dorian 2.4.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +15 -0
  3. data/.github/workflows/ci.yml +38 -0
  4. data/.gitignore +30 -0
  5. data/.node-version +1 -0
  6. data/.prettierignore +2 -0
  7. data/.rubocop.yml +129 -0
  8. data/.ruby-version +1 -0
  9. data/.tool-versions +3 -0
  10. data/Gemfile +20 -0
  11. data/Gemfile.lock +186 -0
  12. data/LICENSE +19 -0
  13. data/README.md +24 -0
  14. data/VERSION +1 -1
  15. data/bin/bundle +123 -0
  16. data/bin/bundle-audit +31 -0
  17. data/bin/bundler-audit +31 -0
  18. data/bin/rspec +31 -0
  19. data/bin/rubocop +31 -0
  20. data/dorian.gemspec +35 -0
  21. data/lib/dorian/bin.rb +739 -81
  22. data/package-lock.json +39 -0
  23. data/package.json +11 -0
  24. data/samples/books.json +33 -0
  25. data/samples/books.jsonl +3 -0
  26. data/samples/config.yml +27 -0
  27. data/samples/config_2.yml +22 -0
  28. data/samples/maths.js +1 -0
  29. data/samples/numbers.raw +10 -0
  30. data/samples/people.csv +6 -0
  31. data/samples/people.yml +28 -0
  32. data/samples/query.sql +7 -0
  33. data/samples/user.json +31 -0
  34. data/spec/dorian_spec.rb +276 -0
  35. data/spec/spec_helper.rb +3 -0
  36. data/vendor/groovy-beautify/LICENSE.MD +21 -0
  37. data/vendor/groovy-beautify/README.md +65 -0
  38. data/vendor/groovy-beautify/dist/__tests__/index.test.d.ts +1 -0
  39. data/vendor/groovy-beautify/dist/cjs/index.js +573 -0
  40. data/vendor/groovy-beautify/dist/cjs/package.json +3 -0
  41. data/vendor/groovy-beautify/dist/es/index.js +682 -0
  42. data/vendor/groovy-beautify/dist/es/package.json +3 -0
  43. data/vendor/groovy-beautify/dist/formatter/FormatRule.d.ts +14 -0
  44. data/vendor/groovy-beautify/dist/formatter/Formatter.d.ts +11 -0
  45. data/vendor/groovy-beautify/dist/formatter/GroovyFormatRules.d.ts +3 -0
  46. data/vendor/groovy-beautify/dist/formatter/__tests__/formatter.test.d.ts +1 -0
  47. data/vendor/groovy-beautify/dist/index.d.ts +5 -0
  48. data/vendor/groovy-beautify/dist/parser/GroovyParseRules.d.ts +3 -0
  49. data/vendor/groovy-beautify/dist/parser/ParseRule.d.ts +23 -0
  50. data/vendor/groovy-beautify/dist/parser/Parser.d.ts +29 -0
  51. data/vendor/groovy-beautify/dist/parser/__tests__/parser.test.d.ts +1 -0
  52. data/vendor/groovy-beautify/dist/parser/types.d.ts +6 -0
  53. data/vendor/groovy-beautify/dist/utils/text.d.ts +4 -0
  54. data/vendor/groovy-beautify/package.json +55 -0
  55. data/vendor/prettier/LICENSE +4379 -0
  56. data/vendor/prettier/README.md +109 -0
  57. data/vendor/prettier/bin/prettier.cjs +71 -0
  58. data/vendor/prettier/doc.d.ts +243 -0
  59. data/vendor/prettier/doc.js +1545 -0
  60. data/vendor/prettier/doc.mjs +1503 -0
  61. data/vendor/prettier/index.cjs +825 -0
  62. data/vendor/prettier/index.d.ts +941 -0
  63. data/vendor/prettier/index.mjs +25899 -0
  64. data/vendor/prettier/internal/cli.mjs +4366 -0
  65. data/vendor/prettier/package.json +198 -0
  66. data/vendor/prettier/plugins/acorn.d.ts +6 -0
  67. data/vendor/prettier/plugins/acorn.js +6618 -0
  68. data/vendor/prettier/plugins/acorn.mjs +6456 -0
  69. data/vendor/prettier/plugins/angular.d.ts +8 -0
  70. data/vendor/prettier/plugins/angular.js +2435 -0
  71. data/vendor/prettier/plugins/angular.mjs +2375 -0
  72. data/vendor/prettier/plugins/babel.d.ts +18 -0
  73. data/vendor/prettier/plugins/babel.js +14271 -0
  74. data/vendor/prettier/plugins/babel.mjs +13986 -0
  75. data/vendor/prettier/plugins/estree.d.ts +1 -0
  76. data/vendor/prettier/plugins/estree.js +9487 -0
  77. data/vendor/prettier/plugins/estree.mjs +9279 -0
  78. data/vendor/prettier/plugins/flow.d.ts +5 -0
  79. data/vendor/prettier/plugins/flow.js +51477 -0
  80. data/vendor/prettier/plugins/flow.mjs +51219 -0
  81. data/vendor/prettier/plugins/glimmer.d.ts +5 -0
  82. data/vendor/prettier/plugins/glimmer.js +8534 -0
  83. data/vendor/prettier/plugins/glimmer.mjs +8421 -0
  84. data/vendor/prettier/plugins/graphql.d.ts +5 -0
  85. data/vendor/prettier/plugins/graphql.js +2421 -0
  86. data/vendor/prettier/plugins/graphql.mjs +2347 -0
  87. data/vendor/prettier/plugins/html.d.ts +8 -0
  88. data/vendor/prettier/plugins/html.js +8182 -0
  89. data/vendor/prettier/plugins/html.mjs +8077 -0
  90. data/vendor/prettier/plugins/markdown.d.ts +7 -0
  91. data/vendor/prettier/plugins/markdown.js +9068 -0
  92. data/vendor/prettier/plugins/markdown.mjs +8977 -0
  93. data/vendor/prettier/plugins/meriyah.d.ts +5 -0
  94. data/vendor/prettier/plugins/meriyah.js +5953 -0
  95. data/vendor/prettier/plugins/meriyah.mjs +5800 -0
  96. data/vendor/prettier/plugins/postcss.d.ts +7 -0
  97. data/vendor/prettier/plugins/postcss.js +9244 -0
  98. data/vendor/prettier/plugins/postcss.mjs +9046 -0
  99. data/vendor/prettier/plugins/typescript.d.ts +5 -0
  100. data/vendor/prettier/plugins/typescript.js +38058 -0
  101. data/vendor/prettier/plugins/typescript.mjs +37732 -0
  102. data/vendor/prettier/plugins/yaml.d.ts +5 -0
  103. data/vendor/prettier/plugins/yaml.js +7425 -0
  104. data/vendor/prettier/plugins/yaml.mjs +7329 -0
  105. data/vendor/prettier/standalone.d.ts +33 -0
  106. data/vendor/prettier/standalone.js +3984 -0
  107. data/vendor/prettier/standalone.mjs +3938 -0
  108. data/vendor/sql-formatter.js +18762 -0
  109. metadata +205 -2
