@qwik.dev/core 2.0.0-alpha.9 → 2.0.0-beta.10

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.
Files changed (132) hide show
  1. package/bindings/qwik.darwin-arm64.node +0 -0
  2. package/bindings/qwik.darwin-x64.node +0 -0
  3. package/bindings/qwik.linux-x64-gnu.node +0 -0
  4. package/bindings/qwik.wasm.cjs +27 -27
  5. package/bindings/qwik.wasm.mjs +27 -27
  6. package/bindings/qwik.win32-x64-msvc.node +0 -0
  7. package/bindings/qwik_wasm_bg.wasm +0 -0
  8. package/dist/backpatch/index.cjs +6 -0
  9. package/dist/backpatch/index.d.ts +2 -0
  10. package/dist/backpatch/index.mjs +5 -0
  11. package/dist/{prefetch → backpatch}/package.json +2 -2
  12. package/dist/backpatch-executor.debug.js +34 -0
  13. package/dist/backpatch-executor.js +1 -0
  14. package/dist/build/index.cjs +3 -3
  15. package/dist/build/index.d.ts +22 -22
  16. package/dist/build/package.json +1 -1
  17. package/dist/cli.cjs +3035 -767
  18. package/dist/core-internal.d.ts +4622 -4153
  19. package/dist/core.cjs +7327 -6169
  20. package/dist/core.cjs.map +1 -1
  21. package/dist/core.min.mjs +1 -1
  22. package/dist/core.mjs +7294 -6163
  23. package/dist/core.mjs.map +1 -1
  24. package/dist/core.prod.cjs +3209 -2612
  25. package/dist/core.prod.mjs +3932 -3294
  26. package/dist/insights/index.qwik.cjs +1 -4142
  27. package/dist/insights/index.qwik.mjs +63 -4133
  28. package/dist/insights/vite/index.cjs +1 -82
  29. package/dist/insights/vite/index.mjs +65 -37
  30. package/dist/insights/vite.d.ts +22 -0
  31. package/dist/{insights/insights.d.ts → insights.d.ts} +33 -22
  32. package/dist/loader/index.cjs +2 -2
  33. package/dist/loader/index.mjs +2 -2
  34. package/dist/loader/package.json +1 -1
  35. package/dist/optimizer.cjs +201 -3817
  36. package/dist/optimizer.d.ts +754 -707
  37. package/dist/optimizer.mjs +2605 -3628
  38. package/dist/preloader.cjs +266 -0
  39. package/dist/preloader.mjs +195 -0
  40. package/dist/qwikloader.debug.js +228 -222
  41. package/dist/qwikloader.js +1 -3
  42. package/dist/server.cjs +915 -621
  43. package/dist/server.d.ts +519 -402
  44. package/dist/server.mjs +900 -615
  45. package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/vite.config.mts +1 -1
  46. package/dist/starters/adapters/aws-lambda/package.json +1 -1
  47. package/dist/starters/adapters/aws-lambda/serverless.yml +15 -0
  48. package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +2 -8
  49. package/dist/starters/adapters/azure-swa/adapters/azure-swa/vite.config.mts +1 -1
  50. package/dist/starters/adapters/azure-swa/package.json +1 -1
  51. package/dist/starters/adapters/azure-swa/public/staticwebapp.config.json +7 -0
  52. package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +2 -4
  53. package/dist/starters/adapters/bun/adapters/bun/vite.config.mts +2 -2
  54. package/dist/starters/adapters/bun/package.json +1 -1
  55. package/dist/starters/adapters/bun/src/entry.bun.ts +3 -4
  56. package/dist/starters/adapters/cloud-run/adapters/cloud-run/vite.config.mts +1 -1
  57. package/dist/starters/adapters/cloud-run/package.json +1 -1
  58. package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +2 -6
  59. package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/vite.config.mts +1 -1
  60. package/dist/starters/adapters/cloudflare-pages/package.json +1 -1
  61. package/dist/starters/adapters/cloudflare-pages/public/_headers +2 -0
  62. package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +2 -4
  63. package/dist/starters/adapters/deno/adapters/deno/vite.config.mts +1 -1
  64. package/dist/starters/adapters/deno/package.json +1 -1
  65. package/dist/starters/adapters/deno/src/entry.deno.ts +3 -4
  66. package/dist/starters/adapters/express/adapters/express/vite.config.mts +1 -1
  67. package/dist/starters/adapters/express/package.json +1 -1
  68. package/dist/starters/adapters/express/src/entry.express.tsx +6 -5
  69. package/dist/starters/adapters/fastify/adapters/fastify/vite.config.mts +1 -1
  70. package/dist/starters/adapters/fastify/package.json +1 -1
  71. package/dist/starters/adapters/fastify/src/entry.fastify.tsx +3 -2
  72. package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +10 -3
  73. package/dist/starters/adapters/firebase/adapters/firebase/vite.config.mts +1 -1
  74. package/dist/starters/adapters/firebase/firebase.json +12 -1
  75. package/dist/starters/adapters/firebase/functions/index.js +2 -3
  76. package/dist/starters/adapters/firebase/package.json +1 -1
  77. package/dist/starters/adapters/firebase/src/entry-firebase.tsx +2 -4
  78. package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/vite.config.mts +1 -1
  79. package/dist/starters/adapters/netlify-edge/package.json +1 -1
  80. package/dist/starters/adapters/netlify-edge/public/_headers +2 -0
  81. package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +2 -4
  82. package/dist/starters/adapters/node-server/adapters/node-server/vite.config.mts +1 -1
  83. package/dist/starters/adapters/node-server/package.json +1 -1
  84. package/dist/starters/adapters/node-server/src/entry.node-server.tsx +3 -4
  85. package/dist/starters/adapters/ssg/README.md +9 -0
  86. package/dist/starters/adapters/{static/adapters/static → ssg/adapters/ssg}/vite.config.mts +2 -2
  87. package/dist/starters/adapters/ssg/package.json +19 -0
  88. package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/vite.config.mts +1 -1
  89. package/dist/starters/adapters/vercel-edge/package.json +1 -1
  90. package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +2 -4
  91. package/dist/starters/adapters/vercel-edge/vercel.json +1 -1
  92. package/dist/starters/features/auth/package.json +1 -1
  93. package/dist/starters/features/bootstrap/src/routes/bootstrap/layout.tsx +0 -11
  94. package/dist/starters/features/csr/index.html +23 -0
  95. package/dist/starters/features/csr/package.json +29 -0
  96. package/dist/starters/features/csr/src/root.tsx +15 -0
  97. package/dist/starters/features/csr/vite.config.mts +13 -0
  98. package/dist/starters/features/localize/package.json +3 -3
  99. package/dist/starters/features/localize/src/entry.ssr.tsx +17 -23
  100. package/dist/starters/features/localize/src/routes/[locale]/i18n-utils.ts +1 -1
  101. package/dist/starters/features/pandacss/package.json +1 -1
  102. package/dist/starters/features/partytown/package.json +4 -4
  103. package/dist/starters/features/partytown/src/components/partytown/partytown.tsx +2 -2
  104. package/dist/starters/features/playwright/playwright-report/index.html +953 -911
  105. package/dist/starters/features/postcss/postcss.config.js +2 -2
  106. package/dist/starters/features/service-worker/package.json +13 -0
  107. package/dist/starters/features/service-worker/src/routes/service-worker.ts +14 -0
  108. package/dist/starters/features/styled-vanilla-extract/package.json +2 -1
  109. package/dist/starters/features/tailwind/package.json +4 -3
  110. package/dist/starters/features/tailwind/prettier.config.js +10 -0
  111. package/dist/starters/features/tailwind/src/global.css +1 -1
  112. package/dist/starters/features/tailwind-v3/package.json +1 -1
  113. package/dist/starters/features/tailwind-v3/prettier.config.js +10 -0
  114. package/dist/starters/features/tailwind-v3/tailwind.config.js +2 -2
  115. package/dist/testing/index.cjs +14313 -11732
  116. package/dist/testing/index.d.ts +1112 -141
  117. package/dist/testing/index.mjs +14225 -11661
  118. package/dist/testing/package.json +1 -1
  119. package/package.json +28 -14
  120. package/public.d.ts +5 -0
  121. package/server.d.ts +1 -0
  122. package/dist/insights/index.d.ts +0 -1
  123. package/dist/insights/vite/index.d.ts +0 -1
  124. package/dist/insights/vite/insights-plugin.d.ts +0 -10
  125. package/dist/prefetch/index.cjs +0 -4
  126. package/dist/prefetch/index.d.ts +0 -2
  127. package/dist/prefetch/index.mjs +0 -3
  128. package/dist/qwik-prefetch.debug.js +0 -244
  129. package/dist/qwik-prefetch.js +0 -1
  130. package/dist/starters/adapters/static/README.md +0 -5
  131. package/dist/starters/adapters/static/package.json +0 -19
  132. package/dist/starters/features/tailwind/.prettierrc.js +0 -3
