hyperframes 0.4.43 → 0.4.44
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 +1444 -393
- package/dist/docs/compositions.md +35 -7
- package/dist/hyperframe-runtime.js +30 -20
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +30 -20
- package/dist/skills/hyperframes/SKILL.md +83 -7
- package/dist/skills/hyperframes-cli/SKILL.md +31 -12
- package/dist/studio/assets/{hyperframes-player-vibA20NC.js → hyperframes-player-Cd8vYWxP.js} +2 -2
- package/dist/studio/assets/{index-Dzq4sUj7.js → index-DpPtpTye.js} +16 -16
- package/dist/studio/index.html +1 -1
- package/package.json +4 -2
package/dist/cli.js
CHANGED
|
@@ -54,7 +54,7 @@ var VERSION;
|
|
|
54
54
|
var init_version = __esm({
|
|
55
55
|
"src/version.ts"() {
|
|
56
56
|
"use strict";
|
|
57
|
-
VERSION = true ? "0.4.
|
|
57
|
+
VERSION = true ? "0.4.44" : "0.0.0-dev";
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
|
|
@@ -2323,7 +2323,7 @@ function getDefaultStageZoom(resolution) {
|
|
|
2323
2323
|
focusY: height / 2
|
|
2324
2324
|
};
|
|
2325
2325
|
}
|
|
2326
|
-
var CANVAS_DIMENSIONS, TIMELINE_COLORS, DEFAULT_DURATIONS;
|
|
2326
|
+
var CANVAS_DIMENSIONS, COMPOSITION_VARIABLE_TYPES, TIMELINE_COLORS, DEFAULT_DURATIONS;
|
|
2327
2327
|
var init_core_types = __esm({
|
|
2328
2328
|
"../core/src/core.types.ts"() {
|
|
2329
2329
|
"use strict";
|
|
@@ -2331,6 +2331,13 @@ var init_core_types = __esm({
|
|
|
2331
2331
|
landscape: { width: 1920, height: 1080 },
|
|
2332
2332
|
portrait: { width: 1080, height: 1920 }
|
|
2333
2333
|
};
|
|
2334
|
+
COMPOSITION_VARIABLE_TYPES = [
|
|
2335
|
+
"string",
|
|
2336
|
+
"number",
|
|
2337
|
+
"color",
|
|
2338
|
+
"boolean",
|
|
2339
|
+
"enum"
|
|
2340
|
+
];
|
|
2334
2341
|
TIMELINE_COLORS = {
|
|
2335
2342
|
video: "#ec4899",
|
|
2336
2343
|
image: "#3b82f6",
|
|
@@ -4128,6 +4135,16 @@ function extractBlocks(source, pattern) {
|
|
|
4128
4135
|
}
|
|
4129
4136
|
return blocks;
|
|
4130
4137
|
}
|
|
4138
|
+
function findHtmlTag(source) {
|
|
4139
|
+
const match = /<html\b([^<>]*)>/i.exec(source);
|
|
4140
|
+
if (!match) return null;
|
|
4141
|
+
return {
|
|
4142
|
+
raw: match[0],
|
|
4143
|
+
name: "html",
|
|
4144
|
+
attrs: match[1] ?? "",
|
|
4145
|
+
index: match.index
|
|
4146
|
+
};
|
|
4147
|
+
}
|
|
4131
4148
|
function findRootTag(source) {
|
|
4132
4149
|
const bodyOpenMatch = /<body\b[^>]*>/i.exec(source);
|
|
4133
4150
|
const bodyCloseMatch = /<\/body>/i.exec(source);
|
|
@@ -4147,6 +4164,13 @@ function readAttr(tagSource, attr) {
|
|
|
4147
4164
|
const match = tagSource.match(new RegExp(`\\b${escaped}\\s*=\\s*["']([^"']+)["']`, "i"));
|
|
4148
4165
|
return match?.[1] || null;
|
|
4149
4166
|
}
|
|
4167
|
+
function readJsonAttr(tagSource, attr) {
|
|
4168
|
+
if (!tagSource) return null;
|
|
4169
|
+
const escaped = attr.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4170
|
+
const match = tagSource.match(new RegExp(`\\b${escaped}\\s*=\\s*(?:"([^"]*)"|'([^']*)')`, "i"));
|
|
4171
|
+
if (!match) return null;
|
|
4172
|
+
return match[1] ?? match[2] ?? null;
|
|
4173
|
+
}
|
|
4150
4174
|
function collectCompositionIds(tags) {
|
|
4151
4175
|
const ids = /* @__PURE__ */ new Set();
|
|
4152
4176
|
for (const tag of tags) {
|
|
@@ -5790,6 +5814,7 @@ var init_composition = __esm({
|
|
|
5790
5814
|
"../core/src/lint/rules/composition.ts"() {
|
|
5791
5815
|
"use strict";
|
|
5792
5816
|
init_utils();
|
|
5817
|
+
init_core_types();
|
|
5793
5818
|
MAX_COMPOSITION_LINES = 300;
|
|
5794
5819
|
MAX_TIMED_ELEMENTS_PER_TRACK = 3;
|
|
5795
5820
|
TRACK_DENSITY_EXEMPT_TAGS = /* @__PURE__ */ new Set(["audio", "script", "style", "video"]);
|
|
@@ -6087,6 +6112,110 @@ var init_composition = __esm({
|
|
|
6087
6112
|
}
|
|
6088
6113
|
}
|
|
6089
6114
|
return findings;
|
|
6115
|
+
},
|
|
6116
|
+
// invalid_variable_values_json
|
|
6117
|
+
// Host elements (`[data-composition-src]`) carry per-instance values via
|
|
6118
|
+
// `data-variable-values`. The runtime swallows JSON errors silently and
|
|
6119
|
+
// falls back to declared defaults, which masks typos. This rule surfaces
|
|
6120
|
+
// the parse failure so authors notice before render time.
|
|
6121
|
+
({ tags }) => {
|
|
6122
|
+
const findings = [];
|
|
6123
|
+
for (const tag of tags) {
|
|
6124
|
+
const raw = readJsonAttr(tag.raw, "data-variable-values");
|
|
6125
|
+
if (!raw) continue;
|
|
6126
|
+
let parsed;
|
|
6127
|
+
try {
|
|
6128
|
+
parsed = JSON.parse(raw);
|
|
6129
|
+
} catch (err) {
|
|
6130
|
+
const reason = err instanceof Error ? err.message : "unknown";
|
|
6131
|
+
findings.push({
|
|
6132
|
+
code: "invalid_variable_values_json",
|
|
6133
|
+
severity: "warning",
|
|
6134
|
+
message: `data-variable-values is not valid JSON (${reason}).`,
|
|
6135
|
+
fixHint: `Wrap the attribute value in single quotes and the JSON keys/values in double quotes, e.g. data-variable-values='{"title":"Hello"}'.`,
|
|
6136
|
+
elementId: readAttr(tag.raw, "id") || void 0,
|
|
6137
|
+
snippet: truncateSnippet(tag.raw)
|
|
6138
|
+
});
|
|
6139
|
+
continue;
|
|
6140
|
+
}
|
|
6141
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
6142
|
+
findings.push({
|
|
6143
|
+
code: "invalid_variable_values_json",
|
|
6144
|
+
severity: "warning",
|
|
6145
|
+
message: 'data-variable-values must be a JSON object keyed by variable id (e.g. {"title":"Hello"}).',
|
|
6146
|
+
fixHint: "Replace the value with a JSON object whose keys are variable ids declared in the sub-composition's data-composition-variables.",
|
|
6147
|
+
elementId: readAttr(tag.raw, "id") || void 0,
|
|
6148
|
+
snippet: truncateSnippet(tag.raw)
|
|
6149
|
+
});
|
|
6150
|
+
}
|
|
6151
|
+
}
|
|
6152
|
+
return findings;
|
|
6153
|
+
},
|
|
6154
|
+
// invalid_composition_variables_declaration
|
|
6155
|
+
// The runtime parses `data-composition-variables` and silently returns []
|
|
6156
|
+
// on any structural problem. Surface JSON / shape failures so authors
|
|
6157
|
+
// catch them at lint time rather than wondering why their `getVariables()`
|
|
6158
|
+
// defaults aren't applied.
|
|
6159
|
+
({ source }) => {
|
|
6160
|
+
const htmlTag = findHtmlTag(source);
|
|
6161
|
+
if (!htmlTag) return [];
|
|
6162
|
+
const raw = readJsonAttr(htmlTag.raw, "data-composition-variables");
|
|
6163
|
+
if (!raw) return [];
|
|
6164
|
+
let parsed;
|
|
6165
|
+
try {
|
|
6166
|
+
parsed = JSON.parse(raw);
|
|
6167
|
+
} catch (err) {
|
|
6168
|
+
const reason = err instanceof Error ? err.message : "unknown";
|
|
6169
|
+
return [
|
|
6170
|
+
{
|
|
6171
|
+
code: "invalid_composition_variables_declaration",
|
|
6172
|
+
severity: "warning",
|
|
6173
|
+
message: `data-composition-variables is not valid JSON (${reason}).`,
|
|
6174
|
+
fixHint: `Provide a JSON array of variable declarations: data-composition-variables='[{"id":"title","type":"string","label":"Title","default":"Hello"}]'.`,
|
|
6175
|
+
snippet: truncateSnippet(htmlTag.raw)
|
|
6176
|
+
}
|
|
6177
|
+
];
|
|
6178
|
+
}
|
|
6179
|
+
if (!Array.isArray(parsed)) {
|
|
6180
|
+
return [
|
|
6181
|
+
{
|
|
6182
|
+
code: "invalid_composition_variables_declaration",
|
|
6183
|
+
severity: "warning",
|
|
6184
|
+
message: "data-composition-variables must be a JSON array of variable declarations.",
|
|
6185
|
+
fixHint: `Wrap declarations in [] and give each an id, type, label, and default: '[{"id":"title","type":"string","label":"Title","default":"Hello"}]'.`,
|
|
6186
|
+
snippet: truncateSnippet(htmlTag.raw)
|
|
6187
|
+
}
|
|
6188
|
+
];
|
|
6189
|
+
}
|
|
6190
|
+
const findings = [];
|
|
6191
|
+
const knownTypes = new Set(COMPOSITION_VARIABLE_TYPES);
|
|
6192
|
+
for (let i2 = 0; i2 < parsed.length; i2 += 1) {
|
|
6193
|
+
const entry = parsed[i2];
|
|
6194
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
|
|
6195
|
+
findings.push({
|
|
6196
|
+
code: "invalid_composition_variables_declaration",
|
|
6197
|
+
severity: "warning",
|
|
6198
|
+
message: `data-composition-variables entry [${i2}] must be an object with id, type, label, and default.`,
|
|
6199
|
+
snippet: truncateSnippet(htmlTag.raw)
|
|
6200
|
+
});
|
|
6201
|
+
continue;
|
|
6202
|
+
}
|
|
6203
|
+
const e2 = entry;
|
|
6204
|
+
const missing = [];
|
|
6205
|
+
if (typeof e2.id !== "string") missing.push("id");
|
|
6206
|
+
if (typeof e2.type !== "string" || !knownTypes.has(e2.type)) missing.push("type");
|
|
6207
|
+
if (typeof e2.label !== "string") missing.push("label");
|
|
6208
|
+
if (!("default" in e2)) missing.push("default");
|
|
6209
|
+
if (missing.length > 0) {
|
|
6210
|
+
findings.push({
|
|
6211
|
+
code: "invalid_composition_variables_declaration",
|
|
6212
|
+
severity: "warning",
|
|
6213
|
+
message: `data-composition-variables entry [${i2}] is missing or has invalid: ${missing.join(", ")}. Type must be one of string, number, color, boolean, enum.`,
|
|
6214
|
+
snippet: truncateSnippet(htmlTag.raw)
|
|
6215
|
+
});
|
|
6216
|
+
}
|
|
6217
|
+
}
|
|
6218
|
+
return findings;
|
|
6090
6219
|
}
|
|
6091
6220
|
];
|
|
6092
6221
|
}
|
|
@@ -6409,7 +6538,7 @@ var RUNTIME_IIFE;
|
|
|
6409
6538
|
var init_runtime_inline = __esm({
|
|
6410
6539
|
"../core/src/generated/runtime-inline.ts"() {
|
|
6411
6540
|
"use strict";
|
|
6412
|
-
RUNTIME_IIFE = '"use strict";(()=>{var Mo=Object.create;var Qn=Object.defineProperty;var ko=Object.getOwnPropertyDescriptor;var Do=Object.getOwnPropertyNames;var Lo=Object.getPrototypeOf,To=Object.prototype.hasOwnProperty;var K=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Ro=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Do(e))!To.call(n,r)&&r!==t&&Qn(n,r,{get:()=>e[r],enumerable:!(i=ko(e,r))||i.enumerable});return n};var vo=(n,e,t)=>(t=n!=null?Mo(Lo(n)):{},Ro(e||!n||!n.__esModule?Qn(t,"default",{value:n,enumerable:!0}):t,n));var yi=K((eu,an)=>{var q=String,gi=function(){return{isColorSupported:!1,reset:q,bold:q,dim:q,italic:q,underline:q,inverse:q,hidden:q,strikethrough:q,black:q,red:q,green:q,yellow:q,blue:q,magenta:q,cyan:q,white:q,gray:q,bgBlack:q,bgRed:q,bgGreen:q,bgYellow:q,bgBlue:q,bgMagenta:q,bgCyan:q,bgWhite:q,blackBright:q,redBright:q,greenBright:q,yellowBright:q,blueBright:q,magentaBright:q,cyanBright:q,whiteBright:q,bgBlackBright:q,bgRedBright:q,bgGreenBright:q,bgYellowBright:q,bgBlueBright:q,bgMagentaBright:q,bgCyanBright:q,bgWhiteBright:q}};an.exports=gi();an.exports.createColors=gi});var un=K(()=>{});var Lt=K((iu,Ei)=>{"use strict";var Si=yi(),Ai=un(),st=class n extends Error{constructor(e,t,i,r,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),r&&(this.source=r),s&&(this.plugin=s),typeof t<"u"&&typeof i<"u"&&(typeof t=="number"?(this.line=t,this.column=i):(this.line=t.line,this.column=t.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}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(e){if(!this.source)return"";let t=this.source;e==null&&(e=Si.isColorSupported);let i=l=>l,r=l=>l,o=l=>l;if(e){let{bold:l,gray:f,red:m}=Si.createColors(!0);r=h=>l(m(h)),i=h=>f(h),Ai&&(o=h=>Ai(h))}let s=t.split(/\\r?\\n/),c=Math.max(this.line-3,0),u=Math.min(this.line+2,s.length),a=String(u).length;return s.slice(c,u).map((l,f)=>{let m=c+1+f,h=" "+(" "+m).slice(-a)+" | ";if(m===this.line){if(l.length>160){let C=20,A=Math.max(0,this.column-C),z=Math.max(this.column+C,this.endColumn+C),O=l.slice(A,z),D=i(h.replace(/\\d/g," "))+l.slice(0,Math.min(this.column-1,C-1)).replace(/[^\\t]/g," ");return r(">")+i(h)+o(O)+`\n `+D+r("^")}let M=i(h.replace(/\\d/g," "))+l.slice(0,this.column-1).replace(/[^\\t]/g," ");return r(">")+i(h)+o(l)+`\n `+M+r("^")}return" "+i(h)+o(l)}).join(`\n`)}toString(){let e=this.showSourceCode();return e&&(e=`\n\n`+e+`\n`),this.name+": "+this.message+e}};Ei.exports=st;st.default=st});var cn=K((ru,bi)=>{"use strict";var Fi={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Zo(n){return n[0].toUpperCase()+n.slice(1)}var lt=class{constructor(e){this.builder=e}atrule(e,t){let i="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?i+=e.raws.afterName:r&&(i+=" "),e.nodes)this.block(e,i+r);else{let o=(e.raws.between||"")+(t?";":"");this.builder(i+r+o,e)}}beforeAfter(e,t){let i;e.type==="decl"?i=this.raw(e,null,"beforeDecl"):e.type==="comment"?i=this.raw(e,null,"beforeComment"):t==="before"?i=this.raw(e,null,"beforeRule"):i=this.raw(e,null,"beforeClose");let r=e.parent,o=0;for(;r&&r.type!=="root";)o+=1,r=r.parent;if(i.includes(`\n`)){let s=this.raw(e,null,"indent");if(s.length)for(let c=0;c<o;c++)i+=s}return i}block(e,t){let i=this.raw(e,"between","beforeOpen");this.builder(t+i+"{",e,"start");let r;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let i=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let o=e.nodes[r],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,t!==r||i)}}comment(e){let t=this.raw(e,"left","commentLeft"),i=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+i+"*/",e)}decl(e,t){let i=this.raw(e,"between","colon"),r=e.prop+i+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,i){let r;if(i||(i=t),t&&(r=e.raws[t],typeof r<"u"))return r;let o=e.parent;if(i==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return Fi[i];let s=e.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[i]<"u")return s.rawCache[i];if(i==="before"||i==="after")return this.beforeAfter(e,i);{let c="raw"+Zo(i);this[c]?r=this[c](s,e):s.walk(u=>{if(r=u.raws[t],typeof r<"u")return!1})}return typeof r>"u"&&(r=Fi[i]),s.rawCache[i]=r,r}rawBeforeClose(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return t=i.raws.after,t.includes(`\n`)&&(t=t.replace(/[^\\n]+$/,"")),!1}),t&&(t=t.replace(/\\S/g,"")),t}rawBeforeComment(e,t){let i;return e.walkComments(r=>{if(typeof r.raws.before<"u")return i=r.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(t,null,"beforeDecl"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeDecl(e,t){let i;return e.walkDecls(r=>{if(typeof r.raws.before<"u")return i=r.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(t,null,"beforeRule"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeOpen(e){let t;return e.walk(i=>{if(i.type!=="decl"&&(t=i.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(i=>{if(i.nodes&&(i.parent!==e||e.first!==i)&&typeof i.raws.before<"u")return t=i.raws.before,t.includes(`\n`)&&(t=t.replace(/[^\\n]+$/,"")),!1}),t&&(t=t.replace(/\\S/g,"")),t}rawColon(e){let t;return e.walkDecls(i=>{if(typeof i.raws.between<"u")return t=i.raws.between.replace(/[^\\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length===0&&(t=i.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(i=>{let r=i.parent;if(r&&r!==e&&r.parent&&r.parent===e&&typeof i.raws.before<"u"){let o=i.raws.before.split(`\n`);return t=o[o.length-1],t=t.replace(/\\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(t=i.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let i=e[t],r=e.raws[t];return r&&r.value===i?r.raw:i}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};bi.exports=lt;lt.default=lt});var at=K((ou,Ni)=>{"use strict";var Xo=cn();function dn(n,e){new Xo(e).stringify(n)}Ni.exports=dn;dn.default=dn});var Tt=K((su,fn)=>{"use strict";fn.exports.isClean=Symbol("isClean");fn.exports.my=Symbol("my")});var dt=K((lu,wi)=>{"use strict";var es=Lt(),ts=cn(),ns=at(),{isClean:ut,my:is}=Tt();function mn(n,e){let t=new n.constructor;for(let i in n){if(!Object.prototype.hasOwnProperty.call(n,i)||i==="proxyCache")continue;let r=n[i],o=typeof r;i==="parent"&&o==="object"?e&&(t[i]=e):i==="source"?t[i]=r:Array.isArray(r)?t[i]=r.map(s=>mn(s,t)):(o==="object"&&r!==null&&(r=mn(r)),t[i]=r)}return t}function De(n,e){if(e&&typeof e.offset<"u")return e.offset;let t=1,i=1,r=0;for(let o=0;o<n.length;o++){if(i===e.line&&t===e.column){r=o;break}n[o]===`\n`?(t=1,i+=1):t+=1}return r}var ct=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[ut]=!1,this[is]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let i of e[t])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\\n\\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\\n\\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=mn(this);for(let i in e)t[i]=e[i];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:i,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:i.column,line:i.line},t)}return new es(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,i){return e[t]===i||(e[t]=i,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markClean(){this[ut]=!0}markDirty(){if(this[ut]){this[ut]=!1;let e=this;for(;e=e.parent;)e[ut]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let i="document"in this.source.input?this.source.input.document:this.source.input.css,o=i.slice(De(i,this.source.start),De(i,this.source.end)).indexOf(e.word);o!==-1&&(t=this.positionInside(o))}return t}positionInside(e){let t=this.source.start.column,i=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,o=De(r,this.source.start),s=o+e;for(let c=o;c<s;c++)r[c]===`\n`?(t=1,i+=1):t+=1;return{column:t,line:i,offset:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,i={column:this.source.start.column,line:this.source.start.line,offset:De(t,this.source.start)},r=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:De(t,this.source.end)+1}:{column:i.column+1,line:i.line,offset:i.offset+1};if(e.word){let s=t.slice(De(t,this.source.start),De(t,this.source.end)).indexOf(e.word);s!==-1&&(i=this.positionInside(s),r=this.positionInside(s+e.word.length))}else e.start?i={column:e.start.column,line:e.start.line,offset:De(t,e.start)}:e.index&&(i=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line,offset:De(t,e.end)}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<i.line||r.line===i.line&&r.column<=i.column)&&(r={column:i.column+1,line:i.line,offset:i.offset+1}),{end:r,start:i}}raw(e,t){return new ts().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,i=!1;for(let r of e)r===this?i=!0:i?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);i||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let i={},r=t==null;t=t||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let c=this[s];if(Array.isArray(c))i[s]=c.map(u=>typeof u=="object"&&u.toJSON?u.toJSON(null,t):u);else if(typeof c=="object"&&c.toJSON)i[s]=c.toJSON(null,t);else if(s==="source"){if(c==null)continue;let u=t.get(c.input);u==null&&(u=o,t.set(c.input,o),o++),i[s]={end:c.end,inputId:u,start:c.start}}else i[s]=c}return r&&(i.inputs=[...t.keys()].map(s=>s.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ns){e.stringify&&(e=e.stringify);let t="";return e(this,i=>{t+=i}),t}warn(e,t,i={}){let r={node:this};for(let o in i)r[o]=i[o];return e.warn(t,r)}};wi.exports=ct;ct.default=ct});var mt=K((au,Ci)=>{"use strict";var rs=dt(),ft=class extends rs{constructor(e){super(e),this.type="comment"}};Ci.exports=ft;ft.default=ft});var ht=K((uu,Mi)=>{"use strict";var os=dt(),pt=class extends os{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}};Mi.exports=pt;pt.default=pt});var ve=K((cu,Oi)=>{"use strict";var ki=mt(),Di=ht(),ss=dt(),{isClean:Li,my:Ti}=Tt(),pn,Ri,vi,hn;function Bi(n){return n.map(e=>(e.nodes&&(e.nodes=Bi(e.nodes)),delete e.source,e))}function _i(n){if(n[Li]=!1,n.proxyOf.nodes)for(let e of n.proxyOf.nodes)_i(e)}var Ce=class n extends ss{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(...e){for(let t of e){let i=this.normalize(t,this.last);for(let r of i)this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),i,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(i=this.indexes[t],r=e(this.proxyOf.nodes[i],i),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...i)=>e[t](...i.map(r=>typeof r=="function"?(o,s)=>r(o.toProxy(),s):r)):t==="every"||t==="some"?i=>e[t]((r,...o)=>i(r.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(i=>i.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,i){return e[t]===i||(e[t]=i,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let i=this.index(e),r=this.normalize(t,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(let s of r)this.proxyOf.nodes.splice(i+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],i<o&&(this.indexes[s]=o+r.length);return this.markDirty(),this}insertBefore(e,t){let i=this.index(e),r=i===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[i],r).reverse();i=this.index(e);for(let c of o)this.proxyOf.nodes.splice(i,0,c);let s;for(let c in this.indexes)s=this.indexes[c],i<=s&&(this.indexes[c]=s+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Bi(Ri(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Di(e)]}else if(e.selector||e.selectors)e=[new hn(e)];else if(e.name)e=[new pn(e)];else if(e.text)e=[new ki(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[Ti]||n.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[Li]&&_i(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(r.raws.before=t.raws.before.replace(/\\S/g,"")),r.parent=this.proxyOf,r))}prepend(...e){e=e.reverse();for(let t of e){let i=this.normalize(t,this.first,"prepend").reverse();for(let r of i)this.proxyOf.nodes.unshift(r);for(let r in this.indexes)this.indexes[r]=this.indexes[r]+i.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let i in this.indexes)t=this.indexes[i],t>=e&&(this.indexes[i]=t-1);return this.markDirty(),this}replaceValues(e,t,i){return i||(i=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,i))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,i)=>{let r;try{r=e(t,i)}catch(o){throw t.addToError(o)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="atrule"&&e.test(i.name))return t(i,r)}):this.walk((i,r)=>{if(i.type==="atrule"&&i.name===e)return t(i,r)}):(t=e,this.walk((i,r)=>{if(i.type==="atrule")return t(i,r)}))}walkComments(e){return this.walk((t,i)=>{if(t.type==="comment")return e(t,i)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="decl"&&e.test(i.prop))return t(i,r)}):this.walk((i,r)=>{if(i.type==="decl"&&i.prop===e)return t(i,r)}):(t=e,this.walk((i,r)=>{if(i.type==="decl")return t(i,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="rule"&&e.test(i.selector))return t(i,r)}):this.walk((i,r)=>{if(i.type==="rule"&&i.selector===e)return t(i,r)}):(t=e,this.walk((i,r)=>{if(i.type==="rule")return t(i,r)}))}};Ce.registerParse=n=>{Ri=n};Ce.registerRule=n=>{hn=n};Ce.registerAtRule=n=>{pn=n};Ce.registerRoot=n=>{vi=n};Oi.exports=Ce;Ce.default=Ce;Ce.rebuild=n=>{n.type==="atrule"?Object.setPrototypeOf(n,pn.prototype):n.type==="rule"?Object.setPrototypeOf(n,hn.prototype):n.type==="decl"?Object.setPrototypeOf(n,Di.prototype):n.type==="comment"?Object.setPrototypeOf(n,ki.prototype):n.type==="root"&&Object.setPrototypeOf(n,vi.prototype),n[Ti]=!0,n.nodes&&n.nodes.forEach(e=>{Ce.rebuild(e)})}});var Rt=K((du,Ii)=>{"use strict";var Pi=ve(),$e=class extends Pi{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};Ii.exports=$e;$e.default=$e;Pi.registerAtRule($e)});var vt=K((fu,Ui)=>{"use strict";var ls=ve(),Wi,Hi,Ue=class extends ls{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Wi(new Hi,this,e).stringify()}};Ue.registerLazyResult=n=>{Wi=n};Ue.registerProcessor=n=>{Hi=n};Ui.exports=Ue;Ue.default=Ue});var zi=K((mu,qi)=>{var as="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",us=(n,e=21)=>(t=e)=>{let i="",r=t|0;for(;r--;)i+=n[Math.random()*n.length|0];return i},cs=(n=21)=>{let e="",t=n|0;for(;t--;)e+=as[Math.random()*64|0];return e};qi.exports={nanoid:cs,customAlphabet:us}});var Bt=K(()=>{});var _t=K(()=>{});var xn=K(()=>{});var ji=K(()=>{});var yn=K((Fu,Vi)=>{"use strict";var{existsSync:ds,readFileSync:fs}=ji(),{dirname:gn,join:ms}=Bt(),{SourceMapConsumer:Gi,SourceMapGenerator:$i}=_t();function ps(n){return Buffer?Buffer.from(n,"base64").toString():window.atob(n)}var xt=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let i=t.map?t.map.prev:void 0,r=this.loadMap(t.from,i);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=gn(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Gi(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\\/json;charset=utf-?8;base64,/,i=/^data:application\\/json;base64,/,r=/^data:application\\/json;charset=utf-?8,/,o=/^data:application\\/json,/,s=e.match(r)||e.match(o);if(s)return decodeURIComponent(e.substr(s[0].length));let c=e.match(t)||e.match(i);if(c)return ps(e.substr(c[0].length));let u=e.match(/data:application\\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+u)}getAnnotationURL(e){return e.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\\/\\*\\s*# sourceMappingURL=/g);if(!t)return;let i=e.lastIndexOf(t.pop()),r=e.indexOf("*/",i);i>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(i,r)))}loadFile(e){if(this.root=gn(e),ds(e))return this.mapFile=e,fs(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let i=t(e);if(i){let r=this.loadFile(i);if(!r)throw new Error("Unable to load previous source map: "+i.toString());return r}}else{if(t instanceof Gi)return $i.fromSourceMap(t).toString();if(t instanceof $i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let i=this.annotation;return e&&(i=ms(gn(e),i)),this.loadFile(i)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};Vi.exports=xt;xt.default=xt});var gt=K((bu,Zi)=>{"use strict";var{nanoid:hs}=zi(),{isAbsolute:En,resolve:Fn}=Bt(),{SourceMapConsumer:xs,SourceMapGenerator:gs}=_t(),{fileURLToPath:Ki,pathToFileURL:Ot}=xn(),Ji=Lt(),ys=yn(),Sn=un(),An=Symbol("lineToIndexCache"),Ss=!!(xs&&gs),Qi=!!(Fn&&En);function Yi(n){if(n[An])return n[An];let e=n.css.split(`\n`),t=new Array(e.length),i=0;for(let r=0,o=e.length;r<o;r++)t[r]=i,i+=e[r].length+1;return n[An]=t,t}var Ve=class{get from(){return this.file||this.id}constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.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,t.document&&(this.document=t.document.toString()),t.from&&(!Qi||/^\\w+:\\/\\//.test(t.from)||En(t.from)?this.file=t.from:this.file=Fn(t.from)),Qi&&Ss){let i=new ys(this.css,t);if(i.text){this.map=i;let r=i.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+hs(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,i,r={}){let o,s,c,u,a;if(t&&typeof t=="object"){let f=t,m=i;if(typeof f.offset=="number"){u=f.offset;let h=this.fromOffset(u);t=h.line,i=h.col}else t=f.line,i=f.column,u=this.fromLineAndColumn(t,i);if(typeof m.offset=="number"){c=m.offset;let h=this.fromOffset(c);s=h.line,o=h.col}else s=m.line,o=m.column,c=this.fromLineAndColumn(m.line,m.column)}else if(i)u=this.fromLineAndColumn(t,i);else{u=t;let f=this.fromOffset(u);t=f.line,i=f.col}let l=this.origin(t,i,s,o);return l?a=new Ji(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,r.plugin):a=new Ji(e,s===void 0?t:{column:i,line:t},s===void 0?i:{column:o,line:s},this.css,this.file,r.plugin),a.input={column:i,endColumn:o,endLine:s,endOffset:c,line:t,offset:u,source:this.css},this.file&&(Ot&&(a.input.url=Ot(this.file).toString()),a.input.file=this.file),a}fromLineAndColumn(e,t){return Yi(this)[e-1]+t-1}fromOffset(e){let t=Yi(this),i=t[t.length-1],r=0;if(e>=i)r=t.length-1;else{let o=t.length-2,s;for(;r<o;)if(s=r+(o-r>>1),e<t[s])o=s-1;else if(e>=t[s+1])r=s+1;else{r=s;break}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\\w+:\\/\\//.test(e)?e:Fn(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,i,r){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:t,line:e});if(!s.source)return!1;let c;typeof i=="number"&&(c=o.originalPositionFor({column:r,line:i}));let u;En(s.source)?u=Ot(s.source):u=new URL(s.source,this.map.consumer().sourceRoot||Ot(this.map.mapFile));let a={column:s.column,endColumn:c&&c.column,endLine:c&&c.line,line:s.line,url:u.toString()};if(u.protocol==="file:")if(Ki)a.file=Ki(u);else throw new Error("file: protocol is not available in this PostCSS build");let l=o.sourceContentFor(s.source);return l&&(a.source=l),a}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};Zi.exports=Ve;Ve.default=Ve;Sn&&Sn.registerInput&&Sn.registerInput(Ve)});var Ke=K((Nu,nr)=>{"use strict";var Xi=ve(),er,tr,Be=class extends Xi{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,i){let r=super.normalize(e);if(t){if(i==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of r)o.raws.before=t.raws.before}return r}removeChild(e,t){let i=this.index(e);return!t&&i===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(e)}toResult(e={}){return new er(new tr,this,e).stringify()}};Be.registerLazyResult=n=>{er=n};Be.registerProcessor=n=>{tr=n};nr.exports=Be;Be.default=Be;Xi.registerRoot(Be)});var bn=K((wu,ir)=>{"use strict";var yt={comma(n){return yt.split(n,[","],!0)},space(n){let e=[" ",`\n`," "];return yt.split(n,e)},split(n,e,t){let i=[],r="",o=!1,s=0,c=!1,u="",a=!1;for(let l of n)a?a=!1:l==="\\\\"?a=!0:c?l===u&&(c=!1):l===\'"\'||l==="\'"?(c=!0,u=l):l==="("?s+=1:l===")"?s>0&&(s-=1):s===0&&e.includes(l)&&(o=!0),o?(r!==""&&i.push(r.trim()),r="",o=!1):r+=l;return(t||r!=="")&&i.push(r.trim()),i}};ir.exports=yt;yt.default=yt});var Pt=K((Cu,or)=>{"use strict";var rr=ve(),As=bn(),Je=class extends rr{get selectors(){return As.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\\s*/):null,i=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(i)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};or.exports=Je;Je.default=Je;rr.registerRule(Je)});var lr=K((Mu,sr)=>{"use strict";var Es=Rt(),Fs=mt(),bs=ht(),Ns=gt(),ws=yn(),Cs=Ke(),Ms=Pt();function St(n,e){if(Array.isArray(n))return n.map(r=>St(r));let{inputs:t,...i}=n;if(t){e=[];for(let r of t){let o={...r,__proto__:Ns.prototype};o.map&&(o.map={...o.map,__proto__:ws.prototype}),e.push(o)}}if(i.nodes&&(i.nodes=n.nodes.map(r=>St(r,e))),i.source){let{inputId:r,...o}=i.source;i.source=o,r!=null&&(i.source.input=e[r])}if(i.type==="root")return new Cs(i);if(i.type==="decl")return new bs(i);if(i.type==="rule")return new Ms(i);if(i.type==="comment")return new Fs(i);if(i.type==="atrule")return new Es(i);throw new Error("Unknown node type: "+n.type)}sr.exports=St;St.default=St});var wn=K((ku,mr)=>{"use strict";var{dirname:It,relative:ur,resolve:cr,sep:dr}=Bt(),{SourceMapConsumer:fr,SourceMapGenerator:Wt}=_t(),{pathToFileURL:ar}=xn(),ks=gt(),Ds=!!(fr&&Wt),Ls=!!(It&&cr&&ur&&dr),Nn=class{constructor(e,t,i,r){this.stringify=e,this.mapOpts=i.map||{},this.root=t,this.opts=i,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`\n`;this.css.includes(`\\r\n`)&&(t=`\\r\n`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),i=e.root||It(e.file),r;this.mapOpts.sourcesContent===!1?(r=new fr(e.text),r.sourcesContent&&(r.sourcesContent=null)):r=e.consumer(),this.map.applySourceMap(r,t,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else if(this.css){let e;for(;(e=this.css.lastIndexOf("/*#"))!==-1;){let t=this.css.indexOf("*/",e+3);if(t===-1)break;for(;e>0&&this.css[e-1]===`\n`;)e--;this.css=this.css.slice(0,e)+this.css.slice(t+2)}}}}generate(){if(this.clearAnnotation(),Ls&&Ds&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Wt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Wt({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 Wt({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,i="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(c,u,a)=>{if(this.css+=c,u&&a!=="end"&&(r.generated.line=e,r.generated.column=t-1,u.source&&u.source.start?(r.source=this.sourcePath(u),r.original.line=u.source.start.line,r.original.column=u.source.start.column-1,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,this.map.addMapping(r))),s=c.match(/\\n/g),s?(e+=s.length,o=c.lastIndexOf(`\n`),t=c.length-o):t+=c.length,u&&a!=="start"){let l=u.parent||{raws:{}};(!(u.type==="decl"||u.type==="atrule"&&!u.nodes)||u!==l.last||l.raws.semicolon)&&(u.source&&u.source.end?(r.source=this.sourcePath(u),r.original.line=u.source.end.line,r.original.column=u.source.end.column-1,r.generated.line=e,r.generated.column=t-2,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,r.generated.line=e,r.generated.column=t-1,this.map.addMapping(r)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.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(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\\w+:\\/\\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let i=this.opts.to?It(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=It(cr(i,this.mapOpts.annotation)));let r=ur(i,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new ks(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let i=t.source.input.from;if(i&&!e[i]){e[i]=!0;let r=this.usesFileUrls?this.toFileUrl(i):this.toUrl(this.path(i));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(ar){let i=ar(e).toString();return this.memoizedFileURLs.set(e,i),i}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;dr==="\\\\"&&(e=e.replace(/\\\\/g,"/"));let i=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,i),i}};mr.exports=Nn});var xr=K((Du,hr)=>{"use strict";var Ht=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,Ut=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,Ts=/.[\\r\\n"\'(/\\\\]/,pr=/[\\da-f]/i;hr.exports=function(e,t={}){let i=e.css.valueOf(),r=t.ignoreErrors,o,s,c,u,a,l,f,m,h,M,C=i.length,A=0,z=[],O=[];function D(){return A}function Y(F){throw e.error("Unclosed "+F,A)}function S(){return O.length===0&&A>=C}function p(F){if(O.length)return O.pop();if(A>=C)return;let b=F?F.ignoreUnclosed:!1;switch(o=i.charCodeAt(A),o){case 10:case 32:case 9:case 13:case 12:{u=A;do u+=1,o=i.charCodeAt(u);while(o===32||o===10||o===9||o===13||o===12);l=["space",i.slice(A,u)],A=u-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let N=String.fromCharCode(o);l=[N,N,A];break}case 40:{if(M=z.length?z.pop()[1]:"",h=i.charCodeAt(A+1),M==="url"&&h!==39&&h!==34&&h!==32&&h!==10&&h!==9&&h!==12&&h!==13){u=A;do{if(f=!1,u=i.indexOf(")",u+1),u===-1)if(r||b){u=A;break}else Y("bracket");for(m=u;i.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);l=["brackets",i.slice(A,u+1),A,u],A=u}else u=i.indexOf(")",A+1),s=i.slice(A,u+1),u===-1||Ts.test(s)?l=["(","(",A]:(l=["brackets",s,A,u],A=u);break}case 39:case 34:{a=o===39?"\'":\'"\',u=A;do{if(f=!1,u=i.indexOf(a,u+1),u===-1)if(r||b){u=A+1;break}else Y("string");for(m=u;i.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);l=["string",i.slice(A,u+1),A,u],A=u;break}case 64:{Ht.lastIndex=A+1,Ht.test(i),Ht.lastIndex===0?u=i.length-1:u=Ht.lastIndex-2,l=["at-word",i.slice(A,u+1),A,u],A=u;break}case 92:{for(u=A,c=!0;i.charCodeAt(u+1)===92;)u+=1,c=!c;if(o=i.charCodeAt(u+1),c&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(u+=1,pr.test(i.charAt(u)))){for(;pr.test(i.charAt(u+1));)u+=1;i.charCodeAt(u+1)===32&&(u+=1)}l=["word",i.slice(A,u+1),A,u],A=u;break}default:{o===47&&i.charCodeAt(A+1)===42?(u=i.indexOf("*/",A+2)+1,u===0&&(r||b?u=i.length:Y("comment")),l=["comment",i.slice(A,u+1),A,u],A=u):(Ut.lastIndex=A+1,Ut.test(i),Ut.lastIndex===0?u=i.length-1:u=Ut.lastIndex-2,l=["word",i.slice(A,u+1),A,u],z.push(l),A=u);break}}return A++,l}function y(F){O.push(F)}return{back:y,endOfFile:S,nextToken:p,position:D}}});var Ar=K((Lu,Sr)=>{"use strict";var Rs=Rt(),vs=mt(),Bs=ht(),_s=Ke(),gr=Pt(),Os=xr(),yr={empty:!0,space:!0};function Ps(n){for(let e=n.length-1;e>=0;e--){let t=n[e],i=t[3]||t[2];if(i)return i}}var Cn=class{constructor(e){this.input=e,this.root=new _s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new Rs;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let i,r,o,s=!1,c=!1,u=[],a=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),i=e[0],i==="("||i==="["?a.push(i==="("?")":"]"):i==="{"&&a.length>0?a.push("}"):i===a[a.length-1]&&a.pop(),a.length===0)if(i===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){c=!0;break}else if(i==="}"){if(u.length>0){for(o=u.length-1,r=u[o];r&&r[0]==="space";)r=u[--o];r&&(t.source.end=this.getPosition(r[3]||r[2]),t.source.end.offset++)}this.end(e);break}else u.push(e);else u.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(u),u.length?(t.raws.afterName=this.spacesAndCommentsFromStart(u),this.raw(t,"params",u),s&&(e=u[u.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),c&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let i=0,r;for(let o=t-1;o>=0&&(r=e[o],!(r[0]!=="space"&&(i+=1,i===2)));o--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(e){let t=0,i,r,o;for(let[s,c]of e.entries()){if(r=c,o=r[0],o==="("&&(t+=1),o===")"&&(t-=1),t===0&&o===":")if(!i)this.doubleColon(r);else{if(i[0]==="word"&&i[1]==="progid")continue;return s}i=r}return!1}comment(e){let t=new vs;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let i=e[1].slice(2,-2);if(!i.trim())t.text="",t.raws.left=i,t.raws.right="";else{let r=i.match(/^(\\s*)([^]*\\S)(\\s*)$/);t.text=r[2],t.raws.left=r[1],t.raws.right=r[3]}}createTokenizer(){this.tokenizer=Os(this.input)}decl(e,t){let i=new Bs;this.init(i,e[0][2]);let r=e[e.length-1];for(r[0]===";"&&(this.semicolon=!0,e.pop()),i.source.end=this.getPosition(r[3]||r[2]||Ps(e)),i.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),i.raws.before+=e.shift()[1];for(i.source.start=this.getPosition(e[0][2]),i.prop="";e.length;){let a=e[0][0];if(a===":"||a==="space"||a==="comment")break;i.prop+=e.shift()[1]}i.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){i.raws.between+=o[1];break}else o[0]==="word"&&/\\w/.test(o[1])&&this.unknownWord([o]),i.raws.between+=o[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let s=[],c;for(;e.length&&(c=e[0][0],!(c!=="space"&&c!=="comment"));)s.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(o=e[a],o[1].toLowerCase()==="!important"){i.important=!0;let l=this.stringFrom(e,a);l=this.spacesFromEnd(e)+l,l!==" !important"&&(i.raws.important=l);break}else if(o[1].toLowerCase()==="important"){let l=e.slice(0),f="";for(let m=a;m>0;m--){let h=l[m][0];if(f.trim().startsWith("!")&&h!=="space")break;f=l.pop()[1]+f}f.trim().startsWith("!")&&(i.important=!0,i.raws.important=f,e=l)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(a=>a[0]!=="space"&&a[0]!=="comment")&&(i.raws.between+=s.map(a=>a[1]).join(""),s=[]),this.raw(i,"value",s.concat(e),t),i.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new gr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){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(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}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(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,i=null,r=!1,o=null,s=[],c=e[1].startsWith("--"),u=[],a=e;for(;a;){if(i=a[0],u.push(a),i==="("||i==="[")o||(o=a),s.push(i==="("?")":"]");else if(c&&r&&i==="{")o||(o=a),s.push("}");else if(s.length===0)if(i===";")if(r){this.decl(u,c);return}else break;else if(i==="{"){this.rule(u);return}else if(i==="}"){this.tokenizer.back(u.pop()),t=!0;break}else i===":"&&(r=!0);else i===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),s.length>0&&this.unclosedBracket(o),t&&r){if(!c)for(;u.length&&(a=u[u.length-1][0],!(a!=="space"&&a!=="comment"));)this.tokenizer.back(u.pop());this.decl(u,c)}else this.unknownWord(u)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,i,r){let o,s,c=i.length,u="",a=!0,l,f;for(let m=0;m<c;m+=1)o=i[m],s=o[0],s==="space"&&m===c-1&&!r?a=!1:s==="comment"?(f=i[m-1]?i[m-1][0]:"empty",l=i[m+1]?i[m+1][0]:"empty",!yr[f]&&!yr[l]?u.slice(-1)===","?a=!1:u+=o[1]:a=!1):u+=o[1];if(!a){let m=i.reduce((h,M)=>h+M[1],"");e.raws[t]={raw:m,value:u}}e[t]=u}rule(e){e.pop();let t=new gr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,i="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)i=e.pop()[1]+i;return i}spacesAndCommentsFromStart(e){let t,i="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)i+=e.shift()[1];return i}spacesFromEnd(e){let t,i="";for(;e.length&&(t=e[e.length-1][0],t==="space");)i=e.pop()[1]+i;return i}stringFrom(e,t){let i="";for(let r=t;r<e.length;r++)i+=e[r][1];return e.splice(t,e.length-t),i}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};Sr.exports=Cn});var zt=K((Tu,Er)=>{"use strict";var Is=ve(),Ws=gt(),Hs=Ar();function qt(n,e){let t=new Ws(n,e),i=new Hs(t);try{i.parse()}catch(r){throw r}return i.root}Er.exports=qt;qt.default=qt;Is.registerParse(qt)});var Mn=K((Ru,Fr)=>{"use strict";var At=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let i=t.node.rangeBy(t);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in t)this[i]=t[i]}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}};Fr.exports=At;At.default=At});var jt=K((vu,br)=>{"use strict";var Us=Mn(),Et=class{get content(){return this.css}constructor(e,t,i){this.processor=e,this.messages=[],this.root=t,this.opts=i,this.css="",this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let i=new Us(e,t);return this.messages.push(i),i}warnings(){return this.messages.filter(e=>e.type==="warning")}};br.exports=Et;Et.default=Et});var kn=K((Bu,wr)=>{"use strict";var Nr={};wr.exports=function(e){Nr[e]||(Nr[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))}});var Tn=K((Ou,Dr)=>{"use strict";var qs=ve(),zs=vt(),js=wn(),Gs=zt(),Cr=jt(),$s=Ke(),Vs=at(),{isClean:ke,my:Ks}=Tt(),_u=kn(),Js={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Qs={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},Ys={Once:!0,postcssPlugin:!0,prepare:!0},Qe=0;function Ft(n){return typeof n=="object"&&typeof n.then=="function"}function kr(n){let e=!1,t=Js[n.type];return n.type==="decl"?e=n.prop.toLowerCase():n.type==="atrule"&&(e=n.name.toLowerCase()),e&&n.append?[t,t+"-"+e,Qe,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:n.append?[t,Qe,t+"Exit"]:[t,t+"Exit"]}function Mr(n){let e;return n.type==="document"?e=["Document",Qe,"DocumentExit"]:n.type==="root"?e=["Root",Qe,"RootExit"]:e=kr(n),{eventIndex:0,events:e,iterator:0,node:n,visitorIndex:0,visitors:[]}}function Dn(n){return n[ke]=!1,n.nodes&&n.nodes.forEach(e=>Dn(e)),n}var Ln={},_e=class n{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(e,t,i){this.stringified=!1,this.processed=!1;let r;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))r=Dn(t);else if(t instanceof n||t instanceof Cr)r=Dn(t.root),t.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=t.map);else{let o=Gs;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{r=o(t,i)}catch(s){this.processed=!0,this.error=s}r&&!r[Ks]&&qs.rebuild(r)}this.result=new Cr(e,r,i),this.helpers={...Ln,postcss:Ln,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(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let i=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=i.postcssPlugin,e.setMessage()):i.postcssVersion}catch(r){console&&console.error&&console.error(r)}return e}prepareVisitors(){this.listeners={};let e=(t,i,r)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([t,r])};for(let t of this.plugins)if(typeof t=="object")for(let i in t){if(!Qs[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Ys[i])if(typeof t[i]=="object")for(let r in t[i])r==="*"?e(t,i,t[i][r]):e(t,i+"-"+r.toLowerCase(),t[i][r]);else typeof t[i]=="function"&&e(t,i,t[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],i=this.runOnRoot(t);if(Ft(i))try{await i}catch(r){throw this.handleError(r)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ke];){e[ke]=!0;let t=[Mr(e)];for(;t.length>0;){let i=this.visitTick(t);if(Ft(i))try{await i}catch(r){let o=t[t.length-1].node;throw this.handleError(r,o)}}}if(this.listeners.OnceExit)for(let[t,i]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let r=e.nodes.map(o=>i(o,this.helpers));await Promise.all(r)}else await i(e,this.helpers)}catch(r){throw this.handleError(r)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(i=>e.Once(i,this.helpers));return Ft(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Vs;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new js(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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 e of this.plugins){let t=this.runOnRoot(e);if(Ft(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ke];)e[ke]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[i,r]of e){this.result.lastPlugin=i;let o;try{o=r(t,this.helpers)}catch(s){throw this.handleError(s,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(Ft(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:i,visitors:r}=t;if(i.type!=="root"&&i.type!=="document"&&!i.parent){e.pop();return}if(r.length>0&&t.visitorIndex<r.length){let[s,c]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=s;try{return c(i.toProxy(),this.helpers)}catch(u){throw this.handleError(u,i)}}if(t.iterator!==0){let s=t.iterator,c;for(;c=i.nodes[i.indexes[s]];)if(i.indexes[s]+=1,!c[ke]){c[ke]=!0,e.push(Mr(c));return}t.iterator=0,delete i.indexes[s]}let o=t.events;for(;t.eventIndex<o.length;){let s=o[t.eventIndex];if(t.eventIndex+=1,s===Qe){i.nodes&&i.nodes.length&&(i[ke]=!0,t.iterator=i.getIterator());return}else if(this.listeners[s]){t.visitors=this.listeners[s];return}}e.pop()}walkSync(e){e[ke]=!0;let t=kr(e);for(let i of t)if(i===Qe)e.nodes&&e.each(r=>{r[ke]||this.walkSync(r)});else{let r=this.listeners[i];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}};_e.registerPostcss=n=>{Ln=n};Dr.exports=_e;_e.default=_e;$s.registerLazyResult(_e);zs.registerLazyResult(_e)});var Tr=K((Iu,Lr)=>{"use strict";var Zs=wn(),Xs=zt(),el=jt(),tl=at(),Pu=kn(),bt=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 e,t=Xs;try{e=t(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,i){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=i,this._map=void 0;let r=tl;this.result=new el(this._processor,void 0,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let s=new Zs(r,void 0,this._opts,t);if(s.isMap()){let[c,u]=s.generate();c&&(this.result.css=c),u&&(this.result.map=u)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}};Lr.exports=bt;bt.default=bt});var vr=K((Wu,Rr)=>{"use strict";var nl=vt(),il=Tn(),rl=Tr(),ol=Ke(),qe=class{constructor(e=[]){this.version="8.5.8",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let i of e)if(i.postcss===!0?i=i():i.postcss&&(i=i.postcss),typeof i=="object"&&Array.isArray(i.plugins))t=t.concat(i.plugins);else if(typeof i=="object"&&i.postcssPlugin)t.push(i);else if(typeof i=="function")t.push(i);else if(!(typeof i=="object"&&(i.parse||i.stringify)))throw new Error(i+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new rl(this,e,t):new il(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};Rr.exports=qe;qe.default=qe;ol.registerProcessor(qe);nl.registerProcessor(qe)});var Ur=K((Hu,Hr)=>{"use strict";var Br=Rt(),_r=mt(),sl=ve(),ll=Lt(),Or=ht(),Pr=vt(),al=lr(),ul=gt(),cl=Tn(),dl=bn(),fl=dt(),ml=zt(),Rn=vr(),pl=jt(),Ir=Ke(),Wr=Pt(),hl=at(),xl=Mn();function te(...n){return n.length===1&&Array.isArray(n[0])&&(n=n[0]),new Rn(n)}te.plugin=function(e,t){let i=!1;function r(...s){console&&console.warn&&!i&&(i=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let c=t(...s);return c.postcssPlugin=e,c.postcssVersion=new Rn().version,c}let o;return Object.defineProperty(r,"postcss",{get(){return o||(o=r()),o}}),r.process=function(s,c,u){return te([r(u)]).process(s,c)},r};te.stringify=hl;te.parse=ml;te.fromJSON=al;te.list=dl;te.comment=n=>new _r(n);te.atRule=n=>new Br(n);te.decl=n=>new Or(n);te.rule=n=>new Wr(n);te.root=n=>new Ir(n);te.document=n=>new Pr(n);te.CssSyntaxError=ll;te.Declaration=Or;te.Container=sl;te.Processor=Rn;te.Document=Pr;te.Comment=_r;te.Warning=xl;te.AtRule=Br;te.Result=pl;te.Input=ul;te.Rule=Wr;te.Root=Ir;te.Node=fl;cl.registerPostcss(te);Hr.exports=te;te.default=te});function ge(n){try{window.parent.postMessage(n,"*")}catch{}}function Yn(n){let e=t=>{let i=t.data;if(!i||i.source!=="hf-parent"||i.type!=="control")return;let r=i.action;if(r==="play"){n.onPlay();return}if(r==="pause"){n.onPause();return}if(r==="seek"){n.onSeek(Number(i.frame??0),i.seekMode??"commit");return}if(r==="set-muted"){n.onSetMuted(!!i.muted);return}if(r==="set-media-output-muted"){n.onSetMediaOutputMuted(!!i.muted);return}if(r==="set-playback-rate"){n.onSetPlaybackRate(Number(i.playbackRate??1));return}if(r==="enable-pick-mode"){n.onEnablePickMode();return}if(r==="disable-pick-mode"){n.onDisablePickMode();return}if(r==="flash-elements"){let o=i.selectors,s=i.duration||800;o&&Bo(o,s)}};return window.addEventListener("message",e),e}function Bo(n,e){if(!document.getElementById("__hf-flash-styles")){let t=document.createElement("style");t.id="__hf-flash-styles",t.textContent=`\n .__hf-flash {\n outline: 2px solid rgba(59, 130, 246, 0.6) !important;\n outline-offset: 2px !important;\n animation: __hf-flash-pulse ${e}ms ease-out forwards !important;\n }\n @keyframes __hf-flash-pulse {\n 0% { outline-color: rgba(59, 130, 246, 0.8); }\n 100% { outline-color: transparent; }\n }\n `,document.head.appendChild(t)}for(let t of n)try{document.querySelectorAll(t).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),e)})}catch{}}var nn=null;function Zn(n){nn=n}function nt(n,e){if(nn)try{nn({source:"hf-preview",type:"analytics",event:n,properties:e??{}})}catch{}}function Xn(n){let e=[],t=c=>{if(typeof c.getAnimations!="function")return[];try{return c.getAnimations()}catch{return[]}},i=(c,u)=>{for(let a of c){try{a.currentTime=u}catch{}try{a.pause()}catch{}}},r=c=>{for(let u of c)try{u.play()}catch{}},o=c=>{for(let u of c)try{u.pause()}catch{}},s=c=>{c.baseDelay?c.el.style.animationDelay=c.baseDelay:c.el.style.removeProperty("animation-delay"),c.basePlayState?c.el.style.animationPlayState=c.basePlayState:c.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{e=[];let c=document.querySelectorAll("*");for(let u of c){if(!(u instanceof HTMLElement))continue;let a=window.getComputedStyle(u);!a.animationName||a.animationName==="none"||e.push({el:u,baseDelay:u.style.animationDelay||"",basePlayState:u.style.animationPlayState||""})}},seek:c=>{let u=Number(c.time)||0;for(let a of e){if(!a.el.isConnected)continue;let l=n?.resolveStartSeconds?n.resolveStartSeconds(a.el):Number.parseFloat(a.el.getAttribute("data-start")??"0")||0,f=Math.max(0,u-l)*1e3,m=t(a.el);if(m.length>0){i(m,f);continue}a.el.style.animationPlayState="paused",a.el.style.animationDelay=`-${(f/1e3).toFixed(3)}s`}},pause:()=>{for(let c of e){if(!c.el.isConnected)continue;let u=t(c.el);u.length>0&&o(u),s(c)}},play:()=>{for(let c of e)c.el.isConnected&&(s(c),r(t(c.el)))},revert:()=>{e=[]}}}function ei(n){return{name:"gsap",discover:()=>{},seek:e=>{let t=n.getTimeline();if(!t)return;t.pause();let i=Math.max(0,Number(e.time)||0);typeof t.totalTime=="function"?t.totalTime(i,!1):t.seek(i,!1)},pause:()=>{let e=n.getTimeline();e&&e.pause()}}}function ti(){return{name:"animejs",discover:()=>{try{let n=window.anime;if(!n||typeof n.running>"u")return;let e=n.running;if(!Array.isArray(e)||e.length===0)return;let t=window.__hfAnime??[],i=new Set(t);for(let r of e)i.has(r)||t.push(r);window.__hfAnime=t}catch{}},seek:n=>{let e=Math.max(0,(Number(n.time)||0)*1e3),t=window.__hfAnime;if(!(!t||t.length===0))for(let i of t)try{typeof i.seek=="function"&&i.seek(e)}catch{}},pause:()=>{let n=window.__hfAnime;if(!(!n||n.length===0))for(let e of n)try{typeof e.pause=="function"&&e.pause()}catch{}},play:()=>{let n=window.__hfAnime;if(!(!n||n.length===0))for(let e of n)try{typeof e.play=="function"&&e.play()}catch{}},revert:()=>{}}}function ri(){return{name:"lottie",discover:()=>{try{let n=window.lottie;if(n&&typeof n.getRegisteredAnimations=="function"){let e=n.getRegisteredAnimations();if(Array.isArray(e)&&e.length>0){let t=window.__hfLottie??[],i=new Set(t);for(let r of e)i.has(r)||t.push(r);window.__hfLottie=t}}}catch{}},seek:n=>{let e=Math.max(0,Number(n.time)||0),t=window.__hfLottie;if(!(!t||t.length===0))for(let i of t)try{if(ni(i))i.goToAndStop(e*1e3,!1);else if(ii(i)){if(typeof i.setCurrentRawFrameValue=="function"){let r=i.totalFrames??0,o=i.frameRate??30,s=e*o;r>0&&i.setCurrentRawFrameValue(Math.min(s,r-1))}else if(typeof i.seek=="function"){let r=i.duration??1,o=Math.min(100,e/r*100);i.seek(o)}}}catch{}},pause:()=>{let n=window.__hfLottie;if(!(!n||n.length===0))for(let e of n)try{(ni(e)||ii(e))&&e.pause()}catch{}},revert:()=>{}}}function ni(n){return typeof n=="object"&&n!==null&&typeof n.goToAndStop=="function"}function ii(n){return typeof n=="object"&&n!==null&&typeof n.pause=="function"&&("totalFrames"in n||"duration"in n)}function oi(){let n=null,e=0;return{name:"three",discover:()=>{},seek:t=>{n=Math.max(0,Number(t.time)||0),e=n,window.__hfThreeTime=n;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:n}}))}catch{}},pause:()=>{n==null&&(n=Math.max(0,e))},play:()=>{n=null},revert:()=>{n=null,e=0}}}function si(){return{name:"waapi",discover:()=>{},seek:n=>{if(!document.getAnimations)return;let e=Math.max(0,(Number(n.time)||0)*1e3);for(let t of document.getAnimations()){try{t.currentTime=e}catch{}try{t.pause()}catch{}}},pause:()=>{if(document.getAnimations)for(let n of document.getAnimations())try{n.pause()}catch{}}}}function li(n){let e=Array.from(document.querySelectorAll("video, audio")),t=n?.shouldIncludeElement?e.filter(s=>n.shouldIncludeElement?.(s)):e.filter(s=>s.hasAttribute("data-start")),i=[],r=[],o=0;for(let s of t){let c=n?.resolveStartSeconds?n.resolveStartSeconds(s):Number.parseFloat(s.dataset.start??"0");if(!Number.isFinite(c))continue;let u=Number.parseFloat(s.dataset.playbackStart??s.dataset.mediaStart??"0")||0,a=s.defaultPlaybackRate,l=Number.isFinite(a)&&a>0?Math.max(.1,Math.min(5,a)):1,f=s.loop,m=Number.isFinite(s.duration)&&s.duration>0?s.duration:null,h=n?.resolveDurationSeconds?.(s)??Number.parseFloat(s.dataset.duration??"");(!Number.isFinite(h)||h<=0)&&m!=null&&(h=Math.max(0,(m-u)/l));let M=Number.isFinite(h)&&h>0?c+h:Number.POSITIVE_INFINITY,C=Number.parseFloat(s.dataset.volume??""),A={el:s,start:c,mediaStart:u,duration:Number.isFinite(h)&&h>0?h:Number.POSITIVE_INFINITY,end:M,volume:Number.isFinite(C)?C:null,playbackRate:l,loop:f,sourceDuration:m};i.push(A),s.tagName==="VIDEO"&&r.push(A),Number.isFinite(M)&&(o=Math.max(o,M))}return{timedMediaEls:t,mediaClips:i,videoClips:r,maxMediaEnd:o}}var rn=new WeakMap,it=new WeakSet;function _o(n){if(it.has(n))return;it.add(n);let e=()=>it.delete(n);n.addEventListener("playing",e,{once:!0}),n.addEventListener("pause",e,{once:!0}),n.addEventListener("error",e,{once:!0})}function ai(n){let e=!!(n.outputMuted||n.userMuted);for(let t of n.clips){let{el:i}=t;if(!i.isConnected)continue;let r=(n.timeSeconds-t.start)*t.playbackRate+t.mediaStart;if(n.timeSeconds>=t.start&&n.timeSeconds<t.end&&r>=0){if(t.loop&&t.sourceDuration!=null&&t.sourceDuration>0){let h=t.sourceDuration-t.mediaStart;h>0&&r>=t.sourceDuration&&(r=t.mediaStart+(r-t.mediaStart)%h)}t.volume!=null&&(i.volume=t.volume),e&&(i.muted=!0);try{i.playbackRate=t.playbackRate*n.playbackRate}catch{}let s=i.currentTime||0,c=Math.abs(s-r),u=r-s,a=rn.get(i);rn.set(i,u);let l=a===void 0,f=!l&&Math.abs(u-a)>.5,m=c>3;if(c>.5&&(l||f||m))try{i.currentTime=r}catch{}n.playing&&i.paused&&!it.has(i)?(i.preload!=="auto"&&(i.preload="auto"),_o(i),i.play().catch(h=>{it.delete(i),(h&&typeof h=="object"&&"name"in h?String(h.name??""):"")==="NotAllowedError"&&n.onAutoplayBlocked?.()})):!n.playing&&!i.paused&&i.pause();continue}rn.delete(i),i.paused||i.pause()}}function ui(n){let e=!1,t=null,i=null,r=null,o=null;function s(S,p){try{window.dispatchEvent(new CustomEvent(S,{detail:p}))}catch{}}function c(S){r=S,s("hyperframe:picker:hovered",{elementInfo:r,isPickMode:e,timestamp:Date.now()})}function u(S){o=S,s("hyperframe:picker:selected",{elementInfo:o,isPickMode:e,timestamp:Date.now()})}function a(S){if(!S||S===document.body||S===document.documentElement)return!1;let p=S.tagName.toLowerCase();return!(p==="script"||p==="style"||p==="link"||p==="meta"||S.classList.contains("__hf-pick-highlight"))}function l(S){let p=S;if(p.id)return`#${p.id}`;let y=S.getAttribute("data-composition-id");if(y)return`[data-composition-id="${y}"]`;let F=S.getAttribute("data-composition-src");if(F)return`[data-composition-src="${F}"]`;let b=S.getAttribute("data-track-index");if(b)return`[data-track-index="${b}"]`;let N=S.tagName.toLowerCase(),B=S.parentElement;if(!B)return N;let W=B.querySelectorAll(`:scope > ${N}`);if(W.length===1)return N;for(let H=0;H<W.length;H+=1)if(W[H]===S)return`${N}:nth-of-type(${H+1})`;return N}function f(S){let p=S.tagName.toLowerCase(),y=(S.textContent??"").trim().replace(/\\s+/g," "),F=(b,N)=>b.length>N?`${b.slice(0,N-1)}\\u2026`:b;return p==="h1"||p==="h2"||p==="h3"?"Heading":p==="p"||p==="span"||p==="div"?y.length>0?F(y,56):"Text":p==="img"?"Image":p==="video"?"Video":p==="audio"?"Audio":p==="svg"?"Shape":S.getAttribute("data-composition-src")?"Composition":p==="section"?"Section":`${p.charAt(0).toUpperCase()}${p.slice(1)}`}function m(S,p,y){let F=typeof y=="number"&&y>0?y:8,b=[];if(document.elementsFromPoint)b=document.elementsFromPoint(S,p);else if(document.elementFromPoint){let W=document.elementFromPoint(S,p);b=W?[W]:[]}let N={},B=[];for(let W=0;W<b.length;W+=1){let H=b[W];if(!a(H))continue;let Z=`${H.tagName}::${H.id||""}::${W}`;if(!N[Z]&&(N[Z]=!0,B.push(H),B.length>=F))break}return B}function h(S){let p=S.getBoundingClientRect(),y={};for(let b=0;b<S.attributes.length;b+=1){let N=S.attributes[b];N.name.startsWith("data-")&&(y[N.name]=N.value)}return{id:S.id||null,tagName:S.tagName.toLowerCase(),selector:l(S),label:f(S),boundingBox:{x:p.left,y:p.top,width:p.width,height:p.height},textContent:S.textContent?S.textContent.trim().slice(0,200):null,src:S.getAttribute("src")||S.getAttribute("data-composition-src")||null,dataAttributes:y}}function M(S,p,y){return m(S,p,y).map(h)}function C(S){if(!e)return;let y=m(S.clientX,S.clientY,1)[0]??(S.target instanceof Element?S.target:null);if(!a(y)||t===y)return;t&&t.classList.remove("__hf-pick-highlight"),t=y,y.classList.add("__hf-pick-highlight");let F=h(y);c(F),n.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:F})}function A(S){if(!e)return;S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation();let p=M(S.clientX,S.clientY,8);p.length!==0&&(c(p[0]??null),n.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:p,selectedIndex:0,point:{x:S.clientX,y:S.clientY}}))}function z(S){S.key==="Escape"&&(D(),n.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function O(){e||(e=!0,i=document.createElement("style"),i.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`\n`),document.head.appendChild(i),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",C,!0),document.addEventListener("click",A,!0),document.addEventListener("keydown",z,!0),s("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function D(){e&&(e=!1,t&&(t.classList.remove("__hf-pick-highlight"),t=null),i&&(i.remove(),i=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",C,!0),document.removeEventListener("click",A,!0),document.removeEventListener("keydown",z,!0),s("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function Y(){window.__HF_PICKER_API={enable:O,disable:D,isActive:()=>e,getHovered:()=>r,getSelected:()=>o,getCandidatesAtPoint:(S,p,y)=>Number.isFinite(S)&&Number.isFinite(p)?M(S,p,y):[],pickAtPoint:(S,p,y)=>{if(!Number.isFinite(S)||!Number.isFinite(p))return null;let F=M(S,p,8);if(!F.length)return null;let b=Math.max(0,Math.min(F.length-1,Number(y??0))),N=F[b]??null;return N?(u(N),n.postMessage({source:"hf-preview",type:"element-picked",elementInfo:N}),D(),N):null},pickManyAtPoint:(S,p,y)=>{if(!Number.isFinite(S)||!Number.isFinite(p))return[];let F=M(S,p,8);if(!F.length)return[];let b=[],N=Array.isArray(y)?y:[0];for(let B of N){let W=Math.max(0,Math.min(F.length-1,Math.floor(Number(B)))),H=F[W];if(!H)continue;b.some(T=>T.selector===H.selector&&T.tagName===H.tagName)||b.push(H)}return b.length?(u(b[0]??null),n.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:b}),D(),b):[]}},s("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:O,disablePickMode:D,installPickerApi:Y}}function on(n,e){let t=Number.isFinite(e)&&e>0?e:30,i=Number.isFinite(n)&&n>0?n:0;return Math.floor(i*t+1e-9)/t}function Dt(n,e,t){if(n){for(let i of Object.values(n))if(!(!i||i===e))try{t(i)}catch{}}}function ci(n,e,t){let i=on(e,t);return n.pause(),typeof n.totalTime=="function"?n.totalTime(i,!1):n.seek(i,!1),i}function Oo(n,e,t,i){let r=[];Dt(n,e,o=>{o.play(),r.push(o)});try{return ci(e,t,i)}finally{for(let o of r)try{o.pause()}catch{}}}function Po(n,e){Dt(n,e,t=>{t.play()})}function di(n){return{_timeline:null,play:()=>{let e=n.getTimeline();if(!e||n.getIsPlaying())return;let t=Math.max(0,Number(n.getSafeDuration?.()??e.duration()??0)||0);t>0&&Math.max(0,Number(e.time())||0)>=t&&(e.pause(),e.seek(0,!1),n.onDeterministicSeek(0),n.setIsPlaying(!1),n.onSyncMedia(0,!1),n.onRenderFrameSeek(0)),typeof e.timeScale=="function"&&e.timeScale(n.getPlaybackRate()),e.play(),Dt(n.getTimelineRegistry?.(),e,i=>{typeof i.timeScale=="function"&&i.timeScale(n.getPlaybackRate()),i.play()}),n.onDeterministicPlay(),n.setIsPlaying(!0),n.onShowNativeVideos(),n.onStatePost(!0)},pause:()=>{let e=n.getTimeline();if(!e)return;e.pause(),Dt(n.getTimelineRegistry?.(),e,i=>{i.pause()});let t=Math.max(0,Number(e.time())||0);n.onDeterministicSeek(t),n.onDeterministicPause(),n.setIsPlaying(!1),n.onSyncMedia(t,!1),n.onRenderFrameSeek(t),n.onStatePost(!0)},seek:e=>{let t=n.getTimeline();if(!t)return;let i=Math.max(0,Number(e)||0),r=Oo(n.getTimelineRegistry?.(),t,i,n.getCanonicalFps());n.onDeterministicSeek(r),n.setIsPlaying(!1),n.onSyncMedia(r,!1),n.onRenderFrameSeek(r),n.onStatePost(!0)},renderSeek:e=>{let t=n.getTimeline(),i=n.getCanonicalFps(),r=t?(Po(n.getTimelineRegistry?.(),t),ci(t,e,i)):on(Math.max(0,Number(e)||0),i);n.onDeterministicSeek(r),n.setIsPlaying(!1),n.onSyncMedia(r,!1),n.onRenderFrameSeek(r),n.onStatePost(!0)},getTime:()=>Number(n.getTimeline()?.time()??0),getDuration:()=>Number(n.getTimeline()?.duration()??0),isPlaying:()=>n.getIsPlaying(),setPlaybackRate:e=>n.setPlaybackRate(e),getPlaybackRate:()=>n.getPlaybackRate()}}function fi(){return{capturedTimeline:null,isPlaying:!1,rafId:null,currentTime:0,deterministicAdapters:[],parityModeEnabled:!0,canonicalFps:30,bridgeMuted:!1,mediaOutputMuted:!1,mediaAutoplayBlockedPosted:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,timelinePollIntervalId:null,controlBridgeHandler:null,clampDurationLoggedRaw:null,beforeUnloadHandler:null,domReadyHandler:null,injectedCompStyles:[],injectedCompScripts:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,maxTimelineDurationSeconds:1800,nativeVisualWatchdogTick:0}}var Io="data-hf-authored-duration",Wo="data-hf-authored-end";function We(n){if(n==null||n==="")return null;let e=Number(n);return Number.isFinite(e)?e:null}function Ho(n){return We(n.getAttribute("data-duration"))}function Uo(n){return We(n.getAttribute("data-end"))}function qo(n){return We(n.getAttribute(Io))}function zo(n){return We(n.getAttribute(Wo))}function jo(n){let e=(n??"").trim();if(!e)return null;let t=We(e);if(t!=null)return{kind:"absolute",value:t};let i=e.match(/^([A-Za-z0-9_.:-]+)(?:\\s*([+-])\\s*([0-9]*\\.?[0-9]+))?$/);if(!i)return null;let r=(i[1]??"").trim();if(!r)return null;let o=i[2]??"+",s=i[3]??"0",c=Number.parseFloat(s),u=Number.isFinite(c)?Math.max(0,c):0,a=o==="-"?-u:u;return{kind:"reference",refId:r,offset:a}}function He(n){let e=n.timelineRegistry??{},t=n.includeAuthoredTimingAttrs??!1,i=new WeakMap,r=new WeakMap,o=new Set,s=l=>{let f=document.getElementById(l);return f||(document.querySelector(`[data-composition-id="${CSS.escape(l)}"]`)??null)},c=l=>{let f=r.get(l);if(f!==void 0)return f;let m=null,h=Ho(l)??(t?qo(l):null);if(h!=null&&h>0&&(m=h),m==null||m<=0){let M=Uo(l)??(t?zo(l):null);if(M!=null){let C=a(l,0),A=M-C;Number.isFinite(A)&&A>0&&(m=A)}}if((m==null||m<=0)&&l instanceof HTMLMediaElement){let M=We(l.getAttribute("data-playback-start"))??We(l.getAttribute("data-media-start"))??0;Number.isFinite(l.duration)&&l.duration>M&&(m=l.duration-M)}if(m==null||m<=0){let M=l.getAttribute("data-composition-id");if(M){let C=e[M]??null;if(C&&typeof C.duration=="function")try{let A=Number(C.duration());Number.isFinite(A)&&A>0&&(m=A)}catch{}}}return m!=null&&Number.isFinite(m)&&m>0?(r.set(l,m),m):(r.set(l,null),null)},u=(l,f)=>{if(l.hasAttribute("data-composition-id")){let h=l.parentElement?.closest("[data-composition-id]");return h?a(h,f):0}let m=l.closest("[data-composition-id]");return m?a(m,f):0},a=(l,f)=>{let m=i.get(l);if(m!==void 0)return m??f;if(o.has(l))return f;o.add(l);try{let h=jo(l.getAttribute("data-start"));if(!h){if(l.hasAttribute("data-composition-id")){let O=l.parentElement;if(O&&(O.hasAttribute("data-composition-src")||O.hasAttribute("data-composition-id"))){let D=a(O,f);return i.set(l,D),D}}return i.set(l,f),f}if(h.kind==="absolute"){let O=Math.max(0,h.value),D=Math.max(0,u(l,f)+O);return i.set(l,D),D}let M=s(h.refId);if(!M)return i.set(l,f),f;let C=a(M,0),A=c(M);if(A==null||A<=0){let O=Math.max(0,C+h.offset);return i.set(l,O),O}let z=Math.max(0,C+A+h.offset);return i.set(l,z),z}finally{o.delete(l)}};return{resolveStartForElement:(l,f=0)=>a(l,Math.max(0,f)),resolveDurationForElement:l=>c(l)}}var Go="data-hf-authored-duration",$o="data-hf-authored-end";function ye(n){if(n==null||n==="")return null;let e=Number(n);return Number.isFinite(e)?e:null}function sn(n){return ye(n.getAttribute("data-duration"))??ye(n.getAttribute(Go))}function mi(n){return ye(n.getAttribute("data-end"))??ye(n.getAttribute($o))}function ln(...n){let e=n.filter(t=>Number.isFinite(t??null));return e.length===0?null:Math.max(...e)}var pi={composition:0,video:1,image:2,element:3,audio:4};function Vo(n){if(n.length===0)return;let e=new Map;for(let s of n){let c=e.get(s.track)??new Set;c.add(s.kind),e.set(s.track,c)}if(!Array.from(e.values()).some(s=>s.size>1))return;let i=0,r=new Map,o=[...e.keys()].sort((s,c)=>s-c);for(let s of o){let c=e.get(s);if(c.size===1)r.set(`${s}:${[...c][0]}`,i++);else{let u=[...c].sort((a,l)=>(pi[a]??99)-(pi[l]??99));for(let a of u)r.set(`${s}:${a}`,i++)}}for(let s of n){let c=`${s.track}:${s.kind}`,u=r.get(c);u!=null&&(s.track=u)}}function ot(n){let e=String(n??"").trim();if(!e)return null;let t=e.toLowerCase();if(t.startsWith("data:")||t.startsWith("javascript:"))return null;try{return new URL(e,document.baseURI).toString()}catch{return e}}function hi(n){let e=n.getAttribute("src")??n.getAttribute("data-src");if(e)return ot(e);let t=n.getAttribute("data-composition-src");if(t)return ot(t);let i=n.querySelector("img[src], video[src], audio[src], source[src]");return i?ot(i.getAttribute("src")):null}function Ko(n){let e=n.className;return typeof e!="string"?null:e.split(/\\s+/).map(t=>t.trim()).find(t=>t&&t!=="clip"&&!t.startsWith("__hf-"))??null}function Jo(n){if(!n)return null;try{return new URL(n,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return n.split(/[\\\\/]/).filter(Boolean).at(-1)??null}}function Qo(n){let e=n.textContent?.replace(/\\s+/g," ").trim();return e?e.length>32?`${e.slice(0,31)}...`:e:null}function rt(n){let e=n.replace(/\\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\\s+/g," ").trim();return e?e.replace(/\\b\\w/g,t=>t.toUpperCase()):n}function Yo(n,e,t){let i=n.getAttribute("data-timeline-label")??n.getAttribute("data-label")??n.getAttribute("aria-label")??null;if(i?.trim())return i.trim();let r=n.getAttribute("data-composition-id");if(r)return rt(r);let o=n.id;if(o)return rt(o);let s=Ko(n);if(s)return rt(s);let c=Jo(hi(n));if(c)return rt(c);let u=Qo(n);return u||`${rt(e)} ${t+1}`}function xi(n){let t=window.__timelines??{},i=He({timelineRegistry:t,includeAuthoredTimingAttrs:!0}),r=R=>{if(!R)return null;let k=t[R]??null;if(!k||typeof k.duration!="function")return null;try{let L=Number(k.duration());return Number.isFinite(L)&&L>0?L:null}catch{return null}},o=R=>{let k=ye(R.getAttribute("data-duration"));if(k!=null&&k>0)return k;let L=ye(R.getAttribute("data-playback-start"))??ye(R.getAttribute("data-media-start"))??0;return Number.isFinite(R.duration)&&R.duration>L?Math.max(0,R.duration-L):null},s=()=>{let R=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(R.length===0)return null;let k=0;for(let L of R){let Q=i.resolveStartForElement(L,0);if(!Number.isFinite(Q))continue;let ie=o(L);ie==null||ie<=0||(k=Math.max(k,Math.max(0,Q)+ie))}return k>0?k:null},c=R=>{let k=R.trim().toLowerCase();return!(!k||k==="main"||k.includes("caption")||k.includes("ambient"))},u=(R,k)=>{let L=[],Q=null,ie=null,P=null,I=R.parentElement;for(;I;){let j=I.getAttribute("data-composition-id");j&&(L.push(j),!P&&I!==k&&(P=j),Q==null&&(Q=i.resolveStartForElement(I,0)),ie==null&&(ie=ye(I.getAttribute("data-duration"))??r(j)??null)),I=I.parentElement}return{parentCompositionId:P,compositionAncestors:L.reverse(),inheritedStart:Q,inheritedDuration:ie}},a=document.querySelector("[data-composition-id]"),l=Array.from(document.querySelectorAll("[data-composition-id]")),f=a?.getAttribute("data-composition-id")??null,m=a?i.resolveStartForElement(a,0):0,h=s(),M=h!=null?Math.max(0,h-Math.max(0,m)):null,C=r(f),A=sn(a??document.body),z=ln(...l.filter(R=>R!==a).map(R=>{let k=i.resolveStartForElement(R,0),L=i.resolveDurationForElement(R)??r(R.getAttribute("data-composition-id"))??null;return!Number.isFinite(k)||L==null||L<=0?null:Math.max(0,k)+L})),O=z!=null?Math.max(0,z-Math.max(0,m)):null,D=typeof C=="number"&&Number.isFinite(C)&&C>0?C:null,Y=typeof A=="number"&&Number.isFinite(A)&&A>0?A:null,S=typeof M=="number"&&Number.isFinite(M)&&M>0?M:null,p=typeof O=="number"&&Number.isFinite(O)&&O>0?O:null,y=ln(S,p),F=D!=null&&y!=null&&D>y+1,b=Y??(F?y:ln(D,S,p)),N=b!=null?Math.min(b,n.maxTimelineDurationSeconds):null,W=(N!=null?m+N:null)??(typeof h=="number"&&Number.isFinite(h)&&h>0?h:null),H=(R,k)=>!Number.isFinite(k)||k<=0?0:W==null||!Number.isFinite(W)?k:!Number.isFinite(R)||R>=W?0:Math.max(0,Math.min(k,W-R)),Z=[],T=[],X=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),ee=0;for(let R=0;R<X.length;R+=1){let k=X[R];if(k===a||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(k.tagName))continue;let L=u(k,a),Q=i.resolveStartForElement(k,L.inheritedStart??0),ie=k.getAttribute("data-composition-id"),P=sn(k);if((P==null||P<=0)&&ie&&ie!==f&&(P=r(ie)),(P==null||P<=0)&&k instanceof HTMLMediaElement){let ce=ye(k.getAttribute("data-playback-start"))??ye(k.getAttribute("data-media-start"))??0;Number.isFinite(k.duration)&&k.duration>0&&(P=Math.max(0,k.duration-ce))}if(P==null||P<=0){let ce=L.inheritedDuration;if(ce!=null&&ce>0){let Fe=(L.inheritedStart??0)+ce;P=Math.max(0,Fe-Q)}}if(P==null||P<=0||(P=H(Q,P),P<=0))continue;let I=Q+P;ee=Math.max(ee,I);let j=k.tagName.toLowerCase(),Ne=ie&&ie!==f?"composition":j==="video"?"video":j==="audio"?"audio":j==="img"?"image":"element";Z.push({id:k.id||ie||null,label:Yo(k,Ne,Z.length),start:Q,duration:P,track:Number.parseInt(k.getAttribute("data-track-index")??k.getAttribute("data-track")??String(R),10)||0,kind:Ne,tagName:j,compositionId:k.getAttribute("data-composition-id"),compositionAncestors:L.compositionAncestors,parentCompositionId:L.parentCompositionId,nodePath:null,compositionSrc:ot(k.getAttribute("data-composition-src")),assetUrl:hi(k),timelineRole:k.getAttribute("data-timeline-role"),timelineLabel:k.getAttribute("data-timeline-label"),timelineGroup:k.getAttribute("data-timeline-group"),timelinePriority:ye(k.getAttribute("data-timeline-priority"))})}let U=new Set(Z.map(R=>R.id)),G=a?.getAttribute("data-composition-id")??null,v=G?t[G]??null:null;if(v&&a){let R=v;if(typeof R.getChildren=="function")try{let k=R.getChildren(!0,!0,!1)??[],L=new Map;for(let P of a.children){let I=P;if(!I.id)continue;let j=I.tagName.toLowerCase();j==="script"||j==="style"||j==="link"||L.set(I,{id:I.id,start:1/0,end:-1/0})}let Q=P=>{let I=P;for(;I;){if(L.has(I))return I;if(I===a)return null;I=I.parentElement}return null};for(let P of k){if(typeof P.targets!="function"||typeof P.startTime!="function"||typeof P.duration!="function")continue;let I=P.startTime(),j=P.parent;for(;j&&j!==v&&typeof j.startTime=="function";)I+=j.startTime(),j=j.parent;let Ne=I+P.duration();if(!(!Number.isFinite(I)||!Number.isFinite(Ne)))for(let ce of P.targets()){if(!(ce instanceof Element))continue;let ze=Q(ce);if(!ze)continue;let Fe=L.get(ze);Fe&&(Fe.start=Math.min(Fe.start,I),Fe.end=Math.max(Fe.end,Ne))}}let ie=Z.length>0?Math.max(...Z.map(P=>P.track))+1:0;for(let[P,I]of L){if(I.start===1/0||I.end===-1/0)continue;let j=P;if(U.has(j.id))continue;let Ne=Math.max(0,I.end-I.start);if(Ne<=0)continue;let ce=H(I.start,Ne);ce<=0||(ee=Math.max(ee,I.start+ce),Z.push({id:j.id,label:j.getAttribute("data-timeline-label")??j.getAttribute("data-label")??j.getAttribute("aria-label")??j.id,start:I.start,duration:ce,track:Number.parseInt(j.getAttribute("data-track-index")??j.getAttribute("data-track")??"",10)||ie,kind:"element",tagName:j.tagName.toLowerCase(),compositionId:j.getAttribute("data-composition-id"),compositionAncestors:G?[G]:[],parentCompositionId:G,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:j.getAttribute("data-timeline-role"),timelineLabel:j.getAttribute("data-timeline-label"),timelineGroup:j.getAttribute("data-timeline-group"),timelinePriority:ye(j.getAttribute("data-timeline-priority"))}),U.add(j.id))}}catch{}}if(a&&N!=null&&N>0){let R=Z.length>0?Math.max(...Z.map(k=>k.track))+1:0;for(let k of a.children){let L=k;if(!L.id||U.has(L.id))continue;let Q=L.getAttribute("data-timeline-role");if(Q!=="overlay"&&Q!=="persistent-overlay")continue;let ie=L.tagName.toLowerCase();if(ie==="script"||ie==="style"||ie==="link"||ie==="meta"||window.getComputedStyle(L).display==="none")continue;let I=H(0,N);I<=0||(ee=Math.max(ee,I),Z.push({id:L.id,label:L.getAttribute("data-timeline-label")??L.getAttribute("data-label")??L.getAttribute("aria-label")??L.id,start:0,duration:I,track:Number.parseInt(L.getAttribute("data-track-index")??L.getAttribute("data-track")??"",10)||R,kind:"element",tagName:ie,compositionId:L.getAttribute("data-composition-id"),compositionAncestors:G?[G]:[],parentCompositionId:G,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:Q,timelineLabel:L.getAttribute("data-timeline-label"),timelineGroup:L.getAttribute("data-timeline-group"),timelinePriority:ye(L.getAttribute("data-timeline-priority"))}),U.add(L.id))}}Vo(Z);for(let R of l){if(R===a)continue;let k=R.getAttribute("data-composition-id");if(!k||!c(k))continue;let L=i.resolveStartForElement(R,0),Q=sn(R);if((Q==null||Q<=0)&&mi(R)!=null){let j=mi(R);Q=Math.max(0,j-L)}let ie=r(k),P=Q&&Q>0?Q:ie;if(P==null||P<=0)continue;let I=H(L,P);I<=0||T.push({id:k,label:R.getAttribute("data-label")??k,start:L,duration:I,thumbnailUrl:ot(R.getAttribute("data-thumbnail-url")),avatarName:null})}let J=Math.max(1,Math.min(Math.max(ee||1,N??0),n.maxTimelineDurationSeconds));return{source:"hf-preview",type:"timeline",durationInFrames:F&&Y==null?Number.POSITIVE_INFINITY:Math.max(1,Math.round(J*Math.max(1,n.canonicalFps))),clips:Z,scenes:T,compositionWidth:ye(a?.getAttribute("data-width"))??1920,compositionHeight:ye(a?.getAttribute("data-height"))??1080}}var re=vo(Ur(),1),qr=re.default,Uu=re.default.stringify,qu=re.default.fromJSON,zu=re.default.plugin,ju=re.default.parse,Gu=re.default.list,$u=re.default.document,Vu=re.default.comment,Ku=re.default.atRule,Ju=re.default.rule,Qu=re.default.decl,Yu=re.default.root,Zu=re.default.CssSyntaxError,Xu=re.default.Declaration,ec=re.default.Container,tc=re.default.Processor,nc=re.default.Document,ic=re.default.Comment,rc=re.default.Warning,oc=re.default.AtRule,sc=re.default.Result,lc=re.default.Input,ac=re.default.Rule,uc=re.default.Root,cc=re.default.Node;function vn(n){return n.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function gl(n){return n.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function yl(n,e,t){let i=Sl(n,e,t),r=i.trim();if(!r||/^(html|body|:root|\\*)$/i.test(r))return n;let o=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*=\\\\s*(["\'])${vn(t)}\\\\1\\\\s*\\\\]`,"g");if(o.test(r))return i.replace(o,e);let s=i.match(/^\\s*/)?.[0]??"",c=i.match(/\\s*$/)?.[0]??"";return`${s}${e} ${r}${c}`}function Sl(n,e,t){let i=vn(t),r=String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${i}"|\'${i}\')\\s*\\]`,o=String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`;return n.replace(new RegExp(`${r}(?:${o})+`,"g"),e).replace(new RegExp(`(?:${o})+${r}`,"g"),e)}var Al=new Set(["keyframes","-webkit-keyframes","font-face"]);function El(n){return n?.type==="atrule"}function Fl(n){let e=n.parent;for(;e;){if(El(e)&&Al.has(e.name.toLowerCase()))return!0;e=e.parent}return!1}function Bn(n,e,t){let i=e.trim();if(!n||!i)return n;let r=t||`[data-composition-id="${gl(i)}"]`,o=qr.parse(n);return o.walkRules(s=>{Fl(s)||(s.selectors=s.selectors.map(c=>yl(c,r,i)))}),o.toResult({map:!1}).css}function zr(n,e,t="[HyperFrames] composition script error:",i,r=e){let o=JSON.stringify(e),s=JSON.stringify(r),c=JSON.stringify(t),u=vn(e),a=JSON.stringify(i??null),l=JSON.stringify(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${u}"|\'${u}\')\\s*\\]`),f=JSON.stringify(String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`);return`(function(){\n var __hfCompId = ${o};\n var __hfTimelineCompId = ${s};\n var __hfErrorLabel = ${c};\n var __hfEscapeAttr = function(value) {\n return (value + "").replace(/\\\\\\\\/g, "\\\\\\\\\\\\\\\\").replace(/"/g, "\\\\\\\\\\\\"");\n };\n var __hfRootSelector = ${a} || (__hfCompId\n ? \'[data-composition-id="\' + __hfEscapeAttr(__hfCompId) + \'"]\'\n : "");\n var __hfRoot = null;\n var __hfRootSelectorPattern = ${l};\n var __hfTimingSelectorPattern = ${f};\n var __hfNormalizeSelector = function(selector) {\n if (!__hfCompId || typeof selector !== "string") return selector;\n return selector\n .replace(new RegExp(__hfRootSelectorPattern + \'(?:\' + __hfTimingSelectorPattern + \')+\', \'g\'), __hfRootSelector)\n .replace(new RegExp(\'(?:\' + __hfTimingSelectorPattern + \')+\' + __hfRootSelectorPattern, \'g\'), __hfRootSelector);\n };\n var __hfFindRoot = function() {\n if (!__hfRoot && __hfRootSelector) {\n __hfRoot = window.document.querySelector(__hfRootSelector);\n }\n return __hfRoot;\n };\n var __hfContains = function(node) {\n var root = __hfFindRoot();\n return !root || node === root || root.contains(node);\n };\n var __hfQueryAll = function(selector) {\n var root = __hfFindRoot();\n if (!root || typeof selector !== "string") {\n return window.document.querySelectorAll(selector);\n }\n return Array.prototype.filter.call(window.document.querySelectorAll(__hfNormalizeSelector(selector)), function(node) {\n return __hfContains(node);\n });\n };\n var __hfQueryOne = function(selector) {\n var matches = __hfQueryAll(selector);\n return matches[0] || null;\n };\n var __hfScopedDocument = typeof Proxy === "function"\n ? new Proxy(window.document, {\n get: function(target, prop, receiver) {\n if (prop === "querySelector") return __hfQueryOne;\n if (prop === "querySelectorAll") return __hfQueryAll;\n if (prop === "getElementById") {\n return function(id) {\n var found = target.getElementById(id);\n return found && __hfContains(found) ? found : null;\n };\n }\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n })\n : window.document;\n var __hfTimelineRegistryProxy = null;\n var __hfGetTimelineRegistry = function() {\n window.__timelines = window.__timelines || {};\n if (!__hfCompId || __hfCompId === __hfTimelineCompId || typeof Proxy !== "function") {\n return window.__timelines;\n }\n if (!__hfTimelineRegistryProxy) {\n __hfTimelineRegistryProxy = new Proxy(window.__timelines, {\n get: function(target, prop, receiver) {\n return Reflect.get(target, prop === __hfCompId ? __hfTimelineCompId : prop, target);\n },\n set: function(target, prop, value, receiver) {\n return Reflect.set(target, prop === __hfCompId ? __hfTimelineCompId : prop, value, target);\n },\n });\n }\n return __hfTimelineRegistryProxy;\n };\n var __hfScopedWindow = typeof Proxy === "function"\n ? new Proxy(window, {\n get: function(target, prop, receiver) {\n if (prop === "__timelines") return __hfGetTimelineRegistry();\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n set: function(target, prop, value, receiver) {\n if (prop === "__timelines") {\n target.__timelines = value || {};\n __hfTimelineRegistryProxy = null;\n return true;\n }\n return Reflect.set(target, prop, value, target);\n },\n })\n : window;\n var __hfResolveGsapTarget = function(target) {\n if (typeof target !== "string") return target;\n return __hfQueryAll(target);\n };\n var __hfScopeTimeline = function(timeline) {\n if (!timeline || timeline.__hfScopedCompositionRoot === __hfFindRoot()) return timeline;\n ["to", "from", "fromTo", "set"].forEach(function(method) {\n var original = timeline[method];\n if (typeof original !== "function") return;\n timeline[method] = function(target) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(target);\n return original.apply(timeline, args);\n };\n });\n try {\n Object.defineProperty(timeline, "__hfScopedCompositionRoot", {\n value: __hfFindRoot(),\n configurable: true,\n });\n } catch (_err) {}\n return timeline;\n };\n var __hfBaseGsap = typeof gsap === "undefined" ? window.gsap : gsap;\n var __hfScopedGsap = !__hfBaseGsap || typeof Proxy !== "function"\n ? __hfBaseGsap\n : new Proxy(__hfBaseGsap, {\n get: function(target, prop, receiver) {\n if (prop === "timeline") {\n return function() {\n return __hfScopeTimeline(target.timeline.apply(target, arguments));\n };\n }\n if (prop === "to" || prop === "from" || prop === "fromTo" || prop === "set") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return target[prop].apply(target, args);\n };\n }\n if (prop === "utils" && target.utils && typeof Proxy === "function") {\n return new Proxy(target.utils, {\n get: function(utilsTarget, utilsProp, utilsReceiver) {\n if (utilsProp === "toArray") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return utilsTarget.toArray.apply(utilsTarget, args);\n };\n }\n if (utilsProp === "selector") {\n return function(base) {\n var baseEl = typeof base === "string" ? __hfQueryOne(base) : base;\n var root = baseEl || __hfFindRoot();\n return function(selector) {\n if (!root || typeof selector !== "string") return [];\n return Array.prototype.slice.call(root.querySelectorAll(selector));\n };\n };\n }\n var value = Reflect.get(utilsTarget, utilsProp, utilsTarget);\n return typeof value === "function" ? value.bind(utilsTarget) : value;\n },\n });\n }\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n });\n var __hfRun = function() {\n try {\n (function(document, gsap, window) {\n${n}\n }).call(window, __hfScopedDocument, __hfScopedGsap, __hfScopedWindow);\n } catch (_err) {\n console.error(__hfErrorLabel, __hfCompId, _err);\n }\n };\n __hfFindRoot();\n __hfRun();\n})()`}var bl=8e3,Nl=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/,wl=n=>new Promise(e=>{let t=!1,i=Date.now(),r=null,o=s=>{t||(t=!0,r!=null&&window.clearTimeout(r),e({status:s,elapsedMs:Math.max(0,Date.now()-i)}))};n.addEventListener("load",()=>o("load"),{once:!0}),n.addEventListener("error",()=>o("error"),{once:!0}),r=window.setTimeout(()=>o("timeout"),bl)});function _n(n){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=""}function jr(n,e){let t=n.trim();if(!t)return n;try{return Nl.test(t)?new URL(t,document.baseURI).toString():e?new URL(t,e).toString():new URL(t,document.baseURI).toString()}catch{return n}}async function On(n){let e=null;n.hostCompositionId&&(e=Array.from(n.sourceNode.querySelectorAll("[data-composition-id]")).find(l=>l.getAttribute("data-composition-id")===n.hostCompositionId)??null);let t=e??n.sourceNode,i=e?.getAttribute("data-composition-id")?.trim()||n.hostCompositionId||null;if(n.headStyles)for(let a of n.headStyles){let l=a.cloneNode(!0);l instanceof HTMLStyleElement&&(i&&(l.textContent=Bn(l.textContent||"",i)),document.head.appendChild(l),n.injectedStyles.push(l))}let r=Array.from(t.querySelectorAll("style"));for(let a of r){let l=a.cloneNode(!0);l instanceof HTMLStyleElement&&(i&&(l.textContent=Bn(l.textContent||"",i)),document.head.appendChild(l),n.injectedStyles.push(l))}let o=[];if(n.headScripts)for(let a of n.headScripts){let l=a.getAttribute("type")?.trim()??"",f=a.getAttribute("src")?.trim()??"";if(f){let m=jr(f,n.compositionUrl);o.push({kind:"external",src:m,type:l})}else{let m=a.textContent?.trim()??"";m&&o.push({kind:"inline",content:m,type:l,scopeCompositionId:i})}}let s=Array.from(t.querySelectorAll("script")),c=[...o];for(let a of s){let l=a.getAttribute("type")?.trim()??"",f=a.getAttribute("src")?.trim()??"";if(f){let m=jr(f,n.compositionUrl);c.push({kind:"external",src:m,type:l})}else{let m=a.textContent?.trim()??"";m&&c.push({kind:"inline",content:m,type:l,scopeCompositionId:i})}a.parentNode?.removeChild(a)}let u=Array.from(t.querySelectorAll("style"));for(let a of u)a.parentNode?.removeChild(a);if(e){let a=document.importNode(e,!0),l=e.getAttribute("data-width"),f=e.getAttribute("data-height"),m=n.parseDimensionPx(l),h=n.parseDimensionPx(f);for(l&&n.host.setAttribute("data-width",l),f&&n.host.setAttribute("data-height",f),m&&n.host instanceof HTMLElement&&(n.host.style.width=m),h&&n.host instanceof HTMLElement&&(n.host.style.height=h);a.firstChild;)n.host.appendChild(a.firstChild)}else n.hasTemplate?n.host.appendChild(document.importNode(t,!0)):n.host.innerHTML=n.fallbackBodyInnerHtml;for(let a of c){let l=document.createElement("script");if(a.type&&(l.type=a.type),l.async=!1,a.kind==="external"?l.src=a.src:a.type.toLowerCase()==="module"?l.textContent=a.content:a.scopeCompositionId?l.textContent=zr(a.content,a.scopeCompositionId):l.textContent=`(function(){${a.content}})();`,document.body.appendChild(l),n.injectedScripts.push(l),a.kind==="external"){let f=await wl(l);f.status!=="load"&&n.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:n.hostCompositionId,hostCompositionSrc:n.hostCompositionSrc,resolvedScriptSrc:a.src,loadStatus:f.status,elapsedMs:f.elapsedMs}})}}}async function Gr(n){let e=Array.from(document.querySelectorAll("[data-composition-id]:not([data-composition-src])")).filter(t=>{if(t.children.length>0)return!1;let i=t.getAttribute("data-composition-id");return i?!!document.querySelector(`template#${CSS.escape(i)}-template`):!1});if(e.length!==0)for(let t of e){let i=t.getAttribute("data-composition-id"),r=document.querySelector(`template#${CSS.escape(i)}-template`);_n(t),await On({host:t,hostCompositionId:i,hostCompositionSrc:`template#${i}-template`,sourceNode:r.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:n.injectedStyles,injectedScripts:n.injectedScripts,parseDimensionPx:n.parseDimensionPx,onDiagnostic:n.onDiagnostic})}}async function $r(n){let e=Array.from(document.querySelectorAll("[data-composition-src]"));e.length!==0&&await Promise.all(e.map(async t=>{let i=t.getAttribute("data-composition-src");if(!i)return;let r=null;try{r=new URL(i,document.baseURI)}catch{r=null}_n(t);try{let o=t.getAttribute("data-composition-id"),s=o!=null?document.querySelector(`template#${CSS.escape(o)}-template`):null;if(s){await On({host:t,hostCompositionId:o,hostCompositionSrc:i,sourceNode:s.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:r,injectedStyles:n.injectedStyles,injectedScripts:n.injectedScripts,parseDimensionPx:n.parseDimensionPx,onDiagnostic:n.onDiagnostic});return}let c=await fetch(i);if(!c.ok)throw new Error(`HTTP ${c.status}`);let u=await c.text(),l=new DOMParser().parseFromString(u,"text/html"),f=(o?l.querySelector(`template#${CSS.escape(o)}-template`):null)??l.querySelector("template"),m=f?f.content:l.body,h=f?void 0:Array.from(l.head.querySelectorAll("style")),M=f?void 0:Array.from(l.head.querySelectorAll("script"));await On({host:t,hostCompositionId:o,hostCompositionSrc:i,sourceNode:m,hasTemplate:!!f,fallbackBodyInnerHtml:l.body.innerHTML,compositionUrl:r,injectedStyles:n.injectedStyles,injectedScripts:n.injectedScripts,parseDimensionPx:n.parseDimensionPx,headStyles:h,headScripts:M,onDiagnostic:n.onDiagnostic})}catch(o){n.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:t.getAttribute("data-composition-id"),hostCompositionSrc:i,errorMessage:o instanceof Error?o.message:"unknown_error"}}),_n(t)}}))}function Pn(){let n=window.gsap;n&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(e=>e.ok?e.json():null).then(e=>{if(!e||!Array.isArray(e)||e.length===0)return;let t=[],i=document.querySelectorAll(".caption-group");for(let r of i){let o=r.querySelectorAll(":scope > span");for(let s of o)t.push(s)}for(let r of e){let o=null;if(r.wordId&&(o=document.getElementById(r.wordId)),!o&&r.wordIndex!==void 0&&(o=t[r.wordIndex]??null),!o||!(o instanceof HTMLElement))continue;let s={},c={};if(r.x!==void 0&&(s.x=r.x),r.y!==void 0&&(s.y=r.y),r.scale!==void 0&&(s.scale=r.scale),r.rotation!==void 0&&(s.rotation=r.rotation),r.opacity!==void 0&&(c.opacity=r.opacity),r.fontSize!==void 0&&(c.fontSize=`${r.fontSize}px`),r.fontWeight!==void 0&&(c.fontWeight=r.fontWeight),r.fontFamily!==void 0&&(c.fontFamily=r.fontFamily),r.activeColor||r.dimColor){let a=n.getTweensOf(o).filter(f=>f.vars.color!==void 0).sort((f,m)=>f.startTime()-m.startTime()),l=a.length>0?String(a[0].vars.color):"";for(let f of a)String(f.vars.color)===l?r.dimColor&&(f.vars.color=r.dimColor):r.activeColor&&(f.vars.color=r.activeColor);r.dimColor&&n.set(o,{color:r.dimColor})}if(Object.keys(c).length>0&&n.set(o,c),Object.keys(s).length>0){let u=document.createElement("span");u.style.display="inline-block",u.dataset.captionWrapper="true",o.parentNode?.insertBefore(u,o),u.appendChild(o),n.set(u,s)}}}).catch(()=>{})}var Vr="data-hf-authored-duration",Kr="data-hf-authored-end";function Jr(){let n=fi(),e=window,t=null,i=null,r=[],o=new Set,s=null;if(typeof e.__hfRuntimeTeardown=="function")try{e.__hfRuntimeTeardown()}catch{}document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden"),window.__timelines=window.__timelines||{};let c=d=>{r.push(d)},u=(d,g,x)=>{let w=x??`${d}:${JSON.stringify(g)}`;o.has(w)||(o.add(w),ge({source:"hf-preview",type:"diagnostic",code:d,details:g}))},a=d=>{let g={scale:1,focusX:960,focusY:540},x=[],w=[],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:()=>g,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>x,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:()=>w,getRenderState:()=>({...E,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},l=1/60,f=.75,m=.75,h=.35,M=900,C=3,A=2,z=.05,O=100,D=240,Y=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??"")}},S=d=>{let g=d.toLowerCase();return g.includes("cannot read properties of null")||g.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:g.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:g.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},p=d=>{if(d==null||d.trim()==="")return null;let g=Number.parseFloat(d);return!Number.isFinite(g)||g<=0?null:`${g}px`},y=()=>{let d=document.querySelector(\'[data-composition-id][data-root="true"]\');if(d instanceof HTMLElement)return d;let g=Array.from(document.querySelectorAll("[data-composition-id]"));return g.length===0?null:g.find(x=>!x.parentElement?.closest("[data-composition-id]"))??g[0]??null},F=()=>{let d=y();if(!d)return;let g=p(d.getAttribute("data-width")),x=p(d.getAttribute("data-height"));g&&(d.style.width=g),x&&(d.style.height=x),g&&d.style.setProperty("--comp-width",g),x&&d.style.setProperty("--comp-height",x)},b=()=>{let d=y(),g=Array.from(document.querySelectorAll("[data-composition-id]")).filter(x=>x.hasAttribute("data-duration")||x.hasAttribute("data-end"));for(let x of g){if(d&&x===d)continue;let w=x.getAttribute("data-duration"),E=x.getAttribute("data-end");w!=null&&!x.hasAttribute(Vr)&&x.setAttribute(Vr,w),E!=null&&!x.hasAttribute(Kr)&&x.setAttribute(Kr,E),x.removeAttribute("data-duration"),x.removeAttribute("data-end")}},N=()=>{let d=y();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let g=p(d.getAttribute("data-width")),x=p(d.getAttribute("data-height"));g&&(d.style.width=g),x&&(d.style.height=x);let w=Array.from(d.children);for(let E of w){let _=E.tagName.toLowerCase();if(_==="script"||_==="style"||_==="link"||_==="meta"||!E.hasAttribute("data-start"))continue;let le=(E.style.top==="0px"||E.style.top==="0")&&(E.style.left==="0px"||E.style.left==="0")&&E.style.width==="100%"&&E.style.height==="100%",ae=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(E.style.transform);if(le&&ae&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let Se=E.style.top,ue=E.style.left,tt=E.style.width,ne=E.style.height;E.style.top="",E.style.left="",E.style.width="",E.style.height="";let $=window.getComputedStyle(E);$.top!=="auto"||$.bottom!=="auto"||$.left!=="auto"||$.right!=="auto"||$.width!=="0px"||$.height!=="0px"||(E.style.top=Se,E.style.left=ue,E.style.width=tt,E.style.height=ne)}let V=window.getComputedStyle(E),we=V.position;if(we!=="absolute"&&we!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||V.top!=="auto"||V.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||V.left!=="auto"||V.right!=="auto"||(E.style.left="0"),_!=="audio"){let Se=p(E.getAttribute("data-width")),ue=p(E.getAttribute("data-height")),tt=V.width!=="0px"&&V.width!=="auto",ne=V.height!=="0px"&&V.height!=="auto";Se?!E.style.width&&!tt&&(E.style.width=Se):!E.style.width&&V.width==="0px"&&(E.style.width="100%"),ue?!E.style.height&&!ne&&(E.style.height=ue):!E.style.height&&V.height==="0px"&&(E.style.height="100%")}}},B=(d,g=0,x)=>He({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:x?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,g),W=(d,g)=>He({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:g?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),H=!!document.querySelector("[data-composition-src]"),Z=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let g of d){let x=g.getAttribute("data-composition-id");if(x&&g.children.length===0&&document.querySelector(`template#${CSS.escape(x)}-template`)){Z=!0;break}}}let T=!H&&!Z,X=d=>{if(!d||typeof d.duration!="function")return null;try{let g=Number(d.duration());return Number.isFinite(g)?Math.max(0,g):null}catch{return null}},ee=d=>typeof d=="number"&&Number.isFinite(d)&&d>l,U=d=>{let g=Number(d.getAttribute("data-duration"));if(Number.isFinite(g)&&g>0)return g;let x=Number(d.getAttribute("data-playback-start")??d.getAttribute("data-media-start")??"0"),w=Number.isFinite(x)?Math.max(0,x):0;return Number.isFinite(d.duration)&&d.duration>w?Math.max(0,d.duration-w):null},G=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let g=0;for(let x of d){let w=B(x,0);if(!Number.isFinite(w))continue;let E=U(x);E==null||E<=l||(g=Math.max(g,Math.max(0,w)+E))}return g>l?g:null},v=()=>{let d=y();if(!d)return null;let g=window.__timelines??{},x=He({timelineRegistry:g,includeAuthoredTimingAttrs:!0}),w=0,E=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let _ of E){if(!(_ instanceof Element)||_.parentElement?.closest("[data-composition-id]")!==d)continue;let ae=x.resolveStartForElement(_,0),V=x.resolveDurationForElement(_);!Number.isFinite(ae)||V==null||V<=0||(w=Math.max(w,Math.max(0,ae)+V))}return w>l?w:null},J=()=>{let d=G();return typeof d!="number"||!Number.isFinite(d)||d<=l?null:d},Ee=d=>ee(d)?Math.max(l,d*f):l,xe=(d,g=0)=>{let x=X(d),w=J(),E=v(),_=Math.max(w??0,E??0),le=Number.isFinite(g)&&g>l?g:0,ae=0;ee(x)?ae=Math.max(x,_,le):ee(_)?ae=Math.max(_,le):ae=le;let V=Math.max(1,Number(n.maxTimelineDurationSeconds)||1800);return ae>0?Math.max(0,Math.min(ae,V)):0},R=()=>{let d=window.__timelines??{},g=He({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),x=J(),w=v(),E=Math.max(x??0,w??0)||null,_=Ee(E),le=ne=>{let $=document.querySelector(`[data-composition-id="${CSS.escape(ne)}"]`);return $?g.resolveStartForElement($,0):0},ae=ne=>{let $=window.gsap;if(!$||typeof $.timeline!="function")return null;let oe=$.timeline({paused:!0});for(let pe of ne)oe.add(pe.timeline,le(pe.compositionId));return oe},V=(ne,$)=>{if(!ee(ne))return null;let oe=window.gsap;if(!oe||typeof oe.timeline!="function")return null;let pe=oe.timeline({paused:!0});if($)try{pe.add($,0)}catch{}let he=pe;if(typeof he.to=="function")try{he.to({},{duration:ne})}catch{}return pe},we=(ne,$)=>{let oe=ne;if(typeof oe.getChildren!="function")return[];try{let pe=oe.getChildren(!0,!0,!0)??[];if(!Array.isArray(pe))return[];let he=[];for(let se of $)if(!pe.some(Ie=>Ie===se.timeline))try{let Ie=le(se.compositionId);ne.add(se.timeline,Ie),he.push(se.compositionId)}catch{}return he}catch{return[]}},Re=y(),de=Re?.getAttribute("data-composition-id")??null;if(!de)return{timeline:null};let me=d[de]??null,ue=(()=>{if(!Re)return[];let ne=new Set,$=Array.from(Re.querySelectorAll("[data-composition-id]")),oe=[];for(let pe of $){let he=pe.getAttribute("data-composition-id");if(!he||he===de||ne.has(he))continue;ne.add(he);let se=d[he]??null;if(!se||typeof se.play!="function"||typeof se.pause!="function")continue;let Ae=X(se);oe.push({compositionId:he,timeline:se,durationSeconds:Ae??0})}return oe})(),tt=ne=>{for(let $ of ne){let oe=$.timeline;if(typeof oe.paused=="function")try{oe.paused(!1)}catch{}}};if(ue.length>0&&tt(ue),me){let ne=ue.length>0?we(me,ue):[];if((ue.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+de+"\'])"))&&(L=!0),ne.length>0)try{let se=me.time();me.seek(se,!1)}catch{}let $=X(me);if(!ee($)&&ue.length>0){let se=ue.map(Co=>Co.compositionId),Ae=ae(ue),Ie=X(Ae);if(Ae&&ee(Ie))return{timeline:Ae,selectedTimelineIds:se,selectedDurationSeconds:Ie,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:de,rootDurationSeconds:$,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:_,selectedDurationSeconds:Ie,mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:w,selectedTimelineIds:se,autoNestedChildren:ne}}};let en=V(E??0,me),tn=X(en);if(en&&ee(tn))return{timeline:en,selectedTimelineIds:[de],selectedDurationSeconds:tn,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:de,rootDurationSeconds:$,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:tn,selectedTimelineIds:[de],autoNestedChildren:ne}}}}if(!ee($)&&ue.length===0){let se=V(E??0,me),Ae=X(se);if(se&&ee(Ae))return{timeline:se,selectedTimelineIds:[de],selectedDurationSeconds:Ae,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:de,rootDurationSeconds:$,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:Ae,selectedTimelineIds:[de]}}}}let oe=Re?.getAttribute("data-duration"),pe=oe?parseFloat(oe):null,he=Math.max(ee(pe)?pe:0,w??0);if(he>0&&ee(he)&&ee($)&&he>=$+.5){let se=me;if(typeof se.to=="function")try{se.to({},{duration:0},he)}catch{}let Ae=X(me);if(ee(Ae))return{timeline:me,selectedTimelineIds:[de],selectedDurationSeconds:Ae,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:de,rootDurationSeconds:$,rootDeclaredDur:pe,authoredCompositionDurationFloorSeconds:w,newDur:Ae}}}}return{timeline:me,selectedTimelineIds:[de],selectedDurationSeconds:$,mediaDurationFloorSeconds:x,diagnostics:ne.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:de,selectedDurationSeconds:$,autoNestedChildren:ne}}:void 0}}if(ue.length>0){let ne=ue.map(pe=>pe.compositionId),$=ae(ue),oe=X($);if($)return{timeline:$,selectedTimelineIds:ne,selectedDurationSeconds:oe,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:de,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:_,selectedDurationSeconds:oe,mediaDurationFloorSeconds:x,selectedTimelineIds:ne}}}}return{timeline:null}},k=()=>{let d=n.capturedTimeline;if(!d||typeof d.time!="function")return;let g=Number(d.time());Number.isFinite(g)&&(n.currentTime=Math.max(0,g))},L=!1,Q=()=>{if(!T)return!1;let d=n.capturedTimeline,g=X(d),x=ee(g);if(d&&x&&L)return!1;let w=R();return w.timeline?d&&d===w.timeline?(typeof d.timeScale=="function"&&d.timeScale(n.playbackRate),!1):(n.capturedTimeline=w.timeline,typeof n.capturedTimeline.timeScale=="function"&&n.capturedTimeline.timeScale(n.playbackRate),w.diagnostics&&ge({source:"hf-preview",type:"diagnostic",code:w.diagnostics.code,details:w.diagnostics.details}),ge({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:w.selectedTimelineIds??[],selectedDurationSeconds:w.selectedDurationSeconds??null,mediaDurationFloorSeconds:w.mediaDurationFloorSeconds??null}}),!0):!1},ie=()=>{let d=y();if(!(d instanceof HTMLElement))return;let g=d.getBoundingClientRect(),x=Number(d.getAttribute("data-width")),w=Number(d.getAttribute("data-height")),E=window.getComputedStyle(d),_=Number.isFinite(x)&&x>0&&Number.isFinite(w)&&w>0,le=g.width<=0||g.height<=0||d.clientWidth<=0||d.clientHeight<=0;!_||!le||u("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:x,declaredHeight:w,rectWidth:Math.round(g.width),rectHeight:Math.round(g.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"}`)},P=()=>{n.tornDown||(s!=null&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=null,ie()}))},I=()=>{t=d=>{let g=Y(d.error??d.message).slice(0,D);if(!g)return;let x=S(g);ge({source:"hf-preview",type:"diagnostic",code:x.code,details:{category:x.category,message:g,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},i=d=>{let g=Y(d.reason).slice(0,D);if(!g)return;let x=S(g);ge({source:"hf-preview",type:"diagnostic",code:`${x.code}_unhandled_rejection`,details:{category:`${x.category}-unhandled-rejection`,message:g}})},window.addEventListener("error",t),window.addEventListener("unhandledrejection",i)},j=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let x of d){let w=()=>{if(!(x instanceof Element))return;let E=x.tagName.toLowerCase(),_=x.getAttribute("src")??x.getAttribute("href")??x.getAttribute("poster")??null,le=E==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";u(le,{tagName:E,assetUrl:_,currentSrc:(x instanceof HTMLImageElement||x instanceof HTMLMediaElement)&&x.currentSrc||null,readyState:x instanceof HTMLMediaElement?x.readyState:null,networkState:x instanceof HTMLMediaElement?x.networkState:null},`${le}:${E}:${_??"unknown"}`)};x.addEventListener("error",w),c(()=>{x.removeEventListener("error",w)})}let g=document.fonts;g&&g.ready.then(()=>{if(n.tornDown)return;let x=Array.from(g).filter(w=>w.status==="error").map(w=>w.family).filter(w=>!!w).slice(0,10);x.length!==0&&u("runtime_font_load_issue",{failedFamilies:x,totalFaces:Array.from(g).length},`runtime-font-load-issue:${x.join("|")}`)}).catch(()=>{})},Ne=(d,g)=>{if(!d.timeline)return!1;let x=n.capturedTimeline;if(x&&x===d.timeline)return!1;let w=Math.max(0,n.currentTime||0),E=n.isPlaying;n.capturedTimeline=d.timeline,typeof n.capturedTimeline.timeScale=="function"&&n.capturedTimeline.timeScale(n.playbackRate);try{n.capturedTimeline.pause(),n.capturedTimeline.seek(w,!1),E&&n.capturedTimeline.play()}catch{}return ge({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:g,previousTime:w,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},ce=null,ze=!1,Fe=new Set,Ct=()=>{n.tornDown||(ce!=null&&window.clearTimeout(ce),ce=window.setTimeout(()=>{if(n.tornDown)return;ce=null;let d=R();if(!d.timeline||!ee(d.mediaDurationFloorSeconds??null))return;if(!n.capturedTimeline){Q()&&(je(),Te(!0));return}if(ze)return;let x=X(n.capturedTimeline),w=d.selectedDurationSeconds??X(d.timeline);ee(w)&&(!ee(x)||w>=x+z)&&Ne(d,"manual")&&(ze=!0,ge({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:x??null,selectedDurationSeconds:w??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),je(),Te(!0))},O))},bo=()=>{for(let d of Fe)d.removeEventListener("loadedmetadata",Ct),d.removeEventListener("durationchange",Ct);Fe.clear()},Qt=()=>{if(n.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let g of d)Fe.has(g)||(Fe.add(g),g.addEventListener("loadedmetadata",Ct),g.addEventListener("durationchange",Ct),g.preload!=="auto"&&(g.preload="auto"),g.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&g.load())},$n=()=>{let d=E=>{let _=E.closest("[data-composition-id]"),le=_?B(_,0):null,ae=_?W(_,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:_,inheritedStart:le,inheritedDuration:ae}},g=li({shouldIncludeElement:E=>E.hasAttribute("data-start")||!!d(E).compositionRoot,resolveStartSeconds:E=>{let _=d(E);return B(E,_.inheritedStart??0)},resolveDurationSeconds:E=>{let _=d(E),le=B(E,_.inheritedStart??0),ae=Number.parseFloat(E.dataset.playbackStart??E.dataset.mediaStart??"0")||0,V=_.inheritedStart!=null&&_.inheritedDuration!=null&&_.inheritedDuration>0?Math.max(0,_.inheritedStart+_.inheritedDuration-le):null,we=Number.isFinite(E.duration)&&E.duration>ae?Math.max(0,E.duration-ae):null;return we!=null&&V!=null?Math.min(we,V):we??V}});ai({clips:g.mediaClips,timeSeconds:n.currentTime,playing:n.isPlaying,playbackRate:n.playbackRate,outputMuted:n.mediaOutputMuted,userMuted:n.bridgeMuted,onAutoplayBlocked:()=>{n.mediaAutoplayBlockedPosted||(n.mediaAutoplayBlockedPosted=!0,ge({source:"hf-preview",type:"media-autoplay-blocked"}))}});let x=document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null,w=Array.from(document.querySelectorAll("[data-start]"));for(let E of w){if(!(E instanceof HTMLElement))continue;let _=E.tagName.toLowerCase();if(_==="script"||_==="style"||_==="link"||_==="meta")continue;if(!E.getAttribute("data-composition-id")){let Se=E.closest("[data-composition-id]")?.getAttribute("data-composition-id")??null;if(Se&&Se!==x)continue}let ae=B(E,0),V=W(E),we=E.getAttribute("data-composition-id");if(we){let me=(window.__timelines??{})[we],Se=null;if(me&&typeof me.duration=="function"){let ue=Number(me.duration());Number.isFinite(ue)&&ue>0&&(Se=ue)}V!=null&&V>0&&Se!=null?V=Math.min(V,Se):(V==null||V<=0)&&Se!=null&&(V=Se)}let Re=V!=null&&V>0?ae+V:Number.POSITIVE_INFINITY,de=n.currentTime>=ae&&(Number.isFinite(Re)?n.currentTime<Re:!0);E.style.visibility=de?"visible":"hidden"}},Te=d=>{k();let g=Math.max(0,Math.round((n.currentTime||0)*n.canonicalFps)),x=Date.now();(d||g!==n.bridgeLastPostedFrame||n.isPlaying!==n.bridgeLastPostedPlaying||n.bridgeMuted!==n.bridgeLastPostedMuted||x-n.bridgeLastPostedAt>=n.bridgeMaxPostIntervalMs)&&(n.bridgeLastPostedFrame=g,n.bridgeLastPostedPlaying=n.isPlaying,n.bridgeLastPostedMuted=n.bridgeMuted,n.bridgeLastPostedAt=x,ge({source:"hf-preview",type:"state",frame:g,isPlaying:n.isPlaying,muted:n.bridgeMuted,playbackRate:n.playbackRate}))},je=()=>{b(),F(),N();let d=y();if(d){let x=p(d.getAttribute("data-width")),w=p(d.getAttribute("data-height")),E=x?parseInt(x,10):0,_=w?parseInt(w,10):0;E>0&&_>0&&ge({source:"hf-preview",type:"stage-size",width:E,height:_})}Q();let g=xi({canonicalFps:n.canonicalFps,maxTimelineDurationSeconds:n.maxTimelineDurationSeconds});window.__clipManifest=g,ge(g),P()},et=(d,g=0)=>{for(let x of n.deterministicAdapters){try{d==="discover"&&x.discover(),d==="pause"&&x.pause(),d==="play"&&x.play&&x.play()}catch{}if(d==="discover")try{x.seek({time:g})}catch{}}};if(T)Pn();else{let d={injectedStyles:n.injectedCompStyles,injectedScripts:n.injectedCompScripts,parseDimensionPx:p,onDiagnostic:({code:g,details:x})=>{ge({source:"hf-preview",type:"diagnostic",code:g,details:x})}};$r(d).then(()=>Gr(d)).finally(()=>{T=!0,et("discover",n.currentTime),Qt(),j(),Pn(),je(),Te(!0)})}let Mt=ui({postMessage:d=>ge(d)});Mt.installPickerApi();let Vn=d=>{let g=Number(d);!Number.isFinite(g)||g<=0?n.playbackRate=1:n.playbackRate=Math.max(.1,Math.min(5,g)),n.capturedTimeline&&typeof n.capturedTimeline.timeScale=="function"&&n.capturedTimeline.timeScale(n.playbackRate);let x=document.querySelectorAll("video, audio");for(let w of x)if(w instanceof HTMLMediaElement)try{w.playbackRate=n.playbackRate}catch{}},fe=di({getTimeline:()=>n.capturedTimeline,setTimeline:d=>{n.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>n.isPlaying,setIsPlaying:d=>{n.isPlaying=d},getPlaybackRate:()=>n.playbackRate,setPlaybackRate:Vn,getCanonicalFps:()=>n.canonicalFps,onSyncMedia:(d,g)=>{n.currentTime=Math.max(0,Number(d)||0),n.isPlaying=g,$n()},onStatePost:Te,onDeterministicSeek:d=>{for(let g of n.deterministicAdapters)try{g.seek({time:Number(d)||0})}catch{}},onDeterministicPause:()=>et("pause"),onDeterministicPlay:()=>et("play"),onRenderFrameSeek:()=>{},onShowNativeVideos:()=>{},getSafeDuration:()=>xe(n.capturedTimeline,0)});window.__player=a(fe),window.__playerReady=!0,window.__renderReady=!0,Zn(ge),nt("composition_loaded",{duration:fe.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),n.controlBridgeHandler=Yn({onPlay:()=>{fe.play(),nt("composition_played",{time:fe.getTime()})},onPause:()=>{fe.pause(),nt("composition_paused",{time:fe.getTime()})},onSeek:(d,g)=>{let x=Math.max(0,d)/n.canonicalFps;fe.seek(x),nt("composition_seeked",{time:x})},onSetMuted:d=>{n.bridgeMuted=d;let g=d||n.mediaOutputMuted,x=document.querySelectorAll("video, audio");for(let w of x)w instanceof HTMLMediaElement&&(w.muted=g)},onSetMediaOutputMuted:d=>{n.mediaOutputMuted=d;let g=d||n.bridgeMuted,x=document.querySelectorAll("video, audio");for(let w of x)w instanceof HTMLMediaElement&&(w.muted=g)},onSetPlaybackRate:d=>Vn(d),onEnablePickMode:()=>Mt.enablePickMode(),onDisablePickMode:()=>Mt.disablePickMode()}),Q(),n.capturedTimeline&&(fe._timeline=n.capturedTimeline),T&&setTimeout(()=>{let d=n.capturedTimeline;Q()&&n.capturedTimeline!==d&&(fe._timeline=n.capturedTimeline),et("discover",n.currentTime),je(),Te(!0)},0),n.deterministicAdapters=[si(),Xn({resolveStartSeconds:d=>B(d,0)}),ti(),ri(),oi(),ei({getTimeline:()=>n.capturedTimeline})],I(),et("discover"),Qt(),n.timelinePollIntervalId&&clearInterval(n.timelinePollIntervalId);let Yt=0,kt=null,Kn=0,Zt=!1,Ge=0,Jn=()=>{Kn=Date.now(),Zt=!1,Ge=0};n.timelinePollIntervalId=setInterval(()=>{Yt+=1;let g=n.isPlaying&&n.capturedTimeline!=null&&Math.max(0,n.currentTime||0)<A?!1:Q();if(n.capturedTimeline&&!fe._timeline&&(fe._timeline=n.capturedTimeline),(g||Yt%20===0)&&je(),Yt%10===0&&Qt(),k(),n.isPlaying&&n.capturedTimeline){let x=Math.max(0,n.currentTime||0),w=kt,E=xe(n.capturedTimeline,0);if(E>0&&x>=E){fe.pause(),fe.seek(E),kt=E,Ge=0,Te(!0);return}if(w!=null&&w>=m&&x<=h?Ge+=1:Ge=0,!Zt&&Ge>=C&&Date.now()-Kn>M){let le=R();Ne(le,"loop_guard")&&(Zt=!0,Ge=0)}kt=Math.max(0,n.currentTime||0)}else kt=Math.max(0,n.currentTime||0);n.isPlaying&&$n(),Te(!1)},50),je(),Te(!0);let No=fe.seek;fe.seek=d=>{Jn(),No(d)};let wo=fe.renderSeek;fe.renderSeek=d=>{Jn(),wo(d)};let Xt=()=>{if(!n.tornDown){n.tornDown=!0,n.timelinePollIntervalId&&(clearInterval(n.timelinePollIntervalId),n.timelinePollIntervalId=null),ce!=null&&(window.clearTimeout(ce),ce=null),s!=null&&(window.cancelAnimationFrame(s),s=null),bo(),n.controlBridgeHandler&&(window.removeEventListener("message",n.controlBridgeHandler),n.controlBridgeHandler=null),t&&(window.removeEventListener("error",t),t=null),i&&(window.removeEventListener("unhandledrejection",i),i=null),n.beforeUnloadHandler&&(window.removeEventListener("beforeunload",n.beforeUnloadHandler),n.beforeUnloadHandler=null),Mt.disablePickMode();for(let d of n.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch{}n.deterministicAdapters=[];for(let d of r.splice(0))try{d()}catch{}for(let d of n.injectedCompStyles)try{d.remove()}catch{}n.injectedCompStyles=[];for(let d of n.injectedCompScripts)try{d.remove()}catch{}n.injectedCompScripts=[],n.capturedTimeline=null,e.__hfRuntimeTeardown===Xt&&(e.__hfRuntimeTeardown=null)}};e.__hfRuntimeTeardown=Xt,n.beforeUnloadHandler=Xt,window.addEventListener("beforeunload",n.beforeUnloadHandler)}var Qr=["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"],In=[[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 Cl(n){if(n<=255)return Qr[n];let e=0,t=In.length-1;for(;e<=t;){let i=e+t>>1,r=In[i];if(n<r[0]){t=i-1;continue}if(n>r[1]){e=i+1;continue}return r[2]}return"L"}function Ml(n){let e=n.length;if(e===0)return null;let t=new Array(e),i=!1;for(let a=0;a<e;){let l=n.charCodeAt(a),f=l,m=1;if(l>=55296&&l<=56319&&a+1<e){let M=n.charCodeAt(a+1);M>=56320&&M<=57343&&(f=(l-55296<<10)+(M-56320)+65536,m=2)}let h=Cl(f);(h==="R"||h==="AL"||h==="AN")&&(i=!0);for(let M=0;M<m;M++)t[a+M]=h;a+=m}if(!i)return null;let r=0;for(let a=0;a<e;a++){let l=t[a];if(l==="L"){r=0;break}if(l==="R"||l==="AL"){r=1;break}}let o=new Int8Array(e);for(let a=0;a<e;a++)o[a]=r;let s=r&1?"R":"L",c=s,u=c;for(let a=0;a<e;a++)t[a]==="NSM"?t[a]=u:u=t[a];u=c;for(let a=0;a<e;a++){let l=t[a];l==="EN"?t[a]=u==="AL"?"AN":"EN":(l==="R"||l==="L"||l==="AL")&&(u=l)}for(let a=0;a<e;a++)t[a]==="AL"&&(t[a]="R");for(let a=1;a<e-1;a++)t[a]==="ES"&&t[a-1]==="EN"&&t[a+1]==="EN"&&(t[a]="EN"),t[a]==="CS"&&(t[a-1]==="EN"||t[a-1]==="AN")&&t[a+1]===t[a-1]&&(t[a]=t[a-1]);for(let a=0;a<e;a++){if(t[a]!=="EN")continue;let l;for(l=a-1;l>=0&&t[l]==="ET";l--)t[l]="EN";for(l=a+1;l<e&&t[l]==="ET";l++)t[l]="EN"}for(let a=0;a<e;a++){let l=t[a];(l==="WS"||l==="ES"||l==="ET"||l==="CS")&&(t[a]="ON")}u=c;for(let a=0;a<e;a++){let l=t[a];l==="EN"?t[a]=u==="L"?"L":"EN":(l==="R"||l==="L")&&(u=l)}for(let a=0;a<e;a++){if(t[a]!=="ON")continue;let l=a+1;for(;l<e&&t[l]==="ON";)l++;let f=a>0?t[a-1]:c,m=l<e?t[l]:c,h=f!=="L"?"R":"L";if(h===(m!=="L"?"R":"L"))for(let C=a;C<l;C++)t[C]=h;a=l-1}for(let a=0;a<e;a++)t[a]==="ON"&&(t[a]=s);for(let a=0;a<e;a++){let l=t[a];(o[a]&1)===0?l==="R"?o[a]++:(l==="AN"||l==="EN")&&(o[a]+=2):(l==="L"||l==="AN"||l==="EN")&&o[a]++}return o}function Yr(n,e){let t=Ml(n);if(t===null)return null;let i=new Int8Array(e.length);for(let r=0;r<e.length;r++)i[r]=t[e[r]];return i}var kl=/[ \\t\\n\\r\\f]+/g,Dl=/[\\t\\n\\r\\f]| {2,}|^ | $/;function Ll(n){let e=n??"normal";return e==="pre-wrap"?{mode:e,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:e,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Tl(n){if(!Dl.test(n))return n;let e=n.replace(kl," ");return e.charCodeAt(0)===32&&(e=e.slice(1)),e.length>0&&e.charCodeAt(e.length-1)===32&&(e=e.slice(0,-1)),e}function Rl(n){return/[\\r\\f]/.test(n)?n.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):n.replace(/\\r\\n/g,`\n`)}var Wn=null,vl;function Bl(){return Wn===null&&(Wn=new Intl.Segmenter(vl,{granularity:"word"})),Wn}var _l=/\\p{Script=Arabic}/u,Gt=/\\p{M}/u,oo=/\\p{Nd}/u;function Zr(n){return _l.test(n)}function Xr(n){return n>=19968&&n<=40959||n>=13312&&n<=19903||n>=131072&&n<=173791||n>=173824&&n<=177983||n>=177984&&n<=178207||n>=178208&&n<=183983||n>=183984&&n<=191471||n>=191472&&n<=192093||n>=194560&&n<=195103||n>=196608&&n<=201551||n>=201552&&n<=205743||n>=205744&&n<=210041||n>=63744&&n<=64255||n>=12288&&n<=12351||n>=12352&&n<=12447||n>=12448&&n<=12543||n>=44032&&n<=55215||n>=65280&&n<=65519}function Me(n){for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);if(!(t<12288)){if(t>=55296&&t<=56319&&e+1<n.length){let i=n.charCodeAt(e+1);if(i>=56320&&i<=57343){let r=(t-55296<<10)+(i-56320)+65536;if(Xr(r))return!0;e++;continue}}if(Xr(t))return!0}}return!1}function Ol(n){let e=Kt(n);return e!==null&&(Vt.has(e)||Oe.has(e))}var Pl=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function Il(n){return Me(n)}function Wl(n){let e=Kt(n);return e!==null&&Pl.has(e)}function $t(n){return!Ol(n)&&!Wl(n)}var Vt=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"]),wt=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),Un=new Set(["\'","\\u2019"]),Oe=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),Hl=new Set([":",".","\\u060C","\\u061B"]),Ul=new Set(["\\u104F"]),ql=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function zl(n){if(qn(n))return!0;let e=!1;for(let t of n){if(Oe.has(t)){e=!0;continue}if(!(e&&Gt.test(t)))return!1}return e}function jl(n){for(let e of n)if(!Vt.has(e)&&!Oe.has(e))return!1;return n.length>0}function Gl(n){if(qn(n))return!0;for(let e of n)if(!wt.has(e)&&!Un.has(e)&&!Gt.test(e))return!1;return n.length>0}function qn(n){let e=!1;for(let t of n)if(!(t==="\\\\"||Gt.test(t))){if(wt.has(t)||Oe.has(t)||Un.has(t)){e=!0;continue}return!1}return e}function so(n,e){let t=e-1;if(t<=0)return Math.max(t,0);let i=n.charCodeAt(t);if(i<56320||i>57343)return t;let r=t-1;if(r<0)return t;let o=n.charCodeAt(r);return o>=55296&&o<=56319?r:t}function Kt(n){if(n.length===0)return null;let e=so(n,n.length);return n.slice(e)}function $l(n){let e=Array.from(n),t=e.length;for(;t>0;){let i=e[t-1];if(Gt.test(i)){t--;continue}if(wt.has(i)||Un.has(i)){t--;continue}break}return t<=0||t===e.length?null:{head:e.slice(0,t).join(""),tail:e.slice(t).join("")}}function Vl(n,e,t){return t==="text"&&!e&&n.length===1&&n!=="-"&&n!=="\\u2014"?n:null}function eo(n,e,t,i){let r=e[i],o=n[i];if(r==null)return o;let s=t[i];if(o.length===s)return o;let c=r.repeat(s);return n[i]=c,c}function to(n,e){return n&&e!==null&&Hl.has(e)}function Kl(n){let e=Kt(n);return e!==null&&Ul.has(e)}function Jl(n){if(n.length<2||n[0]!==" ")return null;let e=n.slice(1);return/^\\p{M}+$/u.test(e)?{space:" ",marks:e}:null}function Jt(n){let e=n.length;for(;e>0;){let t=so(n,e),i=n.slice(t,e);if(ql.has(i))return!0;if(!Oe.has(i))return!1;e=t}return!1}function Ql(n,e){if(e.preserveOrdinarySpaces||e.preserveHardBreaks){if(n===" ")return"preserved-space";if(n===" ")return"tab";if(e.preserveHardBreaks&&n===`\n`)return"hard-break"}return n===" "?"space":n==="\\xA0"||n==="\\u202F"||n==="\\u2060"||n==="\\uFEFF"?"glue":n==="\\u200B"?"zero-width-break":n==="\\xAD"?"soft-hyphen":"text"}var Yl=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function be(n){return n.length===1?n[0]:n.join("")}function Zl(n,e){let t=[];for(let i=n.length-1;i>=0;i--)t.push(n[i]);return t.push(e),be(t)}function Xl(n,e,t,i){if(!Yl.test(n))return[{text:n,isWordLike:e,kind:"text",start:t}];let r=[],o=null,s=[],c=t,u=!1,a=0;for(let l of n){let f=Ql(l,i),m=f==="text"&&e;if(o!==null&&f===o&&m===u){s.push(l),a+=l.length;continue}o!==null&&r.push({text:be(s),isWordLike:u,kind:o,start:c}),o=f,s=[l],c=t+a,u=m,a+=l.length}return o!==null&&r.push({text:be(s),isWordLike:u,kind:o,start:c}),r}function Hn(n){return n==="space"||n==="preserved-space"||n==="zero-width-break"||n==="hard-break"}var ea=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function ta(n,e){let t=n.texts[e];return t.startsWith("www.")?!0:ea.test(t)&&e+1<n.len&&n.kinds[e+1]==="text"&&n.texts[e+1]==="//"}function na(n){return n.includes("?")&&(n.includes("://")||n.startsWith("www."))}function ia(n){let e=n.texts.slice(),t=n.isWordLike.slice(),i=n.kinds.slice(),r=n.starts.slice();for(let s=0;s<n.len;s++){if(i[s]!=="text"||!ta(n,s))continue;let c=[e[s]],u=s+1;for(;u<n.len&&!Hn(i[u]);){c.push(e[u]),t[s]=!0;let a=e[u].includes("?");if(i[u]="text",e[u]="",u++,a)break}e[s]=be(c)}let o=0;for(let s=0;s<e.length;s++){let c=e[s];c.length!==0&&(o!==s&&(e[o]=c,t[o]=t[s],i[o]=i[s],r[o]=r[s]),o++)}return e.length=o,t.length=o,i.length=o,r.length=o,{len:o,texts:e,isWordLike:t,kinds:i,starts:r}}function ra(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o];if(e.push(s),t.push(n.isWordLike[o]),i.push(n.kinds[o]),r.push(n.starts[o]),!na(s))continue;let c=o+1;if(c>=n.len||Hn(n.kinds[c]))continue;let u=[],a=n.starts[c],l=c;for(;l<n.len&&!Hn(n.kinds[l]);)u.push(n.texts[l]),l++;u.length>0&&(e.push(be(u)),t.push(!0),i.push("text"),r.push(a),o=l-1)}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}var oa=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),no=/^[A-Za-z0-9_]+[,:;]*$/,io=/[,:;]+$/;function lo(n){for(let e of n)if(oo.test(e))return!0;return!1}function Nt(n){if(n.length===0)return!1;for(let e of n)if(!(oo.test(e)||oa.has(e)))return!1;return!0}function sa(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o],c=n.kinds[o];if(c==="text"&&Nt(s)&&lo(s)){let u=[s],a=o+1;for(;a<n.len&&n.kinds[a]==="text"&&Nt(n.texts[a]);)u.push(n.texts[a]),a++;e.push(be(u)),t.push(!0),i.push("text"),r.push(n.starts[o]),o=a-1;continue}e.push(s),t.push(n.isWordLike[o]),i.push(c),r.push(n.starts[o])}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function la(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o],c=n.kinds[o],u=n.isWordLike[o];if(c==="text"&&u&&no.test(s)){let a=[s],l=io.test(s),f=o+1;for(;l&&f<n.len&&n.kinds[f]==="text"&&n.isWordLike[f]&&no.test(n.texts[f]);){let m=n.texts[f];a.push(m),l=io.test(m),f++}e.push(be(a)),t.push(!0),i.push("text"),r.push(n.starts[o]),o=f-1;continue}e.push(s),t.push(u),i.push(c),r.push(n.starts[o])}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function aa(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o];if(n.kinds[o]==="text"&&s.includes("-")){let c=s.split("-"),u=c.length>1;for(let a=0;a<c.length;a++){let l=c[a];if(!u)break;(l.length===0||!lo(l)||!Nt(l))&&(u=!1)}if(u){let a=0;for(let l=0;l<c.length;l++){let f=c[l],m=l<c.length-1?`${f}-`:f;e.push(m),t.push(!0),i.push("text"),r.push(n.starts[o]+a),a+=m.length}continue}}e.push(s),t.push(n.isWordLike[o]),i.push(n.kinds[o]),r.push(n.starts[o])}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function ua(n){let e=[],t=[],i=[],r=[],o=0;for(;o<n.len;){let s=[n.texts[o]],c=n.isWordLike[o],u=n.kinds[o],a=n.starts[o];if(u==="glue"){let l=[s[0]],f=a;for(o++;o<n.len&&n.kinds[o]==="glue";)l.push(n.texts[o]),o++;let m=be(l);if(o<n.len&&n.kinds[o]==="text")s[0]=m,s.push(n.texts[o]),c=n.isWordLike[o],u="text",a=f,o++;else{e.push(m),t.push(!1),i.push("glue"),r.push(f);continue}}else o++;if(u==="text")for(;o<n.len&&n.kinds[o]==="glue";){let l=[];for(;o<n.len&&n.kinds[o]==="glue";)l.push(n.texts[o]),o++;let f=be(l);if(o<n.len&&n.kinds[o]==="text"){s.push(f,n.texts[o]),c=c||n.isWordLike[o],o++;continue}s.push(f)}e.push(be(s)),t.push(c),i.push(u),r.push(a)}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function ca(n){let e=n.texts.slice(),t=n.isWordLike.slice(),i=n.kinds.slice(),r=n.starts.slice();for(let o=0;o<e.length-1;o++){if(i[o]!=="text"||i[o+1]!=="text"||!Me(e[o])||!Me(e[o+1]))continue;let s=$l(e[o]);s!==null&&(e[o]=s.head,e[o+1]=s.tail+e[o+1],r[o+1]=r[o]+s.head.length)}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function ro(n,e,t){let i=Bl(),r=0,o=[],s=[],c=[],u=[],a=[],l=[],f=[],m=[],h=[],M=[],C=[],A=[];for(let p of i.segment(n))for(let y of Xl(p.segment,p.isWordLike??!1,p.index,t)){let X=function(){l[T]!==null&&(s[T]=[eo(o,l,f,T)],l[T]=null),s[T].push(y.text),c[T]=c[T]||y.isWordLike,m[T]=m[T]||N,h[T]=h[T]||B,M[T]=H,C[T]=Z,A[T]=to(h[T],W)},F=y.kind==="text",b=Vl(y.text,y.isWordLike,y.kind),N=Me(y.text),B=Zr(y.text),W=Kt(y.text),H=Jt(y.text),Z=Kl(y.text),T=r-1;e.carryCJKAfterClosingQuote&&F&&r>0&&u[T]==="text"&&N&&m[T]&&M[T]||F&&r>0&&u[T]==="text"&&jl(y.text)&&m[T]||F&&r>0&&u[T]==="text"&&C[T]?X():F&&r>0&&u[T]==="text"&&y.isWordLike&&B&&A[T]?(X(),c[T]=!0):b!==null&&r>0&&u[T]==="text"&&l[T]===b?f[T]=(f[T]??1)+1:F&&!y.isWordLike&&r>0&&u[T]==="text"&&(zl(y.text)||y.text==="-"&&c[T])?X():(o[r]=y.text,s[r]=[y.text],c[r]=y.isWordLike,u[r]=y.kind,a[r]=y.start,l[r]=b,f[r]=b===null?0:1,m[r]=N,h[r]=B,M[r]=H,C[r]=Z,A[r]=to(B,W),r++)}for(let p=0;p<r;p++){if(l[p]!==null){o[p]=eo(o,l,f,p);continue}o[p]=be(s[p])}for(let p=1;p<r;p++)u[p]==="text"&&!c[p]&&qn(o[p])&&u[p-1]==="text"&&(o[p-1]+=o[p],c[p-1]=c[p-1]||c[p],o[p]="");let z=Array.from({length:r},()=>null),O=-1;for(let p=r-1;p>=0;p--){let y=o[p];if(y.length!==0){if(u[p]==="text"&&!c[p]&&Gl(y)&&O>=0&&u[O]==="text"){let F=z[O]??[];F.push(y),z[O]=F,a[O]=a[p],o[p]="";continue}O=p}}for(let p=0;p<r;p++){let y=z[p];y!=null&&(o[p]=Zl(y,o[p]))}let D=0;for(let p=0;p<r;p++){let y=o[p];y.length!==0&&(D!==p&&(o[D]=y,c[D]=c[p],u[D]=u[p],a[D]=a[p]),D++)}o.length=D,c.length=D,u.length=D,a.length=D;let Y=ua({len:D,texts:o,isWordLike:c,kinds:u,starts:a}),S=ca(la(aa(sa(ra(ia(Y))))));for(let p=0;p<S.len-1;p++){let y=Jl(S.texts[p]);y!==null&&(S.kinds[p]!=="space"&&S.kinds[p]!=="preserved-space"||S.kinds[p+1]!=="text"||!Zr(S.texts[p+1])||(S.texts[p]=y.space,S.isWordLike[p]=!1,S.kinds[p]=S.kinds[p]==="preserved-space"?"preserved-space":"space",S.texts[p+1]=y.marks+S.texts[p+1],S.starts[p+1]=S.starts[p]+y.space.length))}return S}function da(n,e){if(n.len===0)return[];if(!e.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:n.len,consumedEndSegmentIndex:n.len}];let t=[],i=0;for(let r=0;r<n.len;r++)n.kinds[r]==="hard-break"&&(t.push({startSegmentIndex:i,endSegmentIndex:r,consumedEndSegmentIndex:r+1}),i=r+1);return i<n.len&&t.push({startSegmentIndex:i,endSegmentIndex:n.len,consumedEndSegmentIndex:n.len}),t}function fa(n){if(n.len<=1)return n;let e=[],t=[],i=[],r=[],o=null,s=!1,c=0,u=!1,a=!1;function l(){o!==null&&(e.push(be(o)),t.push(s),i.push("text"),r.push(c),o=null)}for(let f=0;f<n.len;f++){let m=n.texts[f],h=n.kinds[f],M=n.isWordLike[f],C=n.starts[f];if(h==="text"){let A=Il(m),z=$t(m);if(o!==null&&u&&a){o.push(m),s=s||M,u=u||A,a=z;continue}l(),o=[m],s=M,c=C,u=A,a=z;continue}l(),e.push(m),t.push(M),i.push(h),r.push(C)}return l(),{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function ao(n,e,t="normal",i="normal"){let r=Ll(t),o=r.mode==="pre-wrap"?Rl(n):Tl(n);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let s=i==="keep-all"?fa(ro(o,e,r)):ro(o,e,r);return{normalized:o,chunks:da(s,r),...s}}var Ye=null,uo=new Map,Ze=null,ma=96,pa=/\\p{Emoji_Presentation}/u,ha=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,zn=null,co=new Map;function jn(){if(Ye!==null)return Ye;if(typeof OffscreenCanvas<"u")return Ye=new OffscreenCanvas(1,1).getContext("2d"),Ye;if(typeof document<"u")return Ye=document.createElement("canvas").getContext("2d"),Ye;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function xa(n){let e=uo.get(n);return e||(e=new Map,uo.set(n,e)),e}function Le(n,e){let t=e.get(n);return t===void 0&&(t={width:jn().measureText(n).width,containsCJK:Me(n)},e.set(n,t)),t}function Xe(){if(Ze!==null)return Ze;if(typeof navigator>"u")return Ze={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ze;let n=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&n.includes("Safari/")&&!n.includes("Chrome/")&&!n.includes("Chromium/")&&!n.includes("CriOS/")&&!n.includes("FxiOS/")&&!n.includes("EdgiOS/"),i=n.includes("Chrome/")||n.includes("Chromium/")||n.includes("CriOS/")||n.includes("Edg/");return Ze={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:i,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Ze}function ga(n){let e=n.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return e?parseFloat(e[1]):16}function fo(){return zn===null&&(zn=new Intl.Segmenter(void 0,{granularity:"grapheme"})),zn}function ya(n){return pa.test(n)||n.includes("\\uFE0F")}function mo(n){return ha.test(n)}function Sa(n,e){let t=co.get(n);if(t!==void 0)return t;let i=jn();i.font=n;let r=i.measureText("\\u{1F600}").width;if(t=0,r>e+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=n,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\\u{1F600}",document.body.appendChild(o);let s=o.getBoundingClientRect().width;document.body.removeChild(o),r-s>.5&&(t=r-s)}return co.set(n,t),t}function Aa(n){let e=0,t=fo();for(let i of t.segment(n))ya(i.segment)&&e++;return e}function Ea(n,e){return e.emojiCount===void 0&&(e.emojiCount=Aa(n)),e.emojiCount}function Pe(n,e,t){return t===0?e.width:e.width-Ea(n,e)*t}function po(n,e,t,i,r){if(e.breakableFitAdvances!==void 0)return e.breakableFitAdvances;let o=fo(),s=[];for(let l of o.segment(n))s.push(l.segment);if(s.length<=1)return e.breakableFitAdvances=null,e.breakableFitAdvances;if(r==="sum-graphemes"){let l=[];for(let f of s){let m=Le(f,t);l.push(Pe(f,m,i))}return e.breakableFitAdvances=l,e.breakableFitAdvances}if(r==="pair-context"||s.length>ma){let l=[],f=null,m=0;for(let h of s){let M=Le(h,t),C=Pe(h,M,i);if(f===null)l.push(C);else{let A=f+h,z=Le(A,t);l.push(Pe(A,z,i)-m)}f=h,m=C}return e.breakableFitAdvances=l,e.breakableFitAdvances}let c=[],u="",a=0;for(let l of s){u+=l;let f=Le(u,t),m=Pe(u,f,i);c.push(m-a),a=m}return e.breakableFitAdvances=c,e.breakableFitAdvances}function ho(n,e){let t=jn();t.font=n;let i=xa(n),r=ga(n),o=e?Sa(n,r):0;return{cache:i,fontSize:r,emojiCorrection:o}}function Fa(n,e){for(;e<n.widths.length;){let t=n.kinds[e];if(t!=="space"&&t!=="zero-width-break"&&t!=="soft-hyphen")break;e++}return e}function ba(n,e){if(e<=0)return 0;let t=n%e;return Math.abs(t)<=1e-6?e:e-t}function Na(n,e,t,i,r){let o=0,s=e;for(;o<n.length;){let c=s+n[o];if((o+1<n.length?c+r:c)>t+i)break;s=c,o++}return{fitCount:o,fittedWidth:s}}function xo(n,e){return n.simpleLineWalkFastPath?go(n,e):yo(n,e)}function go(n,e,t){let{widths:i,kinds:r,breakableFitAdvances:o}=n;if(i.length===0)return 0;let c=Xe().lineFitEpsilon,u=e+c,a=0,l=0,f=!1,m=0,h=0,M=0,C=0,A=-1,z=0;function O(){A=-1,z=0}function D(b=M,N=C,B=l){a++,t?.({startSegmentIndex:m,startGraphemeIndex:h,endSegmentIndex:b,endGraphemeIndex:N,width:B}),l=0,f=!1,O()}function Y(b,N){f=!0,m=b,h=0,M=b+1,C=0,l=N}function S(b,N,B){f=!0,m=b,h=N,M=b,C=N+1,l=B}function p(b,N){if(!f){Y(b,N);return}l+=N,M=b+1,C=0}function y(b,N){let B=o[b];for(let W=N;W<B.length;W++){let H=B[W];f?l+H>u?(D(),S(b,W,H)):(l+=H,M=b,C=W+1):S(b,W,H)}f&&M===b&&C===B.length&&(M=b+1,C=0)}let F=0;for(;F<i.length&&!(!f&&(F=Fa(n,F),F>=i.length));){let b=i[F],N=r[F],B=N==="space"||N==="preserved-space"||N==="tab"||N==="zero-width-break"||N==="soft-hyphen";if(!f){b>e&&o[F]!==null?y(F,0):Y(F,b),B&&(A=F+1,z=l-b),F++;continue}if(l+b>u){if(B){p(F,b),D(F+1,0,l-b),F++;continue}if(A>=0){if(M>A||M===A&&C>0){D();continue}D(A,0,z);continue}if(b>e&&o[F]!==null){D(),y(F,0),F++;continue}D();continue}p(F,b),B&&(A=F+1,z=l-b),F++}return f&&D(),a}function yo(n,e,t){if(n.simpleLineWalkFastPath)return go(n,e,t);let{widths:i,lineEndFitAdvances:r,lineEndPaintAdvances:o,kinds:s,breakableFitAdvances:c,discretionaryHyphenWidth:u,tabStopAdvance:a,chunks:l}=n;if(i.length===0||l.length===0)return 0;let f=Xe(),m=f.lineFitEpsilon,h=e+m,M=0,C=0,A=!1,z=0,O=0,D=0,Y=0,S=-1,p=0,y=0,F=null;function b(){S=-1,p=0,y=0,F=null}function N(U=D,G=Y,v=C){M++,t?.({startSegmentIndex:z,startGraphemeIndex:O,endSegmentIndex:U,endGraphemeIndex:G,width:v}),C=0,A=!1,b()}function B(U,G){A=!0,z=U,O=0,D=U+1,Y=0,C=G}function W(U,G,v){A=!0,z=U,O=G,D=U,Y=G+1,C=v}function H(U,G){if(!A){B(U,G);return}C+=G,D=U+1,Y=0}function Z(U,G,v,J){if(!G)return;let Ee=U==="tab"?0:r[v],xe=U==="tab"?J:o[v];S=v+1,p=C-J+Ee,y=C-J+xe,F=U}function T(U,G){let v=c[U];for(let J=G;J<v.length;J++){let Ee=v[J];A?C+Ee>h?(N(),W(U,J,Ee)):(C+=Ee,D=U,Y=J+1):W(U,J,Ee)}A&&D===U&&Y===v.length&&(D=U+1,Y=0)}function X(U){if(F!=="soft-hyphen")return!1;let G=c[U];if(G==null)return!1;let{fitCount:v,fittedWidth:J}=Na(G,C,e,m,u);return v===0?!1:(C=J,D=U,Y=v,b(),v===G.length?(D=U+1,Y=0,!0):(N(U,v,J+u),T(U,v),!0))}function ee(U){M++,t?.({startSegmentIndex:U.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:U.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),b()}for(let U=0;U<l.length;U++){let G=l[U];if(G.startSegmentIndex===G.endSegmentIndex){ee(G);continue}A=!1,C=0,z=G.startSegmentIndex,O=0,D=G.startSegmentIndex,Y=0,b();let v=G.startSegmentIndex;for(;v<G.endSegmentIndex;){let J=s[v],Ee=J==="space"||J==="preserved-space"||J==="tab"||J==="zero-width-break"||J==="soft-hyphen",xe=J==="tab"?ba(C,a):i[v];if(J==="soft-hyphen"){A&&(D=v+1,Y=0,S=v+1,p=C+u,y=C+u,F=J),v++;continue}if(!A){xe>e&&c[v]!==null?T(v,0):B(v,xe),Z(J,Ee,v,xe),v++;continue}if(C+xe>h){let k=C+(J==="tab"?0:r[v]),L=C+(J==="tab"?xe:o[v]);if(F==="soft-hyphen"&&f.preferEarlySoftHyphenBreak&&p<=h){N(S,0,y);continue}if(F==="soft-hyphen"&&X(v)){v++;continue}if(Ee&&k<=h){H(v,xe),N(v+1,0,L),v++;continue}if(S>=0&&p<=h){if(D>S||D===S&&Y>0){N();continue}let Q=S;N(Q,0,y),v=Q;continue}if(xe>e&&c[v]!==null){N(),T(v,0),v++;continue}N();continue}H(v,xe),Z(J,Ee,v,xe),v++}if(A){let J=S===G.consumedEndSegmentIndex?y:C;N(G.consumedEndSegmentIndex,0,J)}}return M}var Gn=null;function wa(){return Gn===null&&(Gn=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Gn}function Ca(n){return n?{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 Ma(n,e){let t=[],i=[],r=0,o=!1,s=!1,c=!1;function u(){i.length!==0&&(t.push({text:i.length===1?i[0]:i.join(""),start:r}),i=[],o=!1,s=!1,c=!1)}function a(f,m,h){i=[f],r=m,o=h,s=Jt(f),c=wt.has(f)}function l(f,m){i.push(f),o=o||m;let h=Jt(f);f.length===1&&Oe.has(f)?s=s||h:s=h,c=!1}for(let f of wa().segment(n)){let m=f.segment,h=Me(m);if(i.length===0){a(m,f.index,h);continue}if(c||Vt.has(m)||Oe.has(m)||e.carryCJKAfterClosingQuote&&h&&s){l(m,h);continue}if(!o&&!h){l(m,h);continue}u(),a(m,f.index,h)}return u(),t}function ka(n){if(n.length<=1)return n;let e=[],t=[n[0].text],i=n[0].start,r=Me(n[0].text),o=$t(n[0].text);function s(){e.push({text:t.length===1?t[0]:t.join(""),start:i})}for(let c=1;c<n.length;c++){let u=n[c],a=Me(u.text),l=$t(u.text);if(r&&o){t.push(u.text),r=r||a,o=l;continue}s(),t=[u.text],i=u.start,r=a,o=l}return s(),e}function Da(n,e,t,i){let r=Xe(),{cache:o,emojiCorrection:s}=ho(e,mo(n.normalized)),c=Pe("-",Le("-",o),s),a=Pe(" ",Le(" ",o),s)*8;if(n.len===0)return Ca(t);let l=[],f=[],m=[],h=[],M=n.chunks.length<=1,C=t?[]:null,A=[],z=t?[]:null,O=Array.from({length:n.len});function D(y,F,b,N,B,W,H){B!=="text"&&B!=="space"&&B!=="zero-width-break"&&(M=!1),l.push(F),f.push(b),m.push(N),h.push(B),C?.push(W),A.push(H),z!==null&&z.push(y)}function Y(y,F,b,N,B){let W=Le(y,o),H=Pe(y,W,s),Z=F==="space"||F==="preserved-space"||F==="zero-width-break"?0:H,T=F==="space"||F==="zero-width-break"?0:H;if(B&&N&&y.length>1){let X="sum-graphemes";Nt(y)?X="pair-context":r.preferPrefixWidthsForBreakableRuns&&(X="segment-prefixes");let ee=po(y,W,o,s,X);D(y,H,Z,T,F,b,ee);return}D(y,H,Z,T,F,b,null)}for(let y=0;y<n.len;y++){O[y]=l.length;let F=n.texts[y],b=n.isWordLike[y],N=n.kinds[y],B=n.starts[y];if(N==="soft-hyphen"){D(F,0,c,c,N,B,null);continue}if(N==="hard-break"){D(F,0,0,0,N,B,null);continue}if(N==="tab"){D(F,0,0,0,N,B,null);continue}let W=Le(F,o);if(N==="text"&&W.containsCJK){let H=Ma(F,r),Z=i==="keep-all"?ka(H):H;for(let T=0;T<Z.length;T++){let X=Z[T];Y(X.text,"text",B+X.start,b,i==="keep-all"||!Me(X.text))}continue}Y(F,N,B,b,!0)}let S=La(n.chunks,O,l.length),p=C===null?null:Yr(n.normalized,C);return z!==null?{widths:l,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:h,simpleLineWalkFastPath:M,segLevels:p,breakableFitAdvances:A,discretionaryHyphenWidth:c,tabStopAdvance:a,chunks:S,segments:z}:{widths:l,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:h,simpleLineWalkFastPath:M,segLevels:p,breakableFitAdvances:A,discretionaryHyphenWidth:c,tabStopAdvance:a,chunks:S}}function La(n,e,t){let i=[];for(let r=0;r<n.length;r++){let o=n[r],s=o.startSegmentIndex<e.length?e[o.startSegmentIndex]:t,c=o.endSegmentIndex<e.length?e[o.endSegmentIndex]:t,u=o.consumedEndSegmentIndex<e.length?e[o.consumedEndSegmentIndex]:t;i.push({startSegmentIndex:s,endSegmentIndex:c,consumedEndSegmentIndex:u})}return i}function Ta(n,e,t,i){let r=i?.wordBreak??"normal",o=ao(n,Xe(),i?.whiteSpace,r);return Da(o,e,t,r)}function So(n,e,t){return Ta(n,e,!1,t)}function Ao(n,e,t){let i=xo(n,e);return{lineCount:i,height:i*t}}var Ra={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function Eo(n,e){let t={...Ra,...e},i=1.2;for(let r=t.baseFontSize;r>=t.minFontSize;r-=t.step){let o=`${t.fontWeight} ${r}px ${t.fontFamily}`,s=So(n,o),{lineCount:c}=Ao(s,t.maxWidth,r*i);if(c<=1)return{fontSize:r,fits:!0}}return{fontSize:t.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};window.__hyperframes={fitTextFontSize:Eo};function Fo(){let n=window;n.__hyperframeRuntimeBootstrapped||(n.__hyperframeRuntimeBootstrapped=!0,Jr())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Fo,{once:!0}):Fo();})();\n';
|
|
6541
|
+
RUNTIME_IIFE = '"use strict";(()=>{var Do=Object.create;var Yn=Object.defineProperty;var Lo=Object.getOwnPropertyDescriptor;var To=Object.getOwnPropertyNames;var Ro=Object.getPrototypeOf,vo=Object.prototype.hasOwnProperty;var K=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Bo=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of To(e))!vo.call(n,r)&&r!==t&&Yn(n,r,{get:()=>e[r],enumerable:!(i=Lo(e,r))||i.enumerable});return n};var _o=(n,e,t)=>(t=n!=null?Do(Ro(n)):{},Bo(e||!n||!n.__esModule?Yn(t,"default",{value:n,enumerable:!0}):t,n));var Si=K((lu,an)=>{var q=String,yi=function(){return{isColorSupported:!1,reset:q,bold:q,dim:q,italic:q,underline:q,inverse:q,hidden:q,strikethrough:q,black:q,red:q,green:q,yellow:q,blue:q,magenta:q,cyan:q,white:q,gray:q,bgBlack:q,bgRed:q,bgGreen:q,bgYellow:q,bgBlue:q,bgMagenta:q,bgCyan:q,bgWhite:q,blackBright:q,redBright:q,greenBright:q,yellowBright:q,blueBright:q,magentaBright:q,cyanBright:q,whiteBright:q,bgBlackBright:q,bgRedBright:q,bgGreenBright:q,bgYellowBright:q,bgBlueBright:q,bgMagentaBright:q,bgCyanBright:q,bgWhiteBright:q}};an.exports=yi();an.exports.createColors=yi});var un=K(()=>{});var Lt=K((cu,Fi)=>{"use strict";var Ai=Si(),Ei=un(),st=class n extends Error{constructor(e,t,i,r,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),r&&(this.source=r),s&&(this.plugin=s),typeof t<"u"&&typeof i<"u"&&(typeof t=="number"?(this.line=t,this.column=i):(this.line=t.line,this.column=t.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}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(e){if(!this.source)return"";let t=this.source;e==null&&(e=Ai.isColorSupported);let i=l=>l,r=l=>l,o=l=>l;if(e){let{bold:l,gray:f,red:m}=Ai.createColors(!0);r=h=>l(m(h)),i=h=>f(h),Ei&&(o=h=>Ei(h))}let s=t.split(/\\r?\\n/),c=Math.max(this.line-3,0),u=Math.min(this.line+2,s.length),a=String(u).length;return s.slice(c,u).map((l,f)=>{let m=c+1+f,h=" "+(" "+m).slice(-a)+" | ";if(m===this.line){if(l.length>160){let C=20,A=Math.max(0,this.column-C),z=Math.max(this.column+C,this.endColumn+C),O=l.slice(A,z),D=i(h.replace(/\\d/g," "))+l.slice(0,Math.min(this.column-1,C-1)).replace(/[^\\t]/g," ");return r(">")+i(h)+o(O)+`\n `+D+r("^")}let M=i(h.replace(/\\d/g," "))+l.slice(0,this.column-1).replace(/[^\\t]/g," ");return r(">")+i(h)+o(l)+`\n `+M+r("^")}return" "+i(h)+o(l)}).join(`\n`)}toString(){let e=this.showSourceCode();return e&&(e=`\n\n`+e+`\n`),this.name+": "+this.message+e}};Fi.exports=st;st.default=st});var cn=K((du,Ni)=>{"use strict";var bi={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function es(n){return n[0].toUpperCase()+n.slice(1)}var lt=class{constructor(e){this.builder=e}atrule(e,t){let i="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?i+=e.raws.afterName:r&&(i+=" "),e.nodes)this.block(e,i+r);else{let o=(e.raws.between||"")+(t?";":"");this.builder(i+r+o,e)}}beforeAfter(e,t){let i;e.type==="decl"?i=this.raw(e,null,"beforeDecl"):e.type==="comment"?i=this.raw(e,null,"beforeComment"):t==="before"?i=this.raw(e,null,"beforeRule"):i=this.raw(e,null,"beforeClose");let r=e.parent,o=0;for(;r&&r.type!=="root";)o+=1,r=r.parent;if(i.includes(`\n`)){let s=this.raw(e,null,"indent");if(s.length)for(let c=0;c<o;c++)i+=s}return i}block(e,t){let i=this.raw(e,"between","beforeOpen");this.builder(t+i+"{",e,"start");let r;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let i=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let o=e.nodes[r],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,t!==r||i)}}comment(e){let t=this.raw(e,"left","commentLeft"),i=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+i+"*/",e)}decl(e,t){let i=this.raw(e,"between","colon"),r=e.prop+i+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,i){let r;if(i||(i=t),t&&(r=e.raws[t],typeof r<"u"))return r;let o=e.parent;if(i==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return bi[i];let s=e.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[i]<"u")return s.rawCache[i];if(i==="before"||i==="after")return this.beforeAfter(e,i);{let c="raw"+es(i);this[c]?r=this[c](s,e):s.walk(u=>{if(r=u.raws[t],typeof r<"u")return!1})}return typeof r>"u"&&(r=bi[i]),s.rawCache[i]=r,r}rawBeforeClose(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return t=i.raws.after,t.includes(`\n`)&&(t=t.replace(/[^\\n]+$/,"")),!1}),t&&(t=t.replace(/\\S/g,"")),t}rawBeforeComment(e,t){let i;return e.walkComments(r=>{if(typeof r.raws.before<"u")return i=r.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(t,null,"beforeDecl"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeDecl(e,t){let i;return e.walkDecls(r=>{if(typeof r.raws.before<"u")return i=r.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(t,null,"beforeRule"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeOpen(e){let t;return e.walk(i=>{if(i.type!=="decl"&&(t=i.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(i=>{if(i.nodes&&(i.parent!==e||e.first!==i)&&typeof i.raws.before<"u")return t=i.raws.before,t.includes(`\n`)&&(t=t.replace(/[^\\n]+$/,"")),!1}),t&&(t=t.replace(/\\S/g,"")),t}rawColon(e){let t;return e.walkDecls(i=>{if(typeof i.raws.between<"u")return t=i.raws.between.replace(/[^\\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length===0&&(t=i.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(i=>{let r=i.parent;if(r&&r!==e&&r.parent&&r.parent===e&&typeof i.raws.before<"u"){let o=i.raws.before.split(`\n`);return t=o[o.length-1],t=t.replace(/\\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(t=i.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let i=e[t],r=e.raws[t];return r&&r.value===i?r.raw:i}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};Ni.exports=lt;lt.default=lt});var at=K((fu,wi)=>{"use strict";var ts=cn();function dn(n,e){new ts(e).stringify(n)}wi.exports=dn;dn.default=dn});var Tt=K((mu,fn)=>{"use strict";fn.exports.isClean=Symbol("isClean");fn.exports.my=Symbol("my")});var dt=K((pu,Ci)=>{"use strict";var ns=Lt(),is=cn(),rs=at(),{isClean:ut,my:os}=Tt();function mn(n,e){let t=new n.constructor;for(let i in n){if(!Object.prototype.hasOwnProperty.call(n,i)||i==="proxyCache")continue;let r=n[i],o=typeof r;i==="parent"&&o==="object"?e&&(t[i]=e):i==="source"?t[i]=r:Array.isArray(r)?t[i]=r.map(s=>mn(s,t)):(o==="object"&&r!==null&&(r=mn(r)),t[i]=r)}return t}function De(n,e){if(e&&typeof e.offset<"u")return e.offset;let t=1,i=1,r=0;for(let o=0;o<n.length;o++){if(i===e.line&&t===e.column){r=o;break}n[o]===`\n`?(t=1,i+=1):t+=1}return r}var ct=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[ut]=!1,this[os]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let i of e[t])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\\n\\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\\n\\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=mn(this);for(let i in e)t[i]=e[i];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:i,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:i.column,line:i.line},t)}return new ns(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,i){return e[t]===i||(e[t]=i,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markClean(){this[ut]=!0}markDirty(){if(this[ut]){this[ut]=!1;let e=this;for(;e=e.parent;)e[ut]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let i="document"in this.source.input?this.source.input.document:this.source.input.css,o=i.slice(De(i,this.source.start),De(i,this.source.end)).indexOf(e.word);o!==-1&&(t=this.positionInside(o))}return t}positionInside(e){let t=this.source.start.column,i=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,o=De(r,this.source.start),s=o+e;for(let c=o;c<s;c++)r[c]===`\n`?(t=1,i+=1):t+=1;return{column:t,line:i,offset:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,i={column:this.source.start.column,line:this.source.start.line,offset:De(t,this.source.start)},r=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:De(t,this.source.end)+1}:{column:i.column+1,line:i.line,offset:i.offset+1};if(e.word){let s=t.slice(De(t,this.source.start),De(t,this.source.end)).indexOf(e.word);s!==-1&&(i=this.positionInside(s),r=this.positionInside(s+e.word.length))}else e.start?i={column:e.start.column,line:e.start.line,offset:De(t,e.start)}:e.index&&(i=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line,offset:De(t,e.end)}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<i.line||r.line===i.line&&r.column<=i.column)&&(r={column:i.column+1,line:i.line,offset:i.offset+1}),{end:r,start:i}}raw(e,t){return new is().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,i=!1;for(let r of e)r===this?i=!0:i?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);i||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let i={},r=t==null;t=t||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let c=this[s];if(Array.isArray(c))i[s]=c.map(u=>typeof u=="object"&&u.toJSON?u.toJSON(null,t):u);else if(typeof c=="object"&&c.toJSON)i[s]=c.toJSON(null,t);else if(s==="source"){if(c==null)continue;let u=t.get(c.input);u==null&&(u=o,t.set(c.input,o),o++),i[s]={end:c.end,inputId:u,start:c.start}}else i[s]=c}return r&&(i.inputs=[...t.keys()].map(s=>s.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=rs){e.stringify&&(e=e.stringify);let t="";return e(this,i=>{t+=i}),t}warn(e,t,i={}){let r={node:this};for(let o in i)r[o]=i[o];return e.warn(t,r)}};Ci.exports=ct;ct.default=ct});var mt=K((hu,Mi)=>{"use strict";var ss=dt(),ft=class extends ss{constructor(e){super(e),this.type="comment"}};Mi.exports=ft;ft.default=ft});var ht=K((xu,ki)=>{"use strict";var ls=dt(),pt=class extends ls{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}};ki.exports=pt;pt.default=pt});var ve=K((gu,Pi)=>{"use strict";var Di=mt(),Li=ht(),as=dt(),{isClean:Ti,my:Ri}=Tt(),pn,vi,Bi,hn;function _i(n){return n.map(e=>(e.nodes&&(e.nodes=_i(e.nodes)),delete e.source,e))}function Oi(n){if(n[Ti]=!1,n.proxyOf.nodes)for(let e of n.proxyOf.nodes)Oi(e)}var Ce=class n extends as{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(...e){for(let t of e){let i=this.normalize(t,this.last);for(let r of i)this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),i,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(i=this.indexes[t],r=e(this.proxyOf.nodes[i],i),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...i)=>e[t](...i.map(r=>typeof r=="function"?(o,s)=>r(o.toProxy(),s):r)):t==="every"||t==="some"?i=>e[t]((r,...o)=>i(r.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(i=>i.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,i){return e[t]===i||(e[t]=i,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let i=this.index(e),r=this.normalize(t,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(let s of r)this.proxyOf.nodes.splice(i+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],i<o&&(this.indexes[s]=o+r.length);return this.markDirty(),this}insertBefore(e,t){let i=this.index(e),r=i===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[i],r).reverse();i=this.index(e);for(let c of o)this.proxyOf.nodes.splice(i,0,c);let s;for(let c in this.indexes)s=this.indexes[c],i<=s&&(this.indexes[c]=s+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=_i(vi(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Li(e)]}else if(e.selector||e.selectors)e=[new hn(e)];else if(e.name)e=[new pn(e)];else if(e.text)e=[new Di(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[Ri]||n.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[Ti]&&Oi(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(r.raws.before=t.raws.before.replace(/\\S/g,"")),r.parent=this.proxyOf,r))}prepend(...e){e=e.reverse();for(let t of e){let i=this.normalize(t,this.first,"prepend").reverse();for(let r of i)this.proxyOf.nodes.unshift(r);for(let r in this.indexes)this.indexes[r]=this.indexes[r]+i.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let i in this.indexes)t=this.indexes[i],t>=e&&(this.indexes[i]=t-1);return this.markDirty(),this}replaceValues(e,t,i){return i||(i=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,i))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,i)=>{let r;try{r=e(t,i)}catch(o){throw t.addToError(o)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="atrule"&&e.test(i.name))return t(i,r)}):this.walk((i,r)=>{if(i.type==="atrule"&&i.name===e)return t(i,r)}):(t=e,this.walk((i,r)=>{if(i.type==="atrule")return t(i,r)}))}walkComments(e){return this.walk((t,i)=>{if(t.type==="comment")return e(t,i)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="decl"&&e.test(i.prop))return t(i,r)}):this.walk((i,r)=>{if(i.type==="decl"&&i.prop===e)return t(i,r)}):(t=e,this.walk((i,r)=>{if(i.type==="decl")return t(i,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="rule"&&e.test(i.selector))return t(i,r)}):this.walk((i,r)=>{if(i.type==="rule"&&i.selector===e)return t(i,r)}):(t=e,this.walk((i,r)=>{if(i.type==="rule")return t(i,r)}))}};Ce.registerParse=n=>{vi=n};Ce.registerRule=n=>{hn=n};Ce.registerAtRule=n=>{pn=n};Ce.registerRoot=n=>{Bi=n};Pi.exports=Ce;Ce.default=Ce;Ce.rebuild=n=>{n.type==="atrule"?Object.setPrototypeOf(n,pn.prototype):n.type==="rule"?Object.setPrototypeOf(n,hn.prototype):n.type==="decl"?Object.setPrototypeOf(n,Li.prototype):n.type==="comment"?Object.setPrototypeOf(n,Di.prototype):n.type==="root"&&Object.setPrototypeOf(n,Bi.prototype),n[Ri]=!0,n.nodes&&n.nodes.forEach(e=>{Ce.rebuild(e)})}});var Rt=K((yu,Wi)=>{"use strict";var Ii=ve(),$e=class extends Ii{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};Wi.exports=$e;$e.default=$e;Ii.registerAtRule($e)});var vt=K((Su,qi)=>{"use strict";var us=ve(),Hi,Ui,Ue=class extends us{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Hi(new Ui,this,e).stringify()}};Ue.registerLazyResult=n=>{Hi=n};Ue.registerProcessor=n=>{Ui=n};qi.exports=Ue;Ue.default=Ue});var ji=K((Au,zi)=>{var cs="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ds=(n,e=21)=>(t=e)=>{let i="",r=t|0;for(;r--;)i+=n[Math.random()*n.length|0];return i},fs=(n=21)=>{let e="",t=n|0;for(;t--;)e+=cs[Math.random()*64|0];return e};zi.exports={nanoid:fs,customAlphabet:ds}});var Bt=K(()=>{});var _t=K(()=>{});var xn=K(()=>{});var Gi=K(()=>{});var yn=K((Du,Ki)=>{"use strict";var{existsSync:ms,readFileSync:ps}=Gi(),{dirname:gn,join:hs}=Bt(),{SourceMapConsumer:$i,SourceMapGenerator:Vi}=_t();function xs(n){return Buffer?Buffer.from(n,"base64").toString():window.atob(n)}var xt=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let i=t.map?t.map.prev:void 0,r=this.loadMap(t.from,i);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=gn(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new $i(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\\/json;charset=utf-?8;base64,/,i=/^data:application\\/json;base64,/,r=/^data:application\\/json;charset=utf-?8,/,o=/^data:application\\/json,/,s=e.match(r)||e.match(o);if(s)return decodeURIComponent(e.substr(s[0].length));let c=e.match(t)||e.match(i);if(c)return xs(e.substr(c[0].length));let u=e.match(/data:application\\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+u)}getAnnotationURL(e){return e.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\\/\\*\\s*# sourceMappingURL=/g);if(!t)return;let i=e.lastIndexOf(t.pop()),r=e.indexOf("*/",i);i>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(i,r)))}loadFile(e){if(this.root=gn(e),ms(e))return this.mapFile=e,ps(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let i=t(e);if(i){let r=this.loadFile(i);if(!r)throw new Error("Unable to load previous source map: "+i.toString());return r}}else{if(t instanceof $i)return Vi.fromSourceMap(t).toString();if(t instanceof Vi)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let i=this.annotation;return e&&(i=hs(gn(e),i)),this.loadFile(i)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};Ki.exports=xt;xt.default=xt});var gt=K((Lu,Xi)=>{"use strict";var{nanoid:gs}=ji(),{isAbsolute:En,resolve:Fn}=Bt(),{SourceMapConsumer:ys,SourceMapGenerator:Ss}=_t(),{fileURLToPath:Ji,pathToFileURL:Ot}=xn(),Qi=Lt(),As=yn(),Sn=un(),An=Symbol("lineToIndexCache"),Es=!!(ys&&Ss),Yi=!!(Fn&&En);function Zi(n){if(n[An])return n[An];let e=n.css.split(`\n`),t=new Array(e.length),i=0;for(let r=0,o=e.length;r<o;r++)t[r]=i,i+=e[r].length+1;return n[An]=t,t}var Ve=class{get from(){return this.file||this.id}constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.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,t.document&&(this.document=t.document.toString()),t.from&&(!Yi||/^\\w+:\\/\\//.test(t.from)||En(t.from)?this.file=t.from:this.file=Fn(t.from)),Yi&&Es){let i=new As(this.css,t);if(i.text){this.map=i;let r=i.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+gs(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,i,r={}){let o,s,c,u,a;if(t&&typeof t=="object"){let f=t,m=i;if(typeof f.offset=="number"){u=f.offset;let h=this.fromOffset(u);t=h.line,i=h.col}else t=f.line,i=f.column,u=this.fromLineAndColumn(t,i);if(typeof m.offset=="number"){c=m.offset;let h=this.fromOffset(c);s=h.line,o=h.col}else s=m.line,o=m.column,c=this.fromLineAndColumn(m.line,m.column)}else if(i)u=this.fromLineAndColumn(t,i);else{u=t;let f=this.fromOffset(u);t=f.line,i=f.col}let l=this.origin(t,i,s,o);return l?a=new Qi(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,r.plugin):a=new Qi(e,s===void 0?t:{column:i,line:t},s===void 0?i:{column:o,line:s},this.css,this.file,r.plugin),a.input={column:i,endColumn:o,endLine:s,endOffset:c,line:t,offset:u,source:this.css},this.file&&(Ot&&(a.input.url=Ot(this.file).toString()),a.input.file=this.file),a}fromLineAndColumn(e,t){return Zi(this)[e-1]+t-1}fromOffset(e){let t=Zi(this),i=t[t.length-1],r=0;if(e>=i)r=t.length-1;else{let o=t.length-2,s;for(;r<o;)if(s=r+(o-r>>1),e<t[s])o=s-1;else if(e>=t[s+1])r=s+1;else{r=s;break}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\\w+:\\/\\//.test(e)?e:Fn(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,i,r){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:t,line:e});if(!s.source)return!1;let c;typeof i=="number"&&(c=o.originalPositionFor({column:r,line:i}));let u;En(s.source)?u=Ot(s.source):u=new URL(s.source,this.map.consumer().sourceRoot||Ot(this.map.mapFile));let a={column:s.column,endColumn:c&&c.column,endLine:c&&c.line,line:s.line,url:u.toString()};if(u.protocol==="file:")if(Ji)a.file=Ji(u);else throw new Error("file: protocol is not available in this PostCSS build");let l=o.sourceContentFor(s.source);return l&&(a.source=l),a}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};Xi.exports=Ve;Ve.default=Ve;Sn&&Sn.registerInput&&Sn.registerInput(Ve)});var Ke=K((Tu,ir)=>{"use strict";var er=ve(),tr,nr,Be=class extends er{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,i){let r=super.normalize(e);if(t){if(i==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of r)o.raws.before=t.raws.before}return r}removeChild(e,t){let i=this.index(e);return!t&&i===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(e)}toResult(e={}){return new tr(new nr,this,e).stringify()}};Be.registerLazyResult=n=>{tr=n};Be.registerProcessor=n=>{nr=n};ir.exports=Be;Be.default=Be;er.registerRoot(Be)});var bn=K((Ru,rr)=>{"use strict";var yt={comma(n){return yt.split(n,[","],!0)},space(n){let e=[" ",`\n`," "];return yt.split(n,e)},split(n,e,t){let i=[],r="",o=!1,s=0,c=!1,u="",a=!1;for(let l of n)a?a=!1:l==="\\\\"?a=!0:c?l===u&&(c=!1):l===\'"\'||l==="\'"?(c=!0,u=l):l==="("?s+=1:l===")"?s>0&&(s-=1):s===0&&e.includes(l)&&(o=!0),o?(r!==""&&i.push(r.trim()),r="",o=!1):r+=l;return(t||r!=="")&&i.push(r.trim()),i}};rr.exports=yt;yt.default=yt});var Pt=K((vu,sr)=>{"use strict";var or=ve(),Fs=bn(),Je=class extends or{get selectors(){return Fs.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\\s*/):null,i=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(i)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};sr.exports=Je;Je.default=Je;or.registerRule(Je)});var ar=K((Bu,lr)=>{"use strict";var bs=Rt(),Ns=mt(),ws=ht(),Cs=gt(),Ms=yn(),ks=Ke(),Ds=Pt();function St(n,e){if(Array.isArray(n))return n.map(r=>St(r));let{inputs:t,...i}=n;if(t){e=[];for(let r of t){let o={...r,__proto__:Cs.prototype};o.map&&(o.map={...o.map,__proto__:Ms.prototype}),e.push(o)}}if(i.nodes&&(i.nodes=n.nodes.map(r=>St(r,e))),i.source){let{inputId:r,...o}=i.source;i.source=o,r!=null&&(i.source.input=e[r])}if(i.type==="root")return new ks(i);if(i.type==="decl")return new ws(i);if(i.type==="rule")return new Ds(i);if(i.type==="comment")return new Ns(i);if(i.type==="atrule")return new bs(i);throw new Error("Unknown node type: "+n.type)}lr.exports=St;St.default=St});var wn=K((_u,pr)=>{"use strict";var{dirname:It,relative:cr,resolve:dr,sep:fr}=Bt(),{SourceMapConsumer:mr,SourceMapGenerator:Wt}=_t(),{pathToFileURL:ur}=xn(),Ls=gt(),Ts=!!(mr&&Wt),Rs=!!(It&&dr&&cr&&fr),Nn=class{constructor(e,t,i,r){this.stringify=e,this.mapOpts=i.map||{},this.root=t,this.opts=i,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`\n`;this.css.includes(`\\r\n`)&&(t=`\\r\n`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),i=e.root||It(e.file),r;this.mapOpts.sourcesContent===!1?(r=new mr(e.text),r.sourcesContent&&(r.sourcesContent=null)):r=e.consumer(),this.map.applySourceMap(r,t,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else if(this.css){let e;for(;(e=this.css.lastIndexOf("/*#"))!==-1;){let t=this.css.indexOf("*/",e+3);if(t===-1)break;for(;e>0&&this.css[e-1]===`\n`;)e--;this.css=this.css.slice(0,e)+this.css.slice(t+2)}}}}generate(){if(this.clearAnnotation(),Rs&&Ts&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Wt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Wt({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 Wt({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,i="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(c,u,a)=>{if(this.css+=c,u&&a!=="end"&&(r.generated.line=e,r.generated.column=t-1,u.source&&u.source.start?(r.source=this.sourcePath(u),r.original.line=u.source.start.line,r.original.column=u.source.start.column-1,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,this.map.addMapping(r))),s=c.match(/\\n/g),s?(e+=s.length,o=c.lastIndexOf(`\n`),t=c.length-o):t+=c.length,u&&a!=="start"){let l=u.parent||{raws:{}};(!(u.type==="decl"||u.type==="atrule"&&!u.nodes)||u!==l.last||l.raws.semicolon)&&(u.source&&u.source.end?(r.source=this.sourcePath(u),r.original.line=u.source.end.line,r.original.column=u.source.end.column-1,r.generated.line=e,r.generated.column=t-2,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,r.generated.line=e,r.generated.column=t-1,this.map.addMapping(r)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.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(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\\w+:\\/\\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let i=this.opts.to?It(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=It(dr(i,this.mapOpts.annotation)));let r=cr(i,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Ls(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let i=t.source.input.from;if(i&&!e[i]){e[i]=!0;let r=this.usesFileUrls?this.toFileUrl(i):this.toUrl(this.path(i));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(ur){let i=ur(e).toString();return this.memoizedFileURLs.set(e,i),i}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;fr==="\\\\"&&(e=e.replace(/\\\\/g,"/"));let i=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,i),i}};pr.exports=Nn});var gr=K((Ou,xr)=>{"use strict";var Ht=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,Ut=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,vs=/.[\\r\\n"\'(/\\\\]/,hr=/[\\da-f]/i;xr.exports=function(e,t={}){let i=e.css.valueOf(),r=t.ignoreErrors,o,s,c,u,a,l,f,m,h,M,C=i.length,A=0,z=[],O=[];function D(){return A}function Y(F){throw e.error("Unclosed "+F,A)}function S(){return O.length===0&&A>=C}function p(F){if(O.length)return O.pop();if(A>=C)return;let b=F?F.ignoreUnclosed:!1;switch(o=i.charCodeAt(A),o){case 10:case 32:case 9:case 13:case 12:{u=A;do u+=1,o=i.charCodeAt(u);while(o===32||o===10||o===9||o===13||o===12);l=["space",i.slice(A,u)],A=u-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let N=String.fromCharCode(o);l=[N,N,A];break}case 40:{if(M=z.length?z.pop()[1]:"",h=i.charCodeAt(A+1),M==="url"&&h!==39&&h!==34&&h!==32&&h!==10&&h!==9&&h!==12&&h!==13){u=A;do{if(f=!1,u=i.indexOf(")",u+1),u===-1)if(r||b){u=A;break}else Y("bracket");for(m=u;i.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);l=["brackets",i.slice(A,u+1),A,u],A=u}else u=i.indexOf(")",A+1),s=i.slice(A,u+1),u===-1||vs.test(s)?l=["(","(",A]:(l=["brackets",s,A,u],A=u);break}case 39:case 34:{a=o===39?"\'":\'"\',u=A;do{if(f=!1,u=i.indexOf(a,u+1),u===-1)if(r||b){u=A+1;break}else Y("string");for(m=u;i.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);l=["string",i.slice(A,u+1),A,u],A=u;break}case 64:{Ht.lastIndex=A+1,Ht.test(i),Ht.lastIndex===0?u=i.length-1:u=Ht.lastIndex-2,l=["at-word",i.slice(A,u+1),A,u],A=u;break}case 92:{for(u=A,c=!0;i.charCodeAt(u+1)===92;)u+=1,c=!c;if(o=i.charCodeAt(u+1),c&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(u+=1,hr.test(i.charAt(u)))){for(;hr.test(i.charAt(u+1));)u+=1;i.charCodeAt(u+1)===32&&(u+=1)}l=["word",i.slice(A,u+1),A,u],A=u;break}default:{o===47&&i.charCodeAt(A+1)===42?(u=i.indexOf("*/",A+2)+1,u===0&&(r||b?u=i.length:Y("comment")),l=["comment",i.slice(A,u+1),A,u],A=u):(Ut.lastIndex=A+1,Ut.test(i),Ut.lastIndex===0?u=i.length-1:u=Ut.lastIndex-2,l=["word",i.slice(A,u+1),A,u],z.push(l),A=u);break}}return A++,l}function y(F){O.push(F)}return{back:y,endOfFile:S,nextToken:p,position:D}}});var Er=K((Pu,Ar)=>{"use strict";var Bs=Rt(),_s=mt(),Os=ht(),Ps=Ke(),yr=Pt(),Is=gr(),Sr={empty:!0,space:!0};function Ws(n){for(let e=n.length-1;e>=0;e--){let t=n[e],i=t[3]||t[2];if(i)return i}}var Cn=class{constructor(e){this.input=e,this.root=new Ps,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new Bs;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let i,r,o,s=!1,c=!1,u=[],a=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),i=e[0],i==="("||i==="["?a.push(i==="("?")":"]"):i==="{"&&a.length>0?a.push("}"):i===a[a.length-1]&&a.pop(),a.length===0)if(i===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){c=!0;break}else if(i==="}"){if(u.length>0){for(o=u.length-1,r=u[o];r&&r[0]==="space";)r=u[--o];r&&(t.source.end=this.getPosition(r[3]||r[2]),t.source.end.offset++)}this.end(e);break}else u.push(e);else u.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(u),u.length?(t.raws.afterName=this.spacesAndCommentsFromStart(u),this.raw(t,"params",u),s&&(e=u[u.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),c&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let i=0,r;for(let o=t-1;o>=0&&(r=e[o],!(r[0]!=="space"&&(i+=1,i===2)));o--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(e){let t=0,i,r,o;for(let[s,c]of e.entries()){if(r=c,o=r[0],o==="("&&(t+=1),o===")"&&(t-=1),t===0&&o===":")if(!i)this.doubleColon(r);else{if(i[0]==="word"&&i[1]==="progid")continue;return s}i=r}return!1}comment(e){let t=new _s;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let i=e[1].slice(2,-2);if(!i.trim())t.text="",t.raws.left=i,t.raws.right="";else{let r=i.match(/^(\\s*)([^]*\\S)(\\s*)$/);t.text=r[2],t.raws.left=r[1],t.raws.right=r[3]}}createTokenizer(){this.tokenizer=Is(this.input)}decl(e,t){let i=new Os;this.init(i,e[0][2]);let r=e[e.length-1];for(r[0]===";"&&(this.semicolon=!0,e.pop()),i.source.end=this.getPosition(r[3]||r[2]||Ws(e)),i.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),i.raws.before+=e.shift()[1];for(i.source.start=this.getPosition(e[0][2]),i.prop="";e.length;){let a=e[0][0];if(a===":"||a==="space"||a==="comment")break;i.prop+=e.shift()[1]}i.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){i.raws.between+=o[1];break}else o[0]==="word"&&/\\w/.test(o[1])&&this.unknownWord([o]),i.raws.between+=o[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let s=[],c;for(;e.length&&(c=e[0][0],!(c!=="space"&&c!=="comment"));)s.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(o=e[a],o[1].toLowerCase()==="!important"){i.important=!0;let l=this.stringFrom(e,a);l=this.spacesFromEnd(e)+l,l!==" !important"&&(i.raws.important=l);break}else if(o[1].toLowerCase()==="important"){let l=e.slice(0),f="";for(let m=a;m>0;m--){let h=l[m][0];if(f.trim().startsWith("!")&&h!=="space")break;f=l.pop()[1]+f}f.trim().startsWith("!")&&(i.important=!0,i.raws.important=f,e=l)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(a=>a[0]!=="space"&&a[0]!=="comment")&&(i.raws.between+=s.map(a=>a[1]).join(""),s=[]),this.raw(i,"value",s.concat(e),t),i.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new yr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){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(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}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(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,i=null,r=!1,o=null,s=[],c=e[1].startsWith("--"),u=[],a=e;for(;a;){if(i=a[0],u.push(a),i==="("||i==="[")o||(o=a),s.push(i==="("?")":"]");else if(c&&r&&i==="{")o||(o=a),s.push("}");else if(s.length===0)if(i===";")if(r){this.decl(u,c);return}else break;else if(i==="{"){this.rule(u);return}else if(i==="}"){this.tokenizer.back(u.pop()),t=!0;break}else i===":"&&(r=!0);else i===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),s.length>0&&this.unclosedBracket(o),t&&r){if(!c)for(;u.length&&(a=u[u.length-1][0],!(a!=="space"&&a!=="comment"));)this.tokenizer.back(u.pop());this.decl(u,c)}else this.unknownWord(u)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,i,r){let o,s,c=i.length,u="",a=!0,l,f;for(let m=0;m<c;m+=1)o=i[m],s=o[0],s==="space"&&m===c-1&&!r?a=!1:s==="comment"?(f=i[m-1]?i[m-1][0]:"empty",l=i[m+1]?i[m+1][0]:"empty",!Sr[f]&&!Sr[l]?u.slice(-1)===","?a=!1:u+=o[1]:a=!1):u+=o[1];if(!a){let m=i.reduce((h,M)=>h+M[1],"");e.raws[t]={raw:m,value:u}}e[t]=u}rule(e){e.pop();let t=new yr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,i="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)i=e.pop()[1]+i;return i}spacesAndCommentsFromStart(e){let t,i="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)i+=e.shift()[1];return i}spacesFromEnd(e){let t,i="";for(;e.length&&(t=e[e.length-1][0],t==="space");)i=e.pop()[1]+i;return i}stringFrom(e,t){let i="";for(let r=t;r<e.length;r++)i+=e[r][1];return e.splice(t,e.length-t),i}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};Ar.exports=Cn});var zt=K((Iu,Fr)=>{"use strict";var Hs=ve(),Us=gt(),qs=Er();function qt(n,e){let t=new Us(n,e),i=new qs(t);try{i.parse()}catch(r){throw r}return i.root}Fr.exports=qt;qt.default=qt;Hs.registerParse(qt)});var Mn=K((Wu,br)=>{"use strict";var At=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let i=t.node.rangeBy(t);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in t)this[i]=t[i]}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}};br.exports=At;At.default=At});var jt=K((Hu,Nr)=>{"use strict";var zs=Mn(),Et=class{get content(){return this.css}constructor(e,t,i){this.processor=e,this.messages=[],this.root=t,this.opts=i,this.css="",this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let i=new zs(e,t);return this.messages.push(i),i}warnings(){return this.messages.filter(e=>e.type==="warning")}};Nr.exports=Et;Et.default=Et});var kn=K((Uu,Cr)=>{"use strict";var wr={};Cr.exports=function(e){wr[e]||(wr[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))}});var Tn=K((zu,Lr)=>{"use strict";var js=ve(),Gs=vt(),$s=wn(),Vs=zt(),Mr=jt(),Ks=Ke(),Js=at(),{isClean:ke,my:Qs}=Tt(),qu=kn(),Ys={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Zs={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},Xs={Once:!0,postcssPlugin:!0,prepare:!0},Qe=0;function Ft(n){return typeof n=="object"&&typeof n.then=="function"}function Dr(n){let e=!1,t=Ys[n.type];return n.type==="decl"?e=n.prop.toLowerCase():n.type==="atrule"&&(e=n.name.toLowerCase()),e&&n.append?[t,t+"-"+e,Qe,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:n.append?[t,Qe,t+"Exit"]:[t,t+"Exit"]}function kr(n){let e;return n.type==="document"?e=["Document",Qe,"DocumentExit"]:n.type==="root"?e=["Root",Qe,"RootExit"]:e=Dr(n),{eventIndex:0,events:e,iterator:0,node:n,visitorIndex:0,visitors:[]}}function Dn(n){return n[ke]=!1,n.nodes&&n.nodes.forEach(e=>Dn(e)),n}var Ln={},_e=class n{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(e,t,i){this.stringified=!1,this.processed=!1;let r;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))r=Dn(t);else if(t instanceof n||t instanceof Mr)r=Dn(t.root),t.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=t.map);else{let o=Vs;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{r=o(t,i)}catch(s){this.processed=!0,this.error=s}r&&!r[Qs]&&js.rebuild(r)}this.result=new Mr(e,r,i),this.helpers={...Ln,postcss:Ln,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(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let i=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=i.postcssPlugin,e.setMessage()):i.postcssVersion}catch(r){console&&console.error&&console.error(r)}return e}prepareVisitors(){this.listeners={};let e=(t,i,r)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([t,r])};for(let t of this.plugins)if(typeof t=="object")for(let i in t){if(!Zs[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Xs[i])if(typeof t[i]=="object")for(let r in t[i])r==="*"?e(t,i,t[i][r]):e(t,i+"-"+r.toLowerCase(),t[i][r]);else typeof t[i]=="function"&&e(t,i,t[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],i=this.runOnRoot(t);if(Ft(i))try{await i}catch(r){throw this.handleError(r)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ke];){e[ke]=!0;let t=[kr(e)];for(;t.length>0;){let i=this.visitTick(t);if(Ft(i))try{await i}catch(r){let o=t[t.length-1].node;throw this.handleError(r,o)}}}if(this.listeners.OnceExit)for(let[t,i]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let r=e.nodes.map(o=>i(o,this.helpers));await Promise.all(r)}else await i(e,this.helpers)}catch(r){throw this.handleError(r)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(i=>e.Once(i,this.helpers));return Ft(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Js;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new $s(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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 e of this.plugins){let t=this.runOnRoot(e);if(Ft(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ke];)e[ke]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[i,r]of e){this.result.lastPlugin=i;let o;try{o=r(t,this.helpers)}catch(s){throw this.handleError(s,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(Ft(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:i,visitors:r}=t;if(i.type!=="root"&&i.type!=="document"&&!i.parent){e.pop();return}if(r.length>0&&t.visitorIndex<r.length){let[s,c]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=s;try{return c(i.toProxy(),this.helpers)}catch(u){throw this.handleError(u,i)}}if(t.iterator!==0){let s=t.iterator,c;for(;c=i.nodes[i.indexes[s]];)if(i.indexes[s]+=1,!c[ke]){c[ke]=!0,e.push(kr(c));return}t.iterator=0,delete i.indexes[s]}let o=t.events;for(;t.eventIndex<o.length;){let s=o[t.eventIndex];if(t.eventIndex+=1,s===Qe){i.nodes&&i.nodes.length&&(i[ke]=!0,t.iterator=i.getIterator());return}else if(this.listeners[s]){t.visitors=this.listeners[s];return}}e.pop()}walkSync(e){e[ke]=!0;let t=Dr(e);for(let i of t)if(i===Qe)e.nodes&&e.each(r=>{r[ke]||this.walkSync(r)});else{let r=this.listeners[i];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}};_e.registerPostcss=n=>{Ln=n};Lr.exports=_e;_e.default=_e;Ks.registerLazyResult(_e);Gs.registerLazyResult(_e)});var Rr=K((Gu,Tr)=>{"use strict";var el=wn(),tl=zt(),nl=jt(),il=at(),ju=kn(),bt=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 e,t=tl;try{e=t(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,i){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=i,this._map=void 0;let r=il;this.result=new nl(this._processor,void 0,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let s=new el(r,void 0,this._opts,t);if(s.isMap()){let[c,u]=s.generate();c&&(this.result.css=c),u&&(this.result.map=u)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}};Tr.exports=bt;bt.default=bt});var Br=K(($u,vr)=>{"use strict";var rl=vt(),ol=Tn(),sl=Rr(),ll=Ke(),qe=class{constructor(e=[]){this.version="8.5.8",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let i of e)if(i.postcss===!0?i=i():i.postcss&&(i=i.postcss),typeof i=="object"&&Array.isArray(i.plugins))t=t.concat(i.plugins);else if(typeof i=="object"&&i.postcssPlugin)t.push(i);else if(typeof i=="function")t.push(i);else if(!(typeof i=="object"&&(i.parse||i.stringify)))throw new Error(i+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new sl(this,e,t):new ol(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};vr.exports=qe;qe.default=qe;ll.registerProcessor(qe);rl.registerProcessor(qe)});var qr=K((Vu,Ur)=>{"use strict";var _r=Rt(),Or=mt(),al=ve(),ul=Lt(),Pr=ht(),Ir=vt(),cl=ar(),dl=gt(),fl=Tn(),ml=bn(),pl=dt(),hl=zt(),Rn=Br(),xl=jt(),Wr=Ke(),Hr=Pt(),gl=at(),yl=Mn();function te(...n){return n.length===1&&Array.isArray(n[0])&&(n=n[0]),new Rn(n)}te.plugin=function(e,t){let i=!1;function r(...s){console&&console.warn&&!i&&(i=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let c=t(...s);return c.postcssPlugin=e,c.postcssVersion=new Rn().version,c}let o;return Object.defineProperty(r,"postcss",{get(){return o||(o=r()),o}}),r.process=function(s,c,u){return te([r(u)]).process(s,c)},r};te.stringify=gl;te.parse=hl;te.fromJSON=cl;te.list=ml;te.comment=n=>new Or(n);te.atRule=n=>new _r(n);te.decl=n=>new Pr(n);te.rule=n=>new Hr(n);te.root=n=>new Wr(n);te.document=n=>new Ir(n);te.CssSyntaxError=ul;te.Declaration=Pr;te.Container=al;te.Processor=Rn;te.Document=Ir;te.Comment=Or;te.Warning=yl;te.AtRule=_r;te.Result=xl;te.Input=dl;te.Rule=Hr;te.Root=Wr;te.Node=pl;fl.registerPostcss(te);Ur.exports=te;te.default=te});function ge(n){try{window.parent.postMessage(n,"*")}catch{}}function Zn(n){let e=t=>{let i=t.data;if(!i||i.source!=="hf-parent"||i.type!=="control")return;let r=i.action;if(r==="play"){n.onPlay();return}if(r==="pause"){n.onPause();return}if(r==="seek"){n.onSeek(Number(i.frame??0),i.seekMode??"commit");return}if(r==="set-muted"){n.onSetMuted(!!i.muted);return}if(r==="set-media-output-muted"){n.onSetMediaOutputMuted(!!i.muted);return}if(r==="set-playback-rate"){n.onSetPlaybackRate(Number(i.playbackRate??1));return}if(r==="enable-pick-mode"){n.onEnablePickMode();return}if(r==="disable-pick-mode"){n.onDisablePickMode();return}if(r==="flash-elements"){let o=i.selectors,s=i.duration||800;o&&Oo(o,s)}};return window.addEventListener("message",e),e}function Oo(n,e){if(!document.getElementById("__hf-flash-styles")){let t=document.createElement("style");t.id="__hf-flash-styles",t.textContent=`\n .__hf-flash {\n outline: 2px solid rgba(59, 130, 246, 0.6) !important;\n outline-offset: 2px !important;\n animation: __hf-flash-pulse ${e}ms ease-out forwards !important;\n }\n @keyframes __hf-flash-pulse {\n 0% { outline-color: rgba(59, 130, 246, 0.8); }\n 100% { outline-color: transparent; }\n }\n `,document.head.appendChild(t)}for(let t of n)try{document.querySelectorAll(t).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),e)})}catch{}}var nn=null;function Xn(n){nn=n}function nt(n,e){if(nn)try{nn({source:"hf-preview",type:"analytics",event:n,properties:e??{}})}catch{}}function ei(n){let e=[],t=c=>{if(typeof c.getAnimations!="function")return[];try{return c.getAnimations()}catch{return[]}},i=(c,u)=>{for(let a of c){try{a.currentTime=u}catch{}try{a.pause()}catch{}}},r=c=>{for(let u of c)try{u.play()}catch{}},o=c=>{for(let u of c)try{u.pause()}catch{}},s=c=>{c.baseDelay?c.el.style.animationDelay=c.baseDelay:c.el.style.removeProperty("animation-delay"),c.basePlayState?c.el.style.animationPlayState=c.basePlayState:c.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{e=[];let c=document.querySelectorAll("*");for(let u of c){if(!(u instanceof HTMLElement))continue;let a=window.getComputedStyle(u);!a.animationName||a.animationName==="none"||e.push({el:u,baseDelay:u.style.animationDelay||"",basePlayState:u.style.animationPlayState||""})}},seek:c=>{let u=Number(c.time)||0;for(let a of e){if(!a.el.isConnected)continue;let l=n?.resolveStartSeconds?n.resolveStartSeconds(a.el):Number.parseFloat(a.el.getAttribute("data-start")??"0")||0,f=Math.max(0,u-l)*1e3,m=t(a.el);if(m.length>0){i(m,f);continue}a.el.style.animationPlayState="paused",a.el.style.animationDelay=`-${(f/1e3).toFixed(3)}s`}},pause:()=>{for(let c of e){if(!c.el.isConnected)continue;let u=t(c.el);u.length>0&&o(u),s(c)}},play:()=>{for(let c of e)c.el.isConnected&&(s(c),r(t(c.el)))},revert:()=>{e=[]}}}function ti(n){return{name:"gsap",discover:()=>{},seek:e=>{let t=n.getTimeline();if(!t)return;t.pause();let i=Math.max(0,Number(e.time)||0);typeof t.totalTime=="function"?t.totalTime(i,!1):t.seek(i,!1)},pause:()=>{let e=n.getTimeline();e&&e.pause()}}}function ni(){return{name:"animejs",discover:()=>{try{let n=window.anime;if(!n||typeof n.running>"u")return;let e=n.running;if(!Array.isArray(e)||e.length===0)return;let t=window.__hfAnime??[],i=new Set(t);for(let r of e)i.has(r)||t.push(r);window.__hfAnime=t}catch{}},seek:n=>{let e=Math.max(0,(Number(n.time)||0)*1e3),t=window.__hfAnime;if(!(!t||t.length===0))for(let i of t)try{typeof i.seek=="function"&&i.seek(e)}catch{}},pause:()=>{let n=window.__hfAnime;if(!(!n||n.length===0))for(let e of n)try{typeof e.pause=="function"&&e.pause()}catch{}},play:()=>{let n=window.__hfAnime;if(!(!n||n.length===0))for(let e of n)try{typeof e.play=="function"&&e.play()}catch{}},revert:()=>{}}}function oi(){return{name:"lottie",discover:()=>{try{let n=window.lottie;if(n&&typeof n.getRegisteredAnimations=="function"){let e=n.getRegisteredAnimations();if(Array.isArray(e)&&e.length>0){let t=window.__hfLottie??[],i=new Set(t);for(let r of e)i.has(r)||t.push(r);window.__hfLottie=t}}}catch{}},seek:n=>{let e=Math.max(0,Number(n.time)||0),t=window.__hfLottie;if(!(!t||t.length===0))for(let i of t)try{if(ii(i))i.goToAndStop(e*1e3,!1);else if(ri(i)){if(typeof i.setCurrentRawFrameValue=="function"){let r=i.totalFrames??0,o=i.frameRate??30,s=e*o;r>0&&i.setCurrentRawFrameValue(Math.min(s,r-1))}else if(typeof i.seek=="function"){let r=i.duration??1,o=Math.min(100,e/r*100);i.seek(o)}}}catch{}},pause:()=>{let n=window.__hfLottie;if(!(!n||n.length===0))for(let e of n)try{(ii(e)||ri(e))&&e.pause()}catch{}},revert:()=>{}}}function ii(n){return typeof n=="object"&&n!==null&&typeof n.goToAndStop=="function"}function ri(n){return typeof n=="object"&&n!==null&&typeof n.pause=="function"&&("totalFrames"in n||"duration"in n)}function si(){let n=null,e=0;return{name:"three",discover:()=>{},seek:t=>{n=Math.max(0,Number(t.time)||0),e=n,window.__hfThreeTime=n;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:n}}))}catch{}},pause:()=>{n==null&&(n=Math.max(0,e))},play:()=>{n=null},revert:()=>{n=null,e=0}}}function li(){return{name:"waapi",discover:()=>{},seek:n=>{if(!document.getAnimations)return;let e=Math.max(0,(Number(n.time)||0)*1e3);for(let t of document.getAnimations()){try{t.currentTime=e}catch{}try{t.pause()}catch{}}},pause:()=>{if(document.getAnimations)for(let n of document.getAnimations())try{n.pause()}catch{}}}}function ai(n){let e=Array.from(document.querySelectorAll("video, audio")),t=n?.shouldIncludeElement?e.filter(s=>n.shouldIncludeElement?.(s)):e.filter(s=>s.hasAttribute("data-start")),i=[],r=[],o=0;for(let s of t){let c=n?.resolveStartSeconds?n.resolveStartSeconds(s):Number.parseFloat(s.dataset.start??"0");if(!Number.isFinite(c))continue;let u=Number.parseFloat(s.dataset.playbackStart??s.dataset.mediaStart??"0")||0,a=s.defaultPlaybackRate,l=Number.isFinite(a)&&a>0?Math.max(.1,Math.min(5,a)):1,f=s.loop,m=Number.isFinite(s.duration)&&s.duration>0?s.duration:null,h=n?.resolveDurationSeconds?.(s)??Number.parseFloat(s.dataset.duration??"");(!Number.isFinite(h)||h<=0)&&m!=null&&(h=Math.max(0,(m-u)/l));let M=Number.isFinite(h)&&h>0?c+h:Number.POSITIVE_INFINITY,C=Number.parseFloat(s.dataset.volume??""),A={el:s,start:c,mediaStart:u,duration:Number.isFinite(h)&&h>0?h:Number.POSITIVE_INFINITY,end:M,volume:Number.isFinite(C)?C:null,playbackRate:l,loop:f,sourceDuration:m};i.push(A),s.tagName==="VIDEO"&&r.push(A),Number.isFinite(M)&&(o=Math.max(o,M))}return{timedMediaEls:t,mediaClips:i,videoClips:r,maxMediaEnd:o}}var rn=new WeakMap,it=new WeakSet;function Po(n){if(it.has(n))return;it.add(n);let e=()=>it.delete(n);n.addEventListener("playing",e,{once:!0}),n.addEventListener("pause",e,{once:!0}),n.addEventListener("error",e,{once:!0})}function ui(n){let e=!!(n.outputMuted||n.userMuted);for(let t of n.clips){let{el:i}=t;if(!i.isConnected)continue;let r=(n.timeSeconds-t.start)*t.playbackRate+t.mediaStart;if(n.timeSeconds>=t.start&&n.timeSeconds<t.end&&r>=0){if(t.loop&&t.sourceDuration!=null&&t.sourceDuration>0){let h=t.sourceDuration-t.mediaStart;h>0&&r>=t.sourceDuration&&(r=t.mediaStart+(r-t.mediaStart)%h)}t.volume!=null&&(i.volume=t.volume),e&&(i.muted=!0);try{i.playbackRate=t.playbackRate*n.playbackRate}catch{}let s=i.currentTime||0,c=Math.abs(s-r),u=r-s,a=rn.get(i);rn.set(i,u);let l=a===void 0,f=!l&&Math.abs(u-a)>.5,m=c>3;if(c>.5&&(l||f||m))try{i.currentTime=r}catch{}n.playing&&i.paused&&!it.has(i)?(i.preload!=="auto"&&(i.preload="auto"),Po(i),i.play().catch(h=>{it.delete(i),(h&&typeof h=="object"&&"name"in h?String(h.name??""):"")==="NotAllowedError"&&n.onAutoplayBlocked?.()})):!n.playing&&!i.paused&&i.pause();continue}rn.delete(i),i.paused||i.pause()}}function ci(n){let e=!1,t=null,i=null,r=null,o=null;function s(S,p){try{window.dispatchEvent(new CustomEvent(S,{detail:p}))}catch{}}function c(S){r=S,s("hyperframe:picker:hovered",{elementInfo:r,isPickMode:e,timestamp:Date.now()})}function u(S){o=S,s("hyperframe:picker:selected",{elementInfo:o,isPickMode:e,timestamp:Date.now()})}function a(S){if(!S||S===document.body||S===document.documentElement)return!1;let p=S.tagName.toLowerCase();return!(p==="script"||p==="style"||p==="link"||p==="meta"||S.classList.contains("__hf-pick-highlight"))}function l(S){let p=S;if(p.id)return`#${p.id}`;let y=S.getAttribute("data-composition-id");if(y)return`[data-composition-id="${y}"]`;let F=S.getAttribute("data-composition-src");if(F)return`[data-composition-src="${F}"]`;let b=S.getAttribute("data-track-index");if(b)return`[data-track-index="${b}"]`;let N=S.tagName.toLowerCase(),B=S.parentElement;if(!B)return N;let W=B.querySelectorAll(`:scope > ${N}`);if(W.length===1)return N;for(let H=0;H<W.length;H+=1)if(W[H]===S)return`${N}:nth-of-type(${H+1})`;return N}function f(S){let p=S.tagName.toLowerCase(),y=(S.textContent??"").trim().replace(/\\s+/g," "),F=(b,N)=>b.length>N?`${b.slice(0,N-1)}\\u2026`:b;return p==="h1"||p==="h2"||p==="h3"?"Heading":p==="p"||p==="span"||p==="div"?y.length>0?F(y,56):"Text":p==="img"?"Image":p==="video"?"Video":p==="audio"?"Audio":p==="svg"?"Shape":S.getAttribute("data-composition-src")?"Composition":p==="section"?"Section":`${p.charAt(0).toUpperCase()}${p.slice(1)}`}function m(S,p,y){let F=typeof y=="number"&&y>0?y:8,b=[];if(document.elementsFromPoint)b=document.elementsFromPoint(S,p);else if(document.elementFromPoint){let W=document.elementFromPoint(S,p);b=W?[W]:[]}let N={},B=[];for(let W=0;W<b.length;W+=1){let H=b[W];if(!a(H))continue;let Z=`${H.tagName}::${H.id||""}::${W}`;if(!N[Z]&&(N[Z]=!0,B.push(H),B.length>=F))break}return B}function h(S){let p=S.getBoundingClientRect(),y={};for(let b=0;b<S.attributes.length;b+=1){let N=S.attributes[b];N.name.startsWith("data-")&&(y[N.name]=N.value)}return{id:S.id||null,tagName:S.tagName.toLowerCase(),selector:l(S),label:f(S),boundingBox:{x:p.left,y:p.top,width:p.width,height:p.height},textContent:S.textContent?S.textContent.trim().slice(0,200):null,src:S.getAttribute("src")||S.getAttribute("data-composition-src")||null,dataAttributes:y}}function M(S,p,y){return m(S,p,y).map(h)}function C(S){if(!e)return;let y=m(S.clientX,S.clientY,1)[0]??(S.target instanceof Element?S.target:null);if(!a(y)||t===y)return;t&&t.classList.remove("__hf-pick-highlight"),t=y,y.classList.add("__hf-pick-highlight");let F=h(y);c(F),n.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:F})}function A(S){if(!e)return;S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation();let p=M(S.clientX,S.clientY,8);p.length!==0&&(c(p[0]??null),n.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:p,selectedIndex:0,point:{x:S.clientX,y:S.clientY}}))}function z(S){S.key==="Escape"&&(D(),n.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function O(){e||(e=!0,i=document.createElement("style"),i.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`\n`),document.head.appendChild(i),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",C,!0),document.addEventListener("click",A,!0),document.addEventListener("keydown",z,!0),s("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function D(){e&&(e=!1,t&&(t.classList.remove("__hf-pick-highlight"),t=null),i&&(i.remove(),i=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",C,!0),document.removeEventListener("click",A,!0),document.removeEventListener("keydown",z,!0),s("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function Y(){window.__HF_PICKER_API={enable:O,disable:D,isActive:()=>e,getHovered:()=>r,getSelected:()=>o,getCandidatesAtPoint:(S,p,y)=>Number.isFinite(S)&&Number.isFinite(p)?M(S,p,y):[],pickAtPoint:(S,p,y)=>{if(!Number.isFinite(S)||!Number.isFinite(p))return null;let F=M(S,p,8);if(!F.length)return null;let b=Math.max(0,Math.min(F.length-1,Number(y??0))),N=F[b]??null;return N?(u(N),n.postMessage({source:"hf-preview",type:"element-picked",elementInfo:N}),D(),N):null},pickManyAtPoint:(S,p,y)=>{if(!Number.isFinite(S)||!Number.isFinite(p))return[];let F=M(S,p,8);if(!F.length)return[];let b=[],N=Array.isArray(y)?y:[0];for(let B of N){let W=Math.max(0,Math.min(F.length-1,Math.floor(Number(B)))),H=F[W];if(!H)continue;b.some(T=>T.selector===H.selector&&T.tagName===H.tagName)||b.push(H)}return b.length?(u(b[0]??null),n.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:b}),D(),b):[]}},s("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:O,disablePickMode:D,installPickerApi:Y}}function on(n,e){let t=Number.isFinite(e)&&e>0?e:30,i=Number.isFinite(n)&&n>0?n:0;return Math.floor(i*t+1e-9)/t}function Dt(n,e,t){if(n){for(let i of Object.values(n))if(!(!i||i===e))try{t(i)}catch{}}}function di(n,e,t){let i=on(e,t);return n.pause(),typeof n.totalTime=="function"?n.totalTime(i,!1):n.seek(i,!1),i}function Io(n,e,t,i){let r=[];Dt(n,e,o=>{o.play(),r.push(o)});try{return di(e,t,i)}finally{for(let o of r)try{o.pause()}catch{}}}function Wo(n,e){Dt(n,e,t=>{t.play()})}function fi(n){return{_timeline:null,play:()=>{let e=n.getTimeline();if(!e||n.getIsPlaying())return;let t=Math.max(0,Number(n.getSafeDuration?.()??e.duration()??0)||0);t>0&&Math.max(0,Number(e.time())||0)>=t&&(e.pause(),e.seek(0,!1),n.onDeterministicSeek(0),n.setIsPlaying(!1),n.onSyncMedia(0,!1),n.onRenderFrameSeek(0)),typeof e.timeScale=="function"&&e.timeScale(n.getPlaybackRate()),e.play(),Dt(n.getTimelineRegistry?.(),e,i=>{typeof i.timeScale=="function"&&i.timeScale(n.getPlaybackRate()),i.play()}),n.onDeterministicPlay(),n.setIsPlaying(!0),n.onShowNativeVideos(),n.onStatePost(!0)},pause:()=>{let e=n.getTimeline();if(!e)return;e.pause(),Dt(n.getTimelineRegistry?.(),e,i=>{i.pause()});let t=Math.max(0,Number(e.time())||0);n.onDeterministicSeek(t),n.onDeterministicPause(),n.setIsPlaying(!1),n.onSyncMedia(t,!1),n.onRenderFrameSeek(t),n.onStatePost(!0)},seek:e=>{let t=n.getTimeline();if(!t)return;let i=Math.max(0,Number(e)||0),r=Io(n.getTimelineRegistry?.(),t,i,n.getCanonicalFps());n.onDeterministicSeek(r),n.setIsPlaying(!1),n.onSyncMedia(r,!1),n.onRenderFrameSeek(r),n.onStatePost(!0)},renderSeek:e=>{let t=n.getTimeline(),i=n.getCanonicalFps(),r=t?(Wo(n.getTimelineRegistry?.(),t),di(t,e,i)):on(Math.max(0,Number(e)||0),i);n.onDeterministicSeek(r),n.setIsPlaying(!1),n.onSyncMedia(r,!1),n.onRenderFrameSeek(r),n.onStatePost(!0)},getTime:()=>Number(n.getTimeline()?.time()??0),getDuration:()=>Number(n.getTimeline()?.duration()??0),isPlaying:()=>n.getIsPlaying(),setPlaybackRate:e=>n.setPlaybackRate(e),getPlaybackRate:()=>n.getPlaybackRate()}}function mi(){return{capturedTimeline:null,isPlaying:!1,rafId:null,currentTime:0,deterministicAdapters:[],parityModeEnabled:!0,canonicalFps:30,bridgeMuted:!1,mediaOutputMuted:!1,mediaAutoplayBlockedPosted:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,timelinePollIntervalId:null,controlBridgeHandler:null,clampDurationLoggedRaw:null,beforeUnloadHandler:null,domReadyHandler:null,injectedCompStyles:[],injectedCompScripts:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,maxTimelineDurationSeconds:1800,nativeVisualWatchdogTick:0}}var Ho="data-hf-authored-duration",Uo="data-hf-authored-end";function We(n){if(n==null||n==="")return null;let e=Number(n);return Number.isFinite(e)?e:null}function qo(n){return We(n.getAttribute("data-duration"))}function zo(n){return We(n.getAttribute("data-end"))}function jo(n){return We(n.getAttribute(Ho))}function Go(n){return We(n.getAttribute(Uo))}function $o(n){let e=(n??"").trim();if(!e)return null;let t=We(e);if(t!=null)return{kind:"absolute",value:t};let i=e.match(/^([A-Za-z0-9_.:-]+)(?:\\s*([+-])\\s*([0-9]*\\.?[0-9]+))?$/);if(!i)return null;let r=(i[1]??"").trim();if(!r)return null;let o=i[2]??"+",s=i[3]??"0",c=Number.parseFloat(s),u=Number.isFinite(c)?Math.max(0,c):0,a=o==="-"?-u:u;return{kind:"reference",refId:r,offset:a}}function He(n){let e=n.timelineRegistry??{},t=n.includeAuthoredTimingAttrs??!1,i=new WeakMap,r=new WeakMap,o=new Set,s=l=>{let f=document.getElementById(l);return f||(document.querySelector(`[data-composition-id="${CSS.escape(l)}"]`)??null)},c=l=>{let f=r.get(l);if(f!==void 0)return f;let m=null,h=qo(l)??(t?jo(l):null);if(h!=null&&h>0&&(m=h),m==null||m<=0){let M=zo(l)??(t?Go(l):null);if(M!=null){let C=a(l,0),A=M-C;Number.isFinite(A)&&A>0&&(m=A)}}if((m==null||m<=0)&&l instanceof HTMLMediaElement){let M=We(l.getAttribute("data-playback-start"))??We(l.getAttribute("data-media-start"))??0;Number.isFinite(l.duration)&&l.duration>M&&(m=l.duration-M)}if(m==null||m<=0){let M=l.getAttribute("data-composition-id");if(M){let C=e[M]??null;if(C&&typeof C.duration=="function")try{let A=Number(C.duration());Number.isFinite(A)&&A>0&&(m=A)}catch{}}}return m!=null&&Number.isFinite(m)&&m>0?(r.set(l,m),m):(r.set(l,null),null)},u=(l,f)=>{if(l.hasAttribute("data-composition-id")){let h=l.parentElement?.closest("[data-composition-id]");return h?a(h,f):0}let m=l.closest("[data-composition-id]");return m?a(m,f):0},a=(l,f)=>{let m=i.get(l);if(m!==void 0)return m??f;if(o.has(l))return f;o.add(l);try{let h=$o(l.getAttribute("data-start"));if(!h){if(l.hasAttribute("data-composition-id")){let O=l.parentElement;if(O&&(O.hasAttribute("data-composition-src")||O.hasAttribute("data-composition-id"))){let D=a(O,f);return i.set(l,D),D}}return i.set(l,f),f}if(h.kind==="absolute"){let O=Math.max(0,h.value),D=Math.max(0,u(l,f)+O);return i.set(l,D),D}let M=s(h.refId);if(!M)return i.set(l,f),f;let C=a(M,0),A=c(M);if(A==null||A<=0){let O=Math.max(0,C+h.offset);return i.set(l,O),O}let z=Math.max(0,C+A+h.offset);return i.set(l,z),z}finally{o.delete(l)}};return{resolveStartForElement:(l,f=0)=>a(l,Math.max(0,f)),resolveDurationForElement:l=>c(l)}}var Vo="data-hf-authored-duration",Ko="data-hf-authored-end";function ye(n){if(n==null||n==="")return null;let e=Number(n);return Number.isFinite(e)?e:null}function sn(n){return ye(n.getAttribute("data-duration"))??ye(n.getAttribute(Vo))}function pi(n){return ye(n.getAttribute("data-end"))??ye(n.getAttribute(Ko))}function ln(...n){let e=n.filter(t=>Number.isFinite(t??null));return e.length===0?null:Math.max(...e)}var hi={composition:0,video:1,image:2,element:3,audio:4};function Jo(n){if(n.length===0)return;let e=new Map;for(let s of n){let c=e.get(s.track)??new Set;c.add(s.kind),e.set(s.track,c)}if(!Array.from(e.values()).some(s=>s.size>1))return;let i=0,r=new Map,o=[...e.keys()].sort((s,c)=>s-c);for(let s of o){let c=e.get(s);if(c.size===1)r.set(`${s}:${[...c][0]}`,i++);else{let u=[...c].sort((a,l)=>(hi[a]??99)-(hi[l]??99));for(let a of u)r.set(`${s}:${a}`,i++)}}for(let s of n){let c=`${s.track}:${s.kind}`,u=r.get(c);u!=null&&(s.track=u)}}function ot(n){let e=String(n??"").trim();if(!e)return null;let t=e.toLowerCase();if(t.startsWith("data:")||t.startsWith("javascript:"))return null;try{return new URL(e,document.baseURI).toString()}catch{return e}}function xi(n){let e=n.getAttribute("src")??n.getAttribute("data-src");if(e)return ot(e);let t=n.getAttribute("data-composition-src");if(t)return ot(t);let i=n.querySelector("img[src], video[src], audio[src], source[src]");return i?ot(i.getAttribute("src")):null}function Qo(n){let e=n.className;return typeof e!="string"?null:e.split(/\\s+/).map(t=>t.trim()).find(t=>t&&t!=="clip"&&!t.startsWith("__hf-"))??null}function Yo(n){if(!n)return null;try{return new URL(n,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return n.split(/[\\\\/]/).filter(Boolean).at(-1)??null}}function Zo(n){let e=n.textContent?.replace(/\\s+/g," ").trim();return e?e.length>32?`${e.slice(0,31)}...`:e:null}function rt(n){let e=n.replace(/\\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\\s+/g," ").trim();return e?e.replace(/\\b\\w/g,t=>t.toUpperCase()):n}function Xo(n,e,t){let i=n.getAttribute("data-timeline-label")??n.getAttribute("data-label")??n.getAttribute("aria-label")??null;if(i?.trim())return i.trim();let r=n.getAttribute("data-composition-id");if(r)return rt(r);let o=n.id;if(o)return rt(o);let s=Qo(n);if(s)return rt(s);let c=Yo(xi(n));if(c)return rt(c);let u=Zo(n);return u||`${rt(e)} ${t+1}`}function gi(n){let t=window.__timelines??{},i=He({timelineRegistry:t,includeAuthoredTimingAttrs:!0}),r=R=>{if(!R)return null;let k=t[R]??null;if(!k||typeof k.duration!="function")return null;try{let L=Number(k.duration());return Number.isFinite(L)&&L>0?L:null}catch{return null}},o=R=>{let k=ye(R.getAttribute("data-duration"));if(k!=null&&k>0)return k;let L=ye(R.getAttribute("data-playback-start"))??ye(R.getAttribute("data-media-start"))??0;return Number.isFinite(R.duration)&&R.duration>L?Math.max(0,R.duration-L):null},s=()=>{let R=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(R.length===0)return null;let k=0;for(let L of R){let Q=i.resolveStartForElement(L,0);if(!Number.isFinite(Q))continue;let ie=o(L);ie==null||ie<=0||(k=Math.max(k,Math.max(0,Q)+ie))}return k>0?k:null},c=R=>{let k=R.trim().toLowerCase();return!(!k||k==="main"||k.includes("caption")||k.includes("ambient"))},u=(R,k)=>{let L=[],Q=null,ie=null,P=null,I=R.parentElement;for(;I;){let j=I.getAttribute("data-composition-id");j&&(L.push(j),!P&&I!==k&&(P=j),Q==null&&(Q=i.resolveStartForElement(I,0)),ie==null&&(ie=ye(I.getAttribute("data-duration"))??r(j)??null)),I=I.parentElement}return{parentCompositionId:P,compositionAncestors:L.reverse(),inheritedStart:Q,inheritedDuration:ie}},a=document.querySelector("[data-composition-id]"),l=Array.from(document.querySelectorAll("[data-composition-id]")),f=a?.getAttribute("data-composition-id")??null,m=a?i.resolveStartForElement(a,0):0,h=s(),M=h!=null?Math.max(0,h-Math.max(0,m)):null,C=r(f),A=sn(a??document.body),z=ln(...l.filter(R=>R!==a).map(R=>{let k=i.resolveStartForElement(R,0),L=i.resolveDurationForElement(R)??r(R.getAttribute("data-composition-id"))??null;return!Number.isFinite(k)||L==null||L<=0?null:Math.max(0,k)+L})),O=z!=null?Math.max(0,z-Math.max(0,m)):null,D=typeof C=="number"&&Number.isFinite(C)&&C>0?C:null,Y=typeof A=="number"&&Number.isFinite(A)&&A>0?A:null,S=typeof M=="number"&&Number.isFinite(M)&&M>0?M:null,p=typeof O=="number"&&Number.isFinite(O)&&O>0?O:null,y=ln(S,p),F=D!=null&&y!=null&&D>y+1,b=Y??(F?y:ln(D,S,p)),N=b!=null?Math.min(b,n.maxTimelineDurationSeconds):null,W=(N!=null?m+N:null)??(typeof h=="number"&&Number.isFinite(h)&&h>0?h:null),H=(R,k)=>!Number.isFinite(k)||k<=0?0:W==null||!Number.isFinite(W)?k:!Number.isFinite(R)||R>=W?0:Math.max(0,Math.min(k,W-R)),Z=[],T=[],X=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),ee=0;for(let R=0;R<X.length;R+=1){let k=X[R];if(k===a||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(k.tagName))continue;let L=u(k,a),Q=i.resolveStartForElement(k,L.inheritedStart??0),ie=k.getAttribute("data-composition-id"),P=sn(k);if((P==null||P<=0)&&ie&&ie!==f&&(P=r(ie)),(P==null||P<=0)&&k instanceof HTMLMediaElement){let ce=ye(k.getAttribute("data-playback-start"))??ye(k.getAttribute("data-media-start"))??0;Number.isFinite(k.duration)&&k.duration>0&&(P=Math.max(0,k.duration-ce))}if(P==null||P<=0){let ce=L.inheritedDuration;if(ce!=null&&ce>0){let Fe=(L.inheritedStart??0)+ce;P=Math.max(0,Fe-Q)}}if(P==null||P<=0||(P=H(Q,P),P<=0))continue;let I=Q+P;ee=Math.max(ee,I);let j=k.tagName.toLowerCase(),Ne=ie&&ie!==f?"composition":j==="video"?"video":j==="audio"?"audio":j==="img"?"image":"element";Z.push({id:k.id||ie||null,label:Xo(k,Ne,Z.length),start:Q,duration:P,track:Number.parseInt(k.getAttribute("data-track-index")??k.getAttribute("data-track")??String(R),10)||0,kind:Ne,tagName:j,compositionId:k.getAttribute("data-composition-id"),compositionAncestors:L.compositionAncestors,parentCompositionId:L.parentCompositionId,nodePath:null,compositionSrc:ot(k.getAttribute("data-composition-src")),assetUrl:xi(k),timelineRole:k.getAttribute("data-timeline-role"),timelineLabel:k.getAttribute("data-timeline-label"),timelineGroup:k.getAttribute("data-timeline-group"),timelinePriority:ye(k.getAttribute("data-timeline-priority"))})}let U=new Set(Z.map(R=>R.id)),G=a?.getAttribute("data-composition-id")??null,v=G?t[G]??null:null;if(v&&a){let R=v;if(typeof R.getChildren=="function")try{let k=R.getChildren(!0,!0,!1)??[],L=new Map;for(let P of a.children){let I=P;if(!I.id)continue;let j=I.tagName.toLowerCase();j==="script"||j==="style"||j==="link"||L.set(I,{id:I.id,start:1/0,end:-1/0})}let Q=P=>{let I=P;for(;I;){if(L.has(I))return I;if(I===a)return null;I=I.parentElement}return null};for(let P of k){if(typeof P.targets!="function"||typeof P.startTime!="function"||typeof P.duration!="function")continue;let I=P.startTime(),j=P.parent;for(;j&&j!==v&&typeof j.startTime=="function";)I+=j.startTime(),j=j.parent;let Ne=I+P.duration();if(!(!Number.isFinite(I)||!Number.isFinite(Ne)))for(let ce of P.targets()){if(!(ce instanceof Element))continue;let ze=Q(ce);if(!ze)continue;let Fe=L.get(ze);Fe&&(Fe.start=Math.min(Fe.start,I),Fe.end=Math.max(Fe.end,Ne))}}let ie=Z.length>0?Math.max(...Z.map(P=>P.track))+1:0;for(let[P,I]of L){if(I.start===1/0||I.end===-1/0)continue;let j=P;if(U.has(j.id))continue;let Ne=Math.max(0,I.end-I.start);if(Ne<=0)continue;let ce=H(I.start,Ne);ce<=0||(ee=Math.max(ee,I.start+ce),Z.push({id:j.id,label:j.getAttribute("data-timeline-label")??j.getAttribute("data-label")??j.getAttribute("aria-label")??j.id,start:I.start,duration:ce,track:Number.parseInt(j.getAttribute("data-track-index")??j.getAttribute("data-track")??"",10)||ie,kind:"element",tagName:j.tagName.toLowerCase(),compositionId:j.getAttribute("data-composition-id"),compositionAncestors:G?[G]:[],parentCompositionId:G,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:j.getAttribute("data-timeline-role"),timelineLabel:j.getAttribute("data-timeline-label"),timelineGroup:j.getAttribute("data-timeline-group"),timelinePriority:ye(j.getAttribute("data-timeline-priority"))}),U.add(j.id))}}catch{}}if(a&&N!=null&&N>0){let R=Z.length>0?Math.max(...Z.map(k=>k.track))+1:0;for(let k of a.children){let L=k;if(!L.id||U.has(L.id))continue;let Q=L.getAttribute("data-timeline-role");if(Q!=="overlay"&&Q!=="persistent-overlay")continue;let ie=L.tagName.toLowerCase();if(ie==="script"||ie==="style"||ie==="link"||ie==="meta"||window.getComputedStyle(L).display==="none")continue;let I=H(0,N);I<=0||(ee=Math.max(ee,I),Z.push({id:L.id,label:L.getAttribute("data-timeline-label")??L.getAttribute("data-label")??L.getAttribute("aria-label")??L.id,start:0,duration:I,track:Number.parseInt(L.getAttribute("data-track-index")??L.getAttribute("data-track")??"",10)||R,kind:"element",tagName:ie,compositionId:L.getAttribute("data-composition-id"),compositionAncestors:G?[G]:[],parentCompositionId:G,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:Q,timelineLabel:L.getAttribute("data-timeline-label"),timelineGroup:L.getAttribute("data-timeline-group"),timelinePriority:ye(L.getAttribute("data-timeline-priority"))}),U.add(L.id))}}Jo(Z);for(let R of l){if(R===a)continue;let k=R.getAttribute("data-composition-id");if(!k||!c(k))continue;let L=i.resolveStartForElement(R,0),Q=sn(R);if((Q==null||Q<=0)&&pi(R)!=null){let j=pi(R);Q=Math.max(0,j-L)}let ie=r(k),P=Q&&Q>0?Q:ie;if(P==null||P<=0)continue;let I=H(L,P);I<=0||T.push({id:k,label:R.getAttribute("data-label")??k,start:L,duration:I,thumbnailUrl:ot(R.getAttribute("data-thumbnail-url")),avatarName:null})}let J=Math.max(1,Math.min(Math.max(ee||1,N??0),n.maxTimelineDurationSeconds));return{source:"hf-preview",type:"timeline",durationInFrames:F&&Y==null?Number.POSITIVE_INFINITY:Math.max(1,Math.round(J*Math.max(1,n.canonicalFps))),clips:Z,scenes:T,compositionWidth:ye(a?.getAttribute("data-width"))??1920,compositionHeight:ye(a?.getAttribute("data-height"))??1080}}var re=_o(qr(),1),zr=re.default,Ku=re.default.stringify,Ju=re.default.fromJSON,Qu=re.default.plugin,Yu=re.default.parse,Zu=re.default.list,Xu=re.default.document,ec=re.default.comment,tc=re.default.atRule,nc=re.default.rule,ic=re.default.decl,rc=re.default.root,oc=re.default.CssSyntaxError,sc=re.default.Declaration,lc=re.default.Container,ac=re.default.Processor,uc=re.default.Document,cc=re.default.Comment,dc=re.default.Warning,fc=re.default.AtRule,mc=re.default.Result,pc=re.default.Input,hc=re.default.Rule,xc=re.default.Root,gc=re.default.Node;function vn(n){return n.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function Sl(n){return n.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function Al(n,e,t){let i=El(n,e,t),r=i.trim();if(!r||/^(html|body|:root|\\*)$/i.test(r))return n;let o=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*=\\\\s*(["\'])${vn(t)}\\\\1\\\\s*\\\\]`,"g");if(o.test(r))return i.replace(o,e);let s=i.match(/^\\s*/)?.[0]??"",c=i.match(/\\s*$/)?.[0]??"";return`${s}${e} ${r}${c}`}function El(n,e,t){let i=vn(t),r=String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${i}"|\'${i}\')\\s*\\]`,o=String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`;return n.replace(new RegExp(`${r}(?:${o})+`,"g"),e).replace(new RegExp(`(?:${o})+${r}`,"g"),e)}var Fl=new Set(["keyframes","-webkit-keyframes","font-face"]);function bl(n){return n?.type==="atrule"}function Nl(n){let e=n.parent;for(;e;){if(bl(e)&&Fl.has(e.name.toLowerCase()))return!0;e=e.parent}return!1}function Bn(n,e,t){let i=e.trim();if(!n||!i)return n;let r=t||`[data-composition-id="${Sl(i)}"]`,o=zr.parse(n);return o.walkRules(s=>{Nl(s)||(s.selectors=s.selectors.map(c=>Al(c,r,i)))}),o.toResult({map:!1}).css}function jr(n,e,t="[HyperFrames] composition script error:",i,r=e){let o=JSON.stringify(e),s=JSON.stringify(r),c=JSON.stringify(t),u=vn(e),a=JSON.stringify(i??null),l=JSON.stringify(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${u}"|\'${u}\')\\s*\\]`),f=JSON.stringify(String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`);return`(function(){\n var __hfCompId = ${o};\n var __hfTimelineCompId = ${s};\n var __hfErrorLabel = ${c};\n var __hfEscapeAttr = function(value) {\n return (value + "").replace(/\\\\\\\\/g, "\\\\\\\\\\\\\\\\").replace(/"/g, "\\\\\\\\\\\\"");\n };\n var __hfRootSelector = ${a} || (__hfCompId\n ? \'[data-composition-id="\' + __hfEscapeAttr(__hfCompId) + \'"]\'\n : "");\n var __hfRoot = null;\n var __hfRootSelectorPattern = ${l};\n var __hfTimingSelectorPattern = ${f};\n var __hfNormalizeSelector = function(selector) {\n if (!__hfCompId || typeof selector !== "string") return selector;\n return selector\n .replace(new RegExp(__hfRootSelectorPattern + \'(?:\' + __hfTimingSelectorPattern + \')+\', \'g\'), __hfRootSelector)\n .replace(new RegExp(\'(?:\' + __hfTimingSelectorPattern + \')+\' + __hfRootSelectorPattern, \'g\'), __hfRootSelector);\n };\n var __hfFindRoot = function() {\n if (!__hfRoot && __hfRootSelector) {\n __hfRoot = window.document.querySelector(__hfRootSelector);\n }\n return __hfRoot;\n };\n var __hfContains = function(node) {\n var root = __hfFindRoot();\n return !root || node === root || root.contains(node);\n };\n var __hfQueryAll = function(selector) {\n var root = __hfFindRoot();\n if (!root || typeof selector !== "string") {\n return window.document.querySelectorAll(selector);\n }\n return Array.prototype.filter.call(window.document.querySelectorAll(__hfNormalizeSelector(selector)), function(node) {\n return __hfContains(node);\n });\n };\n var __hfQueryOne = function(selector) {\n var matches = __hfQueryAll(selector);\n return matches[0] || null;\n };\n var __hfScopedDocument = typeof Proxy === "function"\n ? new Proxy(window.document, {\n get: function(target, prop, receiver) {\n if (prop === "querySelector") return __hfQueryOne;\n if (prop === "querySelectorAll") return __hfQueryAll;\n if (prop === "getElementById") {\n return function(id) {\n var found = target.getElementById(id);\n return found && __hfContains(found) ? found : null;\n };\n }\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n })\n : window.document;\n var __hfTimelineRegistryProxy = null;\n var __hfGetTimelineRegistry = function() {\n window.__timelines = window.__timelines || {};\n if (!__hfCompId || __hfCompId === __hfTimelineCompId || typeof Proxy !== "function") {\n return window.__timelines;\n }\n if (!__hfTimelineRegistryProxy) {\n __hfTimelineRegistryProxy = new Proxy(window.__timelines, {\n get: function(target, prop, receiver) {\n return Reflect.get(target, prop === __hfCompId ? __hfTimelineCompId : prop, target);\n },\n set: function(target, prop, value, receiver) {\n return Reflect.set(target, prop === __hfCompId ? __hfTimelineCompId : prop, value, target);\n },\n });\n }\n return __hfTimelineRegistryProxy;\n };\n var __hfScopedWindow = typeof Proxy === "function"\n ? new Proxy(window, {\n get: function(target, prop, receiver) {\n if (prop === "__timelines") return __hfGetTimelineRegistry();\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n set: function(target, prop, value, receiver) {\n if (prop === "__timelines") {\n target.__timelines = value || {};\n __hfTimelineRegistryProxy = null;\n return true;\n }\n return Reflect.set(target, prop, value, target);\n },\n })\n : window;\n var __hfResolveGsapTarget = function(target) {\n if (typeof target !== "string") return target;\n return __hfQueryAll(target);\n };\n var __hfScopeTimeline = function(timeline) {\n if (!timeline || timeline.__hfScopedCompositionRoot === __hfFindRoot()) return timeline;\n ["to", "from", "fromTo", "set"].forEach(function(method) {\n var original = timeline[method];\n if (typeof original !== "function") return;\n timeline[method] = function(target) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(target);\n return original.apply(timeline, args);\n };\n });\n try {\n Object.defineProperty(timeline, "__hfScopedCompositionRoot", {\n value: __hfFindRoot(),\n configurable: true,\n });\n } catch (_err) {}\n return timeline;\n };\n var __hfBaseGsap = typeof gsap === "undefined" ? window.gsap : gsap;\n var __hfScopedGsap = !__hfBaseGsap || typeof Proxy !== "function"\n ? __hfBaseGsap\n : new Proxy(__hfBaseGsap, {\n get: function(target, prop, receiver) {\n if (prop === "timeline") {\n return function() {\n return __hfScopeTimeline(target.timeline.apply(target, arguments));\n };\n }\n if (prop === "to" || prop === "from" || prop === "fromTo" || prop === "set") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return target[prop].apply(target, args);\n };\n }\n if (prop === "utils" && target.utils && typeof Proxy === "function") {\n return new Proxy(target.utils, {\n get: function(utilsTarget, utilsProp, utilsReceiver) {\n if (utilsProp === "toArray") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return utilsTarget.toArray.apply(utilsTarget, args);\n };\n }\n if (utilsProp === "selector") {\n return function(base) {\n var baseEl = typeof base === "string" ? __hfQueryOne(base) : base;\n var root = baseEl || __hfFindRoot();\n return function(selector) {\n if (!root || typeof selector !== "string") return [];\n return Array.prototype.slice.call(root.querySelectorAll(selector));\n };\n };\n }\n var value = Reflect.get(utilsTarget, utilsProp, utilsTarget);\n return typeof value === "function" ? value.bind(utilsTarget) : value;\n },\n });\n }\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n });\n var __hfBaseHyperframes = window.__hyperframes;\n var __hfScopedHyperframes = !__hfBaseHyperframes\n ? __hfBaseHyperframes\n : Object.assign({}, __hfBaseHyperframes, {\n getVariables: function() {\n var byComp = window.__hfVariablesByComp;\n var scoped = byComp && __hfCompId ? byComp[__hfCompId] : null;\n return scoped ? Object.assign({}, scoped) : {};\n },\n });\n var __hfRun = function() {\n try {\n (function(document, gsap, window, __hyperframes) {\n${n}\n }).call(window, __hfScopedDocument, __hfScopedGsap, __hfScopedWindow, __hfScopedHyperframes);\n } catch (_err) {\n console.error(__hfErrorLabel, __hfCompId, _err);\n }\n };\n __hfFindRoot();\n __hfRun();\n})()`}function Gr(){if(typeof document>"u")return{};let n=_n(document.documentElement),e=wl();return{...n,...e}}function _n(n){if(!n)return{};let e=n.getAttribute("data-composition-variables");if(!e)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(!Array.isArray(t))return{};let i={};for(let r of t){if(!r||typeof r!="object")continue;let o=r;typeof o.id!="string"||!("default"in o)||(i[o.id]=o.default)}return i}function wl(){if(typeof window>"u")return{};let n=window.__hfVariables;return!n||typeof n!="object"||Array.isArray(n)?{}:n}var Cl=8e3,Ml=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/,kl=n=>new Promise(e=>{let t=!1,i=Date.now(),r=null,o=s=>{t||(t=!0,r!=null&&window.clearTimeout(r),e({status:s,elapsedMs:Math.max(0,Date.now()-i)}))};n.addEventListener("load",()=>o("load"),{once:!0}),n.addEventListener("error",()=>o("error"),{once:!0}),r=window.setTimeout(()=>o("timeout"),Cl)});function On(n){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=""}function $r(n,e){let t=n.trim();if(!t)return n;try{return Ml.test(t)?new URL(t,document.baseURI).toString():e?new URL(t,e).toString():new URL(t,document.baseURI).toString()}catch{return n}}function Dl(n){let e=n.getAttribute("data-variable-values");if(!e)return{};let t;try{t=JSON.parse(e)}catch{return{}}return!t||typeof t!="object"||Array.isArray(t)?{}:t}async function Pn(n){let e=null;n.hostCompositionId&&(e=Array.from(n.sourceNode.querySelectorAll("[data-composition-id]")).find(l=>l.getAttribute("data-composition-id")===n.hostCompositionId)??null);let t=e??n.sourceNode,i=e?.getAttribute("data-composition-id")?.trim()||n.hostCompositionId||null;if(n.headStyles)for(let a of n.headStyles){let l=a.cloneNode(!0);l instanceof HTMLStyleElement&&(i&&(l.textContent=Bn(l.textContent||"",i)),document.head.appendChild(l),n.injectedStyles.push(l))}let r=Array.from(t.querySelectorAll("style"));for(let a of r){let l=a.cloneNode(!0);l instanceof HTMLStyleElement&&(i&&(l.textContent=Bn(l.textContent||"",i)),document.head.appendChild(l),n.injectedStyles.push(l))}let o=[];if(n.headScripts)for(let a of n.headScripts){let l=a.getAttribute("type")?.trim()??"",f=a.getAttribute("src")?.trim()??"";if(f){let m=$r(f,n.compositionUrl);o.push({kind:"external",src:m,type:l})}else{let m=a.textContent?.trim()??"";m&&o.push({kind:"inline",content:m,type:l,scopeCompositionId:i})}}let s=Array.from(t.querySelectorAll("script")),c=[...o];for(let a of s){let l=a.getAttribute("type")?.trim()??"",f=a.getAttribute("src")?.trim()??"";if(f){let m=$r(f,n.compositionUrl);c.push({kind:"external",src:m,type:l})}else{let m=a.textContent?.trim()??"";m&&c.push({kind:"inline",content:m,type:l,scopeCompositionId:i})}a.parentNode?.removeChild(a)}let u=Array.from(t.querySelectorAll("style"));for(let a of u)a.parentNode?.removeChild(a);if(e){let a=document.importNode(e,!0),l=e.getAttribute("data-width"),f=e.getAttribute("data-height"),m=n.parseDimensionPx(l),h=n.parseDimensionPx(f);for(l&&n.host.setAttribute("data-width",l),f&&n.host.setAttribute("data-height",f),m&&n.host instanceof HTMLElement&&(n.host.style.width=m),h&&n.host instanceof HTMLElement&&(n.host.style.height=h);a.firstChild;)n.host.appendChild(a.firstChild)}else n.hasTemplate?n.host.appendChild(document.importNode(t,!0)):n.host.innerHTML=n.fallbackBodyInnerHtml;if(i){let a={...n.declaredVariableDefaults??{},...Dl(n.host)};Object.keys(a).length>0&&(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[i]=a)}for(let a of c){let l=document.createElement("script");if(a.type&&(l.type=a.type),l.async=!1,a.kind==="external"?l.src=a.src:a.type.toLowerCase()==="module"?l.textContent=a.content:a.scopeCompositionId?l.textContent=jr(a.content,a.scopeCompositionId):l.textContent=`(function(){${a.content}})();`,document.body.appendChild(l),n.injectedScripts.push(l),a.kind==="external"){let f=await kl(l);f.status!=="load"&&n.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:n.hostCompositionId,hostCompositionSrc:n.hostCompositionSrc,resolvedScriptSrc:a.src,loadStatus:f.status,elapsedMs:f.elapsedMs}})}}}async function Vr(n){let e=Array.from(document.querySelectorAll("[data-composition-id]:not([data-composition-src])")).filter(t=>{if(t.children.length>0)return!1;let i=t.getAttribute("data-composition-id");return i?!!document.querySelector(`template#${CSS.escape(i)}-template`):!1});if(e.length!==0)for(let t of e){let i=t.getAttribute("data-composition-id"),r=document.querySelector(`template#${CSS.escape(i)}-template`);On(t),await Pn({host:t,hostCompositionId:i,hostCompositionSrc:`template#${i}-template`,sourceNode:r.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:n.injectedStyles,injectedScripts:n.injectedScripts,parseDimensionPx:n.parseDimensionPx,onDiagnostic:n.onDiagnostic})}}async function Kr(n){let e=Array.from(document.querySelectorAll("[data-composition-src]"));e.length!==0&&await Promise.all(e.map(async t=>{let i=t.getAttribute("data-composition-src");if(!i)return;let r=null;try{r=new URL(i,document.baseURI)}catch{r=null}On(t);try{let o=t.getAttribute("data-composition-id"),s=o!=null?document.querySelector(`template#${CSS.escape(o)}-template`):null;if(s){await Pn({host:t,hostCompositionId:o,hostCompositionSrc:i,sourceNode:s.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:r,injectedStyles:n.injectedStyles,injectedScripts:n.injectedScripts,parseDimensionPx:n.parseDimensionPx,onDiagnostic:n.onDiagnostic});return}let c=await fetch(i);if(!c.ok)throw new Error(`HTTP ${c.status}`);let u=await c.text(),l=new DOMParser().parseFromString(u,"text/html"),f=(o?l.querySelector(`template#${CSS.escape(o)}-template`):null)??l.querySelector("template"),m=f?f.content:l.body,h=f?void 0:Array.from(l.head.querySelectorAll("style")),M=f?void 0:Array.from(l.head.querySelectorAll("script"));await Pn({host:t,hostCompositionId:o,hostCompositionSrc:i,sourceNode:m,hasTemplate:!!f,fallbackBodyInnerHtml:l.body.innerHTML,compositionUrl:r,injectedStyles:n.injectedStyles,injectedScripts:n.injectedScripts,parseDimensionPx:n.parseDimensionPx,headStyles:h,headScripts:M,declaredVariableDefaults:_n(l.documentElement),onDiagnostic:n.onDiagnostic})}catch(o){n.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:t.getAttribute("data-composition-id"),hostCompositionSrc:i,errorMessage:o instanceof Error?o.message:"unknown_error"}}),On(t)}}))}function Ll(n){return n instanceof HTMLElement?n.dataset.captionWrapper!=="true"?n:n.querySelector(":scope > span")??null:null}function Tl(){let n=[],e=document.querySelectorAll(".caption-group");for(let t of e)for(let i of t.children){if(!(i instanceof HTMLElement))continue;let r=i.dataset.captionWrapper==="true"?i.querySelector(":scope > span"):i.tagName==="SPAN"?i:null;r&&n.push(r)}return n}function Rl(n){let e=n.parentElement;if(e?.dataset.captionWrapper==="true")return e;let t=document.createElement("span");return t.style.display="inline-block",t.dataset.captionWrapper="true",n.parentNode?.insertBefore(t,n),t.appendChild(n),t}function In(){let n=window.gsap;n&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(e=>e.ok?e.json():null).then(e=>{if(!e||!Array.isArray(e)||e.length===0)return;let t=Tl();for(let i of e){let r=null;if(i.wordId&&(r=Ll(document.getElementById(i.wordId))),!r&&i.wordIndex!==void 0&&(r=t[i.wordIndex]??null),!r)continue;let o={},s={};if(i.x!==void 0&&(o.x=i.x),i.y!==void 0&&(o.y=i.y),i.scale!==void 0&&(o.scale=i.scale),i.rotation!==void 0&&(o.rotation=i.rotation),i.opacity!==void 0&&(s.opacity=i.opacity),i.fontSize!==void 0&&(s.fontSize=`${i.fontSize}px`),i.fontWeight!==void 0&&(s.fontWeight=i.fontWeight),i.fontFamily!==void 0&&(s.fontFamily=i.fontFamily),i.activeColor||i.dimColor){let u=n.getTweensOf(r).filter(l=>l.vars.color!==void 0).sort((l,f)=>l.startTime()-f.startTime()),a=u.length>0?String(u[0].vars.color):"";for(let l of u)String(l.vars.color)===a?i.dimColor&&(l.vars.color=i.dimColor):i.activeColor&&(l.vars.color=i.activeColor);i.dimColor&&n.set(r,{color:i.dimColor})}if(Object.keys(s).length>0&&n.set(r,s),Object.keys(o).length>0){let c=Rl(r);n.set(c,o)}}}).catch(()=>{})}var Jr="data-hf-authored-duration",Qr="data-hf-authored-end";function Yr(){let n=mi(),e=window,t=null,i=null,r=[],o=new Set,s=null;if(typeof e.__hfRuntimeTeardown=="function")try{e.__hfRuntimeTeardown()}catch{}document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden"),window.__timelines=window.__timelines||{};let c=d=>{r.push(d)},u=(d,g,x)=>{let w=x??`${d}:${JSON.stringify(g)}`;o.has(w)||(o.add(w),ge({source:"hf-preview",type:"diagnostic",code:d,details:g}))},a=d=>{let g={scale:1,focusX:960,focusY:540},x=[],w=[],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:()=>g,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>x,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:()=>w,getRenderState:()=>({...E,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},l=1/60,f=.75,m=.75,h=.35,M=900,C=3,A=2,z=.05,O=100,D=240,Y=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??"")}},S=d=>{let g=d.toLowerCase();return g.includes("cannot read properties of null")||g.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:g.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:g.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},p=d=>{if(d==null||d.trim()==="")return null;let g=Number.parseFloat(d);return!Number.isFinite(g)||g<=0?null:`${g}px`},y=()=>{let d=document.querySelector(\'[data-composition-id][data-root="true"]\');if(d instanceof HTMLElement)return d;let g=Array.from(document.querySelectorAll("[data-composition-id]"));return g.length===0?null:g.find(x=>!x.parentElement?.closest("[data-composition-id]"))??g[0]??null},F=()=>{let d=y();if(!d)return;let g=p(d.getAttribute("data-width")),x=p(d.getAttribute("data-height"));g&&(d.style.width=g),x&&(d.style.height=x),g&&d.style.setProperty("--comp-width",g),x&&d.style.setProperty("--comp-height",x)},b=()=>{let d=y(),g=Array.from(document.querySelectorAll("[data-composition-id]")).filter(x=>x.hasAttribute("data-duration")||x.hasAttribute("data-end"));for(let x of g){if(d&&x===d)continue;let w=x.getAttribute("data-duration"),E=x.getAttribute("data-end");w!=null&&!x.hasAttribute(Jr)&&x.setAttribute(Jr,w),E!=null&&!x.hasAttribute(Qr)&&x.setAttribute(Qr,E),x.removeAttribute("data-duration"),x.removeAttribute("data-end")}},N=()=>{let d=y();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let g=p(d.getAttribute("data-width")),x=p(d.getAttribute("data-height"));g&&(d.style.width=g),x&&(d.style.height=x);let w=Array.from(d.children);for(let E of w){let _=E.tagName.toLowerCase();if(_==="script"||_==="style"||_==="link"||_==="meta"||!E.hasAttribute("data-start"))continue;let le=(E.style.top==="0px"||E.style.top==="0")&&(E.style.left==="0px"||E.style.left==="0")&&E.style.width==="100%"&&E.style.height==="100%",ae=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(E.style.transform);if(le&&ae&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let Se=E.style.top,ue=E.style.left,tt=E.style.width,ne=E.style.height;E.style.top="",E.style.left="",E.style.width="",E.style.height="";let $=window.getComputedStyle(E);$.top!=="auto"||$.bottom!=="auto"||$.left!=="auto"||$.right!=="auto"||$.width!=="0px"||$.height!=="0px"||(E.style.top=Se,E.style.left=ue,E.style.width=tt,E.style.height=ne)}let V=window.getComputedStyle(E),we=V.position;if(we!=="absolute"&&we!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||V.top!=="auto"||V.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||V.left!=="auto"||V.right!=="auto"||(E.style.left="0"),_!=="audio"){let Se=p(E.getAttribute("data-width")),ue=p(E.getAttribute("data-height")),tt=V.width!=="0px"&&V.width!=="auto",ne=V.height!=="0px"&&V.height!=="auto";Se?!E.style.width&&!tt&&(E.style.width=Se):!E.style.width&&V.width==="0px"&&(E.style.width="100%"),ue?!E.style.height&&!ne&&(E.style.height=ue):!E.style.height&&V.height==="0px"&&(E.style.height="100%")}}},B=(d,g=0,x)=>He({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:x?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,g),W=(d,g)=>He({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:g?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),H=!!document.querySelector("[data-composition-src]"),Z=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let g of d){let x=g.getAttribute("data-composition-id");if(x&&g.children.length===0&&document.querySelector(`template#${CSS.escape(x)}-template`)){Z=!0;break}}}let T=!H&&!Z,X=d=>{if(!d||typeof d.duration!="function")return null;try{let g=Number(d.duration());return Number.isFinite(g)?Math.max(0,g):null}catch{return null}},ee=d=>typeof d=="number"&&Number.isFinite(d)&&d>l,U=d=>{let g=Number(d.getAttribute("data-duration"));if(Number.isFinite(g)&&g>0)return g;let x=Number(d.getAttribute("data-playback-start")??d.getAttribute("data-media-start")??"0"),w=Number.isFinite(x)?Math.max(0,x):0;return Number.isFinite(d.duration)&&d.duration>w?Math.max(0,d.duration-w):null},G=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let g=0;for(let x of d){let w=B(x,0);if(!Number.isFinite(w))continue;let E=U(x);E==null||E<=l||(g=Math.max(g,Math.max(0,w)+E))}return g>l?g:null},v=()=>{let d=y();if(!d)return null;let g=window.__timelines??{},x=He({timelineRegistry:g,includeAuthoredTimingAttrs:!0}),w=0,E=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let _ of E){if(!(_ instanceof Element)||_.parentElement?.closest("[data-composition-id]")!==d)continue;let ae=x.resolveStartForElement(_,0),V=x.resolveDurationForElement(_);!Number.isFinite(ae)||V==null||V<=0||(w=Math.max(w,Math.max(0,ae)+V))}return w>l?w:null},J=()=>{let d=G();return typeof d!="number"||!Number.isFinite(d)||d<=l?null:d},Ee=d=>ee(d)?Math.max(l,d*f):l,xe=(d,g=0)=>{let x=X(d),w=J(),E=v(),_=Math.max(w??0,E??0),le=Number.isFinite(g)&&g>l?g:0,ae=0;ee(x)?ae=Math.max(x,_,le):ee(_)?ae=Math.max(_,le):ae=le;let V=Math.max(1,Number(n.maxTimelineDurationSeconds)||1800);return ae>0?Math.max(0,Math.min(ae,V)):0},R=()=>{let d=window.__timelines??{},g=He({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),x=J(),w=v(),E=Math.max(x??0,w??0)||null,_=Ee(E),le=ne=>{let $=document.querySelector(`[data-composition-id="${CSS.escape(ne)}"]`);return $?g.resolveStartForElement($,0):0},ae=ne=>{let $=window.gsap;if(!$||typeof $.timeline!="function")return null;let oe=$.timeline({paused:!0});for(let pe of ne)oe.add(pe.timeline,le(pe.compositionId));return oe},V=(ne,$)=>{if(!ee(ne))return null;let oe=window.gsap;if(!oe||typeof oe.timeline!="function")return null;let pe=oe.timeline({paused:!0});if($)try{pe.add($,0)}catch{}let he=pe;if(typeof he.to=="function")try{he.to({},{duration:ne})}catch{}return pe},we=(ne,$)=>{let oe=ne;if(typeof oe.getChildren!="function")return[];try{let pe=oe.getChildren(!0,!0,!0)??[];if(!Array.isArray(pe))return[];let he=[];for(let se of $)if(!pe.some(Ie=>Ie===se.timeline))try{let Ie=le(se.compositionId);ne.add(se.timeline,Ie),he.push(se.compositionId)}catch{}return he}catch{return[]}},Re=y(),de=Re?.getAttribute("data-composition-id")??null;if(!de)return{timeline:null};let me=d[de]??null,ue=(()=>{if(!Re)return[];let ne=new Set,$=Array.from(Re.querySelectorAll("[data-composition-id]")),oe=[];for(let pe of $){let he=pe.getAttribute("data-composition-id");if(!he||he===de||ne.has(he))continue;ne.add(he);let se=d[he]??null;if(!se||typeof se.play!="function"||typeof se.pause!="function")continue;let Ae=X(se);oe.push({compositionId:he,timeline:se,durationSeconds:Ae??0})}return oe})(),tt=ne=>{for(let $ of ne){let oe=$.timeline;if(typeof oe.paused=="function")try{oe.paused(!1)}catch{}}};if(ue.length>0&&tt(ue),me){let ne=ue.length>0?we(me,ue):[];if((ue.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+de+"\'])"))&&(L=!0),ne.length>0)try{let se=me.time();me.seek(se,!1)}catch{}let $=X(me);if(!ee($)&&ue.length>0){let se=ue.map(ko=>ko.compositionId),Ae=ae(ue),Ie=X(Ae);if(Ae&&ee(Ie))return{timeline:Ae,selectedTimelineIds:se,selectedDurationSeconds:Ie,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:de,rootDurationSeconds:$,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:_,selectedDurationSeconds:Ie,mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:w,selectedTimelineIds:se,autoNestedChildren:ne}}};let en=V(E??0,me),tn=X(en);if(en&&ee(tn))return{timeline:en,selectedTimelineIds:[de],selectedDurationSeconds:tn,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:de,rootDurationSeconds:$,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:tn,selectedTimelineIds:[de],autoNestedChildren:ne}}}}if(!ee($)&&ue.length===0){let se=V(E??0,me),Ae=X(se);if(se&&ee(Ae))return{timeline:se,selectedTimelineIds:[de],selectedDurationSeconds:Ae,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:de,rootDurationSeconds:$,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:Ae,selectedTimelineIds:[de]}}}}let oe=Re?.getAttribute("data-duration"),pe=oe?parseFloat(oe):null,he=Math.max(ee(pe)?pe:0,w??0);if(he>0&&ee(he)&&ee($)&&he>=$+.5){let se=me;if(typeof se.to=="function")try{se.to({},{duration:0},he)}catch{}let Ae=X(me);if(ee(Ae))return{timeline:me,selectedTimelineIds:[de],selectedDurationSeconds:Ae,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:de,rootDurationSeconds:$,rootDeclaredDur:pe,authoredCompositionDurationFloorSeconds:w,newDur:Ae}}}}return{timeline:me,selectedTimelineIds:[de],selectedDurationSeconds:$,mediaDurationFloorSeconds:x,diagnostics:ne.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:de,selectedDurationSeconds:$,autoNestedChildren:ne}}:void 0}}if(ue.length>0){let ne=ue.map(pe=>pe.compositionId),$=ae(ue),oe=X($);if($)return{timeline:$,selectedTimelineIds:ne,selectedDurationSeconds:oe,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:de,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:_,selectedDurationSeconds:oe,mediaDurationFloorSeconds:x,selectedTimelineIds:ne}}}}return{timeline:null}},k=()=>{let d=n.capturedTimeline;if(!d||typeof d.time!="function")return;let g=Number(d.time());Number.isFinite(g)&&(n.currentTime=Math.max(0,g))},L=!1,Q=()=>{if(!T)return!1;let d=n.capturedTimeline,g=X(d),x=ee(g);if(d&&x&&L)return!1;let w=R();return w.timeline?d&&d===w.timeline?(typeof d.timeScale=="function"&&d.timeScale(n.playbackRate),!1):(n.capturedTimeline=w.timeline,typeof n.capturedTimeline.timeScale=="function"&&n.capturedTimeline.timeScale(n.playbackRate),w.diagnostics&&ge({source:"hf-preview",type:"diagnostic",code:w.diagnostics.code,details:w.diagnostics.details}),ge({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:w.selectedTimelineIds??[],selectedDurationSeconds:w.selectedDurationSeconds??null,mediaDurationFloorSeconds:w.mediaDurationFloorSeconds??null}}),!0):!1},ie=()=>{let d=y();if(!(d instanceof HTMLElement))return;let g=d.getBoundingClientRect(),x=Number(d.getAttribute("data-width")),w=Number(d.getAttribute("data-height")),E=window.getComputedStyle(d),_=Number.isFinite(x)&&x>0&&Number.isFinite(w)&&w>0,le=g.width<=0||g.height<=0||d.clientWidth<=0||d.clientHeight<=0;!_||!le||u("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:x,declaredHeight:w,rectWidth:Math.round(g.width),rectHeight:Math.round(g.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"}`)},P=()=>{n.tornDown||(s!=null&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=null,ie()}))},I=()=>{t=d=>{let g=Y(d.error??d.message).slice(0,D);if(!g)return;let x=S(g);ge({source:"hf-preview",type:"diagnostic",code:x.code,details:{category:x.category,message:g,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},i=d=>{let g=Y(d.reason).slice(0,D);if(!g)return;let x=S(g);ge({source:"hf-preview",type:"diagnostic",code:`${x.code}_unhandled_rejection`,details:{category:`${x.category}-unhandled-rejection`,message:g}})},window.addEventListener("error",t),window.addEventListener("unhandledrejection",i)},j=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let x of d){let w=()=>{if(!(x instanceof Element))return;let E=x.tagName.toLowerCase(),_=x.getAttribute("src")??x.getAttribute("href")??x.getAttribute("poster")??null,le=E==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";u(le,{tagName:E,assetUrl:_,currentSrc:(x instanceof HTMLImageElement||x instanceof HTMLMediaElement)&&x.currentSrc||null,readyState:x instanceof HTMLMediaElement?x.readyState:null,networkState:x instanceof HTMLMediaElement?x.networkState:null},`${le}:${E}:${_??"unknown"}`)};x.addEventListener("error",w),c(()=>{x.removeEventListener("error",w)})}let g=document.fonts;g&&g.ready.then(()=>{if(n.tornDown)return;let x=Array.from(g).filter(w=>w.status==="error").map(w=>w.family).filter(w=>!!w).slice(0,10);x.length!==0&&u("runtime_font_load_issue",{failedFamilies:x,totalFaces:Array.from(g).length},`runtime-font-load-issue:${x.join("|")}`)}).catch(()=>{})},Ne=(d,g)=>{if(!d.timeline)return!1;let x=n.capturedTimeline;if(x&&x===d.timeline)return!1;let w=Math.max(0,n.currentTime||0),E=n.isPlaying;n.capturedTimeline=d.timeline,typeof n.capturedTimeline.timeScale=="function"&&n.capturedTimeline.timeScale(n.playbackRate);try{n.capturedTimeline.pause(),n.capturedTimeline.seek(w,!1),E&&n.capturedTimeline.play()}catch{}return ge({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:g,previousTime:w,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},ce=null,ze=!1,Fe=new Set,Ct=()=>{n.tornDown||(ce!=null&&window.clearTimeout(ce),ce=window.setTimeout(()=>{if(n.tornDown)return;ce=null;let d=R();if(!d.timeline||!ee(d.mediaDurationFloorSeconds??null))return;if(!n.capturedTimeline){Q()&&(je(),Te(!0));return}if(ze)return;let x=X(n.capturedTimeline),w=d.selectedDurationSeconds??X(d.timeline);ee(w)&&(!ee(x)||w>=x+z)&&Ne(d,"manual")&&(ze=!0,ge({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:x??null,selectedDurationSeconds:w??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),je(),Te(!0))},O))},wo=()=>{for(let d of Fe)d.removeEventListener("loadedmetadata",Ct),d.removeEventListener("durationchange",Ct);Fe.clear()},Qt=()=>{if(n.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let g of d)Fe.has(g)||(Fe.add(g),g.addEventListener("loadedmetadata",Ct),g.addEventListener("durationchange",Ct),g.preload!=="auto"&&(g.preload="auto"),g.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&g.load())},Vn=()=>{let d=E=>{let _=E.closest("[data-composition-id]"),le=_?B(_,0):null,ae=_?W(_,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:_,inheritedStart:le,inheritedDuration:ae}},g=ai({shouldIncludeElement:E=>E.hasAttribute("data-start")||!!d(E).compositionRoot,resolveStartSeconds:E=>{let _=d(E);return B(E,_.inheritedStart??0)},resolveDurationSeconds:E=>{let _=d(E),le=B(E,_.inheritedStart??0),ae=Number.parseFloat(E.dataset.playbackStart??E.dataset.mediaStart??"0")||0,V=_.inheritedStart!=null&&_.inheritedDuration!=null&&_.inheritedDuration>0?Math.max(0,_.inheritedStart+_.inheritedDuration-le):null,we=Number.isFinite(E.duration)&&E.duration>ae?Math.max(0,E.duration-ae):null;return we!=null&&V!=null?Math.min(we,V):we??V}});ui({clips:g.mediaClips,timeSeconds:n.currentTime,playing:n.isPlaying,playbackRate:n.playbackRate,outputMuted:n.mediaOutputMuted,userMuted:n.bridgeMuted,onAutoplayBlocked:()=>{n.mediaAutoplayBlockedPosted||(n.mediaAutoplayBlockedPosted=!0,ge({source:"hf-preview",type:"media-autoplay-blocked"}))}});let x=document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null,w=Array.from(document.querySelectorAll("[data-start]"));for(let E of w){if(!(E instanceof HTMLElement))continue;let _=E.tagName.toLowerCase();if(_==="script"||_==="style"||_==="link"||_==="meta")continue;if(!E.getAttribute("data-composition-id")){let Se=E.closest("[data-composition-id]")?.getAttribute("data-composition-id")??null;if(Se&&Se!==x)continue}let ae=B(E,0),V=W(E),we=E.getAttribute("data-composition-id");if(we){let me=(window.__timelines??{})[we],Se=null;if(me&&typeof me.duration=="function"){let ue=Number(me.duration());Number.isFinite(ue)&&ue>0&&(Se=ue)}V!=null&&V>0&&Se!=null?V=Math.min(V,Se):(V==null||V<=0)&&Se!=null&&(V=Se)}let Re=V!=null&&V>0?ae+V:Number.POSITIVE_INFINITY,de=n.currentTime>=ae&&(Number.isFinite(Re)?n.currentTime<Re:!0);E.style.visibility=de?"visible":"hidden"}},Te=d=>{k();let g=Math.max(0,Math.round((n.currentTime||0)*n.canonicalFps)),x=Date.now();(d||g!==n.bridgeLastPostedFrame||n.isPlaying!==n.bridgeLastPostedPlaying||n.bridgeMuted!==n.bridgeLastPostedMuted||x-n.bridgeLastPostedAt>=n.bridgeMaxPostIntervalMs)&&(n.bridgeLastPostedFrame=g,n.bridgeLastPostedPlaying=n.isPlaying,n.bridgeLastPostedMuted=n.bridgeMuted,n.bridgeLastPostedAt=x,ge({source:"hf-preview",type:"state",frame:g,isPlaying:n.isPlaying,muted:n.bridgeMuted,playbackRate:n.playbackRate}))},je=()=>{b(),F(),N();let d=y();if(d){let x=p(d.getAttribute("data-width")),w=p(d.getAttribute("data-height")),E=x?parseInt(x,10):0,_=w?parseInt(w,10):0;E>0&&_>0&&ge({source:"hf-preview",type:"stage-size",width:E,height:_})}Q();let g=gi({canonicalFps:n.canonicalFps,maxTimelineDurationSeconds:n.maxTimelineDurationSeconds});window.__clipManifest=g,ge(g),P()},et=(d,g=0)=>{for(let x of n.deterministicAdapters){try{d==="discover"&&x.discover(),d==="pause"&&x.pause(),d==="play"&&x.play&&x.play()}catch{}if(d==="discover")try{x.seek({time:g})}catch{}}};if(T)In();else{let d={injectedStyles:n.injectedCompStyles,injectedScripts:n.injectedCompScripts,parseDimensionPx:p,onDiagnostic:({code:g,details:x})=>{ge({source:"hf-preview",type:"diagnostic",code:g,details:x})}};Kr(d).then(()=>Vr(d)).finally(()=>{T=!0,et("discover",n.currentTime),Qt(),j(),In(),je(),Te(!0)})}let Mt=ci({postMessage:d=>ge(d)});Mt.installPickerApi();let Kn=d=>{let g=Number(d);!Number.isFinite(g)||g<=0?n.playbackRate=1:n.playbackRate=Math.max(.1,Math.min(5,g)),n.capturedTimeline&&typeof n.capturedTimeline.timeScale=="function"&&n.capturedTimeline.timeScale(n.playbackRate);let x=document.querySelectorAll("video, audio");for(let w of x)if(w instanceof HTMLMediaElement)try{w.playbackRate=n.playbackRate}catch{}},fe=fi({getTimeline:()=>n.capturedTimeline,setTimeline:d=>{n.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>n.isPlaying,setIsPlaying:d=>{n.isPlaying=d},getPlaybackRate:()=>n.playbackRate,setPlaybackRate:Kn,getCanonicalFps:()=>n.canonicalFps,onSyncMedia:(d,g)=>{n.currentTime=Math.max(0,Number(d)||0),n.isPlaying=g,Vn()},onStatePost:Te,onDeterministicSeek:d=>{for(let g of n.deterministicAdapters)try{g.seek({time:Number(d)||0})}catch{}},onDeterministicPause:()=>et("pause"),onDeterministicPlay:()=>et("play"),onRenderFrameSeek:()=>{},onShowNativeVideos:()=>{},getSafeDuration:()=>xe(n.capturedTimeline,0)});window.__player=a(fe),window.__playerReady=!0,window.__renderReady=!0,Xn(ge),nt("composition_loaded",{duration:fe.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),n.controlBridgeHandler=Zn({onPlay:()=>{fe.play(),nt("composition_played",{time:fe.getTime()})},onPause:()=>{fe.pause(),nt("composition_paused",{time:fe.getTime()})},onSeek:(d,g)=>{let x=Math.max(0,d)/n.canonicalFps;fe.seek(x),nt("composition_seeked",{time:x})},onSetMuted:d=>{n.bridgeMuted=d;let g=d||n.mediaOutputMuted,x=document.querySelectorAll("video, audio");for(let w of x)w instanceof HTMLMediaElement&&(w.muted=g)},onSetMediaOutputMuted:d=>{n.mediaOutputMuted=d;let g=d||n.bridgeMuted,x=document.querySelectorAll("video, audio");for(let w of x)w instanceof HTMLMediaElement&&(w.muted=g)},onSetPlaybackRate:d=>Kn(d),onEnablePickMode:()=>Mt.enablePickMode(),onDisablePickMode:()=>Mt.disablePickMode()}),Q(),n.capturedTimeline&&(fe._timeline=n.capturedTimeline),T&&setTimeout(()=>{let d=n.capturedTimeline;Q()&&n.capturedTimeline!==d&&(fe._timeline=n.capturedTimeline),et("discover",n.currentTime),je(),Te(!0)},0),n.deterministicAdapters=[li(),ei({resolveStartSeconds:d=>B(d,0)}),ni(),oi(),si(),ti({getTimeline:()=>n.capturedTimeline})],I(),et("discover"),Qt(),n.timelinePollIntervalId&&clearInterval(n.timelinePollIntervalId);let Yt=0,kt=null,Jn=0,Zt=!1,Ge=0,Qn=()=>{Jn=Date.now(),Zt=!1,Ge=0};n.timelinePollIntervalId=setInterval(()=>{Yt+=1;let g=n.isPlaying&&n.capturedTimeline!=null&&Math.max(0,n.currentTime||0)<A?!1:Q();if(n.capturedTimeline&&!fe._timeline&&(fe._timeline=n.capturedTimeline),(g||Yt%20===0)&&je(),Yt%10===0&&Qt(),k(),n.isPlaying&&n.capturedTimeline){let x=Math.max(0,n.currentTime||0),w=kt,E=xe(n.capturedTimeline,0);if(E>0&&x>=E){fe.pause(),fe.seek(E),kt=E,Ge=0,Te(!0);return}if(w!=null&&w>=m&&x<=h?Ge+=1:Ge=0,!Zt&&Ge>=C&&Date.now()-Jn>M){let le=R();Ne(le,"loop_guard")&&(Zt=!0,Ge=0)}kt=Math.max(0,n.currentTime||0)}else kt=Math.max(0,n.currentTime||0);n.isPlaying&&Vn(),Te(!1)},50),je(),Te(!0);let Co=fe.seek;fe.seek=d=>{Qn(),Co(d)};let Mo=fe.renderSeek;fe.renderSeek=d=>{Qn(),Mo(d)};let Xt=()=>{if(!n.tornDown){n.tornDown=!0,n.timelinePollIntervalId&&(clearInterval(n.timelinePollIntervalId),n.timelinePollIntervalId=null),ce!=null&&(window.clearTimeout(ce),ce=null),s!=null&&(window.cancelAnimationFrame(s),s=null),wo(),n.controlBridgeHandler&&(window.removeEventListener("message",n.controlBridgeHandler),n.controlBridgeHandler=null),t&&(window.removeEventListener("error",t),t=null),i&&(window.removeEventListener("unhandledrejection",i),i=null),n.beforeUnloadHandler&&(window.removeEventListener("beforeunload",n.beforeUnloadHandler),n.beforeUnloadHandler=null),Mt.disablePickMode();for(let d of n.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch{}n.deterministicAdapters=[];for(let d of r.splice(0))try{d()}catch{}for(let d of n.injectedCompStyles)try{d.remove()}catch{}n.injectedCompStyles=[];for(let d of n.injectedCompScripts)try{d.remove()}catch{}n.injectedCompScripts=[],n.capturedTimeline=null,e.__hfRuntimeTeardown===Xt&&(e.__hfRuntimeTeardown=null)}};e.__hfRuntimeTeardown=Xt,n.beforeUnloadHandler=Xt,window.addEventListener("beforeunload",n.beforeUnloadHandler)}var Zr=["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"],Wn=[[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 vl(n){if(n<=255)return Zr[n];let e=0,t=Wn.length-1;for(;e<=t;){let i=e+t>>1,r=Wn[i];if(n<r[0]){t=i-1;continue}if(n>r[1]){e=i+1;continue}return r[2]}return"L"}function Bl(n){let e=n.length;if(e===0)return null;let t=new Array(e),i=!1;for(let a=0;a<e;){let l=n.charCodeAt(a),f=l,m=1;if(l>=55296&&l<=56319&&a+1<e){let M=n.charCodeAt(a+1);M>=56320&&M<=57343&&(f=(l-55296<<10)+(M-56320)+65536,m=2)}let h=vl(f);(h==="R"||h==="AL"||h==="AN")&&(i=!0);for(let M=0;M<m;M++)t[a+M]=h;a+=m}if(!i)return null;let r=0;for(let a=0;a<e;a++){let l=t[a];if(l==="L"){r=0;break}if(l==="R"||l==="AL"){r=1;break}}let o=new Int8Array(e);for(let a=0;a<e;a++)o[a]=r;let s=r&1?"R":"L",c=s,u=c;for(let a=0;a<e;a++)t[a]==="NSM"?t[a]=u:u=t[a];u=c;for(let a=0;a<e;a++){let l=t[a];l==="EN"?t[a]=u==="AL"?"AN":"EN":(l==="R"||l==="L"||l==="AL")&&(u=l)}for(let a=0;a<e;a++)t[a]==="AL"&&(t[a]="R");for(let a=1;a<e-1;a++)t[a]==="ES"&&t[a-1]==="EN"&&t[a+1]==="EN"&&(t[a]="EN"),t[a]==="CS"&&(t[a-1]==="EN"||t[a-1]==="AN")&&t[a+1]===t[a-1]&&(t[a]=t[a-1]);for(let a=0;a<e;a++){if(t[a]!=="EN")continue;let l;for(l=a-1;l>=0&&t[l]==="ET";l--)t[l]="EN";for(l=a+1;l<e&&t[l]==="ET";l++)t[l]="EN"}for(let a=0;a<e;a++){let l=t[a];(l==="WS"||l==="ES"||l==="ET"||l==="CS")&&(t[a]="ON")}u=c;for(let a=0;a<e;a++){let l=t[a];l==="EN"?t[a]=u==="L"?"L":"EN":(l==="R"||l==="L")&&(u=l)}for(let a=0;a<e;a++){if(t[a]!=="ON")continue;let l=a+1;for(;l<e&&t[l]==="ON";)l++;let f=a>0?t[a-1]:c,m=l<e?t[l]:c,h=f!=="L"?"R":"L";if(h===(m!=="L"?"R":"L"))for(let C=a;C<l;C++)t[C]=h;a=l-1}for(let a=0;a<e;a++)t[a]==="ON"&&(t[a]=s);for(let a=0;a<e;a++){let l=t[a];(o[a]&1)===0?l==="R"?o[a]++:(l==="AN"||l==="EN")&&(o[a]+=2):(l==="L"||l==="AN"||l==="EN")&&o[a]++}return o}function Xr(n,e){let t=Bl(n);if(t===null)return null;let i=new Int8Array(e.length);for(let r=0;r<e.length;r++)i[r]=t[e[r]];return i}var _l=/[ \\t\\n\\r\\f]+/g,Ol=/[\\t\\n\\r\\f]| {2,}|^ | $/;function Pl(n){let e=n??"normal";return e==="pre-wrap"?{mode:e,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:e,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Il(n){if(!Ol.test(n))return n;let e=n.replace(_l," ");return e.charCodeAt(0)===32&&(e=e.slice(1)),e.length>0&&e.charCodeAt(e.length-1)===32&&(e=e.slice(0,-1)),e}function Wl(n){return/[\\r\\f]/.test(n)?n.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):n.replace(/\\r\\n/g,`\n`)}var Hn=null,Hl;function Ul(){return Hn===null&&(Hn=new Intl.Segmenter(Hl,{granularity:"word"})),Hn}var ql=/\\p{Script=Arabic}/u,Gt=/\\p{M}/u,lo=/\\p{Nd}/u;function eo(n){return ql.test(n)}function to(n){return n>=19968&&n<=40959||n>=13312&&n<=19903||n>=131072&&n<=173791||n>=173824&&n<=177983||n>=177984&&n<=178207||n>=178208&&n<=183983||n>=183984&&n<=191471||n>=191472&&n<=192093||n>=194560&&n<=195103||n>=196608&&n<=201551||n>=201552&&n<=205743||n>=205744&&n<=210041||n>=63744&&n<=64255||n>=12288&&n<=12351||n>=12352&&n<=12447||n>=12448&&n<=12543||n>=44032&&n<=55215||n>=65280&&n<=65519}function Me(n){for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);if(!(t<12288)){if(t>=55296&&t<=56319&&e+1<n.length){let i=n.charCodeAt(e+1);if(i>=56320&&i<=57343){let r=(t-55296<<10)+(i-56320)+65536;if(to(r))return!0;e++;continue}}if(to(t))return!0}}return!1}function zl(n){let e=Kt(n);return e!==null&&(Vt.has(e)||Oe.has(e))}var jl=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function Gl(n){return Me(n)}function $l(n){let e=Kt(n);return e!==null&&jl.has(e)}function $t(n){return!zl(n)&&!$l(n)}var Vt=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"]),wt=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),qn=new Set(["\'","\\u2019"]),Oe=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),Vl=new Set([":",".","\\u060C","\\u061B"]),Kl=new Set(["\\u104F"]),Jl=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function Ql(n){if(zn(n))return!0;let e=!1;for(let t of n){if(Oe.has(t)){e=!0;continue}if(!(e&&Gt.test(t)))return!1}return e}function Yl(n){for(let e of n)if(!Vt.has(e)&&!Oe.has(e))return!1;return n.length>0}function Zl(n){if(zn(n))return!0;for(let e of n)if(!wt.has(e)&&!qn.has(e)&&!Gt.test(e))return!1;return n.length>0}function zn(n){let e=!1;for(let t of n)if(!(t==="\\\\"||Gt.test(t))){if(wt.has(t)||Oe.has(t)||qn.has(t)){e=!0;continue}return!1}return e}function ao(n,e){let t=e-1;if(t<=0)return Math.max(t,0);let i=n.charCodeAt(t);if(i<56320||i>57343)return t;let r=t-1;if(r<0)return t;let o=n.charCodeAt(r);return o>=55296&&o<=56319?r:t}function Kt(n){if(n.length===0)return null;let e=ao(n,n.length);return n.slice(e)}function Xl(n){let e=Array.from(n),t=e.length;for(;t>0;){let i=e[t-1];if(Gt.test(i)){t--;continue}if(wt.has(i)||qn.has(i)){t--;continue}break}return t<=0||t===e.length?null:{head:e.slice(0,t).join(""),tail:e.slice(t).join("")}}function ea(n,e,t){return t==="text"&&!e&&n.length===1&&n!=="-"&&n!=="\\u2014"?n:null}function no(n,e,t,i){let r=e[i],o=n[i];if(r==null)return o;let s=t[i];if(o.length===s)return o;let c=r.repeat(s);return n[i]=c,c}function io(n,e){return n&&e!==null&&Vl.has(e)}function ta(n){let e=Kt(n);return e!==null&&Kl.has(e)}function na(n){if(n.length<2||n[0]!==" ")return null;let e=n.slice(1);return/^\\p{M}+$/u.test(e)?{space:" ",marks:e}:null}function Jt(n){let e=n.length;for(;e>0;){let t=ao(n,e),i=n.slice(t,e);if(Jl.has(i))return!0;if(!Oe.has(i))return!1;e=t}return!1}function ia(n,e){if(e.preserveOrdinarySpaces||e.preserveHardBreaks){if(n===" ")return"preserved-space";if(n===" ")return"tab";if(e.preserveHardBreaks&&n===`\n`)return"hard-break"}return n===" "?"space":n==="\\xA0"||n==="\\u202F"||n==="\\u2060"||n==="\\uFEFF"?"glue":n==="\\u200B"?"zero-width-break":n==="\\xAD"?"soft-hyphen":"text"}var ra=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function be(n){return n.length===1?n[0]:n.join("")}function oa(n,e){let t=[];for(let i=n.length-1;i>=0;i--)t.push(n[i]);return t.push(e),be(t)}function sa(n,e,t,i){if(!ra.test(n))return[{text:n,isWordLike:e,kind:"text",start:t}];let r=[],o=null,s=[],c=t,u=!1,a=0;for(let l of n){let f=ia(l,i),m=f==="text"&&e;if(o!==null&&f===o&&m===u){s.push(l),a+=l.length;continue}o!==null&&r.push({text:be(s),isWordLike:u,kind:o,start:c}),o=f,s=[l],c=t+a,u=m,a+=l.length}return o!==null&&r.push({text:be(s),isWordLike:u,kind:o,start:c}),r}function Un(n){return n==="space"||n==="preserved-space"||n==="zero-width-break"||n==="hard-break"}var la=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function aa(n,e){let t=n.texts[e];return t.startsWith("www.")?!0:la.test(t)&&e+1<n.len&&n.kinds[e+1]==="text"&&n.texts[e+1]==="//"}function ua(n){return n.includes("?")&&(n.includes("://")||n.startsWith("www."))}function ca(n){let e=n.texts.slice(),t=n.isWordLike.slice(),i=n.kinds.slice(),r=n.starts.slice();for(let s=0;s<n.len;s++){if(i[s]!=="text"||!aa(n,s))continue;let c=[e[s]],u=s+1;for(;u<n.len&&!Un(i[u]);){c.push(e[u]),t[s]=!0;let a=e[u].includes("?");if(i[u]="text",e[u]="",u++,a)break}e[s]=be(c)}let o=0;for(let s=0;s<e.length;s++){let c=e[s];c.length!==0&&(o!==s&&(e[o]=c,t[o]=t[s],i[o]=i[s],r[o]=r[s]),o++)}return e.length=o,t.length=o,i.length=o,r.length=o,{len:o,texts:e,isWordLike:t,kinds:i,starts:r}}function da(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o];if(e.push(s),t.push(n.isWordLike[o]),i.push(n.kinds[o]),r.push(n.starts[o]),!ua(s))continue;let c=o+1;if(c>=n.len||Un(n.kinds[c]))continue;let u=[],a=n.starts[c],l=c;for(;l<n.len&&!Un(n.kinds[l]);)u.push(n.texts[l]),l++;u.length>0&&(e.push(be(u)),t.push(!0),i.push("text"),r.push(a),o=l-1)}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}var fa=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),ro=/^[A-Za-z0-9_]+[,:;]*$/,oo=/[,:;]+$/;function uo(n){for(let e of n)if(lo.test(e))return!0;return!1}function Nt(n){if(n.length===0)return!1;for(let e of n)if(!(lo.test(e)||fa.has(e)))return!1;return!0}function ma(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o],c=n.kinds[o];if(c==="text"&&Nt(s)&&uo(s)){let u=[s],a=o+1;for(;a<n.len&&n.kinds[a]==="text"&&Nt(n.texts[a]);)u.push(n.texts[a]),a++;e.push(be(u)),t.push(!0),i.push("text"),r.push(n.starts[o]),o=a-1;continue}e.push(s),t.push(n.isWordLike[o]),i.push(c),r.push(n.starts[o])}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function pa(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o],c=n.kinds[o],u=n.isWordLike[o];if(c==="text"&&u&&ro.test(s)){let a=[s],l=oo.test(s),f=o+1;for(;l&&f<n.len&&n.kinds[f]==="text"&&n.isWordLike[f]&&ro.test(n.texts[f]);){let m=n.texts[f];a.push(m),l=oo.test(m),f++}e.push(be(a)),t.push(!0),i.push("text"),r.push(n.starts[o]),o=f-1;continue}e.push(s),t.push(u),i.push(c),r.push(n.starts[o])}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function ha(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o];if(n.kinds[o]==="text"&&s.includes("-")){let c=s.split("-"),u=c.length>1;for(let a=0;a<c.length;a++){let l=c[a];if(!u)break;(l.length===0||!uo(l)||!Nt(l))&&(u=!1)}if(u){let a=0;for(let l=0;l<c.length;l++){let f=c[l],m=l<c.length-1?`${f}-`:f;e.push(m),t.push(!0),i.push("text"),r.push(n.starts[o]+a),a+=m.length}continue}}e.push(s),t.push(n.isWordLike[o]),i.push(n.kinds[o]),r.push(n.starts[o])}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function xa(n){let e=[],t=[],i=[],r=[],o=0;for(;o<n.len;){let s=[n.texts[o]],c=n.isWordLike[o],u=n.kinds[o],a=n.starts[o];if(u==="glue"){let l=[s[0]],f=a;for(o++;o<n.len&&n.kinds[o]==="glue";)l.push(n.texts[o]),o++;let m=be(l);if(o<n.len&&n.kinds[o]==="text")s[0]=m,s.push(n.texts[o]),c=n.isWordLike[o],u="text",a=f,o++;else{e.push(m),t.push(!1),i.push("glue"),r.push(f);continue}}else o++;if(u==="text")for(;o<n.len&&n.kinds[o]==="glue";){let l=[];for(;o<n.len&&n.kinds[o]==="glue";)l.push(n.texts[o]),o++;let f=be(l);if(o<n.len&&n.kinds[o]==="text"){s.push(f,n.texts[o]),c=c||n.isWordLike[o],o++;continue}s.push(f)}e.push(be(s)),t.push(c),i.push(u),r.push(a)}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function ga(n){let e=n.texts.slice(),t=n.isWordLike.slice(),i=n.kinds.slice(),r=n.starts.slice();for(let o=0;o<e.length-1;o++){if(i[o]!=="text"||i[o+1]!=="text"||!Me(e[o])||!Me(e[o+1]))continue;let s=Xl(e[o]);s!==null&&(e[o]=s.head,e[o+1]=s.tail+e[o+1],r[o+1]=r[o]+s.head.length)}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function so(n,e,t){let i=Ul(),r=0,o=[],s=[],c=[],u=[],a=[],l=[],f=[],m=[],h=[],M=[],C=[],A=[];for(let p of i.segment(n))for(let y of sa(p.segment,p.isWordLike??!1,p.index,t)){let X=function(){l[T]!==null&&(s[T]=[no(o,l,f,T)],l[T]=null),s[T].push(y.text),c[T]=c[T]||y.isWordLike,m[T]=m[T]||N,h[T]=h[T]||B,M[T]=H,C[T]=Z,A[T]=io(h[T],W)},F=y.kind==="text",b=ea(y.text,y.isWordLike,y.kind),N=Me(y.text),B=eo(y.text),W=Kt(y.text),H=Jt(y.text),Z=ta(y.text),T=r-1;e.carryCJKAfterClosingQuote&&F&&r>0&&u[T]==="text"&&N&&m[T]&&M[T]||F&&r>0&&u[T]==="text"&&Yl(y.text)&&m[T]||F&&r>0&&u[T]==="text"&&C[T]?X():F&&r>0&&u[T]==="text"&&y.isWordLike&&B&&A[T]?(X(),c[T]=!0):b!==null&&r>0&&u[T]==="text"&&l[T]===b?f[T]=(f[T]??1)+1:F&&!y.isWordLike&&r>0&&u[T]==="text"&&(Ql(y.text)||y.text==="-"&&c[T])?X():(o[r]=y.text,s[r]=[y.text],c[r]=y.isWordLike,u[r]=y.kind,a[r]=y.start,l[r]=b,f[r]=b===null?0:1,m[r]=N,h[r]=B,M[r]=H,C[r]=Z,A[r]=io(B,W),r++)}for(let p=0;p<r;p++){if(l[p]!==null){o[p]=no(o,l,f,p);continue}o[p]=be(s[p])}for(let p=1;p<r;p++)u[p]==="text"&&!c[p]&&zn(o[p])&&u[p-1]==="text"&&(o[p-1]+=o[p],c[p-1]=c[p-1]||c[p],o[p]="");let z=Array.from({length:r},()=>null),O=-1;for(let p=r-1;p>=0;p--){let y=o[p];if(y.length!==0){if(u[p]==="text"&&!c[p]&&Zl(y)&&O>=0&&u[O]==="text"){let F=z[O]??[];F.push(y),z[O]=F,a[O]=a[p],o[p]="";continue}O=p}}for(let p=0;p<r;p++){let y=z[p];y!=null&&(o[p]=oa(y,o[p]))}let D=0;for(let p=0;p<r;p++){let y=o[p];y.length!==0&&(D!==p&&(o[D]=y,c[D]=c[p],u[D]=u[p],a[D]=a[p]),D++)}o.length=D,c.length=D,u.length=D,a.length=D;let Y=xa({len:D,texts:o,isWordLike:c,kinds:u,starts:a}),S=ga(pa(ha(ma(da(ca(Y))))));for(let p=0;p<S.len-1;p++){let y=na(S.texts[p]);y!==null&&(S.kinds[p]!=="space"&&S.kinds[p]!=="preserved-space"||S.kinds[p+1]!=="text"||!eo(S.texts[p+1])||(S.texts[p]=y.space,S.isWordLike[p]=!1,S.kinds[p]=S.kinds[p]==="preserved-space"?"preserved-space":"space",S.texts[p+1]=y.marks+S.texts[p+1],S.starts[p+1]=S.starts[p]+y.space.length))}return S}function ya(n,e){if(n.len===0)return[];if(!e.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:n.len,consumedEndSegmentIndex:n.len}];let t=[],i=0;for(let r=0;r<n.len;r++)n.kinds[r]==="hard-break"&&(t.push({startSegmentIndex:i,endSegmentIndex:r,consumedEndSegmentIndex:r+1}),i=r+1);return i<n.len&&t.push({startSegmentIndex:i,endSegmentIndex:n.len,consumedEndSegmentIndex:n.len}),t}function Sa(n){if(n.len<=1)return n;let e=[],t=[],i=[],r=[],o=null,s=!1,c=0,u=!1,a=!1;function l(){o!==null&&(e.push(be(o)),t.push(s),i.push("text"),r.push(c),o=null)}for(let f=0;f<n.len;f++){let m=n.texts[f],h=n.kinds[f],M=n.isWordLike[f],C=n.starts[f];if(h==="text"){let A=Gl(m),z=$t(m);if(o!==null&&u&&a){o.push(m),s=s||M,u=u||A,a=z;continue}l(),o=[m],s=M,c=C,u=A,a=z;continue}l(),e.push(m),t.push(M),i.push(h),r.push(C)}return l(),{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function co(n,e,t="normal",i="normal"){let r=Pl(t),o=r.mode==="pre-wrap"?Wl(n):Il(n);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let s=i==="keep-all"?Sa(so(o,e,r)):so(o,e,r);return{normalized:o,chunks:ya(s,r),...s}}var Ye=null,fo=new Map,Ze=null,Aa=96,Ea=/\\p{Emoji_Presentation}/u,Fa=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,jn=null,mo=new Map;function Gn(){if(Ye!==null)return Ye;if(typeof OffscreenCanvas<"u")return Ye=new OffscreenCanvas(1,1).getContext("2d"),Ye;if(typeof document<"u")return Ye=document.createElement("canvas").getContext("2d"),Ye;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function ba(n){let e=fo.get(n);return e||(e=new Map,fo.set(n,e)),e}function Le(n,e){let t=e.get(n);return t===void 0&&(t={width:Gn().measureText(n).width,containsCJK:Me(n)},e.set(n,t)),t}function Xe(){if(Ze!==null)return Ze;if(typeof navigator>"u")return Ze={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ze;let n=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&n.includes("Safari/")&&!n.includes("Chrome/")&&!n.includes("Chromium/")&&!n.includes("CriOS/")&&!n.includes("FxiOS/")&&!n.includes("EdgiOS/"),i=n.includes("Chrome/")||n.includes("Chromium/")||n.includes("CriOS/")||n.includes("Edg/");return Ze={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:i,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Ze}function Na(n){let e=n.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return e?parseFloat(e[1]):16}function po(){return jn===null&&(jn=new Intl.Segmenter(void 0,{granularity:"grapheme"})),jn}function wa(n){return Ea.test(n)||n.includes("\\uFE0F")}function ho(n){return Fa.test(n)}function Ca(n,e){let t=mo.get(n);if(t!==void 0)return t;let i=Gn();i.font=n;let r=i.measureText("\\u{1F600}").width;if(t=0,r>e+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=n,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\\u{1F600}",document.body.appendChild(o);let s=o.getBoundingClientRect().width;document.body.removeChild(o),r-s>.5&&(t=r-s)}return mo.set(n,t),t}function Ma(n){let e=0,t=po();for(let i of t.segment(n))wa(i.segment)&&e++;return e}function ka(n,e){return e.emojiCount===void 0&&(e.emojiCount=Ma(n)),e.emojiCount}function Pe(n,e,t){return t===0?e.width:e.width-ka(n,e)*t}function xo(n,e,t,i,r){if(e.breakableFitAdvances!==void 0)return e.breakableFitAdvances;let o=po(),s=[];for(let l of o.segment(n))s.push(l.segment);if(s.length<=1)return e.breakableFitAdvances=null,e.breakableFitAdvances;if(r==="sum-graphemes"){let l=[];for(let f of s){let m=Le(f,t);l.push(Pe(f,m,i))}return e.breakableFitAdvances=l,e.breakableFitAdvances}if(r==="pair-context"||s.length>Aa){let l=[],f=null,m=0;for(let h of s){let M=Le(h,t),C=Pe(h,M,i);if(f===null)l.push(C);else{let A=f+h,z=Le(A,t);l.push(Pe(A,z,i)-m)}f=h,m=C}return e.breakableFitAdvances=l,e.breakableFitAdvances}let c=[],u="",a=0;for(let l of s){u+=l;let f=Le(u,t),m=Pe(u,f,i);c.push(m-a),a=m}return e.breakableFitAdvances=c,e.breakableFitAdvances}function go(n,e){let t=Gn();t.font=n;let i=ba(n),r=Na(n),o=e?Ca(n,r):0;return{cache:i,fontSize:r,emojiCorrection:o}}function Da(n,e){for(;e<n.widths.length;){let t=n.kinds[e];if(t!=="space"&&t!=="zero-width-break"&&t!=="soft-hyphen")break;e++}return e}function La(n,e){if(e<=0)return 0;let t=n%e;return Math.abs(t)<=1e-6?e:e-t}function Ta(n,e,t,i,r){let o=0,s=e;for(;o<n.length;){let c=s+n[o];if((o+1<n.length?c+r:c)>t+i)break;s=c,o++}return{fitCount:o,fittedWidth:s}}function yo(n,e){return n.simpleLineWalkFastPath?So(n,e):Ao(n,e)}function So(n,e,t){let{widths:i,kinds:r,breakableFitAdvances:o}=n;if(i.length===0)return 0;let c=Xe().lineFitEpsilon,u=e+c,a=0,l=0,f=!1,m=0,h=0,M=0,C=0,A=-1,z=0;function O(){A=-1,z=0}function D(b=M,N=C,B=l){a++,t?.({startSegmentIndex:m,startGraphemeIndex:h,endSegmentIndex:b,endGraphemeIndex:N,width:B}),l=0,f=!1,O()}function Y(b,N){f=!0,m=b,h=0,M=b+1,C=0,l=N}function S(b,N,B){f=!0,m=b,h=N,M=b,C=N+1,l=B}function p(b,N){if(!f){Y(b,N);return}l+=N,M=b+1,C=0}function y(b,N){let B=o[b];for(let W=N;W<B.length;W++){let H=B[W];f?l+H>u?(D(),S(b,W,H)):(l+=H,M=b,C=W+1):S(b,W,H)}f&&M===b&&C===B.length&&(M=b+1,C=0)}let F=0;for(;F<i.length&&!(!f&&(F=Da(n,F),F>=i.length));){let b=i[F],N=r[F],B=N==="space"||N==="preserved-space"||N==="tab"||N==="zero-width-break"||N==="soft-hyphen";if(!f){b>e&&o[F]!==null?y(F,0):Y(F,b),B&&(A=F+1,z=l-b),F++;continue}if(l+b>u){if(B){p(F,b),D(F+1,0,l-b),F++;continue}if(A>=0){if(M>A||M===A&&C>0){D();continue}D(A,0,z);continue}if(b>e&&o[F]!==null){D(),y(F,0),F++;continue}D();continue}p(F,b),B&&(A=F+1,z=l-b),F++}return f&&D(),a}function Ao(n,e,t){if(n.simpleLineWalkFastPath)return So(n,e,t);let{widths:i,lineEndFitAdvances:r,lineEndPaintAdvances:o,kinds:s,breakableFitAdvances:c,discretionaryHyphenWidth:u,tabStopAdvance:a,chunks:l}=n;if(i.length===0||l.length===0)return 0;let f=Xe(),m=f.lineFitEpsilon,h=e+m,M=0,C=0,A=!1,z=0,O=0,D=0,Y=0,S=-1,p=0,y=0,F=null;function b(){S=-1,p=0,y=0,F=null}function N(U=D,G=Y,v=C){M++,t?.({startSegmentIndex:z,startGraphemeIndex:O,endSegmentIndex:U,endGraphemeIndex:G,width:v}),C=0,A=!1,b()}function B(U,G){A=!0,z=U,O=0,D=U+1,Y=0,C=G}function W(U,G,v){A=!0,z=U,O=G,D=U,Y=G+1,C=v}function H(U,G){if(!A){B(U,G);return}C+=G,D=U+1,Y=0}function Z(U,G,v,J){if(!G)return;let Ee=U==="tab"?0:r[v],xe=U==="tab"?J:o[v];S=v+1,p=C-J+Ee,y=C-J+xe,F=U}function T(U,G){let v=c[U];for(let J=G;J<v.length;J++){let Ee=v[J];A?C+Ee>h?(N(),W(U,J,Ee)):(C+=Ee,D=U,Y=J+1):W(U,J,Ee)}A&&D===U&&Y===v.length&&(D=U+1,Y=0)}function X(U){if(F!=="soft-hyphen")return!1;let G=c[U];if(G==null)return!1;let{fitCount:v,fittedWidth:J}=Ta(G,C,e,m,u);return v===0?!1:(C=J,D=U,Y=v,b(),v===G.length?(D=U+1,Y=0,!0):(N(U,v,J+u),T(U,v),!0))}function ee(U){M++,t?.({startSegmentIndex:U.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:U.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),b()}for(let U=0;U<l.length;U++){let G=l[U];if(G.startSegmentIndex===G.endSegmentIndex){ee(G);continue}A=!1,C=0,z=G.startSegmentIndex,O=0,D=G.startSegmentIndex,Y=0,b();let v=G.startSegmentIndex;for(;v<G.endSegmentIndex;){let J=s[v],Ee=J==="space"||J==="preserved-space"||J==="tab"||J==="zero-width-break"||J==="soft-hyphen",xe=J==="tab"?La(C,a):i[v];if(J==="soft-hyphen"){A&&(D=v+1,Y=0,S=v+1,p=C+u,y=C+u,F=J),v++;continue}if(!A){xe>e&&c[v]!==null?T(v,0):B(v,xe),Z(J,Ee,v,xe),v++;continue}if(C+xe>h){let k=C+(J==="tab"?0:r[v]),L=C+(J==="tab"?xe:o[v]);if(F==="soft-hyphen"&&f.preferEarlySoftHyphenBreak&&p<=h){N(S,0,y);continue}if(F==="soft-hyphen"&&X(v)){v++;continue}if(Ee&&k<=h){H(v,xe),N(v+1,0,L),v++;continue}if(S>=0&&p<=h){if(D>S||D===S&&Y>0){N();continue}let Q=S;N(Q,0,y),v=Q;continue}if(xe>e&&c[v]!==null){N(),T(v,0),v++;continue}N();continue}H(v,xe),Z(J,Ee,v,xe),v++}if(A){let J=S===G.consumedEndSegmentIndex?y:C;N(G.consumedEndSegmentIndex,0,J)}}return M}var $n=null;function Ra(){return $n===null&&($n=new Intl.Segmenter(void 0,{granularity:"grapheme"})),$n}function va(n){return n?{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 Ba(n,e){let t=[],i=[],r=0,o=!1,s=!1,c=!1;function u(){i.length!==0&&(t.push({text:i.length===1?i[0]:i.join(""),start:r}),i=[],o=!1,s=!1,c=!1)}function a(f,m,h){i=[f],r=m,o=h,s=Jt(f),c=wt.has(f)}function l(f,m){i.push(f),o=o||m;let h=Jt(f);f.length===1&&Oe.has(f)?s=s||h:s=h,c=!1}for(let f of Ra().segment(n)){let m=f.segment,h=Me(m);if(i.length===0){a(m,f.index,h);continue}if(c||Vt.has(m)||Oe.has(m)||e.carryCJKAfterClosingQuote&&h&&s){l(m,h);continue}if(!o&&!h){l(m,h);continue}u(),a(m,f.index,h)}return u(),t}function _a(n){if(n.length<=1)return n;let e=[],t=[n[0].text],i=n[0].start,r=Me(n[0].text),o=$t(n[0].text);function s(){e.push({text:t.length===1?t[0]:t.join(""),start:i})}for(let c=1;c<n.length;c++){let u=n[c],a=Me(u.text),l=$t(u.text);if(r&&o){t.push(u.text),r=r||a,o=l;continue}s(),t=[u.text],i=u.start,r=a,o=l}return s(),e}function Oa(n,e,t,i){let r=Xe(),{cache:o,emojiCorrection:s}=go(e,ho(n.normalized)),c=Pe("-",Le("-",o),s),a=Pe(" ",Le(" ",o),s)*8;if(n.len===0)return va(t);let l=[],f=[],m=[],h=[],M=n.chunks.length<=1,C=t?[]:null,A=[],z=t?[]:null,O=Array.from({length:n.len});function D(y,F,b,N,B,W,H){B!=="text"&&B!=="space"&&B!=="zero-width-break"&&(M=!1),l.push(F),f.push(b),m.push(N),h.push(B),C?.push(W),A.push(H),z!==null&&z.push(y)}function Y(y,F,b,N,B){let W=Le(y,o),H=Pe(y,W,s),Z=F==="space"||F==="preserved-space"||F==="zero-width-break"?0:H,T=F==="space"||F==="zero-width-break"?0:H;if(B&&N&&y.length>1){let X="sum-graphemes";Nt(y)?X="pair-context":r.preferPrefixWidthsForBreakableRuns&&(X="segment-prefixes");let ee=xo(y,W,o,s,X);D(y,H,Z,T,F,b,ee);return}D(y,H,Z,T,F,b,null)}for(let y=0;y<n.len;y++){O[y]=l.length;let F=n.texts[y],b=n.isWordLike[y],N=n.kinds[y],B=n.starts[y];if(N==="soft-hyphen"){D(F,0,c,c,N,B,null);continue}if(N==="hard-break"){D(F,0,0,0,N,B,null);continue}if(N==="tab"){D(F,0,0,0,N,B,null);continue}let W=Le(F,o);if(N==="text"&&W.containsCJK){let H=Ba(F,r),Z=i==="keep-all"?_a(H):H;for(let T=0;T<Z.length;T++){let X=Z[T];Y(X.text,"text",B+X.start,b,i==="keep-all"||!Me(X.text))}continue}Y(F,N,B,b,!0)}let S=Pa(n.chunks,O,l.length),p=C===null?null:Xr(n.normalized,C);return z!==null?{widths:l,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:h,simpleLineWalkFastPath:M,segLevels:p,breakableFitAdvances:A,discretionaryHyphenWidth:c,tabStopAdvance:a,chunks:S,segments:z}:{widths:l,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:h,simpleLineWalkFastPath:M,segLevels:p,breakableFitAdvances:A,discretionaryHyphenWidth:c,tabStopAdvance:a,chunks:S}}function Pa(n,e,t){let i=[];for(let r=0;r<n.length;r++){let o=n[r],s=o.startSegmentIndex<e.length?e[o.startSegmentIndex]:t,c=o.endSegmentIndex<e.length?e[o.endSegmentIndex]:t,u=o.consumedEndSegmentIndex<e.length?e[o.consumedEndSegmentIndex]:t;i.push({startSegmentIndex:s,endSegmentIndex:c,consumedEndSegmentIndex:u})}return i}function Ia(n,e,t,i){let r=i?.wordBreak??"normal",o=co(n,Xe(),i?.whiteSpace,r);return Oa(o,e,t,r)}function Eo(n,e,t){return Ia(n,e,!1,t)}function Fo(n,e,t){let i=yo(n,e);return{lineCount:i,height:i*t}}var Wa={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function bo(n,e){let t={...Wa,...e},i=1.2;for(let r=t.baseFontSize;r>=t.minFontSize;r-=t.step){let o=`${t.fontWeight} ${r}px ${t.fontFamily}`,s=Eo(n,o),{lineCount:c}=Fo(s,t.maxWidth,r*i);if(c<=1)return{fontSize:r,fits:!0}}return{fontSize:t.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};window.__hyperframes={fitTextFontSize:bo,getVariables:Gr};function No(){let n=window;n.__hyperframeRuntimeBootstrapped||(n.__hyperframeRuntimeBootstrapped=!0,Yr())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",No,{once:!0}):No();})();\n';
|
|
6413
6542
|
}
|
|
6414
6543
|
});
|
|
6415
6544
|
|
|
@@ -9540,6 +9669,132 @@ var init_text = __esm({
|
|
|
9540
9669
|
}
|
|
9541
9670
|
});
|
|
9542
9671
|
|
|
9672
|
+
// ../core/src/runtime/getVariables.ts
|
|
9673
|
+
function getVariables() {
|
|
9674
|
+
if (typeof document === "undefined") return {};
|
|
9675
|
+
const declaredDefaults = readDeclaredDefaults(document.documentElement);
|
|
9676
|
+
const overrides = readOverrides();
|
|
9677
|
+
return { ...declaredDefaults, ...overrides };
|
|
9678
|
+
}
|
|
9679
|
+
function readDeclaredDefaults(root) {
|
|
9680
|
+
if (!root) return {};
|
|
9681
|
+
const raw = root.getAttribute("data-composition-variables");
|
|
9682
|
+
if (!raw) return {};
|
|
9683
|
+
let parsed;
|
|
9684
|
+
try {
|
|
9685
|
+
parsed = JSON.parse(raw);
|
|
9686
|
+
} catch {
|
|
9687
|
+
return {};
|
|
9688
|
+
}
|
|
9689
|
+
if (!Array.isArray(parsed)) return {};
|
|
9690
|
+
const out = {};
|
|
9691
|
+
for (const entry of parsed) {
|
|
9692
|
+
if (!entry || typeof entry !== "object") continue;
|
|
9693
|
+
const e2 = entry;
|
|
9694
|
+
if (typeof e2.id !== "string" || !("default" in e2)) continue;
|
|
9695
|
+
out[e2.id] = e2.default;
|
|
9696
|
+
}
|
|
9697
|
+
return out;
|
|
9698
|
+
}
|
|
9699
|
+
function readOverrides() {
|
|
9700
|
+
if (typeof window === "undefined") return {};
|
|
9701
|
+
const raw = window.__hfVariables;
|
|
9702
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return {};
|
|
9703
|
+
return raw;
|
|
9704
|
+
}
|
|
9705
|
+
var init_getVariables = __esm({
|
|
9706
|
+
"../core/src/runtime/getVariables.ts"() {
|
|
9707
|
+
"use strict";
|
|
9708
|
+
}
|
|
9709
|
+
});
|
|
9710
|
+
|
|
9711
|
+
// ../core/src/runtime/validateVariables.ts
|
|
9712
|
+
function validateVariables(values, declarations) {
|
|
9713
|
+
const decls = /* @__PURE__ */ new Map();
|
|
9714
|
+
for (const decl of declarations) decls.set(decl.id, decl);
|
|
9715
|
+
const issues = [];
|
|
9716
|
+
for (const [id, value] of Object.entries(values)) {
|
|
9717
|
+
const decl = decls.get(id);
|
|
9718
|
+
if (!decl) {
|
|
9719
|
+
issues.push({ kind: "undeclared", variableId: id });
|
|
9720
|
+
continue;
|
|
9721
|
+
}
|
|
9722
|
+
const mismatch = checkType(value, decl);
|
|
9723
|
+
if (mismatch) issues.push(mismatch);
|
|
9724
|
+
}
|
|
9725
|
+
return issues;
|
|
9726
|
+
}
|
|
9727
|
+
function checkType(value, decl) {
|
|
9728
|
+
switch (decl.type) {
|
|
9729
|
+
case "string":
|
|
9730
|
+
case "color":
|
|
9731
|
+
if (typeof value !== "string") {
|
|
9732
|
+
return {
|
|
9733
|
+
kind: "type-mismatch",
|
|
9734
|
+
variableId: decl.id,
|
|
9735
|
+
expected: decl.type,
|
|
9736
|
+
actual: jsTypeOf(value)
|
|
9737
|
+
};
|
|
9738
|
+
}
|
|
9739
|
+
return null;
|
|
9740
|
+
case "number":
|
|
9741
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
9742
|
+
return {
|
|
9743
|
+
kind: "type-mismatch",
|
|
9744
|
+
variableId: decl.id,
|
|
9745
|
+
expected: "number",
|
|
9746
|
+
actual: jsTypeOf(value)
|
|
9747
|
+
};
|
|
9748
|
+
}
|
|
9749
|
+
return null;
|
|
9750
|
+
case "boolean":
|
|
9751
|
+
if (typeof value !== "boolean") {
|
|
9752
|
+
return {
|
|
9753
|
+
kind: "type-mismatch",
|
|
9754
|
+
variableId: decl.id,
|
|
9755
|
+
expected: "boolean",
|
|
9756
|
+
actual: jsTypeOf(value)
|
|
9757
|
+
};
|
|
9758
|
+
}
|
|
9759
|
+
return null;
|
|
9760
|
+
case "enum": {
|
|
9761
|
+
if (typeof value !== "string") {
|
|
9762
|
+
return {
|
|
9763
|
+
kind: "type-mismatch",
|
|
9764
|
+
variableId: decl.id,
|
|
9765
|
+
expected: "enum (string)",
|
|
9766
|
+
actual: jsTypeOf(value)
|
|
9767
|
+
};
|
|
9768
|
+
}
|
|
9769
|
+
const allowed = decl.options.map((o) => o.value);
|
|
9770
|
+
if (!allowed.includes(value)) {
|
|
9771
|
+
return { kind: "enum-out-of-range", variableId: decl.id, allowed, actual: value };
|
|
9772
|
+
}
|
|
9773
|
+
return null;
|
|
9774
|
+
}
|
|
9775
|
+
}
|
|
9776
|
+
}
|
|
9777
|
+
function jsTypeOf(value) {
|
|
9778
|
+
if (value === null) return "null";
|
|
9779
|
+
if (Array.isArray(value)) return "array";
|
|
9780
|
+
return typeof value;
|
|
9781
|
+
}
|
|
9782
|
+
function formatVariableValidationIssue(issue) {
|
|
9783
|
+
switch (issue.kind) {
|
|
9784
|
+
case "undeclared":
|
|
9785
|
+
return `Variable "${issue.variableId}" is not declared in data-composition-variables.`;
|
|
9786
|
+
case "type-mismatch":
|
|
9787
|
+
return `Variable "${issue.variableId}" expected ${issue.expected}, got ${issue.actual}.`;
|
|
9788
|
+
case "enum-out-of-range":
|
|
9789
|
+
return `Variable "${issue.variableId}" must be one of ${issue.allowed.map((v) => `"${v}"`).join(", ")} (got "${issue.actual}").`;
|
|
9790
|
+
}
|
|
9791
|
+
}
|
|
9792
|
+
var init_validateVariables = __esm({
|
|
9793
|
+
"../core/src/runtime/validateVariables.ts"() {
|
|
9794
|
+
"use strict";
|
|
9795
|
+
}
|
|
9796
|
+
});
|
|
9797
|
+
|
|
9543
9798
|
// ../core/src/registry/types.ts
|
|
9544
9799
|
function isExampleItem(item) {
|
|
9545
9800
|
return item.type === "hyperframes:example";
|
|
@@ -9587,6 +9842,7 @@ var src_exports = {};
|
|
|
9587
9842
|
__export(src_exports, {
|
|
9588
9843
|
BASE_STYLES: () => BASE_STYLES,
|
|
9589
9844
|
CANVAS_DIMENSIONS: () => CANVAS_DIMENSIONS,
|
|
9845
|
+
COMPOSITION_VARIABLE_TYPES: () => COMPOSITION_VARIABLE_TYPES,
|
|
9590
9846
|
DEFAULT_DURATIONS: () => DEFAULT_DURATIONS,
|
|
9591
9847
|
ELEMENT_BASE_STYLES: () => ELEMENT_BASE_STYLES,
|
|
9592
9848
|
FILE_TYPES: () => FILE_TYPES,
|
|
@@ -9615,6 +9871,7 @@ __export(src_exports, {
|
|
|
9615
9871
|
extractCompositionMetadata: () => extractCompositionMetadata,
|
|
9616
9872
|
extractResolvedMedia: () => extractResolvedMedia,
|
|
9617
9873
|
fitTextFontSize: () => fitTextFontSize,
|
|
9874
|
+
formatVariableValidationIssue: () => formatVariableValidationIssue,
|
|
9618
9875
|
generateBaseHtml: () => generateBaseHtml,
|
|
9619
9876
|
generateGsapTimelineScript: () => generateGsapTimelineScript,
|
|
9620
9877
|
generateHyperframesHtml: () => generateHyperframesHtml,
|
|
@@ -9623,6 +9880,7 @@ __export(src_exports, {
|
|
|
9623
9880
|
getDefaultStageZoom: () => getDefaultStageZoom,
|
|
9624
9881
|
getHyperframeRuntimeScript: () => getHyperframeRuntimeScript,
|
|
9625
9882
|
getStageStyles: () => getStageStyles,
|
|
9883
|
+
getVariables: () => getVariables,
|
|
9626
9884
|
gsapAnimationsToKeyframes: () => gsapAnimationsToKeyframes,
|
|
9627
9885
|
injectDurations: () => injectDurations,
|
|
9628
9886
|
isBlockItem: () => isBlockItem,
|
|
@@ -9652,7 +9910,8 @@ __export(src_exports, {
|
|
|
9652
9910
|
updateAnimationInScript: () => updateAnimationInScript,
|
|
9653
9911
|
updateElementInHtml: () => updateElementInHtml,
|
|
9654
9912
|
validateCompositionGsap: () => validateCompositionGsap,
|
|
9655
|
-
validateCompositionHtml: () => validateCompositionHtml
|
|
9913
|
+
validateCompositionHtml: () => validateCompositionHtml,
|
|
9914
|
+
validateVariables: () => validateVariables
|
|
9656
9915
|
});
|
|
9657
9916
|
var init_src = __esm({
|
|
9658
9917
|
"../core/src/index.ts"() {
|
|
@@ -9673,6 +9932,8 @@ var init_src = __esm({
|
|
|
9673
9932
|
init_parityContract();
|
|
9674
9933
|
init_gsap2();
|
|
9675
9934
|
init_text();
|
|
9935
|
+
init_getVariables();
|
|
9936
|
+
init_validateVariables();
|
|
9676
9937
|
init_registry();
|
|
9677
9938
|
}
|
|
9678
9939
|
});
|
|
@@ -10171,8 +10432,8 @@ function flushSync() {
|
|
|
10171
10432
|
eventQueue = [];
|
|
10172
10433
|
const payload = JSON.stringify({ api_key: POSTHOG_API_KEY, batch });
|
|
10173
10434
|
try {
|
|
10174
|
-
const { spawn:
|
|
10175
|
-
const child =
|
|
10435
|
+
const { spawn: spawn15 } = __require("child_process");
|
|
10436
|
+
const child = spawn15(
|
|
10176
10437
|
process.execPath,
|
|
10177
10438
|
[
|
|
10178
10439
|
"-e",
|
|
@@ -10288,7 +10549,7 @@ import { get as httpsGet } from "https";
|
|
|
10288
10549
|
import { pipeline } from "stream/promises";
|
|
10289
10550
|
function downloadFile(url, dest) {
|
|
10290
10551
|
const tmp = `${dest}.tmp`;
|
|
10291
|
-
return new Promise((
|
|
10552
|
+
return new Promise((resolve40, reject) => {
|
|
10292
10553
|
const follow = (u) => {
|
|
10293
10554
|
httpsGet(u, (res) => {
|
|
10294
10555
|
if (res.statusCode === 301 || res.statusCode === 302) {
|
|
@@ -10305,7 +10566,7 @@ function downloadFile(url, dest) {
|
|
|
10305
10566
|
const file = createWriteStream(tmp);
|
|
10306
10567
|
pipeline(res, file).then(() => {
|
|
10307
10568
|
renameSync(tmp, dest);
|
|
10308
|
-
|
|
10569
|
+
resolve40();
|
|
10309
10570
|
}).catch((err) => {
|
|
10310
10571
|
try {
|
|
10311
10572
|
unlinkSync(tmp);
|
|
@@ -10339,7 +10600,8 @@ __export(manager_exports, {
|
|
|
10339
10600
|
ensureWhisper: () => ensureWhisper,
|
|
10340
10601
|
findWhisper: () => findWhisper,
|
|
10341
10602
|
getInstallInstructions: () => getInstallInstructions,
|
|
10342
|
-
hasFFmpeg: () => hasFFmpeg
|
|
10603
|
+
hasFFmpeg: () => hasFFmpeg,
|
|
10604
|
+
hasFFprobe: () => hasFFprobe
|
|
10343
10605
|
});
|
|
10344
10606
|
import { execFileSync } from "child_process";
|
|
10345
10607
|
import { existsSync as existsSync5, mkdirSync as mkdirSync3, rmSync } from "fs";
|
|
@@ -10475,19 +10737,25 @@ async function ensureWhisper(options) {
|
|
|
10475
10737
|
throw new Error(`whisper-cpp not found. Install: ${getInstallInstructions()}`);
|
|
10476
10738
|
}
|
|
10477
10739
|
async function ensureModel(model = DEFAULT_MODEL, options) {
|
|
10478
|
-
const
|
|
10479
|
-
if (existsSync5(
|
|
10740
|
+
const modelPath2 = join5(MODELS_DIR, `ggml-${model}.bin`);
|
|
10741
|
+
if (existsSync5(modelPath2)) return modelPath2;
|
|
10480
10742
|
mkdirSync3(MODELS_DIR, { recursive: true });
|
|
10481
10743
|
options?.onProgress?.(`Downloading model ${model}...`);
|
|
10482
|
-
await downloadFile(getModelUrl(model),
|
|
10483
|
-
if (!existsSync5(
|
|
10744
|
+
await downloadFile(getModelUrl(model), modelPath2);
|
|
10745
|
+
if (!existsSync5(modelPath2)) {
|
|
10484
10746
|
throw new Error(`Model download failed: ${model}`);
|
|
10485
10747
|
}
|
|
10486
|
-
return
|
|
10748
|
+
return modelPath2;
|
|
10487
10749
|
}
|
|
10488
10750
|
function hasFFmpeg() {
|
|
10751
|
+
return hasBinary("ffmpeg");
|
|
10752
|
+
}
|
|
10753
|
+
function hasFFprobe() {
|
|
10754
|
+
return hasBinary("ffprobe");
|
|
10755
|
+
}
|
|
10756
|
+
function hasBinary(name) {
|
|
10489
10757
|
try {
|
|
10490
|
-
execFileSync(
|
|
10758
|
+
execFileSync(name, ["-version"], { stdio: "ignore", timeout: 5e3 });
|
|
10491
10759
|
return true;
|
|
10492
10760
|
} catch {
|
|
10493
10761
|
return false;
|
|
@@ -10798,9 +11066,9 @@ import { execFileSync as execFileSync2 } from "child_process";
|
|
|
10798
11066
|
import { existsSync as existsSync6, readFileSync as readFileSync7, mkdirSync as mkdirSync4, unlinkSync as unlinkSync2 } from "fs";
|
|
10799
11067
|
import { join as join8, extname as extname2 } from "path";
|
|
10800
11068
|
import { tmpdir } from "os";
|
|
10801
|
-
function detectLanguage(whisperPath,
|
|
11069
|
+
function detectLanguage(whisperPath, modelPath2, wavPath) {
|
|
10802
11070
|
try {
|
|
10803
|
-
const output = execFileSync2(whisperPath, ["--model",
|
|
11071
|
+
const output = execFileSync2(whisperPath, ["--model", modelPath2, "--detect-language", wavPath], {
|
|
10804
11072
|
encoding: "utf-8",
|
|
10805
11073
|
timeout: 3e4,
|
|
10806
11074
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -10914,7 +11182,7 @@ async function transcribe(inputPath, outputDir, options) {
|
|
|
10914
11182
|
options?.onProgress?.("Checking whisper...");
|
|
10915
11183
|
const whisper = await ensureWhisper({ onProgress: options?.onProgress });
|
|
10916
11184
|
options?.onProgress?.("Checking model...");
|
|
10917
|
-
const
|
|
11185
|
+
const modelPath2 = await ensureModel(model, {
|
|
10918
11186
|
onProgress: options?.onProgress
|
|
10919
11187
|
});
|
|
10920
11188
|
let wavPath;
|
|
@@ -10934,7 +11202,7 @@ async function transcribe(inputPath, outputDir, options) {
|
|
|
10934
11202
|
throw new Error(`Unsupported file type: ${ext}`);
|
|
10935
11203
|
}
|
|
10936
11204
|
let effectiveModel = model;
|
|
10937
|
-
let effectiveModelPath =
|
|
11205
|
+
let effectiveModelPath = modelPath2;
|
|
10938
11206
|
let detectedLanguage = options?.language ?? null;
|
|
10939
11207
|
if (!detectedLanguage && !effectiveModel.endsWith(".en")) {
|
|
10940
11208
|
options?.onProgress?.("Detecting language...");
|
|
@@ -11023,7 +11291,7 @@ function hasNpx() {
|
|
|
11023
11291
|
}
|
|
11024
11292
|
}
|
|
11025
11293
|
function runSkillsAdd(repo) {
|
|
11026
|
-
return new Promise((
|
|
11294
|
+
return new Promise((resolve40, reject) => {
|
|
11027
11295
|
const child = spawn("npx", ["skills", "add", repo, "--all"], {
|
|
11028
11296
|
stdio: "inherit",
|
|
11029
11297
|
timeout: 12e4,
|
|
@@ -11037,7 +11305,7 @@ function runSkillsAdd(repo) {
|
|
|
11037
11305
|
env: { ...process.env, GIT_CLONE_PROTECTION_ACTIVE: "0" }
|
|
11038
11306
|
});
|
|
11039
11307
|
child.on("close", (code, signal) => {
|
|
11040
|
-
if (code === 0)
|
|
11308
|
+
if (code === 0) resolve40();
|
|
11041
11309
|
else if (signal === "SIGINT" || code === 130) process.exit(0);
|
|
11042
11310
|
else reject(new Error(`npx skills add exited with code ${code}`));
|
|
11043
11311
|
});
|
|
@@ -11824,7 +12092,7 @@ function computePeaks(floats, count) {
|
|
|
11824
12092
|
return peaks.map((p) => p / maxPeak);
|
|
11825
12093
|
}
|
|
11826
12094
|
function decodeAudioPeaks(audioPath) {
|
|
11827
|
-
return new Promise((
|
|
12095
|
+
return new Promise((resolve40, reject) => {
|
|
11828
12096
|
const proc = spawn2(
|
|
11829
12097
|
"ffmpeg",
|
|
11830
12098
|
[
|
|
@@ -11857,7 +12125,7 @@ function decodeAudioPeaks(audioPath) {
|
|
|
11857
12125
|
return;
|
|
11858
12126
|
}
|
|
11859
12127
|
const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + numSamples * 4);
|
|
11860
|
-
|
|
12128
|
+
resolve40(computePeaks(new Float32Array(ab), PEAK_COUNT));
|
|
11861
12129
|
});
|
|
11862
12130
|
proc.on("error", reject);
|
|
11863
12131
|
});
|
|
@@ -15797,8 +16065,8 @@ var init_custom_element_registry = __esm({
|
|
|
15797
16065
|
} : (element) => element.localName === localName;
|
|
15798
16066
|
registry.set(localName, { Class, check });
|
|
15799
16067
|
if (waiting.has(localName)) {
|
|
15800
|
-
for (const
|
|
15801
|
-
|
|
16068
|
+
for (const resolve40 of waiting.get(localName))
|
|
16069
|
+
resolve40(Class);
|
|
15802
16070
|
waiting.delete(localName);
|
|
15803
16071
|
}
|
|
15804
16072
|
ownerDocument.querySelectorAll(
|
|
@@ -15838,13 +16106,13 @@ var init_custom_element_registry = __esm({
|
|
|
15838
16106
|
*/
|
|
15839
16107
|
whenDefined(localName) {
|
|
15840
16108
|
const { registry, waiting } = this;
|
|
15841
|
-
return new Promise((
|
|
16109
|
+
return new Promise((resolve40) => {
|
|
15842
16110
|
if (registry.has(localName))
|
|
15843
|
-
|
|
16111
|
+
resolve40(registry.get(localName).Class);
|
|
15844
16112
|
else {
|
|
15845
16113
|
if (!waiting.has(localName))
|
|
15846
16114
|
waiting.set(localName, []);
|
|
15847
|
-
waiting.get(localName).push(
|
|
16115
|
+
waiting.get(localName).push(resolve40);
|
|
15848
16116
|
}
|
|
15849
16117
|
});
|
|
15850
16118
|
}
|
|
@@ -25510,15 +25778,15 @@ async function findBrowser() {
|
|
|
25510
25778
|
async function ensureBrowser(options) {
|
|
25511
25779
|
const existing = await findBrowser();
|
|
25512
25780
|
if (existing) return existing;
|
|
25513
|
-
const
|
|
25514
|
-
if (!
|
|
25781
|
+
const platform6 = detectBrowserPlatform();
|
|
25782
|
+
if (!platform6) {
|
|
25515
25783
|
throw new Error(`Unsupported platform: ${process.platform} ${process.arch}`);
|
|
25516
25784
|
}
|
|
25517
25785
|
const installed = await install({
|
|
25518
25786
|
cacheDir: CACHE_DIR2,
|
|
25519
25787
|
browser: Browser.CHROMEHEADLESSSHELL,
|
|
25520
25788
|
buildId: CHROME_VERSION,
|
|
25521
|
-
platform:
|
|
25789
|
+
platform: platform6,
|
|
25522
25790
|
downloadProgressCallback: options?.onProgress
|
|
25523
25791
|
});
|
|
25524
25792
|
return { executablePath: installed.executablePath, source: "download" };
|
|
@@ -25838,7 +26106,7 @@ function forceReleaseBrowser(browser) {
|
|
|
25838
26106
|
}
|
|
25839
26107
|
}
|
|
25840
26108
|
function buildChromeArgs(options, config) {
|
|
25841
|
-
const
|
|
26109
|
+
const platform6 = options.platform ?? process.platform;
|
|
25842
26110
|
const gpuDisabled = config?.disableGpu ?? DEFAULT_CONFIG2.disableGpu;
|
|
25843
26111
|
const browserGpuMode = gpuDisabled ? "software" : config?.browserGpuMode ?? DEFAULT_CONFIG2.browserGpuMode;
|
|
25844
26112
|
const chromeArgs = [
|
|
@@ -25847,7 +26115,7 @@ function buildChromeArgs(options, config) {
|
|
|
25847
26115
|
"--disable-dev-shm-usage",
|
|
25848
26116
|
"--enable-webgl",
|
|
25849
26117
|
"--ignore-gpu-blocklist",
|
|
25850
|
-
...getBrowserGpuArgs(browserGpuMode,
|
|
26118
|
+
...getBrowserGpuArgs(browserGpuMode, platform6),
|
|
25851
26119
|
"--font-render-hinting=none",
|
|
25852
26120
|
"--force-color-profile=srgb",
|
|
25853
26121
|
`--window-size=${options.width},${options.height}`,
|
|
@@ -25895,11 +26163,11 @@ function buildChromeArgs(options, config) {
|
|
|
25895
26163
|
}
|
|
25896
26164
|
return chromeArgs;
|
|
25897
26165
|
}
|
|
25898
|
-
function getBrowserGpuArgs(mode,
|
|
26166
|
+
function getBrowserGpuArgs(mode, platform6) {
|
|
25899
26167
|
if (mode === "software") {
|
|
25900
26168
|
return ["--use-gl=angle", "--use-angle=swiftshader"];
|
|
25901
26169
|
}
|
|
25902
|
-
switch (
|
|
26170
|
+
switch (platform6) {
|
|
25903
26171
|
case "darwin":
|
|
25904
26172
|
return ["--use-gl=angle", "--use-angle=metal", "--enable-gpu-rasterization"];
|
|
25905
26173
|
case "win32":
|
|
@@ -26219,10 +26487,10 @@ async function waitForCloseWithTimeout(promise) {
|
|
|
26219
26487
|
() => void 0,
|
|
26220
26488
|
() => void 0
|
|
26221
26489
|
),
|
|
26222
|
-
new Promise((
|
|
26490
|
+
new Promise((resolve40) => {
|
|
26223
26491
|
timer = setTimeout(() => {
|
|
26224
26492
|
timedOut = true;
|
|
26225
|
-
|
|
26493
|
+
resolve40();
|
|
26226
26494
|
}, CAPTURE_SESSION_CLOSE_TIMEOUT_MS);
|
|
26227
26495
|
})
|
|
26228
26496
|
]);
|
|
@@ -26247,6 +26515,15 @@ async function createCaptureSession(serverUrl, outputDir, options, onBeforeCaptu
|
|
|
26247
26515
|
w.__name = (fn, _name) => fn;
|
|
26248
26516
|
}
|
|
26249
26517
|
});
|
|
26518
|
+
if (options.variables && Object.keys(options.variables).length > 0) {
|
|
26519
|
+
const variablesJson = JSON.stringify(options.variables);
|
|
26520
|
+
await page.evaluateOnNewDocument((json) => {
|
|
26521
|
+
try {
|
|
26522
|
+
window.__hfVariables = JSON.parse(json);
|
|
26523
|
+
} catch {
|
|
26524
|
+
}
|
|
26525
|
+
}, variablesJson);
|
|
26526
|
+
}
|
|
26250
26527
|
const browserVersion = await browser.version();
|
|
26251
26528
|
const expectedMajor = config?.expectedChromiumMajor;
|
|
26252
26529
|
if (Number.isFinite(expectedMajor)) {
|
|
@@ -26302,7 +26579,7 @@ async function pollPageExpression(page, expression, timeoutMs, intervalMs = 100)
|
|
|
26302
26579
|
while (Date.now() < deadline) {
|
|
26303
26580
|
const ready = Boolean(await page.evaluate(expression));
|
|
26304
26581
|
if (ready) return true;
|
|
26305
|
-
await new Promise((
|
|
26582
|
+
await new Promise((resolve40) => setTimeout(resolve40, intervalMs));
|
|
26306
26583
|
}
|
|
26307
26584
|
return Boolean(await page.evaluate(expression));
|
|
26308
26585
|
}
|
|
@@ -26336,7 +26613,7 @@ async function waitForOptionalTailwindReady(page, timeoutMs) {
|
|
|
26336
26613
|
page.evaluate(
|
|
26337
26614
|
`Promise.resolve(window.__tailwindReady).then(() => true, () => false)`
|
|
26338
26615
|
),
|
|
26339
|
-
new Promise((
|
|
26616
|
+
new Promise((resolve40) => setTimeout(() => resolve40(false), timeoutMs))
|
|
26340
26617
|
]);
|
|
26341
26618
|
if (!ready) {
|
|
26342
26619
|
throw new Error(
|
|
@@ -26654,7 +26931,7 @@ var init_frameCapture = __esm({
|
|
|
26654
26931
|
// ../engine/src/utils/gpuEncoder.ts
|
|
26655
26932
|
import { spawn as spawn3 } from "child_process";
|
|
26656
26933
|
async function detectGpuEncoder() {
|
|
26657
|
-
return new Promise((
|
|
26934
|
+
return new Promise((resolve40) => {
|
|
26658
26935
|
const ffmpeg = spawn3("ffmpeg", ["-encoders"], {
|
|
26659
26936
|
stdio: ["pipe", "pipe", "pipe"]
|
|
26660
26937
|
});
|
|
@@ -26663,13 +26940,13 @@ async function detectGpuEncoder() {
|
|
|
26663
26940
|
stdout2 += data.toString();
|
|
26664
26941
|
});
|
|
26665
26942
|
ffmpeg.on("close", () => {
|
|
26666
|
-
if (stdout2.includes("h264_nvenc"))
|
|
26667
|
-
else if (stdout2.includes("h264_videotoolbox"))
|
|
26668
|
-
else if (stdout2.includes("h264_vaapi"))
|
|
26669
|
-
else if (stdout2.includes("h264_qsv"))
|
|
26670
|
-
else
|
|
26943
|
+
if (stdout2.includes("h264_nvenc")) resolve40("nvenc");
|
|
26944
|
+
else if (stdout2.includes("h264_videotoolbox")) resolve40("videotoolbox");
|
|
26945
|
+
else if (stdout2.includes("h264_vaapi")) resolve40("vaapi");
|
|
26946
|
+
else if (stdout2.includes("h264_qsv")) resolve40("qsv");
|
|
26947
|
+
else resolve40(null);
|
|
26671
26948
|
});
|
|
26672
|
-
ffmpeg.on("error", () =>
|
|
26949
|
+
ffmpeg.on("error", () => resolve40(null));
|
|
26673
26950
|
});
|
|
26674
26951
|
}
|
|
26675
26952
|
async function getCachedGpuEncoder() {
|
|
@@ -26790,7 +27067,7 @@ async function runFfmpeg(args, opts) {
|
|
|
26790
27067
|
const signal = opts?.signal;
|
|
26791
27068
|
const timeout = opts?.timeout ?? DEFAULT_TIMEOUT;
|
|
26792
27069
|
const onStderr = opts?.onStderr;
|
|
26793
|
-
return new Promise((
|
|
27070
|
+
return new Promise((resolve40) => {
|
|
26794
27071
|
const ffmpeg = spawn4("ffmpeg", args);
|
|
26795
27072
|
let stderr = "";
|
|
26796
27073
|
const onAbort = () => {
|
|
@@ -26816,7 +27093,7 @@ async function runFfmpeg(args, opts) {
|
|
|
26816
27093
|
ffmpeg.on("close", (code) => {
|
|
26817
27094
|
clearTimeout(timer);
|
|
26818
27095
|
if (signal) signal.removeEventListener("abort", onAbort);
|
|
26819
|
-
|
|
27096
|
+
resolve40({
|
|
26820
27097
|
success: !signal?.aborted && code === 0,
|
|
26821
27098
|
exitCode: code,
|
|
26822
27099
|
stderr,
|
|
@@ -26826,7 +27103,7 @@ async function runFfmpeg(args, opts) {
|
|
|
26826
27103
|
ffmpeg.on("error", (err) => {
|
|
26827
27104
|
clearTimeout(timer);
|
|
26828
27105
|
if (signal) signal.removeEventListener("abort", onAbort);
|
|
26829
|
-
|
|
27106
|
+
resolve40({
|
|
26830
27107
|
success: false,
|
|
26831
27108
|
exitCode: null,
|
|
26832
27109
|
stderr: err.message,
|
|
@@ -27018,7 +27295,7 @@ async function encodeFramesFromDir(framesDir, framePattern, outputPath, options,
|
|
|
27018
27295
|
const inputPath = join22(framesDir, framePattern);
|
|
27019
27296
|
const inputArgs = ["-framerate", String(options.fps), "-i", inputPath];
|
|
27020
27297
|
const args = buildEncoderArgs(options, inputArgs, outputPath, gpuEncoder);
|
|
27021
|
-
return new Promise((
|
|
27298
|
+
return new Promise((resolve40) => {
|
|
27022
27299
|
const ffmpeg = spawn5("ffmpeg", args);
|
|
27023
27300
|
let stderr = "";
|
|
27024
27301
|
const onAbort = () => {
|
|
@@ -27043,7 +27320,7 @@ async function encodeFramesFromDir(framesDir, framePattern, outputPath, options,
|
|
|
27043
27320
|
if (signal) signal.removeEventListener("abort", onAbort);
|
|
27044
27321
|
const durationMs = Date.now() - startTime;
|
|
27045
27322
|
if (signal?.aborted) {
|
|
27046
|
-
|
|
27323
|
+
resolve40({
|
|
27047
27324
|
success: false,
|
|
27048
27325
|
outputPath,
|
|
27049
27326
|
durationMs,
|
|
@@ -27054,7 +27331,7 @@ async function encodeFramesFromDir(framesDir, framePattern, outputPath, options,
|
|
|
27054
27331
|
return;
|
|
27055
27332
|
}
|
|
27056
27333
|
if (code !== 0) {
|
|
27057
|
-
|
|
27334
|
+
resolve40({
|
|
27058
27335
|
success: false,
|
|
27059
27336
|
outputPath,
|
|
27060
27337
|
durationMs,
|
|
@@ -27065,12 +27342,12 @@ async function encodeFramesFromDir(framesDir, framePattern, outputPath, options,
|
|
|
27065
27342
|
return;
|
|
27066
27343
|
}
|
|
27067
27344
|
const fileSize = existsSync19(outputPath) ? statSync4(outputPath).size : 0;
|
|
27068
|
-
|
|
27345
|
+
resolve40({ success: true, outputPath, durationMs, framesEncoded: frameCount, fileSize });
|
|
27069
27346
|
});
|
|
27070
27347
|
ffmpeg.on("error", (err) => {
|
|
27071
27348
|
clearTimeout(timer);
|
|
27072
27349
|
if (signal) signal.removeEventListener("abort", onAbort);
|
|
27073
|
-
|
|
27350
|
+
resolve40({
|
|
27074
27351
|
success: false,
|
|
27075
27352
|
outputPath,
|
|
27076
27353
|
durationMs: Date.now() - startTime,
|
|
@@ -27128,18 +27405,18 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
|
|
|
27128
27405
|
let gpuEncoder = null;
|
|
27129
27406
|
if (options.useGpu) gpuEncoder = await getCachedGpuEncoder();
|
|
27130
27407
|
const args = buildEncoderArgs(options, inputArgs, chunkPath, gpuEncoder);
|
|
27131
|
-
const chunkResult = await new Promise((
|
|
27408
|
+
const chunkResult = await new Promise((resolve40) => {
|
|
27132
27409
|
const ffmpeg = spawn5("ffmpeg", args);
|
|
27133
27410
|
let stderr = "";
|
|
27134
27411
|
ffmpeg.stderr.on("data", (d) => {
|
|
27135
27412
|
stderr += d.toString();
|
|
27136
27413
|
});
|
|
27137
27414
|
ffmpeg.on("close", (code) => {
|
|
27138
|
-
if (code === 0)
|
|
27139
|
-
else
|
|
27415
|
+
if (code === 0) resolve40({ success: true });
|
|
27416
|
+
else resolve40({ success: false, error: `Chunk ${i2} encode failed: ${stderr.slice(-400)}` });
|
|
27140
27417
|
});
|
|
27141
27418
|
ffmpeg.on("error", (err) => {
|
|
27142
|
-
|
|
27419
|
+
resolve40({ success: false, error: `Chunk ${i2} encode error: ${err.message}` });
|
|
27143
27420
|
});
|
|
27144
27421
|
});
|
|
27145
27422
|
if (!chunkResult.success) {
|
|
@@ -27169,18 +27446,18 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
|
|
|
27169
27446
|
"-y",
|
|
27170
27447
|
outputPath
|
|
27171
27448
|
];
|
|
27172
|
-
const concatResult = await new Promise((
|
|
27449
|
+
const concatResult = await new Promise((resolve40) => {
|
|
27173
27450
|
const ffmpeg = spawn5("ffmpeg", concatArgs);
|
|
27174
27451
|
let stderr = "";
|
|
27175
27452
|
ffmpeg.stderr.on("data", (d) => {
|
|
27176
27453
|
stderr += d.toString();
|
|
27177
27454
|
});
|
|
27178
27455
|
ffmpeg.on("close", (code) => {
|
|
27179
|
-
if (code === 0)
|
|
27180
|
-
else
|
|
27456
|
+
if (code === 0) resolve40({ success: true });
|
|
27457
|
+
else resolve40({ success: false, error: `Chunk concat failed: ${stderr.slice(-400)}` });
|
|
27181
27458
|
});
|
|
27182
27459
|
ffmpeg.on("error", (err) => {
|
|
27183
|
-
|
|
27460
|
+
resolve40({ success: false, error: `Chunk concat error: ${err.message}` });
|
|
27184
27461
|
});
|
|
27185
27462
|
});
|
|
27186
27463
|
if (!concatResult.success) {
|
|
@@ -27280,37 +27557,37 @@ import { dirname as dirname8 } from "path";
|
|
|
27280
27557
|
function createFrameReorderBuffer(startFrame, endFrame) {
|
|
27281
27558
|
let cursor = startFrame;
|
|
27282
27559
|
const pending = /* @__PURE__ */ new Map();
|
|
27283
|
-
const enqueueAt = (frame,
|
|
27560
|
+
const enqueueAt = (frame, resolve40) => {
|
|
27284
27561
|
const list = pending.get(frame);
|
|
27285
27562
|
if (list === void 0) {
|
|
27286
|
-
pending.set(frame, [
|
|
27563
|
+
pending.set(frame, [resolve40]);
|
|
27287
27564
|
} else {
|
|
27288
|
-
list.push(
|
|
27565
|
+
list.push(resolve40);
|
|
27289
27566
|
}
|
|
27290
27567
|
};
|
|
27291
27568
|
const flushAt = (frame) => {
|
|
27292
27569
|
const list = pending.get(frame);
|
|
27293
27570
|
if (list === void 0) return;
|
|
27294
27571
|
pending.delete(frame);
|
|
27295
|
-
for (const
|
|
27572
|
+
for (const resolve40 of list) resolve40();
|
|
27296
27573
|
};
|
|
27297
|
-
const waitForFrame = (frame) => new Promise((
|
|
27574
|
+
const waitForFrame = (frame) => new Promise((resolve40) => {
|
|
27298
27575
|
if (frame === cursor) {
|
|
27299
|
-
|
|
27576
|
+
resolve40();
|
|
27300
27577
|
return;
|
|
27301
27578
|
}
|
|
27302
|
-
enqueueAt(frame,
|
|
27579
|
+
enqueueAt(frame, resolve40);
|
|
27303
27580
|
});
|
|
27304
27581
|
const advanceTo = (frame) => {
|
|
27305
27582
|
cursor = frame;
|
|
27306
27583
|
flushAt(frame);
|
|
27307
27584
|
};
|
|
27308
|
-
const waitForAllDone = () => new Promise((
|
|
27585
|
+
const waitForAllDone = () => new Promise((resolve40) => {
|
|
27309
27586
|
if (cursor >= endFrame) {
|
|
27310
|
-
|
|
27587
|
+
resolve40();
|
|
27311
27588
|
return;
|
|
27312
27589
|
}
|
|
27313
|
-
enqueueAt(endFrame,
|
|
27590
|
+
enqueueAt(endFrame, resolve40);
|
|
27314
27591
|
});
|
|
27315
27592
|
return { waitForFrame, advanceTo, waitForAllDone };
|
|
27316
27593
|
}
|
|
@@ -27472,7 +27749,7 @@ async function spawnStreamingEncoder(outputPath, options, signal, config) {
|
|
|
27472
27749
|
let stderr = "";
|
|
27473
27750
|
let exitCode = null;
|
|
27474
27751
|
let exitPromiseResolve = null;
|
|
27475
|
-
const exitPromise = new Promise((
|
|
27752
|
+
const exitPromise = new Promise((resolve40) => exitPromiseResolve = resolve40);
|
|
27476
27753
|
ffmpeg.stderr?.on("data", (data) => {
|
|
27477
27754
|
stderr += data.toString();
|
|
27478
27755
|
});
|
|
@@ -27518,8 +27795,8 @@ Process error: ${err.message}`;
|
|
|
27518
27795
|
if (signal) signal.removeEventListener("abort", onAbort);
|
|
27519
27796
|
const stdin = ffmpeg.stdin;
|
|
27520
27797
|
if (stdin && !stdin.destroyed) {
|
|
27521
|
-
await new Promise((
|
|
27522
|
-
stdin.end(() =>
|
|
27798
|
+
await new Promise((resolve40) => {
|
|
27799
|
+
stdin.end(() => resolve40());
|
|
27523
27800
|
});
|
|
27524
27801
|
}
|
|
27525
27802
|
await exitPromise;
|
|
@@ -27562,7 +27839,7 @@ import { spawn as spawn7 } from "child_process";
|
|
|
27562
27839
|
import { readFileSync as readFileSync17 } from "fs";
|
|
27563
27840
|
import { extname as extname4 } from "path";
|
|
27564
27841
|
function runFfprobe(args) {
|
|
27565
|
-
return new Promise((
|
|
27842
|
+
return new Promise((resolve40, reject) => {
|
|
27566
27843
|
const proc = spawn7("ffprobe", args);
|
|
27567
27844
|
let stdout2 = "";
|
|
27568
27845
|
let stderr = "";
|
|
@@ -27576,7 +27853,7 @@ function runFfprobe(args) {
|
|
|
27576
27853
|
if (code !== 0) {
|
|
27577
27854
|
reject(new Error(`[FFmpeg] ffprobe exited with code ${code}: ${stderr}`));
|
|
27578
27855
|
} else {
|
|
27579
|
-
|
|
27856
|
+
resolve40(stdout2);
|
|
27580
27857
|
}
|
|
27581
27858
|
});
|
|
27582
27859
|
proc.on("error", (err) => {
|
|
@@ -28375,11 +28652,21 @@ function wrapScopedCompositionScript(source, compositionId, errorLabel = "[Hyper
|
|
|
28375
28652
|
return typeof value === "function" ? value.bind(target) : value;
|
|
28376
28653
|
},
|
|
28377
28654
|
});
|
|
28655
|
+
var __hfBaseHyperframes = window.__hyperframes;
|
|
28656
|
+
var __hfScopedHyperframes = !__hfBaseHyperframes
|
|
28657
|
+
? __hfBaseHyperframes
|
|
28658
|
+
: Object.assign({}, __hfBaseHyperframes, {
|
|
28659
|
+
getVariables: function() {
|
|
28660
|
+
var byComp = window.__hfVariablesByComp;
|
|
28661
|
+
var scoped = byComp && __hfCompId ? byComp[__hfCompId] : null;
|
|
28662
|
+
return scoped ? Object.assign({}, scoped) : {};
|
|
28663
|
+
},
|
|
28664
|
+
});
|
|
28378
28665
|
var __hfRun = function() {
|
|
28379
28666
|
try {
|
|
28380
|
-
(function(document, gsap, window) {
|
|
28667
|
+
(function(document, gsap, window, __hyperframes) {
|
|
28381
28668
|
${source}
|
|
28382
|
-
}).call(window, __hfScopedDocument, __hfScopedGsap, __hfScopedWindow);
|
|
28669
|
+
}).call(window, __hfScopedDocument, __hfScopedGsap, __hfScopedWindow, __hfScopedHyperframes);
|
|
28383
28670
|
} catch (_err) {
|
|
28384
28671
|
console.error(__hfErrorLabel, __hfCompId, _err);
|
|
28385
28672
|
}
|
|
@@ -29200,7 +29487,7 @@ async function extractVideoFramesRange(videoPath, videoId, startTime, duration,
|
|
|
29200
29487
|
args.push("-q:v", format === "jpg" ? String(Math.ceil((100 - quality) / 3)) : "0");
|
|
29201
29488
|
if (format === "png") args.push("-compression_level", "6");
|
|
29202
29489
|
args.push("-y", outputPattern);
|
|
29203
|
-
return new Promise((
|
|
29490
|
+
return new Promise((resolve40, reject) => {
|
|
29204
29491
|
const ffmpeg = spawn8("ffmpeg", args);
|
|
29205
29492
|
let stderr = "";
|
|
29206
29493
|
const onAbort = () => {
|
|
@@ -29235,7 +29522,7 @@ async function extractVideoFramesRange(videoPath, videoId, startTime, duration,
|
|
|
29235
29522
|
files.forEach((file, index) => {
|
|
29236
29523
|
framePaths.set(index, join26(videoOutputDir, file));
|
|
29237
29524
|
});
|
|
29238
|
-
|
|
29525
|
+
resolve40({
|
|
29239
29526
|
videoId,
|
|
29240
29527
|
srcPath: videoPath,
|
|
29241
29528
|
outputDir: videoOutputDir,
|
|
@@ -30620,11 +30907,11 @@ function createFileServer(options) {
|
|
|
30620
30907
|
headers: { "Content-Type": contentType }
|
|
30621
30908
|
});
|
|
30622
30909
|
});
|
|
30623
|
-
return new Promise((
|
|
30910
|
+
return new Promise((resolve40) => {
|
|
30624
30911
|
const server = serve({ fetch: app.fetch, port }, (info) => {
|
|
30625
30912
|
const actualPort = info.port;
|
|
30626
30913
|
const url = `http://localhost:${actualPort}`;
|
|
30627
|
-
|
|
30914
|
+
resolve40({
|
|
30628
30915
|
url,
|
|
30629
30916
|
port: actualPort,
|
|
30630
30917
|
close: () => server.close()
|
|
@@ -32393,10 +32680,10 @@ function createFileServer2(options) {
|
|
|
32393
32680
|
headers: { "Content-Type": contentType }
|
|
32394
32681
|
});
|
|
32395
32682
|
});
|
|
32396
|
-
return new Promise((
|
|
32683
|
+
return new Promise((resolve40) => {
|
|
32397
32684
|
const connections = /* @__PURE__ */ new Set();
|
|
32398
32685
|
const server = serve2({ fetch: app.fetch, port }, (info) => {
|
|
32399
|
-
|
|
32686
|
+
resolve40({
|
|
32400
32687
|
url: `http://localhost:${info.port}`,
|
|
32401
32688
|
port: info.port,
|
|
32402
32689
|
close: () => {
|
|
@@ -35590,7 +35877,8 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
35590
35877
|
height,
|
|
35591
35878
|
fps: job.config.fps,
|
|
35592
35879
|
format: needsAlpha ? "png" : "jpeg",
|
|
35593
|
-
quality: needsAlpha ? void 0 : job.config.quality === "draft" ? 80 : 95
|
|
35880
|
+
quality: needsAlpha ? void 0 : job.config.quality === "draft" ? 80 : 95,
|
|
35881
|
+
variables: job.config.variables
|
|
35594
35882
|
};
|
|
35595
35883
|
const buildCaptureOptions = () => ({
|
|
35596
35884
|
...captureOptions,
|
|
@@ -36887,10 +37175,10 @@ var init_semaphore = __esm({
|
|
|
36887
37175
|
this.active++;
|
|
36888
37176
|
return () => this.release();
|
|
36889
37177
|
}
|
|
36890
|
-
return new Promise((
|
|
37178
|
+
return new Promise((resolve40) => {
|
|
36891
37179
|
this.queue.push(() => {
|
|
36892
37180
|
this.active++;
|
|
36893
|
-
|
|
37181
|
+
resolve40(() => this.release());
|
|
36894
37182
|
});
|
|
36895
37183
|
});
|
|
36896
37184
|
}
|
|
@@ -37076,7 +37364,7 @@ function createRenderHandlers(options = {}) {
|
|
|
37076
37364
|
result
|
|
37077
37365
|
});
|
|
37078
37366
|
};
|
|
37079
|
-
const
|
|
37367
|
+
const render3 = async (c2) => {
|
|
37080
37368
|
const requestId = getRequestId(c2);
|
|
37081
37369
|
const t0 = Date.now();
|
|
37082
37370
|
let body;
|
|
@@ -37330,7 +37618,7 @@ function createRenderHandlers(options = {}) {
|
|
|
37330
37618
|
activeRenders: renderSemaphore.activeCount,
|
|
37331
37619
|
queuedRenders: renderSemaphore.waitingCount
|
|
37332
37620
|
});
|
|
37333
|
-
return { render:
|
|
37621
|
+
return { render: render3, renderStream, lint, health, outputs, queue };
|
|
37334
37622
|
}
|
|
37335
37623
|
function createProducerApp(options = {}) {
|
|
37336
37624
|
const app = new Hono4();
|
|
@@ -37857,8 +38145,8 @@ async function runDevMode(dir, projectName) {
|
|
|
37857
38145
|
}
|
|
37858
38146
|
});
|
|
37859
38147
|
}
|
|
37860
|
-
return new Promise((
|
|
37861
|
-
child.on("close", () =>
|
|
38148
|
+
return new Promise((resolve40) => {
|
|
38149
|
+
child.on("close", () => resolve40());
|
|
37862
38150
|
});
|
|
37863
38151
|
}
|
|
37864
38152
|
function hasLocalStudio(dir) {
|
|
@@ -37928,8 +38216,8 @@ async function runLocalStudioMode(dir, projectName) {
|
|
|
37928
38216
|
}
|
|
37929
38217
|
});
|
|
37930
38218
|
}
|
|
37931
|
-
return new Promise((
|
|
37932
|
-
child.on("close", () =>
|
|
38219
|
+
return new Promise((resolve40) => {
|
|
38220
|
+
child.on("close", () => resolve40());
|
|
37933
38221
|
});
|
|
37934
38222
|
}
|
|
37935
38223
|
async function runEmbeddedMode(dir, startPort, projectName, forceNew = false) {
|
|
@@ -38602,9 +38890,9 @@ var init_init = __esm({
|
|
|
38602
38890
|
}
|
|
38603
38891
|
if (sourceFilePath2 && !skipTranscribe) {
|
|
38604
38892
|
try {
|
|
38605
|
-
const { ensureWhisper: ensureWhisper2, ensureModel:
|
|
38893
|
+
const { ensureWhisper: ensureWhisper2, ensureModel: ensureModel4 } = await Promise.resolve().then(() => (init_manager(), manager_exports));
|
|
38606
38894
|
await ensureWhisper2();
|
|
38607
|
-
await
|
|
38895
|
+
await ensureModel4(modelFlag);
|
|
38608
38896
|
console.log("Transcribing...");
|
|
38609
38897
|
const { transcribe: runTranscribe } = await Promise.resolve().then(() => (init_transcribe(), transcribe_exports));
|
|
38610
38898
|
const result = await runTranscribe(sourceFilePath2, destDir2, {
|
|
@@ -38747,11 +39035,11 @@ var init_init = __esm({
|
|
|
38747
39035
|
needsInstall ? "Installing whisper-cpp (this may take a moment)..." : "Preparing transcription..."
|
|
38748
39036
|
);
|
|
38749
39037
|
try {
|
|
38750
|
-
const { ensureWhisper: ensureWhisper2, ensureModel:
|
|
39038
|
+
const { ensureWhisper: ensureWhisper2, ensureModel: ensureModel4 } = await Promise.resolve().then(() => (init_manager(), manager_exports));
|
|
38751
39039
|
await ensureWhisper2({
|
|
38752
39040
|
onProgress: (msg) => spin2.message(msg)
|
|
38753
39041
|
});
|
|
38754
|
-
await
|
|
39042
|
+
await ensureModel4(modelFlag, {
|
|
38755
39043
|
onProgress: (msg) => spin2.message(msg)
|
|
38756
39044
|
});
|
|
38757
39045
|
spin2.message("Transcribing audio...");
|
|
@@ -39863,7 +40151,8 @@ function buildDockerRunArgs(input) {
|
|
|
39863
40151
|
...options.gpu ? ["--gpu"] : [],
|
|
39864
40152
|
...options.browserGpu ? [] : ["--no-browser-gpu"],
|
|
39865
40153
|
...options.hdrMode === "force-hdr" ? ["--hdr"] : [],
|
|
39866
|
-
...options.hdrMode === "force-sdr" ? ["--sdr"] : []
|
|
40154
|
+
...options.hdrMode === "force-sdr" ? ["--sdr"] : [],
|
|
40155
|
+
...options.variables && Object.keys(options.variables).length > 0 ? ["--variables", JSON.stringify(options.variables)] : []
|
|
39867
40156
|
];
|
|
39868
40157
|
}
|
|
39869
40158
|
var init_dockerRunArgs = __esm({
|
|
@@ -39872,6 +40161,19 @@ var init_dockerRunArgs = __esm({
|
|
|
39872
40161
|
}
|
|
39873
40162
|
});
|
|
39874
40163
|
|
|
40164
|
+
// src/utils/dom.ts
|
|
40165
|
+
function ensureDOMParser() {
|
|
40166
|
+
if (typeof globalThis.DOMParser === "undefined") {
|
|
40167
|
+
globalThis.DOMParser = DOMParser2;
|
|
40168
|
+
}
|
|
40169
|
+
}
|
|
40170
|
+
var init_dom = __esm({
|
|
40171
|
+
"src/utils/dom.ts"() {
|
|
40172
|
+
"use strict";
|
|
40173
|
+
init_esm10();
|
|
40174
|
+
}
|
|
40175
|
+
});
|
|
40176
|
+
|
|
39875
40177
|
// src/browser/ffmpeg.ts
|
|
39876
40178
|
var ffmpeg_exports = {};
|
|
39877
40179
|
__export(ffmpeg_exports, {
|
|
@@ -39914,13 +40216,104 @@ var render_exports = {};
|
|
|
39914
40216
|
__export(render_exports, {
|
|
39915
40217
|
default: () => render_default,
|
|
39916
40218
|
examples: () => examples7,
|
|
40219
|
+
parseVariablesArg: () => parseVariablesArg,
|
|
39917
40220
|
renderLocal: () => renderLocal,
|
|
39918
|
-
resolveBrowserGpuForCli: () => resolveBrowserGpuForCli
|
|
40221
|
+
resolveBrowserGpuForCli: () => resolveBrowserGpuForCli,
|
|
40222
|
+
resolveVariablesArg: () => resolveVariablesArg,
|
|
40223
|
+
validateVariablesAgainstProject: () => validateVariablesAgainstProject
|
|
39919
40224
|
});
|
|
39920
40225
|
import { mkdirSync as mkdirSync24, readFileSync as readFileSync30, statSync as statSync15, writeFileSync as writeFileSync19, rmSync as rmSync9 } from "fs";
|
|
39921
40226
|
import { cpus as cpus3, freemem as freemem3, tmpdir as tmpdir4 } from "os";
|
|
39922
40227
|
import { resolve as resolve27, dirname as dirname17, join as join43, basename as basename10 } from "path";
|
|
39923
40228
|
import { execFileSync as execFileSync5, spawn as spawn11 } from "child_process";
|
|
40229
|
+
function parseVariablesArg(inline, filePath, readFile = (p) => readFileSync30(resolve27(p), "utf8")) {
|
|
40230
|
+
if (inline != null && filePath != null) {
|
|
40231
|
+
return { ok: false, error: { kind: "conflict" } };
|
|
40232
|
+
}
|
|
40233
|
+
let raw;
|
|
40234
|
+
let source;
|
|
40235
|
+
if (inline != null) {
|
|
40236
|
+
raw = inline;
|
|
40237
|
+
source = "inline";
|
|
40238
|
+
} else if (filePath != null) {
|
|
40239
|
+
try {
|
|
40240
|
+
raw = readFile(filePath);
|
|
40241
|
+
source = "file";
|
|
40242
|
+
} catch (error) {
|
|
40243
|
+
return {
|
|
40244
|
+
ok: false,
|
|
40245
|
+
error: {
|
|
40246
|
+
kind: "read-error",
|
|
40247
|
+
path: filePath,
|
|
40248
|
+
cause: error instanceof Error ? error.message : String(error)
|
|
40249
|
+
}
|
|
40250
|
+
};
|
|
40251
|
+
}
|
|
40252
|
+
}
|
|
40253
|
+
if (raw == null) return { ok: true, value: void 0 };
|
|
40254
|
+
let parsed;
|
|
40255
|
+
try {
|
|
40256
|
+
parsed = JSON.parse(raw);
|
|
40257
|
+
} catch (error) {
|
|
40258
|
+
return {
|
|
40259
|
+
ok: false,
|
|
40260
|
+
error: {
|
|
40261
|
+
kind: "parse-error",
|
|
40262
|
+
source: source ?? "inline",
|
|
40263
|
+
cause: error instanceof Error ? error.message : String(error)
|
|
40264
|
+
}
|
|
40265
|
+
};
|
|
40266
|
+
}
|
|
40267
|
+
if (parsed == null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
40268
|
+
return { ok: false, error: { kind: "shape-error" } };
|
|
40269
|
+
}
|
|
40270
|
+
return { ok: true, value: parsed };
|
|
40271
|
+
}
|
|
40272
|
+
function variablesErrorMessage(error) {
|
|
40273
|
+
switch (error.kind) {
|
|
40274
|
+
case "conflict":
|
|
40275
|
+
return {
|
|
40276
|
+
title: "Conflicting variables flags",
|
|
40277
|
+
message: "Use either --variables or --variables-file, not both."
|
|
40278
|
+
};
|
|
40279
|
+
case "read-error":
|
|
40280
|
+
return {
|
|
40281
|
+
title: "Could not read --variables-file",
|
|
40282
|
+
message: `${error.path}: ${error.cause}`
|
|
40283
|
+
};
|
|
40284
|
+
case "parse-error":
|
|
40285
|
+
return {
|
|
40286
|
+
title: error.source === "file" ? "Invalid JSON in --variables-file" : "Invalid JSON in --variables",
|
|
40287
|
+
message: error.cause
|
|
40288
|
+
};
|
|
40289
|
+
case "shape-error":
|
|
40290
|
+
return {
|
|
40291
|
+
title: "Invalid variables payload",
|
|
40292
|
+
message: 'Variables must be a JSON object (e.g. {"title":"Hello"}).'
|
|
40293
|
+
};
|
|
40294
|
+
}
|
|
40295
|
+
}
|
|
40296
|
+
function resolveVariablesArg(inline, filePath) {
|
|
40297
|
+
const result = parseVariablesArg(inline, filePath);
|
|
40298
|
+
if (!result.ok) {
|
|
40299
|
+
const { title, message } = variablesErrorMessage(result.error);
|
|
40300
|
+
errorBox(title, message);
|
|
40301
|
+
process.exit(1);
|
|
40302
|
+
}
|
|
40303
|
+
return result.value;
|
|
40304
|
+
}
|
|
40305
|
+
function validateVariablesAgainstProject(indexPath, values) {
|
|
40306
|
+
let html;
|
|
40307
|
+
try {
|
|
40308
|
+
html = readFileSync30(indexPath, "utf8");
|
|
40309
|
+
} catch {
|
|
40310
|
+
return [];
|
|
40311
|
+
}
|
|
40312
|
+
ensureDOMParser();
|
|
40313
|
+
const meta = extractCompositionMetadata(html);
|
|
40314
|
+
if (meta.variables.length === 0) return [];
|
|
40315
|
+
return validateVariables(values, meta.variables);
|
|
40316
|
+
}
|
|
39924
40317
|
function resolveBrowserGpuForCli(useDocker, browserGpuArg, envMode = process.env.PRODUCER_BROWSER_GPU_MODE) {
|
|
39925
40318
|
if (useDocker) return false;
|
|
39926
40319
|
if (browserGpuArg !== void 0) return browserGpuArg;
|
|
@@ -40022,7 +40415,8 @@ async function renderDocker(projectDir, outputPath, options) {
|
|
|
40022
40415
|
hdrMode: options.hdrMode,
|
|
40023
40416
|
crf: options.crf,
|
|
40024
40417
|
videoBitrate: options.videoBitrate,
|
|
40025
|
-
quiet: options.quiet
|
|
40418
|
+
quiet: options.quiet,
|
|
40419
|
+
variables: options.variables
|
|
40026
40420
|
}
|
|
40027
40421
|
});
|
|
40028
40422
|
if (!options.quiet) {
|
|
@@ -40055,6 +40449,7 @@ async function renderDocker(projectDir, outputPath, options) {
|
|
|
40055
40449
|
...getMemorySnapshot()
|
|
40056
40450
|
});
|
|
40057
40451
|
printRenderComplete(outputPath, elapsed, options.quiet);
|
|
40452
|
+
if (options.exitAfterComplete) scheduleRenderProcessExit();
|
|
40058
40453
|
}
|
|
40059
40454
|
async function renderLocal(projectDir, outputPath, options) {
|
|
40060
40455
|
const producer = await loadProducer();
|
|
@@ -40073,7 +40468,8 @@ async function renderLocal(projectDir, outputPath, options) {
|
|
|
40073
40468
|
}),
|
|
40074
40469
|
hdrMode: options.hdrMode,
|
|
40075
40470
|
crf: options.crf,
|
|
40076
|
-
videoBitrate: options.videoBitrate
|
|
40471
|
+
videoBitrate: options.videoBitrate,
|
|
40472
|
+
variables: options.variables
|
|
40077
40473
|
});
|
|
40078
40474
|
const onProgress = options.quiet ? void 0 : (progressJob, message) => {
|
|
40079
40475
|
renderProgress(progressJob.progress, message);
|
|
@@ -40086,6 +40482,14 @@ async function renderLocal(projectDir, outputPath, options) {
|
|
|
40086
40482
|
const elapsed = Date.now() - startTime;
|
|
40087
40483
|
trackRenderMetrics(job, elapsed, options, false);
|
|
40088
40484
|
printRenderComplete(outputPath, elapsed, options.quiet);
|
|
40485
|
+
if (options.exitAfterComplete) scheduleRenderProcessExit();
|
|
40486
|
+
}
|
|
40487
|
+
function isUnrefableTimer(timer) {
|
|
40488
|
+
return typeof timer === "object" && timer !== null && "unref" in timer && typeof timer.unref === "function";
|
|
40489
|
+
}
|
|
40490
|
+
function scheduleRenderProcessExit() {
|
|
40491
|
+
const timer = setTimeout(() => process.exit(0), 100);
|
|
40492
|
+
if (isUnrefableTimer(timer)) timer.unref();
|
|
40089
40493
|
}
|
|
40090
40494
|
function getMemorySnapshot() {
|
|
40091
40495
|
return {
|
|
@@ -40177,6 +40581,8 @@ var init_render2 = __esm({
|
|
|
40177
40581
|
init_version();
|
|
40178
40582
|
init_env();
|
|
40179
40583
|
init_dockerRunArgs();
|
|
40584
|
+
init_dom();
|
|
40585
|
+
init_src();
|
|
40180
40586
|
examples7 = [
|
|
40181
40587
|
["Render to MP4", "hyperframes render --output output.mp4"],
|
|
40182
40588
|
["Render transparent overlay (ProRes)", "hyperframes render --format mov --output overlay.mov"],
|
|
@@ -40185,7 +40591,15 @@ var init_render2 = __esm({
|
|
|
40185
40591
|
["Deterministic render via Docker", "hyperframes render --docker --output deterministic.mp4"],
|
|
40186
40592
|
["Parallel rendering with 6 workers", "hyperframes render --workers 6 --output fast.mp4"],
|
|
40187
40593
|
["Opt out of browser GPU render", "hyperframes render --no-browser-gpu --output cpu.mp4"],
|
|
40188
|
-
["HDR output (auto-detected)", "hyperframes render --output hdr-output.mp4"]
|
|
40594
|
+
["HDR output (auto-detected)", "hyperframes render --output hdr-output.mp4"],
|
|
40595
|
+
[
|
|
40596
|
+
"Override composition variables (parametrized render)",
|
|
40597
|
+
`hyperframes render --variables '{"title":"Q4 Report","theme":"dark"}' --output q4.mp4`
|
|
40598
|
+
],
|
|
40599
|
+
[
|
|
40600
|
+
"Variables from a JSON file",
|
|
40601
|
+
"hyperframes render --variables-file ./vars.json --output out.mp4"
|
|
40602
|
+
]
|
|
40189
40603
|
];
|
|
40190
40604
|
VALID_FPS = /* @__PURE__ */ new Set([24, 30, 60]);
|
|
40191
40605
|
VALID_QUALITY = /* @__PURE__ */ new Set(["draft", "standard", "high"]);
|
|
@@ -40276,6 +40690,19 @@ var init_render2 = __esm({
|
|
|
40276
40690
|
"max-concurrent-renders": {
|
|
40277
40691
|
type: "string",
|
|
40278
40692
|
description: "Max concurrent renders when using the producer server (1-10). Default: 2."
|
|
40693
|
+
},
|
|
40694
|
+
variables: {
|
|
40695
|
+
type: "string",
|
|
40696
|
+
description: `JSON object of variable values, merged over the composition's data-composition-variables defaults. Example: --variables '{"title":"Hello"}'. Read inside the composition via window.__hyperframes.getVariables().`
|
|
40697
|
+
},
|
|
40698
|
+
"variables-file": {
|
|
40699
|
+
type: "string",
|
|
40700
|
+
description: "Path to a JSON file with variable values (alternative to --variables). The file must contain a single JSON object."
|
|
40701
|
+
},
|
|
40702
|
+
"strict-variables": {
|
|
40703
|
+
type: "boolean",
|
|
40704
|
+
description: "Fail render if any --variables key is undeclared or has a wrong type vs the composition's data-composition-variables. Without this flag, mismatches are warnings.",
|
|
40705
|
+
default: false
|
|
40279
40706
|
}
|
|
40280
40707
|
},
|
|
40281
40708
|
async run({ args }) {
|
|
@@ -40442,6 +40869,32 @@ var init_render2 = __esm({
|
|
|
40442
40869
|
console.error("Error: --hdr and --sdr are mutually exclusive.");
|
|
40443
40870
|
process.exit(1);
|
|
40444
40871
|
}
|
|
40872
|
+
const variables = resolveVariablesArg(args.variables, args["variables-file"]);
|
|
40873
|
+
const strictVariables = args["strict-variables"] ?? false;
|
|
40874
|
+
if (variables && Object.keys(variables).length > 0) {
|
|
40875
|
+
const issues = validateVariablesAgainstProject(project.indexPath, variables);
|
|
40876
|
+
if (issues.length > 0) {
|
|
40877
|
+
if (!quiet) {
|
|
40878
|
+
console.log("");
|
|
40879
|
+
console.log(
|
|
40880
|
+
c.warn(
|
|
40881
|
+
`Variable ${issues.length === 1 ? "issue" : "issues"} (${issues.length}) \u2014 values may not render as expected:`
|
|
40882
|
+
)
|
|
40883
|
+
);
|
|
40884
|
+
for (const issue of issues) {
|
|
40885
|
+
console.log(" " + c.dim(formatVariableValidationIssue(issue)));
|
|
40886
|
+
}
|
|
40887
|
+
console.log("");
|
|
40888
|
+
}
|
|
40889
|
+
if (strictVariables) {
|
|
40890
|
+
console.log(
|
|
40891
|
+
c.error(" Aborting render due to variable issues (--strict-variables mode).")
|
|
40892
|
+
);
|
|
40893
|
+
console.log("");
|
|
40894
|
+
process.exit(1);
|
|
40895
|
+
}
|
|
40896
|
+
}
|
|
40897
|
+
}
|
|
40445
40898
|
if (useDocker) {
|
|
40446
40899
|
await renderDocker(project.dir, outputPath, {
|
|
40447
40900
|
fps,
|
|
@@ -40453,7 +40906,9 @@ var init_render2 = __esm({
|
|
|
40453
40906
|
hdrMode: args.sdr ? "force-sdr" : args.hdr ? "force-hdr" : "auto",
|
|
40454
40907
|
crf,
|
|
40455
40908
|
videoBitrate,
|
|
40456
|
-
quiet
|
|
40909
|
+
quiet,
|
|
40910
|
+
variables,
|
|
40911
|
+
exitAfterComplete: true
|
|
40457
40912
|
});
|
|
40458
40913
|
} else {
|
|
40459
40914
|
await renderLocal(project.dir, outputPath, {
|
|
@@ -40467,7 +40922,9 @@ var init_render2 = __esm({
|
|
|
40467
40922
|
crf,
|
|
40468
40923
|
videoBitrate,
|
|
40469
40924
|
quiet,
|
|
40470
|
-
browserPath
|
|
40925
|
+
browserPath,
|
|
40926
|
+
variables,
|
|
40927
|
+
exitAfterComplete: true
|
|
40471
40928
|
});
|
|
40472
40929
|
}
|
|
40473
40930
|
}
|
|
@@ -40924,7 +41381,7 @@ async function seekTo(page, time) {
|
|
|
40924
41381
|
if (!fonts?.ready) return Promise.resolve();
|
|
40925
41382
|
return Promise.race([
|
|
40926
41383
|
fonts.ready.then(() => void 0),
|
|
40927
|
-
new Promise((
|
|
41384
|
+
new Promise((resolve40) => setTimeout(resolve40, 500))
|
|
40928
41385
|
]);
|
|
40929
41386
|
}).catch(() => {
|
|
40930
41387
|
});
|
|
@@ -41001,7 +41458,7 @@ async function runLayoutAudit(projectDir, opts) {
|
|
|
41001
41458
|
if (!fonts?.ready) return Promise.resolve();
|
|
41002
41459
|
return Promise.race([
|
|
41003
41460
|
fonts.ready.then(() => void 0),
|
|
41004
|
-
new Promise((
|
|
41461
|
+
new Promise((resolve40) => setTimeout(resolve40, 750))
|
|
41005
41462
|
]);
|
|
41006
41463
|
}).catch(() => {
|
|
41007
41464
|
});
|
|
@@ -41241,19 +41698,6 @@ var init_inspect = __esm({
|
|
|
41241
41698
|
}
|
|
41242
41699
|
});
|
|
41243
41700
|
|
|
41244
|
-
// src/utils/dom.ts
|
|
41245
|
-
function ensureDOMParser() {
|
|
41246
|
-
if (typeof globalThis.DOMParser === "undefined") {
|
|
41247
|
-
globalThis.DOMParser = DOMParser2;
|
|
41248
|
-
}
|
|
41249
|
-
}
|
|
41250
|
-
var init_dom = __esm({
|
|
41251
|
-
"src/utils/dom.ts"() {
|
|
41252
|
-
"use strict";
|
|
41253
|
-
init_esm10();
|
|
41254
|
-
}
|
|
41255
|
-
});
|
|
41256
|
-
|
|
41257
41701
|
// src/commands/info.ts
|
|
41258
41702
|
var info_exports = {};
|
|
41259
41703
|
__export(info_exports, {
|
|
@@ -41831,14 +42275,619 @@ Run ${c.accent("hyperframes browser --help")} for usage.`
|
|
|
41831
42275
|
}
|
|
41832
42276
|
});
|
|
41833
42277
|
|
|
42278
|
+
// src/background-removal/manager.ts
|
|
42279
|
+
var manager_exports3 = {};
|
|
42280
|
+
__export(manager_exports3, {
|
|
42281
|
+
DEFAULT_MODEL: () => DEFAULT_MODEL2,
|
|
42282
|
+
DEVICES: () => DEVICES,
|
|
42283
|
+
MODELS_DIR: () => MODELS_DIR2,
|
|
42284
|
+
MODEL_MEMORY_MB: () => MODEL_MEMORY_MB,
|
|
42285
|
+
ensureModel: () => ensureModel2,
|
|
42286
|
+
isDevice: () => isDevice,
|
|
42287
|
+
listAvailableProviders: () => listAvailableProviders,
|
|
42288
|
+
modelPath: () => modelPath,
|
|
42289
|
+
selectProviders: () => selectProviders
|
|
42290
|
+
});
|
|
42291
|
+
import { existsSync as existsSync47, mkdirSync as mkdirSync25 } from "fs";
|
|
42292
|
+
import { homedir as homedir8, platform as platform4, arch } from "os";
|
|
42293
|
+
import { join as join47 } from "path";
|
|
42294
|
+
function isDevice(value) {
|
|
42295
|
+
return typeof value === "string" && DEVICES.includes(value);
|
|
42296
|
+
}
|
|
42297
|
+
function selectProviders(device = "auto") {
|
|
42298
|
+
if (device === "cpu") return { providers: ["cpu"], label: "CPU" };
|
|
42299
|
+
const available = listAvailableProviders();
|
|
42300
|
+
const hasCoreML = available.includes("coreml");
|
|
42301
|
+
const hasCUDA = available.includes("cuda");
|
|
42302
|
+
if (device === "coreml") {
|
|
42303
|
+
if (!hasCoreML) {
|
|
42304
|
+
throw new Error(
|
|
42305
|
+
"CoreML execution provider not available. Install onnxruntime-node on Apple Silicon, or use --device cpu."
|
|
42306
|
+
);
|
|
42307
|
+
}
|
|
42308
|
+
return { providers: ["coreml", "cpu"], label: "CoreML" };
|
|
42309
|
+
}
|
|
42310
|
+
if (device === "cuda") {
|
|
42311
|
+
if (!hasCUDA) {
|
|
42312
|
+
throw new Error(
|
|
42313
|
+
"CUDA execution provider not available. Use --device cpu or install an onnxruntime-node build with CUDA support."
|
|
42314
|
+
);
|
|
42315
|
+
}
|
|
42316
|
+
return { providers: ["cuda", "cpu"], label: "CUDA" };
|
|
42317
|
+
}
|
|
42318
|
+
if (hasCoreML && platform4() === "darwin" && arch() === "arm64") {
|
|
42319
|
+
return { providers: ["coreml", "cpu"], label: "CoreML" };
|
|
42320
|
+
}
|
|
42321
|
+
if (hasCUDA) return { providers: ["cuda", "cpu"], label: "CUDA" };
|
|
42322
|
+
return { providers: ["cpu"], label: "CPU" };
|
|
42323
|
+
}
|
|
42324
|
+
function listAvailableProviders() {
|
|
42325
|
+
if (_cachedProviders) return _cachedProviders;
|
|
42326
|
+
const out = ["cpu"];
|
|
42327
|
+
if (platform4() === "darwin" && arch() === "arm64") out.push("coreml");
|
|
42328
|
+
if (process.env["HYPERFRAMES_CUDA"] === "1") out.push("cuda");
|
|
42329
|
+
_cachedProviders = out;
|
|
42330
|
+
return out;
|
|
42331
|
+
}
|
|
42332
|
+
function modelPath(model = DEFAULT_MODEL2) {
|
|
42333
|
+
return join47(MODELS_DIR2, `${model}.onnx`);
|
|
42334
|
+
}
|
|
42335
|
+
async function ensureModel2(model = DEFAULT_MODEL2, options) {
|
|
42336
|
+
const dest = modelPath(model);
|
|
42337
|
+
if (existsSync47(dest)) return dest;
|
|
42338
|
+
mkdirSync25(MODELS_DIR2, { recursive: true });
|
|
42339
|
+
options?.onProgress?.(`Downloading ${model} weights (~168 MB)...`);
|
|
42340
|
+
await downloadFile(MODEL_URLS[model], dest);
|
|
42341
|
+
if (!existsSync47(dest)) {
|
|
42342
|
+
throw new Error(`Model download failed: ${model}`);
|
|
42343
|
+
}
|
|
42344
|
+
return dest;
|
|
42345
|
+
}
|
|
42346
|
+
var MODELS_DIR2, DEFAULT_MODEL2, MODEL_URLS, MODEL_MEMORY_MB, DEVICES, _cachedProviders;
|
|
42347
|
+
var init_manager3 = __esm({
|
|
42348
|
+
"src/background-removal/manager.ts"() {
|
|
42349
|
+
"use strict";
|
|
42350
|
+
init_download();
|
|
42351
|
+
MODELS_DIR2 = join47(homedir8(), ".cache", "hyperframes", "background-removal", "models");
|
|
42352
|
+
DEFAULT_MODEL2 = "u2net_human_seg";
|
|
42353
|
+
MODEL_URLS = {
|
|
42354
|
+
u2net_human_seg: "https://github.com/danielgatis/rembg/releases/download/v0.0.0/u2net_human_seg.onnx"
|
|
42355
|
+
};
|
|
42356
|
+
MODEL_MEMORY_MB = {
|
|
42357
|
+
u2net_human_seg: 1500
|
|
42358
|
+
};
|
|
42359
|
+
DEVICES = ["auto", "cpu", "coreml", "cuda"];
|
|
42360
|
+
}
|
|
42361
|
+
});
|
|
42362
|
+
|
|
42363
|
+
// src/background-removal/inference.ts
|
|
42364
|
+
async function createSession(options = {}) {
|
|
42365
|
+
const ort = await import("onnxruntime-node");
|
|
42366
|
+
const sharpMod = await import("sharp");
|
|
42367
|
+
const sharp = sharpMod.default;
|
|
42368
|
+
const choice = selectProviders(options.device ?? "auto");
|
|
42369
|
+
const path2 = await ensureModel2(options.model, { onProgress: options.onProgress });
|
|
42370
|
+
options.onProgress?.(`Loading model on ${choice.label}...`);
|
|
42371
|
+
const tryCreate = (providers) => ort.InferenceSession.create(path2, {
|
|
42372
|
+
executionProviders: providers,
|
|
42373
|
+
graphOptimizationLevel: "all"
|
|
42374
|
+
});
|
|
42375
|
+
let session;
|
|
42376
|
+
let providerUsed = choice.label;
|
|
42377
|
+
try {
|
|
42378
|
+
session = await tryCreate(choice.providers);
|
|
42379
|
+
} catch (err) {
|
|
42380
|
+
if (choice.providers[0] === "cpu") throw err;
|
|
42381
|
+
options.onProgress?.(
|
|
42382
|
+
`${choice.label} provider failed (${err.message}); falling back to CPU.`
|
|
42383
|
+
);
|
|
42384
|
+
session = await tryCreate(["cpu"]);
|
|
42385
|
+
providerUsed = "CPU";
|
|
42386
|
+
}
|
|
42387
|
+
const inputName = session.inputNames[0];
|
|
42388
|
+
const outputName = session.outputNames[0];
|
|
42389
|
+
if (!inputName || !outputName) {
|
|
42390
|
+
throw new Error("ONNX session is missing input or output bindings");
|
|
42391
|
+
}
|
|
42392
|
+
const inputData = new Float32Array(3 * INPUT_PLANE);
|
|
42393
|
+
const maskBuf = Buffer.allocUnsafe(INPUT_PLANE);
|
|
42394
|
+
let rgbaBuf = null;
|
|
42395
|
+
return {
|
|
42396
|
+
provider: providerUsed,
|
|
42397
|
+
async process(rgb2, width, height) {
|
|
42398
|
+
const tensor = await preprocess(sharp, ort, rgb2, width, height, inputData);
|
|
42399
|
+
const outputs = await session.run({ [inputName]: tensor });
|
|
42400
|
+
const output = outputs[outputName];
|
|
42401
|
+
if (!output) throw new Error(`Model did not return output '${outputName}'`);
|
|
42402
|
+
const expectedBytes = width * height * 4;
|
|
42403
|
+
if (!rgbaBuf || rgbaBuf.length !== expectedBytes) {
|
|
42404
|
+
rgbaBuf = Buffer.allocUnsafe(expectedBytes);
|
|
42405
|
+
}
|
|
42406
|
+
return await postprocess(sharp, output, rgb2, width, height, maskBuf, rgbaBuf);
|
|
42407
|
+
},
|
|
42408
|
+
async close() {
|
|
42409
|
+
await session.release();
|
|
42410
|
+
}
|
|
42411
|
+
};
|
|
42412
|
+
}
|
|
42413
|
+
async function preprocess(sharp, ort, rgb2, width, height, inputData) {
|
|
42414
|
+
const resized = await sharp(rgb2, { raw: { width, height, channels: 3 } }).resize(INPUT_SIZE, INPUT_SIZE, { kernel: "lanczos3", fit: "fill" }).raw().toBuffer();
|
|
42415
|
+
let maxPixel = 0;
|
|
42416
|
+
for (let i2 = 0; i2 < resized.length; i2++) {
|
|
42417
|
+
if (resized[i2] > maxPixel) maxPixel = resized[i2];
|
|
42418
|
+
}
|
|
42419
|
+
if (maxPixel === 0) maxPixel = 1;
|
|
42420
|
+
for (let y2 = 0; y2 < INPUT_SIZE; y2++) {
|
|
42421
|
+
for (let x4 = 0; x4 < INPUT_SIZE; x4++) {
|
|
42422
|
+
const src = (y2 * INPUT_SIZE + x4) * 3;
|
|
42423
|
+
const dst = y2 * INPUT_SIZE + x4;
|
|
42424
|
+
inputData[dst] = (resized[src] / maxPixel - MEAN[0]) / STD[0];
|
|
42425
|
+
inputData[INPUT_PLANE + dst] = (resized[src + 1] / maxPixel - MEAN[1]) / STD[1];
|
|
42426
|
+
inputData[2 * INPUT_PLANE + dst] = (resized[src + 2] / maxPixel - MEAN[2]) / STD[2];
|
|
42427
|
+
}
|
|
42428
|
+
}
|
|
42429
|
+
return new ort.Tensor("float32", inputData, [1, 3, INPUT_SIZE, INPUT_SIZE]);
|
|
42430
|
+
}
|
|
42431
|
+
async function postprocess(sharp, output, rgb2, width, height, maskBuf, rgbaBuf) {
|
|
42432
|
+
const raw = output.data;
|
|
42433
|
+
let lo = Infinity;
|
|
42434
|
+
let hi = -Infinity;
|
|
42435
|
+
for (let i2 = 0; i2 < INPUT_PLANE; i2++) {
|
|
42436
|
+
const v = raw[i2];
|
|
42437
|
+
if (v < lo) lo = v;
|
|
42438
|
+
if (v > hi) hi = v;
|
|
42439
|
+
}
|
|
42440
|
+
const range = hi - lo || 1;
|
|
42441
|
+
for (let i2 = 0; i2 < INPUT_PLANE; i2++) {
|
|
42442
|
+
const norm = (raw[i2] - lo) / range;
|
|
42443
|
+
maskBuf[i2] = Math.max(0, Math.min(255, Math.round(norm * 255)));
|
|
42444
|
+
}
|
|
42445
|
+
const fullMask = await sharp(maskBuf, {
|
|
42446
|
+
raw: { width: INPUT_SIZE, height: INPUT_SIZE, channels: 1 }
|
|
42447
|
+
}).resize(width, height, { kernel: "lanczos3", fit: "fill" }).raw().toBuffer();
|
|
42448
|
+
for (let i2 = 0; i2 < width * height; i2++) {
|
|
42449
|
+
rgbaBuf[i2 * 4] = rgb2[i2 * 3];
|
|
42450
|
+
rgbaBuf[i2 * 4 + 1] = rgb2[i2 * 3 + 1];
|
|
42451
|
+
rgbaBuf[i2 * 4 + 2] = rgb2[i2 * 3 + 2];
|
|
42452
|
+
rgbaBuf[i2 * 4 + 3] = fullMask[i2];
|
|
42453
|
+
}
|
|
42454
|
+
return rgbaBuf;
|
|
42455
|
+
}
|
|
42456
|
+
var INPUT_SIZE, INPUT_PLANE, MEAN, STD;
|
|
42457
|
+
var init_inference = __esm({
|
|
42458
|
+
"src/background-removal/inference.ts"() {
|
|
42459
|
+
"use strict";
|
|
42460
|
+
init_manager3();
|
|
42461
|
+
INPUT_SIZE = 320;
|
|
42462
|
+
INPUT_PLANE = INPUT_SIZE * INPUT_SIZE;
|
|
42463
|
+
MEAN = [0.485, 0.456, 0.406];
|
|
42464
|
+
STD = [0.229, 0.224, 0.225];
|
|
42465
|
+
}
|
|
42466
|
+
});
|
|
42467
|
+
|
|
42468
|
+
// src/background-removal/pipeline.ts
|
|
42469
|
+
var pipeline_exports = {};
|
|
42470
|
+
__export(pipeline_exports, {
|
|
42471
|
+
buildEncoderArgs: () => buildEncoderArgs2,
|
|
42472
|
+
inferInputKind: () => inferInputKind,
|
|
42473
|
+
inferOutputFormat: () => inferOutputFormat,
|
|
42474
|
+
render: () => render2,
|
|
42475
|
+
waitForExit: () => waitForExit
|
|
42476
|
+
});
|
|
42477
|
+
import { spawn as spawn12 } from "child_process";
|
|
42478
|
+
import { extname as extname8 } from "path";
|
|
42479
|
+
function inferOutputFormat(outputPath) {
|
|
42480
|
+
const ext = extname8(outputPath).toLowerCase();
|
|
42481
|
+
if (ext === ".webm") return "webm";
|
|
42482
|
+
if (ext === ".mov") return "mov";
|
|
42483
|
+
if (ext === ".png") return "png";
|
|
42484
|
+
throw new Error(
|
|
42485
|
+
`Unsupported output extension: ${ext}. Use .webm (VP9 alpha), .mov (ProRes 4444), or .png.`
|
|
42486
|
+
);
|
|
42487
|
+
}
|
|
42488
|
+
function inferInputKind(inputPath) {
|
|
42489
|
+
const ext = extname8(inputPath).toLowerCase();
|
|
42490
|
+
if (VIDEO_EXTENSIONS2.has(ext)) return "video";
|
|
42491
|
+
if (IMAGE_EXTENSIONS.has(ext)) return "image";
|
|
42492
|
+
throw new Error(
|
|
42493
|
+
`Unsupported input: ${ext}. Use a video (mp4/mov/webm/mkv/avi) or image (jpg/png/webp).`
|
|
42494
|
+
);
|
|
42495
|
+
}
|
|
42496
|
+
async function probeMedia(inputPath) {
|
|
42497
|
+
const isImage = inferInputKind(inputPath) === "image";
|
|
42498
|
+
const engine = await Promise.resolve().then(() => (init_src2(), src_exports2));
|
|
42499
|
+
const meta = await engine.extractMediaMetadata(inputPath);
|
|
42500
|
+
if (isImage) {
|
|
42501
|
+
return { width: meta.width, height: meta.height, fps: 0, frameCount: 1 };
|
|
42502
|
+
}
|
|
42503
|
+
const fps = meta.fps || 30;
|
|
42504
|
+
const frameCount = meta.durationSeconds ? Math.round(meta.durationSeconds * fps) : 0;
|
|
42505
|
+
return { width: meta.width, height: meta.height, fps, frameCount };
|
|
42506
|
+
}
|
|
42507
|
+
function buildEncoderArgs2(format, width, height, fps, outputPath) {
|
|
42508
|
+
const base = [
|
|
42509
|
+
"-y",
|
|
42510
|
+
"-f",
|
|
42511
|
+
"rawvideo",
|
|
42512
|
+
"-pix_fmt",
|
|
42513
|
+
"rgba",
|
|
42514
|
+
"-s",
|
|
42515
|
+
`${width}x${height}`,
|
|
42516
|
+
"-r",
|
|
42517
|
+
String(fps || 30),
|
|
42518
|
+
"-i",
|
|
42519
|
+
"-"
|
|
42520
|
+
];
|
|
42521
|
+
if (format === "webm") {
|
|
42522
|
+
return [
|
|
42523
|
+
...base,
|
|
42524
|
+
"-c:v",
|
|
42525
|
+
"libvpx-vp9",
|
|
42526
|
+
"-b:v",
|
|
42527
|
+
"0",
|
|
42528
|
+
"-crf",
|
|
42529
|
+
"30",
|
|
42530
|
+
"-deadline",
|
|
42531
|
+
"good",
|
|
42532
|
+
"-row-mt",
|
|
42533
|
+
"1",
|
|
42534
|
+
"-auto-alt-ref",
|
|
42535
|
+
"0",
|
|
42536
|
+
"-pix_fmt",
|
|
42537
|
+
"yuva420p",
|
|
42538
|
+
"-metadata:s:v:0",
|
|
42539
|
+
"alpha_mode=1",
|
|
42540
|
+
"-an",
|
|
42541
|
+
outputPath
|
|
42542
|
+
];
|
|
42543
|
+
}
|
|
42544
|
+
if (format === "mov") {
|
|
42545
|
+
return [
|
|
42546
|
+
...base,
|
|
42547
|
+
"-c:v",
|
|
42548
|
+
"prores_ks",
|
|
42549
|
+
"-profile:v",
|
|
42550
|
+
"4444",
|
|
42551
|
+
"-vendor",
|
|
42552
|
+
"apl0",
|
|
42553
|
+
"-pix_fmt",
|
|
42554
|
+
"yuva444p10le",
|
|
42555
|
+
"-an",
|
|
42556
|
+
outputPath
|
|
42557
|
+
];
|
|
42558
|
+
}
|
|
42559
|
+
return [...base, "-frames:v", "1", "-pix_fmt", "rgba", "-update", "1", outputPath];
|
|
42560
|
+
}
|
|
42561
|
+
async function* readFrames(stream, frameBytes) {
|
|
42562
|
+
let buffered = Buffer.alloc(0);
|
|
42563
|
+
for await (const chunk of stream) {
|
|
42564
|
+
buffered = buffered.length === 0 ? chunk : Buffer.concat([buffered, chunk]);
|
|
42565
|
+
while (buffered.length >= frameBytes) {
|
|
42566
|
+
yield Buffer.from(buffered.subarray(0, frameBytes));
|
|
42567
|
+
buffered = buffered.subarray(frameBytes);
|
|
42568
|
+
}
|
|
42569
|
+
}
|
|
42570
|
+
}
|
|
42571
|
+
async function render2(options) {
|
|
42572
|
+
if (!hasFFmpeg() || !hasFFprobe()) {
|
|
42573
|
+
throw new Error("ffmpeg and ffprobe are required. Install: brew install ffmpeg");
|
|
42574
|
+
}
|
|
42575
|
+
const format = inferOutputFormat(options.outputPath);
|
|
42576
|
+
const inputKind = inferInputKind(options.inputPath);
|
|
42577
|
+
if (inputKind === "image" && format !== "png") {
|
|
42578
|
+
throw new Error(
|
|
42579
|
+
`Image input requires a .png output (got ${extname8(options.outputPath)}). Use a video input for .webm/.mov.`
|
|
42580
|
+
);
|
|
42581
|
+
}
|
|
42582
|
+
if (inputKind === "video" && format === "png") {
|
|
42583
|
+
throw new Error(
|
|
42584
|
+
`Video input requires a .webm or .mov output (got .png). Use an image input for .png.`
|
|
42585
|
+
);
|
|
42586
|
+
}
|
|
42587
|
+
const media = await probeMedia(options.inputPath);
|
|
42588
|
+
options.onProgress?.({
|
|
42589
|
+
kind: "metadata",
|
|
42590
|
+
width: media.width,
|
|
42591
|
+
height: media.height,
|
|
42592
|
+
fps: media.fps,
|
|
42593
|
+
frameCount: media.frameCount
|
|
42594
|
+
});
|
|
42595
|
+
const session = await createSession({
|
|
42596
|
+
model: options.model,
|
|
42597
|
+
device: options.device,
|
|
42598
|
+
onProgress: (msg) => options.onProgress?.({ kind: "info", message: msg })
|
|
42599
|
+
});
|
|
42600
|
+
try {
|
|
42601
|
+
const start = Date.now();
|
|
42602
|
+
const framesProcessed = await runPipeline(options, session, media, format);
|
|
42603
|
+
const durationSeconds = (Date.now() - start) / 1e3;
|
|
42604
|
+
const avgMsPerFrame = framesProcessed ? durationSeconds * 1e3 / framesProcessed : 0;
|
|
42605
|
+
return {
|
|
42606
|
+
outputPath: options.outputPath,
|
|
42607
|
+
framesProcessed,
|
|
42608
|
+
durationSeconds,
|
|
42609
|
+
avgMsPerFrame,
|
|
42610
|
+
provider: session.provider,
|
|
42611
|
+
format
|
|
42612
|
+
};
|
|
42613
|
+
} finally {
|
|
42614
|
+
await session.close();
|
|
42615
|
+
}
|
|
42616
|
+
}
|
|
42617
|
+
async function runPipeline(options, session, media, format) {
|
|
42618
|
+
const { inputPath, outputPath } = options;
|
|
42619
|
+
const { width, height, fps, frameCount } = media;
|
|
42620
|
+
const frameBytes = width * height * 3;
|
|
42621
|
+
const decoder = spawn12(
|
|
42622
|
+
"ffmpeg",
|
|
42623
|
+
["-loglevel", "error", "-i", inputPath, "-f", "rawvideo", "-pix_fmt", "rgb24", "-an", "-"],
|
|
42624
|
+
{ stdio: ["ignore", "pipe", "pipe"] }
|
|
42625
|
+
);
|
|
42626
|
+
let decoderStderr = "";
|
|
42627
|
+
decoder.stderr?.on("data", (d) => {
|
|
42628
|
+
decoderStderr += d.toString();
|
|
42629
|
+
});
|
|
42630
|
+
const decoderExit = waitForExit(decoder, "ffmpeg decoder", () => decoderStderr);
|
|
42631
|
+
const encoder = spawn12("ffmpeg", buildEncoderArgs2(format, width, height, fps || 30, outputPath), {
|
|
42632
|
+
stdio: ["pipe", "ignore", "pipe"]
|
|
42633
|
+
});
|
|
42634
|
+
let encoderStderr = "";
|
|
42635
|
+
encoder.stderr?.on("data", (d) => {
|
|
42636
|
+
encoderStderr += d.toString();
|
|
42637
|
+
});
|
|
42638
|
+
const encoderExit = waitForExit(encoder, "ffmpeg encoder", () => encoderStderr);
|
|
42639
|
+
let processed = 0;
|
|
42640
|
+
const total = frameCount;
|
|
42641
|
+
const recentMs = new Array(RECENT_WINDOW).fill(0);
|
|
42642
|
+
let recentSum = 0;
|
|
42643
|
+
let recentSlot = 0;
|
|
42644
|
+
let recentCount = 0;
|
|
42645
|
+
try {
|
|
42646
|
+
for await (const rgb2 of readFrames(decoder.stdout, frameBytes)) {
|
|
42647
|
+
const t0 = Date.now();
|
|
42648
|
+
const rgba = await session.process(rgb2, width, height);
|
|
42649
|
+
const elapsed = Date.now() - t0;
|
|
42650
|
+
recentSum += elapsed - recentMs[recentSlot];
|
|
42651
|
+
recentMs[recentSlot] = elapsed;
|
|
42652
|
+
recentSlot = (recentSlot + 1) % RECENT_WINDOW;
|
|
42653
|
+
if (recentCount < RECENT_WINDOW) recentCount++;
|
|
42654
|
+
if (!encoder.stdin.write(rgba)) {
|
|
42655
|
+
await new Promise((resolve40) => encoder.stdin.once("drain", () => resolve40()));
|
|
42656
|
+
}
|
|
42657
|
+
processed++;
|
|
42658
|
+
options.onProgress?.({
|
|
42659
|
+
kind: "frame",
|
|
42660
|
+
index: processed,
|
|
42661
|
+
total,
|
|
42662
|
+
avgMsPerFrame: recentSum / recentCount
|
|
42663
|
+
});
|
|
42664
|
+
}
|
|
42665
|
+
} catch (err) {
|
|
42666
|
+
decoder.kill("SIGKILL");
|
|
42667
|
+
encoder.kill("SIGKILL");
|
|
42668
|
+
throw err;
|
|
42669
|
+
}
|
|
42670
|
+
encoder.stdin.end();
|
|
42671
|
+
await Promise.all([decoderExit, encoderExit]);
|
|
42672
|
+
if (processed === 0) {
|
|
42673
|
+
throw new Error(
|
|
42674
|
+
`No frames produced from ${inputPath}. Decoder stderr:
|
|
42675
|
+
${decoderStderr.slice(-400)}`
|
|
42676
|
+
);
|
|
42677
|
+
}
|
|
42678
|
+
return processed;
|
|
42679
|
+
}
|
|
42680
|
+
function waitForExit(proc, label2, getStderr) {
|
|
42681
|
+
return new Promise((resolve40, reject) => {
|
|
42682
|
+
proc.on("error", reject);
|
|
42683
|
+
proc.on("exit", (code, signal) => {
|
|
42684
|
+
if (code === 0 && !signal) {
|
|
42685
|
+
resolve40();
|
|
42686
|
+
return;
|
|
42687
|
+
}
|
|
42688
|
+
const cause = signal ? `killed by ${signal}` : `exited with code ${code}`;
|
|
42689
|
+
reject(new Error(`${label2} ${cause}: ${getStderr().slice(-400)}`));
|
|
42690
|
+
});
|
|
42691
|
+
});
|
|
42692
|
+
}
|
|
42693
|
+
var VIDEO_EXTENSIONS2, IMAGE_EXTENSIONS, RECENT_WINDOW;
|
|
42694
|
+
var init_pipeline = __esm({
|
|
42695
|
+
"src/background-removal/pipeline.ts"() {
|
|
42696
|
+
"use strict";
|
|
42697
|
+
init_manager();
|
|
42698
|
+
init_inference();
|
|
42699
|
+
VIDEO_EXTENSIONS2 = /* @__PURE__ */ new Set([".mp4", ".mov", ".webm", ".mkv", ".avi"]);
|
|
42700
|
+
IMAGE_EXTENSIONS = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp"]);
|
|
42701
|
+
RECENT_WINDOW = 30;
|
|
42702
|
+
}
|
|
42703
|
+
});
|
|
42704
|
+
|
|
42705
|
+
// src/commands/remove-background.ts
|
|
42706
|
+
var remove_background_exports = {};
|
|
42707
|
+
__export(remove_background_exports, {
|
|
42708
|
+
default: () => remove_background_default,
|
|
42709
|
+
examples: () => examples15
|
|
42710
|
+
});
|
|
42711
|
+
import { resolve as resolve32 } from "path";
|
|
42712
|
+
import { existsSync as existsSync48 } from "fs";
|
|
42713
|
+
async function showInfo(json) {
|
|
42714
|
+
const { selectProviders: selectProviders2, listAvailableProviders: listAvailableProviders2, DEFAULT_MODEL: DEFAULT_MODEL4, MODEL_MEMORY_MB: MODEL_MEMORY_MB2, modelPath: modelPath2 } = await Promise.resolve().then(() => (init_manager3(), manager_exports3));
|
|
42715
|
+
const providers = listAvailableProviders2();
|
|
42716
|
+
const auto = selectProviders2("auto");
|
|
42717
|
+
const cached2 = existsSync48(modelPath2());
|
|
42718
|
+
if (json) {
|
|
42719
|
+
console.log(
|
|
42720
|
+
JSON.stringify({
|
|
42721
|
+
defaultModel: DEFAULT_MODEL4,
|
|
42722
|
+
modelCached: cached2,
|
|
42723
|
+
modelPath: modelPath2(),
|
|
42724
|
+
peakMemoryMb: MODEL_MEMORY_MB2[DEFAULT_MODEL4],
|
|
42725
|
+
availableProviders: providers,
|
|
42726
|
+
autoProvider: auto.label
|
|
42727
|
+
})
|
|
42728
|
+
);
|
|
42729
|
+
return;
|
|
42730
|
+
}
|
|
42731
|
+
console.log(c.bold("hyperframes remove-background \u2014 system info"));
|
|
42732
|
+
console.log("");
|
|
42733
|
+
console.log(` ${c.dim("Default model:")} ${c.accent(DEFAULT_MODEL4)}`);
|
|
42734
|
+
console.log(` ${c.dim("Peak memory:")} ~${MODEL_MEMORY_MB2[DEFAULT_MODEL4]} MB`);
|
|
42735
|
+
console.log(
|
|
42736
|
+
` ${c.dim("Weights cached:")} ${cached2 ? c.success("yes") : c.dim("no (will download on first run)")}`
|
|
42737
|
+
);
|
|
42738
|
+
console.log(` ${c.dim("Cache path:")} ${modelPath2()}`);
|
|
42739
|
+
console.log("");
|
|
42740
|
+
console.log(` ${c.dim("Available providers:")} ${providers.join(", ")}`);
|
|
42741
|
+
console.log(` ${c.dim("Auto-selected:")} ${c.accent(auto.label)}`);
|
|
42742
|
+
}
|
|
42743
|
+
var examples15, remove_background_default;
|
|
42744
|
+
var init_remove_background = __esm({
|
|
42745
|
+
"src/commands/remove-background.ts"() {
|
|
42746
|
+
"use strict";
|
|
42747
|
+
init_dist();
|
|
42748
|
+
init_dist3();
|
|
42749
|
+
init_colors();
|
|
42750
|
+
init_manager3();
|
|
42751
|
+
examples15 = [
|
|
42752
|
+
[
|
|
42753
|
+
"Remove background from a video, output transparent VP9 WebM (default)",
|
|
42754
|
+
"hyperframes remove-background avatar.mp4 -o transparent.webm"
|
|
42755
|
+
],
|
|
42756
|
+
[
|
|
42757
|
+
"Output ProRes 4444 .mov for editing round-trip",
|
|
42758
|
+
"hyperframes remove-background avatar.mp4 -o transparent.mov"
|
|
42759
|
+
],
|
|
42760
|
+
[
|
|
42761
|
+
"Remove background from a single image, output transparent PNG",
|
|
42762
|
+
"hyperframes remove-background portrait.jpg -o cutout.png"
|
|
42763
|
+
],
|
|
42764
|
+
[
|
|
42765
|
+
"Force CPU (skip CoreML/CUDA)",
|
|
42766
|
+
"hyperframes remove-background avatar.mp4 -o transparent.webm --device cpu"
|
|
42767
|
+
],
|
|
42768
|
+
["Show detected providers without rendering", "hyperframes remove-background --info"]
|
|
42769
|
+
];
|
|
42770
|
+
remove_background_default = defineCommand({
|
|
42771
|
+
meta: {
|
|
42772
|
+
name: "remove-background",
|
|
42773
|
+
description: "Remove background from a video or image using a local AI model \u2014 outputs transparent WebM, ProRes 4444, or PNG"
|
|
42774
|
+
},
|
|
42775
|
+
args: {
|
|
42776
|
+
input: {
|
|
42777
|
+
type: "positional",
|
|
42778
|
+
description: "Source video (.mp4/.mov/.webm/.mkv) or image (.jpg/.png/.webp)",
|
|
42779
|
+
required: false
|
|
42780
|
+
},
|
|
42781
|
+
output: {
|
|
42782
|
+
type: "string",
|
|
42783
|
+
description: "Output path. Format inferred from extension: .webm (default), .mov, .png",
|
|
42784
|
+
alias: "o"
|
|
42785
|
+
},
|
|
42786
|
+
device: {
|
|
42787
|
+
type: "string",
|
|
42788
|
+
description: `Execution provider: ${DEVICES.join(", ")}`,
|
|
42789
|
+
default: "auto"
|
|
42790
|
+
},
|
|
42791
|
+
info: {
|
|
42792
|
+
type: "boolean",
|
|
42793
|
+
description: "Print detected execution providers and exit (no render)",
|
|
42794
|
+
default: false
|
|
42795
|
+
},
|
|
42796
|
+
json: {
|
|
42797
|
+
type: "boolean",
|
|
42798
|
+
description: "Output result as JSON",
|
|
42799
|
+
default: false
|
|
42800
|
+
}
|
|
42801
|
+
},
|
|
42802
|
+
async run({ args }) {
|
|
42803
|
+
if (args.info) {
|
|
42804
|
+
return showInfo(args.json);
|
|
42805
|
+
}
|
|
42806
|
+
if (!args.input) {
|
|
42807
|
+
console.error(
|
|
42808
|
+
c.error(
|
|
42809
|
+
"Input file is required. Run `hyperframes remove-background --info` for providers."
|
|
42810
|
+
)
|
|
42811
|
+
);
|
|
42812
|
+
process.exit(1);
|
|
42813
|
+
}
|
|
42814
|
+
if (!args.output) {
|
|
42815
|
+
console.error(c.error("--output (-o) is required. Use a .webm, .mov, or .png path."));
|
|
42816
|
+
process.exit(1);
|
|
42817
|
+
}
|
|
42818
|
+
if (!isDevice(args.device)) {
|
|
42819
|
+
console.error(
|
|
42820
|
+
c.error(`Invalid --device '${String(args.device)}'. Use: ${DEVICES.join(", ")}.`)
|
|
42821
|
+
);
|
|
42822
|
+
process.exit(1);
|
|
42823
|
+
}
|
|
42824
|
+
const inputPath = resolve32(args.input);
|
|
42825
|
+
const outputPath = resolve32(args.output);
|
|
42826
|
+
const { render: render3 } = await Promise.resolve().then(() => (init_pipeline(), pipeline_exports));
|
|
42827
|
+
const spin = args.json ? null : be();
|
|
42828
|
+
spin?.start("Preparing background-removal pipeline...");
|
|
42829
|
+
try {
|
|
42830
|
+
const result = await render3({
|
|
42831
|
+
inputPath,
|
|
42832
|
+
outputPath,
|
|
42833
|
+
device: args.device,
|
|
42834
|
+
onProgress: (event) => {
|
|
42835
|
+
if (event.kind === "info") {
|
|
42836
|
+
spin?.message(event.message);
|
|
42837
|
+
} else if (event.kind === "metadata") {
|
|
42838
|
+
const dims = `${event.width}\xD7${event.height}`;
|
|
42839
|
+
const frames = event.frameCount ? ` \xB7 ${event.frameCount} frames` : "";
|
|
42840
|
+
spin?.message(`Source ${dims} @ ${event.fps.toFixed(0)}fps${frames}`);
|
|
42841
|
+
} else if (event.kind === "frame") {
|
|
42842
|
+
const pct = event.total ? ` (${Math.floor(100 * event.index / event.total)}%)` : "";
|
|
42843
|
+
spin?.message(
|
|
42844
|
+
`Frame ${event.index}${event.total ? `/${event.total}` : ""}${pct} \u2014 ${Math.round(event.avgMsPerFrame)}ms/frame avg`
|
|
42845
|
+
);
|
|
42846
|
+
}
|
|
42847
|
+
}
|
|
42848
|
+
});
|
|
42849
|
+
if (args.json) {
|
|
42850
|
+
console.log(
|
|
42851
|
+
JSON.stringify({
|
|
42852
|
+
ok: true,
|
|
42853
|
+
outputPath: result.outputPath,
|
|
42854
|
+
framesProcessed: result.framesProcessed,
|
|
42855
|
+
durationSeconds: Number(result.durationSeconds.toFixed(2)),
|
|
42856
|
+
avgMsPerFrame: Number(result.avgMsPerFrame.toFixed(1)),
|
|
42857
|
+
provider: result.provider,
|
|
42858
|
+
format: result.format
|
|
42859
|
+
})
|
|
42860
|
+
);
|
|
42861
|
+
} else {
|
|
42862
|
+
const fpsThroughput = result.durationSeconds ? (result.framesProcessed / result.durationSeconds).toFixed(1) : "n/a";
|
|
42863
|
+
spin?.stop(
|
|
42864
|
+
c.success(
|
|
42865
|
+
`Removed background from ${c.accent(String(result.framesProcessed))} frames in ${result.durationSeconds.toFixed(1)}s (${fpsThroughput} fps, ${c.accent(result.provider)}) \u2192 ${c.accent(result.outputPath)}`
|
|
42866
|
+
)
|
|
42867
|
+
);
|
|
42868
|
+
}
|
|
42869
|
+
} catch (err) {
|
|
42870
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
42871
|
+
if (args.json) {
|
|
42872
|
+
console.log(JSON.stringify({ ok: false, error: message }));
|
|
42873
|
+
} else {
|
|
42874
|
+
spin?.stop(c.error(`Background removal failed: ${message}`));
|
|
42875
|
+
}
|
|
42876
|
+
process.exit(1);
|
|
42877
|
+
}
|
|
42878
|
+
}
|
|
42879
|
+
});
|
|
42880
|
+
}
|
|
42881
|
+
});
|
|
42882
|
+
|
|
41834
42883
|
// src/commands/transcribe.ts
|
|
41835
42884
|
var transcribe_exports2 = {};
|
|
41836
42885
|
__export(transcribe_exports2, {
|
|
41837
42886
|
default: () => transcribe_default,
|
|
41838
|
-
examples: () =>
|
|
42887
|
+
examples: () => examples16
|
|
41839
42888
|
});
|
|
41840
|
-
import { existsSync as
|
|
41841
|
-
import { resolve as
|
|
42889
|
+
import { existsSync as existsSync49, writeFileSync as writeFileSync20 } from "fs";
|
|
42890
|
+
import { resolve as resolve33, join as join48, extname as extname9 } from "path";
|
|
41842
42891
|
async function importTranscript(inputPath, dir, json) {
|
|
41843
42892
|
const { loadTranscript: loadTranscript2, patchCaptionHtml: patchCaptionHtml2 } = await Promise.resolve().then(() => (init_normalize(), normalize_exports));
|
|
41844
42893
|
const { words, format } = loadTranscript2(inputPath);
|
|
@@ -41846,7 +42895,7 @@ async function importTranscript(inputPath, dir, json) {
|
|
|
41846
42895
|
console.error(c.error("No words found in transcript."));
|
|
41847
42896
|
process.exit(1);
|
|
41848
42897
|
}
|
|
41849
|
-
const outPath =
|
|
42898
|
+
const outPath = join48(dir, "transcript.json");
|
|
41850
42899
|
writeFileSync20(outPath, JSON.stringify(words, null, 2));
|
|
41851
42900
|
patchCaptionHtml2(dir, words);
|
|
41852
42901
|
if (json) {
|
|
@@ -41913,7 +42962,7 @@ async function transcribeAudio(inputPath, dir, opts) {
|
|
|
41913
42962
|
process.exit(1);
|
|
41914
42963
|
}
|
|
41915
42964
|
}
|
|
41916
|
-
var
|
|
42965
|
+
var examples16, transcribe_default;
|
|
41917
42966
|
var init_transcribe2 = __esm({
|
|
41918
42967
|
"src/commands/transcribe.ts"() {
|
|
41919
42968
|
"use strict";
|
|
@@ -41921,7 +42970,7 @@ var init_transcribe2 = __esm({
|
|
|
41921
42970
|
init_dist3();
|
|
41922
42971
|
init_colors();
|
|
41923
42972
|
init_manager();
|
|
41924
|
-
|
|
42973
|
+
examples16 = [
|
|
41925
42974
|
["Transcribe an audio file", "hyperframes transcribe audio.mp3"],
|
|
41926
42975
|
["Transcribe a video file", "hyperframes transcribe video.mp4"],
|
|
41927
42976
|
["Use a larger model for better accuracy", "hyperframes transcribe audio.mp3 --model medium.en"],
|
|
@@ -41962,13 +43011,13 @@ var init_transcribe2 = __esm({
|
|
|
41962
43011
|
}
|
|
41963
43012
|
},
|
|
41964
43013
|
async run({ args }) {
|
|
41965
|
-
const inputPath =
|
|
41966
|
-
if (!
|
|
43014
|
+
const inputPath = resolve33(args.input);
|
|
43015
|
+
if (!existsSync49(inputPath)) {
|
|
41967
43016
|
console.error(c.error(`File not found: ${args.input}`));
|
|
41968
43017
|
process.exit(1);
|
|
41969
43018
|
}
|
|
41970
|
-
const dir =
|
|
41971
|
-
const ext =
|
|
43019
|
+
const dir = resolve33(args.dir ?? ".");
|
|
43020
|
+
const ext = extname9(inputPath).toLowerCase();
|
|
41972
43021
|
const isImport = ext === ".json" || ext === ".srt" || ext === ".vtt";
|
|
41973
43022
|
if (isImport) {
|
|
41974
43023
|
return importTranscript(inputPath, dir, args.json);
|
|
@@ -41984,9 +43033,9 @@ var init_transcribe2 = __esm({
|
|
|
41984
43033
|
});
|
|
41985
43034
|
|
|
41986
43035
|
// src/tts/manager.ts
|
|
41987
|
-
import { existsSync as
|
|
41988
|
-
import { homedir as
|
|
41989
|
-
import { join as
|
|
43036
|
+
import { existsSync as existsSync50, mkdirSync as mkdirSync26 } from "fs";
|
|
43037
|
+
import { homedir as homedir9 } from "os";
|
|
43038
|
+
import { join as join49 } from "path";
|
|
41990
43039
|
function inferLangFromVoiceId(voiceId) {
|
|
41991
43040
|
const first = voiceId.charAt(0).toLowerCase();
|
|
41992
43041
|
return VOICE_PREFIX_LANG[first] ?? "en-us";
|
|
@@ -41994,44 +43043,44 @@ function inferLangFromVoiceId(voiceId) {
|
|
|
41994
43043
|
function isSupportedLang(value) {
|
|
41995
43044
|
return SUPPORTED_LANGS.includes(value);
|
|
41996
43045
|
}
|
|
41997
|
-
async function
|
|
41998
|
-
const
|
|
41999
|
-
if (
|
|
42000
|
-
const url =
|
|
43046
|
+
async function ensureModel3(model = DEFAULT_MODEL3, options) {
|
|
43047
|
+
const modelPath2 = join49(MODELS_DIR3, `${model}.onnx`);
|
|
43048
|
+
if (existsSync50(modelPath2)) return modelPath2;
|
|
43049
|
+
const url = MODEL_URLS2[model];
|
|
42001
43050
|
if (!url) {
|
|
42002
43051
|
throw new Error(
|
|
42003
|
-
`Unknown TTS model: ${model}. Available: ${Object.keys(
|
|
43052
|
+
`Unknown TTS model: ${model}. Available: ${Object.keys(MODEL_URLS2).join(", ")}`
|
|
42004
43053
|
);
|
|
42005
43054
|
}
|
|
42006
|
-
|
|
43055
|
+
mkdirSync26(MODELS_DIR3, { recursive: true });
|
|
42007
43056
|
options?.onProgress?.(`Downloading TTS model ${model} (~311 MB)...`);
|
|
42008
|
-
await downloadFile(url,
|
|
42009
|
-
if (!
|
|
43057
|
+
await downloadFile(url, modelPath2);
|
|
43058
|
+
if (!existsSync50(modelPath2)) {
|
|
42010
43059
|
throw new Error(`Model download failed: ${model}`);
|
|
42011
43060
|
}
|
|
42012
|
-
return
|
|
43061
|
+
return modelPath2;
|
|
42013
43062
|
}
|
|
42014
43063
|
async function ensureVoices(options) {
|
|
42015
|
-
const voicesPath =
|
|
42016
|
-
if (
|
|
42017
|
-
|
|
43064
|
+
const voicesPath = join49(VOICES_DIR, "voices-v1.0.bin");
|
|
43065
|
+
if (existsSync50(voicesPath)) return voicesPath;
|
|
43066
|
+
mkdirSync26(VOICES_DIR, { recursive: true });
|
|
42018
43067
|
options?.onProgress?.("Downloading voice data (~27 MB)...");
|
|
42019
43068
|
await downloadFile(VOICES_URL, voicesPath);
|
|
42020
|
-
if (!
|
|
43069
|
+
if (!existsSync50(voicesPath)) {
|
|
42021
43070
|
throw new Error("Voice data download failed");
|
|
42022
43071
|
}
|
|
42023
43072
|
return voicesPath;
|
|
42024
43073
|
}
|
|
42025
|
-
var CACHE_DIR3,
|
|
42026
|
-
var
|
|
43074
|
+
var CACHE_DIR3, MODELS_DIR3, VOICES_DIR, DEFAULT_MODEL3, MODEL_URLS2, VOICES_URL, SUPPORTED_LANGS, VOICE_PREFIX_LANG, BUNDLED_VOICES, DEFAULT_VOICE;
|
|
43075
|
+
var init_manager4 = __esm({
|
|
42027
43076
|
"src/tts/manager.ts"() {
|
|
42028
43077
|
"use strict";
|
|
42029
43078
|
init_download();
|
|
42030
|
-
CACHE_DIR3 =
|
|
42031
|
-
|
|
42032
|
-
VOICES_DIR =
|
|
42033
|
-
|
|
42034
|
-
|
|
43079
|
+
CACHE_DIR3 = join49(homedir9(), ".cache", "hyperframes", "tts");
|
|
43080
|
+
MODELS_DIR3 = join49(CACHE_DIR3, "models");
|
|
43081
|
+
VOICES_DIR = join49(CACHE_DIR3, "voices");
|
|
43082
|
+
DEFAULT_MODEL3 = "kokoro-v1.0";
|
|
43083
|
+
MODEL_URLS2 = {
|
|
42035
43084
|
"kokoro-v1.0": "https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0/kokoro-v1.0.onnx"
|
|
42036
43085
|
};
|
|
42037
43086
|
VOICES_URL = "https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0/voices-v1.0.bin";
|
|
@@ -42090,9 +43139,9 @@ __export(synthesize_exports, {
|
|
|
42090
43139
|
synthesize: () => synthesize
|
|
42091
43140
|
});
|
|
42092
43141
|
import { execFileSync as execFileSync6 } from "child_process";
|
|
42093
|
-
import { existsSync as
|
|
42094
|
-
import { join as
|
|
42095
|
-
import { homedir as
|
|
43142
|
+
import { existsSync as existsSync51, writeFileSync as writeFileSync21, mkdirSync as mkdirSync27, readdirSync as readdirSync16, unlinkSync as unlinkSync6 } from "fs";
|
|
43143
|
+
import { join as join50, dirname as dirname20, basename as basename11 } from "path";
|
|
43144
|
+
import { homedir as homedir10 } from "os";
|
|
42096
43145
|
function findPython() {
|
|
42097
43146
|
for (const name of ["python3", "python"]) {
|
|
42098
43147
|
try {
|
|
@@ -42127,15 +43176,15 @@ function hasPythonPackage(python, pkg) {
|
|
|
42127
43176
|
}
|
|
42128
43177
|
}
|
|
42129
43178
|
function ensureSynthScript() {
|
|
42130
|
-
if (!
|
|
42131
|
-
|
|
43179
|
+
if (!existsSync51(SCRIPT_PATH)) {
|
|
43180
|
+
mkdirSync27(SCRIPT_DIR, { recursive: true });
|
|
42132
43181
|
writeFileSync21(SCRIPT_PATH, SYNTH_SCRIPT);
|
|
42133
43182
|
const currentName = basename11(SCRIPT_PATH);
|
|
42134
43183
|
try {
|
|
42135
43184
|
for (const entry of readdirSync16(SCRIPT_DIR)) {
|
|
42136
43185
|
if (entry !== currentName && /^synth(-v\d+)?\.py$/.test(entry)) {
|
|
42137
43186
|
try {
|
|
42138
|
-
unlinkSync6(
|
|
43187
|
+
unlinkSync6(join50(SCRIPT_DIR, entry));
|
|
42139
43188
|
} catch {
|
|
42140
43189
|
}
|
|
42141
43190
|
}
|
|
@@ -42164,24 +43213,24 @@ async function synthesize(text, outputPath, options) {
|
|
|
42164
43213
|
if (!hasPythonPackage(python, "soundfile")) {
|
|
42165
43214
|
throw new Error("The soundfile package is not installed. Run: pip install soundfile");
|
|
42166
43215
|
}
|
|
42167
|
-
const [
|
|
42168
|
-
|
|
43216
|
+
const [modelPath2, voicesPath] = await Promise.all([
|
|
43217
|
+
ensureModel3(options?.model, { onProgress: options?.onProgress }),
|
|
42169
43218
|
ensureVoices({ onProgress: options?.onProgress })
|
|
42170
43219
|
]);
|
|
42171
43220
|
const scriptPath = ensureSynthScript();
|
|
42172
|
-
|
|
43221
|
+
mkdirSync27(dirname20(outputPath), { recursive: true });
|
|
42173
43222
|
options?.onProgress?.(`Generating speech with voice ${voice} (${lang})...`);
|
|
42174
43223
|
try {
|
|
42175
43224
|
const stdout2 = execFileSync6(
|
|
42176
43225
|
python,
|
|
42177
|
-
[scriptPath,
|
|
43226
|
+
[scriptPath, modelPath2, voicesPath, text, voice, String(speed), outputPath, lang],
|
|
42178
43227
|
{
|
|
42179
43228
|
encoding: "utf-8",
|
|
42180
43229
|
timeout: 3e5,
|
|
42181
43230
|
stdio: ["pipe", "pipe", "pipe"]
|
|
42182
43231
|
}
|
|
42183
43232
|
);
|
|
42184
|
-
if (!
|
|
43233
|
+
if (!existsSync51(outputPath)) {
|
|
42185
43234
|
throw new Error("Synthesis completed but no output file was created");
|
|
42186
43235
|
}
|
|
42187
43236
|
const lines = stdout2.trim().split("\n");
|
|
@@ -42194,7 +43243,7 @@ async function synthesize(text, outputPath, options) {
|
|
|
42194
43243
|
langApplied: result.langApplied
|
|
42195
43244
|
};
|
|
42196
43245
|
} catch (err) {
|
|
42197
|
-
if (err instanceof SyntaxError &&
|
|
43246
|
+
if (err instanceof SyntaxError && existsSync51(outputPath)) {
|
|
42198
43247
|
throw new Error(
|
|
42199
43248
|
"Speech was generated but metadata could not be read. Check the output file manually."
|
|
42200
43249
|
);
|
|
@@ -42212,7 +43261,7 @@ var SYNTH_SCRIPT, SCRIPT_DIR, SCRIPT_PATH;
|
|
|
42212
43261
|
var init_synthesize = __esm({
|
|
42213
43262
|
"src/tts/synthesize.ts"() {
|
|
42214
43263
|
"use strict";
|
|
42215
|
-
|
|
43264
|
+
init_manager4();
|
|
42216
43265
|
SYNTH_SCRIPT = `
|
|
42217
43266
|
import sys, json, inspect
|
|
42218
43267
|
|
|
@@ -42245,8 +43294,8 @@ print(json.dumps({
|
|
|
42245
43294
|
"langApplied": bool(lang and supports_lang),
|
|
42246
43295
|
}))
|
|
42247
43296
|
`;
|
|
42248
|
-
SCRIPT_DIR =
|
|
42249
|
-
SCRIPT_PATH =
|
|
43297
|
+
SCRIPT_DIR = join50(homedir10(), ".cache", "hyperframes", "tts");
|
|
43298
|
+
SCRIPT_PATH = join50(SCRIPT_DIR, "synth-v2.py");
|
|
42250
43299
|
}
|
|
42251
43300
|
});
|
|
42252
43301
|
|
|
@@ -42254,10 +43303,10 @@ print(json.dumps({
|
|
|
42254
43303
|
var tts_exports = {};
|
|
42255
43304
|
__export(tts_exports, {
|
|
42256
43305
|
default: () => tts_default,
|
|
42257
|
-
examples: () =>
|
|
43306
|
+
examples: () => examples17
|
|
42258
43307
|
});
|
|
42259
|
-
import { existsSync as
|
|
42260
|
-
import { resolve as
|
|
43308
|
+
import { existsSync as existsSync52, readFileSync as readFileSync35 } from "fs";
|
|
43309
|
+
import { resolve as resolve34, extname as extname10 } from "path";
|
|
42261
43310
|
function listVoices(json) {
|
|
42262
43311
|
const rows = BUNDLED_VOICES.map((v) => ({ ...v, defaultLang: inferLangFromVoiceId(v.id) }));
|
|
42263
43312
|
if (json) {
|
|
@@ -42287,7 +43336,7 @@ ${c.bold("Available voices")} (Kokoro-82M)
|
|
|
42287
43336
|
`
|
|
42288
43337
|
);
|
|
42289
43338
|
}
|
|
42290
|
-
var
|
|
43339
|
+
var examples17, voiceList, langList, tts_default;
|
|
42291
43340
|
var init_tts = __esm({
|
|
42292
43341
|
"src/commands/tts.ts"() {
|
|
42293
43342
|
"use strict";
|
|
@@ -42295,8 +43344,8 @@ var init_tts = __esm({
|
|
|
42295
43344
|
init_dist3();
|
|
42296
43345
|
init_colors();
|
|
42297
43346
|
init_format();
|
|
42298
|
-
|
|
42299
|
-
|
|
43347
|
+
init_manager4();
|
|
43348
|
+
examples17 = [
|
|
42300
43349
|
["Generate speech from text", 'hyperframes tts "Welcome to HyperFrames"'],
|
|
42301
43350
|
["Choose a voice", 'hyperframes tts "Hello world" --voice am_adam'],
|
|
42302
43351
|
["Save to a specific file", 'hyperframes tts "Intro" --voice bf_emma --output narration.wav'],
|
|
@@ -42365,8 +43414,8 @@ var init_tts = __esm({
|
|
|
42365
43414
|
process.exit(1);
|
|
42366
43415
|
}
|
|
42367
43416
|
let text;
|
|
42368
|
-
const maybeFile =
|
|
42369
|
-
if (
|
|
43417
|
+
const maybeFile = resolve34(args.input);
|
|
43418
|
+
if (existsSync52(maybeFile) && extname10(maybeFile).toLowerCase() === ".txt") {
|
|
42370
43419
|
text = readFileSync35(maybeFile, "utf-8").trim();
|
|
42371
43420
|
if (!text) {
|
|
42372
43421
|
console.error(c.error("File is empty."));
|
|
@@ -42379,7 +43428,7 @@ var init_tts = __esm({
|
|
|
42379
43428
|
console.error(c.error("No text provided."));
|
|
42380
43429
|
process.exit(1);
|
|
42381
43430
|
}
|
|
42382
|
-
const output =
|
|
43431
|
+
const output = resolve34(args.output ?? "speech.wav");
|
|
42383
43432
|
const voice = args.voice ?? DEFAULT_VOICE;
|
|
42384
43433
|
const speed = args.speed ? parseFloat(args.speed) : 1;
|
|
42385
43434
|
if (isNaN(speed) || speed <= 0 || speed > 3) {
|
|
@@ -42457,17 +43506,17 @@ var init_tts = __esm({
|
|
|
42457
43506
|
var docs_exports = {};
|
|
42458
43507
|
__export(docs_exports, {
|
|
42459
43508
|
default: () => docs_default,
|
|
42460
|
-
examples: () =>
|
|
43509
|
+
examples: () => examples18
|
|
42461
43510
|
});
|
|
42462
|
-
import { readFileSync as readFileSync36, existsSync as
|
|
42463
|
-
import { resolve as
|
|
43511
|
+
import { readFileSync as readFileSync36, existsSync as existsSync53 } from "fs";
|
|
43512
|
+
import { resolve as resolve35, dirname as dirname21, join as join51 } from "path";
|
|
42464
43513
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
42465
43514
|
function docsDir() {
|
|
42466
43515
|
const thisFile = fileURLToPath7(import.meta.url);
|
|
42467
43516
|
const dir = dirname21(thisFile);
|
|
42468
|
-
const devPath =
|
|
42469
|
-
const builtPath =
|
|
42470
|
-
return
|
|
43517
|
+
const devPath = resolve35(dir, "..", "docs");
|
|
43518
|
+
const builtPath = resolve35(dir, "docs");
|
|
43519
|
+
return existsSync53(devPath) ? devPath : builtPath;
|
|
42471
43520
|
}
|
|
42472
43521
|
function formatInlineCode(line) {
|
|
42473
43522
|
return line.replace(/`([^`]+)`/g, (_match, code) => c.accent(code));
|
|
@@ -42494,13 +43543,13 @@ function renderMarkdown(content) {
|
|
|
42494
43543
|
console.log(formatInlineCode(line));
|
|
42495
43544
|
}
|
|
42496
43545
|
}
|
|
42497
|
-
var
|
|
43546
|
+
var examples18, TOPICS, TOPIC_NAMES, docs_default;
|
|
42498
43547
|
var init_docs = __esm({
|
|
42499
43548
|
"src/commands/docs.ts"() {
|
|
42500
43549
|
"use strict";
|
|
42501
43550
|
init_dist();
|
|
42502
43551
|
init_colors();
|
|
42503
|
-
|
|
43552
|
+
examples18 = [
|
|
42504
43553
|
["List all available topics", "hyperframes docs"],
|
|
42505
43554
|
["Read about data attributes", "hyperframes docs data-attributes"],
|
|
42506
43555
|
["Read about rendering", "hyperframes docs rendering"],
|
|
@@ -42564,8 +43613,8 @@ var init_docs = __esm({
|
|
|
42564
43613
|
}
|
|
42565
43614
|
process.exit(1);
|
|
42566
43615
|
}
|
|
42567
|
-
const filePath =
|
|
42568
|
-
if (!
|
|
43616
|
+
const filePath = join51(docsDir(), entry.file);
|
|
43617
|
+
if (!existsSync53(filePath)) {
|
|
42569
43618
|
console.error(c.error(`Doc file not found: ${filePath}`));
|
|
42570
43619
|
process.exit(1);
|
|
42571
43620
|
}
|
|
@@ -42581,10 +43630,10 @@ var init_docs = __esm({
|
|
|
42581
43630
|
var doctor_exports = {};
|
|
42582
43631
|
__export(doctor_exports, {
|
|
42583
43632
|
default: () => doctor_default,
|
|
42584
|
-
examples: () =>
|
|
43633
|
+
examples: () => examples19
|
|
42585
43634
|
});
|
|
42586
43635
|
import { execSync as execSync3 } from "child_process";
|
|
42587
|
-
import { freemem as freemem4, platform as
|
|
43636
|
+
import { freemem as freemem4, platform as platform5 } from "os";
|
|
42588
43637
|
function checkFFmpeg() {
|
|
42589
43638
|
const path2 = findFFmpeg();
|
|
42590
43639
|
if (path2) {
|
|
@@ -42723,7 +43772,7 @@ function checkEnvironment() {
|
|
|
42723
43772
|
}
|
|
42724
43773
|
return { ok: true, detail: parts.join(" \xB7 ") };
|
|
42725
43774
|
}
|
|
42726
|
-
var
|
|
43775
|
+
var examples19, doctor_default;
|
|
42727
43776
|
var init_doctor = __esm({
|
|
42728
43777
|
"src/commands/doctor.ts"() {
|
|
42729
43778
|
"use strict";
|
|
@@ -42734,7 +43783,7 @@ var init_doctor = __esm({
|
|
|
42734
43783
|
init_version();
|
|
42735
43784
|
init_updateCheck();
|
|
42736
43785
|
init_system();
|
|
42737
|
-
|
|
43786
|
+
examples19 = [["Check system dependencies", "hyperframes doctor"]];
|
|
42738
43787
|
doctor_default = defineCommand({
|
|
42739
43788
|
meta: { name: "doctor", description: "Check system dependencies and environment" },
|
|
42740
43789
|
args: {},
|
|
@@ -42749,7 +43798,7 @@ var init_doctor = __esm({
|
|
|
42749
43798
|
{ name: "Memory", run: checkMemory },
|
|
42750
43799
|
{ name: "Disk", run: checkDisk }
|
|
42751
43800
|
];
|
|
42752
|
-
if (
|
|
43801
|
+
if (platform5() === "linux") {
|
|
42753
43802
|
checks.push({ name: "/dev/shm", run: checkShm });
|
|
42754
43803
|
}
|
|
42755
43804
|
checks.push(
|
|
@@ -42789,10 +43838,10 @@ var init_doctor = __esm({
|
|
|
42789
43838
|
var upgrade_exports = {};
|
|
42790
43839
|
__export(upgrade_exports, {
|
|
42791
43840
|
default: () => upgrade_default,
|
|
42792
|
-
examples: () =>
|
|
43841
|
+
examples: () => examples20
|
|
42793
43842
|
});
|
|
42794
43843
|
import { execSync as execSync4 } from "child_process";
|
|
42795
|
-
var
|
|
43844
|
+
var examples20, upgrade_default;
|
|
42796
43845
|
var init_upgrade = __esm({
|
|
42797
43846
|
"src/commands/upgrade.ts"() {
|
|
42798
43847
|
"use strict";
|
|
@@ -42801,7 +43850,7 @@ var init_upgrade = __esm({
|
|
|
42801
43850
|
init_colors();
|
|
42802
43851
|
init_version();
|
|
42803
43852
|
init_updateCheck();
|
|
42804
|
-
|
|
43853
|
+
examples20 = [
|
|
42805
43854
|
["Check for updates interactively", "hyperframes upgrade"],
|
|
42806
43855
|
["Check for updates without prompting", "hyperframes upgrade --check"],
|
|
42807
43856
|
["Upgrade non-interactively", "hyperframes upgrade --yes"]
|
|
@@ -42879,7 +43928,7 @@ var init_upgrade = __esm({
|
|
|
42879
43928
|
var telemetry_exports = {};
|
|
42880
43929
|
__export(telemetry_exports, {
|
|
42881
43930
|
default: () => telemetry_default,
|
|
42882
|
-
examples: () =>
|
|
43931
|
+
examples: () => examples21
|
|
42883
43932
|
});
|
|
42884
43933
|
function runEnable() {
|
|
42885
43934
|
const config = readConfig();
|
|
@@ -42909,14 +43958,14 @@ function runStatus() {
|
|
|
42909
43958
|
console.log(` ${c.dim("Env var:")} ${c.accent("HYPERFRAMES_NO_TELEMETRY=1")}`);
|
|
42910
43959
|
console.log();
|
|
42911
43960
|
}
|
|
42912
|
-
var
|
|
43961
|
+
var examples21, telemetry_default;
|
|
42913
43962
|
var init_telemetry = __esm({
|
|
42914
43963
|
"src/commands/telemetry.ts"() {
|
|
42915
43964
|
"use strict";
|
|
42916
43965
|
init_dist();
|
|
42917
43966
|
init_colors();
|
|
42918
43967
|
init_config();
|
|
42919
|
-
|
|
43968
|
+
examples21 = [
|
|
42920
43969
|
["Check current telemetry status", "hyperframes telemetry status"],
|
|
42921
43970
|
["Disable telemetry", "hyperframes telemetry disable"],
|
|
42922
43971
|
["Enable telemetry", "hyperframes telemetry enable"]
|
|
@@ -43012,8 +44061,8 @@ __export(validate_exports, {
|
|
|
43012
44061
|
default: () => validate_default,
|
|
43013
44062
|
shouldIgnoreRequestFailure: () => shouldIgnoreRequestFailure
|
|
43014
44063
|
});
|
|
43015
|
-
import { existsSync as
|
|
43016
|
-
import { resolve as
|
|
44064
|
+
import { existsSync as existsSync54, readFileSync as readFileSync37 } from "fs";
|
|
44065
|
+
import { resolve as resolve36, join as join52, dirname as dirname22 } from "path";
|
|
43017
44066
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
43018
44067
|
function shouldIgnoreRequestFailure(url, errorText) {
|
|
43019
44068
|
if (errorText !== "net::ERR_ABORTED") return false;
|
|
@@ -43065,11 +44114,11 @@ async function runContrastAudit(page) {
|
|
|
43065
44114
|
}
|
|
43066
44115
|
function loadContrastAuditScript() {
|
|
43067
44116
|
const candidates = [
|
|
43068
|
-
|
|
43069
|
-
|
|
44117
|
+
join52(__dirname3, "contrast-audit.browser.js"),
|
|
44118
|
+
join52(__dirname3, "commands", "contrast-audit.browser.js")
|
|
43070
44119
|
];
|
|
43071
44120
|
for (const candidate of candidates) {
|
|
43072
|
-
if (
|
|
44121
|
+
if (existsSync54(candidate)) return readFileSync37(candidate, "utf-8");
|
|
43073
44122
|
}
|
|
43074
44123
|
throw new Error("Missing contrast audit browser script");
|
|
43075
44124
|
}
|
|
@@ -43077,7 +44126,7 @@ async function validateInBrowser(projectDir, opts) {
|
|
|
43077
44126
|
const { bundleToSingleHtml: bundleToSingleHtml2 } = await Promise.resolve().then(() => (init_compiler(), compiler_exports));
|
|
43078
44127
|
const { ensureBrowser: ensureBrowser2 } = await Promise.resolve().then(() => (init_manager2(), manager_exports2));
|
|
43079
44128
|
let html = await bundleToSingleHtml2(projectDir);
|
|
43080
|
-
const runtimePath =
|
|
44129
|
+
const runtimePath = resolve36(
|
|
43081
44130
|
__dirname3,
|
|
43082
44131
|
"..",
|
|
43083
44132
|
"..",
|
|
@@ -43086,7 +44135,7 @@ async function validateInBrowser(projectDir, opts) {
|
|
|
43086
44135
|
"dist",
|
|
43087
44136
|
"hyperframe.runtime.iife.js"
|
|
43088
44137
|
);
|
|
43089
|
-
if (
|
|
44138
|
+
if (existsSync54(runtimePath)) {
|
|
43090
44139
|
const runtimeSource = readFileSync37(runtimePath, "utf-8");
|
|
43091
44140
|
html = html.replace(
|
|
43092
44141
|
/<script[^>]*data-hyperframes-preview-runtime[^>]*src="[^"]*"[^>]*><\/script>/,
|
|
@@ -43102,8 +44151,8 @@ async function validateInBrowser(projectDir, opts) {
|
|
|
43102
44151
|
res.end(html);
|
|
43103
44152
|
return;
|
|
43104
44153
|
}
|
|
43105
|
-
const filePath =
|
|
43106
|
-
if (
|
|
44154
|
+
const filePath = join52(projectDir, decodeURIComponent(url));
|
|
44155
|
+
if (existsSync54(filePath)) {
|
|
43107
44156
|
res.writeHead(200, { "Content-Type": getMimeType2(filePath) });
|
|
43108
44157
|
res.end(readFileSync37(filePath));
|
|
43109
44158
|
return;
|
|
@@ -43296,15 +44345,15 @@ Examples:
|
|
|
43296
44345
|
var snapshot_exports = {};
|
|
43297
44346
|
__export(snapshot_exports, {
|
|
43298
44347
|
default: () => snapshot_default,
|
|
43299
|
-
examples: () =>
|
|
44348
|
+
examples: () => examples22
|
|
43300
44349
|
});
|
|
43301
|
-
import { spawn as
|
|
43302
|
-
import { existsSync as
|
|
44350
|
+
import { spawn as spawn13 } from "child_process";
|
|
44351
|
+
import { existsSync as existsSync55, mkdtempSync as mkdtempSync3, readFileSync as readFileSync38, mkdirSync as mkdirSync28, rmSync as rmSync10 } from "fs";
|
|
43303
44352
|
import { tmpdir as tmpdir5 } from "os";
|
|
43304
|
-
import { resolve as
|
|
44353
|
+
import { resolve as resolve37, join as join53, relative as relative6, isAbsolute as isAbsolute7 } from "path";
|
|
43305
44354
|
async function extractVideoFrameToBuffer(videoPath, timeSeconds, useVp9AlphaDecoder = false) {
|
|
43306
|
-
const tmp = mkdtempSync3(
|
|
43307
|
-
const outPath =
|
|
44355
|
+
const tmp = mkdtempSync3(join53(tmpdir5(), "hf-snapshot-frame-"));
|
|
44356
|
+
const outPath = join53(tmp, "frame.png");
|
|
43308
44357
|
try {
|
|
43309
44358
|
const result = await new Promise(
|
|
43310
44359
|
(resolvePromise) => {
|
|
@@ -43324,7 +44373,7 @@ async function extractVideoFrameToBuffer(videoPath, timeSeconds, useVp9AlphaDeco
|
|
|
43324
44373
|
"-y",
|
|
43325
44374
|
outPath
|
|
43326
44375
|
);
|
|
43327
|
-
const ff =
|
|
44376
|
+
const ff = spawn13("ffmpeg", args);
|
|
43328
44377
|
let stderr = "";
|
|
43329
44378
|
let timedOut = false;
|
|
43330
44379
|
const timer = setTimeout(() => {
|
|
@@ -43344,7 +44393,7 @@ async function extractVideoFrameToBuffer(videoPath, timeSeconds, useVp9AlphaDeco
|
|
|
43344
44393
|
});
|
|
43345
44394
|
}
|
|
43346
44395
|
);
|
|
43347
|
-
if (result.code !== 0 || result.timedOut || !
|
|
44396
|
+
if (result.code !== 0 || result.timedOut || !existsSync55(outPath)) return null;
|
|
43348
44397
|
return readFileSync38(outPath);
|
|
43349
44398
|
} finally {
|
|
43350
44399
|
try {
|
|
@@ -43425,8 +44474,8 @@ async function captureSnapshots(projectDir, opts) {
|
|
|
43425
44474
|
return [];
|
|
43426
44475
|
}
|
|
43427
44476
|
const positions = opts.at?.length ? opts.at : numFrames === 1 ? [duration / 2] : Array.from({ length: numFrames }, (_2, i2) => i2 / (numFrames - 1) * duration);
|
|
43428
|
-
const snapshotDir =
|
|
43429
|
-
|
|
44477
|
+
const snapshotDir = join53(projectDir, "snapshots");
|
|
44478
|
+
mkdirSync28(snapshotDir, { recursive: true });
|
|
43430
44479
|
let injectVideoFramesBatch2 = null;
|
|
43431
44480
|
let syncVideoFrameVisibility2 = null;
|
|
43432
44481
|
let extractMediaMetadata2 = null;
|
|
@@ -43498,9 +44547,9 @@ async function captureSnapshots(projectDir, opts) {
|
|
|
43498
44547
|
try {
|
|
43499
44548
|
const url = new URL(v.src);
|
|
43500
44549
|
const decodedPath = decodeURIComponent(url.pathname).replace(/^\//, "");
|
|
43501
|
-
const candidate =
|
|
44550
|
+
const candidate = resolve37(projectDir, decodedPath);
|
|
43502
44551
|
const rel = relative6(projectDir, candidate);
|
|
43503
|
-
if (!rel.startsWith("..") && !isAbsolute7(rel) &&
|
|
44552
|
+
if (!rel.startsWith("..") && !isAbsolute7(rel) && existsSync55(candidate)) {
|
|
43504
44553
|
filePath = candidate;
|
|
43505
44554
|
}
|
|
43506
44555
|
} catch {
|
|
@@ -43530,7 +44579,7 @@ async function captureSnapshots(projectDir, opts) {
|
|
|
43530
44579
|
}
|
|
43531
44580
|
const timeLabel = opts.at?.length ? `${time.toFixed(1)}s` : `${Math.round(time / duration * 100)}pct`;
|
|
43532
44581
|
const filename = `frame-${String(i2).padStart(2, "0")}-at-${timeLabel}.png`;
|
|
43533
|
-
const framePath =
|
|
44582
|
+
const framePath = join53(snapshotDir, filename);
|
|
43534
44583
|
await page.screenshot({ path: framePath, type: "png" });
|
|
43535
44584
|
savedPaths.push(`snapshots/${filename}`);
|
|
43536
44585
|
}
|
|
@@ -43542,7 +44591,7 @@ async function captureSnapshots(projectDir, opts) {
|
|
|
43542
44591
|
}
|
|
43543
44592
|
return savedPaths;
|
|
43544
44593
|
}
|
|
43545
|
-
var FFMPEG_EXTRACT_TIMEOUT_MS,
|
|
44594
|
+
var FFMPEG_EXTRACT_TIMEOUT_MS, examples22, snapshot_default;
|
|
43546
44595
|
var init_snapshot = __esm({
|
|
43547
44596
|
"src/commands/snapshot.ts"() {
|
|
43548
44597
|
"use strict";
|
|
@@ -43552,7 +44601,7 @@ var init_snapshot = __esm({
|
|
|
43552
44601
|
init_staticProjectServer();
|
|
43553
44602
|
init_colors();
|
|
43554
44603
|
FFMPEG_EXTRACT_TIMEOUT_MS = 3e4;
|
|
43555
|
-
|
|
44604
|
+
examples22 = [
|
|
43556
44605
|
["Capture 5 key frames from a composition", "snapshot captures/stripe"],
|
|
43557
44606
|
["Capture 10 evenly-spaced frames", "snapshot captures/stripe --frames 10"]
|
|
43558
44607
|
];
|
|
@@ -43615,14 +44664,14 @@ ${c.error("\u2717")} Snapshot failed: ${msg}`);
|
|
|
43615
44664
|
});
|
|
43616
44665
|
|
|
43617
44666
|
// src/capture/assetDownloader.ts
|
|
43618
|
-
import { writeFileSync as writeFileSync22, mkdirSync as
|
|
43619
|
-
import { join as
|
|
44667
|
+
import { writeFileSync as writeFileSync22, mkdirSync as mkdirSync29 } from "fs";
|
|
44668
|
+
import { join as join54, extname as extname11 } from "path";
|
|
43620
44669
|
async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks) {
|
|
43621
|
-
const assetsDir =
|
|
43622
|
-
|
|
44670
|
+
const assetsDir = join54(outputDir, "assets");
|
|
44671
|
+
mkdirSync29(assetsDir, { recursive: true });
|
|
43623
44672
|
const assets = [];
|
|
43624
44673
|
const downloadedUrls = /* @__PURE__ */ new Set();
|
|
43625
|
-
|
|
44674
|
+
mkdirSync29(join54(outputDir, "assets", "svgs"), { recursive: true });
|
|
43626
44675
|
for (let i2 = 0; i2 < tokens.svgs.length && i2 < 30; i2++) {
|
|
43627
44676
|
const svg = tokens.svgs[i2];
|
|
43628
44677
|
if (!svg.outerHTML || svg.outerHTML.length < 50) continue;
|
|
@@ -43630,7 +44679,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
43630
44679
|
const name = label2 ? slugify(label2) + ".svg" : svg.isLogo ? `logo-${i2}.svg` : `icon-${i2}.svg`;
|
|
43631
44680
|
const localPath = `assets/svgs/${name}`;
|
|
43632
44681
|
try {
|
|
43633
|
-
writeFileSync22(
|
|
44682
|
+
writeFileSync22(join54(outputDir, localPath), svg.outerHTML, "utf-8");
|
|
43634
44683
|
assets.push({ url: "", localPath, type: "svg" });
|
|
43635
44684
|
} catch {
|
|
43636
44685
|
}
|
|
@@ -43638,12 +44687,12 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
43638
44687
|
for (const icon of faviconLinks || []) {
|
|
43639
44688
|
if (!icon.href) continue;
|
|
43640
44689
|
try {
|
|
43641
|
-
const ext =
|
|
44690
|
+
const ext = extname11(new URL(icon.href).pathname) || ".ico";
|
|
43642
44691
|
const name = `favicon${ext}`;
|
|
43643
44692
|
const localPath = `assets/${name}`;
|
|
43644
44693
|
const buffer = await fetchBuffer(icon.href);
|
|
43645
44694
|
if (buffer) {
|
|
43646
|
-
writeFileSync22(
|
|
44695
|
+
writeFileSync22(join54(outputDir, localPath), buffer);
|
|
43647
44696
|
assets.push({ url: icon.href, localPath, type: "favicon" });
|
|
43648
44697
|
break;
|
|
43649
44698
|
}
|
|
@@ -43680,7 +44729,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
43680
44729
|
const results = await Promise.allSettled(
|
|
43681
44730
|
batch.map(async ({ url, isPoster }) => {
|
|
43682
44731
|
const parsedUrl = new URL(url);
|
|
43683
|
-
const pathExt =
|
|
44732
|
+
const pathExt = extname11(parsedUrl.pathname);
|
|
43684
44733
|
const ext = pathExt && pathExt.length <= 5 ? pathExt : ".jpg";
|
|
43685
44734
|
const buffer = await fetchBuffer(url);
|
|
43686
44735
|
if (!buffer) return null;
|
|
@@ -43700,7 +44749,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
43700
44749
|
const slug = isMeaningful ? slugify(rawName) : `${prefix}-${imgIdx}`;
|
|
43701
44750
|
const name = `${slug}${ext}`;
|
|
43702
44751
|
const localPath = `assets/${name}`;
|
|
43703
|
-
writeFileSync22(
|
|
44752
|
+
writeFileSync22(join54(outputDir, localPath), buffer);
|
|
43704
44753
|
assets.push({ url, localPath, type: "image" });
|
|
43705
44754
|
imgIdx++;
|
|
43706
44755
|
} catch {
|
|
@@ -43709,11 +44758,11 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
43709
44758
|
}
|
|
43710
44759
|
if (tokens.ogImage && !downloadedUrls.has(normalizeUrl(tokens.ogImage))) {
|
|
43711
44760
|
try {
|
|
43712
|
-
const ext =
|
|
44761
|
+
const ext = extname11(new URL(tokens.ogImage).pathname) || ".jpg";
|
|
43713
44762
|
const localPath = `assets/og-image${ext}`;
|
|
43714
44763
|
const buffer = await fetchBuffer(tokens.ogImage);
|
|
43715
44764
|
if (buffer && buffer.length > 5e3) {
|
|
43716
|
-
writeFileSync22(
|
|
44765
|
+
writeFileSync22(join54(outputDir, localPath), buffer);
|
|
43717
44766
|
assets.push({ url: tokens.ogImage, localPath, type: "image" });
|
|
43718
44767
|
}
|
|
43719
44768
|
} catch {
|
|
@@ -43736,8 +44785,8 @@ function normalizeUrl(u) {
|
|
|
43736
44785
|
}
|
|
43737
44786
|
}
|
|
43738
44787
|
async function downloadAndRewriteFonts(css, outputDir) {
|
|
43739
|
-
const assetsDir =
|
|
43740
|
-
|
|
44788
|
+
const assetsDir = join54(outputDir, "assets", "fonts");
|
|
44789
|
+
mkdirSync29(assetsDir, { recursive: true });
|
|
43741
44790
|
const fontUrlRegex = /url\(['"]?(https?:\/\/[^'")\s]+\.(?:woff2?|ttf|otf)[^'")\s]*?)['"]?\)/g;
|
|
43742
44791
|
const fontUrls = /* @__PURE__ */ new Set();
|
|
43743
44792
|
let match;
|
|
@@ -43772,7 +44821,7 @@ async function downloadAndRewriteFonts(css, outputDir) {
|
|
|
43772
44821
|
try {
|
|
43773
44822
|
const urlObj = new URL(fontUrl);
|
|
43774
44823
|
const filename = urlObj.pathname.split("/").pop() || `font-${count}.woff2`;
|
|
43775
|
-
const localPath =
|
|
44824
|
+
const localPath = join54(assetsDir, filename);
|
|
43776
44825
|
const relativePath = `assets/fonts/${filename}`;
|
|
43777
44826
|
const buffer = await fetchBuffer(fontUrl);
|
|
43778
44827
|
if (buffer) {
|
|
@@ -44569,8 +45618,8 @@ var init_animationCataloger = __esm({
|
|
|
44569
45618
|
});
|
|
44570
45619
|
|
|
44571
45620
|
// src/capture/mediaCapture.ts
|
|
44572
|
-
import { mkdirSync as
|
|
44573
|
-
import { join as
|
|
45621
|
+
import { mkdirSync as mkdirSync30, writeFileSync as writeFileSync23, readdirSync as readdirSync17, readFileSync as readFileSync39, statSync as statSync18 } from "fs";
|
|
45622
|
+
import { join as join55 } from "path";
|
|
44574
45623
|
async function saveLottieAnimations(discoveredLotties, lottieDir) {
|
|
44575
45624
|
let savedCount = 0;
|
|
44576
45625
|
const savedHashes = /* @__PURE__ */ new Set();
|
|
@@ -44603,7 +45652,7 @@ async function saveLottieAnimations(discoveredLotties, lottieDir) {
|
|
|
44603
45652
|
const hash2 = buf.toString("base64").slice(0, 100);
|
|
44604
45653
|
if (savedHashes.has(hash2)) continue;
|
|
44605
45654
|
savedHashes.add(hash2);
|
|
44606
|
-
writeFileSync23(
|
|
45655
|
+
writeFileSync23(join55(lottieDir, `animation-${savedCount}.lottie`), buf);
|
|
44607
45656
|
savedCount++;
|
|
44608
45657
|
continue;
|
|
44609
45658
|
}
|
|
@@ -44621,7 +45670,7 @@ async function saveLottieAnimations(discoveredLotties, lottieDir) {
|
|
|
44621
45670
|
} catch {
|
|
44622
45671
|
continue;
|
|
44623
45672
|
}
|
|
44624
|
-
writeFileSync23(
|
|
45673
|
+
writeFileSync23(join55(lottieDir, `animation-${savedCount}.json`), jsonData, "utf-8");
|
|
44625
45674
|
savedCount++;
|
|
44626
45675
|
}
|
|
44627
45676
|
} catch {
|
|
@@ -44631,22 +45680,22 @@ async function saveLottieAnimations(discoveredLotties, lottieDir) {
|
|
|
44631
45680
|
}
|
|
44632
45681
|
async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir) {
|
|
44633
45682
|
const manifest = [];
|
|
44634
|
-
const previewDir =
|
|
44635
|
-
|
|
45683
|
+
const previewDir = join55(lottieDir, "previews");
|
|
45684
|
+
mkdirSync30(previewDir, { recursive: true });
|
|
44636
45685
|
for (const file of readdirSync17(lottieDir)) {
|
|
44637
45686
|
if (!file.endsWith(".json")) continue;
|
|
44638
45687
|
try {
|
|
44639
|
-
const raw = JSON.parse(readFileSync39(
|
|
45688
|
+
const raw = JSON.parse(readFileSync39(join55(lottieDir, file), "utf-8"));
|
|
44640
45689
|
const fr = raw.fr || 30;
|
|
44641
45690
|
const dur = ((raw.op || 0) - (raw.ip || 0)) / fr;
|
|
44642
45691
|
const previewName = file.replace(".json", "-preview.png");
|
|
44643
|
-
const fileSize = statSync18(
|
|
45692
|
+
const fileSize = statSync18(join55(lottieDir, file)).size;
|
|
44644
45693
|
if (fileSize > 2e6) continue;
|
|
44645
45694
|
let previewPage;
|
|
44646
45695
|
try {
|
|
44647
45696
|
previewPage = await chromeBrowser.newPage();
|
|
44648
45697
|
await previewPage.setViewport({ width: 400, height: 400 });
|
|
44649
|
-
const animData = JSON.parse(readFileSync39(
|
|
45698
|
+
const animData = JSON.parse(readFileSync39(join55(lottieDir, file), "utf-8"));
|
|
44650
45699
|
const midFrame = Math.floor(((raw.op || 0) - (raw.ip || 0)) * 0.3);
|
|
44651
45700
|
await previewPage.setContent(
|
|
44652
45701
|
`<!DOCTYPE html>
|
|
@@ -44676,7 +45725,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir) {
|
|
|
44676
45725
|
await previewPage.waitForFunction(() => window.__READY === true, { timeout: 5e3 }).catch(() => {
|
|
44677
45726
|
});
|
|
44678
45727
|
await previewPage.screenshot({
|
|
44679
|
-
path:
|
|
45728
|
+
path: join55(previewDir, previewName),
|
|
44680
45729
|
type: "png",
|
|
44681
45730
|
omitBackground: true
|
|
44682
45731
|
});
|
|
@@ -44700,7 +45749,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir) {
|
|
|
44700
45749
|
}
|
|
44701
45750
|
if (manifest.length > 0) {
|
|
44702
45751
|
writeFileSync23(
|
|
44703
|
-
|
|
45752
|
+
join55(outputDir, "extracted", "lottie-manifest.json"),
|
|
44704
45753
|
JSON.stringify(manifest, null, 2),
|
|
44705
45754
|
"utf-8"
|
|
44706
45755
|
);
|
|
@@ -44762,15 +45811,15 @@ async function captureVideoManifest(page, outputDir, progress) {
|
|
|
44762
45811
|
return true;
|
|
44763
45812
|
});
|
|
44764
45813
|
if (uniqueVideos.length > 0) {
|
|
44765
|
-
const videoManifestDir =
|
|
44766
|
-
|
|
44767
|
-
const previewDir =
|
|
44768
|
-
|
|
45814
|
+
const videoManifestDir = join55(outputDir, "assets", "videos");
|
|
45815
|
+
mkdirSync30(videoManifestDir, { recursive: true });
|
|
45816
|
+
const previewDir = join55(videoManifestDir, "previews");
|
|
45817
|
+
mkdirSync30(previewDir, { recursive: true });
|
|
44769
45818
|
const videoManifest = [];
|
|
44770
45819
|
for (let vi = 0; vi < uniqueVideos.length && vi < 20; vi++) {
|
|
44771
45820
|
const v = uniqueVideos[vi];
|
|
44772
45821
|
const previewName = `video-${vi}-preview.png`;
|
|
44773
|
-
const previewPath =
|
|
45822
|
+
const previewPath = join55(previewDir, previewName);
|
|
44774
45823
|
try {
|
|
44775
45824
|
await page.evaluate(`window.scrollTo(0, ${Math.max(0, v.top - 100)})`);
|
|
44776
45825
|
await new Promise((r2) => setTimeout(r2, 300));
|
|
@@ -44809,7 +45858,7 @@ async function captureVideoManifest(page, outputDir, progress) {
|
|
|
44809
45858
|
}
|
|
44810
45859
|
if (videoManifest.length > 0) {
|
|
44811
45860
|
writeFileSync23(
|
|
44812
|
-
|
|
45861
|
+
join55(outputDir, "extracted", "video-manifest.json"),
|
|
44813
45862
|
JSON.stringify(videoManifest, null, 2),
|
|
44814
45863
|
"utf-8"
|
|
44815
45864
|
);
|
|
@@ -45091,7 +46140,7 @@ var require_p_retry = __commonJS({
|
|
|
45091
46140
|
return error;
|
|
45092
46141
|
};
|
|
45093
46142
|
var isNetworkError = (errorMessage) => networkErrorMsgs.includes(errorMessage);
|
|
45094
|
-
var pRetry2 = (input, options) => new Promise((
|
|
46143
|
+
var pRetry2 = (input, options) => new Promise((resolve40, reject) => {
|
|
45095
46144
|
options = {
|
|
45096
46145
|
onFailedAttempt: () => {
|
|
45097
46146
|
},
|
|
@@ -45101,7 +46150,7 @@ var require_p_retry = __commonJS({
|
|
|
45101
46150
|
const operation = retry.operation(options);
|
|
45102
46151
|
operation.attempt(async (attemptNumber) => {
|
|
45103
46152
|
try {
|
|
45104
|
-
|
|
46153
|
+
resolve40(await input(attemptNumber));
|
|
45105
46154
|
} catch (error) {
|
|
45106
46155
|
if (!(error instanceof Error)) {
|
|
45107
46156
|
reject(new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`));
|
|
@@ -45637,8 +46686,8 @@ var require_retry3 = __commonJS({
|
|
|
45637
46686
|
}
|
|
45638
46687
|
const delay = getNextRetryDelay(config);
|
|
45639
46688
|
err.config.retryConfig.currentRetryAttempt += 1;
|
|
45640
|
-
const backoff = config.retryBackoff ? config.retryBackoff(err, delay) : new Promise((
|
|
45641
|
-
setTimeout(
|
|
46689
|
+
const backoff = config.retryBackoff ? config.retryBackoff(err, delay) : new Promise((resolve40) => {
|
|
46690
|
+
setTimeout(resolve40, delay);
|
|
45642
46691
|
});
|
|
45643
46692
|
if (config.onRetryAttempt) {
|
|
45644
46693
|
await config.onRetryAttempt(err);
|
|
@@ -46546,8 +47595,8 @@ var require_helpers = __commonJS({
|
|
|
46546
47595
|
function req(url, opts = {}) {
|
|
46547
47596
|
const href = typeof url === "string" ? url : url.href;
|
|
46548
47597
|
const req2 = (href.startsWith("https:") ? https2 : http4).request(url, opts);
|
|
46549
|
-
const promise = new Promise((
|
|
46550
|
-
req2.once("response",
|
|
47598
|
+
const promise = new Promise((resolve40, reject) => {
|
|
47599
|
+
req2.once("response", resolve40).once("error", reject).end();
|
|
46551
47600
|
});
|
|
46552
47601
|
req2.then = promise.then.bind(promise);
|
|
46553
47602
|
return req2;
|
|
@@ -46724,7 +47773,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
46724
47773
|
var debug_1 = __importDefault(require_src2());
|
|
46725
47774
|
var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
|
|
46726
47775
|
function parseProxyResponse(socket) {
|
|
46727
|
-
return new Promise((
|
|
47776
|
+
return new Promise((resolve40, reject) => {
|
|
46728
47777
|
let buffersLength = 0;
|
|
46729
47778
|
const buffers = [];
|
|
46730
47779
|
function read() {
|
|
@@ -46790,7 +47839,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
46790
47839
|
}
|
|
46791
47840
|
debug("got proxy server response: %o %o", firstLine, headers);
|
|
46792
47841
|
cleanup();
|
|
46793
|
-
|
|
47842
|
+
resolve40({
|
|
46794
47843
|
connect: {
|
|
46795
47844
|
statusCode,
|
|
46796
47845
|
statusText,
|
|
@@ -47034,7 +48083,7 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
47034
48083
|
return new originalPromise(executor);
|
|
47035
48084
|
}
|
|
47036
48085
|
function promiseResolvedWith(value) {
|
|
47037
|
-
return newPromise((
|
|
48086
|
+
return newPromise((resolve40) => resolve40(value));
|
|
47038
48087
|
}
|
|
47039
48088
|
function promiseRejectedWith(reason) {
|
|
47040
48089
|
return originalPromiseReject(reason);
|
|
@@ -47204,8 +48253,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
47204
48253
|
return new TypeError("Cannot " + name + " a stream using a released reader");
|
|
47205
48254
|
}
|
|
47206
48255
|
function defaultReaderClosedPromiseInitialize(reader) {
|
|
47207
|
-
reader._closedPromise = newPromise((
|
|
47208
|
-
reader._closedPromise_resolve =
|
|
48256
|
+
reader._closedPromise = newPromise((resolve40, reject) => {
|
|
48257
|
+
reader._closedPromise_resolve = resolve40;
|
|
47209
48258
|
reader._closedPromise_reject = reject;
|
|
47210
48259
|
});
|
|
47211
48260
|
}
|
|
@@ -47379,8 +48428,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
47379
48428
|
}
|
|
47380
48429
|
let resolvePromise;
|
|
47381
48430
|
let rejectPromise;
|
|
47382
|
-
const promise = newPromise((
|
|
47383
|
-
resolvePromise =
|
|
48431
|
+
const promise = newPromise((resolve40, reject) => {
|
|
48432
|
+
resolvePromise = resolve40;
|
|
47384
48433
|
rejectPromise = reject;
|
|
47385
48434
|
});
|
|
47386
48435
|
const readRequest = {
|
|
@@ -47485,8 +48534,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
47485
48534
|
const reader = this._reader;
|
|
47486
48535
|
let resolvePromise;
|
|
47487
48536
|
let rejectPromise;
|
|
47488
|
-
const promise = newPromise((
|
|
47489
|
-
resolvePromise =
|
|
48537
|
+
const promise = newPromise((resolve40, reject) => {
|
|
48538
|
+
resolvePromise = resolve40;
|
|
47490
48539
|
rejectPromise = reject;
|
|
47491
48540
|
});
|
|
47492
48541
|
const readRequest = {
|
|
@@ -48505,8 +49554,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
48505
49554
|
}
|
|
48506
49555
|
let resolvePromise;
|
|
48507
49556
|
let rejectPromise;
|
|
48508
|
-
const promise = newPromise((
|
|
48509
|
-
resolvePromise =
|
|
49557
|
+
const promise = newPromise((resolve40, reject) => {
|
|
49558
|
+
resolvePromise = resolve40;
|
|
48510
49559
|
rejectPromise = reject;
|
|
48511
49560
|
});
|
|
48512
49561
|
const readIntoRequest = {
|
|
@@ -48818,10 +49867,10 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
48818
49867
|
wasAlreadyErroring = true;
|
|
48819
49868
|
reason = void 0;
|
|
48820
49869
|
}
|
|
48821
|
-
const promise = newPromise((
|
|
49870
|
+
const promise = newPromise((resolve40, reject) => {
|
|
48822
49871
|
stream._pendingAbortRequest = {
|
|
48823
49872
|
_promise: void 0,
|
|
48824
|
-
_resolve:
|
|
49873
|
+
_resolve: resolve40,
|
|
48825
49874
|
_reject: reject,
|
|
48826
49875
|
_reason: reason,
|
|
48827
49876
|
_wasAlreadyErroring: wasAlreadyErroring
|
|
@@ -48838,9 +49887,9 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
48838
49887
|
if (state === "closed" || state === "errored") {
|
|
48839
49888
|
return promiseRejectedWith(new TypeError(`The stream (in ${state} state) is not in the writable state and cannot be closed`));
|
|
48840
49889
|
}
|
|
48841
|
-
const promise = newPromise((
|
|
49890
|
+
const promise = newPromise((resolve40, reject) => {
|
|
48842
49891
|
const closeRequest = {
|
|
48843
|
-
_resolve:
|
|
49892
|
+
_resolve: resolve40,
|
|
48844
49893
|
_reject: reject
|
|
48845
49894
|
};
|
|
48846
49895
|
stream._closeRequest = closeRequest;
|
|
@@ -48853,9 +49902,9 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
48853
49902
|
return promise;
|
|
48854
49903
|
}
|
|
48855
49904
|
function WritableStreamAddWriteRequest(stream) {
|
|
48856
|
-
const promise = newPromise((
|
|
49905
|
+
const promise = newPromise((resolve40, reject) => {
|
|
48857
49906
|
const writeRequest = {
|
|
48858
|
-
_resolve:
|
|
49907
|
+
_resolve: resolve40,
|
|
48859
49908
|
_reject: reject
|
|
48860
49909
|
};
|
|
48861
49910
|
stream._writeRequests.push(writeRequest);
|
|
@@ -49471,8 +50520,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
49471
50520
|
return new TypeError("Cannot " + name + " a stream using a released writer");
|
|
49472
50521
|
}
|
|
49473
50522
|
function defaultWriterClosedPromiseInitialize(writer) {
|
|
49474
|
-
writer._closedPromise = newPromise((
|
|
49475
|
-
writer._closedPromise_resolve =
|
|
50523
|
+
writer._closedPromise = newPromise((resolve40, reject) => {
|
|
50524
|
+
writer._closedPromise_resolve = resolve40;
|
|
49476
50525
|
writer._closedPromise_reject = reject;
|
|
49477
50526
|
writer._closedPromiseState = "pending";
|
|
49478
50527
|
});
|
|
@@ -49508,8 +50557,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
49508
50557
|
writer._closedPromiseState = "resolved";
|
|
49509
50558
|
}
|
|
49510
50559
|
function defaultWriterReadyPromiseInitialize(writer) {
|
|
49511
|
-
writer._readyPromise = newPromise((
|
|
49512
|
-
writer._readyPromise_resolve =
|
|
50560
|
+
writer._readyPromise = newPromise((resolve40, reject) => {
|
|
50561
|
+
writer._readyPromise_resolve = resolve40;
|
|
49513
50562
|
writer._readyPromise_reject = reject;
|
|
49514
50563
|
});
|
|
49515
50564
|
writer._readyPromiseState = "pending";
|
|
@@ -49596,7 +50645,7 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
49596
50645
|
source._disturbed = true;
|
|
49597
50646
|
let shuttingDown = false;
|
|
49598
50647
|
let currentWrite = promiseResolvedWith(void 0);
|
|
49599
|
-
return newPromise((
|
|
50648
|
+
return newPromise((resolve40, reject) => {
|
|
49600
50649
|
let abortAlgorithm;
|
|
49601
50650
|
if (signal !== void 0) {
|
|
49602
50651
|
abortAlgorithm = () => {
|
|
@@ -49741,7 +50790,7 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
49741
50790
|
if (isError) {
|
|
49742
50791
|
reject(error);
|
|
49743
50792
|
} else {
|
|
49744
|
-
|
|
50793
|
+
resolve40(void 0);
|
|
49745
50794
|
}
|
|
49746
50795
|
return null;
|
|
49747
50796
|
}
|
|
@@ -50022,8 +51071,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
50022
51071
|
let branch1;
|
|
50023
51072
|
let branch2;
|
|
50024
51073
|
let resolveCancelPromise;
|
|
50025
|
-
const cancelPromise = newPromise((
|
|
50026
|
-
resolveCancelPromise =
|
|
51074
|
+
const cancelPromise = newPromise((resolve40) => {
|
|
51075
|
+
resolveCancelPromise = resolve40;
|
|
50027
51076
|
});
|
|
50028
51077
|
function pullAlgorithm() {
|
|
50029
51078
|
if (reading) {
|
|
@@ -50114,8 +51163,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
50114
51163
|
let branch1;
|
|
50115
51164
|
let branch2;
|
|
50116
51165
|
let resolveCancelPromise;
|
|
50117
|
-
const cancelPromise = newPromise((
|
|
50118
|
-
resolveCancelPromise =
|
|
51166
|
+
const cancelPromise = newPromise((resolve40) => {
|
|
51167
|
+
resolveCancelPromise = resolve40;
|
|
50119
51168
|
});
|
|
50120
51169
|
function forwardReaderError(thisReader) {
|
|
50121
51170
|
uponRejection(thisReader._closedPromise, (r2) => {
|
|
@@ -50895,8 +51944,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
50895
51944
|
const writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1);
|
|
50896
51945
|
const writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy);
|
|
50897
51946
|
let startPromise_resolve;
|
|
50898
|
-
const startPromise = newPromise((
|
|
50899
|
-
startPromise_resolve =
|
|
51947
|
+
const startPromise = newPromise((resolve40) => {
|
|
51948
|
+
startPromise_resolve = resolve40;
|
|
50900
51949
|
});
|
|
50901
51950
|
InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);
|
|
50902
51951
|
SetUpTransformStreamDefaultControllerFromTransformer(this, transformer);
|
|
@@ -50989,8 +52038,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
50989
52038
|
if (stream._backpressureChangePromise !== void 0) {
|
|
50990
52039
|
stream._backpressureChangePromise_resolve();
|
|
50991
52040
|
}
|
|
50992
|
-
stream._backpressureChangePromise = newPromise((
|
|
50993
|
-
stream._backpressureChangePromise_resolve =
|
|
52041
|
+
stream._backpressureChangePromise = newPromise((resolve40) => {
|
|
52042
|
+
stream._backpressureChangePromise_resolve = resolve40;
|
|
50994
52043
|
});
|
|
50995
52044
|
stream._backpressure = backpressure;
|
|
50996
52045
|
}
|
|
@@ -51158,8 +52207,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
51158
52207
|
return controller._finishPromise;
|
|
51159
52208
|
}
|
|
51160
52209
|
const readable = stream._readable;
|
|
51161
|
-
controller._finishPromise = newPromise((
|
|
51162
|
-
controller._finishPromise_resolve =
|
|
52210
|
+
controller._finishPromise = newPromise((resolve40, reject) => {
|
|
52211
|
+
controller._finishPromise_resolve = resolve40;
|
|
51163
52212
|
controller._finishPromise_reject = reject;
|
|
51164
52213
|
});
|
|
51165
52214
|
const cancelPromise = controller._cancelAlgorithm(reason);
|
|
@@ -51185,8 +52234,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
51185
52234
|
return controller._finishPromise;
|
|
51186
52235
|
}
|
|
51187
52236
|
const readable = stream._readable;
|
|
51188
|
-
controller._finishPromise = newPromise((
|
|
51189
|
-
controller._finishPromise_resolve =
|
|
52237
|
+
controller._finishPromise = newPromise((resolve40, reject) => {
|
|
52238
|
+
controller._finishPromise_resolve = resolve40;
|
|
51190
52239
|
controller._finishPromise_reject = reject;
|
|
51191
52240
|
});
|
|
51192
52241
|
const flushPromise = controller._flushAlgorithm();
|
|
@@ -51216,8 +52265,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
51216
52265
|
return controller._finishPromise;
|
|
51217
52266
|
}
|
|
51218
52267
|
const writable = stream._writable;
|
|
51219
|
-
controller._finishPromise = newPromise((
|
|
51220
|
-
controller._finishPromise_resolve =
|
|
52268
|
+
controller._finishPromise = newPromise((resolve40, reject) => {
|
|
52269
|
+
controller._finishPromise_resolve = resolve40;
|
|
51221
52270
|
controller._finishPromise_reject = reject;
|
|
51222
52271
|
});
|
|
51223
52272
|
const cancelPromise = controller._cancelAlgorithm(reason);
|
|
@@ -53186,7 +54235,7 @@ import zlib from "zlib";
|
|
|
53186
54235
|
import Stream2, { PassThrough as PassThrough2, pipeline as pump } from "stream";
|
|
53187
54236
|
import { Buffer as Buffer3 } from "buffer";
|
|
53188
54237
|
async function fetch3(url, options_) {
|
|
53189
|
-
return new Promise((
|
|
54238
|
+
return new Promise((resolve40, reject) => {
|
|
53190
54239
|
const request = new Request2(url, options_);
|
|
53191
54240
|
const { parsedURL, options } = getNodeRequestOptions(request);
|
|
53192
54241
|
if (!supportedSchemas.has(parsedURL.protocol)) {
|
|
@@ -53195,7 +54244,7 @@ async function fetch3(url, options_) {
|
|
|
53195
54244
|
if (parsedURL.protocol === "data:") {
|
|
53196
54245
|
const data = dist_default(request.url);
|
|
53197
54246
|
const response2 = new Response2(data, { headers: { "Content-Type": data.typeFull } });
|
|
53198
|
-
|
|
54247
|
+
resolve40(response2);
|
|
53199
54248
|
return;
|
|
53200
54249
|
}
|
|
53201
54250
|
const send = (parsedURL.protocol === "https:" ? https : http3).request;
|
|
@@ -53317,7 +54366,7 @@ async function fetch3(url, options_) {
|
|
|
53317
54366
|
if (responseReferrerPolicy) {
|
|
53318
54367
|
requestOptions.referrerPolicy = responseReferrerPolicy;
|
|
53319
54368
|
}
|
|
53320
|
-
|
|
54369
|
+
resolve40(fetch3(new Request2(locationURL, requestOptions)));
|
|
53321
54370
|
finalize();
|
|
53322
54371
|
return;
|
|
53323
54372
|
}
|
|
@@ -53350,7 +54399,7 @@ async function fetch3(url, options_) {
|
|
|
53350
54399
|
const codings = headers.get("Content-Encoding");
|
|
53351
54400
|
if (!request.compress || request.method === "HEAD" || codings === null || response_.statusCode === 204 || response_.statusCode === 304) {
|
|
53352
54401
|
response = new Response2(body, responseOptions);
|
|
53353
|
-
|
|
54402
|
+
resolve40(response);
|
|
53354
54403
|
return;
|
|
53355
54404
|
}
|
|
53356
54405
|
const zlibOptions = {
|
|
@@ -53364,7 +54413,7 @@ async function fetch3(url, options_) {
|
|
|
53364
54413
|
}
|
|
53365
54414
|
});
|
|
53366
54415
|
response = new Response2(body, responseOptions);
|
|
53367
|
-
|
|
54416
|
+
resolve40(response);
|
|
53368
54417
|
return;
|
|
53369
54418
|
}
|
|
53370
54419
|
if (codings === "deflate" || codings === "x-deflate") {
|
|
@@ -53388,12 +54437,12 @@ async function fetch3(url, options_) {
|
|
|
53388
54437
|
});
|
|
53389
54438
|
}
|
|
53390
54439
|
response = new Response2(body, responseOptions);
|
|
53391
|
-
|
|
54440
|
+
resolve40(response);
|
|
53392
54441
|
});
|
|
53393
54442
|
raw.once("end", () => {
|
|
53394
54443
|
if (!response) {
|
|
53395
54444
|
response = new Response2(body, responseOptions);
|
|
53396
|
-
|
|
54445
|
+
resolve40(response);
|
|
53397
54446
|
}
|
|
53398
54447
|
});
|
|
53399
54448
|
return;
|
|
@@ -53405,11 +54454,11 @@ async function fetch3(url, options_) {
|
|
|
53405
54454
|
}
|
|
53406
54455
|
});
|
|
53407
54456
|
response = new Response2(body, responseOptions);
|
|
53408
|
-
|
|
54457
|
+
resolve40(response);
|
|
53409
54458
|
return;
|
|
53410
54459
|
}
|
|
53411
54460
|
response = new Response2(body, responseOptions);
|
|
53412
|
-
|
|
54461
|
+
resolve40(response);
|
|
53413
54462
|
});
|
|
53414
54463
|
writeToStream(request_, request).catch(reject);
|
|
53415
54464
|
});
|
|
@@ -59491,7 +60540,7 @@ var require_jwtaccess = __commonJS({
|
|
|
59491
60540
|
}
|
|
59492
60541
|
}
|
|
59493
60542
|
fromStreamAsync(inputStream) {
|
|
59494
|
-
return new Promise((
|
|
60543
|
+
return new Promise((resolve40, reject) => {
|
|
59495
60544
|
if (!inputStream) {
|
|
59496
60545
|
reject(new Error("Must pass in a stream containing the service account auth settings."));
|
|
59497
60546
|
}
|
|
@@ -59500,7 +60549,7 @@ var require_jwtaccess = __commonJS({
|
|
|
59500
60549
|
try {
|
|
59501
60550
|
const data = JSON.parse(s2);
|
|
59502
60551
|
this.fromJSON(data);
|
|
59503
|
-
|
|
60552
|
+
resolve40();
|
|
59504
60553
|
} catch (err) {
|
|
59505
60554
|
reject(err);
|
|
59506
60555
|
}
|
|
@@ -59739,7 +60788,7 @@ var require_jwtclient = __commonJS({
|
|
|
59739
60788
|
}
|
|
59740
60789
|
}
|
|
59741
60790
|
fromStreamAsync(inputStream) {
|
|
59742
|
-
return new Promise((
|
|
60791
|
+
return new Promise((resolve40, reject) => {
|
|
59743
60792
|
if (!inputStream) {
|
|
59744
60793
|
throw new Error("Must pass in a stream containing the service account auth settings.");
|
|
59745
60794
|
}
|
|
@@ -59748,7 +60797,7 @@ var require_jwtclient = __commonJS({
|
|
|
59748
60797
|
try {
|
|
59749
60798
|
const data = JSON.parse(s2);
|
|
59750
60799
|
this.fromJSON(data);
|
|
59751
|
-
|
|
60800
|
+
resolve40();
|
|
59752
60801
|
} catch (e2) {
|
|
59753
60802
|
reject(e2);
|
|
59754
60803
|
}
|
|
@@ -59881,7 +60930,7 @@ var require_refreshclient = __commonJS({
|
|
|
59881
60930
|
}
|
|
59882
60931
|
}
|
|
59883
60932
|
async fromStreamAsync(inputStream) {
|
|
59884
|
-
return new Promise((
|
|
60933
|
+
return new Promise((resolve40, reject) => {
|
|
59885
60934
|
if (!inputStream) {
|
|
59886
60935
|
return reject(new Error("Must pass in a stream containing the user refresh token."));
|
|
59887
60936
|
}
|
|
@@ -59890,7 +60939,7 @@ var require_refreshclient = __commonJS({
|
|
|
59890
60939
|
try {
|
|
59891
60940
|
const data = JSON.parse(s2);
|
|
59892
60941
|
this.fromJSON(data);
|
|
59893
|
-
return
|
|
60942
|
+
return resolve40();
|
|
59894
60943
|
} catch (err) {
|
|
59895
60944
|
return reject(err);
|
|
59896
60945
|
}
|
|
@@ -61723,7 +62772,7 @@ var require_pluggable_auth_handler = __commonJS({
|
|
|
61723
62772
|
* @return A promise that resolves with the executable response.
|
|
61724
62773
|
*/
|
|
61725
62774
|
retrieveResponseFromExecutable(envMap) {
|
|
61726
|
-
return new Promise((
|
|
62775
|
+
return new Promise((resolve40, reject) => {
|
|
61727
62776
|
const child = childProcess.spawn(this.commandComponents[0], this.commandComponents.slice(1), {
|
|
61728
62777
|
env: { ...process.env, ...Object.fromEntries(envMap) }
|
|
61729
62778
|
});
|
|
@@ -61745,7 +62794,7 @@ var require_pluggable_auth_handler = __commonJS({
|
|
|
61745
62794
|
try {
|
|
61746
62795
|
const responseJson = JSON.parse(output);
|
|
61747
62796
|
const response = new executable_response_1.ExecutableResponse(responseJson);
|
|
61748
|
-
return
|
|
62797
|
+
return resolve40(response);
|
|
61749
62798
|
} catch (error) {
|
|
61750
62799
|
if (error instanceof executable_response_1.ExecutableResponseError) {
|
|
61751
62800
|
return reject(error);
|
|
@@ -62648,7 +63697,7 @@ var require_googleauth = __commonJS({
|
|
|
62648
63697
|
}
|
|
62649
63698
|
}
|
|
62650
63699
|
fromStreamAsync(inputStream, options) {
|
|
62651
|
-
return new Promise((
|
|
63700
|
+
return new Promise((resolve40, reject) => {
|
|
62652
63701
|
if (!inputStream) {
|
|
62653
63702
|
throw new Error("Must pass in a stream containing the Google auth settings.");
|
|
62654
63703
|
}
|
|
@@ -62658,7 +63707,7 @@ var require_googleauth = __commonJS({
|
|
|
62658
63707
|
try {
|
|
62659
63708
|
const data = JSON.parse(chunks.join(""));
|
|
62660
63709
|
const r2 = this._cacheClientFromJSON(data, options);
|
|
62661
|
-
return
|
|
63710
|
+
return resolve40(r2);
|
|
62662
63711
|
} catch (err) {
|
|
62663
63712
|
if (!this.keyFilename)
|
|
62664
63713
|
throw err;
|
|
@@ -62668,7 +63717,7 @@ var require_googleauth = __commonJS({
|
|
|
62668
63717
|
});
|
|
62669
63718
|
this.cachedCredential = client;
|
|
62670
63719
|
this.setGapicJWTValues(client);
|
|
62671
|
-
return
|
|
63720
|
+
return resolve40(client);
|
|
62672
63721
|
}
|
|
62673
63722
|
} catch (err) {
|
|
62674
63723
|
return reject(err);
|
|
@@ -62704,17 +63753,17 @@ var require_googleauth = __commonJS({
|
|
|
62704
63753
|
* Run the Google Cloud SDK command that prints the default project ID
|
|
62705
63754
|
*/
|
|
62706
63755
|
async getDefaultServiceProjectId() {
|
|
62707
|
-
return new Promise((
|
|
63756
|
+
return new Promise((resolve40) => {
|
|
62708
63757
|
(0, child_process_1.exec)("gcloud config config-helper --format json", (err, stdout2) => {
|
|
62709
63758
|
if (!err && stdout2) {
|
|
62710
63759
|
try {
|
|
62711
63760
|
const projectId = JSON.parse(stdout2).configuration.properties.core.project;
|
|
62712
|
-
|
|
63761
|
+
resolve40(projectId);
|
|
62713
63762
|
return;
|
|
62714
63763
|
} catch (e2) {
|
|
62715
63764
|
}
|
|
62716
63765
|
}
|
|
62717
|
-
|
|
63766
|
+
resolve40(null);
|
|
62718
63767
|
});
|
|
62719
63768
|
});
|
|
62720
63769
|
}
|
|
@@ -70486,14 +71535,14 @@ function __asyncValues(o) {
|
|
|
70486
71535
|
}, i2);
|
|
70487
71536
|
function verb(n) {
|
|
70488
71537
|
i2[n] = o[n] && function(v) {
|
|
70489
|
-
return new Promise(function(
|
|
70490
|
-
v = o[n](v), settle(
|
|
71538
|
+
return new Promise(function(resolve40, reject) {
|
|
71539
|
+
v = o[n](v), settle(resolve40, reject, v.done, v.value);
|
|
70491
71540
|
});
|
|
70492
71541
|
};
|
|
70493
71542
|
}
|
|
70494
|
-
function settle(
|
|
71543
|
+
function settle(resolve40, reject, d, v) {
|
|
70495
71544
|
Promise.resolve(v).then(function(v2) {
|
|
70496
|
-
|
|
71545
|
+
resolve40({ value: v2, done: d });
|
|
70497
71546
|
}, reject);
|
|
70498
71547
|
}
|
|
70499
71548
|
}
|
|
@@ -80996,8 +82045,8 @@ var init_node4 = __esm({
|
|
|
80996
82045
|
const url = `${websocketBaseUrl}/ws/google.ai.generativelanguage.${apiVersion}.GenerativeService.BidiGenerateMusic?key=${apiKey}`;
|
|
80997
82046
|
let onopenResolve = () => {
|
|
80998
82047
|
};
|
|
80999
|
-
const onopenPromise = new Promise((
|
|
81000
|
-
onopenResolve =
|
|
82048
|
+
const onopenPromise = new Promise((resolve40) => {
|
|
82049
|
+
onopenResolve = resolve40;
|
|
81001
82050
|
});
|
|
81002
82051
|
const callbacks = params.callbacks;
|
|
81003
82052
|
const onopenAwaitedCallback = function() {
|
|
@@ -81203,8 +82252,8 @@ var init_node4 = __esm({
|
|
|
81203
82252
|
}
|
|
81204
82253
|
let onopenResolve = () => {
|
|
81205
82254
|
};
|
|
81206
|
-
const onopenPromise = new Promise((
|
|
81207
|
-
onopenResolve =
|
|
82255
|
+
const onopenPromise = new Promise((resolve40) => {
|
|
82256
|
+
onopenResolve = resolve40;
|
|
81208
82257
|
});
|
|
81209
82258
|
const callbacks = params.callbacks;
|
|
81210
82259
|
const onopenAwaitedCallback = function() {
|
|
@@ -83513,7 +84562,7 @@ var init_node4 = __esm({
|
|
|
83513
84562
|
return void 0;
|
|
83514
84563
|
}
|
|
83515
84564
|
};
|
|
83516
|
-
sleep$1 = (ms) => new Promise((
|
|
84565
|
+
sleep$1 = (ms) => new Promise((resolve40) => setTimeout(resolve40, ms));
|
|
83517
84566
|
FallbackEncoder = ({ headers, body }) => {
|
|
83518
84567
|
return {
|
|
83519
84568
|
bodyHeaders: {
|
|
@@ -84022,8 +85071,8 @@ ${underline2}`);
|
|
|
84022
85071
|
};
|
|
84023
85072
|
APIPromise = class _APIPromise extends Promise {
|
|
84024
85073
|
constructor(client, responsePromise, parseResponse = defaultParseResponse) {
|
|
84025
|
-
super((
|
|
84026
|
-
|
|
85074
|
+
super((resolve40) => {
|
|
85075
|
+
resolve40(null);
|
|
84027
85076
|
});
|
|
84028
85077
|
this.responsePromise = responsePromise;
|
|
84029
85078
|
this.parseResponse = parseResponse;
|
|
@@ -85265,7 +86314,7 @@ ${underline2}`);
|
|
|
85265
86314
|
|
|
85266
86315
|
// src/capture/contentExtractor.ts
|
|
85267
86316
|
import { readdirSync as readdirSync18, statSync as statSync20, readFileSync as readFileSync40 } from "fs";
|
|
85268
|
-
import { join as
|
|
86317
|
+
import { join as join56 } from "path";
|
|
85269
86318
|
async function detectLibraries(page, capturedShaders) {
|
|
85270
86319
|
let detectedLibraries = [];
|
|
85271
86320
|
try {
|
|
@@ -85385,7 +86434,7 @@ async function captionImagesWithGemini(outputDir, progress, warnings) {
|
|
|
85385
86434
|
try {
|
|
85386
86435
|
const { GoogleGenAI: GoogleGenAI2 } = await Promise.resolve().then(() => (init_node4(), node_exports));
|
|
85387
86436
|
const ai = new GoogleGenAI2({ apiKey: geminiKey });
|
|
85388
|
-
const imageFiles = readdirSync18(
|
|
86437
|
+
const imageFiles = readdirSync18(join56(outputDir, "assets")).filter(
|
|
85389
86438
|
(f3) => /\.(png|jpg|jpeg|webp|gif)$/i.test(f3)
|
|
85390
86439
|
);
|
|
85391
86440
|
const model = process.env.HYPERFRAMES_GEMINI_MODEL || "gemini-3.1-flash-lite-preview";
|
|
@@ -85394,7 +86443,7 @@ async function captionImagesWithGemini(outputDir, progress, warnings) {
|
|
|
85394
86443
|
const batch = imageFiles.slice(i2, i2 + BATCH_SIZE);
|
|
85395
86444
|
const results = await Promise.allSettled(
|
|
85396
86445
|
batch.map(async (file) => {
|
|
85397
|
-
const filePath =
|
|
86446
|
+
const filePath = join56(outputDir, "assets", file);
|
|
85398
86447
|
const stat3 = statSync20(filePath);
|
|
85399
86448
|
if (stat3.size > 4e6) return { file, caption: "" };
|
|
85400
86449
|
const buffer = readFileSync40(filePath);
|
|
@@ -85443,11 +86492,11 @@ function generateAssetDescriptions(outputDir, tokens, catalogedAssets, geminiCap
|
|
|
85443
86492
|
const uncaptionedLines = [];
|
|
85444
86493
|
const svgLines = [];
|
|
85445
86494
|
const fontLines = [];
|
|
85446
|
-
const assetsPath =
|
|
86495
|
+
const assetsPath = join56(outputDir, "assets");
|
|
85447
86496
|
try {
|
|
85448
86497
|
for (const file of readdirSync18(assetsPath)) {
|
|
85449
86498
|
if (file === "svgs" || file === "fonts" || file === "lottie" || file === "videos") continue;
|
|
85450
|
-
const filePath =
|
|
86499
|
+
const filePath = join56(assetsPath, file);
|
|
85451
86500
|
const stat3 = statSync20(filePath);
|
|
85452
86501
|
if (!stat3.isFile()) continue;
|
|
85453
86502
|
const sizeKb = Math.round(stat3.size / 1024);
|
|
@@ -85476,7 +86525,7 @@ function generateAssetDescriptions(outputDir, tokens, catalogedAssets, geminiCap
|
|
|
85476
86525
|
} catch {
|
|
85477
86526
|
}
|
|
85478
86527
|
try {
|
|
85479
|
-
const svgsPath =
|
|
86528
|
+
const svgsPath = join56(assetsPath, "svgs");
|
|
85480
86529
|
for (const file of readdirSync18(svgsPath)) {
|
|
85481
86530
|
if (!file.endsWith(".svg")) continue;
|
|
85482
86531
|
const svgMatch = tokens.svgs.find(
|
|
@@ -85491,7 +86540,7 @@ function generateAssetDescriptions(outputDir, tokens, catalogedAssets, geminiCap
|
|
|
85491
86540
|
} catch {
|
|
85492
86541
|
}
|
|
85493
86542
|
try {
|
|
85494
|
-
const fontsPath =
|
|
86543
|
+
const fontsPath = join56(assetsPath, "fonts");
|
|
85495
86544
|
for (const file of readdirSync18(fontsPath)) {
|
|
85496
86545
|
fontLines.push(`fonts/${file} \u2014 font file`);
|
|
85497
86546
|
}
|
|
@@ -85511,12 +86560,12 @@ __export(agentPromptGenerator_exports, {
|
|
|
85511
86560
|
generateAgentPrompt: () => generateAgentPrompt
|
|
85512
86561
|
});
|
|
85513
86562
|
import { writeFileSync as writeFileSync24 } from "fs";
|
|
85514
|
-
import { join as
|
|
86563
|
+
import { join as join57 } from "path";
|
|
85515
86564
|
function generateAgentPrompt(outputDir, url, tokens, _animations, hasScreenshot, hasLottie, hasShaders, _catalogedAssets, detectedLibraries) {
|
|
85516
86565
|
const prompt = buildPrompt(url, tokens, hasScreenshot, hasLottie, hasShaders, detectedLibraries);
|
|
85517
|
-
writeFileSync24(
|
|
85518
|
-
writeFileSync24(
|
|
85519
|
-
writeFileSync24(
|
|
86566
|
+
writeFileSync24(join57(outputDir, "AGENTS.md"), prompt, "utf-8");
|
|
86567
|
+
writeFileSync24(join57(outputDir, "CLAUDE.md"), prompt, "utf-8");
|
|
86568
|
+
writeFileSync24(join57(outputDir, ".cursorrules"), prompt, "utf-8");
|
|
85520
86569
|
}
|
|
85521
86570
|
function buildPrompt(url, tokens, hasScreenshot, hasLottie, hasShaders, detectedLibraries) {
|
|
85522
86571
|
const title = tokens.title || new URL(url).hostname.replace(/^www\./, "");
|
|
@@ -85583,13 +86632,13 @@ var init_agentPromptGenerator = __esm({
|
|
|
85583
86632
|
});
|
|
85584
86633
|
|
|
85585
86634
|
// src/capture/scaffolding.ts
|
|
85586
|
-
import { existsSync as
|
|
85587
|
-
import { join as
|
|
86635
|
+
import { existsSync as existsSync56, writeFileSync as writeFileSync25, readFileSync as readFileSync41 } from "fs";
|
|
86636
|
+
import { join as join58, resolve as resolve38 } from "path";
|
|
85588
86637
|
function loadEnvFile(startDir) {
|
|
85589
86638
|
try {
|
|
85590
|
-
let dir =
|
|
86639
|
+
let dir = resolve38(startDir);
|
|
85591
86640
|
for (let i2 = 0; i2 < 5; i2++) {
|
|
85592
|
-
const envPath =
|
|
86641
|
+
const envPath = resolve38(dir, ".env");
|
|
85593
86642
|
try {
|
|
85594
86643
|
const envContent = readFileSync41(envPath, "utf-8");
|
|
85595
86644
|
for (const line of envContent.split("\n")) {
|
|
@@ -85603,15 +86652,15 @@ function loadEnvFile(startDir) {
|
|
|
85603
86652
|
}
|
|
85604
86653
|
break;
|
|
85605
86654
|
} catch {
|
|
85606
|
-
dir =
|
|
86655
|
+
dir = resolve38(dir, "..");
|
|
85607
86656
|
}
|
|
85608
86657
|
}
|
|
85609
86658
|
} catch {
|
|
85610
86659
|
}
|
|
85611
86660
|
}
|
|
85612
86661
|
async function generateProjectScaffold(outputDir, url, tokens, animationCatalog, hasScreenshots, hasLotties, hasShaders, catalogedAssets, progress, warnings, detectedLibraries) {
|
|
85613
|
-
const metaPath =
|
|
85614
|
-
if (!
|
|
86662
|
+
const metaPath = join58(outputDir, "meta.json");
|
|
86663
|
+
if (!existsSync56(metaPath)) {
|
|
85615
86664
|
const hostname = new URL(url).hostname.replace(/^www\./, "");
|
|
85616
86665
|
writeFileSync25(
|
|
85617
86666
|
metaPath,
|
|
@@ -85648,11 +86697,11 @@ var screenshotCapture_exports = {};
|
|
|
85648
86697
|
__export(screenshotCapture_exports, {
|
|
85649
86698
|
captureScrollScreenshots: () => captureScrollScreenshots
|
|
85650
86699
|
});
|
|
85651
|
-
import { writeFileSync as writeFileSync26, mkdirSync as
|
|
85652
|
-
import { join as
|
|
86700
|
+
import { writeFileSync as writeFileSync26, mkdirSync as mkdirSync31 } from "fs";
|
|
86701
|
+
import { join as join59 } from "path";
|
|
85653
86702
|
async function captureScrollScreenshots(page, outputDir) {
|
|
85654
|
-
const screenshotsDir =
|
|
85655
|
-
|
|
86703
|
+
const screenshotsDir = join59(outputDir, "screenshots");
|
|
86704
|
+
mkdirSync31(screenshotsDir, { recursive: true });
|
|
85656
86705
|
const MAX_SCREENSHOTS = 20;
|
|
85657
86706
|
const filePaths = [];
|
|
85658
86707
|
try {
|
|
@@ -85685,7 +86734,7 @@ async function captureScrollScreenshots(page, outputDir) {
|
|
|
85685
86734
|
finalPositions[i2] / Math.max(1, scrollHeight - viewportHeight) * 100
|
|
85686
86735
|
);
|
|
85687
86736
|
const filename = `scroll-${String(Math.min(pct, 100)).padStart(3, "0")}.png`;
|
|
85688
|
-
const filePath =
|
|
86737
|
+
const filePath = join59(screenshotsDir, filename);
|
|
85689
86738
|
const buffer = await page.screenshot({ type: "png" });
|
|
85690
86739
|
writeFileSync26(filePath, buffer);
|
|
85691
86740
|
filePaths.push(`screenshots/${filename}`);
|
|
@@ -85998,8 +87047,8 @@ var capture_exports = {};
|
|
|
85998
87047
|
__export(capture_exports, {
|
|
85999
87048
|
captureWebsite: () => captureWebsite
|
|
86000
87049
|
});
|
|
86001
|
-
import { mkdirSync as
|
|
86002
|
-
import { join as
|
|
87050
|
+
import { mkdirSync as mkdirSync32, writeFileSync as writeFileSync27, existsSync as existsSync57 } from "fs";
|
|
87051
|
+
import { join as join60 } from "path";
|
|
86003
87052
|
async function captureWebsite(opts, onProgress) {
|
|
86004
87053
|
const {
|
|
86005
87054
|
url,
|
|
@@ -86016,9 +87065,9 @@ async function captureWebsite(opts, onProgress) {
|
|
|
86016
87065
|
onProgress?.(stage, detail);
|
|
86017
87066
|
};
|
|
86018
87067
|
loadEnvFile(outputDir);
|
|
86019
|
-
|
|
86020
|
-
|
|
86021
|
-
|
|
87068
|
+
mkdirSync32(join60(outputDir, "extracted"), { recursive: true });
|
|
87069
|
+
mkdirSync32(join60(outputDir, "screenshots"), { recursive: true });
|
|
87070
|
+
mkdirSync32(join60(outputDir, "assets"), { recursive: true });
|
|
86022
87071
|
progress("browser", "Launching headless Chrome...");
|
|
86023
87072
|
const { ensureBrowser: ensureBrowser2 } = await Promise.resolve().then(() => (init_manager2(), manager_exports2));
|
|
86024
87073
|
const browser = await ensureBrowser2();
|
|
@@ -86174,8 +87223,8 @@ async function captureWebsite(opts, onProgress) {
|
|
|
86174
87223
|
} catch {
|
|
86175
87224
|
}
|
|
86176
87225
|
if (discoveredLotties.length > 0) {
|
|
86177
|
-
const lottieDir =
|
|
86178
|
-
|
|
87226
|
+
const lottieDir = join60(outputDir, "assets", "lottie");
|
|
87227
|
+
mkdirSync32(lottieDir, { recursive: true });
|
|
86179
87228
|
const savedCount = await saveLottieAnimations(discoveredLotties, lottieDir);
|
|
86180
87229
|
if (savedCount > 0) {
|
|
86181
87230
|
await renderLottiePreviews(chromeBrowser, lottieDir, outputDir);
|
|
@@ -86194,7 +87243,7 @@ async function captureWebsite(opts, onProgress) {
|
|
|
86194
87243
|
});
|
|
86195
87244
|
capturedShaders = unique;
|
|
86196
87245
|
writeFileSync27(
|
|
86197
|
-
|
|
87246
|
+
join60(outputDir, "extracted", "shaders.json"),
|
|
86198
87247
|
JSON.stringify(unique, null, 2),
|
|
86199
87248
|
"utf-8"
|
|
86200
87249
|
);
|
|
@@ -86205,7 +87254,7 @@ async function captureWebsite(opts, onProgress) {
|
|
|
86205
87254
|
progress("tokens", "Extracting design tokens...");
|
|
86206
87255
|
const tokens = await extractTokens(page1);
|
|
86207
87256
|
writeFileSync27(
|
|
86208
|
-
|
|
87257
|
+
join60(outputDir, "extracted", "tokens.json"),
|
|
86209
87258
|
JSON.stringify(tokens, null, 2),
|
|
86210
87259
|
"utf-8"
|
|
86211
87260
|
);
|
|
@@ -86279,7 +87328,7 @@ async function captureWebsite(opts, onProgress) {
|
|
|
86279
87328
|
representativeAnimations: representativeAnims
|
|
86280
87329
|
};
|
|
86281
87330
|
writeFileSync27(
|
|
86282
|
-
|
|
87331
|
+
join60(outputDir, "extracted", "animations.json"),
|
|
86283
87332
|
JSON.stringify(leanCatalog, null, 2),
|
|
86284
87333
|
"utf-8"
|
|
86285
87334
|
);
|
|
@@ -86290,18 +87339,18 @@ async function captureWebsite(opts, onProgress) {
|
|
|
86290
87339
|
assets = await downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks);
|
|
86291
87340
|
}
|
|
86292
87341
|
if (visibleTextContent) {
|
|
86293
|
-
writeFileSync27(
|
|
87342
|
+
writeFileSync27(join60(outputDir, "extracted", "visible-text.txt"), visibleTextContent, "utf-8");
|
|
86294
87343
|
}
|
|
86295
87344
|
if (catalogedAssets.length > 0) {
|
|
86296
87345
|
writeFileSync27(
|
|
86297
|
-
|
|
87346
|
+
join60(outputDir, "extracted", "assets-catalog.json"),
|
|
86298
87347
|
JSON.stringify(catalogedAssets, null, 2),
|
|
86299
87348
|
"utf-8"
|
|
86300
87349
|
);
|
|
86301
87350
|
}
|
|
86302
87351
|
if (detectedLibraries.length > 0) {
|
|
86303
87352
|
writeFileSync27(
|
|
86304
|
-
|
|
87353
|
+
join60(outputDir, "extracted", "detected-libraries.json"),
|
|
86305
87354
|
JSON.stringify(detectedLibraries, null, 2),
|
|
86306
87355
|
"utf-8"
|
|
86307
87356
|
);
|
|
@@ -86312,7 +87361,7 @@ async function captureWebsite(opts, onProgress) {
|
|
|
86312
87361
|
const lines = generateAssetDescriptions(outputDir, tokens, catalogedAssets, geminiCaptions);
|
|
86313
87362
|
if (lines.length > 0) {
|
|
86314
87363
|
writeFileSync27(
|
|
86315
|
-
|
|
87364
|
+
join60(outputDir, "extracted", "asset-descriptions.md"),
|
|
86316
87365
|
"# Asset Descriptions\n\nOne line per file. Read this instead of opening every image individually.\n\n" + lines.map((l) => "- " + l).join("\n") + "\n",
|
|
86317
87366
|
"utf-8"
|
|
86318
87367
|
);
|
|
@@ -86328,7 +87377,7 @@ async function captureWebsite(opts, onProgress) {
|
|
|
86328
87377
|
animationCatalog,
|
|
86329
87378
|
screenshots.length > 0,
|
|
86330
87379
|
discoveredLotties.length > 0,
|
|
86331
|
-
|
|
87380
|
+
existsSync57(join60(outputDir, "extracted", "shaders.json")),
|
|
86332
87381
|
catalogedAssets,
|
|
86333
87382
|
progress,
|
|
86334
87383
|
warnings,
|
|
@@ -86368,15 +87417,15 @@ var init_capture = __esm({
|
|
|
86368
87417
|
var capture_exports2 = {};
|
|
86369
87418
|
__export(capture_exports2, {
|
|
86370
87419
|
default: () => capture_default,
|
|
86371
|
-
examples: () =>
|
|
87420
|
+
examples: () => examples23
|
|
86372
87421
|
});
|
|
86373
|
-
import { resolve as
|
|
86374
|
-
var
|
|
87422
|
+
import { resolve as resolve39 } from "path";
|
|
87423
|
+
var examples23, capture_default;
|
|
86375
87424
|
var init_capture2 = __esm({
|
|
86376
87425
|
"src/commands/capture.ts"() {
|
|
86377
87426
|
"use strict";
|
|
86378
87427
|
init_dist();
|
|
86379
|
-
|
|
87428
|
+
examples23 = [
|
|
86380
87429
|
["Capture a website", "hyperframes capture https://stripe.com"],
|
|
86381
87430
|
["Capture to a specific directory", "hyperframes capture https://linear.app -o linear-video"],
|
|
86382
87431
|
["JSON output for AI agents", "hyperframes capture https://example.com --json"]
|
|
@@ -86429,7 +87478,7 @@ var init_capture2 = __esm({
|
|
|
86429
87478
|
const hostname = new URL(url).hostname.replace(/^www\./, "");
|
|
86430
87479
|
outputName = `captures/${hostname.replace(/\./g, "-")}`;
|
|
86431
87480
|
}
|
|
86432
|
-
const outputDir =
|
|
87481
|
+
const outputDir = resolve39(outputName);
|
|
86433
87482
|
const isJson = args.json;
|
|
86434
87483
|
if (!isJson) {
|
|
86435
87484
|
const { c: c2 } = await Promise.resolve().then(() => (init_colors(), colors_exports));
|
|
@@ -86507,8 +87556,8 @@ var init_capture2 = __esm({
|
|
|
86507
87556
|
} catch (err) {
|
|
86508
87557
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
86509
87558
|
try {
|
|
86510
|
-
const { mkdirSync:
|
|
86511
|
-
|
|
87559
|
+
const { mkdirSync: mkdirSync34, writeFileSync: writeFileSync28 } = await import("fs");
|
|
87560
|
+
mkdirSync34(outputDir, { recursive: true });
|
|
86512
87561
|
const isTimeout = /timeout|timed out/i.test(errMsg);
|
|
86513
87562
|
const reason = isTimeout ? "Page navigation timed out \u2014 the site may be blocking headless browsers or requires authentication." : `Capture failed: ${errMsg}`;
|
|
86514
87563
|
writeFileSync28(
|
|
@@ -86674,10 +87723,10 @@ __export(autoUpdate_exports, {
|
|
|
86674
87723
|
reportCompletedUpdate: () => reportCompletedUpdate,
|
|
86675
87724
|
scheduleBackgroundInstall: () => scheduleBackgroundInstall
|
|
86676
87725
|
});
|
|
86677
|
-
import { spawn as
|
|
86678
|
-
import { appendFileSync as appendFileSync2, mkdirSync as
|
|
86679
|
-
import { homedir as
|
|
86680
|
-
import { join as
|
|
87726
|
+
import { spawn as spawn14 } from "child_process";
|
|
87727
|
+
import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync33, openSync as openSync2 } from "fs";
|
|
87728
|
+
import { homedir as homedir11 } from "os";
|
|
87729
|
+
import { join as join61 } from "path";
|
|
86681
87730
|
import { compareVersions as compareVersions2 } from "compare-versions";
|
|
86682
87731
|
function isAutoInstallDisabled() {
|
|
86683
87732
|
if (isDevMode()) return true;
|
|
@@ -86692,15 +87741,15 @@ function majorOf(version) {
|
|
|
86692
87741
|
}
|
|
86693
87742
|
function log(line) {
|
|
86694
87743
|
try {
|
|
86695
|
-
|
|
87744
|
+
mkdirSync33(CONFIG_DIR2, { recursive: true, mode: 448 });
|
|
86696
87745
|
appendFileSync2(LOG_FILE, `${(/* @__PURE__ */ new Date()).toISOString()} ${line}
|
|
86697
87746
|
`, { mode: 384 });
|
|
86698
87747
|
} catch {
|
|
86699
87748
|
}
|
|
86700
87749
|
}
|
|
86701
87750
|
function launchDetachedInstall(installCommand, version) {
|
|
86702
|
-
|
|
86703
|
-
const configFile =
|
|
87751
|
+
mkdirSync33(CONFIG_DIR2, { recursive: true, mode: 448 });
|
|
87752
|
+
const configFile = join61(CONFIG_DIR2, "config.json");
|
|
86704
87753
|
const nodeScript = `
|
|
86705
87754
|
const { exec } = require("node:child_process");
|
|
86706
87755
|
const { readFileSync, renameSync, writeFileSync } = require("node:fs");
|
|
@@ -86725,7 +87774,7 @@ function launchDetachedInstall(installCommand, version) {
|
|
|
86725
87774
|
});
|
|
86726
87775
|
`;
|
|
86727
87776
|
const out = openSync2(LOG_FILE, "a", 384);
|
|
86728
|
-
const child =
|
|
87777
|
+
const child = spawn14(process.execPath, ["-e", nodeScript], {
|
|
86729
87778
|
detached: true,
|
|
86730
87779
|
stdio: ["ignore", out, out],
|
|
86731
87780
|
windowsHide: true,
|
|
@@ -86819,8 +87868,8 @@ var init_autoUpdate = __esm({
|
|
|
86819
87868
|
init_config();
|
|
86820
87869
|
init_env();
|
|
86821
87870
|
init_installerDetection();
|
|
86822
|
-
CONFIG_DIR2 =
|
|
86823
|
-
LOG_FILE =
|
|
87871
|
+
CONFIG_DIR2 = join61(homedir11(), ".hyperframes");
|
|
87872
|
+
LOG_FILE = join61(CONFIG_DIR2, "auto-update.log");
|
|
86824
87873
|
PENDING_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
86825
87874
|
}
|
|
86826
87875
|
});
|
|
@@ -86874,7 +87923,7 @@ async function loadExamples(name) {
|
|
|
86874
87923
|
}
|
|
86875
87924
|
}
|
|
86876
87925
|
function renderRootHelp() {
|
|
86877
|
-
const NAME_COL =
|
|
87926
|
+
const NAME_COL = 19;
|
|
86878
87927
|
const CMD_COL = 46;
|
|
86879
87928
|
const lines = [];
|
|
86880
87929
|
lines.push(
|
|
@@ -86898,10 +87947,10 @@ function renderRootHelp() {
|
|
|
86898
87947
|
lines.push(`Run ${c.cyan("hyperframes <command> --help")} for more information about a command.`);
|
|
86899
87948
|
return lines.join("\n");
|
|
86900
87949
|
}
|
|
86901
|
-
function formatExamples(
|
|
87950
|
+
function formatExamples(examples24) {
|
|
86902
87951
|
const lines = [];
|
|
86903
87952
|
lines.push(c.bold("Examples:"));
|
|
86904
|
-
for (const [comment, command2] of
|
|
87953
|
+
for (const [comment, command2] of examples24) {
|
|
86905
87954
|
lines.push(` ${c.gray(`# ${comment}`)}`);
|
|
86906
87955
|
lines.push(` ${command2}`);
|
|
86907
87956
|
lines.push("");
|
|
@@ -86918,9 +87967,9 @@ async function showUsage2(cmd, parent) {
|
|
|
86918
87967
|
console.log(usage + "\n");
|
|
86919
87968
|
const name = meta?.name;
|
|
86920
87969
|
if (name) {
|
|
86921
|
-
const
|
|
86922
|
-
if (
|
|
86923
|
-
console.log(formatExamples(
|
|
87970
|
+
const examples24 = STATIC_EXAMPLES[name] ?? await loadExamples(name);
|
|
87971
|
+
if (examples24) {
|
|
87972
|
+
console.log(formatExamples(examples24) + "\n");
|
|
86924
87973
|
}
|
|
86925
87974
|
}
|
|
86926
87975
|
}
|
|
@@ -86976,7 +88025,8 @@ var init_help = __esm({
|
|
|
86976
88025
|
"transcribe",
|
|
86977
88026
|
"Transcribe audio/video to word-level timestamps, or import an existing transcript"
|
|
86978
88027
|
],
|
|
86979
|
-
["tts", "Generate speech audio from text using a local AI model (Kokoro-82M)"]
|
|
88028
|
+
["tts", "Generate speech audio from text using a local AI model (Kokoro-82M)"],
|
|
88029
|
+
["remove-background", "Remove background from a video or image to produce transparent media"]
|
|
86980
88030
|
]
|
|
86981
88031
|
},
|
|
86982
88032
|
{
|
|
@@ -87023,6 +88073,7 @@ var subCommands = {
|
|
|
87023
88073
|
compositions: () => Promise.resolve().then(() => (init_compositions(), compositions_exports)).then((m2) => m2.default),
|
|
87024
88074
|
benchmark: () => Promise.resolve().then(() => (init_benchmark(), benchmark_exports)).then((m2) => m2.default),
|
|
87025
88075
|
browser: () => Promise.resolve().then(() => (init_browser(), browser_exports)).then((m2) => m2.default),
|
|
88076
|
+
"remove-background": () => Promise.resolve().then(() => (init_remove_background(), remove_background_exports)).then((m2) => m2.default),
|
|
87026
88077
|
transcribe: () => Promise.resolve().then(() => (init_transcribe2(), transcribe_exports2)).then((m2) => m2.default),
|
|
87027
88078
|
tts: () => Promise.resolve().then(() => (init_tts(), tts_exports)).then((m2) => m2.default),
|
|
87028
88079
|
docs: () => Promise.resolve().then(() => (init_docs(), docs_exports)).then((m2) => m2.default),
|