@oomol-lab/open-flow 0.1.0-beta.88 → 0.1.0-beta.89

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.
@@ -1,11 +1,11 @@
1
1
  import { l as useTranslate } from "./dist-BFmpkX4P.js";
2
2
  import { xr as Button } from "./tooltip-BZ6tpqnr.js";
3
- import { a as DialogFooter, d as Field, f as FieldDescription, h as FieldLabel, hn as Input, i as DialogDescription, l as Icon, m as FieldGroup, n as DialogClose, o as DialogHeader, p as FieldError, r as DialogContent, s as DialogTitle, t as Dialog, u as Spinner } from "./dialog-Bi-MVTGj.js";
3
+ import { a as DialogFooter, d as Field, f as FieldDescription, h as FieldLabel, hn as Input, l as Icon, m as FieldGroup, n as DialogClose, o as DialogHeader, p as FieldError, r as DialogContent, s as DialogTitle, t as Dialog, u as Spinner } from "./dialog-Bi-MVTGj.js";
4
4
  import { t as WorkbenchSelect } from "./workbenchSelect-CHOeceKA.js";
5
5
  import { useEffect, useRef, useState } from "react";
6
6
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/workbench/browser/runtime/shell/createResourceDialog.tsx
8
- function CreateResourceDialog({ disabled, tagField, summary, field, id, issue, label, name, onNameChange, onOpenChange, onSubmit, pending, submitLabel, sourceUrl, title }) {
8
+ function CreateResourceDialog({ description, disabled, tagField, summary, field, id, issue, label, name, onNameChange, onOpenChange, onSubmit, pending, submitLabel, title }) {
9
9
  const t = useTranslate();
10
10
  const input = useRef(null);
11
11
  const portal = useRef(null);
@@ -14,11 +14,6 @@ function CreateResourceDialog({ disabled, tagField, summary, field, id, issue, l
14
14
  const showIssue = name.length > 0 && issue != null;
15
15
  const message = showIssue ? t(`resource.nameIssue.${issue}`, { max: 80 }) : t("resource.nameHint", { max: 80 });
16
16
  const messageId = `${id}-message`;
17
- let sourceHref;
18
- if (sourceUrl != null) try {
19
- const url = new URL(sourceUrl);
20
- if (url.protocol == "https:" || url.protocol == "http:") sourceHref = url.href;
21
- } catch {}
22
17
  const fieldId = `${id}-option`;
23
18
  useEffect(() => setOpen(true), []);
24
19
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", { ref: portal }), /* @__PURE__ */ jsx(Dialog, {
@@ -47,15 +42,7 @@ function CreateResourceDialog({ disabled, tagField, summary, field, id, issue, l
47
42
  type: "button",
48
43
  children: /* @__PURE__ */ jsx(Icon, { name: "close" })
49
44
  })]
50
- }), sourceUrl != null && /* @__PURE__ */ jsx(DialogDescription, {
51
- className: "break-all",
52
- children: sourceHref == null ? sourceUrl : /* @__PURE__ */ jsx("a", {
53
- href: sourceHref,
54
- target: "_blank",
55
- rel: "noreferrer",
56
- children: sourceUrl
57
- })
58
- })] }),
45
+ }), description] }),
59
46
  /* @__PURE__ */ jsxs(FieldGroup, {
60
47
  className: "gap-4",
61
48
  children: [
@@ -3108,7 +3108,7 @@ function ContextPanel({ className, layoutRoot, children, focusOnOpen, actions, h
3108
3108
  "aria-hidden": "true",
3109
3109
  children: /* @__PURE__ */ jsx("span", {
3110
3110
  className: `flex items-center justify-center text-2xl [&>svg]:size-full! ${icon === "flow" ? "size-5" : "size-6"}`,
3111
- children: /* @__PURE__ */ jsx(Icon, { name: icon })
3111
+ children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : icon
3112
3112
  })
3113
3113
  }), /* @__PURE__ */ jsx("strong", {
3114
3114
  id: titleId,
@@ -31707,7 +31707,8 @@ function RevisionCanvas({ draft, presentation, theme, interactiveMode$, defaultI
31707
31707
  return position != null && (position.x !== node.position.x || position.y !== node.position.y);
31708
31708
  });
31709
31709
  const selection = selected.length === 1 ? revision.node(selected[0]) : void 0;
31710
- const comment = selected.length === 1 ? model.nodes.find((node) => node.id === selected[0] && node.kind === "comment") : void 0;
31710
+ const selectedNode = selected.length === 1 ? model.nodes.find((node) => node.id === selected[0]) : void 0;
31711
+ const panelTitle = selectedNode?.title ?? (selected.length > 1 ? t("inspector.multipleSelected", { count: selected.length }) : t("inspector.outline"));
31711
31712
  const restoreLayout = layoutChanged ? /* @__PURE__ */ jsxs(Button$1, {
31712
31713
  className: "ml-auto",
31713
31714
  size: "xs",
@@ -31787,8 +31788,14 @@ function RevisionCanvas({ draft, presentation, theme, interactiveMode$, defaultI
31787
31788
  layoutRoot: root,
31788
31789
  className: "open-flow-property-panel",
31789
31790
  theme,
31790
- title: selection?.node.name ?? comment?.title ?? t("inspector.title"),
31791
- icon: comment?.kind === "comment" ? "comment" : inspectorIcon(selection),
31791
+ title: panelTitle,
31792
+ icon: selectedNode == null ? "flow" : selectedNode.kind === "comment" ? /* @__PURE__ */ jsx("i", {
31793
+ "aria-hidden": "true",
31794
+ className: "i-codicon:note size-full"
31795
+ }) : /* @__PURE__ */ jsx(CanvasNodeIcon, {
31796
+ ...selectedNode,
31797
+ className: "size-full"
31798
+ }),
31792
31799
  focusOnOpen: true,
31793
31800
  onClose: () => setInspectorOpen(false),
31794
31801
  children: selection != null ? /* @__PURE__ */ jsx(NodeInspector, {
@@ -31798,12 +31805,12 @@ function RevisionCanvas({ draft, presentation, theme, interactiveMode$, defaultI
31798
31805
  theme,
31799
31806
  connectorProviders: providerMetadata,
31800
31807
  triggerDisplays
31801
- }, `${graphId}:${selection.id}`) : comment?.kind === "comment" ? /* @__PURE__ */ jsx(CommentInspector, {
31802
- title: comment.title,
31803
- content: comment.content ?? "",
31808
+ }, `${graphId}:${selection.id}`) : selectedNode?.kind === "comment" ? /* @__PURE__ */ jsx(CommentInspector, {
31809
+ title: selectedNode.title,
31810
+ content: selectedNode.content ?? "",
31804
31811
  dark: theme === "dark",
31805
31812
  readOnly: true
31806
- }, comment.id) : /* @__PURE__ */ jsx(FlowNodeList, {
31813
+ }, selectedNode.id) : /* @__PURE__ */ jsx(FlowNodeList, {
31807
31814
  nodes: selected.length > 1 ? model.nodes.filter((node) => selected.includes(node.id)) : model.nodes,
31808
31815
  onSelect: (id) => setSelected([id]),
31809
31816
  onFocusNode: (nodeId) => {
@@ -1191,6 +1191,11 @@
1191
1191
  height: 18px;
1192
1192
  }
1193
1193
 
1194
+ :where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .size-full {
1195
+ width: 100%;
1196
+ height: 100%;
1197
+ }
1198
+
1194
1199
  :where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .h-1 {
1195
1200
  height: var(--spacing);
1196
1201
  }
@@ -67646,7 +67646,7 @@ function ContextPanel({ className, layoutRoot, children, focusOnOpen, actions, h
67646
67646
  "aria-hidden": "true",
67647
67647
  children: /* @__PURE__ */ jsx("span", {
67648
67648
  className: `flex items-center justify-center text-2xl [&>svg]:size-full! ${icon === "flow" ? "size-5" : "size-6"}`,
67649
- children: /* @__PURE__ */ jsx(Icon, { name: icon })
67649
+ children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : icon
67650
67650
  })
67651
67651
  }), /* @__PURE__ */ jsx("strong", {
67652
67652
  id: titleId,
@@ -119316,22 +119316,6 @@ function WebhookResponseEditor({ entries, disabled, readOnly, variables, renderS
119316
119316
  }
119317
119317
  //#endregion
119318
119318
  //#region src/workbench/browser/runtime/editor/nodeInspector.tsx
119319
- function inspectorIcon(node) {
119320
- if (node?.kind == "trigger") return "trigger";
119321
- if (node?.kind == "condition") return "condition";
119322
- if (node?.kind == "value") return "value";
119323
- if (node?.kind == "approval") return "check";
119324
- if (node?.kind == "wait") return "wait";
119325
- if (node?.kind === "webhook-response") return "response";
119326
- if (node?.kind == "outputs") return "outputs";
119327
- if (node?.kind == "task" && node.definition != null && "executor" in node.definition) {
119328
- if (node.definition.executor.kind == "decision") return "decision";
119329
- if (node.definition.executor.kind == "workflow") return "flow";
119330
- if (node.definition.executor.kind == "openapi" || node.definition.executor.kind == "http-request" || node.definition.executor.kind == "skip-duplicates") return "task";
119331
- return node.definition.executor.kind == "connector" || node.definition.executor.kind === "connector-proxy" ? "connection" : "llm";
119332
- }
119333
- return "task";
119334
- }
119335
119319
  function nodePurposePlaceholder(selection, t, action, displays) {
119336
119320
  switch (selection.kind) {
119337
119321
  case "webhook-response": return t("addNode.webhookResponseDescription");
@@ -120310,7 +120294,8 @@ function RevisionCanvas({ draft, presentation, theme, interactiveMode$, defaultI
120310
120294
  return position != null && (position.x !== node.position.x || position.y !== node.position.y);
120311
120295
  });
120312
120296
  const selection = selected.length === 1 ? revision.node(selected[0]) : void 0;
120313
- const comment = selected.length === 1 ? model.nodes.find((node) => node.id === selected[0] && node.kind === "comment") : void 0;
120297
+ const selectedNode = selected.length === 1 ? model.nodes.find((node) => node.id === selected[0]) : void 0;
120298
+ const panelTitle = selectedNode?.title ?? (selected.length > 1 ? t("inspector.multipleSelected", { count: selected.length }) : t("inspector.outline"));
120314
120299
  const restoreLayout = layoutChanged ? /* @__PURE__ */ jsxs(Button$1, {
120315
120300
  className: "ml-auto",
120316
120301
  size: "xs",
@@ -120390,8 +120375,14 @@ function RevisionCanvas({ draft, presentation, theme, interactiveMode$, defaultI
120390
120375
  layoutRoot: root,
120391
120376
  className: "open-flow-property-panel",
120392
120377
  theme,
120393
- title: selection?.node.name ?? comment?.title ?? t("inspector.title"),
120394
- icon: comment?.kind === "comment" ? "comment" : inspectorIcon(selection),
120378
+ title: panelTitle,
120379
+ icon: selectedNode == null ? "flow" : selectedNode.kind === "comment" ? /* @__PURE__ */ jsx("i", {
120380
+ "aria-hidden": "true",
120381
+ className: "i-codicon:note size-full"
120382
+ }) : /* @__PURE__ */ jsx(CanvasNodeIcon, {
120383
+ ...selectedNode,
120384
+ className: "size-full"
120385
+ }),
120395
120386
  focusOnOpen: true,
120396
120387
  onClose: () => setInspectorOpen(false),
120397
120388
  children: selection != null ? /* @__PURE__ */ jsx(NodeInspector, {
@@ -120401,12 +120392,12 @@ function RevisionCanvas({ draft, presentation, theme, interactiveMode$, defaultI
120401
120392
  theme,
120402
120393
  connectorProviders: providerMetadata,
120403
120394
  triggerDisplays
120404
- }, `${graphId}:${selection.id}`) : comment?.kind === "comment" ? /* @__PURE__ */ jsx(CommentInspector, {
120405
- title: comment.title,
120406
- content: comment.content ?? "",
120395
+ }, `${graphId}:${selection.id}`) : selectedNode?.kind === "comment" ? /* @__PURE__ */ jsx(CommentInspector, {
120396
+ title: selectedNode.title,
120397
+ content: selectedNode.content ?? "",
120407
120398
  dark: theme === "dark",
120408
120399
  readOnly: true
120409
- }, comment.id) : /* @__PURE__ */ jsx(FlowNodeList, {
120400
+ }, selectedNode.id) : /* @__PURE__ */ jsx(FlowNodeList, {
120410
120401
  nodes: selected.length > 1 ? model.nodes.filter((node) => selected.includes(node.id)) : model.nodes,
120411
120402
  onSelect: (id) => setSelected([id]),
120412
120403
  onFocusNode: (nodeId) => {
@@ -1191,6 +1191,11 @@
1191
1191
  height: 18px;
1192
1192
  }
1193
1193
 
1194
+ :where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .size-full {
1195
+ width: 100%;
1196
+ height: 100%;
1197
+ }
1198
+
1194
1199
  :where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .h-1 {
1195
1200
  height: var(--spacing);
1196
1201
  }
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from 'react';
1
2
  import type { WorkflowBundleImportResult } from '../common/control-api.js';
2
3
  import type { FlowCatalogEvent, FlowChangeEvent } from './flow-notifications.js';
3
4
  import type { WorkflowBundle } from '../common/flow-workflowBundle.js';
@@ -56,11 +57,12 @@ export interface WorkbenchPreferences {
56
57
  /** The host resolves deployment and Flow scope before rendering navigation links. */
57
58
  export type ConnectionHref = (flowId: string, providerId: string, connectionId?: string) => string | undefined;
58
59
  /** Object values are complete response/ETag records; implementations must reject failures. */
59
- /** File content already loaded by the host; Open Flow never fetches sourceUrl. */
60
+ /** File content already loaded by the host. */
60
61
  export interface WorkbenchImportInput {
61
62
  readonly text: string;
62
63
  readonly fileName?: string;
63
- readonly sourceUrl?: string;
64
+ /** Host-rendered content below the import dialog title. The host owns its links and presentation. */
65
+ readonly description?: ReactNode;
64
66
  }
65
67
  export interface OpenFlowWorkbenchHandle {
66
68
  /** Opens confirmation on an idle, initialized Flow list. Invalid files notify the host. Does not create a Flow. */
@@ -3032,6 +3032,11 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
3032
3032
  height: 18px;
3033
3033
  }
3034
3034
 
3035
+ :where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .size-full {
3036
+ width: 100%;
3037
+ height: 100%;
3038
+ }
3039
+
3035
3040
  :where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .h-1 {
3036
3041
  height: var(--spacing);
3037
3042
  }
@@ -520,7 +520,7 @@ function FlowDeletionDialog({ flow, workspace, container, busy, finalFocus, onCl
520
520
  }
521
521
  //#endregion
522
522
  //#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
523
- var CreateResourceDialog = lazy(() => import("./createResourceDialog-CB3eiK7e.js"));
523
+ var CreateResourceDialog = lazy(() => import("./createResourceDialog-BstGO0m4.js"));
524
524
  var flowIdTooltipAlignOffset = 44;
525
525
  var renamePopoverAlignOffset = -12;
526
526
  function compactFlowId(flowId) {
@@ -983,7 +983,7 @@ var FlowBrowser = forwardRef(function FlowBrowser({ catalogWidth, createFlowDisa
983
983
  kind: "import",
984
984
  file,
985
985
  key: randomId(),
986
- ...input.sourceUrl == null ? {} : { sourceUrl: input.sourceUrl }
986
+ description: input.description
987
987
  });
988
988
  return "opened";
989
989
  }
@@ -1235,6 +1235,7 @@ var FlowBrowser = forwardRef(function FlowBrowser({ catalogWidth, createFlowDisa
1235
1235
  creation != null && /* @__PURE__ */ jsx(Suspense, {
1236
1236
  fallback: null,
1237
1237
  children: /* @__PURE__ */ jsx(CreateResourceDialog, {
1238
+ description: creation.kind == "import" ? creation.description : void 0,
1238
1239
  disabled: createFlowDisabled || creatingTag,
1239
1240
  tagField: (container) => /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: t("tags.title") }), /* @__PURE__ */ jsx(TagPicker, {
1240
1241
  ...tagsContext,
@@ -1262,7 +1263,6 @@ var FlowBrowser = forwardRef(function FlowBrowser({ catalogWidth, createFlowDisa
1262
1263
  },
1263
1264
  onSubmit: (event) => void create(event),
1264
1265
  pending: busy == "flow",
1265
- sourceUrl: creation.kind == "import" ? creation.sourceUrl : void 0,
1266
1266
  submitLabel: creation.kind == "import" ? t("resource.importFlow") : void 0,
1267
1267
  title: t(creation.kind == "create" ? "resource.newFlow" : "resource.importFlow")
1268
1268
  })
@@ -7314,7 +7314,7 @@ var WorkbenchStore = class {
7314
7314
  };
7315
7315
  //#endregion
7316
7316
  //#region src/workbench/browser/runtime/openFlowWorkbench.tsx
7317
- var FlowWorkspace = lazy(() => import("./flowWorkspace-B79fy3Me.js"));
7317
+ var FlowWorkspace = lazy(() => import("./flowWorkspace-d9Ef-aRK.js"));
7318
7318
  function OpenFlowSessionGate({ action, description, error, onSubmit, onTokenChange, pending = false, title, token, tokenLabel }) {
7319
7319
  const hasToken = token != null && tokenLabel != null && onTokenChange != null;
7320
7320
  const tokenValue = token ?? "";
@@ -3,7 +3,7 @@ var bv=Object.defineProperty;var xv=(e)=>e;function wv(e,n){this[e]=xv.bind(null
3
3
  `:`\r
4
4
  `;else o=String.fromCharCode(r);return++this.state.curLine,this.state.lineStart=this.state.pos,o}jsxReadString(t){let r="",o=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(He.UnterminatedString,this.state.startLoc);let i=this.input.charCodeAt(this.state.pos);if(i===t)break;if(i===38)r+=this.input.slice(o,this.state.pos),r+=this.jsxReadEntity(),o=this.state.pos;else if(iw(i))r+=this.input.slice(o,this.state.pos),r+=this.jsxReadNewLine(!1),o=this.state.pos;else++this.state.pos}r+=this.input.slice(o,this.state.pos++),this.finishToken(130,r)}jsxReadEntity(){let t=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let r=10;if(this.codePointAtPos(this.state.pos)===120)r=16,++this.state.pos;let o=this.readInt(r,void 0,!1,"bail");if(o!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(o)}else{let r=0,o=!1;while(r++<10&&this.state.pos<this.length&&!(o=this.codePointAtPos(this.state.pos)===59))++this.state.pos;if(o){let i=this.input.slice(t,this.state.pos),s=OA[i];if(++this.state.pos,s)return s}}return this.state.pos=t,"&"}jsxReadWord(){let t,r=this.state.pos;do t=this.input.charCodeAt(++this.state.pos);while(hw(t)||t===45);this.finishToken(136,this.input.slice(r,this.state.pos))}jsxParseIdentifier(){let t=this.startNode();if(this.match(136))t.name=this.state.value;else if(pw(this.state.type))t.name=wd(this.state.type);else this.unexpected();return this.next(),this.finishNode(t,"JSXIdentifier")}jsxParseNamespacedName(){let t=this.state.startLoc,r=this.jsxParseIdentifier();if(!this.eat(10))return r;let o=this.startNodeAt(t);return o.namespace=r,o.name=this.jsxParseIdentifier(),this.finishNode(o,"JSXNamespacedName")}jsxParseElementName(){let t=this.state.startLoc,r=this.jsxParseNamespacedName();if(r.type==="JSXNamespacedName")return r;while(this.eat(12)){let o=this.startNodeAt(t);o.object=r,o.property=this.jsxParseIdentifier(),r=this.finishNode(o,"JSXMemberExpression")}return r}jsxParseAttributeValue(){let t;switch(this.state.type){case 2:if(t=this.startNode(),this.setContext(Ce.brace),this.next(),t=this.jsxParseExpressionContainer(t,Ce.j_oTag),t.expression.type==="JSXEmptyExpression")this.raise(Lt.AttributeIsEmpty,t);return t;case 138:case 130:return this.parseExprAtom();default:throw this.raise(Lt.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let t=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(t,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(t){return this.next(),t.expression=this.parseExpression(),this.setContext(Ce.j_expr),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(t,"JSXSpreadChild")}jsxParseExpressionContainer(t,r){if(this.match(4))t.expression=this.jsxParseEmptyExpression();else{let o=this.parseExpression();if(o.type==="SequenceExpression"&&!o.extra?.parenthesized)this.raise(Lt.UnexpectedSequenceExpression,o.expressions[1]);t.expression=o}return this.setContext(r),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(t,"JSXExpressionContainer")}jsxParseAttribute(){if(this.match(2)){let r=this.startNode();return this.setContext(Ce.brace),this.next(),this.expect(17),r.argument=this.parseMaybeAssignAllowIn(),this.setContext(Ce.j_oTag),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(r,"JSXSpreadAttribute")}let t=this.startNode();return t.name=this.jsxParseNamespacedName(),t.value=this.eat(25)?this.jsxParseAttributeValue():null,this.finishNode(t,"JSXAttribute")}jsxParseOpeningElementAt(t){if(this.eat(139)){let o=this.startNodeAt(t);return this.finishNode(o,"JSXOpeningFragment")}let r=this.startNodeAt(t);return r.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(r)}jsxParseOpeningElementAfterName(t){let r=[];while(!this.match(52)&&!this.match(139))r.push(this.jsxParseAttribute());return t.attributes=r,t.selfClosing=this.eat(52),this.expect(139),this.finishNode(t,"JSXOpeningElement")}jsxParseClosingElementAt(t){if(this.eat(139)){let o=this.startNodeAt(t);return this.finishNode(o,"JSXClosingFragment")}let r=this.startNodeAt(t);return r.name=this.jsxParseElementName(),this.expect(139),this.finishNode(r,"JSXClosingElement")}jsxParseElementAt(t){let r=this.startNodeAt(t),o=[],i=this.jsxParseOpeningElementAt(t),s=null;if(!i.selfClosing){e:for(;;)switch(this.state.type){case 138:if(t=this.state.startLoc,this.next(),this.eat(52)){this.setLoc(t),s=this.jsxParseClosingElementAt(t);break e}o.push(this.jsxParseElementAt(t));break;case 137:o.push(this.parseLiteral(this.state.value,"JSXText"));break;case 2:{let a=this.startNode();if(this.setContext(Ce.brace),this.next(),this.match(17))o.push(this.jsxParseSpreadChild(a));else o.push(this.jsxParseExpressionContainer(a,Ce.j_expr));break}default:this.unexpected()}if(on(i)&&!on(s)&&s!==null)this.raise(Lt.MissingClosingTagFragment,s);else if(!on(i)&&on(s))this.raise(Lt.MissingClosingTagElement,s,{openingTagName:lr(i.name)});else if(!on(i)&&!on(s)){if(lr(s.name)!==lr(i.name))this.raise(Lt.MissingClosingTagElement,s,{openingTagName:lr(i.name)})}}if(on(i))r.openingFragment=i,r.closingFragment=s;else r.openingElement=i,r.closingElement=s;if(r.children=o,this.match(43))throw this.raise(Lt.UnwrappedAdjacentJSXElements,this.state.startLoc);return on(i)?this.finishNode(r,"JSXFragment"):this.finishNode(r,"JSXElement")}jsxParseElement(){let t=this.state.startLoc;return this.next(),this.jsxParseElementAt(t)}setContext(t){let{context:r}=this.state;r[r.length-1]=t}parseExprAtom(t){if(this.match(138))return this.jsxParseElement();else if(this.match(43)&&this.input.charCodeAt(this.state.pos)!==33)return this.replaceToken(138),this.jsxParseElement();else return super.parseExprAtom(t)}skipSpace(){if(!this.curContext().preserveSpace)super.skipSpace()}getTokenFromCode(t){let r=this.curContext();if(r===Ce.j_expr){this.jsxReadToken();return}if(r===Ce.j_oTag||r===Ce.j_cTag){if(vd(t)){this.jsxReadWord();return}if(t===62){++this.state.pos,this.finishToken(139);return}if((t===34||t===39)&&r===Ce.j_oTag){this.jsxReadString(t);return}}if(t===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(138);return}super.getTokenFromCode(t)}updateContext(t){let{context:r,type:o}=this.state;if(o===52&&t===138)r.splice(-2,2,Ce.j_cTag),this.state.canStartJSXElement=!1;else if(o===138)r.push(Ce.j_oTag);else if(o===139){let i=r[r.length-1];if(i===Ce.j_oTag&&t===52||i===Ce.j_cTag)r.pop(),this.state.canStartJSXElement=r[r.length-1]===Ce.j_expr;else this.setContext(Ce.j_expr),this.state.canStartJSXElement=!0}else this.state.canStartJSXElement=hA(o)}},gw,bw,oM,dd,$A,N,MA=(e)=>class extends e{getScopeHandler(){return bw}tsIsIdentifier(){return _e(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(2)||this.match(51)||this.match(17)||this.match(134)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){if(this.next(),this.hasPrecedingLineBreak())return!1;return this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){if(this.match(102))return this.next(),this.tsTokenCanFollowModifier();return this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(t,r,o){if(!_e(this.state.type)&&this.state.type!==54&&this.state.type!==71)return;let i=this.state.value;if(t.includes(i)){if(o&&this.match(102))return;if(r&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return i}return}tsParseModifiers({allowedModifiers:t,disallowedModifiers:r,stopOnStartOfClassStaticBlock:o,errorTemplate:i=N.InvalidModifierOnTypeMember},s){let a=(l,u,d,p)=>{if(u===d&&s[p])this.raise(N.InvalidModifiersOrder,l,{orderedModifiers:[d,p]})},c=(l,u,d,p)=>{if(s[d]&&u===p||s[p]&&u===d)this.raise(N.IncompatibleModifiers,l,{modifiers:[d,p]})};for(;;){let{startLoc:l}=this.state,u=this.tsParseModifier(t.concat(r??[]),o,s.static);if(!u)break;if(aw(u))if(s.accessibility)this.raise(N.DuplicateAccessibilityModifier,l,{modifier:u});else a(l,u,u,"override"),a(l,u,u,"static"),a(l,u,u,"readonly"),s.accessibility=u;else if(LA(u)){if(s[u])this.raise(N.DuplicateModifier,l,{modifier:u});s[u]=!0,a(l,u,"in","out")}else{if(Object.hasOwn(s,u))this.raise(N.DuplicateModifier,l,{modifier:u});else a(l,u,"static","readonly"),a(l,u,"static","override"),a(l,u,"override","readonly"),a(l,u,"abstract","override"),c(l,u,"declare","override"),c(l,u,"static","abstract");s[u]=!0}if(r?.includes(u))this.raise(i,l,{modifier:u})}}tsIsListTerminator(t){switch(t){case"EnumMembers":case"TypeMembers":return this.match(4);case"HeritageClauseElement":return this.match(2);case"TupleElementTypes":return this.match(1);case"TypeParametersOrArguments":return this.match(44)}}tsParseList(t,r){let o=[];while(!this.tsIsListTerminator(t))o.push(r());return o}tsParseDelimitedList(t,r,o){return _A(this.tsParseDelimitedListWorker(t,r,!0,o))}tsParseDelimitedListWorker(t,r,o,i){let s=[],a=-1;for(;;){if(this.tsIsListTerminator(t))break;a=-1;let c=r();if(c==null)return;if(s.push(c),this.eat(8)){a=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(t))break;if(o)this.expect(8);return}if(i)i.value=a;return s}tsParseBracketedList(t,r,o,i,s){if(!i)if(o)this.expect(0);else this.expect(43);let a=this.tsParseDelimitedList(t,r,s);if(o)this.expect(1);else this.expect(44);return a}tsParseImportType(){let t=this.startNode();if(this.expect(79),this.expect(6),!this.match(130))this.raise(N.UnsupportedImportTypeArgument,this.state.startLoc),t.source=this.tsParseNonConditionalType();else t.source=this.parseStringLiteral(this.state.value);if(this.eat(8))t.options=this.tsParseImportTypeOptions();else t.options=null;if(this.expect(7),this.eat(12))t.qualifier=this.tsParseEntityName(3);if(this.match(43))t.typeArguments=this.tsParseTypeArguments();return this.finishNode(t,"TSImportType")}tsParseImportTypeOptions(){let t=this.startNode();this.expect(2);let r=this.startNode();if(this.isContextual(72))r.method=!1,r.key=this.parseIdentifier(!0),r.computed=!1,r.shorthand=!1;else this.unexpected(null,72);return this.expect(10),r.value=this.tsParseImportTypeWithPropertyValue(),t.properties=[this.finishObjectProperty(r)],this.eat(8),this.expect(4),this.finishNode(t,"ObjectExpression")}tsParseImportTypeWithPropertyValue(){let t=this.startNode(),r=[];this.expect(2);while(!this.match(4)){let o=this.state.type;if(_e(o)||o===130)r.push(super.parsePropertyDefinition(null));else this.unexpected();this.eat(8)}return t.properties=r,this.next(),this.finishNode(t,"ObjectExpression")}tsParseEntityName(t){let r;if(t&1&&this.match(74))if(t&2)r=this.parseIdentifier(!0);else{let o=this.startNode();this.next(),r=this.finishNode(o,"ThisExpression")}else r=this.parseIdentifier(!!(t&1));while(this.eat(12)){let o=this.startNodeAtNode(r);o.left=r,o.right=this.parseIdentifier(!!(t&1)),r=this.finishNode(o,"TSQualifiedName")}return r}tsParseTypeReference(){let t=this.startNode();if(t.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(43))t.typeArguments=this.tsParseTypeArguments();return this.finishNode(t,"TSTypeReference")}tsParseThisTypePredicate(t){this.next();let r=this.startNodeAtNode(t);return r.parameterName=t,r.typeAnnotation=this.tsParseTypeAnnotation(!1),r.asserts=!1,this.finishNode(r,"TSTypePredicate")}tsParseThisTypeNode(){let t=this.startNode();return this.next(),this.finishNode(t,"TSThisType")}tsParseTypeQuery(){let t=this.startNode();if(this.expect(83),this.match(79))t.exprName=this.tsParseImportType();else t.exprName=this.tsParseEntityName(1);if(!this.hasPrecedingLineBreak()&&this.match(43))t.typeArguments=this.tsParseTypeArguments();return this.finishNode(t,"TSTypeQuery")}tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:N.InvalidModifierOnTypeParameter});tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:N.InvalidModifierOnTypeParameterPositions});tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:N.InvalidModifierOnTypeParameter});tsParseTypeParameter(t){let r=this.startNode();return t(r),r.name=this.tsParseTypeParameterName(),r.constraint=this.tsEatThenParseType(77),r.default=this.tsEatThenParseType(25),this.finishNode(r,"TSTypeParameter")}tsTryParseTypeParameters(t){if(this.match(43))return this.tsParseTypeParameters(t)}tsParseTypeParameters(t){let r=this.startNode();if(this.match(43)||this.match(138))this.next();else this.unexpected();let o={value:-1};if(r.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,t),!1,!0,o),r.params.length===0)this.raise(N.EmptyTypeParameters,r);if(o.value!==-1)this.addExtra(r,"trailingComma",o.value);return this.finishNode(r,"TSTypeParameterDeclaration")}tsFillSignature(t,r){let o=t===15,i="params",s="returnType";if(r.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(6),r.params=this.tsParseBindingListForSignature(),o)r.returnType=this.tsParseTypeOrTypePredicateAnnotation(t);else if(this.match(t))r.returnType=this.tsParseTypeOrTypePredicateAnnotation(t)}tsParseBindingListForSignature(){let t=super.parseBindingList(7,41,2);for(let r of t){let{type:o}=r;if(o==="AssignmentPattern"||o==="TSParameterProperty")this.raise(N.UnsupportedSignatureParameterKind,r,{type:o})}return t}tsParseTypeMemberSemicolon(){if(!this.eat(8)&&!this.isLineTerminator())this.expect(9)}tsParseSignatureMember(t,r){return this.tsFillSignature(10,r),this.tsParseTypeMemberSemicolon(),this.finishNode(r,t)}tsIsUnambiguouslyIndexSignature(){if(this.next(),_e(this.state.type))return this.next(),this.match(10);return!1}tsTryParseIndexSignature(t){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let r=this.parseIdentifier();r.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(r),this.expect(1),t.parameters=[r];let o=this.tsTryParseTypeAnnotation();if(o)t.typeAnnotation=o;return this.tsParseTypeMemberSemicolon(),this.finishNode(t,"TSIndexSignature")}tsParsePropertyOrMethodSignature(t,r){if(this.eat(13))t.optional=!0;if(this.match(6)||this.match(43)){if(r)this.raise(N.ReadonlyForMethodSignature,t);let o=t;if(o.kind&&this.match(43))this.raise(N.AccessorCannotHaveTypeParameters,this.state.curPosition());if(this.tsFillSignature(10,o),this.tsParseTypeMemberSemicolon(),o.kind==="get"){if(o.params.length>0){if(this.raise(He.BadGetterArity,this.state.curPosition()),this.isThisParam(o.params[0]))this.raise(N.AccessorCannotDeclareThisParameter,this.state.curPosition())}}else if(o.kind==="set"){if(o.params.length!==1)this.raise(He.BadSetterArity,this.state.curPosition());else{let i=o.params[0];if(this.isThisParam(i))this.raise(N.AccessorCannotDeclareThisParameter,this.state.curPosition());if(i.type==="Identifier"&&i.optional)this.raise(N.SetAccessorCannotHaveOptionalParameter,this.state.curPosition());if(i.type==="RestElement")this.raise(N.SetAccessorCannotHaveRestParameter,this.state.curPosition())}if(o.returnType)this.raise(N.SetAccessorCannotHaveReturnType,o.returnType)}else o.kind="method";return this.finishNode(o,"TSMethodSignature")}else{let o=t;if(r)o.readonly=!0;let i=this.tsTryParseTypeAnnotation();if(i)o.typeAnnotation=i;return this.tsParseTypeMemberSemicolon(),this.finishNode(o,"TSPropertySignature")}}tsParseTypeMember(){let t=this.startNode();if(this.match(6)||this.match(43))return this.tsParseSignatureMember("TSCallSignatureDeclaration",t);if(this.match(73)){let o=this.startNode();if(this.next(),this.match(6)||this.match(43))return this.tsParseSignatureMember("TSConstructSignatureDeclaration",t);else return t.key=this.createIdentifier(o,"new"),this.tsParsePropertyOrMethodSignature(t,!1)}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},t);let r=this.tsTryParseIndexSignature(t);if(r)return r;if(super.parsePropertyName(t),!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&this.tsTokenCanFollowModifier()){if(t.kind=t.key.name,super.parsePropertyName(t),!this.match(6)&&!this.match(43))this.unexpected(null,6)}return this.tsParsePropertyOrMethodSignature(t,!!t.readonly)}tsParseTypeLiteral(){let t=this.startNode();return t.members=this.tsParseObjectTypeMembers(),this.finishNode(t,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(2);let t=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(4),t}tsIsStartOfMappedType(){if(this.next(),this.eat(49))return this.isContextual(118);if(this.isContextual(118))this.next();if(!this.match(0))return!1;if(this.next(),!this.tsIsIdentifier())return!1;return this.next(),this.match(54)}tsParseMappedType(){let t=this.startNode();if(this.expect(2),this.match(49))t.readonly=this.state.value,this.next(),this.expectContextual(118);else if(this.eatContextual(118))t.readonly=!0;if(this.expect(0),t.key=this.tsParseTypeParameterName(),t.constraint=this.tsExpectThenParseType(54),t.nameType=this.eatContextual(89)?this.tsParseType():null,this.expect(1),this.match(49))t.optional=this.state.value,this.next(),this.expect(13);else if(this.eat(13))t.optional=!0;return t.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(4),this.finishNode(t,"TSMappedType")}tsParseTupleType(){let t=this.startNode();t.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let r=!1;return t.elementTypes.forEach((o)=>{let{type:i}=o;if(r&&i!=="TSRestType"&&i!=="TSOptionalType"&&!(i==="TSNamedTupleMember"&&o.optional))this.raise(N.OptionalTypeBeforeRequired,o);r||=i==="TSNamedTupleMember"&&o.optional||i==="TSOptionalType"}),this.finishNode(t,"TSTupleType")}tsParseTupleElementType(){let t=this.state.startLoc,r=this.eat(17),{startLoc:o}=this.state,i,s,a,c,u=Sn(this.state.type)?this.lookaheadCharCode():null;if(u===58)i=!0,a=!1,s=this.parseIdentifier(!0),this.expect(10),c=this.tsParseType();else if(u===63){a=!0;let d=this.state.value,p=this.tsParseNonArrayType();if(this.lookaheadCharCode()===58)i=!0,s=this.createIdentifier(this.startNodeAt(o),d),this.expect(13),this.expect(10),c=this.tsParseType();else i=!1,c=p,this.expect(13)}else c=this.tsParseType(),a=this.eat(13),i=this.eat(10);if(i){let d;if(s){if(d=this.startNodeAt(o),d.optional=a,d.label=s,d.elementType=c,this.eat(13))d.optional=!0,this.raise(N.TupleOptionalAfterType,this.state.lastTokStartLoc)}else d=this.startNodeAt(o),d.optional=a,this.raise(N.InvalidTupleMemberLabel,c),d.label=c,d.elementType=this.tsParseType();c=this.finishNode(d,"TSNamedTupleMember")}else if(a){let d=this.startNodeAt(o);d.typeAnnotation=c,c=this.finishNode(d,"TSOptionalType")}if(r){let d=this.startNodeAt(t);d.typeAnnotation=c,c=this.finishNode(d,"TSRestType")}return c}tsParseParenthesizedType(){let t=this.startNode();return this.expect(6),t.typeAnnotation=this.tsParseType(),this.expect(7),this.finishNode(t,"TSParenthesizedType")}tsParseFunctionOrConstructorType(t,r){let o=this.startNode();if(t==="TSConstructorType"){if(o.abstract=!!r,r)this.next();this.next()}return this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(15,o)),this.finishNode(o,t)}tsParseLiteralTypeNode(){let t=this.startNode();switch(this.state.type){case 131:case 132:case 130:case 81:case 82:t.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(t,"TSLiteralType")}tsParseTemplateLiteralType(){let t=this.state.startLoc,r=this.parseTemplateElement(!1),o=[r];if(r.tail){let i=this.startNodeAt(t),s=this.startNodeAt(t);return s.expressions=[],s.quasis=o,i.literal=this.finishNode(s,"TemplateLiteral"),this.finishNode(i,"TSLiteralType")}else{let i=[];while(!r.tail)i.push(this.tsParseType()),this.readTemplateContinuation(),o.push(r=this.parseTemplateElement(!1));let s=this.startNodeAt(t);return s.types=i,s.quasis=o,this.finishNode(s,"TSTemplateLiteralType")}}parseTemplateSubstitution(){if(this.state.inType)return this.tsParseType();return super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let t=this.tsParseThisTypeNode();if(this.isContextual(112)&&!this.hasPrecedingLineBreak())return this.tsParseThisTypePredicate(t);else return t}tsParseNonArrayType(){switch(this.state.type){case 130:case 131:case 132:case 81:case 82:return this.tsParseLiteralTypeNode();case 49:if(this.state.value==="-"){let t=this.startNode(),r=this.lookahead();if(r.type!==131&&r.type!==132)this.unexpected();return t.literal=this.parseMaybeUnary(),this.finishNode(t,"TSLiteralType")}break;case 74:return this.tsParseThisTypeOrThisTypePredicate();case 83:return this.tsParseTypeQuery();case 79:return this.tsParseImportType();case 2:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 6:if(!(this.optionFlags&2048)){let t=this.state.startLoc;this.next();let r=this.tsParseType();return this.expect(7),this.addExtra(r,"parenthesized",!0),this.addExtra(r,"parenStart",t.index),r}return this.tsParseParenthesizedType();case 21:case 20:return this.tsParseTemplateLiteralType();default:{let{type:t}=this.state;if(_e(t)||t===84||t===80){let r=t===84?"TSVoidKeyword":t===80?"TSNullKeyword":DA(this.state.value);if(r!==void 0&&this.lookaheadCharCode()!==46){let o=this.startNode();return this.next(),this.finishNode(o,r)}return this.tsParseTypeReference()}}}throw this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:t}=this.state,r=this.tsParseNonArrayType();while(!this.hasPrecedingLineBreak()&&this.eat(0))if(this.match(1)){let o=this.startNodeAt(t);o.elementType=r,this.expect(1),r=this.finishNode(o,"TSArrayType")}else{let o=this.startNodeAt(t);o.objectType=r,o.indexType=this.tsParseType(),this.expect(1),r=this.finishNode(o,"TSIndexedAccessType")}return r}tsParseTypeOperator(){let t=this.startNode(),r=this.state.value;if(this.next(),t.operator=r,t.typeAnnotation=this.tsParseTypeOperatorOrHigher(),r==="readonly")this.tsCheckTypeAnnotationForReadOnly(t);return this.finishNode(t,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(t){switch(t.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(N.UnexpectedReadonly,t)}}tsParseInferType(){let t=this.startNode();this.expectContextual(111);let r=this.startNode();return r.name=this.tsParseTypeParameterName(),r.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),t.typeParameter=this.finishNode(r,"TSTypeParameter"),this.finishNode(t,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(77)){let t=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(13))return t}}tsParseTypeOperatorOrHigher(){return yA(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(111)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(t,r,o){let i=this.startNode(),s=this.eat(o),a=[];do a.push(r());while(this.eat(o));if(a.length===1&&!s)return a[0];return i.types=a,this.finishNode(i,t)}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),41)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),39)}tsIsStartOfFunctionType(){if(this.match(43))return!0;return this.match(6)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(_e(this.state.type)||this.match(74))return this.next(),!0;if(this.match(2)){let{errors:t}=this.state,r=t.length;try{return this.parseObjectLike(4,!0),t.length===r}catch{return!1}}if(this.match(0)){this.next();let{errors:t}=this.state,r=t.length;try{return super.parseBindingList(1,93,1),t.length===r}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(7)||this.match(17))return!0;if(this.tsSkipParameterStart()){if(this.match(10)||this.match(8)||this.match(13)||this.match(25))return!0;if(this.match(7)){if(this.next(),this.match(15))return!0}}return!1}tsParseTypeOrTypePredicateAnnotation(t){return this.tsInType(()=>{let r=this.startNode();this.expect(t);let o=this.startNode(),i=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(i&&this.match(74)){let c=this.tsParseThisTypeOrThisTypePredicate();if(c.type==="TSThisType")o.parameterName=c,o.asserts=!0,o.typeAnnotation=null,c=this.finishNode(o,"TSTypePredicate");else this.resetStartLocationFromNode(c,o),c.asserts=!0;return r.typeAnnotation=c,this.finishNode(r,"TSTypeAnnotation")}let s=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!s){if(!i)return this.tsParseTypeAnnotation(!1,r);return o.parameterName=this.parseIdentifier(),o.asserts=i,o.typeAnnotation=null,r.typeAnnotation=this.finishNode(o,"TSTypePredicate"),this.finishNode(r,"TSTypeAnnotation")}let a=this.tsParseTypeAnnotation(!1);return o.parameterName=s,o.typeAnnotation=a,o.asserts=i,r.typeAnnotation=this.finishNode(o,"TSTypePredicate"),this.finishNode(r,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(10))return this.tsParseTypeOrTypePredicateAnnotation(10)}tsTryParseTypeAnnotation(){if(this.match(10))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(10)}tsParseTypePredicatePrefix(){let t=this.parseIdentifier();if(this.isContextual(112)&&!this.hasPrecedingLineBreak())return this.next(),t}tsParseTypePredicateAsserts(){if(this.state.type!==105)return!1;let t=this.state.containsEsc;if(this.next(),!_e(this.state.type)&&!this.match(74))return!1;if(t)this.raise(He.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"});return!0}tsParseTypeAnnotation(t=!0,r=this.startNode()){return this.tsInType(()=>{if(t)this.expect(10);r.typeAnnotation=this.tsParseType()}),this.finishNode(r,"TSTypeAnnotation")}tsParseType(){sw(this.state.inType);let t=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(77))return t;let r=this.startNodeAtNode(t);return r.checkType=t,r.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(13),r.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(10),r.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(r,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(120)&&this.isLookaheadContextual("new")}tsParseNonConditionalType(){if(this.tsIsStartOfFunctionType())return this.tsParseFunctionOrConstructorType("TSFunctionType");if(this.match(73))return this.tsParseFunctionOrConstructorType("TSConstructorType");else if(this.isAbstractConstructorSignature())return this.tsParseFunctionOrConstructorType("TSConstructorType",!0);return this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){if(this.getPluginOption("typescript","disallowAmbiguousJSXLike"))this.raise(N.ReservedTypeAssertion,this.state.startLoc);let t=this.startNode();return t.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?this.tsParseTypeReference():this.tsParseType())),this.expect(44),t.expression=this.parseMaybeUnary(),this.finishNode(t,"TSTypeAssertion")}tsParseHeritageClause(t){let r=this.state.startLoc,o=this.tsParseDelimitedList("HeritageClauseElement",()=>{let i=(this.state.canStartArrow=!1,super.parseExprSubscripts());if(!fd(i))this.raise(N.InvalidHeritageClauseType,i.start,{token:t});let s=t==="extends"?"TSInterfaceHeritage":"TSClassImplements";if(i.type==="TSInstantiationExpression")return i.type=s,i;let a=this.startNodeAtNode(i);if(a.expression=i,this.match(43)||this.match(47))a.typeArguments=this.tsParseTypeArgumentsInExpression();return this.finishNode(a,s)});if(!o.length)this.raise(N.EmptyHeritageClauseType,r,{token:t});return o}tsParseInterfaceDeclaration(t,r={}){if(this.hasFollowingLineBreak())return null;if(this.expectContextual(125),r.declare)t.declare=!0;if(_e(this.state.type))t.id=this.parseIdentifier(),this.checkIdentifier(t.id,130);else t.id=null,this.raise(N.MissingInterfaceName,this.state.startLoc);if(t.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(77))t.extends=this.tsParseHeritageClause("extends");let o=this.startNode();return o.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),t.body=this.finishNode(o,"TSInterfaceBody"),this.finishNode(t,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(t){return t.id=this.parseIdentifier(),this.checkIdentifier(t.id,2),t.typeAnnotation=this.tsInType(()=>{if(t.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(25),this.isContextual(110)&&this.lookaheadCharCode()!==46){let r=this.startNode();return this.next(),this.finishNode(r,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(t,"TSTypeAliasDeclaration")}tsInTopLevelContext(t){if(this.curContext()!==Ce.brace){let r=this.state.context;this.state.context=[r[0]];try{return t()}finally{this.state.context=r}}else return t()}tsInType(t){let r=this.state.inType;this.state.inType=!0;try{return t()}finally{this.state.inType=r}}tsInDisallowConditionalTypesContext(t){let r=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return t()}finally{this.state.inDisallowConditionalTypesContext=r}}tsInAllowConditionalTypesContext(t){let r=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return t()}finally{this.state.inDisallowConditionalTypesContext=r}}tsEatThenParseType(t){if(this.match(t))return this.tsNextThenParseType()}tsExpectThenParseType(t){return this.tsInType(()=>(this.expect(t),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let t=this.startNode();if(t.id=this.match(130)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(25))t.initializer=super.parseMaybeAssignAllowIn();return this.finishNode(t,"TSEnumMember")}tsParseEnumDeclaration(t,r={}){if(r.const)t.const=!0;if(r.declare)t.declare=!0;return this.expectContextual(122),t.id=this.parseIdentifier(),this.checkIdentifier(t.id,t.const?8971:8459),t.body=this.tsParseEnumBody(),this.finishNode(t,"TSEnumDeclaration")}tsParseEnumBody(){let t=this.startNode();return this.expect(2),t.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(4),this.finishNode(t,"TSEnumBody")}tsParseModuleBlock(t){let r=this.startNode();if(!t)this.scope.enter(0);if(this.expect(2),super.parseBlockOrModuleBlockBody(r.body=[],void 0,!0,4),!t)this.scope.exit();return this.finishNode(r,"TSModuleBlock")}tsParseNamespaceDeclaration(t){if(t.id=this.tsParseEntityName(0),t.id.type==="Identifier")this.checkIdentifier(t.id,1024);return this.scope.enter(2048),this.prodParam.enter(0),t.body=this.tsParseModuleBlock(!1),this.prodParam.exit(),this.scope.exit(),this.finishNode(t,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(t){let r=this.isContextual(108);if(r)t.kind="global",t.id=this.parseIdentifier();else{t.kind="module";let{type:o,value:i}=this.state;if(o===130)t.id=super.parseStringLiteral(i);else if(_e(o))this.raise(N.InlineModuleDeclarationMustUseString,this.state.startLoc),t.id=this.tsParseEntityName(0);else if(o===2)this.raise(N.EmptyNamespaceName,this.state.startLoc);else this.raise(N.InvalidNamespaceName,this.state.startLoc,i),t.id=super.parseExprAtom()}if(this.match(2)){if(!r)this.scope.enter(1024);if(this.prodParam.enter(0),t.body=this.tsParseModuleBlock(r),this.prodParam.exit(),!r)this.scope.exit()}else this.semicolon();return this.finishNode(t,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(t,r){t.id=r||this.parseIdentifier(),this.checkIdentifier(t.id,4096),this.expect(25);let o=this.tsParseModuleReference();if(t.importKind==="type"&&o.type!=="TSExternalModuleReference")this.raise(N.ImportAliasHasImportType,o);return t.moduleReference=o,this.semicolon(),this.finishNode(t,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(115)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let t=this.startNode();if(this.expectContextual(115),this.expect(6),!this.match(130))this.unexpected();return t.expression=super.parseExprAtom(),this.expect(7),this.sawUnambiguousESM=!0,this.finishNode(t,"TSExternalModuleReference")}tsLookAhead(t){let r=this.state.clone(),o=t();return this.state=r,o}tsTryParseAndCatch(t){let r=this.tryParse((o)=>t()||o());if(r.aborted||!r.node)return;if(r.error)this.state=r.failState;return r.node}tsTryParse(t){let r=this.state.clone(),o=t();if(o!==void 0&&o!==!1)return o;this.state=r}tsTryParseDeclare(t){if(this.isLineTerminator())return;let r=this.state.type;return this.tsInAmbientContext(()=>{switch(r){case 64:return t.declare=!0,super.parseFunctionStatement(t,!1,!1);case 76:return t.declare=!0,this.parseClass(t,!0,!1);case 122:return this.tsParseEnumDeclaration(t,{declare:!0});case 108:return this.tsParseAmbientExternalModuleDeclaration(t);case 96:if(this.state.containsEsc)return;case 71:case 70:if(!this.match(71)||!this.isLookaheadContextual("enum"))return t.declare=!0,this.parseVarStatement(t,this.state.value,!0);return this.expect(71),this.tsParseEnumDeclaration(t,{const:!0,declare:!0});case 103:if(this.isUsing())return this.raise(N.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),t.declare=!0,this.parseVarStatement(t,"using",!0);break;case 92:if(this.isAwaitUsing())return this.raise(N.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),t.declare=!0,this.next(),this.parseVarStatement(t,"await using",!0);break;case 125:{let o=this.tsParseInterfaceDeclaration(t,{declare:!0});if(o)return o}default:if(_e(r))return this.tsParseDeclaration(t,this.state.type,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.type,!0,null)}tsParseDeclaration(t,r,o,i){switch(r){case 120:if(this.tsCheckLineTerminator(o)&&(this.match(76)||_e(this.state.type)))return this.tsParseAbstractDeclaration(t,i);break;case 123:if(this.tsCheckLineTerminator(o))return this.tsParseAmbientExternalModuleDeclaration(t);break;case 124:if(this.tsCheckLineTerminator(o)&&_e(this.state.type))return t.kind="namespace",this.tsParseNamespaceDeclaration(t);break;case 126:if(this.tsCheckLineTerminator(o)&&_e(this.state.type))return this.tsParseTypeAliasDeclaration(t);break}}tsCheckLineTerminator(t){if(t){if(this.hasFollowingLineBreak())return!1;return this.next(),!0}return!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(t){if(!this.match(43))return;let r=this.tsTryParseAndCatch(()=>{let o=this.startNodeAt(t);return o.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(o),o.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(15),o});if(!r)return;return super.parseArrowExpression(r,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()!==43)return;return this.tsParseTypeArguments()}tsParseTypeArguments(){let t=this.startNode();if(t.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(43),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),t.params.length===0)this.raise(N.EmptyTypeArguments,t);else if(!this.state.inType&&this.curContext()===Ce.brace)this.reScan_lt_gt();return this.expect(44),this.finishNode(t,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return gA(this.state.type)}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;return super.isExportDefaultSpecifier()}parseBindingElement(t,r){let o=r.length?null:this.state.startLoc,i={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},i);let{accessibility:s,override:a,readonly:c}=i;if(!(t&4)&&(s||c||a))this.raise(N.UnexpectedParameterModifier,o||r[0]);let l=this.state.startLoc,u=this.parseMaybeDefault(l);if(t&2)this.parseFunctionParamType(u);let d=this.parseMaybeDefault(l,u);if(s||c||a){let p=o?this.startNodeAt(o):this.startNodeAtNode(r[0]);if(r.length)p.decorators=r;else this.setLoc(o);if(s)p.accessibility=s;if(c)p.readonly=c;if(a)p.override=a;if(d.type!=="Identifier"&&d.type!=="AssignmentPattern")this.raise(N.UnsupportedParameterPropertyKind,o||r[0]);return p.parameter=d,this.finishNode(p,"TSParameterProperty")}if(r.length)u.decorators=r;return d}isSimpleParameter(t){return t.type==="TSParameterProperty"&&super.isSimpleParameter(t.parameter)||super.isSimpleParameter(t)}tsDisallowOptionalPattern(t){for(let r of t.params)if(r.type!=="Identifier"&&r.optional&&!this.state.isAmbientContext)this.raise(N.PatternIsOptional,r)}setArrowFunctionParameters(t,r,o){super.setArrowFunctionParameters(t,r,o),this.tsDisallowOptionalPattern(t)}parseFunctionBodyAndFinish(t,r,o=!1){if(this.match(10))t.returnType=this.tsParseTypeOrTypePredicateAnnotation(10);let i=r==="FunctionDeclaration"?"TSDeclareFunction":r==="ClassMethod"||r==="ClassPrivateMethod"?"TSDeclareMethod":void 0;if(i&&!this.match(2)&&this.isLineTerminator()){if(i==="TSDeclareMethod"&&t.kind==="constructor"){for(let s of t.params)if(s.type==="TSParameterProperty")this.raise(N.UnexpectedParameterModifier,s);else if(s.type==="AssignmentPattern")this.raise(N.UnexpectedParameterInitializer,s)}else for(let s of t.params)if(s.type==="AssignmentPattern")this.raise(N.UnexpectedParameterInitializer,s);return this.finishNode(t,i)}if(i&&this.state.isAmbientContext){if(this.raise(N.DeclareFunctionHasImplementation,this.state.startLoc),i==="TSDeclareFunction"&&t.declare)return super.parseFunctionBodyAndFinish(t,i,o)}return this.tsDisallowOptionalPattern(t),super.parseFunctionBodyAndFinish(t,r,o)}registerFunctionStatementId(t){if(!t.body&&t.id)this.checkIdentifier(t.id,1024);else super.registerFunctionStatementId(t)}tsCheckForInvalidTypeCasts(t){t.forEach((r)=>{if(r?.type==="TSTypeCastExpression")this.raise(N.UnexpectedTypeAnnotation,r.typeAnnotation)})}toReferencedList(t,r){return this.tsCheckForInvalidTypeCasts(t),t}parseArrayLike(t,r){let o=super.parseArrayLike(t,r);if(o.type==="ArrayExpression")this.tsCheckForInvalidTypeCasts(o.elements);return o}parseSubscript(t,r,o,i){if(!this.hasPrecedingLineBreak()&&this.match(31)){this.state.canStartJSXElement=!1,this.next();let a=this.startNodeAt(r);return a.expression=t,this.finishNode(a,"TSNonNullExpression")}let s=!1;if(this.match(14)&&this.lookaheadCharCode()===60){if(o)return i.stop=!0,t;i.optionalChainMember=s=!0,this.next()}if(this.match(43)||this.match(47)){let a,c=this.tsTryParseAndCatch(()=>{if(!o&&this.atPossibleAsyncArrow(t)){let p=this.tsTryParseGenericAsyncArrowFunction(r);if(p)return i.stop=!0,p}let l=this.tsParseTypeArgumentsInExpression();if(!l)return;if(s&&!this.match(6)){a=this.state.curPosition();return}if(xA(this.state.type)){let p=super.parseTaggedTemplateExpression(t,r,i);return p.typeArguments=l,p}if(!o&&this.eat(6)){let p=this.startNodeAt(r);if(p.callee=t,p.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(p.arguments),p.typeArguments=l,i.optionalChainMember)p.optional=s;return this.finishCallExpression(p,i.optionalChainMember)}let u=this.state.type;if(u===44||u===48||u!==6&&u!==89&&u!==116&&mA(u)&&!this.hasPrecedingLineBreak())return;let d=this.startNodeAt(r);return d.expression=t,d.typeArguments=l,this.finishNode(d,"TSInstantiationExpression")});if(a)this.unexpected(a,6);if(c){if(c.type==="TSInstantiationExpression"){if(this.match(12)||this.match(14)&&this.lookaheadCharCode()!==40)this.raise(N.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc);if(!this.match(12)&&!this.match(14))c.expression=super.stopParseSubscript(t,i)}return c}}return super.parseSubscript(t,r,o,i)}parseNewCallee(t){super.parseNewCallee(t);let{callee:r}=t;if(r.type==="TSInstantiationExpression"&&!r.extra?.parenthesized)t.typeArguments=r.typeArguments,t.callee=r.expression}parseExprOp(t,r,o){let i;if(bA(54)>o&&!this.hasPrecedingLineBreak()&&(this.isContextual(89)||(i=this.isContextual(116)))){let s=this.startNodeAt(r);s.expression=t,s.typeAnnotation=this.tsInType(()=>{if(this.next(),this.match(71)){if(i)this.raise(He.UnexpectedKeyword,this.state.startLoc,{keyword:"const"});return this.tsParseTypeReference()}return this.tsParseType()});let a=this.finishNode(s,i?"TSSatisfiesExpression":"TSAsExpression");return this.reScan_lt_gt(),this.parseExprOp(a,r,o)}return super.parseExprOp(t,r,o)}checkReservedWord(t,r,o,i){if(!this.state.isAmbientContext)super.checkReservedWord(t,r,o,i)}checkDuplicateExports(){}isPotentialImportPhase(t){if(super.isPotentialImportPhase(t))return!0;if(this.isContextual(126)){let r=this.lookaheadCharCode();return t?r===123||r===42:r!==61}return!t&&this.isContextual(83)}applyImportPhase(t,r,o,i){if(super.applyImportPhase(t,r,o,i),r)t.exportKind=o==="type"?"type":"value";else t.importKind=o==="type"||o==="typeof"?o:"value"}parseImport(t){if(this.match(130)){if(t.importKind="value",this.scope.inTSNamespace)this.raise(N.ImportInTSNamespace,t);return super.parseImport(t)}let r;if(_e(this.state.type)&&this.lookaheadCharCode()===61){t.importKind="value";let o=this.tsParseImportEqualsDeclaration(t);if(this.scope.inTSNamespace&&o.moduleReference.type==="TSExternalModuleReference")this.raise(N.ImportInTSNamespace,t);return o}else if(this.isContextual(126)){let o=this.parseMaybeImportPhase(t,!1);if(this.lookaheadCharCode()===61){if(this.scope.inTSNamespace)this.raise(N.ImportInTSNamespace,t);return this.tsParseImportEqualsDeclaration(t,o)}else r=super.parseImportSpecifiersAndAfter(t,o)}else r=super.parseImport(t);if(r.importKind==="type"&&r.specifiers.length>1&&r.specifiers[0].type==="ImportDefaultSpecifier")this.raise(N.TypeImportCannotSpecifyDefaultAndNamed,r);else if(this.scope.inTSNamespace)this.raise(N.ImportInTSNamespace,r);return r}parseExport(t,r){if(this.match(79)){let o=this.startNode();this.next();let i=null;if(this.isContextual(126)&&this.isPotentialImportPhase(!1))i=this.parseMaybeImportPhase(o,!1);else o.importKind="value";let s=this.tsParseImportEqualsDeclaration(o,i);return t.attributes=[],t.declaration=s,t.exportKind="value",t.source=null,t.specifiers=[],this.finishNode(t,"ExportNamedDeclaration")}else if(this.eat(25)){let o=t;if(o.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.scope.inTSNamespace)this.raise(N.ExportAssignmentInTSNamespace,o);return this.finishNode(o,"TSExportAssignment")}else if(this.eatContextual(89)){let o=t;if(this.expectContextual(124),o.id=this.parseIdentifier(),this.checkIdentifier(o.id,8201),this.semicolon(),this.scope.inTSNamespace)this.raise(N.NamespaceExportInTSNamespace,o);return this.finishNode(o,"TSNamespaceExportDeclaration")}else{let o=super.parseExport(t,r);if(this.scope.inTSNamespace&&(o.type!=="ExportNamedDeclaration"||o.source||!o.declaration&&!this.state.isAmbientContext))this.raise(N.ExportInTSNamespace,o);return o}}isAbstractClass(){return this.isContextual(120)&&this.isLookaheadContextual("class")}parseExportDefaultExpression(){if(this.isAbstractClass()){let t=this.startNode();return this.next(),t.abstract=!0,this.parseClass(t,!0,!0)}if(this.match(125)){let t=this.tsParseInterfaceDeclaration(this.startNode());if(t)return t}return super.parseExportDefaultExpression()}parseVarStatement(t,r,o=!1){let{isAmbientContext:i}=this.state,s=super.parseVarStatement(t,r,o||i);if(i&&!t.declare&&(r==="using"||r==="await using"))return this.raiseOverwrite(N.UsingDeclarationInAmbientContext,t,r),s;for(let a of s.declarations){let{id:c,init:l,definite:u}=a;if(u){if(l)this.raise(N.DeclaratorDefiniteAssertionWithInitializer,c);else if(!c.typeAnnotation)this.raise(N.DeclaratorDefiniteAssertionRequiresTypeAnnotation,c)}if(i&&l){if(r==="var"||r==="let"||!!c.typeAnnotation)this.raise(N.InitializerNotAllowedInAmbientContext,l);else if(!FA(l,this.hasPlugin("estree")))this.raise(N.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,l)}}return s}parseStatementContent(t,r){let o=!!(t&2);if(!this.state.containsEsc)switch(this.state.type){case 71:{if(this.isLookaheadContextual("enum")){let i=this.startNode();return this.next(),this.tsParseEnumDeclaration(i,{const:!0})}break}case 120:case 121:{if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let i=this.state.type,s=this.startNode();this.next();let a=i===121?this.tsTryParseDeclare(s):this.tsParseAbstractDeclaration(s,r);if(a){if(i===121)a.declare=!0;return a}else return s.expression=this.createIdentifier(this.startNodeAtNode(s),i===121?"declare":"abstract"),this.semicolon(!1),this.finishNode(s,"ExpressionStatement")}break}case 122:return this.tsParseEnumDeclaration(this.startNode());case 108:{if(this.lookaheadCharCode()===123){let s=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(s)}break}case 125:{let i=this.tsParseInterfaceDeclaration(this.startNode());if(i){if(!o)this.raise(N.UnexpectedTypeDeclaration,i,"interface");return i}break}case 123:{if(this.nextTokenIsStringLiteralOnSameLine()){let i=this.startNode();return this.next(),this.tsParseDeclaration(i,123,!1,r)}else if(this.nextTokenIsIdentifierOnSameLine()){this.raise(N.InlineModuleDeclarationMustUseString,this.state.startLoc);let i=this.startNode();return this.next(),this.tsParseDeclaration(i,124,!1,r)}break}case 124:{if(this.nextTokenIsIdentifierOnSameLine()){let i=this.startNode();return this.next(),this.tsParseDeclaration(i,124,!1,r)}break}case 126:{if(this.nextTokenIsIdentifierOnSameLine()){let i=this.startNode();if(!o)this.raise(N.UnexpectedTypeDeclaration,i,"type");return this.next(),this.tsParseTypeAliasDeclaration(i)}break}}return super.parseStatementContent(t,r)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(t,r){return r.some((o)=>{if(aw(o))return t.accessibility===o;return!!t[o]})}tsIsStartOfStaticBlocks(){return this.isContextual(102)&&this.lookaheadCharCode()===123}parseClassMember(t,r,o){let i=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:i,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:N.InvalidModifierOnTypeParameterPositions},r);let s=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(r,i))this.raise(N.StaticBlockCannotHaveModifier,this.state.curPosition());super.parseClassStaticBlock(t,r)}else this.parseClassMemberWithIsStatic(t,r,o,!!r.static)};if(r.declare)this.tsInAmbientContext(s);else s();if(r.decorators&&r.decorators.length>0&&!this.hasPlugin("decorators-legacy")){if(r.type==="TSAbstractMethodDefinition"||r.type==="TSDeclareMethod")this.raise(N.DecoratorAbstractMethod,r,{kind:"abstract method"});else if(r.type==="ClassProperty"&&r.abstract||r.type==="ClassProperty"&&r.declare||r.type==="TSAbstractPropertyDefinition"||r.type==="PropertyDefinition"&&r.declare)this.raise(N.DecoratorAbstractMethod,r,{kind:r.declare?"declare field":"abstract field"})}}parseClassMemberWithIsStatic(t,r,o,i){let s=this.tsTryParseIndexSignature(r);if(s){if(t.body.push(s),r.abstract)this.raise(N.IndexSignatureHasAbstract,r);if(r.accessibility)this.raise(N.IndexSignatureHasAccessibility,r,{modifier:r.accessibility});if(r.declare)this.raise(N.IndexSignatureHasDeclare,r);if(r.override)this.raise(N.IndexSignatureHasOverride,r);return}if(!this.state.inAbstractClass&&r.abstract)this.raise(N.NonAbstractClassHasAbstractMethod,r);if(r.override){if(!o.hadSuperClass)this.raise(N.OverrideNotInSubClass,r)}super.parseClassMemberWithIsStatic(t,r,o,i)}parsePostMemberNameModifiers(t){if(this.eat(13))t.optional=!0;if(t.readonly&&this.match(6))this.raise(N.ClassMethodHasReadonly,t);if(t.declare&&this.match(6))this.raise(N.ClassMethodHasDeclare,t)}shouldParseExportDeclaration(){if(this.tsIsDeclarationStart())return!0;return super.shouldParseExportDeclaration()}parseConditional(t,r,o){if(!this.match(13))return t;if(o!=null){let a=this.lookaheadCharCode();if(a===44||a===61||a===58||a===41)return this.setOptionalParametersError(o),t}this.next();let i=this.startNodeAt(r);i.test=t;let s=this.state.inConditionalConsequent;return this.state.inConditionalConsequent=!0,i.consequent=this.parseMaybeAssignAllowIn(),this.state.inConditionalConsequent=s,this.expect(10),i.alternate=this.parseMaybeAssign(),this.finishNode(i,"ConditionalExpression")}parseParenItem(t,r){let o=super.parseParenItem(t,r);if(this.eat(13))o.optional=!0,this.resetEndLocation(t);if(this.match(10)){let i=this.startNodeAt(r);return i.expression=t,i.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(i,"TSTypeCastExpression")}return t}parseExportDeclaration(t){if(!this.state.isAmbientContext&&this.isContextual(121))return this.tsInAmbientContext(()=>this.parseExportDeclaration(t));let r=this.state.startLoc,o=this.eatContextual(121);if(o&&(this.isContextual(121)||!this.shouldParseExportDeclaration()))throw this.raise(N.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let s=_e(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(t);if(!s)return null;if(s.type==="TSInterfaceDeclaration"||s.type==="TSTypeAliasDeclaration"||o)t.exportKind="type";if(o&&s.type!=="TSImportEqualsDeclaration")this.resetStartLocation(s,r),s.declare=!0;return s}parseClassId(t,r,o,i){if((!r||o)&&this.isContextual(109)){t.id=null;return}super.parseClassId(t,r,o,t.declare?1024:8331);let s=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);if(s)t.typeParameters=s}parseClassPropertyAnnotation(t){if(!t.optional){if(this.eat(31))t.definite=!0;else if(this.eat(13))t.optional=!0}let r=this.tsTryParseTypeAnnotation();if(r)t.typeAnnotation=r;if(t.definite){if(this.match(25))this.raise(N.DeclaratorDefiniteAssertionWithInitializer,t);else if(!r)this.raise(N.DeclaratorDefiniteAssertionRequiresTypeAnnotation,t)}}parseClassProperty(t){if(this.parseClassPropertyAnnotation(t),this.state.isAmbientContext&&!(t.readonly&&!t.typeAnnotation)&&this.match(25))this.raise(N.DeclareClassFieldHasInitializer,this.state.startLoc);if(t.abstract&&this.match(25)){let{key:r}=t;this.raise(N.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:r.type==="Identifier"&&!t.computed?r.name:`[${this.input.slice(this.offsetToSourcePos(r.start),this.offsetToSourcePos(r.end))}]`})}return super.parseClassProperty(t)}parseClassPrivateProperty(t){if(t.abstract)this.raise(N.PrivateElementHasAbstract,t);if(t.accessibility)this.raise(N.PrivateElementHasAccessibility,t,{modifier:t.accessibility});return this.parseClassPropertyAnnotation(t),super.parseClassPrivateProperty(t)}parseClassAccessorProperty(t){if(this.parseClassPropertyAnnotation(t),t.optional)this.raise(N.AccessorCannotBeOptional,t);return super.parseClassAccessorProperty(t)}pushClassMethod(t,r,o,i,s,a){let c=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(c&&s)this.raise(N.ConstructorHasTypeParameters,c);let{declare:l=!1,kind:u}=r;if(l&&(u==="get"||u==="set"))this.raise(N.DeclareAccessor,r,{kind:u});if(c)r.typeParameters=c;super.pushClassMethod(t,r,o,i,s,a)}pushClassPrivateMethod(t,r,o,i){let s=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(s)r.typeParameters=s;super.pushClassPrivateMethod(t,r,o,i)}declareClassPrivateMethodInScope(t,r){if(t.type==="TSDeclareMethod")return;if(t.type==="MethodDefinition"&&t.value.body==null)return;super.declareClassPrivateMethodInScope(t,r)}parseClassSuper(t){if(super.parseClassSuper(t),t.superClass){if(t.superClass.type==="TSInstantiationExpression"){let r=t.superClass,o=r.expression;this.takeSurroundingComments(o,o.start,o.end);let i=r.typeArguments;this.takeSurroundingComments(i,i.start,i.end),t.superClass=o,t.superTypeArguments=i}else if(this.match(43)||this.match(47))t.superTypeArguments=this.tsParseTypeArgumentsInExpression()}if(this.eatContextual(109))t.implements=this.tsParseHeritageClause("implements")}parseObjPropValue(t,r,o,i,s,a,c){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(l)t.typeParameters=l;return super.parseObjPropValue(t,r,o,i,s,a,c)}parseFunctionParams(t,r){let o=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(o)t.typeParameters=o;super.parseFunctionParams(t,r)}parseVarId(t,r){if(super.parseVarId(t,r),t.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(31))t.definite=!0;let o=this.tsTryParseTypeAnnotation();if(o)t.id.typeAnnotation=o,this.resetEndLocation(t.id)}parseAsyncArrowFromCallExpression(t,r){if(this.match(10))t.returnType=this.tsParseTypeAnnotation();return super.parseAsyncArrowFromCallExpression(t,r)}parseMaybeAssign(t,r){let o,i,s;if(this.hasPlugin("jsx")&&(this.match(138)||this.match(43))){if(o=this.state.clone(),i=this.tryParse(()=>super.parseMaybeAssign(t,r),o),!i.error)return i.node;let{context:l}=this.state,u=l[l.length-1];if(u===Ce.j_oTag||u===Ce.j_expr)l.pop()}if(!i?.error&&!this.match(43))return super.parseMaybeAssign(t,r);if(!o||o===this.state)o=this.state.clone();let a,c=this.tryParse((l)=>{a=this.tsParseTypeParameters(this.tsParseConstModifier);let u=super.parseMaybeAssign(t,r);if(u.type!=="ArrowFunctionExpression"||u.extra?.parenthesized)l();if(a?.params.length!==0)this.resetStartLocationFromNode(u,a);if(u.typeParameters=a,this.hasPlugin("jsx")&&u.typeParameters.params.length===1&&!u.typeParameters.extra?.trailingComma){let d=u.typeParameters.params[0];if(!d.constraint)this.raise(N.SingleTypeParameterWithoutTrailingComma,this.optionFlags&256?nA(d.loc.end,1):d,{typeParameterName:d.name.name})}return u},o);if(!c.error&&!c.aborted){if(a)this.reportReservedArrowTypeParam(a);return c.node}if(!i){if(sw(!this.hasPlugin("jsx")),s=this.tryParse(()=>super.parseMaybeAssign(t,r),o),!s.error)return s.node}if(i?.node)return this.state=i.failState,i.node;if(c.node){if(this.state=c.failState,a)this.reportReservedArrowTypeParam(a);return c.node}if(s?.node)return this.state=s.failState,s.node;throw i?.error||c.error||s?.error}reportReservedArrowTypeParam(t){if(t.params.length===1&&!t.params[0].constraint&&!t.extra?.trailingComma&&this.getPluginOption("typescript","disallowAmbiguousJSXLike"))this.raise(N.ReservedArrowTypeParam,t)}parseMaybeUnary(t,r){if(!this.hasPlugin("jsx")&&this.match(43))return this.tsParseTypeAssertion();return super.parseMaybeUnary(t,r)}parseArrow(t){if(this.match(10)){let r=this.tryParse((o)=>{let i=this.tsParseTypeOrTypePredicateAnnotation(10);if(this.canInsertSemicolon()||!this.match(15))o();return i});if(r.aborted)return;if(!r.thrown){if(r.error)this.state=r.failState;t.returnType=r.node}}return super.parseArrow(t)}parseFunctionParamType(t){if(this.eat(13))t.optional=!0;let r=this.tsTryParseTypeAnnotation();if(r)t.typeAnnotation=r;return this.resetEndLocation(t),t}isAssignable(t,r){switch(t.type){case"TSTypeCastExpression":return this.isAssignable(t.expression,r);case"TSParameterProperty":return!0;default:return super.isAssignable(t,r)}}toAssignable(t,r=!1){switch(t.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(t,r);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":if(r)this.expressionScope.recordArrowParameterBindingError(N.UnexpectedTypeCastInParameter,t);else this.raise(N.UnexpectedTypeCastInParameter,t);this.toAssignable(t.expression,r);break;case"AssignmentExpression":if(!r&&t.left.type==="TSTypeCastExpression")t.left=this.typeCastToParameter(t.left);default:super.toAssignable(t,r)}}toAssignableParenthesizedExpression(t,r){switch(t.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(t.expression,r);break;default:super.toAssignable(t,r)}}checkToRestConversion(t,r){switch(t.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(t.expression,!1);break;default:super.checkToRestConversion(t,r)}}isValidLVal(t,r,o,i){switch(t){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(i!==64||!o)&&["expression",!0];default:return super.isValidLVal(t,r,o,i)}}parseBindingAtom(){if(this.state.type===74)return this.parseIdentifier(!0);return super.parseBindingAtom()}parseMaybeDecoratorArguments(t,r){if(this.match(43)||this.match(47)){let o=this.tsParseTypeArgumentsInExpression();if(this.match(6)){let i=super.parseMaybeDecoratorArguments(t,r);return i.typeArguments=o,i}this.unexpected(null,6)}return super.parseMaybeDecoratorArguments(t,r)}checkCommaAfterRest(t){if(this.state.isAmbientContext&&this.match(8)&&this.lookaheadCharCode()===t)return this.next(),!1;return super.checkCommaAfterRest(t)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(31)||this.match(10)||super.isClassProperty()}parseMaybeDefault(t,r){let o=super.parseMaybeDefault(t,r);if(o.type==="AssignmentPattern"&&o.typeAnnotation&&o.right.start<o.typeAnnotation.start)this.raise(N.TypeAnnotationAfterAssign,o.typeAnnotation);return o}getTokenFromCode(t){if(this.state.inType){if(t===62){this.finishOp(44,1);return}if(t===60){this.finishOp(43,1);return}}super.getTokenFromCode(t)}reScan_lt_gt(){let{type:t}=this.state;if(t===43)this.state.pos-=1,this.readToken_lt();else if(t===44)this.state.pos-=1,this.readToken_gt()}reScan_lt(){let{type:t}=this.state;if(t===47)return this.state.pos-=2,this.finishOp(43,1),43;return t}toAssignableListItem(t,r,o){let i=t[r];if(i.type==="TSTypeCastExpression")t[r]=this.typeCastToParameter(i);super.toAssignableListItem(t,r,o)}typeCastToParameter(t){return t.expression.typeAnnotation=t.typeAnnotation,this.resetEndLocationFromNode(t.expression,t.typeAnnotation),t.expression}shouldParseArrow(t){if(this.match(10))return t.every((r)=>this.isAssignable(r,!0));return super.shouldParseArrow(t)}shouldParseAsyncArrow(){if(this.match(10)){if(this.state.inConditionalConsequent)return!1;return!0}return super.shouldParseAsyncArrow()}parseParenAndDistinguishExpression(t){let r=this.state.inConditionalConsequent;this.state.inConditionalConsequent=!1;let o=super.parseParenAndDistinguishExpression(t);return this.state.inConditionalConsequent=r,o}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(t){if(this.match(43)||this.match(47)){let r=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());if(r)t.typeArguments=r}return super.jsxParseOpeningElementAfterName(t)}getGetterSetterExpectedParamCount(t){let r=super.getGetterSetterExpectedParamCount(t),i=this.getObjectOrClassMethodParams(t)[0];return i&&this.isThisParam(i)?r+1:r}parseCatchClauseParam(){let t=super.parseCatchClauseParam(),r=this.tsTryParseTypeAnnotation();if(r)t.typeAnnotation=r,this.resetEndLocation(t);return t}tsInAmbientContext(t){let{isAmbientContext:r,strict:o}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return t()}finally{this.state.isAmbientContext=r,this.state.strict=o}}parseClass(t,r,o){let i=this.state.inAbstractClass;this.state.inAbstractClass=!!t.abstract;try{return super.parseClass(t,r,o)}finally{this.state.inAbstractClass=i}}tsParseAbstractDeclaration(t,r){if(this.match(76))return t.abstract=!0,this.maybeTakeDecorators(r,this.parseClass(t,!0,!1));else if(this.isContextual(125))if(!this.hasFollowingLineBreak())return t.abstract=!0,this.raise(N.NonClassMethodPropertyHasAbstractModifier,t),this.tsParseInterfaceDeclaration(t);else return null;throw this.unexpected(null,76)}parseMethod(t,r,o,i,s,a,c){let l=super.parseMethod(t,r,o,i,s,a,c);if(l.abstract||l.type==="TSAbstractMethodDefinition"){if((this.hasPlugin("estree")?l.value:l).body){let{key:p}=l;this.raise(N.AbstractMethodHasImplementation,l,{methodName:p.type==="Identifier"&&!l.computed?p.name:`[${this.input.slice(this.offsetToSourcePos(p.start),this.offsetToSourcePos(p.end))}]`})}}return l}tsParseTypeParameterName(){return this.parseIdentifier()}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){if(this.shouldParseAsAmbientContext())this.state.isAmbientContext=!0;return super.parse()}getExpression(){if(this.shouldParseAsAmbientContext())this.state.isAmbientContext=!0;return super.getExpression()}parseExportSpecifier(t,r,o,i){if(!r&&i)return this.parseTypeOnlyImportExportSpecifier(t,!1,o),this.finishNode(t,"ExportSpecifier");return t.exportKind="value",super.parseExportSpecifier(t,r,o,i)}parseImportSpecifier(t,r,o,i,s){if(!r&&i)return this.parseTypeOnlyImportExportSpecifier(t,!0,o),this.finishNode(t,"ImportSpecifier");return t.importKind="value",super.parseImportSpecifier(t,r,o,i,o?4098:4096)}parseTypeOnlyImportExportSpecifier(t,r,o){let i=r?"imported":"local",s=r?"local":"exported",a=t[i],c,l=!1,u=!0,d=a.start;if(this.isContextual(89)){let m=this.parseIdentifier();if(this.isContextual(89)){let y=this.parseIdentifier();if(Sn(this.state.type))l=!0,a=m,c=r?this.parseIdentifier():this.parseModuleExportName(),u=!1;else c=y,u=!1}else if(Sn(this.state.type))u=!1,c=r?this.parseIdentifier():this.parseModuleExportName();else l=!0,a=m}else if(Sn(this.state.type))if(l=!0,r){if(a=this.parseIdentifier(!0),!this.isContextual(89))this.checkReservedWord(a.name,a.start,!0,!0)}else a=this.parseModuleExportName();if(l&&o)this.raise(r?N.TypeModifierIsUsedInTypeImports:N.TypeModifierIsUsedInTypeExports,d);t[i]=a,t[s]=c;let p=r?"importKind":"exportKind";if(t[p]=l?"type":"value",u&&this.eatContextual(89))t[s]=r?this.parseIdentifier():this.parseModuleExportName();if(!t[s])t[s]=this.cloneIdentifier(t[i]);if(r)this.checkIdentifier(t[s],l?4098:4096)}fillOptionalPropertiesForTSESLint(t){switch(t.type){case"ExpressionStatement":t.directive??=void 0;return;case"RestElement":t.value=void 0;case"Identifier":case"ArrayPattern":case"AssignmentPattern":case"ObjectPattern":t.decorators??=[],t.optional??=!1,t.typeAnnotation??=void 0;return;case"TSParameterProperty":t.accessibility??=void 0,t.decorators??=[],t.override??=!1,t.readonly??=!1,t.static??=!1;return;case"TSEmptyBodyFunctionExpression":t.body=null;case"TSDeclareFunction":case"FunctionDeclaration":case"FunctionExpression":case"ClassMethod":case"ClassPrivateMethod":t.declare??=!1,t.returnType??=void 0,t.typeParameters??=void 0;return;case"Property":t.optional??=!1;return;case"TSMethodSignature":case"TSPropertySignature":t.optional??=!1;case"TSIndexSignature":t.accessibility??=void 0,t.readonly??=!1,t.static??=!1;return;case"TSAbstractPropertyDefinition":case"PropertyDefinition":case"TSAbstractAccessorProperty":case"AccessorProperty":t.declare??=!1,t.definite??=!1,t.readonly??=!1,t.typeAnnotation??=void 0;case"TSAbstractMethodDefinition":case"MethodDefinition":t.accessibility??=void 0,t.decorators??=[],t.override??=!1,t.optional??=!1;return;case"ClassExpression":t.id??=null;case"ClassDeclaration":t.abstract??=!1,t.declare??=!1,t.decorators??=[],t.implements??=[],t.superTypeArguments??=void 0,t.typeParameters??=void 0;return;case"TSTypeAliasDeclaration":case"VariableDeclaration":t.declare??=!1;return;case"VariableDeclarator":t.definite??=!1;return;case"TSEnumDeclaration":t.const??=!1,t.declare??=!1;return;case"TSEnumMember":t.computed??=!1;return;case"TSImportType":t.qualifier??=null,t.options??=null,t.typeArguments??=null;return;case"TSInterfaceDeclaration":t.declare??=!1,t.extends??=[];return;case"TSMappedType":t.optional??=!1,t.readonly??=void 0;return;case"TSModuleDeclaration":t.declare??=!1,t.global??=t.kind==="global";return;case"TSTypeParameter":t.const??=!1,t.in??=!1,t.out??=!1;return}}chStartsBindingIdentifierAndNotRelationalOperator(t,r){if(vd(t)){if(dd.lastIndex=r,dd.test(this.input)){let o=this.codePointAtPos(dd.lastIndex);if(!hw(o)&&o!==92)return!1}return!0}else if(t===92)return!0;else return!1}nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine(){let t=this.nextTokenInLineStart(),r=this.codePointAtPos(t);return this.chStartsBindingIdentifierAndNotRelationalOperator(r,t)}nextTokenIsStringLiteralOnSameLine(){let t=this.nextTokenInLineStart(),r=this.codePointAtPos(t);return r===34||r===39}},VA,cw,BA=(e)=>class extends e{parsePlaceholder(t){if(this.match(129)){let r=this.startNode();return this.next(),this.assertNoSpace(),r.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(129),this.finishPlaceholder(r,t)}}finishPlaceholder(t,r){let o=t;if(!o.expectedNode||!o.type)o=this.finishNode(o,"Placeholder");return o.expectedNode=r,o}getTokenFromCode(t){if(t===37&&this.input.charCodeAt(this.state.pos+1)===37)this.finishOp(129,2);else super.getTokenFromCode(t)}parseExprAtom(t){return this.parsePlaceholder("Expression")||super.parseExprAtom(t)}parseIdentifier(t){return this.parsePlaceholder("Identifier")||super.parseIdentifier(t)}checkReservedWord(t,r,o,i){if(t!==void 0)super.checkReservedWord(t,r,o,i)}cloneIdentifier(t){let r=super.cloneIdentifier(t);if(r.type==="Placeholder")r.expectedNode=t.expectedNode;return r}cloneStringLiteral(t){if(t.type==="Placeholder")return this.cloneIdentifier(t);return super.cloneStringLiteral(t)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(t,r,o,i){return t==="Placeholder"||super.isValidLVal(t,r,o,i)}toAssignable(t,r){if(t&&t.type==="Placeholder"&&t.expectedNode==="Expression")t.expectedNode="Pattern";else super.toAssignable(t,r)}chStartsBindingIdentifier(t,r){if(super.chStartsBindingIdentifier(t,r))return!0;let o=this.nextTokenStart();if(this.input.charCodeAt(o)===37&&this.input.charCodeAt(o+1)===37)return!0;return!1}verifyBreakContinue(t,r){if(t.label?.type==="Placeholder")return;super.verifyBreakContinue(t,r)}parseExpressionStatement(t,r){if(r.type!=="Placeholder"||r.extra?.parenthesized)return super.parseExpressionStatement(t,r);if(this.match(10)){let i=t;return i.label=this.finishPlaceholder(r,"Identifier"),this.next(),i.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(i,"LabeledStatement")}this.semicolon();let o=t;return o.name=r.name,this.finishPlaceholder(o,"Statement")}parseBlock(t,r,o){return this.parsePlaceholder("BlockStatement")||super.parseBlock(t,r,o)}parseFunctionId(t){return this.parsePlaceholder("Identifier")||super.parseFunctionId(t)}parseClass(t,r,o){let i=r?"ClassDeclaration":"ClassExpression";this.next();let s=this.state.strict,a=this.parsePlaceholder("Identifier");if(a)if(this.match(77)||this.match(129)||this.match(2))t.id=a;else if(o||!r)return t.id=null,t.body=this.finishPlaceholder(a,"ClassBody"),this.finishNode(t,i);else throw this.raise(cw.ClassNameIsRequired,this.state.startLoc);else this.parseClassId(t,r,o);return super.parseClassSuper(t),t.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!t.superClass,s),this.finishNode(t,i)}parseExport(t,r){let o=this.parsePlaceholder("Identifier");if(!o)return super.parseExport(t,r);let i=t;if(!this.isContextual(94)&&!this.match(8))return i.specifiers=[],i.source=null,i.declaration=this.finishPlaceholder(o,"Declaration"),this.finishNode(i,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let s=this.startNode();return s.exported=o,i.specifiers=[this.finishNode(s,"ExportDefaultSpecifier")],super.parseExport(i,r)}isExportDefaultSpecifier(){if(this.match(61)){let t=this.nextTokenStart();if(this.isUnparsedContextual(t,"from")){if(this.input.startsWith(wd(129),this.nextTokenStartSince(t+4)))return!0}}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(t,r){if(t.specifiers?.length)return!0;return super.maybeParseExportDefaultSpecifier(t,r)}checkExport(t){let{specifiers:r}=t;if(r?.length)t.specifiers=r.filter((o)=>o.exported.type==="Placeholder");super.checkExport(t),t.specifiers=r}parseImport(t){let r=this.parsePlaceholder("Identifier");if(!r)return super.parseImport(t);if(t.specifiers=[],!this.isContextual(94)&&!this.match(8))return t.source=this.finishPlaceholder(r,"StringLiteral"),this.semicolon(),this.finishNode(t,"ImportDeclaration");let o=this.startNodeAtNode(r);if(o.local=r,t.specifiers.push(this.finishNode(o,"ImportDefaultSpecifier")),this.eat(8)){if(!this.maybeParseStarImportSpecifier(t))this.parseNamedImportSpecifiers(t)}return this.expectContextual(94),t.source=this.parseImportSource(),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){if(this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index))this.raise(cw.UnexpectedSpace,this.state.lastTokEndLoc)}},UA=(e)=>class extends e{parseV8Intrinsic(){if(this.match(50)){let t=this.state.startLoc,r=this.startNode();if(this.next(),_e(this.state.type)){let o=this.parseIdentifierName(),i=this.createIdentifier(r,o);if(this.castNodeTo(i,"V8IntrinsicIdentifier"),this.match(6))return i}this.unexpected(t)}}parseExprAtom(t){return this.parseV8Intrinsic()||super.parseExprAtom(t)}},JA,iM,sM;var kw=vv(()=>{rA={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Xx},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Xx}},Yx={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},oA={AccessorIsGenerator:({kind:e})=>`A ${e}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:e})=>`Missing initializer in ${e} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:e})=>`\`${e}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:e,exportName:n})=>`A string literal cannot be used as an exported binding without \`from\`.
5
5
  - Did you mean \`export { '${e}' as '${n}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:e})=>`'${e==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:e})=>`Unsyntactic ${e==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportBindingIsString:({importName:e})=>`A string literal cannot be used as an imported binding.
6
- - Did you mean \`import { "${e}" as foo }\`?`,ImportCallArity:({phase:e})=>`\`import${e?`.${e}`:""}()\` requires exactly one or two arguments.`,ImportCallNotNewExpression:({phase:e})=>`Cannot use new with import${e?`.${e}`:""}().`,ImportCallSpreadArgument:({phase:e})=>`\`...\` is not allowed in \`import${e?`.${e}`:""}()\`.`,IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverDiscardElement:"'void' must be followed by an expression when not used in a binding position.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDigit:({radix:e})=>`Expected number in radix ${e}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:e})=>`Escape sequence in keyword ${e}.`,InvalidIdentifier:({identifierName:e})=>`Invalid identifier ${e}.`,InvalidLhs:({ancestor:e})=>`Invalid left-hand side in ${_s(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${_s(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${_s(e)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:e})=>`Unexpected character '${e}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:e})=>`Private name #${e} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:e})=>`Label '${e}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:e})=>`This experimental syntax requires enabling the parser plugin: ${e.map((n)=>JSON.stringify(n)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:e})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${e.map((n)=>JSON.stringify(n)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:e})=>`Duplicate key "${e}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:e})=>`An export name cannot include a lone surrogate, found '\\u${e.toString(16)}'.`,ModuleExportUndefined:({localName:e})=>`Export '${e}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:e})=>`Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,PrivateNameRedeclaration:({identifierName:e})=>`Duplicate private name #${e}.`,RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperCallNotNewExpression:"Cannot use new with super(...).",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:e})=>`Unexpected keyword '${e}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:e})=>`Unexpected reserved word '${e}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:e,unexpected:n})=>`Unexpected token${n?` '${n}'.`:""}${e?`, expected "${e}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:"Unexpected void binding.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:e,onlyValidPropertyName:n})=>`The only valid meta property for ${e} is ${e}.${n}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:e})=>`Identifier '${e}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:"A void binding may not have an initializer.",YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},iA={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:e})=>`Assigning to '${e}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:e})=>`Binding '${e}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},sA={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:e})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(e)}\`.`},aA={PipeTopicRequiresHackPipes:'Topic references are only supported when using the `"proposal": "hack"` version of the pipeline proposal.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:e})=>`Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:e})=>`Hack-style pipe body cannot be an unparenthesized ${_s({type:e})}; please wrap it in parentheses.`,PipelineUnparenthesized:"Cannot mix binary operator with solo-await F#-style pipeline. Please wrap the pipeline in parentheses."},cA={UnsupportedBind:"Binding should be performed on object property.",UnsupportedBindRHS:"The right-hand side of binding can not be super or import."};He={...kt(rA),...kt(oA),...kt(iA),...kt(sA),...kt`pipelineOperator`(aA),...kt`functionBind`(cA)};uw=new Map;md=[],yd=[],gd=[],bd=[],xd=[],dw=[];pA={bracketL:B("[",{beforeExpr:ie,startsExpr:_}),bracketR:B("]"),braceL:B("{",{beforeExpr:ie,startsExpr:_}),braceBarL:B("{|",{beforeExpr:ie,startsExpr:_}),braceR:B("}"),braceBarR:B("|}"),parenL:B("(",{beforeExpr:ie,startsExpr:_}),parenR:B(")"),comma:B(",",{beforeExpr:ie}),semi:B(";",{beforeExpr:ie}),colon:B(":",{beforeExpr:ie}),doubleColon:B("::",{beforeExpr:ie}),dot:B("."),question:B("?",{beforeExpr:ie}),questionDot:B("?."),arrow:B("=>",{beforeExpr:ie}),template:B("template"),ellipsis:B("...",{beforeExpr:ie}),backQuote:B("`",{startsExpr:_}),dollarBraceL:B("${",{beforeExpr:ie,startsExpr:_}),templateTail:B("...`",{startsExpr:_}),templateNonTail:B("...${",{beforeExpr:ie,startsExpr:_}),at:B("@"),hash:B("#",{startsExpr:_}),interpreterDirective:B("#!..."),eq:B("=",{beforeExpr:ie,isAssign:Eo}),assign:B("_=",{beforeExpr:ie,isAssign:Eo}),slashAssign:B("_=",{beforeExpr:ie,isAssign:Eo}),xorAssign:B("_=",{beforeExpr:ie,isAssign:Eo}),moduloAssign:B("_=",{beforeExpr:ie,isAssign:Eo}),incDec:B("++/--",{prefix:rn,postfix:dA,startsExpr:_}),bang:B("!",{beforeExpr:ie,prefix:rn,startsExpr:_}),tilde:B("~",{beforeExpr:ie,prefix:rn,startsExpr:_}),doubleCaret:B("^^",{startsExpr:_}),doubleAt:B("@@",{startsExpr:_}),pipeline:We("|>",0),nullishCoalescing:We("??",1),logicalOR:We("||",1),logicalAND:We("&&",2),bitwiseOR:We("|",3),bitwiseXOR:We("^",4),bitwiseAND:We("&",5),equality:We("==/!=/===/!==",6),lt:We("</>/<=/>=",7),gt:We("</>/<=/>=",7),relational:We("</>/<=/>=",7),bitShift:We("<</>>/>>>",8),bitShiftL:We("<</>>/>>>",8),bitShiftR:We("<</>>/>>>",8),plusMin:B("+/-",{beforeExpr:ie,binop:9,prefix:rn,startsExpr:_}),modulo:B("%",{binop:10,startsExpr:_}),star:B("*",{binop:10}),slash:We("/",10),exponent:B("**",{beforeExpr:ie,binop:11,rightAssociative:!0}),_in:se("in",{beforeExpr:ie,binop:7}),_instanceof:se("instanceof",{beforeExpr:ie,binop:7}),_break:se("break"),_case:se("case",{beforeExpr:ie}),_catch:se("catch"),_continue:se("continue"),_debugger:se("debugger"),_default:se("default",{beforeExpr:ie}),_else:se("else",{beforeExpr:ie}),_finally:se("finally"),_function:se("function",{startsExpr:_}),_if:se("if"),_return:se("return",{beforeExpr:ie}),_switch:se("switch"),_throw:se("throw",{beforeExpr:ie,prefix:rn,startsExpr:_}),_try:se("try"),_var:se("var"),_const:se("const"),_with:se("with"),_new:se("new",{beforeExpr:ie,startsExpr:_}),_this:se("this",{startsExpr:_}),_super:se("super",{startsExpr:_}),_class:se("class",{startsExpr:_}),_extends:se("extends",{beforeExpr:ie}),_export:se("export"),_import:se("import",{startsExpr:_}),_null:se("null",{startsExpr:_}),_true:se("true",{startsExpr:_}),_false:se("false",{startsExpr:_}),_typeof:se("typeof",{beforeExpr:ie,prefix:rn,startsExpr:_}),_void:se("void",{beforeExpr:ie,prefix:rn,startsExpr:_}),_delete:se("delete",{beforeExpr:ie,prefix:rn,startsExpr:_}),_do:se("do",{isLoop:ud,beforeExpr:ie}),_for:se("for",{isLoop:ud}),_while:se("while",{isLoop:ud}),_as:ne("as",{startsExpr:_}),_assert:ne("assert",{startsExpr:_}),_async:ne("async",{startsExpr:_}),_await:ne("await",{startsExpr:_}),_defer:ne("defer",{startsExpr:_}),_from:ne("from",{startsExpr:_}),_get:ne("get",{startsExpr:_}),_let:ne("let",{startsExpr:_}),_meta:ne("meta",{startsExpr:_}),_of:ne("of",{startsExpr:_}),_sent:ne("sent",{startsExpr:_}),_set:ne("set",{startsExpr:_}),_source:ne("source",{startsExpr:_}),_static:ne("static",{startsExpr:_}),_using:ne("using",{startsExpr:_}),_yield:ne("yield",{startsExpr:_}),_asserts:ne("asserts",{startsExpr:_}),_checks:ne("checks",{startsExpr:_}),_exports:ne("exports",{startsExpr:_}),_global:ne("global",{startsExpr:_}),_implements:ne("implements",{startsExpr:_}),_intrinsic:ne("intrinsic",{startsExpr:_}),_infer:ne("infer",{startsExpr:_}),_is:ne("is",{startsExpr:_}),_mixins:ne("mixins",{startsExpr:_}),_proto:ne("proto",{startsExpr:_}),_require:ne("require",{startsExpr:_}),_satisfies:ne("satisfies",{startsExpr:_}),_keyof:ne("keyof",{startsExpr:_}),_readonly:ne("readonly",{startsExpr:_}),_unique:ne("unique",{startsExpr:_}),_abstract:ne("abstract",{startsExpr:_}),_declare:ne("declare",{startsExpr:_}),_enum:ne("enum",{startsExpr:_}),_module:ne("module",{startsExpr:_}),_namespace:ne("namespace",{startsExpr:_}),_interface:ne("interface",{startsExpr:_}),_type:ne("type",{startsExpr:_}),_opaque:ne("opaque",{startsExpr:_}),name:B("name",{startsExpr:_}),placeholder:B("%%",{startsExpr:_}),string:B("string",{startsExpr:_}),num:B("num",{startsExpr:_}),bigint:B("bigint",{startsExpr:_}),regexp:B("regexp",{startsExpr:_}),privateName:B("#name",{startsExpr:_}),eof:B("eof"),jsxName:B("jsxName"),jsxText:B("jsxText",{beforeExpr:ie}),jsxTagStart:B("jsxTagStart",{startsExpr:_}),jsxTagEnd:B("jsxTagEnd")};Ce={brace:new Ao("{"),j_oTag:new Ao("<tag"),j_cTag:new Ao("</tag"),j_expr:new Ao("<tag>...</tag>",!0)},nw=/[\p{ID_Start}\u088f\u0c5c\u0cdc\ua7ce\ua7cf\ua7d2\ua7d4\ua7f1]/u,rw=/[\p{ID_Continue}\u088f\u0c5c\u0cdc\ua7ce\ua7cf\ua7d2\ua7d4\ua7f1\u1acf-\u1add\u1ae0-\u1aeb]/u,fw=[2368,25,1388,2,3817,43,20677,24,3,24,287,4,6146,7,1290,21,98,114,22734,30,2,2,2,1,2,6,3,4,10,1,53307,5,5987,11,21763,4297],vA=[3834,1,3173,7,633,9,51450,0,3,0,8,1,6,0];kd={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},eM=new Set(kd.keyword),tM=new Set(kd.strict),nM=new Set(kd.strictBind);mw=class mw extends $s{declareFunctions=new Set};yw=class yw extends Sd{createScope(e){return new mw(e)}declareName(e,n,t){let r=this.currentScope();if(n&2048){this.checkRedeclarationInScope(r,e,n,t),this.maybeExportDefined(r,e),r.declareFunctions.add(e);return}super.declareName(e,n,t)}isRedeclaredInScope(e,n,t){if(super.isRedeclaredInScope(e,n,t))return!0;if(t&2048&&!e.declareFunctions.has(n)){let r=e.names.get(n);return(r&4)>0||(r&2)>0}return!1}checkLocalExport(e){if(!this.scopeStack[0].declareFunctions.has(e.name))super.checkLocalExport(e)}};SA=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),IA={AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:e})=>`Cannot overwrite reserved type ${e}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:e,enumName:n})=>`Boolean enum members need to be initialized. Use either \`${e} = true,\` or \`${e} = false,\` in enum \`${n}\`.`,EnumDuplicateMemberName:({memberName:e,enumName:n})=>`Enum member names need to be unique, but the name \`${e}\` has already been used before in enum \`${n}\`.`,EnumInconsistentMemberValues:({enumName:e})=>`Enum \`${e}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:e,enumName:n})=>`Enum type \`${e}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${n}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:e})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:e,memberName:n,explicitType:t})=>`Enum \`${e}\` has type \`${t}\`, so the initializer of \`${n}\` needs to be a ${t} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:e,memberName:n})=>`Symbol enum members cannot be initialized. Use \`${n},\` in enum \`${e}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:e,memberName:n})=>`The enum member initializer for \`${n}\` needs to be a literal (either a boolean, number, or string) in enum \`${e}\`.`,EnumInvalidMemberName:({enumName:e,memberName:n,suggestion:t})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${n}\`, consider using \`${t}\`, in enum \`${e}\`.`,EnumNumberMemberNotInitialized:({enumName:e,memberName:n})=>`Number enum members need to be initialized, e.g. \`${n} = 1\` in enum \`${e}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:e})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${e}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:{message:"A binding pattern parameter cannot be optional in an implementation signature."},SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:e})=>`Unexpected reserved type ${e}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:e,suggestion:n})=>`\`declare export ${e}\` is not supported. Use \`${n}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."},V=kt`flow`(IA);PA={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};AA=/\*?\s*@((?:no)?flow)\b/,OA={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},NA=/\r\n|[\r\n\u2028\u2029]/,rM=new RegExp(NA.source,"g");jA={AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:e})=>`Expected corresponding JSX closing tag for <${e}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:e,HTMLEntity:n})=>`Unexpected token \`${e}\`. Did you mean \`${n}\` or \`{'${e}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"},Lt=kt`jsx`(jA);gw=class gw extends $s{tsNames=new Map};bw=class bw extends Sd{get inTSNamespace(){let e=this.scopeStack;return e.length>=2&&e[e.length-1].flags===0&&(e[e.length-2].flags&2048)>0}importsStack=[];createScope(e){return this.importsStack.push(new Set),new gw(e)}enter(e){if(e&3072)this.importsStack.push(new Set);super.enter(e)}exit(){let e=super.exit();if(e&3072)this.importsStack.pop();return e}hasImport(e,n){let t=this.importsStack.length;if(this.importsStack[t-1].has(e))return!0;if(!n&&t>1){for(let r=0;r<t-1;r++)if(this.importsStack[r].has(e))return!0}return!1}declareName(e,n,t){if(n&4096){if(this.hasImport(e,!0))this.parser.raise(He.VarRedeclaration,t,{identifierName:e});this.importsStack[this.importsStack.length-1].add(e);return}let r=this.currentScope(),o=r.tsNames.get(e)||0;if(n&1024){this.maybeExportDefined(r,e),r.tsNames.set(e,o|16);return}if(super.declareName(e,n,t),n&2){if(!(n&1))this.checkRedeclarationInScope(r,e,n,t),this.maybeExportDefined(r,e);o=o|1}if(n&256)o=o|2;if(n&512)o=o|4;if(n&128)o=o|8;if(o)r.tsNames.set(e,o)}isRedeclaredInScope(e,n,t){let r=e.tsNames.get(n);if((r&2)>0){if(t&256){let o=(t&512)>0,i=(r&4)>0;return o!==i}return!0}if(t&128&&(r&8)>0)if(e.names.get(n)&2)return!!(t&1);else return!1;if(t&2&&(r&1)>0)return!0;return super.isRedeclaredInScope(e,n,t)}checkLocalExport(e){let{name:n}=e;if(this.hasImport(n))return;let t=this.scopeStack.length;for(let r=t-1;r>=0;r--){let i=this.scopeStack[r].tsNames.get(n);if((i&1)>0||(i&16)>0)return}super.checkLocalExport(e)}};oM=xw.prototype,dd=/in(?:stanceof)?|as|satisfies/y;$A={AbstractMethodHasImplementation:({methodName:e})=>`Method '${e}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:e})=>`Property '${e}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclaratorDefiniteAssertionRequiresTypeAnnotation:"Declarations with definite assignment assertions must also have type annotations.",DeclaratorDefiniteAssertionWithInitializer:"Declarations with initializers cannot also have definite assignment assertions.",DeclareAccessor:({kind:e})=>`'declare' is not allowed in ${e}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DecoratorAbstractMethod:({kind:e})=>`Decorators can't be used with ${e.startsWith("a")?"an":"a"} ${e}.`,DuplicateAccessibilityModifier:({modifier:e})=>`Accessibility modifier already seen: '${e}'.`,DuplicateModifier:({modifier:e})=>`Duplicate modifier: '${e}'.`,EmptyHeritageClauseType:({token:e})=>`'${e}' list cannot be empty.`,EmptyNamespaceName:"Namespace must be given a name.",EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ExportAssignmentInTSNamespace:"An export assignment cannot be used in a namespace.",ExportInTSNamespace:"Export declarations are not permitted in a namespace.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportInTSNamespace:"Import declarations in a namespace cannot reference a module.",IncompatibleModifiers:({modifiers:e})=>`'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:e})=>`Index signatures cannot have an accessibility modifier ('${e}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InlineModuleDeclarationMustUseString:"`module ... {}` declarations must have a string name. Use `namespace ... {}` instead.",InvalidHeritageClauseType:({token:e})=>`'${e}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:(e)=>`'${e}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:e})=>`'${e}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:e})=>`'${e}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:e})=>`'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:(e)=>`'${e}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:e})=>`'${e[0]}' modifier must precede '${e[1]}' modifier.`,InvalidNamespaceName:(e)=>`Namespace name cannot be '${e}'.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NamespaceExportInTSNamespace:"Global module exports may only appear at top level.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifier:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:e})=>`Private elements cannot have an accessibility modifier ('${e}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:e})=>`Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterInitializer:"A parameter initializer is only allowed in a function or constructor implementation.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnexpectedTypeDeclaration:(e)=>`'${e}' declarations can only be declared inside a block.`,UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:e})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,UsingDeclarationInAmbientContext:(e)=>`'${e}' declarations are not allowed in ambient contexts.`},N=kt`typescript`($A);VA={ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."},cw=kt`placeholders`(VA),JA={estree:uA,jsx:RA,flow:TA,typescript:MA,v8intrinsic:UA,placeholders:BA},iM=Object.keys(JA);sM=ZA(pA)});var Vt={};Mo(Vt,{anyString:()=>za,base64:()=>Oa,base64url:()=>Na,bigint:()=>qa,boolean:()=>Va,browserEmail:()=>tk,cidrv4:()=>Aa,cidrv6:()=>Ta,creditCard:()=>ti,cuid:()=>ha,cuid2:()=>ma,currencyCode:()=>$a,date:()=>Da,datetime:()=>Ma,domain:()=>Ra,duration:()=>va,e164:()=>_a,email:()=>Sa,emoji:()=>Ia,extendedDuration:()=>Wv,guid:()=>ka,hex:()=>Ka,hostname:()=>ja,html5Email:()=>Xv,httpProtocol:()=>Pr,iban:()=>ni,idnEmail:()=>ek,integer:()=>Er,ipv4:()=>Ca,ipv6:()=>Pa,ksuid:()=>ba,lowercase:()=>Ja,mac:()=>Ea,md5_base64:()=>ik,md5_base64url:()=>sk,md5_hex:()=>ok,nanoid:()=>xa,nanoidOfLength:()=>wa,null:()=>Ba,number:()=>fn,rfc5322Email:()=>Yv,sha1_base64:()=>ck,sha1_base64url:()=>lk,sha1_hex:()=>ak,sha256_base64:()=>dk,sha256_base64url:()=>pk,sha256_hex:()=>uk,sha384_base64:()=>hk,sha384_base64url:()=>mk,sha384_hex:()=>fk,sha512_base64:()=>gk,sha512_base64url:()=>bk,sha512_hex:()=>yk,string:()=>Fa,time:()=>La,ulid:()=>ya,undefined:()=>Ua,unicodeEmail:()=>jp,uppercase:()=>Za,uuid:()=>pn,uuid4:()=>Hv,uuid6:()=>Gv,uuid7:()=>Qv,xid:()=>ga});var Wl={};Mo(Wl,{ZodAny:()=>ly,ZodArray:()=>hy,ZodBase64:()=>Dl,ZodBase64URL:()=>Ll,ZodBigInt:()=>Vl,ZodBigIntFormat:()=>Bl,ZodBoolean:()=>ql,ZodCIDRv4:()=>_l,ZodCIDRv6:()=>$l,ZodCUID:()=>El,ZodCUID2:()=>Al,ZodCatch:()=>_y,ZodCodec:()=>Ki,ZodCreditCard:()=>ry,ZodCustom:()=>Wi,ZodCustomStringFormat:()=>Fn,ZodDate:()=>fy,ZodDefault:()=>Ay,ZodDiscriminatedUnion:()=>yy,ZodE164:()=>Ml,ZodEmail:()=>Sl,ZodEmoji:()=>Cl,ZodEnum:()=>Ur,ZodExactOptional:()=>Jl,ZodFile:()=>Iy,ZodFunction:()=>By,ZodGUID:()=>Il,ZodIBAN:()=>oy,ZodIPv4:()=>jl,ZodIPv6:()=>Rl,ZodISODate:()=>Ln,ZodISODateTime:()=>Dn,ZodISODuration:()=>zn,ZodISOTime:()=>Mn,ZodInstanceOf:()=>Zy,ZodIntersection:()=>gy,ZodJWT:()=>zl,ZodKSUID:()=>Nl,ZodLazy:()=>qy,ZodLiteral:()=>Sy,ZodMAC:()=>ny,ZodMap:()=>vy,ZodNaN:()=>Dy,ZodNanoID:()=>Pl,ZodNever:()=>dy,ZodNonOptional:()=>Zl,ZodNull:()=>ay,ZodNullable:()=>Ey,ZodNumber:()=>Fl,ZodNumberFormat:()=>qn,ZodObject:()=>Bi,ZodOptional:()=>Ji,ZodPipe:()=>Zi,ZodPrefault:()=>Oy,ZodPreprocess:()=>Ly,ZodPromise:()=>Vy,ZodReadonly:()=>My,ZodRecord:()=>Br,ZodSet:()=>ky,ZodString:()=>kl,ZodStringFormat:()=>be,ZodSuccess:()=>Ry,ZodSymbol:()=>iy,ZodTemplateLiteral:()=>Fy,ZodTransform:()=>Cy,ZodTuple:()=>xy,ZodType:()=>Q,ZodULID:()=>Tl,ZodURL:()=>Vi,ZodUUID:()=>_t,ZodUndefined:()=>sy,ZodUnion:()=>Ui,ZodUnknown:()=>uy,ZodVoid:()=>py,ZodXID:()=>Ol,ZodXor:()=>my,_ZodString:()=>vl,_default:()=>Ty,_function:()=>dI,any:()=>ZS,array:()=>A,base64:()=>PS,base64url:()=>ES,bigint:()=>qS,boolean:()=>me,catch:()=>$y,check:()=>pI,cidrv4:()=>IS,cidrv6:()=>CS,codec:()=>aI,creditCard:()=>TS,cuid:()=>yS,cuid2:()=>gS,currencyCode:()=>$S,custom:()=>fI,date:()=>WS,describe:()=>hI,discriminatedUnion:()=>gt,e164:()=>AS,email:()=>sS,emoji:()=>hS,enum:()=>U,exactOptional:()=>Py,file:()=>rI,float32:()=>LS,float64:()=>MS,function:()=>dI,guid:()=>aS,hash:()=>DS,hex:()=>_S,hostname:()=>RS,httpUrl:()=>fS,iban:()=>OS,instanceof:()=>yI,int:()=>Ne,int32:()=>zS,int64:()=>VS,intersection:()=>by,invertCodec:()=>cI,ipv4:()=>vS,ipv6:()=>SS,json:()=>De,jwt:()=>NS,keyof:()=>HS,ksuid:()=>wS,lazy:()=>Kl,literal:()=>b,looseObject:()=>GS,looseRecord:()=>YS,mac:()=>kS,map:()=>eI,meta:()=>mI,nan:()=>sI,nanoid:()=>mS,nativeEnum:()=>nI,never:()=>yt,nonoptional:()=>jy,null:()=>cy,nullable:()=>qi,nullish:()=>oI,number:()=>M,object:()=>E,optional:()=>Fi,partialRecord:()=>XS,pipe:()=>wl,prefault:()=>Ny,preprocess:()=>Ky,promise:()=>uI,readonly:()=>zy,record:()=>re,refine:()=>Uy,set:()=>tI,strictObject:()=>w,string:()=>k,stringFormat:()=>jS,stringbool:()=>gI,success:()=>iI,superRefine:()=>Jy,symbol:()=>US,templateLiteral:()=>lI,transform:()=>Ul,tuple:()=>wy,uint32:()=>FS,uint64:()=>BS,ulid:()=>bS,undefined:()=>JS,union:()=>te,unknown:()=>mt,url:()=>pS,uuid:()=>cS,uuidv4:()=>lS,uuidv6:()=>uS,uuidv7:()=>dS,void:()=>KS,xid:()=>xS,xor:()=>QS});var Mi={};Mo(Mi,{endsWith:()=>Ai,gt:()=>Ut,gte:()=>ht,includes:()=>Pi,length:()=>$r,lowercase:()=>Ii,lt:()=>Bt,lte:()=>ft,maxLength:()=>_r,maxSize:()=>Nn,mime:()=>Oi,minLength:()=>hn,minSize:()=>Jt,multipleOf:()=>On,negative:()=>fm,nonnegative:()=>mm,nonpositive:()=>hm,normalize:()=>Ni,overwrite:()=>Rt,positive:()=>pm,properties:()=>Ti,property:()=>ym,regex:()=>Si,size:()=>Rr,slugify:()=>$i,startsWith:()=>Ei,toLowerCase:()=>Ri,toUpperCase:()=>_i,trim:()=>ji,uppercase:()=>Ci});var Jr={};Mo(Jr,{ZodISODate:()=>Ln,ZodISODateTime:()=>Dn,ZodISODuration:()=>zn,ZodISOTime:()=>Mn,date:()=>xI,datetime:()=>bI,duration:()=>vI,time:()=>wI});var Kd="0.1.0-beta.88";var Qs=["en","zh-CN","zh-TW","ja","ko","ru","fr"],Wd="en";var Gs=new Map(Qs.map((e)=>[e.toLowerCase(),e])),Sv=new Set(["hk","mo","tw"]);function Hd(e){return typeof e=="string"&&Gs.get(e.toLowerCase())==e}function zo(e,n="en"){for(let t of e){let r=t==null?void 0:Iv(t);if(r!=null)return r}return n}function Iv(e){let n=e.trim().toLowerCase();if(n.length==0)return;let t=Gs.get(n);if(t!=null)return t;let r=n.split("-");if(r[0]=="zh"){if(r.includes("hant"))return"zh-TW";if(r.includes("hans"))return"zh-CN";return r.some((o)=>Sv.has(o))?"zh-TW":"zh-CN"}return Gs.get(r[0])}function Gd(e){return{en:"Imported workflow","zh-CN":"\u5BFC\u5165\u7684\u5DE5\u4F5C\u6D41","zh-TW":"\u532F\u5165\u7684\u5DE5\u4F5C\u6D41",ja:"\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u305F\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC",ko:"\uAC00\uC838\uC628 \uC6CC\uD06C\uD50C\uB85C",fr:"Workflow import\xE9",ru:"\u0418\u043C\u043F\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u043F\u0440\u043E\u0446\u0435\u0441\u0441"}[e]}import{spawn as FT}from"child_process";import{readFile as qT}from"fs/promises";import{setTimeout as VT}from"timers/promises";var ln="open-flow-engine/v11";var cn=(e)=>`export const engineContract = ${JSON.stringify(e)}
6
+ - Did you mean \`import { "${e}" as foo }\`?`,ImportCallArity:({phase:e})=>`\`import${e?`.${e}`:""}()\` requires exactly one or two arguments.`,ImportCallNotNewExpression:({phase:e})=>`Cannot use new with import${e?`.${e}`:""}().`,ImportCallSpreadArgument:({phase:e})=>`\`...\` is not allowed in \`import${e?`.${e}`:""}()\`.`,IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverDiscardElement:"'void' must be followed by an expression when not used in a binding position.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDigit:({radix:e})=>`Expected number in radix ${e}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:e})=>`Escape sequence in keyword ${e}.`,InvalidIdentifier:({identifierName:e})=>`Invalid identifier ${e}.`,InvalidLhs:({ancestor:e})=>`Invalid left-hand side in ${_s(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${_s(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${_s(e)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:e})=>`Unexpected character '${e}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:e})=>`Private name #${e} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:e})=>`Label '${e}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:e})=>`This experimental syntax requires enabling the parser plugin: ${e.map((n)=>JSON.stringify(n)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:e})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${e.map((n)=>JSON.stringify(n)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:e})=>`Duplicate key "${e}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:e})=>`An export name cannot include a lone surrogate, found '\\u${e.toString(16)}'.`,ModuleExportUndefined:({localName:e})=>`Export '${e}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:e})=>`Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,PrivateNameRedeclaration:({identifierName:e})=>`Duplicate private name #${e}.`,RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperCallNotNewExpression:"Cannot use new with super(...).",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:e})=>`Unexpected keyword '${e}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:e})=>`Unexpected reserved word '${e}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:e,unexpected:n})=>`Unexpected token${n?` '${n}'.`:""}${e?`, expected "${e}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:"Unexpected void binding.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:e,onlyValidPropertyName:n})=>`The only valid meta property for ${e} is ${e}.${n}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:e})=>`Identifier '${e}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:"A void binding may not have an initializer.",YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},iA={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:e})=>`Assigning to '${e}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:e})=>`Binding '${e}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},sA={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:e})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(e)}\`.`},aA={PipeTopicRequiresHackPipes:'Topic references are only supported when using the `"proposal": "hack"` version of the pipeline proposal.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:e})=>`Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:e})=>`Hack-style pipe body cannot be an unparenthesized ${_s({type:e})}; please wrap it in parentheses.`,PipelineUnparenthesized:"Cannot mix binary operator with solo-await F#-style pipeline. Please wrap the pipeline in parentheses."},cA={UnsupportedBind:"Binding should be performed on object property.",UnsupportedBindRHS:"The right-hand side of binding can not be super or import."};He={...kt(rA),...kt(oA),...kt(iA),...kt(sA),...kt`pipelineOperator`(aA),...kt`functionBind`(cA)};uw=new Map;md=[],yd=[],gd=[],bd=[],xd=[],dw=[];pA={bracketL:B("[",{beforeExpr:ie,startsExpr:_}),bracketR:B("]"),braceL:B("{",{beforeExpr:ie,startsExpr:_}),braceBarL:B("{|",{beforeExpr:ie,startsExpr:_}),braceR:B("}"),braceBarR:B("|}"),parenL:B("(",{beforeExpr:ie,startsExpr:_}),parenR:B(")"),comma:B(",",{beforeExpr:ie}),semi:B(";",{beforeExpr:ie}),colon:B(":",{beforeExpr:ie}),doubleColon:B("::",{beforeExpr:ie}),dot:B("."),question:B("?",{beforeExpr:ie}),questionDot:B("?."),arrow:B("=>",{beforeExpr:ie}),template:B("template"),ellipsis:B("...",{beforeExpr:ie}),backQuote:B("`",{startsExpr:_}),dollarBraceL:B("${",{beforeExpr:ie,startsExpr:_}),templateTail:B("...`",{startsExpr:_}),templateNonTail:B("...${",{beforeExpr:ie,startsExpr:_}),at:B("@"),hash:B("#",{startsExpr:_}),interpreterDirective:B("#!..."),eq:B("=",{beforeExpr:ie,isAssign:Eo}),assign:B("_=",{beforeExpr:ie,isAssign:Eo}),slashAssign:B("_=",{beforeExpr:ie,isAssign:Eo}),xorAssign:B("_=",{beforeExpr:ie,isAssign:Eo}),moduloAssign:B("_=",{beforeExpr:ie,isAssign:Eo}),incDec:B("++/--",{prefix:rn,postfix:dA,startsExpr:_}),bang:B("!",{beforeExpr:ie,prefix:rn,startsExpr:_}),tilde:B("~",{beforeExpr:ie,prefix:rn,startsExpr:_}),doubleCaret:B("^^",{startsExpr:_}),doubleAt:B("@@",{startsExpr:_}),pipeline:We("|>",0),nullishCoalescing:We("??",1),logicalOR:We("||",1),logicalAND:We("&&",2),bitwiseOR:We("|",3),bitwiseXOR:We("^",4),bitwiseAND:We("&",5),equality:We("==/!=/===/!==",6),lt:We("</>/<=/>=",7),gt:We("</>/<=/>=",7),relational:We("</>/<=/>=",7),bitShift:We("<</>>/>>>",8),bitShiftL:We("<</>>/>>>",8),bitShiftR:We("<</>>/>>>",8),plusMin:B("+/-",{beforeExpr:ie,binop:9,prefix:rn,startsExpr:_}),modulo:B("%",{binop:10,startsExpr:_}),star:B("*",{binop:10}),slash:We("/",10),exponent:B("**",{beforeExpr:ie,binop:11,rightAssociative:!0}),_in:se("in",{beforeExpr:ie,binop:7}),_instanceof:se("instanceof",{beforeExpr:ie,binop:7}),_break:se("break"),_case:se("case",{beforeExpr:ie}),_catch:se("catch"),_continue:se("continue"),_debugger:se("debugger"),_default:se("default",{beforeExpr:ie}),_else:se("else",{beforeExpr:ie}),_finally:se("finally"),_function:se("function",{startsExpr:_}),_if:se("if"),_return:se("return",{beforeExpr:ie}),_switch:se("switch"),_throw:se("throw",{beforeExpr:ie,prefix:rn,startsExpr:_}),_try:se("try"),_var:se("var"),_const:se("const"),_with:se("with"),_new:se("new",{beforeExpr:ie,startsExpr:_}),_this:se("this",{startsExpr:_}),_super:se("super",{startsExpr:_}),_class:se("class",{startsExpr:_}),_extends:se("extends",{beforeExpr:ie}),_export:se("export"),_import:se("import",{startsExpr:_}),_null:se("null",{startsExpr:_}),_true:se("true",{startsExpr:_}),_false:se("false",{startsExpr:_}),_typeof:se("typeof",{beforeExpr:ie,prefix:rn,startsExpr:_}),_void:se("void",{beforeExpr:ie,prefix:rn,startsExpr:_}),_delete:se("delete",{beforeExpr:ie,prefix:rn,startsExpr:_}),_do:se("do",{isLoop:ud,beforeExpr:ie}),_for:se("for",{isLoop:ud}),_while:se("while",{isLoop:ud}),_as:ne("as",{startsExpr:_}),_assert:ne("assert",{startsExpr:_}),_async:ne("async",{startsExpr:_}),_await:ne("await",{startsExpr:_}),_defer:ne("defer",{startsExpr:_}),_from:ne("from",{startsExpr:_}),_get:ne("get",{startsExpr:_}),_let:ne("let",{startsExpr:_}),_meta:ne("meta",{startsExpr:_}),_of:ne("of",{startsExpr:_}),_sent:ne("sent",{startsExpr:_}),_set:ne("set",{startsExpr:_}),_source:ne("source",{startsExpr:_}),_static:ne("static",{startsExpr:_}),_using:ne("using",{startsExpr:_}),_yield:ne("yield",{startsExpr:_}),_asserts:ne("asserts",{startsExpr:_}),_checks:ne("checks",{startsExpr:_}),_exports:ne("exports",{startsExpr:_}),_global:ne("global",{startsExpr:_}),_implements:ne("implements",{startsExpr:_}),_intrinsic:ne("intrinsic",{startsExpr:_}),_infer:ne("infer",{startsExpr:_}),_is:ne("is",{startsExpr:_}),_mixins:ne("mixins",{startsExpr:_}),_proto:ne("proto",{startsExpr:_}),_require:ne("require",{startsExpr:_}),_satisfies:ne("satisfies",{startsExpr:_}),_keyof:ne("keyof",{startsExpr:_}),_readonly:ne("readonly",{startsExpr:_}),_unique:ne("unique",{startsExpr:_}),_abstract:ne("abstract",{startsExpr:_}),_declare:ne("declare",{startsExpr:_}),_enum:ne("enum",{startsExpr:_}),_module:ne("module",{startsExpr:_}),_namespace:ne("namespace",{startsExpr:_}),_interface:ne("interface",{startsExpr:_}),_type:ne("type",{startsExpr:_}),_opaque:ne("opaque",{startsExpr:_}),name:B("name",{startsExpr:_}),placeholder:B("%%",{startsExpr:_}),string:B("string",{startsExpr:_}),num:B("num",{startsExpr:_}),bigint:B("bigint",{startsExpr:_}),regexp:B("regexp",{startsExpr:_}),privateName:B("#name",{startsExpr:_}),eof:B("eof"),jsxName:B("jsxName"),jsxText:B("jsxText",{beforeExpr:ie}),jsxTagStart:B("jsxTagStart",{startsExpr:_}),jsxTagEnd:B("jsxTagEnd")};Ce={brace:new Ao("{"),j_oTag:new Ao("<tag"),j_cTag:new Ao("</tag"),j_expr:new Ao("<tag>...</tag>",!0)},nw=/[\p{ID_Start}\u088f\u0c5c\u0cdc\ua7ce\ua7cf\ua7d2\ua7d4\ua7f1]/u,rw=/[\p{ID_Continue}\u088f\u0c5c\u0cdc\ua7ce\ua7cf\ua7d2\ua7d4\ua7f1\u1acf-\u1add\u1ae0-\u1aeb]/u,fw=[2368,25,1388,2,3817,43,20677,24,3,24,287,4,6146,7,1290,21,98,114,22734,30,2,2,2,1,2,6,3,4,10,1,53307,5,5987,11,21763,4297],vA=[3834,1,3173,7,633,9,51450,0,3,0,8,1,6,0];kd={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},eM=new Set(kd.keyword),tM=new Set(kd.strict),nM=new Set(kd.strictBind);mw=class mw extends $s{declareFunctions=new Set};yw=class yw extends Sd{createScope(e){return new mw(e)}declareName(e,n,t){let r=this.currentScope();if(n&2048){this.checkRedeclarationInScope(r,e,n,t),this.maybeExportDefined(r,e),r.declareFunctions.add(e);return}super.declareName(e,n,t)}isRedeclaredInScope(e,n,t){if(super.isRedeclaredInScope(e,n,t))return!0;if(t&2048&&!e.declareFunctions.has(n)){let r=e.names.get(n);return(r&4)>0||(r&2)>0}return!1}checkLocalExport(e){if(!this.scopeStack[0].declareFunctions.has(e.name))super.checkLocalExport(e)}};SA=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),IA={AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:e})=>`Cannot overwrite reserved type ${e}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:e,enumName:n})=>`Boolean enum members need to be initialized. Use either \`${e} = true,\` or \`${e} = false,\` in enum \`${n}\`.`,EnumDuplicateMemberName:({memberName:e,enumName:n})=>`Enum member names need to be unique, but the name \`${e}\` has already been used before in enum \`${n}\`.`,EnumInconsistentMemberValues:({enumName:e})=>`Enum \`${e}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:e,enumName:n})=>`Enum type \`${e}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${n}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:e})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:e,memberName:n,explicitType:t})=>`Enum \`${e}\` has type \`${t}\`, so the initializer of \`${n}\` needs to be a ${t} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:e,memberName:n})=>`Symbol enum members cannot be initialized. Use \`${n},\` in enum \`${e}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:e,memberName:n})=>`The enum member initializer for \`${n}\` needs to be a literal (either a boolean, number, or string) in enum \`${e}\`.`,EnumInvalidMemberName:({enumName:e,memberName:n,suggestion:t})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${n}\`, consider using \`${t}\`, in enum \`${e}\`.`,EnumNumberMemberNotInitialized:({enumName:e,memberName:n})=>`Number enum members need to be initialized, e.g. \`${n} = 1\` in enum \`${e}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:e})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${e}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:{message:"A binding pattern parameter cannot be optional in an implementation signature."},SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:e})=>`Unexpected reserved type ${e}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:e,suggestion:n})=>`\`declare export ${e}\` is not supported. Use \`${n}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."},V=kt`flow`(IA);PA={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};AA=/\*?\s*@((?:no)?flow)\b/,OA={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},NA=/\r\n|[\r\n\u2028\u2029]/,rM=new RegExp(NA.source,"g");jA={AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:e})=>`Expected corresponding JSX closing tag for <${e}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:e,HTMLEntity:n})=>`Unexpected token \`${e}\`. Did you mean \`${n}\` or \`{'${e}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"},Lt=kt`jsx`(jA);gw=class gw extends $s{tsNames=new Map};bw=class bw extends Sd{get inTSNamespace(){let e=this.scopeStack;return e.length>=2&&e[e.length-1].flags===0&&(e[e.length-2].flags&2048)>0}importsStack=[];createScope(e){return this.importsStack.push(new Set),new gw(e)}enter(e){if(e&3072)this.importsStack.push(new Set);super.enter(e)}exit(){let e=super.exit();if(e&3072)this.importsStack.pop();return e}hasImport(e,n){let t=this.importsStack.length;if(this.importsStack[t-1].has(e))return!0;if(!n&&t>1){for(let r=0;r<t-1;r++)if(this.importsStack[r].has(e))return!0}return!1}declareName(e,n,t){if(n&4096){if(this.hasImport(e,!0))this.parser.raise(He.VarRedeclaration,t,{identifierName:e});this.importsStack[this.importsStack.length-1].add(e);return}let r=this.currentScope(),o=r.tsNames.get(e)||0;if(n&1024){this.maybeExportDefined(r,e),r.tsNames.set(e,o|16);return}if(super.declareName(e,n,t),n&2){if(!(n&1))this.checkRedeclarationInScope(r,e,n,t),this.maybeExportDefined(r,e);o=o|1}if(n&256)o=o|2;if(n&512)o=o|4;if(n&128)o=o|8;if(o)r.tsNames.set(e,o)}isRedeclaredInScope(e,n,t){let r=e.tsNames.get(n);if((r&2)>0){if(t&256){let o=(t&512)>0,i=(r&4)>0;return o!==i}return!0}if(t&128&&(r&8)>0)if(e.names.get(n)&2)return!!(t&1);else return!1;if(t&2&&(r&1)>0)return!0;return super.isRedeclaredInScope(e,n,t)}checkLocalExport(e){let{name:n}=e;if(this.hasImport(n))return;let t=this.scopeStack.length;for(let r=t-1;r>=0;r--){let i=this.scopeStack[r].tsNames.get(n);if((i&1)>0||(i&16)>0)return}super.checkLocalExport(e)}};oM=xw.prototype,dd=/in(?:stanceof)?|as|satisfies/y;$A={AbstractMethodHasImplementation:({methodName:e})=>`Method '${e}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:e})=>`Property '${e}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclaratorDefiniteAssertionRequiresTypeAnnotation:"Declarations with definite assignment assertions must also have type annotations.",DeclaratorDefiniteAssertionWithInitializer:"Declarations with initializers cannot also have definite assignment assertions.",DeclareAccessor:({kind:e})=>`'declare' is not allowed in ${e}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DecoratorAbstractMethod:({kind:e})=>`Decorators can't be used with ${e.startsWith("a")?"an":"a"} ${e}.`,DuplicateAccessibilityModifier:({modifier:e})=>`Accessibility modifier already seen: '${e}'.`,DuplicateModifier:({modifier:e})=>`Duplicate modifier: '${e}'.`,EmptyHeritageClauseType:({token:e})=>`'${e}' list cannot be empty.`,EmptyNamespaceName:"Namespace must be given a name.",EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ExportAssignmentInTSNamespace:"An export assignment cannot be used in a namespace.",ExportInTSNamespace:"Export declarations are not permitted in a namespace.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportInTSNamespace:"Import declarations in a namespace cannot reference a module.",IncompatibleModifiers:({modifiers:e})=>`'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:e})=>`Index signatures cannot have an accessibility modifier ('${e}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InlineModuleDeclarationMustUseString:"`module ... {}` declarations must have a string name. Use `namespace ... {}` instead.",InvalidHeritageClauseType:({token:e})=>`'${e}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:(e)=>`'${e}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:e})=>`'${e}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:e})=>`'${e}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:e})=>`'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:(e)=>`'${e}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:e})=>`'${e[0]}' modifier must precede '${e[1]}' modifier.`,InvalidNamespaceName:(e)=>`Namespace name cannot be '${e}'.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NamespaceExportInTSNamespace:"Global module exports may only appear at top level.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifier:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:e})=>`Private elements cannot have an accessibility modifier ('${e}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:e})=>`Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterInitializer:"A parameter initializer is only allowed in a function or constructor implementation.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnexpectedTypeDeclaration:(e)=>`'${e}' declarations can only be declared inside a block.`,UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:e})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,UsingDeclarationInAmbientContext:(e)=>`'${e}' declarations are not allowed in ambient contexts.`},N=kt`typescript`($A);VA={ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."},cw=kt`placeholders`(VA),JA={estree:uA,jsx:RA,flow:TA,typescript:MA,v8intrinsic:UA,placeholders:BA},iM=Object.keys(JA);sM=ZA(pA)});var Vt={};Mo(Vt,{anyString:()=>za,base64:()=>Oa,base64url:()=>Na,bigint:()=>qa,boolean:()=>Va,browserEmail:()=>tk,cidrv4:()=>Aa,cidrv6:()=>Ta,creditCard:()=>ti,cuid:()=>ha,cuid2:()=>ma,currencyCode:()=>$a,date:()=>Da,datetime:()=>Ma,domain:()=>Ra,duration:()=>va,e164:()=>_a,email:()=>Sa,emoji:()=>Ia,extendedDuration:()=>Wv,guid:()=>ka,hex:()=>Ka,hostname:()=>ja,html5Email:()=>Xv,httpProtocol:()=>Pr,iban:()=>ni,idnEmail:()=>ek,integer:()=>Er,ipv4:()=>Ca,ipv6:()=>Pa,ksuid:()=>ba,lowercase:()=>Ja,mac:()=>Ea,md5_base64:()=>ik,md5_base64url:()=>sk,md5_hex:()=>ok,nanoid:()=>xa,nanoidOfLength:()=>wa,null:()=>Ba,number:()=>fn,rfc5322Email:()=>Yv,sha1_base64:()=>ck,sha1_base64url:()=>lk,sha1_hex:()=>ak,sha256_base64:()=>dk,sha256_base64url:()=>pk,sha256_hex:()=>uk,sha384_base64:()=>hk,sha384_base64url:()=>mk,sha384_hex:()=>fk,sha512_base64:()=>gk,sha512_base64url:()=>bk,sha512_hex:()=>yk,string:()=>Fa,time:()=>La,ulid:()=>ya,undefined:()=>Ua,unicodeEmail:()=>jp,uppercase:()=>Za,uuid:()=>pn,uuid4:()=>Hv,uuid6:()=>Gv,uuid7:()=>Qv,xid:()=>ga});var Wl={};Mo(Wl,{ZodAny:()=>ly,ZodArray:()=>hy,ZodBase64:()=>Dl,ZodBase64URL:()=>Ll,ZodBigInt:()=>Vl,ZodBigIntFormat:()=>Bl,ZodBoolean:()=>ql,ZodCIDRv4:()=>_l,ZodCIDRv6:()=>$l,ZodCUID:()=>El,ZodCUID2:()=>Al,ZodCatch:()=>_y,ZodCodec:()=>Ki,ZodCreditCard:()=>ry,ZodCustom:()=>Wi,ZodCustomStringFormat:()=>Fn,ZodDate:()=>fy,ZodDefault:()=>Ay,ZodDiscriminatedUnion:()=>yy,ZodE164:()=>Ml,ZodEmail:()=>Sl,ZodEmoji:()=>Cl,ZodEnum:()=>Ur,ZodExactOptional:()=>Jl,ZodFile:()=>Iy,ZodFunction:()=>By,ZodGUID:()=>Il,ZodIBAN:()=>oy,ZodIPv4:()=>jl,ZodIPv6:()=>Rl,ZodISODate:()=>Ln,ZodISODateTime:()=>Dn,ZodISODuration:()=>zn,ZodISOTime:()=>Mn,ZodInstanceOf:()=>Zy,ZodIntersection:()=>gy,ZodJWT:()=>zl,ZodKSUID:()=>Nl,ZodLazy:()=>qy,ZodLiteral:()=>Sy,ZodMAC:()=>ny,ZodMap:()=>vy,ZodNaN:()=>Dy,ZodNanoID:()=>Pl,ZodNever:()=>dy,ZodNonOptional:()=>Zl,ZodNull:()=>ay,ZodNullable:()=>Ey,ZodNumber:()=>Fl,ZodNumberFormat:()=>qn,ZodObject:()=>Bi,ZodOptional:()=>Ji,ZodPipe:()=>Zi,ZodPrefault:()=>Oy,ZodPreprocess:()=>Ly,ZodPromise:()=>Vy,ZodReadonly:()=>My,ZodRecord:()=>Br,ZodSet:()=>ky,ZodString:()=>kl,ZodStringFormat:()=>be,ZodSuccess:()=>Ry,ZodSymbol:()=>iy,ZodTemplateLiteral:()=>Fy,ZodTransform:()=>Cy,ZodTuple:()=>xy,ZodType:()=>Q,ZodULID:()=>Tl,ZodURL:()=>Vi,ZodUUID:()=>_t,ZodUndefined:()=>sy,ZodUnion:()=>Ui,ZodUnknown:()=>uy,ZodVoid:()=>py,ZodXID:()=>Ol,ZodXor:()=>my,_ZodString:()=>vl,_default:()=>Ty,_function:()=>dI,any:()=>ZS,array:()=>A,base64:()=>PS,base64url:()=>ES,bigint:()=>qS,boolean:()=>me,catch:()=>$y,check:()=>pI,cidrv4:()=>IS,cidrv6:()=>CS,codec:()=>aI,creditCard:()=>TS,cuid:()=>yS,cuid2:()=>gS,currencyCode:()=>$S,custom:()=>fI,date:()=>WS,describe:()=>hI,discriminatedUnion:()=>gt,e164:()=>AS,email:()=>sS,emoji:()=>hS,enum:()=>U,exactOptional:()=>Py,file:()=>rI,float32:()=>LS,float64:()=>MS,function:()=>dI,guid:()=>aS,hash:()=>DS,hex:()=>_S,hostname:()=>RS,httpUrl:()=>fS,iban:()=>OS,instanceof:()=>yI,int:()=>Ne,int32:()=>zS,int64:()=>VS,intersection:()=>by,invertCodec:()=>cI,ipv4:()=>vS,ipv6:()=>SS,json:()=>De,jwt:()=>NS,keyof:()=>HS,ksuid:()=>wS,lazy:()=>Kl,literal:()=>b,looseObject:()=>GS,looseRecord:()=>YS,mac:()=>kS,map:()=>eI,meta:()=>mI,nan:()=>sI,nanoid:()=>mS,nativeEnum:()=>nI,never:()=>yt,nonoptional:()=>jy,null:()=>cy,nullable:()=>qi,nullish:()=>oI,number:()=>M,object:()=>E,optional:()=>Fi,partialRecord:()=>XS,pipe:()=>wl,prefault:()=>Ny,preprocess:()=>Ky,promise:()=>uI,readonly:()=>zy,record:()=>re,refine:()=>Uy,set:()=>tI,strictObject:()=>w,string:()=>k,stringFormat:()=>jS,stringbool:()=>gI,success:()=>iI,superRefine:()=>Jy,symbol:()=>US,templateLiteral:()=>lI,transform:()=>Ul,tuple:()=>wy,uint32:()=>FS,uint64:()=>BS,ulid:()=>bS,undefined:()=>JS,union:()=>te,unknown:()=>mt,url:()=>pS,uuid:()=>cS,uuidv4:()=>lS,uuidv6:()=>uS,uuidv7:()=>dS,void:()=>KS,xid:()=>xS,xor:()=>QS});var Mi={};Mo(Mi,{endsWith:()=>Ai,gt:()=>Ut,gte:()=>ht,includes:()=>Pi,length:()=>$r,lowercase:()=>Ii,lt:()=>Bt,lte:()=>ft,maxLength:()=>_r,maxSize:()=>Nn,mime:()=>Oi,minLength:()=>hn,minSize:()=>Jt,multipleOf:()=>On,negative:()=>fm,nonnegative:()=>mm,nonpositive:()=>hm,normalize:()=>Ni,overwrite:()=>Rt,positive:()=>pm,properties:()=>Ti,property:()=>ym,regex:()=>Si,size:()=>Rr,slugify:()=>$i,startsWith:()=>Ei,toLowerCase:()=>Ri,toUpperCase:()=>_i,trim:()=>ji,uppercase:()=>Ci});var Jr={};Mo(Jr,{ZodISODate:()=>Ln,ZodISODateTime:()=>Dn,ZodISODuration:()=>zn,ZodISOTime:()=>Mn,date:()=>xI,datetime:()=>bI,duration:()=>vI,time:()=>wI});var Kd="0.1.0-beta.89";var Qs=["en","zh-CN","zh-TW","ja","ko","ru","fr"],Wd="en";var Gs=new Map(Qs.map((e)=>[e.toLowerCase(),e])),Sv=new Set(["hk","mo","tw"]);function Hd(e){return typeof e=="string"&&Gs.get(e.toLowerCase())==e}function zo(e,n="en"){for(let t of e){let r=t==null?void 0:Iv(t);if(r!=null)return r}return n}function Iv(e){let n=e.trim().toLowerCase();if(n.length==0)return;let t=Gs.get(n);if(t!=null)return t;let r=n.split("-");if(r[0]=="zh"){if(r.includes("hant"))return"zh-TW";if(r.includes("hans"))return"zh-CN";return r.some((o)=>Sv.has(o))?"zh-TW":"zh-CN"}return Gs.get(r[0])}function Gd(e){return{en:"Imported workflow","zh-CN":"\u5BFC\u5165\u7684\u5DE5\u4F5C\u6D41","zh-TW":"\u532F\u5165\u7684\u5DE5\u4F5C\u6D41",ja:"\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u305F\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC",ko:"\uAC00\uC838\uC628 \uC6CC\uD06C\uD50C\uB85C",fr:"Workflow import\xE9",ru:"\u0418\u043C\u043F\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u043F\u0440\u043E\u0446\u0435\u0441\u0441"}[e]}import{spawn as FT}from"child_process";import{readFile as qT}from"fs/promises";import{setTimeout as VT}from"timers/promises";var ln="open-flow-engine/v11";var cn=(e)=>`export const engineContract = ${JSON.stringify(e)}
7
7
  export function identity(value) { return value }
8
8
  `,Fo={workflowTools:!0,httpRequests:!0,waitAutoContinue:!0,webhookResponses:!0,platformExports:new Set(["engineContract","identity"]),platformModule:"open-flow:platform",platformSource:cn("open-flow-engine/v8")},qo={...Fo,builtinModules:new Set(["assert","assert/strict","buffer","console","constants","crypto","events","fs","fs/promises","os","path","path/posix","process","punycode","querystring","stream","stream/promises","stream/web","string_decoder","timers","timers/promises","url","util","zlib"].flatMap((e)=>[e,`node:${e}`])),platformSource:cn("open-flow-engine/v8/nodejs-compat-v1")},Qd={...qo,codeFetch:!0,platformSource:cn("open-flow-engine/v9")},Xd={...Qd,flowState:!0,platformSource:cn("open-flow-engine/v10")},Cv={...Xd,connectorProxy:!0,platformSource:cn("open-flow-engine/v11")};function Vo(e){if(e=="open-flow-engine/v11")return Cv;if(e=="open-flow-engine/v10")return Xd;if(e=="open-flow-engine/v9")return Qd;if(e=="open-flow-engine/v8")return Fo;if(e=="open-flow-engine/v8/nodejs-compat-v1")return qo;if(e=="open-flow-engine/v7"||e=="open-flow-engine/v7/nodejs-compat-v1")return{...e.endsWith("/nodejs-compat-v1")?qo:Fo,workflowTools:!1,httpRequests:!1,platformSource:cn(e)};if(e=="open-flow-engine/v6"||e=="open-flow-engine/v6/nodejs-compat-v1")return{...e=="open-flow-engine/v6"?Fo:qo,workflowTools:!1,httpRequests:!1,waitAutoContinue:!1,webhookResponses:!1,platformSource:cn(e)};return}function xr(e){let n=Object.values(e).filter((r)=>typeof r==="number");return Object.entries(e).filter(([r,o])=>n.indexOf(+r)===-1).map(([r,o])=>o)}function Ys(e,n="|"){return e.map((t)=>ra(t)).join(n)}function wr(e,n){if(typeof n==="bigint")return n.toString();return n}class ep{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function vr(e){return new ep(e)}function ea(e){return e===null||e===void 0}function qt(e){let n=e.startsWith("^")?1:0,t=e.endsWith("$")?e.length-1:e.length;return e.slice(n,t)}function tp(e,n){let t=e/n,r=Math.round(t),o=4*Number.EPSILON*Math.max(Math.abs(t),1);if(Math.abs(t-r)<o)return 0;return t-r}var Yd=Symbol("evaluating");function np(e,n,t){let r=void 0;Object.defineProperty(e,n,{get(){if(r===Yd)return;if(r===void 0)r=Yd,r=t();return r},set(o){Object.defineProperty(e,n,{value:o})},configurable:!0})}function qe(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function kr(e){let n=Object.getOwnPropertyDescriptor(e,"shape");return n?.get?n.get.raw:n?.value}function Ot(e){return kr(e._zod.def)??e._zod.def.shape}function rp(e,n,t){Object.defineProperty(e,n,{get(){let r=t();return qe(this,n,r),r},enumerable:!0,configurable:!0})}function op(e,n,t){if(n in e)qe(e,n,t);else e[n]=t}function un(e,n,t,r){let o=Ot(n);for(let i of t){let s=Object.getOwnPropertyDescriptor(o,i);if(!s.enumerable)continue;if(s.get)rp(e,i,()=>{let a=n._zod.def.shape[i];return r?r(a,i):a});else op(e,i,r?r(s.value,i):s.value)}}function Pv(e,n){for(let t of Reflect.ownKeys(n)){let r=Object.getOwnPropertyDescriptor(n,t);if(!r.enumerable)continue;if(r.get)rp(e,t,()=>n[t]);else op(e,t,r.value)}}function nt(...e){let n={};for(let t of e){let r=Object.getOwnPropertyDescriptors(t);Object.assign(n,r)}return Object.defineProperties({},n)}function ip(e){return JSON.stringify(e)}function sp(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ta="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function En(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var ap=vr(()=>{if(Fe.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function jt(e){if(En(e)===!1)return!1;let n=e.constructor;if(n===void 0)return!0;if(typeof n!=="function")return!0;let t=n.prototype;if(En(t)===!1)return!1;if(Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)return!1;return!0}function na(e){if(jt(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var Bo=new Set(["string","number","symbol"]),cp=new Set(["string","number","bigint","boolean","symbol","undefined"]);function pt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function St(e,n,t){let r=new e._zod.constr(n??e._zod.def);if(!n||t?.parent)r._zod.parent=e;return r}function T(e){let n=e;if(!n)return{};if(typeof n==="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");n.error=n.message}if(delete n.message,typeof n.error==="string")return{...n,error:()=>n.error};return n}function ra(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function lp(e){return Object.keys(e).filter((n)=>e[n]._zod.optin!==void 0&&e[n]._zod.optout==="optional")}var Uo=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),Jo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ev(e,n){let t=e._zod.def,r=t.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return un(i,e,Zo(e,n)),St(e,nt(t,{shape:i,checks:[]}))}function Zo(e,n){let t=Ot(e),r=[];for(let o of Reflect.ownKeys(n)){if(!Object.getOwnPropertyDescriptor(t,o)?.enumerable)throw Error(`Unrecognized key: "${String(o)}"`);if(n[o])r.push(o)}return r}function Av(e,n){let t=e._zod.def,r=t.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(Zo(e,n)),s={};return un(s,e,Reflect.ownKeys(Ot(e)).filter((a)=>!i.has(a))),St(e,nt(t,{shape:s,checks:[]}))}function Tv(e,n){if(!jt(n))throw Error("Invalid input to extend: expected a plain object");let t=e._zod.def.checks;if(t&&t.length>0){let o=Ot(e);for(let i of Reflect.ownKeys(n))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return St(e,nt(e._zod.def,{shape:up(e,n)}))}function up(e,n){let t={};return un(t,e,Reflect.ownKeys(Ot(e))),Pv(t,n),t}function Ov(e,n){if(!jt(n))throw Error("Invalid input to safeExtend: expected a plain object");return St(e,nt(e._zod.def,{shape:up(e,n)}))}function Nv(e,n){if(!n?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let t={};un(t,e,Reflect.ownKeys(Ot(e))),un(t,n,Reflect.ownKeys(Ot(n)));let r=nt(e._zod.def,{shape:t,get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return St(e,r)}function dp(e,n,t,r="partial"){let i=n._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=t?new Set(Zo(n,t)):void 0,c={};return un(c,n,Reflect.ownKeys(Ot(n)),e&&((l,u)=>a&&!a.has(u)?l:new e({type:"optional",innerType:l}))),St(n,nt(n._zod.def,{shape:c,checks:[]}))}function jv(e,n,t){let r=t?new Set(Zo(n,t)):void 0,o={};return un(o,n,Reflect.ownKeys(Ot(n)),(i,s)=>r&&!r.has(s)?i:new e({type:"nonoptional",innerType:i})),St(n,nt(n._zod.def,{shape:o}))}function Qe(e,n=0){if(e.aborted===!0)return!0;for(let t=n;t<e.issues.length;t++)if(e.issues[t]?.continue!==!0)return!0;return!1}function pp(e,n=0){if(e.aborted===!0)return!0;for(let t=n;t<e.issues.length;t++)if(e.issues[t]?.continue===!1)return!0;return!1}function rt(e,n){return n.map((t)=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function br(e){return typeof e==="string"?e:e?.message}function oa(e){let n=[];for(let t of e??[]){let r=t._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;let o=r.maximum??r.length??r.size;if(o>=0)n.push([o,t])}return n}function Ko(e,n,t){var r;for(let o=n;o<e.length;o++)(r=e[o]).schema??(r.schema=t)}function ot(e,n,t){var r;let o=e.inst?._zod?.traits;if(o?.has("$ZodType"))if(o.has("$ZodCheck"))(r=e).schema??(r.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:br(e.inst?._zod.def?.error?.(e))??br(i?.(e))??br(n?.error?.(e))??br(t.customError?.(e))??br(t.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e)){if(c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__")continue;a[c]=e[c]}if(a.path??(a.path=[]),a.message=s,n?.reportInput)a.input=e.input;return a}function Wo(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}var Rv=/[\uD800-\uDBFF]/;function Ho(e){let n=e.length;if(!Rv.test(e))return n;let t=n;for(let r=0;r<n-1;r++)if((e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320)t--,r++;return t}function Go(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function fp(e){let n=typeof e;switch(n){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return n}function dn(...e){let[n,t,r]=e;if(typeof n==="string")return{message:n,code:"custom",input:t,inst:r};return{...n}}function hp(e,n){for(let t in n){let r=Object.getOwnPropertyDescriptor(n,t);if(r.get)Object.defineProperty(e,t,{...r,enumerable:!1});else _v(e,t,r.value)}}function Nt(e,n,t,r=!0){return Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:r,value:t}),t}function Sr(e,n,t){return Nt(e,n,t,!1)}function Qo(e,n){for(let t in e){let r=e[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get(){return Nt(this,t,r(this))},set(o){Nt(this,t,o)}})}return n}function _v(e,n,t){Object.defineProperty(e,n,{configurable:!0,get(){return this==null?t:Nt(this,n,t.bind(this))},set(r){Nt(this,n,r)}})}function $v(e,n){let t=Object.getPrototypeOf(e);return n in t?void 0:t}var Xs,Ft=!1,Dv={configurable:!0,get(){Ft=!0;return}};function Y(e,n,t){let r=Object.getPrototypeOf(e._zod);if(n in r&&Xs!==e._zod){Xs=void 0;return}Xs=e._zod,Object.defineProperty(r,n,{configurable:!0,get(){Object.defineProperty(this,n,Dv);let o=Ft;Ft=!1;try{let i=t(this);if(Ft)delete this[n];else Object.defineProperty(this,n,{configurable:!0,writable:!0,value:i});return Ft=Ft||o,i}catch(i){throw delete this[n],Ft=Ft||o,i}},set(o){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:o})}})}function Lv(e,n,t,r){let o=$v(e,n);if(!o)return;Object.defineProperty(o,n,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,n,i),i.value=t(this),Object.defineProperty(this,n,i),i.value},set(i){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:r,value:i})}})}var Mv="~constantCatch";function mp(e){let n=()=>e;return n[Mv]=!0,n}var yp;var ia={value:void 0,enumerable:!1},gp="captureStackTrace"in Error?Error:null;function zv(e){let n=gp;if(n){let t=n.stackTraceLimit;if(typeof t==="number"){try{n.stackTraceLimit=0}catch{return gp=null,new e}try{return new e}finally{n.stackTraceLimit=t}}}return new e}function g(e,n,t,r){let o={};function i(p){this.def=p,this.constr=d,this.traits=new Set}i.prototype=o;let s=t,a=s&&new WeakSet;function c(p,m){if(!p._zod){ia.value=new i(m);try{Object.defineProperty(p,"_zod",ia)}finally{ia.value=void 0}}else if(p._zod.traits.has(e))return;if(p._zod.traits.add(e),n(p,m),a){let I=Object.getPrototypeOf(p),j=p._zod.constr.prototype,L=I;while(L&&L!==j)L=Object.getPrototypeOf(L);let F=L??I;if(!a.has(F))a.add(F),hp(F,s)}let y=d.prototype;for(let I in y){if(!Object.prototype.hasOwnProperty.call(y,I))continue;if(!(I in p))p[I]=y[I].bind(p)}}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(p){let m=r?.Parent?zv(u):this;c(m,p);let y=m._zod.deferred;if(y){for(let j of y)j();m._zod.deferred=void 0}let I=globalThis.__zod_globalConfig?.postProcessor;if(I)I(m);return m}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:(p)=>{if(r?.Parent&&p instanceof r.Parent)return!0;return p?._zod?.traits?.has(e)}}),Object.defineProperty(d,"name",{value:e}),d}class It extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class An extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(yp=globalThis).__zod_globalConfig??(yp.__zod_globalConfig={});var Fe=globalThis.__zod_globalConfig;function Ve(e){if(e)Object.assign(Fe,e);return Fe}function Fv(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,wr,2)),e.message}function qv(e){this._zod.message=e}var Vv={get:Fv,set:qv,enumerable:!0,configurable:!0},aa={value:void 0,enumerable:!1},bp=new WeakSet([Object.prototype,Error.prototype]),xp=(e,n)=>{e.name="$ZodError",aa.value=n,Object.defineProperty(e,"issues",aa),aa.value=void 0,Object.defineProperty(e,"message",Vv);let t=Object.getPrototypeOf(e);if(!bp.has(t))bp.add(t),Object.defineProperty(t,"toString",{configurable:!0,enumerable:!1,get(){let r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}})},wp=g("$ZodError",xp),ca=g("$ZodError",xp,void 0,{Parent:Error});function Bv(e,n,t){if(!Object.prototype.hasOwnProperty.call(e,n))if(n==="__proto__")Object.defineProperty(e,n,{value:t(),writable:!0,enumerable:!0,configurable:!0});else e[n]=t();return e[n]}function vp(e,n=(t)=>t.message){let t={},r=[];for(let o of e.issues)if(o.path.length>0)Bv(t,o.path[0],()=>[]).push(n(o));else r.push(n(o));return{formErrors:r,fieldErrors:t}}function kp(e,n=(t)=>t.message){let t={_errors:[]},r=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((a)=>r({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")r({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)t._errors.push(n(s));else{let c=t,l=0;while(l<a.length){let u=a[l],d=l===a.length-1;if(u==="_errors"){if(d)c._errors.push(n(s));l++;continue}if(!Object.prototype.hasOwnProperty.call(c,u))Object.defineProperty(c,u,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let p=c[u];if(d)p._errors.push(n(s));c=p,l++}}}};return r(e),t}function Xo(e,n){return{callee:n?.callee??e,Err:n?.Err}}var Ir=(e)=>{let n=(t,r,o,i)=>{let s=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new It;if(a.issues.length){let c=new(i?.Err??e)(a.issues.map((l)=>ot(l,s,Ve())));throw ta(c,i?.callee??n),c}return a.value};return n},la=Ir(ca),Cr=(e)=>{let n=async(t,r,o,i)=>{let s=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)a=await a;if(a.issues.length){let c=new(i?.Err??e)(a.issues.map((l)=>ot(l,s,Ve())));throw ta(c,i?.callee??n),c}return a.value};return n},ua=Cr(ca),Yo=(e)=>(n,t,r)=>{let o=r?{...r,async:!1}:{async:!1},i=n._zod.run({value:t,issues:[]},o);if(i instanceof Promise)throw new It;return i.issues.length?Sp(e,i.issues,o):{success:!0,data:i.value}};function Sp(e,n,t){let r;return{success:!1,get error(){if(!r)r=new e(n.map((o)=>ot(o,t,Ve()))),n=void 0,t=void 0;return r},set error(o){r=o,n=void 0,t=void 0}}}var ei=(e)=>async(n,t,r)=>{let o=r?{...r,async:!0}:{async:!0},i=n._zod.run({value:t,issues:[]},o);if(i instanceof Promise)i=await i;return i.issues.length?Sp(e,i.issues,o):{success:!0,data:i.value}};var Jv=Symbol.for("zod.compile.invalid"),Zv=Symbol.for("zod.compile.fallback"),da=(e,n,t)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(n)!==Jv)return!0;if(r.definite===!0&&t===void 0)return!1}return Kv(e,n,t)};function Kv(e,n,t){let r=t?{...t,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o)r[Zv]=!0,i=o({value:n,issues:[]},r);else i=e._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new It;return i.issues.length===0}var pa=async(e,n,t)=>{let r=t?{...t,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:n,issues:[]},r);if(o instanceof Promise)o=await o;return o.issues.length===0},Ip=(e)=>{let n=Ir(e),t=(r,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return n(r,o,a,Xo(t,s))};return t};var Cp=(e)=>{let n=Ir(e),t=(r,o,i,s)=>n(r,o,i,Xo(t,s));return t};var Pp=(e)=>{let n=Cr(e),t=async(r,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await n(r,o,a,Xo(t,s))};return t};var Ep=(e)=>{let n=Cr(e),t=async(r,o,i,s)=>await n(r,o,i,Xo(t,s));return t};var Ap=(e)=>(n,t,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return Yo(e)(n,t,o)};var Tp=(e)=>(n,t,r)=>Yo(e)(n,t,r);var Op=(e)=>async(n,t,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return ei(e)(n,t,o)};var Np=(e)=>async(n,t,r)=>ei(e)(n,t,r);var ha=/^[cC][0-9a-z]{6,}$/,ma=/^[0-9a-z]+$/,ya=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ga=/^[0-9a-vA-V]{20}$/,ba=/^[A-Za-z0-9]{27}$/,xa=/^[a-zA-Z0-9_-]{21}$/;function wa(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var va=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Wv=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ka=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,pn=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Hv=pn(4),Gv=pn(6),Qv=pn(7),Sa=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xv=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Yv=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,jp=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ek=jp,tk=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,nk="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Ia(){return new RegExp(nk,"u")}var Ca=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Pa=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ea=(e)=>{let n=pt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${n}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${n}){5}[0-9a-f]{2}$`)},Aa=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ta=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Oa=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Na=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,ja=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Ra=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Pr=/^https?$/,_a=/^\+[1-9]\d{6,14}$/,ti=/^\d(?:[ -]?\d){11,18}$/,$a=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,ni=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,Rp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function rk(e){return new RegExp(`^${e}$`)}var Da=rk(Rp);function fa(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function La(e){return new RegExp(`^${fa(e)}$`)}function Ma(e){let n=["Z"];if(e.offset)n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let t=`${fa({precision:e.precision,seconds:!0})}(?:${n.join("|")})`,r=e.local?`${t}|${fa({precision:e.precision})}`:t;return new RegExp(`^${Rp}T(?:${r})$`)}var za=/^[\s\S]{0,}$/,Fa=(e)=>{let n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},qa=/^-?\d+n?$/,Er=/^-?\d+$/,fn=/^-?\d+(?:\.\d+)?$/,Va=/^(?:true|false)$/i,Ba=/^null$/i;var Ua=/^undefined$/i;var Ja=/^[^A-Z]*$/,Za=/^[^a-z]*$/,Ka=/^[0-9a-fA-F]*$/;function Ar(e,n){return new RegExp(`^[A-Za-z0-9+/]{${e}}${n}$`)}function Tr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var ok=/^[0-9a-fA-F]{32}$/,ik=Ar(22,"=="),sk=Tr(22),ak=/^[0-9a-fA-F]{40}$/,ck=Ar(27,"="),lk=Tr(27),uk=/^[0-9a-fA-F]{64}$/,dk=Ar(43,"="),pk=Tr(43),fk=/^[0-9a-fA-F]{96}$/,hk=Ar(64,""),mk=Tr(64),yk=/^[0-9a-fA-F]{128}$/,gk=Ar(86,"=="),bk=Tr(86);var we=g("$ZodCheck",(e,n)=>{var t;e._zod??(e._zod={}),e._zod.def=n,(t=e._zod).onattach??(t.onattach=[])}),Wa=(e)=>{let n=e.value;return!ea(n)&&n.size!==void 0},Ha=(e)=>{let n=e.value;return!ea(n)&&n.length!==void 0},ri={number:"number",bigint:"bigint",object:"date"},Ga=g("$ZodCheckLessThan",(e,n)=>{we.init(e,n);let t=ri[typeof n.value];e._zod.check=(r)=>{if(n.inclusive?r.value<=n.value:r.value<n.value)return;r.issues.push({origin:ri[typeof r.value]??t,code:"too_big",maximum:typeof n.value==="object"?n.value.getTime():n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Qa=g("$ZodCheckGreaterThan",(e,n)=>{we.init(e,n);let t=ri[typeof n.value];e._zod.check=(r)=>{if(n.inclusive?r.value>=n.value:r.value>n.value)return;r.issues.push({origin:ri[typeof r.value]??t,code:"too_small",minimum:typeof n.value==="object"?n.value.getTime():n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),_p=g("$ZodCheckMultipleOf",(e,n)=>{we.init(e,n),e._zod.check=(t)=>{if(typeof t.value!==typeof n.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof t.value==="bigint"?n.value!==BigInt(0)&&t.value%n.value===BigInt(0):tp(t.value,n.value)===0)return;t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:n.value,input:t.value,inst:e,continue:!n.abort})}}),$p=g("$ZodCheckNumberFormat",(e,n)=>{we.init(e,n),n.format=n.format||"float64";let t=n.format?.includes("int"),r=t?"int":"number",[o,i]=Uo[n.format];e._zod.check=(s)=>{let a=s.value;if(t){if(!Number.isInteger(a)){s.issues.push({expected:r,format:n.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!n.abort});else s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!n.abort});return}}if(a<o)s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!n.abort});if(a>i)s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!n.abort})}}),Dp=g("$ZodCheckBigIntFormat",(e,n)=>{we.init(e,n);let[t,r]=Jo[n.format];e._zod.check=(o)=>{let i=o.value;if(i<t)o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:t,inclusive:!0,inst:e,continue:!n.abort});if(i>r)o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!n.abort})}}),Lp=g("$ZodCheckMaxSize",(e,n)=>{var t;we.init(e,n),(t=e._zod.def).when??(t.when=Wa),e._zod.check=(r)=>{let o=r.value;if(o.size<=n.maximum)return;r.issues.push({origin:Wo(o),code:"too_big",maximum:n.maximum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),Mp=g("$ZodCheckMinSize",(e,n)=>{var t;we.init(e,n),(t=e._zod.def).when??(t.when=Wa),e._zod.check=(r)=>{let o=r.value;if(o.size>=n.minimum)return;r.issues.push({origin:Wo(o),code:"too_small",minimum:n.minimum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),zp=g("$ZodCheckSizeEquals",(e,n)=>{var t;we.init(e,n),(t=e._zod.def).when??(t.when=Wa),e._zod.check=(r)=>{let o=r.value,i=o.size;if(i===n.size)return;let s=i>n.size;r.issues.push({origin:Wo(o),...s?{code:"too_big",maximum:n.size}:{code:"too_small",minimum:n.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!n.abort})}}),Fp=g("$ZodCheckMaxLength",(e,n)=>{var t;we.init(e,n),(t=e._zod.def).when??(t.when=Ha),e._zod.check=(r)=>{let o=r.value,i=o.length;if((typeof o==="string"&&i>n.maximum?Ho(o):i)<=n.maximum)return;let a=Go(o);r.issues.push({origin:a,code:"too_big",maximum:n.maximum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),qp=g("$ZodCheckMinLength",(e,n)=>{var t;we.init(e,n),(t=e._zod.def).when??(t.when=Ha),e._zod.check=(r)=>{let o=r.value,i=o.length;if((typeof o==="string"&&i>=n.minimum&&i<n.minimum*2?Ho(o):i)>=n.minimum)return;let a=Go(o);r.issues.push({origin:a,code:"too_small",minimum:n.minimum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),Vp=g("$ZodCheckLengthEquals",(e,n)=>{var t;we.init(e,n),(t=e._zod.def).when??(t.when=Ha),e._zod.check=(r)=>{let o=r.value,i=o.length,s=typeof o==="string"&&i>=n.length&&i<=n.length*2?Ho(o):i;if(s===n.length)return;let a=Go(o),c=s>n.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!n.abort})}}),Or=g("$ZodCheckStringFormat",(e,n)=>{var t,r;if(we.init(e,n),n.pattern)(t=e._zod).check??(t.check=(o)=>{if(n.pattern.lastIndex=0,n.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:n.format,input:o.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})});else(r=e._zod).check??(r.check=()=>{})}),Bp=g("$ZodCheckRegex",(e,n)=>{Or.init(e,n),e._zod.check=(t)=>{if(n.pattern.lastIndex=0,n.pattern.test(t.value))return;t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),Up=g("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=Ja),Or.init(e,n)}),Jp=g("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=Za),Or.init(e,n)}),Zp=g("$ZodCheckIncludes",(e,n)=>{we.init(e,n);let t=pt(n.includes),r=new RegExp(typeof n.position==="number"?`^.{${n.position},}${t}`:t);n.pattern=r,e._zod.check=(o)=>{if(o.value.includes(n.includes,n.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:o.value,inst:e,continue:!n.abort})}}),Kp=g("$ZodCheckStartsWith",(e,n)=>{we.init(e,n);let t=new RegExp(`^${pt(n.prefix)}.*`);n.pattern??(n.pattern=t),e._zod.check=(r)=>{if(r.value.startsWith(n.prefix))return;r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:r.value,inst:e,continue:!n.abort})}}),Wp=g("$ZodCheckEndsWith",(e,n)=>{we.init(e,n);let t=new RegExp(`.*${pt(n.suffix)}$`);n.pattern??(n.pattern=t),e._zod.check=(r)=>{if(r.value.endsWith(n.suffix))return;r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:r.value,inst:e,continue:!n.abort})}});function oi(e,n,t){if(e.issues.length)n.issues.push(...rt(t,e.issues))}var Hp=g("$ZodCheckProperty",(e,n)=>{we.init(e,n),e._zod.check=(t)=>{let r=n.schema._zod.run({value:t.value[n.property],issues:[]},{});if(r instanceof Promise)return r.then((o)=>oi(o,t,n.property));oi(r,t,n.property);return}}),Gp=g("$ZodCheckProperties",(e,n)=>{we.init(e,n),Sr(e,Symbol.iterator,function*(){yield e});let t;e._zod.check=(r)=>{if(r.value==null){r.issues.push({expected:"object",code:"invalid_type",input:r.value,inst:e});return}t??(t=Reflect.ownKeys(n.shape).map((s)=>[s,n.shape[s]]));let o=r.value,i;for(let[s,a]of t){let c=a._zod.run({value:o[s],issues:[]},{});if(c instanceof Promise)i??(i=[]),i.push(c.then((l)=>oi(l,r,s)));else oi(c,r,s)}if(i)return Promise.all(i).then(()=>{return});return}}),Qp=g("$ZodCheckMimeType",(e,n)=>{we.init(e,n);let t=new Set(n.mime);e._zod.check=(r)=>{if(t.has(r.value.type))return;r.issues.push({code:"invalid_value",values:n.mime,input:r.value.type,inst:e,continue:!n.abort})}}),Xp=g("$ZodCheckOverwrite",(e,n)=>{we.init(e,n),e._zod.check=(t)=>{t.value=n.tx(t.value)}});class Xa{constructor(e=[],n={}){this.content=[],this.indent=0,this.args=e,this.closed=n}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split(`
9
9
  `).filter((i)=>i),r=Math.min(...t.map((i)=>i.length-i.trimStart().length)),o=t.map((i)=>i.slice(r)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of o)this.content.push(i)}compile(){let e=Function,n=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
@@ -1191,6 +1191,11 @@
1191
1191
  height: 18px;
1192
1192
  }
1193
1193
 
1194
+ :where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .size-full {
1195
+ width: 100%;
1196
+ height: 100%;
1197
+ }
1198
+
1194
1199
  :where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .h-1 {
1195
1200
  height: var(--spacing);
1196
1201
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oomol-lab/open-flow",
3
- "version": "0.1.0-beta.88",
3
+ "version": "0.1.0-beta.89",
4
4
  "description": "TypeScript contracts and Browser runtime for Open Flow.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {