@kubb/agent 4.26.1 → 4.27.1

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,5 +1,5 @@
1
1
  {
2
- "date": "2026-02-20T09:55:19.475Z",
2
+ "date": "2026-02-22T01:38:54.241Z",
3
3
  "preset": "node-server",
4
4
  "framework": {
5
5
  "name": "nitro",
@@ -2,9 +2,9 @@ import process from 'node:process';globalThis._importMeta_=globalThis._importMet
2
2
  import https, { Server } from 'node:https';
3
3
  import { EventEmitter } from 'node:events';
4
4
  import { Buffer as Buffer$1 } from 'node:buffer';
5
- import fs$1, { promises, existsSync, readFileSync, writeFileSync } from 'node:fs';
5
+ import fs$1, { promises, existsSync, readFileSync, mkdirSync, writeFileSync } from 'node:fs';
6
6
  import path$1, { resolve, dirname, join, relative, normalize } from 'node:path';
7
- import { createHash } from 'node:crypto';
7
+ import nodeCrypto, { createHash } from 'node:crypto';
8
8
  import process$1, { version as version$2 } from 'node:process';
9
9
  import { orderBy } from 'natural-orderby';
10
10
  import { execaCommand, execa } from 'execa';
@@ -5516,6 +5516,21 @@ const logger = {
5516
5516
  }
5517
5517
  };
5518
5518
 
5519
+ function getMachineId() {
5520
+ const interfaces = os.networkInterfaces();
5521
+ const macs = [];
5522
+ for (const name in interfaces) {
5523
+ for (const iface of interfaces[name]) {
5524
+ if (!iface.internal && iface.mac !== "00:00:00:00:00:00") {
5525
+ macs.push(iface.mac);
5526
+ }
5527
+ }
5528
+ }
5529
+ const hostname = os.hostname();
5530
+ const rawId = macs.join(",") + hostname;
5531
+ return nodeCrypto.createHash("sha256").update(rawId).digest("hex");
5532
+ }
5533
+
5519
5534
  const CONFIG_DIR = path$1.join(os.homedir(), ".kubb");
5520
5535
  const CONFIG_FILE = path$1.join(CONFIG_DIR, "config.json");
5521
5536
  function loadAgentConfig() {
@@ -5528,14 +5543,8 @@ function loadAgentConfig() {
5528
5543
  }
5529
5544
  function saveAgentConfig(config) {
5530
5545
  try {
5531
- if (!CONFIG_DIR) {
5532
- return;
5533
- }
5534
- try {
5535
- writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2), "utf-8");
5536
- } catch {
5537
- return;
5538
- }
5546
+ mkdirSync(CONFIG_DIR, { recursive: true });
5547
+ writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2), "utf-8");
5539
5548
  } catch (_error) {
5540
5549
  logger.warn("Failed to save agent config");
5541
5550
  }
@@ -5614,7 +5623,8 @@ async function createAgentSession({ token, studioUrl, noCache }) {
5614
5623
  method: "POST",
5615
5624
  headers: {
5616
5625
  Authorization: `Bearer ${token}`
5617
- }
5626
+ },
5627
+ body: { machineId: getMachineId() }
5618
5628
  });
5619
5629
  if (data && !noCache) {
5620
5630
  cacheSession(token, data);
@@ -5627,6 +5637,21 @@ async function createAgentSession({ token, studioUrl, noCache }) {
5627
5637
  throw new Error("Failed to get agent session from Kubb Studio", { cause: error });
5628
5638
  }
5629
5639
  }