@@ -0,0 +1,3984 @@
1
+ (function (t) {
2
+ function e() {
3
+ var o = t();
4
+ return o.default || o;
5
+ }
6
+ if (typeof exports == "object" && typeof module == "object")
7
+ module.exports = e();
8
+ else if (typeof define == "function" && define.amd) define(e);
9
+ else {
10
+ var f =
11
+ typeof globalThis < "u"
12
+ ? globalThis
13
+ : typeof global < "u"
14
+ ? global
15
+ : typeof self < "u"
16
+ ? self
17
+ : this || {};
18
+ f.prettier = e();
19
+ }
20
+ })(function () {
21
+ "use strict";
22
+ var yu = Object.create;
23
+ var He = Object.defineProperty;
24
+ var Au = Object.getOwnPropertyDescriptor;
25
+ var Bu = Object.getOwnPropertyNames;
26
+ var wu = Object.getPrototypeOf,
27
+ _u = Object.prototype.hasOwnProperty;
28
+ var or = (e) => {
29
+ throw TypeError(e);
30
+ };
31
+ var xu = (e, t) => () => (e && (t = e((e = 0))), t);
32
+ var At = (e, t) => () => (
33
+ t || e((t = { exports: {} }).exports, t), t.exports
34
+ ),
35
+ We = (e, t) => {
36
+ for (var r in t) He(e, r, { get: t[r], enumerable: !0 });
37
+ },
38
+ sr = (e, t, r, n) => {
39
+ if ((t && typeof t == "object") || typeof t == "function")
40
+ for (let i of Bu(t))
41
+ !_u.call(e, i) &&
42
+ i !== r &&
43
+ He(e, i, {
44
+ get: () => t[i],
45
+ enumerable: !(n = Au(t, i)) || n.enumerable,
46
+ });
47
+ return e;
48
+ };
49
+ var Me = (e, t, r) => (
50
+ (r = e != null ? yu(wu(e)) : {}),
51
+ sr(
52
+ t || !e || !e.__esModule
53
+ ? He(r, "default", { value: e, enumerable: !0 })
54
+ : r,
55
+ e,
56
+ )
57
+ ),
58
+ ar = (e) => sr(He({}, "__esModule", { value: !0 }), e);
59
+ var vu = (e, t, r) => t.has(e) || or("Cannot " + r);
60
+ var Dr = (e, t, r) =>
61
+ t.has(e)
62
+ ? or("Cannot add the same private member more than once")
63
+ : t instanceof WeakSet
64
+ ? t.add(e)
65
+ : t.set(e, r);
66
+ var pe = (e, t, r) => (vu(e, t, "access private method"), r);
67
+ var ot = At((oa, sn) => {
68
+ "use strict";
69
+ var on = new Proxy(String, { get: () => on });
70
+ sn.exports = on;
71
+ });
72
+ var Tn = {};
73
+ We(Tn, { default: () => wi, shouldHighlight: () => Bi });
74
+ var Bi,
75
+ wi,
76
+ kn = xu(() => {
77
+ (Bi = () => !1), (wi = String);
78
+ });
79
+ var Pn = At((bD, Xt) => {
80
+ var g = String,
81
+ Ln = function () {
82
+ return {
83
+ isColorSupported: !1,
84
+ reset: g,
85
+ bold: g,
86
+ dim: g,
87
+ italic: g,
88
+ underline: g,
89
+ inverse: g,
90
+ hidden: g,
91
+ strikethrough: g,
92
+ black: g,
93
+ red: g,
94
+ green: g,
95
+ yellow: g,
96
+ blue: g,
97
+ magenta: g,
98
+ cyan: g,
99
+ white: g,
100
+ gray: g,
101
+ bgBlack: g,
102
+ bgRed: g,
103
+ bgGreen: g,
104
+ bgYellow: g,
105
+ bgBlue: g,
106
+ bgMagenta: g,
107
+ bgCyan: g,
108
+ bgWhite: g,
109
+ };
110
+ };
111
+ Xt.exports = Ln();
112
+ Xt.exports.createColors = Ln;
113
+ });
114
+ var $n = At((Ct) => {
115
+ "use strict";
116
+ Object.defineProperty(Ct, "__esModule", { value: !0 });
117
+ Ct.codeFrameColumns = Mn;
118
+ Ct.default = Si;
119
+ var In = (kn(), ar(Tn)),
120
+ Hn = _i(Pn(), !0);
121
+ function Wn(e) {
122
+ if (typeof WeakMap != "function") return null;
123
+ var t = new WeakMap(),
124
+ r = new WeakMap();
125
+ return (Wn = function (n) {
126
+ return n ? r : t;
127
+ })(e);
128
+ }
129
+ function _i(e, t) {
130
+ if (!t && e && e.__esModule) return e;
131
+ if (e === null || (typeof e != "object" && typeof e != "function"))
132
+ return { default: e };
133
+ var r = Wn(t);
134
+ if (r && r.has(e)) return r.get(e);
135
+ var n = { __proto__: null },
136
+ i = Object.defineProperty && Object.getOwnPropertyDescriptor;
137
+ for (var u in e)
138
+ if (u !== "default" && {}.hasOwnProperty.call(e, u)) {
139
+ var o = i ? Object.getOwnPropertyDescriptor(e, u) : null;
140
+ o && (o.get || o.set)
141
+ ? Object.defineProperty(n, u, o)
142
+ : (n[u] = e[u]);
143
+ }
144
+ return (n.default = e), r && r.set(e, n), n;
145
+ }
146
+ var xi = Hn.default,
147
+ Rn = (e, t) => (r) => e(t(r)),
148
+ Zt;
149
+ function vi(e) {
150
+ if (e) {
151
+ var t;
152
+ return (t = Zt) != null || (Zt = (0, Hn.createColors)(!0)), Zt;
153
+ }
154
+ return xi;
155
+ }
156
+ var Yn = !1;
157
+ function bi(e) {
158
+ return {
159
+ gutter: e.gray,
160
+ marker: Rn(e.red, e.bold),
161
+ message: Rn(e.red, e.bold),
162
+ };
163
+ }
164
+ var jn = /\r\n|[\n\r\u2028\u2029]/;
165
+ function Oi(e, t, r) {
166
+ let n = Object.assign({ column: 0, line: -1 }, e.start),
167
+ i = Object.assign({}, n, e.end),
168
+ { linesAbove: u = 2, linesBelow: o = 3 } = r || {},
169
+ s = n.line,
170
+ a = n.column,
171
+ D = i.line,
172
+ l = i.column,
173
+ d = Math.max(s - (u + 1), 0),
174
+ f = Math.min(t.length, D + o);
175
+ s === -1 && (d = 0), D === -1 && (f = t.length);
176
+ let p = D - s,
177
+ c = {};
178
+ if (p)
179
+ for (let F = 0; F <= p; F++) {
180
+ let m = F + s;
181
+ if (!a) c[m] = !0;
182
+ else if (F === 0) {
183
+ let E = t[m - 1].length;
184
+ c[m] = [a, E - a + 1];
185
+ } else if (F === p) c[m] = [0, l];
186
+ else {
187
+ let E = t[m - F].length;
188
+ c[m] = [0, E];
189
+ }
190
+ }
191
+ else a === l ? (a ? (c[s] = [a, 0]) : (c[s] = !0)) : (c[s] = [a, l - a]);
192
+ return { start: d, end: f, markerLines: c };
193
+ }
194
+ function Mn(e, t, r = {}) {
195
+ let n = (r.highlightCode || r.forceColor) && (0, In.shouldHighlight)(r),
196
+ i = vi(r.forceColor),
197
+ u = bi(i),
198
+ o = (F, m) => (n ? F(m) : m),
199
+ s = e.split(jn),
200
+ { start: a, end: D, markerLines: l } = Oi(t, s, r),
201
+ d = t.start && typeof t.start.column == "number",
202
+ f = String(D).length,
203
+ c = (n ? (0, In.default)(e, r) : e)
204
+ .split(jn, D)
205
+ .slice(a, D)
206
+ .map((F, m) => {
207
+ let E = a + 1 + m,
208
+ w = ` ${` ${E}`.slice(-f)} |`,
209
+ h = l[E],
210
+ C = !l[E + 1];
211
+ if (h) {
212
+ let k = "";
213
+ if (Array.isArray(h)) {
214
+ let v = F.slice(0, Math.max(h[0] - 1, 0)).replace(
215
+ /[^\t]/g,
216
+ " ",
217
+ ),
218
+ $ = h[1] || 1;
219
+ (k = [
220
+ `
221
+ `,
222
+ o(u.gutter, w.replace(/\d/g, " ")),
223
+ " ",
224
+ v,
225
+ o(u.marker, "^").repeat($),
226
+ ].join("")),
227
+ C && r.message && (k += " " + o(u.message, r.message));
228
+ }
229
+ return [
230
+ o(u.marker, ">"),
231
+ o(u.gutter, w),
232
+ F.length > 0 ? ` ${F}` : "",
233
+ k,
234
+ ].join("");
235
+ } else return ` ${o(u.gutter, w)}${F.length > 0 ? ` ${F}` : ""}`;
236
+ }).join(`
237
+ `);
238
+ return (
239
+ r.message &&
240
+ !d &&
241
+ (c = `${" ".repeat(f + 1)}${r.message}
242
+ ${c}`),
243
+ n ? i.reset(c) : c
244
+ );
245
+ }
246
+ function Si(e, t, r, n = {}) {
247
+ if (!Yn) {
248
+ Yn = !0;
249
+ let u =
250
+ "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
251
+ {
252
+ let o = new Error(u);
253
+ (o.name = "DeprecationWarning"), console.warn(new Error(u));
254
+ }
255
+ }
256
+ return (r = Math.max(r, 0)), Mn(e, { start: { column: r, line: t } }, n);
257
+ }
258
+ });
259
+ var po = {};
260
+ We(po, {
261
+ __debug: () => fo,
262
+ check: () => lo,
263
+ doc: () => nr,
264
+ format: () => gu,
265
+ formatWithCursor: () => Cu,
266
+ getSupportInfo: () => co,
267
+ util: () => ir,
268
+ version: () => fu,
269
+ });
270
+ var bu = (e, t, r, n) => {
271
+ if (!(e && t == null))
272
+ return t.replaceAll
273
+ ? t.replaceAll(r, n)
274
+ : r.global
275
+ ? t.replace(r, n)
276
+ : t.split(r).join(n);
277
+ },
278
+ ne = bu;
279
+ function Z() {}
280
+ Z.prototype = {
281
+ diff: function (t, r) {
282
+ var n,
283
+ i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {},
284
+ u = i.callback;
285
+ typeof i == "function" && ((u = i), (i = {})), (this.options = i);
286
+ var o = this;
287
+ function s(h) {
288
+ return u
289
+ ? (setTimeout(function () {
290
+ u(void 0, h);
291
+ }, 0),
292
+ !0)
293
+ : h;
294
+ }
295
+ (t = this.castInput(t)),
296
+ (r = this.castInput(r)),
297
+ (t = this.removeEmpty(this.tokenize(t))),
298
+ (r = this.removeEmpty(this.tokenize(r)));
299
+ var a = r.length,
300
+ D = t.length,
301
+ l = 1,
302
+ d = a + D;
303
+ i.maxEditLength && (d = Math.min(d, i.maxEditLength));
304
+ var f = (n = i.timeout) !== null && n !== void 0 ? n : 1 / 0,
305
+ p = Date.now() + f,
306
+ c = [{ oldPos: -1, lastComponent: void 0 }],
307
+ F = this.extractCommon(c[0], r, t, 0);
308
+ if (c[0].oldPos + 1 >= D && F + 1 >= a)
309
+ return s([{ value: this.join(r), count: r.length }]);
310
+ var m = -1 / 0,
311
+ E = 1 / 0;
312
+ function A() {
313
+ for (var h = Math.max(m, -l); h <= Math.min(E, l); h += 2) {
314
+ var C = void 0,
315
+ k = c[h - 1],
316
+ v = c[h + 1];
317
+ k && (c[h - 1] = void 0);
318
+ var $ = !1;
319
+ if (v) {
320
+ var ye = v.oldPos - h;
321
+ $ = v && 0 <= ye && ye < a;
322
+ }
323
+ var yt = k && k.oldPos + 1 < D;
324
+ if (!$ && !yt) {
325
+ c[h] = void 0;
326
+ continue;
327
+ }
328
+ if (
329
+ (!yt || ($ && k.oldPos + 1 < v.oldPos)
330
+ ? (C = o.addToPath(v, !0, void 0, 0))
331
+ : (C = o.addToPath(k, void 0, !0, 1)),
332
+ (F = o.extractCommon(C, r, t, h)),
333
+ C.oldPos + 1 >= D && F + 1 >= a)
334
+ )
335
+ return s(Ou(o, C.lastComponent, r, t, o.useLongestToken));
336
+ (c[h] = C),
337
+ C.oldPos + 1 >= D && (E = Math.min(E, h - 1)),
338
+ F + 1 >= a && (m = Math.max(m, h + 1));
339
+ }
340
+ l++;
341
+ }
342
+ if (u)
343
+ (function h() {
344
+ setTimeout(function () {
345
+ if (l > d || Date.now() > p) return u();
346
+ A() || h();
347
+ }, 0);
348
+ })();
349
+ else
350
+ for (; l <= d && Date.now() <= p; ) {
351
+ var w = A();
352
+ if (w) return w;
353
+ }
354
+ },
355
+ addToPath: function (t, r, n, i) {
356
+ var u = t.lastComponent;
357
+ return u && u.added === r && u.removed === n
358
+ ? {
359
+ oldPos: t.oldPos + i,
360
+ lastComponent: {
361
+ count: u.count + 1,
362
+ added: r,
363
+ removed: n,
364
+ previousComponent: u.previousComponent,
365
+ },
366
+ }
367
+ : {
368
+ oldPos: t.oldPos + i,
369
+ lastComponent: {
370
+ count: 1,
371
+ added: r,
372
+ removed: n,
373
+ previousComponent: u,
374
+ },
375
+ };
376
+ },
377
+ extractCommon: function (t, r, n, i) {
378
+ for (
379
+ var u = r.length, o = n.length, s = t.oldPos, a = s - i, D = 0;
380
+ a + 1 < u && s + 1 < o && this.equals(r[a + 1], n[s + 1]);
381
+
382
+ )
383
+ a++, s++, D++;
384
+ return (
385
+ D &&
386
+ (t.lastComponent = { count: D, previousComponent: t.lastComponent }),
387
+ (t.oldPos = s),
388
+ a
389
+ );
390
+ },
391
+ equals: function (t, r) {
392
+ return this.options.comparator
393
+ ? this.options.comparator(t, r)
394
+ : t === r ||
395
+ (this.options.ignoreCase && t.toLowerCase() === r.toLowerCase());
396
+ },
397
+ removeEmpty: function (t) {
398
+ for (var r = [], n = 0; n < t.length; n++) t[n] && r.push(t[n]);
399
+ return r;
400
+ },
401
+ castInput: function (t) {
402
+ return t;
403
+ },
404
+ tokenize: function (t) {
405
+ return t.split("");
406
+ },
407
+ join: function (t) {
408
+ return t.join("");
409
+ },
410
+ };
411
+ function Ou(e, t, r, n, i) {
412
+ for (var u = [], o; t; )
413
+ u.push(t), (o = t.previousComponent), delete t.previousComponent, (t = o);
414
+ u.reverse();
415
+ for (var s = 0, a = u.length, D = 0, l = 0; s < a; s++) {
416
+ var d = u[s];
417
+ if (d.removed) {
418
+ if (
419
+ ((d.value = e.join(n.slice(l, l + d.count))),
420
+ (l += d.count),
421
+ s && u[s - 1].added)
422
+ ) {
423
+ var p = u[s - 1];
424
+ (u[s - 1] = u[s]), (u[s] = p);
425
+ }
426
+ } else {
427
+ if (!d.added && i) {
428
+ var f = r.slice(D, D + d.count);
429
+ (f = f.map(function (F, m) {
430
+ var E = n[l + m];
431
+ return E.length > F.length ? E : F;
432
+ })),
433
+ (d.value = e.join(f));
434
+ } else d.value = e.join(r.slice(D, D + d.count));
435
+ (D += d.count), d.added || (l += d.count);
436
+ }
437
+ }
438
+ var c = u[a - 1];
439
+ return (
440
+ a > 1 &&
441
+ typeof c.value == "string" &&
442
+ (c.added || c.removed) &&
443
+ e.equals("", c.value) &&
444
+ ((u[a - 2].value += c.value), u.pop()),
445
+ u
446
+ );
447
+ }
448
+ var ho = new Z();
449
+ var lr = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,
450
+ cr = /\S/,
451
+ fr = new Z();
452
+ fr.equals = function (e, t) {
453
+ return (
454
+ this.options.ignoreCase && ((e = e.toLowerCase()), (t = t.toLowerCase())),
455
+ e === t || (this.options.ignoreWhitespace && !cr.test(e) && !cr.test(t))
456
+ );
457
+ };
458
+ fr.tokenize = function (e) {
459
+ for (
460
+ var t = e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/), r = 0;
461
+ r < t.length - 1;
462
+ r++
463
+ )
464
+ !t[r + 1] &&
465
+ t[r + 2] &&
466
+ lr.test(t[r]) &&
467
+ lr.test(t[r + 2]) &&
468
+ ((t[r] += t[r + 2]), t.splice(r + 1, 2), r--);
469
+ return t;
470
+ };
471
+ var pr = new Z();
472
+ pr.tokenize = function (e) {
473
+ this.options.stripTrailingCr &&
474
+ (e = e.replace(
475
+ /\r\n/g,
476
+ `
477
+ `,
478
+ ));
479
+ var t = [],
480
+ r = e.split(/(\n|\r\n)/);
481
+ r[r.length - 1] || r.pop();
482
+ for (var n = 0; n < r.length; n++) {
483
+ var i = r[n];
484
+ n % 2 && !this.options.newlineIsToken
485
+ ? (t[t.length - 1] += i)
486
+ : (this.options.ignoreWhitespace && (i = i.trim()), t.push(i));
487
+ }
488
+ return t;
489
+ };
490
+ var Su = new Z();
491
+ Su.tokenize = function (e) {
492
+ return e.split(/(\S.+?[.!?])(?=\s+|$)/);
493
+ };
494
+ var Nu = new Z();
495
+ Nu.tokenize = function (e) {
496
+ return e.split(/([{}:;,]|\s+)/);
497
+ };
498
+ function $e(e) {
499
+ "@babel/helpers - typeof";
500
+ return (
501
+ typeof Symbol == "function" && typeof Symbol.iterator == "symbol"
502
+ ? ($e = function (t) {
503
+ return typeof t;
504
+ })
505
+ : ($e = function (t) {
506
+ return t &&
507
+ typeof Symbol == "function" &&
508
+ t.constructor === Symbol &&
509
+ t !== Symbol.prototype
510
+ ? "symbol"
511
+ : typeof t;
512
+ }),
513
+ $e(e)
514
+ );
515
+ }
516
+ var Tu = Object.prototype.toString,
517
+ Ae = new Z();
518
+ Ae.useLongestToken = !0;
519
+ Ae.tokenize = pr.tokenize;
520
+ Ae.castInput = function (e) {
521
+ var t = this.options,
522
+ r = t.undefinedReplacement,
523
+ n = t.stringifyReplacer,
524
+ i =
525
+ n === void 0
526
+ ? function (u, o) {
527
+ return typeof o > "u" ? r : o;
528
+ }
529
+ : n;
530
+ return typeof e == "string"
531
+ ? e
532
+ : JSON.stringify(Bt(e, null, null, i), i, " ");
533
+ };
534
+ Ae.equals = function (e, t) {
535
+ return Z.prototype.equals.call(
536
+ Ae,
537
+ e.replace(/,([\r\n])/g, "$1"),
538
+ t.replace(/,([\r\n])/g, "$1"),
539
+ );
540
+ };
541
+ function Bt(e, t, r, n, i) {
542
+ (t = t || []), (r = r || []), n && (e = n(i, e));
543
+ var u;
544
+ for (u = 0; u < t.length; u += 1) if (t[u] === e) return r[u];
545
+ var o;
546
+ if (Tu.call(e) === "[object Array]") {
547
+ for (
548
+ t.push(e), o = new Array(e.length), r.push(o), u = 0;
549
+ u < e.length;
550
+ u += 1
551
+ )
552
+ o[u] = Bt(e[u], t, r, n, i);
553
+ return t.pop(), r.pop(), o;
554
+ }
555
+ if ((e && e.toJSON && (e = e.toJSON()), $e(e) === "object" && e !== null)) {
556
+ t.push(e), (o = {}), r.push(o);
557
+ var s = [],
558
+ a;
559
+ for (a in e) e.hasOwnProperty(a) && s.push(a);
560
+ for (s.sort(), u = 0; u < s.length; u += 1)
561
+ (a = s[u]), (o[a] = Bt(e[a], t, r, n, a));
562
+ t.pop(), r.pop();
563
+ } else o = e;
564
+ return o;
565
+ }
566
+ var Ve = new Z();
567
+ Ve.tokenize = function (e) {
568
+ return e.slice();
569
+ };
570
+ Ve.join = Ve.removeEmpty = function (e) {
571
+ return e;
572
+ };
573
+ function dr(e, t, r) {
574
+ return Ve.diff(e, t, r);
575
+ }
576
+ function Fr(e) {
577
+ let t = e.indexOf("\r");
578
+ return t >= 0
579
+ ? e.charAt(t + 1) ===
580
+ `
581
+ `
582
+ ? "crlf"
583
+ : "cr"
584
+ : "lf";
585
+ }
586
+ function Be(e) {
587
+ switch (e) {
588
+ case "cr":
589
+ return "\r";
590
+ case "crlf":
591
+ return `\r
592
+ `;
593
+ default:
594
+ return `
595
+ `;
596
+ }
597
+ }
598
+ function wt(e, t) {
599
+ let r;
600
+ switch (t) {
601
+ case `
602
+ `:
603
+ r = /\n/gu;
604
+ break;
605
+ case "\r":
606
+ r = /\r/gu;
607
+ break;
608
+ case `\r
609
+ `:
610
+ r = /\r\n/gu;
611
+ break;
612
+ default:
613
+ throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`);
614
+ }
615
+ let n = e.match(r);
616
+ return n ? n.length : 0;
617
+ }
618
+ function mr(e) {
619
+ return ne(
620
+ !1,
621
+ e,
622
+ /\r\n?/gu,
623
+ `
624
+ `,
625
+ );
626
+ }
627
+ var U = "string",
628
+ W = "array",
629
+ z = "cursor",
630
+ L = "indent",
631
+ P = "align",
632
+ I = "trim",
633
+ _ = "group",
634
+ S = "fill",
635
+ x = "if-break",
636
+ R = "indent-if-break",
637
+ Y = "line-suffix",
638
+ j = "line-suffix-boundary",
639
+ B = "line",
640
+ N = "label",
641
+ b = "break-parent",
642
+ Ue = new Set([z, L, P, I, _, S, x, R, Y, j, B, N, b]);
643
+ function ku(e) {
644
+ if (typeof e == "string") return U;
645
+ if (Array.isArray(e)) return W;
646
+ if (!e) return;
647
+ let { type: t } = e;
648
+ if (Ue.has(t)) return t;
649
+ }
650
+ var G = ku;
651
+ var Lu = (e) =>
652
+ new Intl.ListFormat("en-US", { type: "disjunction" }).format(e);
653
+ function Pu(e) {
654
+ let t = e === null ? "null" : typeof e;
655
+ if (t !== "string" && t !== "object")
656
+ return `Unexpected doc '${t}',
657
+ Expected it to be 'string' or 'object'.`;
658
+ if (G(e)) throw new Error("doc is valid.");
659
+ let r = Object.prototype.toString.call(e);
660
+ if (r !== "[object Object]") return `Unexpected doc '${r}'.`;
661
+ let n = Lu([...Ue].map((i) => `'${i}'`));
662
+ return `Unexpected doc.type '${e.type}'.
663
+ Expected it to be ${n}.`;
664
+ }
665
+ var _t = class extends Error {
666
+ name = "InvalidDocError";
667
+ constructor(t) {
668
+ super(Pu(t)), (this.doc = t);
669
+ }
670
+ },
671
+ Q = _t;
672
+ var Er = {};
673
+ function Iu(e, t, r, n) {
674
+ let i = [e];
675
+ for (; i.length > 0; ) {
676
+ let u = i.pop();
677
+ if (u === Er) {
678
+ r(i.pop());
679
+ continue;
680
+ }
681
+ r && i.push(u, Er);
682
+ let o = G(u);
683
+ if (!o) throw new Q(u);
684
+ if ((t == null ? void 0 : t(u)) !== !1)
685
+ switch (o) {
686
+ case W:
687
+ case S: {
688
+ let s = o === W ? u : u.parts;
689
+ for (let a = s.length, D = a - 1; D >= 0; --D) i.push(s[D]);
690
+ break;
691
+ }
692
+ case x:
693
+ i.push(u.flatContents, u.breakContents);
694
+ break;
695
+ case _:
696
+ if (n && u.expandedStates)
697
+ for (let s = u.expandedStates.length, a = s - 1; a >= 0; --a)
698
+ i.push(u.expandedStates[a]);
699
+ else i.push(u.contents);
700
+ break;
701
+ case P:
702
+ case L:
703
+ case R:
704
+ case N:
705
+ case Y:
706
+ i.push(u.contents);
707
+ break;
708
+ case U:
709
+ case z:
710
+ case I:
711
+ case j:
712
+ case B:
713
+ case b:
714
+ break;
715
+ default:
716
+ throw new Q(u);
717
+ }
718
+ }
719
+ }
720
+ var we = Iu;
721
+ var hr = () => {},
722
+ K = hr,
723
+ ze = hr;
724
+ function De(e) {
725
+ return K(e), { type: L, contents: e };
726
+ }
727
+ function ae(e, t) {
728
+ return K(t), { type: P, contents: t, n: e };
729
+ }
730
+ function xt(e, t = {}) {
731
+ return (
732
+ K(e),
733
+ ze(t.expandedStates, !0),
734
+ {
735
+ type: _,
736
+ id: t.id,
737
+ contents: e,
738
+ break: !!t.shouldBreak,
739
+ expandedStates: t.expandedStates,
740
+ }
741
+ );
742
+ }
743
+ function Cr(e) {
744
+ return ae(Number.NEGATIVE_INFINITY, e);
745
+ }
746
+ function gr(e) {
747
+ return ae({ type: "root" }, e);
748
+ }
749
+ function yr(e) {
750
+ return ae(-1, e);
751
+ }
752
+ function Ar(e, t) {
753
+ return xt(e[0], { ...t, expandedStates: e });
754
+ }
755
+ function Ge(e) {
756
+ return ze(e), { type: S, parts: e };
757
+ }
758
+ function Br(e, t = "", r = {}) {
759
+ return (
760
+ K(e),
761
+ t !== "" && K(t),
762
+ { type: x, breakContents: e, flatContents: t, groupId: r.groupId }
763
+ );
764
+ }
765
+ function wr(e, t) {
766
+ return K(e), { type: R, contents: e, groupId: t.groupId, negate: t.negate };
767
+ }
768
+ function _e(e) {
769
+ return K(e), { type: Y, contents: e };
770
+ }
771
+ var _r = { type: j },
772
+ de = { type: b },
773
+ xr = { type: I },
774
+ xe = { type: B, hard: !0 },
775
+ vt = { type: B, hard: !0, literal: !0 },
776
+ Ke = { type: B },
777
+ vr = { type: B, soft: !0 },
778
+ q = [xe, de],
779
+ qe = [vt, de],
780
+ ve = { type: z };
781
+ function be(e, t) {
782
+ K(e), ze(t);
783
+ let r = [];
784
+ for (let n = 0; n < t.length; n++) n !== 0 && r.push(e), r.push(t[n]);
785
+ return r;
786
+ }
787
+ function Je(e, t, r) {
788
+ K(e);
789
+ let n = e;
790
+ if (t > 0) {
791
+ for (let i = 0; i < Math.floor(t / r); ++i) n = De(n);
792
+ (n = ae(t % r, n)), (n = ae(Number.NEGATIVE_INFINITY, n));
793
+ }
794
+ return n;
795
+ }
796
+ function br(e, t) {
797
+ return K(t), e ? { type: N, label: e, contents: t } : t;
798
+ }
799
+ function ee(e) {
800
+ var t;
801
+ if (!e) return "";
802
+ if (Array.isArray(e)) {
803
+ let r = [];
804
+ for (let n of e)
805
+ if (Array.isArray(n)) r.push(...ee(n));
806
+ else {
807
+ let i = ee(n);
808
+ i !== "" && r.push(i);
809
+ }
810
+ return r;
811
+ }
812
+ return e.type === x
813
+ ? {
814
+ ...e,
815
+ breakContents: ee(e.breakContents),
816
+ flatContents: ee(e.flatContents),
817
+ }
818
+ : e.type === _
819
+ ? {
820
+ ...e,
821
+ contents: ee(e.contents),
822
+ expandedStates: (t = e.expandedStates) == null ? void 0 : t.map(ee),
823
+ }
824
+ : e.type === S
825
+ ? { type: "fill", parts: e.parts.map(ee) }
826
+ : e.contents
827
+ ? { ...e, contents: ee(e.contents) }
828
+ : e;
829
+ }
830
+ function Or(e) {
831
+ let t = Object.create(null),
832
+ r = new Set();
833
+ return n(ee(e));
834
+ function n(u, o, s) {
835
+ var a, D;
836
+ if (typeof u == "string") return JSON.stringify(u);
837
+ if (Array.isArray(u)) {
838
+ let l = u.map(n).filter(Boolean);
839
+ return l.length === 1 ? l[0] : `[${l.join(", ")}]`;
840
+ }
841
+ if (u.type === B) {
842
+ let l =
843
+ ((a = s == null ? void 0 : s[o + 1]) == null ? void 0 : a.type) === b;
844
+ return u.literal
845
+ ? l
846
+ ? "literalline"
847
+ : "literallineWithoutBreakParent"
848
+ : u.hard
849
+ ? l
850
+ ? "hardline"
851
+ : "hardlineWithoutBreakParent"
852
+ : u.soft
853
+ ? "softline"
854
+ : "line";
855
+ }
856
+ if (u.type === b)
857
+ return ((D = s == null ? void 0 : s[o - 1]) == null
858
+ ? void 0
859
+ : D.type) === B && s[o - 1].hard
860
+ ? void 0
861
+ : "breakParent";
862
+ if (u.type === I) return "trim";
863
+ if (u.type === L) return "indent(" + n(u.contents) + ")";
864
+ if (u.type === P)
865
+ return u.n === Number.NEGATIVE_INFINITY
866
+ ? "dedentToRoot(" + n(u.contents) + ")"
867
+ : u.n < 0
868
+ ? "dedent(" + n(u.contents) + ")"
869
+ : u.n.type === "root"
870
+ ? "markAsRoot(" + n(u.contents) + ")"
871
+ : "align(" + JSON.stringify(u.n) + ", " + n(u.contents) + ")";
872
+ if (u.type === x)
873
+ return (
874
+ "ifBreak(" +
875
+ n(u.breakContents) +
876
+ (u.flatContents ? ", " + n(u.flatContents) : "") +
877
+ (u.groupId
878
+ ? (u.flatContents ? "" : ', ""') + `, { groupId: ${i(u.groupId)} }`
879
+ : "") +
880
+ ")"
881
+ );
882
+ if (u.type === R) {
883
+ let l = [];
884
+ u.negate && l.push("negate: true"),
885
+ u.groupId && l.push(`groupId: ${i(u.groupId)}`);
886
+ let d = l.length > 0 ? `, { ${l.join(", ")} }` : "";
887
+ return `indentIfBreak(${n(u.contents)}${d})`;
888
+ }
889
+ if (u.type === _) {
890
+ let l = [];
891
+ u.break && u.break !== "propagated" && l.push("shouldBreak: true"),
892
+ u.id && l.push(`id: ${i(u.id)}`);
893
+ let d = l.length > 0 ? `, { ${l.join(", ")} }` : "";
894
+ return u.expandedStates
895
+ ? `conditionalGroup([${u.expandedStates.map((f) => n(f)).join(",")}]${d})`
896
+ : `group(${n(u.contents)}${d})`;
897
+ }
898
+ if (u.type === S) return `fill([${u.parts.map((l) => n(l)).join(", ")}])`;
899
+ if (u.type === Y) return "lineSuffix(" + n(u.contents) + ")";
900
+ if (u.type === j) return "lineSuffixBoundary";
901
+ if (u.type === N)
902
+ return `label(${JSON.stringify(u.label)}, ${n(u.contents)})`;
903
+ throw new Error("Unknown doc type " + u.type);
904
+ }
905
+ function i(u) {
906
+ if (typeof u != "symbol") return JSON.stringify(String(u));
907
+ if (u in t) return t[u];
908
+ let o = u.description || "symbol";
909
+ for (let s = 0; ; s++) {
910
+ let a = o + (s > 0 ? ` #${s}` : "");
911
+ if (!r.has(a))
912
+ return r.add(a), (t[u] = `Symbol.for(${JSON.stringify(a)})`);
913
+ }
914
+ }
915
+ }
916
+ var Ru = (e, t, r) => {
917
+ if (!(e && t == null))
918
+ return Array.isArray(t) || typeof t == "string"
919
+ ? t[r < 0 ? t.length + r : r]
920
+ : t.at(r);
921
+ },
922
+ y = Ru;
923
+ var Sr = () =>
924
+ /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
925
+ function Nr(e) {
926
+ return (
927
+ e === 12288 || (e >= 65281 && e <= 65376) || (e >= 65504 && e <= 65510)
928
+ );
929
+ }
930
+ function Tr(e) {
931
+ return (
932
+ (e >= 4352 && e <= 4447) ||
933
+ e === 8986 ||
934
+ e === 8987 ||
935
+ e === 9001 ||
936
+ e === 9002 ||
937
+ (e >= 9193 && e <= 9196) ||
938
+ e === 9200 ||
939
+ e === 9203 ||
940
+ e === 9725 ||
941
+ e === 9726 ||
942
+ e === 9748 ||
943
+ e === 9749 ||
944
+ (e >= 9800 && e <= 9811) ||
945
+ e === 9855 ||
946
+ e === 9875 ||
947
+ e === 9889 ||
948
+ e === 9898 ||
949
+ e === 9899 ||
950
+ e === 9917 ||
951
+ e === 9918 ||
952
+ e === 9924 ||
953
+ e === 9925 ||
954
+ e === 9934 ||
955
+ e === 9940 ||
956
+ e === 9962 ||
957
+ e === 9970 ||
958
+ e === 9971 ||
959
+ e === 9973 ||
960
+ e === 9978 ||
961
+ e === 9981 ||
962
+ e === 9989 ||
963
+ e === 9994 ||
964
+ e === 9995 ||
965
+ e === 10024 ||
966
+ e === 10060 ||
967
+ e === 10062 ||
968
+ (e >= 10067 && e <= 10069) ||
969
+ e === 10071 ||
970
+ (e >= 10133 && e <= 10135) ||
971
+ e === 10160 ||
972
+ e === 10175 ||
973
+ e === 11035 ||
974
+ e === 11036 ||
975
+ e === 11088 ||
976
+ e === 11093 ||
977
+ (e >= 11904 && e <= 11929) ||
978
+ (e >= 11931 && e <= 12019) ||
979
+ (e >= 12032 && e <= 12245) ||
980
+ (e >= 12272 && e <= 12287) ||
981
+ (e >= 12289 && e <= 12350) ||
982
+ (e >= 12353 && e <= 12438) ||
983
+ (e >= 12441 && e <= 12543) ||
984
+ (e >= 12549 && e <= 12591) ||
985
+ (e >= 12593 && e <= 12686) ||
986
+ (e >= 12688 && e <= 12771) ||
987
+ (e >= 12783 && e <= 12830) ||
988
+ (e >= 12832 && e <= 12871) ||
989
+ (e >= 12880 && e <= 19903) ||
990
+ (e >= 19968 && e <= 42124) ||
991
+ (e >= 42128 && e <= 42182) ||
992
+ (e >= 43360 && e <= 43388) ||
993
+ (e >= 44032 && e <= 55203) ||
994
+ (e >= 63744 && e <= 64255) ||
995
+ (e >= 65040 && e <= 65049) ||
996
+ (e >= 65072 && e <= 65106) ||
997
+ (e >= 65108 && e <= 65126) ||
998
+ (e >= 65128 && e <= 65131) ||
999
+ (e >= 94176 && e <= 94180) ||
1000
+ e === 94192 ||
1001
+ e === 94193 ||
1002
+ (e >= 94208 && e <= 100343) ||
1003
+ (e >= 100352 && e <= 101589) ||
1004
+ (e >= 101632 && e <= 101640) ||
1005
+ (e >= 110576 && e <= 110579) ||
1006
+ (e >= 110581 && e <= 110587) ||
1007
+ e === 110589 ||
1008
+ e === 110590 ||
1009
+ (e >= 110592 && e <= 110882) ||
1010
+ e === 110898 ||
1011
+ (e >= 110928 && e <= 110930) ||
1012
+ e === 110933 ||
1013
+ (e >= 110948 && e <= 110951) ||
1014
+ (e >= 110960 && e <= 111355) ||
1015
+ e === 126980 ||
1016
+ e === 127183 ||
1017
+ e === 127374 ||
1018
+ (e >= 127377 && e <= 127386) ||
1019
+ (e >= 127488 && e <= 127490) ||
1020
+ (e >= 127504 && e <= 127547) ||
1021
+ (e >= 127552 && e <= 127560) ||
1022
+ e === 127568 ||
1023
+ e === 127569 ||
1024
+ (e >= 127584 && e <= 127589) ||
1025
+ (e >= 127744 && e <= 127776) ||
1026
+ (e >= 127789 && e <= 127797) ||
1027
+ (e >= 127799 && e <= 127868) ||
1028
+ (e >= 127870 && e <= 127891) ||
1029
+ (e >= 127904 && e <= 127946) ||
1030
+ (e >= 127951 && e <= 127955) ||
1031
+ (e >= 127968 && e <= 127984) ||
1032
+ e === 127988 ||
1033
+ (e >= 127992 && e <= 128062) ||
1034
+ e === 128064 ||
1035
+ (e >= 128066 && e <= 128252) ||
1036
+ (e >= 128255 && e <= 128317) ||
1037
+ (e >= 128331 && e <= 128334) ||
1038
+ (e >= 128336 && e <= 128359) ||
1039
+ e === 128378 ||
1040
+ e === 128405 ||
1041
+ e === 128406 ||
1042
+ e === 128420 ||
1043
+ (e >= 128507 && e <= 128591) ||
1044
+ (e >= 128640 && e <= 128709) ||
1045
+ e === 128716 ||
1046
+ (e >= 128720 && e <= 128722) ||
1047
+ (e >= 128725 && e <= 128727) ||
1048
+ (e >= 128732 && e <= 128735) ||
1049
+ e === 128747 ||
1050
+ e === 128748 ||
1051
+ (e >= 128756 && e <= 128764) ||
1052
+ (e >= 128992 && e <= 129003) ||
1053
+ e === 129008 ||
1054
+ (e >= 129292 && e <= 129338) ||
1055
+ (e >= 129340 && e <= 129349) ||
1056
+ (e >= 129351 && e <= 129535) ||
1057
+ (e >= 129648 && e <= 129660) ||
1058
+ (e >= 129664 && e <= 129672) ||
1059
+ (e >= 129680 && e <= 129725) ||
1060
+ (e >= 129727 && e <= 129733) ||
1061
+ (e >= 129742 && e <= 129755) ||
1062
+ (e >= 129760 && e <= 129768) ||
1063
+ (e >= 129776 && e <= 129784) ||
1064
+ (e >= 131072 && e <= 196605) ||
1065
+ (e >= 196608 && e <= 262141)
1066
+ );
1067
+ }
1068
+ var kr = (e) => !(Nr(e) || Tr(e));
1069
+ var Yu = /[^\x20-\x7F]/u;
1070
+ function ju(e) {
1071
+ if (!e) return 0;
1072
+ if (!Yu.test(e)) return e.length;
1073
+ e = e.replace(Sr(), " ");
1074
+ let t = 0;
1075
+ for (let r of e) {
1076
+ let n = r.codePointAt(0);
1077
+ n <= 31 ||
1078
+ (n >= 127 && n <= 159) ||
1079
+ (n >= 768 && n <= 879) ||
1080
+ (t += kr(n) ? 1 : 2);
1081
+ }
1082
+ return t;
1083
+ }
1084
+ var Oe = ju;
1085
+ function Ne(e, t) {
1086
+ if (typeof e == "string") return t(e);
1087
+ let r = new Map();
1088
+ return n(e);
1089
+ function n(u) {
1090
+ if (r.has(u)) return r.get(u);
1091
+ let o = i(u);
1092
+ return r.set(u, o), o;
1093
+ }
1094
+ function i(u) {
1095
+ switch (G(u)) {
1096
+ case W:
1097
+ return t(u.map(n));
1098
+ case S:
1099
+ return t({ ...u, parts: u.parts.map(n) });
1100
+ case x:
1101
+ return t({
1102
+ ...u,
1103
+ breakContents: n(u.breakContents),
1104
+ flatContents: n(u.flatContents),
1105
+ });
1106
+ case _: {
1107
+ let { expandedStates: o, contents: s } = u;
1108
+ return (
1109
+ o ? ((o = o.map(n)), (s = o[0])) : (s = n(s)),
1110
+ t({ ...u, contents: s, expandedStates: o })
1111
+ );
1112
+ }
1113
+ case P:
1114
+ case L:
1115
+ case R:
1116
+ case N:
1117
+ case Y:
1118
+ return t({ ...u, contents: n(u.contents) });
1119
+ case U:
1120
+ case z:
1121
+ case I:
1122
+ case j:
1123
+ case B:
1124
+ case b:
1125
+ return t(u);
1126
+ default:
1127
+ throw new Q(u);
1128
+ }
1129
+ }
1130
+ }
1131
+ function Xe(e, t, r) {
1132
+ let n = r,
1133
+ i = !1;
1134
+ function u(o) {
1135
+ if (i) return !1;
1136
+ let s = t(o);
1137
+ s !== void 0 && ((i = !0), (n = s));
1138
+ }
1139
+ return we(e, u), n;
1140
+ }
1141
+ function Hu(e) {
1142
+ if ((e.type === _ && e.break) || (e.type === B && e.hard) || e.type === b)
1143
+ return !0;
1144
+ }
1145
+ function Ir(e) {
1146
+ return Xe(e, Hu, !1);
1147
+ }
1148
+ function Lr(e) {
1149
+ if (e.length > 0) {
1150
+ let t = y(!1, e, -1);
1151
+ !t.expandedStates && !t.break && (t.break = "propagated");
1152
+ }
1153
+ return null;
1154
+ }
1155
+ function Rr(e) {
1156
+ let t = new Set(),
1157
+ r = [];
1158
+ function n(u) {
1159
+ if ((u.type === b && Lr(r), u.type === _)) {
1160
+ if ((r.push(u), t.has(u))) return !1;
1161
+ t.add(u);
1162
+ }
1163
+ }
1164
+ function i(u) {
1165
+ u.type === _ && r.pop().break && Lr(r);
1166
+ }
1167
+ we(e, n, i, !0);
1168
+ }
1169
+ function Wu(e) {
1170
+ return e.type === B && !e.hard
1171
+ ? e.soft
1172
+ ? ""
1173
+ : " "
1174
+ : e.type === x
1175
+ ? e.flatContents
1176
+ : e;
1177
+ }
1178
+ function Yr(e) {
1179
+ return Ne(e, Wu);
1180
+ }
1181
+ function Pr(e) {
1182
+ for (
1183
+ e = [...e];
1184
+ e.length >= 2 && y(!1, e, -2).type === B && y(!1, e, -1).type === b;
1185
+
1186
+ )
1187
+ e.length -= 2;
1188
+ if (e.length > 0) {
1189
+ let t = Se(y(!1, e, -1));
1190
+ e[e.length - 1] = t;
1191
+ }
1192
+ return e;
1193
+ }
1194
+ function Se(e) {
1195
+ switch (G(e)) {
1196
+ case L:
1197
+ case R:
1198
+ case _:
1199
+ case Y:
1200
+ case N: {
1201
+ let t = Se(e.contents);
1202
+ return { ...e, contents: t };
1203
+ }
1204
+ case x:
1205
+ return {
1206
+ ...e,
1207
+ breakContents: Se(e.breakContents),
1208
+ flatContents: Se(e.flatContents),
1209
+ };
1210
+ case S:
1211
+ return { ...e, parts: Pr(e.parts) };
1212
+ case W:
1213
+ return Pr(e);
1214
+ case U:
1215
+ return e.replace(/[\n\r]*$/u, "");
1216
+ case P:
1217
+ case z:
1218
+ case I:
1219
+ case j:
1220
+ case B:
1221
+ case b:
1222
+ break;
1223
+ default:
1224
+ throw new Q(e);
1225
+ }
1226
+ return e;
1227
+ }
1228
+ function Ze(e) {
1229
+ return Se($u(e));
1230
+ }
1231
+ function Mu(e) {
1232
+ switch (G(e)) {
1233
+ case S:
1234
+ if (e.parts.every((t) => t === "")) return "";
1235
+ break;
1236
+ case _:
1237
+ if (!e.contents && !e.id && !e.break && !e.expandedStates) return "";
1238
+ if (
1239
+ e.contents.type === _ &&
1240
+ e.contents.id === e.id &&
1241
+ e.contents.break === e.break &&
1242
+ e.contents.expandedStates === e.expandedStates
1243
+ )
1244
+ return e.contents;
1245
+ break;
1246
+ case P:
1247
+ case L:
1248
+ case R:
1249
+ case Y:
1250
+ if (!e.contents) return "";
1251
+ break;
1252
+ case x:
1253
+ if (!e.flatContents && !e.breakContents) return "";
1254
+ break;
1255
+ case W: {
1256
+ let t = [];
1257
+ for (let r of e) {
1258
+ if (!r) continue;
1259
+ let [n, ...i] = Array.isArray(r) ? r : [r];
1260
+ typeof n == "string" && typeof y(!1, t, -1) == "string"
1261
+ ? (t[t.length - 1] += n)
1262
+ : t.push(n),
1263
+ t.push(...i);
1264
+ }
1265
+ return t.length === 0 ? "" : t.length === 1 ? t[0] : t;
1266
+ }
1267
+ case U:
1268
+ case z:
1269
+ case I:
1270
+ case j:
1271
+ case B:
1272
+ case N:
1273
+ case b:
1274
+ break;
1275
+ default:
1276
+ throw new Q(e);
1277
+ }
1278
+ return e;
1279
+ }
1280
+ function $u(e) {
1281
+ return Ne(e, (t) => Mu(t));
1282
+ }
1283
+ function jr(e, t = qe) {
1284
+ return Ne(e, (r) =>
1285
+ typeof r == "string"
1286
+ ? be(
1287
+ t,
1288
+ r.split(`
1289
+ `),
1290
+ )
1291
+ : r,
1292
+ );
1293
+ }
1294
+ function Vu(e) {
1295
+ if (e.type === B) return !0;
1296
+ }
1297
+ function Hr(e) {
1298
+ return Xe(e, Vu, !1);
1299
+ }
1300
+ function Qe(e, t) {
1301
+ return e.type === N ? { ...e, contents: t(e.contents) } : t(e);
1302
+ }
1303
+ var H = Symbol("MODE_BREAK"),
1304
+ J = Symbol("MODE_FLAT"),
1305
+ Te = Symbol("cursor");
1306
+ function Wr() {
1307
+ return { value: "", length: 0, queue: [] };
1308
+ }
1309
+ function Uu(e, t) {
1310
+ return bt(e, { type: "indent" }, t);
1311
+ }
1312
+ function zu(e, t, r) {
1313
+ return t === Number.NEGATIVE_INFINITY
1314
+ ? e.root || Wr()
1315
+ : t < 0
1316
+ ? bt(e, { type: "dedent" }, r)
1317
+ : t
1318
+ ? t.type === "root"
1319
+ ? { ...e, root: e }
1320
+ : bt(
1321
+ e,
1322
+ {
1323
+ type: typeof t == "string" ? "stringAlign" : "numberAlign",
1324
+ n: t,
1325
+ },
1326
+ r,
1327
+ )
1328
+ : e;
1329
+ }
1330
+ function bt(e, t, r) {
1331
+ let n = t.type === "dedent" ? e.queue.slice(0, -1) : [...e.queue, t],
1332
+ i = "",
1333
+ u = 0,
1334
+ o = 0,
1335
+ s = 0;
1336
+ for (let c of n)
1337
+ switch (c.type) {
1338
+ case "indent":
1339
+ l(), r.useTabs ? a(1) : D(r.tabWidth);
1340
+ break;
1341
+ case "stringAlign":
1342
+ l(), (i += c.n), (u += c.n.length);
1343
+ break;
1344
+ case "numberAlign":
1345
+ (o += 1), (s += c.n);
1346
+ break;
1347
+ default:
1348
+ throw new Error(`Unexpected type '${c.type}'`);
1349
+ }
1350
+ return f(), { ...e, value: i, length: u, queue: n };
1351
+ function a(c) {
1352
+ (i += " ".repeat(c)), (u += r.tabWidth * c);
1353
+ }
1354
+ function D(c) {
1355
+ (i += " ".repeat(c)), (u += c);
1356
+ }
1357
+ function l() {
1358
+ r.useTabs ? d() : f();
1359
+ }
1360
+ function d() {
1361
+ o > 0 && a(o), p();
1362
+ }
1363
+ function f() {
1364
+ s > 0 && D(s), p();
1365
+ }
1366
+ function p() {
1367
+ (o = 0), (s = 0);
1368
+ }
1369
+ }
1370
+ function Ot(e) {
1371
+ let t = 0,
1372
+ r = 0,
1373
+ n = e.length;
1374
+ e: for (; n--; ) {
1375
+ let i = e[n];
1376
+ if (i === Te) {
1377
+ r++;
1378
+ continue;
1379
+ }
1380
+ for (let u = i.length - 1; u >= 0; u--) {
1381
+ let o = i[u];
1382
+ if (o === " " || o === " ") t++;
1383
+ else {
1384
+ e[n] = i.slice(0, u + 1);
1385
+ break e;
1386
+ }
1387
+ }
1388
+ }
1389
+ if (t > 0 || r > 0) for (e.length = n + 1; r-- > 0; ) e.push(Te);
1390
+ return t;
1391
+ }
1392
+ function et(e, t, r, n, i, u) {
1393
+ if (r === Number.POSITIVE_INFINITY) return !0;
1394
+ let o = t.length,
1395
+ s = [e],
1396
+ a = [];
1397
+ for (; r >= 0; ) {
1398
+ if (s.length === 0) {
1399
+ if (o === 0) return !0;
1400
+ s.push(t[--o]);
1401
+ continue;
1402
+ }
1403
+ let { mode: D, doc: l } = s.pop(),
1404
+ d = G(l);
1405
+ switch (d) {
1406
+ case U:
1407
+ a.push(l), (r -= Oe(l));
1408
+ break;
1409
+ case W:
1410
+ case S: {
1411
+ let f = d === W ? l : l.parts;
1412
+ for (let p = f.length - 1; p >= 0; p--)
1413
+ s.push({ mode: D, doc: f[p] });
1414
+ break;
1415
+ }
1416
+ case L:
1417
+ case P:
1418
+ case R:
1419
+ case N:
1420
+ s.push({ mode: D, doc: l.contents });
1421
+ break;
1422
+ case I:
1423
+ r += Ot(a);
1424
+ break;
1425
+ case _: {
1426
+ if (u && l.break) return !1;
1427
+ let f = l.break ? H : D,
1428
+ p =
1429
+ l.expandedStates && f === H
1430
+ ? y(!1, l.expandedStates, -1)
1431
+ : l.contents;
1432
+ s.push({ mode: f, doc: p });
1433
+ break;
1434
+ }
1435
+ case x: {
1436
+ let p =
1437
+ (l.groupId ? i[l.groupId] || J : D) === H
1438
+ ? l.breakContents
1439
+ : l.flatContents;
1440
+ p && s.push({ mode: D, doc: p });
1441
+ break;
1442
+ }
1443
+ case B:
1444
+ if (D === H || l.hard) return !0;
1445
+ l.soft || (a.push(" "), r--);
1446
+ break;
1447
+ case Y:
1448
+ n = !0;
1449
+ break;
1450
+ case j:
1451
+ if (n) return !1;
1452
+ break;
1453
+ }
1454
+ }
1455
+ return !1;
1456
+ }
1457
+ function Fe(e, t) {
1458
+ let r = {},
1459
+ n = t.printWidth,
1460
+ i = Be(t.endOfLine),
1461
+ u = 0,
1462
+ o = [{ ind: Wr(), mode: H, doc: e }],
1463
+ s = [],
1464
+ a = !1,
1465
+ D = [],
1466
+ l = 0;
1467
+ for (Rr(e); o.length > 0; ) {
1468
+ let { ind: f, mode: p, doc: c } = o.pop();
1469
+ switch (G(c)) {
1470
+ case U: {
1471
+ let F =
1472
+ i !==
1473
+ `
1474
+ `
1475
+ ? ne(
1476
+ !1,
1477
+ c,
1478
+ `
1479
+ `,
1480
+ i,
1481
+ )
1482
+ : c;
1483
+ s.push(F), o.length > 0 && (u += Oe(F));
1484
+ break;
1485
+ }
1486
+ case W:
1487
+ for (let F = c.length - 1; F >= 0; F--)
1488
+ o.push({ ind: f, mode: p, doc: c[F] });
1489
+ break;
1490
+ case z:
1491
+ if (l >= 2) throw new Error("There are too many 'cursor' in doc.");
1492
+ s.push(Te), l++;
1493
+ break;
1494
+ case L:
1495
+ o.push({ ind: Uu(f, t), mode: p, doc: c.contents });
1496
+ break;
1497
+ case P:
1498
+ o.push({ ind: zu(f, c.n, t), mode: p, doc: c.contents });
1499
+ break;
1500
+ case I:
1501
+ u -= Ot(s);
1502
+ break;
1503
+ case _:
1504
+ switch (p) {
1505
+ case J:
1506
+ if (!a) {
1507
+ o.push({ ind: f, mode: c.break ? H : J, doc: c.contents });
1508
+ break;
1509
+ }
1510
+ case H: {
1511
+ a = !1;
1512
+ let F = { ind: f, mode: J, doc: c.contents },
1513
+ m = n - u,
1514
+ E = D.length > 0;
1515
+ if (!c.break && et(F, o, m, E, r)) o.push(F);
1516
+ else if (c.expandedStates) {
1517
+ let A = y(!1, c.expandedStates, -1);
1518
+ if (c.break) {
1519
+ o.push({ ind: f, mode: H, doc: A });
1520
+ break;
1521
+ } else
1522
+ for (let w = 1; w < c.expandedStates.length + 1; w++)
1523
+ if (w >= c.expandedStates.length) {
1524
+ o.push({ ind: f, mode: H, doc: A });
1525
+ break;
1526
+ } else {
1527
+ let h = c.expandedStates[w],
1528
+ C = { ind: f, mode: J, doc: h };
1529
+ if (et(C, o, m, E, r)) {
1530
+ o.push(C);
1531
+ break;
1532
+ }
1533
+ }
1534
+ } else o.push({ ind: f, mode: H, doc: c.contents });
1535
+ break;
1536
+ }
1537
+ }
1538
+ c.id && (r[c.id] = y(!1, o, -1).mode);
1539
+ break;
1540
+ case S: {
1541
+ let F = n - u,
1542
+ { parts: m } = c;
1543
+ if (m.length === 0) break;
1544
+ let [E, A] = m,
1545
+ w = { ind: f, mode: J, doc: E },
1546
+ h = { ind: f, mode: H, doc: E },
1547
+ C = et(w, [], F, D.length > 0, r, !0);
1548
+ if (m.length === 1) {
1549
+ C ? o.push(w) : o.push(h);
1550
+ break;
1551
+ }
1552
+ let k = { ind: f, mode: J, doc: A },
1553
+ v = { ind: f, mode: H, doc: A };
1554
+ if (m.length === 2) {
1555
+ C ? o.push(k, w) : o.push(v, h);
1556
+ break;
1557
+ }
1558
+ m.splice(0, 2);
1559
+ let $ = { ind: f, mode: p, doc: Ge(m) },
1560
+ ye = m[0];
1561
+ et({ ind: f, mode: J, doc: [E, A, ye] }, [], F, D.length > 0, r, !0)
1562
+ ? o.push($, k, w)
1563
+ : C
1564
+ ? o.push($, v, w)
1565
+ : o.push($, v, h);
1566
+ break;
1567
+ }
1568
+ case x:
1569
+ case R: {
1570
+ let F = c.groupId ? r[c.groupId] : p;
1571
+ if (F === H) {
1572
+ let m =
1573
+ c.type === x
1574
+ ? c.breakContents
1575
+ : c.negate
1576
+ ? c.contents
1577
+ : De(c.contents);
1578
+ m && o.push({ ind: f, mode: p, doc: m });
1579
+ }
1580
+ if (F === J) {
1581
+ let m =
1582
+ c.type === x
1583
+ ? c.flatContents
1584
+ : c.negate
1585
+ ? De(c.contents)
1586
+ : c.contents;
1587
+ m && o.push({ ind: f, mode: p, doc: m });
1588
+ }
1589
+ break;
1590
+ }
1591
+ case Y:
1592
+ D.push({ ind: f, mode: p, doc: c.contents });
1593
+ break;
1594
+ case j:
1595
+ D.length > 0 && o.push({ ind: f, mode: p, doc: xe });
1596
+ break;
1597
+ case B:
1598
+ switch (p) {
1599
+ case J:
1600
+ if (c.hard) a = !0;
1601
+ else {
1602
+ c.soft || (s.push(" "), (u += 1));
1603
+ break;
1604
+ }
1605
+ case H:
1606
+ if (D.length > 0) {
1607
+ o.push({ ind: f, mode: p, doc: c }, ...D.reverse()),
1608
+ (D.length = 0);
1609
+ break;
1610
+ }
1611
+ c.literal
1612
+ ? f.root
1613
+ ? (s.push(i, f.root.value), (u = f.root.length))
1614
+ : (s.push(i), (u = 0))
1615
+ : ((u -= Ot(s)), s.push(i + f.value), (u = f.length));
1616
+ break;
1617
+ }
1618
+ break;
1619
+ case N:
1620
+ o.push({ ind: f, mode: p, doc: c.contents });
1621
+ break;
1622
+ case b:
1623
+ break;
1624
+ default:
1625
+ throw new Q(c);
1626
+ }
1627
+ o.length === 0 &&
1628
+ D.length > 0 &&
1629
+ (o.push(...D.reverse()), (D.length = 0));
1630
+ }
1631
+ let d = s.indexOf(Te);
1632
+ if (d !== -1) {
1633
+ let f = s.indexOf(Te, d + 1),
1634
+ p = s.slice(0, d).join(""),
1635
+ c = s.slice(d + 1, f).join(""),
1636
+ F = s.slice(f + 1).join("");
1637
+ return {
1638
+ formatted: p + c + F,
1639
+ cursorNodeStart: p.length,
1640
+ cursorNodeText: c,
1641
+ };
1642
+ }
1643
+ return { formatted: s.join("") };
1644
+ }
1645
+ function Gu(e, t, r = 0) {
1646
+ let n = 0;
1647
+ for (let i = r; i < e.length; ++i)
1648
+ e[i] === " " ? (n = n + t - (n % t)) : n++;
1649
+ return n;
1650
+ }
1651
+ var me = Gu;
1652
+ var te,
1653
+ Nt,
1654
+ tt,
1655
+ St = class {
1656
+ constructor(t) {
1657
+ Dr(this, te);
1658
+ this.stack = [t];
1659
+ }
1660
+ get key() {
1661
+ let { stack: t, siblings: r } = this;
1662
+ return y(!1, t, r === null ? -2 : -4) ?? null;
1663
+ }
1664
+ get index() {
1665
+ return this.siblings === null ? null : y(!1, this.stack, -2);
1666
+ }
1667
+ get node() {
1668
+ return y(!1, this.stack, -1);
1669
+ }
1670
+ get parent() {
1671
+ return this.getNode(1);
1672
+ }
1673
+ get grandparent() {
1674
+ return this.getNode(2);
1675
+ }
1676
+ get isInArray() {
1677
+ return this.siblings !== null;
1678
+ }
1679
+ get siblings() {
1680
+ let { stack: t } = this,
1681
+ r = y(!1, t, -3);
1682
+ return Array.isArray(r) ? r : null;
1683
+ }
1684
+ get next() {
1685
+ let { siblings: t } = this;
1686
+ return t === null ? null : t[this.index + 1];
1687
+ }
1688
+ get previous() {
1689
+ let { siblings: t } = this;
1690
+ return t === null ? null : t[this.index - 1];
1691
+ }
1692
+ get isFirst() {
1693
+ return this.index === 0;
1694
+ }
1695
+ get isLast() {
1696
+ let { siblings: t, index: r } = this;
1697
+ return t !== null && r === t.length - 1;
1698
+ }
1699
+ get isRoot() {
1700
+ return this.stack.length === 1;
1701
+ }
1702
+ get root() {
1703
+ return this.stack[0];
1704
+ }
1705
+ get ancestors() {
1706
+ return [...pe(this, te, tt).call(this)];
1707
+ }
1708
+ getName() {
1709
+ let { stack: t } = this,
1710
+ { length: r } = t;
1711
+ return r > 1 ? y(!1, t, -2) : null;
1712
+ }
1713
+ getValue() {
1714
+ return y(!1, this.stack, -1);
1715
+ }
1716
+ getNode(t = 0) {
1717
+ let r = pe(this, te, Nt).call(this, t);
1718
+ return r === -1 ? null : this.stack[r];
1719
+ }
1720
+ getParentNode(t = 0) {
1721
+ return this.getNode(t + 1);
1722
+ }
1723
+ call(t, ...r) {
1724
+ let { stack: n } = this,
1725
+ { length: i } = n,
1726
+ u = y(!1, n, -1);
1727
+ for (let o of r) (u = u[o]), n.push(o, u);
1728
+ try {
1729
+ return t(this);
1730
+ } finally {
1731
+ n.length = i;
1732
+ }
1733
+ }
1734
+ callParent(t, r = 0) {
1735
+ let n = pe(this, te, Nt).call(this, r + 1),
1736
+ i = this.stack.splice(n + 1);
1737
+ try {
1738
+ return t(this);
1739
+ } finally {
1740
+ this.stack.push(...i);
1741
+ }
1742
+ }
1743
+ each(t, ...r) {
1744
+ let { stack: n } = this,
1745
+ { length: i } = n,
1746
+ u = y(!1, n, -1);
1747
+ for (let o of r) (u = u[o]), n.push(o, u);
1748
+ try {
1749
+ for (let o = 0; o < u.length; ++o)
1750
+ n.push(o, u[o]), t(this, o, u), (n.length -= 2);
1751
+ } finally {
1752
+ n.length = i;
1753
+ }
1754
+ }
1755
+ map(t, ...r) {
1756
+ let n = [];
1757
+ return (
1758
+ this.each(
1759
+ (i, u, o) => {
1760
+ n[u] = t(i, u, o);
1761
+ },
1762
+ ...r,
1763
+ ),
1764
+ n
1765
+ );
1766
+ }
1767
+ match(...t) {
1768
+ let r = this.stack.length - 1,
1769
+ n = null,
1770
+ i = this.stack[r--];
1771
+ for (let u of t) {
1772
+ if (i === void 0) return !1;
1773
+ let o = null;
1774
+ if (
1775
+ (typeof n == "number" &&
1776
+ ((o = n), (n = this.stack[r--]), (i = this.stack[r--])),
1777
+ u && !u(i, n, o))
1778
+ )
1779
+ return !1;
1780
+ (n = this.stack[r--]), (i = this.stack[r--]);
1781
+ }
1782
+ return !0;
1783
+ }
1784
+ findAncestor(t) {
1785
+ for (let r of pe(this, te, tt).call(this)) if (t(r)) return r;
1786
+ }
1787
+ hasAncestor(t) {
1788
+ for (let r of pe(this, te, tt).call(this)) if (t(r)) return !0;
1789
+ return !1;
1790
+ }
1791
+ };
1792
+ (te = new WeakSet()),
1793
+ (Nt = function (t) {
1794
+ let { stack: r } = this;
1795
+ for (let n = r.length - 1; n >= 0; n -= 2)
1796
+ if (!Array.isArray(r[n]) && --t < 0) return n;
1797
+ return -1;
1798
+ }),
1799
+ (tt = function* () {
1800
+ let { stack: t } = this;
1801
+ for (let r = t.length - 3; r >= 0; r -= 2) {
1802
+ let n = t[r];
1803
+ Array.isArray(n) || (yield n);
1804
+ }
1805
+ });
1806
+ var Mr = St;
1807
+ var $r = new Proxy(() => {}, { get: () => $r }),
1808
+ ke = $r;
1809
+ function Ku(e) {
1810
+ return e !== null && typeof e == "object";
1811
+ }
1812
+ var Vr = Ku;
1813
+ function* Tt(e, t) {
1814
+ let { getVisitorKeys: r, filter: n = () => !0 } = t,
1815
+ i = (u) => Vr(u) && n(u);
1816
+ for (let u of r(e)) {
1817
+ let o = e[u];
1818
+ if (Array.isArray(o)) for (let s of o) i(s) && (yield s);
1819
+ else i(o) && (yield o);
1820
+ }
1821
+ }
1822
+ function* Ur(e, t) {
1823
+ let r = [e];
1824
+ for (let n = 0; n < r.length; n++) {
1825
+ let i = r[n];
1826
+ for (let u of Tt(i, t)) yield u, r.push(u);
1827
+ }
1828
+ }
1829
+ function Ee(e) {
1830
+ return (t, r, n) => {
1831
+ let i = !!(n != null && n.backwards);
1832
+ if (r === !1) return !1;
1833
+ let { length: u } = t,
1834
+ o = r;
1835
+ for (; o >= 0 && o < u; ) {
1836
+ let s = t.charAt(o);
1837
+ if (e instanceof RegExp) {
1838
+ if (!e.test(s)) return o;
1839
+ } else if (!e.includes(s)) return o;
1840
+ i ? o-- : o++;
1841
+ }
1842
+ return o === -1 || o === u ? o : !1;
1843
+ };
1844
+ }
1845
+ var zr = Ee(/\s/u),
1846
+ T = Ee(" "),
1847
+ rt = Ee(",; "),
1848
+ nt = Ee(/[^\n\r]/u);
1849
+ function qu(e, t, r) {
1850
+ let n = !!(r != null && r.backwards);
1851
+ if (t === !1) return !1;
1852
+ let i = e.charAt(t);
1853
+ if (n) {
1854
+ if (
1855
+ e.charAt(t - 1) === "\r" &&
1856
+ i ===
1857
+ `
1858
+ `
1859
+ )
1860
+ return t - 2;
1861
+ if (
1862
+ i ===
1863
+ `
1864
+ ` ||
1865
+ i === "\r" ||
1866
+ i === "\u2028" ||
1867
+ i === "\u2029"
1868
+ )
1869
+ return t - 1;
1870
+ } else {
1871
+ if (
1872
+ i === "\r" &&
1873
+ e.charAt(t + 1) ===
1874
+ `
1875
+ `
1876
+ )
1877
+ return t + 2;
1878
+ if (
1879
+ i ===
1880
+ `
1881
+ ` ||
1882
+ i === "\r" ||
1883
+ i === "\u2028" ||
1884
+ i === "\u2029"
1885
+ )
1886
+ return t + 1;
1887
+ }
1888
+ return t;
1889
+ }
1890
+ var M = qu;
1891
+ function Ju(e, t, r = {}) {
1892
+ let n = T(e, r.backwards ? t - 1 : t, r),
1893
+ i = M(e, n, r);
1894
+ return n !== i;
1895
+ }
1896
+ var V = Ju;
1897
+ function Xu(e) {
1898
+ return Array.isArray(e) && e.length > 0;
1899
+ }
1900
+ var kt = Xu;
1901
+ var Gr = new Set([
1902
+ "tokens",
1903
+ "comments",
1904
+ "parent",
1905
+ "enclosingNode",
1906
+ "precedingNode",
1907
+ "followingNode",
1908
+ ]),
1909
+ Zu = (e) => Object.keys(e).filter((t) => !Gr.has(t));
1910
+ function Qu(e) {
1911
+ return e ? (t) => e(t, Gr) : Zu;
1912
+ }
1913
+ var X = Qu;
1914
+ function ei(e) {
1915
+ let t = e.type || e.kind || "(unknown type)",
1916
+ r = String(
1917
+ e.name ||
1918
+ (e.id && (typeof e.id == "object" ? e.id.name : e.id)) ||
1919
+ (e.key && (typeof e.key == "object" ? e.key.name : e.key)) ||
1920
+ (e.value && (typeof e.value == "object" ? "" : String(e.value))) ||
1921
+ e.operator ||
1922
+ "",
1923
+ );
1924
+ return (
1925
+ r.length > 20 && (r = r.slice(0, 19) + "\u2026"), t + (r ? " " + r : "")
1926
+ );
1927
+ }
1928
+ function Lt(e, t) {
1929
+ (e.comments ?? (e.comments = [])).push(t),
1930
+ (t.printed = !1),
1931
+ (t.nodeDescription = ei(e));
1932
+ }
1933
+ function ue(e, t) {
1934
+ (t.leading = !0), (t.trailing = !1), Lt(e, t);
1935
+ }
1936
+ function re(e, t, r) {
1937
+ (t.leading = !1), (t.trailing = !1), r && (t.marker = r), Lt(e, t);
1938
+ }
1939
+ function ie(e, t) {
1940
+ (t.leading = !1), (t.trailing = !0), Lt(e, t);
1941
+ }
1942
+ var Pt = new WeakMap();
1943
+ function ut(e, t) {
1944
+ if (Pt.has(e)) return Pt.get(e);
1945
+ let {
1946
+ printer: {
1947
+ getCommentChildNodes: r,
1948
+ canAttachComment: n,
1949
+ getVisitorKeys: i,
1950
+ },
1951
+ locStart: u,
1952
+ locEnd: o,
1953
+ } = t;
1954
+ if (!n) return [];
1955
+ let s = (
1956
+ (r == null ? void 0 : r(e, t)) ?? [...Tt(e, { getVisitorKeys: X(i) })]
1957
+ ).flatMap((a) => (n(a) ? [a] : ut(a, t)));
1958
+ return s.sort((a, D) => u(a) - u(D) || o(a) - o(D)), Pt.set(e, s), s;
1959
+ }
1960
+ function qr(e, t, r, n) {
1961
+ let { locStart: i, locEnd: u } = r,
1962
+ o = i(t),
1963
+ s = u(t),
1964
+ a = ut(e, r),
1965
+ D,
1966
+ l,
1967
+ d = 0,
1968
+ f = a.length;
1969
+ for (; d < f; ) {
1970
+ let p = (d + f) >> 1,
1971
+ c = a[p],
1972
+ F = i(c),
1973
+ m = u(c);
1974
+ if (F <= o && s <= m) return qr(c, t, r, c);
1975
+ if (m <= o) {
1976
+ (D = c), (d = p + 1);
1977
+ continue;
1978
+ }
1979
+ if (s <= F) {
1980
+ (l = c), (f = p);
1981
+ continue;
1982
+ }
1983
+ throw new Error("Comment location overlaps with node location");
1984
+ }
1985
+ if ((n == null ? void 0 : n.type) === "TemplateLiteral") {
1986
+ let { quasis: p } = n,
1987
+ c = Rt(p, t, r);
1988
+ D && Rt(p, D, r) !== c && (D = null),
1989
+ l && Rt(p, l, r) !== c && (l = null);
1990
+ }
1991
+ return { enclosingNode: n, precedingNode: D, followingNode: l };
1992
+ }
1993
+ var It = () => !1;
1994
+ function Jr(e, t) {
1995
+ let { comments: r } = e;
1996
+ if ((delete e.comments, !kt(r) || !t.printer.canAttachComment)) return;
1997
+ let n = [],
1998
+ {
1999
+ locStart: i,
2000
+ locEnd: u,
2001
+ printer: {
2002
+ experimentalFeatures: { avoidAstMutation: o = !1 } = {},
2003
+ handleComments: s = {},
2004
+ },
2005
+ originalText: a,
2006
+ } = t,
2007
+ { ownLine: D = It, endOfLine: l = It, remaining: d = It } = s,
2008
+ f = r.map((p, c) => ({
2009
+ ...qr(e, p, t),
2010
+ comment: p,
2011
+ text: a,
2012
+ options: t,
2013
+ ast: e,
2014
+ isLastComment: r.length - 1 === c,
2015
+ }));
2016
+ for (let [p, c] of f.entries()) {
2017
+ let {
2018
+ comment: F,
2019
+ precedingNode: m,
2020
+ enclosingNode: E,
2021
+ followingNode: A,
2022
+ text: w,
2023
+ options: h,
2024
+ ast: C,
2025
+ isLastComment: k,
2026
+ } = c;
2027
+ if (
2028
+ h.parser === "json" ||
2029
+ h.parser === "json5" ||
2030
+ h.parser === "jsonc" ||
2031
+ h.parser === "__js_expression" ||
2032
+ h.parser === "__ts_expression" ||
2033
+ h.parser === "__vue_expression" ||
2034
+ h.parser === "__vue_ts_expression"
2035
+ ) {
2036
+ if (i(F) - i(C) <= 0) {
2037
+ ue(C, F);
2038
+ continue;
2039
+ }
2040
+ if (u(F) - u(C) >= 0) {
2041
+ ie(C, F);
2042
+ continue;
2043
+ }
2044
+ }
2045
+ let v;
2046
+ if (
2047
+ (o
2048
+ ? (v = [c])
2049
+ : ((F.enclosingNode = E),
2050
+ (F.precedingNode = m),
2051
+ (F.followingNode = A),
2052
+ (v = [F, w, h, C, k])),
2053
+ ti(w, h, f, p))
2054
+ )
2055
+ (F.placement = "ownLine"),
2056
+ D(...v) || (A ? ue(A, F) : m ? ie(m, F) : E ? re(E, F) : re(C, F));
2057
+ else if (ri(w, h, f, p))
2058
+ (F.placement = "endOfLine"),
2059
+ l(...v) || (m ? ie(m, F) : A ? ue(A, F) : E ? re(E, F) : re(C, F));
2060
+ else if (((F.placement = "remaining"), !d(...v)))
2061
+ if (m && A) {
2062
+ let $ = n.length;
2063
+ $ > 0 && n[$ - 1].followingNode !== A && Kr(n, h), n.push(c);
2064
+ } else m ? ie(m, F) : A ? ue(A, F) : E ? re(E, F) : re(C, F);
2065
+ }
2066
+ if ((Kr(n, t), !o))
2067
+ for (let p of r)
2068
+ delete p.precedingNode, delete p.enclosingNode, delete p.followingNode;
2069
+ }
2070
+ var Xr = (e) => !/[\S\n\u2028\u2029]/u.test(e);
2071
+ function ti(e, t, r, n) {
2072
+ let { comment: i, precedingNode: u } = r[n],
2073
+ { locStart: o, locEnd: s } = t,
2074
+ a = o(i);
2075
+ if (u)
2076
+ for (let D = n - 1; D >= 0; D--) {
2077
+ let { comment: l, precedingNode: d } = r[D];
2078
+ if (d !== u || !Xr(e.slice(s(l), a))) break;
2079
+ a = o(l);
2080
+ }
2081
+ return V(e, a, { backwards: !0 });
2082
+ }
2083
+ function ri(e, t, r, n) {
2084
+ let { comment: i, followingNode: u } = r[n],
2085
+ { locStart: o, locEnd: s } = t,
2086
+ a = s(i);
2087
+ if (u)
2088
+ for (let D = n + 1; D < r.length; D++) {
2089
+ let { comment: l, followingNode: d } = r[D];
2090
+ if (d !== u || !Xr(e.slice(a, o(l)))) break;
2091
+ a = s(l);
2092
+ }
2093
+ return V(e, a);
2094
+ }
2095
+ function Kr(e, t) {
2096
+ var s, a;
2097
+ let r = e.length;
2098
+ if (r === 0) return;
2099
+ let { precedingNode: n, followingNode: i } = e[0],
2100
+ u = t.locStart(i),
2101
+ o;
2102
+ for (o = r; o > 0; --o) {
2103
+ let { comment: D, precedingNode: l, followingNode: d } = e[o - 1];
2104
+ ke.strictEqual(l, n), ke.strictEqual(d, i);
2105
+ let f = t.originalText.slice(t.locEnd(D), u);
2106
+ if (
2107
+ ((a = (s = t.printer).isGap) == null ? void 0 : a.call(s, f, t)) ??
2108
+ /^[\s(]*$/u.test(f)
2109
+ )
2110
+ u = t.locStart(D);
2111
+ else break;
2112
+ }
2113
+ for (let [D, { comment: l }] of e.entries()) D < o ? ie(n, l) : ue(i, l);
2114
+ for (let D of [n, i])
2115
+ D.comments &&
2116
+ D.comments.length > 1 &&
2117
+ D.comments.sort((l, d) => t.locStart(l) - t.locStart(d));
2118
+ e.length = 0;
2119
+ }
2120
+ function Rt(e, t, r) {
2121
+ let n = r.locStart(t) - 1;
2122
+ for (let i = 1; i < e.length; ++i) if (n < r.locStart(e[i])) return i - 1;
2123
+ return 0;
2124
+ }
2125
+ function ni(e, t) {
2126
+ let r = t - 1;
2127
+ (r = T(e, r, { backwards: !0 })),
2128
+ (r = M(e, r, { backwards: !0 })),
2129
+ (r = T(e, r, { backwards: !0 }));
2130
+ let n = M(e, r, { backwards: !0 });
2131
+ return r !== n;
2132
+ }
2133
+ var Le = ni;
2134
+ function Zr(e, t) {
2135
+ let r = e.node;
2136
+ return (r.printed = !0), t.printer.printComment(e, t);
2137
+ }
2138
+ function ui(e, t) {
2139
+ var l;
2140
+ let r = e.node,
2141
+ n = [Zr(e, t)],
2142
+ { printer: i, originalText: u, locStart: o, locEnd: s } = t;
2143
+ if ((l = i.isBlockComment) == null ? void 0 : l.call(i, r)) {
2144
+ let d = V(u, s(r)) ? (V(u, o(r), { backwards: !0 }) ? q : Ke) : " ";
2145
+ n.push(d);
2146
+ } else n.push(q);
2147
+ let D = M(u, T(u, s(r)));
2148
+ return D !== !1 && V(u, D) && n.push(q), n;
2149
+ }
2150
+ function ii(e, t, r) {
2151
+ var D;
2152
+ let n = e.node,
2153
+ i = Zr(e, t),
2154
+ { printer: u, originalText: o, locStart: s } = t,
2155
+ a = (D = u.isBlockComment) == null ? void 0 : D.call(u, n);
2156
+ if (
2157
+ (r != null && r.hasLineSuffix && !(r != null && r.isBlock)) ||
2158
+ V(o, s(n), { backwards: !0 })
2159
+ ) {
2160
+ let l = Le(o, s(n));
2161
+ return { doc: _e([q, l ? q : "", i]), isBlock: a, hasLineSuffix: !0 };
2162
+ }
2163
+ return !a || (r != null && r.hasLineSuffix)
2164
+ ? { doc: [_e([" ", i]), de], isBlock: a, hasLineSuffix: !0 }
2165
+ : { doc: [" ", i], isBlock: a, hasLineSuffix: !1 };
2166
+ }
2167
+ function oi(e, t) {
2168
+ let r = e.node;
2169
+ if (!r) return {};
2170
+ let n = t[Symbol.for("printedComments")];
2171
+ if ((r.comments || []).filter((a) => !n.has(a)).length === 0)
2172
+ return { leading: "", trailing: "" };
2173
+ let u = [],
2174
+ o = [],
2175
+ s;
2176
+ return (
2177
+ e.each(() => {
2178
+ let a = e.node;
2179
+ if (n != null && n.has(a)) return;
2180
+ let { leading: D, trailing: l } = a;
2181
+ D ? u.push(ui(e, t)) : l && ((s = ii(e, t, s)), o.push(s.doc));
2182
+ }, "comments"),
2183
+ { leading: u, trailing: o }
2184
+ );
2185
+ }
2186
+ function Qr(e, t, r) {
2187
+ let { leading: n, trailing: i } = oi(e, r);
2188
+ return !n && !i ? t : Qe(t, (u) => [n, u, i]);
2189
+ }
2190
+ function en(e) {
2191
+ let { [Symbol.for("comments")]: t, [Symbol.for("printedComments")]: r } = e;
2192
+ for (let n of t) {
2193
+ if (!n.printed && !r.has(n))
2194
+ throw new Error(
2195
+ 'Comment "' +
2196
+ n.value.trim() +
2197
+ '" was not printed. Please report this error!',
2198
+ );
2199
+ delete n.printed;
2200
+ }
2201
+ }
2202
+ function si(e) {
2203
+ return () => {};
2204
+ }
2205
+ var tn = si;
2206
+ var Pe = class extends Error {
2207
+ name = "ConfigError";
2208
+ },
2209
+ Ie = class extends Error {
2210
+ name = "UndefinedParserError";
2211
+ };
2212
+ var rn = {
2213
+ cursorOffset: {
2214
+ category: "Special",
2215
+ type: "int",
2216
+ default: -1,
2217
+ range: { start: -1, end: 1 / 0, step: 1 },
2218
+ description:
2219
+ "Print (to stderr) where a cursor at the given position would move to after formatting.",
2220
+ cliCategory: "Editor",
2221
+ },
2222
+ endOfLine: {
2223
+ category: "Global",
2224
+ type: "choice",
2225
+ default: "lf",
2226
+ description: "Which end of line characters to apply.",
2227
+ choices: [
2228
+ {
2229
+ value: "lf",
2230
+ description:
2231
+ "Line Feed only (\\n), common on Linux and macOS as well as inside git repos",
2232
+ },
2233
+ {
2234
+ value: "crlf",
2235
+ description:
2236
+ "Carriage Return + Line Feed characters (\\r\\n), common on Windows",
2237
+ },
2238
+ {
2239
+ value: "cr",
2240
+ description: "Carriage Return character only (\\r), used very rarely",
2241
+ },
2242
+ {
2243
+ value: "auto",
2244
+ description: `Maintain existing
2245
+ (mixed values within one file are normalised by looking at what's used after the first line)`,
2246
+ },
2247
+ ],
2248
+ },
2249
+ filepath: {
2250
+ category: "Special",
2251
+ type: "path",
2252
+ description:
2253
+ "Specify the input filepath. This will be used to do parser inference.",
2254
+ cliName: "stdin-filepath",
2255
+ cliCategory: "Other",
2256
+ cliDescription: "Path to the file to pretend that stdin comes from.",
2257
+ },
2258
+ insertPragma: {
2259
+ category: "Special",
2260
+ type: "boolean",
2261
+ default: !1,
2262
+ description: "Insert @format pragma into file's first docblock comment.",
2263
+ cliCategory: "Other",
2264
+ },
2265
+ parser: {
2266
+ category: "Global",
2267
+ type: "choice",
2268
+ default: void 0,
2269
+ description: "Which parser to use.",
2270
+ exception: (e) => typeof e == "string" || typeof e == "function",
2271
+ choices: [
2272
+ { value: "flow", description: "Flow" },
2273
+ { value: "babel", description: "JavaScript" },
2274
+ { value: "babel-flow", description: "Flow" },
2275
+ { value: "babel-ts", description: "TypeScript" },
2276
+ { value: "typescript", description: "TypeScript" },
2277
+ { value: "acorn", description: "JavaScript" },
2278
+ { value: "espree", description: "JavaScript" },
2279
+ { value: "meriyah", description: "JavaScript" },
2280
+ { value: "css", description: "CSS" },
2281
+ { value: "less", description: "Less" },
2282
+ { value: "scss", description: "SCSS" },
2283
+ { value: "json", description: "JSON" },
2284
+ { value: "json5", description: "JSON5" },
2285
+ { value: "jsonc", description: "JSON with Comments" },
2286
+ { value: "json-stringify", description: "JSON.stringify" },
2287
+ { value: "graphql", description: "GraphQL" },
2288
+ { value: "markdown", description: "Markdown" },
2289
+ { value: "mdx", description: "MDX" },
2290
+ { value: "vue", description: "Vue" },
2291
+ { value: "yaml", description: "YAML" },
2292
+ { value: "glimmer", description: "Ember / Handlebars" },
2293
+ { value: "html", description: "HTML" },
2294
+ { value: "angular", description: "Angular" },
2295
+ { value: "lwc", description: "Lightning Web Components" },
2296
+ ],
2297
+ },
2298
+ plugins: {
2299
+ type: "path",
2300
+ array: !0,
2301
+ default: [{ value: [] }],
2302
+ category: "Global",
2303
+ description:
2304
+ "Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",
2305
+ exception: (e) => typeof e == "string" || typeof e == "object",
2306
+ cliName: "plugin",
2307
+ cliCategory: "Config",
2308
+ },
2309
+ printWidth: {
2310
+ category: "Global",
2311
+ type: "int",
2312
+ default: 80,
2313
+ description: "The line length where Prettier will try wrap.",
2314
+ range: { start: 0, end: 1 / 0, step: 1 },
2315
+ },
2316
+ rangeEnd: {
2317
+ category: "Special",
2318
+ type: "int",
2319
+ default: 1 / 0,
2320
+ range: { start: 0, end: 1 / 0, step: 1 },
2321
+ description: `Format code ending at a given character offset (exclusive).
2322
+ The range will extend forwards to the end of the selected statement.`,
2323
+ cliCategory: "Editor",
2324
+ },
2325
+ rangeStart: {
2326
+ category: "Special",
2327
+ type: "int",
2328
+ default: 0,
2329
+ range: { start: 0, end: 1 / 0, step: 1 },
2330
+ description: `Format code starting at a given character offset.
2331
+ The range will extend backwards to the start of the first line containing the selected statement.`,
2332
+ cliCategory: "Editor",
2333
+ },
2334
+ requirePragma: {
2335
+ category: "Special",
2336
+ type: "boolean",
2337
+ default: !1,
2338
+ description: `Require either '@prettier' or '@format' to be present in the file's first docblock comment
2339
+ in order for it to be formatted.`,
2340
+ cliCategory: "Other",
2341
+ },
2342
+ tabWidth: {
2343
+ type: "int",
2344
+ category: "Global",
2345
+ default: 2,
2346
+ description: "Number of spaces per indentation level.",
2347
+ range: { start: 0, end: 1 / 0, step: 1 },
2348
+ },
2349
+ useTabs: {
2350
+ category: "Global",
2351
+ type: "boolean",
2352
+ default: !1,
2353
+ description: "Indent with tabs instead of spaces.",
2354
+ },
2355
+ embeddedLanguageFormatting: {
2356
+ category: "Global",
2357
+ type: "choice",
2358
+ default: "auto",
2359
+ description:
2360
+ "Control how Prettier formats quoted code embedded in the file.",
2361
+ choices: [
2362
+ {
2363
+ value: "auto",
2364
+ description:
2365
+ "Format embedded code if Prettier can automatically identify it.",
2366
+ },
2367
+ {
2368
+ value: "off",
2369
+ description: "Never automatically format embedded code.",
2370
+ },
2371
+ ],
2372
+ },
2373
+ };
2374
+ function it({ plugins: e = [], showDeprecated: t = !1 } = {}) {
2375
+ let r = e.flatMap((i) => i.languages ?? []),
2376
+ n = [];
2377
+ for (let i of Di(Object.assign({}, ...e.map(({ options: u }) => u), rn)))
2378
+ (!t && i.deprecated) ||
2379
+ (Array.isArray(i.choices) &&
2380
+ (t || (i.choices = i.choices.filter((u) => !u.deprecated)),
2381
+ i.name === "parser" &&
2382
+ (i.choices = [...i.choices, ...ai(i.choices, r, e)])),
2383
+ (i.pluginDefaults = Object.fromEntries(
2384
+ e
2385
+ .filter((u) => {
2386
+ var o;
2387
+ return (
2388
+ ((o = u.defaultOptions) == null ? void 0 : o[i.name]) !== void 0
2389
+ );
2390
+ })
2391
+ .map((u) => [u.name, u.defaultOptions[i.name]]),
2392
+ )),
2393
+ n.push(i));
2394
+ return { languages: r, options: n };
2395
+ }
2396
+ function* ai(e, t, r) {
2397
+ let n = new Set(e.map((i) => i.value));
2398
+ for (let i of t)
2399
+ if (i.parsers) {
2400
+ for (let u of i.parsers)
2401
+ if (!n.has(u)) {
2402
+ n.add(u);
2403
+ let o = r.find(
2404
+ (a) =>
2405
+ a.parsers &&
2406
+ Object.prototype.hasOwnProperty.call(a.parsers, u),
2407
+ ),
2408
+ s = i.name;
2409
+ o != null && o.name && (s += ` (plugin: ${o.name})`),
2410
+ yield { value: u, description: s };
2411
+ }
2412
+ }
2413
+ }
2414
+ function Di(e) {
2415
+ let t = [];
2416
+ for (let [r, n] of Object.entries(e)) {
2417
+ let i = { name: r, ...n };
2418
+ Array.isArray(i.default) && (i.default = y(!1, i.default, -1).value),
2419
+ t.push(i);
2420
+ }
2421
+ return t;
2422
+ }
2423
+ var li = (e) => String(e).split(/[/\\]/u).pop();
2424
+ function nn(e, t) {
2425
+ if (!t) return;
2426
+ let r = li(t).toLowerCase();
2427
+ return (
2428
+ e.find(({ filenames: n }) =>
2429
+ n == null ? void 0 : n.some((i) => i.toLowerCase() === r),
2430
+ ) ??
2431
+ e.find(({ extensions: n }) =>
2432
+ n == null ? void 0 : n.some((i) => r.endsWith(i)),
2433
+ )
2434
+ );
2435
+ }
2436
+ function ci(e, t) {
2437
+ if (t)
2438
+ return (
2439
+ e.find(({ name: r }) => r.toLowerCase() === t) ??
2440
+ e.find(({ aliases: r }) => (r == null ? void 0 : r.includes(t))) ??
2441
+ e.find(({ extensions: r }) =>
2442
+ r == null ? void 0 : r.includes(`.${t}`),
2443
+ )
2444
+ );
2445
+ }
2446
+ function fi(e, t) {
2447
+ let r = e.plugins.flatMap((i) => i.languages ?? []),
2448
+ n =
2449
+ ci(r, t.language) ??
2450
+ nn(r, t.physicalFile) ??
2451
+ nn(r, t.file) ??
2452
+ (t.physicalFile, void 0);
2453
+ return n == null ? void 0 : n.parsers[0];
2454
+ }
2455
+ var un = fi;
2456
+ var oe = {
2457
+ key: (e) => (/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e) ? e : JSON.stringify(e)),
2458
+ value(e) {
2459
+ if (e === null || typeof e != "object") return JSON.stringify(e);
2460
+ if (Array.isArray(e)) return `[${e.map((r) => oe.value(r)).join(", ")}]`;
2461
+ let t = Object.keys(e);
2462
+ return t.length === 0
2463
+ ? "{}"
2464
+ : `{ ${t.map((r) => `${oe.key(r)}: ${oe.value(e[r])}`).join(", ")} }`;
2465
+ },
2466
+ pair: ({ key: e, value: t }) => oe.value({ [e]: t }),
2467
+ };
2468
+ var Yt = Me(ot(), 1),
2469
+ an = (e, t, { descriptor: r }) => {
2470
+ let n = [
2471
+ `${Yt.default.yellow(typeof e == "string" ? r.key(e) : r.pair(e))} is deprecated`,
2472
+ ];
2473
+ return (
2474
+ t &&
2475
+ n.push(
2476
+ `we now treat it as ${Yt.default.blue(typeof t == "string" ? r.key(t) : r.pair(t))}`,
2477
+ ),
2478
+ n.join("; ") + "."
2479
+ );
2480
+ };
2481
+ var le = Me(ot(), 1);
2482
+ var st = Symbol.for("vnopts.VALUE_NOT_EXIST"),
2483
+ he = Symbol.for("vnopts.VALUE_UNCHANGED");
2484
+ var Dn = " ".repeat(2),
2485
+ cn = (e, t, r) => {
2486
+ let { text: n, list: i } = r.normalizeExpectedResult(
2487
+ r.schemas[e].expected(r),
2488
+ ),
2489
+ u = [];
2490
+ return (
2491
+ n && u.push(ln(e, t, n, r.descriptor)),
2492
+ i &&
2493
+ u.push(
2494
+ [ln(e, t, i.title, r.descriptor)].concat(
2495
+ i.values.map((o) => fn(o, r.loggerPrintWidth)),
2496
+ ).join(`
2497
+ `),
2498
+ ),
2499
+ pn(u, r.loggerPrintWidth)
2500
+ );
2501
+ };
2502
+ function ln(e, t, r, n) {
2503
+ return [
2504
+ `Invalid ${le.default.red(n.key(e))} value.`,
2505
+ `Expected ${le.default.blue(r)},`,
2506
+ `but received ${t === st ? le.default.gray("nothing") : le.default.red(n.value(t))}.`,
2507
+ ].join(" ");
2508
+ }
2509
+ function fn({ text: e, list: t }, r) {
2510
+ let n = [];
2511
+ return (
2512
+ e && n.push(`- ${le.default.blue(e)}`),
2513
+ t &&
2514
+ n.push(
2515
+ [`- ${le.default.blue(t.title)}:`].concat(
2516
+ t.values.map((i) =>
2517
+ fn(i, r - Dn.length).replace(/^|\n/g, `$&${Dn}`),
2518
+ ),
2519
+ ).join(`
2520
+ `),
2521
+ ),
2522
+ pn(n, r)
2523
+ );
2524
+ }
2525
+ function pn(e, t) {
2526
+ if (e.length === 1) return e[0];
2527
+ let [r, n] = e,
2528
+ [i, u] = e.map(
2529
+ (o) =>
2530
+ o.split(
2531
+ `
2532
+ `,
2533
+ 1,
2534
+ )[0].length,
2535
+ );
2536
+ return i > t && i > u ? n : r;
2537
+ }
2538
+ var Wt = Me(ot(), 1);
2539
+ var jt = [],
2540
+ dn = [];
2541
+ function Ht(e, t) {
2542
+ if (e === t) return 0;
2543
+ let r = e;
2544
+ e.length > t.length && ((e = t), (t = r));
2545
+ let n = e.length,
2546
+ i = t.length;
2547
+ for (; n > 0 && e.charCodeAt(~-n) === t.charCodeAt(~-i); ) n--, i--;
2548
+ let u = 0;
2549
+ for (; u < n && e.charCodeAt(u) === t.charCodeAt(u); ) u++;
2550
+ if (((n -= u), (i -= u), n === 0)) return i;
2551
+ let o,
2552
+ s,
2553
+ a,
2554
+ D,
2555
+ l = 0,
2556
+ d = 0;
2557
+ for (; l < n; ) (dn[l] = e.charCodeAt(u + l)), (jt[l] = ++l);
2558
+ for (; d < i; )
2559
+ for (o = t.charCodeAt(u + d), a = d++, s = d, l = 0; l < n; l++)
2560
+ (D = o === dn[l] ? a : a + 1),
2561
+ (a = jt[l]),
2562
+ (s = jt[l] = a > s ? (D > s ? s + 1 : D) : D > a ? a + 1 : D);
2563
+ return s;
2564
+ }
2565
+ var at = (e, t, { descriptor: r, logger: n, schemas: i }) => {
2566
+ let u = [
2567
+ `Ignored unknown option ${Wt.default.yellow(r.pair({ key: e, value: t }))}.`,
2568
+ ],
2569
+ o = Object.keys(i)
2570
+ .sort()
2571
+ .find((s) => Ht(e, s) < 3);
2572
+ o && u.push(`Did you mean ${Wt.default.blue(r.key(o))}?`),
2573
+ n.warn(u.join(" "));
2574
+ };
2575
+ var pi = [
2576
+ "default",
2577
+ "expected",
2578
+ "validate",
2579
+ "deprecated",
2580
+ "forward",
2581
+ "redirect",
2582
+ "overlap",
2583
+ "preprocess",
2584
+ "postprocess",
2585
+ ];
2586
+ function di(e, t) {
2587
+ let r = new e(t),
2588
+ n = Object.create(r);
2589
+ for (let i of pi) i in t && (n[i] = Fi(t[i], r, O.prototype[i].length));
2590
+ return n;
2591
+ }
2592
+ var O = class {
2593
+ static create(t) {
2594
+ return di(this, t);
2595
+ }
2596
+ constructor(t) {
2597
+ this.name = t.name;
2598
+ }
2599
+ default(t) {}
2600
+ expected(t) {
2601
+ return "nothing";
2602
+ }
2603
+ validate(t, r) {
2604
+ return !1;
2605
+ }
2606
+ deprecated(t, r) {
2607
+ return !1;
2608
+ }
2609
+ forward(t, r) {}
2610
+ redirect(t, r) {}
2611
+ overlap(t, r, n) {
2612
+ return t;
2613
+ }
2614
+ preprocess(t, r) {
2615
+ return t;
2616
+ }
2617
+ postprocess(t, r) {
2618
+ return he;
2619
+ }
2620
+ };
2621
+ function Fi(e, t, r) {
2622
+ return typeof e == "function"
2623
+ ? (...n) => e(...n.slice(0, r - 1), t, ...n.slice(r - 1))
2624
+ : () => e;
2625
+ }
2626
+ var Dt = class extends O {
2627
+ constructor(t) {
2628
+ super(t), (this._sourceName = t.sourceName);
2629
+ }
2630
+ expected(t) {
2631
+ return t.schemas[this._sourceName].expected(t);
2632
+ }
2633
+ validate(t, r) {
2634
+ return r.schemas[this._sourceName].validate(t, r);
2635
+ }
2636
+ redirect(t, r) {
2637
+ return this._sourceName;
2638
+ }
2639
+ };
2640
+ var lt = class extends O {
2641
+ expected() {
2642
+ return "anything";
2643
+ }
2644
+ validate() {
2645
+ return !0;
2646
+ }
2647
+ };
2648
+ var ct = class extends O {
2649
+ constructor({ valueSchema: t, name: r = t.name, ...n }) {
2650
+ super({ ...n, name: r }), (this._valueSchema = t);
2651
+ }
2652
+ expected(t) {
2653
+ let { text: r, list: n } = t.normalizeExpectedResult(
2654
+ this._valueSchema.expected(t),
2655
+ );
2656
+ return {
2657
+ text: r && `an array of ${r}`,
2658
+ list: n && {
2659
+ title: "an array of the following values",
2660
+ values: [{ list: n }],
2661
+ },
2662
+ };
2663
+ }
2664
+ validate(t, r) {
2665
+ if (!Array.isArray(t)) return !1;
2666
+ let n = [];
2667
+ for (let i of t) {
2668
+ let u = r.normalizeValidateResult(this._valueSchema.validate(i, r), i);
2669
+ u !== !0 && n.push(u.value);
2670
+ }
2671
+ return n.length === 0 ? !0 : { value: n };
2672
+ }
2673
+ deprecated(t, r) {
2674
+ let n = [];
2675
+ for (let i of t) {
2676
+ let u = r.normalizeDeprecatedResult(
2677
+ this._valueSchema.deprecated(i, r),
2678
+ i,
2679
+ );
2680
+ u !== !1 && n.push(...u.map(({ value: o }) => ({ value: [o] })));
2681
+ }
2682
+ return n;
2683
+ }
2684
+ forward(t, r) {
2685
+ let n = [];
2686
+ for (let i of t) {
2687
+ let u = r.normalizeForwardResult(this._valueSchema.forward(i, r), i);
2688
+ n.push(...u.map(Fn));
2689
+ }
2690
+ return n;
2691
+ }
2692
+ redirect(t, r) {
2693
+ let n = [],
2694
+ i = [];
2695
+ for (let u of t) {
2696
+ let o = r.normalizeRedirectResult(this._valueSchema.redirect(u, r), u);
2697
+ "remain" in o && n.push(o.remain), i.push(...o.redirect.map(Fn));
2698
+ }
2699
+ return n.length === 0 ? { redirect: i } : { redirect: i, remain: n };
2700
+ }
2701
+ overlap(t, r) {
2702
+ return t.concat(r);
2703
+ }
2704
+ };
2705
+ function Fn({ from: e, to: t }) {
2706
+ return { from: [e], to: t };
2707
+ }
2708
+ var ft = class extends O {
2709
+ expected() {
2710
+ return "true or false";
2711
+ }
2712
+ validate(t) {
2713
+ return typeof t == "boolean";
2714
+ }
2715
+ };
2716
+ function En(e, t) {
2717
+ let r = Object.create(null);
2718
+ for (let n of e) {
2719
+ let i = n[t];
2720
+ if (r[i]) throw new Error(`Duplicate ${t} ${JSON.stringify(i)}`);
2721
+ r[i] = n;
2722
+ }
2723
+ return r;
2724
+ }
2725
+ function hn(e, t) {
2726
+ let r = new Map();
2727
+ for (let n of e) {
2728
+ let i = n[t];
2729
+ if (r.has(i)) throw new Error(`Duplicate ${t} ${JSON.stringify(i)}`);
2730
+ r.set(i, n);
2731
+ }
2732
+ return r;
2733
+ }
2734
+ function Cn() {
2735
+ let e = Object.create(null);
2736
+ return (t) => {
2737
+ let r = JSON.stringify(t);
2738
+ return e[r] ? !0 : ((e[r] = !0), !1);
2739
+ };
2740
+ }
2741
+ function gn(e, t) {
2742
+ let r = [],
2743
+ n = [];
2744
+ for (let i of e) t(i) ? r.push(i) : n.push(i);
2745
+ return [r, n];
2746
+ }
2747
+ function yn(e) {
2748
+ return e === Math.floor(e);
2749
+ }
2750
+ function An(e, t) {
2751
+ if (e === t) return 0;
2752
+ let r = typeof e,
2753
+ n = typeof t,
2754
+ i = ["undefined", "object", "boolean", "number", "string"];
2755
+ return r !== n
2756
+ ? i.indexOf(r) - i.indexOf(n)
2757
+ : r !== "string"
2758
+ ? Number(e) - Number(t)
2759
+ : e.localeCompare(t);
2760
+ }
2761
+ function Bn(e) {
2762
+ return (...t) => {
2763
+ let r = e(...t);
2764
+ return typeof r == "string" ? new Error(r) : r;
2765
+ };
2766
+ }
2767
+ function Mt(e) {
2768
+ return e === void 0 ? {} : e;
2769
+ }
2770
+ function $t(e) {
2771
+ if (typeof e == "string") return { text: e };
2772
+ let { text: t, list: r } = e;
2773
+ return (
2774
+ mi(
2775
+ (t || r) !== void 0,
2776
+ "Unexpected `expected` result, there should be at least one field.",
2777
+ ),
2778
+ r
2779
+ ? { text: t, list: { title: r.title, values: r.values.map($t) } }
2780
+ : { text: t }
2781
+ );
2782
+ }
2783
+ function Vt(e, t) {
2784
+ return e === !0 ? !0 : e === !1 ? { value: t } : e;
2785
+ }
2786
+ function Ut(e, t, r = !1) {
2787
+ return e === !1
2788
+ ? !1
2789
+ : e === !0
2790
+ ? r
2791
+ ? !0
2792
+ : [{ value: t }]
2793
+ : "value" in e
2794
+ ? [e]
2795
+ : e.length === 0
2796
+ ? !1
2797
+ : e;
2798
+ }
2799
+ function mn(e, t) {
2800
+ return typeof e == "string" || "key" in e
2801
+ ? { from: t, to: e }
2802
+ : "from" in e
2803
+ ? { from: e.from, to: e.to }
2804
+ : { from: t, to: e.to };
2805
+ }
2806
+ function pt(e, t) {
2807
+ return e === void 0
2808
+ ? []
2809
+ : Array.isArray(e)
2810
+ ? e.map((r) => mn(r, t))
2811
+ : [mn(e, t)];
2812
+ }
2813
+ function zt(e, t) {
2814
+ let r = pt(typeof e == "object" && "redirect" in e ? e.redirect : e, t);
2815
+ return r.length === 0
2816
+ ? { remain: t, redirect: r }
2817
+ : typeof e == "object" && "remain" in e
2818
+ ? { remain: e.remain, redirect: r }
2819
+ : { redirect: r };
2820
+ }
2821
+ function mi(e, t) {
2822
+ if (!e) throw new Error(t);
2823
+ }
2824
+ var dt = class extends O {
2825
+ constructor(t) {
2826
+ super(t),
2827
+ (this._choices = hn(
2828
+ t.choices.map((r) => (r && typeof r == "object" ? r : { value: r })),
2829
+ "value",
2830
+ ));
2831
+ }
2832
+ expected({ descriptor: t }) {
2833
+ let r = Array.from(this._choices.keys())
2834
+ .map((o) => this._choices.get(o))
2835
+ .filter(({ hidden: o }) => !o)
2836
+ .map((o) => o.value)
2837
+ .sort(An)
2838
+ .map(t.value),
2839
+ n = r.slice(0, -2),
2840
+ i = r.slice(-2);
2841
+ return {
2842
+ text: n.concat(i.join(" or ")).join(", "),
2843
+ list: { title: "one of the following values", values: r },
2844
+ };
2845
+ }
2846
+ validate(t) {
2847
+ return this._choices.has(t);
2848
+ }
2849
+ deprecated(t) {
2850
+ let r = this._choices.get(t);
2851
+ return r && r.deprecated ? { value: t } : !1;
2852
+ }
2853
+ forward(t) {
2854
+ let r = this._choices.get(t);
2855
+ return r ? r.forward : void 0;
2856
+ }
2857
+ redirect(t) {
2858
+ let r = this._choices.get(t);
2859
+ return r ? r.redirect : void 0;
2860
+ }
2861
+ };
2862
+ var Ft = class extends O {
2863
+ expected() {
2864
+ return "a number";
2865
+ }
2866
+ validate(t, r) {
2867
+ return typeof t == "number";
2868
+ }
2869
+ };
2870
+ var mt = class extends Ft {
2871
+ expected() {
2872
+ return "an integer";
2873
+ }
2874
+ validate(t, r) {
2875
+ return r.normalizeValidateResult(super.validate(t, r), t) === !0 && yn(t);
2876
+ }
2877
+ };
2878
+ var Re = class extends O {
2879
+ expected() {
2880
+ return "a string";
2881
+ }
2882
+ validate(t) {
2883
+ return typeof t == "string";
2884
+ }
2885
+ };
2886
+ var wn = oe,
2887
+ _n = at,
2888
+ xn = cn,
2889
+ vn = an;
2890
+ var Et = class {
2891
+ constructor(t, r) {
2892
+ let {
2893
+ logger: n = console,
2894
+ loggerPrintWidth: i = 80,
2895
+ descriptor: u = wn,
2896
+ unknown: o = _n,
2897
+ invalid: s = xn,
2898
+ deprecated: a = vn,
2899
+ missing: D = () => !1,
2900
+ required: l = () => !1,
2901
+ preprocess: d = (p) => p,
2902
+ postprocess: f = () => he,
2903
+ } = r || {};
2904
+ (this._utils = {
2905
+ descriptor: u,
2906
+ logger: n || { warn: () => {} },
2907
+ loggerPrintWidth: i,
2908
+ schemas: En(t, "name"),
2909
+ normalizeDefaultResult: Mt,
2910
+ normalizeExpectedResult: $t,
2911
+ normalizeDeprecatedResult: Ut,
2912
+ normalizeForwardResult: pt,
2913
+ normalizeRedirectResult: zt,
2914
+ normalizeValidateResult: Vt,
2915
+ }),
2916
+ (this._unknownHandler = o),
2917
+ (this._invalidHandler = Bn(s)),
2918
+ (this._deprecatedHandler = a),
2919
+ (this._identifyMissing = (p, c) => !(p in c) || D(p, c)),
2920
+ (this._identifyRequired = l),
2921
+ (this._preprocess = d),
2922
+ (this._postprocess = f),
2923
+ this.cleanHistory();
2924
+ }
2925
+ cleanHistory() {
2926
+ this._hasDeprecationWarned = Cn();
2927
+ }
2928
+ normalize(t) {
2929
+ let r = {},
2930
+ i = [this._preprocess(t, this._utils)],
2931
+ u = () => {
2932
+ for (; i.length !== 0; ) {
2933
+ let o = i.shift(),
2934
+ s = this._applyNormalization(o, r);
2935
+ i.push(...s);
2936
+ }
2937
+ };
2938
+ u();
2939
+ for (let o of Object.keys(this._utils.schemas)) {
2940
+ let s = this._utils.schemas[o];
2941
+ if (!(o in r)) {
2942
+ let a = Mt(s.default(this._utils));
2943
+ "value" in a && i.push({ [o]: a.value });
2944
+ }
2945
+ }
2946
+ u();
2947
+ for (let o of Object.keys(this._utils.schemas)) {
2948
+ if (!(o in r)) continue;
2949
+ let s = this._utils.schemas[o],
2950
+ a = r[o],
2951
+ D = s.postprocess(a, this._utils);
2952
+ D !== he && (this._applyValidation(D, o, s), (r[o] = D));
2953
+ }
2954
+ return this._applyPostprocess(r), this._applyRequiredCheck(r), r;
2955
+ }
2956
+ _applyNormalization(t, r) {
2957
+ let n = [],
2958
+ { knownKeys: i, unknownKeys: u } = this._partitionOptionKeys(t);
2959
+ for (let o of i) {
2960
+ let s = this._utils.schemas[o],
2961
+ a = s.preprocess(t[o], this._utils);
2962
+ this._applyValidation(a, o, s);
2963
+ let D = ({ from: p, to: c }) => {
2964
+ n.push(typeof c == "string" ? { [c]: p } : { [c.key]: c.value });
2965
+ },
2966
+ l = ({ value: p, redirectTo: c }) => {
2967
+ let F = Ut(s.deprecated(p, this._utils), a, !0);
2968
+ if (F !== !1)
2969
+ if (F === !0)
2970
+ this._hasDeprecationWarned(o) ||
2971
+ this._utils.logger.warn(
2972
+ this._deprecatedHandler(o, c, this._utils),
2973
+ );
2974
+ else
2975
+ for (let { value: m } of F) {
2976
+ let E = { key: o, value: m };
2977
+ if (!this._hasDeprecationWarned(E)) {
2978
+ let A = typeof c == "string" ? { key: c, value: m } : c;
2979
+ this._utils.logger.warn(
2980
+ this._deprecatedHandler(E, A, this._utils),
2981
+ );
2982
+ }
2983
+ }
2984
+ };
2985
+ pt(s.forward(a, this._utils), a).forEach(D);
2986
+ let f = zt(s.redirect(a, this._utils), a);
2987
+ if ((f.redirect.forEach(D), "remain" in f)) {
2988
+ let p = f.remain;
2989
+ (r[o] = o in r ? s.overlap(r[o], p, this._utils) : p),
2990
+ l({ value: p });
2991
+ }
2992
+ for (let { from: p, to: c } of f.redirect)
2993
+ l({ value: p, redirectTo: c });
2994
+ }
2995
+ for (let o of u) {
2996
+ let s = t[o];
2997
+ this._applyUnknownHandler(o, s, r, (a, D) => {
2998
+ n.push({ [a]: D });
2999
+ });
3000
+ }
3001
+ return n;
3002
+ }
3003
+ _applyRequiredCheck(t) {
3004
+ for (let r of Object.keys(this._utils.schemas))
3005
+ if (this._identifyMissing(r, t) && this._identifyRequired(r))
3006
+ throw this._invalidHandler(r, st, this._utils);
3007
+ }
3008
+ _partitionOptionKeys(t) {
3009
+ let [r, n] = gn(
3010
+ Object.keys(t).filter((i) => !this._identifyMissing(i, t)),
3011
+ (i) => i in this._utils.schemas,
3012
+ );
3013
+ return { knownKeys: r, unknownKeys: n };
3014
+ }
3015
+ _applyValidation(t, r, n) {
3016
+ let i = Vt(n.validate(t, this._utils), t);
3017
+ if (i !== !0) throw this._invalidHandler(r, i.value, this._utils);
3018
+ }
3019
+ _applyUnknownHandler(t, r, n, i) {
3020
+ let u = this._unknownHandler(t, r, this._utils);
3021
+ if (u)
3022
+ for (let o of Object.keys(u)) {
3023
+ if (this._identifyMissing(o, u)) continue;
3024
+ let s = u[o];
3025
+ o in this._utils.schemas ? i(o, s) : (n[o] = s);
3026
+ }
3027
+ }
3028
+ _applyPostprocess(t) {
3029
+ let r = this._postprocess(t, this._utils);
3030
+ if (r !== he) {
3031
+ if (r.delete) for (let n of r.delete) delete t[n];
3032
+ if (r.override) {
3033
+ let { knownKeys: n, unknownKeys: i } = this._partitionOptionKeys(
3034
+ r.override,
3035
+ );
3036
+ for (let u of n) {
3037
+ let o = r.override[u];
3038
+ this._applyValidation(o, u, this._utils.schemas[u]), (t[u] = o);
3039
+ }
3040
+ for (let u of i) {
3041
+ let o = r.override[u];
3042
+ this._applyUnknownHandler(u, o, t, (s, a) => {
3043
+ let D = this._utils.schemas[s];
3044
+ this._applyValidation(a, s, D), (t[s] = a);
3045
+ });
3046
+ }
3047
+ }
3048
+ }
3049
+ }
3050
+ };
3051
+ var Gt;
3052
+ function hi(
3053
+ e,
3054
+ t,
3055
+ {
3056
+ logger: r = !1,
3057
+ isCLI: n = !1,
3058
+ passThrough: i = !1,
3059
+ FlagSchema: u,
3060
+ descriptor: o,
3061
+ } = {},
3062
+ ) {
3063
+ if (n) {
3064
+ if (!u) throw new Error("'FlagSchema' option is required.");
3065
+ if (!o) throw new Error("'descriptor' option is required.");
3066
+ } else o = oe;
3067
+ let s = i
3068
+ ? Array.isArray(i)
3069
+ ? (f, p) => (i.includes(f) ? { [f]: p } : void 0)
3070
+ : (f, p) => ({ [f]: p })
3071
+ : (f, p, c) => {
3072
+ let { _: F, ...m } = c.schemas;
3073
+ return at(f, p, { ...c, schemas: m });
3074
+ },
3075
+ a = Ci(t, { isCLI: n, FlagSchema: u }),
3076
+ D = new Et(a, { logger: r, unknown: s, descriptor: o }),
3077
+ l = r !== !1;
3078
+ l && Gt && (D._hasDeprecationWarned = Gt);
3079
+ let d = D.normalize(e);
3080
+ return l && (Gt = D._hasDeprecationWarned), d;
3081
+ }
3082
+ function Ci(e, { isCLI: t, FlagSchema: r }) {
3083
+ let n = [];
3084
+ t && n.push(lt.create({ name: "_" }));
3085
+ for (let i of e)
3086
+ n.push(gi(i, { isCLI: t, optionInfos: e, FlagSchema: r })),
3087
+ i.alias &&
3088
+ t &&
3089
+ n.push(Dt.create({ name: i.alias, sourceName: i.name }));
3090
+ return n;
3091
+ }
3092
+ function gi(e, { isCLI: t, optionInfos: r, FlagSchema: n }) {
3093
+ let { name: i } = e,
3094
+ u = { name: i },
3095
+ o,
3096
+ s = {};
3097
+ switch (e.type) {
3098
+ case "int":
3099
+ (o = mt), t && (u.preprocess = Number);
3100
+ break;
3101
+ case "string":
3102
+ o = Re;
3103
+ break;
3104
+ case "choice":
3105
+ (o = dt),
3106
+ (u.choices = e.choices.map((a) =>
3107
+ a != null && a.redirect
3108
+ ? { ...a, redirect: { to: { key: e.name, value: a.redirect } } }
3109
+ : a,
3110
+ ));
3111
+ break;
3112
+ case "boolean":
3113
+ o = ft;
3114
+ break;
3115
+ case "flag":
3116
+ (o = n),
3117
+ (u.flags = r.flatMap((a) =>
3118
+ [
3119
+ a.alias,
3120
+ a.description && a.name,
3121
+ a.oppositeDescription && `no-${a.name}`,
3122
+ ].filter(Boolean),
3123
+ ));
3124
+ break;
3125
+ case "path":
3126
+ o = Re;
3127
+ break;
3128
+ default:
3129
+ throw new Error(`Unexpected type ${e.type}`);
3130
+ }
3131
+ if (
3132
+ (e.exception
3133
+ ? (u.validate = (a, D, l) => e.exception(a) || D.validate(a, l))
3134
+ : (u.validate = (a, D, l) => a === void 0 || D.validate(a, l)),
3135
+ e.redirect &&
3136
+ (s.redirect = (a) =>
3137
+ a
3138
+ ? {
3139
+ to:
3140
+ typeof e.redirect == "string"
3141
+ ? e.redirect
3142
+ : { key: e.redirect.option, value: e.redirect.value },
3143
+ }
3144
+ : void 0),
3145
+ e.deprecated && (s.deprecated = !0),
3146
+ t && !e.array)
3147
+ ) {
3148
+ let a = u.preprocess || ((D) => D);
3149
+ u.preprocess = (D, l, d) =>
3150
+ l.preprocess(a(Array.isArray(D) ? y(!1, D, -1) : D), d);
3151
+ }
3152
+ return e.array
3153
+ ? ct.create({
3154
+ ...(t ? { preprocess: (a) => (Array.isArray(a) ? a : [a]) } : {}),
3155
+ ...s,
3156
+ valueSchema: o.create(u),
3157
+ })
3158
+ : o.create({ ...u, ...s });
3159
+ }
3160
+ var bn = hi;
3161
+ var yi = (e, t, r) => {
3162
+ if (!(e && t == null)) {
3163
+ if (t.findLast) return t.findLast(r);
3164
+ for (let n = t.length - 1; n >= 0; n--) {
3165
+ let i = t[n];
3166
+ if (r(i, n, t)) return i;
3167
+ }
3168
+ }
3169
+ },
3170
+ Kt = yi;
3171
+ function qt(e, t) {
3172
+ if (!t) throw new Error("parserName is required.");
3173
+ let r = Kt(
3174
+ !1,
3175
+ e,
3176
+ (i) => i.parsers && Object.prototype.hasOwnProperty.call(i.parsers, t),
3177
+ );
3178
+ if (r) return r;
3179
+ let n = `Couldn't resolve parser "${t}".`;
3180
+ throw (
3181
+ ((n += " Plugins must be explicitly added to the standalone bundle."),
3182
+ new Pe(n))
3183
+ );
3184
+ }
3185
+ function On(e, t) {
3186
+ if (!t) throw new Error("astFormat is required.");
3187
+ let r = Kt(
3188
+ !1,
3189
+ e,
3190
+ (i) => i.printers && Object.prototype.hasOwnProperty.call(i.printers, t),
3191
+ );
3192
+ if (r) return r;
3193
+ let n = `Couldn't find plugin for AST format "${t}".`;
3194
+ throw (
3195
+ ((n += " Plugins must be explicitly added to the standalone bundle."),
3196
+ new Pe(n))
3197
+ );
3198
+ }
3199
+ function ht({ plugins: e, parser: t }) {
3200
+ let r = qt(e, t);
3201
+ return Jt(r, t);
3202
+ }
3203
+ function Jt(e, t) {
3204
+ let r = e.parsers[t];
3205
+ return typeof r == "function" ? r() : r;
3206
+ }
3207
+ function Sn(e, t) {
3208
+ let r = e.printers[t];
3209
+ return typeof r == "function" ? r() : r;
3210
+ }
3211
+ var Nn = {
3212
+ astFormat: "estree",
3213
+ printer: {},
3214
+ originalText: void 0,
3215
+ locStart: null,
3216
+ locEnd: null,
3217
+ };
3218
+ async function Ai(e, t = {}) {
3219
+ var d;
3220
+ let r = { ...e };
3221
+ if (!r.parser)
3222
+ if (r.filepath) {
3223
+ if (((r.parser = un(r, { physicalFile: r.filepath })), !r.parser))
3224
+ throw new Ie(`No parser could be inferred for file "${r.filepath}".`);
3225
+ } else
3226
+ throw new Ie(
3227
+ "No parser and no file path given, couldn't infer a parser.",
3228
+ );
3229
+ let n = it({ plugins: e.plugins, showDeprecated: !0 }).options,
3230
+ i = {
3231
+ ...Nn,
3232
+ ...Object.fromEntries(
3233
+ n.filter((f) => f.default !== void 0).map((f) => [f.name, f.default]),
3234
+ ),
3235
+ },
3236
+ u = qt(r.plugins, r.parser),
3237
+ o = await Jt(u, r.parser);
3238
+ (r.astFormat = o.astFormat),
3239
+ (r.locEnd = o.locEnd),
3240
+ (r.locStart = o.locStart);
3241
+ let s =
3242
+ (d = u.printers) != null && d[o.astFormat]
3243
+ ? u
3244
+ : On(r.plugins, o.astFormat),
3245
+ a = await Sn(s, o.astFormat);
3246
+ r.printer = a;
3247
+ let D = s.defaultOptions
3248
+ ? Object.fromEntries(
3249
+ Object.entries(s.defaultOptions).filter(([, f]) => f !== void 0),
3250
+ )
3251
+ : {},
3252
+ l = { ...i, ...D };
3253
+ for (let [f, p] of Object.entries(l))
3254
+ (r[f] === null || r[f] === void 0) && (r[f] = p);
3255
+ return (
3256
+ r.parser === "json" && (r.trailingComma = "none"),
3257
+ bn(r, n, { passThrough: Object.keys(Nn), ...t })
3258
+ );
3259
+ }
3260
+ var se = Ai;
3261
+ var Vn = Me($n(), 1);
3262
+ async function Ni(e, t) {
3263
+ let r = await ht(t),
3264
+ n = r.preprocess ? r.preprocess(e, t) : e;
3265
+ t.originalText = n;
3266
+ let i;
3267
+ try {
3268
+ i = await r.parse(n, t, t);
3269
+ } catch (u) {
3270
+ Ti(u, e);
3271
+ }
3272
+ return { text: n, ast: i };
3273
+ }
3274
+ function Ti(e, t) {
3275
+ let { loc: r } = e;
3276
+ if (r) {
3277
+ let n = (0, Vn.codeFrameColumns)(t, r, { highlightCode: !0 });
3278
+ throw (
3279
+ ((e.message +=
3280
+ `
3281
+ ` + n),
3282
+ (e.codeFrame = n),
3283
+ e)
3284
+ );
3285
+ }
3286
+ throw e;
3287
+ }
3288
+ var ce = Ni;
3289
+ async function Un(e, t, r, n, i) {
3290
+ let {
3291
+ embeddedLanguageFormatting: u,
3292
+ printer: { embed: o, hasPrettierIgnore: s = () => !1, getVisitorKeys: a },
3293
+ } = r;
3294
+ if (!o || u !== "auto") return;
3295
+ if (o.length > 2)
3296
+ throw new Error(
3297
+ "printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed",
3298
+ );
3299
+ let D = X(o.getVisitorKeys ?? a),
3300
+ l = [];
3301
+ p();
3302
+ let d = e.stack;
3303
+ for (let { print: c, node: F, pathStack: m } of l)
3304
+ try {
3305
+ e.stack = m;
3306
+ let E = await c(f, t, e, r);
3307
+ E && i.set(F, E);
3308
+ } catch (E) {
3309
+ if (globalThis.PRETTIER_DEBUG) throw E;
3310
+ }
3311
+ e.stack = d;
3312
+ function f(c, F) {
3313
+ return ki(c, F, r, n);
3314
+ }
3315
+ function p() {
3316
+ let { node: c } = e;
3317
+ if (c === null || typeof c != "object" || s(e)) return;
3318
+ for (let m of D(c)) Array.isArray(c[m]) ? e.each(p, m) : e.call(p, m);
3319
+ let F = o(e, r);
3320
+ if (F) {
3321
+ if (typeof F == "function") {
3322
+ l.push({ print: F, node: c, pathStack: [...e.stack] });
3323
+ return;
3324
+ }
3325
+ i.set(c, F);
3326
+ }
3327
+ }
3328
+ }
3329
+ async function ki(e, t, r, n) {
3330
+ let i = await se(
3331
+ { ...r, ...t, parentParser: r.parser, originalText: e },
3332
+ { passThrough: !0 },
3333
+ ),
3334
+ { ast: u } = await ce(e, i),
3335
+ o = await n(u, i);
3336
+ return Ze(o);
3337
+ }
3338
+ function Li(e, t) {
3339
+ let {
3340
+ originalText: r,
3341
+ [Symbol.for("comments")]: n,
3342
+ locStart: i,
3343
+ locEnd: u,
3344
+ [Symbol.for("printedComments")]: o,
3345
+ } = t,
3346
+ { node: s } = e,
3347
+ a = i(s),
3348
+ D = u(s);
3349
+ for (let l of n) i(l) >= a && u(l) <= D && o.add(l);
3350
+ return r.slice(a, D);
3351
+ }
3352
+ var zn = Li;
3353
+ async function Ye(e, t) {
3354
+ ({ ast: e } = await Qt(e, t));
3355
+ let r = new Map(),
3356
+ n = new Mr(e),
3357
+ i = tn(t),
3358
+ u = new Map();
3359
+ await Un(n, s, t, Ye, u);
3360
+ let o = await Gn(n, t, s, void 0, u);
3361
+ return en(t), o;
3362
+ function s(D, l) {
3363
+ return D === void 0 || D === n
3364
+ ? a(l)
3365
+ : Array.isArray(D)
3366
+ ? n.call(() => a(l), ...D)
3367
+ : n.call(() => a(l), D);
3368
+ }
3369
+ function a(D) {
3370
+ i(n);
3371
+ let l = n.node;
3372
+ if (l == null) return "";
3373
+ let d = l && typeof l == "object" && D === void 0;
3374
+ if (d && r.has(l)) return r.get(l);
3375
+ let f = Gn(n, t, s, D, u);
3376
+ return d && r.set(l, f), f;
3377
+ }
3378
+ }
3379
+ function Gn(e, t, r, n, i) {
3380
+ var a;
3381
+ let { node: u } = e,
3382
+ { printer: o } = t,
3383
+ s;
3384
+ return (
3385
+ (a = o.hasPrettierIgnore) != null && a.call(o, e)
3386
+ ? (s = zn(e, t))
3387
+ : i.has(u)
3388
+ ? (s = i.get(u))
3389
+ : (s = o.print(e, t, r, n)),
3390
+ u === t.cursorNode && (s = Qe(s, (D) => [ve, D, ve])),
3391
+ o.printComment &&
3392
+ (!o.willPrintOwnComments || !o.willPrintOwnComments(e, t)) &&
3393
+ (s = Qr(e, s, t)),
3394
+ s
3395
+ );
3396
+ }
3397
+ async function Qt(e, t) {
3398
+ let r = e.comments ?? [];
3399
+ (t[Symbol.for("comments")] = r),
3400
+ (t[Symbol.for("tokens")] = e.tokens ?? []),
3401
+ (t[Symbol.for("printedComments")] = new Set()),
3402
+ Jr(e, t);
3403
+ let {
3404
+ printer: { preprocess: n },
3405
+ } = t;
3406
+ return (e = n ? await n(e, t) : e), { ast: e, comments: r };
3407
+ }
3408
+ function Pi(e, t) {
3409
+ let { cursorOffset: r, locStart: n, locEnd: i } = t,
3410
+ u = X(t.printer.getVisitorKeys),
3411
+ o = (a) => n(a) <= r && i(a) >= r,
3412
+ s = e;
3413
+ for (let a of Ur(e, { getVisitorKeys: u, filter: o })) s = a;
3414
+ return s;
3415
+ }
3416
+ var Kn = Pi;
3417
+ function Ii(e, t) {
3418
+ let {
3419
+ printer: { massageAstNode: r, getVisitorKeys: n },
3420
+ } = t;
3421
+ if (!r) return e;
3422
+ let i = X(n),
3423
+ u = r.ignoredProperties ?? new Set();
3424
+ return o(e);
3425
+ function o(s, a) {
3426
+ if (!(s !== null && typeof s == "object")) return s;
3427
+ if (Array.isArray(s)) return s.map((f) => o(f, a)).filter(Boolean);
3428
+ let D = {},
3429
+ l = new Set(i(s));
3430
+ for (let f in s)
3431
+ !Object.prototype.hasOwnProperty.call(s, f) ||
3432
+ u.has(f) ||
3433
+ (l.has(f) ? (D[f] = o(s[f], s)) : (D[f] = s[f]));
3434
+ let d = r(s, D, a);
3435
+ if (d !== null) return d ?? D;
3436
+ }
3437
+ }
3438
+ var qn = Ii;
3439
+ var Ri = (e, t, r) => {
3440
+ if (!(e && t == null)) {
3441
+ if (t.findLastIndex) return t.findLastIndex(r);
3442
+ for (let n = t.length - 1; n >= 0; n--) {
3443
+ let i = t[n];
3444
+ if (r(i, n, t)) return n;
3445
+ }
3446
+ return -1;
3447
+ }
3448
+ },
3449
+ Jn = Ri;
3450
+ var Yi = ({ parser: e }) =>
3451
+ e === "json" || e === "json5" || e === "jsonc" || e === "json-stringify";
3452
+ function ji(e, t) {
3453
+ let r = [e.node, ...e.parentNodes],
3454
+ n = new Set([t.node, ...t.parentNodes]);
3455
+ return r.find((i) => Qn.has(i.type) && n.has(i));
3456
+ }
3457
+ function Xn(e) {
3458
+ let t = Jn(!1, e, (r) => r.type !== "Program" && r.type !== "File");
3459
+ return t === -1 ? e : e.slice(0, t + 1);
3460
+ }
3461
+ function Hi(e, t, { locStart: r, locEnd: n }) {
3462
+ let i = e.node,
3463
+ u = t.node;
3464
+ if (i === u) return { startNode: i, endNode: u };
3465
+ let o = r(e.node);
3466
+ for (let a of Xn(t.parentNodes))
3467
+ if (r(a) >= o) u = a;
3468
+ else break;
3469
+ let s = n(t.node);
3470
+ for (let a of Xn(e.parentNodes)) {
3471
+ if (n(a) <= s) i = a;
3472
+ else break;
3473
+ if (i === u) break;
3474
+ }
3475
+ return { startNode: i, endNode: u };
3476
+ }
3477
+ function er(e, t, r, n, i = [], u) {
3478
+ let { locStart: o, locEnd: s } = r,
3479
+ a = o(e),
3480
+ D = s(e);
3481
+ if (
3482
+ !(
3483
+ t > D ||
3484
+ t < a ||
3485
+ (u === "rangeEnd" && t === a) ||
3486
+ (u === "rangeStart" && t === D)
3487
+ )
3488
+ ) {
3489
+ for (let l of ut(e, r)) {
3490
+ let d = er(l, t, r, n, [e, ...i], u);
3491
+ if (d) return d;
3492
+ }
3493
+ if (!n || n(e, i[0])) return { node: e, parentNodes: i };
3494
+ }
3495
+ }
3496
+ function Wi(e, t) {
3497
+ return (
3498
+ t !== "DeclareExportDeclaration" &&
3499
+ e !== "TypeParameterDeclaration" &&
3500
+ (e === "Directive" ||
3501
+ e === "TypeAlias" ||
3502
+ e === "TSExportAssignment" ||
3503
+ e.startsWith("Declare") ||
3504
+ e.startsWith("TSDeclare") ||
3505
+ e.endsWith("Statement") ||
3506
+ e.endsWith("Declaration"))
3507
+ );
3508
+ }
3509
+ var Qn = new Set([
3510
+ "JsonRoot",
3511
+ "ObjectExpression",
3512
+ "ArrayExpression",
3513
+ "StringLiteral",
3514
+ "NumericLiteral",
3515
+ "BooleanLiteral",
3516
+ "NullLiteral",
3517
+ "UnaryExpression",
3518
+ "TemplateLiteral",
3519
+ ]),
3520
+ Mi = new Set([
3521
+ "OperationDefinition",
3522
+ "FragmentDefinition",
3523
+ "VariableDefinition",
3524
+ "TypeExtensionDefinition",
3525
+ "ObjectTypeDefinition",
3526
+ "FieldDefinition",
3527
+ "DirectiveDefinition",
3528
+ "EnumTypeDefinition",
3529
+ "EnumValueDefinition",
3530
+ "InputValueDefinition",
3531
+ "InputObjectTypeDefinition",
3532
+ "SchemaDefinition",
3533
+ "OperationTypeDefinition",
3534
+ "InterfaceTypeDefinition",
3535
+ "UnionTypeDefinition",
3536
+ "ScalarTypeDefinition",
3537
+ ]);
3538
+ function Zn(e, t, r) {
3539
+ if (!t) return !1;
3540
+ switch (e.parser) {
3541
+ case "flow":
3542
+ case "babel":
3543
+ case "babel-flow":
3544
+ case "babel-ts":
3545
+ case "typescript":
3546
+ case "acorn":
3547
+ case "espree":
3548
+ case "meriyah":
3549
+ case "__babel_estree":
3550
+ return Wi(t.type, r == null ? void 0 : r.type);
3551
+ case "json":
3552
+ case "json5":
3553
+ case "jsonc":
3554
+ case "json-stringify":
3555
+ return Qn.has(t.type);
3556
+ case "graphql":
3557
+ return Mi.has(t.kind);
3558
+ case "vue":
3559
+ return t.tag !== "root";
3560
+ }
3561
+ return !1;
3562
+ }
3563
+ function eu(e, t, r) {
3564
+ let { rangeStart: n, rangeEnd: i, locStart: u, locEnd: o } = t;
3565
+ ke.ok(i > n);
3566
+ let s = e.slice(n, i).search(/\S/u),
3567
+ a = s === -1;
3568
+ if (!a) for (n += s; i > n && !/\S/u.test(e[i - 1]); --i);
3569
+ let D = er(r, n, t, (p, c) => Zn(t, p, c), [], "rangeStart"),
3570
+ l = a ? D : er(r, i, t, (p) => Zn(t, p), [], "rangeEnd");
3571
+ if (!D || !l) return { rangeStart: 0, rangeEnd: 0 };
3572
+ let d, f;
3573
+ if (Yi(t)) {
3574
+ let p = ji(D, l);
3575
+ (d = p), (f = p);
3576
+ } else ({ startNode: d, endNode: f } = Hi(D, l, t));
3577
+ return { rangeStart: Math.min(u(d), u(f)), rangeEnd: Math.max(o(d), o(f)) };
3578
+ }
3579
+ var uu = "\uFEFF",
3580
+ tu = Symbol("cursor");
3581
+ async function iu(e, t, r = 0) {
3582
+ if (!e || e.trim().length === 0)
3583
+ return { formatted: "", cursorOffset: -1, comments: [] };
3584
+ let { ast: n, text: i } = await ce(e, t);
3585
+ t.cursorOffset >= 0 && (t.cursorNode = Kn(n, t));
3586
+ let u = await Ye(n, t, r);
3587
+ r > 0 && (u = Je([q, u], r, t.tabWidth));
3588
+ let o = Fe(u, t);
3589
+ if (r > 0) {
3590
+ let a = o.formatted.trim();
3591
+ o.cursorNodeStart !== void 0 &&
3592
+ (o.cursorNodeStart -= o.formatted.indexOf(a)),
3593
+ (o.formatted = a + Be(t.endOfLine));
3594
+ }
3595
+ let s = t[Symbol.for("comments")];
3596
+ if (t.cursorOffset >= 0) {
3597
+ let a, D, l, d, f;
3598
+ if (
3599
+ (t.cursorNode && o.cursorNodeText
3600
+ ? ((a = t.locStart(t.cursorNode)),
3601
+ (D = i.slice(a, t.locEnd(t.cursorNode))),
3602
+ (l = t.cursorOffset - a),
3603
+ (d = o.cursorNodeStart),
3604
+ (f = o.cursorNodeText))
3605
+ : ((a = 0),
3606
+ (D = i),
3607
+ (l = t.cursorOffset),
3608
+ (d = 0),
3609
+ (f = o.formatted)),
3610
+ D === f)
3611
+ )
3612
+ return { formatted: o.formatted, cursorOffset: d + l, comments: s };
3613
+ let p = D.split("");
3614
+ p.splice(l, 0, tu);
3615
+ let c = f.split(""),
3616
+ F = dr(p, c),
3617
+ m = d;
3618
+ for (let E of F)
3619
+ if (E.removed) {
3620
+ if (E.value.includes(tu)) break;
3621
+ } else m += E.count;
3622
+ return { formatted: o.formatted, cursorOffset: m, comments: s };
3623
+ }
3624
+ return { formatted: o.formatted, cursorOffset: -1, comments: s };
3625
+ }
3626
+ async function $i(e, t) {
3627
+ let { ast: r, text: n } = await ce(e, t),
3628
+ { rangeStart: i, rangeEnd: u } = eu(n, t, r),
3629
+ o = n.slice(i, u),
3630
+ s = Math.min(
3631
+ i,
3632
+ n.lastIndexOf(
3633
+ `
3634
+ `,
3635
+ i,
3636
+ ) + 1,
3637
+ ),
3638
+ a = n.slice(s, i).match(/^\s*/u)[0],
3639
+ D = me(a, t.tabWidth),
3640
+ l = await iu(
3641
+ o,
3642
+ {
3643
+ ...t,
3644
+ rangeStart: 0,
3645
+ rangeEnd: Number.POSITIVE_INFINITY,
3646
+ cursorOffset:
3647
+ t.cursorOffset > i && t.cursorOffset <= u ? t.cursorOffset - i : -1,
3648
+ endOfLine: "lf",
3649
+ },
3650
+ D,
3651
+ ),
3652
+ d = l.formatted.trimEnd(),
3653
+ { cursorOffset: f } = t;
3654
+ f > u
3655
+ ? (f += d.length - o.length)
3656
+ : l.cursorOffset >= 0 && (f = l.cursorOffset + i);
3657
+ let p = n.slice(0, i) + d + n.slice(u);
3658
+ if (t.endOfLine !== "lf") {
3659
+ let c = Be(t.endOfLine);
3660
+ f >= 0 &&
3661
+ c ===
3662
+ `\r
3663
+ ` &&
3664
+ (f += wt(
3665
+ p.slice(0, f),
3666
+ `
3667
+ `,
3668
+ )),
3669
+ (p = ne(
3670
+ !1,
3671
+ p,
3672
+ `
3673
+ `,
3674
+ c,
3675
+ ));
3676
+ }
3677
+ return { formatted: p, cursorOffset: f, comments: l.comments };
3678
+ }
3679
+ function tr(e, t, r) {
3680
+ return typeof t != "number" || Number.isNaN(t) || t < 0 || t > e.length
3681
+ ? r
3682
+ : t;
3683
+ }
3684
+ function ru(e, t) {
3685
+ let { cursorOffset: r, rangeStart: n, rangeEnd: i } = t;
3686
+ return (
3687
+ (r = tr(e, r, -1)),
3688
+ (n = tr(e, n, 0)),
3689
+ (i = tr(e, i, e.length)),
3690
+ { ...t, cursorOffset: r, rangeStart: n, rangeEnd: i }
3691
+ );
3692
+ }
3693
+ function ou(e, t) {
3694
+ let {
3695
+ cursorOffset: r,
3696
+ rangeStart: n,
3697
+ rangeEnd: i,
3698
+ endOfLine: u,
3699
+ } = ru(e, t),
3700
+ o = e.charAt(0) === uu;
3701
+ if (
3702
+ (o && ((e = e.slice(1)), r--, n--, i--),
3703
+ u === "auto" && (u = Fr(e)),
3704
+ e.includes("\r"))
3705
+ ) {
3706
+ let s = (a) =>
3707
+ wt(
3708
+ e.slice(0, Math.max(a, 0)),
3709
+ `\r
3710
+ `,
3711
+ );
3712
+ (r -= s(r)), (n -= s(n)), (i -= s(i)), (e = mr(e));
3713
+ }
3714
+ return {
3715
+ hasBOM: o,
3716
+ text: e,
3717
+ options: ru(e, {
3718
+ ...t,
3719
+ cursorOffset: r,
3720
+ rangeStart: n,
3721
+ rangeEnd: i,
3722
+ endOfLine: u,
3723
+ }),
3724
+ };
3725
+ }
3726
+ async function nu(e, t) {
3727
+ let r = await ht(t);
3728
+ return !r.hasPragma || r.hasPragma(e);
3729
+ }
3730
+ async function rr(e, t) {
3731
+ let { hasBOM: r, text: n, options: i } = ou(e, await se(t));
3732
+ if (
3733
+ (i.rangeStart >= i.rangeEnd && n !== "") ||
3734
+ (i.requirePragma && !(await nu(n, i)))
3735
+ )
3736
+ return { formatted: e, cursorOffset: t.cursorOffset, comments: [] };
3737
+ let u;
3738
+ return (
3739
+ i.rangeStart > 0 || i.rangeEnd < n.length
3740
+ ? (u = await $i(n, i))
3741
+ : (!i.requirePragma &&
3742
+ i.insertPragma &&
3743
+ i.printer.insertPragma &&
3744
+ !(await nu(n, i)) &&
3745
+ (n = i.printer.insertPragma(n)),
3746
+ (u = await iu(n, i))),
3747
+ r &&
3748
+ ((u.formatted = uu + u.formatted),
3749
+ u.cursorOffset >= 0 && u.cursorOffset++),
3750
+ u
3751
+ );
3752
+ }
3753
+ async function su(e, t, r) {
3754
+ let { text: n, options: i } = ou(e, await se(t)),
3755
+ u = await ce(n, i);
3756
+ return (
3757
+ r &&
3758
+ (r.preprocessForPrint && (u.ast = await Qt(u.ast, i)),
3759
+ r.massage && (u.ast = qn(u.ast, i))),
3760
+ u
3761
+ );
3762
+ }
3763
+ async function au(e, t) {
3764
+ t = await se(t);
3765
+ let r = await Ye(e, t);
3766
+ return Fe(r, t);
3767
+ }
3768
+ async function Du(e, t) {
3769
+ let r = Or(e),
3770
+ { formatted: n } = await rr(r, { ...t, parser: "__js_expression" });
3771
+ return n;
3772
+ }
3773
+ async function lu(e, t) {
3774
+ t = await se(t);
3775
+ let { ast: r } = await ce(e, t);
3776
+ return Ye(r, t);
3777
+ }
3778
+ async function cu(e, t) {
3779
+ return Fe(e, await se(t));
3780
+ }
3781
+ var nr = {};
3782
+ We(nr, { builders: () => Ui, printer: () => zi, utils: () => Gi });
3783
+ var Ui = {
3784
+ join: be,
3785
+ line: Ke,
3786
+ softline: vr,
3787
+ hardline: q,
3788
+ literalline: qe,
3789
+ group: xt,
3790
+ conditionalGroup: Ar,
3791
+ fill: Ge,
3792
+ lineSuffix: _e,
3793
+ lineSuffixBoundary: _r,
3794
+ cursor: ve,
3795
+ breakParent: de,
3796
+ ifBreak: Br,
3797
+ trim: xr,
3798
+ indent: De,
3799
+ indentIfBreak: wr,
3800
+ align: ae,
3801
+ addAlignmentToDoc: Je,
3802
+ markAsRoot: gr,
3803
+ dedentToRoot: Cr,
3804
+ dedent: yr,
3805
+ hardlineWithoutBreakParent: xe,
3806
+ literallineWithoutBreakParent: vt,
3807
+ label: br,
3808
+ concat: (e) => e,
3809
+ },
3810
+ zi = { printDocToString: Fe },
3811
+ Gi = {
3812
+ willBreak: Ir,
3813
+ traverseDoc: we,
3814
+ findInDoc: Xe,
3815
+ mapDoc: Ne,
3816
+ removeLines: Yr,
3817
+ stripTrailingHardline: Ze,
3818
+ replaceEndOfLine: jr,
3819
+ canBreak: Hr,
3820
+ };
3821
+ var fu = "3.3.3";
3822
+ var ir = {};
3823
+ We(ir, {
3824
+ addDanglingComment: () => re,
3825
+ addLeadingComment: () => ue,
3826
+ addTrailingComment: () => ie,
3827
+ getAlignmentSize: () => me,
3828
+ getIndentSize: () => pu,
3829
+ getMaxContinuousCount: () => du,
3830
+ getNextNonSpaceNonCommentCharacter: () => Fu,
3831
+ getNextNonSpaceNonCommentCharacterIndex: () => io,
3832
+ getStringWidth: () => Oe,
3833
+ hasNewline: () => V,
3834
+ hasNewlineInRange: () => mu,
3835
+ hasSpaces: () => Eu,
3836
+ isNextLineEmpty: () => Do,
3837
+ isNextLineEmptyAfterIndex: () => gt,
3838
+ isPreviousLineEmpty: () => so,
3839
+ makeString: () => hu,
3840
+ skip: () => Ee,
3841
+ skipEverythingButNewLine: () => nt,
3842
+ skipInlineComment: () => Ce,
3843
+ skipNewline: () => M,
3844
+ skipSpaces: () => T,
3845
+ skipToLineEnd: () => rt,
3846
+ skipTrailingComment: () => ge,
3847
+ skipWhitespace: () => zr,
3848
+ });
3849
+ function Ki(e, t) {
3850
+ if (t === !1) return !1;
3851
+ if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
3852
+ for (let r = t + 2; r < e.length; ++r)
3853
+ if (e.charAt(r) === "*" && e.charAt(r + 1) === "/") return r + 2;
3854
+ }
3855
+ return t;
3856
+ }
3857
+ var Ce = Ki;
3858
+ function qi(e, t) {
3859
+ return t === !1
3860
+ ? !1
3861
+ : e.charAt(t) === "/" && e.charAt(t + 1) === "/"
3862
+ ? nt(e, t)
3863
+ : t;
3864
+ }
3865
+ var ge = qi;
3866
+ function Ji(e, t) {
3867
+ let r = null,
3868
+ n = t;
3869
+ for (; n !== r; )
3870
+ (r = n), (n = T(e, n)), (n = Ce(e, n)), (n = ge(e, n)), (n = M(e, n));
3871
+ return n;
3872
+ }
3873
+ var je = Ji;
3874
+ function Xi(e, t) {
3875
+ let r = null,
3876
+ n = t;
3877
+ for (; n !== r; ) (r = n), (n = rt(e, n)), (n = Ce(e, n)), (n = T(e, n));
3878
+ return (n = ge(e, n)), (n = M(e, n)), n !== !1 && V(e, n);
3879
+ }
3880
+ var gt = Xi;
3881
+ function Zi(e, t) {
3882
+ let r = e.lastIndexOf(`
3883
+ `);
3884
+ return r === -1 ? 0 : me(e.slice(r + 1).match(/^[\t ]*/u)[0], t);
3885
+ }
3886
+ var pu = Zi;
3887
+ function ur(e) {
3888
+ if (typeof e != "string") throw new TypeError("Expected a string");
3889
+ return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
3890
+ }
3891
+ function Qi(e, t) {
3892
+ let r = e.match(new RegExp(`(${ur(t)})+`, "gu"));
3893
+ return r === null
3894
+ ? 0
3895
+ : r.reduce((n, i) => Math.max(n, i.length / t.length), 0);
3896
+ }
3897
+ var du = Qi;
3898
+ function eo(e, t) {
3899
+ let r = je(e, t);
3900
+ return r === !1 ? "" : e.charAt(r);
3901
+ }
3902
+ var Fu = eo;
3903
+ function to(e, t, r) {
3904
+ for (let n = t; n < r; ++n)
3905
+ if (
3906
+ e.charAt(n) ===
3907
+ `
3908
+ `
3909
+ )
3910
+ return !0;
3911
+ return !1;
3912
+ }
3913
+ var mu = to;
3914
+ function ro(e, t, r = {}) {
3915
+ return T(e, r.backwards ? t - 1 : t, r) !== t;
3916
+ }
3917
+ var Eu = ro;
3918
+ function no(e, t, r) {
3919
+ let n = t === '"' ? "'" : '"',
3920
+ u = ne(!1, e, /\\(.)|(["'])/gsu, (o, s, a) =>
3921
+ s === n
3922
+ ? s
3923
+ : a === t
3924
+ ? "\\" + a
3925
+ : a ||
3926
+ (r && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(s)
3927
+ ? s
3928
+ : "\\" + s),
3929
+ );
3930
+ return t + u + t;
3931
+ }
3932
+ var hu = no;
3933
+ function uo(e, t, r) {
3934
+ return je(e, r(t));
3935
+ }
3936
+ function io(e, t) {
3937
+ return arguments.length === 2 || typeof t == "number"
3938
+ ? je(e, t)
3939
+ : uo(...arguments);
3940
+ }
3941
+ function oo(e, t, r) {
3942
+ return Le(e, r(t));
3943
+ }
3944
+ function so(e, t) {
3945
+ return arguments.length === 2 || typeof t == "number"
3946
+ ? Le(e, t)
3947
+ : oo(...arguments);
3948
+ }
3949
+ function ao(e, t, r) {
3950
+ return gt(e, r(t));
3951
+ }
3952
+ function Do(e, t) {
3953
+ return arguments.length === 2 || typeof t == "number"
3954
+ ? gt(e, t)
3955
+ : ao(...arguments);
3956
+ }
3957
+ function fe(e, t = 1) {
3958
+ return async (...r) => {
3959
+ let n = r[t] ?? {},
3960
+ i = n.plugins ?? [];
3961
+ return (
3962
+ (r[t] = { ...n, plugins: Array.isArray(i) ? i : Object.values(i) }),
3963
+ e(...r)
3964
+ );
3965
+ };
3966
+ }
3967
+ var Cu = fe(rr);
3968
+ async function gu(e, t) {
3969
+ let { formatted: r } = await Cu(e, { ...t, cursorOffset: -1 });
3970
+ return r;
3971
+ }
3972
+ async function lo(e, t) {
3973
+ return (await gu(e, t)) === e;
3974
+ }
3975
+ var co = fe(it, 0),
3976
+ fo = {
3977
+ parse: fe(su),
3978
+ formatAST: fe(au),
3979
+ formatDoc: fe(Du),
3980
+ printToDoc: fe(lu),
3981
+ printDocToString: fe(cu),
3982
+ };
3983
+ return ar(po);
3984
+ });