sveld 0.40.1 → 0.40.2

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.
@@ -0,0 +1,191 @@
1
+ var E=Symbol("sveld.parsedComponentTypeScriptMetadata"),L=Symbol("sveld.parsedComponentPropIgnores");function yo(ee){return ee[L]}function xo(ee){return ee[E]}var js=Array(2048).fill(void 0);function Oc(){js.fill(void 0)}function vo(ee,te,Oe,Ot){let jt=Ot&2047,Vt=js[jt];if(Vt!==void 0&&Vt.length===Oe-te&&ee.startsWith(Vt,te))return Vt;let Wt=ee.slice(te,Oe);return js[jt]=Wt,Wt}var pi="",Rn=[0],Gn=0,ai=0,Vn;function ne(ee){Oc(),pi=ee,Rn=[0],Gn=0,ai=0,Vn=void 0}function Vs(ee){while(Gn<=ee){let te=pi.indexOf(`
2
+ `,Gn);if(te===-1){Gn=Number.POSITIVE_INFINITY;return}Gn=te+1,Rn.push(Gn)}}function Eo(ee){let te=[0],Oe=ee.indexOf(`
3
+ `);while(Oe!==-1)te.push(Oe+1),Oe=ee.indexOf(`
4
+ `,Oe+1);return te}function zi(ee,te,Oe){let Ot=0,jt=ee.length-1;if(te>=ee[Oe])Ot=Oe;else jt=Oe-1;if(Ot<jt&&te<ee[Ot+1])jt=Ot;while(Ot<jt){let Vt=Ot+jt+1>>>1;if(ee[Vt]<=te)Ot=Vt;else jt=Vt-1}return Ot}function x(ee){return Vs(ee),ai=zi(Rn,ee,ai),{line:ai+1,column:ee-Rn[ai],character:ee}}var Bs=/\r\n?|\n|\u2028|\u2029/g,Lc=/[\r\u2028\u2029]/;function So(ee){if(Vn===void 0){Vn=Lc.test(pi)?[]:null,Bs.lastIndex=0;while(Vn!==null&&Bs.exec(pi)!==null)Vn.push(Bs.lastIndex)}if(Vn===null)return Vs(ee),zi(Rn,ee,ai);let te=0,Oe=Vn.length;while(te<Oe){let Ot=te+Oe>>>1;if(Vn[Ot]<=ee)te=Ot+1;else Oe=Ot}return te}function D(ee){let{line:te,column:Oe}=x(ee);return{line:te,column:Oe}}function bo(ee){while(Rn.length<=ee+1&&Gn!==Number.POSITIVE_INFINITY)Vs(Gn);if(ee>=Rn.length)return;let te=ee+1<Rn.length?Rn[ee+1]-1:pi.length;return pi.slice(Rn[ee],te)}function ve(ee){let te,Oe=0;return(Ot)=>(te??=Eo(ee),Oe=zi(te,Ot,Oe),{line:Oe+1,column:Ot-te[Oe]})}function Mn(ee){return typeof ee==="object"&&ee!==null&&typeof Jn(ee).type==="string"}function Jn(ee){return ee}function H(ee,te){let Oe=Jn(ee);for(let Ot in Oe){let jt=Oe[Ot];if(Array.isArray(jt)){for(let Vt=0;Vt<jt.length;Vt++)if(Mn(jt[Vt]))jt[Vt]=te(jt[Vt])}else if(Mn(jt))Oe[Ot]=te(jt)}}function re(ee,...te){if(!te.some((Oe)=>Oe===ee.type))throw Error(`expected ${te.join(" or ")}, got ${ee.type}`)}function Se(ee){let te=[];return Yn(ee,te),te}function Yn(ee,te){switch(ee.type){case"Identifier":te.push(ee);return;case"ObjectPattern":for(let Oe of ee.properties)Yn(Oe.type==="RestElement"?Oe.argument:Oe.value,te);return;case"ArrayPattern":for(let Oe of ee.elements)if(Oe!==null)Yn(Oe,te);return;case"RestElement":Yn(ee.argument,te);return;case"AssignmentPattern":Yn(ee.left,te);return;case"TSParameterProperty":Yn(ee.parameter,te);return;case"TSAsExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":Yn(ee.expression,te)}}function U(ee,te){if(ee.type!=="Identifier")return!1;if(te===null)return!0;switch(te.type){case"MemberExpression":return te.computed||ee===te.object;case"MethodDefinition":return te.computed;case"Property":case"PropertyDefinition":return te.computed||ee===te.value;case"ExportSpecifier":case"ImportSpecifier":return ee===te.local;case"MetaProperty":case"ImportAttribute":case"ExportAllDeclaration":case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":case"TSInstantiationExpression":case"TSExportAssignment":return ee===te.expression;case"TSEnumMember":return ee===te.initializer;case"TSParameterProperty":case"TSEnumDeclaration":case"TSImportEqualsDeclaration":return!0;default:return!te.type.startsWith("TS")}}var Qn={Root:["module","instance","fragment","css"],Script:["attributes","content"],Fragment:["nodes"],Text:[],Comment:[],ExpressionTag:["expression"],HtmlTag:["expression"],ConstTag:["declaration"],DeclarationTag:["declaration"],DebugTag:["identifiers"],RenderTag:["expression"],AttachTag:["expression"],Attribute:["value"],SpreadAttribute:["expression"],AnimateDirective:["expression"],BindDirective:["expression"],ClassDirective:["expression"],LetDirective:["expression"],OnDirective:["expression"],StyleDirective:["value"],TransitionDirective:["expression"],UseDirective:["expression"],Component:["attributes","fragment"],TitleElement:["attributes","fragment"],SlotElement:["attributes","fragment"],RegularElement:["attributes","fragment"],SvelteBody:["attributes","fragment"],SvelteBoundary:["attributes","fragment"],SvelteComponent:["expression","attributes","fragment"],SvelteDocument:["attributes","fragment"],SvelteElement:["tag","attributes","fragment"],SvelteFragment:["attributes","fragment"],SvelteHead:["attributes","fragment"],SvelteOptions:["attributes","fragment"],SvelteSelf:["attributes","fragment"],SvelteWindow:["attributes","fragment"],IfBlock:["test","consequent","alternate"],EachBlock:["expression","context","key","body","fallback"],AwaitBlock:["expression","pending","value","then","error","catch"],KeyBlock:["expression","fragment"],SnippetBlock:["expression","parameters","body"],StyleSheet:["attributes","children"],Rule:["prelude","block"],Atrule:["block"],SelectorList:["children"],ComplexSelector:["children"],RelativeSelector:["combinator","selectors"],Combinator:[],TypeSelector:[],IdSelector:[],ClassSelector:[],AttributeSelector:[],PseudoElementSelector:["args"],PseudoClassSelector:["args"],Percentage:[],Nth:[],NestingSelector:[],Block:["children"],Declaration:[],Program:["body"],ExpressionStatement:["expression"],BlockStatement:["body"],StaticBlock:["body"],EmptyStatement:[],DebuggerStatement:[],WithStatement:["object","body"],ReturnStatement:["argument"],LabeledStatement:["label","body"],BreakStatement:["label"],ContinueStatement:["label"],IfStatement:["test","consequent","alternate"],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],CatchClause:["param","body"],WhileStatement:["test","body"],DoWhileStatement:["body","test"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","typeParameters","params","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],ArrowFunctionExpression:["typeParameters","params","returnType","body"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","implements","body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","implements","body"],ClassBody:["body"],MethodDefinition:["decorators","key","typeParameters","value"],PropertyDefinition:["decorators","key","typeAnnotation","value"],Property:["decorators","key","value"],ThisExpression:[],Super:[],Literal:[],Identifier:["decorators","typeAnnotation"],PrivateIdentifier:[],ArrayExpression:["elements"],ObjectExpression:["properties"],UnaryExpression:["argument"],UpdateExpression:["argument"],BinaryExpression:["left","right"],LogicalExpression:["left","right"],AssignmentExpression:["left","right"],MemberExpression:["object","property"],ConditionalExpression:["test","consequent","alternate"],CallExpression:["callee","typeArguments","arguments"],NewExpression:["callee","typeArguments","arguments"],SequenceExpression:["expressions"],TemplateLiteral:["quasis","expressions"],TaggedTemplateExpression:["tag","typeArguments","quasi"],TemplateElement:[],SpreadElement:["argument"],RestElement:["decorators","argument","typeAnnotation"],YieldExpression:["argument"],AwaitExpression:["argument"],ImportExpression:["source","options","arguments"],ChainExpression:["expression"],ParenthesizedExpression:["expression"],MetaProperty:["meta","property"],ObjectPattern:["decorators","properties","typeAnnotation"],ArrayPattern:["decorators","elements","typeAnnotation"],AssignmentPattern:["decorators","left","right"],ImportDeclaration:["specifiers","source","attributes"],ImportSpecifier:["imported","local"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportAttribute:["key","value"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ExportDefaultDeclaration:["declaration"],ExportAllDeclaration:["exported","source","attributes"],Decorator:["expression"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterDeclaration:["params"],TSTypeParameterInstantiation:["params"],TSTypeParameter:["constraint","default"],TSAnyKeyword:[],TSBigIntKeyword:[],TSBooleanKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSNamedTupleMember:["label","elementType"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSLiteralType:["literal"],TSTypeReference:["typeName","typeArguments"],TSQualifiedName:["left","right"],TSTypeQuery:["exprName","typeArguments"],TSImportType:["argument","qualifier","typeArguments"],TSTypeLiteral:["members"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation"],TSFunctionType:["typeParameters","parameters","typeAnnotation"],TSConstructorType:["typeParameters","parameters","typeAnnotation"],TSIndexSignature:["decorators","parameters","typeAnnotation"],TSTypePredicate:["parameterName","typeAnnotation"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSDeclareFunction:["id","typeParameters","params","returnType"],TSDeclareMethod:["typeParameters","params","returnType"],TSParameterProperty:["parameter"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSNonNullExpression:["expression"],TSInstantiationExpression:["expression","typeArguments"]};var on=[],ci={...Qn,FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],ArrowFunctionExpression:["params","body"],ClassDeclaration:["decorators","id","superClass","body"],ClassExpression:["decorators","id","superClass","body"],MethodDefinition:["decorators","key","value"],PropertyDefinition:["decorators","key","value"],Identifier:["decorators"],CallExpression:["callee","arguments"],NewExpression:["callee","arguments"],TaggedTemplateExpression:["tag","quasi"],RestElement:["decorators","argument"],ObjectPattern:["decorators","properties"],ArrayPattern:["decorators","elements"],TSTypeAnnotation:on,TSTypeParameterDeclaration:on,TSTypeParameterInstantiation:on,TSTypeParameter:on,TSArrayType:on,TSTupleType:on,TSNamedTupleMember:on,TSOptionalType:on,TSRestType:on,TSUnionType:on,TSIntersectionType:on,TSConditionalType:on,TSInferType:on,TSParenthesizedType:on,TSTypeOperator:on,TSIndexedAccessType:on,TSMappedType:on,TSLiteralType:on,TSTypeReference:on,TSTypeQuery:on,TSImportType:on,TSTypeLiteral:on,TSPropertySignature:on,TSMethodSignature:on,TSCallSignatureDeclaration:on,TSConstructSignatureDeclaration:on,TSFunctionType:on,TSConstructorType:on,TSIndexSignature:on,TSTypePredicate:on,TSInterfaceDeclaration:on,TSInterfaceBody:on,TSExpressionWithTypeArguments:on,TSTypeAliasDeclaration:on,TSNamespaceExportDeclaration:on,TSDeclareFunction:["id"],TSDeclareMethod:on,TSAsExpression:["expression"],TSSatisfiesExpression:["expression"],TSTypeAssertion:["expression"],TSInstantiationExpression:["expression"]},Mc=Object.assign(Object.create(null),Qn),Fc=Object.assign(Object.create(null),ci),Co=[],v=Symbol("sveast.walk.stop"),p=Symbol("sveast.walk.skip");function o(ee,te,Oe){Xi(ee,null,null,null,te,Bc(Oe))}function Bc(ee){if(ee===void 0||ee===Qn)return Vc;if(ee===ci)return Gc;return(te)=>jc(ee,te.type)}function jc(ee,te){return Object.hasOwn(ee,te)?ee[te]:void 0}var Rm=Object.freeze([]);function Xi(ee,te,Oe,Ot,jt,Vt){let Wt=Vt(ee);if(Wt===void 0)throw Error(`unknown node type: ${ee.type}`);let Mt=jt.enter?.(ee,te,Oe,Ot);if(Mt===v)return!0;if(Mt!==p){if(Mt!==ee&&Mn(Mt))return Wc(Mt,te,Oe,Ot,jt,Vt);let Gt=Jn(ee);for(let Ut=0;Ut<Wt.length;Ut++){let Ht=Wt[Ut],qt=Gt[Ht];if(Array.isArray(qt))for(let zt=0;zt<qt.length;zt++){let Xt=qt[zt];if(Mn(Xt)&&Xi(Xt,ee,Ht,zt,jt,Vt))return!0}else if(Mn(qt)&&Xi(qt,ee,Ht,null,jt,Vt))return!0}}return jt.leave?.(ee,te,Oe,Ot)===v}function Vc(ee){let te=ee.type;if(te==="Identifier")return ee.typeAnnotation===void 0&&ee.decorators===void 0?Co:Qn.Identifier;if(te==="Literal")return Qn.Literal;if(te==="Text")return Qn.Text;return Mc[te]}function Gc(ee){let te=ee.type;if(te==="Identifier")return ee.decorators===void 0?Co:ci.Identifier;if(te==="Literal")return ci.Literal;if(te==="Text")return ci.Text;return Fc[te]}function Wc(ee,te,Oe,Ot,jt,Vt){if(te===null||Oe===null)throw Error("walk can't replace the node it was called with");let Wt=Jn(te),Mt=Wt[Oe];if(Ot===null)Wt[Oe]=ee;else if(Array.isArray(Mt))Mt[Ot]=ee;return Xi(ee,te,Oe,Ot,jt,Vt)}function r(ee){return typeof ee==="object"&&ee!==null}function b(ee){return r(ee)&&ee.type==="Literal"}function t(ee){return r(ee)&&ee.type==="Identifier"&&typeof ee.name==="string"}function T(ee){return r(ee)&&ee.type==="MemberExpression"}function c(ee){return r(ee)&&ee.type==="ObjectExpression"&&Array.isArray(ee.properties)}function Uc(ee){return r(ee)&&ee.type==="CallExpression"}function m(ee,te){return Uc(ee)&&t(ee.callee)&&ee.callee.name===te}function C(ee){return ee?.type==="TSAsExpression"||ee?.type==="TSSatisfiesExpression"?C(ee.expression):ee}function Me(ee){return ee?.type==="TSAsExpression"||ee?.type==="TSSatisfiesExpression"?ee.typeAnnotation:void 0}function Hc(ee){return r(ee)&&ee.type==="NewExpression"}function be(ee,te){return Hc(ee)&&t(ee.callee)&&ee.callee.name===te}function k(ee){if(!r(ee))return null;if(ee.type==="Literal")return ee.value==null?null:String(ee.value);if(ee.type==="TemplateLiteral"){let te=ee.quasis;if(te?.length===1)return te[0]?.value?.cooked??null}return null}function l(ee){if(t(ee))return ee.name;if(b(ee))return ee.value==null?void 0:String(ee.value);return}var Kc=new Set(["Component","SvelteComponent","SvelteSelf"]),qc=new Set(["RegularElement","SvelteElement"]);function O(ee){return Kc.has(ee)}function N(ee){return qc.has(ee)}function Ji(ee,te,Oe=0,Ot=ee.length,jt=0){let Vt=jt;for(let Wt=Oe;Wt<Ot;Wt++){let Mt=ee.charCodeAt(Wt);if(Mt===34||Mt===39||Mt===96){Wt=zc(ee,Wt,Ot);continue}if(Mt===123||Mt===40||Mt===91||Mt===60)Vt++;else if(Mt===125||Mt===41||Mt===93||Mt===62&&ee.charCodeAt(Wt-1)!==61){if(Vt>0)Vt--}if(te?.(Wt,Vt)===!0)break}return Vt}function zc(ee,te,Oe){let Ot=ee.charCodeAt(te);for(let jt=te+1;jt<Oe;jt++){let Vt=ee.charCodeAt(jt);if(Vt===92)jt++;else if(Vt===Ot)return jt}return Oe-1}function i(ee,te){let Oe=[],Ot=0;return Ji(ee,(jt,Vt)=>{if(Vt===0&&te.includes(ee[jt]))Oe.push(ee.slice(Ot,jt)),Ot=jt+1;return!1}),Oe.push(ee.slice(Ot)),Oe}function Gs(ee,te,Oe=0){let Ot=-1;return Ji(ee,(jt,Vt)=>{if(te(jt,Vt))Ot=jt;return Ot!==-1},Oe),Ot}function z(ee,te){return Gs(ee,(Oe,Ot)=>Ot===0&&te.includes(ee[Oe]))}function w(ee){return Gs(ee,(te,Oe)=>Oe===0&&ee[te]==="="&&ee[te+1]===">")}function P(ee,te){return Gs(ee,(Oe,Ot)=>Ot===0,te)}function Ws(ee){let te=ee.trim();return te.startsWith("[")&&P(te,0)===te.length-1}function ie(ee){if(!ee)return;let te=w(ee);if(te===-1)return;return ee.slice(te+2).trim()||void 0}var Xc=new Set(["null","undefined"]);function se(ee){if(!ee)return!1;let te=i(ee,"|").map((Ot)=>Ot.trim()).filter((Ot)=>Ot&&!Xc.has(Ot));if(te.length!==1)return!1;let[Oe]=te;while(Oe.startsWith("(")&&P(Oe,0)===Oe.length-1)Oe=Oe.slice(1,-1).trim();return(Oe.startsWith("(")||Oe.startsWith("<"))&&w(Oe)!==-1}function Jc(ee){let te="";for(let Oe=0;Oe<ee.length;Oe++){let Ot=ee[Oe];if(Ot==="*"&&ee[Oe+1]==="*"){if(Oe++,ee[Oe+1]==="/")te+="(?:.*/)?",Oe++;else te+=".*";continue}if(Ot==="*"){te+="[^/]*";continue}if(Ot==="?"){te+="[^/]";continue}te+=".+^$()[]{}|\\".includes(Ot)?`\\${Ot}`:Ot}return te}function wo(ee,te){return new RegExp(`^${Jc(ee)}$`).test(te)}var Us={"prop-unknown-type":{severity:"warning",label:"Props without inferred types"},"context-any-type":{severity:"warning",label:"Context values typed as `any`"},"bind-this-type-mismatch":{severity:"warning",label:"bind:this props declared with an element type they're never bound to"},"slot-missing-type":{severity:"warning",label:"@slot/@snippet tags missing a {Type} annotation"},"slot-not-rendered":{severity:"warning",label:"@slot/@snippet tags for slots the component doesn't render"},"event-no-source":{severity:"warning",label:"@event tags with no dispatch or callback"},"dispatch-escapes":{severity:"warning",label:"Dispatchers passed to functions sveld can't follow"},"example-compile-error":{severity:"error",label:"@example blocks that failed to compile"},"example-syntax-error":{severity:"error",label:"@example blocks that failed to parse"},"syntax-skipped":{severity:"error",label:"Component syntax sveld skipped"},"type-syntax-error":{severity:"error",label:"JSDoc types that aren't valid TypeScript"},"rest-props-unresolved":{severity:"warning",label:"$$restProps spread only onto components"},"context-duplicate-key":{severity:"warning",label:"Duplicate setContext keys"},"context-key-unresolved":{severity:"warning",label:"setContext keys sveld couldn't resolve"},"context-value-unresolved":{severity:"warning",label:"setContext values sveld couldn't describe"},"spread-unresolved":{severity:"warning",label:"Unresolved spreads widened to Record<string, any>"},"export-unresolved":{severity:"warning",label:"Unresolved named export specifiers"},"module-export-conflict":{severity:"warning",label:"Module-script exports colliding with generated names"},"extend-props-target-missing":{severity:"error",label:"@extends/@extendProps targets that couldn't be verified"},"extend-props-duplicate":{severity:"warning",label:"Duplicate @extends/@extendProps tags"},"extend-props-override":{severity:"warning",label:"Own props overriding an @extends target's prop"},"jsdoc-unknown-tag":{severity:"warning",label:"Unknown JSDoc tags"},"typedef-duplicate":{severity:"warning",label:"Duplicate @typedef/@callback names"},"property-duplicate":{severity:"warning",label:"Duplicate @property names"},"generics-conflict":{severity:"warning",label:"Duplicate @generics/@template names"},"event-description-ambiguous":{severity:"warning",label:"Text after an @event read as the next tag's description"},"jsdoc-tag-dropped":{severity:"warning",label:"Passthrough JSDoc tags that couldn't attach"},"internal-typedef-referenced":{severity:"error",label:"Public types referencing an @internal typedef"},"cross-file-unresolved":{severity:"warning",label:"Imports a standalone parse couldn't read"},"export-ambiguous":{severity:"warning",label:"Ambiguous `export *` names left out of the entry exports"}};function a(ee){return{...ee,code:J[ee.kind],severity:Us[ee.kind].severity}}function To(ee,te){if(te)return ee;return ee.filter((Oe)=>Oe.kind!=="jsdoc-unknown-tag")}function ko(ee,te){if(!te)return[];return ee.filter((Oe)=>!Oe.ignored&&(te!=="errors"||Oe.severity==="error"))}function Yc(ee,te){if(te.code!==void 0&&te.code!==ee.code)return!1;if(te.name!==void 0&&te.name!==ee.name)return!1;if(te.component!==void 0&&!wo(te.component,ee.component))return!1;return!0}function Ao(ee,te){if(!te||te.length===0)return ee;return ee.map((Oe)=>Oe.ignored||te.some((Ot)=>Yc(Oe,Ot))?{...Oe,ignored:!0}:Oe)}var Po=Object.keys(Us),J=Object.fromEntries(Po.map((ee)=>[ee,`sveld/${ee}`]));function _o(ee){let te=new Set,Oe=[];for(let Ot of ee){let jt=`${Ot.component}:${Ot.kind}:${Ot.name}`;if(te.has(jt))continue;te.add(jt),Oe.push(Ot)}return Oe}function $o(ee){let te=ee.filter((Gt)=>!Gt.ignored),Oe=ee.length-te.length,Ot=Oe>0?` (${Oe} ignored)`:"";if(te.length===0)return`sveld: no diagnostics${Ot}.`;let jt=[],Vt=(Gt,Ut)=>`${Gt} ${Ut}${Gt===1?"":"s"}`,Wt=te.filter((Gt)=>Gt.severity==="error").length,Mt=`${Vt(Wt,"error")}, ${Vt(te.length-Wt,"warning")}`;jt.push(`sveld: ${Vt(te.length,"diagnostic")} (${Mt})${Ot}.`);for(let Gt of Po){let Ut=te.filter((qt)=>qt.kind===Gt);if(Ut.length===0)continue;jt.push(""),jt.push(`${Us[Gt].label} (${Ut.length}):`);let Ht=new Map;for(let qt of Ut){let zt=Ht.get(qt.component)??[];zt.push(qt),Ht.set(qt.component,zt)}for(let[qt,zt]of Ht){jt.push(` ${qt}`);for(let Xt of zt){let Jt=Xt.source?` (${qt}:${Xt.source.start.line}:${Xt.source.start.column})`:"";jt.push(` - ${Xt.message}${Jt} [${Xt.code}]`)}}}return jt.join(`
5
+ `)}function No(ee){return ee.replaceAll("%","%25").replaceAll("\r","%0D").replaceAll(`
6
+ `,"%0A")}function Qc(ee){return No(ee).replaceAll(":","%3A").replaceAll(",","%2C")}function Zc(ee){let Oe=[["file",ee.file],["line",ee.line],["col",ee.column],["endLine",ee.endLine],["endColumn",ee.endColumn],["title",ee.title]].filter((Ot)=>Ot[1]!==void 0).map(([Ot,jt])=>`${Ot}=${Qc(String(jt))}`).join(",");return`::${ee.severity} ${Oe}::${No(ee.message)}`}function Do(ee,te){let Oe=ee.filter((jt)=>!jt.ignored);return[...Oe.filter((jt)=>jt.severity==="error"),...Oe.filter((jt)=>jt.severity!=="error")].map(({source:jt,...Vt})=>{let Wt=jt!==void 0&&jt.start.line===jt.end.line;return Zc({severity:Vt.severity,title:Vt.code,message:Vt.message,file:te(Vt.component),line:jt?.start.line,column:Wt?jt.start.column+1:void 0,endLine:jt?.end.line,endColumn:Wt?jt.end.column+1:void 0})}).join(`
7
+ `)}var Fe=1;function Ro(ee){return`${JSON.stringify({kind:"diagnostics",schemaVersion:Fe,diagnostics:ee},null,2)}
8
+ `}function li(ee,te){if(te.length===0)return;ee.diagnostics=[...ee.diagnostics??[],...te]}var el=/\*\//g,tl=/[.*+?^${}()|[\]\\]/g;function _(ee){return ee.replace(tl,"\\$&")}function M(ee){return ee.replace(el,"*\\/")}function h(ee){return ee.map((te)=>`${te.name}${te.optional?"?":""}: ${te.type}`).join(", ")}var nl=new Intl.Collator("en");function u(ee,te){return nl.compare(ee,te)}var il=/(?:_|[^\p{ID_Continue}$])+/u,sl=/^[\p{ID_Start}$]/u;function K(ee){let Ot=`${ee.split(il).map((jt)=>jt.charAt(0).toUpperCase()+jt.slice(1)).join("")}Context`;return sl.test(Ot)?Ot:`_${Ot}`}var rl=/^\{([\s\S]*)\}$/,ol=/^[A-Za-z_$][\w$]*$/,al=/^readonly\s+/,pl=/^\[[\w$]+\s*:[^\]]+\]$/;function d(ee,{skipIndexSignatures:te=!1}={}){let Oe=ee.trim(),Ot=rl.exec(Oe);if(!Ot)return null;let jt=Ot[1].trim();if(jt==="")return[];let Vt=[];for(let Wt of i(jt,";,")){let Mt=Wt.trim();if(!Mt)continue;let Gt=z(Mt,":");if(Gt===-1)return null;let Ut=Mt.slice(0,Gt).trim().replace(al,""),Ht=Mt.slice(Gt+1).trim();if(!Ht)return null;if(te&&pl.test(Ut))continue;let qt=!1;if(Ut.endsWith("?"))qt=!0,Ut=Ut.slice(0,-1).trim();if(!ol.test(Ut))return null;Vt.push({name:Ut,type:Ht,optional:qt})}return Vt}function oe({imported:ee}){return ee.type==="Identifier"?ee.name:ee.value}function X(ee,te){let Oe=te.source.value;if(typeof Oe!=="string"||te.importKind==="type")return;for(let Ot of te.specifiers){if(Ot.type!=="ImportSpecifier"||Ot.importKind==="type")continue;let jt=Ot.local.name,Vt=oe(Ot);ee.valueImportBindingsByLocalName.set(jt,{localName:jt,importedName:Vt,source:Oe})}}function ae(ee){return[ee.importedName,...ee.members??[]].join(".")}function Te(ee,te){let Oe=[],Ot=te;while(T(Ot)){if(Ot.computed||!t(Ot.property))return;Oe.unshift(Ot.property.name),Ot=Ot.object}if(!t(Ot))return;return Y(ee,Ot.name,Oe)}function Y(ee,te,Oe=[]){let Ot=(Vt,Wt,Mt)=>Mt.length>0?{source:Vt,importedName:Wt,members:Mt}:{source:Vt,importedName:Wt},jt=ee.valueImportBindingsByLocalName.get(te);if(jt)return Ot(jt.source,jt.importedName,Oe);for(let Vt of[ee.parsed?.instance,ee.parsed?.module])for(let Wt of Vt?.content.body??[]){if(Wt.type!=="ImportDeclaration")continue;let Mt=Wt.source.value;if(Wt.importKind==="type"||typeof Mt!=="string")continue;let Gt=Wt.specifiers.find((Ut)=>Ut.local.name===te);if(Gt?.type==="ImportDefaultSpecifier")return Ot(Mt,"default",Oe);if(Gt?.type==="ImportNamespaceSpecifier"&&Oe.length>0)return Ot(Mt,Oe[0],Oe.slice(1))}return}function le(ee,te){if(!T(te))return;return Te(ee,te)}function Be(ee){let te=new Map;for(let Oe of ee.content.body){if(Oe.type!=="ImportDeclaration"||Oe.importKind==="type")continue;let Ot=Oe.source.value;if(typeof Ot!=="string")continue;for(let jt of Oe.specifiers){if(jt.type==="ImportSpecifier"&&jt.importKind==="type")continue;let Vt=jt.local.name,Wt;if(jt.type==="ImportDefaultSpecifier")Wt="default";else if(jt.type==="ImportNamespaceSpecifier")Wt="*";else Wt=oe(jt);te.set(Vt,{from:Ot,imported:Wt})}}return te}function Ce(ee,te){for(let Oe of te?.content.body??[]){if(Oe.type==="ImportDeclaration"){X(ee,Oe);continue}let Ot=Oe.type==="ExportNamedDeclaration"&&Oe.declaration?Oe.declaration:Oe;if(Ot.type==="FunctionDeclaration"&&Ot.id?.name)ee.funcDecls.set(Ot.id.name,Ot)}}function pe(ee){return ee==="TSTypeAnnotation"||ee==="TSTypeAliasDeclaration"||ee==="TSInterfaceDeclaration"||ee==="TSTypeParameterDeclaration"||ee==="TSTypeParameterInstantiation"}function Q(ee){let te=[];return o(ee,{enter(Oe){if(Oe.type==="FunctionDeclaration"||Oe.type==="FunctionExpression"||Oe.type==="ArrowFunctionExpression")return p;if(Oe.type==="ReturnStatement")te.push(Oe.argument??null)}}),te}var Hs={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Ks="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",cl={5:Ks,"5module":Ks+" export import",6:Ks+" const class extends export import super"},Fo=/^in(stanceof)?$/,ll=/\p{ID_Start}/u,ul=/[\p{ID_Continue}\u200c\u200d]/u;function g(ee,te){if(ee<65)return ee===36;if(ee<91)return!0;if(ee<97)return ee===95;if(ee<123)return!0;if(ee>65535&&te===!1)return!1;return ee>=170&&ll.test(String.fromCodePoint(ee))}function S(ee,te){if(ee<48)return ee===36;if(ee<58)return!0;if(ee<65)return!1;if(ee<91)return!0;if(ee<97)return ee===95;if(ee<123)return!0;if(ee>65535&&te===!1)return!1;return ee>=170&&ul.test(String.fromCodePoint(ee))}var pn=function(ee,te){if(te===void 0)te={};this.label=ee,this.keyword=te.keyword,this.beforeExpr=!!te.beforeExpr,this.startsExpr=!!te.startsExpr,this.isLoop=!!te.isLoop,this.isAssign=!!te.isAssign,this.prefix=!!te.prefix,this.postfix=!!te.postfix,this.binop=te.binop||null,this.updateContext=null};function Cn(ee,te){return new pn(ee,{beforeExpr:!0,binop:te})}var wn={beforeExpr:!0},vn={startsExpr:!0},Js={};function an(ee,te){if(te===void 0)te={};return te.keyword=ee,Js[ee]=new pn(ee,te)}var Kt={num:new pn("num",vn),regexp:new pn("regexp",vn),string:new pn("string",vn),name:new pn("name",vn),privateId:new pn("privateId",vn),eof:new pn("eof"),bracketL:new pn("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new pn("]"),braceL:new pn("{",{beforeExpr:!0,startsExpr:!0}),braceR:new pn("}"),parenL:new pn("(",{beforeExpr:!0,startsExpr:!0}),parenR:new pn(")"),comma:new pn(",",wn),semi:new pn(";",wn),colon:new pn(":",wn),dot:new pn("."),question:new pn("?",wn),questionDot:new pn("?."),arrow:new pn("=>",wn),template:new pn("template"),invalidTemplate:new pn("invalidTemplate"),ellipsis:new pn("...",wn),backQuote:new pn("`",vn),dollarBraceL:new pn("${",{beforeExpr:!0,startsExpr:!0}),eq:new pn("=",{beforeExpr:!0,isAssign:!0}),assign:new pn("_=",{beforeExpr:!0,isAssign:!0}),incDec:new pn("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new pn("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Cn("||",1),logicalAND:Cn("&&",2),bitwiseOR:Cn("|",3),bitwiseXOR:Cn("^",4),bitwiseAND:Cn("&",5),equality:Cn("==/!=/===/!==",6),relational:Cn("</>/<=/>=",7),bitShift:Cn("<</>>/>>>",8),plusMin:new pn("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Cn("%",10),star:Cn("*",10),slash:Cn("/",10),starstar:new pn("**",{beforeExpr:!0}),coalesce:Cn("??",1),_break:an("break"),_case:an("case",wn),_catch:an("catch"),_continue:an("continue"),_debugger:an("debugger"),_default:an("default",wn),_do:an("do",{isLoop:!0,beforeExpr:!0}),_else:an("else",wn),_finally:an("finally"),_for:an("for",{isLoop:!0}),_function:an("function",vn),_if:an("if"),_return:an("return",wn),_switch:an("switch"),_throw:an("throw",wn),_try:an("try"),_var:an("var"),_const:an("const"),_while:an("while",{isLoop:!0}),_with:an("with"),_new:an("new",{beforeExpr:!0,startsExpr:!0}),_this:an("this",vn),_super:an("super",vn),_class:an("class",vn),_extends:an("extends",wn),_export:an("export"),_import:an("import",vn),_null:an("null",vn),_true:an("true",vn),_false:an("false",vn),_in:an("in",{beforeExpr:!0,binop:7}),_instanceof:an("instanceof",{beforeExpr:!0,binop:7}),_typeof:an("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:an("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:an("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},En=/\r\n?|\n|\u2028|\u2029/,hl=new RegExp(En.source,"g");function ui(ee){return ee===10||ee===13||ee===8232||ee===8233}function Bo(ee,te,Oe){if(Oe===void 0)Oe=ee.length;for(var Ot=te;Ot<Oe;Ot++){var jt=ee.charCodeAt(Ot);if(ui(jt))return Ot<Oe-1&&jt===13&&ee.charCodeAt(Ot+1)===10?Ot+2:Ot+1}return-1}var jo=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,dn=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,dl=Object.prototype,{hasOwnProperty:fl,toString:ml}=dl,Ci=Object.hasOwn||function(ee,te){return fl.call(ee,te)},Io=Array.isArray||function(ee){return ml.call(ee)==="[object Array]"},Oo=Object.create(null);function Yi(ee){return Oo[ee]||(Oo[ee]=new RegExp("^(?:"+ee.replace(/ /g,"|")+")$"))}function ts(ee){if(ee<=65535)return String.fromCharCode(ee);return ee-=65536,String.fromCharCode((ee>>10)+55296,(ee&1023)+56320)}var gl=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,bi=function(ee,te){this.line=ee,this.column=te};bi.prototype.offset=function(ee){return new bi(this.line,this.column+ee)};var ns=function(ee,te,Oe){if(this.start=te,this.end=Oe,ee.sourceFile!==null)this.source=ee.sourceFile};function Vo(ee,te){for(var Oe=1,Ot=0;;){var jt=Bo(ee,Ot,te);if(jt<0)return new bi(Oe,te-Ot);++Oe,Ot=jt}}var qs={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Lo=!1;function yl(ee){var te={};for(var Oe in qs)te[Oe]=ee&&Ci(ee,Oe)?ee[Oe]:qs[Oe];if(te.ecmaVersion==="latest")te.ecmaVersion=1e8;else if(te.ecmaVersion==null){if(!Lo&&typeof console==="object"&&console.warn)Lo=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
9
+ Defaulting to 2020, but this will stop working in the future.`);te.ecmaVersion=11}else if(te.ecmaVersion>=2015)te.ecmaVersion-=2009;if(te.allowReserved==null)te.allowReserved=te.ecmaVersion<5;if(!ee||ee.allowHashBang==null)te.allowHashBang=te.ecmaVersion>=14;if(Io(te.onToken)){var Ot=te.onToken;te.onToken=function(jt){return Ot.push(jt)}}if(Io(te.onComment))te.onComment=xl(te,te.onComment);if(te.sourceType==="commonjs"&&te.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return te}function xl(ee,te){return function(Oe,Ot,jt,Vt,Wt,Mt){var Gt={type:Oe?"Block":"Line",value:Ot,start:jt,end:Vt};if(ee.locations)Gt.loc=new ns(this,Wt,Mt);if(ee.ranges)Gt.range=[jt,Vt];te.push(Gt)}}var Zn=1,ei=2,Ys=4,Go=8,Qs=16,Wo=32,is=64,Uo=128,ti=256,wi=512,Ho=1024,ss=Zn|ei|ti;function Zs(ee,te){return ei|(ee?Ys:0)|(te?Go:0)}var Qi=0,er=1,Fn=2,Ko=3,qo=4,zo=5,s=function(ee,te,Oe){this.options=ee=yl(ee),this.sourceFile=ee.sourceFile,this.keywords=Yi(cl[ee.ecmaVersion>=6?6:ee.sourceType==="module"?"5module":5]);var Ot="";if(ee.allowReserved!==!0){if(Ot=Hs[ee.ecmaVersion>=6?6:ee.ecmaVersion===5?5:3],ee.sourceType==="module")Ot+=" await"}this.reservedWords=Yi(Ot);var jt=(Ot?Ot+" ":"")+Hs.strict;if(this.reservedWordsStrict=Yi(jt),this.reservedWordsStrictBind=Yi(jt+" "+Hs.strictBind),this.input=String(te),this.containsEsc=!1,this.pos=Oe||0,this.curLine=1,ee.startLocation)this.lineStart=this.pos-ee.startLocation.column,this.curLine=ee.startLocation.line;else if(Oe){if(this.lineStart=this.input.lastIndexOf(`
10
+ `,Oe-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(En).length}else this.lineStart=0;if(this.type=Kt.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=ee.sourceType==="module",this.strict=this.inModule||ee.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&ee.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?ei:Zn),this.regexpState=null,this.privateNameStack=[]},Tn={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};s.prototype.parse=function(){var ee=this,te=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return ee.parseTopLevel(te)})};Tn.inFunction.get=function(){return(this.currentVarScope().flags&ei)>0};Tn.inGenerator.get=function(){return(this.currentVarScope().flags&Go)>0};Tn.inAsync.get=function(){return(this.currentVarScope().flags&Ys)>0};Tn.canAwait.get=function(){for(var ee=this.scopeStack.length-1;ee>=0;ee--){var te=this.scopeStack[ee],Oe=te.flags;if(Oe&(ti|wi))return!1;if(Oe&ei)return(Oe&Ys)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Tn.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&Zn)return!0;return!1};Tn.allowSuper.get=function(){var ee=this.currentThisScope(),te=ee.flags;return(te&is)>0||this.options.allowSuperOutsideMethod};Tn.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Uo)>0};Tn.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Tn.allowNewDotTarget.get=function(){for(var ee=this.scopeStack.length-1;ee>=0;ee--){var te=this.scopeStack[ee],Oe=te.flags;if(Oe&(ti|wi)||Oe&ei&&!(Oe&Qs))return!0}return!1};Tn.allowUsing.get=function(){var ee=this.currentScope(),te=ee.flags;if(te&Ho)return!1;if(!this.inModule&&te&Zn)return!1;return!0};Tn.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ti)>0};s.extend=function(){var ee=[],te=arguments.length;while(te--)ee[te]=arguments[te];var Oe=this;for(var Ot=0;Ot<ee.length;Ot++)Oe=ee[Ot](Oe);return Oe};s.parse=function(ee,te){return new this(te,ee).parse()};s.parseExpressionAt=function(ee,te,Oe){var Ot=new this(Oe,ee,te);return Ot.nextToken(),Ot.parseExpression()};s.tokenizer=function(ee,te){return new this(te,ee)};Object.defineProperties(s.prototype,Tn);var gn=s.prototype,vl=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;gn.strictDirective=function(ee){if(this.options.ecmaVersion<5)return!1;for(;;){dn.lastIndex=ee,ee+=dn.exec(this.input)[0].length;var te=vl.exec(this.input.slice(ee));if(!te)return!1;if((te[1]||te[2])==="use strict"){dn.lastIndex=ee+te[0].length;var Oe=dn.exec(this.input),Ot=Oe.index+Oe[0].length,jt=this.input.charAt(Ot);return jt===";"||jt==="}"||En.test(Oe[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(jt)||jt==="!"&&this.input.charAt(Ot+1)==="=")}if(ee+=te[0].length,dn.lastIndex=ee,ee+=dn.exec(this.input)[0].length,this.input[ee]===";")ee++}};gn.eat=function(ee){if(this.type===ee)return this.next(),!0;else return!1};gn.isContextual=function(ee){return this.type===Kt.name&&this.value===ee&&!this.containsEsc};gn.eatContextual=function(ee){if(!this.isContextual(ee))return!1;return this.next(),!0};gn.catchStackOverflow=function(ee){try{return ee()}catch(te){if(te instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(te.message)||/\btoo much recursion\b/i.test(te.message)))this.raise(this.start,"Not enough stack space to parse input");else throw te}};gn.expectContextual=function(ee){if(!this.eatContextual(ee))this.unexpected()};gn.canInsertSemicolon=function(){return this.type===Kt.eof||this.type===Kt.braceR||En.test(this.input.slice(this.lastTokEnd,this.start))};gn.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};gn.semicolon=function(){if(!this.eat(Kt.semi)&&!this.insertSemicolon())this.unexpected()};gn.afterTrailingComma=function(ee,te){if(this.type===ee){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!te)this.next();return!0}};gn.expect=function(ee){this.eat(ee)||this.unexpected()};gn.unexpected=function(ee){this.raise(ee!=null?ee:this.start,"Unexpected token")};var rs=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};gn.checkPatternErrors=function(ee,te){if(!ee)return;if(ee.trailingComma>-1)this.raiseRecoverable(ee.trailingComma,"Comma is not permitted after the rest element");var Oe=te?ee.parenthesizedAssign:ee.parenthesizedBind;if(Oe>-1)this.raiseRecoverable(Oe,te?"Assigning to rvalue":"Parenthesized pattern")};gn.checkExpressionErrors=function(ee,te){if(!ee)return!1;var{shorthandAssign:Oe,doubleProto:Ot}=ee;if(!te)return Oe>=0||Ot>=0;if(Oe>=0)this.raise(Oe,"Shorthand property assignments are valid only in destructuring patterns");if(Ot>=0)this.raiseRecoverable(Ot,"Redefinition of __proto__ property")};gn.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos))this.raise(this.yieldPos,"Yield expression cannot be a default value");if(this.awaitPos)this.raise(this.awaitPos,"Await expression cannot be a default value")};gn.isSimpleAssignTarget=function(ee){if(ee.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(ee.expression);return ee.type==="Identifier"||ee.type==="MemberExpression"};var Zt=s.prototype;Zt.parseTopLevel=function(ee){var te=Object.create(null);if(!ee.body)ee.body=[];while(this.type!==Kt.eof){var Oe=this.parseStatement(null,!0,te);ee.body.push(Oe)}if(this.inModule)for(var Ot=0,jt=Object.keys(this.undefinedExports);Ot<jt.length;Ot+=1){var Vt=jt[Ot];this.raiseRecoverable(this.undefinedExports[Vt].start,"Export '"+Vt+"' is not defined")}return this.adaptDirectivePrologue(ee.body),this.next(),ee.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(ee,"Program")};var tr={kind:"loop"},El={kind:"switch"};Zt.isLet=function(ee){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;dn.lastIndex=this.pos;var te=dn.exec(this.input),Oe=this.pos+te[0].length,Ot=this.fullCharCodeAt(Oe);if(Ot===91||Ot===92)return!0;if(ee)return!1;if(Ot===123)return!0;if(g(Ot)){var jt=Oe;do Oe+=Ot<=65535?1:2;while(S(Ot=this.fullCharCodeAt(Oe)));if(Ot===92)return!0;var Vt=this.input.slice(jt,Oe);if(!Fo.test(Vt))return!0}return!1};Zt.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;dn.lastIndex=this.pos;var ee=dn.exec(this.input),te=this.pos+ee[0].length,Oe;return!En.test(this.input.slice(this.pos,te))&&this.input.slice(te,te+8)==="function"&&(te+8===this.input.length||!(S(Oe=this.fullCharCodeAt(te+8))||Oe===92))};Zt.isUsingKeyword=function(ee,te){if(this.options.ecmaVersion<17||!this.isContextual(ee?"await":"using"))return!1;dn.lastIndex=this.pos;var Oe=dn.exec(this.input),Ot=this.pos+Oe[0].length;if(En.test(this.input.slice(this.pos,Ot)))return!1;if(ee){var jt=Ot+5,Vt;if(this.input.slice(Ot,jt)!=="using"||jt===this.input.length||S(Vt=this.fullCharCodeAt(jt))||Vt===92)return!1;dn.lastIndex=jt;var Wt=dn.exec(this.input);if(Ot=jt+Wt[0].length,Wt&&En.test(this.input.slice(jt,Ot)))return!1}var Mt=this.fullCharCodeAt(Ot);if(!g(Mt)&&Mt!==92)return!1;var Gt=Ot;do Ot+=Mt<=65535?1:2;while(S(Mt=this.fullCharCodeAt(Ot)));if(Mt===92)return!0;var Ut=this.input.slice(Gt,Ot);if(Fo.test(Ut))return!1;if(te&&!ee&&Ut==="of"){dn.lastIndex=Ot;var Ht=dn.exec(this.input);if(Ot=Ot+Ht[0].length,this.input.charCodeAt(Ot)!==61||(Mt=this.input.charCodeAt(Ot+1))===61||Mt===62)return!1}return!0};Zt.isAwaitUsing=function(ee){return this.isUsingKeyword(!0,ee)};Zt.isUsing=function(ee){return this.isUsingKeyword(!1,ee)};Zt.parseStatement=function(ee,te,Oe){var Ot=this.type,jt=this.startNode(),Vt;if(this.isLet(ee))Ot=Kt._var,Vt="let";switch(Ot){case Kt._break:case Kt._continue:return this.parseBreakContinueStatement(jt,Ot.keyword);case Kt._debugger:return this.parseDebuggerStatement(jt);case Kt._do:return this.parseDoStatement(jt);case Kt._for:return this.parseForStatement(jt);case Kt._function:if(ee&&(this.strict||ee!=="if"&&ee!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(jt,!1,!ee);case Kt._class:if(ee)this.unexpected();return this.parseClass(jt,!0);case Kt._if:return this.parseIfStatement(jt);case Kt._return:return this.parseReturnStatement(jt);case Kt._switch:return this.parseSwitchStatement(jt);case Kt._throw:return this.parseThrowStatement(jt);case Kt._try:return this.parseTryStatement(jt);case Kt._const:case Kt._var:if(Vt=Vt||this.value,ee&&Vt!=="var")this.unexpected();return this.parseVarStatement(jt,Vt);case Kt._while:return this.parseWhileStatement(jt);case Kt._with:return this.parseWithStatement(jt);case Kt.braceL:return this.parseBlock(!0,jt);case Kt.semi:return this.parseEmptyStatement(jt);case Kt._export:case Kt._import:if(this.options.ecmaVersion>10&&Ot===Kt._import){dn.lastIndex=this.pos;var Wt=dn.exec(this.input),Mt=this.pos+Wt[0].length,Gt=this.input.charCodeAt(Mt);if(Gt===40||Gt===46)return this.parseExpressionStatement(jt,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!te)this.raise(this.start,"'import' and 'export' may only appear at the top level");if(!this.inModule)this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}return Ot===Kt._import?this.parseImport(jt):this.parseExport(jt,Oe);default:if(this.isAsyncFunction()){if(ee)this.unexpected();return this.next(),this.parseFunctionStatement(jt,!0,!ee)}var Ut=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(Ut){if(!this.allowUsing)this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");if(ee)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(Ut==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(jt,!1,Ut),this.semicolon(),this.finishNode(jt,"VariableDeclaration")}var Ht=this.value,qt=this.parseExpression();if(Ot===Kt.name&&qt.type==="Identifier"&&this.eat(Kt.colon))return this.parseLabeledStatement(jt,Ht,qt,ee);else return this.parseExpressionStatement(jt,qt)}};Zt.parseBreakContinueStatement=function(ee,te){var Oe=te==="break";if(this.next(),this.eat(Kt.semi)||this.insertSemicolon())ee.label=null;else if(this.type!==Kt.name)this.unexpected();else ee.label=this.parseIdent(),this.semicolon();var Ot=0;for(;Ot<this.labels.length;++Ot){var jt=this.labels[Ot];if(ee.label==null||jt.name===ee.label.name){if(jt.kind!=null&&(Oe||jt.kind==="loop"))break;if(ee.label&&Oe)break}}if(Ot===this.labels.length)this.raise(ee.start,"Unsyntactic "+te);return this.finishNode(ee,Oe?"BreakStatement":"ContinueStatement")};Zt.parseDebuggerStatement=function(ee){return this.next(),this.semicolon(),this.finishNode(ee,"DebuggerStatement")};Zt.parseDoStatement=function(ee){if(this.next(),this.labels.push(tr),ee.body=this.parseStatement("do"),this.labels.pop(),this.expect(Kt._while),ee.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(Kt.semi);else this.semicolon();return this.finishNode(ee,"DoWhileStatement")};Zt.parseForStatement=function(ee){this.next();var te=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(tr),this.enterScope(0),this.expect(Kt.parenL),this.type===Kt.semi){if(te>-1)this.unexpected(te);return this.parseFor(ee,null)}var Oe=this.isLet();if(this.type===Kt._var||this.type===Kt._const||Oe){var Ot=this.startNode(),jt=Oe?"let":this.value;return this.next(),this.parseVar(Ot,!0,jt),this.finishNode(Ot,"VariableDeclaration"),this.parseForAfterInit(ee,Ot,te)}var Vt=this.isContextual("let"),Wt=!1,Mt=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(Mt){var Gt=this.startNode();if(this.next(),Mt==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(Gt,!0,Mt),this.finishNode(Gt,"VariableDeclaration"),this.parseForAfterInit(ee,Gt,te)}var Ut=this.containsEsc,Ht=new rs,qt=this.start,zt=te>-1?this.parseExprSubscripts(Ht,"await"):this.parseExpression(!0,Ht);if(this.type===Kt._in||(Wt=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(te>-1){if(this.type===Kt._in)this.unexpected(te);ee.await=!0}else if(Wt&&this.options.ecmaVersion>=8){if(zt.start===qt&&!Ut&&zt.type==="Identifier"&&zt.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)ee.await=!1}if(Vt&&Wt)this.raise(zt.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(zt,!1,Ht),this.checkLValPattern(zt),this.parseForIn(ee,zt)}else this.checkExpressionErrors(Ht,!0);if(te>-1)this.unexpected(te);return this.parseFor(ee,zt)};Zt.parseForAfterInit=function(ee,te,Oe){if((this.type===Kt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&te.declarations.length===1){if(this.type===Kt._in){if((te.kind==="using"||te.kind==="await using")&&!te.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&Oe>-1)this.unexpected(Oe)}else if(this.options.ecmaVersion>=9)ee.await=Oe>-1;return this.parseForIn(ee,te)}if(Oe>-1)this.unexpected(Oe);return this.parseFor(ee,te)};Zt.parseFunctionStatement=function(ee,te,Oe){return this.next(),this.parseFunction(ee,Si|(Oe?0:zs),!1,te)};Zt.parseIfStatement=function(ee){return this.next(),ee.test=this.parseParenExpression(),ee.consequent=this.parseStatement("if"),ee.alternate=this.eat(Kt._else)?this.parseStatement("if"):null,this.finishNode(ee,"IfStatement")};Zt.parseReturnStatement=function(ee){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(Kt.semi)||this.insertSemicolon())ee.argument=null;else ee.argument=this.parseExpression(),this.semicolon();return this.finishNode(ee,"ReturnStatement")};Zt.parseSwitchStatement=function(ee){this.next(),ee.discriminant=this.parseParenExpression(),ee.cases=[],this.expect(Kt.braceL),this.labels.push(El),this.enterScope(Ho);var te;for(var Oe=!1;this.type!==Kt.braceR;)if(this.type===Kt._case||this.type===Kt._default){var Ot=this.type===Kt._case;if(te)this.finishNode(te,"SwitchCase");if(ee.cases.push(te=this.startNode()),te.consequent=[],this.next(),Ot)te.test=this.parseExpression();else{if(Oe)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");Oe=!0,te.test=null}this.expect(Kt.colon)}else{if(!te)this.unexpected();te.consequent.push(this.parseStatement(null))}if(this.exitScope(),te)this.finishNode(te,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(ee,"SwitchStatement")};Zt.parseThrowStatement=function(ee){if(this.next(),En.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return ee.argument=this.parseExpression(),this.semicolon(),this.finishNode(ee,"ThrowStatement")};var Sl=[];Zt.parseCatchClauseParam=function(){var ee=this.parseBindingAtom(),te=ee.type==="Identifier";return this.enterScope(te?Wo:0),this.checkLValPattern(ee,te?qo:Fn),this.expect(Kt.parenR),ee};Zt.parseTryStatement=function(ee){if(this.next(),ee.block=this.parseBlock(),ee.handler=null,this.type===Kt._catch){var te=this.startNode();if(this.next(),this.eat(Kt.parenL))te.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();te.param=null,this.enterScope(0)}te.body=this.parseBlock(!1),this.exitScope(),ee.handler=this.finishNode(te,"CatchClause")}if(ee.finalizer=this.eat(Kt._finally)?this.parseBlock():null,!ee.handler&&!ee.finalizer)this.raise(ee.start,"Missing catch or finally clause");return this.finishNode(ee,"TryStatement")};Zt.parseVarStatement=function(ee,te,Oe){return this.next(),this.parseVar(ee,!1,te,Oe),this.semicolon(),this.finishNode(ee,"VariableDeclaration")};Zt.parseWhileStatement=function(ee){return this.next(),ee.test=this.parseParenExpression(),this.labels.push(tr),ee.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(ee,"WhileStatement")};Zt.parseWithStatement=function(ee){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),ee.object=this.parseParenExpression(),ee.body=this.parseStatement("with"),this.finishNode(ee,"WithStatement")};Zt.parseEmptyStatement=function(ee){return this.next(),this.finishNode(ee,"EmptyStatement")};Zt.parseLabeledStatement=function(ee,te,Oe,Ot){for(var jt=0,Vt=this.labels;jt<Vt.length;jt+=1){var Wt=Vt[jt];if(Wt.name===te)this.raise(Oe.start,"Label '"+te+"' is already declared")}var Mt=this.type.isLoop?"loop":this.type===Kt._switch?"switch":null;for(var Gt=this.labels.length-1;Gt>=0;Gt--){var Ut=this.labels[Gt];if(Ut.statementStart===ee.start)Ut.statementStart=this.start,Ut.kind=Mt;else break}return this.labels.push({name:te,kind:Mt,statementStart:this.start}),ee.body=this.parseStatement(Ot?Ot.indexOf("label")===-1?Ot+"label":Ot:"label"),this.labels.pop(),ee.label=Oe,this.finishNode(ee,"LabeledStatement")};Zt.parseExpressionStatement=function(ee,te){return ee.expression=te,this.semicolon(),this.finishNode(ee,"ExpressionStatement")};Zt.parseBlock=function(ee,te,Oe){if(ee===void 0)ee=!0;if(te===void 0)te=this.startNode();if(te.body=[],this.expect(Kt.braceL),ee)this.enterScope(0);while(this.type!==Kt.braceR){var Ot=this.parseStatement(null);te.body.push(Ot)}if(Oe)this.strict=!1;if(this.next(),ee)this.exitScope();return this.finishNode(te,"BlockStatement")};Zt.parseFor=function(ee,te){return ee.init=te,this.expect(Kt.semi),ee.test=this.type===Kt.semi?null:this.parseExpression(),this.expect(Kt.semi),ee.update=this.type===Kt.parenR?null:this.parseExpression(),this.expect(Kt.parenR),ee.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(ee,"ForStatement")};Zt.parseForIn=function(ee,te){var Oe=this.type===Kt._in;if(this.next(),te.type==="VariableDeclaration"&&te.declarations[0].init!=null&&(!Oe||this.options.ecmaVersion<8||this.strict||te.kind!=="var"||te.declarations[0].id.type!=="Identifier"))this.raise(te.start,(Oe?"for-in":"for-of")+" loop variable declaration may not have an initializer");return ee.left=te,ee.right=Oe?this.parseExpression():this.parseMaybeAssign(),this.expect(Kt.parenR),ee.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(ee,Oe?"ForInStatement":"ForOfStatement")};Zt.parseVar=function(ee,te,Oe,Ot){ee.declarations=[],ee.kind=Oe;for(;;){var jt=this.startNode();if(this.parseVarId(jt,Oe),this.eat(Kt.eq))jt.init=this.parseMaybeAssign(te);else if(!Ot&&Oe==="const"&&!(this.type===Kt._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!Ot&&(Oe==="using"||Oe==="await using")&&this.options.ecmaVersion>=17&&this.type!==Kt._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+Oe+" declaration");else if(!Ot&&jt.id.type!=="Identifier"&&!(te&&(this.type===Kt._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else jt.init=null;if(ee.declarations.push(this.finishNode(jt,"VariableDeclarator")),!this.eat(Kt.comma))break}return ee};Zt.parseVarId=function(ee,te){ee.id=te==="using"||te==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(ee.id,te==="var"?er:Fn,!1)};var Si=1,zs=2,Xo=4;Zt.parseFunction=function(ee,te,Oe,Ot,jt){if(this.initFunction(ee),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!Ot){if(this.type===Kt.star&&te&zs)this.unexpected();ee.generator=this.eat(Kt.star)}if(this.options.ecmaVersion>=8)ee.async=!!Ot;if(te&Si){if(ee.id=te&Xo&&this.type!==Kt.name?null:this.parseIdent(),ee.id&&!(te&zs))this.checkLValSimple(ee.id,this.strict||ee.generator||ee.async?this.treatFunctionsAsVar?er:Fn:Ko)}var Vt=this.yieldPos,Wt=this.awaitPos,Mt=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Zs(ee.async,ee.generator)),!(te&Si))ee.id=this.type===Kt.name?this.parseIdent():null;return this.parseFunctionParams(ee),this.parseFunctionBody(ee,Oe,!1,jt),this.yieldPos=Vt,this.awaitPos=Wt,this.awaitIdentPos=Mt,this.finishNode(ee,te&Si?"FunctionDeclaration":"FunctionExpression")};Zt.parseFunctionParams=function(ee){this.expect(Kt.parenL),ee.params=this.parseBindingList(Kt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};Zt.parseClass=function(ee,te){this.next();var Oe=this.strict;this.strict=!0,this.parseClassId(ee,te),this.parseClassSuper(ee);var Ot=this.enterClassBody(),jt=this.startNode(),Vt=!1;jt.body=[],this.expect(Kt.braceL);while(this.type!==Kt.braceR){var Wt=this.parseClassElement(ee.superClass!==null);if(Wt){if(jt.body.push(Wt),Wt.type==="MethodDefinition"&&Wt.kind==="constructor"){if(Vt)this.raiseRecoverable(Wt.start,"Duplicate constructor in the same class");Vt=!0}else if(Wt.key&&Wt.key.type==="PrivateIdentifier"&&bl(Ot,Wt))this.raiseRecoverable(Wt.key.start,"Identifier '#"+Wt.key.name+"' has already been declared")}}return this.strict=Oe,this.next(),ee.body=this.finishNode(jt,"ClassBody"),this.exitClassBody(),this.finishNode(ee,te?"ClassDeclaration":"ClassExpression")};Zt.parseClassElement=function(ee){if(this.eat(Kt.semi))return null;var te=this.options.ecmaVersion,Oe=this.startNode(),Ot="",jt=!1,Vt=!1,Wt="method",Mt=!1;if(this.eatContextual("static")){if(te>=13&&this.eat(Kt.braceL))return this.parseClassStaticBlock(Oe),Oe;if(this.isClassElementNameStart()||this.type===Kt.star)Mt=!0;else Ot="static"}if(Oe.static=Mt,!Ot&&te>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===Kt.star)&&!this.canInsertSemicolon())Vt=!0;else Ot="async";if(!Ot&&(te>=9||!Vt)&&this.eat(Kt.star))jt=!0;if(!Ot&&!Vt&&!jt){var Gt=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())Wt=Gt;else Ot=Gt}if(Ot)Oe.computed=!1,Oe.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Oe.key.name=Ot,this.finishNode(Oe.key,"Identifier");else this.parseClassElementName(Oe);if(te<13||this.type===Kt.parenL||Wt!=="method"||jt||Vt){var Ut=!Oe.static&&Zi(Oe,"constructor"),Ht=Ut&&ee;if(Ut&&Wt!=="method")this.raise(Oe.key.start,"Constructor can't have get/set modifier");Oe.kind=Ut?"constructor":Wt,this.parseClassMethod(Oe,jt,Vt,Ht)}else this.parseClassField(Oe);return Oe};Zt.isClassElementNameStart=function(){return this.type===Kt.name||this.type===Kt.privateId||this.type===Kt.num||this.type===Kt.string||this.type===Kt.bracketL||this.type.keyword};Zt.parseClassElementName=function(ee){if(this.type===Kt.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");ee.computed=!1,ee.key=this.parsePrivateIdent()}else this.parsePropertyName(ee)};Zt.parseClassMethod=function(ee,te,Oe,Ot){var jt=ee.key;if(ee.kind==="constructor"){if(te)this.raise(jt.start,"Constructor can't be a generator");if(Oe)this.raise(jt.start,"Constructor can't be an async method")}else if(ee.static&&Zi(ee,"prototype"))this.raise(jt.start,"Classes may not have a static property named prototype");var Vt=ee.value=this.parseMethod(te,Oe,Ot);if(ee.kind==="get"&&Vt.params.length!==0)this.raiseRecoverable(Vt.start,"getter should have no params");if(ee.kind==="set"&&Vt.params.length!==1)this.raiseRecoverable(Vt.start,"setter should have exactly one param");if(ee.kind==="set"&&Vt.params[0].type==="RestElement")this.raiseRecoverable(Vt.params[0].start,"Setter cannot use rest params");return this.finishNode(ee,"MethodDefinition")};Zt.parseClassField=function(ee){if(Zi(ee,"constructor"))this.raise(ee.key.start,"Classes can't have a field named 'constructor'");else if(ee.static&&Zi(ee,"prototype"))this.raise(ee.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(Kt.eq))this.enterScope(wi|is),ee.value=this.parseMaybeAssign(),this.exitScope();else ee.value=null;return this.semicolon(),this.finishNode(ee,"PropertyDefinition")};Zt.parseClassStaticBlock=function(ee){ee.body=[];var te=this.labels;this.labels=[],this.enterScope(ti|is);while(this.type!==Kt.braceR){var Oe=this.parseStatement(null);ee.body.push(Oe)}return this.next(),this.exitScope(),this.labels=te,this.finishNode(ee,"StaticBlock")};Zt.parseClassId=function(ee,te){if(this.type===Kt.name){if(ee.id=this.parseIdent(),te)this.checkLValSimple(ee.id,Fn,!1)}else{if(te===!0)this.unexpected();ee.id=null}};Zt.parseClassSuper=function(ee){ee.superClass=this.eat(Kt._extends)?this.parseExprSubscripts(null,!1):null};Zt.enterClassBody=function(){var ee={declared:Object.create(null),used:[]};return this.privateNameStack.push(ee),ee.declared};Zt.exitClassBody=function(){var ee=this.privateNameStack.pop(),{declared:te,used:Oe}=ee;if(!this.options.checkPrivateFields)return;var Ot=this.privateNameStack.length,jt=Ot===0?null:this.privateNameStack[Ot-1];for(var Vt=0;Vt<Oe.length;++Vt){var Wt=Oe[Vt];if(!Ci(te,Wt.name))if(jt)jt.used.push(Wt);else this.raiseRecoverable(Wt.start,"Private field '#"+Wt.name+"' must be declared in an enclosing class")}};function bl(ee,te){var Oe=te.key.name,Ot=ee[Oe],jt="true";if(te.type==="MethodDefinition"&&(te.kind==="get"||te.kind==="set"))jt=(te.static?"s":"i")+te.kind;if(Ot==="iget"&&jt==="iset"||Ot==="iset"&&jt==="iget"||Ot==="sget"&&jt==="sset"||Ot==="sset"&&jt==="sget")return ee[Oe]="true",!1;else if(!Ot)return ee[Oe]=jt,!1;else return!0}function Zi(ee,te){var{computed:Oe,key:Ot}=ee;return!Oe&&(Ot.type==="Identifier"&&Ot.name===te||Ot.type==="Literal"&&Ot.value===te)}Zt.parseExportAllDeclaration=function(ee,te){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))ee.exported=this.parseModuleExportName(),this.checkExport(te,ee.exported,this.lastTokStart);else ee.exported=null;if(this.expectContextual("from"),this.type!==Kt.string)this.unexpected();if(ee.source=this.parseExprAtom(),this.options.ecmaVersion>=16)ee.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(ee,"ExportAllDeclaration")};Zt.parseExport=function(ee,te){if(this.next(),this.eat(Kt.star))return this.parseExportAllDeclaration(ee,te);if(this.eat(Kt._default))return this.checkExport(te,"default",this.lastTokStart),ee.declaration=this.parseExportDefaultDeclaration(),this.finishNode(ee,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(ee.declaration=this.parseExportDeclaration(ee),ee.declaration.type==="VariableDeclaration")this.checkVariableExport(te,ee.declaration.declarations);else this.checkExport(te,ee.declaration.id,ee.declaration.id.start);if(ee.specifiers=[],ee.source=null,this.options.ecmaVersion>=16)ee.attributes=[]}else{if(ee.declaration=null,ee.specifiers=this.parseExportSpecifiers(te),this.eatContextual("from")){if(this.type!==Kt.string)this.unexpected();if(ee.source=this.parseExprAtom(),this.options.ecmaVersion>=16)ee.attributes=this.parseWithClause()}else{for(var Oe=0,Ot=ee.specifiers;Oe<Ot.length;Oe+=1){var jt=Ot[Oe];if(this.checkUnreserved(jt.local),this.checkLocalExport(jt.local),jt.local.type==="Literal")this.raise(jt.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(ee.source=null,this.options.ecmaVersion>=16)ee.attributes=[]}this.semicolon()}return this.finishNode(ee,"ExportNamedDeclaration")};Zt.parseExportDeclaration=function(ee){return this.parseStatement(null)};Zt.parseExportDefaultDeclaration=function(){var ee;if(this.type===Kt._function||(ee=this.isAsyncFunction())){var te=this.startNode();if(this.next(),ee)this.next();return this.parseFunction(te,Si|Xo,!1,ee)}else if(this.type===Kt._class){var Oe=this.startNode();return this.parseClass(Oe,"nullableID")}else{var Ot=this.parseMaybeAssign();return this.semicolon(),Ot}};Zt.checkExport=function(ee,te,Oe){if(!ee)return;if(typeof te!=="string")te=te.type==="Identifier"?te.name:te.value;if(Ci(ee,te))this.raiseRecoverable(Oe,"Duplicate export '"+te+"'");ee[te]=!0};Zt.checkPatternExport=function(ee,te){var Oe=te.type;if(Oe==="Identifier")this.checkExport(ee,te,te.start);else if(Oe==="ObjectPattern")for(var Ot=0,jt=te.properties;Ot<jt.length;Ot+=1){var Vt=jt[Ot];this.checkPatternExport(ee,Vt)}else if(Oe==="ArrayPattern")for(var Wt=0,Mt=te.elements;Wt<Mt.length;Wt+=1){var Gt=Mt[Wt];if(Gt)this.checkPatternExport(ee,Gt)}else if(Oe==="Property")this.checkPatternExport(ee,te.value);else if(Oe==="AssignmentPattern")this.checkPatternExport(ee,te.left);else if(Oe==="RestElement")this.checkPatternExport(ee,te.argument)};Zt.checkVariableExport=function(ee,te){if(!ee)return;for(var Oe=0,Ot=te;Oe<Ot.length;Oe+=1){var jt=Ot[Oe];this.checkPatternExport(ee,jt.id)}};Zt.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};Zt.parseExportSpecifier=function(ee){var te=this.startNode();return te.local=this.parseModuleExportName(),te.exported=this.eatContextual("as")?this.parseModuleExportName():te.local,this.checkExport(ee,te.exported,te.exported.start),this.finishNode(te,"ExportSpecifier")};Zt.parseExportSpecifiers=function(ee){var te=[],Oe=!0;this.expect(Kt.braceL);while(!this.eat(Kt.braceR)){if(!Oe){if(this.expect(Kt.comma),this.afterTrailingComma(Kt.braceR))break}else Oe=!1;te.push(this.parseExportSpecifier(ee))}return te};Zt.parseImport=function(ee){if(this.next(),this.type===Kt.string)ee.specifiers=Sl,ee.source=this.parseExprAtom();else ee.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),ee.source=this.type===Kt.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)ee.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(ee,"ImportDeclaration")};Zt.parseImportSpecifier=function(){var ee=this.startNode();if(ee.imported=this.parseModuleExportName(),this.eatContextual("as"))ee.local=this.parseIdent();else this.checkUnreserved(ee.imported),ee.local=ee.imported;return this.checkLValSimple(ee.local,Fn),this.finishNode(ee,"ImportSpecifier")};Zt.parseImportDefaultSpecifier=function(){var ee=this.startNode();return ee.local=this.parseIdent(),this.checkLValSimple(ee.local,Fn),this.finishNode(ee,"ImportDefaultSpecifier")};Zt.parseImportNamespaceSpecifier=function(){var ee=this.startNode();return this.next(),this.expectContextual("as"),ee.local=this.parseIdent(),this.checkLValSimple(ee.local,Fn),this.finishNode(ee,"ImportNamespaceSpecifier")};Zt.parseImportSpecifiers=function(){var ee=[],te=!0;if(this.type===Kt.name){if(ee.push(this.parseImportDefaultSpecifier()),!this.eat(Kt.comma))return ee}if(this.type===Kt.star)return ee.push(this.parseImportNamespaceSpecifier()),ee;this.expect(Kt.braceL);while(!this.eat(Kt.braceR)){if(!te){if(this.expect(Kt.comma),this.afterTrailingComma(Kt.braceR))break}else te=!1;ee.push(this.parseImportSpecifier())}return ee};Zt.parseWithClause=function(){var ee=[];if(!this.eat(Kt._with))return ee;this.expect(Kt.braceL);var te={},Oe=!0;while(!this.eat(Kt.braceR)){if(!Oe){if(this.expect(Kt.comma),this.afterTrailingComma(Kt.braceR))break}else Oe=!1;var Ot=this.parseImportAttribute(),jt=Ot.key.type==="Identifier"?Ot.key.name:Ot.key.value;if(Ci(te,jt))this.raiseRecoverable(Ot.key.start,"Duplicate attribute key '"+jt+"'");te[jt]=!0,ee.push(Ot)}return ee};Zt.parseImportAttribute=function(){var ee=this.startNode();if(ee.key=this.type===Kt.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(Kt.colon),this.type!==Kt.string)this.unexpected();return ee.value=this.parseExprAtom(),this.finishNode(ee,"ImportAttribute")};Zt.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Kt.string){var ee=this.parseLiteral(this.value);if(gl.test(ee.value))this.raise(ee.start,"An export name cannot include a lone surrogate.");return ee}return this.parseIdent(!0)};Zt.adaptDirectivePrologue=function(ee){for(var te=0;te<ee.length&&this.isDirectiveCandidate(ee[te]);++te)ee[te].directive=ee[te].expression.raw.slice(1,-1)};Zt.isDirectiveCandidate=function(ee){return this.options.ecmaVersion>=5&&ee.type==="ExpressionStatement"&&ee.expression.type==="Literal"&&typeof ee.expression.value==="string"&&(this.input[ee.start]==='"'||this.input[ee.start]==="'")};var kn=s.prototype;kn.toAssignable=function(ee,te,Oe){if(this.options.ecmaVersion>=6&&ee)switch(ee.type){case"Identifier":if(this.inAsync&&ee.name==="await")this.raise(ee.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(ee.type="ObjectPattern",Oe)this.checkPatternErrors(Oe,!0);for(var Ot=0,jt=ee.properties;Ot<jt.length;Ot+=1){var Vt=jt[Ot];if(this.toAssignable(Vt,te),Vt.type==="RestElement"&&(Vt.argument.type==="ArrayPattern"||Vt.argument.type==="ObjectPattern"))this.raise(Vt.argument.start,"Unexpected token")}break;case"Property":if(ee.kind!=="init")this.raise(ee.key.start,"Object pattern can't contain getter or setter");this.toAssignable(ee.value,te);break;case"ArrayExpression":if(ee.type="ArrayPattern",Oe)this.checkPatternErrors(Oe,!0);this.toAssignableList(ee.elements,te);break;case"SpreadElement":if(ee.type="RestElement",this.toAssignable(ee.argument,te),ee.argument.type==="AssignmentPattern")this.raise(ee.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(ee.operator!=="=")this.raise(ee.left.end,"Only '=' operator can be used for specifying default value.");ee.type="AssignmentPattern",delete ee.operator,this.toAssignable(ee.left,te);break;case"ParenthesizedExpression":this.toAssignable(ee.expression,te,Oe);break;case"ChainExpression":this.raiseRecoverable(ee.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!te)break;default:this.raise(ee.start,"Assigning to rvalue")}else if(Oe)this.checkPatternErrors(Oe,!0);return ee};kn.toAssignableList=function(ee,te){var Oe=ee.length;for(var Ot=0;Ot<Oe;Ot++){var jt=ee[Ot];if(jt)this.toAssignable(jt,te)}if(Oe){var Vt=ee[Oe-1];if(this.options.ecmaVersion===6&&te&&Vt&&Vt.type==="RestElement"&&Vt.argument.type!=="Identifier")this.unexpected(Vt.argument.start)}return ee};kn.parseSpread=function(ee){var te=this.startNode();return this.next(),te.argument=this.parseMaybeAssign(!1,ee),this.finishNode(te,"SpreadElement")};kn.parseRestBinding=function(){var ee=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==Kt.name)this.unexpected();return ee.argument=this.parseBindingAtom(),this.finishNode(ee,"RestElement")};kn.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Kt.bracketL:var ee=this.startNode();return this.next(),ee.elements=this.parseBindingList(Kt.bracketR,!0,!0),this.finishNode(ee,"ArrayPattern");case Kt.braceL:return this.parseObj(!0)}return this.parseIdent()};kn.parseBindingList=function(ee,te,Oe,Ot){var jt=[],Vt=!0;while(!this.eat(ee)){if(Vt)Vt=!1;else this.expect(Kt.comma);if(te&&this.type===Kt.comma)jt.push(null);else if(Oe&&this.afterTrailingComma(ee))break;else if(this.type===Kt.ellipsis){var Wt=this.parseRestBinding();if(this.parseBindingListItem(Wt),jt.push(Wt),this.type===Kt.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(ee);break}else jt.push(this.parseAssignableListItem(Ot))}return jt};kn.parseAssignableListItem=function(ee){var te=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(te),te};kn.parseBindingListItem=function(ee){return ee};kn.parseMaybeDefault=function(ee,te,Oe){if(Oe=Oe||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Kt.eq))return Oe;var Ot=this.startNodeAt(ee,te);return Ot.left=Oe,Ot.right=this.parseMaybeAssign(),this.finishNode(Ot,"AssignmentPattern")};kn.checkLValSimple=function(ee,te,Oe){if(te===void 0)te=Qi;var Ot=te!==Qi;switch(ee.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(ee.name))this.raiseRecoverable(ee.start,(Ot?"Binding ":"Assigning to ")+ee.name+" in strict mode");if(Ot){if(te===Fn&&ee.name==="let")this.raiseRecoverable(ee.start,"let is disallowed as a lexically bound name");if(Oe){if(Ci(Oe,ee.name))this.raiseRecoverable(ee.start,"Argument name clash");Oe[ee.name]=!0}if(te!==zo)this.declareName(ee.name,te,ee.start)}break;case"ChainExpression":this.raiseRecoverable(ee.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(Ot)this.raiseRecoverable(ee.start,"Binding member expression");break;case"ParenthesizedExpression":if(Ot)this.raiseRecoverable(ee.start,"Binding parenthesized expression");return this.checkLValSimple(ee.expression,te,Oe);default:this.raise(ee.start,(Ot?"Binding":"Assigning to")+" rvalue")}};kn.checkLValPattern=function(ee,te,Oe){if(te===void 0)te=Qi;switch(ee.type){case"ObjectPattern":for(var Ot=0,jt=ee.properties;Ot<jt.length;Ot+=1){var Vt=jt[Ot];this.checkLValInnerPattern(Vt,te,Oe)}break;case"ArrayPattern":for(var Wt=0,Mt=ee.elements;Wt<Mt.length;Wt+=1){var Gt=Mt[Wt];if(Gt)this.checkLValInnerPattern(Gt,te,Oe)}break;default:this.checkLValSimple(ee,te,Oe)}};kn.checkLValInnerPattern=function(ee,te,Oe){if(te===void 0)te=Qi;switch(ee.type){case"Property":this.checkLValInnerPattern(ee.value,te,Oe);break;case"AssignmentPattern":this.checkLValPattern(ee.left,te,Oe);break;case"RestElement":this.checkLValPattern(ee.argument,te,Oe);break;default:this.checkLValPattern(ee,te,Oe)}};var Pn=function(ee,te,Oe,Ot,jt){this.token=ee,this.isExpr=!!te,this.preserveSpace=!!Oe,this.override=Ot,this.generator=!!jt},ln={b_stat:new Pn("{",!1),b_expr:new Pn("{",!0),b_tmpl:new Pn("${",!1),p_stat:new Pn("(",!1),p_expr:new Pn("(",!0),q_tmpl:new Pn("`",!0,!0,function(ee){return ee.tryReadTemplateToken()}),f_stat:new Pn("function",!1),f_expr:new Pn("function",!0),f_expr_gen:new Pn("function",!0,!1,null,!0),f_gen:new Pn("function",!1,!1,null,!0)},hi=s.prototype;hi.initialContext=function(){return[ln.b_stat]};hi.curContext=function(){return this.context[this.context.length-1]};hi.braceIsBlock=function(ee){var te=this.curContext();if(te===ln.f_expr||te===ln.f_stat)return!0;if(ee===Kt.colon&&(te===ln.b_stat||te===ln.b_expr))return!te.isExpr;if(ee===Kt._return||ee===Kt.name&&this.exprAllowed)return En.test(this.input.slice(this.lastTokEnd,this.start));if(ee===Kt._else||ee===Kt.semi||ee===Kt.eof||ee===Kt.parenR||ee===Kt.arrow)return!0;if(ee===Kt.braceL)return te===ln.b_stat;if(ee===Kt._var||ee===Kt._const||ee===Kt.name)return!1;return!this.exprAllowed};hi.inGeneratorContext=function(){for(var ee=this.context.length-1;ee>=1;ee--){var te=this.context[ee];if(te.token==="function")return te.generator}return!1};hi.updateContext=function(ee){var te,Oe=this.type;if(Oe.keyword&&ee===Kt.dot)this.exprAllowed=!1;else if(te=Oe.updateContext)te.call(this,ee);else this.exprAllowed=Oe.beforeExpr};hi.overrideContext=function(ee){if(this.curContext()!==ee)this.context[this.context.length-1]=ee};Kt.parenR.updateContext=Kt.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var ee=this.context.pop();if(ee===ln.b_stat&&this.curContext().token==="function")ee=this.context.pop();this.exprAllowed=!ee.isExpr};Kt.braceL.updateContext=function(ee){this.context.push(this.braceIsBlock(ee)?ln.b_stat:ln.b_expr),this.exprAllowed=!0};Kt.dollarBraceL.updateContext=function(){this.context.push(ln.b_tmpl),this.exprAllowed=!0};Kt.parenL.updateContext=function(ee){var te=ee===Kt._if||ee===Kt._for||ee===Kt._with||ee===Kt._while;this.context.push(te?ln.p_stat:ln.p_expr),this.exprAllowed=!0};Kt.incDec.updateContext=function(){};Kt._function.updateContext=Kt._class.updateContext=function(ee){if(ee.beforeExpr&&ee!==Kt._else&&!(ee===Kt.semi&&this.curContext()!==ln.p_stat)&&!(ee===Kt._return&&En.test(this.input.slice(this.lastTokEnd,this.start)))&&!((ee===Kt.colon||ee===Kt.braceL)&&this.curContext()===ln.b_stat))this.context.push(ln.f_expr);else this.context.push(ln.f_stat);this.exprAllowed=!1};Kt.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};Kt.backQuote.updateContext=function(){if(this.curContext()===ln.q_tmpl)this.context.pop();else this.context.push(ln.q_tmpl);this.exprAllowed=!1};Kt.star.updateContext=function(ee){if(ee===Kt._function){var te=this.context.length-1;if(this.context[te]===ln.f_expr)this.context[te]=ln.f_expr_gen;else this.context[te]=ln.f_gen}this.exprAllowed=!0};Kt.name.updateContext=function(ee){var te=!1;if(this.options.ecmaVersion>=6&&ee!==Kt.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())te=!0}this.exprAllowed=te};var tn=s.prototype;tn.checkPropClash=function(ee,te,Oe){if(this.options.ecmaVersion>=9&&ee.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(ee.computed||ee.method||ee.shorthand))return;var Ot=ee.key,jt;switch(Ot.type){case"Identifier":jt=Ot.name;break;case"Literal":jt=String(Ot.value);break;default:return}var Vt=ee.kind;if(this.options.ecmaVersion>=6){if(jt==="__proto__"&&Vt==="init"){if(te.proto)if(Oe){if(Oe.doubleProto<0)Oe.doubleProto=Ot.start}else this.raiseRecoverable(Ot.start,"Redefinition of __proto__ property");te.proto=!0}return}jt="$"+jt;var Wt=te[jt];if(Wt){var Mt;if(Vt==="init")Mt=this.strict&&Wt.init||Wt.get||Wt.set;else Mt=Wt.init||Wt[Vt];if(Mt)this.raiseRecoverable(Ot.start,"Redefinition of property")}else Wt=te[jt]={init:!1,get:!1,set:!1};Wt[Vt]=!0};tn.parseExpression=function(ee,te){var Oe=this;return this.catchStackOverflow(function(){var{start:Ot,startLoc:jt}=Oe,Vt=Oe.parseMaybeAssign(ee,te);if(Oe.type===Kt.comma){var Wt=Oe.startNodeAt(Ot,jt);Wt.expressions=[Vt];while(Oe.eat(Kt.comma))Wt.expressions.push(Oe.parseMaybeAssign(ee,te));return Oe.finishNode(Wt,"SequenceExpression")}return Vt})};tn.parseMaybeAssign=function(ee,te,Oe){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(ee);else this.exprAllowed=!1;var Ot=!1,jt=-1,Vt=-1,Wt=-1;if(te)jt=te.parenthesizedAssign,Vt=te.trailingComma,Wt=te.doubleProto,te.parenthesizedAssign=te.trailingComma=-1;else te=new rs,Ot=!0;var Mt=this.start,Gt=this.startLoc;if(this.type===Kt.parenL||this.type===Kt.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=ee==="await";var Ut=this.parseMaybeConditional(ee,te);if(Oe)Ut=Oe.call(this,Ut,Mt,Gt);if(this.type.isAssign){var Ht=this.startNodeAt(Mt,Gt);if(Ht.operator=this.value,this.type===Kt.eq)Ut=this.toAssignable(Ut,!1,te);if(!Ot)te.parenthesizedAssign=te.trailingComma=te.doubleProto=-1;if(te.shorthandAssign>=Ut.start)te.shorthandAssign=-1;if(this.type===Kt.eq)this.checkLValPattern(Ut);else this.checkLValSimple(Ut);if(Ht.left=Ut,this.next(),Ht.right=this.parseMaybeAssign(ee),Wt>-1)te.doubleProto=Wt;return this.finishNode(Ht,"AssignmentExpression")}else if(Ot)this.checkExpressionErrors(te,!0);if(jt>-1)te.parenthesizedAssign=jt;if(Vt>-1)te.trailingComma=Vt;return Ut};tn.parseMaybeConditional=function(ee,te){var Oe=this.start,Ot=this.startLoc,jt=this.parseExprOps(ee,te);if(this.checkExpressionErrors(te))return jt;if(!(jt.type==="ArrowFunctionExpression"&&jt.start===Oe)&&this.eat(Kt.question)){var Vt=this.startNodeAt(Oe,Ot);return Vt.test=jt,Vt.consequent=this.parseMaybeAssign(),this.expect(Kt.colon),Vt.alternate=this.parseMaybeAssign(ee),this.finishNode(Vt,"ConditionalExpression")}return jt};tn.parseExprOps=function(ee,te){var Oe=this.start,Ot=this.startLoc,jt=this.parseMaybeUnary(te,!1,!1,ee);if(this.checkExpressionErrors(te))return jt;return jt.start===Oe&&jt.type==="ArrowFunctionExpression"?jt:this.parseExprOp(jt,Oe,Ot,-1,ee)};tn.parseExprOp=function(ee,te,Oe,Ot,jt){var Vt=this.type.binop;if(Vt!=null&&(!jt||this.type!==Kt._in)){if(Vt>Ot){var Wt=this.type===Kt.logicalOR||this.type===Kt.logicalAND,Mt=this.type===Kt.coalesce;if(Mt)Vt=Kt.logicalAND.binop;var Gt=this.value;this.next();var Ut=this.start,Ht=this.startLoc,qt=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,jt),Ut,Ht,Vt,jt),zt=this.buildBinary(te,Oe,ee,qt,Gt,Wt||Mt);if(Wt&&this.type===Kt.coalesce||Mt&&(this.type===Kt.logicalOR||this.type===Kt.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(zt,te,Oe,Ot,jt)}}return ee};tn.buildBinary=function(ee,te,Oe,Ot,jt,Vt){if(Ot.type==="PrivateIdentifier")this.raise(Ot.start,"Private identifier can only be left side of binary expression");var Wt=this.startNodeAt(ee,te);return Wt.left=Oe,Wt.operator=jt,Wt.right=Ot,this.finishNode(Wt,Vt?"LogicalExpression":"BinaryExpression")};tn.parseMaybeUnary=function(ee,te,Oe,Ot){var jt=this.start,Vt=this.startLoc,Wt;if(this.isContextual("await")&&this.canAwait)Wt=this.parseAwait(Ot),te=!0;else if(this.type.prefix){var Mt=this.startNode(),Gt=this.type===Kt.incDec;if(Mt.operator=this.value,Mt.prefix=!0,this.next(),Mt.argument=this.parseMaybeUnary(null,!0,Gt,Ot),this.checkExpressionErrors(ee,!0),Gt)this.checkLValSimple(Mt.argument);else if(this.strict&&Mt.operator==="delete"&&Jo(Mt.argument))this.raiseRecoverable(Mt.start,"Deleting local variable in strict mode");else if(Mt.operator==="delete"&&Xs(Mt.argument))this.raiseRecoverable(Mt.start,"Private fields can not be deleted");else te=!0;Wt=this.finishNode(Mt,Gt?"UpdateExpression":"UnaryExpression")}else if(!te&&this.type===Kt.privateId){if((Ot||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(Wt=this.parsePrivateIdent(),this.type!==Kt._in)this.unexpected()}else{if(Wt=this.parseExprSubscripts(ee,Ot),this.checkExpressionErrors(ee))return Wt;while(this.type.postfix&&!this.canInsertSemicolon()){var Ut=this.startNodeAt(jt,Vt);Ut.operator=this.value,Ut.prefix=!1,Ut.argument=Wt,this.checkLValSimple(Wt),this.next(),Wt=this.finishNode(Ut,"UpdateExpression")}}if(!Oe&&!(Wt.type==="ArrowFunctionExpression"&&Wt.start===jt)&&this.eat(Kt.starstar))if(te)this.unexpected(this.lastTokStart);else return this.buildBinary(jt,Vt,Wt,this.parseMaybeUnary(null,!1,!1,Ot),"**",!1);else return Wt};function Jo(ee){return ee.type==="Identifier"||ee.type==="ParenthesizedExpression"&&Jo(ee.expression)}function Xs(ee){return ee.type==="MemberExpression"&&ee.property.type==="PrivateIdentifier"||ee.type==="ChainExpression"&&Xs(ee.expression)||ee.type==="ParenthesizedExpression"&&Xs(ee.expression)}tn.parseExprSubscripts=function(ee,te){var Oe=this.start,Ot=this.startLoc,jt=this.parseExprAtom(ee,te);if(jt.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return jt;var Vt=this.parseSubscripts(jt,Oe,Ot,!1,te);if(ee&&Vt.type==="MemberExpression"){if(ee.parenthesizedAssign>=Vt.start)ee.parenthesizedAssign=-1;if(ee.parenthesizedBind>=Vt.start)ee.parenthesizedBind=-1;if(ee.trailingComma>=Vt.start)ee.trailingComma=-1}return Vt};tn.parseSubscripts=function(ee,te,Oe,Ot,jt){var Vt=this.options.ecmaVersion>=8&&ee.type==="Identifier"&&ee.name==="async"&&this.lastTokEnd===ee.end&&!this.canInsertSemicolon()&&ee.end-ee.start===5&&this.potentialArrowAt===ee.start,Wt=!1;while(!0){var Mt=this.parseSubscript(ee,te,Oe,Ot,Vt,Wt,jt);if(Mt.optional)Wt=!0;if(Mt===ee||Mt.type==="ArrowFunctionExpression"){if(Wt){var Gt=this.startNodeAt(te,Oe);Gt.expression=Mt,Mt=this.finishNode(Gt,"ChainExpression")}return Mt}ee=Mt}};tn.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(Kt.arrow)};tn.parseSubscriptAsyncArrow=function(ee,te,Oe,Ot){return this.parseArrowExpression(this.startNodeAt(ee,te),Oe,!0,Ot)};tn.parseSubscript=function(ee,te,Oe,Ot,jt,Vt,Wt){var Mt=this.options.ecmaVersion>=11,Gt=Mt&&this.eat(Kt.questionDot);if(Ot&&Gt)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var Ut=this.eat(Kt.bracketL);if(Ut||Gt&&this.type!==Kt.parenL&&this.type!==Kt.backQuote||this.eat(Kt.dot)){var Ht=this.startNodeAt(te,Oe);if(Ht.object=ee,Ut)Ht.property=this.parseExpression(),this.expect(Kt.bracketR);else if(this.type===Kt.privateId&&ee.type!=="Super")Ht.property=this.parsePrivateIdent();else Ht.property=this.parseIdent(this.options.allowReserved!=="never");if(Ht.computed=!!Ut,Mt)Ht.optional=Gt;ee=this.finishNode(Ht,"MemberExpression")}else if(!Ot&&this.eat(Kt.parenL)){var qt=new rs,zt=this.yieldPos,Xt=this.awaitPos,Jt=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Qt=this.parseExprList(Kt.parenR,this.options.ecmaVersion>=8,!1,qt);if(jt&&!Gt&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(qt,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=zt,this.awaitPos=Xt,this.awaitIdentPos=Jt,this.parseSubscriptAsyncArrow(te,Oe,Qt,Wt)}this.checkExpressionErrors(qt,!0),this.yieldPos=zt||this.yieldPos,this.awaitPos=Xt||this.awaitPos,this.awaitIdentPos=Jt||this.awaitIdentPos;var Yt=this.startNodeAt(te,Oe);if(Yt.callee=ee,Yt.arguments=Qt,Mt)Yt.optional=Gt;ee=this.finishNode(Yt,"CallExpression")}else if(this.type===Kt.backQuote){if(Gt||Vt)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var nn=this.startNodeAt(te,Oe);nn.tag=ee,nn.quasi=this.parseTemplate({isTagged:!0}),ee=this.finishNode(nn,"TaggedTemplateExpression")}return ee};tn.parseExprAtom=function(ee,te,Oe){if(this.type===Kt.slash)this.readRegexp();var Ot,jt=this.potentialArrowAt===this.start;switch(this.type){case Kt._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(Ot=this.startNode(),this.next(),this.type===Kt.parenL&&!this.allowDirectSuper)this.raise(Ot.start,"super() call outside constructor of a subclass");if(this.type!==Kt.dot&&this.type!==Kt.bracketL&&this.type!==Kt.parenL)this.unexpected();return this.finishNode(Ot,"Super");case Kt._this:return Ot=this.startNode(),this.next(),this.finishNode(Ot,"ThisExpression");case Kt.name:var Vt=this.start,Wt=this.startLoc,Mt=this.containsEsc,Gt=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Mt&&Gt.name==="async"&&!this.canInsertSemicolon()&&this.eat(Kt._function))return this.overrideContext(ln.f_expr),this.parseFunction(this.startNodeAt(Vt,Wt),0,!1,!0,te);if(jt&&!this.canInsertSemicolon()){if(this.eat(Kt.arrow))return this.parseArrowExpression(this.startNodeAt(Vt,Wt),[Gt],!1,te);if(this.options.ecmaVersion>=8&&Gt.name==="async"&&this.type===Kt.name&&!Mt&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(Gt=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(Kt.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(Vt,Wt),[Gt],!0,te)}}return Gt;case Kt.regexp:var Ut=this.value;return Ot=this.parseLiteral(Ut.value),Ot.regex={pattern:Ut.pattern,flags:Ut.flags},Ot;case Kt.num:case Kt.string:return this.parseLiteral(this.value);case Kt._null:case Kt._true:case Kt._false:return Ot=this.startNode(),Ot.value=this.type===Kt._null?null:this.type===Kt._true,Ot.raw=this.type.keyword,this.next(),this.finishNode(Ot,"Literal");case Kt.parenL:var Ht=this.start,qt=this.parseParenAndDistinguishExpression(jt,te);if(ee){if(ee.parenthesizedAssign<0&&!this.isSimpleAssignTarget(qt))ee.parenthesizedAssign=Ht;if(ee.parenthesizedBind<0)ee.parenthesizedBind=Ht}return qt;case Kt.bracketL:return Ot=this.startNode(),this.next(),Ot.elements=this.parseExprList(Kt.bracketR,!0,!0,ee),this.finishNode(Ot,"ArrayExpression");case Kt.braceL:return this.overrideContext(ln.b_expr),this.parseObj(!1,ee);case Kt._function:return Ot=this.startNode(),this.next(),this.parseFunction(Ot,0);case Kt._class:return this.parseClass(this.startNode(),!1);case Kt._new:return this.parseNew();case Kt.backQuote:return this.parseTemplate();case Kt._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(Oe);else return this.unexpected();default:return this.parseExprAtomDefault()}};tn.parseExprAtomDefault=function(){this.unexpected()};tn.parseExprImport=function(ee){var te=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===Kt.parenL&&!ee)return this.parseDynamicImport(te);else if(this.type===Kt.dot){var Oe=this.startNodeAt(te.start,te.loc&&te.loc.start);return Oe.name="import",te.meta=this.finishNode(Oe,"Identifier"),this.parseImportMeta(te)}else this.unexpected()};tn.parseDynamicImport=function(ee){if(this.next(),ee.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(Kt.parenR))if(this.expect(Kt.comma),!this.afterTrailingComma(Kt.parenR)){if(ee.options=this.parseMaybeAssign(),!this.eat(Kt.parenR)){if(this.expect(Kt.comma),!this.afterTrailingComma(Kt.parenR))this.unexpected()}}else ee.options=null;else ee.options=null;else if(!this.eat(Kt.parenR)){var te=this.start;if(this.eat(Kt.comma)&&this.eat(Kt.parenR))this.raiseRecoverable(te,"Trailing comma is not allowed in import()");else this.unexpected(te)}return this.finishNode(ee,"ImportExpression")};tn.parseImportMeta=function(ee){this.next();var te=this.containsEsc;if(ee.property=this.parseIdent(!0),ee.property.name!=="meta")this.raiseRecoverable(ee.property.start,"The only valid meta property for import is 'import.meta'");if(te)this.raiseRecoverable(ee.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(ee.start,"Cannot use 'import.meta' outside a module");return this.finishNode(ee,"MetaProperty")};tn.parseLiteral=function(ee){var te=this.startNode();if(te.value=ee,te.raw=this.input.slice(this.start,this.end),te.raw.charCodeAt(te.raw.length-1)===110)te.bigint=te.value!=null?te.value.toString():te.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(te,"Literal")};tn.parseParenExpression=function(){this.expect(Kt.parenL);var ee=this.parseExpression();return this.expect(Kt.parenR),ee};tn.shouldParseArrow=function(ee){return!this.canInsertSemicolon()};tn.parseParenAndDistinguishExpression=function(ee,te){var Oe=this.start,Ot=this.startLoc,jt,Vt=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var Wt=this.start,Mt=this.startLoc,Gt=[],Ut=!0,Ht=!1,qt=new rs,zt=this.yieldPos,Xt=this.awaitPos,Jt;this.yieldPos=0,this.awaitPos=0;while(this.type!==Kt.parenR)if(Ut?Ut=!1:this.expect(Kt.comma),Vt&&this.afterTrailingComma(Kt.parenR,!0)){Ht=!0;break}else if(this.type===Kt.ellipsis){if(Jt=this.start,Gt.push(this.parseParenItem(this.parseRestBinding())),this.type===Kt.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Gt.push(this.parseMaybeAssign(!1,qt,this.parseParenItem));var Qt=this.lastTokEnd,Yt=this.lastTokEndLoc;if(this.expect(Kt.parenR),ee&&this.shouldParseArrow(Gt)&&this.eat(Kt.arrow))return this.checkPatternErrors(qt,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=zt,this.awaitPos=Xt,this.parseParenArrowList(Oe,Ot,Gt,te);if(!Gt.length||Ht)this.unexpected(this.lastTokStart);if(Jt)this.unexpected(Jt);if(this.checkExpressionErrors(qt,!0),this.yieldPos=zt||this.yieldPos,this.awaitPos=Xt||this.awaitPos,Gt.length>1)jt=this.startNodeAt(Wt,Mt),jt.expressions=Gt,this.finishNodeAt(jt,"SequenceExpression",Qt,Yt);else jt=Gt[0]}else jt=this.parseParenExpression();if(this.options.preserveParens){var nn=this.startNodeAt(Oe,Ot);return nn.expression=jt,this.finishNode(nn,"ParenthesizedExpression")}else return jt};tn.parseParenItem=function(ee){return ee};tn.parseParenArrowList=function(ee,te,Oe,Ot){return this.parseArrowExpression(this.startNodeAt(ee,te),Oe,!1,Ot)};var Cl=[];tn.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var ee=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===Kt.dot){var te=this.startNodeAt(ee.start,ee.loc&&ee.loc.start);te.name="new",ee.meta=this.finishNode(te,"Identifier"),this.next();var Oe=this.containsEsc;if(ee.property=this.parseIdent(!0),ee.property.name!=="target")this.raiseRecoverable(ee.property.start,"The only valid meta property for new is 'new.target'");if(Oe)this.raiseRecoverable(ee.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(ee.start,"'new.target' can only be used in functions and class static block");return this.finishNode(ee,"MetaProperty")}var Ot=this.start,jt=this.startLoc;if(ee.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),Ot,jt,!0,!1),ee.callee.type==="Super")this.raiseRecoverable(Ot,"Invalid use of 'super'");if(this.eat(Kt.parenL))ee.arguments=this.parseExprList(Kt.parenR,this.options.ecmaVersion>=8,!1);else ee.arguments=Cl;return this.finishNode(ee,"NewExpression")};tn.parseTemplateElement=function(ee){var te=ee.isTagged,Oe=this.startNode();if(this.type===Kt.invalidTemplate){if(!te)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");Oe.value={raw:this.value.replace(/\r\n?/g,`
11
+ `),cooked:null}}else Oe.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
12
+ `),cooked:this.value};return this.next(),Oe.tail=this.type===Kt.backQuote,this.finishNode(Oe,"TemplateElement")};tn.parseTemplate=function(ee){if(ee===void 0)ee={};var te=ee.isTagged;if(te===void 0)te=!1;var Oe=this.startNode();this.next(),Oe.expressions=[];var Ot=this.parseTemplateElement({isTagged:te});Oe.quasis=[Ot];while(!Ot.tail){if(this.type===Kt.eof)this.raise(this.pos,"Unterminated template literal");this.expect(Kt.dollarBraceL),Oe.expressions.push(this.parseExpression()),this.expect(Kt.braceR),Oe.quasis.push(Ot=this.parseTemplateElement({isTagged:te}))}return this.next(),this.finishNode(Oe,"TemplateLiteral")};tn.isAsyncProp=function(ee){return!ee.computed&&ee.key.type==="Identifier"&&ee.key.name==="async"&&(this.type===Kt.name||this.type===Kt.num||this.type===Kt.string||this.type===Kt.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Kt.star)&&!En.test(this.input.slice(this.lastTokEnd,this.start))};tn.parseObj=function(ee,te){var Oe=this.startNode(),Ot=!0,jt={};Oe.properties=[],this.next();while(!this.eat(Kt.braceR)){if(!Ot){if(this.expect(Kt.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Kt.braceR))break}else Ot=!1;var Vt=this.parseProperty(ee,te);if(!ee)this.checkPropClash(Vt,jt,te);Oe.properties.push(Vt)}return this.finishNode(Oe,ee?"ObjectPattern":"ObjectExpression")};tn.parseProperty=function(ee,te){var Oe=this.startNode(),Ot,jt,Vt,Wt;if(this.options.ecmaVersion>=9&&this.eat(Kt.ellipsis)){if(ee){if(Oe.argument=this.parseIdent(!1),this.type===Kt.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(Oe,"RestElement")}if(Oe.argument=this.parseMaybeAssign(!1,te),this.type===Kt.comma&&te&&te.trailingComma<0)te.trailingComma=this.start;return this.finishNode(Oe,"SpreadElement")}if(this.options.ecmaVersion>=6){if(Oe.method=!1,Oe.shorthand=!1,ee||te)Vt=this.start,Wt=this.startLoc;if(!ee)Ot=this.eat(Kt.star)}var Mt=this.containsEsc;if(this.parsePropertyName(Oe),!ee&&!Mt&&this.options.ecmaVersion>=8&&!Ot&&this.isAsyncProp(Oe))jt=!0,Ot=this.options.ecmaVersion>=9&&this.eat(Kt.star),this.parsePropertyName(Oe);else jt=!1;return this.parsePropertyValue(Oe,ee,Ot,jt,Vt,Wt,te,Mt),this.finishNode(Oe,"Property")};tn.parseGetterSetter=function(ee){var te=ee.key.name;this.parsePropertyName(ee),ee.value=this.parseMethod(!1),ee.kind=te;var Oe=ee.kind==="get"?0:1;if(ee.value.params.length!==Oe){var Ot=ee.value.start;if(ee.kind==="get")this.raiseRecoverable(Ot,"getter should have no params");else this.raiseRecoverable(Ot,"setter should have exactly one param")}else if(ee.kind==="set"&&ee.value.params[0].type==="RestElement")this.raiseRecoverable(ee.value.params[0].start,"Setter cannot use rest params")};tn.parsePropertyValue=function(ee,te,Oe,Ot,jt,Vt,Wt,Mt){if((Oe||Ot)&&this.type===Kt.colon)this.unexpected();if(this.eat(Kt.colon))ee.value=te?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,Wt),ee.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Kt.parenL){if(te)this.unexpected();ee.method=!0,ee.value=this.parseMethod(Oe,Ot),ee.kind="init"}else if(!te&&!Mt&&this.options.ecmaVersion>=5&&!ee.computed&&ee.key.type==="Identifier"&&(ee.key.name==="get"||ee.key.name==="set")&&(this.type!==Kt.comma&&this.type!==Kt.braceR&&this.type!==Kt.eq)){if(Oe||Ot)this.unexpected();this.parseGetterSetter(ee)}else if(this.options.ecmaVersion>=6&&!ee.computed&&ee.key.type==="Identifier"){if(Oe||Ot)this.unexpected();if(this.checkUnreserved(ee.key),ee.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=jt;if(te)ee.value=this.parseMaybeDefault(jt,Vt,this.copyNode(ee.key));else if(this.type===Kt.eq&&Wt){if(Wt.shorthandAssign<0)Wt.shorthandAssign=this.start;ee.value=this.parseMaybeDefault(jt,Vt,this.copyNode(ee.key))}else ee.value=this.copyNode(ee.key);ee.kind="init",ee.shorthand=!0}else this.unexpected()};tn.parsePropertyName=function(ee){if(this.options.ecmaVersion>=6)if(this.eat(Kt.bracketL))return ee.computed=!0,ee.key=this.parseMaybeAssign(),this.expect(Kt.bracketR),ee.key;else ee.computed=!1;return ee.key=this.type===Kt.num||this.type===Kt.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};tn.initFunction=function(ee){if(ee.id=null,this.options.ecmaVersion>=6)ee.generator=ee.expression=!1;if(this.options.ecmaVersion>=8)ee.async=!1};tn.parseMethod=function(ee,te,Oe){var Ot=this.startNode(),jt=this.yieldPos,Vt=this.awaitPos,Wt=this.awaitIdentPos;if(this.initFunction(Ot),this.options.ecmaVersion>=6)Ot.generator=ee;if(this.options.ecmaVersion>=8)Ot.async=!!te;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Zs(te,Ot.generator)|is|(Oe?Uo:0)),this.expect(Kt.parenL),Ot.params=this.parseBindingList(Kt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(Ot,!1,!0,!1),this.yieldPos=jt,this.awaitPos=Vt,this.awaitIdentPos=Wt,this.finishNode(Ot,"FunctionExpression")};tn.parseArrowExpression=function(ee,te,Oe,Ot){var jt=this.yieldPos,Vt=this.awaitPos,Wt=this.awaitIdentPos;if(this.enterScope(Zs(Oe,!1)|Qs),this.initFunction(ee),this.options.ecmaVersion>=8)ee.async=!!Oe;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,ee.params=this.toAssignableList(te,!0),this.parseFunctionBody(ee,!0,!1,Ot),this.yieldPos=jt,this.awaitPos=Vt,this.awaitIdentPos=Wt,this.finishNode(ee,"ArrowFunctionExpression")};tn.parseFunctionBody=function(ee,te,Oe,Ot){var jt=te&&this.type!==Kt.braceL,Vt=this.strict,Wt=!1;if(jt)ee.body=this.parseMaybeAssign(Ot),ee.expression=!0,this.checkParams(ee,!1);else{var Mt=this.options.ecmaVersion>=7&&!this.isSimpleParamList(ee.params);if(!Vt||Mt){if(Wt=this.strictDirective(this.end),Wt&&Mt)this.raiseRecoverable(ee.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var Gt=this.labels;if(this.labels=[],Wt)this.strict=!0;if(this.checkParams(ee,!Vt&&!Wt&&!te&&!Oe&&this.isSimpleParamList(ee.params)),this.strict&&ee.id)this.checkLValSimple(ee.id,zo);ee.body=this.parseBlock(!1,void 0,Wt&&!Vt),ee.expression=!1,this.adaptDirectivePrologue(ee.body.body),this.labels=Gt}this.exitScope()};tn.isSimpleParamList=function(ee){for(var te=0,Oe=ee;te<Oe.length;te+=1){var Ot=Oe[te];if(Ot.type!=="Identifier")return!1}return!0};tn.checkParams=function(ee,te){var Oe=Object.create(null);for(var Ot=0,jt=ee.params;Ot<jt.length;Ot+=1){var Vt=jt[Ot];this.checkLValInnerPattern(Vt,er,te?null:Oe)}};tn.parseExprList=function(ee,te,Oe,Ot){var jt=[],Vt=!0;while(!this.eat(ee)){if(!Vt){if(this.expect(Kt.comma),te&&this.afterTrailingComma(ee))break}else Vt=!1;var Wt=void 0;if(Oe&&this.type===Kt.comma)Wt=null;else if(this.type===Kt.ellipsis){if(Wt=this.parseSpread(Ot),Ot&&this.type===Kt.comma&&Ot.trailingComma<0)Ot.trailingComma=this.start}else Wt=this.parseMaybeAssign(!1,Ot);jt.push(Wt)}return jt};tn.checkUnreserved=function(ee){var{start:te,end:Oe,name:Ot}=ee;if(this.inGenerator&&Ot==="yield")this.raiseRecoverable(te,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&Ot==="await")this.raiseRecoverable(te,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&ss)&&Ot==="arguments")this.raiseRecoverable(te,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(Ot==="arguments"||Ot==="await"))this.raise(te,"Cannot use "+Ot+" in class static initialization block");if(this.keywords.test(Ot))this.raise(te,"Unexpected keyword '"+Ot+"'");if(this.options.ecmaVersion<6&&this.input.slice(te,Oe).indexOf("\\")!==-1)return;var jt=this.strict?this.reservedWordsStrict:this.reservedWords;if(jt.test(Ot)){if(!this.inAsync&&Ot==="await")this.raiseRecoverable(te,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(te,"The keyword '"+Ot+"' is reserved")}};tn.parseIdent=function(ee){var te=this.parseIdentNode();if(this.next(!!ee),this.finishNode(te,"Identifier"),!ee){if(this.checkUnreserved(te),te.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=te.start}return te};tn.parseIdentNode=function(){var ee=this.startNode();if(this.type===Kt.name)ee.name=this.value;else if(this.type.keyword){if(ee.name=this.type.keyword,(ee.name==="class"||ee.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=Kt.name}else this.unexpected();return ee};tn.parsePrivateIdent=function(){var ee=this.startNode();if(this.type===Kt.privateId)ee.name=this.value;else this.unexpected();if(this.next(),this.finishNode(ee,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(ee.start,"Private field '#"+ee.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(ee);return ee};tn.parseYield=function(ee){if(!this.yieldPos)this.yieldPos=this.start;var te=this.startNode();if(this.next(),this.type===Kt.semi||this.canInsertSemicolon()||this.type!==Kt.star&&!this.type.startsExpr)te.delegate=!1,te.argument=null;else te.delegate=this.eat(Kt.star),te.argument=this.parseMaybeAssign(ee);return this.finishNode(te,"YieldExpression")};tn.parseAwait=function(ee){if(!this.awaitPos)this.awaitPos=this.start;var te=this.startNode();return this.next(),te.argument=this.parseMaybeUnary(null,!0,!1,ee),this.finishNode(te,"AwaitExpression")};var es=s.prototype;es.raise=function(ee,te){var Oe=Vo(this.input,ee);if(te+=" ("+Oe.line+":"+Oe.column+")",this.sourceFile)te+=" in "+this.sourceFile;var Ot=SyntaxError(te);throw Ot.pos=ee,Ot.loc=Oe,Ot.raisedAt=this.pos,Ot};es.raiseRecoverable=es.raise;es.curPosition=function(){if(this.options.locations)return new bi(this.curLine,this.pos-this.lineStart)};var Wn=s.prototype,wl=function(ee){this.flags=ee,this.var=[],this.lexical=[],this.functions=[]};Wn.enterScope=function(ee){this.scopeStack.push(new wl(ee))};Wn.exitScope=function(){this.scopeStack.pop()};Wn.treatFunctionsAsVarInScope=function(ee){return ee.flags&ei||!this.inModule&&ee.flags&Zn};Wn.declareName=function(ee,te,Oe){var Ot=!1;if(te===Fn){var jt=this.currentScope();if(Ot=jt.lexical.indexOf(ee)>-1||jt.functions.indexOf(ee)>-1||jt.var.indexOf(ee)>-1,jt.lexical.push(ee),this.inModule&&jt.flags&Zn)delete this.undefinedExports[ee]}else if(te===qo){var Vt=this.currentScope();Vt.lexical.push(ee)}else if(te===Ko){var Wt=this.currentScope();if(this.treatFunctionsAsVar)Ot=Wt.lexical.indexOf(ee)>-1;else Ot=Wt.lexical.indexOf(ee)>-1||Wt.var.indexOf(ee)>-1;Wt.functions.push(ee)}else for(var Mt=this.scopeStack.length-1;Mt>=0;--Mt){var Gt=this.scopeStack[Mt];if(Gt.lexical.indexOf(ee)>-1&&!(Gt.flags&Wo&&Gt.lexical[0]===ee)||!this.treatFunctionsAsVarInScope(Gt)&&Gt.functions.indexOf(ee)>-1){Ot=!0;break}if(Gt.var.push(ee),this.inModule&&Gt.flags&Zn)delete this.undefinedExports[ee];if(Gt.flags&ss)break}if(Ot)this.raiseRecoverable(Oe,"Identifier '"+ee+"' has already been declared")};Wn.checkLocalExport=function(ee){if(this.scopeStack[0].lexical.indexOf(ee.name)===-1&&this.scopeStack[0].var.indexOf(ee.name)===-1)this.undefinedExports[ee.name]=ee};Wn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Wn.currentVarScope=function(){for(var ee=this.scopeStack.length-1;;ee--){var te=this.scopeStack[ee];if(te.flags&(ss|wi|ti))return te}};Wn.currentThisScope=function(){for(var ee=this.scopeStack.length-1;;ee--){var te=this.scopeStack[ee];if(te.flags&(ss|wi|ti)&&!(te.flags&Qs))return te}};var os=function(ee,te,Oe){if(this.type="",this.start=te,this.end=0,ee.options.locations)this.loc=new ns(ee,Oe);if(ee.options.directSourceFile)this.sourceFile=ee.options.directSourceFile;if(ee.options.ranges)this.range=[te,0]},Ti=s.prototype;Ti.startNode=function(){return new os(this,this.start,this.startLoc)};Ti.startNodeAt=function(ee,te){return new os(this,ee,te)};function Yo(ee,te,Oe,Ot){if(ee.type=te,ee.end=Oe,this.options.locations)ee.loc.end=Ot;if(this.options.ranges)ee.range[1]=Oe;return ee}Ti.finishNode=function(ee,te){return Yo.call(this,ee,te,this.lastTokEnd,this.lastTokEndLoc)};Ti.finishNodeAt=function(ee,te,Oe,Ot){return Yo.call(this,ee,te,Oe,Ot)};Ti.copyNode=function(ee){var te=new os(this,ee.start,this.startLoc);for(var Oe in ee)te[Oe]=ee[Oe];return te};var Qo=function(){};Qo.prototype.reset=function(){};s.prototype.validateRegExpFlags=function(){};s.prototype.validateRegExpPattern=function(){};var nr=function(ee){if(this.type=ee.type,this.value=ee.value,this.start=ee.start,this.end=ee.end,ee.options.locations)this.loc=new ns(ee,ee.startLoc,ee.endLoc);if(ee.options.ranges)this.range=[ee.start,ee.end]},rn=s.prototype;rn.next=function(ee){if(!ee&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new nr(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};rn.getToken=function(){return this.next(),new nr(this)};if(typeof Symbol<"u")rn[Symbol.iterator]=function(){var ee=this;return{next:function(){var te=ee.getToken();return{done:te.type===Kt.eof,value:te}}}};rn.nextToken=function(){var ee=this.curContext();if(!ee||!ee.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(Kt.eof);if(ee.override)return ee.override(this);else this.readToken(this.fullCharCodeAtPos())};rn.readToken=function(ee){if(g(ee,this.options.ecmaVersion>=6)||ee===92)return this.readWord();return this.getTokenFromCode(ee)};rn.fullCharCodeAt=function(ee){var te=this.input.charCodeAt(ee);if(te<=55295||te>=56320)return te;var Oe=this.input.charCodeAt(ee+1);return Oe<=56319||Oe>=57344?te:(te<<10)+Oe-56613888};rn.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};rn.skipBlockComment=function(){var ee=this.options.onComment&&this.curPosition(),te=this.pos,Oe=this.input.indexOf("*/",this.pos+=2);if(Oe===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=Oe+2,this.options.locations)for(var Ot=void 0,jt=te;(Ot=Bo(this.input,jt,this.pos))>-1;)++this.curLine,jt=this.lineStart=Ot;if(this.options.onComment)this.options.onComment(!0,this.input.slice(te+2,Oe),te,this.pos,ee,this.curPosition())};rn.skipLineComment=function(ee){var te=this.pos,Oe=this.options.onComment&&this.curPosition(),Ot=this.input.charCodeAt(this.pos+=ee);while(this.pos<this.input.length&&!ui(Ot))Ot=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(te+ee,this.pos),te,this.pos,Oe,this.curPosition())};rn.skipSpace=function(){e:while(this.pos<this.input.length){var ee=this.input.charCodeAt(this.pos);switch(ee){case 32:case 160:++this.pos;break;case 13:if(this.input.charCodeAt(this.pos+1)===10)++this.pos;case 10:case 8232:case 8233:if(++this.pos,this.options.locations)++this.curLine,this.lineStart=this.pos;break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(ee>8&&ee<14||ee>=5760&&jo.test(String.fromCharCode(ee)))++this.pos;else break e}}};rn.finishToken=function(ee,te){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var Oe=this.type;this.type=ee,this.value=te,this.updateContext(Oe)};rn.readToken_dot=function(){var ee=this.input.charCodeAt(this.pos+1);if(ee>=48&&ee<=57)return this.readNumber(!0);var te=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&ee===46&&te===46)return this.pos+=3,this.finishToken(Kt.ellipsis);else return++this.pos,this.finishToken(Kt.dot)};rn.readToken_slash=function(){var ee=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(ee===61)return this.finishOp(Kt.assign,2);return this.finishOp(Kt.slash,1)};rn.readToken_mult_modulo_exp=function(ee){var te=this.input.charCodeAt(this.pos+1),Oe=1,Ot=ee===42?Kt.star:Kt.modulo;if(this.options.ecmaVersion>=7&&ee===42&&te===42)++Oe,Ot=Kt.starstar,te=this.input.charCodeAt(this.pos+2);if(te===61)return this.finishOp(Kt.assign,Oe+1);return this.finishOp(Ot,Oe)};rn.readToken_pipe_amp=function(ee){var te=this.input.charCodeAt(this.pos+1);if(te===ee){if(this.options.ecmaVersion>=12){var Oe=this.input.charCodeAt(this.pos+2);if(Oe===61)return this.finishOp(Kt.assign,3)}return this.finishOp(ee===124?Kt.logicalOR:Kt.logicalAND,2)}if(te===61)return this.finishOp(Kt.assign,2);return this.finishOp(ee===124?Kt.bitwiseOR:Kt.bitwiseAND,1)};rn.readToken_caret=function(){var ee=this.input.charCodeAt(this.pos+1);if(ee===61)return this.finishOp(Kt.assign,2);return this.finishOp(Kt.bitwiseXOR,1)};rn.readToken_plus_min=function(ee){var te=this.input.charCodeAt(this.pos+1);if(te===ee){if(te===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||En.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(Kt.incDec,2)}if(te===61)return this.finishOp(Kt.assign,2);return this.finishOp(Kt.plusMin,1)};rn.readToken_lt_gt=function(ee){var te=this.input.charCodeAt(this.pos+1),Oe=1;if(te===ee){if(Oe=ee===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+Oe)===61)return this.finishOp(Kt.assign,Oe+1);return this.finishOp(Kt.bitShift,Oe)}if(te===33&&ee===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45)return this.skipLineComment(4),this.skipSpace(),this.nextToken();if(te===61)Oe=2;return this.finishOp(Kt.relational,Oe)};rn.readToken_eq_excl=function(ee){var te=this.input.charCodeAt(this.pos+1);if(te===61)return this.finishOp(Kt.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(ee===61&&te===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(Kt.arrow);return this.finishOp(ee===61?Kt.eq:Kt.prefix,1)};rn.readToken_question=function(){var ee=this.options.ecmaVersion;if(ee>=11){var te=this.input.charCodeAt(this.pos+1);if(te===46){var Oe=this.input.charCodeAt(this.pos+2);if(Oe<48||Oe>57)return this.finishOp(Kt.questionDot,2)}if(te===63){if(ee>=12){var Ot=this.input.charCodeAt(this.pos+2);if(Ot===61)return this.finishOp(Kt.assign,3)}return this.finishOp(Kt.coalesce,2)}}return this.finishOp(Kt.question,1)};rn.readToken_numberSign=function(){var ee=this.options.ecmaVersion,te=35;if(ee>=13){if(++this.pos,te=this.fullCharCodeAtPos(),g(te,!0)||te===92)return this.finishToken(Kt.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+ts(te)+"'")};rn.getTokenFromCode=function(ee){switch(ee){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Kt.parenL);case 41:return++this.pos,this.finishToken(Kt.parenR);case 59:return++this.pos,this.finishToken(Kt.semi);case 44:return++this.pos,this.finishToken(Kt.comma);case 91:return++this.pos,this.finishToken(Kt.bracketL);case 93:return++this.pos,this.finishToken(Kt.bracketR);case 123:return++this.pos,this.finishToken(Kt.braceL);case 125:return++this.pos,this.finishToken(Kt.braceR);case 58:return++this.pos,this.finishToken(Kt.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Kt.backQuote);case 48:var te=this.input.charCodeAt(this.pos+1);if(te===120||te===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(te===111||te===79)return this.readRadixNumber(8);if(te===98||te===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(ee);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(ee);case 124:case 38:return this.readToken_pipe_amp(ee);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(ee);case 60:case 62:return this.readToken_lt_gt(ee);case 61:case 33:return this.readToken_eq_excl(ee);case 63:return this.readToken_question();case 126:return this.finishOp(Kt.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+ts(ee)+"'")};rn.finishOp=function(ee,te){var Oe=this.input.slice(this.pos,this.pos+te);return this.pos+=te,this.finishToken(ee,Oe)};rn.readRegexp=function(){var ee,te,Oe=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(Oe,"Unterminated regular expression");var Ot=this.input.charAt(this.pos);if(En.test(Ot))this.raise(Oe,"Unterminated regular expression");if(!ee){if(Ot==="[")te=!0;else if(Ot==="]"&&te)te=!1;else if(Ot==="/"&&!te)break;ee=Ot==="\\"}else ee=!1;++this.pos}var jt=this.input.slice(Oe,this.pos);++this.pos;var Vt=this.pos,Wt=this.readWord1();if(this.containsEsc)this.unexpected(Vt);var Mt=this.regexpState||(this.regexpState=new Qo(this));Mt.reset(Oe,jt,Wt),this.validateRegExpFlags(Mt),this.validateRegExpPattern(Mt);var Gt=null;try{Gt=new RegExp(jt,Wt)}catch(Ut){}return this.finishToken(Kt.regexp,{pattern:jt,flags:Wt,value:Gt})};rn.readInt=function(ee,te,Oe){var Ot=this.options.ecmaVersion>=12&&te===void 0,jt=Oe&&this.input.charCodeAt(this.pos)===48,Vt=this.pos,Wt=0,Mt=0;for(var Gt=0,Ut=te==null?1/0:te;Gt<Ut;++Gt,++this.pos){var Ht=this.input.charCodeAt(this.pos),qt=void 0;if(Ot&&Ht===95){if(jt)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(Mt===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(Gt===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");Mt=Ht;continue}if(Ht>=97)qt=Ht-97+10;else if(Ht>=65)qt=Ht-65+10;else if(Ht>=48&&Ht<=57)qt=Ht-48;else qt=1/0;if(qt>=ee)break;Mt=Ht,Wt=Wt*ee+qt}if(Ot&&Mt===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===Vt||te!=null&&this.pos-Vt!==te)return null;return Wt};function Tl(ee,te){if(te)return parseInt(ee,8);return parseFloat(ee.replace(/_/g,""))}function Zo(ee){if(typeof BigInt!=="function")return null;return BigInt(ee.replace(/_/g,""))}rn.readRadixNumber=function(ee){var te=this.pos;this.pos+=2;var Oe=this.readInt(ee);if(Oe==null)this.raise(this.start+2,"Expected number in radix "+ee);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)Oe=Zo(this.input.slice(te,this.pos)),++this.pos;else if(g(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Kt.num,Oe)};rn.readNumber=function(ee){var te=this.pos;if(!ee&&this.readInt(10,void 0,!0)===null)this.raise(te,"Invalid number");var Oe=this.pos-te>=2&&this.input.charCodeAt(te)===48;if(Oe&&this.strict)this.raise(te,"Invalid number");var Ot=this.input.charCodeAt(this.pos);if(!Oe&&!ee&&this.options.ecmaVersion>=11&&Ot===110){var jt=Zo(this.input.slice(te,this.pos));if(++this.pos,g(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Kt.num,jt)}if(Oe&&/[89]/.test(this.input.slice(te,this.pos)))Oe=!1;if(Ot===46&&!Oe)++this.pos,this.readInt(10),Ot=this.input.charCodeAt(this.pos);if((Ot===69||Ot===101)&&!Oe){if(Ot=this.input.charCodeAt(++this.pos),Ot===43||Ot===45)++this.pos;if(this.readInt(10)===null)this.raise(te,"Invalid number")}if(g(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var Vt=Tl(this.input.slice(te,this.pos),Oe);return this.finishToken(Kt.num,Vt)};rn.readCodePoint=function(){var ee=this.input.charCodeAt(this.pos),te;if(ee===123){if(this.options.ecmaVersion<6)this.unexpected();var Oe=++this.pos;if(te=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,te>1114111)this.invalidStringToken(Oe,"Code point out of bounds")}else te=this.readHexChar(4);return te};rn.readString=function(ee){var te="",Oe=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var Ot=this.input.charCodeAt(this.pos);if(Ot===ee)break;if(Ot===92)te+=this.input.slice(Oe,this.pos),te+=this.readEscapedChar(!1),Oe=this.pos;else if(Ot===8232||Ot===8233){if(this.options.ecmaVersion<10)this.raise(this.start,"Unterminated string constant");if(++this.pos,this.options.locations)this.curLine++,this.lineStart=this.pos}else{if(ui(Ot))this.raise(this.start,"Unterminated string constant");++this.pos}}return te+=this.input.slice(Oe,this.pos++),this.finishToken(Kt.string,te)};var ea={};rn.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(ee){if(ee===ea)this.readInvalidTemplateToken();else throw ee}this.inTemplateElement=!1};rn.invalidStringToken=function(ee,te){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ea;else this.raise(ee,te)};rn.readTmplToken=function(){var ee="",te=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var Oe=this.input.charCodeAt(this.pos);if(Oe===96||Oe===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===Kt.template||this.type===Kt.invalidTemplate))if(Oe===36)return this.pos+=2,this.finishToken(Kt.dollarBraceL);else return++this.pos,this.finishToken(Kt.backQuote);return ee+=this.input.slice(te,this.pos),this.finishToken(Kt.template,ee)}if(Oe===92)ee+=this.input.slice(te,this.pos),ee+=this.readEscapedChar(!0),te=this.pos;else if(ui(Oe)){switch(ee+=this.input.slice(te,this.pos),++this.pos,Oe){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:ee+=`
13
+ `;break;default:ee+=String.fromCharCode(Oe);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;te=this.pos}else++this.pos}};rn.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(Kt.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":if(this.input[this.pos+1]===`
14
+ `)++this.pos;case`
15
+ `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};rn.readEscapedChar=function(ee){var te=this.input.charCodeAt(++this.pos);switch(++this.pos,te){case 110:return`
16
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ts(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:if(this.options.locations)this.lineStart=this.pos,++this.curLine;return"";case 56:case 57:if(this.strict)this.invalidStringToken(this.pos-1,"Invalid escape sequence");if(ee){var Oe=this.pos-1;this.invalidStringToken(Oe,"Invalid escape sequence in template string")}default:if(te>=48&&te<=55){var Ot=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],jt=parseInt(Ot,8);if(jt>255)Ot=Ot.slice(0,-1),jt=parseInt(Ot,8);if(this.pos+=Ot.length-1,te=this.input.charCodeAt(this.pos),(Ot!=="0"||te===56||te===57)&&(this.strict||ee))this.invalidStringToken(this.pos-1-Ot.length,ee?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(jt)}if(ui(te)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(te)}};rn.readHexChar=function(ee){var te=this.pos,Oe=this.readInt(16,ee);if(Oe===null)this.invalidStringToken(te,"Bad character escape sequence");return Oe};rn.readWord1=function(){this.containsEsc=!1;var ee="",te=!0,Oe=this.pos,Ot=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var jt=this.fullCharCodeAtPos();if(S(jt,Ot))this.pos+=jt<=65535?1:2;else if(jt===92){this.containsEsc=!0,ee+=this.input.slice(Oe,this.pos);var Vt=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var Wt=this.readCodePoint();if(!(te?g:S)(Wt,Ot))this.invalidStringToken(Vt,"Invalid Unicode escape");ee+=ts(Wt),Oe=this.pos}else break;te=!1}return ee+this.input.slice(Oe,this.pos)};rn.readWord=function(){var ee=this.readWord1(),te=Kt.name;if(this.keywords.test(ee))te=Js[ee];return this.finishToken(te,ee)};var kl="8.18.0";s.acorn={Parser:s,version:kl,defaultOptions:qs,Position:bi,SourceLocation:ns,getLineInfo:Vo,Node:os,TokenType:pn,tokTypes:Kt,keywordTypes:Js,TokContext:Pn,tokContexts:ln,isIdentifierChar:S,isIdentifierStart:g,Token:nr,isNewLine:ui,lineBreak:En,lineBreakG:hl,nonASCIIwhitespace:jo};function ki(ee){return(te)=>ee(te)}function as(...ee){return s.extend(...ee)}function Ai(ee,te,Oe){for(let Ot=te;Ot<Oe;Ot++){let jt=ee.charCodeAt(Ot);if(jt===10||jt===13||jt===8232||jt===8233)return!0}return!1}var Mo=new WeakMap;function Sn(ee,te){if(ee===void 0)return!1;if(ee.length<16)return ee.includes(te);let Oe=Mo.get(ee);if(Oe===void 0||Oe.length>ee.length)Oe={names:new Set,length:0},Mo.set(ee,Oe);while(Oe.length<ee.length)Oe.names.add(ee[Oe.length++]);return Oe.names.has(te)}var ir=/(?:\s|\/\/.*|\/\*[\s\S]*?\*\/)*/g,Al=new Map([["any","TSAnyKeyword"],["bigint","TSBigIntKeyword"],["boolean","TSBooleanKeyword"],["never","TSNeverKeyword"],["null","TSNullKeyword"],["number","TSNumberKeyword"],["object","TSObjectKeyword"],["string","TSStringKeyword"],["symbol","TSSymbolKeyword"],["undefined","TSUndefinedKeyword"],["unknown","TSUnknownKeyword"],["void","TSVoidKeyword"]]),Pl=new Set("public private protected readonly declare abstract override static accessor".split(" ")),_l=new Set("public private protected readonly override".split(" ")),$l=new Set("var let const function class abstract enum interface type namespace module global".split(" ")),Nl=new Set("var let const function class interface enum".split(" ")),ta=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),na=1,Dl=32,Rl=256,Il=0,Ol=1,Pi=2,Ll=3,Ml=4,sr=6,ia=7,ca=256,pr=1024,Fl=8|pr,Bl=Pi|ca,sa=1,jl=2,ra=40,Vl=41,Gl=44,oa=46,aa=58,ps=61,pa=60,cs=123,Wl=91,rr=42,Ul=35,or=34,ar=39,Hl=SyntaxError("speculative parse failed"),ce=ki((ee)=>{let{tokTypes:te,keywordTypes:Oe,isIdentifierChar:Ot,isIdentifierStart:jt}=ee.acorn,Vt=new ee.acorn.TokenType("@");class Wt extends ee{inType=!1;$4=!1;$5=!1;$7=null;$k=null;$l=!1;$m=!1;$f=null;$9=[[]];$n=0;$t=0;$o=-1;constructor(Mt,Gt,Ut){super(Mt,Gt,Ut);let Ht=this.options.onComment;if(typeof Ht==="function")this.options.onComment=(qt,zt,Xt,Jt,Qt,Yt)=>{if(Xt<this.$t)return;this.$t=Jt,Ht.call(this,qt,zt,Xt,Jt,Qt,Yt)}}reset(){this.inType=!1,this.$4=!1,this.$5=!1,this.$7=null,this.$k=null,this.$l=!1,this.$m=!1,this.$f=null,this.$9=[[]],this.$n=0,this.$t=0,this.$o=-1}getTokenFromCode(Mt){if(Mt===64)return++this.pos,this.finishToken(Vt);return super.getTokenFromCode(Mt)}readToken_lt_gt(Mt){if(this.inType)return this.finishOp(te.relational,1);return super.readToken_lt_gt(Mt)}$a(Mt){let Gt=this.inType;this.inType=!0;let Ut=Mt();if(this.inType=Gt,!Gt&&this.type===te.relational)this.pos=this.start,this.nextToken();return Ut}$1(){return this.type===te.relational&&this.value==="<"}$p(){if(this.type===te.bitShift&&this.value==="<<")this.pos=this.start+1,this.finishToken(te.relational,"<");return this.$1()}$c(){return this.type===te.relational&&this.value===">"}$u(){return this.type===te.prefix&&this.value==="!"}hasPrecedingLineBreak(){return Ai(this.input,this.lastTokEnd,this.start)}$d(Mt=this.pos){return ir.lastIndex=Mt,ir.exec(this.input),ir.lastIndex}$2(){return this.input.charCodeAt(this.$d())}$3(){let Mt=this.$d(),Gt=Mt;while(Gt<this.input.length&&Ot(this.input.charCodeAt(Gt)))Gt++;return this.input.slice(Mt,Gt)}$b(){return!Ai(this.input,this.pos,this.$d())}$14(){return this.$b()&&jt(this.$2())&&!Object.hasOwn(Oe,this.$3())}$15(){return{pos:this.pos,type:this.type,value:this.value,start:this.start,end:this.end,startLoc:this.startLoc,endLoc:this.endLoc,lastTokStart:this.lastTokStart,lastTokEnd:this.lastTokEnd,lastTokStartLoc:this.lastTokStartLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,context:this.context.slice(),exprAllowed:this.exprAllowed,containsEsc:this.containsEsc,inType:this.inType,$4:this.$4,$5:this.$5,$7:this.$7,scopes:this.scopeStack.length,privateNames:this.privateNameStack.length,labels:this.labels,labelCount:this.labels.length,strict:this.strict,yieldPos:this.yieldPos,awaitPos:this.awaitPos,awaitIdentPos:this.awaitIdentPos,potentialArrowAt:this.potentialArrowAt,potentialArrowInForAwait:this.potentialArrowInForAwait}}$16(Mt){this.pos=Mt.pos,this.type=Mt.type,this.value=Mt.value,this.start=Mt.start,this.end=Mt.end,this.startLoc=Mt.startLoc,this.endLoc=Mt.endLoc,this.lastTokStart=Mt.lastTokStart,this.lastTokEnd=Mt.lastTokEnd,this.lastTokStartLoc=Mt.lastTokStartLoc,this.lastTokEndLoc=Mt.lastTokEndLoc,this.curLine=Mt.curLine,this.lineStart=Mt.lineStart,this.context=Mt.context,this.exprAllowed=Mt.exprAllowed,this.containsEsc=Mt.containsEsc,this.inType=Mt.inType,this.$4=Mt.$4,this.$5=Mt.$5,this.$7=Mt.$7,this.scopeStack.length=Mt.scopes,this.privateNameStack.length=Mt.privateNames,this.labels=Mt.labels,this.labels.length=Mt.labelCount,this.strict=Mt.strict,this.yieldPos=Mt.yieldPos,this.awaitPos=Mt.awaitPos,this.awaitIdentPos=Mt.awaitIdentPos,this.potentialArrowAt=Mt.potentialArrowAt,this.potentialArrowInForAwait=Mt.potentialArrowInForAwait}raise(Mt,Gt){if(this.$n>0)throw Hl;return super.raise(Mt,Gt)}$1y(Mt,Gt){try{super.raise(Mt,Gt)}catch(Ut){if(Ut instanceof SyntaxError)Ut.$1z=!0;throw Ut}throw Error("unreachable")}$g(Mt,Gt=!1){let Ut=this.$15();this.$n++;try{let Ht=Mt();if(Gt||Ht===void 0)this.$16(Ut);return Ht}catch(Ht){if(!(Ht instanceof SyntaxError)||!Gt&&Ht.$1z)throw Ht;this.$16(Ut);return}finally{this.$n--}}$v(Mt){return this.$g(Mt,!0)===!0}$17(Mt){if(Mt.end=this.lastTokEnd,this.options.locations)Mt.loc.end=this.lastTokEndLoc}$q(Mt,Gt){if(Mt.start=Gt.start,this.options.locations)Mt.loc.start=Gt.loc.start}$6(Mt=!1){let Gt=this.startNode();return Gt.typeAnnotation=this.$a(()=>(this.next(),Mt?this.$20():this.$0())),this.finishNode(Gt,"TSTypeAnnotation")}$h(Mt,Gt){if(Gt&&this.eat(te.question))Mt.optional=!0,this.$17(Mt);if(this.type===te.colon)Mt.typeAnnotation=this.$6(),this.$17(Mt);return Mt}$20(){if(this.type!==te.name&&this.type!==te._this)return this.$0();if(this.isContextual("asserts")&&this.$b()&&jt(this.$2())){let Mt=this.startNode();if(this.next(),Mt.parameterName=this.type===te._this?this.$w():this.parseIdent(),this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.$x(Mt,!0);return Mt.asserts=!0,Mt.typeAnnotation=null,this.finishNode(Mt,"TSTypePredicate")}if(this.$3()==="is"&&this.$b()){let Mt=this.startNode();return Mt.parameterName=this.type===te._this?this.$w():this.parseIdent(!0),this.$x(Mt,!1)}return this.$0()}$x(Mt,Gt){this.next();let Ut=this.startNode();return Ut.typeAnnotation=this.$0(),Mt.typeAnnotation=this.finishNode(Ut,"TSTypeAnnotation"),Mt.asserts=Gt,this.finishNode(Mt,"TSTypePredicate")}$w(){let Mt=this.startNode();return this.next(),this.finishNode(Mt,"TSThisType")}parseWholeType(){this.inType=!0,this.nextToken();let Mt=this.$0();if(this.type!==te.eof)this.unexpected();return Mt}$0(){let Mt=this.$18();if(this.$4||this.type!==te._extends||this.hasPrecedingLineBreak())return Mt;let Gt=this.startNodeAt(Mt.start,Mt.loc?.start);return this.next(),Gt.checkType=Mt,Gt.extendsType=this.$i(!0,()=>this.$18()),this.expect(te.question),Gt.trueType=this.$i(!1,()=>this.$0()),this.expect(te.colon),Gt.falseType=this.$i(!1,()=>this.$0()),this.finishNode(Gt,"TSConditionalType")}$i(Mt,Gt){let Ut=this.$4;this.$4=Mt;let Ht=Gt();return this.$4=Ut,Ht}$18(){if(this.$21())return this.$19("TSFunctionType");if(this.type===te._new||this.isContextual("abstract")&&this.$3()==="new")return this.$19("TSConstructorType");return this.$1a("TSUnionType",te.bitwiseOR,()=>this.$1a("TSIntersectionType",te.bitwiseAND,()=>this.$1b()))}$19(Mt){let Gt=this.startNode();if(Mt==="TSConstructorType"){if(Gt.abstract=this.isContextual("abstract"),Gt.abstract)this.next();this.next()}return this.$i(!1,()=>this.$r(Gt,te.arrow)),this.finishNode(Gt,Mt)}$r(Mt,Gt){if(this.$1())Mt.typeParameters=this.$8();if(this.expect(te.parenL),Mt.parameters=this.parseBindingList(te.parenR,!1,!0),this.type===Gt)Mt.typeAnnotation=this.$6(!0);else if(Gt===te.arrow)this.unexpected()}$21(){if(this.$1())return!0;if(this.type!==te.parenL)return!1;return this.$v(()=>{if(this.next(),this.type===te.parenR||this.type===te.ellipsis)return!0;if(this.type===te.name||this.type===te._this)this.next();else if(this.type===te.braceL||this.type===te.bracketL)this.parseBindingAtom();else return!1;let Mt=this.type;if(Mt===te.colon||Mt===te.comma||Mt===te.question||Mt===te.eq)return!0;if(Mt!==te.parenR)return!1;return this.next(),this.type===te.arrow})}$1a(Mt,Gt,Ut){let Ht=this.startNode(),qt=this.eat(Gt),zt=[];do zt.push(Ut());while(this.eat(Gt));if(zt.length===1&&!qt)return zt[0];return Ht.types=zt,this.finishNode(Ht,Mt)}$1b(){if(this.type===te.name&&!this.containsEsc){let Mt=this.value;if(Mt==="keyof"||Mt==="unique"||Mt==="readonly"){let Gt=this.startNode();return this.next(),Gt.operator=Mt,Gt.typeAnnotation=this.$1b(),this.finishNode(Gt,"TSTypeOperator")}if(Mt==="infer"){let Gt=this.startNode();this.next();let Ut=this.startNode();Ut.name=this.$y();let Ht=this.$g(()=>this.$22());if(Ht)Ut.constraint=Ht;return Gt.typeParameter=this.finishNode(Ut,"TSTypeParameter"),this.finishNode(Gt,"TSInferType")}}return this.$i(!1,()=>this.$23())}$22(){if(!this.eat(te._extends))return;let Mt=this.$i(!0,()=>this.$0());return this.$4||this.type!==te.question?Mt:void 0}$y(){if(this.type!==te.name&&!this.type.keyword)this.unexpected();let Mt=this.type===te.name?this.value:this.type.keyword;return this.next(),Mt}$23(){let Mt=this.$24();while(!this.hasPrecedingLineBreak()&&this.eat(te.bracketL)){let Gt=this.startNodeAt(Mt.start,Mt.loc?.start);if(this.eat(te.bracketR))Gt.elementType=Mt,Mt=this.finishNode(Gt,"TSArrayType");else Gt.objectType=Mt,Gt.indexType=this.$0(),this.expect(te.bracketR),Mt=this.finishNode(Gt,"TSIndexedAccessType")}return Mt}$24(){switch(this.type){case te.name:case te._void:case te._null:{let Mt=Al.get(this.value);if(Mt&&(this.type!==te.name||!this.containsEsc&&this.$2()!==oa)){let Gt=this.startNode();return this.next(),this.finishNode(Gt,Mt)}return this.$1c()}case te.string:case te.num:case te._true:case te._false:{let Mt=this.startNode();return Mt.literal=this.parseExprAtom(),this.finishNode(Mt,"TSLiteralType")}case te.plusMin:{if(this.value!=="-")break;let Mt=this.startNode(),Gt=this.startNode();if(this.next(),this.type!==te.num)this.unexpected();return Gt.operator="-",Gt.prefix=!0,Gt.argument=this.parseExprAtom(),Mt.literal=this.finishNode(Gt,"UnaryExpression"),this.finishNode(Mt,"TSLiteralType")}case te.backQuote:return this.$25();case te._this:{let Mt=this.$w();if(this.isContextual("is")&&!this.hasPrecedingLineBreak()){let Gt=this.startNodeAt(Mt.start,Mt.loc?.start);return Gt.parameterName=Mt,this.$x(Gt,!1)}return Mt}case te._typeof:return this.$26();case te._import:return this.$1d();case te.braceL:return this.$27()?this.$28():this.$29();case te.bracketL:return this.$2a();case te.parenL:{let Mt=this.startNode();return this.next(),Mt.typeAnnotation=this.$0(),this.expect(te.parenR),this.finishNode(Mt,"TSParenthesizedType")}default:if(this.type.keyword)return this.$1c()}return this.unexpected()}$1c(){let Mt=this.startNode();if(Mt.typeName=this.$j(),!this.hasPrecedingLineBreak()&&this.$1())Mt.typeArguments=this.$e();return this.finishNode(Mt,"TSTypeReference")}$j(){let Mt=this.parseIdent(!0);while(this.eat(te.dot)){let Gt=this.startNodeAt(Mt.start,Mt.loc?.start);Gt.left=Mt,Gt.right=this.parseIdent(!0),Mt=this.finishNode(Gt,"TSQualifiedName")}return Mt}$26(){let Mt=this.startNode();if(this.next(),Mt.exprName=this.type===te._import?this.$1d():this.$j(),!this.hasPrecedingLineBreak()&&this.$1())Mt.typeArguments=this.$e();return this.finishNode(Mt,"TSTypeQuery")}$1d(){let Mt=this.startNode();if(this.next(),Mt.argument=this.$1e(),this.eat(te.dot))Mt.qualifier=this.$j();if(this.$1())Mt.typeArguments=this.$e();return this.finishNode(Mt,"TSImportType")}$z(){if(this.type!==te.string)this.unexpected();return this.parseExprAtom()}$1e(){this.expect(te.parenL);let Mt=this.$z();return this.expect(te.parenR),Mt}$25(){let Mt=this.startNode(),Gt=this.startNode();this.next(),Gt.expressions=[];let Ut=this.parseTemplateElement({isTagged:!1});Gt.quasis=[Ut];while(!Ut.tail){if(this.type===te.eof)this.raise(this.pos,"Unterminated template literal");this.expect(te.dollarBraceL),Gt.expressions.push(this.$0()),this.expect(te.braceR),Ut=this.parseTemplateElement({isTagged:!1}),Gt.quasis.push(Ut)}return this.next(),Mt.literal=this.finishNode(Gt,"TemplateLiteral"),this.finishNode(Mt,"TSLiteralType")}$27(){return this.$v(()=>{if(this.next(),this.type===te.plusMin)return this.next(),this.isContextual("readonly");if(this.isContextual("readonly"))this.next();if(this.type!==te.bracketL)return!1;if(this.next(),this.type!==te.name)return!1;return this.next(),this.type===te._in})}$28(){let Mt=this.startNode();if(this.expect(te.braceL),this.type===te.plusMin)Mt.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))Mt.readonly=!0;this.expect(te.bracketL);let Gt=this.startNode();if(Gt.name=this.$y(),this.expect(te._in),Gt.constraint=this.$0(),Mt.typeParameter=this.finishNode(Gt,"TSTypeParameter"),Mt.nameType=this.eatContextual("as")?this.$0():null,this.expect(te.bracketR),this.type===te.plusMin)Mt.optional=this.value,this.next(),this.expect(te.question);else if(this.eat(te.question))Mt.optional=!0;if(this.eat(te.colon))Mt.typeAnnotation=this.$0();return this.semicolon(),this.expect(te.braceR),this.finishNode(Mt,"TSMappedType")}$29(){let Mt=this.startNode();return Mt.members=this.$1f(),this.finishNode(Mt,"TSTypeLiteral")}$1f(){this.expect(te.braceL);let Mt=[];while(!this.eat(te.braceR))Mt.push(this.$2b());return Mt}$2b(){let Mt=this.startNode(),Gt="TSPropertySignature",Ut=this.type===te._new?this.$2():-1;if(this.type===te.parenL||this.$1())Gt="TSCallSignatureDeclaration",this.$r(Mt,te.colon);else if(Ut===ra||Ut===pa)Gt="TSConstructSignatureDeclaration",this.next(),this.$r(Mt,te.colon);else{let Ht=this.type===te._new?this.parseIdent(!0):null;if(this.isContextual("readonly")&&this.$s(!0))this.next(),Mt.readonly=!0;if(this.type===te.bracketL&&this.$1g())return this.$1h(Mt);let qt="method";if(Ht)Mt.key=Ht;else{if((this.isContextual("get")||this.isContextual("set"))&&this.$s(!1))qt=this.value,this.next();this.parsePropertyName(Mt)}if(this.eat(te.question))Mt.optional=!0;if(this.type===te.parenL||this.$1()){if(Gt="TSMethodSignature",qt!=="method")Mt.kind=qt;this.$r(Mt,te.colon),Mt.kind=qt}else if(this.type===te.colon)Mt.typeAnnotation=this.$6()}return this.$1i(),this.finishNode(Mt,Gt)}$1i(){if(!this.eat(te.comma))this.semicolon()}$1g(){return this.$v(()=>{if(this.next(),this.type!==te.name)return!1;return this.next(),this.type===te.colon})}$1h(Mt){if(this.expect(te.bracketL),Mt.parameters=[this.$h(this.parseIdent(),!1)],this.expect(te.bracketR),this.type===te.colon)Mt.typeAnnotation=this.$6();return this.$1i(),this.finishNode(Mt,"TSIndexSignature")}$2a(){let Mt=this.startNode();this.expect(te.bracketL),Mt.elementTypes=[];while(!this.eat(te.bracketR))if(Mt.elementTypes.push(this.$2c()),this.type!==te.bracketR)this.expect(te.comma);return this.finishNode(Mt,"TSTupleType")}$2c(){let Mt=this.start,Gt=this.startLoc,Ut=this.eat(te.ellipsis),Ht;if((this.type===te.name||this.type.keyword)&&this.$2d()){let qt=this.startNode();qt.label=this.parseIdent(!0),qt.optional=this.eat(te.question),this.expect(te.colon),qt.elementType=this.$0(),Ht=this.finishNode(qt,"TSNamedTupleMember")}else if(Ht=this.$0(),this.eat(te.question)){let qt=this.startNodeAt(Ht.start,Ht.loc?.start);qt.typeAnnotation=Ht,Ht=this.finishNode(qt,"TSOptionalType")}if(Ut){let qt=this.startNodeAt(Mt,Gt);qt.typeAnnotation=Ht,Ht=this.finishNode(qt,"TSRestType")}return Ht}$2d(){let Mt=this.$d();if(this.input.charCodeAt(Mt)===63)Mt=this.$d(Mt+1);return this.input.charCodeAt(Mt)===aa}$8(){return this.$a(()=>{let Mt=this.startNode();this.next(),Mt.params=[];while(!this.$c()){let Gt=this.startNode();while((this.type===te._const||this.type===te._in||this.isContextual("out"))&&jt(this.$2()))Gt[this.value]=!0,this.next();if(Gt.name=this.$y(),this.eat(te._extends))Gt.constraint=this.$0();if(this.eat(te.eq))Gt.default=this.$0();if(Mt.params.push(this.finishNode(Gt,"TSTypeParameter")),!this.$c()){if(this.expect(te.comma),this.$c())Mt.extra={trailingComma:this.lastTokStart}}}if(this.next(),Mt.params.length===0)this.$1y(this.start,"Type parameter list cannot be empty.");return this.finishNode(Mt,"TSTypeParameterDeclaration")})}$e(){return this.$a(()=>{let Mt=this.startNode();this.next(),Mt.params=[];while(!this.$c())if(Mt.params.push(this.$0()),!this.$c())this.expect(te.comma);if(Mt.params.length===0)this.unexpected();return this.next(),this.finishNode(Mt,"TSTypeParameterInstantiation")})}$1j(){let Mt=[];do{let Gt=this.startNode();if(Gt.expression=this.$j(),this.$1())Gt.typeParameters=this.$e();Mt.push(this.finishNode(Gt,"TSExpressionWithTypeArguments"))}while(this.eat(te.comma));return Mt}$1k(Mt=!1){if(this.type!==te.name||this.containsEsc){if(this.type===te._const&&this.$3()==="enum")return this.$10(this.startNode());return}if(!this.$2e(this.value))return;if(this.value==="declare")return this.$2f(Mt);return this.$1l(this.startNode(),this.value)}$2e(Mt){switch(Mt){case"interface":case"type":case"namespace":return this.$14();case"enum":return jt(this.$2());case"abstract":return this.$b()&&this.$3()==="class";case"module":{let Gt=this.$2();return this.$b()&&(Gt===or||Gt===ar||jt(Gt))}case"declare":return this.$b()&&$l.has(this.$3());case"global":return this.$b()&&this.$2()===cs}return!1}$1l(Mt,Gt){switch(Gt){case"interface":return this.$1m(Mt);case"type":return this.$2g(Mt);case"enum":return this.$10(Mt);case"abstract":return this.$1n(Mt,!0);case"global":return Mt.global=!0,Mt.id=this.parseIdent(),Mt.body=this.$11(),this.finishNode(Mt,"TSModuleDeclaration")}return this.$2h(Mt)}$2f(Mt){let Gt=this.$5;this.$5=!0;let Ut=this.startNode();this.next();let Ht=this.value;if(Ht==="const"&&this.$3()==="enum")Ut.const=!0;if(!Mt&&Nl.has(Ht))Ut.declare=!0;let qt;if(Ut.const)qt=this.$10(Ut);else if(Ht==="var"||Ht==="let"||Ht==="const")qt=this.parseVarStatement(Ut,Ht,!0);else if(Ht==="function")this.next(),qt=this.parseFunction(Ut,sa,!1,!1);else if(Ht==="class")qt=this.parseClass(Ut,!0);else qt=this.$1l(Ut,Ht);return qt.declare=!0,this.$5=Gt,qt}$1n(Mt,Gt){return this.next(),Mt.abstract=!0,this.parseClass(Mt,Gt)}$1m(Mt){if(this.next(),Mt.id=this.parseIdent(),this.checkLValSimple(Mt.id,ia),this.$1())Mt.typeParameters=this.$8();return this.$a(()=>{if(this.eat(te._extends))Mt.extends=this.$1j();let Gt=this.startNode();Gt.body=this.$1f(),Mt.body=this.finishNode(Gt,"TSInterfaceBody")}),this.finishNode(Mt,"TSInterfaceDeclaration")}$2g(Mt){if(this.next(),Mt.id=this.parseIdent(),this.checkLValSimple(Mt.id,sr),this.$1())Mt.typeParameters=this.$8();return Mt.typeAnnotation=this.$a(()=>(this.expect(te.eq),this.$0())),this.semicolon(),this.finishNode(Mt,"TSTypeAliasDeclaration")}$10(Mt){if(this.type===te._const)Mt.const=!0,this.next();this.next(),Mt.id=this.parseIdent(),this.checkLValSimple(Mt.id,Bl),this.expect(te.braceL),Mt.members=[];while(!this.eat(te.braceR)){let Gt=this.startNode();if(Gt.id=this.type===te.string?this.parseExprAtom():this.parseIdent(!0),this.eat(te.eq))Gt.initializer=this.parseMaybeAssign();if(Mt.members.push(this.finishNode(Gt,"TSEnumMember")),this.type!==te.braceR)this.expect(te.comma)}return this.finishNode(Mt,"TSEnumDeclaration")}$2h(Mt){if(this.next(),this.type===te.string){if(Mt.id=this.parseExprAtom(),this.type===te.braceL)Mt.body=this.$11();else this.semicolon();return this.finishNode(Mt,"TSModuleDeclaration")}return Mt.id=this.parseIdent(),this.checkLValSimple(Mt.id,Fl),this.$1o(Mt)}$1o(Mt){if(this.eat(te.dot)){let Gt=this.startNode();Gt.id=this.parseIdent(),Mt.body=this.$1o(Gt)}else Mt.body=this.$11();return this.finishNode(Mt,"TSModuleDeclaration")}$11(){this.enterScope(Rl);let Mt=this.startNode();this.enterScope(0),this.expect(te.braceL),Mt.body=[];while(!this.eat(te.braceR))Mt.body.push(this.parseStatement(null,!0));return this.exitScope(),this.exitScope(),this.finishNode(Mt,"TSModuleBlock")}$1p(Mt,Gt){if(Mt.isExport=Gt,Mt.id=this.parseIdent(),this.checkLValSimple(Mt.id,Pi),this.expect(te.eq),this.isContextual("require")&&this.$2()===ra){let Ut=this.startNode();this.next(),Ut.expression=this.$1e(),Mt.moduleReference=this.finishNode(Ut,"TSExternalModuleReference")}else Mt.moduleReference=this.$j();return this.semicolon(),this.finishNode(Mt,"TSImportEqualsDeclaration")}$2i(){let Mt=this.$d();if(this.input.charCodeAt(Mt)!==ps)return!1;let Gt=this.input.charCodeAt(Mt+1);return Gt!==ps&&Gt!==62}parseStatement(Mt,Gt,Ut){if(this.type===Vt)this.$1q(!0);let Ht=this.$1k();if(Ht)return Ht;return super.parseStatement(Mt,Gt,Ut)}parseVarStatement(Mt,Gt,Ut){return super.parseVarStatement(Mt,Gt,Ut||this.$5)}parseVarId(Mt,Gt){if(super.parseVarId(Mt,Gt),Mt.id.type==="Identifier"&&this.$u()&&!this.hasPrecedingLineBreak())this.next(),Mt.definite=!0;this.$h(Mt.id,!1)}parseCatchClauseParam(){let Mt=this.$h(this.parseBindingAtom(),!1),Gt=Mt.type==="Identifier";return this.enterScope(Gt?Dl:0),this.checkLValPattern(Mt,Gt?Ml:Pi),this.expect(te.parenR),Mt}parseImport(Mt){if(this.next(),Mt.importKind="value",this.type===te.string)Mt.specifiers=[],Mt.source=this.parseExprAtom();else{if(this.isContextual("type")){let Gt=this.$2();if(Gt===cs||Gt===rr||jt(Gt)&&this.$3()!=="from")Mt.importKind="type",this.next()}if(this.type===te.name&&this.$2i())return this.$1p(Mt,!1);Mt.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),Mt.source=this.$z()}return this.$1r(Mt),this.semicolon(),this.finishNode(Mt,"ImportDeclaration")}parseWithClause(){if(this.isContextual("assert")&&!this.hasPrecedingLineBreak())this.type=te._with;return this.type===te._with?super.parseWithClause():void 0}$1r(Mt){let Gt=this.parseWithClause();if(Gt)Mt.attributes=Gt}parseImportSpecifier(){return this.$1s("importKind",()=>super.parseImportSpecifier())}parseExportSpecifier(Mt){return this.$1s("exportKind",()=>super.parseExportSpecifier(Mt))}$1s(Mt,Gt){let Ut=this.isContextual("type")?this.$2():-1;if(Ut===or||Ut===ar||jt(Ut)&&this.$3()!=="as"){let qt=this.startNode();this.next();let zt=Gt();return this.$q(zt,qt),zt[Mt]="type",zt}let Ht=Gt();return Ht[Mt]="value",Ht}parseExport(Mt,Gt){if(this.next(),this.eat(te._import)){if(Mt.importKind="value",this.isContextual("type")&&jt(this.$2())&&this.$3()!=="from")Mt.importKind="type",this.next();return this.$1p(Mt,!0)}if(this.eat(te.eq))return Mt.expression=this.parseExpression(),this.semicolon(),this.finishNode(Mt,"TSExportAssignment");if(this.eatContextual("as"))return this.expectContextual("namespace"),Mt.id=this.parseIdent(),this.semicolon(),this.finishNode(Mt,"TSNamespaceExportDeclaration");if(Mt.exportKind="value",this.isContextual("type")){let qt=this.$2();if(qt===cs||qt===rr)Mt.exportKind="type",this.next()}if(this.eat(te.star))return this.parseExportAllDeclaration(Mt,Gt);if(this.eat(te._default)){if(this.isContextual("interface")&&this.$14())Mt.declaration=this.$1m(this.startNode());else if(this.isContextual("abstract")&&this.$3()==="class")Mt.declaration=this.$1n(this.startNode(),"nullableID");else Mt.declaration=this.parseExportDefaultDeclaration();return this.finishNode(Mt,"ExportDefaultDeclaration")}let Ut=this.isContextual("declare"),Ht=this.$1k(!0);if(Ht||this.shouldParseExportStatement()){if(Mt.declaration=Ht??this.parseStatement(null),Ut||Mt.declaration.type==="TSInterfaceDeclaration"||Mt.declaration.type==="TSTypeAliasDeclaration")Mt.exportKind="type";return Mt.specifiers=[],Mt.source=null,this.finishNode(Mt,"ExportNamedDeclaration")}if(Mt.declaration=null,Mt.specifiers=this.parseExportSpecifiers(Gt),this.eatContextual("from"))Mt.source=this.$z(),this.$1r(Mt);else{for(let qt of Mt.specifiers)if(this.checkUnreserved(qt.local),this.checkLocalExport(qt.local),qt.local.type==="Literal")this.raise(qt.local.start,"A string literal cannot be used as an exported binding without `from`.");Mt.source=null}return this.semicolon(),this.finishNode(Mt,"ExportNamedDeclaration")}parseFunction(Mt,Gt,Ut,Ht,qt){let zt=Gt&sa;if(zt)this.$f=Mt,this.$o=Mt.start;super.parseFunction(Mt,Gt,Ut,Ht,qt),this.$f=null;let Xt=!Mt.body;if(Xt)Mt.type="TSDeclareFunction";if(zt&&Mt.id){if(Xt){if(this.$5&&this.currentScope().flags&na)this.declareName(Mt.id.name,pr,Mt.id.start);this.checkLValSimple(Mt.id,Il)}else if(!(Gt&jl)){let Jt=Ll;if(this.strict||Mt.generator||Mt.async)Jt=this.treatFunctionsAsVar?Ol:Pi;this.checkLValSimple(Mt.id,Jt)}}return Mt}parseFunctionParams(Mt){if(this.$1())Mt.typeParameters=this.$8();if(super.parseFunctionParams(Mt),this.type===te.colon)Mt.returnType=this.$6(!0)}parseFunctionBody(Mt,Gt,Ut,Ht){if(Ut&&this.type===te.colon)Mt.returnType=this.$6(!0);if(Gt||this.type===te.braceL||Mt.start!==this.$o){super.parseFunctionBody(Mt,Gt,Ut,Ht);return}this.semicolon(),this.exitScope()}parseMethod(Mt,Gt,Ut){let Ht=this.$k;this.$k=null;let qt=super.parseMethod(Mt,Gt,Ut);if(!qt.body)qt.type="TSDeclareMethod";if(Ht)qt.typeParameters=Ht;return qt}parseBindingList(Mt,Gt,Ut,Ht){let qt=Ht===!0||this.$l;return this.$l=!1,super.parseBindingList(Mt,Gt,Ut,qt)}$s(Mt){if(!Mt&&!this.$b())return!1;let Gt=this.$2();return Gt===Wl||Gt===cs||Gt===rr||Gt===oa||Gt===Ul||Gt===or||Gt===ar||Gt>=48&&Gt<=57||jt(Gt)}parseAssignableListItem(Mt){let Gt=this.$12(),Ut=this.start,Ht=this.startLoc,qt,zt=!1,Xt=!1;if(Mt)while(this.type===te.name&&_l.has(this.value)&&!this.containsEsc&&this.$s(!1)){if(this.value==="readonly")zt=!0;else if(this.value==="override")Xt=!0;else qt=this.value;this.next()}let Jt;if(this.type===te._this)Jt=this.startNode(),Jt.name="this",this.next(),this.finishNode(Jt,"Identifier");else Jt=this.parseBindingAtom();let Qt=this.type===te.eq?this.parseMaybeDefault(Ut,Ht,Jt):this.parseMaybeDefault(Jt.start,Jt.loc?.start,this.$h(Jt,!0));if(Gt.length>0)Qt.decorators=Gt;if(!qt&&!zt&&!Xt)return Qt;let Yt=this.startNodeAt(Ut,Ht);if(qt)Yt.accessibility=qt;if(zt)Yt.readonly=!0;if(Xt)Yt.override=!0;return Yt.parameter=Qt,this.finishNode(Yt,"TSParameterProperty")}parseBindingListItem(Mt){if(Mt.type==="RestElement")this.$h(Mt,!0);return Mt}checkLValSimple(Mt,Gt,Ut){if(this.$f&&Mt===this.$f.id){this.$f=null;return}if(!Gt&&ta.has(Mt.type)){this.checkLValSimple(Mt.expression,Gt,Ut);return}switch(Mt.type){case"TSParameterProperty":this.checkLValInnerPattern(Mt.parameter,Gt,Ut);return;case"Identifier":if(Mt.name==="this")return}super.checkLValSimple(Mt,Gt,Ut)}toAssignable(Mt,Gt,Ut){if(Mt&&!Gt&&ta.has(Mt.type))return Mt;return super.toAssignable(Mt,Gt,Ut)}declareName(Mt,Gt,Ut){let Ht=this.currentScope();if(Gt&pr){this.$1t(Ht,Mt),Ht.$1u??=[],Ht.$1u.push(Mt);return}if(Gt===sr||Gt===ia){if(Ht.$13??=[],Gt===sr&&Sn(Ht.$13,Mt))this.raise(Ut,`type '${Mt}' has already been declared.`);Ht.$13.push(Mt),this.$1t(Ht,Mt);return}if(Gt&ca){if(Ht.$1v??=[],Sn(Ht.$1v,Mt))return;super.declareName(Mt,Pi,Ut),Ht.$1v.push(Mt);return}super.declareName(Mt,Gt,Ut)}$1t(Mt,Gt){if(this.inModule&&Mt.flags&na)delete this.undefinedExports[Gt]}checkLocalExport(Mt){for(let Gt=this.scopeStack.length-1;Gt>=0;Gt--){let Ut=this.scopeStack[Gt];if(Sn(Ut.$13,Mt.name)||Sn(Ut.$1u,Mt.name))return}super.checkLocalExport(Mt)}checkExport(){}raiseRecoverable(Mt,Gt){if(Gt==="Duplicate constructor in the same class")return;super.raiseRecoverable(Mt,Gt)}$12(){let Mt=[];while(this.type===Vt)Mt.push(this.$1w());return Mt}$1q(Mt){let Gt=this.$9[this.$9.length-1];while(this.type===Vt)Gt.push(this.$1w());if(this.type===te._export){if(!Mt)this.unexpected()}else if(this.type!==te._class&&!((this.isContextual("abstract")||this.isContextual("declare"))&&this.$3()==="class"))this.raise(this.start,"Leading decorators must be attached to a class declaration.")}$1w(){let Mt=this.startNode();this.next(),this.$9.push([]);let Gt=this.start,Ut=this.startLoc,Ht;if(this.type===te.parenL){if(this.next(),Ht=this.parseExpression(),this.expect(te.parenR),this.options.preserveParens){let zt=this.startNodeAt(Gt,Ut);zt.expression=Ht,Ht=this.finishNode(zt,"ParenthesizedExpression")}}else{Ht=this.parseIdent(!1);while(this.eat(te.dot)){let zt=this.startNodeAt(Gt,Ut);zt.object=Ht,zt.property=this.parseIdent(!0),zt.computed=!1,Ht=this.finishNode(zt,"MemberExpression")}}let qt=this.$p()?this.$e():void 0;if(this.eat(te.parenL)){let zt=this.startNodeAt(Ht.start,Ht.loc?.start);if(zt.callee=Ht,zt.arguments=this.parseExprList(te.parenR,!1,!1),qt)zt.typeArguments=qt;Ht=this.finishNode(zt,"CallExpression")}else if(qt){let zt=this.startNodeAt(Ht.start,Ht.loc?.start);zt.expression=Ht,zt.typeArguments=qt,Ht=this.finishNode(zt,"TSInstantiationExpression")}return Mt.expression=Ht,this.$9.pop(),this.finishNode(Mt,"Decorator")}shouldParseExportStatement(){return this.type===Vt||super.shouldParseExportStatement()}parseExprAtom(Mt,Gt,Ut){if(this.type===Vt)this.$1q(!1);return super.parseExprAtom(Mt,Gt,Ut)}parseProperty(Mt,Gt){if(Mt||this.type!==Vt)return super.parseProperty(Mt,Gt);let Ut=this.$12(),Ht=super.parseProperty(Mt,Gt);if(Ht.type==="SpreadElement")this.raise(Ht.start,"Decorators can't be used with SpreadElement");return Ht.decorators=Ut,Ht}parseClassId(Mt,Gt){let Ut=this.$9.length-1,Ht=this.$9[Ut];if(Ht.length>0)Mt.decorators=Ht,this.$q(Mt,Ht[0]),this.$9[Ut]=[];if(!this.isContextual("implements")||Gt===!0)super.parseClassId(Mt,Gt);if(this.$1())Mt.typeParameters=this.$8()}parseClassSuper(Mt){if(super.parseClassSuper(Mt),Mt.superClass&&this.$1())Mt.superTypeParameters=this.$e();if(this.eatContextual("implements"))Mt.implements=this.$a(()=>this.$1j())}parseClassElement(Mt){if(this.type===Vt){let Xt=this.$12();if(this.type===te.braceR)this.raise(this.start,"Decorators must be attached to a class element.");let Jt=this.parseClassElement(Mt);return Jt.decorators=Xt,this.$q(Jt,Xt[0]),Jt}if(this.eat(te.semi))return null;let Gt=this.startNode();while(this.type===te.name&&Pl.has(this.value)&&!this.containsEsc&&this.$s(this.value==="static")){let Xt=this.value;if(this.next(),Xt==="static"&&this.type===te.braceL)return this.next(),this.parseClassStaticBlock(Gt),Gt;if(Xt==="public"||Xt==="private"||Xt==="protected")Gt.accessibility=Xt;else Gt[Xt]=!0}if(this.type===te.bracketL&&this.$1g())return this.$1h(Gt);Gt.static??=!1;let Ut="",Ht=!1,qt=!1,zt="method";if(this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===te.star)&&!this.canInsertSemicolon())qt=!0;else Ut="async";if(!Ut&&this.eat(te.star))Ht=!0;if(!Ut&&!qt&&!Ht){let Xt=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())zt=Xt;else Ut=Xt}if(Ut)Gt.computed=!1,Gt.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Gt.key.name=Ut,this.finishNode(Gt.key,"Identifier");else this.parseClassElementName(Gt);if(this.eat(te.question))Gt.optional=!0;if(this.type===te.parenL||this.$1()||zt!=="method"||Ht||qt){let Xt=Gt.key,Jt=!Gt.static&&!Gt.computed&&(Xt.type==="Identifier"&&Xt.name==="constructor"||Xt.type==="Literal"&&Xt.value==="constructor");if(Gt.kind=Jt?"constructor":zt,this.$1())Gt.typeParameters=this.$8();this.$l=Jt,this.$o=this.start,this.parseClassMethod(Gt,Ht,qt,Jt&&Mt)}else{if(!Gt.optional&&this.$u())this.next(),Gt.definite=!0;if(this.type===te.colon)Gt.typeAnnotation=this.$6();this.parseClassField(Gt)}return Gt}parseMaybeAssign(Mt,Gt,Ut){if(this.$p()){let Ht=this.$g(()=>{let qt=this.$8(),zt=super.parseMaybeAssign(Mt,Gt,Ut);if(zt.type!=="ArrowFunctionExpression")return;return zt.typeParameters=qt,this.$q(zt,qt),zt});if(Ht)return Ht}return super.parseMaybeAssign(Mt,Gt,Ut)}parseMaybeUnary(Mt,Gt,Ut,Ht){if(this.$p()){let qt=this.startNode();return qt.typeAnnotation=this.$a(()=>{this.next();let zt=this.$0();if(!this.$c())this.unexpected();return this.next(),zt}),qt.expression=this.parseMaybeUnary(null,!1,!1,Ht),this.finishNode(qt,"TSTypeAssertion")}return super.parseMaybeUnary(Mt,Gt,Ut,Ht)}parseMaybeConditional(Mt,Gt){let Ut=this.start,Ht=this.startLoc,qt=this.parseExprOps(Mt,Gt);if(this.checkExpressionErrors(Gt))return qt;if(this.type===te.question&&!(qt.type==="ArrowFunctionExpression"&&qt.start===Ut)&&!this.$2j()){this.next();let zt=this.startNodeAt(Ut,Ht);return zt.test=qt,zt.consequent=this.parseMaybeAssign(),this.expect(te.colon),zt.alternate=this.parseMaybeAssign(Mt),this.finishNode(zt,"ConditionalExpression")}return qt}$2j(){let Mt=this.$d(),Gt=this.input.charCodeAt(Mt);if(Gt===aa||Gt===Gl||Gt===Vl)return!0;return Gt===ps&&this.input.charCodeAt(Mt+1)!==ps}parseParenItem(Mt){return this.$h(Mt,!0)}$1x(){if(this.type!==te.colon)return!0;let Mt=this.$g(()=>{let Gt=this.$6(!0);return this.type===te.arrow&&!this.canInsertSemicolon()?Gt:void 0});if(!Mt)return!1;return this.$7=Mt,!0}shouldParseArrow(Mt){return this.$1x()&&super.shouldParseArrow(Mt)}shouldParseAsyncArrow(){return this.$1x()&&super.shouldParseAsyncArrow()}parseArrowExpression(Mt,Gt,Ut,Ht){if(this.$7)Mt.returnType=this.$7,this.$7=null;return super.parseArrowExpression(Mt,Gt,Ut,Ht)}parseExprList(Mt,Gt,Ut,Ht){if(!this.$m)return super.parseExprList(Mt,Gt,Ut,Ht);this.$m=!1;let qt=[],zt=!0;while(!this.eat(Mt)){if(zt)zt=!1;else if(this.expect(te.comma),Gt&&this.afterTrailingComma(Mt))break;if(this.type===te.ellipsis){let Xt=this.parseSpread(Ht);if(this.eat(te.question))Xt.optional=!0;if(this.type===te.colon)Xt.typeAnnotation=this.$6();qt.push(Xt)}else qt.push(this.parseMaybeAssign(!1,Ht,this.parseParenItem))}return qt}parseSubscript(Mt,Gt,Ut,Ht,qt,zt,Xt){if(this.$u()&&!this.hasPrecedingLineBreak()){let Qt=this.startNodeAt(Gt,Ut);return this.exprAllowed=!1,this.next(),Qt.expression=Mt,this.finishNode(Qt,"TSNonNullExpression")}if(qt&&this.$1()){let Qt=this.$g(()=>this.$2k(Gt,Ut,Xt));if(Qt)return Qt}let Jt=this.type===te.questionDot&&this.$2()===pa;if(this.$1()||Jt||this.type===te.bitShift&&this.value==="<<"){let Qt=this.$g(()=>{if(Jt)this.next();this.$p();let Yt=this.$e();if(this.type===te.parenL&&!Ht)return Yt;if(this.type===te.backQuote)return Jt?void 0:Yt;if(Jt)return;if(this.$c()||this.type===te.bitShift||this.type.startsExpr&&this.type!==te.parenL&&!this.hasPrecedingLineBreak())return;return Yt});if(Qt){let Yt=this.startNodeAt(Gt,Ut);if(this.type===te.parenL&&!Ht){if(this.next(),Yt.callee=Mt,Yt.arguments=this.parseExprList(te.parenR,!0,!1),Yt.typeArguments=Qt,Jt)Mt.optional=!0;if(Jt||zt)Yt.optional=Jt;return this.finishNode(Yt,"CallExpression")}if(this.type===te.backQuote)return Yt.tag=Mt,Yt.quasi=this.parseTemplate({isTagged:!0}),Yt.typeArguments=Qt,this.finishNode(Yt,"TaggedTemplateExpression");return Yt.expression=Mt,Yt.typeArguments=Qt,this.finishNode(Yt,"TSInstantiationExpression")}}if(qt&&this.type===te.parenL)this.$m=!0;return super.parseSubscript(Mt,Gt,Ut,Ht,qt,zt,Xt)}$2k(Mt,Gt,Ut){let Ht=this.startNodeAt(Mt,Gt);if(Ht.typeParameters=this.$8(),this.expect(te.parenL),Ht.params=this.parseBindingList(te.parenR,!1,!0),this.type===te.colon)Ht.returnType=this.$6(!0);if(this.type!==te.arrow||this.canInsertSemicolon())return;return this.next(),this.parseArrowExpression(Ht,Ht.params,!0,Ut)}parseDynamicImport(Mt){if(this.next(),Mt.source=this.parseMaybeAssign(),this.eat(te.comma)&&this.type!==te.parenR)Mt.arguments=[this.parseExpression()];return this.expect(te.parenR),this.finishNode(Mt,"ImportExpression")}parseNew(){let Mt=super.parseNew();if(Mt.callee?.type!=="TSInstantiationExpression")return Mt;let Gt=this.startNodeAt(Mt.start,Mt.loc?.start);return Gt.callee=Mt.callee.expression,Gt.typeArguments=Mt.callee.typeArguments,Gt.arguments=Mt.arguments,this.finishNodeAt(Gt,"NewExpression",Mt.end,Mt.loc?.end)}parseExprOp(Mt,Gt,Ut,Ht,qt){if(te._in.binop>Ht&&this.type===te.name&&(this.value==="as"||this.value==="satisfies")&&!this.containsEsc&&!this.hasPrecedingLineBreak()){let zt=this.value==="satisfies",Xt=this.startNodeAt(Gt,Ut);return Xt.expression=Mt,Xt.typeAnnotation=this.$a(()=>{if(this.next(),!zt&&this.type===te._const){let Jt=this.startNode();return Jt.typeName=this.parseIdent(!0),this.finishNode(Jt,"TSTypeReference")}return this.$0()}),this.finishNode(Xt,zt?"TSSatisfiesExpression":"TSAsExpression"),this.parseExprOp(Xt,Gt,Ut,Ht,qt)}return super.parseExprOp(Mt,Gt,Ut,Ht,qt)}parseGetterSetter(Mt){Mt.kind=Mt.key.name,super.parseGetterSetter(Mt)}parsePropertyValue(Mt,Gt,Ut,Ht,qt,zt,Xt,Jt){if(!Gt&&this.$1()){if(this.$k=this.$8(),this.type!==te.parenL)this.unexpected();Mt.kind="init"}return super.parsePropertyValue(Mt,Gt,Ut,Ht,qt,zt,Xt,Jt)}}return Wt});function ue(){throw Error('sveast: parsing TypeScript needs `typescript` from "sveast/typescript": createParser({ typescript }) or createModuleParser({ typescript })')}var Kl=/^\t+/;class e extends Error{name="ParseError";code;reason;position;start;end;frame;constructor(ee,te,Oe){super(`${Oe}
17
+ https://svelte.dev/e/${te}`);this.code=te,this.reason=Oe;let Ot=typeof ee==="number"?ee:ee?.start,jt=typeof ee==="number"?ee:ee?.end;if(Ot!==void 0)this.position=[Ot,jt??Ot],this.start=x(this.position[0]),this.end=x(this.position[1]),this.frame=ql(this.start.line-1,this.end.column)}}var la=(ee)=>ee.replace(Kl,(te)=>" ".repeat(te.length));function ql(ee,te){let Oe=Math.max(0,ee-2),Ot=[];for(let Vt=Oe;Vt<ee+3;Vt++){let Wt=bo(Vt);if(Wt===void 0)break;Ot.push(Wt)}let jt=String(Oe+Ot.length+1).length;return Ot.map((Vt,Wt)=>{let Mt=`${String(Oe+Wt+1).padStart(jt," ")}: ${la(Vt)}`;if(Oe+Wt!==ee)return Mt;return`${Mt}
18
+ ${" ".repeat(jt+2+la(Vt.slice(0,te)).length)}^`}).join(`
19
+ `)}function je(ee){throw new e(ee,"attribute_duplicate","Attributes need to be unique")}function Ve(ee){throw new e(ee,"attribute_empty_shorthand","Attribute shorthand cannot be empty")}function qe(ee,te){throw new e(ee,"block_duplicate_clause",`${te} cannot appear more than once within a block`)}function Ge(ee){throw new e(ee,"block_invalid_continuation_placement","{:...} block is invalid at this position (did you forget to close the preceding element or block?)")}function We(ee){throw new e(ee,"block_invalid_elseif","'elseif' should be 'else if'")}function He(ee,te,Oe){throw new e(ee,"block_invalid_placement",`{#${te} ...} block cannot be ${Oe}`)}function Ue(ee){throw new e(ee,"block_unclosed","Block was left open")}function ze(ee){throw new e(ee,"block_unexpected_close","Unexpected block closing tag")}function Je(ee){throw new e(ee,"const_tag_invalid_expression","{@const ...} must consist of a single variable declaration")}function Ke(ee){throw new e(ee,"css_empty_declaration","Declaration cannot be empty")}function ke(ee){throw new e(ee,"css_expected_identifier","Expected a valid CSS identifier")}function Xe(ee){throw new e(ee,"css_selector_invalid","Invalid selector")}function Ye(ee){throw new e(ee,"debug_tag_invalid_arguments","{@debug ...} arguments must be identifiers, not arbitrary expressions")}function we(ee){throw new e(ee,"declaration_tag_invalid_type","Declaration tags must be `let` or `const` declarations")}function Qe(ee){throw new e(ee,"directive_invalid_value","Directive value must be a JavaScript expression enclosed in curly braces")}function Ze(ee,te){throw new e(ee,"directive_missing_name",`\`${te}\` name cannot be empty`)}function et(ee,te){throw new e(ee,"element_invalid_closing_tag",`\`</${te}>\` attempted to close an element that was not open`)}function tt(ee,te,Oe){throw new e(ee,"element_invalid_closing_tag_autoclosed",`\`</${te}>\` attempted to close element that was already automatically closed by \`<${Oe}>\` (cannot nest \`<${Oe}>\` inside \`<${te}>\`)`)}function Pe(ee,te){throw new e(ee,"element_unclosed",`\`<${te}>\` was left open`)}function Ae(ee){throw new e(ee,"expected_attribute_value","Expected attribute value")}function nt(ee){throw new e(ee,"expected_block_type","Expected 'if', 'each', 'await', 'key' or 'snippet'")}function De(ee){throw new e(ee,"expected_identifier","Expected an identifier")}function rt(ee){throw new e(ee,"expected_pattern","Expected identifier or destructure pattern")}function it(ee){throw new e(ee,"expected_tag","Expected 'html', 'render', 'attach', 'const', or 'debug'")}function A(ee,te){throw new e(ee,"expected_token",`Expected token ${te}`)}function st(ee){throw new e(ee,"expected_whitespace","Expected whitespace")}function zl(ee,te){throw new e(ee,"js_parse_error",`${te}`)}function ot(ee){throw new e(ee,"render_tag_invalid_expression","`{@render ...}` tags can only contain call expressions")}function at(ee){throw new e(ee,"script_duplicate","A component can have a single top-level `<script>` element and/or a single top-level `<script module>` element")}function lt(ee,te){throw new e(ee,"script_invalid_attribute_value",`If the \`${te}\` attribute is supplied, it must be a boolean attribute`)}function pt(ee){throw new e(ee,"script_invalid_context",'If the context attribute is supplied, its value must be "module"')}function ct(ee,te){throw new e(ee,"script_reserved_attribute",`The \`${te}\` attribute is reserved and cannot be used`)}function ut(ee){throw new e(ee,"style_duplicate","A component can have a single top-level `<style>` element")}function dt(ee){throw new e(ee,"svelte_component_invalid_this","Invalid component definition — must be an `{expression}`")}function ft(ee){throw new e(ee,"svelte_component_missing_this","`<svelte:component>` must have a 'this' attribute")}function Ne(ee){throw new e(ee,"svelte_element_missing_this","`<svelte:element>` must have a 'this' attribute with a value")}function mt(ee,te){throw new e(ee,"svelte_meta_duplicate",`A component can only have one \`<${te}>\` element`)}function ht(ee,te){throw new e(ee,"svelte_meta_invalid_content",`<${te}> cannot have children`)}function gt(ee,te){throw new e(ee,"svelte_meta_invalid_placement",`\`<${te}>\` tags cannot be inside elements or blocks`)}function yt(ee,te){throw new e(ee,"svelte_meta_invalid_tag",`Valid \`<svelte:...>\` tag names are ${te}`)}function xt(ee){throw new e(ee,"svelte_options_deprecated_tag",'"tag" option is deprecated — use "customElement" instead')}function Et(ee){throw new e(ee,"svelte_options_invalid_attribute","`<svelte:options>` can only receive static attributes")}function de(ee,te){throw new e(ee,"svelte_options_invalid_attribute_value",`Value must be ${te}, if specified`)}function vt(ee){throw new e(ee,"svelte_options_invalid_customelement",'"customElement" must be a string literal defining a valid custom element name or an object of the form { tag?: string; shadow?: "open" | "none" | `ShadowRootInit`; props?: { [key: string]: { attribute?: string; reflect?: boolean; type: .. } } }')}function St(ee){throw new e(ee,"svelte_options_invalid_customelement_props",'"props" must be a statically analyzable object literal of the form "{ [key: string]: { attribute?: string; reflect?: boolean; type?: "String" | "Boolean" | "Number" | "Array" | "Object" }"')}function bt(ee){throw new e(ee,"svelte_options_invalid_customelement_shadow",'"shadow" must be either "open", "none" or `ShadowRootInit` object.')}function _e(ee){throw new e(ee,"svelte_options_invalid_tagname","Tag name must be lowercase and hyphenated")}function Tt(ee){throw new e(ee,"svelte_options_reserved_tagname","Tag name is reserved")}function Ct(ee,te){throw new e(ee,"svelte_options_unknown_attribute",`\`<svelte:options>\` unknown attribute '${te}'`)}function kt(ee){throw new e(ee,"tag_invalid_name","Expected a valid element or component name. Components must have a valid variable name or dot notation expression")}function wt(ee,te,Oe){throw new e(ee,"tag_invalid_placement",`{@${te} ...} tag cannot be ${Oe}`)}function f(ee){throw new e(ee,"unexpected_eof","Unexpected end of input")}function Pt(ee,te){throw new e(ee,"unexpected_reserved_word",`'${te}' is a reserved word in JavaScript and cannot be used here`)}function At(ee){throw new e(ee,"unterminated_string_constant","Unterminated string constant")}function Dt(ee){throw new e(ee,"void_element_invalid_content","Void elements cannot have children or closing tags")}var di="",da=[],us=0,fn=[],mn=0;function Xl(ee,te){di=ee,da=te,us=0}function Jl(){return us}function Yl(ee,te,Oe,Ot){us=Ot}function Ql(ee,te,Oe,Ot,jt,Vt){us=Ot;let Wt=te;if(ee&&Wt.includes(`
20
+ `)){let Gt=di.lastIndexOf(`
21
+ `,Oe-1)+1,Ut=Gt,Ht=di.charCodeAt(Ut);while(Ht===32||Ht===9)Ht=di.charCodeAt(++Ut);if(Ut>Gt)Wt=Zl(Wt,di.slice(Gt,Ut))}let Mt={type:ee?"Block":"Line",value:Wt,start:Oe,end:Ot};if(jt&&Vt)Mt.loc={start:jt,end:Vt};da.push(Mt)}function Zl(ee,te){let Oe=ee.startsWith(te)?te.length:0,Ot="",jt=ee.indexOf(`
22
+ `,Oe);while(jt!==-1){if(Ot+=ee.slice(Oe,jt+1),Oe=jt+1,ee.startsWith(te,Oe))Oe+=te.length;jt=ee.indexOf(`
23
+ `,Oe)}return Ot+ee.slice(Oe)}function eu(ee,te,Oe){let Ot=0,jt=te.length;while(Ot<jt){let Vt=Ot+jt>>>1;if(te[Vt].start<Oe)Ot=Vt+1;else jt=Vt}if(Ot>=te.length)return;if(fn=te.slice(Ot).map(({type:Vt,value:Wt,start:Mt,end:Gt})=>({type:Vt,value:Wt,start:Mt,end:Gt})),mn=0,lr(ee,void 0,!1),mn<fn.length&&(fn[mn].start>=ee.end||ee.type==="Program")){ee.trailingComments??=[];while(mn<fn.length)ee.trailingComments.push(fn[mn++])}}var tu=new Map([["BlockStatement","body"],["Program","body"],["ArrayExpression","elements"],["ObjectExpression","properties"]]);function ua(ee,te){for(let Oe=ee;Oe<te;Oe++){let Ot=di.charCodeAt(Oe);if(Ot!==44&&Ot!==41&&Ot!==32&&Ot!==9)return!0}return!1}function lr(ee,te,Oe){while(mn<fn.length&&fn[mn].start<ee.start)ee.leadingComments??=[],ee.leadingComments.push(fn[mn++]);if(mn>=fn.length)return;let Ot=fn[mn].start;if(Ot<ee.end||!ua(ee.end,Ot)){let jt=Jn(ee),Vt=tu.get(ee.type),Wt=Vt===void 0?void 0:jt[Vt],Mt=Array.isArray(Wt)&&Wt.length===0;for(let Gt in jt){if(mn>=fn.length)return;if(Gt==="type")continue;let Ut=jt[Gt];if(Array.isArray(Ut)){let Ht=Gt===Vt;for(let qt=0;qt<Ut.length;qt++){let zt=Ut[qt];if(Mn(zt))lr(zt,ee,Ht?qt===Ut.length-1:Mt)}}else if(Mn(Ut))lr(Ut,ee,Mt)}if(mn>=fn.length)return}if(te!==void 0&&ee.end===te.end)return;if(Oe)while(mn<fn.length){if(te&&fn[mn].start>=te.end)break;ee.trailingComments??=[],ee.trailingComments.push(fn[mn++])}else if(ee.end<=fn[mn].start&&!ua(ee.end,fn[mn].start))ee.trailingComments=[fn[mn++]]}var fe=new Set("arguments await break case catch class const continue debugger default delete do else enum eval export extends false finally for function if implements import in instanceof interface let new null package private protected public return static super switch this throw true try typeof var void while with yield".split(" ")),hs=!1,_i=1,nu=2,iu=32,su=256,ru=_i|nu|su,ou=2,au=3,pu=4,cu=/\r\n?|\n|\u2028|\u2029/,ha=new Map;function ls(ee){if(!(ee instanceof RegExp))return ee;let te=ha.get(ee);if(!te){let Oe=new Set(ee.source.slice(4,-2).split("|"));te={test:(Ot)=>Oe.has(Ot)},ha.set(ee,te)}return te}var ur=ki((ee)=>class extends ee{declareName(te,Oe,Ot){let jt=!1;if(Oe===ou){let Vt=this.currentScope();if(jt=Sn(Vt.lexical,te)||Sn(Vt.functions,te)||Sn(Vt.var,te),Vt.lexical.push(te),this.inModule&&Vt.flags&_i)delete this.undefinedExports[te]}else if(Oe===pu)this.currentScope().lexical.push(te);else if(Oe===au){let Vt=this.currentScope();jt=this.treatFunctionsAsVar?Sn(Vt.lexical,te):Sn(Vt.lexical,te)||Sn(Vt.var,te),Vt.functions.push(te)}else for(let Vt=this.scopeStack.length-1;Vt>=0;--Vt){let Wt=this.scopeStack[Vt];if(Sn(Wt.lexical,te)&&!(Wt.flags&iu&&Wt.lexical[0]===te)||!this.treatFunctionsAsVarInScope(Wt)&&Sn(Wt.functions,te)){jt=!0;break}if(Wt.var.push(te),this.inModule&&Wt.flags&_i)delete this.undefinedExports[te];if(Wt.flags&ru)break}if(jt)this.raiseRecoverable(Ot,`Identifier '${te}' has already been declared`)}}),hr=ki((ee)=>{let{keywordTypes:te,tokTypes:Oe}=ee.acorn,Ot=new Map("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this const class extends export import super".split(" ").map((Vt)=>[Vt,te[Vt]])),jt;return class extends ee{constructor(Vt,Wt,Mt){super(Vt,Wt,Mt);this.keywords=ls(this.keywords),this.reservedWords=ls(this.reservedWords),this.reservedWordsStrict=ls(this.reservedWordsStrict),this.reservedWordsStrictBind=ls(this.reservedWordsStrictBind),jt??=this.context[0]}reset(Vt,Wt,Mt){if(super.reset?.(Vt,Wt,Mt),this.input=Vt,this.containsEsc=!1,this.pos=Wt,Mt)this.lineStart=Wt-Mt.column,this.curLine=Mt.line;else this.lineStart=Vt.lastIndexOf(`
24
+ `,Wt-1)+1,this.curLine=this.options.locations?Vt.slice(0,this.lineStart).split(cu).length:1;this.type=Oe.eof,this.value=null,this.start=this.end=Wt,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=Wt;let Gt=this.context;if(Gt.length!==1||Gt[0]!==jt)this.context=this.initialContext();if(this.exprAllowed=!0,this.strict=!0,this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels.length>0)this.labels=[];for(let qt in this.undefinedExports){this.undefinedExports=Object.create(null);break}let Ut=this.scopeStack,Ht=Ut[0];if(Ut.length!==1||Ht.flags!==_i||Ht.var.length>0||Ht.lexical.length>0||Ht.functions.length>0||Ht.tsTypes!==void 0||Ht.tsExportOnly!==void 0||Ht.tsEnums!==void 0)this.scopeStack=[],this.enterScope(_i);if(this.regexpState=null,this.privateNameStack.length>0)this.privateNameStack=[];this.inTemplateElement=!1}parseParenAndDistinguishExpression(Vt,Wt){let Mt=super.parseParenAndDistinguishExpression(Vt,Wt);if(Mt.type==="ParenthesizedExpression")hs=!0;return Mt}checkUnreserved(Vt){if(fe.has(Vt.name))super.checkUnreserved(Vt)}canInsertSemicolon(){let Vt=this.type;return Vt===Oe.eof||Vt===Oe.braceR||Ai(this.input,this.lastTokEnd,this.start)}checkLocalExport(){}skipSpace(){let Vt=this.input,Wt=this.options.locations,Mt=this.pos,Gt=Vt.charCodeAt(Mt);for(;;)if(Gt===32||Gt===9)Gt=Vt.charCodeAt(++Mt);else if(Gt===10){if(Gt=Vt.charCodeAt(++Mt),Wt)this.curLine++,this.lineStart=Mt}else break;if(this.pos=Mt,Gt===47||Gt<33||Gt>=128)super.skipSpace()}readWord1(){let Vt=this.input,Wt=this.pos,Mt=Wt,Gt=Vt.charCodeAt(Mt),Ut=0;while(Gt>=97&&Gt<=122||Gt>=65&&Gt<=90||Gt>=48&&Gt<=57||Gt===95||Gt===36)Ut=Math.imul(Ut,31)+Gt|0,Gt=Vt.charCodeAt(++Mt);if(Gt>=128||Gt===92)return super.readWord1();return this.containsEsc=!1,this.pos=Mt,vo(Vt,Wt,Mt,Ut)}readWord(){let Vt=this.readWord1();return this.finishToken(Ot.get(Vt)??Oe.name,Vt)}}}),fa=as(ur,hr),lu=/ \(\d+:\d+\)$/;function $i(ee){return ee}function ma(ee){return ee instanceof SyntaxError&&"pos"in ee&&typeof ee.pos==="number"}function dr(ee,te,Oe,Ot,jt,Vt=ee.root.comments.length){let Wt=ee.root.comments;Xl(te,Wt);let Mt={onComment:ee.comments?Ql:Yl,sourceType:"module",ecmaVersion:16,locations:ee.loc,preserveParens:Ot};if(ee.lfOnly)Mt.startLocation=x(Oe);let Gt=ee.isTypeScript?ee.typescript:fa;if(!Gt)ue();let Ut;try{Ut=jt(Gt,Mt)}catch(Ht){if(!ma(Ht))throw Ht;zl(Ht.pos,Ht.message.replace(lu,""))}if(Wt.length>Vt)eu($i(Ut),Wt,Oe);return Ut}function me(ee,te,Oe=0){return $i(dr(ee,te,0,!1,(Ot,jt)=>{if(Oe>0&&jt.locations)jt.startLocation=x(Oe);let Vt=new Ot(jt,te,Oe).parse();return Vt.start=0,Vt},0))}function uu(ee,te){if(!te)return{line:1,column:0};let{column:Oe}=x(ee);return{line:So(ee-Oe)+1,column:Oe}}var hu={count:0},cr,du=(ee)=>ee.parseExpression();function fu(ee,te,Oe,Ot,jt){let Vt=cr;if(cr=void 0,Vt?.ParserClass===ee&&Vt.onComment===te.onComment&&Vt.locations===te.locations&&Vt.parser.reset)Vt.parser.reset(Oe,Ot,te.startLocation);else Vt={ParserClass:ee,onComment:te.onComment,locations:te.locations,parser:new ee(te,Oe,Ot)};let Wt=Vt.parser;Wt.nextToken();let Mt=jt(Wt);return Wt.input="",cr=Vt,Mt}function ga(ee,te,Oe,Ot){return hu.count+=1,hs=!1,dr(ee,te,Oe,!0,(jt,Vt)=>(Vt.startLocation??=uu(Oe,Vt.locations),fu(jt,Vt,te,Oe,Ot)))}function F(ee,te,Oe,Ot=!1){let jt=$i(ga(ee,te,Oe,du)),Vt=Math.max(jt.end,Jl());return{node:hs&&!Ot?fr(jt):jt,end:Vt}}function Nt(ee,te,Oe){let Ot=ee.root.comments.length,jt=!0,Vt=ga(ee,te,Oe,(Mt)=>{let Gt={shorthandAssign:-1,trailingComma:-1,parenthesizedAssign:-1,parenthesizedBind:-1,doubleProto:-1},Ut=Mt.parseMaybeConditional(void 0,Gt);if(Mt.type!==fa.acorn.tokTypes.eof)return jt=!1,Ut;let Ht=Mt.toAssignable(Ut,!1,Gt);return Mt.checkLValPattern(Ht),Ht});if(!jt){ee.root.comments.length=Ot;return}let Wt=$i(Vt);return hs?fr(Wt):Wt}function _t(ee,te,Oe){return $i(dr(ee,te,Oe,!1,(Ot,jt)=>{let Vt=new Ot(jt,te,Oe);try{return Vt.nextToken(),Vt.parseStatement(null,!0,Object.create(null))}catch(Wt){if(ma(Wt)&&Wt.pos===te.length)f(te.length);throw Wt}}))}function fr(ee){let te=ee;while(te.type==="ParenthesizedExpression")te=te.expression;return H(te,fr),te}var B=as(ur,ce,hr);function ya(ee,te,Oe){return ne(ee),me({isTypeScript:te.typescript??!1,typescript:Oe,loc:te.loc??!1,comments:te.comments??!0,root:{comments:[]}},ee)}function he(ee,te={}){return ya(ee,te,B)}function ge(ee,te){let Oe=u(ee.name,te.name);if(Oe!==0)return Oe;let Ot=u(ee.type,te.type);if(Ot!==0)return Ot;if(ee.type==="forwarded"&&te.type==="forwarded"){let jt=u(ee.element,te.element);if(jt!==0)return jt}return u(ee.detail??"",te.detail??"")}function mu(ee,te){let Oe=ee.length+1,Ot=te.length+1,jt=Array.from({length:Oe},()=>Array(Ot).fill(0));for(let Vt=0;Vt<Oe;Vt++)jt[Vt][0]=Vt;for(let Vt=0;Vt<Ot;Vt++)jt[0][Vt]=Vt;for(let Vt=1;Vt<Oe;Vt++)for(let Wt=1;Wt<Ot;Wt++){let Mt=ee[Vt-1]===te[Wt-1]?0:1;if(jt[Vt][Wt]=Math.min(jt[Vt-1][Wt]+1,jt[Vt][Wt-1]+1,jt[Vt-1][Wt-1]+Mt),Vt>1&&Wt>1&&ee[Vt-1]===te[Wt-2]&&ee[Vt-2]===te[Wt-1])jt[Vt][Wt]=Math.min(jt[Vt][Wt],jt[Vt-2][Wt-2]+1)}return jt[Oe-1][Ot-1]}function R(ee,te,Oe=3){let Ot,jt=Number.POSITIVE_INFINITY;for(let Vt of te){let Wt=mu(ee,Vt);if(Wt<jt)Ot=Vt,jt=Wt}return jt<=Oe?Ot:void 0}import{readFile as xu}from"node:fs/promises";import yr from"node:path";import xa,{sep as mr}from"node:path";var _n=/\.svelte$/,fi=[".ts",".mts",".cts",".tsx",".js",".mjs",".cjs",".jsx",".d.ts"],va=/\.(?:svelte|[mc]?ts|[mc]?js|tsx|jsx)$/;function mi(ee){if(!ee.endsWith(".svelte"))return!1;let te=ee.length-7;if(te===0)return!1;let Oe=ee.charCodeAt(te-1);return Oe!==47&&(mr==="/"||Oe!==92)}function n(ee){return mr==="/"?ee:ee.split(mr).join("/")}function Ea(ee,te){return n(xa.join(te,xa.normalize(ee)))}function Ni(ee){return`${JSON.stringify(ee,null,2)}
25
+ `}var Sa="sveld",ds="0.40.2";var Rt={name:Sa,version:ds,license:"Apache-2.0",description:"Generate TypeScript definitions and component documentation for your Svelte components.",type:"module",main:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",default:"./dist/index.js"},"./browser":{types:"./dist/browser.d.ts",import:"./dist/browser.js",default:"./dist/browser.js"},"./schema/component-api.schema.json":"./schema/component-api.schema.json"},scripts:{test:"bun test --parallel","test:changed":"bivium run --suite unit","test:update":"SVELD_UPDATE_FIXTURES=1 bun test tests/fixtures.test.ts","test:fixtures-types":"bun check --project tsconfig.fixtures.json","test:types-matrix":"bun scripts/typecheck-option-matrix.ts","test:svelte-versions":"bun scripts/typecheck-svelte-versions.ts","test:e2e":"bun tests/test-e2e.ts","test:inferred-types":"bun scripts/check-inferred-types.ts",format:"biome format --write .",lint:"biome check --error-on-warnings .","lint:fix":"biome check --write --unsafe .","lint:fix:changed":"biome check --write --unsafe --changed --no-errors-on-unmatched",knip:"knip-bun",build:"bun scripts/build.ts",bench:"bun scripts/bench.ts","bench:cache":"bun scripts/bench.ts --cache","bench:ostia":"ostia bench scripts/bench-ostia.ts",typecheck:"bun check && bun check --project tsconfig.excluded.json"},devDependencies:{"@biomejs/biome":"2.6.3","@types/bun":"^1.4.4","@types/jest":"^30.0.0","@typescript/typescript6":"^6.0.2",ajv:"^8.20.0",bivium:"^0.3.2",knip:"^6.43.0",ostia:"^0.2.11",sveast:"^0.9.6",svelte:"^5.57.2",typescript:"^7.0.2"},bin:{sveld:"dist/cli.js"},repository:{type:"git",url:"git+https://github.com/carbon-design-system/sveld.git"},homepage:"https://github.com/carbon-design-system/sveld",bugs:"https://github.com/carbon-design-system/sveld/issues",keywords:["svelte","svelte component","documentation","docgen","typescript","definitions","JSDocs","vite","vite-plugin"],maintainers:["Eric Liu (https://github.com/metonym)"]};var Di="5.57.2";var fs=1;function Un(ee){return ee.some((te)=>te.internal)?ee.filter((te)=>!te.internal):ee}function yu(ee){return{...ee,props:Un(ee.props),moduleExports:Un(ee.moduleExports),slots:Un(ee.slots),events:Un(ee.events),typedefs:Un(ee.typedefs),...ee.contexts?{contexts:Un(ee.contexts).map((te)=>({...te,properties:Un(te.properties)}))}:{}}}function y(ee,te={}){let Oe=Array.from(ee.values(),(Vt)=>{let{diagnostics:Wt,...Mt}=Vt;return yu(Mt)}).sort((Vt,Wt)=>u(Vt.moduleName,Wt.moduleName)),Ot={schemaVersion:fs,generator:{name:Sa,version:ds,svelteVersion:Di},total:Oe.length,components:Oe},jt=te.entryExports?Un(te.entryExports):void 0;if(jt&&jt.length>0)Ot.totalExports=jt.length,Ot.exports=jt;return Ot}var vu=/[:=]/,ba=/^HTML\w+Element$|^HTMLElementTagNameMap\[[\w$]+\]$/,Ca=/^SVG\w+Element$/,vr="COMPONENT_API.json",ms={none:0,patch:1,minor:2,major:3};function xr(ee,te){return ms[te]>ms[ee]?te:ee}function Eu(ee){return ee.reduce((te,Oe)=>xr(te,Oe.bump),"none")}function $a(ee,te){return ms[ee]>=ms[te]}function wa(ee){return new Set(i(ee,"|").map((te)=>te.trim()).filter((te)=>te.length>0))}function Su(ee,te){if(ee===te)return!1;if(te==="HTMLElement")return ba.test(ee);if(te==="SVGElement")return Ca.test(ee);if(te==="Element")return ee==="HTMLElement"||ee==="SVGElement"||ee==="MathMLElement"||ba.test(ee)||Ca.test(ee);return!1}function Ta(ee,te){for(let Oe of te)if(Su(ee,Oe))return!0;return!1}function ka(ee){let te=w(ee);if(te===-1)return;let Oe=ee.slice(0,te).trim(),Ot=ee.slice(te+2).trim();if(!Oe.startsWith("(")||!Oe.endsWith(")"))return;let jt=Oe.slice(1,-1).trim();return{params:jt.length===0?[]:i(jt,",").map((Wt)=>Wt.trim()),returnType:Ot}}function bu(ee){return(ee.split(vu,1)[0]??"").trimEnd().endsWith("?")}function Cu(ee,te){if(ee.returnType!==te.returnType)return"major";if(te.params.length<ee.params.length)return"major";for(let Ot=0;Ot<ee.params.length;Ot++)if(ee.params[Ot]!==te.params[Ot])return"major";if(te.params.length===ee.params.length)return"none";return te.params.slice(ee.params.length).every(bu)?"minor":"major"}function wu(ee,te){let Oe=d(ee),Ot=d(te);if(!Oe||!Ot)return;let{added:jt,removed:Vt,common:Wt}=ni(Oe,Ot,(Gt)=>Gt.name);if(Vt.length>0)return"major";let Mt=jt.length>0?"minor":"none";for(let[,Gt,Ut]of Wt){if(Gt.optional!==Ut.optional)Mt=xr(Mt,Ut.optional?"major":"minor");Mt=xr(Mt,gi(Gt.type,Ut.type,{readOnly:!0}))}return Mt}function gi(ee,te,{readOnly:Oe=!1}={}){if(ee===te)return"none";if(ee===void 0||te===void 0)return"major";let Ot=ka(ee),jt=ka(te);if(Ot&&jt)return Cu(Ot,jt);let Vt=Oe?wu(ee,te):void 0;if(Vt!==void 0)return Vt;let Wt=wa(ee),Mt=wa(te),Gt=[...Mt].some((Ht)=>!Wt.has(Ht)&&!Ta(Ht,Wt));if(![...Wt].some((Ht)=>!Mt.has(Ht)&&!Ta(Ht,Mt)))return Gt?"minor":"none";return"major"}function Aa(ee){return ee.bindable===!0||ee.binding==="writable"}function ni(ee,te,Oe){let Ot=new Map(ee.map((Gt)=>[Oe(Gt),Gt])),jt=new Map(te.map((Gt)=>[Oe(Gt),Gt])),Vt=[...jt].filter(([Gt])=>!Ot.has(Gt)),Wt=[...Ot.keys()].filter((Gt)=>!jt.has(Gt)),Mt=[];for(let[Gt,Ut]of Ot){let Ht=jt.get(Gt);if(Ht)Mt.push([Gt,Ut,Ht])}return{added:Vt,removed:Wt,common:Mt}}function Er(ee,te,Oe,Ot){return(jt,Vt,Wt)=>ee.push({component:te,kind:Oe,name:jt,bump:Vt,message:`${Ot} "${jt}" ${Wt}`})}function Pa(ee,te,Oe,Ot){let jt=[],Vt=Er(jt,ee,te,te==="prop"?"prop":"export"),{added:Wt,removed:Mt,common:Gt}=ni(Oe,Ot,(Ut)=>Ut.name);for(let[Ut,Ht]of Wt)Vt(Ut,Ht.isRequired?"major":"minor",`added${Ht.isRequired?" (required)":""}`);for(let Ut of Mt)Vt(Ut,"major","removed");for(let[Ut,Ht,qt]of Gt){if(Ht.isRequired!==qt.isRequired)Vt(Ut,qt.isRequired?"major":"minor",`became ${qt.isRequired?"required":"optional"}`);let zt=gi(Ht.type,qt.type);if(zt!=="none")Vt(Ut,zt,`type changed from \`${Ht.type??"unknown"}\` to \`${qt.type??"unknown"}\``);let Xt=Aa(qt);if(Aa(Ht)!==Xt)Vt(Ut,Xt?"minor":"major",Xt?"gained a writable binding":"lost its writable binding");if(Ht.value!==qt.value&&zt==="none")Vt(Ut,"patch",`default changed from \`${Ht.value??"none"}\` to \`${qt.value??"none"}\``);let Jt=qt.deprecated!==void 0;if(Ht.deprecated!==void 0!==Jt)Vt(Ut,Jt?"minor":"patch",Jt?"marked as deprecated":"no longer deprecated");if(Ht.constant!==qt.constant)Vt(Ut,"minor",qt.constant?"became constant":"became mutable");if(Ht.reactive!==qt.reactive)Vt(Ut,"minor",qt.reactive?"became reactive":"stopped being reactive")}return jt}function Tu(ee,te,Oe){let Ot=[],jt=Er(Ot,ee,"event","event"),{added:Vt,removed:Wt,common:Mt}=ni(te,Oe,(Gt)=>Gt.name);for(let[Gt]of Vt)jt(Gt,"minor","added");for(let Gt of Wt)jt(Gt,"major","removed");for(let[Gt,Ut,Ht]of Mt){if(Ut.type!==Ht.type){jt(Gt,"major",`changed from ${Ut.type} to ${Ht.type}`);continue}let qt=Ut.type==="dispatched"?Ut.detail:void 0,zt=Ht.type==="dispatched"?Ht.detail:void 0,Xt=gi(qt,zt,{readOnly:!0});if(Xt!=="none")jt(Gt,Xt,`detail changed from \`${qt??"unknown"}\` to \`${zt??"unknown"}\``)}return Ot}function ku(ee,te,Oe){let Ot=[],jt=Er(Ot,ee,"slot","slot"),{added:Vt,removed:Wt,common:Mt}=ni(te,Oe,(Gt)=>Gt.name??"default");for(let[Gt]of Vt)jt(Gt,"minor","added");for(let Gt of Wt)jt(Gt,"major","removed");for(let[Gt,Ut,Ht]of Mt){let qt=gi(Ut.slot_props,Ht.slot_props,{readOnly:!0});if(qt!=="none")jt(Gt,qt,`props changed from \`${Ut.slot_props??"none"}\` to \`${Ht.slot_props??"none"}\``)}return Ot}function _a(ee){return ee.type===void 0?"an object of properties":`\`${ee.type}\``}function Au(ee,te=[],Oe=[]){let Ot=[],{added:jt,removed:Vt,common:Wt}=ni(te,Oe,(Mt)=>Mt.key);for(let[Mt]of jt)Ot.push({component:ee,kind:"context",name:Mt,bump:"minor",message:`context "${Mt}" added`});for(let Mt of Vt)Ot.push({component:ee,kind:"context",name:Mt,bump:"major",message:`context "${Mt}" removed`});for(let[Mt,Gt,Ut]of Wt){let Ht=(zt,Xt,Jt)=>Ot.push({component:ee,kind:"context",name:Mt,...Jt===void 0?{}:{property:Jt},bump:zt,message:`context "${Mt}" ${Jt===void 0?"":`property "${Jt}" `}${Xt}`});if(Gt.typeName!==Ut.typeName)Ht("major",`type name changed from \`${Gt.typeName}\` to \`${Ut.typeName}\``);if(Boolean(Gt.hasUnresolvedSpread)!==Boolean(Ut.hasUnresolvedSpread))Ht("major",`${Ut.hasUnresolvedSpread?"gained":"lost"} an unresolved spread`);if(Gt.type!==void 0||Ut.type!==void 0){if(Gt.type!==Ut.type){let zt=Gt.type!==void 0&&Ut.type!==void 0?gi(Gt.type,Ut.type):"major";Ht(zt,`type changed from ${_a(Gt)} to ${_a(Ut)}`)}continue}let qt=ni(Gt.properties,Ut.properties,(zt)=>zt.name);for(let[zt]of qt.added)Ht("minor","added",zt);for(let zt of qt.removed)Ht("major","removed",zt);for(let[zt,Xt,Jt]of qt.common){if(Xt.optional!==Jt.optional)Ht(Jt.optional?"major":"minor",`became ${Jt.optional?"optional":"required"}`,zt);let Qt=gi(Xt.type,Jt.type);if(Qt!=="none")Ht(Qt,`type changed from \`${Xt.type}\` to \`${Jt.type}\``,zt)}}return Ot}var Pu=new Set(["description","source","componentCommentSource","tags"]);function gs(ee){if(Array.isArray(ee))return ee.map(gs);if(r(ee)){let te={};for(let[Oe,Ot]of Object.entries(ee)){if(Pu.has(Oe))continue;te[Oe]=gs(Ot)}return te}return ee}var _u=["generics","rest_props","extends","typedefs"];function $u(ee,te,Oe){let Ot=[];for(let jt of _u){let Vt=JSON.stringify(gs(te[jt])),Wt=JSON.stringify(gs(Oe[jt]));if(Vt!==Wt)Ot.push({component:ee,kind:"shape",name:jt,bump:"major",message:`"${jt}" changed (breaking)`})}return Ot}function Nu(ee,te){let Oe=te.moduleName;return[...Pa(Oe,"prop",ee.props,te.props),...Pa(Oe,"moduleExport",ee.moduleExports,te.moduleExports),...Tu(Oe,ee.events,te.events),...ku(Oe,ee.slots,te.slots),...Au(Oe,ee.contexts,te.contexts),...$u(Oe,ee,te)]}function $t(ee,te){let Oe=[],{added:Ot,removed:jt,common:Vt}=ni(ee.components,te.components,(Wt)=>Wt.moduleName);for(let[Wt]of Ot)Oe.push({component:Wt,kind:"component",bump:"minor",message:`component "${Wt}" added`});for(let Wt of jt)Oe.push({component:Wt,kind:"component",bump:"major",message:`component "${Wt}" removed`});for(let[,Wt,Mt]of Vt)Oe.push(...Nu(Wt,Mt));return Oe}async function Du(ee){let te;try{te=await xu(yr.resolve(ee),"utf-8")}catch(Oe){if(Oe.code==="ENOENT")return null;throw Oe}try{return JSON.parse(te)}catch{throw Error(`sveld: could not parse "${ee}" as JSON. Is it a sveld COMPONENT_API.json snapshot?`)}}function Na(ee){if(typeof ee.check==="string")return ee.check;return ee.jsonOptions?.outFile??vr}function Da(ee,te){if(!ee.json||ee.stdout||ee.jsonOptions?.outDir)return!1;return yr.resolve(ee.jsonOptions?.outFile??vr)===yr.resolve(te)}async function Re(ee,te,Oe={}){let Ot=await Du(te);if(Ot===null)return{snapshotExists:!1,snapshotFile:te,changes:[],bump:"none"};if(Ot.schemaVersion!==fs)return{snapshotExists:!0,snapshotFile:te,changes:[{component:"*",kind:"schema",bump:"none",message:`snapshot schemaVersion ${Ot.schemaVersion} differs from ${fs}; regenerate the snapshot`}],bump:"none"};let jt=y(ee,{entryExports:Oe.entryExports}),Vt=$t(Ot,jt);return{snapshotExists:!0,snapshotFile:te,changes:Vt,bump:Eu(Vt)}}var Ru={major:"BREAKING",minor:"additive",patch:"patch",none:"no change"};function ye(ee){if(!ee.snapshotExists){let jt=ee.snapshotFile===vr?"`sveld --json`":`\`sveld --json\` with \`jsonOptions.outFile: "${ee.snapshotFile}"\``;return`sveld --check: no snapshot found at "${ee.snapshotFile}". Generate it with ${jt} and commit it.`}if(ee.changes.length===0)return`sveld --check: no API changes detected against "${ee.snapshotFile}".`;let te=ee.changes.length,Oe=[`sveld --check: ${te} API change${te===1?"":"s"} detected against "${ee.snapshotFile}".`,`Suggested semver bump: ${ee.bump}.`],Ot=new Map;for(let jt of ee.changes){let Vt=Ot.get(jt.component)??[];Vt.push(jt),Ot.set(jt.component,Vt)}for(let[jt,Vt]of Ot){Oe.push("",` ${jt}`);for(let Wt of Vt){let Mt=Wt.kind==="schema"?"schema":Ru[Wt.bump];Oe.push(` [${Mt}] ${Wt.message}`)}}return Oe.join(`
26
+ `)}var It=1;function xe(ee){let te={kind:"check-report",schemaVersion:It,...ee};return Ni(te)}import{existsSync as Oa}from"node:fs";import{join as Iu,resolve as Ou}from"node:path";import{pathToFileURL as Lu}from"node:url";var Mu=["sveld.config.js","sveld.config.mjs","sveld.config.ts"];function Ft(ee){return ee}function Fu(ee=process.cwd()){for(let te of Mu){let Oe=Iu(ee,te);if(Oa(Oe))return Oe}return null}async function La(ee){let te;try{te=await import(`${Lu(ee).href}?t=${Date.now()}`)}catch(Ot){let jt=Ot instanceof Error?Ot.message:String(Ot);throw Error(`sveld: failed to load config file "${ee}".
27
+ ${jt}`)}let Oe=te.default;if(!r(Oe)||Array.isArray(Oe))throw Error(`sveld: config file "${ee}" must export a configuration object as its default export. Did you forget \`export default defineConfig({ ... })\`?`);return Oe}async function Bu(ee=process.cwd()){let te=Fu(ee);return te===null?{}:La(te)}async function j(ee,te,Oe){if(typeof ee==="string"){let Ot=Ou(te,ee);if(!Oa(Ot))throw Error(`sveld: config file "${ee}" does not exist.`);return La(Ot)}return ee??Oe?Bu(te):{}}function I(...ee){let te={};for(let Oe of ee){if(!Oe)continue;for(let[Ot,jt]of Object.entries(Oe)){let Vt=te[Ot];te[Ot]=r(Vt)&&!Array.isArray(Vt)&&r(jt)&&!Array.isArray(jt)?{...Vt,...jt}:jt}}return te}var Ra=["entry","glob","quiet","documentExports","types","typesOptions","json","jsonOptions","markdown","markdownOptions","failFast","watch","config","cache","checkExamples","reportDiagnostics","strict","check","checkLevel","stdout","format","diagnostics"],ju={typesOptions:["outDir","preamble","format","transform","indexTypes"],jsonOptions:["outFile","outDir","source"],markdownOptions:["outFile","outDir","onAppend"],diagnostics:["ignore"]};function Ia(ee,te,Oe){let Ot=ee===null?te:`${ee}.${te}`,jt=R(te,Oe),Vt=jt===void 0?void 0:ee===null?jt:`${ee}.${jt}`;console.warn(`sveld: unknown option "${Ot}".${Vt?` Did you mean "${Vt}"?`:""}`)}function V(ee){for(let te of Object.keys(ee))if(!Ra.includes(te))Ia(null,te,Ra);for(let[te,Oe]of Object.entries(ju)){let Ot=ee[te];if(!r(Ot))continue;for(let jt of Object.keys(Ot))if(!Oe.includes(jt))Ia(te,jt,Oe)}}import{dirname as Pc}from"node:path";import{lstatSync as Ff}from"node:fs";import{readFile as Bf}from"node:fs/promises";import{resolve as Zp}from"node:path";import{dirname as Qh}from"node:path";var Vu=" ",Gu=120,Wu=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/,Uu=200,ja=/\s/,Hu=/\s{2}|[^\S ]/,Ku=/["'`{}/]/g,qu=/["'`{};/]/g,Va=9,Sr=10,zu=13,Ri=32,xs=34,Xu=38,vs=39,Ju=40,Yu=41,ys=42,Ma=46,Cr=47,Ga=59,Qu=62,Zu=91,wr=92,eh=93,Es=96,Tr=123,th=124,kr=125;function nh(ee){return Wu.test(sh(ee,Uu))}var Fa=[""];function ih(ee){let te=Fa[ee];if(te===void 0)te=Vu.repeat(ee),Fa[ee]=te;return te}function sh(ee,te){let Oe="";for(let Ot=ee.length-1;Ot>=0&&Oe.length<te;Ot--)Oe=ee[Ot]+Oe;return Oe.length>te?Oe.slice(-te):Oe}function rh(ee){if(ee.length===0)return!1;let te=ee[ee.length-1];return te.charCodeAt(te.length-1)===Sr}function oh(ee){while(ee.length>0){let te=ee[ee.length-1],Oe=te.length;while(Oe>0){let Ot=te.charCodeAt(Oe-1);if(Ot!==Ri&&Ot!==Va)break;Oe--}if(Oe===te.length)return;if(Oe===0){ee.pop();continue}ee[ee.length-1]=te.slice(0,Oe);return}}function ah(ee){while(ee.length>0){let te=ee[ee.length-1];if(!ja.test(te[te.length-1]))return;let Oe=te.trimEnd();if(Oe.length===te.length)return;if(Oe.length===0){ee.pop();continue}ee[ee.length-1]=Oe;return}}function ph(ee){if(ee.includes("{"))return!1;let te=0,Oe=0;for(let Ot=0;Ot<ee.length;Ot++){let jt=ee.charCodeAt(Ot);if(te!==0){if(jt===te&&ee.charCodeAt(Ot-1)!==wr)te=0;continue}if(jt===xs||jt===vs||jt===Es){te=jt;continue}if(jt===Ga&&++Oe>=2)return!0}return!1}function ch(ee){if(!Hu.test(ee))return ee.trimEnd();let te="",Oe=null,Ot=!1;for(let jt=0;jt<ee.length;jt++){let Vt=ee[jt],Wt=ee[jt-1];if(Oe){if(te+=Vt,Oe==="double"&&Vt==='"'&&Wt!=="\\"||Oe==="single"&&Vt==="'"&&Wt!=="\\"||Oe==="template"&&Vt==="`"&&Wt!=="\\")Oe=null;Ot=!1;continue}if(Vt==='"'||Vt==="'"||Vt==="`"){Oe=Vt==='"'?"double":Vt==="'"?"single":"template",te+=Vt,Ot=!1;continue}if(ja.test(Vt)){if(!Ot&&te.length>0)te+=" ",Ot=!0;continue}te+=Vt,Ot=!1}return te.trimEnd()}function Wa(ee,te){let Oe=ee[te],Ot=ee.indexOf(Oe,te+1);while(Ot!==-1&&ee.charCodeAt(Ot-1)===wr)Ot=ee.indexOf(Oe,Ot+1);return Ot}function Ua(ee,te){let Oe=ee.indexOf("*/",te+1);return Oe===-1?-1:Oe+1}function lh(ee){let te=new Map,Oe=[],Ot=Ku,jt=0;while(jt<ee.length){if(Ot.lastIndex=jt,!Ot.test(ee))break;jt=Ot.lastIndex-1;let Vt=ee.charCodeAt(jt);if(Vt===Cr){if(ee.charCodeAt(jt+1)===ys){let Wt=Ua(ee,jt);if(Wt===-1)break;jt=Wt}}else if(Vt===xs||Vt===vs||Vt===Es){let Wt=Wa(ee,jt);if(Wt===-1)break;jt=Wt}else if(Vt===Tr)Oe.push(jt);else if(Vt===kr&&Oe.length>0)te.set(Oe.pop(),jt);jt++}return te}function uh(ee,te,Oe){for(let Ot=te;Ot<Oe;Ot++)if(!br(ee.charCodeAt(Ot)))return!1;return!0}function br(ee){if(ee<=Ri)return ee===Ri||ee>=Va&&ee<=zu;if(ee<160)return!1;return ee===160||ee===5760||ee>=8192&&ee<=8202||ee===8232||ee===8233||ee===8239||ee===8287||ee===12288||ee===65279}function Ha(ee,te,Oe,Ot){let jt=[],Vt=qu,Wt=te,Mt=te;while(Mt<Oe){if(Vt.lastIndex=Mt,!Vt.test(ee))break;if(Mt=Vt.lastIndex-1,Mt>=Oe)break;let Gt=ee.charCodeAt(Mt);if(Gt===Cr){if(ee.charCodeAt(Mt+1)===ys){let Ut=Ua(ee,Mt);if(Ut===-1)break;Mt=Ut}Mt++;continue}if(Gt===xs||Gt===vs||Gt===Es){let Ut=Wa(ee,Mt);if(Ut===-1)break;Mt=Ut+1;continue}if(Gt===Tr){let Ut=Ot.get(Mt);if(Ut===void 0||Ut>=Oe){Mt++;continue}if(Wt<Mt)jt.push(ee.slice(Wt,Mt));let Ht=Mt+1;if(uh(ee,Ht,Ut)){jt.push("{}"),Mt=Ut+1,Wt=Mt;continue}let qt=ee.slice(Ht,Ut),zt=ee.charCodeAt(Ht)===Sr;if(!zt&&!qt.includes("/*")&&!ph(qt)&&!nh(jt)){let Xt=Ha(ee,Ht,Ut,Ot),Jt=Xt.trim();if(!Jt.includes(`
28
+ `)){let Qt=Jt.endsWith(";")?Jt.slice(0,-1):Jt,Yt=`{ ${ch(Qt)} }`;if(Yt.length<=Gu){jt.push(Yt),Mt=Ut+1,Wt=Mt;continue}}if(jt.push("{"),Xt.charCodeAt(0)!==Ga)jt.push(`
29
+ `);if(Xt.length>0)jt.push(Xt);Mt=Ut,Wt=Ut;continue}if(jt.push("{"),!zt)jt.push(`
30
+ `);Mt=Ht,Wt=Ht;continue}if(Gt===kr){if(Wt<Mt)jt.push(ee.slice(Wt,Mt));if(oh(jt),!rh(jt))jt.push(`
31
+ `);jt.push("}"),Mt++,Wt=Mt;continue}if(Wt<Mt)jt.push(ee.slice(Wt,Mt));if(ah(jt),jt.push(";"),ee.charCodeAt(Mt+1)!==Sr)jt.push(`
32
+ `);Mt++,Wt=Mt}if(Wt<Oe)jt.push(ee.slice(Wt,Oe));return jt.join("")}function hh(ee){if(!ee.includes(" "))return ee;let te="",Oe=0;for(let Ot=0;Ot<ee.length;Ot++){let jt=ee.charCodeAt(Ot);if(Oe!==0){if(te+=ee[Ot],jt===Oe&&ee.charCodeAt(Ot-1)!==wr)Oe=0;continue}if(jt===xs||jt===vs||jt===Es){Oe=jt,te+=ee[Ot];continue}if(jt===Ri&&te.charCodeAt(te.length-1)===Ri)continue;te+=ee[Ot]}return te}function dh(ee){return ee===kr||ee===eh||ee===Yu||ee===Qu}function fh(ee,te,Oe){return Oe-te>=3&&ee.charCodeAt(te)===Cr&&ee.charCodeAt(te+1)===ys&&ee.charCodeAt(te+2)===ys}function Ba(ee,te,Oe){let Ot=ee.indexOf("*/",te);return Ot!==-1&&Ot+2<=Oe}function mh(ee,te,Oe){let Ot=ee.charCodeAt(te);if(Ot===th||Ot===Xu)return!0;return Ot===Ma&&te+1<Oe&&ee.charCodeAt(te+1)!==Ma}function gh(ee){let te=[],Oe=[],Ot=ee.length,jt=0,Vt=!1,Wt=0,Mt=0;while(Mt<=Ot){let Ht=ee.indexOf(`
33
+ `,Mt);if(Ht===-1)Ht=Ot;let qt=Ht+1,zt=Mt,Xt=Ht;while(zt<Xt&&br(ee.charCodeAt(zt)))zt++;while(Xt>zt&&br(ee.charCodeAt(Xt-1)))Xt--;if(zt===Xt){let sn=Oe.length>0?Oe[Oe.length-1]:void 0;if(sn!==void 0&&sn!==""){let cn=sn.charCodeAt(sn.length-1);if(cn!==Tr&&cn!==Ju&&cn!==Zu)te.push(0),Oe.push("")}Mt=qt;continue}if(Vt){if(te.push(Wt),Oe.push(` ${ee.slice(zt,Xt)}`),Ba(ee,zt,Xt))Vt=!1;Mt=qt;continue}let Jt=fh(ee,zt,Xt),Qt=Jt&&Ba(ee,zt,Xt);if(Jt&&!Qt){te.push(jt),Oe.push(ee.slice(zt,Xt)),Vt=!0,Wt=jt,Mt=qt;continue}let Yt=dh(ee.charCodeAt(zt)),nn=Math.max(0,jt-(Yt?1:0))+(mh(ee,zt,Xt)?1:0);if(Yt&&nn===0&&Oe.length>0&&Oe[Oe.length-1]==="")te.pop(),Oe.pop();if(te.push(nn),Oe.push(hh(ee.slice(zt,Xt))),Mt=qt,Qt)continue;jt=Ji(ee,void 0,zt,Xt,jt)}let Gt=Oe.length;while(Gt>0&&Oe[Gt-1]==="")Gt--;let Ut=[];for(let Ht=0;Ht<Gt;Ht++){if(Ht>0)Ut.push(`
34
+ `);let qt=te[Ht];if(qt>0)Ut.push(ih(qt));Ut.push(Oe[Ht])}return Ut.join("")}function Ka(ee){return`${gh(Ha(ee,0,ee.length,lh(ee)))}
35
+ `}var An="any",yh="Record<string, any>",Ii="Record<string, never>",Qa=/^[A-Za-z_$][A-Za-z0-9_$]*$/,xh=/CustomEvent/,vh=/^[A-Z]/,Eh=/\n/,Sh=/=>/,bh=/^\s*[(<]/,Ch=/(?:^|\n)@default\b/,wh=/^([ \t]*\*) +$/gm,Th=/[^\S\r\n]*[\r\n]\s*/g,kh=/(^|[^.\w])Snippet(?:\s*<|\b)/,Ah=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,Ph=/^const\s+/,_h=/^export /,$h=/[^\w$]/g;function Za(ee){return ee.replace(Ph,"")}function In(ee){if(ee.length===0)return"";return`/**
36
+ * ${M(ee.join(`
37
+ * `))}
38
+ */`}function Oi(ee){return ee?ee.split(`
39
+ `):[]}function ep(ee){if(ee===void 0)return[];return(ee===!0?"@deprecated":`@deprecated ${ee}`).split(`
40
+ `)}function Pr(ee){let te=[];for(let{name:Oe,body:Ot}of ee??[])if(!Ot)te.push(`@${Oe}`);else if(Ot.includes(`
41
+ `))te.push(`@${Oe}`,...Ot.split(`
42
+ `));else te.push(`@${Oe} ${Ot}`);return te}function yi(ee,te,Oe){return[...Oi(ee),...ep(te),...Pr(Oe)]}function tp(ee){if(!ee)return"";return`/** ${M(ee)} */`}function _r(ee){return ee?.includes(`
43
+ `)?In(Oi(ee)):tp(ee)}function $r(ee,te,Oe){let Ot=[...Pr(te),...ep(Oe)];if(Ot.length===0)return _r(ee);return In([...Oi(ee),...Ot])}function np(ee){if(ee===void 0)return An;return`${ee}
44
+ `}function Ss(ee){if(ee.typedefs.length===0)return"";return ee.typedefs.map((te)=>{let Oe=In([...Oi(te.description),...Pr(te.tags)]);return`${Oe?`${Oe}
45
+ `:""}export ${te.ts}`.replace(wh,"$1")}).join(`
46
+
47
+ `)}var qa=new Map;function Nh(ee,te){let Oe=qa.get(te);if(Oe===void 0)Oe=new RegExp(`\\b${_(te)}\\b`),qa.set(te,Oe);return Oe.test(ee)}var za,Xa=[];function ip(ee){if(ee!==za)za=ee,Xa=i(ee,",");return Xa}function Dh(ee){if(ee===null)return[];return ee[0].split(",").map((te,Oe)=>({name:te.trim(),constraint:(ip(ee[1]??"")[Oe]??te).trim()}))}function sp(ee,te){let Oe=Dh(ee).filter(({name:Ot})=>Nh(te,Ot));if(Oe.length===0)return{declSuffix:"",refSuffix:""};return{declSuffix:`<${Oe.map(({constraint:Ot})=>Za(Ot)).join(", ")}>`,refSuffix:`<${Oe.map(({name:Ot})=>Ot).join(", ")}>`}}function rp(ee){if(!ee.contexts||ee.contexts.length===0)return"";return ee.contexts.map((te)=>{let Oe=te.properties.map((Wt)=>{let Mt=Wt.description?`${_r(Wt.description)}
48
+ `:"",Gt=Wt.optional?"?":"";return`${Mt}${$n(Wt.name)}${Gt}: ${Wt.type};`}).join(`
49
+ `),Ot=te.description?`${In(Oi(te.description))}
50
+ `:"",{declSuffix:jt}=sp(ee.generics,[te.type??"",...te.properties.map((Wt)=>Wt.type)].join(`
51
+ `));if(te.type!==void 0)return`${Ot}export type ${te.typeName}${jt} = ${te.type};`;if(te.properties.length===0)return`${Ot}export type ${te.typeName} = ${te.hasUnresolvedSpread?"Record<string, any>":Ii};`;let Vt=te.hasUnresolvedSpread?" & Record<string, any>":"";return`${Ot}export type ${te.typeName}${jt} = {
52
+ ${Oe}
53
+ }${Vt};`}).join(`
54
+
55
+ `)}function $n(ee){return Qa.test(ee)?ee:JSON.stringify(ee)}function Ja(ee,te){let Oe=$r(te.description,te.tags,te.deprecated),Ot=Oe?`${Oe}
56
+ `:"",jt=!te.slot_props||te.slot_props===Ii?"[]":Ih(te.slot_props),Vt=jt==="[]"?"(this: void) => void":`(this: void, ...args: ${jt}) => void`;return`
57
+ ${Ot}${ee}?: ${Vt};`}function Rh(ee){let te=ee.props.filter((en)=>!bs(en)),Oe=new Set([...te.map((en)=>en.name),...Array.from(ee.canonicalPropNames??[])]),jt=(ee.canonicalPropsType?te.filter((en)=>!ee.canonicalPropNames?.has(en.name)):te).map((en)=>{let oi=typeof en.value==="string"?en.value.replace(Th," "):en.value,Hi=Ch.test(en.description??"")||en.value===void 0||en.value==="undefined",Ki=In([...yi(en.description,en.deprecated,en.tags),...en.constant?["@constant"]:[],...Hi?[]:[`@default ${oi}`]]),qi=en.constant&&!en.isFunction?en.value:en.type||An;return`
58
+ ${Ki}
59
+ ${$n(en.name)}${en.isRequired?"":"?"}: ${qi};`});for(let en of ee.slots)if(!en.default&&en.name!=null&&!Oe.has(en.name))jt.push(Ja($n(en.name),en));let Vt=ee.slots.find((en)=>en.default||en.name===null);if(Vt&&!Oe.has("children"))jt.push(Ja("children",Vt));let Wt=jt.join(`
60
+ `),Mt=xi(ee.moduleName),Gt=ee.generics?`<${ip(ee.generics[1]).map((en)=>Za(en.trim())).join(", ")}>`:"",Ut=ee.generics?`<${ee.generics[0]}>`:"",qt=`${ee.extends===void 0?"":`Omit<${ee.extends.interface}, keyof $Props${Ut}> & `}$Props${Ut}`,zt=(en)=>`export type ${Mt}${Gt} = ${en};`,Xt=`{${Wt}
61
+ }`;if(ee.rest_props?.type!=="Element"){let en;if(ee.canonicalPropsType){let oi=Wt.trim()===""?"":` & ${Xt}`;en=[`type $Props${Gt} = ${ee.canonicalPropsType}${oi};`,zt(qt)]}else if(Wt.trim()==="")en=[zt(ee.extends?.interface??Ii)];else if(ee.extends===void 0)en=[zt(Xt)];else en=[`type $Props${Gt} = ${Xt};`,zt(qt)];return{props_name:Mt,prop_def:en.join(`
62
+
63
+ `),elementsImport:void 0}}let{name:Jt,thisValue:Qt,thisType:Yt,description:nn}=ee.rest_props,sn;if(Jt!=="svelte:element")sn=Jt.split("|").map((en)=>`SvelteHTMLElements["${en.trim()}"]`).join(" & ");else if(Qt)sn=`SvelteHTMLElements["${Qt}"]`;else if(Yt)sn=`NoInfer<SvelteHTMLElements[${Yt}]>`;else sn="HTMLAttributes<HTMLElement>";let cn="[key: `data-${string}`]: unknown;",un=nn?`${_r(nn)}
64
+ `:"",hn=ee.canonicalPropsType?`(${ee.canonicalPropsType}) & `:"",Ln=Yt?{name:Gt,ref:Ut}:{name:"",ref:""},Xn=ee.extends===void 0?`keyof $Props${Ut}`:`keyof ($Props${Ut} & ${ee.extends.interface})`,jn=`Omit<$RestProps${Ln.ref}, ${Xn}>`,xn=Yt?`(${Yt} extends any ? ${jn} : never)`:jn;return{props_name:Mt,prop_def:[`${un}type $RestProps${Ln.name} = ${sn};`,`type $Props${Gt} = ${hn}{${Wt}
65
+
66
+ ${cn}
67
+ };`,zt(`${xn} & ${qt}`)].join(`
68
+
69
+ `),elementsImport:sn.startsWith("HTMLAttributes")?"HTMLAttributes":"SvelteHTMLElements"}}function Ih(ee){return Ws(ee)?ee:`[${ee}]`}function Oh(ee){let te=ee.slots.filter((Ot)=>!Ws(Ot.slot_props??""));if(te.length===0)return Ii;let Oe=te.map(({name:Ot,slot_props:jt,...Vt})=>{let Wt=Vt.default||Ot===null?"default":$n(Ot??""),Mt=$r(Vt.description,Vt.tags,Vt.deprecated);return`${Mt?`${Mt}
70
+ `:""}${Wt}: ${np(jt)};`}).join(`
71
+ `);return te.length===1?`{${Oe}}`:`{
72
+ ${Oe}
73
+ }`}var Lh=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave","contextmenu","wheel","keydown","keyup","keypress","submit","change","input","focus","blur","focusin","focusout","reset","select","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragover","dragenter","dragleave","drop","pointerdown","pointerup","pointermove","pointerover","pointerout","pointerenter","pointerleave","pointercancel","gotpointercapture","lostpointercapture","play","pause","ended","volumechange","timeupdate","loadeddata","loadedmetadata","canplay","canplaythrough","seeking","seeked","playing","waiting","stalled","suspend","abort","error","emptied","ratechange","durationchange","loadstart","progress","loadend","animationstart","animationend","animationiteration","animationcancel","transitionstart","transitionend","transitionrun","transitioncancel","scroll","resize","load","unload","beforeunload","cut","copy","paste","compositionstart","compositionupdate","compositionend"]);function Ar(ee=An){if(xh.test(ee))return ee;return`CustomEvent<${ee}>`}function Mh(ee){switch(ee.type){case"dispatched":return Ar(ee.detail);case"forwarded":{let te=ee.element,Oe=te&&vh.test(te),Ot=!Oe||Lh.has(ee.name);if(ee.detail!==void 0&&ee.detail!=="undefined"&&!(ee.detail==="null"&&Ot&&!Oe))return Ar(ee.detail);if(!Ot)return Ar();return`${te==="svelte:document"?"DocumentEventMap":"WindowEventMap"}["${ee.name}"]`}default:return ee}}function Ya(ee){if(ee.events.length===0)return yh;let te=ee.events.map((Oe)=>{let Ot=$r(Oe.description,Oe.tags,Oe.deprecated);return`${Ot?`${Ot}
74
+ `:""}${$n(Oe.name)}: ${Mh(Oe)};
75
+ `}).join("");return ee.events.length===1?`{${te}}`:`{
76
+ ${te}}`}function Fh(ee){let te=ee.type==="() => any";if(ee.type&&Sh.test(ee.type)&&!te)return ee.type;if(ee.params&&ee.params.length>0)return`(${h(ee.params)}) => ${ee.returnType||An}`;if(ee.returnType)return`() => ${ee.returnType}`;return ee.type||An}function bs(ee){return ee.isFunctionDeclaration===!0||ee.kind==="const"}function op(ee){return ee.props.filter(bs).map((te)=>`
77
+ ${In(yi(te.description,te.deprecated,te.tags))}
78
+ ${$n(te.name)}: ${Fh(te)};`).join(`
79
+ `)}function Bh(ee){let te=Li(ee.moduleName),Oe=op({props:ee.props});if(Oe.trim()==="")return{exports_ref:te,exports_def:`export type ${te} = ${Ii};`};let{declSuffix:Ot,refSuffix:jt}=sp(ee.generics,Oe);return{exports_ref:`${te}${jt}`,exports_def:`export type ${te}${Ot} = {${Oe}
80
+ };`}}function jh(ee){let te=ee.props.filter((Oe)=>Oe.bindable===!0||Oe.binding==="writable").map((Oe)=>JSON.stringify(Oe.name));return te.length>0?te.join(" | "):'""'}function ap(ee){return ee==="default"?"$$Component":ee}function Vh(ee){let te=ap(ee.moduleName);return`declare const ${te}: Component<
81
+ ${ee.propsRef},
82
+ ${ee.exportsRef},
83
+ ${ee.bindings}
84
+ >;
85
+ export default ${te};`}function Gh(ee){let te=ap(ee.moduleName),Oe=`${te}Component`,Ot=ee.eventsRef?`$on?<K extends keyof ${ee.eventsRef} & string>(type: K, callback: (e: ${ee.eventsRef}[K]) => void): () => void;`:"$on?(type: string, callback: (e: any) => void): () => void;";return`interface ${Oe} {
86
+ new ${ee.generic}(
87
+ options: ComponentConstructorOptions<${ee.propsRef}>
88
+ ): SvelteComponent<${ee.propsRef}${ee.eventsRef?`, ${ee.eventsRef}`:""}> & ${ee.exportsRef};
89
+ ${ee.generic}(
90
+ this: void,
91
+ internals: ComponentInternals,
92
+ props: ${ee.propsRef}
93
+ ): {
94
+ ${Ot}
95
+ $set?(props: Partial<${ee.propsRef}>): void;
96
+ } & ${ee.exportsRef};
97
+ element?: typeof HTMLElement;
98
+ z_$$bindings?: ${ee.bindings};
99
+ }
100
+ declare const ${te}: ${Oe};
101
+ export default ${te};`}function Wh(ee){if(ee.extends===void 0)return"";return`import type { ${Nr(ee.extends.interface)} } from ${ee.extends.import};`}function Nr(ee){let te=ee.indexOf("<");return(te===-1?ee:ee.slice(0,te)).trim()}function Uh(ee){if(!ee.componentComment)return"";if(!Eh.test(ee.componentComment))return tp(ee.componentComment.trim());return`/*${M(ee.componentComment).split(`
102
+ `).map((te)=>`* ${te}`).join(`
103
+ `)}
104
+ */`}function Hh(ee){let te=[],Oe=new Map;for(let Ot of ee.moduleExports){if(Ot.kind!=="re-export"||!Ot.reExport)continue;let{from:jt,imported:Vt}=Ot.reExport,Wt=In(yi(Ot.description,Ot.deprecated,Ot.tags)),Mt=$n(Ot.name);if(Vt==="*"){let Ht=Ot.name==="*"?"*":`* as ${Mt}`;te.push(`${Wt}
105
+ export ${Ht} from ${JSON.stringify(jt)};`);continue}let Gt=`${jt}\x00${Wt}`,Ut=Oe.get(Gt);if(!Ut)Ut={comment:Wt,from:jt,specifiers:[]},Oe.set(Gt,Ut),te.push(Gt);Ut.specifiers.push(Vt===Ot.name?Mt:`${$n(Vt)} as ${Mt}`)}return te.map((Ot)=>{let jt=Oe.get(Ot);if(!jt)return Ot;return`${jt.comment}
106
+ export { ${jt.specifiers.join(", ")} } from ${JSON.stringify(jt.from)};`}).join(`
107
+
108
+ `)}function Dr(ee){let te=[ee.static?"static ":"",ee.abstract?"abstract ":"",ee.readonly?"readonly ":""].join(""),Oe=ee.optional?"?":"";if(ee.kind==="property")return`${te}${$n(ee.name)}${Oe}: ${ee.type??An}`;if(ee.kind==="index")return`${te}${ee.name}: ${ee.type??An}`;let Ot=h(ee.params??[]);if(ee.kind==="constructor")return`constructor(${Ot})`;let jt=ee.typeParameters?`<${ee.typeParameters}>`:"";return`${te}${$n(ee.name)}${Oe}${jt}(${Ot}): ${ee.returnType??An}`}function Kh(ee,te){let Oe=ee.localName??ee.name,Ot=Oe!==ee.name,jt=`export { ${Oe}${Ot?` as ${$n(ee.name)}`:""} };`;if(te.has(Oe))return jt;te.add(Oe);let Vt=ee.typeParameters?`<${ee.typeParameters}>`:"",Wt=(ee.members??[]).map((Ht)=>[In(yi(Ht.description,Ht.deprecated,Ht.tags)),`${Dr(Ht)};`].filter(Boolean).join(`
109
+ `)).join(`
110
+
111
+ `),Mt=`${ee.extends?` extends ${ee.extends}`:""}${ee.implements?.length?` implements ${ee.implements.join(", ")}`:""}`,Gt=`${Ot?"":"export "}declare ${ee.abstract?"abstract ":""}class ${Oe}${Vt}${Mt}`;return`
112
+ ${[In(yi(ee.description,ee.deprecated,ee.tags)),Wt?`${Gt} {
113
+ ${Wt}
114
+ }`:`${Gt} {}`,Ot?jt:""].filter(Boolean).join(`
115
+ `)}`}function qh(ee){let te=Hh(ee),Oe=new Set,Ot=ee.moduleExports.filter((jt)=>jt.kind!=="re-export").map((jt)=>{if(jt.kind==="class")return Kh(jt,Oe);let Vt=!Qa.test(jt.name),Wt=Vt?{...jt,name:zh(jt.name)}:jt,Mt,Gt=Wt.type&&bh.test(Wt.type)?w(Wt.type):-1,Ut=Wt.typeParameters?`<${Wt.typeParameters}>`:"";if(Wt.kind==="const"&&Gt===-1)Mt=`export declare const ${Wt.name}: ${Wt.type||An};
116
+ `;else if(Wt.kind==="let")Mt=`export declare let ${Wt.name}: ${Wt.type||An};`;else if(Wt.params&&Wt.params.length>0)Mt=`export declare function ${Wt.name}${Ut}(${h(Wt.params)}): ${Wt.returnType||An};`;else if(Wt.returnType)Mt=`export declare function ${Wt.name}${Ut}(): ${Wt.returnType};`;else if(Wt.type&&Gt!==-1){let Ht=Wt.type.slice(0,Gt).trimEnd(),qt=Wt.type.slice(Gt+2).trim();Mt=`export declare function ${Wt.name}${Ht}: ${qt};`}else Mt=`export declare let ${Wt.name}: ${Wt.type||An};`;if(Vt)Mt=`${Mt.replace(_h,"").trimEnd()}
117
+ export { ${Wt.name} as ${JSON.stringify(jt.name)} };`;return`
118
+ ${In(yi(Wt.description,Wt.deprecated,Wt.tags))}
119
+ ${Mt}`}).join(`
120
+ `);return[te,Ot].filter(Boolean).join(`
121
+
122
+ `)}function zh(ee){return`__export_${ee.replace($h,"_")}`}var Xh=120;function Jh(ee){let Oe=`export default class ${ee.moduleName==="default"?"":ee.moduleName}${ee.generic} extends SvelteComponentTyped<`,Ot=[ee.genericProps,ee.events,ee.slots];if(ee.accessors.trim()===""&&Ot.every((jt)=>!jt.includes(`
123
+ `))){let jt=`${Oe}${Ot.join(", ")}> {}`;if(jt.length<=Xh)return jt}return`${Oe}
124
+ ${ee.genericProps},
125
+ ${ee.events},
126
+ ${ee.slots}
127
+ > {
128
+ ${ee.accessors}
129
+ }`}function xi(ee){return`${ee}Props`}function Li(ee){return`${ee}Exports`}function Rr(ee){return{format:ee.format}}var Yh={format:"class"};function pp(ee){let te=Rr(ee??{}),Oe={};for(let[Ot,jt]of Object.entries(te))Oe[Ot]=jt??Yh[Ot];return JSON.stringify(Oe)}function Ir(ee,te){let Oe=xo(ee),{moduleName:Ot,typedefs:jt,generics:Vt,props:Wt,moduleExports:Mt,slots:Gt,events:Ut,rest_props:Ht,extends:qt,componentComment:zt,contexts:Xt}=ee,Jt=te?.format==="component",Qt=Vt!==null,{props_name:Yt,prop_def:nn,elementsImport:sn}=Rh({moduleName:Ot,props:Wt,rest_props:Ht,extends:qt,generics:Vt,slots:Gt,canonicalPropNames:new Set(Oe?.canonicalPropNames??[]),canonicalPropsType:Oe?.canonicalPropsType}),cn=Vt?`<${Vt[1]}>`:"",un=Vt?`${Yt}<${Vt[0]}>`:Yt,hn=Jt&&Ut.length>0?`type $Events${cn} = ${Ya({events:Ut})};`:"",Ln=Vt?`$Events<${Vt[0]}>`:"$Events",Xn=Jt&&(Qt||hn!==""),jn=qh({moduleExports:Mt}),xn=Ss({typedefs:jt}),en=rp({contexts:Xt,generics:Vt}),oi=(Oe?.typeImportStatements??[]).join(`
130
+ `),Hi=[...Oe?.localTypeDeclarations??[],...Oe?.moduleTypeDeclarations??[]].join(`
131
+
132
+ `),{exports_ref:Ki,exports_def:qi}=Jt?Bh({props:Wt,moduleName:Ot,generics:Vt}):{exports_ref:"",exports_def:""},go=Jt?jh({props:Wt}):"",Ms=!Ah.test(oi)&&[nn,jn,xn,en,Hi,qi].some((Fs)=>kh.test(Fs)),Dc=[Jt?Xn?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${Ms?", Snippet":""} } from "svelte";`:`import type { Component${Ms?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${Ms?", type Snippet":""} } from "svelte";`,sn?`import type { ${sn} } from "svelte/elements";`:"",oi,Wh({extends:qt})].filter(Boolean).join(`
133
+ `),Rc=Jt?Xn?Gh({moduleName:Ot,generic:cn,propsRef:un,exportsRef:Ki,bindings:go,...hn?{eventsRef:Ln}:{}}):Vh({moduleName:Ot,propsRef:un,exportsRef:Ki,bindings:go}):Jh({moduleName:Ot,generic:cn,genericProps:un,events:Ya({events:Ut}),slots:Oh({slots:Gt}),accessors:op({props:Wt})}),Ic=[jn,xn,Hi,en,nn,qi,hn,[Uh({componentComment:zt}),Rc].filter(Boolean).join(`
134
+ `)].map((Fs)=>Fs.trim()).filter(Boolean).join(`
135
+
136
+ `);return Ka([Dc,Ic].filter(Boolean).join(`
137
+
138
+ `))}var Zh=[...fi,".svelte"];function ed(ee){let te=ee.trim();if(te.length<2)return;let Oe=te[0],Ot=te[te.length-1];if((Oe==='"'||Oe==="'"||Oe==="`")&&Oe===Ot)return te.slice(1,-1);return}function cp(ee){let te=[],Oe=ee.moduleExports.filter((jt)=>jt.kind==="re-export");if(Oe.length===0)return te;let Ot=new Set([xi(ee.moduleName),Li(ee.moduleName)]);for(let jt of Oe){if(!Ot.has(jt.name))continue;te.push(a({component:ee.filePath,kind:"module-export-conflict",name:jt.name,message:`Re-export "${jt.name}" has the same name as the generated "${jt.name}" type; the .d.ts won't type-check if "${jt.reExport?.from}" exports a type by that name.`,source:jt.source}))}return te}function lp(ee,te,Oe){let Ot=new Map(Array.from(ee.values()).map((jt)=>[te(jt.filePath),jt]));return(jt)=>{let Vt=jt.extends;if(!Vt)return[];let Wt=ed(Vt.import);if(Wt===void 0||!Wt.startsWith(".")&&!Wt.startsWith("/"))return[];let Mt=te(jt.filePath),Gt=Oe.resolve(Wt,Qh(Mt),Zh);if(Gt===null)return[a({component:jt.filePath,kind:"extend-props-target-missing",name:Vt.interface,message:`@extends/@extendProps target "${Wt}" was not found on disk.`})];let Ut=Ot.get(Gt);if(!Ut)return[];let Ht=xi(Ut.moduleName);if(Nr(Vt.interface)!==Ht)return[a({component:jt.filePath,kind:"extend-props-target-missing",name:Vt.interface,message:`@extends/@extendProps names "${Vt.interface}", but "${Wt}" generates "${Ht}".`})];let qt=[];for(let zt of jt.props){let Xt=Ut.props.find((Jt)=>Jt.name===zt.name);if(Xt&&Xt.type!==zt.type){let Jt=a({component:jt.filePath,kind:"extend-props-override",name:zt.name,message:`Own prop "${zt.name}" (${zt.type}) overrides "${Ht}"'s "${zt.name}" (${Xt.type}).`,source:zt.source}),Yt=yo(jt)?.[zt.name]?.some((nn)=>nn===""||nn===Jt.code);qt.push(Yt?{...Jt,ignored:!0}:Jt)}}return qt}}import{lstatSync as Sd,readFileSync as bd,realpathSync as Cd,statSync as wd}from"node:fs";import{dirname as Td,isAbsolute as kd,join as Ap,parse as Ad,relative as Hr,resolve as Fi}from"node:path";function Z(ee){return ee}function Nn(ee){if(ee==="")return ee;return ee==="."||ee===".."||ee.startsWith("./")||ee.startsWith("../")?ee:`./${ee}`}import{readFileSync as Tp}from"node:fs";import{dirname as Wr,join as vd,relative as Cp,resolve as wp}from"node:path";import{readFileSync as ld,statSync as ud}from"node:fs";import{basename as Vr,dirname as Cs,isAbsolute as hd,join as dd,resolve as fd}from"node:path";import{existsSync as dp,readdirSync as td}from"node:fs";import{dirname as up,join as fp,resolve as nd}from"node:path";function q(ee,te){for(let Oe=nd(ee);;Oe=up(Oe)){for(let Ot of te){let jt=fp(Oe,Ot);if(dp(jt))return jt}if(up(Oe)===Oe)return null}}function hp(ee){return ee.normalize("NFC").toLowerCase()}class Or{listings=new Map;clear(){this.listings.clear()}entries(ee){return this.read(ee)?.entries??null}entry(ee,te){let Oe=this.read(ee);if(Oe===null)return;if(Oe.byName===void 0){Oe.byName=new Map;for(let Ot of Oe.entries)Oe.byName.set(Ot.name,Ot)}return Oe.byName.get(te)}has(ee,te){let Oe=this.read(ee);if(Oe===null)return!1;if(Oe.names.has(te))return!0;if(Oe.folded===void 0){Oe.folded=new Map;for(let jt of Oe.names)Oe.folded.set(hp(jt),jt)}let Ot=Oe.folded.get(hp(te));return Ot!==void 0&&Ot!==te&&dp(fp(ee,te))}read(ee){let te=this.listings.get(ee);if(te!==void 0)return te;try{let Oe=td(ee,{withFileTypes:!0}),Ot=new Set;for(let jt of Oe)Ot.add(jt.name);te={entries:Oe,names:Ot}}catch{te=null}return this.listings.set(ee,te),te}}var Lr=!1;function G(ee){Lr=ee}function Bn(ee){if(!Lr)console.error(ee)}function mp(ee){if(!Lr)console.error(ee)}function Ee(ee){if(ee instanceof e)return ee.start?`${ee.reason} (${ee.start.line}:${ee.start.column})`:ee.reason;return ee instanceof Error?ee.message:String(ee)}var Mi=null,Mr=null;function Hn(){if(Mi)return Promise.resolve(Mi);if(!Mr)Mr=import("./chunk-tz95vn4s.js").then((ee)=>(Mi=ee,ee));return Mr}function Dn(){if(!Mi)throw Error("sveld: internal error, parser stack read before loadParserStack() resolved.");return Mi}import{existsSync as Fr,readFileSync as id}from"node:fs";import{dirname as Ep,isAbsolute as Sp,relative as sd,resolve as Br}from"node:path";function gp(ee){if(!r(ee))return{};let te={};if(typeof ee.svelte==="string")te.svelte=ee.svelte;if(typeof ee.name==="string")te.name=ee.name;if(typeof ee.description==="string")te.description=ee.description;return te}function yp(ee){if(!r(ee))return{};let te={};if(typeof ee.extends==="string")te.extends=ee.extends;if(r(ee.compilerOptions)){let Oe={};if(typeof ee.compilerOptions.baseUrl==="string")Oe.baseUrl=ee.compilerOptions.baseUrl;if(r(ee.compilerOptions.paths)){let Ot={};for(let[jt,Vt]of Object.entries(ee.compilerOptions.paths))if(Array.isArray(Vt)&&Vt.every((Wt)=>typeof Wt==="string"))Ot[jt]=Vt;if(Object.keys(Ot).length>0)Oe.paths=Ot}if(Object.keys(Oe).length>0)te.compilerOptions=Oe}return te}var rd=["tsconfig.json","jsconfig.json"],xp=new Map,od=/\/\*[\s\S]*?\*\/|\/\/.*/g,ad=[".svelte",...fi];class W extends Error{specifier;fromFile;searched;constructor(ee,te,Oe){super(`cannot resolve "${ee}" from ${te||"."} (${Oe})`);this.name="UnresolvedModuleError",this.specifier=ee,this.fromFile=te,this.searched=Oe}}function pd(ee){if(Fr(ee))return!0;return ad.some((te)=>Fr(ee+te))}function vp(ee){let te=ee.indexOf("*");return te===-1?ee.length:te}function bp(ee,te){if(te.has(ee))return te.get(ee)??null;try{let Oe=id(ee,"utf-8"),Ot;try{Ot=JSON.parse(Oe)}catch{let Vt=Oe.replace(od,"");Ot=JSON.parse(Vt)}let jt=yp(Ot);if(jt.extends){let Vt=Sp(jt.extends)?jt.extends:Br(Ep(ee),jt.extends),Wt=Vt.endsWith(".json")?Vt:`${Vt}.json`;if(Fr(Wt)){let Mt=bp(Wt,te);if(Mt)jt.compilerOptions={...Mt.compilerOptions,...jt.compilerOptions,paths:{...Mt.compilerOptions?.paths,...jt.compilerOptions?.paths}}}}return te.set(ee,jt),jt}catch{return te.set(ee,null),null}}function cd(ee){let te=xp.get(ee);if(!te){let Oe=ee.split("*").map(_).join("(.*)");te=new RegExp(`^${Oe}$`),xp.set(ee,te)}return te}class jr{configs=new Map;lookup(ee,te){if(ee.startsWith(".")||Sp(ee))return{resolved:ee,unresolved:!1,searched:""};let Oe=q(te,rd),Ot=Oe?bp(Oe,this.configs)?.compilerOptions:void 0,jt=Ot?.paths;if(!Oe||!Ot||!jt)return{resolved:ee,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let Vt=Br(Ep(Oe),Ot.baseUrl??"."),Wt=Object.entries(jt).sort(([Mt],[Gt])=>vp(Gt)-vp(Mt));for(let[Mt,Gt]of Wt){let Ut=ee.match(cd(Mt));if(!Ut)continue;let Ht;for(let qt of Gt){let zt=qt;for(let Jt=1;Jt<Ut.length;Jt++)zt=zt.replace("*",Ut[Jt]);let Xt=Br(Vt,zt);if(Ht??=Xt,pd(Xt))return{resolved:Xt,unresolved:!1,searched:Oe}}return{resolved:Ht??ee,unresolved:!1,searched:Oe}}return{resolved:ee,unresolved:!0,searched:`tsconfig paths (${Oe})`}}absolute(ee,te){return this.lookup(ee,te).resolved}relative(ee,te){let Oe=this.absolute(ee,te);if(Oe===ee)return ee;return Nn(n(sd(te,Oe)))}}var md=/\.[mc]?jsx?$/,gd={".js":[".ts",".tsx",".d.ts"],".jsx":[".tsx",".d.ts"],".mjs":[".mts",".d.mts"],".cjs":[".cts",".d.cts"]};function yd(ee){return ee==="."||ee===".."||ee.startsWith("./")||ee.startsWith("../")||hd(ee)}class Kn{aliases=new jr;listings=new Or;modules=new Map;programs=new Map;listDirectory(ee){return this.listings.entries(ee)}exists(ee){return this.listings.has(Cs(ee),Vr(ee))}resolve(ee,te,Oe=fi){let Ot=this.aliases.absolute(ee,te);if(Ot===ee&&!yd(ee))return null;let jt=fd(te,Ot),Vt=Cs(jt),Wt=Vr(jt),Mt=this.listings.has(Vt,Wt),Gt;if(Mt){let Ut=this.listings.entry(Vt,Wt);if(Gt=Ut&&!Ut.isSymbolicLink()?Ut:ud(jt,{throwIfNoEntry:!1}),Gt?.isFile())return jt}for(let Ut of Oe)if(this.listings.has(Vt,Wt+Ut))return jt+Ut;if(!Mt)return this.typeScriptCounterpart(jt)??null;if(Gt?.isDirectory()){for(let Ut of Oe)if(this.listings.has(jt,`index${Ut}`))return dd(jt,`index${Ut}`)}return null}parse(ee){let te=this.modules.get(ee);if(te===void 0)te=xd(ee),this.modules.set(ee,te);return te}parseJavaScript(ee,te){let Oe=this.programs.get(ee);if(Oe?.source===te)return Oe.ast;let Ot;try{Ot=he(te)}catch(jt){throw Error(Ee(jt))}return this.programs.set(ee,{source:te,ast:Ot}),Ot}invalidate(...ee){this.listings.clear();for(let te of ee)this.modules.delete(te),this.programs.delete(te)}typeScriptCounterpart(ee){let te=md.exec(ee)?.[0];if(te===void 0)return;let Oe=ee.slice(0,-te.length),Ot=Cs(Oe),jt=Vr(Oe);for(let Vt of gd[te]??[])if(this.listings.has(Ot,jt+Vt))return Oe+Vt;return}}function xd(ee){let te;try{te=ld(ee,"utf-8")}catch{return null}try{let Oe=ee.endsWith(".svelte")?Dn().parseSvelteScripts(te).module?.content.body??[]:Dn().parseModule(te,{typescript:!0}).body;return{source:{text:te,filePath:ee,dir:Cs(ee)},body:Oe}}catch(Oe){return mp(`Warning: sveld couldn't parse ${ee} to read its exports (${Ee(Oe)}); skipping it.`),null}}function Gr(ee){return ee.type==="Identifier"?ee.name:ee.value}function Ed(ee,te,Oe,Ot){let jt=ee.resolve(te,Oe);if(!jt)return null;let Vt=Wr(jt);if(Ot.has(jt))return{dir:Vt,exports:{}};Ot.add(jt);try{return{dir:Vt,exports:Ur(ee,Tp(jt,"utf-8"),Vt,Ot,jt)}}catch{return{dir:Vt,exports:{}}}finally{Ot.delete(jt)}}function kp(ee,te,Oe=new Kn,Ot=new Set,jt=te){return Ur(Oe,ee,te,Ot,jt)}function Ur(ee,te,Oe,Ot,jt){let Vt=ee.parseJavaScript(jt,te),Wt={};for(let Mt of Vt.body)if(Mt.type==="ExportDefaultDeclaration"){if(Mt.declaration.type!=="Identifier")continue;let Gt=Mt.declaration.name;if(Gt in Wt)Wt[Gt].default=!0;else Wt[Gt]={source:Nn(""),default:!0}}else if(Mt.type==="ExportAllDeclaration"){let Gt=Mt.source.value,Ut=ee.resolve(Gt,Oe);if(!Ut){let Xt=ee.aliases.lookup(Gt,Oe);throw new W(Gt,jt,Xt.unresolved?Xt.searched:"no matching file or index found")}if(Ot.has(Ut))continue;Ot.add(Ut);let Ht=Tp(Ut,"utf-8"),qt=Ur(ee,Ht,Wr(Ut),Ot,Ut);Ot.delete(Ut);let zt=Object.entries(qt);if(zt.length===0&&!_n.test(Gt)){let Xt=Nn(n(Gt));Wt[`*:${Gt}`]={source:Xt,default:!1,star:!0}}for(let[Xt,Jt]of zt){let Qt=Nn(n(Jt.source.startsWith(".")?`./${Cp(Oe,wp(Wr(Ut),Jt.source))}`:`./${vd(Gt,Jt.source)}`));Wt[Xt]={...Jt,source:Qt}}}else if(Mt.type==="ExportNamedDeclaration"){let Gt=Mt.source?.value,Ut=Gt!==void 0&&_n.test(Gt);if(Ut){let zt=ee.aliases.lookup(Gt,Oe);if(zt.unresolved)throw new W(Gt,jt,zt.searched)}let qt=Gt!==void 0&&!Ut?Ed(ee,Gt,Oe,Ot):void 0;if(qt===null){console.warn(`sveld: could not resolve re-exported module "${Gt}" from barrel "${Oe||"."}"; skipping.`);continue}for(let zt of Mt.specifiers){let Xt=Gr(zt.exported),Jt=Gr(zt.local),Qt=Xt||Jt,Yt=qt?.exports[Jt],nn=Yt?Nn(n(`./${Cp(Oe,wp(qt.dir,Yt.source))}`)):Nn(ee.aliases.relative(Gt??"",Oe)),sn=Yt?Yt.default:Jt==="default",cn=Yt?Yt.imported??Jt:Jt;if(Qt in Wt){if(Wt[Qt].mixed=!0,!Wt[Qt].source)Wt[Qt].source=nn}else Wt[Qt]={source:nn,default:sn,...!sn&&Gt!==void 0&&cn!==Qt?{imported:cn}:{}}}}else if(Mt.type==="ImportDeclaration"){let Gt=Mt.specifiers[0];if(!Gt)continue;let Ut=Gt.local.name,Ht=Nn(ee.aliases.relative(Mt.source.value,Oe)),qt=Gt.type==="ImportSpecifier"?Gr(Gt.imported):Ut;if(Ut in Wt){if(!Wt[Ut].source)Wt[Ut].source=Ht}else Wt[Ut]={source:Ht,default:Ut==="default",...qt===Ut?{}:{imported:qt}}}return Wt}var Pd=/-/g,_d=/[^A-Za-z0-9_$]/g,$d=/^[0-9]/;function Nd(ee,te){let Oe=ee.replace(_d,""),Ot=$d.test(Oe)?`_${Oe}`:Oe;if(Ot!==ee&&!te?.has(ee))te?.add(ee),console.warn(`Warning: "${ee}" is not a valid identifier; using "${Ot}" instead.`);return Ot}function Pp(ee,te){return Nd(Ad(ee).name.replace(Pd,""),te)}function _p(ee,te,Oe=[],Ot=new Set,jt){let Vt;try{Vt=jt??Cd(te)}catch{return Oe}if(Ot.has(Vt))return Oe;Ot.add(Vt);let Wt=ee.listDirectory(te);if(Wt===null)return Oe;for(let Mt of Wt){if(Mt.name.startsWith("."))continue;let Gt=Ap(te,Mt.name),Ut=Mt.isSymbolicLink(),Ht=Ut?wd(Gt,{throwIfNoEntry:!1}):Mt;if(!Ht)continue;if(Ht.isDirectory())_p(ee,Gt,Oe,Ot,Ut?void 0:Ap(Vt,Mt.name));else if(Ht.isFile()&&Mt.name.endsWith(".svelte"))Oe.push(Gt)}return Oe}function Dd(ee,te){return _p(ee,te).map((Oe)=>({moduleName:Pp(Oe),source:Nn(n(`./${Hr(te,Oe)}`))})).sort((Oe,Ot)=>u(Oe.source,Ot.source))}function Rd(ee){return!mi(ee)}function Id(ee,te){let Oe=ee.endsWith("/")?ee:`${ee}/`;return te.startsWith(Oe)}function ws(ee,te){return{seenPaths:new Set(ee.map(([,Oe])=>te(Oe.source))),seenModuleNamePaths:new Map(ee.map(([Oe,Ot])=>[Oe,te(Ot.source)])),warnedModuleNames:new Set}}function Kr(ee,te,Oe,Ot,jt,Vt){for(let{moduleName:Wt,source:Mt}of Dd(ee,te)){let Gt=jt(Mt),Ut=Oe[Wt];if(Ut&&Rd(Ut.source)&&Id(Ut.source,Mt)){Vt.seenPaths.delete(jt(Ut.source)),Ut.source=Mt,Vt.seenPaths.add(Gt),Vt.seenModuleNamePaths.set(Wt,Gt);continue}if(Vt.seenPaths.has(Gt))continue;Vt.seenPaths.add(Gt);let Ht=Vt.seenModuleNamePaths.get(Wt);if(Ht===void 0)Vt.seenModuleNamePaths.set(Wt,Gt);else if(Ht!==Gt&&!Vt.warnedModuleNames.has(Wt))Vt.warnedModuleNames.add(Wt),console.warn(`Warning: multiple components named "${Wt}" found (${n(Hr(te,Ht))} and ${n(Hr(te,Gt))}). Both are included in TypeScript definitions, but only one can be the named export.`);Ot.push([Wt,{source:Mt,default:!1}])}}function qr(ee,te,Oe,Ot){let jt=Sd(ee).isFile(),Vt=jt?Td(ee):ee,Wt=Fi(Vt),Mt=new Map,Gt=(qt)=>{let zt=Mt.get(qt);if(zt===void 0)zt=kd(qt)?Fi(qt):Fi(Wt,qt),Mt.set(qt,zt);return zt},Ut={};if(jt){let qt=bd(ee,"utf-8");try{Ut=kp(qt,Wt,Ot,new Set([Fi(ee)]),Fi(ee))}catch(zt){if(!Oe)throw zt;let Xt=zt instanceof Error?zt.message:String(zt);console.warn(`Warning: Failed to parse component exports from ${ee}: ${Xt}`)}}let Ht=Object.entries(Ut);if(te){let qt=ws(Ht,Gt);if(Kr(Ot,Wt,Ut,Ht,Gt,qt),!jt)Ut=Object.fromEntries(Ht.map(([zt,Xt])=>[zt,{...Xt,default:!0}]))}return{exports:Ut,allComponentEntries:Ht,rootDir:Wt,resolveComponentFilePath:Gt}}function $p(ee,te,Oe,Ot){if(Oe!==1||ee!=="default")return ee;return Pp(te,Ot)}import{dirname as gf}from"node:path";import{resolve as Od}from"node:path";var Ld=/\r?\n/,Md=/^\s*\*+/;function Ts(ee){return{graph:ee,cache:new Map,computing:new Set}}function yn(ee){return ee?.type==="Identifier"?ee.name:void 0}function Fd(ee){let te=ee.trimEnd();for(;;){let Oe=te.lastIndexOf(`
139
+ `)+1;if(te.slice(Oe).trimStart().startsWith("//")){te=te.slice(0,Oe).trimEnd();continue}let Ot=te.endsWith("*/")?te.lastIndexOf("/*",te.length-3):-1;if(Ot!==-1&&te[Ot+2]!=="*"){te=te.slice(0,Ot).trimEnd();continue}return te}}function Bd(ee,te){let Oe=Fd(ee.slice(0,te));if(!Oe.endsWith("*/"))return;let Ot=Oe.length-2,jt=Oe.lastIndexOf("/**",Ot);if(jt===-1)return;return Oe.slice(jt,Ot+2)}function jd(ee){let te=[];for(let Oe of ee.slice(3,-2).split(Ld)){let Ot=Oe.replace(Md,"").trim();if(Ot.startsWith("@"))break;if(Ot)te.push(Ot)}return te.join(" ")||void 0}function ii(ee,te){if(!te)return;return ee.text.slice(te.start,te.end)}function Vd(ee,te){return"typeAnnotation"in te?ii(ee,te.typeAnnotation?.typeAnnotation):void 0}function Dp(ee,te){return ii(ee,te.returnType?.typeAnnotation)}function zr(ee,te,Oe){return`(${te.params.map((jt)=>ii(ee,jt)??"").join(", ")}) => ${Dp(ee,te)??Oe??"any"}`}function Rp(ee){if(ee.type==="Literal"){let te=ee.value;if(typeof te==="string")return"string";if(typeof te==="number")return"number";if(typeof te==="boolean")return"boolean"}if(ee.type==="TemplateLiteral")return"string";if(ee.type==="UnaryExpression"&&(ee.operator==="-"||ee.operator==="+"))return ee.argument.type==="Literal"&&typeof ee.argument.value==="number"?"number":void 0;if(ee.type==="CallExpression"&&ee.callee.type==="Identifier")return Gd[ee.callee.name];return}var Gd={String:"string",Number:"number",Boolean:"boolean"};function Ip(ee){if(ee.type==="Literal"){let te=ee.value;return typeof te==="string"||typeof te==="number"||typeof te==="boolean"?te:void 0}if(ee.type==="UnaryExpression"&&ee.operator==="-"){let te=ee.argument;return te.type==="Literal"&&typeof te.value==="number"?-te.value:void 0}return ee.type==="TemplateLiteral"?k(ee)??void 0:void 0}function Wd(ee,te){let Oe=ii(ee,te),Ot=Ip(te);if(Oe===void 0||Ot===void 0)return;return{raw:Oe,value:Ot,type:typeof Ot}}function Ud(ee,te){if(ee.type!=="CallExpression"&&ee.type!=="NewExpression")return;let Oe=ee.callee;if(!(yn(Oe)==="Symbol"||Oe.type==="MemberExpression"&&!Oe.computed&&yn(Oe.object)==="Symbol"&&yn(Oe.property)==="for"))return;let[jt]=ee.arguments;return(jt?.type==="Literal"&&typeof jt.value!=="string"?null:k(jt))||te}var Hd=new Set(["any","bigint","boolean","false","never","null","number","object","readonly","string","symbol","true","undefined","unknown","void"]),Kd=/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/g,qd=/(?<![\w$.])[A-Za-z_$][\w$]*(?![\w$]|\s*\??:)/g;function zd(ee,te){let Oe=te?Dn().extractJsDocType(te):void 0,Ot=ee?{type:ee,source:"typescript"}:Oe?{type:Oe,source:"jsdoc"}:void 0;if(!Ot||Ot.type.includes("`"))return;return(Ot.type.replace(Kd,'""').match(qd)??[]).every((Vt)=>Hd.has(Vt))?Ot:void 0}function Op(ee){if(ee.async||ee.generator||ee.type==="TSDeclareFunction")return;let te=ee.body,Oe=te.type==="BlockStatement"?Q(te):[te];if(Oe.length===0)return;let Ot;for(let jt of Oe){if(!jt)return;let Vt=Rp(jt);if(!Vt)return;if(Ot===void 0)Ot=Vt;else if(Ot!==Vt)return}return Ot}function Xd(ee){if(ee.type==="TemplateLiteral")return;let te=Ip(ee);return typeof te==="boolean"?void 0:te}function Jd(ee){let te=ee.members;if(te.length===0)return;let Oe=[],Ot=0;for(let jt of te){if(!jt.initializer){Oe.push(String(Ot)),Ot+=1;continue}let Vt=Xd(jt.initializer);if(Vt===void 0)return;Oe.push(typeof Vt==="string"?JSON.stringify(Vt):String(Vt)),Ot=typeof Vt==="number"?Vt+1:Ot}return Oe.join(" | ")}function Xr(ee,te,Oe,Ot){let jt=Bd(ee.text,Oe),Vt=jt?jd(jt):void 0,Wt=jt?Dn().extractJsDocReturnType(jt):void 0,{deprecated:Mt,tags:Gt,internal:Ut}=jt?Dn().extractJsDocDeprecatedAndTags(jt):{deprecated:void 0,tags:void 0,internal:!1},Ht={description:Vt,deprecated:Mt,tags:Gt,...Ut?{internal:!0}:{},declFile:ee.filePath},qt=(Xt,Jt,Qt=!1)=>Xt?[{name:Xt,...Jt,...Ht,isTypeOnly:Qt}]:[],zt=(Xt,Jt)=>Dp(ee,Xt)??Wt??ie(Jt)??Op(Xt);if(te.type==="VariableDeclaration"){let Xt=te.kind==="let"||te.kind==="var"?te.kind:"const";return te.declarations.flatMap((Jt)=>{let Qt=Jt.id,Yt=yn(Qt);if(!Yt)return[];let nn=Vd(ee,Qt),sn=nn,cn,un,hn,Ln,Xn,jn,xn=Jt.init;if(xn)if(xn.type==="ArrowFunctionExpression"||xn.type==="FunctionExpression"){if(jn=xn,un=zt(xn,sn),!sn)sn=zr(ee,xn,un)}else{if(cn=ii(ee,xn),!sn)sn=Rp(xn);let en=C(xn);if(hn=k(en)??Ud(en,Yt),Xt==="const")Ln=Wd(ee,en),Xn=zd(nn,jt)}return qt(Yt,{kind:Xt,type:sn,value:cn,returnType:un,literalValue:hn,primitiveLiteral:Ln,declaredType:Xn,functionNode:jn})})}if(te.type==="FunctionDeclaration"||te.type==="TSDeclareFunction"){let Xt=zt(te);return qt(yn(te.id)??Ot,{kind:"function",type:zr(ee,te,Xt),returnType:Xt,...te.type==="FunctionDeclaration"?{functionNode:te}:{}})}if(te.type==="ClassDeclaration"){let Xt=yn(te.id);return qt(Xt??Ot,{kind:"class",...Xt?{type:Xt}:{}})}if(te.type==="TSTypeAliasDeclaration")return qt(yn(te.id),{kind:"type",type:ii(ee,te.typeAnnotation)},!0);if(te.type==="TSInterfaceDeclaration")return qt(yn(te.id),{kind:"interface",type:ii(ee,te.body)},!0);if(te.type==="TSEnumDeclaration"){let Xt=yn(te.id);return qt(Xt,{kind:"enum",type:Jd(te)??Xt})}return[]}function Yd(ee,te,Oe){let Ot=te.declaration;if(Ot.type==="FunctionDeclaration"||Ot.type==="TSDeclareFunction"||Ot.type==="ClassDeclaration"){let[Wt]=Xr(ee,Ot,te.start,"default");return Wt?{...Wt,name:"default"}:void 0}if(Ot.type==="FunctionExpression"||Ot.type==="ArrowFunctionExpression")return{name:"default",kind:"function",type:zr(ee,Ot,Op(Ot)),functionNode:Ot,declFile:ee.filePath,isTypeOnly:!1};let jt=yn(Ot),Vt=jt?Oe(jt):null;return Vt?{...Vt,name:"default"}:void 0}function Qd(ee,te){for(let Oe of ee){if(Oe.type!=="ImportDeclaration")continue;let Ot=Oe.source.value;for(let jt of Oe.specifiers){if(jt.local.name!==te)continue;let Vt=Oe.importKind==="type"||jt.type==="ImportSpecifier"&&jt.importKind==="type";if(jt.type==="ImportDefaultSpecifier")return{specifier:Ot,importedName:"default",isTypeOnly:Vt};if(jt.type==="ImportNamespaceSpecifier")return{specifier:Ot,importedName:"*",isTypeOnly:Vt};if(jt.type==="ImportSpecifier"){let Wt=yn(jt.imported)??te;return{specifier:Ot,importedName:Wt,isTypeOnly:Vt}}}}return null}function Np(ee,te,Oe){return{name:ee,kind:"const",declFile:te,namespaceFile:te,isTypeOnly:Oe}}function ks(ee,te){let Oe=te.cache.get(ee);if(Oe)return Oe;if(te.computing.has(ee))return[];te.computing.add(ee);let Ot=te.graph.parse(ee);if(!Ot)return te.computing.delete(ee),te.cache.set(ee,[]),[];let{source:jt,body:Vt}=Ot,Wt=[],Mt=new Map;for(let zt of Vt){let Xt=zt.type==="ExportNamedDeclaration"?zt.declaration:zt;if(!Xt)continue;for(let Jt of Xr(jt,Xt,Xt.start))Mt.set(Jt.name,Jt)}let Gt=(zt,Xt)=>({name:zt,kind:"const",declFile:Od(jt.dir,Xt),isTypeOnly:!1}),Ut=(zt)=>{let Xt=Mt.get(zt);if(Xt)return Xt;let Jt=Qd(Vt,zt);if(!Jt)return null;if(Jt.specifier.endsWith(".svelte"))return Gt(zt,Jt.specifier);let Qt=te.graph.resolve(Jt.specifier,jt.dir);if(!Qt)return null;if(Jt.importedName==="*")return Np(zt,Qt,Jt.isTypeOnly);return si(Qt,Jt.importedName,te)??null},Ht=new Map;for(let zt of Vt){if(zt.type==="ExportAllDeclaration"){let Yt=zt.source.value;if(Yt.endsWith(".svelte"))continue;let nn=te.graph.resolve(Yt,jt.dir);if(!nn)continue;let sn=zt.exportKind==="type",cn=yn(zt.exported);if(cn){Wt.push(Np(cn,nn,sn));continue}for(let un of ks(nn,te)){let hn=Ht.get(un.name)??[];hn.push(sn?{...un,isTypeOnly:!0}:un),Ht.set(un.name,hn)}continue}if(zt.type==="ExportDefaultDeclaration"){let Yt=Yd(jt,zt,Ut);if(Yt)Wt.push(Yt);continue}if(zt.type!=="ExportNamedDeclaration")continue;let Xt=zt.declaration;if(Xt){Wt.push(...Xr(jt,Xt,zt.start));continue}let Jt=zt.source?.value;if(Jt?.endsWith(".svelte")){for(let Yt of zt.specifiers){let nn=yn(Yt.exported);if(nn)Wt.push(Gt(nn,Jt))}continue}let Qt=zt.exportKind==="type";for(let Yt of zt.specifiers){let nn=yn(Yt.exported),sn=yn(Yt.local);if(!nn||!sn)continue;let cn=Qt||Yt.exportKind==="type",un=null;if(Jt){let hn=te.graph.resolve(Jt,jt.dir);if(hn)un=si(hn,sn,te)??null}else un=Ut(sn);if(un)Wt.push({...un,name:nn,isTypeOnly:un.isTypeOnly||cn});else if(sn!=="default")Wt.push({name:nn,kind:cn?"type":"const",declFile:ee,isTypeOnly:cn})}}let qt=new Set(Wt.map((zt)=>zt.name));for(let[zt,Xt]of Ht){if(qt.has(zt)||zt==="default")continue;if(Xt.every((Jt)=>Jt.declFile===Xt[0].declFile))Wt.push(...Xt);else te.onAmbiguousStarExport?.(ee,zt,Xt)}return te.computing.delete(ee),te.cache.set(ee,Wt),Wt}function si(ee,te,Oe){return ks(ee,Oe).findLast((Ot)=>Ot.name===te)}function vi(ee,{importedName:te,members:Oe=[]},Ot){let jt=si(ee,te,Ot);for(let Vt of Oe){if(jt?.namespaceFile===void 0)return;jt=si(jt.namespaceFile,Vt,Ot)}return jt}function qn(ee,te,Oe){if(ee[te]===void 0)delete ee[te];ee[te]=Oe}function As(ee,te){return(te.location==="props"?ee.props:ee.moduleExports).find((Ot)=>Ot.name===te.propName)}function Ps(ee,te){if(te.location!=="props")return;ee.diagnostics=(ee.diagnostics??[]).filter((Oe)=>!(Oe.kind==="prop-unknown-type"&&Oe.name===te.propName))}var Zd=/\.[^./\\]+$/;function ef(ee,te){if(ee.endsWith(".d.ts"))return null;let Oe=ee.replace(Zd,".d.ts");return te.exists(Oe)?Oe:null}function tf(ee,te,Oe){return te.map((Ot)=>{if(!Ot.importSource||!Ot.importedName)return{candidate:Ot};let jt=Oe.graph.resolve(Ot.importSource,ee);if(!jt)return{candidate:Ot,failureReason:"module-not-found"};let Vt=si(jt,Ot.importedName,Oe);if(!Vt)return{candidate:Ot,failureReason:"export-not-found"};if(Vt.returnType)return{candidate:Ot,type:Vt.returnType};let Wt=ef(jt,Oe.graph);if(Wt){let Mt=si(Wt,Ot.importedName,Oe);if(Mt?.returnType)return{candidate:Ot,type:Mt.returnType}}return{candidate:Ot,failureReason:"return-type-unresolved"}})}function nf(ee,te){switch(te){case"module-not-found":return`Prop "${ee.propName}" default calls "${ee.calleeName}()", but "${ee.importSource}" could not be resolved; falling back to "any".`;case"export-not-found":return`Prop "${ee.propName}" default calls "${ee.calleeName}()", but "${ee.importedName}" is not exported from "${ee.importSource}"; falling back to "any".`;case"return-type-unresolved":return`Prop "${ee.propName}" default calls "${ee.calleeName}()" imported from "${ee.importSource}", but its return type could not be resolved; falling back to "any".`}}function sf(ee,te){for(let{candidate:Oe,type:Ot,failureReason:jt}of te){let Vt=As(ee,Oe);if(Vt?.typeSource!=="unknown")continue;if(Ot){qn(Vt,"type",Ot),qn(Vt,"typeSource","typescript"),Ps(ee,Oe);continue}if(Oe.location==="props"&&jt){let Wt=ee.diagnostics?.find((Mt)=>Mt.kind==="prop-unknown-type"&&Mt.name===Oe.propName);if(Wt)Wt.message=nf(Oe,jt)}}}var Lp={collect:(ee)=>ee.pendingCallDefaultCandidates?.filter((te)=>te.importSource!==void 0)??[],resolve:tf,apply:sf};function rf(ee,te,Oe){return te.map((Ot)=>{let jt=Oe.graph.resolve(Ot.importSource,ee);if(!jt)return{candidate:Ot};let Vt=vi(jt,Ot,Oe);if(!Vt?.primitiveLiteral)return{candidate:Ot};return{candidate:Ot,literal:Vt.primitiveLiteral,declaredType:Vt.declaredType}})}function of(ee,te){for(let{candidate:Oe,literal:Ot,declaredType:jt}of te){if(!Ot)continue;let Vt=As(ee,Oe);if(!Vt)continue;if(qn(Vt,"value",Ot.raw),qn(Vt,"defaultValue",{raw:Ot.raw,kind:"literal",value:Ot.value}),Vt.typeSource!=="unknown")continue;qn(Vt,"type",jt?.type??Ot.type),qn(Vt,"typeSource",jt?.source??"default"),Ps(ee,Oe)}}var Mp={collect:(ee)=>ee.pendingConstDefaultCandidates??[],resolve:rf,apply:of};function af(ee,te,Oe){return te.map((Ot)=>{let jt=Oe.graph.resolve(Ot.importSource,ee);if(!jt)return{candidate:Ot};let Vt=vi(jt,Ot,Oe);if(Vt?.kind!=="const"||Vt.literalValue===void 0)return{candidate:Ot};return{candidate:Ot,key:Vt.literalValue}})}function pf(ee,te){for(let{candidate:Oe,key:Ot}of te){if(!Ot){let Mt=ae(Oe);li(ee,[a({component:ee.filePath,kind:"context-key-unresolved",name:Mt,message:`setContext key \`${Mt}\` from "${Oe.importSource}" isn't an \`export const\` string or Symbol() sveld can read; the context is skipped.`,...Oe.source?{source:Oe.source}:{}})]);continue}let jt=[...ee.contexts??[]],Vt=jt.findIndex((Mt)=>Mt.key===Ot);if(Vt!==-1){let Mt=jt[Vt],Gt=Fp(Mt.source,Oe.source),Ut=Gt?Mt.source:Oe.source;if(li(ee,[a({component:ee.filePath,kind:"context-duplicate-key",name:Ot,message:`setContext("${Ot}", ...) was called more than once; only the first call's shape is used.`,...Ut?{source:Ut}:{}})]),!Gt)continue;jt.splice(Vt,1)}let Wt=jt.findIndex((Mt)=>Fp(Mt.source,Oe.source));jt.splice(Wt===-1?jt.length:Wt,0,{key:Ot,typeName:K(Ot),...Oe.type===void 0?{}:{type:Oe.type},description:Oe.description,properties:Oe.properties,...Oe.hasUnresolvedSpread?{hasUnresolvedSpread:!0}:{},...Oe.internal?{internal:!0}:{},source:Oe.source}),ee.contexts=jt}}function Fp(ee,te){if(!ee||!te)return!1;let{line:Oe,column:Ot}=ee.start;return Oe>te.start.line||Oe===te.start.line&&Ot>te.start.column}var Bp={collect:(ee)=>ee.pendingContextKeyCandidates??[],resolve:af,apply:pf};function cf(ee,te,Oe){return te.map((Ot)=>{let jt=Oe.graph.resolve(Ot.importSource,ee);if(!jt)return{candidate:Ot,failureReason:"module-not-found"};let Vt=vi(jt,Ot,Oe)?.functionNode;if(!Vt)return{candidate:Ot,failureReason:"not-a-function"};let Wt=lf(Vt,Ot);if(!Wt)return{candidate:Ot,failureReason:"parameter-not-found"};return df(Vt,Wt,Ot)})}function jp(ee){return ee?.type==="AssignmentPattern"?ee.left:ee}function lf(ee,te){let Oe=jp(ee.params[te.argumentIndex]);if(te.property===void 0)return Oe?.type==="Identifier"?{name:Oe.name}:void 0;if(!te.property)return;if(Oe?.type==="Identifier")return{object:Oe.name,property:te.property};if(Oe?.type!=="ObjectPattern")return;for(let Ot of Oe.properties){if(Ot.type!=="Property"||Ot.computed)continue;if(Ot.key.type!=="Identifier"||Ot.key.name!==te.property)continue;let jt=jp(Ot.value);return jt?.type==="Identifier"?{name:jt.name}:void 0}return}function Jr(ee){if(!ee)return null;if(ee.type==="ConditionalExpression"){let Oe=Jr(ee.consequent),Ot=Jr(ee.alternate);return Oe&&Ot?[...Oe,...Ot]:null}let te=k(ee);return te?[te]:null}var uf={variableType:()=>{return}};function hf(ee){if(!ee)return"null";let{deriveLiteralDetailType:te,literalDetailToTypeText:Oe}=Dn();if(ee.type==="Literal")return Oe(ee.value);return te(uf,ee)??"any"}function Vp(ee,te){if("name"in te)return ee.type==="Identifier"&&ee.name===te.name;if(ee.type!=="MemberExpression"||ee.computed)return!1;return ee.object.type==="Identifier"&&ee.object.name===te.object&&ee.property.type==="Identifier"&&ee.property.name===te.property}function df(ee,te,Oe){let Ot=new Map,jt="name"in te?te.name:te.object,Vt;if(o(ee.body,{enter(Mt,Gt,Ut){if(Mt.type==="CallExpression"){if(!Vp(Mt.callee,te))return;let qt=Mt.arguments,zt=Jr(qt[0]);if(!zt)return Vt="dynamic-event-name",v;for(let Xt of zt){let Jt=Ot.get(Xt)??new Set;Jt.add(hf(qt[1])),Ot.set(Xt,Jt)}return}let Ht=Gt?.type==="CallExpression"&&Ut==="callee";if(Mt.type==="MemberExpression"&&Vp(Mt,te)&&!Ht)return Vt="passed-on",v;if(Mt.type!=="Identifier"||Mt.name!==jt)return;if(Ht)return;if(!("name"in te)&&Gt?.type==="MemberExpression"&&Ut==="object")return;if(!U(Mt,Gt))return;return Vt="passed-on",v}}),Vt)return{candidate:Oe,failureReason:Vt};let Wt=Array.from(Ot,([Mt,Gt])=>{let Ut=Array.from(Gt);return{name:Mt,detail:Ut.includes("any")?"any":Ut.join(" | ")}});return{candidate:Oe,events:Wt}}function ff(ee,te){let Oe=ee.members?`"${ee.calleeText}"`:ee.importedName==="default"?"the default export":`"${ee.importedName}"`;switch(te){case"module-not-found":return`"${ee.importSource}" isn't a local module sveld can read`;case"not-a-function":return`${Oe} isn't a function declared in "${ee.importSource}"`;case"parameter-not-found":return`no parameter of ${Oe} receives it`;case"dynamic-event-name":return"an event name isn't a string literal";case"passed-on":return`${Oe} passes it on`}}function mf(ee,te,{deferredEventNoSourceDiagnostics:Oe=[],untypedJsDocEventNames:Ot=[]}){let jt=new Map,Vt=[...ee.diagnostics??[]],Wt=!0;for(let{candidate:Xt,events:Jt,failureReason:Qt}of te){if(Qt){Wt=!1,Vt.push(a({component:ee.filePath,kind:"dispatch-escapes",name:Xt.dispatcherName,message:`\`${Xt.dispatcherName}\` is passed to \`${Xt.calleeText}\`, but sveld couldn't read the events it dispatches: ${ff(Xt,Qt)}. Document them with @event tags.`,...Xt.source?{source:Xt.source}:{},...Xt.ignored?{ignored:!0}:{}}));continue}for(let Yt of Jt??[]){if(jt.has(Yt.name))continue;jt.set(Yt.name,{type:"dispatched",name:Yt.name,detail:Yt.detail,...Xt.source?{source:Xt.source}:{}})}}if(Wt){for(let Xt of Oe)if(!jt.has(Xt.name))Vt.push(Xt)}if(ee.diagnostics=Vt,jt.size===0)return;let Mt=new Map,Gt=new Set;for(let Xt of ee.events)if(Xt.type==="dispatched")Gt.add(Xt.name);else if(!Mt.has(Xt.name))Mt.set(Xt.name,Xt);let Ut=new Set(Ot),Ht=new Map,qt=[];for(let Xt of jt.values()){if(Gt.has(Xt.name)){if(Ut.has(Xt.name)&&Xt.detail!==void 0)Ht.set(Xt.name,Xt.detail);continue}let Jt=Mt.get(Xt.name);if(!Jt){qt.push(Xt);continue}let Qt=Xt.source??Jt.source;qt.push({type:"dispatched",name:Xt.name,detail:Jt.detail??Xt.detail,...Jt.description?{description:Jt.description}:{},...Jt.deprecated===void 0?{}:{deprecated:Jt.deprecated},...Jt.tags?{tags:Jt.tags}:{},...Jt.internal?{internal:!0}:{},...Qt?{source:Qt}:{}})}if(qt.length===0&&Ht.size===0)return;let zt=new Set(qt.map((Xt)=>Xt.name));ee.events=[...ee.events.filter((Xt)=>Xt.type==="dispatched"||!zt.has(Xt.name)).map((Xt)=>{let Jt=Xt.type==="dispatched"?Ht.get(Xt.name):void 0;return Jt===void 0?Xt:{...Xt,detail:Jt}}),...qt].sort(ge)}var Gp={collect:(ee)=>ee.pendingDispatchEscapeCandidates??[],resolve:cf,apply:mf};function _s(ee){return(te)=>{let Oe=ee.collect(te);if(Oe.length===0)return;return(Ot,jt,Vt)=>ee.apply(Ot,ee.resolve(jt,Oe,Vt),te)}}var yf=[_s(Lp),_s(Mp),_s(Bp),_s(Gp)];async function Wp(ee,te,Oe,Ot){let jt=[];for(let Wt of ee){let Mt=Oe(Wt);if(Mt===void 0)continue;let Gt=yf.flatMap((Ut)=>Ut(Mt)??[]);if(Gt.length>0)jt.push({component:Wt,passes:Gt})}let Vt=new Map;if(jt.length===0)return Vt;await Hn();for(let{component:Wt,passes:Mt}of jt){let Gt=Ts(Ot),Ut=gf(te(Wt.filePath));for(let Ht of Mt)Ht(Wt,Ut,Gt);Vt.set(Wt.filePath,Array.from(Gt.cache.keys()))}return Vt}var xf=/^```([\w-]*)\r?\n([\s\S]*?)\r?\n?```$/,vf=new Set(["","js","jsx","ts","tsx","javascript","typescript"]),Ef=new Set(["svelte","html"]);function Sf(ee){let te=ee.trim();if(te==="")return null;let Oe=te.match(xf);if(Oe){let Ot=Oe[1].toLowerCase(),jt=Oe[2].trim();if(jt==="")return null;if(vf.has(Ot))return{kind:"compile",code:jt};if(Ef.has(Ot))return{kind:"syntax",code:jt};return null}if(te.startsWith("<"))return null;return{kind:"compile",code:te}}function Up(ee){if(!ee.isFunction)return"any";return`(${(ee.params??[]).map((Oe)=>`${Oe.name}${Oe.optional?"?":""}: any`).join(", ")}) => any`}function $s(ee,te,Oe,Ot,jt){let Vt=(ee??[]).filter((Mt)=>Mt.name==="example"),Wt=Vt.length>1;return Vt.flatMap((Mt,Gt)=>{let Ut=Sf(Mt.body);if(Ut===null)return[];return[{id:Wt?`${te}#${Gt}`:te,name:Wt?`${Oe} (example ${Gt+1})`:Oe,type:Ot,code:Ut.code,kind:Ut.kind,...jt?{source:jt}:{}}]})}function bf(ee){let te=[];for(let Oe of ee.props)te.push(...$s(Oe.tags,`prop:${Oe.name}`,Oe.name,Up(Oe),Oe.source));for(let Oe of ee.moduleExports)te.push(...$s(Oe.tags,`export:${Oe.name}`,Oe.name,Up(Oe),Oe.source));for(let Oe of ee.slots){let Ot=Oe.name??"default";te.push(...$s(Oe.tags,`slot:${Ot}`,Ot,"any",Oe.source))}for(let Oe of ee.events)te.push(...$s(Oe.tags,`event:${Oe.name}`,Oe.name,"any",Oe.source));return te}function Hp(ee,te){return ee.flatMap(({component:Oe,sources:Ot})=>{let jt=Ot.filter((Vt)=>Vt.kind===te);return jt.length===0?[]:[{component:Oe,sources:jt}]})}async function Cf(ee){let{formatParseError:te,parseSvelte:Oe}=await Hn(),Ot=new Map;for(let{component:jt,sources:Vt}of ee){let Wt=[];for(let Mt of Vt)try{Oe(Mt.code)}catch(Gt){Wt.push(a({component:jt.filePath,kind:"example-syntax-error",name:Mt.name,message:te(Gt),...Mt.source?{source:Mt.source}:{}}))}Ot.set(jt,Wt)}return Ot}async function wf(ee,te,Oe){let Ot=await te.checkExamples(ee.map(({component:Vt,sources:Wt})=>({moduleName:Vt.moduleName,filePath:Oe(Vt.filePath),sources:Wt}))),jt=new Map;for(let{component:Vt,sources:Wt}of ee){let Mt=Ot.get(Oe(Vt.filePath));if(!Mt||Mt.length===0)continue;let Gt=new Map(Wt.map((Ut)=>[Ut.id,Ut.source]));jt.set(Vt,Mt.map((Ut)=>{let Ht=Gt.get(Ut.id);return a({component:Vt.filePath,kind:"example-compile-error",name:Ut.name,message:Ut.message,...Ht?{source:Ht}:{}})}))}return jt}async function Kp(ee,te,Oe,Ot){let jt=Array.from(ee,(Ut)=>({component:Ut,sources:bf(Ut)})),Vt=te===!0?Hp(jt,"compile"):[],Wt=Hp(jt,"syntax"),Mt=new Map,Gt=(Ut)=>{for(let[Ht,qt]of Ut)Mt.set(Ht,[...Mt.get(Ht)??[],...qt])};if(Wt.length>0)Gt(await Cf(Wt));if(Vt.length>0){let{TypeResolver:Ut}=await import("./chunk-6hzm92zg.js"),Ht=await Ut.create(Oe);if(!Ht.ok)throw Error(`sveld: \`checkExamples\` ${Ht.message}.`);let qt=Ht.resolver;try{Gt(await wf(Vt,qt,Ot))}finally{await qt.dispose()}}return Mt}import{hash as Tf}from"node:crypto";import{mkdirSync as kf,readFileSync as Af,renameSync as Pf,writeFileSync as qp}from"node:fs";import{dirname as zp,isAbsolute as _f,join as $f,resolve as Yr}from"node:path";var Xp=11,Nf=$f("node_modules",".cache","sveld","parse-cache.json"),Df="0ef077d6d6e9dc85";function Jp(){return`${ds}+${Df}+svelte@${Di}`}function Rf(ee){let te=q(ee,["package.json"]);return te===null?Yr(ee):zp(te)}function Yp(ee,te){let Oe=Rf(ee);if(typeof te==="string")return _f(te)?te:Yr(Oe,te);return Yr(Oe,Nf)}function Ns(ee){return Tf("sha256",ee,"hex")}function Qr(){return{formatVersion:Xp,toolchainVersion:Jp(),entries:{}}}function If(ee){try{let te=JSON.parse(Af(ee,"utf-8"));if(te.formatVersion!==Xp||te.toolchainVersion!==Jp())return Qr();return te}catch{return Qr()}}class Zr{cacheFilePath;file;next=new Map;dirty=!1;savedEntryCount;constructor(ee){this.cacheFilePath=ee,this.file=If(ee),this.savedEntryCount=Object.keys(this.file.entries).length}has(ee,te){return this.lookup(ee,te)!==void 0}lookup(ee,te){let Oe=this.next.get(ee);if(Oe?.hash===te)return Oe;let Ot=this.file.entries[ee];return Ot?.hash===te?Ot:void 0}get(ee,te){let Oe=this.lookup(ee,te);if(Oe===void 0)return null;this.next.set(ee,Oe);let{component:Ot,typeScriptMetadata:jt,propIgnores:Vt,pending:Wt}=structuredClone({component:Oe.component,typeScriptMetadata:Oe.typeScriptMetadata,propIgnores:Oe.propIgnores,pending:Oe.pending});if(jt!==void 0)Ot[E]=jt;if(Vt!==void 0)Ot[L]=Vt;return Wt===void 0?{component:Ot}:{component:Ot,pending:Wt}}set(ee,te,{component:Oe,pending:Ot}){this.dirty=!0,this.next.set(ee,{hash:te,...structuredClone({component:Oe,typeScriptMetadata:Oe[E],propIgnores:Oe[L],pending:Ot})})}getGeneratedText(ee,te){let Oe=this.next.get(ee);if(Oe?.generatedText===void 0||Oe.generatedText.key!==te)return;return Oe.generatedText.text}setGeneratedText(ee,te,Oe){let Ot=this.next.get(ee);if(Ot===void 0)return;if(Ot.generatedText?.key===te&&Ot.generatedText.text===Oe)return;Ot.generatedText={key:te,text:Oe},this.dirty=!0}save(){if(!this.dirty&&this.next.size===this.savedEntryCount)return;this.dirty=!1,this.savedEntryCount=this.next.size,kf(zp(this.cacheFilePath),{recursive:!0});let ee={...Qr(),entries:Object.fromEntries(this.next)},te=JSON.stringify(ee),Oe=`${this.cacheFilePath}.${process.pid}.tmp`;try{qp(Oe,te),Pf(Oe,this.cacheFilePath)}catch{try{qp(this.cacheFilePath,te)}catch{}}}}import{dirname as Of,relative as Lf,resolve as Mf}from"node:path";async function Qp(ee,te={}){await Hn();let Oe=Mf(ee),Ot=Of(Oe),jt=(Mt)=>n(`./${Lf(Ot,Mt)}`),Vt=ks(Oe,{...Ts(te.graph??new Kn),onAmbiguousStarExport:(Mt,Gt,Ut)=>{if(Mt!==Oe||!te.diagnostics)return;if(Ut.every((Xt)=>Xt.declFile.endsWith(".svelte")))return;let Ht=Array.from(new Set(Ut.map((Xt)=>jt(Xt.declFile)))),qt=Ht.map((Xt)=>`"${Xt}"`),zt=`${qt.slice(0,-1).join(", ")} and ${qt[qt.length-1]}`;te.diagnostics.push(a({component:jt(Oe),kind:"export-ambiguous",name:Gt,message:`"${Gt}" is exported by ${zt} through \`export *\`, so the barrel doesn't export it and the docs leave it out; export it explicitly from the barrel (e.g. \`export { ${Gt} } from "${Ht[0]}"\`).`}))}}),Wt=new Map;for(let Mt of Vt){if(Mt.name==="default"||Mt.declFile.endsWith(".svelte"))continue;let{declFile:Gt,returnType:Ut,literalValue:Ht,primitiveLiteral:qt,declaredType:zt,functionNode:Xt,namespaceFile:Jt,...Qt}=Mt,Yt=jt(Gt);if(Jt!==void 0)Qt.type=`typeof import(${JSON.stringify(jt(Jt))})`;Wt.set(Mt.name,{...Qt,source:Yt})}return Array.from(Wt.values()).sort((Mt,Gt)=>u(Mt.name,Gt.name))}async function jf(ee){let te=await Promise.all(Array.from(ee,async(Oe)=>{try{return[Oe,await Bf(Oe,"utf-8")]}catch(Ot){return console.warn(`Warning: Failed to read file ${Oe}:`,Ot),[Oe,null]}}));return new Map(te)}function ec(ee){if(ee.length===0)return;console.error(`sveld: failed to parse ${ee.length} component(s):`);for(let{filePath:te,message:Oe}of ee)console.error(` - ${te}: ${Oe}`)}class Bi{input;glob;options;graph=new Kn;collected;entryFile=null;globMergeState;cache;entryExports=[];entryDiagnostics=[];records=new Map;parseErrors=new Map;canonicalEntries=new Map;warnedModuleNames=new Set;constructor(ee,te,Oe={}){this.input=ee,this.glob=te,this.options=Oe}get documentExports(){return this.options.documentExports===!0}async build(){return this.graph=new Kn,this.collected=qr(this.input,this.glob,this.documentExports,this.graph),this.globMergeState=ws(this.collected.allComponentEntries,this.collected.resolveComponentFilePath),this.entryFile=Ff(this.input).isFile()?Zp(this.input):null,this.cache=this.options.cache===!1?void 0:new Zr(Yp(this.collected.rootDir,this.options.cache??!0)),await this.readEntryExports(),this.records.clear(),this.parseErrors.clear(),this.indexEntries(),await this.process(this.componentPaths()),ec(Array.from(this.parseErrors.values())),this.assemble()}async update(ee){let te=ee.map((Ut)=>Zp(Ut));if(this.graph.invalidate(...te),te.length===0)return{result:this.assemble(),reparsed:[]};let Oe=this.entryFile!==null&&te.includes(this.entryFile)?await this.recollect():[];if(this.glob){let{rootDir:Ut,exports:Ht,allComponentEntries:qt,resolveComponentFilePath:zt}=this.collected;Kr(this.graph,Ut,Ht,qt,zt,this.globMergeState)}this.indexEntries();let Ot=this.componentPaths();for(let Ut of this.records.keys())if(!Ot.has(Ut))this.records.delete(Ut);for(let Ut of this.parseErrors.keys())if(!Ot.has(Ut))this.parseErrors.delete(Ut);let jt=Array.from(this.records).flatMap(([Ut,{crossFileReads:Ht}])=>Ht?.some((qt)=>te.includes(qt))?[Ut]:[]),Vt=new Set([...te.filter((Ut)=>_n.test(Ut)),...Oe,...jt]),Wt=new Set(Array.from(Ot).filter((Ut)=>Vt.has(Ut))),Mt=await this.process(Wt),Gt=this.assemble();return ec(Gt.errors),{result:Gt,reparsed:Mt}}async recollect(){let ee=this.collected,te=qr(this.input,this.glob,this.documentExports,this.graph),Oe=[];for(let[Ot,jt]of Object.entries(te.exports)){let Vt=te.resolveComponentFilePath(jt.source),Wt=Object.hasOwn(ee.exports,Ot)?ee.exports[Ot]:void 0;if(Wt===void 0||ee.resolveComponentFilePath(Wt.source)!==Vt)Oe.push(Vt)}return this.collected=te,this.globMergeState=ws(te.allComponentEntries,te.resolveComponentFilePath),await this.readEntryExports(),Oe}async readEntryExports(){this.entryDiagnostics=[],this.entryExports=this.documentExports&&this.entryFile!==null?await Qp(this.entryFile,{diagnostics:this.entryDiagnostics,graph:this.graph}):[]}componentPaths(){let{exports:ee,allComponentEntries:te,resolveComponentFilePath:Oe}=this.collected,Ot=new Set;for(let[,jt]of[...Object.entries(ee),...te])if(mi(jt.source))Ot.add(Oe(jt.source));return Ot}indexEntries(){let{exports:ee,allComponentEntries:te,resolveComponentFilePath:Oe}=this.collected;this.canonicalEntries=new Map;for(let Ot of[Object.entries(ee),te])for(let jt of Ot){if(!mi(jt[1].source))continue;this.canonicalEntries.set(Oe(jt[1].source),this.entryIdentity(Ot,jt))}}entryIdentity(ee,[te,{source:Oe}]){return{moduleName:$p(te,Oe,ee.length,this.warnedModuleNames),filePath:n(Oe)}}canonicalEntry(ee){let te=this.canonicalEntries.get(ee);if(te===void 0)throw Error(`sveld: no entry lists ${ee}.`);return te}async process(ee){let te=new Map,Oe=await this.parse(ee,te);this.cache?.save();let Ot=await this.settle(Oe);for(let jt of ee)this.records.delete(jt),this.parseErrors.delete(jt);for(let[jt,Vt]of Ot)this.records.set(jt,Vt);for(let[jt,Vt]of te)this.parseErrors.set(jt,Vt);return Array.from(Ot.keys())}async parse(ee,te){let Oe=await jf(ee),Ot=this.cache,jt=new Map,Vt=new Set;if(Ot)for(let[Mt,Gt]of Oe){if(Gt===null)continue;let Ut=Ns(Gt);if(jt.set(Mt,Ut),!Ot.has(Mt,Ut))Vt.add(Mt)}if(ee.size>0&&(!Ot||Vt.size>0))await Hn();let Wt=new Map;for(let Mt of ee){let Gt=Oe.get(Mt);if(Gt===null||Gt===void 0)continue;let Ut=this.parseOne(Mt,Gt,jt.get(Mt),te);if(Ut)Wt.set(Mt,Ut)}return Wt}parseOne(ee,te,Oe,Ot){let jt=Oe===void 0?null:this.cache?.get(ee,Oe);if(jt)return jt;let{moduleName:Vt,filePath:Wt}=this.canonicalEntry(ee),Mt;try{Mt=new(Dn()).ComponentParser().parse(te,{moduleName:Vt,filePath:Wt})}catch(Gt){if(this.options.failFast)throw Gt;Ot.set(ee,{filePath:Wt,moduleName:Vt,message:Gt instanceof Error?Gt.message:String(Gt),stack:Gt instanceof Error?Gt.stack:void 0});return}if(Oe!==void 0)this.cache?.set(ee,Oe,Mt);return Mt}async settle(ee){let{rootDir:te,resolveComponentFilePath:Oe}=this.collected,Ot=new Map,jt=new Map;for(let[Gt,{component:Ut,pending:Ht}]of ee){let qt={...this.canonicalEntry(Gt),...Ut};Ot.set(Gt,qt),jt.set(qt,Ht)}let{checkExamples:Vt}=this.options;if(Vt){let Gt=await Kp(Ot.values(),Vt,te,Oe);for(let[Ut,Ht]of Gt)li(Ut,Ht)}let Wt=await Wp(Ot.values(),Oe,(Gt)=>jt.get(Gt),this.graph),Mt=new Map;for(let[Gt,Ut]of Ot){let{moduleName:Ht,filePath:qt,...zt}=Ut,Xt=Wt.get(qt);Mt.set(Gt,Xt===void 0?{component:zt}:{component:zt,crossFileReads:Xt})}return Mt}assemble(){let{exports:ee,allComponentEntries:te,resolveComponentFilePath:Oe}=this.collected,Ot=this.cache,jt=(qt,zt)=>{let{source:Xt}=zt[1];if(!mi(Xt))return;let Jt=this.records.get(Oe(Xt));if(Jt===void 0)return;return{component:{...this.entryIdentity(qt,zt),...Jt.component},record:Jt}},Vt=new Map,Wt=Ot?new Map:void 0,Mt=Ot?new Map:void 0;for(let qt of te){let zt=jt(te,qt);if(zt===void 0)continue;let{filePath:Xt}=zt.component;Vt.set(Xt,zt.component),(zt.record.crossFileReads===void 0?Wt:Mt)?.set(Xt,Oe(qt[1].source))}let Gt=lp(Vt,Oe,this.graph);for(let qt of Vt.values())li(qt,[...Gt(qt),...cp(qt)]);let Ut=new Map,Ht=Object.entries(ee);for(let qt of Ht){let zt=jt(Ht,qt);if(zt===void 0)continue;let Xt=Vt.get(zt.component.filePath);if(Xt)zt.component.diagnostics=Xt.diagnostics;Ut.set(zt.component.moduleName,zt.component)}return{exports:ee,entryExports:this.entryExports,components:Ut,allComponentsForTypes:Vt,errors:Array.from(this.parseErrors.values()),diagnostics:Ao(_o([...Array.from(Vt.values()).flatMap((qt)=>qt.diagnostics??[]),...this.entryDiagnostics]),this.options.diagnostics?.ignore),cache:Ot,resolvedPathByFilePath:Wt,crossFileResolvedPathByFilePath:Mt}}}function ji(ee){return{failFast:ee?.failFast,documentExports:ee?.documentExports===!0,cache:ee?.cache,checkExamples:ee?.checkExamples==="syntax"?"syntax":ee?.checkExamples===!0,diagnostics:ee?.diagnostics}}async function Vi(ee,te,Oe={}){return new Bi(ee,te,Oe).build()}import{existsSync as eo,readFileSync as Vf}from"node:fs";import{isAbsolute as Gf,join as nc}from"node:path";var Gi='sveld: could not resolve a Svelte entry point. Set package.json#svelte, or pass the "entry" option.';function tc(ee){return Gf(ee)?ee:nc(process.cwd(),ee)}function $e(ee){if(ee){let jt=tc(ee);if(eo(jt))return{entry:Z(ee)};return{entry:null,configured:!0,message:`Invalid entry point: ${jt}. Pass a valid --entry (or "entry" option), or unset it and set the "svelte" field in your package.json instead.`}}let te=nc(process.cwd(),"package.json");if(!eo(te))return{entry:null,configured:!1,message:'Could not locate a package.json file. Specify an entry point with --entry (or the "entry" option).'};let Oe;try{Oe=gp(JSON.parse(Vf(te,"utf-8")))}catch(jt){throw console.error("Error reading package.json:",jt),jt}let Ot=Oe.svelte?.trim();if(!Ot)return{entry:null,configured:!1,message:'Could not determine an entry point. Set the "svelte" field in your package.json, or pass --entry (or the "entry" option).'};if(!eo(tc(Ot)))return{entry:null,configured:!0,message:`The "svelte" field in package.json points to "${Ot}", which does not exist.`};return{entry:Z(Ot)}}function Ds(ee){let te=$e(ee);if(te.entry===null)console.error(te.message);return te.entry}async function ic(ee,te,Oe={}){let Ot=new Bi(ee,te,{...Oe,failFast:!1}),jt=await Ot.build();return{get result(){return Promise.resolve(jt)},async update(Vt){let Wt=await Ot.update(Vt);return jt=Wt.result,Wt}}}import no from"node:path";function sc(ee){let te=new Map,Oe=[];for(let[Ot,jt]of Object.entries(ee)){if(jt.star){Oe.push(`export * from "${jt.source}";`);continue}let Vt=te.get(jt.source)??[];Vt.push({id:Ot,exportee:jt}),te.set(jt.source,Vt)}for(let[Ot,jt]of te){let Vt=_n.test(Ot),Wt=jt.some(({id:zt,exportee:Xt})=>zt!=="default"&&Xt.default),Mt=jt.some(({exportee:zt})=>!zt.default),Gt=Vt&&Wt&&Mt,Ut=[],Ht=[],qt=[];for(let{id:zt,exportee:Xt}of jt){if(zt==="default"){Ht.push(`export { default } from "${Ot}";`);continue}if(Xt.default)if(Xt.mixed)Ht.push(`export { default as ${zt} } from "${Ot}";`),Ht.push(`export { default } from "${Ot}";`);else qt.push(`default as ${zt}`);else if(Vt&&!Gt)qt.push(`default as ${zt}`);else Ut.push(Xt.imported===void 0?zt:`${Xt.imported} as ${zt}`)}if(qt.length>0&&Ut.length>0)Oe.push(`export { ${[...qt,...Ut].join(", ")} } from "${Ot}";`);else{if(Ut.length>0)Oe.push(`export { ${Ut.join(", ")} } from "${Ot}";`);if(qt.length>0)Oe.push(`export { ${qt.join(", ")} } from "${Ot}";`)}Oe.push(...Ht)}return Oe.join(`
140
+ `)}function rc(ee){return ee.filter((te)=>te.names.length>0).map((te)=>`export type { ${te.names.join(", ")} } from "${te.source}";`).join(`
141
+ `)}function oc(ee){return ee.replace(_n,"")}function to(ee){return ee.replace(_n,".svelte.d.ts")}import{mkdir as Wf,readFile as Uf,writeFile as Hf}from"node:fs/promises";import{parse as Kf}from"node:path";class On{ensuredDirs=new Set;async write(ee,te){try{if(await Uf(ee,"utf-8")===te)return!1}catch{}let Oe=Kf(ee).dir;if(!this.ensuredDirs.has(Oe))await Wf(Oe,{recursive:!0}),this.ensuredDirs.add(Oe);return await Hf(ee,te),!0}}function qf(ee){return r(ee)&&!Array.isArray(ee)&&"start"in ee&&"end"in ee}function io(ee){if(Array.isArray(ee))return ee.map((te)=>io(te));if(r(ee)){let te={};for(let[Oe,Ot]of Object.entries(ee)){if((Oe==="source"||Oe==="componentCommentSource")&&qf(Ot))continue;te[Oe]=io(Ot)}return te}return ee}function zf(ee,te,Oe){if(!te)return`${ee.moduleName}.api.json`;if(!Oe.has(ee.moduleName))Oe.add(ee.moduleName),console.warn(`Warning: multiple components named "${ee.moduleName}" found. Their JSON files are keyed by source path instead of name to avoid overwriting each other.`);return`${oc(ee.filePath)}.api.json`}async function Xf(ee,te,Oe){let Ot=Rs(ee,{inputDir:te.inputDir,source:te.source}).components,jt=new Map;for(let Mt of Ot)jt.set(Mt.moduleName,(jt.get(Mt.moduleName)??0)+1);let Vt=new Set,Wt=new On;await Promise.all(Ot.map(async(Mt)=>{let Gt=(jt.get(Mt.moduleName)??0)>1,Ut=zf(Mt,Gt,Vt),Ht=no.resolve(no.join(Oe,Ut)),qt=await Wt.write(Ht,Ni(Mt));Bn(`${qt?"created":"unchanged"} "${Ht}".`)}))}function Rs(ee,te){let Oe=y(ee,{entryExports:te.entryExports}),Ot={...Oe,components:Oe.components.map((jt)=>({...jt,filePath:Ea(jt.filePath,te.inputDir)}))};return te.source===!1?io(Ot):Ot}function so(ee,te){return Ni(Rs(ee,te))}async function ro(ee,te){if(te.outDir){await Xf(ee,te,te.outDir);return}let Oe=await new On().write(no.resolve(te.outFile),so(ee,te));Bn(`${Oe?"created":"unchanged"} "${te.outFile}".`)}import{join as kc,resolve as ho}from"node:path";var ac=/`/g,pc=/\s+/g,zn="--",cc=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
142
+ | :- | :- | :- | :- | :- | :- | :- | :- |
143
+ `,lc=`| Slot name | Default | Props | Fallback | Description |
144
+ | :- | :- | :- | :- | :- |
145
+ `,uc=`| Event name | Type | Detail | Description |
146
+ | :- | :- | :- | :- |
147
+ `,oo=`| Name | Kind | Type | Description |
148
+ | :- | :- | :- | :- |
149
+ `,Jf=`| Member | Signature | Description |
150
+ | :- | :- | :- |
151
+ `,hc=`| Part name | Description |
152
+ | :- | :- |
153
+ `,dc=`| Property name | Type | Default value | Description |
154
+ | :- | :- | :- | :- |
155
+ `,fc=/\|/g,Yf=/</g,Qf=/>/g,Is=/\n/g,Zf=/^[A-Za-z_$][\w$]*$/,em=/\s*\n\s*/g,tm=/&(?=#?\w+;)|<(?=[A-Za-z/!?])|[|`*]|\\(?=[!-/:-@[-`{-~])|(?<![A-Za-z0-9])_|_(?![A-Za-z0-9])/g,nm=/[&<|`*\\_]/;function ao(ee){if(!nm.test(ee))return ee;return ee.replace(tm,(te)=>te==="&"?"&amp;":te==="<"?"&lt;":te==="_"?"&#95;":`&#${te.charCodeAt(0)};`)}function im(ee){return`<code>${ao(ee.includes(`
156
+ `)?ee.replace(em," "):ee)}</code>`}var sm=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function rm(ee){if(!ee.includes("{@link"))return ee;return ee.replace(sm,(te,Oe,Ot)=>`[${Ot===void 0?Oe:Ot.trim()}](${Oe})`)}function om(ee){return ee.includes("```")||ee.includes("~~~")}function am(ee){return xc(rm(ee))}var pm=/^([ \t]*)(`{3,}|~{3,})(.*)$/,cm=/^\n/,lm=/\n$/;function mc(ee){let te=(Vt)=>({kind:"prose",text:am(Vt.join(`
157
+ `))});if(!om(ee))return[te([ee])];let Oe=ee.split(`
158
+ `),Ot=[],jt=[];for(let Vt=0;Vt<Oe.length;Vt++){let Wt=pm.exec(Oe[Vt]),[,Mt="",Gt="",Ut=""]=Wt??[];if(!Wt||Gt[0]==="`"&&Ut.includes("`")){jt.push(Oe[Vt]);continue}if(jt.push(""),jt.length>1)Ot.push(te(jt));let Ht=[],qt=new RegExp(`^[ \\t]*${Gt[0]}{${Gt.length},}[ \\t]*$`);for(Vt++;Vt<Oe.length&&!qt.test(Oe[Vt]);Vt++){let zt=Oe[Vt],Xt=0;while(Xt<Mt.length&&(zt[Xt]===" "||zt[Xt]==="\t"))Xt++;Ht.push(zt.slice(Xt))}Ot.push({kind:"code",code:Ht.join(`
159
+ `)}),jt=[""]}if(jt.length>1||Ot.length===0)Ot.push(te(jt));return Ot}function gc(ee){let te="";for(let Oe=0;Oe<ee.length;Oe++){let Ot=ee[Oe];if(Ot.kind==="code"){te+=`<pre><code>${ao(Ot.code).replace(Is,"<br />")}</code></pre>`;continue}let jt=Ot.text;if(ee[Oe-1]?.kind==="code")jt=jt.replace(cm,"");if(ee[Oe+1]?.kind==="code")jt=jt.replace(lm,"");te+=jt.replace(fc,"&#124;").replace(Is,"<br />")}return te}function bn(ee){if(ee===void 0)return zn;return im(ee)}function yc(ee){if(!ee.reExport)return bn(ee.type);let{from:te,imported:Oe}=ee.reExport,Ot=Oe==="*"?"":Zf.test(Oe)?`.${Oe}`:`[${JSON.stringify(Oe)}]`;return bn(`typeof import(${JSON.stringify(te)})${Ot}`)}function xc(ee){if(!ee.includes("<")&&!ee.includes(">"))return ee;return ee.replace(Yf,"&lt;").replace(Qf,"&gt;")}function ri(ee,te){if(te===void 0)return ee;let Oe=typeof te==="string"&&te.trim().length>0?`: ${xc(te).replace(Is," ").replace(fc,"&#124;")}`:"";return`<s>${ee}</s><br />**Deprecated**${Oe}`}function Os(ee){if(ee===void 0||ee.trim().length===0)return zn;return gc(mc(ee))}function vc(ee){if(ee===void 0||ee==="{}"||ee==="Record<string, never>")return zn;return bn(ee.trim())}function Ec(ee){if(ee===void 0)return zn;return`<code>${ao(ee).replace(Is,"<br />")}</code>`}function Ei(ee,te){let Oe=[],Ot=(Vt)=>{let Wt=Oe.at(-1);if(Wt?.kind==="prose")Wt.text+=Vt;else Oe.push({kind:"prose",text:Vt})},jt=(Vt,Wt)=>{if(Oe.length>0)Ot(`
160
+ `);if(Vt)Ot(Vt);for(let Mt of mc(Wt))if(Mt.kind==="prose")Ot(Mt.text);else Oe.push(Mt)};if(ee?.trim())jt("",ee);for(let{name:Vt,body:Wt}of te??[]){let Mt=Wt?.trim();jt(Mt?`@${Vt} `:`@${Vt}`,Mt??"")}if(Oe.length===0)return zn;return gc(Oe)}function Sc(ee){return bn(ee)}function um(ee){let te=[ee.extends?`Extends ${bn(ee.extends)}.`:"",ee.implements?.length?`Implements ${ee.implements.map((Oe)=>bn(Oe)).join(", ")}.`:""].filter(Boolean);return te.length>0?te.join(" "):void 0}function bc(ee,te){let Oe=new Set;for(let Ot of te){if(Ot.kind!=="class")continue;let jt=um(Ot);if(!Ot.members?.length&&!jt)continue;let Vt=Ot.localName??Ot.name;if(Oe.has(Vt))continue;if(Oe.add(Vt),ee.append("h4",`\`${Vt}\` members`),jt)ee.append("raw",`${jt}
161
+
162
+ `);if(!Ot.members?.length)continue;ee.append("raw",Jf);for(let Wt of Ot.members)ee.append("raw",`| ${ri(Wt.name,Wt.deprecated)} | ${bn(Dr(Wt))} | ${Ei(Wt.description,Wt.tags)} |
163
+ `);ee.append("raw",`
164
+ `)}}function Cc(ee,te,Oe){if(ee.append("h1","Component Index"),ee.append("h2","Components").tableOfContents(),ee.append("divider"),Oe&&Oe.length>0)Tc(ee,Oe);for(let Ot of y(te).components)co(ee,Ot)}function wc(ee,te,Oe){ee.append("h1","Component Index"),ee.append("h2","Components");for(let Ot of te)ee.append("raw",`- [${Ot.moduleName}](./${Ot.moduleName}.md)
165
+ `);if(ee.append("raw",`
166
+ `),ee.append("divider"),Oe&&Oe.length>0)Tc(ee,Oe)}function Tc(ee,te){ee.append("h2","Exports"),ee.append("raw",oo);for(let Oe of te){let Ot=(Oe.type??Oe.value)?.replace(pc," ").trim();ee.append("raw",`| ${ri(Oe.name,Oe.deprecated)} | <code>${Oe.kind}</code> | ${bn(Ot)} | ${Os(Oe.description)} |
167
+ `)}ee.append("raw",`
168
+ `),ee.append("divider")}function hm(ee,te){ee.append("h3","Module exports"),ee.append("raw",oo);for(let Oe of te)ee.append("raw",`| ${ri(Oe.name,Oe.deprecated)} | <code>${Oe.kind}</code> | ${yc(Oe)} | ${Ei(Oe.description,Oe.tags)} |
169
+ `);ee.append("raw",`
170
+ `),bc(ee,te)}function po(ee,te,Oe){if(te.length>0)Oe(),ee.append("raw",`
171
+ `);else ee.append("p","None.")}function co(ee,te){if(ee.append("h2",`\`${te.moduleName}\``),te.generics)ee.append("p",`**Type parameters:** ${bn(`<${te.generics[1]}>`)}`);if(te.typedefs.length>0)ee.append("h3","Types").append("raw",`\`\`\`ts
172
+ ${Ss({typedefs:te.typedefs})}
173
+ \`\`\`
174
+
175
+ `);if(ee.append("h3","Props"),po(ee,te.props,()=>{ee.append("raw",cc);let Oe=(jt)=>jt.reactive?0:jt.constant?2:1,Ot=te.props.map((jt,Vt)=>({prop:jt,index:Vt})).sort((jt,Vt)=>Oe(jt.prop)-Oe(Vt.prop)||jt.index-Vt.index).map(({prop:jt})=>jt);for(let jt of Ot){let Vt=bs(jt)?"accessor":jt.kind;ee.append("raw",`| ${ri(jt.name,jt.deprecated)} | ${jt.isRequired?"Yes":"No"} | <code>${Vt}</code> | ${jt.reactive?"Yes":"No"} | ${jt.binding??"--"} | ${bn(jt.type)} | ${bn(jt.value)} | ${Ei(jt.description,jt.tags)} |
176
+ `)}}),te.moduleExports.length>0)hm(ee,te.moduleExports);if(ee.append("h3","Slots"),po(ee,te.slots,()=>{ee.append("raw",lc);for(let Oe of te.slots)ee.append("raw",`| ${ri(Oe.default?zn:Oe.name??zn,Oe.deprecated)} | ${Oe.default?"Yes":"No"} | ${vc(Oe.slot_props)} | ${Ec(Oe.fallback)} | ${Ei(Oe.description,Oe.tags)} |
177
+ `)}),ee.append("h3","Events"),po(ee,te.events,()=>{ee.append("raw",uc);for(let Oe of te.events)ee.append("raw",`| ${ri(Oe.name,Oe.deprecated)} | ${Oe.type} | ${Sc(Oe.detail)} | ${Ei(Oe.description,Oe.tags)} |
178
+ `)}),te.cssParts&&te.cssParts.length>0){ee.append("h3","CSS Parts"),ee.append("raw",hc);for(let Oe of te.cssParts)ee.append("raw",`| ${Oe.name} | ${Os(Oe.description)} |
179
+ `);ee.append("raw",`
180
+ `)}if(te.cssProperties&&te.cssProperties.length>0){ee.append("h3","CSS Custom Properties"),ee.append("raw",dc);for(let Oe of te.cssProperties)ee.append("raw",`| ${Oe.name} | ${bn(Oe.type)} | ${bn(Oe.default)} | ${Os(Oe.description)} |
181
+ `);ee.append("raw",`
182
+ `)}}var dm=/[^\w\- ]+/g,fm=/\s+/g,lo="<!-- __TOC__ -->";function mm(ee,te){let Oe=ee.toLowerCase().replace(ac,"").replace(dm,"").replace(fm,"-"),Ot=te.get(Oe)??0;return te.set(Oe,Ot+1),Ot===0?Oe:`${Oe}-${Ot}`}class uo{sourceParts=[];hasToC=!1;toc=[];onAppend;constructor(ee={}){this.onAppend=ee.onAppend}get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
183
+
184
+ `),this}append(ee,te){switch(ee){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{if(this.sourceParts.push(`${"#".repeat(Number(ee.slice(-1)))} ${te}`),this.hasToC&&ee==="h2")this.toc.push({indent:0,raw:te??""});break}case"quote":this.sourceParts.push(`> ${te}`);break;case"p":this.sourceParts.push(te??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(te??"");break}if(ee!=="raw")this.appendLineBreaks();return this.onAppend?.call(this,ee,this),this}tableOfContents(){return this.sourceParts.push(lo),this.hasToC=!0,this.appendLineBreaks(),this}end(){let ee=this.sourceParts.join("");if(!this.hasToC)return ee;let te=ee.indexOf(lo);if(te===-1)return ee;let Oe=new Map,Ot=this.toc.map(({indent:jt,raw:Vt})=>`${" ".repeat(jt)}- [${Vt}](#${mm(Vt,Oe)})`).join(`
185
+ `);return ee.slice(0,te)+Ot+ee.slice(te+lo.length)}}function Ls(ee,te){return new uo({onAppend:(Oe,Ot)=>{te?.onAppend?.call(null,Oe,Ot,ee)}})}function Wi(ee,te){let Oe=Ls(ee,te);return Cc(Oe,ee,te.entryExports),Oe.end()}async function gm(ee,te,Oe){let Ot=y(ee,{entryExports:te.entryExports}),jt=new On,Vt=Ls(ee,te);wc(Vt,Ot.components,te.entryExports);let Wt=ho(kc(Oe,"README.md")),Mt=await jt.write(Wt,Vt.end());Bn(`${Mt?"created":"unchanged"} "${Wt}".`),await Promise.all(Ot.components.map(async(Gt)=>{let Ut=Ls(ee,te);co(Ut,Gt);let Ht=ho(kc(Oe,`${Gt.moduleName}.md`)),qt=await jt.write(Ht,Ut.end());Bn(`${qt?"created":"unchanged"} "${Ht}".`)}))}async function fo(ee,te){if(te.outDir){await gm(ee,te,te.outDir);return}let Oe=ho(te.outFile),Ot=await new On().write(Oe,Wi(ee,te));Bn(`${Ot?"created":"unchanged"} "${te.outFile}".`)}import{join as ym,resolve as xm}from"node:path";function vm(ee,te){if(!te.indexTypes)return[];let Oe=te.format==="component",Ot=new Set,jt=[];for(let Vt of Object.values(te.exports)){if(!Vt.default||!_n.test(Vt.source))continue;let Wt=n(Vt.source);if(Ot.has(Wt))continue;Ot.add(Wt);let Mt=ee.components.find((Ut)=>Ut.filePath===Wt);if(!Mt)continue;let Gt=[xi(Mt.moduleName)];if(Oe)Gt.push(Li(Mt.moduleName));jt.push({source:Vt.source,names:Gt})}return jt}async function Ac(ee,te,Oe){if(!ee)return te;try{let Ot=await ee(te,Oe);if(typeof Ot!=="string")throw TypeError(`must return a string, got ${typeof Ot}`);return Ot}catch(Ot){let jt=Ot instanceof Error?Ot.message:String(Ot);throw Error(`sveld: typesOptions.transform failed for "${Oe.filePath}": ${jt}`,{cause:Ot})}}function Em(ee,te){return`${ee}
186
+ ${pp(te)}`}async function mo(ee,te){let Oe=xm(te.outDir,"index.d.ts"),Ot=new On,jt=y(ee),Vt=rc(vm(jt,te)),Wt=te.preamble+[sc(te.exports),Vt].filter((Xt)=>Xt!=="").join(`
187
+
188
+ `),Mt=Rr(te),Gt=jt.components.map(async(Xt)=>{let Jt=to(ym(te.outDir,Xt.filePath)),Qt=n(to(Xt.filePath)),Yt=te.resolvedPathByFilePath?.get(Xt.filePath),nn=Yt?void 0:te.crossFileResolvedPathByFilePath?.get(Xt.filePath),sn=Yt??nn,cn=Em(Xt.moduleName,Mt),un=nn?`${cn}
189
+ ${Ns(JSON.stringify(Xt))}`:cn,hn=sn?te.cache?.getGeneratedText(sn,un):void 0;if(hn===void 0){if(hn=Ir(Xt,Mt),sn)te.cache?.setGeneratedText(sn,un,hn)}let Ln=await Ac(te.transform,hn,{kind:"component",component:Xt,filePath:Qt});return Ot.write(Jt,Ln)}),Ut=(async()=>{let Xt=await Ac(te.transform,Wt,{kind:"index",filePath:"index.d.ts"});return Ot.write(Oe,`${Xt}
190
+ `)})(),Ht=(await Promise.all([...Gt,Ut])).filter(Boolean).length,qt=Gt.length+1,zt=Ht===0?`unchanged ${qt}`:`created ${Ht} of ${qt}`;Bn(`${zt} TypeScript definitions in "${te.outDir}".`)}var Sm=["reportDiagnostics","strict","check","checkLevel","stdout","format"],bm=50;function Cm(ee){let te=Promise.resolve();return()=>{te=te.then(ee,ee)}}function Lt(ee){let te=ee?.watch===!0,Oe,Ot,jt=ee??{},Vt,Wt=null,Mt,Gt=new Set,Ht=Cm(async()=>{if(Wt==null||Ot==null||Gt.size===0)return;let zt=Array.from(Gt);Gt.clear();try{let{result:Xt}=await Wt.update(zt);await Ui(Xt,jt,Ot)}catch(Xt){console.error("sveld: failed to regenerate types in watch mode:",Xt)}}),qt=(zt)=>{if(!te||Wt==null||!va.test(zt))return;Gt.add(zt),clearTimeout(Mt),Mt=setTimeout(Ht,bm)};return{name:"vite-plugin-sveld",apply:te?void 0:"build",enforce:"post",configResolved(zt){Vt=zt.root},async buildStart(){if(ee?.config){let Xt=await j(ee.config,Vt??process.cwd(),!1);jt=I(Xt,ee)}V(jt);let zt=Sm.filter((Xt)=>(Xt in jt));if(zt.length>0)console.warn(`sveld: the Vite plugin ignores ${zt.map((Xt)=>`"${Xt}"`).join(", ")}; run the sveld CLI or sveld() for them.`);if(G(jt.quiet===!0),Ot=Ds(jt.entry),te&&Ot!=null)try{Wt=await ic(Ot,jt.glob===!0,ji(jt)),await Ui(await Wt.result,jt,Ot)}catch(Xt){console.error("sveld: failed to generate initial types in watch mode:",Xt)}},async generateBundle(){if(te)return;if(Ot==null)this.error(Gi);Oe=await Vi(Ot,jt.glob===!0,ji(jt))},async writeBundle(){if(te)return;if(Ot==null)this.error(Gi);await Ui(Oe,jt,Ot)},handleHotUpdate(zt){qt(zt.file)},watchChange(zt){qt(zt)}}}async function Ui(ee,te,Oe){let Ot=Pc(Oe);if(te.types!==!1)await mo(ee.allComponentsForTypes,{outDir:"types",preamble:"",...te.typesOptions,exports:ee.exports,inputDir:Ot,cache:ee.cache,resolvedPathByFilePath:ee.resolvedPathByFilePath,crossFileResolvedPathByFilePath:ee.crossFileResolvedPathByFilePath});if(te.json)await ro(ee.components,{outFile:"COMPONENT_API.json",...te.jsonOptions,inputDir:Ot,entryExports:ee.entryExports});if(te.markdown)await fo(ee.components,{outFile:"COMPONENT_INDEX.md",...te.markdownOptions,entryExports:ee.entryExports});ee.cache?.save()}async function _c(ee,te,Oe){if(te.json){let Ot=so(ee.components,{...te.jsonOptions,inputDir:Pc(Oe),entryExports:ee.entryExports});process.stdout.write(Ot);return}if(te.markdown){let Ot=Wi(ee.components,{...te.markdownOptions,entryExports:ee.entryExports});process.stdout.write(Ot)}}import{realpathSync as $c,statSync as wm}from"node:fs";import{dirname as Nc,relative as Tm,resolve as km}from"node:path";function Am(ee){if(ee.check&&!ee.check.snapshotExists&&!ee.writesSnapshot)return 1;if(ee.check?.changes.some((te)=>te.kind==="schema"))return 1;if(ee.errors.length>0)return 2;if(ee.check&&$a(ee.check.bump,ee.checkLevel??"major"))return 3;if(ko(ee.diagnostics,ee.strict).length>0)return 4;return 0}async function Ie(ee,te,Oe=!1){let Ot=await Vi(ee,te.glob===!0,ji(te)),jt=te.check?await Re(Ot.components,Na(te),{entryExports:Ot.entryExports}):void 0;return await(Oe?_c:Ui)(Ot,te,ee),{result:Ot,check:jt}}function Pm(ee){let te=$c(wm(ee).isFile()?Nc(ee):ee),Oe=$c(process.env.GITHUB_WORKSPACE||process.cwd());return(Ot)=>n(Tm(Oe,km(te,Ot)))}function Le(ee,te,Oe,Ot){let jt=Oe.reportDiagnostics||Oe.strict,Vt=To(ee.diagnostics,jt);if(jt&&Vt.length>0)if(Oe.format==="json")process.stderr.write(Ro(Vt));else{if(Oe.format==="github"){let Mt=Do(Vt,Pm(Ot));if(Mt)console.error(Mt)}console.error($o(Vt))}let Wt=Am({errors:ee.errors,check:te,writesSnapshot:te?Da(Oe,te.snapshotFile):!1,checkLevel:Oe.checkLevel,diagnostics:Vt,strict:Oe.strict});return{diagnostics:Vt,exitCode:Wt}}async function Bt(ee){if(ee&&"input"in ee)throw Error("sveld: the `input` option was renamed to `entry`.");if(typeof ee?.config==="string")throw Error("sveld: `config` takes `true` or `false`; import another config file and pass its options instead.");let{entry:te,...Oe}=ee??{},Ot=await j(Oe.config,process.cwd(),!0),jt=Ds(te??Ot.entry);if(jt===null)throw Error(Gi);let Vt=I(Ot,Oe,{entry:jt});V(Vt),G(Vt.quiet===!0);let{result:Wt,check:Mt}=await Ie(jt,Vt),{diagnostics:Gt,exitCode:Ut}=Le(Wt,Mt,Vt,jt),Ht=Rs(Wt.components,{inputDir:Nc(jt),entryExports:Wt.entryExports,source:Vt.jsonOptions?.source});return{diagnostics:Gt,check:Mt,errors:Wt.errors,document:Ht,exitCode:Ut}}
191
+ export{E,L,ne,x,D,ve,H,re,Se,U,v,p,o,r,b,t,T,c,m,C,Me,be,k,l,O,N,i,z,w,P,ie,se,a,J,Fe,_,M,h,u,K,d,oe,X,ae,Te,Y,le,Be,Ce,pe,Q,g,S,s,ce,ue,e,je,Ve,qe,Ge,We,He,Ue,ze,Je,Ke,ke,Xe,Ye,we,Qe,Ze,et,tt,Pe,Ae,nt,De,rt,it,A,st,ot,at,lt,pt,ct,ut,dt,ft,Ne,mt,ht,gt,yt,xt,Et,de,vt,St,bt,_e,Tt,Ct,kt,wt,f,Pt,At,Dt,fe,me,F,Nt,_t,B,he,ge,R,n,Rt,y,$t,Re,ye,It,xe,Ft,j,I,V,Z,q,G,Ee,W,$e,Lt,Ie,Le,Bt};