cueframe 0.4.7 → 0.4.8

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/cueframe.js CHANGED
@@ -1,74 +1,84 @@
1
1
  #!/usr/bin/env node
2
- import{A as N,B as R,C as de,D as x,E as P,F as a,G as qe,H as S,I as D,J as M,K as u,L as h,M as mo,N as p,O as Pt,P as H,Q,R as ie,S as A,T as K,U as j,V as se,W as be,X as te,Y as Rs,a as fe,b as ys,c as ge,d as bs,e as Ss,f as zs,g as ws,h as Cs,i as Ee,j as Rt,k as Ae,l as Be,m as Ms,n as it,o as O,p as V,q as ce,r as I,s as _e,t as Ts,u as vt,v as s,w as re,x as i,y,z as v}from"./chunk-WFQZXC67.js";import{a as rc,c as sc}from"./chunk-MCQRX24V.js";var Pa=rc(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});function dW(n,t){if(n==null)return{};var e={};for(var o in n)if({}.hasOwnProperty.call(n,o)){if(t.indexOf(o)!==-1)continue;e[o]=n[o]}return e}var Ie=class{constructor(t,e,o){this.line=void 0,this.column=void 0,this.index=void 0,this.line=t,this.column=e,this.index=o}},rt=class{constructor(t,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=t,this.end=e}};function ue(n,t){let{line:e,column:o,index:r}=n;return new Ie(e,o+t,r+t)}var Qi="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",lW={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Qi},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Qi}},ea={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},no=n=>n.type==="UpdateExpression"?ea.UpdateExpression[`${n.prefix}`]:ea[n.type],uW={AccessorIsGenerator:({kind:n})=>`A ${n}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:n})=>`Missing initializer in ${n} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:n})=>`\`${n}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:n,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.
3
- - Did you mean \`export { '${n}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:n})=>`'${n==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:n})=>`Unsyntactic ${n==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:n})=>`A string literal cannot be used as an imported binding.
4
- - Did you mean \`import { "${n}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverDiscardElement:"'void' must be followed by an expression when not used in a binding position.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:n})=>`Expected number in radix ${n}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:n})=>`Escape sequence in keyword ${n}.`,InvalidIdentifier:({identifierName:n})=>`Invalid identifier ${n}.`,InvalidLhs:({ancestor:n})=>`Invalid left-hand side in ${no(n)}.`,InvalidLhsBinding:({ancestor:n})=>`Binding invalid left-hand side in ${no(n)}.`,InvalidLhsOptionalChaining:({ancestor:n})=>`Invalid optional chaining in the left-hand side of ${no(n)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:n})=>`Unexpected character '${n}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:n})=>`Private name #${n} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:n})=>`Label '${n}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:n})=>`This experimental syntax requires enabling the parser plugin: ${n.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:n})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${n.map(t=>JSON.stringify(t)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:n})=>`Duplicate key "${n}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:n})=>`An export name cannot include a lone surrogate, found '\\u${n.toString(16)}'.`,ModuleExportUndefined:({localName:n})=>`Export '${n}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:n})=>`Private names are only allowed in property accesses (\`obj.#${n}\`) or in \`in\` expressions (\`#${n} in obj\`).`,PrivateNameRedeclaration:({identifierName:n})=>`Duplicate private name #${n}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperCallNotNewExpression:"Cannot use new with super(...).",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:n})=>`Unexpected keyword '${n}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:n})=>`Unexpected reserved word '${n}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:n,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${n?`, expected "${n}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:"Unexpected void binding.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:n,onlyValidPropertyName:t})=>`The only valid meta property for ${n} is ${n}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:n})=>`Identifier '${n}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:"A void binding may not have an initializer.",YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},mW={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:n})=>`Assigning to '${n}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:n})=>`Binding '${n}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},hW={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:n})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(n)}\`.`},fW=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),xW=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:n})=>`Invalid topic token ${n}. In order to use ${n} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${n}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:n})=>`Hack-style pipe body cannot be an unparenthesized ${no({type:n})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'}),gW={UnsupportedBind:"Binding should be performed on object property.",UnsupportedBindRHS:"The right-hand side of binding can not be super or import."},yW=["message"];function ta(n,t,e){Object.defineProperty(n,t,{enumerable:!1,configurable:!0,value:e})}function bW({toMessage:n,code:t,reasonCode:e,syntaxPlugin:o}){let r=e==="MissingPlugin"||e==="MissingOneOfPlugins",c={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};return c[e]&&(e=c[e]),function d(l,m){let f=new SyntaxError;return f.code=t,f.reasonCode=e,f.loc=l,f.pos=l.index,f.syntaxPlugin=o,r&&(f.missingPlugin=m.missingPlugin),ta(f,"clone",function(b={}){var C;let{line:T,column:E,index:k}=(C=b.loc)!=null?C:l;return d(new Ie(T,E,k),Object.assign({},m,b.details))}),ta(f,"details",m),Object.defineProperty(f,"message",{configurable:!0,get(){let g=`${n(m)} (${l.line}:${l.column})`;return this.message=g,g},set(g){Object.defineProperty(this,"message",{value:g,writable:!0})}}),f}}function ze(n,t){if(Array.isArray(n))return o=>ze(o,n[0]);let e={};for(let o of Object.keys(n)){let r=n[o],c=typeof r=="string"?{message:()=>r}:typeof r=="function"?{message:r}:r,{message:d}=c,l=dW(c,yW),m=typeof d=="string"?()=>d:d;e[o]=bW(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:o,toMessage:m},t?{syntaxPlugin:t}:{},l))}return e}var w=Object.assign({},ze(lW),ze(uW),ze(mW),ze(hW),ze`pipelineOperator`(xW),ze`functionBind`(gW));function SW(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function zW(n){let t=SW();if(n==null)return t;if(n.annexB!=null&&n.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let e of Object.keys(t))n[e]!=null&&(t[e]=n[e]);if(t.startLine===1)n.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:n.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if((n.startColumn==null||n.startIndex==null)&&n.startIndex!=null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(t.sourceType==="commonjs"){if(n.allowAwaitOutsideFunction!=null)throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(n.allowReturnOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(n.allowNewTargetOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return t}var{defineProperty:wW}=Object,oa=(n,t)=>{n&&wW(n,t,{enumerable:!1,value:n[t]})};function xt(n){return oa(n.loc.start,"index"),oa(n.loc.end,"index"),n}var CW=n=>class extends n{parse(){let e=xt(super.parse());return this.optionFlags&256&&(e.tokens=e.tokens.map(xt)),e}parseRegExpLiteral({pattern:e,flags:o}){let r=null;try{r=new RegExp(e,o)}catch{}let c=this.estreeParseLiteral(r);return c.regex={pattern:e,flags:o},c}parseBigIntLiteral(e){let o;try{o=BigInt(e)}catch{o=null}let r=this.estreeParseLiteral(o);return r.bigint=String(r.value||e),r}parseDecimalLiteral(e){let r=this.estreeParseLiteral(null);return r.decimal=String(r.value||e),r}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}estreeParseChainExpression(e,o){let r=this.startNodeAtNode(e);return r.expression=e,this.finishNodeAt(r,"ChainExpression",o)}directiveToStmt(e){let o=e.value;delete e.value,this.castNodeTo(o,"Literal"),o.raw=o.extra.raw,o.value=o.extra.expressionValue;let r=this.castNodeTo(e,"ExpressionStatement");return r.expression=o,r.directive=o.extra.rawValue,delete o.extra,r}fillOptionalPropertiesForTSESLint(e){}cloneEstreeStringLiteral(e){let{start:o,end:r,loc:c,range:d,raw:l,value:m}=e,f=Object.create(e.constructor.prototype);return f.type="Literal",f.start=o,f.end=r,f.loc=c,f.range=d,f.raw=l,f.value=m,f}initFunction(e,o){super.initFunction(e,o),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var o;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((o=e.expression.extra)!=null&&o.parenthesized)}parseBlockBody(e,o,r,c,d){super.parseBlockBody(e,o,r,c,d);let l=e.directives.map(m=>this.directiveToStmt(m));e.body=l.concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let o=super.getPrivateNameSV(e);return delete e.id,e.name=o,this.castNodeTo(e,"PrivateIdentifier")}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,o){let r=super.parseLiteral(e,o);return r.raw=r.extra.raw,delete r.extra,r}parseFunctionBody(e,o,r=!1){super.parseFunctionBody(e,o,r),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,o,r,c,d,l,m=!1){let f=this.startNode();f.kind=e.kind,f=super.parseMethod(f,o,r,c,d,l,m),delete f.kind;let{typeParameters:g}=e;g&&(delete e.typeParameters,f.typeParameters=g,this.resetStartLocationFromNode(f,g));let b=this.castNodeTo(f,"FunctionExpression");return e.value=b,l==="ClassPrivateMethod"&&(e.computed=!1),l==="ObjectMethod"?(e.kind==="method"&&(e.kind="init"),e.shorthand=!1,this.finishNode(e,"Property")):this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){let o=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&this.castNodeTo(o,"PropertyDefinition"),o}parseClassPrivateProperty(...e){let o=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(this.castNodeTo(o,"PropertyDefinition"),o.computed=!1),o}parseClassAccessorProperty(e){let o=super.parseClassAccessorProperty(e);return this.getPluginOption("estree","classFeatures")&&(o.abstract&&this.hasPlugin("typescript")?(delete o.abstract,this.castNodeTo(o,"TSAbstractAccessorProperty")):this.castNodeTo(o,"AccessorProperty")),o}parseObjectProperty(e,o,r,c){let d=super.parseObjectProperty(e,o,r,c);return d&&(d.kind="init",this.castNodeTo(d,"Property")),d}finishObjectProperty(e){return e.kind="init",this.finishNode(e,"Property")}isValidLVal(e,o,r,c){return e==="Property"?"value":super.isValidLVal(e,o,r,c)}isAssignable(e,o){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,o):super.isAssignable(e,o)}toAssignable(e,o=!1){if(e!=null&&this.isObjectProperty(e)){let{key:r,value:c}=e;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.loc.start),this.toAssignable(c,o)}else super.toAssignable(e,o)}toAssignableObjectExpressionProp(e,o,r){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(w.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(w.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,o,r)}finishCallExpression(e,o){let r=super.finishCallExpression(e,o);if(r.callee.type==="Import"){var c,d;this.castNodeTo(r,"ImportExpression"),r.source=r.arguments[0],r.options=(c=r.arguments[1])!=null?c:null,r.attributes=(d=r.arguments[1])!=null?d:null,delete r.arguments,delete r.callee}else r.type==="OptionalCallExpression"?this.castNodeTo(r,"CallExpression"):r.optional=!1;return r}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,o){let r=this.state.lastTokStartLoc,c=super.parseExport(e,o);switch(c.type){case"ExportAllDeclaration":c.exported=null;break;case"ExportNamedDeclaration":c.specifiers.length===1&&c.specifiers[0].type==="ExportNamespaceSpecifier"&&(this.castNodeTo(c,"ExportAllDeclaration"),c.exported=c.specifiers[0].exported,delete c.specifiers);case"ExportDefaultDeclaration":{var d;let{declaration:l}=c;l?.type==="ClassDeclaration"&&((d=l.decorators)==null?void 0:d.length)>0&&l.start===c.start&&this.resetStartLocation(c,r)}break}return c}stopParseSubscript(e,o){let r=super.stopParseSubscript(e,o);return o.optionalChainMember?this.estreeParseChainExpression(r,e.loc.end):r}parseMember(e,o,r,c,d){let l=super.parseMember(e,o,r,c,d);return l.type==="OptionalMemberExpression"?this.castNodeTo(l,"MemberExpression"):l.optional=!1,l}isOptionalMemberExpression(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}castNodeTo(e,o){let r=super.castNodeTo(e,o);return this.fillOptionalPropertiesForTSESLint(r),r}cloneIdentifier(e){let o=super.cloneIdentifier(e);return this.fillOptionalPropertiesForTSESLint(o),o}cloneStringLiteral(e){return e.type==="Literal"?this.cloneEstreeStringLiteral(e):super.cloneStringLiteral(e)}finishNodeAt(e,o,r){return xt(super.finishNodeAt(e,o,r))}finishNode(e,o){let r=super.finishNode(e,o);return this.fillOptionalPropertiesForTSESLint(r),r}resetStartLocation(e,o){super.resetStartLocation(e,o),xt(e)}resetEndLocation(e,o=this.state.lastTokEndLoc){super.resetEndLocation(e,o),xt(e)}},Ve=class{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}},X={brace:new Ve("{"),j_oTag:new Ve("<tag"),j_cTag:new Ve("</tag"),j_expr:new Ve("<tag>...</tag>",!0)};X.template=new Ve("`",!0);var W=!0,L=!0,or=!0,gt=!0,Le=!0,MW=!0,co=class{constructor(t,e={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}},Ir=new Map;function J(n,t={}){t.keyword=n;let e=$(n,t);return Ir.set(n,e),e}function le(n,t){return $(n,{beforeExpr:W,binop:t})}var zt=-1,ke=[],Or=[],kr=[],Er=[],Ar=[],Lr=[];function $(n,t={}){var e,o,r,c;return++zt,Or.push(n),kr.push((e=t.binop)!=null?e:-1),Er.push((o=t.beforeExpr)!=null?o:!1),Ar.push((r=t.startsExpr)!=null?r:!1),Lr.push((c=t.prefix)!=null?c:!1),ke.push(new co(n,t)),zt}function G(n,t={}){var e,o,r,c;return++zt,Ir.set(n,zt),Or.push(n),kr.push((e=t.binop)!=null?e:-1),Er.push((o=t.beforeExpr)!=null?o:!1),Ar.push((r=t.startsExpr)!=null?r:!1),Lr.push((c=t.prefix)!=null?c:!1),ke.push(new co("name",t)),zt}var TW={bracketL:$("[",{beforeExpr:W,startsExpr:L}),bracketHashL:$("#[",{beforeExpr:W,startsExpr:L}),bracketBarL:$("[|",{beforeExpr:W,startsExpr:L}),bracketR:$("]"),bracketBarR:$("|]"),braceL:$("{",{beforeExpr:W,startsExpr:L}),braceBarL:$("{|",{beforeExpr:W,startsExpr:L}),braceHashL:$("#{",{beforeExpr:W,startsExpr:L}),braceR:$("}"),braceBarR:$("|}"),parenL:$("(",{beforeExpr:W,startsExpr:L}),parenR:$(")"),comma:$(",",{beforeExpr:W}),semi:$(";",{beforeExpr:W}),colon:$(":",{beforeExpr:W}),doubleColon:$("::",{beforeExpr:W}),dot:$("."),question:$("?",{beforeExpr:W}),questionDot:$("?."),arrow:$("=>",{beforeExpr:W}),template:$("template"),ellipsis:$("...",{beforeExpr:W}),backQuote:$("`",{startsExpr:L}),dollarBraceL:$("${",{beforeExpr:W,startsExpr:L}),templateTail:$("...`",{startsExpr:L}),templateNonTail:$("...${",{beforeExpr:W,startsExpr:L}),at:$("@"),hash:$("#",{startsExpr:L}),interpreterDirective:$("#!..."),eq:$("=",{beforeExpr:W,isAssign:gt}),assign:$("_=",{beforeExpr:W,isAssign:gt}),slashAssign:$("_=",{beforeExpr:W,isAssign:gt}),xorAssign:$("_=",{beforeExpr:W,isAssign:gt}),moduloAssign:$("_=",{beforeExpr:W,isAssign:gt}),incDec:$("++/--",{prefix:Le,postfix:MW,startsExpr:L}),bang:$("!",{beforeExpr:W,prefix:Le,startsExpr:L}),tilde:$("~",{beforeExpr:W,prefix:Le,startsExpr:L}),doubleCaret:$("^^",{startsExpr:L}),doubleAt:$("@@",{startsExpr:L}),pipeline:le("|>",0),nullishCoalescing:le("??",1),logicalOR:le("||",1),logicalAND:le("&&",2),bitwiseOR:le("|",3),bitwiseXOR:le("^",4),bitwiseAND:le("&",5),equality:le("==/!=/===/!==",6),lt:le("</>/<=/>=",7),gt:le("</>/<=/>=",7),relational:le("</>/<=/>=",7),bitShift:le("<</>>/>>>",8),bitShiftL:le("<</>>/>>>",8),bitShiftR:le("<</>>/>>>",8),plusMin:$("+/-",{beforeExpr:W,binop:9,prefix:Le,startsExpr:L}),modulo:$("%",{binop:10,startsExpr:L}),star:$("*",{binop:10}),slash:le("/",10),exponent:$("**",{beforeExpr:W,binop:11,rightAssociative:!0}),_in:J("in",{beforeExpr:W,binop:7}),_instanceof:J("instanceof",{beforeExpr:W,binop:7}),_break:J("break"),_case:J("case",{beforeExpr:W}),_catch:J("catch"),_continue:J("continue"),_debugger:J("debugger"),_default:J("default",{beforeExpr:W}),_else:J("else",{beforeExpr:W}),_finally:J("finally"),_function:J("function",{startsExpr:L}),_if:J("if"),_return:J("return",{beforeExpr:W}),_switch:J("switch"),_throw:J("throw",{beforeExpr:W,prefix:Le,startsExpr:L}),_try:J("try"),_var:J("var"),_const:J("const"),_with:J("with"),_new:J("new",{beforeExpr:W,startsExpr:L}),_this:J("this",{startsExpr:L}),_super:J("super",{startsExpr:L}),_class:J("class",{startsExpr:L}),_extends:J("extends",{beforeExpr:W}),_export:J("export"),_import:J("import",{startsExpr:L}),_null:J("null",{startsExpr:L}),_true:J("true",{startsExpr:L}),_false:J("false",{startsExpr:L}),_typeof:J("typeof",{beforeExpr:W,prefix:Le,startsExpr:L}),_void:J("void",{beforeExpr:W,prefix:Le,startsExpr:L}),_delete:J("delete",{beforeExpr:W,prefix:Le,startsExpr:L}),_do:J("do",{isLoop:or,beforeExpr:W}),_for:J("for",{isLoop:or}),_while:J("while",{isLoop:or}),_as:G("as",{startsExpr:L}),_assert:G("assert",{startsExpr:L}),_async:G("async",{startsExpr:L}),_await:G("await",{startsExpr:L}),_defer:G("defer",{startsExpr:L}),_from:G("from",{startsExpr:L}),_get:G("get",{startsExpr:L}),_let:G("let",{startsExpr:L}),_meta:G("meta",{startsExpr:L}),_of:G("of",{startsExpr:L}),_sent:G("sent",{startsExpr:L}),_set:G("set",{startsExpr:L}),_source:G("source",{startsExpr:L}),_static:G("static",{startsExpr:L}),_using:G("using",{startsExpr:L}),_yield:G("yield",{startsExpr:L}),_asserts:G("asserts",{startsExpr:L}),_checks:G("checks",{startsExpr:L}),_exports:G("exports",{startsExpr:L}),_global:G("global",{startsExpr:L}),_implements:G("implements",{startsExpr:L}),_intrinsic:G("intrinsic",{startsExpr:L}),_infer:G("infer",{startsExpr:L}),_is:G("is",{startsExpr:L}),_mixins:G("mixins",{startsExpr:L}),_proto:G("proto",{startsExpr:L}),_require:G("require",{startsExpr:L}),_satisfies:G("satisfies",{startsExpr:L}),_keyof:G("keyof",{startsExpr:L}),_readonly:G("readonly",{startsExpr:L}),_unique:G("unique",{startsExpr:L}),_abstract:G("abstract",{startsExpr:L}),_declare:G("declare",{startsExpr:L}),_enum:G("enum",{startsExpr:L}),_module:G("module",{startsExpr:L}),_namespace:G("namespace",{startsExpr:L}),_interface:G("interface",{startsExpr:L}),_type:G("type",{startsExpr:L}),_opaque:G("opaque",{startsExpr:L}),name:$("name",{startsExpr:L}),placeholder:$("%%",{startsExpr:L}),string:$("string",{startsExpr:L}),num:$("num",{startsExpr:L}),bigint:$("bigint",{startsExpr:L}),decimal:$("decimal",{startsExpr:L}),regexp:$("regexp",{startsExpr:L}),privateName:$("#name",{startsExpr:L}),eof:$("eof"),jsxName:$("jsxName"),jsxText:$("jsxText",{beforeExpr:W}),jsxTagStart:$("jsxTagStart",{startsExpr:L}),jsxTagEnd:$("jsxTagEnd")};function Z(n){return n>=93&&n<=133}function RW(n){return n<=92}function we(n){return n>=58&&n<=133}function ha(n){return n>=58&&n<=137}function vW(n){return Er[n]}function bt(n){return Ar[n]}function PW(n){return n>=29&&n<=33}function ra(n){return n>=129&&n<=131}function IW(n){return n>=90&&n<=92}function Dr(n){return n>=58&&n<=92}function OW(n){return n>=39&&n<=59}function kW(n){return n===34}function EW(n){return Lr[n]}function AW(n){return n>=121&&n<=123}function LW(n){return n>=124&&n<=130}function Fe(n){return Or[n]}function io(n){return kr[n]}function DW(n){return n===57}function po(n){return n>=24&&n<=25}function Oe(n){return ke[n]}ke[8].updateContext=n=>{n.pop()};ke[5].updateContext=ke[7].updateContext=ke[23].updateContext=n=>{n.push(X.brace)};ke[22].updateContext=n=>{n[n.length-1]===X.template?n.pop():n.push(X.template)};ke[143].updateContext=n=>{n.push(X.j_expr,X.j_oTag)};var Fr="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",fa="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",FW=new RegExp("["+Fr+"]"),jW=new RegExp("["+Fr+fa+"]");Fr=fa=null;var xa=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],VW=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];function cr(n,t){let e=65536;for(let o=0,r=t.length;o<r;o+=2){if(e+=t[o],e>n)return!1;if(e+=t[o+1],e>=n)return!0}return!1}function Pe(n){return n<65?n===36:n<=90?!0:n<97?n===95:n<=122?!0:n<=65535?n>=170&&FW.test(String.fromCharCode(n)):cr(n,xa)}function Ne(n){return n<48?n===36:n<58?!0:n<65?!1:n<=90?!0:n<97?n===95:n<=122?!0:n<=65535?n>=170&&jW.test(String.fromCharCode(n)):cr(n,xa)||cr(n,VW)}var jr={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},NW=new Set(jr.keyword),$W=new Set(jr.strict),BW=new Set(jr.strictBind);function ga(n,t){return t&&n==="await"||n==="enum"}function ya(n,t){return ga(n,t)||$W.has(n)}function ba(n){return BW.has(n)}function Sa(n,t){return ya(n,t)||ba(n)}function _W(n){return NW.has(n)}function qW(n,t,e){return n===64&&t===64&&Pe(e)}var UW=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function WW(n){return UW.has(n)}var wt=class{constructor(t){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=t}},Ct=class{constructor(t,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&128)return!0;if(e&1731)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new wt(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,e,o){let r=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(r,t,e,o);let c=r.names.get(t)||0;e&16?c=c|4:(r.firstLexicalName||(r.firstLexicalName=t),c=c|2),r.names.set(t,c),e&8&&this.maybeExportDefined(r,t)}else if(e&4)for(let c=this.scopeStack.length-1;c>=0&&(r=this.scopeStack[c],this.checkRedeclarationInScope(r,t,e,o),r.names.set(t,(r.names.get(t)||0)|1),this.maybeExportDefined(r,t),!(r.flags&1667));--c);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,o,r){this.isRedeclaredInScope(t,e,o)&&this.parser.raise(w.VarRedeclaration,r,{identifierName:e})}isRedeclaredInScope(t,e,o){if(!(o&1))return!1;if(o&8)return t.names.has(e);let r=t.names.get(e)||0;return o&16?(r&2)>0||!this.treatFunctionsAsVarInScope(t)&&(r&1)>0:(r&2)>0&&!(t.flags&8&&t.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(t)&&(r&4)>0}checkLocalExport(t){let{name:e}=t;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&1667)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&1731&&!(e&4))return e}}},pr=class extends wt{constructor(...t){super(...t),this.declareFunctions=new Set}},dr=class extends Ct{createScope(t){return new pr(t)}declareName(t,e,o){let r=this.currentScope();if(e&2048){this.checkRedeclarationInScope(r,t,e,o),this.maybeExportDefined(r,t),r.declareFunctions.add(t);return}super.declareName(t,e,o)}isRedeclaredInScope(t,e,o){if(super.isRedeclaredInScope(t,e,o))return!0;if(o&2048&&!t.declareFunctions.has(e)){let r=t.names.get(e);return(r&4)>0||(r&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},GW=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),B=ze`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:n})=>`Cannot overwrite reserved type ${n}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:n,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${n} = true,\` or \`${n} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:n,enumName:t})=>`Enum member names need to be unique, but the name \`${n}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:n})=>`Enum \`${n}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:n,enumName:t})=>`Enum type \`${n}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:n})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${n}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:n,memberName:t,explicitType:e})=>`Enum \`${n}\` has type \`${e}\`, so the initializer of \`${t}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:n,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${n}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:n,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${n}\`.`,EnumInvalidMemberName:({enumName:n,memberName:t,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${e}\`, in enum \`${n}\`.`,EnumNumberMemberNotInitialized:({enumName:n,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${n}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:n})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${n}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:n})=>`Unexpected reserved type ${n}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:n,suggestion:t})=>`\`declare export ${n}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function HW(n){return n.type==="DeclareExportAllDeclaration"||n.type==="DeclareExportDeclaration"&&(!n.declaration||n.declaration.type!=="TypeAlias"&&n.declaration.type!=="InterfaceDeclaration")}function sa(n){return n.importKind==="type"||n.importKind==="typeof"}var KW={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function JW(n,t){let e=[],o=[];for(let r=0;r<n.length;r++)(t(n[r],r,n)?e:o).push(n[r]);return[e,o]}var XW=/\*?\s*@((?:no)?flow)\b/,ZW=n=>class extends n{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return dr}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,o){e!==134&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,o)}addComment(e){if(this.flowPragma===void 0){let o=XW.exec(e.value);if(o)if(o[1]==="flow")this.flowPragma="flow";else if(o[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let o=this.state.inType;this.state.inType=!0,this.expect(e||14);let r=this.flowParseType();return this.state.inType=o,r}flowParsePredicate(){let e=this.startNode(),o=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>o.index+1&&this.raise(B.UnexpectedSpaceBetweenModuloChecks,o),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let o=null,r=null;return this.match(54)?(this.state.inType=e,r=this.flowParsePredicate()):(o=this.flowParseType(),this.state.inType=e,this.match(54)&&(r=this.flowParsePredicate())),[o,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let o=e.id=this.parseIdentifier(),r=this.startNode(),c=this.startNode();this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(10);let d=this.flowParseFunctionTypeParams();return r.params=d.params,r.rest=d.rest,r.this=d._this,this.expect(11),[r.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),c.typeAnnotation=this.finishNode(r,"FunctionTypeAnnotation"),o.typeAnnotation=this.finishNode(c,"TypeAnnotation"),this.resetEndLocation(o),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,o){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(o&&this.raise(B.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,o);throw this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(134)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let o=e.body=this.startNode(),r=o.body=[];for(this.expect(5);!this.match(8);){let l=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(B.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),r.push(super.parseImport(l))):(this.expectContextual(125,B.UnsupportedStatementInDeclareModule),r.push(this.flowParseDeclare(l,!0)))}this.scope.exit(),this.expect(8),this.finishNode(o,"BlockStatement");let c=null,d=!1;return r.forEach(l=>{HW(l)?(c==="CommonJS"&&this.raise(B.AmbiguousDeclareModuleKind,l),c="ES"):l.type==="DeclareModuleExports"&&(d&&this.raise(B.DuplicateDeclareModuleExports,l),c==="ES"&&this.raise(B.AmbiguousDeclareModuleKind,l),c="CommonJS",d=!0)}),e.kind=c||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,o){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!o){let r=this.state.value;throw this.raise(B.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:r,suggestion:KW[r]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"?(e.default=!1,delete e.exportKind,this.castNodeTo(e,"DeclareExportDeclaration")):this.castNodeTo(e,"DeclareExportAllDeclaration");throw this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let o=this.flowParseTypeAlias(e);return this.castNodeTo(o,"DeclareTypeAlias"),o}flowParseDeclareOpaqueType(e){this.next();let o=this.flowParseOpaqueType(e,!0);return this.castNodeTo(o,"DeclareOpaqueType"),o}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,o){if(e.id=this.flowParseRestrictedIdentifier(!o,!0),this.scope.declareName(e.id.name,o?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!o&&this.eat(12));if(o){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:o,allowExact:!1,allowSpread:!1,allowProto:o,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(B.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,o,r){GW.has(e)&&this.raise(r?B.AssignReservedType:B.UnexpectedReservedType,o,{reservedType:e})}flowParseRestrictedIdentifierName(e,o){return this.checkReservedType(this.state.value,this.state.startLoc,o),this.parseIdentifierName(e)}flowParseRestrictedIdentifier(e,o){let r=this.startNode(),c=this.flowParseRestrictedIdentifierName(e,o);return this.createIdentifier(r,c)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,o){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,o||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameterBound(){if(this.match(14)||this.isContextual(81)){let e=this.startNode();return this.next(),e.typeAnnotation=this.flowParseType(),this.finishNode(e,"TypeAnnotation")}}flowParseTypeParameter(e=!1){let o=this.state.startLoc,r=this.startNode(),c=this.flowParseVariance();return r.name=this.flowParseRestrictedIdentifierName(),r.variance=c,r.bound=this.flowParseTypeParameterBound(),this.match(29)?(this.eat(29),r.default=this.flowParseType()):e&&this.raise(B.MissingTypeParamDefault,o),this.finishNode(r,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,o=this.startNode();o.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let r=!1;do{let c=this.flowParseTypeParameter(r);o.params.push(c),c.default&&(r=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(o,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()!==X.brace){let o=this.state.context;this.state.context=[o[0]];try{return e()}finally{this.state.context=o}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),o=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let r=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=r}),this.state.inType=o,!this.state.inType&&this.curContext()===X.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return null;let e=this.startNode(),o=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=o,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,o,r){return e.static=o,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=r,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,o){return e.static=o,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,o){let r=this.startNode();return e.static=o,e.value=this.flowParseObjectTypeMethodish(r),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:o,allowSpread:r,allowProto:c,allowInexact:d}){let l=this.state.inType;this.state.inType=!0;let m=this.startNode();m.callProperties=[],m.properties=[],m.indexers=[],m.internalSlots=[];let f,g,b=!1;for(o&&this.match(6)?(this.expect(6),f=9,g=!0):(this.expect(5),f=8,g=!1),m.exact=g;!this.match(f);){let T=!1,E=null,k=null,q=this.startNode();if(c&&this.isContextual(118)){let U=this.lookahead();U.type!==14&&U.type!==17&&(this.next(),E=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let U=this.lookahead();U.type!==14&&U.type!==17&&(this.next(),T=!0)}let _=this.flowParseVariance();if(this.eat(0))E!=null&&this.unexpected(E),this.eat(0)?(_&&this.unexpected(_.loc.start),m.internalSlots.push(this.flowParseObjectTypeInternalSlot(q,T))):m.indexers.push(this.flowParseObjectTypeIndexer(q,T,_));else if(this.match(10)||this.match(47))E!=null&&this.unexpected(E),_&&this.unexpected(_.loc.start),m.callProperties.push(this.flowParseObjectTypeCallProperty(q,T));else{let U="init";if(this.isContextual(99)||this.isContextual(104)){let he=this.lookahead();ha(he.type)&&(U=this.state.value,this.next())}let me=this.flowParseObjectTypeProperty(q,T,E,_,U,r,d??!g);me===null?(b=!0,k=this.state.lastTokStartLoc):m.properties.push(me)}this.flowObjectTypeSemicolon(),k&&!this.match(8)&&!this.match(9)&&this.raise(B.UnexpectedExplicitInexactInObject,k)}this.expect(f),r&&(m.inexact=b);let C=this.finishNode(m,"ObjectTypeAnnotation");return this.state.inType=l,C}flowParseObjectTypeProperty(e,o,r,c,d,l,m){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(l?m||this.raise(B.InexactInsideExact,this.state.lastTokStartLoc):this.raise(B.InexactInsideNonObject,this.state.lastTokStartLoc),c&&this.raise(B.InexactVariance,c),null):(l||this.raise(B.UnexpectedSpreadType,this.state.lastTokStartLoc),r!=null&&this.unexpected(r),c&&this.raise(B.SpreadVariance,c),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=o,e.proto=r!=null,e.kind=d;let f=!1;return this.match(47)||this.match(10)?(e.method=!0,r!=null&&this.unexpected(r),c&&this.unexpected(c.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(d==="get"||d==="set")&&this.flowCheckGetterSetterParams(e),!l&&e.key.name==="constructor"&&e.value.this&&this.raise(B.ThisParamBannedInConstructor,e.value.this)):(d!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(f=!0),e.value=this.flowParseTypeInitialiser(),e.variance=c),e.optional=f,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let o=e.kind==="get"?0:1,r=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?B.GetterMayNotHaveThisParam:B.SetterMayNotHaveThisParam,e.value.this),r!==o&&this.raise(e.kind==="get"?w.BadGetterArity:w.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(w.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,o){e??(e=this.state.startLoc);let r=o||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let c=this.startNodeAt(e);c.qualification=r,c.id=this.flowParseRestrictedIdentifier(!0),r=this.finishNode(c,"QualifiedTypeIdentifier")}return r}flowParseGenericType(e,o){let r=this.startNodeAt(e);return r.typeParameters=null,r.id=this.flowParseQualifiedTypeIdentifier(e,o),this.match(47)&&(r.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(r,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(e.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(e,"TupleTypeAnnotation")}flowParseFunctionTypeParam(e){let o=null,r=!1,c=null,d=this.startNode(),l=this.lookahead(),m=this.state.type===78;return l.type===14||l.type===17?(m&&!e&&this.raise(B.ThisParamMustBeFirst,d),o=this.parseIdentifier(m),this.eat(17)&&(r=!0,m&&this.raise(B.ThisParamMayNotBeOptional,d)),c=this.flowParseTypeInitialiser()):c=this.flowParseType(),d.name=o,d.optional=r,d.typeAnnotation=c,this.finishNode(d,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){let o=this.startNodeAt(e.loc.start);return o.name=null,o.optional=!1,o.typeAnnotation=e,this.finishNode(o,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let o=null,r=null;for(this.match(78)&&(r=this.flowParseFunctionTypeParam(!0),r.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(o=this.flowParseFunctionTypeParam(!1)),{params:e,rest:o,_this:r}}flowIdentToTypeAnnotation(e,o,r){switch(r.name){case"any":return this.finishNode(o,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(o,"BooleanTypeAnnotation");case"mixed":return this.finishNode(o,"MixedTypeAnnotation");case"empty":return this.finishNode(o,"EmptyTypeAnnotation");case"number":return this.finishNode(o,"NumberTypeAnnotation");case"string":return this.finishNode(o,"StringTypeAnnotation");case"symbol":return this.finishNode(o,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(r.name),this.flowParseGenericType(e,r)}}flowParsePrimaryType(){let e=this.state.startLoc,o=this.startNode(),r,c,d=!1,l=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,c=this.flowParseTupleType(),this.state.noAnonFunctionType=l,c;case 47:{let m=this.startNode();return m.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),r=this.flowParseFunctionTypeParams(),m.params=r.params,m.rest=r.rest,m.this=r._this,this.expect(11),this.expect(19),m.returnType=this.flowParseType(),this.finishNode(m,"FunctionTypeAnnotation")}case 10:{let m=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(Z(this.state.type)||this.match(78)){let f=this.lookahead().type;d=f!==17&&f!==14}else d=!0;if(d){if(this.state.noAnonFunctionType=!1,c=this.flowParseType(),this.state.noAnonFunctionType=l,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),c;this.eat(12)}return c?r=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(c)]):r=this.flowParseFunctionTypeParams(),m.params=r.params,m.rest=r.rest,m.this=r._this,this.expect(11),this.expect(19),m.returnType=this.flowParseType(),m.typeParameters=null,this.finishNode(m,"FunctionTypeAnnotation")}case 134:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return o.value=this.match(85),this.next(),this.finishNode(o,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(135))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",o);if(this.match(136))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",o);throw this.raise(B.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 135:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 136:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(o,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(o,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(o,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(o,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(Dr(this.state.type)){let m=Fe(this.state.type);return this.next(),super.createIdentifier(o,m)}else if(Z(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,o,this.parseIdentifier())}throw this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,o=this.flowParsePrimaryType(),r=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let c=this.startNodeAt(e),d=this.eat(18);r=r||d,this.expect(0),!d&&this.match(3)?(c.elementType=o,this.next(),o=this.finishNode(c,"ArrayTypeAnnotation")):(c.objectType=o,c.indexType=this.flowParseType(),this.expect(3),r?(c.optional=d,o=this.finishNode(c,"OptionalIndexedAccessType")):o=this.finishNode(c,"IndexedAccessType"))}return o}flowParsePrefixType(){let e=this.startNode();return this.eat(17)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let o=this.startNodeAt(e.loc.start);return o.params=[this.reinterpretTypeAsFunctionTypeParam(e)],o.rest=null,o.this=null,o.returnType=this.flowParseType(),o.typeParameters=null,this.finishNode(o,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(45);let o=this.flowParseAnonFunctionWithoutParens();for(e.types=[o];this.eat(45);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?o:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){let e=this.startNode();this.eat(43);let o=this.flowParseIntersectionType();for(e.types=[o];this.eat(43);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?o:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){let e=this.state.inType;this.state.inType=!0;let o=this.flowParseUnionType();return this.state.inType=e,o}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let e=this.state.startLoc,o=this.parseIdentifier();return this.flowParseGenericType(e,o)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(){let e=this.startNode(),o=this.parseIdentifierName();return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),this.createIdentifier(e,o)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}flowParseVariance(){let e=null;return this.match(53)?(e=this.startNode(),this.state.value==="+"?e.kind="plus":e.kind="minus",this.next(),this.finishNode(e,"Variance")):e}parseFunctionBody(e,o,r=!1){if(o){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,r));return}super.parseFunctionBody(e,!1,r)}parseFunctionBodyAndFinish(e,o,r=!1){if(this.match(14)){let c=this.startNode();[c.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=c.typeAnnotation?this.finishNode(c,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,o,r)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let r=this.lookahead();if(we(r.type)){let c=this.startNode();return this.next(),this.flowParseInterface(c)}}else if(this.isContextual(126)){let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}let o=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(o)&&(this.flowPragma=null),o}parseExpressionStatement(e,o,r){if(o.type==="Identifier"){if(o.name==="declare"){if(this.match(80)||Z(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(Z(this.state.type)){if(o.name==="interface")return this.flowParseInterface(e);if(o.name==="type")return this.flowParseTypeAlias(e);if(o.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,o,r)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===126||ra(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===126||ra(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,o,r){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let C=this.lookaheadCharCode();if(C===44||C===61||C===58||C===41)return this.setOptionalParametersError(r),e}this.expect(17);let c=this.state.clone(),d=this.state.noArrowAt,l=this.startNodeAt(o),{consequent:m,failed:f}=this.tryParseConditionalConsequent(),[g,b]=this.getArrowLikeExpressions(m);if(f||b.length>0){let C=[...d];if(b.length>0){this.state=c,this.state.noArrowAt=C;for(let T=0;T<b.length;T++)C.push(b[T].start);({consequent:m,failed:f}=this.tryParseConditionalConsequent()),[g,b]=this.getArrowLikeExpressions(m)}f&&g.length>1&&this.raise(B.AmbiguousConditionalArrow,c.startLoc),f&&g.length===1&&(this.state=c,C.push(g[0].start),this.state.noArrowAt=C,{consequent:m,failed:f}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(m,!0),this.state.noArrowAt=d,this.expect(14),l.test=e,l.consequent=m,l.alternate=this.forwardNoArrowParamsConversionAt(l,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(l,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),o=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:o}}getArrowLikeExpressions(e,o){let r=[e],c=[];for(;r.length!==0;){let d=r.pop();d.type==="ArrowFunctionExpression"&&d.body.type!=="BlockStatement"?(d.typeParameters||!d.returnType?this.finishArrowValidation(d):c.push(d),r.push(d.body)):d.type==="ConditionalExpression"&&(r.push(d.consequent),r.push(d.alternate))}return o?(c.forEach(d=>this.finishArrowValidation(d)),[c,[]]):JW(c,d=>d.params.every(l=>this.isAssignable(l,!0)))}finishArrowValidation(e){var o;this.toAssignableList(e.params,(o=e.extra)==null?void 0:o.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,o){let r;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),r=o(),this.state.noArrowParamsConversionAt.pop()):r=o(),r}parseParenItem(e,o){let r=super.parseParenItem(e,o);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){let c=this.startNodeAt(o);return c.expression=r,c.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(c,"TypeCastExpression")}return r}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";let o=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(o)}else if(this.isContextual(131)){e.exportKind="type";let o=this.startNode();return this.next(),this.flowParseOpaqueType(o,!1)}else if(this.isContextual(129)){e.exportKind="type";let o=this.startNode();return this.next(),this.flowParseInterface(o)}else if(this.isContextual(126)){e.exportKind="value";let o=this.startNode();return this.next(),this.flowParseEnumDeclaration(o)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:o}=this.state,r=super.maybeParseExportNamespaceSpecifier(e);return r&&e.exportKind==="type"&&this.unexpected(o),r}parseClassId(e,o,r){super.parseClassId(e,o,r),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,o,r){let{startLoc:c}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,o))return;o.declare=!0}super.parseClassMember(e,o,r),o.declare&&(o.type!=="ClassProperty"&&o.type!=="ClassPrivateProperty"&&o.type!=="PropertyDefinition"?this.raise(B.DeclareClassElement,c):o.value&&this.raise(B.DeclareClassFieldInitializer,o.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),o="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(w.InvalidIdentifier,this.state.curPosition(),{identifierName:o}),this.finishToken(132,o)}getTokenFromCode(e){let o=this.input.charCodeAt(this.state.pos+1);e===123&&o===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?o===46?this.finishOp(18,2):this.finishOp(17,1):qW(e,o,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,o){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,o):super.isAssignable(e,o)}toAssignable(e,o=!1){!o&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,o)}toAssignableList(e,o,r){for(let c=0;c<e.length;c++){let d=e[c];d?.type==="TypeCastExpression"&&(e[c]=this.typeCastToParameter(d))}super.toAssignableList(e,o,r)}toReferencedList(e,o){for(let c=0;c<e.length;c++){var r;let d=e[c];d&&d.type==="TypeCastExpression"&&!((r=d.extra)!=null&&r.parenthesized)&&(e.length>1||!o)&&this.raise(B.TypeCastInPattern,d.typeAnnotation)}return e}parseArrayLike(e,o,r){let c=super.parseArrayLike(e,o,r);return r!=null&&!this.state.maybeInArrowParameters&&this.toReferencedList(c.elements),c}isValidLVal(e,o,r,c){return e==="TypeCastExpression"||super.isValidLVal(e,o,r,c)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,o,r,c,d,l){if(o.variance&&this.unexpected(o.variance.loc.start),delete o.variance,this.match(47)&&(o.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,o,r,c,d,l),o.params&&d){let m=o.params;m.length>0&&this.isThisParam(m[0])&&this.raise(B.ThisParamBannedInConstructor,o)}else if(o.type==="MethodDefinition"&&d&&o.value.params){let m=o.value.params;m.length>0&&this.isThisParam(m[0])&&this.raise(B.ThisParamBannedInConstructor,o)}}pushClassPrivateMethod(e,o,r,c){o.variance&&this.unexpected(o.variance.loc.start),delete o.variance,this.match(47)&&(o.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,o,r,c)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();let o=e.implements=[];do{let r=this.startNode();r.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?r.typeParameters=this.flowParseTypeParameterInstantiation():r.typeParameters=null,o.push(this.finishNode(r,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let o=this.getObjectOrClassMethodParams(e);if(o.length>0){let r=o[0];this.isThisParam(r)&&e.kind==="get"?this.raise(B.GetterMayNotHaveThisParam,r):this.isThisParam(r)&&this.raise(B.SetterMayNotHaveThisParam,r)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,o,r,c,d,l,m){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let f;this.match(47)&&!l&&(f=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let g=super.parseObjPropValue(e,o,r,c,d,l,m);return f&&((g.value||g).typeParameters=f),g}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(B.PatternIsOptional,e),this.isThisParam(e)&&this.raise(B.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(B.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(B.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,o){let r=super.parseMaybeDefault(e,o);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(B.TypeBeforeInitializer,r.typeAnnotation),r}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(B.ImportReflectionHasImportType,e.specifiers[0].loc.start)}parseImportSpecifierLocal(e,o,r){o.local=sa(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(o,r))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){if(!e)return!0;let o=this.lookaheadCharCode();return o===123||o===42}return!e&&this.isContextual(87)}applyImportPhase(e,o,r,c){if(super.applyImportPhase(e,o,r,c),o){if(!r&&this.match(65))return;e.exportKind=r==="type"?r:"value"}else r==="type"&&this.match(55)&&this.unexpected(),e.importKind=r==="type"||r==="typeof"?r:"value"}parseImportSpecifier(e,o,r,c,d){let l=e.imported,m=null;l.type==="Identifier"&&(l.name==="type"?m="type":l.name==="typeof"&&(m="typeof"));let f=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let b=this.parseIdentifier(!0);m!==null&&!we(this.state.type)?(e.imported=b,e.importKind=m,e.local=this.cloneIdentifier(b)):(e.imported=l,e.importKind=null,e.local=this.parseIdentifier())}else{if(m!==null&&we(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=m;else{if(o)throw this.raise(w.ImportBindingIsString,e,{importName:l.value});e.imported=l,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(f=!0,e.local=this.cloneIdentifier(e.imported))}let g=sa(e);return r&&g&&this.raise(B.ImportTypeShorthandOnlyInPureImport,e),(r||g)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),f&&!r&&!g&&this.checkReservedWord(e.local.name,e.loc.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseFunctionParams(e,o){let r=e.kind;r!=="get"&&r!=="set"&&this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,o)}parseVarId(e,o){super.parseVarId(e,o),this.match(14)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,o){if(this.match(14)){let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=r}return super.parseAsyncArrowFromCallExpression(e,o)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,o){var r;let c=null,d;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(c=this.state.clone(),d=this.tryParse(()=>super.parseMaybeAssign(e,o),c),!d.error)return d.node;let{context:f}=this.state,g=f[f.length-1];(g===X.j_oTag||g===X.j_expr)&&f.pop()}if((r=d)!=null&&r.error||this.match(47)){var l,m;c=c||this.state.clone();let f,g=this.tryParse(C=>{var T;f=this.flowParseTypeParameterDeclaration();let E=this.forwardNoArrowParamsConversionAt(f,()=>{let q=super.parseMaybeAssign(e,o);return this.resetStartLocationFromNode(q,f),q});(T=E.extra)!=null&&T.parenthesized&&C();let k=this.maybeUnwrapTypeCastExpression(E);return k.type!=="ArrowFunctionExpression"&&C(),k.typeParameters=f,this.resetStartLocationFromNode(k,f),E},c),b=null;if(g.node&&this.maybeUnwrapTypeCastExpression(g.node).type==="ArrowFunctionExpression"){if(!g.error&&!g.aborted)return g.node.async&&this.raise(B.UnexpectedTypeParameterBeforeAsyncArrowFunction,f),g.node;b=g.node}if((l=d)!=null&&l.node)return this.state=d.failState,d.node;if(b)return this.state=g.failState,b;throw(m=d)!=null&&m.thrown?d.error:g.thrown?g.error:this.raise(B.UnexpectedTokenAfterTypeParameter,f)}return super.parseMaybeAssign(e,o)}parseArrow(e){if(this.match(14)){let o=this.tryParse(()=>{let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let c=this.startNode();return[c.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=r,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),c});if(o.thrown)return null;o.error&&(this.state=o.failState),e.returnType=o.node.typeAnnotation?this.finishNode(o.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,o){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=o:super.setArrowFunctionParameters(e,o)}checkParams(e,o,r,c=!0){if(!(r&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let d=0;d<e.params.length;d++)this.isThisParam(e.params[d])&&d>0&&this.raise(B.ThisParamMustBeFirst,e.params[d]);super.checkParams(e,o,r,c)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,o,r){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(o.index)){this.next();let c=this.startNodeAt(o);c.callee=e,c.arguments=super.parseCallExpressionArguments(),e=this.finishNode(c,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let c=this.state.clone(),d=this.tryParse(m=>this.parseAsyncArrowWithTypeParameters(o)||m(),c);if(!d.error&&!d.aborted)return d.node;let l=this.tryParse(()=>super.parseSubscripts(e,o,r),c);if(l.node&&!l.error)return l.node;if(d.node)return this.state=d.failState,d.node;if(l.node)return this.state=l.failState,l.node;throw d.error||l.error}return super.parseSubscripts(e,o,r)}parseSubscript(e,o,r,c){if(this.match(18)&&this.isLookaheadToken_lt()){if(c.optionalChainMember=!0,r)return c.stop=!0,e;this.next();let d=this.startNodeAt(o);return d.callee=e,d.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),d.arguments=this.parseCallExpressionArguments(),d.optional=!0,this.finishCallExpression(d,!0)}else if(!r&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let d=this.startNodeAt(o);d.callee=e;let l=this.tryParse(()=>(d.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),d.arguments=super.parseCallExpressionArguments(),c.optionalChainMember&&(d.optional=!1),this.finishCallExpression(d,c.optionalChainMember)));if(l.node)return l.error&&(this.state=l.failState),l.node}return super.parseSubscript(e,o,r,c)}parseNewCallee(e){super.parseNewCallee(e);let o=null;this.shouldParseTypes()&&this.match(47)&&(o=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=o}parseAsyncArrowWithTypeParameters(e){let o=this.startNodeAt(e);if(this.parseFunctionParams(o,!1),!!this.parseArrow(o))return super.parseArrowExpression(o,void 0,!0)}readToken_mult_modulo(e){let o=this.input.charCodeAt(this.state.pos+1);if(e===42&&o===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let o=this.input.charCodeAt(this.state.pos+1);if(e===124&&o===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,o){let r=super.parseTopLevel(e,o);return this.state.hasFlowComment&&this.raise(B.UnterminatedFlowComment,this.state.curPosition()),r}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(B.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,o=2;for(;[32,9].includes(this.input.charCodeAt(e+o));)o++;let r=this.input.charCodeAt(o+e),c=this.input.charCodeAt(o+e+1);return r===58&&c===58?o+2:this.input.slice(o+e,o+e+12)==="flow-include"?o+12:r===58&&c!==58?o:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(w.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:o,memberName:r}){this.raise(B.EnumBooleanMemberNotInitialized,e,{memberName:r,enumName:o})}flowEnumErrorInvalidMemberInitializer(e,o){return this.raise(o.explicitType?o.explicitType==="symbol"?B.EnumInvalidMemberInitializerSymbolType:B.EnumInvalidMemberInitializerPrimaryType:B.EnumInvalidMemberInitializerUnknownType,e,o)}flowEnumErrorNumberMemberNotInitialized(e,o){this.raise(B.EnumNumberMemberNotInitialized,e,o)}flowEnumErrorStringMemberInconsistentlyInitialized(e,o){this.raise(B.EnumStringMemberInconsistentlyInitialized,e,o)}flowEnumMemberInit(){let e=this.state.startLoc,o=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let r=this.parseNumericLiteral(this.state.value);return o()?{type:"number",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 134:{let r=this.parseStringLiteral(this.state.value);return o()?{type:"string",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 85:case 86:{let r=this.parseBooleanLiteral(this.match(85));return o()?{type:"boolean",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,o=this.parseIdentifier(!0),r=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:o,init:r}}flowEnumCheckExplicitTypeMismatch(e,o,r){let{explicitType:c}=o;c!==null&&c!==r&&this.flowEnumErrorInvalidMemberInitializer(e,o)}flowEnumMembers({enumName:e,explicitType:o}){let r=new Set,c={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},d=!1;for(;!this.match(8);){if(this.eat(21)){d=!0;break}let l=this.startNode(),{id:m,init:f}=this.flowEnumMemberRaw(),g=m.name;if(g==="")continue;/^[a-z]/.test(g)&&this.raise(B.EnumInvalidMemberName,m,{memberName:g,suggestion:g[0].toUpperCase()+g.slice(1),enumName:e}),r.has(g)&&this.raise(B.EnumDuplicateMemberName,m,{memberName:g,enumName:e}),r.add(g);let b={enumName:e,explicitType:o,memberName:g};switch(l.id=m,f.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(f.loc,b,"boolean"),l.init=f.value,c.booleanMembers.push(this.finishNode(l,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(f.loc,b,"number"),l.init=f.value,c.numberMembers.push(this.finishNode(l,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(f.loc,b,"string"),l.init=f.value,c.stringMembers.push(this.finishNode(l,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(f.loc,b);case"none":switch(o){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(f.loc,b);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(f.loc,b);break;default:c.defaultedMembers.push(this.finishNode(l,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:c,hasUnknownMembers:d}}flowEnumStringMembers(e,o,{enumName:r}){if(e.length===0)return o;if(o.length===0)return e;if(o.length>e.length){for(let c of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(c,{enumName:r});return o}else{for(let c of o)this.flowEnumErrorStringMemberInconsistentlyInitialized(c,{enumName:r});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!Z(this.state.type))throw this.raise(B.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:o}=this.state;return this.next(),o!=="boolean"&&o!=="number"&&o!=="string"&&o!=="symbol"&&this.raise(B.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:o}),o}flowEnumBody(e,o){let r=o.name,c=o.loc.start,d=this.flowEnumParseExplicitType({enumName:r});this.expect(5);let{members:l,hasUnknownMembers:m}=this.flowEnumMembers({enumName:r,explicitType:d});switch(e.hasUnknownMembers=m,d){case"boolean":return e.explicitType=!0,e.members=l.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=l.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(l.stringMembers,l.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=l.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let f=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let g=l.booleanMembers.length,b=l.numberMembers.length,C=l.stringMembers.length,T=l.defaultedMembers.length;if(!g&&!b&&!C&&!T)return f();if(!g&&!b)return e.members=this.flowEnumStringMembers(l.stringMembers,l.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!b&&!C&&g>=T){for(let E of l.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(E.loc.start,{enumName:r,memberName:E.id.name});return e.members=l.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!g&&!C&&b>=T){for(let E of l.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(E.loc.start,{enumName:r,memberName:E.id.name});return e.members=l.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(B.EnumInconsistentMemberValues,c,{enumName:r}),f()}}}flowParseEnumDeclaration(e){let o=this.parseIdentifier();return e.id=o,e.body=this.flowEnumBody(this.startNode(),o),this.finishNode(e,"EnumDeclaration")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let o=this.input.charCodeAt(e+1);return o!==60&&o!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},YW={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},QW=/\r\n|[\r\n\u2028\u2029]/,ro=new RegExp(QW.source,"g");function tt(n){switch(n){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function na(n,t,e){for(let o=t;o<e;o++)if(tt(n.charCodeAt(o)))return!0;return!1}var rr=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,sr=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function eG(n){switch(n){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var je=ze`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:n})=>`Expected corresponding JSX closing tag for <${n}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:n,HTMLEntity:t})=>`Unexpected token \`${n}\`. Did you mean \`${t}\` or \`{'${n}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function De(n){return n?n.type==="JSXOpeningFragment"||n.type==="JSXClosingFragment":!1}function et(n){if(n.type==="JSXIdentifier")return n.name;if(n.type==="JSXNamespacedName")return n.namespace.name+":"+n.name.name;if(n.type==="JSXMemberExpression")return et(n.object)+"."+et(n.property);throw new Error("Node had unexpected type: "+n.type)}var tG=n=>class extends n{jsxReadToken(){let e="",o=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(je.UnterminatedJsxContent,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);switch(r){case 60:case 123:if(this.state.pos===this.state.start){r===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(r);return}e+=this.input.slice(o,this.state.pos),this.finishToken(142,e);return;case 38:e+=this.input.slice(o,this.state.pos),e+=this.jsxReadEntity(),o=this.state.pos;break;default:tt(r)?(e+=this.input.slice(o,this.state.pos),e+=this.jsxReadNewLine(!0),o=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let o=this.input.charCodeAt(this.state.pos),r;return++this.state.pos,o===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,r=e?`
2
+ import{A as G,B as L,C as ve,D as y,E as v,F as c,G as Jt,H as E,I as H,J as O,K as h,L as b,M as Qs,N as d,O as yr,P as re,Q as ue,R as Ce,S as V,T as se,U as K,V as Ee,W as Je,X as ge,Y as Np,a as Ve,b as Op,c as qe,d as Mp,e as kp,f as Pp,g as Lp,h as Dp,i as Rt,j as gr,k as wt,l as Yt,m as vp,n as Co,o as B,p as q,q as Oe,r as N,s as Qt,t as Fp,u as br,v as n,w as xe,x as i,y as A,z as P}from"./chunk-EGBS3VAH.js";import{a as vf,b as X,c as Ff}from"./chunk-MCQRX24V.js";var tf=vf(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});function Vce(o,e){if(o==null)return{};var t={};for(var r in o)if({}.hasOwnProperty.call(o,r)){if(e.indexOf(r)!==-1)continue;t[r]=o[r]}return t}var At=class{constructor(e,t,r){this.line=void 0,this.column=void 0,this.index=void 0,this.line=e,this.column=t,this.index=r}},zo=class{constructor(e,t){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=e,this.end=t}};function je(o,e){let{line:t,column:r,index:s}=o;return new At(t,r+e,s+e)}var Ih="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Uce={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Ih},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Ih}},Rh={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},Hs=o=>o.type==="UpdateExpression"?Rh.UpdateExpression[`${o.prefix}`]:Rh[o.type],Hce={AccessorIsGenerator:({kind:o})=>`A ${o}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:o})=>`Missing initializer in ${o} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:o})=>`\`${o}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:o,exportName:e})=>`A string literal cannot be used as an exported binding without \`from\`.
3
+ - Did you mean \`export { '${o}' as '${e}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:o})=>`'${o==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:o})=>`Unsyntactic ${o==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:o})=>`A string literal cannot be used as an imported binding.
4
+ - Did you mean \`import { "${o}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverDiscardElement:"'void' must be followed by an expression when not used in a binding position.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:o})=>`Expected number in radix ${o}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:o})=>`Escape sequence in keyword ${o}.`,InvalidIdentifier:({identifierName:o})=>`Invalid identifier ${o}.`,InvalidLhs:({ancestor:o})=>`Invalid left-hand side in ${Hs(o)}.`,InvalidLhsBinding:({ancestor:o})=>`Binding invalid left-hand side in ${Hs(o)}.`,InvalidLhsOptionalChaining:({ancestor:o})=>`Invalid optional chaining in the left-hand side of ${Hs(o)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:o})=>`Unexpected character '${o}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:o})=>`Private name #${o} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:o})=>`Label '${o}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:o})=>`This experimental syntax requires enabling the parser plugin: ${o.map(e=>JSON.stringify(e)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:o})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${o.map(e=>JSON.stringify(e)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:o})=>`Duplicate key "${o}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:o})=>`An export name cannot include a lone surrogate, found '\\u${o.toString(16)}'.`,ModuleExportUndefined:({localName:o})=>`Export '${o}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:o})=>`Private names are only allowed in property accesses (\`obj.#${o}\`) or in \`in\` expressions (\`#${o} in obj\`).`,PrivateNameRedeclaration:({identifierName:o})=>`Duplicate private name #${o}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperCallNotNewExpression:"Cannot use new with super(...).",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:o})=>`Unexpected keyword '${o}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:o})=>`Unexpected reserved word '${o}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:o,unexpected:e})=>`Unexpected token${e?` '${e}'.`:""}${o?`, expected "${o}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:"Unexpected void binding.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:o,onlyValidPropertyName:e})=>`The only valid meta property for ${o} is ${o}.${e}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:o})=>`Identifier '${o}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:"A void binding may not have an initializer.",YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},Wce={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:o})=>`Assigning to '${o}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:o})=>`Binding '${o}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},$ce={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:o})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(o)}\`.`},Gce=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Kce=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:o})=>`Invalid topic token ${o}. In order to use ${o} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${o}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:o})=>`Hack-style pipe body cannot be an unparenthesized ${Hs({type:o})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'}),qce={UnsupportedBind:"Binding should be performed on object property.",UnsupportedBindRHS:"The right-hand side of binding can not be super or import."},Yce=["message"];function wh(o,e,t){Object.defineProperty(o,e,{enumerable:!1,configurable:!0,value:t})}function Qce({toMessage:o,code:e,reasonCode:t,syntaxPlugin:r}){let s=t==="MissingPlugin"||t==="MissingOneOfPlugins",a={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};return a[t]&&(t=a[t]),function p(u,f){let m=new SyntaxError;return m.code=e,m.reasonCode=t,m.loc=u,m.pos=u.index,m.syntaxPlugin=r,s&&(m.missingPlugin=f.missingPlugin),wh(m,"clone",function(g={}){var z;let{line:w,column:k,index:F}=(z=g.loc)!=null?z:u;return p(new At(w,k,F),Object.assign({},f,g.details))}),wh(m,"details",f),Object.defineProperty(m,"message",{configurable:!0,get(){let x=`${o(f)} (${u.line}:${u.column})`;return this.message=x,x},set(x){Object.defineProperty(this,"message",{value:x,writable:!0})}}),m}}function ct(o,e){if(Array.isArray(o))return r=>ct(r,o[0]);let t={};for(let r of Object.keys(o)){let s=o[r],a=typeof s=="string"?{message:()=>s}:typeof s=="function"?{message:s}:s,{message:p}=a,u=Vce(a,Yce),f=typeof p=="string"?()=>p:p;t[r]=Qce(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:r,toMessage:f},e?{syntaxPlugin:e}:{},u))}return t}var R=Object.assign({},ct(Uce),ct(Hce),ct(Wce),ct($ce),ct`pipelineOperator`(Kce),ct`functionBind`(qce));function Jce(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Zce(o){let e=Jce();if(o==null)return e;if(o.annexB!=null&&o.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let t of Object.keys(e))o[t]!=null&&(e[t]=o[t]);if(e.startLine===1)o.startIndex==null&&e.startColumn>0?e.startIndex=e.startColumn:o.startColumn==null&&e.startIndex>0&&(e.startColumn=e.startIndex);else if((o.startColumn==null||o.startIndex==null)&&o.startIndex!=null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(e.sourceType==="commonjs"){if(o.allowAwaitOutsideFunction!=null)throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(o.allowReturnOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(o.allowNewTargetOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return e}var{defineProperty:Xce}=Object,Oh=(o,e)=>{o&&Xce(o,e,{enumerable:!1,value:o[e]})};function ir(o){return Oh(o.loc.start,"index"),Oh(o.loc.end,"index"),o}var epe=o=>class extends o{parse(){let t=ir(super.parse());return this.optionFlags&256&&(t.tokens=t.tokens.map(ir)),t}parseRegExpLiteral({pattern:t,flags:r}){let s=null;try{s=new RegExp(t,r)}catch{}let a=this.estreeParseLiteral(s);return a.regex={pattern:t,flags:r},a}parseBigIntLiteral(t){let r;try{r=BigInt(t)}catch{r=null}let s=this.estreeParseLiteral(r);return s.bigint=String(s.value||t),s}parseDecimalLiteral(t){let s=this.estreeParseLiteral(null);return s.decimal=String(s.value||t),s}estreeParseLiteral(t){return this.parseLiteral(t,"Literal")}parseStringLiteral(t){return this.estreeParseLiteral(t)}parseNumericLiteral(t){return this.estreeParseLiteral(t)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(t){return this.estreeParseLiteral(t)}estreeParseChainExpression(t,r){let s=this.startNodeAtNode(t);return s.expression=t,this.finishNodeAt(s,"ChainExpression",r)}directiveToStmt(t){let r=t.value;delete t.value,this.castNodeTo(r,"Literal"),r.raw=r.extra.raw,r.value=r.extra.expressionValue;let s=this.castNodeTo(t,"ExpressionStatement");return s.expression=r,s.directive=r.extra.rawValue,delete r.extra,s}fillOptionalPropertiesForTSESLint(t){}cloneEstreeStringLiteral(t){let{start:r,end:s,loc:a,range:p,raw:u,value:f}=t,m=Object.create(t.constructor.prototype);return m.type="Literal",m.start=r,m.end=s,m.loc=a,m.range=p,m.raw=u,m.value=f,m}initFunction(t,r){super.initFunction(t,r),t.expression=!1}checkDeclaration(t){t!=null&&this.isObjectProperty(t)?this.checkDeclaration(t.value):super.checkDeclaration(t)}getObjectOrClassMethodParams(t){return t.value.params}isValidDirective(t){var r;return t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value=="string"&&!((r=t.expression.extra)!=null&&r.parenthesized)}parseBlockBody(t,r,s,a,p){super.parseBlockBody(t,r,s,a,p);let u=t.directives.map(f=>this.directiveToStmt(f));t.body=u.concat(t.body),delete t.directives}parsePrivateName(){let t=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(t):t}convertPrivateNameToPrivateIdentifier(t){let r=super.getPrivateNameSV(t);return delete t.id,t.name=r,this.castNodeTo(t,"PrivateIdentifier")}isPrivateName(t){return this.getPluginOption("estree","classFeatures")?t.type==="PrivateIdentifier":super.isPrivateName(t)}getPrivateNameSV(t){return this.getPluginOption("estree","classFeatures")?t.name:super.getPrivateNameSV(t)}parseLiteral(t,r){let s=super.parseLiteral(t,r);return s.raw=s.extra.raw,delete s.extra,s}parseFunctionBody(t,r,s=!1){super.parseFunctionBody(t,r,s),t.expression=t.body.type!=="BlockStatement"}parseMethod(t,r,s,a,p,u,f=!1){let m=this.startNode();m.kind=t.kind,m=super.parseMethod(m,r,s,a,p,u,f),delete m.kind;let{typeParameters:x}=t;x&&(delete t.typeParameters,m.typeParameters=x,this.resetStartLocationFromNode(m,x));let g=this.castNodeTo(m,"FunctionExpression");return t.value=g,u==="ClassPrivateMethod"&&(t.computed=!1),u==="ObjectMethod"?(t.kind==="method"&&(t.kind="init"),t.shorthand=!1,this.finishNode(t,"Property")):this.finishNode(t,"MethodDefinition")}nameIsConstructor(t){return t.type==="Literal"?t.value==="constructor":super.nameIsConstructor(t)}parseClassProperty(...t){let r=super.parseClassProperty(...t);return this.getPluginOption("estree","classFeatures")&&this.castNodeTo(r,"PropertyDefinition"),r}parseClassPrivateProperty(...t){let r=super.parseClassPrivateProperty(...t);return this.getPluginOption("estree","classFeatures")&&(this.castNodeTo(r,"PropertyDefinition"),r.computed=!1),r}parseClassAccessorProperty(t){let r=super.parseClassAccessorProperty(t);return this.getPluginOption("estree","classFeatures")&&(r.abstract&&this.hasPlugin("typescript")?(delete r.abstract,this.castNodeTo(r,"TSAbstractAccessorProperty")):this.castNodeTo(r,"AccessorProperty")),r}parseObjectProperty(t,r,s,a){let p=super.parseObjectProperty(t,r,s,a);return p&&(p.kind="init",this.castNodeTo(p,"Property")),p}finishObjectProperty(t){return t.kind="init",this.finishNode(t,"Property")}isValidLVal(t,r,s,a){return t==="Property"?"value":super.isValidLVal(t,r,s,a)}isAssignable(t,r){return t!=null&&this.isObjectProperty(t)?this.isAssignable(t.value,r):super.isAssignable(t,r)}toAssignable(t,r=!1){if(t!=null&&this.isObjectProperty(t)){let{key:s,value:a}=t;this.isPrivateName(s)&&this.classScope.usePrivateName(this.getPrivateNameSV(s),s.loc.start),this.toAssignable(a,r)}else super.toAssignable(t,r)}toAssignableObjectExpressionProp(t,r,s){t.type==="Property"&&(t.kind==="get"||t.kind==="set")?this.raise(R.PatternHasAccessor,t.key):t.type==="Property"&&t.method?this.raise(R.PatternHasMethod,t.key):super.toAssignableObjectExpressionProp(t,r,s)}finishCallExpression(t,r){let s=super.finishCallExpression(t,r);if(s.callee.type==="Import"){var a,p;this.castNodeTo(s,"ImportExpression"),s.source=s.arguments[0],s.options=(a=s.arguments[1])!=null?a:null,s.attributes=(p=s.arguments[1])!=null?p:null,delete s.arguments,delete s.callee}else s.type==="OptionalCallExpression"?this.castNodeTo(s,"CallExpression"):s.optional=!1;return s}toReferencedArguments(t){t.type!=="ImportExpression"&&super.toReferencedArguments(t)}parseExport(t,r){let s=this.state.lastTokStartLoc,a=super.parseExport(t,r);switch(a.type){case"ExportAllDeclaration":a.exported=null;break;case"ExportNamedDeclaration":a.specifiers.length===1&&a.specifiers[0].type==="ExportNamespaceSpecifier"&&(this.castNodeTo(a,"ExportAllDeclaration"),a.exported=a.specifiers[0].exported,delete a.specifiers);case"ExportDefaultDeclaration":{var p;let{declaration:u}=a;u?.type==="ClassDeclaration"&&((p=u.decorators)==null?void 0:p.length)>0&&u.start===a.start&&this.resetStartLocation(a,s)}break}return a}stopParseSubscript(t,r){let s=super.stopParseSubscript(t,r);return r.optionalChainMember?this.estreeParseChainExpression(s,t.loc.end):s}parseMember(t,r,s,a,p){let u=super.parseMember(t,r,s,a,p);return u.type==="OptionalMemberExpression"?this.castNodeTo(u,"MemberExpression"):u.optional=!1,u}isOptionalMemberExpression(t){return t.type==="ChainExpression"?t.expression.type==="MemberExpression":super.isOptionalMemberExpression(t)}hasPropertyAsPrivateName(t){return t.type==="ChainExpression"&&(t=t.expression),super.hasPropertyAsPrivateName(t)}isObjectProperty(t){return t.type==="Property"&&t.kind==="init"&&!t.method}isObjectMethod(t){return t.type==="Property"&&(t.method||t.kind==="get"||t.kind==="set")}castNodeTo(t,r){let s=super.castNodeTo(t,r);return this.fillOptionalPropertiesForTSESLint(s),s}cloneIdentifier(t){let r=super.cloneIdentifier(t);return this.fillOptionalPropertiesForTSESLint(r),r}cloneStringLiteral(t){return t.type==="Literal"?this.cloneEstreeStringLiteral(t):super.cloneStringLiteral(t)}finishNodeAt(t,r,s){return ir(super.finishNodeAt(t,r,s))}finishNode(t,r){let s=super.finishNode(t,r);return this.fillOptionalPropertiesForTSESLint(s),s}resetStartLocation(t,r){super.resetStartLocation(t,r),ir(t)}resetEndLocation(t,r=this.state.lastTokEndLoc){super.resetEndLocation(t,r),ir(t)}},Gt=class{constructor(e,t){this.token=void 0,this.preserveSpace=void 0,this.token=e,this.preserveSpace=!!t}},ce={brace:new Gt("{"),j_oTag:new Gt("<tag"),j_cTag:new Gt("</tag"),j_expr:new Gt("<tag>...</tag>",!0)};ce.template=new Gt("`",!0);var te=!0,U=!0,mc=!0,ar=!0,Dt=!0,tpe=!0,Gs=class{constructor(e,t={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.rightAssociative=!!t.rightAssociative,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop!=null?t.binop:null,this.updateContext=null}},jc=new Map;function ae(o,e={}){e.keyword=o;let t=Q(o,e);return jc.set(o,t),t}function Be(o,e){return Q(o,{beforeExpr:te,binop:e})}var lr=-1,It=[],Vc=[],Uc=[],Hc=[],Wc=[],$c=[];function Q(o,e={}){var t,r,s,a;return++lr,Vc.push(o),Uc.push((t=e.binop)!=null?t:-1),Hc.push((r=e.beforeExpr)!=null?r:!1),Wc.push((s=e.startsExpr)!=null?s:!1),$c.push((a=e.prefix)!=null?a:!1),It.push(new Gs(o,e)),lr}function oe(o,e={}){var t,r,s,a;return++lr,jc.set(o,lr),Vc.push(o),Uc.push((t=e.binop)!=null?t:-1),Hc.push((r=e.beforeExpr)!=null?r:!1),Wc.push((s=e.startsExpr)!=null?s:!1),$c.push((a=e.prefix)!=null?a:!1),It.push(new Gs("name",e)),lr}var ope={bracketL:Q("[",{beforeExpr:te,startsExpr:U}),bracketHashL:Q("#[",{beforeExpr:te,startsExpr:U}),bracketBarL:Q("[|",{beforeExpr:te,startsExpr:U}),bracketR:Q("]"),bracketBarR:Q("|]"),braceL:Q("{",{beforeExpr:te,startsExpr:U}),braceBarL:Q("{|",{beforeExpr:te,startsExpr:U}),braceHashL:Q("#{",{beforeExpr:te,startsExpr:U}),braceR:Q("}"),braceBarR:Q("|}"),parenL:Q("(",{beforeExpr:te,startsExpr:U}),parenR:Q(")"),comma:Q(",",{beforeExpr:te}),semi:Q(";",{beforeExpr:te}),colon:Q(":",{beforeExpr:te}),doubleColon:Q("::",{beforeExpr:te}),dot:Q("."),question:Q("?",{beforeExpr:te}),questionDot:Q("?."),arrow:Q("=>",{beforeExpr:te}),template:Q("template"),ellipsis:Q("...",{beforeExpr:te}),backQuote:Q("`",{startsExpr:U}),dollarBraceL:Q("${",{beforeExpr:te,startsExpr:U}),templateTail:Q("...`",{startsExpr:U}),templateNonTail:Q("...${",{beforeExpr:te,startsExpr:U}),at:Q("@"),hash:Q("#",{startsExpr:U}),interpreterDirective:Q("#!..."),eq:Q("=",{beforeExpr:te,isAssign:ar}),assign:Q("_=",{beforeExpr:te,isAssign:ar}),slashAssign:Q("_=",{beforeExpr:te,isAssign:ar}),xorAssign:Q("_=",{beforeExpr:te,isAssign:ar}),moduloAssign:Q("_=",{beforeExpr:te,isAssign:ar}),incDec:Q("++/--",{prefix:Dt,postfix:tpe,startsExpr:U}),bang:Q("!",{beforeExpr:te,prefix:Dt,startsExpr:U}),tilde:Q("~",{beforeExpr:te,prefix:Dt,startsExpr:U}),doubleCaret:Q("^^",{startsExpr:U}),doubleAt:Q("@@",{startsExpr:U}),pipeline:Be("|>",0),nullishCoalescing:Be("??",1),logicalOR:Be("||",1),logicalAND:Be("&&",2),bitwiseOR:Be("|",3),bitwiseXOR:Be("^",4),bitwiseAND:Be("&",5),equality:Be("==/!=/===/!==",6),lt:Be("</>/<=/>=",7),gt:Be("</>/<=/>=",7),relational:Be("</>/<=/>=",7),bitShift:Be("<</>>/>>>",8),bitShiftL:Be("<</>>/>>>",8),bitShiftR:Be("<</>>/>>>",8),plusMin:Q("+/-",{beforeExpr:te,binop:9,prefix:Dt,startsExpr:U}),modulo:Q("%",{binop:10,startsExpr:U}),star:Q("*",{binop:10}),slash:Be("/",10),exponent:Q("**",{beforeExpr:te,binop:11,rightAssociative:!0}),_in:ae("in",{beforeExpr:te,binop:7}),_instanceof:ae("instanceof",{beforeExpr:te,binop:7}),_break:ae("break"),_case:ae("case",{beforeExpr:te}),_catch:ae("catch"),_continue:ae("continue"),_debugger:ae("debugger"),_default:ae("default",{beforeExpr:te}),_else:ae("else",{beforeExpr:te}),_finally:ae("finally"),_function:ae("function",{startsExpr:U}),_if:ae("if"),_return:ae("return",{beforeExpr:te}),_switch:ae("switch"),_throw:ae("throw",{beforeExpr:te,prefix:Dt,startsExpr:U}),_try:ae("try"),_var:ae("var"),_const:ae("const"),_with:ae("with"),_new:ae("new",{beforeExpr:te,startsExpr:U}),_this:ae("this",{startsExpr:U}),_super:ae("super",{startsExpr:U}),_class:ae("class",{startsExpr:U}),_extends:ae("extends",{beforeExpr:te}),_export:ae("export"),_import:ae("import",{startsExpr:U}),_null:ae("null",{startsExpr:U}),_true:ae("true",{startsExpr:U}),_false:ae("false",{startsExpr:U}),_typeof:ae("typeof",{beforeExpr:te,prefix:Dt,startsExpr:U}),_void:ae("void",{beforeExpr:te,prefix:Dt,startsExpr:U}),_delete:ae("delete",{beforeExpr:te,prefix:Dt,startsExpr:U}),_do:ae("do",{isLoop:mc,beforeExpr:te}),_for:ae("for",{isLoop:mc}),_while:ae("while",{isLoop:mc}),_as:oe("as",{startsExpr:U}),_assert:oe("assert",{startsExpr:U}),_async:oe("async",{startsExpr:U}),_await:oe("await",{startsExpr:U}),_defer:oe("defer",{startsExpr:U}),_from:oe("from",{startsExpr:U}),_get:oe("get",{startsExpr:U}),_let:oe("let",{startsExpr:U}),_meta:oe("meta",{startsExpr:U}),_of:oe("of",{startsExpr:U}),_sent:oe("sent",{startsExpr:U}),_set:oe("set",{startsExpr:U}),_source:oe("source",{startsExpr:U}),_static:oe("static",{startsExpr:U}),_using:oe("using",{startsExpr:U}),_yield:oe("yield",{startsExpr:U}),_asserts:oe("asserts",{startsExpr:U}),_checks:oe("checks",{startsExpr:U}),_exports:oe("exports",{startsExpr:U}),_global:oe("global",{startsExpr:U}),_implements:oe("implements",{startsExpr:U}),_intrinsic:oe("intrinsic",{startsExpr:U}),_infer:oe("infer",{startsExpr:U}),_is:oe("is",{startsExpr:U}),_mixins:oe("mixins",{startsExpr:U}),_proto:oe("proto",{startsExpr:U}),_require:oe("require",{startsExpr:U}),_satisfies:oe("satisfies",{startsExpr:U}),_keyof:oe("keyof",{startsExpr:U}),_readonly:oe("readonly",{startsExpr:U}),_unique:oe("unique",{startsExpr:U}),_abstract:oe("abstract",{startsExpr:U}),_declare:oe("declare",{startsExpr:U}),_enum:oe("enum",{startsExpr:U}),_module:oe("module",{startsExpr:U}),_namespace:oe("namespace",{startsExpr:U}),_interface:oe("interface",{startsExpr:U}),_type:oe("type",{startsExpr:U}),_opaque:oe("opaque",{startsExpr:U}),name:Q("name",{startsExpr:U}),placeholder:Q("%%",{startsExpr:U}),string:Q("string",{startsExpr:U}),num:Q("num",{startsExpr:U}),bigint:Q("bigint",{startsExpr:U}),decimal:Q("decimal",{startsExpr:U}),regexp:Q("regexp",{startsExpr:U}),privateName:Q("#name",{startsExpr:U}),eof:Q("eof"),jsxName:Q("jsxName"),jsxText:Q("jsxText",{beforeExpr:te}),jsxTagStart:Q("jsxTagStart",{startsExpr:U}),jsxTagEnd:Q("jsxTagEnd")};function pe(o){return o>=93&&o<=133}function rpe(o){return o<=92}function pt(o){return o>=58&&o<=133}function Vh(o){return o>=58&&o<=137}function spe(o){return Hc[o]}function pr(o){return Wc[o]}function npe(o){return o>=29&&o<=33}function Mh(o){return o>=129&&o<=131}function ipe(o){return o>=90&&o<=92}function Gc(o){return o>=58&&o<=92}function ape(o){return o>=39&&o<=59}function cpe(o){return o===34}function ppe(o){return $c[o]}function dpe(o){return o>=121&&o<=123}function lpe(o){return o>=124&&o<=130}function Ft(o){return Vc[o]}function Ws(o){return Uc[o]}function upe(o){return o===57}function Ks(o){return o>=24&&o<=25}function Ct(o){return It[o]}It[8].updateContext=o=>{o.pop()};It[5].updateContext=It[7].updateContext=It[23].updateContext=o=>{o.push(ce.brace)};It[22].updateContext=o=>{o[o.length-1]===ce.template?o.pop():o.push(ce.template)};It[143].updateContext=o=>{o.push(ce.j_expr,ce.j_oTag)};var Kc="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Uh="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",mpe=new RegExp("["+Kc+"]"),hpe=new RegExp("["+Kc+Uh+"]");Kc=Uh=null;var Hh=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],fpe=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];function yc(o,e){let t=65536;for(let r=0,s=e.length;r<s;r+=2){if(t+=e[r],t>o)return!1;if(t+=e[r+1],t>=o)return!0}return!1}function yt(o){return o<65?o===36:o<=90?!0:o<97?o===95:o<=122?!0:o<=65535?o>=170&&mpe.test(String.fromCharCode(o)):yc(o,Hh)}function Kt(o){return o<48?o===36:o<58?!0:o<65?!1:o<=90?!0:o<97?o===95:o<=122?!0:o<=65535?o>=170&&hpe.test(String.fromCharCode(o)):yc(o,Hh)||yc(o,fpe)}var qc={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},xpe=new Set(qc.keyword),gpe=new Set(qc.strict),bpe=new Set(qc.strictBind);function Wh(o,e){return e&&o==="await"||o==="enum"}function $h(o,e){return Wh(o,e)||gpe.has(o)}function Gh(o){return bpe.has(o)}function Kh(o,e){return $h(o,e)||Gh(o)}function ype(o){return xpe.has(o)}function Ape(o,e,t){return o===64&&e===64&&yt(t)}var Spe=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function zpe(o){return Spe.has(o)}var ur=class{constructor(e){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=e}},mr=class{constructor(e,t){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=e,this.inModule=t}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let e=this.currentThisScopeFlags();return(e&64)>0&&(e&2)===0}get inStaticBlock(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&128)return!0;if(t&1731)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(e){return new ur(e)}enter(e){this.scopeStack.push(this.createScope(e))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(e){return!!(e.flags&130||!this.parser.inModule&&e.flags&1)}declareName(e,t,r){let s=this.currentScope();if(t&8||t&16){this.checkRedeclarationInScope(s,e,t,r);let a=s.names.get(e)||0;t&16?a=a|4:(s.firstLexicalName||(s.firstLexicalName=e),a=a|2),s.names.set(e,a),t&8&&this.maybeExportDefined(s,e)}else if(t&4)for(let a=this.scopeStack.length-1;a>=0&&(s=this.scopeStack[a],this.checkRedeclarationInScope(s,e,t,r),s.names.set(e,(s.names.get(e)||0)|1),this.maybeExportDefined(s,e),!(s.flags&1667));--a);this.parser.inModule&&s.flags&1&&this.undefinedExports.delete(e)}maybeExportDefined(e,t){this.parser.inModule&&e.flags&1&&this.undefinedExports.delete(t)}checkRedeclarationInScope(e,t,r,s){this.isRedeclaredInScope(e,t,r)&&this.parser.raise(R.VarRedeclaration,s,{identifierName:t})}isRedeclaredInScope(e,t,r){if(!(r&1))return!1;if(r&8)return e.names.has(t);let s=e.names.get(t)||0;return r&16?(s&2)>0||!this.treatFunctionsAsVarInScope(e)&&(s&1)>0:(s&2)>0&&!(e.flags&8&&e.firstLexicalName===t)||!this.treatFunctionsAsVarInScope(e)&&(s&4)>0}checkLocalExport(e){let{name:t}=e;this.scopeStack[0].names.has(t)||this.undefinedExports.set(t,e.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&1667)return t}}currentThisScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&1731&&!(t&4))return t}}},Ac=class extends ur{constructor(...e){super(...e),this.declareFunctions=new Set}},Sc=class extends mr{createScope(e){return new Ac(e)}declareName(e,t,r){let s=this.currentScope();if(t&2048){this.checkRedeclarationInScope(s,e,t,r),this.maybeExportDefined(s,e),s.declareFunctions.add(e);return}super.declareName(e,t,r)}isRedeclaredInScope(e,t,r){if(super.isRedeclaredInScope(e,t,r))return!0;if(r&2048&&!e.declareFunctions.has(t)){let s=e.names.get(t);return(s&4)>0||(s&2)>0}return!1}checkLocalExport(e){this.scopeStack[0].declareFunctions.has(e.name)||super.checkLocalExport(e)}},Tpe=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),J=ct`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:o})=>`Cannot overwrite reserved type ${o}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:o,enumName:e})=>`Boolean enum members need to be initialized. Use either \`${o} = true,\` or \`${o} = false,\` in enum \`${e}\`.`,EnumDuplicateMemberName:({memberName:o,enumName:e})=>`Enum member names need to be unique, but the name \`${o}\` has already been used before in enum \`${e}\`.`,EnumInconsistentMemberValues:({enumName:o})=>`Enum \`${o}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:o,enumName:e})=>`Enum type \`${o}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:o})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${o}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:o,memberName:e,explicitType:t})=>`Enum \`${o}\` has type \`${t}\`, so the initializer of \`${e}\` needs to be a ${t} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:o,memberName:e})=>`Symbol enum members cannot be initialized. Use \`${e},\` in enum \`${o}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:o,memberName:e})=>`The enum member initializer for \`${e}\` needs to be a literal (either a boolean, number, or string) in enum \`${o}\`.`,EnumInvalidMemberName:({enumName:o,memberName:e,suggestion:t})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${e}\`, consider using \`${t}\`, in enum \`${o}\`.`,EnumNumberMemberNotInitialized:({enumName:o,memberName:e})=>`Number enum members need to be initialized, e.g. \`${e} = 1\` in enum \`${o}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:o})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${o}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:o})=>`Unexpected reserved type ${o}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:o,suggestion:e})=>`\`declare export ${o}\` is not supported. Use \`${e}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function Epe(o){return o.type==="DeclareExportAllDeclaration"||o.type==="DeclareExportDeclaration"&&(!o.declaration||o.declaration.type!=="TypeAlias"&&o.declaration.type!=="InterfaceDeclaration")}function kh(o){return o.importKind==="type"||o.importKind==="typeof"}var Cpe={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function Ipe(o,e){let t=[],r=[];for(let s=0;s<o.length;s++)(e(o[s],s,o)?t:r).push(o[s]);return[t,r]}var Rpe=/\*?\s*@((?:no)?flow)\b/,wpe=o=>class extends o{constructor(...t){super(...t),this.flowPragma=void 0}getScopeHandler(){return Sc}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(t,r){t!==134&&t!==13&&t!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(t,r)}addComment(t){if(this.flowPragma===void 0){let r=Rpe.exec(t.value);if(r)if(r[1]==="flow")this.flowPragma="flow";else if(r[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(t)}flowParseTypeInitialiser(t){let r=this.state.inType;this.state.inType=!0,this.expect(t||14);let s=this.flowParseType();return this.state.inType=r,s}flowParsePredicate(){let t=this.startNode(),r=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>r.index+1&&this.raise(J.UnexpectedSpaceBetweenModuloChecks,r),this.eat(10)?(t.value=super.parseExpression(),this.expect(11),this.finishNode(t,"DeclaredPredicate")):this.finishNode(t,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let t=this.state.inType;this.state.inType=!0,this.expect(14);let r=null,s=null;return this.match(54)?(this.state.inType=t,s=this.flowParsePredicate()):(r=this.flowParseType(),this.state.inType=t,this.match(54)&&(s=this.flowParsePredicate())),[r,s]}flowParseDeclareClass(t){return this.next(),this.flowParseInterfaceish(t,!0),this.finishNode(t,"DeclareClass")}flowParseDeclareFunction(t){this.next();let r=t.id=this.parseIdentifier(),s=this.startNode(),a=this.startNode();this.match(47)?s.typeParameters=this.flowParseTypeParameterDeclaration():s.typeParameters=null,this.expect(10);let p=this.flowParseFunctionTypeParams();return s.params=p.params,s.rest=p.rest,s.this=p._this,this.expect(11),[s.returnType,t.predicate]=this.flowParseTypeAndPredicateInitialiser(),a.typeAnnotation=this.finishNode(s,"FunctionTypeAnnotation"),r.typeAnnotation=this.finishNode(a,"TypeAnnotation"),this.resetEndLocation(r),this.semicolon(),this.scope.declareName(t.id.name,2048,t.id.loc.start),this.finishNode(t,"DeclareFunction")}flowParseDeclare(t,r){if(this.match(80))return this.flowParseDeclareClass(t);if(this.match(68))return this.flowParseDeclareFunction(t);if(this.match(74))return this.flowParseDeclareVariable(t);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(t):(r&&this.raise(J.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(t));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(t);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(t);if(this.isContextual(129))return this.flowParseDeclareInterface(t);if(this.match(82))return this.flowParseDeclareExportDeclaration(t,r);throw this.unexpected()}flowParseDeclareVariable(t){return this.next(),t.id=this.flowParseTypeAnnotatableIdentifier(),this.scope.declareName(t.id.name,5,t.id.loc.start),this.semicolon(),this.finishNode(t,"DeclareVariable")}flowParseDeclareModule(t){this.scope.enter(0),this.match(134)?t.id=super.parseExprAtom():t.id=this.parseIdentifier();let r=t.body=this.startNode(),s=r.body=[];for(this.expect(5);!this.match(8);){let u=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(J.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),s.push(super.parseImport(u))):(this.expectContextual(125,J.UnsupportedStatementInDeclareModule),s.push(this.flowParseDeclare(u,!0)))}this.scope.exit(),this.expect(8),this.finishNode(r,"BlockStatement");let a=null,p=!1;return s.forEach(u=>{Epe(u)?(a==="CommonJS"&&this.raise(J.AmbiguousDeclareModuleKind,u),a="ES"):u.type==="DeclareModuleExports"&&(p&&this.raise(J.DuplicateDeclareModuleExports,u),a==="ES"&&this.raise(J.AmbiguousDeclareModuleKind,u),a="CommonJS",p=!0)}),t.kind=a||"CommonJS",this.finishNode(t,"DeclareModule")}flowParseDeclareExportDeclaration(t,r){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?t.declaration=this.flowParseDeclare(this.startNode()):(t.declaration=this.flowParseType(),this.semicolon()),t.default=!0,this.finishNode(t,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!r){let s=this.state.value;throw this.raise(J.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:s,suggestion:Cpe[s]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return t.declaration=this.flowParseDeclare(this.startNode()),t.default=!1,this.finishNode(t,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return t=this.parseExport(t,null),t.type==="ExportNamedDeclaration"?(t.default=!1,delete t.exportKind,this.castNodeTo(t,"DeclareExportDeclaration")):this.castNodeTo(t,"DeclareExportAllDeclaration");throw this.unexpected()}flowParseDeclareModuleExports(t){return this.next(),this.expectContextual(111),t.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(t,"DeclareModuleExports")}flowParseDeclareTypeAlias(t){this.next();let r=this.flowParseTypeAlias(t);return this.castNodeTo(r,"DeclareTypeAlias"),r}flowParseDeclareOpaqueType(t){this.next();let r=this.flowParseOpaqueType(t,!0);return this.castNodeTo(r,"DeclareOpaqueType"),r}flowParseDeclareInterface(t){return this.next(),this.flowParseInterfaceish(t,!1),this.finishNode(t,"DeclareInterface")}flowParseInterfaceish(t,r){if(t.id=this.flowParseRestrictedIdentifier(!r,!0),this.scope.declareName(t.id.name,r?17:8201,t.id.loc.start),this.match(47)?t.typeParameters=this.flowParseTypeParameterDeclaration():t.typeParameters=null,t.extends=[],this.eat(81))do t.extends.push(this.flowParseInterfaceExtends());while(!r&&this.eat(12));if(r){if(t.implements=[],t.mixins=[],this.eatContextual(117))do t.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do t.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}t.body=this.flowParseObjectType({allowStatic:r,allowExact:!1,allowSpread:!1,allowProto:r,allowInexact:!1})}flowParseInterfaceExtends(){let t=this.startNode();return t.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?t.typeParameters=this.flowParseTypeParameterInstantiation():t.typeParameters=null,this.finishNode(t,"InterfaceExtends")}flowParseInterface(t){return this.flowParseInterfaceish(t,!1),this.finishNode(t,"InterfaceDeclaration")}checkNotUnderscore(t){t==="_"&&this.raise(J.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(t,r,s){Tpe.has(t)&&this.raise(s?J.AssignReservedType:J.UnexpectedReservedType,r,{reservedType:t})}flowParseRestrictedIdentifierName(t,r){return this.checkReservedType(this.state.value,this.state.startLoc,r),this.parseIdentifierName(t)}flowParseRestrictedIdentifier(t,r){let s=this.startNode(),a=this.flowParseRestrictedIdentifierName(t,r);return this.createIdentifier(s,a)}flowParseTypeAlias(t){return t.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(t.id.name,8201,t.id.loc.start),this.match(47)?t.typeParameters=this.flowParseTypeParameterDeclaration():t.typeParameters=null,t.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(t,"TypeAlias")}flowParseOpaqueType(t,r){return this.expectContextual(130),t.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(t.id.name,8201,t.id.loc.start),this.match(47)?t.typeParameters=this.flowParseTypeParameterDeclaration():t.typeParameters=null,t.supertype=null,this.match(14)&&(t.supertype=this.flowParseTypeInitialiser(14)),t.impltype=null,r||(t.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(t,"OpaqueType")}flowParseTypeParameterBound(){if(this.match(14)||this.isContextual(81)){let t=this.startNode();return this.next(),t.typeAnnotation=this.flowParseType(),this.finishNode(t,"TypeAnnotation")}}flowParseTypeParameter(t=!1){let r=this.state.startLoc,s=this.startNode(),a=this.flowParseVariance();return s.name=this.flowParseRestrictedIdentifierName(),s.variance=a,s.bound=this.flowParseTypeParameterBound(),this.match(29)?(this.eat(29),s.default=this.flowParseType()):t&&this.raise(J.MissingTypeParamDefault,r),this.finishNode(s,"TypeParameter")}flowParseTypeParameterDeclaration(){let t=this.state.inType,r=this.startNode();r.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let s=!1;do{let a=this.flowParseTypeParameter(s);r.params.push(a),a.default&&(s=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=t,this.finishNode(r,"TypeParameterDeclaration")}flowInTopLevelContext(t){if(this.curContext()!==ce.brace){let r=this.state.context;this.state.context=[r[0]];try{return t()}finally{this.state.context=r}}else return t()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let t=this.startNode(),r=this.state.inType;return this.state.inType=!0,t.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let s=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)t.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=s}),this.state.inType=r,!this.state.inType&&this.curContext()===ce.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(t,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return null;let t=this.startNode(),r=this.state.inType;for(t.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)t.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=r,this.finishNode(t,"TypeParameterInstantiation")}flowParseInterfaceType(){let t=this.startNode();if(this.expectContextual(129),t.extends=[],this.eat(81))do t.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return t.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(t,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(t,r,s){return t.static=r,this.lookahead().type===14?(t.id=this.flowParseObjectPropertyKey(),t.key=this.flowParseTypeInitialiser()):(t.id=null,t.key=this.flowParseType()),this.expect(3),t.value=this.flowParseTypeInitialiser(),t.variance=s,this.finishNode(t,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(t,r){return t.static=r,t.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(t.method=!0,t.optional=!1,t.value=this.flowParseObjectTypeMethodish(this.startNodeAt(t.loc.start))):(t.method=!1,this.eat(17)&&(t.optional=!0),t.value=this.flowParseTypeInitialiser()),this.finishNode(t,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(t){for(t.params=[],t.rest=null,t.typeParameters=null,t.this=null,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(t.this=this.flowParseFunctionTypeParam(!0),t.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)t.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(t.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),t.returnType=this.flowParseTypeInitialiser(),this.finishNode(t,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(t,r){let s=this.startNode();return t.static=r,t.value=this.flowParseObjectTypeMethodish(s),this.finishNode(t,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:t,allowExact:r,allowSpread:s,allowProto:a,allowInexact:p}){let u=this.state.inType;this.state.inType=!0;let f=this.startNode();f.callProperties=[],f.properties=[],f.indexers=[],f.internalSlots=[];let m,x,g=!1;for(r&&this.match(6)?(this.expect(6),m=9,x=!0):(this.expect(5),m=8,x=!1),f.exact=x;!this.match(m);){let w=!1,k=null,F=null,Y=this.startNode();if(a&&this.isContextual(118)){let ee=this.lookahead();ee.type!==14&&ee.type!==17&&(this.next(),k=this.state.startLoc,t=!1)}if(t&&this.isContextual(106)){let ee=this.lookahead();ee.type!==14&&ee.type!==17&&(this.next(),w=!0)}let W=this.flowParseVariance();if(this.eat(0))k!=null&&this.unexpected(k),this.eat(0)?(W&&this.unexpected(W.loc.start),f.internalSlots.push(this.flowParseObjectTypeInternalSlot(Y,w))):f.indexers.push(this.flowParseObjectTypeIndexer(Y,w,W));else if(this.match(10)||this.match(47))k!=null&&this.unexpected(k),W&&this.unexpected(W.loc.start),f.callProperties.push(this.flowParseObjectTypeCallProperty(Y,w));else{let ee="init";if(this.isContextual(99)||this.isContextual(104)){let Te=this.lookahead();Vh(Te.type)&&(ee=this.state.value,this.next())}let de=this.flowParseObjectTypeProperty(Y,w,k,W,ee,s,p??!x);de===null?(g=!0,F=this.state.lastTokStartLoc):f.properties.push(de)}this.flowObjectTypeSemicolon(),F&&!this.match(8)&&!this.match(9)&&this.raise(J.UnexpectedExplicitInexactInObject,F)}this.expect(m),s&&(f.inexact=g);let z=this.finishNode(f,"ObjectTypeAnnotation");return this.state.inType=u,z}flowParseObjectTypeProperty(t,r,s,a,p,u,f){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(u?f||this.raise(J.InexactInsideExact,this.state.lastTokStartLoc):this.raise(J.InexactInsideNonObject,this.state.lastTokStartLoc),a&&this.raise(J.InexactVariance,a),null):(u||this.raise(J.UnexpectedSpreadType,this.state.lastTokStartLoc),s!=null&&this.unexpected(s),a&&this.raise(J.SpreadVariance,a),t.argument=this.flowParseType(),this.finishNode(t,"ObjectTypeSpreadProperty"));{t.key=this.flowParseObjectPropertyKey(),t.static=r,t.proto=s!=null,t.kind=p;let m=!1;return this.match(47)||this.match(10)?(t.method=!0,s!=null&&this.unexpected(s),a&&this.unexpected(a.loc.start),t.value=this.flowParseObjectTypeMethodish(this.startNodeAt(t.loc.start)),(p==="get"||p==="set")&&this.flowCheckGetterSetterParams(t),!u&&t.key.name==="constructor"&&t.value.this&&this.raise(J.ThisParamBannedInConstructor,t.value.this)):(p!=="init"&&this.unexpected(),t.method=!1,this.eat(17)&&(m=!0),t.value=this.flowParseTypeInitialiser(),t.variance=a),t.optional=m,this.finishNode(t,"ObjectTypeProperty")}}flowCheckGetterSetterParams(t){let r=t.kind==="get"?0:1,s=t.value.params.length+(t.value.rest?1:0);t.value.this&&this.raise(t.kind==="get"?J.GetterMayNotHaveThisParam:J.SetterMayNotHaveThisParam,t.value.this),s!==r&&this.raise(t.kind==="get"?R.BadGetterArity:R.BadSetterArity,t),t.kind==="set"&&t.value.rest&&this.raise(R.BadSetterRestParameter,t)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(t,r){t??(t=this.state.startLoc);let s=r||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let a=this.startNodeAt(t);a.qualification=s,a.id=this.flowParseRestrictedIdentifier(!0),s=this.finishNode(a,"QualifiedTypeIdentifier")}return s}flowParseGenericType(t,r){let s=this.startNodeAt(t);return s.typeParameters=null,s.id=this.flowParseQualifiedTypeIdentifier(t,r),this.match(47)&&(s.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(s,"GenericTypeAnnotation")}flowParseTypeofType(){let t=this.startNode();return this.expect(87),t.argument=this.flowParsePrimaryType(),this.finishNode(t,"TypeofTypeAnnotation")}flowParseTupleType(){let t=this.startNode();for(t.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(t.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(t,"TupleTypeAnnotation")}flowParseFunctionTypeParam(t){let r=null,s=!1,a=null,p=this.startNode(),u=this.lookahead(),f=this.state.type===78;return u.type===14||u.type===17?(f&&!t&&this.raise(J.ThisParamMustBeFirst,p),r=this.parseIdentifier(f),this.eat(17)&&(s=!0,f&&this.raise(J.ThisParamMayNotBeOptional,p)),a=this.flowParseTypeInitialiser()):a=this.flowParseType(),p.name=r,p.optional=s,p.typeAnnotation=a,this.finishNode(p,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(t){let r=this.startNodeAt(t.loc.start);return r.name=null,r.optional=!1,r.typeAnnotation=t,this.finishNode(r,"FunctionTypeParam")}flowParseFunctionTypeParams(t=[]){let r=null,s=null;for(this.match(78)&&(s=this.flowParseFunctionTypeParam(!0),s.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)t.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(r=this.flowParseFunctionTypeParam(!1)),{params:t,rest:r,_this:s}}flowIdentToTypeAnnotation(t,r,s){switch(s.name){case"any":return this.finishNode(r,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(r,"BooleanTypeAnnotation");case"mixed":return this.finishNode(r,"MixedTypeAnnotation");case"empty":return this.finishNode(r,"EmptyTypeAnnotation");case"number":return this.finishNode(r,"NumberTypeAnnotation");case"string":return this.finishNode(r,"StringTypeAnnotation");case"symbol":return this.finishNode(r,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(s.name),this.flowParseGenericType(t,s)}}flowParsePrimaryType(){let t=this.state.startLoc,r=this.startNode(),s,a,p=!1,u=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,a=this.flowParseTupleType(),this.state.noAnonFunctionType=u,a;case 47:{let f=this.startNode();return f.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),s=this.flowParseFunctionTypeParams(),f.params=s.params,f.rest=s.rest,f.this=s._this,this.expect(11),this.expect(19),f.returnType=this.flowParseType(),this.finishNode(f,"FunctionTypeAnnotation")}case 10:{let f=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(pe(this.state.type)||this.match(78)){let m=this.lookahead().type;p=m!==17&&m!==14}else p=!0;if(p){if(this.state.noAnonFunctionType=!1,a=this.flowParseType(),this.state.noAnonFunctionType=u,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),a;this.eat(12)}return a?s=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(a)]):s=this.flowParseFunctionTypeParams(),f.params=s.params,f.rest=s.rest,f.this=s._this,this.expect(11),this.expect(19),f.returnType=this.flowParseType(),f.typeParameters=null,this.finishNode(f,"FunctionTypeAnnotation")}case 134:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return r.value=this.match(85),this.next(),this.finishNode(r,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(135))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",r);if(this.match(136))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",r);throw this.raise(J.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 135:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 136:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(r,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(r,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(r,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(r,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(Gc(this.state.type)){let f=Ft(this.state.type);return this.next(),super.createIdentifier(r,f)}else if(pe(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(t,r,this.parseIdentifier())}throw this.unexpected()}flowParsePostfixType(){let t=this.state.startLoc,r=this.flowParsePrimaryType(),s=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let a=this.startNodeAt(t),p=this.eat(18);s=s||p,this.expect(0),!p&&this.match(3)?(a.elementType=r,this.next(),r=this.finishNode(a,"ArrayTypeAnnotation")):(a.objectType=r,a.indexType=this.flowParseType(),this.expect(3),s?(a.optional=p,r=this.finishNode(a,"OptionalIndexedAccessType")):r=this.finishNode(a,"IndexedAccessType"))}return r}flowParsePrefixType(){let t=this.startNode();return this.eat(17)?(t.typeAnnotation=this.flowParsePrefixType(),this.finishNode(t,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let t=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let r=this.startNodeAt(t.loc.start);return r.params=[this.reinterpretTypeAsFunctionTypeParam(t)],r.rest=null,r.this=null,r.returnType=this.flowParseType(),r.typeParameters=null,this.finishNode(r,"FunctionTypeAnnotation")}return t}flowParseIntersectionType(){let t=this.startNode();this.eat(45);let r=this.flowParseAnonFunctionWithoutParens();for(t.types=[r];this.eat(45);)t.types.push(this.flowParseAnonFunctionWithoutParens());return t.types.length===1?r:this.finishNode(t,"IntersectionTypeAnnotation")}flowParseUnionType(){let t=this.startNode();this.eat(43);let r=this.flowParseIntersectionType();for(t.types=[r];this.eat(43);)t.types.push(this.flowParseIntersectionType());return t.types.length===1?r:this.finishNode(t,"UnionTypeAnnotation")}flowParseType(){let t=this.state.inType;this.state.inType=!0;let r=this.flowParseUnionType();return this.state.inType=t,r}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let t=this.state.startLoc,r=this.parseIdentifier();return this.flowParseGenericType(t,r)}else return this.flowParseType()}flowParseTypeAnnotation(){let t=this.startNode();return t.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(t,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(){let t=this.startNode(),r=this.parseIdentifierName();return this.match(14)&&(t.typeAnnotation=this.flowParseTypeAnnotation()),this.createIdentifier(t,r)}typeCastToParameter(t){return t.expression.typeAnnotation=t.typeAnnotation,this.resetEndLocation(t.expression,t.typeAnnotation.loc.end),t.expression}flowParseVariance(){let t=null;return this.match(53)?(t=this.startNode(),this.state.value==="+"?t.kind="plus":t.kind="minus",this.next(),this.finishNode(t,"Variance")):t}parseFunctionBody(t,r,s=!1){if(r){this.forwardNoArrowParamsConversionAt(t,()=>super.parseFunctionBody(t,!0,s));return}super.parseFunctionBody(t,!1,s)}parseFunctionBodyAndFinish(t,r,s=!1){if(this.match(14)){let a=this.startNode();[a.typeAnnotation,t.predicate]=this.flowParseTypeAndPredicateInitialiser(),t.returnType=a.typeAnnotation?this.finishNode(a,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(t,r,s)}parseStatementLike(t){if(this.state.strict&&this.isContextual(129)){let s=this.lookahead();if(pt(s.type)){let a=this.startNode();return this.next(),this.flowParseInterface(a)}}else if(this.isContextual(126)){let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}let r=super.parseStatementLike(t);return this.flowPragma===void 0&&!this.isValidDirective(r)&&(this.flowPragma=null),r}parseExpressionStatement(t,r,s){if(r.type==="Identifier"){if(r.name==="declare"){if(this.match(80)||pe(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(t)}else if(pe(this.state.type)){if(r.name==="interface")return this.flowParseInterface(t);if(r.name==="type")return this.flowParseTypeAlias(t);if(r.name==="opaque")return this.flowParseOpaqueType(t,!1)}}return super.parseExpressionStatement(t,r,s)}shouldParseExportDeclaration(){let{type:t}=this.state;return t===126||Mh(t)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:t}=this.state;return t===126||Mh(t)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}return super.parseExportDefaultExpression()}parseConditional(t,r,s){if(!this.match(17))return t;if(this.state.maybeInArrowParameters){let z=this.lookaheadCharCode();if(z===44||z===61||z===58||z===41)return this.setOptionalParametersError(s),t}this.expect(17);let a=this.state.clone(),p=this.state.noArrowAt,u=this.startNodeAt(r),{consequent:f,failed:m}=this.tryParseConditionalConsequent(),[x,g]=this.getArrowLikeExpressions(f);if(m||g.length>0){let z=[...p];if(g.length>0){this.state=a,this.state.noArrowAt=z;for(let w=0;w<g.length;w++)z.push(g[w].start);({consequent:f,failed:m}=this.tryParseConditionalConsequent()),[x,g]=this.getArrowLikeExpressions(f)}m&&x.length>1&&this.raise(J.AmbiguousConditionalArrow,a.startLoc),m&&x.length===1&&(this.state=a,z.push(x[0].start),this.state.noArrowAt=z,{consequent:f,failed:m}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(f,!0),this.state.noArrowAt=p,this.expect(14),u.test=t,u.consequent=f,u.alternate=this.forwardNoArrowParamsConversionAt(u,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(u,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let t=this.parseMaybeAssignAllowIn(),r=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:t,failed:r}}getArrowLikeExpressions(t,r){let s=[t],a=[];for(;s.length!==0;){let p=s.pop();p.type==="ArrowFunctionExpression"&&p.body.type!=="BlockStatement"?(p.typeParameters||!p.returnType?this.finishArrowValidation(p):a.push(p),s.push(p.body)):p.type==="ConditionalExpression"&&(s.push(p.consequent),s.push(p.alternate))}return r?(a.forEach(p=>this.finishArrowValidation(p)),[a,[]]):Ipe(a,p=>p.params.every(u=>this.isAssignable(u,!0)))}finishArrowValidation(t){var r;this.toAssignableList(t.params,(r=t.extra)==null?void 0:r.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(t,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(t,r){let s;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(t.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),s=r(),this.state.noArrowParamsConversionAt.pop()):s=r(),s}parseParenItem(t,r){let s=super.parseParenItem(t,r);if(this.eat(17)&&(s.optional=!0,this.resetEndLocation(t)),this.match(14)){let a=this.startNodeAt(r);return a.expression=s,a.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(a,"TypeCastExpression")}return s}assertModuleNodeAllowed(t){t.type==="ImportDeclaration"&&(t.importKind==="type"||t.importKind==="typeof")||t.type==="ExportNamedDeclaration"&&t.exportKind==="type"||t.type==="ExportAllDeclaration"&&t.exportKind==="type"||super.assertModuleNodeAllowed(t)}parseExportDeclaration(t){if(this.isContextual(130)){t.exportKind="type";let r=this.startNode();return this.next(),this.match(5)?(t.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(t),null):this.flowParseTypeAlias(r)}else if(this.isContextual(131)){t.exportKind="type";let r=this.startNode();return this.next(),this.flowParseOpaqueType(r,!1)}else if(this.isContextual(129)){t.exportKind="type";let r=this.startNode();return this.next(),this.flowParseInterface(r)}else if(this.isContextual(126)){t.exportKind="value";let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}else return super.parseExportDeclaration(t)}eatExportStar(t){return super.eatExportStar(t)?!0:this.isContextual(130)&&this.lookahead().type===55?(t.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(t){let{startLoc:r}=this.state,s=super.maybeParseExportNamespaceSpecifier(t);return s&&t.exportKind==="type"&&this.unexpected(r),s}parseClassId(t,r,s){super.parseClassId(t,r,s),this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(t,r,s){let{startLoc:a}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(t,r))return;r.declare=!0}super.parseClassMember(t,r,s),r.declare&&(r.type!=="ClassProperty"&&r.type!=="ClassPrivateProperty"&&r.type!=="PropertyDefinition"?this.raise(J.DeclareClassElement,a):r.value&&this.raise(J.DeclareClassFieldInitializer,r.value))}isIterator(t){return t==="iterator"||t==="asyncIterator"}readIterator(){let t=super.readWord1(),r="@@"+t;(!this.isIterator(t)||!this.state.inType)&&this.raise(R.InvalidIdentifier,this.state.curPosition(),{identifierName:r}),this.finishToken(132,r)}getTokenFromCode(t){let r=this.input.charCodeAt(this.state.pos+1);t===123&&r===124?this.finishOp(6,2):this.state.inType&&(t===62||t===60)?this.finishOp(t===62?48:47,1):this.state.inType&&t===63?r===46?this.finishOp(18,2):this.finishOp(17,1):Ape(t,r,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(t)}isAssignable(t,r){return t.type==="TypeCastExpression"?this.isAssignable(t.expression,r):super.isAssignable(t,r)}toAssignable(t,r=!1){!r&&t.type==="AssignmentExpression"&&t.left.type==="TypeCastExpression"&&(t.left=this.typeCastToParameter(t.left)),super.toAssignable(t,r)}toAssignableList(t,r,s){for(let a=0;a<t.length;a++){let p=t[a];p?.type==="TypeCastExpression"&&(t[a]=this.typeCastToParameter(p))}super.toAssignableList(t,r,s)}toReferencedList(t,r){for(let a=0;a<t.length;a++){var s;let p=t[a];p&&p.type==="TypeCastExpression"&&!((s=p.extra)!=null&&s.parenthesized)&&(t.length>1||!r)&&this.raise(J.TypeCastInPattern,p.typeAnnotation)}return t}parseArrayLike(t,r,s){let a=super.parseArrayLike(t,r,s);return s!=null&&!this.state.maybeInArrowParameters&&this.toReferencedList(a.elements),a}isValidLVal(t,r,s,a){return t==="TypeCastExpression"||super.isValidLVal(t,r,s,a)}parseClassProperty(t){return this.match(14)&&(t.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(t)}parseClassPrivateProperty(t){return this.match(14)&&(t.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(t)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(t){return!this.match(14)&&super.isNonstaticConstructor(t)}pushClassMethod(t,r,s,a,p,u){if(r.variance&&this.unexpected(r.variance.loc.start),delete r.variance,this.match(47)&&(r.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(t,r,s,a,p,u),r.params&&p){let f=r.params;f.length>0&&this.isThisParam(f[0])&&this.raise(J.ThisParamBannedInConstructor,r)}else if(r.type==="MethodDefinition"&&p&&r.value.params){let f=r.value.params;f.length>0&&this.isThisParam(f[0])&&this.raise(J.ThisParamBannedInConstructor,r)}}pushClassPrivateMethod(t,r,s,a){r.variance&&this.unexpected(r.variance.loc.start),delete r.variance,this.match(47)&&(r.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(t,r,s,a)}parseClassSuper(t){if(super.parseClassSuper(t),t.superClass&&(this.match(47)||this.match(51))&&(t.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();let r=t.implements=[];do{let s=this.startNode();s.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?s.typeParameters=this.flowParseTypeParameterInstantiation():s.typeParameters=null,r.push(this.finishNode(s,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(t){super.checkGetterSetterParams(t);let r=this.getObjectOrClassMethodParams(t);if(r.length>0){let s=r[0];this.isThisParam(s)&&t.kind==="get"?this.raise(J.GetterMayNotHaveThisParam,s):this.isThisParam(s)&&this.raise(J.SetterMayNotHaveThisParam,s)}}parsePropertyNamePrefixOperator(t){t.variance=this.flowParseVariance()}parseObjPropValue(t,r,s,a,p,u,f){t.variance&&this.unexpected(t.variance.loc.start),delete t.variance;let m;this.match(47)&&!u&&(m=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let x=super.parseObjPropValue(t,r,s,a,p,u,f);return m&&((x.value||x).typeParameters=m),x}parseFunctionParamType(t){return this.eat(17)&&(t.type!=="Identifier"&&this.raise(J.PatternIsOptional,t),this.isThisParam(t)&&this.raise(J.ThisParamMayNotBeOptional,t),t.optional=!0),this.match(14)?t.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(t)&&this.raise(J.ThisParamAnnotationRequired,t),this.match(29)&&this.isThisParam(t)&&this.raise(J.ThisParamNoDefault,t),this.resetEndLocation(t),t}parseMaybeDefault(t,r){let s=super.parseMaybeDefault(t,r);return s.type==="AssignmentPattern"&&s.typeAnnotation&&s.right.start<s.typeAnnotation.start&&this.raise(J.TypeBeforeInitializer,s.typeAnnotation),s}checkImportReflection(t){super.checkImportReflection(t),t.module&&t.importKind!=="value"&&this.raise(J.ImportReflectionHasImportType,t.specifiers[0].loc.start)}parseImportSpecifierLocal(t,r,s){r.local=kh(t)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(r,s))}isPotentialImportPhase(t){if(super.isPotentialImportPhase(t))return!0;if(this.isContextual(130)){if(!t)return!0;let r=this.lookaheadCharCode();return r===123||r===42}return!t&&this.isContextual(87)}applyImportPhase(t,r,s,a){if(super.applyImportPhase(t,r,s,a),r){if(!s&&this.match(65))return;t.exportKind=s==="type"?s:"value"}else s==="type"&&this.match(55)&&this.unexpected(),t.importKind=s==="type"||s==="typeof"?s:"value"}parseImportSpecifier(t,r,s,a,p){let u=t.imported,f=null;u.type==="Identifier"&&(u.name==="type"?f="type":u.name==="typeof"&&(f="typeof"));let m=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let g=this.parseIdentifier(!0);f!==null&&!pt(this.state.type)?(t.imported=g,t.importKind=f,t.local=this.cloneIdentifier(g)):(t.imported=u,t.importKind=null,t.local=this.parseIdentifier())}else{if(f!==null&&pt(this.state.type))t.imported=this.parseIdentifier(!0),t.importKind=f;else{if(r)throw this.raise(R.ImportBindingIsString,t,{importName:u.value});t.imported=u,t.importKind=null}this.eatContextual(93)?t.local=this.parseIdentifier():(m=!0,t.local=this.cloneIdentifier(t.imported))}let x=kh(t);return s&&x&&this.raise(J.ImportTypeShorthandOnlyInPureImport,t),(s||x)&&this.checkReservedType(t.local.name,t.local.loc.start,!0),m&&!s&&!x&&this.checkReservedWord(t.local.name,t.loc.start,!0,!0),this.finishImportSpecifier(t,"ImportSpecifier")}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseFunctionParams(t,r){let s=t.kind;s!=="get"&&s!=="set"&&this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(t,r)}parseVarId(t,r){super.parseVarId(t,r),this.match(14)&&(t.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(t.id))}parseAsyncArrowFromCallExpression(t,r){if(this.match(14)){let s=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,t.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=s}return super.parseAsyncArrowFromCallExpression(t,r)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(t,r){var s;let a=null,p;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(a=this.state.clone(),p=this.tryParse(()=>super.parseMaybeAssign(t,r),a),!p.error)return p.node;let{context:m}=this.state,x=m[m.length-1];(x===ce.j_oTag||x===ce.j_expr)&&m.pop()}if((s=p)!=null&&s.error||this.match(47)){var u,f;a=a||this.state.clone();let m,x=this.tryParse(z=>{var w;m=this.flowParseTypeParameterDeclaration();let k=this.forwardNoArrowParamsConversionAt(m,()=>{let Y=super.parseMaybeAssign(t,r);return this.resetStartLocationFromNode(Y,m),Y});(w=k.extra)!=null&&w.parenthesized&&z();let F=this.maybeUnwrapTypeCastExpression(k);return F.type!=="ArrowFunctionExpression"&&z(),F.typeParameters=m,this.resetStartLocationFromNode(F,m),k},a),g=null;if(x.node&&this.maybeUnwrapTypeCastExpression(x.node).type==="ArrowFunctionExpression"){if(!x.error&&!x.aborted)return x.node.async&&this.raise(J.UnexpectedTypeParameterBeforeAsyncArrowFunction,m),x.node;g=x.node}if((u=p)!=null&&u.node)return this.state=p.failState,p.node;if(g)return this.state=x.failState,g;throw(f=p)!=null&&f.thrown?p.error:x.thrown?x.error:this.raise(J.UnexpectedTokenAfterTypeParameter,m)}return super.parseMaybeAssign(t,r)}parseArrow(t){if(this.match(14)){let r=this.tryParse(()=>{let s=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let a=this.startNode();return[a.typeAnnotation,t.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=s,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),a});if(r.thrown)return null;r.error&&(this.state=r.failState),t.returnType=r.node.typeAnnotation?this.finishNode(r.node,"TypeAnnotation"):null}return super.parseArrow(t)}shouldParseArrow(t){return this.match(14)||super.shouldParseArrow(t)}setArrowFunctionParameters(t,r){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(t.start))?t.params=r:super.setArrowFunctionParameters(t,r)}checkParams(t,r,s,a=!0){if(!(s&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(t.start)))){for(let p=0;p<t.params.length;p++)this.isThisParam(t.params[p])&&p>0&&this.raise(J.ThisParamMustBeFirst,t.params[p]);super.checkParams(t,r,s,a)}}parseParenAndDistinguishExpression(t){return super.parseParenAndDistinguishExpression(t&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(t,r,s){if(t.type==="Identifier"&&t.name==="async"&&this.state.noArrowAt.includes(r.index)){this.next();let a=this.startNodeAt(r);a.callee=t,a.arguments=super.parseCallExpressionArguments(),t=this.finishNode(a,"CallExpression")}else if(t.type==="Identifier"&&t.name==="async"&&this.match(47)){let a=this.state.clone(),p=this.tryParse(f=>this.parseAsyncArrowWithTypeParameters(r)||f(),a);if(!p.error&&!p.aborted)return p.node;let u=this.tryParse(()=>super.parseSubscripts(t,r,s),a);if(u.node&&!u.error)return u.node;if(p.node)return this.state=p.failState,p.node;if(u.node)return this.state=u.failState,u.node;throw p.error||u.error}return super.parseSubscripts(t,r,s)}parseSubscript(t,r,s,a){if(this.match(18)&&this.isLookaheadToken_lt()){if(a.optionalChainMember=!0,s)return a.stop=!0,t;this.next();let p=this.startNodeAt(r);return p.callee=t,p.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),p.arguments=this.parseCallExpressionArguments(),p.optional=!0,this.finishCallExpression(p,!0)}else if(!s&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let p=this.startNodeAt(r);p.callee=t;let u=this.tryParse(()=>(p.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),p.arguments=super.parseCallExpressionArguments(),a.optionalChainMember&&(p.optional=!1),this.finishCallExpression(p,a.optionalChainMember)));if(u.node)return u.error&&(this.state=u.failState),u.node}return super.parseSubscript(t,r,s,a)}parseNewCallee(t){super.parseNewCallee(t);let r=null;this.shouldParseTypes()&&this.match(47)&&(r=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),t.typeArguments=r}parseAsyncArrowWithTypeParameters(t){let r=this.startNodeAt(t);if(this.parseFunctionParams(r,!1),!!this.parseArrow(r))return super.parseArrowExpression(r,void 0,!0)}readToken_mult_modulo(t){let r=this.input.charCodeAt(this.state.pos+1);if(t===42&&r===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(t)}readToken_pipe_amp(t){let r=this.input.charCodeAt(this.state.pos+1);if(t===124&&r===125){this.finishOp(9,2);return}super.readToken_pipe_amp(t)}parseTopLevel(t,r){let s=super.parseTopLevel(t,r);return this.state.hasFlowComment&&this.raise(J.UnterminatedFlowComment,this.state.curPosition()),s}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(J.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let t=this.skipFlowComment();t&&(this.state.pos+=t,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:t}=this.state,r=2;for(;[32,9].includes(this.input.charCodeAt(t+r));)r++;let s=this.input.charCodeAt(r+t),a=this.input.charCodeAt(r+t+1);return s===58&&a===58?r+2:this.input.slice(r+t,r+t+12)==="flow-include"?r+12:s===58&&a!==58?r:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(R.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(t,{enumName:r,memberName:s}){this.raise(J.EnumBooleanMemberNotInitialized,t,{memberName:s,enumName:r})}flowEnumErrorInvalidMemberInitializer(t,r){return this.raise(r.explicitType?r.explicitType==="symbol"?J.EnumInvalidMemberInitializerSymbolType:J.EnumInvalidMemberInitializerPrimaryType:J.EnumInvalidMemberInitializerUnknownType,t,r)}flowEnumErrorNumberMemberNotInitialized(t,r){this.raise(J.EnumNumberMemberNotInitialized,t,r)}flowEnumErrorStringMemberInconsistentlyInitialized(t,r){this.raise(J.EnumStringMemberInconsistentlyInitialized,t,r)}flowEnumMemberInit(){let t=this.state.startLoc,r=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let s=this.parseNumericLiteral(this.state.value);return r()?{type:"number",loc:s.loc.start,value:s}:{type:"invalid",loc:t}}case 134:{let s=this.parseStringLiteral(this.state.value);return r()?{type:"string",loc:s.loc.start,value:s}:{type:"invalid",loc:t}}case 85:case 86:{let s=this.parseBooleanLiteral(this.match(85));return r()?{type:"boolean",loc:s.loc.start,value:s}:{type:"invalid",loc:t}}default:return{type:"invalid",loc:t}}}flowEnumMemberRaw(){let t=this.state.startLoc,r=this.parseIdentifier(!0),s=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:t};return{id:r,init:s}}flowEnumCheckExplicitTypeMismatch(t,r,s){let{explicitType:a}=r;a!==null&&a!==s&&this.flowEnumErrorInvalidMemberInitializer(t,r)}flowEnumMembers({enumName:t,explicitType:r}){let s=new Set,a={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},p=!1;for(;!this.match(8);){if(this.eat(21)){p=!0;break}let u=this.startNode(),{id:f,init:m}=this.flowEnumMemberRaw(),x=f.name;if(x==="")continue;/^[a-z]/.test(x)&&this.raise(J.EnumInvalidMemberName,f,{memberName:x,suggestion:x[0].toUpperCase()+x.slice(1),enumName:t}),s.has(x)&&this.raise(J.EnumDuplicateMemberName,f,{memberName:x,enumName:t}),s.add(x);let g={enumName:t,explicitType:r,memberName:x};switch(u.id=f,m.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(m.loc,g,"boolean"),u.init=m.value,a.booleanMembers.push(this.finishNode(u,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(m.loc,g,"number"),u.init=m.value,a.numberMembers.push(this.finishNode(u,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(m.loc,g,"string"),u.init=m.value,a.stringMembers.push(this.finishNode(u,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(m.loc,g);case"none":switch(r){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(m.loc,g);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(m.loc,g);break;default:a.defaultedMembers.push(this.finishNode(u,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:a,hasUnknownMembers:p}}flowEnumStringMembers(t,r,{enumName:s}){if(t.length===0)return r;if(r.length===0)return t;if(r.length>t.length){for(let a of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(a,{enumName:s});return r}else{for(let a of r)this.flowEnumErrorStringMemberInconsistentlyInitialized(a,{enumName:s});return t}}flowEnumParseExplicitType({enumName:t}){if(!this.eatContextual(102))return null;if(!pe(this.state.type))throw this.raise(J.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:t});let{value:r}=this.state;return this.next(),r!=="boolean"&&r!=="number"&&r!=="string"&&r!=="symbol"&&this.raise(J.EnumInvalidExplicitType,this.state.startLoc,{enumName:t,invalidEnumType:r}),r}flowEnumBody(t,r){let s=r.name,a=r.loc.start,p=this.flowEnumParseExplicitType({enumName:s});this.expect(5);let{members:u,hasUnknownMembers:f}=this.flowEnumMembers({enumName:s,explicitType:p});switch(t.hasUnknownMembers=f,p){case"boolean":return t.explicitType=!0,t.members=u.booleanMembers,this.expect(8),this.finishNode(t,"EnumBooleanBody");case"number":return t.explicitType=!0,t.members=u.numberMembers,this.expect(8),this.finishNode(t,"EnumNumberBody");case"string":return t.explicitType=!0,t.members=this.flowEnumStringMembers(u.stringMembers,u.defaultedMembers,{enumName:s}),this.expect(8),this.finishNode(t,"EnumStringBody");case"symbol":return t.members=u.defaultedMembers,this.expect(8),this.finishNode(t,"EnumSymbolBody");default:{let m=()=>(t.members=[],this.expect(8),this.finishNode(t,"EnumStringBody"));t.explicitType=!1;let x=u.booleanMembers.length,g=u.numberMembers.length,z=u.stringMembers.length,w=u.defaultedMembers.length;if(!x&&!g&&!z&&!w)return m();if(!x&&!g)return t.members=this.flowEnumStringMembers(u.stringMembers,u.defaultedMembers,{enumName:s}),this.expect(8),this.finishNode(t,"EnumStringBody");if(!g&&!z&&x>=w){for(let k of u.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(k.loc.start,{enumName:s,memberName:k.id.name});return t.members=u.booleanMembers,this.expect(8),this.finishNode(t,"EnumBooleanBody")}else if(!x&&!z&&g>=w){for(let k of u.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(k.loc.start,{enumName:s,memberName:k.id.name});return t.members=u.numberMembers,this.expect(8),this.finishNode(t,"EnumNumberBody")}else return this.raise(J.EnumInconsistentMemberValues,a,{enumName:s}),m()}}}flowParseEnumDeclaration(t){let r=this.parseIdentifier();return t.id=r,t.body=this.flowEnumBody(this.startNode(),r),this.finishNode(t,"EnumDeclaration")}jsxParseOpeningElementAfterName(t){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(t.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(t)}isLookaheadToken_lt(){let t=this.nextTokenStart();if(this.input.charCodeAt(t)===60){let r=this.input.charCodeAt(t+1);return r!==60&&r!==61}return!1}reScan_lt_gt(){let{type:t}=this.state;t===47?(this.state.pos-=1,this.readToken_lt()):t===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:t}=this.state;return t===51?(this.state.pos-=2,this.finishOp(47,1),47):t}maybeUnwrapTypeCastExpression(t){return t.type==="TypeCastExpression"?t.expression:t}},Ope={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},Mpe=/\r\n|[\r\n\u2028\u2029]/,Vs=new RegExp(Mpe.source,"g");function Ao(o){switch(o){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function Ph(o,e,t){for(let r=e;r<t;r++)if(Ao(o.charCodeAt(r)))return!0;return!1}var hc=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,fc=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function kpe(o){switch(o){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var $t=ct`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:o})=>`Expected corresponding JSX closing tag for <${o}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:o,HTMLEntity:e})=>`Unexpected token \`${o}\`. Did you mean \`${e}\` or \`{'${o}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function vt(o){return o?o.type==="JSXOpeningFragment"||o.type==="JSXClosingFragment":!1}function yo(o){if(o.type==="JSXIdentifier")return o.name;if(o.type==="JSXNamespacedName")return o.namespace.name+":"+o.name.name;if(o.type==="JSXMemberExpression")return yo(o.object)+"."+yo(o.property);throw new Error("Node had unexpected type: "+o.type)}var Ppe=o=>class extends o{jsxReadToken(){let t="",r=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise($t.UnterminatedJsxContent,this.state.startLoc);let s=this.input.charCodeAt(this.state.pos);switch(s){case 60:case 123:if(this.state.pos===this.state.start){s===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(s);return}t+=this.input.slice(r,this.state.pos),this.finishToken(142,t);return;case 38:t+=this.input.slice(r,this.state.pos),t+=this.jsxReadEntity(),r=this.state.pos;break;default:Ao(s)?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadNewLine(!0),r=this.state.pos):++this.state.pos}}}jsxReadNewLine(t){let r=this.input.charCodeAt(this.state.pos),s;return++this.state.pos,r===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,s=t?`
5
5
  `:`\r
6
- `):r=String.fromCharCode(o),++this.state.curLine,this.state.lineStart=this.state.pos,r}jsxReadString(e){let o="",r=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(w.UnterminatedString,this.state.startLoc);let c=this.input.charCodeAt(this.state.pos);if(c===e)break;c===38?(o+=this.input.slice(r,this.state.pos),o+=this.jsxReadEntity(),r=this.state.pos):tt(c)?(o+=this.input.slice(r,this.state.pos),o+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}o+=this.input.slice(r,this.state.pos++),this.finishToken(134,o)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let o=10;this.codePointAtPos(this.state.pos)===120&&(o=16,++this.state.pos);let r=this.readInt(o,void 0,!1,"bail");if(r!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(r)}else{let o=0,r=!1;for(;o++<10&&this.state.pos<this.length&&!(r=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(r){let c=this.input.slice(e,this.state.pos),d=YW[c];if(++this.state.pos,d)return d}}return this.state.pos=e,"&"}jsxReadWord(){let e,o=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(Ne(e)||e===45);this.finishToken(141,this.input.slice(o,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(141)?e.name=this.state.value:Dr(this.state.type)?e.name=Fe(this.state.type):this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")}jsxParseNamespacedName(){let e=this.state.startLoc,o=this.jsxParseIdentifier();if(!this.eat(14))return o;let r=this.startNodeAt(e);return r.namespace=o,r.name=this.jsxParseIdentifier(),this.finishNode(r,"JSXNamespacedName")}jsxParseElementName(){let e=this.state.startLoc,o=this.jsxParseNamespacedName();if(o.type==="JSXNamespacedName")return o;for(;this.eat(16);){let r=this.startNodeAt(e);r.object=o,r.property=this.jsxParseIdentifier(),o=this.finishNode(r,"JSXMemberExpression")}return o}jsxParseAttributeValue(){let e;switch(this.state.type){case 5:return e=this.startNode(),this.setContext(X.brace),this.next(),e=this.jsxParseExpressionContainer(e,X.j_oTag),e.expression.type==="JSXEmptyExpression"&&this.raise(je.AttributeIsEmpty,e),e;case 143:case 134:return this.parseExprAtom();default:throw this.raise(je.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext(X.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadChild")}jsxParseExpressionContainer(e,o){if(this.match(8))e.expression=this.jsxParseEmptyExpression();else{let r=this.parseExpression();e.expression=r}return this.setContext(o),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXExpressionContainer")}jsxParseAttribute(){let e=this.startNode();return this.match(5)?(this.setContext(X.brace),this.next(),this.expect(21),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(X.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsxParseNamespacedName(),e.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(e,"JSXAttribute"))}jsxParseOpeningElementAt(e){let o=this.startNodeAt(e);return this.eat(144)?this.finishNode(o,"JSXOpeningFragment"):(o.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(o))}jsxParseOpeningElementAfterName(e){let o=[];for(;!this.match(56)&&!this.match(144);)o.push(this.jsxParseAttribute());return e.attributes=o,e.selfClosing=this.eat(56),this.expect(144),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e){let o=this.startNodeAt(e);return this.eat(144)?this.finishNode(o,"JSXClosingFragment"):(o.name=this.jsxParseElementName(),this.expect(144),this.finishNode(o,"JSXClosingElement"))}jsxParseElementAt(e){let o=this.startNodeAt(e),r=[],c=this.jsxParseOpeningElementAt(e),d=null;if(!c.selfClosing){e:for(;;)switch(this.state.type){case 143:if(e=this.state.startLoc,this.next(),this.eat(56)){d=this.jsxParseClosingElementAt(e);break e}r.push(this.jsxParseElementAt(e));break;case 142:r.push(this.parseLiteral(this.state.value,"JSXText"));break;case 5:{let l=this.startNode();this.setContext(X.brace),this.next(),this.match(21)?r.push(this.jsxParseSpreadChild(l)):r.push(this.jsxParseExpressionContainer(l,X.j_expr));break}default:this.unexpected()}De(c)&&!De(d)&&d!==null?this.raise(je.MissingClosingTagFragment,d):!De(c)&&De(d)?this.raise(je.MissingClosingTagElement,d,{openingTagName:et(c.name)}):!De(c)&&!De(d)&&et(d.name)!==et(c.name)&&this.raise(je.MissingClosingTagElement,d,{openingTagName:et(c.name)})}if(De(c)?(o.openingFragment=c,o.closingFragment=d):(o.openingElement=c,o.closingElement=d),o.children=r,this.match(47))throw this.raise(je.UnwrappedAdjacentJSXElements,this.state.startLoc);return De(c)?this.finishNode(o,"JSXFragment"):this.finishNode(o,"JSXElement")}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:o}=this.state;o[o.length-1]=e}parseExprAtom(e){return this.match(143)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(143),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let o=this.curContext();if(o===X.j_expr){this.jsxReadToken();return}if(o===X.j_oTag||o===X.j_cTag){if(Pe(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(144);return}if((e===34||e===39)&&o===X.j_oTag){this.jsxReadString(e);return}}if(e===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(143);return}super.getTokenFromCode(e)}updateContext(e){let{context:o,type:r}=this.state;if(r===56&&e===143)o.splice(-2,2,X.j_cTag),this.state.canStartJSXElement=!1;else if(r===143)o.push(X.j_oTag);else if(r===144){let c=o[o.length-1];c===X.j_oTag&&e===56||c===X.j_cTag?(o.pop(),this.state.canStartJSXElement=o[o.length-1]===X.j_expr):(this.setContext(X.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=vW(r)}},lr=class extends wt{constructor(...t){super(...t),this.tsNames=new Map}},ur=class extends Ct{constructor(...t){super(...t),this.importsStack=[]}createScope(t){return this.importsStack.push(new Set),new lr(t)}enter(t){t===1024&&this.importsStack.push(new Set),super.enter(t)}exit(){let t=super.exit();return t===1024&&this.importsStack.pop(),t}hasImport(t,e){let o=this.importsStack.length;if(this.importsStack[o-1].has(t))return!0;if(!e&&o>1){for(let r=0;r<o-1;r++)if(this.importsStack[r].has(t))return!0}return!1}declareName(t,e,o){if(e&4096){this.hasImport(t,!0)&&this.parser.raise(w.VarRedeclaration,o,{identifierName:t}),this.importsStack[this.importsStack.length-1].add(t);return}let r=this.currentScope(),c=r.tsNames.get(t)||0;if(e&1024){this.maybeExportDefined(r,t),r.tsNames.set(t,c|16);return}super.declareName(t,e,o),e&2&&(e&1||(this.checkRedeclarationInScope(r,t,e,o),this.maybeExportDefined(r,t)),c=c|1),e&256&&(c=c|2),e&512&&(c=c|4),e&128&&(c=c|8),c&&r.tsNames.set(t,c)}isRedeclaredInScope(t,e,o){let r=t.tsNames.get(e);if((r&2)>0){if(o&256){let c=!!(o&512),d=(r&4)>0;return c!==d}return!0}return o&128&&(r&8)>0?t.names.get(e)&2?!!(o&1):!1:o&2&&(r&1)>0?!0:super.isRedeclaredInScope(t,e,o)}checkLocalExport(t){let{name:e}=t;if(this.hasImport(e))return;let o=this.scopeStack.length;for(let r=o-1;r>=0;r--){let d=this.scopeStack[r].tsNames.get(e);if((d&1)>0||(d&16)>0)return}super.checkLocalExport(t)}},mr=class{constructor(){this.stacks=[]}enter(t){this.stacks.push(t)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function ao(n,t){return(n?2:0)|(t?1:0)}var hr=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(t){return t+this.startIndex}offsetToSourcePos(t){return t-this.startIndex}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{let[e,o]=t;if(!this.hasPlugin(e))return!1;let r=this.plugins.get(e);for(let c of Object.keys(o))if(r?.[c]!==o[c])return!1;return!0}}getPluginOption(t,e){var o;return(o=this.plugins.get(t))==null?void 0:o[e]}};function za(n,t){n.trailingComments===void 0?n.trailingComments=t:n.trailingComments.unshift(...t)}function oG(n,t){n.leadingComments===void 0?n.leadingComments=t:n.leadingComments.unshift(...t)}function Mt(n,t){n.innerComments===void 0?n.innerComments=t:n.innerComments.unshift(...t)}function Se(n,t,e){let o=null,r=t.length;for(;o===null&&r>0;)o=t[--r];o===null||o.start>e.start?Mt(n,e.comments):za(o,e.comments)}var fr=class extends hr{addComment(t){this.filename&&(t.loc.filename=this.filename);let{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(t),this.state.commentsLen++}processComment(t){let{commentStack:e}=this.state,o=e.length;if(o===0)return;let r=o-1,c=e[r];c.start===t.end&&(c.leadingNode=t,r--);let{start:d}=t;for(;r>=0;r--){let l=e[r],m=l.end;if(m>d)l.containingNode=t,this.finalizeComment(l),e.splice(r,1);else{m===d&&(l.trailingNode=t);break}}}finalizeComment(t){var e;let{comments:o}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&za(t.leadingNode,o),t.trailingNode!==null&&oG(t.trailingNode,o);else{let r=t.containingNode,c=t.start;if(this.input.charCodeAt(this.offsetToSourcePos(c)-1)===44)switch(r.type){case"ObjectExpression":case"ObjectPattern":Se(r,r.properties,t);break;case"CallExpression":case"NewExpression":case"OptionalCallExpression":Se(r,r.arguments,t);break;case"ImportExpression":Se(r,[r.source,(e=r.options)!=null?e:null],t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":case"TSTypeParameterDeclaration":Se(r,r.params,t);break;case"ArrayExpression":case"ArrayPattern":Se(r,r.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":Se(r,r.specifiers,t);break;case"TSEnumDeclaration":Se(r,r.members,t);break;case"TSEnumBody":Se(r,r.members,t);break;case"TSInterfaceBody":Se(r,r.body,t);break;default:{if(r.type==="RecordExpression"){Se(r,r.properties,t);break}if(r.type==="TupleExpression"){Se(r,r.elements,t);break}Mt(r,o)}}else Mt(r,o)}}finalizeRemainingComments(){let{commentStack:t}=this.state;for(let e=t.length-1;e>=0;e--)this.finalizeComment(t[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){let{commentStack:e}=this.state,{length:o}=e;if(o===0)return;let r=e[o-1];r.leadingNode===t&&(r.leadingNode=null)}takeSurroundingComments(t,e,o){let{commentStack:r}=this.state,c=r.length;if(c===0)return;let d=c-1;for(;d>=0;d--){let l=r[d],m=l.end;if(l.start===o)l.leadingNode=t;else if(m===e)l.trailingNode=t;else if(m<e)break}}},xr=class n{constructor(){this.flags=1024,this.startIndex=void 0,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=140,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[X.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(t){t?this.flags|=1:this.flags&=-2}init({strictMode:t,sourceType:e,startIndex:o,startLine:r,startColumn:c}){this.strict=t===!1?!1:t===!0?!0:e==="module",this.startIndex=o,this.curLine=r,this.lineStart=-c,this.startLoc=this.endLoc=new Ie(r,c,o)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(t){t?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(t){t?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(t){t?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(t){t?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(t){t?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(t){t?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(t){t?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(t){t?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(t){t?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(t){t?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(t){t?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(t){t?this.flags|=4096:this.flags&=-4097}curPosition(){return new Ie(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let t=new n;return t.flags=this.flags,t.startIndex=this.startIndex,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.potentialArrowAt=this.potentialArrowAt,t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.topicContext=this.topicContext,t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}},rG=function(t){return t>=48&&t<=57},ia={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},so={bin:n=>n===48||n===49,oct:n=>n>=48&&n<=55,dec:n=>n>=48&&n<=57,hex:n=>n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102};function aa(n,t,e,o,r,c){let d=e,l=o,m=r,f="",g=null,b=e,{length:C}=t;for(;;){if(e>=C){c.unterminated(d,l,m),f+=t.slice(b,e);break}let T=t.charCodeAt(e);if(sG(n,T,t,e)){f+=t.slice(b,e);break}if(T===92){f+=t.slice(b,e);let E=nG(t,e,o,r,n==="template",c);E.ch===null&&!g?g={pos:e,lineStart:o,curLine:r}:f+=E.ch,{pos:e,lineStart:o,curLine:r}=E,b=e}else T===8232||T===8233?(++e,++r,o=e):T===10||T===13?n==="template"?(f+=t.slice(b,e)+`
7
- `,++e,T===13&&t.charCodeAt(e)===10&&++e,++r,b=o=e):c.unterminated(d,l,m):++e}return{pos:e,str:f,firstInvalidLoc:g,lineStart:o,curLine:r,containsInvalid:!!g}}function sG(n,t,e,o){return n==="template"?t===96||t===36&&e.charCodeAt(o+1)===123:t===(n==="double"?34:39)}function nG(n,t,e,o,r,c){let d=!r;t++;let l=f=>({pos:t,ch:f,lineStart:e,curLine:o}),m=n.charCodeAt(t++);switch(m){case 110:return l(`
8
- `);case 114:return l("\r");case 120:{let f;return{code:f,pos:t}=gr(n,t,e,o,2,!1,d,c),l(f===null?null:String.fromCharCode(f))}case 117:{let f;return{code:f,pos:t}=Ca(n,t,e,o,d,c),l(f===null?null:String.fromCodePoint(f))}case 116:return l(" ");case 98:return l("\b");case 118:return l("\v");case 102:return l("\f");case 13:n.charCodeAt(t)===10&&++t;case 10:e=t,++o;case 8232:case 8233:return l("");case 56:case 57:if(r)return l(null);c.strictNumericEscape(t-1,e,o);default:if(m>=48&&m<=55){let f=t-1,b=/^[0-7]+/.exec(n.slice(f,t+2))[0],C=parseInt(b,8);C>255&&(b=b.slice(0,-1),C=parseInt(b,8)),t+=b.length-1;let T=n.charCodeAt(t);if(b!=="0"||T===56||T===57){if(r)return l(null);c.strictNumericEscape(f,e,o)}return l(String.fromCharCode(C))}return l(String.fromCharCode(m))}}function gr(n,t,e,o,r,c,d,l){let m=t,f;return{n:f,pos:t}=wa(n,t,e,o,16,r,c,!1,l,!d),f===null&&(d?l.invalidEscapeSequence(m,e,o):t=m-1),{code:f,pos:t}}function wa(n,t,e,o,r,c,d,l,m,f){let g=t,b=r===16?ia.hex:ia.decBinOct,C=r===16?so.hex:r===10?so.dec:r===8?so.oct:so.bin,T=!1,E=0;for(let k=0,q=c??1/0;k<q;++k){let _=n.charCodeAt(t),U;if(_===95&&l!=="bail"){let me=n.charCodeAt(t-1),he=n.charCodeAt(t+1);if(l){if(Number.isNaN(he)||!C(he)||b.has(me)||b.has(he)){if(f)return{n:null,pos:t};m.unexpectedNumericSeparator(t,e,o)}}else{if(f)return{n:null,pos:t};m.numericSeparatorInEscapeSequence(t,e,o)}++t;continue}if(_>=97?U=_-97+10:_>=65?U=_-65+10:rG(_)?U=_-48:U=1/0,U>=r){if(U<=9&&f)return{n:null,pos:t};if(U<=9&&m.invalidDigit(t,e,o,r))U=0;else if(d)U=0,T=!0;else break}++t,E=E*r+U}return t===g||c!=null&&t-g!==c||T?{n:null,pos:t}:{n:E,pos:t}}function Ca(n,t,e,o,r,c){let d=n.charCodeAt(t),l;if(d===123){if(++t,{code:l,pos:t}=gr(n,t,e,o,n.indexOf("}",t)-t,!0,r,c),++t,l!==null&&l>1114111)if(r)c.invalidCodePoint(t,e,o);else return{code:null,pos:t}}else({code:l,pos:t}=gr(n,t,e,o,4,!1,r,c));return{code:l,pos:t}}function yt(n,t,e){return new Ie(e,n-t,n)}var iG=new Set([103,109,115,105,121,117,100,118]),ve=class{constructor(t){let e=t.startIndex||0;this.type=t.type,this.value=t.value,this.start=e+t.start,this.end=e+t.end,this.loc=new rt(t.startLoc,t.endLoc)}},yr=class extends fr{constructor(t,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(o,r,c,d)=>this.optionFlags&2048?(this.raise(w.InvalidDigit,yt(o,r,c),{radix:d}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(w.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(w.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(w.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(w.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(o,r,c)=>{this.recordStrictModeErrors(w.StrictNumericEscape,yt(o,r,c))},unterminated:(o,r,c)=>{throw this.raise(w.UnterminatedString,yt(o-1,r,c))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(w.StrictNumericEscape),unterminated:(o,r,c)=>{throw this.raise(w.UnterminatedTemplate,yt(o,r,c))}}),this.state=new xr,this.state.init(t),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(t){this.tokens.length=this.state.tokensLength,this.tokens.push(t),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&256&&this.pushToken(new ve(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(t){return this.match(t)?(this.next(),!0):!1}match(t){return this.state.type===t}createLookaheadState(t){return{pos:t.pos,value:null,type:t.type,start:t.start,end:t.end,context:[this.curContext()],inType:t.inType,startLoc:t.startLoc,lastTokEndLoc:t.lastTokEndLoc,curLine:t.curLine,lineStart:t.lineStart,curPosition:t.curPosition}}lookahead(){let t=this.state;this.state=this.createLookaheadState(t),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=t,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(t){return rr.lastIndex=t,rr.test(this.input)?rr.lastIndex:t}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(t){return this.input.charCodeAt(this.nextTokenStartSince(t))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return sr.lastIndex=t,sr.test(this.input)?sr.lastIndex:t}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(t){let e=this.input.charCodeAt(t);if((e&64512)===55296&&++t<this.input.length){let o=this.input.charCodeAt(t);(o&64512)===56320&&(e=65536+((e&1023)<<10)+(o&1023))}return e}setStrict(t){this.state.strict=t,t&&(this.state.strictErrors.forEach(([e,o])=>this.raise(e,o)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(140);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(t){let e;this.isLookahead||(e=this.state.curPosition());let o=this.state.pos,r=this.input.indexOf(t,o+2);if(r===-1)throw this.raise(w.UnterminatedComment,this.state.curPosition());for(this.state.pos=r+t.length,ro.lastIndex=o+2;ro.test(this.input)&&ro.lastIndex<=r;)++this.state.curLine,this.state.lineStart=ro.lastIndex;if(this.isLookahead)return;let c={type:"CommentBlock",value:this.input.slice(o+2,r),start:this.sourceToOffsetPos(o),end:this.sourceToOffsetPos(r+t.length),loc:new rt(e,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(c),c}skipLineComment(t){let e=this.state.pos,o;this.isLookahead||(o=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=t);if(this.state.pos<this.length)for(;!tt(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let c=this.state.pos,l={type:"CommentLine",value:this.input.slice(e+t,c),start:this.sourceToOffsetPos(e),end:this.sourceToOffsetPos(c),loc:new rt(o,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(l),l}skipSpace(){let t=this.state.pos,e=this.optionFlags&4096?[]:null;e:for(;this.state.pos<this.length;){let o=this.input.charCodeAt(this.state.pos);switch(o){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let r=this.skipBlockComment("*/");r!==void 0&&(this.addComment(r),e?.push(r));break}case 47:{let r=this.skipLineComment(2);r!==void 0&&(this.addComment(r),e?.push(r));break}default:break e}break;default:if(eG(o))++this.state.pos;else if(o===45&&!this.inModule&&this.optionFlags&8192){let r=this.state.pos;if(this.input.charCodeAt(r+1)===45&&this.input.charCodeAt(r+2)===62&&(t===0||this.state.lineStart>t)){let c=this.skipLineComment(3);c!==void 0&&(this.addComment(c),e?.push(c))}else break e}else if(o===60&&!this.inModule&&this.optionFlags&8192){let r=this.state.pos;if(this.input.charCodeAt(r+1)===33&&this.input.charCodeAt(r+2)===45&&this.input.charCodeAt(r+3)===45){let c=this.skipLineComment(4);c!==void 0&&(this.addComment(c),e?.push(c))}else break e}else break e}}if(e?.length>0){let o=this.state.pos,r={start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(o),comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(t,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let o=this.state.type;this.state.type=t,this.state.value=e,this.isLookahead||this.updateContext(o)}replaceToken(t){this.state.type=t,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let t=this.state.pos+1,e=this.codePointAtPos(t);if(e>=48&&e<=57)throw this.raise(w.UnexpectedDigitAfterHash,this.state.curPosition());if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?w.RecordExpressionHashIncorrectStartSyntaxType:w.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else Pe(e)?(++this.state.pos,this.finishToken(139,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(139,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let t=this.input.charCodeAt(this.state.pos+1);if(t>=48&&t<=57){this.readNumber(!0);return}t===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let t=this.input.charCodeAt(this.state.pos+1);if(t!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!tt(t)&&++this.state.pos<this.length;)t=this.input.charCodeAt(this.state.pos);let o=this.input.slice(e+2,this.state.pos);return this.finishToken(28,o),!0}readToken_mult_modulo(t){let e=t===42?55:54,o=1,r=this.input.charCodeAt(this.state.pos+1);t===42&&r===42&&(o++,r=this.input.charCodeAt(this.state.pos+2),e=57),r===61&&!this.state.inType&&(o++,e=t===37?33:30),this.finishOp(e,o)}readToken_pipe_amp(t){let e=this.input.charCodeAt(this.state.pos+1);if(e===t){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(30,3):this.finishOp(t===124?41:42,2);return}if(t===124){if(e===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&e===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(w.RecordExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&e===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(w.TupleExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(4);return}}if(e===61){this.finishOp(30,2);return}this.finishOp(t===124?43:45,1)}readToken_caret(){let t=this.input.charCodeAt(this.state.pos+1);t===61&&!this.state.inType?this.finishOp(32,2):t===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])?(this.finishOp(37,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(44,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}])?this.finishOp(38,2):this.finishOp(26,1)}readToken_plus_min(t){let e=this.input.charCodeAt(this.state.pos+1);if(e===t){this.finishOp(34,2);return}e===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){let{pos:t}=this.state,e=this.input.charCodeAt(t+1);if(e===60){if(this.input.charCodeAt(t+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(e===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){let{pos:t}=this.state,e=this.input.charCodeAt(t+1);if(e===62){let o=this.input.charCodeAt(t+2)===62?3:2;if(this.input.charCodeAt(t+o)===61){this.finishOp(30,o+1);return}this.finishOp(52,o);return}if(e===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(t){let e=this.input.charCodeAt(this.state.pos+1);if(e===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(t===61&&e===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(t===61?29:35,1)}readToken_question(){let t=this.input.charCodeAt(this.state.pos+1),e=this.input.charCodeAt(this.state.pos+2);t===63?e===61?this.finishOp(30,3):this.finishOp(40,2):t===46&&!(e>=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(t){switch(t){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(w.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(w.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(t);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(t);return;case 124:case 38:this.readToken_pipe_amp(t);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(t);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(t);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(Pe(t)){this.readWord(t);return}}throw this.raise(w.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(t)})}finishOp(t,e){let o=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(t,o)}readRegexp(){let t=this.state.startLoc,e=this.state.start+1,o,r,{pos:c}=this.state;for(;;++c){if(c>=this.length)throw this.raise(w.UnterminatedRegExp,ue(t,1));let f=this.input.charCodeAt(c);if(tt(f))throw this.raise(w.UnterminatedRegExp,ue(t,1));if(o)o=!1;else{if(f===91)r=!0;else if(f===93&&r)r=!1;else if(f===47&&!r)break;o=f===92}}let d=this.input.slice(e,c);++c;let l="",m=()=>ue(t,c+2-e);for(;c<this.length;){let f=this.codePointAtPos(c),g=String.fromCharCode(f);if(iG.has(f))f===118?l.includes("u")&&this.raise(w.IncompatibleRegExpUVFlags,m()):f===117&&l.includes("v")&&this.raise(w.IncompatibleRegExpUVFlags,m()),l.includes(g)&&this.raise(w.DuplicateRegExpFlags,m());else if(Ne(f)||f===92)this.raise(w.MalformedRegExpFlags,m());else break;++c,l+=g}this.state.pos=c,this.finishToken(138,{pattern:d,flags:l})}readInt(t,e,o=!1,r=!0){let{n:c,pos:d}=wa(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,e,o,r,this.errorHandlers_readInt,!1);return this.state.pos=d,c}readRadixNumber(t){let e=this.state.pos,o=this.state.curPosition(),r=!1;this.state.pos+=2;let c=this.readInt(t);c==null&&this.raise(w.InvalidDigit,ue(o,2),{radix:t});let d=this.input.charCodeAt(this.state.pos);if(d===110)++this.state.pos,r=!0;else if(d===109)throw this.raise(w.InvalidDecimal,o);if(Pe(this.codePointAtPos(this.state.pos)))throw this.raise(w.NumberIdentifier,this.state.curPosition());if(r){let l=this.input.slice(e,this.state.pos).replace(/[_n]/g,"");this.finishToken(136,l);return}this.finishToken(135,c)}readNumber(t){let e=this.state.pos,o=this.state.curPosition(),r=!1,c=!1,d=!1,l=!1;!t&&this.readInt(10)===null&&this.raise(w.InvalidNumber,this.state.curPosition());let m=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(m){let T=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(w.StrictOctalLiteral,o),!this.state.strict){let E=T.indexOf("_");E>0&&this.raise(w.ZeroDigitNumericSeparator,ue(o,E))}l=m&&!/[89]/.test(T)}let f=this.input.charCodeAt(this.state.pos);if(f===46&&!l&&(++this.state.pos,this.readInt(10),r=!0,f=this.input.charCodeAt(this.state.pos)),(f===69||f===101)&&!l&&(f=this.input.charCodeAt(++this.state.pos),(f===43||f===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(w.InvalidOrMissingExponent,o),r=!0,d=!0,f=this.input.charCodeAt(this.state.pos)),f===110&&((r||m)&&this.raise(w.InvalidBigIntLiteral,o),++this.state.pos,c=!0),f===109){this.expectPlugin("decimal",this.state.curPosition()),(d||m)&&this.raise(w.InvalidDecimal,o),++this.state.pos;var g=!0}if(Pe(this.codePointAtPos(this.state.pos)))throw this.raise(w.NumberIdentifier,this.state.curPosition());let b=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(c){this.finishToken(136,b);return}if(g){this.finishToken(137,b);return}let C=l?parseInt(b,8):parseFloat(b);this.finishToken(135,C)}readCodePoint(t){let{code:e,pos:o}=Ca(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,this.errorHandlers_readCodePoint);return this.state.pos=o,e}readString(t){let{str:e,pos:o,curLine:r,lineStart:c}=aa(t===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=o+1,this.state.lineStart=c,this.state.curLine=r,this.finishToken(134,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let t=this.input[this.state.pos],{str:e,firstInvalidLoc:o,pos:r,curLine:c,lineStart:d}=aa("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=r+1,this.state.lineStart=d,this.state.curLine=c,o&&(this.state.firstInvalidTemplateEscapePos=new Ie(o.curLine,o.pos-o.lineStart,this.sourceToOffsetPos(o.pos))),this.input.codePointAt(r)===96?this.finishToken(24,o?null:t+e+"`"):(this.state.pos++,this.finishToken(25,o?null:t+e+"${"))}recordStrictModeErrors(t,e){let o=e.index;this.state.strict&&!this.state.strictErrors.has(o)?this.raise(t,e):this.state.strictErrors.set(o,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="",o=this.state.pos,r=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos<this.length;){let c=this.codePointAtPos(this.state.pos);if(Ne(c))this.state.pos+=c<=65535?1:2;else if(c===92){this.state.containsEsc=!0,e+=this.input.slice(r,this.state.pos);let d=this.state.curPosition(),l=this.state.pos===o?Pe:Ne;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(w.MissingUnicodeEscape,this.state.curPosition()),r=this.state.pos-1;continue}++this.state.pos;let m=this.readCodePoint(!0);m!==null&&(l(m)||this.raise(w.EscapedCharNotAnIdentifier,d),e+=String.fromCodePoint(m)),r=this.state.pos}else break}return e+this.input.slice(r,this.state.pos)}readWord(t){let e=this.readWord1(t),o=Ir.get(e);o!==void 0?this.finishToken(o,Fe(o)):this.finishToken(132,e)}checkKeywordEscapes(){let{type:t}=this.state;Dr(t)&&this.state.containsEsc&&this.raise(w.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:Fe(t)})}raise(t,e,o={}){let r=e instanceof Ie?e:e.loc.start,c=t(r,o);if(!(this.optionFlags&2048))throw c;return this.isLookahead||this.state.errors.push(c),c}raiseOverwrite(t,e,o={}){let r=e instanceof Ie?e:e.loc.start,c=r.index,d=this.state.errors;for(let l=d.length-1;l>=0;l--){let m=d[l];if(m.loc.index===c)return d[l]=t(r,o);if(m.loc.index<c)break}return this.raise(t,e,o)}updateContext(t){}unexpected(t,e){throw this.raise(w.UnexpectedToken,t??this.state.startLoc,{expected:e?Fe(e):null})}expectPlugin(t,e){if(this.hasPlugin(t))return!0;throw this.raise(w.MissingPlugin,e??this.state.startLoc,{missingPlugin:[t]})}expectOnePlugin(t){if(!t.some(e=>this.hasPlugin(e)))throw this.raise(w.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:t})}errorBuilder(t){return(e,o,r)=>{this.raise(t,yt(e,o,r))}}},br=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},Sr=class{constructor(t){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new br)}exit(){let t=this.stack.pop(),e=this.current();for(let[o,r]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(o)||e.undefinedPrivateNames.set(o,r):this.parser.raise(w.InvalidPrivateFieldResolution,r,{identifierName:o})}declarePrivateName(t,e,o){let{privateNames:r,loneAccessors:c,undefinedPrivateNames:d}=this.current(),l=r.has(t);if(e&3){let m=l&&c.get(t);if(m){let f=m&4,g=e&4,b=m&3,C=e&3;l=b===C||f!==g,l||c.delete(t)}else l||c.set(t,e)}l&&this.parser.raise(w.PrivateNameRedeclaration,o,{identifierName:t}),r.add(t),d.delete(t)}usePrivateName(t,e){let o;for(o of this.stack)if(o.privateNames.has(t))return;o?o.undefinedPrivateNames.set(t,e):this.parser.raise(w.InvalidPrivateFieldResolution,e,{identifierName:t})}},st=class{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},lo=class extends st{constructor(t){super(t),this.declarationErrors=new Map}recordDeclarationError(t,e){let o=e.index;this.declarationErrors.set(o,[t,e])}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}},zr=class{constructor(t){this.parser=void 0,this.stack=[new st],this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,e){let o=e.loc.start,{stack:r}=this,c=r.length-1,d=r[c];for(;!d.isCertainlyParameterDeclaration();){if(d.canBeArrowParameterDeclaration())d.recordDeclarationError(t,o);else return;d=r[--c]}this.parser.raise(t,o)}recordArrowParameterBindingError(t,e){let{stack:o}=this,r=o[o.length-1],c=e.loc.start;if(r.isCertainlyParameterDeclaration())this.parser.raise(t,c);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(t,c);else return}recordAsyncArrowParametersError(t){let{stack:e}=this,o=e.length-1,r=e[o];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(w.AwaitBindingIdentifier,t),r=e[--o]}validateAsPattern(){let{stack:t}=this,e=t[t.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([o,r])=>{this.parser.raise(o,r);let c=t.length-2,d=t[c];for(;d.canBeArrowParameterDeclaration();)d.clearDeclarationError(r.index),d=t[--c]})}};function aG(){return new st(3)}function cG(){return new lo(1)}function pG(){return new lo(2)}function Ma(){return new st}var wr=class extends yr{addExtra(t,e,o,r=!0){if(!t)return;let{extra:c}=t;c==null&&(c={},t.extra=c),r?c[e]=o:Object.defineProperty(c,e,{enumerable:r,value:o})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,e){if(this.input.startsWith(e,t)){let o=this.input.charCodeAt(t+e.length);return!(Ne(o)||(o&64512)===55296)}return!1}isLookaheadContextual(t){let e=this.nextTokenStart();return this.isUnparsedContextual(e,t)}eatContextual(t){return this.isContextual(t)?(this.next(),!0):!1}expectContextual(t,e){if(!this.eatContextual(t)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,t)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return na(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return na(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(w.MissingSemicolon,this.state.lastTokEndLoc)}expect(t,e){this.eat(t)||this.unexpected(e,t)}tryParse(t,e=this.state.clone()){let o={node:null};try{let r=t((c=null)=>{throw o.node=c,o});if(this.state.errors.length>e.errors.length){let c=this.state;return this.state=e,this.state.tokensLength=c.tokensLength,{node:r,error:c.errors[e.errors.length],thrown:!1,aborted:!1,failState:c}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(r){let c=this.state;if(this.state=e,r instanceof SyntaxError)return{node:null,error:r,thrown:!0,aborted:!1,failState:c};if(r===o)return{node:o.node,error:null,thrown:!1,aborted:!0,failState:c};throw r}}checkExpressionErrors(t,e){if(!t)return!1;let{shorthandAssignLoc:o,doubleProtoLoc:r,privateKeyLoc:c,optionalParametersLoc:d,voidPatternLoc:l}=t,m=!!o||!!r||!!d||!!c||!!l;if(!e)return m;o!=null&&this.raise(w.InvalidCoverInitializedName,o),r!=null&&this.raise(w.DuplicateProto,r),c!=null&&this.raise(w.UnexpectedPrivateField,c),d!=null&&this.unexpected(d),l!=null&&this.raise(w.InvalidCoverDiscardElement,l)}isLiteralPropertyName(){return ha(this.state.type)}isPrivateName(t){return t.type==="PrivateName"}getPrivateNameSV(t){return t.id.name}hasPropertyAsPrivateName(t){return(t.type==="MemberExpression"||t.type==="OptionalMemberExpression")&&this.isPrivateName(t.property)}isObjectProperty(t){return t.type==="ObjectProperty"}isObjectMethod(t){return t.type==="ObjectMethod"}initializeScopes(t=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let o=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=t;let c=this.scope,d=this.getScopeHandler();this.scope=new d(this,t);let l=this.prodParam;this.prodParam=new mr;let m=this.classScope;this.classScope=new Sr(this);let f=this.expressionScope;return this.expressionScope=new zr(this),()=>{this.state.labels=e,this.exportedIdentifiers=o,this.inModule=r,this.scope=c,this.prodParam=l,this.classScope=m,this.expressionScope=f}}enterInitialScopes(){let t=0;(this.inModule||this.optionFlags&1)&&(t|=2),this.optionFlags&32&&(t|=1);let e=!this.inModule&&this.options.sourceType==="commonjs";(e||this.optionFlags&2)&&(t|=4),this.prodParam.enter(t);let o=e?514:1;this.optionFlags&4&&(o|=512),this.scope.enter(o)}checkDestructuringPrivate(t){let{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}},ot=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null,this.voidPatternLoc=null}},nt=class{constructor(t,e,o){this.type="",this.start=e,this.end=0,this.loc=new rt(o),t?.optionFlags&128&&(this.range=[e,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}},Cr=nt.prototype;Cr.__clone=function(){let n=new nt(void 0,this.start,this.loc.start),t=Object.keys(this);for(let e=0,o=t.length;e<o;e++){let r=t[e];r!=="leadingComments"&&r!=="trailingComments"&&r!=="innerComments"&&(n[r]=this[r])}return n};var Mr=class extends wr{startNode(){let t=this.state.startLoc;return new nt(this,t.index,t)}startNodeAt(t){return new nt(this,t.index,t)}startNodeAtNode(t){return this.startNodeAt(t.loc.start)}finishNode(t,e){return this.finishNodeAt(t,e,this.state.lastTokEndLoc)}finishNodeAt(t,e,o){return t.type=e,t.end=o.index,t.loc.end=o,this.optionFlags&128&&(t.range[1]=o.index),this.optionFlags&4096&&this.processComment(t),t}resetStartLocation(t,e){t.start=e.index,t.loc.start=e,this.optionFlags&128&&(t.range[0]=e.index)}resetEndLocation(t,e=this.state.lastTokEndLoc){t.end=e.index,t.loc.end=e,this.optionFlags&128&&(t.range[1]=e.index)}resetStartLocationFromNode(t,e){this.resetStartLocation(t,e.loc.start)}castNodeTo(t,e){return t.type=e,t}cloneIdentifier(t){let{type:e,start:o,end:r,loc:c,range:d,name:l}=t,m=Object.create(Cr);return m.type=e,m.start=o,m.end=r,m.loc=c,m.range=d,m.name=l,t.extra&&(m.extra=t.extra),m}cloneStringLiteral(t){let{type:e,start:o,end:r,loc:c,range:d,extra:l}=t,m=Object.create(Cr);return m.type=e,m.start=o,m.end=r,m.loc=c,m.range=d,m.extra=l,m.value=t.value,m}},Tr=n=>n.type==="ParenthesizedExpression"?Tr(n.expression):n,Rr=class extends Mr{toAssignable(t,e=!1){var o,r;let c;switch((t.type==="ParenthesizedExpression"||(o=t.extra)!=null&&o.parenthesized)&&(c=Tr(t),e?c.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(w.InvalidParenthesizedAssignment,t):c.type!=="CallExpression"&&c.type!=="MemberExpression"&&!this.isOptionalMemberExpression(c)&&this.raise(w.InvalidParenthesizedAssignment,t):this.raise(w.InvalidParenthesizedAssignment,t)),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":break;case"ObjectExpression":this.castNodeTo(t,"ObjectPattern");for(let l=0,m=t.properties.length,f=m-1;l<m;l++){var d;let g=t.properties[l],b=l===f;this.toAssignableObjectExpressionProp(g,b,e),b&&g.type==="RestElement"&&(d=t.extra)!=null&&d.trailingCommaLoc&&this.raise(w.RestTrailingComma,t.extra.trailingCommaLoc)}break;case"ObjectProperty":{let{key:l,value:m}=t;this.isPrivateName(l)&&this.classScope.usePrivateName(this.getPrivateNameSV(l),l.loc.start),this.toAssignable(m,e);break}case"SpreadElement":throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");case"ArrayExpression":this.castNodeTo(t,"ArrayPattern"),this.toAssignableList(t.elements,(r=t.extra)==null?void 0:r.trailingCommaLoc,e);break;case"AssignmentExpression":t.operator!=="="&&this.raise(w.MissingEqInAssignment,t.left.loc.end),this.castNodeTo(t,"AssignmentPattern"),delete t.operator,t.left.type==="VoidPattern"&&this.raise(w.VoidPatternInitializer,t.left),this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(c,e);break}}toAssignableObjectExpressionProp(t,e,o){if(t.type==="ObjectMethod")this.raise(t.kind==="get"||t.kind==="set"?w.PatternHasAccessor:w.PatternHasMethod,t.key);else if(t.type==="SpreadElement"){this.castNodeTo(t,"RestElement");let r=t.argument;this.checkToRestConversion(r,!1),this.toAssignable(r,o),e||this.raise(w.RestTrailingComma,t)}else this.toAssignable(t,o)}toAssignableList(t,e,o){let r=t.length-1;for(let c=0;c<=r;c++){let d=t[c];d&&(this.toAssignableListItem(t,c,o),d.type==="RestElement"&&(c<r?this.raise(w.RestTrailingComma,d):e&&this.raise(w.RestTrailingComma,e)))}}toAssignableListItem(t,e,o){let r=t[e];if(r.type==="SpreadElement"){this.castNodeTo(r,"RestElement");let c=r.argument;this.checkToRestConversion(c,!0),this.toAssignable(c,o)}else this.toAssignable(r,o)}isAssignable(t,e){switch(t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":return!0;case"ObjectExpression":{let o=t.properties.length-1;return t.properties.every((r,c)=>r.type!=="ObjectMethod"&&(c===o||r.type!=="SpreadElement")&&this.isAssignable(r))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(o=>o===null||this.isAssignable(o));case"AssignmentExpression":return t.operator==="=";case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(t,e){return t}toReferencedListDeep(t,e){this.toReferencedList(t,e);for(let o of t)o?.type==="ArrayExpression"&&this.toReferencedListDeep(o.elements)}parseSpread(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(t,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let t=this.startNode();this.next();let e=this.parseBindingAtom();return e.type==="VoidPattern"&&this.raise(w.UnexpectedVoidPattern,e),t.argument=e,this.finishNode(t,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let t=this.startNode();return this.next(),t.elements=this.parseBindingList(3,93,1),this.finishNode(t,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0);case 88:return this.parseVoidPattern(null)}return this.parseIdentifier()}parseBindingList(t,e,o){let r=o&1,c=[],d=!0;for(;!this.eat(t);)if(d?d=!1:this.expect(12),r&&this.match(12))c.push(null);else{if(this.eat(t))break;if(this.match(21)){let l=this.parseRestBinding();if((this.hasPlugin("flow")||o&2)&&(l=this.parseFunctionParamType(l)),c.push(l),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{let l=[];if(o&2)for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(w.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)l.push(this.parseDecorator());c.push(this.parseBindingElement(o,l))}}return c}parseBindingRestProperty(t){return this.next(),this.hasPlugin("discardBinding")&&this.match(88)?(t.argument=this.parseVoidPattern(null),this.raise(w.UnexpectedVoidPattern,t.argument)):t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let{type:t,startLoc:e}=this.state;if(t===21)return this.parseBindingRestProperty(this.startNode());let o=this.startNode();return t===139?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),o.key=this.parsePrivateName()):this.parsePropertyName(o),o.method=!1,this.parseObjPropValue(o,e,!1,!1,!0,!1)}parseBindingElement(t,e){let o=this.parseMaybeDefault();return(this.hasPlugin("flow")||t&2)&&this.parseFunctionParamType(o),e.length&&(o.decorators=e,this.resetStartLocationFromNode(o,e[0])),this.parseMaybeDefault(o.loc.start,o)}parseFunctionParamType(t){return t}parseMaybeDefault(t,e){if(t??(t=this.state.startLoc),e=e??this.parseBindingAtom(),!this.eat(29))return e;let o=this.startNodeAt(t);return e.type==="VoidPattern"&&this.raise(w.VoidPatternInitializer,e),o.left=e,o.right=this.parseMaybeAssignAllowIn(),this.finishNode(o,"AssignmentPattern")}isValidLVal(t,e,o,r){switch(t){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties";case"VoidPattern":return!0;case"CallExpression":if(!e&&!this.state.strict&&this.optionFlags&8192)return!0}return!1}isOptionalMemberExpression(t){return t.type==="OptionalMemberExpression"}checkLVal(t,e,o=64,r=!1,c=!1,d=!1,l=!1){var m;let f=t.type;if(this.isObjectMethod(t))return;let g=this.isOptionalMemberExpression(t);if(g||f==="MemberExpression"){g&&(this.expectPlugin("optionalChainingAssign",t.loc.start),e.type!=="AssignmentExpression"&&this.raise(w.InvalidLhsOptionalChaining,t,{ancestor:e})),o!==64&&this.raise(w.InvalidPropertyBindingPattern,t);return}if(f==="Identifier"){this.checkIdentifier(t,o,c);let{name:_}=t;r&&(r.has(_)?this.raise(w.ParamDupe,t):r.add(_));return}else f==="VoidPattern"&&e.type==="CatchClause"&&this.raise(w.VoidPatternCatchClauseParam,t);let b=Tr(t);l||(l=b.type==="CallExpression"&&(b.callee.type==="Import"||b.callee.type==="Super"));let C=this.isValidLVal(f,l,!(d||(m=t.extra)!=null&&m.parenthesized)&&e.type==="AssignmentExpression",o);if(C===!0)return;if(C===!1){let _=o===64?w.InvalidLhs:w.InvalidLhsBinding;this.raise(_,t,{ancestor:e});return}let T,E;typeof C=="string"?(T=C,E=f==="ParenthesizedExpression"):[T,E]=C;let k=f==="ArrayPattern"||f==="ObjectPattern"?{type:f}:e,q=t[T];if(Array.isArray(q))for(let _ of q)_&&this.checkLVal(_,k,o,r,c,E,!0);else q&&this.checkLVal(q,k,o,r,c,E,l)}checkIdentifier(t,e,o=!1){this.state.strict&&(o?Sa(t.name,this.inModule):ba(t.name))&&(e===64?this.raise(w.StrictEvalArguments,t,{referenceName:t.name}):this.raise(w.StrictEvalArgumentsBinding,t,{bindingName:t.name})),e&8192&&t.name==="let"&&this.raise(w.LetInLexicalBinding,t),e&64||this.declareNameFromIdentifier(t,e)}declareNameFromIdentifier(t,e){this.scope.declareName(t.name,e,t.loc.start)}checkToRestConversion(t,e){switch(t.type){case"ParenthesizedExpression":this.checkToRestConversion(t.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(w.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?w.RestTrailingComma:w.ElementAfterRest,this.state.startLoc),!0):!1}},nr=/in(?:stanceof)?|as|satisfies/y;function dG(n){if(n==null)throw new Error(`Unexpected ${n} value.`);return n}function ca(n){if(!n)throw new Error("Assert fail")}var F=ze`typescript`({AbstractMethodHasImplementation:({methodName:n})=>`Method '${n}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:n})=>`Property '${n}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:n})=>`'declare' is not allowed in ${n}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:n})=>`Accessibility modifier already seen: '${n}'.`,DuplicateModifier:({modifier:n})=>`Duplicate modifier: '${n}'.`,EmptyHeritageClauseType:({token:n})=>`'${n}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:n})=>`'${n[0]}' modifier cannot be used with '${n[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:n})=>`Index signatures cannot have an accessibility modifier ('${n}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidHeritageClauseType:({token:n})=>`'${n}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:n=>`'${n}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:n})=>`'${n}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:n})=>`'${n}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:n})=>`'${n}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:n=>`'${n}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:n})=>`'${n[0]}' modifier must precede '${n[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifier:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:n})=>`Private elements cannot have an accessibility modifier ('${n}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:n})=>`Single type parameter ${n} should have a trailing comma. Example usage: <${n},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:n})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${n}.`,UsingDeclarationInAmbientContext:n=>`'${n}' declarations are not allowed in ambient contexts.`});function lG(n){switch(n){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function pa(n){return n==="private"||n==="public"||n==="protected"}function uG(n){return n==="in"||n==="out"}var mG=n=>class extends n{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:F.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:F.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:F.InvalidModifierOnTypeParameter})}getScopeHandler(){return ur}tsIsIdentifier(){return Z(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,o,r){if(!Z(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let c=this.state.value;if(e.includes(c)){if(r&&this.match(106)||o&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return c}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:o,stopOnStartOfClassStaticBlock:r,errorTemplate:c=F.InvalidModifierOnTypeMember},d){let l=(f,g,b,C)=>{g===b&&d[C]&&this.raise(F.InvalidModifiersOrder,f,{orderedModifiers:[b,C]})},m=(f,g,b,C)=>{(d[b]&&g===C||d[C]&&g===b)&&this.raise(F.IncompatibleModifiers,f,{modifiers:[b,C]})};for(;;){let{startLoc:f}=this.state,g=this.tsParseModifier(e.concat(o??[]),r,d.static);if(!g)break;pa(g)?d.accessibility?this.raise(F.DuplicateAccessibilityModifier,f,{modifier:g}):(l(f,g,g,"override"),l(f,g,g,"static"),l(f,g,g,"readonly"),d.accessibility=g):uG(g)?(d[g]&&this.raise(F.DuplicateModifier,f,{modifier:g}),d[g]=!0,l(f,g,"in","out")):(hasOwnProperty.call(d,g)?this.raise(F.DuplicateModifier,f,{modifier:g}):(l(f,g,"static","readonly"),l(f,g,"static","override"),l(f,g,"override","readonly"),l(f,g,"abstract","override"),m(f,g,"declare","override"),m(f,g,"static","abstract")),d[g]=!0),o!=null&&o.includes(g)&&this.raise(c,f,{modifier:g})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,o){let r=[];for(;!this.tsIsListTerminator(e);)r.push(o());return r}tsParseDelimitedList(e,o,r){return dG(this.tsParseDelimitedListWorker(e,o,!0,r))}tsParseDelimitedListWorker(e,o,r,c){let d=[],l=-1;for(;!this.tsIsListTerminator(e);){l=-1;let m=o();if(m==null)return;if(d.push(m),this.eat(12)){l=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;r&&this.expect(12);return}return c&&(c.value=l),d}tsParseBracketedList(e,o,r,c,d){c||(r?this.expect(0):this.expect(47));let l=this.tsParseDelimitedList(e,o,d);return r?this.expect(3):this.expect(48),l}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(134)?e.argument=this.parseStringLiteral(this.state.value):(this.raise(F.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom()),this.eat(12)?e.options=this.tsParseImportTypeOptions():e.options=null,this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName(3)),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseImportTypeOptions(){let e=this.startNode();this.expect(5);let o=this.startNode();return this.isContextual(76)?(o.method=!1,o.key=this.parseIdentifier(!0),o.computed=!1,o.shorthand=!1):this.unexpected(null,76),this.expect(14),o.value=this.tsParseImportTypeWithPropertyValue(),e.properties=[this.finishObjectProperty(o)],this.eat(12),this.expect(8),this.finishNode(e,"ObjectExpression")}tsParseImportTypeWithPropertyValue(){let e=this.startNode(),o=[];for(this.expect(5);!this.match(8);){let r=this.state.type;Z(r)||r===134?o.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(12)}return e.properties=o,this.next(),this.finishNode(e,"ObjectExpression")}tsParseEntityName(e){let o;if(e&1&&this.match(78))if(e&2)o=this.parseIdentifier(!0);else{let r=this.startNode();this.next(),o=this.finishNode(r,"ThisExpression")}else o=this.parseIdentifier(!!(e&1));for(;this.eat(16);){let r=this.startNodeAtNode(o);r.left=o,r.right=this.parseIdentifier(!!(e&1)),o=this.finishNode(r,"TSQualifiedName")}return o}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let o=this.startNodeAtNode(e);return o.parameterName=e,o.typeAnnotation=this.tsParseTypeAnnotation(!1),o.asserts=!1,this.finishNode(o,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(3),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){let o=this.startNode();return e(o),o.name=this.tsParseTypeParameterName(),o.constraint=this.tsEatThenParseType(81),o.default=this.tsEatThenParseType(29),this.finishNode(o,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let o=this.startNode();this.match(47)||this.match(143)?this.next():this.unexpected();let r={value:-1};return o.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,r),o.params.length===0&&this.raise(F.EmptyTypeParameters,o),r.value!==-1&&this.addExtra(o,"trailingComma",r.value),this.finishNode(o,"TSTypeParameterDeclaration")}tsFillSignature(e,o){let r=e===19,c="parameters",d="typeAnnotation";o.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),o[c]=this.tsParseBindingListForSignature(),r?o[d]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(o[d]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let o of e){let{type:r}=o;(r==="AssignmentPattern"||r==="TSParameterProperty")&&this.raise(F.UnsupportedSignatureParameterKind,o,{type:r})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,o){return this.tsFillSignature(14,o),this.tsParseTypeMemberSemicolon(),this.finishNode(o,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),Z(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let o=this.parseIdentifier();o.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(o),this.expect(3),e.parameters=[o];let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,o){if(this.eat(17)&&(e.optional=!0),this.match(10)||this.match(47)){o&&this.raise(F.ReadonlyForMethodSignature,e);let r=e;r.kind&&this.match(47)&&this.raise(F.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,r),this.tsParseTypeMemberSemicolon();let c="parameters",d="typeAnnotation";if(r.kind==="get")r[c].length>0&&(this.raise(w.BadGetterArity,this.state.curPosition()),this.isThisParam(r[c][0])&&this.raise(F.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(r.kind==="set"){if(r[c].length!==1)this.raise(w.BadSetterArity,this.state.curPosition());else{let l=r[c][0];this.isThisParam(l)&&this.raise(F.AccessorCannotDeclareThisParameter,this.state.curPosition()),l.type==="Identifier"&&l.optional&&this.raise(F.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),l.type==="RestElement"&&this.raise(F.SetAccessorCannotHaveRestParameter,this.state.curPosition())}r[d]&&this.raise(F.SetAccessorCannotHaveReturnType,r[d])}else r.kind="method";return this.finishNode(r,"TSMethodSignature")}else{let r=e;o&&(r.readonly=!0);let c=this.tsTryParseTypeAnnotation();return c&&(r.typeAnnotation=c),this.tsParseTypeMemberSemicolon(),this.finishNode(r,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let r=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(r,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);let o=this.tsTryParseIndexSignature(e);return o||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e),!this.match(10)&&!this.match(47)&&this.unexpected(null,10)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){let e=this.startNode();this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0);let o=this.startNode();return o.name=this.tsParseTypeParameterName(),o.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(o,"TSTypeParameter"),e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let o=!1;return e.elementTypes.forEach(r=>{let{type:c}=r;o&&c!=="TSRestType"&&c!=="TSOptionalType"&&!(c==="TSNamedTupleMember"&&r.optional)&&this.raise(F.OptionalTypeBeforeRequired,r),o||(o=c==="TSNamedTupleMember"&&r.optional||c==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let e=this.state.startLoc,o=this.eat(21),{startLoc:r}=this.state,c,d,l,m,g=we(this.state.type)?this.lookaheadCharCode():null;if(g===58)c=!0,l=!1,d=this.parseIdentifier(!0),this.expect(14),m=this.tsParseType();else if(g===63){l=!0;let b=this.state.value,C=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(c=!0,d=this.createIdentifier(this.startNodeAt(r),b),this.expect(17),this.expect(14),m=this.tsParseType()):(c=!1,m=C,this.expect(17))}else m=this.tsParseType(),l=this.eat(17),c=this.eat(14);if(c){let b;d?(b=this.startNodeAt(r),b.optional=l,b.label=d,b.elementType=m,this.eat(17)&&(b.optional=!0,this.raise(F.TupleOptionalAfterType,this.state.lastTokStartLoc))):(b=this.startNodeAt(r),b.optional=l,this.raise(F.InvalidTupleMemberLabel,m),b.label=m,b.elementType=this.tsParseType()),m=this.finishNode(b,"TSNamedTupleMember")}else if(l){let b=this.startNodeAt(r);b.typeAnnotation=m,m=this.finishNode(b,"TSOptionalType")}if(o){let b=this.startNodeAt(e);b.typeAnnotation=m,m=this.finishNode(b,"TSRestType")}return m}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,o){let r=this.startNode();return e==="TSConstructorType"&&(r.abstract=!!o,o&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,r)),this.finishNode(r,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),o=this.lookahead();return o.type!==135&&o.type!==136&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(Z(e)||e===88||e===84){let o=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":lG(this.state.value);if(o!==void 0&&this.lookaheadCharCode()!==46){let r=this.startNode();return this.next(),this.finishNode(r,o)}return this.tsParseTypeReference()}}}throw this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,o=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let r=this.startNodeAt(e);r.elementType=o,this.expect(3),o=this.finishNode(r,"TSArrayType")}else{let r=this.startNodeAt(e);r.objectType=o,r.indexType=this.tsParseType(),this.expect(3),o=this.finishNode(r,"TSIndexedAccessType")}return o}tsParseTypeOperator(){let e=this.startNode(),o=this.state.value;return this.next(),e.operator=o,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),o==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(F.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let o=this.startNode();return o.name=this.tsParseTypeParameterName(),o.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(o,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return AW(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,o,r){let c=this.startNode(),d=this.eat(r),l=[];do l.push(o());while(this.eat(r));return l.length===1&&!d?l[0]:(c.types=l,this.finishNode(c,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(Z(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,o=e.length;try{return this.parseObjectLike(8,!0),e.length===o}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,o=e.length;try{return super.parseBindingList(3,93,1),e.length===o}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let o=this.startNode();this.expect(e);let r=this.startNode(),c=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(c&&this.match(78)){let m=this.tsParseThisTypeOrThisTypePredicate();return m.type==="TSThisType"?(r.parameterName=m,r.asserts=!0,r.typeAnnotation=null,m=this.finishNode(r,"TSTypePredicate")):(this.resetStartLocationFromNode(m,r),m.asserts=!0),o.typeAnnotation=m,this.finishNode(o,"TSTypeAnnotation")}let d=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!d)return c?(r.parameterName=this.parseIdentifier(),r.asserts=c,r.typeAnnotation=null,o.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(o,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,o);let l=this.tsParseTypeAnnotation(!1);return r.parameterName=d,r.typeAnnotation=l,r.asserts=c,o.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(o,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let e=this.state.containsEsc;return this.next(),!Z(this.state.type)&&!this.match(78)?!1:(e&&this.raise(w.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,o=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),o.typeAnnotation=this.tsParseType()}),this.finishNode(o,"TSTypeAnnotation")}tsParseType(){ca(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let o=this.startNodeAtNode(e);return o.checkType=e,o.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),o.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),o.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(o,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.isLookaheadContextual("new")}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(F.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let o=this.state.startLoc,r=this.tsParseDelimitedList("HeritageClauseElement",()=>{let c=this.startNode();return c.expression=this.tsParseEntityName(3),this.match(47)&&(c.typeParameters=this.tsParseTypeArguments()),this.finishNode(c,"TSExpressionWithTypeArguments")});return r.length||this.raise(F.EmptyHeritageClauseType,o,{token:e}),r}tsParseInterfaceDeclaration(e,o={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),o.declare&&(e.declare=!0),Z(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(F.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let r=this.startNode();return r.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(r,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookaheadCharCode()!==46){let o=this.startNode();return this.next(),this.finishNode(o,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInTopLevelContext(e){if(this.curContext()!==X.brace){let o=this.state.context;this.state.context=[o[0]];try{return e()}finally{this.state.context=o}}else return e()}tsInType(e){let o=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=o}}tsInDisallowConditionalTypesContext(e){let o=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=o}}tsInAllowConditionalTypesContext(e){let o=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=o}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,o={}){return o.const&&(e.const=!0),o.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseEnumBody(){let e=this.startNode();return this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumBody")}tsParseModuleBlock(){let e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,o=!1){if(e.id=this.parseIdentifier(),o||this.checkIdentifier(e.id,1024),this.eat(16)){let r=this.startNode();this.tsParseModuleOrNamespaceDeclaration(r,!0),e.body=r}else this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.kind="global",e.global=!0,e.id=this.parseIdentifier()):this.match(134)?(e.kind="module",e.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,o,r){e.isExport=r||!1,e.id=o||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let c=this.tsParseModuleReference();return e.importKind==="type"&&c.type!=="TSExternalModuleReference"&&this.raise(F.ImportAliasHasImportType,c),e.moduleReference=c,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let o=this.state.clone(),r=e();return this.state=o,r}tsTryParseAndCatch(e){let o=this.tryParse(r=>e()||r());if(!(o.aborted||!o.node))return o.error&&(this.state=o.failState),o.node}tsTryParse(e){let o=this.state.clone(),r=e();if(r!==void 0&&r!==!1)return r;this.state=o}tsTryParseDeclare(e){if(this.isLineTerminator())return;let o=this.state.type;return this.tsInAmbientContext(()=>{switch(o){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 100:if(this.state.containsEsc)return;case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 107:if(this.isUsing())return this.raise(F.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.parseVarStatement(e,"using",!0);break;case 96:if(this.isAwaitUsing())return this.raise(F.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.next(),this.parseVarStatement(e,"await using",!0);break;case 129:{let r=this.tsParseInterfaceDeclaration(e,{declare:!0});if(r)return r}default:if(Z(o))return this.tsParseDeclaration(e,this.state.type,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.type,!0,null)}tsParseDeclaration(e,o,r,c){switch(o){case 124:if(this.tsCheckLineTerminator(r)&&(this.match(80)||Z(this.state.type)))return this.tsParseAbstractDeclaration(e,c);break;case 127:if(this.tsCheckLineTerminator(r)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(e);if(Z(this.state.type))return e.kind="module",this.tsParseModuleOrNamespaceDeclaration(e)}break;case 128:if(this.tsCheckLineTerminator(r)&&Z(this.state.type))return e.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(e);break;case 130:if(this.tsCheckLineTerminator(r)&&Z(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;let o=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let r=this.tsTryParseAndCatch(()=>{let c=this.startNodeAt(e);return c.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(c),c.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),c});if(this.state.maybeInArrowParameters=o,!!r)return super.parseArrowExpression(r,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(F.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===X.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return LW(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseBindingElement(e,o){let r=o.length?o[0].loc.start:this.state.startLoc,c={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},c);let d=c.accessibility,l=c.override,m=c.readonly;!(e&4)&&(d||m||l)&&this.raise(F.UnexpectedParameterModifier,r);let f=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(f);let g=this.parseMaybeDefault(f.loc.start,f);if(d||m||l){let b=this.startNodeAt(r);return o.length&&(b.decorators=o),d&&(b.accessibility=d),m&&(b.readonly=m),l&&(b.override=l),g.type!=="Identifier"&&g.type!=="AssignmentPattern"&&this.raise(F.UnsupportedParameterPropertyKind,b),b.parameter=g,this.finishNode(b,"TSParameterProperty")}return o.length&&(f.decorators=o),g}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let o of e.params)o.type!=="Identifier"&&o.optional&&!this.state.isAmbientContext&&this.raise(F.PatternIsOptional,o)}setArrowFunctionParameters(e,o,r){super.setArrowFunctionParameters(e,o,r),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,o,r=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let c=o==="FunctionDeclaration"?"TSDeclareFunction":o==="ClassMethod"||o==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return c&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,c):c==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(F.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,c,r):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,o,r))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(o=>{o?.type==="TSTypeCastExpression"&&this.raise(F.UnexpectedTypeAnnotation,o.typeAnnotation)})}toReferencedList(e,o){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,o,r){let c=super.parseArrayLike(e,o,r);return c.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(c.elements),c}parseSubscript(e,o,r,c){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let l=this.startNodeAt(o);return l.expression=e,this.finishNode(l,"TSNonNullExpression")}let d=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(r)return c.stop=!0,e;c.optionalChainMember=d=!0,this.next()}if(this.match(47)||this.match(51)){let l,m=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsyncArrow(e)){let C=this.tsTryParseGenericAsyncArrowFunction(o);if(C)return c.stop=!0,C}let f=this.tsParseTypeArgumentsInExpression();if(!f)return;if(d&&!this.match(10)){l=this.state.curPosition();return}if(po(this.state.type)){let C=super.parseTaggedTemplateExpression(e,o,c);return C.typeParameters=f,C}if(!r&&this.eat(10)){let C=this.startNodeAt(o);return C.callee=e,C.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(C.arguments),C.typeParameters=f,c.optionalChainMember&&(C.optional=d),this.finishCallExpression(C,c.optionalChainMember)}let g=this.state.type;if(g===48||g===52||g!==10&&g!==93&&g!==120&&bt(g)&&!this.hasPrecedingLineBreak())return;let b=this.startNodeAt(o);return b.expression=e,b.typeParameters=f,this.finishNode(b,"TSInstantiationExpression")});if(l&&this.unexpected(l,10),m)return m.type==="TSInstantiationExpression"&&((this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(F.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(16)&&!this.match(18)&&(m.expression=super.stopParseSubscript(e,c))),m}return super.parseSubscript(e,o,r,c)}parseNewCallee(e){var o;super.parseNewCallee(e);let{callee:r}=e;r.type==="TSInstantiationExpression"&&!((o=r.extra)!=null&&o.parenthesized)&&(e.typeParameters=r.typeParameters,e.callee=r.expression)}parseExprOp(e,o,r){let c;if(io(58)>r&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(c=this.isContextual(120)))){let d=this.startNodeAt(o);return d.expression=e,d.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(c&&this.raise(w.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(d,c?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(d,o,r)}return super.parseExprOp(e,o,r)}checkReservedWord(e,o,r,c){this.state.isAmbientContext||super.checkReservedWord(e,o,r,c)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(F.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let o=this.lookaheadCharCode();return e?o===123||o===42:o!==61}return!e&&this.isContextual(87)}applyImportPhase(e,o,r,c){super.applyImportPhase(e,o,r,c),o?e.exportKind=r==="type"?"type":"value":e.importKind=r==="type"||r==="typeof"?r:"value"}parseImport(e){if(this.match(134))return e.importKind="value",super.parseImport(e);let o;if(Z(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let r=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,r);o=super.parseImportSpecifiersAndAfter(e,r)}else o=super.parseImport(e);return o.importKind==="type"&&o.specifiers.length>1&&o.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(F.TypeImportCannotSpecifyDefaultAndNamed,o),o}parseExport(e,o){if(this.match(83)){let r=e;this.next();let c=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?c=this.parseMaybeImportPhase(r,!1):r.importKind="value",this.tsParseImportEqualsDeclaration(r,c,!0)}else if(this.eat(29)){let r=e;return r.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(r,"TSExportAssignment")}else if(this.eatContextual(93)){let r=e;return this.expectContextual(128),r.id=this.parseIdentifier(),this.semicolon(),this.finishNode(r,"TSNamespaceExportDeclaration")}else return super.parseExport(e,o)}isAbstractClass(){return this.isContextual(124)&&this.isLookaheadContextual("class")}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,o,r=!1){let{isAmbientContext:c}=this.state,d=super.parseVarStatement(e,o,r||c);if(!c)return d;if(!e.declare&&(o==="using"||o==="await using"))return this.raiseOverwrite(F.UsingDeclarationInAmbientContext,e,o),d;for(let{id:l,init:m}of d.declarations)m&&(o==="var"||o==="let"||l.typeAnnotation?this.raise(F.InitializerNotAllowedInAmbientContext,m):fG(m,this.hasPlugin("estree"))||this.raise(F.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,m));return d}parseStatementContent(e,o){if(!this.state.containsEsc)switch(this.state.type){case 75:{if(this.isLookaheadContextual("enum")){let r=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(r,{const:!0})}break}case 124:case 125:{if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let r=this.state.type,c=this.startNode();this.next();let d=r===125?this.tsTryParseDeclare(c):this.tsParseAbstractDeclaration(c,o);return d?(r===125&&(d.declare=!0),d):(c.expression=this.createIdentifier(this.startNodeAt(c.loc.start),r===125?"declare":"abstract"),this.semicolon(!1),this.finishNode(c,"ExpressionStatement"))}break}case 126:return this.tsParseEnumDeclaration(this.startNode());case 112:{if(this.lookaheadCharCode()===123){let c=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(c)}break}case 129:{let r=this.tsParseInterfaceDeclaration(this.startNode());if(r)return r;break}case 127:{if(this.nextTokenIsIdentifierOrStringLiteralOnSameLine()){let r=this.startNode();return this.next(),this.tsParseDeclaration(r,127,!1,o)}break}case 128:{if(this.nextTokenIsIdentifierOnSameLine()){let r=this.startNode();return this.next(),this.tsParseDeclaration(r,128,!1,o)}break}case 130:{if(this.nextTokenIsIdentifierOnSameLine()){let r=this.startNode();return this.next(),this.tsParseTypeAliasDeclaration(r)}break}}return super.parseStatementContent(e,o)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,o){return o.some(r=>pa(r)?e.accessibility===r:!!e[r])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,o,r){let c=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:c,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:F.InvalidModifierOnTypeParameterPositions},o);let d=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(o,c)&&this.raise(F.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,o)):this.parseClassMemberWithIsStatic(e,o,r,!!o.static)};o.declare?this.tsInAmbientContext(d):d()}parseClassMemberWithIsStatic(e,o,r,c){let d=this.tsTryParseIndexSignature(o);if(d){e.body.push(d),o.abstract&&this.raise(F.IndexSignatureHasAbstract,o),o.accessibility&&this.raise(F.IndexSignatureHasAccessibility,o,{modifier:o.accessibility}),o.declare&&this.raise(F.IndexSignatureHasDeclare,o),o.override&&this.raise(F.IndexSignatureHasOverride,o);return}!this.state.inAbstractClass&&o.abstract&&this.raise(F.NonAbstractClassHasAbstractMethod,o),o.override&&(r.hadSuperClass||this.raise(F.OverrideNotInSubClass,o)),super.parseClassMemberWithIsStatic(e,o,r,c)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(F.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(F.ClassMethodHasDeclare,e)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,o,r){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let c=this.lookaheadCharCode();if(c===44||c===61||c===58||c===41)return this.setOptionalParametersError(r),e}return super.parseConditional(e,o,r)}parseParenItem(e,o){let r=super.parseParenItem(e,o);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){let c=this.startNodeAt(o);return c.expression=e,c.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(c,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let o=this.state.startLoc,r=this.eatContextual(125);if(r&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(F.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let d=Z(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return d?((d.type==="TSInterfaceDeclaration"||d.type==="TSTypeAliasDeclaration"||r)&&(e.exportKind="type"),r&&d.type!=="TSImportEqualsDeclaration"&&(this.resetStartLocation(d,o),d.declare=!0),d):null}parseClassId(e,o,r,c){if((!o||r)&&this.isContextual(113))return;super.parseClassId(e,o,r,e.declare?1024:8331);let d=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);d&&(e.typeParameters=d)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let o=this.tsTryParseTypeAnnotation();o&&(e.typeAnnotation=o)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(F.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:o}=e;this.raise(F.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:o.type==="Identifier"&&!e.computed?o.name:`[${this.input.slice(this.offsetToSourcePos(o.start),this.offsetToSourcePos(o.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(F.PrivateElementHasAbstract,e),e.accessibility&&this.raise(F.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(F.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,o,r,c,d,l){let m=this.tsTryParseTypeParameters(this.tsParseConstModifier);m&&d&&this.raise(F.ConstructorHasTypeParameters,m);let{declare:f=!1,kind:g}=o;f&&(g==="get"||g==="set")&&this.raise(F.DeclareAccessor,o,{kind:g}),m&&(o.typeParameters=m),super.pushClassMethod(e,o,r,c,d,l)}pushClassPrivateMethod(e,o,r,c){let d=this.tsTryParseTypeParameters(this.tsParseConstModifier);d&&(o.typeParameters=d),super.pushClassPrivateMethod(e,o,r,c)}declareClassPrivateMethodInScope(e,o){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&e.value.body==null||super.declareClassPrivateMethodInScope(e,o))}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass)if(e.superClass.type==="TSInstantiationExpression"){let o=e.superClass,r=o.expression;this.takeSurroundingComments(r,r.start,r.end);let c=o.typeParameters;this.takeSurroundingComments(c,c.start,c.end),e.superClass=r,e.superTypeParameters=c}else(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression());this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,o,r,c,d,l,m){let f=this.tsTryParseTypeParameters(this.tsParseConstModifier);return f&&(e.typeParameters=f),super.parseObjPropValue(e,o,r,c,d,l,m)}parseFunctionParams(e,o){let r=this.tsTryParseTypeParameters(this.tsParseConstModifier);r&&(e.typeParameters=r),super.parseFunctionParams(e,o)}parseVarId(e,o){super.parseVarId(e,o),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let r=this.tsTryParseTypeAnnotation();r&&(e.id.typeAnnotation=r,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,o){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,o)}parseMaybeAssign(e,o){var r,c,d,l,m;let f,g,b;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(f=this.state.clone(),g=this.tryParse(()=>super.parseMaybeAssign(e,o),f),!g.error)return g.node;let{context:E}=this.state,k=E[E.length-1];(k===X.j_oTag||k===X.j_expr)&&E.pop()}if(!((r=g)!=null&&r.error)&&!this.match(47))return super.parseMaybeAssign(e,o);(!f||f===this.state)&&(f=this.state.clone());let C,T=this.tryParse(E=>{var k,q;C=this.tsParseTypeParameters(this.tsParseConstModifier);let _=super.parseMaybeAssign(e,o);return(_.type!=="ArrowFunctionExpression"||(k=_.extra)!=null&&k.parenthesized)&&E(),((q=C)==null?void 0:q.params.length)!==0&&this.resetStartLocationFromNode(_,C),_.typeParameters=C,_},f);if(!T.error&&!T.aborted)return C&&this.reportReservedArrowTypeParam(C),T.node;if(!g&&(ca(!this.hasPlugin("jsx")),b=this.tryParse(()=>super.parseMaybeAssign(e,o),f),!b.error))return b.node;if((c=g)!=null&&c.node)return this.state=g.failState,g.node;if(T.node)return this.state=T.failState,C&&this.reportReservedArrowTypeParam(C),T.node;if((d=b)!=null&&d.node)return this.state=b.failState,b.node;throw((l=g)==null?void 0:l.error)||T.error||((m=b)==null?void 0:m.error)}reportReservedArrowTypeParam(e){var o;e.params.length===1&&!e.params[0].constraint&&!((o=e.extra)!=null&&o.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(F.ReservedArrowTypeParam,e)}parseMaybeUnary(e,o){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,o)}parseArrow(e){if(this.match(14)){let o=this.tryParse(r=>{let c=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&r(),c});if(o.aborted)return;o.thrown||(o.error&&(this.state=o.failState),e.returnType=o.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);let o=this.tsTryParseTypeAnnotation();return o&&(e.typeAnnotation=o),this.resetEndLocation(e),e}isAssignable(e,o){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,o);case"TSParameterProperty":return!0;default:return super.isAssignable(e,o)}}toAssignable(e,o=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,o);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":o?this.expressionScope.recordArrowParameterBindingError(F.UnexpectedTypeCastInParameter,e):this.raise(F.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,o);break;case"AssignmentExpression":!o&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,o)}}toAssignableParenthesizedExpression(e,o){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,o);break;default:super.toAssignable(e,o)}}checkToRestConversion(e,o){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,o)}}isValidLVal(e,o,r,c){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(c!==64||!r)&&["expression",!0];default:return super.isValidLVal(e,o,r,c)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,o){if(this.match(47)||this.match(51)){let r=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let c=super.parseMaybeDecoratorArguments(e,o);return c.typeParameters=r,c}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e,o)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,o){let r=super.parseMaybeDefault(e,o);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(F.TypeAnnotationAfterAssign,r.typeAnnotation),r}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(48,1);return}if(e===60){this.finishOp(47,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}toAssignableListItem(e,o,r){let c=e[o];c.type==="TSTypeCastExpression"&&(e[o]=this.typeCastToParameter(c)),super.toAssignableListItem(e,o,r)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}shouldParseArrow(e){return this.match(14)?e.every(o=>this.isAssignable(o,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){let o=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());o&&(e.typeParameters=o)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let o=super.getGetterSetterExpectedParamCount(e),c=this.getObjectOrClassMethodParams(e)[0];return c&&this.isThisParam(c)?o+1:o}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),o=this.tsTryParseTypeAnnotation();return o&&(e.typeAnnotation=o,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:o,strict:r}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=o,this.state.strict=r}}parseClass(e,o,r){let c=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,o,r)}finally{this.state.inAbstractClass=c}}tsParseAbstractDeclaration(e,o){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(o,this.parseClass(e,!0,!1));if(this.isContextual(129))return this.hasFollowingLineBreak()?null:(e.abstract=!0,this.raise(F.NonClassMethodPropertyHasAbstractModifier,e),this.tsParseInterfaceDeclaration(e));throw this.unexpected(null,80)}parseMethod(e,o,r,c,d,l,m){let f=super.parseMethod(e,o,r,c,d,l,m);if((f.abstract||f.type==="TSAbstractMethodDefinition")&&(this.hasPlugin("estree")?f.value:f).body){let{key:C}=f;this.raise(F.AbstractMethodHasImplementation,f,{methodName:C.type==="Identifier"&&!f.computed?C.name:`[${this.input.slice(this.offsetToSourcePos(C.start),this.offsetToSourcePos(C.end))}]`})}return f}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,o,r,c){return!o&&c?(this.parseTypeOnlyImportExportSpecifier(e,!1,r),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,o,r,c))}parseImportSpecifier(e,o,r,c,d){return!o&&c?(this.parseTypeOnlyImportExportSpecifier(e,!0,r),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,o,r,c,r?4098:4096))}parseTypeOnlyImportExportSpecifier(e,o,r){let c=o?"imported":"local",d=o?"local":"exported",l=e[c],m,f=!1,g=!0,b=l.loc.start;if(this.isContextual(93)){let T=this.parseIdentifier();if(this.isContextual(93)){let E=this.parseIdentifier();we(this.state.type)?(f=!0,l=T,m=o?this.parseIdentifier():this.parseModuleExportName(),g=!1):(m=E,g=!1)}else we(this.state.type)?(g=!1,m=o?this.parseIdentifier():this.parseModuleExportName()):(f=!0,l=T)}else we(this.state.type)&&(f=!0,o?(l=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(l.name,l.loc.start,!0,!0)):l=this.parseModuleExportName());f&&r&&this.raise(o?F.TypeModifierIsUsedInTypeImports:F.TypeModifierIsUsedInTypeExports,b),e[c]=l,e[d]=m;let C=o?"importKind":"exportKind";e[C]=f?"type":"value",g&&this.eatContextual(93)&&(e[d]=o?this.parseIdentifier():this.parseModuleExportName()),e[d]||(e[d]=this.cloneIdentifier(e[c])),o&&this.checkIdentifier(e[d],f?4098:4096)}fillOptionalPropertiesForTSESLint(e){var o,r,c,d,l,m,f,g,b,C,T,E,k,q,_,U,me,he,_r,qr,Ur,Wr,Gr,Hr,Kr,Jr,Xr,Zr,Yr,Qr,es,ts,os,rs,ss,ns,is,as,cs,ps,ds,ls,us,ms,hs,fs,xs,gs;switch(e.type){case"ExpressionStatement":(o=e.directive)!=null||(e.directive=void 0);return;case"RestElement":e.value=void 0;case"Identifier":case"ArrayPattern":case"AssignmentPattern":case"ObjectPattern":(r=e.decorators)!=null||(e.decorators=[]),(c=e.optional)!=null||(e.optional=!1),(d=e.typeAnnotation)!=null||(e.typeAnnotation=void 0);return;case"TSParameterProperty":(l=e.accessibility)!=null||(e.accessibility=void 0),(m=e.decorators)!=null||(e.decorators=[]),(f=e.override)!=null||(e.override=!1),(g=e.readonly)!=null||(e.readonly=!1),(b=e.static)!=null||(e.static=!1);return;case"TSEmptyBodyFunctionExpression":e.body=null;case"TSDeclareFunction":case"FunctionDeclaration":case"FunctionExpression":case"ClassMethod":case"ClassPrivateMethod":(C=e.declare)!=null||(e.declare=!1),(T=e.returnType)!=null||(e.returnType=void 0),(E=e.typeParameters)!=null||(e.typeParameters=void 0);return;case"Property":(k=e.optional)!=null||(e.optional=!1);return;case"TSMethodSignature":case"TSPropertySignature":(q=e.optional)!=null||(e.optional=!1);case"TSIndexSignature":(_=e.accessibility)!=null||(e.accessibility=void 0),(U=e.readonly)!=null||(e.readonly=!1),(me=e.static)!=null||(e.static=!1);return;case"TSAbstractPropertyDefinition":case"PropertyDefinition":case"TSAbstractAccessorProperty":case"AccessorProperty":(he=e.declare)!=null||(e.declare=!1),(_r=e.definite)!=null||(e.definite=!1),(qr=e.readonly)!=null||(e.readonly=!1),(Ur=e.typeAnnotation)!=null||(e.typeAnnotation=void 0);case"TSAbstractMethodDefinition":case"MethodDefinition":(Wr=e.accessibility)!=null||(e.accessibility=void 0),(Gr=e.decorators)!=null||(e.decorators=[]),(Hr=e.override)!=null||(e.override=!1),(Kr=e.optional)!=null||(e.optional=!1);return;case"ClassExpression":(Jr=e.id)!=null||(e.id=null);case"ClassDeclaration":(Xr=e.abstract)!=null||(e.abstract=!1),(Zr=e.declare)!=null||(e.declare=!1),(Yr=e.decorators)!=null||(e.decorators=[]),(Qr=e.implements)!=null||(e.implements=[]),(es=e.superTypeArguments)!=null||(e.superTypeArguments=void 0),(ts=e.typeParameters)!=null||(e.typeParameters=void 0);return;case"TSTypeAliasDeclaration":case"VariableDeclaration":(os=e.declare)!=null||(e.declare=!1);return;case"VariableDeclarator":(rs=e.definite)!=null||(e.definite=!1);return;case"TSEnumDeclaration":(ss=e.const)!=null||(e.const=!1),(ns=e.declare)!=null||(e.declare=!1);return;case"TSEnumMember":(is=e.computed)!=null||(e.computed=!1);return;case"TSImportType":(as=e.qualifier)!=null||(e.qualifier=null),(cs=e.options)!=null||(e.options=null);return;case"TSInterfaceDeclaration":(ps=e.declare)!=null||(e.declare=!1),(ds=e.extends)!=null||(e.extends=[]);return;case"TSMappedType":(ls=e.optional)!=null||(e.optional=!1),(us=e.readonly)!=null||(e.readonly=void 0);return;case"TSModuleDeclaration":(ms=e.declare)!=null||(e.declare=!1),(hs=e.global)!=null||(e.global=e.kind==="global");return;case"TSTypeParameter":(fs=e.const)!=null||(e.const=!1),(xs=e.in)!=null||(e.in=!1),(gs=e.out)!=null||(e.out=!1);return}}chStartsBindingIdentifierAndNotRelationalOperator(e,o){if(Pe(e)){if(nr.lastIndex=o,nr.test(this.input)){let r=this.codePointAtPos(nr.lastIndex);if(!Ne(r)&&r!==92)return!1}return!0}else return e===92}nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine(){let e=this.nextTokenInLineStart(),o=this.codePointAtPos(e);return this.chStartsBindingIdentifierAndNotRelationalOperator(o,e)}nextTokenIsIdentifierOrStringLiteralOnSameLine(){let e=this.nextTokenInLineStart(),o=this.codePointAtPos(e);return this.chStartsBindingIdentifier(o,e)||o===34||o===39}};function hG(n){if(n.type!=="MemberExpression")return!1;let{computed:t,property:e}=n;return t&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:Ra(n.object)}function fG(n,t){var e;let{type:o}=n;if((e=n.extra)!=null&&e.parenthesized)return!1;if(t){if(o==="Literal"){let{value:r}=n;if(typeof r=="string"||typeof r=="boolean")return!0}}else if(o==="StringLiteral"||o==="BooleanLiteral")return!0;return!!(Ta(n,t)||xG(n,t)||o==="TemplateLiteral"&&n.expressions.length===0||hG(n))}function Ta(n,t){return t?n.type==="Literal"&&(typeof n.value=="number"||"bigint"in n):n.type==="NumericLiteral"||n.type==="BigIntLiteral"}function xG(n,t){if(n.type==="UnaryExpression"){let{operator:e,argument:o}=n;if(e==="-"&&Ta(o,t))return!0}return!1}function Ra(n){return n.type==="Identifier"?!0:n.type!=="MemberExpression"||n.computed?!1:Ra(n.object)}var da=ze`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),gG=n=>class extends n{parsePlaceholder(e){if(this.match(133)){let o=this.startNode();return this.next(),this.assertNoSpace(),o.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(o,e)}}finishPlaceholder(e,o){let r=e;return(!r.expectedNode||!r.type)&&(r=this.finishNode(r,"Placeholder")),r.expectedNode=o,r}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(133,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,o,r,c){e!==void 0&&super.checkReservedWord(e,o,r,c)}cloneIdentifier(e){let o=super.cloneIdentifier(e);return o.type==="Placeholder"&&(o.expectedNode=e.expectedNode),o}cloneStringLiteral(e){return e.type==="Placeholder"?this.cloneIdentifier(e):super.cloneStringLiteral(e)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,o,r,c){return e==="Placeholder"||super.isValidLVal(e,o,r,c)}toAssignable(e,o){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,o)}chStartsBindingIdentifier(e,o){if(super.chStartsBindingIdentifier(e,o))return!0;let r=this.nextTokenStart();return this.input.charCodeAt(r)===37&&this.input.charCodeAt(r+1)===37}verifyBreakContinue(e,o){var r;((r=e.label)==null?void 0:r.type)!=="Placeholder"&&super.verifyBreakContinue(e,o)}parseExpressionStatement(e,o){var r;if(o.type!=="Placeholder"||(r=o.extra)!=null&&r.parenthesized)return super.parseExpressionStatement(e,o);if(this.match(14)){let d=e;return d.label=this.finishPlaceholder(o,"Identifier"),this.next(),d.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(d,"LabeledStatement")}this.semicolon();let c=e;return c.name=o.name,this.finishPlaceholder(c,"Statement")}parseBlock(e,o,r){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,o,r)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,o,r){let c=o?"ClassDeclaration":"ClassExpression";this.next();let d=this.state.strict,l=this.parsePlaceholder("Identifier");if(l)if(this.match(81)||this.match(133)||this.match(5))e.id=l;else{if(r||!o)return e.id=null,e.body=this.finishPlaceholder(l,"ClassBody"),this.finishNode(e,c);throw this.raise(da.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,o,r);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,d),this.finishNode(e,c)}parseExport(e,o){let r=this.parsePlaceholder("Identifier");if(!r)return super.parseExport(e,o);let c=e;if(!this.isContextual(98)&&!this.match(12))return c.specifiers=[],c.source=null,c.declaration=this.finishPlaceholder(r,"Declaration"),this.finishNode(c,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let d=this.startNode();return d.exported=r,c.specifiers=[this.finishNode(d,"ExportDefaultSpecifier")],super.parseExport(c,o)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(Fe(133),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,o){var r;return(r=e.specifiers)!=null&&r.length?!0:super.maybeParseExportDefaultSpecifier(e,o)}checkExport(e){let{specifiers:o}=e;o!=null&&o.length&&(e.specifiers=o.filter(r=>r.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=o}parseImport(e){let o=this.parsePlaceholder("Identifier");if(!o)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(o,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let r=this.startNodeAtNode(o);return r.local=o,e.specifiers.push(this.finishNode(r,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(da.UnexpectedSpace,this.state.lastTokEndLoc)}},yG=n=>class extends n{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,o=this.startNode();if(this.next(),Z(this.state.type)){let r=this.parseIdentifierName(),c=this.createIdentifier(o,r);if(this.castNodeTo(c,"V8IntrinsicIdentifier"),this.match(10))return c}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},la=["minimal","fsharp","hack","smart"],ua=["^^","@@","^","%","#"];function bG(n){if(n.has("decorators")){if(n.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let o=n.get("decorators").decoratorsBeforeExport;if(o!=null&&typeof o!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let r=n.get("decorators").allowCallParenthesized;if(r!=null&&typeof r!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(n.has("flow")&&n.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(n.has("placeholders")&&n.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(n.has("pipelineOperator")){var t;let o=n.get("pipelineOperator").proposal;if(!la.includes(o)){let r=la.map(c=>`"${c}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${r}.`)}if(o==="hack"){var e;if(n.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(n.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let r=n.get("pipelineOperator").topicToken;if(!ua.includes(r)){let c=ua.map(d=>`"${d}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${c}.`)}if(r==="#"&&((e=n.get("recordAndTuple"))==null?void 0:e.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",n.get("recordAndTuple")])}\`.`)}else if(o==="smart"&&((t=n.get("recordAndTuple"))==null?void 0:t.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",n.get("recordAndTuple")])}\`.`)}if(n.has("moduleAttributes")){if(n.has("deprecatedImportAssert")||n.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if(n.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(n.has("importAssertions")&&n.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");if(n.has("deprecatedImportAssert")||n.has("importAttributes")&&n.get("importAttributes").deprecatedAssertSyntax&&n.set("deprecatedImportAssert",{}),n.has("recordAndTuple")){let o=n.get("recordAndTuple").syntaxType;if(o!=null){let r=["hash","bar"];if(!r.includes(o))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+r.map(c=>`'${c}'`).join(", "))}}if(n.has("asyncDoExpressions")&&!n.has("doExpressions")){let o=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw o.missingPlugins="doExpressions",o}if(n.has("optionalChainingAssign")&&n.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.");if(n.has("discardBinding")&&n.get("discardBinding").syntaxType!=="void")throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.")}var va={estree:CW,jsx:tG,flow:ZW,typescript:mG,v8intrinsic:yG,placeholders:gG},SG=Object.keys(va),vr=class extends Rr{checkProto(t,e,o,r){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return o;let c=t.key;return(c.type==="Identifier"?c.name:c.value)==="__proto__"?e?(this.raise(w.RecordNoProto,c),!0):(o&&(r?r.doubleProtoLoc===null&&(r.doubleProtoLoc=c.loc.start):this.raise(w.DuplicateProto,c)),!0):o}shouldExitDescending(t,e){return t.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(t.start)===e}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(140))throw this.raise(w.ParseExpressionEmptyInput,this.state.startLoc);let t=this.parseExpression();if(!this.match(140))throw this.raise(w.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),t.comments=this.comments,t.errors=this.state.errors,this.optionFlags&256&&(t.tokens=this.tokens),t}parseExpression(t,e){return t?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(t){let e=this.state.startLoc,o=this.parseMaybeAssign(t);if(this.match(12)){let r=this.startNodeAt(e);for(r.expressions=[o];this.eat(12);)r.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(r.expressions),this.finishNode(r,"SequenceExpression")}return o}parseMaybeAssignDisallowIn(t,e){return this.disallowInAnd(()=>this.parseMaybeAssign(t,e))}parseMaybeAssignAllowIn(t,e){return this.allowInAnd(()=>this.parseMaybeAssign(t,e))}setOptionalParametersError(t){t.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(t,e){let o=this.state.startLoc,r=this.isContextual(108);if(r&&this.prodParam.hasYield){this.next();let m=this.parseYield(o);return e&&(m=e.call(this,m,o)),m}let c;t?c=!1:(t=new ot,c=!0);let{type:d}=this.state;(d===10||Z(d))&&(this.state.potentialArrowAt=this.state.start);let l=this.parseMaybeConditional(t);if(e&&(l=e.call(this,l,o)),PW(this.state.type)){let m=this.startNodeAt(o),f=this.state.value;if(m.operator=f,this.match(29)){this.toAssignable(l,!0),m.left=l;let g=o.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=g&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=g&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=g&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null),t.voidPatternLoc!=null&&t.voidPatternLoc.index>=g&&(t.voidPatternLoc=null)}else m.left=l;return this.next(),m.right=this.parseMaybeAssign(),this.checkLVal(l,this.finishNode(m,"AssignmentExpression"),void 0,void 0,void 0,void 0,f==="||="||f==="&&="||f==="??="),m}else c&&this.checkExpressionErrors(t,!0);if(r){let{type:m}=this.state;if((this.hasPlugin("v8intrinsic")?bt(m):bt(m)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(w.YieldNotInGeneratorFunction,o),this.parseYield(o)}return l}parseMaybeConditional(t){let e=this.state.startLoc,o=this.state.potentialArrowAt,r=this.parseExprOps(t);return this.shouldExitDescending(r,o)?r:this.parseConditional(r,e,t)}parseConditional(t,e,o){if(this.eat(17)){let r=this.startNodeAt(e);return r.test=t,r.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),r.alternate=this.parseMaybeAssign(),this.finishNode(r,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let e=this.state.startLoc,o=this.state.potentialArrowAt,r=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(r,o)?r:this.parseExprOp(r,e,-1)}parseExprOp(t,e,o){if(this.isPrivateName(t)){let c=this.getPrivateNameSV(t);(o>=io(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(w.PrivateInExpectedIn,t,{identifierName:c}),this.classScope.usePrivateName(c,t.loc.start)}let r=this.state.type;if(OW(r)&&(this.prodParam.hasIn||!this.match(58))){let c=io(r);if(c>o){if(r===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,e)}let d=this.startNodeAt(e);d.left=t,d.operator=this.state.value;let l=r===41||r===42,m=r===40;if(m&&(c=io(42)),this.next(),r===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(w.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);d.right=this.parseExprOpRightExpr(r,c);let f=this.finishNode(d,l||m?"LogicalExpression":"BinaryExpression"),g=this.state.type;if(m&&(g===41||g===42)||l&&g===40)throw this.raise(w.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(f,e,o)}}return t}parseExprOpRightExpr(t,e){let o=this.state.startLoc;switch(t){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}if(this.getPluginOption("pipelineOperator","proposal")==="smart")return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(w.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(t,e),o)});default:return this.parseExprOpBaseRightExpr(t,e)}}parseExprOpBaseRightExpr(t,e){let o=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),o,DW(t)?e-1:e)}parseHackPipeBody(){var t;let{startLoc:e}=this.state,o=this.parseMaybeAssign();return fW.has(o.type)&&!((t=o.extra)!=null&&t.parenthesized)&&this.raise(w.PipeUnparenthesizedBody,e,{type:o.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(w.PipeTopicUnused,e),o}checkExponentialAfterUnary(t){this.match(57)&&this.raise(w.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,e){let o=this.state.startLoc,r=this.isContextual(96);if(r&&this.recordAwaitIfAllowed()){this.next();let m=this.parseAwait(o);return e||this.checkExponentialAfterUnary(m),m}let c=this.match(34),d=this.startNode();if(EW(this.state.type)){d.operator=this.state.value,d.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let m=this.match(89);if(this.next(),d.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&m){let f=d.argument;f.type==="Identifier"?this.raise(w.StrictDelete,d):this.hasPropertyAsPrivateName(f)&&this.raise(w.DeletePrivateField,d)}if(!c)return e||this.checkExponentialAfterUnary(d),this.finishNode(d,"UnaryExpression")}let l=this.parseUpdate(d,c,t);if(r){let{type:m}=this.state;if((this.hasPlugin("v8intrinsic")?bt(m):bt(m)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(w.AwaitNotInAsyncContext,o),this.parseAwait(o)}return l}parseUpdate(t,e,o){if(e){let d=t;return this.checkLVal(d.argument,this.finishNode(d,"UpdateExpression")),t}let r=this.state.startLoc,c=this.parseExprSubscripts(o);if(this.checkExpressionErrors(o,!1))return c;for(;kW(this.state.type)&&!this.canInsertSemicolon();){let d=this.startNodeAt(r);d.operator=this.state.value,d.prefix=!1,d.argument=c,this.next(),this.checkLVal(c,c=this.finishNode(d,"UpdateExpression"))}return c}parseExprSubscripts(t){let e=this.state.startLoc,o=this.state.potentialArrowAt,r=this.parseExprAtom(t);return this.shouldExitDescending(r,o)?r:this.parseSubscripts(r,e)}parseSubscripts(t,e,o){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,o,r),r.maybeAsyncArrow=!1;while(!r.stop);return t}parseSubscript(t,e,o,r){let{type:c}=this.state;if(!o&&c===15)return this.parseBind(t,e,r);if(po(c))return this.parseTaggedTemplateExpression(t,e,r);let d=!1;if(c===18){if(o&&(this.raise(w.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(t,r);r.optionalChainMember=d=!0,this.next()}if(!o&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,e,r,d);{let l=this.eat(0);return l||d||this.eat(16)?this.parseMember(t,e,r,l,d):this.stopParseSubscript(t,r)}}stopParseSubscript(t,e){return e.stop=!0,t}parseMember(t,e,o,r,c){let d=this.startNodeAt(e);return d.object=t,d.computed=r,r?(d.property=this.parseExpression(),this.expect(3)):this.match(139)?(t.type==="Super"&&this.raise(w.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),d.property=this.parsePrivateName()):d.property=this.parseIdentifier(!0),o.optionalChainMember?(d.optional=c,this.finishNode(d,"OptionalMemberExpression")):this.finishNode(d,"MemberExpression")}parseBind(t,e,o){let r=this.startNodeAt(e);r.object=t,this.next();let c=this.match(83),d=this.parseNoCallExpr();if(d.type==="Super"||c&&d.type==="ImportExpression"||d.type==="Import")throw this.raise(w.UnsupportedBindRHS,d);return r.callee=d,o.stop=!0,this.parseSubscripts(this.finishNode(r,"BindExpression"),e,!1)}parseCoverCallAndAsyncArrowHead(t,e,o,r){let c=this.state.maybeInArrowParameters,d=null;this.state.maybeInArrowParameters=!0,this.next();let l=this.startNodeAt(e);l.callee=t;let{maybeAsyncArrow:m,optionalChainMember:f}=o;m&&(this.expressionScope.enter(pG()),d=new ot),f&&(l.optional=r),r?l.arguments=this.parseCallExpressionArguments():l.arguments=this.parseCallExpressionArguments(t.type!=="Super",l,d);let g=this.finishCallExpression(l,f);return m&&this.shouldParseAsyncArrow()&&!r?(o.stop=!0,this.checkDestructuringPrivate(d),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),g=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),g)):(m&&(this.checkExpressionErrors(d,!0),this.expressionScope.exit()),this.toReferencedArguments(g)),this.state.maybeInArrowParameters=c,g}toReferencedArguments(t,e){this.toReferencedListDeep(t.arguments,e)}parseTaggedTemplateExpression(t,e,o){let r=this.startNodeAt(e);return r.tag=t,r.quasi=this.parseTemplate(!0),o.optionalChainMember&&this.raise(w.OptionalChainingNoTemplate,e),this.finishNode(r,"TaggedTemplateExpression")}atPossibleAsyncArrow(t){return t.type==="Identifier"&&t.name==="async"&&this.state.lastTokEndLoc.index===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.offsetToSourcePos(t.start)===this.state.potentialArrowAt}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===0||t.arguments.length>2)this.raise(w.ImportCallArity,t);else for(let o of t.arguments)o.type==="SpreadElement"&&this.raise(w.ImportCallSpreadArgument,o);return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,o){let r=[],c=!0,d=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(11);){if(c)c=!1;else if(this.expect(12),this.match(11)){e&&this.addTrailingCommaExtraToNode(e),this.next();break}r.push(this.parseExprListItem(11,!1,o,t))}return this.state.inFSharpPipelineDirectBody=d,r}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,e){var o;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(t,e.arguments,!0,(o=e.extra)==null?void 0:o.trailingCommaLoc),e.innerComments&&Mt(t,e.innerComments),e.callee.trailingComments&&Mt(t,e.callee.trailingComments),t}parseNoCallExpr(){let t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let e,o=null,{type:r}=this.state;switch(r){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaPropertyOrPhaseCall(e):this.match(10)?this.optionFlags&512?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(w.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let c=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(c)}case 0:return this.parseArrayLike(3,!1,t);case 5:return this.parseObjectLike(8,!1,!1,t);case 68:return this.parseFunctionOrFunctionSent();case 26:o=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(o,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{e=this.startNode(),this.next(),e.object=null;let c=e.callee=this.parseNoCallExpr();if(c.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(w.UnsupportedBind,c)}case 139:return this.raise(w.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let c=this.getPluginOption("pipelineOperator","proposal");if(c)return this.parseTopicReference(c);throw this.unexpected()}case 47:{let c=this.input.codePointAt(this.nextTokenStart());throw Pe(c)||c===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected()}default:if(r===137)return this.parseDecimalLiteral(this.state.value);if(r===2||r===1)return this.parseArrayLike(this.state.type===2?4:3,!0);if(r===6||r===7)return this.parseObjectLike(this.state.type===6?9:8,!1,!0);if(Z(r)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let c=this.state.potentialArrowAt===this.state.start,d=this.state.containsEsc,l=this.parseIdentifier();if(!d&&l.name==="async"&&!this.canInsertSemicolon()){let{type:m}=this.state;if(m===68)return this.resetPreviousNodeTrailingComments(l),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(l));if(Z(m))return c&&this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(l)):l;if(m===90)return this.resetPreviousNodeTrailingComments(l),this.parseDo(this.startNodeAtNode(l),!0)}return c&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(l),[l],!1)):l}else throw this.unexpected()}}parseTopicReferenceThenEqualsSign(t,e){let o=this.getPluginOption("pipelineOperator","proposal");if(o)return this.state.type=t,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=ue(this.state.endLoc,-1),this.parseTopicReference(o);throw this.unexpected()}parseTopicReference(t){let e=this.startNode(),o=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(e,o,t,r)}finishTopicReference(t,e,o,r){if(this.testTopicReferenceConfiguration(o,e,r))return o==="hack"?(this.topicReferenceIsAllowedInCurrentContext()||this.raise(w.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(t,"TopicReference")):(this.topicReferenceIsAllowedInCurrentContext()||this.raise(w.PrimaryTopicNotAllowed,e),this.registerTopicReference(),this.finishNode(t,"PipelinePrimaryTopicReference"));throw this.raise(w.PipeTopicUnconfiguredToken,e,{token:Fe(r)})}testTopicReferenceConfiguration(t,e,o){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:Fe(o)}]);case"smart":return o===27;default:throw this.raise(w.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(ao(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(w.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(t,e,!0)}parseDo(t,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),t.async=e,this.next();let o=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=o,this.finishNode(t,"DoExpression")}parseSuper(){let t=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper?this.optionFlags&16||this.raise(w.SuperNotAllowed,t):this.scope.allowSuper||this.optionFlags&16||this.raise(w.UnexpectedSuper,t),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(w.UnsupportedSuper,t),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),e=this.startNodeAt(ue(this.state.startLoc,1)),o=this.state.value;return this.next(),t.id=this.createIdentifier(e,o),this.finishNode(t,"PrivateName")}parseFunctionOrFunctionSent(){let t=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,e,"sent")}return this.parseFunction(t)}parseMetaProperty(t,e,o){t.meta=e;let r=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==o||r)&&this.raise(w.UnsupportedMetaProperty,t.property,{target:e.name,onlyValidPropertyName:o}),this.finishNode(t,"MetaProperty")}parseImportMetaPropertyOrPhaseCall(t){if(this.next(),this.isContextual(105)||this.isContextual(97)){let e=this.isContextual(105);return this.expectPlugin(e?"sourcePhaseImports":"deferredImportEvaluation"),this.next(),t.phase=e?"source":"defer",this.parseImportCall(t)}else{let e=this.createIdentifierAt(this.startNodeAtNode(t),"import",this.state.lastTokStartLoc);return this.isContextual(101)&&(this.inModule||this.raise(w.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0),this.parseMetaProperty(t,e,"meta")}}parseLiteralAtNode(t,e,o){return this.addExtra(o,"rawValue",t),this.addExtra(o,"raw",this.input.slice(this.offsetToSourcePos(o.start),this.state.end)),o.value=t,this.next(),this.finishNode(o,e)}parseLiteral(t,e){let o=this.startNode();return this.parseLiteralAtNode(t,e,o)}parseStringLiteral(t){return this.parseLiteral(t,"StringLiteral")}parseNumericLiteral(t){return this.parseLiteral(t,"NumericLiteral")}parseBigIntLiteral(t){return this.parseLiteral(t,"BigIntLiteral")}parseDecimalLiteral(t){return this.parseLiteral(t,"DecimalLiteral")}parseRegExpLiteral(t){let e=this.startNode();return this.addExtra(e,"raw",this.input.slice(this.offsetToSourcePos(e.start),this.state.end)),e.pattern=t.pattern,e.flags=t.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(t){let e=this.startNode();return e.value=t,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let t=this.startNode();return this.next(),this.finishNode(t,"NullLiteral")}parseParenAndDistinguishExpression(t){let e=this.state.startLoc,o;this.next(),this.expressionScope.enter(cG());let r=this.state.maybeInArrowParameters,c=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let d=this.state.startLoc,l=[],m=new ot,f=!0,g,b;for(;!this.match(11);){if(f)f=!1;else if(this.expect(12,m.optionalParametersLoc===null?null:m.optionalParametersLoc),this.match(11)){b=this.state.startLoc;break}if(this.match(21)){let E=this.state.startLoc;if(g=this.state.startLoc,l.push(this.parseParenItem(this.parseRestBinding(),E)),!this.checkCommaAfterRest(41))break}else l.push(this.parseMaybeAssignAllowInOrVoidPattern(11,m,this.parseParenItem))}let C=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=r,this.state.inFSharpPipelineDirectBody=c;let T=this.startNodeAt(e);return t&&this.shouldParseArrow(l)&&(T=this.parseArrow(T))?(this.checkDestructuringPrivate(m),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(T,l,!1),T):(this.expressionScope.exit(),l.length||this.unexpected(this.state.lastTokStartLoc),b&&this.unexpected(b),g&&this.unexpected(g),this.checkExpressionErrors(m,!0),this.toReferencedListDeep(l,!0),l.length>1?(o=this.startNodeAt(d),o.expressions=l,this.finishNode(o,"SequenceExpression"),this.resetEndLocation(o,C)):o=l[0],this.wrapParenthesis(e,o))}wrapParenthesis(t,e){if(!(this.optionFlags&1024))return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",t.index),this.takeSurroundingComments(e,t.index,this.state.lastTokEndLoc.index),e;let o=this.startNodeAt(t);return o.expression=e,this.finishNode(o,"ParenthesizedExpression")}shouldParseArrow(t){return!this.canInsertSemicolon()}parseArrow(t){if(this.eat(19))return t}parseParenItem(t,e){return t}parseNewOrNewTarget(){let t=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();let o=this.parseMetaProperty(t,e,"target");return this.scope.allowNewTarget||this.raise(w.UnexpectedNewTarget,o),o}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),t.arguments=e}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){let e=this.match(83),o=this.parseNoCallExpr();t.callee=o,(e&&o.type==="ImportExpression"||o.type==="Import")&&this.raise(w.ImportCallNotNewExpression,o),o.type==="Super"&&this.raise(w.SuperCallNotNewExpression,o)}parseTemplateElement(t){let{start:e,startLoc:o,end:r,value:c}=this.state,d=e+1,l=this.startNodeAt(ue(o,1));c===null&&(t||this.raise(w.InvalidEscapeSequenceTemplate,ue(this.state.firstInvalidTemplateEscapePos,1)));let m=this.match(24),f=m?-1:-2,g=r+f;l.value={raw:this.input.slice(d,g).replace(/\r\n?/g,`
9
- `),cooked:c===null?null:c.slice(1,f)},l.tail=m,this.next();let b=this.finishNode(l,"TemplateElement");return this.resetEndLocation(b,ue(this.state.lastTokEndLoc,f)),b}parseTemplate(t){let e=this.startNode(),o=this.parseTemplateElement(t),r=[o],c=[];for(;!o.tail;)c.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.push(o=this.parseTemplateElement(t));return e.expressions=c,e.quasis=r,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,o,r){o&&this.expectPlugin("recordAndTuple");let c=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let d=!1,l=!0,m=this.startNode();for(m.properties=[],this.next();!this.match(t);){if(l)l=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(m);break}let g;e?g=this.parseBindingProperty():(g=this.parsePropertyDefinition(r),d=this.checkProto(g,o,d,r)),o&&!this.isObjectProperty(g)&&g.type!=="SpreadElement"&&this.raise(w.InvalidRecordProperty,g),g.shorthand&&this.addExtra(g,"shorthand",!0),m.properties.push(g)}this.next(),this.state.inFSharpPipelineDirectBody=c;let f="ObjectExpression";return e?f="ObjectPattern":o&&(f="RecordExpression"),this.finishNode(m,f)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(t){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(w.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());let o=this.startNode(),r=!1,c=!1,d;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(o.decorators=e,e=[]),o.method=!1,t&&(d=this.state.startLoc);let l=this.eat(55);this.parsePropertyNamePrefixOperator(o);let m=this.state.containsEsc;if(this.parsePropertyName(o,t),!l&&!m&&this.maybeAsyncOrAccessorProp(o)){let{key:f}=o,g=f.name;g==="async"&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(f),l=this.eat(55),this.parsePropertyName(o)),(g==="get"||g==="set")&&(c=!0,this.resetPreviousNodeTrailingComments(f),o.kind=g,this.match(55)&&(l=!0,this.raise(w.AccessorIsGenerator,this.state.curPosition(),{kind:g}),this.next()),this.parsePropertyName(o))}return this.parseObjPropValue(o,d,l,r,!1,c,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;let o=this.getGetterSetterExpectedParamCount(t),r=this.getObjectOrClassMethodParams(t);r.length!==o&&this.raise(t.kind==="get"?w.BadGetterArity:w.BadSetterArity,t),t.kind==="set"&&((e=r[r.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(w.BadSetterRestParameter,t)}parseObjectMethod(t,e,o,r,c){if(c){let d=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(d),d}if(o||e||this.match(10))return r&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,o,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,o,r){if(t.shorthand=!1,this.eat(14))return t.value=o?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(8,r),this.finishObjectProperty(t);if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),o)t.value=this.parseMaybeDefault(e,this.cloneIdentifier(t.key));else if(this.match(29)){let c=this.state.startLoc;r!=null?r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=c):this.raise(w.InvalidCoverInitializedName,c),t.value=this.parseMaybeDefault(e,this.cloneIdentifier(t.key))}else t.value=this.cloneIdentifier(t.key);return t.shorthand=!0,this.finishObjectProperty(t)}}finishObjectProperty(t){return this.finishNode(t,"ObjectProperty")}parseObjPropValue(t,e,o,r,c,d,l){let m=this.parseObjectMethod(t,o,r,c,d)||this.parseObjectProperty(t,e,c,l);return m||this.unexpected(),m}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:o,value:r}=this.state,c;if(we(o))c=this.parseIdentifier(!0);else switch(o){case 135:c=this.parseNumericLiteral(r);break;case 134:c=this.parseStringLiteral(r);break;case 136:c=this.parseBigIntLiteral(r);break;case 139:{let d=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=d):this.raise(w.UnexpectedPrivateField,d),c=this.parsePrivateName();break}default:if(o===137){c=this.parseDecimalLiteral(r);break}this.unexpected()}t.key=c,o!==139&&(t.computed=!1)}}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,o,r,c,d,l=!1){this.initFunction(t,o),t.generator=e,this.scope.enter(530|(l?576:0)|(c?32:0)),this.prodParam.enter(ao(o,t.generator)),this.parseFunctionParams(t,r);let m=this.parseFunctionBodyAndFinish(t,d,!0);return this.prodParam.exit(),this.scope.exit(),m}parseArrayLike(t,e,o){e&&this.expectPlugin("recordAndTuple");let r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let c=this.startNode();return this.next(),c.elements=this.parseExprList(t,!e,o,c),this.state.inFSharpPipelineDirectBody=r,this.finishNode(c,e?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,e,o,r){this.scope.enter(518);let c=ao(o,!1);!this.match(5)&&this.prodParam.hasIn&&(c|=8),this.prodParam.enter(c),this.initFunction(t,o);let d=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,e,r)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=d,this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,e,o){this.toAssignableList(e,o,!1),t.params=e}parseFunctionBodyAndFinish(t,e,o=!1){return this.parseFunctionBody(t,!1,o),this.finishNode(t,e)}parseFunctionBody(t,e,o=!1){let r=e&&!this.match(5);if(this.expressionScope.enter(Ma()),r)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{let c=this.state.strict,d=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),t.body=this.parseBlock(!0,!1,l=>{let m=!this.isSimpleParamList(t.params);l&&m&&this.raise(w.IllegalLanguageModeDirective,(t.kind==="method"||t.kind==="constructor")&&t.key?t.key.loc.end:t);let f=!c&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!o&&!m,e,f),this.state.strict&&t.id&&this.checkIdentifier(t.id,65,f)}),this.prodParam.exit(),this.state.labels=d}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let e=0,o=t.length;e<o;e++)if(!this.isSimpleParameter(t[e]))return!1;return!0}checkParams(t,e,o,r=!0){let c=!e&&new Set,d={type:"FormalParameters"};for(let l of t.params)this.checkLVal(l,d,5,c,r)}parseExprList(t,e,o,r){let c=[],d=!0;for(;!this.eat(t);){if(d)d=!1;else if(this.expect(12),this.match(t)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}c.push(this.parseExprListItem(t,e,o))}return c}parseExprListItem(t,e,o,r){let c;if(this.match(12))e||this.raise(w.UnexpectedToken,this.state.curPosition(),{unexpected:","}),c=null;else if(this.match(21)){let d=this.state.startLoc;c=this.parseParenItem(this.parseSpread(o),d)}else if(this.match(17)){this.expectPlugin("partialApplication"),r||this.raise(w.UnexpectedArgumentPlaceholder,this.state.startLoc);let d=this.startNode();this.next(),c=this.finishNode(d,"ArgumentPlaceholder")}else c=this.parseMaybeAssignAllowInOrVoidPattern(t,o,this.parseParenItem);return c}parseIdentifier(t){let e=this.startNode(),o=this.parseIdentifierName(t);return this.createIdentifier(e,o)}createIdentifier(t,e){return t.name=e,t.loc.identifierName=e,this.finishNode(t,"Identifier")}createIdentifierAt(t,e,o){return t.name=e,t.loc.identifierName=e,this.finishNodeAt(t,"Identifier",o)}parseIdentifierName(t){let e,{startLoc:o,type:r}=this.state;we(r)?e=this.state.value:this.unexpected();let c=RW(r);return t?c&&this.replaceToken(132):this.checkReservedWord(e,o,c,!1),this.next(),e}checkReservedWord(t,e,o,r){if(t.length>10||!WW(t))return;if(o&&_W(t)){this.raise(w.UnexpectedKeyword,e,{keyword:t});return}if((this.state.strict?r?Sa:ya:ga)(t,this.inModule)){this.raise(w.UnexpectedReservedWord,e,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(w.YieldBindingIdentifier,e);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(w.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(w.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(w.ArgumentsInClass,e);return}}recordAwaitIfAllowed(){let t=this.prodParam.hasAwait;return t&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),t}parseAwait(t){let e=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(w.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(w.ObsoleteAwaitStar,e),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:t}=this.state;return t===53||t===10||t===0||po(t)||t===102&&!this.state.containsEsc||t===138||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(t){let e=this.startNodeAt(t);this.expressionScope.recordParameterInitializerError(w.YieldInParameter,e);let o=!1,r=null;if(!this.hasPrecedingLineBreak())switch(o=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!o)break;default:r=this.parseMaybeAssign()}return e.delegate=o,e.argument=r,this.finishNode(e,"YieldExpression")}parseImportCall(t){if(this.next(),t.source=this.parseMaybeAssignAllowIn(),t.options=null,this.eat(12)){if(this.match(11))this.addTrailingCommaExtraToNode(t.source);else if(t.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&(this.addTrailingCommaExtraToNode(t.options),!this.match(11))){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(w.ImportCallArity,t)}}return this.expect(11),this.finishNode(t,"ImportExpression")}checkPipelineAtInfixOperator(t,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(w.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(t,e){if(this.isSimpleReference(t)){let o=this.startNodeAt(e);return o.callee=t,this.finishNode(o,"PipelineBareFunction")}else{let o=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),o.expression=t,this.finishNode(o,"PipelineTopicExpression")}}isSimpleReference(t){switch(t.type){case"MemberExpression":return!t.computed&&this.isSimpleReference(t.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(t){if(this.match(19))throw this.raise(w.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(w.PipelineTopicUnused,t)}withTopicBindingContext(t){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(t){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}else return t()}withSoloAwaitPermittingContext(t){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return t()}finally{this.state.soloAwait=e}}allowInAnd(t){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return t()}finally{this.prodParam.exit()}}return t()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(t){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let o=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let r=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.state.inFSharpPipelineDirectBody=o,r}parseModuleExpression(){this.expectPlugin("moduleBlocks");let t=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let o=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(e,8,"module")}finally{o()}return this.finishNode(t,"ModuleExpression")}parseVoidPattern(t){this.expectPlugin("discardBinding");let e=this.startNode();return t!=null&&(t.voidPatternLoc=this.state.startLoc),this.next(),this.finishNode(e,"VoidPattern")}parseMaybeAssignAllowInOrVoidPattern(t,e,o){if(e!=null&&this.match(88)){let r=this.lookaheadCharCode();if(r===44||r===(t===3?93:t===8?125:41)||r===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(e))}return this.parseMaybeAssignAllowIn(e,o)}parsePropertyNamePrefixOperator(t){}},ir={kind:1},zG={kind:2},wG=/[\uD800-\uDFFF]/u,ar=/in(?:stanceof)?/y;function CG(n,t,e){for(let o=0;o<n.length;o++){let r=n[o],{type:c}=r;if(typeof c=="number"){if(c===139){let{loc:d,start:l,value:m,end:f}=r,g=l+1,b=ue(d.start,1);n.splice(o,1,new ve({type:Oe(27),value:"#",start:l,end:g,startLoc:d.start,endLoc:b}),new ve({type:Oe(132),value:m,start:g,end:f,startLoc:b,endLoc:d.end})),o++;continue}if(po(c)){let{loc:d,start:l,value:m,end:f}=r,g=l+1,b=ue(d.start,1),C;t.charCodeAt(l-e)===96?C=new ve({type:Oe(22),value:"`",start:l,end:g,startLoc:d.start,endLoc:b}):C=new ve({type:Oe(8),value:"}",start:l,end:g,startLoc:d.start,endLoc:b});let T,E,k,q;c===24?(E=f-1,k=ue(d.end,-1),T=m===null?null:m.slice(1,-1),q=new ve({type:Oe(22),value:"`",start:E,end:f,startLoc:k,endLoc:d.end})):(E=f-2,k=ue(d.end,-2),T=m===null?null:m.slice(1,-2),q=new ve({type:Oe(23),value:"${",start:E,end:f,startLoc:k,endLoc:d.end})),n.splice(o,1,C,new ve({type:Oe(20),value:T,start:g,end:E,startLoc:b,endLoc:k}),q),o+=2;continue}r.type=Oe(c)}}return n}var Pr=class extends vr{parseTopLevel(t,e){return t.program=this.parseProgram(e,140,this.options.sourceType==="module"?"module":"script"),t.comments=this.comments,this.optionFlags&256&&(t.tokens=CG(this.tokens,this.input,this.startIndex)),this.finishNode(t,"File")}parseProgram(t,e,o){if(t.sourceType=o,t.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(t,!0,!0,e),this.inModule){if(!(this.optionFlags&64)&&this.scope.undefinedExports.size>0)for(let[c,d]of Array.from(this.scope.undefinedExports))this.raise(w.ModuleExportUndefined,d,{localName:c});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let r;return e===140?r=this.finishNode(t,"Program"):r=this.finishNodeAt(t,"Program",ue(this.state.startLoc,-1)),r}stmtToDirective(t){let e=this.castNodeTo(t,"Directive"),o=this.castNodeTo(t.expression,"DirectiveLiteral"),r=o.value,c=this.input.slice(this.offsetToSourcePos(o.start),this.offsetToSourcePos(o.end)),d=o.value=c.slice(1,-1);return this.addExtra(o,"raw",c),this.addExtra(o,"rawValue",d),this.addExtra(o,"expressionValue",r),e.value=o,delete t.expression,e}parseInterpreterDirective(){if(!this.match(28))return null;let t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(107)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(107))return!1;let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);if(this.isUnparsedContextual(t,"of")){let o=this.lookaheadCharCodeSince(t+2);if(o!==61&&o!==58&&o!==59)return!1}return!!(this.chStartsBindingIdentifier(e,t)||this.isUnparsedContextual(t,"void"))}nextTokenIsIdentifierOnSameLine(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return this.chStartsBindingIdentifier(e,t)}isAwaitUsing(){if(!this.isContextual(96))return!1;let t=this.nextTokenInLineStart();if(this.isUnparsedContextual(t,"using")){t=this.nextTokenInLineStartSince(t+5);let e=this.codePointAtPos(t);if(this.chStartsBindingIdentifier(e,t))return!0}return!1}chStartsBindingIdentifier(t,e){if(Pe(t)){if(ar.lastIndex=e,ar.test(this.input)){let o=this.codePointAtPos(ar.lastIndex);if(!Ne(o)&&o!==92)return!1}return!0}else return t===92}chStartsBindingPattern(t){return t===91||t===123}hasFollowingBindingAtom(){let t=this.nextTokenStart(),e=this.codePointAtPos(t);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,t)}hasInLineFollowingBindingIdentifierOrBrace(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return e===123||this.chStartsBindingIdentifier(e,t)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(t=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,t&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(t){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(t,e)}parseStatementContent(t,e){let o=this.state.type,r=this.startNode(),c=!!(t&2),d=!!(t&4),l=t&1;switch(o){case 60:return this.parseBreakContinueStatement(r,!0);case 63:return this.parseBreakContinueStatement(r,!1);case 64:return this.parseDebuggerStatement(r);case 90:return this.parseDoWhileStatement(r);case 91:return this.parseForStatement(r);case 68:if(this.lookaheadCharCode()===46)break;return d||this.raise(this.state.strict?w.StrictFunction:this.options.annexB?w.SloppyFunctionAnnexB:w.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(r,!1,!c&&d);case 80:return c||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,r),!0);case 69:return this.parseIfStatement(r);case 70:return this.parseReturnStatement(r);case 71:return this.parseSwitchStatement(r);case 72:return this.parseThrowStatement(r);case 73:return this.parseTryStatement(r);case 96:if(this.isAwaitUsing())return this.allowsUsing()?c?this.recordAwaitIfAllowed()||this.raise(w.AwaitUsingNotInAsyncContext,r):this.raise(w.UnexpectedLexicalDeclaration,r):this.raise(w.UnexpectedUsingDeclaration,r),this.next(),this.parseVarStatement(r,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?c||this.raise(w.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(w.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(r,"using");case 100:{if(this.state.containsEsc)break;let g=this.nextTokenStart(),b=this.codePointAtPos(g);if(b!==91&&(!c&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(b,g)&&b!==123))break}case 75:c||this.raise(w.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let g=this.state.value;return this.parseVarStatement(r,g)}case 92:return this.parseWhileStatement(r);case 76:return this.parseWithStatement(r);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(r);case 83:{let g=this.lookaheadCharCode();if(g===40||g===46)break}case 82:{!(this.optionFlags&8)&&!l&&this.raise(w.UnexpectedImportExport,this.state.startLoc),this.next();let g;return o===83?g=this.parseImport(r):g=this.parseExport(r,e),this.assertModuleNodeAllowed(g),g}default:if(this.isAsyncFunction())return c||this.raise(w.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!c&&d)}let m=this.state.value,f=this.parseExpression();return Z(o)&&f.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(r,m,f,t):this.parseExpressionStatement(r,f,e)}assertModuleNodeAllowed(t){!(this.optionFlags&8)&&!this.inModule&&this.raise(w.ImportOutsideModule,t)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(t,e,o){if(t){var r;(r=e.decorators)!=null&&r.length?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(w.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...t)):e.decorators=t,this.resetStartLocationFromNode(e,t[0]),o&&this.resetStartLocationFromNode(o,e)}return e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(t){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))t||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(w.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(w.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let t=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,o;if(this.match(10)){let r=this.state.startLoc;this.next(),o=this.parseExpression(),this.expect(11),o=this.wrapParenthesis(r,o);let c=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(o,r),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==o&&this.raise(w.DecoratorArgumentsOutsideParentheses,c)}else{for(o=this.parseIdentifier(!1);this.eat(16);){let r=this.startNodeAt(e);r.object=o,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),r.property=this.parsePrivateName()):r.property=this.parseIdentifier(!0),r.computed=!1,o=this.finishNode(r,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(o,e)}}else t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t,e){if(this.eat(10)){let o=this.startNodeAt(e);return o.callee=t,o.arguments=this.parseCallExpressionArguments(),this.toReferencedList(o.arguments),this.finishNode(o,"CallExpression")}return t}parseBreakContinueStatement(t,e){return this.next(),this.isLineTerminator()?t.label=null:(t.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(t,e),this.finishNode(t,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(t,e){let o;for(o=0;o<this.state.labels.length;++o){let r=this.state.labels[o];if((t.label==null||r.name===t.label.name)&&(r.kind!=null&&(e||r.kind===1)||t.label&&e))break}if(o===this.state.labels.length){let r=e?"BreakStatement":"ContinueStatement";this.raise(w.IllegalBreakContinue,t,{type:r})}}parseDebuggerStatement(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let t=this.parseExpression();return this.expect(11),t}parseDoWhileStatement(t){return this.next(),this.state.labels.push(ir),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),t.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push(ir);let e=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(t,null);let o=this.isContextual(100);{let m=this.isAwaitUsing(),f=m||this.isForUsing(),g=o&&this.hasFollowingBindingAtom()||f;if(this.match(74)||this.match(75)||g){let b=this.startNode(),C;m?(C="await using",this.recordAwaitIfAllowed()||this.raise(w.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):C=this.state.value,this.next(),this.parseVar(b,!0,C);let T=this.finishNode(b,"VariableDeclaration"),E=this.match(58);return E&&f&&this.raise(w.ForInUsing,T),(E||this.isContextual(102))&&T.declarations.length===1?this.parseForIn(t,T,e):(e!==null&&this.unexpected(e),this.parseFor(t,T))}}let r=this.isContextual(95),c=new ot,d=this.parseExpression(!0,c),l=this.isContextual(102);if(l&&(o&&this.raise(w.ForOfLet,d),e===null&&r&&d.type==="Identifier"&&this.raise(w.ForOfAsync,d)),l||this.match(58)){this.checkDestructuringPrivate(c),this.toAssignable(d,!0);let m=l?"ForOfStatement":"ForInStatement";return this.checkLVal(d,{type:m}),this.parseForIn(t,d,e)}else this.checkExpressionErrors(c,!0);return e!==null&&this.unexpected(e),this.parseFor(t,d)}parseFunctionStatement(t,e,o){return this.next(),this.parseFunction(t,1|(o?2:0)|(e?8:0))}parseIfStatement(t){return this.next(),t.test=this.parseHeaderExpression(),t.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),t.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return this.prodParam.hasReturn||this.raise(w.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")}parseSwitchStatement(t){this.next(),t.discriminant=this.parseHeaderExpression();let e=t.cases=[];this.expect(5),this.state.labels.push(zG),this.scope.enter(256);let o;for(let r;!this.match(8);)if(this.match(61)||this.match(65)){let c=this.match(61);o&&this.finishNode(o,"SwitchCase"),e.push(o=this.startNode()),o.consequent=[],this.next(),c?o.test=this.parseExpression():(r&&this.raise(w.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),r=!0,o.test=null),this.expect(14)}else o?o.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),o&&this.finishNode(o,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(w.NewlineAfterThrow,this.state.lastTokEndLoc),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")}parseCatchClauseParam(){let t=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&t.type==="Identifier"?8:0),this.checkLVal(t,{type:"CatchClause"},9),t}parseTryStatement(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.match(62)){let e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(67)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(w.NoCatchOrFinally,t),this.finishNode(t,"TryStatement")}parseVarStatement(t,e,o=!1){return this.next(),this.parseVar(t,!1,e,o),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push(ir),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(w.StrictWith,this.state.startLoc),this.next(),t.object=this.parseHeaderExpression(),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(t,"WithStatement")}parseEmptyStatement(t){return this.next(),this.finishNode(t,"EmptyStatement")}parseLabeledStatement(t,e,o,r){for(let d of this.state.labels)d.name===e&&this.raise(w.LabelRedeclaration,o,{labelName:e});let c=IW(this.state.type)?1:this.match(71)?2:null;for(let d=this.state.labels.length-1;d>=0;d--){let l=this.state.labels[d];if(l.statementStart===t.start)l.statementStart=this.sourceToOffsetPos(this.state.start),l.kind=c;else break}return this.state.labels.push({name:e,kind:c,statementStart:this.sourceToOffsetPos(this.state.start)}),t.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=o,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,e,o){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,e=!0,o){let r=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(r,t,!1,8,o),e&&this.scope.exit(),this.finishNode(r,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,o,r,c){let d=t.body=[],l=t.directives=[];this.parseBlockOrModuleBlockBody(d,e?l:void 0,o,r,c)}parseBlockOrModuleBlockBody(t,e,o,r,c){let d=this.state.strict,l=!1,m=!1;for(;!this.match(r);){let f=o?this.parseModuleItem():this.parseStatementListItem();if(e&&!m){if(this.isValidDirective(f)){let g=this.stmtToDirective(f);e.push(g),!l&&g.value.value==="use strict"&&(l=!0,this.setStrict(!0));continue}m=!0,this.state.strictErrors.clear()}t.push(f)}c?.call(this,l),d||this.setStrict(!1),this.next()}parseFor(t,e){return t.init=e,this.semicolon(!1),t.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(11)?null:this.parseExpression(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,e,o){let r=this.match(58);return this.next(),r?o!==null&&this.unexpected(o):t.await=o!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!r||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(w.ForInOfLoopInitializer,e,{type:r?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(w.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),t.left=e,t.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,r?"ForInStatement":"ForOfStatement")}parseVar(t,e,o,r=!1){let c=t.declarations=[];for(t.kind=o;;){let d=this.startNode();if(this.parseVarId(d,o),d.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,d.init===null&&!r&&(d.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(w.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(o==="const"||o==="using"||o==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(w.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:o})),c.push(this.finishNode(d,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,e){let o=this.parseBindingAtom();e==="using"||e==="await using"?(o.type==="ArrayPattern"||o.type==="ObjectPattern")&&this.raise(w.UsingDeclarationHasBindingPattern,o.loc.start):o.type==="VoidPattern"&&this.raise(w.UnexpectedVoidPattern,o.loc.start),this.checkLVal(o,{type:"VariableDeclarator"},e==="var"?5:8201),t.id=o}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){let o=e&2,r=!!(e&1),c=r&&!(e&4),d=!!(e&8);this.initFunction(t,d),this.match(55)&&(o&&this.raise(w.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),r&&(t.id=this.parseFunctionId(c));let l=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(514),this.prodParam.enter(ao(d,t.generator)),r||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,r?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),r&&!o&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=l,t}parseFunctionId(t){return t||Z(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(10),this.expressionScope.enter(aG()),t.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(t){t.id&&this.scope.declareName(t.id.name,!this.options.annexB||this.state.strict||t.generator||t.async?this.scope.treatFunctionsAsVar?5:8201:17,t.id.loc.start)}parseClass(t,e,o){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,o),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,r),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(t){return t.type==="Identifier"&&t.name==="constructor"||t.type==="StringLiteral"&&t.value==="constructor"}isNonstaticConstructor(t){return!t.computed&&!t.static&&this.nameIsConstructor(t.key)}parseClassBody(t,e){this.classScope.enter();let o={hadConstructor:!1,hadSuperClass:t},r=[],c=this.startNode();if(c.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(r.length>0)throw this.raise(w.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){r.push(this.parseDecorator());continue}let d=this.startNode();r.length&&(d.decorators=r,this.resetStartLocationFromNode(d,r[0]),r=[]),this.parseClassMember(c,d,o),d.kind==="constructor"&&d.decorators&&d.decorators.length>0&&this.raise(w.DecoratorConstructor,d)}}),this.state.strict=e,this.next(),r.length)throw this.raise(w.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(c,"ClassBody")}parseClassMemberFromModifier(t,e){let o=this.parseIdentifier(!0);if(this.isClassMethod()){let r=e;return r.kind="method",r.computed=!1,r.key=o,r.static=!1,this.pushClassMethod(t,r,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let r=e;return r.computed=!1,r.key=o,r.static=!1,t.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(o),!1}parseClassMember(t,e,o){let r=this.isContextual(106);if(r){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(5)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,o,r)}parseClassMemberWithIsStatic(t,e,o,r){let c=e,d=e,l=e,m=e,f=e,g=c,b=c;if(e.static=r,this.parsePropertyNamePrefixOperator(e),this.eat(55)){g.kind="method";let _=this.match(139);if(this.parseClassElementName(g),this.parsePostMemberNameModifiers(g),_){this.pushClassPrivateMethod(t,d,!0,!1);return}this.isNonstaticConstructor(c)&&this.raise(w.ConstructorIsGenerator,c.key),this.pushClassMethod(t,c,!0,!1,!1,!1);return}let C=!this.state.containsEsc&&Z(this.state.type),T=this.parseClassElementName(e),E=C?T.name:null,k=this.isPrivateName(T),q=this.state.startLoc;if(this.parsePostMemberNameModifiers(b),this.isClassMethod()){if(g.kind="method",k){this.pushClassPrivateMethod(t,d,!1,!1);return}let _=this.isNonstaticConstructor(c),U=!1;_&&(c.kind="constructor",o.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(w.DuplicateConstructor,T),_&&this.hasPlugin("typescript")&&e.override&&this.raise(w.OverrideOnConstructor,T),o.hadConstructor=!0,U=o.hadSuperClass),this.pushClassMethod(t,c,!1,!1,_,U)}else if(this.isClassProperty())k?this.pushClassPrivateProperty(t,m):this.pushClassProperty(t,l);else if(E==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(T);let _=this.eat(55);b.optional&&this.unexpected(q),g.kind="method";let U=this.match(139);this.parseClassElementName(g),this.parsePostMemberNameModifiers(b),U?this.pushClassPrivateMethod(t,d,_,!0):(this.isNonstaticConstructor(c)&&this.raise(w.ConstructorIsAsync,c.key),this.pushClassMethod(t,c,_,!0,!1,!1))}else if((E==="get"||E==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(T),g.kind=E;let _=this.match(139);this.parseClassElementName(c),_?this.pushClassPrivateMethod(t,d,!1,!1):(this.isNonstaticConstructor(c)&&this.raise(w.ConstructorIsAccessor,c.key),this.pushClassMethod(t,c,!1,!1,!1,!1)),this.checkGetterSetterParams(c)}else if(E==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(T);let _=this.match(139);this.parseClassElementName(l),this.pushClassAccessorProperty(t,f,_)}else this.isLineTerminator()?k?this.pushClassPrivateProperty(t,m):this.pushClassProperty(t,l):this.unexpected()}parseClassElementName(t){let{type:e,value:o}=this.state;if((e===132||e===134)&&t.static&&o==="prototype"&&this.raise(w.StaticPrototype,this.state.startLoc),e===139){o==="constructor"&&this.raise(w.ConstructorClassPrivateField,this.state.startLoc);let r=this.parsePrivateName();return t.key=r,r}return this.parsePropertyName(t),t.key}parseClassStaticBlock(t,e){var o;this.scope.enter(720);let r=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let c=e.body=[];this.parseBlockOrModuleBlockBody(c,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=r,t.body.push(this.finishNode(e,"StaticBlock")),(o=e.decorators)!=null&&o.length&&this.raise(w.DecoratorStaticBlock,e)}pushClassProperty(t,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(w.ConstructorClassField,e.key),t.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(t,e){let o=this.parseClassPrivateProperty(e);t.body.push(o),this.classScope.declarePrivateName(this.getPrivateNameSV(o.key),0,o.key.loc.start)}pushClassAccessorProperty(t,e,o){!o&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(w.ConstructorClassField,e.key);let r=this.parseClassAccessorProperty(e);t.body.push(r),o&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.loc.start)}pushClassMethod(t,e,o,r,c,d){t.body.push(this.parseMethod(e,o,r,c,d,"ClassMethod",!0))}pushClassPrivateMethod(t,e,o,r){let c=this.parseMethod(e,o,r,!1,!1,"ClassPrivateMethod",!0);t.body.push(c);let d=c.kind==="get"?c.static?6:2:c.kind==="set"?c.static?5:1:0;this.declareClassPrivateMethodInScope(c,d)}declareClassPrivateMethodInScope(t,e){this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),e,t.key.loc.start)}parsePostMemberNameModifiers(t){}parseClassPrivateProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassPrivateProperty")}parseClassProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassProperty")}parseClassAccessorProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassAccessorProperty")}parseInitializer(t){this.scope.enter(592),this.expressionScope.enter(Ma()),this.prodParam.enter(0),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,o,r=8331){if(Z(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,r);else if(o||!e)t.id=null;else throw this.raise(w.MissingClassName,this.state.startLoc)}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,e){let o=this.parseMaybeImportPhase(t,!0),r=this.maybeParseExportDefaultSpecifier(t,o),c=!r||this.eat(12),d=c&&this.eatExportStar(t),l=d&&this.maybeParseExportNamespaceSpecifier(t),m=c&&(!l||this.eat(12)),f=r||d;if(d&&!l){if(r&&this.unexpected(),e)throw this.raise(w.UnsupportedDecoratorExport,t);return this.parseExportFrom(t,!0),this.sawUnambiguousESM=!0,this.finishNode(t,"ExportAllDeclaration")}let g=this.maybeParseExportNamedSpecifiers(t);r&&c&&!d&&!g&&this.unexpected(null,5),l&&m&&this.unexpected(null,98);let b;if(f||g){if(b=!1,e)throw this.raise(w.UnsupportedDecoratorExport,t);this.parseExportFrom(t,f)}else b=this.maybeParseExportDeclaration(t);if(f||g||b){var C;let T=t;if(this.checkExport(T,!0,!1,!!T.source),((C=T.declaration)==null?void 0:C.type)==="ClassDeclaration")this.maybeTakeDecorators(e,T.declaration,T);else if(e)throw this.raise(w.UnsupportedDecoratorExport,t);return this.sawUnambiguousESM=!0,this.finishNode(T,"ExportNamedDeclaration")}if(this.eat(65)){let T=t,E=this.parseExportDefaultExpression();if(T.declaration=E,E.type==="ClassDeclaration")this.maybeTakeDecorators(e,E,T);else if(e)throw this.raise(w.UnsupportedDecoratorExport,t);return this.checkExport(T,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(T,"ExportDefaultDeclaration")}throw this.unexpected(null,5)}eatExportStar(t){return this.eat(55)}maybeParseExportDefaultSpecifier(t,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e?.loc.start);let o=e||this.parseIdentifier(!0),r=this.startNodeAtNode(o);return r.exported=o,t.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){var e,o;(o=(e=t).specifiers)!=null||(e.specifiers=[]);let r=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),r.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(r,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){let e=t;e.specifiers||(e.specifiers=[]);let o=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(o)),e.source=null,this.hasPlugin("importAssertions")?e.assertions=[]:e.attributes=[],e.declaration=null,!0}return!1}maybeParseExportDeclaration(t){return this.shouldParseExportDeclaration()?(t.specifiers=[],t.source=null,this.hasPlugin("importAssertions")?t.assertions=[]:t.attributes=[],t.declaration=this.parseExportDeclaration(t),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){let t=this.startNode();if(this.match(68))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(80))return this.parseClass(t,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(w.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(w.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(t){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:t}=this.state;if(Z(t)){if(t===95&&!this.state.containsEsc||t===100)return!1;if((t===130||t===129)&&!this.state.containsEsc){let r=this.nextTokenStart(),c=this.input.charCodeAt(r);if(c===123||this.chStartsBindingIdentifier(c,r)&&!this.input.startsWith("from",r))return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),o=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||Z(this.state.type)&&o)return!0;if(this.match(65)&&o){let r=this.input.charCodeAt(this.nextTokenStartSince(e+4));return r===34||r===39}return!1}parseExportFrom(t,e){this.eatContextual(98)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t),this.checkJSONModuleImport(t)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:t}=this.state;return t===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(w.DecoratorBeforeExport,this.state.startLoc),!0):this.isUsing()?(this.raise(w.UsingDeclarationExport,this.state.startLoc),!0):this.isAwaitUsing()?(this.raise(w.UsingDeclarationExport,this.state.startLoc),!0):t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,e,o,r){if(e){var c;if(o){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){var d;let l=t.declaration;l.type==="Identifier"&&l.name==="from"&&l.end-l.start===4&&!((d=l.extra)!=null&&d.parenthesized)&&this.raise(w.ExportDefaultFromAsIdentifier,l)}}else if((c=t.specifiers)!=null&&c.length)for(let l of t.specifiers){let{exported:m}=l,f=m.type==="Identifier"?m.name:m.value;if(this.checkDuplicateExports(l,f),!r&&l.local){let{local:g}=l;g.type!=="Identifier"?this.raise(w.ExportBindingIsString,l,{localName:g.value,exportName:f}):(this.checkReservedWord(g.name,g.loc.start,!0,!1),this.scope.checkLocalExport(g))}}else if(t.declaration){let l=t.declaration;if(l.type==="FunctionDeclaration"||l.type==="ClassDeclaration"){let{id:m}=l;if(!m)throw new Error("Assertion failure");this.checkDuplicateExports(t,m.name)}else if(l.type==="VariableDeclaration")for(let m of l.declarations)this.checkDeclaration(m.id)}}}checkDeclaration(t){if(t.type==="Identifier")this.checkDuplicateExports(t,t.name);else if(t.type==="ObjectPattern")for(let e of t.properties)this.checkDeclaration(e);else if(t.type==="ArrayPattern")for(let e of t.elements)e&&this.checkDeclaration(e);else t.type==="ObjectProperty"?this.checkDeclaration(t.value):t.type==="RestElement"?this.checkDeclaration(t.argument):t.type==="AssignmentPattern"&&this.checkDeclaration(t.left)}checkDuplicateExports(t,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(w.DuplicateDefaultExport,t):this.raise(w.DuplicateExport,t,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(t){let e=[],o=!0;for(this.expect(5);!this.eat(8);){if(o)o=!1;else if(this.expect(12),this.eat(8))break;let r=this.isContextual(130),c=this.match(134),d=this.startNode();d.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(d,c,t,r))}return e}parseExportSpecifier(t,e,o,r){return this.eatContextual(93)?t.exported=this.parseModuleExportName():e?t.exported=this.cloneStringLiteral(t.local):t.exported||(t.exported=this.cloneIdentifier(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let t=this.parseStringLiteral(this.state.value),e=wG.exec(t.value);return e&&this.raise(w.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}isJSONModuleImport(t){return t.assertions!=null?t.assertions.some(({key:e,value:o})=>o.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(t){let{specifiers:e}=t,o=e.length===1?e[0].type:null;if(t.phase==="source")o!=="ImportDefaultSpecifier"&&this.raise(w.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(t.phase==="defer")o!=="ImportNamespaceSpecifier"&&this.raise(w.DeferImportRequiresNamespace,e[0].loc.start);else if(t.module){var r;o!=="ImportDefaultSpecifier"&&this.raise(w.ImportReflectionNotBinding,e[0].loc.start),((r=t.assertions)==null?void 0:r.length)>0&&this.raise(w.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){let{specifiers:e}=t;if(e!=null){let o=e.find(r=>{let c;if(r.type==="ExportSpecifier"?c=r.local:r.type==="ImportSpecifier"&&(c=r.imported),c!==void 0)return c.type==="Identifier"?c.name!=="default":c.value!=="default"});o!==void 0&&this.raise(w.ImportJSONBindingNotDefault,o.loc.start)}}}isPotentialImportPhase(t){return t?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(t,e,o,r){e||(o==="module"?(this.expectPlugin("importReflection",r),t.module=!0):this.hasPlugin("importReflection")&&(t.module=!1),o==="source"?(this.expectPlugin("sourcePhaseImports",r),t.phase="source"):o==="defer"?(this.expectPlugin("deferredImportEvaluation",r),t.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(t.phase=null))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;let o=this.startNode(),r=this.parseIdentifierName(!0),{type:c}=this.state;return(we(c)?c!==98||this.lookaheadCharCode()===102:c!==12)?(this.applyImportPhase(t,e,r,o.loc.start),null):(this.applyImportPhase(t,e,null),this.createIdentifier(o,r))}isPrecedingIdImportPhase(t){let{type:e}=this.state;return Z(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(t){return this.match(134)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];let r=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(12),c=r&&this.maybeParseStarImportSpecifier(t);return r&&!c&&this.parseNamedImportSpecifiers(t),this.expectContextual(98),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){var e;return(e=t.specifiers)!=null||(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportReflection(t),this.checkJSONModuleImport(t),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,o){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,o))}finishImportSpecifier(t,e,o=8201){return this.checkLVal(t.local,{type:e},o),this.finishNode(t,e)}parseImportAttributes(){this.expect(5);let t=[],e=new Set;do{if(this.match(8))break;let o=this.startNode(),r=this.state.value;if(e.has(r)&&this.raise(w.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),e.add(r),this.match(134)?o.key=this.parseStringLiteral(r):o.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(w.ModuleAttributeInvalidValue,this.state.startLoc);o.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(o,"ImportAttribute"))}while(this.eat(12));return this.expect(8),t}parseModuleAttributes(){let t=[],e=new Set;do{let o=this.startNode();if(o.key=this.parseIdentifier(!0),o.key.name!=="type"&&this.raise(w.ModuleAttributeDifferentFromType,o.key),e.has(o.key.name)&&this.raise(w.ModuleAttributesWithDuplicateKeys,o.key,{key:o.key.name}),e.add(o.key.name),this.expect(14),!this.match(134))throw this.raise(w.ModuleAttributeInvalidValue,this.state.startLoc);o.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(o,"ImportAttribute"))}while(this.eat(12));return t}maybeParseImportAttributes(t){let e;var o=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?(e=this.parseModuleAttributes(),this.addExtra(t,"deprecatedWithLegacySyntax",!0)):e=this.parseImportAttributes(),o=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions")&&this.raise(w.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(t,"deprecatedAssertSyntax",!0),this.next(),e=this.parseImportAttributes()):e=[];!o&&this.hasPlugin("importAssertions")?t.assertions=e:t.attributes=e}maybeParseDefaultImportSpecifier(t,e){if(e){let o=this.startNodeAtNode(e);return o.local=e,t.specifiers.push(this.finishImportSpecifier(o,"ImportDefaultSpecifier")),!0}else if(we(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(t,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(w.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let o=this.startNode(),r=this.match(134),c=this.isContextual(130);o.imported=this.parseModuleExportName();let d=this.parseImportSpecifier(o,r,t.importKind==="type"||t.importKind==="typeof",c,void 0);t.specifiers.push(d)}}parseImportSpecifier(t,e,o,r,c){if(this.eatContextual(93))t.local=this.parseIdentifier();else{let{imported:d}=t;if(e)throw this.raise(w.ImportBindingIsString,t,{importName:d.value});this.checkReservedWord(d.name,t.loc.start,!0,!0),t.local||(t.local=this.cloneIdentifier(d))}return this.finishImportSpecifier(t,"ImportSpecifier",c)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},uo=class extends Pr{constructor(t,e,o){let r=zW(t);super(r,e),this.options=r,this.initializeScopes(),this.plugins=o,this.filename=r.sourceFilename,this.startIndex=r.startIndex;let c=0;r.allowAwaitOutsideFunction&&(c|=1),r.allowReturnOutsideFunction&&(c|=2),r.allowImportExportEverywhere&&(c|=8),r.allowSuperOutsideMethod&&(c|=16),r.allowUndeclaredExports&&(c|=64),r.allowNewTargetOutsideFunction&&(c|=4),r.allowYieldOutsideFunction&&(c|=32),r.ranges&&(c|=128),r.tokens&&(c|=256),r.createImportExpressions&&(c|=512),r.createParenthesizedExpressions&&(c|=1024),r.errorRecovery&&(c|=2048),r.attachComment&&(c|=4096),r.annexB&&(c|=8192),this.optionFlags=c}getScopeHandler(){return Ct}parse(){this.enterInitialScopes();let t=this.startNode(),e=this.startNode();this.nextToken(),t.errors=null;let o=this.parseTopLevel(t,e);return o.errors=this.state.errors,o.comments.length=this.state.commentsLen,o}};function MG(n,t){var e;if(((e=t)==null?void 0:e.sourceType)==="unambiguous"){t=Object.assign({},t);try{t.sourceType="module";let o=St(t,n),r=o.parse();if(o.sawUnambiguousESM)return r;if(o.ambiguousScriptDifferentAst)try{return t.sourceType="script",St(t,n).parse()}catch{}else r.program.sourceType="script";return r}catch(o){try{return t.sourceType="script",St(t,n).parse()}catch{}throw o}}else return St(t,n).parse()}function TG(n,t){let e=St(t,n);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function RG(n){let t={};for(let e of Object.keys(n))t[e]=Oe(n[e]);return t}var vG=RG(TW);function St(n,t){let e=uo,o=new Map;if(n!=null&&n.plugins){for(let r of n.plugins){let c,d;typeof r=="string"?c=r:[c,d]=r,o.has(c)||o.set(c,d||{})}bG(o),e=PG(o)}return new e(n,t,o)}var ma=new Map;function PG(n){let t=[];for(let r of SG)n.has(r)&&t.push(r);let e=t.join("|"),o=ma.get(e);if(!o){o=uo;for(let r of t)o=va[r](o);ma.set(e,o)}return o}Tt.parse=MG;Tt.parseExpression=TG;Tt.tokTypes=vG});import{Command as ZG}from"commander";import{existsSync as lc}from"fs";import{homedir as Ls}from"os";import{dirname as uc,join as bo}from"path";import{fileURLToPath as mc}from"url";import{agents as hc,detectGlobalAgents as Ds,upsertServer as fc}from"add-mcp";import{createHash as nc,randomUUID as vs}from"crypto";import{chmodSync as ic,existsSync as ac,lstatSync as go,mkdirSync as ho,readFileSync as Os,readdirSync as ks,renameSync as fo,writeFileSync as Ps}from"fs";import{dirname as It,join as Ce}from"path";var yo=".cueframe-install.json";function Es(n){return nc("sha256").update(n).digest("hex")}function Is(n){let t=new Map;function e(o){let r=Ce(n,o),c=go(r);if(c.isSymbolicLink())throw new Error(`Skill package contains a symbolic link: ${r}`);if(c.isDirectory())for(let d of ks(r).sort())!o&&d===yo||e(o?`${o}/${d}`:d);else if(c.isFile())t.set(o,{bytes:Os(r),mode:c.mode&511});else throw new Error(`Unsupported skill package entry: ${r}`)}return e(""),t}function xo(n){return Object.fromEntries([...n].map(([t,e])=>[t,`${e.mode}:${Es(e.bytes)}`]))}function cc(n,t){let e=Object.keys(n).sort();return JSON.stringify(e)===JSON.stringify(Object.keys(t).sort())&&e.every(o=>n[o]===t[o])}function pc(n,t){try{let e=Ce(n,yo);if(!go(e).isFile())return;let o=JSON.parse(Os(e,"utf8"));return o.version!==1||typeof o.sourceHash!="string"||!o.files||!cc(o.files,xo(t))?void 0:o}catch{return}}function dc(n,t){let e=`> Installed ${t} by \`npx -y cueframe install\`. Run it again to refresh
6
+ `):s=String.fromCharCode(r),++this.state.curLine,this.state.lineStart=this.state.pos,s}jsxReadString(t){let r="",s=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(R.UnterminatedString,this.state.startLoc);let a=this.input.charCodeAt(this.state.pos);if(a===t)break;a===38?(r+=this.input.slice(s,this.state.pos),r+=this.jsxReadEntity(),s=this.state.pos):Ao(a)?(r+=this.input.slice(s,this.state.pos),r+=this.jsxReadNewLine(!1),s=this.state.pos):++this.state.pos}r+=this.input.slice(s,this.state.pos++),this.finishToken(134,r)}jsxReadEntity(){let t=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let r=10;this.codePointAtPos(this.state.pos)===120&&(r=16,++this.state.pos);let s=this.readInt(r,void 0,!1,"bail");if(s!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(s)}else{let r=0,s=!1;for(;r++<10&&this.state.pos<this.length&&!(s=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(s){let a=this.input.slice(t,this.state.pos),p=Ope[a];if(++this.state.pos,p)return p}}return this.state.pos=t,"&"}jsxReadWord(){let t,r=this.state.pos;do t=this.input.charCodeAt(++this.state.pos);while(Kt(t)||t===45);this.finishToken(141,this.input.slice(r,this.state.pos))}jsxParseIdentifier(){let t=this.startNode();return this.match(141)?t.name=this.state.value:Gc(this.state.type)?t.name=Ft(this.state.type):this.unexpected(),this.next(),this.finishNode(t,"JSXIdentifier")}jsxParseNamespacedName(){let t=this.state.startLoc,r=this.jsxParseIdentifier();if(!this.eat(14))return r;let s=this.startNodeAt(t);return s.namespace=r,s.name=this.jsxParseIdentifier(),this.finishNode(s,"JSXNamespacedName")}jsxParseElementName(){let t=this.state.startLoc,r=this.jsxParseNamespacedName();if(r.type==="JSXNamespacedName")return r;for(;this.eat(16);){let s=this.startNodeAt(t);s.object=r,s.property=this.jsxParseIdentifier(),r=this.finishNode(s,"JSXMemberExpression")}return r}jsxParseAttributeValue(){let t;switch(this.state.type){case 5:return t=this.startNode(),this.setContext(ce.brace),this.next(),t=this.jsxParseExpressionContainer(t,ce.j_oTag),t.expression.type==="JSXEmptyExpression"&&this.raise($t.AttributeIsEmpty,t),t;case 143:case 134:return this.parseExprAtom();default:throw this.raise($t.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let t=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(t,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(t){return this.next(),t.expression=this.parseExpression(),this.setContext(ce.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(t,"JSXSpreadChild")}jsxParseExpressionContainer(t,r){if(this.match(8))t.expression=this.jsxParseEmptyExpression();else{let s=this.parseExpression();t.expression=s}return this.setContext(r),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(t,"JSXExpressionContainer")}jsxParseAttribute(){let t=this.startNode();return this.match(5)?(this.setContext(ce.brace),this.next(),this.expect(21),t.argument=this.parseMaybeAssignAllowIn(),this.setContext(ce.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(t,"JSXSpreadAttribute")):(t.name=this.jsxParseNamespacedName(),t.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(t,"JSXAttribute"))}jsxParseOpeningElementAt(t){let r=this.startNodeAt(t);return this.eat(144)?this.finishNode(r,"JSXOpeningFragment"):(r.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(r))}jsxParseOpeningElementAfterName(t){let r=[];for(;!this.match(56)&&!this.match(144);)r.push(this.jsxParseAttribute());return t.attributes=r,t.selfClosing=this.eat(56),this.expect(144),this.finishNode(t,"JSXOpeningElement")}jsxParseClosingElementAt(t){let r=this.startNodeAt(t);return this.eat(144)?this.finishNode(r,"JSXClosingFragment"):(r.name=this.jsxParseElementName(),this.expect(144),this.finishNode(r,"JSXClosingElement"))}jsxParseElementAt(t){let r=this.startNodeAt(t),s=[],a=this.jsxParseOpeningElementAt(t),p=null;if(!a.selfClosing){e:for(;;)switch(this.state.type){case 143:if(t=this.state.startLoc,this.next(),this.eat(56)){p=this.jsxParseClosingElementAt(t);break e}s.push(this.jsxParseElementAt(t));break;case 142:s.push(this.parseLiteral(this.state.value,"JSXText"));break;case 5:{let u=this.startNode();this.setContext(ce.brace),this.next(),this.match(21)?s.push(this.jsxParseSpreadChild(u)):s.push(this.jsxParseExpressionContainer(u,ce.j_expr));break}default:this.unexpected()}vt(a)&&!vt(p)&&p!==null?this.raise($t.MissingClosingTagFragment,p):!vt(a)&&vt(p)?this.raise($t.MissingClosingTagElement,p,{openingTagName:yo(a.name)}):!vt(a)&&!vt(p)&&yo(p.name)!==yo(a.name)&&this.raise($t.MissingClosingTagElement,p,{openingTagName:yo(a.name)})}if(vt(a)?(r.openingFragment=a,r.closingFragment=p):(r.openingElement=a,r.closingElement=p),r.children=s,this.match(47))throw this.raise($t.UnwrappedAdjacentJSXElements,this.state.startLoc);return vt(a)?this.finishNode(r,"JSXFragment"):this.finishNode(r,"JSXElement")}jsxParseElement(){let t=this.state.startLoc;return this.next(),this.jsxParseElementAt(t)}setContext(t){let{context:r}=this.state;r[r.length-1]=t}parseExprAtom(t){return this.match(143)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(143),this.jsxParseElement()):super.parseExprAtom(t)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(t){let r=this.curContext();if(r===ce.j_expr){this.jsxReadToken();return}if(r===ce.j_oTag||r===ce.j_cTag){if(yt(t)){this.jsxReadWord();return}if(t===62){++this.state.pos,this.finishToken(144);return}if((t===34||t===39)&&r===ce.j_oTag){this.jsxReadString(t);return}}if(t===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(143);return}super.getTokenFromCode(t)}updateContext(t){let{context:r,type:s}=this.state;if(s===56&&t===143)r.splice(-2,2,ce.j_cTag),this.state.canStartJSXElement=!1;else if(s===143)r.push(ce.j_oTag);else if(s===144){let a=r[r.length-1];a===ce.j_oTag&&t===56||a===ce.j_cTag?(r.pop(),this.state.canStartJSXElement=r[r.length-1]===ce.j_expr):(this.setContext(ce.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=spe(s)}},zc=class extends ur{constructor(...e){super(...e),this.tsNames=new Map}},Tc=class extends mr{constructor(...e){super(...e),this.importsStack=[]}createScope(e){return this.importsStack.push(new Set),new zc(e)}enter(e){e===1024&&this.importsStack.push(new Set),super.enter(e)}exit(){let e=super.exit();return e===1024&&this.importsStack.pop(),e}hasImport(e,t){let r=this.importsStack.length;if(this.importsStack[r-1].has(e))return!0;if(!t&&r>1){for(let s=0;s<r-1;s++)if(this.importsStack[s].has(e))return!0}return!1}declareName(e,t,r){if(t&4096){this.hasImport(e,!0)&&this.parser.raise(R.VarRedeclaration,r,{identifierName:e}),this.importsStack[this.importsStack.length-1].add(e);return}let s=this.currentScope(),a=s.tsNames.get(e)||0;if(t&1024){this.maybeExportDefined(s,e),s.tsNames.set(e,a|16);return}super.declareName(e,t,r),t&2&&(t&1||(this.checkRedeclarationInScope(s,e,t,r),this.maybeExportDefined(s,e)),a=a|1),t&256&&(a=a|2),t&512&&(a=a|4),t&128&&(a=a|8),a&&s.tsNames.set(e,a)}isRedeclaredInScope(e,t,r){let s=e.tsNames.get(t);if((s&2)>0){if(r&256){let a=!!(r&512),p=(s&4)>0;return a!==p}return!0}return r&128&&(s&8)>0?e.names.get(t)&2?!!(r&1):!1:r&2&&(s&1)>0?!0:super.isRedeclaredInScope(e,t,r)}checkLocalExport(e){let{name:t}=e;if(this.hasImport(t))return;let r=this.scopeStack.length;for(let s=r-1;s>=0;s--){let p=this.scopeStack[s].tsNames.get(t);if((p&1)>0||(p&16)>0)return}super.checkLocalExport(e)}},Ec=class{constructor(){this.stacks=[]}enter(e){this.stacks.push(e)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function $s(o,e){return(o?2:0)|(e?1:0)}var Cc=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(e){return e+this.startIndex}offsetToSourcePos(e){return e-this.startIndex}hasPlugin(e){if(typeof e=="string")return this.plugins.has(e);{let[t,r]=e;if(!this.hasPlugin(t))return!1;let s=this.plugins.get(t);for(let a of Object.keys(r))if(s?.[a]!==r[a])return!1;return!0}}getPluginOption(e,t){var r;return(r=this.plugins.get(e))==null?void 0:r[t]}};function qh(o,e){o.trailingComments===void 0?o.trailingComments=e:o.trailingComments.unshift(...e)}function Lpe(o,e){o.leadingComments===void 0?o.leadingComments=e:o.leadingComments.unshift(...e)}function hr(o,e){o.innerComments===void 0?o.innerComments=e:o.innerComments.unshift(...e)}function at(o,e,t){let r=null,s=e.length;for(;r===null&&s>0;)r=e[--s];r===null||r.start>t.start?hr(o,t.comments):qh(r,t.comments)}var Ic=class extends Cc{addComment(e){this.filename&&(e.loc.filename=this.filename);let{commentsLen:t}=this.state;this.comments.length!==t&&(this.comments.length=t),this.comments.push(e),this.state.commentsLen++}processComment(e){let{commentStack:t}=this.state,r=t.length;if(r===0)return;let s=r-1,a=t[s];a.start===e.end&&(a.leadingNode=e,s--);let{start:p}=e;for(;s>=0;s--){let u=t[s],f=u.end;if(f>p)u.containingNode=e,this.finalizeComment(u),t.splice(s,1);else{f===p&&(u.trailingNode=e);break}}}finalizeComment(e){var t;let{comments:r}=e;if(e.leadingNode!==null||e.trailingNode!==null)e.leadingNode!==null&&qh(e.leadingNode,r),e.trailingNode!==null&&Lpe(e.trailingNode,r);else{let s=e.containingNode,a=e.start;if(this.input.charCodeAt(this.offsetToSourcePos(a)-1)===44)switch(s.type){case"ObjectExpression":case"ObjectPattern":at(s,s.properties,e);break;case"CallExpression":case"NewExpression":case"OptionalCallExpression":at(s,s.arguments,e);break;case"ImportExpression":at(s,[s.source,(t=s.options)!=null?t:null],e);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":case"TSTypeParameterDeclaration":at(s,s.params,e);break;case"ArrayExpression":case"ArrayPattern":at(s,s.elements,e);break;case"ExportNamedDeclaration":case"ImportDeclaration":at(s,s.specifiers,e);break;case"TSEnumDeclaration":at(s,s.members,e);break;case"TSEnumBody":at(s,s.members,e);break;case"TSInterfaceBody":at(s,s.body,e);break;default:{if(s.type==="RecordExpression"){at(s,s.properties,e);break}if(s.type==="TupleExpression"){at(s,s.elements,e);break}hr(s,r)}}else hr(s,r)}}finalizeRemainingComments(){let{commentStack:e}=this.state;for(let t=e.length-1;t>=0;t--)this.finalizeComment(e[t]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(e){let{commentStack:t}=this.state,{length:r}=t;if(r===0)return;let s=t[r-1];s.leadingNode===e&&(s.leadingNode=null)}takeSurroundingComments(e,t,r){let{commentStack:s}=this.state,a=s.length;if(a===0)return;let p=a-1;for(;p>=0;p--){let u=s[p],f=u.end;if(u.start===r)u.leadingNode=e;else if(f===t)u.trailingNode=e;else if(f<t)break}}},Rc=class o{constructor(){this.flags=1024,this.startIndex=void 0,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=140,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[ce.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(e){e?this.flags|=1:this.flags&=-2}init({strictMode:e,sourceType:t,startIndex:r,startLine:s,startColumn:a}){this.strict=e===!1?!1:e===!0?!0:t==="module",this.startIndex=r,this.curLine=s,this.lineStart=-a,this.startLoc=this.endLoc=new At(s,a,r)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(e){e?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(e){e?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(e){e?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(e){e?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(e){e?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(e){e?this.flags|=4096:this.flags&=-4097}curPosition(){return new At(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let e=new o;return e.flags=this.flags,e.startIndex=this.startIndex,e.curLine=this.curLine,e.lineStart=this.lineStart,e.startLoc=this.startLoc,e.endLoc=this.endLoc,e.errors=this.errors.slice(),e.potentialArrowAt=this.potentialArrowAt,e.noArrowAt=this.noArrowAt.slice(),e.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),e.topicContext=this.topicContext,e.labels=this.labels.slice(),e.commentsLen=this.commentsLen,e.commentStack=this.commentStack.slice(),e.pos=this.pos,e.type=this.type,e.value=this.value,e.start=this.start,e.end=this.end,e.lastTokEndLoc=this.lastTokEndLoc,e.lastTokStartLoc=this.lastTokStartLoc,e.context=this.context.slice(),e.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,e.strictErrors=this.strictErrors,e.tokensLength=this.tokensLength,e}},Dpe=function(e){return e>=48&&e<=57},Lh={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Us={bin:o=>o===48||o===49,oct:o=>o>=48&&o<=55,dec:o=>o>=48&&o<=57,hex:o=>o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102};function Dh(o,e,t,r,s,a){let p=t,u=r,f=s,m="",x=null,g=t,{length:z}=e;for(;;){if(t>=z){a.unterminated(p,u,f),m+=e.slice(g,t);break}let w=e.charCodeAt(t);if(vpe(o,w,e,t)){m+=e.slice(g,t);break}if(w===92){m+=e.slice(g,t);let k=Fpe(e,t,r,s,o==="template",a);k.ch===null&&!x?x={pos:t,lineStart:r,curLine:s}:m+=k.ch,{pos:t,lineStart:r,curLine:s}=k,g=t}else w===8232||w===8233?(++t,++s,r=t):w===10||w===13?o==="template"?(m+=e.slice(g,t)+`
7
+ `,++t,w===13&&e.charCodeAt(t)===10&&++t,++s,g=r=t):a.unterminated(p,u,f):++t}return{pos:t,str:m,firstInvalidLoc:x,lineStart:r,curLine:s,containsInvalid:!!x}}function vpe(o,e,t,r){return o==="template"?e===96||e===36&&t.charCodeAt(r+1)===123:e===(o==="double"?34:39)}function Fpe(o,e,t,r,s,a){let p=!s;e++;let u=m=>({pos:e,ch:m,lineStart:t,curLine:r}),f=o.charCodeAt(e++);switch(f){case 110:return u(`
8
+ `);case 114:return u("\r");case 120:{let m;return{code:m,pos:e}=wc(o,e,t,r,2,!1,p,a),u(m===null?null:String.fromCharCode(m))}case 117:{let m;return{code:m,pos:e}=Qh(o,e,t,r,p,a),u(m===null?null:String.fromCodePoint(m))}case 116:return u(" ");case 98:return u("\b");case 118:return u("\v");case 102:return u("\f");case 13:o.charCodeAt(e)===10&&++e;case 10:t=e,++r;case 8232:case 8233:return u("");case 56:case 57:if(s)return u(null);a.strictNumericEscape(e-1,t,r);default:if(f>=48&&f<=55){let m=e-1,g=/^[0-7]+/.exec(o.slice(m,e+2))[0],z=parseInt(g,8);z>255&&(g=g.slice(0,-1),z=parseInt(g,8)),e+=g.length-1;let w=o.charCodeAt(e);if(g!=="0"||w===56||w===57){if(s)return u(null);a.strictNumericEscape(m,t,r)}return u(String.fromCharCode(z))}return u(String.fromCharCode(f))}}function wc(o,e,t,r,s,a,p,u){let f=e,m;return{n:m,pos:e}=Yh(o,e,t,r,16,s,a,!1,u,!p),m===null&&(p?u.invalidEscapeSequence(f,t,r):e=f-1),{code:m,pos:e}}function Yh(o,e,t,r,s,a,p,u,f,m){let x=e,g=s===16?Lh.hex:Lh.decBinOct,z=s===16?Us.hex:s===10?Us.dec:s===8?Us.oct:Us.bin,w=!1,k=0;for(let F=0,Y=a??1/0;F<Y;++F){let W=o.charCodeAt(e),ee;if(W===95&&u!=="bail"){let de=o.charCodeAt(e-1),Te=o.charCodeAt(e+1);if(u){if(Number.isNaN(Te)||!z(Te)||g.has(de)||g.has(Te)){if(m)return{n:null,pos:e};f.unexpectedNumericSeparator(e,t,r)}}else{if(m)return{n:null,pos:e};f.numericSeparatorInEscapeSequence(e,t,r)}++e;continue}if(W>=97?ee=W-97+10:W>=65?ee=W-65+10:Dpe(W)?ee=W-48:ee=1/0,ee>=s){if(ee<=9&&m)return{n:null,pos:e};if(ee<=9&&f.invalidDigit(e,t,r,s))ee=0;else if(p)ee=0,w=!0;else break}++e,k=k*s+ee}return e===x||a!=null&&e-x!==a||w?{n:null,pos:e}:{n:k,pos:e}}function Qh(o,e,t,r,s,a){let p=o.charCodeAt(e),u;if(p===123){if(++e,{code:u,pos:e}=wc(o,e,t,r,o.indexOf("}",e)-e,!0,s,a),++e,u!==null&&u>1114111)if(s)a.invalidCodePoint(e,t,r);else return{code:null,pos:e}}else({code:u,pos:e}=wc(o,e,t,r,4,!1,s,a));return{code:u,pos:e}}function cr(o,e,t){return new At(t,o-e,o)}var Npe=new Set([103,109,115,105,121,117,100,118]),bt=class{constructor(e){let t=e.startIndex||0;this.type=e.type,this.value=e.value,this.start=t+e.start,this.end=t+e.end,this.loc=new zo(e.startLoc,e.endLoc)}},Oc=class extends Ic{constructor(e,t){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(r,s,a,p)=>this.optionFlags&2048?(this.raise(R.InvalidDigit,cr(r,s,a),{radix:p}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(R.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(R.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(R.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(R.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(r,s,a)=>{this.recordStrictModeErrors(R.StrictNumericEscape,cr(r,s,a))},unterminated:(r,s,a)=>{throw this.raise(R.UnterminatedString,cr(r-1,s,a))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(R.StrictNumericEscape),unterminated:(r,s,a)=>{throw this.raise(R.UnterminatedTemplate,cr(r,s,a))}}),this.state=new Rc,this.state.init(e),this.input=t,this.length=t.length,this.comments=[],this.isLookahead=!1}pushToken(e){this.tokens.length=this.state.tokensLength,this.tokens.push(e),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&256&&this.pushToken(new bt(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(e){return this.match(e)?(this.next(),!0):!1}match(e){return this.state.type===e}createLookaheadState(e){return{pos:e.pos,value:null,type:e.type,start:e.start,end:e.end,context:[this.curContext()],inType:e.inType,startLoc:e.startLoc,lastTokEndLoc:e.lastTokEndLoc,curLine:e.curLine,lineStart:e.lineStart,curPosition:e.curPosition}}lookahead(){let e=this.state;this.state=this.createLookaheadState(e),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let t=this.state;return this.state=e,t}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(e){return hc.lastIndex=e,hc.test(this.input)?hc.lastIndex:e}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(e){return this.input.charCodeAt(this.nextTokenStartSince(e))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(e){return fc.lastIndex=e,fc.test(this.input)?fc.lastIndex:e}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(e){let t=this.input.charCodeAt(e);if((t&64512)===55296&&++e<this.input.length){let r=this.input.charCodeAt(e);(r&64512)===56320&&(t=65536+((t&1023)<<10)+(r&1023))}return t}setStrict(e){this.state.strict=e,e&&(this.state.strictErrors.forEach(([t,r])=>this.raise(t,r)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(140);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(e){let t;this.isLookahead||(t=this.state.curPosition());let r=this.state.pos,s=this.input.indexOf(e,r+2);if(s===-1)throw this.raise(R.UnterminatedComment,this.state.curPosition());for(this.state.pos=s+e.length,Vs.lastIndex=r+2;Vs.test(this.input)&&Vs.lastIndex<=s;)++this.state.curLine,this.state.lineStart=Vs.lastIndex;if(this.isLookahead)return;let a={type:"CommentBlock",value:this.input.slice(r+2,s),start:this.sourceToOffsetPos(r),end:this.sourceToOffsetPos(s+e.length),loc:new zo(t,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(a),a}skipLineComment(e){let t=this.state.pos,r;this.isLookahead||(r=this.state.curPosition());let s=this.input.charCodeAt(this.state.pos+=e);if(this.state.pos<this.length)for(;!Ao(s)&&++this.state.pos<this.length;)s=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let a=this.state.pos,u={type:"CommentLine",value:this.input.slice(t+e,a),start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(a),loc:new zo(r,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(u),u}skipSpace(){let e=this.state.pos,t=this.optionFlags&4096?[]:null;e:for(;this.state.pos<this.length;){let r=this.input.charCodeAt(this.state.pos);switch(r){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let s=this.skipBlockComment("*/");s!==void 0&&(this.addComment(s),t?.push(s));break}case 47:{let s=this.skipLineComment(2);s!==void 0&&(this.addComment(s),t?.push(s));break}default:break e}break;default:if(kpe(r))++this.state.pos;else if(r===45&&!this.inModule&&this.optionFlags&8192){let s=this.state.pos;if(this.input.charCodeAt(s+1)===45&&this.input.charCodeAt(s+2)===62&&(e===0||this.state.lineStart>e)){let a=this.skipLineComment(3);a!==void 0&&(this.addComment(a),t?.push(a))}else break e}else if(r===60&&!this.inModule&&this.optionFlags&8192){let s=this.state.pos;if(this.input.charCodeAt(s+1)===33&&this.input.charCodeAt(s+2)===45&&this.input.charCodeAt(s+3)===45){let a=this.skipLineComment(4);a!==void 0&&(this.addComment(a),t?.push(a))}else break e}else break e}}if(t?.length>0){let r=this.state.pos,s={start:this.sourceToOffsetPos(e),end:this.sourceToOffsetPos(r),comments:t,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(s)}}finishToken(e,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let r=this.state.type;this.state.type=e,this.state.value=t,this.isLookahead||this.updateContext(r)}replaceToken(e){this.state.type=e,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let e=this.state.pos+1,t=this.codePointAtPos(e);if(t>=48&&t<=57)throw this.raise(R.UnexpectedDigitAfterHash,this.state.curPosition());if(t===123||t===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(t===123?R.RecordExpressionHashIncorrectStartSyntaxType:R.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,t===123?this.finishToken(7):this.finishToken(1)}else yt(t)?(++this.state.pos,this.finishToken(139,this.readWord1(t))):t===92?(++this.state.pos,this.finishToken(139,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let e=this.input.charCodeAt(this.state.pos+1);if(e>=48&&e<=57){this.readNumber(!0);return}e===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let e=this.input.charCodeAt(this.state.pos+1);if(e!==33)return!1;let t=this.state.pos;for(this.state.pos+=1;!Ao(e)&&++this.state.pos<this.length;)e=this.input.charCodeAt(this.state.pos);let r=this.input.slice(t+2,this.state.pos);return this.finishToken(28,r),!0}readToken_mult_modulo(e){let t=e===42?55:54,r=1,s=this.input.charCodeAt(this.state.pos+1);e===42&&s===42&&(r++,s=this.input.charCodeAt(this.state.pos+2),t=57),s===61&&!this.state.inType&&(r++,t=e===37?33:30),this.finishOp(t,r)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===e){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(30,3):this.finishOp(e===124?41:42,2);return}if(e===124){if(t===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&t===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(R.RecordExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&t===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(R.TupleExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(4);return}}if(t===61){this.finishOp(30,2);return}this.finishOp(e===124?43:45,1)}readToken_caret(){let e=this.input.charCodeAt(this.state.pos+1);e===61&&!this.state.inType?this.finishOp(32,2):e===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])?(this.finishOp(37,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(44,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}])?this.finishOp(38,2):this.finishOp(26,1)}readToken_plus_min(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===e){this.finishOp(34,2);return}t===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){let{pos:e}=this.state,t=this.input.charCodeAt(e+1);if(t===60){if(this.input.charCodeAt(e+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(t===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){let{pos:e}=this.state,t=this.input.charCodeAt(e+1);if(t===62){let r=this.input.charCodeAt(e+2)===62?3:2;if(this.input.charCodeAt(e+r)===61){this.finishOp(30,r+1);return}this.finishOp(52,r);return}if(t===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(e===61&&t===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(e===61?29:35,1)}readToken_question(){let e=this.input.charCodeAt(this.state.pos+1),t=this.input.charCodeAt(this.state.pos+2);e===63?t===61?this.finishOp(30,3):this.finishOp(40,2):e===46&&!(t>=48&&t<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(e){switch(e){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(R.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(R.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let t=this.input.charCodeAt(this.state.pos+1);if(t===120||t===88){this.readRadixNumber(16);return}if(t===111||t===79){this.readRadixNumber(8);return}if(t===98||t===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(e);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(e);return;case 124:case 38:this.readToken_pipe_amp(e);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(e);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(e);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(yt(e)){this.readWord(e);return}}throw this.raise(R.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(e)})}finishOp(e,t){let r=this.input.slice(this.state.pos,this.state.pos+t);this.state.pos+=t,this.finishToken(e,r)}readRegexp(){let e=this.state.startLoc,t=this.state.start+1,r,s,{pos:a}=this.state;for(;;++a){if(a>=this.length)throw this.raise(R.UnterminatedRegExp,je(e,1));let m=this.input.charCodeAt(a);if(Ao(m))throw this.raise(R.UnterminatedRegExp,je(e,1));if(r)r=!1;else{if(m===91)s=!0;else if(m===93&&s)s=!1;else if(m===47&&!s)break;r=m===92}}let p=this.input.slice(t,a);++a;let u="",f=()=>je(e,a+2-t);for(;a<this.length;){let m=this.codePointAtPos(a),x=String.fromCharCode(m);if(Npe.has(m))m===118?u.includes("u")&&this.raise(R.IncompatibleRegExpUVFlags,f()):m===117&&u.includes("v")&&this.raise(R.IncompatibleRegExpUVFlags,f()),u.includes(x)&&this.raise(R.DuplicateRegExpFlags,f());else if(Kt(m)||m===92)this.raise(R.MalformedRegExpFlags,f());else break;++a,u+=x}this.state.pos=a,this.finishToken(138,{pattern:p,flags:u})}readInt(e,t,r=!1,s=!0){let{n:a,pos:p}=Yh(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,t,r,s,this.errorHandlers_readInt,!1);return this.state.pos=p,a}readRadixNumber(e){let t=this.state.pos,r=this.state.curPosition(),s=!1;this.state.pos+=2;let a=this.readInt(e);a==null&&this.raise(R.InvalidDigit,je(r,2),{radix:e});let p=this.input.charCodeAt(this.state.pos);if(p===110)++this.state.pos,s=!0;else if(p===109)throw this.raise(R.InvalidDecimal,r);if(yt(this.codePointAtPos(this.state.pos)))throw this.raise(R.NumberIdentifier,this.state.curPosition());if(s){let u=this.input.slice(t,this.state.pos).replace(/[_n]/g,"");this.finishToken(136,u);return}this.finishToken(135,a)}readNumber(e){let t=this.state.pos,r=this.state.curPosition(),s=!1,a=!1,p=!1,u=!1;!e&&this.readInt(10)===null&&this.raise(R.InvalidNumber,this.state.curPosition());let f=this.state.pos-t>=2&&this.input.charCodeAt(t)===48;if(f){let w=this.input.slice(t,this.state.pos);if(this.recordStrictModeErrors(R.StrictOctalLiteral,r),!this.state.strict){let k=w.indexOf("_");k>0&&this.raise(R.ZeroDigitNumericSeparator,je(r,k))}u=f&&!/[89]/.test(w)}let m=this.input.charCodeAt(this.state.pos);if(m===46&&!u&&(++this.state.pos,this.readInt(10),s=!0,m=this.input.charCodeAt(this.state.pos)),(m===69||m===101)&&!u&&(m=this.input.charCodeAt(++this.state.pos),(m===43||m===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(R.InvalidOrMissingExponent,r),s=!0,p=!0,m=this.input.charCodeAt(this.state.pos)),m===110&&((s||f)&&this.raise(R.InvalidBigIntLiteral,r),++this.state.pos,a=!0),m===109){this.expectPlugin("decimal",this.state.curPosition()),(p||f)&&this.raise(R.InvalidDecimal,r),++this.state.pos;var x=!0}if(yt(this.codePointAtPos(this.state.pos)))throw this.raise(R.NumberIdentifier,this.state.curPosition());let g=this.input.slice(t,this.state.pos).replace(/[_mn]/g,"");if(a){this.finishToken(136,g);return}if(x){this.finishToken(137,g);return}let z=u?parseInt(g,8):parseFloat(g);this.finishToken(135,z)}readCodePoint(e){let{code:t,pos:r}=Qh(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,this.errorHandlers_readCodePoint);return this.state.pos=r,t}readString(e){let{str:t,pos:r,curLine:s,lineStart:a}=Dh(e===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=r+1,this.state.lineStart=a,this.state.curLine=s,this.finishToken(134,t)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let e=this.input[this.state.pos],{str:t,firstInvalidLoc:r,pos:s,curLine:a,lineStart:p}=Dh("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=s+1,this.state.lineStart=p,this.state.curLine=a,r&&(this.state.firstInvalidTemplateEscapePos=new At(r.curLine,r.pos-r.lineStart,this.sourceToOffsetPos(r.pos))),this.input.codePointAt(s)===96?this.finishToken(24,r?null:e+t+"`"):(this.state.pos++,this.finishToken(25,r?null:e+t+"${"))}recordStrictModeErrors(e,t){let r=t.index;this.state.strict&&!this.state.strictErrors.has(r)?this.raise(e,t):this.state.strictErrors.set(r,[e,t])}readWord1(e){this.state.containsEsc=!1;let t="",r=this.state.pos,s=this.state.pos;for(e!==void 0&&(this.state.pos+=e<=65535?1:2);this.state.pos<this.length;){let a=this.codePointAtPos(this.state.pos);if(Kt(a))this.state.pos+=a<=65535?1:2;else if(a===92){this.state.containsEsc=!0,t+=this.input.slice(s,this.state.pos);let p=this.state.curPosition(),u=this.state.pos===r?yt:Kt;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(R.MissingUnicodeEscape,this.state.curPosition()),s=this.state.pos-1;continue}++this.state.pos;let f=this.readCodePoint(!0);f!==null&&(u(f)||this.raise(R.EscapedCharNotAnIdentifier,p),t+=String.fromCodePoint(f)),s=this.state.pos}else break}return t+this.input.slice(s,this.state.pos)}readWord(e){let t=this.readWord1(e),r=jc.get(t);r!==void 0?this.finishToken(r,Ft(r)):this.finishToken(132,t)}checkKeywordEscapes(){let{type:e}=this.state;Gc(e)&&this.state.containsEsc&&this.raise(R.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:Ft(e)})}raise(e,t,r={}){let s=t instanceof At?t:t.loc.start,a=e(s,r);if(!(this.optionFlags&2048))throw a;return this.isLookahead||this.state.errors.push(a),a}raiseOverwrite(e,t,r={}){let s=t instanceof At?t:t.loc.start,a=s.index,p=this.state.errors;for(let u=p.length-1;u>=0;u--){let f=p[u];if(f.loc.index===a)return p[u]=e(s,r);if(f.loc.index<a)break}return this.raise(e,t,r)}updateContext(e){}unexpected(e,t){throw this.raise(R.UnexpectedToken,e??this.state.startLoc,{expected:t?Ft(t):null})}expectPlugin(e,t){if(this.hasPlugin(e))return!0;throw this.raise(R.MissingPlugin,t??this.state.startLoc,{missingPlugin:[e]})}expectOnePlugin(e){if(!e.some(t=>this.hasPlugin(t)))throw this.raise(R.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:e})}errorBuilder(e){return(t,r,s)=>{this.raise(e,cr(t,r,s))}}},Mc=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},kc=class{constructor(e){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=e}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Mc)}exit(){let e=this.stack.pop(),t=this.current();for(let[r,s]of Array.from(e.undefinedPrivateNames))t?t.undefinedPrivateNames.has(r)||t.undefinedPrivateNames.set(r,s):this.parser.raise(R.InvalidPrivateFieldResolution,s,{identifierName:r})}declarePrivateName(e,t,r){let{privateNames:s,loneAccessors:a,undefinedPrivateNames:p}=this.current(),u=s.has(e);if(t&3){let f=u&&a.get(e);if(f){let m=f&4,x=t&4,g=f&3,z=t&3;u=g===z||m!==x,u||a.delete(e)}else u||a.set(e,t)}u&&this.parser.raise(R.PrivateNameRedeclaration,r,{identifierName:e}),s.add(e),p.delete(e)}usePrivateName(e,t){let r;for(r of this.stack)if(r.privateNames.has(e))return;r?r.undefinedPrivateNames.set(e,t):this.parser.raise(R.InvalidPrivateFieldResolution,t,{identifierName:e})}},To=class{constructor(e=0){this.type=e}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},qs=class extends To{constructor(e){super(e),this.declarationErrors=new Map}recordDeclarationError(e,t){let r=t.index;this.declarationErrors.set(r,[e,t])}clearDeclarationError(e){this.declarationErrors.delete(e)}iterateErrors(e){this.declarationErrors.forEach(e)}},Pc=class{constructor(e){this.parser=void 0,this.stack=[new To],this.parser=e}enter(e){this.stack.push(e)}exit(){this.stack.pop()}recordParameterInitializerError(e,t){let r=t.loc.start,{stack:s}=this,a=s.length-1,p=s[a];for(;!p.isCertainlyParameterDeclaration();){if(p.canBeArrowParameterDeclaration())p.recordDeclarationError(e,r);else return;p=s[--a]}this.parser.raise(e,r)}recordArrowParameterBindingError(e,t){let{stack:r}=this,s=r[r.length-1],a=t.loc.start;if(s.isCertainlyParameterDeclaration())this.parser.raise(e,a);else if(s.canBeArrowParameterDeclaration())s.recordDeclarationError(e,a);else return}recordAsyncArrowParametersError(e){let{stack:t}=this,r=t.length-1,s=t[r];for(;s.canBeArrowParameterDeclaration();)s.type===2&&s.recordDeclarationError(R.AwaitBindingIdentifier,e),s=t[--r]}validateAsPattern(){let{stack:e}=this,t=e[e.length-1];t.canBeArrowParameterDeclaration()&&t.iterateErrors(([r,s])=>{this.parser.raise(r,s);let a=e.length-2,p=e[a];for(;p.canBeArrowParameterDeclaration();)p.clearDeclarationError(s.index),p=e[--a]})}};function _pe(){return new To(3)}function Bpe(){return new qs(1)}function jpe(){return new qs(2)}function Jh(){return new To}var Lc=class extends Oc{addExtra(e,t,r,s=!0){if(!e)return;let{extra:a}=e;a==null&&(a={},e.extra=a),s?a[t]=r:Object.defineProperty(a,t,{enumerable:s,value:r})}isContextual(e){return this.state.type===e&&!this.state.containsEsc}isUnparsedContextual(e,t){if(this.input.startsWith(t,e)){let r=this.input.charCodeAt(e+t.length);return!(Kt(r)||(r&64512)===55296)}return!1}isLookaheadContextual(e){let t=this.nextTokenStart();return this.isUnparsedContextual(t,e)}eatContextual(e){return this.isContextual(e)?(this.next(),!0):!1}expectContextual(e,t){if(!this.eatContextual(e)){if(t!=null)throw this.raise(t,this.state.startLoc);this.unexpected(null,e)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Ph(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return Ph(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(e=!0){(e?this.isLineTerminator():this.eat(13))||this.raise(R.MissingSemicolon,this.state.lastTokEndLoc)}expect(e,t){this.eat(e)||this.unexpected(t,e)}tryParse(e,t=this.state.clone()){let r={node:null};try{let s=e((a=null)=>{throw r.node=a,r});if(this.state.errors.length>t.errors.length){let a=this.state;return this.state=t,this.state.tokensLength=a.tokensLength,{node:s,error:a.errors[t.errors.length],thrown:!1,aborted:!1,failState:a}}return{node:s,error:null,thrown:!1,aborted:!1,failState:null}}catch(s){let a=this.state;if(this.state=t,s instanceof SyntaxError)return{node:null,error:s,thrown:!0,aborted:!1,failState:a};if(s===r)return{node:r.node,error:null,thrown:!1,aborted:!0,failState:a};throw s}}checkExpressionErrors(e,t){if(!e)return!1;let{shorthandAssignLoc:r,doubleProtoLoc:s,privateKeyLoc:a,optionalParametersLoc:p,voidPatternLoc:u}=e,f=!!r||!!s||!!p||!!a||!!u;if(!t)return f;r!=null&&this.raise(R.InvalidCoverInitializedName,r),s!=null&&this.raise(R.DuplicateProto,s),a!=null&&this.raise(R.UnexpectedPrivateField,a),p!=null&&this.unexpected(p),u!=null&&this.raise(R.InvalidCoverDiscardElement,u)}isLiteralPropertyName(){return Vh(this.state.type)}isPrivateName(e){return e.type==="PrivateName"}getPrivateNameSV(e){return e.id.name}hasPropertyAsPrivateName(e){return(e.type==="MemberExpression"||e.type==="OptionalMemberExpression")&&this.isPrivateName(e.property)}isObjectProperty(e){return e.type==="ObjectProperty"}isObjectMethod(e){return e.type==="ObjectMethod"}initializeScopes(e=this.options.sourceType==="module"){let t=this.state.labels;this.state.labels=[];let r=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let s=this.inModule;this.inModule=e;let a=this.scope,p=this.getScopeHandler();this.scope=new p(this,e);let u=this.prodParam;this.prodParam=new Ec;let f=this.classScope;this.classScope=new kc(this);let m=this.expressionScope;return this.expressionScope=new Pc(this),()=>{this.state.labels=t,this.exportedIdentifiers=r,this.inModule=s,this.scope=a,this.prodParam=u,this.classScope=f,this.expressionScope=m}}enterInitialScopes(){let e=0;(this.inModule||this.optionFlags&1)&&(e|=2),this.optionFlags&32&&(e|=1);let t=!this.inModule&&this.options.sourceType==="commonjs";(t||this.optionFlags&2)&&(e|=4),this.prodParam.enter(e);let r=t?514:1;this.optionFlags&4&&(r|=512),this.scope.enter(r)}checkDestructuringPrivate(e){let{privateKeyLoc:t}=e;t!==null&&this.expectPlugin("destructuringPrivate",t)}},So=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null,this.voidPatternLoc=null}},Eo=class{constructor(e,t,r){this.type="",this.start=t,this.end=0,this.loc=new zo(r),e?.optionFlags&128&&(this.range=[t,0]),e!=null&&e.filename&&(this.loc.filename=e.filename)}},Dc=Eo.prototype;Dc.__clone=function(){let o=new Eo(void 0,this.start,this.loc.start),e=Object.keys(this);for(let t=0,r=e.length;t<r;t++){let s=e[t];s!=="leadingComments"&&s!=="trailingComments"&&s!=="innerComments"&&(o[s]=this[s])}return o};var vc=class extends Lc{startNode(){let e=this.state.startLoc;return new Eo(this,e.index,e)}startNodeAt(e){return new Eo(this,e.index,e)}startNodeAtNode(e){return this.startNodeAt(e.loc.start)}finishNode(e,t){return this.finishNodeAt(e,t,this.state.lastTokEndLoc)}finishNodeAt(e,t,r){return e.type=t,e.end=r.index,e.loc.end=r,this.optionFlags&128&&(e.range[1]=r.index),this.optionFlags&4096&&this.processComment(e),e}resetStartLocation(e,t){e.start=t.index,e.loc.start=t,this.optionFlags&128&&(e.range[0]=t.index)}resetEndLocation(e,t=this.state.lastTokEndLoc){e.end=t.index,e.loc.end=t,this.optionFlags&128&&(e.range[1]=t.index)}resetStartLocationFromNode(e,t){this.resetStartLocation(e,t.loc.start)}castNodeTo(e,t){return e.type=t,e}cloneIdentifier(e){let{type:t,start:r,end:s,loc:a,range:p,name:u}=e,f=Object.create(Dc);return f.type=t,f.start=r,f.end=s,f.loc=a,f.range=p,f.name=u,e.extra&&(f.extra=e.extra),f}cloneStringLiteral(e){let{type:t,start:r,end:s,loc:a,range:p,extra:u}=e,f=Object.create(Dc);return f.type=t,f.start=r,f.end=s,f.loc=a,f.range=p,f.extra=u,f.value=e.value,f}},Fc=o=>o.type==="ParenthesizedExpression"?Fc(o.expression):o,Nc=class extends vc{toAssignable(e,t=!1){var r,s;let a;switch((e.type==="ParenthesizedExpression"||(r=e.extra)!=null&&r.parenthesized)&&(a=Fc(e),t?a.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(R.InvalidParenthesizedAssignment,e):a.type!=="CallExpression"&&a.type!=="MemberExpression"&&!this.isOptionalMemberExpression(a)&&this.raise(R.InvalidParenthesizedAssignment,e):this.raise(R.InvalidParenthesizedAssignment,e)),e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":break;case"ObjectExpression":this.castNodeTo(e,"ObjectPattern");for(let u=0,f=e.properties.length,m=f-1;u<f;u++){var p;let x=e.properties[u],g=u===m;this.toAssignableObjectExpressionProp(x,g,t),g&&x.type==="RestElement"&&(p=e.extra)!=null&&p.trailingCommaLoc&&this.raise(R.RestTrailingComma,e.extra.trailingCommaLoc)}break;case"ObjectProperty":{let{key:u,value:f}=e;this.isPrivateName(u)&&this.classScope.usePrivateName(this.getPrivateNameSV(u),u.loc.start),this.toAssignable(f,t);break}case"SpreadElement":throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");case"ArrayExpression":this.castNodeTo(e,"ArrayPattern"),this.toAssignableList(e.elements,(s=e.extra)==null?void 0:s.trailingCommaLoc,t);break;case"AssignmentExpression":e.operator!=="="&&this.raise(R.MissingEqInAssignment,e.left.loc.end),this.castNodeTo(e,"AssignmentPattern"),delete e.operator,e.left.type==="VoidPattern"&&this.raise(R.VoidPatternInitializer,e.left),this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(a,t);break}}toAssignableObjectExpressionProp(e,t,r){if(e.type==="ObjectMethod")this.raise(e.kind==="get"||e.kind==="set"?R.PatternHasAccessor:R.PatternHasMethod,e.key);else if(e.type==="SpreadElement"){this.castNodeTo(e,"RestElement");let s=e.argument;this.checkToRestConversion(s,!1),this.toAssignable(s,r),t||this.raise(R.RestTrailingComma,e)}else this.toAssignable(e,r)}toAssignableList(e,t,r){let s=e.length-1;for(let a=0;a<=s;a++){let p=e[a];p&&(this.toAssignableListItem(e,a,r),p.type==="RestElement"&&(a<s?this.raise(R.RestTrailingComma,p):t&&this.raise(R.RestTrailingComma,t)))}}toAssignableListItem(e,t,r){let s=e[t];if(s.type==="SpreadElement"){this.castNodeTo(s,"RestElement");let a=s.argument;this.checkToRestConversion(a,!0),this.toAssignable(a,r)}else this.toAssignable(s,r)}isAssignable(e,t){switch(e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":return!0;case"ObjectExpression":{let r=e.properties.length-1;return e.properties.every((s,a)=>s.type!=="ObjectMethod"&&(a===r||s.type!=="SpreadElement")&&this.isAssignable(s))}case"ObjectProperty":return this.isAssignable(e.value);case"SpreadElement":return this.isAssignable(e.argument);case"ArrayExpression":return e.elements.every(r=>r===null||this.isAssignable(r));case"AssignmentExpression":return e.operator==="=";case"ParenthesizedExpression":return this.isAssignable(e.expression);case"MemberExpression":case"OptionalMemberExpression":return!t;default:return!1}}toReferencedList(e,t){return e}toReferencedListDeep(e,t){this.toReferencedList(e,t);for(let r of e)r?.type==="ArrayExpression"&&this.toReferencedListDeep(r.elements)}parseSpread(e){let t=this.startNode();return this.next(),t.argument=this.parseMaybeAssignAllowIn(e,void 0),this.finishNode(t,"SpreadElement")}parseRestBinding(){let e=this.startNode();this.next();let t=this.parseBindingAtom();return t.type==="VoidPattern"&&this.raise(R.UnexpectedVoidPattern,t),e.argument=t,this.finishNode(e,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let e=this.startNode();return this.next(),e.elements=this.parseBindingList(3,93,1),this.finishNode(e,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0);case 88:return this.parseVoidPattern(null)}return this.parseIdentifier()}parseBindingList(e,t,r){let s=r&1,a=[],p=!0;for(;!this.eat(e);)if(p?p=!1:this.expect(12),s&&this.match(12))a.push(null);else{if(this.eat(e))break;if(this.match(21)){let u=this.parseRestBinding();if((this.hasPlugin("flow")||r&2)&&(u=this.parseFunctionParamType(u)),a.push(u),!this.checkCommaAfterRest(t)){this.expect(e);break}}else{let u=[];if(r&2)for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(R.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)u.push(this.parseDecorator());a.push(this.parseBindingElement(r,u))}}return a}parseBindingRestProperty(e){return this.next(),this.hasPlugin("discardBinding")&&this.match(88)?(e.argument=this.parseVoidPattern(null),this.raise(R.UnexpectedVoidPattern,e.argument)):e.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(e,"RestElement")}parseBindingProperty(){let{type:e,startLoc:t}=this.state;if(e===21)return this.parseBindingRestProperty(this.startNode());let r=this.startNode();return e===139?(this.expectPlugin("destructuringPrivate",t),this.classScope.usePrivateName(this.state.value,t),r.key=this.parsePrivateName()):this.parsePropertyName(r),r.method=!1,this.parseObjPropValue(r,t,!1,!1,!0,!1)}parseBindingElement(e,t){let r=this.parseMaybeDefault();return(this.hasPlugin("flow")||e&2)&&this.parseFunctionParamType(r),t.length&&(r.decorators=t,this.resetStartLocationFromNode(r,t[0])),this.parseMaybeDefault(r.loc.start,r)}parseFunctionParamType(e){return e}parseMaybeDefault(e,t){if(e??(e=this.state.startLoc),t=t??this.parseBindingAtom(),!this.eat(29))return t;let r=this.startNodeAt(e);return t.type==="VoidPattern"&&this.raise(R.VoidPatternInitializer,t),r.left=t,r.right=this.parseMaybeAssignAllowIn(),this.finishNode(r,"AssignmentPattern")}isValidLVal(e,t,r,s){switch(e){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties";case"VoidPattern":return!0;case"CallExpression":if(!t&&!this.state.strict&&this.optionFlags&8192)return!0}return!1}isOptionalMemberExpression(e){return e.type==="OptionalMemberExpression"}checkLVal(e,t,r=64,s=!1,a=!1,p=!1,u=!1){var f;let m=e.type;if(this.isObjectMethod(e))return;let x=this.isOptionalMemberExpression(e);if(x||m==="MemberExpression"){x&&(this.expectPlugin("optionalChainingAssign",e.loc.start),t.type!=="AssignmentExpression"&&this.raise(R.InvalidLhsOptionalChaining,e,{ancestor:t})),r!==64&&this.raise(R.InvalidPropertyBindingPattern,e);return}if(m==="Identifier"){this.checkIdentifier(e,r,a);let{name:W}=e;s&&(s.has(W)?this.raise(R.ParamDupe,e):s.add(W));return}else m==="VoidPattern"&&t.type==="CatchClause"&&this.raise(R.VoidPatternCatchClauseParam,e);let g=Fc(e);u||(u=g.type==="CallExpression"&&(g.callee.type==="Import"||g.callee.type==="Super"));let z=this.isValidLVal(m,u,!(p||(f=e.extra)!=null&&f.parenthesized)&&t.type==="AssignmentExpression",r);if(z===!0)return;if(z===!1){let W=r===64?R.InvalidLhs:R.InvalidLhsBinding;this.raise(W,e,{ancestor:t});return}let w,k;typeof z=="string"?(w=z,k=m==="ParenthesizedExpression"):[w,k]=z;let F=m==="ArrayPattern"||m==="ObjectPattern"?{type:m}:t,Y=e[w];if(Array.isArray(Y))for(let W of Y)W&&this.checkLVal(W,F,r,s,a,k,!0);else Y&&this.checkLVal(Y,F,r,s,a,k,u)}checkIdentifier(e,t,r=!1){this.state.strict&&(r?Kh(e.name,this.inModule):Gh(e.name))&&(t===64?this.raise(R.StrictEvalArguments,e,{referenceName:e.name}):this.raise(R.StrictEvalArgumentsBinding,e,{bindingName:e.name})),t&8192&&e.name==="let"&&this.raise(R.LetInLexicalBinding,e),t&64||this.declareNameFromIdentifier(e,t)}declareNameFromIdentifier(e,t){this.scope.declareName(e.name,t,e.loc.start)}checkToRestConversion(e,t){switch(e.type){case"ParenthesizedExpression":this.checkToRestConversion(e.expression,t);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(t)break;default:this.raise(R.InvalidRestAssignmentPattern,e)}}checkCommaAfterRest(e){return this.match(12)?(this.raise(this.lookaheadCharCode()===e?R.RestTrailingComma:R.ElementAfterRest,this.state.startLoc),!0):!1}},xc=/in(?:stanceof)?|as|satisfies/y;function Vpe(o){if(o==null)throw new Error(`Unexpected ${o} value.`);return o}function vh(o){if(!o)throw new Error("Assert fail")}var $=ct`typescript`({AbstractMethodHasImplementation:({methodName:o})=>`Method '${o}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:o})=>`Property '${o}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:o})=>`'declare' is not allowed in ${o}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:o})=>`Accessibility modifier already seen: '${o}'.`,DuplicateModifier:({modifier:o})=>`Duplicate modifier: '${o}'.`,EmptyHeritageClauseType:({token:o})=>`'${o}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:o})=>`'${o[0]}' modifier cannot be used with '${o[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:o})=>`Index signatures cannot have an accessibility modifier ('${o}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidHeritageClauseType:({token:o})=>`'${o}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:o=>`'${o}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:o})=>`'${o}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:o})=>`'${o}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:o})=>`'${o}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:o=>`'${o}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:o})=>`'${o[0]}' modifier must precede '${o[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifier:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:o})=>`Private elements cannot have an accessibility modifier ('${o}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:o})=>`Single type parameter ${o} should have a trailing comma. Example usage: <${o},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:o})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${o}.`,UsingDeclarationInAmbientContext:o=>`'${o}' declarations are not allowed in ambient contexts.`});function Upe(o){switch(o){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function Fh(o){return o==="private"||o==="public"||o==="protected"}function Hpe(o){return o==="in"||o==="out"}var Wpe=o=>class extends o{constructor(...t){super(...t),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:$.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:$.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:$.InvalidModifierOnTypeParameter})}getScopeHandler(){return Tc}tsIsIdentifier(){return pe(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(t,r,s){if(!pe(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let a=this.state.value;if(t.includes(a)){if(s&&this.match(106)||r&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return a}}tsParseModifiers({allowedModifiers:t,disallowedModifiers:r,stopOnStartOfClassStaticBlock:s,errorTemplate:a=$.InvalidModifierOnTypeMember},p){let u=(m,x,g,z)=>{x===g&&p[z]&&this.raise($.InvalidModifiersOrder,m,{orderedModifiers:[g,z]})},f=(m,x,g,z)=>{(p[g]&&x===z||p[z]&&x===g)&&this.raise($.IncompatibleModifiers,m,{modifiers:[g,z]})};for(;;){let{startLoc:m}=this.state,x=this.tsParseModifier(t.concat(r??[]),s,p.static);if(!x)break;Fh(x)?p.accessibility?this.raise($.DuplicateAccessibilityModifier,m,{modifier:x}):(u(m,x,x,"override"),u(m,x,x,"static"),u(m,x,x,"readonly"),p.accessibility=x):Hpe(x)?(p[x]&&this.raise($.DuplicateModifier,m,{modifier:x}),p[x]=!0,u(m,x,"in","out")):(hasOwnProperty.call(p,x)?this.raise($.DuplicateModifier,m,{modifier:x}):(u(m,x,"static","readonly"),u(m,x,"static","override"),u(m,x,"override","readonly"),u(m,x,"abstract","override"),f(m,x,"declare","override"),f(m,x,"static","abstract")),p[x]=!0),r!=null&&r.includes(x)&&this.raise(a,m,{modifier:x})}}tsIsListTerminator(t){switch(t){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(t,r){let s=[];for(;!this.tsIsListTerminator(t);)s.push(r());return s}tsParseDelimitedList(t,r,s){return Vpe(this.tsParseDelimitedListWorker(t,r,!0,s))}tsParseDelimitedListWorker(t,r,s,a){let p=[],u=-1;for(;!this.tsIsListTerminator(t);){u=-1;let f=r();if(f==null)return;if(p.push(f),this.eat(12)){u=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(t))break;s&&this.expect(12);return}return a&&(a.value=u),p}tsParseBracketedList(t,r,s,a,p){a||(s?this.expect(0):this.expect(47));let u=this.tsParseDelimitedList(t,r,p);return s?this.expect(3):this.expect(48),u}tsParseImportType(){let t=this.startNode();return this.expect(83),this.expect(10),this.match(134)?t.argument=this.parseStringLiteral(this.state.value):(this.raise($.UnsupportedImportTypeArgument,this.state.startLoc),t.argument=super.parseExprAtom()),this.eat(12)?t.options=this.tsParseImportTypeOptions():t.options=null,this.expect(11),this.eat(16)&&(t.qualifier=this.tsParseEntityName(3)),this.match(47)&&(t.typeParameters=this.tsParseTypeArguments()),this.finishNode(t,"TSImportType")}tsParseImportTypeOptions(){let t=this.startNode();this.expect(5);let r=this.startNode();return this.isContextual(76)?(r.method=!1,r.key=this.parseIdentifier(!0),r.computed=!1,r.shorthand=!1):this.unexpected(null,76),this.expect(14),r.value=this.tsParseImportTypeWithPropertyValue(),t.properties=[this.finishObjectProperty(r)],this.eat(12),this.expect(8),this.finishNode(t,"ObjectExpression")}tsParseImportTypeWithPropertyValue(){let t=this.startNode(),r=[];for(this.expect(5);!this.match(8);){let s=this.state.type;pe(s)||s===134?r.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(12)}return t.properties=r,this.next(),this.finishNode(t,"ObjectExpression")}tsParseEntityName(t){let r;if(t&1&&this.match(78))if(t&2)r=this.parseIdentifier(!0);else{let s=this.startNode();this.next(),r=this.finishNode(s,"ThisExpression")}else r=this.parseIdentifier(!!(t&1));for(;this.eat(16);){let s=this.startNodeAtNode(r);s.left=r,s.right=this.parseIdentifier(!!(t&1)),r=this.finishNode(s,"TSQualifiedName")}return r}tsParseTypeReference(){let t=this.startNode();return t.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47)&&(t.typeParameters=this.tsParseTypeArguments()),this.finishNode(t,"TSTypeReference")}tsParseThisTypePredicate(t){this.next();let r=this.startNodeAtNode(t);return r.parameterName=t,r.typeAnnotation=this.tsParseTypeAnnotation(!1),r.asserts=!1,this.finishNode(r,"TSTypePredicate")}tsParseThisTypeNode(){let t=this.startNode();return this.next(),this.finishNode(t,"TSThisType")}tsParseTypeQuery(){let t=this.startNode();return this.expect(87),this.match(83)?t.exprName=this.tsParseImportType():t.exprName=this.tsParseEntityName(3),!this.hasPrecedingLineBreak()&&this.match(47)&&(t.typeParameters=this.tsParseTypeArguments()),this.finishNode(t,"TSTypeQuery")}tsParseTypeParameter(t){let r=this.startNode();return t(r),r.name=this.tsParseTypeParameterName(),r.constraint=this.tsEatThenParseType(81),r.default=this.tsEatThenParseType(29),this.finishNode(r,"TSTypeParameter")}tsTryParseTypeParameters(t){if(this.match(47))return this.tsParseTypeParameters(t)}tsParseTypeParameters(t){let r=this.startNode();this.match(47)||this.match(143)?this.next():this.unexpected();let s={value:-1};return r.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,t),!1,!0,s),r.params.length===0&&this.raise($.EmptyTypeParameters,r),s.value!==-1&&this.addExtra(r,"trailingComma",s.value),this.finishNode(r,"TSTypeParameterDeclaration")}tsFillSignature(t,r){let s=t===19,a="parameters",p="typeAnnotation";r.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),r[a]=this.tsParseBindingListForSignature(),s?r[p]=this.tsParseTypeOrTypePredicateAnnotation(t):this.match(t)&&(r[p]=this.tsParseTypeOrTypePredicateAnnotation(t))}tsParseBindingListForSignature(){let t=super.parseBindingList(11,41,2);for(let r of t){let{type:s}=r;(s==="AssignmentPattern"||s==="TSParameterProperty")&&this.raise($.UnsupportedSignatureParameterKind,r,{type:s})}return t}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(t,r){return this.tsFillSignature(14,r),this.tsParseTypeMemberSemicolon(),this.finishNode(r,t)}tsIsUnambiguouslyIndexSignature(){return this.next(),pe(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(t){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let r=this.parseIdentifier();r.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(r),this.expect(3),t.parameters=[r];let s=this.tsTryParseTypeAnnotation();return s&&(t.typeAnnotation=s),this.tsParseTypeMemberSemicolon(),this.finishNode(t,"TSIndexSignature")}tsParsePropertyOrMethodSignature(t,r){if(this.eat(17)&&(t.optional=!0),this.match(10)||this.match(47)){r&&this.raise($.ReadonlyForMethodSignature,t);let s=t;s.kind&&this.match(47)&&this.raise($.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,s),this.tsParseTypeMemberSemicolon();let a="parameters",p="typeAnnotation";if(s.kind==="get")s[a].length>0&&(this.raise(R.BadGetterArity,this.state.curPosition()),this.isThisParam(s[a][0])&&this.raise($.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(s.kind==="set"){if(s[a].length!==1)this.raise(R.BadSetterArity,this.state.curPosition());else{let u=s[a][0];this.isThisParam(u)&&this.raise($.AccessorCannotDeclareThisParameter,this.state.curPosition()),u.type==="Identifier"&&u.optional&&this.raise($.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),u.type==="RestElement"&&this.raise($.SetAccessorCannotHaveRestParameter,this.state.curPosition())}s[p]&&this.raise($.SetAccessorCannotHaveReturnType,s[p])}else s.kind="method";return this.finishNode(s,"TSMethodSignature")}else{let s=t;r&&(s.readonly=!0);let a=this.tsTryParseTypeAnnotation();return a&&(s.typeAnnotation=a),this.tsParseTypeMemberSemicolon(),this.finishNode(s,"TSPropertySignature")}}tsParseTypeMember(){let t=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",t);if(this.match(77)){let s=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",t):(t.key=this.createIdentifier(s,"new"),this.tsParsePropertyOrMethodSignature(t,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},t);let r=this.tsTryParseIndexSignature(t);return r||(super.parsePropertyName(t),!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&this.tsTokenCanFollowModifier()&&(t.kind=t.key.name,super.parsePropertyName(t),!this.match(10)&&!this.match(47)&&this.unexpected(null,10)),this.tsParsePropertyOrMethodSignature(t,!!t.readonly))}tsParseTypeLiteral(){let t=this.startNode();return t.members=this.tsParseObjectTypeMembers(),this.finishNode(t,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let t=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),t}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){let t=this.startNode();this.expect(5),this.match(53)?(t.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(t.readonly=!0),this.expect(0);let r=this.startNode();return r.name=this.tsParseTypeParameterName(),r.constraint=this.tsExpectThenParseType(58),t.typeParameter=this.finishNode(r,"TSTypeParameter"),t.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(t.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(t.optional=!0),t.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(t,"TSMappedType")}tsParseTupleType(){let t=this.startNode();t.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let r=!1;return t.elementTypes.forEach(s=>{let{type:a}=s;r&&a!=="TSRestType"&&a!=="TSOptionalType"&&!(a==="TSNamedTupleMember"&&s.optional)&&this.raise($.OptionalTypeBeforeRequired,s),r||(r=a==="TSNamedTupleMember"&&s.optional||a==="TSOptionalType")}),this.finishNode(t,"TSTupleType")}tsParseTupleElementType(){let t=this.state.startLoc,r=this.eat(21),{startLoc:s}=this.state,a,p,u,f,x=pt(this.state.type)?this.lookaheadCharCode():null;if(x===58)a=!0,u=!1,p=this.parseIdentifier(!0),this.expect(14),f=this.tsParseType();else if(x===63){u=!0;let g=this.state.value,z=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(a=!0,p=this.createIdentifier(this.startNodeAt(s),g),this.expect(17),this.expect(14),f=this.tsParseType()):(a=!1,f=z,this.expect(17))}else f=this.tsParseType(),u=this.eat(17),a=this.eat(14);if(a){let g;p?(g=this.startNodeAt(s),g.optional=u,g.label=p,g.elementType=f,this.eat(17)&&(g.optional=!0,this.raise($.TupleOptionalAfterType,this.state.lastTokStartLoc))):(g=this.startNodeAt(s),g.optional=u,this.raise($.InvalidTupleMemberLabel,f),g.label=f,g.elementType=this.tsParseType()),f=this.finishNode(g,"TSNamedTupleMember")}else if(u){let g=this.startNodeAt(s);g.typeAnnotation=f,f=this.finishNode(g,"TSOptionalType")}if(r){let g=this.startNodeAt(t);g.typeAnnotation=f,f=this.finishNode(g,"TSRestType")}return f}tsParseParenthesizedType(){let t=this.startNode();return this.expect(10),t.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(t,"TSParenthesizedType")}tsParseFunctionOrConstructorType(t,r){let s=this.startNode();return t==="TSConstructorType"&&(s.abstract=!!r,r&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,s)),this.finishNode(s,t)}tsParseLiteralTypeNode(){let t=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:t.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(t,"TSLiteralType")}tsParseTemplateLiteralType(){let t=this.startNode();return t.literal=super.parseTemplate(!1),this.finishNode(t,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let t=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(t):t}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let t=this.startNode(),r=this.lookahead();return r.type!==135&&r.type!==136&&this.unexpected(),t.literal=this.parseMaybeUnary(),this.finishNode(t,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:t}=this.state;if(pe(t)||t===88||t===84){let r=t===88?"TSVoidKeyword":t===84?"TSNullKeyword":Upe(this.state.value);if(r!==void 0&&this.lookaheadCharCode()!==46){let s=this.startNode();return this.next(),this.finishNode(s,r)}return this.tsParseTypeReference()}}}throw this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:t}=this.state,r=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let s=this.startNodeAt(t);s.elementType=r,this.expect(3),r=this.finishNode(s,"TSArrayType")}else{let s=this.startNodeAt(t);s.objectType=r,s.indexType=this.tsParseType(),this.expect(3),r=this.finishNode(s,"TSIndexedAccessType")}return r}tsParseTypeOperator(){let t=this.startNode(),r=this.state.value;return this.next(),t.operator=r,t.typeAnnotation=this.tsParseTypeOperatorOrHigher(),r==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(t),this.finishNode(t,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(t){switch(t.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise($.UnexpectedReadonly,t)}}tsParseInferType(){let t=this.startNode();this.expectContextual(115);let r=this.startNode();return r.name=this.tsParseTypeParameterName(),r.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),t.typeParameter=this.finishNode(r,"TSTypeParameter"),this.finishNode(t,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let t=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return t}}tsParseTypeOperatorOrHigher(){return dpe(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(t,r,s){let a=this.startNode(),p=this.eat(s),u=[];do u.push(r());while(this.eat(s));return u.length===1&&!p?u[0]:(a.types=u,this.finishNode(a,t))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(pe(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:t}=this.state,r=t.length;try{return this.parseObjectLike(8,!0),t.length===r}catch{return!1}}if(this.match(0)){this.next();let{errors:t}=this.state,r=t.length;try{return super.parseBindingList(3,93,1),t.length===r}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(t){return this.tsInType(()=>{let r=this.startNode();this.expect(t);let s=this.startNode(),a=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(a&&this.match(78)){let f=this.tsParseThisTypeOrThisTypePredicate();return f.type==="TSThisType"?(s.parameterName=f,s.asserts=!0,s.typeAnnotation=null,f=this.finishNode(s,"TSTypePredicate")):(this.resetStartLocationFromNode(f,s),f.asserts=!0),r.typeAnnotation=f,this.finishNode(r,"TSTypeAnnotation")}let p=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!p)return a?(s.parameterName=this.parseIdentifier(),s.asserts=a,s.typeAnnotation=null,r.typeAnnotation=this.finishNode(s,"TSTypePredicate"),this.finishNode(r,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,r);let u=this.tsParseTypeAnnotation(!1);return s.parameterName=p,s.typeAnnotation=u,s.asserts=a,r.typeAnnotation=this.finishNode(s,"TSTypePredicate"),this.finishNode(r,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let t=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),t}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let t=this.state.containsEsc;return this.next(),!pe(this.state.type)&&!this.match(78)?!1:(t&&this.raise(R.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(t=!0,r=this.startNode()){return this.tsInType(()=>{t&&this.expect(14),r.typeAnnotation=this.tsParseType()}),this.finishNode(r,"TSTypeAnnotation")}tsParseType(){vh(this.state.inType);let t=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return t;let r=this.startNodeAtNode(t);return r.checkType=t,r.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),r.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),r.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(r,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.isLookaheadContextual("new")}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise($.ReservedTypeAssertion,this.state.startLoc);let t=this.startNode();return t.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),t.expression=this.parseMaybeUnary(),this.finishNode(t,"TSTypeAssertion")}tsParseHeritageClause(t){let r=this.state.startLoc,s=this.tsParseDelimitedList("HeritageClauseElement",()=>{let a=this.startNode();return a.expression=this.tsParseEntityName(3),this.match(47)&&(a.typeParameters=this.tsParseTypeArguments()),this.finishNode(a,"TSExpressionWithTypeArguments")});return s.length||this.raise($.EmptyHeritageClauseType,r,{token:t}),s}tsParseInterfaceDeclaration(t,r={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),r.declare&&(t.declare=!0),pe(this.state.type)?(t.id=this.parseIdentifier(),this.checkIdentifier(t.id,130)):(t.id=null,this.raise($.MissingInterfaceName,this.state.startLoc)),t.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(t.extends=this.tsParseHeritageClause("extends"));let s=this.startNode();return s.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),t.body=this.finishNode(s,"TSInterfaceBody"),this.finishNode(t,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(t){return t.id=this.parseIdentifier(),this.checkIdentifier(t.id,2),t.typeAnnotation=this.tsInType(()=>{if(t.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookaheadCharCode()!==46){let r=this.startNode();return this.next(),this.finishNode(r,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(t,"TSTypeAliasDeclaration")}tsInTopLevelContext(t){if(this.curContext()!==ce.brace){let r=this.state.context;this.state.context=[r[0]];try{return t()}finally{this.state.context=r}}else return t()}tsInType(t){let r=this.state.inType;this.state.inType=!0;try{return t()}finally{this.state.inType=r}}tsInDisallowConditionalTypesContext(t){let r=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return t()}finally{this.state.inDisallowConditionalTypesContext=r}}tsInAllowConditionalTypesContext(t){let r=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return t()}finally{this.state.inDisallowConditionalTypesContext=r}}tsEatThenParseType(t){if(this.match(t))return this.tsNextThenParseType()}tsExpectThenParseType(t){return this.tsInType(()=>(this.expect(t),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let t=this.startNode();return t.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(t.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(t,"TSEnumMember")}tsParseEnumDeclaration(t,r={}){return r.const&&(t.const=!0),r.declare&&(t.declare=!0),this.expectContextual(126),t.id=this.parseIdentifier(),this.checkIdentifier(t.id,t.const?8971:8459),this.expect(5),t.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(t,"TSEnumDeclaration")}tsParseEnumBody(){let t=this.startNode();return this.expect(5),t.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(t,"TSEnumBody")}tsParseModuleBlock(){let t=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(t.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(t,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(t,r=!1){if(t.id=this.parseIdentifier(),r||this.checkIdentifier(t.id,1024),this.eat(16)){let s=this.startNode();this.tsParseModuleOrNamespaceDeclaration(s,!0),t.body=s}else this.scope.enter(1024),this.prodParam.enter(0),t.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(t,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(t){return this.isContextual(112)?(t.kind="global",t.global=!0,t.id=this.parseIdentifier()):this.match(134)?(t.kind="module",t.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(1024),this.prodParam.enter(0),t.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(t,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(t,r,s){t.isExport=s||!1,t.id=r||this.parseIdentifier(),this.checkIdentifier(t.id,4096),this.expect(29);let a=this.tsParseModuleReference();return t.importKind==="type"&&a.type!=="TSExternalModuleReference"&&this.raise($.ImportAliasHasImportType,a),t.moduleReference=a,this.semicolon(),this.finishNode(t,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let t=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||this.unexpected(),t.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(t,"TSExternalModuleReference")}tsLookAhead(t){let r=this.state.clone(),s=t();return this.state=r,s}tsTryParseAndCatch(t){let r=this.tryParse(s=>t()||s());if(!(r.aborted||!r.node))return r.error&&(this.state=r.failState),r.node}tsTryParse(t){let r=this.state.clone(),s=t();if(s!==void 0&&s!==!1)return s;this.state=r}tsTryParseDeclare(t){if(this.isLineTerminator())return;let r=this.state.type;return this.tsInAmbientContext(()=>{switch(r){case 68:return t.declare=!0,super.parseFunctionStatement(t,!1,!1);case 80:return t.declare=!0,this.parseClass(t,!0,!1);case 126:return this.tsParseEnumDeclaration(t,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(t);case 100:if(this.state.containsEsc)return;case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(t.declare=!0,this.parseVarStatement(t,this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(t,{const:!0,declare:!0}));case 107:if(this.isUsing())return this.raise($.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),t.declare=!0,this.parseVarStatement(t,"using",!0);break;case 96:if(this.isAwaitUsing())return this.raise($.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),t.declare=!0,this.next(),this.parseVarStatement(t,"await using",!0);break;case 129:{let s=this.tsParseInterfaceDeclaration(t,{declare:!0});if(s)return s}default:if(pe(r))return this.tsParseDeclaration(t,this.state.type,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.type,!0,null)}tsParseDeclaration(t,r,s,a){switch(r){case 124:if(this.tsCheckLineTerminator(s)&&(this.match(80)||pe(this.state.type)))return this.tsParseAbstractDeclaration(t,a);break;case 127:if(this.tsCheckLineTerminator(s)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(t);if(pe(this.state.type))return t.kind="module",this.tsParseModuleOrNamespaceDeclaration(t)}break;case 128:if(this.tsCheckLineTerminator(s)&&pe(this.state.type))return t.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(t);break;case 130:if(this.tsCheckLineTerminator(s)&&pe(this.state.type))return this.tsParseTypeAliasDeclaration(t);break}}tsCheckLineTerminator(t){return t?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(t){if(!this.match(47))return;let r=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let s=this.tsTryParseAndCatch(()=>{let a=this.startNodeAt(t);return a.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(a),a.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),a});if(this.state.maybeInArrowParameters=r,!!s)return super.parseArrowExpression(s,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let t=this.startNode();return t.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),t.params.length===0?this.raise($.EmptyTypeArguments,t):!this.state.inType&&this.curContext()===ce.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(t,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return lpe(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseBindingElement(t,r){let s=r.length?r[0].loc.start:this.state.startLoc,a={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},a);let p=a.accessibility,u=a.override,f=a.readonly;!(t&4)&&(p||f||u)&&this.raise($.UnexpectedParameterModifier,s);let m=this.parseMaybeDefault();t&2&&this.parseFunctionParamType(m);let x=this.parseMaybeDefault(m.loc.start,m);if(p||f||u){let g=this.startNodeAt(s);return r.length&&(g.decorators=r),p&&(g.accessibility=p),f&&(g.readonly=f),u&&(g.override=u),x.type!=="Identifier"&&x.type!=="AssignmentPattern"&&this.raise($.UnsupportedParameterPropertyKind,g),g.parameter=x,this.finishNode(g,"TSParameterProperty")}return r.length&&(m.decorators=r),x}isSimpleParameter(t){return t.type==="TSParameterProperty"&&super.isSimpleParameter(t.parameter)||super.isSimpleParameter(t)}tsDisallowOptionalPattern(t){for(let r of t.params)r.type!=="Identifier"&&r.optional&&!this.state.isAmbientContext&&this.raise($.PatternIsOptional,r)}setArrowFunctionParameters(t,r,s){super.setArrowFunctionParameters(t,r,s),this.tsDisallowOptionalPattern(t)}parseFunctionBodyAndFinish(t,r,s=!1){this.match(14)&&(t.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let a=r==="FunctionDeclaration"?"TSDeclareFunction":r==="ClassMethod"||r==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return a&&!this.match(5)&&this.isLineTerminator()?this.finishNode(t,a):a==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise($.DeclareFunctionHasImplementation,t),t.declare)?super.parseFunctionBodyAndFinish(t,a,s):(this.tsDisallowOptionalPattern(t),super.parseFunctionBodyAndFinish(t,r,s))}registerFunctionStatementId(t){!t.body&&t.id?this.checkIdentifier(t.id,1024):super.registerFunctionStatementId(t)}tsCheckForInvalidTypeCasts(t){t.forEach(r=>{r?.type==="TSTypeCastExpression"&&this.raise($.UnexpectedTypeAnnotation,r.typeAnnotation)})}toReferencedList(t,r){return this.tsCheckForInvalidTypeCasts(t),t}parseArrayLike(t,r,s){let a=super.parseArrayLike(t,r,s);return a.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(a.elements),a}parseSubscript(t,r,s,a){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let u=this.startNodeAt(r);return u.expression=t,this.finishNode(u,"TSNonNullExpression")}let p=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(s)return a.stop=!0,t;a.optionalChainMember=p=!0,this.next()}if(this.match(47)||this.match(51)){let u,f=this.tsTryParseAndCatch(()=>{if(!s&&this.atPossibleAsyncArrow(t)){let z=this.tsTryParseGenericAsyncArrowFunction(r);if(z)return a.stop=!0,z}let m=this.tsParseTypeArgumentsInExpression();if(!m)return;if(p&&!this.match(10)){u=this.state.curPosition();return}if(Ks(this.state.type)){let z=super.parseTaggedTemplateExpression(t,r,a);return z.typeParameters=m,z}if(!s&&this.eat(10)){let z=this.startNodeAt(r);return z.callee=t,z.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(z.arguments),z.typeParameters=m,a.optionalChainMember&&(z.optional=p),this.finishCallExpression(z,a.optionalChainMember)}let x=this.state.type;if(x===48||x===52||x!==10&&x!==93&&x!==120&&pr(x)&&!this.hasPrecedingLineBreak())return;let g=this.startNodeAt(r);return g.expression=t,g.typeParameters=m,this.finishNode(g,"TSInstantiationExpression")});if(u&&this.unexpected(u,10),f)return f.type==="TSInstantiationExpression"&&((this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise($.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(16)&&!this.match(18)&&(f.expression=super.stopParseSubscript(t,a))),f}return super.parseSubscript(t,r,s,a)}parseNewCallee(t){var r;super.parseNewCallee(t);let{callee:s}=t;s.type==="TSInstantiationExpression"&&!((r=s.extra)!=null&&r.parenthesized)&&(t.typeParameters=s.typeParameters,t.callee=s.expression)}parseExprOp(t,r,s){let a;if(Ws(58)>s&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(a=this.isContextual(120)))){let p=this.startNodeAt(r);return p.expression=t,p.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(a&&this.raise(R.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(p,a?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(p,r,s)}return super.parseExprOp(t,r,s)}checkReservedWord(t,r,s,a){this.state.isAmbientContext||super.checkReservedWord(t,r,s,a)}checkImportReflection(t){super.checkImportReflection(t),t.module&&t.importKind!=="value"&&this.raise($.ImportReflectionHasImportType,t.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(t){if(super.isPotentialImportPhase(t))return!0;if(this.isContextual(130)){let r=this.lookaheadCharCode();return t?r===123||r===42:r!==61}return!t&&this.isContextual(87)}applyImportPhase(t,r,s,a){super.applyImportPhase(t,r,s,a),r?t.exportKind=s==="type"?"type":"value":t.importKind=s==="type"||s==="typeof"?s:"value"}parseImport(t){if(this.match(134))return t.importKind="value",super.parseImport(t);let r;if(pe(this.state.type)&&this.lookaheadCharCode()===61)return t.importKind="value",this.tsParseImportEqualsDeclaration(t);if(this.isContextual(130)){let s=this.parseMaybeImportPhase(t,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(t,s);r=super.parseImportSpecifiersAndAfter(t,s)}else r=super.parseImport(t);return r.importKind==="type"&&r.specifiers.length>1&&r.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise($.TypeImportCannotSpecifyDefaultAndNamed,r),r}parseExport(t,r){if(this.match(83)){let s=t;this.next();let a=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?a=this.parseMaybeImportPhase(s,!1):s.importKind="value",this.tsParseImportEqualsDeclaration(s,a,!0)}else if(this.eat(29)){let s=t;return s.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(s,"TSExportAssignment")}else if(this.eatContextual(93)){let s=t;return this.expectContextual(128),s.id=this.parseIdentifier(),this.semicolon(),this.finishNode(s,"TSNamespaceExportDeclaration")}else return super.parseExport(t,r)}isAbstractClass(){return this.isContextual(124)&&this.isLookaheadContextual("class")}parseExportDefaultExpression(){if(this.isAbstractClass()){let t=this.startNode();return this.next(),t.abstract=!0,this.parseClass(t,!0,!0)}if(this.match(129)){let t=this.tsParseInterfaceDeclaration(this.startNode());if(t)return t}return super.parseExportDefaultExpression()}parseVarStatement(t,r,s=!1){let{isAmbientContext:a}=this.state,p=super.parseVarStatement(t,r,s||a);if(!a)return p;if(!t.declare&&(r==="using"||r==="await using"))return this.raiseOverwrite($.UsingDeclarationInAmbientContext,t,r),p;for(let{id:u,init:f}of p.declarations)f&&(r==="var"||r==="let"||u.typeAnnotation?this.raise($.InitializerNotAllowedInAmbientContext,f):Gpe(f,this.hasPlugin("estree"))||this.raise($.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,f));return p}parseStatementContent(t,r){if(!this.state.containsEsc)switch(this.state.type){case 75:{if(this.isLookaheadContextual("enum")){let s=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(s,{const:!0})}break}case 124:case 125:{if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let s=this.state.type,a=this.startNode();this.next();let p=s===125?this.tsTryParseDeclare(a):this.tsParseAbstractDeclaration(a,r);return p?(s===125&&(p.declare=!0),p):(a.expression=this.createIdentifier(this.startNodeAt(a.loc.start),s===125?"declare":"abstract"),this.semicolon(!1),this.finishNode(a,"ExpressionStatement"))}break}case 126:return this.tsParseEnumDeclaration(this.startNode());case 112:{if(this.lookaheadCharCode()===123){let a=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(a)}break}case 129:{let s=this.tsParseInterfaceDeclaration(this.startNode());if(s)return s;break}case 127:{if(this.nextTokenIsIdentifierOrStringLiteralOnSameLine()){let s=this.startNode();return this.next(),this.tsParseDeclaration(s,127,!1,r)}break}case 128:{if(this.nextTokenIsIdentifierOnSameLine()){let s=this.startNode();return this.next(),this.tsParseDeclaration(s,128,!1,r)}break}case 130:{if(this.nextTokenIsIdentifierOnSameLine()){let s=this.startNode();return this.next(),this.tsParseTypeAliasDeclaration(s)}break}}return super.parseStatementContent(t,r)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(t,r){return r.some(s=>Fh(s)?t.accessibility===s:!!t[s])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(t,r,s){let a=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:a,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:$.InvalidModifierOnTypeParameterPositions},r);let p=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(r,a)&&this.raise($.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(t,r)):this.parseClassMemberWithIsStatic(t,r,s,!!r.static)};r.declare?this.tsInAmbientContext(p):p()}parseClassMemberWithIsStatic(t,r,s,a){let p=this.tsTryParseIndexSignature(r);if(p){t.body.push(p),r.abstract&&this.raise($.IndexSignatureHasAbstract,r),r.accessibility&&this.raise($.IndexSignatureHasAccessibility,r,{modifier:r.accessibility}),r.declare&&this.raise($.IndexSignatureHasDeclare,r),r.override&&this.raise($.IndexSignatureHasOverride,r);return}!this.state.inAbstractClass&&r.abstract&&this.raise($.NonAbstractClassHasAbstractMethod,r),r.override&&(s.hadSuperClass||this.raise($.OverrideNotInSubClass,r)),super.parseClassMemberWithIsStatic(t,r,s,a)}parsePostMemberNameModifiers(t){this.eat(17)&&(t.optional=!0),t.readonly&&this.match(10)&&this.raise($.ClassMethodHasReadonly,t),t.declare&&this.match(10)&&this.raise($.ClassMethodHasDeclare,t)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(t,r,s){if(!this.match(17))return t;if(this.state.maybeInArrowParameters){let a=this.lookaheadCharCode();if(a===44||a===61||a===58||a===41)return this.setOptionalParametersError(s),t}return super.parseConditional(t,r,s)}parseParenItem(t,r){let s=super.parseParenItem(t,r);if(this.eat(17)&&(s.optional=!0,this.resetEndLocation(t)),this.match(14)){let a=this.startNodeAt(r);return a.expression=t,a.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(a,"TSTypeCastExpression")}return t}parseExportDeclaration(t){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(t));let r=this.state.startLoc,s=this.eatContextual(125);if(s&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise($.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let p=pe(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(t);return p?((p.type==="TSInterfaceDeclaration"||p.type==="TSTypeAliasDeclaration"||s)&&(t.exportKind="type"),s&&p.type!=="TSImportEqualsDeclaration"&&(this.resetStartLocation(p,r),p.declare=!0),p):null}parseClassId(t,r,s,a){if((!r||s)&&this.isContextual(113))return;super.parseClassId(t,r,s,t.declare?1024:8331);let p=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);p&&(t.typeParameters=p)}parseClassPropertyAnnotation(t){t.optional||(this.eat(35)?t.definite=!0:this.eat(17)&&(t.optional=!0));let r=this.tsTryParseTypeAnnotation();r&&(t.typeAnnotation=r)}parseClassProperty(t){if(this.parseClassPropertyAnnotation(t),this.state.isAmbientContext&&!(t.readonly&&!t.typeAnnotation)&&this.match(29)&&this.raise($.DeclareClassFieldHasInitializer,this.state.startLoc),t.abstract&&this.match(29)){let{key:r}=t;this.raise($.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:r.type==="Identifier"&&!t.computed?r.name:`[${this.input.slice(this.offsetToSourcePos(r.start),this.offsetToSourcePos(r.end))}]`})}return super.parseClassProperty(t)}parseClassPrivateProperty(t){return t.abstract&&this.raise($.PrivateElementHasAbstract,t),t.accessibility&&this.raise($.PrivateElementHasAccessibility,t,{modifier:t.accessibility}),this.parseClassPropertyAnnotation(t),super.parseClassPrivateProperty(t)}parseClassAccessorProperty(t){return this.parseClassPropertyAnnotation(t),t.optional&&this.raise($.AccessorCannotBeOptional,t),super.parseClassAccessorProperty(t)}pushClassMethod(t,r,s,a,p,u){let f=this.tsTryParseTypeParameters(this.tsParseConstModifier);f&&p&&this.raise($.ConstructorHasTypeParameters,f);let{declare:m=!1,kind:x}=r;m&&(x==="get"||x==="set")&&this.raise($.DeclareAccessor,r,{kind:x}),f&&(r.typeParameters=f),super.pushClassMethod(t,r,s,a,p,u)}pushClassPrivateMethod(t,r,s,a){let p=this.tsTryParseTypeParameters(this.tsParseConstModifier);p&&(r.typeParameters=p),super.pushClassPrivateMethod(t,r,s,a)}declareClassPrivateMethodInScope(t,r){t.type!=="TSDeclareMethod"&&(t.type==="MethodDefinition"&&t.value.body==null||super.declareClassPrivateMethodInScope(t,r))}parseClassSuper(t){if(super.parseClassSuper(t),t.superClass)if(t.superClass.type==="TSInstantiationExpression"){let r=t.superClass,s=r.expression;this.takeSurroundingComments(s,s.start,s.end);let a=r.typeParameters;this.takeSurroundingComments(a,a.start,a.end),t.superClass=s,t.superTypeParameters=a}else(this.match(47)||this.match(51))&&(t.superTypeParameters=this.tsParseTypeArgumentsInExpression());this.eatContextual(113)&&(t.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(t,r,s,a,p,u,f){let m=this.tsTryParseTypeParameters(this.tsParseConstModifier);return m&&(t.typeParameters=m),super.parseObjPropValue(t,r,s,a,p,u,f)}parseFunctionParams(t,r){let s=this.tsTryParseTypeParameters(this.tsParseConstModifier);s&&(t.typeParameters=s),super.parseFunctionParams(t,r)}parseVarId(t,r){super.parseVarId(t,r),t.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(t.definite=!0);let s=this.tsTryParseTypeAnnotation();s&&(t.id.typeAnnotation=s,this.resetEndLocation(t.id))}parseAsyncArrowFromCallExpression(t,r){return this.match(14)&&(t.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(t,r)}parseMaybeAssign(t,r){var s,a,p,u,f;let m,x,g;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(m=this.state.clone(),x=this.tryParse(()=>super.parseMaybeAssign(t,r),m),!x.error)return x.node;let{context:k}=this.state,F=k[k.length-1];(F===ce.j_oTag||F===ce.j_expr)&&k.pop()}if(!((s=x)!=null&&s.error)&&!this.match(47))return super.parseMaybeAssign(t,r);(!m||m===this.state)&&(m=this.state.clone());let z,w=this.tryParse(k=>{var F,Y;z=this.tsParseTypeParameters(this.tsParseConstModifier);let W=super.parseMaybeAssign(t,r);return(W.type!=="ArrowFunctionExpression"||(F=W.extra)!=null&&F.parenthesized)&&k(),((Y=z)==null?void 0:Y.params.length)!==0&&this.resetStartLocationFromNode(W,z),W.typeParameters=z,W},m);if(!w.error&&!w.aborted)return z&&this.reportReservedArrowTypeParam(z),w.node;if(!x&&(vh(!this.hasPlugin("jsx")),g=this.tryParse(()=>super.parseMaybeAssign(t,r),m),!g.error))return g.node;if((a=x)!=null&&a.node)return this.state=x.failState,x.node;if(w.node)return this.state=w.failState,z&&this.reportReservedArrowTypeParam(z),w.node;if((p=g)!=null&&p.node)return this.state=g.failState,g.node;throw((u=x)==null?void 0:u.error)||w.error||((f=g)==null?void 0:f.error)}reportReservedArrowTypeParam(t){var r;t.params.length===1&&!t.params[0].constraint&&!((r=t.extra)!=null&&r.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise($.ReservedArrowTypeParam,t)}parseMaybeUnary(t,r){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(t,r)}parseArrow(t){if(this.match(14)){let r=this.tryParse(s=>{let a=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&s(),a});if(r.aborted)return;r.thrown||(r.error&&(this.state=r.failState),t.returnType=r.node)}return super.parseArrow(t)}parseFunctionParamType(t){this.eat(17)&&(t.optional=!0);let r=this.tsTryParseTypeAnnotation();return r&&(t.typeAnnotation=r),this.resetEndLocation(t),t}isAssignable(t,r){switch(t.type){case"TSTypeCastExpression":return this.isAssignable(t.expression,r);case"TSParameterProperty":return!0;default:return super.isAssignable(t,r)}}toAssignable(t,r=!1){switch(t.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(t,r);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":r?this.expressionScope.recordArrowParameterBindingError($.UnexpectedTypeCastInParameter,t):this.raise($.UnexpectedTypeCastInParameter,t),this.toAssignable(t.expression,r);break;case"AssignmentExpression":!r&&t.left.type==="TSTypeCastExpression"&&(t.left=this.typeCastToParameter(t.left));default:super.toAssignable(t,r)}}toAssignableParenthesizedExpression(t,r){switch(t.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(t.expression,r);break;default:super.toAssignable(t,r)}}checkToRestConversion(t,r){switch(t.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(t.expression,!1);break;default:super.checkToRestConversion(t,r)}}isValidLVal(t,r,s,a){switch(t){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(a!==64||!s)&&["expression",!0];default:return super.isValidLVal(t,r,s,a)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(t,r){if(this.match(47)||this.match(51)){let s=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let a=super.parseMaybeDecoratorArguments(t,r);return a.typeParameters=s,a}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(t,r)}checkCommaAfterRest(t){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===t?(this.next(),!1):super.checkCommaAfterRest(t)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(t,r){let s=super.parseMaybeDefault(t,r);return s.type==="AssignmentPattern"&&s.typeAnnotation&&s.right.start<s.typeAnnotation.start&&this.raise($.TypeAnnotationAfterAssign,s.typeAnnotation),s}getTokenFromCode(t){if(this.state.inType){if(t===62){this.finishOp(48,1);return}if(t===60){this.finishOp(47,1);return}}super.getTokenFromCode(t)}reScan_lt_gt(){let{type:t}=this.state;t===47?(this.state.pos-=1,this.readToken_lt()):t===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:t}=this.state;return t===51?(this.state.pos-=2,this.finishOp(47,1),47):t}toAssignableListItem(t,r,s){let a=t[r];a.type==="TSTypeCastExpression"&&(t[r]=this.typeCastToParameter(a)),super.toAssignableListItem(t,r,s)}typeCastToParameter(t){return t.expression.typeAnnotation=t.typeAnnotation,this.resetEndLocation(t.expression,t.typeAnnotation.loc.end),t.expression}shouldParseArrow(t){return this.match(14)?t.every(r=>this.isAssignable(r,!0)):super.shouldParseArrow(t)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(t){if(this.match(47)||this.match(51)){let r=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());r&&(t.typeParameters=r)}return super.jsxParseOpeningElementAfterName(t)}getGetterSetterExpectedParamCount(t){let r=super.getGetterSetterExpectedParamCount(t),a=this.getObjectOrClassMethodParams(t)[0];return a&&this.isThisParam(a)?r+1:r}parseCatchClauseParam(){let t=super.parseCatchClauseParam(),r=this.tsTryParseTypeAnnotation();return r&&(t.typeAnnotation=r,this.resetEndLocation(t)),t}tsInAmbientContext(t){let{isAmbientContext:r,strict:s}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return t()}finally{this.state.isAmbientContext=r,this.state.strict=s}}parseClass(t,r,s){let a=this.state.inAbstractClass;this.state.inAbstractClass=!!t.abstract;try{return super.parseClass(t,r,s)}finally{this.state.inAbstractClass=a}}tsParseAbstractDeclaration(t,r){if(this.match(80))return t.abstract=!0,this.maybeTakeDecorators(r,this.parseClass(t,!0,!1));if(this.isContextual(129))return this.hasFollowingLineBreak()?null:(t.abstract=!0,this.raise($.NonClassMethodPropertyHasAbstractModifier,t),this.tsParseInterfaceDeclaration(t));throw this.unexpected(null,80)}parseMethod(t,r,s,a,p,u,f){let m=super.parseMethod(t,r,s,a,p,u,f);if((m.abstract||m.type==="TSAbstractMethodDefinition")&&(this.hasPlugin("estree")?m.value:m).body){let{key:z}=m;this.raise($.AbstractMethodHasImplementation,m,{methodName:z.type==="Identifier"&&!m.computed?z.name:`[${this.input.slice(this.offsetToSourcePos(z.start),this.offsetToSourcePos(z.end))}]`})}return m}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(t,r,s,a){return!r&&a?(this.parseTypeOnlyImportExportSpecifier(t,!1,s),this.finishNode(t,"ExportSpecifier")):(t.exportKind="value",super.parseExportSpecifier(t,r,s,a))}parseImportSpecifier(t,r,s,a,p){return!r&&a?(this.parseTypeOnlyImportExportSpecifier(t,!0,s),this.finishNode(t,"ImportSpecifier")):(t.importKind="value",super.parseImportSpecifier(t,r,s,a,s?4098:4096))}parseTypeOnlyImportExportSpecifier(t,r,s){let a=r?"imported":"local",p=r?"local":"exported",u=t[a],f,m=!1,x=!0,g=u.loc.start;if(this.isContextual(93)){let w=this.parseIdentifier();if(this.isContextual(93)){let k=this.parseIdentifier();pt(this.state.type)?(m=!0,u=w,f=r?this.parseIdentifier():this.parseModuleExportName(),x=!1):(f=k,x=!1)}else pt(this.state.type)?(x=!1,f=r?this.parseIdentifier():this.parseModuleExportName()):(m=!0,u=w)}else pt(this.state.type)&&(m=!0,r?(u=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(u.name,u.loc.start,!0,!0)):u=this.parseModuleExportName());m&&s&&this.raise(r?$.TypeModifierIsUsedInTypeImports:$.TypeModifierIsUsedInTypeExports,g),t[a]=u,t[p]=f;let z=r?"importKind":"exportKind";t[z]=m?"type":"value",x&&this.eatContextual(93)&&(t[p]=r?this.parseIdentifier():this.parseModuleExportName()),t[p]||(t[p]=this.cloneIdentifier(t[a])),r&&this.checkIdentifier(t[p],m?4098:4096)}fillOptionalPropertiesForTSESLint(t){var r,s,a,p,u,f,m,x,g,z,w,k,F,Y,W,ee,de,Te,xr,ep,tp,op,rp,sp,np,ip,ap,cp,pp,dp,lp,up,mp,hp,fp,xp,gp,bp,yp,Ap,Sp,zp,Tp,Ep,Cp,Ip,Rp,wp;switch(t.type){case"ExpressionStatement":(r=t.directive)!=null||(t.directive=void 0);return;case"RestElement":t.value=void 0;case"Identifier":case"ArrayPattern":case"AssignmentPattern":case"ObjectPattern":(s=t.decorators)!=null||(t.decorators=[]),(a=t.optional)!=null||(t.optional=!1),(p=t.typeAnnotation)!=null||(t.typeAnnotation=void 0);return;case"TSParameterProperty":(u=t.accessibility)!=null||(t.accessibility=void 0),(f=t.decorators)!=null||(t.decorators=[]),(m=t.override)!=null||(t.override=!1),(x=t.readonly)!=null||(t.readonly=!1),(g=t.static)!=null||(t.static=!1);return;case"TSEmptyBodyFunctionExpression":t.body=null;case"TSDeclareFunction":case"FunctionDeclaration":case"FunctionExpression":case"ClassMethod":case"ClassPrivateMethod":(z=t.declare)!=null||(t.declare=!1),(w=t.returnType)!=null||(t.returnType=void 0),(k=t.typeParameters)!=null||(t.typeParameters=void 0);return;case"Property":(F=t.optional)!=null||(t.optional=!1);return;case"TSMethodSignature":case"TSPropertySignature":(Y=t.optional)!=null||(t.optional=!1);case"TSIndexSignature":(W=t.accessibility)!=null||(t.accessibility=void 0),(ee=t.readonly)!=null||(t.readonly=!1),(de=t.static)!=null||(t.static=!1);return;case"TSAbstractPropertyDefinition":case"PropertyDefinition":case"TSAbstractAccessorProperty":case"AccessorProperty":(Te=t.declare)!=null||(t.declare=!1),(xr=t.definite)!=null||(t.definite=!1),(ep=t.readonly)!=null||(t.readonly=!1),(tp=t.typeAnnotation)!=null||(t.typeAnnotation=void 0);case"TSAbstractMethodDefinition":case"MethodDefinition":(op=t.accessibility)!=null||(t.accessibility=void 0),(rp=t.decorators)!=null||(t.decorators=[]),(sp=t.override)!=null||(t.override=!1),(np=t.optional)!=null||(t.optional=!1);return;case"ClassExpression":(ip=t.id)!=null||(t.id=null);case"ClassDeclaration":(ap=t.abstract)!=null||(t.abstract=!1),(cp=t.declare)!=null||(t.declare=!1),(pp=t.decorators)!=null||(t.decorators=[]),(dp=t.implements)!=null||(t.implements=[]),(lp=t.superTypeArguments)!=null||(t.superTypeArguments=void 0),(up=t.typeParameters)!=null||(t.typeParameters=void 0);return;case"TSTypeAliasDeclaration":case"VariableDeclaration":(mp=t.declare)!=null||(t.declare=!1);return;case"VariableDeclarator":(hp=t.definite)!=null||(t.definite=!1);return;case"TSEnumDeclaration":(fp=t.const)!=null||(t.const=!1),(xp=t.declare)!=null||(t.declare=!1);return;case"TSEnumMember":(gp=t.computed)!=null||(t.computed=!1);return;case"TSImportType":(bp=t.qualifier)!=null||(t.qualifier=null),(yp=t.options)!=null||(t.options=null);return;case"TSInterfaceDeclaration":(Ap=t.declare)!=null||(t.declare=!1),(Sp=t.extends)!=null||(t.extends=[]);return;case"TSMappedType":(zp=t.optional)!=null||(t.optional=!1),(Tp=t.readonly)!=null||(t.readonly=void 0);return;case"TSModuleDeclaration":(Ep=t.declare)!=null||(t.declare=!1),(Cp=t.global)!=null||(t.global=t.kind==="global");return;case"TSTypeParameter":(Ip=t.const)!=null||(t.const=!1),(Rp=t.in)!=null||(t.in=!1),(wp=t.out)!=null||(t.out=!1);return}}chStartsBindingIdentifierAndNotRelationalOperator(t,r){if(yt(t)){if(xc.lastIndex=r,xc.test(this.input)){let s=this.codePointAtPos(xc.lastIndex);if(!Kt(s)&&s!==92)return!1}return!0}else return t===92}nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine(){let t=this.nextTokenInLineStart(),r=this.codePointAtPos(t);return this.chStartsBindingIdentifierAndNotRelationalOperator(r,t)}nextTokenIsIdentifierOrStringLiteralOnSameLine(){let t=this.nextTokenInLineStart(),r=this.codePointAtPos(t);return this.chStartsBindingIdentifier(r,t)||r===34||r===39}};function $pe(o){if(o.type!=="MemberExpression")return!1;let{computed:e,property:t}=o;return e&&t.type!=="StringLiteral"&&(t.type!=="TemplateLiteral"||t.expressions.length>0)?!1:Xh(o.object)}function Gpe(o,e){var t;let{type:r}=o;if((t=o.extra)!=null&&t.parenthesized)return!1;if(e){if(r==="Literal"){let{value:s}=o;if(typeof s=="string"||typeof s=="boolean")return!0}}else if(r==="StringLiteral"||r==="BooleanLiteral")return!0;return!!(Zh(o,e)||Kpe(o,e)||r==="TemplateLiteral"&&o.expressions.length===0||$pe(o))}function Zh(o,e){return e?o.type==="Literal"&&(typeof o.value=="number"||"bigint"in o):o.type==="NumericLiteral"||o.type==="BigIntLiteral"}function Kpe(o,e){if(o.type==="UnaryExpression"){let{operator:t,argument:r}=o;if(t==="-"&&Zh(r,e))return!0}return!1}function Xh(o){return o.type==="Identifier"?!0:o.type!=="MemberExpression"||o.computed?!1:Xh(o.object)}var Nh=ct`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),qpe=o=>class extends o{parsePlaceholder(t){if(this.match(133)){let r=this.startNode();return this.next(),this.assertNoSpace(),r.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(r,t)}}finishPlaceholder(t,r){let s=t;return(!s.expectedNode||!s.type)&&(s=this.finishNode(s,"Placeholder")),s.expectedNode=r,s}getTokenFromCode(t){t===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(133,2):super.getTokenFromCode(t)}parseExprAtom(t){return this.parsePlaceholder("Expression")||super.parseExprAtom(t)}parseIdentifier(t){return this.parsePlaceholder("Identifier")||super.parseIdentifier(t)}checkReservedWord(t,r,s,a){t!==void 0&&super.checkReservedWord(t,r,s,a)}cloneIdentifier(t){let r=super.cloneIdentifier(t);return r.type==="Placeholder"&&(r.expectedNode=t.expectedNode),r}cloneStringLiteral(t){return t.type==="Placeholder"?this.cloneIdentifier(t):super.cloneStringLiteral(t)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(t,r,s,a){return t==="Placeholder"||super.isValidLVal(t,r,s,a)}toAssignable(t,r){t&&t.type==="Placeholder"&&t.expectedNode==="Expression"?t.expectedNode="Pattern":super.toAssignable(t,r)}chStartsBindingIdentifier(t,r){if(super.chStartsBindingIdentifier(t,r))return!0;let s=this.nextTokenStart();return this.input.charCodeAt(s)===37&&this.input.charCodeAt(s+1)===37}verifyBreakContinue(t,r){var s;((s=t.label)==null?void 0:s.type)!=="Placeholder"&&super.verifyBreakContinue(t,r)}parseExpressionStatement(t,r){var s;if(r.type!=="Placeholder"||(s=r.extra)!=null&&s.parenthesized)return super.parseExpressionStatement(t,r);if(this.match(14)){let p=t;return p.label=this.finishPlaceholder(r,"Identifier"),this.next(),p.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(p,"LabeledStatement")}this.semicolon();let a=t;return a.name=r.name,this.finishPlaceholder(a,"Statement")}parseBlock(t,r,s){return this.parsePlaceholder("BlockStatement")||super.parseBlock(t,r,s)}parseFunctionId(t){return this.parsePlaceholder("Identifier")||super.parseFunctionId(t)}parseClass(t,r,s){let a=r?"ClassDeclaration":"ClassExpression";this.next();let p=this.state.strict,u=this.parsePlaceholder("Identifier");if(u)if(this.match(81)||this.match(133)||this.match(5))t.id=u;else{if(s||!r)return t.id=null,t.body=this.finishPlaceholder(u,"ClassBody"),this.finishNode(t,a);throw this.raise(Nh.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(t,r,s);return super.parseClassSuper(t),t.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!t.superClass,p),this.finishNode(t,a)}parseExport(t,r){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseExport(t,r);let a=t;if(!this.isContextual(98)&&!this.match(12))return a.specifiers=[],a.source=null,a.declaration=this.finishPlaceholder(s,"Declaration"),this.finishNode(a,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let p=this.startNode();return p.exported=s,a.specifiers=[this.finishNode(p,"ExportDefaultSpecifier")],super.parseExport(a,r)}isExportDefaultSpecifier(){if(this.match(65)){let t=this.nextTokenStart();if(this.isUnparsedContextual(t,"from")&&this.input.startsWith(Ft(133),this.nextTokenStartSince(t+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(t,r){var s;return(s=t.specifiers)!=null&&s.length?!0:super.maybeParseExportDefaultSpecifier(t,r)}checkExport(t){let{specifiers:r}=t;r!=null&&r.length&&(t.specifiers=r.filter(s=>s.exported.type==="Placeholder")),super.checkExport(t),t.specifiers=r}parseImport(t){let r=this.parsePlaceholder("Identifier");if(!r)return super.parseImport(t);if(t.specifiers=[],!this.isContextual(98)&&!this.match(12))return t.source=this.finishPlaceholder(r,"StringLiteral"),this.semicolon(),this.finishNode(t,"ImportDeclaration");let s=this.startNodeAtNode(r);return s.local=r,t.specifiers.push(this.finishNode(s,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(t)||this.parseNamedImportSpecifiers(t)),this.expectContextual(98),t.source=this.parseImportSource(),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(Nh.UnexpectedSpace,this.state.lastTokEndLoc)}},Ype=o=>class extends o{parseV8Intrinsic(){if(this.match(54)){let t=this.state.startLoc,r=this.startNode();if(this.next(),pe(this.state.type)){let s=this.parseIdentifierName(),a=this.createIdentifier(r,s);if(this.castNodeTo(a,"V8IntrinsicIdentifier"),this.match(10))return a}this.unexpected(t)}}parseExprAtom(t){return this.parseV8Intrinsic()||super.parseExprAtom(t)}},_h=["minimal","fsharp","hack","smart"],Bh=["^^","@@","^","%","#"];function Qpe(o){if(o.has("decorators")){if(o.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let r=o.get("decorators").decoratorsBeforeExport;if(r!=null&&typeof r!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let s=o.get("decorators").allowCallParenthesized;if(s!=null&&typeof s!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(o.has("flow")&&o.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(o.has("placeholders")&&o.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(o.has("pipelineOperator")){var e;let r=o.get("pipelineOperator").proposal;if(!_h.includes(r)){let s=_h.map(a=>`"${a}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${s}.`)}if(r==="hack"){var t;if(o.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(o.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let s=o.get("pipelineOperator").topicToken;if(!Bh.includes(s)){let a=Bh.map(p=>`"${p}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${a}.`)}if(s==="#"&&((t=o.get("recordAndTuple"))==null?void 0:t.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",o.get("recordAndTuple")])}\`.`)}else if(r==="smart"&&((e=o.get("recordAndTuple"))==null?void 0:e.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",o.get("recordAndTuple")])}\`.`)}if(o.has("moduleAttributes")){if(o.has("deprecatedImportAssert")||o.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if(o.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(o.has("importAssertions")&&o.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");if(o.has("deprecatedImportAssert")||o.has("importAttributes")&&o.get("importAttributes").deprecatedAssertSyntax&&o.set("deprecatedImportAssert",{}),o.has("recordAndTuple")){let r=o.get("recordAndTuple").syntaxType;if(r!=null){let s=["hash","bar"];if(!s.includes(r))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+s.map(a=>`'${a}'`).join(", "))}}if(o.has("asyncDoExpressions")&&!o.has("doExpressions")){let r=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw r.missingPlugins="doExpressions",r}if(o.has("optionalChainingAssign")&&o.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.");if(o.has("discardBinding")&&o.get("discardBinding").syntaxType!=="void")throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.")}var ef={estree:epe,jsx:Ppe,flow:wpe,typescript:Wpe,v8intrinsic:Ype,placeholders:qpe},Jpe=Object.keys(ef),_c=class extends Nc{checkProto(e,t,r,s){if(e.type==="SpreadElement"||this.isObjectMethod(e)||e.computed||e.shorthand)return r;let a=e.key;return(a.type==="Identifier"?a.name:a.value)==="__proto__"?t?(this.raise(R.RecordNoProto,a),!0):(r&&(s?s.doubleProtoLoc===null&&(s.doubleProtoLoc=a.loc.start):this.raise(R.DuplicateProto,a)),!0):r}shouldExitDescending(e,t){return e.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(e.start)===t}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(140))throw this.raise(R.ParseExpressionEmptyInput,this.state.startLoc);let e=this.parseExpression();if(!this.match(140))throw this.raise(R.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),e.comments=this.comments,e.errors=this.state.errors,this.optionFlags&256&&(e.tokens=this.tokens),e}parseExpression(e,t){return e?this.disallowInAnd(()=>this.parseExpressionBase(t)):this.allowInAnd(()=>this.parseExpressionBase(t))}parseExpressionBase(e){let t=this.state.startLoc,r=this.parseMaybeAssign(e);if(this.match(12)){let s=this.startNodeAt(t);for(s.expressions=[r];this.eat(12);)s.expressions.push(this.parseMaybeAssign(e));return this.toReferencedList(s.expressions),this.finishNode(s,"SequenceExpression")}return r}parseMaybeAssignDisallowIn(e,t){return this.disallowInAnd(()=>this.parseMaybeAssign(e,t))}parseMaybeAssignAllowIn(e,t){return this.allowInAnd(()=>this.parseMaybeAssign(e,t))}setOptionalParametersError(e){e.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(e,t){let r=this.state.startLoc,s=this.isContextual(108);if(s&&this.prodParam.hasYield){this.next();let f=this.parseYield(r);return t&&(f=t.call(this,f,r)),f}let a;e?a=!1:(e=new So,a=!0);let{type:p}=this.state;(p===10||pe(p))&&(this.state.potentialArrowAt=this.state.start);let u=this.parseMaybeConditional(e);if(t&&(u=t.call(this,u,r)),npe(this.state.type)){let f=this.startNodeAt(r),m=this.state.value;if(f.operator=m,this.match(29)){this.toAssignable(u,!0),f.left=u;let x=r.index;e.doubleProtoLoc!=null&&e.doubleProtoLoc.index>=x&&(e.doubleProtoLoc=null),e.shorthandAssignLoc!=null&&e.shorthandAssignLoc.index>=x&&(e.shorthandAssignLoc=null),e.privateKeyLoc!=null&&e.privateKeyLoc.index>=x&&(this.checkDestructuringPrivate(e),e.privateKeyLoc=null),e.voidPatternLoc!=null&&e.voidPatternLoc.index>=x&&(e.voidPatternLoc=null)}else f.left=u;return this.next(),f.right=this.parseMaybeAssign(),this.checkLVal(u,this.finishNode(f,"AssignmentExpression"),void 0,void 0,void 0,void 0,m==="||="||m==="&&="||m==="??="),f}else a&&this.checkExpressionErrors(e,!0);if(s){let{type:f}=this.state;if((this.hasPlugin("v8intrinsic")?pr(f):pr(f)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(R.YieldNotInGeneratorFunction,r),this.parseYield(r)}return u}parseMaybeConditional(e){let t=this.state.startLoc,r=this.state.potentialArrowAt,s=this.parseExprOps(e);return this.shouldExitDescending(s,r)?s:this.parseConditional(s,t,e)}parseConditional(e,t,r){if(this.eat(17)){let s=this.startNodeAt(t);return s.test=e,s.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),s.alternate=this.parseMaybeAssign(),this.finishNode(s,"ConditionalExpression")}return e}parseMaybeUnaryOrPrivate(e){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(e)}parseExprOps(e){let t=this.state.startLoc,r=this.state.potentialArrowAt,s=this.parseMaybeUnaryOrPrivate(e);return this.shouldExitDescending(s,r)?s:this.parseExprOp(s,t,-1)}parseExprOp(e,t,r){if(this.isPrivateName(e)){let a=this.getPrivateNameSV(e);(r>=Ws(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(R.PrivateInExpectedIn,e,{identifierName:a}),this.classScope.usePrivateName(a,e.loc.start)}let s=this.state.type;if(ape(s)&&(this.prodParam.hasIn||!this.match(58))){let a=Ws(s);if(a>r){if(s===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return e;this.checkPipelineAtInfixOperator(e,t)}let p=this.startNodeAt(t);p.left=e,p.operator=this.state.value;let u=s===41||s===42,f=s===40;if(f&&(a=Ws(42)),this.next(),s===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(R.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);p.right=this.parseExprOpRightExpr(s,a);let m=this.finishNode(p,u||f?"LogicalExpression":"BinaryExpression"),x=this.state.type;if(f&&(x===41||x===42)||u&&x===40)throw this.raise(R.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(m,t,r)}}return e}parseExprOpRightExpr(e,t){let r=this.state.startLoc;switch(e){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(t))}if(this.getPluginOption("pipelineOperator","proposal")==="smart")return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(R.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(e,t),r)});default:return this.parseExprOpBaseRightExpr(e,t)}}parseExprOpBaseRightExpr(e,t){let r=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),r,upe(e)?t-1:t)}parseHackPipeBody(){var e;let{startLoc:t}=this.state,r=this.parseMaybeAssign();return Gce.has(r.type)&&!((e=r.extra)!=null&&e.parenthesized)&&this.raise(R.PipeUnparenthesizedBody,t,{type:r.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(R.PipeTopicUnused,t),r}checkExponentialAfterUnary(e){this.match(57)&&this.raise(R.UnexpectedTokenUnaryExponentiation,e.argument)}parseMaybeUnary(e,t){let r=this.state.startLoc,s=this.isContextual(96);if(s&&this.recordAwaitIfAllowed()){this.next();let f=this.parseAwait(r);return t||this.checkExponentialAfterUnary(f),f}let a=this.match(34),p=this.startNode();if(ppe(this.state.type)){p.operator=this.state.value,p.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let f=this.match(89);if(this.next(),p.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),this.state.strict&&f){let m=p.argument;m.type==="Identifier"?this.raise(R.StrictDelete,p):this.hasPropertyAsPrivateName(m)&&this.raise(R.DeletePrivateField,p)}if(!a)return t||this.checkExponentialAfterUnary(p),this.finishNode(p,"UnaryExpression")}let u=this.parseUpdate(p,a,e);if(s){let{type:f}=this.state;if((this.hasPlugin("v8intrinsic")?pr(f):pr(f)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(R.AwaitNotInAsyncContext,r),this.parseAwait(r)}return u}parseUpdate(e,t,r){if(t){let p=e;return this.checkLVal(p.argument,this.finishNode(p,"UpdateExpression")),e}let s=this.state.startLoc,a=this.parseExprSubscripts(r);if(this.checkExpressionErrors(r,!1))return a;for(;cpe(this.state.type)&&!this.canInsertSemicolon();){let p=this.startNodeAt(s);p.operator=this.state.value,p.prefix=!1,p.argument=a,this.next(),this.checkLVal(a,a=this.finishNode(p,"UpdateExpression"))}return a}parseExprSubscripts(e){let t=this.state.startLoc,r=this.state.potentialArrowAt,s=this.parseExprAtom(e);return this.shouldExitDescending(s,r)?s:this.parseSubscripts(s,t)}parseSubscripts(e,t,r){let s={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(e),stop:!1};do e=this.parseSubscript(e,t,r,s),s.maybeAsyncArrow=!1;while(!s.stop);return e}parseSubscript(e,t,r,s){let{type:a}=this.state;if(!r&&a===15)return this.parseBind(e,t,s);if(Ks(a))return this.parseTaggedTemplateExpression(e,t,s);let p=!1;if(a===18){if(r&&(this.raise(R.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(e,s);s.optionalChainMember=p=!0,this.next()}if(!r&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(e,t,s,p);{let u=this.eat(0);return u||p||this.eat(16)?this.parseMember(e,t,s,u,p):this.stopParseSubscript(e,s)}}stopParseSubscript(e,t){return t.stop=!0,e}parseMember(e,t,r,s,a){let p=this.startNodeAt(t);return p.object=e,p.computed=s,s?(p.property=this.parseExpression(),this.expect(3)):this.match(139)?(e.type==="Super"&&this.raise(R.SuperPrivateField,t),this.classScope.usePrivateName(this.state.value,this.state.startLoc),p.property=this.parsePrivateName()):p.property=this.parseIdentifier(!0),r.optionalChainMember?(p.optional=a,this.finishNode(p,"OptionalMemberExpression")):this.finishNode(p,"MemberExpression")}parseBind(e,t,r){let s=this.startNodeAt(t);s.object=e,this.next();let a=this.match(83),p=this.parseNoCallExpr();if(p.type==="Super"||a&&p.type==="ImportExpression"||p.type==="Import")throw this.raise(R.UnsupportedBindRHS,p);return s.callee=p,r.stop=!0,this.parseSubscripts(this.finishNode(s,"BindExpression"),t,!1)}parseCoverCallAndAsyncArrowHead(e,t,r,s){let a=this.state.maybeInArrowParameters,p=null;this.state.maybeInArrowParameters=!0,this.next();let u=this.startNodeAt(t);u.callee=e;let{maybeAsyncArrow:f,optionalChainMember:m}=r;f&&(this.expressionScope.enter(jpe()),p=new So),m&&(u.optional=s),s?u.arguments=this.parseCallExpressionArguments():u.arguments=this.parseCallExpressionArguments(e.type!=="Super",u,p);let x=this.finishCallExpression(u,m);return f&&this.shouldParseAsyncArrow()&&!s?(r.stop=!0,this.checkDestructuringPrivate(p),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),x=this.parseAsyncArrowFromCallExpression(this.startNodeAt(t),x)):(f&&(this.checkExpressionErrors(p,!0),this.expressionScope.exit()),this.toReferencedArguments(x)),this.state.maybeInArrowParameters=a,x}toReferencedArguments(e,t){this.toReferencedListDeep(e.arguments,t)}parseTaggedTemplateExpression(e,t,r){let s=this.startNodeAt(t);return s.tag=e,s.quasi=this.parseTemplate(!0),r.optionalChainMember&&this.raise(R.OptionalChainingNoTemplate,t),this.finishNode(s,"TaggedTemplateExpression")}atPossibleAsyncArrow(e){return e.type==="Identifier"&&e.name==="async"&&this.state.lastTokEndLoc.index===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.offsetToSourcePos(e.start)===this.state.potentialArrowAt}finishCallExpression(e,t){if(e.callee.type==="Import")if(e.arguments.length===0||e.arguments.length>2)this.raise(R.ImportCallArity,e);else for(let r of e.arguments)r.type==="SpreadElement"&&this.raise(R.ImportCallSpreadArgument,r);return this.finishNode(e,t?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(e,t,r){let s=[],a=!0,p=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(11);){if(a)a=!1;else if(this.expect(12),this.match(11)){t&&this.addTrailingCommaExtraToNode(t),this.next();break}s.push(this.parseExprListItem(11,!1,r,e))}return this.state.inFSharpPipelineDirectBody=p,s}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(e,t){var r;return this.resetPreviousNodeTrailingComments(t),this.expect(19),this.parseArrowExpression(e,t.arguments,!0,(r=t.extra)==null?void 0:r.trailingCommaLoc),t.innerComments&&hr(e,t.innerComments),t.callee.trailingComments&&hr(e,t.callee.trailingComments),e}parseNoCallExpr(){let e=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),e,!0)}parseExprAtom(e){let t,r=null,{type:s}=this.state;switch(s){case 79:return this.parseSuper();case 83:return t=this.startNode(),this.next(),this.match(16)?this.parseImportMetaPropertyOrPhaseCall(t):this.match(10)?this.optionFlags&512?this.parseImportCall(t):this.finishNode(t,"Import"):(this.raise(R.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(t,"Import"));case 78:return t=this.startNode(),this.next(),this.finishNode(t,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let a=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(a)}case 0:return this.parseArrayLike(3,!1,e);case 5:return this.parseObjectLike(8,!1,!1,e);case 68:return this.parseFunctionOrFunctionSent();case 26:r=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(r,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{t=this.startNode(),this.next(),t.object=null;let a=t.callee=this.parseNoCallExpr();if(a.type==="MemberExpression")return this.finishNode(t,"BindExpression");throw this.raise(R.UnsupportedBind,a)}case 139:return this.raise(R.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let a=this.getPluginOption("pipelineOperator","proposal");if(a)return this.parseTopicReference(a);throw this.unexpected()}case 47:{let a=this.input.codePointAt(this.nextTokenStart());throw yt(a)||a===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected()}default:if(s===137)return this.parseDecimalLiteral(this.state.value);if(s===2||s===1)return this.parseArrayLike(this.state.type===2?4:3,!0);if(s===6||s===7)return this.parseObjectLike(this.state.type===6?9:8,!1,!0);if(pe(s)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let a=this.state.potentialArrowAt===this.state.start,p=this.state.containsEsc,u=this.parseIdentifier();if(!p&&u.name==="async"&&!this.canInsertSemicolon()){let{type:f}=this.state;if(f===68)return this.resetPreviousNodeTrailingComments(u),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(u));if(pe(f))return a&&this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(u)):u;if(f===90)return this.resetPreviousNodeTrailingComments(u),this.parseDo(this.startNodeAtNode(u),!0)}return a&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(u),[u],!1)):u}else throw this.unexpected()}}parseTopicReferenceThenEqualsSign(e,t){let r=this.getPluginOption("pipelineOperator","proposal");if(r)return this.state.type=e,this.state.value=t,this.state.pos--,this.state.end--,this.state.endLoc=je(this.state.endLoc,-1),this.parseTopicReference(r);throw this.unexpected()}parseTopicReference(e){let t=this.startNode(),r=this.state.startLoc,s=this.state.type;return this.next(),this.finishTopicReference(t,r,e,s)}finishTopicReference(e,t,r,s){if(this.testTopicReferenceConfiguration(r,t,s))return r==="hack"?(this.topicReferenceIsAllowedInCurrentContext()||this.raise(R.PipeTopicUnbound,t),this.registerTopicReference(),this.finishNode(e,"TopicReference")):(this.topicReferenceIsAllowedInCurrentContext()||this.raise(R.PrimaryTopicNotAllowed,t),this.registerTopicReference(),this.finishNode(e,"PipelinePrimaryTopicReference"));throw this.raise(R.PipeTopicUnconfiguredToken,t,{token:Ft(s)})}testTopicReferenceConfiguration(e,t,r){switch(e){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:Ft(r)}]);case"smart":return r===27;default:throw this.raise(R.PipeTopicRequiresHackPipes,t)}}parseAsyncArrowUnaryFunction(e){this.prodParam.enter($s(!0,this.prodParam.hasYield));let t=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(R.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(e,t,!0)}parseDo(e,t){this.expectPlugin("doExpressions"),t&&this.expectPlugin("asyncDoExpressions"),e.async=t,this.next();let r=this.state.labels;return this.state.labels=[],t?(this.prodParam.enter(2),e.body=this.parseBlock(),this.prodParam.exit()):e.body=this.parseBlock(),this.state.labels=r,this.finishNode(e,"DoExpression")}parseSuper(){let e=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper?this.optionFlags&16||this.raise(R.SuperNotAllowed,e):this.scope.allowSuper||this.optionFlags&16||this.raise(R.UnexpectedSuper,e),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(R.UnsupportedSuper,e),this.finishNode(e,"Super")}parsePrivateName(){let e=this.startNode(),t=this.startNodeAt(je(this.state.startLoc,1)),r=this.state.value;return this.next(),e.id=this.createIdentifier(t,r),this.finishNode(e,"PrivateName")}parseFunctionOrFunctionSent(){let e=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let t=this.createIdentifier(this.startNodeAtNode(e),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(e,t,"sent")}return this.parseFunction(e)}parseMetaProperty(e,t,r){e.meta=t;let s=this.state.containsEsc;return e.property=this.parseIdentifier(!0),(e.property.name!==r||s)&&this.raise(R.UnsupportedMetaProperty,e.property,{target:t.name,onlyValidPropertyName:r}),this.finishNode(e,"MetaProperty")}parseImportMetaPropertyOrPhaseCall(e){if(this.next(),this.isContextual(105)||this.isContextual(97)){let t=this.isContextual(105);return this.expectPlugin(t?"sourcePhaseImports":"deferredImportEvaluation"),this.next(),e.phase=t?"source":"defer",this.parseImportCall(e)}else{let t=this.createIdentifierAt(this.startNodeAtNode(e),"import",this.state.lastTokStartLoc);return this.isContextual(101)&&(this.inModule||this.raise(R.ImportMetaOutsideModule,t),this.sawUnambiguousESM=!0),this.parseMetaProperty(e,t,"meta")}}parseLiteralAtNode(e,t,r){return this.addExtra(r,"rawValue",e),this.addExtra(r,"raw",this.input.slice(this.offsetToSourcePos(r.start),this.state.end)),r.value=e,this.next(),this.finishNode(r,t)}parseLiteral(e,t){let r=this.startNode();return this.parseLiteralAtNode(e,t,r)}parseStringLiteral(e){return this.parseLiteral(e,"StringLiteral")}parseNumericLiteral(e){return this.parseLiteral(e,"NumericLiteral")}parseBigIntLiteral(e){return this.parseLiteral(e,"BigIntLiteral")}parseDecimalLiteral(e){return this.parseLiteral(e,"DecimalLiteral")}parseRegExpLiteral(e){let t=this.startNode();return this.addExtra(t,"raw",this.input.slice(this.offsetToSourcePos(t.start),this.state.end)),t.pattern=e.pattern,t.flags=e.flags,this.next(),this.finishNode(t,"RegExpLiteral")}parseBooleanLiteral(e){let t=this.startNode();return t.value=e,this.next(),this.finishNode(t,"BooleanLiteral")}parseNullLiteral(){let e=this.startNode();return this.next(),this.finishNode(e,"NullLiteral")}parseParenAndDistinguishExpression(e){let t=this.state.startLoc,r;this.next(),this.expressionScope.enter(Bpe());let s=this.state.maybeInArrowParameters,a=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let p=this.state.startLoc,u=[],f=new So,m=!0,x,g;for(;!this.match(11);){if(m)m=!1;else if(this.expect(12,f.optionalParametersLoc===null?null:f.optionalParametersLoc),this.match(11)){g=this.state.startLoc;break}if(this.match(21)){let k=this.state.startLoc;if(x=this.state.startLoc,u.push(this.parseParenItem(this.parseRestBinding(),k)),!this.checkCommaAfterRest(41))break}else u.push(this.parseMaybeAssignAllowInOrVoidPattern(11,f,this.parseParenItem))}let z=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=s,this.state.inFSharpPipelineDirectBody=a;let w=this.startNodeAt(t);return e&&this.shouldParseArrow(u)&&(w=this.parseArrow(w))?(this.checkDestructuringPrivate(f),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(w,u,!1),w):(this.expressionScope.exit(),u.length||this.unexpected(this.state.lastTokStartLoc),g&&this.unexpected(g),x&&this.unexpected(x),this.checkExpressionErrors(f,!0),this.toReferencedListDeep(u,!0),u.length>1?(r=this.startNodeAt(p),r.expressions=u,this.finishNode(r,"SequenceExpression"),this.resetEndLocation(r,z)):r=u[0],this.wrapParenthesis(t,r))}wrapParenthesis(e,t){if(!(this.optionFlags&1024))return this.addExtra(t,"parenthesized",!0),this.addExtra(t,"parenStart",e.index),this.takeSurroundingComments(t,e.index,this.state.lastTokEndLoc.index),t;let r=this.startNodeAt(e);return r.expression=t,this.finishNode(r,"ParenthesizedExpression")}shouldParseArrow(e){return!this.canInsertSemicolon()}parseArrow(e){if(this.eat(19))return e}parseParenItem(e,t){return e}parseNewOrNewTarget(){let e=this.startNode();if(this.next(),this.match(16)){let t=this.createIdentifier(this.startNodeAtNode(e),"new");this.next();let r=this.parseMetaProperty(e,t,"target");return this.scope.allowNewTarget||this.raise(R.UnexpectedNewTarget,r),r}return this.parseNew(e)}parseNew(e){if(this.parseNewCallee(e),this.eat(10)){let t=this.parseExprList(11);this.toReferencedList(t),e.arguments=t}else e.arguments=[];return this.finishNode(e,"NewExpression")}parseNewCallee(e){let t=this.match(83),r=this.parseNoCallExpr();e.callee=r,(t&&r.type==="ImportExpression"||r.type==="Import")&&this.raise(R.ImportCallNotNewExpression,r),r.type==="Super"&&this.raise(R.SuperCallNotNewExpression,r)}parseTemplateElement(e){let{start:t,startLoc:r,end:s,value:a}=this.state,p=t+1,u=this.startNodeAt(je(r,1));a===null&&(e||this.raise(R.InvalidEscapeSequenceTemplate,je(this.state.firstInvalidTemplateEscapePos,1)));let f=this.match(24),m=f?-1:-2,x=s+m;u.value={raw:this.input.slice(p,x).replace(/\r\n?/g,`
9
+ `),cooked:a===null?null:a.slice(1,m)},u.tail=f,this.next();let g=this.finishNode(u,"TemplateElement");return this.resetEndLocation(g,je(this.state.lastTokEndLoc,m)),g}parseTemplate(e){let t=this.startNode(),r=this.parseTemplateElement(e),s=[r],a=[];for(;!r.tail;)a.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),s.push(r=this.parseTemplateElement(e));return t.expressions=a,t.quasis=s,this.finishNode(t,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(e,t,r,s){r&&this.expectPlugin("recordAndTuple");let a=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let p=!1,u=!0,f=this.startNode();for(f.properties=[],this.next();!this.match(e);){if(u)u=!1;else if(this.expect(12),this.match(e)){this.addTrailingCommaExtraToNode(f);break}let x;t?x=this.parseBindingProperty():(x=this.parsePropertyDefinition(s),p=this.checkProto(x,r,p,s)),r&&!this.isObjectProperty(x)&&x.type!=="SpreadElement"&&this.raise(R.InvalidRecordProperty,x),x.shorthand&&this.addExtra(x,"shorthand",!0),f.properties.push(x)}this.next(),this.state.inFSharpPipelineDirectBody=a;let m="ObjectExpression";return t?m="ObjectPattern":r&&(m="RecordExpression"),this.finishNode(f,m)}addTrailingCommaExtraToNode(e){this.addExtra(e,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(e,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(e){return!e.computed&&e.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(e){let t=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(R.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)t.push(this.parseDecorator());let r=this.startNode(),s=!1,a=!1,p;if(this.match(21))return t.length&&this.unexpected(),this.parseSpread();t.length&&(r.decorators=t,t=[]),r.method=!1,e&&(p=this.state.startLoc);let u=this.eat(55);this.parsePropertyNamePrefixOperator(r);let f=this.state.containsEsc;if(this.parsePropertyName(r,e),!u&&!f&&this.maybeAsyncOrAccessorProp(r)){let{key:m}=r,x=m.name;x==="async"&&!this.hasPrecedingLineBreak()&&(s=!0,this.resetPreviousNodeTrailingComments(m),u=this.eat(55),this.parsePropertyName(r)),(x==="get"||x==="set")&&(a=!0,this.resetPreviousNodeTrailingComments(m),r.kind=x,this.match(55)&&(u=!0,this.raise(R.AccessorIsGenerator,this.state.curPosition(),{kind:x}),this.next()),this.parsePropertyName(r))}return this.parseObjPropValue(r,p,u,s,!1,a,e)}getGetterSetterExpectedParamCount(e){return e.kind==="get"?0:1}getObjectOrClassMethodParams(e){return e.params}checkGetterSetterParams(e){var t;let r=this.getGetterSetterExpectedParamCount(e),s=this.getObjectOrClassMethodParams(e);s.length!==r&&this.raise(e.kind==="get"?R.BadGetterArity:R.BadSetterArity,e),e.kind==="set"&&((t=s[s.length-1])==null?void 0:t.type)==="RestElement"&&this.raise(R.BadSetterRestParameter,e)}parseObjectMethod(e,t,r,s,a){if(a){let p=this.parseMethod(e,t,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(p),p}if(r||t||this.match(10))return s&&this.unexpected(),e.kind="method",e.method=!0,this.parseMethod(e,t,r,!1,!1,"ObjectMethod")}parseObjectProperty(e,t,r,s){if(e.shorthand=!1,this.eat(14))return e.value=r?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(8,s),this.finishObjectProperty(e);if(!e.computed&&e.key.type==="Identifier"){if(this.checkReservedWord(e.key.name,e.key.loc.start,!0,!1),r)e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key));else if(this.match(29)){let a=this.state.startLoc;s!=null?s.shorthandAssignLoc===null&&(s.shorthandAssignLoc=a):this.raise(R.InvalidCoverInitializedName,a),e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key))}else e.value=this.cloneIdentifier(e.key);return e.shorthand=!0,this.finishObjectProperty(e)}}finishObjectProperty(e){return this.finishNode(e,"ObjectProperty")}parseObjPropValue(e,t,r,s,a,p,u){let f=this.parseObjectMethod(e,r,s,a,p)||this.parseObjectProperty(e,t,a,u);return f||this.unexpected(),f}parsePropertyName(e,t){if(this.eat(0))e.computed=!0,e.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:r,value:s}=this.state,a;if(pt(r))a=this.parseIdentifier(!0);else switch(r){case 135:a=this.parseNumericLiteral(s);break;case 134:a=this.parseStringLiteral(s);break;case 136:a=this.parseBigIntLiteral(s);break;case 139:{let p=this.state.startLoc;t!=null?t.privateKeyLoc===null&&(t.privateKeyLoc=p):this.raise(R.UnexpectedPrivateField,p),a=this.parsePrivateName();break}default:if(r===137){a=this.parseDecimalLiteral(s);break}this.unexpected()}e.key=a,r!==139&&(e.computed=!1)}}initFunction(e,t){e.id=null,e.generator=!1,e.async=t}parseMethod(e,t,r,s,a,p,u=!1){this.initFunction(e,r),e.generator=t,this.scope.enter(530|(u?576:0)|(a?32:0)),this.prodParam.enter($s(r,e.generator)),this.parseFunctionParams(e,s);let f=this.parseFunctionBodyAndFinish(e,p,!0);return this.prodParam.exit(),this.scope.exit(),f}parseArrayLike(e,t,r){t&&this.expectPlugin("recordAndTuple");let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=this.startNode();return this.next(),a.elements=this.parseExprList(e,!t,r,a),this.state.inFSharpPipelineDirectBody=s,this.finishNode(a,t?"TupleExpression":"ArrayExpression")}parseArrowExpression(e,t,r,s){this.scope.enter(518);let a=$s(r,!1);!this.match(5)&&this.prodParam.hasIn&&(a|=8),this.prodParam.enter(a),this.initFunction(e,r);let p=this.state.maybeInArrowParameters;return t&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(e,t,s)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(e,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=p,this.finishNode(e,"ArrowFunctionExpression")}setArrowFunctionParameters(e,t,r){this.toAssignableList(t,r,!1),e.params=t}parseFunctionBodyAndFinish(e,t,r=!1){return this.parseFunctionBody(e,!1,r),this.finishNode(e,t)}parseFunctionBody(e,t,r=!1){let s=t&&!this.match(5);if(this.expressionScope.enter(Jh()),s)e.body=this.parseMaybeAssign(),this.checkParams(e,!1,t,!1);else{let a=this.state.strict,p=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),e.body=this.parseBlock(!0,!1,u=>{let f=!this.isSimpleParamList(e.params);u&&f&&this.raise(R.IllegalLanguageModeDirective,(e.kind==="method"||e.kind==="constructor")&&e.key?e.key.loc.end:e);let m=!a&&this.state.strict;this.checkParams(e,!this.state.strict&&!t&&!r&&!f,t,m),this.state.strict&&e.id&&this.checkIdentifier(e.id,65,m)}),this.prodParam.exit(),this.state.labels=p}this.expressionScope.exit()}isSimpleParameter(e){return e.type==="Identifier"}isSimpleParamList(e){for(let t=0,r=e.length;t<r;t++)if(!this.isSimpleParameter(e[t]))return!1;return!0}checkParams(e,t,r,s=!0){let a=!t&&new Set,p={type:"FormalParameters"};for(let u of e.params)this.checkLVal(u,p,5,a,s)}parseExprList(e,t,r,s){let a=[],p=!0;for(;!this.eat(e);){if(p)p=!1;else if(this.expect(12),this.match(e)){s&&this.addTrailingCommaExtraToNode(s),this.next();break}a.push(this.parseExprListItem(e,t,r))}return a}parseExprListItem(e,t,r,s){let a;if(this.match(12))t||this.raise(R.UnexpectedToken,this.state.curPosition(),{unexpected:","}),a=null;else if(this.match(21)){let p=this.state.startLoc;a=this.parseParenItem(this.parseSpread(r),p)}else if(this.match(17)){this.expectPlugin("partialApplication"),s||this.raise(R.UnexpectedArgumentPlaceholder,this.state.startLoc);let p=this.startNode();this.next(),a=this.finishNode(p,"ArgumentPlaceholder")}else a=this.parseMaybeAssignAllowInOrVoidPattern(e,r,this.parseParenItem);return a}parseIdentifier(e){let t=this.startNode(),r=this.parseIdentifierName(e);return this.createIdentifier(t,r)}createIdentifier(e,t){return e.name=t,e.loc.identifierName=t,this.finishNode(e,"Identifier")}createIdentifierAt(e,t,r){return e.name=t,e.loc.identifierName=t,this.finishNodeAt(e,"Identifier",r)}parseIdentifierName(e){let t,{startLoc:r,type:s}=this.state;pt(s)?t=this.state.value:this.unexpected();let a=rpe(s);return e?a&&this.replaceToken(132):this.checkReservedWord(t,r,a,!1),this.next(),t}checkReservedWord(e,t,r,s){if(e.length>10||!zpe(e))return;if(r&&ype(e)){this.raise(R.UnexpectedKeyword,t,{keyword:e});return}if((this.state.strict?s?Kh:$h:Wh)(e,this.inModule)){this.raise(R.UnexpectedReservedWord,t,{reservedWord:e});return}else if(e==="yield"){if(this.prodParam.hasYield){this.raise(R.YieldBindingIdentifier,t);return}}else if(e==="await"){if(this.prodParam.hasAwait){this.raise(R.AwaitBindingIdentifier,t);return}if(this.scope.inStaticBlock){this.raise(R.AwaitBindingIdentifierInStaticBlock,t);return}this.expressionScope.recordAsyncArrowParametersError(t)}else if(e==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(R.ArgumentsInClass,t);return}}recordAwaitIfAllowed(){let e=this.prodParam.hasAwait;return e&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),e}parseAwait(e){let t=this.startNodeAt(e);return this.expressionScope.recordParameterInitializerError(R.AwaitExpressionFormalParameter,t),this.eat(55)&&this.raise(R.ObsoleteAwaitStar,t),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(t.argument=this.parseMaybeUnary(null,!0)),this.finishNode(t,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:e}=this.state;return e===53||e===10||e===0||Ks(e)||e===102&&!this.state.containsEsc||e===138||e===56||this.hasPlugin("v8intrinsic")&&e===54}parseYield(e){let t=this.startNodeAt(e);this.expressionScope.recordParameterInitializerError(R.YieldInParameter,t);let r=!1,s=null;if(!this.hasPrecedingLineBreak())switch(r=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!r)break;default:s=this.parseMaybeAssign()}return t.delegate=r,t.argument=s,this.finishNode(t,"YieldExpression")}parseImportCall(e){if(this.next(),e.source=this.parseMaybeAssignAllowIn(),e.options=null,this.eat(12)){if(this.match(11))this.addTrailingCommaExtraToNode(e.source);else if(e.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&(this.addTrailingCommaExtraToNode(e.options),!this.match(11))){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(R.ImportCallArity,e)}}return this.expect(11),this.finishNode(e,"ImportExpression")}checkPipelineAtInfixOperator(e,t){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&e.type==="SequenceExpression"&&this.raise(R.PipelineHeadSequenceExpression,t)}parseSmartPipelineBodyInStyle(e,t){if(this.isSimpleReference(e)){let r=this.startNodeAt(t);return r.callee=e,this.finishNode(r,"PipelineBareFunction")}else{let r=this.startNodeAt(t);return this.checkSmartPipeTopicBodyEarlyErrors(t),r.expression=e,this.finishNode(r,"PipelineTopicExpression")}}isSimpleReference(e){switch(e.type){case"MemberExpression":return!e.computed&&this.isSimpleReference(e.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(e){if(this.match(19))throw this.raise(R.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(R.PipelineTopicUnused,e)}withTopicBindingContext(e){let t=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return e()}finally{this.state.topicContext=t}}withSmartMixTopicForbiddingContext(e){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let t=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return e()}finally{this.state.topicContext=t}}else return e()}withSoloAwaitPermittingContext(e){let t=this.state.soloAwait;this.state.soloAwait=!0;try{return e()}finally{this.state.soloAwait=t}}allowInAnd(e){let t=this.prodParam.currentFlags();if(8&~t){this.prodParam.enter(t|8);try{return e()}finally{this.prodParam.exit()}}return e()}disallowInAnd(e){let t=this.prodParam.currentFlags();if(8&t){this.prodParam.enter(t&-9);try{return e()}finally{this.prodParam.exit()}}return e()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(e){let t=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let s=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,e);return this.state.inFSharpPipelineDirectBody=r,s}parseModuleExpression(){this.expectPlugin("moduleBlocks");let e=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let t=this.startNodeAt(this.state.endLoc);this.next();let r=this.initializeScopes(!0);this.enterInitialScopes();try{e.body=this.parseProgram(t,8,"module")}finally{r()}return this.finishNode(e,"ModuleExpression")}parseVoidPattern(e){this.expectPlugin("discardBinding");let t=this.startNode();return e!=null&&(e.voidPatternLoc=this.state.startLoc),this.next(),this.finishNode(t,"VoidPattern")}parseMaybeAssignAllowInOrVoidPattern(e,t,r){if(t!=null&&this.match(88)){let s=this.lookaheadCharCode();if(s===44||s===(e===3?93:e===8?125:41)||s===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(t))}return this.parseMaybeAssignAllowIn(t,r)}parsePropertyNamePrefixOperator(e){}},gc={kind:1},Zpe={kind:2},Xpe=/[\uD800-\uDFFF]/u,bc=/in(?:stanceof)?/y;function ede(o,e,t){for(let r=0;r<o.length;r++){let s=o[r],{type:a}=s;if(typeof a=="number"){if(a===139){let{loc:p,start:u,value:f,end:m}=s,x=u+1,g=je(p.start,1);o.splice(r,1,new bt({type:Ct(27),value:"#",start:u,end:x,startLoc:p.start,endLoc:g}),new bt({type:Ct(132),value:f,start:x,end:m,startLoc:g,endLoc:p.end})),r++;continue}if(Ks(a)){let{loc:p,start:u,value:f,end:m}=s,x=u+1,g=je(p.start,1),z;e.charCodeAt(u-t)===96?z=new bt({type:Ct(22),value:"`",start:u,end:x,startLoc:p.start,endLoc:g}):z=new bt({type:Ct(8),value:"}",start:u,end:x,startLoc:p.start,endLoc:g});let w,k,F,Y;a===24?(k=m-1,F=je(p.end,-1),w=f===null?null:f.slice(1,-1),Y=new bt({type:Ct(22),value:"`",start:k,end:m,startLoc:F,endLoc:p.end})):(k=m-2,F=je(p.end,-2),w=f===null?null:f.slice(1,-2),Y=new bt({type:Ct(23),value:"${",start:k,end:m,startLoc:F,endLoc:p.end})),o.splice(r,1,z,new bt({type:Ct(20),value:w,start:x,end:k,startLoc:g,endLoc:F}),Y),r+=2;continue}s.type=Ct(a)}}return o}var Bc=class extends _c{parseTopLevel(e,t){return e.program=this.parseProgram(t,140,this.options.sourceType==="module"?"module":"script"),e.comments=this.comments,this.optionFlags&256&&(e.tokens=ede(this.tokens,this.input,this.startIndex)),this.finishNode(e,"File")}parseProgram(e,t,r){if(e.sourceType=r,e.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(e,!0,!0,t),this.inModule){if(!(this.optionFlags&64)&&this.scope.undefinedExports.size>0)for(let[a,p]of Array.from(this.scope.undefinedExports))this.raise(R.ModuleExportUndefined,p,{localName:a});this.addExtra(e,"topLevelAwait",this.state.hasTopLevelAwait)}let s;return t===140?s=this.finishNode(e,"Program"):s=this.finishNodeAt(e,"Program",je(this.state.startLoc,-1)),s}stmtToDirective(e){let t=this.castNodeTo(e,"Directive"),r=this.castNodeTo(e.expression,"DirectiveLiteral"),s=r.value,a=this.input.slice(this.offsetToSourcePos(r.start),this.offsetToSourcePos(r.end)),p=r.value=a.slice(1,-1);return this.addExtra(r,"raw",a),this.addExtra(r,"rawValue",p),this.addExtra(r,"expressionValue",s),t.value=r,delete e.expression,t}parseInterpreterDirective(){if(!this.match(28))return null;let e=this.startNode();return e.value=this.state.value,this.next(),this.finishNode(e,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(107)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(107))return!1;let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);if(this.isUnparsedContextual(e,"of")){let r=this.lookaheadCharCodeSince(e+2);if(r!==61&&r!==58&&r!==59)return!1}return!!(this.chStartsBindingIdentifier(t,e)||this.isUnparsedContextual(e,"void"))}nextTokenIsIdentifierOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return this.chStartsBindingIdentifier(t,e)}isAwaitUsing(){if(!this.isContextual(96))return!1;let e=this.nextTokenInLineStart();if(this.isUnparsedContextual(e,"using")){e=this.nextTokenInLineStartSince(e+5);let t=this.codePointAtPos(e);if(this.chStartsBindingIdentifier(t,e))return!0}return!1}chStartsBindingIdentifier(e,t){if(yt(e)){if(bc.lastIndex=t,bc.test(this.input)){let r=this.codePointAtPos(bc.lastIndex);if(!Kt(r)&&r!==92)return!1}return!0}else return e===92}chStartsBindingPattern(e){return e===91||e===123}hasFollowingBindingAtom(){let e=this.nextTokenStart(),t=this.codePointAtPos(e);return this.chStartsBindingPattern(t)||this.chStartsBindingIdentifier(t,e)}hasInLineFollowingBindingIdentifierOrBrace(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return t===123||this.chStartsBindingIdentifier(t,e)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(e=!1){let t=0;return this.options.annexB&&!this.state.strict&&(t|=4,e&&(t|=8)),this.parseStatementLike(t)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(e){let t=null;return this.match(26)&&(t=this.parseDecorators(!0)),this.parseStatementContent(e,t)}parseStatementContent(e,t){let r=this.state.type,s=this.startNode(),a=!!(e&2),p=!!(e&4),u=e&1;switch(r){case 60:return this.parseBreakContinueStatement(s,!0);case 63:return this.parseBreakContinueStatement(s,!1);case 64:return this.parseDebuggerStatement(s);case 90:return this.parseDoWhileStatement(s);case 91:return this.parseForStatement(s);case 68:if(this.lookaheadCharCode()===46)break;return p||this.raise(this.state.strict?R.StrictFunction:this.options.annexB?R.SloppyFunctionAnnexB:R.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(s,!1,!a&&p);case 80:return a||this.unexpected(),this.parseClass(this.maybeTakeDecorators(t,s),!0);case 69:return this.parseIfStatement(s);case 70:return this.parseReturnStatement(s);case 71:return this.parseSwitchStatement(s);case 72:return this.parseThrowStatement(s);case 73:return this.parseTryStatement(s);case 96:if(this.isAwaitUsing())return this.allowsUsing()?a?this.recordAwaitIfAllowed()||this.raise(R.AwaitUsingNotInAsyncContext,s):this.raise(R.UnexpectedLexicalDeclaration,s):this.raise(R.UnexpectedUsingDeclaration,s),this.next(),this.parseVarStatement(s,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?a||this.raise(R.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(R.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(s,"using");case 100:{if(this.state.containsEsc)break;let x=this.nextTokenStart(),g=this.codePointAtPos(x);if(g!==91&&(!a&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(g,x)&&g!==123))break}case 75:a||this.raise(R.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let x=this.state.value;return this.parseVarStatement(s,x)}case 92:return this.parseWhileStatement(s);case 76:return this.parseWithStatement(s);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(s);case 83:{let x=this.lookaheadCharCode();if(x===40||x===46)break}case 82:{!(this.optionFlags&8)&&!u&&this.raise(R.UnexpectedImportExport,this.state.startLoc),this.next();let x;return r===83?x=this.parseImport(s):x=this.parseExport(s,t),this.assertModuleNodeAllowed(x),x}default:if(this.isAsyncFunction())return a||this.raise(R.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(s,!0,!a&&p)}let f=this.state.value,m=this.parseExpression();return pe(r)&&m.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(s,f,m,e):this.parseExpressionStatement(s,m,t)}assertModuleNodeAllowed(e){!(this.optionFlags&8)&&!this.inModule&&this.raise(R.ImportOutsideModule,e)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(e,t,r){if(e){var s;(s=t.decorators)!=null&&s.length?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(R.DecoratorsBeforeAfterExport,t.decorators[0]),t.decorators.unshift(...e)):t.decorators=e,this.resetStartLocationFromNode(t,e[0]),r&&this.resetStartLocationFromNode(r,t)}return t}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(e){let t=[];do t.push(this.parseDecorator());while(this.match(26));if(this.match(82))e||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(R.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(R.UnexpectedLeadingDecorator,this.state.startLoc);return t}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let e=this.startNode();if(this.next(),this.hasPlugin("decorators")){let t=this.state.startLoc,r;if(this.match(10)){let s=this.state.startLoc;this.next(),r=this.parseExpression(),this.expect(11),r=this.wrapParenthesis(s,r);let a=this.state.startLoc;e.expression=this.parseMaybeDecoratorArguments(r,s),this.getPluginOption("decorators","allowCallParenthesized")===!1&&e.expression!==r&&this.raise(R.DecoratorArgumentsOutsideParentheses,a)}else{for(r=this.parseIdentifier(!1);this.eat(16);){let s=this.startNodeAt(t);s.object=r,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),s.property=this.parsePrivateName()):s.property=this.parseIdentifier(!0),s.computed=!1,r=this.finishNode(s,"MemberExpression")}e.expression=this.parseMaybeDecoratorArguments(r,t)}}else e.expression=this.parseExprSubscripts();return this.finishNode(e,"Decorator")}parseMaybeDecoratorArguments(e,t){if(this.eat(10)){let r=this.startNodeAt(t);return r.callee=e,r.arguments=this.parseCallExpressionArguments(),this.toReferencedList(r.arguments),this.finishNode(r,"CallExpression")}return e}parseBreakContinueStatement(e,t){return this.next(),this.isLineTerminator()?e.label=null:(e.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(e,t),this.finishNode(e,t?"BreakStatement":"ContinueStatement")}verifyBreakContinue(e,t){let r;for(r=0;r<this.state.labels.length;++r){let s=this.state.labels[r];if((e.label==null||s.name===e.label.name)&&(s.kind!=null&&(t||s.kind===1)||e.label&&t))break}if(r===this.state.labels.length){let s=t?"BreakStatement":"ContinueStatement";this.raise(R.IllegalBreakContinue,e,{type:s})}}parseDebuggerStatement(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let e=this.parseExpression();return this.expect(11),e}parseDoWhileStatement(e){return this.next(),this.state.labels.push(gc),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),e.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(e,"DoWhileStatement")}parseForStatement(e){this.next(),this.state.labels.push(gc);let t=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(t=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return t!==null&&this.unexpected(t),this.parseFor(e,null);let r=this.isContextual(100);{let f=this.isAwaitUsing(),m=f||this.isForUsing(),x=r&&this.hasFollowingBindingAtom()||m;if(this.match(74)||this.match(75)||x){let g=this.startNode(),z;f?(z="await using",this.recordAwaitIfAllowed()||this.raise(R.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):z=this.state.value,this.next(),this.parseVar(g,!0,z);let w=this.finishNode(g,"VariableDeclaration"),k=this.match(58);return k&&m&&this.raise(R.ForInUsing,w),(k||this.isContextual(102))&&w.declarations.length===1?this.parseForIn(e,w,t):(t!==null&&this.unexpected(t),this.parseFor(e,w))}}let s=this.isContextual(95),a=new So,p=this.parseExpression(!0,a),u=this.isContextual(102);if(u&&(r&&this.raise(R.ForOfLet,p),t===null&&s&&p.type==="Identifier"&&this.raise(R.ForOfAsync,p)),u||this.match(58)){this.checkDestructuringPrivate(a),this.toAssignable(p,!0);let f=u?"ForOfStatement":"ForInStatement";return this.checkLVal(p,{type:f}),this.parseForIn(e,p,t)}else this.checkExpressionErrors(a,!0);return t!==null&&this.unexpected(t),this.parseFor(e,p)}parseFunctionStatement(e,t,r){return this.next(),this.parseFunction(e,1|(r?2:0)|(t?8:0))}parseIfStatement(e){return this.next(),e.test=this.parseHeaderExpression(),e.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),e.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(e,"IfStatement")}parseReturnStatement(e){return this.prodParam.hasReturn||this.raise(R.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")}parseSwitchStatement(e){this.next(),e.discriminant=this.parseHeaderExpression();let t=e.cases=[];this.expect(5),this.state.labels.push(Zpe),this.scope.enter(256);let r;for(let s;!this.match(8);)if(this.match(61)||this.match(65)){let a=this.match(61);r&&this.finishNode(r,"SwitchCase"),t.push(r=this.startNode()),r.consequent=[],this.next(),a?r.test=this.parseExpression():(s&&this.raise(R.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),s=!0,r.test=null),this.expect(14)}else r?r.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),r&&this.finishNode(r,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(e,"SwitchStatement")}parseThrowStatement(e){return this.next(),this.hasPrecedingLineBreak()&&this.raise(R.NewlineAfterThrow,this.state.lastTokEndLoc),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")}parseCatchClauseParam(){let e=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&e.type==="Identifier"?8:0),this.checkLVal(e,{type:"CatchClause"},9),e}parseTryStatement(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.match(62)){let t=this.startNode();this.next(),this.match(10)?(this.expect(10),t.param=this.parseCatchClauseParam(),this.expect(11)):(t.param=null,this.scope.enter(0)),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(67)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(R.NoCatchOrFinally,e),this.finishNode(e,"TryStatement")}parseVarStatement(e,t,r=!1){return this.next(),this.parseVar(e,!1,t,r),this.semicolon(),this.finishNode(e,"VariableDeclaration")}parseWhileStatement(e){return this.next(),e.test=this.parseHeaderExpression(),this.state.labels.push(gc),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(e,"WhileStatement")}parseWithStatement(e){return this.state.strict&&this.raise(R.StrictWith,this.state.startLoc),this.next(),e.object=this.parseHeaderExpression(),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(e,"WithStatement")}parseEmptyStatement(e){return this.next(),this.finishNode(e,"EmptyStatement")}parseLabeledStatement(e,t,r,s){for(let p of this.state.labels)p.name===t&&this.raise(R.LabelRedeclaration,r,{labelName:t});let a=ipe(this.state.type)?1:this.match(71)?2:null;for(let p=this.state.labels.length-1;p>=0;p--){let u=this.state.labels[p];if(u.statementStart===e.start)u.statementStart=this.sourceToOffsetPos(this.state.start),u.kind=a;else break}return this.state.labels.push({name:t,kind:a,statementStart:this.sourceToOffsetPos(this.state.start)}),e.body=s&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")}parseExpressionStatement(e,t,r){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")}parseBlock(e=!1,t=!0,r){let s=this.startNode();return e&&this.state.strictErrors.clear(),this.expect(5),t&&this.scope.enter(0),this.parseBlockBody(s,e,!1,8,r),t&&this.scope.exit(),this.finishNode(s,"BlockStatement")}isValidDirective(e){return e.type==="ExpressionStatement"&&e.expression.type==="StringLiteral"&&!e.expression.extra.parenthesized}parseBlockBody(e,t,r,s,a){let p=e.body=[],u=e.directives=[];this.parseBlockOrModuleBlockBody(p,t?u:void 0,r,s,a)}parseBlockOrModuleBlockBody(e,t,r,s,a){let p=this.state.strict,u=!1,f=!1;for(;!this.match(s);){let m=r?this.parseModuleItem():this.parseStatementListItem();if(t&&!f){if(this.isValidDirective(m)){let x=this.stmtToDirective(m);t.push(x),!u&&x.value.value==="use strict"&&(u=!0,this.setStrict(!0));continue}f=!0,this.state.strictErrors.clear()}e.push(m)}a?.call(this,u),p||this.setStrict(!1),this.next()}parseFor(e,t){return e.init=t,this.semicolon(!1),e.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),e.update=this.match(11)?null:this.parseExpression(),this.expect(11),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,"ForStatement")}parseForIn(e,t,r){let s=this.match(58);return this.next(),s?r!==null&&this.unexpected(r):e.await=r!==null,t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!s||!this.options.annexB||this.state.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(R.ForInOfLoopInitializer,t,{type:s?"ForInStatement":"ForOfStatement"}),t.type==="AssignmentPattern"&&this.raise(R.InvalidLhs,t,{ancestor:{type:"ForStatement"}}),e.left=t,e.right=s?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,s?"ForInStatement":"ForOfStatement")}parseVar(e,t,r,s=!1){let a=e.declarations=[];for(e.kind=r;;){let p=this.startNode();if(this.parseVarId(p,r),p.init=this.eat(29)?t?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,p.init===null&&!s&&(p.id.type!=="Identifier"&&!(t&&(this.match(58)||this.isContextual(102)))?this.raise(R.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(r==="const"||r==="using"||r==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(R.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:r})),a.push(this.finishNode(p,"VariableDeclarator")),!this.eat(12))break}return e}parseVarId(e,t){let r=this.parseBindingAtom();t==="using"||t==="await using"?(r.type==="ArrayPattern"||r.type==="ObjectPattern")&&this.raise(R.UsingDeclarationHasBindingPattern,r.loc.start):r.type==="VoidPattern"&&this.raise(R.UnexpectedVoidPattern,r.loc.start),this.checkLVal(r,{type:"VariableDeclarator"},t==="var"?5:8201),e.id=r}parseAsyncFunctionExpression(e){return this.parseFunction(e,8)}parseFunction(e,t=0){let r=t&2,s=!!(t&1),a=s&&!(t&4),p=!!(t&8);this.initFunction(e,p),this.match(55)&&(r&&this.raise(R.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),e.generator=!0),s&&(e.id=this.parseFunctionId(a));let u=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(514),this.prodParam.enter($s(p,e.generator)),s||(e.id=this.parseFunctionId()),this.parseFunctionParams(e,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(e,s?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),s&&!r&&this.registerFunctionStatementId(e),this.state.maybeInArrowParameters=u,e}parseFunctionId(e){return e||pe(this.state.type)?this.parseIdentifier():null}parseFunctionParams(e,t){this.expect(10),this.expressionScope.enter(_pe()),e.params=this.parseBindingList(11,41,2|(t?4:0)),this.expressionScope.exit()}registerFunctionStatementId(e){e.id&&this.scope.declareName(e.id.name,!this.options.annexB||this.state.strict||e.generator||e.async?this.scope.treatFunctionsAsVar?5:8201:17,e.id.loc.start)}parseClass(e,t,r){this.next();let s=this.state.strict;return this.state.strict=!0,this.parseClassId(e,t,r),this.parseClassSuper(e),e.body=this.parseClassBody(!!e.superClass,s),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(e){return e.type==="Identifier"&&e.name==="constructor"||e.type==="StringLiteral"&&e.value==="constructor"}isNonstaticConstructor(e){return!e.computed&&!e.static&&this.nameIsConstructor(e.key)}parseClassBody(e,t){this.classScope.enter();let r={hadConstructor:!1,hadSuperClass:e},s=[],a=this.startNode();if(a.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(s.length>0)throw this.raise(R.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){s.push(this.parseDecorator());continue}let p=this.startNode();s.length&&(p.decorators=s,this.resetStartLocationFromNode(p,s[0]),s=[]),this.parseClassMember(a,p,r),p.kind==="constructor"&&p.decorators&&p.decorators.length>0&&this.raise(R.DecoratorConstructor,p)}}),this.state.strict=t,this.next(),s.length)throw this.raise(R.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(a,"ClassBody")}parseClassMemberFromModifier(e,t){let r=this.parseIdentifier(!0);if(this.isClassMethod()){let s=t;return s.kind="method",s.computed=!1,s.key=r,s.static=!1,this.pushClassMethod(e,s,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let s=t;return s.computed=!1,s.key=r,s.static=!1,e.body.push(this.parseClassProperty(s)),!0}return this.resetPreviousNodeTrailingComments(r),!1}parseClassMember(e,t,r){let s=this.isContextual(106);if(s){if(this.parseClassMemberFromModifier(e,t))return;if(this.eat(5)){this.parseClassStaticBlock(e,t);return}}this.parseClassMemberWithIsStatic(e,t,r,s)}parseClassMemberWithIsStatic(e,t,r,s){let a=t,p=t,u=t,f=t,m=t,x=a,g=a;if(t.static=s,this.parsePropertyNamePrefixOperator(t),this.eat(55)){x.kind="method";let W=this.match(139);if(this.parseClassElementName(x),this.parsePostMemberNameModifiers(x),W){this.pushClassPrivateMethod(e,p,!0,!1);return}this.isNonstaticConstructor(a)&&this.raise(R.ConstructorIsGenerator,a.key),this.pushClassMethod(e,a,!0,!1,!1,!1);return}let z=!this.state.containsEsc&&pe(this.state.type),w=this.parseClassElementName(t),k=z?w.name:null,F=this.isPrivateName(w),Y=this.state.startLoc;if(this.parsePostMemberNameModifiers(g),this.isClassMethod()){if(x.kind="method",F){this.pushClassPrivateMethod(e,p,!1,!1);return}let W=this.isNonstaticConstructor(a),ee=!1;W&&(a.kind="constructor",r.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(R.DuplicateConstructor,w),W&&this.hasPlugin("typescript")&&t.override&&this.raise(R.OverrideOnConstructor,w),r.hadConstructor=!0,ee=r.hadSuperClass),this.pushClassMethod(e,a,!1,!1,W,ee)}else if(this.isClassProperty())F?this.pushClassPrivateProperty(e,f):this.pushClassProperty(e,u);else if(k==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(w);let W=this.eat(55);g.optional&&this.unexpected(Y),x.kind="method";let ee=this.match(139);this.parseClassElementName(x),this.parsePostMemberNameModifiers(g),ee?this.pushClassPrivateMethod(e,p,W,!0):(this.isNonstaticConstructor(a)&&this.raise(R.ConstructorIsAsync,a.key),this.pushClassMethod(e,a,W,!0,!1,!1))}else if((k==="get"||k==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(w),x.kind=k;let W=this.match(139);this.parseClassElementName(a),W?this.pushClassPrivateMethod(e,p,!1,!1):(this.isNonstaticConstructor(a)&&this.raise(R.ConstructorIsAccessor,a.key),this.pushClassMethod(e,a,!1,!1,!1,!1)),this.checkGetterSetterParams(a)}else if(k==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(w);let W=this.match(139);this.parseClassElementName(u),this.pushClassAccessorProperty(e,m,W)}else this.isLineTerminator()?F?this.pushClassPrivateProperty(e,f):this.pushClassProperty(e,u):this.unexpected()}parseClassElementName(e){let{type:t,value:r}=this.state;if((t===132||t===134)&&e.static&&r==="prototype"&&this.raise(R.StaticPrototype,this.state.startLoc),t===139){r==="constructor"&&this.raise(R.ConstructorClassPrivateField,this.state.startLoc);let s=this.parsePrivateName();return e.key=s,s}return this.parsePropertyName(e),e.key}parseClassStaticBlock(e,t){var r;this.scope.enter(720);let s=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let a=t.body=[];this.parseBlockOrModuleBlockBody(a,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=s,e.body.push(this.finishNode(t,"StaticBlock")),(r=t.decorators)!=null&&r.length&&this.raise(R.DecoratorStaticBlock,t)}pushClassProperty(e,t){!t.computed&&this.nameIsConstructor(t.key)&&this.raise(R.ConstructorClassField,t.key),e.body.push(this.parseClassProperty(t))}pushClassPrivateProperty(e,t){let r=this.parseClassPrivateProperty(t);e.body.push(r),this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.loc.start)}pushClassAccessorProperty(e,t,r){!r&&!t.computed&&this.nameIsConstructor(t.key)&&this.raise(R.ConstructorClassField,t.key);let s=this.parseClassAccessorProperty(t);e.body.push(s),r&&this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassMethod(e,t,r,s,a,p){e.body.push(this.parseMethod(t,r,s,a,p,"ClassMethod",!0))}pushClassPrivateMethod(e,t,r,s){let a=this.parseMethod(t,r,s,!1,!1,"ClassPrivateMethod",!0);e.body.push(a);let p=a.kind==="get"?a.static?6:2:a.kind==="set"?a.static?5:1:0;this.declareClassPrivateMethodInScope(a,p)}declareClassPrivateMethodInScope(e,t){this.classScope.declarePrivateName(this.getPrivateNameSV(e.key),t,e.key.loc.start)}parsePostMemberNameModifiers(e){}parseClassPrivateProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassPrivateProperty")}parseClassProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassProperty")}parseClassAccessorProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassAccessorProperty")}parseInitializer(e){this.scope.enter(592),this.expressionScope.enter(Jh()),this.prodParam.enter(0),e.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(e,t,r,s=8331){if(pe(this.state.type))e.id=this.parseIdentifier(),t&&this.declareNameFromIdentifier(e.id,s);else if(r||!t)e.id=null;else throw this.raise(R.MissingClassName,this.state.startLoc)}parseClassSuper(e){e.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(e,t){let r=this.parseMaybeImportPhase(e,!0),s=this.maybeParseExportDefaultSpecifier(e,r),a=!s||this.eat(12),p=a&&this.eatExportStar(e),u=p&&this.maybeParseExportNamespaceSpecifier(e),f=a&&(!u||this.eat(12)),m=s||p;if(p&&!u){if(s&&this.unexpected(),t)throw this.raise(R.UnsupportedDecoratorExport,e);return this.parseExportFrom(e,!0),this.sawUnambiguousESM=!0,this.finishNode(e,"ExportAllDeclaration")}let x=this.maybeParseExportNamedSpecifiers(e);s&&a&&!p&&!x&&this.unexpected(null,5),u&&f&&this.unexpected(null,98);let g;if(m||x){if(g=!1,t)throw this.raise(R.UnsupportedDecoratorExport,e);this.parseExportFrom(e,m)}else g=this.maybeParseExportDeclaration(e);if(m||x||g){var z;let w=e;if(this.checkExport(w,!0,!1,!!w.source),((z=w.declaration)==null?void 0:z.type)==="ClassDeclaration")this.maybeTakeDecorators(t,w.declaration,w);else if(t)throw this.raise(R.UnsupportedDecoratorExport,e);return this.sawUnambiguousESM=!0,this.finishNode(w,"ExportNamedDeclaration")}if(this.eat(65)){let w=e,k=this.parseExportDefaultExpression();if(w.declaration=k,k.type==="ClassDeclaration")this.maybeTakeDecorators(t,k,w);else if(t)throw this.raise(R.UnsupportedDecoratorExport,e);return this.checkExport(w,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(w,"ExportDefaultDeclaration")}throw this.unexpected(null,5)}eatExportStar(e){return this.eat(55)}maybeParseExportDefaultSpecifier(e,t){if(t||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",t?.loc.start);let r=t||this.parseIdentifier(!0),s=this.startNodeAtNode(r);return s.exported=r,e.specifiers=[this.finishNode(s,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(e){if(this.isContextual(93)){var t,r;(r=(t=e).specifiers)!=null||(t.specifiers=[]);let s=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),s.exported=this.parseModuleExportName(),e.specifiers.push(this.finishNode(s,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(e){if(this.match(5)){let t=e;t.specifiers||(t.specifiers=[]);let r=t.exportKind==="type";return t.specifiers.push(...this.parseExportSpecifiers(r)),t.source=null,this.hasPlugin("importAssertions")?t.assertions=[]:t.attributes=[],t.declaration=null,!0}return!1}maybeParseExportDeclaration(e){return this.shouldParseExportDeclaration()?(e.specifiers=[],e.source=null,this.hasPlugin("importAssertions")?e.assertions=[]:e.attributes=[],e.declaration=this.parseExportDeclaration(e),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let e=this.nextTokenInLineStart();return this.isUnparsedContextual(e,"function")}parseExportDefaultExpression(){let e=this.startNode();if(this.match(68))return this.next(),this.parseFunction(e,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(e,13);if(this.match(80))return this.parseClass(e,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(R.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(R.UnsupportedDefaultExport,this.state.startLoc);let t=this.parseMaybeAssignAllowIn();return this.semicolon(),t}parseExportDeclaration(e){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:e}=this.state;if(pe(e)){if(e===95&&!this.state.containsEsc||e===100)return!1;if((e===130||e===129)&&!this.state.containsEsc){let s=this.nextTokenStart(),a=this.input.charCodeAt(s);if(a===123||this.chStartsBindingIdentifier(a,s)&&!this.input.startsWith("from",s))return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let t=this.nextTokenStart(),r=this.isUnparsedContextual(t,"from");if(this.input.charCodeAt(t)===44||pe(this.state.type)&&r)return!0;if(this.match(65)&&r){let s=this.input.charCodeAt(this.nextTokenStartSince(t+4));return s===34||s===39}return!1}parseExportFrom(e,t){this.eatContextual(98)?(e.source=this.parseImportSource(),this.checkExport(e),this.maybeParseImportAttributes(e),this.checkJSONModuleImport(e)):t&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:e}=this.state;return e===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(R.DecoratorBeforeExport,this.state.startLoc),!0):this.isUsing()?(this.raise(R.UsingDeclarationExport,this.state.startLoc),!0):this.isAwaitUsing()?(this.raise(R.UsingDeclarationExport,this.state.startLoc),!0):e===74||e===75||e===68||e===80||this.isLet()||this.isAsyncFunction()}checkExport(e,t,r,s){if(t){var a;if(r){if(this.checkDuplicateExports(e,"default"),this.hasPlugin("exportDefaultFrom")){var p;let u=e.declaration;u.type==="Identifier"&&u.name==="from"&&u.end-u.start===4&&!((p=u.extra)!=null&&p.parenthesized)&&this.raise(R.ExportDefaultFromAsIdentifier,u)}}else if((a=e.specifiers)!=null&&a.length)for(let u of e.specifiers){let{exported:f}=u,m=f.type==="Identifier"?f.name:f.value;if(this.checkDuplicateExports(u,m),!s&&u.local){let{local:x}=u;x.type!=="Identifier"?this.raise(R.ExportBindingIsString,u,{localName:x.value,exportName:m}):(this.checkReservedWord(x.name,x.loc.start,!0,!1),this.scope.checkLocalExport(x))}}else if(e.declaration){let u=e.declaration;if(u.type==="FunctionDeclaration"||u.type==="ClassDeclaration"){let{id:f}=u;if(!f)throw new Error("Assertion failure");this.checkDuplicateExports(e,f.name)}else if(u.type==="VariableDeclaration")for(let f of u.declarations)this.checkDeclaration(f.id)}}}checkDeclaration(e){if(e.type==="Identifier")this.checkDuplicateExports(e,e.name);else if(e.type==="ObjectPattern")for(let t of e.properties)this.checkDeclaration(t);else if(e.type==="ArrayPattern")for(let t of e.elements)t&&this.checkDeclaration(t);else e.type==="ObjectProperty"?this.checkDeclaration(e.value):e.type==="RestElement"?this.checkDeclaration(e.argument):e.type==="AssignmentPattern"&&this.checkDeclaration(e.left)}checkDuplicateExports(e,t){this.exportedIdentifiers.has(t)&&(t==="default"?this.raise(R.DuplicateDefaultExport,e):this.raise(R.DuplicateExport,e,{exportName:t})),this.exportedIdentifiers.add(t)}parseExportSpecifiers(e){let t=[],r=!0;for(this.expect(5);!this.eat(8);){if(r)r=!1;else if(this.expect(12),this.eat(8))break;let s=this.isContextual(130),a=this.match(134),p=this.startNode();p.local=this.parseModuleExportName(),t.push(this.parseExportSpecifier(p,a,e,s))}return t}parseExportSpecifier(e,t,r,s){return this.eatContextual(93)?e.exported=this.parseModuleExportName():t?e.exported=this.cloneStringLiteral(e.local):e.exported||(e.exported=this.cloneIdentifier(e.local)),this.finishNode(e,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let e=this.parseStringLiteral(this.state.value),t=Xpe.exec(e.value);return t&&this.raise(R.ModuleExportNameHasLoneSurrogate,e,{surrogateCharCode:t[0].charCodeAt(0)}),e}return this.parseIdentifier(!0)}isJSONModuleImport(e){return e.assertions!=null?e.assertions.some(({key:t,value:r})=>r.value==="json"&&(t.type==="Identifier"?t.name==="type":t.value==="type")):!1}checkImportReflection(e){let{specifiers:t}=e,r=t.length===1?t[0].type:null;if(e.phase==="source")r!=="ImportDefaultSpecifier"&&this.raise(R.SourcePhaseImportRequiresDefault,t[0].loc.start);else if(e.phase==="defer")r!=="ImportNamespaceSpecifier"&&this.raise(R.DeferImportRequiresNamespace,t[0].loc.start);else if(e.module){var s;r!=="ImportDefaultSpecifier"&&this.raise(R.ImportReflectionNotBinding,t[0].loc.start),((s=e.assertions)==null?void 0:s.length)>0&&this.raise(R.ImportReflectionHasAssertion,t[0].loc.start)}}checkJSONModuleImport(e){if(this.isJSONModuleImport(e)&&e.type!=="ExportAllDeclaration"){let{specifiers:t}=e;if(t!=null){let r=t.find(s=>{let a;if(s.type==="ExportSpecifier"?a=s.local:s.type==="ImportSpecifier"&&(a=s.imported),a!==void 0)return a.type==="Identifier"?a.name!=="default":a.value!=="default"});r!==void 0&&this.raise(R.ImportJSONBindingNotDefault,r.loc.start)}}}isPotentialImportPhase(e){return e?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(e,t,r,s){t||(r==="module"?(this.expectPlugin("importReflection",s),e.module=!0):this.hasPlugin("importReflection")&&(e.module=!1),r==="source"?(this.expectPlugin("sourcePhaseImports",s),e.phase="source"):r==="defer"?(this.expectPlugin("deferredImportEvaluation",s),e.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(e.phase=null))}parseMaybeImportPhase(e,t){if(!this.isPotentialImportPhase(t))return this.applyImportPhase(e,t,null),null;let r=this.startNode(),s=this.parseIdentifierName(!0),{type:a}=this.state;return(pt(a)?a!==98||this.lookaheadCharCode()===102:a!==12)?(this.applyImportPhase(e,t,s,r.loc.start),null):(this.applyImportPhase(e,t,null),this.createIdentifier(r,s))}isPrecedingIdImportPhase(e){let{type:t}=this.state;return pe(t)?t!==98||this.lookaheadCharCode()===102:t!==12}parseImport(e){return this.match(134)?this.parseImportSourceAndAttributes(e):this.parseImportSpecifiersAndAfter(e,this.parseMaybeImportPhase(e,!1))}parseImportSpecifiersAndAfter(e,t){e.specifiers=[];let s=!this.maybeParseDefaultImportSpecifier(e,t)||this.eat(12),a=s&&this.maybeParseStarImportSpecifier(e);return s&&!a&&this.parseNamedImportSpecifiers(e),this.expectContextual(98),this.parseImportSourceAndAttributes(e)}parseImportSourceAndAttributes(e){var t;return(t=e.specifiers)!=null||(e.specifiers=[]),e.source=this.parseImportSource(),this.maybeParseImportAttributes(e),this.checkImportReflection(e),this.checkJSONModuleImport(e),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(e,t,r){t.local=this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,r))}finishImportSpecifier(e,t,r=8201){return this.checkLVal(e.local,{type:t},r),this.finishNode(e,t)}parseImportAttributes(){this.expect(5);let e=[],t=new Set;do{if(this.match(8))break;let r=this.startNode(),s=this.state.value;if(t.has(s)&&this.raise(R.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:s}),t.add(s),this.match(134)?r.key=this.parseStringLiteral(s):r.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(R.ModuleAttributeInvalidValue,this.state.startLoc);r.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(r,"ImportAttribute"))}while(this.eat(12));return this.expect(8),e}parseModuleAttributes(){let e=[],t=new Set;do{let r=this.startNode();if(r.key=this.parseIdentifier(!0),r.key.name!=="type"&&this.raise(R.ModuleAttributeDifferentFromType,r.key),t.has(r.key.name)&&this.raise(R.ModuleAttributesWithDuplicateKeys,r.key,{key:r.key.name}),t.add(r.key.name),this.expect(14),!this.match(134))throw this.raise(R.ModuleAttributeInvalidValue,this.state.startLoc);r.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(r,"ImportAttribute"))}while(this.eat(12));return e}maybeParseImportAttributes(e){let t;var r=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?(t=this.parseModuleAttributes(),this.addExtra(e,"deprecatedWithLegacySyntax",!0)):t=this.parseImportAttributes(),r=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions")&&this.raise(R.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(e,"deprecatedAssertSyntax",!0),this.next(),t=this.parseImportAttributes()):t=[];!r&&this.hasPlugin("importAssertions")?e.assertions=t:e.attributes=t}maybeParseDefaultImportSpecifier(e,t){if(t){let r=this.startNodeAtNode(t);return r.local=t,e.specifiers.push(this.finishImportSpecifier(r,"ImportDefaultSpecifier")),!0}else if(pt(this.state.type))return this.parseImportSpecifierLocal(e,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(e){if(this.match(55)){let t=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(e,t,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(e){let t=!0;for(this.expect(5);!this.eat(8);){if(t)t=!1;else{if(this.eat(14))throw this.raise(R.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let r=this.startNode(),s=this.match(134),a=this.isContextual(130);r.imported=this.parseModuleExportName();let p=this.parseImportSpecifier(r,s,e.importKind==="type"||e.importKind==="typeof",a,void 0);e.specifiers.push(p)}}parseImportSpecifier(e,t,r,s,a){if(this.eatContextual(93))e.local=this.parseIdentifier();else{let{imported:p}=e;if(t)throw this.raise(R.ImportBindingIsString,e,{importName:p.value});this.checkReservedWord(p.name,e.loc.start,!0,!0),e.local||(e.local=this.cloneIdentifier(p))}return this.finishImportSpecifier(e,"ImportSpecifier",a)}isThisParam(e){return e.type==="Identifier"&&e.name==="this"}},Ys=class extends Bc{constructor(e,t,r){let s=Zce(e);super(s,t),this.options=s,this.initializeScopes(),this.plugins=r,this.filename=s.sourceFilename,this.startIndex=s.startIndex;let a=0;s.allowAwaitOutsideFunction&&(a|=1),s.allowReturnOutsideFunction&&(a|=2),s.allowImportExportEverywhere&&(a|=8),s.allowSuperOutsideMethod&&(a|=16),s.allowUndeclaredExports&&(a|=64),s.allowNewTargetOutsideFunction&&(a|=4),s.allowYieldOutsideFunction&&(a|=32),s.ranges&&(a|=128),s.tokens&&(a|=256),s.createImportExpressions&&(a|=512),s.createParenthesizedExpressions&&(a|=1024),s.errorRecovery&&(a|=2048),s.attachComment&&(a|=4096),s.annexB&&(a|=8192),this.optionFlags=a}getScopeHandler(){return mr}parse(){this.enterInitialScopes();let e=this.startNode(),t=this.startNode();this.nextToken(),e.errors=null;let r=this.parseTopLevel(e,t);return r.errors=this.state.errors,r.comments.length=this.state.commentsLen,r}};function tde(o,e){var t;if(((t=e)==null?void 0:t.sourceType)==="unambiguous"){e=Object.assign({},e);try{e.sourceType="module";let r=dr(e,o),s=r.parse();if(r.sawUnambiguousESM)return s;if(r.ambiguousScriptDifferentAst)try{return e.sourceType="script",dr(e,o).parse()}catch{}else s.program.sourceType="script";return s}catch(r){try{return e.sourceType="script",dr(e,o).parse()}catch{}throw r}}else return dr(e,o).parse()}function ode(o,e){let t=dr(e,o);return t.options.strictMode&&(t.state.strict=!0),t.getExpression()}function rde(o){let e={};for(let t of Object.keys(o))e[t]=Ct(o[t]);return e}var sde=rde(ope);function dr(o,e){let t=Ys,r=new Map;if(o!=null&&o.plugins){for(let s of o.plugins){let a,p;typeof s=="string"?a=s:[a,p]=s,r.has(a)||r.set(a,p||{})}Qpe(r),t=nde(r)}return new t(o,e,r)}var jh=new Map;function nde(o){let e=[];for(let s of Jpe)o.has(s)&&e.push(s);let t=e.join("|"),r=jh.get(t);if(!r){r=Ys;for(let s of e)r=ef[s](r);jh.set(t,r)}return r}fr.parse=tde;fr.parseExpression=ode;fr.tokTypes=sde});import{Command as Ide}from"commander";import{existsSync as Hf}from"fs";import{homedir as $p}from"os";import{dirname as Wf,join as on}from"path";import{fileURLToPath as $f}from"url";import{agents as Gf,detectGlobalAgents as Gp,upsertServer as Kf}from"add-mcp";import{createHash as Nf,randomUUID as _p}from"crypto";import{chmodSync as _f,existsSync as Bf,lstatSync as en,mkdirSync as Js,readFileSync as Vp,readdirSync as Up,renameSync as Zs,writeFileSync as Bp}from"fs";import{dirname as Ar,join as dt}from"path";var tn=".cueframe-install.json";function Hp(o){return Nf("sha256").update(o).digest("hex")}function jp(o){let e=new Map;function t(r){let s=dt(o,r),a=en(s);if(a.isSymbolicLink())throw new Error(`Skill package contains a symbolic link: ${s}`);if(a.isDirectory())for(let p of Up(s).sort())!r&&p===tn||t(r?`${r}/${p}`:p);else if(a.isFile())e.set(r,{bytes:Vp(s),mode:a.mode&511});else throw new Error(`Unsupported skill package entry: ${s}`)}return t(""),e}function Xs(o){return Object.fromEntries([...o].map(([e,t])=>[e,`${t.mode}:${Hp(t.bytes)}`]))}function jf(o,e){let t=Object.keys(o).sort();return JSON.stringify(t)===JSON.stringify(Object.keys(e).sort())&&t.every(r=>o[r]===e[r])}function Vf(o,e){try{let t=dt(o,tn);if(!en(t).isFile())return;let r=JSON.parse(Vp(t,"utf8"));return r.version!==1||typeof r.sourceHash!="string"||!r.files||!jf(r.files,Xs(e))?void 0:r}catch{return}}function Uf(o,e){let t=`> Installed ${e} by \`npx -y cueframe install\`. Run it again to refresh
10
10
  > unchanged managed skills. Locally edited or untracked packages are preserved;
11
11
  > inspect reported conflicts before using \`--force\` (which makes a backup).
12
- `,o=n.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n/);return o?`${o[0]}
13
- ${e}${n.slice(o[0].length)}`:`${e}
14
- ${n}`}function As(n,t,e={}){let o={installed:[],unchanged:[],skipped:[],backups:[]},r=e.today??new Date().toISOString().slice(0,10),c=ks(n).sort().flatMap(d=>{let l=Ce(n,d);if(!ac(Ce(l,"SKILL.md")))return[];let m=Is(l),f=Es(JSON.stringify(xo(m))),g=m.get("SKILL.md");return m.set("SKILL.md",{...g,bytes:Buffer.from(dc(g.bytes.toString("utf8"),r))}),[{name:d,files:m,sourceHash:f}]});for(let d of new Set(t))for(let{name:l,files:m,sourceHash:f}of c){let g=Ce(d,l),b=Ce(g,"SKILL.md"),C=!1;try{go(g),C=!0}catch(q){if(q.code!=="ENOENT")throw q}if(C&&!e.force){let q;try{q=pc(g,Is(g))}catch{}if(!q){o.skipped.push(b);continue}if(q.sourceHash===f){o.unchanged.push(b);continue}}let T=Ce(It(d),"cueframe-skill-staging",`${l}-${vs()}`);for(let[q,_]of m){let U=Ce(T,q);ho(It(U),{recursive:!0}),Ps(U,_.bytes),ic(U,_.mode)}let E={version:1,sourceHash:f,files:xo(m)};Ps(Ce(T,yo),JSON.stringify(E,null,2)+`
15
- `),ho(d,{recursive:!0});let k;C&&(k=Ce(It(d),"cueframe-skill-backups",`${l}-${vs()}`),ho(It(k),{recursive:!0}),fo(g,k));try{fo(T,g)}catch(q){throw k&&fo(k,g),q}k&&o.backups.push({skill:b,path:k}),o.installed.push(b)}return o}var Ot="cueframe",xc=bo(uc(mc(import.meta.url)),"skills");function gc(n){return(hc[n]?.supportedTransports??[]).includes("http")}async function yc(n){return(await Ds()).map(e=>{if(!gc(e))return{agent:e,wired:!1,error:"speaks stdio only \u2014 CueFrame\u2019s MCP server is remote HTTP"};try{let o=fc(e,Ot,{type:"http",url:n});return{agent:e,wired:o.success,path:o.path,error:o.error}}catch(o){return{agent:e,wired:!1,error:o instanceof Error?o.message:String(o)}}})}async function Fs(n,t=xc){let e=`${_e(n.target)}/v1/mcp`,o=[bo(Ls(),".agents","skills"),bo(Ls(),".claude","skills")];if(n.dryRun){let f=await Ds();K(n,{ok:!0,dryRun:!0,mcpUrl:e,wouldWire:f,serverName:Ot,skillDirectories:o},()=>{console.log(`Would wire MCP server "${Ot}" \u2192 ${e} into:`),f.length===0&&console.log(" (no agents detected on this machine)");for(let g of f)console.log(` \u2192 ${g}`);console.log("Would install/refresh CueFrame skills in ~/.agents/skills and ~/.claude/skills"),console.log("Dry run \u2014 nothing was written.")});return}lc(t)||(j(n,"install",new Error("Bundled skills/ directory not found"),O.UserError),I(O.UserError));let r=await yc(e),{installed:c,unchanged:d,skipped:l,backups:m}=As(t,o,n);c.length===0&&d.length===0&&l.length===0&&r.length===0&&(j(n,"install",new Error("No agents detected and no skills found \u2014 nothing to install"),O.UserError),I(O.UserError)),K(n,{ok:!0,mcpUrl:e,agents:r,skills:c,unchanged:d,skipped:l,backups:m,skillDirectories:o},()=>{if(console.log(`\u2713 CueFrame MCP server (${e})`),r.length===0)console.log(" No agents detected on this machine. Add it manually:"),console.log(` claude mcp add --transport http ${Ot} ${e}`),console.log(` \u2026or add the MCP server ${e} as a custom connector.`);else for(let f of r)console.log(f.wired?` \u2192 wired ${f.agent}`:` \u2717 ${f.agent}: ${f.error??"failed"}`);if(console.log(`\u2713 Installed/refreshed ${c.length} CueFrame skill copies in ~/.agents/skills and ~/.claude/skills`),d.length>0&&console.log(` ${d.length} already current`),l.length>0){console.log(` ${l.length} preserved (locally changed or untracked; review before --force)`);for(let f of l)console.log(` ${f}`)}for(let f of m)console.log(` Backup: ${f.path}`);console.log(""),console.log("Next: ask your agent to make a video \u2014 it opens a browser to authorize on"),console.log("first call. No API key needed."),console.log("Restart your agent session to load the MCP server and skills."),console.log(""),console.log("This installed no `cueframe` binary \u2014 npx leaves nothing on your PATH."),console.log("Prefer the terminal? Every command runs as `npx -y cueframe \u2026`:"),console.log(" npx -y cueframe login")})}import{existsSync as So,mkdirSync as bc,readFileSync as Vs,writeFileSync as zo}from"fs";import{join as wo}from"path";var js="cueframe.json",Sc="cueframe/components",kt=".cueframe/";function zc(n,t){let e=wo(n,".gitignore");if(So(e)){let o=Vs(e,"utf8"),r=o.split(`
16
- `).map(c=>c.trim());if(r.includes(kt)||r.includes(".cueframe"))return!1;if(!t){let c=o.endsWith(`
17
- `)||o.length===0?"":`
18
- `;zo(e,`${o}${c}
12
+ `,r=o.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n/);return r?`${r[0]}
13
+ ${t}${o.slice(r[0].length)}`:`${t}
14
+ ${o}`}function Wp(o,e,t={}){let r={installed:[],unchanged:[],skipped:[],backups:[]},s=t.today??new Date().toISOString().slice(0,10),a=Up(o).sort().flatMap(p=>{let u=dt(o,p);if(!Bf(dt(u,"SKILL.md")))return[];let f=jp(u),m=Hp(JSON.stringify(Xs(f))),x=f.get("SKILL.md");return f.set("SKILL.md",{...x,bytes:Buffer.from(Uf(x.bytes.toString("utf8"),s))}),[{name:p,files:f,sourceHash:m}]});for(let p of new Set(e))for(let{name:u,files:f,sourceHash:m}of a){let x=dt(p,u),g=dt(x,"SKILL.md"),z=!1;try{en(x),z=!0}catch(Y){if(Y.code!=="ENOENT")throw Y}if(z&&!t.force){let Y;try{Y=Vf(x,jp(x))}catch{}if(!Y){r.skipped.push(g);continue}if(Y.sourceHash===m){r.unchanged.push(g);continue}}let w=dt(Ar(p),"cueframe-skill-staging",`${u}-${_p()}`);for(let[Y,W]of f){let ee=dt(w,Y);Js(Ar(ee),{recursive:!0}),Bp(ee,W.bytes),_f(ee,W.mode)}let k={version:1,sourceHash:m,files:Xs(f)};Bp(dt(w,tn),JSON.stringify(k,null,2)+`
15
+ `),Js(p,{recursive:!0});let F;z&&(F=dt(Ar(p),"cueframe-skill-backups",`${u}-${_p()}`),Js(Ar(F),{recursive:!0}),Zs(x,F));try{Zs(w,x)}catch(Y){throw F&&Zs(F,x),Y}F&&r.backups.push({skill:g,path:F}),r.installed.push(g)}return r}var Sr="cueframe",qf=on(Wf($f(import.meta.url)),"skills");function Yf(o){return(Gf[o]?.supportedTransports??[]).includes("http")}async function Qf(o){return(await Gp()).map(t=>{if(!Yf(t))return{agent:t,wired:!1,error:"speaks stdio only \u2014 CueFrame\u2019s MCP server is remote HTTP"};try{let r=Kf(t,Sr,{type:"http",url:o});return{agent:t,wired:r.success,path:r.path,error:r.error}}catch(r){return{agent:t,wired:!1,error:r instanceof Error?r.message:String(r)}}})}async function Kp(o,e=qf){let t=`${Qt(o.target)}/v1/mcp`,r=[on($p(),".agents","skills"),on($p(),".claude","skills")];if(o.dryRun){let m=await Gp();se(o,{ok:!0,dryRun:!0,mcpUrl:t,wouldWire:m,serverName:Sr,skillDirectories:r},()=>{console.log(`Would wire MCP server "${Sr}" \u2192 ${t} into:`),m.length===0&&console.log(" (no agents detected on this machine)");for(let x of m)console.log(` \u2192 ${x}`);console.log("Would install/refresh CueFrame skills in ~/.agents/skills and ~/.claude/skills"),console.log("Dry run \u2014 nothing was written.")});return}Hf(e)||(K(o,"install",new Error("Bundled skills/ directory not found"),B.UserError),N(B.UserError));let s=await Qf(t),{installed:a,unchanged:p,skipped:u,backups:f}=Wp(e,r,o);a.length===0&&p.length===0&&u.length===0&&s.length===0&&(K(o,"install",new Error("No agents detected and no skills found \u2014 nothing to install"),B.UserError),N(B.UserError)),se(o,{ok:!0,mcpUrl:t,agents:s,skills:a,unchanged:p,skipped:u,backups:f,skillDirectories:r},()=>{if(console.log(`\u2713 CueFrame MCP server (${t})`),s.length===0)console.log(" No agents detected on this machine. Add it manually:"),console.log(` claude mcp add --transport http ${Sr} ${t}`),console.log(` \u2026or add the MCP server ${t} as a custom connector.`);else for(let m of s)console.log(m.wired?` \u2192 wired ${m.agent}`:` \u2717 ${m.agent}: ${m.error??"failed"}`);if(console.log(`\u2713 Installed/refreshed ${a.length} CueFrame skill copies in ~/.agents/skills and ~/.claude/skills`),p.length>0&&console.log(` ${p.length} already current`),u.length>0){console.log(` ${u.length} preserved (locally changed or untracked; review before --force)`);for(let m of u)console.log(` ${m}`)}for(let m of f)console.log(` Backup: ${m.path}`);console.log(""),console.log("Next: ask your agent to make a video \u2014 it opens a browser to authorize on"),console.log("first call. No API key needed."),console.log("Restart your agent session to load the MCP server and skills."),console.log(""),console.log("This installed no `cueframe` binary \u2014 npx leaves nothing on your PATH."),console.log("Prefer the terminal? Every command runs as `npx -y cueframe \u2026`:"),console.log(" npx -y cueframe login")})}import{existsSync as rn,mkdirSync as Jf,readFileSync as Yp,writeFileSync as sn}from"fs";import{join as nn}from"path";var qp="cueframe.json",Zf="cueframe/components",zr=".cueframe/";function Xf(o,e){let t=nn(o,".gitignore");if(rn(t)){let r=Yp(t,"utf8"),s=r.split(`
16
+ `).map(a=>a.trim());if(s.includes(zr)||s.includes(".cueframe"))return!1;if(!e){let a=r.endsWith(`
17
+ `)||r.length===0?"":`
18
+ `;sn(t,`${r}${a}
19
19
  # CueFrame derived render cache (regenerated; never authored)
20
- ${kt}
21
- `)}return!0}return t||zo(e,`# CueFrame derived render cache (regenerated; never authored)
22
- ${kt}
23
- `),!0}function Ns(n){let t=process.cwd(),e=n.dryRun??!1;A(n,"init_prepare",{cwd:t,dryRun:e});let o=wo(t,js),r=So(o),c=Sc;if(r)try{let f=JSON.parse(Vs(o,"utf8"));typeof f.componentsDir=="string"&&f.componentsDir.length>0&&(c=f.componentsDir)}catch{}else e||zo(o,`${JSON.stringify({componentsDir:c},null,2)}
24
- `);let d=wo(t,c),l=So(d);!l&&!e&&bc(d,{recursive:!0});let m=zc(t,e);K(n,{ok:!0,dryRun:e,root:t,manifest:{path:o,created:!r},componentsDir:c,componentsDirCreated:!l,gitignoreUpdated:m},()=>{console.log(`\u2713 ${e?"Would initialize":"Initialized"} CueFrame workspace at ${t}`),console.log(` ${r?"kept":"created"} ${js} (componentsDir: ${c})`),console.log(` ${l?"exists":"created"} ${c}/`),m&&console.log(` gitignored ${kt}`),console.log("Next: cueframe eject <primitive> or cueframe new component <name>")})}import{existsSync as qc,mkdirSync as Uc,readFileSync as Wc,readdirSync as Gc,writeFileSync as Xs}from"fs";import{join as Zs}from"path";import{existsSync as Et,readFileSync as wc,readdirSync as Cc,statSync as Mc}from"fs";import{dirname as Tc,join as Ue,parse as Rc}from"path";var vc="cueframe/components";var Pc="cueframe.json",Ic=p.object({componentsDir:p.string().min(1).default(vc)}).passthrough();function at(n){let t=n,e=Rc(t).root;for(;;){let o=Ue(t,Pc);if(Et(o)){let r=wc(o,"utf8"),c=Ic.parse(JSON.parse(r));return{root:t,manifest:c}}if(t===e)return null;t=Tc(t)}}function $s(n){return Ue(n.root,n.manifest.componentsDir)}function At(n,t){return Ue($s(n),t)}function Bs(n){let t=$s(n);return Et(t)?Cc(t).filter(e=>{let o=Ue(t,e);return Mc(o).isDirectory()?Et(Ue(o,"index.tsx"))&&Et(Ue(o,"config.ts")):!1}).sort():[]}import{existsSync as $c,readFileSync as Bc}from"fs";import{join as _c}from"path";var Co=2,Oc=2,Lt=2,Mo=p.enum(["image","video","audio","data"]),kc=p.union([p.literal(256),p.literal(512),p.literal(1024),p.literal(2048)]),Ec=p.discriminatedUnion("mode",[p.object({mode:p.literal("original")}).strict(),p.object({mode:p.literal("tier"),tier:kc}).strict(),p.object({mode:p.literal("auto"),maxProjectedWidthRatio:p.number().positive().max(64),maxProjectedHeightRatio:p.number().positive().max(64),minVisibleSourceWidthRatio:p.number().positive().max(1).default(1),minVisibleSourceHeightRatio:p.number().positive().max(1).default(1)}).strict()]),Ac=p.object({kind:Mo,required:p.boolean(),mimeTypes:p.array(p.string().min(1)).min(1).optional(),mediaDemand:Ec.optional()}).strict(),_s=p.enum(["canvas2d","webgl","webgl2","webgpu"]),To=p.object({api:_s,required:p.literal(!0),accelerationPreference:p.enum(["hardware-preferred","software-allowed"])}).strict(),qs=p.object({version:p.literal(2)}).strict(),Us=p.enum(["angle","angle-egl","swangle","vulkan"]),Ws=p.object({glBackend:Us,colorPipeline:p.literal("srgb"),sceneShot:qs.nullable()}).strict(),Lc=p.object({webgl:p.string().min(1),renderer:p.string(),maxTextureSize:p.number().int().positive(),halfFloatColorTarget:p.string().min(1),glBackend:Us}).strict(),Dc=p.object({loadedRuntimeIdentity:p.string().min(1),loadedDependencyIdentity:p.string().min(1),observedRasterAffectingFlags:p.object({browserArguments:p.array(p.string().min(1))}).strict(),browserProduct:p.string().min(1),browserVersion:p.string().min(1),browserExecutableSha256:p.string().regex(/^[a-f0-9]{64}$/),headless:p.boolean(),os:p.string().min(1),arch:p.string().min(1),deviceScaleFactor:p.number().positive(),colorProfile:p.string().min(1),actualGlBackend:p.string().min(1),actualRenderer:p.string().min(1),gpuIdentity:p.string().min(1).nullable()}).strict(),zH=Dc.omit({deviceScaleFactor:!0}).strict(),wH=p.object({handle:p.string().min(1),mimeType:p.literal("image/png"),byteLength:p.number().int().positive(),width:p.number().int().positive(),height:p.number().int().positive(),encodedSha256:p.string().regex(/^[a-f0-9]{64}$/)}).strict(),CH=p.object({sessionId:p.string().uuid(),requestId:p.number().int().nonnegative(),frame:p.number().int().nonnegative(),deviceScaleFactor:p.number().positive()}).strict(),Dt=p.object({version:p.literal(Co),assets:p.record(p.string().min(1),Ac),graphics:To,alphaPolicy:p.enum(["requires-transparency","allows-opaque"]),sceneShot:qs.optional()}).strict(),Gs=Object.freeze({version:Co,assets:Object.freeze({}),graphics:Object.freeze({api:"canvas2d",required:!0,accelerationPreference:"software-allowed"}),alphaPolicy:"requires-transparency"}),Ft=p.object({version:p.literal(Co),componentId:p.string().min(1).max(128).regex(/^[a-z0-9][a-z0-9._-]*$/),tsxSource:p.string().min(1),manifest:Dt}).strict(),MH=p.object({version:p.literal(1),sourceVersionId:p.string().regex(/^[a-f0-9]{64}$/)}).strict();var Hs=p.object({handle:p.string().min(1).max(256),kind:Mo,mimeType:p.string().min(1),contentSha256:p.string().regex(/^[a-f0-9]{64}$/),width:p.number().int().positive().optional(),height:p.number().int().positive().optional(),durationSec:p.number().positive().optional(),frameRate:p.number().positive().optional()}).strict(),Fc=p.object({handle:p.string().min(1).max(256),kind:Mo,mimeType:p.string().min(1),width:p.number().int().positive().optional(),height:p.number().int().positive().optional(),durationSec:p.number().positive().optional(),frameRate:p.number().positive().optional()}).strict(),jc=p.object({path:p.string().min(1)}).strict(),TH=p.object({version:p.literal(Oc),bundleId:p.string().regex(/^[a-f0-9]{64}$/),sourceVersionId:p.string().regex(/^[a-f0-9]{64}$/),runtimeDigest:p.string().min(1),dependencyLockDigest:p.string().regex(/^[a-f0-9]{64}$/),entrypoint:p.string().min(1),manifest:Dt}).strict(),RH=p.object({version:p.literal(Lt),bundleId:p.string().regex(/^[a-f0-9]{64}$/),params:p.record(p.string(),p.unknown()),assets:p.record(p.string().min(1),Hs),width:p.number().int().positive(),height:p.number().int().positive(),fps:p.number().positive(),durationInFrames:p.number().int().positive(),alpha:p.boolean(),graphics:To,seed:p.string().min(1),renderer:Ws}).strict(),vH=p.object({version:p.literal(Lt),source:Ft,params:p.record(p.string(),p.unknown()),assets:p.record(p.string().min(1),Hs),width:p.number().int().positive(),height:p.number().int().positive(),fps:p.number().positive(),durationInFrames:p.number().int().positive(),codec:p.enum(["vp9","prores"]),runtimeDigest:p.string().min(1),dependencyLockDigest:p.string().regex(/^[a-f0-9]{64}$/),seed:p.string().min(1)}).strict(),PH=p.object({version:p.literal(Lt),source:Ft,params:p.record(p.string(),p.unknown()),assets:p.record(p.string().min(1),Fc),assetFiles:p.record(p.string().min(1),jc),width:p.number().int().positive(),height:p.number().int().positive(),fps:p.number().positive(),durationInFrames:p.number().int().positive(),codec:p.enum(["vp9","prores"]),runtimeDigest:p.string().min(1),dependencyLockDigest:p.string().regex(/^[a-f0-9]{64}$/),seed:p.string().min(1)}).strict();var Vc=p.object({api:_s,acceleration:p.enum(["hardware","software"]),adapterName:p.string().min(1).optional(),deviceLost:p.literal(!1)}).strict(),IH=p.object({version:p.literal(Lt),artifactId:p.string().regex(/^[a-f0-9]{64}$/),renderKey:p.string().regex(/^[a-f0-9]{64}$/),bundleId:p.string().regex(/^[a-f0-9]{64}$/),sourceVersionId:p.string().regex(/^[a-f0-9]{64}$/),runtimeDigest:p.string().min(1),outputSha256:p.string().regex(/^[a-f0-9]{64}$/),outputBytes:p.number().int().positive(),codec:p.enum(["png","vp9","prores"]),width:p.number().int().positive(),height:p.number().int().positive(),fps:p.number().positive(),durationInFrames:p.number().int().positive(),alpha:p.boolean(),requestedGraphics:To,actualGraphics:Vc,renderer:Ws,host:Lc.nullable()}).strict(),Nc=["invalid_component_source","unsupported_runtime_version","component_does_not_compile","component_runtime_error","component_deadline_exceeded","component_resource_exhausted","component_asset_undeclared","component_asset_unavailable","component_asset_integrity_failed","component_network_denied","component_import_denied","component_graphics_unavailable","component_graphics_mismatch","component_device_lost","component_output_invalid","component_output_unverifiable","component_conflict","component_scene_invalid"],OH=p.enum(Nc),We=class extends Error{code;retryable;locator;constructor(t,e,o){super(e,o?.cause===void 0?void 0:{cause:o.cause}),this.name="ComponentRuntimeError",this.code=t,this.retryable=o?.retryable??!1,o?.locator&&(this.locator=o.locator)}};var Ks=Gs;function Ro(n,t,e){let o=Dt.safeParse(n);if(!o.success)throw Object.assign(new Error(`Component "${t}" has no valid contract-v2 manifest at ${e}.`),{code:"no_component_manifest"});return o.data}function Js(n,t){let e=_c(n.root,"cueframe.json");if(!$c(e))throw Object.assign(new Error("No cueframe.json workspace manifest was found."),{code:"no_component_manifest"});let o=JSON.parse(Bc(e,"utf8"));return Ro(o.components?.[t]?.manifest,t,`cueframe.json components.${t}.manifest`)}var Hc="cueframe.json";function Kc(n){return n.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}function Jc(n){return n.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function vo(n,t){j(n,"new_component",new Error(t),O.UserError),I(O.UserError)}function Xc(n,t){return`import React from 'react';
20
+ ${zr}
21
+ `)}return!0}return e||sn(t,`# CueFrame derived render cache (regenerated; never authored)
22
+ ${zr}
23
+ `),!0}function Qp(o){let e=process.cwd(),t=o.dryRun??!1;V(o,"init_prepare",{cwd:e,dryRun:t});let r=nn(e,qp),s=rn(r),a=Zf;if(s)try{let m=JSON.parse(Yp(r,"utf8"));typeof m.componentsDir=="string"&&m.componentsDir.length>0&&(a=m.componentsDir)}catch{}else t||sn(r,`${JSON.stringify({componentsDir:a},null,2)}
24
+ `);let p=nn(e,a),u=rn(p);!u&&!t&&Jf(p,{recursive:!0});let f=Xf(e,t);se(o,{ok:!0,dryRun:t,root:e,manifest:{path:r,created:!s},componentsDir:a,componentsDirCreated:!u,gitignoreUpdated:f},()=>{console.log(`\u2713 ${t?"Would initialize":"Initialized"} CueFrame workspace at ${e}`),console.log(` ${s?"kept":"created"} ${qp} (componentsDir: ${a})`),console.log(` ${u?"exists":"created"} ${a}/`),f&&console.log(` gitignored ${zr}`),console.log("Next: cueframe new component <name>")})}import{existsSync as Sx,mkdirSync as zx,readFileSync as Tx,readdirSync as Ex,writeFileSync as ad}from"fs";import{join as cd}from"path";import{existsSync as Tr,readFileSync as ex,readdirSync as tx,statSync as ox}from"fs";import{dirname as rx,join as Zt,parse as sx}from"path";var nx="cueframe/components";var ix="cueframe.json",ax=d.object({componentsDir:d.string().min(1).default(nx)}).passthrough();function Io(o){let e=o,t=sx(e).root;for(;;){let r=Zt(e,ix);if(Tr(r)){let s=ex(r,"utf8"),a=ax.parse(JSON.parse(s));return{root:e,manifest:a}}if(e===t)return null;e=rx(e)}}function Jp(o){return Zt(o.root,o.manifest.componentsDir)}function Er(o,e){return Zt(Jp(o),e)}function Zp(o){let e=Jp(o);return Tr(e)?tx(e).filter(t=>{let r=Zt(e,t);return ox(r).isDirectory()?Tr(Zt(r,"index.tsx"))&&Tr(Zt(r,"config.ts")):!1}).sort():[]}import{existsSync as bx,readFileSync as yx}from"fs";import{join as Ax}from"path";var an=2,cx=2,Cr=2,cn=d.enum(["image","video","audio","data"]),px=d.union([d.literal(256),d.literal(512),d.literal(1024),d.literal(2048)]),dx=d.discriminatedUnion("mode",[d.object({mode:d.literal("original")}).strict(),d.object({mode:d.literal("tier"),tier:px}).strict(),d.object({mode:d.literal("auto"),maxProjectedWidthRatio:d.number().positive().max(64),maxProjectedHeightRatio:d.number().positive().max(64),minVisibleSourceWidthRatio:d.number().positive().max(1).default(1),minVisibleSourceHeightRatio:d.number().positive().max(1).default(1)}).strict()]),lx=d.object({kind:cn,required:d.boolean(),mimeTypes:d.array(d.string().min(1)).min(1).optional(),mediaDemand:dx.optional()}).strict(),Xp=d.enum(["canvas2d","webgl","webgl2","webgpu"]),pn=d.object({api:Xp,required:d.literal(!0),accelerationPreference:d.enum(["hardware-preferred","software-allowed"])}).strict(),ed=d.object({version:d.literal(2)}).strict(),td=d.enum(["angle","angle-egl","swangle","vulkan"]),od=d.object({glBackend:td,colorPipeline:d.literal("srgb"),sceneShot:ed.nullable()}).strict(),ux=d.object({webgl:d.string().min(1),renderer:d.string(),maxTextureSize:d.number().int().positive(),halfFloatColorTarget:d.string().min(1),glBackend:td}).strict(),mx=d.object({loadedRuntimeIdentity:d.string().min(1),loadedDependencyIdentity:d.string().min(1),observedRasterAffectingFlags:d.object({browserArguments:d.array(d.string().min(1))}).strict(),browserProduct:d.string().min(1),browserVersion:d.string().min(1),browserExecutableSha256:d.string().regex(/^[a-f0-9]{64}$/),headless:d.boolean(),os:d.string().min(1),arch:d.string().min(1),deviceScaleFactor:d.number().positive(),colorProfile:d.string().min(1),actualGlBackend:d.string().min(1),actualRenderer:d.string().min(1),gpuIdentity:d.string().min(1).nullable()}).strict(),Qde=mx.omit({deviceScaleFactor:!0}).strict(),Jde=d.object({handle:d.string().min(1),mimeType:d.literal("image/png"),byteLength:d.number().int().positive(),width:d.number().int().positive(),height:d.number().int().positive(),encodedSha256:d.string().regex(/^[a-f0-9]{64}$/)}).strict(),Zde=d.object({sessionId:d.string().uuid(),requestId:d.number().int().nonnegative(),frame:d.number().int().nonnegative(),deviceScaleFactor:d.number().positive()}).strict(),Ir=d.object({version:d.literal(an),assets:d.record(d.string().min(1),lx),graphics:pn,alphaPolicy:d.enum(["requires-transparency","allows-opaque"]),sceneShot:ed.optional()}).strict(),rd=Object.freeze({version:an,assets:Object.freeze({}),graphics:Object.freeze({api:"canvas2d",required:!0,accelerationPreference:"software-allowed"}),alphaPolicy:"requires-transparency"}),Rr=d.object({version:d.literal(an),componentId:d.string().min(1).max(128).regex(/^[a-z0-9][a-z0-9._-]*$/),tsxSource:d.string().min(1),manifest:Ir}).strict(),sd=d.object({handle:d.string().min(1).max(256),kind:cn,mimeType:d.string().min(1),contentSha256:d.string().regex(/^[a-f0-9]{64}$/),width:d.number().int().positive().optional(),height:d.number().int().positive().optional(),durationSec:d.number().positive().optional(),frameRate:d.number().positive().optional()}).strict(),hx=d.object({handle:d.string().min(1).max(256),kind:cn,mimeType:d.string().min(1),width:d.number().int().positive().optional(),height:d.number().int().positive().optional(),durationSec:d.number().positive().optional(),frameRate:d.number().positive().optional()}).strict(),fx=d.object({path:d.string().min(1)}).strict(),Xde=d.object({version:d.literal(cx),bundleId:d.string().regex(/^[a-f0-9]{64}$/),sourceVersionId:d.string().regex(/^[a-f0-9]{64}$/),runtimeDigest:d.string().min(1),dependencyLockDigest:d.string().regex(/^[a-f0-9]{64}$/),entrypoint:d.string().min(1),manifest:Ir}).strict(),ele=d.object({version:d.literal(Cr),bundleId:d.string().regex(/^[a-f0-9]{64}$/),params:d.record(d.string(),d.unknown()),assets:d.record(d.string().min(1),sd),width:d.number().int().positive(),height:d.number().int().positive(),fps:d.number().positive(),durationInFrames:d.number().int().positive(),alpha:d.boolean(),graphics:pn,seed:d.string().min(1),renderer:od}).strict(),tle=d.object({version:d.literal(Cr),source:Rr,params:d.record(d.string(),d.unknown()),assets:d.record(d.string().min(1),sd),width:d.number().int().positive(),height:d.number().int().positive(),fps:d.number().positive(),durationInFrames:d.number().int().positive(),codec:d.enum(["vp9","prores"]),runtimeDigest:d.string().min(1),dependencyLockDigest:d.string().regex(/^[a-f0-9]{64}$/),seed:d.string().min(1)}).strict(),ole=d.object({version:d.literal(Cr),source:Rr,params:d.record(d.string(),d.unknown()),assets:d.record(d.string().min(1),hx),assetFiles:d.record(d.string().min(1),fx),width:d.number().int().positive(),height:d.number().int().positive(),fps:d.number().positive(),durationInFrames:d.number().int().positive(),codec:d.enum(["vp9","prores"]),runtimeDigest:d.string().min(1),dependencyLockDigest:d.string().regex(/^[a-f0-9]{64}$/),seed:d.string().min(1)}).strict();var xx=d.object({api:Xp,acceleration:d.enum(["hardware","software"]),adapterName:d.string().min(1).optional(),deviceLost:d.literal(!1)}).strict(),rle=d.object({version:d.literal(Cr),artifactId:d.string().regex(/^[a-f0-9]{64}$/),renderKey:d.string().regex(/^[a-f0-9]{64}$/),bundleId:d.string().regex(/^[a-f0-9]{64}$/),sourceVersionId:d.string().regex(/^[a-f0-9]{64}$/),runtimeDigest:d.string().min(1),outputSha256:d.string().regex(/^[a-f0-9]{64}$/),outputBytes:d.number().int().positive(),codec:d.enum(["png","vp9","prores"]),width:d.number().int().positive(),height:d.number().int().positive(),fps:d.number().positive(),durationInFrames:d.number().int().positive(),alpha:d.boolean(),requestedGraphics:pn,actualGraphics:xx,renderer:od,host:ux.nullable()}).strict(),gx=["invalid_component_source","unsupported_runtime_version","component_does_not_compile","component_runtime_error","component_deadline_exceeded","component_resource_exhausted","component_asset_undeclared","component_asset_unavailable","component_asset_integrity_failed","component_network_denied","component_import_denied","component_api_mismatch","component_graphics_unavailable","component_graphics_mismatch","component_device_lost","component_output_invalid","component_output_unverifiable","component_conflict","component_scene_invalid"],sle=d.enum(gx),Ot=class extends Error{code;retryable;locator;constructor(e,t,r){super(t,r?.cause===void 0?void 0:{cause:r.cause}),this.name="ComponentRuntimeError",this.code=e,this.retryable=r?.retryable??!1,r?.locator&&(this.locator=r.locator)}};var nd=rd;function dn(o,e,t){let r=Ir.safeParse(o);if(!r.success)throw Object.assign(new Error(`Component "${e}" has no valid contract-v2 manifest at ${t}.`),{code:"no_component_manifest"});return r.data}function id(o,e){let t=Ax(o.root,"cueframe.json");if(!bx(t))throw Object.assign(new Error("No cueframe.json workspace manifest was found."),{code:"no_component_manifest"});let r=JSON.parse(yx(t,"utf8"));return dn(r.components?.[e]?.manifest,e,`cueframe.json components.${e}.manifest`)}var Cx="cueframe.json";function Ix(o){return o.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}function Rx(o){return o.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function ln(o,e){K(o,"new_component",new Error(e),B.UserError),N(B.UserError)}function wx(o,e){return`import React from 'react';
25
25
 
26
26
  /** Custom CueFrame component. Mounted through component contract v2. Edit me. */
27
- export default function ${t}({ params }: { durationInFrames: number; params: Record<string, unknown>; assets: Record<string, unknown>; render: { frame: number; fps: number; width: number; height: number; seed: string; colorSpace: 'srgb' } }) {
28
- return <div style={{ width: '100%', height: '100%', display: 'grid', placeItems: 'center' }}>{String((params as { text?: unknown }).text ?? '${n}')}</div>;
27
+ export default function ${e}({ params }: { durationInFrames: number; params: Record<string, unknown>; assets: Record<string, unknown>; render: { frame: number; fps: number; width: number; height: number; seed: string; colorSpace: 'srgb' } }) {
28
+ return <div style={{ width: '100%', height: '100%', display: 'grid', placeItems: 'center' }}>{String((params as { text?: unknown }).text ?? '${o}')}</div>;
29
29
  }
30
- `}function Zc(n,t){return`import { z } from 'zod';
30
+ `}function Ox(o,e){return`import { z } from 'zod';
31
31
  import component from './index';
32
32
 
33
33
  const paramsSchema = z.object({}).passthrough();
34
34
 
35
35
  export const config = {
36
- id: '${n}',
36
+ id: '${o}',
37
37
  component,
38
- name: '${t}',
38
+ name: '${e}',
39
39
  category: 'ui-blocks',
40
40
  kind: 'component',
41
41
  version: '0.1.0',
42
42
  paramsSchema,
43
43
  };
44
44
  export default config;
45
- `}function Ys(n,t){te(n,"name",t);let e=t.dryRun??!1,o=t.force??!1,r=Kc(n);r||vo(t,`name "${n}" has no alphanumeric characters to form a component identifier.`);let c=Jc(n);A(t,"new_component_prepare",{name:n,dryRun:e,force:o});let d=at(process.cwd());d||vo(t,"No CueFrame workspace found (no cueframe.json up-tree). Run `cueframe init` first to scaffold one.");let l=At(d,n),m=qc(l);m&&Gc(l).length>0&&!o&&vo(t,`Component dir ${l} already exists and is non-empty. Pass --force to overwrite (this replaces local source).`);let f={"index.tsx":Xc(n,r),"config.ts":Zc(n,c)};if(!e){Uc(l,{recursive:!0});for(let[T,E]of Object.entries(f))Xs(Zs(l,T),E);let g=Zs(d.root,Hc),b=JSON.parse(Wc(g,"utf8")),C=b.components??{};C[n]={custom:!0,manifest:Ks},b.components=C,Xs(g,`${JSON.stringify(b,null,2)}
46
- `)}K(t,{ok:!0,dryRun:e,name:n,component:r,dir:l,files:Object.keys(f),overwritten:m&&o},()=>{console.log(`\u2713 ${e?"Would scaffold":"Scaffolded"} custom component ${n} (${r}) into ${l}`);for(let b of Object.keys(f))console.log(` ${e?"would write":"wrote"} ${b}`);e||console.log(` stamped cueframe.json components.${n} (custom)`),console.log("Edit index.tsx, then `cueframe push "+n+"` to publish it to CueFrame.")})}import{existsSync as Vt,readFileSync as Nt}from"fs";import{join as $t}from"path";import ae from"typescript";var Yc="cueframe.json",Qc=["effects","transitions","text","layouts"];function ep(n){return Qc.includes(n??"")?n:"layouts"}function tp(n){let t=n;for(;ae.isAsExpression(t)||ae.isParenthesizedExpression(t)||typeof ae.isSatisfiesExpression=="function"&&ae.isSatisfiesExpression(t);)t=t.expression;return t}function op(n,t){for(let e of n.statements)if(ae.isImportDeclaration(e)&&ae.isStringLiteral(e.moduleSpecifier)&&e.moduleSpecifier.text===t)return!0;return!1}function Qs(n,t){let e=ae.createSourceFile(t,n,ae.ScriptTarget.Latest,!0,ae.ScriptKind.TS),o;for(let c of e.statements)if(ae.isVariableStatement(c)){for(let d of c.declarationList.declarations)if(ae.isIdentifier(d.name)&&d.name.text==="config"&&d.initializer){let l=tp(d.initializer);ae.isObjectLiteralExpression(l)&&(o=l)}if(o)break}let r={};if(!o)return r;for(let c of o.properties){if(!ae.isPropertyAssignment(c)||!(ae.isIdentifier(c.name)||ae.isStringLiteral(c.name)))continue;let d=c.name.text;ae.isStringLiteralLike(c.initializer)&&(d==="name"?r.name=c.initializer.text:d==="category"?r.category=c.initializer.text:d==="version"&&(r.version=c.initializer.text))}return r}function rp(n){let t=$t(n,"config.ts");if(!Vt(t))return{};let e=Nt(t,"utf8"),o=ae.createSourceFile("config.ts",e,ae.ScriptTarget.Latest,!0,ae.ScriptKind.TS),r=$t(n,"_config.ts");return op(o,"./_config")&&Vt(r)?Qs(Nt(r,"utf8"),"_config.ts"):Qs(e,"config.ts")}function sp(n){return n.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function np(n,t){let e=$t(n.root,Yc);if(Vt(e))try{let r=JSON.parse(Nt(e,"utf8")).components?.[t]?.ejectedFrom;return typeof r=="string"&&r.length>0?r:void 0}catch{return}}var jt="none \u2014 params are unvalidated server-side";function en(n){let t=n.code;return t==="no_component_source"||t==="no_component_manifest"?O.UserError:V(n)}async function tn(n,t,e){let o=At(n,t),r=$t(o,"index.tsx");if(!Vt(r))throw Object.assign(new Error(`Component "${t}" has no index.tsx at ${o}. Scaffold it first (cueframe eject / new component).`),{code:"no_component_source"});let c=Nt(r,"utf8"),d=rp(o),l=d.name??sp(t),m=ep(d.category),f=np(n,t),g=Js(n,t),b=`Custom component "${t}" pushed from the local CueFrame workspace.`,C={type:"object",properties:{}};A(e,"push_component",{id:t,name:l,category:m,version:d.version,ejectedFrom:f,propSchema:jt});let T=!1;try{await Ee.getComponent(t),T=!0}catch(E){if(E instanceof fe&&E.status===404)T=!1;else throw E}return T?(await Ee.updateComponent(t,{tsxSource:c,name:l,description:b,category:m,propSchema:C,origin:"customer-owned",manifest:g,...f?{ejectedFrom:f}:{}}),A(e,"pushed",{id:t,action:"updated"}),{id:t,action:"updated",name:l,category:m,propSchema:jt}):(await Ee.createComponent({componentId:t,tsxSource:c,name:l,description:b,category:m,propSchema:C,origin:"customer-owned",manifest:g,...f?{ejectedFrom:f}:{}}),A(e,"pushed",{id:t,action:"created"}),{id:t,action:"created",name:l,category:m,propSchema:jt})}async function on(n,t){n||(j(t,"push",new Error("Pass a component id (cueframe push <id>), or use `cueframe sync` to push all."),O.UserError),I(O.UserError)),te(n,"id",t),H(t.target);let e=at(process.cwd());e||(j(t,"push",new Error("No CueFrame workspace found (no cueframe.json up-tree). Run `cueframe init` first."),O.UserError),I(O.UserError)),A(t,"push_prepare",{id:n,target:t.target});try{let o=await tn(e,n,t);K(t,{ok:!0,target:t.target,...o},()=>{console.log(`\u2713 ${o.action} component ${o.id} (${o.name}) on CueFrame`),console.log(` propSchema: ${o.propSchema}`)})}catch(o){let r=en(o);j(t,"push",o,r),I(r)}}async function rn(n){H(n.target);let t=at(process.cwd());t||(j(n,"sync",new Error("No CueFrame workspace found (no cueframe.json up-tree). Run `cueframe init` first."),O.UserError),I(O.UserError));let e=Bs(t);A(n,"sync_prepare",{target:n.target,count:e.length,ids:e});let o=[],r=[];for(let c of e)try{o.push(await tn(t,c,n))}catch(d){let l=en(d);se(n,"sync",d,l),r.push({id:c,error:d})}K(n,{ok:r.length===0,target:n.target,pushed:o,failed:r.map(c=>({id:c.id,error:Q(c.error)}))},()=>{if(o.length===0&&r.length===0){console.log("No components to sync. Scaffold one with `cueframe eject` or `cueframe new component`.");return}for(let c of o)console.log(`\u2713 ${c.action} ${c.id} (${c.name})`);o.length>0&&console.log(` propSchema: ${jt}`);for(let c of r)console.error(`\u2716 ${c.id}: ${Q(c.error)}`);console.log(`Synced ${o.length}/${e.length} component(s) to CueFrame.`)}),r.length>0&&I(V(r[0].error))}var Bt=["media","sessions","projects","renders","webhooks"],sn={readonly:Object.fromEntries(Bt.map(n=>[n,["read"]])),editall:Object.fromEntries(Bt.map(n=>[n,["read","write"]]))};function ip(n){if(n.preset){let t=sn[n.preset];return t||(console.error(`Unknown --preset "${n.preset}". Valid: ${Object.keys(sn).join(", ")}.`),I(O.UserError)),t}if(n.scope)return ap(n.scope);console.error("Provide --scope or --preset (e.g. --preset readonly | editall)."),I(O.UserError)}function ap(n){let t={};for(let e of n.split(",").map(o=>o.trim()).filter(Boolean)){let[o,r]=e.split(":");(!o||!r)&&(console.error(`Invalid --scope "${e}". Use resource:rw (e.g. renders:rw,media:r).`),I(O.UserError)),Bt.includes(o)||(console.error(`--scope "${e}": unknown resource "${o}". Valid: ${Bt.join(", ")}.`),I(O.UserError));let c=[];/r/i.test(r)&&c.push("read"),/w/i.test(r)&&c.push("write"),c.length===0&&(console.error(`--scope "${e}": actions must include r and/or w.`),I(O.UserError)),t[o]=c}return Object.keys(t).length===0&&(console.error("--scope is required, e.g. --scope media:rw,projects:rw,renders:rw"),I(O.UserError)),t}async function nn(n){H(n.target);let t=ip(n),e={name:n.name,permissions:t};if(n.expires){let o=Number(n.expires);(!Number.isFinite(o)||o<=0)&&(console.error("--expires must be a positive number of days."),I(O.UserError)),e.expiresIn=Math.round(o*86400)}try{let o=await bs("/v1/api-keys",{method:"POST",body:JSON.stringify(e),headers:{"content-type":"application/json"}});K(n,{ok:!0,id:o.id,prefix:o.prefix,start:o.start,key:o.key},()=>{let r=Object.entries(t).map(([c,d])=>`${c}:${d.map(l=>l[0]).join("")}`).join(" ");console.log(`\u2713 API key "${n.name}" created \u2014 scopes: ${r}`),console.log(`
47
- ${o.key}
48
- `),console.log(" Shown ONCE \u2014 store it now (paste it into your integration; not saved here).")})}catch(o){j(n,"keys_create",o,V(o)),I(V(o))}}async function an(n){H(n.target);let t;try{t=await ge("/api/auth/api-key/list",{method:"GET"})}catch(o){j(n,"keys_list",o,V(o)),I(V(o))}t.status>=400&&(j(n,"keys_list",new Error(`list failed (${t.status})`),ce(t.status)),I(ce(t.status)));let e=Array.isArray(t.body)?t.body:[];K(n,{ok:!0,keys:e},()=>{if(e.length===0){console.log("No API keys.");return}for(let o of e)console.log(` ${o.id} ${o.name??"(unnamed)"} ${o.start??""}\u2026`)})}async function cn(n,t){H(t.target);let e;try{e=await ge("/api/auth/api-key/delete",{method:"POST",body:JSON.stringify({keyId:n}),headers:{"content-type":"application/json"}})}catch(o){j(t,"keys_revoke",o,V(o)),I(V(o))}e.status>=400&&(j(t,"keys_revoke",new Error(`revoke failed (${e.status})`),ce(e.status)),I(ce(e.status))),K(t,{ok:!0,revoked:n},()=>console.log(`\u2713 Revoked ${n}`))}async function pn(n){H(n.target),A(n,"list_prepare",{target:n.target});try{let t=await Be.listProjects(),e=n.limit,o=typeof e=="number"&&Number.isFinite(e)&&e>0?t.data.slice(0,e):t.data;if(A(n,"list_complete",{count:o.length,total:t.data.length,truncated:o.length<t.data.length,projects:o}),!n.json){if(t.data.length===0){console.log("No projects found.");return}for(let r of o){let c=new Date(r.createdAt).toLocaleDateString();console.log(` ${r.id} ${r.name} (${c})`)}o.length<t.data.length&&console.log(` \u2026 ${t.data.length-o.length} more (raise --limit to see all)`)}}catch(t){j(n,"list",t,V(t)),I(V(t))}}import{readFile as cp,stat as pp}from"fs/promises";import{existsSync as dp}from"fs";import{basename as lp,extname as up}from"path";var mp=4e3,dn=1800*1e3,ln=5,un={".mp4":"video/mp4",".mov":"video/quicktime",".webm":"video/webm",".mkv":"video/x-matroska",".wav":"audio/wav",".mp3":"audio/mpeg",".m4a":"audio/mp4",".aac":"audio/aac",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml"};function hp(n,t){let e=up(n).toLowerCase(),o=un[e];if(!o){let r=new Error(`Unsupported file extension "${e||"(none)"}" for ${n}. Supported: ${Object.keys(un).join(", ")}.`);j(t,"preflight",r,O.UserError),I(O.UserError)}return o}var mn=["vo","music","sfx","ambience"];async function _t(n,t){dp(n)||(j(t,"preflight",new Error(`File not found: ${n}`),O.UserError),I(O.UserError));let e=lp(n),o=(await pp(n)).size,r=hp(e,t);if(t.audioRole&&!mn.includes(t.audioRole)){let k=new Error(`--audio-role must be one of ${mn.join("|")} (got "${t.audioRole}")`);j(t,"preflight",k,O.UserError),I(O.UserError)}let c=t.audioRole;if(t.dryRun){A(t,"upload_dry_run",{file:e,sizeBytes:o,contentType:r,target:t.target,analyzeAfter:!!t.analyze,wouldCall:"POST /v1/media \u2192 presigned PUT \u2192 POST /v1/media/:id/finalize \u2192 poll processing"}),t.json||console.log(`[dry-run] Would upload ${e} (${(o/1024/1024).toFixed(1)} MB, ${r}) to ${t.target}.`);return}H(t.target),A(t,"upload_prepare",{file:e,sizeBytes:o,contentType:r,target:t.target});let d=ie("Preparing upload\u2026",t.json),l,m;try{let k=await Ae.createMediaUpload({filename:e,contentType:r,size:o});l=k.id,m=k.uploadUrl,d.succeed("Ready"),A(t,"upload_ready",{mediaItemId:l})}catch(k){d.fail(`Failed: ${Q(k)}`),se(t,"upload_prepare",k,V(k)),I(V(k))}let f=Date.now(),g=ie(`Uploading ${e} (${(o/1024/1024).toFixed(1)} MB)\u2026`,t.json);try{let k=await cp(n),q=await fetch(m,{method:"PUT",headers:{"Content-Type":r},body:k});if(!q.ok)throw new Error(`presigned PUT failed: ${q.status} ${q.statusText}`);await Ae.finalizeMedia(l,c?{audioRole:c}:{}),g.succeed(`Uploaded: ${e}`),A(t,"upload_complete",{mediaItemId:l,bytesUploaded:o,...c?{audioRole:c}:{},durationMs:Date.now()-f})}catch(k){g.fail(`Upload failed: ${Q(k)}`),se(t,"upload",k,O.NetworkError),I(O.NetworkError)}let b=ie("Processing (transcription)\u2026",t.json),C=Date.now(),T=null,E=0;for(;;){if(await new Promise(k=>setTimeout(k,mp)),Date.now()-C>dn){let k=`Processing did not complete within ${Math.round(dn/6e4)}m. Media item ID: ${l}.`;b.fail(k),se(t,"process",new Error(k),O.ApiServerError),I(O.ApiServerError)}try{let k=await Ae.getMedia(l);E=0;let q=k?.processingStatus?.phase??"unknown",_=k?.processingStatus?.percent??null,U=Math.round((Date.now()-C)/1e3),me=_!=null?` \xB7 ${Math.round(_*100)}%`:"";if(b.text=`Processing\u2026 ${q}${me} (${U}s)`,A(t,"process_progress",{phase:q,percent:_,elapsedSec:U}),q==="complete"||q==="completed"){b.succeed(`Ready: ${l}`),T=k,A(t,"process_complete",{mediaItemId:l,durationMs:Date.now()-C,item:k});break}if(q==="error"){let he=k?.processingStatus?.error??"unknown error";b.fail(`Processing failed: ${he}`),se(t,"process",new Error(he),O.ApiServerError),I(O.ApiServerError)}}catch(k){k instanceof fe&&[401,403,404].includes(k.status)&&(b.fail(`Processing check failed: ${Q(k)}`),se(t,"process",k,V(k)),I(V(k))),E++,E>=ln&&(b.fail(`Processing check failed: ${Q(k)}`),se(t,"process",new Error(`Processing status unreadable after ${ln} consecutive failures: ${Q(k)}`),V(k)),I(V(k)))}}if(t.analyze){be(`
49
- Media item ID: ${l}`,t);let{analyzeCommand:k}=await import("./analyze-J3YAYGD4.js");return await k(l,{target:t.target,wait:!0,json:t.json}),{mediaItemId:l,item:T}}return t.json||K(t,{mediaItemId:l,item:T},()=>{console.log(`
50
- Media item ID: ${l}`),console.log(`
51
- Run \`cueframe analyze ${l} --target ${t.target}\` to generate clip suggestions.`)}),{mediaItemId:l,item:T}}function Po(n){let t=Math.floor(n/60),e=Math.floor(n%60);return`${t}:${String(e).padStart(2,"0")}`}async function hn(n,t){n!==void 0&&te(n,"mediaItemId",t),H(t.target),A(t,"clips_prepare",{target:t.target,mode:n?"suggestions":"media-list",...n?{mediaItemId:n}:{}});try{if(!n){let o=await Ae.listMedia();if(A(t,"clips_complete",{mode:"media-list",count:o.data.length,media:o.data}),!t.json){if(o.data.length===0){console.log("No media items found. Import a video first.");return}console.log("Media items (pass the ID to `cueframe clips <id>`):"),console.log("");for(let r of o.data){let c=r.duration?`${Po(r.duration)} `:"",d=r.processingStatus?.phase??"unknown",l=d==="complete"?"":` [${d}]`;console.log(` ${r.id} ${r.name} ${c}${l}`)}}return}let e=await Cs.listMediaSuggestions(n);if(A(t,"clips_complete",{mode:"suggestions",mediaItemId:n,count:e.suggestions.length,suggestions:e.suggestions}),!t.json){if(e.suggestions.length===0){console.log("No clip suggestions found for this media item."),console.log("If analysis is still running, try again shortly. Otherwise the video may not have suitable clips.");return}console.log(`${e.suggestions.length} clip suggestion${e.suggestions.length!==1?"s":""}:`),console.log("");for(let o of e.suggestions){let r=`${Po(o.trim.start)} \u2192 ${Po(o.trim.end)}`,c=(o.trim.end-o.trim.start).toFixed(1);console.log(` ${o.id}`),console.log(` ${o.title}`),console.log(` ${r} (${c}s) ${o.format} score: ${o.score}`),o.reason&&console.log(` ${o.reason}`),console.log("")}}}catch(e){j(t,"clips",e,V(e)),I(V(e))}}import{readFileSync as fp}from"fs";async function fn(n,t){te(n,"projectId",t),H(t.target),A(t,"composition_get_prepare",{projectId:n});let e=await ct(`/v1/projects/${n}/composition`,{method:"GET"},t,"composition_get");e.status>=400&&(pt(e,t,"composition_get"),I(ce(e.status)));let o=e.headers.etag,r=o&&xn(o);A(t,"composition_get_complete",{projectId:n,etag:r,status:e.status}),K(t,{etag:r,composition:e.body},()=>{r&&console.log(`# ETag: ${r}`),console.log(JSON.stringify(e.body,null,2))})}async function qt(n,t){te(n,"projectId",t),t.body||(console.error("--body is required (inline JSON, @file.json, or @- for stdin)"),I(O.UserError)),H(t.target);let e=await Io(n,t),o=await gn(t.body);A(t,"composition_put_prepare",{projectId:n,ifMatch:e});let r=new Headers({"content-type":"application/json","if-match":e}),c=await ct(`/v1/projects/${n}/composition`,{method:"PUT",headers:r,body:o},t,"composition_put");c.status>=400&&(pt(c,t,"composition_put"),I(ce(c.status)));let d=c.headers.etag;return A(t,"composition_put_complete",{projectId:n,etag:d,status:c.status,response:c.body}),K(t,{etag:d,response:c.body},()=>{console.log(`Composition saved (ETag: ${d??"unknown"}).`),c.body&&typeof c.body=="object"&&console.log(JSON.stringify(c.body,null,2))}),{etag:d,response:c.body}}async function Ut(n,t){te(n,"projectId",t),t.suggestionId||(console.error("--suggestion <suggestionId> is required"),I(O.UserError)),H(t.target);let e=await Io(n,t),o;if(t.format)try{o=JSON.parse(t.format)}catch{console.error(`--format must be JSON, e.g. '{"aspectRatio":"9:16","fps":30,"resolution":"fhd"}'`),I(O.UserError)}let r=JSON.stringify({suggestionId:t.suggestionId,...o?{format:o}:{}});A(t,"composition_from_suggestion_prepare",{projectId:n,suggestionId:t.suggestionId,ifMatch:e});let c,d=e,l=0,m=3;for(;;){l++;let g=new Headers({"content-type":"application/json","if-match":d});if(c=await ct(`/v1/projects/${n}/composition/from-suggestion`,{method:"POST",headers:g,body:r},t,"composition_from_suggestion"),!(c.status===409&&c.body?.error?.code==="stale_etag"))break;if(l>m){A(t,"composition_from_suggestion_etag_retries_exhausted",{projectId:n,attempts:m});break}A(t,"composition_from_suggestion_etag_retry",{projectId:n,attempt:l,reason:"stale_etag"}),d=await Io(n,t)}c.status>=400&&(pt(c,t,"composition_from_suggestion"),I(ce(c.status)));let f=c.headers.etag;A(t,"composition_from_suggestion_complete",{projectId:n,suggestionId:t.suggestionId,etag:f,status:c.status,response:c.body,attempts:l}),K(t,{etag:f,response:c.body},()=>{console.log(`Composition built from suggestion ${t.suggestionId} (ETag: ${f??"unknown"}).`),c.body&&typeof c.body=="object"&&console.log(JSON.stringify(c.body,null,2))})}async function Wt(n){n.body||(console.error("--body is required (inline JSON, @file.json, or @- for stdin)"),I(O.UserError)),H(n.target);let t=await gn(n.body);A(n,"composition_validate_prepare",{});let e=new Headers({"content-type":"application/json"}),o=await ct("/v1/composition/validate",{method:"POST",headers:e,body:t},n,"composition_validate");return o.status>=400&&(pt(o,n,"composition_validate"),I(ce(o.status))),A(n,"composition_validate_complete",{status:o.status}),K(n,{valid:!0},()=>{console.log("\u2713 Composition is valid.")}),{valid:!0}}function xn(n){return n.replace(/^W\//,"").replace(/-gzip(?=("?)$)/,"")}async function Io(n,t){if(t.force)return"*";if(t.ifMatch)return t.ifMatch;let e=await ct(`/v1/projects/${n}/composition`,{method:"GET"},t,"composition_etag_fetch");if(e.status===404)return be("No existing composition; treating as create (If-Match: *).",t),"*";e.status>=400&&(pt(e,t,"composition_etag_fetch"),I(ce(e.status)));let o=e.headers.etag;return o||(j(t,"composition_etag_fetch",new Error("Server returned no ETag on composition GET; cannot safely thread If-Match. Pass --force to overwrite anyway."),O.ApiServerError),I(O.ApiServerError)),xn(o)}async function gn(n){if(n.startsWith("@")){let t=n.slice(1);if(t==="-"){let e=[];for await(let o of process.stdin)e.push(Buffer.isBuffer(o)?o:Buffer.from(o));return Buffer.concat(e).toString("utf-8")}return fp(t,"utf-8")}return n}async function ct(n,t,e,o){try{return await ge(n,t)}catch(r){j(e,o,r,O.NetworkError),I(O.NetworkError)}}function pt(n,t,e){let o=n.body?.error,r=o?.code??"unknown",c=o?.message??n.statusText,d=xp(r,n.status,o?.details),l=ce(n.status);t.json?j(t,e,Object.assign(new Error(c),{code:r,status:n.status,details:o?.details,advice:d}),l):(process.stderr.write(`\u2716 ${e}: ${c} (${r}, ${n.status})
52
- `),d&&process.stderr.write(` \u2192 ${d}
53
- `))}function xp(n,t,e){let o=new fe(t,{code:n,message:"",details:e&&typeof e=="object"?e:void 0}),r=Ss(o);return r||(t===404?"Project or composition not found. Run `cueframe list` to confirm the project ID; the composition may not yet exist.":null)}async function Gt(n){let t=n.aspect?{aspectRatio:n.aspect,fps:n.fps??30,resolution:n.resolution??"fhd"}:void 0;if(n.dryRun){if(A(n,"project_create_dry_run",{name:n.name,target:n.target,format:t??null,brandKitId:n.brandKitId??null,fromSuggestion:n.fromSuggestion??null,cheap:n.cheap??!1,wouldCall:n.fromSuggestion?n.cheap?"POST /v1/projects \u2192 POST /v1/projects/:id/composition/from-suggestion (sync translator)":"POST /v1/projects \u2192 POST /v1/projects/:id/compose (async) \u2192 SSE watch":"POST /v1/projects"}),!n.json){let r=n.cheap?" (--cheap: deterministic translator)":"";console.log(`[dry-run] Would create project "${n.name}" on ${n.target}`+(n.fromSuggestion?` from suggestion ${n.fromSuggestion}${r}.`:"."))}return}H(n.target),A(n,"project_create_prepare",{name:n.name,target:n.target,fromSuggestion:n.fromSuggestion??null,brandKitId:n.brandKitId??null,cheap:n.cheap??!1});let e=ie(`Creating project "${n.name}"\u2026`,n.json),o;try{o=await Be.createProject({name:n.name,format:t,brandKitId:n.brandKitId}),e.succeed(`Created: ${o.id}`)}catch(r){e.fail(`Failed: ${Q(r)}`),se(n,"project_create",r,V(r)),I(V(r))}if(A(n,"project_create_complete",{project:o}),!n.json&&!n.fromSuggestion&&console.log(`
54
- ${o.id} ${o.name}`),n.fromSuggestion){let r=!1;if(r||await Ut(o.id,{target:n.target,suggestionId:n.fromSuggestion,json:n.json,force:!0}),!n.json){let c=r?"(composed)":"(translated)";console.log(`
55
- ${o.id} ${o.name} \u2190 composed from ${n.fromSuggestion} ${c}`)}}return o}async function yn(n,t){te(n,"projectId",t),H(t.target),A(t,"project_delete_prepare",{projectId:n});try{await Be.deleteProject(n),A(t,"project_delete_complete",{projectId:n}),K(t,{ok:!0,projectId:n},()=>{console.log(`Project ${n} deleted.`)})}catch(e){j(t,"project_delete",e,V(e)),I(V(e))}}async function bn(n,t){te(n,"mediaId",t),H(t.target),A(t,"media_delete_prepare",{mediaId:n});try{await Ae.deleteMedia(n),A(t,"media_delete_complete",{mediaId:n}),K(t,{ok:!0,mediaId:n},()=>{console.log(`Media ${n} deleted.`)})}catch(e){j(t,"media_delete",e,V(e)),I(V(e))}}import{writeFileSync as gp}from"fs";import{resolve as yp}from"path";var bp=1500,Sp=4e3,zp=1800*1e3,Sn=5;async function Oo(n,t,e={}){let o=Date.now()+(e.timeoutMs??zp),r=e.reconnectBackoffMs??bp,c=Date.now(),d=0;for(;Date.now()<o;){let l=null,m=!1;try{for await(let f of zs(n,t)){if(d=0,f.event==="progress"){let g=Math.round((Date.now()-c)/1e3);if(e.spinner){let b=Math.round(f.data.percent*100);e.spinner.text=`Rendering\u2026 ${f.data.phase}${b>0?` \xB7 ${b}%`:""} (${g}s)`}e.onProgress?.({phase:f.data.phase,percent:f.data.percent,elapsedSec:g});continue}f.event==="complete"?l={kind:"complete",outputUrl:f.data.outputUrl,outputExpiresAt:f.data.outputExpiresAt,duration:f.data.duration}:l={kind:"failed",message:f.data.message};break}}catch(f){if(f instanceof fe)m=!0;else{if(d++,d>=Sn)throw Object.assign(new Error(`Render stream unreachable after ${Sn} consecutive transport failures: ${f instanceof Error?f.message:String(f)}`),{cause:f});await new Promise(g=>setTimeout(g,r));continue}}if(l)return l;if(m){let f=await wp(n,t);if(f)return f;await new Promise(g=>setTimeout(g,Sp));continue}await new Promise(f=>setTimeout(f,r))}return{kind:"failed",message:`Timed out waiting for render to reach a terminal state. Render ID: ${t}, Project ID: ${n}.`}}async function wp(n,t){let e=await Ms.getRender(n,t);return e.status==="complete"?{kind:"complete",outputUrl:e.outputUrl??null,outputExpiresAt:null,duration:null}:e.status==="error"||e.status==="cancelled"?{kind:"failed",message:e.error??`Render ${e.status}`}:null}async function zn(n,t){te(n,"renderId",t),te(t.project,"projectId",t),H(t.target),A(t,"render_watch_prepare",{renderId:n,projectId:t.project,target:t.target});let e=ie(`Watching render ${n}\u2026`,t.json),o;try{o=await Oo(t.project,n,{spinner:e,onProgress:c=>A(t,"render_progress",{renderId:n,...c})})}catch(c){e.fail(`Failed to watch render: ${Q(c)}`),se(t,"render_watch",c,V(c)),I(V(c))}o.kind==="failed"&&(e.fail(o.message),se(t,"render_watch",new Error(o.message),O.ApiServerError),I(O.ApiServerError)),e.succeed(`Render complete (${n})`);let r=null;t.download&&o.outputUrl?r=await ko(o.outputUrl,t.out??`./reel-${n.slice(0,8)}.mp4`,t.json):o.outputUrl||(j(t,"render_watch",new Error("Render reported complete but no outputUrl was returned."),O.ApiServerError),t.json||console.error(`Render reported complete but no outputUrl was returned.
56
- Re-fetch via GET /v1/projects/${t.project}/renders/${n}.`),I(O.ApiServerError)),A(t,"render_complete",{renderId:n,projectId:t.project,outputUrl:o.outputUrl,outputExpiresAt:o.outputExpiresAt,duration:o.duration,outputPath:r}),t.json||(o.outputUrl&&console.log(`MP4 URL: ${o.outputUrl}`),o.outputExpiresAt&&console.log(`Expires: ${o.outputExpiresAt}`),o.duration!=null&&console.log(`Duration: ${o.duration}s`))}async function ko(n,t,e){let o=yp(t),r=ie(`Downloading \u2192 ${o}\u2026`,e);try{let c=await fetch(n);if(!c.ok)throw new Error(`HTTP ${c.status}`);let d=Buffer.from(await c.arrayBuffer());return gp(o,d),r.succeed(`Saved: ${o} (${(d.length/1024/1024).toFixed(1)} MB)`),o}catch(c){r.fail(`Download failed: ${Q(c)}`),console.error(`
57
- MP4 URL (1-hour TTL): ${n}`),I(O.NetworkError)}}async function wn(n,t){let e=t.map(d=>d==null?"null":String(d)).join(":"),o=`${n}:${e}`,r=new TextEncoder().encode(o),c=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(c),d=>d.toString(16).padStart(2,"0")).join("")}async function Cp(n){let t=await ge(`/v1/projects/${n}/composition`,{method:"GET"});return t.status===404?"no-composition":t.status>=400?"unknown-composition":t.headers.etag??"no-etag"}async function Ht(n,t){if(te(n,"projectId",t),t.dryRun){A(t,"render_dry_run",{projectId:n,target:t.target,wouldCall:"POST /v1/projects/:id/renders \u2192 SSE watch \u2192 download MP4"}),t.json||console.log(`[dry-run] Would render project ${n} on ${t.target}.`);return}H(t.target),A(t,"render_prepare",{projectId:n,target:t.target});let e;try{e=t.idempotencyKey??await wn("render",[n,await Cp(n)]),A(t,"idempotency_key",{scope:"render",key:e,overridden:!!t.idempotencyKey})}catch(g){e="",A(t,"idempotency_key",{scope:"render",key:null,skipped:!0,reason:g instanceof Error?g.message:String(g)})}let o=ie("Queuing render\u2026",t.json),r,c,d=!1;try{let g=t.aspect?{format:{aspectRatio:t.aspect,fps:t.fps??30,resolution:t.resolution??"fhd"}}:{};t.priority&&(g.priority=t.priority),t.intent&&(g.intent=t.intent);let b={"content-type":"application/json"};e&&(b["idempotency-key"]=e);let C=await ge(`/v1/projects/${n}/renders`,{method:"POST",headers:b,body:JSON.stringify(g)});if(C.status>=400){let E=C.body?.error;throw new fe(C.status,{code:E?.code??"unknown",message:E?.message??C.statusText})}let T=C.body;r=T.id,c=T.status,d=C.headers["idempotency-replay"]==="true",o.succeed(d?`Render replayed: ${r} (status: ${c})`:`Render queued: ${r}`)}catch(g){o.fail(`Failed: ${Q(g)}`),se(t,"render_prepare",g,V(g)),I(V(g))}d?A(t,"render_idempotent_replay",{renderId:r,projectId:n,status:c,idempotencyKey:e}):A(t,"render_queued",{renderId:r,projectId:n});let l=ie("Rendering\u2026",t.json),m;try{m=await Oo(n,r,{spinner:l,onProgress:g=>A(t,"render_progress",{renderId:r,...g})})}catch(g){l.fail(`Failed to watch render: ${Q(g)}`),se(t,"render_progress",g,V(g)),I(V(g))}m.kind==="failed"&&(l.fail(m.message),se(t,"render_progress",new Error(m.message),O.ApiServerError),I(O.ApiServerError)),l.succeed("Render complete"),m.outputUrl||(j(t,"render_complete",new Error("Render reported complete but no outputUrl was returned."),O.ApiServerError),t.json||console.error(`Render reported complete but no outputUrl was returned.
58
- Render ID: ${r}
59
- Project ID: ${n}
60
- Re-fetch via GET /v1/projects/${n}/renders/${r} once the URL is signed.`),I(O.ApiServerError));let f=await ko(m.outputUrl,t.out??`./reel-${r.slice(0,8)}.mp4`,t.json);return A(t,"render_complete",{renderId:r,projectId:n,outputUrl:m.outputUrl,outputExpiresAt:m.outputExpiresAt,duration:m.duration,outputPath:f}),{renderId:r,projectId:n,outputUrl:m.outputUrl,outputExpiresAt:m.outputExpiresAt,duration:m.duration,outputPath:f}}import{existsSync as Kt}from"fs";import{readFile as Mp}from"fs/promises";import{resolve as ye}from"path";var Eo="REPLACE_WITH_MEDIA_ID";function Ge(n,t,e=Eo){let o=0,r=d=>d===e?(o+=1,t):Array.isArray(d)?d.map(r):d&&typeof d=="object"?Object.fromEntries(Object.entries(d).map(([l,m])=>[l,r(m)])):d,c=r(n);if(o!==1)throw new Error(`Recipe must contain exactly one ${e} media value; found ${o}.`);return c}async function Ao(n,t){try{return JSON.parse(await Mp(n,"utf8"))}catch(e){j(t,"recipe_read",new Error(`Could not read valid JSON from ${n}: ${Q(e)}`),O.UserError),I(O.UserError)}}function Cn(n,t,e){let o=n.recipe?.mediaSlots?.[0]?.projectMediaId;(!n.name||!n.composition||!o||!n.recipe?.cloudBrandKit)&&(j(e,"recipe_read",new Error(`${t} is a project, but not a portable CueFrame recipe template.`),O.UserError),I(O.UserError));let r=(n.recipe.components??[]).map(c=>{let d=c.componentId,l=c.sourceVersionId,m=d&&l?n.authoredComponents?.[d]?.versions?.[l]:void 0;return(!d||!l||!m||m.componentId!==d)&&(j(e,"recipe_read",new Error(`${t} has an invalid authored component reference.`),O.UserError),I(O.UserError)),{id:d,name:c.name||d,category:c.category??"layouts",source:m,propSchema:c.propSchema}});return{name:n.name,brandKit:n.recipe.cloudBrandKit,composition:n.composition,mediaPlaceholder:o,components:r}}async function Tp(n,t){let e=ye(n);if(e.endsWith(".cueframe"))return Cn(await Ao(e,t),e,t);if(!Kt(e)&&/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)){let d=`https://raw.githubusercontent.com/cueframe-ai/cueframe-recipes/main/${n}/recipe.cueframe`;try{let l=await fetch(d,{headers:{accept:"application/json"}});if(!l.ok)throw new Error(`${l.status} ${l.statusText}`);return Cn(await l.json(),d,t)}catch(l){j(t,"recipe_fetch",new Error(`Could not load recipe "${n}" from cueframe-ai/cueframe-recipes: ${Q(l)}`),O.NetworkError),I(O.NetworkError)}}let o=e,[r,c]=await Promise.all([Ao(ye(o,"brand-kit.json"),t),Ao(ye(o,"composition.template.json"),t)]);return{name:o.split("/").pop()??r.name,brandKit:r,composition:c,mediaPlaceholder:Eo,components:[]}}async function Rp(n,t){let e=n.components.map(o=>({component:o,manifest:Ro(o.source.manifest,o.id,`the ${n.name} recipe source manifest`)}));for(let{component:o,manifest:r}of e){let c={tsxSource:o.source.tsxSource,name:o.name,description:`Authored component installed from the ${n.name} CueFrame recipe.`,category:o.category,propSchema:o.propSchema??{type:"object",properties:{}},origin:"customer-owned",manifest:r},d=!1;try{await Ee.getComponent(o.id),d=!0}catch(l){if(!(l instanceof fe)||l.status!==404)throw l}d?await Ee.updateComponent(o.id,c):await Ee.createComponent({componentId:o.id,...c}),A(t,"recipe_component_ready",{componentId:o.id,action:d?"updated":"created"})}}async function Mn(n){let t=await Tp(n.directory,n);if(n.dryRun){Ge(t.composition,"dry_run_media_id",t.mediaPlaceholder);let b={recipe:Kt(ye(n.directory))?ye(n.directory):n.directory,media:ye(n.media),target:n.target,render:n.render,output:ye(n.out),wouldRun:["upload source media",...t.components.length>0?["install authored recipe components"]:[],"upsert recipe brand kit","create project","bind media to recipe composition","validate composition","save composition",...n.render?["render and download MP4"]:[]]};return K(n,b,()=>console.log(`[dry-run] Recipe is valid. Would create ${t.name}.`)),b}A(n,"recipe_run_prepare",{recipe:Kt(ye(n.directory))?ye(n.directory):n.directory,media:ye(n.media),target:n.target});let e=await _t(n.media,{target:n.target,analyze:!1,json:n.json});H(n.target);try{await Rp(t,n)}catch(b){j(n,"recipe_components",b,V(b)),I(V(b))}let o;try{o=await ws.createBrandKit(t.brandKit),A(n,"recipe_brand_kit_ready",{brandKitId:o.id})}catch(b){j(n,"recipe_brand_kit",b,V(b)),I(V(b))}let r=t.composition.format,c=await Gt({name:t.name,target:n.target,aspect:r?.aspectRatio,fps:r?.fps,resolution:r?.resolution,brandKitId:o.id,json:n.json});if(!e||!c)throw new Error("Recipe orchestration stopped before CueFrame returned the required media and project IDs.");let d=Ge(t.composition,e.mediaItemId,t.mediaPlaceholder),l=JSON.stringify(d);await Wt({target:n.target,body:l,json:n.json});let m=await qt(c.id,{target:n.target,body:l,force:!0,json:n.json}),f=n.render?await Ht(c.id,{target:n.target,out:n.out,json:n.json}):void 0,g={recipe:Kt(ye(n.directory))?ye(n.directory):n.directory,mediaItemId:e.mediaItemId,brandKitId:o.id,projectId:c.id,compositionEtag:m.etag,...f?{renderId:f.renderId,outputPath:f.outputPath}:{}};return A(n,"recipe_run_complete",g),n.json||K(n,g,()=>{console.log(`
61
- Recipe ready in project ${c.id}.`),f&&console.log(`Output: ${f.outputPath}`)}),g}import{readFile as Fa,writeFile as AG,rename as LG,unlink as DG}from"fs/promises";import{randomUUID as FG}from"crypto";import{resolve as ja}from"path";var Tn=["Inter","Space Mono","Montserrat","Roboto","Poppins","Oswald","Playfair Display","Bebas Neue","Instrument Serif","National Park","Bricolage Grotesque","Schibsted Grotesk"],Rn=["Georgia"],vn=Object.freeze({Inter:{slug:"inter",faces:[{weight:"100 900",file:"400"}],captionDefaults:{base:600,emphasis:800}},Montserrat:{slug:"montserrat",faces:[{weight:"100 900",file:"400"}],captionDefaults:{base:600,emphasis:800}},Roboto:{slug:"roboto",faces:[{weight:"100 900",file:"400"}],captionDefaults:{base:600,emphasis:800}},Oswald:{slug:"oswald",faces:[{weight:"400 700",file:"400"}],captionDefaults:{base:600,emphasis:700}},"Playfair Display":{slug:"playfair-display",faces:[{weight:"400 900",file:"400"}],captionDefaults:{base:600,emphasis:800}},"Bricolage Grotesque":{slug:"bricolage-grotesque",faces:[{weight:"200 800",file:"400"}],captionDefaults:{base:600,emphasis:800}},"Schibsted Grotesk":{slug:"schibsted-grotesk",faces:[{weight:"400 900",file:"400"}],captionDefaults:{base:600,emphasis:800}},"Space Mono":{slug:"space-mono",faces:[{weight:"400",file:"400"},{weight:"700",file:"700"}],captionDefaults:{base:400,emphasis:700}},Poppins:{slug:"poppins",faces:[{weight:"400",file:"400"},{weight:"700",file:"700"}],captionDefaults:{base:400,emphasis:700}},"Bebas Neue":{slug:"bebas-neue",faces:[{weight:"400",file:"400"}],captionDefaults:{base:400,emphasis:400}},"Instrument Serif":{slug:"instrument-serif",faces:[{weight:"400",file:"400"}],captionDefaults:{base:400,emphasis:400}},"National Park":{slug:"national-park",faces:[{weight:"400",file:"400"}],captionDefaults:{base:400,emphasis:400}},Georgia:{slug:"gelasio",faces:[{weight:"400",file:"400"},{weight:"700",file:"700"}],captionDefaults:{base:400,emphasis:700}}}),Lo="normal";function Jt(n){return vn[n]}function vp(n,t){let e=n.weight.split(/\s+/).map(Number);if(e.some(c=>!Number.isFinite(c)))return!1;if(e.length===1)return e[0]===t;let[o,r]=e;return t>=o&&t<=r}function Pn(n,t,e){if(e!==Lo)return!1;let o=Jt(n);return o?o.faces.some(r=>vp(r,t)):!1}function In(n){let t=Jt(n);return t?t.faces.map(e=>e.weight.split(/\s+/).join("-")).join(", "):""}function On(n){return n.split(",").map(t=>t.trim().replace(/^['"]|['"]$/g,"").trim()).filter(Boolean)}var Pp=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);var Ip=new Map(Object.keys(vn).map(n=>[n.toLowerCase(),n]));function kn(n){if(typeof n!="string"||n.trim().length===0)return{kind:"default"};if(n.includes("$brand:")||n.includes("${"))return{kind:"unknown"};let t;for(let e of On(n)){let o=e.toLowerCase();if(Pp.has(o))continue;let r=Ip.get(o);if(!r)return{kind:"unknown"};t??=r}return t?{kind:"bundled",family:t}:{kind:"default"}}var Xt=Object.freeze({fontFamily:"Inter, 'Helvetica Neue', Helvetica, Arial, sans-serif",fontWeight:600,emphasisFontWeight:800,emphasisFontStyle:"normal"}),Op="Inter";function En(n){return typeof n!="string"||n.trim().length===0?{kind:"bundled",family:Op}:kn(n)}function An(n){return(n.kind==="bundled"?Jt(n.family):void 0)?.captionDefaults??{base:Xt.fontWeight,emphasis:Xt.emphasisFontWeight}}function kp(n){let t=n.fontFamily??Xt.fontFamily,e=En(n.fontFamily),o=n.fontWeight??An(e).base,r=n.emphasisFontFamily,c=r??t,d=r===void 0?e:En(r),l=n.emphasisFontWeight??An(d).emphasis,m=n.emphasisFontStyle??Xt.emphasisFontStyle;return{base:{role:"base",field:"fontWeight",stack:t,resolved:e,weight:o,style:Lo,fromDefault:n.fontWeight===void 0},emphasis:{role:"emphasis",field:m==="italic"?"emphasisFontStyle":"emphasisFontWeight",stack:c,resolved:d,weight:l,style:m,fromDefault:m==="italic"?n.emphasisFontStyle===void 0:n.emphasisFontWeight===void 0}}}function Ep(n){let{base:t,emphasis:e}=kp(n);return e.stack===t.stack&&e.weight===t.weight&&e.style===t.style?[t]:[t,e]}var TJ=Object.freeze(["fontWeight","emphasisFontWeight","emphasisFontStyle"]);function Do(n){return n.fromDefault?`no ${n.field} is authored, so the ${n.role} run is drawn at the default ${n.style==="italic"?`${n.field} "italic"`:n.weight}`:`${n.field} ${n.style==="italic"?'"italic"':n.weight} has no file behind it`}function Ap(n){if(n.resolved.kind==="default"&&n.style==="italic")return{field:n.field,face:{family:n.stack,weight:n.weight,style:n.style},message:`font_not_reproducible \u2014 ${Do(n)}: "${n.stack}" names no font file the render bundle carries, and it ships no italic binary at all, so the browser would slant whatever upright face it matched and the render refuses it before capture. Emphasise with emphasisFontWeight, emphasisColor or emphasisScale, or name an uploaded brand font that is sealed in italic.`};if(n.resolved.kind!=="bundled")return null;let t={family:n.resolved.family,weight:n.weight,style:n.style};return n.style==="italic"?{field:n.field,face:t,message:`font_not_reproducible \u2014 ${Do(n)}: ${n.resolved.family} ships no italic binary, so the browser would slant the upright face and the render refuses it before capture. Emphasise with emphasisFontWeight, emphasisColor or emphasisScale, or name an uploaded brand font that is sealed in italic.`}:Pn(n.resolved.family,n.weight,n.style)?null:{field:n.field,face:t,message:`font_not_reproducible \u2014 ${Do(n)}: ${n.resolved.family} ships ${In(n.resolved.family)}. The render refuses a weight outside that range before capture rather than let the browser substitute a nearby file, so set ${n.field} to a weight the family covers, or pick a family whose files do.`}}function Fo(n){let t=[];for(let e of Ep(n)){let o=Ap(e);o&&t.push(o)}return t}var RJ=Object.freeze(["fontFamily","fontWeight","emphasisFontFamily","emphasisFontWeight","emphasisFontStyle"]);function Lp(n){return n.caption?{ref:n.caption,slot:"caption"}:n.body?{ref:n.body,slot:"body"}:{ref:n.heading,slot:"heading"}}function Dp(n){let t=n.captionProfile?.fontFamily;if(t!==void 0)return{family:t,path:"captionProfile.fontFamily"};let{ref:e,slot:o}=Lp(n.fonts);return{family:e?.family,path:`fonts.${o}`}}function Ln(n){let t=Dp(n),e=n.captionProfile??{},o={...e,...t.family!==void 0?{fontFamily:t.family}:{fontFamily:void 0}};return Fo(o).map(r=>({...r,path:e[r.field]!==void 0?`captionProfile.${r.field}`:t.path}))}var vJ=Object.freeze([400,500,600,700,800,900]);var OJ=new Set([...Tn,...Rn].map(n=>n.toLowerCase()));var ne=p.string();var Dn=p.discriminatedUnion("mode",[p.object({mode:p.literal("frame-center")}),p.object({mode:p.literal("point"),x:p.number().min(0).max(1),y:p.number().min(0).max(1)}),p.object({mode:p.literal("face"),faceId:p.string().min(1),shotScale:p.enum(["close","standard","wide"]).optional()}),p.object({mode:p.literal("all-faces")}),p.object({mode:p.literal("active-speaker")})]),Fn=p.object({startSec:p.number().nonnegative().describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:p.number().positive().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:Dn.describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:p.string().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:p.number().min(.1).max(1).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale`: a face-tracked shot is sized EITHER by the editorial scale (shotScale, calibrated to the detected face) OR by an explicit zoom \u2014 never both."),ease:p.object({in:p.number().nonnegative().describe("Ease-IN ramp DURATION in seconds at the segment START."),out:p.number().nonnegative().describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:p.object({x:p.number().min(-.3).max(.3).describe("Horizontal nudge, source-normalized (+ = right)."),y:p.number().min(-.3).max(.3).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")}),jn=Fn.refine(n=>!(n.focus.mode==="face"&&n.focus.shotScale!==void 0&&n.zoom!==void 0),{message:"a face segment takes EITHER focus.shotScale (editorial scale, calibrated to the detected face) OR an explicit zoom \u2014 never both; shotScale wins at bake time and the zoom would be silently discarded",path:["zoom"]}),jo=p.object({segments:p.array(jn).min(1)});var Vo=p.object({aspectRatio:p.enum(["16:9","9:16","1:1","4:5"]),fps:p.union([p.literal(24),p.literal(25),p.literal(30),p.literal(60)]).optional(),resolution:p.enum(["hd","fhd","4k"]).optional(),platform:p.string().optional()}),qn=p.object({start:p.number().nonnegative(),end:p.number().nonnegative()}),Fp=p.object({start:p.number().nonnegative(),end:p.number().nonnegative(),reason:p.string().optional()}),jp=p.object({kind:p.literal("media"),mediaId:ne,trim:qn.optional(),excludedRanges:p.array(Fp).optional(),volume:p.number().min(0).max(4).optional(),muted:p.boolean().optional(),playbackRate:p.number().positive().optional(),sync:p.enum(["video","independent"]).optional(),kenBurns:p.enum(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:p.number().optional(),fadeInMs:p.number().nonnegative().optional(),fadeOutMs:p.number().nonnegative().optional(),loop:p.boolean().optional(),audioRole:p.enum(["sfx","music","vo","ambience"]).optional(),duck:p.object({duckDb:p.number().max(0),attackMs:p.number().nonnegative(),releaseMs:p.number().nonnegative(),windows:p.array(p.object({startMs:p.number(),endMs:p.number()})).optional()}).optional(),anchor:p.object({clipId:p.string().min(1),offsetMs:p.number()}).optional(),reframe:jo.optional()}),Vp=p.object({kind:p.literal("component"),componentId:p.string().min(1),props:p.record(p.string(),p.unknown()),assets:p.record(p.string().min(1),p.string().min(1)).optional(),zPlane:p.enum(["front","behind-subject"]).optional()}),Np=p.object({kind:p.literal("overlay"),primitiveId:p.string().min(1),params:p.record(p.string(),p.unknown()),zPlane:p.enum(["front","behind-subject"]).optional(),anchor:p.object({space:p.literal("scene"),x:p.number().min(0).max(1),y:p.number().min(0).max(1)}).optional(),parallax:p.number().min(-.3).max(.3).optional()}),$p=p.object({kind:p.literal("effect"),primitiveId:p.string().min(1),params:p.record(p.string(),p.unknown()).optional()}),Bp=p.object({kind:p.literal("alpha-layer"),componentId:p.string().min(1),props:p.record(p.string(),p.unknown()),assets:p.record(p.string().min(1),p.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:p.enum(["front","behind-subject"]).optional()}),_p=p.object({kind:p.literal("card"),html:p.string().min(1),tokens:p.record(p.string(),p.string()).optional(),zPlane:p.literal("front").optional()}),qp=p.object({kind:p.literal("composition"),compositionId:p.string().min(1),trim:qn.optional()}).strict(),Up=p.discriminatedUnion("kind",[jp,Vp,Np,$p,Bp,_p,qp]),Wp=p.object({type:p.string().min(1),duration:p.number().positive()}),Un=-1,Wn=2,Vn=n=>`position.${n} is a FRACTION of the frame (0.5 = centre, 0 to 1 inside it, ${Un} to ${Wn} with entrance/exit overshoot) \u2014 px values are not accepted`,Zt=n=>p.number().min(Un,Vn(n)).max(Wn,Vn(n)),Gp=p.object({x:Zt("x"),y:Zt("y")}).describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),No=p.object({x:p.number().min(0).max(1),y:p.number().min(0).max(1),w:p.number().positive().max(1),h:p.number().positive().max(1)}),Hp=p.enum(["cover","contain"]),Kp=p.object({primitiveId:p.string().min(1),params:p.record(p.string(),p.unknown()).optional()}),Jp=p.union([p.enum(["linear","ease","easeIn","easeOut","easeInOut"]),p.object({cubicBezier:p.tuple([p.number(),p.number(),p.number(),p.number()])}).strict()]),Xp=p.object({time:p.number().nonnegative(),value:p.number(),easing:Jp.optional()}).strict(),Zp=p.array(Xp).min(2),Nn=["opacity","scale","rotation","position.x","position.y","volume"],Yp={opacity:p.number().min(0,"opacity is 0 to 1").max(1,"opacity is 0 to 1"),scale:p.number().positive("scale is a multiplier and must be > 0"),rotation:p.number(),"position.x":Zt("x"),"position.y":Zt("y"),volume:p.number().min(0,"volume is 0 to 4").max(4,"volume is 0 to 4")},Qp=p.object({id:p.string().min(1),startTime:p.number().nonnegative(),duration:p.number().positive(),source:Up,kind:p.enum(["video","audio","image","overlay","effect"]).optional(),opacity:p.number().min(0).max(1).optional(),scale:p.number().positive().optional(),rotation:p.number().optional(),position:Gp.optional(),region:No.optional(),fit:Hp.optional(),effects:p.array(Kp).optional(),transitionIn:Wp.optional(),linkGroupId:p.string().min(1).optional(),animate:p.record(p.string(),Zp).superRefine((n,t)=>{for(let[e,o]of Object.entries(n)){if(!Nn.includes(e)){t.addIssue({code:p.ZodIssueCode.custom,path:[e],message:`"${e}" is not an animatable param (${Nn.join(", ")})`});continue}let r=Yp[e];o.forEach((c,d)=>{let l=r.safeParse(c.value);l.success||t.addIssue({code:p.ZodIssueCode.custom,path:[e,d,"value"],message:l.error.issues[0]?.message??`invalid ${e} keyframe value`})})}}).describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.").optional()}).strict(),ed=p.object({id:p.string().min(1),startTime:p.number().nonnegative(),duration:p.number().positive()}).strict(),td=p.unknown().transform((n,t)=>{let o=(!!n&&typeof n=="object"&&"source"in n?Qp:ed).safeParse(n);return o.success?o.data:(t.issues.push(...o.error.issues),p.NEVER)}),od=p.object({id:p.string().min(1),kind:p.enum(["video","audio","image","overlay","effect"]),name:p.string().optional(),enabled:p.boolean().optional(),volume:p.number().min(0).max(4).optional(),contents:p.array(td)}).strict(),rd=p.object({id:p.string().min(1),startTime:p.number().nonnegative(),endTime:p.number().nonnegative().optional(),kind:p.string().min(1),name:p.string().optional(),metadata:p.record(p.string(),p.unknown()).optional()}).strict(),sd=p.object({public:p.boolean().optional(),readerOrgIds:p.array(p.string()).optional(),writerOrgIds:p.array(p.string()).optional()}),nd=p.object({type:p.string().min(1),source:p.string().optional(),notes:p.string().optional()}),id=p.object({audioDescriptionTrackId:p.string().optional(),captionsTrackId:p.string().optional(),signLanguageTrackId:p.string().optional(),notes:p.string().optional()}),ad=p.object({text:p.string().min(1),startMs:p.number().nonnegative().describe("Word start on the composition timeline, in milliseconds."),endMs:p.number().nonnegative().describe("Word end on the composition timeline, in milliseconds."),emphasis:p.boolean().optional(),annotate:p.enum(["circle","underline"]).optional()}),$n=p.object({fontFamily:p.string().min(1).optional(),fontSize:p.number().min(1,"captions style.fontSize is PERCENT of composition height (1-15, default 5) \u2014 px values are not accepted").max(15,"captions style.fontSize is PERCENT of composition height (1-15, default 5) \u2014 px values are not accepted").optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),fontWeight:p.number().int().min(100).max(900).optional(),color:p.string().min(1).optional(),highlightColor:p.string().min(1).optional(),backgroundColor:p.string().optional(),plate:p.enum(["glass","solid","none"]).optional(),position:p.enum(["top","center","bottom"]).optional(),textTransform:p.enum(["none","uppercase","capitalize"]).optional(),emphasisColor:p.string().optional(),emphasisGradient:p.string().optional(),emphasisScale:p.number().positive().optional(),emphasisFontFamily:p.string().optional(),emphasisFontWeight:p.number().int().min(100).max(900).optional(),emphasisTextTransform:p.enum(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:p.number().optional(),emphasisFontStyle:p.enum(["normal","italic"]).optional(),entrance:p.enum(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:p.number().nonnegative().optional(),entranceStaggerMs:p.number().nonnegative().optional(),exitMs:p.number().nonnegative().optional(),emphasisPlate:p.boolean().optional(),emphasisPlateColor:p.string().optional(),emphasisPlateTextColor:p.string().optional(),emphasisPlateAltColor:p.string().optional(),emphasisPlateAltTextColor:p.string().optional(),emphasisPlateRadius:p.number().nonnegative().optional(),emphasisPlatePadX:p.number().optional(),emphasisPlatePadY:p.number().optional(),annotationColor:p.string().optional(),maxWidthPercent:p.number().positive().max(100,"captions style.maxWidthPercent is % of composition width (max 100)").optional()}),Bn=p.object({words:p.array(ad)}),_n=p.enum(["front","behind-subject"]).optional(),cd=p.discriminatedUnion("source",[p.object({source:p.literal("derived"),from:p.object({clipId:p.string()}),segments:p.array(Bn),style:$n.optional(),zPlane:_n}),p.object({source:p.literal("authored"),segments:p.array(Bn),style:$n.optional(),zPlane:_n})]).superRefine((n,t)=>{if(n.style)for(let e of Fo(n.style))t.addIssue({code:"custom",path:["style",e.field],message:e.message})});var dt=p.object({v:p.literal(1,{error:n=>n.input===void 0?'Missing version envelope: add top-level "v": 1 to the composition.':`Invalid version envelope: top-level "v" must be the literal 1 (got ${JSON.stringify(n.input)}).`}),format:Vo,tracks:p.array(od),markers:p.array(rd).optional(),captions:cd.optional(),sourceSuggestionId:p.string().optional(),license:nd.optional(),licenseVerification:p.enum(["attested","cueframe-verified","third-party-verified"]).optional(),accessibility:id.optional(),ownerOrgId:p.string().optional(),acl:sd.optional()}).strict(),pd=p.enum(["user","agent","import"]),KJ=p.object({id:p.string().min(1),compositionId:ne,predecessorId:p.string().optional(),createdAt:p.number(),etag:p.string().min(1),authorKind:pd,authorId:p.string().optional(),composition:dt});var dd="gp-1",Yt=p.literal(dd),Gn=No,lt=p.enum(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]),$o=p.object({headline:p.string().max(120).optional(),sub:p.string().max(200).optional(),value:p.string().max(40).optional(),label:p.string().max(80).optional(),items:p.array(p.string().max(80)).max(8).optional(),series:p.array(p.object({label:p.string().max(40),value:p.string().max(16)})).max(8).optional()}).strict(),ld=p.object({id:p.string().min(1),atSec:p.number().min(0),durSec:p.number().positive(),role:lt,copy:$o,intent:p.string().min(1).max(400),priority:p.number().int().min(0).max(10).default(5)}).strict(),ud=p.object({version:Yt,beats:p.array(ld)}).strict(),md=p.enum(["headline","value","label","sublabel","logo","accent-shape","backdrop"]),hd=p.enum(["heading","body","accent","surface","on-accent","on-surface"]),fd=p.enum(["front","behind-subject"]),xd=p.object({elId:p.string().min(1),role:md,box:Gn,styleRole:hd,z:fd.default("front"),text:p.string().max(200).optional(),typeScaleStep:p.number().int().min(0).max(8).optional()}).strict(),He=1e-6,gd=(n,t)=>n.x<t.x+t.w-He&&n.x+n.w>t.x+He&&n.y<t.y+t.h-He&&n.y+n.h>t.y+He,yd=p.object({version:Yt,beatId:p.string().min(1),frame:p.object({w:p.number().positive(),h:p.number().positive()}).strict(),keepOut:p.array(Gn),safe:p.object({titleSafe:p.number().min(0).max(1),actionSafe:p.number().min(0).max(1)}).strict(),elements:p.array(xd),dropped:p.object({reason:p.string().min(1)}).strict().optional()}).strict().superRefine((n,t)=>{for(let e of n.elements){if(e.z==="behind-subject")continue;let o=e.box;(o.x+o.w>1+He||o.y+o.h>1+He)&&t.addIssue({code:p.ZodIssueCode.custom,message:`element ${e.elId} box spills past the frame`,path:["elements"]});for(let r of n.keepOut)gd(o,r)&&t.addIssue({code:p.ZodIssueCode.custom,message:`element ${e.elId} overlaps a face keep-out (text on the speaker)`,path:["elements"]})}}),bd=p.enum(["reveal","fade","rise","count-up","wipe"]),Sd=p.enum(["pulse","underline","color-shift"]),zd=p.enum(["fade","fall","wipe","cut"]),wd=p.enum(["spring","ease-out","ease-in-out","linear"]),Cd=p.object({type:bd,atMs:p.number().min(0),durMs:p.number().positive(),ease:wd.default("spring"),stagger:p.number().min(0).optional()}).strict(),Md=p.object({type:Sd,atMs:p.number().min(0),durMs:p.number().positive()}).strict(),Td=p.object({type:zd,atMs:p.number().min(0),durMs:p.number().positive()}).strict(),Rd=p.object({elId:p.string().min(1),enter:Cd,emphasis:Md.optional(),exit:Td.optional()}).strict(),vd=p.object({version:Yt,beatId:p.string().min(1),elements:p.array(Rd)}).strict(),eX=p.object({version:Yt,content:ud,layouts:p.array(yd),motions:p.array(vd)}).strict();var Pd=p.discriminatedUnion("kind",[p.object({kind:p.literal("face"),faceId:p.string().min(1)}),p.object({kind:p.literal("all-faces")}),p.object({kind:p.literal("frame-center")}),p.object({kind:p.literal("active-speaker")}),p.object({kind:p.literal("point"),x:p.number().min(0).max(1),y:p.number().min(0).max(1)})]),Id=p.object({startSec:p.number().nonnegative(),endSec:p.number().positive(),action:p.enum(["frame","keep","trim"]).describe("'frame' = SHOW this span cropped/tracked per `subject`. 'keep' = SHOW this span as-is, no reframe (footage with nothing to track). 'trim' = DELETE this span from the output entirely \u2014 trimmed footage never appears."),subject:Pd.optional(),shotScale:p.enum(["close","standard","wide"]).optional(),zoomScale:p.number().min(.4).max(1).optional(),verticalBias:p.number().min(-.3).max(.3).optional(),lateralBias:p.number().min(-.3).max(.3).optional(),intent:p.string().optional()}).refine(n=>n.action!=="frame"||n.subject!==void 0,{message:"frame segment requires a subject \u2014 for footage with no trackable subject use action:'keep' (shown as-is); do NOT trim spans you want shown"}).refine(n=>n.action!=="keep"||n.subject===void 0,{message:"keep segment shows footage as-is \u2014 it takes no subject (use action:'frame' to track one)"}).refine(n=>n.shotScale===void 0||n.zoomScale===void 0,{message:"framing segment takes EITHER shotScale (editorial scale \u2014 the bake calibrates the zoom to the detected face) OR zoomScale (an explicit fraction of the frame), never both: shotScale wins and the zoomScale would be silently discarded",path:["zoomScale"]}),Od=p.object({startSec:p.number().nonnegative(),endSec:p.number().positive(),reason:p.string().min(1)}),kd=p.object({id:p.string().min(1),atSec:p.number().nonnegative(),durSec:p.number().positive(),kind:p.enum(["broll","audio","sfx","music","ambience","gif","image"]),source:p.enum(["find","generate"]),intent:p.string().min(1),resolvedMediaId:p.string().optional()}),Ed=p.object({id:p.string().min(1),atSec:p.number().nonnegative(),durSec:p.number().positive(),role:lt,copy:$o,intent:p.string().min(1)}),Ad=p.object({startSec:p.number().nonnegative(),endSec:p.number().nonnegative().optional(),kind:p.string().min(1),name:p.string().optional()}),sX=p.object({framing:p.array(Id).min(1),cuts:p.array(Od).optional(),captions:p.object({styleIntent:p.string().optional()}).optional(),assets:p.array(kd).optional(),graphics:p.array(Ed).optional(),markers:p.array(Ad).optional()});var Ld=p.union([p.enum(["linear","ease","ease-in","ease-out","ease-in-out"]),p.object({kind:p.literal("cubic-bezier"),x1:p.number().min(0).max(1),y1:p.number(),x2:p.number().min(0).max(1),y2:p.number()})]),Me=p.string().min(1),Bo=p.union([p.object({kind:p.literal("system"),family:p.string().min(1),weight:p.number().int().min(1).max(1e3).optional(),style:p.enum(["normal","italic"]).optional()}),p.object({kind:p.literal("web"),family:p.string().min(1),url:p.string().url().optional(),weight:p.number().int().min(1).max(1e3).optional(),style:p.enum(["normal","italic"]).optional()}),p.object({kind:p.literal("uploaded"),fontId:ne,family:p.string().optional(),weight:p.number().int().min(1).max(1e3).optional(),style:p.enum(["normal","italic"]).optional()})]),Dd=p.object({primary:p.string().min(1),secondary:p.string().optional(),accent:p.string().min(1),background:p.string().min(1),text:p.string().min(1),textMuted:p.string().optional(),border:p.string().optional(),surface:p.string().optional(),card:p.string().optional(),gridLine:p.string().optional(),accentMuted:p.string().optional(),textOnAccent:p.string().optional(),textOnSurface:p.string().optional()}),Fd=p.object({heading:Bo,body:Bo.optional(),caption:Bo.optional()}),jd=p.object({base:p.number().positive().optional(),lg:p.number().positive().optional(),sm:p.number().positive().optional()}),Vd=p.object({fontSizeHeading:p.number().positive().optional(),fontSizeBody:p.number().positive().optional(),fontSizeLabel:p.number().positive().optional(),borderRadius:p.number().nonnegative().optional()}),Nd=p.object({duration:p.number().positive().optional(),easing:Ld.optional(),entrance:p.enum(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:p.number().nonnegative().optional(),exitMs:p.number().nonnegative().optional()}),Kn=p.enum(["tl","tr","bl","br"]),$d=p.object({src:p.string().min(1),alt:p.string().optional(),placement:Kn.optional(),sizePct:p.number().positive().optional()}),Hn=p.object({kind:p.enum(["card","video"]),src:p.string().min(1).optional(),title:p.string().optional(),subtitle:p.string().optional(),durationMs:p.number().positive().optional()}),Bd=p.object({src:p.string().min(1),opacity:p.number().min(0).max(1).optional(),placement:Kn.optional()}),_d=p.discriminatedUnion("kind",[p.object({kind:p.literal("card"),html:p.string().min(1),tokens:p.record(p.string(),p.string()).optional()}),p.object({kind:p.literal("overlay"),primitiveId:p.string().min(1),params:p.record(p.string(),p.unknown()).optional()}),p.object({kind:p.literal("component"),componentId:p.string().min(1),props:p.record(p.string(),p.unknown()).optional()})]),qd=p.enum(["fade-up","slide-in-left","slide-in-right","scale-pop","stagger-reveal"]),Ud=p.object({id:p.string().min(1).max(40),observed:p.string().min(1).max(500),body:_d,motion:p.object({preset:qd,enterMs:p.number().int().min(0).max(5e3).optional(),exitMs:p.number().int().min(0).max(5e3).optional(),staggerMs:p.number().int().min(0).max(2e3).optional(),confidence:p.enum(["high","low"]).optional()}).optional(),role:lt,zone:p.object({x:p.number(),y:p.number(),w:p.number(),h:p.number()}).optional(),evidence:p.array(p.number().int().min(0)).max(24).optional(),diffScore:p.number().min(0).max(1).optional(),coverage:p.enum(["reproduced","approximated","skipped"]),skipReason:p.string().max(300).optional()}),Wd=p.object({public:p.boolean().optional(),readerOrgIds:p.array(p.string()).optional(),writerOrgIds:p.array(p.string()).optional()}),Gd=p.object({type:p.string().min(1),source:p.string().optional(),notes:p.string().optional()}),Jn=p.object({id:p.string().min(1),name:p.string().min(1),colors:Dd,fonts:Fd,spacing:jd.optional(),sizing:Vd.optional(),motion:Nd.optional(),captionProfile:p.object({color:p.string().optional(),highlightColor:p.string().optional(),emphasisColor:p.string().optional(),plate:p.enum(["glass","solid","none"]).optional(),entrance:p.enum(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:p.number().optional(),entranceStaggerMs:p.number().optional(),exitMs:p.number().optional(),fontFamily:p.string().optional(),fontWeight:p.number().int().min(100).max(900).multipleOf(100).optional(),emphasisFontFamily:p.string().optional(),emphasisScale:p.number().positive().optional(),emphasisFontWeight:p.number().int().min(100).max(900).optional(),emphasisFontStyle:p.enum(["normal","italic"]).optional(),emphasisTextTransform:p.enum(["none","uppercase"]).optional(),emphasisLetterSpacing:p.number().optional(),emphasisPlate:p.boolean().optional(),emphasisPlateColor:p.string().optional(),emphasisPlateTextColor:p.string().optional()}).optional(),exemplarKeys:p.array(p.string().min(1)).max(24).optional(),contactSheetKey:p.string().min(1).optional(),motifs:p.array(Ud).max(24).optional(),styleRubric:p.string().max(4e3).optional(),density:p.object({graphicsPerMin:p.number().min(0).max(60),maxSimultaneous:p.number().int().min(1).max(6)}).optional(),inspiration:p.object({sources:p.array(p.string()).min(1).max(24),extractedAt:p.number(),extractionVersion:p.string().min(1).max(60)}).optional(),logo:$d.optional(),intro:Hn.optional(),outro:Hn.optional(),watermark:Bd.optional(),audio:p.object({sfxIntensity:p.enum(["off","light","standard","dense"]).optional(),musicEnabled:p.boolean().optional(),musicMood:p.string().max(300).optional(),sonicLogo:p.object({ref:Me,placement:p.enum(["intro","outro","both"]),offsetMs:p.number().int().min(0).max(1e4).optional()}).optional(),uiSoundSet:p.object({tick:Me.optional(),pop:Me.optional(),impact:Me.optional(),confirm:Me.optional(),error:Me.optional(),whoosh:Me.optional(),riser:Me.optional()}).optional(),bedStyle:p.object({bedId:Me.optional(),genre:p.string().max(120).optional(),bpmRange:p.object({min:p.number(),max:p.number()}).optional()}).optional(),ambiencePreference:p.object({ref:Me}).nullable().optional()}).optional(),license:Gd.optional(),licenseVerification:p.enum(["attested","cueframe-verified","third-party-verified"]).optional(),ownerOrgId:p.string().optional(),acl:Wd.optional()}).superRefine((n,t)=>{for(let e of Ln(n))t.addIssue({code:"custom",path:e.path.split("."),message:e.message})});var Hd=p.enum(["pending","uploading","analyzing","subsetting","ready","partial","failed"]),Kd=p.object({weight:p.number().int().min(100).max(900),style:p.enum(["normal","italic"]),storageKey:p.string().min(1),byteSize:p.number().int().nonnegative().optional(),subsetComplete:p.boolean().optional()}),uX=p.object({id:p.string().min(1),family:p.string().min(1),status:Hd,variants:p.array(Kd).nonempty(),source:p.enum(["uploaded","system","web"]).optional(),license:p.object({type:p.string().min(1),source:p.string().optional(),notes:p.string().optional()}).optional(),createdAt:p.number().optional(),ownerOrgId:p.string().optional()});var Jd=p.enum(["interactive","standard","background"]),Xd=p.enum(["preview","final"]),Zd=p.enum(["offline","live"]),Yd=p.enum(["user","agent","cost_limit","superseded","source_removed","timeout","error"]),Xn=p.enum(["pending","rendering","complete","error","cancelled"]),Qd=p.object({phase:p.string().min(1),percent:p.number().min(0).max(100),scenesTotal:p.number().int().positive().optional()}),el=p.object({package:p.string().min(1),name:p.string().min(1),version:p.string().min(1)}),tl=p.object({mediaId:ne,presignedUrl:p.string().url(),expiresAt:p.number().optional()}),ol=p.object({composition:dt,brandKit:Jn.optional(),mediaSources:p.array(tl),registryPins:p.array(el),capturedAt:p.number()}),rl=p.object({kind:p.literal("r2"),path:p.string().optional()}),sl=p.object({kind:p.literal("s3"),credentialId:p.string().min(1),bucket:p.string().min(1),key:p.string().min(1),region:p.string().optional(),acl:p.string().optional()}),nl=p.object({kind:p.literal("youtube"),credentialId:p.string().min(1),title:p.string().min(1),description:p.string().optional(),privacy:p.enum(["public","unlisted","private"]),tags:p.array(p.string()).optional()}),il=p.object({kind:p.literal("mux"),credentialId:p.string().min(1),passthrough:p.string().optional()}),al=p.object({kind:p.literal("webhook"),url:p.string().url(),signingKeyId:p.string().optional(),headers:p.record(p.string(),p.string()).optional()}),cl=p.discriminatedUnion("kind",[rl,sl,nl,il,al]),pl=p.enum(["pending","uploading","delivered","failed"]),dl=p.object({destinationIndex:p.number().int().nonnegative(),status:pl,url:p.string().url().optional(),deliveredAt:p.number().optional(),error:p.string().optional()}),yX=p.object({id:ne,projectId:ne.optional(),compositionId:ne,compositionVersionId:p.string().min(1),status:Xn,progress:Qd.optional(),mode:Zd.optional(),priority:Jd,intent:Xd.optional(),snapshot:ol.optional(),snapshotRef:p.string().optional(),outputUrl:p.string().url().optional(),outputExpiresAt:p.number().optional(),destinations:p.array(cl).optional(),destinationResults:p.array(dl).optional(),cancelReason:Yd.optional(),error:p.object({code:p.string(),message:p.string(),details:p.record(p.string(),p.unknown()).optional()}).optional(),createdAt:p.number(),updatedAt:p.number()}),bX=p.object({jobId:ne,status:Xn,percent:p.number().min(0).max(100).optional(),framesRendered:p.number().int().nonnegative().optional(),framesTotal:p.number().int().positive().optional()});var ll=p.enum(["first-party","community-verified","community-unverified","user-private","sandbox","deprecated"]),ul=p.enum(["2d","immersive","interactive"]),ml=p.object({path:p.string().min(1),fallback:p.unknown()}),hl=p.object({effectName:p.string().min(1),metadata:p.record(p.string(),p.unknown()).optional()}),fl=p.object({description:p.string().optional(),use_when:p.array(p.string()).optional(),avoid_when:p.array(p.string()).optional(),vibe:p.array(p.string()).optional(),formats:p.array(p.string()).optional(),pairs_well_with:p.array(p.string()).optional(),exemplars:p.array(p.string()).optional()}),wX=p.object({name:p.string().min(1),package:p.string().min(1),category:p.enum(["overlay","text","effect","transition","layout"]),version:p.string().min(1),origin:ll,modes:p.array(ul).optional(),paramsSchema:p.unknown(),varyingParams:p.array(p.string()).optional(),extends:p.string().optional(),tokens:p.array(ml).optional(),otio:hl.optional(),meta:fl.optional()});var vX=p.object({id:ne,name:p.string().min(1),defaultFormat:Vo.optional(),palConformDefault:p.union([p.literal(24),p.literal(30)]).optional(),activeCompositionId:ne.nullable().optional(),brandKitId:p.string().optional(),ownerOrgId:p.string().optional(),createdAt:p.number(),updatedAt:p.number()});var xl=p.enum(["main","wide","facecam","screen","audio"]),gl=p.object({mediaId:ne,role:xl,label:p.string().optional()}),yl=p.object({videoRole:p.enum(["main","wide","facecam","screen"]),audioRole:p.literal("audio")}),kX=p.object({id:ne,name:p.string().min(1),members:p.array(gl).nonempty(),mux:p.array(yl).optional(),ownerOrgId:p.string().optional(),createdAt:p.number(),updatedAt:p.number()});var DX=p.enum(["render.completed","media.transcribed","media.completed","composition.updated"]),bl=p.enum(["pending","delivering","delivered","failed","exhausted"]),FX=p.object({id:ne,url:p.string().url(),events:p.array(p.string().min(1)).nonempty(),signingKeyId:p.string().optional(),headers:p.record(p.string(),p.string()).optional(),enabled:p.boolean().optional(),ownerOrgId:p.string().optional(),createdAt:p.number(),updatedAt:p.number()}),jX=p.object({id:p.string().min(1),webhookId:ne,event:p.string().min(1),payload:p.record(p.string(),p.unknown()),status:bl,attemptCount:p.number().int().nonnegative(),responseStatus:p.number().int().optional(),responseBody:p.string().optional(),error:p.string().optional(),createdAt:p.number(),deliveredAt:p.number().optional()});function mt(n){return"source"in n}function ut(n){return n.startTime+n.duration}function Sl(n){let t=[],e=[...n.contents].sort((o,r)=>o.startTime-r.startTime);for(let o=1;o<e.length;o++){let r=e[o-1],c=e[o];c.startTime<ut(r)&&t.push({code:"track_clips_overlap",message:`Track ${n.id}: items ${r.id} and ${c.id} overlap at [${c.startTime}, ${Math.min(ut(r),ut(c))})`,details:{trackId:n.id,clipAId:r.id,clipBId:c.id,overlapRange:[c.startTime,Math.min(ut(r),ut(c))]}})}return t}function zl(n){let t=[];for(let e of n.contents){if(!mt(e))continue;wl(n.kind,e.source.kind)||t.push({code:"clip_source_track_kind_mismatch",message:`Track ${n.id} (kind=${n.kind}) cannot hold TimelineClip ${e.id} (source.kind=${e.source.kind})`,details:{trackId:n.id,clipId:e.id,sourceKind:e.source.kind,trackKind:n.kind}})}return t}function wl(n,t){switch(n){case"video":return t==="media"||t==="component"||t==="composition";case"audio":return t==="media"||t==="component";case"image":return t==="media"||t==="component";case"overlay":return t==="overlay"||t==="component"||t==="alpha-layer"||t==="card";case"effect":return t==="effect"}}function Cl(n){let t=[],e=[...n.contents].sort((o,r)=>o.startTime-r.startTime);for(let o=0;o<e.length;o++){let r=e[o];if(!mt(r)||!r.transitionIn)continue;let c=e[o-1];if(!c||!mt(c)){t.push({code:"transition_no_predecessor",message:`Track ${n.id}: TimelineClip ${r.id} has transitionIn but no TimelineClip predecessor`,details:{trackId:n.id,clipId:r.id}});continue}let d=r.transitionIn.duration,l=Math.min(c.duration,r.duration);d>l&&t.push({code:"transition_too_long",message:`Track ${n.id}: TimelineClip ${r.id} transitionIn.duration (${d}) exceeds available headroom (${l})`,details:{trackId:n.id,clipId:r.id,transitionDuration:d,available:l}})}return t}function Ml(n){let t=[];for(let e of n.contents){if(!mt(e)||e.source.kind!=="media")continue;let o=e.source.excludedRanges;if(!o||o.length===0)continue;let r=e.source.trim,c=r?.start??0,d=r?.end??c+e.duration,l=-1/0,m=0,f=!1;for(let C=0;C<o.length;C++){let T=o[C];if(T.end<=T.start){t.push({code:"excluded_range_invalid",message:`Track ${n.id}: TimelineClip ${e.id} excludedRanges[${C}] end (${T.end}) must be > start (${T.start})`,details:{trackId:n.id,clipId:e.id,index:C,start:T.start,end:T.end}}),f=!0;break}if(T.start<c||T.end>d){t.push({code:"excluded_range_out_of_bounds",message:`Track ${n.id}: TimelineClip ${e.id} excludedRanges[${C}] [${T.start}, ${T.end}] outside trim [${c}, ${d}]`,details:{trackId:n.id,clipId:e.id,index:C,start:T.start,end:T.end,trimStart:c,trimEnd:d}}),f=!0;break}if(T.start<l){t.push({code:"excluded_range_overlap",message:`Track ${n.id}: TimelineClip ${e.id} excludedRanges[${C}] overlaps preceding range (start ${T.start} < prevEnd ${l})`,details:{trackId:n.id,clipId:e.id,index:C,start:T.start,prevEnd:l}}),f=!0;break}l=T.end,m+=T.end-T.start}if(f)continue;let g=d-c,b=g-m;Math.abs(b-e.duration)>.001&&t.push({code:"excluded_range_duration_mismatch",message:`Track ${n.id}: TimelineClip ${e.id} duration (${e.duration}) \u2260 trimSpan (${g}) \u2212 \u03A3excluded (${m}) = ${b}`,details:{trackId:n.id,clipId:e.id,expected:b,actual:e.duration,trimSpan:g,totalExcluded:m}})}return t}function Tl(n){let t=[];for(let e of n.contents){if(!mt(e)||e.source.kind!=="media")continue;let o=e.source.trim;if(!o)continue;let r=e.source.playbackRate??1;if(!(r>0))continue;let c=e.source.excludedRanges;if(c&&c.length>0)continue;let d=o.end-o.start,l=d/r;Math.abs(l-e.duration)>.001&&t.push({code:"clip_duration_trim_mismatch",message:`Track ${n.id}: TimelineClip ${e.id} duration (${e.duration}) \u2260 trimSpan (${d}) \xF7 playbackRate (${r}) = ${l}`,details:{trackId:n.id,clipId:e.id,expected:l,actual:e.duration,trimSpan:d,playbackRate:r}})}return t}function Rl(n){return[...Sl(n),...zl(n),...Cl(n),...Ml(n),...Tl(n)]}function Zn(n){let t=[];for(let e of n.tracks)t.push(...Rl(e));return t}var ht=n=>n.endTime??n.startTime;function Yn(n){let t=(n.markers??[]).filter(o=>o.kind==="scene").sort((o,r)=>o.startTime-r.startTime),e=[];for(let o=1;o<t.length;o++){let r=t[o-1],c=t[o];c.startTime<ht(r)&&e.push({code:"scene_marker_overlap",message:`Scene markers ${r.id} and ${c.id} overlap at [${c.startTime}, ${Math.min(ht(r),ht(c))})`,details:{markerAId:r.id,markerBId:c.id,overlapRange:[c.startTime,Math.min(ht(r),ht(c))]}})}return e}function Qn(n){let t=new Map,e=[],o=(r,c)=>{let d=t.get(r);d?e.push({code:"composition_id_collision",message:`Id ${r} used by both ${d} and ${c}`,details:{id:r,existingKind:d,newKind:c}}):t.set(r,c)};for(let r of n.tracks){o(r.id,"track");for(let c of r.contents)o(c.id,"source"in c?"clip":"gap")}for(let r of n.markers??[])o(r.id,"marker");return e}function vl(n){let t=n.animate;if(!t)return[];let e=[];for(let[o,r]of Object.entries(t)){if(!r)continue;let c=[...r].sort((d,l)=>d.time-l.time);for(let d of c)d.time>n.duration+1e-6&&e.push({code:"varying_keyframe_time_out_of_range",message:`clip "${n.id}" animates "${o}" at ${d.time}s, past its own duration of ${n.duration}s \u2014 that keyframe can never be reached`,details:{clipId:n.id,param:o,time:d.time,duration:n.duration}});for(let d=1;d<c.length;d++)Math.abs(c[d].time-c[d-1].time)<1e-6&&e.push({code:"varying_keyframe_duplicate_time",message:`clip "${n.id}" has two "${o}" keyframes at ${c[d].time}s \u2014 the value at that instant is undefined`,details:{clipId:n.id,param:o,time:c[d].time}})}return e}function ei(n){let t=[];for(let e of n.tracks)for(let o of e.contents)"source"in o&&t.push(...vl(o));return t}function ti(n){return[...Qn(n),...Zn(n),...Yn(n),...ei(n)]}var oi=a({featureId:s().describe("Stable billing feature id."),name:s().describe("Human-readable feature name."),type:u(["metered","boolean","credit_system"]).describe("metered = a depleting/gauge quota (has balances); boolean = an on/off plan grant; credit_system = a spendable wallet the metered lines draw from."),unit:S([u(["cents","count","minutes","gb"]),N()]).describe("What `balance`/`includedUsage`/`usage` are COUNTED IN \u2014 do not assume. `exports` is output-MINUTES (not a number of renders), `compose`/`ai_tokens`/`compose_verify`/`generate` are CENTS of spend (not a number of calls), `compose_capture` is a count of stills, `storage` is GB, a credit system is cents (1 credit = $0.01). null = boolean feature, nothing to count."),included:v().nullable().describe("Does the CURRENT plan grant this feature? For a credit-funded feature (see `fundedBy`) this is true whenever the plan grants the funding wallet \u2014 spend is then bounded by `balance`, not by inclusion. false = not on this plan (a create gated on it 402s billing_required); null = unknown (billing not configured / no live data)."),unlimited:v().nullable().describe("Metered only: the plan grants an effectively-unlimited allowance. null = unknown / boolean feature."),balance:i().nullable().describe("Metered only: remaining balance for the current period, in THIS feature's unit. For a credit-funded feature it is the funding wallet's balance restated at `creditCost` credits per unit \u2014 a SHARE of a pool, not a private allowance. null = unknown / boolean feature."),includedUsage:i().nullable().describe("Metered only: the plan's included allowance (the period limit), in this feature's unit. null = unknown / boolean feature."),usage:i().nullable().describe("Metered only: amount consumed this period, in this feature's unit. null = unknown / boolean feature."),nextResetAt:i().nullable().describe("Metered only: epoch-ms when the period balance resets. null = unknown / no scheduled reset."),fundedBy:s().nullable().describe("The credit system that actually pays for this feature (always `credits` \u2014 there is one wallet). Non-null means the feature has NO separate allowance: its `balance` restates that shared wallet, and every other feature with the same `fundedBy` competes for the same money. null = the plan grants this feature directly."),creditCost:i().nullable().describe("Credits consumed per ONE unit of this feature (exports 50 = $0.50 per 1080p output-minute; compose_capture 2 = $0.02 per still). null = not credit-funded."),listUsdPerUnit:i().nullable().describe("LIST price in USD of ONE unit of this feature (see `unit`) \u2014 the quote to read BEFORE a call. Credit-funded: `creditCost`/100 (exports 0.5 per 1080p output-minute; compose_capture 0.02 per still; compose/ai_tokens/generate 0.015 per cent of provider cost). 0 = the plan grants this feature and it draws NO credits (resource_import: stock search AND import are free for a keyed caller, bytes count toward `storage`; brand_kits). null = not quotable up front (a wallet, a gauge, or a feature the plan does not grant).")}).describe("A single feature's entitlement: whether the plan includes it, remaining/limit when metered, and the per-unit list price to quote before a call");var Pl=a({generationLimit:S([a({applies:v(),unit:h("cents_of_provider_cost"),cap:i().nullable(),spent:i().nullable(),remaining:i().nullable()}),N()]).describe("Separate lifetime generation cap before a credit-pack purchase. Wallet balance is still shared; generation must also fit this remaining provider-cost allowance. null means unknown."),orgId:s().describe("The org this API key is bound to \u2014 resolved server-side from the Authorization credential, NEVER from the request body/query."),displayName:s().nullable().describe("Org/customer display name from the billing record; null when not set or unknown."),plan:S([a({id:s().describe("Plan/product id (e.g. free, pro, business, studio)."),name:s().nullable().describe("Plan display name.")}),N()]).describe("The customer's current base plan/tier. null = unknown (billing not configured, or no active plan resolvable yet)."),entitlements:M(s(),oi).describe("Per-feature entitlements keyed by featureId. Covers the billing-gated capabilities: `exports` gates create_render AND generate_media output; `compose` gates compose; `brand_kits` gates create_brand_kit; `resource_import` gates import_resource (a boolean grant: `listUsdPerUnit` 0 \u2014 stock search and import cost no credits for a keyed caller); plus ai_tokens/storage/compose_verify/compose_capture/etc. Read `listUsdPerUnit` for what one unit costs before you spend it. Most capabilities are CREDIT-FUNDED \u2014 `included` is true and the real limit is `balance`, drawn from the shared wallet named in `fundedBy` (`credits` \u2014 generation included; a free org is additionally bounded by a generation cap). So read `balance`, not `included`, to decide whether you can afford a call; `included:false` means the plan genuinely lacks the feature. Check BEFORE a metered call to avoid a mid-workflow 402 billing_required (whose error `details.featureId` names the gating feature)."),costCeilings:a({generateMediaUsdPerCall:i().nullable().describe("Per-call USD ceiling for generate_media: a generation whose ESTIMATE exceeds this 402s (generation_budget_exceeded) before any spend. Right-size the prompt/duration under this. null = unknown.")}).describe("Discoverable per-call cost ceilings so an agent can price/right-size a request before a guaranteed 402."),billingConfigured:v().describe("false = billing is not configured in this environment, so plan/entitlement values are best-effort and may be null (unknown), not authoritative."),surfaces:a({console:s().describe("Origin of the authenticated web console."),usage:s().describe("Browser URL for the usage ledger."),billing:s().describe("Browser URL for plan and credits."),apiKeys:s().describe("Browser URL for minting and revoking API keys."),project:N().describe("No per-project browser view exists yet, so there is no URL to hand a user for a project or its composition. Stated as an explicit null so a client does not construct a route that 404s (CUE-19). Show a rendered frame (preview_frame) or a completed render instead.")}).describe('The browser URLs that actually exist, so an agent asked to "show me" can hand the user a real link instead of guessing one from an id. A null means the surface is not built, not that it is hidden from this key.')}).describe("Account discovery for the authenticated key: identity + plan + entitlements + cost ceilings + the browser surfaces that exist. Read this to see what your plan/credits allow before a metered call (create_render / compose / generate_media / create_brand_kit).");var Il=0,Ol=9007199254740991,kl=a({name:s().min(1),permissions:M(s(),x(u(["read","write"])).min(1)).describe("Resource \u2192 actions grant. Resources: media, sessions, projects, renders, webhooks, billing. Actions: read, write. Least-privilege \u2014 grant only what's needed (billing:write is required to start a checkout)."),expiresIn:y().gt(Il).max(Ol).optional().describe("Lifetime in seconds; omit for no expiry.")});var El=a({key:s().describe("The full secret key (cf_test_\u2026 / cf_live_\u2026). Shown ONCE \u2014 store it now."),id:s(),prefix:s(),start:s().describe("First chars of the key, for later identification.")});var ri=a({ref:s().describe("Placement handle: a pack soundId/bedId, or an org media id."),role:u(["vo","music","sfx","ambience"]).describe("Declared role for mix policy."),envelopeClass:u(["transient","sweep","ambient"]).describe("Coarse envelope shape \u2014 the browse grouping."),description:s(),durationSec:i(),evidence:a({envelopeClass:u(["transient","sweep","ambient"]),attackMs:i().optional(),spectralCentroidHz:i().optional(),meanVolumeDb:i().optional(),maxVolumeDb:i().optional()}).describe("Envelope probe evidence (always carries envelopeClass)."),source:u(["pack","org","generated"]).describe("Provenance discriminant."),license:s().describe('"CC0" (pack), "org-owned"/a CC token (org), or "generated".'),provenance:s().describe("Human-legible provenance (pack attribution / org-owned / generator + prompt)."),bpm:i().optional().describe("Tempo \u2014 present for music-role entries."),mood:x(s()).optional().describe("Editorial mood tags \u2014 present for pack music beds.")});var si=a({id:s().describe("Billing catalog product id (e.g. pro, pro_yearly)."),tier:s().describe("Plan tier: pro | business | studio."),name:s(),interval:s().describe("month | year."),priceUsd:i().describe("Price in USD for the interval.")});var Al=a({plans:x(si).describe("Every purchasable {tier, interval} and its product id."),billingConfigured:v()});var Ll=200,Dl=200,Fl=2e3,jl=500,Vl=500,Nl=5e3,$l=0,Bl=1,_l=300,ql=0,Ul=1e4,Wl=120,Gl=24,Hl=40,Kl=500,Jl=0,Xl=5e3,Zl=0,Yl=5e3,Ql=0,eu=2e3,tu=0,ou=9007199254740991,ru=24,su=0,nu=1,iu=300,au=24,cu=4e3,pu=0,du=60,lu=6,uu=24,mu=60,ni=a({kitId:s().min(1).max(Ll),name:s().min(1).max(Dl),description:s().max(Fl).optional(),tagline:s().max(jl).optional(),secondaryTagline:s().max(Vl).optional(),colors:a({primary:s().min(1),secondary:s().min(1),accent:s().min(1),background:s().min(1),text:s().min(1)}),extraColors:x(a({hex:s().min(1),label:s().min(1),usage:s().optional()})).optional(),headingFont:a({fontFamily:s().min(1),fontWeight:i()}),bodyFont:a({fontFamily:s().min(1),fontWeight:i()}),voiceGuidelines:s().max(Nl).optional(),syncCaptions:v().optional(),captionProfile:a({fontFamily:s().optional(),fontSize:i().optional(),fontWeight:i().optional(),color:s().optional(),highlightColor:s().optional(),backgroundColor:s().optional(),plate:u(["glass","solid","none"]).optional(),position:u(["top","center","bottom"]).optional(),textTransform:u(["none","uppercase"]).optional(),entrance:u(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:i().optional(),entranceStaggerMs:i().optional(),exitMs:i().optional(),emphasisColor:s().optional(),emphasisScale:i().optional(),emphasisFontFamily:s().optional(),emphasisFontWeight:i().optional(),emphasisFontStyle:u(["normal","italic"]).optional(),emphasisTextTransform:u(["none","uppercase"]).optional(),emphasisLetterSpacing:i().optional(),emphasisPlate:v().optional(),emphasisPlateColor:s().optional(),emphasisPlateTextColor:s().optional()}).optional(),motion:a({duration:i().optional(),easing:S([u(["linear","ease","ease-in","ease-out","ease-in-out"]),a({kind:h("cubic-bezier"),x1:i(),y1:i(),x2:i(),y2:i()})]).optional(),entrance:u(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:i().optional(),exitMs:i().optional()}).optional(),logo:a({src:s().min(1),alt:s().optional(),placement:u(["tl","tr","bl","br"]).optional(),sizePct:i().optional()}).optional(),intro:a({kind:u(["card","video"]),src:s().min(1).optional(),title:s().optional(),subtitle:s().optional(),durationMs:i().optional()}).optional(),outro:a({kind:u(["card","video"]),src:s().min(1).optional(),title:s().optional(),subtitle:s().optional(),durationMs:i().optional()}).optional(),watermark:a({src:s().min(1),opacity:i().min($l).max(Bl).optional(),placement:u(["tl","tr","bl","br"]).optional()}).optional(),spacing:a({base:i().optional(),lg:i().optional(),sm:i().optional()}).optional(),sizing:a({fontSizeHeading:i().optional(),fontSizeBody:i().optional(),fontSizeLabel:i().optional(),borderRadius:i().optional()}).optional(),audio:a({sfxIntensity:u(["off","light","standard","dense"]).optional(),musicEnabled:v().optional(),musicMood:s().max(_l).optional(),sonicLogo:a({ref:s().min(1),placement:u(["intro","outro","both"]),offsetMs:y().min(ql).max(Ul).optional()}).optional().describe("A brand sound signature bound to the intro/outro bookend. `ref` = a palette reference; bound only when the kit carries the matching bumper (intro/outro), else a non-blocking advisory."),uiSoundSet:a({tick:s().min(1).optional(),pop:s().min(1).optional(),impact:s().min(1).optional(),confirm:s().min(1).optional(),error:s().min(1).optional(),whoosh:s().min(1).optional(),riser:s().min(1).optional()}).optional().describe("Per-family SFX overrides (the brand's own tick/pop/\u2026). Highest-priority tier over the org palette + pack default in the compose SFX draw."),bedStyle:a({bedId:s().min(1).optional(),genre:s().max(Wl).optional(),bpmRange:a({min:i(),max:i()}).optional()}).optional().describe("Preferred music bed (`bedId`) or a style hint (`genre` / `bpmRange`). Surfaced for driving agents; compose does not auto-select a pack bed."),ambiencePreference:S([a({ref:s().min(1)}),N()]).optional().describe("Preferred ambience bed (`{ref}`) or explicit null (opt-out). Surfaced for driving agents; compose has no ambience auto-placement.")}).optional(),exemplarKeys:x(s().min(1)).max(Gl).optional(),contactSheetKey:s().min(1).optional(),motifs:x(a({id:s().min(1).max(Hl),observed:s().min(1).max(Kl),body:S([a({kind:h("card"),html:s().min(1),tokens:M(s(),s()).optional()}),a({kind:h("overlay"),primitiveId:s().min(1),params:M(s(),R()).optional()}),a({kind:h("component"),componentId:s().min(1),props:M(s(),R()).optional()})]),motion:a({preset:u(["fade-up","slide-in-left","slide-in-right","scale-pop","stagger-reveal"]),enterMs:y().min(Jl).max(Xl).optional(),exitMs:y().min(Zl).max(Yl).optional(),staggerMs:y().min(Ql).max(eu).optional(),confidence:u(["high","low"]).optional()}).optional(),role:u(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]),zone:a({x:i(),y:i(),w:i(),h:i()}).optional(),evidence:x(y().min(tu).max(ou)).max(ru).optional(),diffScore:i().min(su).max(nu).optional(),coverage:u(["reproduced","approximated","skipped"]),skipReason:s().max(iu).optional()})).max(au).optional(),styleRubric:s().max(cu).optional(),density:a({graphicsPerMin:i().min(pu).max(du),maxSimultaneous:y().min(1).max(lu)}).optional(),inspiration:a({sources:x(s()).min(1).max(uu),extractedAt:i(),extractionVersion:s().min(1).max(mu)}).optional()}).describe("POST /brand-kits body. Org/user are server-resolved; never accepted from the body.");var hu=12,fu=a({motifId:s().min(1).optional(),limit:y().min(1).max(hu).optional()}).describe("POST /brand-kits/{id}/exemplars body \u2014 select which exemplar frames to presign.");var xu=-9007199254740991,gu=9007199254740991,yu=a({exemplars:x(a({index:y().min(xu).max(gu),url:s()})),contactSheetUrl:s().optional()});var bu=300,Su=0,zu=1e4,wu=120,Cu=24,Mu=40,Tu=500,Ru=0,vu=5e3,Pu=0,Iu=5e3,Ou=0,ku=2e3,Eu=0,Au=9007199254740991,Lu=24,Du=0,Fu=1,ju=300,Vu=24,Nu=4e3,$u=0,Bu=60,_u=6,qu=24,Uu=60,ft=a({id:s(),name:s(),description:s().nullable(),tagline:s().nullable(),colors:M(s(),s()),extraColors:x(a({name:s(),value:s()})).optional(),fonts:a({heading:S([a({family:s(),weight:S([i(),s()]).optional()}),N()]),body:S([a({family:s(),weight:S([i(),s()]).optional()}),N()])}),voiceGuidelines:s().nullable(),captions:a({sync:v(),profile:S([M(s(),R()),N()])}),motion:a({duration:i().optional(),easing:S([u(["linear","ease","ease-in","ease-out","ease-in-out"]),a({kind:h("cubic-bezier"),x1:i(),y1:i(),x2:i(),y2:i()})]).optional(),entrance:u(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:i().optional(),exitMs:i().optional()}).optional(),logo:a({src:s(),alt:s().optional(),placement:u(["tl","tr","bl","br"]).optional(),sizePct:i().optional()}).optional(),intro:a({kind:u(["card","video"]),src:s().optional(),title:s().optional(),subtitle:s().optional(),durationMs:i().optional()}).optional(),outro:a({kind:u(["card","video"]),src:s().optional(),title:s().optional(),subtitle:s().optional(),durationMs:i().optional()}).optional(),watermark:a({src:s(),opacity:i().optional(),placement:u(["tl","tr","bl","br"]).optional()}).optional(),spacing:a({base:i().optional(),lg:i().optional(),sm:i().optional()}).optional(),sizing:a({fontSizeHeading:i().optional(),fontSizeBody:i().optional(),fontSizeLabel:i().optional(),borderRadius:i().optional()}).optional(),audio:a({sfxIntensity:u(["off","light","standard","dense"]).optional(),musicEnabled:v().optional(),musicMood:s().max(bu).optional(),sonicLogo:a({ref:s().min(1),placement:u(["intro","outro","both"]),offsetMs:y().min(Su).max(zu).optional()}).optional().describe("A brand sound signature bound to the intro/outro bookend. `ref` = a palette reference; bound only when the kit carries the matching bumper (intro/outro), else a non-blocking advisory."),uiSoundSet:a({tick:s().min(1).optional(),pop:s().min(1).optional(),impact:s().min(1).optional(),confirm:s().min(1).optional(),error:s().min(1).optional(),whoosh:s().min(1).optional(),riser:s().min(1).optional()}).optional().describe("Per-family SFX overrides (the brand's own tick/pop/\u2026). Highest-priority tier over the org palette + pack default in the compose SFX draw."),bedStyle:a({bedId:s().min(1).optional(),genre:s().max(wu).optional(),bpmRange:a({min:i(),max:i()}).optional()}).optional().describe("Preferred music bed (`bedId`) or a style hint (`genre` / `bpmRange`). Surfaced for driving agents; compose does not auto-select a pack bed."),ambiencePreference:S([a({ref:s().min(1)}),N()]).optional().describe("Preferred ambience bed (`{ref}`) or explicit null (opt-out). Surfaced for driving agents; compose has no ambience auto-placement.")}).optional(),exemplarKeys:x(s().min(1)).max(Cu).optional(),contactSheetKey:s().min(1).optional(),motifs:x(a({id:s().min(1).max(Mu),observed:s().min(1).max(Tu),body:S([a({kind:h("card"),html:s().min(1),tokens:M(s(),s()).optional()}),a({kind:h("overlay"),primitiveId:s().min(1),params:M(s(),R()).optional()}),a({kind:h("component"),componentId:s().min(1),props:M(s(),R()).optional()})]),motion:a({preset:u(["fade-up","slide-in-left","slide-in-right","scale-pop","stagger-reveal"]),enterMs:y().min(Ru).max(vu).optional(),exitMs:y().min(Pu).max(Iu).optional(),staggerMs:y().min(Ou).max(ku).optional(),confidence:u(["high","low"]).optional()}).optional(),role:u(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]),zone:a({x:i(),y:i(),w:i(),h:i()}).optional(),evidence:x(y().min(Eu).max(Au)).max(Lu).optional(),diffScore:i().min(Du).max(Fu).optional(),coverage:u(["reproduced","approximated","skipped"]),skipReason:s().max(ju).optional()})).max(Vu).optional(),styleRubric:s().max(Nu).optional(),density:a({graphicsPerMin:i().min($u).max(Bu),maxSimultaneous:y().min(1).max(_u)}).optional(),inspiration:a({sources:x(s()).min(1).max(qu),extractedAt:i(),extractionVersion:s().min(1).max(Uu)}).optional(),createdAt:s(),updatedAt:s()}).describe("Brand kit response per \xA7Brand Kits.");var oe=a({hasMore:v(),nextCursor:s().nullable(),prevCursor:s().nullable()}).describe("Cursor pagination metadata.");var Wu=a({data:x(ft),pagination:oe});var Gu=300,Ke=a({music:a({enabled:v().describe("Whether the compose carries a music bed."),mood:s().max(Gu).optional().describe("Freeform mood/genre prompt for the GENERATED bed (e.g. 'understated editorial, warm'). Ignored when mediaId pins a track."),mediaId:s().min(1).optional().describe("Pin a client-imported track as the bed. HONOR-OR-REFUSE: must be an org-owned kind:'audio' media item, else 422 \u2014 never accept-and-ignore. Absent \u21D2 generate from mood.")}).optional(),sfx:a({intensity:u(["off","light","standard","dense"]).describe("SFX placement density. Real-footage content keeps restraint caps regardless ('dense' is the explicit opt-out); generated/graphic-led content unlocks the standard tier.")}).optional()});var Hu=0,Ku=0,Ju=0,Xu=80,Zu=8,Je=a({id:s().min(1),intent:s().min(1).describe("What this beat DOES editorially (hook the claim, prove it, CTA\u2026)."),durationSec:i().gt(Hu).optional(),source:a({mediaId:s().min(1),startSec:i().min(Ku),endSec:i().gt(Ju)}).optional().describe("MOMENT PINNING: this beat uses EXACTLY this window of this media item \u2014 honored to-the-frame or refused. v1: every sourced beat must reference the SAME mediaId (multi-source briefs are refused loudly, not silently merged)."),graphic:a({role:u(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]).describe("The mandated graphic's editorial role (the graphics-plan GraphicRole vocabulary)."),items:x(s().min(1).max(Xu)).max(Zu).optional().describe("Mandated list items (enumeration/sequence) \u2014 carried VERBATIM into the plan's copy.items.")}).optional().describe("GRAPHICS MANDATE: the plan MUST carry a graphics request of this role overlapping this beat's window \u2014 enforced at the plan gate (honor-or-refuse, like moment pinning). Prose mustIncludes reaches only the judge; this is the checkable form.")});var Xe=u(["overlay","component","card","no-transitions"]);var Yu=3,Ze=a({holdAt:x(u(["content","layout","motion"])).max(Yu).optional().describe("Checkpoint gates \u2014 the compose pauses at each named stage for review via resume. DEFAULT (gates absent): the compose holds at EVERY stage \u2014 your agent reviews and resumes each one; an unreviewed checkpoint times out loudly after 60min. Auto-progression is the opt-in (gates.autoApprove: true)."),autoApprove:v().optional().describe("true = fully autonomous (compose runs with NO gates \u2014 the headless opt-in; without it a brief holds at every stage by default). Mutually exclusive with a non-empty holdAt."),reviewMode:u(["agent","hosted"]).optional().describe("Who captures the review decision. Default 'agent': you relay the packet and call resume. 'hosted': every checkpoint mints a review-page URL (checkpoint.ready payload + get_checkpoint's reviewUrl) where a human approves/revises from the browser \u2014 no account, no agent session; the recorded decision rides the SAME resume rail and you learn of it via checkpoint webhooks / wait_job.")});var ee=a({aspectRatio:u(["16:9","9:16","1:1","4:5"]),fps:S([h(24),h(25),h(30),h(60)]).optional(),resolution:u(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format.");var Qu=200,em=2e3,tm=500,om=100,rm=0,sm=3600,nm=500,im=500,am=35,cm=500,pm=2e3,dm=24,lm=24,um=12,mm=24,hm=0,fm=0,xm=0,gm=0,ym=0,bm=0,Sm=0,zm=4,wm=0,Cm=0,Mm=0,Tm=0,Rm=0,vm=0,Pm=0,Im=0,Om=0,km=1,Em=0,Am=1,Lm=.1,Dm=1,Fm=0,jm=0,Vm=-.3,Nm=.3,$m=-.3,Bm=.3,_m=0,qm=1,Um=0,Wm=1,Gm=-.3,Hm=.3,Km=0,Jm=1,Xm=0,Zm=-1,Ym=2,Qm=-1,eh=2,th=0,oh=1,rh=0,sh=1,nh=0,ih=1,ah=0,ch=1,ph=0,dh=0,lh=2,uh=16,mh=8,hh=a({projectId:s().min(1),name:s().max(Qu).optional(),goal:s().min(1).max(em).describe("What the video must accomplish."),audience:s().max(tm).optional(),platform:s().max(om).optional(),format:ee.optional(),durationSec:i().gt(rm).max(sm).optional().describe("Target output duration. HONOR-OR-REFUSE: compose validates it against the beat-source window (\xB11.5s) and refuses a brief it cannot honor."),tone:s().max(nm).optional(),cta:s().max(im).optional(),locale:s().max(am).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:s().max(cm).optional(),caption:s().max(pm).optional(),beats:x(Je).max(dm).optional(),mustIncludes:x(s().min(1)).max(lm).optional(),references:x(s()).max(um).optional(),captions:a({styleId:s().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:x(s().min(1)).max(mm).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).optional(),motionStyle:a({textAnimation:s().optional(),transitions:s().optional(),colorMood:s().optional(),captionStyle:s().optional()}).optional(),seededGraphics:x(a({id:s().min(1),startTime:i().min(hm).describe("Timeline start (seconds)."),duration:i().gt(fm).describe("Clip duration (seconds)."),source:S([a({kind:h("media"),mediaId:s().min(1),trim:a({start:i().min(xm).describe("Source trim start (seconds)."),end:i().min(gm).describe("Source trim end (seconds).")}).optional(),excludedRanges:x(a({start:i().min(ym),end:i().min(bm),reason:s().optional()})).optional(),volume:i().min(Sm).max(zm).optional(),muted:v().optional(),playbackRate:i().gt(wm).optional(),sync:u(["video","independent"]).optional(),kenBurns:u(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:i().optional(),fadeInMs:i().min(Cm).optional(),fadeOutMs:i().min(Mm).optional(),loop:v().optional(),audioRole:u(["sfx","music","vo","ambience"]).optional(),duck:a({duckDb:i().max(Tm),attackMs:i().min(Rm),releaseMs:i().min(vm),windows:x(a({startMs:i(),endMs:i()})).optional()}).optional(),anchor:a({clipId:s().min(1),offsetMs:i()}).optional(),reframe:a({segments:x(a({startSec:i().min(Pm).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(Im).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:S([a({mode:h("frame-center")}),a({mode:h("point"),x:i().min(Om).max(km),y:i().min(Em).max(Am)}),a({mode:h("face"),faceId:s().min(1),shotScale:u(["close","standard","wide"]).optional()}),a({mode:h("all-faces")}),a({mode:h("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:s().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(Lm).max(Dm).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:a({in:i().min(Fm).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(jm).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:a({x:i().min(Vm).max(Nm).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min($m).max(Bm).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),a({kind:h("component"),componentId:s().min(1),props:M(s(),R()),assets:M(s(),s().min(1)).optional(),zPlane:u(["front","behind-subject"]).optional()}),a({kind:h("overlay"),primitiveId:s().min(1),params:M(s(),R()),zPlane:u(["front","behind-subject"]).optional(),anchor:a({space:h("scene"),x:i().min(_m).max(qm),y:i().min(Um).max(Wm)}).optional(),parallax:i().min(Gm).max(Hm).optional()}),a({kind:h("effect"),primitiveId:s().min(1),params:M(s(),R()).optional()}),a({kind:h("alpha-layer"),componentId:s().min(1),props:M(s(),R()),assets:M(s(),s().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:u(["front","behind-subject"]).optional()}),a({kind:h("card"),html:s().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),tokens:M(s(),s()).optional(),zPlane:h("front").optional()})]),kind:u(["video","audio","image","overlay","effect"]).optional(),opacity:i().min(Km).max(Jm).optional(),scale:i().gt(Xm).optional(),rotation:i().optional(),position:a({x:i().min(Zm).max(Ym),y:i().min(Qm).max(eh)}).optional().describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),region:a({x:i().min(th).max(oh),y:i().min(rh).max(sh),w:i().gt(nh).max(ih),h:i().gt(ah).max(ch)}).optional(),fit:u(["cover","contain"]).optional(),effects:x(a({primitiveId:s().min(1),params:M(s(),R()).optional()})).optional(),transitionIn:a({type:s().min(1),duration:i().gt(ph)}).optional(),linkGroupId:s().min(1).optional(),animate:M(s(),x(a({time:i().min(dh),value:i(),easing:S([u(["linear","ease","easeIn","easeOut","easeInOut"]),a({cubicBezier:D([i(),i(),i(),i()])})]).optional()})).min(lh)).optional().describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.")})).max(uh).optional().describe("Client-authored graphic clips the Director must carry VERBATIM: seeded into the design loop's base composition as LOCKED clips (never re-authored, never discarded)."),exclusions:x(Xe).max(mh).optional(),gates:Ze.optional(),audio:Ke.optional()});var fh=-9007199254740991,xh=9007199254740991,ii=a({composeUsd:i(),renderUsdPerExport:i(),estimatedJourneyUsd:i().describe("compose + expected renders \u2014 relay this BEFORE composing."),revisionCyclesIncluded:y().min(fh).max(xh).describe("Revise cycles the compose price includes per gate (A1). Beyond this, resume(revise) is refused with `revision_cycles_exhausted` \u2014 saying no never silently charges.")});var gh=200,yh=2e3,bh=500,Sh=100,zh=0,wh=3600,Ch=500,Mh=500,Th=35,Rh=500,vh=2e3,Ph=24,Ih=24,Oh=12,kh=24,Eh=0,Ah=0,Lh=0,Dh=0,Fh=0,jh=0,Vh=0,Nh=4,$h=0,Bh=0,_h=0,qh=0,Uh=0,Wh=0,Gh=0,Hh=0,Kh=0,Jh=1,Xh=0,Zh=1,Yh=.1,Qh=1,ef=0,tf=0,of=-.3,rf=.3,sf=-.3,nf=.3,af=0,cf=1,pf=0,df=1,lf=-.3,uf=.3,mf=0,hf=1,ff=0,xf=-1,gf=2,yf=-1,bf=2,Sf=0,zf=1,wf=0,Cf=1,Mf=0,Tf=1,Rf=0,vf=1,Pf=0,If=0,Of=2,kf=16,Ef=8,_o=a({id:s(),projectId:s(),kind:u(["authored","clip"]).describe("authored = create_brief; clip = minted by suggest_briefs from an AI clip suggestion."),sourceSuggestionId:s().optional().describe("kind:'clip' provenance \u2014 the suggestion this Brief was minted from."),name:s().max(gh).optional(),goal:s().min(1).max(yh).describe("What the video must accomplish."),audience:s().max(bh).optional(),platform:s().max(Sh).optional(),format:ee.optional(),durationSec:i().gt(zh).max(wh).optional().describe("Target output duration. HONOR-OR-REFUSE: compose validates it against the beat-source window (\xB11.5s) and refuses a brief it cannot honor."),tone:s().max(Ch).optional(),cta:s().max(Mh).optional(),locale:s().max(Th).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:s().max(Rh).optional(),caption:s().max(vh).optional(),beats:x(Je).max(Ph).optional(),mustIncludes:x(s().min(1)).max(Ih).optional(),references:x(s()).max(Oh).optional(),captions:a({styleId:s().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:x(s().min(1)).max(kh).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).optional(),motionStyle:a({textAnimation:s().optional(),transitions:s().optional(),colorMood:s().optional(),captionStyle:s().optional()}).optional(),seededGraphics:x(a({id:s().min(1),startTime:i().min(Eh).describe("Timeline start (seconds)."),duration:i().gt(Ah).describe("Clip duration (seconds)."),source:S([a({kind:h("media"),mediaId:s().min(1),trim:a({start:i().min(Lh).describe("Source trim start (seconds)."),end:i().min(Dh).describe("Source trim end (seconds).")}).optional(),excludedRanges:x(a({start:i().min(Fh),end:i().min(jh),reason:s().optional()})).optional(),volume:i().min(Vh).max(Nh).optional(),muted:v().optional(),playbackRate:i().gt($h).optional(),sync:u(["video","independent"]).optional(),kenBurns:u(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:i().optional(),fadeInMs:i().min(Bh).optional(),fadeOutMs:i().min(_h).optional(),loop:v().optional(),audioRole:u(["sfx","music","vo","ambience"]).optional(),duck:a({duckDb:i().max(qh),attackMs:i().min(Uh),releaseMs:i().min(Wh),windows:x(a({startMs:i(),endMs:i()})).optional()}).optional(),anchor:a({clipId:s().min(1),offsetMs:i()}).optional(),reframe:a({segments:x(a({startSec:i().min(Gh).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(Hh).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:S([a({mode:h("frame-center")}),a({mode:h("point"),x:i().min(Kh).max(Jh),y:i().min(Xh).max(Zh)}),a({mode:h("face"),faceId:s().min(1),shotScale:u(["close","standard","wide"]).optional()}),a({mode:h("all-faces")}),a({mode:h("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:s().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(Yh).max(Qh).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:a({in:i().min(ef).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(tf).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:a({x:i().min(of).max(rf).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(sf).max(nf).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),a({kind:h("component"),componentId:s().min(1),props:M(s(),R()),assets:M(s(),s().min(1)).optional(),zPlane:u(["front","behind-subject"]).optional()}),a({kind:h("overlay"),primitiveId:s().min(1),params:M(s(),R()),zPlane:u(["front","behind-subject"]).optional(),anchor:a({space:h("scene"),x:i().min(af).max(cf),y:i().min(pf).max(df)}).optional(),parallax:i().min(lf).max(uf).optional()}),a({kind:h("effect"),primitiveId:s().min(1),params:M(s(),R()).optional()}),a({kind:h("alpha-layer"),componentId:s().min(1),props:M(s(),R()),assets:M(s(),s().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:u(["front","behind-subject"]).optional()}),a({kind:h("card"),html:s().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),tokens:M(s(),s()).optional(),zPlane:h("front").optional()})]),kind:u(["video","audio","image","overlay","effect"]).optional(),opacity:i().min(mf).max(hf).optional(),scale:i().gt(ff).optional(),rotation:i().optional(),position:a({x:i().min(xf).max(gf),y:i().min(yf).max(bf)}).optional().describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),region:a({x:i().min(Sf).max(zf),y:i().min(wf).max(Cf),w:i().gt(Mf).max(Tf),h:i().gt(Rf).max(vf)}).optional(),fit:u(["cover","contain"]).optional(),effects:x(a({primitiveId:s().min(1),params:M(s(),R()).optional()})).optional(),transitionIn:a({type:s().min(1),duration:i().gt(Pf)}).optional(),linkGroupId:s().min(1).optional(),animate:M(s(),x(a({time:i().min(If),value:i(),easing:S([u(["linear","ease","easeIn","easeOut","easeInOut"]),a({cubicBezier:D([i(),i(),i(),i()])})]).optional()})).min(Of)).optional().describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.")})).max(kf).optional().describe("Client-authored graphic clips the Director must carry VERBATIM: seeded into the design loop's base composition as LOCKED clips (never re-authored, never discarded)."),exclusions:x(Xe).max(Ef).optional(),gates:Ze.optional(),audio:Ke.optional(),quote:ii,createdAt:i(),updatedAt:i()});var Af=a({data:x(_o),pagination:oe});var Lf=200,Df=2e3,Ff=500,jf=100,Vf=0,Nf=3600,$f=500,Bf=500,_f=35,qf=500,Uf=2e3,Wf=24,Gf=24,Hf=12,Kf=24,Jf=0,Xf=0,Zf=0,Yf=0,Qf=0,ex=0,tx=0,ox=4,rx=0,sx=0,nx=0,ix=0,ax=0,cx=0,px=0,dx=0,lx=0,ux=1,mx=0,hx=1,fx=.1,xx=1,gx=0,yx=0,bx=-.3,Sx=.3,zx=-.3,wx=.3,Cx=0,Mx=1,Tx=0,Rx=1,vx=-.3,Px=.3,Ix=0,Ox=1,kx=0,Ex=-1,Ax=2,Lx=-1,Dx=2,Fx=0,jx=1,Vx=0,Nx=1,$x=0,Bx=1,_x=0,qx=1,Ux=0,Wx=0,Gx=2,Hx=16,Kx=8,Jx=a({name:s().max(Lf).optional(),goal:s().min(1).max(Df).optional().describe("What the video must accomplish."),audience:s().max(Ff).optional(),platform:s().max(jf).optional(),format:ee.optional(),durationSec:i().gt(Vf).max(Nf).optional().describe("Target output duration. HONOR-OR-REFUSE: compose validates it against the beat-source window (\xB11.5s) and refuses a brief it cannot honor."),tone:s().max($f).optional(),cta:s().max(Bf).optional(),locale:s().max(_f).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:s().max(qf).optional(),caption:s().max(Uf).optional(),beats:x(Je).max(Wf).optional(),mustIncludes:x(s().min(1)).max(Gf).optional(),references:x(s()).max(Hf).optional(),captions:a({styleId:s().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:x(s().min(1)).max(Kf).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).optional(),motionStyle:a({textAnimation:s().optional(),transitions:s().optional(),colorMood:s().optional(),captionStyle:s().optional()}).optional(),seededGraphics:x(a({id:s().min(1),startTime:i().min(Jf).describe("Timeline start (seconds)."),duration:i().gt(Xf).describe("Clip duration (seconds)."),source:S([a({kind:h("media"),mediaId:s().min(1),trim:a({start:i().min(Zf).describe("Source trim start (seconds)."),end:i().min(Yf).describe("Source trim end (seconds).")}).optional(),excludedRanges:x(a({start:i().min(Qf),end:i().min(ex),reason:s().optional()})).optional(),volume:i().min(tx).max(ox).optional(),muted:v().optional(),playbackRate:i().gt(rx).optional(),sync:u(["video","independent"]).optional(),kenBurns:u(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:i().optional(),fadeInMs:i().min(sx).optional(),fadeOutMs:i().min(nx).optional(),loop:v().optional(),audioRole:u(["sfx","music","vo","ambience"]).optional(),duck:a({duckDb:i().max(ix),attackMs:i().min(ax),releaseMs:i().min(cx),windows:x(a({startMs:i(),endMs:i()})).optional()}).optional(),anchor:a({clipId:s().min(1),offsetMs:i()}).optional(),reframe:a({segments:x(a({startSec:i().min(px).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(dx).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:S([a({mode:h("frame-center")}),a({mode:h("point"),x:i().min(lx).max(ux),y:i().min(mx).max(hx)}),a({mode:h("face"),faceId:s().min(1),shotScale:u(["close","standard","wide"]).optional()}),a({mode:h("all-faces")}),a({mode:h("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:s().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(fx).max(xx).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:a({in:i().min(gx).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(yx).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:a({x:i().min(bx).max(Sx).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(zx).max(wx).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),a({kind:h("component"),componentId:s().min(1),props:M(s(),R()),assets:M(s(),s().min(1)).optional(),zPlane:u(["front","behind-subject"]).optional()}),a({kind:h("overlay"),primitiveId:s().min(1),params:M(s(),R()),zPlane:u(["front","behind-subject"]).optional(),anchor:a({space:h("scene"),x:i().min(Cx).max(Mx),y:i().min(Tx).max(Rx)}).optional(),parallax:i().min(vx).max(Px).optional()}),a({kind:h("effect"),primitiveId:s().min(1),params:M(s(),R()).optional()}),a({kind:h("alpha-layer"),componentId:s().min(1),props:M(s(),R()),assets:M(s(),s().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:u(["front","behind-subject"]).optional()}),a({kind:h("card"),html:s().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),tokens:M(s(),s()).optional(),zPlane:h("front").optional()})]),kind:u(["video","audio","image","overlay","effect"]).optional(),opacity:i().min(Ix).max(Ox).optional(),scale:i().gt(kx).optional(),rotation:i().optional(),position:a({x:i().min(Ex).max(Ax),y:i().min(Lx).max(Dx)}).optional().describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),region:a({x:i().min(Fx).max(jx),y:i().min(Vx).max(Nx),w:i().gt($x).max(Bx),h:i().gt(_x).max(qx)}).optional(),fit:u(["cover","contain"]).optional(),effects:x(a({primitiveId:s().min(1),params:M(s(),R()).optional()})).optional(),transitionIn:a({type:s().min(1),duration:i().gt(Ux)}).optional(),linkGroupId:s().min(1).optional(),animate:M(s(),x(a({time:i().min(Wx),value:i(),easing:S([u(["linear","ease","easeIn","easeOut","easeInOut"]),a({cubicBezier:D([i(),i(),i(),i()])})]).optional()})).min(Gx)).optional().describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.")})).max(Hx).optional().describe("Client-authored graphic clips the Director must carry VERBATIM: seeded into the design loop's base composition as LOCKED clips (never re-authored, never discarded)."),exclusions:x(Xe).max(Kx).optional(),gates:Ze.optional(),audio:Ke.optional()});var Xx="month",Zx=a({plan:u(["credit_pack_10","credit_pack_30","credit_pack_100"]).describe("Plan tier to subscribe to."),interval:u(["month","year"]).default(Xx).describe("Billing interval: 'month' (monthly) or 'year' (annual, ~2 months free).")});var Yx=a({url:s().describe("Hosted Stripe checkout URL to open in a browser to complete payment. Always present on success \u2014 an existing saved card is never charged without confirming here."),plan:s(),interval:s(),productId:s().describe("Resolved billing catalog product id.")});var Qx=0,eg=9007199254740991,tg=2e3,ai=a({anchor:S([a({beatId:s().min(1)}),a({timecodeMs:y().min(Qx).max(eg)})]).describe("What the comment is about: a plan beat (content gate) or a timecode on the artifact (layout/motion gates)."),verdict:u(["approve","revise","lock"]).describe("Per-anchor verdict under the single gate decision. `lock` = contractually frozen \u2014 the director touching a locked element is a defect, surfaced as a lock_violation verdict on the next packet (the no-discard machinery)."),note:s().max(tg).optional()});var Qt=a({thisStepUsd:i().describe("What approving costs NEXT (the render at the final gate; $0 earlier)."),jobSpendSoFarUsd:i().describe("What has SETTLED so far \u2014 $0 while the run is live (compose is charge-on-delivery on both rails), so abandoning at a gate charges nothing."),estimatedJourneyTotalUsd:i().describe("The same journey number the Brief quoted.")});var eo=u(["content","layout","motion"]);var og=-9007199254740991,rg=9007199254740991,sg=-9007199254740991,ng=9007199254740991,qo=a({id:s(),projectId:s(),composeJobId:s().optional(),briefId:s().optional(),kind:u(["gate","score"]),stage:eo.optional(),version:y().min(og).max(rg),status:u(["awaiting","approved","revised","abandoned","expired","superseded"]),artifact:R().describe("The stage artifact under review: the locked ComposePlan at content; the composition wire shape at layout/motion; the judged composition snapshot on kind:'score'."),stillUrls:x(s()).optional().describe("Presigned storyboard/eval stills \u2014 the packet's visual evidence (may be GC'd by the retention sweep after the job goes terminal; the decision record is immortal)."),criticVerdicts:R().optional().describe("Per-criterion scores + critique from the design loop / judge, incl. lock_violation entries."),quote:Qt.optional(),revisionCycle:y().min(sg).max(ng).describe("Revise cycles this gate has consumed. The brief quote states the included count (revisionCyclesIncluded); beyond it, resume(revise) is refused with a typed error."),decision:R().optional().describe("The recorded decision {decision, comments?, globalNote?, decidedAt} once resolved."),reviewMode:u(["agent","hosted"]).optional().describe("How this packet is decided (from the Brief's gates). 'hosted' = the review PAGE captures the decision; absent/'agent' = the decision flows back through the driving agent."),reviewUrl:s().optional().describe("Hosted review-page URL (present when reviewMode is 'hosted') \u2014 a human decides from this link, no account or agent session; the recorded decision rides the SAME resume rail, and the agent learns of it via checkpoint webhooks / wait_job."),createdAt:i(),updatedAt:i()});var ig=a({data:x(qo),pagination:oe});var ag=24,cg=4e3,pg=a({decision:u(["approve","revise","abandon"]).describe("The ONE verdict for this gate (GitHub review grammar). approve = proceed (comments allowed \u2014 they record as taste signal without gating); revise = the director revises per comments/edits and RE-PRESENTS this same gate (in-job, no re-meter); abandon = end the run."),comments:x(ai).max(ag).optional(),edits:R().optional().describe("Your edited stage artifact (the power path). With edits the re-presented packet carries exactly what you supplied; with comments alone the director re-authors scoped by them."),globalNote:s().max(cg).optional()}).describe("POST /checkpoints/:id/resume body \u2014 the A1 review grammar.");var dg=a({ok:h(!0)}).describe("POST /checkpoints/:id/resume response.");var MY=a({ok:v()});var RY=a({etag:s()});var lg=0,ug=64,mg=0,hg=64,fg=1,xg=0,gg=1,yg=1,bg=0,Sg=1,Te=a({version:h(2),assets:M(s(),a({kind:u(["image","video","audio","data"]),required:v(),mimeTypes:x(s().min(1)).min(1).optional(),mediaDemand:S([a({mode:h("original")}),a({mode:h("tier"),tier:S([h(256),h(512),h(1024),h(2048)])}),a({mode:h("auto"),maxProjectedWidthRatio:i().gt(lg).max(ug),maxProjectedHeightRatio:i().gt(mg).max(hg),minVisibleSourceWidthRatio:i().gt(xg).max(gg).default(fg),minVisibleSourceHeightRatio:i().gt(bg).max(Sg).default(yg)})]).optional()})),graphics:a({api:u(["canvas2d","webgl","webgl2","webgpu"]),required:h(!0),accelerationPreference:u(["hardware-preferred","software-allowed"])}),alphaPolicy:u(["requires-transparency","allows-opaque"]),sceneShot:a({version:h(2)}).optional()});var zg=200,wg=200,Cg=2e3,Mg=200,Tg=0,Rg=a({componentId:s().min(1).max(zg).describe("Caller-chosen stable component id. On create it names the new component. On PUT/PATCH it is optional and, when present, must equal the id in the path; a mismatch is a 400 naming both."),tsxSource:s().min(1),name:s().min(1).max(wg),description:s().max(Cg),category:u(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),propSchema:M(s(),R()).optional(),origin:u(["customer-owned","server-native"]).optional(),ejectedFrom:s().max(Mg).optional(),tokens:M(s(),R()).optional(),examples:x(M(s(),R())).optional().describe("Usage examples, as authored. A built-in primitive projects {name, mood?, params?, description?}; an authored component's examples are whatever it wrote, which is why the item is open. One shape for both directions: what you write here is what you read back."),durationInFrames:i().gt(Tg).optional(),manifest:Te}).describe("POST /components body. Org/user are server-resolved; never accepted from the body.");var ci=a({clipSourceKind:u(["overlay","effect","component"]).describe("The ClipSource `kind` to author this entry as: 'overlay' (built-in text/ui/scene/background/layout), 'effect' (built-in effect/transition), or 'component' (an org-INSTALLED custom component)."),refField:u(["primitiveId","componentId"]).describe("Which id field keys the ClipSource: 'primitiveId' for built-ins (source:'default'), 'componentId' for installed components (source:'installed'). Using the wrong field will NOT resolve at render.")});var pi=a({aspectRatio:u(["16:9","9:16","1:1","4:5"]),fps:S([h(24),h(25),h(30),h(60)]).optional(),resolution:u(["hd","fhd","4k"]).optional()});var vg=200,Pg=2e3,Ig=200,Og=0,Uo=a({name:s().min(1).max(vg),description:s().max(Pg),category:u(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),propSchema:M(s(),R()),origin:u(["customer-owned","server-native"]).optional(),ejectedFrom:s().max(Ig).optional(),tokens:M(s(),R()).optional(),examples:x(M(s(),R())).optional().describe("Usage examples, as authored. A built-in primitive projects {name, mood?, params?, description?}; an authored component's examples are whatever it wrote, which is why the item is open. One shape for both directions: what you write here is what you read back."),durationInFrames:i().gt(Og).optional(),manifest:Te.optional().describe("The stored runtime manifest (assets, graphics API, alpha policy) of an org-INSTALLED component: the same object the create/update body takes, so a manifest read back here can be written back unchanged. Built-in defaults have no stored manifest and omit it. Its `version` is always 2 (the contract version), unlike the entry's semver `version`."),id:s().describe("The entry's id: a `primitiveId` for a built-in, a `componentId` for an installed component."),source:u(["default","installed"]).describe("'default' = built-in primitive (place by primitiveId); 'installed' = org-authored component (place by componentId)."),kind:u(["component","transition","scene"]).describe("RENDER kind (component | transition | scene). NOT the ClipSource variant \u2014 see `placement` for how to author it on the timeline."),version:s().describe("The ENTRY's version: a semver string ('0.0.0' until an authored component is versioned). Distinct from `manifest.version`, which is the runtime contract version and is always the literal 2."),propDefaults:M(s(),R()).optional(),textParam:s().nullish().describe("The param field that carries this primitive's primary text; null = no single text slot."),subtextParam:s().nullish().describe("The param field for secondary text (subtitle/byline); null = none."),format:pi.optional(),intent:s().optional().describe("Selection signal: a verb naming what this primitive accomplishes (e.g. 'product-trailer'). Match it to the beat you are authoring."),useWhen:s().optional().describe("When to use this \u2014 AND when not to. The negative guidance is load-bearing; read it before picking."),pairsWith:x(s()).optional().describe("Authoring guidance: ids of primitives that COMPOSE well with this one in the same edit."),avoidWith:x(s()).optional().describe("Authoring guidance: ids of primitives that CONFLICT with this one \u2014 do not place together."),tags:x(s()).optional().describe("Free-text search keywords."),mood:x(s()).optional().describe("Vibe/tone tags (e.g. 'cinematic', 'minimal'). Filter to match the edit's mood."),tier:u(["recommended","standard","niche"]).optional().describe("Quality/applicability RANKING (a preference, not a flag). Prefer 'recommended'; reach for 'niche' only when its specific use-case is exactly the beat."),useCase:x(u(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"])).optional().describe("The edit ROLE(s) this primitive fills \u2014 the dimension to filter by for a beat (e.g. 'intro', 'title-over-footage', 'grade')."),fixedCopy:x(s()).optional().describe("On-screen strings this primitive BAKES \u2014 the read-side counterpart to propSchema. These literals render REGARDLESS of params (no param can change them); fork the source via get_component_source to edit them. Use this to see at author time what fixed copy (someone-else's marketing text, faux-code, faux-data) will appear before you render."),brandBindings:x(a({param:s(),brandToken:s()})).optional().describe("Params that can follow the project brand kit. Each {param, brandToken} says: set `param` to `brandToken` (a `$brand:` ref, e.g. '$brand:colors.accent') to track the brand instead of a literal. See the list response's `brandTokens` for the full ref vocabulary. Omitted when nothing is brand-bound."),placement:ci.describe("How to author this entry as a ClipSource via apply_composition: the exact ClipSource `kind` + the id field to key it by. Built-ins place as {kind:'overlay'|'effect', primitiveId}; installed components place as {kind:'component', componentId}. A kind:'scene' primitive has no 'scene' ClipSource \u2014 it is placed as {kind:'overlay', primitiveId}."),warnings:x(s()).optional().describe("Non-blocking save-time advisories \u2014 the create/update SUCCEEDED. Currently: a `fontFamily` string literal referencing a NON-vendored font (a bare CSS generic like 'serif', or an unknown named family like 'Arial') whose LIVE-lane pixels vary by render host \u2014 re-author with a vendored family or 'Georgia'. Omitted when there is nothing to flag; only present on the create/update responses.")}).describe("Component catalog entry per \xA7Components.");var di=a({soundId:s().describe("Stable sound-pack item id."),family:u(["tick","pop","impact","confirm","error","whoosh","riser"]).describe("Editorial family the compose sfx pass binds by."),envelopeClass:u(["transient","sweep","ambient"]).describe("Coarse envelope shape \u2014 the browse grouping."),intensity:u(["subtle","standard","strong"]),durationSec:i().describe("Duration of the mastered asset (seconds)."),description:s().describe("One-line human-legible caption."),attribution:s().describe("CC0 provenance string.")});var kg=a({data:x(Uo),pagination:oe,brandTokens:x(s()).optional().describe("Catalog-level reference: the valid `$brand:` token refs a param value may carry (e.g. accentColor: \"$brand:colors.accent\"). Colors + fonts are the common bindings; the full design-token vocabulary is listed. Derived from the brand kit resolver so it can't drift. See each entry's `brandBindings` for which params are brand-bound by default."),sfx:x(di).optional().describe("Catalog-level reference: the curated CC0 SFX pack (closed, versioned). The compose sfx pass places these deterministically; this is the pack-only structural inventory to pick a `soundId` by family. Present on the first page only."),audio:x(ri).optional().describe(`The UNIFIED org sound palette (audio-substrate Phase 2): the curated packs (SFX + music beds) unioned with THIS org's own uploads/imports (source:"org") and generated audio (source:"generated"), one uniform entry shape carrying role + envelopeClass + provenance + license; music entries carry bpm. Prefer an org sound when it fits \u2014 an org that uploads its product's real UI sounds hears ITS product. Present on the first page only.`)});var Eg=200,Ag=200,Lg=2e3,Dg=200,Fg=0,jg=a({componentId:s().min(1).max(Eg).optional().describe("Caller-chosen stable component id. On create it names the new component. On PUT/PATCH it is optional and, when present, must equal the id in the path; a mismatch is a 400 naming both."),tsxSource:s().min(1).optional(),name:s().min(1).max(Ag).optional(),description:s().max(Lg).optional(),category:u(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]).optional(),propSchema:M(s(),R()).optional(),origin:u(["customer-owned","server-native"]).optional(),ejectedFrom:s().max(Dg).optional(),tokens:M(s(),R()).optional(),examples:x(M(s(),R())).optional().describe("Usage examples, as authored. A built-in primitive projects {name, mood?, params?, description?}; an authored component's examples are whatever it wrote, which is why the item is open. One shape for both directions: what you write here is what you read back."),durationInFrames:i().gt(Fg).optional(),manifest:Te.optional()}).describe("PATCH /components/:id body, RFC 7396 merge: a field you omit is left exactly as it was. Org/user are server-resolved; never accepted from the body.");var li=a({artifactKind:h("image"),contentType:u(["image/png","image/jpeg"]),cached:v(),listUsd:i().optional().describe("List price charged for this delivered preview."),url:re(),urlExpiresAt:s()});var ui=a({artifactKind:h("motion"),contentType:h("video/webm"),cached:v(),listUsd:i().optional().describe("List price charged for this delivered preview."),url:re(),urlExpiresAt:s()});var mi=S([li,ui]);var Vg=200,Ng=2e3,$g=200,Bg=0,_g=a({tsxSource:s().min(1),name:s().min(1).max(Vg),description:s().max(Ng),propSchema:M(s(),R()),origin:u(["customer-owned","server-native"]).optional(),ejectedFrom:s().max($g).optional(),tokens:M(s(),R()).optional(),examples:x(M(s(),R())).optional().describe("Usage examples, as authored. A built-in primitive projects {name, mood?, params?, description?}; an authored component's examples are whatever it wrote, which is why the item is open. One shape for both directions: what you write here is what you read back."),durationInFrames:i().gt(Bg).optional(),manifest:Te,id:s(),source:u(["default","installed"])}).describe("Installed component SOURCE (TSX) + ownership provenance per \xA7Components.");var qg=200,Ug=200,Wg=2e3,Gg=200,Hg=0,Kg=a({componentId:s().min(1).max(qg).optional().describe("Caller-chosen stable component id. On create it names the new component. On PUT/PATCH it is optional and, when present, must equal the id in the path; a mismatch is a 400 naming both."),tsxSource:s().min(1).optional(),name:s().min(1).max(Ug).optional(),description:s().max(Wg).optional(),category:u(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]).optional(),propSchema:M(s(),R()).optional(),origin:u(["customer-owned","server-native"]).optional(),ejectedFrom:s().max(Gg).optional(),tokens:M(s(),R()).optional(),examples:x(M(s(),R())).optional().describe("Usage examples, as authored. A built-in primitive projects {name, mood?, params?, description?}; an authored component's examples are whatever it wrote, which is why the item is open. One shape for both directions: what you write here is what you read back."),durationInFrames:i().gt(Hg).optional(),manifest:Te.optional()}).describe("PUT /components/:id body: every writable field, all optional; an omitted field is carried forward. Org/user are server-resolved; never accepted from the body.");var Jg=2e3,Xg=5,Zg=0,Yg=0,Qg=10,ey=-9007199254740991,ty=9007199254740991,oy=64,ry=3,sy=a({suggestionId:s().min(1).optional(),fromComposition:v().optional().describe("Reuse the project's current composition as the compose starting point (critique-retry path). The Director RE-AUTHORS graphics: if the current composition is client-authored and contains graphic clips (overlay/component/card), the request is refused (validation_error naming the clips) \u2014 render it verbatim with create_render instead. The director's own output (critique-retry) is exempt."),briefId:s().min(1).optional().describe("Compose from a persisted Brief (create_brief) \u2014 the intent-first door: every Brief field is HONORED or the request is refused loudly naming the field (window from beat moment-pinning; seeded graphics carried VERBATIM as locked clips; exclusions enforced; locale + caption emphasis threaded to the Director). Exactly ONE of suggestionId | fromComposition | briefId."),format:ee.optional().describe("Optional format override. Phase 2 ignores this \u2014 format precedence is project.compositionFormat \u2192 9:16 fhd 30fps default."),scope:R().optional().describe("RequestScope discriminated union (per compose-api-contract.md). Editor-only scopes (captions/overlay-track/broll/overlay-instance/segment) require an editor-session token; API tokens get 403 on those."),critique:s().max(Jg).optional().describe("Structured critique block (per compose-api-contract.md decision #11). Capped at 2KB total; per-criterion blocks capped at 500 chars."),parentJobId:s().optional().describe("Pointer to the prior compose job this run iterates on. Surfaced on the resulting compose job as baselineComposeJobId."),maxCandidates:y().min(1).max(Xg).optional().describe("Ensemble size. Currently pinned to 1 \u2014 the multi-candidate ensemble is disabled pending a capacity bound, so any value >1 is ignored and every compose runs a single candidate. Still accepted for forward-compat; will honor [1, 5] again once re-enabled."),budgetUsd:i().gt(Zg).optional().describe("Per-job budget cap (USD). Clamped at the route against the org's composeMaxBudgetUsdPerJob setting."),qualityThreshold:i().min(Yg).max(Qg).optional().describe("Composite-score accept threshold. Server default per contract."),seed:y().min(ey).max(ty).optional().describe("Deterministic seed for replay."),clientNonce:s().max(oy).optional().describe("Opaque caller token that disambiguates intentional same-critique retries. Without it, identical (project, sug, seed, critique) tuples deduplicate; with it, retries create a fresh execution."),holdAt:x(u(["content","layout","motion"])).max(ry).optional().describe("Opt-in checkpoint gates. Each named stage pauses the compose at its boundary (status \u2192 awaiting_input) for client review via resume. Absent/empty \u21D2 fully autonomous. Non-empty \u21D2 the run is a single spine.")}).describe("POST /projects/:id/compose body.");var ny=a({composeJobId:s().describe("Opaque compose job id; pass to the SSE stream URL."),projectId:s(),status:u(["queued","failed"]).describe("queued = normal; failed = startup failed and the job is already terminal (the SSE stream will emit a single `job_failed` frame and close)."),streamUrl:s().optional().describe("Relative SSE endpoint to stream this job's events (per compose-api-contract.md).")}).describe("POST /projects/:id/compose response.");var rQ=a({suggestionId:s().min(1),format:a({aspectRatio:u(["16:9","9:16","1:1","4:5"]),fps:S([h(24),h(25),h(30),h(60)]).optional(),resolution:u(["hd","fhd","4k"]).optional(),platform:s().optional()}).optional()});var iy=0,ay=9007199254740991,hi=a({mode:u(["advise","amend","explore"]),assessment:a({editorial:a({score:i(),grounding:u(["measured","judged"]),abstained:v(),reliability:i().optional()}),spatial:a({score:i(),grounding:u(["measured","judged"]),abstained:v(),reliability:i().optional()}),brand:a({score:i(),grounding:u(["measured","judged"]),abstained:v(),reliability:i().optional()}),caption:a({score:i(),grounding:u(["measured","judged"]),abstained:v(),reliability:i().optional()})}).optional().describe("Grounded critique of the CURRENT composition. Omitted for mode=advise."),proposals:x(a({label:s(),candidateIndex:y().min(iy).max(ay).optional().describe("Present for amend/explore \u2014 adopt via POST /compose/jobs/:jobId/select with this candidateIndex. Absent for advise."),changeSummary:x(s()).describe("Human-legible edit-pattern labels."),boundToEtag:s().optional().describe("The composition etag this proposal was computed against."),expectedDelta:M(s(),s()).optional().describe("Advisory per-criterion score lift; NOT authoritative pre-recalibration.")})),principles:x(s()).describe("Reusable, grounded lessons for the client's next authoring."),plan:R().optional().describe("Present for mode=advise \u2014 the planner agent's ComposePlan (framing/cuts/captions/graphics intents) as GUIDANCE. The client agent reads it and re-authors; it is NOT converted to ops."),checkpointId:s().optional().describe("The durable kind:'score' Checkpoint minted from this advisory (evidence convergence \u2014 get_checkpoint re-reads the envelope later). Stamped at the consult success terminal.")}).describe("The advisory envelope returned by a completed consult job (on ComposeJobDetailResponse.advisoryResult).");var cy=-9007199254740991,py=9007199254740991,dy=0,ly=9007199254740991,uy=-9007199254740991,my=9007199254740991,hy=a({composeJobId:s(),projectId:s(),status:u(["queued","running","awaiting_input","complete","failed","cancelled"]),error:s().nullable(),request:a({suggestionId:s().optional(),fromComposition:v().optional(),scope:R().optional(),critique:s().optional(),parentJobId:s().optional(),maxCandidates:y().min(cy).max(py).optional(),budgetUsd:i().optional(),qualityThreshold:i().optional()}),candidates:x(R()),winner:S([a({candidateIndex:y().min(dy).max(ly),compositionRunId:s()}),N()]),listUsd:i().optional(),startedAt:i(),completedAt:i().nullable(),advisoryResult:hi.optional(),checkpoint:a({checkpointId:s(),stage:u(["content","layout","motion"]),version:y().min(uy).max(my)}).optional()});var fi=a({composeJobId:s(),projectId:s(),status:u(["queued","running","awaiting_input","complete","failed","cancelled"]),suggestionId:s().optional(),createdAt:i(),completedAt:i().nullable()});var fy=a({jobs:x(fi)});var xy=0,gy=9007199254740991,yy=a({candidateIndex:y().min(xy).max(gy),selectStrategy:u(["agent-authoritative","editor-merge","editor-replace"]),ifMatch:s().optional()}).describe("POST /projects/:id/compose/jobs/:jobId/select body.");var by=0,Sy=9007199254740991,zy=a({newCompositionEtag:s(),mergeResult:a({replayedEdits:y().min(by).max(Sy),droppedEdits:x(a({trackId:s(),clipId:s().optional(),wordStartMs:i().optional(),reason:u(["target_removed","conflict"])}))}).optional()}).describe("POST /projects/:id/compose/jobs/:jobId/select response.");var wy=0,Cy=4,My=0,Ty=0,Ry=0,vy=0,Py=0,Iy=0,Oy=0,ky=4,Ey=0,Ay=0,Ly=0,Dy=0,Fy=0,jy=0,Vy=0,Ny=0,$y=0,By=1,_y=0,qy=1,Uy=.1,Wy=1,Gy=0,Hy=0,Ky=-.3,Jy=.3,Xy=-.3,Zy=.3,Yy=0,Qy=1,eb=0,tb=1,ob=-.3,rb=.3,sb=0,nb=1,ib=0,ab=-1,cb=2,pb=-1,db=2,lb=0,ub=1,mb=0,hb=1,fb=0,xb=1,gb=0,yb=1,bb=0,Sb=0,zb=2,wb=0,Cb=0,Mb=0,Tb=0,Rb=0,vb=0,Pb=15,Ib=100,Ob=900,kb=0,Eb=100,Ab=900,Lb=0,Db=0,Fb=0,jb=0,Vb=0,Nb=100,$b=0,Bb=0,_b=15,qb=100,Ub=900,Wb=0,Gb=100,Hb=900,Kb=0,Jb=0,Xb=0,Zb=0,Yb=0,Qb=100,Wo=a({v:h(1),format:a({aspectRatio:u(["16:9","9:16","1:1","4:5"]),fps:S([h(24),h(25),h(30),h(60)]).optional(),resolution:u(["hd","fhd","4k"]).optional(),platform:s().optional()}),tracks:x(a({id:s().min(1),kind:u(["video","audio","image","overlay","effect"]),name:s().optional(),enabled:v().optional(),volume:i().min(wy).max(Cy).optional(),contents:x(S([a({id:s().min(1),startTime:i().min(My).describe("Timeline start (seconds)."),duration:i().gt(Ty).describe("Clip duration (seconds)."),source:S([a({kind:h("media"),mediaId:s().min(1),trim:a({start:i().min(Ry).describe("Source trim start (seconds)."),end:i().min(vy).describe("Source trim end (seconds).")}).optional(),excludedRanges:x(a({start:i().min(Py),end:i().min(Iy),reason:s().optional()})).optional(),volume:i().min(Oy).max(ky).optional(),muted:v().optional(),playbackRate:i().gt(Ey).optional(),sync:u(["video","independent"]).optional(),kenBurns:u(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:i().optional(),fadeInMs:i().min(Ay).optional(),fadeOutMs:i().min(Ly).optional(),loop:v().optional(),audioRole:u(["sfx","music","vo","ambience"]).optional(),duck:a({duckDb:i().max(Dy),attackMs:i().min(Fy),releaseMs:i().min(jy),windows:x(a({startMs:i(),endMs:i()})).optional()}).optional(),anchor:a({clipId:s().min(1),offsetMs:i()}).optional(),reframe:a({segments:x(a({startSec:i().min(Vy).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(Ny).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:S([a({mode:h("frame-center")}),a({mode:h("point"),x:i().min($y).max(By),y:i().min(_y).max(qy)}),a({mode:h("face"),faceId:s().min(1),shotScale:u(["close","standard","wide"]).optional()}),a({mode:h("all-faces")}),a({mode:h("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:s().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(Uy).max(Wy).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:a({in:i().min(Gy).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(Hy).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:a({x:i().min(Ky).max(Jy).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(Xy).max(Zy).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),a({kind:h("component"),componentId:s().min(1),props:M(s(),R()),assets:M(s(),s().min(1)).optional(),zPlane:u(["front","behind-subject"]).optional()}),a({kind:h("overlay"),primitiveId:s().min(1),params:M(s(),R()),zPlane:u(["front","behind-subject"]).optional(),anchor:a({space:h("scene"),x:i().min(Yy).max(Qy),y:i().min(eb).max(tb)}).optional(),parallax:i().min(ob).max(rb).optional()}),a({kind:h("effect"),primitiveId:s().min(1),params:M(s(),R()).optional()}),a({kind:h("alpha-layer"),componentId:s().min(1),props:M(s(),R()),assets:M(s(),s().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:u(["front","behind-subject"]).optional()}),a({kind:h("card"),html:s().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),tokens:M(s(),s()).optional(),zPlane:h("front").optional()})]),kind:u(["video","audio","image","overlay","effect"]).optional(),opacity:i().min(sb).max(nb).optional(),scale:i().gt(ib).optional(),rotation:i().optional(),position:a({x:i().min(ab).max(cb),y:i().min(pb).max(db)}).optional().describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),region:a({x:i().min(lb).max(ub),y:i().min(mb).max(hb),w:i().gt(fb).max(xb),h:i().gt(gb).max(yb)}).optional(),fit:u(["cover","contain"]).optional(),effects:x(a({primitiveId:s().min(1),params:M(s(),R()).optional()})).optional(),transitionIn:a({type:s().min(1),duration:i().gt(bb)}).optional(),linkGroupId:s().min(1).optional(),animate:M(s(),x(a({time:i().min(Sb),value:i(),easing:S([u(["linear","ease","easeIn","easeOut","easeInOut"]),a({cubicBezier:D([i(),i(),i(),i()])})]).optional()})).min(zb)).optional().describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.")}),a({id:s().min(1),startTime:i().min(wb).describe("Timeline start (seconds)."),duration:i().gt(Cb).describe("Gap duration (seconds).")})]))})),markers:x(a({id:s().min(1),startTime:i().min(Mb),endTime:i().min(Tb).optional(),kind:s().min(1),name:s().optional(),metadata:M(s(),R()).optional()})).optional(),captions:S([a({source:h("derived"),from:a({clipId:s()}),segments:x(a({words:x(a({text:s().min(1),startMs:i().min(Rb).describe("Word start on the composition timeline, in milliseconds."),endMs:i().min(vb).describe("Word end on the composition timeline, in milliseconds."),emphasis:v().optional(),annotate:u(["circle","underline"]).optional()}))})),style:a({fontFamily:s().min(1).optional(),fontSize:i().min(1).max(Pb).optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),fontWeight:y().min(Ib).max(Ob).optional(),color:s().min(1).optional(),highlightColor:s().min(1).optional(),backgroundColor:s().optional(),plate:u(["glass","solid","none"]).optional(),position:u(["top","center","bottom"]).optional(),textTransform:u(["none","uppercase","capitalize"]).optional(),emphasisColor:s().optional(),emphasisGradient:s().optional(),emphasisScale:i().gt(kb).optional(),emphasisFontFamily:s().optional(),emphasisFontWeight:y().min(Eb).max(Ab).optional(),emphasisTextTransform:u(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:i().optional(),emphasisFontStyle:u(["normal","italic"]).optional(),entrance:u(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:i().min(Lb).optional(),entranceStaggerMs:i().min(Db).optional(),exitMs:i().min(Fb).optional(),emphasisPlate:v().optional(),emphasisPlateColor:s().optional(),emphasisPlateTextColor:s().optional(),emphasisPlateAltColor:s().optional(),emphasisPlateAltTextColor:s().optional(),emphasisPlateRadius:i().min(jb).optional(),emphasisPlatePadX:i().optional(),emphasisPlatePadY:i().optional(),annotationColor:s().optional(),maxWidthPercent:i().gt(Vb).max(Nb).optional()}).optional(),zPlane:u(["front","behind-subject"]).optional()}),a({source:h("authored"),segments:x(a({words:x(a({text:s().min(1),startMs:i().min($b).describe("Word start on the composition timeline, in milliseconds."),endMs:i().min(Bb).describe("Word end on the composition timeline, in milliseconds."),emphasis:v().optional(),annotate:u(["circle","underline"]).optional()}))})),style:a({fontFamily:s().min(1).optional(),fontSize:i().min(1).max(_b).optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),fontWeight:y().min(qb).max(Ub).optional(),color:s().min(1).optional(),highlightColor:s().min(1).optional(),backgroundColor:s().optional(),plate:u(["glass","solid","none"]).optional(),position:u(["top","center","bottom"]).optional(),textTransform:u(["none","uppercase","capitalize"]).optional(),emphasisColor:s().optional(),emphasisGradient:s().optional(),emphasisScale:i().gt(Wb).optional(),emphasisFontFamily:s().optional(),emphasisFontWeight:y().min(Gb).max(Hb).optional(),emphasisTextTransform:u(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:i().optional(),emphasisFontStyle:u(["normal","italic"]).optional(),entrance:u(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:i().min(Kb).optional(),entranceStaggerMs:i().min(Jb).optional(),exitMs:i().min(Xb).optional(),emphasisPlate:v().optional(),emphasisPlateColor:s().optional(),emphasisPlateTextColor:s().optional(),emphasisPlateAltColor:s().optional(),emphasisPlateAltTextColor:s().optional(),emphasisPlateRadius:i().min(Zb).optional(),emphasisPlatePadX:i().optional(),emphasisPlatePadY:i().optional(),annotationColor:s().optional(),maxWidthPercent:i().gt(Yb).max(Qb).optional()}).optional(),zPlane:u(["front","behind-subject"]).optional()})]).optional(),license:a({type:s().min(1),source:s().optional(),notes:s().optional()}).optional(),accessibility:a({audioDescriptionTrackId:s().optional(),captionsTrackId:s().optional(),signLanguageTrackId:s().optional(),notes:s().optional()}).optional()}).describe("Canonical composition wire shape (multi-track; carries reframe, captions, markers).");var Y=S([N(),v(),i(),s(),x(mo(()=>Y)),M(s(),mo(()=>Y))]);var eS=64,tS=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),oS=1,rS=0,sS=1,nS=0,iS=1,aS=200,cS=4e3,pS=0,dS=3.141592653589793,lS=64,uS=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),mS=0,hS=1,fS=0,xS=1,gS=0,yS=1,bS=0,SS=1,zS=0,wS=1,CS=2.333,MS=0,TS=1,RS=16,vS=64,PS=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),IS=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),OS=256,kS=new RegExp("^[a-f0-9]{64}$"),ES=0,AS=9007199254740991,LS=0,DS=9007199254740991,FS=0,jS=9007199254740991,VS=256,NS=0,$S=0,BS=9007199254740991,_S=0,qS=9007199254740991,US=64,WS=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),GS=1,HS=0,KS=1,JS=0,XS=1,ZS=80,YS=2e3,QS=64,ez=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),tz=0,oz=1,rz=0,sz=1,nz=0,iz=1,az=0,cz=1,pz=0,dz=1,lz=2.333,uz=0,mz=1,hz=16,fz=64,xz=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),gz=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),yz=256,bz=new RegExp("^[a-f0-9]{64}$"),Sz=0,zz=9007199254740991,wz=0,Cz=9007199254740991,Mz=0,Tz=9007199254740991,Rz=256,vz=0,Pz=0,Iz=9007199254740991,Oz=0,kz=9007199254740991,Ez=64,Az=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),Lz=1,Dz=0,Fz=1,jz=0,Vz=1,Nz=40,$z=8e3,Bz=40,_z=8e3,qz=32,Uz=4,Wz=200,Gz=32,Hz=0,Kz=15,Jz=0,Xz="satin",Zz=64,Yz=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),Qz=0,e0=1,t0=0,o0=1,r0=0,s0=1,n0=0,i0=1,a0=0,c0=1,p0=2.333,d0=0,l0=1,u0=16,m0=64,h0=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),f0=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),x0=256,g0=new RegExp("^[a-f0-9]{64}$"),y0=0,b0=9007199254740991,S0=0,z0=9007199254740991,w0=0,C0=9007199254740991,M0=256,T0=0,R0=0,v0=9007199254740991,P0=0,I0=9007199254740991,O0=64,k0=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),E0=1,A0=0,L0=1,D0=0,F0=1,j0=40,V0=8e3,N0=40,$0=8e3,B0="contain",_0="straight",q0=!0,U0="hidden",W0=64,G0=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),H0=0,K0=1,J0=0,X0=1,Z0=0,Y0=1,Q0=0,ew=1,tw=0,ow=1,rw=2.333,sw=0,nw=1,iw=16,aw=64,cw=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),pw=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),dw=256,lw=new RegExp("^[a-f0-9]{64}$"),uw=0,mw=9007199254740991,hw=0,fw=9007199254740991,xw=0,gw=9007199254740991,yw=256,bw=0,Sw=0,zw=9007199254740991,ww=0,Cw=9007199254740991,Mw=64,Tw=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),Rw=1,vw=0,Pw=1,Iw=512,Ow=new RegExp("^[^\\r\\n]+$"),kw=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),Ew=16,Aw=24,Lw=128,Dw=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),Fw=100,jw=900,Vw=8,Nw=800,$w=1.2,Bw=.6,_w=3,qw=0,Uw=-20,Ww=40,Gw="center",Hw=0,Kw=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),Jw=1,Xw=0,Zw=64,Yw=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),Qw=1,e1=0,t1=1,o1=512,r1=new RegExp("^[^\\r\\n]+$"),s1=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),n1=16,i1=24,a1=128,c1=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),p1=100,d1=900,l1=8,u1=800,m1=1.2,h1=.6,f1=3,x1=0,g1=-20,y1=40,b1="center",S1=0,z1=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),w1=0,C1=1,M1=0,xi=S([a({kind:h("laptop"),id:s().min(1).max(eS).regex(tS),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(rS).default(oS)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(nS).max(iS).default(sS),width:i().min(aS).max(cS),openAngle:i().min(pS).max(dS),materials:x(a({role:s().min(1).max(lS),type:u(["physical","unlit"]),color:S([s().regex(uS),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(mS).max(hS).optional(),metalness:i().min(fS).max(xS).optional(),clearcoat:i().min(gS).max(yS).optional(),clearcoatRoughness:i().min(bS).max(SS).optional(),anisotropy:i().min(zS).max(wS).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(CS).optional(),reflectivity:i().min(MS).max(TS).optional()})).max(RS).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(vS).regex(PS).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(IS),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(OS),sourceVersionId:s().regex(kS)}),captureFrame:y().min(ES).max(AS),layout:a({width:y().gt(LS).max(DS),height:y().gt(FS).max(jS)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(VS),startFrame:y().min($S).max(BS).default(NS),endFrame:y().gt(_S).max(qS).optional()})])).optional()}),a({kind:h("phone"),id:s().min(1).max(US).regex(WS),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(HS).default(GS)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(JS).max(XS).default(KS),width:i().min(ZS).max(YS),materials:x(a({role:s().min(1).max(QS),type:u(["physical","unlit"]),color:S([s().regex(ez),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(tz).max(oz).optional(),metalness:i().min(rz).max(sz).optional(),clearcoat:i().min(nz).max(iz).optional(),clearcoatRoughness:i().min(az).max(cz).optional(),anisotropy:i().min(pz).max(dz).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(lz).optional(),reflectivity:i().min(uz).max(mz).optional()})).max(hz).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(fz).regex(xz).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(gz),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(yz),sourceVersionId:s().regex(bz)}),captureFrame:y().min(Sz).max(zz),layout:a({width:y().gt(wz).max(Cz),height:y().gt(Mz).max(Tz)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(Rz),startFrame:y().min(Pz).max(Iz).default(vz),endFrame:y().gt(Oz).max(kz).optional()})])).optional()}),a({kind:h("slab"),id:s().min(1).max(Ez).regex(Az),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(Dz).default(Lz)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(jz).max(Vz).default(Fz),width:i().min(Nz).max($z),height:i().min(Bz).max(_z),thickness:i().min(Uz).max(Wz).default(qz),cornerRadius:i().min(Hz).default(Gz),edgeRadius:i().min(Jz).default(Kz),finish:u(["satin","brushed"]).default(Xz),materials:x(a({role:s().min(1).max(Zz),type:u(["physical","unlit"]),color:S([s().regex(Yz),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(Qz).max(e0).optional(),metalness:i().min(t0).max(o0).optional(),clearcoat:i().min(r0).max(s0).optional(),clearcoatRoughness:i().min(n0).max(i0).optional(),anisotropy:i().min(a0).max(c0).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(p0).optional(),reflectivity:i().min(d0).max(l0).optional()})).max(u0).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(m0).regex(h0).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(f0),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(x0),sourceVersionId:s().regex(g0)}),captureFrame:y().min(y0).max(b0),layout:a({width:y().gt(S0).max(z0),height:y().gt(w0).max(C0)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(M0),startFrame:y().min(R0).max(v0).default(T0),endFrame:y().gt(P0).max(I0).optional()})])).optional()}),a({kind:h("page"),id:s().min(1).max(O0).regex(k0),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(A0).default(E0)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(D0).max(F0).default(L0),width:i().min(j0).max(V0),height:i().min(N0).max($0),fit:u(["contain","cover"]).default(B0),transparency:u(["straight","premultiplied","opaque"]).default(_0),depthWrite:v().default(q0),backface:u(["hidden","visible"]).default(U0),materials:x(a({role:s().min(1).max(W0),type:u(["physical","unlit"]),color:S([s().regex(G0),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(H0).max(K0).optional(),metalness:i().min(J0).max(X0).optional(),clearcoat:i().min(Z0).max(Y0).optional(),clearcoatRoughness:i().min(Q0).max(ew).optional(),anisotropy:i().min(tw).max(ow).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(rw).optional(),reflectivity:i().min(sw).max(nw).optional()})).max(iw).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(aw).regex(cw).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(pw),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(dw),sourceVersionId:s().regex(lw)}),captureFrame:y().min(uw).max(mw),layout:a({width:y().gt(hw).max(fw),height:y().gt(xw).max(gw)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(yw),startFrame:y().min(Sw).max(zw).default(bw),endFrame:y().gt(ww).max(Cw).optional()})]))}),a({id:s().min(1).max(Mw).regex(Tw),kind:h("text"),opacity:i().min(vw).max(Pw).default(Rw),lines:x(a({runs:x(a({text:s().min(1).max(Iw).regex(Ow),color:S([s().regex(kw),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:v().optional()})).min(1).max(Ew)})).min(1).max(Aw),fontFamily:S([s().min(1).max(Lw).regex(Dw),u(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:y().min(Fw).max(jw),fontStyle:u(["normal","italic"]),fontSize:i().min(Vw).max(Nw),lineHeight:i().min(Bw).max(_w).default($w),letterSpacing:i().min(Uw).max(Ww).default(qw),align:u(["left","center","right"]).default(Gw),maxWidth:i().gt(Hw).optional(),color:S([s().regex(Kw),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:h("world"),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(Xw).default(Jw)}).default({position:[0,0,0],rotation:[0,0,0],scale:1})}),a({id:s().min(1).max(Zw).regex(Yw),kind:h("text"),opacity:i().min(e1).max(t1).default(Qw),lines:x(a({runs:x(a({text:s().min(1).max(o1).regex(r1),color:S([s().regex(s1),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:v().optional()})).min(1).max(n1)})).min(1).max(i1),fontFamily:S([s().min(1).max(a1).regex(c1),u(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:y().min(p1).max(d1),fontStyle:u(["normal","italic"]),fontSize:i().min(l1).max(u1),lineHeight:i().min(h1).max(f1).default(m1),letterSpacing:i().min(g1).max(y1).default(x1),align:u(["left","center","right"]).default(b1),maxWidth:i().gt(S1).optional(),color:S([s().regex(z1),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:h("screen"),x:i(),y:i(),rotation:i().default(w1),scale:i().gt(M1).default(C1)})]);var T1=64,R1=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),v1=1,P1=0,I1=1,O1=0,k1=1,E1=16,A1=64,L1=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),D1=1,F1=0,j1=1,V1=0,N1=1,$1=200,B1=4e3,_1=0,q1=3.141592653589793,U1=64,W1=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),G1=0,H1=1,K1=0,J1=1,X1=0,Z1=1,Y1=0,Q1=1,eC=0,tC=1,oC=2.333,rC=0,sC=1,nC=16,iC=64,aC=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),cC=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),pC=256,dC=new RegExp("^[a-f0-9]{64}$"),lC=0,uC=9007199254740991,mC=0,hC=9007199254740991,fC=0,xC=9007199254740991,gC=256,yC=0,bC=0,SC=9007199254740991,zC=0,wC=9007199254740991,CC=64,MC=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),TC=1,RC=0,vC=1,PC=0,IC=1,OC=80,kC=2e3,EC=64,AC=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),LC=0,DC=1,FC=0,jC=1,VC=0,NC=1,$C=0,BC=1,_C=0,qC=1,UC=2.333,WC=0,GC=1,HC=16,KC=64,JC=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),XC=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),ZC=256,YC=new RegExp("^[a-f0-9]{64}$"),QC=0,eM=9007199254740991,tM=0,oM=9007199254740991,rM=0,sM=9007199254740991,nM=256,iM=0,aM=0,cM=9007199254740991,pM=0,dM=9007199254740991,lM=64,uM=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),mM=1,hM=0,fM=1,xM=0,gM=1,yM=40,bM=8e3,SM=40,zM=8e3,wM=32,CM=4,MM=200,TM=32,RM=0,vM=15,PM=0,IM="satin",OM=64,kM=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),EM=0,AM=1,LM=0,DM=1,FM=0,jM=1,VM=0,NM=1,$M=0,BM=1,_M=2.333,qM=0,UM=1,WM=16,GM=64,HM=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),KM=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),JM=256,XM=new RegExp("^[a-f0-9]{64}$"),ZM=0,YM=9007199254740991,QM=0,eT=9007199254740991,tT=0,oT=9007199254740991,rT=256,sT=0,nT=0,iT=9007199254740991,aT=0,cT=9007199254740991,pT=64,dT=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),lT=1,uT=0,mT=1,hT=0,fT=1,xT=40,gT=8e3,yT=40,bT=8e3,ST="contain",zT="straight",wT=!0,CT="hidden",MT=64,TT=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),RT=0,vT=1,PT=0,IT=1,OT=0,kT=1,ET=0,AT=1,LT=0,DT=1,FT=2.333,jT=0,VT=1,NT=16,$T=64,BT=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),_T=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),qT=256,UT=new RegExp("^[a-f0-9]{64}$"),WT=0,GT=9007199254740991,HT=0,KT=9007199254740991,JT=0,XT=9007199254740991,ZT=256,YT=0,QT=0,eR=9007199254740991,tR=0,oR=9007199254740991,rR=64,sR=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),nR=1,iR=0,aR=1,cR=512,pR=new RegExp("^[^\\r\\n]+$"),dR=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),lR=16,uR=24,mR=128,hR=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),fR=100,xR=900,gR=8,yR=800,bR=1.2,SR=.6,zR=3,wR=0,CR=-20,MR=40,TR="center",RR=0,vR=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),PR=1,IR=0,OR=64,kR=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),ER=1,AR=0,LR=1,DR=512,FR=new RegExp("^[^\\r\\n]+$"),jR=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),VR=16,NR=24,$R=128,BR=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),_R=100,qR=900,UR=8,WR=800,GR=1.2,HR=.6,KR=3,JR=0,XR=-20,ZR=40,YR="center",QR=0,ev=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),tv=0,ov=1,rv=0,gi=S([a({kind:h("group"),id:s().min(1).max(T1).regex(R1),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(P1).default(v1)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(O1).max(k1).default(I1),children:x(xi).min(1).max(E1)}),a({kind:h("laptop"),id:s().min(1).max(A1).regex(L1),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(F1).default(D1)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(V1).max(N1).default(j1),width:i().min($1).max(B1),openAngle:i().min(_1).max(q1),materials:x(a({role:s().min(1).max(U1),type:u(["physical","unlit"]),color:S([s().regex(W1),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(G1).max(H1).optional(),metalness:i().min(K1).max(J1).optional(),clearcoat:i().min(X1).max(Z1).optional(),clearcoatRoughness:i().min(Y1).max(Q1).optional(),anisotropy:i().min(eC).max(tC).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(oC).optional(),reflectivity:i().min(rC).max(sC).optional()})).max(nC).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(iC).regex(aC).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(cC),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(pC),sourceVersionId:s().regex(dC)}),captureFrame:y().min(lC).max(uC),layout:a({width:y().gt(mC).max(hC),height:y().gt(fC).max(xC)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(gC),startFrame:y().min(bC).max(SC).default(yC),endFrame:y().gt(zC).max(wC).optional()})])).optional()}),a({kind:h("phone"),id:s().min(1).max(CC).regex(MC),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(RC).default(TC)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(PC).max(IC).default(vC),width:i().min(OC).max(kC),materials:x(a({role:s().min(1).max(EC),type:u(["physical","unlit"]),color:S([s().regex(AC),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(LC).max(DC).optional(),metalness:i().min(FC).max(jC).optional(),clearcoat:i().min(VC).max(NC).optional(),clearcoatRoughness:i().min($C).max(BC).optional(),anisotropy:i().min(_C).max(qC).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(UC).optional(),reflectivity:i().min(WC).max(GC).optional()})).max(HC).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(KC).regex(JC).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(XC),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(ZC),sourceVersionId:s().regex(YC)}),captureFrame:y().min(QC).max(eM),layout:a({width:y().gt(tM).max(oM),height:y().gt(rM).max(sM)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(nM),startFrame:y().min(aM).max(cM).default(iM),endFrame:y().gt(pM).max(dM).optional()})])).optional()}),a({kind:h("slab"),id:s().min(1).max(lM).regex(uM),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(hM).default(mM)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(xM).max(gM).default(fM),width:i().min(yM).max(bM),height:i().min(SM).max(zM),thickness:i().min(CM).max(MM).default(wM),cornerRadius:i().min(RM).default(TM),edgeRadius:i().min(PM).default(vM),finish:u(["satin","brushed"]).default(IM),materials:x(a({role:s().min(1).max(OM),type:u(["physical","unlit"]),color:S([s().regex(kM),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(EM).max(AM).optional(),metalness:i().min(LM).max(DM).optional(),clearcoat:i().min(FM).max(jM).optional(),clearcoatRoughness:i().min(VM).max(NM).optional(),anisotropy:i().min($M).max(BM).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(_M).optional(),reflectivity:i().min(qM).max(UM).optional()})).max(WM).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(GM).regex(HM).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(KM),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(JM),sourceVersionId:s().regex(XM)}),captureFrame:y().min(ZM).max(YM),layout:a({width:y().gt(QM).max(eT),height:y().gt(tT).max(oT)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(rT),startFrame:y().min(nT).max(iT).default(sT),endFrame:y().gt(aT).max(cT).optional()})])).optional()}),a({kind:h("page"),id:s().min(1).max(pT).regex(dT),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(uT).default(lT)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(hT).max(fT).default(mT),width:i().min(xT).max(gT),height:i().min(yT).max(bT),fit:u(["contain","cover"]).default(ST),transparency:u(["straight","premultiplied","opaque"]).default(zT),depthWrite:v().default(wT),backface:u(["hidden","visible"]).default(CT),materials:x(a({role:s().min(1).max(MT),type:u(["physical","unlit"]),color:S([s().regex(TT),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(RT).max(vT).optional(),metalness:i().min(PT).max(IT).optional(),clearcoat:i().min(OT).max(kT).optional(),clearcoatRoughness:i().min(ET).max(AT).optional(),anisotropy:i().min(LT).max(DT).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(FT).optional(),reflectivity:i().min(jT).max(VT).optional()})).max(NT).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max($T).regex(BT).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(_T),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(qT),sourceVersionId:s().regex(UT)}),captureFrame:y().min(WT).max(GT),layout:a({width:y().gt(HT).max(KT),height:y().gt(JT).max(XT)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(ZT),startFrame:y().min(QT).max(eR).default(YT),endFrame:y().gt(tR).max(oR).optional()})]))}),a({id:s().min(1).max(rR).regex(sR),kind:h("text"),opacity:i().min(iR).max(aR).default(nR),lines:x(a({runs:x(a({text:s().min(1).max(cR).regex(pR),color:S([s().regex(dR),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:v().optional()})).min(1).max(lR)})).min(1).max(uR),fontFamily:S([s().min(1).max(mR).regex(hR),u(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:y().min(fR).max(xR),fontStyle:u(["normal","italic"]),fontSize:i().min(gR).max(yR),lineHeight:i().min(SR).max(zR).default(bR),letterSpacing:i().min(CR).max(MR).default(wR),align:u(["left","center","right"]).default(TR),maxWidth:i().gt(RR).optional(),color:S([s().regex(vR),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:h("world"),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(IR).default(PR)}).default({position:[0,0,0],rotation:[0,0,0],scale:1})}),a({id:s().min(1).max(OR).regex(kR),kind:h("text"),opacity:i().min(AR).max(LR).default(ER),lines:x(a({runs:x(a({text:s().min(1).max(DR).regex(FR),color:S([s().regex(jR),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:v().optional()})).min(1).max(VR)})).min(1).max(NR),fontFamily:S([s().min(1).max($R).regex(BR),u(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:y().min(_R).max(qR),fontStyle:u(["normal","italic"]),fontSize:i().min(UR).max(WR),lineHeight:i().min(HR).max(KR).default(GR),letterSpacing:i().min(XR).max(ZR).default(JR),align:u(["left","center","right"]).default(YR),maxWidth:i().gt(QR).optional(),color:S([s().regex(ev),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:h("screen"),x:i(),y:i(),rotation:i().default(tv),scale:i().gt(rv).default(ov)})]);var sv=64,nv=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),iv=1,av=0,cv=1,pv=0,dv=1,lv=16,uv=64,mv=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),hv=1,fv=0,xv=1,gv=0,yv=1,bv=200,Sv=4e3,zv=0,wv=3.141592653589793,Cv=64,Mv=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),Tv=0,Rv=1,vv=0,Pv=1,Iv=0,Ov=1,kv=0,Ev=1,Av=0,Lv=1,Dv=2.333,Fv=0,jv=1,Vv=16,Nv=64,$v=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),Bv=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),_v=256,qv=new RegExp("^[a-f0-9]{64}$"),Uv=0,Wv=9007199254740991,Gv=0,Hv=9007199254740991,Kv=0,Jv=9007199254740991,Xv=256,Zv=0,Yv=0,Qv=9007199254740991,eP=0,tP=9007199254740991,oP=64,rP=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),sP=1,nP=0,iP=1,aP=0,cP=1,pP=80,dP=2e3,lP=64,uP=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),mP=0,hP=1,fP=0,xP=1,gP=0,yP=1,bP=0,SP=1,zP=0,wP=1,CP=2.333,MP=0,TP=1,RP=16,vP=64,PP=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),IP=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),OP=256,kP=new RegExp("^[a-f0-9]{64}$"),EP=0,AP=9007199254740991,LP=0,DP=9007199254740991,FP=0,jP=9007199254740991,VP=256,NP=0,$P=0,BP=9007199254740991,_P=0,qP=9007199254740991,UP=64,WP=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),GP=1,HP=0,KP=1,JP=0,XP=1,ZP=40,YP=8e3,QP=40,eI=8e3,tI=32,oI=4,rI=200,sI=32,nI=0,iI=15,aI=0,cI="satin",pI=64,dI=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),lI=0,uI=1,mI=0,hI=1,fI=0,xI=1,gI=0,yI=1,bI=0,SI=1,zI=2.333,wI=0,CI=1,MI=16,TI=64,RI=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),vI=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),PI=256,II=new RegExp("^[a-f0-9]{64}$"),OI=0,kI=9007199254740991,EI=0,AI=9007199254740991,LI=0,DI=9007199254740991,FI=256,jI=0,VI=0,NI=9007199254740991,$I=0,BI=9007199254740991,_I=64,qI=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),UI=1,WI=0,GI=1,HI=0,KI=1,JI=40,XI=8e3,ZI=40,YI=8e3,QI="contain",e2="straight",t2=!0,o2="hidden",r2=64,s2=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),n2=0,i2=1,a2=0,c2=1,p2=0,d2=1,l2=0,u2=1,m2=0,h2=1,f2=2.333,x2=0,g2=1,y2=16,b2=64,S2=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),z2=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),w2=256,C2=new RegExp("^[a-f0-9]{64}$"),M2=0,T2=9007199254740991,R2=0,v2=9007199254740991,P2=0,I2=9007199254740991,O2=256,k2=0,E2=0,A2=9007199254740991,L2=0,D2=9007199254740991,F2=64,j2=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),V2=1,N2=0,$2=1,B2=512,_2=new RegExp("^[^\\r\\n]+$"),q2=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),U2=16,W2=24,G2=128,H2=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),K2=100,J2=900,X2=8,Z2=800,Y2=1.2,Q2=.6,eO=3,tO=0,oO=-20,rO=40,sO="center",nO=0,iO=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),aO=1,cO=0,pO=64,dO=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),lO=1,uO=0,mO=1,hO=512,fO=new RegExp("^[^\\r\\n]+$"),xO=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),gO=16,yO=24,bO=128,SO=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),zO=100,wO=900,CO=8,MO=800,TO=1.2,RO=.6,vO=3,PO=0,IO=-20,OO=40,kO="center",EO=0,AO=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),LO=0,DO=1,FO=0,yi=S([a({kind:h("group"),id:s().min(1).max(sv).regex(nv),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(av).default(iv)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(pv).max(dv).default(cv),children:x(gi).min(1).max(lv)}),a({kind:h("laptop"),id:s().min(1).max(uv).regex(mv),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(fv).default(hv)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(gv).max(yv).default(xv),width:i().min(bv).max(Sv),openAngle:i().min(zv).max(wv),materials:x(a({role:s().min(1).max(Cv),type:u(["physical","unlit"]),color:S([s().regex(Mv),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(Tv).max(Rv).optional(),metalness:i().min(vv).max(Pv).optional(),clearcoat:i().min(Iv).max(Ov).optional(),clearcoatRoughness:i().min(kv).max(Ev).optional(),anisotropy:i().min(Av).max(Lv).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(Dv).optional(),reflectivity:i().min(Fv).max(jv).optional()})).max(Vv).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(Nv).regex($v).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(Bv),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(_v),sourceVersionId:s().regex(qv)}),captureFrame:y().min(Uv).max(Wv),layout:a({width:y().gt(Gv).max(Hv),height:y().gt(Kv).max(Jv)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(Xv),startFrame:y().min(Yv).max(Qv).default(Zv),endFrame:y().gt(eP).max(tP).optional()})])).optional()}),a({kind:h("phone"),id:s().min(1).max(oP).regex(rP),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(nP).default(sP)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(aP).max(cP).default(iP),width:i().min(pP).max(dP),materials:x(a({role:s().min(1).max(lP),type:u(["physical","unlit"]),color:S([s().regex(uP),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(mP).max(hP).optional(),metalness:i().min(fP).max(xP).optional(),clearcoat:i().min(gP).max(yP).optional(),clearcoatRoughness:i().min(bP).max(SP).optional(),anisotropy:i().min(zP).max(wP).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(CP).optional(),reflectivity:i().min(MP).max(TP).optional()})).max(RP).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(vP).regex(PP).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(IP),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(OP),sourceVersionId:s().regex(kP)}),captureFrame:y().min(EP).max(AP),layout:a({width:y().gt(LP).max(DP),height:y().gt(FP).max(jP)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(VP),startFrame:y().min($P).max(BP).default(NP),endFrame:y().gt(_P).max(qP).optional()})])).optional()}),a({kind:h("slab"),id:s().min(1).max(UP).regex(WP),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(HP).default(GP)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(JP).max(XP).default(KP),width:i().min(ZP).max(YP),height:i().min(QP).max(eI),thickness:i().min(oI).max(rI).default(tI),cornerRadius:i().min(nI).default(sI),edgeRadius:i().min(aI).default(iI),finish:u(["satin","brushed"]).default(cI),materials:x(a({role:s().min(1).max(pI),type:u(["physical","unlit"]),color:S([s().regex(dI),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(lI).max(uI).optional(),metalness:i().min(mI).max(hI).optional(),clearcoat:i().min(fI).max(xI).optional(),clearcoatRoughness:i().min(gI).max(yI).optional(),anisotropy:i().min(bI).max(SI).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(zI).optional(),reflectivity:i().min(wI).max(CI).optional()})).max(MI).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(TI).regex(RI).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(vI),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(PI),sourceVersionId:s().regex(II)}),captureFrame:y().min(OI).max(kI),layout:a({width:y().gt(EI).max(AI),height:y().gt(LI).max(DI)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(FI),startFrame:y().min(VI).max(NI).default(jI),endFrame:y().gt($I).max(BI).optional()})])).optional()}),a({kind:h("page"),id:s().min(1).max(_I).regex(qI),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(WI).default(UI)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(HI).max(KI).default(GI),width:i().min(JI).max(XI),height:i().min(ZI).max(YI),fit:u(["contain","cover"]).default(QI),transparency:u(["straight","premultiplied","opaque"]).default(e2),depthWrite:v().default(t2),backface:u(["hidden","visible"]).default(o2),materials:x(a({role:s().min(1).max(r2),type:u(["physical","unlit"]),color:S([s().regex(s2),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(n2).max(i2).optional(),metalness:i().min(a2).max(c2).optional(),clearcoat:i().min(p2).max(d2).optional(),clearcoatRoughness:i().min(l2).max(u2).optional(),anisotropy:i().min(m2).max(h2).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(f2).optional(),reflectivity:i().min(x2).max(g2).optional()})).max(y2).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(b2).regex(S2).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(z2),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(w2),sourceVersionId:s().regex(C2)}),captureFrame:y().min(M2).max(T2),layout:a({width:y().gt(R2).max(v2),height:y().gt(P2).max(I2)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(O2),startFrame:y().min(E2).max(A2).default(k2),endFrame:y().gt(L2).max(D2).optional()})]))}),a({id:s().min(1).max(F2).regex(j2),kind:h("text"),opacity:i().min(N2).max($2).default(V2),lines:x(a({runs:x(a({text:s().min(1).max(B2).regex(_2),color:S([s().regex(q2),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:v().optional()})).min(1).max(U2)})).min(1).max(W2),fontFamily:S([s().min(1).max(G2).regex(H2),u(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:y().min(K2).max(J2),fontStyle:u(["normal","italic"]),fontSize:i().min(X2).max(Z2),lineHeight:i().min(Q2).max(eO).default(Y2),letterSpacing:i().min(oO).max(rO).default(tO),align:u(["left","center","right"]).default(sO),maxWidth:i().gt(nO).optional(),color:S([s().regex(iO),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:h("world"),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(cO).default(aO)}).default({position:[0,0,0],rotation:[0,0,0],scale:1})}),a({id:s().min(1).max(pO).regex(dO),kind:h("text"),opacity:i().min(uO).max(mO).default(lO),lines:x(a({runs:x(a({text:s().min(1).max(hO).regex(fO),color:S([s().regex(xO),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:v().optional()})).min(1).max(gO)})).min(1).max(yO),fontFamily:S([s().min(1).max(bO).regex(SO),u(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:y().min(zO).max(wO),fontStyle:u(["normal","italic"]),fontSize:i().min(CO).max(MO),lineHeight:i().min(RO).max(vO).default(TO),letterSpacing:i().min(IO).max(OO).default(PO),align:u(["left","center","right"]).default(kO),maxWidth:i().gt(EO).optional(),color:S([s().regex(AO),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:h("screen"),x:i(),y:i(),rotation:i().default(LO),scale:i().gt(FO).default(DO)})]);var jO=64,VO=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),NO=1,$O=0,BO=1,_O=0,qO=1,UO=16,WO=64,GO=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),HO=1,KO=0,JO=1,XO=0,ZO=1,YO=200,QO=4e3,ek=0,tk=3.141592653589793,ok=64,rk=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),sk=0,nk=1,ik=0,ak=1,ck=0,pk=1,dk=0,lk=1,uk=0,mk=1,hk=2.333,fk=0,xk=1,gk=16,yk=64,bk=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),Sk=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),zk=256,wk=new RegExp("^[a-f0-9]{64}$"),Ck=0,Mk=9007199254740991,Tk=0,Rk=9007199254740991,vk=0,Pk=9007199254740991,Ik=256,Ok=0,kk=0,Ek=9007199254740991,Ak=0,Lk=9007199254740991,Dk=64,Fk=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),jk=1,Vk=0,Nk=1,$k=0,Bk=1,_k=80,qk=2e3,Uk=64,Wk=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),Gk=0,Hk=1,Kk=0,Jk=1,Xk=0,Zk=1,Yk=0,Qk=1,eE=0,tE=1,oE=2.333,rE=0,sE=1,nE=16,iE=64,aE=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),cE=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),pE=256,dE=new RegExp("^[a-f0-9]{64}$"),lE=0,uE=9007199254740991,mE=0,hE=9007199254740991,fE=0,xE=9007199254740991,gE=256,yE=0,bE=0,SE=9007199254740991,zE=0,wE=9007199254740991,CE=64,ME=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),TE=1,RE=0,vE=1,PE=0,IE=1,OE=40,kE=8e3,EE=40,AE=8e3,LE=32,DE=4,FE=200,jE=32,VE=0,NE=15,$E=0,BE="satin",_E=64,qE=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),UE=0,WE=1,GE=0,HE=1,KE=0,JE=1,XE=0,ZE=1,YE=0,QE=1,eA=2.333,tA=0,oA=1,rA=16,sA=64,nA=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),iA=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),aA=256,cA=new RegExp("^[a-f0-9]{64}$"),pA=0,dA=9007199254740991,lA=0,uA=9007199254740991,mA=0,hA=9007199254740991,fA=256,xA=0,gA=0,yA=9007199254740991,bA=0,SA=9007199254740991,zA=64,wA=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),CA=1,MA=0,TA=1,RA=0,vA=1,PA=40,IA=8e3,OA=40,kA=8e3,EA="contain",AA="straight",LA=!0,DA="hidden",FA=64,jA=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),VA=0,NA=1,$A=0,BA=1,_A=0,qA=1,UA=0,WA=1,GA=0,HA=1,KA=2.333,JA=0,XA=1,ZA=16,YA=64,QA=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),eL=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),tL=256,oL=new RegExp("^[a-f0-9]{64}$"),rL=0,sL=9007199254740991,nL=0,iL=9007199254740991,aL=0,cL=9007199254740991,pL=256,dL=0,lL=0,uL=9007199254740991,mL=0,hL=9007199254740991,fL=64,xL=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),gL=1,yL=0,bL=1,SL=512,zL=new RegExp("^[^\\r\\n]+$"),wL=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),CL=16,ML=24,TL=128,RL=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),vL=100,PL=900,IL=8,OL=800,kL=1.2,EL=.6,AL=3,LL=0,DL=-20,FL=40,jL="center",VL=0,NL=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),$L=1,BL=0,_L=64,qL=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),UL=1,WL=0,GL=1,HL=512,KL=new RegExp("^[^\\r\\n]+$"),JL=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),XL=16,ZL=24,YL=128,QL=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),eD=100,tD=900,oD=8,rD=800,sD=1.2,nD=.6,iD=3,aD=0,cD=-20,pD=40,dD="center",lD=0,uD=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),mD=0,hD=1,fD=0,bi=S([a({kind:h("group"),id:s().min(1).max(jO).regex(VO),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt($O).default(NO)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(_O).max(qO).default(BO),children:x(yi).min(1).max(UO)}),a({kind:h("laptop"),id:s().min(1).max(WO).regex(GO),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(KO).default(HO)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(XO).max(ZO).default(JO),width:i().min(YO).max(QO),openAngle:i().min(ek).max(tk),materials:x(a({role:s().min(1).max(ok),type:u(["physical","unlit"]),color:S([s().regex(rk),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(sk).max(nk).optional(),metalness:i().min(ik).max(ak).optional(),clearcoat:i().min(ck).max(pk).optional(),clearcoatRoughness:i().min(dk).max(lk).optional(),anisotropy:i().min(uk).max(mk).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(hk).optional(),reflectivity:i().min(fk).max(xk).optional()})).max(gk).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(yk).regex(bk).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(Sk),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(zk),sourceVersionId:s().regex(wk)}),captureFrame:y().min(Ck).max(Mk),layout:a({width:y().gt(Tk).max(Rk),height:y().gt(vk).max(Pk)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(Ik),startFrame:y().min(kk).max(Ek).default(Ok),endFrame:y().gt(Ak).max(Lk).optional()})])).optional()}),a({kind:h("phone"),id:s().min(1).max(Dk).regex(Fk),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(Vk).default(jk)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min($k).max(Bk).default(Nk),width:i().min(_k).max(qk),materials:x(a({role:s().min(1).max(Uk),type:u(["physical","unlit"]),color:S([s().regex(Wk),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(Gk).max(Hk).optional(),metalness:i().min(Kk).max(Jk).optional(),clearcoat:i().min(Xk).max(Zk).optional(),clearcoatRoughness:i().min(Yk).max(Qk).optional(),anisotropy:i().min(eE).max(tE).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(oE).optional(),reflectivity:i().min(rE).max(sE).optional()})).max(nE).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(iE).regex(aE).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(cE),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(pE),sourceVersionId:s().regex(dE)}),captureFrame:y().min(lE).max(uE),layout:a({width:y().gt(mE).max(hE),height:y().gt(fE).max(xE)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(gE),startFrame:y().min(bE).max(SE).default(yE),endFrame:y().gt(zE).max(wE).optional()})])).optional()}),a({kind:h("slab"),id:s().min(1).max(CE).regex(ME),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(RE).default(TE)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(PE).max(IE).default(vE),width:i().min(OE).max(kE),height:i().min(EE).max(AE),thickness:i().min(DE).max(FE).default(LE),cornerRadius:i().min(VE).default(jE),edgeRadius:i().min($E).default(NE),finish:u(["satin","brushed"]).default(BE),materials:x(a({role:s().min(1).max(_E),type:u(["physical","unlit"]),color:S([s().regex(qE),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(UE).max(WE).optional(),metalness:i().min(GE).max(HE).optional(),clearcoat:i().min(KE).max(JE).optional(),clearcoatRoughness:i().min(XE).max(ZE).optional(),anisotropy:i().min(YE).max(QE).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(eA).optional(),reflectivity:i().min(tA).max(oA).optional()})).max(rA).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(sA).regex(nA).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(iA),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(aA),sourceVersionId:s().regex(cA)}),captureFrame:y().min(pA).max(dA),layout:a({width:y().gt(lA).max(uA),height:y().gt(mA).max(hA)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(fA),startFrame:y().min(gA).max(yA).default(xA),endFrame:y().gt(bA).max(SA).optional()})])).optional()}),a({kind:h("page"),id:s().min(1).max(zA).regex(wA),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(MA).default(CA)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(RA).max(vA).default(TA),width:i().min(PA).max(IA),height:i().min(OA).max(kA),fit:u(["contain","cover"]).default(EA),transparency:u(["straight","premultiplied","opaque"]).default(AA),depthWrite:v().default(LA),backface:u(["hidden","visible"]).default(DA),materials:x(a({role:s().min(1).max(FA),type:u(["physical","unlit"]),color:S([s().regex(jA),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(VA).max(NA).optional(),metalness:i().min($A).max(BA).optional(),clearcoat:i().min(_A).max(qA).optional(),clearcoatRoughness:i().min(UA).max(WA).optional(),anisotropy:i().min(GA).max(HA).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(KA).optional(),reflectivity:i().min(JA).max(XA).optional()})).max(ZA).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(YA).regex(QA).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(eL),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(tL),sourceVersionId:s().regex(oL)}),captureFrame:y().min(rL).max(sL),layout:a({width:y().gt(nL).max(iL),height:y().gt(aL).max(cL)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(pL),startFrame:y().min(lL).max(uL).default(dL),endFrame:y().gt(mL).max(hL).optional()})]))}),a({id:s().min(1).max(fL).regex(xL),kind:h("text"),opacity:i().min(yL).max(bL).default(gL),lines:x(a({runs:x(a({text:s().min(1).max(SL).regex(zL),color:S([s().regex(wL),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:v().optional()})).min(1).max(CL)})).min(1).max(ML),fontFamily:S([s().min(1).max(TL).regex(RL),u(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:y().min(vL).max(PL),fontStyle:u(["normal","italic"]),fontSize:i().min(IL).max(OL),lineHeight:i().min(EL).max(AL).default(kL),letterSpacing:i().min(DL).max(FL).default(LL),align:u(["left","center","right"]).default(jL),maxWidth:i().gt(VL).optional(),color:S([s().regex(NL),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:h("world"),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(BL).default($L)}).default({position:[0,0,0],rotation:[0,0,0],scale:1})}),a({id:s().min(1).max(_L).regex(qL),kind:h("text"),opacity:i().min(WL).max(GL).default(UL),lines:x(a({runs:x(a({text:s().min(1).max(HL).regex(KL),color:S([s().regex(JL),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:v().optional()})).min(1).max(XL)})).min(1).max(ZL),fontFamily:S([s().min(1).max(YL).regex(QL),u(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:y().min(eD).max(tD),fontStyle:u(["normal","italic"]),fontSize:i().min(oD).max(rD),lineHeight:i().min(nD).max(iD).default(sD),letterSpacing:i().min(cD).max(pD).default(aD),align:u(["left","center","right"]).default(dD),maxWidth:i().gt(lD).optional(),color:S([s().regex(uD),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:h("screen"),x:i(),y:i(),rotation:i().default(mD),scale:i().gt(fD).default(hD)})]);var xD=64,gD=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),yD=1,bD=0,SD=1,zD=0,wD=1,CD=16,MD=64,TD=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),RD=1,vD=0,PD=1,ID=0,OD=1,kD=200,ED=4e3,AD=0,LD=3.141592653589793,DD=64,FD=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),jD=0,VD=1,ND=0,$D=1,BD=0,_D=1,qD=0,UD=1,WD=0,GD=1,HD=2.333,KD=0,JD=1,XD=16,ZD=64,YD=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),QD=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),eF=256,tF=new RegExp("^[a-f0-9]{64}$"),oF=0,rF=9007199254740991,sF=0,nF=9007199254740991,iF=0,aF=9007199254740991,cF=256,pF=0,dF=0,lF=9007199254740991,uF=0,mF=9007199254740991,hF=64,fF=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),xF=1,gF=0,yF=1,bF=0,SF=1,zF=80,wF=2e3,CF=64,MF=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),TF=0,RF=1,vF=0,PF=1,IF=0,OF=1,kF=0,EF=1,AF=0,LF=1,DF=2.333,FF=0,jF=1,VF=16,NF=64,$F=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),BF=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),_F=256,qF=new RegExp("^[a-f0-9]{64}$"),UF=0,WF=9007199254740991,GF=0,HF=9007199254740991,KF=0,JF=9007199254740991,XF=256,ZF=0,YF=0,QF=9007199254740991,ej=0,tj=9007199254740991,oj=64,rj=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),sj=1,nj=0,ij=1,aj=0,cj=1,pj=40,dj=8e3,lj=40,uj=8e3,mj=32,hj=4,fj=200,xj=32,gj=0,yj=15,bj=0,Sj="satin",zj=64,wj=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),Cj=0,Mj=1,Tj=0,Rj=1,vj=0,Pj=1,Ij=0,Oj=1,kj=0,Ej=1,Aj=2.333,Lj=0,Dj=1,Fj=16,jj=64,Vj=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),Nj=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),$j=256,Bj=new RegExp("^[a-f0-9]{64}$"),_j=0,qj=9007199254740991,Uj=0,Wj=9007199254740991,Gj=0,Hj=9007199254740991,Kj=256,Jj=0,Xj=0,Zj=9007199254740991,Yj=0,Qj=9007199254740991,eV=64,tV=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),oV=1,rV=0,sV=1,nV=0,iV=1,aV=40,cV=8e3,pV=40,dV=8e3,lV="contain",uV="straight",mV=!0,hV="hidden",fV=64,xV=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),gV=0,yV=1,bV=0,SV=1,zV=0,wV=1,CV=0,MV=1,TV=0,RV=1,vV=2.333,PV=0,IV=1,OV=16,kV=64,EV=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),AV=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),LV=256,DV=new RegExp("^[a-f0-9]{64}$"),FV=0,jV=9007199254740991,VV=0,NV=9007199254740991,$V=0,BV=9007199254740991,_V=256,qV=0,UV=0,WV=9007199254740991,GV=0,HV=9007199254740991,KV=64,JV=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),XV=1,ZV=0,YV=1,QV=512,e9=new RegExp("^[^\\r\\n]+$"),t9=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),o9=16,r9=24,s9=128,n9=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),i9=100,a9=900,c9=8,p9=800,d9=1.2,l9=.6,u9=3,m9=0,h9=-20,f9=40,x9="center",g9=0,y9=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),b9=1,S9=0,z9=64,w9=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),C9=1,M9=0,T9=1,R9=512,v9=new RegExp("^[^\\r\\n]+$"),P9=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),I9=16,O9=24,k9=128,E9=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),A9=100,L9=900,D9=8,F9=800,j9=1.2,V9=.6,N9=3,$9=0,B9=-20,_9=40,q9="center",U9=0,W9=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),G9=0,H9=1,K9=0,Si=S([a({kind:h("group"),id:s().min(1).max(xD).regex(gD),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(bD).default(yD)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(zD).max(wD).default(SD),children:x(bi).min(1).max(CD)}),a({kind:h("laptop"),id:s().min(1).max(MD).regex(TD),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(vD).default(RD)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(ID).max(OD).default(PD),width:i().min(kD).max(ED),openAngle:i().min(AD).max(LD),materials:x(a({role:s().min(1).max(DD),type:u(["physical","unlit"]),color:S([s().regex(FD),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(jD).max(VD).optional(),metalness:i().min(ND).max($D).optional(),clearcoat:i().min(BD).max(_D).optional(),clearcoatRoughness:i().min(qD).max(UD).optional(),anisotropy:i().min(WD).max(GD).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(HD).optional(),reflectivity:i().min(KD).max(JD).optional()})).max(XD).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(ZD).regex(YD).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(QD),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(eF),sourceVersionId:s().regex(tF)}),captureFrame:y().min(oF).max(rF),layout:a({width:y().gt(sF).max(nF),height:y().gt(iF).max(aF)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(cF),startFrame:y().min(dF).max(lF).default(pF),endFrame:y().gt(uF).max(mF).optional()})])).optional()}),a({kind:h("phone"),id:s().min(1).max(hF).regex(fF),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(gF).default(xF)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(bF).max(SF).default(yF),width:i().min(zF).max(wF),materials:x(a({role:s().min(1).max(CF),type:u(["physical","unlit"]),color:S([s().regex(MF),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(TF).max(RF).optional(),metalness:i().min(vF).max(PF).optional(),clearcoat:i().min(IF).max(OF).optional(),clearcoatRoughness:i().min(kF).max(EF).optional(),anisotropy:i().min(AF).max(LF).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(DF).optional(),reflectivity:i().min(FF).max(jF).optional()})).max(VF).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(NF).regex($F).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(BF),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(_F),sourceVersionId:s().regex(qF)}),captureFrame:y().min(UF).max(WF),layout:a({width:y().gt(GF).max(HF),height:y().gt(KF).max(JF)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(XF),startFrame:y().min(YF).max(QF).default(ZF),endFrame:y().gt(ej).max(tj).optional()})])).optional()}),a({kind:h("slab"),id:s().min(1).max(oj).regex(rj),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(nj).default(sj)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(aj).max(cj).default(ij),width:i().min(pj).max(dj),height:i().min(lj).max(uj),thickness:i().min(hj).max(fj).default(mj),cornerRadius:i().min(gj).default(xj),edgeRadius:i().min(bj).default(yj),finish:u(["satin","brushed"]).default(Sj),materials:x(a({role:s().min(1).max(zj),type:u(["physical","unlit"]),color:S([s().regex(wj),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(Cj).max(Mj).optional(),metalness:i().min(Tj).max(Rj).optional(),clearcoat:i().min(vj).max(Pj).optional(),clearcoatRoughness:i().min(Ij).max(Oj).optional(),anisotropy:i().min(kj).max(Ej).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(Aj).optional(),reflectivity:i().min(Lj).max(Dj).optional()})).max(Fj).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(jj).regex(Vj).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(Nj),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max($j),sourceVersionId:s().regex(Bj)}),captureFrame:y().min(_j).max(qj),layout:a({width:y().gt(Uj).max(Wj),height:y().gt(Gj).max(Hj)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(Kj),startFrame:y().min(Xj).max(Zj).default(Jj),endFrame:y().gt(Yj).max(Qj).optional()})])).optional()}),a({kind:h("page"),id:s().min(1).max(eV).regex(tV),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(rV).default(oV)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(nV).max(iV).default(sV),width:i().min(aV).max(cV),height:i().min(pV).max(dV),fit:u(["contain","cover"]).default(lV),transparency:u(["straight","premultiplied","opaque"]).default(uV),depthWrite:v().default(mV),backface:u(["hidden","visible"]).default(hV),materials:x(a({role:s().min(1).max(fV),type:u(["physical","unlit"]),color:S([s().regex(xV),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(gV).max(yV).optional(),metalness:i().min(bV).max(SV).optional(),clearcoat:i().min(zV).max(wV).optional(),clearcoatRoughness:i().min(CV).max(MV).optional(),anisotropy:i().min(TV).max(RV).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(vV).optional(),reflectivity:i().min(PV).max(IV).optional()})).max(OV).optional(),surfaces:M(s(),S([a({source:h("image"),assetSlot:s().min(1).max(kV).regex(EV).describe("Image asset slot name bound by the clip assets map; never a URL.")}),a({source:h("color"),color:S([s().regex(AV),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({source:h("component"),component:a({version:h(1),componentId:s().min(1).max(LV),sourceVersionId:s().regex(DV)}),captureFrame:y().min(FV).max(jV),layout:a({width:y().gt(VV).max(NV),height:y().gt($V).max(BV)}),bakeScale:S([h(2),h(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:M(s(),Y).optional()}),a({source:h("video"),mediaId:s().min(1).max(_V),startFrame:y().min(UV).max(WV).default(qV),endFrame:y().gt(GV).max(HV).optional()})]))}),a({id:s().min(1).max(KV).regex(JV),kind:h("text"),opacity:i().min(ZV).max(YV).default(XV),lines:x(a({runs:x(a({text:s().min(1).max(QV).regex(e9),color:S([s().regex(t9),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:v().optional()})).min(1).max(o9)})).min(1).max(r9),fontFamily:S([s().min(1).max(s9).regex(n9),u(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:y().min(i9).max(a9),fontStyle:u(["normal","italic"]),fontSize:i().min(c9).max(p9),lineHeight:i().min(l9).max(u9).default(d9),letterSpacing:i().min(h9).max(f9).default(m9),align:u(["left","center","right"]).default(x9),maxWidth:i().gt(g9).optional(),color:S([s().regex(y9),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:h("world"),transform:a({position:D([i(),i(),i()]).default([0,0,0]),rotation:D([i(),i(),i()]).default([0,0,0]),scale:i().gt(S9).default(b9)}).default({position:[0,0,0],rotation:[0,0,0],scale:1})}),a({id:s().min(1).max(z9).regex(w9),kind:h("text"),opacity:i().min(M9).max(T9).default(C9),lines:x(a({runs:x(a({text:s().min(1).max(R9).regex(v9),color:S([s().regex(P9),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:v().optional()})).min(1).max(I9)})).min(1).max(O9),fontFamily:S([s().min(1).max(k9).regex(E9),u(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:y().min(A9).max(L9),fontStyle:u(["normal","italic"]),fontSize:i().min(D9).max(F9),lineHeight:i().min(V9).max(N9).default(j9),letterSpacing:i().min(B9).max(_9).default($9),align:u(["left","center","right"]).default(q9),maxWidth:i().gt(U9).optional(),color:S([s().regex(W9),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:h("screen"),x:i(),y:i(),rotation:i().default(G9),scale:i().gt(K9).default(H9)})]);var J9=16,X9=8192,Z9=16,Y9=8192,Q9=.3141592653589793,eN=1.3962634015954636,tN="studio",oN="soft",rN=1,sN=0,nN=-420,iN=.5,aN=0,cN=1,pN={lightingProfile:"studio",preset:"soft",intensity:1,floorY:-420,shadowOpacity:.5},dN=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),lN=0,uN=0,mN=1,hN=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),fN=2,xN=8,gN=0,yN=1,bN=0,SN=1,zN=0,wN=1,CN=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),MN=2,TN=8,RN={kind:"transparent"},vN=64,PN=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),IN=0,ON=1,kN=0,EN=1,AN=-4,LN=5,DN=0,FN=1,jN=-4,VN=5,NN=256,$N=[],BN=0,_N=0,qN=.5,UN=0,WN=0,GN=1,HN=0,KN=0,JN=0,XN=64,ZN=null,YN={grain:0,vignette:0,focus:null},QN=64,e4=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),t4=2,o4=0,r4=[],Go=a({version:h(2),referenceSize:a({width:y().min(J9).max(X9),height:y().min(Z9).max(Y9)}),camera:a({position:D([i(),i(),i()]).optional(),rotation:D([i(),i(),i()]).optional(),fov:i().min(Q9).max(eN).optional()}).optional(),environment:S([a({kind:h("studio").optional(),lightingProfile:u(["studio","studio-edge"]).default(tN),preset:u(["soft","key","rim"]).default(oN),intensity:i().min(sN).default(rN),floorY:i().default(nN),shadowOpacity:i().min(aN).max(cN).default(iN)}),a({kind:h("photographic-studio-v1")})]).default(pN),backdrop:S([a({kind:h("transparent")}),a({kind:h("solid"),color:S([s().regex(dN),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),a({kind:h("linear"),angle:i().default(lN),stops:x(a({at:i().min(uN).max(mN),color:S([s().regex(hN),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])})).min(fN).max(xN)}),a({kind:h("radial"),at:D([i().min(gN).max(yN),i().min(bN).max(SN)]).default([.5,.5]),stops:x(a({at:i().min(zN).max(wN),color:S([s().regex(CN),u(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])})).min(MN).max(TN)})]).default(RN),layers:x(Si).min(1),animation:x(a({target:S([a({kind:h("camera")}),a({kind:h("layer"),layerId:s().min(1).max(vN).regex(PN)}),a({kind:h("environment")}),a({kind:h("focus")})]),property:u(["positionX","positionY","positionZ","rotationX","rotationY","rotationZ","fov","scale","opacity","openAngle","x","y","rotation","intensity","distance","range","maxBlur"]),keyframes:x(a({at:i().min(IN).max(ON),value:i(),easing:S([a({kind:h("linear")}),a({kind:h("hold")}),a({kind:h("bezier"),x1:i().min(kN).max(EN),y1:i().min(AN).max(LN),x2:i().min(DN).max(FN),y2:i().min(jN).max(VN)})]).optional()})).min(1).max(NN)})).default($N),post:a({grain:i().min(_N).max(qN).default(BN),vignette:i().min(WN).max(GN).default(UN),focus:S([a({distance:i().gt(HN),range:i().gt(KN),maxBlur:i().min(JN).max(XN)}),N()]).default(ZN)}).default(YN),constraints:x(a({kind:h("minSeparation"),objects:x(s().min(1).max(QN).regex(e4)).min(t4),gap:i().gt(o4)})).default(r4)}).describe("A version-2 scene shot: a self-contained 3D world-object shot that scene.add / scene.update materializes into an ordinary component clip. The shot owns its layers, camera, lighting, backdrop and normalized local animation; the composition owns start, duration, ordering, cuts and transitions. Coordinates are REFERENCE PIXELS: origin at frame centre, +X right, +Y down, +Z toward the viewer. referenceSize must have the SAME aspect ratio as the composition format; mismatch fails instead of cropping. At equal aspect ratio the shot scales uniformly by outputWidth/referenceWidth. A segment's easing belongs to the keyframe it ARRIVES at; the first keyframe has no easing. Authoring limits: 32 layers, 4 devices, 16 distinct image slots, 256 keyframes per channel, 2048 keyframes per shot. Version 2 supports nested groups, procedural slab/page/phone/laptop objects, screen- and world-space text, admitted image/component/video surfaces, fixed photographic and generated studio environments, transparent/solid/linear/radial backdrops, constraints, focus, grain and vignette. Raw HTML, custom shader props, imported GLB models, arbitrary external HDR environments, skeletal animation and physics are refused with an exact field path.");var s4=0,Ho=a({type:u(["cut","fade","dissolve","wipe"]),duration:i().min(s4).optional()}).describe("Inter-scene transition.");var n4=0,i4=0,a4=0,c4=0,p4=0,d4=0,l4=0,u4=0,m4=0,h4=0,f4=0,x4=4,g4=0,y4=0,b4=0,S4=0,z4=0,w4=0,C4=0,M4=0,T4=0,R4=1,v4=0,P4=1,I4=.1,O4=1,k4=0,E4=0,A4=-.3,L4=.3,D4=-.3,F4=.3,j4=0,V4=1,N4=0,$4=1,B4=-.3,_4=.3,q4=0,U4=1,W4=0,G4=-1,H4=2,K4=-1,J4=2,X4=0,Z4=1,Y4=0,Q4=1,e$=0,t$=1,o$=0,r$=1,s$=0,n$=0,i$=2,a$=0,c$=0,p$=0,d$=0,l$=0,u$=0,m$=0,h$=4,f$=0,x$=0,g$=0,y$=0,b$=0,S$=0,z$=0,w$=0,C$=0,M$=1,T$=0,R$=1,v$=.1,P$=1,I$=0,O$=0,k$=-.3,E$=.3,A$=-.3,L$=.3,D$=0,F$=1,j$=0,V$=1,N$=-.3,$$=.3,B$=0,_$=1,q$=0,U$=-1,W$=2,G$=-1,H$=2,K$=0,J$=1,X$=0,Z$=1,Y$=0,Q$=1,e3=0,t3=1,o3=0,r3=0,s3=2,n3=0,i3=0,a3=0,c3=0,p3=0,d3=0,l3=0,u3=4,m3=0,h3=0,f3=0,x3=0,g3=0,y3=0,b3=0,S3=0,z3=0,w3=1,C3=0,M3=1,T3=.1,R3=1,v3=0,P3=0,I3=-.3,O3=.3,k3=-.3,E3=.3,A3=0,L3=1,D3=0,F3=1,j3=-.3,V3=.3,N3=0,$3=1,B3=0,_3=-1,q3=2,U3=-1,W3=2,G3=0,H3=1,K3=0,J3=1,X3=0,Z3=1,Y3=0,Q3=1,eB=0,tB=0,oB=2,rB=0,sB=0,nB=0,iB=0,aB=0,cB=0,pB=0,dB=1,lB=0,uB=1,mB=.1,hB=1,fB=0,xB=0,gB=-.3,yB=.3,bB=-.3,SB=.3,zB=15,wB=100,CB=900,MB=0,TB=100,RB=900,vB=0,PB=0,IB=0,OB=0,kB=0,EB=100,AB=0,LB=0,DB=15,FB=100,jB=900,VB=0,NB=100,$B=900,BB=0,_B=0,qB=0,UB=0,WB=0,GB=100,HB=0,KB=0,JB=0,XB=2e3,Ko=S([a({type:h("scene.add"),clipId:s(),trackId:s().optional(),newTrack:v().optional(),newTrackId:s().optional(),startTime:i().min(n4),duration:i().gt(i4),scene:Go,assets:M(s(),s()),transitionIn:Ho.optional()}).describe('Author a scene shot and place it on a dedicated overlay track. The host validates the scene, generates and registers an immutable wrapper component source, and emits the ordinary track/clip operations carrying `props.componentRef` \u2014 you edit a scene SPEC, never wrapper TSX or a source hash. Registration and the composition update are ONE undoable edit; a failure publishes nothing and leaves no clip pointing at an unresolved source. Pass EXACTLY ONE of `trackId` (an existing dedicated scene track) or `newTrack: true` (mint one). That track holds scene-shot clips and gaps only \u2014 no generic component/primitive/media clips in v1 \u2014 and existing generic overlay tracks are unaffected. Scene clips use front zPlane and full-frame placement: outer per-clip `region`, `position`, `scale`, `rotation`, `fit`, `effects`, `animate`, `params.transition`, `params.sequenceGroup` and internal fadeIn/fadeOut are REFUSED with a path, because the shot\'s own layer transforms are the single transform owner. TEXT: `space: "screen"` text is composed above the world result, stays fixed in the frame and stays sharp through focus; `space: "world"` text is rasterized into the 3D scene, moves with the camera and is occluded by geometry. Screenshots and world text are UNLIT and colour-managed so product UI colours are not tinted by the studio lighting, while device bodies are lit and cast shadows; an unlit surface still occludes. SCOPE GAP (pre-existing, neither closed nor changed by scene shots): global wrap effects \u2014 composition-level grades and camera effects \u2014 do not reach front-overlay clips, so they do not affect a scene shot. Author the look INSIDE the shot (`post.grain`, `post.vignette`, `post.focus`, `backdrop`, `environment`) instead. DISCOVERY: there is no built-in scene primitive to look up in list_catalog; the wrapper this operation registers appears afterwards as an ordinary INSTALLED component under the existing catalog rules. ASSETS: `assets` binds each slot name a layer references to a media id in the same project, and the slot\'s declared KIND decides what it admits \u2014 an image slot takes PNG, JPEG or WebP, a video slot MP4 or WebM. Binding the wrong kind is refused with the slot\'s path.'),a({type:h("scene.update"),clipId:s(),startTime:i().min(a4).optional(),duration:i().gt(c4).optional(),scene:Go.optional(),assets:M(s(),s()).optional(),transitionIn:Ho.optional()}).describe("Revise a scene shot in place by clip id. Send a replacement `scene` and/or `assets`; timing changes use the ordinary clip timing fields (`startTime`, `duration`, `transitionIn`). Omitted fields keep their persisted values and the MERGED result is re-validated as a whole, so a partial edit cannot leave the shot invalid. Changing only values or asset IDs updates props and bindings and REUSES the pinned source; changing the referenced SLOT SET regenerates the wrapper manifest and registers a new immutable source version atomically. Undo restores the source reference, spec, bindings and timing together. Topology, asset bindings, text content, font properties, device kind and colours are STATIC within a shot's animation \u2014 change them here (a revised spec) rather than trying to animate them. This is not a source trim or slip: a shortened or extended clip resamples the SAME normalized animation over its new duration, and trim/slip requests on generated animation are rejected rather than reinterpreted as media trims. In one batch, `scene.update` may target a shot added by an earlier `scene.add`. ASSETS: `assets` binds each slot name a layer references to a media id in the same project, and the slot's declared KIND decides what it admits \u2014 an image slot takes PNG, JPEG or WebP, a video slot MP4 or WebM. Binding the wrong kind is refused with the slot's path."),a({type:h("clip.add"),clip:a({id:s().min(1),startTime:i().min(p4).describe("Timeline start (seconds)."),duration:i().gt(d4).describe("Clip duration (seconds)."),source:S([a({kind:h("media"),mediaId:s().min(1),trim:a({start:i().min(l4).describe("Source trim start (seconds)."),end:i().min(u4).describe("Source trim end (seconds).")}).optional(),excludedRanges:x(a({start:i().min(m4),end:i().min(h4),reason:s().optional()})).optional(),volume:i().min(f4).max(x4).optional(),muted:v().optional(),playbackRate:i().gt(g4).optional(),sync:u(["video","independent"]).optional(),kenBurns:u(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:i().optional(),fadeInMs:i().min(y4).optional(),fadeOutMs:i().min(b4).optional(),loop:v().optional(),audioRole:u(["sfx","music","vo","ambience"]).optional(),duck:a({duckDb:i().max(S4),attackMs:i().min(z4),releaseMs:i().min(w4),windows:x(a({startMs:i(),endMs:i()})).optional()}).optional(),anchor:a({clipId:s().min(1),offsetMs:i()}).optional(),reframe:a({segments:x(a({startSec:i().min(C4).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(M4).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:S([a({mode:h("frame-center")}),a({mode:h("point"),x:i().min(T4).max(R4),y:i().min(v4).max(P4)}),a({mode:h("face"),faceId:s().min(1),shotScale:u(["close","standard","wide"]).optional()}),a({mode:h("all-faces")}),a({mode:h("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:s().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(I4).max(O4).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:a({in:i().min(k4).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(E4).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:a({x:i().min(A4).max(L4).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(D4).max(F4).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),a({kind:h("component"),componentId:s().min(1),props:M(s(),R()),assets:M(s(),s().min(1)).optional(),zPlane:u(["front","behind-subject"]).optional()}),a({kind:h("overlay"),primitiveId:s().min(1),params:M(s(),R()),zPlane:u(["front","behind-subject"]).optional(),anchor:a({space:h("scene"),x:i().min(j4).max(V4),y:i().min(N4).max($4)}).optional(),parallax:i().min(B4).max(_4).optional()}),a({kind:h("effect"),primitiveId:s().min(1),params:M(s(),R()).optional()}),a({kind:h("alpha-layer"),componentId:s().min(1),props:M(s(),R()),assets:M(s(),s().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:u(["front","behind-subject"]).optional()}),a({kind:h("card"),html:s().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),tokens:M(s(),s()).optional(),zPlane:h("front").optional()})]),kind:u(["video","audio","image","overlay","effect"]).optional(),opacity:i().min(q4).max(U4).optional(),scale:i().gt(W4).optional(),rotation:i().optional(),position:a({x:i().min(G4).max(H4),y:i().min(K4).max(J4)}).optional().describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),region:a({x:i().min(X4).max(Z4),y:i().min(Y4).max(Q4),w:i().gt(e$).max(t$),h:i().gt(o$).max(r$)}).optional(),fit:u(["cover","contain"]).optional(),effects:x(a({primitiveId:s().min(1),params:M(s(),R()).optional()})).optional(),transitionIn:a({type:s().min(1),duration:i().gt(s$)}).optional(),linkGroupId:s().min(1).optional(),animate:M(s(),x(a({time:i().min(n$),value:i(),easing:S([u(["linear","ease","easeIn","easeOut","easeInOut"]),a({cubicBezier:D([i(),i(),i(),i()])})]).optional()})).min(i$)).optional().describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.")}),trackId:s().optional(),newTrack:v().optional(),newTrackId:s().optional()}).describe("Add a clip to the timeline. The clip self-routes to a track by FAMILY (`clip.kind`, else derived from `source.kind`, else the target track) \u2014 a `media` clip MUST carry `kind` (video|audio|image) or a `trackId`, else it is rejected as ambiguous. `trackId` targets an existing SAME-family track; `newTrack:true` (with optional pinned `newTrackId`) creates a fresh track of that family."),a({type:h("clip.remove"),clipId:s()}).describe("Remove a clip by id (located across every track)."),a({type:h("clip.update"),clipId:s(),patch:a({id:s().min(1).optional(),startTime:i().min(a$).optional().describe("Timeline start (seconds)."),duration:i().gt(c$).optional().describe("Clip duration (seconds)."),source:S([a({kind:h("media"),mediaId:s().min(1),trim:a({start:i().min(p$).describe("Source trim start (seconds)."),end:i().min(d$).describe("Source trim end (seconds).")}).optional(),excludedRanges:x(a({start:i().min(l$),end:i().min(u$),reason:s().optional()})).optional(),volume:i().min(m$).max(h$).optional(),muted:v().optional(),playbackRate:i().gt(f$).optional(),sync:u(["video","independent"]).optional(),kenBurns:u(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:i().optional(),fadeInMs:i().min(x$).optional(),fadeOutMs:i().min(g$).optional(),loop:v().optional(),audioRole:u(["sfx","music","vo","ambience"]).optional(),duck:a({duckDb:i().max(y$),attackMs:i().min(b$),releaseMs:i().min(S$),windows:x(a({startMs:i(),endMs:i()})).optional()}).optional(),anchor:a({clipId:s().min(1),offsetMs:i()}).optional(),reframe:a({segments:x(a({startSec:i().min(z$).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(w$).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:S([a({mode:h("frame-center")}),a({mode:h("point"),x:i().min(C$).max(M$),y:i().min(T$).max(R$)}),a({mode:h("face"),faceId:s().min(1),shotScale:u(["close","standard","wide"]).optional()}),a({mode:h("all-faces")}),a({mode:h("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:s().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(v$).max(P$).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:a({in:i().min(I$).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(O$).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:a({x:i().min(k$).max(E$).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(A$).max(L$).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),a({kind:h("component"),componentId:s().min(1),props:M(s(),R()),assets:M(s(),s().min(1)).optional(),zPlane:u(["front","behind-subject"]).optional()}),a({kind:h("overlay"),primitiveId:s().min(1),params:M(s(),R()),zPlane:u(["front","behind-subject"]).optional(),anchor:a({space:h("scene"),x:i().min(D$).max(F$),y:i().min(j$).max(V$)}).optional(),parallax:i().min(N$).max($$).optional()}),a({kind:h("effect"),primitiveId:s().min(1),params:M(s(),R()).optional()}),a({kind:h("alpha-layer"),componentId:s().min(1),props:M(s(),R()),assets:M(s(),s().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:u(["front","behind-subject"]).optional()}),a({kind:h("card"),html:s().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),tokens:M(s(),s()).optional(),zPlane:h("front").optional()})]).optional(),kind:u(["video","audio","image","overlay","effect"]).optional(),opacity:i().min(B$).max(_$).optional(),scale:i().gt(q$).optional(),rotation:i().optional(),position:a({x:i().min(U$).max(W$),y:i().min(G$).max(H$)}).optional().describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),region:a({x:i().min(K$).max(J$),y:i().min(X$).max(Z$),w:i().gt(Y$).max(Q$),h:i().gt(e3).max(t3)}).optional(),fit:u(["cover","contain"]).optional(),effects:x(a({primitiveId:s().min(1),params:M(s(),R()).optional()})).optional(),transitionIn:a({type:s().min(1),duration:i().gt(o3)}).optional(),linkGroupId:s().min(1).optional(),animate:M(s(),x(a({time:i().min(r3),value:i(),easing:S([u(["linear","ease","easeIn","easeOut","easeInOut"]),a({cubicBezier:D([i(),i(),i(),i()])})]).optional()})).min(s3)).optional().describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.")})}).describe("Patch an existing clip by id (cross-family). The patch is a partial TimelineClip. NOTE: `source` is REPLACED wholesale \u2014 the patch merges at the top level only, so a partial `source` WIPES the source fields you omit. Patch the whole source object when changing it. (To change reframe/excluded ranges, prefer setCropIntents / addExcludedRange, not a source patch.)"),a({type:h("removeClipsByMediaId"),mediaId:s()}).describe("Remove EVERY clip sourced from a given mediaId (e.g. after deleting that media)."),a({type:h("loadOverlays"),clips:x(a({id:s().min(1),startTime:i().min(n3).describe("Timeline start (seconds)."),duration:i().gt(i3).describe("Clip duration (seconds)."),source:S([a({kind:h("media"),mediaId:s().min(1),trim:a({start:i().min(a3).describe("Source trim start (seconds)."),end:i().min(c3).describe("Source trim end (seconds).")}).optional(),excludedRanges:x(a({start:i().min(p3),end:i().min(d3),reason:s().optional()})).optional(),volume:i().min(l3).max(u3).optional(),muted:v().optional(),playbackRate:i().gt(m3).optional(),sync:u(["video","independent"]).optional(),kenBurns:u(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:i().optional(),fadeInMs:i().min(h3).optional(),fadeOutMs:i().min(f3).optional(),loop:v().optional(),audioRole:u(["sfx","music","vo","ambience"]).optional(),duck:a({duckDb:i().max(x3),attackMs:i().min(g3),releaseMs:i().min(y3),windows:x(a({startMs:i(),endMs:i()})).optional()}).optional(),anchor:a({clipId:s().min(1),offsetMs:i()}).optional(),reframe:a({segments:x(a({startSec:i().min(b3).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(S3).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:S([a({mode:h("frame-center")}),a({mode:h("point"),x:i().min(z3).max(w3),y:i().min(C3).max(M3)}),a({mode:h("face"),faceId:s().min(1),shotScale:u(["close","standard","wide"]).optional()}),a({mode:h("all-faces")}),a({mode:h("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:s().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(T3).max(R3).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:a({in:i().min(v3).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(P3).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:a({x:i().min(I3).max(O3).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(k3).max(E3).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),a({kind:h("component"),componentId:s().min(1),props:M(s(),R()),assets:M(s(),s().min(1)).optional(),zPlane:u(["front","behind-subject"]).optional()}),a({kind:h("overlay"),primitiveId:s().min(1),params:M(s(),R()),zPlane:u(["front","behind-subject"]).optional(),anchor:a({space:h("scene"),x:i().min(A3).max(L3),y:i().min(D3).max(F3)}).optional(),parallax:i().min(j3).max(V3).optional()}),a({kind:h("effect"),primitiveId:s().min(1),params:M(s(),R()).optional()}),a({kind:h("alpha-layer"),componentId:s().min(1),props:M(s(),R()),assets:M(s(),s().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:u(["front","behind-subject"]).optional()}),a({kind:h("card"),html:s().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),tokens:M(s(),s()).optional(),zPlane:h("front").optional()})]),kind:u(["video","audio","image","overlay","effect"]).optional(),opacity:i().min(N3).max($3).optional(),scale:i().gt(B3).optional(),rotation:i().optional(),position:a({x:i().min(_3).max(q3),y:i().min(U3).max(W3)}).optional().describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),region:a({x:i().min(G3).max(H3),y:i().min(K3).max(J3),w:i().gt(X3).max(Z3),h:i().gt(Y3).max(Q3)}).optional(),fit:u(["cover","contain"]).optional(),effects:x(a({primitiveId:s().min(1),params:M(s(),R()).optional()})).optional(),transitionIn:a({type:s().min(1),duration:i().gt(eB)}).optional(),linkGroupId:s().min(1).optional(),animate:M(s(),x(a({time:i().min(tB),value:i(),easing:S([u(["linear","ease","easeIn","easeOut","easeInOut"]),a({cubicBezier:D([i(),i(),i(),i()])})]).optional()})).min(oB)).optional().describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.")}))}).describe("Replace the overlay channel wholesale with the given clips (bulk set, not a merge)."),a({type:h("addMarker"),marker:a({id:s().min(1),startTime:i().min(rB),endTime:i().min(sB).optional(),kind:s().min(1),name:s().optional(),metadata:M(s(),R()).optional()})}).describe("Add a timeline marker (a named time point/range; carry extensions in `metadata`)."),a({type:h("removeMarker"),markerId:s()}).describe("Remove a marker by id."),a({type:h("updateMarker"),markerId:s(),updates:a({id:s().min(1).optional(),startTime:i().min(nB).optional(),endTime:i().min(iB).optional(),kind:s().min(1).optional(),name:s().optional(),metadata:M(s(),R()).optional()})}).describe("Patch a marker's fields by id (partial merge)."),a({type:h("setCropIntents"),clipId:s(),segments:S([x(a({startSec:i().min(aB).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(cB).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:S([a({mode:h("frame-center")}),a({mode:h("point"),x:i().min(pB).max(dB),y:i().min(lB).max(uB)}),a({mode:h("face"),faceId:s().min(1),shotScale:u(["close","standard","wide"]).optional()}),a({mode:h("all-faces")}),a({mode:h("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:s().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(mB).max(hB).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:a({in:i().min(fB).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(xB).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:a({x:i().min(gB).max(yB).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(bB).max(SB).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})),N()])}).describe("Set (or CLEAR, with `segments: null`) the camera/reframe channel on a MEDIA clip \u2014 the time-aligned source\u2192output viewport (focus, zoom, ease, bias). This is the PREFERRED way to author reframing; do NOT reframe via a whole-source `clip.update` patch. Segments tile the clip's duration."),a({type:h("setEffects"),clipId:s(),effects:x(a({primitiveId:s().min(1),params:M(s(),R()).optional()}))}).describe("Set (or CLEAR, with `effects: []`) a clip's EFFECT channel \u2014 the registered effect primitives stacked onto that clip, each `{ primitiveId, params? }`. WHOLESALE: the array REPLACES the clip's current effects, so send the full stack (read the clip first to add one). This is the ONLY way to change effects on an existing clip \u2014 do NOT reach for a `clip.update` patch, whose top-level merge is the source-clobbering footgun documented above."),a({type:h("setCaptionStyle"),style:a({fontFamily:s().min(1).optional(),fontSize:i().min(1).max(zB).optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),fontWeight:y().min(wB).max(CB).optional(),color:s().min(1).optional(),highlightColor:s().min(1).optional(),backgroundColor:s().optional(),plate:u(["glass","solid","none"]).optional(),position:u(["top","center","bottom"]).optional(),textTransform:u(["none","uppercase","capitalize"]).optional(),emphasisColor:s().optional(),emphasisGradient:s().optional(),emphasisScale:i().gt(MB).optional(),emphasisFontFamily:s().optional(),emphasisFontWeight:y().min(TB).max(RB).optional(),emphasisTextTransform:u(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:i().optional(),emphasisFontStyle:u(["normal","italic"]).optional(),entrance:u(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:i().min(vB).optional(),entranceStaggerMs:i().min(PB).optional(),exitMs:i().min(IB).optional(),emphasisPlate:v().optional(),emphasisPlateColor:s().optional(),emphasisPlateTextColor:s().optional(),emphasisPlateAltColor:s().optional(),emphasisPlateAltTextColor:s().optional(),emphasisPlateRadius:i().min(OB).optional(),emphasisPlatePadX:i().optional(),emphasisPlatePadY:i().optional(),annotationColor:s().optional(),maxWidthPercent:i().gt(kB).max(EB).optional()})}).describe("Merge style overrides (font/color/position/emphasis) onto the composition's caption layer. Partial \u2014 omitted fields keep their current value; creates the caption container if absent."),a({type:h("setCaptionDepth"),zPlane:u(["front","behind-subject"])}).describe("Set the caption compositing plane. Use `behind-subject` to place captions behind the segmented foreground subject; use `front` for conventional captions above all video layers."),a({type:h("setCaptions"),segments:x(a({words:x(a({text:s().min(1),startMs:i().min(AB).describe("Word start on the composition timeline, in milliseconds."),endMs:i().min(LB).describe("Word end on the composition timeline, in milliseconds."),emphasis:v().optional(),annotate:u(["circle","underline"]).optional()}))})),style:a({fontFamily:s().min(1).optional(),fontSize:i().min(1).max(DB).optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),fontWeight:y().min(FB).max(jB).optional(),color:s().min(1).optional(),highlightColor:s().min(1).optional(),backgroundColor:s().optional(),plate:u(["glass","solid","none"]).optional(),position:u(["top","center","bottom"]).optional(),textTransform:u(["none","uppercase","capitalize"]).optional(),emphasisColor:s().optional(),emphasisGradient:s().optional(),emphasisScale:i().gt(VB).optional(),emphasisFontFamily:s().optional(),emphasisFontWeight:y().min(NB).max($B).optional(),emphasisTextTransform:u(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:i().optional(),emphasisFontStyle:u(["normal","italic"]).optional(),entrance:u(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:i().min(BB).optional(),entranceStaggerMs:i().min(_B).optional(),exitMs:i().min(qB).optional(),emphasisPlate:v().optional(),emphasisPlateColor:s().optional(),emphasisPlateTextColor:s().optional(),emphasisPlateAltColor:s().optional(),emphasisPlateAltTextColor:s().optional(),emphasisPlateRadius:i().min(UB).optional(),emphasisPlatePadX:i().optional(),emphasisPlatePadY:i().optional(),annotationColor:s().optional(),maxWidthPercent:i().gt(WB).max(GB).optional()}).optional()}).describe("Replace the caption SEGMENTS wholesale \u2014 author the word-timed caption layer directly (each segment = one sentence/page of `words` with timeline-ms `startMs`/`endMs`, optional `emphasis`). This is how a client with its OWN word timings (e.g. a generated VO take) gets word-synced captions without a source transcript; the compose lane's transcript slice writes the same layer. `style`, when given, merges with setCaptionStyle semantics; an omitted style keeps the existing one. Renderer paginates within a segment and never pools words across two \u2014 keep segments sentence-bounded."),a({type:h("captions.fromTranscript"),mediaId:s().min(1),window:a({startSec:i().min(HB),endSec:i().gt(KB)}).optional()}).describe("Attach caption CONTENT from the media's cached transcript \u2014 no pasting words. ROUTE-MATERIALIZED like applyMotionPreset/materializeGrid: the server slices the word-timed transcript to `window` (source seconds; absent = the whole media), rebases times, sentence-splits into segments, and applies it as `setCaptions`. 422 media_no_transcript when the media has no transcript or no words in the window. For your OWN word timings use setCaptions directly."),a({type:h("applyMotionPreset"),clipId:s(),preset:s(),params:a({enterMs:i().optional(),exitMs:i().optional(),staggerMs:i().optional()}).optional()}).describe("Shell a STATIC `card` clip with a frame-driven MOTION preset \u2014 the public card-shelling op (the layout renders VERBATIM; only the container animates in/out). The server wraps the card in the chosen `preset` (fade-up / slide-in-left / slide-in-right / scale-pop / stagger-reveal), transpiles it, mints it as a LIVE component, and swaps the clip source to that component (the bakeless live lane \u2014 no box). `params` tunes timing (`enterMs`/`exitMs`, `staggerMs` for stagger-reveal). The target must be a static card (components already carry motion; library overlays already move); re-run overwrites idempotently ONLY while the target is still a card (an uncompilable shell); once shelled, the clip is a COMPONENT \u2014 to change its motion, remove and re-add the card, then re-shell. Honored under `dry_run` (validates preset + target without transpiling or persisting). ORDERING: the preset resolves its target against the PERSISTED composition \u2014 a card added in the SAME batch is not yet visible to it. Persist the clip.add batch first, then shell in a following call."),a({type:h("materializeGrid"),clipId:s(),grid:u(["beat","word","shot"]),maxMarkers:y().gt(JB).max(XB).optional()}).describe('Materialize a clip\'s SOURCE-media temporal GRID as timeline markers \u2014 the rhythm authority you cut to. `grid:"beat"` reads a MUSIC bed\'s beat map (get_media_context.beatGrid), `grid:"word"` the VO word onsets (wordGrid); each grid point is projected from media time to TIMELINE time through the clip\'s placement (startTime, trim, playbackRate, excludedRanges) and written as a `kind:"beat"|"word"` marker (`metadata.sourceClipId` set). Points outside the clip\'s visible window are skipped. Re-running REPLACES the prior markers from the same clip+grid (idempotent). Land cuts and transition MIDPOINTS on the markers (a 0.5s transition starts 0.25s before its marker). `maxMarkers` (default 500, ceiling 2000) \u2014 exceeding it fails loud with the count. `grid:"shot"` is not yet exposed (shot_grid_unavailable). The target must be a media clip; absent evidence fails loud (grid_unavailable) naming how to get it (declare audioRole:"music" at ingest / transcribe).'),a({type:h("setFormat"),format:a({aspectRatio:u(["16:9","9:16","1:1","4:5"]),fps:S([h(24),h(25),h(30),h(60)]).optional(),resolution:u(["hd","fhd","4k"]).optional()})}).describe("Set the output format \u2014 `aspectRatio` (16:9|9:16|1:1|4:5) plus optional `fps` and `resolution`. Merges: an omitted field keeps the current value."),a({type:h("addTrack"),kind:u(["video","audio","image","overlay","effect"]),name:s().optional(),id:s().optional()}).describe("Add an EMPTY track of a given family (video|audio|image|overlay|effect). Optional pinned `id`. The new track is appended, so it starts at the BACK: index 0 is the top layer and higher indices are further back (see `reorderTracks`). Track order only ranks clips on the same plane \u2014 every overlay draws above the video lane unless its `zPlane` is `behind-subject`, whatever its track index."),a({type:h("removeTrack"),trackId:s()}).describe("Remove a track AND all its clips by id."),a({type:h("updateTrack"),trackId:s(),updates:a({name:s().optional(),enabled:v().optional()})}).describe("Patch a track's `name` / `enabled` by id."),a({type:h("reorderTracks"),fromIndex:i(),toIndex:i()}).describe('Move a track from one index to another. ORDER: index 0 is the TOP layer, not the bottom \u2014 moving a backdrop to index 0 puts it in FRONT of everything and hides the composition. Higher index = further back. PRECEDENCE: track order decides compositing only among clips on the same plane. Overlays are composited in a lane ABOVE the video lane whatever their track index; the one exception is `zPlane:"behind-subject"`, which moves the overlay inside its host clip, behind the segmented foreground. So if reordering tracks does not change what you see, the plane split already decided it.'),a({type:h("moveClipToTrack"),clipId:s(),targetTrackId:s(),newStartTime:i().optional()}).describe("Move a clip to another SAME-family track, optionally at a new `newStartTime`."),a({type:h("duplicateClip"),clipId:s(),newClipId:s().optional()}).describe("Duplicate a clip by id. Pin `newClipId` to make the copy's id deterministic (required for a clean undo/inverse)."),a({type:h("cutAndRipple"),start:i(),end:i()}).describe("Server-authoritative: delete the [start,end] time window (seconds) and ripple every downstream clip/marker/caption earlier to close the gap."),a({type:h("ripple"),time:i(),amount:i()}).describe("Server-authoritative: shift everything at/after `time` (seconds) by `amount` seconds (+ opens a gap, \u2212 closes one)."),a({type:h("addExcludedRange"),clipId:s(),sourceStart:i(),sourceEnd:i(),reason:s().optional()}).describe("Server-authoritative: exclude a [sourceStart,sourceEnd] span (seconds) of a clip's SOURCE (an internal trim) and ripple downstream \u2014 the preferred way to drop a sub-range vs a source patch."),a({type:h("removeExcludedRange"),clipId:s(),rangeIdx:i()}).describe("Server-authoritative: remove a clip's previously-added excluded range by index (re-includes that span, ripples downstream).")]).describe("One scoped composition operation. Discriminated by `type` \u2014 `clip.add` / `clip.remove` / `clip.update` patch clips across any family; the rest cover markers, reframe, effects, captions, format, tracks, and the server-authoritative ripple recomputes. Every variant is `.strict()`: an unknown field is refused, not ignored.");var ZB=a({ops:x(Ko).min(1),if_match:s().optional().describe('Optional OCC precondition \u2014 the strong etag (`"<hex>"`) the caller last saw. On mismatch the batch is rejected (409 stale_etag) before any op applies.'),dry_run:v().optional().describe("When true, validate the batch (apply + projection accept/reject guards) WITHOUT persisting. Returns `{ valid, errors }` instead of applying."),composition_id:s().optional().describe("Target a SPECIFIC composition instead of the project's active one. Omit it and the project's active composition is edited, which is the default and the common case. `preview_frame` and `create_render` already accept a compositionId; this closes the gap so a second composition minted with `new_composition` can actually be authored into \u2014 build variant A, mint B, edit B, preview both. Mutually exclusive with `session_id`, which targets the session's scratch."),session_id:s().optional().describe("Optional compose-session id. When present, the ops target the session's SCRATCH composition (a derived sibling) instead of the project's active composition \u2014 the server never mutates active until commit.")}).describe("POST /projects/:id/composition/apply body \u2014 a batch of CompositionOps.");var YB=200,QB=a({name:s().min(1).max(YB).optional(),format:ee.optional()}).describe("POST /projects/:id/compositions body \u2014 create a new video (composition) in the project. `format` defaults to the project's compositionFormat when omitted.");var e_=0,t_=9007199254740991,zi=a({compositionId:s(),format:ee,etag:s(),isActive:v(),updatedAt:i(),sceneCount:y().min(e_).max(t_)}).describe("A composition in a project, flagging the active one.");var o_=a({data:x(zi)}).describe("GET /projects/:id/compositions response.");var r_=2e3,s_=a({intent:s().min(1).max(r_).describe("Plain-English goal \u2014 what you're trying to achieve with this edit."),mode:u(["advise","amend","explore"]).optional().describe("advise = proposer-only (no render/judge, no grounded assessment); amend (default) = grade the current composition + author the fix for the weakest criterion; explore = ranked slate of diverse directions. All modes are async \u2014 poll the returned job."),focus:u(["editorial","spatial","brand","caption"]).optional().describe("Optional criterion to concentrate the advice on."),ifMatch:s().optional().describe("Etag of the composition the advice is computed against. Proposals are bound to it; apply a proposal BEFORE any other edit or it will 409.")}).describe("POST /projects/:id/consult body.");var n_=a({consultJobId:s().describe("Opaque consult job id; poll it for the advisory result."),projectId:s(),status:u(["queued","failed"]).describe("queued = normal; failed = startup failed and the job is already terminal."),streamUrl:s().optional().describe("Relative SSE endpoint to stream this job's events.")}).describe("POST /projects/:id/consult response.");var wi=a({faceId:s(),bbox:a({x:i(),y:i(),width:i(),height:i()}),speakingShare:i().optional()});var Ci=a({detectorVersion:s().describe("Version of the face detector that produced this source-window roster."),window:a({startSec:i(),endSec:i()}),faces:x(wi)});var KQ=a({projectId:s().optional().describe("Optional project to scope the token to; omitted = org library.")});var XQ=a({projectId:s(),mediaId:s()});var i_=2048,QQ=a({videoUrl:re().max(i_),format:ee.optional()});var a_=0,c_=10,p_=6,d_=a({criticId:s().min(1).describe("Stable client id; re-registering the same id UPSERTS."),label:s().min(1),tier:u(["rules","rubric","evaluator"]),floor:i().min(a_).max(c_).optional().describe("Score below this routes a refine like a built-in criterion. Defaults to 6."),rules:x(M(s(),R())).optional().describe('tier "rules": declarative ClientRule[] (data).'),rubric:s().optional().describe('tier "rubric": your criterion + description; scored as an extra column.'),referenceMediaIds:x(s()).max(p_).optional().describe('tier "rubric"/"evaluator": up to 6 org media ids whose thumbnails the judge sees as YOUR reference standard \u2014 "looks like mine" becomes a machine check. Each must be an org-owned media item with a visual thumbnail (422 names any that is not).'),url:re().optional().describe('tier "evaluator": your HTTPS webhook; CueFrame POSTs the artifact.')}).describe("Register a custom compose critic.");var to=a({criticId:s(),label:s(),tier:u(["rules","rubric","evaluator"]),floor:i(),referenceMediaIds:x(s()).optional()}).describe("One registered critic (rubric/rules/url stay write-only \u2014 never echoed).");var l_=a({critics:x(to)});var u_=a({id:s(),criticId:s(),tier:u(["rules","rubric","evaluator"]),secret:s().optional().describe("evaluator tier: Standard-Webhooks signing secret, returned ONCE.")}).describe("POST /critics response (evaluator secret present exactly once).");var m_=a({fromCompositionId:s().min(1).describe("Source composition to reframe a sibling from."),targetFormat:ee.describe("The target output format (aspectRatio + optional fps/resolution) for the new sibling.")}).describe("Derive a reframed sibling composition for a new aspect (Auto-Reframe / Magic-Resize, agent-native).");var h_=a({compositionId:s().describe("The new sibling composition's id.")}).describe("POST /projects/:id/compositions/derive response.");var pee=a({error:a({code:s().describe("Stable machine-readable error code per \xA7Error Model."),message:s().describe("Human-readable message."),contract:s().describe("Contract version that produced this verdict. If it differs between two calls, the rules changed underneath you, not your request."),details:M(s(),R()).optional().describe("Optional context (currentEtag, projectIds, retryAfter, \u2026).")}).describe("Standard API error envelope.")}).describe("Error envelope used by every non-2xx response.");var Ye=a({kind:u(["transcript","subjectTrack","matte"]),intent:a({kind:u(["whole","window"]),window:a({startSec:i(),endSec:i()}).optional().describe("The SOURCE window this fact covers, when it is scoped to a clip.")}),status:u(["pending","ready","failed"]),summary:a({presenceFraction:i().optional().describe("Matte only: fraction of frames carrying a detected subject (0\u20131). Below 0.6 there is no reliable silhouette \u2014 the matte is delivered but cannot carry a behind-subject graphic, and is NOT charged."),faceCount:i().optional(),language:s().optional(),wordCount:i().optional(),durationSec:i().optional()}).optional(),charge:a({usd:i()}).optional().describe("What this fact was BILLED, in USD. Absent when it cost nothing: a compose/render side effect (already paid for inside that operation) or an unusable matte."),error:a({code:s(),message:s()}).optional(),readyAt:i().optional()}).describe("One derived fact about a media item \u2014 computed once, charged at most once.");var Qe=a({kind:u(["transcript","subjectTrack","matte"]),quotedUsd:i().describe("The server's price for this enhancement, in USD. Meaningful ONLY when `available` is true \u2014 an unavailable offer quotes 0 because there is nothing to price yet."),available:v(),reason:s().optional().describe("Why this cannot be bought right now. Present iff `available` is false. e.g. `media_not_ready` (the source has no known duration yet).")}).describe("A purchasable enhancement that this media item does not have yet.");var Mi=S([a({kind:u(["subjectTrack","matte"]),scope:a({startSec:i(),endSec:i()}),state:u(["pending","ready","failed"]),fact:Ye}),a({kind:u(["subjectTrack","matte"]),scope:a({startSec:i(),endSec:i()}),state:u(["available","unavailable"]),offer:Qe})]).describe("The server-selected fact or offer for one exact source window. Present when kind, startSec, and endSec are supplied; clients consume this instead of recreating the fact hash.");var f_=24,x_=a({count:y().min(1).max(f_),contentType:u(["image/jpeg","image/png"]).optional(),includeContactSheet:v().optional()}).describe("POST /brand-kits/exemplar-uploads body. Reserve presigned PUT slots for curated reference frames (\u2264720px recommended \u2014 they are vision input tokens downstream).");var g_=a({batchId:s(),uploads:x(a({key:s(),url:s()})),contactSheetUpload:a({key:s(),url:s()}).optional(),expiresAt:s()});var y_=a({clipSuggestionId:s().min(1)}).describe("POST /projects/:id/exports/{fcpxml,premiere} body.");var Ti=a({phase:u(["trim","build","upload","trigger"]),message:s(),detail:s().optional(),retryable:v()});var Ri=u(["fcpxml","premiere"]);var vi=u(["queued","trimming","building","uploading","complete","error","cancelled"]);var b_=0,S_=1,z_=a({id:s(),format:Ri,status:vi,progress:i().min(b_).max(S_).describe("Fractional progress 0..1 across the trim/build/upload pipeline. Reaches 1 only on `complete`."),outputUrl:s().nullable(),outputExpiresAt:s().nullable(),outputSizeBytes:i().nullable(),outputDurationSec:i().nullable(),error:S([Ti,N()]).describe("Set when status is `error`; null otherwise. The phase field localizes the failure to trim / build / upload / trigger."),trimCacheHit:v().nullable(),clipSuggestionId:s().nullable(),createdAt:s(),updatedAt:s()}).describe("NLE export job response.");var w_=a({url:re()}).describe("POST /brand-kits/extract body \u2014 the website URL to extract brand tokens from.");var Pi=a({colors:x(s()),fonts:x(s()),title:s().optional(),description:s().optional()}).describe("POST /brand-kits/extract response \u2014 extracted brand tokens (not persisted).");var C_=200,M_=0,T_=50,R_=a({query:s().min(1).max(C_),perPage:y().gt(M_).max(T_).optional()}).describe("POST /fonts/search body.");var v_=a({results:x(a({family:s(),category:s().optional(),variants:x(s()).optional(),cssUrl:s().optional(),previewText:s().optional()}))}).describe("POST /fonts/search response.");var Oee=a({composition:R()});var Eee=a({compositionId:s().optional()});var P_=0,I_=0,O_=20,k_=100,Lee=a({after:y().min(P_).optional(),before:y().min(I_).optional(),limit:y().min(1).max(k_).default(O_)});var Fee=qe({});var E_=100,A_=-9007199254740991,L_=9007199254740991,D_=-9007199254740991,F_=9007199254740991,Vee=a({limit:y().min(1).max(E_).optional(),after:s().optional(),projectId:s().optional(),jobId:s().optional(),from:y().min(A_).max(L_).optional(),to:y().min(D_).max(F_).optional()});var $ee=a({deep:h("1").optional()});var j_=a({status:u(["ok","degraded"]),version:s(),checks:M(s(),a({ok:v(),detail:s().optional()})).optional()}).describe("Health probe response.");var Ii=a({jobId:s().describe("Poll GET /v1/jobs/{jobId} / wait_job until terminal."),jobKey:s().describe("Deterministic identity of the work (content hash of every input the result depends on). Re-enqueueing the same key returns the same job while it runs; a failed key revives as a fresh attempt."),kind:s().describe("Job family, e.g. `verify` | `preview` | `brand_kit_extract`."),status:u(["running","succeeded","cancelled"]).describe("running on a fresh/deduped enqueue; succeeded when an identical request already completed. Cancelled is part of the shared status vocabulary; identical cancelled work revives to running.")});var V_=0,N_=9007199254740991,$_=0,B_=9007199254740991,Oi=a({geometry:a({scale:i(),compositionWidth:i().optional(),compositionHeight:i().optional(),width:i().optional(),height:i().optional()}),warnings:x(M(s(),R())).optional(),previewed:a({source:u(["inline","scratch","persisted"]),compositionId:s().optional(),etag:s().optional()}),listUsd:i().optional().describe("List price charged for this delivered capture."),artifacts:x(a({id:s(),beatSec:i(),bytes:y().gt(V_).max(N_),contentType:u(["image/png","image/jpeg"]),layers:a({video:s().nullable(),overlays:y().min($_).max(B_)}),url:re(),urlExpiresAt:s()}))});var ki=a({perCriterion:R(),composite:i(),critique:s(),checkpointId:s(),beats:R().optional(),clientScores:x(R()).optional(),listUsd:i().optional().describe("List price charged for this delivered evaluation.")});var __=a({id:s().describe("Job id \u2014 pass to GET /v1/jobs/{id} / wait_job."),jobKey:s().describe("Deterministic identity of the work (idempotency key, e.g. `verify-<sessionId>-<contentHash>` \u2014 the hash covers the composition AND grading inputs). Re-enqueueing the same key returns the same job while it runs."),kind:s().describe("Job family, e.g. `verify`."),status:u(["running","succeeded","failed","cancelled"]).describe("Poll until terminal (`succeeded` | `failed` | `cancelled`)."),progress:S([a({phase:s(),percent:i().optional(),message:s().optional()}),N()]).describe("Executor heartbeat while running; null when none reported."),result:S([S([Oi,mi,ki,Pi]),N()]).describe("Kind-specific payload when status is `succeeded`; null otherwise."),error:S([a({code:s(),message:s()}),N()]).describe("Stable failure code + human message when status is `failed`; null otherwise. `job_timeout` = the executor died mid-run and the stall sweep reaped the job \u2014 re-enqueue to retry."),createdAt:s(),updatedAt:s(),completedAt:s().nullable()});var Ei=a({mediaId:s().describe("The media item this moment belongs to \u2014 feed it to apply_composition as a clip source, or GET /v1/media/{id}/context for its faces/beat/word grids."),name:s().describe("The media item's name, so a result is readable without a second call."),score:i().describe("Cosine similarity between the query text and the chunk's frame, in [-1, 1]. Higher is closer. Compare scores WITHIN one response; absolute values are not calibrated across queries."),startSec:i().describe("Moment start, SECONDS from the media item's start."),endSec:i().describe("Moment end, SECONDS from the media item's start."),thumbUrl:s().nullable().describe("Presigned URL for the media item's thumbnail, or null when it has none. This is the ITEM's thumbnail, not a still of this moment \u2014 render a still of the exact range with preview_frame.")});var q_=a({results:x(Ei).describe("Matching moments, best first. Empty means nothing matched (when `indexing` is false) \u2014 the library was searched and came back empty-handed."),indexing:v().describe('TRUE when some of the org\'s footage is NOT in the visual index yet \u2014 media that predates it, or is still processing. This is COVERAGE, not emptiness: it can be true ALONGSIDE results, and then it means "these are the best moments among what we have looked at so far", not "these are the best moments". An empty `results` with `indexing: true` means "not looked at yet", NOT "no match" \u2014 re-run the media through processing (reprocess) to index it, then search again. FALSE with empty `results` is a real miss: the library was searched and nothing matched.')}).describe(`Semantic search over the org's OWN footage. The query is embedded with the same CLIP model that embedded every indexed frame, so a description of what you want to SEE ("wide shot of the speaker at a whiteboard") finds the moment even when nobody says those words.`);var U_=100,ete=a({limit:y().min(1).max(U_).optional(),after:s().optional()});var W_=100,ote=a({limit:y().min(1).max(W_).optional(),after:s().optional(),projectId:s().optional(),kind:u(["authored","clip","all"]).optional()});var G_=100,ste=a({category:u(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]).optional(),kind:u(["component","transition","scene"]).optional(),tier:u(["recommended","standard","niche"]).optional(),useCase:u(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"]).optional(),mood:s().optional(),q:s().optional(),intent:s().optional(),limit:y().min(1).max(G_).optional(),after:s().optional()});var H_=100,ite=a({limit:y().min(1).max(H_).optional(),after:s().optional(),composeJobId:s().optional(),projectId:s().optional()});var cte=a({kind:u(["subjectTrack","matte"]).optional(),startSec:i().optional(),endSec:i().optional()});var K_=100,dte=a({limit:y().min(1).max(K_).optional(),after:s().optional(),kind:u(["video","audio","image","gif","asset","source","stock"]).optional(),source:u(["upload","generated","import-url","stock"]).optional(),tag:s().optional()});var J_=100,ute=a({limit:y().min(1).max(J_).optional(),after:s().optional(),platform:s().optional(),format:s().optional(),topic:s().optional()});var X_=100,hte=a({limit:y().min(1).max(X_).optional(),after:s().optional(),status:s().optional()});var Z_=100,xte=a({limit:y().min(1).max(Z_).optional(),after:s().optional()});var yte=a({groupId:s().min(1)});var Y_=100,Ste=a({limit:y().min(1).max(Y_).optional(),after:s().optional()});var Q_=100,wte=a({limit:y().min(1).max(Q_).optional(),after:s().optional()});var e6=0,t6=0,o6=a({startSec:i().min(e6).describe("Source-in of the window to matte, in seconds into the underlying source."),endSec:i().gt(t6).describe("Source-out of the window to matte, in seconds into the underlying source.")}).describe("POST /media/:id/matte body. The window is REQUIRED and is the clip's SOURCE trim, not timeline time: a matte's cost scales with its duration, so there is no whole-source default to fall back on.");var r6=a({factId:s(),status:u(["pending","ready","failed"]),quotedUsd:i().describe("The server's price for this matte, in USD, quoted from the window duration."),alreadyExisted:v().describe("True when a matte for this exact window was already pending or ready. Nothing was dispatched and nothing will be charged.")}).describe("POST /media/:id/matte response \u2014 the claimed matte fact.");var Jo=a({mediaItemId:s(),language:s().nullable(),fullText:s(),utterances:x(M(s(),R())),data:x(M(s(),R())).optional(),pagination:oe.optional()}).describe("Transcript response.");var s6=a({mediaId:s(),durationSec:i().nullable(),width:i().nullable(),height:i().nullable(),thumbnail:S([a({url:s()}),N()]).describe("Presigned processing thumbnail (~1 week) \u2014 the footage at a glance. For stills at chosen timestamps, use preview_frame with a one-clip composition over this media."),faces:a({status:u(["ready","not_detected"]),windows:x(Ci)}),transcript:a({status:u(["ready","not_transcribed","unavailable"]),data:S([Jo,N()])}),beatGrid:S([a({bpm:i(),beatTimesMs:x(i()).describe("Beat onset times in MILLISECONDS \u2014 divide by 1000 for timeline startTime (composition timeline fields are seconds)."),confidence:i().describe("Rhythmic-periodicity strength (0\u20131). Trust the grid for cutting when high; a beatless bed reports low."),method:u(["requested-anchored","detected"]).describe("`requested-anchored` = phase-locked to a requested BPM (a generated bed whose prompt named a tempo); `detected` = full beat tracking (import/upload).")}),N()]).describe("The MUSIC-role rhythm grid (audio-substrate MVP). Present only for a music bed that carries a computed beat grid; null otherwise. For a music-driven film, cut on these beats (transition midpoints on beats, risers resolving on downbeats)."),wordGrid:S([a({wordTimesMs:x(i()).describe("Word onset times in MILLISECONDS, in order \u2014 divide by 1000 for timeline startTime (composition timeline fields are seconds).")}),N()]).describe("The VO-role rhythm grid: word onsets surfaced from the transcript (pure exposure). Present only when a transcript exists; null otherwise. For a VO-driven (narration) film, cut every beat boundary to the voice \u2014 the film-spine rule."),audioRole:S([u(["vo","music","sfx","ambience"]),N()]).describe("DECLARED audio role of this asset (audio-substrate P0): 'vo' (narration), 'music' (bed that ducks under speech), 'sfx' (one-shot hit), 'ambience' (a bed that HOLDS under VO \u2014 never ducks). Author the clip source's `audioRole` from this. Null for footage/images or an undeclared audio asset."),envelope:S([a({envelopeClass:u(["transient","sweep","ambient"]).describe("Coarse temporal shape: 'transient' (a sharp one-shot), 'sweep' (a bounded rise/fall over ~0.5\u20132s), 'ambient' (an unbounded bed)."),attackMs:i().optional(),spectralCentroidHz:i().optional(),meanVolumeDb:i().optional(),maxVolumeDb:i().optional()}),N()]).describe("Envelope evidence (audio-substrate P0). `envelopeClass` is always present when an envelope exists (the SFX pack carries it); the numeric probe stats are present only when an audio probe has run. Null when no envelope is stored."),facts:x(Ye).describe("Derived facts about this source (subject tracks, mattes): what has been computed, its status, and what it was billed. Same shape as GET /media/{id}/facts."),offers:x(Qe).describe("Enhancements this source does not have yet, with a server quote. Same shape as GET /media/{id}/facts. Mattes are quoted per-window via POST /media/{id}/matte, never here.")}).describe("Read-only authoring context for a source media item: detected face roster + transcript + the temporal grids (beat / word) an agent cuts to, the DECLARED audioRole + envelope of an audio asset, and the paid-enhancement block (facts already computed + offers for what is missing).");var n6=a({id:s(),uploadUrl:re(),expiresAt:s()}).describe("POST /media response: reserved media id + a presigned PUT URL. PUT the raw bytes to uploadUrl (\u2264 ~5 GiB), then POST /media/:id/finalize.");var i6=0,a6=0,c6=a({kind:u(["subjectTrack","matte"]).describe("Which enhancement to buy. `transcript` is NOT purchasable here \u2014 it is delivered by the transcription pipeline."),intent:a({startSec:i().min(i6),endSec:i().gt(a6)}).optional().describe("The SOURCE window. REQUIRED for `matte` (its cost scales with duration). OPTIONAL for `subjectTrack`: give a clip's source window to buy the track the render looks up for THAT clip, and pay only for its duration; omit it to detect the whole source.")}).describe("POST /media/:id/facts body.");var p6=a({factId:s(),status:u(["pending","ready","failed"]),quotedUsd:i(),alreadyExisted:v().describe("True when this exact fact was already pending or ready. Nothing was dispatched and nothing will be charged.")}).describe("POST /media/:id/facts response.");var d6=a({facts:x(Ye),offers:x(Qe).describe("What is NOT yet present and could be bought. A `matte` offer appears ONLY when the request carried `startSec`+`endSec` (the clip's SOURCE window) \u2014 a matte's price is a function of its duration, so there is no honest whole-source matte quote. `transcript` is never offered: it is produced by the ingest pipeline, not bought here."),exact:Mi.optional()}).describe("Facts and offers for a media item, plus an exact-window resolution when requested.");var l6=a({audioRole:u(["vo","music","sfx","ambience"]).optional().describe("Declared audio role: 'vo' (narration), 'music' (bed that ducks under speech), 'sfx' (one-shot hit), 'ambience' (a bed that HOLDS under VO \u2014 never ducks).")}).describe("POST /media/:id/finalize body \u2014 optional declared audioRole.");var u6=a({id:s(),status:u(["processing","complete"]),processingPhase:s()}).describe("POST /media/:id/finalize response: ingest triggered (audio/video \u2192 processing) or the item is immediately ready (image/asset \u2192 complete).");var m6=1e4,h6=a({generator:u(["text-to-video","text-to-image","image-to-video","text-to-music","text-to-speech","text-to-sfx","auto"]),prompt:s().min(1).max(m6),style:M(s(),R()).optional().describe("Free-form generation parameters, read per generator. All generators honor `aspect` (string) + `durationSec` (number) where applicable. text-to-speech honors `voice` (string; default voice when omitted), `speed` (number 0.7-1.2), `stability` (number 0-1), and `styleExaggeration` (number 0-1 \u2192 the endpoint's style exaggeration). Provider and model selection are server-owned and cannot be overridden."),refs:a({firstFrameMediaId:s().optional(),lastFrameMediaId:s().optional(),imageMediaIds:x(s()).optional()}).optional()}).describe("POST /media/generate body.");var f6=a({id:s(),status:h("generating"),estimateUsd:i().optional()}).describe("POST /media/generate response.");var x6=2048,g6=500,y6=0,b6=10737418240,S6=a({url:re().max(x6),filename:s().min(1).max(g6),contentType:u(["video/mp4","video/quicktime","video/x-matroska","video/webm","audio/mpeg","audio/wav","audio/x-wav","audio/mp4","audio/aac","image/png","image/jpeg","image/webp","image/gif","image/svg+xml","application/json","font/ttf","font/otf","font/woff","font/woff2"]),size:y().gt(y6).max(b6).optional(),audioRole:u(["vo","music","sfx","ambience"]).optional().describe("Declared audio role: 'vo' (narration), 'music' (bed that ducks under speech), 'sfx' (one-shot hit), 'ambience' (a bed that HOLDS under VO \u2014 never ducks).")}).describe("POST /media/import body.");var z6=a({id:s(),status:h("importing")}).describe("POST /media/import response.");var Ai=a({phase:u(["idle","pending_import","pending_upload","uploading","extracting","loading_model","transcribing","proxy","embedding","analyzing","indexing","generating","rendering","processing","complete","error","cancelled"]),percent:i().nullish(),message:s().nullish(),error:s().nullish()}).describe("Processing status stored on mediaItems rows.");var Xo=a({id:s(),status:s(),source:u(["upload","generated","stock"]),name:s(),mimeType:s(),fileSize:i(),duration:i().nullable(),width:i().nullable(),height:i().nullable(),frameRate:i().nullable(),progress:S([a({phase:s(),percent:i().nullable()}),N()]),analysis:S([M(s(),R()),N()]),listUsd:i().optional().describe("A2 money stamp \u2014 GENERATED media only: the generate meter's LIST price (USD) at the success terminal. A plan allowance may zero the invoice line. Absent for uploads/imports, failures, x402 (on-chain receipts)."),thumbnailUrl:s().nullable().describe("Presigned GET URL for the item's thumbnail (an uploaded image is its own thumbnail), valid ~7 days \u2014 fetch it directly, no auth header. null when no thumbnail exists yet (still processing, stock imports, audio)."),kind:s().nullable(),tags:S([x(s()),N()]),attribution:S([a({provider:u(["pexels","pixabay","freesound","klipy"]),externalId:s().nullable(),assetUrl:s().nullable(),license:s().nullable()}),N()]),processingStatus:S([Ai,N()]),createdAt:s(),updatedAt:s()}).describe("Media item response per \xA7Media.");var w6=a({data:x(Xo),pagination:oe});var C6=500,M6=0,T6=10737418240,R6=a({filename:s().min(1).max(C6),contentType:u(["video/mp4","video/quicktime","video/x-matroska","video/webm","audio/mpeg","audio/wav","audio/x-wav","audio/mp4","audio/aac","image/png","image/jpeg","image/webp","image/gif","image/svg+xml","application/json","font/ttf","font/otf","font/woff","font/woff2"]),size:y().gt(M6).max(T6),projectId:s().min(1).optional()}).describe("POST /media upload initiation body.");var v6=a({jobId:s(),status:s(),muxedItems:S([M(s(),s()),N()]).optional(),error:s().nullish(),startedAt:s().nullish(),completedAt:s().nullish()}).describe("Mux job response.");var eoe=a({sessionId:s()});var P6=64,ooe=a({seedComposition:R().optional(),leaseJobId:s().min(1).max(P6).optional()});var I6=0,O6=0,k6=a({fromSec:i().min(I6).describe("Window start, seconds into the composition."),toSec:i().gt(O6).describe("Window end (exclusive), seconds."),compositionId:s().min(1).optional().describe("Target a specific composition; defaults to the project's active composition.")}).describe("POST /projects/:id/preview-clip body.");var E6=0,A6=9007199254740991,L6=0,D6=9007199254740991,F6=0,j6=120,V6=3600,noe=a({componentId:s().min(1),params:M(s(),R()).optional(),assets:M(s(),s().min(1)).optional().describe("Component asset-slot name to org mediaId. Every required manifest slot must be bound."),width:y().gt(E6).max(A6).optional(),height:y().gt(L6).max(D6).optional(),fps:i().gt(F6).max(j6).optional().describe("Preview frame rate. When omitted, uses the project's format."),durationInFrames:y().min(1).max(V6).optional().describe("Preview frame count. When omitted, uses the component's declared duration; required if the component has none.")});var N6=18,$6=.1,B6=1,_6=100,aoe=a({composition:R().optional().describe("The composition to render. Absent \u21D2 the project's ACTIVE composition \u2014 what create_render will encode. The response's `previewed.source` names what was rendered."),compositionId:s().optional().describe("Preview a SPECIFIC persisted composition of this project (create_render parity). Absent \u21D2 the active one. A stale/foreign id is a 404 \u2014 never a silent fall-through."),session_id:s().optional().describe("Compose-session id: render that session's SCRATCH composition (what the session has been editing) instead of the active row. Ignored when `composition` is passed."),timestamps:x(i()).min(1).max(N6).describe("Composition seconds to capture, 18 per request. The batch renders as ONE unit of work \u2014 one warm container, one source decode, N seeks \u2014 and that unit has a fixed time budget, so a larger batch is refused here rather than accepted and timed out minutes later. For a denser sweep, split it across calls; identical beats are served from the still cache, so overlapping batches are cheap."),imageFormat:u(["png","jpeg"]).optional().describe("Still format. Default jpeg \u2014 these pixels go to a vision model, where jpeg is equivalent and png costs multiples in bytes to store and move. Pass png only when you need full fidelity."),scale:i().min($6).max(B6).optional().describe("Render scale 0.1\u20131. Default 0.5, which is what this schema has always recommended for vision-bound looks. Pass 1 when judging fine detail \u2014 it costs ~4x the vision tokens."),jpegQuality:y().min(1).max(_6).optional().describe("JPEG quality (jpeg only). Default 70 \u2014 the quality the eval panel grades at.")});var q6=300,U6=0,W6=1e4,G6=120,H6=a({brandKits:x(a({id:s(),name:s(),audio:a({sfxIntensity:u(["off","light","standard","dense"]).optional(),musicEnabled:v().optional(),musicMood:s().max(q6).optional(),sonicLogo:a({ref:s().min(1),placement:u(["intro","outro","both"]),offsetMs:y().min(U6).max(W6).optional()}).optional().describe("A brand sound signature bound to the intro/outro bookend. `ref` = a palette reference; bound only when the kit carries the matching bumper (intro/outro), else a non-blocking advisory."),uiSoundSet:a({tick:s().min(1).optional(),pop:s().min(1).optional(),impact:s().min(1).optional(),confirm:s().min(1).optional(),error:s().min(1).optional(),whoosh:s().min(1).optional(),riser:s().min(1).optional()}).optional().describe("Per-family SFX overrides (the brand's own tick/pop/\u2026). Highest-priority tier over the org palette + pack default in the compose SFX draw."),bedStyle:a({bedId:s().min(1).optional(),genre:s().max(G6).optional(),bpmRange:a({min:i(),max:i()}).optional()}).optional().describe("Preferred music bed (`bedId`) or a style hint (`genre` / `bpmRange`). Surfaced for driving agents; compose does not auto-select a pack bed."),ambiencePreference:S([a({ref:s().min(1)}),N()]).optional().describe("Preferred ambience bed (`{ref}`) or explicit null (opt-out). Surfaced for driving agents; compose has no ambience auto-placement.")}).optional()})).describe("The org's brand kits (bind one to a project via update_project). `audio` carries the brand sound kit when set."),critics:x(to).describe("Registered critics \u2014 run in the Director's gates AND score_composition."),references:x(a({mediaId:s(),name:s().optional(),thumbnailUrl:s().optional().describe("Presigned reference thumbnail (~1 week).")})).describe("The union of critic reference media \u2014 the org's visual standard, with provenance."),recentDecisions:x(a({checkpointId:s(),projectId:s(),kind:u(["gate","score"]),stage:u(["content","layout","motion"]).optional(),decision:s(),decidedAt:i()})).describe("The last recorded checkpoint decisions \u2014 the raw taste log phase 2 will distill.")}).describe("The org's legible taste: brand + critics + references + decision log.");var K6=0,J6=9007199254740991,Li=a({hasComposition:v(),sceneCount:y().min(K6).max(J6),duration:i().nullable(),updatedAt:s().nullable()}).describe("Summary of a project's stored composition.");var Di=a({id:s(),name:s(),kind:s().nullable(),durationSec:i().nullable().describe("Seconds. Uses the media duration when known; audio without one falls back to its transcript's measured duration (same rule as get_media_context)."),hasTranscript:v().describe("A cached transcript EXISTS for this item. The bodies are never inlined here \u2014 fetch one with GET /v1/media/{id}/transcript (or get_media_context for faces + grids too).")}).describe("One media item as the project context lists it: identity + duration + whether a transcript exists.");var Fi=S([a({status:h("ready"),mediaId:s(),words:x(a({text:s(),start:i().describe("Word onset (SECONDS from source start)."),end:i().describe("Word end (SECONDS from source start).")}))}),a({status:h("unavailable"),mediaId:s()})]);var X6=0,Z6=0,Y6=a({composition:S([Wo,N()]).describe("The project's ACTIVE composition wire shape \u2014 identical to GET /v1/projects/{id}/composition. NULL when the project has no composition yet (a freshly created project): mint one with new_composition, or let the first apply_composition create it."),format:S([a({aspectRatio:u(["16:9","9:16","1:1","4:5"]),fps:S([h(24),h(25),h(30),h(60)]).optional(),resolution:u(["hd","fhd","4k"]).optional(),platform:s().optional()}),N()]).describe("The composition's format, hoisted \u2014 the pixel frame every card/graphic must be authored against. Null whenever `composition` is null."),media:x(Di).describe("The org's media library (most recent first, capped) \u2014 the pool this project can draw clips from."),transcript:S([Fi,N()]).describe('The FIRST transcribed media item\'s word-timed transcript, flattened \u2014 the spine a VO-driven film cuts to. `status:"ready"` carries the words; `status:"unavailable"` means the transcript exists but its body could not be fetched (retry); null means nothing in `media` is transcribed. For any OTHER transcribed item (see each entry\'s `hasTranscript`), read GET /v1/media/{id}/transcript.'),brandKit:S([ft,N()]).describe("The kit BOUND to this project (`projects.brandKitId` is the brand SSOT \u2014 bind one via update_project). Null when the project has no kit bound; enumerate the org's kits with GET /v1/brand-kits."),markers:x(a({id:s().min(1),startTime:i().min(X6),endTime:i().min(Z6).optional(),kind:s().min(1),name:s().optional(),metadata:M(s(),R()).optional()})).describe("The composition's markers \u2014 hoisted alongside `format`. Empty when the composition carries none AND when there is no composition yet.")}).describe("One-call agent context for a project: composition + format + media pool + the lead transcript + the bound brand kit + markers. Replaces get_composition + get_media_context + get_profile at the start of an authoring session. A 404 means the project doesn't exist for your org \u2014 never that it is empty.");var Q6=200,e5=0,t5=0,o5=a({name:s().min(1).max(Q6),description:s().optional(),format:ee.optional(),brandKitId:s().min(1).optional(),width:i().gt(e5).optional(),height:i().gt(t5).optional()}).describe("POST /projects body.");var ji=S([a({id:s(),status:s(),createdAt:s(),outputUrl:s().nullable(),outputExpiresAt:s().nullable()}),N()]).describe("Most recent render for a project, if any.");var Zo=a({id:s(),name:s(),description:s().nullable(),format:S([ee,N()]),brandKitId:s().nullable(),activeCompositionId:s().nullable(),composition:Li,lastRender:ji,webUrl:s().nullable().describe("A browser URL that opens THIS project, or null when CueFrame exposes no web view for a project. Null today: the console serves account surfaces (keys, usage, billing) and has no per-project page, so there is no link to give. Do NOT synthesise one \u2014 a guessed console path 404s. Show the user rendered output (create_render \u2192 outputUrl) or a preview still instead. This field becoming non-null is the signal that a real project view exists."),createdAt:s()}).describe("Project response per \xA7Projects.");var r5=a({data:x(Zo),pagination:oe});var s5=200,n5=a({name:s().min(1).max(s5).optional(),description:s().optional(),format:ee.optional(),brandKitId:s().min(1).optional()}).describe("PATCH /projects/:id body.");var i5=a({clipSuggestionId:s().min(1).optional(),compositionId:s().min(1).optional().describe("Target a specific composition in the project; defaults to the project's active composition."),format:ee.optional(),priority:u(["interactive","standard","background"]).optional(),intent:u(["preview","final"]).optional(),brandKitId:S([s().min(1),N()]).optional()}).describe("POST /projects/:id/renders body.");var a5=a({manifestVersion:s().describe("Identifies this exact face table. Derived from the table's own content, so it moves when and only when the admitted set moves. Record it beside a composition to state which face table a font choice was validated against."),families:x(a({family:s().describe("The family name authoring accepts VERBATIM \u2014 card, caption and scene text alike."),weights:x(a({min:i(),max:i()})).describe("The weights a shipped file declares. A static face has min === max; a variable face gives its declared wght axis range. Any weight inside a range renders; anything outside every range is REFUSED, never synthesised."),styles:x(u(["normal"])).describe("The styles bytes exist for. Always ['normal']: no bundled or aliased family ships an italic file, so fontStyle:'italic' over one is refused rather than slanted. Real italics come only from a brand-kit font asset."),captionDefaults:a({base:i(),emphasis:i()}).describe("The weights a caption is drawn at when the style names none."),origin:u(["bundled","aliased"]).describe("'bundled' = bytes ship in the render bundle. 'aliased' = a metric-compatible binary stands in for the named family.")}))}).describe("GET /fonts response \u2014 the renderer's admitted font set. Derived from the same table the font gate refuses by, so any family/weight/style here passes validation by construction. Covers the BUNDLED set only: a brand kit's sealed faces are per-org and per-render.");var c5=0,p5=9007199254740991,d5=0,l5=9007199254740991,Vi=a({phase:u(["queued","validating","presigning","collecting-artifacts","resolving","detecting","baking-matte","translating","spawning","encoding","uploading"]),percent:i(),scenesCompleted:y().min(c5).max(p5).optional(),scenesTotal:y().min(d5).max(l5).optional()}).describe("Non-terminal render progress; phase is one of the worker's emitted stages.");var Yo=a({id:s(),status:u(["queued","pending","rendering","complete","error","cancelled"]),progress:Vi.optional(),outputUrl:s().nullable(),outputExpiresAt:s().nullable(),error:s().nullable().describe("Human-readable failure message. Pair with `errorCode` for a stable, machine-readable code an agent runner can branch on."),errorCode:s().nullable().describe("Stable, machine-readable error code (e.g. `render_pipeline_unavailable`, `render_route_missing`, `render_pipeline_failed`). Null when status is not `error` or unavailable for an older render."),errorDetails:S([M(s(),R()),N()]).describe("Structured failure context \u2014 `{ targetUrl?, upstreamStatus?, upstreamCode?, attemptedAt? }`. Surfaced so agent runners can distinguish operator-config issues from upstream-down vs route-missing without parsing `error`."),category:S([u(["authoring","transient","internal"]),N()]).describe("Failure taxonomy when status is `error`; null otherwise. `authoring` = deterministic defect in YOUR composition/request \u2014 fix it, retrying is futile; `transient` = temporary pipeline/infra failure \u2014 safe to retry_render; `internal` = unexpected server fault \u2014 retry once then escalate. Mirrors the render.failed webhook's `category`."),retryable:v().nullable().describe("Whether re-attempting the SAME render can succeed (status `error`); null otherwise. true \u2192 call retry_render. false \u2192 deterministic (category authoring/internal); fix the composition first \u2014 retry_render alone reproduces it. Mirrors the render.failed webhook's `retryable`."),createdAt:s(),updatedAt:s().describe("ISO-8601 timestamp of the render's most recent progress update. Compute staleness = now \u2212 updatedAt to distinguish a wedged render from a slow one and decide whether to wait, cancel, or retry."),listUsd:i().optional().describe("A2 money stamp: the metered event's LIST price (USD), stamped at the success terminal (exports for deliverable renders, compose_capture for A8 previews). A plan allowance may zero the actual invoice line \u2014 this is the list price, never a Stripe charge. Absent while running, on failure, and for x402 orgs (on-chain receipts). Mirrors the get_usage ledger."),warnings:x(s()).optional().describe("Non-fatal advisories surfaced at render-CREATE (omitted when none, and on GET \u2014 create-time only).")}).describe("Render job response per \xA7Renders.");var u5=a({data:x(Yo),pagination:oe});var m5=a({outputUrl:s(),outputExpiresAt:s()}).describe("POST /refresh-url response.");var oo=a({candidateId:s(),provider:u(["pexels","pixabay","freesound","klipy"]),kind:u(["video","photo","sfx","gif"]),thumbnail:s(),previewUrl:s(),downloadUrl:s().optional(),duration:i().optional(),width:i().optional(),height:i().optional(),author:s(),authorUrl:s().optional(),assetUrl:s().optional(),license:s().optional()}).describe("A stock resource search candidate.");var h5=a({kind:u(["sfx-pack","music-pack"]).optional(),id:s().min(1).optional(),projectId:s().min(1).optional(),candidateId:s().min(1).optional()}).describe('POST /resources/import body \u2014 stock candidate lane { projectId, candidateId } OR curated pack lane { kind:"sfx-pack"|"music-pack", id }.');var f5=a({id:s(),status:u(["importing","ready"])}).describe("POST /resources/import response.");var x5=200,g5=200,y5=10,b5=0,S5=50,z5=0,w5=9007199254740991,C5=0,M5=9007199254740991,T5=0,R5=0,v5=a({query:s().min(1).max(x5).optional(),queries:x(s().min(1).max(g5)).min(1).max(y5).optional(),kind:u(["video","photo","sfx","gif"]).optional(),provider:u(["pexels","pixabay","freesound","klipy"]).optional(),limit:y().gt(b5).max(S5).optional(),minWidth:y().gt(z5).max(w5).optional().describe("Video-only minimum selected-rendition width in pixels; smaller results are excluded."),minHeight:y().gt(C5).max(M5).optional().describe("Video-only minimum selected-rendition height in pixels; smaller results are excluded."),durationSec:a({min:i().min(T5).optional(),max:i().gt(R5).optional()}).optional().describe("sfx-only clip-length bound in seconds \u2192 Freesound native filter.")}).describe("POST /resources/search body \u2014 one `query`, or a batch of `queries[]`.");var Ni=a({query:s(),provider:u(["pexels","pixabay","freesound","klipy"]).optional(),kind:u(["video","photo","sfx","gif"]).optional(),candidates:x(oo),error:s().optional()}).describe("One query's candidates within a batch search.");var P5=a({provider:u(["pexels","pixabay","freesound","klipy"]).optional(),kind:u(["video","photo","sfx","gif"]).optional(),candidates:x(oo).optional(),results:x(Ni).optional()}).describe("POST /resources/search response \u2014 `candidates` for one query, `results[]` for a batch.");var I5=-9007199254740991,O5=9007199254740991,k5=a({ok:h(!0),stage:u(["content","layout","motion"]).optional(),version:y().min(I5).max(O5).optional(),composeJobId:s().optional()}).describe("Decision recorded; the run resumes (the SAME rail as POST /checkpoints/{id}/resume).");var E5=-9007199254740991,A5=9007199254740991,L5=-9007199254740991,D5=9007199254740991,F5=-9007199254740991,j5=9007199254740991,V5=a({id:s(),projectId:s(),composeJobId:s().optional(),briefId:s().optional(),kind:u(["gate","score"]),stage:eo.optional(),version:y().min(E5).max(A5),status:u(["awaiting","approved","revised","abandoned","expired","superseded"]),artifact:R().describe("The stage artifact under review: the locked ComposePlan at content; the composition wire shape at layout/motion; the judged composition snapshot on kind:'score'."),stillUrls:x(s()).optional().describe("Presigned storyboard/eval stills \u2014 the packet's visual evidence (may be GC'd by the retention sweep after the job goes terminal; the decision record is immortal)."),criticVerdicts:R().optional().describe("Per-criterion scores + critique from the design loop / judge, incl. lock_violation entries."),quote:Qt.optional(),revisionCycle:y().min(L5).max(D5).describe("Revise cycles this gate has consumed. The brief quote states the included count (revisionCyclesIncluded); beyond it, resume(revise) is refused with a typed error."),decision:R().optional().describe("The recorded decision {decision, comments?, globalNote?, decidedAt} once resolved."),reviewMode:u(["agent","hosted"]).optional().describe("How this packet is decided (from the Brief's gates). 'hosted' = the review PAGE captures the decision; absent/'agent' = the decision flows back through the driving agent."),createdAt:i(),updatedAt:i(),versionStack:x(a({id:s(),version:y().min(F5).max(j5),stage:u(["content","layout","motion"]).optional(),status:s(),decision:s().optional(),createdAt:i()})).describe("The run's v1\u2192vN gate history \u2014 per-version status + decision summaries.")});var ere=a({composition:R().optional().describe("The composition to judge. Absent \u21D2 the project's ACTIVE composition."),compositionId:s().optional().describe("Judge a SPECIFIC persisted composition of this project (create_render parity). Absent \u21D2 the active one. A stale/foreign id is a 404 \u2014 never a silent fall-through."),session_id:s().optional().describe("Compose-session id: judge that session's SCRATCH composition (what the session has been editing) instead of the active row. Ignored when `composition` is passed."),editorialIntent:s().optional(),brandContext:s().optional()});var N5=10,$5=25,ore=a({q:s().min(1),limit:y().min(1).max($5).default(N5)});var $i=a({startSec:i(),endSec:i(),candidateId:s().describe("The chosen audio source (the clearest mic) for this span \u2192 programAudioSourceId."),reasons:x(s())});var Bi=a({startSec:i(),endSec:i(),candidateId:s(),sourceInSec:i().describe("Chosen source window start (declared-offset resolved)."),sourceOutSec:i(),reasons:x(s())});var _i=a({candidateId:s().describe("Stable angle/source id. An unknown id is rejected, never remapped."),role:s().nullish().describe('Agent-declared semantic tag (e.g. "wide", "webcam").'),score:i().describe("The weighted prominence score (\u03A3 weights\xB7signal)."),contributions:M(s(),i()).describe("signalKey \u2192 weighted contribution (the agent reweights from this)."),reasons:x(s())});var qi=a({startSec:i().describe("Span start (output seconds)."),endSec:i().describe("Span end (output seconds)."),chosen:s().describe('The recommended candidateId, or "__hold__" (abstain).'),pacingNote:s().nullish().describe("Which mechanism produced the pick (argmax / hysteresis / override / hold \u2026)."),candidates:x(_i)});var B5=a({projectId:s(),groupId:s(),selectorVersion:s(),signalVersions:M(s(),s()),moments:x(qi),recommendation:a({cutSchedule:x(Bi),audioBed:x($i).describe("Best-audio bed (instance #3): the clearest mic per span."),suppressedSwitches:x(a({atSec:i(),wouldHaveBeenCandidateId:s(),byScore:i(),blockedBy:s(),releaseAtSec:i().nullable()})).describe("Switches the stabilizer suppressed (the anti-ping-pong audit).")}),divergesFromComposition:v().optional()}).describe("Selector (switch) candidates + recommendation for a synced-angle group. Every candidate carries score + contributions + reasons so the agent reweights from evidence; the recommendation is the lowered cut schedule + best-audio bed.");var _5=0,q5=0,U5=0,W5=0,G5=0,H5=a({groupId:s().min(1),weights:M(s(),i()).optional().describe("Sparse prominence weights (the taste knob, non-negative). Default = DOMINANCE_WEIGHTS."),minHoldSec:i().gt(_5).optional(),enterSec:i().min(q5).optional(),switchMargin:i().min(U5).optional(),cooldownSec:i().min(W5).optional(),maxHoldSec:i().gt(G5).optional(),lockSourceId:s().optional().describe("Pin a camera/angle for the whole timeline."),overrides:x(a({startSec:i(),endSec:i(),candidateId:s()})).optional()});var K5=200,J5=50,X5=20,Z5=a({name:s().min(1).max(K5),files:x(a({mediaId:s().min(1),role:s().min(1).max(J5)})).min(1).max(X5)}).describe("POST /sessions body.");var Ui=a({mediaId:s(),role:s(),status:s().nullable()}).describe("One file member of a session, with optional role + status.");var Y5=0,Q5=9007199254740991,Wi=a({id:s(),name:s(),fileCount:y().min(Y5).max(Q5),muxStatus:s().nullable(),createdAt:s()}).describe("Session list summary (per list endpoint).");var eq=a({data:x(Wi),pagination:oe});var tq=a({id:s(),name:s(),files:x(Ui),mux:a({status:s().nullable(),jobId:s().nullable(),muxedItems:S([M(s(),s()),N()]),error:s().nullable(),startedAt:s().nullable(),completedAt:s().nullable()}),createdAt:s()}).describe("Session response per \xA7Sessions.");var Gi=a({name:s(),title:s(),description:s()}).describe("A CueFrame agent skill (metadata).");var oq=a({skills:x(Gi)}).describe("GET /skills response \u2014 the available agent skills.");var rq=a({factId:s().describe("Opaque identifier for the derived fact."),status:u(["pending","ready","failed"]).describe("State of the fact right now. `ready` with `alreadyExisted` means the detection was already computed and is available immediately."),quotedUsd:i().describe("The server's price for this detection, in USD, quoted from the source duration. Zero is charged when `alreadyExisted` is true."),alreadyExisted:v().describe("True when this exact detection was already pending or ready. Nothing was dispatched and nothing will be charged \u2014 the same fact is served twice for one price.")}).describe("POST /media/:id/detect-subjects response \u2014 the claimed perception fact.");var sq=0,nq=9007199254740991,Hi=a({id:s(),briefId:s().nullable(),rank:y().gt(sq).max(nq),trim:a({start:i(),end:i()}),score:i(),title:s(),reason:s(),topic:s(),hook:s(),platforms:x(s()),format:s(),caption:s(),hashtags:x(s()),textOverlays:x(s()),editingNotes:s(),motionStyle:a({textAnimation:s(),transitions:s(),colorMood:s(),captionStyle:s()}),visualTreatment:x(a({time:S([i(),s()]),visual:s()})),brollSuggestions:x(a({moment:s(),searchTerms:x(s()),rationale:s()})),thumbnailConcept:s()}).describe("Single ranked clip suggestion.");var iq=a({status:u(["idle","generating","completed","failed"]),createdAt:s().nullable(),analyzedAt:s().nullable(),jobId:s().nullable(),topics:x(s()),suggestions:x(Hi),pagination:oe}).describe("GET /media/:id/suggestions envelope.");var aq=a({status:u(["queued","running","complete","failed"]),alreadyRunning:v().optional()}).describe("POST /media/:id/suggestions response.");var cq=1e3,pq=0,dq=0,lq=256,uq=256,mq=0,hq=0,fq=256,xq=12e3,gq=a({words:x(a({text:s().min(1).max(cq),timelineStart:i().min(pq),timelineEnd:i().min(dq),clipId:s().min(1).max(lq),poolItemId:s().min(1).max(uq),sourceStart:i().min(mq),sourceEnd:i().min(hq),speakerId:S([s().max(fq),N()])})).min(1).max(xq)}).describe("A bounded merged timeline transcript for CueFrame edit analysis. The server selects the model; clients cannot provide a provider, API key, or model override.");var yq=0,bq=9007199254740991,Sq=0,zq=9007199254740991,wq=0,Cq=9007199254740991,Mq=a({fillers:x(y().min(yq).max(bq)),silenceGaps:x(y().min(Sq).max(zq)),emphasis:x(y().min(wq).max(Cq))}).describe("CueFrame-model analysis of timeline word indices. Every returned index refers to the request's words array.");var Tq=64,Rq=new RegExp("^[a-z][a-z0-9_]*$"),vq=0,Pq=1,Iq=500,Oq=10,kq=a({scores:x(a({name:s().min(1).max(Tq).regex(Rq),value:i().min(vq).max(Pq),comment:s().max(Iq).optional()})).min(1).max(Oq)}).describe("POST /traces/:traceId/scores body.");var Eq=-9007199254740991,Aq=9007199254740991,Lq=a({accepted:y().min(Eq).max(Aq)}).describe("POST /traces/:traceId/scores response.");var Dq=0,Fq=0,jq=a({task:u(["summary","chapters","highlights"]).describe("What to ask of the transcript. `summary` \u2014 prose: the argument plus the concrete takeaways as bullets. `chapters` \u2014 one line per subject change, `[h:mm:ss] Title \u2014 description`. `highlights` \u2014 up to 8 standalone moments, strongest first, one line each as `[h:mm:ss]-[h:mm:ss] Title \u2014 why it lands` plus the line that carries it. Every timestamp is ABSOLUTE seconds from the start of the media, including when you pass a `window`, and every one is verified against the transcript before you see it \u2014 but they are LINE-START markers about 15s apart, so treat a span as APPROXIMATE (up to 15s early) and refine it against the word timings from GET /v1/media/{id}/context before you cut."),window:a({startSec:i().min(Dq).describe("Window start, SECONDS from the start of the media."),endSec:i().min(Fq).describe("Window end, SECONDS from the start of the media.")}).optional().describe("Analyse only this slice of the transcript. Omit to analyse all of it. Words are windowed exactly as captions.fromTranscript windows them (a word straddling an edge is clamped, a word wholly outside is dropped). Use this when a long recording is rejected with `transcript_too_long`, and to chapter a single segment of a podcast without paying for the whole thing.")}).describe("One editorial question about a media item's transcript.");var Vq=a({task:u(["summary","chapters","highlights"]).describe("Echo of the requested task \u2014 so a batched caller can pair answers to asks."),result:s().describe("The answer, as text. `summary` is prose; `chapters` and `highlights` are one record per LINE in the shape documented on the request's `task` field \u2014 split on newlines to parse them. Timestamps are absolute seconds from the start of the media and every one is CHECKED against the transcript before the response is returned (a fabricated timestamp fails the call rather than shipping), but they are line-start markers about 15s apart \u2014 a boundary can sit up to 15s BEFORE the moment you want. Use them to locate, not to cut: refine against the word timings in GET /v1/media/{id}/context.")}).describe("The analysis of one media item's transcript. Metered: this is a real LLM call, billed on measured token spend, so it is not a read to poll.");var jre=a({detector:u(["face","person"]).optional()});var Nq=-9007199254740991,$q=9007199254740991,Bq=a({token:s(),expiresAt:y().min(Nq).max($q).describe("Expiry, ms since epoch (~30 min TTL).")}).describe("POST /uploads/token response: a short-lived token for the signed upload lane (the upload-signing worker's `uppy-auth-token` header). The org is derived from the session server-side and stamped into the token.");var Ki=a({featureId:s().describe("The metered plan feature (exports, compose, compose_verify, \u2026)."),value:i().optional().describe("Metered amount, in the feature's own unit (exports = render-minutes, storage = GB). Absent for a discrete single use, AND deliberately absent on the cost-plus lines (compose, generate, ai_tokens, compose_verify) whose internal metered unit is not a quantity \u2014 read `listUsd` for what those events cost you."),projectId:s().optional(),jobId:s().optional().describe("The job that produced the meter: a render/compose/preview job id, a media id (transcription, generate), or a clip-suggestion run id (jobKind `suggestions` \u2014 see `mediaItemId` for the media it analyzed)."),jobKind:s().optional().describe("render | compose | consult_* | verify | preview | generate | suggestions | session_uptime | \u2026"),mediaItemId:s().optional().describe("The media item the job ran over, when it ran over one (suggestions, transcription). Resolve it with GET /v1/media/{id}."),listUsd:i().optional().describe("LIST price of this metered event, USD. Honest naming: the invoice may zero it inside a plan allowance \u2014 this is the event's list price, not a Stripe line item."),createdAt:i().describe("Epoch-ms when the meter landed.")});var _q=a({data:x(Ki),pagination:oe});var Ure=a({contract:s().describe("The contract this verdict was computed against (the kernel version the deployment runs). If it differs between two calls, the validator changed, not your composition."),valid:v(),errors:x(a({code:s(),stage:s(),category:s(),retryable:v(),message:s(),fix:M(s(),R()).optional()})),advisories:x(a({rule:s(),criterion:s(),clipId:s().optional(),detail:s(),fix:s()})).describe("Deterministic, render-free QUALITY floors (the SAME named defects the Director's in-loop verify and score_composition surface: static-hold, caption-spine, sfx-density, sfx-speech-collision, bed-coverage, audio-role). NON-blocking \u2014 they never flip `valid` (an editorially-weak composition still renders); fix them for quality, not to save. Empty when the composition is clean or the wire shape failed (they need a parsed composition)."),warnings:x(s()).optional().describe("Non-blocking render-fidelity warnings detected before enqueue, including unavailable font families."),quote:a({thisStepUsd:i(),jobSpendSoFarUsd:i(),estimatedJourneyTotalUsd:i()}).describe("The A2 money triple for the commodity lane: validate is free; estimatedJourneyTotalUsd is the render price to finish from a valid composition \u2014 relay it BEFORE create_render.")});var Re=u(["media.transcribed","media.completed","suggest.completed","session.mux.complete","session.mux.failed","render.completed","compose.completed","checkpoint.ready","project.updated","composition.updated","webhook.test"]);var qq=0,Uq=6e4,Wq=a({url:s().min(1),events:x(Re).min(1),settleMs:y().min(qq).max(Uq).optional()}).describe("POST /webhooks body.");var Gq=0,Hq=9007199254740991,Kq=a({id:s(),url:re(),events:x(Re),settleMs:y().min(Gq).max(Hq),enabled:v(),status:u(["active","pending"]).describe("active = ownership verified + receiving events; pending = challenge not echoed, inactive."),secret:s().describe("Standard Webhooks signing secret, format `whsec_<base64>`. Returned ONCE at create; rotate = delete + recreate. Every delivery carries `webhook-id`, `webhook-timestamp` (unix seconds), and `webhook-signature: v1,<base64>` (HMAC-SHA256 over `{id}.{timestamp}.{rawBody}`). Verify with any Standard-Webhooks library (`standardwebhooks` / `svix`): `new Webhook(secret).verify(rawBody, headers)`."),verification:a({status:h("pending"),reason:s()}).optional().describe('Present ONLY when ownership verification did not complete (status:"pending"). CueFrame POSTs a signed `webhook.verify` challenge whose `data.token` your endpoint must echo in a 2xx to activate; `reason` is one of token_not_echoed | non_2xx_<code> | unreachable | ssrf_blocked. A pending webhook receives no events \u2014 fix the receiver and POST /webhooks/:id/verify (no delete/recreate needed). See GET /webhooks/events for the full contract.')}).describe("POST /webhooks response (secret present exactly once).");var Jq=a({delivery:M(s(),R()).describe("The shared HTTP envelope + headers + retry semantics."),signing:M(s(),R()).describe("Standard Webhooks signing: secret format, signed content, how to verify."),ownershipVerification:M(s(),R()).describe("The synchronous echo-the-token activation handshake + recovery."),events:x(a({event:Re,when:s(),data:M(s(),s())})).describe("Every subscribable event with its exact delivery `data` fields."),sample:M(s(),R()).describe("A fully-worked example delivery (headers + body).")}).describe("The webhook delivery/signing/verification contract, as data. Read this before building a receiver.");var Xq=0,Zq=9007199254740991,Yq=0,Qq=9007199254740991,Qo=a({id:s(),url:re(),events:x(Re),settleMs:y().min(Xq).max(Zq),enabled:v(),verificationStatus:u(["pending","verified"]).describe("pending = callback URL has not echoed the ownership challenge (receives no events); verified = ownership proven."),createdAt:s(),lastDeliveredAt:s().nullable(),lastFailedAt:s().nullable(),consecutiveFailures:y().min(Yq).max(Qq)}).describe("Webhook endpoint record (secret omitted after create).");var eU=a({data:x(Qo),pagination:oe});var tU=0,oU=6e4,rU=a({url:s().min(1).optional(),events:x(Re).min(1).optional(),settleMs:y().min(tU).max(oU).optional(),enabled:v().optional()}).describe("PATCH /webhooks/:id body.");var sU=a({deliveryId:s(),status:h("queued")}).describe("POST /webhooks/:id/test response.");var nU=a({id:s(),status:u(["active","pending"]).describe("active = ownership verified + receiving events; pending = challenge not echoed."),verification:a({status:h("pending"),reason:s()}).optional().describe("Present only when the re-challenge did not verify; `reason` names why (see WebhookCreateResponse.verification).")}).describe("POST /webhooks/:id/verify response.");var iU=a({orgId:s(),permissions:M(s(),x(s())),keyId:s(),keyName:s()}).describe("Whoami response.");var pse=a({x402Version:h(2),accepts:x(qe({})).describe("Accepted payment requirements. Read `accepts[0]` for scheme (`exact` for a fixed price, `upto` for a measured one), network (CAIP-2), asset, amount and payTo."),error:s().optional().describe("Human-readable reason.")}).describe("x402 v2 PaymentRequired challenge \u2014 the body of a 402 on a priced operation.");var aU=100,cU=-9007199254740991,pU=9007199254740991,dU=-9007199254740991,lU=9007199254740991,uU=P({limit:y().min(1).max(aU).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:s().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only."),projectId:s().optional().describe("Only events attributed to this project."),jobId:s().optional().describe('Only events produced by this job \u2014 how to answer "did my failed render post a charge?" for one run.'),from:y().min(cU).max(pU).optional().describe("Period start, epoch milliseconds, INCLUSIVE."),to:y().min(dU).max(lU).optional().describe("Period end, epoch milliseconds, EXCLUSIVE.")});var mU=100,hU=P({limit:y().min(1).max(mU).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:s().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only.")});var er=ni;var fU=P({id:s()});var xU=P({id:s()});var gU=100,yU=P({limit:y().min(1).max(gU).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:s().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only."),projectId:s().optional().describe("Scope to one project. Omit for every brief in the org."),kind:u(["authored","clip","all"]).optional().describe("Which briefs to list. `authored` (default) = human-authored only; `clip` = the machine-minted clip briefs from suggest_briefs; `all` = both.")});var bU=P({id:s()});var SU=P({id:s()});var zU=P({id:s()}),wU=de();var CU=P({id:s()});var MU=P({id:s()});var TU=100,RU=P({limit:y().min(1).max(TU).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:s().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only."),composeJobId:s().optional().describe("Scope to ONE compose run \u2014 its v1\u2192vN gate history with per-version status and decisions."),projectId:s().optional().describe("Scope to everything reviewable in one project.")});var vU=P({id:s()});var PU=P({id:s()});var IU=P({id:s()}),OU=a({suggestionId:s().min(1),format:a({aspectRatio:u(["16:9","9:16","1:1","4:5"]),fps:S([h(24),h(25),h(30),h(60)]).optional(),resolution:u(["hd","fhd","4k"]).optional(),platform:s().optional()}).optional()}),kU=R(),EU=P({id:s()}),AU=100,LU=P({limit:y().min(1).max(AU).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:s().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only."),platform:s().optional().describe("Only suggestions cut for this delivery platform."),format:s().optional().describe("Only suggestions in this output format."),topic:s().optional().describe("Only suggestions matching this topic label.")});var DU=P({id:s()});var FU=P({id:s()}),jU=R();var VU=100,NU=P({category:u(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]).optional().describe("Filter to one category bucket (text|effects|transitions|layouts|backgrounds|ui-blocks|scenes)."),kind:u(["component","transition","scene"]).optional().describe("Filter by render kind (component|transition|scene)."),tier:u(["recommended","standard","niche"]).optional().describe("Filter by curation tier (recommended|standard|niche)."),useCase:u(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"]).optional().describe("Filter to entries whose useCase includes this edit role (e.g. intro, title-over-footage, grade)."),mood:s().optional().describe("Filter to entries whose mood tags include this value (e.g. cinematic, minimal)."),q:s().optional().describe("Free-text match across id/name/description/intent/useWhen/tags/mood. Recommend-orders results."),intent:s().optional().describe("Alias of `q` framed as recommend-by-intent (e.g. intent=intro). Recommend-orders results."),limit:y().min(1).max(VU).optional().describe("Page size (1..100). Omit to return the whole filtered catalog in one page."),after:s().optional().describe("Opaque cursor from a previous page's nextCursor (forward-only).")});var $U=P({id:s()});var BU=P({id:s()});var _U=P({id:s()});var qU=P({id:s()});var UU=P({id:s()});var WU=P({id:s(),composeJobId:s()}),GU=R(),HU=P({id:s(),composeJobId:s()});var KU=P({id:s(),composeJobId:s()});var JU=P({id:s()});var XU=P({id:s(),composeJobId:s()});var ZU=P({id:s()}),YU=64,QU=a({seedComposition:R().optional(),leaseJobId:s().min(1).max(YU).optional()}),e8=P({sessionId:s()}),t8=P({id:s(),sessionId:s()}),o8=P({composition:R()}),r8=P({id:s(),sessionId:s()}),s8=P({ok:v()}),n8=P({id:s(),sessionId:s()}),i8=P({etag:s()});var a8=P({id:s()}),c8=P({compositionId:s().optional().describe("Read a SPECIFIC composition instead of the project's active one. Omit it and the active composition is returned. Pairs with `composition_id` on the apply op: an edit you can make to a second composition is one you can read back.")});var p8=P({id:s()});var d8=R(),l8=P({id:s()});var u8=de(),m8=P({id:s()});var h8=P({id:s()});var f8=R(),x8=P({id:s()});var g8=R(),y8=P({id:s()});var b8=P({contract:s().describe("The contract this verdict was computed against (the kernel version the deployment runs). If it differs between two calls, the validator changed, not your composition."),valid:v(),errors:x(P({code:s(),stage:s(),category:s(),retryable:v(),message:s(),fix:M(s(),R()).optional()})),advisories:x(P({rule:s(),criterion:s(),clipId:s().optional(),detail:s(),fix:s()})).describe("Deterministic, render-free QUALITY floors (the SAME named defects the Director's in-loop verify and score_composition surface: static-hold, caption-spine, sfx-density, sfx-speech-collision, bed-coverage, audio-role). NON-blocking \u2014 they never flip `valid` (an editorially-weak composition still renders); fix them for quality, not to save. Empty when the composition is clean or the wire shape failed (they need a parsed composition)."),warnings:x(s()).optional().describe("Non-blocking render-fidelity warnings detected before enqueue, including unavailable font families."),quote:P({thisStepUsd:i(),jobSpendSoFarUsd:i(),estimatedJourneyTotalUsd:i()}).describe("The A2 money triple for the commodity lane: validate is free; estimatedJourneyTotalUsd is the render price to finish from a valid composition \u2014 relay it BEFORE create_render.")}),S8=P({id:s(),compositionId:s()}),z8=de();var w8=P({id:s()});var C8=P({criticId:s()}),M8=de();var T8=P({id:s()}),R8=a({composition:R().optional().describe("The composition to judge. Absent \u21D2 the project's ACTIVE composition."),compositionId:s().optional().describe("Judge a SPECIFIC persisted composition of this project (create_render parity). Absent \u21D2 the active one. A stale/foreign id is a 404 \u2014 never a silent fall-through."),session_id:s().optional().describe("Compose-session id: judge that session's SCRATCH composition (what the session has been editing) instead of the active row. Ignored when `composition` is passed."),editorialIntent:s().optional(),brandContext:s().optional()});var v8=P({id:s()}),P8=18,I8=.1,O8=1,k8=100,E8=a({composition:R().optional().describe("The composition to render. Absent \u21D2 the project's ACTIVE composition \u2014 what create_render will encode. The response's `previewed.source` names what was rendered."),compositionId:s().optional().describe("Preview a SPECIFIC persisted composition of this project (create_render parity). Absent \u21D2 the active one. A stale/foreign id is a 404 \u2014 never a silent fall-through."),session_id:s().optional().describe("Compose-session id: render that session's SCRATCH composition (what the session has been editing) instead of the active row. Ignored when `composition` is passed."),timestamps:x(i()).min(1).max(P8).describe("Composition seconds to capture, 18 per request. The batch renders as ONE unit of work \u2014 one warm container, one source decode, N seeks \u2014 and that unit has a fixed time budget, so a larger batch is refused here rather than accepted and timed out minutes later. For a denser sweep, split it across calls; identical beats are served from the still cache, so overlapping batches are cheap."),imageFormat:u(["png","jpeg"]).optional().describe("Still format. Default jpeg \u2014 these pixels go to a vision model, where jpeg is equivalent and png costs multiples in bytes to store and move. Pass png only when you need full fidelity."),scale:i().min(I8).max(O8).optional().describe("Render scale 0.1\u20131. Default 0.5, which is what this schema has always recommended for vision-bound looks. Pass 1 when judging fine detail \u2014 it costs ~4x the vision tokens."),jpegQuality:y().min(1).max(k8).optional().describe("JPEG quality (jpeg only). Default 70 \u2014 the quality the eval panel grades at.")});var A8=P({id:s()}),L8=0,D8=9007199254740991,F8=0,j8=9007199254740991,V8=0,N8=120,$8=3600,B8=a({componentId:s().min(1),params:M(s(),R()).optional(),assets:M(s(),s().min(1)).optional().describe("Component asset-slot name to org mediaId. Every required manifest slot must be bound."),width:y().gt(L8).max(D8).optional(),height:y().gt(F8).max(j8).optional(),fps:i().gt(V8).max(N8).optional().describe("Preview frame rate. When omitted, uses the project's format."),durationInFrames:y().min(1).max($8).optional().describe("Preview frame count. When omitted, uses the component's declared duration; required if the component has none.")});var _8=P({id:s()});var q8=P({id:s()});var U8=P({id:s(),exportId:s()});var W8=P({id:s(),exportId:s()});var G8=P({deep:h("1").optional().describe("Pass `1` to run the deep dependency checks instead of the shallow liveness probe.")});var H8=qe({});var K8=P({jobId:s()});var J8=P({jobId:s()});var X8=10,Z8=25,Y8=P({q:s().min(1).describe("What the moment should look like, in plain language. Describe the IMAGE, not the words spoken."),limit:y().min(1).max(Z8).default(X8).describe("Maximum moments to return. Default 10, maximum 25.")});var Q8=a({projectId:s().optional().describe("Optional project to scope the token to; omitted = org library.")});var e7=100,t7=P({limit:y().min(1).max(e7).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:s().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only."),kind:u(["video","audio","image","gif","asset","source","stock"]).optional().describe("Filter to one media kind."),source:u(["upload","generated","import-url","stock"]).optional().describe("Filter by how the item entered the library."),tag:s().optional().describe("Filter to items carrying this EXACT tag (not a prefix or substring match).")});var o7=P({id:s()});var r7=P({id:s()}),s7=de(),n7=P({id:s()});var i7=P({id:s()}),a7=0,c7=0,p7=20,d7=100,l7=P({after:y().min(a7).optional().describe("Zero-based utterance cursor returned as pagination.nextCursor."),before:y().min(c7).optional().describe("Zero-based utterance cursor for a backward page. Do not combine with after."),limit:y().min(1).max(d7).default(p7).describe("Utterances per page.")});var u7=P({id:s()});var m7=P({id:s()}),h7=P({detector:u(["face","person"]).optional().describe("Which detector to run. Defaults to `face`; an unknown value is refused, never defaulted.")});var f7=P({id:s()});var x7=P({id:s()}),g7=P({kind:u(["subjectTrack","matte"]).optional().describe("Resolve one exact editor prerequisite. Requires startSec and endSec; the response includes the server-selected `exact` result."),startSec:i().optional().describe("Source-in of the clip's trim, in seconds. Must be sent WITH endSec \u2014 one without the other is a 400, never a silent whole-source default."),endSec:i().optional().describe("Source-out of the clip's trim, in seconds. Must be sent WITH startSec.")});var y7=P({id:s()});var b7=P({id:s()});var S7=100,z7=P({limit:y().min(1).max(S7).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:s().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only.")});var w7=P({id:s()});var C7=P({id:s()});var M7=P({id:s()}),T7=de(),R7=P({id:s()});var v7=P({id:s()});var P7=P({id:s()}),I7=100,O7=P({limit:y().min(1).max(I7).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:s().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only."),status:s().optional().describe("Comma-separated render statuses to include (e.g. `error,cancelled`). Omit for every status.")});var k7=P({id:s()});var E7=P({id:s(),renderId:s()});var A7=P({id:s(),renderId:s()});var L7=P({id:s(),renderId:s()});var D7=P({id:s(),renderId:s()});var F7=P({id:s(),renderId:s()}),j7=R();var V7=P({id:s()}),N7=P({groupId:s().min(1).describe("The synced-angle group to score.")});var $7=P({id:s()});var B7=100,_7=P({limit:y().min(1).max(B7).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:s().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only.")});var q7=P({id:s()});var U7=P({id:s()}),W7=de(),G7=P({id:s()});var H7=P({id:s()});var K7=P({name:s()}),J7=R();var X7=P({traceId:s()});var Z7=100,Y7=P({limit:y().min(1).max(Z7).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:s().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only.")});var Q7=P({id:s()});var eW=P({id:s()});var tW=P({id:s()}),oW=de(),rW=P({id:s()});var sW=P({id:s()});var nW=2048,iW=a({videoUrl:re().max(nW),format:ee.optional()}),aW=P({projectId:s(),mediaId:s()});import{createHash as cW}from"crypto";function Ji(n){return n.replace(/\r\n?/g,`
62
- `).normalize("NFC")}function tr(n,t){if(n===null||typeof n=="boolean")return n;if(typeof n=="string")return Ji(n);if(typeof n=="number"){if(!Number.isFinite(n))throw new TypeError("Canonical JSON does not support non-finite numbers.");return Object.is(n,-0)?0:n}if(typeof n!="object")throw new TypeError(`Canonical JSON does not support ${typeof n} values.`);if(t.has(n))throw new TypeError("Canonical JSON does not support cyclic values.");t.add(n);try{if(Array.isArray(n))return n.map(c=>tr(c,t));let e=Object.getPrototypeOf(n);if(e!==Object.prototype&&e!==null)throw new TypeError("Canonical JSON only supports plain objects.");let o=n,r={};for(let c of Object.keys(o).sort()){let d=o[c];if(d===void 0)throw new TypeError("Canonical JSON does not support undefined values.");r[Ji(c)]=tr(d,t)}return r}finally{t.delete(n)}}function Xi(n){return JSON.stringify(tr(n,new Set))}function Zi(n){return Xi(n)}function pW(n){return cW("sha256").update(n).digest("hex")}function Yi(n){return pW(Zi(n))}var ka=sc(Pa(),1);var Vr=Object.freeze(["react","react/jsx-runtime","remotion","@remotion/media","@remotion/layout-utils","@remotion/transitions","@remotion/motion-blur","@remotion/noise","@remotion/paths","@remotion/shapes","@remotion/three","three","three/webgpu","three/tsl","@react-three/fiber","@cueframe/animate","gsap","postprocessing"]);var Ia=new Set(Vr),IG=new Set(["Math.random","Date.now","performance.now","crypto.getRandomValues","crypto.randomUUID"]),OG=new Set(["Date","requestAnimationFrame","setTimeout","setInterval"]),kG=new Set(["Audio","Html5Audio","Html5Video","OffthreadVideo","Video"]);function Oa(n){let t=n.imported;return n.type!=="ImportSpecifier"||!t?null:t.type==="Identifier"&&typeof t.name=="string"?t.name:t.type==="StringLiteral"&&typeof t.value=="string"?t.value:null}function Ea(n){if(!n||typeof n!="object")return null;let t=n;if(t.type==="Identifier"&&typeof t.name=="string")return t.name;if(t.type!=="MemberExpression"&&t.type!=="OptionalMemberExpression")return null;let e=Ea(t.object);if(!e||!t.property||typeof t.property!="object")return null;let o=t.property,r=t.computed===!0?o.type==="StringLiteral"&&typeof o.value=="string"?o.value:null:o.type==="Identifier"&&typeof o.name=="string"?o.name:null;return r?`${e}.${r}`:null}function Nr(n){return Ea(n)?.replace(/^(?:globalThis|window|self)\./,"")??null}function xe(n){throw new We("component_import_denied",`Component import is not allowed: ${JSON.stringify(n)}.`)}function Aa(n,t){let e,o=!1;try{e=(0,ka.parse)(n,{sourceType:"module",plugins:["jsx","typescript"],errorRecovery:!1})}catch(c){throw new We("component_does_not_compile",c instanceof Error?c.message:String(c))}let r=c=>{if(!c||typeof c!="object")return;if(Array.isArray(c)){for(let m of c)r(m);return}let d=c,l=d.type;if((l==="ImportDeclaration"||l==="ExportNamedDeclaration"||l==="ExportAllDeclaration")&&d.source&&typeof d.source=="object"){let m=d.source.value;if(typeof m=="string"&&!Ia.has(m)&&xe(m),(m==="remotion"||m==="@remotion/media")&&l==="ImportDeclaration"){let g=(Array.isArray(d.specifiers)?d.specifiers:[]).map(Oa).find(b=>b!==null&&kG.has(b));g&&xe(`${m}.${g}; use @cueframe/animate MediaTileScene`)}if(m==="@cueframe/animate"&&l==="ImportDeclaration"){let f=Array.isArray(d.specifiers)?d.specifiers:[];o||=f.map(Oa).some(g=>g==="MediaTileScene"||g==="ImageTileScene")}}if(l==="ImportExpression"&&xe("dynamic import()"),l==="CallExpression"){let m=d.callee;m?.type==="Import"&&xe("dynamic import()"),m?.type==="Identifier"&&m.name==="require"&&xe("require()"),m?.type==="Identifier"&&typeof m.name=="string"&&OG.has(m.name)&&xe(`ambient ${m.name}`);let f=Nr(d.callee),g=Array.isArray(d.arguments)?d.arguments:[],b=g[0]?.type==="StringLiteral"?g[0].value:void 0;f==="document.createElement"&&(b==="video"||b==="audio")&&xe(`raw ${b} element; use @cueframe/animate MediaTileScene`)}if(l==="JSXOpeningElement"){let m=d.name;m?.type==="JSXIdentifier"&&(m.name==="video"||m.name==="audio")&&xe(`raw <${String(m.name)}> element; use @cueframe/animate MediaTileScene`)}if(l==="NewExpression"){let m=d.callee;m?.type==="Identifier"&&(m.name==="Date"||m.name==="Worker"||m.name==="SharedWorker")&&xe(`ambient ${String(m.name)}`)}if(l==="MemberExpression"||l==="OptionalMemberExpression"){let m=Nr(d);m&&IG.has(m)&&xe(`ambient ${m}`)}if(l==="VariableDeclarator"){let m=Nr(d.init),f=d.id;m&&["Math","Date","performance","crypto"].includes(m)&&f?.type==="Identifier"&&xe(`ambient ${m} alias`),m==="Math"&&f?.type==="ObjectPattern"&&(Array.isArray(f.properties)?f.properties:[]).some(b=>{let C=b.key;return C?.name==="random"||C?.value==="random"})&&xe("ambient Math.random alias")}if(l==="TSImportType"){let m=d.argument;m?.type==="StringLiteral"&&typeof m.value=="string"&&!Ia.has(m.value)&&xe(m.value)}for(let[m,f]of Object.entries(d))m==="loc"||m==="start"||m==="end"||m==="errors"||m==="comments"||r(f)};if(r(e),o&&t!==void 0&&t!=="webgl2")throw new We("component_graphics_mismatch","MediaTileScene requires manifest.graphics.api to be webgl2.")}var $e=p.string().min(1),La=p.enum(["image","video","audio","data"]),EG=p.object({version:p.literal(1),project:p.object({version:p.literal(4),id:$e,name:$e,createdAt:p.number().finite(),modifiedAt:p.number().finite(),composition:dt,pool:p.array(p.object({id:$e,kind:La}).passthrough()),authoredComponents:p.never().optional(),recipe:p.object({schemaVersion:p.literal(1),slug:p.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),mediaSlots:p.array(p.object({id:$e,projectMediaId:$e,kind:La}).passthrough()).length(1),cloudBrandKit:er,components:p.array(p.object({componentId:$e,name:$e,category:p.enum(["effects","transitions","text","layouts"]),propSchema:p.record(p.string(),p.unknown()).optional(),sourceVersionId:p.never().optional()}).strict())}).passthrough()}).passthrough(),components:p.array(Ft)}).strict();function $r(n,t,e){let o=new Map;for(let r of n){let c=t(r);if(o.has(c))throw new Error(`Duplicate ${e}: ${c}`);o.set(c,r)}return o}function Da(n){let t=EG.parse(n),e=ti(t.project.composition);if(e.length)throw new Error(e.map(T=>`${T.code}: ${T.message}`).join(`
63
- `));let r=structuredClone(n).project,c=$r(t.components,T=>T.componentId,"component source"),d=$r(r.recipe.components,T=>T.componentId,"recipe component"),l=$r(r.pool,T=>T.id,"pool media id");for(let T of r.recipe.mediaSlots)if(l.get(T.projectMediaId)?.kind!==T.kind)throw new Error(`Media slot ${T.id} must match a pool entry of kind ${T.kind}.`);let m=new Map;for(let[T,E]of c){if(!d.has(T))throw new Error(`Missing recipe metadata for component ${T}.`);if(Buffer.byteLength(E.tsxSource,"utf8")>5e5)throw new Error(`Component ${T} exceeds the recipe loader's 500000-byte source limit.`);Aa(E.tsxSource,E.manifest.graphics.api),m.set(T,Yi(E))}for(let T of d.keys())if(!c.has(T))throw new Error(`Missing source for component ${T}.`);for(let T of r.composition.tracks)for(let E of T.contents){if(!("source"in E))continue;let k=E.source;if(k.kind==="media"&&!l.has(k.mediaId))throw new Error(`Missing pool media ${k.mediaId}.`);if(k.kind!=="component"&&k.kind!=="alpha-layer")continue;let q=c.get(k.componentId);if(!q)throw new Error(`Missing source for placed component ${k.componentId}.`);if(Object.hasOwn(k.props,"componentRef"))throw new Error(`Remove componentRef from ${E.id}; recipe pack owns source pinning.`);let _=k.assets??{};for(let[U,me]of Object.entries(q.manifest.assets))if(me.required&&!_[U])throw new Error(`Missing required asset ${k.componentId}.${U}.`);for(let[U,me]of Object.entries(_)){let he=q.manifest.assets[U];if(!he||l.get(me)?.kind!==he.kind)throw new Error(`Invalid asset binding ${k.componentId}.${U}: ${me}.`)}E.source={...k,props:{...k.props,componentRef:{version:1,sourceVersionId:m.get(k.componentId)}}}}let f=Object.fromEntries([...c].map(([T,E])=>{let k=m.get(T);return[T,{headVersionId:k,versions:{[k]:E}}]})),g=r.recipe.mediaSlots[0].projectMediaId;Ge(r.composition,g,g);let{recipe:b,...C}=r;return{...C,authoredComponents:f,recipe:{...b,components:b.components.map(({propSchema:T,...E})=>({...E,sourceVersionId:m.get(E.componentId),...T===void 0?{}:{propSchema:T}}))}}}async function Va(n){try{let t;if(n.body==="@-"){let d=[];for await(let l of process.stdin)d.push(Buffer.from(l));t=Buffer.concat(d).toString("utf8")}else t=n.body.startsWith("@")?await Fa(ja(n.body.slice(1)),"utf8"):n.body;let e=Da(JSON.parse(t)),o=ja(n.out),r=JSON.stringify(e,null,2)+`
64
- `;if(n.check){if(await Fa(o,"utf8")!==r)throw new Error(`Stale generated file: ${o}`)}else if(!n.dryRun){let d=`${o}.${FG()}.tmp`;try{await AG(d,r,{flag:"wx"}),await LG(d,o)}finally{await DG(d).catch(l=>{if(l.code!=="ENOENT")throw l})}}let c={output:o,check:!!n.check,dryRun:!!n.dryRun,sourceVersions:Object.fromEntries(Object.entries(e.authoredComponents).map(([d,l])=>[d,l.headVersionId]))};return A(n,"recipe_pack_complete",c),n.json||console.log(`${n.check?"Checked":n.dryRun?"Validated":"Packed"} ${o}`),c}catch(t){j(n,"recipe_pack",t,O.UserError),I(O.UserError)}}import jG from"open";import{createAuthClient as VG}from"better-auth/client";import{deviceAuthorizationClient as NG}from"better-auth/client/plugins";async function Na(n){let t=_e(n.target),e=VG({baseURL:t,fetchOptions:{headers:Pt()},plugins:[NG()]}),o=ie("Requesting device code\u2026",n.json),r;try{let{data:f,error:g}=await e.device.code({client_id:"cueframe-cli",scope:"openid profile email"});(g||!f)&&(o.fail(`Could not start login: ${g?.message??"unknown error"}`),I(O.NetworkError)),r=f}catch(f){o.fail(`Could not start login: ${f instanceof Error?f.message:String(f)}`),I(O.NetworkError)}o.succeed("Device code issued");let c=r.verification_uri_complete??r.verification_uri;be("",n),be(` Visit: ${c}`,n),be(` Code: ${r.user_code}`,n),be("",n);try{await jG(c)}catch{}let d=ie("Waiting for approval in browser\u2026",n.json),l=Date.now()+r.expires_in*1e3,m=r.interval*1e3;for(;Date.now()<l;){await new Promise(f=>setTimeout(f,m));try{let{data:f,error:g}=await e.device.token({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:r.device_code,client_id:"cueframe-cli"});if(f?.access_token){let T=f.access_token;vt(T,n.target,n.url),d.succeed(`Logged in. Token saved for target "${n.target}".`),K(n,{ok:!0,target:n.target,apiUrl:t},()=>{});return}let b=f??g,C=b?.error;C==="authorization_pending"||(C==="slow_down"?m+=5e3:C==="access_denied"?(d.fail("Access denied in the browser."),I(O.UserError)):C==="expired_token"?(d.fail("Device code expired before approval. Run `cueframe login` again."),I(O.UserError)):C&&(d.fail(`Login failed: ${b?.error_description??C}`),I(O.ApiClientError)))}catch{}}d.fail("Timed out waiting for approval. Run `cueframe login` again."),I(O.UserError)}import{readFileSync as $G}from"fs";var $a=new Set(["GET","POST","PUT","PATCH","DELETE"]);async function qa(n,t,e){let o=n.toUpperCase();$a.has(o)||(j(e,"api",new Error(`Unsupported method: ${n}. Allowed: ${[...$a].join(", ")}.`),O.UserError),I(O.UserError)),t.startsWith("/")||(j(e,"api",new Error(`Path must start with '/'. Got: ${t}`),O.UserError),I(O.UserError)),H(e.target);let r=_G(e.header??[]),c=await qG(e.body,o);c!==void 0&&!r.has("content-type")&&r.set("content-type","application/json");let d;try{d=await ge(t,{method:o,headers:r,body:c})}catch(m){j(e,"api",m,V(m)),I(V(m))}BG(d,{include:!!e.include,json:!!e.json,method:o,path:t});let l=ce(d.status);l!==O.Success&&j(e,"api",Object.assign(new Error(`${o} ${t} \u2192 ${d.status} ${d.statusText}`),{code:d.body?.error?.code,status:d.status}),l),process.exitCode=l}function BG(n,{include:t,json:e,method:o,path:r}){if(e){console.log(JSON.stringify({status:n.status,statusText:n.statusText,headers:n.headers,body:n.body}));return}if(t){process.stdout.write(`HTTP/1.1 ${n.status} ${n.statusText}
65
- `);for(let[c,d]of Object.entries(n.headers))process.stdout.write(`${c}: ${d}
45
+ `}function pd(o,e){ge(o,"name",e);let t=e.dryRun??!1,r=e.force??!1,s=Ix(o);s||ln(e,`name "${o}" has no alphanumeric characters to form a component identifier.`);let a=Rx(o);V(e,"new_component_prepare",{name:o,dryRun:t,force:r});let p=Io(process.cwd());p||ln(e,"No CueFrame workspace found (no cueframe.json up-tree). Run `cueframe init` first to scaffold one.");let u=Er(p,o),f=Sx(u);f&&Ex(u).length>0&&!r&&ln(e,`Component dir ${u} already exists and is non-empty. Pass --force to overwrite (this replaces local source).`);let m={"index.tsx":wx(o,s),"config.ts":Ox(o,a)};if(!t){zx(u,{recursive:!0});for(let[w,k]of Object.entries(m))ad(cd(u,w),k);let x=cd(p.root,Cx),g=JSON.parse(Tx(x,"utf8")),z=g.components??{};z[o]={custom:!0,manifest:nd},g.components=z,ad(x,`${JSON.stringify(g,null,2)}
46
+ `)}se(e,{ok:!0,dryRun:t,name:o,component:s,dir:u,files:Object.keys(m),overwritten:f&&r},()=>{console.log(`\u2713 ${t?"Would scaffold":"Scaffolded"} custom component ${o} (${s}) into ${u}`);for(let g of Object.keys(m))console.log(` ${t?"would write":"wrote"} ${g}`);t||console.log(` stamped cueframe.json components.${o} (custom)`),console.log("Edit index.tsx, then `cueframe push "+o+"` to publish it to CueFrame.")})}import{existsSync as Or,readFileSync as Mr}from"fs";import{join as kr}from"path";import Ie from"typescript";var Mx="cueframe.json",kx=["effects","transitions","text","layouts"];function Px(o){return kx.includes(o??"")?o:"layouts"}function Lx(o){let e=o;for(;Ie.isAsExpression(e)||Ie.isParenthesizedExpression(e)||typeof Ie.isSatisfiesExpression=="function"&&Ie.isSatisfiesExpression(e);)e=e.expression;return e}function Dx(o,e){for(let t of o.statements)if(Ie.isImportDeclaration(t)&&Ie.isStringLiteral(t.moduleSpecifier)&&t.moduleSpecifier.text===e)return!0;return!1}function dd(o,e){let t=Ie.createSourceFile(e,o,Ie.ScriptTarget.Latest,!0,Ie.ScriptKind.TS),r;for(let a of t.statements)if(Ie.isVariableStatement(a)){for(let p of a.declarationList.declarations)if(Ie.isIdentifier(p.name)&&p.name.text==="config"&&p.initializer){let u=Lx(p.initializer);Ie.isObjectLiteralExpression(u)&&(r=u)}if(r)break}let s={};if(!r)return s;for(let a of r.properties){if(!Ie.isPropertyAssignment(a)||!(Ie.isIdentifier(a.name)||Ie.isStringLiteral(a.name)))continue;let p=a.name.text;Ie.isStringLiteralLike(a.initializer)&&(p==="name"?s.name=a.initializer.text:p==="category"?s.category=a.initializer.text:p==="version"&&(s.version=a.initializer.text))}return s}function vx(o){let e=kr(o,"config.ts");if(!Or(e))return{};let t=Mr(e,"utf8"),r=Ie.createSourceFile("config.ts",t,Ie.ScriptTarget.Latest,!0,Ie.ScriptKind.TS),s=kr(o,"_config.ts");return Dx(r,"./_config")&&Or(s)?dd(Mr(s,"utf8"),"_config.ts"):dd(t,"config.ts")}function Fx(o){return o.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Nx(o,e){let t=kr(o.root,Mx);if(Or(t))try{let s=JSON.parse(Mr(t,"utf8")).components?.[e]?.ejectedFrom;return typeof s=="string"&&s.length>0?s:void 0}catch{return}}var wr="none \u2014 params are unvalidated server-side";function ld(o){let e=o.code;return e==="no_component_source"||e==="no_component_manifest"?B.UserError:q(o)}async function ud(o,e,t){let r=Er(o,e),s=kr(r,"index.tsx");if(!Or(s))throw Object.assign(new Error(`Component "${e}" has no index.tsx at ${r}. Scaffold it first: cueframe new component ${e}`),{code:"no_component_source"});let a=Mr(s,"utf8"),p=vx(r),u=p.name??Fx(e),f=Px(p.category),m=Nx(o,e),x=id(o,e),g=`Custom component "${e}" pushed from the local CueFrame workspace.`,z={type:"object",properties:{}};V(t,"push_component",{id:e,name:u,category:f,version:p.version,ejectedFrom:m,propSchema:wr});let w=!1;try{await Rt.getComponent(e),w=!0}catch(k){if(k instanceof Ve&&k.status===404)w=!1;else throw k}return w?(await Rt.updateComponent(e,{tsxSource:a,name:u,description:g,category:f,propSchema:z,origin:"customer-owned",manifest:x,...m?{ejectedFrom:m}:{}}),V(t,"pushed",{id:e,action:"updated"}),{id:e,action:"updated",name:u,category:f,propSchema:wr}):(await Rt.createComponent({componentId:e,tsxSource:a,name:u,description:g,category:f,propSchema:z,origin:"customer-owned",manifest:x,...m?{ejectedFrom:m}:{}}),V(t,"pushed",{id:e,action:"created"}),{id:e,action:"created",name:u,category:f,propSchema:wr})}async function md(o,e){o||(K(e,"push",new Error("Pass a component id (cueframe push <id>), or use `cueframe sync` to push all."),B.UserError),N(B.UserError)),ge(o,"id",e),re(e.target);let t=Io(process.cwd());t||(K(e,"push",new Error("No CueFrame workspace found (no cueframe.json up-tree). Run `cueframe init` first."),B.UserError),N(B.UserError)),V(e,"push_prepare",{id:o,target:e.target});try{let r=await ud(t,o,e);se(e,{ok:!0,target:e.target,...r},()=>{console.log(`\u2713 ${r.action} component ${r.id} (${r.name}) on CueFrame`),console.log(` propSchema: ${r.propSchema}`)})}catch(r){let s=ld(r);K(e,"push",r,s),N(s)}}async function hd(o){re(o.target);let e=Io(process.cwd());e||(K(o,"sync",new Error("No CueFrame workspace found (no cueframe.json up-tree). Run `cueframe init` first."),B.UserError),N(B.UserError));let t=Zp(e);V(o,"sync_prepare",{target:o.target,count:t.length,ids:t});let r=[],s=[];for(let a of t)try{r.push(await ud(e,a,o))}catch(p){let u=ld(p);Ee(o,"sync",p,u),s.push({id:a,error:p})}se(o,{ok:s.length===0,target:o.target,pushed:r,failed:s.map(a=>({id:a.id,error:ue(a.error)}))},()=>{if(r.length===0&&s.length===0){console.log("No components to sync. Scaffold one with `cueframe eject` or `cueframe new component`.");return}for(let a of r)console.log(`\u2713 ${a.action} ${a.id} (${a.name})`);r.length>0&&console.log(` propSchema: ${wr}`);for(let a of s)console.error(`\u2716 ${a.id}: ${ue(a.error)}`);console.log(`Synced ${r.length}/${t.length} component(s) to CueFrame.`)}),s.length>0&&N(q(s[0].error))}var Pr=["media","sessions","projects","renders","webhooks"],fd={readonly:Object.fromEntries(Pr.map(o=>[o,["read"]])),editall:Object.fromEntries(Pr.map(o=>[o,["read","write"]]))};function _x(o){if(o.preset){let e=fd[o.preset];return e||(console.error(`Unknown --preset "${o.preset}". Valid: ${Object.keys(fd).join(", ")}.`),N(B.UserError)),e}if(o.scope)return Bx(o.scope);console.error("Provide --scope or --preset (e.g. --preset readonly | editall)."),N(B.UserError)}function Bx(o){let e={};for(let t of o.split(",").map(r=>r.trim()).filter(Boolean)){let[r,s]=t.split(":");(!r||!s)&&(console.error(`Invalid --scope "${t}". Use resource:rw (e.g. renders:rw,media:r).`),N(B.UserError)),Pr.includes(r)||(console.error(`--scope "${t}": unknown resource "${r}". Valid: ${Pr.join(", ")}.`),N(B.UserError));let a=[];/r/i.test(s)&&a.push("read"),/w/i.test(s)&&a.push("write"),a.length===0&&(console.error(`--scope "${t}": actions must include r and/or w.`),N(B.UserError)),e[r]=a}return Object.keys(e).length===0&&(console.error("--scope is required, e.g. --scope media:rw,projects:rw,renders:rw"),N(B.UserError)),e}async function xd(o){re(o.target);let e=_x(o),t={name:o.name,permissions:e};if(o.expires){let r=Number(o.expires);(!Number.isFinite(r)||r<=0)&&(console.error("--expires must be a positive number of days."),N(B.UserError)),t.expiresIn=Math.round(r*86400)}try{let r=await Mp("/v1/api-keys",{method:"POST",body:JSON.stringify(t),headers:{"content-type":"application/json"}});se(o,{ok:!0,id:r.id,prefix:r.prefix,start:r.start,key:r.key},()=>{let s=Object.entries(e).map(([a,p])=>`${a}:${p.map(u=>u[0]).join("")}`).join(" ");console.log(`\u2713 API key "${o.name}" created \u2014 scopes: ${s}`),console.log(`
47
+ ${r.key}
48
+ `),console.log(" Shown ONCE \u2014 store it now (paste it into your integration; not saved here).")})}catch(r){K(o,"keys_create",r,q(r)),N(q(r))}}async function gd(o){re(o.target);let e;try{e=await qe("/api/auth/api-key/list",{method:"GET"})}catch(r){K(o,"keys_list",r,q(r)),N(q(r))}e.status>=400&&(K(o,"keys_list",new Error(`list failed (${e.status})`),Oe(e.status)),N(Oe(e.status)));let t=Array.isArray(e.body)?e.body:[];se(o,{ok:!0,keys:t},()=>{if(t.length===0){console.log("No API keys.");return}for(let r of t)console.log(` ${r.id} ${r.name??"(unnamed)"} ${r.start??""}\u2026`)})}async function bd(o,e){re(e.target);let t;try{t=await qe("/api/auth/api-key/delete",{method:"POST",body:JSON.stringify({keyId:o}),headers:{"content-type":"application/json"}})}catch(r){K(e,"keys_revoke",r,q(r)),N(q(r))}t.status>=400&&(K(e,"keys_revoke",new Error(`revoke failed (${t.status})`),Oe(t.status)),N(Oe(t.status))),se(e,{ok:!0,revoked:o},()=>console.log(`\u2713 Revoked ${o}`))}async function yd(o){re(o.target),V(o,"list_prepare",{target:o.target});try{let e=await Yt.listProjects(),t=o.limit,r=typeof t=="number"&&Number.isFinite(t)&&t>0?e.data.slice(0,t):e.data;if(V(o,"list_complete",{count:r.length,total:e.data.length,truncated:r.length<e.data.length,projects:r}),!o.json){if(e.data.length===0){console.log("No projects found.");return}for(let s of r){let a=new Date(s.createdAt).toLocaleDateString();console.log(` ${s.id} ${s.name} (${a})`)}r.length<e.data.length&&console.log(` \u2026 ${e.data.length-r.length} more (raise --limit to see all)`)}}catch(e){K(o,"list",e,q(e)),N(q(e))}}import{readFile as jx,stat as Vx}from"fs/promises";import{existsSync as Ux}from"fs";import{basename as Hx,extname as Wx}from"path";var $x=4e3,Ad=1800*1e3,Sd=5,zd={".mp4":"video/mp4",".mov":"video/quicktime",".webm":"video/webm",".mkv":"video/x-matroska",".wav":"audio/wav",".mp3":"audio/mpeg",".m4a":"audio/mp4",".aac":"audio/aac",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml"};function Gx(o,e){let t=Wx(o).toLowerCase(),r=zd[t];if(!r){let s=new Error(`Unsupported file extension "${t||"(none)"}" for ${o}. Supported: ${Object.keys(zd).join(", ")}.`);K(e,"preflight",s,B.UserError),N(B.UserError)}return r}var Td=["vo","music","sfx","ambience"];async function Lr(o,e){Ux(o)||(K(e,"preflight",new Error(`File not found: ${o}`),B.UserError),N(B.UserError));let t=Hx(o),r=(await Vx(o)).size,s=Gx(t,e);if(e.audioRole&&!Td.includes(e.audioRole)){let F=new Error(`--audio-role must be one of ${Td.join("|")} (got "${e.audioRole}")`);K(e,"preflight",F,B.UserError),N(B.UserError)}let a=e.audioRole;if(e.dryRun){V(e,"upload_dry_run",{file:t,sizeBytes:r,contentType:s,target:e.target,analyzeAfter:!!e.analyze,wouldCall:"POST /v1/media \u2192 presigned PUT \u2192 POST /v1/media/:id/finalize \u2192 poll processing"}),e.json||console.log(`[dry-run] Would upload ${t} (${(r/1024/1024).toFixed(1)} MB, ${s}) to ${e.target}.`);return}re(e.target),V(e,"upload_prepare",{file:t,sizeBytes:r,contentType:s,target:e.target});let p=Ce("Preparing upload\u2026",e.json),u,f;try{let F=await wt.createMediaUpload({filename:t,contentType:s,size:r});u=F.id,f=F.uploadUrl,p.succeed("Ready"),V(e,"upload_ready",{mediaItemId:u})}catch(F){p.fail(`Failed: ${ue(F)}`),Ee(e,"upload_prepare",F,q(F)),N(q(F))}let m=Date.now(),x=Ce(`Uploading ${t} (${(r/1024/1024).toFixed(1)} MB)\u2026`,e.json);try{let F=await jx(o),Y=await fetch(f,{method:"PUT",headers:{"Content-Type":s},body:F});if(!Y.ok)throw new Error(`presigned PUT failed: ${Y.status} ${Y.statusText}`);await wt.finalizeMedia(u,a?{audioRole:a}:{}),x.succeed(`Uploaded: ${t}`),V(e,"upload_complete",{mediaItemId:u,bytesUploaded:r,...a?{audioRole:a}:{},durationMs:Date.now()-m})}catch(F){x.fail(`Upload failed: ${ue(F)}`),Ee(e,"upload",F,B.NetworkError),N(B.NetworkError)}let g=Ce("Processing (transcription)\u2026",e.json),z=Date.now(),w=null,k=0;for(;;){if(await new Promise(F=>setTimeout(F,$x)),Date.now()-z>Ad){let F=`Processing did not complete within ${Math.round(Ad/6e4)}m. Media item ID: ${u}.`;g.fail(F),Ee(e,"process",new Error(F),B.ApiServerError),N(B.ApiServerError)}try{let F=await wt.getMedia(u);k=0;let Y=F?.processingStatus?.phase??"unknown",W=F?.processingStatus?.percent??null,ee=Math.round((Date.now()-z)/1e3),de=W!=null?` \xB7 ${Math.round(W*100)}%`:"";if(g.text=`Processing\u2026 ${Y}${de} (${ee}s)`,V(e,"process_progress",{phase:Y,percent:W,elapsedSec:ee}),Y==="complete"||Y==="completed"){g.succeed(`Ready: ${u}`),w=F,V(e,"process_complete",{mediaItemId:u,durationMs:Date.now()-z,item:F});break}if(Y==="error"){let Te=F?.processingStatus?.error??"unknown error";g.fail(`Processing failed: ${Te}`),Ee(e,"process",new Error(Te),B.ApiServerError),N(B.ApiServerError)}}catch(F){F instanceof Ve&&[401,403,404].includes(F.status)&&(g.fail(`Processing check failed: ${ue(F)}`),Ee(e,"process",F,q(F)),N(q(F))),k++,k>=Sd&&(g.fail(`Processing check failed: ${ue(F)}`),Ee(e,"process",new Error(`Processing status unreadable after ${Sd} consecutive failures: ${ue(F)}`),q(F)),N(q(F)))}}if(e.analyze){Je(`
49
+ Media item ID: ${u}`,e);let{analyzeCommand:F}=await import("./analyze-4KYPG6F7.js");return await F(u,{target:e.target,wait:!0,json:e.json}),{mediaItemId:u,item:w}}return e.json||se(e,{mediaItemId:u,item:w},()=>{console.log(`
50
+ Media item ID: ${u}`),console.log(`
51
+ Run \`cueframe analyze ${u} --target ${e.target}\` to generate clip suggestions.`)}),{mediaItemId:u,item:w}}function un(o){let e=Math.floor(o/60),t=Math.floor(o%60);return`${e}:${String(t).padStart(2,"0")}`}async function Ed(o,e){o!==void 0&&ge(o,"mediaItemId",e),re(e.target),V(e,"clips_prepare",{target:e.target,mode:o?"suggestions":"media-list",...o?{mediaItemId:o}:{}});try{if(!o){let r=await wt.listMedia();if(V(e,"clips_complete",{mode:"media-list",count:r.data.length,media:r.data}),!e.json){if(r.data.length===0){console.log("No media items found. Import a video first.");return}console.log("Media items (pass the ID to `cueframe clips <id>`):"),console.log("");for(let s of r.data){let a=s.duration?`${un(s.duration)} `:"",p=s.processingStatus?.phase??"unknown",u=p==="complete"?"":` [${p}]`;console.log(` ${s.id} ${s.name} ${a}${u}`)}}return}let t=await Dp.listMediaSuggestions(o);if(V(e,"clips_complete",{mode:"suggestions",mediaItemId:o,count:t.suggestions.length,suggestions:t.suggestions}),!e.json){if(t.suggestions.length===0){console.log("No clip suggestions found for this media item."),console.log("If analysis is still running, try again shortly. Otherwise the video may not have suitable clips.");return}console.log(`${t.suggestions.length} clip suggestion${t.suggestions.length!==1?"s":""}:`),console.log("");for(let r of t.suggestions){let s=`${un(r.trim.start)} \u2192 ${un(r.trim.end)}`,a=(r.trim.end-r.trim.start).toFixed(1);console.log(` ${r.id}`),console.log(` ${r.title}`),console.log(` ${s} (${a}s) ${r.format} score: ${r.score}`),r.reason&&console.log(` ${r.reason}`),console.log("")}}}catch(t){K(e,"clips",t,q(t)),N(q(t))}}import{readFileSync as Kx}from"fs";async function Cd(o,e){ge(o,"projectId",e),re(e.target),V(e,"composition_get_prepare",{projectId:o});let t=await Ro(`/v1/projects/${o}/composition`,{method:"GET"},e,"composition_get");t.status>=400&&(wo(t,e,"composition_get"),N(Oe(t.status)));let r=t.headers.etag,s=r&&Id(r);V(e,"composition_get_complete",{projectId:o,etag:s,status:t.status}),se(e,{etag:s,composition:t.body},()=>{s&&console.log(`# ETag: ${s}`),console.log(JSON.stringify(t.body,null,2))})}async function Dr(o,e){ge(o,"projectId",e),e.body||(console.error("--body is required (inline JSON, @file.json, or @- for stdin)"),N(B.UserError)),re(e.target);let t=await mn(o,e),r=await Rd(e.body);V(e,"composition_put_prepare",{projectId:o,ifMatch:t});let s=new Headers({"content-type":"application/json","if-match":t}),a=await Ro(`/v1/projects/${o}/composition`,{method:"PUT",headers:s,body:r},e,"composition_put");a.status>=400&&(wo(a,e,"composition_put"),N(Oe(a.status)));let p=a.headers.etag;return V(e,"composition_put_complete",{projectId:o,etag:p,status:a.status,response:a.body}),se(e,{etag:p,response:a.body},()=>{console.log(`Composition saved (ETag: ${p??"unknown"}).`),a.body&&typeof a.body=="object"&&console.log(JSON.stringify(a.body,null,2))}),{etag:p,response:a.body}}async function vr(o,e){ge(o,"projectId",e),e.suggestionId||(console.error("--suggestion <suggestionId> is required"),N(B.UserError)),re(e.target);let t=await mn(o,e),r;if(e.format)try{r=JSON.parse(e.format)}catch{console.error(`--format must be JSON, e.g. '{"aspectRatio":"9:16","fps":30,"resolution":"fhd"}'`),N(B.UserError)}let s=JSON.stringify({suggestionId:e.suggestionId,...r?{format:r}:{}});V(e,"composition_from_suggestion_prepare",{projectId:o,suggestionId:e.suggestionId,ifMatch:t});let a,p=t,u=0,f=3;for(;;){u++;let x=new Headers({"content-type":"application/json","if-match":p});if(a=await Ro(`/v1/projects/${o}/composition/from-suggestion`,{method:"POST",headers:x,body:s},e,"composition_from_suggestion"),!(a.status===409&&a.body?.error?.code==="stale_etag"))break;if(u>f){V(e,"composition_from_suggestion_etag_retries_exhausted",{projectId:o,attempts:f});break}V(e,"composition_from_suggestion_etag_retry",{projectId:o,attempt:u,reason:"stale_etag"}),p=await mn(o,e)}a.status>=400&&(wo(a,e,"composition_from_suggestion"),N(Oe(a.status)));let m=a.headers.etag;V(e,"composition_from_suggestion_complete",{projectId:o,suggestionId:e.suggestionId,etag:m,status:a.status,response:a.body,attempts:u}),se(e,{etag:m,response:a.body},()=>{console.log(`Composition built from suggestion ${e.suggestionId} (ETag: ${m??"unknown"}).`),a.body&&typeof a.body=="object"&&console.log(JSON.stringify(a.body,null,2))})}async function Fr(o){o.body||(console.error("--body is required (inline JSON, @file.json, or @- for stdin)"),N(B.UserError)),re(o.target);let e=await Rd(o.body);V(o,"composition_validate_prepare",{});let t=new Headers({"content-type":"application/json"}),r=await Ro("/v1/composition/validate",{method:"POST",headers:t,body:e},o,"composition_validate");return r.status>=400&&(wo(r,o,"composition_validate"),N(Oe(r.status))),V(o,"composition_validate_complete",{status:r.status}),se(o,{valid:!0},()=>{console.log("\u2713 Composition is valid.")}),{valid:!0}}function Id(o){return o.replace(/^W\//,"").replace(/-gzip(?=("?)$)/,"")}async function mn(o,e){if(e.force)return"*";if(e.ifMatch)return e.ifMatch;let t=await Ro(`/v1/projects/${o}/composition`,{method:"GET"},e,"composition_etag_fetch");if(t.status===404)return Je("No existing composition; treating as create (If-Match: *).",e),"*";t.status>=400&&(wo(t,e,"composition_etag_fetch"),N(Oe(t.status)));let r=t.headers.etag;return r||(K(e,"composition_etag_fetch",new Error("Server returned no ETag on composition GET; cannot safely thread If-Match. Pass --force to overwrite anyway."),B.ApiServerError),N(B.ApiServerError)),Id(r)}async function Rd(o){if(o.startsWith("@")){let e=o.slice(1);if(e==="-"){let t=[];for await(let r of process.stdin)t.push(Buffer.isBuffer(r)?r:Buffer.from(r));return Buffer.concat(t).toString("utf-8")}return Kx(e,"utf-8")}return o}async function Ro(o,e,t,r){try{return await qe(o,e)}catch(s){K(t,r,s,B.NetworkError),N(B.NetworkError)}}function wo(o,e,t){let r=o.body?.error,s=r?.code??"unknown",a=r?.message??o.statusText,p=qx(s,o.status,r?.details),u=Oe(o.status);e.json?K(e,t,Object.assign(new Error(a),{code:s,status:o.status,details:r?.details,advice:p}),u):(process.stderr.write(`\u2716 ${t}: ${a} (${s}, ${o.status})
52
+ `),p&&process.stderr.write(` \u2192 ${p}
53
+ `))}function qx(o,e,t){let r=new Ve(e,{code:o,message:"",details:t&&typeof t=="object"?t:void 0}),s=kp(r);return s||(e===404?"Project or composition not found. Run `cueframe list` to confirm the project ID; the composition may not yet exist.":null)}async function Nr(o){let e=o.aspect?{aspectRatio:o.aspect,fps:o.fps??30,resolution:o.resolution??"fhd"}:void 0;if(o.dryRun){if(V(o,"project_create_dry_run",{name:o.name,target:o.target,format:e??null,brandKitId:o.brandKitId??null,fromSuggestion:o.fromSuggestion??null,cheap:o.cheap??!1,wouldCall:o.fromSuggestion?o.cheap?"POST /v1/projects \u2192 POST /v1/projects/:id/composition/from-suggestion (sync translator)":"POST /v1/projects \u2192 POST /v1/projects/:id/compose (async) \u2192 SSE watch":"POST /v1/projects"}),!o.json){let s=o.cheap?" (--cheap: deterministic translator)":"";console.log(`[dry-run] Would create project "${o.name}" on ${o.target}`+(o.fromSuggestion?` from suggestion ${o.fromSuggestion}${s}.`:"."))}return}re(o.target),V(o,"project_create_prepare",{name:o.name,target:o.target,fromSuggestion:o.fromSuggestion??null,brandKitId:o.brandKitId??null,cheap:o.cheap??!1});let t=Ce(`Creating project "${o.name}"\u2026`,o.json),r;try{r=await Yt.createProject({name:o.name,format:e,brandKitId:o.brandKitId}),t.succeed(`Created: ${r.id}`)}catch(s){t.fail(`Failed: ${ue(s)}`),Ee(o,"project_create",s,q(s)),N(q(s))}if(V(o,"project_create_complete",{project:r}),!o.json&&!o.fromSuggestion&&console.log(`
54
+ ${r.id} ${r.name}`),o.fromSuggestion){let s=!1;if(s||await vr(r.id,{target:o.target,suggestionId:o.fromSuggestion,json:o.json,force:!0}),!o.json){let a=s?"(composed)":"(translated)";console.log(`
55
+ ${r.id} ${r.name} \u2190 composed from ${o.fromSuggestion} ${a}`)}}return r}async function wd(o,e){ge(o,"projectId",e),re(e.target),V(e,"project_delete_prepare",{projectId:o});try{await Yt.deleteProject(o),V(e,"project_delete_complete",{projectId:o}),se(e,{ok:!0,projectId:o},()=>{console.log(`Project ${o} deleted.`)})}catch(t){K(e,"project_delete",t,q(t)),N(q(t))}}async function Od(o,e){ge(o,"mediaId",e),re(e.target),V(e,"media_delete_prepare",{mediaId:o});try{await wt.deleteMedia(o),V(e,"media_delete_complete",{mediaId:o}),se(e,{ok:!0,mediaId:o},()=>{console.log(`Media ${o} deleted.`)})}catch(t){K(e,"media_delete",t,q(t)),N(q(t))}}import{writeFileSync as Yx}from"fs";import{resolve as Qx}from"path";var Jx=1500,Zx=4e3,Xx=1800*1e3,Md=5;async function hn(o,e,t={}){let r=Date.now()+(t.timeoutMs??Xx),s=t.reconnectBackoffMs??Jx,a=Date.now(),p=0;for(;Date.now()<r;){let u=null,f=!1;try{for await(let m of Pp(o,e)){if(p=0,m.event==="progress"){let x=Math.round((Date.now()-a)/1e3);if(t.spinner){let g=Math.round(m.data.percent*100);t.spinner.text=`Rendering\u2026 ${m.data.phase}${g>0?` \xB7 ${g}%`:""} (${x}s)`}t.onProgress?.({phase:m.data.phase,percent:m.data.percent,elapsedSec:x});continue}m.event==="complete"?u={kind:"complete",outputUrl:m.data.outputUrl,outputExpiresAt:m.data.outputExpiresAt,duration:m.data.duration}:u={kind:"failed",message:m.data.message};break}}catch(m){if(m instanceof Ve)f=!0;else{if(p++,p>=Md)throw Object.assign(new Error(`Render stream unreachable after ${Md} consecutive transport failures: ${m instanceof Error?m.message:String(m)}`),{cause:m});await new Promise(x=>setTimeout(x,s));continue}}if(u)return u;if(f){let m=await eg(o,e);if(m)return m;await new Promise(x=>setTimeout(x,Zx));continue}await new Promise(m=>setTimeout(m,s))}return{kind:"failed",message:`Timed out waiting for render to reach a terminal state. Render ID: ${e}, Project ID: ${o}.`}}async function eg(o,e){let t=await vp.getRender(o,e);return t.status==="complete"?{kind:"complete",outputUrl:t.outputUrl??null,outputExpiresAt:null,duration:null}:t.status==="error"||t.status==="cancelled"?{kind:"failed",message:t.error??`Render ${t.status}`}:null}async function kd(o,e){ge(o,"renderId",e),ge(e.project,"projectId",e),re(e.target),V(e,"render_watch_prepare",{renderId:o,projectId:e.project,target:e.target});let t=Ce(`Watching render ${o}\u2026`,e.json),r;try{r=await hn(e.project,o,{spinner:t,onProgress:a=>V(e,"render_progress",{renderId:o,...a})})}catch(a){t.fail(`Failed to watch render: ${ue(a)}`),Ee(e,"render_watch",a,q(a)),N(q(a))}r.kind==="failed"&&(t.fail(r.message),Ee(e,"render_watch",new Error(r.message),B.ApiServerError),N(B.ApiServerError)),t.succeed(`Render complete (${o})`);let s=null;e.download&&r.outputUrl?s=await fn(r.outputUrl,e.out??`./reel-${o.slice(0,8)}.mp4`,e.json):r.outputUrl||(K(e,"render_watch",new Error("Render reported complete but no outputUrl was returned."),B.ApiServerError),e.json||console.error(`Render reported complete but no outputUrl was returned.
56
+ Re-fetch via GET /v1/projects/${e.project}/renders/${o}.`),N(B.ApiServerError)),V(e,"render_complete",{renderId:o,projectId:e.project,outputUrl:r.outputUrl,outputExpiresAt:r.outputExpiresAt,duration:r.duration,outputPath:s}),e.json||(r.outputUrl&&console.log(`MP4 URL: ${r.outputUrl}`),r.outputExpiresAt&&console.log(`Expires: ${r.outputExpiresAt}`),r.duration!=null&&console.log(`Duration: ${r.duration}s`))}async function fn(o,e,t){let r=Qx(e),s=Ce(`Downloading \u2192 ${r}\u2026`,t);try{let a=await fetch(o);if(!a.ok)throw new Error(`HTTP ${a.status}`);let p=Buffer.from(await a.arrayBuffer());return Yx(r,p),s.succeed(`Saved: ${r} (${(p.length/1024/1024).toFixed(1)} MB)`),r}catch(a){s.fail(`Download failed: ${ue(a)}`),console.error(`
57
+ MP4 URL (1-hour TTL): ${o}`),N(B.NetworkError)}}async function Pd(o,e){let t=e.map(p=>p==null?"null":String(p)).join(":"),r=`${o}:${t}`,s=new TextEncoder().encode(r),a=await crypto.subtle.digest("SHA-256",s);return Array.from(new Uint8Array(a),p=>p.toString(16).padStart(2,"0")).join("")}async function tg(o){let e=await qe(`/v1/projects/${o}/composition`,{method:"GET"});return e.status===404?"no-composition":e.status>=400?"unknown-composition":e.headers.etag??"no-etag"}async function _r(o,e){if(ge(o,"projectId",e),e.dryRun){V(e,"render_dry_run",{projectId:o,target:e.target,wouldCall:"POST /v1/projects/:id/renders \u2192 SSE watch \u2192 download MP4"}),e.json||console.log(`[dry-run] Would render project ${o} on ${e.target}.`);return}re(e.target),V(e,"render_prepare",{projectId:o,target:e.target});let t;try{t=e.idempotencyKey??await Pd("render",[o,await tg(o)]),V(e,"idempotency_key",{scope:"render",key:t,overridden:!!e.idempotencyKey})}catch(x){t="",V(e,"idempotency_key",{scope:"render",key:null,skipped:!0,reason:x instanceof Error?x.message:String(x)})}let r=Ce("Queuing render\u2026",e.json),s,a,p=!1;try{let x=e.aspect?{format:{aspectRatio:e.aspect,fps:e.fps??30,resolution:e.resolution??"fhd"}}:{};e.priority&&(x.priority=e.priority),e.intent&&(x.intent=e.intent);let g={"content-type":"application/json"};t&&(g["idempotency-key"]=t);let z=await qe(`/v1/projects/${o}/renders`,{method:"POST",headers:g,body:JSON.stringify(x)});if(z.status>=400){let k=z.body?.error;throw new Ve(z.status,{code:k?.code??"unknown",message:k?.message??z.statusText})}let w=z.body;s=w.id,a=w.status,p=z.headers["idempotency-replay"]==="true",r.succeed(p?`Render replayed: ${s} (status: ${a})`:`Render queued: ${s}`)}catch(x){r.fail(`Failed: ${ue(x)}`),Ee(e,"render_prepare",x,q(x)),N(q(x))}p?V(e,"render_idempotent_replay",{renderId:s,projectId:o,status:a,idempotencyKey:t}):V(e,"render_queued",{renderId:s,projectId:o});let u=Ce("Rendering\u2026",e.json),f;try{f=await hn(o,s,{spinner:u,onProgress:x=>V(e,"render_progress",{renderId:s,...x})})}catch(x){u.fail(`Failed to watch render: ${ue(x)}`),Ee(e,"render_progress",x,q(x)),N(q(x))}f.kind==="failed"&&(u.fail(f.message),Ee(e,"render_progress",new Error(f.message),B.ApiServerError),N(B.ApiServerError)),u.succeed("Render complete"),f.outputUrl||(K(e,"render_complete",new Error("Render reported complete but no outputUrl was returned."),B.ApiServerError),e.json||console.error(`Render reported complete but no outputUrl was returned.
58
+ Render ID: ${s}
59
+ Project ID: ${o}
60
+ Re-fetch via GET /v1/projects/${o}/renders/${s} once the URL is signed.`),N(B.ApiServerError));let m=await fn(f.outputUrl,e.out??`./reel-${s.slice(0,8)}.mp4`,e.json);return V(e,"render_complete",{renderId:s,projectId:o,outputUrl:f.outputUrl,outputExpiresAt:f.outputExpiresAt,duration:f.duration,outputPath:m}),{renderId:s,projectId:o,outputUrl:f.outputUrl,outputExpiresAt:f.outputExpiresAt,duration:f.duration,outputPath:m}}import{existsSync as Br}from"fs";import{readFile as og}from"fs/promises";import{resolve as Ye}from"path";var xn="REPLACE_WITH_MEDIA_ID";function Xt(o,e,t=xn){let r=0,s=p=>p===t?(r+=1,e):Array.isArray(p)?p.map(s):p&&typeof p=="object"?Object.fromEntries(Object.entries(p).map(([u,f])=>[u,s(f)])):p,a=s(o);if(r!==1)throw new Error(`Recipe must contain exactly one ${t} media value; found ${r}.`);return a}async function gn(o,e){try{return JSON.parse(await og(o,"utf8"))}catch(t){K(e,"recipe_read",new Error(`Could not read valid JSON from ${o}: ${ue(t)}`),B.UserError),N(B.UserError)}}function Ld(o,e,t){let r=o.recipe?.mediaSlots?.[0]?.projectMediaId;(!o.name||!o.composition||!r||!o.recipe?.cloudBrandKit)&&(K(t,"recipe_read",new Error(`${e} is a project, but not a portable CueFrame recipe template.`),B.UserError),N(B.UserError));let s=(o.recipe.components??[]).map(a=>{let p=a.componentId,u=a.sourceVersionId,f=p&&u?o.authoredComponents?.[p]?.versions?.[u]:void 0;return(!p||!u||!f||f.componentId!==p)&&(K(t,"recipe_read",new Error(`${e} has an invalid authored component reference.`),B.UserError),N(B.UserError)),{id:p,name:a.name||p,category:a.category??"layouts",source:f,propSchema:a.propSchema}});return{name:o.name,brandKit:o.recipe.cloudBrandKit,composition:o.composition,mediaPlaceholder:r,components:s}}async function rg(o,e){let t=Ye(o);if(t.endsWith(".cueframe"))return Ld(await gn(t,e),t,e);if(!Br(t)&&/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(o)){let p=`https://raw.githubusercontent.com/cueframe-ai/cueframe-recipes/main/${o}/recipe.cueframe`;try{let u=await fetch(p,{headers:{accept:"application/json"}});if(!u.ok)throw new Error(`${u.status} ${u.statusText}`);return Ld(await u.json(),p,e)}catch(u){K(e,"recipe_fetch",new Error(`Could not load recipe "${o}" from cueframe-ai/cueframe-recipes: ${ue(u)}`),B.NetworkError),N(B.NetworkError)}}let r=t,[s,a]=await Promise.all([gn(Ye(r,"brand-kit.json"),e),gn(Ye(r,"composition.template.json"),e)]);return{name:r.split("/").pop()??s.name,brandKit:s,composition:a,mediaPlaceholder:xn,components:[]}}async function sg(o,e){let t=o.components.map(r=>({component:r,manifest:dn(r.source.manifest,r.id,`the ${o.name} recipe source manifest`)}));for(let{component:r,manifest:s}of t){let a={tsxSource:r.source.tsxSource,name:r.name,description:`Authored component installed from the ${o.name} CueFrame recipe.`,category:r.category,propSchema:r.propSchema??{type:"object",properties:{}},origin:"customer-owned",manifest:s},p=!1;try{await Rt.getComponent(r.id),p=!0}catch(u){if(!(u instanceof Ve)||u.status!==404)throw u}p?await Rt.updateComponent(r.id,a):await Rt.createComponent({componentId:r.id,...a}),V(e,"recipe_component_ready",{componentId:r.id,action:p?"updated":"created"})}}async function Dd(o){let e=await rg(o.directory,o);if(o.dryRun){Xt(e.composition,"dry_run_media_id",e.mediaPlaceholder);let g={recipe:Br(Ye(o.directory))?Ye(o.directory):o.directory,media:Ye(o.media),target:o.target,render:o.render,output:Ye(o.out),wouldRun:["upload source media",...e.components.length>0?["install authored recipe components"]:[],"upsert recipe brand kit","create project","bind media to recipe composition","validate composition","save composition",...o.render?["render and download MP4"]:[]]};return se(o,g,()=>console.log(`[dry-run] Recipe is valid. Would create ${e.name}.`)),g}V(o,"recipe_run_prepare",{recipe:Br(Ye(o.directory))?Ye(o.directory):o.directory,media:Ye(o.media),target:o.target});let t=await Lr(o.media,{target:o.target,analyze:!1,json:o.json});re(o.target);try{await sg(e,o)}catch(g){K(o,"recipe_components",g,q(g)),N(q(g))}let r;try{r=await Lp.createBrandKit(e.brandKit),V(o,"recipe_brand_kit_ready",{brandKitId:r.id})}catch(g){K(o,"recipe_brand_kit",g,q(g)),N(q(g))}let s=e.composition.format,a=await Nr({name:e.name,target:o.target,aspect:s?.aspectRatio,fps:s?.fps,resolution:s?.resolution,brandKitId:r.id,json:o.json});if(!t||!a)throw new Error("Recipe orchestration stopped before CueFrame returned the required media and project IDs.");let p=Xt(e.composition,t.mediaItemId,e.mediaPlaceholder),u=JSON.stringify(p);await Fr({target:o.target,body:u,json:o.json});let f=await Dr(a.id,{target:o.target,body:u,force:!0,json:o.json}),m=o.render?await _r(a.id,{target:o.target,out:o.out,json:o.json}):void 0,x={recipe:Br(Ye(o.directory))?Ye(o.directory):o.directory,mediaItemId:t.mediaItemId,brandKitId:r.id,projectId:a.id,compositionEtag:f.etag,...m?{renderId:m.renderId,outputPath:m.outputPath}:{}};return V(o,"recipe_run_complete",x),o.json||se(o,x,()=>{console.log(`
61
+ Recipe ready in project ${a.id}.`),m&&console.log(`Output: ${m.outputPath}`)}),x}import{readFile as hf,writeFile as cde,rename as pde,unlink as dde}from"fs/promises";import{randomUUID as lde}from"crypto";import{resolve as ff}from"path";function ng(o){return o instanceof Uint8Array||ArrayBuffer.isView(o)&&o.constructor.name==="Uint8Array"}function Oo(o,...e){if(!ng(o))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(o.length))throw new Error("Uint8Array expected of length "+e+", got length="+o.length)}function bn(o,e=!0){if(o.destroyed)throw new Error("Hash instance has been destroyed");if(e&&o.finished)throw new Error("Hash#digest() has already been called")}function vd(o,e){Oo(o);let t=e.outputLen;if(o.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}function Mo(...o){for(let e=0;e<o.length;e++)o[e].fill(0)}function Vr(o){return new DataView(o.buffer,o.byteOffset,o.byteLength)}function Ze(o,e){return o<<32-e|o>>>e}var ig=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",ag=Array.from({length:256},(o,e)=>e.toString(16).padStart(2,"0"));function Fd(o){if(Oo(o),ig)return o.toHex();let e="";for(let t=0;t<o.length;t++)e+=ag[o[t]];return e}function cg(o){if(typeof o!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(o))}function yn(o){return typeof o=="string"&&(o=cg(o)),Oo(o),o}var jr=class{};function Nd(o){let e=r=>o().update(yn(r)).digest(),t=o();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>o(),e}function pg(o,e,t,r){if(typeof o.setBigUint64=="function")return o.setBigUint64(e,t,r);let s=BigInt(32),a=BigInt(4294967295),p=Number(t>>s&a),u=Number(t&a),f=r?4:0,m=r?0:4;o.setUint32(e+f,p,r),o.setUint32(e+m,u,r)}function _d(o,e,t){return o&e^~o&t}function Bd(o,e,t){return o&e^o&t^e&t}var Ur=class extends jr{constructor(e,t,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(e),this.view=Vr(this.buffer)}update(e){bn(this),e=yn(e),Oo(e);let{view:t,buffer:r,blockLen:s}=this,a=e.length;for(let p=0;p<a;){let u=Math.min(s-this.pos,a-p);if(u===s){let f=Vr(e);for(;s<=a-p;p+=s)this.process(f,p);continue}r.set(e.subarray(p,p+u),this.pos),this.pos+=u,p+=u,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){bn(this),vd(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:a}=this,{pos:p}=this;t[p++]=128,Mo(this.buffer.subarray(p)),this.padOffset>s-p&&(this.process(r,0),p=0);for(let g=p;g<s;g++)t[g]=0;pg(r,s-8,BigInt(this.length*8),a),this.process(r,0);let u=Vr(e),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let m=f/4,x=this.get();if(m>x.length)throw new Error("_sha2: outputLen bigger than state");for(let g=0;g<m;g++)u.setUint32(4*g,x[g],a)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:s,finished:a,destroyed:p,pos:u}=this;return e.destroyed=p,e.finished=a,e.length=s,e.pos=u,s%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}},St=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var dg=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Mt=new Uint32Array(64),Hr=class extends Ur{constructor(e=32){super(64,e,8,!1),this.A=St[0]|0,this.B=St[1]|0,this.C=St[2]|0,this.D=St[3]|0,this.E=St[4]|0,this.F=St[5]|0,this.G=St[6]|0,this.H=St[7]|0}get(){let{A:e,B:t,C:r,D:s,E:a,F:p,G:u,H:f}=this;return[e,t,r,s,a,p,u,f]}set(e,t,r,s,a,p,u,f){this.A=e|0,this.B=t|0,this.C=r|0,this.D=s|0,this.E=a|0,this.F=p|0,this.G=u|0,this.H=f|0}process(e,t){for(let g=0;g<16;g++,t+=4)Mt[g]=e.getUint32(t,!1);for(let g=16;g<64;g++){let z=Mt[g-15],w=Mt[g-2],k=Ze(z,7)^Ze(z,18)^z>>>3,F=Ze(w,17)^Ze(w,19)^w>>>10;Mt[g]=F+Mt[g-7]+k+Mt[g-16]|0}let{A:r,B:s,C:a,D:p,E:u,F:f,G:m,H:x}=this;for(let g=0;g<64;g++){let z=Ze(u,6)^Ze(u,11)^Ze(u,25),w=x+z+_d(u,f,m)+dg[g]+Mt[g]|0,F=(Ze(r,2)^Ze(r,13)^Ze(r,22))+Bd(r,s,a)|0;x=m,m=f,f=u,u=p+w|0,p=a,a=s,s=r,r=w+F|0}r=r+this.A|0,s=s+this.B|0,a=a+this.C|0,p=p+this.D|0,u=u+this.E|0,f=f+this.F|0,m=m+this.G|0,x=x+this.H|0,this.set(r,s,a,p,u,f,m,x)}roundClean(){Mo(Mt)}destroy(){this.set(0,0,0,0,0,0,0,0),Mo(this.buffer)}};var jd=Nd(()=>new Hr);var Vd=jd;var Ud=["Inter","Space Mono","Montserrat","Roboto","Poppins","Oswald","Playfair Display","Bebas Neue","Instrument Serif","National Park","Bricolage Grotesque","Schibsted Grotesk"],Hd=["Georgia"],Wd=Object.freeze({Inter:{slug:"inter",faces:[{weight:"100 900",file:"400"}],captionDefaults:{base:600,emphasis:800}},Montserrat:{slug:"montserrat",faces:[{weight:"100 900",file:"400"}],captionDefaults:{base:600,emphasis:800}},Roboto:{slug:"roboto",faces:[{weight:"100 900",file:"400"}],captionDefaults:{base:600,emphasis:800}},Oswald:{slug:"oswald",faces:[{weight:"400 700",file:"400"}],captionDefaults:{base:600,emphasis:700}},"Playfair Display":{slug:"playfair-display",faces:[{weight:"400 900",file:"400"},{weight:"400 900",file:"400-italic",style:"italic"}],captionDefaults:{base:600,emphasis:800}},"Bricolage Grotesque":{slug:"bricolage-grotesque",faces:[{weight:"200 800",file:"400"}],captionDefaults:{base:600,emphasis:800}},"Schibsted Grotesk":{slug:"schibsted-grotesk",faces:[{weight:"400 900",file:"400"}],captionDefaults:{base:600,emphasis:800}},"Space Mono":{slug:"space-mono",faces:[{weight:"400",file:"400"},{weight:"700",file:"700"}],captionDefaults:{base:400,emphasis:700}},Poppins:{slug:"poppins",faces:[{weight:"400",file:"400"},{weight:"700",file:"700"}],captionDefaults:{base:400,emphasis:700}},"Bebas Neue":{slug:"bebas-neue",faces:[{weight:"400",file:"400"}],captionDefaults:{base:400,emphasis:400}},"Instrument Serif":{slug:"instrument-serif",faces:[{weight:"400",file:"400"},{weight:"400",file:"400-italic",style:"italic"}],captionDefaults:{base:400,emphasis:400}},"National Park":{slug:"national-park",faces:[{weight:"400",file:"400"}],captionDefaults:{base:400,emphasis:400}},Georgia:{slug:"gelasio",faces:[{weight:"400",file:"400"},{weight:"700",file:"700"}],captionDefaults:{base:400,emphasis:700}}}),An="normal";function ko(o){return Wd[o]}function lg(o,e){let t=o.weight.split(/\s+/).map(Number);if(t.some(a=>!Number.isFinite(a)))return!1;if(t.length===1)return t[0]===e;let[r,s]=t;return e>=r&&e<=s}function $d(o,e,t){let r=ko(o);return r?r.faces.some(s=>(s.style??An)===t&&lg(s,e)):!1}function Gd(o){let e=ko(o);return e?[...new Set(e.faces.map(t=>t.weight.split(/\s+/).join("-")))].join(", "):""}function Kd(o){return o.split(",").map(e=>e.trim().replace(/^['"]|['"]$/g,"").trim()).filter(Boolean)}var ug=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);var mg=new Map(Object.keys(Wd).map(o=>[o.toLowerCase(),o]));function qd(o){if(typeof o!="string"||o.trim().length===0)return{kind:"default"};if(o.includes("$brand:")||o.includes("${"))return{kind:"unknown"};let e;for(let t of Kd(o)){let r=t.toLowerCase();if(ug.has(r))continue;let s=mg.get(r);if(!s)return{kind:"unknown"};e??=s}return e?{kind:"bundled",family:e}:{kind:"default"}}var Wr=Object.freeze({fontFamily:"Inter, 'Helvetica Neue', Helvetica, Arial, sans-serif",fontWeight:600,emphasisFontWeight:800,emphasisFontStyle:"normal"}),hg="Inter";function Yd(o){return typeof o!="string"||o.trim().length===0?{kind:"bundled",family:hg}:qd(o)}function Qd(o){return(o.kind==="bundled"?ko(o.family):void 0)?.captionDefaults??{base:Wr.fontWeight,emphasis:Wr.emphasisFontWeight}}function fg(o){let e=o.fontFamily??Wr.fontFamily,t=Yd(o.fontFamily),r=o.fontWeight??Qd(t).base,s=o.emphasisFontFamily,a=s??e,p=s===void 0?t:Yd(s),u=o.emphasisFontWeight??Qd(p).emphasis,f=o.emphasisFontStyle??Wr.emphasisFontStyle;return{base:{role:"base",field:"fontWeight",stack:e,resolved:t,weight:r,style:An,fromDefault:o.fontWeight===void 0},emphasis:{role:"emphasis",field:f==="italic"?"emphasisFontStyle":"emphasisFontWeight",stack:a,resolved:p,weight:u,style:f,fromDefault:f==="italic"?o.emphasisFontStyle===void 0:o.emphasisFontWeight===void 0}}}function xg(o){let{base:e,emphasis:t}=fg(o);return t.stack===e.stack&&t.weight===e.weight&&t.style===e.style?[e]:[e,t]}var ume=Object.freeze(["fontWeight","emphasisFontWeight","emphasisFontStyle"]);function Jd(o){return o.fromDefault?`no ${o.field} is authored, so the ${o.role} run is drawn at the default ${o.style==="italic"?`${o.field} "italic"`:o.weight}`:`${o.field} ${o.style==="italic"?'"italic"':o.weight} has no file behind it`}function gg(o){if(o.resolved.kind==="default"&&o.style==="italic")return{field:o.field,face:{family:o.stack,weight:o.weight,style:o.style},message:`font_not_reproducible \u2014 ${Jd(o)}: "${o.stack}" names no font file the render bundle carries, so this stack ships no italic binary to select and the browser would slant whatever upright face it matched and the render refuses it before capture. Emphasise with emphasisFontWeight, emphasisColor or emphasisScale, or name an uploaded brand font that is sealed in italic.`};if(o.resolved.kind!=="bundled")return null;let e={family:o.resolved.family,weight:o.weight,style:o.style};if(o.style==="italic"&&!ko(o.resolved.family).faces.some(r=>r.style==="italic"))return{field:o.field,face:e,message:`font_not_reproducible \u2014 ${Jd(o)}: ${o.resolved.family} ships no italic binary, so the browser would slant the upright face and the render refuses it before capture. Emphasise with emphasisFontWeight, emphasisColor or emphasisScale, or name an uploaded brand font that is sealed in italic.`};if($d(o.resolved.family,o.weight,o.style))return null;let t=o.role==="emphasis"?"emphasisFontWeight":"fontWeight";return{field:t,face:e,message:`font_not_reproducible \u2014 ${t} ${o.weight} (${o.style}) has no file behind it: ${o.resolved.family} ships ${Gd(o.resolved.family)}. The render refuses a weight outside that range before capture rather than let the browser substitute a nearby file, so set ${t} to a weight the family covers, or pick a family whose files do.`}}function $r(o){let e=[];for(let t of xg(o)){let r=gg(t);r&&e.push(r)}return e}var mme=Object.freeze(["fontFamily","fontWeight","emphasisFontFamily","emphasisFontWeight","emphasisFontStyle"]);function bg(o){return o.caption?{ref:o.caption,slot:"caption"}:o.body?{ref:o.body,slot:"body"}:{ref:o.heading,slot:"heading"}}function yg(o){let e=o.captionProfile?.fontFamily;if(e!==void 0)return{family:e,path:"captionProfile.fontFamily"};let{ref:t,slot:r}=bg(o.fonts);return{family:t?.family,path:`fonts.${r}`}}function Zd(o){let e=yg(o),t=o.captionProfile??{},r={...t,...e.family!==void 0?{fontFamily:e.family}:{fontFamily:void 0}};return $r(r).map(s=>({...s,path:t[s.field]!==void 0?`captionProfile.${s.field}`:e.path}))}var hme=Object.freeze([400,500,600,700,800,900]);var gme=new Set([...Ud,...Hd].map(o=>o.toLowerCase()));var Ue=d.string();var Xd=d.discriminatedUnion("mode",[d.object({mode:d.literal("frame-center")}),d.object({mode:d.literal("point"),x:d.number().min(0).max(1),y:d.number().min(0).max(1)}),d.object({mode:d.literal("face"),faceId:d.string().min(1),shotScale:d.enum(["close","standard","wide"]).optional()}),d.object({mode:d.literal("all-faces")}),d.object({mode:d.literal("active-speaker")})]),el=d.object({startSec:d.number().nonnegative().describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:d.number().positive().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:Xd.describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:d.string().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:d.number().min(.1).max(1).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale`: a face-tracked shot is sized EITHER by the editorial scale (shotScale, calibrated to the detected face) OR by an explicit zoom \u2014 never both."),ease:d.object({in:d.number().nonnegative().describe("Ease-IN ramp DURATION in seconds at the segment START."),out:d.number().nonnegative().describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:d.object({x:d.number().min(-.3).max(.3).describe("Horizontal nudge, source-normalized (+ = right)."),y:d.number().min(-.3).max(.3).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")}),tl=el.refine(o=>!(o.focus.mode==="face"&&o.focus.shotScale!==void 0&&o.zoom!==void 0),{message:"a face segment takes EITHER focus.shotScale (editorial scale, calibrated to the detected face) OR an explicit zoom \u2014 never both; shotScale wins at bake time and the zoom would be silently discarded",path:["zoom"]}),Sn=d.object({segments:d.array(tl).min(1)});function Fe(o){return o>=48&&o<=57}function lt(o){return Fe(o)||o>=65&&o<=70||o>=97&&o<=102}function Kr(o){return o>=65&&o<=90}function Ag(o){return o>=97&&o<=122}function Sg(o){return Kr(o)||Ag(o)}function zg(o){return o>=128}function Gr(o){return Sg(o)||zg(o)||o===95}function qr(o){return Gr(o)||Fe(o)||o===45}function Tg(o){return o>=0&&o<=8||o===11||o>=14&&o<=31||o===127}function Po(o){return o===10||o===13||o===12}function ut(o){return Po(o)||o===32||o===9}function He(o,e){return!(o!==92||Po(e)||e===0)}function Yr(o,e,t){return o===45?Gr(e)||e===45||He(e,t):Gr(o)?!0:o===92?He(o,e):!1}function Qr(o,e,t){return o===43||o===45?Fe(e)?2:e===46&&Fe(t)?3:0:o===46?Fe(e)?2:0:Fe(o)?1:0}function Jr(o){return o===65279||o===65534?1:0}var zn=new Array(128),Eg=128,Lo=130,Tn=131,Zr=132,En=133;for(let o=0;o<zn.length;o++)zn[o]=ut(o)&&Lo||Fe(o)&&Tn||Gr(o)&&Zr||Tg(o)&&En||o||Eg;function Xr(o){return o<128?zn[o]:Zr}function eo(o,e){return e<o.length?o.charCodeAt(e):0}function es(o,e,t){return t===13&&eo(o,e+1)===10?2:1}function In(o,e,t){let r=o.charCodeAt(e);return Kr(r)&&(r=r|32),r===t}function Nt(o,e,t,r){if(t-e!==r.length||e<0||t>o.length)return!1;for(let s=e;s<t;s++){let a=r.charCodeAt(s-e),p=o.charCodeAt(s);if(Kr(p)&&(p=p|32),p!==a)return!1}return!0}function ol(o,e){for(;e>=0&&ut(o.charCodeAt(e));e--);return e+1}function Do(o,e){for(;e<o.length&&ut(o.charCodeAt(e));e++);return e}function Cn(o,e){for(;e<o.length&&Fe(o.charCodeAt(e));e++);return e}function zt(o,e){if(e+=2,lt(eo(o,e-1))){for(let r=Math.min(o.length,e+5);e<r&&lt(eo(o,e));e++);let t=eo(o,e);ut(t)&&(e+=es(o,e,t))}return e}function vo(o,e){for(;e<o.length;e++){let t=o.charCodeAt(e);if(!qr(t)){if(He(t,eo(o,e+1))){e=zt(o,e)-1;continue}break}}return e}function ts(o,e){let t=o.charCodeAt(e);if((t===43||t===45)&&(t=o.charCodeAt(e+=1)),Fe(t)&&(e=Cn(o,e+1),t=o.charCodeAt(e)),t===46&&Fe(o.charCodeAt(e+1))&&(e+=2,e=Cn(o,e)),In(o,e,101)){let r=0;t=o.charCodeAt(e+1),(t===45||t===43)&&(r=1,t=o.charCodeAt(e+2)),Fe(t)&&(e=Cn(o,e+1+r+1))}return e}function os(o,e){for(;e<o.length;e++){let t=o.charCodeAt(e);if(t===41){e++;break}He(t,eo(o,e+1))&&(e=zt(o,e))}return e}function rs(o){if(o.length===1&&!lt(o.charCodeAt(0)))return o[0];let e=parseInt(o,16);return(e===0||e>=55296&&e<=57343||e>1114111)&&(e=65533),String.fromCodePoint(e)}var to=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function oo(o=null,e){return o===null||o.length<e?new Uint32Array(Math.max(e+1024,16384)):o}var rl=10,Cg=12,sl=13;function nl(o){let e=o.source,t=e.length,r=e.length>0?Jr(e.charCodeAt(0)):0,s=oo(o.lines,t),a=oo(o.columns,t),p=o.startLine,u=o.startColumn;for(let f=r;f<t;f++){let m=e.charCodeAt(f);s[f]=p,a[f]=u++,(m===rl||m===sl||m===Cg)&&(m===sl&&f+1<t&&e.charCodeAt(f+1)===rl&&(f++,s[f]=p,a[f]=u),p++,u=1)}s[t]=p,a[t]=u,o.lines=s,o.columns=a,o.computed=!0}var ss=class{constructor(e,t,r,s){this.setSource(e,t,r,s),this.lines=null,this.columns=null}setSource(e="",t=0,r=1,s=1){this.source=e,this.startOffset=t,this.startLine=r,this.startColumn=s,this.computed=!1}getLocation(e,t){return this.computed||nl(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,r){return this.computed||nl(this),{source:r,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}};var Xe=16777215,et=24,No=1,is=2,kt=new Uint8Array(32);kt[2]=22;kt[21]=22;kt[19]=20;kt[23]=24;var tt=new Uint8Array(32);tt[2]=No;tt[21]=No;tt[19]=No;tt[23]=No;tt[22]=is;tt[20]=is;tt[24]=is;function il(o,e,t){return o<e?e:o>t?t:o}var ns=class{constructor(e,t){this.setSource(e,t)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e="",t=()=>{}){e=String(e||"");let r=e.length,s=oo(this.offsetAndType,e.length+1),a=oo(this.balance,e.length+1),p=0,u=-1,f=0,m=e.length;this.offsetAndType=null,this.balance=null,a.fill(0),t(e,(x,g,z)=>{let w=p++;if(s[w]=x<<et|z,u===-1&&(u=g),a[w]=m,x===f){let k=a[m];a[m]=w,m=k,f=kt[s[k]>>et]}else this.isBlockOpenerTokenType(x)&&(m=w,f=kt[x])}),s[p]=0<<et|r,a[p]=p;for(let x=0;x<p;x++){let g=a[x];if(g<=x){let z=a[g];z!==x&&(a[x]=z)}else g>p&&(a[x]=p)}this.source=e,this.firstCharOffset=u===-1?0:u,this.tokenCount=p,this.offsetAndType=s,this.balance=a,this.reset(),this.next()}lookupType(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e]>>et:0}lookupTypeNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){let r=this.offsetAndType[t]>>et;if(r!==13&&r!==25&&e--===0)return r}return 0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&Xe:this.source.length}lookupOffsetNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){let r=this.offsetAndType[t]>>et;if(r!==13&&r!==25&&e--===0)return t-this.tokenIndex}return 0}lookupValue(e,t){return e+=this.tokenIndex,e<this.tokenCount?Nt(this.source,this.offsetAndType[e-1]&Xe,this.offsetAndType[e]&Xe,t):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&Xe:this.offsetAndType[this.tokenCount]&Xe:this.firstCharOffset}getTokenEnd(e){return e===this.tokenIndex?this.tokenEnd:this.offsetAndType[il(e,0,this.tokenCount)]&Xe}getTokenType(e){return e===this.tokenIndex?this.tokenType:this.offsetAndType[il(e,0,this.tokenCount)]>>et}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBlockOpenerTokenType(e){return tt[e]===No}isBlockCloserTokenType(e){return tt[e]===is}getBlockTokenPairIndex(e){let t=this.getTokenType(e);if(tt[t]===1){let r=this.balance[e],s=this.getTokenType(r);return kt[t]===s?r:-1}else if(tt[t]===2){let r=this.balance[e],s=this.getTokenType(r);return kt[s]===t?r:-1}return-1}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,t){return t?this.lookupType(t)===9&&this.source.charCodeAt(this.lookupOffset(t))===e:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let t=this.tokenIndex+e;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.offsetAndType[t-1]&Xe,t=this.offsetAndType[t],this.tokenType=t>>et,this.tokenEnd=t&Xe):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>et,this.tokenEnd=e&Xe):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(e,t){let r=e,s=0,a=0;e:for(;r<this.tokenCount;r++){if(s=this.balance[r],s<e)break e;switch(a=r>0?this.offsetAndType[r-1]&Xe:this.firstCharOffset,t(this.source.charCodeAt(a))){case 1:break e;case 2:r++;break e;default:this.isBlockOpenerTokenType(this.offsetAndType[r]>>et)&&(r=s)}}this.skip(r-this.tokenIndex)}forEachToken(e){for(let t=0,r=this.firstCharOffset;t<this.tokenCount;t++){let s=r,a=this.offsetAndType[t],p=a&Xe,u=a>>et;r=p,e(u,s,p,t)}}dump(){let e=new Array(this.tokenCount);return this.forEachToken((t,r,s,a)=>{e[a]={idx:a,type:to[t],chunk:this.source.substring(r,s),balance:this.balance[a]}}),e}};function cl(o,e){function t(g){return g<u?o.charCodeAt(g):0}function r(){if(m=ts(o,m),Yr(t(m),t(m+1),t(m+2))){x=12,m=vo(o,m);return}if(t(m)===37){x=11,m++;return}x=10}function s(){let g=m;if(m=vo(o,m),Nt(o,g,m,"url")&&t(m)===40){if(m=Do(o,m+1),t(m)===34||t(m)===39){x=2,m=g+4;return}p();return}if(t(m)===40){x=2,m++;return}x=1}function a(g){for(g||(g=t(m++)),x=5;m<o.length;m++){let z=o.charCodeAt(m);switch(Xr(z)){case g:m++;return;case Lo:if(Po(z)){m+=es(o,m,z),x=6;return}break;case 92:if(m===o.length-1)break;let w=t(m+1);Po(w)?m+=es(o,m+1,w):He(z,w)&&(m=zt(o,m)-1);break}}}function p(){for(x=7,m=Do(o,m);m<o.length;m++){let g=o.charCodeAt(m);switch(Xr(g)){case 41:m++;return;case Lo:if(m=Do(o,m),t(m)===41||m>=o.length){m<o.length&&m++;return}m=os(o,m),x=8;return;case 34:case 39:case 40:case En:m=os(o,m),x=8;return;case 92:if(He(g,t(m+1))){m=zt(o,m)-1;break}m=os(o,m),x=8;return}}}o=String(o||"");let u=o.length,f=Jr(t(0)),m=f,x;for(;m<u;){let g=o.charCodeAt(m);switch(Xr(g)){case Lo:x=13,m=Do(o,m+1);break;case 34:a();break;case 35:qr(t(m+1))||He(t(m+1),t(m+2))?(x=4,m=vo(o,m+1)):(x=9,m++);break;case 39:a();break;case 40:x=21,m++;break;case 41:x=22,m++;break;case 43:Qr(g,t(m+1),t(m+2))?r():(x=9,m++);break;case 44:x=18,m++;break;case 45:Qr(g,t(m+1),t(m+2))?r():t(m+1)===45&&t(m+2)===62?(x=15,m=m+3):Yr(g,t(m+1),t(m+2))?s():(x=9,m++);break;case 46:Qr(g,t(m+1),t(m+2))?r():(x=9,m++);break;case 47:t(m+1)===42?(x=25,m=o.indexOf("*/",m+2),m=m===-1?o.length:m+2):(x=9,m++);break;case 58:x=16,m++;break;case 59:x=17,m++;break;case 60:t(m+1)===33&&t(m+2)===45&&t(m+3)===45?(x=14,m=m+4):(x=9,m++);break;case 64:Yr(t(m+1),t(m+2),t(m+3))?(x=3,m=vo(o,m+1)):(x=9,m++);break;case 91:x=19,m++;break;case 92:He(g,t(m+1))?s():(x=9,m++);break;case 93:x=20,m++;break;case 123:x=23,m++;break;case 125:x=24,m++;break;case Tn:r();break;case Zr:s();break;default:x=9,m++}e(x,f,f=m)}}var kn={};X(kn,{generate:()=>Og,name:()=>Rg,parse:()=>Mn,structure:()=>wg});var ht=43,Ge=45,as=110,Vt=!0,Ig=!1;function cs(o,e){let t=this.tokenStart+o,r=this.charCodeAt(t);for((r===ht||r===Ge)&&(e&&this.error("Number sign is not allowed"),t++);t<this.tokenEnd;t++)Fe(this.charCodeAt(t))||this.error("Integer is expected",t)}function ao(o){return cs.call(this,0,o)}function Pt(o,e){if(!this.cmpChar(this.tokenStart+o,e)){let t="";switch(e){case as:t="N is expected";break;case Ge:t="HyphenMinus is expected";break}this.error(t,this.tokenStart+o)}}function On(){let o=0,e=0,t=this.tokenType;for(;t===13||t===25;)t=this.lookupType(++o);if(t!==10)if(this.isDelim(ht,o)||this.isDelim(Ge,o)){e=this.isDelim(ht,o)?ht:Ge;do t=this.lookupType(++o);while(t===13||t===25);t!==10&&(this.skip(o),ao.call(this,Vt))}else return null;return o>0&&this.skip(o),e===0&&(t=this.charCodeAt(this.tokenStart),t!==ht&&t!==Ge&&this.error("Number sign is expected")),ao.call(this,e!==0),e===Ge?"-"+this.consume(10):this.consume(10)}var Rg="AnPlusB",wg={a:[String,null],b:[String,null]};function Mn(){let o=this.tokenStart,e=null,t=null;if(this.tokenType===10)ao.call(this,Ig),t=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,Ge))switch(e="-1",Pt.call(this,1,as),this.tokenEnd-this.tokenStart){case 2:this.next(),t=On.call(this);break;case 3:Pt.call(this,2,Ge),this.next(),this.skipSC(),ao.call(this,Vt),t="-"+this.consume(10);break;default:Pt.call(this,2,Ge),cs.call(this,3,Vt),this.next(),t=this.substrToCursor(o+2)}else if(this.tokenType===1||this.isDelim(ht)&&this.lookupType(1)===1){let r=0;switch(e="1",this.isDelim(ht)&&(r=1,this.next()),Pt.call(this,0,as),this.tokenEnd-this.tokenStart){case 1:this.next(),t=On.call(this);break;case 2:Pt.call(this,1,Ge),this.next(),this.skipSC(),ao.call(this,Vt),t="-"+this.consume(10);break;default:Pt.call(this,1,Ge),cs.call(this,2,Vt),this.next(),t=this.substrToCursor(o+r+1)}}else if(this.tokenType===12){let r=this.charCodeAt(this.tokenStart),s=r===ht||r===Ge,a=this.tokenStart+s;for(;a<this.tokenEnd&&Fe(this.charCodeAt(a));a++);a===this.tokenStart+s&&this.error("Integer is expected",this.tokenStart+s),Pt.call(this,a-this.tokenStart,as),e=this.substring(o,a),a+1===this.tokenEnd?(this.next(),t=On.call(this)):(Pt.call(this,a-this.tokenStart+1,Ge),a+2===this.tokenEnd?(this.next(),this.skipSC(),ao.call(this,Vt),t="-"+this.consume(10)):(cs.call(this,a-this.tokenStart+2,Vt),this.next(),t=this.substrToCursor(a+1)))}else this.error();return e!==null&&e.charCodeAt(0)===ht&&(e=e.substr(1)),t!==null&&t.charCodeAt(0)===ht&&(t=t.substr(1)),{type:"AnPlusB",loc:this.getLocation(o,this.tokenStart),a:e,b:t}}function Og(o){if(o.a){let e=o.a==="+1"&&"n"||o.a==="1"&&"n"||o.a==="-1"&&"-n"||o.a+"n";if(o.b){let t=o.b[0]==="-"||o.b[0]==="+"?o.b:"+"+o.b;this.tokenize(e+t)}else this.tokenize(e)}else this.tokenize(o.b)}var Ln={};X(Ln,{generate:()=>Dg,name:()=>kg,parse:()=>Pn,structure:()=>Lg,walkContext:()=>Pg});function pl(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function Mg(){for(let o=1,e;e=this.lookupType(o);o++){if(e===24)return!0;if(e===23||e===3)return!1}return!1}var kg="Atrule",Pg="atrule",Lg={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function Pn(o=!1){let e=this.tokenStart,t,r,s=null,a=null;switch(this.eat(3),t=this.substrToCursor(e+1),r=t.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(this.parseAtrulePrelude?s=this.parseWithFallback(this.AtrulePrelude.bind(this,t,o),pl):s=pl.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:hasOwnProperty.call(this.atrule,r)&&typeof this.atrule[r].block=="function"?a=this.atrule[r].block.call(this,o):a=this.Block(Mg.call(this));break}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:t,prelude:s,block:a}}function Dg(o){this.token(3,"@"+o.name),o.prelude!==null&&this.node(o.prelude),o.block?this.node(o.block):this.token(17,";")}var vn={};X(vn,{generate:()=>_g,name:()=>vg,parse:()=>Dn,structure:()=>Ng,walkContext:()=>Fg});var vg="AtrulePrelude",Fg="atrulePrelude",Ng={children:[[]]};function Dn(o){let e=null;return o!==null&&(o=o.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,o)&&typeof this.atrule[o].prelude=="function"?e=this.atrule[o].prelude.call(this):e=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==23&&this.tokenType!==17&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(e),children:e}}function _g(o){this.children(o)}var _n={};X(_n,{generate:()=>Gg,name:()=>Wg,parse:()=>Nn,structure:()=>$g});var Bg=36,dl=42,ps=61,jg=94,Fn=124,Vg=126;function Ug(){this.eof&&this.error("Unexpected end of input");let o=this.tokenStart,e=!1;return this.isDelim(dl)?(e=!0,this.next()):this.isDelim(Fn)||this.eat(1),this.isDelim(Fn)?this.charCodeAt(this.tokenStart+1)!==ps?(this.next(),this.eat(1)):e&&this.error("Identifier is expected",this.tokenEnd):e&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(o,this.tokenStart),name:this.substrToCursor(o)}}function Hg(){let o=this.tokenStart,e=this.charCodeAt(o);return e!==ps&&e!==Vg&&e!==jg&&e!==Bg&&e!==dl&&e!==Fn&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),e!==ps&&(this.isDelim(ps)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(o)}var Wg="AttributeSelector",$g={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function Nn(){let o=this.tokenStart,e,t=null,r=null,s=null;return this.eat(19),this.skipSC(),e=Ug.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(t=Hg.call(this),this.skipSC(),r=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(s=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(o,this.tokenStart),name:e,matcher:t,value:r,flags:s}}function Gg(o){this.token(9,"["),this.node(o.name),o.matcher!==null&&(this.tokenize(o.matcher),this.node(o.value)),o.flags!==null&&this.token(1,o.flags),this.token(9,"]")}var jn={};X(jn,{generate:()=>Zg,name:()=>Yg,parse:()=>Bn,structure:()=>Jg,walkContext:()=>Qg});var Kg=38;function ml(){return this.Raw(null,!0)}function ll(){return this.parseWithFallback(this.Rule,ml)}function ul(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function qg(){if(this.tokenType===17)return ul.call(this,this.tokenIndex);let o=this.parseWithFallback(this.Declaration,ul);return this.tokenType===17&&this.next(),o}var Yg="Block",Qg="block",Jg={children:[["Atrule","Rule","Declaration"]]};function Bn(o){let e=o?qg:ll,t=this.tokenStart,r=this.createList();this.eat(23);e:for(;!this.eof;)switch(this.tokenType){case 24:break e;case 13:case 25:this.next();break;case 3:r.push(this.parseWithFallback(this.Atrule.bind(this,o),ml));break;default:o&&this.isDelim(Kg)?r.push(ll.call(this)):r.push(e.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(t,this.tokenStart),children:r}}function Zg(o){this.token(23,"{"),this.children(o,e=>{e.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var Un={};X(Un,{generate:()=>tb,name:()=>Xg,parse:()=>Vn,structure:()=>eb});var Xg="Brackets",eb={children:[[]]};function Vn(o,e){let t=this.tokenStart,r=null;return this.eat(19),r=o.call(this,e),this.eof||this.eat(20),{type:"Brackets",loc:this.getLocation(t,this.tokenStart),children:r}}function tb(o){this.token(9,"["),this.children(o),this.token(9,"]")}var Wn={};X(Wn,{generate:()=>sb,name:()=>ob,parse:()=>Hn,structure:()=>rb});var ob="CDC",rb=[];function Hn(){let o=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(o,this.tokenStart)}}function sb(){this.token(15,"-->")}var Gn={};X(Gn,{generate:()=>ab,name:()=>nb,parse:()=>$n,structure:()=>ib});var nb="CDO",ib=[];function $n(){let o=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(o,this.tokenStart)}}function ab(){this.token(14,"<!--")}var qn={};X(qn,{generate:()=>lb,name:()=>pb,parse:()=>Kn,structure:()=>db});var cb=46,pb="ClassSelector",db={name:String};function Kn(){return this.eatDelim(cb),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function lb(o){this.token(9,"."),this.token(1,o.name)}var Qn={};X(Qn,{generate:()=>gb,name:()=>fb,parse:()=>Yn,structure:()=>xb});var ub=43,hl=47,mb=62,hb=126,fb="Combinator",xb={name:String};function Yn(){let o=this.tokenStart,e;switch(this.tokenType){case 13:e=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case mb:case ub:case hb:this.next();break;case hl:this.next(),this.eatIdent("deep"),this.eatDelim(hl);break;default:this.error("Combinator is expected")}e=this.substrToCursor(o);break}return{type:"Combinator",loc:this.getLocation(o,this.tokenStart),name:e}}function gb(o){this.tokenize(o.name)}var Zn={};X(Zn,{generate:()=>zb,name:()=>Ab,parse:()=>Jn,structure:()=>Sb});var bb=42,yb=47,Ab="Comment",Sb={value:String};function Jn(){let o=this.tokenStart,e=this.tokenEnd;return this.eat(25),e-o+2>=2&&this.charCodeAt(e-2)===bb&&this.charCodeAt(e-1)===yb&&(e-=2),{type:"Comment",loc:this.getLocation(o,this.tokenStart),value:this.substring(o+2,e)}}function zb(o){this.token(25,"/*"+o.value+"*/")}var ei={};X(ei,{generate:()=>Rb,name:()=>Eb,parse:()=>Xn,structure:()=>Cb});var Tb=new Set([16,22,0]),Eb="Condition",Cb={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function fl(o){return this.lookupTypeNonSC(1)===1&&Tb.has(this.lookupTypeNonSC(2))?this.Feature(o):this.FeatureRange(o)}var Ib={media:fl,container:fl,supports(){return this.SupportsDeclaration()}};function Xn(o="media"){let e=this.createList();e:for(;!this.eof;)switch(this.tokenType){case 25:case 13:this.next();continue;case 1:e.push(this.Identifier());break;case 21:{let t=this.parseWithFallback(()=>Ib[o].call(this,o),()=>null);t||(t=this.parseWithFallback(()=>{this.eat(21);let r=this.Condition(o);return this.eat(22),r},()=>this.GeneralEnclosed(o))),e.push(t);break}case 2:{let t=this.parseWithFallback(()=>this.FeatureFunction(o),()=>null);t||(t=this.GeneralEnclosed(o)),e.push(t);break}default:break e}return e.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(e),kind:o,children:e}}function Rb(o){o.children.forEach(e=>{e.type==="Condition"?(this.token(21,"("),this.node(e),this.token(22,")")):this.node(e)})}var oi={};X(oi,{generate:()=>Bb,name:()=>Fb,parse:()=>ti,structure:()=>_b,walkContext:()=>Nb});var xl=45;function gl(o,e){return e=e||0,o.length-e>=2&&o.charCodeAt(e)===xl&&o.charCodeAt(e+1)===xl}var yl=33,wb=35,Ob=36,Mb=38,kb=42,Pb=43,bl=47;function Lb(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function Db(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function vb(){let o=this.tokenIndex,e=this.Value();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(yl)===!1&&this.isBalanceEdge(o)===!1&&this.error(),e}var Fb="Declaration",Nb="declaration",_b={important:[Boolean,String],property:String,value:["Value","Raw"]};function ti(){let o=this.tokenStart,e=this.tokenIndex,t=jb.call(this),r=gl(t),s=r?this.parseCustomProperty:this.parseValue,a=r?Db:Lb,p=!1,u;this.skipSC(),this.eat(16);let f=this.tokenIndex;if(r||this.skipSC(),s?u=this.parseWithFallback(vb,a):u=a.call(this,this.tokenIndex),r&&u.type==="Value"&&u.children.isEmpty){for(let m=f-this.tokenIndex;m<=0;m++)if(this.lookupType(m)===13){u.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(yl)&&(p=Vb.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==17&&this.isBalanceEdge(e)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(o,this.tokenStart),important:p,property:t,value:u}}function Bb(o){this.token(1,o.property),this.token(16,":"),this.node(o.value),o.important&&(this.token(9,"!"),this.token(1,o.important===!0?"important":o.important))}function jb(){let o=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case kb:case Ob:case Pb:case wb:case Mb:this.next();break;case bl:this.next(),this.isDelim(bl)&&this.next();break}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(o)}function Vb(){this.eat(9),this.skipSC();let o=this.consume(1);return o==="important"?!0:o}var ni={};X(ni,{generate:()=>$b,name:()=>Hb,parse:()=>si,structure:()=>Wb});var Ub=38;function ri(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}var Hb="DeclarationList",Wb={children:[["Declaration","Atrule","Rule"]]};function si(){let o=this.createList();for(;!this.eof;)switch(this.tokenType){case 13:case 25:case 17:this.next();break;case 3:o.push(this.parseWithFallback(this.Atrule.bind(this,!0),ri));break;default:this.isDelim(Ub)?o.push(this.parseWithFallback(this.Rule,ri)):o.push(this.parseWithFallback(this.Declaration,ri))}return{type:"DeclarationList",loc:this.getLocationFromList(o),children:o}}function $b(o){this.children(o,e=>{e.type==="Declaration"&&this.token(17,";")})}var ai={};X(ai,{generate:()=>qb,name:()=>Gb,parse:()=>ii,structure:()=>Kb});var Gb="Dimension",Kb={value:String,unit:String};function ii(){let o=this.tokenStart,e=this.consumeNumber(12);return{type:"Dimension",loc:this.getLocation(o,this.tokenStart),value:e,unit:this.substring(o+e.length,this.tokenStart)}}function qb(o){this.token(12,o.value+o.unit)}var pi={};X(pi,{generate:()=>Zb,name:()=>Qb,parse:()=>ci,structure:()=>Jb});var Yb=47,Qb="Feature",Jb={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function ci(o){let e=this.tokenStart,t,r=null;if(this.eat(21),this.skipSC(),t=this.consume(1),this.skipSC(),this.tokenType!==22){switch(this.eat(16),this.skipSC(),this.tokenType){case 10:this.lookupNonWSType(1)===9?r=this.Ratio():r=this.Number();break;case 12:r=this.Dimension();break;case 1:r=this.Identifier();break;case 2:r=this.parseWithFallback(()=>{let s=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(Yb)&&this.error(),s},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(22),{type:"Feature",loc:this.getLocation(e,this.tokenStart),kind:o,name:t,value:r}}function Zb(o){this.token(21,"("),this.token(1,o.name),o.value!==null&&(this.token(16,":"),this.node(o.value)),this.token(22,")")}var li={};X(li,{generate:()=>oy,name:()=>Xb,parse:()=>di,structure:()=>ey});var Xb="FeatureFunction",ey={kind:String,feature:String,value:["Declaration","Selector"]};function ty(o,e){let r=(this.features[o]||{})[e];return typeof r!="function"&&this.error(`Unknown feature ${e}()`),r}function di(o="unknown"){let e=this.tokenStart,t=this.consumeFunctionName(),r=ty.call(this,o,t.toLowerCase());this.skipSC();let s=this.parseWithFallback(()=>{let a=this.tokenIndex,p=r.call(this);return this.eof===!1&&this.isBalanceEdge(a)===!1&&this.error(),p},()=>this.Raw(null,!1));return this.eof||this.eat(22),{type:"FeatureFunction",loc:this.getLocation(e,this.tokenStart),kind:o,feature:t,value:s}}function oy(o){this.token(2,o.feature+"("),this.node(o.value),this.token(22,")")}var hi={};X(hi,{generate:()=>ay,name:()=>ny,parse:()=>mi,structure:()=>iy});var Al=47,ry=60,Sl=61,sy=62,ny="FeatureRange",iy={kind:String,left:["Identifier","Number","Dimension","Ratio","Function"],leftComparison:String,middle:["Identifier","Number","Dimension","Ratio","Function"],rightComparison:[String,null],right:["Identifier","Number","Dimension","Ratio","Function",null]};function ui(){switch(this.skipSC(),this.tokenType){case 10:return this.isDelim(Al,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case 12:return this.Dimension();case 1:return this.Identifier();case 2:return this.parseWithFallback(()=>{let o=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(Al)&&this.error(),o},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function zl(o){if(this.skipSC(),this.isDelim(ry)||this.isDelim(sy)){let e=this.source[this.tokenStart];return this.next(),this.isDelim(Sl)?(this.next(),e+"="):e}if(this.isDelim(Sl))return"=";this.error(`Expected ${o?'":", ':""}"<", ">", "=" or ")"`)}function mi(o="unknown"){let e=this.tokenStart;this.skipSC(),this.eat(21);let t=ui.call(this),r=zl.call(this,t.type==="Identifier"),s=ui.call(this),a=null,p=null;return this.lookupNonWSType(0)!==22&&(a=zl.call(this),p=ui.call(this)),this.skipSC(),this.eat(22),{type:"FeatureRange",loc:this.getLocation(e,this.tokenStart),kind:o,left:t,leftComparison:r,middle:s,rightComparison:a,right:p}}function ay(o){this.token(21,"("),this.node(o.left),this.tokenize(o.leftComparison),this.node(o.middle),o.right&&(this.tokenize(o.rightComparison),this.node(o.right)),this.token(22,")")}var xi={};X(xi,{generate:()=>ly,name:()=>cy,parse:()=>fi,structure:()=>dy,walkContext:()=>py});var cy="Function",py="function",dy={name:String,children:[[]]};function fi(o,e){let t=this.tokenStart,r=this.consumeFunctionName(),s=r.toLowerCase(),a;return a=e.hasOwnProperty(s)?e[s].call(this,e):o.call(this,e),this.eof||this.eat(22),{type:"Function",loc:this.getLocation(t,this.tokenStart),name:r,children:a}}function ly(o){this.token(2,o.name+"("),this.children(o),this.token(22,")")}var bi={};X(bi,{generate:()=>hy,name:()=>uy,parse:()=>gi,structure:()=>my});var uy="GeneralEnclosed",my={kind:String,function:[String,null],children:[[]]};function gi(o){let e=this.tokenStart,t=null;this.tokenType===2?t=this.consumeFunctionName():this.eat(21);let r=this.parseWithFallback(()=>{let s=this.tokenIndex,a=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(s)===!1&&this.error(),a},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(22),{type:"GeneralEnclosed",loc:this.getLocation(e,this.tokenStart),kind:o,function:t,children:r}}function hy(o){o.function?this.token(2,o.function+"("):this.token(21,"("),this.children(o),this.token(22,")")}var Ai={};X(Ai,{generate:()=>by,name:()=>xy,parse:()=>yi,structure:()=>gy,xxx:()=>fy});var fy="XXX",xy="Hash",gy={value:String};function yi(){let o=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(o,this.tokenStart),value:this.substrToCursor(o+1)}}function by(o){this.token(4,"#"+o.value)}var zi={};X(zi,{generate:()=>Sy,name:()=>yy,parse:()=>Si,structure:()=>Ay});var yy="Identifier",Ay={name:String};function Si(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function Sy(o){this.token(1,o.name)}var Ei={};X(Ei,{generate:()=>Ey,name:()=>zy,parse:()=>Ti,structure:()=>Ty});var zy="IdSelector",Ty={name:String};function Ti(){let o=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(o,this.tokenStart),name:this.substrToCursor(o+1)}}function Ey(o){this.token(9,"#"+o.name)}var Ii={};X(Ii,{generate:()=>wy,name:()=>Iy,parse:()=>Ci,structure:()=>Ry});var Cy=46,Iy="Layer",Ry={name:String};function Ci(){let o=this.tokenStart,e=this.consume(1);for(;this.isDelim(Cy);)this.eat(9),e+="."+this.consume(1);return{type:"Layer",loc:this.getLocation(o,this.tokenStart),name:e}}function wy(o){this.tokenize(o.name)}var wi={};X(wi,{generate:()=>ky,name:()=>Oy,parse:()=>Ri,structure:()=>My});var Oy="LayerList",My={children:[["Layer"]]};function Ri(){let o=this.createList();for(this.skipSC();!this.eof&&(o.push(this.Layer()),this.lookupTypeNonSC(0)===18);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(o),children:o}}function ky(o){this.children(o,()=>this.token(18,","))}var Mi={};X(Mi,{generate:()=>Dy,name:()=>Py,parse:()=>Oi,structure:()=>Ly});var Py="MediaQuery",Ly={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function Oi(){let o=this.tokenStart,e=null,t=null,r=null;if(this.skipSC(),this.tokenType===1&&this.lookupTypeNonSC(1)!==21){let s=this.consume(1),a=s.toLowerCase();switch(a==="not"||a==="only"?(this.skipSC(),e=a,t=this.consume(1)):t=s,this.lookupTypeNonSC(0)){case 1:{this.skipSC(),this.eatIdent("and"),r=this.Condition("media");break}case 23:case 17:case 18:case 0:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case 1:case 21:case 2:{r=this.Condition("media");break}case 23:case 17:case 0:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(o,this.tokenStart),modifier:e,mediaType:t,condition:r}}function Dy(o){o.mediaType?(o.modifier&&this.token(1,o.modifier),this.token(1,o.mediaType),o.condition&&(this.token(1,"and"),this.node(o.condition))):o.condition&&this.node(o.condition)}var Pi={};X(Pi,{generate:()=>Ny,name:()=>vy,parse:()=>ki,structure:()=>Fy});var vy="MediaQueryList",Fy={children:[["MediaQuery"]]};function ki(){let o=this.createList();for(this.skipSC();!this.eof&&(o.push(this.MediaQuery()),this.tokenType===18);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(o),children:o}}function Ny(o){this.children(o,()=>this.token(18,","))}var Di={};X(Di,{generate:()=>Vy,name:()=>By,parse:()=>Li,structure:()=>jy});var _y=38,By="NestingSelector",jy={};function Li(){let o=this.tokenStart;return this.eatDelim(_y),{type:"NestingSelector",loc:this.getLocation(o,this.tokenStart)}}function Vy(){this.token(9,"&")}var Fi={};X(Fi,{generate:()=>Wy,name:()=>Uy,parse:()=>vi,structure:()=>Hy});var Uy="Nth",Hy={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function vi(){this.skipSC();let o=this.tokenStart,e=o,t=null,r;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?r=this.Identifier():r=this.AnPlusB(),e=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),t=this.SelectorList(),e=this.tokenStart),{type:"Nth",loc:this.getLocation(o,e),nth:r,selector:t}}function Wy(o){this.node(o.nth),o.selector!==null&&(this.token(1,"of"),this.node(o.selector))}var _i={};X(_i,{generate:()=>Ky,name:()=>$y,parse:()=>Ni,structure:()=>Gy});var $y="Number",Gy={value:String};function Ni(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function Ky(o){this.token(10,o.value)}var ji={};X(ji,{generate:()=>Qy,name:()=>qy,parse:()=>Bi,structure:()=>Yy});var qy="Operator",Yy={value:String};function Bi(){let o=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(o,this.tokenStart),value:this.substrToCursor(o)}}function Qy(o){this.tokenize(o.value)}var Ui={};X(Ui,{generate:()=>Xy,name:()=>Jy,parse:()=>Vi,structure:()=>Zy});var Jy="Parentheses",Zy={children:[[]]};function Vi(o,e){let t=this.tokenStart,r=null;return this.eat(21),r=o.call(this,e),this.eof||this.eat(22),{type:"Parentheses",loc:this.getLocation(t,this.tokenStart),children:r}}function Xy(o){this.token(21,"("),this.children(o),this.token(22,")")}var Wi={};X(Wi,{generate:()=>oA,name:()=>eA,parse:()=>Hi,structure:()=>tA});var eA="Percentage",tA={value:String};function Hi(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function oA(o){this.token(11,o.value+"%")}var Gi={};X(Gi,{generate:()=>iA,name:()=>rA,parse:()=>$i,structure:()=>nA,walkContext:()=>sA});var rA="PseudoClassSelector",sA="function",nA={name:String,children:[["Raw"],null]};function $i(){let o=this.tokenStart,e=null,t,r;return this.eat(16),this.tokenType===2?(t=this.consumeFunctionName(),r=t.toLowerCase(),this.lookupNonWSType(0)==22?e=this.createList():hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),e=this.pseudo[r].call(this),this.skipSC()):(e=this.createList(),e.push(this.Raw(null,!1))),this.eat(22)):t=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(o,this.tokenStart),name:t,children:e}}function iA(o){this.token(16,":"),o.children===null?this.token(1,o.name):(this.token(2,o.name+"("),this.children(o),this.token(22,")"))}var qi={};X(qi,{generate:()=>dA,name:()=>aA,parse:()=>Ki,structure:()=>pA,walkContext:()=>cA});var aA="PseudoElementSelector",cA="function",pA={name:String,children:[["Raw"],null]};function Ki(){let o=this.tokenStart,e=null,t,r;return this.eat(16),this.eat(16),this.tokenType===2?(t=this.consumeFunctionName(),r=t.toLowerCase(),this.lookupNonWSType(0)==22?e=this.createList():hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),e=this.pseudo[r].call(this),this.skipSC()):(e=this.createList(),e.push(this.Raw(null,!1))),this.eat(22)):t=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(o,this.tokenStart),name:t,children:e}}function dA(o){this.token(16,":"),this.token(16,":"),o.children===null?this.token(1,o.name):(this.token(2,o.name+"("),this.children(o),this.token(22,")"))}var Qi={};X(Qi,{generate:()=>mA,name:()=>lA,parse:()=>Yi,structure:()=>uA});var Tl=47;function El(){switch(this.skipSC(),this.tokenType){case 10:return this.Number();case 2:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}var lA="Ratio",uA={left:["Number","Function"],right:["Number","Function",null]};function Yi(){let o=this.tokenStart,e=El.call(this),t=null;return this.skipSC(),this.isDelim(Tl)&&(this.eatDelim(Tl),t=El.call(this)),{type:"Ratio",loc:this.getLocation(o,this.tokenStart),left:e,right:t}}function mA(o){this.node(o.left),this.token(9,"/"),o.right?this.node(o.right):this.node(10,1)}var Zi={};X(Zi,{generate:()=>gA,name:()=>fA,parse:()=>Ji,structure:()=>xA});function hA(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var fA="Raw",xA={value:String};function Ji(o,e){let t=this.getTokenStart(this.tokenIndex),r;return this.skipUntilBalanced(this.tokenIndex,o||this.consumeUntilBalanceEnd),e&&this.tokenStart>t?r=hA.call(this):r=this.tokenStart,{type:"Raw",loc:this.getLocation(t,r),value:this.substring(t,r)}}function gA(o){this.tokenize(o.value)}var ea={};X(ea,{generate:()=>zA,name:()=>yA,parse:()=>Xi,structure:()=>SA,walkContext:()=>AA});function Cl(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function bA(){let o=this.SelectorList();return o.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),o}var yA="Rule",AA="rule",SA={prelude:["SelectorList","Raw"],block:["Block"]};function Xi(){let o=this.tokenIndex,e=this.tokenStart,t,r;return this.parseRulePrelude?t=this.parseWithFallback(bA,Cl):t=Cl.call(this,o),r=this.Block(!0),{type:"Rule",loc:this.getLocation(e,this.tokenStart),prelude:t,block:r}}function zA(o){this.node(o.prelude),this.node(o.block)}var oa={};X(oa,{generate:()=>CA,name:()=>TA,parse:()=>ta,structure:()=>EA});var TA="Scope",EA={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function ta(){let o=null,e=null;this.skipSC();let t=this.tokenStart;return this.tokenType===21&&(this.next(),this.skipSC(),o=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(22)),this.lookupNonWSType(0)===1&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(21),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(22)),{type:"Scope",loc:this.getLocation(t,this.tokenStart),root:o,limit:e}}function CA(o){o.root&&(this.token(21,"("),this.node(o.root),this.token(22,")")),o.limit&&(this.token(1,"to"),this.token(21,"("),this.node(o.limit),this.token(22,")"))}var sa={};X(sa,{generate:()=>wA,name:()=>IA,parse:()=>ra,structure:()=>RA});var IA="Selector",RA={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]};function ra(){let o=this.readSequence(this.scope.Selector);return this.getFirstListNode(o)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(o),children:o}}function wA(o){this.children(o)}var ia={};X(ia,{generate:()=>PA,name:()=>OA,parse:()=>na,structure:()=>kA,walkContext:()=>MA});var OA="SelectorList",MA="selector",kA={children:[["Selector","Raw"]]};function na(){let o=this.createList();for(;!this.eof;){if(o.push(this.Selector()),this.tokenType===18){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(o),children:o}}function PA(o){this.children(o,()=>this.token(18,","))}var pa={};X(pa,{generate:()=>FA,name:()=>DA,parse:()=>ca,structure:()=>vA});var aa=92,Il=34,Rl=39;function ds(o){let e=o.length,t=o.charCodeAt(0),r=t===Il||t===Rl?1:0,s=r===1&&e>1&&o.charCodeAt(e-1)===t?e-2:e-1,a="";for(let p=r;p<=s;p++){let u=o.charCodeAt(p);if(u===aa){if(p===s){p!==e-1&&(a=o.substr(p+1));break}if(u=o.charCodeAt(++p),He(aa,u)){let f=p-1,m=zt(o,f);p=m-1,a+=rs(o.substring(f+1,m))}else u===13&&o.charCodeAt(p+1)===10&&p++}else a+=o[p]}return a}function wl(o,e){let t=e?"'":'"',r=e?Rl:Il,s="",a=!1;for(let p=0;p<o.length;p++){let u=o.charCodeAt(p);if(u===0){s+="\uFFFD";continue}if(u<=31||u===127){s+="\\"+u.toString(16),a=!0;continue}u===r||u===aa?(s+="\\"+o.charAt(p),a=!1):(a&&(lt(u)||ut(u))&&(s+=" "),s+=o.charAt(p),a=!1)}return t+s+t}var DA="String",vA={value:String};function ca(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:ds(this.consume(5))}}function FA(o){this.token(5,wl(o.value))}var la={};X(la,{generate:()=>VA,name:()=>_A,parse:()=>da,structure:()=>jA,walkContext:()=>BA});var NA=33;function Ol(){return this.Raw(null,!1)}var _A="StyleSheet",BA="stylesheet",jA={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function da(){let o=this.tokenStart,e=this.createList(),t;for(;!this.eof;){switch(this.tokenType){case 13:this.next();continue;case 25:if(this.charCodeAt(this.tokenStart+2)!==NA){this.next();continue}t=this.Comment();break;case 14:t=this.CDO();break;case 15:t=this.CDC();break;case 3:t=this.parseWithFallback(this.Atrule,Ol);break;default:t=this.parseWithFallback(this.Rule,Ol)}e.push(t)}return{type:"StyleSheet",loc:this.getLocation(o,this.tokenStart),children:e}}function VA(o){this.children(o)}var ma={};X(ma,{generate:()=>WA,name:()=>UA,parse:()=>ua,structure:()=>HA});var UA="SupportsDeclaration",HA={declaration:"Declaration"};function ua(){let o=this.tokenStart;this.eat(21),this.skipSC();let e=this.Declaration();return this.eof||this.eat(22),{type:"SupportsDeclaration",loc:this.getLocation(o,this.tokenStart),declaration:e}}function WA(o){this.token(21,"("),this.node(o.declaration),this.token(22,")")}var xa={};X(xa,{generate:()=>qA,name:()=>GA,parse:()=>fa,structure:()=>KA});var $A=42,Ml=124;function ha(){this.tokenType!==1&&this.isDelim($A)===!1&&this.error("Identifier or asterisk is expected"),this.next()}var GA="TypeSelector",KA={name:String};function fa(){let o=this.tokenStart;return this.isDelim(Ml)?(this.next(),ha.call(this)):(ha.call(this),this.isDelim(Ml)&&(this.next(),ha.call(this))),{type:"TypeSelector",loc:this.getLocation(o,this.tokenStart),name:this.substrToCursor(o)}}function qA(o){this.tokenize(o.name)}var ya={};X(ya,{generate:()=>XA,name:()=>JA,parse:()=>ba,structure:()=>ZA});var kl=43,Pl=45,ga=63;function _o(o,e){let t=0;for(let r=this.tokenStart+o;r<this.tokenEnd;r++){let s=this.charCodeAt(r);if(s===Pl&&e&&t!==0)return _o.call(this,o+t+1,!1),-1;lt(s)||this.error(e&&t!==0?"Hyphen minus"+(t<6?" or hex digit":"")+" is expected":t<6?"Hex digit is expected":"Unexpected input",r),++t>6&&this.error("Too many hex digits",r)}return this.next(),t}function ls(o){let e=0;for(;this.isDelim(ga);)++e>o&&this.error("Too many question marks"),this.next()}function YA(o){this.charCodeAt(this.tokenStart)!==o&&this.error((o===kl?"Plus sign":"Hyphen minus")+" is expected")}function QA(){let o=0;switch(this.tokenType){case 10:if(o=_o.call(this,1,!0),this.isDelim(ga)){ls.call(this,6-o);break}if(this.tokenType===12||this.tokenType===10){YA.call(this,Pl),_o.call(this,1,!1);break}break;case 12:o=_o.call(this,1,!0),o>0&&ls.call(this,6-o);break;default:if(this.eatDelim(kl),this.tokenType===1){o=_o.call(this,0,!0),o>0&&ls.call(this,6-o);break}if(this.isDelim(ga)){this.next(),ls.call(this,5);break}this.error("Hex digit or question mark is expected")}}var JA="UnicodeRange",ZA={value:String};function ba(){let o=this.tokenStart;return this.eatIdent("u"),QA.call(this),{type:"UnicodeRange",loc:this.getLocation(o,this.tokenStart),value:this.substrToCursor(o)}}function XA(o){this.tokenize(o.value)}var za={};X(za,{generate:()=>aS,name:()=>nS,parse:()=>Sa,structure:()=>iS});var eS=32,Aa=92,tS=34,oS=39,rS=40,Ll=41;function Dl(o){let e=o.length,t=4,r=o.charCodeAt(e-1)===Ll?e-2:e-1,s="";for(;t<r&&ut(o.charCodeAt(t));)t++;for(;t<r&&ut(o.charCodeAt(r));)r--;for(let a=t;a<=r;a++){let p=o.charCodeAt(a);if(p===Aa){if(a===r){a!==e-1&&(s=o.substr(a+1));break}if(p=o.charCodeAt(++a),He(Aa,p)){let u=a-1,f=zt(o,u);a=f-1,s+=rs(o.substring(u+1,f))}else p===13&&o.charCodeAt(a+1)===10&&a++}else s+=o[a]}return s}function vl(o){let e="",t=!1;for(let r=0;r<o.length;r++){let s=o.charCodeAt(r);if(s===0){e+="\uFFFD";continue}if(s<=31||s===127){e+="\\"+s.toString(16),t=!0;continue}s===eS||s===Aa||s===tS||s===oS||s===rS||s===Ll?(e+="\\"+o.charAt(r),t=!1):(t&&lt(s)&&(e+=" "),e+=o.charAt(r),t=!1)}return"url("+e+")"}var nS="Url",iS={value:String};function Sa(){let o=this.tokenStart,e;switch(this.tokenType){case 7:e=Dl(this.consume(7));break;case 2:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(2),this.skipSC(),e=ds(this.consume(5)),this.skipSC(),this.eof||this.eat(22);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(o,this.tokenStart),value:e}}function aS(o){this.token(7,vl(o.value))}var Ea={};X(Ea,{generate:()=>dS,name:()=>cS,parse:()=>Ta,structure:()=>pS});var cS="Value",pS={children:[[]]};function Ta(){let o=this.tokenStart,e=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(o,this.tokenStart),children:e}}function dS(o){this.children(o)}var Ia={};X(Ia,{generate:()=>hS,name:()=>uS,parse:()=>Ca,structure:()=>mS});var lS=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),uS="WhiteSpace",mS={value:String};function Ca(){return this.eat(13),lS}function hS(o){this.token(13,o.value)}var co=null,Bo=class o{static createItem(e){return{prev:null,next:null,data:e}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(e){return o.createItem(e)}allocateCursor(e,t){let r;return co!==null?(r=co,co=co.cursor,r.prev=e,r.next=t,r.cursor=this.cursor):r={prev:e,next:t,cursor:this.cursor},this.cursor=r,r}releaseCursor(){let{cursor:e}=this;this.cursor=e.cursor,e.prev=null,e.next=null,e.cursor=co,co=e}updateCursors(e,t,r,s){let{cursor:a}=this;for(;a!==null;)a.prev===e&&(a.prev=t),a.next===r&&(a.next=s),a=a.cursor}*[Symbol.iterator](){for(let e=this.head;e!==null;e=e.next)yield e.data}get size(){let e=0;for(let t=this.head;t!==null;t=t.next)e++;return e}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(e){let t=null;this.head=null;for(let r of e){let s=o.createItem(r);t!==null?t.next=s:this.head=s,s.prev=t,t=s}return this.tail=t,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(e,t=this){let r=this.allocateCursor(null,this.head);for(;r.next!==null;){let s=r.next;r.next=s.next,e.call(t,s.data,s,this)}this.releaseCursor()}forEachRight(e,t=this){let r=this.allocateCursor(this.tail,null);for(;r.prev!==null;){let s=r.prev;r.prev=s.prev,e.call(t,s.data,s,this)}this.releaseCursor()}reduce(e,t,r=this){let s=this.allocateCursor(null,this.head),a=t,p;for(;s.next!==null;)p=s.next,s.next=p.next,a=e.call(r,a,p.data,p,this);return this.releaseCursor(),a}reduceRight(e,t,r=this){let s=this.allocateCursor(this.tail,null),a=t,p;for(;s.prev!==null;)p=s.prev,s.prev=p.prev,a=e.call(r,a,p.data,p,this);return this.releaseCursor(),a}some(e,t=this){for(let r=this.head;r!==null;r=r.next)if(e.call(t,r.data,r,this))return!0;return!1}map(e,t=this){let r=new o;for(let s=this.head;s!==null;s=s.next)r.appendData(e.call(t,s.data,s,this));return r}filter(e,t=this){let r=new o;for(let s=this.head;s!==null;s=s.next)e.call(t,s.data,s,this)&&r.appendData(s.data);return r}nextUntil(e,t,r=this){if(e===null)return;let s=this.allocateCursor(null,e);for(;s.next!==null;){let a=s.next;if(s.next=a.next,t.call(r,a.data,a,this))break}this.releaseCursor()}prevUntil(e,t,r=this){if(e===null)return;let s=this.allocateCursor(e,null);for(;s.prev!==null;){let a=s.prev;if(s.prev=a.prev,t.call(r,a.data,a,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){let e=new o;for(let t of this)e.appendData(t);return e}prepend(e){return this.updateCursors(null,e,this.head,e),this.head!==null?(this.head.prev=e,e.next=this.head):this.tail=e,this.head=e,this}prependData(e){return this.prepend(o.createItem(e))}append(e){return this.insert(e)}appendData(e){return this.insert(o.createItem(e))}insert(e,t=null){if(t!==null)if(this.updateCursors(t.prev,e,t,e),t.prev===null){if(this.head!==t)throw new Error("before doesn't belong to list");this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t;else this.updateCursors(this.tail,e,null,e),this.tail!==null?(this.tail.next=e,e.prev=this.tail):this.head=e,this.tail=e;return this}insertData(e,t){return this.insert(o.createItem(e),t)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),e.prev!==null)e.prev.next=e.next;else{if(this.head!==e)throw new Error("item doesn't belong to list");this.head=e.next}if(e.next!==null)e.next.prev=e.prev;else{if(this.tail!==e)throw new Error("item doesn't belong to list");this.tail=e.prev}return e.prev=null,e.next=null,e}push(e){this.insert(o.createItem(e))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(e){this.prepend(o.createItem(e))}shift(){return this.head!==null?this.remove(this.head):null}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e)}insertList(e,t){return e.head===null?this:(t!=null?(this.updateCursors(t.prev,e.tail,t,e.head),t.prev!==null?(t.prev.next=e.head,e.head.prev=t.prev):this.head=e.head,t.prev=e.tail,e.tail.next=t):(this.updateCursors(this.tail,e.tail,null,e.head),this.tail!==null?(this.tail.next=e.head,e.head.prev=this.tail):this.head=e.head,this.tail=e.tail),e.head=null,e.tail=null,this)}replace(e,t){"head"in t?this.insertList(t,e):this.insert(t,e),this.remove(e)}};function Fl(o,e){let t=Object.create(SyntaxError.prototype),r=new Error;return Object.assign(t,{name:o,message:e,get stack(){return(r.stack||"").replace(/^(.+\n){1,3}/,`${o}: ${e}
62
+ `)}})}var Ra=100,Nl=60,_l=" ";function Bl({source:o,line:e,column:t,baseLine:r,baseColumn:s},a){function p(k,F){return m.slice(k,F).map((Y,W)=>String(k+W+1).padStart(z)+" |"+Y).join(`
63
+ `)}let u=`
64
+ `.repeat(Math.max(r-1,0)),f=" ".repeat(Math.max(s-1,0)),m=(u+f+o).split(/\r\n?|\n|\f/),x=Math.max(1,e-a)-1,g=Math.min(e+a,m.length+1),z=Math.max(4,String(g).length)+1,w=0;t+=(_l.length-1)*(m[e-1].substr(0,t-1).match(/\t/g)||[]).length,t>Ra&&(w=t-Nl+3,t=Nl-2);for(let k=x;k<=g;k++)k>=0&&k<m.length&&(m[k]=m[k].replace(/\t/g,_l),m[k]=(w>0&&m[k].length>w?"\u2026":"")+m[k].substr(w,Ra-2)+(m[k].length>w+Ra-1?"\u2026":""));return[p(x,e),new Array(t+z+2).join("-")+"^",p(e,g)].filter(Boolean).join(`
65
+ `).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function wa(o,e,t,r,s,a=1,p=1){return Object.assign(Fl("SyntaxError",o),{source:e,offset:t,line:r,column:s,sourceFragment(f){return Bl({source:e,line:r,column:s,baseLine:a,baseColumn:p},isNaN(f)?0:f)},get formattedMessage(){return`Parse error: ${o}
66
+ `+Bl({source:e,line:r,column:s,baseLine:a,baseColumn:p},2)}})}function jl(o){let e=this.createList(),t=!1,r={recognizer:o};for(;!this.eof;){switch(this.tokenType){case 25:this.next();continue;case 13:t=!0,this.next();continue}let s=o.getNode.call(this,r);if(s===void 0)break;t&&(o.onWhiteSpace&&o.onWhiteSpace.call(this,s,e,r),t=!1),e.push(s)}return t&&o.onWhiteSpace&&o.onWhiteSpace.call(this,null,e,r),e}var po=()=>{},fS=33,xS=35,Oa=59,Vl=123,Ul=0,gS={createList(){return[]},createSingleNodeList(o){return[o]},getFirstListNode(o){return o&&o[0]||null},getLastListNode(o){return o&&o.length>0?o[o.length-1]:null}},bS={createList(){return new Bo},createSingleNodeList(o){return new Bo().appendData(o)},getFirstListNode(o){return o&&o.first},getLastListNode(o){return o&&o.last}};function yS(o){return function(){return this[o]()}}function Ma(o){let e=Object.create(null);for(let t of Object.keys(o)){let r=o[t],s=r.parse||r;s&&(e[t]=s)}return e}function AS(o){let e={context:Object.create(null),features:Object.assign(Object.create(null),o.features),scope:Object.assign(Object.create(null),o.scope),atrule:Ma(o.atrule),pseudo:Ma(o.pseudo),node:Ma(o.node)};for(let[t,r]of Object.entries(o.parseContext))switch(typeof r){case"function":e.context[t]=r;break;case"string":e.context[t]=yS(r);break}return{config:e,...e,...e.node}}function Hl(o){let e="",t="<unknown>",r=!1,s=po,a=!1,p=new ss,u=Object.assign(new ns,AS(o||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:jl,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(x){return x===Vl?1:0},consumeUntilLeftCurlyBracketOrSemicolon(x){return x===Vl||x===Oa?1:0},consumeUntilExclamationMarkOrSemicolon(x){return x===fS||x===Oa?1:0},consumeUntilSemicolonIncluded(x){return x===Oa?2:0},createList:po,createSingleNodeList:po,getFirstListNode:po,getLastListNode:po,parseWithFallback(x,g){let z=this.tokenIndex;try{return x.call(this)}catch(w){if(a)throw w;this.skip(z-this.tokenIndex);let k=g.call(this);return a=!0,s(w,k),a=!1,k}},lookupNonWSType(x){let g;do if(g=this.lookupType(x++),g!==13&&g!==25)return g;while(g!==Ul);return Ul},charCodeAt(x){return x>=0&&x<e.length?e.charCodeAt(x):0},substring(x,g){return e.substring(x,g)},substrToCursor(x){return this.source.substring(x,this.tokenStart)},cmpChar(x,g){return In(e,x,g)},cmpStr(x,g,z){return Nt(e,x,g,z)},consume(x){let g=this.tokenStart;return this.eat(x),this.substrToCursor(g)},consumeFunctionName(){let x=e.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),x},consumeNumber(x){let g=e.substring(this.tokenStart,ts(e,this.tokenStart));return this.eat(x),g},eat(x){if(this.tokenType!==x){let g=to[x].slice(0,-6).replace(/-/g," ").replace(/^./,k=>k.toUpperCase()),z=`${/[[\](){}]/.test(g)?`"${g}"`:g} is expected`,w=this.tokenStart;switch(x){case 1:this.tokenType===2||this.tokenType===7?(w=this.tokenEnd-1,z="Identifier is expected but function found"):z="Identifier is expected";break;case 4:this.isDelim(xS)&&(this.next(),w++,z="Name is expected");break;case 11:this.tokenType===10&&(w=this.tokenEnd,z="Percent sign is expected");break}this.error(z,w)}this.next()},eatIdent(x){(this.tokenType!==1||this.lookupValue(0,x)===!1)&&this.error(`Identifier "${x}" is expected`),this.next()},eatDelim(x){this.isDelim(x)||this.error(`Delim "${String.fromCharCode(x)}" is expected`),this.next()},getLocation(x,g){return r?p.getLocationRange(x,g,t):null},getLocationFromList(x){if(r){let g=this.getFirstListNode(x),z=this.getLastListNode(x);return p.getLocationRange(g!==null?g.loc.start.offset-p.startOffset:this.tokenStart,z!==null?z.loc.end.offset-p.startOffset:this.tokenStart,t)}return null},error(x,g){let z=typeof g<"u"&&g<e.length?p.getLocation(g):this.eof?p.getLocation(ol(e,e.length-1)):p.getLocation(this.tokenStart);throw new wa(x||"Unexpected input",e,z.offset,z.line,z.column,p.startLine,p.startColumn)}}),f=()=>({filename:t,source:e,tokenCount:u.tokenCount,getTokenType:x=>u.getTokenType(x),getTokenTypeName:x=>to[u.getTokenType(x)],getTokenStart:x=>u.getTokenStart(x),getTokenEnd:x=>u.getTokenEnd(x),getTokenValue:x=>u.source.substring(u.getTokenStart(x),u.getTokenEnd(x)),substring:(x,g)=>u.source.substring(x,g),balance:u.balance.subarray(0,u.tokenCount+1),isBlockOpenerTokenType:u.isBlockOpenerTokenType,isBlockCloserTokenType:u.isBlockCloserTokenType,getBlockTokenPairIndex:x=>u.getBlockTokenPairIndex(x),getLocation:x=>p.getLocation(x,t),getRangeLocation:(x,g)=>p.getLocationRange(x,g,t)});return Object.assign(function(x,g){e=x,g=g||{},u.setSource(e,cl),p.setSource(e,g.offset,g.line,g.column),t=g.filename||"<unknown>",r=!!g.positions,s=typeof g.onParseError=="function"?g.onParseError:po,a=!1,u.parseAtrulePrelude="parseAtrulePrelude"in g?!!g.parseAtrulePrelude:!0,u.parseRulePrelude="parseRulePrelude"in g?!!g.parseRulePrelude:!0,u.parseValue="parseValue"in g?!!g.parseValue:!0,u.parseCustomProperty="parseCustomProperty"in g?!!g.parseCustomProperty:!1;let{context:z="default",list:w=!0,onComment:k,onToken:F}=g;if(!(z in u.context))throw new Error("Unknown context `"+z+"`");Object.assign(u,w?bS:gS),Array.isArray(F)?u.forEachToken((W,ee,de)=>{F.push({type:W,start:ee,end:de})}):typeof F=="function"&&u.forEachToken(F.bind(f())),typeof k=="function"&&u.forEachToken((W,ee,de)=>{if(W===25){let Te=u.getLocation(ee,de),xr=Nt(e,de-2,de,"*/")?e.slice(ee+2,de-2):e.slice(ee+2,de);k(xr,Te)}});let Y=u.context[z].call(u,g);return u.eof||u.error(),Y},{SyntaxError:wa,config:u.config})}var ka={};X(ka,{AtrulePrelude:()=>$l,Selector:()=>Kl,Value:()=>Jl});var SS=35,zS=42,Wl=43,TS=45,ES=47,CS=117;function jo(o){switch(this.tokenType){case 4:return this.Hash();case 18:return this.Operator();case 21:return this.Parentheses(this.readSequence,o.recognizer);case 19:return this.Brackets(this.readSequence,o.recognizer);case 5:return this.String();case 12:return this.Dimension();case 11:return this.Percentage();case 10:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,o.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,CS)&&this.cmpChar(this.tokenStart+1,Wl)?this.UnicodeRange():this.Identifier();case 9:{let e=this.charCodeAt(this.tokenStart);if(e===ES||e===zS||e===Wl||e===TS)return this.Operator();e===SS&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var $l={getNode:jo};var IS=35,RS=38,wS=42,OS=43,MS=47,Gl=46,kS=62,PS=124,LS=126;function DS(o,e){e.last!==null&&e.last.type!=="Combinator"&&o!==null&&o.type!=="Combinator"&&e.push({type:"Combinator",loc:null,name:" "})}function vS(){switch(this.tokenType){case 19:return this.AttributeSelector();case 4:return this.IdSelector();case 16:return this.lookupType(1)===16?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case 10:case 11:return this.Percentage();case 12:this.charCodeAt(this.tokenStart)===Gl&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:{switch(this.charCodeAt(this.tokenStart)){case OS:case kS:case LS:case MS:return this.Combinator();case Gl:return this.ClassSelector();case wS:case PS:return this.TypeSelector();case IS:return this.IdSelector();case RS:return this.NestingSelector()}break}}}var Kl={onWhiteSpace:DS,getNode:vS};function ql(){return this.createSingleNodeList(this.Raw(null,!1))}function Yl(){let o=this.createList();if(this.skipSC(),o.push(this.Identifier()),this.skipSC(),this.tokenType===18){o.push(this.Operator());let e=this.tokenIndex,t=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if(t.type==="Value"&&t.children.isEmpty){for(let r=e-this.tokenIndex;r<=0;r++)if(this.lookupType(r)===13){t.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}o.push(t)}return o}function Ql(o){return o!==null&&o.type==="Operator"&&(o.value[o.value.length-1]==="-"||o.value[o.value.length-1]==="+")}var Jl={getNode:jo,onWhiteSpace(o,e){Ql(o)&&(o.value=" "+o.value),Ql(e.last)&&(e.last.value+=" ")},expression:ql,var:Yl};var FS=new Set(["none","and","not","or"]),Zl={parse:{prelude(){let o=this.createList();if(this.tokenType===1){let e=this.substring(this.tokenStart,this.tokenEnd);FS.has(e.toLowerCase())||o.push(this.Identifier())}return o.push(this.Condition("container")),o},block(o=!1){return this.Block(o)}}};var Xl={parse:{prelude:null,block(){return this.Block(!0)}}};function Pa(o,e){return this.parseWithFallback(()=>{try{return o.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==22&&this.error()}},e||(()=>this.Raw(null,!0)))}var eu={layer(){this.skipSC();let o=this.createList(),e=Pa.call(this,this.Layer);return(e.type!=="Raw"||e.value!=="")&&o.push(e),o},supports(){this.skipSC();let o=this.createList(),e=Pa.call(this,this.Declaration,()=>Pa.call(this,()=>this.Condition("supports")));return(e.type!=="Raw"||e.value!=="")&&o.push(e),o}},tu={parse:{prelude(){let o=this.createList();switch(this.tokenType){case 5:o.push(this.String());break;case 7:case 2:o.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===1&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?o.push(this.Identifier()):this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&o.push(this.Function(null,eu)),this.skipSC(),this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&o.push(this.Function(null,eu)),(this.lookupNonWSType(0)===1||this.lookupNonWSType(0)===21)&&o.push(this.MediaQueryList()),o},block:null}};var ou={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}};var ru={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(o=!1){return this.Block(o)}}};var su={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};var nu={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};var iu={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(o=!1){return this.Block(o)}}};var au={parse:{prelude:null,block(o=!1){return this.Block(o)}}};var cu={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(o=!1){return this.Block(o)}}};var pu={container:Zl,"font-face":Xl,import:tu,layer:ou,media:ru,nest:su,page:nu,scope:iu,"starting-style":au,supports:cu};function du(){let o=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 1:o.push(this.Identifier());break;case 5:o.push(this.String());break;case 18:o.push(this.Operator());break;case 22:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return o}var Ut={parse(){return this.createSingleNodeList(this.SelectorList())}},La={parse(){return this.createSingleNodeList(this.Selector())}},NS={parse(){return this.createSingleNodeList(this.Identifier())}},_S={parse:du},us={parse(){return this.createSingleNodeList(this.Nth())}},lu={dir:NS,has:Ut,lang:_S,matches:Ut,is:Ut,"-moz-any":Ut,"-webkit-any":Ut,where:Ut,not:Ut,"nth-child":us,"nth-last-child":us,"nth-last-of-type":us,"nth-of-type":us,slotted:La,host:La,"host-context":La};var Da={};X(Da,{AnPlusB:()=>Mn,Atrule:()=>Pn,AtrulePrelude:()=>Dn,AttributeSelector:()=>Nn,Block:()=>Bn,Brackets:()=>Vn,CDC:()=>Hn,CDO:()=>$n,ClassSelector:()=>Kn,Combinator:()=>Yn,Comment:()=>Jn,Condition:()=>Xn,Declaration:()=>ti,DeclarationList:()=>si,Dimension:()=>ii,Feature:()=>ci,FeatureFunction:()=>di,FeatureRange:()=>mi,Function:()=>fi,GeneralEnclosed:()=>gi,Hash:()=>yi,IdSelector:()=>Ti,Identifier:()=>Si,Layer:()=>Ci,LayerList:()=>Ri,MediaQuery:()=>Oi,MediaQueryList:()=>ki,NestingSelector:()=>Li,Nth:()=>vi,Number:()=>Ni,Operator:()=>Bi,Parentheses:()=>Vi,Percentage:()=>Hi,PseudoClassSelector:()=>$i,PseudoElementSelector:()=>Ki,Ratio:()=>Yi,Raw:()=>Ji,Rule:()=>Xi,Scope:()=>ta,Selector:()=>ra,SelectorList:()=>na,String:()=>ca,StyleSheet:()=>da,SupportsDeclaration:()=>ua,TypeSelector:()=>fa,UnicodeRange:()=>ba,Url:()=>Sa,Value:()=>Ta,WhiteSpace:()=>Ca});var uu={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(o){return this.AtrulePrelude(o.atrule?String(o.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(o){return this.Condition(o.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:ka,atrule:pu,pseudo:lu,node:Da};var mu=Hl(uu);var{hasOwnProperty:va}=Object.prototype,Vo=function(){};function hu(o){return typeof o=="function"?o:Vo}function fu(o,e){return function(t,r,s){t.type===e&&o.call(this,t,r,s)}}function BS(o,e){let t=e.structure,r=[];for(let s in t){if(va.call(t,s)===!1)continue;let a=t[s],p={name:s,type:!1,nullable:!1};Array.isArray(a)||(a=[a]);for(let u of a)u===null?p.nullable=!0:typeof u=="string"?p.type="node":Array.isArray(u)&&(p.type="list");p.type&&r.push(p)}return r.length?{context:e.walkContext,fields:r}:null}function jS(o){let e={};for(let t in o.node)if(va.call(o.node,t)){let r=o.node[t];if(!r.structure)throw new Error("Missed `structure` field in `"+t+"` node type definition");e[t]=BS(t,r)}return e}function xu(o,e){let t=o.fields.slice(),r=o.context,s=typeof r=="string";return e&&t.reverse(),function(a,p,u,f){let m;s&&(m=p[r],p[r]=a);for(let x of t){let g=a[x.name];if(!x.nullable||g){if(x.type==="list"){if(e?g.reduceRight(f,!1):g.reduce(f,!1))return!0}else if(u(g))return!0}}s&&(p[r]=m)}}function gu({StyleSheet:o,Atrule:e,Rule:t,Block:r,DeclarationList:s}){return{Atrule:{StyleSheet:o,Atrule:e,Rule:t,Block:r},Rule:{StyleSheet:o,Atrule:e,Rule:t,Block:r},Declaration:{StyleSheet:o,Atrule:e,Rule:t,Block:r,DeclarationList:s}}}function bu(o){let e=jS(o),t={},r={},s=Symbol("break-walk"),a=Symbol("skip-node");for(let m in e)va.call(e,m)&&e[m]!==null&&(t[m]=xu(e[m],!1),r[m]=xu(e[m],!0));let p=gu(t),u=gu(r),f=function(m,x){function g(W,ee,de){let Te=z.call(Y,W,ee,de);return Te===s?!0:Te===a?!1:!!(k.hasOwnProperty(W.type)&&k[W.type](W,Y,g,F)||w.call(Y,W,ee,de)===s)}let z=Vo,w=Vo,k=t,F=(W,ee,de,Te)=>W||g(ee,de,Te),Y={break:s,skip:a,root:m,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof x=="function")z=x;else if(x&&(z=hu(x.enter),w=hu(x.leave),x.reverse&&(k=r),x.visit)){if(p.hasOwnProperty(x.visit))k=x.reverse?u[x.visit]:p[x.visit];else if(!e.hasOwnProperty(x.visit))throw new Error("Bad value `"+x.visit+"` for `visit` option (should be: "+Object.keys(e).sort().join(", ")+")");z=fu(z,x.visit),w=fu(w,x.visit)}if(z===Vo&&w===Vo)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");g(m)};return f.break=s,f.skip=a,f.find=function(m,x){let g=null;return f(m,function(z,w,k){if(x.call(this,z,w,k))return g=z,s}),g},f.findLast=function(m,x){let g=null;return f(m,{reverse:!0,enter(z,w,k){if(x.call(this,z,w,k))return g=z,s}}),g},f.findAll=function(m,x){let g=[];return f(m,function(z,w,k){x.call(this,z,w,k)&&g.push(z)}),g},f}var Fa={};X(Fa,{AnPlusB:()=>kn,Atrule:()=>Ln,AtrulePrelude:()=>vn,AttributeSelector:()=>_n,Block:()=>jn,Brackets:()=>Un,CDC:()=>Wn,CDO:()=>Gn,ClassSelector:()=>qn,Combinator:()=>Qn,Comment:()=>Zn,Condition:()=>ei,Declaration:()=>oi,DeclarationList:()=>ni,Dimension:()=>ai,Feature:()=>pi,FeatureFunction:()=>li,FeatureRange:()=>hi,Function:()=>xi,GeneralEnclosed:()=>bi,Hash:()=>Ai,IdSelector:()=>Ei,Identifier:()=>zi,Layer:()=>Ii,LayerList:()=>wi,MediaQuery:()=>Mi,MediaQueryList:()=>Pi,NestingSelector:()=>Di,Nth:()=>Fi,Number:()=>_i,Operator:()=>ji,Parentheses:()=>Ui,Percentage:()=>Wi,PseudoClassSelector:()=>Gi,PseudoElementSelector:()=>qi,Ratio:()=>Qi,Raw:()=>Zi,Rule:()=>ea,Scope:()=>oa,Selector:()=>sa,SelectorList:()=>ia,String:()=>pa,StyleSheet:()=>la,SupportsDeclaration:()=>ma,TypeSelector:()=>xa,UnicodeRange:()=>ya,Url:()=>za,Value:()=>Ea,WhiteSpace:()=>Ia});var yu={node:Fa};var Au=bu(yu);var VS=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),he="\uFFFD",S;(function(o){o[o.EOF=-1]="EOF",o[o.NULL=0]="NULL",o[o.TABULATION=9]="TABULATION",o[o.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",o[o.LINE_FEED=10]="LINE_FEED",o[o.FORM_FEED=12]="FORM_FEED",o[o.SPACE=32]="SPACE",o[o.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",o[o.QUOTATION_MARK=34]="QUOTATION_MARK",o[o.AMPERSAND=38]="AMPERSAND",o[o.APOSTROPHE=39]="APOSTROPHE",o[o.HYPHEN_MINUS=45]="HYPHEN_MINUS",o[o.SOLIDUS=47]="SOLIDUS",o[o.DIGIT_0=48]="DIGIT_0",o[o.DIGIT_9=57]="DIGIT_9",o[o.SEMICOLON=59]="SEMICOLON",o[o.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",o[o.EQUALS_SIGN=61]="EQUALS_SIGN",o[o.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",o[o.QUESTION_MARK=63]="QUESTION_MARK",o[o.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",o[o.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",o[o.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",o[o.GRAVE_ACCENT=96]="GRAVE_ACCENT",o[o.LATIN_SMALL_A=97]="LATIN_SMALL_A",o[o.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(S||(S={}));var Ne={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function ms(o){return o>=55296&&o<=57343}function Su(o){return o>=56320&&o<=57343}function zu(o,e){return(o-55296)*1024+9216+e}function hs(o){return o!==32&&o!==10&&o!==13&&o!==9&&o!==12&&o>=1&&o<=31||o>=127&&o<=159}function fs(o){return o>=64976&&o<=65007||VS.has(o)}var D;(function(o){o.controlCharacterInInputStream="control-character-in-input-stream",o.noncharacterInInputStream="noncharacter-in-input-stream",o.surrogateInInputStream="surrogate-in-input-stream",o.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",o.endTagWithAttributes="end-tag-with-attributes",o.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",o.unexpectedSolidusInTag="unexpected-solidus-in-tag",o.unexpectedNullCharacter="unexpected-null-character",o.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",o.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",o.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",o.missingEndTagName="missing-end-tag-name",o.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",o.unknownNamedCharacterReference="unknown-named-character-reference",o.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",o.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",o.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",o.eofBeforeTagName="eof-before-tag-name",o.eofInTag="eof-in-tag",o.missingAttributeValue="missing-attribute-value",o.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",o.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",o.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",o.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",o.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",o.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",o.missingDoctypePublicIdentifier="missing-doctype-public-identifier",o.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",o.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",o.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",o.cdataInHtmlContent="cdata-in-html-content",o.incorrectlyOpenedComment="incorrectly-opened-comment",o.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",o.eofInDoctype="eof-in-doctype",o.nestedComment="nested-comment",o.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",o.eofInComment="eof-in-comment",o.incorrectlyClosedComment="incorrectly-closed-comment",o.eofInCdata="eof-in-cdata",o.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",o.nullCharacterReference="null-character-reference",o.surrogateCharacterReference="surrogate-character-reference",o.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",o.controlCharacterReference="control-character-reference",o.noncharacterCharacterReference="noncharacter-character-reference",o.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",o.missingDoctypeName="missing-doctype-name",o.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",o.duplicateAttribute="duplicate-attribute",o.nonConformingDoctype="non-conforming-doctype",o.missingDoctype="missing-doctype",o.misplacedDoctype="misplaced-doctype",o.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",o.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",o.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",o.openElementsLeftAfterEof="open-elements-left-after-eof",o.abandonedHeadElementChild="abandoned-head-element-child",o.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",o.nestedNoscriptInHead="nested-noscript-in-head",o.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(D||(D={}));var HS=65536,xs=class{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=HS,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:r,col:s,offset:a}=this,p=s+t,u=a+t;return{code:e,startLine:r,endLine:r,startCol:p,endCol:p,startOffset:u,endOffset:u}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(Su(t))return this.pos++,this._addGap(),zu(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,S.EOF;return this._err(D.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,S.EOF;let r=this.html.charCodeAt(t);return r===S.CARRIAGE_RETURN?S.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,S.EOF;let e=this.html.charCodeAt(this.pos);return e===S.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,S.LINE_FEED):e===S.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,ms(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===S.LINE_FEED||e===S.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){hs(e)?this._err(D.controlCharacterInInputStream):fs(e)&&this._err(D.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}};var ie;(function(o){o[o.CHARACTER=0]="CHARACTER",o[o.NULL_CHARACTER=1]="NULL_CHARACTER",o[o.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",o[o.START_TAG=3]="START_TAG",o[o.END_TAG=4]="END_TAG",o[o.COMMENT=5]="COMMENT",o[o.DOCTYPE=6]="DOCTYPE",o[o.EOF=7]="EOF",o[o.HIBERNATION=8]="HIBERNATION"})(ie||(ie={}));function gs(o,e){for(let t=o.attrs.length-1;t>=0;t--)if(o.attrs[t].name===e)return o.attrs[t].value;return null}var $S=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Tu(o){return o>=55296&&o<=57343||o>1114111?65533:$S.get(o)??o}function Eu(o){let e=atob(o),t=e.length&-2,r=new Uint16Array(t/2);for(let s=0,a=0;s<t;s+=2){let p=e.charCodeAt(s),u=e.charCodeAt(s+1);r[a++]=p|u<<8}return r}var Na=Eu("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfUhdGUGYWmg0iJ0KGFsRGlmZmVyZW50aWFsRAAAoEUhbCJleXMAAKAtIQACYWVpb0EBRAFKAU0B8iFvbgxhZABpAGwAO4DHAMdAcgBjAAhhbiJpbnQAAKAwIm8AdAAKYQABZG5ZAV0BaSJsbGEAuGB0I2VyRG90ALdg8gA5AWkAp2NyImNsZQAAAkRNUFRwAXQBeQF9AW8AdAAAoJkiaSJudXMAAKCWIuwhdXMAoJUiaSJtZXMAAKCXIm8AAAFjc4cBlAFrKndpc2VDb250b3VySW50ZWdyYWwAAKAyImUjQ3VybHkAAAFEUZwBpAFvJXVibGVRdW90ZQAAoB0gdSJvdGUAAKAZIAACbG5wdbABtgHNAdgBbwBuAGWgNyIAoHQqgAFnaXQAvAHBAcUB8iJ1ZW50AKBhIm4AdAAAoC8i7yV1ckludGVncmFsAKAuIgABZnLRAdMBAKACIe8iZHVjdACgECJuLnRlckNsb2Nrd2lzZUNvbnRvdXJJbnRlZ3JhbAAAoDMi7yFzcwCgLypjAHIAAOA12J7ccABDoNMiYQBwAACgTSKABURKU1phY2VmaW9zAAsCEgIVAhgCGwIsAjQCOQI9AnMCfwNvoEUh9CJyYWhkAKARKWMAeQACZGMAeQAFZGMAeQAPZIABZ3JzACECJQIoAuchZXIAoCEgcgAAoKEhaAB2AACg5CoAAWF5MAIzAvIhb24OYRRkbAB0oAciYQCUY3IAAOA12AfdAAFhZkECawIAAWNtRQJnAvIjaXRpY2FsAAJBREdUUAJUAl8CYwJjInV0ZQC0YG8AdAFZAloC2WJiJGxlQWN1dGUA3WJyImF2ZQBgYGkibGRlANxi7yFuZACgxCJmJWVyZW50aWFsRAAAoEYhcAR9AgAAAAAAAIECjgIAABoDZgAA4DXYO91EoagAhQKJAm8AdAAAoNwgcSJ1YWwAAKBQIuIhbGUAA0NETFJVVpkCqAK1Au8C/wIRA28AbgB0AG8AdQByAEkAbgB0AGUAZwByAGEA7ADEAW8AdAKvAgAAAACwAqhgbiNBcnJvdwAAoNMhAAFlb7kC0AJmAHQAgAFBUlQAwQLGAs0CciJyb3cAAKDQIekkZ2h0QXJyb3cAoNQhZQDlACsCbgBnAAABTFLWAugC5SFmdAABQVLcAuECciJyb3cAAKD4J+kkZ2h0QXJyb3cAoPon6SRnaHRBcnJvdwCg+SdpImdodAAAAUFU9gL7AnIicm93AACg0iFlAGUAAKCoInAAQQIGAwAAAAALA3Iicm93AACg0SFvJHduQXJyb3cAAKDVIWUlcnRpY2FsQmFyAACgJSJuAAADQUJMUlRhJAM2AzoDWgNxA3oDciJyb3cAAKGTIUJVLAMwA2EAcgAAoBMpcCNBcnJvdwAAoPUhciJldmUAEWPlIWZ00gJDAwAASwMAAFIDaSVnaHRWZWN0b3IAAKBQKWUkZVZlY3RvcgAAoF4p5SJjdG9yQqC9IWEAcgAAoFYpaSJnaHQA1AFiAwAAaQNlJGVWZWN0b3IAAKBfKeUiY3RvckKgwSFhAHIAAKBXKWUAZQBBoKQiciJyb3cAAKCnIXIAcgBvAPcAtAIAAWN0gwOHA3IAAOA12J/c8iFvaxBhAAhOVGFjZGZnbG1vcHFzdHV4owOlA6kDsAO/A8IDxgPNA9ID8gP9AwEEFAQeBCAEJQRHAEphSAA7gNAA0EBjAHUAdABlADuAyQDJQIABYWl5ALYDuQO+A/Ihb24aYXIAYwA7gMoAykAtZG8AdAAWYXIAAOA12AjdcgBhAHYAZQA7gMgAyEDlIm1lbnQAoAgiAAFhcNYD2QNjAHIAEmF0AHkAUwLhAwAAAADpA20lYWxsU3F1YXJlAACg+yVlJ3J5U21hbGxTcXVhcmUAAKCrJQABZ3D2A/kDbwBuABhhZgAA4DXYPN3zImlsb26VY3UAAAFhaQYEDgRsAFSgdSppImxkZQAAoEIi7CNpYnJpdW0AoMwhAAFjaRgEGwRyAACgMCFtAACgcyphAJdjbQBsADuAywDLQAABaXApBC0E8yF0cwCgAyLvJG5lbnRpYWxFAKBHIYACY2Zpb3MAPQQ/BEMEXQRyBHkAJGRyAADgNdgJ3WwibGVkAFMCTAQAAAAAVARtJWFsbFNxdWFyZQAAoPwlZSdyeVNtYWxsU3F1YXJlAACgqiVwA2UEAABpBAAAAABtBGYAAOA12D3dwSFsbACgACLyI2llcnRyZgCgMSFjAPIAcQQABkpUYWJjZGZnb3JzdIgEiwSOBJMElwSkBKcEqwStBLIE5QTqBGMAeQADZDuAPgA+QO0hbWFkoJMD3GNyImV2ZQAeYYABZWl5AJ0EoASjBOQhaWwiYXIAYwAcYRNkbwB0ACBhcgAA4DXYCt0AoNkicABmAADgNdg+3eUiYXRlcgADRUZHTFNUvwTIBM8E1QTZBOAEcSJ1YWwATKBlIuUhc3MAoNsidSRsbEVxdWFsAACgZyJyI2VhdGVyAACgoirlIXNzAKB3IuwkYW50RXF1YWwAoH4qaSJsZGUAAKBzImMAcgAA4DXYotwAoGsiAARBYWNmaW9zdfkE/QQFBQgFCwUTBSIFKwVSIkRjeQAqZAABY3QBBQQFZQBrAMdiXmDpIXJjJGFyAACgDCFsJWJlcnRTcGFjZQAAoAsh8AEYBQAAGwVmAACgDSHpJXpvbnRhbExpbmUAoAAlAAFjdCYFKAXyABIF8iFvayZhbQBwAEQBMQU5BW8AdwBuAEgAdQBtAPAAAAFxInVhbAAAoE8iAAdFSk9hY2RmZ21ub3N0dVMFVgVZBVwFYwVtBXAFcwV6BZAFtgXFBckFzQVjAHkAFWTsIWlnMmFjAHkAAWRjAHUAdABlADuAzQDNQAABaXlnBWwFcgBjADuAzgDOQBhkbwB0ADBhcgAAoBEhcgBhAHYAZQA7gMwAzEAAoREhYXB/BYsFAAFjZ4MFhQVyACphaSNuYXJ5SQAAoEghbABpAGUA8wD6AvQBlQUAAKUFZaAsIgABZ3KaBZ4F8iFhbACgKyLzI2VjdGlvbgCgwiJpI3NpYmxlAAABQ1SsBbEFbyJtbWEAAKBjIGkibWVzAACgYiCAAWdwdAC8Bb8FwwVvAG4ALmFmAADgNdhA3WEAmWNjAHIAAKAQIWkibGRlAChh6wHSBQAA1QVjAHkABmRsADuAzwDPQIACY2Zvc3UA4QXpBe0F8gX9BQABaXnlBegFcgBjADRhGWRyAADgNdgN3XAAZgAA4DXYQd3jAfcFAAD7BXIAAOA12KXc8iFjeQhk6yFjeQRkgANISmFjZm9zAAwGDwYSBhUGHQYhBiYGYwB5ACVkYwB5AAxk8CFwYZpjAAFleRkGHAbkIWlsNmEaZHIAAOA12A7dcABmAADgNdhC3WMAcgAA4DXYptyABUpUYWNlZmxtb3N0AD0GQAZDBl4GawZkB2gHcAd0B80H2gdjAHkACWQ7gDwAPECAAmNtbnByAEwGTwZSBlUGWwb1IXRlOWHiIWRhm2NnAACg6ifsI2FjZXRyZgCgEiFyAACgniGAAWFleQBkBmcGagbyIW9uPWHkIWlsO2EbZAABZnNvBjQHdAAABUFDREZSVFVWYXKABp4GpAbGBssG3AYDByEHwQIqBwABbnKEBowGZyVsZUJyYWNrZXQAAKDoJ/Ihb3cAoZAhQlKTBpcGYQByAACg5CHpJGdodEFycm93AKDGIWUjaWxpbmcAAKAII28A9QGqBgAAsgZiJWxlQnJhY2tldAAAoOYnbgDUAbcGAAC+BmUkZVZlY3RvcgAAoGEp5SJjdG9yQqDDIWEAcgAAoFkpbCJvb3IAAKAKI2kiZ2h0AAABQVbSBtcGciJyb3cAAKCUIeUiY3RvcgCgTikAAWVy4AbwBmUAAKGjIkFW5gbrBnIicm93AACgpCHlImN0b3IAoFopaSNhbmdsZQBCorIi+wYAAAAA/wZhAHIAAKDPKXEidWFsAACgtCJwAIABRFRWAAoHEQcYB+8kd25WZWN0b3IAoFEpZSRlVmVjdG9yAACgYCnlImN0b3JCoL8hYQByAACgWCnlImN0b3JCoLwhYQByAACgUilpAGcAaAB0AGEAcgByAG8A9wDMAnMAAANFRkdMU1Q/B0cHTgdUB1gHXwfxJXVhbEdyZWF0ZXIAoNoidSRsbEVxdWFsAACgZiJyI2VhdGVyAACgdiLlIXNzAKChKuwkYW50RXF1YWwAoH0qaSJsZGUAAKByInIAAOA12A/dZaDYIuYjdGFycm93AKDaIWkiZG90AD9hgAFucHcAege1B7kHZwAAAkxSbHKCB5QHmwerB+UhZnQAAUFSiAeNB3Iicm93AACg9SfpJGdodEFycm93AKD3J+kkZ2h0QXJyb3cAoPYn5SFmdAABYXLcAqEHaQBnAGgAdABhAHIAcgBvAPcA5wJpAGcAaAB0AGEAcgByAG8A9wDuAmYAAOA12EPdZQByAAABTFK/B8YHZSRmdEFycm93AACgmSHpJGdodEFycm93AKCYIYABY2h0ANMH1QfXB/IAWgYAoLAh8iFva0FhAKBqIgAEYWNlZmlvc3XpB+wH7gf/BwMICQgOCBEIcAAAoAUpeQAcZAABZGzyB/kHaSR1bVNwYWNlAACgXyBsI2ludHJmAACgMyFyAADgNdgQ3e4jdXNQbHVzAKATInAAZgAA4DXYRN1jAPIA/gecY4AESmFjZWZvc3R1ACEIJAgoCDUIgQiFCDsKQApHCmMAeQAKZGMidXRlAENhgAFhZXkALggxCDQI8iFvbkdh5CFpbEVhHWSAAWdzdwA7CGEIfQjhInRpdmWAAU1UVgBECEwIWQhlJWRpdW1TcGFjZQAAoAsgaABpAAABY25SCFMIawBTAHAAYQBjAOUASwhlAHIAeQBUAGgAaQDuAFQI9CFlZAABR0xnCHUIcgBlAGEAdABlAHIARwByAGUAYQB0AGUA8gDrBGUAcwBzAEwAZQBzAPMA2wdMImluZQAKYHIAAOA12BHdAAJCbnB0jAiRCJkInAhyImVhawAAoGAgwiZyZWFraW5nU3BhY2WgYGYAAKAVIUOq7CqzCMIIzQgAAOcIGwkAAAAAAAAtCQAAbwkAAIcJAACdCcAJGQoAADQKAAFvdbYIvAjuI2dydWVudACgYiJwIkNhcAAAoG0ibyh1YmxlVmVydGljYWxCYXIAAKAmIoABbHF4ANII1wjhCOUibWVudACgCSL1IWFsVKBgImkibGRlAADgQiI4A2kic3RzAACgBCJyI2VhdGVyAACjbyJFRkdMU1T1CPoIAgkJCQ0JFQlxInVhbAAAoHEidSRsbEVxdWFsAADgZyI4A3IjZWF0ZXIAAOBrIjgD5SFzcwCgeSLsJGFudEVxdWFsAOB+KjgDaSJsZGUAAKB1IvUhbXBEASAJJwnvI3duSHVtcADgTiI4A3EidWFsAADgTyI4A2UAAAFmczEJRgn0JFRyaWFuZ2xlQqLqIj0JAAAAAEIJYQByAADgzyk4A3EidWFsAACg7CJzAICibiJFR0xTVABRCVYJXAlhCWkJcSJ1YWwAAKBwInIjZWF0ZXIAAKB4IuUhc3MA4GoiOAPsJGFudEVxdWFsAOB9KjgDaSJsZGUAAKB0IuUic3RlZAABR0x1CX8J8iZlYXRlckdyZWF0ZXIA4KIqOAPlI3NzTGVzcwDgoSo4A/IjZWNlZGVzAKGAIkVTjwmVCXEidWFsAADgryo4A+wkYW50RXF1YWwAoOAiAAFlaaAJqQl2JmVyc2VFbGVtZW50AACgDCLnJWh0VHJpYW5nbGVCousitgkAAAAAuwlhAHIAAODQKTgDcSJ1YWwAAKDtIgABcXXDCeAJdSNhcmVTdQAAAWJwywnVCfMhZXRF4I8iOANxInVhbAAAoOIi5SJyc2V0ReCQIjgDcSJ1YWwAAKDjIoABYmNwAOYJ8AkNCvMhZXRF4IIi0iBxInVhbAAAoIgi4yJlZWRzgKGBIkVTVAD6CQAKBwpxInVhbAAA4LAqOAPsJGFudEVxdWFsAKDhImkibGRlAADgfyI4A+UicnNldEXggyLSIHEidWFsAACgiSJpImxkZQCAoUEiRUZUACIKJwouCnEidWFsAACgRCJ1JGxsRXF1YWwAAKBHImkibGRlAACgSSJlJXJ0aWNhbEJhcgAAoCQiYwByAADgNdip3GkAbABkAGUAO4DRANFAnWMAB0VhY2RmZ21vcHJzdHV2XgphCmgKcgp2CnoKgQqRCpYKqwqtCrsKyArNCuwhaWdSYWMAdQB0AGUAO4DTANNAAAFpeWwKcQpyAGMAO4DUANRAHmRiImxhYwBQYXIAAOA12BLdcgBhAHYAZQA7gNIA0kCAAWFlaQCHCooKjQpjAHIATGFnAGEAqWNjInJvbgCfY3AAZgAA4DXYRt3lI25DdXJseQABRFGeCqYKbyV1YmxlUXVvdGUAAKAcIHUib3RlAACgGCAAoFQqAAFjbLEKtQpyAADgNdiq3GEAcwBoADuA2ADYQGkAbAHACsUKZABlADuA1QDVQGUAcwAAoDcqbQBsADuA1gDWQGUAcgAAAUJQ0wrmCgABYXLXCtoKcgAAoD4gYQBjAAABZWvgCuIKAKDeI2UAdAAAoLQjYSVyZW50aGVzaXMAAKDcI4AEYWNmaGlsb3JzAP0KAwsFCwkLCwsMCxELIwtaC3IjdGlhbEQAAKACInkAH2RyAADgNdgT3WkApmOgY/Ujc01pbnVzsWAAAWlwFQsgC24AYwBhAHIAZQBwAGwAYQBuAOUACgVmAACgGSGAobsqZWlvACoLRQtJC+MiZWRlc4CheiJFU1QANAs5C0ALcSJ1YWwAAKCvKuwkYW50RXF1YWwAoHwiaSJsZGUAAKB+Im0AZQAAoDMgAAFkcE0LUQv1IWN0AKAPIm8jcnRpb24AYaA3ImwAAKAdIgABY2leC2ILcgAA4DXYq9yoYwACVWZvc2oLbwtzC3cLTwBUADuAIgAiQHIAAOA12BTdcABmAACgGiFjAHIAAOA12KzcAAZCRWFjZWZoaW9yc3WPC5MLlwupC7YL2AvbC90LhQyTDJoMowzhIXJyAKAQKUcAO4CuAK5AgAFjbnIAnQugC6ML9SF0ZVRhZwAAoOsncgB0oKAhbAAAoBYpgAFhZXkArwuyC7UL8iFvblhh5CFpbFZhIGR2oBwhZSJyc2UAAAFFVb8LzwsAAWxxwwvIC+UibWVudACgCyL1JGlsaWJyaXVtAKDLIXAmRXF1aWxpYnJpdW0AAKBvKXIAAKAcIW8AoWPnIWh0AARBQ0RGVFVWYewLCgwQDDIMNwxeDHwM9gIAAW5y8Av4C2clbGVCcmFja2V0AACg6SfyIW93AKGSIUJM/wsDDGEAcgAAoOUhZSRmdEFycm93AACgxCFlI2lsaW5nAACgCSNvAPUBFgwAAB4MYiVsZUJyYWNrZXQAAKDnJ24A1AEjDAAAKgxlJGVWZWN0b3IAAKBdKeUiY3RvckKgwiFhAHIAAKBVKWwib29yAACgCyMAAWVyOwxLDGUAAKGiIkFWQQxGDHIicm93AACgpiHlImN0b3IAoFspaSNhbmdsZQBCorMiVgwAAAAAWgxhAHIAAKDQKXEidWFsAACgtSJwAIABRFRWAGUMbAxzDO8kd25WZWN0b3IAoE8pZSRlVmVjdG9yAACgXCnlImN0b3JCoL4hYQByAACgVCnlImN0b3JCoMAhYQByAACgUykAAXB1iQyMDGYAAKAdIe4kZEltcGxpZXMAoHAp6SRnaHRhcnJvdwCg2yEAAWNongyhDHIAAKAbIQCgsSHsJGVEZWxheWVkAKD0KYAGSE9hY2ZoaW1vcXN0dQC/DMgMzAzQDOIM5gwKDQ0NFA0ZDU8NVA1YDQABQ2PDDMYMyCFjeSlkeQAoZEYiVGN5ACxkYyJ1dGUAWmEAorwqYWVpedgM2wzeDOEM8iFvbmBh5CFpbF5hcgBjAFxhIWRyAADgNdgW3e8hcnQAAkRMUlXvDPYM/QwEDW8kd25BcnJvdwAAoJMhZSRmdEFycm93AACgkCHpJGdodEFycm93AKCSIXAjQXJyb3cAAKCRIechbWGjY+EkbGxDaXJjbGUAoBgicABmAADgNdhK3XICHw0AAAAAIg10AACgGiLhIXJlgKGhJUlTVQAqDTINSg3uJXRlcnNlY3Rpb24AoJMidQAAAWJwNw1ADfMhZXRFoI8icSJ1YWwAAKCRIuUicnNldEWgkCJxInVhbAAAoJIibiJpb24AAKCUImMAcgAA4DXYrtxhAHIAAKDGIgACYmNtcF8Nag2ODZANc6DQImUAdABFoNAicSJ1YWwAAKCGIgABY2huDYkNZSJlZHMAgKF7IkVTVAB4DX0NhA1xInVhbAAAoLAq7CRhbnRFcXVhbACgfSJpImxkZQAAoH8iVABoAGEA9ADHCwCgESIAodEiZXOVDZ8NciJzZXQARaCDInEidWFsAACghyJlAHQAAKDRIoAFSFJTYWNmaGlvcnMAtQ27Db8NyA3ODdsN3w3+DRgOHQ4jDk8AUgBOADuA3gDeQMEhREUAoCIhAAFIY8MNxg1jAHkAC2R5ACZkAAFidcwNzQ0JYKRjgAFhZXkA1A3XDdoN8iFvbmRh5CFpbGJhImRyAADgNdgX3QABZWnjDe4N8gHoDQAA7Q3lImZvcmUAoDQiYQCYYwABY27yDfkNayNTcGFjZQAA4F8gCiDTInBhY2UAoAkg7CFkZYChPCJFRlQABw4MDhMOcSJ1YWwAAKBDInUkbGxFcXVhbAAAoEUiaSJsZGUAAKBIInAAZgAA4DXYS93pI3BsZURvdACg2yAAAWN0Jw4rDnIAAOA12K/c8iFva2Zh4QpFDlYOYA5qDgAAbg5yDgAAAAAAAAAAAAB5DnwOqA6zDgAADg8RDxYPGg8AAWNySA5ODnUAdABlADuA2gDaQHIAb6CfIeMhaXIAoEkpcgDjAVsOAABdDnkADmR2AGUAbGEAAWl5Yw5oDnIAYwA7gNsA20AjZGIibGFjAHBhcgAA4DXYGN1yAGEAdgBlADuA2QDZQOEhY3JqYQABZGl/Dp8OZQByAAABQlCFDpcOAAFhcokOiw5yAF9gYQBjAAABZWuRDpMOAKDfI2UAdAAAoLUjYSVyZW50aGVzaXMAAKDdI28AbgBQoMMi7CF1cwCgjiIAAWdwqw6uDm8AbgByYWYAAOA12EzdAARBREVUYWRwc78O0g7ZDuEOBQPqDvMOBw9yInJvdwDCoZEhyA4AAMwOYQByAACgEilvJHduQXJyb3cAAKDFIW8kd25BcnJvdwAAoJUhcSV1aWxpYnJpdW0AAKBuKWUAZQBBoKUiciJyb3cAAKClIW8AdwBuAGEAcgByAG8A9wAQA2UAcgAAAUxS+Q4AD2UkZnRBcnJvdwAAoJYh6SRnaHRBcnJvdwCglyFpAGyg0gNvAG4ApWPpIW5nbmFjAHIAAOA12LDcaSJsZGUAaGFtAGwAO4DcANxAgAREYmNkZWZvc3YALQ8xDzUPNw89D3IPdg97D4AP4SFzaACgqyJhAHIAAKDrKnkAEmThIXNobKCpIgCg5ioAAWVyQQ9DDwCgwSKAAWJ0eQBJD00Paw9hAHIAAKAWIGmgFiDjIWFsAAJCTFNUWA9cD18PZg9hAHIAAKAjIukhbmV8YGUkcGFyYXRvcgAAoFgnaSJsZGUAAKBAItQkaGluU3BhY2UAoAogcgAA4DXYGd1wAGYAAOA12E3dYwByAADgNdix3GQiYXNoAACgqiKAAmNlZm9zAI4PkQ+VD5kPng/pIXJjdGHkIWdlAKDAInIAAOA12BrdcABmAADgNdhO3WMAcgAA4DXYstwAAmZpb3OqD64Prw+0D3IAAOA12BvdnmNwAGYAAOA12E/dYwByAADgNdiz3IAEQUlVYWNmb3N1AMgPyw/OD9EP2A/gD+QP6Q/uD2MAeQAvZGMAeQAHZGMAeQAuZGMAdQB0AGUAO4DdAN1AAAFpedwP3w9yAGMAdmErZHIAAOA12BzdcABmAADgNdhQ3WMAcgAA4DXYtNxtAGwAeGEABEhhY2RlZm9z/g8BEAUQDRAQEB0QIBAkEGMAeQAWZGMidXRlAHlhAAFheQkQDBDyIW9ufWEXZG8AdAB7YfIBFRAAABwQbwBXAGkAZAB0AOgAVAhhAJZjcgAAoCghcABmAACgJCFjAHIAAOA12LXc4QtCEEkQTRAAAGcQbRByEAAAAAAAAAAAeRCKEJcQ8hD9EAAAGxEhETIROREAAD4RYwB1AHQAZQA7gOEA4UByImV2ZQADYYCiPiJFZGl1eQBWEFkQWxBgEGUQAOA+IjMDAKA/InIAYwA7gOIA4kB0AGUAO4C0ALRAMGRsAGkAZwA7gOYA5kByoGEgAOA12B7dcgBhAHYAZQA7gOAA4EAAAWVwfBCGEAABZnCAEIQQ8yF5bQCgNSHoAIMQaABhALFjAAFhcI0QWwAAAWNskRCTEHIAAWFnAACgPypkApwQAAAAALEQAKInImFkc3ajEKcQqRCuEG4AZAAAoFUqAKBcKmwib3BlAACgWCoAoFoqAKMgImVsbXJzersQvRDAEN0Q5RDtEACgpCllAACgICJzAGQAYaAhImEEzhDQENIQ1BDWENgQ2hDcEACgqCkAoKkpAKCqKQCgqykAoKwpAKCtKQCgrikAoK8pdAB2oB8iYgBkoL4iAKCdKQABcHTpEOwQaAAAoCIixWDhIXJyAKB8IwABZ3D1EPgQbwBuAAVhZgAA4DXYUt0Ao0giRWFlaW9wBxEJEQ0RDxESERQRAKBwKuMhaXIAoG8qAKBKImQAAKBLInMAJ2DyIW94ZaBIIvEADhFpAG4AZwA7gOUA5UCAAWN0eQAmESoRKxFyAADgNdi23CpgbQBwAGWgSCLxAPgBaQBsAGQAZQA7gOMA40BtAGwAO4DkAORAAAFjaUERRxFvAG4AaQBuAPQA6AFuAHQAAKARKgAITmFiY2RlZmlrbG5vcHJzdWQRaBGXEZ8RpxGrEdIR1hErEjASexKKEn0RThNbE3oTbwB0AACg7SoAAWNybBGJEWsAAAJjZXBzdBF4EX0RghHvIW5nAKBMInAjc2lsb24A9mNyImltZQAAoDUgaQBtAGWgPSJxAACgzSJ2AY0RkRFlAGUAAKC9ImUAZABnoAUjZQAAoAUjcgBrAHSgtSPiIXJrAKC2IwABb3mjEaYRbgDnAHcRMWTxIXVvAKAeIIACY21wcnQAtBG5Eb4RwRHFEeEhdXPloDUi5ABwInR5dgAAoLApcwDpAH0RbgBvAPUA6gCAAWFodwDLEcwRzhGyYwCgNiHlIWVuAKBsInIAAOA12B/dZwCAA2Nvc3R1dncA4xHyEQUSEhIhEiYSKRKAAWFpdQDpEesR7xHwAKMFcgBjAACg7yVwAACgwyKAAWRwdAD4EfwRABJvAHQAAKAAKuwhdXMAoAEqaSJtZXMAAKACKnECCxIAAAAADxLjIXVwAKAGKmEAcgAAoAUm8iNpYW5nbGUAAWR1GhIeEu8hd24AoL0lcAAAoLMlcCJsdXMAAKAEKmUA5QBCD+UAkg9hInJvdwAAoA0pgAFha28ANhJoEncSAAFjbjoSZRJrAIABbHN0AEESRxJNEm8jemVuZ2UAAKDrKXEAdQBhAHIA5QBcBPIjaWFuZ2xlgKG0JWRscgBYElwSYBLvIXduAKC+JeUhZnQAoMIlaSJnaHQAAKC4JWsAAKAjJLEBbRIAAHUSsgFxEgAAcxIAoJIlAKCRJTQAAKCTJWMAawAAoIglAAFlb38ShxJx4D0A5SD1IWl2AOBhIuUgdAAAoBAjAAJwdHd4kRKVEpsSnxJmAADgNdhT3XSgpSJvAG0AAKClIvQhaWUAoMgiAAZESFVWYmRobXB0dXayEsES0RLgEvcS+xIKExoTHxMjEygTNxMAAkxSbHK5ErsSvRK/EgCgVyUAoFQlAKBWJQCgUyUAolAlRFVkdckSyxLNEs8SAKBmJQCgaSUAoGQlAKBnJQACTFJsctgS2hLcEt4SAKBdJQCgWiUAoFwlAKBZJQCjUSVITFJobHLrEu0S7xLxEvMS9RIAoGwlAKBjJQCgYCUAoGslAKBiJQCgXyVvAHgAAKDJKQACTFJscgITBBMGEwgTAKBVJQCgUiUAoBAlAKAMJQCiACVEVWR1EhMUExYTGBMAoGUlAKBoJQCgLCUAoDQlaSJudXMAAKCfIuwhdXMAoJ4iaSJtZXMAAKCgIgACTFJsci8TMRMzEzUTAKBbJQCgWCUAoBglAKAUJQCjAiVITFJobHJCE0QTRhNIE0oTTBMAoGolAKBhJQCgXiUAoDwlAKAkJQCgHCUAAWV2UhNVE3YA5QD5AGIAYQByADuApgCmQAACY2Vpb2ITZhNqE24TcgAA4DXYt9xtAGkAAKBPIG0A5aA9IogRbAAAoVwAYmh0E3YTAKDFKfMhdWIAoMgnbAF+E4QTbABloCIgdAAAoCIgcAAAoU4iRWWJE4sTAKCuKvGgTyI8BeEMqRMAAN8TABQDFB8UAAAjFDQUAAAAAIUUAAAAAI0UAAAAANcU4xT3FPsUAACIFQAAlhWAAWNwcgCuE7ET1RP1IXRlB2GAoikiYWJjZHMAuxO/E8QTzhPSE24AZAAAoEQqciJjdXAAAKBJKgABYXXIE8sTcAAAoEsqcAAAoEcqbwB0AACgQCoA4CkiAP4AAWVv2RPcE3QAAKBBIO4ABAUAAmFlaXXlE+8T9RP4E/AB6hMAAO0TcwAAoE0qbwBuAA1hZABpAGwAO4DnAOdAcgBjAAlhcABzAHOgTCptAACgUCpvAHQAC2GAAWRtbgAIFA0UEhRpAGwAO4C4ALhAcCJ0eXYAAKCyKXQAAIGiADtlGBQZFKJAcgBkAG8A9ABiAXIAAOA12CDdgAFjZWkAKBQqFDIUeQBHZGMAawBtoBMn4SFyawCgEyfHY3IAAKPLJUVjZWZtcz8UQRRHFHcUfBSAFACgwykAocYCZWxGFEkUcQAAoFciZQBhAlAUAAAAAGAUciJyb3cAAAFsclYUWhTlIWZ0AKC6IWkiZ2h0AACguyGAAlJTYWNkAGgUaRRrFG8UcxSuYACgyCRzAHQAAKCbIukhcmMAoJoi4SFzaACgnSJuImludAAAoBAqaQBkAACg7yrjIWlyAKDCKfUhYnN1oGMmaQB0AACgYybsApMUmhS2FAAAwxRvAG4AZaA6APGgVCKrAG0CnxQAAAAAoxRhAHSgLABAYAChASJmbKcUqRTuABMNZQAAAW14rhSyFOUhbnQAoAEiZQDzANIB5wG6FAAAwBRkoEUibwB0AACgbSpuAPQAzAGAAWZyeQDIFMsUzhQA4DXYVN1vAOQA1wEAgakAO3MeAdMUcgAAoBchAAFhb9oU3hRyAHIAAKC1IXMAcwAAoBcnAAFjdeYU6hRyAADgNdi43AABYnDuFPIUZaDPKgCg0SploNAqAKDSKuQhb3QAoO8igANkZWxwcnZ3AAYVEBUbFSEVRBVlFYQV4SFycgABbHIMFQ4VAKA4KQCgNSlwAhYVAAAAABkVcgAAoN4iYwAAoN8i4SFycnCgtiEAoD0pgKIqImJjZG9zACsVMBU6FT4VQRVyImNhcAAAoEgqAAFhdTQVNxVwAACgRipwAACgSipvAHQAAKCNInIAAKBFKgDgKiIA/gACYWxydksVURVuFXMVcgByAG2gtyEAoDwpeQCAAWV2dwBYFWUVaRVxAHACXxUAAAAAYxVyAGUA4wAXFXUA4wAZFWUAZQAAoM4iZSJkZ2UAAKDPImUAbgA7gKQApEBlI2Fycm93AAABbHJ7FX8V5SFmdACgtiFpImdodAAAoLchZQDkAG0VAAFjaYsVkRVvAG4AaQBuAPQAkwFuAHQAAKAxImwiY3R5AACgLSOACUFIYWJjZGVmaGlqbG9yc3R1d3oAuBW7Fb8V1RXgFegV+RUKFhUWHxZUFlcWZRbFFtsW7xb7FgUXChdyAPIAtAJhAHIAAKBlKQACZ2xyc8YVyhXOFdAV5yFlcgCgICDlIXRoAKA4IfIA9QxoAHagECAAoKMiawHZFd4VYSJyb3cAAKAPKWEA4wBfAgABYXnkFecV8iFvbg9hNGQAoUYhYW/tFfQVAAFnciEC8RVyAACgyiF0InNlcQAAoHcqgAFnbG0A/xUCFgUWO4CwALBAdABhALRjcCJ0eXYAAKCxKQABaXIOFhIW8yFodACgfykA4DXYId1hAHIAAAFschsWHRYAoMMhAKDCIYACYWVnc3YAKBauAjYWOhY+Fm0AAKHEIm9zLhY0Fm4AZABzoMQi9SFpdACgZiZhIm1tYQDdY2kAbgAAoPIiAKH3AGlvQxZRFmQAZQAAgfcAO29KFksW90BuI3RpbWVzAACgxyJuAPgAUBZjAHkAUmRjAG8CXhYAAAAAYhZyAG4AAKAeI28AcAAAoA0jgAJscHR1dwBuFnEWdRaSFp4W7CFhciRgZgAA4DXYVd0AotkCZW1wc30WhBaJFo0WcQBkoFAibwB0AACgUSJpIm51cwAAoDgi7CF1cwCgFCLxInVhcmUAoKEiYgBsAGUAYgBhAHIAdwBlAGQAZwDlANcAbgCAAWFkaAClFqoWtBZyAHIAbwD3APUMbwB3AG4AYQByAHIAbwB3APMA8xVhI3Jwb29uAAABbHK8FsAWZQBmAPQAHBZpAGcAaAD0AB4WYgHJFs8WawBhAHIAbwD3AJILbwLUFgAAAADYFnIAbgAAoB8jbwBwAACgDCOAAWNvdADhFukW7BYAAXJ55RboFgDgNdi53FVkbAAAoPYp8iFvaxFhAAFkcvMW9xZvAHQAAKDxImkA5qC/JVsSAAFhaP8WAhdyAPIANQNhAPIA1wvhIm5nbGUAoKYpAAFjaQ4XEBd5AF9k5yJyYXJyAKD/JwAJRGFjZGVmZ2xtbm9wcXJzdHV4MRc4F0YXWxcyBF4XaRd5F40XrBe0F78X2RcVGCEYLRg1GEAYAAFEbzUXgRZvAPQA+BUAAWNzPBdCF3UAdABlADuA6QDpQPQhZXIAoG4qAAJhaW95TRdQF1YXWhfyIW9uG2FyAGOgViI7gOoA6kDsIW9uAKBVIk1kbwB0ABdhAAFEcmIXZhdvAHQAAKBSIgDgNdgi3XKhmipuF3QXYQB2AGUAO4DoAOhAZKCWKm8AdAAAoJgqgKGZKmlscwCAF4UXhxfuInRlcnMAoOcjAKATIWSglSpvAHQAAKCXKoABYXBzAJMXlheiF2MAcgATYXQAeQBzogUinxcAAAAAoRdlAHQAAKAFInAAMaADIDMBqRerFwCgBCAAoAUgAAFnc7AXsRdLYXAAAKACIAABZ3C4F7sXbwBuABlhZgAA4DXYVt2AAWFscwDFF8sXzxdyAHOg1SJsAACg4yl1AHMAAKBxKmkAAKG1A2x21RfYF28AbgC1Y/VjAAJjc3V24BfoF/0XEBgAAWlv5BdWF3IAYwAAoFYiaQLuFwAAAADwF+0ADQThIW50AAFnbPUX+Rd0AHIAAKCWKuUhc3MAoJUqgAFhZWkAAxgGGAoYbABzAD1gcwB0AACgXyJ2AESgYSJEAACgeCrwImFyc2wAoOUpAAFEYRkYHRhvAHQAAKBTInIAcgAAoHEpgAFjZGkAJxgqGO0XcgAAoC8hbwD0AIwCAAFhaDEYMhi3YzuA8ADwQAABbXI5GD0YbAA7gOsA60BvAACgrCCAAWNpcABGGEgYSxhsACFgcwD0ACwEAAFlb08YVxhjAHQAYQB0AGkAbwDuABoEbgBlAG4AdABpAGEAbADlADME4Ql1GAAAgRgAAIMYiBgAAAAAoRilGAAAqhgAALsYvhjRGAAA1xgnGWwAbABpAG4AZwBkAG8AdABzAGUA8QBlF3kARGRtImFsZQAAoEAmgAFpbHIAjRiRGJ0Y7CFpZwCgA/tpApcYAAAAAJoYZwAAoAD7aQBnAACgBPsA4DXYI93sIWlnAKAB++whaWcA4GYAagCAAWFsdACvGLIYthh0AACgbSZpAGcAAKAC+24AcwAAoLElbwBmAJJh8AHCGAAAxhhmAADgNdhX3QABYWvJGMwYbADsAGsEdqDUIgCg2SphI3J0aW50AACgDSoAAWFv2hgiGQABY3PeGB8ZsQPnGP0YBRkSGRUZAAAdGbID7xjyGPQY9xj5GAAA+xg7gL0AvUAAoFMhO4C8ALxAAKBVIQCgWSEAoFshswEBGQAAAxkAoFQhAKBWIbQCCxkOGQAAAAAQGTuAvgC+QACgVyEAoFwhNQAAoFghtgEZGQAAGxkAoFohAKBdITgAAKBeIWwAAKBEIHcAbgAAoCIjYwByAADgNdi73IAIRWFiY2RlZmdpamxub3JzdHYARhlKGVoZXhlmGWkZkhmWGZkZnRmgGa0ZxhnLGc8Z4BkjGmygZyIAoIwqgAFjbXAAUBlTGVgZ9SF0ZfVhbQBhAOSgswM6FgCghipyImV2ZQAfYQABaXliGWUZcgBjAB1hM2RvAHQAIWGAoWUibHFzAMYEcBl6GfGhZSLOBAAAdhlsAGEAbgD0AN8EgKF+KmNkbACBGYQZjBljAACgqSpvAHQAb6CAKmyggioAoIQqZeDbIgD+cwAAoJQqcgAA4DXYJN3noGsirATtIWVsAKA3IWMAeQBTZIChdyJFYWoApxmpGasZAKCSKgCgpSoAoKQqAAJFYWVztBm2Gb0ZwhkAoGkicABwoIoq8iFveACgiipxoIgq8aCIKrUZaQBtAACg5yJwAGYAAOA12FjdYQB2AOUAYwIAAWNp0xnWGXIAAKAKIW0AAKFzImVs3BneGQCgjioAoJAqAIM+ADtjZGxxco0E6xn0GfgZ/BkBGgABY2nvGfEZAKCnKnIAAKB6Km8AdAAAoNci0CFhcgCglSl1ImVzdAAAoHwqgAJhZGVscwAKGvQZFhrVBCAa8AEPGgAAFBpwAHIAbwD4AFkZcgAAoHgpcQAAAWxxxAQbGmwAZQBzAPMASRlpAO0A5AQAAWVuJxouGnIjdG5lcXEAAOBpIgD+xQAsGgAFQWFiY2Vma29zeUAaQxpmGmoabRqDGocalhrCGtMacgDyAMwCAAJpbG1yShpOGlAaVBpyAHMA8ABxD2YAvWBpAGwA9AASBQABZHJYGlsaYwB5AEpkAKGUIWN3YBpkGmkAcgAAoEgpAKCtIWEAcgAAoA8h6SFyYyVhgAFhbHIAcxp7Gn8a8iF0c3WgZSZpAHQAAKBlJuwhaXAAoCYg4yFvbgCguSJyAADgNdgl3XMAAAFld4wakRphInJvdwAAoCUpYSJyb3cAAKAmKYACYW1vcHIAnxqjGqcauhq+GnIAcgAAoP8h9CFodACgOyJrAAABbHKsGrMaZSRmdGFycm93AACgqSHpJGdodGFycm93AKCqIWYAAOA12Fnd4iFhcgCgFSCAAWNsdADIGswa0BpyAADgNdi93GEAcwDoAGka8iFvaydhAAFicNca2xr1IWxsAKBDIOghZW4AoBAg4Qr2GgAA/RoAAAgbExsaGwAAIRs7GwAAAAA+G2IbmRuVG6sbAACyG80b0htjAHUAdABlADuA7QDtQAChYyBpeQEbBhtyAGMAO4DuAO5AOGQAAWN4CxsNG3kANWRjAGwAO4ChAKFAAAFmcssCFhsA4DXYJt1yAGEAdgBlADuA7ADsQIChSCFpbm8AJxsyGzYbAAFpbisbLxtuAHQAAKAMKnQAAKAtIuYhaW4AoNwpdABhAACgKSHsIWlnM2GAAWFvcABDG1sbXhuAAWNndABJG0sbWRtyACthgAFlbHAAcQVRG1UbaQBuAOUAyAVhAHIA9AByBWgAMWFmAACgtyJlAGQAtWEAoggiY2ZvdGkbbRt1G3kb4SFyZQCgBSFpAG4AdKAeImkAZQAAoN0pZABvAPQAWxsAoisiY2VscIEbhRuPG5QbYQBsAACguiIAAWdyiRuNG2UAcgDzACMQ4wCCG2EicmhrAACgFyryIW9kAKA8KgACY2dwdJ8boRukG6gbeQBRZG8AbgAvYWYAAOA12FrdYQC5Y3UAZQBzAHQAO4C/AL9AAAFjabUbuRtyAADgNdi+3G4AAKIIIkVkc3bCG8QbyBvQAwCg+SJvAHQAAKD1Inag9CIAoPMiaaBiIOwhZGUpYesB1hsAANkbYwB5AFZkbAA7gO8A70AAA2NmbW9zdeYb7hvyG/Ub+hsFHAABaXnqG+0bcgBjADVhOWRyAADgNdgn3eEhdGg3YnAAZgAA4DXYW93jAf8bAAADHHIAAOA12L/c8iFjeVhk6yFjeVRkAARhY2ZnaGpvcxUcGhwiHCYcKhwtHDAcNRzwIXBhdqC6A/BjAAFleR4cIRzkIWlsN2E6ZHIAAOA12CjdciJlZW4AOGFjAHkARWRjAHkAXGRwAGYAAOA12FzdYwByAADgNdjA3IALQUJFSGFiY2RlZmdoamxtbm9wcnN0dXYAXhxtHHEcdRx5HN8cBx0dHTwd3B3tHfEdAR4EHh0eLB5FHrwewx7hHgkfPR9LH4ABYXJ0AGQcZxxpHHIA8gBvB/IAxQLhIWlsAKAbKeEhcnIAoA4pZ6BmIgCgiyphAHIAAKBiKWMJjRwAAJAcAACVHAAAAAAAAAAAAACZHJwcAACmHKgcrRwAANIc9SF0ZTph7SJwdHl2AKC0KXIAYQDuAFoG4iFkYbtjZwAAoegnZGyhHKMcAKCRKeUAiwYAoIUqdQBvADuAqwCrQHIAgKOQIWJmaGxwc3QAuhy/HMIcxBzHHMoczhxmoOQhcwAAoB8pcwAAoB0p6wCyGnAAAKCrIWwAAKA5KWkAbQAAoHMpbAAAoKIhAKGrKmFl1hzaHGkAbAAAoBkpc6CtKgDgrSoA/oABYWJyAOUc6RztHHIAcgAAoAwpcgBrAACgcicAAWFr8Rz4HGMAAAFla/Yc9xx7YFtgAAFlc/wc/hwAoIspbAAAAWR1Ax0FHQCgjykAoI0pAAJhZXV5Dh0RHRodHB3yIW9uPmEAAWRpFR0YHWkAbAA8YewAowbiAPccO2QAAmNxcnMkHScdLB05HWEAAKA2KXUAbwDyoBwgqhEAAWR1MB00HeghYXIAoGcpcyJoYXIAAKBLKWgAAKCyIQCiZCJmZ3FzRB1FB5Qdnh10AIACYWhscnQATh1WHWUdbB2NHXIicm93AHSgkCFhAOkAzxxhI3Jwb29uAAABZHVeHWId7yF3bgCgvSFwAACgvCHlJGZ0YXJyb3dzAKDHIWkiZ2h0AIABYWhzAHUdex2DHXIicm93APOglCGdBmEAcgBwAG8AbwBuAPMAzgtxAHUAaQBnAGEAcgByAG8A9wBlGugkcmVldGltZXMAoMsi8aFkIk0HAACaHWwAYQBuAPQAXgcAon0qY2Rnc6YdqR2xHbcdYwAAoKgqbwB0AG+gfypyoIEqAKCDKmXg2iIA/nMAAKCTKoACYWRlZ3MAwB3GHcod1h3ZHXAAcAByAG8A+ACmHG8AdAAAoNYicQAAAWdxzx3SHXQA8gBGB2cAdADyAHQcdADyAFMHaQDtAGMHgAFpbHIA4h3mHeod8yFodACgfClvAG8A8gDKBgDgNdgp3UWgdiIAoJEqYQH1Hf4dcgAAAWR1YB35HWygvCEAoGopbABrAACghCVjAHkAWWQAomoiYWNodAweDx4VHhkecgDyAGsdbwByAG4AZQDyAGAW4SFyZACgaylyAGkAAKD6JQABaW8hHiQe5CFvdEBh9SFzdGGgsCPjIWhlAKCwIwACRWFlczMeNR48HkEeAKBoInAAcKCJKvIhb3gAoIkqcaCHKvGghyo0HmkAbQAAoOYiAARhYm5vcHR3elIeXB5fHoUelh6mHqsetB4AAW5yVh5ZHmcAAKDsJ3IAAKD9IXIA6wCwBmcAgAFsbXIAZh52Hnse5SFmdAABYXKIB2weaQBnAGgAdABhAHIAcgBvAPcAkwfhInBzdG8AoPwnaQBnAGgAdABhAHIAcgBvAPcAmgdwI2Fycm93AAABbHKNHpEeZQBmAPQAxhxpImdodAAAoKwhgAFhZmwAnB6fHqIecgAAoIUpAOA12F3ddQBzAACgLSppIm1lcwAAoDQqYQGvHrMecwB0AACgFyLhAIoOZaHKJbkeRhLuIWdlAKDKJWEAcgBsoCgAdAAAoJMpgAJhY2htdADMHs8e1R7bHt0ecgDyAJ0GbwByAG4AZQDyANYWYQByAGSgyyEAoG0pAKAOIHIAaQAAoL8iAANhY2hpcXTrHu8e1QfzHv0eBh/xIXVvAKA5IHIAAOA12MHcbQDloXIi+h4AAPweAKCNKgCgjyoAAWJ19xwBH28AcqAYIACgGiDyIW9rQmEAhDwAO2NkaGlscXJCBhcfxh0gHyQfKB8sHzEfAAFjaRsfHR8AoKYqcgAAoHkqcgBlAOUAkx3tIWVzAKDJIuEhcnIAoHYpdSJlc3QAAKB7KgABUGk1HzkfYQByAACglillocMlAgdfEnIAAAFkdUIfRx9zImhhcgAAoEop6CFhcgCgZikAAWVuTx9WH3IjdG5lcXEAAOBoIgD+xQBUHwAHRGFjZGVmaGlsbm9wc3VuH3Ifoh+rH68ftx+7H74f5h/uH/MfBwj/HwsgxCFvdACgOiIAAmNscHJ5H30fiR+eH3IAO4CvAK9AAAFldIEfgx8AoEImZaAgJ3MAZQAAoCAnc6CmIXQAbwCAoaYhZGx1AJQfmB+cH28AdwDuAHkDZQBmAPQA6gbwAOkO6yFlcgCgriUAAW95ph+qH+0hbWEAoCkqPGThIXNoAKAUIOElc3VyZWRhbmdsZQCgISJyAADgNdgq3W8AAKAnIYABY2RuAMQfyR/bH3IAbwA7gLUAtUBhoiMi0B8AANMf1x9zAPQAKxFpAHIAAKDwKm8AdAA7gLcAt0B1AHMA4qESIh4TAADjH3WgOCIAoCoqYwHqH+0fcAAAoNsq8gB+GnAAbAB1APMACAgAAWRw9x/7H+UhbHMAoKciZgAA4DXYXt0AAWN0AyAHIHIAAOA12MLc8CFvcwCgPiJsobwDECAVIPQiaW1hcACguCJhAPAAEyAADEdMUlZhYmNkZWZnaGlqbG1vcHJzdHV2dzwgRyBmIG0geSCqILgg2iDeIBEhFSEyIUMhTSFQIZwhnyHSIQAiIyKLIrEivyIUIwABZ3RAIEMgAODZIjgD9uBrItIgBwmAAWVsdABNIF8gYiBmAHQAAAFhclMgWCByInJvdwAAoM0h6SRnaHRhcnJvdwCgziEA4NgiOAP24Goi0iBfCekkZ2h0YXJyb3cAoM8hAAFEZHEgdSDhIXNoAKCvIuEhc2gAoK4igAJiY25wdACCIIYgiSCNIKIgbABhAACgByL1IXRlRGFnAADgICLSIACiSSJFaW9wlSCYIJwgniAA4HAqOANkAADgSyI4A3MASWFyAG8A+AAyCnUAcgBhoG4mbADzoG4mmwjzAa8gAACzIHAAO4CgAKBAbQBwAOXgTiI4AyoJgAJhZW91eQDBIMogzSDWINkg8AHGIAAAyCAAoEMqbwBuAEhh5CFpbEZhbgBnAGSgRyJvAHQAAOBtKjgDcAAAoEIqPWThIXNoAKATIACjYCJBYWRxc3jpIO0g+SD+IAIhDCFyAHIAAKDXIXIAAAFocvIg9SBrAACgJClvoJch9wAGD28AdAAA4FAiOAN1AGkA9gC7CAABZWkGIQohYQByAACgKCntAN8I6SFzdPOgBCLlCHIAAOA12CvdAAJFZXN0/wgcISshLiHxoXEiIiEAABMJ8aFxIgAJAAAnIWwAYQBuAPQAEwlpAO0AGQlyoG8iAKBvIoABQWFwADghOyE/IXIA8gBeIHIAcgAAoK4hYQByAACg8ipzogsiSiEAAAAAxwtkoPwiAKD6ImMAeQBaZIADQUVhZGVzdABcIV8hYiFmIWkhkyGWIXIA8gBXIADgZiI4A3IAcgAAoJohcgAAoCUggKFwImZxcwBwIYQhjiF0AAABYXJ1IXohcgByAG8A9wBlIWkAZwBoAHQAYQByAHIAbwD3AD4h8aFwImAhAACKIWwAYQBuAPQAZwlz4H0qOAMAoG4iaQDtAG0JcqBuImkA5aDqIkUJaQDkADoKAAFwdKMhpyFmAADgNdhf3YCBrAA7aW4AriGvIcchrEBuAIChCSJFZHYAtyG6Ib8hAOD5IjgDbwB0AADg9SI4A+EB1gjEIcYhAKD3IgCg9iJpAHagDCLhAagJzyHRIQCg/iIAoP0igAFhb3IA2CHsIfEhcgCAoSYiYXN0AOAh5SHpIWwAbABlAOwAywhsAADg/SrlIADgAiI4A2wiaW50AACgFCrjoYAi9yEAAPohdQDlAJsJY+CvKjgDZaCAIvEAkwkAAkFhaXQHIgoiFyIeInIA8gBsIHIAcgAAoZshY3cRIhQiAOAzKTgDAOCdITgDZyRodGFycm93AACgmyFyAGkA5aDrIr4JgANjaGltcHF1AC8iPCJHIpwhTSJQIloigKGBImNlcgA2Iv0JOSJ1AOUABgoA4DXYw9zvIXJ0bQKdIQAAAABEImEAcgDhAOEhbQBloEEi8aBEIiYKYQDyAMsIcwB1AAABYnBWIlgi5QDUCeUA3wmAAWJjcABgInMieCKAoYQiRWVzAGci7glqIgDgxSo4A2UAdABl4IIi0iBxAPGgiCJoImMAZaCBIvEA/gmAoYUiRWVzAH8iFgqCIgDgxio4A2UAdABl4IMi0iBxAPGgiSKAIgACZ2lscpIilCKaIpwi7AAMCWwAZABlADuA8QDxQOcAWwlpI2FuZ2xlAAABbHKkIqoi5SFmdGWg6iLxAEUJaSJnaHQAZaDrIvEAvgltoL0DAKEjAGVzuCK8InIAbwAAoBYhcAAAoAcggARESGFkZ2lscnMAziLSItYi2iLeIugi7SICIw8j4SFzaACgrSLhIXJyAKAEKXAAAOBNItIg4SFzaACgrCIAAWV04iLlIgDgZSLSIADgPgDSIG4iZmluAACg3imAAUFldADzIvci+iJyAHIAAKACKQDgZCLSIHLgPADSIGkAZQAA4LQi0iAAAUF0BiMKI3IAcgAAoAMp8iFpZQDgtSLSIGkAbQAA4Dwi0iCAAUFhbgAaIx4jKiNyAHIAAKDWIXIAAAFociMjJiNrAACgIylvoJYh9wD/DuUhYXIAoCcpUxJqFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVCMAAF4jaSN/I4IjjSOeI8AUAAAAAKYjwCMAANoj3yMAAO8jHiQvJD8kRCQAAWNzVyNsFHUAdABlADuA8wDzQAABaXlhI2cjcgBjoJoiO4D0APRAPmSAAmFiaW9zAHEjdCN3I3EBeiNzAOgAdhTsIWFjUWF2AACgOCrvIWxkAKC8KewhaWdTYQABY3KFI4kjaQByAACgvykA4DXYLN1vA5QjAAAAAJYjAACcI24A22JhAHYAZQA7gPIA8kAAoMEpAAFibaEjjAphAHIAAKC1KQACYWNpdKwjryO6I70jcgDyAFkUAAFpcrMjtiNyAACgvinvIXNzAKC7KW4A5QDZCgCgwCmAAWFlaQDFI8gjyyNjAHIATWFnAGEAyWOAAWNkbgDRI9Qj1iPyIW9uv2MAoLYpdQDzAHgBcABmAADgNdhg3YABYWVsAOQj5yPrI3IAAKC3KXIAcAAAoLkpdQDzAHwBAKMoImFkaW9zdvkj/CMPJBMkFiQbJHIA8gBeFIChXSplZm0AAyQJJAwkcgBvoDQhZgAAoDQhO4CqAKpAO4C6ALpA5yFvZgCgtiJyAACgVipsIm9wZQAAoFcqAKBbKoABY2xvACMkJSQrJPIACCRhAHMAaAA7gPgA+EBsAACgmCJpAGwBMyQ4JGQAZQA7gPUA9UBlAHMAYaCXInMAAKA2Km0AbAA7gPYA9kDiIWFyAKA9I+EKXiQAAHokAAB8JJQkAACYJKkkAAAAALUkEQsAAPAkAAAAAAQleiUAAIMlcgCAoSUiYXN0AGUkbyQBCwCBtgA7bGokayS2QGwAZQDsABgDaQJ1JAAAAAB4JG0AAKDzKgCg/Sp5AD9kcgCAAmNpbXB0AIUkiCSLJJkSjyRuAHQAJWBvAGQALmBpAGwAAKAwIOUhbmsAoDEgcgAA4DXYLd2AAWltbwCdJKAkpCR2oMYD1WNtAGEA9AD+B24AZQAAoA4m9KHAA64kAAC0JGMjaGZvcmsAAKDUItZjAAFhdbgkxCRuAAABY2u9JMIkawBooA8hAKAOIfYAaRpzAACkKwBhYmNkZW1zdNMkIRPXJNsk4STjJOck6yTjIWlyAKAjKmkAcgAAoCIqAAFvdYsW3yQAoCUqAKByKm4AO4CxALFAaQBtAACgJip3AG8AAKAnKoABaXB1APUk+iT+JO4idGludACgFSpmAADgNdhh3W4AZAA7gKMAo0CApHoiRWFjZWlub3N1ABMlFSUYJRslTCVRJVklSSV1JQCgsypwAACgtyp1AOUAPwtjoK8qgKJ6ImFjZW5zACclLSU0JTYlSSVwAHAAcgBvAPgAFyV1AHIAbAB5AGUA8QA/C/EAOAuAAWFlcwA8JUElRSXwInByb3gAoLkqcQBxAACgtSppAG0AAKDoImkA7QBEC20AZQDzoDIgIguAAUVhcwBDJVclRSXwAEAlgAFkZnAATwtfJXElgAFhbHMAZSVpJW0l7CFhcgCgLiPpIW5lAKASI/UhcmYAoBMjdKAdIu8AWQvyIWVsAKCwIgABY2l9JYElcgAA4DXYxdzIY24iY3NwAACgCCAAA2Zpb3BzdZElKxuVJZolnyWkJXIAAOA12C7dcABmAADgNdhi3XIiaW1lAACgVyBjAHIAAOA12MbcgAFhZW8AqiW6JcAldAAAAWVpryW2JXIAbgBpAG8AbgDzABkFbgB0AACgFipzAHQAZaA/APEACRj0AG0LgApBQkhhYmNkZWZoaWxtbm9wcnN0dXgA4yXyJfYl+iVpJpAmpia9JtUm5ib4JlonaCdxJ3UnnietJ7EnyCfiJ+cngAFhcnQA6SXsJe4lcgDyAJkM8gD6AuEhaWwAoBwpYQByAPIA3BVhAHIAAKBkKYADY2RlbnFydAAGJhAmEyYYJiYmKyZaJgABZXUKJg0mAOA9IjEDdABlAFVhaQDjACAN7SJwdHl2AKCzKWcAgKHpJ2RlbAAgJiImJCYAoJIpAKClKeUA9wt1AG8AO4C7ALtAcgAApZIhYWJjZmhscHN0dz0mQCZFJkcmSiZMJk4mUSZVJlgmcAAAoHUpZqDlIXMAAKAgKQCgMylzAACgHinrALka8ACVHmwAAKBFKWkAbQAAoHQpbAAAoKMhAKCdIQABYWleJmImaQBsAACgGilvAG6gNiJhAGwA8wB2C4ABYWJyAG8mciZ2JnIA8gAvEnIAawAAoHMnAAFha3omgSZjAAABZWt/JoAmfWBdYAABZXOFJocmAKCMKWwAAAFkdYwmjiYAoI4pAKCQKQACYWV1eZcmmiajJqUm8iFvbllhAAFkaZ4moSZpAGwAV2HsAA8M4gCAJkBkAAJjbHFzrSawJrUmuiZhAACgNylkImhhcgAAoGkpdQBvAPKgHSCjAWgAAKCzIYABYWNnAMMm0iaUC2wAgKEcIWlwcwDLJs4migxuAOUAoAxhAHIA9ADaC3QAAKCtJYABaWxyANsm3ybjJvMhaHQAoH0pbwBvAPIANgwA4DXYL90AAWFv6ib1JnIAAAFkde8m8SYAoMEhbKDAIQCgbCl2oMED8WOAAWducwD+Jk4nUCdoAHQAAANhaGxyc3QKJxInISc1Jz0nRydyInJvdwB0oJIhYQDpAFYmYSNycG9vbgAAAWR1GiceJ28AdwDuAPAmcAAAoMAh5SFmdAABYWgnJy0ncgByAG8AdwDzAAkMYQByAHAAbwBvAG4A8wATBGklZ2h0YXJyb3dzAACgySFxAHUAaQBnAGEAcgByAG8A9wBZJugkcmVldGltZXMAoMwiZwDaYmkAbgBnAGQAbwB0AHMAZQDxABwYgAFhaG0AYCdjJ2YncgDyAAkMYQDyABMEAKAPIG8idXN0AGGgsSPjIWhlAKCxI+0haWQAoO4qAAJhYnB0fCeGJ4knmScAAW5ygCeDJ2cAAKDtJ3IAAKD+IXIA6wAcDIABYWZsAI8nkieVJ3IAAKCGKQDgNdhj3XUAcwAAoC4qaSJtZXMAAKA1KgABYXCiJ6gncgBnoCkAdAAAoJQp7yJsaW50AKASKmEAcgDyADwnAAJhY2hxuCe8J6EMwCfxIXVvAKA6IHIAAOA12MfcAAFidYAmxCdvAPKgGSCoAYABaGlyAM4n0ifWJ3IAZQDlAE0n7SFlcwCgyiJpAIChuSVlZmwAXAxjEt4n9CFyaQCgzinsInVoYXIAoGgpAKAeIWENBSgJKA0oSyhVKIYoAACLKLAoAAAAAOMo5ygAABApJCkxKW0pcSmHKaYpAACYKgAAAACxKmMidXRlAFthcQB1AO8ABR+ApHsiRWFjZWlucHN5ABwoHignKCooLygyKEEoRihJKACgtCrwASMoAAAlKACguCpvAG4AYWF1AOUAgw1koLAqaQBsAF9hcgBjAF1hgAFFYXMAOCg6KD0oAKC2KnAAAKC6KmkAbQAAoOki7yJsaW50AKATKmkA7QCIDUFkbwB0AGKixSKRFgAAAABTKACgZiqAA0FhY21zdHgAYChkKG8ocyh1KHkogihyAHIAAKDYIXIAAAFocmkoayjrAJAab6CYIfcAzAd0ADuApwCnQGkAO2D3IWFyAKApKW0AAAFpbn4ozQBuAHUA8wDOAHQAAKA2J3IA7+A12DDdIxkAAmFjb3mRKJUonSisKHIAcAAAoG8mAAFoeZkonChjAHkASWRIZHIAdABtAqUoAAAAAKgoaQDkAFsPYQByAGEA7ABsJDuArQCtQAABZ22zKLsobQBhAAChwwNmdroouijCY4CjPCJkZWdsbnByAMgozCjPKNMo1yjaKN4obwB0AACgairxoEMiCw5FoJ4qAKCgKkWgnSoAoJ8qZQAAoEYi7CF1cwCgJCrhIXJyAKByKWEAcgDyAPwMAAJhZWl07Sj8KAEpCCkAAWxz8Sj4KGwAcwBlAHQAbQDpAH8oaABwAACgMyrwImFyc2wAoOQpAAFkbFoPBSllAACgIyNloKoqc6CsKgDgrCoA/oABZmxwABUpGCkfKfQhY3lMZGKgLwBhoMQpcgAAoD8jZgAA4DXYZN1hAAABZHIoKRcDZQBzAHWgYCZpAHQAAKBgJoABY3N1ADYpRilhKQABYXU6KUApcABzoJMiAOCTIgD+cABzoJQiAOCUIgD+dQAAAWJwSylWKQChjyJlcz4NUCllAHQAZaCPIvEAPw0AoZAiZXNIDVspZQB0AGWgkCLxAEkNAKGhJWFmZilbBHIAZQFrKVwEAKChJWEAcgDyAAMNAAJjZW10dyl7KX8pgilyAADgNdjI3HQAbQDuAM4AaQDsAAYpYQByAOYAVw0AAWFyiimOKXIA5qAGJhESAAFhbpIpoylpImdodAAAAWVwmSmgKXAAcwBpAGwAbwDuANkXaADpAKAkcwCvYIACYmNtbnAArin8KY4NJSooKgCkgiJFZGVtbnByc7wpvinCKcgpzCnUKdgp3CkAoMUqbwB0AACgvSpkoIYibwB0AACgwyr1IWx0AKDBKgABRWXQKdIpAKDLKgCgiiLsIXVzAKC/KuEhcnIAoHkpgAFlaXUA4inxKfQpdAAAoYIiZW7oKewpcQDxoIYivSllAHEA8aCKItEpbQAAoMcqAAFicPgp+ikAoNUqAKDTKmMAgKJ7ImFjZW5zAAcqDSoUKhYqRihwAHAAcgBvAPgAIyh1AHIAbAB5AGUA8QCDDfEAfA2AAWFlcwAcKiIqPShwAHAAcgBvAPgAPChxAPEAOShnAACgaiYApoMiMTIzRWRlaGxtbnBzPCo/KkIqRSpHKlIqWCpjKmcqaypzKncqO4C5ALlAO4CyALJAO4CzALNAAKDGKgABb3NLKk4qdAAAoL4qdQBiAACg2CpkoIcibwB0AACgxCpzAAABb3VdKmAqbAAAoMknYgAAoNcq4SFycgCgeyn1IWx0AKDCKgABRWVvKnEqAKDMKgCgiyLsIXVzAKDAKoABZWl1AH0qjCqPKnQAAKGDImVugyqHKnEA8aCHIkYqZQBxAPGgiyJwKm0AAKDIKgABYnCTKpUqAKDUKgCg1iqAAUFhbgCdKqEqrCpyAHIAAKDZIXIAAAFocqYqqCrrAJUab6CZIfcAxQf3IWFyAKAqKWwAaQBnADuA3wDfQOELzyrZKtwq6SrsKvEqAAD1KjQrAAAAAAAAAAAAAEwrbCsAAHErvSsAAAAAAADRK3IC1CoAAAAA2CrnIWV0AKAWI8RjcgDrAOUKgAFhZXkA4SrkKucq8iFvbmVh5CFpbGNhQmRvAPQAIg5sInJlYwAAoBUjcgAA4DXYMd0AAmVpa2/7KhIrKCsuK/IBACsAAAkrZQAAATRm6g0EK28AcgDlAOsNYQBzorgDECsAAAAAEit5AG0A0WMAAWNuFislK2sAAAFhcxsrIStwAHAAcgBvAPgAFw5pAG0AAKA8InMA8AD9DQABYXMsKyEr8AAXDnIAbgA7gP4A/kDsATgrOyswG2QA5QBnAmUAcwCAgdcAO2JkAEMrRCtJK9dAYaCgInIAAKAxKgCgMCqAAWVwcwBRK1MraSvhAAkh4qKkIlsrXysAAAAAYytvAHQAAKA2I2kAcgAAoPEqb+A12GXdcgBrAACg2irhAHgociJpbWUAAKA0IIABYWlwAHYreSu3K2QA5QC+DYADYWRlbXBzdACFK6MrmiunK6wrsCuzK24iZ2xlAACitSVkbHFykCuUK5ornCvvIXduAKC/JeUhZnRloMMl8QACBwCgXCJpImdodABloLkl8QBdDG8AdAAAoOwlaSJudXMAAKA6KuwhdXMAoDkqYgAAoM0p6SFtZQCgOyrlInppdW0AoOIjgAFjaHQAwivKK80rAAFyecYrySsA4DXYydxGZGMAeQBbZPIhb2tnYQABaW/UK9creAD0ANERaCJlYWQAAAFsct4r5ytlAGYAdABhAHIAcgBvAPcAXQbpJGdodGFycm93AKCgIQAJQUhhYmNkZmdobG1vcHJzdHV3CiwNLBEsHSwnLDEsQCxLLFIsYix6LIQsjyzLLOgs7Sz/LAotcgDyAAkDYQByAACgYykAAWNyFSwbLHUAdABlADuA+gD6QPIACQ1yAOMBIywAACUseQBeZHYAZQBtYQABaXkrLDAscgBjADuA+wD7QENkgAFhYmgANyw6LD0scgDyANEO7CFhY3FhYQDyAOAOAAFpckQsSCzzIWh0AKB+KQDgNdgy3XIAYQB2AGUAO4D5APlAYQFWLF8scgAAAWxyWixcLACgvyEAoL4hbABrAACggCUAAWN0Zix2LG8CbCwAAAAAcyxyAG4AZaAcI3IAAKAcI28AcAAAoA8jcgBpAACg+CUAAWFsfiyBLGMAcgBrYTuAqACoQAABZ3CILIssbwBuAHNhZgAA4DXYZt0AA2FkaGxzdZksniynLLgsuyzFLHIAcgBvAPcACQ1vAHcAbgBhAHIAcgBvAPcA2A5hI3Jwb29uAAABbHKvLLMsZQBmAPQAWyxpAGcAaAD0AF0sdQDzAKYOaQAAocUDaGzBLMIs0mNvAG4AxWPwI2Fycm93cwCgyCGAAWNpdADRLOEs5CxvAtcsAAAAAN4scgBuAGWgHSNyAACgHSNvAHAAAKAOI24AZwBvYXIAaQAAoPklYwByAADgNdjK3IABZGlyAPMs9yz6LG8AdAAAoPAi7CFkZWlhaQBmoLUlAKC0JQABYW0DLQYtcgDyAMosbAA7gPwA/EDhIm5nbGUAoKcpgAdBQkRhY2RlZmxub3Byc3oAJy0qLTAtNC2bLZ0toS2/LcMtxy3TLdgt3C3gLfwtcgDyABADYQByAHag6CoAoOkqYQBzAOgA/gIAAW5yOC08LechcnQAoJwpgANla25wcnN0AJkpSC1NLVQtXi1iLYItYQBwAHAA4QAaHG8AdABoAGkAbgDnAKEXgAFoaXIAoSmzJFotbwBwAPQAdCVooJUh7wD4JgABaXVmLWotZwBtAOEAuygAAWJwbi14LXMjZXRuZXEAceCKIgD+AODLKgD+cyNldG5lcQBx4IsiAP4A4MwqAP4AAWhyhi2KLWUAdADhABIraSNhbmdsZQAAAWxyki2WLeUhZnQAoLIiaSJnaHQAAKCzInkAMmThIXNoAKCiIoABZWxyAKcttC24LWKiKCKuLQAAAACyLWEAcgAAoLsicQAAoFoi7CFpcACg7iIAAWJ0vC1eD2EA8gBfD3IAAOA12DPddAByAOkAlS1zAHUAAAFicM0t0C0A4IIi0iAA4IMi0iBwAGYAAOA12GfdcgBvAPAAWQt0AHIA6QCaLQABY3XkLegtcgAA4DXYy9wAAWJw7C30LW4AAAFFZXUt8S0A4IoiAP5uAAABRWV/LfktAOCLIgD+6SJnemFnAKCaKYADY2Vmb3BycwANLhAuJS4pLiMuLi40LukhcmN1YQABZGkULiEuAAFiZxguHC5hAHIAAKBfKmUAcaAnIgCgWSLlIXJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg");var ke;(function(o){o[o.VALUE_LENGTH=49152]="VALUE_LENGTH",o[o.FLAG13=8192]="FLAG13",o[o.BRANCH_LENGTH=8064]="BRANCH_LENGTH",o[o.JUMP_TABLE=127]="JUMP_TABLE"})(ke||(ke={}));var ze;(function(o){o[o.NUM=35]="NUM",o[o.SEMI=59]="SEMI",o[o.EQUALS=61]="EQUALS",o[o.ZERO=48]="ZERO",o[o.NINE=57]="NINE",o[o.LOWER_A=97]="LOWER_A",o[o.LOWER_F=102]="LOWER_F",o[o.LOWER_X=120]="LOWER_X",o[o.LOWER_Z=122]="LOWER_Z",o[o.UPPER_A=65]="UPPER_A",o[o.UPPER_F=70]="UPPER_F",o[o.UPPER_Z=90]="UPPER_Z"})(ze||(ze={}));var Cu=32;function _a(o){return o>=ze.ZERO&&o<=ze.NINE}function GS(o){return o>=ze.UPPER_A&&o<=ze.UPPER_F||o>=ze.LOWER_A&&o<=ze.LOWER_F}function KS(o){return o>=ze.UPPER_A&&o<=ze.UPPER_Z||o>=ze.LOWER_A&&o<=ze.LOWER_Z||_a(o)}function qS(o){return o===ze.EQUALS||KS(o)}var we;(function(o){o[o.EntityStart=0]="EntityStart",o[o.NumericStart=1]="NumericStart",o[o.NumericDecimal=2]="NumericDecimal",o[o.NumericHex=3]="NumericHex",o[o.NamedEntity=4]="NamedEntity"})(we||(we={}));var ft;(function(o){o[o.Legacy=0]="Legacy",o[o.Strict=1]="Strict",o[o.Attribute=2]="Attribute"})(ft||(ft={}));var bs=class{decodeTree;emitCodePoint;errors;constructor(e,t,r){this.decodeTree=e,this.emitCodePoint=t,this.errors=r}state=we.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=ft.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=we.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case we.EntityStart:return e.charCodeAt(t)===ze.NUM?(this.state=we.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=we.NamedEntity,this.stateNamedEntity(e,t));case we.NumericStart:return this.stateNumericStart(e,t);case we.NumericDecimal:return this.stateNumericDecimal(e,t);case we.NumericHex:return this.stateNumericHex(e,t);case we.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Cu)===ze.LOWER_X?(this.state=we.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=we.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t<e.length;){let r=e.charCodeAt(t);if(_a(r)||GS(r)){let s=r<=ze.NINE?r-ze.ZERO:(r|Cu)-ze.LOWER_A+10;this.result=this.result*16+s,this.consumed++,t++}else return this.emitNumericEntity(r,3)}return-1}stateNumericDecimal(e,t){for(;t<e.length;){let r=e.charCodeAt(t);if(_a(r))this.result=this.result*10+(r-ze.ZERO),this.consumed++,t++;else return this.emitNumericEntity(r,2)}return-1}emitNumericEntity(e,t){if(this.consumed<=t)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===ze.SEMI)this.consumed+=1;else if(this.decodeMode===ft.Strict)return 0;return this.emitCodePoint(Tu(this.result),this.consumed),this.errors&&(e!==ze.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:r}=this,s=r[this.treeIndex],a=(s&ke.VALUE_LENGTH)>>14;for(;t<e.length;){if(a===0&&(s&ke.FLAG13)!==0){let u=(s&ke.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let f=s&ke.JUMP_TABLE;if(e.charCodeAt(t)!==f)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed<u;){if(t>=e.length)return-1;let f=this.runConsumed-1,m=r[this.treeIndex+1+(f>>1)],x=f%2===0?m&255:m>>8&255;if(e.charCodeAt(t)!==x)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(u>>1),s=r[this.treeIndex],a=(s&ke.VALUE_LENGTH)>>14}if(t>=e.length)break;let p=e.charCodeAt(t);if(p===ze.SEMI&&a!==0&&(s&ke.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);if(this.treeIndex=YS(r,s,this.treeIndex+Math.max(1,a),p),this.treeIndex<0)return this.result===0||this.decodeMode===ft.Attribute&&(a===0||qS(p))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&ke.VALUE_LENGTH)>>14,a!==0){if(p===ze.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==ft.Strict&&(s&ke.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){let{result:e,decodeTree:t}=this,r=(t[e]&ke.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,r,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,r){let{decodeTree:s}=this;return this.emitCodePoint(t===1?s[e]&~(ke.VALUE_LENGTH|ke.FLAG13):s[e+1],r),t===3&&this.emitCodePoint(s[e+2],r),r}end(){switch(this.state){case we.NamedEntity:return this.result!==0&&(this.decodeMode!==ft.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case we.NumericDecimal:return this.emitNumericEntity(0,2);case we.NumericHex:return this.emitNumericEntity(0,3);case we.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case we.EntityStart:return 0}}};function YS(o,e,t,r){let s=(e&ke.BRANCH_LENGTH)>>7,a=e&ke.JUMP_TABLE;if(s===0)return a!==0&&r===a?t:-1;if(a){let m=r-a;return m<0||m>=s?-1:o[t+m]-1}let p=s+1>>1,u=0,f=s-1;for(;u<=f;){let m=u+f>>>1,x=m>>1,z=o[t+x]>>(m&1)*8&255;if(z<r)u=m+1;else if(z>r)f=m-1;else return o[t+p+m]}return-1}var _;(function(o){o.HTML="http://www.w3.org/1999/xhtml",o.MATHML="http://www.w3.org/1998/Math/MathML",o.SVG="http://www.w3.org/2000/svg",o.XLINK="http://www.w3.org/1999/xlink",o.XML="http://www.w3.org/XML/1998/namespace",o.XMLNS="http://www.w3.org/2000/xmlns/"})(_||(_={}));var Et;(function(o){o.TYPE="type",o.ACTION="action",o.ENCODING="encoding",o.PROMPT="prompt",o.NAME="name",o.COLOR="color",o.FACE="face",o.SIZE="size"})(Et||(Et={}));var _e;(function(o){o.NO_QUIRKS="no-quirks",o.QUIRKS="quirks",o.LIMITED_QUIRKS="limited-quirks"})(_e||(_e={}));var M;(function(o){o.A="a",o.ADDRESS="address",o.ANNOTATION_XML="annotation-xml",o.APPLET="applet",o.AREA="area",o.ARTICLE="article",o.ASIDE="aside",o.B="b",o.BASE="base",o.BASEFONT="basefont",o.BGSOUND="bgsound",o.BIG="big",o.BLOCKQUOTE="blockquote",o.BODY="body",o.BR="br",o.BUTTON="button",o.CAPTION="caption",o.CENTER="center",o.CODE="code",o.COL="col",o.COLGROUP="colgroup",o.DD="dd",o.DESC="desc",o.DETAILS="details",o.DIALOG="dialog",o.DIR="dir",o.DIV="div",o.DL="dl",o.DT="dt",o.EM="em",o.EMBED="embed",o.FIELDSET="fieldset",o.FIGCAPTION="figcaption",o.FIGURE="figure",o.FONT="font",o.FOOTER="footer",o.FOREIGN_OBJECT="foreignObject",o.FORM="form",o.FRAME="frame",o.FRAMESET="frameset",o.H1="h1",o.H2="h2",o.H3="h3",o.H4="h4",o.H5="h5",o.H6="h6",o.HEAD="head",o.HEADER="header",o.HGROUP="hgroup",o.HR="hr",o.HTML="html",o.I="i",o.IMG="img",o.IMAGE="image",o.INPUT="input",o.IFRAME="iframe",o.KEYGEN="keygen",o.LABEL="label",o.LI="li",o.LINK="link",o.LISTING="listing",o.MAIN="main",o.MALIGNMARK="malignmark",o.MARQUEE="marquee",o.MATH="math",o.MENU="menu",o.META="meta",o.MGLYPH="mglyph",o.MI="mi",o.MO="mo",o.MN="mn",o.MS="ms",o.MTEXT="mtext",o.NAV="nav",o.NOBR="nobr",o.NOFRAMES="noframes",o.NOEMBED="noembed",o.NOSCRIPT="noscript",o.OBJECT="object",o.OL="ol",o.OPTGROUP="optgroup",o.OPTION="option",o.P="p",o.PARAM="param",o.PLAINTEXT="plaintext",o.PRE="pre",o.RB="rb",o.RP="rp",o.RT="rt",o.RTC="rtc",o.RUBY="ruby",o.S="s",o.SCRIPT="script",o.SEARCH="search",o.SECTION="section",o.SELECT="select",o.SOURCE="source",o.SMALL="small",o.SPAN="span",o.STRIKE="strike",o.STRONG="strong",o.STYLE="style",o.SUB="sub",o.SUMMARY="summary",o.SUP="sup",o.TABLE="table",o.TBODY="tbody",o.TEMPLATE="template",o.TEXTAREA="textarea",o.TFOOT="tfoot",o.TD="td",o.TH="th",o.THEAD="thead",o.TITLE="title",o.TR="tr",o.TRACK="track",o.TT="tt",o.U="u",o.UL="ul",o.SVG="svg",o.VAR="var",o.WBR="wbr",o.XMP="xmp"})(M||(M={}));var l;(function(o){o[o.UNKNOWN=0]="UNKNOWN",o[o.A=1]="A",o[o.ADDRESS=2]="ADDRESS",o[o.ANNOTATION_XML=3]="ANNOTATION_XML",o[o.APPLET=4]="APPLET",o[o.AREA=5]="AREA",o[o.ARTICLE=6]="ARTICLE",o[o.ASIDE=7]="ASIDE",o[o.B=8]="B",o[o.BASE=9]="BASE",o[o.BASEFONT=10]="BASEFONT",o[o.BGSOUND=11]="BGSOUND",o[o.BIG=12]="BIG",o[o.BLOCKQUOTE=13]="BLOCKQUOTE",o[o.BODY=14]="BODY",o[o.BR=15]="BR",o[o.BUTTON=16]="BUTTON",o[o.CAPTION=17]="CAPTION",o[o.CENTER=18]="CENTER",o[o.CODE=19]="CODE",o[o.COL=20]="COL",o[o.COLGROUP=21]="COLGROUP",o[o.DD=22]="DD",o[o.DESC=23]="DESC",o[o.DETAILS=24]="DETAILS",o[o.DIALOG=25]="DIALOG",o[o.DIR=26]="DIR",o[o.DIV=27]="DIV",o[o.DL=28]="DL",o[o.DT=29]="DT",o[o.EM=30]="EM",o[o.EMBED=31]="EMBED",o[o.FIELDSET=32]="FIELDSET",o[o.FIGCAPTION=33]="FIGCAPTION",o[o.FIGURE=34]="FIGURE",o[o.FONT=35]="FONT",o[o.FOOTER=36]="FOOTER",o[o.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",o[o.FORM=38]="FORM",o[o.FRAME=39]="FRAME",o[o.FRAMESET=40]="FRAMESET",o[o.H1=41]="H1",o[o.H2=42]="H2",o[o.H3=43]="H3",o[o.H4=44]="H4",o[o.H5=45]="H5",o[o.H6=46]="H6",o[o.HEAD=47]="HEAD",o[o.HEADER=48]="HEADER",o[o.HGROUP=49]="HGROUP",o[o.HR=50]="HR",o[o.HTML=51]="HTML",o[o.I=52]="I",o[o.IMG=53]="IMG",o[o.IMAGE=54]="IMAGE",o[o.INPUT=55]="INPUT",o[o.IFRAME=56]="IFRAME",o[o.KEYGEN=57]="KEYGEN",o[o.LABEL=58]="LABEL",o[o.LI=59]="LI",o[o.LINK=60]="LINK",o[o.LISTING=61]="LISTING",o[o.MAIN=62]="MAIN",o[o.MALIGNMARK=63]="MALIGNMARK",o[o.MARQUEE=64]="MARQUEE",o[o.MATH=65]="MATH",o[o.MENU=66]="MENU",o[o.META=67]="META",o[o.MGLYPH=68]="MGLYPH",o[o.MI=69]="MI",o[o.MO=70]="MO",o[o.MN=71]="MN",o[o.MS=72]="MS",o[o.MTEXT=73]="MTEXT",o[o.NAV=74]="NAV",o[o.NOBR=75]="NOBR",o[o.NOFRAMES=76]="NOFRAMES",o[o.NOEMBED=77]="NOEMBED",o[o.NOSCRIPT=78]="NOSCRIPT",o[o.OBJECT=79]="OBJECT",o[o.OL=80]="OL",o[o.OPTGROUP=81]="OPTGROUP",o[o.OPTION=82]="OPTION",o[o.P=83]="P",o[o.PARAM=84]="PARAM",o[o.PLAINTEXT=85]="PLAINTEXT",o[o.PRE=86]="PRE",o[o.RB=87]="RB",o[o.RP=88]="RP",o[o.RT=89]="RT",o[o.RTC=90]="RTC",o[o.RUBY=91]="RUBY",o[o.S=92]="S",o[o.SCRIPT=93]="SCRIPT",o[o.SEARCH=94]="SEARCH",o[o.SECTION=95]="SECTION",o[o.SELECT=96]="SELECT",o[o.SOURCE=97]="SOURCE",o[o.SMALL=98]="SMALL",o[o.SPAN=99]="SPAN",o[o.STRIKE=100]="STRIKE",o[o.STRONG=101]="STRONG",o[o.STYLE=102]="STYLE",o[o.SUB=103]="SUB",o[o.SUMMARY=104]="SUMMARY",o[o.SUP=105]="SUP",o[o.TABLE=106]="TABLE",o[o.TBODY=107]="TBODY",o[o.TEMPLATE=108]="TEMPLATE",o[o.TEXTAREA=109]="TEXTAREA",o[o.TFOOT=110]="TFOOT",o[o.TD=111]="TD",o[o.TH=112]="TH",o[o.THEAD=113]="THEAD",o[o.TITLE=114]="TITLE",o[o.TR=115]="TR",o[o.TRACK=116]="TRACK",o[o.TT=117]="TT",o[o.U=118]="U",o[o.UL=119]="UL",o[o.SVG=120]="SVG",o[o.VAR=121]="VAR",o[o.WBR=122]="WBR",o[o.XMP=123]="XMP"})(l||(l={}));var QS=new Map([[M.A,l.A],[M.ADDRESS,l.ADDRESS],[M.ANNOTATION_XML,l.ANNOTATION_XML],[M.APPLET,l.APPLET],[M.AREA,l.AREA],[M.ARTICLE,l.ARTICLE],[M.ASIDE,l.ASIDE],[M.B,l.B],[M.BASE,l.BASE],[M.BASEFONT,l.BASEFONT],[M.BGSOUND,l.BGSOUND],[M.BIG,l.BIG],[M.BLOCKQUOTE,l.BLOCKQUOTE],[M.BODY,l.BODY],[M.BR,l.BR],[M.BUTTON,l.BUTTON],[M.CAPTION,l.CAPTION],[M.CENTER,l.CENTER],[M.CODE,l.CODE],[M.COL,l.COL],[M.COLGROUP,l.COLGROUP],[M.DD,l.DD],[M.DESC,l.DESC],[M.DETAILS,l.DETAILS],[M.DIALOG,l.DIALOG],[M.DIR,l.DIR],[M.DIV,l.DIV],[M.DL,l.DL],[M.DT,l.DT],[M.EM,l.EM],[M.EMBED,l.EMBED],[M.FIELDSET,l.FIELDSET],[M.FIGCAPTION,l.FIGCAPTION],[M.FIGURE,l.FIGURE],[M.FONT,l.FONT],[M.FOOTER,l.FOOTER],[M.FOREIGN_OBJECT,l.FOREIGN_OBJECT],[M.FORM,l.FORM],[M.FRAME,l.FRAME],[M.FRAMESET,l.FRAMESET],[M.H1,l.H1],[M.H2,l.H2],[M.H3,l.H3],[M.H4,l.H4],[M.H5,l.H5],[M.H6,l.H6],[M.HEAD,l.HEAD],[M.HEADER,l.HEADER],[M.HGROUP,l.HGROUP],[M.HR,l.HR],[M.HTML,l.HTML],[M.I,l.I],[M.IMG,l.IMG],[M.IMAGE,l.IMAGE],[M.INPUT,l.INPUT],[M.IFRAME,l.IFRAME],[M.KEYGEN,l.KEYGEN],[M.LABEL,l.LABEL],[M.LI,l.LI],[M.LINK,l.LINK],[M.LISTING,l.LISTING],[M.MAIN,l.MAIN],[M.MALIGNMARK,l.MALIGNMARK],[M.MARQUEE,l.MARQUEE],[M.MATH,l.MATH],[M.MENU,l.MENU],[M.META,l.META],[M.MGLYPH,l.MGLYPH],[M.MI,l.MI],[M.MO,l.MO],[M.MN,l.MN],[M.MS,l.MS],[M.MTEXT,l.MTEXT],[M.NAV,l.NAV],[M.NOBR,l.NOBR],[M.NOFRAMES,l.NOFRAMES],[M.NOEMBED,l.NOEMBED],[M.NOSCRIPT,l.NOSCRIPT],[M.OBJECT,l.OBJECT],[M.OL,l.OL],[M.OPTGROUP,l.OPTGROUP],[M.OPTION,l.OPTION],[M.P,l.P],[M.PARAM,l.PARAM],[M.PLAINTEXT,l.PLAINTEXT],[M.PRE,l.PRE],[M.RB,l.RB],[M.RP,l.RP],[M.RT,l.RT],[M.RTC,l.RTC],[M.RUBY,l.RUBY],[M.S,l.S],[M.SCRIPT,l.SCRIPT],[M.SEARCH,l.SEARCH],[M.SECTION,l.SECTION],[M.SELECT,l.SELECT],[M.SOURCE,l.SOURCE],[M.SMALL,l.SMALL],[M.SPAN,l.SPAN],[M.STRIKE,l.STRIKE],[M.STRONG,l.STRONG],[M.STYLE,l.STYLE],[M.SUB,l.SUB],[M.SUMMARY,l.SUMMARY],[M.SUP,l.SUP],[M.TABLE,l.TABLE],[M.TBODY,l.TBODY],[M.TEMPLATE,l.TEMPLATE],[M.TEXTAREA,l.TEXTAREA],[M.TFOOT,l.TFOOT],[M.TD,l.TD],[M.TH,l.TH],[M.THEAD,l.THEAD],[M.TITLE,l.TITLE],[M.TR,l.TR],[M.TRACK,l.TRACK],[M.TT,l.TT],[M.U,l.U],[M.UL,l.UL],[M.SVG,l.SVG],[M.VAR,l.VAR],[M.WBR,l.WBR],[M.XMP,l.XMP]]);function Ht(o){var e;return(e=QS.get(o))!==null&&e!==void 0?e:l.UNKNOWN}var j=l,Iu={[_.HTML]:new Set([j.ADDRESS,j.APPLET,j.AREA,j.ARTICLE,j.ASIDE,j.BASE,j.BASEFONT,j.BGSOUND,j.BLOCKQUOTE,j.BODY,j.BR,j.BUTTON,j.CAPTION,j.CENTER,j.COL,j.COLGROUP,j.DD,j.DETAILS,j.DIR,j.DIV,j.DL,j.DT,j.EMBED,j.FIELDSET,j.FIGCAPTION,j.FIGURE,j.FOOTER,j.FORM,j.FRAME,j.FRAMESET,j.H1,j.H2,j.H3,j.H4,j.H5,j.H6,j.HEAD,j.HEADER,j.HGROUP,j.HR,j.HTML,j.IFRAME,j.IMG,j.INPUT,j.LI,j.LINK,j.LISTING,j.MAIN,j.MARQUEE,j.MENU,j.META,j.NAV,j.NOEMBED,j.NOFRAMES,j.NOSCRIPT,j.OBJECT,j.OL,j.P,j.PARAM,j.PLAINTEXT,j.PRE,j.SCRIPT,j.SECTION,j.SELECT,j.SOURCE,j.STYLE,j.SUMMARY,j.TABLE,j.TBODY,j.TD,j.TEMPLATE,j.TEXTAREA,j.TFOOT,j.TH,j.THEAD,j.TITLE,j.TR,j.TRACK,j.UL,j.WBR,j.XMP]),[_.MATHML]:new Set([j.MI,j.MO,j.MN,j.MS,j.MTEXT,j.ANNOTATION_XML]),[_.SVG]:new Set([j.TITLE,j.FOREIGN_OBJECT,j.DESC]),[_.XLINK]:new Set,[_.XML]:new Set,[_.XMLNS]:new Set},Uo=new Set([j.H1,j.H2,j.H3,j.H4,j.H5,j.H6]),gxe=new Set([M.STYLE,M.SCRIPT,M.XMP,M.IFRAME,M.NOEMBED,M.NOFRAMES,M.PLAINTEXT]);var T;(function(o){o[o.DATA=0]="DATA",o[o.RCDATA=1]="RCDATA",o[o.RAWTEXT=2]="RAWTEXT",o[o.SCRIPT_DATA=3]="SCRIPT_DATA",o[o.PLAINTEXT=4]="PLAINTEXT",o[o.TAG_OPEN=5]="TAG_OPEN",o[o.END_TAG_OPEN=6]="END_TAG_OPEN",o[o.TAG_NAME=7]="TAG_NAME",o[o.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",o[o.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",o[o.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",o[o.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",o[o.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",o[o.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",o[o.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",o[o.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",o[o.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",o[o.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",o[o.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",o[o.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",o[o.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",o[o.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",o[o.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",o[o.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",o[o.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",o[o.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",o[o.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",o[o.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",o[o.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",o[o.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",o[o.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",o[o.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",o[o.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",o[o.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",o[o.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",o[o.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",o[o.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",o[o.BOGUS_COMMENT=40]="BOGUS_COMMENT",o[o.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",o[o.COMMENT_START=42]="COMMENT_START",o[o.COMMENT_START_DASH=43]="COMMENT_START_DASH",o[o.COMMENT=44]="COMMENT",o[o.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",o[o.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",o[o.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",o[o.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",o[o.COMMENT_END_DASH=49]="COMMENT_END_DASH",o[o.COMMENT_END=50]="COMMENT_END",o[o.COMMENT_END_BANG=51]="COMMENT_END_BANG",o[o.DOCTYPE=52]="DOCTYPE",o[o.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",o[o.DOCTYPE_NAME=54]="DOCTYPE_NAME",o[o.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",o[o.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",o[o.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",o[o.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",o[o.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",o[o.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",o[o.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",o[o.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",o[o.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",o[o.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",o[o.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",o[o.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",o[o.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",o[o.CDATA_SECTION=68]="CDATA_SECTION",o[o.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",o[o.CDATA_SECTION_END=70]="CDATA_SECTION_END",o[o.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",o[o.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(T||(T={}));var Pe={DATA:T.DATA,RCDATA:T.RCDATA,RAWTEXT:T.RAWTEXT,SCRIPT_DATA:T.SCRIPT_DATA,PLAINTEXT:T.PLAINTEXT,CDATA_SECTION:T.CDATA_SECTION};function ZS(o){return o>=S.DIGIT_0&&o<=S.DIGIT_9}function Ho(o){return o>=S.LATIN_CAPITAL_A&&o<=S.LATIN_CAPITAL_Z}function XS(o){return o>=S.LATIN_SMALL_A&&o<=S.LATIN_SMALL_Z}function Lt(o){return XS(o)||Ho(o)}function Ru(o){return Lt(o)||ZS(o)}function ys(o){return o+32}function Ou(o){return o===S.SPACE||o===S.LINE_FEED||o===S.TABULATION||o===S.FORM_FEED}function wu(o){return Ou(o)||o===S.SOLIDUS||o===S.GREATER_THAN_SIGN}function e0(o){return o===S.NULL?D.nullCharacterReference:o>1114111?D.characterReferenceOutsideUnicodeRange:ms(o)?D.surrogateCharacterReference:fs(o)?D.noncharacterCharacterReference:hs(o)||o===S.CARRIAGE_RETURN?D.controlCharacterReference:null}var Wo=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=T.DATA,this.returnState=T.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new xs(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new bs(Na,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(D.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(D.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{let s=e0(r);s&&this._err(s,1)}}:void 0)}_err(e,t=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,r){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:ie.START_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:ie.END_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:ie.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:ie.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,t;let r=this.currentToken;if(gs(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){let s=(e=(t=r.location).attrs)!==null&&e!==void 0?e:t.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(D.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=Ht(e.tagName),e.type===ie.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(D.endTagWithAttributes),e.selfClosing&&this._err(D.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case ie.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ie.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ie.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:ie.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){let t=Ou(e)?ie.WHITESPACE_CHARACTER:e===S.NULL?ie.NULL_CHARACTER:ie.CHARACTER;this._appendCharToCurrentCharacterToken(t,e<65536?String.fromCharCode(e):String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(ie.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=T.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ft.Attribute:ft.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===T.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===T.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===T.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case T.DATA:{this._stateData(e);break}case T.RCDATA:{this._stateRcdata(e);break}case T.RAWTEXT:{this._stateRawtext(e);break}case T.SCRIPT_DATA:{this._stateScriptData(e);break}case T.PLAINTEXT:{this._statePlaintext(e);break}case T.TAG_OPEN:{this._stateTagOpen(e);break}case T.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case T.TAG_NAME:{this._stateTagName(e);break}case T.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case T.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case T.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case T.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case T.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case T.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case T.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case T.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case T.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case T.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case T.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case T.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case T.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case T.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case T.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case T.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case T.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case T.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case T.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case T.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case T.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case T.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case T.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case T.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case T.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case T.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case T.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case T.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case T.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case T.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case T.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case T.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case T.BOGUS_COMMENT:{this._stateBogusComment(e);break}case T.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case T.COMMENT_START:{this._stateCommentStart(e);break}case T.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case T.COMMENT:{this._stateComment(e);break}case T.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case T.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case T.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case T.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case T.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case T.COMMENT_END:{this._stateCommentEnd(e);break}case T.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case T.DOCTYPE:{this._stateDoctype(e);break}case T.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case T.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case T.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case T.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case T.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case T.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case T.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case T.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case T.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case T.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case T.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case T.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case T.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case T.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case T.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case T.CDATA_SECTION:{this._stateCdataSection(e);break}case T.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case T.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case T.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case T.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case S.LESS_THAN_SIGN:{this.state=T.TAG_OPEN;break}case S.AMPERSAND:{this._startCharacterReference();break}case S.NULL:{this._err(D.unexpectedNullCharacter),this._emitCodePoint(e);break}case S.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case S.AMPERSAND:{this._startCharacterReference();break}case S.LESS_THAN_SIGN:{this.state=T.RCDATA_LESS_THAN_SIGN;break}case S.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(he);break}case S.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case S.LESS_THAN_SIGN:{this.state=T.RAWTEXT_LESS_THAN_SIGN;break}case S.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(he);break}case S.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case S.LESS_THAN_SIGN:{this.state=T.SCRIPT_DATA_LESS_THAN_SIGN;break}case S.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(he);break}case S.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case S.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(he);break}case S.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Lt(e))this._createStartTagToken(),this.state=T.TAG_NAME,this._stateTagName(e);else switch(e){case S.EXCLAMATION_MARK:{this.state=T.MARKUP_DECLARATION_OPEN;break}case S.SOLIDUS:{this.state=T.END_TAG_OPEN;break}case S.QUESTION_MARK:{this._err(D.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=T.BOGUS_COMMENT,this._stateBogusComment(e);break}case S.EOF:{this._err(D.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(D.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=T.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Lt(e))this._createEndTagToken(),this.state=T.TAG_NAME,this._stateTagName(e);else switch(e){case S.GREATER_THAN_SIGN:{this._err(D.missingEndTagName),this.state=T.DATA;break}case S.EOF:{this._err(D.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(D.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=T.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this.state=T.BEFORE_ATTRIBUTE_NAME;break}case S.SOLIDUS:{this.state=T.SELF_CLOSING_START_TAG;break}case S.GREATER_THAN_SIGN:{this.state=T.DATA,this.emitCurrentTagToken();break}case S.NULL:{this._err(D.unexpectedNullCharacter),t.tagName+=he;break}case S.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:t.tagName+=String.fromCodePoint(Ho(e)?ys(e):e)}}_stateRcdataLessThanSign(e){e===S.SOLIDUS?this.state=T.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=T.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Lt(e)?(this.state=T.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=T.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=T.BEFORE_ATTRIBUTE_NAME,!1;case S.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=T.SELF_CLOSING_START_TAG,!1;case S.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=T.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=T.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===S.SOLIDUS?this.state=T.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=T.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Lt(e)?(this.state=T.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=T.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=T.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case S.SOLIDUS:{this.state=T.SCRIPT_DATA_END_TAG_OPEN;break}case S.EXCLAMATION_MARK:{this.state=T.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=T.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Lt(e)?(this.state=T.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=T.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=T.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===S.HYPHEN_MINUS?(this.state=T.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=T.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===S.HYPHEN_MINUS?(this.state=T.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=T.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case S.HYPHEN_MINUS:{this.state=T.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case S.LESS_THAN_SIGN:{this.state=T.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case S.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(he);break}case S.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case S.HYPHEN_MINUS:{this.state=T.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case S.LESS_THAN_SIGN:{this.state=T.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case S.NULL:{this._err(D.unexpectedNullCharacter),this.state=T.SCRIPT_DATA_ESCAPED,this._emitChars(he);break}case S.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=T.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case S.HYPHEN_MINUS:{this._emitChars("-");break}case S.LESS_THAN_SIGN:{this.state=T.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case S.GREATER_THAN_SIGN:{this.state=T.SCRIPT_DATA,this._emitChars(">");break}case S.NULL:{this._err(D.unexpectedNullCharacter),this.state=T.SCRIPT_DATA_ESCAPED,this._emitChars(he);break}case S.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=T.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===S.SOLIDUS?this.state=T.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Lt(e)?(this._emitChars("<"),this.state=T.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=T.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Lt(e)?(this.state=T.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=T.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=T.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Ne.SCRIPT,!1)&&wu(this.preprocessor.peek(Ne.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t<Ne.SCRIPT.length;t++)this._emitCodePoint(this._consume());this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=T.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case S.HYPHEN_MINUS:{this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case S.LESS_THAN_SIGN:{this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case S.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(he);break}case S.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case S.HYPHEN_MINUS:{this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case S.LESS_THAN_SIGN:{this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case S.NULL:{this._err(D.unexpectedNullCharacter),this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(he);break}case S.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case S.HYPHEN_MINUS:{this._emitChars("-");break}case S.LESS_THAN_SIGN:{this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case S.GREATER_THAN_SIGN:{this.state=T.SCRIPT_DATA,this._emitChars(">");break}case S.NULL:{this._err(D.unexpectedNullCharacter),this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(he);break}case S.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===S.SOLIDUS?(this.state=T.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Ne.SCRIPT,!1)&&wu(this.preprocessor.peek(Ne.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t<Ne.SCRIPT.length;t++)this._emitCodePoint(this._consume());this.state=T.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=T.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.SOLIDUS:case S.GREATER_THAN_SIGN:case S.EOF:{this.state=T.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case S.EQUALS_SIGN:{this._err(D.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=T.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=T.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:case S.SOLIDUS:case S.GREATER_THAN_SIGN:case S.EOF:{this._leaveAttrName(),this.state=T.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case S.EQUALS_SIGN:{this._leaveAttrName(),this.state=T.BEFORE_ATTRIBUTE_VALUE;break}case S.QUOTATION_MARK:case S.APOSTROPHE:case S.LESS_THAN_SIGN:{this._err(D.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case S.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.name+=he;break}default:this.currentAttr.name+=String.fromCodePoint(Ho(e)?ys(e):e)}}_stateAfterAttributeName(e){switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.SOLIDUS:{this.state=T.SELF_CLOSING_START_TAG;break}case S.EQUALS_SIGN:{this.state=T.BEFORE_ATTRIBUTE_VALUE;break}case S.GREATER_THAN_SIGN:{this.state=T.DATA,this.emitCurrentTagToken();break}case S.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=T.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.QUOTATION_MARK:{this.state=T.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case S.APOSTROPHE:{this.state=T.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case S.GREATER_THAN_SIGN:{this._err(D.missingAttributeValue),this.state=T.DATA,this.emitCurrentTagToken();break}default:this.state=T.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case S.QUOTATION_MARK:{this.state=T.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case S.AMPERSAND:{this._startCharacterReference();break}case S.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=he;break}case S.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case S.APOSTROPHE:{this.state=T.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case S.AMPERSAND:{this._startCharacterReference();break}case S.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=he;break}case S.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this._leaveAttrValue(),this.state=T.BEFORE_ATTRIBUTE_NAME;break}case S.AMPERSAND:{this._startCharacterReference();break}case S.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=T.DATA,this.emitCurrentTagToken();break}case S.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=he;break}case S.QUOTATION_MARK:case S.APOSTROPHE:case S.LESS_THAN_SIGN:case S.EQUALS_SIGN:case S.GRAVE_ACCENT:{this._err(D.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case S.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this._leaveAttrValue(),this.state=T.BEFORE_ATTRIBUTE_NAME;break}case S.SOLIDUS:{this._leaveAttrValue(),this.state=T.SELF_CLOSING_START_TAG;break}case S.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=T.DATA,this.emitCurrentTagToken();break}case S.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._err(D.missingWhitespaceBetweenAttributes),this.state=T.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case S.GREATER_THAN_SIGN:{let t=this.currentToken;t.selfClosing=!0,this.state=T.DATA,this.emitCurrentTagToken();break}case S.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._err(D.unexpectedSolidusInTag),this.state=T.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case S.GREATER_THAN_SIGN:{this.state=T.DATA,this.emitCurrentComment(t);break}case S.EOF:{this.emitCurrentComment(t),this._emitEOFToken();break}case S.NULL:{this._err(D.unexpectedNullCharacter),t.data+=he;break}default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Ne.DASH_DASH,!0)?(this._createCommentToken(Ne.DASH_DASH.length+1),this.state=T.COMMENT_START):this._consumeSequenceIfMatch(Ne.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Ne.DOCTYPE.length+1),this.state=T.DOCTYPE):this._consumeSequenceIfMatch(Ne.CDATA_START,!0)?this.inForeignNode?this.state=T.CDATA_SECTION:(this._err(D.cdataInHtmlContent),this._createCommentToken(Ne.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=T.BOGUS_COMMENT):this._ensureHibernation()||(this._err(D.incorrectlyOpenedComment),this._createCommentToken(2),this.state=T.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case S.HYPHEN_MINUS:{this.state=T.COMMENT_START_DASH;break}case S.GREATER_THAN_SIGN:{this._err(D.abruptClosingOfEmptyComment),this.state=T.DATA;let t=this.currentToken;this.emitCurrentComment(t);break}default:this.state=T.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case S.HYPHEN_MINUS:{this.state=T.COMMENT_END;break}case S.GREATER_THAN_SIGN:{this._err(D.abruptClosingOfEmptyComment),this.state=T.DATA,this.emitCurrentComment(t);break}case S.EOF:{this._err(D.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="-",this.state=T.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case S.HYPHEN_MINUS:{this.state=T.COMMENT_END_DASH;break}case S.LESS_THAN_SIGN:{t.data+="<",this.state=T.COMMENT_LESS_THAN_SIGN;break}case S.NULL:{this._err(D.unexpectedNullCharacter),t.data+=he;break}case S.EOF:{this._err(D.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case S.EXCLAMATION_MARK:{t.data+="!",this.state=T.COMMENT_LESS_THAN_SIGN_BANG;break}case S.LESS_THAN_SIGN:{t.data+="<";break}default:this.state=T.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===S.HYPHEN_MINUS?this.state=T.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=T.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===S.HYPHEN_MINUS?this.state=T.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=T.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==S.GREATER_THAN_SIGN&&e!==S.EOF&&this._err(D.nestedComment),this.state=T.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case S.HYPHEN_MINUS:{this.state=T.COMMENT_END;break}case S.EOF:{this._err(D.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="-",this.state=T.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case S.GREATER_THAN_SIGN:{this.state=T.DATA,this.emitCurrentComment(t);break}case S.EXCLAMATION_MARK:{this.state=T.COMMENT_END_BANG;break}case S.HYPHEN_MINUS:{t.data+="-";break}case S.EOF:{this._err(D.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="--",this.state=T.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case S.HYPHEN_MINUS:{t.data+="--!",this.state=T.COMMENT_END_DASH;break}case S.GREATER_THAN_SIGN:{this._err(D.incorrectlyClosedComment),this.state=T.DATA,this.emitCurrentComment(t);break}case S.EOF:{this._err(D.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="--!",this.state=T.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this.state=T.BEFORE_DOCTYPE_NAME;break}case S.GREATER_THAN_SIGN:{this.state=T.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case S.EOF:{this._err(D.eofInDoctype),this._createDoctypeToken(null);let t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(D.missingWhitespaceBeforeDoctypeName),this.state=T.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(Ho(e))this._createDoctypeToken(String.fromCharCode(ys(e))),this.state=T.DOCTYPE_NAME;else switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.NULL:{this._err(D.unexpectedNullCharacter),this._createDoctypeToken(he),this.state=T.DOCTYPE_NAME;break}case S.GREATER_THAN_SIGN:{this._err(D.missingDoctypeName),this._createDoctypeToken(null);let t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=T.DATA;break}case S.EOF:{this._err(D.eofInDoctype),this._createDoctypeToken(null);let t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=T.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this.state=T.AFTER_DOCTYPE_NAME;break}case S.GREATER_THAN_SIGN:{this.state=T.DATA,this.emitCurrentDoctype(t);break}case S.NULL:{this._err(D.unexpectedNullCharacter),t.name+=he;break}case S.EOF:{this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.name+=String.fromCodePoint(Ho(e)?ys(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.GREATER_THAN_SIGN:{this.state=T.DATA,this.emitCurrentDoctype(t);break}case S.EOF:{this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Ne.PUBLIC,!1)?this.state=T.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Ne.SYSTEM,!1)?this.state=T.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(D.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this.state=T.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case S.QUOTATION_MARK:{this._err(D.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=T.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case S.APOSTROPHE:{this._err(D.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=T.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case S.GREATER_THAN_SIGN:{this._err(D.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=T.DATA,this.emitCurrentDoctype(t);break}case S.EOF:{this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.QUOTATION_MARK:{t.publicId="",this.state=T.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case S.APOSTROPHE:{t.publicId="",this.state=T.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case S.GREATER_THAN_SIGN:{this._err(D.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=T.DATA,this.emitCurrentDoctype(t);break}case S.EOF:{this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case S.QUOTATION_MARK:{this.state=T.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case S.NULL:{this._err(D.unexpectedNullCharacter),t.publicId+=he;break}case S.GREATER_THAN_SIGN:{this._err(D.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=T.DATA;break}case S.EOF:{this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case S.APOSTROPHE:{this.state=T.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case S.NULL:{this._err(D.unexpectedNullCharacter),t.publicId+=he;break}case S.GREATER_THAN_SIGN:{this._err(D.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=T.DATA;break}case S.EOF:{this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this.state=T.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case S.GREATER_THAN_SIGN:{this.state=T.DATA,this.emitCurrentDoctype(t);break}case S.QUOTATION_MARK:{this._err(D.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case S.APOSTROPHE:{this._err(D.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case S.EOF:{this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=T.DATA;break}case S.QUOTATION_MARK:{t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case S.APOSTROPHE:{t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case S.EOF:{this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:{this.state=T.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case S.QUOTATION_MARK:{this._err(D.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case S.APOSTROPHE:{this._err(D.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case S.GREATER_THAN_SIGN:{this._err(D.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=T.DATA,this.emitCurrentDoctype(t);break}case S.EOF:{this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.QUOTATION_MARK:{t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case S.APOSTROPHE:{t.systemId="",this.state=T.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case S.GREATER_THAN_SIGN:{this._err(D.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=T.DATA,this.emitCurrentDoctype(t);break}case S.EOF:{this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case S.QUOTATION_MARK:{this.state=T.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case S.NULL:{this._err(D.unexpectedNullCharacter),t.systemId+=he;break}case S.GREATER_THAN_SIGN:{this._err(D.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=T.DATA;break}case S.EOF:{this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case S.APOSTROPHE:{this.state=T.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case S.NULL:{this._err(D.unexpectedNullCharacter),t.systemId+=he;break}case S.GREATER_THAN_SIGN:{this._err(D.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=T.DATA;break}case S.EOF:{this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case S.SPACE:case S.LINE_FEED:case S.TABULATION:case S.FORM_FEED:break;case S.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=T.DATA;break}case S.EOF:{this._err(D.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(D.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=T.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case S.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=T.DATA;break}case S.NULL:{this._err(D.unexpectedNullCharacter);break}case S.EOF:{this.emitCurrentDoctype(t),this._emitEOFToken();break}default:}}_stateCdataSection(e){switch(e){case S.RIGHT_SQUARE_BRACKET:{this.state=T.CDATA_SECTION_BRACKET;break}case S.EOF:{this._err(D.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===S.RIGHT_SQUARE_BRACKET?this.state=T.CDATA_SECTION_END:(this._emitChars("]"),this.state=T.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case S.GREATER_THAN_SIGN:{this.state=T.DATA;break}case S.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=T.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(S.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Ru(this.preprocessor.peek(1))?T.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){Ru(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===S.SEMICOLON&&this._err(D.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}};var Lu=new Set([l.DD,l.DT,l.LI,l.OPTGROUP,l.OPTION,l.P,l.RB,l.RP,l.RT,l.RTC]),Mu=new Set([...Lu,l.CAPTION,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]),As=new Set([l.APPLET,l.CAPTION,l.HTML,l.MARQUEE,l.OBJECT,l.TABLE,l.TD,l.TEMPLATE,l.TH]),t0=new Set([...As,l.OL,l.UL]),o0=new Set([...As,l.BUTTON]),ku=new Set([l.ANNOTATION_XML,l.MI,l.MN,l.MO,l.MS,l.MTEXT]),Pu=new Set([l.DESC,l.FOREIGN_OBJECT,l.TITLE]),r0=new Set([l.TR,l.TEMPLATE,l.HTML]),s0=new Set([l.TBODY,l.TFOOT,l.THEAD,l.TEMPLATE,l.HTML]),n0=new Set([l.TABLE,l.TEMPLATE,l.HTML]),i0=new Set([l.TD,l.TH]),Ss=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,r){this.treeAdapter=t,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=l.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===l.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===_.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let r=this._indexOf(e);this.items[r]=t,r===this.stackTop&&(this.current=t)}insertAfter(e,t,r){let s=this._indexOf(e)+1;this.items.splice(s,0,t),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==_.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let r=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Uo,_.HTML)}popUntilTableCellPopped(){this.popUntilPopped(i0,_.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let r=this.stackTop;r>=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===t)return r;return-1}clearBackTo(e,t){let r=this._indexOfTagNames(e,t);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(n0,_.HTML)}clearBackToTableBodyContext(){this.clearBackTo(s0,_.HTML)}clearBackToTableRowContext(){this.clearBackTo(r0,_.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===l.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===l.HTML}hasInDynamicScope(e,t){for(let r=this.stackTop;r>=0;r--){let s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case _.HTML:{if(s===e)return!0;if(t.has(s))return!1;break}case _.SVG:{if(Pu.has(s))return!1;break}case _.MATHML:{if(ku.has(s))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,As)}hasInListItemScope(e){return this.hasInDynamicScope(e,t0)}hasInButtonScope(e){return this.hasInDynamicScope(e,o0)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case _.HTML:{if(Uo.has(t))return!0;if(As.has(t))return!1;break}case _.SVG:{if(Pu.has(t))return!1;break}case _.MATHML:{if(ku.has(t))return!1;break}}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===_.HTML)switch(this.tagIDs[t]){case e:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===_.HTML)switch(this.tagIDs[e]){case l.TBODY:case l.THEAD:case l.TFOOT:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===_.HTML)switch(this.tagIDs[t]){case e:return!0;case l.OPTION:case l.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Lu.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Mu.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Mu.has(this.currentTagId);)this.pop()}};var st;(function(o){o[o.Marker=0]="Marker",o[o.Element=1]="Element"})(st||(st={}));var Du={type:st.Marker},zs=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let r=[],s=t.length,a=this.treeAdapter.getTagName(e),p=this.treeAdapter.getNamespaceURI(e);for(let u=0;u<this.entries.length;u++){let f=this.entries[u];if(f.type===st.Marker)break;let{element:m}=f;if(this.treeAdapter.getTagName(m)===a&&this.treeAdapter.getNamespaceURI(m)===p){let x=this.treeAdapter.getAttrList(m);x.length===s&&r.push({idx:u,attrs:x})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<3)return;let t=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,t);if(r.length<3)return;let s=new Map(t.map(p=>[p.name,p.value])),a=0;for(let p=0;p<r.length;p++){let u=r[p];u.attrs.every(f=>s.get(f.name)===f.value)&&(a+=1,a>=3&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(Du)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:st.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:st.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(Du);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(r=>r.type===st.Marker||this.treeAdapter.getTagName(r.element)===e);return t&&t.type===st.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===st.Element&&t.element===e)}};var nt={createDocument(){return{nodeName:"#document",mode:_e.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(o,e,t){return{nodeName:o,tagName:o,attrs:t,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(o){return{nodeName:"#comment",data:o,parentNode:null}},createTextNode(o){return{nodeName:"#text",value:o,parentNode:null}},appendChild(o,e){o.childNodes.push(e),e.parentNode=o},insertBefore(o,e,t){let r=o.childNodes.indexOf(t);o.childNodes.splice(r,0,e),e.parentNode=o},setTemplateContent(o,e){o.content=e},getTemplateContent(o){return o.content},setDocumentType(o,e,t,r){let s=o.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=e,s.publicId=t,s.systemId=r;else{let a={nodeName:"#documentType",name:e,publicId:t,systemId:r,parentNode:null};nt.appendChild(o,a)}},setDocumentMode(o,e){o.mode=e},getDocumentMode(o){return o.mode},detachNode(o){if(o.parentNode){let e=o.parentNode.childNodes.indexOf(o);o.parentNode.childNodes.splice(e,1),o.parentNode=null}},insertText(o,e){if(o.childNodes.length>0){let t=o.childNodes[o.childNodes.length-1];if(nt.isTextNode(t)){t.value+=e;return}}nt.appendChild(o,nt.createTextNode(e))},insertTextBefore(o,e,t){let r=o.childNodes[o.childNodes.indexOf(t)-1];r&&nt.isTextNode(r)?r.value+=e:nt.insertBefore(o,nt.createTextNode(e),t)},adoptAttributes(o,e){let t=new Set(o.attrs.map(r=>r.name));for(let r=0;r<e.length;r++)t.has(e[r].name)||o.attrs.push(e[r])},getFirstChild(o){return o.childNodes[0]},getChildNodes(o){return o.childNodes},getParentNode(o){return o.parentNode},getAttrList(o){return o.attrs},getTagName(o){return o.tagName},getNamespaceURI(o){return o.namespaceURI},getTextNodeContent(o){return o.value},getCommentNodeContent(o){return o.data},getDocumentTypeNodeName(o){return o.name},getDocumentTypeNodePublicId(o){return o.publicId},getDocumentTypeNodeSystemId(o){return o.systemId},isTextNode(o){return o.nodeName==="#text"},isCommentNode(o){return o.nodeName==="#comment"},isDocumentTypeNode(o){return o.nodeName==="#documentType"},isElementNode(o){return Object.prototype.hasOwnProperty.call(o,"tagName")},setNodeSourceCodeLocation(o,e){o.sourceCodeLocation=e},getNodeSourceCodeLocation(o){return o.sourceCodeLocation},updateNodeSourceCodeLocation(o,e){o.sourceCodeLocation={...o.sourceCodeLocation,...e}}};var Fu="html",a0="about:legacy-compat",c0="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Nu=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],p0=[...Nu,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],d0=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),_u=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],l0=[..._u,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function vu(o,e){return e.some(t=>o.startsWith(t))}function Bu(o){return o.name===Fu&&o.publicId===null&&(o.systemId===null||o.systemId===a0)}function ju(o){if(o.name!==Fu)return _e.QUIRKS;let{systemId:e}=o;if(e&&e.toLowerCase()===c0)return _e.QUIRKS;let{publicId:t}=o;if(t!==null){if(t=t.toLowerCase(),d0.has(t))return _e.QUIRKS;let r=e===null?p0:Nu;if(vu(t,r))return _e.QUIRKS;if(r=e===null?_u:l0,vu(t,r))return _e.LIMITED_QUIRKS}return _e.NO_QUIRKS}var Vu={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},m0="definitionurl",h0="definitionURL",f0=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(o=>[o.toLowerCase(),o])),x0=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:_.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:_.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:_.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:_.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:_.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:_.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:_.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:_.XML}],["xml:space",{prefix:"xml",name:"space",namespace:_.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:_.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:_.XMLNS}]]),g0=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(o=>[o.toLowerCase(),o])),b0=new Set([l.B,l.BIG,l.BLOCKQUOTE,l.BODY,l.BR,l.CENTER,l.CODE,l.DD,l.DIV,l.DL,l.DT,l.EM,l.EMBED,l.H1,l.H2,l.H3,l.H4,l.H5,l.H6,l.HEAD,l.HR,l.I,l.IMG,l.LI,l.LISTING,l.MENU,l.META,l.NOBR,l.OL,l.P,l.PRE,l.RUBY,l.S,l.SMALL,l.SPAN,l.STRONG,l.STRIKE,l.SUB,l.SUP,l.TABLE,l.TT,l.U,l.UL,l.VAR]);function Uu(o){let e=o.tagID;return e===l.FONT&&o.attrs.some(({name:r})=>r===Et.COLOR||r===Et.SIZE||r===Et.FACE)||b0.has(e)}function Ba(o){for(let e=0;e<o.attrs.length;e++)if(o.attrs[e].name===m0){o.attrs[e].name=h0;break}}function ja(o){for(let e=0;e<o.attrs.length;e++){let t=f0.get(o.attrs[e].name);t!=null&&(o.attrs[e].name=t)}}function Ts(o){for(let e=0;e<o.attrs.length;e++){let t=x0.get(o.attrs[e].name);t&&(o.attrs[e].prefix=t.prefix,o.attrs[e].name=t.name,o.attrs[e].namespace=t.namespace)}}function Hu(o){let e=g0.get(o.tagName);e!=null&&(o.tagName=e,o.tagID=Ht(o.tagName))}function y0(o,e){return e===_.MATHML&&(o===l.MI||o===l.MO||o===l.MN||o===l.MS||o===l.MTEXT)}function A0(o,e,t){if(e===_.MATHML&&o===l.ANNOTATION_XML){for(let r=0;r<t.length;r++)if(t[r].name===Et.ENCODING){let s=t[r].value.toLowerCase();return s===Vu.TEXT_HTML||s===Vu.APPLICATION_XML}}return e===_.SVG&&(o===l.FOREIGN_OBJECT||o===l.DESC||o===l.TITLE)}function Wu(o,e,t,r){return(!r||r===_.HTML)&&A0(o,e,t)||(!r||r===_.MATHML)&&y0(o,e)}var S0="hidden",z0=8,T0=3,I;(function(o){o[o.INITIAL=0]="INITIAL",o[o.BEFORE_HTML=1]="BEFORE_HTML",o[o.BEFORE_HEAD=2]="BEFORE_HEAD",o[o.IN_HEAD=3]="IN_HEAD",o[o.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",o[o.AFTER_HEAD=5]="AFTER_HEAD",o[o.IN_BODY=6]="IN_BODY",o[o.TEXT=7]="TEXT",o[o.IN_TABLE=8]="IN_TABLE",o[o.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",o[o.IN_CAPTION=10]="IN_CAPTION",o[o.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",o[o.IN_TABLE_BODY=12]="IN_TABLE_BODY",o[o.IN_ROW=13]="IN_ROW",o[o.IN_CELL=14]="IN_CELL",o[o.IN_SELECT=15]="IN_SELECT",o[o.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",o[o.IN_TEMPLATE=17]="IN_TEMPLATE",o[o.AFTER_BODY=18]="AFTER_BODY",o[o.IN_FRAMESET=19]="IN_FRAMESET",o[o.AFTER_FRAMESET=20]="AFTER_FRAMESET",o[o.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",o[o.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(I||(I={}));var E0={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Yu=new Set([l.TABLE,l.TBODY,l.TFOOT,l.THEAD,l.TR]),Gu={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:nt,onParseError:null},Zo=class{constructor(e,t,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=I.INITIAL,this.originalInsertionMode=I.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Gu,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new Wo(this.options,this),this.activeFormattingElements=new zs(this.treeAdapter),this.fragmentContextID=r?Ht(this.treeAdapter.getTagName(r)):l.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new Ss(this.document,this.treeAdapter,this)}static parse(e,t){let r=new this(t);return r.tokenizer.write(e,!0),r.document}static getFragmentParser(e,t){let r={...Gu,...t};e??(e=r.treeAdapter.createElement(M.TEMPLATE,_.HTML,[]));let s=r.treeAdapter.createElement("documentmock",_.HTML,[]),a=new this(r,s,e);return a.fragmentContextID===l.TEMPLATE&&a.tmplInsertionModeStack.unshift(I.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,r){var s;if(!this.onParseError)return;let a=(s=e.location)!==null&&s!==void 0?s:E0,p={code:t,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(p)}onItemPush(e,t,r){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,e,this.openElements.current),t){let a,p;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,p=this.fragmentContextID):{current:a,currentTagId:p}=this.openElements,this._setContextModes(a,p)}}_setContextModes(e,t){let r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===_.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,_.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=I.TEXT}switchToPlaintextParsing(){this.insertionMode=I.TEXT,this.originalInsertionMode=I.IN_BODY,this.tokenizer.state=Pe.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===M.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==_.HTML))switch(this.fragmentContextID){case l.TITLE:case l.TEXTAREA:{this.tokenizer.state=Pe.RCDATA;break}case l.STYLE:case l.XMP:case l.IFRAME:case l.NOEMBED:case l.NOFRAMES:case l.NOSCRIPT:{this.tokenizer.state=Pe.RAWTEXT;break}case l.SCRIPT:{this.tokenizer.state=Pe.SCRIPT_DATA;break}case l.PLAINTEXT:{this.tokenizer.state=Pe.PLAINTEXT;break}default:}}_setDocumentType(e){let t=e.name||"",r=e.publicId||"",s=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,t,r,s),e.location){let p=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));p&&this.treeAdapter.setNodeSourceCodeLocation(p,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let r=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,t){let r=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,t){let r=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,t){let r=this.treeAdapter.createElement(e,_.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,_.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,r),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(M.HTML,_.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,l.HTML)}_appendCommentNode(e,t){let r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let t,r;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(t,e.chars,r):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let s=this.treeAdapter.getChildNodes(t),a=r?s.lastIndexOf(r):s.length,p=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(p)){let{endLine:f,endCol:m,endOffset:x}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(p,{endLine:f,endCol:m,endOffset:x})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(p,e.location)}_adoptNodes(e,t){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(t,r)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let r=t.location,s=this.treeAdapter.getTagName(e),a=t.type===ie.END_TAG&&s===t.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,a)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,r;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,r=this.fragmentContextID):{current:t,currentTagId:r}=this.openElements,e.tagID===l.SVG&&this.treeAdapter.getTagName(t)===M.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===_.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===l.MGLYPH||e.tagID===l.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,t,_.HTML)}_processToken(e){switch(e.type){case ie.CHARACTER:{this.onCharacter(e);break}case ie.NULL_CHARACTER:{this.onNullCharacter(e);break}case ie.COMMENT:{this.onComment(e);break}case ie.DOCTYPE:{this.onDoctype(e);break}case ie.START_TAG:{this._processStartTag(e);break}case ie.END_TAG:{this.onEndTag(e);break}case ie.EOF:{this.onEof(e);break}case ie.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,t,r){let s=this.treeAdapter.getNamespaceURI(t),a=this.treeAdapter.getAttrList(t);return Wu(e,s,a,r)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(s=>s.type===st.Marker||this.openElements.contains(s.element)),r=t===-1?e-1:t-1;for(let s=r;s>=0;s--){let a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=I.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(l.P),this.openElements.popUntilTagNamePopped(l.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case l.TR:{this.insertionMode=I.IN_ROW;return}case l.TBODY:case l.THEAD:case l.TFOOT:{this.insertionMode=I.IN_TABLE_BODY;return}case l.CAPTION:{this.insertionMode=I.IN_CAPTION;return}case l.COLGROUP:{this.insertionMode=I.IN_COLUMN_GROUP;return}case l.TABLE:{this.insertionMode=I.IN_TABLE;return}case l.BODY:{this.insertionMode=I.IN_BODY;return}case l.FRAMESET:{this.insertionMode=I.IN_FRAMESET;return}case l.SELECT:{this._resetInsertionModeForSelect(e);return}case l.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case l.HTML:{this.insertionMode=this.headElement?I.AFTER_HEAD:I.BEFORE_HEAD;return}case l.TD:case l.TH:{if(e>0){this.insertionMode=I.IN_CELL;return}break}case l.HEAD:{if(e>0){this.insertionMode=I.IN_HEAD;return}break}}this.insertionMode=I.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let r=this.openElements.tagIDs[t];if(r===l.TEMPLATE)break;if(r===l.TABLE){this.insertionMode=I.IN_SELECT_IN_TABLE;return}}this.insertionMode=I.IN_SELECT}_isElementCausesFosterParenting(e){return Yu.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case l.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(t)===_.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break}case l.TABLE:{let r=this.treeAdapter.getParentNode(t);return r?{parent:r,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){let r=this.treeAdapter.getNamespaceURI(e);return Iu[r].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){eT(this,e);return}switch(this.insertionMode){case I.INITIAL:{$o(this,e);break}case I.BEFORE_HTML:{Ko(this,e);break}case I.BEFORE_HEAD:{qo(this,e);break}case I.IN_HEAD:{Yo(this,e);break}case I.IN_HEAD_NO_SCRIPT:{Qo(this,e);break}case I.AFTER_HEAD:{Jo(this,e);break}case I.IN_BODY:case I.IN_CAPTION:case I.IN_CELL:case I.IN_TEMPLATE:{Ju(this,e);break}case I.TEXT:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{Va(this,e);break}case I.IN_TABLE_TEXT:{rm(this,e);break}case I.IN_COLUMN_GROUP:{Cs(this,e);break}case I.AFTER_BODY:{Is(this,e);break}case I.AFTER_AFTER_BODY:{Es(this,e);break}default:}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Xz(this,e);return}switch(this.insertionMode){case I.INITIAL:{$o(this,e);break}case I.BEFORE_HTML:{Ko(this,e);break}case I.BEFORE_HEAD:{qo(this,e);break}case I.IN_HEAD:{Yo(this,e);break}case I.IN_HEAD_NO_SCRIPT:{Qo(this,e);break}case I.AFTER_HEAD:{Jo(this,e);break}case I.TEXT:{this._insertCharacters(e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{Va(this,e);break}case I.IN_COLUMN_GROUP:{Cs(this,e);break}case I.AFTER_BODY:{Is(this,e);break}case I.AFTER_AFTER_BODY:{Es(this,e);break}default:}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Ua(this,e);return}switch(this.insertionMode){case I.INITIAL:case I.BEFORE_HTML:case I.BEFORE_HEAD:case I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:case I.IN_BODY:case I.IN_TABLE:case I.IN_CAPTION:case I.IN_COLUMN_GROUP:case I.IN_TABLE_BODY:case I.IN_ROW:case I.IN_CELL:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:case I.IN_TEMPLATE:case I.IN_FRAMESET:case I.AFTER_FRAMESET:{Ua(this,e);break}case I.IN_TABLE_TEXT:{Go(this,e);break}case I.AFTER_BODY:{k0(this,e);break}case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{P0(this,e);break}default:}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case I.INITIAL:{L0(this,e);break}case I.BEFORE_HEAD:case I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:{this._err(e,D.misplacedDoctype);break}case I.IN_TABLE_TEXT:{Go(this,e);break}default:}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,D.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?tT(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case I.INITIAL:{$o(this,e);break}case I.BEFORE_HTML:{D0(this,e);break}case I.BEFORE_HEAD:{F0(this,e);break}case I.IN_HEAD:{it(this,e);break}case I.IN_HEAD_NO_SCRIPT:{B0(this,e);break}case I.AFTER_HEAD:{V0(this,e);break}case I.IN_BODY:{Le(this,e);break}case I.IN_TABLE:{lo(this,e);break}case I.IN_TABLE_TEXT:{Go(this,e);break}case I.IN_CAPTION:{Nz(this,e);break}case I.IN_COLUMN_GROUP:{Ga(this,e);break}case I.IN_TABLE_BODY:{Os(this,e);break}case I.IN_ROW:{Ms(this,e);break}case I.IN_CELL:{jz(this,e);break}case I.IN_SELECT:{im(this,e);break}case I.IN_SELECT_IN_TABLE:{Uz(this,e);break}case I.IN_TEMPLATE:{Wz(this,e);break}case I.AFTER_BODY:{Gz(this,e);break}case I.IN_FRAMESET:{Kz(this,e);break}case I.AFTER_FRAMESET:{Yz(this,e);break}case I.AFTER_AFTER_BODY:{Jz(this,e);break}case I.AFTER_AFTER_FRAMESET:{Zz(this,e);break}default:}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?oT(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case I.INITIAL:{$o(this,e);break}case I.BEFORE_HTML:{v0(this,e);break}case I.BEFORE_HEAD:{N0(this,e);break}case I.IN_HEAD:{_0(this,e);break}case I.IN_HEAD_NO_SCRIPT:{j0(this,e);break}case I.AFTER_HEAD:{U0(this,e);break}case I.IN_BODY:{ws(this,e);break}case I.TEXT:{Rz(this,e);break}case I.IN_TABLE:{Xo(this,e);break}case I.IN_TABLE_TEXT:{Go(this,e);break}case I.IN_CAPTION:{_z(this,e);break}case I.IN_COLUMN_GROUP:{Bz(this,e);break}case I.IN_TABLE_BODY:{Ha(this,e);break}case I.IN_ROW:{nm(this,e);break}case I.IN_CELL:{Vz(this,e);break}case I.IN_SELECT:{am(this,e);break}case I.IN_SELECT_IN_TABLE:{Hz(this,e);break}case I.IN_TEMPLATE:{$z(this,e);break}case I.AFTER_BODY:{pm(this,e);break}case I.IN_FRAMESET:{qz(this,e);break}case I.AFTER_FRAMESET:{Qz(this,e);break}case I.AFTER_AFTER_BODY:{Es(this,e);break}default:}}onEof(e){switch(this.insertionMode){case I.INITIAL:{$o(this,e);break}case I.BEFORE_HTML:{Ko(this,e);break}case I.BEFORE_HEAD:{qo(this,e);break}case I.IN_HEAD:{Yo(this,e);break}case I.IN_HEAD_NO_SCRIPT:{Qo(this,e);break}case I.AFTER_HEAD:{Jo(this,e);break}case I.IN_BODY:case I.IN_TABLE:case I.IN_CAPTION:case I.IN_COLUMN_GROUP:case I.IN_TABLE_BODY:case I.IN_ROW:case I.IN_CELL:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:{tm(this,e);break}case I.TEXT:{wz(this,e);break}case I.IN_TABLE_TEXT:{Go(this,e);break}case I.IN_TEMPLATE:{cm(this,e);break}case I.AFTER_BODY:case I.IN_FRAMESET:case I.AFTER_FRAMESET:case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{$a(this,e);break}default:}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===S.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:case I.TEXT:case I.IN_COLUMN_GROUP:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:case I.IN_FRAMESET:case I.AFTER_FRAMESET:{this._insertCharacters(e);break}case I.IN_BODY:case I.IN_CAPTION:case I.IN_CELL:case I.IN_TEMPLATE:case I.AFTER_BODY:case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{Qu(this,e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{Va(this,e);break}case I.IN_TABLE_TEXT:{om(this,e);break}default:}}};function C0(o,e){let t=o.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return t?o.openElements.contains(t.element)?o.openElements.hasInScope(e.tagID)||(t=null):(o.activeFormattingElements.removeEntry(t),t=null):em(o,e),t}function I0(o,e){let t=null,r=o.openElements.stackTop;for(;r>=0;r--){let s=o.openElements.items[r];if(s===e.element)break;o._isSpecialElement(s,o.openElements.tagIDs[r])&&(t=s)}return t||(o.openElements.shortenToLength(Math.max(r,0)),o.activeFormattingElements.removeEntry(e)),t}function R0(o,e,t){let r=e,s=o.openElements.getCommonAncestor(e);for(let a=0,p=s;p!==t;a++,p=s){s=o.openElements.getCommonAncestor(p);let u=o.activeFormattingElements.getElementEntry(p),f=u&&a>=T0;!u||f?(f&&o.activeFormattingElements.removeEntry(u),o.openElements.remove(p)):(p=w0(o,u),r===e&&(o.activeFormattingElements.bookmark=u),o.treeAdapter.detachNode(r),o.treeAdapter.appendChild(p,r),r=p)}return r}function w0(o,e){let t=o.treeAdapter.getNamespaceURI(e.element),r=o.treeAdapter.createElement(e.token.tagName,t,e.token.attrs);return o.openElements.replace(e.element,r),e.element=r,r}function O0(o,e,t){let r=o.treeAdapter.getTagName(e),s=Ht(r);if(o._isElementCausesFosterParenting(s))o._fosterParentElement(t);else{let a=o.treeAdapter.getNamespaceURI(e);s===l.TEMPLATE&&a===_.HTML&&(e=o.treeAdapter.getTemplateContent(e)),o.treeAdapter.appendChild(e,t)}}function M0(o,e,t){let r=o.treeAdapter.getNamespaceURI(t.element),{token:s}=t,a=o.treeAdapter.createElement(s.tagName,r,s.attrs);o._adoptNodes(e,a),o.treeAdapter.appendChild(e,a),o.activeFormattingElements.insertElementAfterBookmark(a,s),o.activeFormattingElements.removeEntry(t),o.openElements.remove(t.element),o.openElements.insertAfter(e,a,s.tagID)}function Wa(o,e){for(let t=0;t<z0;t++){let r=C0(o,e);if(!r)break;let s=I0(o,r);if(!s)break;o.activeFormattingElements.bookmark=r;let a=R0(o,s,r.element),p=o.openElements.getCommonAncestor(r.element);o.treeAdapter.detachNode(a),p&&O0(o,p,a),M0(o,s,r)}}function Ua(o,e){o._appendCommentNode(e,o.openElements.currentTmplContentOrNode)}function k0(o,e){o._appendCommentNode(e,o.openElements.items[0])}function P0(o,e){o._appendCommentNode(e,o.document)}function $a(o,e){if(o.stopped=!0,e.location){let t=o.fragmentContext?0:2;for(let r=o.openElements.stackTop;r>=t;r--)o._setEndLocation(o.openElements.items[r],e);if(!o.fragmentContext&&o.openElements.stackTop>=0){let r=o.openElements.items[0],s=o.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(o._setEndLocation(r,e),o.openElements.stackTop>=1)){let a=o.openElements.items[1],p=o.treeAdapter.getNodeSourceCodeLocation(a);p&&!p.endTag&&o._setEndLocation(a,e)}}}}function L0(o,e){o._setDocumentType(e);let t=e.forceQuirks?_e.QUIRKS:ju(e);Bu(e)||o._err(e,D.nonConformingDoctype),o.treeAdapter.setDocumentMode(o.document,t),o.insertionMode=I.BEFORE_HTML}function $o(o,e){o._err(e,D.missingDoctype,!0),o.treeAdapter.setDocumentMode(o.document,_e.QUIRKS),o.insertionMode=I.BEFORE_HTML,o._processToken(e)}function D0(o,e){e.tagID===l.HTML?(o._insertElement(e,_.HTML),o.insertionMode=I.BEFORE_HEAD):Ko(o,e)}function v0(o,e){let t=e.tagID;(t===l.HTML||t===l.HEAD||t===l.BODY||t===l.BR)&&Ko(o,e)}function Ko(o,e){o._insertFakeRootElement(),o.insertionMode=I.BEFORE_HEAD,o._processToken(e)}function F0(o,e){switch(e.tagID){case l.HTML:{Le(o,e);break}case l.HEAD:{o._insertElement(e,_.HTML),o.headElement=o.openElements.current,o.insertionMode=I.IN_HEAD;break}default:qo(o,e)}}function N0(o,e){let t=e.tagID;t===l.HEAD||t===l.BODY||t===l.HTML||t===l.BR?qo(o,e):o._err(e,D.endTagWithoutMatchingOpenElement)}function qo(o,e){o._insertFakeElement(M.HEAD,l.HEAD),o.headElement=o.openElements.current,o.insertionMode=I.IN_HEAD,o._processToken(e)}function it(o,e){switch(e.tagID){case l.HTML:{Le(o,e);break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:{o._appendElement(e,_.HTML),e.ackSelfClosing=!0;break}case l.TITLE:{o._switchToTextParsing(e,Pe.RCDATA);break}case l.NOSCRIPT:{o.options.scriptingEnabled?o._switchToTextParsing(e,Pe.RAWTEXT):(o._insertElement(e,_.HTML),o.insertionMode=I.IN_HEAD_NO_SCRIPT);break}case l.NOFRAMES:case l.STYLE:{o._switchToTextParsing(e,Pe.RAWTEXT);break}case l.SCRIPT:{o._switchToTextParsing(e,Pe.SCRIPT_DATA);break}case l.TEMPLATE:{o._insertTemplate(e),o.activeFormattingElements.insertMarker(),o.framesetOk=!1,o.insertionMode=I.IN_TEMPLATE,o.tmplInsertionModeStack.unshift(I.IN_TEMPLATE);break}case l.HEAD:{o._err(e,D.misplacedStartTagForHeadElement);break}default:Yo(o,e)}}function _0(o,e){switch(e.tagID){case l.HEAD:{o.openElements.pop(),o.insertionMode=I.AFTER_HEAD;break}case l.BODY:case l.BR:case l.HTML:{Yo(o,e);break}case l.TEMPLATE:{Wt(o,e);break}default:o._err(e,D.endTagWithoutMatchingOpenElement)}}function Wt(o,e){o.openElements.tmplCount>0?(o.openElements.generateImpliedEndTagsThoroughly(),o.openElements.currentTagId!==l.TEMPLATE&&o._err(e,D.closingOfElementWithOpenChildElements),o.openElements.popUntilTagNamePopped(l.TEMPLATE),o.activeFormattingElements.clearToLastMarker(),o.tmplInsertionModeStack.shift(),o._resetInsertionMode()):o._err(e,D.endTagWithoutMatchingOpenElement)}function Yo(o,e){o.openElements.pop(),o.insertionMode=I.AFTER_HEAD,o._processToken(e)}function B0(o,e){switch(e.tagID){case l.HTML:{Le(o,e);break}case l.BASEFONT:case l.BGSOUND:case l.HEAD:case l.LINK:case l.META:case l.NOFRAMES:case l.STYLE:{it(o,e);break}case l.NOSCRIPT:{o._err(e,D.nestedNoscriptInHead);break}default:Qo(o,e)}}function j0(o,e){switch(e.tagID){case l.NOSCRIPT:{o.openElements.pop(),o.insertionMode=I.IN_HEAD;break}case l.BR:{Qo(o,e);break}default:o._err(e,D.endTagWithoutMatchingOpenElement)}}function Qo(o,e){let t=e.type===ie.EOF?D.openElementsLeftAfterEof:D.disallowedContentInNoscriptInHead;o._err(e,t),o.openElements.pop(),o.insertionMode=I.IN_HEAD,o._processToken(e)}function V0(o,e){switch(e.tagID){case l.HTML:{Le(o,e);break}case l.BODY:{o._insertElement(e,_.HTML),o.framesetOk=!1,o.insertionMode=I.IN_BODY;break}case l.FRAMESET:{o._insertElement(e,_.HTML),o.insertionMode=I.IN_FRAMESET;break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{o._err(e,D.abandonedHeadElementChild),o.openElements.push(o.headElement,l.HEAD),it(o,e),o.openElements.remove(o.headElement);break}case l.HEAD:{o._err(e,D.misplacedStartTagForHeadElement);break}default:Jo(o,e)}}function U0(o,e){switch(e.tagID){case l.BODY:case l.HTML:case l.BR:{Jo(o,e);break}case l.TEMPLATE:{Wt(o,e);break}default:o._err(e,D.endTagWithoutMatchingOpenElement)}}function Jo(o,e){o._insertFakeElement(M.BODY,l.BODY),o.insertionMode=I.IN_BODY,Rs(o,e)}function Rs(o,e){switch(e.type){case ie.CHARACTER:{Ju(o,e);break}case ie.WHITESPACE_CHARACTER:{Qu(o,e);break}case ie.COMMENT:{Ua(o,e);break}case ie.START_TAG:{Le(o,e);break}case ie.END_TAG:{ws(o,e);break}case ie.EOF:{tm(o,e);break}default:}}function Qu(o,e){o._reconstructActiveFormattingElements(),o._insertCharacters(e)}function Ju(o,e){o._reconstructActiveFormattingElements(),o._insertCharacters(e),o.framesetOk=!1}function H0(o,e){o.openElements.tmplCount===0&&o.treeAdapter.adoptAttributes(o.openElements.items[0],e.attrs)}function W0(o,e){let t=o.openElements.tryPeekProperlyNestedBodyElement();t&&o.openElements.tmplCount===0&&(o.framesetOk=!1,o.treeAdapter.adoptAttributes(t,e.attrs))}function $0(o,e){let t=o.openElements.tryPeekProperlyNestedBodyElement();o.framesetOk&&t&&(o.treeAdapter.detachNode(t),o.openElements.popAllUpToHtmlElement(),o._insertElement(e,_.HTML),o.insertionMode=I.IN_FRAMESET)}function G0(o,e){o.openElements.hasInButtonScope(l.P)&&o._closePElement(),o._insertElement(e,_.HTML)}function K0(o,e){o.openElements.hasInButtonScope(l.P)&&o._closePElement(),o.openElements.currentTagId!==void 0&&Uo.has(o.openElements.currentTagId)&&o.openElements.pop(),o._insertElement(e,_.HTML)}function q0(o,e){o.openElements.hasInButtonScope(l.P)&&o._closePElement(),o._insertElement(e,_.HTML),o.skipNextNewLine=!0,o.framesetOk=!1}function Y0(o,e){let t=o.openElements.tmplCount>0;(!o.formElement||t)&&(o.openElements.hasInButtonScope(l.P)&&o._closePElement(),o._insertElement(e,_.HTML),t||(o.formElement=o.openElements.current))}function Q0(o,e){o.framesetOk=!1;let t=e.tagID;for(let r=o.openElements.stackTop;r>=0;r--){let s=o.openElements.tagIDs[r];if(t===l.LI&&s===l.LI||(t===l.DD||t===l.DT)&&(s===l.DD||s===l.DT)){o.openElements.generateImpliedEndTagsWithExclusion(s),o.openElements.popUntilTagNamePopped(s);break}if(s!==l.ADDRESS&&s!==l.DIV&&s!==l.P&&o._isSpecialElement(o.openElements.items[r],s))break}o.openElements.hasInButtonScope(l.P)&&o._closePElement(),o._insertElement(e,_.HTML)}function J0(o,e){o.openElements.hasInButtonScope(l.P)&&o._closePElement(),o._insertElement(e,_.HTML),o.tokenizer.state=Pe.PLAINTEXT}function Z0(o,e){o.openElements.hasInScope(l.BUTTON)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(l.BUTTON)),o._reconstructActiveFormattingElements(),o._insertElement(e,_.HTML),o.framesetOk=!1}function X0(o,e){let t=o.activeFormattingElements.getElementEntryInScopeWithTagName(M.A);t&&(Wa(o,e),o.openElements.remove(t.element),o.activeFormattingElements.removeEntry(t)),o._reconstructActiveFormattingElements(),o._insertElement(e,_.HTML),o.activeFormattingElements.pushElement(o.openElements.current,e)}function ez(o,e){o._reconstructActiveFormattingElements(),o._insertElement(e,_.HTML),o.activeFormattingElements.pushElement(o.openElements.current,e)}function tz(o,e){o._reconstructActiveFormattingElements(),o.openElements.hasInScope(l.NOBR)&&(Wa(o,e),o._reconstructActiveFormattingElements()),o._insertElement(e,_.HTML),o.activeFormattingElements.pushElement(o.openElements.current,e)}function oz(o,e){o._reconstructActiveFormattingElements(),o._insertElement(e,_.HTML),o.activeFormattingElements.insertMarker(),o.framesetOk=!1}function rz(o,e){o.treeAdapter.getDocumentMode(o.document)!==_e.QUIRKS&&o.openElements.hasInButtonScope(l.P)&&o._closePElement(),o._insertElement(e,_.HTML),o.framesetOk=!1,o.insertionMode=I.IN_TABLE}function Zu(o,e){o._reconstructActiveFormattingElements(),o._appendElement(e,_.HTML),o.framesetOk=!1,e.ackSelfClosing=!0}function Xu(o){let e=gs(o,Et.TYPE);return e!=null&&e.toLowerCase()===S0}function sz(o,e){o._reconstructActiveFormattingElements(),o._appendElement(e,_.HTML),Xu(e)||(o.framesetOk=!1),e.ackSelfClosing=!0}function nz(o,e){o._appendElement(e,_.HTML),e.ackSelfClosing=!0}function iz(o,e){o.openElements.hasInButtonScope(l.P)&&o._closePElement(),o._appendElement(e,_.HTML),o.framesetOk=!1,e.ackSelfClosing=!0}function az(o,e){e.tagName=M.IMG,e.tagID=l.IMG,Zu(o,e)}function cz(o,e){o._insertElement(e,_.HTML),o.skipNextNewLine=!0,o.tokenizer.state=Pe.RCDATA,o.originalInsertionMode=o.insertionMode,o.framesetOk=!1,o.insertionMode=I.TEXT}function pz(o,e){o.openElements.hasInButtonScope(l.P)&&o._closePElement(),o._reconstructActiveFormattingElements(),o.framesetOk=!1,o._switchToTextParsing(e,Pe.RAWTEXT)}function dz(o,e){o.framesetOk=!1,o._switchToTextParsing(e,Pe.RAWTEXT)}function Ku(o,e){o._switchToTextParsing(e,Pe.RAWTEXT)}function lz(o,e){o._reconstructActiveFormattingElements(),o._insertElement(e,_.HTML),o.framesetOk=!1,o.insertionMode=o.insertionMode===I.IN_TABLE||o.insertionMode===I.IN_CAPTION||o.insertionMode===I.IN_TABLE_BODY||o.insertionMode===I.IN_ROW||o.insertionMode===I.IN_CELL?I.IN_SELECT_IN_TABLE:I.IN_SELECT}function uz(o,e){o.openElements.currentTagId===l.OPTION&&o.openElements.pop(),o._reconstructActiveFormattingElements(),o._insertElement(e,_.HTML)}function mz(o,e){o.openElements.hasInScope(l.RUBY)&&o.openElements.generateImpliedEndTags(),o._insertElement(e,_.HTML)}function hz(o,e){o.openElements.hasInScope(l.RUBY)&&o.openElements.generateImpliedEndTagsWithExclusion(l.RTC),o._insertElement(e,_.HTML)}function fz(o,e){o._reconstructActiveFormattingElements(),Ba(e),Ts(e),e.selfClosing?o._appendElement(e,_.MATHML):o._insertElement(e,_.MATHML),e.ackSelfClosing=!0}function xz(o,e){o._reconstructActiveFormattingElements(),ja(e),Ts(e),e.selfClosing?o._appendElement(e,_.SVG):o._insertElement(e,_.SVG),e.ackSelfClosing=!0}function qu(o,e){o._reconstructActiveFormattingElements(),o._insertElement(e,_.HTML)}function Le(o,e){switch(e.tagID){case l.I:case l.S:case l.B:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.SMALL:case l.STRIKE:case l.STRONG:{ez(o,e);break}case l.A:{X0(o,e);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{K0(o,e);break}case l.P:case l.DL:case l.OL:case l.UL:case l.DIV:case l.DIR:case l.NAV:case l.MAIN:case l.MENU:case l.ASIDE:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.DETAILS:case l.ADDRESS:case l.ARTICLE:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{G0(o,e);break}case l.LI:case l.DD:case l.DT:{Q0(o,e);break}case l.BR:case l.IMG:case l.WBR:case l.AREA:case l.EMBED:case l.KEYGEN:{Zu(o,e);break}case l.HR:{iz(o,e);break}case l.RB:case l.RTC:{mz(o,e);break}case l.RT:case l.RP:{hz(o,e);break}case l.PRE:case l.LISTING:{q0(o,e);break}case l.XMP:{pz(o,e);break}case l.SVG:{xz(o,e);break}case l.HTML:{H0(o,e);break}case l.BASE:case l.LINK:case l.META:case l.STYLE:case l.TITLE:case l.SCRIPT:case l.BGSOUND:case l.BASEFONT:case l.TEMPLATE:{it(o,e);break}case l.BODY:{W0(o,e);break}case l.FORM:{Y0(o,e);break}case l.NOBR:{tz(o,e);break}case l.MATH:{fz(o,e);break}case l.TABLE:{rz(o,e);break}case l.INPUT:{sz(o,e);break}case l.PARAM:case l.TRACK:case l.SOURCE:{nz(o,e);break}case l.IMAGE:{az(o,e);break}case l.BUTTON:{Z0(o,e);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{oz(o,e);break}case l.IFRAME:{dz(o,e);break}case l.SELECT:{lz(o,e);break}case l.OPTION:case l.OPTGROUP:{uz(o,e);break}case l.NOEMBED:case l.NOFRAMES:{Ku(o,e);break}case l.FRAMESET:{$0(o,e);break}case l.TEXTAREA:{cz(o,e);break}case l.NOSCRIPT:{o.options.scriptingEnabled?Ku(o,e):qu(o,e);break}case l.PLAINTEXT:{J0(o,e);break}case l.COL:case l.TH:case l.TD:case l.TR:case l.HEAD:case l.FRAME:case l.TBODY:case l.TFOOT:case l.THEAD:case l.CAPTION:case l.COLGROUP:break;default:qu(o,e)}}function gz(o,e){if(o.openElements.hasInScope(l.BODY)&&(o.insertionMode=I.AFTER_BODY,o.options.sourceCodeLocationInfo)){let t=o.openElements.tryPeekProperlyNestedBodyElement();t&&o._setEndLocation(t,e)}}function bz(o,e){o.openElements.hasInScope(l.BODY)&&(o.insertionMode=I.AFTER_BODY,pm(o,e))}function yz(o,e){let t=e.tagID;o.openElements.hasInScope(t)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(t))}function Az(o){let e=o.openElements.tmplCount>0,{formElement:t}=o;e||(o.formElement=null),(t||e)&&o.openElements.hasInScope(l.FORM)&&(o.openElements.generateImpliedEndTags(),e?o.openElements.popUntilTagNamePopped(l.FORM):t&&o.openElements.remove(t))}function Sz(o){o.openElements.hasInButtonScope(l.P)||o._insertFakeElement(M.P,l.P),o._closePElement()}function zz(o){o.openElements.hasInListItemScope(l.LI)&&(o.openElements.generateImpliedEndTagsWithExclusion(l.LI),o.openElements.popUntilTagNamePopped(l.LI))}function Tz(o,e){let t=e.tagID;o.openElements.hasInScope(t)&&(o.openElements.generateImpliedEndTagsWithExclusion(t),o.openElements.popUntilTagNamePopped(t))}function Ez(o){o.openElements.hasNumberedHeaderInScope()&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilNumberedHeaderPopped())}function Cz(o,e){let t=e.tagID;o.openElements.hasInScope(t)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(t),o.activeFormattingElements.clearToLastMarker())}function Iz(o){o._reconstructActiveFormattingElements(),o._insertFakeElement(M.BR,l.BR),o.openElements.pop(),o.framesetOk=!1}function em(o,e){let t=e.tagName,r=e.tagID;for(let s=o.openElements.stackTop;s>0;s--){let a=o.openElements.items[s],p=o.openElements.tagIDs[s];if(r===p&&(r!==l.UNKNOWN||o.treeAdapter.getTagName(a)===t)){o.openElements.generateImpliedEndTagsWithExclusion(r),o.openElements.stackTop>=s&&o.openElements.shortenToLength(s);break}if(o._isSpecialElement(a,p))break}}function ws(o,e){switch(e.tagID){case l.A:case l.B:case l.I:case l.S:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.NOBR:case l.SMALL:case l.STRIKE:case l.STRONG:{Wa(o,e);break}case l.P:{Sz(o);break}case l.DL:case l.UL:case l.OL:case l.DIR:case l.DIV:case l.NAV:case l.PRE:case l.MAIN:case l.MENU:case l.ASIDE:case l.BUTTON:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.ADDRESS:case l.ARTICLE:case l.DETAILS:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.LISTING:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{yz(o,e);break}case l.LI:{zz(o);break}case l.DD:case l.DT:{Tz(o,e);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{Ez(o);break}case l.BR:{Iz(o);break}case l.BODY:{gz(o,e);break}case l.HTML:{bz(o,e);break}case l.FORM:{Az(o);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{Cz(o,e);break}case l.TEMPLATE:{Wt(o,e);break}default:em(o,e)}}function tm(o,e){o.tmplInsertionModeStack.length>0?cm(o,e):$a(o,e)}function Rz(o,e){var t;e.tagID===l.SCRIPT&&((t=o.scriptHandler)===null||t===void 0||t.call(o,o.openElements.current)),o.openElements.pop(),o.insertionMode=o.originalInsertionMode}function wz(o,e){o._err(e,D.eofInElementThatCanContainOnlyText),o.openElements.pop(),o.insertionMode=o.originalInsertionMode,o.onEof(e)}function Va(o,e){if(o.openElements.currentTagId!==void 0&&Yu.has(o.openElements.currentTagId))switch(o.pendingCharacterTokens.length=0,o.hasNonWhitespacePendingCharacterToken=!1,o.originalInsertionMode=o.insertionMode,o.insertionMode=I.IN_TABLE_TEXT,e.type){case ie.CHARACTER:{rm(o,e);break}case ie.WHITESPACE_CHARACTER:{om(o,e);break}}else er(o,e)}function Oz(o,e){o.openElements.clearBackToTableContext(),o.activeFormattingElements.insertMarker(),o._insertElement(e,_.HTML),o.insertionMode=I.IN_CAPTION}function Mz(o,e){o.openElements.clearBackToTableContext(),o._insertElement(e,_.HTML),o.insertionMode=I.IN_COLUMN_GROUP}function kz(o,e){o.openElements.clearBackToTableContext(),o._insertFakeElement(M.COLGROUP,l.COLGROUP),o.insertionMode=I.IN_COLUMN_GROUP,Ga(o,e)}function Pz(o,e){o.openElements.clearBackToTableContext(),o._insertElement(e,_.HTML),o.insertionMode=I.IN_TABLE_BODY}function Lz(o,e){o.openElements.clearBackToTableContext(),o._insertFakeElement(M.TBODY,l.TBODY),o.insertionMode=I.IN_TABLE_BODY,Os(o,e)}function Dz(o,e){o.openElements.hasInTableScope(l.TABLE)&&(o.openElements.popUntilTagNamePopped(l.TABLE),o._resetInsertionMode(),o._processStartTag(e))}function vz(o,e){Xu(e)?o._appendElement(e,_.HTML):er(o,e),e.ackSelfClosing=!0}function Fz(o,e){!o.formElement&&o.openElements.tmplCount===0&&(o._insertElement(e,_.HTML),o.formElement=o.openElements.current,o.openElements.pop())}function lo(o,e){switch(e.tagID){case l.TD:case l.TH:case l.TR:{Lz(o,e);break}case l.STYLE:case l.SCRIPT:case l.TEMPLATE:{it(o,e);break}case l.COL:{kz(o,e);break}case l.FORM:{Fz(o,e);break}case l.TABLE:{Dz(o,e);break}case l.TBODY:case l.TFOOT:case l.THEAD:{Pz(o,e);break}case l.INPUT:{vz(o,e);break}case l.CAPTION:{Oz(o,e);break}case l.COLGROUP:{Mz(o,e);break}default:er(o,e)}}function Xo(o,e){switch(e.tagID){case l.TABLE:{o.openElements.hasInTableScope(l.TABLE)&&(o.openElements.popUntilTagNamePopped(l.TABLE),o._resetInsertionMode());break}case l.TEMPLATE:{Wt(o,e);break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:er(o,e)}}function er(o,e){let t=o.fosterParentingEnabled;o.fosterParentingEnabled=!0,Rs(o,e),o.fosterParentingEnabled=t}function om(o,e){o.pendingCharacterTokens.push(e)}function rm(o,e){o.pendingCharacterTokens.push(e),o.hasNonWhitespacePendingCharacterToken=!0}function Go(o,e){let t=0;if(o.hasNonWhitespacePendingCharacterToken)for(;t<o.pendingCharacterTokens.length;t++)er(o,o.pendingCharacterTokens[t]);else for(;t<o.pendingCharacterTokens.length;t++)o._insertCharacters(o.pendingCharacterTokens[t]);o.insertionMode=o.originalInsertionMode,o._processToken(e)}var sm=new Set([l.CAPTION,l.COL,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]);function Nz(o,e){let t=e.tagID;sm.has(t)?o.openElements.hasInTableScope(l.CAPTION)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(l.CAPTION),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=I.IN_TABLE,lo(o,e)):Le(o,e)}function _z(o,e){let t=e.tagID;switch(t){case l.CAPTION:case l.TABLE:{o.openElements.hasInTableScope(l.CAPTION)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(l.CAPTION),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=I.IN_TABLE,t===l.TABLE&&Xo(o,e));break}case l.BODY:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:ws(o,e)}}function Ga(o,e){switch(e.tagID){case l.HTML:{Le(o,e);break}case l.COL:{o._appendElement(e,_.HTML),e.ackSelfClosing=!0;break}case l.TEMPLATE:{it(o,e);break}default:Cs(o,e)}}function Bz(o,e){switch(e.tagID){case l.COLGROUP:{o.openElements.currentTagId===l.COLGROUP&&(o.openElements.pop(),o.insertionMode=I.IN_TABLE);break}case l.TEMPLATE:{Wt(o,e);break}case l.COL:break;default:Cs(o,e)}}function Cs(o,e){o.openElements.currentTagId===l.COLGROUP&&(o.openElements.pop(),o.insertionMode=I.IN_TABLE,o._processToken(e))}function Os(o,e){switch(e.tagID){case l.TR:{o.openElements.clearBackToTableBodyContext(),o._insertElement(e,_.HTML),o.insertionMode=I.IN_ROW;break}case l.TH:case l.TD:{o.openElements.clearBackToTableBodyContext(),o._insertFakeElement(M.TR,l.TR),o.insertionMode=I.IN_ROW,Ms(o,e);break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{o.openElements.hasTableBodyContextInTableScope()&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=I.IN_TABLE,lo(o,e));break}default:lo(o,e)}}function Ha(o,e){let t=e.tagID;switch(e.tagID){case l.TBODY:case l.TFOOT:case l.THEAD:{o.openElements.hasInTableScope(t)&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=I.IN_TABLE);break}case l.TABLE:{o.openElements.hasTableBodyContextInTableScope()&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=I.IN_TABLE,Xo(o,e));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:case l.TR:break;default:Xo(o,e)}}function Ms(o,e){switch(e.tagID){case l.TH:case l.TD:{o.openElements.clearBackToTableRowContext(),o._insertElement(e,_.HTML),o.insertionMode=I.IN_CELL,o.activeFormattingElements.insertMarker();break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{o.openElements.hasInTableScope(l.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=I.IN_TABLE_BODY,Os(o,e));break}default:lo(o,e)}}function nm(o,e){switch(e.tagID){case l.TR:{o.openElements.hasInTableScope(l.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=I.IN_TABLE_BODY);break}case l.TABLE:{o.openElements.hasInTableScope(l.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=I.IN_TABLE_BODY,Ha(o,e));break}case l.TBODY:case l.TFOOT:case l.THEAD:{(o.openElements.hasInTableScope(e.tagID)||o.openElements.hasInTableScope(l.TR))&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=I.IN_TABLE_BODY,Ha(o,e));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:break;default:Xo(o,e)}}function jz(o,e){let t=e.tagID;sm.has(t)?(o.openElements.hasInTableScope(l.TD)||o.openElements.hasInTableScope(l.TH))&&(o._closeTableCell(),Ms(o,e)):Le(o,e)}function Vz(o,e){let t=e.tagID;switch(t){case l.TD:case l.TH:{o.openElements.hasInTableScope(t)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(t),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=I.IN_ROW);break}case l.TABLE:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{o.openElements.hasInTableScope(t)&&(o._closeTableCell(),nm(o,e));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:break;default:ws(o,e)}}function im(o,e){switch(e.tagID){case l.HTML:{Le(o,e);break}case l.OPTION:{o.openElements.currentTagId===l.OPTION&&o.openElements.pop(),o._insertElement(e,_.HTML);break}case l.OPTGROUP:{o.openElements.currentTagId===l.OPTION&&o.openElements.pop(),o.openElements.currentTagId===l.OPTGROUP&&o.openElements.pop(),o._insertElement(e,_.HTML);break}case l.HR:{o.openElements.currentTagId===l.OPTION&&o.openElements.pop(),o.openElements.currentTagId===l.OPTGROUP&&o.openElements.pop(),o._appendElement(e,_.HTML),e.ackSelfClosing=!0;break}case l.INPUT:case l.KEYGEN:case l.TEXTAREA:case l.SELECT:{o.openElements.hasInSelectScope(l.SELECT)&&(o.openElements.popUntilTagNamePopped(l.SELECT),o._resetInsertionMode(),e.tagID!==l.SELECT&&o._processStartTag(e));break}case l.SCRIPT:case l.TEMPLATE:{it(o,e);break}default:}}function am(o,e){switch(e.tagID){case l.OPTGROUP:{o.openElements.stackTop>0&&o.openElements.currentTagId===l.OPTION&&o.openElements.tagIDs[o.openElements.stackTop-1]===l.OPTGROUP&&o.openElements.pop(),o.openElements.currentTagId===l.OPTGROUP&&o.openElements.pop();break}case l.OPTION:{o.openElements.currentTagId===l.OPTION&&o.openElements.pop();break}case l.SELECT:{o.openElements.hasInSelectScope(l.SELECT)&&(o.openElements.popUntilTagNamePopped(l.SELECT),o._resetInsertionMode());break}case l.TEMPLATE:{Wt(o,e);break}default:}}function Uz(o,e){let t=e.tagID;t===l.CAPTION||t===l.TABLE||t===l.TBODY||t===l.TFOOT||t===l.THEAD||t===l.TR||t===l.TD||t===l.TH?(o.openElements.popUntilTagNamePopped(l.SELECT),o._resetInsertionMode(),o._processStartTag(e)):im(o,e)}function Hz(o,e){let t=e.tagID;t===l.CAPTION||t===l.TABLE||t===l.TBODY||t===l.TFOOT||t===l.THEAD||t===l.TR||t===l.TD||t===l.TH?o.openElements.hasInTableScope(t)&&(o.openElements.popUntilTagNamePopped(l.SELECT),o._resetInsertionMode(),o.onEndTag(e)):am(o,e)}function Wz(o,e){switch(e.tagID){case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{it(o,e);break}case l.CAPTION:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{o.tmplInsertionModeStack[0]=I.IN_TABLE,o.insertionMode=I.IN_TABLE,lo(o,e);break}case l.COL:{o.tmplInsertionModeStack[0]=I.IN_COLUMN_GROUP,o.insertionMode=I.IN_COLUMN_GROUP,Ga(o,e);break}case l.TR:{o.tmplInsertionModeStack[0]=I.IN_TABLE_BODY,o.insertionMode=I.IN_TABLE_BODY,Os(o,e);break}case l.TD:case l.TH:{o.tmplInsertionModeStack[0]=I.IN_ROW,o.insertionMode=I.IN_ROW,Ms(o,e);break}default:o.tmplInsertionModeStack[0]=I.IN_BODY,o.insertionMode=I.IN_BODY,Le(o,e)}}function $z(o,e){e.tagID===l.TEMPLATE&&Wt(o,e)}function cm(o,e){o.openElements.tmplCount>0?(o.openElements.popUntilTagNamePopped(l.TEMPLATE),o.activeFormattingElements.clearToLastMarker(),o.tmplInsertionModeStack.shift(),o._resetInsertionMode(),o.onEof(e)):$a(o,e)}function Gz(o,e){e.tagID===l.HTML?Le(o,e):Is(o,e)}function pm(o,e){var t;if(e.tagID===l.HTML){if(o.fragmentContext||(o.insertionMode=I.AFTER_AFTER_BODY),o.options.sourceCodeLocationInfo&&o.openElements.tagIDs[0]===l.HTML){o._setEndLocation(o.openElements.items[0],e);let r=o.openElements.items[1];r&&!(!((t=o.treeAdapter.getNodeSourceCodeLocation(r))===null||t===void 0)&&t.endTag)&&o._setEndLocation(r,e)}}else Is(o,e)}function Is(o,e){o.insertionMode=I.IN_BODY,Rs(o,e)}function Kz(o,e){switch(e.tagID){case l.HTML:{Le(o,e);break}case l.FRAMESET:{o._insertElement(e,_.HTML);break}case l.FRAME:{o._appendElement(e,_.HTML),e.ackSelfClosing=!0;break}case l.NOFRAMES:{it(o,e);break}default:}}function qz(o,e){e.tagID===l.FRAMESET&&!o.openElements.isRootHtmlElementCurrent()&&(o.openElements.pop(),!o.fragmentContext&&o.openElements.currentTagId!==l.FRAMESET&&(o.insertionMode=I.AFTER_FRAMESET))}function Yz(o,e){switch(e.tagID){case l.HTML:{Le(o,e);break}case l.NOFRAMES:{it(o,e);break}default:}}function Qz(o,e){e.tagID===l.HTML&&(o.insertionMode=I.AFTER_AFTER_FRAMESET)}function Jz(o,e){e.tagID===l.HTML?Le(o,e):Es(o,e)}function Es(o,e){o.insertionMode=I.IN_BODY,Rs(o,e)}function Zz(o,e){switch(e.tagID){case l.HTML:{Le(o,e);break}case l.NOFRAMES:{it(o,e);break}default:}}function Xz(o,e){e.chars=he,o._insertCharacters(e)}function eT(o,e){o._insertCharacters(e),o.framesetOk=!1}function dm(o){for(;o.treeAdapter.getNamespaceURI(o.openElements.current)!==_.HTML&&o.openElements.currentTagId!==void 0&&!o._isIntegrationPoint(o.openElements.currentTagId,o.openElements.current);)o.openElements.pop()}function tT(o,e){if(Uu(e))dm(o),o._startTagOutsideForeignContent(e);else{let t=o._getAdjustedCurrentElement(),r=o.treeAdapter.getNamespaceURI(t);r===_.MATHML?Ba(e):r===_.SVG&&(Hu(e),ja(e)),Ts(e),e.selfClosing?o._appendElement(e,r):o._insertElement(e,r),e.ackSelfClosing=!0}}function oT(o,e){if(e.tagID===l.P||e.tagID===l.BR){dm(o),o._endTagOutsideForeignContent(e);return}for(let t=o.openElements.stackTop;t>0;t--){let r=o.openElements.items[t];if(o.treeAdapter.getNamespaceURI(r)===_.HTML){o._endTagOutsideForeignContent(e);break}let s=o.treeAdapter.getTagName(r);if(s.toLowerCase()===e.tagName){e.tagName=s,o.openElements.shortenToLength(t);break}}}var Hxe=new Set([M.AREA,M.BASE,M.BASEFONT,M.BGSOUND,M.BR,M.COL,M.EMBED,M.FRAME,M.HR,M.IMG,M.INPUT,M.KEYGEN,M.LINK,M.META,M.PARAM,M.SOURCE,M.TRACK,M.WBR]);function lm(o,e,t){typeof o=="string"&&(t=e,e=o,o=null);let r=Zo.getFragmentParser(o,t);return r.tokenizer.write(e,!0),r.getFragment()}function Ka(o){return o.trim().startsWith("#")}function sT(o){return[...o.matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)/gi)].map(e=>e[2]??"")}function nT(o){return sT(o).some(e=>!Ka(e))}var iT=["abbr","address","article","aside","b","bdi","bdo","blockquote","br","button","caption","cite","code","col","colgroup","data","dd","del","dfn","div","dl","dt","em","figcaption","figure","footer","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","ins","kbd","label","li","main","mark","meter","nav","ol","p","pre","progress","q","rp","rt","ruby","s","samp","section","small","span","strong","style","sub","sup","table","tbody","td","tfoot","th","thead","time","tr","u","ul","var","wbr"],aT=["svg","g","defs","symbol","use","title","desc","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","textpath","lineargradient","radialgradient","stop","clippath","mask","pattern","marker","filter","feblend","fecolormatrix","fecomponenttransfer","fecomposite","feconvolvematrix","fediffuselighting","fedisplacementmap","fedistantlight","fedropshadow","feflood","fefunca","fefuncb","fefuncg","fefuncr","fegaussianblur","femerge","femergenode","femorphology","feoffset","fepointlight","fespecularlighting","fespotlight","fetile","feturbulence"],cT=new Set([...iT,...aT]),pT=new Set(["action","data","formaction","href","poster","src","srcset"]),dT=new Set(["clip-path","cursor","fill","filter","marker","marker-end","marker-mid","marker-start","mask","stroke"]);function um(o,e){let t;try{t=mu(o,{context:e})}catch(s){return`contains invalid CSS: ${String(s)}`}let r=null;return Au(t,s=>{r||(s.type==="Url"&&!Ka(s.value)?r="contains a CSS url() asset reference":s.type==="Atrule"&&["import","font-face"].includes(s.name.toLowerCase())&&(r=`contains a forbidden CSS @${s.name} rule`))}),r}function mm(o){if(o.nodeName==="#comment"||o.nodeName==="#text")return null;if("tagName"in o){let e=o.tagName.toLowerCase();if(!cT.has(e))return`contains <${o.tagName}>, which a card may not use`;for(let t of o.attrs){let r=t.name.toLowerCase();if(r.startsWith("on"))return`contains the event handler '${t.name}'`;if(pT.has(r)&&!Ka(t.value))return`contains a ${t.name} reference outside the card`;if(r==="style"){let s=um(t.value,"declarationList");if(s)return s}if(dT.has(r)&&nT(t.value))return`contains a ${t.name} url() reference outside the card`}if(e==="style"){let t=o.childNodes.filter(s=>s.nodeName==="#text").map(s=>s.value).join(""),r=um(t,"stylesheet");if(r)return r}}if("childNodes"in o)for(let e of o.childNodes){let t=mm(e);if(t)return t}return null}function lT(o){for(let e of lm(o).childNodes){let t=mm(e);if(t)return t}return null}var ks=d.string().min(1).superRefine((o,e)=>{let t=lT(o);t&&e.addIssue({code:"custom",message:`Card HTML ${t}.`})});var Ya=d.object({aspectRatio:d.enum(["16:9","9:16","1:1","4:5"]),fps:d.union([d.literal(24),d.literal(25),d.literal(30),d.literal(60)]).optional(),resolution:d.enum(["hd","fhd","4k"]).optional(),platform:d.string().optional()}),ym=d.object({start:d.number().nonnegative(),end:d.number().nonnegative()}),uT=d.object({start:d.number().nonnegative(),end:d.number().nonnegative(),reason:d.string().optional()}),mT=d.object({kind:d.literal("media"),mediaId:Ue,trim:ym.optional(),excludedRanges:d.array(uT).optional(),volume:d.number().min(0).max(4).optional(),muted:d.boolean().optional(),playbackRate:d.number().positive().optional(),sync:d.enum(["video","independent"]).optional(),kenBurns:d.enum(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:d.number().optional(),fadeInMs:d.number().nonnegative().optional(),fadeOutMs:d.number().nonnegative().optional(),loop:d.boolean().optional(),audioRole:d.enum(["sfx","music","vo","ambience"]).optional(),duck:d.object({duckDb:d.number().max(0),attackMs:d.number().nonnegative(),releaseMs:d.number().nonnegative(),windows:d.array(d.object({startMs:d.number(),endMs:d.number()})).optional()}).optional(),anchor:d.object({clipId:d.string().min(1),offsetMs:d.number()}).optional(),reframe:Sn.optional()}),hT=d.object({kind:d.literal("component"),componentId:d.string().min(1),props:d.record(d.string(),d.unknown()),assets:d.record(d.string().min(1),d.string().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:d.enum(["front","behind-subject"]).optional()}),fT=d.object({kind:d.literal("overlay"),primitiveId:d.string().min(1),params:d.record(d.string(),d.unknown()),zPlane:d.enum(["front","behind-subject"]).optional(),anchor:d.object({space:d.literal("scene"),x:d.number().min(0).max(1),y:d.number().min(0).max(1)}).optional(),parallax:d.number().min(-.3).max(.3).optional()}),xT=d.object({kind:d.literal("effect"),primitiveId:d.string().min(1),params:d.record(d.string(),d.unknown()).optional()}),gT=d.object({kind:d.literal("card"),html:ks,tokens:d.record(d.string(),d.string()).optional(),zPlane:d.literal("front").optional()}),bT=d.object({kind:d.literal("composition"),compositionId:d.string().min(1),trim:ym.optional()}).strict(),yT=d.discriminatedUnion("kind",[mT,hT,fT,xT,gT,bT]),AT=d.object({type:d.string().min(1),duration:d.number().positive()}),Am=-1,Sm=2,hm=o=>`position.${o} is a FRACTION of the frame (0.5 = centre, 0 to 1 inside it, ${Am} to ${Sm} with entrance/exit overshoot) \u2014 px values are not accepted`,Ps=o=>d.number().min(Am,hm(o)).max(Sm,hm(o)),ST=d.object({x:Ps("x"),y:Ps("y")}).describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),Ls=d.object({x:d.number().min(0).max(1),y:d.number().min(0).max(1),w:d.number().positive().max(1),h:d.number().positive().max(1)}),zm=Ls.refine(o=>o.x+o.w<=1&&o.y+o.h<=1,"captions style.region must fit within the normalized frame"),zT=d.enum(["cover","contain"]),TT=d.enum(["visible","hidden"]),ET=d.object({primitiveId:d.string().min(1),params:d.record(d.string(),d.unknown()).optional()}),CT=d.union([d.enum(["linear","ease","easeIn","easeOut","easeInOut"]),d.object({cubicBezier:d.tuple([d.number(),d.number(),d.number(),d.number()])}).strict()]),IT=d.object({time:d.number().nonnegative(),value:d.number(),easing:CT.optional()}).strict(),RT=d.array(IT).min(2),fm=["opacity","scale","rotation","position.x","position.y","volume"],wT={opacity:d.number().min(0,"opacity is 0 to 1").max(1,"opacity is 0 to 1"),scale:d.number().positive("scale is a multiplier and must be > 0"),rotation:d.number(),"position.x":Ps("x"),"position.y":Ps("y"),volume:d.number().min(0,"volume is 0 to 4").max(4,"volume is 0 to 4")},OT=d.object({id:d.string().min(1),startTime:d.number().nonnegative(),duration:d.number().positive(),source:yT,kind:d.enum(["video","audio","image","overlay","effect"]).optional(),opacity:d.number().min(0).max(1).optional(),scale:d.number().positive().optional(),rotation:d.number().optional(),position:ST.optional(),region:Ls.optional(),fit:zT.optional(),captionVisibility:TT.optional().describe("Video media clip only. Hide native captions while this clip is topmost and covers the lower picture, or when an opaque, effect-free clip has an explicitly full-frame region, even with fit:contain. Caption words and timings remain stored and resume when another visible clip takes over."),effects:d.array(ET).optional(),transitionIn:AT.optional(),linkGroupId:d.string().min(1).optional(),animate:d.record(d.string(),RT).superRefine((o,e)=>{for(let[t,r]of Object.entries(o)){if(!fm.includes(t)){e.addIssue({code:d.ZodIssueCode.custom,path:[t],message:`"${t}" is not an animatable param (${fm.join(", ")})`});continue}let s=wT[t];r.forEach((a,p)=>{let u=s.safeParse(a.value);u.success||e.addIssue({code:d.ZodIssueCode.custom,path:[t,p,"value"],message:u.error.issues[0]?.message??`invalid ${t} keyframe value`})})}}).describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.").optional()}).strict(),MT=d.object({id:d.string().min(1),startTime:d.number().nonnegative(),duration:d.number().positive()}).strict(),kT=d.unknown().transform((o,e)=>{let r=(!!o&&typeof o=="object"&&"source"in o?OT:MT).safeParse(o);return r.success?r.data:(e.issues.push(...r.error.issues),d.NEVER)}),PT=d.object({id:d.string().min(1),kind:d.enum(["video","audio","image","overlay","effect"]),name:d.string().optional(),enabled:d.boolean().optional(),volume:d.number().min(0).max(4).optional(),contents:d.array(kT)}).strict(),LT=d.object({id:d.string().min(1),startTime:d.number().nonnegative(),endTime:d.number().nonnegative().optional(),kind:d.string().min(1),name:d.string().optional(),metadata:d.record(d.string(),d.unknown()).optional()}).strict(),DT=d.object({public:d.boolean().optional(),readerOrgIds:d.array(d.string()).optional(),writerOrgIds:d.array(d.string()).optional()}),vT=d.object({type:d.string().min(1),source:d.string().optional(),notes:d.string().optional()}),FT=d.object({audioDescriptionTrackId:d.string().optional(),captionsTrackId:d.string().optional(),signLanguageTrackId:d.string().optional(),notes:d.string().optional()}),NT=d.object({text:d.string().min(1),startMs:d.number().nonnegative().describe("Word start on the composition timeline, in milliseconds."),endMs:d.number().nonnegative().describe("Word end on the composition timeline, in milliseconds."),emphasis:d.boolean().optional(),annotate:d.enum(["circle","underline"]).optional()}),qa=d.object({fontFamily:d.string().min(1).optional(),fontSize:d.number().min(1,"captions style.fontSize is PERCENT of composition height (1-15, default 5) \u2014 px values are not accepted").max(15,"captions style.fontSize is PERCENT of composition height (1-15, default 5) \u2014 px values are not accepted").optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),fontWeight:d.number().int().min(100).max(900).optional(),color:d.string().min(1).optional(),highlightColor:d.string().min(1).optional(),backgroundColor:d.string().optional(),plate:d.enum(["glass","solid","none"]).optional(),position:d.enum(["top","center","bottom"]).optional(),region:zm.optional().describe("Optional caption layout box {x,y,w,h} in normalized output-frame coordinates. Overrides position; text starts at its top edge and wraps/pages within its width and height."),textTransform:d.enum(["none","uppercase","capitalize"]).optional(),letterSpacing:d.number().min(-5).max(20).optional().describe("Base caption glyph spacing in pixels."),wordGapEm:d.number().min(0).max(2).optional().describe("Gap between caption runs as a multiple of base font size; default 0.35."),lineGapEm:d.number().min(0).max(2).optional().describe("Gap between caption lines as a multiple of base font size; default 0.25."),emphasisColor:d.string().optional(),emphasisGradient:d.string().optional(),emphasisScale:d.number().positive().optional(),emphasisFontFamily:d.string().optional(),emphasisFontWeight:d.number().int().min(100).max(900).optional(),emphasisTextTransform:d.enum(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:d.number().optional(),emphasisFontStyle:d.enum(["normal","italic"]).optional(),entrance:d.enum(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:d.number().nonnegative().optional(),entranceStaggerMs:d.number().nonnegative().optional(),exitMs:d.number().nonnegative().optional(),emphasisPlate:d.boolean().optional(),emphasisPlateColor:d.string().optional(),emphasisPlateTextColor:d.string().optional(),emphasisPlateAltColor:d.string().optional(),emphasisPlateAltTextColor:d.string().optional(),emphasisPlateRadius:d.number().nonnegative().optional(),emphasisPlatePadX:d.number().optional(),emphasisPlatePadY:d.number().optional(),emphasisPlateReveal:d.boolean().optional().describe("Grow a shared emphasis plate as saved words appear while reserving its final layout width."),annotationColor:d.string().optional(),annotationStrokeWidth:d.number().min(.5).max(12).optional().describe("Annotation stroke width in its 100\xD7100 SVG coordinate system; default 4."),annotationTexture:d.enum(["clean","pencil"]).optional().describe("Native annotation stroke finish; default clean."),maxWidthPercent:d.number().positive().max(100,"captions style.maxWidthPercent is % of composition width (max 100)").optional()}),_T=qa.pick({fontFamily:!0,fontSize:!0,fontWeight:!0,color:!0,highlightColor:!0,backgroundColor:!0,plate:!0,textTransform:!0,letterSpacing:!0,wordGapEm:!0,lineGapEm:!0,emphasisColor:!0,emphasisScale:!0,emphasisFontFamily:!0,emphasisFontWeight:!0,emphasisTextTransform:!0,emphasisLetterSpacing:!0,emphasisFontStyle:!0,emphasisPlate:!0,emphasisPlateColor:!0,emphasisPlateTextColor:!0,emphasisPlateAltColor:!0,emphasisPlateAltTextColor:!0,emphasisPlateRadius:!0,emphasisPlatePadX:!0,emphasisPlatePadY:!0,emphasisPlateReveal:!0,annotationColor:!0,annotationStrokeWidth:!0,annotationTexture:!0,entrance:!0,entranceMs:!0,entranceStaggerMs:!0,exitMs:!0}).strict(),BT=d.object({segmentIndex:d.number().int().nonnegative(),wordStartIndex:d.number().int().nonnegative(),wordEndIndex:d.number().int().positive().describe("Exclusive word index in the saved caption segment."),region:zm,scale:d.number().min(.25).max(4).optional(),rotation:d.number().min(-45).max(45).optional(),style:_T.optional(),holdThroughWordIndex:d.number().int().nonnegative().optional().describe("Inclusive saved-word index in this segment. The layout stays visible until that word ends."),wordMarks:d.array(d.object({wordIndex:d.number().int().nonnegative(),emphasis:d.boolean().optional(),annotate:d.enum(["circle","underline"]).nullable().optional()}).strict()).optional()}).strict(),xm=BT.extend({wordSignature:d.string().regex(/^[a-f0-9]{64}$/)});function jT(o){let e=JSON.stringify(o.map(t=>({text:t.text,startMs:t.startMs,endMs:t.endMs,emphasis:t.emphasis??null,annotate:t.annotate??null})));return Fd(Vd(new TextEncoder().encode(e)))}function VT(o,e,t=!1){let r=[],s=new Set;return e.forEach((a,p)=>{let u=o[a.segmentIndex]?.words;if(!u){r.push({index:p,field:"segmentIndex",message:"caption layout segment does not exist"});return}if(a.wordStartIndex>=a.wordEndIndex||a.wordEndIndex>u.length){r.push({index:p,field:"wordEndIndex",message:"caption layout word range is outside its segment"});return}let f=a.holdThroughWordIndex??a.wordEndIndex-1;(f<a.wordEndIndex-1||f>=u.length)&&r.push({index:p,field:"holdThroughWordIndex",message:"caption layout hold must reference this or a later word in the same segment"});let m=new Set;for(let x of a.wordMarks??[])(x.wordIndex<a.wordStartIndex||x.wordIndex>=a.wordEndIndex||m.has(x.wordIndex))&&r.push({index:p,field:"wordMarks",message:"caption layout word marks must be unique words inside the layout range"}),m.add(x.wordIndex);for(let x=a.wordStartIndex;x<a.wordEndIndex;x++){let g=`${a.segmentIndex}:${x}`;s.has(g)&&r.push({index:p,field:"wordStartIndex",message:"caption layout word ranges must not overlap"}),s.add(g)}t&&"wordSignature"in a&&a.wordSignature!==jT(u)&&r.push({index:p,field:"wordSignature",message:"caption layout is stale for these saved transcript words; reapply setCaptionLayouts"})}),r}var gm=d.object({words:d.array(NT)}),bm=d.enum(["front","behind-subject"]).optional(),UT=d.discriminatedUnion("source",[d.object({source:d.literal("derived"),from:d.object({clipId:d.string()}),segments:d.array(gm),style:qa.optional(),layouts:d.array(xm).optional(),zPlane:bm}),d.object({source:d.literal("authored"),segments:d.array(gm),style:qa.optional(),layouts:d.array(xm).optional(),zPlane:bm})]).superRefine((o,e)=>{if(o.style)for(let t of $r(o.style))e.addIssue({code:"custom",path:["style",t.field],message:t.message});for(let t of VT(o.segments,o.layouts??[],!0))e.addIssue({code:"custom",path:["layouts",t.index,t.field],message:t.message});for(let[t,r]of(o.layouts??[]).entries())for(let s of $r({...o.style,...r.style}))e.addIssue({code:"custom",path:["layouts",t,"style",s.field],message:s.message})});function HT(o){let e=[];return o.tracks.forEach((t,r)=>{t.contents.forEach((s,a)=>{!("source"in s)||s.captionVisibility===void 0||(t.kind!=="video"||s.source.kind!=="media")&&e.push({trackIndex:r,contentIndex:a})})}),e}var Qa=d.object({v:d.literal(1,{error:o=>o.input===void 0?'Missing version envelope: add top-level "v": 1 to the composition.':`Invalid version envelope: top-level "v" must be the literal 1 (got ${JSON.stringify(o.input)}).`}),format:Ya,tracks:d.array(PT),markers:d.array(LT).optional(),captions:UT.optional(),sourceSuggestionId:d.string().optional(),license:vT.optional(),licenseVerification:d.enum(["attested","cueframe-verified","third-party-verified"]).optional(),accessibility:FT.optional(),ownerOrgId:d.string().optional(),acl:DT.optional()}).strict().superRefine((o,e)=>{for(let t of HT(o))e.addIssue({code:"custom",path:["tracks",t.trackIndex,"contents",t.contentIndex,"captionVisibility"],message:"captionVisibility is supported only on video media clips"})}),WT=d.enum(["user","agent","import"]),mge=d.object({id:d.string().min(1),compositionId:Ue,predecessorId:d.string().optional(),createdAt:d.number(),etag:d.string().min(1),authorKind:WT,authorId:d.string().optional(),composition:Qa});var $T="gp-1",Ds=d.literal($T),Tm=Ls,tr=d.enum(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]),Ja=d.object({headline:d.string().max(120).optional(),sub:d.string().max(200).optional(),value:d.string().max(40).optional(),label:d.string().max(80).optional(),items:d.array(d.string().max(80)).max(8).optional(),series:d.array(d.object({label:d.string().max(40),value:d.string().max(16)})).max(8).optional()}).strict(),GT=d.object({id:d.string().min(1),atSec:d.number().min(0),durSec:d.number().positive(),role:tr,copy:Ja,intent:d.string().min(1).max(400),priority:d.number().int().min(0).max(10).default(5)}).strict(),KT=d.object({version:Ds,beats:d.array(GT)}).strict(),qT=d.enum(["headline","value","label","sublabel","logo","accent-shape","backdrop"]),YT=d.enum(["heading","body","accent","surface","on-accent","on-surface"]),QT=d.enum(["front","behind-subject"]),JT=d.object({elId:d.string().min(1),role:qT,box:Tm,styleRole:YT,z:QT.default("front"),text:d.string().max(200).optional(),typeScaleStep:d.number().int().min(0).max(8).optional()}).strict(),uo=1e-6,ZT=(o,e)=>o.x<e.x+e.w-uo&&o.x+o.w>e.x+uo&&o.y<e.y+e.h-uo&&o.y+o.h>e.y+uo,XT=d.object({version:Ds,beatId:d.string().min(1),frame:d.object({w:d.number().positive(),h:d.number().positive()}).strict(),keepOut:d.array(Tm),safe:d.object({titleSafe:d.number().min(0).max(1),actionSafe:d.number().min(0).max(1)}).strict(),elements:d.array(JT),dropped:d.object({reason:d.string().min(1)}).strict().optional()}).strict().superRefine((o,e)=>{for(let t of o.elements){if(t.z==="behind-subject")continue;let r=t.box;(r.x+r.w>1+uo||r.y+r.h>1+uo)&&e.addIssue({code:d.ZodIssueCode.custom,message:`element ${t.elId} box spills past the frame`,path:["elements"]});for(let s of o.keepOut)ZT(r,s)&&e.addIssue({code:d.ZodIssueCode.custom,message:`element ${t.elId} overlaps a face keep-out (text on the speaker)`,path:["elements"]})}}),eE=d.enum(["reveal","fade","rise","count-up","wipe"]),tE=d.enum(["pulse","underline","color-shift"]),oE=d.enum(["fade","fall","wipe","cut"]),rE=d.enum(["spring","ease-out","ease-in-out","linear"]),sE=d.object({type:eE,atMs:d.number().min(0),durMs:d.number().positive(),ease:rE.default("spring"),stagger:d.number().min(0).optional()}).strict(),nE=d.object({type:tE,atMs:d.number().min(0),durMs:d.number().positive()}).strict(),iE=d.object({type:oE,atMs:d.number().min(0),durMs:d.number().positive()}).strict(),aE=d.object({elId:d.string().min(1),enter:sE,emphasis:nE.optional(),exit:iE.optional()}).strict(),cE=d.object({version:Ds,beatId:d.string().min(1),elements:d.array(aE)}).strict(),yge=d.object({version:Ds,content:KT,layouts:d.array(XT),motions:d.array(cE)}).strict();var pE=d.discriminatedUnion("kind",[d.object({kind:d.literal("face"),faceId:d.string().min(1)}),d.object({kind:d.literal("all-faces")}),d.object({kind:d.literal("frame-center")}),d.object({kind:d.literal("active-speaker")}),d.object({kind:d.literal("point"),x:d.number().min(0).max(1),y:d.number().min(0).max(1)})]),dE=d.object({startSec:d.number().nonnegative(),endSec:d.number().positive(),action:d.enum(["frame","keep","trim"]).describe("'frame' = SHOW this span cropped/tracked per `subject`. 'keep' = SHOW this span as-is, no reframe (footage with nothing to track). 'trim' = DELETE this span from the output entirely \u2014 trimmed footage never appears."),subject:pE.optional(),shotScale:d.enum(["close","standard","wide"]).optional(),zoomScale:d.number().min(.4).max(1).optional(),verticalBias:d.number().min(-.3).max(.3).optional(),lateralBias:d.number().min(-.3).max(.3).optional(),intent:d.string().optional()}).refine(o=>o.action!=="frame"||o.subject!==void 0,{message:"frame segment requires a subject \u2014 for footage with no trackable subject use action:'keep' (shown as-is); do NOT trim spans you want shown"}).refine(o=>o.action!=="keep"||o.subject===void 0,{message:"keep segment shows footage as-is \u2014 it takes no subject (use action:'frame' to track one)"}).refine(o=>o.shotScale===void 0||o.zoomScale===void 0,{message:"framing segment takes EITHER shotScale (editorial scale \u2014 the bake calibrates the zoom to the detected face) OR zoomScale (an explicit fraction of the frame), never both: shotScale wins and the zoomScale would be silently discarded",path:["zoomScale"]}),lE=d.object({startSec:d.number().nonnegative(),endSec:d.number().positive(),reason:d.string().min(1)}),uE=d.object({id:d.string().min(1),atSec:d.number().nonnegative(),durSec:d.number().positive(),kind:d.enum(["broll","audio","sfx","music","ambience","gif","image"]),source:d.enum(["find","generate"]),intent:d.string().min(1),resolvedMediaId:d.string().optional()}),mE=d.object({id:d.string().min(1),atSec:d.number().nonnegative(),durSec:d.number().positive(),role:tr,copy:Ja,intent:d.string().min(1)}),hE=d.object({startSec:d.number().nonnegative(),endSec:d.number().nonnegative().optional(),kind:d.string().min(1),name:d.string().optional()}),Tge=d.object({framing:d.array(dE).min(1),cuts:d.array(lE).optional(),captions:d.object({styleIntent:d.string().optional()}).optional(),assets:d.array(uE).optional(),graphics:d.array(mE).optional(),markers:d.array(hE).optional()});var fE=d.union([d.enum(["linear","ease","ease-in","ease-out","ease-in-out"]),d.object({kind:d.literal("cubic-bezier"),x1:d.number().min(0).max(1),y1:d.number(),x2:d.number().min(0).max(1),y2:d.number()})]),xt=d.string().min(1),Za=d.union([d.object({kind:d.literal("system"),family:d.string().min(1),weight:d.number().int().min(1).max(1e3).optional(),style:d.enum(["normal","italic"]).optional()}),d.object({kind:d.literal("web"),family:d.string().min(1),url:d.string().url().optional(),weight:d.number().int().min(1).max(1e3).optional(),style:d.enum(["normal","italic"]).optional()}),d.object({kind:d.literal("uploaded"),fontId:Ue,family:d.string().optional(),weight:d.number().int().min(1).max(1e3).optional(),style:d.enum(["normal","italic"]).optional()})]),xE=d.object({primary:d.string().min(1),secondary:d.string().optional(),accent:d.string().min(1),background:d.string().min(1),text:d.string().min(1),textMuted:d.string().optional(),border:d.string().optional(),surface:d.string().optional(),card:d.string().optional(),gridLine:d.string().optional(),accentMuted:d.string().optional(),textOnAccent:d.string().optional(),textOnSurface:d.string().optional()}),gE=d.object({heading:Za,body:Za.optional(),caption:Za.optional()}),bE=d.object({base:d.number().positive().optional(),lg:d.number().positive().optional(),sm:d.number().positive().optional()}),yE=d.object({fontSizeHeading:d.number().positive().optional(),fontSizeBody:d.number().positive().optional(),fontSizeLabel:d.number().positive().optional(),borderRadius:d.number().nonnegative().optional()}),AE=d.object({duration:d.number().positive().optional(),easing:fE.optional(),entrance:d.enum(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:d.number().nonnegative().optional(),exitMs:d.number().nonnegative().optional()}),Cm=d.enum(["tl","tr","bl","br"]),SE=d.object({src:d.string().min(1),alt:d.string().optional(),placement:Cm.optional(),sizePct:d.number().positive().optional()}),Em=d.object({kind:d.enum(["card","video"]),src:d.string().min(1).optional(),title:d.string().optional(),subtitle:d.string().optional(),durationMs:d.number().positive().optional()}),zE=d.object({src:d.string().min(1),opacity:d.number().min(0).max(1).optional(),placement:Cm.optional()}),TE=d.discriminatedUnion("kind",[d.object({kind:d.literal("card"),html:ks,tokens:d.record(d.string(),d.string()).optional()}),d.object({kind:d.literal("overlay"),primitiveId:d.string().min(1),params:d.record(d.string(),d.unknown()).optional()}),d.object({kind:d.literal("component"),componentId:d.string().min(1),props:d.record(d.string(),d.unknown()).optional()})]),EE=d.enum(["fade-up","slide-in-left","slide-in-right","scale-pop","stagger-reveal"]),CE=d.object({id:d.string().min(1).max(40),observed:d.string().min(1).max(500),body:TE,motion:d.object({preset:EE,enterMs:d.number().int().min(0).max(5e3).optional(),exitMs:d.number().int().min(0).max(5e3).optional(),staggerMs:d.number().int().min(0).max(2e3).optional(),confidence:d.enum(["high","low"]).optional()}).optional(),role:tr,zone:d.object({x:d.number(),y:d.number(),w:d.number(),h:d.number()}).optional(),evidence:d.array(d.number().int().min(0)).max(24).optional(),diffScore:d.number().min(0).max(1).optional(),coverage:d.enum(["reproduced","approximated","skipped"]),skipReason:d.string().max(300).optional()}),IE=d.object({public:d.boolean().optional(),readerOrgIds:d.array(d.string()).optional(),writerOrgIds:d.array(d.string()).optional()}),RE=d.object({type:d.string().min(1),source:d.string().optional(),notes:d.string().optional()}),Mge=d.object({id:d.string().min(1),name:d.string().min(1),colors:xE,fonts:gE,syncCaptions:d.boolean().optional(),spacing:bE.optional(),sizing:yE.optional(),motion:AE.optional(),captionProfile:d.object({color:d.string().optional(),highlightColor:d.string().optional(),emphasisColor:d.string().optional(),plate:d.enum(["glass","solid","none"]).optional(),entrance:d.enum(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:d.number().optional(),entranceStaggerMs:d.number().optional(),exitMs:d.number().optional(),fontFamily:d.string().optional(),fontWeight:d.number().int().min(100).max(900).multipleOf(100).optional(),emphasisFontFamily:d.string().optional(),emphasisScale:d.number().positive().optional(),emphasisFontWeight:d.number().int().min(100).max(900).optional(),emphasisFontStyle:d.enum(["normal","italic"]).optional(),emphasisTextTransform:d.enum(["none","uppercase"]).optional(),emphasisLetterSpacing:d.number().optional(),emphasisPlate:d.boolean().optional(),emphasisPlateColor:d.string().optional(),emphasisPlateTextColor:d.string().optional()}).optional(),exemplarKeys:d.array(d.string().min(1)).max(24).optional(),contactSheetKey:d.string().min(1).optional(),motifs:d.array(CE).max(24).optional(),styleRubric:d.string().max(4e3).optional(),density:d.object({graphicsPerMin:d.number().min(0).max(60),maxSimultaneous:d.number().int().min(1).max(6)}).optional(),inspiration:d.object({sources:d.array(d.string()).min(1).max(24),extractedAt:d.number(),extractionVersion:d.string().min(1).max(60)}).optional(),logo:SE.optional(),intro:Em.optional(),outro:Em.optional(),watermark:zE.optional(),audio:d.object({sfxIntensity:d.enum(["off","light","standard","dense"]).optional(),musicEnabled:d.boolean().optional(),musicMood:d.string().max(300).optional(),sonicLogo:d.object({ref:xt,placement:d.enum(["intro","outro","both"]),offsetMs:d.number().int().min(0).max(1e4).optional()}).optional(),uiSoundSet:d.object({tick:xt.optional(),pop:xt.optional(),impact:xt.optional(),confirm:xt.optional(),error:xt.optional(),whoosh:xt.optional(),riser:xt.optional()}).optional(),bedStyle:d.object({bedId:xt.optional(),genre:d.string().max(120).optional(),bpmRange:d.object({min:d.number(),max:d.number()}).optional()}).optional(),ambiencePreference:d.object({ref:xt}).nullable().optional()}).optional(),license:RE.optional(),licenseVerification:d.enum(["attested","cueframe-verified","third-party-verified"]).optional(),ownerOrgId:d.string().optional(),acl:IE.optional()}).superRefine((o,e)=>{for(let t of Zd(o))e.addIssue({code:"custom",path:t.path.split("."),message:t.message})});var vge=d.object({id:Ue,name:d.string().min(1),defaultFormat:Ya.optional(),palConformDefault:d.union([d.literal(24),d.literal(30)]).optional(),activeCompositionId:Ue.nullable().optional(),brandKitId:d.string().optional(),ownerOrgId:d.string().optional(),createdAt:d.number(),updatedAt:d.number()});var wE=d.enum(["main","wide","facecam","screen","audio"]),OE=d.object({mediaId:Ue,role:wE,label:d.string().optional()}),ME=d.object({videoRole:d.enum(["main","wide","facecam","screen"]),audioRole:d.literal("audio")}),Bge=d.object({id:Ue,name:d.string().min(1),members:d.array(OE).nonempty(),mux:d.array(ME).optional(),ownerOrgId:d.string().optional(),createdAt:d.number(),updatedAt:d.number()});var Hge=d.enum(["render.completed","media.transcribed","media.completed","composition.updated"]),kE=d.enum(["pending","delivering","delivered","failed","exhausted"]),Wge=d.object({id:Ue,url:d.string().url(),events:d.array(d.string().min(1)).nonempty(),signingKeyId:d.string().optional(),headers:d.record(d.string(),d.string()).optional(),enabled:d.boolean().optional(),ownerOrgId:d.string().optional(),createdAt:d.number(),updatedAt:d.number()}),$ge=d.object({id:d.string().min(1),webhookId:Ue,event:d.string().min(1),payload:d.record(d.string(),d.unknown()),status:kE,attemptCount:d.number().int().nonnegative(),responseStatus:d.number().int().optional(),responseBody:d.string().optional(),error:d.string().optional(),createdAt:d.number(),deliveredAt:d.number().optional()});function rr(o){return"source"in o}function or(o){return o.startTime+o.duration}function PE(o){let e=[],t=[...o.contents].sort((r,s)=>r.startTime-s.startTime);for(let r=1;r<t.length;r++){let s=t[r-1],a=t[r];a.startTime<or(s)&&e.push({code:"track_clips_overlap",message:`Track ${o.id}: items ${s.id} and ${a.id} overlap at [${a.startTime}, ${Math.min(or(s),or(a))})`,details:{trackId:o.id,clipAId:s.id,clipBId:a.id,overlapRange:[a.startTime,Math.min(or(s),or(a))]}})}return e}function LE(o){let e=[];for(let t of o.contents){if(!rr(t))continue;DE(o.kind,t.source.kind)||e.push({code:"clip_source_track_kind_mismatch",message:`Track ${o.id} (kind=${o.kind}) cannot hold TimelineClip ${t.id} (source.kind=${t.source.kind})`,details:{trackId:o.id,clipId:t.id,sourceKind:t.source.kind,trackKind:o.kind}})}return e}function DE(o,e){switch(o){case"video":return e==="media"||e==="component"||e==="composition";case"audio":return e==="media"||e==="component";case"image":return e==="media"||e==="component";case"overlay":return e==="overlay"||e==="component"||e==="card";case"effect":return e==="effect"}}function vE(o){let e=[],t=[...o.contents].sort((r,s)=>r.startTime-s.startTime);for(let r=0;r<t.length;r++){let s=t[r];if(!rr(s)||!s.transitionIn)continue;let a=t[r-1];if(!a||!rr(a)){e.push({code:"transition_no_predecessor",message:`Track ${o.id}: TimelineClip ${s.id} has transitionIn but no TimelineClip predecessor`,details:{trackId:o.id,clipId:s.id}});continue}let p=s.transitionIn.duration,u=Math.min(a.duration,s.duration);p>u&&e.push({code:"transition_too_long",message:`Track ${o.id}: TimelineClip ${s.id} transitionIn.duration (${p}) exceeds available headroom (${u})`,details:{trackId:o.id,clipId:s.id,transitionDuration:p,available:u}})}return e}function FE(o){let e=[];for(let t of o.contents){if(!rr(t)||t.source.kind!=="media")continue;let r=t.source.excludedRanges;if(!r||r.length===0)continue;let s=t.source.trim,a=s?.start??0,p=t.source.playbackRate??1,u=s?.end??a+t.duration*p,f=-1/0,m=0,x=!1;for(let w=0;w<r.length;w++){let k=r[w];if(k.end<=k.start){e.push({code:"excluded_range_invalid",message:`Track ${o.id}: TimelineClip ${t.id} excludedRanges[${w}] end (${k.end}) must be > start (${k.start})`,details:{trackId:o.id,clipId:t.id,index:w,start:k.start,end:k.end}}),x=!0;break}if(k.start<a||k.end>u){e.push({code:"excluded_range_out_of_bounds",message:`Track ${o.id}: TimelineClip ${t.id} excludedRanges[${w}] [${k.start}, ${k.end}] outside trim [${a}, ${u}]`,details:{trackId:o.id,clipId:t.id,index:w,start:k.start,end:k.end,trimStart:a,trimEnd:u}}),x=!0;break}if(k.start<f){e.push({code:"excluded_range_overlap",message:`Track ${o.id}: TimelineClip ${t.id} excludedRanges[${w}] overlaps preceding range (start ${k.start} < prevEnd ${f})`,details:{trackId:o.id,clipId:t.id,index:w,start:k.start,prevEnd:f}}),x=!0;break}f=k.end,m+=k.end-k.start}if(x)continue;let g=u-a,z=(g-m)/p;Math.abs(z-t.duration)>.001&&e.push({code:"excluded_range_duration_mismatch",message:`Track ${o.id}: TimelineClip ${t.id} duration (${t.duration}) \u2260 (trimSpan (${g}) \u2212 \u03A3excluded (${m})) \xF7 playbackRate (${p}) = ${z}`,details:{trackId:o.id,clipId:t.id,expected:z,actual:t.duration,trimSpan:g,totalExcluded:m,playbackRate:p}})}return e}function NE(o){let e=[];for(let t of o.contents){if(!rr(t)||t.source.kind!=="media")continue;let r=t.source.trim;if(!r)continue;let s=t.source.playbackRate??1;if(!(s>0))continue;let a=t.source.excludedRanges;if(a&&a.length>0)continue;let p=r.end-r.start,u=p/s;Math.abs(u-t.duration)>.001&&e.push({code:"clip_duration_trim_mismatch",message:`Track ${o.id}: TimelineClip ${t.id} duration (${t.duration}) \u2260 trimSpan (${p}) \xF7 playbackRate (${s}) = ${u}`,details:{trackId:o.id,clipId:t.id,expected:u,actual:t.duration,trimSpan:p,playbackRate:s}})}return e}function _E(o){return[...PE(o),...LE(o),...vE(o),...FE(o),...NE(o)]}function Im(o){let e=[];for(let t of o.tracks)e.push(..._E(t));return e}var sr=o=>o.endTime??o.startTime;function Rm(o){let e=(o.markers??[]).filter(r=>r.kind==="scene").sort((r,s)=>r.startTime-s.startTime),t=[];for(let r=1;r<e.length;r++){let s=e[r-1],a=e[r];a.startTime<sr(s)&&t.push({code:"scene_marker_overlap",message:`Scene markers ${s.id} and ${a.id} overlap at [${a.startTime}, ${Math.min(sr(s),sr(a))})`,details:{markerAId:s.id,markerBId:a.id,overlapRange:[a.startTime,Math.min(sr(s),sr(a))]}})}return t}function wm(o){let e=new Map,t=[],r=(s,a)=>{let p=e.get(s);p?t.push({code:"composition_id_collision",message:`Id ${s} used by both ${p} and ${a}`,details:{id:s,existingKind:p,newKind:a}}):e.set(s,a)};for(let s of o.tracks){r(s.id,"track");for(let a of s.contents)r(a.id,"source"in a?"clip":"gap")}for(let s of o.markers??[])r(s.id,"marker");return t}function BE(o){let e=o.animate;if(!e)return[];let t=[];for(let[r,s]of Object.entries(e)){if(!s)continue;let a=[...s].sort((p,u)=>p.time-u.time);for(let p of a)p.time>o.duration+1e-6&&t.push({code:"varying_keyframe_time_out_of_range",message:`clip "${o.id}" animates "${r}" at ${p.time}s, past its own duration of ${o.duration}s \u2014 that keyframe can never be reached`,details:{clipId:o.id,param:r,time:p.time,duration:o.duration}});for(let p=1;p<a.length;p++)Math.abs(a[p].time-a[p-1].time)<1e-6&&t.push({code:"varying_keyframe_duplicate_time",message:`clip "${o.id}" has two "${r}" keyframes at ${a[p].time}s \u2014 the value at that instant is undefined`,details:{clipId:o.id,param:r,time:a[p].time}})}return t}function Om(o){let e=[];for(let t of o.tracks)for(let r of t.contents)"source"in r&&e.push(...BE(r));return e}function Mm(o){return[...wm(o),...Im(o),...Rm(o),...Om(o)]}var km=c({featureId:n().describe("Stable billing feature id."),name:n().describe("Human-readable feature name."),type:h(["metered","boolean","credit_system"]).describe("metered = a depleting/gauge quota (has balances); boolean = an on/off plan grant; credit_system = a spendable wallet the metered lines draw from."),unit:E([h(["cents","count","minutes","gb"]),G()]).describe("What `balance`/`includedUsage`/`usage` are COUNTED IN \u2014 do not assume. `exports` is output-MINUTES (not a number of renders), `compose`/`ai_tokens`/`compose_verify`/`generate` are CENTS of spend (not a number of calls), `compose_capture` is a count of stills, `storage` is GB, a credit system is cents (1 credit = $0.01). null = boolean feature, nothing to count."),included:P().nullable().describe("Does the CURRENT plan grant this feature? For a credit-funded feature (see `fundedBy`) this is true whenever the plan grants the funding wallet \u2014 spend is then bounded by `balance`, not by inclusion. false = not on this plan (a create gated on it 402s billing_required); null = unknown (billing not configured / no live data)."),unlimited:P().nullable().describe("Metered only: the plan grants an effectively-unlimited allowance. null = unknown / boolean feature."),balance:i().nullable().describe("Metered only: remaining balance for the current period, in THIS feature's unit. For a credit-funded feature it is the funding wallet's balance restated at `creditCost` credits per unit \u2014 a SHARE of a pool, not a private allowance. null = unknown / boolean feature."),includedUsage:i().nullable().describe("Metered only: the plan's included allowance (the period limit), in this feature's unit. null = unknown / boolean feature."),usage:i().nullable().describe("Metered only: amount consumed this period, in this feature's unit. null = unknown / boolean feature."),nextResetAt:i().nullable().describe("Metered only: epoch-ms when the period balance resets. null = unknown / no scheduled reset."),fundedBy:n().nullable().describe("The credit system that actually pays for this feature (always `credits` \u2014 there is one wallet). Non-null means the feature has NO separate allowance: its `balance` restates that shared wallet, and every other feature with the same `fundedBy` competes for the same money. null = the plan grants this feature directly."),creditCost:i().nullable().describe("Credits consumed per ONE unit of this feature (exports 50 = $0.50 per 1080p output-minute; compose_capture 2 = $0.02 per still). null = not credit-funded."),listUsdPerUnit:i().nullable().describe("LIST price in USD of ONE unit of this feature (see `unit`) \u2014 the quote to read BEFORE a call. Credit-funded: `creditCost`/100 (exports 0.5 per 1080p output-minute; compose_capture 0.02 per still; compose/ai_tokens/generate 0.015 per cent of provider cost). 0 = the plan grants this feature and it draws NO credits (resource_import: stock search AND import are free for a keyed caller, bytes count toward `storage`; brand_kits). null = not quotable up front (a wallet, a gauge, or a feature the plan does not grant).")}).describe("A single feature's entitlement: whether the plan includes it, remaining/limit when metered, and the per-unit list price to quote before a call");var jE=c({generationLimit:E([c({applies:P(),unit:b("cents_of_provider_cost"),cap:i().nullable(),spent:i().nullable(),remaining:i().nullable()}),G()]).describe("Separate lifetime generation cap before a credit-pack purchase. Wallet balance is still shared; generation must also fit this remaining provider-cost allowance. null means unknown."),orgId:n().describe("The org this API key is bound to \u2014 resolved server-side from the Authorization credential, NEVER from the request body/query."),displayName:n().nullable().describe("Org/customer display name from the billing record; null when not set or unknown."),plan:E([c({id:n().describe("Plan/product id (e.g. free, pro, business, studio)."),name:n().nullable().describe("Plan display name.")}),G()]).describe("The customer's current base plan/tier. null = unknown (billing not configured, or no active plan resolvable yet)."),entitlements:O(n(),km).describe("Per-feature entitlements keyed by featureId. Covers the billing-gated capabilities: `exports` gates create_render AND generate_media output; `compose` gates compose; `brand_kits` gates create_brand_kit; `resource_import` gates import_resource (a boolean grant: `listUsdPerUnit` 0 \u2014 stock search and import cost no credits for a keyed caller); plus ai_tokens/storage/compose_verify/compose_capture/etc. Read `listUsdPerUnit` for what one unit costs before you spend it. Most capabilities are CREDIT-FUNDED \u2014 `included` is true and the real limit is `balance`, drawn from the shared wallet named in `fundedBy` (`credits` \u2014 generation included; a free org is additionally bounded by a generation cap). So read `balance`, not `included`, to decide whether you can afford a call; `included:false` means the plan genuinely lacks the feature. Check BEFORE a metered call to avoid a mid-workflow 402 billing_required (whose error `details.featureId` names the gating feature)."),costCeilings:c({generateMediaUsdPerCall:i().nullable().describe("Per-call USD ceiling for generate_media: a generation whose ESTIMATE exceeds this 402s (generation_budget_exceeded) before any spend. Right-size the prompt/duration under this. null = unknown.")}).describe("Discoverable per-call cost ceilings so an agent can price/right-size a request before a guaranteed 402."),billingConfigured:P().describe("false = billing is not configured in this environment, so plan/entitlement values are best-effort and may be null (unknown), not authoritative."),surfaces:c({console:n().describe("Origin of the authenticated web console."),usage:n().describe("Browser URL for the usage ledger."),billing:n().describe("Browser URL for plan and credits."),apiKeys:n().describe("Browser URL for minting and revoking API keys."),project:G().describe("No per-project browser view exists yet, so there is no URL to hand a user for a project or its composition. Stated as an explicit null so a client does not construct a route that 404s (CUE-19). Show a rendered frame (preview_frame) or a completed render instead.")}).describe('The browser URLs that actually exist, so an agent asked to "show me" can hand the user a real link instead of guessing one from an id. A null means the surface is not built, not that it is hidden from this key.')}).describe("Account discovery for the authenticated key: identity + plan + entitlements + cost ceilings + the browser surfaces that exist. Read this to see what your plan/credits allow before a metered call (create_render / compose / generate_media / create_brand_kit).");var VE=0,UE=9007199254740991,HE=c({name:n().min(1),permissions:O(n(),y(h(["read","write"])).min(1)).describe("Resource \u2192 actions grant. Resources: media, sessions, projects, renders, webhooks, billing. Actions: read, write. Least-privilege \u2014 grant only what's needed (billing:write is required to start a checkout)."),expiresIn:A().gt(VE).max(UE).optional().describe("Lifetime in seconds; omit for no expiry.")});var WE=c({key:n().describe("The full secret key (cf_test_\u2026 / cf_live_\u2026). Shown ONCE \u2014 store it now."),id:n(),prefix:n(),start:n().describe("First chars of the key, for later identification.")});var Pm=c({ref:n().describe("Placement handle: a pack soundId/bedId, or an org media id."),role:h(["vo","music","sfx","ambience"]).describe("Declared role for mix policy."),envelopeClass:h(["transient","sweep","ambient"]).describe("Coarse envelope shape \u2014 the browse grouping."),description:n(),durationSec:i(),evidence:c({envelopeClass:h(["transient","sweep","ambient"]),attackMs:i().optional(),spectralCentroidHz:i().optional(),meanVolumeDb:i().optional(),maxVolumeDb:i().optional()}).describe("Envelope probe evidence (always carries envelopeClass)."),source:h(["pack","org","generated"]).describe("Provenance discriminant."),license:n().describe('"CC0" (pack), "org-owned"/a CC token (org), or "generated".'),provenance:n().describe("Human-legible provenance (pack attribution / org-owned / generator + prompt)."),bpm:i().optional().describe("Tempo \u2014 present for music-role entries."),mood:y(n()).optional().describe("Editorial mood tags \u2014 present for pack music beds.")});var Lm=c({id:n().describe("Billing catalog product id (e.g. pro, pro_yearly)."),tier:n().describe("Plan tier: pro | business | studio."),name:n(),interval:n().describe("month | year."),priceUsd:i().describe("Price in USD for the interval.")});var $E=c({plans:y(Lm).describe("Every purchasable {tier, interval} and its product id."),billingConfigured:P()});var GE=200,KE=200,qE=2e3,YE=500,QE=500,JE=5e3,ZE=0,XE=1,eC=300,tC=0,oC=1e4,rC=120,sC=24,nC=40,iC=500,aC=0,cC=5e3,pC=0,dC=5e3,lC=0,uC=2e3,mC=0,hC=9007199254740991,fC=24,xC=0,gC=1,bC=300,yC=24,AC=4e3,SC=0,zC=60,TC=6,EC=24,CC=60,Dm=c({kitId:n().min(1).max(GE),name:n().min(1).max(KE),description:n().max(qE).optional(),tagline:n().max(YE).optional(),secondaryTagline:n().max(QE).optional(),colors:c({primary:n().min(1),secondary:n().min(1),accent:n().min(1),background:n().min(1),text:n().min(1)}),extraColors:y(c({hex:n().min(1),label:n().min(1),usage:n().optional()})).optional(),headingFont:c({fontFamily:n().min(1),fontWeight:i()}),bodyFont:c({fontFamily:n().min(1),fontWeight:i()}),voiceGuidelines:n().max(JE).optional(),syncCaptions:P().optional(),captionProfile:c({fontFamily:n().optional(),fontSize:i().optional(),fontWeight:i().optional(),color:n().optional(),highlightColor:n().optional(),backgroundColor:n().optional(),plate:h(["glass","solid","none"]).optional(),position:h(["top","center","bottom"]).optional(),textTransform:h(["none","uppercase"]).optional(),entrance:h(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:i().optional(),entranceStaggerMs:i().optional(),exitMs:i().optional(),emphasisColor:n().optional(),emphasisScale:i().optional(),emphasisFontFamily:n().optional(),emphasisFontWeight:i().optional(),emphasisFontStyle:h(["normal","italic"]).optional(),emphasisTextTransform:h(["none","uppercase"]).optional(),emphasisLetterSpacing:i().optional(),emphasisPlate:P().optional(),emphasisPlateColor:n().optional(),emphasisPlateTextColor:n().optional()}).optional(),motion:c({duration:i().optional(),easing:E([h(["linear","ease","ease-in","ease-out","ease-in-out"]),c({kind:b("cubic-bezier"),x1:i(),y1:i(),x2:i(),y2:i()})]).optional(),entrance:h(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:i().optional(),exitMs:i().optional()}).optional(),logo:c({src:n().min(1),alt:n().optional(),placement:h(["tl","tr","bl","br"]).optional(),sizePct:i().optional()}).optional(),intro:c({kind:h(["card","video"]),src:n().min(1).optional(),title:n().optional(),subtitle:n().optional(),durationMs:i().optional()}).optional(),outro:c({kind:h(["card","video"]),src:n().min(1).optional(),title:n().optional(),subtitle:n().optional(),durationMs:i().optional()}).optional(),watermark:c({src:n().min(1),opacity:i().min(ZE).max(XE).optional(),placement:h(["tl","tr","bl","br"]).optional()}).optional(),spacing:c({base:i().optional(),lg:i().optional(),sm:i().optional()}).optional(),sizing:c({fontSizeHeading:i().optional(),fontSizeBody:i().optional(),fontSizeLabel:i().optional(),borderRadius:i().optional()}).optional(),audio:c({sfxIntensity:h(["off","light","standard","dense"]).optional(),musicEnabled:P().optional(),musicMood:n().max(eC).optional(),sonicLogo:c({ref:n().min(1),placement:h(["intro","outro","both"]),offsetMs:A().min(tC).max(oC).optional()}).optional().describe("A brand sound signature bound to the intro/outro bookend. `ref` = a palette reference; bound only when the kit carries the matching bumper (intro/outro), else a non-blocking advisory."),uiSoundSet:c({tick:n().min(1).optional(),pop:n().min(1).optional(),impact:n().min(1).optional(),confirm:n().min(1).optional(),error:n().min(1).optional(),whoosh:n().min(1).optional(),riser:n().min(1).optional()}).optional().describe("Per-family SFX overrides (the brand's own tick/pop/\u2026). Highest-priority tier over the org palette + pack default in the compose SFX draw."),bedStyle:c({bedId:n().min(1).optional(),genre:n().max(rC).optional(),bpmRange:c({min:i(),max:i()}).optional()}).optional().describe("Preferred music bed (`bedId`) or a style hint (`genre` / `bpmRange`). Surfaced for driving agents; compose does not auto-select a pack bed."),ambiencePreference:E([c({ref:n().min(1)}),G()]).optional().describe("Preferred ambience bed (`{ref}`) or explicit null (opt-out). Surfaced for driving agents; compose has no ambience auto-placement.")}).optional(),exemplarKeys:y(n().min(1)).max(sC).optional(),contactSheetKey:n().min(1).optional(),motifs:y(c({id:n().min(1).max(nC),observed:n().min(1).max(iC),body:E([c({kind:b("card"),html:n().min(1),tokens:O(n(),n()).optional()}),c({kind:b("overlay"),primitiveId:n().min(1),params:O(n(),L()).optional()}),c({kind:b("component"),componentId:n().min(1),props:O(n(),L()).optional()})]),motion:c({preset:h(["fade-up","slide-in-left","slide-in-right","scale-pop","stagger-reveal"]),enterMs:A().min(aC).max(cC).optional(),exitMs:A().min(pC).max(dC).optional(),staggerMs:A().min(lC).max(uC).optional(),confidence:h(["high","low"]).optional()}).optional(),role:h(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]),zone:c({x:i(),y:i(),w:i(),h:i()}).optional(),evidence:y(A().min(mC).max(hC)).max(fC).optional(),diffScore:i().min(xC).max(gC).optional(),coverage:h(["reproduced","approximated","skipped"]),skipReason:n().max(bC).optional()})).max(yC).optional(),styleRubric:n().max(AC).optional(),density:c({graphicsPerMin:i().min(SC).max(zC),maxSimultaneous:A().min(1).max(TC)}).optional(),inspiration:c({sources:y(n()).min(1).max(EC),extractedAt:i(),extractionVersion:n().min(1).max(CC)}).optional()}).describe("POST /brand-kits body. Org/user are server-resolved; never accepted from the body.");var IC=12,RC=c({motifId:n().min(1).optional(),limit:A().min(1).max(IC).optional()}).describe("POST /brand-kits/{id}/exemplars body \u2014 select which exemplar frames to presign.");var wC=-9007199254740991,OC=9007199254740991,MC=c({exemplars:y(c({index:A().min(wC).max(OC),url:n()})),contactSheetUrl:n().optional()});var kC=300,PC=0,LC=1e4,DC=120,vC=24,FC=40,NC=500,_C=0,BC=5e3,jC=0,VC=5e3,UC=0,HC=2e3,WC=0,$C=9007199254740991,GC=24,KC=0,qC=1,YC=300,QC=24,JC=4e3,ZC=0,XC=60,eI=6,tI=24,oI=60,nr=c({id:n(),name:n(),description:n().nullable(),tagline:n().nullable(),colors:O(n(),n()),extraColors:y(c({name:n(),value:n()})).optional(),fonts:c({heading:E([c({family:n(),weight:E([i(),n()]).optional()}),G()]),body:E([c({family:n(),weight:E([i(),n()]).optional()}),G()])}),voiceGuidelines:n().nullable(),captions:c({sync:P(),profile:E([O(n(),L()),G()])}),motion:c({duration:i().optional(),easing:E([h(["linear","ease","ease-in","ease-out","ease-in-out"]),c({kind:b("cubic-bezier"),x1:i(),y1:i(),x2:i(),y2:i()})]).optional(),entrance:h(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:i().optional(),exitMs:i().optional()}).optional(),logo:c({src:n(),alt:n().optional(),placement:h(["tl","tr","bl","br"]).optional(),sizePct:i().optional()}).optional(),intro:c({kind:h(["card","video"]),src:n().optional(),title:n().optional(),subtitle:n().optional(),durationMs:i().optional()}).optional(),outro:c({kind:h(["card","video"]),src:n().optional(),title:n().optional(),subtitle:n().optional(),durationMs:i().optional()}).optional(),watermark:c({src:n(),opacity:i().optional(),placement:h(["tl","tr","bl","br"]).optional()}).optional(),spacing:c({base:i().optional(),lg:i().optional(),sm:i().optional()}).optional(),sizing:c({fontSizeHeading:i().optional(),fontSizeBody:i().optional(),fontSizeLabel:i().optional(),borderRadius:i().optional()}).optional(),audio:c({sfxIntensity:h(["off","light","standard","dense"]).optional(),musicEnabled:P().optional(),musicMood:n().max(kC).optional(),sonicLogo:c({ref:n().min(1),placement:h(["intro","outro","both"]),offsetMs:A().min(PC).max(LC).optional()}).optional().describe("A brand sound signature bound to the intro/outro bookend. `ref` = a palette reference; bound only when the kit carries the matching bumper (intro/outro), else a non-blocking advisory."),uiSoundSet:c({tick:n().min(1).optional(),pop:n().min(1).optional(),impact:n().min(1).optional(),confirm:n().min(1).optional(),error:n().min(1).optional(),whoosh:n().min(1).optional(),riser:n().min(1).optional()}).optional().describe("Per-family SFX overrides (the brand's own tick/pop/\u2026). Highest-priority tier over the org palette + pack default in the compose SFX draw."),bedStyle:c({bedId:n().min(1).optional(),genre:n().max(DC).optional(),bpmRange:c({min:i(),max:i()}).optional()}).optional().describe("Preferred music bed (`bedId`) or a style hint (`genre` / `bpmRange`). Surfaced for driving agents; compose does not auto-select a pack bed."),ambiencePreference:E([c({ref:n().min(1)}),G()]).optional().describe("Preferred ambience bed (`{ref}`) or explicit null (opt-out). Surfaced for driving agents; compose has no ambience auto-placement.")}).optional(),exemplarKeys:y(n().min(1)).max(vC).optional(),contactSheetKey:n().min(1).optional(),motifs:y(c({id:n().min(1).max(FC),observed:n().min(1).max(NC),body:E([c({kind:b("card"),html:n().min(1),tokens:O(n(),n()).optional()}),c({kind:b("overlay"),primitiveId:n().min(1),params:O(n(),L()).optional()}),c({kind:b("component"),componentId:n().min(1),props:O(n(),L()).optional()})]),motion:c({preset:h(["fade-up","slide-in-left","slide-in-right","scale-pop","stagger-reveal"]),enterMs:A().min(_C).max(BC).optional(),exitMs:A().min(jC).max(VC).optional(),staggerMs:A().min(UC).max(HC).optional(),confidence:h(["high","low"]).optional()}).optional(),role:h(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]),zone:c({x:i(),y:i(),w:i(),h:i()}).optional(),evidence:y(A().min(WC).max($C)).max(GC).optional(),diffScore:i().min(KC).max(qC).optional(),coverage:h(["reproduced","approximated","skipped"]),skipReason:n().max(YC).optional()})).max(QC).optional(),styleRubric:n().max(JC).optional(),density:c({graphicsPerMin:i().min(ZC).max(XC),maxSimultaneous:A().min(1).max(eI)}).optional(),inspiration:c({sources:y(n()).min(1).max(tI),extractedAt:i(),extractionVersion:n().min(1).max(oI)}).optional(),createdAt:n(),updatedAt:n()}).describe("Brand kit response per \xA7Brand Kits.");var be=c({hasMore:P(),nextCursor:n().nullable(),prevCursor:n().nullable()}).describe("Cursor pagination metadata.");var rI=c({data:y(nr),pagination:be});var sI=300,mo=c({music:c({enabled:P().describe("Whether the compose carries a music bed."),mood:n().max(sI).optional().describe("Freeform mood/genre prompt for the GENERATED bed (e.g. 'understated editorial, warm'). Ignored when mediaId pins a track."),mediaId:n().min(1).optional().describe("Pin a client-imported track as the bed. HONOR-OR-REFUSE: must be an org-owned kind:'audio' media item, else 422 \u2014 never accept-and-ignore. Absent \u21D2 generate from mood.")}).optional(),sfx:c({intensity:h(["off","light","standard","dense"]).describe("SFX placement density. Real-footage content keeps restraint caps regardless ('dense' is the explicit opt-out); generated/graphic-led content unlocks the standard tier.")}).optional()});var nI=0,iI=0,aI=0,cI=80,pI=8,ho=c({id:n().min(1),intent:n().min(1).describe("What this beat DOES editorially (hook the claim, prove it, CTA\u2026)."),durationSec:i().gt(nI).optional(),source:c({mediaId:n().min(1),startSec:i().min(iI),endSec:i().gt(aI)}).optional().describe("MOMENT PINNING: this beat uses EXACTLY this window of this media item \u2014 honored to-the-frame or refused. v1: every sourced beat must reference the SAME mediaId (multi-source briefs are refused loudly, not silently merged)."),graphic:c({role:h(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]).describe("The mandated graphic's editorial role (the graphics-plan GraphicRole vocabulary)."),items:y(n().min(1).max(cI)).max(pI).optional().describe("Mandated list items (enumeration/sequence) \u2014 carried VERBATIM into the plan's copy.items.")}).optional().describe("GRAPHICS MANDATE: the plan MUST carry a graphics request of this role overlapping this beat's window \u2014 enforced at the plan gate (honor-or-refuse, like moment pinning). Prose mustIncludes reaches only the judge; this is the checkable form.")});var fo=h(["overlay","component","card","no-transitions"]);var dI=3,xo=c({holdAt:y(h(["content","layout","motion"])).max(dI).optional().describe("Checkpoint gates \u2014 the compose pauses at each named stage for review via resume. DEFAULT (gates absent): the compose holds at EVERY stage \u2014 your agent reviews and resumes each one; an unreviewed checkpoint times out loudly after 60min. Auto-progression is the opt-in (gates.autoApprove: true)."),autoApprove:P().optional().describe("true = fully autonomous (compose runs with NO gates \u2014 the headless opt-in; without it a brief holds at every stage by default). Mutually exclusive with a non-empty holdAt."),reviewMode:h(["agent","hosted"]).optional().describe("Who captures the review decision. Default 'agent': you relay the packet and call resume. 'hosted': every checkpoint mints a review-page URL (checkpoint.ready payload + get_checkpoint's reviewUrl) where a human approves/revises from the browser \u2014 no account, no agent session; the recorded decision rides the SAME resume rail and you learn of it via checkpoint webhooks / wait_job.")});var ye=c({aspectRatio:h(["16:9","9:16","1:1","4:5"]),fps:E([b(24),b(25),b(30),b(60)]).optional(),resolution:h(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format.");var lI=200,uI=2e3,mI=500,hI=100,fI=0,xI=3600,gI=500,bI=500,yI=35,AI=500,SI=2e3,zI=24,TI=24,EI=12,CI=24,II=0,RI=0,wI=0,OI=0,MI=0,kI=0,PI=0,LI=4,DI=0,vI=0,FI=0,NI=0,_I=0,BI=0,jI=0,VI=0,UI=0,HI=1,WI=0,$I=1,GI=.1,KI=1,qI=0,YI=0,QI=-.3,JI=.3,ZI=-.3,XI=.3,eR=0,tR=1,oR=0,rR=1,sR=-.3,nR=.3,iR=0,aR=1,cR=0,pR=-1,dR=2,lR=-1,uR=2,mR=0,hR=1,fR=0,xR=1,gR=0,bR=1,yR=0,AR=1,SR=0,zR=0,TR=2,ER=16,CR=8,IR=c({projectId:n().min(1),name:n().max(lI).optional(),goal:n().min(1).max(uI).describe("What the video must accomplish."),audience:n().max(mI).optional(),platform:n().max(hI).optional(),format:ye.optional(),durationSec:i().gt(fI).max(xI).optional().describe("Target output duration. HONOR-OR-REFUSE: compose validates it against the beat-source window (\xB11.5s) and refuses a brief it cannot honor."),tone:n().max(gI).optional(),cta:n().max(bI).optional(),locale:n().max(yI).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:n().max(AI).optional(),caption:n().max(SI).optional(),beats:y(ho).max(zI).optional(),mustIncludes:y(n().min(1)).max(TI).optional(),references:y(n()).max(EI).optional(),captions:c({styleId:n().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:y(n().min(1)).max(CI).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).optional(),motionStyle:c({textAnimation:n().optional(),transitions:n().optional(),colorMood:n().optional(),captionStyle:n().optional()}).optional(),seededGraphics:y(c({id:n().min(1),startTime:i().min(II).describe("Timeline start (seconds)."),duration:i().gt(RI).describe("Clip duration (seconds)."),source:E([c({kind:b("media"),mediaId:n().min(1),trim:c({start:i().min(wI).describe("Source trim start (seconds)."),end:i().min(OI).describe("Source trim end (seconds).")}).optional(),excludedRanges:y(c({start:i().min(MI),end:i().min(kI),reason:n().optional()})).optional(),volume:i().min(PI).max(LI).optional(),muted:P().optional(),playbackRate:i().gt(DI).optional(),sync:h(["video","independent"]).optional(),kenBurns:h(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:i().optional(),fadeInMs:i().min(vI).optional(),fadeOutMs:i().min(FI).optional(),loop:P().optional(),audioRole:h(["sfx","music","vo","ambience"]).optional(),duck:c({duckDb:i().max(NI),attackMs:i().min(_I),releaseMs:i().min(BI),windows:y(c({startMs:i(),endMs:i()})).optional()}).optional(),anchor:c({clipId:n().min(1),offsetMs:i()}).optional(),reframe:c({segments:y(c({startSec:i().min(jI).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(VI).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:E([c({mode:b("frame-center")}),c({mode:b("point"),x:i().min(UI).max(HI),y:i().min(WI).max($I)}),c({mode:b("face"),faceId:n().min(1),shotScale:h(["close","standard","wide"]).optional()}),c({mode:b("all-faces")}),c({mode:b("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:n().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(GI).max(KI).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:c({in:i().min(qI).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(YI).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:c({x:i().min(QI).max(JI).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(ZI).max(XI).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),c({kind:b("component"),componentId:n().min(1),props:O(n(),L()),assets:O(n(),n().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:h(["front","behind-subject"]).optional()}),c({kind:b("overlay"),primitiveId:n().min(1),params:O(n(),L()),zPlane:h(["front","behind-subject"]).optional(),anchor:c({space:b("scene"),x:i().min(eR).max(tR),y:i().min(oR).max(rR)}).optional(),parallax:i().min(sR).max(nR).optional()}),c({kind:b("effect"),primitiveId:n().min(1),params:O(n(),L()).optional()}),c({kind:b("card"),html:n().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),tokens:O(n(),n()).optional(),zPlane:b("front").optional()})]),kind:h(["video","audio","image","overlay","effect"]).optional(),opacity:i().min(iR).max(aR).optional(),scale:i().gt(cR).optional(),rotation:i().optional(),position:c({x:i().min(pR).max(dR),y:i().min(lR).max(uR)}).optional().describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),region:c({x:i().min(mR).max(hR),y:i().min(fR).max(xR),w:i().gt(gR).max(bR),h:i().gt(yR).max(AR)}).optional(),fit:h(["cover","contain"]).optional(),captionVisibility:h(["visible","hidden"]).optional().describe("Video media clip only. Hide native captions while this clip is topmost and covers the lower picture, or when an opaque, effect-free clip has an explicitly full-frame region, even with fit:contain. Caption words and timings remain stored and resume when another visible clip takes over."),effects:y(c({primitiveId:n().min(1),params:O(n(),L()).optional()})).optional(),transitionIn:c({type:n().min(1),duration:i().gt(SR)}).optional(),linkGroupId:n().min(1).optional(),animate:O(n(),y(c({time:i().min(zR),value:i(),easing:E([h(["linear","ease","easeIn","easeOut","easeInOut"]),c({cubicBezier:H([i(),i(),i(),i()])})]).optional()})).min(TR)).optional().describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.")})).max(ER).optional().describe("Client-authored graphic clips the Director must carry VERBATIM: seeded into the design loop's base composition as LOCKED clips (never re-authored, never discarded)."),exclusions:y(fo).max(CR).optional(),gates:xo.optional(),audio:mo.optional()});var RR=-9007199254740991,wR=9007199254740991,vm=c({composeUsd:i(),renderUsdPerExport:i(),estimatedJourneyUsd:i().describe("compose + expected renders \u2014 relay this BEFORE composing."),revisionCyclesIncluded:A().min(RR).max(wR).describe("Revise cycles the compose price includes per gate (A1). Beyond this, resume(revise) is refused with `revision_cycles_exhausted` \u2014 saying no never silently charges.")});var OR=200,MR=2e3,kR=500,PR=100,LR=0,DR=3600,vR=500,FR=500,NR=35,_R=500,BR=2e3,jR=24,VR=24,UR=12,HR=24,WR=0,$R=0,GR=0,KR=0,qR=0,YR=0,QR=0,JR=4,ZR=0,XR=0,ew=0,tw=0,ow=0,rw=0,sw=0,nw=0,iw=0,aw=1,cw=0,pw=1,dw=.1,lw=1,uw=0,mw=0,hw=-.3,fw=.3,xw=-.3,gw=.3,bw=0,yw=1,Aw=0,Sw=1,zw=-.3,Tw=.3,Ew=0,Cw=1,Iw=0,Rw=-1,ww=2,Ow=-1,Mw=2,kw=0,Pw=1,Lw=0,Dw=1,vw=0,Fw=1,Nw=0,_w=1,Bw=0,jw=0,Vw=2,Uw=16,Hw=8,Xa=c({id:n(),projectId:n(),kind:h(["authored","clip"]).describe("authored = create_brief; clip = minted by suggest_briefs from an AI clip suggestion."),sourceSuggestionId:n().optional().describe("kind:'clip' provenance \u2014 the suggestion this Brief was minted from."),name:n().max(OR).optional(),goal:n().min(1).max(MR).describe("What the video must accomplish."),audience:n().max(kR).optional(),platform:n().max(PR).optional(),format:ye.optional(),durationSec:i().gt(LR).max(DR).optional().describe("Target output duration. HONOR-OR-REFUSE: compose validates it against the beat-source window (\xB11.5s) and refuses a brief it cannot honor."),tone:n().max(vR).optional(),cta:n().max(FR).optional(),locale:n().max(NR).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:n().max(_R).optional(),caption:n().max(BR).optional(),beats:y(ho).max(jR).optional(),mustIncludes:y(n().min(1)).max(VR).optional(),references:y(n()).max(UR).optional(),captions:c({styleId:n().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:y(n().min(1)).max(HR).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).optional(),motionStyle:c({textAnimation:n().optional(),transitions:n().optional(),colorMood:n().optional(),captionStyle:n().optional()}).optional(),seededGraphics:y(c({id:n().min(1),startTime:i().min(WR).describe("Timeline start (seconds)."),duration:i().gt($R).describe("Clip duration (seconds)."),source:E([c({kind:b("media"),mediaId:n().min(1),trim:c({start:i().min(GR).describe("Source trim start (seconds)."),end:i().min(KR).describe("Source trim end (seconds).")}).optional(),excludedRanges:y(c({start:i().min(qR),end:i().min(YR),reason:n().optional()})).optional(),volume:i().min(QR).max(JR).optional(),muted:P().optional(),playbackRate:i().gt(ZR).optional(),sync:h(["video","independent"]).optional(),kenBurns:h(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:i().optional(),fadeInMs:i().min(XR).optional(),fadeOutMs:i().min(ew).optional(),loop:P().optional(),audioRole:h(["sfx","music","vo","ambience"]).optional(),duck:c({duckDb:i().max(tw),attackMs:i().min(ow),releaseMs:i().min(rw),windows:y(c({startMs:i(),endMs:i()})).optional()}).optional(),anchor:c({clipId:n().min(1),offsetMs:i()}).optional(),reframe:c({segments:y(c({startSec:i().min(sw).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(nw).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:E([c({mode:b("frame-center")}),c({mode:b("point"),x:i().min(iw).max(aw),y:i().min(cw).max(pw)}),c({mode:b("face"),faceId:n().min(1),shotScale:h(["close","standard","wide"]).optional()}),c({mode:b("all-faces")}),c({mode:b("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:n().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(dw).max(lw).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:c({in:i().min(uw).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(mw).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:c({x:i().min(hw).max(fw).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(xw).max(gw).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),c({kind:b("component"),componentId:n().min(1),props:O(n(),L()),assets:O(n(),n().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:h(["front","behind-subject"]).optional()}),c({kind:b("overlay"),primitiveId:n().min(1),params:O(n(),L()),zPlane:h(["front","behind-subject"]).optional(),anchor:c({space:b("scene"),x:i().min(bw).max(yw),y:i().min(Aw).max(Sw)}).optional(),parallax:i().min(zw).max(Tw).optional()}),c({kind:b("effect"),primitiveId:n().min(1),params:O(n(),L()).optional()}),c({kind:b("card"),html:n().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),tokens:O(n(),n()).optional(),zPlane:b("front").optional()})]),kind:h(["video","audio","image","overlay","effect"]).optional(),opacity:i().min(Ew).max(Cw).optional(),scale:i().gt(Iw).optional(),rotation:i().optional(),position:c({x:i().min(Rw).max(ww),y:i().min(Ow).max(Mw)}).optional().describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),region:c({x:i().min(kw).max(Pw),y:i().min(Lw).max(Dw),w:i().gt(vw).max(Fw),h:i().gt(Nw).max(_w)}).optional(),fit:h(["cover","contain"]).optional(),captionVisibility:h(["visible","hidden"]).optional().describe("Video media clip only. Hide native captions while this clip is topmost and covers the lower picture, or when an opaque, effect-free clip has an explicitly full-frame region, even with fit:contain. Caption words and timings remain stored and resume when another visible clip takes over."),effects:y(c({primitiveId:n().min(1),params:O(n(),L()).optional()})).optional(),transitionIn:c({type:n().min(1),duration:i().gt(Bw)}).optional(),linkGroupId:n().min(1).optional(),animate:O(n(),y(c({time:i().min(jw),value:i(),easing:E([h(["linear","ease","easeIn","easeOut","easeInOut"]),c({cubicBezier:H([i(),i(),i(),i()])})]).optional()})).min(Vw)).optional().describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.")})).max(Uw).optional().describe("Client-authored graphic clips the Director must carry VERBATIM: seeded into the design loop's base composition as LOCKED clips (never re-authored, never discarded)."),exclusions:y(fo).max(Hw).optional(),gates:xo.optional(),audio:mo.optional(),quote:vm,createdAt:i(),updatedAt:i()});var Ww=c({data:y(Xa),pagination:be});var $w=200,Gw=2e3,Kw=500,qw=100,Yw=0,Qw=3600,Jw=500,Zw=500,Xw=35,eO=500,tO=2e3,oO=24,rO=24,sO=12,nO=24,iO=0,aO=0,cO=0,pO=0,dO=0,lO=0,uO=0,mO=4,hO=0,fO=0,xO=0,gO=0,bO=0,yO=0,AO=0,SO=0,zO=0,TO=1,EO=0,CO=1,IO=.1,RO=1,wO=0,OO=0,MO=-.3,kO=.3,PO=-.3,LO=.3,DO=0,vO=1,FO=0,NO=1,_O=-.3,BO=.3,jO=0,VO=1,UO=0,HO=-1,WO=2,$O=-1,GO=2,KO=0,qO=1,YO=0,QO=1,JO=0,ZO=1,XO=0,eM=1,tM=0,oM=0,rM=2,sM=16,nM=8,iM=c({name:n().max($w).optional(),goal:n().min(1).max(Gw).optional().describe("What the video must accomplish."),audience:n().max(Kw).optional(),platform:n().max(qw).optional(),format:ye.optional(),durationSec:i().gt(Yw).max(Qw).optional().describe("Target output duration. HONOR-OR-REFUSE: compose validates it against the beat-source window (\xB11.5s) and refuses a brief it cannot honor."),tone:n().max(Jw).optional(),cta:n().max(Zw).optional(),locale:n().max(Xw).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:n().max(eO).optional(),caption:n().max(tO).optional(),beats:y(ho).max(oO).optional(),mustIncludes:y(n().min(1)).max(rO).optional(),references:y(n()).max(sO).optional(),captions:c({styleId:n().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:y(n().min(1)).max(nO).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).optional(),motionStyle:c({textAnimation:n().optional(),transitions:n().optional(),colorMood:n().optional(),captionStyle:n().optional()}).optional(),seededGraphics:y(c({id:n().min(1),startTime:i().min(iO).describe("Timeline start (seconds)."),duration:i().gt(aO).describe("Clip duration (seconds)."),source:E([c({kind:b("media"),mediaId:n().min(1),trim:c({start:i().min(cO).describe("Source trim start (seconds)."),end:i().min(pO).describe("Source trim end (seconds).")}).optional(),excludedRanges:y(c({start:i().min(dO),end:i().min(lO),reason:n().optional()})).optional(),volume:i().min(uO).max(mO).optional(),muted:P().optional(),playbackRate:i().gt(hO).optional(),sync:h(["video","independent"]).optional(),kenBurns:h(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:i().optional(),fadeInMs:i().min(fO).optional(),fadeOutMs:i().min(xO).optional(),loop:P().optional(),audioRole:h(["sfx","music","vo","ambience"]).optional(),duck:c({duckDb:i().max(gO),attackMs:i().min(bO),releaseMs:i().min(yO),windows:y(c({startMs:i(),endMs:i()})).optional()}).optional(),anchor:c({clipId:n().min(1),offsetMs:i()}).optional(),reframe:c({segments:y(c({startSec:i().min(AO).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(SO).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:E([c({mode:b("frame-center")}),c({mode:b("point"),x:i().min(zO).max(TO),y:i().min(EO).max(CO)}),c({mode:b("face"),faceId:n().min(1),shotScale:h(["close","standard","wide"]).optional()}),c({mode:b("all-faces")}),c({mode:b("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:n().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(IO).max(RO).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:c({in:i().min(wO).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(OO).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:c({x:i().min(MO).max(kO).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(PO).max(LO).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),c({kind:b("component"),componentId:n().min(1),props:O(n(),L()),assets:O(n(),n().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:h(["front","behind-subject"]).optional()}),c({kind:b("overlay"),primitiveId:n().min(1),params:O(n(),L()),zPlane:h(["front","behind-subject"]).optional(),anchor:c({space:b("scene"),x:i().min(DO).max(vO),y:i().min(FO).max(NO)}).optional(),parallax:i().min(_O).max(BO).optional()}),c({kind:b("effect"),primitiveId:n().min(1),params:O(n(),L()).optional()}),c({kind:b("card"),html:n().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),tokens:O(n(),n()).optional(),zPlane:b("front").optional()})]),kind:h(["video","audio","image","overlay","effect"]).optional(),opacity:i().min(jO).max(VO).optional(),scale:i().gt(UO).optional(),rotation:i().optional(),position:c({x:i().min(HO).max(WO),y:i().min($O).max(GO)}).optional().describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),region:c({x:i().min(KO).max(qO),y:i().min(YO).max(QO),w:i().gt(JO).max(ZO),h:i().gt(XO).max(eM)}).optional(),fit:h(["cover","contain"]).optional(),captionVisibility:h(["visible","hidden"]).optional().describe("Video media clip only. Hide native captions while this clip is topmost and covers the lower picture, or when an opaque, effect-free clip has an explicitly full-frame region, even with fit:contain. Caption words and timings remain stored and resume when another visible clip takes over."),effects:y(c({primitiveId:n().min(1),params:O(n(),L()).optional()})).optional(),transitionIn:c({type:n().min(1),duration:i().gt(tM)}).optional(),linkGroupId:n().min(1).optional(),animate:O(n(),y(c({time:i().min(oM),value:i(),easing:E([h(["linear","ease","easeIn","easeOut","easeInOut"]),c({cubicBezier:H([i(),i(),i(),i()])})]).optional()})).min(rM)).optional().describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.")})).max(sM).optional().describe("Client-authored graphic clips the Director must carry VERBATIM: seeded into the design loop's base composition as LOCKED clips (never re-authored, never discarded)."),exclusions:y(fo).max(nM).optional(),gates:xo.optional(),audio:mo.optional()});var aM="month",cM=c({plan:h(["credit_pack_10","credit_pack_30","credit_pack_100"]).describe("Plan tier to subscribe to."),interval:h(["month","year"]).default(aM).describe("Billing interval: 'month' (monthly) or 'year' (annual, ~2 months free).")});var pM=c({url:n().describe("Hosted Stripe checkout URL to open in a browser to complete payment. Always present on success \u2014 an existing saved card is never charged without confirming here."),plan:n(),interval:n(),productId:n().describe("Resolved billing catalog product id.")});var dM=0,lM=9007199254740991,uM=2e3,Fm=c({anchor:E([c({beatId:n().min(1)}),c({timecodeMs:A().min(dM).max(lM)})]).describe("What the comment is about: a plan beat (content gate) or a timecode on the artifact (layout/motion gates)."),verdict:h(["approve","revise","lock"]).describe("Per-anchor verdict under the single gate decision. `lock` = contractually frozen \u2014 the director touching a locked element is a defect, surfaced as a lock_violation verdict on the next packet (the no-discard machinery)."),note:n().max(uM).optional()});var vs=c({thisStepUsd:i().describe("What approving costs NEXT (the render at the final gate; $0 earlier)."),jobSpendSoFarUsd:i().describe("What has SETTLED so far \u2014 $0 while the run is live (compose is charge-on-delivery on both rails), so abandoning at a gate charges nothing."),estimatedJourneyTotalUsd:i().describe("The same journey number the Brief quoted.")});var Fs=h(["content","layout","motion"]);var mM=-9007199254740991,hM=9007199254740991,fM=-9007199254740991,xM=9007199254740991,ec=c({id:n(),projectId:n(),composeJobId:n().optional(),briefId:n().optional(),kind:h(["gate","score"]),stage:Fs.optional(),version:A().min(mM).max(hM),status:h(["awaiting","approved","revised","abandoned","expired","superseded"]),artifact:L().describe("The stage artifact under review: the locked ComposePlan at content; the composition wire shape at layout/motion; the judged composition snapshot on kind:'score'."),stillUrls:y(n()).optional().describe("Presigned storyboard/eval stills \u2014 the packet's visual evidence (may be GC'd by the retention sweep after the job goes terminal; the decision record is immortal)."),criticVerdicts:L().optional().describe("Per-criterion scores + critique from the design loop / judge, incl. lock_violation entries."),quote:vs.optional(),revisionCycle:A().min(fM).max(xM).describe("Revise cycles this gate has consumed. The brief quote states the included count (revisionCyclesIncluded); beyond it, resume(revise) is refused with a typed error."),decision:L().optional().describe("The recorded decision {decision, comments?, globalNote?, decidedAt} once resolved."),reviewMode:h(["agent","hosted"]).optional().describe("How this packet is decided (from the Brief's gates). 'hosted' = the review PAGE captures the decision; absent/'agent' = the decision flows back through the driving agent."),reviewUrl:n().optional().describe("Hosted review-page URL (present when reviewMode is 'hosted') \u2014 a human decides from this link, no account or agent session; the recorded decision rides the SAME resume rail, and the agent learns of it via checkpoint webhooks / wait_job."),createdAt:i(),updatedAt:i()});var gM=c({data:y(ec),pagination:be});var bM=24,yM=4e3,AM=c({decision:h(["approve","revise","abandon"]).describe("The ONE verdict for this gate (GitHub review grammar). approve = proceed (comments allowed \u2014 they record as taste signal without gating); revise = the director revises per comments/edits and RE-PRESENTS this same gate (in-job, no re-meter); abandon = end the run."),comments:y(Fm).max(bM).optional(),edits:L().optional().describe("Your edited stage artifact (the power path). With edits the re-presented packet carries exactly what you supplied; with comments alone the director re-authors scoped by them."),globalNote:n().max(yM).optional()}).describe("POST /checkpoints/:id/resume body \u2014 the A1 review grammar.");var SM=c({ok:b(!0)}).describe("POST /checkpoints/:id/resume response.");var Mye=c({ok:P()});var Pye=c({etag:n()});var zM=0,TM=64,EM=0,CM=64,IM=1,RM=0,wM=1,OM=1,MM=0,kM=1,Qe=c({version:b(2),assets:O(n(),c({kind:h(["image","video","audio","data"]),required:P(),mimeTypes:y(n().min(1)).min(1).optional(),mediaDemand:E([c({mode:b("original")}),c({mode:b("tier"),tier:E([b(256),b(512),b(1024),b(2048)])}),c({mode:b("auto"),maxProjectedWidthRatio:i().gt(zM).max(TM),maxProjectedHeightRatio:i().gt(EM).max(CM),minVisibleSourceWidthRatio:i().gt(RM).max(wM).default(IM),minVisibleSourceHeightRatio:i().gt(MM).max(kM).default(OM)})]).optional()})),graphics:c({api:h(["canvas2d","webgl","webgl2","webgpu"]),required:b(!0),accelerationPreference:h(["hardware-preferred","software-allowed"])}),alphaPolicy:h(["requires-transparency","allows-opaque"]),sceneShot:c({version:b(2)}).optional()});var PM=200,LM=200,DM=2e3,vM=200,FM=0,NM=c({componentId:n().min(1).max(PM).describe("Caller-chosen stable component id. On create it names the new component. On PUT/PATCH it is optional and, when present, must equal the id in the path; a mismatch is a 400 naming both."),tsxSource:n().min(1),name:n().min(1).max(LM),description:n().max(DM),category:h(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),propSchema:O(n(),L()).optional(),origin:h(["customer-owned","server-native"]).optional(),ejectedFrom:n().max(vM).optional(),tokens:O(n(),L()).optional(),examples:y(O(n(),L())).optional().describe("Usage examples, as authored. A built-in primitive projects {name, mood?, params?, description?}; an authored component's examples are whatever it wrote, which is why the item is open. One shape for both directions: what you write here is what you read back."),durationInFrames:i().gt(FM).optional(),manifest:Qe}).describe("POST /components body. Org/user are server-resolved; never accepted from the body.");var Ns=c({clipSourceKind:h(["overlay","effect","component"]).describe("The ClipSource `kind` to author this entry as: 'overlay' (built-in text/ui/scene/background/layout), 'effect' (built-in effect/transition), or 'component' (an org-INSTALLED custom component)."),refField:h(["primitiveId","componentId"]).describe("Which id field keys the ClipSource: 'primitiveId' for built-ins (source:'default'), 'componentId' for installed components (source:'installed'). Using the wrong field will NOT resolve at render.")});var _s=c({aspectRatio:h(["16:9","9:16","1:1","4:5"]),fps:E([b(24),b(25),b(30),b(60)]).optional(),resolution:h(["hd","fhd","4k"]).optional()});var _M=200,BM=2e3,jM=200,VM=0,tc=c({name:n().min(1).max(_M),description:n().max(BM),category:h(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),propSchema:O(n(),L()),origin:h(["customer-owned","server-native"]).optional(),ejectedFrom:n().max(jM).optional(),tokens:O(n(),L()).optional(),examples:y(O(n(),L())).optional().describe("Usage examples, as authored. A built-in primitive projects {name, mood?, params?, description?}; an authored component's examples are whatever it wrote, which is why the item is open. One shape for both directions: what you write here is what you read back."),durationInFrames:i().gt(VM).optional(),manifest:Qe.optional().describe("The stored runtime manifest (assets, graphics API, alpha policy) of an org-INSTALLED component: the same object the create/update body takes, so a manifest read back here can be written back unchanged. Built-in defaults have no stored manifest and omit it. Its `version` is always 2 (the contract version), unlike the entry's semver `version`."),id:n().describe("The entry's id: a `primitiveId` for a built-in, a `componentId` for an installed component."),source:h(["default","installed"]).describe("'default' = built-in primitive (place by primitiveId); 'installed' = org-authored component (place by componentId)."),kind:h(["component","transition","scene"]).describe("RENDER kind (component | transition | scene). NOT the ClipSource variant \u2014 see `placement` for how to author it on the timeline."),version:n().describe("The ENTRY's version: a semver string ('0.0.0' until an authored component is versioned). Distinct from `manifest.version`, which is the runtime contract version and is always the literal 2."),propDefaults:O(n(),L()).optional(),textParam:n().nullish().describe("The param field that carries this primitive's primary text; null = no single text slot."),subtextParam:n().nullish().describe("The param field for secondary text (subtitle/byline); null = none."),format:_s.optional(),intent:n().optional().describe("Selection signal: a verb naming what this primitive accomplishes (e.g. 'product-trailer'). Match it to the beat you are authoring."),useWhen:n().optional().describe("When to use this \u2014 AND when not to. The negative guidance is load-bearing; read it before picking."),pairsWith:y(n()).optional().describe("Authoring guidance: ids of primitives that COMPOSE well with this one in the same edit."),avoidWith:y(n()).optional().describe("Authoring guidance: ids of primitives that CONFLICT with this one \u2014 do not place together."),tags:y(n()).optional().describe("Free-text search keywords."),mood:y(n()).optional().describe("Vibe/tone tags (e.g. 'cinematic', 'minimal'). Filter to match the edit's mood."),tier:h(["recommended","standard","niche"]).optional().describe("Quality/applicability RANKING (a preference, not a flag). Prefer 'recommended'; reach for 'niche' only when its specific use-case is exactly the beat."),useCase:y(h(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"])).optional().describe("The edit ROLE(s) this primitive fills \u2014 the dimension to filter by for a beat (e.g. 'intro', 'title-over-footage', 'grade')."),fixedCopy:y(n()).optional().describe("On-screen strings this primitive BAKES \u2014 the read-side counterpart to propSchema. These literals render REGARDLESS of params (no param can change them); fork the source via get_component_source to edit them. Use this to see at author time what fixed copy (someone-else's marketing text, faux-code, faux-data) will appear before you render."),brandBindings:y(c({param:n(),brandToken:n()})).optional().describe("Params that can follow the project brand kit. Each {param, brandToken} says: set `param` to `brandToken` (a `$brand:` ref, e.g. '$brand:colors.accent') to track the brand instead of a literal. See the list response's `brandTokens` for the full ref vocabulary. Omitted when nothing is brand-bound."),placement:Ns.describe("How to author this entry as a ClipSource via apply_composition: the exact ClipSource `kind` + the id field to key it by. Built-ins place as {kind:'overlay'|'effect', primitiveId}; installed components place as {kind:'component', componentId}. A kind:'scene' primitive has no 'scene' ClipSource \u2014 it is placed as {kind:'overlay', primitiveId}."),warnings:y(n()).optional().describe("Non-blocking save-time advisories \u2014 the create/update SUCCEEDED. Currently: a `fontFamily` string literal referencing a NON-vendored font (a bare CSS generic like 'serif', or an unknown named family like 'Arial') whose LIVE-lane pixels vary by render host \u2014 re-author with a vendored family or 'Georgia'. Omitted when there is nothing to flag; only present on the create/update responses.")}).describe("Component catalog entry per \xA7Components.");var Nm=c({soundId:n().describe("Stable sound-pack item id."),family:h(["tick","pop","impact","confirm","error","whoosh","riser"]).describe("Editorial family the compose sfx pass binds by."),envelopeClass:h(["transient","sweep","ambient"]).describe("Coarse envelope shape \u2014 the browse grouping."),intensity:h(["subtle","standard","strong"]),durationSec:i().describe("Duration of the mastered asset (seconds)."),description:n().describe("One-line human-legible caption."),attribution:n().describe("CC0 provenance string.")});var UM=c({data:y(tc),pagination:be,brandTokens:y(n()).optional().describe("Catalog-level reference: the valid `$brand:` token refs a param value may carry (e.g. accentColor: \"$brand:colors.accent\"). Colors + fonts are the common bindings; the full design-token vocabulary is listed. Derived from the brand kit resolver so it can't drift. See each entry's `brandBindings` for which params are brand-bound by default."),sfx:y(Nm).optional().describe("Catalog-level reference: the curated CC0 SFX pack (closed, versioned). The compose sfx pass places these deterministically; this is the pack-only structural inventory to pick a `soundId` by family. Present on the first page only."),audio:y(Pm).optional().describe(`The UNIFIED org sound palette (audio-substrate Phase 2): the curated packs (SFX + music beds) unioned with THIS org's own uploads/imports (source:"org") and generated audio (source:"generated"), one uniform entry shape carrying role + envelopeClass + provenance + license; music entries carry bpm. Prefer an org sound when it fits \u2014 an org that uploads its product's real UI sounds hears ITS product. Present on the first page only.`)});var HM=200,WM=200,$M=2e3,GM=200,KM=0,qM=c({componentId:n().min(1).max(HM).optional().describe("Caller-chosen stable component id. On create it names the new component. On PUT/PATCH it is optional and, when present, must equal the id in the path; a mismatch is a 400 naming both."),tsxSource:n().min(1).optional(),name:n().min(1).max(WM).optional(),description:n().max($M).optional(),category:h(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]).optional(),propSchema:O(n(),L()).optional(),origin:h(["customer-owned","server-native"]).optional(),ejectedFrom:n().max(GM).optional(),tokens:O(n(),L()).optional(),examples:y(O(n(),L())).optional().describe("Usage examples, as authored. A built-in primitive projects {name, mood?, params?, description?}; an authored component's examples are whatever it wrote, which is why the item is open. One shape for both directions: what you write here is what you read back."),durationInFrames:i().gt(KM).optional(),manifest:Qe.optional(),projectId:n().min(1).optional().describe("A project whose active composition's placements of this component move to the new version in the same write. Without it no placement moves."),compositionId:n().min(1).optional().describe("With `projectId`: the composition to move instead of the project's active one.")}).describe("PATCH /components/:id body, RFC 7396 merge: a field you omit is left exactly as it was. Org/user are server-resolved; never accepted from the body.");var _m=c({artifactKind:b("image"),contentType:h(["image/png","image/jpeg"]),cached:P(),listUsd:i().optional().describe("List price charged for this delivered preview."),url:xe(),urlExpiresAt:n()});var Bm=c({artifactKind:b("motion"),contentType:b("video/webm"),cached:P(),listUsd:i().optional().describe("List price charged for this delivered preview."),url:xe(),urlExpiresAt:n()});var jm=E([_m,Bm]);var YM=0,QM=9007199254740991,JM=0,ZM=9007199254740991,XM=0,ek=120,tk=3600,ok=c({componentId:n().min(1),params:O(n(),L()).optional(),assets:O(n(),n().min(1)).optional().describe("Component asset-slot name to org mediaId. Every required manifest slot must be bound."),width:A().gt(YM).max(QM).optional(),height:A().gt(JM).max(ZM).optional(),fps:i().gt(XM).max(ek).optional().describe("Preview frame rate. When omitted, uses the project's format."),durationInFrames:A().min(1).max(tk).optional().describe("Preview frame count. When omitted, uses the component's declared duration; required if the component has none.")});var rk=200,sk=2e3,nk=200,ik=0,ak=c({tsxSource:n().min(1),name:n().min(1).max(rk),description:n().max(sk),propSchema:O(n(),L()),origin:h(["customer-owned","server-native"]).optional(),ejectedFrom:n().max(nk).optional(),tokens:O(n(),L()).optional(),examples:y(O(n(),L())).optional().describe("Usage examples, as authored. A built-in primitive projects {name, mood?, params?, description?}; an authored component's examples are whatever it wrote, which is why the item is open. One shape for both directions: what you write here is what you read back."),durationInFrames:i().gt(ik).optional(),manifest:Qe,id:n(),source:h(["default","installed"])}).describe("Installed component SOURCE (TSX) + ownership provenance per \xA7Components.");var ck=200,pk=200,dk=2e3,lk=200,uk=0,mk=c({componentId:n().min(1).max(ck).optional().describe("Caller-chosen stable component id. On create it names the new component. On PUT/PATCH it is optional and, when present, must equal the id in the path; a mismatch is a 400 naming both."),tsxSource:n().min(1).optional(),name:n().min(1).max(pk).optional(),description:n().max(dk).optional(),category:h(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]).optional(),propSchema:O(n(),L()).optional(),origin:h(["customer-owned","server-native"]).optional(),ejectedFrom:n().max(lk).optional(),tokens:O(n(),L()).optional(),examples:y(O(n(),L())).optional().describe("Usage examples, as authored. A built-in primitive projects {name, mood?, params?, description?}; an authored component's examples are whatever it wrote, which is why the item is open. One shape for both directions: what you write here is what you read back."),durationInFrames:i().gt(uk).optional(),manifest:Qe.optional(),projectId:n().min(1).optional().describe("A project whose active composition's placements of this component move to the new version in the same write. Without it no placement moves."),compositionId:n().min(1).optional().describe("With `projectId`: the composition to move instead of the project's active one.")}).describe("PUT /components/:id body: every writable field, all optional; an omitted field is carried forward. Org/user are server-resolved; never accepted from the body.");var hk=200,fk=2e3,xk=200,gk=0,bk=0,yk=9007199254740991,Ak=0,Sk=9007199254740991,zk=c({name:n().min(1).max(hk),description:n().max(fk),category:h(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),propSchema:O(n(),L()),origin:h(["customer-owned","server-native"]).optional(),ejectedFrom:n().max(xk).optional(),tokens:O(n(),L()).optional(),examples:y(O(n(),L())).optional().describe("Usage examples, as authored. A built-in primitive projects {name, mood?, params?, description?}; an authored component's examples are whatever it wrote, which is why the item is open. One shape for both directions: what you write here is what you read back."),durationInFrames:i().gt(gk).optional(),manifest:Qe.optional().describe("The stored runtime manifest (assets, graphics API, alpha policy) of an org-INSTALLED component: the same object the create/update body takes, so a manifest read back here can be written back unchanged. Built-in defaults have no stored manifest and omit it. Its `version` is always 2 (the contract version), unlike the entry's semver `version`."),id:n().describe("The entry's id: a `primitiveId` for a built-in, a `componentId` for an installed component."),source:h(["default","installed"]).describe("'default' = built-in primitive (place by primitiveId); 'installed' = org-authored component (place by componentId)."),kind:h(["component","transition","scene"]).describe("RENDER kind (component | transition | scene). NOT the ClipSource variant \u2014 see `placement` for how to author it on the timeline."),version:n().describe("The ENTRY's version: a semver string ('0.0.0' until an authored component is versioned). Distinct from `manifest.version`, which is the runtime contract version and is always the literal 2."),propDefaults:O(n(),L()).optional(),textParam:n().nullish().describe("The param field that carries this primitive's primary text; null = no single text slot."),subtextParam:n().nullish().describe("The param field for secondary text (subtitle/byline); null = none."),format:_s.optional(),intent:n().optional().describe("Selection signal: a verb naming what this primitive accomplishes (e.g. 'product-trailer'). Match it to the beat you are authoring."),useWhen:n().optional().describe("When to use this \u2014 AND when not to. The negative guidance is load-bearing; read it before picking."),pairsWith:y(n()).optional().describe("Authoring guidance: ids of primitives that COMPOSE well with this one in the same edit."),avoidWith:y(n()).optional().describe("Authoring guidance: ids of primitives that CONFLICT with this one \u2014 do not place together."),tags:y(n()).optional().describe("Free-text search keywords."),mood:y(n()).optional().describe("Vibe/tone tags (e.g. 'cinematic', 'minimal'). Filter to match the edit's mood."),tier:h(["recommended","standard","niche"]).optional().describe("Quality/applicability RANKING (a preference, not a flag). Prefer 'recommended'; reach for 'niche' only when its specific use-case is exactly the beat."),useCase:y(h(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"])).optional().describe("The edit ROLE(s) this primitive fills \u2014 the dimension to filter by for a beat (e.g. 'intro', 'title-over-footage', 'grade')."),fixedCopy:y(n()).optional().describe("On-screen strings this primitive BAKES \u2014 the read-side counterpart to propSchema. These literals render REGARDLESS of params (no param can change them); fork the source via get_component_source to edit them. Use this to see at author time what fixed copy (someone-else's marketing text, faux-code, faux-data) will appear before you render."),brandBindings:y(c({param:n(),brandToken:n()})).optional().describe("Params that can follow the project brand kit. Each {param, brandToken} says: set `param` to `brandToken` (a `$brand:` ref, e.g. '$brand:colors.accent') to track the brand instead of a literal. See the list response's `brandTokens` for the full ref vocabulary. Omitted when nothing is brand-bound."),placement:Ns.describe("How to author this entry as a ClipSource via apply_composition: the exact ClipSource `kind` + the id field to key it by. Built-ins place as {kind:'overlay'|'effect', primitiveId}; installed components place as {kind:'component', componentId}. A kind:'scene' primitive has no 'scene' ClipSource \u2014 it is placed as {kind:'overlay', primitiveId}."),warnings:y(n()).optional().describe("Non-blocking save-time advisories \u2014 the create/update SUCCEEDED. Currently: a `fontFamily` string literal referencing a NON-vendored font (a bare CSS generic like 'serif', or an unknown named family like 'Arial') whose LIVE-lane pixels vary by render host \u2014 re-author with a vendored family or 'Georgia'. Omitted when there is nothing to flag; only present on the create/update responses."),repinned:c({compositionId:n(),pins:A().min(bk).max(yk).describe("Placements in that composition moved from the previous version to this one, nested scene surfaces included."),etag:n().nullable().describe("The composition's ETag after the move; null when no pin moved.")}).optional().describe("Present when the update named `projectId`: the composition whose placements moved to the new version."),placementsPinnedToPrevious:A().min(Ak).max(Sk).describe("Placements across the org that still pin the previous version and will keep rendering it. Name `projectId` (and `compositionId`) on the update to move a composition's placements with it.")}).describe("Updated component entry plus where its placements point.");var Tk=2e3,Ek=5,Ck=0,Ik=0,Rk=10,wk=-9007199254740991,Ok=9007199254740991,Mk=64,kk=3,Pk=c({suggestionId:n().min(1).optional(),fromComposition:P().optional().describe("Reuse the project's current composition as the compose starting point (critique-retry path). The Director RE-AUTHORS graphics: if the current composition is client-authored and contains graphic clips (overlay/component/card), the request is refused (validation_error naming the clips) \u2014 render it verbatim with create_render instead. The director's own output (critique-retry) is exempt."),briefId:n().min(1).optional().describe("Compose from a persisted Brief (create_brief) \u2014 the intent-first door: every Brief field is HONORED or the request is refused loudly naming the field (window from beat moment-pinning; seeded graphics carried VERBATIM as locked clips; exclusions enforced; locale + caption emphasis threaded to the Director). Exactly ONE of suggestionId | fromComposition | briefId."),format:ye.optional().describe("Optional format override. Phase 2 ignores this \u2014 format precedence is project.compositionFormat \u2192 9:16 fhd 30fps default."),scope:L().optional().describe("RequestScope discriminated union (per compose-api-contract.md). Editor-only scopes (captions/overlay-track/broll/overlay-instance/segment) require an editor-session token; API tokens get 403 on those."),critique:n().max(Tk).optional().describe("Structured critique block (per compose-api-contract.md decision #11). Capped at 2KB total; per-criterion blocks capped at 500 chars."),parentJobId:n().optional().describe("Pointer to the prior compose job this run iterates on. Surfaced on the resulting compose job as baselineComposeJobId."),maxCandidates:A().min(1).max(Ek).optional().describe("Ensemble size. Currently pinned to 1 \u2014 the multi-candidate ensemble is disabled pending a capacity bound, so any value >1 is ignored and every compose runs a single candidate. Still accepted for forward-compat; will honor [1, 5] again once re-enabled."),budgetUsd:i().gt(Ck).optional().describe("Per-job budget cap (USD). Clamped at the route against the org's composeMaxBudgetUsdPerJob setting."),qualityThreshold:i().min(Ik).max(Rk).optional().describe("Composite-score accept threshold. Server default per contract."),seed:A().min(wk).max(Ok).optional().describe("Deterministic seed for replay."),clientNonce:n().max(Mk).optional().describe("Opaque caller token that disambiguates intentional same-critique retries. Without it, identical (project, sug, seed, critique) tuples deduplicate; with it, retries create a fresh execution."),holdAt:y(h(["content","layout","motion"])).max(kk).optional().describe("Opt-in checkpoint gates. Each named stage pauses the compose at its boundary (status \u2192 awaiting_input) for client review via resume. Absent/empty \u21D2 fully autonomous. Non-empty \u21D2 the run is a single spine.")}).describe("POST /projects/:id/compose body.");var Lk=c({composeJobId:n().describe("Opaque compose job id; pass to the SSE stream URL."),projectId:n(),status:h(["queued","failed"]).describe("queued = normal; failed = startup failed and the job is already terminal (the SSE stream will emit a single `job_failed` frame and close)."),streamUrl:n().optional().describe("Relative SSE endpoint to stream this job's events (per compose-api-contract.md).")}).describe("POST /projects/:id/compose response.");var Dk=0,vk=9007199254740991,Vm=c({mode:h(["advise","amend","explore"]),assessment:c({editorial:c({score:i(),grounding:h(["measured","judged"]),abstained:P(),reliability:i().optional()}),spatial:c({score:i(),grounding:h(["measured","judged"]),abstained:P(),reliability:i().optional()}),brand:c({score:i(),grounding:h(["measured","judged"]),abstained:P(),reliability:i().optional()}),caption:c({score:i(),grounding:h(["measured","judged"]),abstained:P(),reliability:i().optional()})}).optional().describe("Grounded critique of the CURRENT composition. Omitted for mode=advise."),proposals:y(c({label:n(),candidateIndex:A().min(Dk).max(vk).optional().describe("Present for amend/explore \u2014 adopt via POST /compose/jobs/:jobId/select with this candidateIndex. Absent for advise."),changeSummary:y(n()).describe("Human-legible edit-pattern labels."),boundToEtag:n().optional().describe("The composition etag this proposal was computed against."),expectedDelta:O(n(),n()).optional().describe("Advisory per-criterion score lift; NOT authoritative pre-recalibration.")})),principles:y(n()).describe("Reusable, grounded lessons for the client's next authoring."),plan:L().optional().describe("Present for mode=advise \u2014 the planner agent's ComposePlan (framing/cuts/captions/graphics intents) as GUIDANCE. The client agent reads it and re-authors; it is NOT converted to ops."),checkpointId:n().optional().describe("The durable kind:'score' Checkpoint minted from this advisory (evidence convergence \u2014 get_checkpoint re-reads the envelope later). Stamped at the consult success terminal.")}).describe("The advisory envelope returned by a completed consult job (on ComposeJobDetailResponse.advisoryResult).");var Fk=-9007199254740991,Nk=9007199254740991,_k=0,Bk=9007199254740991,jk=-9007199254740991,Vk=9007199254740991,Uk=c({composeJobId:n(),projectId:n(),status:h(["queued","running","awaiting_input","complete","failed","cancelled"]),error:n().nullable(),request:c({suggestionId:n().optional(),fromComposition:P().optional(),scope:L().optional(),critique:n().optional(),parentJobId:n().optional(),maxCandidates:A().min(Fk).max(Nk).optional(),budgetUsd:i().optional(),qualityThreshold:i().optional()}),candidates:y(L()),winner:E([c({candidateIndex:A().min(_k).max(Bk),compositionRunId:n()}),G()]),listUsd:i().optional(),startedAt:i(),completedAt:i().nullable(),advisoryResult:Vm.optional(),checkpoint:c({checkpointId:n(),stage:h(["content","layout","motion"]),version:A().min(jk).max(Vk)}).optional()});var Um=c({composeJobId:n(),projectId:n(),status:h(["queued","running","awaiting_input","complete","failed","cancelled"]),suggestionId:n().optional(),createdAt:i(),completedAt:i().nullable()});var Hk=c({jobs:y(Um)});var Wk=0,$k=9007199254740991,Gk=c({candidateIndex:A().min(Wk).max($k),selectStrategy:h(["agent-authoritative","editor-merge","editor-replace"]),ifMatch:n().optional()}).describe("POST /projects/:id/compose/jobs/:jobId/select body.");var Kk=0,qk=9007199254740991,Yk=c({newCompositionEtag:n(),mergeResult:c({replayedEdits:A().min(Kk).max(qk),droppedEdits:y(c({trackId:n(),clipId:n().optional(),wordStartMs:i().optional(),reason:h(["target_removed","conflict"])}))}).optional()}).describe("POST /projects/:id/compose/jobs/:jobId/select response.");var Qk=64,Jk=c({seedComposition:L().optional(),leaseJobId:n().min(1).max(Qk).optional()});var Zk=0,Xk=4,eP=0,tP=0,oP=0,rP=0,sP=0,nP=0,iP=0,aP=4,cP=0,pP=0,dP=0,lP=0,uP=0,mP=0,hP=0,fP=0,xP=0,gP=1,bP=0,yP=1,AP=.1,SP=1,zP=0,TP=0,EP=-.3,CP=.3,IP=-.3,RP=.3,wP=0,OP=1,MP=0,kP=1,PP=-.3,LP=.3,DP=0,vP=1,FP=0,NP=-1,_P=2,BP=-1,jP=2,VP=0,UP=1,HP=0,WP=1,$P=0,GP=1,KP=0,qP=1,YP=0,QP=0,JP=2,ZP=0,XP=0,e1=0,t1=0,o1=0,r1=0,s1=15,n1=100,i1=900,a1=0,c1=1,p1=0,d1=1,l1=0,u1=1,m1=0,h1=1,f1=-5,x1=20,g1=0,b1=2,y1=0,A1=2,S1=0,z1=100,T1=900,E1=0,C1=0,I1=0,R1=0,w1=.5,O1=12,M1=0,k1=100,P1=0,L1=9007199254740991,D1=0,v1=9007199254740991,F1=0,N1=9007199254740991,_1=0,B1=1,j1=0,V1=1,U1=0,H1=1,W1=0,$1=1,G1=.25,K1=4,q1=-45,Y1=45,Q1=15,J1=100,Z1=900,X1=-5,eL=20,tL=0,oL=2,rL=0,sL=2,nL=0,iL=100,aL=900,cL=0,pL=.5,dL=12,lL=0,uL=0,mL=0,hL=0,fL=9007199254740991,xL=0,gL=9007199254740991,bL=new RegExp("^[a-f0-9]{64}$"),yL=0,AL=0,SL=15,zL=100,TL=900,EL=0,CL=1,IL=0,RL=1,wL=0,OL=1,ML=0,kL=1,PL=-5,LL=20,DL=0,vL=2,FL=0,NL=2,_L=0,BL=100,jL=900,VL=0,UL=0,HL=0,WL=0,$L=.5,GL=12,KL=0,qL=100,YL=0,QL=9007199254740991,JL=0,ZL=9007199254740991,XL=0,eD=9007199254740991,tD=0,oD=1,rD=0,sD=1,nD=0,iD=1,aD=0,cD=1,pD=.25,dD=4,lD=-45,uD=45,mD=15,hD=100,fD=900,xD=-5,gD=20,bD=0,yD=2,AD=0,SD=2,zD=0,TD=100,ED=900,CD=0,ID=.5,RD=12,wD=0,OD=0,MD=0,kD=0,PD=9007199254740991,LD=0,DD=9007199254740991,vD=new RegExp("^[a-f0-9]{64}$"),oc=c({v:b(1),format:c({aspectRatio:h(["16:9","9:16","1:1","4:5"]),fps:E([b(24),b(25),b(30),b(60)]).optional(),resolution:h(["hd","fhd","4k"]).optional(),platform:n().optional()}),tracks:y(c({id:n().min(1),kind:h(["video","audio","image","overlay","effect"]),name:n().optional(),enabled:P().optional(),volume:i().min(Zk).max(Xk).optional(),contents:y(E([c({id:n().min(1),startTime:i().min(eP).describe("Timeline start (seconds)."),duration:i().gt(tP).describe("Clip duration (seconds)."),source:E([c({kind:b("media"),mediaId:n().min(1),trim:c({start:i().min(oP).describe("Source trim start (seconds)."),end:i().min(rP).describe("Source trim end (seconds).")}).optional(),excludedRanges:y(c({start:i().min(sP),end:i().min(nP),reason:n().optional()})).optional(),volume:i().min(iP).max(aP).optional(),muted:P().optional(),playbackRate:i().gt(cP).optional(),sync:h(["video","independent"]).optional(),kenBurns:h(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:i().optional(),fadeInMs:i().min(pP).optional(),fadeOutMs:i().min(dP).optional(),loop:P().optional(),audioRole:h(["sfx","music","vo","ambience"]).optional(),duck:c({duckDb:i().max(lP),attackMs:i().min(uP),releaseMs:i().min(mP),windows:y(c({startMs:i(),endMs:i()})).optional()}).optional(),anchor:c({clipId:n().min(1),offsetMs:i()}).optional(),reframe:c({segments:y(c({startSec:i().min(hP).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(fP).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:E([c({mode:b("frame-center")}),c({mode:b("point"),x:i().min(xP).max(gP),y:i().min(bP).max(yP)}),c({mode:b("face"),faceId:n().min(1),shotScale:h(["close","standard","wide"]).optional()}),c({mode:b("all-faces")}),c({mode:b("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:n().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(AP).max(SP).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:c({in:i().min(zP).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(TP).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:c({x:i().min(EP).max(CP).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(IP).max(RP).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),c({kind:b("component"),componentId:n().min(1),props:O(n(),L()),assets:O(n(),n().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:h(["front","behind-subject"]).optional()}),c({kind:b("overlay"),primitiveId:n().min(1),params:O(n(),L()),zPlane:h(["front","behind-subject"]).optional(),anchor:c({space:b("scene"),x:i().min(wP).max(OP),y:i().min(MP).max(kP)}).optional(),parallax:i().min(PP).max(LP).optional()}),c({kind:b("effect"),primitiveId:n().min(1),params:O(n(),L()).optional()}),c({kind:b("card"),html:n().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),tokens:O(n(),n()).optional(),zPlane:b("front").optional()})]),kind:h(["video","audio","image","overlay","effect"]).optional(),opacity:i().min(DP).max(vP).optional(),scale:i().gt(FP).optional(),rotation:i().optional(),position:c({x:i().min(NP).max(_P),y:i().min(BP).max(jP)}).optional().describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),region:c({x:i().min(VP).max(UP),y:i().min(HP).max(WP),w:i().gt($P).max(GP),h:i().gt(KP).max(qP)}).optional(),fit:h(["cover","contain"]).optional(),captionVisibility:h(["visible","hidden"]).optional().describe("Video media clip only. Hide native captions while this clip is topmost and covers the lower picture, or when an opaque, effect-free clip has an explicitly full-frame region, even with fit:contain. Caption words and timings remain stored and resume when another visible clip takes over."),effects:y(c({primitiveId:n().min(1),params:O(n(),L()).optional()})).optional(),transitionIn:c({type:n().min(1),duration:i().gt(YP)}).optional(),linkGroupId:n().min(1).optional(),animate:O(n(),y(c({time:i().min(QP),value:i(),easing:E([h(["linear","ease","easeIn","easeOut","easeInOut"]),c({cubicBezier:H([i(),i(),i(),i()])})]).optional()})).min(JP)).optional().describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.")}),c({id:n().min(1),startTime:i().min(ZP).describe("Timeline start (seconds)."),duration:i().gt(XP).describe("Gap duration (seconds).")})]))})),markers:y(c({id:n().min(1),startTime:i().min(e1),endTime:i().min(t1).optional(),kind:n().min(1),name:n().optional(),metadata:O(n(),L()).optional()})).optional(),captions:E([c({source:b("derived"),from:c({clipId:n()}),segments:y(c({words:y(c({text:n().min(1),startMs:i().min(o1).describe("Word start on the composition timeline, in milliseconds."),endMs:i().min(r1).describe("Word end on the composition timeline, in milliseconds."),emphasis:P().optional(),annotate:h(["circle","underline"]).optional()}))})),style:c({fontFamily:n().min(1).optional(),fontSize:i().min(1).max(s1).optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),fontWeight:A().min(n1).max(i1).optional(),color:n().min(1).optional(),highlightColor:n().min(1).optional(),backgroundColor:n().optional(),plate:h(["glass","solid","none"]).optional(),position:h(["top","center","bottom"]).optional(),region:c({x:i().min(a1).max(c1),y:i().min(p1).max(d1),w:i().gt(l1).max(u1),h:i().gt(m1).max(h1)}).optional().describe("Optional caption layout box {x,y,w,h} in normalized output-frame coordinates. Overrides position; text starts at its top edge and wraps/pages within its width and height."),textTransform:h(["none","uppercase","capitalize"]).optional(),letterSpacing:i().min(f1).max(x1).optional().describe("Base caption glyph spacing in pixels."),wordGapEm:i().min(g1).max(b1).optional().describe("Gap between caption runs as a multiple of base font size; default 0.35."),lineGapEm:i().min(y1).max(A1).optional().describe("Gap between caption lines as a multiple of base font size; default 0.25."),emphasisColor:n().optional(),emphasisGradient:n().optional(),emphasisScale:i().gt(S1).optional(),emphasisFontFamily:n().optional(),emphasisFontWeight:A().min(z1).max(T1).optional(),emphasisTextTransform:h(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:i().optional(),emphasisFontStyle:h(["normal","italic"]).optional(),entrance:h(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:i().min(E1).optional(),entranceStaggerMs:i().min(C1).optional(),exitMs:i().min(I1).optional(),emphasisPlate:P().optional(),emphasisPlateColor:n().optional(),emphasisPlateTextColor:n().optional(),emphasisPlateAltColor:n().optional(),emphasisPlateAltTextColor:n().optional(),emphasisPlateRadius:i().min(R1).optional(),emphasisPlatePadX:i().optional(),emphasisPlatePadY:i().optional(),emphasisPlateReveal:P().optional().describe("Grow a shared emphasis plate as saved words appear while reserving its final layout width."),annotationColor:n().optional(),annotationStrokeWidth:i().min(w1).max(O1).optional().describe("Annotation stroke width in its 100\xD7100 SVG coordinate system; default 4."),annotationTexture:h(["clean","pencil"]).optional().describe("Native annotation stroke finish; default clean."),maxWidthPercent:i().gt(M1).max(k1).optional()}).optional(),layouts:y(c({segmentIndex:A().min(P1).max(L1),wordStartIndex:A().min(D1).max(v1),wordEndIndex:A().gt(F1).max(N1).describe("Exclusive word index in the saved caption segment."),region:c({x:i().min(_1).max(B1),y:i().min(j1).max(V1),w:i().gt(U1).max(H1),h:i().gt(W1).max($1)}),scale:i().min(G1).max(K1).optional(),rotation:i().min(q1).max(Y1).optional(),style:c({fontFamily:n().min(1).optional(),fontSize:i().min(1).max(Q1).optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),fontWeight:A().min(J1).max(Z1).optional(),color:n().min(1).optional(),highlightColor:n().min(1).optional(),backgroundColor:n().optional(),plate:h(["glass","solid","none"]).optional(),textTransform:h(["none","uppercase","capitalize"]).optional(),letterSpacing:i().min(X1).max(eL).optional().describe("Base caption glyph spacing in pixels."),wordGapEm:i().min(tL).max(oL).optional().describe("Gap between caption runs as a multiple of base font size; default 0.35."),lineGapEm:i().min(rL).max(sL).optional().describe("Gap between caption lines as a multiple of base font size; default 0.25."),emphasisColor:n().optional(),emphasisScale:i().gt(nL).optional(),emphasisFontFamily:n().optional(),emphasisFontWeight:A().min(iL).max(aL).optional(),emphasisTextTransform:h(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:i().optional(),emphasisFontStyle:h(["normal","italic"]).optional(),emphasisPlate:P().optional(),emphasisPlateColor:n().optional(),emphasisPlateTextColor:n().optional(),emphasisPlateAltColor:n().optional(),emphasisPlateAltTextColor:n().optional(),emphasisPlateRadius:i().min(cL).optional(),emphasisPlatePadX:i().optional(),emphasisPlatePadY:i().optional(),emphasisPlateReveal:P().optional().describe("Grow a shared emphasis plate as saved words appear while reserving its final layout width."),annotationColor:n().optional(),annotationStrokeWidth:i().min(pL).max(dL).optional().describe("Annotation stroke width in its 100\xD7100 SVG coordinate system; default 4."),annotationTexture:h(["clean","pencil"]).optional().describe("Native annotation stroke finish; default clean."),entrance:h(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:i().min(lL).optional(),entranceStaggerMs:i().min(uL).optional(),exitMs:i().min(mL).optional()}).optional(),holdThroughWordIndex:A().min(hL).max(fL).optional().describe("Inclusive saved-word index in this segment. The layout stays visible until that word ends."),wordMarks:y(c({wordIndex:A().min(xL).max(gL),emphasis:P().optional(),annotate:E([h(["circle","underline"]),G()]).optional()})).optional(),wordSignature:n().regex(bL)})).optional(),zPlane:h(["front","behind-subject"]).optional()}),c({source:b("authored"),segments:y(c({words:y(c({text:n().min(1),startMs:i().min(yL).describe("Word start on the composition timeline, in milliseconds."),endMs:i().min(AL).describe("Word end on the composition timeline, in milliseconds."),emphasis:P().optional(),annotate:h(["circle","underline"]).optional()}))})),style:c({fontFamily:n().min(1).optional(),fontSize:i().min(1).max(SL).optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),fontWeight:A().min(zL).max(TL).optional(),color:n().min(1).optional(),highlightColor:n().min(1).optional(),backgroundColor:n().optional(),plate:h(["glass","solid","none"]).optional(),position:h(["top","center","bottom"]).optional(),region:c({x:i().min(EL).max(CL),y:i().min(IL).max(RL),w:i().gt(wL).max(OL),h:i().gt(ML).max(kL)}).optional().describe("Optional caption layout box {x,y,w,h} in normalized output-frame coordinates. Overrides position; text starts at its top edge and wraps/pages within its width and height."),textTransform:h(["none","uppercase","capitalize"]).optional(),letterSpacing:i().min(PL).max(LL).optional().describe("Base caption glyph spacing in pixels."),wordGapEm:i().min(DL).max(vL).optional().describe("Gap between caption runs as a multiple of base font size; default 0.35."),lineGapEm:i().min(FL).max(NL).optional().describe("Gap between caption lines as a multiple of base font size; default 0.25."),emphasisColor:n().optional(),emphasisGradient:n().optional(),emphasisScale:i().gt(_L).optional(),emphasisFontFamily:n().optional(),emphasisFontWeight:A().min(BL).max(jL).optional(),emphasisTextTransform:h(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:i().optional(),emphasisFontStyle:h(["normal","italic"]).optional(),entrance:h(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:i().min(VL).optional(),entranceStaggerMs:i().min(UL).optional(),exitMs:i().min(HL).optional(),emphasisPlate:P().optional(),emphasisPlateColor:n().optional(),emphasisPlateTextColor:n().optional(),emphasisPlateAltColor:n().optional(),emphasisPlateAltTextColor:n().optional(),emphasisPlateRadius:i().min(WL).optional(),emphasisPlatePadX:i().optional(),emphasisPlatePadY:i().optional(),emphasisPlateReveal:P().optional().describe("Grow a shared emphasis plate as saved words appear while reserving its final layout width."),annotationColor:n().optional(),annotationStrokeWidth:i().min($L).max(GL).optional().describe("Annotation stroke width in its 100\xD7100 SVG coordinate system; default 4."),annotationTexture:h(["clean","pencil"]).optional().describe("Native annotation stroke finish; default clean."),maxWidthPercent:i().gt(KL).max(qL).optional()}).optional(),layouts:y(c({segmentIndex:A().min(YL).max(QL),wordStartIndex:A().min(JL).max(ZL),wordEndIndex:A().gt(XL).max(eD).describe("Exclusive word index in the saved caption segment."),region:c({x:i().min(tD).max(oD),y:i().min(rD).max(sD),w:i().gt(nD).max(iD),h:i().gt(aD).max(cD)}),scale:i().min(pD).max(dD).optional(),rotation:i().min(lD).max(uD).optional(),style:c({fontFamily:n().min(1).optional(),fontSize:i().min(1).max(mD).optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),fontWeight:A().min(hD).max(fD).optional(),color:n().min(1).optional(),highlightColor:n().min(1).optional(),backgroundColor:n().optional(),plate:h(["glass","solid","none"]).optional(),textTransform:h(["none","uppercase","capitalize"]).optional(),letterSpacing:i().min(xD).max(gD).optional().describe("Base caption glyph spacing in pixels."),wordGapEm:i().min(bD).max(yD).optional().describe("Gap between caption runs as a multiple of base font size; default 0.35."),lineGapEm:i().min(AD).max(SD).optional().describe("Gap between caption lines as a multiple of base font size; default 0.25."),emphasisColor:n().optional(),emphasisScale:i().gt(zD).optional(),emphasisFontFamily:n().optional(),emphasisFontWeight:A().min(TD).max(ED).optional(),emphasisTextTransform:h(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:i().optional(),emphasisFontStyle:h(["normal","italic"]).optional(),emphasisPlate:P().optional(),emphasisPlateColor:n().optional(),emphasisPlateTextColor:n().optional(),emphasisPlateAltColor:n().optional(),emphasisPlateAltTextColor:n().optional(),emphasisPlateRadius:i().min(CD).optional(),emphasisPlatePadX:i().optional(),emphasisPlatePadY:i().optional(),emphasisPlateReveal:P().optional().describe("Grow a shared emphasis plate as saved words appear while reserving its final layout width."),annotationColor:n().optional(),annotationStrokeWidth:i().min(ID).max(RD).optional().describe("Annotation stroke width in its 100\xD7100 SVG coordinate system; default 4."),annotationTexture:h(["clean","pencil"]).optional().describe("Native annotation stroke finish; default clean."),entrance:h(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:i().min(wD).optional(),entranceStaggerMs:i().min(OD).optional(),exitMs:i().min(MD).optional()}).optional(),holdThroughWordIndex:A().min(kD).max(PD).optional().describe("Inclusive saved-word index in this segment. The layout stays visible until that word ends."),wordMarks:y(c({wordIndex:A().min(LD).max(DD),emphasis:P().optional(),annotate:E([h(["circle","underline"]),G()]).optional()})).optional(),wordSignature:n().regex(vD)})).optional(),zPlane:h(["front","behind-subject"]).optional()})]).optional(),license:c({type:n().min(1),source:n().optional(),notes:n().optional()}).optional(),accessibility:c({audioDescriptionTrackId:n().optional(),captionsTrackId:n().optional(),signLanguageTrackId:n().optional(),notes:n().optional()}).optional()}).describe("Canonical composition wire shape (multi-track; carries reframe, captions, markers).");var le=E([G(),P(),i(),n(),y(Qs(()=>le)),O(n(),Qs(()=>le))]);var FD=64,ND=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),_D=1,BD=0,jD=1,VD=0,UD=1,HD=200,WD=4e3,$D=0,GD=3.141592653589793,KD=64,qD=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),YD=0,QD=1,JD=0,ZD=1,XD=0,e2=1,t2=0,o2=1,r2=0,s2=1,n2=2.333,i2=0,a2=1,c2=16,p2=64,d2=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),l2=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),u2=256,m2=new RegExp("^[a-f0-9]{64}$"),h2=0,f2=9007199254740991,x2=0,g2=9007199254740991,b2=0,y2=9007199254740991,A2=256,S2=0,z2=0,T2=9007199254740991,E2=0,C2=9007199254740991,I2=64,R2=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),w2=1,O2=0,M2=1,k2=0,P2=1,L2=80,D2=2e3,v2=64,F2=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),N2=0,_2=1,B2=0,j2=1,V2=0,U2=1,H2=0,W2=1,$2=0,G2=1,K2=2.333,q2=0,Y2=1,Q2=16,J2=64,Z2=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),X2=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),ev=256,tv=new RegExp("^[a-f0-9]{64}$"),ov=0,rv=9007199254740991,sv=0,nv=9007199254740991,iv=0,av=9007199254740991,cv=256,pv=0,dv=0,lv=9007199254740991,uv=0,mv=9007199254740991,hv=64,fv=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),xv=1,gv=0,bv=1,yv=0,Av=1,Sv=40,zv=8e3,Tv=40,Ev=8e3,Cv=32,Iv=4,Rv=200,wv=32,Ov=0,Mv=15,kv=0,Pv="satin",Lv=64,Dv=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),vv=0,Fv=1,Nv=0,_v=1,Bv=0,jv=1,Vv=0,Uv=1,Hv=0,Wv=1,$v=2.333,Gv=0,Kv=1,qv=16,Yv=64,Qv=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),Jv=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),Zv=256,Xv=new RegExp("^[a-f0-9]{64}$"),eF=0,tF=9007199254740991,oF=0,rF=9007199254740991,sF=0,nF=9007199254740991,iF=256,aF=0,cF=0,pF=9007199254740991,dF=0,lF=9007199254740991,uF=64,mF=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),hF=1,fF=0,xF=1,gF=0,bF=1,yF=40,AF=8e3,SF=40,zF=8e3,TF="contain",EF="straight",CF=!0,IF="hidden",RF=64,wF=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),OF=0,MF=1,kF=0,PF=1,LF=0,DF=1,vF=0,FF=1,NF=0,_F=1,BF=2.333,jF=0,VF=1,UF=16,HF=64,WF=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),$F=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),GF=256,KF=new RegExp("^[a-f0-9]{64}$"),qF=0,YF=9007199254740991,QF=0,JF=9007199254740991,ZF=0,XF=9007199254740991,eN=256,tN=0,oN=0,rN=9007199254740991,sN=0,nN=9007199254740991,iN=64,aN=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),cN=1,pN=0,dN=1,lN=512,uN=new RegExp("^[^\\r\\n]+$"),mN=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),hN=16,fN=24,xN=128,gN=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),bN=100,yN=900,AN=8,SN=800,zN=1.2,TN=.6,EN=3,CN=0,IN=-20,RN=40,wN="center",ON=0,MN=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),kN=1,PN=0,LN=64,DN=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),vN=1,FN=0,NN=1,_N=512,BN=new RegExp("^[^\\r\\n]+$"),jN=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),VN=16,UN=24,HN=128,WN=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),$N=100,GN=900,KN=8,qN=800,YN=1.2,QN=.6,JN=3,ZN=0,XN=-20,e_=40,t_="center",o_=0,r_=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),s_=0,n_=1,i_=0,Hm=E([c({kind:b("laptop"),id:n().min(1).max(FD).regex(ND),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(BD).default(_D)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(VD).max(UD).default(jD),width:i().min(HD).max(WD),openAngle:i().min($D).max(GD),materials:y(c({role:n().min(1).max(KD),type:h(["physical","unlit"]),color:E([n().regex(qD),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(YD).max(QD).optional(),metalness:i().min(JD).max(ZD).optional(),clearcoat:i().min(XD).max(e2).optional(),clearcoatRoughness:i().min(t2).max(o2).optional(),anisotropy:i().min(r2).max(s2).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(n2).optional(),reflectivity:i().min(i2).max(a2).optional()})).max(c2).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(p2).regex(d2).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(l2),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(u2),sourceVersionId:n().regex(m2)}),captureFrame:A().min(h2).max(f2),layout:c({width:A().gt(x2).max(g2),height:A().gt(b2).max(y2)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(A2),startFrame:A().min(z2).max(T2).default(S2),endFrame:A().gt(E2).max(C2).optional()})])).optional()}),c({kind:b("phone"),id:n().min(1).max(I2).regex(R2),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(O2).default(w2)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(k2).max(P2).default(M2),width:i().min(L2).max(D2),materials:y(c({role:n().min(1).max(v2),type:h(["physical","unlit"]),color:E([n().regex(F2),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(N2).max(_2).optional(),metalness:i().min(B2).max(j2).optional(),clearcoat:i().min(V2).max(U2).optional(),clearcoatRoughness:i().min(H2).max(W2).optional(),anisotropy:i().min($2).max(G2).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(K2).optional(),reflectivity:i().min(q2).max(Y2).optional()})).max(Q2).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(J2).regex(Z2).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(X2),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(ev),sourceVersionId:n().regex(tv)}),captureFrame:A().min(ov).max(rv),layout:c({width:A().gt(sv).max(nv),height:A().gt(iv).max(av)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(cv),startFrame:A().min(dv).max(lv).default(pv),endFrame:A().gt(uv).max(mv).optional()})])).optional()}),c({kind:b("slab"),id:n().min(1).max(hv).regex(fv),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(gv).default(xv)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(yv).max(Av).default(bv),width:i().min(Sv).max(zv),height:i().min(Tv).max(Ev),thickness:i().min(Iv).max(Rv).default(Cv),cornerRadius:i().min(Ov).default(wv),edgeRadius:i().min(kv).default(Mv),finish:h(["satin","brushed"]).default(Pv),materials:y(c({role:n().min(1).max(Lv),type:h(["physical","unlit"]),color:E([n().regex(Dv),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(vv).max(Fv).optional(),metalness:i().min(Nv).max(_v).optional(),clearcoat:i().min(Bv).max(jv).optional(),clearcoatRoughness:i().min(Vv).max(Uv).optional(),anisotropy:i().min(Hv).max(Wv).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max($v).optional(),reflectivity:i().min(Gv).max(Kv).optional()})).max(qv).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(Yv).regex(Qv).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(Jv),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(Zv),sourceVersionId:n().regex(Xv)}),captureFrame:A().min(eF).max(tF),layout:c({width:A().gt(oF).max(rF),height:A().gt(sF).max(nF)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(iF),startFrame:A().min(cF).max(pF).default(aF),endFrame:A().gt(dF).max(lF).optional()})])).optional()}),c({kind:b("page"),id:n().min(1).max(uF).regex(mF),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(fF).default(hF)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(gF).max(bF).default(xF),width:i().min(yF).max(AF),height:i().min(SF).max(zF),fit:h(["contain","cover"]).default(TF),transparency:h(["straight","premultiplied","opaque"]).default(EF),depthWrite:P().default(CF),backface:h(["hidden","visible"]).default(IF),materials:y(c({role:n().min(1).max(RF),type:h(["physical","unlit"]),color:E([n().regex(wF),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(OF).max(MF).optional(),metalness:i().min(kF).max(PF).optional(),clearcoat:i().min(LF).max(DF).optional(),clearcoatRoughness:i().min(vF).max(FF).optional(),anisotropy:i().min(NF).max(_F).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(BF).optional(),reflectivity:i().min(jF).max(VF).optional()})).max(UF).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(HF).regex(WF).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex($F),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(GF),sourceVersionId:n().regex(KF)}),captureFrame:A().min(qF).max(YF),layout:c({width:A().gt(QF).max(JF),height:A().gt(ZF).max(XF)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(eN),startFrame:A().min(oN).max(rN).default(tN),endFrame:A().gt(sN).max(nN).optional()})]))}),c({id:n().min(1).max(iN).regex(aN),kind:b("text"),opacity:i().min(pN).max(dN).default(cN),lines:y(c({runs:y(c({text:n().min(1).max(lN).regex(uN),color:E([n().regex(mN),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:P().optional()})).min(1).max(hN)})).min(1).max(fN),fontFamily:E([n().min(1).max(xN).regex(gN),h(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:A().min(bN).max(yN),fontStyle:h(["normal","italic"]),fontSize:i().min(AN).max(SN),lineHeight:i().min(TN).max(EN).default(zN),letterSpacing:i().min(IN).max(RN).default(CN),align:h(["left","center","right"]).default(wN),maxWidth:i().gt(ON).optional(),color:E([n().regex(MN),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:b("world"),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(PN).default(kN)}).default({position:[0,0,0],rotation:[0,0,0],scale:1})}),c({id:n().min(1).max(LN).regex(DN),kind:b("text"),opacity:i().min(FN).max(NN).default(vN),lines:y(c({runs:y(c({text:n().min(1).max(_N).regex(BN),color:E([n().regex(jN),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:P().optional()})).min(1).max(VN)})).min(1).max(UN),fontFamily:E([n().min(1).max(HN).regex(WN),h(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:A().min($N).max(GN),fontStyle:h(["normal","italic"]),fontSize:i().min(KN).max(qN),lineHeight:i().min(QN).max(JN).default(YN),letterSpacing:i().min(XN).max(e_).default(ZN),align:h(["left","center","right"]).default(t_),maxWidth:i().gt(o_).optional(),color:E([n().regex(r_),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:b("screen"),x:i(),y:i(),rotation:i().default(s_),scale:i().gt(i_).default(n_)})]);var a_=64,c_=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),p_=1,d_=0,l_=1,u_=0,m_=1,h_=16,f_=64,x_=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),g_=1,b_=0,y_=1,A_=0,S_=1,z_=200,T_=4e3,E_=0,C_=3.141592653589793,I_=64,R_=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),w_=0,O_=1,M_=0,k_=1,P_=0,L_=1,D_=0,v_=1,F_=0,N_=1,__=2.333,B_=0,j_=1,V_=16,U_=64,H_=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),W_=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),$_=256,G_=new RegExp("^[a-f0-9]{64}$"),K_=0,q_=9007199254740991,Y_=0,Q_=9007199254740991,J_=0,Z_=9007199254740991,X_=256,eB=0,tB=0,oB=9007199254740991,rB=0,sB=9007199254740991,nB=64,iB=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),aB=1,cB=0,pB=1,dB=0,lB=1,uB=80,mB=2e3,hB=64,fB=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),xB=0,gB=1,bB=0,yB=1,AB=0,SB=1,zB=0,TB=1,EB=0,CB=1,IB=2.333,RB=0,wB=1,OB=16,MB=64,kB=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),PB=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),LB=256,DB=new RegExp("^[a-f0-9]{64}$"),vB=0,FB=9007199254740991,NB=0,_B=9007199254740991,BB=0,jB=9007199254740991,VB=256,UB=0,HB=0,WB=9007199254740991,$B=0,GB=9007199254740991,KB=64,qB=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),YB=1,QB=0,JB=1,ZB=0,XB=1,ej=40,tj=8e3,oj=40,rj=8e3,sj=32,nj=4,ij=200,aj=32,cj=0,pj=15,dj=0,lj="satin",uj=64,mj=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),hj=0,fj=1,xj=0,gj=1,bj=0,yj=1,Aj=0,Sj=1,zj=0,Tj=1,Ej=2.333,Cj=0,Ij=1,Rj=16,wj=64,Oj=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),Mj=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),kj=256,Pj=new RegExp("^[a-f0-9]{64}$"),Lj=0,Dj=9007199254740991,vj=0,Fj=9007199254740991,Nj=0,_j=9007199254740991,Bj=256,jj=0,Vj=0,Uj=9007199254740991,Hj=0,Wj=9007199254740991,$j=64,Gj=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),Kj=1,qj=0,Yj=1,Qj=0,Jj=1,Zj=40,Xj=8e3,eV=40,tV=8e3,oV="contain",rV="straight",sV=!0,nV="hidden",iV=64,aV=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),cV=0,pV=1,dV=0,lV=1,uV=0,mV=1,hV=0,fV=1,xV=0,gV=1,bV=2.333,yV=0,AV=1,SV=16,zV=64,TV=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),EV=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),CV=256,IV=new RegExp("^[a-f0-9]{64}$"),RV=0,wV=9007199254740991,OV=0,MV=9007199254740991,kV=0,PV=9007199254740991,LV=256,DV=0,vV=0,FV=9007199254740991,NV=0,_V=9007199254740991,BV=64,jV=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),VV=1,UV=0,HV=1,WV=512,$V=new RegExp("^[^\\r\\n]+$"),GV=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),KV=16,qV=24,YV=128,QV=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),JV=100,ZV=900,XV=8,e4=800,t4=1.2,o4=.6,r4=3,s4=0,n4=-20,i4=40,a4="center",c4=0,p4=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),d4=1,l4=0,u4=64,m4=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),h4=1,f4=0,x4=1,g4=512,b4=new RegExp("^[^\\r\\n]+$"),y4=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),A4=16,S4=24,z4=128,T4=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),E4=100,C4=900,I4=8,R4=800,w4=1.2,O4=.6,M4=3,k4=0,P4=-20,L4=40,D4="center",v4=0,F4=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),N4=0,_4=1,B4=0,Wm=E([c({kind:b("group"),id:n().min(1).max(a_).regex(c_),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(d_).default(p_)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(u_).max(m_).default(l_),children:y(Hm).min(1).max(h_)}),c({kind:b("laptop"),id:n().min(1).max(f_).regex(x_),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(b_).default(g_)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(A_).max(S_).default(y_),width:i().min(z_).max(T_),openAngle:i().min(E_).max(C_),materials:y(c({role:n().min(1).max(I_),type:h(["physical","unlit"]),color:E([n().regex(R_),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(w_).max(O_).optional(),metalness:i().min(M_).max(k_).optional(),clearcoat:i().min(P_).max(L_).optional(),clearcoatRoughness:i().min(D_).max(v_).optional(),anisotropy:i().min(F_).max(N_).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(__).optional(),reflectivity:i().min(B_).max(j_).optional()})).max(V_).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(U_).regex(H_).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(W_),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max($_),sourceVersionId:n().regex(G_)}),captureFrame:A().min(K_).max(q_),layout:c({width:A().gt(Y_).max(Q_),height:A().gt(J_).max(Z_)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(X_),startFrame:A().min(tB).max(oB).default(eB),endFrame:A().gt(rB).max(sB).optional()})])).optional()}),c({kind:b("phone"),id:n().min(1).max(nB).regex(iB),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(cB).default(aB)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(dB).max(lB).default(pB),width:i().min(uB).max(mB),materials:y(c({role:n().min(1).max(hB),type:h(["physical","unlit"]),color:E([n().regex(fB),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(xB).max(gB).optional(),metalness:i().min(bB).max(yB).optional(),clearcoat:i().min(AB).max(SB).optional(),clearcoatRoughness:i().min(zB).max(TB).optional(),anisotropy:i().min(EB).max(CB).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(IB).optional(),reflectivity:i().min(RB).max(wB).optional()})).max(OB).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(MB).regex(kB).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(PB),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(LB),sourceVersionId:n().regex(DB)}),captureFrame:A().min(vB).max(FB),layout:c({width:A().gt(NB).max(_B),height:A().gt(BB).max(jB)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(VB),startFrame:A().min(HB).max(WB).default(UB),endFrame:A().gt($B).max(GB).optional()})])).optional()}),c({kind:b("slab"),id:n().min(1).max(KB).regex(qB),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(QB).default(YB)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(ZB).max(XB).default(JB),width:i().min(ej).max(tj),height:i().min(oj).max(rj),thickness:i().min(nj).max(ij).default(sj),cornerRadius:i().min(cj).default(aj),edgeRadius:i().min(dj).default(pj),finish:h(["satin","brushed"]).default(lj),materials:y(c({role:n().min(1).max(uj),type:h(["physical","unlit"]),color:E([n().regex(mj),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(hj).max(fj).optional(),metalness:i().min(xj).max(gj).optional(),clearcoat:i().min(bj).max(yj).optional(),clearcoatRoughness:i().min(Aj).max(Sj).optional(),anisotropy:i().min(zj).max(Tj).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(Ej).optional(),reflectivity:i().min(Cj).max(Ij).optional()})).max(Rj).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(wj).regex(Oj).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(Mj),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(kj),sourceVersionId:n().regex(Pj)}),captureFrame:A().min(Lj).max(Dj),layout:c({width:A().gt(vj).max(Fj),height:A().gt(Nj).max(_j)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(Bj),startFrame:A().min(Vj).max(Uj).default(jj),endFrame:A().gt(Hj).max(Wj).optional()})])).optional()}),c({kind:b("page"),id:n().min(1).max($j).regex(Gj),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(qj).default(Kj)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(Qj).max(Jj).default(Yj),width:i().min(Zj).max(Xj),height:i().min(eV).max(tV),fit:h(["contain","cover"]).default(oV),transparency:h(["straight","premultiplied","opaque"]).default(rV),depthWrite:P().default(sV),backface:h(["hidden","visible"]).default(nV),materials:y(c({role:n().min(1).max(iV),type:h(["physical","unlit"]),color:E([n().regex(aV),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(cV).max(pV).optional(),metalness:i().min(dV).max(lV).optional(),clearcoat:i().min(uV).max(mV).optional(),clearcoatRoughness:i().min(hV).max(fV).optional(),anisotropy:i().min(xV).max(gV).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(bV).optional(),reflectivity:i().min(yV).max(AV).optional()})).max(SV).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(zV).regex(TV).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(EV),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(CV),sourceVersionId:n().regex(IV)}),captureFrame:A().min(RV).max(wV),layout:c({width:A().gt(OV).max(MV),height:A().gt(kV).max(PV)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(LV),startFrame:A().min(vV).max(FV).default(DV),endFrame:A().gt(NV).max(_V).optional()})]))}),c({id:n().min(1).max(BV).regex(jV),kind:b("text"),opacity:i().min(UV).max(HV).default(VV),lines:y(c({runs:y(c({text:n().min(1).max(WV).regex($V),color:E([n().regex(GV),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:P().optional()})).min(1).max(KV)})).min(1).max(qV),fontFamily:E([n().min(1).max(YV).regex(QV),h(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:A().min(JV).max(ZV),fontStyle:h(["normal","italic"]),fontSize:i().min(XV).max(e4),lineHeight:i().min(o4).max(r4).default(t4),letterSpacing:i().min(n4).max(i4).default(s4),align:h(["left","center","right"]).default(a4),maxWidth:i().gt(c4).optional(),color:E([n().regex(p4),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:b("world"),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(l4).default(d4)}).default({position:[0,0,0],rotation:[0,0,0],scale:1})}),c({id:n().min(1).max(u4).regex(m4),kind:b("text"),opacity:i().min(f4).max(x4).default(h4),lines:y(c({runs:y(c({text:n().min(1).max(g4).regex(b4),color:E([n().regex(y4),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:P().optional()})).min(1).max(A4)})).min(1).max(S4),fontFamily:E([n().min(1).max(z4).regex(T4),h(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:A().min(E4).max(C4),fontStyle:h(["normal","italic"]),fontSize:i().min(I4).max(R4),lineHeight:i().min(O4).max(M4).default(w4),letterSpacing:i().min(P4).max(L4).default(k4),align:h(["left","center","right"]).default(D4),maxWidth:i().gt(v4).optional(),color:E([n().regex(F4),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:b("screen"),x:i(),y:i(),rotation:i().default(N4),scale:i().gt(B4).default(_4)})]);var j4=64,V4=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),U4=1,H4=0,W4=1,$4=0,G4=1,K4=16,q4=64,Y4=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),Q4=1,J4=0,Z4=1,X4=0,e9=1,t9=200,o9=4e3,r9=0,s9=3.141592653589793,n9=64,i9=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),a9=0,c9=1,p9=0,d9=1,l9=0,u9=1,m9=0,h9=1,f9=0,x9=1,g9=2.333,b9=0,y9=1,A9=16,S9=64,z9=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),T9=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),E9=256,C9=new RegExp("^[a-f0-9]{64}$"),I9=0,R9=9007199254740991,w9=0,O9=9007199254740991,M9=0,k9=9007199254740991,P9=256,L9=0,D9=0,v9=9007199254740991,F9=0,N9=9007199254740991,_9=64,B9=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),j9=1,V9=0,U9=1,H9=0,W9=1,$9=80,G9=2e3,K9=64,q9=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),Y9=0,Q9=1,J9=0,Z9=1,X9=0,eU=1,tU=0,oU=1,rU=0,sU=1,nU=2.333,iU=0,aU=1,cU=16,pU=64,dU=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),lU=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),uU=256,mU=new RegExp("^[a-f0-9]{64}$"),hU=0,fU=9007199254740991,xU=0,gU=9007199254740991,bU=0,yU=9007199254740991,AU=256,SU=0,zU=0,TU=9007199254740991,EU=0,CU=9007199254740991,IU=64,RU=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),wU=1,OU=0,MU=1,kU=0,PU=1,LU=40,DU=8e3,vU=40,FU=8e3,NU=32,_U=4,BU=200,jU=32,VU=0,UU=15,HU=0,WU="satin",$U=64,GU=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),KU=0,qU=1,YU=0,QU=1,JU=0,ZU=1,XU=0,e3=1,t3=0,o3=1,r3=2.333,s3=0,n3=1,i3=16,a3=64,c3=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),p3=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),d3=256,l3=new RegExp("^[a-f0-9]{64}$"),u3=0,m3=9007199254740991,h3=0,f3=9007199254740991,x3=0,g3=9007199254740991,b3=256,y3=0,A3=0,S3=9007199254740991,z3=0,T3=9007199254740991,E3=64,C3=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),I3=1,R3=0,w3=1,O3=0,M3=1,k3=40,P3=8e3,L3=40,D3=8e3,v3="contain",F3="straight",N3=!0,_3="hidden",B3=64,j3=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),V3=0,U3=1,H3=0,W3=1,$3=0,G3=1,K3=0,q3=1,Y3=0,Q3=1,J3=2.333,Z3=0,X3=1,eH=16,tH=64,oH=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),rH=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),sH=256,nH=new RegExp("^[a-f0-9]{64}$"),iH=0,aH=9007199254740991,cH=0,pH=9007199254740991,dH=0,lH=9007199254740991,uH=256,mH=0,hH=0,fH=9007199254740991,xH=0,gH=9007199254740991,bH=64,yH=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),AH=1,SH=0,zH=1,TH=512,EH=new RegExp("^[^\\r\\n]+$"),CH=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),IH=16,RH=24,wH=128,OH=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),MH=100,kH=900,PH=8,LH=800,DH=1.2,vH=.6,FH=3,NH=0,_H=-20,BH=40,jH="center",VH=0,UH=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),HH=1,WH=0,$H=64,GH=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),KH=1,qH=0,YH=1,QH=512,JH=new RegExp("^[^\\r\\n]+$"),ZH=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),XH=16,eW=24,tW=128,oW=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),rW=100,sW=900,nW=8,iW=800,aW=1.2,cW=.6,pW=3,dW=0,lW=-20,uW=40,mW="center",hW=0,fW=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),xW=0,gW=1,bW=0,$m=E([c({kind:b("group"),id:n().min(1).max(j4).regex(V4),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(H4).default(U4)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min($4).max(G4).default(W4),children:y(Wm).min(1).max(K4)}),c({kind:b("laptop"),id:n().min(1).max(q4).regex(Y4),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(J4).default(Q4)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(X4).max(e9).default(Z4),width:i().min(t9).max(o9),openAngle:i().min(r9).max(s9),materials:y(c({role:n().min(1).max(n9),type:h(["physical","unlit"]),color:E([n().regex(i9),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(a9).max(c9).optional(),metalness:i().min(p9).max(d9).optional(),clearcoat:i().min(l9).max(u9).optional(),clearcoatRoughness:i().min(m9).max(h9).optional(),anisotropy:i().min(f9).max(x9).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(g9).optional(),reflectivity:i().min(b9).max(y9).optional()})).max(A9).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(S9).regex(z9).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(T9),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(E9),sourceVersionId:n().regex(C9)}),captureFrame:A().min(I9).max(R9),layout:c({width:A().gt(w9).max(O9),height:A().gt(M9).max(k9)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(P9),startFrame:A().min(D9).max(v9).default(L9),endFrame:A().gt(F9).max(N9).optional()})])).optional()}),c({kind:b("phone"),id:n().min(1).max(_9).regex(B9),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(V9).default(j9)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(H9).max(W9).default(U9),width:i().min($9).max(G9),materials:y(c({role:n().min(1).max(K9),type:h(["physical","unlit"]),color:E([n().regex(q9),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(Y9).max(Q9).optional(),metalness:i().min(J9).max(Z9).optional(),clearcoat:i().min(X9).max(eU).optional(),clearcoatRoughness:i().min(tU).max(oU).optional(),anisotropy:i().min(rU).max(sU).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(nU).optional(),reflectivity:i().min(iU).max(aU).optional()})).max(cU).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(pU).regex(dU).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(lU),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(uU),sourceVersionId:n().regex(mU)}),captureFrame:A().min(hU).max(fU),layout:c({width:A().gt(xU).max(gU),height:A().gt(bU).max(yU)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(AU),startFrame:A().min(zU).max(TU).default(SU),endFrame:A().gt(EU).max(CU).optional()})])).optional()}),c({kind:b("slab"),id:n().min(1).max(IU).regex(RU),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(OU).default(wU)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(kU).max(PU).default(MU),width:i().min(LU).max(DU),height:i().min(vU).max(FU),thickness:i().min(_U).max(BU).default(NU),cornerRadius:i().min(VU).default(jU),edgeRadius:i().min(HU).default(UU),finish:h(["satin","brushed"]).default(WU),materials:y(c({role:n().min(1).max($U),type:h(["physical","unlit"]),color:E([n().regex(GU),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(KU).max(qU).optional(),metalness:i().min(YU).max(QU).optional(),clearcoat:i().min(JU).max(ZU).optional(),clearcoatRoughness:i().min(XU).max(e3).optional(),anisotropy:i().min(t3).max(o3).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(r3).optional(),reflectivity:i().min(s3).max(n3).optional()})).max(i3).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(a3).regex(c3).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(p3),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(d3),sourceVersionId:n().regex(l3)}),captureFrame:A().min(u3).max(m3),layout:c({width:A().gt(h3).max(f3),height:A().gt(x3).max(g3)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(b3),startFrame:A().min(A3).max(S3).default(y3),endFrame:A().gt(z3).max(T3).optional()})])).optional()}),c({kind:b("page"),id:n().min(1).max(E3).regex(C3),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(R3).default(I3)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(O3).max(M3).default(w3),width:i().min(k3).max(P3),height:i().min(L3).max(D3),fit:h(["contain","cover"]).default(v3),transparency:h(["straight","premultiplied","opaque"]).default(F3),depthWrite:P().default(N3),backface:h(["hidden","visible"]).default(_3),materials:y(c({role:n().min(1).max(B3),type:h(["physical","unlit"]),color:E([n().regex(j3),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(V3).max(U3).optional(),metalness:i().min(H3).max(W3).optional(),clearcoat:i().min($3).max(G3).optional(),clearcoatRoughness:i().min(K3).max(q3).optional(),anisotropy:i().min(Y3).max(Q3).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(J3).optional(),reflectivity:i().min(Z3).max(X3).optional()})).max(eH).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(tH).regex(oH).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(rH),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(sH),sourceVersionId:n().regex(nH)}),captureFrame:A().min(iH).max(aH),layout:c({width:A().gt(cH).max(pH),height:A().gt(dH).max(lH)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(uH),startFrame:A().min(hH).max(fH).default(mH),endFrame:A().gt(xH).max(gH).optional()})]))}),c({id:n().min(1).max(bH).regex(yH),kind:b("text"),opacity:i().min(SH).max(zH).default(AH),lines:y(c({runs:y(c({text:n().min(1).max(TH).regex(EH),color:E([n().regex(CH),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:P().optional()})).min(1).max(IH)})).min(1).max(RH),fontFamily:E([n().min(1).max(wH).regex(OH),h(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:A().min(MH).max(kH),fontStyle:h(["normal","italic"]),fontSize:i().min(PH).max(LH),lineHeight:i().min(vH).max(FH).default(DH),letterSpacing:i().min(_H).max(BH).default(NH),align:h(["left","center","right"]).default(jH),maxWidth:i().gt(VH).optional(),color:E([n().regex(UH),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:b("world"),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(WH).default(HH)}).default({position:[0,0,0],rotation:[0,0,0],scale:1})}),c({id:n().min(1).max($H).regex(GH),kind:b("text"),opacity:i().min(qH).max(YH).default(KH),lines:y(c({runs:y(c({text:n().min(1).max(QH).regex(JH),color:E([n().regex(ZH),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:P().optional()})).min(1).max(XH)})).min(1).max(eW),fontFamily:E([n().min(1).max(tW).regex(oW),h(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:A().min(rW).max(sW),fontStyle:h(["normal","italic"]),fontSize:i().min(nW).max(iW),lineHeight:i().min(cW).max(pW).default(aW),letterSpacing:i().min(lW).max(uW).default(dW),align:h(["left","center","right"]).default(mW),maxWidth:i().gt(hW).optional(),color:E([n().regex(fW),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:b("screen"),x:i(),y:i(),rotation:i().default(xW),scale:i().gt(bW).default(gW)})]);var yW=64,AW=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),SW=1,zW=0,TW=1,EW=0,CW=1,IW=16,RW=64,wW=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),OW=1,MW=0,kW=1,PW=0,LW=1,DW=200,vW=4e3,FW=0,NW=3.141592653589793,_W=64,BW=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),jW=0,VW=1,UW=0,HW=1,WW=0,$W=1,GW=0,KW=1,qW=0,YW=1,QW=2.333,JW=0,ZW=1,XW=16,e5=64,t5=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),o5=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),r5=256,s5=new RegExp("^[a-f0-9]{64}$"),n5=0,i5=9007199254740991,a5=0,c5=9007199254740991,p5=0,d5=9007199254740991,l5=256,u5=0,m5=0,h5=9007199254740991,f5=0,x5=9007199254740991,g5=64,b5=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),y5=1,A5=0,S5=1,z5=0,T5=1,E5=80,C5=2e3,I5=64,R5=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),w5=0,O5=1,M5=0,k5=1,P5=0,L5=1,D5=0,v5=1,F5=0,N5=1,_5=2.333,B5=0,j5=1,V5=16,U5=64,H5=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),W5=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),$5=256,G5=new RegExp("^[a-f0-9]{64}$"),K5=0,q5=9007199254740991,Y5=0,Q5=9007199254740991,J5=0,Z5=9007199254740991,X5=256,e$=0,t$=0,o$=9007199254740991,r$=0,s$=9007199254740991,n$=64,i$=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),a$=1,c$=0,p$=1,d$=0,l$=1,u$=40,m$=8e3,h$=40,f$=8e3,x$=32,g$=4,b$=200,y$=32,A$=0,S$=15,z$=0,T$="satin",E$=64,C$=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),I$=0,R$=1,w$=0,O$=1,M$=0,k$=1,P$=0,L$=1,D$=0,v$=1,F$=2.333,N$=0,_$=1,B$=16,j$=64,V$=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),U$=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),H$=256,W$=new RegExp("^[a-f0-9]{64}$"),$$=0,G$=9007199254740991,K$=0,q$=9007199254740991,Y$=0,Q$=9007199254740991,J$=256,Z$=0,X$=0,eG=9007199254740991,tG=0,oG=9007199254740991,rG=64,sG=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),nG=1,iG=0,aG=1,cG=0,pG=1,dG=40,lG=8e3,uG=40,mG=8e3,hG="contain",fG="straight",xG=!0,gG="hidden",bG=64,yG=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),AG=0,SG=1,zG=0,TG=1,EG=0,CG=1,IG=0,RG=1,wG=0,OG=1,MG=2.333,kG=0,PG=1,LG=16,DG=64,vG=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),FG=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),NG=256,_G=new RegExp("^[a-f0-9]{64}$"),BG=0,jG=9007199254740991,VG=0,UG=9007199254740991,HG=0,WG=9007199254740991,$G=256,GG=0,KG=0,qG=9007199254740991,YG=0,QG=9007199254740991,JG=64,ZG=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),XG=1,e8=0,t8=1,o8=512,r8=new RegExp("^[^\\r\\n]+$"),s8=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),n8=16,i8=24,a8=128,c8=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),p8=100,d8=900,l8=8,u8=800,m8=1.2,h8=.6,f8=3,x8=0,g8=-20,b8=40,y8="center",A8=0,S8=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),z8=1,T8=0,E8=64,C8=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),I8=1,R8=0,w8=1,O8=512,M8=new RegExp("^[^\\r\\n]+$"),k8=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),P8=16,L8=24,D8=128,v8=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),F8=100,N8=900,_8=8,B8=800,j8=1.2,V8=.6,U8=3,H8=0,W8=-20,$8=40,G8="center",K8=0,q8=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),Y8=0,Q8=1,J8=0,Gm=E([c({kind:b("group"),id:n().min(1).max(yW).regex(AW),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(zW).default(SW)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(EW).max(CW).default(TW),children:y($m).min(1).max(IW)}),c({kind:b("laptop"),id:n().min(1).max(RW).regex(wW),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(MW).default(OW)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(PW).max(LW).default(kW),width:i().min(DW).max(vW),openAngle:i().min(FW).max(NW),materials:y(c({role:n().min(1).max(_W),type:h(["physical","unlit"]),color:E([n().regex(BW),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(jW).max(VW).optional(),metalness:i().min(UW).max(HW).optional(),clearcoat:i().min(WW).max($W).optional(),clearcoatRoughness:i().min(GW).max(KW).optional(),anisotropy:i().min(qW).max(YW).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(QW).optional(),reflectivity:i().min(JW).max(ZW).optional()})).max(XW).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(e5).regex(t5).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(o5),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(r5),sourceVersionId:n().regex(s5)}),captureFrame:A().min(n5).max(i5),layout:c({width:A().gt(a5).max(c5),height:A().gt(p5).max(d5)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(l5),startFrame:A().min(m5).max(h5).default(u5),endFrame:A().gt(f5).max(x5).optional()})])).optional()}),c({kind:b("phone"),id:n().min(1).max(g5).regex(b5),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(A5).default(y5)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(z5).max(T5).default(S5),width:i().min(E5).max(C5),materials:y(c({role:n().min(1).max(I5),type:h(["physical","unlit"]),color:E([n().regex(R5),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(w5).max(O5).optional(),metalness:i().min(M5).max(k5).optional(),clearcoat:i().min(P5).max(L5).optional(),clearcoatRoughness:i().min(D5).max(v5).optional(),anisotropy:i().min(F5).max(N5).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(_5).optional(),reflectivity:i().min(B5).max(j5).optional()})).max(V5).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(U5).regex(H5).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(W5),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max($5),sourceVersionId:n().regex(G5)}),captureFrame:A().min(K5).max(q5),layout:c({width:A().gt(Y5).max(Q5),height:A().gt(J5).max(Z5)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(X5),startFrame:A().min(t$).max(o$).default(e$),endFrame:A().gt(r$).max(s$).optional()})])).optional()}),c({kind:b("slab"),id:n().min(1).max(n$).regex(i$),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(c$).default(a$)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(d$).max(l$).default(p$),width:i().min(u$).max(m$),height:i().min(h$).max(f$),thickness:i().min(g$).max(b$).default(x$),cornerRadius:i().min(A$).default(y$),edgeRadius:i().min(z$).default(S$),finish:h(["satin","brushed"]).default(T$),materials:y(c({role:n().min(1).max(E$),type:h(["physical","unlit"]),color:E([n().regex(C$),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(I$).max(R$).optional(),metalness:i().min(w$).max(O$).optional(),clearcoat:i().min(M$).max(k$).optional(),clearcoatRoughness:i().min(P$).max(L$).optional(),anisotropy:i().min(D$).max(v$).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(F$).optional(),reflectivity:i().min(N$).max(_$).optional()})).max(B$).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(j$).regex(V$).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(U$),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(H$),sourceVersionId:n().regex(W$)}),captureFrame:A().min($$).max(G$),layout:c({width:A().gt(K$).max(q$),height:A().gt(Y$).max(Q$)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(J$),startFrame:A().min(X$).max(eG).default(Z$),endFrame:A().gt(tG).max(oG).optional()})])).optional()}),c({kind:b("page"),id:n().min(1).max(rG).regex(sG),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(iG).default(nG)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(cG).max(pG).default(aG),width:i().min(dG).max(lG),height:i().min(uG).max(mG),fit:h(["contain","cover"]).default(hG),transparency:h(["straight","premultiplied","opaque"]).default(fG),depthWrite:P().default(xG),backface:h(["hidden","visible"]).default(gG),materials:y(c({role:n().min(1).max(bG),type:h(["physical","unlit"]),color:E([n().regex(yG),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(AG).max(SG).optional(),metalness:i().min(zG).max(TG).optional(),clearcoat:i().min(EG).max(CG).optional(),clearcoatRoughness:i().min(IG).max(RG).optional(),anisotropy:i().min(wG).max(OG).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(MG).optional(),reflectivity:i().min(kG).max(PG).optional()})).max(LG).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(DG).regex(vG).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(FG),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(NG),sourceVersionId:n().regex(_G)}),captureFrame:A().min(BG).max(jG),layout:c({width:A().gt(VG).max(UG),height:A().gt(HG).max(WG)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max($G),startFrame:A().min(KG).max(qG).default(GG),endFrame:A().gt(YG).max(QG).optional()})]))}),c({id:n().min(1).max(JG).regex(ZG),kind:b("text"),opacity:i().min(e8).max(t8).default(XG),lines:y(c({runs:y(c({text:n().min(1).max(o8).regex(r8),color:E([n().regex(s8),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:P().optional()})).min(1).max(n8)})).min(1).max(i8),fontFamily:E([n().min(1).max(a8).regex(c8),h(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:A().min(p8).max(d8),fontStyle:h(["normal","italic"]),fontSize:i().min(l8).max(u8),lineHeight:i().min(h8).max(f8).default(m8),letterSpacing:i().min(g8).max(b8).default(x8),align:h(["left","center","right"]).default(y8),maxWidth:i().gt(A8).optional(),color:E([n().regex(S8),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:b("world"),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(T8).default(z8)}).default({position:[0,0,0],rotation:[0,0,0],scale:1})}),c({id:n().min(1).max(E8).regex(C8),kind:b("text"),opacity:i().min(R8).max(w8).default(I8),lines:y(c({runs:y(c({text:n().min(1).max(O8).regex(M8),color:E([n().regex(k8),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:P().optional()})).min(1).max(P8)})).min(1).max(L8),fontFamily:E([n().min(1).max(D8).regex(v8),h(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:A().min(F8).max(N8),fontStyle:h(["normal","italic"]),fontSize:i().min(_8).max(B8),lineHeight:i().min(V8).max(U8).default(j8),letterSpacing:i().min(W8).max($8).default(H8),align:h(["left","center","right"]).default(G8),maxWidth:i().gt(K8).optional(),color:E([n().regex(q8),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:b("screen"),x:i(),y:i(),rotation:i().default(Y8),scale:i().gt(J8).default(Q8)})]);var Z8=64,X8=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),e6=1,t6=0,o6=1,r6=0,s6=1,n6=16,i6=64,a6=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),c6=1,p6=0,d6=1,l6=0,u6=1,m6=200,h6=4e3,f6=0,x6=3.141592653589793,g6=64,b6=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),y6=0,A6=1,S6=0,z6=1,T6=0,E6=1,C6=0,I6=1,R6=0,w6=1,O6=2.333,M6=0,k6=1,P6=16,L6=64,D6=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),v6=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),F6=256,N6=new RegExp("^[a-f0-9]{64}$"),_6=0,B6=9007199254740991,j6=0,V6=9007199254740991,U6=0,H6=9007199254740991,W6=256,$6=0,G6=0,K6=9007199254740991,q6=0,Y6=9007199254740991,Q6=64,J6=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),Z6=1,X6=0,eK=1,tK=0,oK=1,rK=80,sK=2e3,nK=64,iK=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),aK=0,cK=1,pK=0,dK=1,lK=0,uK=1,mK=0,hK=1,fK=0,xK=1,gK=2.333,bK=0,yK=1,AK=16,SK=64,zK=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),TK=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),EK=256,CK=new RegExp("^[a-f0-9]{64}$"),IK=0,RK=9007199254740991,wK=0,OK=9007199254740991,MK=0,kK=9007199254740991,PK=256,LK=0,DK=0,vK=9007199254740991,FK=0,NK=9007199254740991,_K=64,BK=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),jK=1,VK=0,UK=1,HK=0,WK=1,$K=40,GK=8e3,KK=40,qK=8e3,YK=32,QK=4,JK=200,ZK=32,XK=0,e7=15,t7=0,o7="satin",r7=64,s7=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),n7=0,i7=1,a7=0,c7=1,p7=0,d7=1,l7=0,u7=1,m7=0,h7=1,f7=2.333,x7=0,g7=1,b7=16,y7=64,A7=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),S7=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),z7=256,T7=new RegExp("^[a-f0-9]{64}$"),E7=0,C7=9007199254740991,I7=0,R7=9007199254740991,w7=0,O7=9007199254740991,M7=256,k7=0,P7=0,L7=9007199254740991,D7=0,v7=9007199254740991,F7=64,N7=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),_7=1,B7=0,j7=1,V7=0,U7=1,H7=40,W7=8e3,$7=40,G7=8e3,K7="contain",q7="straight",Y7=!0,Q7="hidden",J7=64,Z7=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),X7=0,eq=1,tq=0,oq=1,rq=0,sq=1,nq=0,iq=1,aq=0,cq=1,pq=2.333,dq=0,lq=1,uq=16,mq=64,hq=new RegExp("^[A-Za-z_][A-Za-z0-9_-]*$"),fq=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),xq=256,gq=new RegExp("^[a-f0-9]{64}$"),bq=0,yq=9007199254740991,Aq=0,Sq=9007199254740991,zq=0,Tq=9007199254740991,Eq=256,Cq=0,Iq=0,Rq=9007199254740991,wq=0,Oq=9007199254740991,Mq=64,kq=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),Pq=1,Lq=0,Dq=1,vq=512,Fq=new RegExp("^[^\\r\\n]+$"),Nq=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),_q=16,Bq=24,jq=128,Vq=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),Uq=100,Hq=900,Wq=8,$q=800,Gq=1.2,Kq=.6,qq=3,Yq=0,Qq=-20,Jq=40,Zq="center",Xq=0,eY=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),tY=1,oY=0,rY=64,sY=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),nY=1,iY=0,aY=1,cY=512,pY=new RegExp("^[^\\r\\n]+$"),dY=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),lY=16,uY=24,mY=128,hY=new RegExp("^[A-Za-z0-9][A-Za-z0-9 _.\\-]*$"),fY=100,xY=900,gY=8,bY=800,yY=1.2,AY=.6,SY=3,zY=0,TY=-20,EY=40,CY="center",IY=0,RY=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),wY=0,OY=1,MY=0,Km=E([c({kind:b("group"),id:n().min(1).max(Z8).regex(X8),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(t6).default(e6)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(r6).max(s6).default(o6),children:y(Gm).min(1).max(n6)}),c({kind:b("laptop"),id:n().min(1).max(i6).regex(a6),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(p6).default(c6)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(l6).max(u6).default(d6),width:i().min(m6).max(h6),openAngle:i().min(f6).max(x6),materials:y(c({role:n().min(1).max(g6),type:h(["physical","unlit"]),color:E([n().regex(b6),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(y6).max(A6).optional(),metalness:i().min(S6).max(z6).optional(),clearcoat:i().min(T6).max(E6).optional(),clearcoatRoughness:i().min(C6).max(I6).optional(),anisotropy:i().min(R6).max(w6).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(O6).optional(),reflectivity:i().min(M6).max(k6).optional()})).max(P6).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(L6).regex(D6).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(v6),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(F6),sourceVersionId:n().regex(N6)}),captureFrame:A().min(_6).max(B6),layout:c({width:A().gt(j6).max(V6),height:A().gt(U6).max(H6)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(W6),startFrame:A().min(G6).max(K6).default($6),endFrame:A().gt(q6).max(Y6).optional()})])).optional()}),c({kind:b("phone"),id:n().min(1).max(Q6).regex(J6),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(X6).default(Z6)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(tK).max(oK).default(eK),width:i().min(rK).max(sK),materials:y(c({role:n().min(1).max(nK),type:h(["physical","unlit"]),color:E([n().regex(iK),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(aK).max(cK).optional(),metalness:i().min(pK).max(dK).optional(),clearcoat:i().min(lK).max(uK).optional(),clearcoatRoughness:i().min(mK).max(hK).optional(),anisotropy:i().min(fK).max(xK).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(gK).optional(),reflectivity:i().min(bK).max(yK).optional()})).max(AK).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(SK).regex(zK).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(TK),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(EK),sourceVersionId:n().regex(CK)}),captureFrame:A().min(IK).max(RK),layout:c({width:A().gt(wK).max(OK),height:A().gt(MK).max(kK)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(PK),startFrame:A().min(DK).max(vK).default(LK),endFrame:A().gt(FK).max(NK).optional()})])).optional()}),c({kind:b("slab"),id:n().min(1).max(_K).regex(BK),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(VK).default(jK)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(HK).max(WK).default(UK),width:i().min($K).max(GK),height:i().min(KK).max(qK),thickness:i().min(QK).max(JK).default(YK),cornerRadius:i().min(XK).default(ZK),edgeRadius:i().min(t7).default(e7),finish:h(["satin","brushed"]).default(o7),materials:y(c({role:n().min(1).max(r7),type:h(["physical","unlit"]),color:E([n().regex(s7),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(n7).max(i7).optional(),metalness:i().min(a7).max(c7).optional(),clearcoat:i().min(p7).max(d7).optional(),clearcoatRoughness:i().min(l7).max(u7).optional(),anisotropy:i().min(m7).max(h7).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(f7).optional(),reflectivity:i().min(x7).max(g7).optional()})).max(b7).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(y7).regex(A7).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(S7),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(z7),sourceVersionId:n().regex(T7)}),captureFrame:A().min(E7).max(C7),layout:c({width:A().gt(I7).max(R7),height:A().gt(w7).max(O7)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(M7),startFrame:A().min(P7).max(L7).default(k7),endFrame:A().gt(D7).max(v7).optional()})])).optional()}),c({kind:b("page"),id:n().min(1).max(F7).regex(N7),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(B7).default(_7)}).default({position:[0,0,0],rotation:[0,0,0],scale:1}),opacity:i().min(V7).max(U7).default(j7),width:i().min(H7).max(W7),height:i().min($7).max(G7),fit:h(["contain","cover"]).default(K7),transparency:h(["straight","premultiplied","opaque"]).default(q7),depthWrite:P().default(Y7),backface:h(["hidden","visible"]).default(Q7),materials:y(c({role:n().min(1).max(J7),type:h(["physical","unlit"]),color:E([n().regex(Z7),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),roughness:i().min(X7).max(eq).optional(),metalness:i().min(tq).max(oq).optional(),clearcoat:i().min(rq).max(sq).optional(),clearcoatRoughness:i().min(nq).max(iq).optional(),anisotropy:i().min(aq).max(cq).optional(),anisotropyRotation:i().optional(),ior:i().min(1).max(pq).optional(),reflectivity:i().min(dq).max(lq).optional()})).max(uq).optional(),surfaces:O(n(),E([c({source:b("image"),assetSlot:n().min(1).max(mq).regex(hq).describe("Image asset slot name bound by the clip assets map; never a URL.")}),c({source:b("color"),color:E([n().regex(fq),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({source:b("component"),component:c({version:b(1),componentId:n().min(1).max(xq),sourceVersionId:n().regex(gq)}),captureFrame:A().min(bq).max(yq),layout:c({width:A().gt(Aq).max(Sq),height:A().gt(zq).max(Tq)}),bakeScale:E([b(2),b(3)]).optional().describe("Optional authored scale. Preparation defaults omission to 2 and may auto-raise it to 3."),params:O(n(),le).optional()}),c({source:b("video"),mediaId:n().min(1).max(Eq),startFrame:A().min(Iq).max(Rq).default(Cq),endFrame:A().gt(wq).max(Oq).optional()})]))}),c({id:n().min(1).max(Mq).regex(kq),kind:b("text"),opacity:i().min(Lq).max(Dq).default(Pq),lines:y(c({runs:y(c({text:n().min(1).max(vq).regex(Fq),color:E([n().regex(Nq),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:P().optional()})).min(1).max(_q)})).min(1).max(Bq),fontFamily:E([n().min(1).max(jq).regex(Vq),h(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:A().min(Uq).max(Hq),fontStyle:h(["normal","italic"]),fontSize:i().min(Wq).max($q),lineHeight:i().min(Kq).max(qq).default(Gq),letterSpacing:i().min(Qq).max(Jq).default(Yq),align:h(["left","center","right"]).default(Zq),maxWidth:i().gt(Xq).optional(),color:E([n().regex(eY),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:b("world"),transform:c({position:H([i(),i(),i()]).default([0,0,0]),rotation:H([i(),i(),i()]).default([0,0,0]),scale:i().gt(oY).default(tY)}).default({position:[0,0,0],rotation:[0,0,0],scale:1})}),c({id:n().min(1).max(rY).regex(sY),kind:b("text"),opacity:i().min(iY).max(aY).default(nY),lines:y(c({runs:y(c({text:n().min(1).max(cY).regex(pY),color:E([n().regex(dY),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]).optional(),emphasis:P().optional()})).min(1).max(lY)})).min(1).max(uY),fontFamily:E([n().min(1).max(mY).regex(hY),h(["$brand:fonts.heading","$brand:fonts.body","$brand:fonts.caption"])]),fontWeight:A().min(fY).max(xY),fontStyle:h(["normal","italic"]),fontSize:i().min(gY).max(bY),lineHeight:i().min(AY).max(SY).default(yY),letterSpacing:i().min(TY).max(EY).default(zY),align:h(["left","center","right"]).default(CY),maxWidth:i().gt(IY).optional(),color:E([n().regex(RY),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])]),space:b("screen"),x:i(),y:i(),rotation:i().default(wY),scale:i().gt(MY).default(OY)})]);var kY=16,PY=8192,LY=16,DY=8192,vY=.3141592653589793,FY=1.3962634015954636,NY="studio",_Y="soft",BY=1,jY=0,VY=-420,UY=.5,HY=0,WY=1,$Y={lightingProfile:"studio",preset:"soft",intensity:1,floorY:-420,shadowOpacity:.5},GY=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),KY=0,qY=0,YY=1,QY=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),JY=2,ZY=8,XY=0,eQ=1,tQ=0,oQ=1,rQ=0,sQ=1,nQ=new RegExp("^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"),iQ=2,aQ=8,cQ={kind:"transparent"},pQ=64,dQ=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),lQ=0,uQ=1,mQ=0,hQ=1,fQ=-4,xQ=5,gQ=0,bQ=1,yQ=-4,AQ=5,SQ=256,zQ=[],TQ=0,EQ=0,CQ=.5,IQ=0,RQ=0,wQ=1,OQ=0,MQ=0,kQ=0,PQ=64,LQ=null,DQ={grain:0,vignette:0,focus:null},vQ=64,FQ=new RegExp("^[A-Za-z0-9][A-Za-z0-9_-]*$"),NQ=2,_Q=0,BQ=[],rc=c({version:b(2),referenceSize:c({width:A().min(kY).max(PY),height:A().min(LY).max(DY)}),camera:c({position:H([i(),i(),i()]).optional(),rotation:H([i(),i(),i()]).optional(),fov:i().min(vY).max(FY).optional()}).optional(),environment:E([c({kind:b("studio").optional(),lightingProfile:h(["studio","studio-edge"]).default(NY),preset:h(["soft","key","rim"]).default(_Y),intensity:i().min(jY).default(BY),floorY:i().default(VY),shadowOpacity:i().min(HY).max(WY).default(UY)}),c({kind:b("photographic-studio-v1")})]).default($Y),backdrop:E([c({kind:b("transparent")}),c({kind:b("solid"),color:E([n().regex(GY),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])}),c({kind:b("linear"),angle:i().default(KY),stops:y(c({at:i().min(qY).max(YY),color:E([n().regex(QY),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])})).min(JY).max(ZY)}),c({kind:b("radial"),at:H([i().min(XY).max(eQ),i().min(tQ).max(oQ)]).default([.5,.5]),stops:y(c({at:i().min(rQ).max(sQ),color:E([n().regex(nQ),h(["$brand:colors.background","$brand:colors.surface","$brand:colors.text","$brand:colors.textMuted","$brand:colors.accent","$brand:colors.accentStrong","$brand:colors.accentSoft","$brand:colors.success","$brand:colors.warning","$brand:colors.danger"])])})).min(iQ).max(aQ)})]).default(cQ),layers:y(Km).min(1),animation:y(c({target:E([c({kind:b("camera")}),c({kind:b("layer"),layerId:n().min(1).max(pQ).regex(dQ)}),c({kind:b("environment")}),c({kind:b("focus")})]),property:h(["positionX","positionY","positionZ","rotationX","rotationY","rotationZ","fov","scale","opacity","openAngle","x","y","rotation","intensity","distance","range","maxBlur"]),keyframes:y(c({at:i().min(lQ).max(uQ),value:i(),easing:E([c({kind:b("linear")}),c({kind:b("hold")}),c({kind:b("bezier"),x1:i().min(mQ).max(hQ),y1:i().min(fQ).max(xQ),x2:i().min(gQ).max(bQ),y2:i().min(yQ).max(AQ)})]).optional()})).min(1).max(SQ)})).default(zQ),post:c({grain:i().min(EQ).max(CQ).default(TQ),vignette:i().min(RQ).max(wQ).default(IQ),focus:E([c({distance:i().gt(OQ),range:i().gt(MQ),maxBlur:i().min(kQ).max(PQ)}),G()]).default(LQ)}).default(DQ),constraints:y(c({kind:b("minSeparation"),objects:y(n().min(1).max(vQ).regex(FQ)).min(NQ),gap:i().gt(_Q)})).default(BQ)}).describe("A version-2 scene shot: a self-contained 3D world-object shot that scene.add / scene.update materializes into an ordinary component clip. The shot owns its layers, camera, lighting, backdrop and normalized local animation; the composition owns start, duration, ordering, cuts and transitions. Coordinates are REFERENCE PIXELS: origin at frame centre, +X right, +Y down, +Z toward the viewer. referenceSize must have the SAME aspect ratio as the composition format; mismatch fails instead of cropping. At equal aspect ratio the shot scales uniformly by outputWidth/referenceWidth. A segment's easing belongs to the keyframe it ARRIVES at; the first keyframe has no easing. Authoring limits: 32 layers, 4 devices, 16 distinct image slots, 256 keyframes per channel, 2048 keyframes per shot. Version 2 supports nested groups, procedural slab/page/phone/laptop objects, screen- and world-space text, admitted image/component/video surfaces, fixed photographic and generated studio environments, transparent/solid/linear/radial backdrops, constraints, focus, grain and vignette. Raw HTML, custom shader props, imported GLB models, arbitrary external HDR environments, skeletal animation and physics are refused with an exact field path.");var jQ=0,sc=c({type:h(["cut","fade","dissolve","wipe"]),duration:i().min(jQ).optional()}).describe("Inter-scene transition.");var VQ=0,UQ=0,HQ=0,WQ=0,$Q=0,GQ=0,KQ=0,qQ=0,YQ=0,QQ=0,JQ=0,ZQ=4,XQ=0,eJ=0,tJ=0,oJ=0,rJ=0,sJ=0,nJ=0,iJ=0,aJ=0,cJ=1,pJ=0,dJ=1,lJ=.1,uJ=1,mJ=0,hJ=0,fJ=-.3,xJ=.3,gJ=-.3,bJ=.3,yJ=0,AJ=1,SJ=0,zJ=1,TJ=-.3,EJ=.3,CJ=0,IJ=1,RJ=0,wJ=-1,OJ=2,MJ=-1,kJ=2,PJ=0,LJ=1,DJ=0,vJ=1,FJ=0,NJ=1,_J=0,BJ=1,jJ=0,VJ=0,UJ=2,HJ=0,WJ=0,$J=0,GJ=0,KJ=0,qJ=0,YJ=0,QJ=4,JJ=0,ZJ=0,XJ=0,eZ=0,tZ=0,oZ=0,rZ=0,sZ=0,nZ=0,iZ=1,aZ=0,cZ=1,pZ=.1,dZ=1,lZ=0,uZ=0,mZ=-.3,hZ=.3,fZ=-.3,xZ=.3,gZ=0,bZ=1,yZ=0,AZ=1,SZ=-.3,zZ=.3,TZ=0,EZ=1,CZ=0,IZ=-1,RZ=2,wZ=-1,OZ=2,MZ=0,kZ=1,PZ=0,LZ=1,DZ=0,vZ=1,FZ=0,NZ=1,_Z=0,BZ=0,jZ=2,VZ=0,UZ=0,HZ=0,WZ=0,$Z=0,GZ=0,KZ=0,qZ=4,YZ=0,QZ=0,JZ=0,ZZ=0,XZ=0,eX=0,tX=0,oX=0,rX=0,sX=1,nX=0,iX=1,aX=.1,cX=1,pX=0,dX=0,lX=-.3,uX=.3,mX=-.3,hX=.3,fX=0,xX=1,gX=0,bX=1,yX=-.3,AX=.3,SX=0,zX=1,TX=0,EX=-1,CX=2,IX=-1,RX=2,wX=0,OX=1,MX=0,kX=1,PX=0,LX=1,DX=0,vX=1,FX=0,NX=0,_X=2,BX=0,jX=0,VX=0,UX=0,HX=0,WX=0,$X=0,GX=1,KX=0,qX=1,YX=.1,QX=1,JX=0,ZX=0,XX=-.3,eee=.3,tee=-.3,oee=.3,ree=15,see=100,nee=900,iee=0,aee=1,cee=0,pee=1,dee=0,lee=1,uee=0,mee=1,hee=-5,fee=20,xee=0,gee=2,bee=0,yee=2,Aee=0,See=100,zee=900,Tee=0,Eee=0,Cee=0,Iee=0,Ree=.5,wee=12,Oee=0,Mee=100,kee=0,Pee=9007199254740991,Lee=0,Dee=9007199254740991,vee=0,Fee=9007199254740991,Nee=0,_ee=1,Bee=0,jee=1,Vee=0,Uee=1,Hee=0,Wee=1,$ee=.25,Gee=4,Kee=-45,qee=45,Yee=15,Qee=100,Jee=900,Zee=-5,Xee=20,ete=0,tte=2,ote=0,rte=2,ste=0,nte=100,ite=900,ate=0,cte=.5,pte=12,dte=0,lte=0,ute=0,mte=0,hte=9007199254740991,fte=0,xte=9007199254740991,gte=0,bte=0,yte=15,Ate=100,Ste=900,zte=0,Tte=1,Ete=0,Cte=1,Ite=0,Rte=1,wte=0,Ote=1,Mte=-5,kte=20,Pte=0,Lte=2,Dte=0,vte=2,Fte=0,Nte=100,_te=900,Bte=0,jte=0,Vte=0,Ute=0,Hte=.5,Wte=12,$te=0,Gte=100,Kte=0,qte=0,Yte=0,Qte=2e3,nc=E([c({type:b("scene.add"),clipId:n(),trackId:n().optional(),newTrack:P().optional(),newTrackId:n().optional(),startTime:i().min(VQ),duration:i().gt(UQ),scene:rc,assets:O(n(),n()),transitionIn:sc.optional()}).describe('Author a scene shot and place it on a dedicated overlay track. The host validates the scene, generates and registers an immutable wrapper component source, and emits the ordinary track/clip operations carrying `props.componentRef` \u2014 you edit a scene SPEC, never wrapper TSX or a source hash. Registration and the composition update are ONE undoable edit; a failure publishes nothing and leaves no clip pointing at an unresolved source. Pass EXACTLY ONE of `trackId` (an existing dedicated scene track) or `newTrack: true` (mint one). That track holds scene-shot clips and gaps only \u2014 no generic component/primitive/media clips in v1 \u2014 and existing generic overlay tracks are unaffected. Scene clips use front zPlane and full-frame placement: outer per-clip `region`, `position`, `scale`, `rotation`, `fit`, `effects`, `animate`, `params.transition`, `params.sequenceGroup` and internal fadeIn/fadeOut are REFUSED with a path, because the shot\'s own layer transforms are the single transform owner. TEXT: `space: "screen"` text is composed above the world result, stays fixed in the frame and stays sharp through focus; `space: "world"` text is rasterized into the 3D scene, moves with the camera and is occluded by geometry. Screenshots and world text are UNLIT and colour-managed so product UI colours are not tinted by the studio lighting, while device bodies are lit and cast shadows; an unlit surface still occludes. SCOPE GAP (pre-existing, neither closed nor changed by scene shots): global wrap effects \u2014 composition-level grades and camera effects \u2014 do not reach front-overlay clips, so they do not affect a scene shot. Author the look INSIDE the shot (`post.grain`, `post.vignette`, `post.focus`, `backdrop`, `environment`) instead. DISCOVERY: there is no built-in scene primitive to look up in list_catalog; the wrapper this operation registers appears afterwards as an ordinary INSTALLED component under the existing catalog rules. ASSETS: `assets` binds each slot name a layer references to a media id in the same project, and the slot\'s declared KIND decides what it admits \u2014 an image slot takes PNG, JPEG or WebP, a video slot MP4 or WebM. Binding the wrong kind is refused with the slot\'s path.'),c({type:b("scene.update"),clipId:n(),startTime:i().min(HQ).optional(),duration:i().gt(WQ).optional(),scene:rc.optional(),assets:O(n(),n()).optional(),transitionIn:sc.optional()}).describe("Revise a scene shot in place by clip id. Send a replacement `scene` and/or `assets`; timing changes use the ordinary clip timing fields (`startTime`, `duration`, `transitionIn`). Omitted fields keep their persisted values and the MERGED result is re-validated as a whole, so a partial edit cannot leave the shot invalid. Changing only values or asset IDs updates props and bindings and REUSES the pinned source; changing the referenced SLOT SET regenerates the wrapper manifest and registers a new immutable source version atomically. Undo restores the source reference, spec, bindings and timing together. Topology, asset bindings, text content, font properties, device kind and colours are STATIC within a shot's animation \u2014 change them here (a revised spec) rather than trying to animate them. This is not a source trim or slip: a shortened or extended clip resamples the SAME normalized animation over its new duration, and trim/slip requests on generated animation are rejected rather than reinterpreted as media trims. In one batch, `scene.update` may target a shot added by an earlier `scene.add`. ASSETS: `assets` binds each slot name a layer references to a media id in the same project, and the slot's declared KIND decides what it admits \u2014 an image slot takes PNG, JPEG or WebP, a video slot MP4 or WebM. Binding the wrong kind is refused with the slot's path."),c({type:b("clip.add"),clip:c({id:n().min(1),startTime:i().min($Q).describe("Timeline start (seconds)."),duration:i().gt(GQ).describe("Clip duration (seconds)."),source:E([c({kind:b("media"),mediaId:n().min(1),trim:c({start:i().min(KQ).describe("Source trim start (seconds)."),end:i().min(qQ).describe("Source trim end (seconds).")}).optional(),excludedRanges:y(c({start:i().min(YQ),end:i().min(QQ),reason:n().optional()})).optional(),volume:i().min(JQ).max(ZQ).optional(),muted:P().optional(),playbackRate:i().gt(XQ).optional(),sync:h(["video","independent"]).optional(),kenBurns:h(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:i().optional(),fadeInMs:i().min(eJ).optional(),fadeOutMs:i().min(tJ).optional(),loop:P().optional(),audioRole:h(["sfx","music","vo","ambience"]).optional(),duck:c({duckDb:i().max(oJ),attackMs:i().min(rJ),releaseMs:i().min(sJ),windows:y(c({startMs:i(),endMs:i()})).optional()}).optional(),anchor:c({clipId:n().min(1),offsetMs:i()}).optional(),reframe:c({segments:y(c({startSec:i().min(nJ).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(iJ).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:E([c({mode:b("frame-center")}),c({mode:b("point"),x:i().min(aJ).max(cJ),y:i().min(pJ).max(dJ)}),c({mode:b("face"),faceId:n().min(1),shotScale:h(["close","standard","wide"]).optional()}),c({mode:b("all-faces")}),c({mode:b("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:n().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(lJ).max(uJ).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:c({in:i().min(mJ).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(hJ).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:c({x:i().min(fJ).max(xJ).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(gJ).max(bJ).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),c({kind:b("component"),componentId:n().min(1),props:O(n(),L()),assets:O(n(),n().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:h(["front","behind-subject"]).optional()}),c({kind:b("overlay"),primitiveId:n().min(1),params:O(n(),L()),zPlane:h(["front","behind-subject"]).optional(),anchor:c({space:b("scene"),x:i().min(yJ).max(AJ),y:i().min(SJ).max(zJ)}).optional(),parallax:i().min(TJ).max(EJ).optional()}),c({kind:b("effect"),primitiveId:n().min(1),params:O(n(),L()).optional()}),c({kind:b("card"),html:n().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),tokens:O(n(),n()).optional(),zPlane:b("front").optional()})]),kind:h(["video","audio","image","overlay","effect"]).optional(),opacity:i().min(CJ).max(IJ).optional(),scale:i().gt(RJ).optional(),rotation:i().optional(),position:c({x:i().min(wJ).max(OJ),y:i().min(MJ).max(kJ)}).optional().describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),region:c({x:i().min(PJ).max(LJ),y:i().min(DJ).max(vJ),w:i().gt(FJ).max(NJ),h:i().gt(_J).max(BJ)}).optional(),fit:h(["cover","contain"]).optional(),captionVisibility:h(["visible","hidden"]).optional().describe("Video media clip only. Hide native captions while this clip is topmost and covers the lower picture, or when an opaque, effect-free clip has an explicitly full-frame region, even with fit:contain. Caption words and timings remain stored and resume when another visible clip takes over."),effects:y(c({primitiveId:n().min(1),params:O(n(),L()).optional()})).optional(),transitionIn:c({type:n().min(1),duration:i().gt(jJ)}).optional(),linkGroupId:n().min(1).optional(),animate:O(n(),y(c({time:i().min(VJ),value:i(),easing:E([h(["linear","ease","easeIn","easeOut","easeInOut"]),c({cubicBezier:H([i(),i(),i(),i()])})]).optional()})).min(UJ)).optional().describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.")}),trackId:n().optional(),newTrack:P().optional(),newTrackId:n().optional()}).describe("Add a clip to the timeline. The clip self-routes to a track by FAMILY (`clip.kind`, else derived from `source.kind`, else the target track) \u2014 a `media` clip MUST carry `kind` (video|audio|image) or a `trackId`, else it is rejected as ambiguous. `trackId` targets an existing SAME-family track; `newTrack:true` (with optional pinned `newTrackId`) creates a fresh track of that family."),c({type:b("clip.remove"),clipId:n()}).describe("Remove a clip by id (located across every track)."),c({type:b("clip.update"),clipId:n(),patch:c({id:n().min(1).optional(),startTime:i().min(HJ).optional().describe("Timeline start (seconds)."),duration:i().gt(WJ).optional().describe("Clip duration (seconds)."),source:E([c({kind:b("media"),mediaId:n().min(1),trim:c({start:i().min($J).describe("Source trim start (seconds)."),end:i().min(GJ).describe("Source trim end (seconds).")}).optional(),excludedRanges:y(c({start:i().min(KJ),end:i().min(qJ),reason:n().optional()})).optional(),volume:i().min(YJ).max(QJ).optional(),muted:P().optional(),playbackRate:i().gt(JJ).optional(),sync:h(["video","independent"]).optional(),kenBurns:h(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:i().optional(),fadeInMs:i().min(ZJ).optional(),fadeOutMs:i().min(XJ).optional(),loop:P().optional(),audioRole:h(["sfx","music","vo","ambience"]).optional(),duck:c({duckDb:i().max(eZ),attackMs:i().min(tZ),releaseMs:i().min(oZ),windows:y(c({startMs:i(),endMs:i()})).optional()}).optional(),anchor:c({clipId:n().min(1),offsetMs:i()}).optional(),reframe:c({segments:y(c({startSec:i().min(rZ).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(sZ).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:E([c({mode:b("frame-center")}),c({mode:b("point"),x:i().min(nZ).max(iZ),y:i().min(aZ).max(cZ)}),c({mode:b("face"),faceId:n().min(1),shotScale:h(["close","standard","wide"]).optional()}),c({mode:b("all-faces")}),c({mode:b("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:n().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(pZ).max(dZ).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:c({in:i().min(lZ).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(uZ).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:c({x:i().min(mZ).max(hZ).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(fZ).max(xZ).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),c({kind:b("component"),componentId:n().min(1),props:O(n(),L()),assets:O(n(),n().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:h(["front","behind-subject"]).optional()}),c({kind:b("overlay"),primitiveId:n().min(1),params:O(n(),L()),zPlane:h(["front","behind-subject"]).optional(),anchor:c({space:b("scene"),x:i().min(gZ).max(bZ),y:i().min(yZ).max(AZ)}).optional(),parallax:i().min(SZ).max(zZ).optional()}),c({kind:b("effect"),primitiveId:n().min(1),params:O(n(),L()).optional()}),c({kind:b("card"),html:n().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),tokens:O(n(),n()).optional(),zPlane:b("front").optional()})]).optional(),kind:h(["video","audio","image","overlay","effect"]).optional(),opacity:i().min(TZ).max(EZ).optional(),scale:i().gt(CZ).optional(),rotation:i().optional(),position:c({x:i().min(IZ).max(RZ),y:i().min(wZ).max(OZ)}).optional().describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),region:c({x:i().min(MZ).max(kZ),y:i().min(PZ).max(LZ),w:i().gt(DZ).max(vZ),h:i().gt(FZ).max(NZ)}).optional(),fit:h(["cover","contain"]).optional(),captionVisibility:h(["visible","hidden"]).optional().describe("Video media clip only. Hide native captions while this clip is topmost and covers the lower picture, or when an opaque, effect-free clip has an explicitly full-frame region, even with fit:contain. Caption words and timings remain stored and resume when another visible clip takes over."),effects:y(c({primitiveId:n().min(1),params:O(n(),L()).optional()})).optional(),transitionIn:c({type:n().min(1),duration:i().gt(_Z)}).optional(),linkGroupId:n().min(1).optional(),animate:O(n(),y(c({time:i().min(BZ),value:i(),easing:E([h(["linear","ease","easeIn","easeOut","easeInOut"]),c({cubicBezier:H([i(),i(),i(),i()])})]).optional()})).min(jZ)).optional().describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.")})}).describe("Patch an existing clip by id (cross-family). The patch is a partial TimelineClip. NOTE: `source` is REPLACED wholesale \u2014 the patch merges at the top level only, so a partial `source` WIPES the source fields you omit. Patch the whole source object when changing it. (To change reframe/excluded ranges, prefer setCropIntents / addExcludedRange, not a source patch.)"),c({type:b("removeClipsByMediaId"),mediaId:n()}).describe("Remove EVERY clip sourced from a given mediaId (e.g. after deleting that media)."),c({type:b("loadOverlays"),clips:y(c({id:n().min(1),startTime:i().min(VZ).describe("Timeline start (seconds)."),duration:i().gt(UZ).describe("Clip duration (seconds)."),source:E([c({kind:b("media"),mediaId:n().min(1),trim:c({start:i().min(HZ).describe("Source trim start (seconds)."),end:i().min(WZ).describe("Source trim end (seconds).")}).optional(),excludedRanges:y(c({start:i().min($Z),end:i().min(GZ),reason:n().optional()})).optional(),volume:i().min(KZ).max(qZ).optional(),muted:P().optional(),playbackRate:i().gt(YZ).optional(),sync:h(["video","independent"]).optional(),kenBurns:h(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:i().optional(),fadeInMs:i().min(QZ).optional(),fadeOutMs:i().min(JZ).optional(),loop:P().optional(),audioRole:h(["sfx","music","vo","ambience"]).optional(),duck:c({duckDb:i().max(ZZ),attackMs:i().min(XZ),releaseMs:i().min(eX),windows:y(c({startMs:i(),endMs:i()})).optional()}).optional(),anchor:c({clipId:n().min(1),offsetMs:i()}).optional(),reframe:c({segments:y(c({startSec:i().min(tX).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(oX).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:E([c({mode:b("frame-center")}),c({mode:b("point"),x:i().min(rX).max(sX),y:i().min(nX).max(iX)}),c({mode:b("face"),faceId:n().min(1),shotScale:h(["close","standard","wide"]).optional()}),c({mode:b("all-faces")}),c({mode:b("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:n().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(aX).max(cX).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:c({in:i().min(pX).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(dX).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:c({x:i().min(lX).max(uX).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(mX).max(hX).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),c({kind:b("component"),componentId:n().min(1),props:O(n(),L()),assets:O(n(),n().min(1)).optional().describe("Manifest asset slot \u2192 project media id. At mount each slot arrives as `assets[slot].handle`, a fetchable URL for <Img>/<Video>/<Audio>; `props` becomes `params` and never carries an asset URL."),zPlane:h(["front","behind-subject"]).optional()}),c({kind:b("overlay"),primitiveId:n().min(1),params:O(n(),L()),zPlane:h(["front","behind-subject"]).optional(),anchor:c({space:b("scene"),x:i().min(fX).max(xX),y:i().min(gX).max(bX)}).optional(),parallax:i().min(yX).max(AX).optional()}),c({kind:b("effect"),primitiveId:n().min(1),params:O(n(),L()).optional()}),c({kind:b("card"),html:n().min(1).describe("Your card's HTML \u2014 rendered VERBATIM as the graphic (shell motion via applyMotionPreset in a FOLLOWING call). CANVAS CONTRACT: the card renders in a viewport equal to the composition format's pixel frame (1080\xD71920 at 9:16 fhd); the root is NOT auto-pinned \u2014 declare explicit width/height matching the frame (box-sizing:border-box) and anchor content with flex/grid; position:absolute;inset:0 on the root does NOT fill the frame; for edge-to-edge backgrounds add an inner absolutely-positioned layer with generous negative inset. Overlay compositing applies a ~92% safe-area inset \u2014 keep critical copy away from the extreme edges. FONTS: name a family from GET /v1/fonts (list_render_fonts) \u2014 the renderer loads those faces for the card and waits for them, so `font-family: Inter` draws Inter. `@import` and remote font files are REFUSED: the card renders with no network. A family that is not on that list has no bytes behind it and the browser falls back, so end any stack with a generic (`Inter, sans-serif`) rather than relying on a system face being present."),tokens:O(n(),n()).optional(),zPlane:b("front").optional()})]),kind:h(["video","audio","image","overlay","effect"]).optional(),opacity:i().min(SX).max(zX).optional(),scale:i().gt(TX).optional(),rotation:i().optional(),position:c({x:i().min(EX).max(CX),y:i().min(IX).max(RX)}).optional().describe("Clip CENTRE as a fraction of the frame: {x:0.5,y:0.5} is dead centre, 0 to 1 is inside the frame, and a little overshoot (down to -1, up to 2) is how an entrance starts off-canvas. NOT pixels: the renderer maps x to `left: x*100%`, so `x: 180` sits 180 frame-widths away and draws nothing."),region:c({x:i().min(wX).max(OX),y:i().min(MX).max(kX),w:i().gt(PX).max(LX),h:i().gt(DX).max(vX)}).optional(),fit:h(["cover","contain"]).optional(),captionVisibility:h(["visible","hidden"]).optional().describe("Video media clip only. Hide native captions while this clip is topmost and covers the lower picture, or when an opaque, effect-free clip has an explicitly full-frame region, even with fit:contain. Caption words and timings remain stored and resume when another visible clip takes over."),effects:y(c({primitiveId:n().min(1),params:O(n(),L()).optional()})).optional(),transitionIn:c({type:n().min(1),duration:i().gt(FX)}).optional(),linkGroupId:n().min(1).optional(),animate:O(n(),y(c({time:i().min(NX),value:i(),easing:E([h(["linear","ease","easeIn","easeOut","easeInOut"]),c({cubicBezier:H([i(),i(),i(),i()])})]).optional()})).min(_X)).optional().describe("Keyframe channels, clip-relative seconds. Each channel's values use the SAME unit as the scalar it animates: `opacity` 0 to 1, `scale` a multiplier (>0), `rotation` degrees, `position.x`/`position.y` a FRACTION of the frame like `position` (0.5 = centre; NOT pixels), `volume` 0 to 4.")}))}).describe("Replace the overlay channel wholesale with the given clips (bulk set, not a merge)."),c({type:b("addMarker"),marker:c({id:n().min(1),startTime:i().min(BX),endTime:i().min(jX).optional(),kind:n().min(1),name:n().optional(),metadata:O(n(),L()).optional()})}).describe("Add a timeline marker (a named time point/range; carry extensions in `metadata`)."),c({type:b("removeMarker"),markerId:n()}).describe("Remove a marker by id."),c({type:b("updateMarker"),markerId:n(),updates:c({id:n().min(1).optional(),startTime:i().min(VX).optional(),endTime:i().min(UX).optional(),kind:n().min(1).optional(),name:n().optional(),metadata:O(n(),L()).optional()})}).describe("Patch a marker's fields by id (partial merge)."),c({type:b("setCropIntents"),clipId:n(),segments:E([y(c({startSec:i().min(HX).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:i().gt(WX).describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:E([c({mode:b("frame-center")}),c({mode:b("point"),x:i().min($X).max(GX),y:i().min(KX).max(qX)}),c({mode:b("face"),faceId:n().min(1),shotScale:h(["close","standard","wide"]).optional()}),c({mode:b("all-faces")}),c({mode:b("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:n().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:i().min(YX).max(QX).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:c({in:i().min(JX).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:i().min(ZX).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:c({x:i().min(XX).max(eee).describe("Horizontal nudge, source-normalized (+ = right)."),y:i().min(tee).max(oee).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})),G()])}).describe("Set (or CLEAR, with `segments: null`) the camera/reframe channel on a MEDIA clip \u2014 the time-aligned source\u2192output viewport (focus, zoom, ease, bias). This is the PREFERRED way to author reframing; do NOT reframe via a whole-source `clip.update` patch. Segments tile the clip's duration."),c({type:b("setEffects"),clipId:n(),effects:y(c({primitiveId:n().min(1),params:O(n(),L()).optional()}))}).describe("Set (or CLEAR, with `effects: []`) a clip's EFFECT channel \u2014 the registered effect primitives stacked onto that clip, each `{ primitiveId, params? }`. WHOLESALE: the array REPLACES the clip's current effects, so send the full stack (read the clip first to add one). This is the ONLY way to change effects on an existing clip \u2014 do NOT reach for a `clip.update` patch, whose top-level merge is the source-clobbering footgun documented above."),c({type:b("setCaptionStyle"),style:c({fontFamily:n().min(1).optional(),fontSize:i().min(1).max(ree).optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),fontWeight:A().min(see).max(nee).optional(),color:n().min(1).optional(),highlightColor:n().min(1).optional(),backgroundColor:n().optional(),plate:h(["glass","solid","none"]).optional(),position:h(["top","center","bottom"]).optional(),region:c({x:i().min(iee).max(aee),y:i().min(cee).max(pee),w:i().gt(dee).max(lee),h:i().gt(uee).max(mee)}).optional().describe("Optional caption layout box {x,y,w,h} in normalized output-frame coordinates. Overrides position; text starts at its top edge and wraps/pages within its width and height."),textTransform:h(["none","uppercase","capitalize"]).optional(),letterSpacing:i().min(hee).max(fee).optional().describe("Base caption glyph spacing in pixels."),wordGapEm:i().min(xee).max(gee).optional().describe("Gap between caption runs as a multiple of base font size; default 0.35."),lineGapEm:i().min(bee).max(yee).optional().describe("Gap between caption lines as a multiple of base font size; default 0.25."),emphasisColor:n().optional(),emphasisGradient:n().optional(),emphasisScale:i().gt(Aee).optional(),emphasisFontFamily:n().optional(),emphasisFontWeight:A().min(See).max(zee).optional(),emphasisTextTransform:h(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:i().optional(),emphasisFontStyle:h(["normal","italic"]).optional(),entrance:h(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:i().min(Tee).optional(),entranceStaggerMs:i().min(Eee).optional(),exitMs:i().min(Cee).optional(),emphasisPlate:P().optional(),emphasisPlateColor:n().optional(),emphasisPlateTextColor:n().optional(),emphasisPlateAltColor:n().optional(),emphasisPlateAltTextColor:n().optional(),emphasisPlateRadius:i().min(Iee).optional(),emphasisPlatePadX:i().optional(),emphasisPlatePadY:i().optional(),emphasisPlateReveal:P().optional().describe("Grow a shared emphasis plate as saved words appear while reserving its final layout width."),annotationColor:n().optional(),annotationStrokeWidth:i().min(Ree).max(wee).optional().describe("Annotation stroke width in its 100\xD7100 SVG coordinate system; default 4."),annotationTexture:h(["clean","pencil"]).optional().describe("Native annotation stroke finish; default clean."),maxWidthPercent:i().gt(Oee).max(Mee).optional()})}).describe("Merge style overrides (font/color/position/emphasis) onto the composition's caption layer. Partial \u2014 omitted fields keep their current value; creates the caption container if absent."),c({type:b("setCaptionLayouts"),layouts:y(c({segmentIndex:A().min(kee).max(Pee),wordStartIndex:A().min(Lee).max(Dee),wordEndIndex:A().gt(vee).max(Fee).describe("Exclusive word index in the saved caption segment."),region:c({x:i().min(Nee).max(_ee),y:i().min(Bee).max(jee),w:i().gt(Vee).max(Uee),h:i().gt(Hee).max(Wee)}),scale:i().min($ee).max(Gee).optional(),rotation:i().min(Kee).max(qee).optional(),style:c({fontFamily:n().min(1).optional(),fontSize:i().min(1).max(Yee).optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),fontWeight:A().min(Qee).max(Jee).optional(),color:n().min(1).optional(),highlightColor:n().min(1).optional(),backgroundColor:n().optional(),plate:h(["glass","solid","none"]).optional(),textTransform:h(["none","uppercase","capitalize"]).optional(),letterSpacing:i().min(Zee).max(Xee).optional().describe("Base caption glyph spacing in pixels."),wordGapEm:i().min(ete).max(tte).optional().describe("Gap between caption runs as a multiple of base font size; default 0.35."),lineGapEm:i().min(ote).max(rte).optional().describe("Gap between caption lines as a multiple of base font size; default 0.25."),emphasisColor:n().optional(),emphasisScale:i().gt(ste).optional(),emphasisFontFamily:n().optional(),emphasisFontWeight:A().min(nte).max(ite).optional(),emphasisTextTransform:h(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:i().optional(),emphasisFontStyle:h(["normal","italic"]).optional(),emphasisPlate:P().optional(),emphasisPlateColor:n().optional(),emphasisPlateTextColor:n().optional(),emphasisPlateAltColor:n().optional(),emphasisPlateAltTextColor:n().optional(),emphasisPlateRadius:i().min(ate).optional(),emphasisPlatePadX:i().optional(),emphasisPlatePadY:i().optional(),emphasisPlateReveal:P().optional().describe("Grow a shared emphasis plate as saved words appear while reserving its final layout width."),annotationColor:n().optional(),annotationStrokeWidth:i().min(cte).max(pte).optional().describe("Annotation stroke width in its 100\xD7100 SVG coordinate system; default 4."),annotationTexture:h(["clean","pencil"]).optional().describe("Native annotation stroke finish; default clean."),entrance:h(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:i().min(dte).optional(),entranceStaggerMs:i().min(lte).optional(),exitMs:i().min(ute).optional()}).optional(),holdThroughWordIndex:A().min(mte).max(hte).optional().describe("Inclusive saved-word index in this segment. The layout stays visible until that word ends."),wordMarks:y(c({wordIndex:A().min(fte).max(xte),emphasis:P().optional(),annotate:E([h(["circle","underline"]),G()]).optional()})).optional()}))}).describe("Replace native caption placements without changing transcript words or timings. Each layout references a half-open word-index range in one saved segment; a one-word range is valid. region places that group independently, optional bounded scale/rotation/style changes its look, and holdThroughWordIndex keeps it visible through a later saved word in the same segment. All words in a placed range occupy one page; rendering refuses a range that cannot fit its box, so enlarge region or split the range. The box reserves horizontal space of 1.6 font sizes and vertical space of 0.8 font sizes for padding, with at most three lines. Unreferenced words keep the default caption layout. Word ranges must not overlap. Reapply after caption regeneration or timeline cuts."),c({type:b("setCaptionDepth"),zPlane:h(["front","behind-subject"])}).describe("Set the caption compositing plane. Use `behind-subject` to place captions behind the segmented foreground subject; use `front` for conventional captions above all video layers."),c({type:b("setCaptions"),segments:y(c({words:y(c({text:n().min(1),startMs:i().min(gte).describe("Word start on the composition timeline, in milliseconds."),endMs:i().min(bte).describe("Word end on the composition timeline, in milliseconds."),emphasis:P().optional(),annotate:h(["circle","underline"]).optional()}))})),style:c({fontFamily:n().min(1).optional(),fontSize:i().min(1).max(yte).optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),fontWeight:A().min(Ate).max(Ste).optional(),color:n().min(1).optional(),highlightColor:n().min(1).optional(),backgroundColor:n().optional(),plate:h(["glass","solid","none"]).optional(),position:h(["top","center","bottom"]).optional(),region:c({x:i().min(zte).max(Tte),y:i().min(Ete).max(Cte),w:i().gt(Ite).max(Rte),h:i().gt(wte).max(Ote)}).optional().describe("Optional caption layout box {x,y,w,h} in normalized output-frame coordinates. Overrides position; text starts at its top edge and wraps/pages within its width and height."),textTransform:h(["none","uppercase","capitalize"]).optional(),letterSpacing:i().min(Mte).max(kte).optional().describe("Base caption glyph spacing in pixels."),wordGapEm:i().min(Pte).max(Lte).optional().describe("Gap between caption runs as a multiple of base font size; default 0.35."),lineGapEm:i().min(Dte).max(vte).optional().describe("Gap between caption lines as a multiple of base font size; default 0.25."),emphasisColor:n().optional(),emphasisGradient:n().optional(),emphasisScale:i().gt(Fte).optional(),emphasisFontFamily:n().optional(),emphasisFontWeight:A().min(Nte).max(_te).optional(),emphasisTextTransform:h(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:i().optional(),emphasisFontStyle:h(["normal","italic"]).optional(),entrance:h(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:i().min(Bte).optional(),entranceStaggerMs:i().min(jte).optional(),exitMs:i().min(Vte).optional(),emphasisPlate:P().optional(),emphasisPlateColor:n().optional(),emphasisPlateTextColor:n().optional(),emphasisPlateAltColor:n().optional(),emphasisPlateAltTextColor:n().optional(),emphasisPlateRadius:i().min(Ute).optional(),emphasisPlatePadX:i().optional(),emphasisPlatePadY:i().optional(),emphasisPlateReveal:P().optional().describe("Grow a shared emphasis plate as saved words appear while reserving its final layout width."),annotationColor:n().optional(),annotationStrokeWidth:i().min(Hte).max(Wte).optional().describe("Annotation stroke width in its 100\xD7100 SVG coordinate system; default 4."),annotationTexture:h(["clean","pencil"]).optional().describe("Native annotation stroke finish; default clean."),maxWidthPercent:i().gt($te).max(Gte).optional()}).optional()}).describe("Replace the caption SEGMENTS wholesale \u2014 author the word-timed caption layer directly (each segment = one sentence/page of `words` with timeline-ms `startMs`/`endMs`, optional `emphasis`). This is how a client with its OWN word timings (e.g. a generated VO take) gets word-synced captions without a source transcript; the compose lane's transcript slice writes the same layer. `style`, when given, merges with setCaptionStyle semantics; an omitted style keeps the existing one. Renderer paginates within a segment and never pools words across two \u2014 keep segments sentence-bounded."),c({type:b("captions.fromTranscript"),mediaId:n().min(1),window:c({startSec:i().min(Kte),endSec:i().gt(qte)}).optional()}).describe("Attach caption CONTENT from the media's cached transcript \u2014 no pasting words. ROUTE-MATERIALIZED like applyMotionPreset/materializeGrid: the server slices the word-timed transcript to `window` (source seconds; absent = the whole media), rebases times, sentence-splits into segments, and applies it as `setCaptions`. 422 media_no_transcript when the media has no transcript or no words in the window. For your OWN word timings use setCaptions directly. For edited multi-clip timelines, use captions.fromComposition after saving the edits; that operation projects all selected track clips, trims, exclusions, and placements."),c({type:b("captions.fromComposition"),trackId:n().min(1)}).describe("Snapshot word-timed captions from the SAVED edits on one explicit enabled video or audio track. The host reads each source media transcript, projects words through clip trim, excluded ranges and placement, then replaces the caption segments. This is route-materialized to setCaptions; call it AFTER persisting clip edits and call it again when those edits change. The existing caption style and depth are preserved. Missing transcripts, unsupported clips, inconsistent clip durations, and overlapping audible clips fail loud. Playback rate scales source word times and playable duration on both audio and video tracks."),c({type:b("applyMotionPreset"),clipId:n(),preset:n(),params:c({enterMs:i().optional(),exitMs:i().optional(),staggerMs:i().optional()}).optional()}).describe("Shell a STATIC `card` clip with a frame-driven MOTION preset \u2014 the public card-shelling op (the layout renders VERBATIM; only the container animates in/out). The server wraps the card in the chosen `preset` (fade-up / slide-in-left / slide-in-right / scale-pop / stagger-reveal), transpiles it, mints it as a LIVE component, and swaps the clip source to that component (the bakeless live lane \u2014 no box). `params` tunes timing (`enterMs`/`exitMs`, `staggerMs` for stagger-reveal). The target must be a static card (components already carry motion; library overlays already move); re-run overwrites idempotently ONLY while the target is still a card (an uncompilable shell); once shelled, the clip is a COMPONENT \u2014 to change its motion, remove and re-add the card, then re-shell. Honored under `dry_run` (validates preset + target without transpiling or persisting). ORDERING: the preset resolves its target against the PERSISTED composition \u2014 a card added in the SAME batch is not yet visible to it. Persist the clip.add batch first, then shell in a following call."),c({type:b("materializeGrid"),clipId:n(),grid:h(["beat","word","shot"]),maxMarkers:A().gt(Yte).max(Qte).optional()}).describe('Materialize a clip\'s SOURCE-media temporal GRID as timeline markers \u2014 the rhythm authority you cut to. `grid:"beat"` reads a MUSIC bed\'s beat map (get_media_context.beatGrid), `grid:"word"` the VO word onsets (wordGrid); each grid point is projected from media time to TIMELINE time through the clip\'s placement (startTime, trim, playbackRate, excludedRanges) and written as a `kind:"beat"|"word"` marker (`metadata.sourceClipId` set). Points outside the clip\'s visible window are skipped. Re-running REPLACES the prior markers from the same clip+grid (idempotent). Land cuts and transition MIDPOINTS on the markers (a 0.5s transition starts 0.25s before its marker). `maxMarkers` (default 500, ceiling 2000) \u2014 exceeding it fails loud with the count. `grid:"shot"` is not yet exposed (shot_grid_unavailable). The target must be a media clip; absent evidence fails loud (grid_unavailable) naming how to get it (declare audioRole:"music" at ingest / transcribe).'),c({type:b("setFormat"),format:c({aspectRatio:h(["16:9","9:16","1:1","4:5"]),fps:E([b(24),b(25),b(30),b(60)]).optional(),resolution:h(["hd","fhd","4k"]).optional()})}).describe("Set the output format \u2014 `aspectRatio` (16:9|9:16|1:1|4:5) plus optional `fps` and `resolution`. Merges: an omitted field keeps the current value."),c({type:b("addTrack"),kind:h(["video","audio","image","overlay","effect"]),name:n().optional(),id:n().optional()}).describe("Add an EMPTY track of a given family (video|audio|image|overlay|effect). Optional pinned `id`. The new track is appended, so it starts at the BACK: index 0 is the top layer and higher indices are further back (see `reorderTracks`). Track order only ranks clips on the same plane \u2014 every overlay draws above the video lane unless its `zPlane` is `behind-subject`, whatever its track index."),c({type:b("removeTrack"),trackId:n()}).describe("Remove a track AND all its clips by id."),c({type:b("updateTrack"),trackId:n(),updates:c({name:n().optional(),enabled:P().optional()})}).describe("Patch a track's `name` / `enabled` by id."),c({type:b("reorderTracks"),fromIndex:i(),toIndex:i()}).describe('Move a track from one index to another. ORDER: index 0 is the TOP layer, not the bottom \u2014 moving a backdrop to index 0 puts it in FRONT of everything and hides the composition. Higher index = further back. PRECEDENCE: track order decides compositing only among clips on the same plane. Overlays are composited in a lane ABOVE the video lane whatever their track index; the one exception is `zPlane:"behind-subject"`, which moves the overlay inside its host clip, behind the segmented foreground. So if reordering tracks does not change what you see, the plane split already decided it.'),c({type:b("moveClipToTrack"),clipId:n(),targetTrackId:n(),newStartTime:i().optional()}).describe("Move a clip to another SAME-family track, optionally at a new `newStartTime`."),c({type:b("duplicateClip"),clipId:n(),newClipId:n().optional()}).describe("Duplicate a clip by id. Pin `newClipId` to make the copy's id deterministic (required for a clean undo/inverse)."),c({type:b("cutAndRipple"),start:i(),end:i()}).describe("Server-authoritative: delete the [start,end] time window (seconds) and ripple every downstream clip/marker/caption earlier to close the gap."),c({type:b("ripple"),time:i(),amount:i()}).describe("Server-authoritative: shift everything at/after `time` (seconds) by `amount` seconds (+ opens a gap, \u2212 closes one)."),c({type:b("addExcludedRange"),clipId:n(),sourceStart:i(),sourceEnd:i(),reason:n().optional()}).describe("Server-authoritative: exclude a [sourceStart,sourceEnd] span (seconds) of a clip's SOURCE (an internal trim) and ripple downstream \u2014 the preferred way to drop a sub-range vs a source patch."),c({type:b("removeExcludedRange"),clipId:n(),rangeIdx:i()}).describe("Server-authoritative: remove a clip's previously-added excluded range by index (re-includes that span, ripples downstream)."),c({type:b("component.repin"),componentId:n(),from:n(),to:n()}).describe("Move every pin of a component at version `from` to version `to`: the clips that place it and the scene surfaces that nest it. A clip's version changes only through a composition write; a component edit issues this op over the composition it names.")]).describe("One scoped composition operation. Discriminated by `type` \u2014 `clip.add` / `clip.remove` / `clip.update` patch clips across any family; the rest cover markers, reframe, effects, captions, format, tracks, and the server-authoritative ripple recomputes. Every variant is `.strict()`: an unknown field is refused, not ignored.");var Jte=c({ops:y(nc).min(1),if_match:n().optional().describe('Optional OCC precondition \u2014 the strong etag (`"<hex>"`) the caller last saw. On mismatch the batch is rejected (409 stale_etag) before any op applies.'),dry_run:P().optional().describe("When true, validate the batch (apply + projection accept/reject guards) WITHOUT persisting. Returns `{ valid, errors }` instead of applying."),composition_id:n().optional().describe("Target a SPECIFIC composition instead of the project's active one. Omit it and the project's active composition is edited, which is the default and the common case. `preview_frame` and `create_render` already accept a compositionId; this closes the gap so a second composition minted with `new_composition` can actually be authored into \u2014 build variant A, mint B, edit B, preview both. Mutually exclusive with `session_id`, which targets the session's scratch."),session_id:n().optional().describe("Optional compose-session id. When present, the ops target the session's SCRATCH composition (a derived sibling) instead of the project's active composition \u2014 the server never mutates active until commit.")}).describe("POST /projects/:id/composition/apply body \u2014 a batch of CompositionOps.");var Zte=200,Xte=c({name:n().min(1).max(Zte).optional(),format:ye.optional()}).describe("POST /projects/:id/compositions body \u2014 create a new video (composition) in the project. `format` defaults to the project's compositionFormat when omitted.");var eoe=c({suggestionId:n().min(1),format:c({aspectRatio:h(["16:9","9:16","1:1","4:5"]),fps:E([b(24),b(25),b(30),b(60)]).optional(),resolution:h(["hd","fhd","4k"]).optional(),platform:n().optional()}).optional()});var toe=0,ooe=9007199254740991,qm=c({compositionId:n(),format:ye,etag:n(),isActive:P(),updatedAt:i(),sceneCount:A().min(toe).max(ooe)}).describe("A composition in a project, flagging the active one.");var roe=c({data:y(qm)}).describe("GET /projects/:id/compositions response.");var soe=2e3,noe=c({intent:n().min(1).max(soe).describe("Plain-English goal \u2014 what you're trying to achieve with this edit."),mode:h(["advise","amend","explore"]).optional().describe("advise = proposer-only (no render/judge, no grounded assessment); amend (default) = grade the current composition + author the fix for the weakest criterion; explore = ranked slate of diverse directions. All modes are async \u2014 poll the returned job."),focus:h(["editorial","spatial","brand","caption"]).optional().describe("Optional criterion to concentrate the advice on."),ifMatch:n().optional().describe("Etag of the composition the advice is computed against. Proposals are bound to it; apply a proposal BEFORE any other edit or it will 409.")}).describe("POST /projects/:id/consult body.");var ioe=c({consultJobId:n().describe("Opaque consult job id; poll it for the advisory result."),projectId:n(),status:h(["queued","failed"]).describe("queued = normal; failed = startup failed and the job is already terminal."),streamUrl:n().optional().describe("Relative SSE endpoint to stream this job's events.")}).describe("POST /projects/:id/consult response.");var Ym=c({faceId:n(),bbox:c({x:i(),y:i(),width:i(),height:i()}),speakingShare:i().optional()});var Qm=c({detectorVersion:n().describe("Version of the face detector that produced this source-window roster."),window:c({startSec:i(),endSec:i()}),faces:y(Ym)});var nSe=c({projectId:n(),mediaId:n()});var aoe=0,coe=10,poe=6,doe=c({criticId:n().min(1).describe("Stable client id; re-registering the same id UPSERTS."),label:n().min(1),tier:h(["rules","rubric","evaluator"]),floor:i().min(aoe).max(coe).optional().describe("Score below this routes a refine like a built-in criterion. Defaults to 6."),rules:y(O(n(),L())).optional().describe('tier "rules": declarative ClientRule[] (data).'),rubric:n().optional().describe('tier "rubric": your criterion + description; scored as an extra column.'),referenceMediaIds:y(n()).max(poe).optional().describe('tier "rubric"/"evaluator": up to 6 org media ids whose thumbnails the judge sees as YOUR reference standard \u2014 "looks like mine" becomes a machine check. Each must be an org-owned media item with a visual thumbnail (422 names any that is not).'),url:xe().optional().describe('tier "evaluator": your HTTPS webhook; CueFrame POSTs the artifact.')}).describe("Register a custom compose critic.");var Bs=c({criticId:n(),label:n(),tier:h(["rules","rubric","evaluator"]),floor:i(),referenceMediaIds:y(n()).optional()}).describe("One registered critic (rubric/rules/url stay write-only \u2014 never echoed).");var loe=c({critics:y(Bs)});var uoe=c({id:n(),criticId:n(),tier:h(["rules","rubric","evaluator"]),secret:n().optional().describe("evaluator tier: Standard-Webhooks signing secret, returned ONCE.")}).describe("POST /critics response (evaluator secret present exactly once).");var moe=c({fromCompositionId:n().min(1).describe("Source composition to reframe a sibling from."),targetFormat:ye.describe("The target output format (aspectRatio + optional fps/resolution) for the new sibling.")}).describe("Derive a reframed sibling composition for a new aspect (Auto-Reframe / Magic-Resize, agent-native).");var hoe=c({compositionId:n().describe("The new sibling composition's id.")}).describe("POST /projects/:id/compositions/derive response.");var fSe=c({error:c({code:n().describe("Stable machine-readable error code per \xA7Error Model."),message:n().describe("Human-readable message."),contract:n().describe("Contract version that produced this verdict. If it differs between two calls, the rules changed underneath you, not your request."),details:O(n(),L()).optional().describe("Optional context (currentEtag, projectIds, retryAfter, \u2026).")}).describe("Standard API error envelope.")}).describe("Error envelope used by every non-2xx response.");var go=c({kind:h(["transcript","subjectTrack","matte"]),intent:c({kind:h(["whole","window"]),window:c({startSec:i(),endSec:i()}).optional().describe("The SOURCE window this fact covers, when it is scoped to a clip.")}),status:h(["pending","ready","failed"]),summary:c({presenceFraction:i().optional().describe("Matte only: fraction of frames carrying a detected subject (0\u20131). Below 0.6 there is no reliable silhouette \u2014 the matte is delivered but cannot carry a behind-subject graphic, and is NOT charged."),faceCount:i().optional(),language:n().optional(),wordCount:i().optional(),durationSec:i().optional()}).optional(),charge:c({usd:i()}).optional().describe("What this fact was BILLED, in USD. Absent when it cost nothing: a compose/render side effect (already paid for inside that operation) or an unusable matte."),error:c({code:n(),message:n()}).optional(),readyAt:i().optional()}).describe("One derived fact about a media item \u2014 computed once, charged at most once.");var bo=c({kind:h(["transcript","subjectTrack","matte"]),quotedUsd:i().describe("The server's price for this enhancement, in USD. Meaningful ONLY when `available` is true \u2014 an unavailable offer quotes 0 because there is nothing to price yet."),available:P(),reason:n().optional().describe("Why this cannot be bought right now. Present iff `available` is false. e.g. `media_not_ready` (the source has no known duration yet).")}).describe("A purchasable enhancement that this media item does not have yet.");var Jm=E([c({kind:h(["subjectTrack","matte"]),scope:c({startSec:i(),endSec:i()}),state:h(["pending","ready","failed"]),fact:go}),c({kind:h(["subjectTrack","matte"]),scope:c({startSec:i(),endSec:i()}),state:h(["available","unavailable"]),offer:bo})]).describe("The server-selected fact or offer for one exact source window. Present when kind, startSec, and endSec are supplied; clients consume this instead of recreating the fact hash.");var foe=24,xoe=c({count:A().min(1).max(foe),contentType:h(["image/jpeg","image/png"]).optional(),includeContactSheet:P().optional()}).describe("POST /brand-kits/exemplar-uploads body. Reserve presigned PUT slots for curated reference frames (\u2264720px recommended \u2014 they are vision input tokens downstream).");var goe=c({batchId:n(),uploads:y(c({key:n(),url:n()})),contactSheetUpload:c({key:n(),url:n()}).optional(),expiresAt:n()});var boe=c({clipSuggestionId:n().min(1)}).describe("POST /projects/:id/exports/{fcpxml,premiere} body.");var Zm=c({phase:h(["trim","build","upload","trigger"]),message:n(),detail:n().optional(),retryable:P()});var Xm=h(["fcpxml","premiere"]);var eh=h(["queued","trimming","building","uploading","complete","error","cancelled"]);var yoe=0,Aoe=1,Soe=c({id:n(),format:Xm,status:eh,progress:i().min(yoe).max(Aoe).describe("Fractional progress 0..1 across the trim/build/upload pipeline. Reaches 1 only on `complete`."),outputUrl:n().nullable(),outputExpiresAt:n().nullable(),outputSizeBytes:i().nullable(),outputDurationSec:i().nullable(),error:E([Zm,G()]).describe("Set when status is `error`; null otherwise. The phase field localizes the failure to trim / build / upload / trigger."),trimCacheHit:P().nullable(),clipSuggestionId:n().nullable(),createdAt:n(),updatedAt:n()}).describe("NLE export job response.");var zoe=c({url:xe()}).describe("POST /brand-kits/extract body \u2014 the website URL to extract brand tokens from.");var th=c({colors:y(n()),fonts:y(n()),title:n().optional(),description:n().optional()}).describe("POST /brand-kits/extract response \u2014 extracted brand tokens (not persisted).");var Toe=200,Eoe=0,Coe=50,Ioe=c({query:n().min(1).max(Toe),perPage:A().gt(Eoe).max(Coe).optional()}).describe("POST /fonts/search body.");var Roe=c({results:y(c({family:n(),category:n().optional(),variants:y(n()).optional(),cssUrl:n().optional(),previewText:n().optional()}))}).describe("POST /fonts/search response.");var FSe=c({composition:L()});var _Se=c({compositionId:n().optional()});var woe=0,Ooe=0,Moe=20,koe=100,jSe=c({after:A().min(woe).optional(),before:A().min(Ooe).optional(),limit:A().min(1).max(koe).default(Moe)});var USe=Jt({});var Poe=100,Loe=-9007199254740991,Doe=9007199254740991,voe=-9007199254740991,Foe=9007199254740991,WSe=c({limit:A().min(1).max(Poe).optional(),after:n().optional(),projectId:n().optional(),jobId:n().optional(),from:A().min(Loe).max(Doe).optional(),to:A().min(voe).max(Foe).optional()});var GSe=c({deep:b("1").optional()});var Noe=c({status:h(["ok","degraded"]),version:n(),checks:O(n(),c({ok:P(),detail:n().optional()})).optional()}).describe("Health probe response.");var oh=c({jobId:n().describe("Poll GET /v1/jobs/{jobId} / wait_job until terminal."),jobKey:n().describe("Deterministic identity of the work (content hash of every input the result depends on). Re-enqueueing the same key returns the same job while it runs; a failed key revives as a fresh attempt."),kind:n().describe("Job family, e.g. `verify` | `preview` | `brand_kit_extract`."),status:h(["running","succeeded","cancelled"]).describe("running on a fresh/deduped enqueue; succeeded when an identical request already completed. Cancelled is part of the shared status vocabulary; identical cancelled work revives to running.")});var _oe=0,Boe=9007199254740991,joe=0,Voe=9007199254740991,rh=c({geometry:c({scale:i(),compositionWidth:i().optional(),compositionHeight:i().optional(),width:i().optional(),height:i().optional()}),warnings:y(O(n(),L())).optional(),previewed:c({source:h(["inline","scratch","persisted"]),compositionId:n().optional(),etag:n().optional()}),listUsd:i().optional().describe("List price charged for this delivered capture."),artifacts:y(c({id:n(),beatSec:i(),bytes:A().gt(_oe).max(Boe),contentType:h(["image/png","image/jpeg"]),layers:c({video:n().nullable(),overlays:A().min(joe).max(Voe)}),url:xe(),urlExpiresAt:n()}))});var sh=c({perCriterion:L(),composite:i(),critique:n(),checkpointId:n(),beats:L().optional(),clientScores:y(L()).optional(),listUsd:i().optional().describe("List price charged for this delivered evaluation.")});var Uoe=c({id:n().describe("Job id \u2014 pass to GET /v1/jobs/{id} / wait_job."),jobKey:n().describe("Deterministic identity of the work (idempotency key, e.g. `verify-<sessionId>-<contentHash>` \u2014 the hash covers the composition AND grading inputs). Re-enqueueing the same key returns the same job while it runs."),kind:n().describe("Job family, e.g. `verify`."),status:h(["running","succeeded","failed","cancelled"]).describe("Poll until terminal (`succeeded` | `failed` | `cancelled`)."),progress:E([c({phase:n(),percent:i().optional(),message:n().optional()}),G()]).describe("Executor heartbeat while running; null when none reported."),result:E([E([rh,jm,sh,th]),G()]).describe("Kind-specific payload when status is `succeeded`; null otherwise."),error:E([c({code:n(),message:n()}),G()]).describe("Stable failure code + human message when status is `failed`; null otherwise. `job_timeout` = the executor died mid-run and the stall sweep reaped the job \u2014 re-enqueue to retry."),createdAt:n(),updatedAt:n(),completedAt:n().nullable()});var nh=c({mediaId:n().describe("The media item this moment belongs to \u2014 feed it to apply_composition as a clip source, or GET /v1/media/{id}/context for its faces/beat/word grids."),name:n().describe("The media item's name, so a result is readable without a second call."),score:i().describe("Cosine similarity between the query text and the chunk's frame, in [-1, 1]. Higher is closer. Compare scores WITHIN one response; absolute values are not calibrated across queries."),startSec:i().describe("Moment start, SECONDS from the media item's start."),endSec:i().describe("Moment end, SECONDS from the media item's start."),thumbUrl:n().nullable().describe("Presigned URL for the media item's thumbnail, or null when it has none. This is the ITEM's thumbnail, not a still of this moment \u2014 render a still of the exact range with preview_frame.")});var Hoe=c({results:y(nh).describe("Matching moments, best first. Empty means nothing matched (when `indexing` is false) \u2014 the library was searched and came back empty-handed."),indexing:P().describe('TRUE when some of the org\'s footage is NOT in the visual index yet \u2014 media that predates it, or is still processing. This is COVERAGE, not emptiness: it can be true ALONGSIDE results, and then it means "these are the best moments among what we have looked at so far", not "these are the best moments". An empty `results` with `indexing: true` means "not looked at yet", NOT "no match" \u2014 re-run the media through processing (reprocess) to index it, then search again. FALSE with empty `results` is a real miss: the library was searched and nothing matched.')}).describe(`Semantic search over the org's OWN footage. The query is embedded with the same CLIP model that embedded every indexed frame, so a description of what you want to SEE ("wide shot of the speaker at a whiteboard") finds the moment even when nobody says those words.`);var Woe=100,i0e=c({limit:A().min(1).max(Woe).optional(),after:n().optional()});var $oe=100,c0e=c({limit:A().min(1).max($oe).optional(),after:n().optional(),projectId:n().optional(),kind:h(["authored","clip","all"]).optional()});var Goe=100,d0e=c({category:h(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]).optional(),kind:h(["component","transition","scene"]).optional(),tier:h(["recommended","standard","niche"]).optional(),useCase:h(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"]).optional(),mood:n().optional(),q:n().optional(),intent:n().optional(),limit:A().min(1).max(Goe).optional(),after:n().optional()});var Koe=100,u0e=c({limit:A().min(1).max(Koe).optional(),after:n().optional(),composeJobId:n().optional(),projectId:n().optional()});var h0e=c({kind:h(["subjectTrack","matte"]).optional(),startSec:i().optional(),endSec:i().optional()});var qoe=100,x0e=c({limit:A().min(1).max(qoe).optional(),after:n().optional(),kind:h(["video","audio","image","gif","asset","source","stock"]).optional(),source:h(["upload","generated","import-url","stock"]).optional(),tag:n().optional()});var Yoe=100,b0e=c({limit:A().min(1).max(Yoe).optional(),after:n().optional(),platform:n().optional(),format:n().optional(),topic:n().optional()});var Qoe=100,A0e=c({limit:A().min(1).max(Qoe).optional(),after:n().optional(),status:n().optional()});var Joe=100,z0e=c({limit:A().min(1).max(Joe).optional(),after:n().optional()});var E0e=c({groupId:n().min(1)});var Zoe=100,I0e=c({limit:A().min(1).max(Zoe).optional(),after:n().optional()});var Xoe=100,w0e=c({limit:A().min(1).max(Xoe).optional(),after:n().optional()});var ere=0,tre=0,ore=c({startSec:i().min(ere).describe("Source-in of the window to matte, in seconds into the underlying source."),endSec:i().gt(tre).describe("Source-out of the window to matte, in seconds into the underlying source.")}).describe("POST /media/:id/matte body. The window is REQUIRED and is the clip's SOURCE trim, not timeline time: a matte's cost scales with its duration, so there is no whole-source default to fall back on.");var rre=c({factId:n(),status:h(["pending","ready","failed"]),quotedUsd:i().describe("The server's price for this matte, in USD, quoted from the window duration."),alreadyExisted:P().describe("True when a matte for this exact window was already pending or ready. Nothing was dispatched and nothing will be charged.")}).describe("POST /media/:id/matte response \u2014 the claimed matte fact.");var ic=c({mediaItemId:n(),language:n().nullable(),fullText:n(),utterances:y(O(n(),L())),data:y(O(n(),L())).optional(),pagination:be.optional()}).describe("Transcript response.");var sre=c({mediaId:n(),durationSec:i().nullable(),width:i().nullable(),height:i().nullable(),thumbnail:E([c({url:n()}),G()]).describe("Presigned processing thumbnail (~1 week) \u2014 the footage at a glance. For stills at chosen timestamps, use preview_frame with a one-clip composition over this media."),faces:c({status:h(["ready","not_detected"]),windows:y(Qm)}),transcript:c({status:h(["ready","not_transcribed","unavailable"]),data:E([ic,G()])}),beatGrid:E([c({bpm:i(),beatTimesMs:y(i()).describe("Beat onset times in MILLISECONDS \u2014 divide by 1000 for timeline startTime (composition timeline fields are seconds)."),confidence:i().describe("Rhythmic-periodicity strength (0\u20131). Trust the grid for cutting when high; a beatless bed reports low."),method:h(["requested-anchored","detected"]).describe("`requested-anchored` = phase-locked to a requested BPM (a generated bed whose prompt named a tempo); `detected` = full beat tracking (import/upload).")}),G()]).describe("The MUSIC-role rhythm grid (audio-substrate MVP). Present only for a music bed that carries a computed beat grid; null otherwise. For a music-driven film, cut on these beats (transition midpoints on beats, risers resolving on downbeats)."),wordGrid:E([c({wordTimesMs:y(i()).describe("Word onset times in MILLISECONDS, in order \u2014 divide by 1000 for timeline startTime (composition timeline fields are seconds).")}),G()]).describe("The VO-role rhythm grid: word onsets surfaced from the transcript (pure exposure). Present only when a transcript exists; null otherwise. For a VO-driven (narration) film, cut every beat boundary to the voice \u2014 the film-spine rule."),audioRole:E([h(["vo","music","sfx","ambience"]),G()]).describe("DECLARED audio role of this asset (audio-substrate P0): 'vo' (narration), 'music' (bed that ducks under speech), 'sfx' (one-shot hit), 'ambience' (a bed that HOLDS under VO \u2014 never ducks). Author the clip source's `audioRole` from this. Null for footage/images or an undeclared audio asset."),envelope:E([c({envelopeClass:h(["transient","sweep","ambient"]).describe("Coarse temporal shape: 'transient' (a sharp one-shot), 'sweep' (a bounded rise/fall over ~0.5\u20132s), 'ambient' (an unbounded bed)."),attackMs:i().optional(),spectralCentroidHz:i().optional(),meanVolumeDb:i().optional(),maxVolumeDb:i().optional()}),G()]).describe("Envelope evidence (audio-substrate P0). `envelopeClass` is always present when an envelope exists (the SFX pack carries it); the numeric probe stats are present only when an audio probe has run. Null when no envelope is stored."),facts:y(go).describe("Derived facts about this source (subject tracks, mattes): what has been computed, its status, and what it was billed. Same shape as GET /media/{id}/facts."),offers:y(bo).describe("Enhancements this source does not have yet, with a server quote. Same shape as GET /media/{id}/facts. Mattes are quoted per-window via POST /media/{id}/matte, never here.")}).describe("Read-only authoring context for a source media item: detected face roster + transcript + the temporal grids (beat / word) an agent cuts to, the DECLARED audioRole + envelope of an audio asset, and the paid-enhancement block (facts already computed + offers for what is missing).");var nre=c({id:n(),uploadUrl:xe(),expiresAt:n()}).describe("POST /media response: reserved media id + a presigned PUT URL. PUT the raw bytes to uploadUrl (\u2264 ~5 GiB), then POST /media/:id/finalize.");var ire=0,are=0,cre=c({kind:h(["subjectTrack","matte"]).describe("Which enhancement to buy. `transcript` is NOT purchasable here \u2014 it is delivered by the transcription pipeline."),intent:c({startSec:i().min(ire),endSec:i().gt(are)}).optional().describe("The SOURCE window. REQUIRED for `matte` (its cost scales with duration). OPTIONAL for `subjectTrack`: give a clip's source window to buy the track the render looks up for THAT clip, and pay only for its duration; omit it to detect the whole source.")}).describe("POST /media/:id/facts body.");var pre=c({factId:n(),status:h(["pending","ready","failed"]),quotedUsd:i(),alreadyExisted:P().describe("True when this exact fact was already pending or ready. Nothing was dispatched and nothing will be charged.")}).describe("POST /media/:id/facts response.");var dre=c({facts:y(go),offers:y(bo).describe("What is NOT yet present and could be bought. A `matte` offer appears ONLY when the request carried `startSec`+`endSec` (the clip's SOURCE window) \u2014 a matte's price is a function of its duration, so there is no honest whole-source matte quote. `transcript` is never offered: it is produced by the ingest pipeline, not bought here."),exact:Jm.optional()}).describe("Facts and offers for a media item, plus an exact-window resolution when requested.");var lre=c({audioRole:h(["vo","music","sfx","ambience"]).optional().describe("Declared audio role: 'vo' (narration), 'music' (bed that ducks under speech), 'sfx' (one-shot hit), 'ambience' (a bed that HOLDS under VO \u2014 never ducks).")}).describe("POST /media/:id/finalize body \u2014 optional declared audioRole.");var ure=c({id:n(),status:h(["processing","complete"]),processingPhase:n()}).describe("POST /media/:id/finalize response: ingest triggered (audio/video \u2192 processing) or the item is immediately ready (image/asset \u2192 complete).");var mre=1e4,hre=c({generator:h(["text-to-video","text-to-image","image-to-video","text-to-music","text-to-speech","text-to-sfx","auto"]),prompt:n().min(1).max(mre),style:O(n(),L()).optional().describe("Free-form generation parameters, read per generator. All generators honor `aspect` (string) + `durationSec` (number) where applicable. text-to-speech honors `voice` (string; default voice when omitted), `speed` (number 0.7-1.2), `stability` (number 0-1), and `styleExaggeration` (number 0-1 \u2192 the endpoint's style exaggeration). Provider and model selection are server-owned and cannot be overridden."),refs:c({firstFrameMediaId:n().optional(),lastFrameMediaId:n().optional(),imageMediaIds:y(n()).optional()}).optional()}).describe("POST /media/generate body.");var fre=c({id:n(),status:b("generating"),estimateUsd:i().optional()}).describe("POST /media/generate response.");var xre=2048,gre=500,bre=0,yre=10737418240,Are=c({url:xe().max(xre),filename:n().min(1).max(gre),contentType:h(["video/mp4","video/quicktime","video/x-matroska","video/webm","audio/mpeg","audio/wav","audio/x-wav","audio/mp4","audio/aac","image/png","image/jpeg","image/webp","image/gif","image/svg+xml","application/json","font/ttf","font/otf","font/woff","font/woff2"]),size:A().gt(bre).max(yre).optional(),audioRole:h(["vo","music","sfx","ambience"]).optional().describe("Declared audio role: 'vo' (narration), 'music' (bed that ducks under speech), 'sfx' (one-shot hit), 'ambience' (a bed that HOLDS under VO \u2014 never ducks).")}).describe("POST /media/import body.");var Sre=c({id:n(),status:b("importing")}).describe("POST /media/import response.");var ih=c({phase:h(["idle","pending_import","pending_upload","uploading","extracting","loading_model","transcribing","proxy","embedding","analyzing","indexing","generating","rendering","processing","complete","error","cancelled"]),percent:i().nullish(),message:n().nullish(),error:n().nullish()}).describe("Processing status stored on mediaItems rows.");var ac=c({id:n(),status:n(),source:h(["upload","generated","stock"]),name:n(),mimeType:n(),fileSize:i(),duration:i().nullable(),width:i().nullable(),height:i().nullable(),frameRate:i().nullable(),progress:E([c({phase:n(),percent:i().nullable()}),G()]),analysis:E([O(n(),L()),G()]),listUsd:i().optional().describe("A2 money stamp \u2014 GENERATED media only: the generate meter's LIST price (USD) at the success terminal. A plan allowance may zero the invoice line. Absent for uploads/imports, failures, x402 (on-chain receipts)."),thumbnailUrl:n().nullable().describe("Presigned GET URL for the item's thumbnail (an uploaded image is its own thumbnail), valid ~7 days \u2014 fetch it directly, no auth header. null when no thumbnail exists yet (still processing, stock imports, audio)."),kind:n().nullable(),tags:E([y(n()),G()]),attribution:E([c({provider:h(["pexels","pixabay","freesound","klipy"]),externalId:n().nullable(),assetUrl:n().nullable(),license:n().nullable()}),G()]),processingStatus:E([ih,G()]),createdAt:n(),updatedAt:n()}).describe("Media item response per \xA7Media.");var zre=c({data:y(ac),pagination:be});var Tre=500,Ere=0,Cre=10737418240,Ire=c({filename:n().min(1).max(Tre),contentType:h(["video/mp4","video/quicktime","video/x-matroska","video/webm","audio/mpeg","audio/wav","audio/x-wav","audio/mp4","audio/aac","image/png","image/jpeg","image/webp","image/gif","image/svg+xml","application/json","font/ttf","font/otf","font/woff","font/woff2"]),size:A().gt(Ere).max(Cre),projectId:n().min(1).optional()}).describe("POST /media upload initiation body.");var Rre=c({jobId:n(),status:n(),muxedItems:E([O(n(),n()),G()]).optional(),error:n().nullish(),startedAt:n().nullish(),completedAt:n().nullish()}).describe("Mux job response.");var ize=c({sessionId:n()});var wre=0,Ore=0,Mre=c({fromSec:i().min(wre).describe("Window start, seconds into the composition."),toSec:i().gt(Ore).describe("Window end (exclusive), seconds."),compositionId:n().min(1).optional().describe("Target a specific composition; defaults to the project's active composition.")}).describe("POST /projects/:id/preview-clip body.");var kre=18,Pre=.1,Lre=1,Dre=100,vre=c({composition:L().optional().describe("The composition to render. Absent \u21D2 the project's ACTIVE composition \u2014 what create_render will encode. The response's `previewed.source` names what was rendered."),compositionId:n().optional().describe("Preview a SPECIFIC persisted composition of this project (create_render parity). Absent \u21D2 the active one. A stale/foreign id is a 404 \u2014 never a silent fall-through."),session_id:n().optional().describe("Compose-session id: render that session's SCRATCH composition (what the session has been editing) instead of the active row. Ignored when `composition` is passed."),timestamps:y(i()).min(1).max(kre).describe("Composition seconds to capture, 18 per request. The batch renders as ONE unit of work \u2014 one warm container, one source decode, N seeks \u2014 and that unit has a fixed time budget, so a larger batch is refused here rather than accepted and timed out minutes later. For a denser sweep, split it across calls; identical beats are served from the still cache, so overlapping batches are cheap."),imageFormat:h(["png","jpeg"]).optional().describe("Still format. Default jpeg \u2014 these pixels go to a vision model, where jpeg is equivalent and png costs multiples in bytes to store and move. Pass png only when you need full fidelity."),scale:i().min(Pre).max(Lre).optional().describe("Render scale 0.1\u20131. Default 0.5, which is what this schema has always recommended for vision-bound looks. Pass 1 when judging fine detail \u2014 it costs ~4x the vision tokens."),jpegQuality:A().min(1).max(Dre).optional().describe("JPEG quality (jpeg only). Default 70 \u2014 the quality the eval panel grades at.")});var Fre=300,Nre=0,_re=1e4,Bre=120,jre=c({brandKits:y(c({id:n(),name:n(),audio:c({sfxIntensity:h(["off","light","standard","dense"]).optional(),musicEnabled:P().optional(),musicMood:n().max(Fre).optional(),sonicLogo:c({ref:n().min(1),placement:h(["intro","outro","both"]),offsetMs:A().min(Nre).max(_re).optional()}).optional().describe("A brand sound signature bound to the intro/outro bookend. `ref` = a palette reference; bound only when the kit carries the matching bumper (intro/outro), else a non-blocking advisory."),uiSoundSet:c({tick:n().min(1).optional(),pop:n().min(1).optional(),impact:n().min(1).optional(),confirm:n().min(1).optional(),error:n().min(1).optional(),whoosh:n().min(1).optional(),riser:n().min(1).optional()}).optional().describe("Per-family SFX overrides (the brand's own tick/pop/\u2026). Highest-priority tier over the org palette + pack default in the compose SFX draw."),bedStyle:c({bedId:n().min(1).optional(),genre:n().max(Bre).optional(),bpmRange:c({min:i(),max:i()}).optional()}).optional().describe("Preferred music bed (`bedId`) or a style hint (`genre` / `bpmRange`). Surfaced for driving agents; compose does not auto-select a pack bed."),ambiencePreference:E([c({ref:n().min(1)}),G()]).optional().describe("Preferred ambience bed (`{ref}`) or explicit null (opt-out). Surfaced for driving agents; compose has no ambience auto-placement.")}).optional()})).describe("The org's brand kits (bind one to a project via update_project). `audio` carries the brand sound kit when set."),critics:y(Bs).describe("Registered critics \u2014 run in the Director's gates AND score_composition."),references:y(c({mediaId:n(),name:n().optional(),thumbnailUrl:n().optional().describe("Presigned reference thumbnail (~1 week).")})).describe("The union of critic reference media \u2014 the org's visual standard, with provenance."),recentDecisions:y(c({checkpointId:n(),projectId:n(),kind:h(["gate","score"]),stage:h(["content","layout","motion"]).optional(),decision:n(),decidedAt:i()})).describe("The last recorded checkpoint decisions \u2014 the raw taste log phase 2 will distill.")}).describe("The org's legible taste: brand + critics + references + decision log.");var Vre=0,Ure=9007199254740991,ah=c({hasComposition:P(),sceneCount:A().min(Vre).max(Ure),duration:i().nullable(),updatedAt:n().nullable()}).describe("Summary of a project's stored composition.");var ch=c({id:n(),name:n(),kind:n().nullable(),durationSec:i().nullable().describe("Seconds. Uses the media duration when known; audio without one falls back to its transcript's measured duration (same rule as get_media_context)."),hasTranscript:P().describe("A cached transcript EXISTS for this item. The bodies are never inlined here \u2014 fetch one with GET /v1/media/{id}/transcript (or get_media_context for faces + grids too).")}).describe("One media item as the project context lists it: identity + duration + whether a transcript exists.");var ph=E([c({status:b("ready"),mediaId:n(),words:y(c({text:n(),start:i().describe("Word onset (SECONDS from source start)."),end:i().describe("Word end (SECONDS from source start).")}))}),c({status:b("unavailable"),mediaId:n()})]);var Hre=0,Wre=0,$re=c({composition:E([oc,G()]).describe("The project's ACTIVE composition wire shape \u2014 identical to GET /v1/projects/{id}/composition. NULL when the project has no composition yet (a freshly created project): mint one with new_composition, or let the first apply_composition create it."),format:E([c({aspectRatio:h(["16:9","9:16","1:1","4:5"]),fps:E([b(24),b(25),b(30),b(60)]).optional(),resolution:h(["hd","fhd","4k"]).optional(),platform:n().optional()}),G()]).describe("The composition's format, hoisted \u2014 the pixel frame every card/graphic must be authored against. Null whenever `composition` is null."),media:y(ch).describe("The org's media library (most recent first, capped) \u2014 the pool this project can draw clips from."),transcript:E([ph,G()]).describe('The FIRST transcribed media item\'s word-timed transcript, flattened \u2014 the spine a VO-driven film cuts to. `status:"ready"` carries the words; `status:"unavailable"` means the transcript exists but its body could not be fetched (retry); null means nothing in `media` is transcribed. For any OTHER transcribed item (see each entry\'s `hasTranscript`), read GET /v1/media/{id}/transcript.'),brandKit:E([nr,G()]).describe("The kit BOUND to this project (`projects.brandKitId` is the brand SSOT \u2014 bind one via update_project). Null when the project has no kit bound; enumerate the org's kits with GET /v1/brand-kits."),markers:y(c({id:n().min(1),startTime:i().min(Hre),endTime:i().min(Wre).optional(),kind:n().min(1),name:n().optional(),metadata:O(n(),L()).optional()})).describe("The composition's markers \u2014 hoisted alongside `format`. Empty when the composition carries none AND when there is no composition yet.")}).describe("One-call agent context for a project: composition + format + media pool + the lead transcript + the bound brand kit + markers. Replaces get_composition + get_media_context + get_profile at the start of an authoring session. A 404 means the project doesn't exist for your org \u2014 never that it is empty.");var Gre=200,Kre=0,qre=0,Yre=c({name:n().min(1).max(Gre),description:n().optional(),format:ye.optional(),brandKitId:n().min(1).optional(),width:i().gt(Kre).optional(),height:i().gt(qre).optional()}).describe("POST /projects body.");var dh=E([c({id:n(),status:n(),createdAt:n(),outputUrl:n().nullable(),outputExpiresAt:n().nullable()}),G()]).describe("Most recent render for a project, if any.");var cc=c({id:n(),name:n(),description:n().nullable(),format:E([ye,G()]),brandKitId:n().nullable(),activeCompositionId:n().nullable(),composition:ah,lastRender:dh,webUrl:n().nullable().describe("A browser URL that opens THIS project, or null when CueFrame exposes no web view for a project. Null today: the console serves account surfaces (keys, usage, billing) and has no per-project page, so there is no link to give. Do NOT synthesise one \u2014 a guessed console path 404s. Show the user rendered output (create_render \u2192 outputUrl) or a preview still instead. This field becoming non-null is the signal that a real project view exists."),createdAt:n()}).describe("Project response per \xA7Projects.");var Qre=c({data:y(cc),pagination:be});var Jre=200,Zre=c({name:n().min(1).max(Jre).optional(),description:n().optional(),format:ye.optional(),brandKitId:n().min(1).optional()}).describe("PATCH /projects/:id body.");var Xre=c({clipSuggestionId:n().min(1).optional(),compositionId:n().min(1).optional().describe("Target a specific composition in the project; defaults to the project's active composition."),format:ye.optional(),priority:h(["interactive","standard","background"]).optional(),intent:h(["preview","final"]).optional(),brandKitId:E([n().min(1),G()]).optional()}).describe("POST /projects/:id/renders body.");var ese=c({manifestVersion:n().describe("Identifies this exact face table. Derived from the table's own content, so it moves when and only when the admitted set moves. Record it beside a composition to state which face table a font choice was validated against."),families:y(c({family:n().describe("The family name authoring accepts VERBATIM \u2014 card, caption and scene text alike."),weights:y(c({min:i(),max:i()})).describe("The weights a shipped file declares. A static face has min === max; a variable face gives its declared wght axis range. Any weight inside a range renders; anything outside every range is REFUSED, never synthesised."),styles:y(h(["normal","italic"])).describe("The styles bytes exist for in this family. Request italic only when this list includes 'italic'; the renderer refuses synthetic slant."),captionDefaults:c({base:i(),emphasis:i()}).describe("The weights a caption is drawn at when the style names none."),origin:h(["bundled","aliased"]).describe("'bundled' = bytes ship in the render bundle. 'aliased' = a metric-compatible binary stands in for the named family.")}))}).describe("GET /fonts response \u2014 the renderer's admitted font set. Derived from the same table the font gate refuses by, so any family/weight/style here passes validation by construction. Covers the BUNDLED set only: a brand kit's sealed faces are per-org and per-render.");var tse=0,ose=9007199254740991,rse=0,sse=9007199254740991,lh=c({phase:h(["queued","validating","presigning","collecting-artifacts","resolving","detecting","baking-matte","translating","spawning","encoding","uploading"]),percent:i(),scenesCompleted:A().min(tse).max(ose).optional(),scenesTotal:A().min(rse).max(sse).optional()}).describe("Non-terminal render progress; phase is one of the worker's emitted stages.");var pc=c({id:n(),status:h(["queued","pending","rendering","complete","error","cancelled"]),progress:lh.optional(),outputUrl:n().nullable(),outputExpiresAt:n().nullable(),error:n().nullable().describe("Human-readable failure message. Pair with `errorCode` for a stable, machine-readable code an agent runner can branch on."),errorCode:n().nullable().describe("Stable, machine-readable error code (e.g. `render_pipeline_unavailable`, `render_route_missing`, `render_pipeline_failed`). Null when status is not `error` or unavailable for an older render."),errorDetails:E([O(n(),L()),G()]).describe("Structured failure context \u2014 `{ targetUrl?, upstreamStatus?, upstreamCode?, attemptedAt? }`. Surfaced so agent runners can distinguish operator-config issues from upstream-down vs route-missing without parsing `error`."),category:E([h(["authoring","transient","internal"]),G()]).describe("Failure taxonomy when status is `error`; null otherwise. `authoring` = deterministic defect in YOUR composition/request \u2014 fix it, retrying is futile; `transient` = temporary pipeline/infra failure \u2014 safe to retry_render; `internal` = unexpected server fault \u2014 retry once then escalate. Mirrors the render.failed webhook's `category`."),retryable:P().nullable().describe("Whether re-attempting the SAME render can succeed (status `error`); null otherwise. true \u2192 call retry_render. false \u2192 deterministic (category authoring/internal); fix the composition first \u2014 retry_render alone reproduces it. Mirrors the render.failed webhook's `retryable`."),createdAt:n(),updatedAt:n().describe("ISO-8601 timestamp of the render's most recent progress update. Compute staleness = now \u2212 updatedAt to distinguish a wedged render from a slow one and decide whether to wait, cancel, or retry."),listUsd:i().optional().describe("A2 money stamp: the metered event's LIST price (USD), stamped at the success terminal (exports for deliverable renders, compose_capture for A8 previews). A plan allowance may zero the actual invoice line \u2014 this is the list price, never a Stripe charge. Absent while running, on failure, and for x402 orgs (on-chain receipts). Mirrors the get_usage ledger."),warnings:y(n()).optional().describe("Non-fatal advisories surfaced at render-CREATE (omitted when none, and on GET \u2014 create-time only).")}).describe("Render job response per \xA7Renders.");var nse=c({data:y(pc),pagination:be});var ise=c({outputUrl:n(),outputExpiresAt:n()}).describe("POST /refresh-url response.");var js=c({candidateId:n(),provider:h(["pexels","pixabay","freesound","klipy"]),kind:h(["video","photo","sfx","gif"]),thumbnail:n(),previewUrl:n(),downloadUrl:n().optional(),duration:i().optional(),width:i().optional(),height:i().optional(),author:n(),authorUrl:n().optional(),assetUrl:n().optional(),license:n().optional()}).describe("A stock resource search candidate.");var ase=c({kind:h(["sfx-pack","music-pack"]).optional(),id:n().min(1).optional(),projectId:n().min(1).optional(),candidateId:n().min(1).optional()}).describe('POST /resources/import body \u2014 stock candidate lane { projectId, candidateId } OR curated pack lane { kind:"sfx-pack"|"music-pack", id }.');var cse=c({id:n(),status:h(["importing","ready"])}).describe("POST /resources/import response.");var pse=200,dse=200,lse=10,use=0,mse=50,hse=0,fse=9007199254740991,xse=0,gse=9007199254740991,bse=0,yse=0,Ase=c({query:n().min(1).max(pse).optional(),queries:y(n().min(1).max(dse)).min(1).max(lse).optional(),kind:h(["video","photo","sfx","gif"]).optional(),provider:h(["pexels","pixabay","freesound","klipy"]).optional(),limit:A().gt(use).max(mse).optional(),minWidth:A().gt(hse).max(fse).optional().describe("Video-only minimum selected-rendition width in pixels; smaller results are excluded."),minHeight:A().gt(xse).max(gse).optional().describe("Video-only minimum selected-rendition height in pixels; smaller results are excluded."),durationSec:c({min:i().min(bse).optional(),max:i().gt(yse).optional()}).optional().describe("sfx-only clip-length bound in seconds \u2192 Freesound native filter.")}).describe("POST /resources/search body \u2014 one `query`, or a batch of `queries[]`.");var uh=c({query:n(),provider:h(["pexels","pixabay","freesound","klipy"]).optional(),kind:h(["video","photo","sfx","gif"]).optional(),candidates:y(js),error:n().optional()}).describe("One query's candidates within a batch search.");var Sse=c({provider:h(["pexels","pixabay","freesound","klipy"]).optional(),kind:h(["video","photo","sfx","gif"]).optional(),candidates:y(js).optional(),results:y(uh).optional()}).describe("POST /resources/search response \u2014 `candidates` for one query, `results[]` for a batch.");var zse=-9007199254740991,Tse=9007199254740991,Ese=c({ok:b(!0),stage:h(["content","layout","motion"]).optional(),version:A().min(zse).max(Tse).optional(),composeJobId:n().optional()}).describe("Decision recorded; the run resumes (the SAME rail as POST /checkpoints/{id}/resume).");var Cse=-9007199254740991,Ise=9007199254740991,Rse=-9007199254740991,wse=9007199254740991,Ose=-9007199254740991,Mse=9007199254740991,kse=c({id:n(),projectId:n(),composeJobId:n().optional(),briefId:n().optional(),kind:h(["gate","score"]),stage:Fs.optional(),version:A().min(Cse).max(Ise),status:h(["awaiting","approved","revised","abandoned","expired","superseded"]),artifact:L().describe("The stage artifact under review: the locked ComposePlan at content; the composition wire shape at layout/motion; the judged composition snapshot on kind:'score'."),stillUrls:y(n()).optional().describe("Presigned storyboard/eval stills \u2014 the packet's visual evidence (may be GC'd by the retention sweep after the job goes terminal; the decision record is immortal)."),criticVerdicts:L().optional().describe("Per-criterion scores + critique from the design loop / judge, incl. lock_violation entries."),quote:vs.optional(),revisionCycle:A().min(Rse).max(wse).describe("Revise cycles this gate has consumed. The brief quote states the included count (revisionCyclesIncluded); beyond it, resume(revise) is refused with a typed error."),decision:L().optional().describe("The recorded decision {decision, comments?, globalNote?, decidedAt} once resolved."),reviewMode:h(["agent","hosted"]).optional().describe("How this packet is decided (from the Brief's gates). 'hosted' = the review PAGE captures the decision; absent/'agent' = the decision flows back through the driving agent."),createdAt:i(),updatedAt:i(),versionStack:y(c({id:n(),version:A().min(Ose).max(Mse),stage:h(["content","layout","motion"]).optional(),status:n(),decision:n().optional(),createdAt:i()})).describe("The run's v1\u2192vN gate history \u2014 per-version status + decision summaries.")});var Pse=c({composition:L().optional().describe("The composition to judge. Absent \u21D2 the project's ACTIVE composition."),compositionId:n().optional().describe("Judge a SPECIFIC persisted composition of this project (create_render parity). Absent \u21D2 the active one. A stale/foreign id is a 404 \u2014 never a silent fall-through."),session_id:n().optional().describe("Compose-session id: judge that session's SCRATCH composition (what the session has been editing) instead of the active row. Ignored when `composition` is passed."),editorialIntent:n().optional(),brandContext:n().optional()});var Lse=10,Dse=25,oTe=c({q:n().min(1),limit:A().min(1).max(Dse).default(Lse)});var mh=c({startSec:i(),endSec:i(),candidateId:n().describe("The chosen audio source (the clearest mic) for this span \u2192 programAudioSourceId."),reasons:y(n())});var hh=c({startSec:i(),endSec:i(),candidateId:n(),sourceInSec:i().describe("Chosen source window start (declared-offset resolved)."),sourceOutSec:i(),reasons:y(n())});var fh=c({candidateId:n().describe("Stable angle/source id. An unknown id is rejected, never remapped."),role:n().nullish().describe('Agent-declared semantic tag (e.g. "wide", "webcam").'),score:i().describe("The weighted prominence score (\u03A3 weights\xB7signal)."),contributions:O(n(),i()).describe("signalKey \u2192 weighted contribution (the agent reweights from this)."),reasons:y(n())});var xh=c({startSec:i().describe("Span start (output seconds)."),endSec:i().describe("Span end (output seconds)."),chosen:n().describe('The recommended candidateId, or "__hold__" (abstain).'),pacingNote:n().nullish().describe("Which mechanism produced the pick (argmax / hysteresis / override / hold \u2026)."),candidates:y(fh)});var vse=c({projectId:n(),groupId:n(),selectorVersion:n(),signalVersions:O(n(),n()),moments:y(xh),recommendation:c({cutSchedule:y(hh),audioBed:y(mh).describe("Best-audio bed (instance #3): the clearest mic per span."),suppressedSwitches:y(c({atSec:i(),wouldHaveBeenCandidateId:n(),byScore:i(),blockedBy:n(),releaseAtSec:i().nullable()})).describe("Switches the stabilizer suppressed (the anti-ping-pong audit).")}),divergesFromComposition:P().optional()}).describe("Selector (switch) candidates + recommendation for a synced-angle group. Every candidate carries score + contributions + reasons so the agent reweights from evidence; the recommendation is the lowered cut schedule + best-audio bed.");var Fse=0,Nse=0,_se=0,Bse=0,jse=0,Vse=c({groupId:n().min(1),weights:O(n(),i()).optional().describe("Sparse prominence weights (the taste knob, non-negative). Default = DOMINANCE_WEIGHTS."),minHoldSec:i().gt(Fse).optional(),enterSec:i().min(Nse).optional(),switchMargin:i().min(_se).optional(),cooldownSec:i().min(Bse).optional(),maxHoldSec:i().gt(jse).optional(),lockSourceId:n().optional().describe("Pin a camera/angle for the whole timeline."),overrides:y(c({startSec:i(),endSec:i(),candidateId:n()})).optional()});var Use=200,Hse=50,Wse=20,$se=c({name:n().min(1).max(Use),files:y(c({mediaId:n().min(1),role:n().min(1).max(Hse)})).min(1).max(Wse)}).describe("POST /sessions body.");var gh=c({mediaId:n(),role:n(),status:n().nullable()}).describe("One file member of a session, with optional role + status.");var Gse=0,Kse=9007199254740991,bh=c({id:n(),name:n(),fileCount:A().min(Gse).max(Kse),muxStatus:n().nullable(),createdAt:n()}).describe("Session list summary (per list endpoint).");var qse=c({data:y(bh),pagination:be});var Yse=c({id:n(),name:n(),files:y(gh),mux:c({status:n().nullable(),jobId:n().nullable(),muxedItems:E([O(n(),n()),G()]),error:n().nullable(),startedAt:n().nullable(),completedAt:n().nullable()}),createdAt:n()}).describe("Session response per \xA7Sessions.");var yh=c({name:n(),title:n(),description:n()}).describe("A CueFrame agent skill (metadata).");var Qse=c({skills:y(yh)}).describe("GET /skills response \u2014 the available agent skills.");var Jse=c({factId:n().describe("Opaque identifier for the derived fact."),status:h(["pending","ready","failed"]).describe("State of the fact right now. `ready` with `alreadyExisted` means the detection was already computed and is available immediately."),quotedUsd:i().describe("The server's price for this detection, in USD, quoted from the source duration. Zero is charged when `alreadyExisted` is true."),alreadyExisted:P().describe("True when this exact detection was already pending or ready. Nothing was dispatched and nothing will be charged \u2014 the same fact is served twice for one price.")}).describe("POST /media/:id/detect-subjects response \u2014 the claimed perception fact.");var Zse=0,Xse=9007199254740991,Ah=c({id:n(),briefId:n().nullable(),rank:A().gt(Zse).max(Xse),trim:c({start:i(),end:i()}),score:i(),title:n(),reason:n(),topic:n(),hook:n(),platforms:y(n()),format:n(),caption:n(),hashtags:y(n()),textOverlays:y(n()),editingNotes:n(),motionStyle:c({textAnimation:n(),transitions:n(),colorMood:n(),captionStyle:n()}),visualTreatment:y(c({time:E([i(),n()]),visual:n()})),brollSuggestions:y(c({moment:n(),searchTerms:y(n()),rationale:n()})),thumbnailConcept:n()}).describe("Single ranked clip suggestion.");var ene=c({status:h(["idle","generating","completed","failed"]),createdAt:n().nullable(),analyzedAt:n().nullable(),jobId:n().nullable(),topics:y(n()),suggestions:y(Ah),pagination:be}).describe("GET /media/:id/suggestions envelope.");var tne=c({status:h(["queued","running","complete","failed"]),alreadyRunning:P().optional()}).describe("POST /media/:id/suggestions response.");var one=1e3,rne=0,sne=0,nne=256,ine=256,ane=0,cne=0,pne=256,dne=12e3,lne=c({words:y(c({text:n().min(1).max(one),timelineStart:i().min(rne),timelineEnd:i().min(sne),clipId:n().min(1).max(nne),poolItemId:n().min(1).max(ine),sourceStart:i().min(ane),sourceEnd:i().min(cne),speakerId:E([n().max(pne),G()])})).min(1).max(dne)}).describe("A bounded merged timeline transcript for CueFrame edit analysis. The server selects the model; clients cannot provide a provider, API key, or model override.");var une=0,mne=9007199254740991,hne=0,fne=9007199254740991,xne=0,gne=9007199254740991,bne=c({fillers:y(A().min(une).max(mne)),silenceGaps:y(A().min(hne).max(fne)),emphasis:y(A().min(xne).max(gne))}).describe("CueFrame-model analysis of timeline word indices. Every returned index refers to the request's words array.");var yne=64,Ane=new RegExp("^[a-z][a-z0-9_]*$"),Sne=0,zne=1,Tne=500,Ene=10,Cne=c({scores:y(c({name:n().min(1).max(yne).regex(Ane),value:i().min(Sne).max(zne),comment:n().max(Tne).optional()})).min(1).max(Ene)}).describe("POST /traces/:traceId/scores body.");var Ine=-9007199254740991,Rne=9007199254740991,wne=c({accepted:A().min(Ine).max(Rne)}).describe("POST /traces/:traceId/scores response.");var One=0,Mne=0,kne=c({task:h(["summary","chapters","highlights"]).describe("What to ask of the transcript. `summary` \u2014 prose: the argument plus the concrete takeaways as bullets. `chapters` \u2014 one line per subject change, `[h:mm:ss] Title \u2014 description`. `highlights` \u2014 up to 8 standalone moments, strongest first, one line each as `[h:mm:ss]-[h:mm:ss] Title \u2014 why it lands` plus the line that carries it. Every timestamp is ABSOLUTE seconds from the start of the media, including when you pass a `window`, and every one is verified against the transcript before you see it \u2014 but they are LINE-START markers about 15s apart, so treat a span as APPROXIMATE (up to 15s early) and refine it against the word timings from GET /v1/media/{id}/context before you cut."),window:c({startSec:i().min(One).describe("Window start, SECONDS from the start of the media."),endSec:i().min(Mne).describe("Window end, SECONDS from the start of the media.")}).optional().describe("Analyse only this slice of the transcript. Omit to analyse all of it. Words are windowed exactly as captions.fromTranscript windows them (a word straddling an edge is clamped, a word wholly outside is dropped). Use this when a long recording is rejected with `transcript_too_long`, and to chapter a single segment of a podcast without paying for the whole thing.")}).describe("One editorial question about a media item's transcript.");var Pne=c({task:h(["summary","chapters","highlights"]).describe("Echo of the requested task \u2014 so a batched caller can pair answers to asks."),result:n().describe("The answer, as text. `summary` is prose; `chapters` and `highlights` are one record per LINE in the shape documented on the request's `task` field \u2014 split on newlines to parse them. Timestamps are absolute seconds from the start of the media and every one is CHECKED against the transcript before the response is returned (a fabricated timestamp fails the call rather than shipping), but they are line-start markers about 15s apart \u2014 a boundary can sit up to 15s BEFORE the moment you want. Use them to locate, not to cut: refine against the word timings in GET /v1/media/{id}/context.")}).describe("The analysis of one media item's transcript. Metered: this is a real LLM call, billed on measured token spend, so it is not a read to poll.");var NTe=c({detector:h(["face","person"]).optional()});var Lne=c({projectId:n().optional().describe("Optional project to scope the token to; omitted = org library.")});var Dne=-9007199254740991,vne=9007199254740991,Fne=c({token:n(),expiresAt:A().min(Dne).max(vne).describe("Expiry, ms since epoch (~30 min TTL).")}).describe("POST /uploads/token response: a short-lived token for the signed upload lane (the upload-signing worker's `uppy-auth-token` header). The org is derived from the session server-side and stamped into the token.");var Sh=c({featureId:n().describe("The metered plan feature (exports, compose, compose_verify, \u2026)."),value:i().optional().describe("Metered amount, in the feature's own unit (exports = render-minutes, storage = GB). Absent for a discrete single use, AND deliberately absent on the cost-plus lines (compose, generate, ai_tokens, compose_verify) whose internal metered unit is not a quantity \u2014 read `listUsd` for what those events cost you."),projectId:n().optional(),jobId:n().optional().describe("The job that produced the meter: a render/compose/preview job id, a media id (transcription, generate), or a clip-suggestion run id (jobKind `suggestions` \u2014 see `mediaItemId` for the media it analyzed)."),jobKind:n().optional().describe("render | compose | consult_* | verify | preview | generate | suggestions | session_uptime | \u2026"),mediaItemId:n().optional().describe("The media item the job ran over, when it ran over one (suggestions, transcription). Resolve it with GET /v1/media/{id}."),listUsd:i().optional().describe("LIST price of this metered event, USD. Honest naming: the invoice may zero it inside a plan allowance \u2014 this is the event's list price, not a Stripe line item."),createdAt:i().describe("Epoch-ms when the meter landed.")});var Nne=c({data:y(Sh),pagination:be});var $Te=c({contract:n().describe("The contract this verdict was computed against (the kernel version the deployment runs). If it differs between two calls, the validator changed, not your composition."),valid:P(),errors:y(c({code:n(),stage:n(),category:n(),retryable:P(),message:n(),fix:O(n(),L()).optional()})),advisories:y(c({rule:n(),criterion:n(),clipId:n().optional(),detail:n(),fix:n()})).describe("Deterministic, render-free QUALITY floors (the SAME named defects the Director's in-loop verify and score_composition surface: static-hold, caption-spine, sfx-density, sfx-speech-collision, bed-coverage, audio-role). NON-blocking \u2014 they never flip `valid` (an editorially-weak composition still renders); fix them for quality, not to save. Empty when the composition is clean or the wire shape failed (they need a parsed composition)."),warnings:y(n()).optional().describe("Non-blocking render-fidelity warnings detected before enqueue, including unavailable font families."),quote:c({thisStepUsd:i(),jobSpendSoFarUsd:i(),estimatedJourneyTotalUsd:i()}).describe("The A2 money triple for the commodity lane: validate is free; estimatedJourneyTotalUsd is the render price to finish from a valid composition \u2014 relay it BEFORE create_render.")});var gt=h(["media.transcribed","media.completed","suggest.completed","session.mux.complete","session.mux.failed","render.completed","compose.completed","checkpoint.ready","project.updated","composition.updated","webhook.test"]);var _ne=0,Bne=6e4,jne=c({url:xe().min(1),events:y(gt).min(1),settleMs:A().min(_ne).max(Bne).optional()}).describe("POST /webhooks body.");var Vne=0,Une=9007199254740991,Hne=c({id:n(),url:xe(),events:y(gt),settleMs:A().min(Vne).max(Une),enabled:P(),status:h(["active","pending"]).describe("active = ownership verified + receiving events; pending = challenge not echoed, inactive."),secret:n().describe("Standard Webhooks signing secret, format `whsec_<base64>`. Returned ONCE at create; rotate = delete + recreate. Every delivery carries `webhook-id`, `webhook-timestamp` (unix seconds), and `webhook-signature: v1,<base64>` (HMAC-SHA256 over `{id}.{timestamp}.{rawBody}`). Verify with any Standard-Webhooks library (`standardwebhooks` / `svix`): `new Webhook(secret).verify(rawBody, headers)`."),verification:c({status:b("pending"),reason:n()}).optional().describe('Present ONLY when ownership verification did not complete (status:"pending"). CueFrame POSTs a signed `webhook.verify` challenge whose `data.token` your endpoint must echo in a 2xx to activate; `reason` is one of token_not_echoed | non_2xx_<code> | unreachable | ssrf_blocked. A pending webhook receives no events \u2014 fix the receiver and POST /webhooks/:id/verify (no delete/recreate needed). See GET /webhooks/events for the full contract.')}).describe("POST /webhooks response (secret present exactly once).");var Wne=c({delivery:O(n(),L()).describe("The shared HTTP envelope + headers + retry semantics."),signing:O(n(),L()).describe("Standard Webhooks signing: secret format, signed content, how to verify."),ownershipVerification:O(n(),L()).describe("The synchronous echo-the-token activation handshake + recovery."),events:y(c({event:gt,when:n(),data:O(n(),n())})).describe("Every subscribable event with its exact delivery `data` fields."),sample:O(n(),L()).describe("A fully-worked example delivery (headers + body).")}).describe("The webhook delivery/signing/verification contract, as data. Read this before building a receiver.");var $ne=0,Gne=9007199254740991,Kne=0,qne=9007199254740991,dc=c({id:n(),url:xe(),events:y(gt),settleMs:A().min($ne).max(Gne),enabled:P(),verificationStatus:h(["pending","verified"]).describe("pending = callback URL has not echoed the ownership challenge (receives no events); verified = ownership proven."),createdAt:n(),lastDeliveredAt:n().nullable(),lastFailedAt:n().nullable(),consecutiveFailures:A().min(Kne).max(qne)}).describe("Webhook endpoint record (secret omitted after create).");var Yne=c({data:y(dc),pagination:be});var Qne=0,Jne=6e4,Zne=c({url:xe().min(1).optional(),events:y(gt).min(1).optional(),settleMs:A().min(Qne).max(Jne).optional(),enabled:P().optional()}).describe("PATCH /webhooks/:id body.");var Xne=c({deliveryId:n(),status:b("queued")}).describe("POST /webhooks/:id/test response.");var eie=c({id:n(),status:h(["active","pending"]).describe("active = ownership verified + receiving events; pending = challenge not echoed."),verification:c({status:b("pending"),reason:n()}).optional().describe("Present only when the re-challenge did not verify; `reason` names why (see WebhookCreateResponse.verification).")}).describe("POST /webhooks/:id/verify response.");var tie=c({orgId:n(),permissions:O(n(),y(n())),keyId:n(),keyName:n()}).describe("Whoami response.");var oie=2048,rie=c({videoUrl:xe().max(oie),format:ye.optional()});var uEe=c({x402Version:b(2),accepts:y(Jt({})).describe("Accepted payment requirements. Read `accepts[0]` for scheme (`exact` for a fixed price, `upto` for a measured one), network (CAIP-2), asset, amount and payTo."),error:n().optional().describe("Human-readable reason.")}).describe("x402 v2 PaymentRequired challenge \u2014 the body of a 402 on a priced operation.");var sie=100,nie=-9007199254740991,iie=9007199254740991,aie=-9007199254740991,cie=9007199254740991,pie=v({limit:A().min(1).max(sie).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:n().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only."),projectId:n().optional().describe("Only events attributed to this project."),jobId:n().optional().describe('Only events produced by this job \u2014 how to answer "did my failed render post a charge?" for one run.'),from:A().min(nie).max(iie).optional().describe("Period start, epoch milliseconds, INCLUSIVE."),to:A().min(aie).max(cie).optional().describe("Period end, epoch milliseconds, EXCLUSIVE.")});var die=100,lie=v({limit:A().min(1).max(die).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:n().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only.")});var lc=Dm;var uie=v({id:n()});var mie=v({id:n()});var hie=100,fie=v({limit:A().min(1).max(hie).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:n().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only."),projectId:n().optional().describe("Scope to one project. Omit for every brief in the org."),kind:h(["authored","clip","all"]).optional().describe("Which briefs to list. `authored` (default) = human-authored only; `clip` = the machine-minted clip briefs from suggest_briefs; `all` = both.")});var xie=v({id:n()});var gie=v({id:n()});var bie=v({id:n()}),yie=ve();var Aie=v({id:n()});var Sie=v({id:n()});var zie=100,Tie=v({limit:A().min(1).max(zie).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:n().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only."),composeJobId:n().optional().describe("Scope to ONE compose run \u2014 its v1\u2192vN gate history with per-version status and decisions."),projectId:n().optional().describe("Scope to everything reviewable in one project.")});var Eie=v({id:n()});var Cie=v({id:n()});var Iie=v({id:n()});var Rie=L(),wie=v({id:n()}),Oie=100,Mie=v({limit:A().min(1).max(Oie).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:n().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only."),platform:n().optional().describe("Only suggestions cut for this delivery platform."),format:n().optional().describe("Only suggestions in this output format."),topic:n().optional().describe("Only suggestions matching this topic label.")});var kie=v({id:n()});var Pie=v({id:n()}),Lie=L();var Die=100,vie=v({category:h(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]).optional().describe("Filter to one category bucket (text|effects|transitions|layouts|backgrounds|ui-blocks|scenes)."),kind:h(["component","transition","scene"]).optional().describe("Filter by render kind (component|transition|scene)."),tier:h(["recommended","standard","niche"]).optional().describe("Filter by curation tier (recommended|standard|niche)."),useCase:h(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"]).optional().describe("Filter to entries whose useCase includes this edit role (e.g. intro, title-over-footage, grade)."),mood:n().optional().describe("Filter to entries whose mood tags include this value (e.g. cinematic, minimal)."),q:n().optional().describe("Free-text match across id/name/description/intent/useWhen/tags/mood. Recommend-orders results."),intent:n().optional().describe("Alias of `q` framed as recommend-by-intent (e.g. intent=intro). Recommend-orders results."),limit:A().min(1).max(Die).optional().describe("Page size (1..100). Omit to return the whole filtered catalog in one page."),after:n().optional().describe("Opaque cursor from a previous page's nextCursor (forward-only).")});var Fie=v({id:n()});var Nie=v({id:n()});var _ie=v({id:n()});var Bie=v({id:n()});var jie=v({id:n()});var Vie=v({id:n(),composeJobId:n()}),Uie=L(),Hie=v({id:n(),composeJobId:n()});var Wie=v({id:n(),composeJobId:n()});var $ie=v({id:n()});var Gie=v({id:n(),composeJobId:n()});var Kie=v({id:n()});var qie=v({sessionId:n()}),Yie=v({id:n(),sessionId:n()}),Qie=v({composition:L()}),Jie=v({id:n(),sessionId:n()}),Zie=v({ok:P()}),Xie=v({id:n(),sessionId:n()}),eae=v({etag:n()});var tae=v({id:n()}),oae=v({compositionId:n().optional().describe("Read a SPECIFIC composition instead of the project's active one. Omit it and the active composition is returned. Pairs with `composition_id` on the apply op: an edit you can make to a second composition is one you can read back.")});var rae=v({id:n()});var sae=L(),nae=v({id:n()});var iae=ve(),aae=v({id:n()});var cae=v({id:n()});var pae=L(),dae=v({id:n()});var lae=L(),uae=v({id:n()});var mae=v({contract:n().describe("The contract this verdict was computed against (the kernel version the deployment runs). If it differs between two calls, the validator changed, not your composition."),valid:P(),errors:y(v({code:n(),stage:n(),category:n(),retryable:P(),message:n(),fix:O(n(),L()).optional()})),advisories:y(v({rule:n(),criterion:n(),clipId:n().optional(),detail:n(),fix:n()})).describe("Deterministic, render-free QUALITY floors (the SAME named defects the Director's in-loop verify and score_composition surface: static-hold, caption-spine, sfx-density, sfx-speech-collision, bed-coverage, audio-role). NON-blocking \u2014 they never flip `valid` (an editorially-weak composition still renders); fix them for quality, not to save. Empty when the composition is clean or the wire shape failed (they need a parsed composition)."),warnings:y(n()).optional().describe("Non-blocking render-fidelity warnings detected before enqueue, including unavailable font families."),quote:v({thisStepUsd:i(),jobSpendSoFarUsd:i(),estimatedJourneyTotalUsd:i()}).describe("The A2 money triple for the commodity lane: validate is free; estimatedJourneyTotalUsd is the render price to finish from a valid composition \u2014 relay it BEFORE create_render.")}),hae=v({id:n(),compositionId:n()}),fae=ve();var xae=v({id:n()});var gae=v({criticId:n()}),bae=ve();var yae=v({id:n()});var Aae=v({id:n()});var Sae=v({id:n()});var zae=v({id:n()});var Tae=v({id:n()});var Eae=v({id:n(),exportId:n()});var Cae=v({id:n(),exportId:n()});var Iae=v({deep:b("1").optional().describe("Pass `1` to run the deep dependency checks instead of the shallow liveness probe.")});var Rae=Jt({});var wae=v({jobId:n()});var Oae=v({jobId:n()});var Mae=10,kae=25,Pae=v({q:n().min(1).describe("What the moment should look like, in plain language. Describe the IMAGE, not the words spoken."),limit:A().min(1).max(kae).default(Mae).describe("Maximum moments to return. Default 10, maximum 25.")});var Lae=100,Dae=v({limit:A().min(1).max(Lae).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:n().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only."),kind:h(["video","audio","image","gif","asset","source","stock"]).optional().describe("Filter to one media kind."),source:h(["upload","generated","import-url","stock"]).optional().describe("Filter by how the item entered the library."),tag:n().optional().describe("Filter to items carrying this EXACT tag (not a prefix or substring match).")});var vae=v({id:n()});var Fae=v({id:n()}),Nae=ve(),_ae=v({id:n()});var Bae=v({id:n()}),jae=0,Vae=0,Uae=20,Hae=100,Wae=v({after:A().min(jae).optional().describe("Zero-based utterance cursor returned as pagination.nextCursor."),before:A().min(Vae).optional().describe("Zero-based utterance cursor for a backward page. Do not combine with after."),limit:A().min(1).max(Hae).default(Uae).describe("Utterances per page.")});var $ae=v({id:n()});var Gae=v({id:n()}),Kae=v({detector:h(["face","person"]).optional().describe("Which detector to run. Defaults to `face`; an unknown value is refused, never defaulted.")});var qae=v({id:n()});var Yae=v({id:n()}),Qae=v({kind:h(["subjectTrack","matte"]).optional().describe("Resolve one exact editor prerequisite. Requires startSec and endSec; the response includes the server-selected `exact` result."),startSec:i().optional().describe("Source-in of the clip's trim, in seconds. Must be sent WITH endSec \u2014 one without the other is a 400, never a silent whole-source default."),endSec:i().optional().describe("Source-out of the clip's trim, in seconds. Must be sent WITH startSec.")});var Jae=v({id:n()});var Zae=v({id:n()});var Xae=100,ece=v({limit:A().min(1).max(Xae).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:n().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only.")});var tce=v({id:n()});var oce=v({id:n()});var rce=v({id:n()}),sce=ve(),nce=v({id:n()});var ice=v({id:n()});var ace=v({id:n()}),cce=100,pce=v({limit:A().min(1).max(cce).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:n().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only."),status:n().optional().describe("Comma-separated render statuses to include (e.g. `error,cancelled`). Omit for every status.")});var dce=v({id:n()});var lce=v({id:n(),renderId:n()});var uce=v({id:n(),renderId:n()});var mce=v({id:n(),renderId:n()});var hce=v({id:n(),renderId:n()});var fce=v({id:n(),renderId:n()}),xce=L();var gce=v({id:n()}),bce=v({groupId:n().min(1).describe("The synced-angle group to score.")});var yce=v({id:n()});var Ace=100,Sce=v({limit:A().min(1).max(Ace).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:n().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only.")});var zce=v({id:n()});var Tce=v({id:n()}),Ece=ve(),Cce=v({id:n()});var Ice=v({id:n()});var Rce=v({name:n()}),wce=L();var Oce=v({traceId:n()});var Mce=100,kce=v({limit:A().min(1).max(Mce).optional().describe("Page size (1..100), default 20. Out-of-range or unparseable clamps into the range."),after:n().optional().describe("Opaque cursor from the previous page's `pagination.nextCursor`. Forward-only.")});var Pce=v({id:n()});var Lce=v({id:n()});var Dce=v({id:n()}),vce=ve(),Fce=v({id:n()});var Nce=v({id:n()});var _ce=v({projectId:n(),mediaId:n()});import{createHash as Bce}from"crypto";function zh(o){return o.replace(/\r\n?/g,`
67
+ `).normalize("NFC")}function uc(o,e){if(o===null||typeof o=="boolean")return o;if(typeof o=="string")return zh(o);if(typeof o=="number"){if(!Number.isFinite(o))throw new TypeError("Canonical JSON does not support non-finite numbers.");return Object.is(o,-0)?0:o}if(typeof o!="object")throw new TypeError(`Canonical JSON does not support ${typeof o} values.`);if(e.has(o))throw new TypeError("Canonical JSON does not support cyclic values.");e.add(o);try{if(Array.isArray(o))return o.map(a=>uc(a,e));let t=Object.getPrototypeOf(o);if(t!==Object.prototype&&t!==null)throw new TypeError("Canonical JSON only supports plain objects.");let r=o,s={};for(let a of Object.keys(r).sort()){let p=r[a];if(p===void 0)throw new TypeError("Canonical JSON does not support undefined values.");s[zh(a)]=uc(p,e)}return s}finally{e.delete(o)}}function Th(o){return JSON.stringify(uc(o,new Set))}function Eh(o){return Th(o)}function jce(o){return Bce("sha256").update(o).digest("hex")}function Ch(o){return jce(Eh(o))}var cf=Ff(tf(),1);var Yc=Object.freeze(["react","react/jsx-runtime","remotion","@remotion/media","@remotion/layout-utils","@remotion/transitions","@remotion/motion-blur","@remotion/noise","@remotion/paths","@remotion/shapes","@remotion/three","three","three/webgpu","three/tsl","@react-three/fiber","@cueframe/animate","gsap","postprocessing"]),of=new Set(["Date","requestAnimationFrame","setTimeout","setInterval"]),rf=new Set(["Math.random","Date.now","performance.now","crypto.getRandomValues","crypto.randomUUID"]),sf=new Set(["Audio","Html5Audio","Html5Video","OffthreadVideo","Video"]);var nf=new Set(Yc);function af(o){let e=o.imported;return o.type!=="ImportSpecifier"||!e?null:e.type==="Identifier"&&typeof e.name=="string"?e.name:e.type==="StringLiteral"&&typeof e.value=="string"?e.value:null}function pf(o){if(!o||typeof o!="object")return null;let e=o;if(e.type==="Identifier"&&typeof e.name=="string")return e.name;if(e.type!=="MemberExpression"&&e.type!=="OptionalMemberExpression")return null;let t=pf(e.object);if(!t||!e.property||typeof e.property!="object")return null;let r=e.property,s=e.computed===!0?r.type==="StringLiteral"&&typeof r.value=="string"?r.value:null:r.type==="Identifier"&&typeof r.name=="string"?r.name:null;return s?`${t}.${s}`:null}function Qc(o){return pf(o)?.replace(/^(?:globalThis|window|self)\./,"")??null}function Ke(o){throw new Ot("component_import_denied",`Component import is not allowed: ${JSON.stringify(o)}.`)}var ide=new Set(["loc","start","end","errors","comments"]);function df(o){return Object.entries(o).filter(([e])=>!ide.has(e)).map(([,e])=>e)}function Jc(o,e){if(!o||typeof o!="object")return;if(Array.isArray(o)){for(let s of o)Jc(s,e);return}let t=o,r=t.name;if(t.type==="JSXOpeningElement"&&r?.type==="JSXIdentifier"&&e.has(r.name)){let s=Array.isArray(t.attributes)?t.attributes:[];if(s.some(u=>u.type==="JSXSpreadAttribute"))throw new Ot("component_api_mismatch","MediaTileScene props must be explicit so the source can be admitted.");let a=new Set(s.flatMap(u=>{let f=u.name;return u.type==="JSXAttribute"&&f?.type==="JSXIdentifier"?[f.name]:[]})),p=["streams","tiles"].filter(u=>!a.has(u));if(p.length>0)throw new Ot("component_api_mismatch",`MediaTileScene requires ${p.map(u=>`\`${u}\``).join(" and ")}. Pass \`streams={{ id: { asset: assets.slot } }}\` and make each tile reference that id with \`stream\`.`)}for(let s of df(t))Jc(s,e)}function lf(o,e){let t,r=new Set;try{t=(0,cf.parse)(o,{sourceType:"module",plugins:["jsx","typescript"],errorRecovery:!1})}catch(a){throw new Ot("component_does_not_compile",a instanceof Error?a.message:String(a))}let s=a=>{if(!a||typeof a!="object")return;if(Array.isArray(a)){for(let f of a)s(f);return}let p=a,u=p.type;if((u==="ImportDeclaration"||u==="ExportNamedDeclaration"||u==="ExportAllDeclaration")&&p.source&&typeof p.source=="object"){let f=p.source.value;if(typeof f=="string"&&!nf.has(f)&&Ke(f),(f==="remotion"||f==="@remotion/media")&&u==="ImportDeclaration"){let x=(Array.isArray(p.specifiers)?p.specifiers:[]).map(af).find(g=>g!==null&&sf.has(g));x&&Ke(`${f}.${x}; use @cueframe/animate MediaTileScene`)}if(f==="@cueframe/animate"&&u==="ImportDeclaration"){let m=Array.isArray(p.specifiers)?p.specifiers:[];for(let x of m){let g=af(x);if(g!=="MediaTileScene"&&g!=="ImageTileScene")continue;let z=x.local;r.add(typeof z?.name=="string"?z.name:g)}}}if(u==="ImportExpression"&&Ke("dynamic import()"),u==="CallExpression"){let f=p.callee;f?.type==="Import"&&Ke("dynamic import()"),f?.type==="Identifier"&&f.name==="require"&&Ke("require()"),f?.type==="Identifier"&&typeof f.name=="string"&&of.has(f.name)&&Ke(`ambient ${f.name}`);let m=Qc(p.callee),x=Array.isArray(p.arguments)?p.arguments:[],g=x[0]?.type==="StringLiteral"?x[0].value:void 0;m==="document.createElement"&&(g==="video"||g==="audio")&&Ke(`raw ${g} element; use @cueframe/animate MediaTileScene`)}if(u==="JSXOpeningElement"){let f=p.name;f?.type==="JSXIdentifier"&&(f.name==="video"||f.name==="audio")&&Ke(`raw <${String(f.name)}> element; use @cueframe/animate MediaTileScene`)}if(u==="NewExpression"){let f=p.callee;f?.type==="Identifier"&&(f.name==="Date"||f.name==="Worker"||f.name==="SharedWorker")&&Ke(`ambient ${String(f.name)}`)}if(u==="MemberExpression"||u==="OptionalMemberExpression"){let f=Qc(p);f&&rf.has(f)&&Ke(`ambient ${f}`)}if(u==="VariableDeclarator"){let f=Qc(p.init),m=p.id;f&&["Math","Date","performance","crypto"].includes(f)&&m?.type==="Identifier"&&Ke(`ambient ${f} alias`),f==="Math"&&m?.type==="ObjectPattern"&&(Array.isArray(m.properties)?m.properties:[]).some(g=>{let z=g.key;return z?.name==="random"||z?.value==="random"})&&Ke("ambient Math.random alias")}if(u==="TSImportType"){let f=p.argument;f?.type==="StringLiteral"&&typeof f.value=="string"&&!nf.has(f.value)&&Ke(f.value)}for(let f of df(p))s(f)};if(s(t),r.size!==0&&(Jc(t,r),e!==void 0&&e!=="webgl2"))throw new Ot("component_graphics_mismatch","MediaTileScene requires manifest.graphics.api to be webgl2.")}var qt=d.string().min(1),uf=d.enum(["image","video","audio","data"]),ade=d.object({version:d.literal(1),project:d.object({version:d.literal(4),id:qt,name:qt,createdAt:d.number().finite(),modifiedAt:d.number().finite(),composition:Qa,pool:d.array(d.object({id:qt,kind:uf}).passthrough()),authoredComponents:d.never().optional(),recipe:d.object({schemaVersion:d.literal(1),slug:d.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),mediaSlots:d.array(d.object({id:qt,projectMediaId:qt,kind:uf}).passthrough()).length(1),cloudBrandKit:lc,components:d.array(d.object({componentId:qt,name:qt,category:d.enum(["effects","transitions","text","layouts"]),propSchema:d.record(d.string(),d.unknown()).optional(),sourceVersionId:d.never().optional()}).strict())}).passthrough()}).passthrough(),components:d.array(Rr)}).strict();function Zc(o,e,t){let r=new Map;for(let s of o){let a=e(s);if(r.has(a))throw new Error(`Duplicate ${t}: ${a}`);r.set(a,s)}return r}function mf(o){let e=ade.parse(o),t=Mm(e.project.composition);if(t.length)throw new Error(t.map(w=>`${w.code}: ${w.message}`).join(`
68
+ `));let s=structuredClone(o).project,a=Zc(e.components,w=>w.componentId,"component source"),p=Zc(s.recipe.components,w=>w.componentId,"recipe component"),u=Zc(s.pool,w=>w.id,"pool media id");for(let w of s.recipe.mediaSlots)if(u.get(w.projectMediaId)?.kind!==w.kind)throw new Error(`Media slot ${w.id} must match a pool entry of kind ${w.kind}.`);let f=new Map;for(let[w,k]of a){if(!p.has(w))throw new Error(`Missing recipe metadata for component ${w}.`);if(Buffer.byteLength(k.tsxSource,"utf8")>5e5)throw new Error(`Component ${w} exceeds the recipe loader's 500000-byte source limit.`);lf(k.tsxSource,k.manifest.graphics.api),f.set(w,Ch(k))}for(let w of p.keys())if(!a.has(w))throw new Error(`Missing source for component ${w}.`);for(let w of s.composition.tracks)for(let k of w.contents){if(!("source"in k))continue;let F=k.source;if(F.kind==="media"&&!u.has(F.mediaId))throw new Error(`Missing pool media ${F.mediaId}.`);if(F.kind!=="component")continue;let Y=a.get(F.componentId);if(!Y)throw new Error(`Missing source for placed component ${F.componentId}.`);if(Object.hasOwn(F.props,"componentRef"))throw new Error(`Remove componentRef from ${k.id}; recipe pack owns source pinning.`);let W=F.assets??{};for(let[ee,de]of Object.entries(Y.manifest.assets))if(de.required&&!W[ee])throw new Error(`Missing required asset ${F.componentId}.${ee}.`);for(let[ee,de]of Object.entries(W)){let Te=Y.manifest.assets[ee];if(!Te||u.get(de)?.kind!==Te.kind)throw new Error(`Invalid asset binding ${F.componentId}.${ee}: ${de}.`)}k.source={...F,props:{...F.props,componentRef:{version:1,sourceVersionId:f.get(F.componentId)}}}}let m=Object.fromEntries([...a].map(([w,k])=>{let F=f.get(w);return[w,{headVersionId:F,versions:{[F]:k}}]})),x=s.recipe.mediaSlots[0].projectMediaId;Xt(s.composition,x,x);let{recipe:g,...z}=s;return{...z,authoredComponents:m,recipe:{...g,components:g.components.map(({propSchema:w,...k})=>({...k,sourceVersionId:f.get(k.componentId),...w===void 0?{}:{propSchema:w}}))}}}async function xf(o){try{let e;if(o.body==="@-"){let p=[];for await(let u of process.stdin)p.push(Buffer.from(u));e=Buffer.concat(p).toString("utf8")}else e=o.body.startsWith("@")?await hf(ff(o.body.slice(1)),"utf8"):o.body;let t=mf(JSON.parse(e)),r=ff(o.out),s=JSON.stringify(t,null,2)+`
69
+ `;if(o.check){if(await hf(r,"utf8")!==s)throw new Error(`Stale generated file: ${r}`)}else if(!o.dryRun){let p=`${r}.${lde()}.tmp`;try{await cde(p,s,{flag:"wx"}),await pde(p,r)}finally{await dde(p).catch(u=>{if(u.code!=="ENOENT")throw u})}}let a={output:r,check:!!o.check,dryRun:!!o.dryRun,sourceVersions:Object.fromEntries(Object.entries(t.authoredComponents).map(([p,u])=>[p,u.headVersionId]))};return V(o,"recipe_pack_complete",a),o.json||console.log(`${o.check?"Checked":o.dryRun?"Validated":"Packed"} ${r}`),a}catch(e){K(o,"recipe_pack",e,B.UserError),N(B.UserError)}}import ude from"open";import{createAuthClient as mde}from"better-auth/client";import{deviceAuthorizationClient as hde}from"better-auth/client/plugins";async function gf(o){let e=Qt(o.target),t=mde({baseURL:e,fetchOptions:{headers:yr()},plugins:[hde()]}),r=Ce("Requesting device code\u2026",o.json),s;try{let{data:m,error:x}=await t.device.code({client_id:"cueframe-cli",scope:"openid profile email"});(x||!m)&&(r.fail(`Could not start login: ${x?.message??"unknown error"}`),N(B.NetworkError)),s=m}catch(m){r.fail(`Could not start login: ${m instanceof Error?m.message:String(m)}`),N(B.NetworkError)}r.succeed("Device code issued");let a=s.verification_uri_complete??s.verification_uri;Je("",o),Je(` Visit: ${a}`,o),Je(` Code: ${s.user_code}`,o),Je("",o);try{await ude(a)}catch{}let p=Ce("Waiting for approval in browser\u2026",o.json),u=Date.now()+s.expires_in*1e3,f=s.interval*1e3;for(;Date.now()<u;){await new Promise(m=>setTimeout(m,f));try{let{data:m,error:x}=await t.device.token({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:s.device_code,client_id:"cueframe-cli"});if(m?.access_token){let w=m.access_token;br(w,o.target,o.url),p.succeed(`Logged in. Token saved for target "${o.target}".`),se(o,{ok:!0,target:o.target,apiUrl:e},()=>{});return}let g=m??x,z=g?.error;z==="authorization_pending"||(z==="slow_down"?f+=5e3:z==="access_denied"?(p.fail("Access denied in the browser."),N(B.UserError)):z==="expired_token"?(p.fail("Device code expired before approval. Run `cueframe login` again."),N(B.UserError)):z&&(p.fail(`Login failed: ${g?.error_description??z}`),N(B.ApiClientError)))}catch{}}p.fail("Timed out waiting for approval. Run `cueframe login` again."),N(B.UserError)}import{readFileSync as fde}from"fs";var bf=new Set(["GET","POST","PUT","PATCH","DELETE"]);async function Sf(o,e,t){let r=o.toUpperCase();bf.has(r)||(K(t,"api",new Error(`Unsupported method: ${o}. Allowed: ${[...bf].join(", ")}.`),B.UserError),N(B.UserError)),e.startsWith("/")||(K(t,"api",new Error(`Path must start with '/'. Got: ${e}`),B.UserError),N(B.UserError)),re(t.target);let s=gde(t.header??[]),a=await bde(t.body,r);a!==void 0&&!s.has("content-type")&&s.set("content-type","application/json");let p;try{p=await qe(e,{method:r,headers:s,body:a})}catch(f){K(t,"api",f,q(f)),N(q(f))}xde(p,{include:!!t.include,json:!!t.json,method:r,path:e});let u=Oe(p.status);u!==B.Success&&K(t,"api",Object.assign(new Error(`${r} ${e} \u2192 ${p.status} ${p.statusText}`),{code:p.body?.error?.code,status:p.status}),u),process.exitCode=u}function xde(o,{include:e,json:t,method:r,path:s}){if(t){console.log(JSON.stringify({status:o.status,statusText:o.statusText,headers:o.headers,body:o.body}));return}if(e){process.stdout.write(`HTTP/1.1 ${o.status} ${o.statusText}
70
+ `);for(let[a,p]of Object.entries(o.headers))process.stdout.write(`${a}: ${p}
66
71
  `);process.stdout.write(`
67
- `),Ba(n.body,n.status>=400);return}if(n.status===204||n.body===null){console.error(`${o} ${r} \u2192 ${n.status} (no content)`);return}Ba(n.body,n.status>=400)}function Ba(n,t){let e=t?process.stderr:process.stdout;n!=null&&(typeof n=="string"?e.write(n.endsWith(`
68
- `)?n:n+`
69
- `):e.write(JSON.stringify(n,null,2)+`
70
- `))}function _G(n){let t=new Headers;for(let e of n){let o=e.indexOf(":");o===-1&&(console.error(`Invalid --header (expected "Name: value"): ${e}`),I(O.UserError));let r=e.slice(0,o).trim(),c=e.slice(o+1).trim();t.set(r,c)}return t}async function qG(n,t){if(n){if(n.startsWith("@")){let e=n.slice(1);return e==="-"?_a():$G(e,"utf-8")}return n}if(!(t==="GET"||t==="DELETE")&&!process.stdin.isTTY)return _a()}async function _a(){let n=[];for await(let t of process.stdin)n.push(Buffer.isBuffer(t)?t:Buffer.from(t));return Buffer.concat(n).toString("utf-8")}var Ua=/#\/components\/schemas\/([A-Za-z0-9_]+)/g;function UG(n,t){let e=new Set,o=[t];for(;o.length;){let r=o.pop();if(e.has(r)||!(r in n))continue;e.add(r);let c=JSON.stringify(n[r]),d;for(Ua.lastIndex=0;d=Ua.exec(c);)o.push(d[1])}return e}function WG(n){let t=n?.paths??{};for(let e of Object.values(t))if(e?.put?.operationId==="putComposition"){let o=e.put?.requestBody?.content?.["application/json"]?.schema?.$ref,r=typeof o=="string"?o.match(/#\/components\/schemas\/(.+)$/):null;if(r)return r[1]}return null}async function Wa(n,t){n!=="composition"&&(console.error(`Unknown schema '${n}'. Supported: composition.`),I(O.UserError)),ys({baseUrl:_e(t.target),headers:Pt()});let e;try{e=await ge("/v1/openapi.json",{method:"GET"})}catch(f){j(t,"schema",f,O.NetworkError),I(O.NetworkError)}if(e.status>=400){let f=ce(e.status);j(t,"schema",new Error(`Failed to fetch /v1/openapi.json (${e.status})`),f),I(f)}let o=e.body,r=o?.components?.schemas??{},c=WG(o);(!c||!(c in r))&&(j(t,"schema",new Error("Could not locate the composition schema in openapi.json (putComposition body ref not found)."),O.ApiServerError),I(O.ApiServerError));let d=UG(r,c);d.delete(c);let l={};for(let f of[...d].sort())l[f]=r[f];let m={name:c,schema:r[c],referenced:l};K(t,m,()=>{console.log(JSON.stringify(m,null,2))})}import{writeFileSync as GG}from"fs";import{resolve as HG}from"path";var Ga=1800*1e3,KG=5e3;async function Br(n,t){te(t.projectId,"projectId",t),te(t.suggestionId,"suggestionId",t),H(t.target),A(t,"export_prepare",{projectId:t.projectId,suggestionId:t.suggestionId,format:n,target:t.target});let e=ie(`Queuing ${n} export\u2026`,t.json),o;try{o=(await(n==="fcpxml"?Rt.createFcpxmlExport:Rt.createPremiereExport)(t.projectId,{clipSuggestionId:t.suggestionId})).id,e.succeed(`Export queued: ${o}`)}catch(m){e.fail(`Failed: ${Q(m)}`),se(t,"export_prepare",m,V(m)),I(V(m))}if(A(t,"export_queued",{exportId:o,projectId:t.projectId,format:n}),!t.wait){be(`Poll status with: cueframe api GET /v1/projects/${t.projectId}/exports/${o}`,t);return}let r=await JG(t.projectId,o,t);r.kind==="failed"&&(j(t,"export_progress",Object.assign(new Error(r.message),r.error?{details:r.error}:{}),O.ApiServerError),t.json||console.error(`Export failed: ${r.message}`),I(O.ApiServerError)),r.outputUrl||(j(t,"export_complete",new Error("Export reported complete but no outputUrl was returned."),O.ApiServerError),t.json||console.error(`Export reported complete but no outputUrl was returned.
71
- Export ID: ${o}
72
- Re-fetch via GET /v1/projects/${t.projectId}/exports/${o}.`),I(O.ApiServerError));let d=t.out??`./export-${o.slice(0,8)}.zip`,l=await XG(r.outputUrl,d,t.json);A(t,"export_complete",{exportId:o,projectId:t.projectId,format:n,outputUrl:r.outputUrl,outputExpiresAt:r.outputExpiresAt,outputSizeBytes:r.outputSizeBytes,trimCacheHit:r.trimCacheHit,outputPath:l})}async function JG(n,t,e){let o=Date.now()+(e.timeoutMs??Ga),r=e.pollIntervalMs??KG,c=Date.now(),d=ie("Exporting\u2026",e.json);try{for(;Date.now()<o;){let l;try{l=await Rt.getExport(n,t)}catch(g){if(g instanceof fe&&g.status>=500){await Ha(r);continue}throw d.fail(`Failed to poll: ${Q(g)}`),g}let m=Math.round((Date.now()-c)/1e3),f=Math.round((l.progress??0)*100);if(d.text=`Exporting\u2026 ${l.status}${f>0?` \xB7 ${f}%`:""} (${m}s)`,A(e,"export_progress",{exportId:t,status:l.status,progress:l.progress,elapsedSec:m}),l.status==="complete")return d.succeed(`Export complete (${m}s)`),{kind:"complete",outputUrl:l.outputUrl??null,outputExpiresAt:l.outputExpiresAt??null,outputSizeBytes:l.outputSizeBytes??null,trimCacheHit:l.trimCacheHit??null};if(l.status==="error"||l.status==="cancelled"){let g=l.error?.message??`Export ${l.status}`;return d.fail(g),{kind:"failed",message:g,error:l.error?{phase:l.error.phase,retryable:!!l.error.retryable}:null}}await Ha(r)}return d.fail(`Timed out waiting for export (${Math.round((Date.now()-c)/1e3)}s)`),{kind:"failed",message:`Timed out after ${Math.round((e.timeoutMs??Ga)/1e3)}s`,error:null}}catch(l){j(e,"export_progress",l,V(l)),I(V(l))}}async function XG(n,t,e){let o=HG(t),r=ie(`Downloading \u2192 ${o}\u2026`,e);try{let c=await fetch(n);if(!c.ok)throw new Error(`HTTP ${c.status}`);let d=Buffer.from(await c.arrayBuffer());return GG(o,d),r.succeed(`Saved: ${o} (${(d.length/1024/1024).toFixed(1)} MB)`),o}catch(c){r.fail(`Download failed: ${Q(c)}`),e||console.error(`
73
- Export URL (7-day TTL): ${n}`),I(O.NetworkError)}}function Ha(n){return new Promise(t=>setTimeout(t,n))}async function Ka(n){H(n.target),A(n,"sessions_list_prepare",{});try{let t=await it.listSessions();A(n,"sessions_list_complete",{count:t.data.length}),K(n,t,()=>{if(t.data.length===0){console.log("No sessions yet. Create one with `cueframe sessions create --name <n> --files <mediaId:role> \u2026`");return}for(let e of t.data){let o=e.muxStatus??"pending";console.log(`${e.id} ${e.fileCount} files mux:${o} ${e.name}`)}t.pagination.hasMore&&console.log(`# more \u2014 pass --after ${t.pagination.nextCursor} (raw via \`cueframe api\`)`)})}catch(t){j(n,"sessions_list",t,V(t)),I(V(t))}}async function Ja(n,t){te(n,"sessionId",t),H(t.target),A(t,"sessions_get_prepare",{sessionId:n});try{let e=await it.getSession(n);A(t,"sessions_get_complete",{sessionId:n}),K(t,e,()=>{console.log(JSON.stringify(e,null,2))})}catch(e){j(t,"sessions_get",e,V(e)),I(V(e))}}async function Xa(n){n.name||(console.error("--name is required"),I(O.UserError)),(!n.files||n.files.length===0)&&(console.error("At least one --file <mediaId:role> is required"),I(O.UserError));let t=n.files.map((e,o)=>{let r=e.indexOf(":");return r===-1&&(console.error(`--file[${o}] must be <mediaId>:<role>. Got: ${e}`),I(O.UserError)),{mediaId:e.slice(0,r).trim(),role:e.slice(r+1).trim()}});H(n.target),A(n,"sessions_create_prepare",{name:n.name,fileCount:t.length});try{let e=await it.createSession({name:n.name,files:t});A(n,"sessions_create_complete",{sessionId:e.id}),K(n,e,()=>{console.log(`Session created: ${e.id}`),console.log(JSON.stringify(e,null,2))})}catch(e){j(n,"sessions_create",e,V(e)),I(V(e))}}async function Za(n,t){te(n,"sessionId",t),H(t.target),A(t,"sessions_delete_prepare",{sessionId:n});try{await it.deleteSession(n),A(t,"sessions_delete_complete",{sessionId:n}),K(t,{ok:!0,sessionId:n},()=>{console.log(`Session ${n} deleted.`)})}catch(e){j(t,"sessions_delete",e,V(e)),I(V(e))}}function Ya(n){let t=n.commands.map(Ya);return{name:n.name(),description:n.description(),arguments:n.registeredArguments.map(e=>({name:e.name(),required:e.required,description:e.description})),options:n.options.map(e=>({flags:e.flags,description:e.description,...e.defaultValue!==void 0?{default:e.defaultValue}:{}})),...t.length>0?{subcommands:t}:{}}}function Qa(n,t){let e=n.commands.map(Ya);if(t.json){A(t,"describe_complete",{name:n.name(),version:n.version()??null,commands:e});return}console.log(`${n.name()} ${n.version()??""}`.trim());for(let o of e){console.log(`
74
- ${o.name} \u2014 ${o.description}`);for(let r of o.subcommands??[])console.log(` ${o.name} ${r.name} \u2014 ${r.description}`)}}var ec=["prod","dev","local"];function pe(n){if(n===void 0)return"prod";if(ec.includes(n))return n;console.error(`Invalid --target ${n}. Allowed: ${ec.join(", ")}.`),I(O.UserError)}function tc(n){if(!n)return;let t=parseInt(n,10);if(t===24||t===25||t===30||t===60)return t;console.error(`Invalid --fps ${n}. Allowed: 24, 25, 30, 60.`),I(O.UserError)}async function oc(){let n=new ZG;n.name("cueframe").description("AI-assisted video editing and rendering").version("0.4.7").option("--json","Emit a structured JSON document on stdout instead of human-formatted output. Spinners are silenced.").option("--dry-run","Validate inputs and report what would happen \u2014 no API calls, no mutations. Applies to upload, analyze, project create, render.");let t=()=>n.opts();n.command("install").description('One-line setup: wire the CueFrame MCP server into every installed agent (Claude Code / Cursor / Codex) and install the agent skills. No API key \u2014 auth is a browser "Allow" on first call.').option("-t, --target <target>","Target environment: prod (default), dev, local").option("-f, --force","Replace locally changed or untracked skills, retaining backups").action(b=>Fs({json:t().json,target:pe(b.target),dryRun:t().dryRun,force:b.force})),n.command("init").description("Scaffold a CueFrame component workspace (cueframe.json + components dir) in the current repo, so `new component` has a home and the render harness can discover it.").action(()=>Ns({json:t().json,dryRun:t().dryRun})),n.command("new").description("Scaffold new owned source in the component workspace").command("component").description("Scaffold a blank custom component in cueframe/components/<name>").argument("<name>","Component id (e.g. my-badge)").option("-f, --force","Overwrite an existing non-empty component dir").action((b,C)=>Ys(b,{json:t().json,dryRun:t().dryRun,force:C.force})),n.command("push").description("Publish a locally-authored component (cueframe/components/<id>/index.tsx) to CueFrame so it renders server-side. Upserts by id.").argument("[id]","Component id to push (omit and use `cueframe sync` to push all)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((b,C)=>on(b,{target:pe(C.target),json:t().json})),n.command("sync").description("Publish EVERY component in the workspace (cueframe/components/*) to CueFrame. Upserts each by id.").option("-t, --target <target>","Target environment: prod (default), dev, local").action(b=>rn({target:pe(b.target),json:t().json}));let o=n.command("keys").description("Manage API keys. `keys create` mints a scoped key \u2014 run `cueframe login` first (keys cannot mint keys).");o.command("create").description("Mint a scoped API key (cf_*). Requires a logged-in session.").requiredOption("-n, --name <name>","Key name, e.g. ci-runner").option("-s, --scope <scope>","Comma-separated resource:actions, e.g. media:rw,projects:rw,renders:rw (resources: media,sessions,projects,renders,webhooks; actions r/w)").option("--preset <preset>","Scope preset instead of --scope: readonly (read all) | editall (read+write all)").option("--expires <days>","Expire after N days (default: never)").option("-t, --target <target>","Target environment: prod (default), dev, local").action(b=>nn({...b,target:pe(b.target),json:t().json})),o.command("list").description("List your API keys.").option("-t, --target <target>","Target environment: prod (default), dev, local").action(b=>an({target:pe(b.target),json:t().json})),o.command("revoke").description("Revoke an API key by id.").argument("<keyId>","Key id (from `cueframe keys list`)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((b,C)=>cn(b,{target:pe(C.target),json:t().json})),n.command("login").description("Browser-mediated sign-in (OAuth device flow). Recommended for laptops.").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--url <url>","Override the API base URL (advanced)").action(b=>Na({...b,target:pe(b.target),json:t().json})),n.command("auth").description("Save a static API key (cf_live_\u2026 / cf_test_\u2026). Use for CI / headless environments.").argument("<api-key>","Your CueFrame API key").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--url <url>","Override the API base URL (advanced)").action((b,C)=>{let T=pe(C.target);Ts(b),vt(b,T,C.url),t().json?console.log(JSON.stringify({ok:!0,target:T},null,2)):console.log(`API key saved for target "${T}"`)}),n.command("list").description("List projects").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-n, --limit <n>","Max projects to show","10").action(b=>pn({target:pe(b.target),limit:parseInt(b.limit),json:t().json}));let r=n.command("project").description("Project commands");r.command("create").description("Create a new project. With --from-suggestion, atomically build the composition from a clip suggestion in one round-trip \u2014 the project is then immediately renderable via `cueframe render <projectId>`.").requiredOption("-n, --name <name>","Project name").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-a, --aspect <ratio>","Aspect ratio: 9:16, 1:1, 16:9","9:16").option("--fps <n>","Frame rate","30").option("--resolution <r>","Resolution: hd, fhd, 2k, 4k","fhd").option("--brand-kit <id>","Bind a brand kit id to the project").option("--from-suggestion <sug>","Clip suggestion publicId (sug_\u2026) \u2014 atomically builds the composition after project creation so render needs no further args").option("--cheap","With --from-suggestion: use the deterministic translator (no LLM, ~100ms) instead of the AI authoring pass. Useful for tests / programmatic flows.").action(async b=>{await Gt({name:b.name,target:pe(b.target),aspect:b.aspect,fps:tc(b.fps),resolution:b.resolution,brandKitId:b.brandKit,fromSuggestion:b.fromSuggestion,cheap:b.cheap,json:t().json,dryRun:t().dryRun})}),r.command("delete").description("Permanently delete a project (irreversible cleanup \u2014 removes the composition and render history).").argument("<projectId>","Project ID (from `cueframe list` or `project create`)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((b,C)=>yn(b,{target:pe(C.target),json:t().json})),n.command("media").description("Media library cleanup commands").command("delete").description("Permanently delete a media item (irreversible cleanup \u2014 removes the source and its derived assets).").argument("<mediaId>","Media item ID (from `cueframe clips`)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((b,C)=>bn(b,{target:pe(C.target),json:t().json})),n.command("upload").description("Upload a video file and process it").argument("<file>","Path to video file").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-a, --analyze","Run clip analysis after processing completes").option("-r, --audio-role <role>","Declare the audio role (vo|music|sfx|ambience) \u2014 routes ingest enrichment: vo\u2192transcript, music\u2192beat grid, sfx/ambience\u2192envelope").action(async(b,C)=>{await _t(b,{target:pe(C.target),analyze:C.analyze,audioRole:C.audioRole,json:t().json,dryRun:t().dryRun})}),n.command("analyze").description("Trigger AI clip suggestion analysis for a media item").argument("<mediaItemId>","Media item ID (from `cueframe clips`)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-w, --wait","Wait for analysis to complete and show results").action((b,C)=>Rs(b,{target:pe(C.target),wait:C.wait,json:t().json,dryRun:t().dryRun})),n.command("clips").description("List AI-generated clip suggestions for a media item").argument("[mediaItemId]","Media item ID (omit to list your media library)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((b,C)=>hn(b,{target:pe(C.target),json:t().json}));let d=n.command("recipe").description("Package or run a portable CueFrame recipe");d.command("pack").description("Validate, pin authored source, and package a recipe offline. No login, upload, compilation, or rendering.").requiredOption("-b, --body <json|@file|@->","Version-1 packaging input: project draft and bundled component sources; @- reads stdin").requiredOption("-o, --out <path>","Generated .cueframe project path (replaced on success)").option("--check","Check that the output is current without writing it").action(async b=>{await Va({...b,json:t().json,dryRun:t().dryRun})}),d.command("run").description("Upload the source, create the recipe project, validate it, and render it").argument("[recipe]","Recipe slug from cueframe-ai/cueframe-recipes, local .cueframe template, or legacy directory",".").requiredOption("-m, --media <path>","Source media file for the recipe").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-o, --out <path>","Output MP4 path","./recipe-output.mp4").option("--no-render","Create the editable project without rendering it").action(async(b,C)=>{await Mn({directory:b,media:C.media,out:C.out,target:pe(C.target),render:C.render!==!1,json:t().json,dryRun:t().dryRun})});let l=n.command("render").description("Render a project to MP4 (queues, watches via SSE, downloads). Renders whatever composition is saved on the project \u2014 build it first via `project create --from-suggestion` or `composition from-suggestion`.").allowExcessArguments(!1).argument("<projectId>","Project ID (from `cueframe list` or `project create`)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-a, --aspect <ratio>","Aspect ratio: 9:16, 1:1, 16:9 (defaults to project format)").option("--fps <n>","Frame rate","30").option("--resolution <r>","Resolution: hd, fhd, 2k, 4k","fhd").option("-o, --out <path>","Output file path (default: ./reel-<id>.mp4)").option("--idempotency-key <key>",'Override the auto-derived Idempotency-Key. Default: sha256("render:<projectId>:<currentCompositionETag>"). Pass a fresh UUID to force a new render row.').option("--priority <p>","Routing intent: interactive (low-latency, access-gated), standard (default), background (lowest queue weight).").option("--intent <i>","Encode-quality hint: preview (fast / low-bitrate, for editor scrubbing) or final (default, full Format).").action(async(b,C)=>{await Ht(b,{target:C.target,aspect:C.aspect,fps:tc(C.fps),resolution:C.resolution,out:C.out,json:t().json,dryRun:t().dryRun,...C.idempotencyKey?{idempotencyKey:C.idempotencyKey}:{},...C.priority?{priority:C.priority}:{},...C.intent?{intent:C.intent}:{}})});n.command("api").description("Raw API call against the v1 surface (escape hatch \u2014 like `gh api`).").argument("<method>","HTTP method: GET, POST, PUT, PATCH, DELETE").argument("<path>","API path starting with /v1, e.g. /v1/projects").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-b, --body <body>","Request body (inline JSON, @file.json to read from disk, @- for stdin)").option("-H, --header <header...>",'Additional header (repeatable), e.g. -H "If-Match: \\"abc\\""').option("-i, --include","Include response status line + headers in stdout (curl-style). Lets agents read ETag etc.").action((b,C,T)=>qa(b,C,{target:T.target,body:T.body,header:T.header,include:T.include,json:t().json})),n.command("schema").description("Print the live composition wire schema from the server (/v1/openapi.json) \u2014 discover the contract instead of guessing.").argument("[resource]","Schema to print (currently: composition)","composition").option("-t, --target <target>","Target environment: prod (default), dev, local").action((b,C)=>Wa(b,{target:C.target,json:t().json}));let m=n.command("composition").description("Read/write a project's composition. ETag is threaded automatically.");m.command("validate").description("Validate a composition body against the live schema WITHOUT saving or rendering. Returns per-field errors \u2014 author safely before paying for a render.").requiredOption("-b, --body <body>","Composition JSON (inline, @file.json, or @- for stdin)").option("-t, --target <target>","Target environment: prod (default), dev, local").action(async b=>{await Wt({target:b.target,body:b.body,json:t().json})}),m.command("get").description("Fetch the project's composition and ETag").argument("<projectId>","Project ID").option("-t, --target <target>","Target environment: prod (default), dev, local").action((b,C)=>fn(b,{target:C.target,json:t().json})),m.command("put").description("Replace the composition. GETs ETag first for safe concurrent writes.").argument("<projectId>","Project ID").option("-t, --target <target>","Target environment: prod (default), dev, local").requiredOption("-b, --body <body>","Composition JSON (inline, @file.json, or @- for stdin)").option("--if-match <etag>","Use this ETag (skip the GET round-trip)").option("--force","Use If-Match: * (unconditional overwrite \u2014 may clobber concurrent edits)").action(async(b,C)=>{await qt(b,{target:C.target,body:C.body,ifMatch:C.ifMatch,force:C.force,json:t().json})}),m.command("from-suggestion").description("Build the composition from an existing clip suggestion").argument("<projectId>","Project ID").requiredOption("-s, --suggestion <suggestionId>","Clip suggestion publicId (sug_\u2026)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--format <json>",`Optional format override, e.g. '{"aspectRatio":"9:16","fps":30,"resolution":"fhd"}'`).option("--if-match <etag>","Use this ETag (skip the GET round-trip)").option("--force","Use If-Match: * (unconditional overwrite)").action((b,C)=>Ut(b,{target:C.target,suggestionId:C.suggestion,format:C.format,ifMatch:C.ifMatch,force:C.force,json:t().json})),l.command("watch").description("Reattach to an existing render and stream progress to terminal state").argument("<renderId>","Render ID (from `cueframe render` output)").requiredOption("-p, --project <projectId>","Project the render belongs to").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--no-download","Print the MP4 URL but skip downloading the file").option("-o, --out <path>","Output file path when downloading (default: ./reel-<id>.mp4)").action((b,C,T)=>{let E=T?.parent?.opts?.()?.target??C.target;return zn(b,{target:E,project:C.project,out:C.out,download:C.download!==!1,json:t().json})});let f=n.command("export").description("Hand the timeline off to a real NLE (Final Cut Pro / Premiere Pro)");f.command("fcpxml").description("Build a Final Cut Pro export zip and (optionally) wait to download it").argument("<projectId>","Project ID").requiredOption("-s, --suggestion <suggestionId>","Clip suggestion publicId (sug_\u2026)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-o, --out <path>","Output zip path (default: ./export-<id>.zip)").option("--wait","Block until the export finishes, then download the artifact").action((b,C)=>Br("fcpxml",{target:C.target,projectId:b,suggestionId:C.suggestion,out:C.out,wait:C.wait,json:t().json})),f.command("premiere").description("Build a Premiere Pro export zip and (optionally) wait to download it").argument("<projectId>","Project ID").requiredOption("-s, --suggestion <suggestionId>","Clip suggestion publicId (sug_\u2026)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-o, --out <path>","Output zip path (default: ./export-<id>.zip)").option("--wait","Block until the export finishes, then download the artifact").action((b,C)=>Br("premiere",{target:C.target,projectId:b,suggestionId:C.suggestion,out:C.out,wait:C.wait,json:t().json}));let g=n.command("sessions").description("Multi-file ingest sessions (camera A/B/screen \u2192 muxed composition)");g.command("list").description("List sessions in this org").option("-t, --target <target>","Target environment: prod (default), dev, local").action(b=>Ka({target:b.target,json:t().json})),g.command("get").description("Get a single session by ID").argument("<sessionId>","Session ID").option("-t, --target <target>","Target environment: prod (default), dev, local").action((b,C)=>Ja(b,{target:C.target,json:t().json})),g.command("create").description("Create a session from one or more media files").requiredOption("-n, --name <name>","Session name").requiredOption("-f, --file <entry...>","Each entry is <mediaId>:<role> (repeatable)").option("-t, --target <target>","Target environment: prod (default), dev, local").action(b=>Xa({target:b.target,name:b.name,files:b.file,json:t().json})),g.command("delete").description("Delete a session (server checks for compositions referencing it)").argument("<sessionId>","Session ID").option("-t, --target <target>","Target environment: prod (default), dev, local").action((b,C)=>Za(b,{target:C.target,json:t().json})),n.command("describe").description("Print the CLI command tree as structured JSON (agent introspection)").action(()=>Qa(n,{json:t().json}));try{await n.parseAsync()}catch(b){let C=V(b);j(t(),"cli",Object.assign(new Error(Q(b)),{code:b?.code,status:b?.status}),C),I(C)}}await oc();
72
+ `),yf(o.body,o.status>=400);return}if(o.status===204||o.body===null){console.error(`${r} ${s} \u2192 ${o.status} (no content)`);return}yf(o.body,o.status>=400)}function yf(o,e){let t=e?process.stderr:process.stdout;o!=null&&(typeof o=="string"?t.write(o.endsWith(`
73
+ `)?o:o+`
74
+ `):t.write(JSON.stringify(o,null,2)+`
75
+ `))}function gde(o){let e=new Headers;for(let t of o){let r=t.indexOf(":");r===-1&&(console.error(`Invalid --header (expected "Name: value"): ${t}`),N(B.UserError));let s=t.slice(0,r).trim(),a=t.slice(r+1).trim();e.set(s,a)}return e}async function bde(o,e){if(o){if(o.startsWith("@")){let t=o.slice(1);return t==="-"?Af():fde(t,"utf-8")}return o}if(!(e==="GET"||e==="DELETE")&&!process.stdin.isTTY)return Af()}async function Af(){let o=[];for await(let e of process.stdin)o.push(Buffer.isBuffer(e)?e:Buffer.from(e));return Buffer.concat(o).toString("utf-8")}var zf=/#\/components\/schemas\/([A-Za-z0-9_]+)/g;function yde(o,e){let t=new Set,r=[e];for(;r.length;){let s=r.pop();if(t.has(s)||!(s in o))continue;t.add(s);let a=JSON.stringify(o[s]),p;for(zf.lastIndex=0;p=zf.exec(a);)r.push(p[1])}return t}function Ade(o){let e=o?.paths??{};for(let t of Object.values(e))if(t?.put?.operationId==="putComposition"){let r=t.put?.requestBody?.content?.["application/json"]?.schema?.$ref,s=typeof r=="string"?r.match(/#\/components\/schemas\/(.+)$/):null;if(s)return s[1]}return null}async function Tf(o,e){o!=="composition"&&(console.error(`Unknown schema '${o}'. Supported: composition.`),N(B.UserError)),Op({baseUrl:Qt(e.target),headers:yr()});let t;try{t=await qe("/v1/openapi.json",{method:"GET"})}catch(m){K(e,"schema",m,B.NetworkError),N(B.NetworkError)}if(t.status>=400){let m=Oe(t.status);K(e,"schema",new Error(`Failed to fetch /v1/openapi.json (${t.status})`),m),N(m)}let r=t.body,s=r?.components?.schemas??{},a=Ade(r);(!a||!(a in s))&&(K(e,"schema",new Error("Could not locate the composition schema in openapi.json (putComposition body ref not found)."),B.ApiServerError),N(B.ApiServerError));let p=yde(s,a);p.delete(a);let u={};for(let m of[...p].sort())u[m]=s[m];let f={name:a,schema:s[a],referenced:u};se(e,f,()=>{console.log(JSON.stringify(f,null,2))})}import{writeFileSync as Sde}from"fs";import{resolve as zde}from"path";var Ef=1800*1e3,Tde=5e3;async function Xc(o,e){ge(e.projectId,"projectId",e),ge(e.suggestionId,"suggestionId",e),re(e.target),V(e,"export_prepare",{projectId:e.projectId,suggestionId:e.suggestionId,format:o,target:e.target});let t=Ce(`Queuing ${o} export\u2026`,e.json),r;try{r=(await(o==="fcpxml"?gr.createFcpxmlExport:gr.createPremiereExport)(e.projectId,{clipSuggestionId:e.suggestionId})).id,t.succeed(`Export queued: ${r}`)}catch(f){t.fail(`Failed: ${ue(f)}`),Ee(e,"export_prepare",f,q(f)),N(q(f))}if(V(e,"export_queued",{exportId:r,projectId:e.projectId,format:o}),!e.wait){Je(`Poll status with: cueframe api GET /v1/projects/${e.projectId}/exports/${r}`,e);return}let s=await Ede(e.projectId,r,e);s.kind==="failed"&&(K(e,"export_progress",Object.assign(new Error(s.message),s.error?{details:s.error}:{}),B.ApiServerError),e.json||console.error(`Export failed: ${s.message}`),N(B.ApiServerError)),s.outputUrl||(K(e,"export_complete",new Error("Export reported complete but no outputUrl was returned."),B.ApiServerError),e.json||console.error(`Export reported complete but no outputUrl was returned.
76
+ Export ID: ${r}
77
+ Re-fetch via GET /v1/projects/${e.projectId}/exports/${r}.`),N(B.ApiServerError));let p=e.out??`./export-${r.slice(0,8)}.zip`,u=await Cde(s.outputUrl,p,e.json);V(e,"export_complete",{exportId:r,projectId:e.projectId,format:o,outputUrl:s.outputUrl,outputExpiresAt:s.outputExpiresAt,outputSizeBytes:s.outputSizeBytes,trimCacheHit:s.trimCacheHit,outputPath:u})}async function Ede(o,e,t){let r=Date.now()+(t.timeoutMs??Ef),s=t.pollIntervalMs??Tde,a=Date.now(),p=Ce("Exporting\u2026",t.json);try{for(;Date.now()<r;){let u;try{u=await gr.getExport(o,e)}catch(x){if(x instanceof Ve&&x.status>=500){await Cf(s);continue}throw p.fail(`Failed to poll: ${ue(x)}`),x}let f=Math.round((Date.now()-a)/1e3),m=Math.round((u.progress??0)*100);if(p.text=`Exporting\u2026 ${u.status}${m>0?` \xB7 ${m}%`:""} (${f}s)`,V(t,"export_progress",{exportId:e,status:u.status,progress:u.progress,elapsedSec:f}),u.status==="complete")return p.succeed(`Export complete (${f}s)`),{kind:"complete",outputUrl:u.outputUrl??null,outputExpiresAt:u.outputExpiresAt??null,outputSizeBytes:u.outputSizeBytes??null,trimCacheHit:u.trimCacheHit??null};if(u.status==="error"||u.status==="cancelled"){let x=u.error?.message??`Export ${u.status}`;return p.fail(x),{kind:"failed",message:x,error:u.error?{phase:u.error.phase,retryable:!!u.error.retryable}:null}}await Cf(s)}return p.fail(`Timed out waiting for export (${Math.round((Date.now()-a)/1e3)}s)`),{kind:"failed",message:`Timed out after ${Math.round((t.timeoutMs??Ef)/1e3)}s`,error:null}}catch(u){K(t,"export_progress",u,q(u)),N(q(u))}}async function Cde(o,e,t){let r=zde(e),s=Ce(`Downloading \u2192 ${r}\u2026`,t);try{let a=await fetch(o);if(!a.ok)throw new Error(`HTTP ${a.status}`);let p=Buffer.from(await a.arrayBuffer());return Sde(r,p),s.succeed(`Saved: ${r} (${(p.length/1024/1024).toFixed(1)} MB)`),r}catch(a){s.fail(`Download failed: ${ue(a)}`),t||console.error(`
78
+ Export URL (7-day TTL): ${o}`),N(B.NetworkError)}}function Cf(o){return new Promise(e=>setTimeout(e,o))}async function If(o){re(o.target),V(o,"sessions_list_prepare",{});try{let e=await Co.listSessions();V(o,"sessions_list_complete",{count:e.data.length}),se(o,e,()=>{if(e.data.length===0){console.log("No sessions yet. Create one with `cueframe sessions create --name <n> --files <mediaId:role> \u2026`");return}for(let t of e.data){let r=t.muxStatus??"pending";console.log(`${t.id} ${t.fileCount} files mux:${r} ${t.name}`)}e.pagination.hasMore&&console.log(`# more \u2014 pass --after ${e.pagination.nextCursor} (raw via \`cueframe api\`)`)})}catch(e){K(o,"sessions_list",e,q(e)),N(q(e))}}async function Rf(o,e){ge(o,"sessionId",e),re(e.target),V(e,"sessions_get_prepare",{sessionId:o});try{let t=await Co.getSession(o);V(e,"sessions_get_complete",{sessionId:o}),se(e,t,()=>{console.log(JSON.stringify(t,null,2))})}catch(t){K(e,"sessions_get",t,q(t)),N(q(t))}}async function wf(o){o.name||(console.error("--name is required"),N(B.UserError)),(!o.files||o.files.length===0)&&(console.error("At least one --file <mediaId:role> is required"),N(B.UserError));let e=o.files.map((t,r)=>{let s=t.indexOf(":");return s===-1&&(console.error(`--file[${r}] must be <mediaId>:<role>. Got: ${t}`),N(B.UserError)),{mediaId:t.slice(0,s).trim(),role:t.slice(s+1).trim()}});re(o.target),V(o,"sessions_create_prepare",{name:o.name,fileCount:e.length});try{let t=await Co.createSession({name:o.name,files:e});V(o,"sessions_create_complete",{sessionId:t.id}),se(o,t,()=>{console.log(`Session created: ${t.id}`),console.log(JSON.stringify(t,null,2))})}catch(t){K(o,"sessions_create",t,q(t)),N(q(t))}}async function Of(o,e){ge(o,"sessionId",e),re(e.target),V(e,"sessions_delete_prepare",{sessionId:o});try{await Co.deleteSession(o),V(e,"sessions_delete_complete",{sessionId:o}),se(e,{ok:!0,sessionId:o},()=>{console.log(`Session ${o} deleted.`)})}catch(t){K(e,"sessions_delete",t,q(t)),N(q(t))}}function Mf(o){let e=o.commands.map(Mf);return{name:o.name(),description:o.description(),arguments:o.registeredArguments.map(t=>({name:t.name(),required:t.required,description:t.description})),options:o.options.map(t=>({flags:t.flags,description:t.description,...t.defaultValue!==void 0?{default:t.defaultValue}:{}})),...e.length>0?{subcommands:e}:{}}}function kf(o,e){let t=o.commands.map(Mf);if(e.json){V(e,"describe_complete",{name:o.name(),version:o.version()??null,commands:t});return}console.log(`${o.name()} ${o.version()??""}`.trim());for(let r of t){console.log(`
79
+ ${r.name} \u2014 ${r.description}`);for(let s of r.subcommands??[])console.log(` ${r.name} ${s.name} \u2014 ${s.description}`)}}var Pf=["prod","dev","local"];function De(o){if(o===void 0)return"prod";if(Pf.includes(o))return o;console.error(`Invalid --target ${o}. Allowed: ${Pf.join(", ")}.`),N(B.UserError)}function Lf(o){if(!o)return;let e=parseInt(o,10);if(e===24||e===25||e===30||e===60)return e;console.error(`Invalid --fps ${o}. Allowed: 24, 25, 30, 60.`),N(B.UserError)}async function Df(){let o=new Ide;o.name("cueframe").description("AI-assisted video editing and rendering").version("0.4.8").option("--json","Emit a structured JSON document on stdout instead of human-formatted output. Spinners are silenced.").option("--dry-run","Validate inputs and report what would happen \u2014 no API calls, no mutations. Applies to upload, analyze, project create, render.");let e=()=>o.opts();o.command("install").description('One-line setup: wire the CueFrame MCP server into every installed agent (Claude Code / Cursor / Codex) and install the agent skills. No API key \u2014 auth is a browser "Allow" on first call.').option("-t, --target <target>","Target environment: prod (default), dev, local").option("-f, --force","Replace locally changed or untracked skills, retaining backups").action(g=>Kp({json:e().json,target:De(g.target),dryRun:e().dryRun,force:g.force})),o.command("init").description("Scaffold a CueFrame component workspace (cueframe.json + components dir) in the current repo, so `new component` has a home and the render harness can discover it.").action(()=>Qp({json:e().json,dryRun:e().dryRun})),o.command("new").description("Scaffold new owned source in the component workspace").command("component").description("Scaffold a blank custom component in cueframe/components/<name>").argument("<name>","Component id (e.g. my-badge)").option("-f, --force","Overwrite an existing non-empty component dir").action((g,z)=>pd(g,{json:e().json,dryRun:e().dryRun,force:z.force})),o.command("push").description("Publish a locally-authored component (cueframe/components/<id>/index.tsx) to CueFrame so it renders server-side. Upserts by id.").argument("[id]","Component id to push (omit and use `cueframe sync` to push all)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>md(g,{target:De(z.target),json:e().json})),o.command("sync").description("Publish EVERY component in the workspace (cueframe/components/*) to CueFrame. Upserts each by id.").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>hd({target:De(g.target),json:e().json}));let r=o.command("keys").description("Manage API keys. `keys create` mints a scoped key \u2014 run `cueframe login` first (keys cannot mint keys).");r.command("create").description("Mint a scoped API key (cf_*). Requires a logged-in session.").requiredOption("-n, --name <name>","Key name, e.g. ci-runner").option("-s, --scope <scope>","Comma-separated resource:actions, e.g. media:rw,projects:rw,renders:rw (resources: media,sessions,projects,renders,webhooks; actions r/w)").option("--preset <preset>","Scope preset instead of --scope: readonly (read all) | editall (read+write all)").option("--expires <days>","Expire after N days (default: never)").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>xd({...g,target:De(g.target),json:e().json})),r.command("list").description("List your API keys.").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>gd({target:De(g.target),json:e().json})),r.command("revoke").description("Revoke an API key by id.").argument("<keyId>","Key id (from `cueframe keys list`)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>bd(g,{target:De(z.target),json:e().json})),o.command("login").description("Browser-mediated sign-in (OAuth device flow). Recommended for laptops.").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--url <url>","Override the API base URL (advanced)").action(g=>gf({...g,target:De(g.target),json:e().json})),o.command("auth").description("Save a static API key (cf_live_\u2026 / cf_test_\u2026). Use for CI / headless environments.").argument("<api-key>","Your CueFrame API key").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--url <url>","Override the API base URL (advanced)").action((g,z)=>{let w=De(z.target);Fp(g),br(g,w,z.url),e().json?console.log(JSON.stringify({ok:!0,target:w},null,2)):console.log(`API key saved for target "${w}"`)}),o.command("list").description("List projects").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-n, --limit <n>","Max projects to show","10").action(g=>yd({target:De(g.target),limit:parseInt(g.limit),json:e().json}));let s=o.command("project").description("Project commands");s.command("create").description("Create a new project. With --from-suggestion, atomically build the composition from a clip suggestion in one round-trip \u2014 the project is then immediately renderable via `cueframe render <projectId>`.").requiredOption("-n, --name <name>","Project name").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-a, --aspect <ratio>","Aspect ratio: 9:16, 1:1, 16:9","9:16").option("--fps <n>","Frame rate","30").option("--resolution <r>","Resolution: hd, fhd, 2k, 4k","fhd").option("--brand-kit <id>","Bind a brand kit id to the project").option("--from-suggestion <sug>","Clip suggestion publicId (sug_\u2026) \u2014 atomically builds the composition after project creation so render needs no further args").option("--cheap","With --from-suggestion: use the deterministic translator (no LLM, ~100ms) instead of the AI authoring pass. Useful for tests / programmatic flows.").action(async g=>{await Nr({name:g.name,target:De(g.target),aspect:g.aspect,fps:Lf(g.fps),resolution:g.resolution,brandKitId:g.brandKit,fromSuggestion:g.fromSuggestion,cheap:g.cheap,json:e().json,dryRun:e().dryRun})}),s.command("delete").description("Permanently delete a project (irreversible cleanup \u2014 removes the composition and render history).").argument("<projectId>","Project ID (from `cueframe list` or `project create`)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>wd(g,{target:De(z.target),json:e().json})),o.command("media").description("Media library cleanup commands").command("delete").description("Permanently delete a media item (irreversible cleanup \u2014 removes the source and its derived assets).").argument("<mediaId>","Media item ID (from `cueframe clips`)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Od(g,{target:De(z.target),json:e().json})),o.command("upload").description("Upload a video file and process it").argument("<file>","Path to video file").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-a, --analyze","Run clip analysis after processing completes").option("-r, --audio-role <role>","Declare the audio role (vo|music|sfx|ambience) \u2014 routes ingest enrichment: vo\u2192transcript, music\u2192beat grid, sfx/ambience\u2192envelope").action(async(g,z)=>{await Lr(g,{target:De(z.target),analyze:z.analyze,audioRole:z.audioRole,json:e().json,dryRun:e().dryRun})}),o.command("analyze").description("Trigger AI clip suggestion analysis for a media item").argument("<mediaItemId>","Media item ID (from `cueframe clips`)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-w, --wait","Wait for analysis to complete and show results").action((g,z)=>Np(g,{target:De(z.target),wait:z.wait,json:e().json,dryRun:e().dryRun})),o.command("clips").description("List AI-generated clip suggestions for a media item").argument("[mediaItemId]","Media item ID (omit to list your media library)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Ed(g,{target:De(z.target),json:e().json}));let p=o.command("recipe").description("Package or run a portable CueFrame recipe");p.command("pack").description("Validate, pin authored source, and package a recipe offline. No login, upload, compilation, or rendering.").requiredOption("-b, --body <json|@file|@->","Version-1 packaging input: project draft and bundled component sources; @- reads stdin").requiredOption("-o, --out <path>","Generated .cueframe project path (replaced on success)").option("--check","Check that the output is current without writing it").action(async g=>{await xf({...g,json:e().json,dryRun:e().dryRun})}),p.command("run").description("Upload the source, create the recipe project, validate it, and render it").argument("[recipe]","Recipe slug from cueframe-ai/cueframe-recipes, local .cueframe template, or legacy directory",".").requiredOption("-m, --media <path>","Source media file for the recipe").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-o, --out <path>","Output MP4 path","./recipe-output.mp4").option("--no-render","Create the editable project without rendering it").action(async(g,z)=>{await Dd({directory:g,media:z.media,out:z.out,target:De(z.target),render:z.render!==!1,json:e().json,dryRun:e().dryRun})});let u=o.command("render").description("Render a project to MP4 (queues, watches via SSE, downloads). Renders whatever composition is saved on the project \u2014 build it first via `project create --from-suggestion` or `composition from-suggestion`.").allowExcessArguments(!1).argument("<projectId>","Project ID (from `cueframe list` or `project create`)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-a, --aspect <ratio>","Aspect ratio: 9:16, 1:1, 16:9 (defaults to project format)").option("--fps <n>","Frame rate","30").option("--resolution <r>","Resolution: hd, fhd, 2k, 4k","fhd").option("-o, --out <path>","Output file path (default: ./reel-<id>.mp4)").option("--idempotency-key <key>",'Override the auto-derived Idempotency-Key. Default: sha256("render:<projectId>:<currentCompositionETag>"). Pass a fresh UUID to force a new render row.').option("--priority <p>","Routing intent: interactive (low-latency, access-gated), standard (default), background (lowest queue weight).").option("--intent <i>","Encode-quality hint: preview (fast / low-bitrate, for editor scrubbing) or final (default, full Format).").action(async(g,z)=>{await _r(g,{target:z.target,aspect:z.aspect,fps:Lf(z.fps),resolution:z.resolution,out:z.out,json:e().json,dryRun:e().dryRun,...z.idempotencyKey?{idempotencyKey:z.idempotencyKey}:{},...z.priority?{priority:z.priority}:{},...z.intent?{intent:z.intent}:{}})});o.command("api").description("Raw API call against the v1 surface (escape hatch \u2014 like `gh api`).").argument("<method>","HTTP method: GET, POST, PUT, PATCH, DELETE").argument("<path>","API path starting with /v1, e.g. /v1/projects").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-b, --body <body>","Request body (inline JSON, @file.json to read from disk, @- for stdin)").option("-H, --header <header...>",'Additional header (repeatable), e.g. -H "If-Match: \\"abc\\""').option("-i, --include","Include response status line + headers in stdout (curl-style). Lets agents read ETag etc.").action((g,z,w)=>Sf(g,z,{target:w.target,body:w.body,header:w.header,include:w.include,json:e().json})),o.command("schema").description("Print the live composition wire schema from the server (/v1/openapi.json) \u2014 discover the contract instead of guessing.").argument("[resource]","Schema to print (currently: composition)","composition").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Tf(g,{target:z.target,json:e().json}));let f=o.command("composition").description("Read/write a project's composition. ETag is threaded automatically.");f.command("validate").description("Validate a composition body against the live schema WITHOUT saving or rendering. Returns per-field errors \u2014 author safely before paying for a render.").requiredOption("-b, --body <body>","Composition JSON (inline, @file.json, or @- for stdin)").option("-t, --target <target>","Target environment: prod (default), dev, local").action(async g=>{await Fr({target:g.target,body:g.body,json:e().json})}),f.command("get").description("Fetch the project's composition and ETag").argument("<projectId>","Project ID").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Cd(g,{target:z.target,json:e().json})),f.command("put").description("Replace the composition. GETs ETag first for safe concurrent writes.").argument("<projectId>","Project ID").option("-t, --target <target>","Target environment: prod (default), dev, local").requiredOption("-b, --body <body>","Composition JSON (inline, @file.json, or @- for stdin)").option("--if-match <etag>","Use this ETag (skip the GET round-trip)").option("--force","Use If-Match: * (unconditional overwrite \u2014 may clobber concurrent edits)").action(async(g,z)=>{await Dr(g,{target:z.target,body:z.body,ifMatch:z.ifMatch,force:z.force,json:e().json})}),f.command("from-suggestion").description("Build the composition from an existing clip suggestion").argument("<projectId>","Project ID").requiredOption("-s, --suggestion <suggestionId>","Clip suggestion publicId (sug_\u2026)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--format <json>",`Optional format override, e.g. '{"aspectRatio":"9:16","fps":30,"resolution":"fhd"}'`).option("--if-match <etag>","Use this ETag (skip the GET round-trip)").option("--force","Use If-Match: * (unconditional overwrite)").action((g,z)=>vr(g,{target:z.target,suggestionId:z.suggestion,format:z.format,ifMatch:z.ifMatch,force:z.force,json:e().json})),u.command("watch").description("Reattach to an existing render and stream progress to terminal state").argument("<renderId>","Render ID (from `cueframe render` output)").requiredOption("-p, --project <projectId>","Project the render belongs to").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--no-download","Print the MP4 URL but skip downloading the file").option("-o, --out <path>","Output file path when downloading (default: ./reel-<id>.mp4)").action((g,z,w)=>{let k=w?.parent?.opts?.()?.target??z.target;return kd(g,{target:k,project:z.project,out:z.out,download:z.download!==!1,json:e().json})});let m=o.command("export").description("Hand the timeline off to a real NLE (Final Cut Pro / Premiere Pro)");m.command("fcpxml").description("Build a Final Cut Pro export zip and (optionally) wait to download it").argument("<projectId>","Project ID").requiredOption("-s, --suggestion <suggestionId>","Clip suggestion publicId (sug_\u2026)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-o, --out <path>","Output zip path (default: ./export-<id>.zip)").option("--wait","Block until the export finishes, then download the artifact").action((g,z)=>Xc("fcpxml",{target:z.target,projectId:g,suggestionId:z.suggestion,out:z.out,wait:z.wait,json:e().json})),m.command("premiere").description("Build a Premiere Pro export zip and (optionally) wait to download it").argument("<projectId>","Project ID").requiredOption("-s, --suggestion <suggestionId>","Clip suggestion publicId (sug_\u2026)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-o, --out <path>","Output zip path (default: ./export-<id>.zip)").option("--wait","Block until the export finishes, then download the artifact").action((g,z)=>Xc("premiere",{target:z.target,projectId:g,suggestionId:z.suggestion,out:z.out,wait:z.wait,json:e().json}));let x=o.command("sessions").description("Multi-file ingest sessions (camera A/B/screen \u2192 muxed composition)");x.command("list").description("List sessions in this org").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>If({target:g.target,json:e().json})),x.command("get").description("Get a single session by ID").argument("<sessionId>","Session ID").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Rf(g,{target:z.target,json:e().json})),x.command("create").description("Create a session from one or more media files").requiredOption("-n, --name <name>","Session name").requiredOption("-f, --file <entry...>","Each entry is <mediaId>:<role> (repeatable)").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>wf({target:g.target,name:g.name,files:g.file,json:e().json})),x.command("delete").description("Delete a session (server checks for compositions referencing it)").argument("<sessionId>","Session ID").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Of(g,{target:z.target,json:e().json})),o.command("describe").description("Print the CLI command tree as structured JSON (agent introspection)").action(()=>kf(o,{json:e().json}));try{await o.parseAsync()}catch(g){let z=q(g);K(e(),"cli",Object.assign(new Error(ue(g)),{code:g?.code,status:g?.status}),z),N(z)}}await Df();
80
+ /*! Bundled license information:
81
+
82
+ @noble/hashes/esm/utils.js:
83
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
84
+ */