5640
+ async function registerAgent({ token, studioUrl }) {
5641
+ const machineId = getMachineId();
5642
+ try {
5643
+ await $fetch(`${studioUrl}/api/agent/register`, {
5644
+ method: "POST",
5645
+ headers: {
5646
+ Authorization: `Bearer ${token}`
5647
+ },
5648
+ body: { machineId }
5649
+ });
5650
+ logger.success("Agent registered with Studio");
5651
+ } catch (error) {
5652
+ throw new Error("Failed to register agent with Studio", { cause: error });
5653
+ }
5654
+ }
5630
5655
  async function disconnect({ sessionToken, token, studioUrl }) {
5631
5656
  try {
5632
5657
  const disconnectUrl = `${studioUrl}/api/agent/session/${sessionToken}/disconnect`;
@@ -5654,7 +5679,7 @@ var _b, _cache, _cwd, _SLASHES, _PackageManager_instances, match_fn;
5654
5679
  function isInputPath(config) {
5655
5680
  return typeof (config == null ? void 0 : config.input) === "object" && config.input !== null && "path" in config.input;
5656
5681
  }
5657
- var version$1 = "4.26.1";
5682
+ var version$1 = "4.27.1";
5658
5683
  function getDiagnosticInfo() {
5659
5684
  return {
5660
5685
  nodeVersion: version$2,
@@ -5720,7 +5745,7 @@ async function setup(options) {
5720
5745
  await clean(definedConfig.output.path);
5721
5746
  }
5722
5747
  const fabric = createFabric();
5723
- fabric.use(fsPlugin, { dryRun: !definedConfig.output.write });
5748
+ fabric.use(fsPlugin);
5724
5749
  fabric.use(typescriptParser);
5725
5750
  fabric.context.on("files:processing:start", (files) => {
5726
5751
  events.emit("files:processing:start", files);
@@ -5737,7 +5762,7 @@ async function setup(options) {
5737
5762
  source
5738
5763
  });
5739
5764
  if (source) {
5740
- await write(file.path, source, { sanity: false });
5765
+ if (definedConfig.output.write) await write(file.path, source, { sanity: false });
5741
5766
  sources.set(file.path, source);
5742
5767
  }
5743
5768
  });
@@ -6279,6 +6304,7 @@ const tsLoader = async (configFile) => {
6279
6304
  return mod;
6280
6305
  };
6281
6306
  async function getCosmiConfig(configPath) {
6307
+ var _a;
6282
6308
  try {
6283
6309
  const absolutePath = path$1.isAbsolute(configPath) ? configPath : path$1.resolve(process$1.cwd(), configPath);
6284
6310
  const mod = await tsLoader(absolutePath);
@@ -6287,10 +6313,48 @@ async function getCosmiConfig(configPath) {
6287
6313
  config: mod
6288
6314
  };
6289
6315
  } catch (error) {
6316
+ logger.error(`Config failed loading ${(_a = error == null ? void 0 : error.message) != null ? _a : error}`);
6290
6317
  throw new Error("Config failed loading", { cause: error });
6291
6318
  }
6292
6319
  }
6293
6320
 
6321
+ function getFactoryName(packageName) {
6322
+ const match = packageName.match(/\/plugin-(.+)$/);
6323
+ if (!match) {
6324
+ return packageName;
6325
+ }
6326
+ return `plugin-${match[1]}`.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
6327
+ }
6328
+ async function resolvePlugins(plugins) {
6329
+ return Promise.all(
6330
+ plugins.map(async ({ name, options }) => {
6331
+ const mod = await import(name);
6332
+ const factoryName = getFactoryName(name);
6333
+ const factory = mod[factoryName];
6334
+ if (typeof factory !== "function") {
6335
+ throw new Error(`Plugin factory "${factoryName}" not found in package "${name}"`);
6336
+ }
6337
+ return factory(options != null ? options : {});
6338
+ })
6339
+ );
6340
+ }
6341
+
6342
+ function readStudioConfig(configPath) {
6343
+ const studioConfigPath = path$1.join(path$1.dirname(configPath), "kubb.config.studio.json");
6344
+ if (!existsSync(studioConfigPath)) {
6345
+ return null;
6346
+ }
6347
+ try {
6348
+ return JSON.parse(readFileSync(studioConfigPath, "utf-8"));
6349
+ } catch {
6350
+ return null;
6351
+ }
6352
+ }
6353
+ function writeStudioConfig(configPath, config) {
6354
+ const studioConfigPath = path$1.join(path$1.dirname(configPath), "kubb.config.studio.json");
6355
+ writeFileSync(studioConfigPath, JSON.stringify(config, null, 2), "utf-8");
6356
+ }
6357
+
6294
6358
  const WEBSOCKET_READY = 1;
6295
6359
  const WEBSOCKET_CONNECTING = 0;
6296
6360
  function createWebsocket(url, options) {
@@ -6420,43 +6484,48 @@ function setupEventsStream(ws, events) {
6420
6484
  });
6421
6485
  }
6422
6486
 
6423
- var version = "4.26.1";
6487
+ var version = "4.27.1";
6424
6488
 
6425
6489
  const _zcw7I4pYH8OiCfaDcjy_x7I6IH1tLDQR3W_yRZgP6E = defineNitroPlugin(async (nitro) => {
6426
6490
  const studioUrl = process$1.env.KUBB_STUDIO_URL || "https://studio.kubb.dev";
6427
6491
  const token = process$1.env.KUBB_AGENT_TOKEN;
6428
- const configPath = process$1.env.KUBB_CONFIG || "kubb.config.ts";
6492
+ const configPath = process$1.env.KUBB_AGENT_CONFIG || "kubb.config.ts";
6429
6493
  const noCache = process$1.env.KUBB_AGENT_NO_CACHE === "true";
6430
- const retryInterval = process$1.env.KUBB_RETRY_TIMEOUT ? Number.parseInt(process$1.env.KUBB_RETRY_TIMEOUT, 10) : 3e4;
6494
+ const retryInterval = process$1.env.KUBB_AGENT_RETRY_TIMEOUT ? Number.parseInt(process$1.env.KUBB_AGENT_RETRY_TIMEOUT, 10) : 3e4;
6495
+ const root = process$1.env.KUBB_AGENT_ROOT || process$1.cwd();
6496
+ const allowAll = process$1.env.KUBB_AGENT_ALLOW_ALL === "true";
6497
+ const allowWrite = allowAll || process$1.env.KUBB_AGENT_ALLOW_WRITE === "true";
6431
6498
  if (!token) {
6432
6499
  logger.warn("KUBB_AGENT_TOKEN not set", "cannot authenticate with studio");
6433
6500
  return null;
6434
6501
  }
6435
- const result = await getCosmiConfig(configPath);
6436
- const configs = await getConfigs(result.config, {});
6437
- if (configs.length === 0) {
6438
- throw new Error("No configs found");
6439
- }
6440
- const config = configs[0];
6502
+ const resolvedConfigPath = path$1.isAbsolute(configPath) ? configPath : path$1.resolve(root, configPath);
6441
6503
  const events = new AsyncEventEmitter();
6504
+ async function loadConfig() {
6505
+ const result = await getCosmiConfig(resolvedConfigPath);
6506
+ const configs = await getConfigs(result.config, {});
6507
+ if (configs.length === 0) {
6508
+ throw new Error("No configs found");
6509
+ }
6510
+ return configs[0];
6511
+ }
6442
6512
  const wsOptions = {
6443
6513
  headers: {
6444
6514
  Authorization: `Bearer ${token}`
6445
6515
  }
6446
6516
  };
6447
- const root = process$1.env.KUBB_ROOT || config.root || process$1.cwd();
6448
6517
  events.on("hook:start", async ({ id, command, args }) => {
6449
6518
  const commandWithArgs = (args == null ? void 0 : args.length) ? `${command} ${args.join(" ")}` : command;
6450
6519
  if (!id) {
6451
6520
  return;
6452
6521
  }
6453
6522
  try {
6454
- const result2 = await execa(command, args, {
6523
+ const result = await execa(command, args, {
6455
6524
  cwd: root,
6456
6525
  detached: true,
6457
6526
  stripFinalNewline: true
6458
6527
  });
6459
- console.log(result2.stdout);
6528
+ console.log(result.stdout);
6460
6529
  await events.emit("hook:end", {
6461
6530
  command,
6462
6531
  args,
@@ -6532,57 +6601,58 @@ const _zcw7I4pYH8OiCfaDcjy_x7I6IH1tLDQR3W_yRZgP6E = defineNitroPlugin(async (nit
6532
6601
  }, 3e4);
6533
6602
  setupEventsStream(ws, events);
6534
6603
  ws.addEventListener("message", async (message) => {
6535
- var _a;
6536
- const data = JSON.parse(message.data);
6537
- if (isCommandMessage(data)) {
6538
- if (data.command === "generate") {
6539
- await generate({
6540
- config: {
6541
- ...config,
6542
- root
6543
- },
6544
- events
6545
- });
6546
- logger.success("Generated command success");
6547
- }
6548
- if (data.command === "connect") {
6549
- let specContent;
6550
- if (config && "path" in config.input) {
6551
- const specPath = path$1.resolve(process$1.cwd(), config.root, config.input.path);
6552
- try {
6553
- specContent = readFileSync(specPath, "utf-8");
6554
- } catch {
6555
- }
6556
- }
6557
- sendAgentMessage(ws, {
6558
- type: "connected",
6559
- payload: {
6560
- version,
6561
- configPath: process$1.env.KUBB_CONFIG || "",
6562
- spec: specContent,
6604
+ var _a, _b, _c;
6605
+ try {
6606
+ const data = JSON.parse(message.data);
6607
+ if (isCommandMessage(data)) {
6608
+ if (data.command === "generate") {
6609
+ const config = await loadConfig();
6610
+ const studioConfig = readStudioConfig(resolvedConfigPath);
6611
+ const patch = (_a = data.payload) != null ? _a : studioConfig;
6612
+ const resolvedPlugins = await resolvePlugins(patch.plugins);
6613
+ await generate({
6563
6614
  config: {
6564
- name: config.name,
6565
- root: config.root,
6566
- input: {
6567
- path: "path" in config.input ? config.input.path : void 0
6568
- },
6615
+ ...config,
6616
+ plugins: patch ? resolvedPlugins : config.plugins,
6617
+ root,
6569
6618
  output: {
6570
- path: config.output.path,
6571
- write: config.output.write,
6572
- extension: config.output.extension,
6573
- barrelType: config.output.barrelType
6619
+ ...config.output,
6620
+ write: allowWrite
6621
+ }
6622
+ },
6623
+ events
6624
+ });
6625
+ if (allowWrite) {
6626
+ writeStudioConfig(resolvedConfigPath, data.payload);
6627
+ }
6628
+ logger.success("Generated command success");
6629
+ }
6630
+ if (data.command === "connect") {
6631
+ const config = await loadConfig();
6632
+ sendAgentMessage(ws, {
6633
+ type: "connected",
6634
+ payload: {
6635
+ version,
6636
+ configPath,
6637
+ permissions: {
6638
+ allowAll,
6639
+ allowWrite
6574
6640
  },
6575
- plugins: (_a = config.plugins) == null ? void 0 : _a.map((plugin) => ({
6576
- name: `@kubb/${plugin.name}`,
6577
- options: serializePluginOptions(plugin.options)
6578
- }))
6641
+ config: {
6642
+ plugins: (_b = config.plugins) == null ? void 0 : _b.map((plugin) => ({
6643
+ name: `@kubb/${plugin.name}`,
6644
+ options: serializePluginOptions(plugin.options)
6645
+ }))
6646
+ }
6579
6647
  }
6580
- }
6581
- });
6648
+ });
6649
+ }
6650
+ return;
6582
6651
  }
6583
- return;
6652
+ logger.warn(`Unknown message type from Kubb Studio: ${message.data}`);
6653
+ } catch (error) {
6654
+ logger.error(`[unhandledRejection] ${(_c = error == null ? void 0 : error.message) != null ? _c : error}`);
6584
6655
  }
6585
- logger.warn(`Unknown message type from Kubb Studio: ${message.data}`);
6586
6656
  });
6587
6657
  } catch (error) {
6588
6658
  deleteCachedSession(token);
@@ -6590,6 +6660,7 @@ const _zcw7I4pYH8OiCfaDcjy_x7I6IH1tLDQR3W_yRZgP6E = defineNitroPlugin(async (nit
6590
6660
  await reconnectToStudio();
6591
6661
  }
6592
6662
  }
6663
+ await registerAgent({ token, studioUrl });
6593
6664
  await connectToStudio();
6594
6665
  });
6595
6666
 
@@ -1 +1 @@
1
- {"version":3,"file":"nitro.mjs","sources":["../../../../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs","../../../../../../node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs","../../../../../../node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs","../../../../../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs","../../../../../../node_modules/.pnpm/node-mock-http@1.0.4/node_modules/node-mock-http/dist/index.mjs","../../../../../../node_modules/.pnpm/h3@1.15.5/node_modules/h3/dist/index.mjs","../../../../../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs","../../../../../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/native.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/utils/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/fs-lite.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/storage.mjs","../../../../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/cache.mjs","../../../../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs","../../../../../../node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/config.mjs","../../../../../../node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/plugin.mjs","../../../../../core/dist/chunk-iVr_oF3V.js","../../../../../core/dist/fs-Parec-wn.js","../../../../../core/dist/transformers-8ju9ixkG.js","../../../../../core/dist/getBarrelFiles-gRyVPFBP.js","../../../../../core/dist/utils.js","../../../../server/types/agent.ts","../../../../server/utils/logger.ts","../../../../server/utils/sessionManager.ts","../../../../server/utils/api.ts","../../../../../core/dist/index.js","../../../../server/utils/executeHooks.ts","../../../../server/utils/generate.ts","../../../../server/utils/getCosmiConfig.ts","../../../../server/utils/ws.ts","../../../../server/plugins/studio.ts","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/presets/node/runtime/node-server.mjs"],"names":["createRouter","f","h","i","l","createError","mergeHeaders","s","nodeFetch","Headers","Headers$1","AbortController$1","normalizeKey","defineDriver","DRIVER_NAME","fsPromises","fsp","_inlineAppConfig","createRadixRouter","__defProp","_b","_options","__privateAdd","__privateGet","__privateSet","pLimit","path","_a","__privateMethod","version","fs","error","process","result","nitroApp","callNodeRequestHandler","fetchNodeRequestHandler","gracefulShutdown","HttpsServer","HttpServer"],"mappings":"","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,45,46,47,48]}
1
+ {"version":3,"file":"nitro.mjs","sources":["../../../../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs","../../../../../../node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs","../../../../../../node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs","../../../../../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs","../../../../../../node_modules/.pnpm/node-mock-http@1.0.4/node_modules/node-mock-http/dist/index.mjs","../../../../../../node_modules/.pnpm/h3@1.15.5/node_modules/h3/dist/index.mjs","../../../../../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs","../../../../../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/native.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/utils/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/fs-lite.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/storage.mjs","../../../../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/cache.mjs","../../../../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs","../../../../../../node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/config.mjs","../../../../../../node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/plugin.mjs","../../../../../core/dist/chunk-iVr_oF3V.js","../../../../../core/dist/fs-Parec-wn.js","../../../../../core/dist/transformers-8ju9ixkG.js","../../../../../core/dist/getBarrelFiles-gRyVPFBP.js","../../../../../core/dist/utils.js","../../../../server/types/agent.ts","../../../../server/utils/logger.ts","../../../../server/utils/machineId.ts","../../../../server/utils/sessionManager.ts","../../../../server/utils/api.ts","../../../../../core/dist/index.js","../../../../server/utils/executeHooks.ts","../../../../server/utils/generate.ts","../../../../server/utils/getCosmiConfig.ts","../../../../server/utils/resolvePlugins.ts","../../../../server/utils/studioConfig.ts","../../../../server/utils/ws.ts","../../../../server/plugins/studio.ts","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/presets/node/runtime/node-server.mjs"],"names":["createRouter","f","h","i","l","createError","mergeHeaders","s","nodeFetch","Headers","Headers$1","AbortController$1","normalizeKey","defineDriver","DRIVER_NAME","fsPromises","fsp","_inlineAppConfig","createRadixRouter","__defProp","_b","_options","__privateAdd","__privateGet","__privateSet","pLimit","path","_a","__privateMethod","crypto","version","fs","error","process","nitroApp","callNodeRequestHandler","fetchNodeRequestHandler","gracefulShutdown","HttpsServer","HttpServer"],"mappings":"","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,48,49,50,51]}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/agent-prod",
3
- "version": "4.26.1",
3
+ "version": "4.27.1",
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "dependencies": {
package/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/kubb-labs/kubb/main/assets/logo.png" alt="Kubb logo" width="200" />
3
+ </p>
4
+
1
5
  # @kubb/agent
2
6
 
3
7
  Kubb Agent Server — HTTP server for code generation powered by [Nitro](https://nitro.build) with WebSocket integration for real-time Studio communication.
@@ -9,6 +13,7 @@ Kubb Agent Server — HTTP server for code generation powered by [Nitro](https:/
9
13
  - 🔧 Easy integration with Kubb configuration
10
14
  - 📊 Health and info endpoints
11
15
  - 🔗 Bidirectional WebSocket with Kubb Studio
16
+ - 🖥️ Machine binding — token locked to the registered machine via stable `machineId`
12
17
  - 💾 Automatic session caching for faster reconnects
13
18
  - ⚡ Production-ready
14
19
 
@@ -41,38 +46,86 @@ kubb agent start --config kubb.config.ts --host 0.0.0.0 --port 8080 --no-cache
41
46
  If you need to start the server directly:
42
47
 
43
48
  ```bash
44
- KUBB_CONFIG=./kubb.config.ts node node_modules/@kubb/agent/.output/server/index.mjs
49
+ KUBB_AGENT_CONFIG=./kubb.config.ts node node_modules/@kubb/agent/.output/server/index.mjs
45
50
  ```
46
51
 
47
- The server will be available at `http://localhost:4000`.
52
+ The server will be available at `http://localhost:3000`.
53
+
54
+ ### Docker
55
+
56
+ Run the agent standalone, mounting your config file into the container:
57
+
58
+ ```bash
59
+ docker run --env-file .env \
60
+ -p 3000:3000 \
61
+ -v ./kubb.config.ts:/kubb/agent/kubb.config.ts \
62
+ kubblabs/kubb-agent
63
+ ```
64
+
65
+ ### Docker Compose
66
+
67
+ To run the full stack (Studio + Agent + Postgres), use the provided `docker-compose.yml`:
68
+
69
+ ```yaml
70
+ services:
71
+ agent:
72
+ image: kubblabs/kubb-agent:latest
73
+ ports:
74
+ - "3001:3000"
75
+ env_file:
76
+ - .env
77
+ environment:
78
+ PORT: 3000
79
+ KUBB_AGENT_ROOT: /kubb/agent
80
+ KUBB_AGENT_CONFIG: kubb.config.ts
81
+ KUBB_STUDIO_URL: http://kubb-studio:3000
82
+ volumes:
83
+ - ./kubb.config.ts:/kubb/agent/kubb.config.ts
84
+ depends_on:
85
+ studio:
86
+ condition: service_healthy
87
+ restart: unless-stopped
88
+ healthcheck:
89
+ test: ["CMD-SHELL", "wget -qO- http://localhost:3000/api/health || exit 1"]
90
+ interval: 30s
91
+ timeout: 5s
92
+ start_period: 10s
93
+ retries: 3
94
+ ```
95
+
96
+ ```bash
97
+ docker compose up
98
+ ```
48
99
 
49
100
  ### Environment Variables
50
101
 
51
- - `KUBB_CONFIG` - **Required**. Path to your Kubb configuration file (e.g., `./kubb.config.ts` or `./kubb.config.js`). Supports both TypeScript and JavaScript files. Can be relative or absolute.
52
- - `PORT` - Server port (default: `4000`)
53
- - `HOST` - Server host (default: `localhost`)
54
- - `KUBB_STUDIO_URL` - Studio connection URL (e.g., `http://localhost:3000`)
55
- - `KUBB_AGENT_TOKEN` - Authentication token for Studio connection
56
- - `KUBB_AGENT_NO_CACHE` - Disable session caching (set to `true` to skip cache)
102
+ | Variable | Default | Description |
103
+ |---|---|---|
104
+ | `KUBB_AGENT_CONFIG` | `kubb.config.ts` | Path to your Kubb config file. Relative paths are resolved against `KUBB_AGENT_ROOT`. |
105
+ | `KUBB_AGENT_ROOT` | `/kubb/agent` (Docker) / `cwd` | Root directory for resolving relative paths. |
106
+ | `PORT` | `3000` | Server port. |
107
+ | `HOST` | `0.0.0.0` | Server host. |
108
+ | `KUBB_STUDIO_URL` | `https://studio.kubb.dev` | Kubb Studio WebSocket URL. |
109
+ | `KUBB_AGENT_TOKEN` | _(empty)_ | Authentication token for Studio. Required to connect. |
110
+ | `KUBB_AGENT_NO_CACHE` | `false` | Set to `true` to disable session caching. |
111
+ | `KUBB_AGENT_ALLOW_WRITE` | `false` | Set to `true` to allow writing generated files to disk. |
112
+ | `KUBB_AGENT_ALLOW_ALL` | `false` | Set to `true` to grant all permissions (implies `KUBB_AGENT_ALLOW_WRITE=true`). |
113
+ | `KUBB_AGENT_RETRY_TIMEOUT` | `30000` | Milliseconds to wait before retrying a failed Studio connection. |
57
114
 
58
115
  ### Automatic .env Loading
59
116
 
60
- The agent automatically loads environment variables from:
61
- 1. `.env` - Base environment variables
62
- 2. `.env.local` - Local overrides (for secrets/local config)
63
-
64
- Files are optional and loaded in order, with `.env.local` taking precedence.
117
+ The agent automatically loads a `.env` file from the current working directory into `process.env` on startup. Variables already set in the environment take precedence.
65
118
 
66
119
  ## Quick Start
67
120
 
68
121
  1. **Create `.env` file:**
69
122
  ```env
70
- PORT=4000
71
- KUBB_ROOT=/Users/stijnvanhulle/GitHub/kubb/examples/react-query/
72
- KUBB_CONFIG=/Users/stijnvanhulle/GitHub/kubb/examples/react-query/kubb.config.ts
73
- KUBB_AGENT_TOKEN=
74
- KUBB_AGENT_NO_CACHE=true
75
- KUBB_STUDIO_URL=https://studio.kubb,dev
123
+ PORT=3000
124
+ KUBB_AGENT_ROOT=/path/to/your/project
125
+ KUBB_AGENT_CONFIG=/path/to/your/project/kubb.config.ts
126
+ KUBB_AGENT_TOKEN=your-token-here
127
+ KUBB_AGENT_NO_CACHE=false
128
+ KUBB_STUDIO_URL=https://studio.kubb.dev
76
129
  ```
77
130
 
78
131
  2. **Run the agent:**
@@ -82,12 +135,20 @@ npx kubb agent start
82
135
 
83
136
  3. **Agent is now available at:**
84
137
  ```
85
- http://localhost:4000
138
+ http://localhost:3000
86
139
  ```
87
140
 
88
141
  ## WebSocket Studio Integration
89
142
 
90
- The agent automatically connects to Kubb Studio on startup:
143
+ The agent connects to Kubb Studio on startup when `KUBB_AGENT_TOKEN` is set.
144
+
145
+ ### Startup Sequence
146
+
147
+ On startup the agent performs these steps before opening a WebSocket:
148
+
149
+ 1. **Register** — calls `POST /api/agent/register` with a stable `machineId` derived from the machine's network interfaces and hostname (SHA-256). This binds the token to the machine. If registration fails the agent throws and does not continue.
150
+ 2. **Create session** — calls `POST /api/agent/session/create` (includes `machineId` for verification) and receives a WebSocket URL.
151
+ 3. **Connect** — opens a WebSocket to the returned URL (appends `?machineId=` for server-side verification).
91
152
 
92
153
  ### Connection Features
93
154
 
@@ -109,51 +170,66 @@ Sessions are cached in `~/.kubb/config.json` for faster reconnects:
109
170
 
110
171
  ### Messages Sent by Agent
111
172
 
112
- **Connected**
173
+ **Connected** — sent in response to a `connect` command
113
174
  ```json
114
175
  {
115
176
  "type": "connected",
116
- "id": "unique-id",
117
177
  "payload": {
118
- "version": "4.24.0",
119
- "config": { /* full kubb config */ },
120
- "spec": "/* OpenAPI spec */"
178
+ "version": "x.x.x",
179
+ "configPath": "/app/kubb.config.ts",
180
+ "permissions": {
181
+ "allowAll": false,
182
+ "allowWrite": false
183
+ },
184
+ "config": {
185
+ "plugins": [
186
+ { "name": "@kubb/plugin-ts", "options": {} }
187
+ ]
188
+ }
121
189
  }
122
190
  }
123
191
  ```
124
192
 
125
- **Data Events (during generation)**
193
+ **Data Events** — streamed during code generation
126
194
  ```json
127
195
  {
128
196
  "type": "data",
129
- "id": "message-id",
130
- "event": "plugin:start",
131
- "payload": "{...}"
197
+ "payload": {
198
+ "type": "plugin:start",
199
+ "data": [{ "name": "plugin-ts" }],
200
+ "timestamp": 1708000000000
201
+ }
132
202
  }
133
203
  ```
134
204
 
135
- **Ping (every 30 seconds)**
205
+ Available `payload.type` values: `plugin:start`, `plugin:end`, `files:processing:start`, `file:processing:update`, `files:processing:end`, `generation:start`, `generation:end`, `info`, `success`, `warn`, `error`.
206
+
207
+ **Ping** — sent every 30 seconds to keep the connection alive
136
208
  ```json
137
- {
138
- "type": "ping"
139
- }
209
+ { "type": "ping" }
140
210
  ```
141
211
 
142
212
  ### Messages Received from Studio
143
213
 
144
- **Generate Command**
214
+ **Generate Command** — triggers code generation
145
215
  ```json
146
216
  {
147
217
  "type": "command",
148
- "command": "generate"
218
+ "command": "generate",
219
+ "payload": { "plugins": [] }
149
220
  }
150
221
  ```
222
+ `payload` is optional. When omitted, the agent uses the config loaded from disk.
151
223
 
152
- **Connect Command (resend info)**
224
+ **Connect Command** requests agent info
153
225
  ```json
154
226
  {
155
227
  "type": "command",
156
- "command": "connect"
228
+ "command": "connect",
229
+ "permissions": {
230
+ "allowAll": false,
231
+ "allowWrite": false
232
+ }
157
233
  }
158
234
  ```
159
235
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/agent",
3
- "version": "4.26.1",
3
+ "version": "4.27.1",
4
4
  "description": "Agent server for Kubb, enabling HTTP-based access to code generation capabilities.",
5
5
  "keywords": [
6
6
  "agent",
@@ -45,7 +45,21 @@
45
45
  "picocolors": "^1.1.1",
46
46
  "string-argv": "^0.3.2",
47
47
  "ws": "^8.19.0",
48
- "@kubb/core": "4.26.1"
48
+ "@kubb/core": "4.27.1",
49
+ "@kubb/plugin-client": "4.27.1",
50
+ "@kubb/plugin-cypress": "4.27.1",
51
+ "@kubb/plugin-msw": "4.27.1",
52
+ "@kubb/plugin-oas": "4.27.1",
53
+ "@kubb/plugin-faker": "4.27.1",
54
+ "@kubb/plugin-react-query": "4.27.1",
55
+ "@kubb/plugin-redoc": "4.27.1",
56
+ "@kubb/plugin-solid-query": "4.27.1",
57
+ "@kubb/plugin-svelte-query": "4.27.1",
58
+ "@kubb/plugin-swr": "4.27.1",
59
+ "@kubb/plugin-ts": "4.27.1",
60
+ "@kubb/plugin-mcp": "4.27.1",
61
+ "@kubb/plugin-vue-query": "4.27.1",
62
+ "@kubb/plugin-zod": "4.27.1"
49
63
  },
50
64
  "devDependencies": {
51
65
  "@types/ws": "^8.18.1",
@@ -1 +0,0 @@
1
- (()=>{var e={"./node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist lazy recursive":function(e){function webpackEmptyAsyncContext(e){return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}webpackEmptyAsyncContext.keys=()=>[],webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id="./node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist lazy recursive",e.exports=webpackEmptyAsyncContext}},t={};function __webpack_require__(i){var s=t[i];if(void 0!==s)return s.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,__webpack_require__),r.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};(()=>{"use strict";__webpack_require__.d(i,{default:()=>createJiti});const e=require("node:os");var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],s=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],r="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",n={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},a="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",o={5:a,"5module":a+" export import",6:a+" const class extends export import super"},h=/^in(stanceof)?$/,c=new RegExp("["+r+"]"),p=new RegExp("["+r+"‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・]");function isInAstralSet(e,t){for(var i=65536,s=0;s<t.length;s+=2){if((i+=t[s])>e)return!1;if((i+=t[s+1])>=e)return!0}return!1}function isIdentifierStart(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&c.test(String.fromCharCode(e)):!1!==t&&isInAstralSet(e,s)))}function isIdentifierChar(e,i){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&p.test(String.fromCharCode(e)):!1!==i&&(isInAstralSet(e,s)||isInAstralSet(e,t)))))}var acorn_TokenType=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function binop(e,t){return new acorn_TokenType(e,{beforeExpr:!0,binop:t})}var l={beforeExpr:!0},u={startsExpr:!0},d={};function kw(e,t){return void 0===t&&(t={}),t.keyword=e,d[e]=new acorn_TokenType(e,t)}var f={num:new acorn_TokenType("num",u),regexp:new acorn_TokenType("regexp",u),string:new acorn_TokenType("string",u),name:new acorn_TokenType("name",u),privateId:new acorn_TokenType("privateId",u),eof:new acorn_TokenType("eof"),bracketL:new acorn_TokenType("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new acorn_TokenType("]"),braceL:new acorn_TokenType("{",{beforeExpr:!0,startsExpr:!0}),braceR:new acorn_TokenType("}"),parenL:new acorn_TokenType("(",{beforeExpr:!0,startsExpr:!0}),parenR:new acorn_TokenType(")"),comma:new acorn_TokenType(",",l),semi:new acorn_TokenType(";",l),colon:new acorn_TokenType(":",l),dot:new acorn_TokenType("."),question:new acorn_TokenType("?",l),questionDot:new acorn_TokenType("?."),arrow:new acorn_TokenType("=>",l),template:new acorn_TokenType("template"),invalidTemplate:new acorn_TokenType("invalidTemplate"),ellipsis:new acorn_TokenType("...",l),backQuote:new acorn_TokenType("`",u),dollarBraceL:new acorn_TokenType("${",{beforeExpr:!0,startsExpr:!0}),eq:new acorn_TokenType("=",{beforeExpr:!0,isAssign:!0}),assign:new acorn_TokenType("_=",{beforeExpr:!0,isAssign:!0}),incDec:new acorn_TokenType("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new acorn_TokenType("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=/===/!==",6),relational:binop("</>/<=/>=",7),bitShift:binop("<</>>/>>>",8),plusMin:new acorn_TokenType("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new acorn_TokenType("**",{beforeExpr:!0}),coalesce:binop("??",1),_break:kw("break"),_case:kw("case",l),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",l),_do:kw("do",{isLoop:!0,beforeExpr:!0}),_else:kw("else",l),_finally:kw("finally"),_for:kw("for",{isLoop:!0}),_function:kw("function",u),_if:kw("if"),_return:kw("return",l),_switch:kw("switch"),_throw:kw("throw",l),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:!0}),_with:kw("with"),_new:kw("new",{beforeExpr:!0,startsExpr:!0}),_this:kw("this",u),_super:kw("super",u),_class:kw("class",u),_extends:kw("extends",l),_export:kw("export"),_import:kw("import",u),_null:kw("null",u),_true:kw("true",u),_false:kw("false",u),_in:kw("in",{beforeExpr:!0,binop:7}),_instanceof:kw("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},m=/\r\n?|\n|\u2028|\u2029/,g=new RegExp(m.source,"g");function isNewLine(e){return 10===e||13===e||8232===e||8233===e}function nextLineBreak(e,t,i){void 0===i&&(i=e.length);for(var s=t;s<i;s++){var r=e.charCodeAt(s);if(isNewLine(r))return s<i-1&&13===r&&10===e.charCodeAt(s+1)?s+2:s+1}return-1}var x=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,v=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,y=Object.prototype,_=y.hasOwnProperty,E=y.toString,b=Object.hasOwn||function(e,t){return _.call(e,t)},S=Array.isArray||function(e){return"[object Array]"===E.call(e)},k=Object.create(null);function wordsRegexp(e){return k[e]||(k[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}var w=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,acorn_Position=function(e,t){this.line=e,this.column=t};acorn_Position.prototype.offset=function(e){return new acorn_Position(this.line,this.column+e)};var acorn_SourceLocation=function(e,t,i){this.start=t,this.end=i,null!==e.sourceFile&&(this.source=e.sourceFile)};function getLineInfo(e,t){for(var i=1,s=0;;){var r=nextLineBreak(e,s,t);if(r<0)return new acorn_Position(i,t-s);++i,s=r}}var I={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},C=!1;function getOptions(e){var t={};for(var i in I)t[i]=e&&b(e,i)?e[i]:I[i];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!C&&"object"==typeof console&&console.warn&&(C=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),e&&null!=e.allowHashBang||(t.allowHashBang=t.ecmaVersion>=14),S(t.onToken)){var s=t.onToken;t.onToken=function(e){return s.push(e)}}return S(t.onComment)&&(t.onComment=function(e,t){return function(i,s,r,n,a,o){var h={type:i?"Block":"Line",value:s,start:r,end:n};e.locations&&(h.loc=new acorn_SourceLocation(this,a,o)),e.ranges&&(h.range=[r,n]),t.push(h)}}(t,t.onComment)),t}var R=256,P=259;function functionFlags(e,t){return 2|(e?4:0)|(t?8:0)}var acorn_Parser=function(e,t,i){this.options=e=getOptions(e),this.sourceFile=e.sourceFile,this.keywords=wordsRegexp(o[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var s="";!0!==e.allowReserved&&(s=n[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(s+=" await")),this.reservedWords=wordsRegexp(s);var r=(s?s+" ":"")+n.strict;this.reservedWordsStrict=wordsRegexp(r),this.reservedWordsStrictBind=wordsRegexp(r+" "+n.strictBind),this.input=String(t),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(m).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=f.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null,this.privateNameStack=[]},T={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};acorn_Parser.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},T.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},T.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},T.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},T.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t)return!1;if(2&t)return(4&t)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},T.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0||this.options.allowSuperOutsideMethod},T.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},T.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},T.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t||2&t&&!(16&t))return!0}return!1},T.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&R)>0},acorn_Parser.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,s=0;s<e.length;s++)i=e[s](i);return i},acorn_Parser.parse=function(e,t){return new this(t,e).parse()},acorn_Parser.parseExpressionAt=function(e,t,i){var s=new this(i,e,t);return s.nextToken(),s.parseExpression()},acorn_Parser.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(acorn_Parser.prototype,T);var A=acorn_Parser.prototype,N=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;A.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){v.lastIndex=e,e+=v.exec(this.input)[0].length;var t=N.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){v.lastIndex=e+t[0].length;var i=v.exec(this.input),s=i.index+i[0].length,r=this.input.charAt(s);return";"===r||"}"===r||m.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||"!"===r&&"="===this.input.charAt(s+1))}e+=t[0].length,v.lastIndex=e,e+=v.exec(this.input)[0].length,";"===this.input[e]&&e++}},A.eat=function(e){return this.type===e&&(this.next(),!0)},A.isContextual=function(e){return this.type===f.name&&this.value===e&&!this.containsEsc},A.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},A.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},A.canInsertSemicolon=function(){return this.type===f.eof||this.type===f.braceR||m.test(this.input.slice(this.lastTokEnd,this.start))},A.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},A.semicolon=function(){this.eat(f.semi)||this.insertSemicolon()||this.unexpected()},A.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},A.expect=function(e){this.eat(e)||this.unexpected()},A.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var acorn_DestructuringErrors=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};A.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}},A.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,s=e.doubleProto;if(!t)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")},A.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},A.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var L=acorn_Parser.prototype;L.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==f.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var s=0,r=Object.keys(this.undefinedExports);s<r.length;s+=1){var n=r[s];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var O={kind:"loop"},D={kind:"switch"};L.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;v.lastIndex=this.pos;var t=v.exec(this.input),i=this.pos+t[0].length,s=this.input.charCodeAt(i);if(91===s||92===s)return!0;if(e)return!1;if(123===s||s>55295&&s<56320)return!0;if(isIdentifierStart(s,!0)){for(var r=i+1;isIdentifierChar(s=this.input.charCodeAt(r),!0);)++r;if(92===s||s>55295&&s<56320)return!0;var n=this.input.slice(i,r);if(!h.test(n))return!0}return!1},L.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;v.lastIndex=this.pos;var e,t=v.exec(this.input),i=this.pos+t[0].length;return!(m.test(this.input.slice(this.pos,i))||"function"!==this.input.slice(i,i+8)||i+8!==this.input.length&&(isIdentifierChar(e=this.input.charCodeAt(i+8))||e>55295&&e<56320))},L.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;v.lastIndex=this.pos;var i=v.exec(this.input),s=this.pos+i[0].length;if(m.test(this.input.slice(this.pos,s)))return!1;if(e){var r,n=s+5;if("using"!==this.input.slice(s,n)||n===this.input.length||isIdentifierChar(r=this.input.charCodeAt(n))||r>55295&&r<56320)return!1;v.lastIndex=n;var a=v.exec(this.input);if(a&&m.test(this.input.slice(n,n+a[0].length)))return!1}if(t){var o,h=s+2;if(!("of"!==this.input.slice(s,h)||h!==this.input.length&&(isIdentifierChar(o=this.input.charCodeAt(h))||o>55295&&o<56320)))return!1}var c=this.input.charCodeAt(s);return isIdentifierStart(c,!0)||92===c},L.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},L.isUsing=function(e){return this.isUsingKeyword(!1,e)},L.parseStatement=function(e,t,i){var s,r=this.type,n=this.startNode();switch(this.isLet(e)&&(r=f._var,s="let"),r){case f._break:case f._continue:return this.parseBreakContinueStatement(n,r.keyword);case f._debugger:return this.parseDebuggerStatement(n);case f._do:return this.parseDoStatement(n);case f._for:return this.parseForStatement(n);case f._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(n,!1,!e);case f._class:return e&&this.unexpected(),this.parseClass(n,!0);case f._if:return this.parseIfStatement(n);case f._return:return this.parseReturnStatement(n);case f._switch:return this.parseSwitchStatement(n);case f._throw:return this.parseThrowStatement(n);case f._try:return this.parseTryStatement(n);case f._const:case f._var:return s=s||this.value,e&&"var"!==s&&this.unexpected(),this.parseVarStatement(n,s);case f._while:return this.parseWhileStatement(n);case f._with:return this.parseWithStatement(n);case f.braceL:return this.parseBlock(!0,n);case f.semi:return this.parseEmptyStatement(n);case f._export:case f._import:if(this.options.ecmaVersion>10&&r===f._import){v.lastIndex=this.pos;var a=v.exec(this.input),o=this.pos+a[0].length,h=this.input.charCodeAt(o);if(40===h||46===h)return this.parseExpressionStatement(n,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===f._import?this.parseImport(n):this.parseExport(n,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(n,!0,!e);var c=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(c)return t&&"script"===this.options.sourceType&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),"await using"===c&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(n,!1,c),this.semicolon(),this.finishNode(n,"VariableDeclaration");var p=this.value,l=this.parseExpression();return r===f.name&&"Identifier"===l.type&&this.eat(f.colon)?this.parseLabeledStatement(n,p,l,e):this.parseExpressionStatement(n,l)}},L.parseBreakContinueStatement=function(e,t){var i="break"===t;this.next(),this.eat(f.semi)||this.insertSemicolon()?e.label=null:this.type!==f.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var s=0;s<this.labels.length;++s){var r=this.labels[s];if(null==e.label||r.name===e.label.name){if(null!=r.kind&&(i||"loop"===r.kind))break;if(e.label&&i)break}}return s===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")},L.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},L.parseDoStatement=function(e){return this.next(),this.labels.push(O),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(f._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(f.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},L.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(O),this.enterScope(0),this.expect(f.parenL),this.type===f.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===f._var||this.type===f._const||i){var s=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),this.parseForAfterInit(e,s,t)}var n=this.isContextual("let"),a=!1,o=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(o){var h=this.startNode();return this.next(),"await using"===o&&this.next(),this.parseVar(h,!0,o),this.finishNode(h,"VariableDeclaration"),this.parseForAfterInit(e,h,t)}var c=this.containsEsc,p=new acorn_DestructuringErrors,l=this.start,u=t>-1?this.parseExprSubscripts(p,"await"):this.parseExpression(!0,p);return this.type===f._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===f._in&&this.unexpected(t),e.await=!0):a&&this.options.ecmaVersion>=8&&(u.start!==l||c||"Identifier"!==u.type||"async"!==u.name?this.options.ecmaVersion>=9&&(e.await=!1):this.unexpected()),n&&a&&this.raise(u.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(u,!1,p),this.checkLValPattern(u),this.parseForIn(e,u)):(this.checkExpressionErrors(p,!0),t>-1&&this.unexpected(t),this.parseFor(e,u))},L.parseForAfterInit=function(e,t,i){return(this.type===f._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===t.declarations.length?(this.options.ecmaVersion>=9&&(this.type===f._in?i>-1&&this.unexpected(i):e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))},L.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,U|(i?0:M),!1,t)},L.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(f._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},L.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(f.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},L.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(f.braceL),this.labels.push(D),this.enterScope(0);for(var i=!1;this.type!==f.braceR;)if(this.type===f._case||this.type===f._default){var s=this.type===f._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),s?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(f.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},L.parseThrowStatement=function(e){return this.next(),m.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var V=[];L.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t="Identifier"===e.type;return this.enterScope(t?32:0),this.checkLValPattern(e,t?4:2),this.expect(f.parenR),e},L.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===f._catch){var t=this.startNode();this.next(),this.eat(f.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(f._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},L.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")},L.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(O),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},L.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},L.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},L.parseLabeledStatement=function(e,t,i,s){for(var r=0,n=this.labels;r<n.length;r+=1){n[r].name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var a=this.type.isLoop?"loop":this.type===f._switch?"switch":null,o=this.labels.length-1;o>=0;o--){var h=this.labels[o];if(h.statementStart!==e.start)break;h.statementStart=this.start,h.kind=a}return this.labels.push({name:t,kind:a,statementStart:this.start}),e.body=this.parseStatement(s?-1===s.indexOf("label")?s+"label":s:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},L.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},L.parseBlock=function(e,t,i){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(f.braceL),e&&this.enterScope(0);this.type!==f.braceR;){var s=this.parseStatement(null);t.body.push(s)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},L.parseFor=function(e,t){return e.init=t,this.expect(f.semi),e.test=this.type===f.semi?null:this.parseExpression(),this.expect(f.semi),e.update=this.type===f.parenR?null:this.parseExpression(),this.expect(f.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},L.parseForIn=function(e,t){var i=this.type===f._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(f.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},L.parseVar=function(e,t,i,s){for(e.declarations=[],e.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(f.eq)?r.init=this.parseMaybeAssign(t):s||"const"!==i||this.type===f._in||this.options.ecmaVersion>=6&&this.isContextual("of")?s||"using"!==i&&"await using"!==i||!(this.options.ecmaVersion>=17)||this.type===f._in||this.isContextual("of")?s||"Identifier"===r.id.type||t&&(this.type===f._in||this.isContextual("of"))?r.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):this.unexpected(),e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(f.comma))break}return e},L.parseVarId=function(e,t){e.id="using"===t||"await using"===t?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?1:2,!1)};var U=1,M=2;function isPrivateNameConflicted(e,t){var i=t.key.name,s=e[i],r="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(r=(t.static?"s":"i")+t.kind),"iget"===s&&"iset"===r||"iset"===s&&"iget"===r||"sget"===s&&"sset"===r||"sset"===s&&"sget"===r?(e[i]="true",!1):!!s||(e[i]=r,!1)}function checkKeyName(e,t){var i=e.computed,s=e.key;return!i&&("Identifier"===s.type&&s.name===t||"Literal"===s.type&&s.value===t)}L.parseFunction=function(e,t,i,s,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===f.star&&t&M&&this.unexpected(),e.generator=this.eat(f.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&U&&(e.id=4&t&&this.type!==f.name?null:this.parseIdent(),!e.id||t&M||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var n=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags(e.async,e.generator)),t&U||(e.id=this.type===f.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,r),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&U?"FunctionDeclaration":"FunctionExpression")},L.parseFunctionParams=function(e){this.expect(f.parenL),e.params=this.parseBindingList(f.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},L.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var s=this.enterClassBody(),r=this.startNode(),n=!1;for(r.body=[],this.expect(f.braceL);this.type!==f.braceR;){var a=this.parseClassElement(null!==e.superClass);a&&(r.body.push(a),"MethodDefinition"===a.type&&"constructor"===a.kind?(n&&this.raiseRecoverable(a.start,"Duplicate constructor in the same class"),n=!0):a.key&&"PrivateIdentifier"===a.key.type&&isPrivateNameConflicted(s,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},L.parseClassElement=function(e){if(this.eat(f.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),s="",r=!1,n=!1,a="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(f.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===f.star?o=!0:s="static"}if(i.static=o,!s&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==f.star||this.canInsertSemicolon()?s="async":n=!0),!s&&(t>=9||!n)&&this.eat(f.star)&&(r=!0),!s&&!n&&!r){var h=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=h:s=h)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===f.parenL||"method"!==a||r||n){var c=!i.static&&checkKeyName(i,"constructor"),p=c&&e;c&&"method"!==a&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=c?"constructor":a,this.parseClassMethod(i,r,n,p)}else this.parseClassField(i);return i},L.isClassElementNameStart=function(){return this.type===f.name||this.type===f.privateId||this.type===f.num||this.type===f.string||this.type===f.bracketL||this.type.keyword},L.parseClassElementName=function(e){this.type===f.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},L.parseClassMethod=function(e,t,i,s){var r=e.key;"constructor"===e.kind?(t&&this.raise(r.start,"Constructor can't be a generator"),i&&this.raise(r.start,"Constructor can't be an async method")):e.static&&checkKeyName(e,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,i,s);return"get"===e.kind&&0!==n.params.length&&this.raiseRecoverable(n.start,"getter should have no params"),"set"===e.kind&&1!==n.params.length&&this.raiseRecoverable(n.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===n.params[0].type&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},L.parseClassField=function(e){return checkKeyName(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&checkKeyName(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(f.eq)?(this.enterScope(576),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},L.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==f.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},L.parseClassId=function(e,t){this.type===f.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},L.parseClassSuper=function(e){e.superClass=this.eat(f._extends)?this.parseExprSubscripts(null,!1):null},L.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},L.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var s=this.privateNameStack.length,r=0===s?null:this.privateNameStack[s-1],n=0;n<i.length;++n){var a=i[n];b(t,a.name)||(r?r.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}},L.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==f.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},L.parseExport=function(e,t){if(this.next(),this.eat(f.star))return this.parseExportAllDeclaration(e,t);if(this.eat(f._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==f.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,s=e.specifiers;i<s.length;i+=1){var r=s[i];this.checkUnreserved(r.local),this.checkLocalExport(r.local),"Literal"===r.local.type&&this.raise(r.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},L.parseExportDeclaration=function(e){return this.parseStatement(null)},L.parseExportDefaultDeclaration=function(){var e;if(this.type===f._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,4|U,!1,e)}if(this.type===f._class){var i=this.startNode();return this.parseClass(i,"nullableID")}var s=this.parseMaybeAssign();return this.semicolon(),s},L.checkExport=function(e,t,i){e&&("string"!=typeof t&&(t="Identifier"===t.type?t.name:t.value),b(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)},L.checkPatternExport=function(e,t){var i=t.type;if("Identifier"===i)this.checkExport(e,t,t.start);else if("ObjectPattern"===i)for(var s=0,r=t.properties;s<r.length;s+=1){var n=r[s];this.checkPatternExport(e,n)}else if("ArrayPattern"===i)for(var a=0,o=t.elements;a<o.length;a+=1){var h=o[a];h&&this.checkPatternExport(e,h)}else"Property"===i?this.checkPatternExport(e,t.value):"AssignmentPattern"===i?this.checkPatternExport(e,t.left):"RestElement"===i&&this.checkPatternExport(e,t.argument)},L.checkVariableExport=function(e,t){if(e)for(var i=0,s=t;i<s.length;i+=1){var r=s[i];this.checkPatternExport(e,r.id)}},L.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},L.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},L.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(f.braceL);!this.eat(f.braceR);){if(i)i=!1;else if(this.expect(f.comma),this.afterTrailingComma(f.braceR))break;t.push(this.parseExportSpecifier(e))}return t},L.parseImport=function(e){return this.next(),this.type===f.string?(e.specifiers=V,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===f.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},L.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportSpecifier")},L.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportDefaultSpecifier")},L.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportNamespaceSpecifier")},L.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===f.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(f.comma)))return e;if(this.type===f.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(f.braceL);!this.eat(f.braceR);){if(t)t=!1;else if(this.expect(f.comma),this.afterTrailingComma(f.braceR))break;e.push(this.parseImportSpecifier())}return e},L.parseWithClause=function(){var e=[];if(!this.eat(f._with))return e;this.expect(f.braceL);for(var t={},i=!0;!this.eat(f.braceR);){if(i)i=!1;else if(this.expect(f.comma),this.afterTrailingComma(f.braceR))break;var s=this.parseImportAttribute(),r="Identifier"===s.key.type?s.key.name:s.key.value;b(t,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),t[r]=!0,e.push(s)}return e},L.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===f.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved),this.expect(f.colon),this.type!==f.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},L.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===f.string){var e=this.parseLiteral(this.value);return w.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},L.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},L.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var j=acorn_Parser.prototype;j.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var s=0,r=e.properties;s<r.length;s+=1){var n=r[s];this.toAssignable(n,t),"RestElement"!==n.type||"ArrayPattern"!==n.argument.type&&"ObjectPattern"!==n.argument.type||this.raise(n.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e},j.toAssignableList=function(e,t){for(var i=e.length,s=0;s<i;s++){var r=e[s];r&&this.toAssignable(r,t)}if(i){var n=e[i-1];6===this.options.ecmaVersion&&t&&n&&"RestElement"===n.type&&"Identifier"!==n.argument.type&&this.unexpected(n.argument.start)}return e},j.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},j.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==f.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},j.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case f.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(f.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case f.braceL:return this.parseObj(!0)}return this.parseIdent()},j.parseBindingList=function(e,t,i,s){for(var r=[],n=!0;!this.eat(e);)if(n?n=!1:this.expect(f.comma),t&&this.type===f.comma)r.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===f.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),r.push(a),this.type===f.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}r.push(this.parseAssignableListItem(s))}return r},j.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},j.parseBindingListItem=function(e){return e},j.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(f.eq))return i;var s=this.startNodeAt(e,t);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")},j.checkLValSimple=function(e,t,i){void 0===t&&(t=0);var s=0!==t;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(s?"Binding ":"Assigning to ")+e.name+" in strict mode"),s&&(2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(b(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),5!==t&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":s&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return s&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(s?"Binding":"Assigning to")+" rvalue")}},j.checkLValPattern=function(e,t,i){switch(void 0===t&&(t=0),e.type){case"ObjectPattern":for(var s=0,r=e.properties;s<r.length;s+=1){var n=r[s];this.checkLValInnerPattern(n,t,i)}break;case"ArrayPattern":for(var a=0,o=e.elements;a<o.length;a+=1){var h=o[a];h&&this.checkLValInnerPattern(h,t,i)}break;default:this.checkLValSimple(e,t,i)}},j.checkLValInnerPattern=function(e,t,i){switch(void 0===t&&(t=0),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var acorn_TokContext=function(e,t,i,s,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!i,this.override=s,this.generator=!!r},F={b_stat:new acorn_TokContext("{",!1),b_expr:new acorn_TokContext("{",!0),b_tmpl:new acorn_TokContext("${",!1),p_stat:new acorn_TokContext("(",!1),p_expr:new acorn_TokContext("(",!0),q_tmpl:new acorn_TokContext("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new acorn_TokContext("function",!1),f_expr:new acorn_TokContext("function",!0),f_expr_gen:new acorn_TokContext("function",!0,!1,null,!0),f_gen:new acorn_TokContext("function",!1,!1,null,!0)},B=acorn_Parser.prototype;B.initialContext=function(){return[F.b_stat]},B.curContext=function(){return this.context[this.context.length-1]},B.braceIsBlock=function(e){var t=this.curContext();return t===F.f_expr||t===F.f_stat||(e!==f.colon||t!==F.b_stat&&t!==F.b_expr?e===f._return||e===f.name&&this.exprAllowed?m.test(this.input.slice(this.lastTokEnd,this.start)):e===f._else||e===f.semi||e===f.eof||e===f.parenR||e===f.arrow||(e===f.braceL?t===F.b_stat:e!==f._var&&e!==f._const&&e!==f.name&&!this.exprAllowed):!t.isExpr)},B.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},B.updateContext=function(e){var t,i=this.type;i.keyword&&e===f.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},B.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},f.parenR.updateContext=f.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===F.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},f.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?F.b_stat:F.b_expr),this.exprAllowed=!0},f.dollarBraceL.updateContext=function(){this.context.push(F.b_tmpl),this.exprAllowed=!0},f.parenL.updateContext=function(e){var t=e===f._if||e===f._for||e===f._with||e===f._while;this.context.push(t?F.p_stat:F.p_expr),this.exprAllowed=!0},f.incDec.updateContext=function(){},f._function.updateContext=f._class.updateContext=function(e){!e.beforeExpr||e===f._else||e===f.semi&&this.curContext()!==F.p_stat||e===f._return&&m.test(this.input.slice(this.lastTokEnd,this.start))||(e===f.colon||e===f.braceL)&&this.curContext()===F.b_stat?this.context.push(F.f_stat):this.context.push(F.f_expr),this.exprAllowed=!1},f.colon.updateContext=function(){"function"===this.curContext().token&&this.context.pop(),this.exprAllowed=!0},f.backQuote.updateContext=function(){this.curContext()===F.q_tmpl?this.context.pop():this.context.push(F.q_tmpl),this.exprAllowed=!1},f.star.updateContext=function(e){if(e===f._function){var t=this.context.length-1;this.context[t]===F.f_expr?this.context[t]=F.f_expr_gen:this.context[t]=F.f_gen}this.exprAllowed=!0},f.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==f.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var $=acorn_Parser.prototype;function isLocalVariableAccess(e){return"Identifier"===e.type||"ParenthesizedExpression"===e.type&&isLocalVariableAccess(e.expression)}function isPrivateFieldAccess(e){return"MemberExpression"===e.type&&"PrivateIdentifier"===e.property.type||"ChainExpression"===e.type&&isPrivateFieldAccess(e.expression)||"ParenthesizedExpression"===e.type&&isPrivateFieldAccess(e.expression)}$.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var s,r=e.key;switch(r.type){case"Identifier":s=r.name;break;case"Literal":s=String(r.value);break;default:return}var n=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===s&&"init"===n&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);else{var a=t[s="$"+s];if(a)("init"===n?this.strict&&a.init||a.get||a.set:a.init||a[n])&&this.raiseRecoverable(r.start,"Redefinition of property");else a=t[s]={init:!1,get:!1,set:!1};a[n]=!0}}},$.parseExpression=function(e,t){var i=this.start,s=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===f.comma){var n=this.startNodeAt(i,s);for(n.expressions=[r];this.eat(f.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return r},$.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var s=!1,r=-1,n=-1,a=-1;t?(r=t.parenthesizedAssign,n=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new acorn_DestructuringErrors,s=!0);var o=this.start,h=this.startLoc;this.type!==f.parenL&&this.type!==f.name||(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===e);var c=this.parseMaybeConditional(e,t);if(i&&(c=i.call(this,c,o,h)),this.type.isAssign){var p=this.startNodeAt(o,h);return p.operator=this.value,this.type===f.eq&&(c=this.toAssignable(c,!1,t)),s||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=c.start&&(t.shorthandAssign=-1),this.type===f.eq?this.checkLValPattern(c):this.checkLValSimple(c),p.left=c,this.next(),p.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(p,"AssignmentExpression")}return s&&this.checkExpressionErrors(t,!0),r>-1&&(t.parenthesizedAssign=r),n>-1&&(t.trailingComma=n),c},$.parseMaybeConditional=function(e,t){var i=this.start,s=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(this.eat(f.question)){var n=this.startNodeAt(i,s);return n.test=r,n.consequent=this.parseMaybeAssign(),this.expect(f.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return r},$.parseExprOps=function(e,t){var i=this.start,s=this.startLoc,r=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||r.start===i&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,i,s,-1,e)},$.parseExprOp=function(e,t,i,s,r){var n=this.type.binop;if(null!=n&&(!r||this.type!==f._in)&&n>s){var a=this.type===f.logicalOR||this.type===f.logicalAND,o=this.type===f.coalesce;o&&(n=f.logicalAND.binop);var h=this.value;this.next();var c=this.start,p=this.startLoc,l=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),c,p,n,r),u=this.buildBinary(t,i,e,l,h,a||o);return(a&&this.type===f.coalesce||o&&(this.type===f.logicalOR||this.type===f.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(u,t,i,s,r)}return e},$.buildBinary=function(e,t,i,s,r,n){"PrivateIdentifier"===s.type&&this.raise(s.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=i,a.operator=r,a.right=s,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")},$.parseMaybeUnary=function(e,t,i,s){var r,n=this.start,a=this.startLoc;if(this.isContextual("await")&&this.canAwait)r=this.parseAwait(s),t=!0;else if(this.type.prefix){var o=this.startNode(),h=this.type===f.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,h,s),this.checkExpressionErrors(e,!0),h?this.checkLValSimple(o.argument):this.strict&&"delete"===o.operator&&isLocalVariableAccess(o.argument)?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):"delete"===o.operator&&isPrivateFieldAccess(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,r=this.finishNode(o,h?"UpdateExpression":"UnaryExpression")}else if(t||this.type!==f.privateId){if(r=this.parseExprSubscripts(e,s),this.checkExpressionErrors(e))return r;for(;this.type.postfix&&!this.canInsertSemicolon();){var c=this.startNodeAt(n,a);c.operator=this.value,c.prefix=!1,c.argument=r,this.checkLValSimple(r),this.next(),r=this.finishNode(c,"UpdateExpression")}}else(s||0===this.privateNameStack.length)&&this.options.checkPrivateFields&&this.unexpected(),r=this.parsePrivateIdent(),this.type!==f._in&&this.unexpected();return i||!this.eat(f.starstar)?r:t?void this.unexpected(this.lastTokStart):this.buildBinary(n,a,r,this.parseMaybeUnary(null,!1,!1,s),"**",!1)},$.parseExprSubscripts=function(e,t){var i=this.start,s=this.startLoc,r=this.parseExprAtom(e,t);if("ArrowFunctionExpression"===r.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return r;var n=this.parseSubscripts(r,i,s,!1,t);return e&&"MemberExpression"===n.type&&(e.parenthesizedAssign>=n.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=n.start&&(e.parenthesizedBind=-1),e.trailingComma>=n.start&&(e.trailingComma=-1)),n},$.parseSubscripts=function(e,t,i,s,r){for(var n=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var o=this.parseSubscript(e,t,i,s,n,a,r);if(o.optional&&(a=!0),o===e||"ArrowFunctionExpression"===o.type){if(a){var h=this.startNodeAt(t,i);h.expression=o,o=this.finishNode(h,"ChainExpression")}return o}e=o}},$.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(f.arrow)},$.parseSubscriptAsyncArrow=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,s)},$.parseSubscript=function(e,t,i,s,r,n,a){var o=this.options.ecmaVersion>=11,h=o&&this.eat(f.questionDot);s&&h&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(f.bracketL);if(c||h&&this.type!==f.parenL&&this.type!==f.backQuote||this.eat(f.dot)){var p=this.startNodeAt(t,i);p.object=e,c?(p.property=this.parseExpression(),this.expect(f.bracketR)):this.type===f.privateId&&"Super"!==e.type?p.property=this.parsePrivateIdent():p.property=this.parseIdent("never"!==this.options.allowReserved),p.computed=!!c,o&&(p.optional=h),e=this.finishNode(p,"MemberExpression")}else if(!s&&this.eat(f.parenL)){var l=new acorn_DestructuringErrors,u=this.yieldPos,d=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var g=this.parseExprList(f.parenR,this.options.ecmaVersion>=8,!1,l);if(r&&!h&&this.shouldParseAsyncArrow())return this.checkPatternErrors(l,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=u,this.awaitPos=d,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,i,g,a);this.checkExpressionErrors(l,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=d||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var x=this.startNodeAt(t,i);x.callee=e,x.arguments=g,o&&(x.optional=h),e=this.finishNode(x,"CallExpression")}else if(this.type===f.backQuote){(h||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var v=this.startNodeAt(t,i);v.tag=e,v.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(v,"TaggedTemplateExpression")}return e},$.parseExprAtom=function(e,t,i){this.type===f.slash&&this.readRegexp();var s,r=this.potentialArrowAt===this.start;switch(this.type){case f._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),s=this.startNode(),this.next(),this.type!==f.parenL||this.allowDirectSuper||this.raise(s.start,"super() call outside constructor of a subclass"),this.type!==f.dot&&this.type!==f.bracketL&&this.type!==f.parenL&&this.unexpected(),this.finishNode(s,"Super");case f._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case f.name:var n=this.start,a=this.startLoc,o=this.containsEsc,h=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&"async"===h.name&&!this.canInsertSemicolon()&&this.eat(f._function))return this.overrideContext(F.f_expr),this.parseFunction(this.startNodeAt(n,a),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(f.arrow))return this.parseArrowExpression(this.startNodeAt(n,a),[h],!1,t);if(this.options.ecmaVersion>=8&&"async"===h.name&&this.type===f.name&&!o&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return h=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(f.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,a),[h],!0,t)}return h;case f.regexp:var c=this.value;return(s=this.parseLiteral(c.value)).regex={pattern:c.pattern,flags:c.flags},s;case f.num:case f.string:return this.parseLiteral(this.value);case f._null:case f._true:case f._false:return(s=this.startNode()).value=this.type===f._null?null:this.type===f._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case f.parenL:var p=this.start,l=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(e.parenthesizedAssign=p),e.parenthesizedBind<0&&(e.parenthesizedBind=p)),l;case f.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(f.bracketR,!0,!0,e),this.finishNode(s,"ArrayExpression");case f.braceL:return this.overrideContext(F.b_expr),this.parseObj(!1,e);case f._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case f._class:return this.parseClass(this.startNode(),!1);case f._new:return this.parseNew();case f.backQuote:return this.parseTemplate();case f._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}},$.parseExprAtomDefault=function(){this.unexpected()},$.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===f.parenL&&!e)return this.parseDynamicImport(t);if(this.type===f.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}this.unexpected()},$.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(f.parenR)?e.options=null:(this.expect(f.comma),this.afterTrailingComma(f.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(f.parenR)||(this.expect(f.comma),this.afterTrailingComma(f.parenR)||this.unexpected())));else if(!this.eat(f.parenR)){var t=this.start;this.eat(f.comma)&&this.eat(f.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},$.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},$.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=null!=t.value?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},$.parseParenExpression=function(){this.expect(f.parenL);var e=this.parseExpression();return this.expect(f.parenR),e},$.shouldParseArrow=function(e){return!this.canInsertSemicolon()},$.parseParenAndDistinguishExpression=function(e,t){var i,s=this.start,r=this.startLoc,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a,o=this.start,h=this.startLoc,c=[],p=!0,l=!1,u=new acorn_DestructuringErrors,d=this.yieldPos,m=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==f.parenR;){if(p?p=!1:this.expect(f.comma),n&&this.afterTrailingComma(f.parenR,!0)){l=!0;break}if(this.type===f.ellipsis){a=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===f.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(!1,u,this.parseParenItem))}var g=this.lastTokEnd,x=this.lastTokEndLoc;if(this.expect(f.parenR),e&&this.shouldParseArrow(c)&&this.eat(f.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=m,this.parseParenArrowList(s,r,c,t);c.length&&!l||this.unexpected(this.lastTokStart),a&&this.unexpected(a),this.checkExpressionErrors(u,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=m||this.awaitPos,c.length>1?((i=this.startNodeAt(o,h)).expressions=c,this.finishNodeAt(i,"SequenceExpression",g,x)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var v=this.startNodeAt(s,r);return v.expression=i,this.finishNode(v,"ParenthesizedExpression")}return i},$.parseParenItem=function(e){return e},$.parseParenArrowList=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,s)};var q=[];$.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===f.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var s=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,r,!0,!1),this.eat(f.parenL)?e.arguments=this.parseExprList(f.parenR,this.options.ecmaVersion>=8,!1):e.arguments=q,this.finishNode(e,"NewExpression")},$.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===f.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===f.backQuote,this.finishNode(i,"TemplateElement")},$.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:t});for(i.quasis=[s];!s.tail;)this.type===f.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(f.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(f.braceR),i.quasis.push(s=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},$.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===f.name||this.type===f.num||this.type===f.string||this.type===f.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===f.star)&&!m.test(this.input.slice(this.lastTokEnd,this.start))},$.parseObj=function(e,t){var i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(f.braceR);){if(s)s=!1;else if(this.expect(f.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(f.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,r,t),i.properties.push(n)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")},$.parseProperty=function(e,t){var i,s,r,n,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(f.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===f.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(a.argument=this.parseMaybeAssign(!1,t),this.type===f.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(e||t)&&(r=this.start,n=this.startLoc),e||(i=this.eat(f.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(a)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(f.star),this.parsePropertyName(a)):s=!1,this.parsePropertyValue(a,e,i,s,r,n,t,o),this.finishNode(a,"Property")},$.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var i="get"===e.kind?0:1;if(e.value.params.length!==i){var s=e.value.start;"get"===e.kind?this.raiseRecoverable(s,"getter should have no params"):this.raiseRecoverable(s,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},$.parsePropertyValue=function(e,t,i,s,r,n,a,o){(i||s)&&this.type===f.colon&&this.unexpected(),this.eat(f.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init"):this.options.ecmaVersion>=6&&this.type===f.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(i,s),e.kind="init"):t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===f.comma||this.type===f.braceR||this.type===f.eq?this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((i||s)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=r),t?e.value=this.parseMaybeDefault(r,n,this.copyNode(e.key)):this.type===f.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected():((i||s)&&this.unexpected(),this.parseGetterSetter(e))},$.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(f.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(f.bracketR),e.key;e.computed=!1}return e.key=this.type===f.num||this.type===f.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},$.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},$.parseMethod=function(e,t,i){var s=this.startNode(),r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=e),this.options.ecmaVersion>=8&&(s.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|functionFlags(t,s.generator)|(i?128:0)),this.expect(f.parenL),s.params=this.parseBindingList(f.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(s,"FunctionExpression")},$.parseArrowExpression=function(e,t,i,s){var r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(16|functionFlags(i,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,s),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")},$.parseFunctionBody=function(e,t,i,s){var r=t&&this.type!==f.braceL,n=this.strict,a=!1;if(r)e.body=this.parseMaybeAssign(s),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);n&&!o||(a=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var h=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!n&&!a&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,a&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=h}this.exitScope()},$.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){if("Identifier"!==i[t].type)return!1}return!0},$.checkParams=function(e,t){for(var i=Object.create(null),s=0,r=e.params;s<r.length;s+=1){var n=r[s];this.checkLValInnerPattern(n,1,t?null:i)}},$.parseExprList=function(e,t,i,s){for(var r=[],n=!0;!this.eat(e);){if(n)n=!1;else if(this.expect(f.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===f.comma?a=null:this.type===f.ellipsis?(a=this.parseSpread(s),s&&this.type===f.comma&&s.trailingComma<0&&(s.trailingComma=this.start)):a=this.parseMaybeAssign(!1,s),r.push(a)}return r},$.checkUnreserved=function(e){var t=e.start,i=e.end,s=e.name;(this.inGenerator&&"yield"===s&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===s&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().flags&P||"arguments"!==s||this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),!this.inClassStaticBlock||"arguments"!==s&&"await"!==s||this.raise(t,"Cannot use "+s+" in class static initialization block"),this.keywords.test(s)&&this.raise(t,"Unexpected keyword '"+s+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,i).indexOf("\\"))||(this.strict?this.reservedWordsStrict:this.reservedWords).test(s)&&(this.inAsync||"await"!==s||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+s+"' is reserved"))},$.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),"await"!==t.name||this.awaitIdentPos||(this.awaitIdentPos=t.start)),t},$.parseIdentNode=function(){var e=this.startNode();return this.type===f.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,"class"!==e.name&&"function"!==e.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop(),this.type=f.name):this.unexpected(),e},$.parsePrivateIdent=function(){var e=this.startNode();return this.type===f.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(0===this.privateNameStack.length?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},$.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===f.semi||this.canInsertSemicolon()||this.type!==f.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(f.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},$.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var W=acorn_Parser.prototype;W.raise=function(e,t){var i=getLineInfo(this.input,e);t+=" ("+i.line+":"+i.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var s=new SyntaxError(t);throw s.pos=e,s.loc=i,s.raisedAt=this.pos,s},W.raiseRecoverable=W.raise,W.curPosition=function(){if(this.options.locations)return new acorn_Position(this.curLine,this.pos-this.lineStart)};var G=acorn_Parser.prototype,acorn_Scope=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};G.enterScope=function(e){this.scopeStack.push(new acorn_Scope(e))},G.exitScope=function(){this.scopeStack.pop()},G.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},G.declareName=function(e,t,i){var s=!1;if(2===t){var r=this.currentScope();s=r.lexical.indexOf(e)>-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&1&r.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var n=this.currentScope();s=this.treatFunctionsAsVar?n.lexical.indexOf(e)>-1:n.lexical.indexOf(e)>-1||n.var.indexOf(e)>-1,n.functions.push(e)}else for(var a=this.scopeStack.length-1;a>=0;--a){var o=this.scopeStack[a];if(o.lexical.indexOf(e)>-1&&!(32&o.flags&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){s=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],o.flags&P)break}s&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")},G.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},G.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},G.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags)return t}},G.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags&&!(16&t.flags))return t}};var acorn_Node=function(e,t,i){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new acorn_SourceLocation(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},H=acorn_Parser.prototype;function finishNodeAt(e,t,i,s){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=s),this.options.ranges&&(e.range[1]=i),e}H.startNode=function(){return new acorn_Node(this,this.start,this.startLoc)},H.startNodeAt=function(e,t){return new acorn_Node(this,e,t)},H.finishNode=function(e,t){return finishNodeAt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},H.finishNodeAt=function(e,t,i,s){return finishNodeAt.call(this,e,t,i,s)},H.copyNode=function(e){var t=new acorn_Node(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var K="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",z=K+" Extended_Pictographic",J=z+" EBase EComp EMod EPres ExtPict",Y={9:K,10:z,11:z,12:J,13:J,14:J},Q={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},Z="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",X="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ee=X+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",te=ee+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",ie=te+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",se=ie+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",re={9:X,10:ee,11:te,12:ie,13:se,14:se+" Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz"},ne={};function buildUnicodeData(e){var t=ne[e]={binary:wordsRegexp(Y[e]+" "+Z),binaryOfStrings:wordsRegexp(Q[e]),nonBinary:{General_Category:wordsRegexp(Z),Script:wordsRegexp(re[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var ae=0,oe=[9,10,11,12,13,14];ae<oe.length;ae+=1){buildUnicodeData(oe[ae])}var he=acorn_Parser.prototype,acorn_BranchID=function(e,t){this.parent=e,this.base=t||this};acorn_BranchID.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var i=e;i;i=i.parent)if(t.base===i.base&&t!==i)return!0;return!1},acorn_BranchID.prototype.sibling=function(){return new acorn_BranchID(this.parent,this.base)};var acorn_RegExpValidationState=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=ne[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function isRegularExpressionModifier(e){return 105===e||109===e||115===e}function isSyntaxCharacter(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function isControlLetter(e){return e>=65&&e<=90||e>=97&&e<=122}acorn_RegExpValidationState.prototype.reset=function(e,t,i){var s=-1!==i.indexOf("v"),r=-1!==i.indexOf("u");this.start=0|e,this.source=t+"",this.flags=i,s&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=r&&this.parser.options.ecmaVersion>=9)},acorn_RegExpValidationState.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},acorn_RegExpValidationState.prototype.at=function(e,t){void 0===t&&(t=!1);var i=this.source,s=i.length;if(e>=s)return-1;var r=i.charCodeAt(e);if(!t&&!this.switchU||r<=55295||r>=57344||e+1>=s)return r;var n=i.charCodeAt(e+1);return n>=56320&&n<=57343?(r<<10)+n-56613888:r},acorn_RegExpValidationState.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var i=this.source,s=i.length;if(e>=s)return s;var r,n=i.charCodeAt(e);return!t&&!this.switchU||n<=55295||n>=57344||e+1>=s||(r=i.charCodeAt(e+1))<56320||r>57343?e+1:e+2},acorn_RegExpValidationState.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},acorn_RegExpValidationState.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},acorn_RegExpValidationState.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},acorn_RegExpValidationState.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},acorn_RegExpValidationState.prototype.eatChars=function(e,t){void 0===t&&(t=!1);for(var i=this.pos,s=0,r=e;s<r.length;s+=1){var n=r[s],a=this.at(i,t);if(-1===a||a!==n)return!1;i=this.nextIndex(i,t)}return this.pos=i,!0},he.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,s=!1,r=!1,n=0;n<i.length;n++){var a=i.charAt(n);-1===t.indexOf(a)&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(a,n+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),"u"===a&&(s=!0),"v"===a&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(e.start,"Invalid regular expression flag")},he.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&function(e){for(var t in e)return!0;return!1}(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},he.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var s=i[t];e.groupNames[s]||e.raise("Invalid named capture referenced")}},he.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new acorn_BranchID(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},he.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},he.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},he.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1},he.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},he.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},he.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var s=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return-1!==r&&r<s&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1},he.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},he.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},he.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),s=e.eat(45);if(i||s){for(var r=0;r<i.length;r++){var n=i.charAt(r);i.indexOf(n,r+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(s){var a=this.regexp_eatModifiers(e);i||a||58!==e.current()||e.raise("Invalid regular expression modifiers");for(var o=0;o<a.length;o++){var h=a.charAt(o);(a.indexOf(h,o+1)>-1||i.indexOf(h)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},he.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},he.regexp_eatModifiers=function(e){for(var t="",i=0;-1!==(i=e.current())&&isRegularExpressionModifier(i);)t+=codePointToString(i),e.advance();return t},he.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},he.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},he.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!isSyntaxCharacter(t)&&(e.lastIntValue=t,e.advance(),!0)},he.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!isSyntaxCharacter(i);)e.advance();return e.pos!==t},he.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},he.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var s=0,r=i;s<r.length;s+=1){r[s].separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},he.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},he.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=codePointToString(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=codePointToString(e.lastIntValue);return!0}return!1},he.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),92===s&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),function(e){return isIdentifierStart(e,!0)||36===e||95===e}(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)},he.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),92===s&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),function(e){return isIdentifierChar(e,!0)||36===e||95===e||8204===e||8205===e}(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)},he.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},he.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1},he.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},he.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},he.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},he.regexp_eatZero=function(e){return 48===e.current()&&!isDecimalDigit(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},he.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},he.regexp_eatControlLetter=function(e){var t=e.current();return!!isControlLetter(t)&&(e.lastIntValue=t%32,e.advance(),!0)},he.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var i,s=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(r&&n>=55296&&n<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=1024*(n-55296)+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=n}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((i=e.lastIntValue)>=0&&i<=1114111))return!0;r&&e.raise("Invalid unicode escape"),e.pos=s}return!1},he.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},he.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};function isUnicodePropertyNameCharacter(e){return isControlLetter(e)||95===e}function isUnicodePropertyValueCharacter(e){return isUnicodePropertyNameCharacter(e)||isDecimalDigit(e)}function isDecimalDigit(e){return e>=48&&e<=57}function isHexDigit(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function hexToInt(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function isOctalDigit(e){return e>=48&&e<=55}he.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),1;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=80===t)||112===t)){var s;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(s=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&2===s&&e.raise("Invalid property name"),s;e.raise("Invalid property name")}return 0},he.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,s),1}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r)}return 0},he.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){b(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},he.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?1:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?2:void e.raise("Invalid property name")},he.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";isUnicodePropertyNameCharacter(t=e.current());)e.lastStringValue+=codePointToString(t),e.advance();return""!==e.lastStringValue},he.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";isUnicodePropertyValueCharacter(t=e.current());)e.lastStringValue+=codePointToString(t),e.advance();return""!==e.lastStringValue},he.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},he.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&2===i&&e.raise("Negated character class may contain strings"),!0}return!1},he.regexp_classContents=function(e){return 93===e.current()?1:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),1)},he.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;!e.switchU||-1!==t&&-1!==i||e.raise("Invalid character class"),-1!==t&&-1!==i&&t>i&&e.raise("Range out of order in character class")}}},he.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(99===i||isOctalDigit(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var s=e.current();return 93!==s&&(e.lastIntValue=s,e.advance(),!0)},he.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},he.regexp_classSetExpression=function(e){var t,i=1;if(this.regexp_eatClassSetRange(e));else if(t=this.regexp_eatClassSetOperand(e)){2===t&&(i=2);for(var s=e.pos;e.eatChars([38,38]);)38!==e.current()&&(t=this.regexp_eatClassSetOperand(e))?2!==t&&(i=1):e.raise("Invalid character in character class");if(s!==e.pos)return i;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(s!==e.pos)return i}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return i;2===t&&(i=2)}},he.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var s=e.lastIntValue;return-1!==i&&-1!==s&&i>s&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},he.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?1:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},he.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),s=this.regexp_classContents(e);if(e.eat(93))return i&&2===s&&e.raise("Negated character class may contain strings"),s;e.pos=t}if(e.eat(92)){var r=this.regexp_eatCharacterClassEscape(e);if(r)return r;e.pos=t}return null},he.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t}return null},he.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)2===this.regexp_classString(e)&&(t=2);return t},he.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return 1===t?1:2},he.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e))||(e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1));var i=e.current();return!(i<0||i===e.lookahead()&&function(e){return 33===e||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e}(i))&&(!function(e){return 40===e||41===e||45===e||47===e||e>=91&&e<=93||e>=123&&e<=125}(i)&&(e.advance(),e.lastIntValue=i,!0))},he.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!function(e){return 33===e||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e}(t)&&(e.lastIntValue=t,e.advance(),!0)},he.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!isDecimalDigit(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},he.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},he.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;isDecimalDigit(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},he.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;isHexDigit(i=e.current());)e.lastIntValue=16*e.lastIntValue+hexToInt(i),e.advance();return e.pos!==t},he.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*i+e.lastIntValue:e.lastIntValue=8*t+i}else e.lastIntValue=t;return!0}return!1},he.regexp_eatOctalDigit=function(e){var t=e.current();return isOctalDigit(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},he.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var s=0;s<t;++s){var r=e.current();if(!isHexDigit(r))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+hexToInt(r),e.advance()}return!0};var acorn_Token=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new acorn_SourceLocation(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},ce=acorn_Parser.prototype;function stringToBigInt(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}ce.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new acorn_Token(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},ce.getToken=function(){return this.next(),new acorn_Token(this)},"undefined"!=typeof Symbol&&(ce[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===f.eof,value:t}}}}),ce.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(f.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},ce.readToken=function(e){return isIdentifierStart(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},ce.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},ce.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var s=void 0,r=t;(s=nextLineBreak(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=s;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())},ce.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!isNewLine(s);)s=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())},ce.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&x.test(String.fromCharCode(e))))break e;++this.pos}}},ce.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)},ce.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(f.ellipsis)):(++this.pos,this.finishToken(f.dot))},ce.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(f.assign,2):this.finishOp(f.slash,1)},ce.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,s=42===e?f.star:f.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,s=f.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(f.assign,i+1):this.finishOp(s,i)},ce.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(f.assign,3);return this.finishOp(124===e?f.logicalOR:f.logicalAND,2)}return 61===t?this.finishOp(f.assign,2):this.finishOp(124===e?f.bitwiseOR:f.bitwiseAND,1)},ce.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(f.assign,2):this.finishOp(f.bitwiseXOR,1)},ce.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!m.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(f.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(f.assign,2):this.finishOp(f.plusMin,1)},ce.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(f.assign,i+1):this.finishOp(f.bitShift,i)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(i=2),this.finishOp(f.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},ce.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(f.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(f.arrow)):this.finishOp(61===e?f.eq:f.prefix,1)},ce.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(f.questionDot,2)}if(63===t){if(e>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(f.assign,3);return this.finishOp(f.coalesce,2)}}return this.finishOp(f.question,1)},ce.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,isIdentifierStart(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(f.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+codePointToString(e)+"'")},ce.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(f.parenL);case 41:return++this.pos,this.finishToken(f.parenR);case 59:return++this.pos,this.finishToken(f.semi);case 44:return++this.pos,this.finishToken(f.comma);case 91:return++this.pos,this.finishToken(f.bracketL);case 93:return++this.pos,this.finishToken(f.bracketR);case 123:return++this.pos,this.finishToken(f.braceL);case 125:return++this.pos,this.finishToken(f.braceR);case 58:return++this.pos,this.finishToken(f.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(f.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(f.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+codePointToString(e)+"'")},ce.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},ce.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(m.test(s)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if("["===s)t=!0;else if("]"===s&&t)t=!1;else if("/"===s&&!t)break;e="\\"===s}++this.pos}var r=this.input.slice(i,this.pos);++this.pos;var n=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(n);var o=this.regexpState||(this.regexpState=new acorn_RegExpValidationState(this));o.reset(i,r,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var h=null;try{h=new RegExp(r,a)}catch(e){}return this.finishToken(f.regexp,{pattern:r,flags:a,value:h})},ce.readInt=function(e,t,i){for(var s=this.options.ecmaVersion>=12&&void 0===t,r=i&&48===this.input.charCodeAt(this.pos),n=this.pos,a=0,o=0,h=0,c=null==t?1/0:t;h<c;++h,++this.pos){var p=this.input.charCodeAt(this.pos),l=void 0;if(s&&95===p)r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===o&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===h&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=p;else{if((l=p>=97?p-97+10:p>=65?p-65+10:p>=48&&p<=57?p-48:1/0)>=e)break;o=p,a=a*e+l}}return s&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||null!=t&&this.pos-n!==t?null:a},ce.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return null==i&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i=stringToBigInt(this.input.slice(t,this.pos)),++this.pos):isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(f.num,i)},ce.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var i=this.pos-t>=2&&48===this.input.charCodeAt(t);i&&this.strict&&this.raise(t,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&110===s){var r=stringToBigInt(this.input.slice(t,this.pos));return++this.pos,isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(f.num,r)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),46!==s||i||(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),69!==s&&101!==s||i||(43!==(s=this.input.charCodeAt(++this.pos))&&45!==s||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n,a=(n=this.input.slice(t,this.pos),i?parseInt(n,8):parseFloat(n.replace(/_/g,"")));return this.finishToken(f.num,a)},ce.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},ce.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===e)break;92===s?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):8232===s||8233===s?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(isNewLine(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(f.string,t)};var pe={};ce.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==pe)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},ce.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw pe;this.raise(e,t)},ce.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==f.template&&this.type!==f.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(f.template,e)):36===i?(this.pos+=2,this.finishToken(f.dollarBraceL)):(++this.pos,this.finishToken(f.backQuote));if(92===i)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(isNewLine(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},ce.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(f.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":"\n"===this.input[this.pos+1]&&++this.pos;case"\n":case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,"Unterminated template")},ce.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(s,8);return r>255&&(s=s.slice(0,-1),r=parseInt(s,8)),this.pos+=s.length-1,t=this.input.charCodeAt(this.pos),"0"===s&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-s.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return isNewLine(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},ce.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},ce.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(isIdentifierChar(r,s))this.pos+=r<=65535?1:2;else{if(92!==r)break;this.containsEsc=!0,e+=this.input.slice(i,this.pos);var n=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?isIdentifierStart:isIdentifierChar)(a,s)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=codePointToString(a),i=this.pos}t=!1}return e+this.input.slice(i,this.pos)},ce.readWord=function(){var e=this.readWord1(),t=f.name;return this.keywords.test(e)&&(t=d[e]),this.finishToken(t,e)};acorn_Parser.acorn={Parser:acorn_Parser,version:"8.15.0",defaultOptions:I,Position:acorn_Position,SourceLocation:acorn_SourceLocation,getLineInfo,Node:acorn_Node,TokenType:acorn_TokenType,tokTypes:f,keywordTypes:d,TokContext:acorn_TokContext,tokContexts:F,isIdentifierChar,isIdentifierStart,Token:acorn_Token,isNewLine,lineBreak:m,lineBreakG:g,nonASCIIwhitespace:x};const le=require("node:module"),ue=require("node:fs");String.fromCharCode;const de=/\/$|\/\?|\/#/,fe=/^\.?\//;function hasTrailingSlash(e="",t){return t?de.test(e):e.endsWith("/")}function withTrailingSlash(e="",t){if(!t)return e.endsWith("/")?e:e+"/";if(hasTrailingSlash(e,!0))return e||"/";let i=e,s="";const r=e.indexOf("#");if(-1!==r&&(i=e.slice(0,r),s=e.slice(r),!i))return s;const[n,...a]=i.split("?");return n+"/"+(a.length>0?`?${a.join("?")}`:"")+s}function isNonEmptyURL(e){return e&&"/"!==e}function dist_joinURL(e,...t){let i=e||"";for(const e of t.filter(e=>isNonEmptyURL(e)))if(i){const t=e.replace(fe,"");i=withTrailingSlash(i)+t}else i=e;return i}Symbol.for("ufo:protocolRelative");const me=/^[A-Za-z]:\//;function pathe_M_eThtNZ_normalizeWindowsPath(e=""){return e?e.replace(/\\/g,"/").replace(me,e=>e.toUpperCase()):e}const ge=/^[/\\]{2}/,xe=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,ve=/^[A-Za-z]:$/,ye=/.(\.[^./]+|\.)$/,pathe_M_eThtNZ_normalize=function(e){if(0===e.length)return".";const t=(e=pathe_M_eThtNZ_normalizeWindowsPath(e)).match(ge),i=isAbsolute(e),s="/"===e[e.length-1];return 0===(e=normalizeString(e,!i)).length?i?"/":s?"./":".":(s&&(e+="/"),ve.test(e)&&(e+="/"),t?i?`//${e}`:`//./${e}`:i&&!isAbsolute(e)?`/${e}`:e)},pathe_M_eThtNZ_join=function(...e){let t="";for(const i of e)if(i)if(t.length>0){const e="/"===t[t.length-1],s="/"===i[0];t+=e&&s?i.slice(1):e||s?i:`/${i}`}else t+=i;return pathe_M_eThtNZ_normalize(t)};function pathe_M_eThtNZ_cwd(){return"undefined"!=typeof process&&"function"==typeof process.cwd?process.cwd().replace(/\\/g,"/"):"/"}const pathe_M_eThtNZ_resolve=function(...e){let t="",i=!1;for(let s=(e=e.map(e=>pathe_M_eThtNZ_normalizeWindowsPath(e))).length-1;s>=-1&&!i;s--){const r=s>=0?e[s]:pathe_M_eThtNZ_cwd();r&&0!==r.length&&(t=`${r}/${t}`,i=isAbsolute(r))}return t=normalizeString(t,!i),i&&!isAbsolute(t)?`/${t}`:t.length>0?t:"."};function normalizeString(e,t){let i="",s=0,r=-1,n=0,a=null;for(let o=0;o<=e.length;++o){if(o<e.length)a=e[o];else{if("/"===a)break;a="/"}if("/"===a){if(r===o-1||1===n);else if(2===n){if(i.length<2||2!==s||"."!==i[i.length-1]||"."!==i[i.length-2]){if(i.length>2){const e=i.lastIndexOf("/");-1===e?(i="",s=0):(i=i.slice(0,e),s=i.length-1-i.lastIndexOf("/")),r=o,n=0;continue}if(i.length>0){i="",s=0,r=o,n=0;continue}}t&&(i+=i.length>0?"/..":"..",s=2)}else i.length>0?i+=`/${e.slice(r+1,o)}`:i=e.slice(r+1,o),s=o-r-1;r=o,n=0}else"."===a&&-1!==n?++n:n=-1}return i}const isAbsolute=function(e){return xe.test(e)},extname=function(e){if(".."===e)return"";const t=ye.exec(pathe_M_eThtNZ_normalizeWindowsPath(e));return t&&t[1]||""},pathe_M_eThtNZ_dirname=function(e){const t=pathe_M_eThtNZ_normalizeWindowsPath(e).replace(/\/$/,"").split("/").slice(0,-1);return 1===t.length&&ve.test(t[0])&&(t[0]+="/"),t.join("/")||(isAbsolute(e)?"/":".")},basename=function(e,t){const i=pathe_M_eThtNZ_normalizeWindowsPath(e).split("/");let s="";for(let e=i.length-1;e>=0;e--){const t=i[e];if(t){s=t;break}}return t&&s.endsWith(t)?s.slice(0,-t.length):s},_e=require("node:url"),Ee=require("node:assert"),be=require("node:process"),Se=require("node:path"),ke=require("node:v8"),we=require("node:util"),Ie=new Set(le.builtinModules);function normalizeSlash(e){return e.replace(/\\/g,"/")}const Ce={}.hasOwnProperty,Re=/^([A-Z][a-z\d]*)+$/,Pe=new Set(["string","function","number","object","Function","Object","boolean","bigint","symbol"]),Te={};function formatList(e,t="and"){return e.length<3?e.join(` ${t} `):`${e.slice(0,-1).join(", ")}, ${t} ${e[e.length-1]}`}const Ae=new Map;let Ne;function createError(e,t,i){return Ae.set(e,t),function(e,t){return NodeError;function NodeError(...i){const s=Error.stackTraceLimit;isErrorStackTraceLimitWritable()&&(Error.stackTraceLimit=0);const r=new e;isErrorStackTraceLimitWritable()&&(Error.stackTraceLimit=s);const n=function(e,t,i){const s=Ae.get(e);if(Ee(void 0!==s,"expected `message` to be found"),"function"==typeof s)return Ee(s.length<=t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${s.length}).`),Reflect.apply(s,i,t);const r=/%[dfijoOs]/g;let n=0;for(;null!==r.exec(s);)n++;return Ee(n===t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${n}).`),0===t.length?s:(t.unshift(s),Reflect.apply(we.format,null,t))}(t,i,r);return Object.defineProperties(r,{message:{value:n,enumerable:!1,writable:!0,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},enumerable:!1,writable:!0,configurable:!0}}),Le(r),r.code=t,r}}(i,e)}function isErrorStackTraceLimitWritable(){try{if(ke.startupSnapshot.isBuildingSnapshot())return!1}catch{}const e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return void 0===e?Object.isExtensible(Error):Ce.call(e,"writable")&&void 0!==e.writable?e.writable:void 0!==e.set}Te.ERR_INVALID_ARG_TYPE=createError("ERR_INVALID_ARG_TYPE",(e,t,i)=>{Ee("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let s="The ";if(e.endsWith(" argument"))s+=`${e} `;else{const t=e.includes(".")?"property":"argument";s+=`"${e}" ${t} `}s+="must be ";const r=[],n=[],a=[];for(const e of t)Ee("string"==typeof e,"All expected entries have to be of type string"),Pe.has(e)?r.push(e.toLowerCase()):null===Re.exec(e)?(Ee("object"!==e,'The value "object" should be written as "Object"'),a.push(e)):n.push(e);if(n.length>0){const e=r.indexOf("object");-1!==e&&(r.slice(e,1),n.push("Object"))}return r.length>0&&(s+=`${r.length>1?"one of type":"of type"} ${formatList(r,"or")}`,(n.length>0||a.length>0)&&(s+=" or ")),n.length>0&&(s+=`an instance of ${formatList(n,"or")}`,a.length>0&&(s+=" or ")),a.length>0&&(a.length>1?s+=`one of ${formatList(a,"or")}`:(a[0].toLowerCase()!==a[0]&&(s+="an "),s+=`${a[0]}`)),s+=`. Received ${function(e){if(null==e)return String(e);if("function"==typeof e&&e.name)return`function ${e.name}`;if("object"==typeof e)return e.constructor&&e.constructor.name?`an instance of ${e.constructor.name}`:`${(0,we.inspect)(e,{depth:-1})}`;let t=(0,we.inspect)(e,{colors:!1});t.length>28&&(t=`${t.slice(0,25)}...`);return`type ${typeof e} (${t})`}(i)}`,s},TypeError),Te.ERR_INVALID_MODULE_SPECIFIER=createError("ERR_INVALID_MODULE_SPECIFIER",(e,t,i=void 0)=>`Invalid module "${e}" ${t}${i?` imported from ${i}`:""}`,TypeError),Te.ERR_INVALID_PACKAGE_CONFIG=createError("ERR_INVALID_PACKAGE_CONFIG",(e,t,i)=>`Invalid package config ${e}${t?` while importing ${t}`:""}${i?`. ${i}`:""}`,Error),Te.ERR_INVALID_PACKAGE_TARGET=createError("ERR_INVALID_PACKAGE_TARGET",(e,t,i,s=!1,r=void 0)=>{const n="string"==typeof i&&!s&&i.length>0&&!i.startsWith("./");return"."===t?(Ee(!1===s),`Invalid "exports" main target ${JSON.stringify(i)} defined in the package config ${e}package.json${r?` imported from ${r}`:""}${n?'; targets must start with "./"':""}`):`Invalid "${s?"imports":"exports"}" target ${JSON.stringify(i)} defined for '${t}' in the package config ${e}package.json${r?` imported from ${r}`:""}${n?'; targets must start with "./"':""}`},Error),Te.ERR_MODULE_NOT_FOUND=createError("ERR_MODULE_NOT_FOUND",(e,t,i=!1)=>`Cannot find ${i?"module":"package"} '${e}' imported from ${t}`,Error),Te.ERR_NETWORK_IMPORT_DISALLOWED=createError("ERR_NETWORK_IMPORT_DISALLOWED","import of '%s' by %s is not supported: %s",Error),Te.ERR_PACKAGE_IMPORT_NOT_DEFINED=createError("ERR_PACKAGE_IMPORT_NOT_DEFINED",(e,t,i)=>`Package import specifier "${e}" is not defined${t?` in package ${t}package.json`:""} imported from ${i}`,TypeError),Te.ERR_PACKAGE_PATH_NOT_EXPORTED=createError("ERR_PACKAGE_PATH_NOT_EXPORTED",(e,t,i=void 0)=>"."===t?`No "exports" main defined in ${e}package.json${i?` imported from ${i}`:""}`:`Package subpath '${t}' is not defined by "exports" in ${e}package.json${i?` imported from ${i}`:""}`,Error),Te.ERR_UNSUPPORTED_DIR_IMPORT=createError("ERR_UNSUPPORTED_DIR_IMPORT","Directory import '%s' is not supported resolving ES modules imported from %s",Error),Te.ERR_UNSUPPORTED_RESOLVE_REQUEST=createError("ERR_UNSUPPORTED_RESOLVE_REQUEST",'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',TypeError),Te.ERR_UNKNOWN_FILE_EXTENSION=createError("ERR_UNKNOWN_FILE_EXTENSION",(e,t)=>`Unknown file extension "${e}" for ${t}`,TypeError),Te.ERR_INVALID_ARG_VALUE=createError("ERR_INVALID_ARG_VALUE",(e,t,i="is invalid")=>{let s=(0,we.inspect)(t);s.length>128&&(s=`${s.slice(0,128)}...`);return`The ${e.includes(".")?"property":"argument"} '${e}' ${i}. Received ${s}`},TypeError);const Le=function(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}(function(e){const t=isErrorStackTraceLimitWritable();return t&&(Ne=Error.stackTraceLimit,Error.stackTraceLimit=Number.POSITIVE_INFINITY),Error.captureStackTrace(e),t&&(Error.stackTraceLimit=Ne),e});const Oe={}.hasOwnProperty,{ERR_INVALID_PACKAGE_CONFIG:De}=Te,Ve=new Map;function read(e,{base:t,specifier:i}){const s=Ve.get(e);if(s)return s;let r;try{r=ue.readFileSync(Se.toNamespacedPath(e),"utf8")}catch(e){const t=e;if("ENOENT"!==t.code)throw t}const n={exists:!1,pjsonPath:e,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};if(void 0!==r){let s;try{s=JSON.parse(r)}catch(s){const r=s,n=new De(e,(t?`"${i}" from `:"")+(0,_e.fileURLToPath)(t||i),r.message);throw n.cause=r,n}n.exists=!0,Oe.call(s,"name")&&"string"==typeof s.name&&(n.name=s.name),Oe.call(s,"main")&&"string"==typeof s.main&&(n.main=s.main),Oe.call(s,"exports")&&(n.exports=s.exports),Oe.call(s,"imports")&&(n.imports=s.imports),!Oe.call(s,"type")||"commonjs"!==s.type&&"module"!==s.type||(n.type=s.type)}return Ve.set(e,n),n}function getPackageScopeConfig(e){let t=new URL("package.json",e);for(;;){if(t.pathname.endsWith("node_modules/package.json"))break;const i=read((0,_e.fileURLToPath)(t),{specifier:e});if(i.exists)return i;const s=t;if(t=new URL("../package.json",t),t.pathname===s.pathname)break}return{pjsonPath:(0,_e.fileURLToPath)(t),exists:!1,type:"none"}}function getPackageType(e){return getPackageScopeConfig(e).type}const{ERR_UNKNOWN_FILE_EXTENSION:Ue}=Te,Me={}.hasOwnProperty,je={__proto__:null,".cjs":"commonjs",".js":"module",".json":"json",".mjs":"module"};const Fe={__proto__:null,"data:":function(e){const{1:t}=/^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(e.pathname)||[null,null,null];return function(e){return e&&/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(e)?"module":"application/json"===e?"json":null}(t)},"file:":function(e,t,i){const s=function(e){const t=e.pathname;let i=t.length;for(;i--;){const e=t.codePointAt(i);if(47===e)return"";if(46===e)return 47===t.codePointAt(i-1)?"":t.slice(i)}return""}(e);if(".js"===s){const t=getPackageType(e);return"none"!==t?t:"commonjs"}if(""===s){const t=getPackageType(e);return"none"===t||"commonjs"===t?"commonjs":"module"}const r=je[s];if(r)return r;if(i)return;const n=(0,_e.fileURLToPath)(e);throw new Ue(s,n)},"http:":getHttpProtocolModuleFormat,"https:":getHttpProtocolModuleFormat,"node:":()=>"builtin"};function getHttpProtocolModuleFormat(){}const Be=RegExp.prototype[Symbol.replace],{ERR_INVALID_MODULE_SPECIFIER:$e,ERR_INVALID_PACKAGE_CONFIG:qe,ERR_INVALID_PACKAGE_TARGET:We,ERR_MODULE_NOT_FOUND:Ge,ERR_PACKAGE_IMPORT_NOT_DEFINED:He,ERR_PACKAGE_PATH_NOT_EXPORTED:Ke,ERR_UNSUPPORTED_DIR_IMPORT:ze,ERR_UNSUPPORTED_RESOLVE_REQUEST:Je}=Te,Ye={}.hasOwnProperty,Qe=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i,Ze=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i,Xe=/^\.|%|\\/,et=/\*/g,tt=/%2f|%5c/i,it=new Set,st=/[/\\]{2}/;function emitInvalidSegmentDeprecation(e,t,i,s,r,n,a){if(be.noDeprecation)return;const o=(0,_e.fileURLToPath)(s),h=null!==st.exec(a?e:t);be.emitWarning(`Use of deprecated ${h?"double slash":"leading or trailing slash matching"} resolving "${e}" for module request "${t}" ${t===i?"":`matched to "${i}" `}in the "${r?"imports":"exports"}" field module resolution of the package at ${o}${n?` imported from ${(0,_e.fileURLToPath)(n)}`:""}.`,"DeprecationWarning","DEP0166")}function emitLegacyIndexDeprecation(e,t,i,s){if(be.noDeprecation)return;const r=function(e,t){const i=e.protocol;return Me.call(Fe,i)&&Fe[i](e,t,!0)||null}(e,{parentURL:i.href});if("module"!==r)return;const n=(0,_e.fileURLToPath)(e.href),a=(0,_e.fileURLToPath)(new _e.URL(".",t)),o=(0,_e.fileURLToPath)(i);s?Se.resolve(a,s)!==n&&be.emitWarning(`Package ${a} has a "main" field set to "${s}", excluding the full filename and extension to the resolved file at "${n.slice(a.length)}", imported from ${o}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`,"DeprecationWarning","DEP0151"):be.emitWarning(`No "main" or "exports" field defined in the package.json for ${a} resolving the main entry point "${n.slice(a.length)}", imported from ${o}.\nDefault "index" lookups for the main are deprecated for ES modules.`,"DeprecationWarning","DEP0151")}function tryStatSync(e){try{return(0,ue.statSync)(e)}catch{}}function fileExists(e){const t=(0,ue.statSync)(e,{throwIfNoEntry:!1}),i=t?t.isFile():void 0;return null!=i&&i}function legacyMainResolve(e,t,i){let s;if(void 0!==t.main){if(s=new _e.URL(t.main,e),fileExists(s))return s;const r=[`./${t.main}.js`,`./${t.main}.json`,`./${t.main}.node`,`./${t.main}/index.js`,`./${t.main}/index.json`,`./${t.main}/index.node`];let n=-1;for(;++n<r.length&&(s=new _e.URL(r[n],e),!fileExists(s));)s=void 0;if(s)return emitLegacyIndexDeprecation(s,e,i,t.main),s}const r=["./index.js","./index.json","./index.node"];let n=-1;for(;++n<r.length&&(s=new _e.URL(r[n],e),!fileExists(s));)s=void 0;if(s)return emitLegacyIndexDeprecation(s,e,i,t.main),s;throw new Ge((0,_e.fileURLToPath)(new _e.URL(".",e)),(0,_e.fileURLToPath)(i))}function exportsNotFound(e,t,i){return new Ke((0,_e.fileURLToPath)(new _e.URL(".",t)),e,i&&(0,_e.fileURLToPath)(i))}function invalidPackageTarget(e,t,i,s,r){return t="object"==typeof t&&null!==t?JSON.stringify(t,null,""):`${t}`,new We((0,_e.fileURLToPath)(new _e.URL(".",i)),e,t,s,r&&(0,_e.fileURLToPath)(r))}function resolvePackageTargetString(e,t,i,s,r,n,a,o,h){if(""!==t&&!n&&"/"!==e[e.length-1])throw invalidPackageTarget(i,e,s,a,r);if(!e.startsWith("./")){if(a&&!e.startsWith("../")&&!e.startsWith("/")){let i=!1;try{new _e.URL(e),i=!0}catch{}if(!i){return packageResolve(n?Be.call(et,e,()=>t):e+t,s,h)}}throw invalidPackageTarget(i,e,s,a,r)}if(null!==Qe.exec(e.slice(2))){if(null!==Ze.exec(e.slice(2)))throw invalidPackageTarget(i,e,s,a,r);if(!o){const o=n?i.replace("*",()=>t):i+t;emitInvalidSegmentDeprecation(n?Be.call(et,e,()=>t):e,o,i,s,a,r,!0)}}const c=new _e.URL(e,s),p=c.pathname,l=new _e.URL(".",s).pathname;if(!p.startsWith(l))throw invalidPackageTarget(i,e,s,a,r);if(""===t)return c;if(null!==Qe.exec(t)){const h=n?i.replace("*",()=>t):i+t;if(null===Ze.exec(t)){if(!o){emitInvalidSegmentDeprecation(n?Be.call(et,e,()=>t):e,h,i,s,a,r,!1)}}else!function(e,t,i,s,r){const n=`request is not a valid match in pattern "${t}" for the "${s?"imports":"exports"}" resolution of ${(0,_e.fileURLToPath)(i)}`;throw new $e(e,n,r&&(0,_e.fileURLToPath)(r))}(h,i,s,a,r)}return n?new _e.URL(Be.call(et,c.href,()=>t)):new _e.URL(t,c)}function isArrayIndex(e){const t=Number(e);return`${t}`===e&&(t>=0&&t<4294967295)}function resolvePackageTarget(e,t,i,s,r,n,a,o,h){if("string"==typeof t)return resolvePackageTargetString(t,i,s,e,r,n,a,o,h);if(Array.isArray(t)){const c=t;if(0===c.length)return null;let p,l=-1;for(;++l<c.length;){const t=c[l];let u;try{u=resolvePackageTarget(e,t,i,s,r,n,a,o,h)}catch(e){if(p=e,"ERR_INVALID_PACKAGE_TARGET"===e.code)continue;throw e}if(void 0!==u){if(null!==u)return u;p=null}}if(null==p)return null;throw p}if("object"==typeof t&&null!==t){const c=Object.getOwnPropertyNames(t);let p=-1;for(;++p<c.length;){if(isArrayIndex(c[p]))throw new qe((0,_e.fileURLToPath)(e),r,'"exports" cannot contain numeric property keys.')}for(p=-1;++p<c.length;){const l=c[p];if("default"===l||h&&h.has(l)){const c=resolvePackageTarget(e,t[l],i,s,r,n,a,o,h);if(void 0===c)continue;return c}}return null}if(null===t)return null;throw invalidPackageTarget(s,t,e,a,r)}function emitTrailingSlashPatternDeprecation(e,t,i){if(be.noDeprecation)return;const s=(0,_e.fileURLToPath)(t);it.has(s+"|"+e)||(it.add(s+"|"+e),be.emitWarning(`Use of deprecated trailing slash pattern mapping "${e}" in the "exports" field module resolution of the package at ${s}${i?` imported from ${(0,_e.fileURLToPath)(i)}`:""}. Mapping specifiers ending in "/" is no longer supported.`,"DeprecationWarning","DEP0155"))}function packageExportsResolve(e,t,i,s,r){let n=i.exports;if(function(e,t,i){if("string"==typeof e||Array.isArray(e))return!0;if("object"!=typeof e||null===e)return!1;const s=Object.getOwnPropertyNames(e);let r=!1,n=0,a=-1;for(;++a<s.length;){const e=s[a],o=""===e||"."!==e[0];if(0===n++)r=o;else if(r!==o)throw new qe((0,_e.fileURLToPath)(t),i,"\"exports\" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.")}return r}(n,e,s)&&(n={".":n}),Ye.call(n,t)&&!t.includes("*")&&!t.endsWith("/")){const i=resolvePackageTarget(e,n[t],"",t,s,!1,!1,!1,r);if(null==i)throw exportsNotFound(t,e,s);return i}let a="",o="";const h=Object.getOwnPropertyNames(n);let c=-1;for(;++c<h.length;){const i=h[c],r=i.indexOf("*");if(-1!==r&&t.startsWith(i.slice(0,r))){t.endsWith("/")&&emitTrailingSlashPatternDeprecation(t,e,s);const n=i.slice(r+1);t.length>=i.length&&t.endsWith(n)&&1===patternKeyCompare(a,i)&&i.lastIndexOf("*")===r&&(a=i,o=t.slice(r,t.length-n.length))}}if(a){const i=resolvePackageTarget(e,n[a],o,a,s,!0,!1,t.endsWith("/"),r);if(null==i)throw exportsNotFound(t,e,s);return i}throw exportsNotFound(t,e,s)}function patternKeyCompare(e,t){const i=e.indexOf("*"),s=t.indexOf("*"),r=-1===i?e.length:i+1,n=-1===s?t.length:s+1;return r>n?-1:n>r||-1===i?1:-1===s||e.length>t.length?-1:t.length>e.length?1:0}function packageImportsResolve(e,t,i){if("#"===e||e.startsWith("#/")||e.endsWith("/")){throw new $e(e,"is not a valid internal imports specifier name",(0,_e.fileURLToPath)(t))}let s;const r=getPackageScopeConfig(t);if(r.exists){s=(0,_e.pathToFileURL)(r.pjsonPath);const n=r.imports;if(n)if(Ye.call(n,e)&&!e.includes("*")){const r=resolvePackageTarget(s,n[e],"",e,t,!1,!0,!1,i);if(null!=r)return r}else{let r="",a="";const o=Object.getOwnPropertyNames(n);let h=-1;for(;++h<o.length;){const t=o[h],i=t.indexOf("*");if(-1!==i&&e.startsWith(t.slice(0,-1))){const s=t.slice(i+1);e.length>=t.length&&e.endsWith(s)&&1===patternKeyCompare(r,t)&&t.lastIndexOf("*")===i&&(r=t,a=e.slice(i,e.length-s.length))}}if(r){const e=resolvePackageTarget(s,n[r],a,r,t,!0,!0,!1,i);if(null!=e)return e}}}throw function(e,t,i){return new He(e,t&&(0,_e.fileURLToPath)(new _e.URL(".",t)),(0,_e.fileURLToPath)(i))}(e,s,t)}function packageResolve(e,t,i){if(le.builtinModules.includes(e))return new _e.URL("node:"+e);const{packageName:s,packageSubpath:r,isScoped:n}=function(e,t){let i=e.indexOf("/"),s=!0,r=!1;"@"===e[0]&&(r=!0,-1===i||0===e.length?s=!1:i=e.indexOf("/",i+1));const n=-1===i?e:e.slice(0,i);if(null!==Xe.exec(n)&&(s=!1),!s)throw new $e(e,"is not a valid package name",(0,_e.fileURLToPath)(t));return{packageName:n,packageSubpath:"."+(-1===i?"":e.slice(i)),isScoped:r}}(e,t),a=getPackageScopeConfig(t);if(a.exists){const e=(0,_e.pathToFileURL)(a.pjsonPath);if(a.name===s&&void 0!==a.exports&&null!==a.exports)return packageExportsResolve(e,r,a,t,i)}let o,h=new _e.URL("./node_modules/"+s+"/package.json",t),c=(0,_e.fileURLToPath)(h);do{const a=tryStatSync(c.slice(0,-13));if(!a||!a.isDirectory()){o=c,h=new _e.URL((n?"../../../../node_modules/":"../../../node_modules/")+s+"/package.json",h),c=(0,_e.fileURLToPath)(h);continue}const p=read(c,{base:t,specifier:e});return void 0!==p.exports&&null!==p.exports?packageExportsResolve(h,r,p,t,i):"."===r?legacyMainResolve(h,p,t):new _e.URL(r,h)}while(c.length!==o.length);throw new Ge(s,(0,_e.fileURLToPath)(t),!1)}function moduleResolve(e,t,i,s){const r=t.protocol,n="data:"===r||"http:"===r||"https:"===r;let a;if(function(e){return""!==e&&("/"===e[0]||function(e){if("."===e[0]){if(1===e.length||"/"===e[1])return!0;if("."===e[1]&&(2===e.length||"/"===e[2]))return!0}return!1}(e))}(e))try{a=new _e.URL(e,t)}catch(i){const s=new Je(e,t);throw s.cause=i,s}else if("file:"===r&&"#"===e[0])a=packageImportsResolve(e,t,i);else try{a=new _e.URL(e)}catch(s){if(n&&!le.builtinModules.includes(e)){const i=new Je(e,t);throw i.cause=s,i}a=packageResolve(e,t,i)}return Ee(void 0!==a,"expected to be defined"),"file:"!==a.protocol?a:function(e,t){if(null!==tt.exec(e.pathname))throw new $e(e.pathname,'must not include encoded "/" or "\\" characters',(0,_e.fileURLToPath)(t));let i;try{i=(0,_e.fileURLToPath)(e)}catch(i){const s=i;throw Object.defineProperty(s,"input",{value:String(e)}),Object.defineProperty(s,"module",{value:String(t)}),s}const s=tryStatSync(i.endsWith("/")?i.slice(-1):i);if(s&&s.isDirectory()){const s=new ze(i,(0,_e.fileURLToPath)(t));throw s.url=String(e),s}if(!s||!s.isFile()){const s=new Ge(i||e.pathname,t&&(0,_e.fileURLToPath)(t),!0);throw s.url=String(e),s}{const t=(0,ue.realpathSync)(i),{search:s,hash:r}=e;(e=(0,_e.pathToFileURL)(t+(i.endsWith(Se.sep)?"/":""))).search=s,e.hash=r}return e}(a,t)}function fileURLToPath(e){return"string"!=typeof e||e.startsWith("file://")?normalizeSlash((0,_e.fileURLToPath)(e)):normalizeSlash(e)}function pathToFileURL(e){return(0,_e.pathToFileURL)(fileURLToPath(e)).toString()}const rt=new Set(["node","import"]),nt=[".mjs",".cjs",".js",".json"],at=new Set(["ERR_MODULE_NOT_FOUND","ERR_UNSUPPORTED_DIR_IMPORT","MODULE_NOT_FOUND","ERR_PACKAGE_PATH_NOT_EXPORTED"]);function _tryModuleResolve(e,t,i){try{return moduleResolve(e,t,i)}catch(e){if(!at.has(e?.code))throw e}}function _resolve(e,t={}){if("string"!=typeof e){if(!(e instanceof URL))throw new TypeError("input must be a `string` or `URL`");e=fileURLToPath(e)}if(/(?:node|data|http|https):/.test(e))return e;if(Ie.has(e))return"node:"+e;if(e.startsWith("file://")&&(e=fileURLToPath(e)),isAbsolute(e))try{if((0,ue.statSync)(e).isFile())return pathToFileURL(e)}catch(e){if("ENOENT"!==e?.code)throw e}const i=t.conditions?new Set(t.conditions):rt,s=(Array.isArray(t.url)?t.url:[t.url]).filter(Boolean).map(e=>new URL(function(e){return"string"!=typeof e&&(e=e.toString()),/(?:node|data|http|https|file):/.test(e)?e:Ie.has(e)?"node:"+e:"file://"+encodeURI(normalizeSlash(e))}(e.toString())));0===s.length&&s.push(new URL(pathToFileURL(process.cwd())));const r=[...s];for(const e of s)"file:"===e.protocol&&r.push(new URL("./",e),new URL(dist_joinURL(e.pathname,"_index.js"),e),new URL("node_modules",e));let n;for(const s of r){if(n=_tryModuleResolve(e,s,i),n)break;for(const r of["","/index"]){for(const a of t.extensions||nt)if(n=_tryModuleResolve(dist_joinURL(e,r)+a,s,i),n)break;if(n)break}if(n)break}if(!n){const t=new Error(`Cannot find module ${e} imported from ${r.join(", ")}`);throw t.code="ERR_MODULE_NOT_FOUND",t}return pathToFileURL(n)}function resolveSync(e,t){return _resolve(e,t)}function resolvePathSync(e,t){return fileURLToPath(resolveSync(e,t))}const ot=/(?:[\s;]|^)(?:import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m,ht=/\/\*.+?\*\/|\/\/.*(?=[nr])/g;function hasESMSyntax(e,t={}){return t.stripComments&&(e=e.replace(ht,"")),ot.test(e)}function escapeStringRegexp(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const ct=new Set(["/","\\",void 0]),pt=Symbol.for("pathe:normalizedAlias"),lt=/[/\\]/;function normalizeAliases(e){if(e[pt])return e;const t=Object.fromEntries(Object.entries(e).sort(([e],[t])=>function(e,t){return t.split("/").length-e.split("/").length}(e,t)));for(const e in t)for(const i in t)i===e||e.startsWith(i)||t[e]?.startsWith(i)&&ct.has(t[e][i.length])&&(t[e]=t[i]+t[e].slice(i.length));return Object.defineProperty(t,pt,{value:!0,enumerable:!1}),t}function utils_hasTrailingSlash(e="/"){const t=e[e.length-1];return"/"===t||"\\"===t}var ut={rE:"2.6.1"};const dt=require("node:crypto");var ft=__webpack_require__.n(dt);const mt=Object.create(null),dist_i=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?mt:globalThis),gt=new Proxy(mt,{get:(e,t)=>dist_i()[t]??mt[t],has:(e,t)=>t in dist_i()||t in mt,set:(e,t,i)=>(dist_i(!0)[t]=i,!0),deleteProperty(e,t){if(!t)return!1;return delete dist_i(!0)[t],!0},ownKeys(){const e=dist_i(!0);return Object.keys(e)}}),xt=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",vt=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CLOUDFLARE_WORKERS","WORKERS_CI",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];const yt=function(){if(globalThis.process?.env)for(const e of vt){const t=e[1]||e[0];if(globalThis.process?.env[t])return{name:e[0].toLowerCase(),...e[2]}}return"/bin/jsh"===globalThis.process?.env?.SHELL&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}();yt.name;function std_env_dist_n(e){return!!e&&"false"!==e}const _t=globalThis.process?.platform||"",Et=std_env_dist_n(gt.CI)||!1!==yt.ci,bt=std_env_dist_n(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),St=(std_env_dist_n(gt.DEBUG),"test"===xt||std_env_dist_n(gt.TEST)),kt=(std_env_dist_n(gt.MINIMAL),/^win/i.test(_t)),wt=(/^linux/i.test(_t),/^darwin/i.test(_t),!std_env_dist_n(gt.NO_COLOR)&&(std_env_dist_n(gt.FORCE_COLOR)||(bt||kt)&&gt.TERM),(globalThis.process?.versions?.node||"").replace(/^v/,"")||null),It=(Number(wt?.split(".")[0]),globalThis.process||Object.create(null)),Ct={versions:{}},Rt=(new Proxy(It,{get:(e,t)=>"env"===t?gt:t in e?e[t]:t in Ct?Ct[t]:void 0}),"node"===globalThis.process?.release?.name),Pt=!!globalThis.Bun||!!globalThis.process?.versions?.bun,Tt=!!globalThis.Deno,At=!!globalThis.fastly,Nt=[[!!globalThis.Netlify,"netlify"],[!!globalThis.EdgeRuntime,"edge-light"],["Cloudflare-Workers"===globalThis.navigator?.userAgent,"workerd"],[At,"fastly"],[Tt,"deno"],[Pt,"bun"],[Rt,"node"]];!function(){const e=Nt.find(e=>e[0]);if(e)e[1]}();const Lt=require("node:tty"),Ot=Lt?.WriteStream?.prototype?.hasColors?.()??!1,base_format=(e,t)=>{if(!Ot)return e=>e;const i=`[${e}m`,s=`[${t}m`;return e=>{const r=e+"";let n=r.indexOf(s);if(-1===n)return i+r+s;let a=i,o=0;const h=(22===t?s:"")+i;for(;-1!==n;)a+=r.slice(o,n)+h,o=n+s.length,n=r.indexOf(s,o);return a+=r.slice(o)+s,a}},Dt=(base_format(0,0),base_format(1,22),base_format(2,22),base_format(3,23),base_format(4,24),base_format(53,55),base_format(7,27),base_format(8,28),base_format(9,29),base_format(30,39),base_format(31,39)),Vt=base_format(32,39),Ut=base_format(33,39),Mt=base_format(34,39),jt=(base_format(35,39),base_format(36,39)),Ft=(base_format(37,39),base_format(90,39));base_format(40,49),base_format(41,49),base_format(42,49),base_format(43,49),base_format(44,49),base_format(45,49),base_format(46,49),base_format(47,49),base_format(100,49),base_format(91,39),base_format(92,39),base_format(93,39),base_format(94,39),base_format(95,39),base_format(96,39),base_format(97,39),base_format(101,49),base_format(102,49),base_format(103,49),base_format(104,49),base_format(105,49),base_format(106,49),base_format(107,49);function isDir(e){if("string"!=typeof e||e.startsWith("file://"))return!1;try{return(0,ue.lstatSync)(e).isDirectory()}catch{return!1}}function utils_hash(e,t=8){return(function(){if(void 0!==$t)return $t;try{return $t=!!ft().getFips?.(),$t}catch{return $t=!1,$t}}()?ft().createHash("sha256"):ft().createHash("md5")).update(e).digest("hex").slice(0,t)}const Bt={true:Vt("true"),false:Ut("false"),"[rebuild]":Ut("[rebuild]"),"[esm]":Mt("[esm]"),"[cjs]":Vt("[cjs]"),"[import]":Mt("[import]"),"[require]":Vt("[require]"),"[native]":jt("[native]"),"[transpile]":Ut("[transpile]"),"[fallback]":Dt("[fallback]"),"[unknown]":Dt("[unknown]"),"[hit]":Vt("[hit]"),"[miss]":Ut("[miss]"),"[json]":Vt("[json]"),"[data]":Vt("[data]")};function debug(e,...t){if(!e.opts.debug)return;const i=process.cwd();console.log(Ft(["[jiti]",...t.map(e=>e in Bt?Bt[e]:"string"!=typeof e?JSON.stringify(e):e.replace(i,"."))].join(" ")))}function jitiInteropDefault(e,t){return e.opts.interopDefault?function(e){const t=typeof e;if(null===e||"object"!==t&&"function"!==t)return e;const i=e.default,s=typeof i,r=null==i,n="object"===s||"function"===s;if(r&&e instanceof Promise)return e;return new Proxy(e,{get(t,s,a){if("__esModule"===s)return!0;if("default"===s)return r?e:"function"==typeof i?.default&&e.__esModule?i.default:i;if(Reflect.has(t,s))return Reflect.get(t,s,a);if(n&&!(i instanceof Promise)){let e=Reflect.get(i,s,a);return"function"==typeof e&&(e=e.bind(i)),e}},apply:(e,t,r)=>"function"==typeof e?Reflect.apply(e,t,r):"function"===s?Reflect.apply(i,t,r):void 0})}(t):t}let $t;function _booleanEnv(e,t){const i=_jsonEnv(e,t);return Boolean(i)}function _jsonEnv(e,t){const i=process.env[e];if(!(e in process.env))return t;try{return JSON.parse(i)}catch{return t}}const qt=/\.(c|m)?j(sx?)$/,Wt=/\.(c|m)?t(sx?)$/;function jitiResolve(e,t,i){let s,r;if(e.isNativeRe.test(t))return t;e.alias&&(t=function(e,t){const i=pathe_M_eThtNZ_normalizeWindowsPath(e);t=normalizeAliases(t);for(const[e,s]of Object.entries(t)){if(!i.startsWith(e))continue;const t=utils_hasTrailingSlash(e)?e.slice(0,-1):e;if(utils_hasTrailingSlash(i[t.length]))return pathe_M_eThtNZ_join(s,i.slice(e.length))}return i}(t,e.alias));let n=i?.parentURL||e.url;isDir(n)&&(n=pathe_M_eThtNZ_join(n,"_index.js"));const a=(i?.async?[i?.conditions,["node","import"],["node","require"]]:[i?.conditions,["node","require"],["node","import"]]).filter(Boolean);for(const i of a){try{s=resolvePathSync(t,{url:n,conditions:i,extensions:e.opts.extensions})}catch(e){r=e}if(s)return s}try{return e.nativeRequire.resolve(t,{paths:i.paths})}catch(e){r=e}for(const r of e.additionalExts){if(s=tryNativeRequireResolve(e,t+r,n,i)||tryNativeRequireResolve(e,t+"/index"+r,n,i),s)return s;if((Wt.test(e.filename)||Wt.test(e.parentModule?.filename||"")||qt.test(t))&&(s=tryNativeRequireResolve(e,t.replace(qt,".$1t$2"),n,i),s))return s}if(!i?.try)throw r}function tryNativeRequireResolve(e,t,i,s){try{return e.nativeRequire.resolve(t,{...s,paths:[pathe_M_eThtNZ_dirname(fileURLToPath(i)),...s?.paths||[]]})}catch{}}const Gt=require("node:perf_hooks"),Ht=require("node:vm");var Kt=__webpack_require__.n(Ht);function jitiRequire(e,t,i){const s=e.parentCache||{};if(t.startsWith("node:"))return nativeImportOrRequire(e,t,i.async);if(t.startsWith("file:"))t=(0,_e.fileURLToPath)(t);else if(t.startsWith("data:")){if(!i.async)throw new Error("`data:` URLs are only supported in ESM context. Use `import` or `jiti.import` instead.");return debug(e,"[native]","[data]","[import]",t),nativeImportOrRequire(e,t,!0)}if(le.builtinModules.includes(t)||".pnp.js"===t)return nativeImportOrRequire(e,t,i.async);if(e.opts.tryNative&&!e.opts.transformOptions)try{if(!(t=jitiResolve(e,t,i))&&i.try)return;if(debug(e,"[try-native]",i.async&&e.nativeImport?"[import]":"[require]",t),i.async&&e.nativeImport)return e.nativeImport(t).then(i=>(!1===e.opts.moduleCache&&delete e.nativeRequire.cache[t],jitiInteropDefault(e,i)));{const i=e.nativeRequire(t);return!1===e.opts.moduleCache&&delete e.nativeRequire.cache[t],jitiInteropDefault(e,i)}}catch(i){debug(e,`[try-native] Using fallback for ${t} because of an error:`,i)}const r=jitiResolve(e,t,i);if(!r&&i.try)return;const n=extname(r);if(".json"===n){debug(e,"[json]",r);const t=e.nativeRequire(r);return t&&!("default"in t)&&Object.defineProperty(t,"default",{value:t,enumerable:!1}),t}if(n&&!e.opts.extensions.includes(n))return debug(e,"[native]","[unknown]",i.async?"[import]":"[require]",r),nativeImportOrRequire(e,r,i.async);if(e.isNativeRe.test(r))return debug(e,"[native]",i.async?"[import]":"[require]",r),nativeImportOrRequire(e,r,i.async);if(s[r])return jitiInteropDefault(e,s[r]?.exports);if(e.opts.moduleCache){const t=e.nativeRequire.cache[r];if(t?.loaded)return jitiInteropDefault(e,t.exports)}const a=(0,ue.readFileSync)(r,"utf8");return eval_evalModule(e,a,{id:t,filename:r,ext:n,cache:s,async:i.async})}function nativeImportOrRequire(e,t,i){return i&&e.nativeImport?e.nativeImport(function(e){return kt&&isAbsolute(e)?pathToFileURL(e):e}(t)).then(t=>jitiInteropDefault(e,t)):jitiInteropDefault(e,e.nativeRequire(t))}const zt="9";function getCache(e,t,i){if(!e.opts.fsCache||!t.filename)return i();const s=` /* v${zt}-${utils_hash(t.source,16)} */\n`;let r=`${basename(pathe_M_eThtNZ_dirname(t.filename))}-${function(e){const t=e.split(lt).pop();if(!t)return;const i=t.lastIndexOf(".");return i<=0?t:t.slice(0,i)}(t.filename)}`+(e.opts.sourceMaps?"+map":"")+(t.interopDefault?".i":"")+`.${utils_hash(t.filename)}`+(t.async?".mjs":".cjs");t.jsx&&t.filename.endsWith("x")&&(r+="x");const n=e.opts.fsCache,a=pathe_M_eThtNZ_join(n,r);if(!e.opts.rebuildFsCache&&(0,ue.existsSync)(a)){const i=(0,ue.readFileSync)(a,"utf8");if(i.endsWith(s))return debug(e,"[cache]","[hit]",t.filename,"~>",a),i}debug(e,"[cache]","[miss]",t.filename);const o=i();return o.includes("__JITI_ERROR__")||((0,ue.writeFileSync)(a,o+s,"utf8"),debug(e,"[cache]","[store]",t.filename,"~>",a)),o}function prepareCacheDir(t){if(!0===t.opts.fsCache&&(t.opts.fsCache=function(t){const i=t.filename&&pathe_M_eThtNZ_resolve(t.filename,"../node_modules");if(i&&(0,ue.existsSync)(i))return pathe_M_eThtNZ_join(i,".cache/jiti");let s=(0,e.tmpdir)();if(process.env.TMPDIR&&s===process.cwd()&&!process.env.JITI_RESPECT_TMPDIR_ENV){const t=process.env.TMPDIR;delete process.env.TMPDIR,s=(0,e.tmpdir)(),process.env.TMPDIR=t}return pathe_M_eThtNZ_join(s,"jiti")}(t)),t.opts.fsCache)try{if((0,ue.mkdirSync)(t.opts.fsCache,{recursive:!0}),!function(e){try{return(0,ue.accessSync)(e,ue.constants.W_OK),!0}catch{return!1}}(t.opts.fsCache))throw new Error("directory is not writable!")}catch(e){debug(t,"Error creating cache directory at ",t.opts.fsCache,e),t.opts.fsCache=!1}}function transform(e,t){let i=getCache(e,t,()=>{const i=e.opts.transform({...e.opts.transformOptions,babel:{...e.opts.sourceMaps?{sourceFileName:t.filename,sourceMaps:"inline"}:{},...e.opts.transformOptions?.babel},interopDefault:e.opts.interopDefault,...t});return i.error&&e.opts.debug&&debug(e,i.error),i.code});return i.startsWith("#!")&&(i="// "+i),i}function eval_evalModule(e,t,i={}){const s=i.id||(i.filename?basename(i.filename):`_jitiEval.${i.ext||(i.async?"mjs":"js")}`),r=i.filename||jitiResolve(e,s,{async:i.async}),n=i.ext||extname(r),a=i.cache||e.parentCache||{},o=/\.[cm]?tsx?$/.test(n),h=".mjs"===n||".js"===n&&"module"===function(e){for(;e&&"."!==e&&"/"!==e;){e=pathe_M_eThtNZ_join(e,"..");try{const t=(0,ue.readFileSync)(pathe_M_eThtNZ_join(e,"package.json"),"utf8");try{return JSON.parse(t)}catch{}break}catch{}}}(r)?.type,c=".cjs"===n,p=i.forceTranspile??(!c&&!(h&&i.async)&&(o||h||e.isTransformRe.test(r)||hasESMSyntax(t))),l=Gt.performance.now();if(p){t=transform(e,{filename:r,source:t,ts:o,async:i.async??!1,jsx:e.opts.jsx});const s=Math.round(1e3*(Gt.performance.now()-l))/1e3;debug(e,"[transpile]",i.async?"[esm]":"[cjs]",r,`(${s}ms)`)}else{if(debug(e,"[native]",i.async?"[import]":"[require]",r),i.async)return Promise.resolve(nativeImportOrRequire(e,r,i.async)).catch(s=>(debug(e,"Native import error:",s),debug(e,"[fallback]",r),eval_evalModule(e,t,{...i,forceTranspile:!0})));try{return nativeImportOrRequire(e,r,i.async)}catch(s){debug(e,"Native require error:",s),debug(e,"[fallback]",r),t=transform(e,{filename:r,source:t,ts:o,async:i.async??!1,jsx:e.opts.jsx})}}const u=new le.Module(r);u.filename=r,e.parentModule&&(u.parent=e.parentModule,Array.isArray(e.parentModule.children)&&!e.parentModule.children.includes(u)&&e.parentModule.children.push(u));const d=createJiti(r,e.opts,{parentModule:u,parentCache:a,nativeImport:e.nativeImport,onError:e.onError,createRequire:e.createRequire},!0);let f;u.require=d,u.path=pathe_M_eThtNZ_dirname(r),u.paths=le.Module._nodeModulePaths(u.path),a[r]=u,e.opts.moduleCache&&(e.nativeRequire.cache[r]=u);const m=function(e,t){return`(${t?.async?"async ":""}function (exports, require, module, __filename, __dirname, jitiImport, jitiESMResolve) { ${e}\n});`}(t,{async:i.async});try{f=Kt().runInThisContext(m,{filename:r,lineOffset:0,displayErrors:!1})}catch(t){"SyntaxError"===t.name&&i.async&&e.nativeImport?(debug(e,"[esm]","[import]","[fallback]",r),f=function(e,t){const i=`data:text/javascript;base64,${Buffer.from(`export default ${e}`).toString("base64")}`;return(...e)=>t(i).then(t=>t.default(...e))}(m,e.nativeImport)):(e.opts.moduleCache&&delete e.nativeRequire.cache[r],e.onError(t))}let g;try{g=f(u.exports,u.require,u,u.filename,pathe_M_eThtNZ_dirname(u.filename),d.import,d.esmResolve)}catch(t){e.opts.moduleCache&&delete e.nativeRequire.cache[r],e.onError(t)}function next(){if(u.exports&&u.exports.__JITI_ERROR__){const{filename:t,line:i,column:s,code:r,message:n}=u.exports.__JITI_ERROR__,a=new Error(`${r}: ${n} \n ${`${t}:${i}:${s}`}`);Error.captureStackTrace(a,jitiRequire),e.onError(a)}u.loaded=!0;return jitiInteropDefault(e,u.exports)}return i.async?Promise.resolve(g).then(next):next()}const Jt="win32"===(0,e.platform)();function createJiti(e,t={},i,s=!1){const r=s?t:function(e){const t={fsCache:_booleanEnv("JITI_FS_CACHE",_booleanEnv("JITI_CACHE",!0)),rebuildFsCache:_booleanEnv("JITI_REBUILD_FS_CACHE",!1),moduleCache:_booleanEnv("JITI_MODULE_CACHE",_booleanEnv("JITI_REQUIRE_CACHE",!0)),debug:_booleanEnv("JITI_DEBUG",!1),sourceMaps:_booleanEnv("JITI_SOURCE_MAPS",!1),interopDefault:_booleanEnv("JITI_INTEROP_DEFAULT",!0),extensions:_jsonEnv("JITI_EXTENSIONS",[".js",".mjs",".cjs",".ts",".tsx",".mts",".cts",".mtsx",".ctsx"]),alias:_jsonEnv("JITI_ALIAS",{}),nativeModules:_jsonEnv("JITI_NATIVE_MODULES",[]),transformModules:_jsonEnv("JITI_TRANSFORM_MODULES",[]),tryNative:_jsonEnv("JITI_TRY_NATIVE","Bun"in globalThis),jsx:_booleanEnv("JITI_JSX",!1)};t.jsx&&t.extensions.push(".jsx",".tsx");const i={};return void 0!==e.cache&&(i.fsCache=e.cache),void 0!==e.requireCache&&(i.moduleCache=e.requireCache),{...t,...i,...e}}(t),n=r.alias&&Object.keys(r.alias).length>0?normalizeAliases(r.alias||{}):void 0,a=["typescript","jiti",...r.nativeModules||[]],o=new RegExp(`node_modules/(${a.map(e=>escapeStringRegexp(e)).join("|")})/`),h=[...r.transformModules||[]],c=new RegExp(`node_modules/(${h.map(e=>escapeStringRegexp(e)).join("|")})/`);e||(e=process.cwd()),!s&&isDir(e)&&(e=pathe_M_eThtNZ_join(e,"_index.js"));const p=pathToFileURL(e),l=[...r.extensions].filter(e=>".js"!==e),u=i.createRequire(Jt?e.replace(/\//g,"\\"):e),d={filename:e,url:p,opts:r,alias:n,nativeModules:a,transformModules:h,isNativeRe:o,isTransformRe:c,additionalExts:l,nativeRequire:u,onError:i.onError,parentModule:i.parentModule,parentCache:i.parentCache,nativeImport:i.nativeImport,createRequire:i.createRequire};s||debug(d,"[init]",...[["version:",ut.rE],["module-cache:",r.moduleCache],["fs-cache:",r.fsCache],["rebuild-fs-cache:",r.rebuildFsCache],["interop-defaults:",r.interopDefault]].flat()),s||prepareCacheDir(d);const f=Object.assign(function(e){return jitiRequire(d,e,{async:!1})},{cache:r.moduleCache?u.cache:Object.create(null),extensions:u.extensions,main:u.main,options:r,resolve:Object.assign(function(e){return jitiResolve(d,e,{async:!1})},{paths:u.resolve.paths}),transform:e=>transform(d,e),evalModule:(e,t)=>eval_evalModule(d,e,t),async import(e,t){const i=await jitiRequire(d,e,{...t,async:!0});return t?.default?i?.default??i:i},esmResolve(e,t){"string"==typeof t&&(t={parentURL:t});const i=jitiResolve(d,e,{parentURL:p,...t,async:!0});return!i||"string"!=typeof i||i.startsWith("file://")?i:pathToFileURL(i)}});return f}})(),module.exports=i.default})();
@@ -1,29 +0,0 @@
1
- import { createRequire } from "node:module";
2
- import _createJiti from "../dist/jiti.cjs";
3
-
4
- function onError(err) {
5
- throw err; /* ↓ Check stack trace ↓ */
6
- }
7
-
8
- const nativeImport = (id) => import(id);
9
-
10
- let _transform;
11
- function lazyTransform(...args) {
12
- if (!_transform) {
13
- _transform = createRequire(import.meta.url)("../dist/babel.cjs");
14
- }
15
- return _transform(...args);
16
- }
17
-
18
- export function createJiti(id, opts = {}) {
19
- if (!opts.transform) {
20
- opts = { ...opts, transform: lazyTransform };
21
- }
22
- return _createJiti(id, opts, {
23
- onError,
24
- nativeImport,
25
- createRequire,
26
- });
27
- }
28
-
29
- export default createJiti;
@@ -1,133 +0,0 @@
1
- {
2
- "name": "jiti",
3
- "version": "2.6.1",
4
- "description": "Runtime typescript and ESM support for Node.js",
5
- "repository": "unjs/jiti",
6
- "license": "MIT",
7
- "type": "module",
8
- "exports": {
9
- ".": {
10
- "import": {
11
- "types": "./lib/jiti.d.mts",
12
- "default": "./lib/jiti.mjs"
13
- },
14
- "require": {
15
- "types": "./lib/jiti.d.cts",
16
- "default": "./lib/jiti.cjs"
17
- }
18
- },
19
- "./register": {
20
- "types": "./lib/jiti-register.d.mts",
21
- "import": "./lib/jiti-register.mjs"
22
- },
23
- "./native": {
24
- "types": "./lib/jiti.d.mts",
25
- "import": "./lib/jiti-native.mjs"
26
- },
27
- "./package.json": "./package.json"
28
- },
29
- "main": "./lib/jiti.cjs",
30
- "module": "./lib/jiti.mjs",
31
- "types": "./lib/jiti.d.cts",
32
- "typesVersions": {
33
- "*": {
34
- "register": [
35
- "./lib/jiti-register.d.mts"
36
- ],
37
- "native": [
38
- "./lib/jiti.d.mts"
39
- ]
40
- }
41
- },
42
- "bin": {
43
- "jiti": "./lib/jiti-cli.mjs"
44
- },
45
- "files": [
46
- "lib",
47
- "dist",
48
- "register.cjs"
49
- ],
50
- "scripts": {
51
- "bench": "node test/bench.mjs && deno -A test/bench.mjs && bun --bun test/bench.mjs",
52
- "build": "pnpm clean && pnpm rspack",
53
- "clean": "rm -rf dist",
54
- "dev": "pnpm clean && pnpm rspack --watch",
55
- "jiti": "JITI_DEBUG=1 JITI_JSX=1 lib/jiti-cli.mjs",
56
- "lint": "eslint . && prettier -c src lib test stubs",
57
- "lint:fix": "eslint --fix . && prettier -w src lib test stubs",
58
- "prepack": "pnpm build",
59
- "release": "pnpm build && pnpm test && changelogen --release --push --publish",
60
- "test": "pnpm lint && pnpm test:types && vitest run --coverage && pnpm test:node-register && pnpm test:bun && pnpm test:native",
61
- "test:bun": "bun --bun test test/bun",
62
- "test:native": "pnpm test:native:bun && pnpm test:native:node && pnpm test:native:deno",
63
- "test:native:bun": "bun --bun test test/native/bun.test.ts",
64
- "test:native:deno": "deno test -A --no-check test/native/deno.test.ts",
65
- "test:native:node": "node --test --experimental-strip-types test/native/node.test.ts",
66
- "test:node-register": "JITI_JSX=1 node --test test/node-register.test.mjs",
67
- "test:types": "tsc --noEmit"
68
- },
69
- "devDependencies": {
70
- "@babel/core": "^7.28.4",
71
- "@babel/helper-module-imports": "^7.27.1",
72
- "@babel/helper-module-transforms": "^7.28.3",
73
- "@babel/helper-plugin-utils": "^7.27.1",
74
- "@babel/helper-simple-access": "^7.27.1",
75
- "@babel/plugin-proposal-decorators": "^7.28.0",
76
- "@babel/plugin-syntax-class-properties": "^7.12.13",
77
- "@babel/plugin-syntax-import-assertions": "^7.27.1",
78
- "@babel/plugin-syntax-jsx": "^7.27.1",
79
- "@babel/plugin-transform-export-namespace-from": "^7.27.1",
80
- "@babel/plugin-transform-react-jsx": "^7.27.1",
81
- "@babel/plugin-transform-typescript": "^7.28.0",
82
- "@babel/preset-typescript": "^7.27.1",
83
- "@babel/template": "^7.27.2",
84
- "@babel/traverse": "^7.28.4",
85
- "@babel/types": "^7.28.4",
86
- "@rspack/cli": "^1.5.8",
87
- "@rspack/core": "^1.5.8",
88
- "@types/babel__core": "^7.20.5",
89
- "@types/babel__helper-module-imports": "^7.18.3",
90
- "@types/babel__helper-plugin-utils": "^7.10.3",
91
- "@types/babel__template": "^7.4.4",
92
- "@types/babel__traverse": "^7.28.0",
93
- "@types/node": "^24.6.1",
94
- "@vitest/coverage-v8": "^3.2.4",
95
- "acorn": "^8.15.0",
96
- "babel-plugin-parameter-decorator": "^1.0.16",
97
- "changelogen": "^0.6.2",
98
- "config": "^4.1.1",
99
- "consola": "^3.4.2",
100
- "defu": "^6.1.4",
101
- "destr": "^2.0.5",
102
- "escape-string-regexp": "^5.0.0",
103
- "eslint": "^9.36.0",
104
- "eslint-config-unjs": "^0.5.0",
105
- "estree-walker": "^3.0.3",
106
- "etag": "^1.8.1",
107
- "fast-glob": "^3.3.3",
108
- "is-installed-globally": "^1.0.0",
109
- "mime": "^4.1.0",
110
- "mlly": "^1.8.0",
111
- "moment-timezone": "^0.6.0",
112
- "nano-jsx": "^0.2.0",
113
- "pathe": "^2.0.3",
114
- "pkg-types": "^2.3.0",
115
- "preact": "^10.27.2",
116
- "preact-render-to-string": "^6.6.2",
117
- "prettier": "^3.6.2",
118
- "react": "^19.1.1",
119
- "react-dom": "^19.1.1",
120
- "reflect-metadata": "^0.2.2",
121
- "solid-js": "^1.9.9",
122
- "std-env": "^3.9.0",
123
- "terser-webpack-plugin": "^5.3.14",
124
- "tinyexec": "^1.0.1",
125
- "ts-loader": "^9.5.4",
126
- "typescript": "^5.9.3",
127
- "vitest": "^3.2.4",
128
- "vue": "^3.5.22",
129
- "yoctocolors": "^2.1.2",
130
- "zod": "^4.1.11"
131
- },
132
- "packageManager": "pnpm@10.17.1"
133
- }