package/dist/cli.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/cli 2.0.0-alpha.9-dev+56ed5bd
3
+ * @qwik.dev/core/cli 2.0.0-beta.10-dev+4669425
4
4
  * Copyright QwikDev. All Rights Reserved.
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
@@ -48,14 +48,14 @@ var require_src = __commonJS({
48
48
  var CSI = `${ESC}[`;
49
49
  var beep = "\x07";
50
50
  var cursor = {
51
- to(x3, y3) {
52
- if (!y3) return `${CSI}${x3 + 1}G`;
53
- return `${CSI}${y3 + 1};${x3 + 1}H`;
51
+ to(x2, y3) {
52
+ if (!y3) return `${CSI}${x2 + 1}G`;
53
+ return `${CSI}${y3 + 1};${x2 + 1}H`;
54
54
  },
55
- move(x3, y3) {
55
+ move(x2, y3) {
56
56
  let ret = "";
57
- if (x3 < 0) ret += `${CSI}${-x3}D`;
58
- else if (x3 > 0) ret += `${CSI}${x3}C`;
57
+ if (x2 < 0) ret += `${CSI}${-x2}D`;
58
+ else if (x2 > 0) ret += `${CSI}${x2}C`;
59
59
  if (y3 < 0) ret += `${CSI}${-y3}A`;
60
60
  else if (y3 > 0) ret += `${CSI}${y3}B`;
61
61
  return ret;
@@ -99,10 +99,10 @@ var require_src = __commonJS({
99
99
  // node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
100
100
  var require_picocolors = __commonJS({
101
101
  "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports2, module2) {
102
- var p = process || {};
103
- var argv = p.argv || [];
104
- var env = p.env || {};
105
- var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
102
+ var p2 = process || {};
103
+ var argv = p2.argv || [];
104
+ var env = p2.env || {};
105
+ var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p2.platform === "win32" || (p2.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
106
106
  var formatter = (open, close, replace = open) => (input) => {
107
107
  let string = "" + input, index = string.indexOf(close, open.length);
108
108
  return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
@@ -117,50 +117,50 @@ var require_picocolors = __commonJS({
117
117
  return result + string.substring(cursor);
118
118
  };
119
119
  var createColors = (enabled = isColorSupported) => {
120
- let f3 = enabled ? formatter : () => String;
120
+ let f = enabled ? formatter : () => String;
121
121
  return {
122
122
  isColorSupported: enabled,
123
- reset: f3("\x1B[0m", "\x1B[0m"),
124
- bold: f3("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
125
- dim: f3("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
126
- italic: f3("\x1B[3m", "\x1B[23m"),
127
- underline: f3("\x1B[4m", "\x1B[24m"),
128
- inverse: f3("\x1B[7m", "\x1B[27m"),
129
- hidden: f3("\x1B[8m", "\x1B[28m"),
130
- strikethrough: f3("\x1B[9m", "\x1B[29m"),
131
- black: f3("\x1B[30m", "\x1B[39m"),
132
- red: f3("\x1B[31m", "\x1B[39m"),
133
- green: f3("\x1B[32m", "\x1B[39m"),
134
- yellow: f3("\x1B[33m", "\x1B[39m"),
135
- blue: f3("\x1B[34m", "\x1B[39m"),
136
- magenta: f3("\x1B[35m", "\x1B[39m"),
137
- cyan: f3("\x1B[36m", "\x1B[39m"),
138
- white: f3("\x1B[37m", "\x1B[39m"),
139
- gray: f3("\x1B[90m", "\x1B[39m"),
140
- bgBlack: f3("\x1B[40m", "\x1B[49m"),
141
- bgRed: f3("\x1B[41m", "\x1B[49m"),
142
- bgGreen: f3("\x1B[42m", "\x1B[49m"),
143
- bgYellow: f3("\x1B[43m", "\x1B[49m"),
144
- bgBlue: f3("\x1B[44m", "\x1B[49m"),
145
- bgMagenta: f3("\x1B[45m", "\x1B[49m"),
146
- bgCyan: f3("\x1B[46m", "\x1B[49m"),
147
- bgWhite: f3("\x1B[47m", "\x1B[49m"),
148
- blackBright: f3("\x1B[90m", "\x1B[39m"),
149
- redBright: f3("\x1B[91m", "\x1B[39m"),
150
- greenBright: f3("\x1B[92m", "\x1B[39m"),
151
- yellowBright: f3("\x1B[93m", "\x1B[39m"),
152
- blueBright: f3("\x1B[94m", "\x1B[39m"),
153
- magentaBright: f3("\x1B[95m", "\x1B[39m"),
154
- cyanBright: f3("\x1B[96m", "\x1B[39m"),
155
- whiteBright: f3("\x1B[97m", "\x1B[39m"),
156
- bgBlackBright: f3("\x1B[100m", "\x1B[49m"),
157
- bgRedBright: f3("\x1B[101m", "\x1B[49m"),
158
- bgGreenBright: f3("\x1B[102m", "\x1B[49m"),
159
- bgYellowBright: f3("\x1B[103m", "\x1B[49m"),
160
- bgBlueBright: f3("\x1B[104m", "\x1B[49m"),
161
- bgMagentaBright: f3("\x1B[105m", "\x1B[49m"),
162
- bgCyanBright: f3("\x1B[106m", "\x1B[49m"),
163
- bgWhiteBright: f3("\x1B[107m", "\x1B[49m")
123
+ reset: f("\x1B[0m", "\x1B[0m"),
124
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
125
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
126
+ italic: f("\x1B[3m", "\x1B[23m"),
127
+ underline: f("\x1B[4m", "\x1B[24m"),
128
+ inverse: f("\x1B[7m", "\x1B[27m"),
129
+ hidden: f("\x1B[8m", "\x1B[28m"),
130
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
131
+ black: f("\x1B[30m", "\x1B[39m"),
132
+ red: f("\x1B[31m", "\x1B[39m"),
133
+ green: f("\x1B[32m", "\x1B[39m"),
134
+ yellow: f("\x1B[33m", "\x1B[39m"),
135
+ blue: f("\x1B[34m", "\x1B[39m"),
136
+ magenta: f("\x1B[35m", "\x1B[39m"),
137
+ cyan: f("\x1B[36m", "\x1B[39m"),
138
+ white: f("\x1B[37m", "\x1B[39m"),
139
+ gray: f("\x1B[90m", "\x1B[39m"),
140
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
141
+ bgRed: f("\x1B[41m", "\x1B[49m"),
142
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
143
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
144
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
145
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
146
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
147
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
148
+ blackBright: f("\x1B[90m", "\x1B[39m"),
149
+ redBright: f("\x1B[91m", "\x1B[39m"),
150
+ greenBright: f("\x1B[92m", "\x1B[39m"),
151
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
152
+ blueBright: f("\x1B[94m", "\x1B[39m"),
153
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
154
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
155
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
156
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
157
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
158
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
159
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
160
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
161
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
162
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
163
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
164
164
  };
165
165
  };
166
166
  module2.exports = createColors();
@@ -168,339 +168,367 @@ var require_picocolors = __commonJS({
168
168
  }
169
169
  });
170
170
 
171
- // node_modules/.pnpm/@clack+core@0.3.4/node_modules/@clack/core/dist/index.mjs
172
- function q({ onlyFirst: t = false } = {}) {
173
- const u = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
174
- return new RegExp(u, t ? void 0 : "g");
171
+ // node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/dist/index.mjs
172
+ function DD({ onlyFirst: e2 = false } = {}) {
173
+ const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
174
+ return new RegExp(t, e2 ? void 0 : "g");
175
175
  }
176
- function S(t) {
177
- if (typeof t != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
178
- return t.replace(q(), "");
176
+ function P(e2) {
177
+ if (typeof e2 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof e2}\``);
178
+ return e2.replace(uD, "");
179
179
  }
180
- function j(t) {
181
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
180
+ function L(e2) {
181
+ return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
182
182
  }
183
- function A(t, u = {}) {
184
- if (typeof t != "string" || t.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, t = S(t), t.length === 0)) return 0;
185
- t = t.replace(DD(), " ");
186
- const F = u.ambiguousIsNarrow ? 1 : 2;
187
- let e2 = 0;
188
- for (const s2 of t) {
189
- const C2 = s2.codePointAt(0);
190
- if (C2 <= 31 || C2 >= 127 && C2 <= 159 || C2 >= 768 && C2 <= 879) continue;
191
- switch (Q.eastAsianWidth(s2)) {
183
+ function p(e2, u2 = {}) {
184
+ if (typeof e2 != "string" || e2.length === 0 || (u2 = { ambiguousIsNarrow: true, ...u2 }, e2 = P(e2), e2.length === 0)) return 0;
185
+ e2 = e2.replace(sD(), " ");
186
+ const t = u2.ambiguousIsNarrow ? 1 : 2;
187
+ let F2 = 0;
188
+ for (const s2 of e2) {
189
+ const i = s2.codePointAt(0);
190
+ if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879) continue;
191
+ switch (eD.eastAsianWidth(s2)) {
192
192
  case "F":
193
193
  case "W":
194
- e2 += 2;
194
+ F2 += 2;
195
195
  break;
196
196
  case "A":
197
- e2 += F;
197
+ F2 += t;
198
198
  break;
199
199
  default:
200
- e2 += 1;
200
+ F2 += 1;
201
201
  }
202
202
  }
203
- return e2;
203
+ return F2;
204
204
  }
205
- function tD() {
206
- const t = /* @__PURE__ */ new Map();
207
- for (const [u, F] of Object.entries(r)) {
208
- for (const [e2, s2] of Object.entries(F)) r[e2] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F[e2] = r[e2], t.set(s2[0], s2[1]);
209
- Object.defineProperty(r, u, { value: F, enumerable: false });
210
- }
211
- return Object.defineProperty(r, "codes", { value: t, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = T(), r.color.ansi256 = P(), r.color.ansi16m = W(), r.bgColor.ansi = T(m), r.bgColor.ansi256 = P(m), r.bgColor.ansi16m = W(m), Object.defineProperties(r, { rgbToAnsi256: { value: (u, F, e2) => u === F && F === e2 ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(F / 255 * 5) + Math.round(e2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
212
- const F = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
213
- if (!F) return [0, 0, 0];
214
- let [e2] = F;
215
- e2.length === 3 && (e2 = [...e2].map((C2) => C2 + C2).join(""));
216
- const s2 = Number.parseInt(e2, 16);
205
+ function rD() {
206
+ const e2 = /* @__PURE__ */ new Map();
207
+ for (const [u2, t] of Object.entries(r)) {
208
+ for (const [F2, s2] of Object.entries(t)) r[F2] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, t[F2] = r[F2], e2.set(s2[0], s2[1]);
209
+ Object.defineProperty(r, u2, { value: t, enumerable: false });
210
+ }
211
+ return Object.defineProperty(r, "codes", { value: e2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = N(), r.color.ansi256 = I(), r.color.ansi16m = R(), r.bgColor.ansi = N(w), r.bgColor.ansi256 = I(w), r.bgColor.ansi16m = R(w), Object.defineProperties(r, { rgbToAnsi256: { value: (u2, t, F2) => u2 === t && t === F2 ? u2 < 8 ? 16 : u2 > 248 ? 231 : Math.round((u2 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u2 / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u2) => {
212
+ const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u2.toString(16));
213
+ if (!t) return [0, 0, 0];
214
+ let [F2] = t;
215
+ F2.length === 3 && (F2 = [...F2].map((i) => i + i).join(""));
216
+ const s2 = Number.parseInt(F2, 16);
217
217
  return [s2 >> 16 & 255, s2 >> 8 & 255, s2 & 255];
218
- }, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
219
- if (u < 8) return 30 + u;
220
- if (u < 16) return 90 + (u - 8);
221
- let F, e2, s2;
222
- if (u >= 232) F = ((u - 232) * 10 + 8) / 255, e2 = F, s2 = F;
218
+ }, enumerable: false }, hexToAnsi256: { value: (u2) => r.rgbToAnsi256(...r.hexToRgb(u2)), enumerable: false }, ansi256ToAnsi: { value: (u2) => {
219
+ if (u2 < 8) return 30 + u2;
220
+ if (u2 < 16) return 90 + (u2 - 8);
221
+ let t, F2, s2;
222
+ if (u2 >= 232) t = ((u2 - 232) * 10 + 8) / 255, F2 = t, s2 = t;
223
223
  else {
224
- u -= 16;
225
- const i = u % 36;
226
- F = Math.floor(u / 36) / 5, e2 = Math.floor(i / 6) / 5, s2 = i % 6 / 5;
227
- }
228
- const C2 = Math.max(F, e2, s2) * 2;
229
- if (C2 === 0) return 30;
230
- let D = 30 + (Math.round(s2) << 2 | Math.round(e2) << 1 | Math.round(F));
231
- return C2 === 2 && (D += 60), D;
232
- }, enumerable: false }, rgbToAnsi: { value: (u, F, e2) => r.ansi256ToAnsi(r.rgbToAnsi256(u, F, e2)), enumerable: false }, hexToAnsi: { value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)), enumerable: false } }), r;
224
+ u2 -= 16;
225
+ const C2 = u2 % 36;
226
+ t = Math.floor(u2 / 36) / 5, F2 = Math.floor(C2 / 6) / 5, s2 = C2 % 6 / 5;
227
+ }
228
+ const i = Math.max(t, F2, s2) * 2;
229
+ if (i === 0) return 30;
230
+ let D2 = 30 + (Math.round(s2) << 2 | Math.round(F2) << 1 | Math.round(t));
231
+ return i === 2 && (D2 += 60), D2;
232
+ }, enumerable: false }, rgbToAnsi: { value: (u2, t, F2) => r.ansi256ToAnsi(r.rgbToAnsi256(u2, t, F2)), enumerable: false }, hexToAnsi: { value: (u2) => r.ansi256ToAnsi(r.hexToAnsi256(u2)), enumerable: false } }), r;
233
233
  }
234
- function R(t, u, F) {
235
- return String(t).normalize().replace(/\r\n/g, `
234
+ function Y(e2, u2, t) {
235
+ return String(e2).normalize().replace(/\r\n/g, `
236
236
  `).split(`
237
- `).map((e2) => ED(e2, u, F)).join(`
237
+ `).map((F2) => lD(F2, u2, t)).join(`
238
238
  `);
239
239
  }
240
- function aD(t, u) {
241
- if (t === u) return;
242
- const F = t.split(`
243
- `), e2 = u.split(`
240
+ function $2(e2, u2) {
241
+ if (typeof e2 == "string") return B.aliases.get(e2) === u2;
242
+ for (const t of e2) if (t !== void 0 && $2(t, u2)) return true;
243
+ return false;
244
+ }
245
+ function BD(e2, u2) {
246
+ if (e2 === u2) return;
247
+ const t = e2.split(`
248
+ `), F2 = u2.split(`
244
249
  `), s2 = [];
245
- for (let C2 = 0; C2 < Math.max(F.length, e2.length); C2++) F[C2] !== e2[C2] && s2.push(C2);
250
+ for (let i = 0; i < Math.max(t.length, F2.length); i++) t[i] !== F2[i] && s2.push(i);
246
251
  return s2;
247
252
  }
248
- function hD(t) {
249
- return t === V;
253
+ function pD(e2) {
254
+ return e2 === S;
250
255
  }
251
- function v(t, u) {
252
- t.isTTY && t.setRawMode(u);
256
+ function m(e2, u2) {
257
+ const t = e2;
258
+ t.isTTY && t.setRawMode(u2);
253
259
  }
254
- function WD({ input: t = import_node_process.stdin, output: u = import_node_process.stdout, overwrite: F = true, hideCursor: e2 = true } = {}) {
255
- const s2 = f.createInterface({ input: t, output: u, prompt: "", tabSize: 1 });
256
- f.emitKeypressEvents(t, s2), t.isTTY && t.setRawMode(true);
257
- const C2 = (D, { name: i }) => {
258
- if (String(D) === "" && process.exit(0), !F) return;
259
- let n = i === "return" ? 0 : -1, E2 = i === "return" ? -1 : 0;
260
- f.moveCursor(u, n, E2, () => {
261
- f.clearLine(u, 1, () => {
262
- t.once("keypress", C2);
260
+ function fD({ input: e2 = import_node_process.stdin, output: u2 = import_node_process.stdout, overwrite: t = true, hideCursor: F2 = true } = {}) {
261
+ const s2 = g.createInterface({ input: e2, output: u2, prompt: "", tabSize: 1 });
262
+ g.emitKeypressEvents(e2, s2), e2.isTTY && e2.setRawMode(true);
263
+ const i = (D2, { name: C2, sequence: n }) => {
264
+ const E = String(D2);
265
+ if ($2([E, C2, n], "cancel")) {
266
+ F2 && u2.write(import_sisteransi.cursor.show), process.exit(0);
267
+ return;
268
+ }
269
+ if (!t) return;
270
+ const a = C2 === "return" ? 0 : -1, o2 = C2 === "return" ? -1 : 0;
271
+ g.moveCursor(u2, a, o2, () => {
272
+ g.clearLine(u2, 1, () => {
273
+ e2.once("keypress", i);
263
274
  });
264
275
  });
265
276
  };
266
- return e2 && process.stdout.write(import_sisteransi.cursor.hide), t.once("keypress", C2), () => {
267
- t.off("keypress", C2), e2 && process.stdout.write(import_sisteransi.cursor.show), t.isTTY && !PD && t.setRawMode(false), s2.terminal = false, s2.close();
277
+ return F2 && u2.write(import_sisteransi.cursor.hide), e2.once("keypress", i), () => {
278
+ e2.off("keypress", i), F2 && u2.write(import_sisteransi.cursor.show), e2.isTTY && !AD && e2.setRawMode(false), s2.terminal = false, s2.close();
268
279
  };
269
280
  }
270
- var import_sisteransi, import_node_process, f, import_node_readline, import_node_tty, import_picocolors, M, J, Q, X, DD, m, T, P, W, r, uD, FD, eD, g, sD, b, O, CD, I, w, N, L, iD, y, rD, ED, oD, nD, a, V, z, lD, x, xD, bD, wD, Z, yD, SD, jD, MD, TD, PD;
281
+ var import_sisteransi, import_node_process, g, import_node_readline, import_node_stream, import_picocolors, uD, W, tD, eD, FD, sD, w, N, I, R, r, iD, CD, ED, d, oD, y, V, nD, G, _, z, K, aD, k, hD, lD, xD, B, AD, S, gD, vD, h, x, dD, A, OD, PD, J, LD, RD;
271
282
  var init_dist = __esm({
272
- "node_modules/.pnpm/@clack+core@0.3.4/node_modules/@clack/core/dist/index.mjs"() {
283
+ "node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/dist/index.mjs"() {
273
284
  import_sisteransi = __toESM(require_src(), 1);
274
285
  import_node_process = require("node:process");
275
- f = __toESM(require("node:readline"), 1);
286
+ g = __toESM(require("node:readline"), 1);
276
287
  import_node_readline = __toESM(require("node:readline"), 1);
277
- import_node_tty = require("node:tty");
288
+ import_node_stream = require("node:stream");
278
289
  import_picocolors = __toESM(require_picocolors(), 1);
279
- M = { exports: {} };
280
- (function(t) {
281
- var u = {};
282
- t.exports = u, u.eastAsianWidth = function(e2) {
283
- var s2 = e2.charCodeAt(0), C2 = e2.length == 2 ? e2.charCodeAt(1) : 0, D = s2;
284
- return 55296 <= s2 && s2 <= 56319 && 56320 <= C2 && C2 <= 57343 && (s2 &= 1023, C2 &= 1023, D = s2 << 10 | C2, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
285
- }, u.characterLength = function(e2) {
286
- var s2 = this.eastAsianWidth(e2);
290
+ uD = DD();
291
+ W = { exports: {} };
292
+ (function(e2) {
293
+ var u2 = {};
294
+ e2.exports = u2, u2.eastAsianWidth = function(F2) {
295
+ var s2 = F2.charCodeAt(0), i = F2.length == 2 ? F2.charCodeAt(1) : 0, D2 = s2;
296
+ return 55296 <= s2 && s2 <= 56319 && 56320 <= i && i <= 57343 && (s2 &= 1023, i &= 1023, D2 = s2 << 10 | i, D2 += 65536), D2 == 12288 || 65281 <= D2 && D2 <= 65376 || 65504 <= D2 && D2 <= 65510 ? "F" : D2 == 8361 || 65377 <= D2 && D2 <= 65470 || 65474 <= D2 && D2 <= 65479 || 65482 <= D2 && D2 <= 65487 || 65490 <= D2 && D2 <= 65495 || 65498 <= D2 && D2 <= 65500 || 65512 <= D2 && D2 <= 65518 ? "H" : 4352 <= D2 && D2 <= 4447 || 4515 <= D2 && D2 <= 4519 || 4602 <= D2 && D2 <= 4607 || 9001 <= D2 && D2 <= 9002 || 11904 <= D2 && D2 <= 11929 || 11931 <= D2 && D2 <= 12019 || 12032 <= D2 && D2 <= 12245 || 12272 <= D2 && D2 <= 12283 || 12289 <= D2 && D2 <= 12350 || 12353 <= D2 && D2 <= 12438 || 12441 <= D2 && D2 <= 12543 || 12549 <= D2 && D2 <= 12589 || 12593 <= D2 && D2 <= 12686 || 12688 <= D2 && D2 <= 12730 || 12736 <= D2 && D2 <= 12771 || 12784 <= D2 && D2 <= 12830 || 12832 <= D2 && D2 <= 12871 || 12880 <= D2 && D2 <= 13054 || 13056 <= D2 && D2 <= 19903 || 19968 <= D2 && D2 <= 42124 || 42128 <= D2 && D2 <= 42182 || 43360 <= D2 && D2 <= 43388 || 44032 <= D2 && D2 <= 55203 || 55216 <= D2 && D2 <= 55238 || 55243 <= D2 && D2 <= 55291 || 63744 <= D2 && D2 <= 64255 || 65040 <= D2 && D2 <= 65049 || 65072 <= D2 && D2 <= 65106 || 65108 <= D2 && D2 <= 65126 || 65128 <= D2 && D2 <= 65131 || 110592 <= D2 && D2 <= 110593 || 127488 <= D2 && D2 <= 127490 || 127504 <= D2 && D2 <= 127546 || 127552 <= D2 && D2 <= 127560 || 127568 <= D2 && D2 <= 127569 || 131072 <= D2 && D2 <= 194367 || 177984 <= D2 && D2 <= 196605 || 196608 <= D2 && D2 <= 262141 ? "W" : 32 <= D2 && D2 <= 126 || 162 <= D2 && D2 <= 163 || 165 <= D2 && D2 <= 166 || D2 == 172 || D2 == 175 || 10214 <= D2 && D2 <= 10221 || 10629 <= D2 && D2 <= 10630 ? "Na" : D2 == 161 || D2 == 164 || 167 <= D2 && D2 <= 168 || D2 == 170 || 173 <= D2 && D2 <= 174 || 176 <= D2 && D2 <= 180 || 182 <= D2 && D2 <= 186 || 188 <= D2 && D2 <= 191 || D2 == 198 || D2 == 208 || 215 <= D2 && D2 <= 216 || 222 <= D2 && D2 <= 225 || D2 == 230 || 232 <= D2 && D2 <= 234 || 236 <= D2 && D2 <= 237 || D2 == 240 || 242 <= D2 && D2 <= 243 || 247 <= D2 && D2 <= 250 || D2 == 252 || D2 == 254 || D2 == 257 || D2 == 273 || D2 == 275 || D2 == 283 || 294 <= D2 && D2 <= 295 || D2 == 299 || 305 <= D2 && D2 <= 307 || D2 == 312 || 319 <= D2 && D2 <= 322 || D2 == 324 || 328 <= D2 && D2 <= 331 || D2 == 333 || 338 <= D2 && D2 <= 339 || 358 <= D2 && D2 <= 359 || D2 == 363 || D2 == 462 || D2 == 464 || D2 == 466 || D2 == 468 || D2 == 470 || D2 == 472 || D2 == 474 || D2 == 476 || D2 == 593 || D2 == 609 || D2 == 708 || D2 == 711 || 713 <= D2 && D2 <= 715 || D2 == 717 || D2 == 720 || 728 <= D2 && D2 <= 731 || D2 == 733 || D2 == 735 || 768 <= D2 && D2 <= 879 || 913 <= D2 && D2 <= 929 || 931 <= D2 && D2 <= 937 || 945 <= D2 && D2 <= 961 || 963 <= D2 && D2 <= 969 || D2 == 1025 || 1040 <= D2 && D2 <= 1103 || D2 == 1105 || D2 == 8208 || 8211 <= D2 && D2 <= 8214 || 8216 <= D2 && D2 <= 8217 || 8220 <= D2 && D2 <= 8221 || 8224 <= D2 && D2 <= 8226 || 8228 <= D2 && D2 <= 8231 || D2 == 8240 || 8242 <= D2 && D2 <= 8243 || D2 == 8245 || D2 == 8251 || D2 == 8254 || D2 == 8308 || D2 == 8319 || 8321 <= D2 && D2 <= 8324 || D2 == 8364 || D2 == 8451 || D2 == 8453 || D2 == 8457 || D2 == 8467 || D2 == 8470 || 8481 <= D2 && D2 <= 8482 || D2 == 8486 || D2 == 8491 || 8531 <= D2 && D2 <= 8532 || 8539 <= D2 && D2 <= 8542 || 8544 <= D2 && D2 <= 8555 || 8560 <= D2 && D2 <= 8569 || D2 == 8585 || 8592 <= D2 && D2 <= 8601 || 8632 <= D2 && D2 <= 8633 || D2 == 8658 || D2 == 8660 || D2 == 8679 || D2 == 8704 || 8706 <= D2 && D2 <= 8707 || 8711 <= D2 && D2 <= 8712 || D2 == 8715 || D2 == 8719 || D2 == 8721 || D2 == 8725 || D2 == 8730 || 8733 <= D2 && D2 <= 8736 || D2 == 8739 || D2 == 8741 || 8743 <= D2 && D2 <= 8748 || D2 == 8750 || 8756 <= D2 && D2 <= 8759 || 8764 <= D2 && D2 <= 8765 || D2 == 8776 || D2 == 8780 || D2 == 8786 || 8800 <= D2 && D2 <= 8801 || 8804 <= D2 && D2 <= 8807 || 8810 <= D2 && D2 <= 8811 || 8814 <= D2 && D2 <= 8815 || 8834 <= D2 && D2 <= 8835 || 8838 <= D2 && D2 <= 8839 || D2 == 8853 || D2 == 8857 || D2 == 8869 || D2 == 8895 || D2 == 8978 || 9312 <= D2 && D2 <= 9449 || 9451 <= D2 && D2 <= 9547 || 9552 <= D2 && D2 <= 9587 || 9600 <= D2 && D2 <= 9615 || 9618 <= D2 && D2 <= 9621 || 9632 <= D2 && D2 <= 9633 || 9635 <= D2 && D2 <= 9641 || 9650 <= D2 && D2 <= 9651 || 9654 <= D2 && D2 <= 9655 || 9660 <= D2 && D2 <= 9661 || 9664 <= D2 && D2 <= 9665 || 9670 <= D2 && D2 <= 9672 || D2 == 9675 || 9678 <= D2 && D2 <= 9681 || 9698 <= D2 && D2 <= 9701 || D2 == 9711 || 9733 <= D2 && D2 <= 9734 || D2 == 9737 || 9742 <= D2 && D2 <= 9743 || 9748 <= D2 && D2 <= 9749 || D2 == 9756 || D2 == 9758 || D2 == 9792 || D2 == 9794 || 9824 <= D2 && D2 <= 9825 || 9827 <= D2 && D2 <= 9829 || 9831 <= D2 && D2 <= 9834 || 9836 <= D2 && D2 <= 9837 || D2 == 9839 || 9886 <= D2 && D2 <= 9887 || 9918 <= D2 && D2 <= 9919 || 9924 <= D2 && D2 <= 9933 || 9935 <= D2 && D2 <= 9953 || D2 == 9955 || 9960 <= D2 && D2 <= 9983 || D2 == 10045 || D2 == 10071 || 10102 <= D2 && D2 <= 10111 || 11093 <= D2 && D2 <= 11097 || 12872 <= D2 && D2 <= 12879 || 57344 <= D2 && D2 <= 63743 || 65024 <= D2 && D2 <= 65039 || D2 == 65533 || 127232 <= D2 && D2 <= 127242 || 127248 <= D2 && D2 <= 127277 || 127280 <= D2 && D2 <= 127337 || 127344 <= D2 && D2 <= 127386 || 917760 <= D2 && D2 <= 917999 || 983040 <= D2 && D2 <= 1048573 || 1048576 <= D2 && D2 <= 1114109 ? "A" : "N";
297
+ }, u2.characterLength = function(F2) {
298
+ var s2 = this.eastAsianWidth(F2);
287
299
  return s2 == "F" || s2 == "W" || s2 == "A" ? 2 : 1;
288
300
  };
289
- function F(e2) {
290
- return e2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
291
- }
292
- u.length = function(e2) {
293
- for (var s2 = F(e2), C2 = 0, D = 0; D < s2.length; D++) C2 = C2 + this.characterLength(s2[D]);
294
- return C2;
295
- }, u.slice = function(e2, s2, C2) {
296
- textLen = u.length(e2), s2 = s2 || 0, C2 = C2 || 1, s2 < 0 && (s2 = textLen + s2), C2 < 0 && (C2 = textLen + C2);
297
- for (var D = "", i = 0, n = F(e2), E2 = 0; E2 < n.length; E2++) {
298
- var h2 = n[E2], o2 = u.length(h2);
299
- if (i >= s2 - (o2 == 2 ? 1 : 0)) if (i + o2 <= C2) D += h2;
301
+ function t(F2) {
302
+ return F2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
303
+ }
304
+ u2.length = function(F2) {
305
+ for (var s2 = t(F2), i = 0, D2 = 0; D2 < s2.length; D2++) i = i + this.characterLength(s2[D2]);
306
+ return i;
307
+ }, u2.slice = function(F2, s2, i) {
308
+ textLen = u2.length(F2), s2 = s2 || 0, i = i || 1, s2 < 0 && (s2 = textLen + s2), i < 0 && (i = textLen + i);
309
+ for (var D2 = "", C2 = 0, n = t(F2), E = 0; E < n.length; E++) {
310
+ var a = n[E], o2 = u2.length(a);
311
+ if (C2 >= s2 - (o2 == 2 ? 1 : 0)) if (C2 + o2 <= i) D2 += a;
300
312
  else break;
301
- i += o2;
313
+ C2 += o2;
302
314
  }
303
- return D;
315
+ return D2;
304
316
  };
305
- })(M);
306
- J = M.exports;
307
- Q = j(J);
308
- X = function() {
317
+ })(W);
318
+ tD = W.exports;
319
+ eD = L(tD);
320
+ FD = function() {
309
321
  return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
310
322
  };
311
- DD = j(X);
312
- m = 10;
313
- T = (t = 0) => (u) => `\x1B[${u + t}m`;
314
- P = (t = 0) => (u) => `\x1B[${38 + t};5;${u}m`;
315
- W = (t = 0) => (u, F, e2) => `\x1B[${38 + t};2;${u};${F};${e2}m`;
323
+ sD = L(FD);
324
+ w = 10;
325
+ N = (e2 = 0) => (u2) => `\x1B[${u2 + e2}m`;
326
+ I = (e2 = 0) => (u2) => `\x1B[${38 + e2};5;${u2}m`;
327
+ R = (e2 = 0) => (u2, t, F2) => `\x1B[${38 + e2};2;${u2};${t};${F2}m`;
316
328
  r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
317
329
  Object.keys(r.modifier);
318
- uD = Object.keys(r.color);
319
- FD = Object.keys(r.bgColor);
320
- [...uD, ...FD];
321
- eD = tD();
322
- g = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
323
- sD = 39;
324
- b = "\x07";
325
- O = "[";
326
- CD = "]";
327
- I = "m";
328
- w = `${CD}8;;`;
329
- N = (t) => `${g.values().next().value}${O}${t}${I}`;
330
- L = (t) => `${g.values().next().value}${w}${t}${b}`;
331
- iD = (t) => t.split(" ").map((u) => A(u));
332
- y = (t, u, F) => {
333
- const e2 = [...u];
334
- let s2 = false, C2 = false, D = A(S(t[t.length - 1]));
335
- for (const [i, n] of e2.entries()) {
336
- const E2 = A(n);
337
- if (D + E2 <= F ? t[t.length - 1] += n : (t.push(n), D = 0), g.has(n) && (s2 = true, C2 = e2.slice(i + 1).join("").startsWith(w)), s2) {
338
- C2 ? n === b && (s2 = false, C2 = false) : n === I && (s2 = false);
330
+ iD = Object.keys(r.color);
331
+ CD = Object.keys(r.bgColor);
332
+ [...iD, ...CD];
333
+ ED = rD();
334
+ d = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
335
+ oD = 39;
336
+ y = "\x07";
337
+ V = "[";
338
+ nD = "]";
339
+ G = "m";
340
+ _ = `${nD}8;;`;
341
+ z = (e2) => `${d.values().next().value}${V}${e2}${G}`;
342
+ K = (e2) => `${d.values().next().value}${_}${e2}${y}`;
343
+ aD = (e2) => e2.split(" ").map((u2) => p(u2));
344
+ k = (e2, u2, t) => {
345
+ const F2 = [...u2];
346
+ let s2 = false, i = false, D2 = p(P(e2[e2.length - 1]));
347
+ for (const [C2, n] of F2.entries()) {
348
+ const E = p(n);
349
+ if (D2 + E <= t ? e2[e2.length - 1] += n : (e2.push(n), D2 = 0), d.has(n) && (s2 = true, i = F2.slice(C2 + 1).join("").startsWith(_)), s2) {
350
+ i ? n === y && (s2 = false, i = false) : n === G && (s2 = false);
339
351
  continue;
340
352
  }
341
- D += E2, D === F && i < e2.length - 1 && (t.push(""), D = 0);
353
+ D2 += E, D2 === t && C2 < F2.length - 1 && (e2.push(""), D2 = 0);
342
354
  }
343
- !D && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
355
+ !D2 && e2[e2.length - 1].length > 0 && e2.length > 1 && (e2[e2.length - 2] += e2.pop());
344
356
  };
345
- rD = (t) => {
346
- const u = t.split(" ");
347
- let F = u.length;
348
- for (; F > 0 && !(A(u[F - 1]) > 0); ) F--;
349
- return F === u.length ? t : u.slice(0, F).join(" ") + u.slice(F).join("");
357
+ hD = (e2) => {
358
+ const u2 = e2.split(" ");
359
+ let t = u2.length;
360
+ for (; t > 0 && !(p(u2[t - 1]) > 0); ) t--;
361
+ return t === u2.length ? e2 : u2.slice(0, t).join(" ") + u2.slice(t).join("");
350
362
  };
351
- ED = (t, u, F = {}) => {
352
- if (F.trim !== false && t.trim() === "") return "";
353
- let e2 = "", s2, C2;
354
- const D = iD(t);
355
- let i = [""];
356
- for (const [E2, h2] of t.split(" ").entries()) {
357
- F.trim !== false && (i[i.length - 1] = i[i.length - 1].trimStart());
358
- let o2 = A(i[i.length - 1]);
359
- if (E2 !== 0 && (o2 >= u && (F.wordWrap === false || F.trim === false) && (i.push(""), o2 = 0), (o2 > 0 || F.trim === false) && (i[i.length - 1] += " ", o2++)), F.hard && D[E2] > u) {
360
- const B2 = u - o2, p = 1 + Math.floor((D[E2] - B2 - 1) / u);
361
- Math.floor((D[E2] - 1) / u) < p && i.push(""), y(i, h2, u);
363
+ lD = (e2, u2, t = {}) => {
364
+ if (t.trim !== false && e2.trim() === "") return "";
365
+ let F2 = "", s2, i;
366
+ const D2 = aD(e2);
367
+ let C2 = [""];
368
+ for (const [E, a] of e2.split(" ").entries()) {
369
+ t.trim !== false && (C2[C2.length - 1] = C2[C2.length - 1].trimStart());
370
+ let o2 = p(C2[C2.length - 1]);
371
+ if (E !== 0 && (o2 >= u2 && (t.wordWrap === false || t.trim === false) && (C2.push(""), o2 = 0), (o2 > 0 || t.trim === false) && (C2[C2.length - 1] += " ", o2++)), t.hard && D2[E] > u2) {
372
+ const c = u2 - o2, f = 1 + Math.floor((D2[E] - c - 1) / u2);
373
+ Math.floor((D2[E] - 1) / u2) < f && C2.push(""), k(C2, a, u2);
362
374
  continue;
363
375
  }
364
- if (o2 + D[E2] > u && o2 > 0 && D[E2] > 0) {
365
- if (F.wordWrap === false && o2 < u) {
366
- y(i, h2, u);
376
+ if (o2 + D2[E] > u2 && o2 > 0 && D2[E] > 0) {
377
+ if (t.wordWrap === false && o2 < u2) {
378
+ k(C2, a, u2);
367
379
  continue;
368
380
  }
369
- i.push("");
381
+ C2.push("");
370
382
  }
371
- if (o2 + D[E2] > u && F.wordWrap === false) {
372
- y(i, h2, u);
383
+ if (o2 + D2[E] > u2 && t.wordWrap === false) {
384
+ k(C2, a, u2);
373
385
  continue;
374
386
  }
375
- i[i.length - 1] += h2;
387
+ C2[C2.length - 1] += a;
376
388
  }
377
- F.trim !== false && (i = i.map((E2) => rD(E2)));
378
- const n = [...i.join(`
389
+ t.trim !== false && (C2 = C2.map((E) => hD(E)));
390
+ const n = [...C2.join(`
379
391
  `)];
380
- for (const [E2, h2] of n.entries()) {
381
- if (e2 += h2, g.has(h2)) {
382
- const { groups: B2 } = new RegExp(`(?:\\${O}(?<code>\\d+)m|\\${w}(?<uri>.*)${b})`).exec(n.slice(E2).join("")) || { groups: {} };
383
- if (B2.code !== void 0) {
384
- const p = Number.parseFloat(B2.code);
385
- s2 = p === sD ? void 0 : p;
386
- } else B2.uri !== void 0 && (C2 = B2.uri.length === 0 ? void 0 : B2.uri);
387
- }
388
- const o2 = eD.codes.get(Number(s2));
389
- n[E2 + 1] === `
390
- ` ? (C2 && (e2 += L("")), s2 && o2 && (e2 += N(o2))) : h2 === `
391
- ` && (s2 && o2 && (e2 += N(s2)), C2 && (e2 += L(C2)));
392
- }
393
- return e2;
392
+ for (const [E, a] of n.entries()) {
393
+ if (F2 += a, d.has(a)) {
394
+ const { groups: c } = new RegExp(`(?:\\${V}(?<code>\\d+)m|\\${_}(?<uri>.*)${y})`).exec(n.slice(E).join("")) || { groups: {} };
395
+ if (c.code !== void 0) {
396
+ const f = Number.parseFloat(c.code);
397
+ s2 = f === oD ? void 0 : f;
398
+ } else c.uri !== void 0 && (i = c.uri.length === 0 ? void 0 : c.uri);
399
+ }
400
+ const o2 = ED.codes.get(Number(s2));
401
+ n[E + 1] === `
402
+ ` ? (i && (F2 += K("")), s2 && o2 && (F2 += z(o2))) : a === `
403
+ ` && (s2 && o2 && (F2 += z(s2)), i && (F2 += K(i)));
404
+ }
405
+ return F2;
394
406
  };
395
- oD = Object.defineProperty;
396
- nD = (t, u, F) => u in t ? oD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
397
- a = (t, u, F) => (nD(t, typeof u != "symbol" ? u + "" : u, F), F);
398
- V = Symbol("clack:cancel");
399
- z = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
400
- lD = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]);
407
+ xD = ["up", "down", "left", "right", "space", "enter", "cancel"];
408
+ B = { actions: new Set(xD), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]) };
409
+ AD = globalThis.process.platform.startsWith("win");
410
+ S = Symbol("clack:cancel");
411
+ gD = Object.defineProperty;
412
+ vD = (e2, u2, t) => u2 in e2 ? gD(e2, u2, { enumerable: true, configurable: true, writable: true, value: t }) : e2[u2] = t;
413
+ h = (e2, u2, t) => (vD(e2, typeof u2 != "symbol" ? u2 + "" : u2, t), t);
401
414
  x = class {
402
- constructor({ render: u, input: F = import_node_process.stdin, output: e2 = import_node_process.stdout, ...s2 }, C2 = true) {
403
- a(this, "input"), a(this, "output"), a(this, "rl"), a(this, "opts"), a(this, "_track", false), a(this, "_render"), a(this, "_cursor", 0), a(this, "state", "initial"), a(this, "value"), a(this, "error", ""), a(this, "subscribers", /* @__PURE__ */ new Map()), a(this, "_prevFrame", ""), this.opts = s2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u.bind(this), this._track = C2, this.input = F, this.output = e2;
415
+ constructor(u2, t = true) {
416
+ h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
417
+ const { input: F2 = import_node_process.stdin, output: s2 = import_node_process.stdout, render: i, signal: D2, ...C2 } = u2;
418
+ this.opts = C2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = t, this._abortSignal = D2, this.input = F2, this.output = s2;
404
419
  }
405
- prompt() {
406
- const u = new import_node_tty.WriteStream(0);
407
- return u._write = (F, e2, s2) => {
408
- this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s2();
409
- }, this.input.pipe(u), this.rl = import_node_readline.default.createInterface({ input: this.input, output: u, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), v(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F, e2) => {
410
- this.once("submit", () => {
411
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v(this.input, false), F(this.value);
412
- }), this.once("cancel", () => {
413
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v(this.input, false), F(V);
414
- });
415
- });
420
+ unsubscribe() {
421
+ this._subscribers.clear();
416
422
  }
417
- on(u, F) {
418
- const e2 = this.subscribers.get(u) ?? [];
419
- e2.push({ cb: F }), this.subscribers.set(u, e2);
423
+ setSubscriber(u2, t) {
424
+ const F2 = this._subscribers.get(u2) ?? [];
425
+ F2.push(t), this._subscribers.set(u2, F2);
420
426
  }
421
- once(u, F) {
422
- const e2 = this.subscribers.get(u) ?? [];
423
- e2.push({ cb: F, once: true }), this.subscribers.set(u, e2);
427
+ on(u2, t) {
428
+ this.setSubscriber(u2, { cb: t });
424
429
  }
425
- emit(u, ...F) {
426
- const e2 = this.subscribers.get(u) ?? [], s2 = [];
427
- for (const C2 of e2) C2.cb(...F), C2.once && s2.push(() => e2.splice(e2.indexOf(C2), 1));
428
- for (const C2 of s2) C2();
430
+ once(u2, t) {
431
+ this.setSubscriber(u2, { cb: t, once: true });
429
432
  }
430
- unsubscribe() {
431
- this.subscribers.clear();
433
+ emit(u2, ...t) {
434
+ const F2 = this._subscribers.get(u2) ?? [], s2 = [];
435
+ for (const i of F2) i.cb(...t), i.once && s2.push(() => F2.splice(F2.indexOf(i), 1));
436
+ for (const i of s2) i();
437
+ }
438
+ prompt() {
439
+ return new Promise((u2, t) => {
440
+ if (this._abortSignal) {
441
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u2(S);
442
+ this._abortSignal.addEventListener("abort", () => {
443
+ this.state = "cancel", this.close();
444
+ }, { once: true });
445
+ }
446
+ const F2 = new import_node_stream.Writable();
447
+ F2._write = (s2, i, D2) => {
448
+ var _a, _b;
449
+ this._track && (this.value = (_a = this.rl) == null ? void 0 : _a.line.replace(/\t/g, ""), this._cursor = ((_b = this.rl) == null ? void 0 : _b.cursor) ?? 0, this.emit("value", this.value)), D2();
450
+ }, this.input.pipe(F2), this.rl = import_node_readline.default.createInterface({ input: this.input, output: F2, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), m(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
451
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u2(this.value);
452
+ }), this.once("cancel", () => {
453
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u2(S);
454
+ });
455
+ });
432
456
  }
433
- onKeypress(u, F) {
434
- if (this.state === "error" && (this.state = "active"), (F == null ? void 0 : F.name) && !this._track && z.has(F.name) && this.emit("cursor", z.get(F.name)), (F == null ? void 0 : F.name) && lD.has(F.name) && this.emit("cursor", F.name), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u === " " && this.opts.placeholder && (this.value || (this.rl.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u && this.emit("key", u.toLowerCase()), (F == null ? void 0 : F.name) === "return") {
457
+ onKeypress(u2, t) {
458
+ var _a, _b;
459
+ if (this.state === "error" && (this.state = "active"), (t == null ? void 0 : t.name) && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u2 && (u2.toLowerCase() === "y" || u2.toLowerCase() === "n") && this.emit("confirm", u2.toLowerCase() === "y"), u2 === " " && this.opts.placeholder && (this.value || ((_a = this.rl) == null ? void 0 : _a.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u2 && this.emit("key", u2.toLowerCase()), (t == null ? void 0 : t.name) === "return") {
435
460
  if (this.opts.validate) {
436
- const e2 = this.opts.validate(this.value);
437
- e2 && (this.error = e2, this.state = "error", this.rl.write(this.value));
461
+ const F2 = this.opts.validate(this.value);
462
+ F2 && (this.error = F2 instanceof Error ? F2.message : F2, this.state = "error", (_b = this.rl) == null ? void 0 : _b.write(this.value));
438
463
  }
439
464
  this.state !== "error" && (this.state = "submit");
440
465
  }
441
- u === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
466
+ $2([u2, t == null ? void 0 : t.name, t == null ? void 0 : t.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
442
467
  }
443
468
  close() {
469
+ var _a;
444
470
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
445
- `), v(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
471
+ `), m(this.input, false), (_a = this.rl) == null ? void 0 : _a.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
446
472
  }
447
473
  restoreCursor() {
448
- const u = R(this._prevFrame, process.stdout.columns, { hard: true }).split(`
474
+ const u2 = Y(this._prevFrame, process.stdout.columns, { hard: true }).split(`
449
475
  `).length - 1;
450
- this.output.write(import_sisteransi.cursor.move(-999, u * -1));
476
+ this.output.write(import_sisteransi.cursor.move(-999, u2 * -1));
451
477
  }
452
478
  render() {
453
- const u = R(this._render(this) ?? "", process.stdout.columns, { hard: true });
454
- if (u !== this._prevFrame) {
479
+ const u2 = Y(this._render(this) ?? "", process.stdout.columns, { hard: true });
480
+ if (u2 !== this._prevFrame) {
455
481
  if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
456
482
  else {
457
- const F = aD(this._prevFrame, u);
458
- if (this.restoreCursor(), F && (F == null ? void 0 : F.length) === 1) {
459
- const e2 = F[0];
460
- this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.lines(1));
461
- const s2 = u.split(`
483
+ const t = BD(this._prevFrame, u2);
484
+ if (this.restoreCursor(), t && (t == null ? void 0 : t.length) === 1) {
485
+ const F2 = t[0];
486
+ this.output.write(import_sisteransi.cursor.move(0, F2)), this.output.write(import_sisteransi.erase.lines(1));
487
+ const s2 = u2.split(`
462
488
  `);
463
- this.output.write(s2[e2]), this._prevFrame = u, this.output.write(import_sisteransi.cursor.move(0, s2.length - e2 - 1));
489
+ this.output.write(s2[F2]), this._prevFrame = u2, this.output.write(import_sisteransi.cursor.move(0, s2.length - F2 - 1));
464
490
  return;
465
- } else if (F && (F == null ? void 0 : F.length) > 1) {
466
- const e2 = F[0];
467
- this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.down());
468
- const s2 = u.split(`
469
- `).slice(e2);
491
+ }
492
+ if (t && (t == null ? void 0 : t.length) > 1) {
493
+ const F2 = t[0];
494
+ this.output.write(import_sisteransi.cursor.move(0, F2)), this.output.write(import_sisteransi.erase.down());
495
+ const s2 = u2.split(`
496
+ `).slice(F2);
470
497
  this.output.write(s2.join(`
471
- `)), this._prevFrame = u;
498
+ `)), this._prevFrame = u2;
472
499
  return;
473
500
  }
474
501
  this.output.write(import_sisteransi.erase.down());
475
502
  }
476
- this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
503
+ this.output.write(u2), this.state === "initial" && (this.state = "active"), this._prevFrame = u2;
477
504
  }
478
505
  }
479
506
  };
480
- xD = class extends x {
507
+ dD = class extends x {
481
508
  get cursor() {
482
509
  return this.value ? 0 : 1;
483
510
  }
484
511
  get _value() {
485
512
  return this.cursor === 0;
486
513
  }
487
- constructor(u) {
488
- super(u, false), this.value = !!u.initialValue, this.on("value", () => {
514
+ constructor(u2) {
515
+ super(u2, false), this.value = !!u2.initialValue, this.on("value", () => {
489
516
  this.value = this._value;
490
- }), this.on("confirm", (F) => {
491
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F, this.state = "submit", this.close();
517
+ }), this.on("confirm", (t) => {
518
+ this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
492
519
  }), this.on("cursor", () => {
493
520
  this.value = !this.value;
494
521
  });
495
522
  }
496
523
  };
497
- bD = Object.defineProperty;
498
- wD = (t, u, F) => u in t ? bD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
499
- Z = (t, u, F) => (wD(t, typeof u != "symbol" ? u + "" : u, F), F);
500
- yD = class extends x {
501
- constructor(u) {
502
- super(u, false), Z(this, "options"), Z(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: F }) => F === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F) => {
503
- switch (F) {
524
+ A = /* @__PURE__ */ new WeakMap();
525
+ OD = Object.defineProperty;
526
+ PD = (e2, u2, t) => u2 in e2 ? OD(e2, u2, { enumerable: true, configurable: true, writable: true, value: t }) : e2[u2] = t;
527
+ J = (e2, u2, t) => (PD(e2, typeof u2 != "symbol" ? u2 + "" : u2, t), t);
528
+ LD = class extends x {
529
+ constructor(u2) {
530
+ super(u2, false), J(this, "options"), J(this, "cursor", 0), this.options = u2.options, this.cursor = this.options.findIndex(({ value: t }) => t === u2.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
531
+ switch (t) {
504
532
  case "left":
505
533
  case "up":
506
534
  this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
@@ -520,202 +548,236 @@ var init_dist = __esm({
520
548
  this.value = this._value.value;
521
549
  }
522
550
  };
523
- SD = Object.defineProperty;
524
- jD = (t, u, F) => u in t ? SD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
525
- MD = (t, u, F) => (jD(t, typeof u != "symbol" ? u + "" : u, F), F);
526
- TD = class extends x {
527
- constructor(u) {
528
- super(u), MD(this, "valueWithCursor", ""), this.on("finalize", () => {
529
- this.value || (this.value = u.defaultValue), this.valueWithCursor = this.value;
530
- }), this.on("value", () => {
531
- if (this.cursor >= this.value.length) this.valueWithCursor = `${this.value}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
532
- else {
533
- const F = this.value.slice(0, this.cursor), e2 = this.value.slice(this.cursor);
534
- this.valueWithCursor = `${F}${import_picocolors.default.inverse(e2[0])}${e2.slice(1)}`;
535
- }
536
- });
551
+ RD = class extends x {
552
+ get valueWithCursor() {
553
+ if (this.state === "submit") return this.value;
554
+ if (this.cursor >= this.value.length) return `${this.value}\u2588`;
555
+ const u2 = this.value.slice(0, this.cursor), [t, ...F2] = this.value.slice(this.cursor);
556
+ return `${u2}${import_picocolors.default.inverse(t)}${F2.join("")}`;
537
557
  }
538
558
  get cursor() {
539
559
  return this._cursor;
540
560
  }
561
+ constructor(u2) {
562
+ super(u2), this.on("finalize", () => {
563
+ this.value || (this.value = u2.defaultValue);
564
+ });
565
+ }
541
566
  };
542
- PD = globalThis.process.platform.startsWith("win");
543
567
  }
544
568
  });
545
569
 
546
- // node_modules/.pnpm/@clack+prompts@0.7.0/node_modules/@clack/prompts/dist/index.mjs
547
- function q2() {
548
- return import_node_process2.default.platform !== "win32" ? import_node_process2.default.env.TERM !== "linux" : Boolean(import_node_process2.default.env.CI) || Boolean(import_node_process2.default.env.WT_SESSION) || Boolean(import_node_process2.default.env.TERMINUS_SUBLIME) || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
570
+ // node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs
571
+ function ce() {
572
+ return import_node_process2.default.platform !== "win32" ? import_node_process2.default.env.TERM !== "linux" : !!import_node_process2.default.env.CI || !!import_node_process2.default.env.WT_SESSION || !!import_node_process2.default.env.TERMINUS_SUBLIME || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
549
573
  }
550
- var import_node_process2, import_picocolors2, import_sisteransi2, _2, o, H, I2, x2, S2, K, a2, d2, b2, E, C, w2, M2, U2, B, Z2, z2, X2, J2, Y, Q2, ee, y2, te, se, ie, oe, $e, f2, de;
574
+ var import_node_process2, import_picocolors2, import_sisteransi2, V2, u, le, L2, W2, C, ue, o, d2, k2, P2, A2, T, F, $e, _2, me, de, pe, q, D, U, K2, b2, G2, he, ye, ve, Ie, Se, M2, J2, Y2;
551
575
  var init_dist2 = __esm({
552
- "node_modules/.pnpm/@clack+prompts@0.7.0/node_modules/@clack/prompts/dist/index.mjs"() {
576
+ "node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs"() {
553
577
  init_dist();
554
578
  init_dist();
555
579
  import_node_process2 = __toESM(require("node:process"), 1);
556
580
  import_picocolors2 = __toESM(require_picocolors(), 1);
557
581
  import_sisteransi2 = __toESM(require_src(), 1);
558
- _2 = q2();
559
- o = (r2, n) => _2 ? r2 : n;
560
- H = o("\u25C6", "*");
561
- I2 = o("\u25A0", "x");
562
- x2 = o("\u25B2", "x");
563
- S2 = o("\u25C7", "o");
564
- K = o("\u250C", "T");
565
- a2 = o("\u2502", "|");
566
- d2 = o("\u2514", "\u2014");
567
- b2 = o("\u25CF", ">");
568
- E = o("\u25CB", " ");
569
- C = o("\u25FB", "[\u2022]");
570
- w2 = o("\u25FC", "[+]");
571
- M2 = o("\u25FB", "[ ]");
572
- U2 = o("\u25AA", "\u2022");
573
- B = o("\u2500", "-");
574
- Z2 = o("\u256E", "+");
575
- z2 = o("\u251C", "+");
576
- X2 = o("\u256F", "+");
577
- J2 = o("\u25CF", "\u2022");
578
- Y = o("\u25C6", "*");
579
- Q2 = o("\u25B2", "!");
580
- ee = o("\u25A0", "x");
581
- y2 = (r2) => {
582
- switch (r2) {
582
+ V2 = ce();
583
+ u = (t, n) => V2 ? t : n;
584
+ le = u("\u25C6", "*");
585
+ L2 = u("\u25A0", "x");
586
+ W2 = u("\u25B2", "x");
587
+ C = u("\u25C7", "o");
588
+ ue = u("\u250C", "T");
589
+ o = u("\u2502", "|");
590
+ d2 = u("\u2514", "\u2014");
591
+ k2 = u("\u25CF", ">");
592
+ P2 = u("\u25CB", " ");
593
+ A2 = u("\u25FB", "[\u2022]");
594
+ T = u("\u25FC", "[+]");
595
+ F = u("\u25FB", "[ ]");
596
+ $e = u("\u25AA", "\u2022");
597
+ _2 = u("\u2500", "-");
598
+ me = u("\u256E", "+");
599
+ de = u("\u251C", "+");
600
+ pe = u("\u256F", "+");
601
+ q = u("\u25CF", "\u2022");
602
+ D = u("\u25C6", "*");
603
+ U = u("\u25B2", "!");
604
+ K2 = u("\u25A0", "x");
605
+ b2 = (t) => {
606
+ switch (t) {
583
607
  case "initial":
584
608
  case "active":
585
- return import_picocolors2.default.cyan(H);
609
+ return import_picocolors2.default.cyan(le);
586
610
  case "cancel":
587
- return import_picocolors2.default.red(I2);
611
+ return import_picocolors2.default.red(L2);
588
612
  case "error":
589
- return import_picocolors2.default.yellow(x2);
613
+ return import_picocolors2.default.yellow(W2);
590
614
  case "submit":
591
- return import_picocolors2.default.green(S2);
615
+ return import_picocolors2.default.green(C);
592
616
  }
593
617
  };
594
- te = (r2) => new TD({ validate: r2.validate, placeholder: r2.placeholder, defaultValue: r2.defaultValue, initialValue: r2.initialValue, render() {
618
+ G2 = (t) => {
619
+ const { cursor: n, options: r2, style: i } = t, s2 = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s2, 5));
620
+ let l2 = 0;
621
+ n >= l2 + a - 3 ? l2 = Math.max(Math.min(n - a + 3, r2.length - a), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
622
+ const $4 = a < r2.length && l2 > 0, g2 = a < r2.length && l2 + a < r2.length;
623
+ return r2.slice(l2, l2 + a).map((p2, v2, f) => {
624
+ const j2 = v2 === 0 && $4, E = v2 === f.length - 1 && g2;
625
+ return j2 || E ? import_picocolors2.default.dim("...") : i(p2, v2 + l2 === n);
626
+ });
627
+ };
628
+ he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
595
629
  var _a;
596
- const n = `${import_picocolors2.default.gray(a2)}
597
- ${y2(this.state)} ${r2.message}
598
- `, i = r2.placeholder ? import_picocolors2.default.inverse(r2.placeholder[0]) + import_picocolors2.default.dim(r2.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), t = this.value ? this.valueWithCursor : i;
630
+ const n = `${import_picocolors2.default.gray(o)}
631
+ ${b2(this.state)} ${t.message}
632
+ `, r2 = t.placeholder ? import_picocolors2.default.inverse(t.placeholder[0]) + import_picocolors2.default.dim(t.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.value ? this.valueWithCursor : r2;
599
633
  switch (this.state) {
600
634
  case "error":
601
635
  return `${n.trim()}
602
- ${import_picocolors2.default.yellow(a2)} ${t}
636
+ ${import_picocolors2.default.yellow(o)} ${i}
603
637
  ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
604
638
  `;
605
639
  case "submit":
606
- return `${n}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(this.value || r2.placeholder)}`;
640
+ return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(this.value || t.placeholder)}`;
607
641
  case "cancel":
608
- return `${n}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${((_a = this.value) == null ? void 0 : _a.trim()) ? `
609
- ` + import_picocolors2.default.gray(a2) : ""}`;
642
+ return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${((_a = this.value) == null ? void 0 : _a.trim()) ? `
643
+ ${import_picocolors2.default.gray(o)}` : ""}`;
610
644
  default:
611
- return `${n}${import_picocolors2.default.cyan(a2)} ${t}
645
+ return `${n}${import_picocolors2.default.cyan(o)} ${i}
612
646
  ${import_picocolors2.default.cyan(d2)}
613
647
  `;
614
648
  }
615
649
  } }).prompt();
616
- se = (r2) => {
617
- const n = r2.active ?? "Yes", i = r2.inactive ?? "No";
618
- return new xD({ active: n, inactive: i, initialValue: r2.initialValue ?? true, render() {
619
- const t = `${import_picocolors2.default.gray(a2)}
620
- ${y2(this.state)} ${r2.message}
621
- `, s2 = this.value ? n : i;
650
+ ye = (t) => {
651
+ const n = t.active ?? "Yes", r2 = t.inactive ?? "No";
652
+ return new dD({ active: n, inactive: r2, initialValue: t.initialValue ?? true, render() {
653
+ const i = `${import_picocolors2.default.gray(o)}
654
+ ${b2(this.state)} ${t.message}
655
+ `, s2 = this.value ? n : r2;
622
656
  switch (this.state) {
623
657
  case "submit":
624
- return `${t}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(s2)}`;
658
+ return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(s2)}`;
625
659
  case "cancel":
626
- return `${t}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s2))}
627
- ${import_picocolors2.default.gray(a2)}`;
660
+ return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s2))}
661
+ ${import_picocolors2.default.gray(o)}`;
628
662
  default:
629
- return `${t}${import_picocolors2.default.cyan(a2)} ${this.value ? `${import_picocolors2.default.green(b2)} ${n}` : `${import_picocolors2.default.dim(E)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(E)} ${import_picocolors2.default.dim(i)}` : `${import_picocolors2.default.green(b2)} ${i}`}
663
+ return `${i}${import_picocolors2.default.cyan(o)} ${this.value ? `${import_picocolors2.default.green(k2)} ${n}` : `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(r2)}` : `${import_picocolors2.default.green(k2)} ${r2}`}
630
664
  ${import_picocolors2.default.cyan(d2)}
631
665
  `;
632
666
  }
633
667
  } }).prompt();
634
668
  };
635
- ie = (r2) => {
636
- const n = (t, s2) => {
637
- const c2 = t.label ?? String(t.value);
638
- return s2 === "active" ? `${import_picocolors2.default.green(b2)} ${c2} ${t.hint ? import_picocolors2.default.dim(`(${t.hint})`) : ""}` : s2 === "selected" ? `${import_picocolors2.default.dim(c2)}` : s2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(c2))}` : `${import_picocolors2.default.dim(E)} ${import_picocolors2.default.dim(c2)}`;
669
+ ve = (t) => {
670
+ const n = (r2, i) => {
671
+ const s2 = r2.label ?? String(r2.value);
672
+ switch (i) {
673
+ case "selected":
674
+ return `${import_picocolors2.default.dim(s2)}`;
675
+ case "active":
676
+ return `${import_picocolors2.default.green(k2)} ${s2} ${r2.hint ? import_picocolors2.default.dim(`(${r2.hint})`) : ""}`;
677
+ case "cancelled":
678
+ return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s2))}`;
679
+ default:
680
+ return `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(s2)}`;
681
+ }
639
682
  };
640
- let i = 0;
641
- return new yD({ options: r2.options, initialValue: r2.initialValue, render() {
642
- const t = `${import_picocolors2.default.gray(a2)}
643
- ${y2(this.state)} ${r2.message}
683
+ return new LD({ options: t.options, initialValue: t.initialValue, render() {
684
+ const r2 = `${import_picocolors2.default.gray(o)}
685
+ ${b2(this.state)} ${t.message}
644
686
  `;
645
687
  switch (this.state) {
646
688
  case "submit":
647
- return `${t}${import_picocolors2.default.gray(a2)} ${n(this.options[this.cursor], "selected")}`;
689
+ return `${r2}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
648
690
  case "cancel":
649
- return `${t}${import_picocolors2.default.gray(a2)} ${n(this.options[this.cursor], "cancelled")}
650
- ${import_picocolors2.default.gray(a2)}`;
651
- default: {
652
- const s2 = r2.maxItems === void 0 ? 1 / 0 : Math.max(r2.maxItems, 5);
653
- this.cursor >= i + s2 - 3 ? i = Math.max(Math.min(this.cursor - s2 + 3, this.options.length - s2), 0) : this.cursor < i + 2 && (i = Math.max(this.cursor - 2, 0));
654
- const c2 = s2 < this.options.length && i > 0, l2 = s2 < this.options.length && i + s2 < this.options.length;
655
- return `${t}${import_picocolors2.default.cyan(a2)} ${this.options.slice(i, i + s2).map((u, m2, $4) => m2 === 0 && c2 ? import_picocolors2.default.dim("...") : m2 === $4.length - 1 && l2 ? import_picocolors2.default.dim("...") : n(u, m2 + i === this.cursor ? "active" : "inactive")).join(`
656
- ${import_picocolors2.default.cyan(a2)} `)}
691
+ return `${r2}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
692
+ ${import_picocolors2.default.gray(o)}`;
693
+ default:
694
+ return `${r2}${import_picocolors2.default.cyan(o)} ${G2({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (i, s2) => n(i, s2 ? "active" : "inactive") }).join(`
695
+ ${import_picocolors2.default.cyan(o)} `)}
657
696
  ${import_picocolors2.default.cyan(d2)}
658
697
  `;
659
- }
660
698
  }
661
699
  } }).prompt();
662
700
  };
663
- oe = (r2 = "") => {
664
- process.stdout.write(`${import_picocolors2.default.gray(K)} ${r2}
701
+ Ie = (t = "") => {
702
+ process.stdout.write(`${import_picocolors2.default.gray(ue)} ${t}
665
703
  `);
666
704
  };
667
- $e = (r2 = "") => {
668
- process.stdout.write(`${import_picocolors2.default.gray(a2)}
669
- ${import_picocolors2.default.gray(d2)} ${r2}
705
+ Se = (t = "") => {
706
+ process.stdout.write(`${import_picocolors2.default.gray(o)}
707
+ ${import_picocolors2.default.gray(d2)} ${t}
670
708
 
671
709
  `);
672
710
  };
673
- f2 = { message: (r2 = "", { symbol: n = import_picocolors2.default.gray(a2) } = {}) => {
674
- const i = [`${import_picocolors2.default.gray(a2)}`];
675
- if (r2) {
676
- const [t, ...s2] = r2.split(`
711
+ M2 = { message: (t = "", { symbol: n = import_picocolors2.default.gray(o) } = {}) => {
712
+ const r2 = [`${import_picocolors2.default.gray(o)}`];
713
+ if (t) {
714
+ const [i, ...s2] = t.split(`
677
715
  `);
678
- i.push(`${n} ${t}`, ...s2.map((c2) => `${import_picocolors2.default.gray(a2)} ${c2}`));
716
+ r2.push(`${n} ${i}`, ...s2.map((c) => `${import_picocolors2.default.gray(o)} ${c}`));
679
717
  }
680
- process.stdout.write(`${i.join(`
718
+ process.stdout.write(`${r2.join(`
681
719
  `)}
682
720
  `);
683
- }, info: (r2) => {
684
- f2.message(r2, { symbol: import_picocolors2.default.blue(J2) });
685
- }, success: (r2) => {
686
- f2.message(r2, { symbol: import_picocolors2.default.green(Y) });
687
- }, step: (r2) => {
688
- f2.message(r2, { symbol: import_picocolors2.default.green(S2) });
689
- }, warn: (r2) => {
690
- f2.message(r2, { symbol: import_picocolors2.default.yellow(Q2) });
691
- }, warning: (r2) => {
692
- f2.warn(r2);
693
- }, error: (r2) => {
694
- f2.message(r2, { symbol: import_picocolors2.default.red(ee) });
721
+ }, info: (t) => {
722
+ M2.message(t, { symbol: import_picocolors2.default.blue(q) });
723
+ }, success: (t) => {
724
+ M2.message(t, { symbol: import_picocolors2.default.green(D) });
725
+ }, step: (t) => {
726
+ M2.message(t, { symbol: import_picocolors2.default.green(C) });
727
+ }, warn: (t) => {
728
+ M2.message(t, { symbol: import_picocolors2.default.yellow(U) });
729
+ }, warning: (t) => {
730
+ M2.warn(t);
731
+ }, error: (t) => {
732
+ M2.message(t, { symbol: import_picocolors2.default.red(K2) });
695
733
  } };
696
- de = () => {
697
- const r2 = _2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], n = _2 ? 80 : 120;
698
- let i, t, s2 = false, c2 = "";
699
- const l2 = (v2 = "") => {
700
- s2 = true, i = WD(), c2 = v2.replace(/\.+$/, ""), process.stdout.write(`${import_picocolors2.default.gray(a2)}
734
+ J2 = `${import_picocolors2.default.gray(o)} `;
735
+ Y2 = ({ indicator: t = "dots" } = {}) => {
736
+ const n = V2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], r2 = V2 ? 80 : 120, i = process.env.CI === "true";
737
+ let s2, c, a = false, l2 = "", $4, g2 = performance.now();
738
+ const p2 = (m2) => {
739
+ const h2 = m2 > 1 ? "Something went wrong" : "Canceled";
740
+ a && N2(h2, m2);
741
+ }, v2 = () => p2(2), f = () => p2(1), j2 = () => {
742
+ process.on("uncaughtExceptionMonitor", v2), process.on("unhandledRejection", v2), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p2);
743
+ }, E = () => {
744
+ process.removeListener("uncaughtExceptionMonitor", v2), process.removeListener("unhandledRejection", v2), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p2);
745
+ }, B2 = () => {
746
+ if ($4 === void 0) return;
747
+ i && process.stdout.write(`
748
+ `);
749
+ const m2 = $4.split(`
701
750
  `);
702
- let g2 = 0, p = 0;
703
- t = setInterval(() => {
704
- const O2 = import_picocolors2.default.magenta(r2[g2]), P2 = ".".repeat(Math.floor(p)).slice(0, 3);
705
- process.stdout.write(import_sisteransi2.cursor.move(-999, 0)), process.stdout.write(import_sisteransi2.erase.down(1)), process.stdout.write(`${O2} ${c2}${P2}`), g2 = g2 + 1 < r2.length ? g2 + 1 : 0, p = p < r2.length ? p + 0.125 : 0;
706
- }, n);
707
- }, u = (v2 = "", g2 = 0) => {
708
- c2 = v2 ?? c2, s2 = false, clearInterval(t);
709
- const p = g2 === 0 ? import_picocolors2.default.green(S2) : g2 === 1 ? import_picocolors2.default.red(I2) : import_picocolors2.default.red(x2);
710
- process.stdout.write(import_sisteransi2.cursor.move(-999, 0)), process.stdout.write(import_sisteransi2.erase.down(1)), process.stdout.write(`${p} ${c2}
711
- `), i();
712
- }, m2 = (v2 = "") => {
713
- c2 = v2 ?? c2;
714
- }, $4 = (v2) => {
715
- const g2 = v2 > 1 ? "Something went wrong" : "Canceled";
716
- s2 && u(g2, v2);
751
+ process.stdout.write(import_sisteransi2.cursor.move(-999, m2.length - 1)), process.stdout.write(import_sisteransi2.erase.down(m2.length));
752
+ }, R2 = (m2) => m2.replace(/\.+$/, ""), O2 = (m2) => {
753
+ const h2 = (performance.now() - m2) / 1e3, w2 = Math.floor(h2 / 60), I2 = Math.floor(h2 % 60);
754
+ return w2 > 0 ? `[${w2}m ${I2}s]` : `[${I2}s]`;
755
+ }, H = (m2 = "") => {
756
+ a = true, s2 = fD(), l2 = R2(m2), g2 = performance.now(), process.stdout.write(`${import_picocolors2.default.gray(o)}
757
+ `);
758
+ let h2 = 0, w2 = 0;
759
+ j2(), c = setInterval(() => {
760
+ if (i && l2 === $4) return;
761
+ B2(), $4 = l2;
762
+ const I2 = import_picocolors2.default.magenta(n[h2]);
763
+ if (i) process.stdout.write(`${I2} ${l2}...`);
764
+ else if (t === "timer") process.stdout.write(`${I2} ${l2} ${O2(g2)}`);
765
+ else {
766
+ const z2 = ".".repeat(Math.floor(w2)).slice(0, 3);
767
+ process.stdout.write(`${I2} ${l2}${z2}`);
768
+ }
769
+ h2 = h2 + 1 < n.length ? h2 + 1 : 0, w2 = w2 < n.length ? w2 + 0.125 : 0;
770
+ }, r2);
771
+ }, N2 = (m2 = "", h2 = 0) => {
772
+ a = false, clearInterval(c), B2();
773
+ const w2 = h2 === 0 ? import_picocolors2.default.green(C) : h2 === 1 ? import_picocolors2.default.red(L2) : import_picocolors2.default.red(W2);
774
+ l2 = R2(m2 ?? l2), t === "timer" ? process.stdout.write(`${w2} ${l2} ${O2(g2)}
775
+ `) : process.stdout.write(`${w2} ${l2}
776
+ `), E(), s2();
717
777
  };
718
- return process.on("uncaughtExceptionMonitor", () => $4(2)), process.on("unhandledRejection", () => $4(2)), process.on("SIGINT", () => $4(1)), process.on("SIGTERM", () => $4(1)), process.on("exit", $4), { start: l2, stop: u, message: m2 };
778
+ return { start: H, stop: N2, message: (m2 = "") => {
779
+ l2 = R2(m2 ?? l2);
780
+ } };
719
781
  };
720
782
  }
721
783
  });
@@ -747,8 +809,8 @@ var require_windows = __commonJS({
747
809
  "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports2, module2) {
748
810
  module2.exports = isexe;
749
811
  isexe.sync = sync;
750
- var fs8 = require("fs");
751
- function checkPathExt(path3, options) {
812
+ var fs9 = require("fs");
813
+ function checkPathExt(path4, options) {
752
814
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
753
815
  if (!pathext) {
754
816
  return true;
@@ -758,26 +820,26 @@ var require_windows = __commonJS({
758
820
  return true;
759
821
  }
760
822
  for (var i = 0; i < pathext.length; i++) {
761
- var p = pathext[i].toLowerCase();
762
- if (p && path3.substr(-p.length).toLowerCase() === p) {
823
+ var p2 = pathext[i].toLowerCase();
824
+ if (p2 && path4.substr(-p2.length).toLowerCase() === p2) {
763
825
  return true;
764
826
  }
765
827
  }
766
828
  return false;
767
829
  }
768
- function checkStat(stat, path3, options) {
830
+ function checkStat(stat, path4, options) {
769
831
  if (!stat.isSymbolicLink() && !stat.isFile()) {
770
832
  return false;
771
833
  }
772
- return checkPathExt(path3, options);
834
+ return checkPathExt(path4, options);
773
835
  }
774
- function isexe(path3, options, cb) {
775
- fs8.stat(path3, function(er, stat) {
776
- cb(er, er ? false : checkStat(stat, path3, options));
836
+ function isexe(path4, options, cb) {
837
+ fs9.stat(path4, function(er, stat) {
838
+ cb(er, er ? false : checkStat(stat, path4, options));
777
839
  });
778
840
  }
779
- function sync(path3, options) {
780
- return checkStat(fs8.statSync(path3), path3, options);
841
+ function sync(path4, options) {
842
+ return checkStat(fs9.statSync(path4), path4, options);
781
843
  }
782
844
  }
783
845
  });
@@ -787,14 +849,14 @@ var require_mode = __commonJS({
787
849
  "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports2, module2) {
788
850
  module2.exports = isexe;
789
851
  isexe.sync = sync;
790
- var fs8 = require("fs");
791
- function isexe(path3, options, cb) {
792
- fs8.stat(path3, function(er, stat) {
852
+ var fs9 = require("fs");
853
+ function isexe(path4, options, cb) {
854
+ fs9.stat(path4, function(er, stat) {
793
855
  cb(er, er ? false : checkStat(stat, options));
794
856
  });
795
857
  }
796
- function sync(path3, options) {
797
- return checkStat(fs8.statSync(path3), options);
858
+ function sync(path4, options) {
859
+ return checkStat(fs9.statSync(path4), options);
798
860
  }
799
861
  function checkStat(stat, options) {
800
862
  return stat.isFile() && checkMode(stat, options);
@@ -805,11 +867,11 @@ var require_mode = __commonJS({
805
867
  var gid = stat.gid;
806
868
  var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
807
869
  var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
808
- var u = parseInt("100", 8);
870
+ var u2 = parseInt("100", 8);
809
871
  var g2 = parseInt("010", 8);
810
872
  var o2 = parseInt("001", 8);
811
- var ug = u | g2;
812
- var ret = mod & o2 || mod & g2 && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
873
+ var ug = u2 | g2;
874
+ var ret = mod & o2 || mod & g2 && gid === myGid || mod & u2 && uid === myUid || mod & ug && myUid === 0;
813
875
  return ret;
814
876
  }
815
877
  }
@@ -818,7 +880,7 @@ var require_mode = __commonJS({
818
880
  // node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
819
881
  var require_isexe = __commonJS({
820
882
  "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports2, module2) {
821
- var fs8 = require("fs");
883
+ var fs9 = require("fs");
822
884
  var core;
823
885
  if (process.platform === "win32" || global.TESTING_WINDOWS) {
824
886
  core = require_windows();
@@ -827,7 +889,7 @@ var require_isexe = __commonJS({
827
889
  }
828
890
  module2.exports = isexe;
829
891
  isexe.sync = sync;
830
- function isexe(path3, options, cb) {
892
+ function isexe(path4, options, cb) {
831
893
  if (typeof options === "function") {
832
894
  cb = options;
833
895
  options = {};
@@ -837,7 +899,7 @@ var require_isexe = __commonJS({
837
899
  throw new TypeError("callback not provided");
838
900
  }
839
901
  return new Promise(function(resolve2, reject) {
840
- isexe(path3, options || {}, function(er, is) {
902
+ isexe(path4, options || {}, function(er, is) {
841
903
  if (er) {
842
904
  reject(er);
843
905
  } else {
@@ -846,7 +908,7 @@ var require_isexe = __commonJS({
846
908
  });
847
909
  });
848
910
  }
849
- core(path3, options || {}, function(er, is) {
911
+ core(path4, options || {}, function(er, is) {
850
912
  if (er) {
851
913
  if (er.code === "EACCES" || options && options.ignoreErrors) {
852
914
  er = null;
@@ -856,9 +918,9 @@ var require_isexe = __commonJS({
856
918
  cb(er, is);
857
919
  });
858
920
  }
859
- function sync(path3, options) {
921
+ function sync(path4, options) {
860
922
  try {
861
- return core.sync(path3, options || {});
923
+ return core.sync(path4, options || {});
862
924
  } catch (er) {
863
925
  if (options && options.ignoreErrors || er.code === "EACCES") {
864
926
  return false;
@@ -874,7 +936,7 @@ var require_isexe = __commonJS({
874
936
  var require_which = __commonJS({
875
937
  "node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports2, module2) {
876
938
  var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
877
- var path3 = require("path");
939
+ var path4 = require("path");
878
940
  var COLON = isWindows ? ";" : ":";
879
941
  var isexe = require_isexe();
880
942
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -912,22 +974,22 @@ var require_which = __commonJS({
912
974
  return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
913
975
  const ppRaw = pathEnv[i];
914
976
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
915
- const pCmd = path3.join(pathPart, cmd);
916
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
917
- resolve2(subStep(p, i, 0));
977
+ const pCmd = path4.join(pathPart, cmd);
978
+ const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
979
+ resolve2(subStep(p2, i, 0));
918
980
  });
919
- const subStep = (p, i, ii) => new Promise((resolve2, reject) => {
981
+ const subStep = (p2, i, ii) => new Promise((resolve2, reject) => {
920
982
  if (ii === pathExt.length)
921
983
  return resolve2(step(i + 1));
922
984
  const ext = pathExt[ii];
923
- isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
985
+ isexe(p2 + ext, { pathExt: pathExtExe }, (er, is) => {
924
986
  if (!er && is) {
925
987
  if (opt.all)
926
- found.push(p + ext);
988
+ found.push(p2 + ext);
927
989
  else
928
- return resolve2(p + ext);
990
+ return resolve2(p2 + ext);
929
991
  }
930
- return resolve2(subStep(p, i, ii + 1));
992
+ return resolve2(subStep(p2, i, ii + 1));
931
993
  });
932
994
  });
933
995
  return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
@@ -939,10 +1001,10 @@ var require_which = __commonJS({
939
1001
  for (let i = 0; i < pathEnv.length; i++) {
940
1002
  const ppRaw = pathEnv[i];
941
1003
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
942
- const pCmd = path3.join(pathPart, cmd);
943
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
1004
+ const pCmd = path4.join(pathPart, cmd);
1005
+ const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
944
1006
  for (let j2 = 0; j2 < pathExt.length; j2++) {
945
- const cur = p + pathExt[j2];
1007
+ const cur = p2 + pathExt[j2];
946
1008
  try {
947
1009
  const is = isexe.sync(cur, { pathExt: pathExtExe });
948
1010
  if (is) {
@@ -983,11 +1045,11 @@ var require_path_key = __commonJS({
983
1045
  }
984
1046
  });
985
1047
 
986
- // node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js
1048
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
987
1049
  var require_resolveCommand = __commonJS({
988
- "node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
1050
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
989
1051
  "use strict";
990
- var path3 = require("path");
1052
+ var path4 = require("path");
991
1053
  var which = require_which();
992
1054
  var getPathKey = require_path_key();
993
1055
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -1005,7 +1067,7 @@ var require_resolveCommand = __commonJS({
1005
1067
  try {
1006
1068
  resolved = which.sync(parsed.command, {
1007
1069
  path: env[getPathKey({ env })],
1008
- pathExt: withoutPathExt ? path3.delimiter : void 0
1070
+ pathExt: withoutPathExt ? path4.delimiter : void 0
1009
1071
  });
1010
1072
  } catch (e2) {
1011
1073
  } finally {
@@ -1014,7 +1076,7 @@ var require_resolveCommand = __commonJS({
1014
1076
  }
1015
1077
  }
1016
1078
  if (resolved) {
1017
- resolved = path3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
1079
+ resolved = path4.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
1018
1080
  }
1019
1081
  return resolved;
1020
1082
  }
@@ -1025,9 +1087,9 @@ var require_resolveCommand = __commonJS({
1025
1087
  }
1026
1088
  });
1027
1089
 
1028
- // node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js
1090
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
1029
1091
  var require_escape = __commonJS({
1030
- "node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js"(exports2, module2) {
1092
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports2, module2) {
1031
1093
  "use strict";
1032
1094
  var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
1033
1095
  function escapeCommand(arg) {
@@ -1036,206 +1098,2302 @@ var require_escape = __commonJS({
1036
1098
  }
1037
1099
  function escapeArgument(arg, doubleEscapeMetaChars) {
1038
1100
  arg = `${arg}`;
1039
- arg = arg.replace(/(\\*)"/g, '$1$1\\"');
1040
- arg = arg.replace(/(\\*)$/, "$1$1");
1101
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
1102
+ arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
1041
1103
  arg = `"${arg}"`;
1042
1104
  arg = arg.replace(metaCharsRegExp, "^$1");
1043
1105
  if (doubleEscapeMetaChars) {
1044
1106
  arg = arg.replace(metaCharsRegExp, "^$1");
1045
1107
  }
1046
- return arg;
1047
- }
1048
- module2.exports.command = escapeCommand;
1049
- module2.exports.argument = escapeArgument;
1050
- }
1051
- });
1052
-
1053
- // node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
1054
- var require_shebang_regex = __commonJS({
1055
- "node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports2, module2) {
1056
- "use strict";
1057
- module2.exports = /^#!(.*)/;
1058
- }
1059
- });
1060
-
1061
- // node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
1062
- var require_shebang_command = __commonJS({
1063
- "node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports2, module2) {
1064
- "use strict";
1065
- var shebangRegex = require_shebang_regex();
1066
- module2.exports = (string = "") => {
1067
- const match = string.match(shebangRegex);
1068
- if (!match) {
1069
- return null;
1108
+ return arg;
1109
+ }
1110
+ module2.exports.command = escapeCommand;
1111
+ module2.exports.argument = escapeArgument;
1112
+ }
1113
+ });
1114
+
1115
+ // node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
1116
+ var require_shebang_regex = __commonJS({
1117
+ "node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports2, module2) {
1118
+ "use strict";
1119
+ module2.exports = /^#!(.*)/;
1120
+ }
1121
+ });
1122
+
1123
+ // node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
1124
+ var require_shebang_command = __commonJS({
1125
+ "node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports2, module2) {
1126
+ "use strict";
1127
+ var shebangRegex = require_shebang_regex();
1128
+ module2.exports = (string = "") => {
1129
+ const match = string.match(shebangRegex);
1130
+ if (!match) {
1131
+ return null;
1132
+ }
1133
+ const [path4, argument] = match[0].replace(/#! ?/, "").split(" ");
1134
+ const binary = path4.split("/").pop();
1135
+ if (binary === "env") {
1136
+ return argument;
1137
+ }
1138
+ return argument ? `${binary} ${argument}` : binary;
1139
+ };
1140
+ }
1141
+ });
1142
+
1143
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
1144
+ var require_readShebang = __commonJS({
1145
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
1146
+ "use strict";
1147
+ var fs9 = require("fs");
1148
+ var shebangCommand = require_shebang_command();
1149
+ function readShebang(command) {
1150
+ const size = 150;
1151
+ const buffer = Buffer.alloc(size);
1152
+ let fd;
1153
+ try {
1154
+ fd = fs9.openSync(command, "r");
1155
+ fs9.readSync(fd, buffer, 0, size, 0);
1156
+ fs9.closeSync(fd);
1157
+ } catch (e2) {
1158
+ }
1159
+ return shebangCommand(buffer.toString());
1160
+ }
1161
+ module2.exports = readShebang;
1162
+ }
1163
+ });
1164
+
1165
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
1166
+ var require_parse = __commonJS({
1167
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
1168
+ "use strict";
1169
+ var path4 = require("path");
1170
+ var resolveCommand = require_resolveCommand();
1171
+ var escape = require_escape();
1172
+ var readShebang = require_readShebang();
1173
+ var isWin = process.platform === "win32";
1174
+ var isExecutableRegExp = /\.(?:com|exe)$/i;
1175
+ var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
1176
+ function detectShebang(parsed) {
1177
+ parsed.file = resolveCommand(parsed);
1178
+ const shebang = parsed.file && readShebang(parsed.file);
1179
+ if (shebang) {
1180
+ parsed.args.unshift(parsed.file);
1181
+ parsed.command = shebang;
1182
+ return resolveCommand(parsed);
1183
+ }
1184
+ return parsed.file;
1185
+ }
1186
+ function parseNonShell(parsed) {
1187
+ if (!isWin) {
1188
+ return parsed;
1189
+ }
1190
+ const commandFile = detectShebang(parsed);
1191
+ const needsShell = !isExecutableRegExp.test(commandFile);
1192
+ if (parsed.options.forceShell || needsShell) {
1193
+ const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
1194
+ parsed.command = path4.normalize(parsed.command);
1195
+ parsed.command = escape.command(parsed.command);
1196
+ parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
1197
+ const shellCommand = [parsed.command].concat(parsed.args).join(" ");
1198
+ parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
1199
+ parsed.command = process.env.comspec || "cmd.exe";
1200
+ parsed.options.windowsVerbatimArguments = true;
1201
+ }
1202
+ return parsed;
1203
+ }
1204
+ function parse(command, args, options) {
1205
+ if (args && !Array.isArray(args)) {
1206
+ options = args;
1207
+ args = null;
1208
+ }
1209
+ args = args ? args.slice(0) : [];
1210
+ options = Object.assign({}, options);
1211
+ const parsed = {
1212
+ command,
1213
+ args,
1214
+ options,
1215
+ file: void 0,
1216
+ original: {
1217
+ command,
1218
+ args
1219
+ }
1220
+ };
1221
+ return options.shell ? parsed : parseNonShell(parsed);
1222
+ }
1223
+ module2.exports = parse;
1224
+ }
1225
+ });
1226
+
1227
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
1228
+ var require_enoent = __commonJS({
1229
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports2, module2) {
1230
+ "use strict";
1231
+ var isWin = process.platform === "win32";
1232
+ function notFoundError(original, syscall) {
1233
+ return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
1234
+ code: "ENOENT",
1235
+ errno: "ENOENT",
1236
+ syscall: `${syscall} ${original.command}`,
1237
+ path: original.command,
1238
+ spawnargs: original.args
1239
+ });
1240
+ }
1241
+ function hookChildProcess(cp, parsed) {
1242
+ if (!isWin) {
1243
+ return;
1244
+ }
1245
+ const originalEmit = cp.emit;
1246
+ cp.emit = function(name, arg1) {
1247
+ if (name === "exit") {
1248
+ const err = verifyENOENT(arg1, parsed);
1249
+ if (err) {
1250
+ return originalEmit.call(cp, "error", err);
1251
+ }
1252
+ }
1253
+ return originalEmit.apply(cp, arguments);
1254
+ };
1255
+ }
1256
+ function verifyENOENT(status, parsed) {
1257
+ if (isWin && status === 1 && !parsed.file) {
1258
+ return notFoundError(parsed.original, "spawn");
1259
+ }
1260
+ return null;
1261
+ }
1262
+ function verifyENOENTSync(status, parsed) {
1263
+ if (isWin && status === 1 && !parsed.file) {
1264
+ return notFoundError(parsed.original, "spawnSync");
1265
+ }
1266
+ return null;
1267
+ }
1268
+ module2.exports = {
1269
+ hookChildProcess,
1270
+ verifyENOENT,
1271
+ verifyENOENTSync,
1272
+ notFoundError
1273
+ };
1274
+ }
1275
+ });
1276
+
1277
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
1278
+ var require_cross_spawn = __commonJS({
1279
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports2, module2) {
1280
+ "use strict";
1281
+ var cp = require("child_process");
1282
+ var parse = require_parse();
1283
+ var enoent = require_enoent();
1284
+ function spawn2(command, args, options) {
1285
+ const parsed = parse(command, args, options);
1286
+ const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
1287
+ enoent.hookChildProcess(spawned, parsed);
1288
+ return spawned;
1289
+ }
1290
+ function spawnSync(command, args, options) {
1291
+ const parsed = parse(command, args, options);
1292
+ const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
1293
+ result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
1294
+ return result;
1295
+ }
1296
+ module2.exports = spawn2;
1297
+ module2.exports.spawn = spawn2;
1298
+ module2.exports.sync = spawnSync;
1299
+ module2.exports._parse = parse;
1300
+ module2.exports._enoent = enoent;
1301
+ }
1302
+ });
1303
+
1304
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/identifier.js
1305
+ var require_identifier = __commonJS({
1306
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/identifier.js"(exports2) {
1307
+ "use strict";
1308
+ Object.defineProperty(exports2, "__esModule", { value: true });
1309
+ exports2.identifierRegex = exports2.reservedIdentifiers = void 0;
1310
+ exports2.isReserved = isReserved;
1311
+ exports2.isIdentifier = isIdentifier;
1312
+ exports2.reservedIdentifiers = [
1313
+ // Keywords
1314
+ "await",
1315
+ "break",
1316
+ "case",
1317
+ "catch",
1318
+ "class",
1319
+ "const",
1320
+ "continue",
1321
+ "debugger",
1322
+ "default",
1323
+ "delete",
1324
+ "do",
1325
+ "else",
1326
+ "enum",
1327
+ "export",
1328
+ "extends",
1329
+ "false",
1330
+ "finally",
1331
+ "for",
1332
+ "function",
1333
+ "if",
1334
+ "import",
1335
+ "in",
1336
+ "instanceof",
1337
+ "new",
1338
+ "null",
1339
+ "return",
1340
+ "super",
1341
+ "switch",
1342
+ "this",
1343
+ "throw",
1344
+ "true",
1345
+ "try",
1346
+ "typeof",
1347
+ "var",
1348
+ "void",
1349
+ "while",
1350
+ "with",
1351
+ "yield",
1352
+ // Future reserved keywords
1353
+ "implements",
1354
+ "interface",
1355
+ "package",
1356
+ "private",
1357
+ "protected",
1358
+ "public"
1359
+ ];
1360
+ exports2.identifierRegex = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*/u;
1361
+ var exactRegex = new RegExp(`^${exports2.identifierRegex.source}$`, exports2.identifierRegex.flags);
1362
+ function isReserved(value) {
1363
+ return exports2.reservedIdentifiers.includes(value);
1364
+ }
1365
+ function isIdentifier(value) {
1366
+ return exactRegex.test(value) && !isReserved(value);
1367
+ }
1368
+ }
1369
+ });
1370
+
1371
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/token.js
1372
+ var require_token = __commonJS({
1373
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/token.js"(exports2) {
1374
+ "use strict";
1375
+ Object.defineProperty(exports2, "__esModule", { value: true });
1376
+ exports2.JsonToken = exports2.JsonTokenType = void 0;
1377
+ var JsonTokenType;
1378
+ (function(JsonTokenType2) {
1379
+ JsonTokenType2["IDENTIFIER"] = "IDENTIFIER";
1380
+ JsonTokenType2["STRING"] = "STRING";
1381
+ JsonTokenType2["NUMBER"] = "NUMBER";
1382
+ JsonTokenType2["BOOLEAN"] = "BOOLEAN";
1383
+ JsonTokenType2["NULL"] = "NULL";
1384
+ JsonTokenType2["COLON"] = "COLON";
1385
+ JsonTokenType2["COMMA"] = "COMMA";
1386
+ JsonTokenType2["LINE_COMMENT"] = "LINE_COMMENT";
1387
+ JsonTokenType2["BLOCK_COMMENT"] = "BLOCK_COMMENT";
1388
+ JsonTokenType2["BRACE_LEFT"] = "BRACE_LEFT";
1389
+ JsonTokenType2["BRACE_RIGHT"] = "BRACE_RIGHT";
1390
+ JsonTokenType2["BRACKET_LEFT"] = "BRACKET_LEFT";
1391
+ JsonTokenType2["BRACKET_RIGHT"] = "BRACKET_RIGHT";
1392
+ JsonTokenType2["WHITESPACE"] = "WHITESPACE";
1393
+ JsonTokenType2["NEWLINE"] = "NEWLINE";
1394
+ JsonTokenType2["EOF"] = "EOF";
1395
+ })(JsonTokenType || (exports2.JsonTokenType = JsonTokenType = {}));
1396
+ var JsonToken;
1397
+ (function(JsonToken2) {
1398
+ function isType(token, type) {
1399
+ return token.type === type;
1400
+ }
1401
+ JsonToken2.isType = isType;
1402
+ })(JsonToken || (exports2.JsonToken = JsonToken = {}));
1403
+ }
1404
+ });
1405
+
1406
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/error.js
1407
+ var require_error = __commonJS({
1408
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/error.js"(exports2) {
1409
+ "use strict";
1410
+ Object.defineProperty(exports2, "__esModule", { value: true });
1411
+ exports2.JsonParseError = exports2.JsonError = void 0;
1412
+ var JsonError = class extends Error {
1413
+ constructor(message) {
1414
+ super(message);
1415
+ Object.setPrototypeOf(this, new.target.prototype);
1416
+ }
1417
+ };
1418
+ exports2.JsonError = JsonError;
1419
+ var JsonParseError = class extends JsonError {
1420
+ constructor(message, location) {
1421
+ super(message);
1422
+ this.location = location;
1423
+ Object.setPrototypeOf(this, new.target.prototype);
1424
+ }
1425
+ };
1426
+ exports2.JsonParseError = JsonParseError;
1427
+ }
1428
+ });
1429
+
1430
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/lexer.js
1431
+ var require_lexer = __commonJS({
1432
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/lexer.js"(exports2) {
1433
+ "use strict";
1434
+ Object.defineProperty(exports2, "__esModule", { value: true });
1435
+ exports2.JsonLexer = void 0;
1436
+ var token_1 = require_token();
1437
+ var identifier_1 = require_identifier();
1438
+ var error_1 = require_error();
1439
+ var JsonLexer = class _JsonLexer {
1440
+ constructor(source) {
1441
+ this.current = null;
1442
+ this.remaining = source;
1443
+ }
1444
+ static tokenize(source) {
1445
+ return [...new _JsonLexer(source)];
1446
+ }
1447
+ isEof() {
1448
+ var _a;
1449
+ return ((_a = this.current) == null ? void 0 : _a.type) === token_1.JsonTokenType.EOF;
1450
+ }
1451
+ [Symbol.iterator]() {
1452
+ return {
1453
+ next: () => this.isEof() ? {
1454
+ done: true,
1455
+ value: void 0
1456
+ } : {
1457
+ done: false,
1458
+ value: this.next()
1459
+ }
1460
+ };
1461
+ }
1462
+ skipInsignificant() {
1463
+ return this.skip(token_1.JsonTokenType.WHITESPACE, token_1.JsonTokenType.NEWLINE, token_1.JsonTokenType.LINE_COMMENT, token_1.JsonTokenType.BLOCK_COMMENT);
1464
+ }
1465
+ skip(...types) {
1466
+ const tokens = [];
1467
+ while (!this.isEof() && this.matches(...types)) {
1468
+ tokens.push(this.peek());
1469
+ this.next();
1470
+ }
1471
+ return tokens;
1472
+ }
1473
+ expect(type, ...other) {
1474
+ const token = this.peek();
1475
+ const types = [type, ...other];
1476
+ if (!_JsonLexer.isTokenType(token, types)) {
1477
+ const { line, column } = token.location.start;
1478
+ const expectedTypes = types.length === 1 ? types[0] : `either ${types.slice(0, -1).join(", ")} or ${types[types.length - 1]}`;
1479
+ throw new error_1.JsonParseError(`Expected ${expectedTypes}, but got ${token.type} at ${line}:${column}.`, token.location);
1480
+ }
1481
+ return token;
1482
+ }
1483
+ consume(type, ...types) {
1484
+ const token = this.expect(type, ...types);
1485
+ if (!this.isEof()) {
1486
+ this.next();
1487
+ }
1488
+ return token;
1489
+ }
1490
+ matches(...types) {
1491
+ return _JsonLexer.isTokenType(this.peek(), types);
1492
+ }
1493
+ peek() {
1494
+ if (this.current === null) {
1495
+ throw new Error("No token has been consumed yet.");
1496
+ }
1497
+ return this.current;
1498
+ }
1499
+ next() {
1500
+ if (this.isEof()) {
1501
+ throw new Error("The end of the input has been reached.");
1502
+ }
1503
+ if (this.remaining === "") {
1504
+ this.current = this.createToken(token_1.JsonTokenType.EOF, "");
1505
+ } else {
1506
+ this.current = this.match();
1507
+ this.remaining = this.remaining.slice(this.current.value.length);
1508
+ }
1509
+ return this.current;
1510
+ }
1511
+ match() {
1512
+ var _a, _b, _c;
1513
+ for (const { type, pattern } of _JsonLexer.PATTERNS) {
1514
+ if (typeof pattern === "string") {
1515
+ if (this.remaining.startsWith(pattern)) {
1516
+ return this.createToken(type, pattern);
1517
+ }
1518
+ continue;
1519
+ }
1520
+ const match = this.remaining.match(pattern);
1521
+ if (match !== null) {
1522
+ return this.createToken(type, match[0]);
1523
+ }
1524
+ }
1525
+ const start = {
1526
+ index: ((_a = this.current) == null ? void 0 : _a.location.end.index) ?? 0,
1527
+ line: ((_b = this.current) == null ? void 0 : _b.location.end.line) ?? 1,
1528
+ column: ((_c = this.current) == null ? void 0 : _c.location.end.column) ?? 1
1529
+ };
1530
+ const end = {
1531
+ index: start.index + 1,
1532
+ line: start.line,
1533
+ column: start.column + 1
1534
+ };
1535
+ const char = this.remaining[0];
1536
+ throw new error_1.JsonParseError(`Unexpected token '${char}' at ${start.line}:${start.column}.`, {
1537
+ start,
1538
+ end
1539
+ });
1540
+ }
1541
+ createToken(type, value) {
1542
+ var _a, _b, _c;
1543
+ const start = {
1544
+ index: ((_a = this.current) == null ? void 0 : _a.location.end.index) ?? 0,
1545
+ line: ((_b = this.current) == null ? void 0 : _b.location.end.line) ?? 1,
1546
+ column: ((_c = this.current) == null ? void 0 : _c.location.end.column) ?? 1
1547
+ };
1548
+ const end = {
1549
+ index: start.index,
1550
+ line: start.line,
1551
+ column: start.column
1552
+ };
1553
+ end.index += [...value].length;
1554
+ for (const char of value) {
1555
+ if (char === "\n") {
1556
+ end.line++;
1557
+ end.column = 1;
1558
+ } else {
1559
+ end.column++;
1560
+ }
1561
+ }
1562
+ return {
1563
+ type,
1564
+ value,
1565
+ location: {
1566
+ start,
1567
+ end
1568
+ }
1569
+ };
1570
+ }
1571
+ static isTokenType(token, types) {
1572
+ return types.length === 0 || types.includes(token.type);
1573
+ }
1574
+ };
1575
+ exports2.JsonLexer = JsonLexer;
1576
+ JsonLexer.PATTERNS = [
1577
+ {
1578
+ type: token_1.JsonTokenType.BRACE_LEFT,
1579
+ pattern: "{"
1580
+ },
1581
+ {
1582
+ type: token_1.JsonTokenType.BRACE_RIGHT,
1583
+ pattern: "}"
1584
+ },
1585
+ {
1586
+ type: token_1.JsonTokenType.BRACKET_LEFT,
1587
+ pattern: "["
1588
+ },
1589
+ {
1590
+ type: token_1.JsonTokenType.BRACKET_RIGHT,
1591
+ pattern: "]"
1592
+ },
1593
+ {
1594
+ type: token_1.JsonTokenType.COLON,
1595
+ pattern: ":"
1596
+ },
1597
+ {
1598
+ type: token_1.JsonTokenType.COMMA,
1599
+ pattern: ","
1600
+ },
1601
+ {
1602
+ type: token_1.JsonTokenType.LINE_COMMENT,
1603
+ pattern: /^\/\/.*/
1604
+ },
1605
+ {
1606
+ type: token_1.JsonTokenType.BLOCK_COMMENT,
1607
+ pattern: /^\/\*[\s\S]*?\*\//
1608
+ },
1609
+ {
1610
+ type: token_1.JsonTokenType.STRING,
1611
+ pattern: /^"(?:[^"\r\n\u2028\u2029\\]|\\(?:.|\r\n|\r|\n|\u2028|\u2029))*"/u
1612
+ },
1613
+ {
1614
+ type: token_1.JsonTokenType.STRING,
1615
+ pattern: /^'(?:[^'\r\n\u2028\u2029\\]|\\(?:.|\r\n|\r|\n|\u2028|\u2029))*'/u
1616
+ },
1617
+ {
1618
+ type: token_1.JsonTokenType.NEWLINE,
1619
+ pattern: /^(\r?\n)/
1620
+ },
1621
+ {
1622
+ type: token_1.JsonTokenType.WHITESPACE,
1623
+ pattern: /^[ \r\t\v\f\u00A0\u2028\u2029\uFEFF\u1680\u2000-\u200A\u202F\u205F\u3000]+/
1624
+ },
1625
+ {
1626
+ type: token_1.JsonTokenType.NUMBER,
1627
+ pattern: /^[-+]?((?:NaN|Infinity)(?![$_\u200C\u200D\p{ID_Continue}])|0[xX][\da-fA-F]+|(?:(?:0|[1-9]\d*)(?:\.\d*)?|\.\d*)(?:[eE][+-]?\d+)?)/u
1628
+ },
1629
+ {
1630
+ type: token_1.JsonTokenType.NULL,
1631
+ pattern: /^null(?![$_\u200C\u200D\p{ID_Continue}])/u
1632
+ },
1633
+ {
1634
+ type: token_1.JsonTokenType.BOOLEAN,
1635
+ pattern: /^(true|false)(?![$_\u200C\u200D\p{ID_Continue}])/u
1636
+ },
1637
+ {
1638
+ type: token_1.JsonTokenType.IDENTIFIER,
1639
+ pattern: new RegExp(`^${identifier_1.identifierRegex.source}`, identifier_1.identifierRegex.flags)
1640
+ }
1641
+ ];
1642
+ }
1643
+ });
1644
+
1645
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/location.js
1646
+ var require_location = __commonJS({
1647
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/location.js"(exports2) {
1648
+ "use strict";
1649
+ Object.defineProperty(exports2, "__esModule", { value: true });
1650
+ exports2.SourceLocation = exports2.SourcePosition = void 0;
1651
+ var SourcePosition;
1652
+ (function(SourcePosition2) {
1653
+ function unknown() {
1654
+ return {
1655
+ index: -1,
1656
+ line: 0,
1657
+ column: 0
1658
+ };
1659
+ }
1660
+ SourcePosition2.unknown = unknown;
1661
+ })(SourcePosition || (exports2.SourcePosition = SourcePosition = {}));
1662
+ var SourceLocation;
1663
+ (function(SourceLocation2) {
1664
+ function unknown() {
1665
+ return {
1666
+ start: SourcePosition.unknown(),
1667
+ end: SourcePosition.unknown()
1668
+ };
1669
+ }
1670
+ SourceLocation2.unknown = unknown;
1671
+ })(SourceLocation || (exports2.SourceLocation = SourceLocation = {}));
1672
+ }
1673
+ });
1674
+
1675
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/node.js
1676
+ var require_node = __commonJS({
1677
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/node.js"(exports2) {
1678
+ "use strict";
1679
+ Object.defineProperty(exports2, "__esModule", { value: true });
1680
+ exports2.JsonNode = void 0;
1681
+ var location_1 = require_location();
1682
+ var JsonNode = class {
1683
+ constructor(definition) {
1684
+ this.location = definition.location ?? location_1.SourceLocation.unknown();
1685
+ }
1686
+ equals(other) {
1687
+ return this.equalsLocation(other) && this.isEquivalent(other);
1688
+ }
1689
+ equalsLocation(other) {
1690
+ return this.location.start.index === other.location.start.index && this.location.start.line === other.location.start.line && this.location.start.column === other.location.start.column && this.location.end.index === other.location.end.index && this.location.end.line === other.location.end.line && this.location.end.column === other.location.end.column;
1691
+ }
1692
+ };
1693
+ exports2.JsonNode = JsonNode;
1694
+ }
1695
+ });
1696
+
1697
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/compositeNode.js
1698
+ var require_compositeNode = __commonJS({
1699
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/compositeNode.js"(exports2) {
1700
+ "use strict";
1701
+ Object.defineProperty(exports2, "__esModule", { value: true });
1702
+ exports2.JsonCompositeNode = void 0;
1703
+ var node_1 = require_node();
1704
+ var JsonCompositeNode = class _JsonCompositeNode extends node_1.JsonNode {
1705
+ constructor(definition) {
1706
+ super(definition);
1707
+ this.children = [...definition.children ?? []];
1708
+ }
1709
+ toString(formatting) {
1710
+ const clone = this.clone();
1711
+ clone.rebuild(formatting);
1712
+ return _JsonCompositeNode.flatten(clone).join("");
1713
+ }
1714
+ reformat(formatting = {}) {
1715
+ this.reset();
1716
+ this.rebuild(formatting);
1717
+ }
1718
+ static flatten(node) {
1719
+ if (node instanceof _JsonCompositeNode) {
1720
+ return node.children.flatMap(_JsonCompositeNode.flatten);
1721
+ }
1722
+ return [node];
1723
+ }
1724
+ };
1725
+ exports2.JsonCompositeNode = JsonCompositeNode;
1726
+ }
1727
+ });
1728
+
1729
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/valueNode.js
1730
+ var require_valueNode = __commonJS({
1731
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/valueNode.js"(exports2) {
1732
+ "use strict";
1733
+ Object.defineProperty(exports2, "__esModule", { value: true });
1734
+ exports2.JsonValueNode = void 0;
1735
+ var compositeNode_1 = require_compositeNode();
1736
+ var error_1 = require_error();
1737
+ var JsonValueNode = class extends compositeNode_1.JsonCompositeNode {
1738
+ cast(type) {
1739
+ if (!(this instanceof type)) {
1740
+ throw new error_1.JsonError(`Expected value of type ${type.name}, but got ${this.constructor.name}.`);
1741
+ }
1742
+ return this;
1743
+ }
1744
+ };
1745
+ exports2.JsonValueNode = JsonValueNode;
1746
+ }
1747
+ });
1748
+
1749
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/tokenNode.js
1750
+ var require_tokenNode = __commonJS({
1751
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/tokenNode.js"(exports2) {
1752
+ "use strict";
1753
+ Object.defineProperty(exports2, "__esModule", { value: true });
1754
+ exports2.JsonTokenNode = void 0;
1755
+ var token_1 = require_token();
1756
+ var node_1 = require_node();
1757
+ var JsonTokenNode = class _JsonTokenNode extends node_1.JsonNode {
1758
+ constructor(definition) {
1759
+ super(definition);
1760
+ this.type = definition.type;
1761
+ this.value = definition.value;
1762
+ }
1763
+ isType(type) {
1764
+ return token_1.JsonToken.isType(this, type);
1765
+ }
1766
+ clone() {
1767
+ return new _JsonTokenNode({
1768
+ type: this.type,
1769
+ value: this.value,
1770
+ location: this.location
1771
+ });
1772
+ }
1773
+ isEquivalent(other) {
1774
+ return other instanceof _JsonTokenNode && this.type === other.type && this.value === other.value;
1775
+ }
1776
+ toString() {
1777
+ return this.value;
1778
+ }
1779
+ };
1780
+ exports2.JsonTokenNode = JsonTokenNode;
1781
+ }
1782
+ });
1783
+
1784
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/manipulator.js
1785
+ var require_manipulator = __commonJS({
1786
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/manipulator.js"(exports2) {
1787
+ "use strict";
1788
+ Object.defineProperty(exports2, "__esModule", { value: true });
1789
+ exports2.NodeManipulator = exports2.NodeMatcher = void 0;
1790
+ var token_1 = require_token();
1791
+ var node_1 = require_node2();
1792
+ var NodeMatcher;
1793
+ (function(NodeMatcher2) {
1794
+ NodeMatcher2.ANY = () => true;
1795
+ NodeMatcher2.NONE = () => false;
1796
+ NodeMatcher2.SIGNIFICANT = (node) => !NodeMatcher2.INSIGNIFICANT(node);
1797
+ NodeMatcher2.INSIGNIFICANT = (node) => NodeMatcher2.SPACE(node) || NodeMatcher2.COMMENT(node);
1798
+ NodeMatcher2.SPACE = (node) => NodeMatcher2.WHITESPACE(node) || NodeMatcher2.NEWLINE(node);
1799
+ NodeMatcher2.WHITESPACE = (node) => node instanceof node_1.JsonTokenNode && node.type === token_1.JsonTokenType.WHITESPACE;
1800
+ NodeMatcher2.NEWLINE = (node) => node instanceof node_1.JsonTokenNode && node.type === token_1.JsonTokenType.NEWLINE;
1801
+ NodeMatcher2.COMMENT = (node) => NodeMatcher2.LINE_COMMENT(node) || NodeMatcher2.BLOCK_COMMENT(node);
1802
+ NodeMatcher2.LINE_COMMENT = (node) => node instanceof node_1.JsonTokenNode && node.type === token_1.JsonTokenType.LINE_COMMENT;
1803
+ NodeMatcher2.BLOCK_COMMENT = (node) => node instanceof node_1.JsonTokenNode && node.type === token_1.JsonTokenType.BLOCK_COMMENT;
1804
+ NodeMatcher2.PUNCTUATION = (node) => node instanceof node_1.JsonTokenNode && [
1805
+ token_1.JsonTokenType.COLON,
1806
+ token_1.JsonTokenType.COMMA,
1807
+ token_1.JsonTokenType.BRACE_LEFT,
1808
+ token_1.JsonTokenType.BRACE_RIGHT,
1809
+ token_1.JsonTokenType.BRACKET_LEFT,
1810
+ token_1.JsonTokenType.BRACKET_RIGHT
1811
+ ].includes(node.type);
1812
+ })(NodeMatcher || (exports2.NodeMatcher = NodeMatcher = {}));
1813
+ var NodeManipulator = class _NodeManipulator {
1814
+ constructor(list) {
1815
+ this.index = 0;
1816
+ this.fixing = false;
1817
+ this.list = list;
1818
+ }
1819
+ done() {
1820
+ return this.index >= this.list.length;
1821
+ }
1822
+ next() {
1823
+ if (this.done()) {
1824
+ throw new Error("The iterator is at the end of the list.");
1825
+ }
1826
+ this.index++;
1827
+ }
1828
+ get position() {
1829
+ return this.index;
1830
+ }
1831
+ seek(position) {
1832
+ if (position < 0 || position >= this.list.length) {
1833
+ throw new Error("The position is out of bounds.");
1834
+ }
1835
+ this.index = position;
1836
+ }
1837
+ previous() {
1838
+ if (this.index === 0) {
1839
+ throw new Error("The iterator is at the beginning of the list.");
1840
+ }
1841
+ this.index--;
1842
+ }
1843
+ get current() {
1844
+ if (this.done()) {
1845
+ throw new Error("The iterator is at the end of the list.");
1846
+ }
1847
+ return this.list[this.index];
1848
+ }
1849
+ get nodeList() {
1850
+ return this.list;
1851
+ }
1852
+ matchesPreviousToken(type) {
1853
+ if (this.index === 0) {
1854
+ return false;
1855
+ }
1856
+ const previous = this.list[this.index - 1];
1857
+ return previous instanceof node_1.JsonTokenNode && previous.type === type;
1858
+ }
1859
+ matches(node) {
1860
+ return this.findMatch([node]) >= 0;
1861
+ }
1862
+ matchesToken(type) {
1863
+ return this.matchesNext((current) => current instanceof node_1.JsonTokenNode && current.type === type, NodeMatcher.NONE);
1864
+ }
1865
+ matchesNext(matcher, skipped) {
1866
+ return this.findNext(matcher, skipped) >= 0;
1867
+ }
1868
+ findNext(matcher, skipper = NodeMatcher.INSIGNIFICANT) {
1869
+ let matchIndex = -1;
1870
+ const previousPosition = this.index;
1871
+ while (!this.done()) {
1872
+ const { current } = this;
1873
+ if (matcher(current)) {
1874
+ matchIndex = this.index;
1875
+ break;
1876
+ }
1877
+ if (skipper(current)) {
1878
+ this.next();
1879
+ continue;
1880
+ }
1881
+ break;
1882
+ }
1883
+ this.index = previousPosition;
1884
+ return matchIndex;
1885
+ }
1886
+ token(token, $optional = false) {
1887
+ return this.nodes([token], $optional);
1888
+ }
1889
+ node(node, $optional = false) {
1890
+ return this.nodes([node], $optional);
1891
+ }
1892
+ nodes(nodes, optional = false) {
1893
+ const index = this.findMatch(nodes);
1894
+ if (index >= 0) {
1895
+ if (nodes.length === 1) {
1896
+ this.seek(index);
1897
+ this.remove();
1898
+ this.insert(nodes[0]);
1899
+ } else {
1900
+ this.seek(index + 1);
1901
+ }
1902
+ this.fixing = false;
1903
+ } else if (!optional) {
1904
+ this.fixing = true;
1905
+ this.accommodate(nodes[0]);
1906
+ }
1907
+ return this;
1908
+ }
1909
+ insert(node) {
1910
+ this.list.splice(this.index, 0, node);
1911
+ this.next();
1912
+ return this;
1913
+ }
1914
+ remove() {
1915
+ this.list.splice(this.index, 1);
1916
+ return this;
1917
+ }
1918
+ dropUntil(matcher) {
1919
+ let fixing = false;
1920
+ const startIndex = this.index;
1921
+ while (!this.done()) {
1922
+ const node = this.current;
1923
+ if (matcher(node)) {
1924
+ if (fixing) {
1925
+ this.fixSpacing(startIndex);
1926
+ }
1927
+ return true;
1928
+ }
1929
+ if (!(node instanceof node_1.JsonTokenNode) || NodeMatcher.SIGNIFICANT(node)) {
1930
+ this.remove();
1931
+ fixing = true;
1932
+ continue;
1933
+ }
1934
+ if (!fixing || node.type === token_1.JsonTokenType.WHITESPACE) {
1935
+ this.next();
1936
+ continue;
1937
+ }
1938
+ this.fixSpacing(startIndex);
1939
+ fixing = false;
1940
+ }
1941
+ if (fixing) {
1942
+ this.fixSpacing(startIndex);
1943
+ }
1944
+ return false;
1945
+ }
1946
+ end() {
1947
+ this.dropUntil(NodeMatcher.NONE);
1948
+ if (!this.fixing) {
1949
+ return this;
1950
+ }
1951
+ while (this.index > 0) {
1952
+ this.previous();
1953
+ const node = this.current;
1954
+ if (NodeMatcher.INSIGNIFICANT(node)) {
1955
+ this.remove();
1956
+ continue;
1957
+ }
1958
+ this.next();
1959
+ break;
1960
+ }
1961
+ return this;
1962
+ }
1963
+ findMatch(nodes) {
1964
+ return this.findNext((current) => nodes.some((node) => current == null ? void 0 : current.isEquivalent(node)), NodeMatcher.INSIGNIFICANT);
1965
+ }
1966
+ fixSpacing(startIndex) {
1967
+ const currentToken = this.done() ? null : this.current;
1968
+ let removalCount = 0;
1969
+ while (this.index > startIndex) {
1970
+ this.previous();
1971
+ const node = this.current;
1972
+ if (!NodeMatcher.WHITESPACE(node)) {
1973
+ this.next();
1974
+ break;
1975
+ }
1976
+ removalCount++;
1977
+ }
1978
+ const previousToken = this.list[this.index - 1] ?? null;
1979
+ if (currentToken !== null) {
1980
+ if (previousToken === null && NodeMatcher.SPACE(currentToken) || removalCount > 0 && (NodeMatcher.BLOCK_COMMENT(previousToken) && NodeMatcher.PUNCTUATION(currentToken) || NodeMatcher.BLOCK_COMMENT(currentToken) && NodeMatcher.PUNCTUATION(previousToken))) {
1981
+ removalCount++;
1982
+ } else if (NodeMatcher.NEWLINE(previousToken) && NodeMatcher.NEWLINE(currentToken)) {
1983
+ removalCount++;
1984
+ this.previous();
1985
+ } else if (!NodeMatcher.NEWLINE(currentToken)) {
1986
+ removalCount--;
1987
+ this.next();
1988
+ }
1989
+ }
1990
+ while (removalCount-- > 0) {
1991
+ this.remove();
1992
+ }
1993
+ }
1994
+ accommodate(node) {
1995
+ if (NodeMatcher.INSIGNIFICANT(node)) {
1996
+ this.insert(node);
1997
+ return;
1998
+ }
1999
+ if (!this.done()) {
2000
+ const index = this.findNext((current) => _NodeManipulator.isReplacement(current, node));
2001
+ if (index >= 0) {
2002
+ this.seek(index);
2003
+ this.remove();
2004
+ this.fixing = false;
2005
+ }
2006
+ }
2007
+ this.insert(node);
2008
+ }
2009
+ static isReplacement(previousNode, currentNode) {
2010
+ if (currentNode instanceof node_1.JsonTokenNode || previousNode instanceof node_1.JsonTokenNode) {
2011
+ return previousNode.isEquivalent(currentNode);
2012
+ }
2013
+ if (currentNode instanceof node_1.JsonValueNode && previousNode instanceof node_1.JsonValueNode) {
2014
+ return true;
2015
+ }
2016
+ return previousNode.constructor === currentNode.constructor;
2017
+ }
2018
+ };
2019
+ exports2.NodeManipulator = NodeManipulator;
2020
+ }
2021
+ });
2022
+
2023
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/factory.js
2024
+ var require_factory = __commonJS({
2025
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/factory.js"(exports2) {
2026
+ "use strict";
2027
+ Object.defineProperty(exports2, "__esModule", { value: true });
2028
+ exports2.JsonValueFactory = void 0;
2029
+ var valueNode_1 = require_valueNode();
2030
+ var JsonValueFactory;
2031
+ (function(JsonValueFactory2) {
2032
+ const factories = {};
2033
+ function register(type, factory) {
2034
+ factories[type] = factory;
2035
+ }
2036
+ JsonValueFactory2.register = register;
2037
+ function create(value) {
2038
+ if (value instanceof valueNode_1.JsonValueNode) {
2039
+ return value;
2040
+ }
2041
+ if (Array.isArray(value)) {
2042
+ return factories.array(value);
2043
+ }
2044
+ if (typeof value === "object" && value !== null) {
2045
+ return factories.object(value);
2046
+ }
2047
+ return factories.primitive(value);
2048
+ }
2049
+ JsonValueFactory2.create = create;
2050
+ })(JsonValueFactory || (exports2.JsonValueFactory = JsonValueFactory = {}));
2051
+ }
2052
+ });
2053
+
2054
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/identifierNode.js
2055
+ var require_identifierNode = __commonJS({
2056
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/identifierNode.js"(exports2) {
2057
+ "use strict";
2058
+ Object.defineProperty(exports2, "__esModule", { value: true });
2059
+ exports2.JsonIdentifierNode = void 0;
2060
+ var valueNode_1 = require_valueNode();
2061
+ var manipulator_1 = require_manipulator();
2062
+ var tokenNode_1 = require_tokenNode();
2063
+ var token_1 = require_token();
2064
+ var factory_1 = require_factory();
2065
+ var identifier_1 = require_identifier();
2066
+ var error_1 = require_error();
2067
+ var JsonIdentifierNode = class _JsonIdentifierNode extends valueNode_1.JsonValueNode {
2068
+ constructor(definition) {
2069
+ super(definition);
2070
+ this.token = definition.token;
2071
+ }
2072
+ static of(name) {
2073
+ if (!(0, identifier_1.isIdentifier)(name)) {
2074
+ throw new error_1.JsonError(`Invalid identifier '${name}'.`);
2075
+ }
2076
+ return new _JsonIdentifierNode({
2077
+ token: new tokenNode_1.JsonTokenNode({
2078
+ type: token_1.JsonTokenType.IDENTIFIER,
2079
+ value: name
2080
+ })
2081
+ });
2082
+ }
2083
+ update(other) {
2084
+ const node = factory_1.JsonValueFactory.create(other);
2085
+ if (!this.isEquivalent(node)) {
2086
+ return node;
2087
+ }
2088
+ return this;
2089
+ }
2090
+ reset() {
2091
+ this.children.length = 0;
2092
+ }
2093
+ rebuild() {
2094
+ new manipulator_1.NodeManipulator(this.children).node(this.token).end();
2095
+ }
2096
+ clone() {
2097
+ const tokenClone = this.token.clone();
2098
+ return new _JsonIdentifierNode({
2099
+ token: tokenClone,
2100
+ children: this.children.map((child) => child === this.token ? tokenClone : child),
2101
+ location: this.location
2102
+ });
2103
+ }
2104
+ isEquivalent(other) {
2105
+ return other instanceof _JsonIdentifierNode && this.token.equals(other.token);
2106
+ }
2107
+ toJSON() {
2108
+ return this.token.value;
2109
+ }
2110
+ };
2111
+ exports2.JsonIdentifierNode = JsonIdentifierNode;
2112
+ }
2113
+ });
2114
+
2115
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/primitiveNode.js
2116
+ var require_primitiveNode = __commonJS({
2117
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/primitiveNode.js"(exports2) {
2118
+ "use strict";
2119
+ Object.defineProperty(exports2, "__esModule", { value: true });
2120
+ exports2.JsonPrimitiveNode = void 0;
2121
+ var valueNode_1 = require_valueNode();
2122
+ var manipulator_1 = require_manipulator();
2123
+ var tokenNode_1 = require_tokenNode();
2124
+ var token_1 = require_token();
2125
+ var factory_1 = require_factory();
2126
+ var JsonPrimitiveNode = class _JsonPrimitiveNode extends valueNode_1.JsonValueNode {
2127
+ constructor(definition) {
2128
+ super(definition);
2129
+ this.token = definition.token;
2130
+ this.value = definition.value;
2131
+ }
2132
+ static of(value) {
2133
+ return factory_1.JsonValueFactory.create(value);
2134
+ }
2135
+ static ofHex(value) {
2136
+ return new _JsonPrimitiveNode({
2137
+ token: new tokenNode_1.JsonTokenNode({
2138
+ type: token_1.JsonTokenType.NUMBER,
2139
+ value: `"0x${value.toString(16)}"`
2140
+ }),
2141
+ value
2142
+ });
2143
+ }
2144
+ update(other) {
2145
+ const node = factory_1.JsonValueFactory.create(other);
2146
+ if (!this.isEquivalent(node)) {
2147
+ return node;
2148
+ }
2149
+ return this;
2150
+ }
2151
+ reset() {
2152
+ this.children.length = 0;
2153
+ }
2154
+ rebuild(formatting) {
2155
+ var _a;
2156
+ const manipulator = new manipulator_1.NodeManipulator(this.children);
2157
+ let token = this.token;
2158
+ if (token.isType(token_1.JsonTokenType.STRING) && manipulator.done()) {
2159
+ const quotes = (_a = formatting == null ? void 0 : formatting.string) == null ? void 0 : _a.quote;
2160
+ if (quotes === "single") {
2161
+ let value = JSON.stringify(this.value).slice(1, -1).replace(/((?:^|[^\\])(?:\\\\)*)\\"/g, (_3, preceding) => `${preceding}"`).replace(/'/g, "\\'");
2162
+ value = `'${value}'`;
2163
+ token = new tokenNode_1.JsonTokenNode({
2164
+ type: token_1.JsonTokenType.STRING,
2165
+ value
2166
+ });
2167
+ }
2168
+ }
2169
+ manipulator.node(token);
2170
+ manipulator.end();
2171
+ }
2172
+ clone() {
2173
+ const tokenClone = this.token.clone();
2174
+ return new _JsonPrimitiveNode({
2175
+ token: tokenClone,
2176
+ value: this.value,
2177
+ children: this.children.map((child) => child === this.token ? tokenClone : child.clone()),
2178
+ location: this.location
2179
+ });
2180
+ }
2181
+ isEquivalent(other) {
2182
+ return other instanceof _JsonPrimitiveNode && this.token.equals(other.token) && this.value === other.value;
2183
+ }
2184
+ toJSON() {
2185
+ return this.value;
2186
+ }
2187
+ };
2188
+ exports2.JsonPrimitiveNode = JsonPrimitiveNode;
2189
+ var tokenTypes = {
2190
+ string: token_1.JsonTokenType.STRING,
2191
+ number: token_1.JsonTokenType.NUMBER,
2192
+ boolean: token_1.JsonTokenType.BOOLEAN,
2193
+ null: token_1.JsonTokenType.NULL
2194
+ };
2195
+ factory_1.JsonValueFactory.register("primitive", (value) => new JsonPrimitiveNode({
2196
+ value,
2197
+ token: new tokenNode_1.JsonTokenNode({
2198
+ type: tokenTypes[value === null ? "null" : typeof value],
2199
+ value: JSON.stringify(value)
2200
+ })
2201
+ }));
2202
+ }
2203
+ });
2204
+
2205
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/propertyNode.js
2206
+ var require_propertyNode = __commonJS({
2207
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/propertyNode.js"(exports2) {
2208
+ "use strict";
2209
+ Object.defineProperty(exports2, "__esModule", { value: true });
2210
+ exports2.JsonPropertyNode = void 0;
2211
+ var tokenNode_1 = require_tokenNode();
2212
+ var token_1 = require_token();
2213
+ var compositeNode_1 = require_compositeNode();
2214
+ var manipulator_1 = require_manipulator();
2215
+ var factory_1 = require_factory();
2216
+ var identifierNode_1 = require_identifierNode();
2217
+ var identifier_1 = require_identifier();
2218
+ var primitiveNode_1 = require_primitiveNode();
2219
+ var JsonPropertyNode = class _JsonPropertyNode extends compositeNode_1.JsonCompositeNode {
2220
+ constructor(definition) {
2221
+ super(definition);
2222
+ this.key = definition.key;
2223
+ this.value = definition.value;
2224
+ }
2225
+ reset() {
2226
+ this.key.reset();
2227
+ this.value.reset();
2228
+ this.children.length = 0;
2229
+ }
2230
+ set(value) {
2231
+ this.value = factory_1.JsonValueFactory.create(value);
2232
+ }
2233
+ rebuild(formatting) {
2234
+ var _a, _b, _c;
2235
+ this.value.rebuild(formatting);
2236
+ const quote = (_a = formatting == null ? void 0 : formatting.property) == null ? void 0 : _a.quote;
2237
+ const spaced = ((_b = formatting == null ? void 0 : formatting.object) == null ? void 0 : _b.colonSpacing) ?? false;
2238
+ const manipulator = new manipulator_1.NodeManipulator(this.children);
2239
+ let { key } = this;
2240
+ if (manipulator.matches(this.key)) {
2241
+ key.rebuild();
2242
+ } else {
2243
+ key = this.formatKey(formatting);
2244
+ key.rebuild({
2245
+ ...formatting,
2246
+ string: {
2247
+ quote: quote === "single" || quote === "double" ? quote : (_c = formatting == null ? void 0 : formatting.string) == null ? void 0 : _c.quote
2248
+ }
2249
+ });
2250
+ }
2251
+ manipulator.node(key);
2252
+ manipulator.token(new tokenNode_1.JsonTokenNode({
2253
+ type: token_1.JsonTokenType.COLON,
2254
+ value: ":"
2255
+ }));
2256
+ if (spaced) {
2257
+ manipulator.token(new tokenNode_1.JsonTokenNode({
2258
+ type: token_1.JsonTokenType.WHITESPACE,
2259
+ value: " "
2260
+ }), !manipulator.done());
2261
+ }
2262
+ manipulator.node(this.value).end();
2263
+ }
2264
+ formatKey(formatting) {
2265
+ var _a;
2266
+ if (this.key instanceof primitiveNode_1.JsonPrimitiveNode && ((_a = formatting == null ? void 0 : formatting.property) == null ? void 0 : _a.unquoted) === true && (0, identifier_1.isIdentifier)(this.key.value)) {
2267
+ return identifierNode_1.JsonIdentifierNode.of(this.key.value);
2268
+ }
2269
+ return this.key;
2270
+ }
2271
+ clone() {
2272
+ const keyClone = this.key.clone();
2273
+ const valueClone = this.value.clone();
2274
+ return new _JsonPropertyNode({
2275
+ key: keyClone,
2276
+ value: valueClone,
2277
+ children: this.children.map((child) => {
2278
+ if (child === this.key) {
2279
+ return keyClone;
2280
+ }
2281
+ if (child === this.value) {
2282
+ return valueClone;
2283
+ }
2284
+ return child.clone();
2285
+ }),
2286
+ location: this.location
2287
+ });
2288
+ }
2289
+ isEquivalent(other) {
2290
+ if (!(other instanceof _JsonPropertyNode)) {
2291
+ return false;
2292
+ }
2293
+ return this.key.isEquivalent(other.key) && this.value.isEquivalent(other.value);
2294
+ }
2295
+ };
2296
+ exports2.JsonPropertyNode = JsonPropertyNode;
2297
+ }
2298
+ });
2299
+
2300
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/structureNode.js
2301
+ var require_structureNode = __commonJS({
2302
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/structureNode.js"(exports2) {
2303
+ "use strict";
2304
+ Object.defineProperty(exports2, "__esModule", { value: true });
2305
+ exports2.JsonStructureNode = exports2.StructureDelimiter = void 0;
2306
+ var valueNode_1 = require_valueNode();
2307
+ var token_1 = require_token();
2308
+ var tokenNode_1 = require_tokenNode();
2309
+ var manipulator_1 = require_manipulator();
2310
+ var compositeNode_1 = require_compositeNode();
2311
+ var propertyNode_1 = require_propertyNode();
2312
+ var COMMENT = manipulator_1.NodeMatcher.COMMENT;
2313
+ var WHITESPACE = manipulator_1.NodeMatcher.WHITESPACE;
2314
+ var NEWLINE = manipulator_1.NodeMatcher.NEWLINE;
2315
+ var SPACE = manipulator_1.NodeMatcher.SPACE;
2316
+ var INSIGNIFICANT = manipulator_1.NodeMatcher.INSIGNIFICANT;
2317
+ var StructureDelimiter;
2318
+ (function(StructureDelimiter2) {
2319
+ StructureDelimiter2["OBJECT"] = "object";
2320
+ StructureDelimiter2["ARRAY"] = "array";
2321
+ })(StructureDelimiter || (exports2.StructureDelimiter = StructureDelimiter = {}));
2322
+ (function(StructureDelimiter2) {
2323
+ const definitions = {
2324
+ [StructureDelimiter2.OBJECT]: {
2325
+ start: {
2326
+ type: token_1.JsonTokenType.BRACE_LEFT,
2327
+ value: "{"
2328
+ },
2329
+ end: {
2330
+ type: token_1.JsonTokenType.BRACE_RIGHT,
2331
+ value: "}"
2332
+ }
2333
+ },
2334
+ [StructureDelimiter2.ARRAY]: {
2335
+ start: {
2336
+ type: token_1.JsonTokenType.BRACKET_LEFT,
2337
+ value: "["
2338
+ },
2339
+ end: {
2340
+ type: token_1.JsonTokenType.BRACKET_RIGHT,
2341
+ value: "]"
2342
+ }
2343
+ }
2344
+ };
2345
+ function isStartToken(token) {
2346
+ return Object.values(definitions).some(({ start }) => start.type === token.type);
2347
+ }
2348
+ StructureDelimiter2.isStartToken = isStartToken;
2349
+ function isEndToken(token) {
2350
+ return Object.values(definitions).some(({ end }) => end.type === token.type);
2351
+ }
2352
+ StructureDelimiter2.isEndToken = isEndToken;
2353
+ function getStartToken(delimiter) {
2354
+ return new tokenNode_1.JsonTokenNode(definitions[delimiter].start);
2355
+ }
2356
+ StructureDelimiter2.getStartToken = getStartToken;
2357
+ function getEndToken(delimiter) {
2358
+ return new tokenNode_1.JsonTokenNode(definitions[delimiter].end);
2359
+ }
2360
+ StructureDelimiter2.getEndToken = getEndToken;
2361
+ })(StructureDelimiter || (exports2.StructureDelimiter = StructureDelimiter = {}));
2362
+ var JsonStructureNode = class _JsonStructureNode extends valueNode_1.JsonValueNode {
2363
+ reset() {
2364
+ for (const item of this.getList()) {
2365
+ item.reset();
2366
+ }
2367
+ this.children.length = 0;
2368
+ }
2369
+ rebuild(formatting = {}) {
2370
+ const parentFormatting = this.detectFormatting(formatting);
2371
+ let childFormatting = parentFormatting;
2372
+ const children = [...this.children];
2373
+ for (let index = 0; index < children.length; index++) {
2374
+ const child = children[index];
2375
+ if (child instanceof _JsonStructureNode) {
2376
+ childFormatting = {
2377
+ ...child.detectFormatting(childFormatting),
2378
+ indentationLevel: childFormatting.indentationLevel
2379
+ };
2380
+ continue;
2381
+ }
2382
+ if (child instanceof compositeNode_1.JsonCompositeNode && this.children.includes(child)) {
2383
+ children.splice(index + 1, 0, ...child.children);
2384
+ }
2385
+ }
2386
+ for (const item of this.getList()) {
2387
+ item.rebuild(childFormatting);
2388
+ }
2389
+ this.rebuildChildren(parentFormatting);
2390
+ }
2391
+ rebuildChildren(formatting) {
2392
+ const manipulator = new manipulator_1.NodeManipulator(this.children);
2393
+ const delimiter = this.getDelimiter();
2394
+ const startToken = StructureDelimiter.getStartToken(delimiter);
2395
+ const endToken = StructureDelimiter.getEndToken(delimiter);
2396
+ manipulator.token(startToken);
2397
+ const list = this.getList();
2398
+ const count = list.length;
2399
+ const { indentationLevel = 0 } = formatting;
2400
+ const { indentationSize = 0, commaSpacing = false, entryIndentation = false, leadingIndentation: blockLeadingIndentation = false, trailingIndentation: blockTrailingIndentation = false, trailingComma = false } = formatting[delimiter] ?? {};
2401
+ let previousMatched = false;
2402
+ for (let index = 0; index < count; index++) {
2403
+ const item = list[index];
2404
+ const leadingIndentation = index !== 0 && entryIndentation || index === 0 && blockLeadingIndentation;
2405
+ if (_JsonStructureNode.matchesInsertion(manipulator, list, index)) {
2406
+ if (leadingIndentation) {
2407
+ this.indent(manipulator, formatting);
2408
+ }
2409
+ manipulator.insert(item);
2410
+ previousMatched = false;
2411
+ } else if (_JsonStructureNode.matchesRemoval(manipulator, list, index)) {
2412
+ manipulator.dropUntil(item.isEquivalent.bind(item));
2413
+ manipulator.node(item);
2414
+ previousMatched = true;
2415
+ } else {
2416
+ const currentMatched = manipulator.matches(item);
2417
+ if (!currentMatched) {
2418
+ _JsonStructureNode.skipComments(manipulator);
2419
+ }
2420
+ if (leadingIndentation) {
2421
+ if (indentationSize > 0 && manipulator.matchesNext((node) => endToken.isEquivalent(node))) {
2422
+ manipulator.node(new tokenNode_1.JsonTokenNode({
2423
+ type: token_1.JsonTokenType.NEWLINE,
2424
+ value: "\n"
2425
+ }));
2426
+ if (manipulator.matchesToken(token_1.JsonTokenType.WHITESPACE) && manipulator.matchesNext(manipulator_1.NodeMatcher.NEWLINE, manipulator_1.NodeMatcher.WHITESPACE)) {
2427
+ manipulator.remove();
2428
+ }
2429
+ manipulator.token(this.getIndentationToken(formatting));
2430
+ } else {
2431
+ this.indent(manipulator, formatting, previousMatched && currentMatched);
2432
+ }
2433
+ }
2434
+ previousMatched = currentMatched;
2435
+ if (manipulator.matchesPreviousToken(token_1.JsonTokenType.LINE_COMMENT)) {
2436
+ manipulator.insert(new tokenNode_1.JsonTokenNode({
2437
+ type: token_1.JsonTokenType.NEWLINE,
2438
+ value: "\n"
2439
+ }));
2440
+ } else if (manipulator.position > 1 && !currentMatched && manipulator.matchesPreviousToken(token_1.JsonTokenType.BLOCK_COMMENT) && !manipulator.matchesToken(token_1.JsonTokenType.WHITESPACE)) {
2441
+ manipulator.previous();
2442
+ const trailingSpace = manipulator.matchesPreviousToken(token_1.JsonTokenType.WHITESPACE);
2443
+ manipulator.next();
2444
+ if (trailingSpace) {
2445
+ manipulator.token(new tokenNode_1.JsonTokenNode({
2446
+ type: token_1.JsonTokenType.WHITESPACE,
2447
+ value: " "
2448
+ }));
2449
+ }
2450
+ }
2451
+ manipulator.node(item);
2452
+ }
2453
+ if (index < count - 1 || trailingComma) {
2454
+ manipulator.node(new tokenNode_1.JsonTokenNode({
2455
+ type: token_1.JsonTokenType.COMMA,
2456
+ value: ","
2457
+ }));
2458
+ }
2459
+ if (index === count - 1) {
2460
+ if (blockTrailingIndentation) {
2461
+ this.indent(manipulator, {
2462
+ ...formatting,
2463
+ indentationLevel: indentationLevel - 1
2464
+ });
2465
+ }
2466
+ } else if ((indentationSize === 0 || !entryIndentation) && commaSpacing && (!manipulator.matchesNext(manipulator_1.NodeMatcher.SPACE) || manipulator.matchesNext((node) => endToken.isEquivalent(node), manipulator_1.NodeMatcher.SPACE))) {
2467
+ manipulator.token(new tokenNode_1.JsonTokenNode({
2468
+ type: token_1.JsonTokenType.WHITESPACE,
2469
+ value: " "
2470
+ }), manipulator.matchesNext((node) => list[index + 1].isEquivalent(node), manipulator_1.NodeMatcher.SPACE));
2471
+ }
2472
+ }
2473
+ if (count === 0) {
2474
+ const index = manipulator.findNext((node) => node.isEquivalent(endToken), manipulator_1.NodeMatcher.ANY);
2475
+ if (index >= 0) {
2476
+ manipulator.dropUntil((node) => node.isEquivalent(endToken));
2477
+ }
2478
+ }
2479
+ manipulator.token(endToken);
2480
+ manipulator.end();
2481
+ }
2482
+ detectFormatting(parent = {}) {
2483
+ let blockStart = false;
2484
+ let lineStart = true;
2485
+ let inlineComma = false;
2486
+ let inlineColon = false;
2487
+ let levelComma = false;
2488
+ let lineIndentationSize = 0;
2489
+ let levelIndentationSize = 0;
2490
+ let leadingIndentation;
2491
+ let trailingIndentation;
2492
+ let trailingComma = false;
2493
+ let newLine = false;
2494
+ let immediatelyClosed = true;
2495
+ let empty = true;
2496
+ const formatting = {};
2497
+ const blockFormatting = {};
2498
+ const tokens = [..._JsonStructureNode.iterate(this, this.getMaxDepth())];
2499
+ for (let index = 0; index < tokens.length; index++) {
2500
+ const { token, depth, parents } = tokens[index];
2501
+ switch (token.type) {
2502
+ case token_1.JsonTokenType.IDENTIFIER:
2503
+ formatting.property = {
2504
+ ...formatting.property,
2505
+ unquoted: true
2506
+ };
2507
+ break;
2508
+ case token_1.JsonTokenType.STRING: {
2509
+ const grandParent = parents[parents.length - 2];
2510
+ const quote = token.value.startsWith("'") ? "single" : "double";
2511
+ if (grandParent instanceof propertyNode_1.JsonPropertyNode && grandParent.key.equals(parents[parents.length - 1])) {
2512
+ formatting.property = {
2513
+ ...formatting.property,
2514
+ quote
2515
+ };
2516
+ } else {
2517
+ formatting.string = {
2518
+ ...formatting.string,
2519
+ quote
2520
+ };
2521
+ }
2522
+ break;
2523
+ }
2524
+ }
2525
+ if (depth === 0 && StructureDelimiter.isStartToken(token)) {
2526
+ blockStart = true;
2527
+ } else {
2528
+ const blockEnd = StructureDelimiter.isEndToken(token);
2529
+ if (depth === 0) {
2530
+ if (blockEnd) {
2531
+ trailingIndentation = lineStart;
2532
+ trailingComma = levelComma;
2533
+ }
2534
+ if (blockStart) {
2535
+ leadingIndentation = NEWLINE(token);
2536
+ if (!WHITESPACE(token)) {
2537
+ blockStart = false;
2538
+ }
2539
+ }
2540
+ }
2541
+ if (!blockEnd) {
2542
+ levelIndentationSize = lineIndentationSize;
2543
+ immediatelyClosed = false;
2544
+ if (!SPACE(token)) {
2545
+ empty = false;
2546
+ }
2547
+ }
2548
+ }
2549
+ if (WHITESPACE(token)) {
2550
+ if (token.value.includes(" ")) {
2551
+ formatting.indentationCharacter = "tab";
2552
+ }
2553
+ if (depth === 0 && lineStart) {
2554
+ lineIndentationSize = token.value.includes(" ") ? token.value.replace(/[^\t]/g, "").length : token.value.replace(/[^ ]/g, "").length;
2555
+ }
2556
+ }
2557
+ if (inlineComma && index > 0 && tokens[index - 1].depth === 0) {
2558
+ if (!NEWLINE(token)) {
2559
+ blockFormatting.commaSpacing = WHITESPACE(token);
2560
+ }
2561
+ let entryIndentation = NEWLINE(token);
2562
+ for (let nextIndex = index; !entryIndentation && nextIndex < tokens.length; nextIndex++) {
2563
+ const { token: nextToken, depth: nextDepth } = tokens[nextIndex];
2564
+ if (nextDepth === 0) {
2565
+ if (WHITESPACE(nextToken) || COMMENT(nextToken)) {
2566
+ continue;
2567
+ }
2568
+ if (NEWLINE(nextToken)) {
2569
+ entryIndentation = true;
2570
+ }
2571
+ }
2572
+ break;
2573
+ }
2574
+ blockFormatting.entryIndentation = entryIndentation;
2575
+ inlineComma = false;
2576
+ }
2577
+ if (inlineColon) {
2578
+ blockFormatting.colonSpacing = WHITESPACE(token);
2579
+ inlineColon = false;
2580
+ }
2581
+ inlineColon = token.type === token_1.JsonTokenType.COLON || inlineColon && WHITESPACE(token);
2582
+ inlineComma = token.type === token_1.JsonTokenType.COMMA || inlineComma && WHITESPACE(token);
2583
+ levelComma = depth === 0 && token.type === token_1.JsonTokenType.COMMA || levelComma && INSIGNIFICANT(token);
2584
+ lineStart = NEWLINE(token) || lineStart && WHITESPACE(token);
2585
+ newLine = newLine || NEWLINE(token);
2586
+ }
2587
+ if (!immediatelyClosed) {
2588
+ if (!empty) {
2589
+ blockFormatting.indentationSize = 0;
2590
+ blockFormatting.trailingComma = trailingComma;
2591
+ }
2592
+ blockFormatting.leadingIndentation = leadingIndentation ?? false;
2593
+ blockFormatting.trailingIndentation = trailingIndentation ?? false;
2594
+ }
2595
+ const currentDepth = Math.max(parent.indentationLevel ?? 0, 0) + 1;
2596
+ if (levelIndentationSize > 0 && !empty) {
2597
+ const remainder = levelIndentationSize % currentDepth;
2598
+ blockFormatting.indentationSize = (levelIndentationSize - remainder) / currentDepth + remainder;
2599
+ }
2600
+ if (newLine) {
2601
+ if (blockFormatting.commaSpacing === void 0) {
2602
+ blockFormatting.commaSpacing = true;
2603
+ }
2604
+ if (blockFormatting.colonSpacing === void 0) {
2605
+ blockFormatting.colonSpacing = true;
2606
+ }
2607
+ if (blockFormatting.entryIndentation === void 0) {
2608
+ blockFormatting.entryIndentation = true;
2609
+ }
2610
+ }
2611
+ formatting[this.getDelimiter()] = blockFormatting;
2612
+ formatting.indentationLevel = currentDepth;
2613
+ return {
2614
+ ...parent,
2615
+ ...formatting,
2616
+ object: {
2617
+ ...parent.array,
2618
+ ...formatting.array,
2619
+ ...parent.object,
2620
+ ...formatting.object
2621
+ },
2622
+ array: {
2623
+ ...parent.object,
2624
+ ...formatting.object,
2625
+ ...parent.array,
2626
+ ...formatting.array
2627
+ }
2628
+ };
2629
+ }
2630
+ indent(manipulator, formatting, optional = false) {
2631
+ const delimiter = this.getDelimiter();
2632
+ const { indentationSize = 0, leadingIndentation = false, trailingIndentation = false } = formatting[delimiter] ?? {};
2633
+ if (indentationSize <= 0 && !leadingIndentation && !trailingIndentation) {
2634
+ return;
2635
+ }
2636
+ const newLine = new tokenNode_1.JsonTokenNode({
2637
+ type: token_1.JsonTokenType.NEWLINE,
2638
+ value: "\n"
2639
+ });
2640
+ manipulator.token(newLine, optional);
2641
+ if (manipulator.matchesToken(token_1.JsonTokenType.WHITESPACE)) {
2642
+ manipulator.next();
2643
+ } else {
2644
+ manipulator.token(this.getIndentationToken(formatting), optional);
2645
+ }
2646
+ }
2647
+ getIndentationToken(formatting) {
2648
+ const delimiter = this.getDelimiter();
2649
+ const { indentationLevel = 0 } = formatting;
2650
+ const { indentationSize = 0 } = formatting[delimiter] ?? {};
2651
+ const char = formatting.indentationCharacter === "tab" ? " " : " ";
2652
+ return new tokenNode_1.JsonTokenNode({
2653
+ type: token_1.JsonTokenType.WHITESPACE,
2654
+ value: char.repeat(indentationLevel * indentationSize)
2655
+ });
2656
+ }
2657
+ static *iterate(parent, maxDepth, parents = []) {
2658
+ for (const child of parent.children) {
2659
+ if (child instanceof tokenNode_1.JsonTokenNode) {
2660
+ yield {
2661
+ depth: parents.length,
2662
+ token: child,
2663
+ parents: [...parents, parent]
2664
+ };
2665
+ }
2666
+ if (maxDepth > 0 && child instanceof compositeNode_1.JsonCompositeNode) {
2667
+ yield* _JsonStructureNode.iterate(child, maxDepth - 1, [...parents, parent]);
2668
+ }
2669
+ }
2670
+ }
2671
+ static skipComments(manipulator) {
2672
+ while (manipulator.matchesNext(manipulator_1.NodeMatcher.COMMENT, manipulator_1.NodeMatcher.SPACE)) {
2673
+ manipulator.next();
2674
+ }
2675
+ }
2676
+ static matchesInsertion(manipulator, items, index) {
2677
+ const count = items.length;
2678
+ const currentNode = items[index];
2679
+ if (manipulator.matchesNext(currentNode.isEquivalent.bind(currentNode), manipulator_1.NodeMatcher.ANY)) {
2680
+ return false;
2681
+ }
2682
+ for (let i = index + 1; i < count; i++) {
2683
+ if (manipulator.matches(items[i])) {
2684
+ return true;
2685
+ }
2686
+ }
2687
+ return false;
2688
+ }
2689
+ static matchesRemoval(manipulator, items, index) {
2690
+ if (manipulator.matches(items[index])) {
2691
+ return false;
2692
+ }
2693
+ const nextItems = items.slice(index + 1);
2694
+ return manipulator.matchesNext(
2695
+ items[index].isEquivalent.bind(items[index]),
2696
+ // if any of the following nodes match one of
2697
+ // the remaining items before the current one,
2698
+ // items have been swapped, not dropped
2699
+ (item) => nextItems.every((nextItem) => !nextItem.isEquivalent(item))
2700
+ );
2701
+ }
2702
+ };
2703
+ exports2.JsonStructureNode = JsonStructureNode;
2704
+ }
2705
+ });
2706
+
2707
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/arrayNode.js
2708
+ var require_arrayNode = __commonJS({
2709
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/arrayNode.js"(exports2) {
2710
+ "use strict";
2711
+ Object.defineProperty(exports2, "__esModule", { value: true });
2712
+ exports2.JsonArrayNode = void 0;
2713
+ var structureNode_1 = require_structureNode();
2714
+ var factory_1 = require_factory();
2715
+ var error_1 = require_error();
2716
+ var JsonArrayNode = class _JsonArrayNode extends structureNode_1.JsonStructureNode {
2717
+ constructor(definition) {
2718
+ super(definition);
2719
+ this.elementNodes = [...definition.elements];
2720
+ }
2721
+ static of(...elements) {
2722
+ return new _JsonArrayNode({ elements: elements.map(factory_1.JsonValueFactory.create) });
2723
+ }
2724
+ update(other) {
2725
+ if (!(other instanceof _JsonArrayNode) && !Array.isArray(other)) {
2726
+ return factory_1.JsonValueFactory.create(other);
2727
+ }
2728
+ const otherElements = other instanceof _JsonArrayNode ? other.elements : other;
2729
+ const elements = this.elementNodes.splice(0);
2730
+ for (let index = 0; index < otherElements.length; index++) {
2731
+ this.push(index < elements.length ? elements[index].update(otherElements[index]) : otherElements[index]);
2732
+ }
2733
+ if (otherElements.length < elements.length) {
2734
+ this.splice(otherElements.length, elements.length - otherElements.length);
2735
+ }
2736
+ return this;
2737
+ }
2738
+ getList() {
2739
+ return [...this.elementNodes];
2740
+ }
2741
+ getDelimiter() {
2742
+ return structureNode_1.StructureDelimiter.ARRAY;
2743
+ }
2744
+ getMaxDepth() {
2745
+ return 1;
2746
+ }
2747
+ get elements() {
2748
+ return [...this.elementNodes];
2749
+ }
2750
+ get(index, type) {
2751
+ const element = this.elementNodes[index];
2752
+ if (type !== void 0 && !(element instanceof type)) {
2753
+ throw new error_1.JsonError(`Expected ${type.name} at index ${index}, but got ${element.constructor.name}.`);
2754
+ }
2755
+ return element;
2756
+ }
2757
+ set(index, element) {
2758
+ if (index < 0 || index >= this.elementNodes.length) {
2759
+ throw new Error(`Index ${index} is out of bounds.`);
2760
+ }
2761
+ this.elementNodes[index] = factory_1.JsonValueFactory.create(element);
2762
+ }
2763
+ clear() {
2764
+ this.elementNodes.length = 0;
2765
+ }
2766
+ delete(index) {
2767
+ if (index < 0 || index >= this.elementNodes.length) {
2768
+ throw new Error(`Index ${index} is out of bounds.`);
2769
+ }
2770
+ this.splice(index, 1);
2771
+ }
2772
+ unshift(...elements) {
2773
+ this.elementNodes.unshift(...elements.map(factory_1.JsonValueFactory.create));
2774
+ }
2775
+ push(...elements) {
2776
+ this.elementNodes.push(...elements.map(factory_1.JsonValueFactory.create));
2777
+ }
2778
+ shift() {
2779
+ return this.elementNodes.shift();
2780
+ }
2781
+ pop() {
2782
+ return this.elementNodes.pop();
2783
+ }
2784
+ splice(start, deleteCount, ...elements) {
2785
+ return this.elementNodes.splice(start, deleteCount, ...elements.map(factory_1.JsonValueFactory.create));
2786
+ }
2787
+ clone() {
2788
+ const clones = /* @__PURE__ */ new Map();
2789
+ for (const element of this.elementNodes) {
2790
+ clones.set(element, element.clone());
2791
+ }
2792
+ return new _JsonArrayNode({
2793
+ elements: [...clones.values()],
2794
+ children: this.children.map((child) => clones.get(child) ?? child.clone()),
2795
+ location: this.location
2796
+ });
2797
+ }
2798
+ isEquivalent(other) {
2799
+ if (!(other instanceof _JsonArrayNode)) {
2800
+ return false;
2801
+ }
2802
+ if (this.elements.length !== other.elements.length) {
2803
+ return false;
2804
+ }
2805
+ return this.elements.every((element, index) => other.elements[index].isEquivalent(element));
2806
+ }
2807
+ toJSON() {
2808
+ return this.elements.map((element) => element.toJSON());
2809
+ }
2810
+ };
2811
+ exports2.JsonArrayNode = JsonArrayNode;
2812
+ factory_1.JsonValueFactory.register("array", (elements) => new JsonArrayNode({
2813
+ elements: elements.map(factory_1.JsonValueFactory.create)
2814
+ }));
2815
+ }
2816
+ });
2817
+
2818
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/objectNode.js
2819
+ var require_objectNode = __commonJS({
2820
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/objectNode.js"(exports2) {
2821
+ "use strict";
2822
+ Object.defineProperty(exports2, "__esModule", { value: true });
2823
+ exports2.JsonObjectNode = void 0;
2824
+ var valueNode_1 = require_valueNode();
2825
+ var structureNode_1 = require_structureNode();
2826
+ var propertyNode_1 = require_propertyNode();
2827
+ var primitiveNode_1 = require_primitiveNode();
2828
+ var factory_1 = require_factory();
2829
+ var error_1 = require_error();
2830
+ var manipulator_1 = require_manipulator();
2831
+ var tokenNode_1 = require_tokenNode();
2832
+ var token_1 = require_token();
2833
+ var INSIGNIFICANT = manipulator_1.NodeMatcher.INSIGNIFICANT;
2834
+ var NEWLINE = manipulator_1.NodeMatcher.NEWLINE;
2835
+ var SIGNIFICANT = manipulator_1.NodeMatcher.SIGNIFICANT;
2836
+ var SPACE = manipulator_1.NodeMatcher.SPACE;
2837
+ var JsonObjectNode2 = class _JsonObjectNode extends structureNode_1.JsonStructureNode {
2838
+ constructor(definition) {
2839
+ super(definition);
2840
+ this.propertyNodes = [...definition.properties];
2841
+ }
2842
+ static of(properties) {
2843
+ return new _JsonObjectNode({
2844
+ properties: Object.entries(properties).map(([key, value]) => new propertyNode_1.JsonPropertyNode({
2845
+ key: primitiveNode_1.JsonPrimitiveNode.of(key),
2846
+ value: factory_1.JsonValueFactory.create(value)
2847
+ }))
2848
+ });
2849
+ }
2850
+ merge(source) {
2851
+ if (source.propertyNodes.length === 0) {
2852
+ return;
2853
+ }
2854
+ if (this.propertyNodes.length === 0) {
2855
+ this.propertyNodes.push(...source.propertyNodes.map((property) => property.clone()));
2856
+ this.children.splice(0, this.children.length, ...source.children.map((child) => child.clone()));
2857
+ return;
2858
+ }
2859
+ for (const property of source.propertyNodes) {
2860
+ const key = property.key.toJSON();
2861
+ const sourceRange = source.findPropertyRange(key);
2862
+ let sourceChildren = [property];
2863
+ if (sourceRange !== null) {
2864
+ sourceChildren = source.children.slice(sourceRange[0], sourceRange[1] + 1);
2865
+ }
2866
+ const newProperty = property.clone();
2867
+ sourceChildren = sourceChildren.map((node) => node === property ? newProperty : node.clone());
2868
+ const range = this.findPropertyRange(key);
2869
+ if (range === null) {
2870
+ this.propertyNodes.push(newProperty);
2871
+ this.insert(sourceChildren);
2872
+ continue;
2873
+ }
2874
+ const currentIndex = this.propertyNodes.findIndex((candidate) => candidate.key.toJSON() === key);
2875
+ this.propertyNodes.splice(currentIndex, 1, newProperty);
2876
+ this.children.splice(range[0], range[1] - range[0] + 1, ...sourceChildren);
2877
+ }
2878
+ }
2879
+ insert(nodes) {
2880
+ let insertionIndex = this.children.length;
2881
+ for (let index = this.children.length - 1; index >= 0; index--) {
2882
+ const child = this.children[index];
2883
+ if (child instanceof tokenNode_1.JsonTokenNode) {
2884
+ if (child.isType(token_1.JsonTokenType.BRACE_RIGHT)) {
2885
+ insertionIndex = index;
2886
+ continue;
2887
+ }
2888
+ if (child.isType(token_1.JsonTokenType.COMMA)) {
2889
+ insertionIndex = index + 1;
2890
+ break;
2891
+ }
2892
+ }
2893
+ if (SIGNIFICANT(child)) {
2894
+ break;
2895
+ }
2896
+ if (NEWLINE(child)) {
2897
+ while (index > 0 && SPACE(this.children[index - 1])) {
2898
+ index--;
2899
+ }
2900
+ insertionIndex = index;
2901
+ break;
2902
+ }
2903
+ insertionIndex = index;
2904
+ }
2905
+ let needsComma = false;
2906
+ for (let index = insertionIndex - 1; index >= 0; index--) {
2907
+ const child = this.children[index];
2908
+ if (child instanceof tokenNode_1.JsonTokenNode) {
2909
+ if (child.isType(token_1.JsonTokenType.COMMA)) {
2910
+ needsComma = false;
2911
+ break;
2912
+ }
2913
+ }
2914
+ if (SIGNIFICANT(child)) {
2915
+ needsComma = true;
2916
+ break;
2917
+ }
2918
+ }
2919
+ if (needsComma) {
2920
+ this.children.splice(insertionIndex, 0, new tokenNode_1.JsonTokenNode({
2921
+ type: token_1.JsonTokenType.COMMA,
2922
+ value: ","
2923
+ }));
2924
+ insertionIndex++;
2925
+ }
2926
+ this.children.splice(insertionIndex, 0, ...nodes);
2927
+ }
2928
+ findPropertyRange(name) {
2929
+ let startIndex = this.children.findIndex((node) => node instanceof propertyNode_1.JsonPropertyNode && node.key.toJSON() === name);
2930
+ if (startIndex === -1) {
2931
+ return null;
2932
+ }
2933
+ let endIndex = startIndex;
2934
+ for (let lookBehind = startIndex - 1; lookBehind >= 0; lookBehind--) {
2935
+ const child = this.children[lookBehind];
2936
+ if (!INSIGNIFICANT(child)) {
2937
+ break;
2938
+ }
2939
+ if (NEWLINE(child)) {
2940
+ startIndex = lookBehind;
2941
+ }
2942
+ }
2943
+ for (let lookAhead = endIndex + 1; lookAhead < this.children.length; lookAhead++) {
2944
+ const child = this.children[lookAhead];
2945
+ if (!(child instanceof tokenNode_1.JsonTokenNode) || SIGNIFICANT(child) && !child.isType(token_1.JsonTokenType.COMMA)) {
2946
+ break;
2947
+ }
2948
+ if (NEWLINE(child)) {
2949
+ endIndex = lookAhead - 1;
2950
+ break;
2951
+ }
2952
+ endIndex = lookAhead;
2953
+ }
2954
+ return [startIndex, endIndex];
2955
+ }
2956
+ update(other) {
2957
+ if (!(other instanceof valueNode_1.JsonValueNode)) {
2958
+ if (typeof other !== "object" || other === null || Array.isArray(other)) {
2959
+ return factory_1.JsonValueFactory.create(other);
2960
+ }
2961
+ for (const [key, value] of Object.entries(other)) {
2962
+ if (value === void 0) {
2963
+ this.delete(key);
2964
+ continue;
2965
+ }
2966
+ const property = this.propertyNodes.find((current) => current.key.toJSON() === key);
2967
+ if (property !== void 0) {
2968
+ property.value = property.value.update(value);
2969
+ continue;
2970
+ }
2971
+ this.set(key, value);
2972
+ }
2973
+ for (const property of this.propertyNodes) {
2974
+ const key = property.key.toJSON();
2975
+ if (other[key] === void 0) {
2976
+ this.delete(property.key.toJSON());
2977
+ }
2978
+ }
2979
+ return this;
2980
+ }
2981
+ if (!(other instanceof _JsonObjectNode)) {
2982
+ return other;
2983
+ }
2984
+ for (const property of other.propertyNodes) {
2985
+ const index = this.propertyNodes.findIndex((current) => current.key.toJSON() === property.key.toJSON());
2986
+ if (index >= 0) {
2987
+ const cloneProperty = this.propertyNodes[index].clone();
2988
+ cloneProperty.value = cloneProperty.value.update(property.value);
2989
+ } else {
2990
+ this.propertyNodes.push(property);
2991
+ }
2992
+ }
2993
+ for (const property of this.propertyNodes) {
2994
+ const key = property.key.toJSON();
2995
+ if (!other.has(key)) {
2996
+ this.delete(key);
2997
+ }
2998
+ }
2999
+ return this;
3000
+ }
3001
+ getList() {
3002
+ return [...this.propertyNodes];
3003
+ }
3004
+ getDelimiter() {
3005
+ return structureNode_1.StructureDelimiter.OBJECT;
3006
+ }
3007
+ getMaxDepth() {
3008
+ return 2;
3009
+ }
3010
+ has(name) {
3011
+ return this.propertyNodes.some((current) => current.key.toJSON() === name);
3012
+ }
3013
+ get properties() {
3014
+ return [...this.propertyNodes];
3015
+ }
3016
+ set(name, value) {
3017
+ const index = this.propertyNodes.findIndex((current) => current.key.toJSON() === name);
3018
+ if (index >= 0) {
3019
+ this.propertyNodes[index].set(value);
3020
+ return;
3021
+ }
3022
+ this.propertyNodes.push(new propertyNode_1.JsonPropertyNode({
3023
+ key: typeof name === "string" ? primitiveNode_1.JsonPrimitiveNode.of(name) : name,
3024
+ value: factory_1.JsonValueFactory.create(value)
3025
+ }));
3026
+ }
3027
+ delete(name) {
3028
+ for (let index = 0; index < this.propertyNodes.length; index++) {
3029
+ const property = this.propertyNodes[index];
3030
+ if (property.key.toJSON() === name) {
3031
+ this.propertyNodes.splice(index, 1);
3032
+ break;
3033
+ }
3034
+ }
3035
+ }
3036
+ get(name, type) {
3037
+ const property = this.propertyNodes.find((current) => current.key.toJSON() === name);
3038
+ if (property === void 0) {
3039
+ throw new Error(`Property "${name}" does not exist.`);
3040
+ }
3041
+ const { value } = property;
3042
+ if (type !== void 0 && !(value instanceof type)) {
3043
+ throw new error_1.JsonError(`Expected a value of type ${type.name}, but got ${value.constructor.name}`);
3044
+ }
3045
+ return value;
3046
+ }
3047
+ clone() {
3048
+ const clones = /* @__PURE__ */ new Map();
3049
+ for (const property of this.propertyNodes) {
3050
+ clones.set(property, property.clone());
3051
+ }
3052
+ return new _JsonObjectNode({
3053
+ properties: [...clones.values()],
3054
+ children: this.children.map((child) => clones.get(child) ?? child.clone()),
3055
+ location: this.location
3056
+ });
1070
3057
  }
1071
- const [path3, argument] = match[0].replace(/#! ?/, "").split(" ");
1072
- const binary = path3.split("/").pop();
1073
- if (binary === "env") {
1074
- return argument;
3058
+ isEquivalent(other) {
3059
+ if (!(other instanceof _JsonObjectNode)) {
3060
+ return false;
3061
+ }
3062
+ if (this.properties.length !== other.properties.length) {
3063
+ return false;
3064
+ }
3065
+ const entries = Object.fromEntries(other.properties.map((property) => [property.key.toJSON(), property]));
3066
+ return this.properties.every((property) => {
3067
+ var _a;
3068
+ return ((_a = entries[property.key.toJSON()]) == null ? void 0 : _a.isEquivalent(property)) === true;
3069
+ });
3070
+ }
3071
+ toJSON() {
3072
+ return Object.fromEntries(this.properties.map((property) => [
3073
+ property.key.toJSON(),
3074
+ property.value.toJSON()
3075
+ ]));
1075
3076
  }
1076
- return argument ? `${binary} ${argument}` : binary;
1077
3077
  };
3078
+ exports2.JsonObjectNode = JsonObjectNode2;
3079
+ factory_1.JsonValueFactory.register("object", (object) => new JsonObjectNode2({
3080
+ properties: Object.entries(object).flatMap(([propertyName, propertyValue]) => propertyValue === void 0 ? [] : [
3081
+ new propertyNode_1.JsonPropertyNode({
3082
+ key: primitiveNode_1.JsonPrimitiveNode.of(propertyName),
3083
+ value: factory_1.JsonValueFactory.create(propertyValue)
3084
+ })
3085
+ ])
3086
+ }));
1078
3087
  }
1079
3088
  });
1080
3089
 
1081
- // node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js
1082
- var require_readShebang = __commonJS({
1083
- "node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
3090
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/index.js
3091
+ var require_node2 = __commonJS({
3092
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/node/index.js"(exports2) {
1084
3093
  "use strict";
1085
- var fs8 = require("fs");
1086
- var shebangCommand = require_shebang_command();
1087
- function readShebang(command) {
1088
- const size = 150;
1089
- const buffer = Buffer.alloc(size);
1090
- let fd;
1091
- try {
1092
- fd = fs8.openSync(command, "r");
1093
- fs8.readSync(fd, buffer, 0, size, 0);
1094
- fs8.closeSync(fd);
1095
- } catch (e2) {
3094
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m2, k3, k22) {
3095
+ if (k22 === void 0) k22 = k3;
3096
+ var desc = Object.getOwnPropertyDescriptor(m2, k3);
3097
+ if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
3098
+ desc = { enumerable: true, get: function() {
3099
+ return m2[k3];
3100
+ } };
1096
3101
  }
1097
- return shebangCommand(buffer.toString());
1098
- }
1099
- module2.exports = readShebang;
3102
+ Object.defineProperty(o2, k22, desc);
3103
+ }) : (function(o2, m2, k3, k22) {
3104
+ if (k22 === void 0) k22 = k3;
3105
+ o2[k22] = m2[k3];
3106
+ }));
3107
+ var __exportStar = exports2 && exports2.__exportStar || function(m2, exports3) {
3108
+ for (var p2 in m2) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p2)) __createBinding(exports3, m2, p2);
3109
+ };
3110
+ Object.defineProperty(exports2, "__esModule", { value: true });
3111
+ __exportStar(require_structureNode(), exports2);
3112
+ __exportStar(require_arrayNode(), exports2);
3113
+ __exportStar(require_compositeNode(), exports2);
3114
+ __exportStar(require_identifierNode(), exports2);
3115
+ __exportStar(require_node(), exports2);
3116
+ __exportStar(require_objectNode(), exports2);
3117
+ __exportStar(require_primitiveNode(), exports2);
3118
+ __exportStar(require_propertyNode(), exports2);
3119
+ __exportStar(require_tokenNode(), exports2);
3120
+ __exportStar(require_valueNode(), exports2);
3121
+ __exportStar(require_factory(), exports2);
1100
3122
  }
1101
3123
  });
1102
3124
 
1103
- // node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js
1104
- var require_parse = __commonJS({
1105
- "node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
3125
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/parser.js
3126
+ var require_parser = __commonJS({
3127
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/parser.js"(exports2) {
1106
3128
  "use strict";
1107
- var path3 = require("path");
1108
- var resolveCommand = require_resolveCommand();
1109
- var escape = require_escape();
1110
- var readShebang = require_readShebang();
1111
- var isWin = process.platform === "win32";
1112
- var isExecutableRegExp = /\.(?:com|exe)$/i;
1113
- var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
1114
- function detectShebang(parsed) {
1115
- parsed.file = resolveCommand(parsed);
1116
- const shebang = parsed.file && readShebang(parsed.file);
1117
- if (shebang) {
1118
- parsed.args.unshift(parsed.file);
1119
- parsed.command = shebang;
1120
- return resolveCommand(parsed);
3129
+ Object.defineProperty(exports2, "__esModule", { value: true });
3130
+ exports2.JsonParser = void 0;
3131
+ var lexer_1 = require_lexer();
3132
+ var token_1 = require_token();
3133
+ var node_1 = require_node2();
3134
+ var identifier_1 = require_identifier();
3135
+ var error_1 = require_error();
3136
+ var JsonParser2 = class _JsonParser {
3137
+ constructor(source) {
3138
+ this.lexer = new lexer_1.JsonLexer(source);
1121
3139
  }
1122
- return parsed.file;
1123
- }
1124
- function parseNonShell(parsed) {
1125
- if (!isWin) {
1126
- return parsed;
3140
+ static parse(source, type) {
3141
+ const parser = new _JsonParser(source);
3142
+ if (type !== void 0) {
3143
+ return parser.parseValue(type);
3144
+ }
3145
+ return parser.parseValue();
1127
3146
  }
1128
- const commandFile = detectShebang(parsed);
1129
- const needsShell = !isExecutableRegExp.test(commandFile);
1130
- if (parsed.options.forceShell || needsShell) {
1131
- const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
1132
- parsed.command = path3.normalize(parsed.command);
1133
- parsed.command = escape.command(parsed.command);
1134
- parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
1135
- const shellCommand = [parsed.command].concat(parsed.args).join(" ");
1136
- parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
1137
- parsed.command = process.env.comspec || "cmd.exe";
1138
- parsed.options.windowsVerbatimArguments = true;
3147
+ parseValue(type) {
3148
+ const node = this.parseRoot();
3149
+ if (type !== void 0 && !(node instanceof type)) {
3150
+ throw new error_1.JsonError(`Expected ${type.name}, but got ${node.constructor.name}.`);
3151
+ }
3152
+ return node;
1139
3153
  }
1140
- return parsed;
1141
- }
1142
- function parse(command, args, options) {
1143
- if (args && !Array.isArray(args)) {
1144
- options = args;
1145
- args = null;
3154
+ parseRoot() {
3155
+ this.lexer.next();
3156
+ const leadingTokens = this.lexer.skipInsignificant();
3157
+ const node = this.parseNext();
3158
+ const trailingTokens = this.lexer.skipInsignificant();
3159
+ node.children.unshift(..._JsonParser.createChildren(leadingTokens));
3160
+ node.children.push(..._JsonParser.createChildren(trailingTokens));
3161
+ if (!this.lexer.isEof()) {
3162
+ const token = this.lexer.peek();
3163
+ const position = token.location.start;
3164
+ throw new error_1.JsonParseError(`Unexpected token '${token.value}' at ${position.line}:${position.column}.`, token.location);
3165
+ }
3166
+ return node;
1146
3167
  }
1147
- args = args ? args.slice(0) : [];
1148
- options = Object.assign({}, options);
1149
- const parsed = {
1150
- command,
1151
- args,
1152
- options,
1153
- file: void 0,
1154
- original: {
1155
- command,
1156
- args
3168
+ parseNext() {
3169
+ const token = this.lexer.peek();
3170
+ switch (token.type) {
3171
+ case token_1.JsonTokenType.BRACE_LEFT:
3172
+ return this.parseObject();
3173
+ case token_1.JsonTokenType.BRACKET_LEFT:
3174
+ return this.parseArray();
3175
+ case token_1.JsonTokenType.NUMBER:
3176
+ return this.parseNumber();
3177
+ case token_1.JsonTokenType.STRING:
3178
+ return this.parseString();
3179
+ case token_1.JsonTokenType.BOOLEAN:
3180
+ return this.parseBoolean();
3181
+ case token_1.JsonTokenType.NULL:
3182
+ return this.parseNull();
3183
+ default: {
3184
+ const position = token.location.start;
3185
+ throw new error_1.JsonParseError(`Unexpected token '${token.value}' at ${position.line}:${position.column}.`, token.location);
3186
+ }
1157
3187
  }
1158
- };
1159
- return options.shell ? parsed : parseNonShell(parsed);
1160
- }
1161
- module2.exports = parse;
1162
- }
1163
- });
1164
-
1165
- // node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js
1166
- var require_enoent = __commonJS({
1167
- "node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js"(exports2, module2) {
1168
- "use strict";
1169
- var isWin = process.platform === "win32";
1170
- function notFoundError(original, syscall) {
1171
- return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
1172
- code: "ENOENT",
1173
- errno: "ENOENT",
1174
- syscall: `${syscall} ${original.command}`,
1175
- path: original.command,
1176
- spawnargs: original.args
1177
- });
1178
- }
1179
- function hookChildProcess(cp, parsed) {
1180
- if (!isWin) {
1181
- return;
1182
3188
  }
1183
- const originalEmit = cp.emit;
1184
- cp.emit = function(name, arg1) {
1185
- if (name === "exit") {
1186
- const err = verifyENOENT(arg1, parsed, "spawn");
1187
- if (err) {
1188
- return originalEmit.call(cp, "error", err);
3189
+ parseNumber() {
3190
+ const token = this.lexer.consume(token_1.JsonTokenType.NUMBER);
3191
+ const tokenNode = new node_1.JsonTokenNode(token);
3192
+ return new node_1.JsonPrimitiveNode({
3193
+ token: tokenNode,
3194
+ value: this.parseNumberValue(token),
3195
+ children: [tokenNode],
3196
+ location: token.location
3197
+ });
3198
+ }
3199
+ parseNumberValue(token) {
3200
+ let { value } = token;
3201
+ let sign = 1;
3202
+ if (value.startsWith("+")) {
3203
+ value = value.slice(1);
3204
+ } else if (value.startsWith("-")) {
3205
+ sign = -1;
3206
+ value = value.slice(1);
3207
+ }
3208
+ if (value === "Infinity") {
3209
+ return sign * Infinity;
3210
+ }
3211
+ if (value === "NaN") {
3212
+ return NaN;
3213
+ }
3214
+ if (value.startsWith(".")) {
3215
+ value = `0${value}`;
3216
+ } else {
3217
+ value = value.replace(/\.(?!\d)/, "");
3218
+ }
3219
+ if (value.startsWith("0x") || value.startsWith("0X")) {
3220
+ return sign * Number.parseInt(value, 16);
3221
+ }
3222
+ return sign * JSON.parse(value);
3223
+ }
3224
+ parseString() {
3225
+ const token = this.lexer.consume(token_1.JsonTokenType.STRING);
3226
+ let { value } = token;
3227
+ if (value.startsWith("'")) {
3228
+ value = value.slice(1, -1).replace(/((?:^|[^\\])(?:\\\\)*)\\(["'])/g, (_3, preceding, quote) => `${preceding}${quote === '"' ? '\\"' : "'"}`);
3229
+ value = `"${value}"`;
3230
+ }
3231
+ value = value.replace(/\\(?:\r\n|\r|\n|\u2028|\u2029)/gu, "");
3232
+ const tokenNode = new node_1.JsonTokenNode(token);
3233
+ let parsedValue;
3234
+ try {
3235
+ parsedValue = JSON.parse(value);
3236
+ } catch (error) {
3237
+ if (error instanceof Error) {
3238
+ throw new error_1.JsonParseError(`Invalid string at ${token.location.start.line}:${token.location.start.column}: ${error.message}`, token.location);
1189
3239
  }
3240
+ throw error;
1190
3241
  }
1191
- return originalEmit.apply(cp, arguments);
1192
- };
1193
- }
1194
- function verifyENOENT(status, parsed) {
1195
- if (isWin && status === 1 && !parsed.file) {
1196
- return notFoundError(parsed.original, "spawn");
3242
+ return new node_1.JsonPrimitiveNode({
3243
+ token: tokenNode,
3244
+ value: parsedValue,
3245
+ children: [tokenNode],
3246
+ location: token.location
3247
+ });
1197
3248
  }
1198
- return null;
1199
- }
1200
- function verifyENOENTSync(status, parsed) {
1201
- if (isWin && status === 1 && !parsed.file) {
1202
- return notFoundError(parsed.original, "spawnSync");
3249
+ parseNull() {
3250
+ const token = this.lexer.consume(token_1.JsonTokenType.NULL);
3251
+ const tokenNode = new node_1.JsonTokenNode(token);
3252
+ return new node_1.JsonPrimitiveNode({
3253
+ token: tokenNode,
3254
+ value: null,
3255
+ children: [tokenNode],
3256
+ location: token.location
3257
+ });
3258
+ }
3259
+ parseBoolean() {
3260
+ const token = this.lexer.consume(token_1.JsonTokenType.BOOLEAN);
3261
+ const tokenNode = new node_1.JsonTokenNode(token);
3262
+ return new node_1.JsonPrimitiveNode({
3263
+ token: tokenNode,
3264
+ value: token.value === "true",
3265
+ children: [tokenNode],
3266
+ location: token.location
3267
+ });
3268
+ }
3269
+ parseArray() {
3270
+ const children = [
3271
+ this.lexer.consume(token_1.JsonTokenType.BRACKET_LEFT),
3272
+ ...this.lexer.skipInsignificant()
3273
+ ];
3274
+ const elements = [];
3275
+ while (!this.lexer.matches(token_1.JsonTokenType.BRACKET_RIGHT)) {
3276
+ const element = this.parseNext();
3277
+ elements.push(element);
3278
+ children.push(element, ...this.lexer.skipInsignificant());
3279
+ if (!this.lexer.matches(token_1.JsonTokenType.BRACKET_RIGHT)) {
3280
+ children.push(this.lexer.consume(token_1.JsonTokenType.COMMA), ...this.lexer.skipInsignificant());
3281
+ }
3282
+ }
3283
+ children.push(this.lexer.consume(token_1.JsonTokenType.BRACKET_RIGHT));
3284
+ return new node_1.JsonArrayNode({
3285
+ elements,
3286
+ children: _JsonParser.createChildren(children),
3287
+ location: {
3288
+ start: children[0].location.start,
3289
+ end: children[children.length - 1].location.end
3290
+ }
3291
+ });
3292
+ }
3293
+ parseObject() {
3294
+ const children = [
3295
+ this.lexer.consume(token_1.JsonTokenType.BRACE_LEFT),
3296
+ ...this.lexer.skipInsignificant()
3297
+ ];
3298
+ const properties = [];
3299
+ while (!this.lexer.matches(token_1.JsonTokenType.BRACE_RIGHT)) {
3300
+ const property = this.parseObjectProperty();
3301
+ properties.push(property);
3302
+ children.push(property, ...this.lexer.skipInsignificant());
3303
+ if (!this.lexer.matches(token_1.JsonTokenType.BRACE_RIGHT)) {
3304
+ children.push(this.lexer.consume(token_1.JsonTokenType.COMMA), ...this.lexer.skipInsignificant());
3305
+ }
3306
+ }
3307
+ children.push(this.lexer.consume(token_1.JsonTokenType.BRACE_RIGHT));
3308
+ return new node_1.JsonObjectNode({
3309
+ properties,
3310
+ children: _JsonParser.createChildren(children),
3311
+ location: {
3312
+ start: children[0].location.start,
3313
+ end: children[children.length - 1].location.end
3314
+ }
3315
+ });
3316
+ }
3317
+ parseObjectProperty() {
3318
+ const children = [];
3319
+ this.lexer.expect(token_1.JsonTokenType.STRING, token_1.JsonTokenType.IDENTIFIER);
3320
+ const key = this.lexer.matches(token_1.JsonTokenType.STRING) ? this.parseString() : this.parseIdentifier();
3321
+ children.push(key, ...this.lexer.skipInsignificant(), this.lexer.consume(token_1.JsonTokenType.COLON), ...this.lexer.skipInsignificant());
3322
+ const value = this.parseNext();
3323
+ children.push(value);
3324
+ return new node_1.JsonPropertyNode({
3325
+ key,
3326
+ value,
3327
+ children: _JsonParser.createChildren(children),
3328
+ location: {
3329
+ start: children[0].location.start,
3330
+ end: children[children.length - 1].location.end
3331
+ }
3332
+ });
3333
+ }
3334
+ parseIdentifier() {
3335
+ const token = this.lexer.consume(token_1.JsonTokenType.IDENTIFIER);
3336
+ if ((0, identifier_1.isReserved)(token.value)) {
3337
+ const location = token.location.start;
3338
+ throw new error_1.JsonParseError(`Reserved identifier '${token.value}' at ${location.line}:${location.column}.`, token.location);
3339
+ }
3340
+ const tokenNode = new node_1.JsonTokenNode(token);
3341
+ return new node_1.JsonIdentifierNode({
3342
+ token: tokenNode,
3343
+ children: [tokenNode],
3344
+ location: token.location
3345
+ });
3346
+ }
3347
+ static createChildren(children) {
3348
+ return children.map((child) => {
3349
+ if (child instanceof node_1.JsonNode) {
3350
+ return child;
3351
+ }
3352
+ return new node_1.JsonTokenNode(child);
3353
+ });
1203
3354
  }
1204
- return null;
1205
- }
1206
- module2.exports = {
1207
- hookChildProcess,
1208
- verifyENOENT,
1209
- verifyENOENTSync,
1210
- notFoundError
1211
3355
  };
3356
+ exports2.JsonParser = JsonParser2;
1212
3357
  }
1213
3358
  });
1214
3359
 
1215
- // node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js
1216
- var require_cross_spawn = __commonJS({
1217
- "node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js"(exports2, module2) {
3360
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/formatting.js
3361
+ var require_formatting = __commonJS({
3362
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/formatting.js"(exports2) {
1218
3363
  "use strict";
1219
- var cp = require("child_process");
1220
- var parse = require_parse();
1221
- var enoent = require_enoent();
1222
- function spawn2(command, args, options) {
1223
- const parsed = parse(command, args, options);
1224
- const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
1225
- enoent.hookChildProcess(spawned, parsed);
1226
- return spawned;
1227
- }
1228
- function spawnSync(command, args, options) {
1229
- const parsed = parse(command, args, options);
1230
- const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
1231
- result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
1232
- return result;
1233
- }
1234
- module2.exports = spawn2;
1235
- module2.exports.spawn = spawn2;
1236
- module2.exports.sync = spawnSync;
1237
- module2.exports._parse = parse;
1238
- module2.exports._enoent = enoent;
3364
+ Object.defineProperty(exports2, "__esModule", { value: true });
3365
+ }
3366
+ });
3367
+
3368
+ // node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/index.js
3369
+ var require_json5_parser = __commonJS({
3370
+ "node_modules/.pnpm/@croct+json5-parser@0.2.0/node_modules/@croct/json5-parser/index.js"(exports2) {
3371
+ "use strict";
3372
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m2, k3, k22) {
3373
+ if (k22 === void 0) k22 = k3;
3374
+ var desc = Object.getOwnPropertyDescriptor(m2, k3);
3375
+ if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
3376
+ desc = { enumerable: true, get: function() {
3377
+ return m2[k3];
3378
+ } };
3379
+ }
3380
+ Object.defineProperty(o2, k22, desc);
3381
+ }) : (function(o2, m2, k3, k22) {
3382
+ if (k22 === void 0) k22 = k3;
3383
+ o2[k22] = m2[k3];
3384
+ }));
3385
+ var __exportStar = exports2 && exports2.__exportStar || function(m2, exports3) {
3386
+ for (var p2 in m2) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p2)) __createBinding(exports3, m2, p2);
3387
+ };
3388
+ Object.defineProperty(exports2, "__esModule", { value: true });
3389
+ __exportStar(require_identifier(), exports2);
3390
+ __exportStar(require_lexer(), exports2);
3391
+ __exportStar(require_location(), exports2);
3392
+ __exportStar(require_parser(), exports2);
3393
+ __exportStar(require_token(), exports2);
3394
+ __exportStar(require_formatting(), exports2);
3395
+ __exportStar(require_node2(), exports2);
3396
+ __exportStar(require_error(), exports2);
1239
3397
  }
1240
3398
  });
1241
3399
 
@@ -1320,11 +3478,11 @@ __export(rename_import_exports, {
1320
3478
  });
1321
3479
  function replaceImportInFiles(changes, library) {
1322
3480
  const project = new import_ts_morph.Project();
1323
- visitNotIgnoredFiles(".", (path3) => {
1324
- if (!path3.endsWith(".ts") && !path3.endsWith(".tsx")) {
3481
+ visitNotIgnoredFiles(".", (path4) => {
3482
+ if (!path4.endsWith(".ts") && !path4.endsWith(".tsx")) {
1325
3483
  return;
1326
3484
  }
1327
- project.addSourceFileAtPath(path3);
3485
+ project.addSourceFileAtPath(path4);
1328
3486
  });
1329
3487
  project.getSourceFiles().forEach((sourceFile) => {
1330
3488
  let hasChanges = false;
@@ -1350,7 +3508,7 @@ function replaceImportInFiles(changes, library) {
1350
3508
  });
1351
3509
  if (hasChanges) {
1352
3510
  sourceFile.saveSync();
1353
- f2.info(`Updated imports in ${sourceFile.getFilePath()}`);
3511
+ M2.info(`Updated imports in ${sourceFile.getFilePath()}`);
1354
3512
  }
1355
3513
  });
1356
3514
  }
@@ -1365,12 +3523,12 @@ var init_rename_import = __esm({
1365
3523
  });
1366
3524
 
1367
3525
  // packages/qwik/src/cli/index.ts
1368
- var cli_exports = {};
1369
- __export(cli_exports, {
3526
+ var index_exports = {};
3527
+ __export(index_exports, {
1370
3528
  runCli: () => runCli,
1371
3529
  updateApp: () => updateApp
1372
3530
  });
1373
- module.exports = __toCommonJS(cli_exports);
3531
+ module.exports = __toCommonJS(index_exports);
1374
3532
 
1375
3533
  // node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/colors.mjs
1376
3534
  var FORCE_COLOR;
@@ -1385,9 +3543,9 @@ if (typeof process !== "undefined") {
1385
3543
  var $ = {
1386
3544
  enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY)
1387
3545
  };
1388
- function init(x3, y3) {
3546
+ function init(x2, y3) {
1389
3547
  let rgx = new RegExp(`\\x1b\\[${y3}m`, "g");
1390
- let open = `\x1B[${x3}m`, close = `\x1B[${y3}m`;
3548
+ let open = `\x1B[${x2}m`, close = `\x1B[${y3}m`;
1391
3549
  return function(txt) {
1392
3550
  if (!$.enabled || txt == null) return txt;
1393
3551
  return open + (!!~("" + txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close;
@@ -1504,11 +3662,11 @@ function runCommand(cmd, args, cwd) {
1504
3662
  child.on("error", (e2) => {
1505
3663
  if (e2) {
1506
3664
  if (e2.message) {
1507
- f2.error(red(String(e2.message)) + `
3665
+ M2.error(red(String(e2.message)) + `
1508
3666
 
1509
3667
  `);
1510
3668
  } else {
1511
- f2.error(red(String(e2)) + `
3669
+ M2.error(red(String(e2)) + `
1512
3670
 
1513
3671
  `);
1514
3672
  }
@@ -1534,13 +3692,13 @@ function runCommand(cmd, args, cwd) {
1534
3692
  return { abort, install };
1535
3693
  }
1536
3694
  async function readPackageJson(dir) {
1537
- const path3 = (0, import_node_path2.join)(dir, "package.json");
1538
- const pkgJson = JSON.parse(await import_node_fs2.default.promises.readFile(path3, "utf-8"));
3695
+ const path4 = (0, import_node_path2.join)(dir, "package.json");
3696
+ const pkgJson = JSON.parse(await import_node_fs2.default.promises.readFile(path4, "utf-8"));
1539
3697
  return pkgJson;
1540
3698
  }
1541
3699
  async function writePackageJson(dir, pkgJson) {
1542
- const path3 = (0, import_node_path2.join)(dir, "package.json");
1543
- await import_node_fs2.default.promises.writeFile(path3, JSON.stringify(pkgJson, null, 2) + "\n");
3700
+ const path4 = (0, import_node_path2.join)(dir, "package.json");
3701
+ await import_node_fs2.default.promises.writeFile(path4, JSON.stringify(pkgJson, null, 2) + "\n");
1544
3702
  }
1545
3703
  function dashToTitleCase(str) {
1546
3704
  return str.toLocaleLowerCase().split("-").map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join(" ");
@@ -1553,7 +3711,7 @@ function limitLength(hint, maxLength = 50) {
1553
3711
  }
1554
3712
  function getPackageManager() {
1555
3713
  var _a;
1556
- return ((_a = (0, import_which_pm_runs.default)()) == null ? void 0 : _a.name) || "npm";
3714
+ return ((_a = (0, import_which_pm_runs.default)()) == null ? void 0 : _a.name) || "pnpm";
1557
3715
  }
1558
3716
  function pmRunCmd() {
1559
3717
  const pm = getPackageManager();
@@ -1569,7 +3727,7 @@ function panic(msg) {
1569
3727
  process.exit(1);
1570
3728
  }
1571
3729
  function bye() {
1572
- $e("Take care, see you soon! \u{1F44B}");
3730
+ Se("Take care, see you soon! \u{1F44B}");
1573
3731
  process.exit(0);
1574
3732
  }
1575
3733
  function printHeader() {
@@ -1620,7 +3778,7 @@ function isUnicodeSupported() {
1620
3778
  process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1621
3779
  }
1622
3780
  var unicode = isUnicodeSupported();
1623
- var s = (c2, fallback) => unicode ? c2 : fallback;
3781
+ var s = (c, fallback) => unicode ? c : fallback;
1624
3782
  var S_BAR = s("\u2502", "|");
1625
3783
  var S_BAR_H = s("\u2500", "-");
1626
3784
  var S_CORNER_TOP_RIGHT = s("\u256E", "+");
@@ -1662,14 +3820,14 @@ ${gray(S_CONNECT_LEFT + S_BAR_H.repeat(len + 2) + S_CORNER_BOTTOM_RIGHT)}
1662
3820
  // packages/qwik/src/cli/utils/integrations.ts
1663
3821
  var integrations = null;
1664
3822
  async function sortIntegrationsAndReturnAsClackOptions(integrations2, { maxHintLength = 50, showHint = true } = {}) {
1665
- return integrations2.sort((a3, b3) => {
1666
- if (a3.priority > b3.priority) {
3823
+ return integrations2.sort((a, b3) => {
3824
+ if (a.priority > b3.priority) {
1667
3825
  return -1;
1668
3826
  }
1669
- if (a3.priority < b3.priority) {
3827
+ if (a.priority < b3.priority) {
1670
3828
  return 1;
1671
3829
  }
1672
- return a3.id < b3.id ? -1 : 1;
3830
+ return a.id < b3.id ? -1 : 1;
1673
3831
  }).map((i) => ({
1674
3832
  value: i.id,
1675
3833
  label: i.name,
@@ -1712,14 +3870,14 @@ async function loadIntegrations() {
1712
3870
  }
1713
3871
  })
1714
3872
  );
1715
- loadingIntegrations.sort((a3, b3) => {
1716
- if (a3.priority > b3.priority) {
3873
+ loadingIntegrations.sort((a, b3) => {
3874
+ if (a.priority > b3.priority) {
1717
3875
  return -1;
1718
3876
  }
1719
- if (a3.priority < b3.priority) {
3877
+ if (a.priority < b3.priority) {
1720
3878
  return 1;
1721
3879
  }
1722
- return a3.id < b3.id ? -1 : 1;
3880
+ return a.id < b3.id ? -1 : 1;
1723
3881
  });
1724
3882
  integrations = loadingIntegrations;
1725
3883
  }
@@ -1756,6 +3914,7 @@ var import_node_fs5 = __toESM(require("node:fs"), 1);
1756
3914
  var import_node_path5 = require("node:path");
1757
3915
 
1758
3916
  // packages/qwik/src/cli/add/update-files.ts
3917
+ var import_json5_parser = __toESM(require_json5_parser(), 1);
1759
3918
  var import_node_fs4 = __toESM(require("node:fs"), 1);
1760
3919
  var import_node_path4 = require("node:path");
1761
3920
  async function mergeIntegrationDir(fileUpdates, opts, srcDir, destDir, alwaysInRoot) {
@@ -1773,8 +3932,8 @@ async function mergeIntegrationDir(fileUpdates, opts, srcDir, destDir, alwaysInR
1773
3932
  const finalDestPath = getFinalDestPath(opts, destRootPath, destDir, destName, alwaysInRoot);
1774
3933
  if (destName === "package.json") {
1775
3934
  await mergePackageJsons(fileUpdates, srcChildPath, destRootPath);
1776
- } else if (destName === "settings.json") {
1777
- await mergeJsons(fileUpdates, srcChildPath, finalDestPath);
3935
+ } else if (destDir.endsWith(".vscode") && destName === "settings.json") {
3936
+ await mergeVSCodeSettings(fileUpdates, srcChildPath, finalDestPath);
1778
3937
  } else if (destName === "README.md") {
1779
3938
  await mergeReadmes(fileUpdates, srcChildPath, finalDestPath);
1780
3939
  } else if (destName === ".gitignore" || destName === ".prettierignore" || destName === ".eslintignore") {
@@ -1834,15 +3993,18 @@ async function mergePackageJsons(fileUpdates, srcPath, destPath) {
1834
3993
  });
1835
3994
  }
1836
3995
  }
1837
- async function mergeJsons(fileUpdates, srcPath, destPath) {
3996
+ async function mergeVSCodeSettings(fileUpdates, srcPath, destPath) {
1838
3997
  const srcContent = await import_node_fs4.default.promises.readFile(srcPath, "utf-8");
1839
3998
  try {
1840
- const srcPkgJson = JSON.parse(srcContent);
1841
- const destPkgJson = JSON.parse(await import_node_fs4.default.promises.readFile(destPath, "utf-8"));
1842
- Object.assign(srcPkgJson, destPkgJson);
3999
+ const srcPkgJson = import_json5_parser.JsonParser.parse(srcContent, import_json5_parser.JsonObjectNode);
4000
+ const destPkgJson = import_json5_parser.JsonParser.parse(
4001
+ await import_node_fs4.default.promises.readFile(destPath, "utf-8"),
4002
+ import_json5_parser.JsonObjectNode
4003
+ );
4004
+ destPkgJson.merge(srcPkgJson);
1843
4005
  fileUpdates.files.push({
1844
4006
  path: destPath,
1845
- content: JSON.stringify(srcPkgJson, null, 2) + "\n",
4007
+ content: destPkgJson.toString() + "\n",
1846
4008
  type: "modify"
1847
4009
  });
1848
4010
  } catch (e2) {
@@ -2074,8 +4236,8 @@ function appendImports(ts2, tsSourceFile, defaultImport, namedImport, importPath
2074
4236
  const importSpecifier = ts2.factory.createImportSpecifier(false, void 0, identifier);
2075
4237
  existingNamedImports.push(importSpecifier);
2076
4238
  }
2077
- existingNamedImports.sort((a3, b3) => {
2078
- const aName = a3.name.escapedText.toString();
4239
+ existingNamedImports.sort((a, b3) => {
4240
+ const aName = a.name.escapedText.toString();
2079
4241
  const bName = b3.name.escapedText.toString();
2080
4242
  return aName < bName ? -1 : 1;
2081
4243
  });
@@ -2199,22 +4361,22 @@ function updateVitConfigObj(ts2, obj, updates) {
2199
4361
  }
2200
4362
  function updatePlugins(ts2, obj, updates) {
2201
4363
  const properties = [];
2202
- for (const p of obj.properties) {
2203
- if (ts2.isPropertyAssignment(p)) {
2204
- if (p.name && ts2.isIdentifier(p.name) && p.name.text === "plugins") {
2205
- if (ts2.isArrayLiteralExpression(p.initializer)) {
4364
+ for (const p2 of obj.properties) {
4365
+ if (ts2.isPropertyAssignment(p2)) {
4366
+ if (p2.name && ts2.isIdentifier(p2.name) && p2.name.text === "plugins") {
4367
+ if (ts2.isArrayLiteralExpression(p2.initializer)) {
2206
4368
  properties.push(
2207
4369
  ts2.factory.updatePropertyAssignment(
2208
- p,
2209
- p.name,
2210
- updatePluginsArray(ts2, p.initializer, updates)
4370
+ p2,
4371
+ p2.name,
4372
+ updatePluginsArray(ts2, p2.initializer, updates)
2211
4373
  )
2212
4374
  );
2213
4375
  continue;
2214
4376
  }
2215
4377
  }
2216
4378
  }
2217
- properties.push(p);
4379
+ properties.push(p2);
2218
4380
  }
2219
4381
  return ts2.factory.updateObjectLiteralExpression(obj, properties);
2220
4382
  }
@@ -2287,12 +4449,12 @@ function updateObjectLiteralExpression(ts2, obj, updateObj) {
2287
4449
  const exp = s2.expression;
2288
4450
  let added = false;
2289
4451
  const properties = [];
2290
- for (const p of obj.properties) {
2291
- if (p.name && ts2.isIdentifier(p.name) && p.name.text === propName) {
4452
+ for (const p2 of obj.properties) {
4453
+ if (p2.name && ts2.isIdentifier(p2.name) && p2.name.text === propName) {
2292
4454
  properties.push(ts2.factory.createPropertyAssignment(propName, exp));
2293
4455
  added = true;
2294
4456
  } else {
2295
- properties.push(p);
4457
+ properties.push(p2);
2296
4458
  }
2297
4459
  }
2298
4460
  if (!added) {
@@ -2309,12 +4471,12 @@ function transformSource(ts2, sourceText, transformer) {
2309
4471
  const t = ts2.transform(ts2.createSourceFile("/tmp.ts", sourceText, ts2.ScriptTarget.Latest), [
2310
4472
  transformer
2311
4473
  ]);
2312
- const p = ts2.createPrinter({
4474
+ const p2 = ts2.createPrinter({
2313
4475
  removeComments: false,
2314
4476
  omitTrailingSemicolon: false,
2315
4477
  noEmitHelpers: true
2316
4478
  });
2317
- return p.printFile(t.transformed[0]);
4479
+ return p2.printFile(t.transformed[0]);
2318
4480
  }
2319
4481
 
2320
4482
  // packages/qwik/src/cli/add/update-vite-config.ts
@@ -2391,13 +4553,13 @@ async function updateApp(pkgManager, opts) {
2391
4553
  }
2392
4554
  const commit = async (showSpinner) => {
2393
4555
  const isInstallingDeps = Object.keys(fileUpdates.installedDeps).length > 0;
2394
- const s2 = de();
4556
+ const s2 = Y2();
2395
4557
  if (showSpinner) {
2396
4558
  s2.start(`Updating app${isInstallingDeps ? " and installing dependencies" : ""}...`);
2397
4559
  }
2398
4560
  let passed = true;
2399
4561
  try {
2400
- const dirs = new Set(fileUpdates.files.map((f3) => (0, import_node_path5.dirname)(f3.path)));
4562
+ const dirs = new Set(fileUpdates.files.map((f) => (0, import_node_path5.dirname)(f.path)));
2401
4563
  for (const dir of Array.from(dirs)) {
2402
4564
  try {
2403
4565
  import_node_fs5.default.mkdirSync(dir, { recursive: true });
@@ -2405,8 +4567,8 @@ async function updateApp(pkgManager, opts) {
2405
4567
  }
2406
4568
  }
2407
4569
  const fsWrites = Promise.all(
2408
- fileUpdates.files.map(async (f3) => {
2409
- await import_node_fs5.default.promises.writeFile(f3.path, f3.content);
4570
+ fileUpdates.files.map(async (f) => {
4571
+ await import_node_fs5.default.promises.writeFile(f.path, f.content);
2410
4572
  })
2411
4573
  );
2412
4574
  if (opts.installDeps && Object.keys(fileUpdates.installedDeps).length > 0) {
@@ -2422,7 +4584,7 @@ async function updateApp(pkgManager, opts) {
2422
4584
  You might need to run "${cyan(
2423
4585
  `${pkgManager} install`
2424
4586
  )}" manually inside the root of the project.`;
2425
- f2.error(errorMessage);
4587
+ M2.error(errorMessage);
2426
4588
  }
2427
4589
  } catch (e2) {
2428
4590
  showSpinner && s2.stop("App updated");
@@ -2449,18 +4611,18 @@ async function runAddInteractive(app, id) {
2449
4611
  if (!integration) {
2450
4612
  throw new Error(`Invalid integration: ${id}`);
2451
4613
  }
2452
- oe(`\u{1F98B} ${bgBlue(` Add Integration `)} ${bold(magenta(integration.id))}`);
4614
+ Ie(`\u{1F98B} ${bgBlue(` Add Integration `)} ${bold(magenta(integration.id))}`);
2453
4615
  } else {
2454
- oe(`\u{1F98B} ${bgBlue(` Add Integration `)}`);
4616
+ Ie(`\u{1F98B} ${bgBlue(` Add Integration `)}`);
2455
4617
  const integrationChoices = [
2456
4618
  ...integrations2.filter((i) => i.type === "adapter"),
2457
4619
  ...integrations2.filter((i) => i.type === "feature")
2458
4620
  ];
2459
- const integrationAnswer = await ie({
4621
+ const integrationAnswer = await ve({
2460
4622
  message: "What integration would you like to add?",
2461
4623
  options: await sortIntegrationsAndReturnAsClackOptions(integrationChoices)
2462
4624
  });
2463
- if (hD(integrationAnswer)) {
4625
+ if (pD(integrationAnswer)) {
2464
4626
  bye();
2465
4627
  }
2466
4628
  integration = integrations2.find((i) => i.id === integrationAnswer);
@@ -2492,7 +4654,7 @@ async function runAddInteractive(app, id) {
2492
4654
  await result.commit(true);
2493
4655
  const postInstall = (_a = result.integration.pkgJson.__qwik__) == null ? void 0 : _a.postInstall;
2494
4656
  if (postInstall) {
2495
- const s2 = de();
4657
+ const s2 = Y2();
2496
4658
  s2.start(`Running post install script: ${postInstall}`);
2497
4659
  await runInPkg(pkgManager, postInstall.split(" "), app.rootDir);
2498
4660
  s2.stop("Post install script complete");
@@ -2501,42 +4663,42 @@ async function runAddInteractive(app, id) {
2501
4663
  process.exit(0);
2502
4664
  }
2503
4665
  async function logUpdateAppResult(pkgManager, result) {
2504
- const modifyFiles = result.updates.files.filter((f3) => f3.type === "modify");
2505
- const overwriteFiles = result.updates.files.filter((f3) => f3.type === "overwrite");
2506
- const createFiles = result.updates.files.filter((f3) => f3.type === "create");
4666
+ const modifyFiles = result.updates.files.filter((f) => f.type === "modify");
4667
+ const overwriteFiles = result.updates.files.filter((f) => f.type === "overwrite");
4668
+ const createFiles = result.updates.files.filter((f) => f.type === "create");
2507
4669
  const installDepNames = Object.keys(result.updates.installedDeps);
2508
4670
  const installScripts = result.updates.installedScripts;
2509
4671
  const installDeps2 = installDepNames.length > 0;
2510
4672
  if (modifyFiles.length === 0 && overwriteFiles.length === 0 && createFiles.length === 0 && installScripts.length === 0 && !installDeps2) {
2511
4673
  panic(`No updates made`);
2512
4674
  }
2513
- f2.step(`\u{1F47B} ${bgBlue(` Ready? `)} Add ${bold(magenta(result.integration.id))} to your app?`);
4675
+ M2.step(`\u{1F47B} ${bgBlue(` Ready? `)} Add ${bold(magenta(result.integration.id))} to your app?`);
2514
4676
  if (modifyFiles.length > 0) {
2515
- f2.message(
4677
+ M2.message(
2516
4678
  [
2517
4679
  `\u{1F42C} ${cyan("Modify")}`,
2518
- ...modifyFiles.map((f3) => ` - ${(0, import_node_path6.relative)(process.cwd(), f3.path)}`)
4680
+ ...modifyFiles.map((f) => ` - ${(0, import_node_path6.relative)(process.cwd(), f.path)}`)
2519
4681
  ].join("\n")
2520
4682
  );
2521
4683
  }
2522
4684
  if (createFiles.length > 0) {
2523
- f2.message(
4685
+ M2.message(
2524
4686
  [
2525
4687
  `\u{1F31F} ${cyan(`Create`)}`,
2526
- ...createFiles.map((f3) => ` - ${(0, import_node_path6.relative)(process.cwd(), f3.path)}`)
4688
+ ...createFiles.map((f) => ` - ${(0, import_node_path6.relative)(process.cwd(), f.path)}`)
2527
4689
  ].join("\n")
2528
4690
  );
2529
4691
  }
2530
4692
  if (overwriteFiles.length > 0) {
2531
- f2.message(
4693
+ M2.message(
2532
4694
  [
2533
4695
  `\u{1F433} ${cyan(`Overwrite`)}`,
2534
- ...overwriteFiles.map((f3) => ` - ${(0, import_node_path6.relative)(process.cwd(), f3.path)}`)
4696
+ ...overwriteFiles.map((f) => ` - ${(0, import_node_path6.relative)(process.cwd(), f.path)}`)
2535
4697
  ].join("\n")
2536
4698
  );
2537
4699
  }
2538
4700
  if (installDepNames.length > 0) {
2539
- f2.message(
4701
+ M2.message(
2540
4702
  [
2541
4703
  `\u{1F4BE} ${cyan(`Install ${pkgManager} dependenc${installDepNames.length > 1 ? "ies" : "y"}:`)}`,
2542
4704
  ...installDepNames.map(
@@ -2547,21 +4709,21 @@ async function logUpdateAppResult(pkgManager, result) {
2547
4709
  }
2548
4710
  if (installScripts.length > 0) {
2549
4711
  const prefix = pkgManager === "npm" ? "npm run" : pkgManager;
2550
- f2.message(
4712
+ M2.message(
2551
4713
  [
2552
4714
  `\u{1F4DC} ${cyan(`New ${pkgManager} script${installDepNames.length > 1 ? "s" : ""}:`)}`,
2553
4715
  ...installScripts.map((script) => ` - ${prefix} ${script}`)
2554
4716
  ].join("\n")
2555
4717
  );
2556
4718
  }
2557
- const commit = await ie({
4719
+ const commit = await ve({
2558
4720
  message: `Ready to apply the ${bold(magenta(result.integration.id))} updates to your app?`,
2559
4721
  options: [
2560
4722
  { label: "Yes looks good, finish update!", value: true },
2561
4723
  { label: "Nope, cancel update", value: false }
2562
4724
  ]
2563
4725
  });
2564
- if (hD(commit) || !commit) {
4726
+ if (pD(commit) || !commit) {
2565
4727
  bye();
2566
4728
  }
2567
4729
  }
@@ -2577,7 +4739,7 @@ function logUpdateAppCommitResult(result, pkgManager) {
2577
4739
  const noteMessage = `\u{1F7E3} ${bgMagenta(` ${nextSteps.title ?? "Action Required!"} `)}`;
2578
4740
  note(logNextStep(nextSteps, pkgManager), noteMessage);
2579
4741
  }
2580
- $e(`\u{1F984} ${bgMagenta(` Success! `)} Added ${bold(cyan(result.integration.id))} to your app`);
4742
+ Se(`\u{1F984} ${bgMagenta(` Success! `)} Added ${bold(cyan(result.integration.id))} to your app`);
2581
4743
  }
2582
4744
 
2583
4745
  // packages/qwik/src/cli/add/print-add-help.ts
@@ -2595,21 +4757,21 @@ async function printAddHelp(app) {
2595
4757
  const adapters = integrations2.filter((i) => i.type === "adapter");
2596
4758
  const features = integrations2.filter((i) => i.type === "feature");
2597
4759
  const pmRun = pmRunCmd();
2598
- oe(`${pmRun} qwik ${magenta(`add`)} [integration]`);
4760
+ Ie(`${pmRun} qwik ${magenta(`add`)} [integration]`);
2599
4761
  note(renderIntegration(adapters), "Adapters");
2600
4762
  note(renderIntegration(features), "Features");
2601
- const proceed = await se({
4763
+ const proceed = await ye({
2602
4764
  message: "Do you want to install an integration?",
2603
4765
  initialValue: true
2604
4766
  });
2605
- if (hD(proceed) || !proceed) {
4767
+ if (pD(proceed) || !proceed) {
2606
4768
  bye();
2607
4769
  }
2608
- const command = await ie({
4770
+ const command = await ve({
2609
4771
  message: "Select an integration",
2610
4772
  options: await sortIntegrationsAndReturnAsClackOptions(integrations2)
2611
4773
  });
2612
- if (hD(command)) {
4774
+ if (pD(command)) {
2613
4775
  bye();
2614
4776
  }
2615
4777
  runAddInteractive(app, command);
@@ -2653,13 +4815,13 @@ async function loadTemplates() {
2653
4815
  allTemplates.push(template);
2654
4816
  })
2655
4817
  );
2656
- allTemplates.sort((a3, b3) => {
2657
- if (a3.id === "qwik") {
4818
+ allTemplates.sort((a, b3) => {
4819
+ if (a.id === "qwik") {
2658
4820
  return -1;
2659
4821
  } else if (b3.id === "qwik") {
2660
4822
  return 1;
2661
4823
  }
2662
- return a3.id > b3.id ? 1 : -1;
4824
+ return a.id > b3.id ? 1 : -1;
2663
4825
  });
2664
4826
  templates = allTemplates;
2665
4827
  }
@@ -2675,16 +4837,16 @@ async function readTemplates(rootDir) {
2675
4837
  const markdown = await getFilesDeep(markdownDir);
2676
4838
  const mdx = await getFilesDeep(mdxDir);
2677
4839
  return {
2678
- component: component.map((c2) => parseTemplatePath(c2, "component")),
4840
+ component: component.map((c) => parseTemplatePath(c, "component")),
2679
4841
  route: route.map((r2) => parseTemplatePath(r2, "route")),
2680
4842
  markdown: markdown.map((m2) => parseTemplatePath(m2, "markdown")),
2681
4843
  mdx: mdx.map((m2) => parseTemplatePath(m2, "mdx"))
2682
4844
  };
2683
4845
  }
2684
- function parseTemplatePath(path3, type) {
2685
- const parts = path3.split(import_node_path7.sep + type + import_node_path7.sep);
4846
+ function parseTemplatePath(path4, type) {
4847
+ const parts = path4.split(import_node_path7.sep + type + import_node_path7.sep);
2686
4848
  return {
2687
- absolute: path3,
4849
+ absolute: path4,
2688
4850
  relative: parts[1]
2689
4851
  };
2690
4852
  }
@@ -2736,13 +4898,13 @@ var MDX_SUFFIX = ".mdx";
2736
4898
  async function runNewCommand(app) {
2737
4899
  try {
2738
4900
  if (app.args.length > 1 && app.args[1] === "help") {
2739
- oe(`\u{1F52D} ${bgMagenta(" Qwik Help ")}`);
4901
+ Ie(`\u{1F52D} ${bgMagenta(" Qwik Help ")}`);
2740
4902
  await printNewHelp();
2741
4903
  bye();
2742
4904
  } else {
2743
- oe(`\u2728 ${bgMagenta(" Create a new Qwik component or route ")}`);
4905
+ Ie(`\u2728 ${bgMagenta(" Create a new Qwik component or route ")}`);
2744
4906
  }
2745
- const args = app.args.filter((a3) => !a3.startsWith("--"));
4907
+ const args = app.args.filter((a) => !a.startsWith("--"));
2746
4908
  const mainInput = args.slice(1).join(" ");
2747
4909
  let typeArg = void 0;
2748
4910
  let nameArg;
@@ -2762,7 +4924,7 @@ async function runNewCommand(app) {
2762
4924
  typeArg = "component";
2763
4925
  nameArg = mainInput;
2764
4926
  }
2765
- let templateArg = app.args.filter((a3) => a3.startsWith("--")).map((a3) => a3.substring(2)).join("");
4927
+ let templateArg = app.args.filter((a) => a.startsWith("--")).map((a) => a.substring(2)).join("");
2766
4928
  if (!templateArg && mainInput) {
2767
4929
  templateArg = "qwik";
2768
4930
  }
@@ -2785,7 +4947,7 @@ async function runNewCommand(app) {
2785
4947
  (i) => i.id === templateArg && i[typeArg] && i[typeArg].length
2786
4948
  );
2787
4949
  if (!templates2.length) {
2788
- f2.error(`Template "${templateArg}" not found`);
4950
+ M2.error(`Template "${templateArg}" not found`);
2789
4951
  bye();
2790
4952
  }
2791
4953
  template = templates2[0][typeArg][0];
@@ -2796,16 +4958,16 @@ async function runNewCommand(app) {
2796
4958
  outDir = (0, import_path2.join)(app.rootDir, "src", `components`, nameArg);
2797
4959
  }
2798
4960
  const fileOutput = await writeToFile(name, slug, template, outDir);
2799
- f2.success(`${green(`${toPascal([typeArg])} "${slug}" created!`)}`);
2800
- f2.message(`Emitted in ${dim(fileOutput)}`);
4961
+ M2.success(`${green(`${toPascal([typeArg])} "${slug}" created!`)}`);
4962
+ M2.message(`Emitted in ${dim(fileOutput)}`);
2801
4963
  } catch (e2) {
2802
- f2.error(String(e2));
4964
+ M2.error(String(e2));
2803
4965
  await printNewHelp();
2804
4966
  }
2805
4967
  bye();
2806
4968
  }
2807
4969
  async function selectType() {
2808
- const typeAnswer = await ie({
4970
+ const typeAnswer = await ve({
2809
4971
  message: "What would you like to create?",
2810
4972
  options: [
2811
4973
  { value: "component", label: "Component" },
@@ -2814,7 +4976,7 @@ async function selectType() {
2814
4976
  { value: "mdx", label: "Route (MDX)" }
2815
4977
  ]
2816
4978
  });
2817
- if (hD(typeAnswer)) {
4979
+ if (pD(typeAnswer)) {
2818
4980
  bye();
2819
4981
  }
2820
4982
  return typeAnswer;
@@ -2834,7 +4996,7 @@ async function selectName(type) {
2834
4996
  component: "my-component"
2835
4997
  };
2836
4998
  const placeholder = placeholders[type];
2837
- const nameAnswer = await te({
4999
+ const nameAnswer = await he({
2838
5000
  message,
2839
5001
  placeholder,
2840
5002
  validate: (v2) => {
@@ -2843,7 +5005,7 @@ async function selectName(type) {
2843
5005
  }
2844
5006
  }
2845
5007
  });
2846
- if (hD(nameAnswer)) {
5008
+ if (pD(nameAnswer)) {
2847
5009
  bye();
2848
5010
  }
2849
5011
  if (typeof nameAnswer !== "string") {
@@ -2864,17 +5026,17 @@ async function selectTemplate(typeArg) {
2864
5026
  const allTemplates = await loadTemplates();
2865
5027
  const templates2 = allTemplates.filter((i) => i[typeArg] && i[typeArg].length);
2866
5028
  if (!templates2.length) {
2867
- f2.error(`No templates found for type "${typeArg}"`);
5029
+ M2.error(`No templates found for type "${typeArg}"`);
2868
5030
  bye();
2869
5031
  }
2870
5032
  if (templates2.length === 1) {
2871
5033
  return templates2[0][typeArg][0];
2872
5034
  }
2873
- const templateAnswer = await ie({
5035
+ const templateAnswer = await ve({
2874
5036
  message: "Which template would you like to use?",
2875
5037
  options: templates2.map((t) => ({ value: t[typeArg][0], label: t.id }))
2876
5038
  });
2877
- if (hD(templateAnswer)) {
5039
+ if (pD(templateAnswer)) {
2878
5040
  bye();
2879
5041
  }
2880
5042
  return templateAnswer;
@@ -2916,7 +5078,7 @@ function toSlug(list) {
2916
5078
  return list.join("-");
2917
5079
  }
2918
5080
  function toPascal(list) {
2919
- return list.map((p) => p[0].toUpperCase() + p.substring(1)).join("");
5081
+ return list.map((p2) => p2[0].toUpperCase() + p2.substring(1)).join("");
2920
5082
  }
2921
5083
 
2922
5084
  // packages/create-qwik/src/helpers/jokes.json
@@ -3744,9 +5906,9 @@ var SignalExit = class extends SignalExitBase {
3744
5906
  this.#sigListeners[sig] = () => {
3745
5907
  const listeners = this.#process.listeners(sig);
3746
5908
  let { count } = this.#emitter;
3747
- const p = process7;
3748
- if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
3749
- count += p.__signal_exit_emitter__.count;
5909
+ const p2 = process7;
5910
+ if (typeof p2.__signal_exit_emitter__ === "object" && typeof p2.__signal_exit_emitter__.count === "number") {
5911
+ count += p2.__signal_exit_emitter__.count;
3750
5912
  }
3751
5913
  if (listeners.length === count) {
3752
5914
  this.unload();
@@ -3791,8 +5953,8 @@ var SignalExit = class extends SignalExitBase {
3791
5953
  } catch (_3) {
3792
5954
  }
3793
5955
  }
3794
- this.#process.emit = (ev, ...a3) => {
3795
- return this.#processEmit(ev, ...a3);
5956
+ this.#process.emit = (ev, ...a) => {
5957
+ return this.#processEmit(ev, ...a);
3796
5958
  };
3797
5959
  this.#process.reallyExit = (code) => {
3798
5960
  return this.#processReallyExit(code);
@@ -5180,17 +7342,17 @@ var binaryExtensions = /* @__PURE__ */ new Set([
5180
7342
  ".zip",
5181
7343
  ".zipx"
5182
7344
  ]);
5183
- function isBinaryPath(path3) {
5184
- return binaryExtensions.has((0, import_path3.extname)(path3).toLowerCase());
7345
+ function isBinaryPath(path4) {
7346
+ return binaryExtensions.has((0, import_path3.extname)(path4).toLowerCase());
5185
7347
  }
5186
7348
 
5187
7349
  // packages/qwik/src/cli/migrate-v2/replace-package.ts
5188
7350
  init_visit_not_ignored_files();
5189
7351
  var import_fs3 = require("fs");
5190
7352
  init_dist2();
5191
- function updateFileContent(path3, content) {
5192
- (0, import_fs3.writeFileSync)(path3, content);
5193
- f2.info(`"${path3}" has been updated`);
7353
+ function updateFileContent(path4, content) {
7354
+ (0, import_fs3.writeFileSync)(path4, content);
7355
+ M2.info(`"${path4}" has been updated`);
5194
7356
  }
5195
7357
  function replacePackage(oldPackageName, newPackageName, skipDependencies = false) {
5196
7358
  if (!skipDependencies) {
@@ -5199,12 +7361,12 @@ function replacePackage(oldPackageName, newPackageName, skipDependencies = false
5199
7361
  replaceMentions(oldPackageName, newPackageName);
5200
7362
  }
5201
7363
  function replacePackageInDependencies(oldPackageName, newPackageName) {
5202
- visitNotIgnoredFiles(".", (path3) => {
5203
- if ((0, import_path5.basename)(path3) !== "package.json") {
7364
+ visitNotIgnoredFiles(".", (path4) => {
7365
+ if ((0, import_path5.basename)(path4) !== "package.json") {
5204
7366
  return;
5205
7367
  }
5206
7368
  try {
5207
- const packageJson = JSON.parse((0, import_fs3.readFileSync)(path3, "utf-8"));
7369
+ const packageJson = JSON.parse((0, import_fs3.readFileSync)(path4, "utf-8"));
5208
7370
  for (const deps of [
5209
7371
  packageJson.dependencies ?? {},
5210
7372
  packageJson.devDependencies ?? {},
@@ -5216,15 +7378,15 @@ function replacePackageInDependencies(oldPackageName, newPackageName) {
5216
7378
  delete deps[oldPackageName];
5217
7379
  }
5218
7380
  }
5219
- updateFileContent(path3, JSON.stringify(packageJson, null, 2));
7381
+ updateFileContent(path4, JSON.stringify(packageJson, null, 2));
5220
7382
  } catch (e2) {
5221
- console.warn(`Could not replace ${oldPackageName} with ${newPackageName} in ${path3}.`);
7383
+ console.warn(`Could not replace ${oldPackageName} with ${newPackageName} in ${path4}.`);
5222
7384
  }
5223
7385
  });
5224
7386
  }
5225
7387
  function replaceMentions(oldPackageName, newPackageName) {
5226
- visitNotIgnoredFiles(".", (path3) => {
5227
- if (isBinaryPath(path3)) {
7388
+ visitNotIgnoredFiles(".", (path4) => {
7389
+ if (isBinaryPath(path4)) {
5228
7390
  return;
5229
7391
  }
5230
7392
  const ignoredFiles = [
@@ -5234,18 +7396,18 @@ function replaceMentions(oldPackageName, newPackageName) {
5234
7396
  "bun.lockb",
5235
7397
  "CHANGELOG.md"
5236
7398
  ];
5237
- if (ignoredFiles.includes((0, import_path5.basename)(path3))) {
7399
+ if (ignoredFiles.includes((0, import_path5.basename)(path4))) {
5238
7400
  return;
5239
7401
  }
5240
7402
  try {
5241
- const contents = (0, import_fs3.readFileSync)(path3, "utf-8");
7403
+ const contents = (0, import_fs3.readFileSync)(path4, "utf-8");
5242
7404
  if (!contents.includes(oldPackageName)) {
5243
7405
  return;
5244
7406
  }
5245
- updateFileContent(path3, contents.replace(new RegExp(oldPackageName, "g"), newPackageName));
7407
+ updateFileContent(path4, contents.replace(new RegExp(oldPackageName, "g"), newPackageName));
5246
7408
  } catch {
5247
- f2.warn(
5248
- `An error was thrown when trying to update ${path3}. If you believe the migration should have updated it, be sure to review the file and open an issue.`
7409
+ M2.warn(
7410
+ `An error was thrown when trying to update ${path4}. If you believe the migration should have updated it, be sure to review the file and open an issue.`
5249
7411
  );
5250
7412
  }
5251
7413
  });
@@ -5284,7 +7446,7 @@ async function updateDependencies() {
5284
7446
  }
5285
7447
  }
5286
7448
  await writePackageJson(process.cwd(), packageJson);
5287
- const loading = de();
7449
+ const loading = Y2();
5288
7450
  loading.start(`Updating dependencies...`);
5289
7451
  await runInstall();
5290
7452
  loading.stop("Dependencies have been updated");
@@ -5295,8 +7457,8 @@ function getPackageTag() {
5295
7457
  encoding: "utf-8"
5296
7458
  })) == null ? void 0 : _a.split("\n").filter(Boolean).map(
5297
7459
  (data) => data.split(":").map((v2) => v2 == null ? void 0 : v2.trim()).filter(Boolean)
5298
- ).filter((v2) => v2.length === 2).sort((a3, b3) => {
5299
- let aIndex = versionTagPriority.indexOf(a3[0]);
7460
+ ).filter((v2) => v2.length === 2).sort((a, b3) => {
7461
+ let aIndex = versionTagPriority.indexOf(a[0]);
5300
7462
  let bIndex = versionTagPriority.indexOf(b3[0]);
5301
7463
  if (aIndex === -1) {
5302
7464
  aIndex = Infinity;
@@ -5310,7 +7472,7 @@ function getPackageTag() {
5310
7472
  return version;
5311
7473
  }
5312
7474
  }
5313
- f2.warn('Failed to resolve the Qwik version tag, version "2.0.0" will be installed');
7475
+ M2.warn('Failed to resolve the Qwik version tag, version "2.0.0" will be installed');
5314
7476
  return "2.0.0";
5315
7477
  }
5316
7478
  async function installTsMorph() {
@@ -5319,9 +7481,9 @@ async function installTsMorph() {
5319
7481
  if (((_a = packageJson.dependencies) == null ? void 0 : _a["ts-morph"]) || ((_b = packageJson.devDependencies) == null ? void 0 : _b["ts-morph"])) {
5320
7482
  return false;
5321
7483
  }
5322
- const loading = de();
7484
+ const loading = Y2();
5323
7485
  loading.start("Fetching migration tools..");
5324
- (packageJson.devDependencies ??= {})["ts-morph"] = "latest";
7486
+ (packageJson.devDependencies ??= {})["ts-morph"] = "23";
5325
7487
  await writePackageJson(process.cwd(), packageJson);
5326
7488
  await runInstall();
5327
7489
  loading.stop("Migration tools have been loaded");
@@ -5344,7 +7506,7 @@ async function removeTsMorphFromPackageJson() {
5344
7506
 
5345
7507
  // packages/qwik/src/cli/migrate-v2/run-migration.ts
5346
7508
  async function runV2Migration(app) {
5347
- oe(
7509
+ Ie(
5348
7510
  `\u2728 ${bgMagenta(" This command will migrate your Qwik application from v1 to v2")}
5349
7511
  This includes the following:
5350
7512
  - "@builder.io/qwik", "@builder.io/qwik-city" and "@builder.io/qwik-react" packages will be rescoped to "@qwik.dev/core", "@qwik.dev/router" and "@qwik.dev/react" respectively
@@ -5352,11 +7514,11 @@ This includes the following:
5352
7514
 
5353
7515
  ${bold(bgRed('Warning: migration tool is experimental and will migrate your application to the "alpha" release of Qwik V2'))}`
5354
7516
  );
5355
- const proceed = await se({
7517
+ const proceed = await ye({
5356
7518
  message: "Do you want to proceed?",
5357
7519
  initialValue: true
5358
7520
  });
5359
- if (hD(proceed) || !proceed) {
7521
+ if (pD(proceed) || !proceed) {
5360
7522
  bye();
5361
7523
  }
5362
7524
  try {
@@ -5388,13 +7550,108 @@ ${bold(bgRed('Warning: migration tool is experimental and will migrate your appl
5388
7550
  await removeTsMorphFromPackageJson();
5389
7551
  }
5390
7552
  await updateDependencies();
5391
- f2.success(`${green(`Your application has been successfully migrated to v2!`)}`);
7553
+ M2.success(`${green(`Your application has been successfully migrated to v2!`)}`);
5392
7554
  } catch (error) {
5393
7555
  console.error(error);
5394
7556
  throw error;
5395
7557
  }
5396
7558
  }
5397
7559
 
7560
+ // packages/qwik/src/cli/check-client/index.ts
7561
+ var import_promises2 = __toESM(require("fs/promises"), 1);
7562
+ var import_path6 = __toESM(require("path"), 1);
7563
+ var getDiskPath = (dist) => import_path6.default.resolve(dist);
7564
+ var getSrcPath = (src) => import_path6.default.resolve(src);
7565
+ var getManifestPath = (dist) => import_path6.default.resolve(dist, "q-manifest.json");
7566
+ async function runQwikClientCommand(app) {
7567
+ try {
7568
+ const src = app.args[1];
7569
+ const dist = app.args[2];
7570
+ await checkClientCommand(app, src, dist);
7571
+ } catch (e2) {
7572
+ console.error(`\u274C ${red(String(e2))}
7573
+ `);
7574
+ process.exit(1);
7575
+ }
7576
+ }
7577
+ async function checkClientCommand(app, src, dist) {
7578
+ if (!await clientDirExists(dist)) {
7579
+ await goBuild(app);
7580
+ } else {
7581
+ const manifest = await getManifestTs(getManifestPath(dist));
7582
+ if (manifest === null) {
7583
+ await goBuild(app);
7584
+ } else {
7585
+ if (await hasNewer(getSrcPath(src), manifest)) {
7586
+ await goBuild(app);
7587
+ }
7588
+ }
7589
+ }
7590
+ }
7591
+ async function goBuild(app) {
7592
+ const pkgManager = getPackageManager();
7593
+ const { install } = await runInPkg(pkgManager, ["run", "build.client"], app.rootDir);
7594
+ if (!await install) {
7595
+ throw new Error("Client build command reported failure.");
7596
+ }
7597
+ }
7598
+ async function getManifestTs(manifestPath) {
7599
+ try {
7600
+ const stats = await import_promises2.default.stat(manifestPath);
7601
+ return stats.mtimeMs;
7602
+ } catch (err) {
7603
+ if (err.code !== "ENOENT") {
7604
+ panic(`Error accessing manifest file ${manifestPath}: ${err.message}`);
7605
+ }
7606
+ return null;
7607
+ }
7608
+ }
7609
+ async function clientDirExists(path4) {
7610
+ try {
7611
+ await import_promises2.default.access(getDiskPath(path4));
7612
+ return true;
7613
+ } catch (err) {
7614
+ if (!(err.code === "ENOENT")) {
7615
+ panic(`Error accessing disk directory ${path4}: ${err.message}`);
7616
+ }
7617
+ return false;
7618
+ }
7619
+ }
7620
+ async function hasNewer(srcPath, timestamp) {
7621
+ let returnValue = false;
7622
+ async function traverse(dir) {
7623
+ if (returnValue) {
7624
+ return;
7625
+ }
7626
+ let items;
7627
+ try {
7628
+ items = await import_promises2.default.readdir(dir, { withFileTypes: true });
7629
+ } catch (err) {
7630
+ return;
7631
+ }
7632
+ for (const item of items) {
7633
+ if (returnValue) {
7634
+ return;
7635
+ }
7636
+ const fullPath = import_path6.default.join(dir, item.name);
7637
+ try {
7638
+ if (item.isDirectory()) {
7639
+ await traverse(fullPath);
7640
+ } else if (item.isFile()) {
7641
+ const stats = await import_promises2.default.stat(fullPath);
7642
+ if (stats.mtimeMs > timestamp) {
7643
+ returnValue = true;
7644
+ return;
7645
+ }
7646
+ }
7647
+ } catch (err) {
7648
+ }
7649
+ }
7650
+ }
7651
+ await traverse(srcPath);
7652
+ return returnValue;
7653
+ }
7654
+
5398
7655
  // packages/qwik/src/cli/run.ts
5399
7656
  var SPACE_TO_HINT2 = 18;
5400
7657
  var COMMANDS = [
@@ -5440,6 +7697,13 @@ var COMMANDS = [
5440
7697
  run: (app) => runV2Migration(app),
5441
7698
  showInHelp: false
5442
7699
  },
7700
+ {
7701
+ value: "check-client",
7702
+ label: "check-client",
7703
+ hint: "Make sure the client bundle is up-to-date with the source code",
7704
+ run: (app) => runQwikClientCommand(app),
7705
+ showInHelp: true
7706
+ },
5443
7707
  {
5444
7708
  value: "help",
5445
7709
  label: "help",
@@ -5494,6 +7758,10 @@ async function runCommand2(app) {
5494
7758
  await runV2Migration(app);
5495
7759
  return;
5496
7760
  }
7761
+ case "check-client": {
7762
+ await runQwikClientCommand(app);
7763
+ return;
7764
+ }
5497
7765
  case "version": {
5498
7766
  printVersion();
5499
7767
  return;
@@ -5507,21 +7775,21 @@ async function runCommand2(app) {
5507
7775
  }
5508
7776
  async function printHelp(app) {
5509
7777
  const pmRun = pmRunCmd();
5510
- oe(`\u{1F52D} ${bgMagenta(" Qwik Help ")}`);
7778
+ Ie(`\u{1F52D} ${bgMagenta(" Qwik Help ")}`);
5511
7779
  note(
5512
7780
  COMMANDS.filter((cmd) => cmd.showInHelp).map(
5513
7781
  (cmd) => `${pmRun} qwik ${cyan(cmd.label)}` + " ".repeat(Math.max(SPACE_TO_HINT2 - cmd.label.length, 2)) + dim(cmd.hint)
5514
7782
  ).join("\n"),
5515
7783
  "Available commands"
5516
7784
  );
5517
- const proceed = await se({
7785
+ const proceed = await ye({
5518
7786
  message: "Do you want to run a command?",
5519
7787
  initialValue: true
5520
7788
  });
5521
- if (hD(proceed) || !proceed) {
7789
+ if (pD(proceed) || !proceed) {
5522
7790
  bye();
5523
7791
  }
5524
- const command = await ie({
7792
+ const command = await ve({
5525
7793
  message: "Select a command",
5526
7794
  options: COMMANDS.filter((cmd) => cmd.showInHelp).map((cmd) => ({
5527
7795
  value: cmd.value,
@@ -5529,14 +7797,14 @@ async function printHelp(app) {
5529
7797
  hint: cmd.hint
5530
7798
  }))
5531
7799
  });
5532
- if (hD(command)) {
7800
+ if (pD(command)) {
5533
7801
  bye();
5534
7802
  }
5535
7803
  const args = command.split(" ");
5536
7804
  await runCommand2(Object.assign(app, { task: args[0], args }));
5537
7805
  }
5538
7806
  function printVersion() {
5539
- console.log("2.0.0-alpha.9-dev+56ed5bd");
7807
+ console.log("2.0.0-beta.10-dev+4669425");
5540
7808
  }
5541
7809
  // Annotate the CommonJS export names for ESM import in node:
5542
7810
  0 && (module.exports = {