vite-plugin-norg 1.3.6 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/napi/index.js +52 -52
- package/dist/napi/index.linux-x64-gnu.node +0 -0
- package/dist/plugin/index.js +181 -181
- package/package.json +3 -3
package/dist/plugin/index.js
CHANGED
|
@@ -52,10 +52,10 @@ function Lr(t) {
|
|
|
52
52
|
const e = Object.values(t).filter((r) => typeof r == "number");
|
|
53
53
|
return Object.entries(t).filter(([r, o]) => e.indexOf(+r) === -1).map(([r, o]) => o);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function st(t, e) {
|
|
56
56
|
return typeof e == "bigint" ? e.toString() : e;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function vt(t) {
|
|
59
59
|
return {
|
|
60
60
|
get value() {
|
|
61
61
|
{
|
|
@@ -65,10 +65,10 @@ function St(t) {
|
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function St(t) {
|
|
69
69
|
return t == null;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function kt(t) {
|
|
72
72
|
const e = t.startsWith("^") ? 1 : 0, n = t.endsWith("$") ? t.length - 1 : t.length;
|
|
73
73
|
return t.slice(e, n);
|
|
74
74
|
}
|
|
@@ -113,7 +113,7 @@ const Ln = "captureStackTrace" in Error ? Error.captureStackTrace : (...t) => {
|
|
|
113
113
|
function Le(t) {
|
|
114
114
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
115
115
|
}
|
|
116
|
-
const xr =
|
|
116
|
+
const xr = vt(() => {
|
|
117
117
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
118
118
|
return !1;
|
|
119
119
|
try {
|
|
@@ -306,7 +306,7 @@ function Y(t, e, n) {
|
|
|
306
306
|
}
|
|
307
307
|
return delete r.inst, delete r.continue, e?.reportInput || delete r.input, r;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function Ct(t) {
|
|
310
310
|
return Array.isArray(t) ? "array" : typeof t == "string" ? "string" : "unknown";
|
|
311
311
|
}
|
|
312
312
|
function fe(...t) {
|
|
@@ -325,7 +325,7 @@ const In = (t, e) => {
|
|
|
325
325
|
}), Object.defineProperty(t, "issues", {
|
|
326
326
|
value: e,
|
|
327
327
|
enumerable: !1
|
|
328
|
-
}), t.message = JSON.stringify(e,
|
|
328
|
+
}), t.message = JSON.stringify(e, st, 2), Object.defineProperty(t, "toString", {
|
|
329
329
|
value: () => t.message,
|
|
330
330
|
enumerable: !1
|
|
331
331
|
});
|
|
@@ -357,7 +357,7 @@ function Hr(t, e = (n) => n.message) {
|
|
|
357
357
|
};
|
|
358
358
|
return r(t), n;
|
|
359
359
|
}
|
|
360
|
-
const
|
|
360
|
+
const Tt = (t) => (e, n, r, o) => {
|
|
361
361
|
const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = e._zod.run({ value: n, issues: [] }, i);
|
|
362
362
|
if (s instanceof Promise)
|
|
363
363
|
throw new oe();
|
|
@@ -366,7 +366,7 @@ const Pt = (t) => (e, n, r, o) => {
|
|
|
366
366
|
throw Ln(a, o?.callee), a;
|
|
367
367
|
}
|
|
368
368
|
return s.value;
|
|
369
|
-
},
|
|
369
|
+
}, Pt = (t) => async (e, n, r, o) => {
|
|
370
370
|
const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
371
371
|
let s = e._zod.run({ value: n, issues: [] }, i);
|
|
372
372
|
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
@@ -374,7 +374,7 @@ const Pt = (t) => (e, n, r, o) => {
|
|
|
374
374
|
throw Ln(a, o?.callee), a;
|
|
375
375
|
}
|
|
376
376
|
return s.value;
|
|
377
|
-
},
|
|
377
|
+
}, Fe = (t) => (e, n, r) => {
|
|
378
378
|
const o = r ? { ...r, async: !1 } : { async: !1 }, i = e._zod.run({ value: n, issues: [] }, o);
|
|
379
379
|
if (i instanceof Promise)
|
|
380
380
|
throw new oe();
|
|
@@ -382,33 +382,33 @@ const Pt = (t) => (e, n, r, o) => {
|
|
|
382
382
|
success: !1,
|
|
383
383
|
error: new (t ?? zn)(i.issues.map((s) => Y(s, o, J())))
|
|
384
384
|
} : { success: !0, data: i.value };
|
|
385
|
-
}, Wr = /* @__PURE__ */
|
|
385
|
+
}, Wr = /* @__PURE__ */ Fe($n), He = (t) => async (e, n, r) => {
|
|
386
386
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
387
387
|
let i = e._zod.run({ value: n, issues: [] }, o);
|
|
388
388
|
return i instanceof Promise && (i = await i), i.issues.length ? {
|
|
389
389
|
success: !1,
|
|
390
390
|
error: new t(i.issues.map((s) => Y(s, o, J())))
|
|
391
391
|
} : { success: !0, data: i.value };
|
|
392
|
-
}, Zr = /* @__PURE__ */
|
|
392
|
+
}, Zr = /* @__PURE__ */ He($n), qr = (t) => (e, n, r) => {
|
|
393
|
+
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
394
|
+
return Tt(t)(e, n, o);
|
|
395
|
+
}, Vr = (t) => (e, n, r) => Tt(t)(e, n, r), Kr = (t) => async (e, n, r) => {
|
|
393
396
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
394
397
|
return Pt(t)(e, n, o);
|
|
395
|
-
},
|
|
398
|
+
}, Jr = (t) => async (e, n, r) => Pt(t)(e, n, r), Yr = (t) => (e, n, r) => {
|
|
396
399
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
397
|
-
return
|
|
398
|
-
},
|
|
400
|
+
return Fe(t)(e, n, o);
|
|
401
|
+
}, Xr = (t) => (e, n, r) => Fe(t)(e, n, r), Qr = (t) => async (e, n, r) => {
|
|
399
402
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
400
403
|
return He(t)(e, n, o);
|
|
401
|
-
},
|
|
402
|
-
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
403
|
-
return We(t)(e, n, o);
|
|
404
|
-
}, eo = (t) => async (e, n, r) => We(t)(e, n, r), le = /* @__PURE__ */ S("$ZodCheck", (t, e) => {
|
|
404
|
+
}, eo = (t) => async (e, n, r) => He(t)(e, n, r), le = /* @__PURE__ */ S("$ZodCheck", (t, e) => {
|
|
405
405
|
var n;
|
|
406
406
|
t._zod ?? (t._zod = {}), t._zod.def = e, (n = t._zod).onattach ?? (n.onattach = []);
|
|
407
407
|
}), to = /* @__PURE__ */ S("$ZodCheckMaxLength", (t, e) => {
|
|
408
408
|
var n;
|
|
409
409
|
le.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
|
|
410
410
|
const o = r.value;
|
|
411
|
-
return !
|
|
411
|
+
return !St(o) && o.length !== void 0;
|
|
412
412
|
}), t._zod.onattach.push((r) => {
|
|
413
413
|
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
414
414
|
e.maximum < o && (r._zod.bag.maximum = e.maximum);
|
|
@@ -416,7 +416,7 @@ const Pt = (t) => (e, n, r, o) => {
|
|
|
416
416
|
const o = r.value;
|
|
417
417
|
if (o.length <= e.maximum)
|
|
418
418
|
return;
|
|
419
|
-
const s =
|
|
419
|
+
const s = Ct(o);
|
|
420
420
|
r.issues.push({
|
|
421
421
|
origin: s,
|
|
422
422
|
code: "too_big",
|
|
@@ -431,7 +431,7 @@ const Pt = (t) => (e, n, r, o) => {
|
|
|
431
431
|
var n;
|
|
432
432
|
le.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
|
|
433
433
|
const o = r.value;
|
|
434
|
-
return !
|
|
434
|
+
return !St(o) && o.length !== void 0;
|
|
435
435
|
}), t._zod.onattach.push((r) => {
|
|
436
436
|
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
437
437
|
e.minimum > o && (r._zod.bag.minimum = e.minimum);
|
|
@@ -439,7 +439,7 @@ const Pt = (t) => (e, n, r, o) => {
|
|
|
439
439
|
const o = r.value;
|
|
440
440
|
if (o.length >= e.minimum)
|
|
441
441
|
return;
|
|
442
|
-
const s =
|
|
442
|
+
const s = Ct(o);
|
|
443
443
|
r.issues.push({
|
|
444
444
|
origin: s,
|
|
445
445
|
code: "too_small",
|
|
@@ -454,7 +454,7 @@ const Pt = (t) => (e, n, r, o) => {
|
|
|
454
454
|
var n;
|
|
455
455
|
le.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
|
|
456
456
|
const o = r.value;
|
|
457
|
-
return !
|
|
457
|
+
return !St(o) && o.length !== void 0;
|
|
458
458
|
}), t._zod.onattach.push((r) => {
|
|
459
459
|
const o = r._zod.bag;
|
|
460
460
|
o.minimum = e.length, o.maximum = e.length, o.length = e.length;
|
|
@@ -462,7 +462,7 @@ const Pt = (t) => (e, n, r, o) => {
|
|
|
462
462
|
const o = r.value, i = o.length;
|
|
463
463
|
if (i === e.length)
|
|
464
464
|
return;
|
|
465
|
-
const s =
|
|
465
|
+
const s = Ct(o), a = i > e.length;
|
|
466
466
|
r.issues.push({
|
|
467
467
|
origin: s,
|
|
468
468
|
...a ? { code: "too_big", maximum: e.length } : { code: "too_small", minimum: e.length },
|
|
@@ -664,7 +664,7 @@ const po = /* @__PURE__ */ S("$ZodObject", (t, e) => {
|
|
|
664
664
|
}
|
|
665
665
|
});
|
|
666
666
|
}
|
|
667
|
-
const r =
|
|
667
|
+
const r = vt(() => Mn(e));
|
|
668
668
|
P(t._zod, "propValues", () => {
|
|
669
669
|
const a = e.shape, l = {};
|
|
670
670
|
for (const c in a) {
|
|
@@ -699,7 +699,7 @@ const po = /* @__PURE__ */ S("$ZodObject", (t, e) => {
|
|
|
699
699
|
};
|
|
700
700
|
}), ho = /* @__PURE__ */ S("$ZodObjectJIT", (t, e) => {
|
|
701
701
|
po.init(t, e);
|
|
702
|
-
const n = t._zod.parse, r =
|
|
702
|
+
const n = t._zod.parse, r = vt(() => Mn(e)), o = (h) => {
|
|
703
703
|
const d = new io(["shape", "payload", "ctx"]), m = r.value, _ = (f) => {
|
|
704
704
|
const v = Ft(f);
|
|
705
705
|
return `shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`;
|
|
@@ -768,7 +768,7 @@ const mo = /* @__PURE__ */ S("$ZodUnion", (t, e) => {
|
|
|
768
768
|
}), P(t._zod, "pattern", () => {
|
|
769
769
|
if (e.options.every((o) => o._zod.pattern)) {
|
|
770
770
|
const o = e.options.map((i) => i._zod.pattern);
|
|
771
|
-
return new RegExp(`^(${o.map((i) =>
|
|
771
|
+
return new RegExp(`^(${o.map((i) => kt(i.source)).join("|")})$`);
|
|
772
772
|
}
|
|
773
773
|
});
|
|
774
774
|
const n = e.options.length === 1, r = e.options[0]._zod.run;
|
|
@@ -798,7 +798,7 @@ const mo = /* @__PURE__ */ S("$ZodUnion", (t, e) => {
|
|
|
798
798
|
return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([l, c]) => Zt(n, l, c)) : Zt(n, i, s);
|
|
799
799
|
};
|
|
800
800
|
});
|
|
801
|
-
function
|
|
801
|
+
function at(t, e) {
|
|
802
802
|
if (t === e)
|
|
803
803
|
return { valid: !0, data: t };
|
|
804
804
|
if (t instanceof Date && e instanceof Date && +t == +e)
|
|
@@ -806,7 +806,7 @@ function lt(t, e) {
|
|
|
806
806
|
if (me(t) && me(e)) {
|
|
807
807
|
const n = Object.keys(e), r = Object.keys(t).filter((i) => n.indexOf(i) !== -1), o = { ...t, ...e };
|
|
808
808
|
for (const i of r) {
|
|
809
|
-
const s =
|
|
809
|
+
const s = at(t[i], e[i]);
|
|
810
810
|
if (!s.valid)
|
|
811
811
|
return {
|
|
812
812
|
valid: !1,
|
|
@@ -821,7 +821,7 @@ function lt(t, e) {
|
|
|
821
821
|
return { valid: !1, mergeErrorPath: [] };
|
|
822
822
|
const n = [];
|
|
823
823
|
for (let r = 0; r < t.length; r++) {
|
|
824
|
-
const o = t[r], i = e[r], s =
|
|
824
|
+
const o = t[r], i = e[r], s = at(o, i);
|
|
825
825
|
if (!s.valid)
|
|
826
826
|
return {
|
|
827
827
|
valid: !1,
|
|
@@ -836,7 +836,7 @@ function lt(t, e) {
|
|
|
836
836
|
function Zt(t, e, n) {
|
|
837
837
|
if (e.issues.length && t.issues.push(...e.issues), n.issues.length && t.issues.push(...n.issues), ne(t))
|
|
838
838
|
return t;
|
|
839
|
-
const r =
|
|
839
|
+
const r = at(e.value, n.value);
|
|
840
840
|
if (!r.valid)
|
|
841
841
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
|
|
842
842
|
return t.value = r.data, t;
|
|
@@ -871,7 +871,7 @@ function qt(t, e) {
|
|
|
871
871
|
const _o = /* @__PURE__ */ S("$ZodOptional", (t, e) => {
|
|
872
872
|
E.init(t, e), t._zod.optin = "optional", t._zod.optout = "optional", P(t._zod, "values", () => e.innerType._zod.values ? /* @__PURE__ */ new Set([...e.innerType._zod.values, void 0]) : void 0), P(t._zod, "pattern", () => {
|
|
873
873
|
const n = e.innerType._zod.pattern;
|
|
874
|
-
return n ? new RegExp(`^(${
|
|
874
|
+
return n ? new RegExp(`^(${kt(n.source)})?$`) : void 0;
|
|
875
875
|
}), t._zod.parse = (n, r) => {
|
|
876
876
|
if (e.innerType._zod.optin === "optional") {
|
|
877
877
|
const o = e.innerType._zod.run(n, r);
|
|
@@ -882,7 +882,7 @@ const _o = /* @__PURE__ */ S("$ZodOptional", (t, e) => {
|
|
|
882
882
|
}), bo = /* @__PURE__ */ S("$ZodNullable", (t, e) => {
|
|
883
883
|
E.init(t, e), P(t._zod, "optin", () => e.innerType._zod.optin), P(t._zod, "optout", () => e.innerType._zod.optout), P(t._zod, "pattern", () => {
|
|
884
884
|
const n = e.innerType._zod.pattern;
|
|
885
|
-
return n ? new RegExp(`^(${
|
|
885
|
+
return n ? new RegExp(`^(${kt(n.source)}|null)$`) : void 0;
|
|
886
886
|
}), P(t._zod, "values", () => e.innerType._zod.values ? /* @__PURE__ */ new Set([...e.innerType._zod.values, null]) : void 0), t._zod.parse = (n, r) => n.value === null ? n : e.innerType._zod.run(n, r);
|
|
887
887
|
}), wo = /* @__PURE__ */ S("$ZodDefault", (t, e) => {
|
|
888
888
|
E.init(t, e), t._zod.optin = "optional", P(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => {
|
|
@@ -1113,13 +1113,13 @@ const Do = (t, e) => {
|
|
|
1113
1113
|
},
|
|
1114
1114
|
addIssue: {
|
|
1115
1115
|
value: (n) => {
|
|
1116
|
-
t.issues.push(n), t.message = JSON.stringify(t.issues,
|
|
1116
|
+
t.issues.push(n), t.message = JSON.stringify(t.issues, st, 2);
|
|
1117
1117
|
}
|
|
1118
1118
|
// enumerable: false,
|
|
1119
1119
|
},
|
|
1120
1120
|
addIssues: {
|
|
1121
1121
|
value: (n) => {
|
|
1122
|
-
t.issues.push(...n), t.message = JSON.stringify(t.issues,
|
|
1122
|
+
t.issues.push(...n), t.message = JSON.stringify(t.issues, st, 2);
|
|
1123
1123
|
}
|
|
1124
1124
|
// enumerable: false,
|
|
1125
1125
|
},
|
|
@@ -1132,7 +1132,7 @@ const Do = (t, e) => {
|
|
|
1132
1132
|
});
|
|
1133
1133
|
}, G = S("ZodError", Do, {
|
|
1134
1134
|
Parent: Error
|
|
1135
|
-
}), Bo = /* @__PURE__ */
|
|
1135
|
+
}), Bo = /* @__PURE__ */ Tt(G), Go = /* @__PURE__ */ Pt(G), Uo = /* @__PURE__ */ Fe(G), Fo = /* @__PURE__ */ He(G), Ho = /* @__PURE__ */ qr(G), Wo = /* @__PURE__ */ Vr(G), Zo = /* @__PURE__ */ Kr(G), qo = /* @__PURE__ */ Jr(G), Vo = /* @__PURE__ */ Yr(G), Ko = /* @__PURE__ */ Xr(G), Jo = /* @__PURE__ */ Qr(G), Yo = /* @__PURE__ */ eo(G), O = /* @__PURE__ */ S("ZodType", (t, e) => (E.init(t, e), t.def = e, t.type = e.type, Object.defineProperty(t, "_def", { value: e }), t.check = (...n) => t.clone(Q(e, {
|
|
1136
1136
|
checks: [
|
|
1137
1137
|
...e.checks ?? [],
|
|
1138
1138
|
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
@@ -1153,7 +1153,7 @@ const Do = (t, e) => {
|
|
|
1153
1153
|
}, t.isOptional = () => t.safeParse(void 0).success, t.isNullable = () => t.safeParse(null).success, t)), Xo = /* @__PURE__ */ S("ZodAny", (t, e) => {
|
|
1154
1154
|
ao.init(t, e), O.init(t, e);
|
|
1155
1155
|
});
|
|
1156
|
-
function
|
|
1156
|
+
function Ye() {
|
|
1157
1157
|
return No(Xo);
|
|
1158
1158
|
}
|
|
1159
1159
|
const Qo = /* @__PURE__ */ S("ZodUnknown", (t, e) => {
|
|
@@ -1205,7 +1205,7 @@ function ci(t, e) {
|
|
|
1205
1205
|
right: e
|
|
1206
1206
|
});
|
|
1207
1207
|
}
|
|
1208
|
-
const
|
|
1208
|
+
const lt = /* @__PURE__ */ S("ZodEnum", (t, e) => {
|
|
1209
1209
|
go.init(t, e), O.init(t, e), t.enum = e.entries, t.options = Object.values(e.entries);
|
|
1210
1210
|
const n = new Set(Object.keys(e.entries));
|
|
1211
1211
|
t.extract = (r, o) => {
|
|
@@ -1215,7 +1215,7 @@ const ct = /* @__PURE__ */ S("ZodEnum", (t, e) => {
|
|
|
1215
1215
|
i[s] = e.entries[s];
|
|
1216
1216
|
else
|
|
1217
1217
|
throw new Error(`Key ${s} not found in enum`);
|
|
1218
|
-
return new
|
|
1218
|
+
return new lt({
|
|
1219
1219
|
...e,
|
|
1220
1220
|
checks: [],
|
|
1221
1221
|
...D(o),
|
|
@@ -1228,7 +1228,7 @@ const ct = /* @__PURE__ */ S("ZodEnum", (t, e) => {
|
|
|
1228
1228
|
delete i[s];
|
|
1229
1229
|
else
|
|
1230
1230
|
throw new Error(`Key ${s} not found in enum`);
|
|
1231
|
-
return new
|
|
1231
|
+
return new lt({
|
|
1232
1232
|
...e,
|
|
1233
1233
|
checks: [],
|
|
1234
1234
|
...D(o),
|
|
@@ -1238,7 +1238,7 @@ const ct = /* @__PURE__ */ S("ZodEnum", (t, e) => {
|
|
|
1238
1238
|
});
|
|
1239
1239
|
function Dn(t, e) {
|
|
1240
1240
|
const n = Array.isArray(t) ? Object.fromEntries(t.map((r) => [r, r])) : t;
|
|
1241
|
-
return new
|
|
1241
|
+
return new lt({
|
|
1242
1242
|
type: "enum",
|
|
1243
1243
|
entries: n,
|
|
1244
1244
|
...D(e)
|
|
@@ -1394,21 +1394,21 @@ let A = class extends Error {
|
|
|
1394
1394
|
}
|
|
1395
1395
|
};
|
|
1396
1396
|
function Ni(t) {
|
|
1397
|
-
return
|
|
1397
|
+
return Rt(t);
|
|
1398
1398
|
}
|
|
1399
|
-
function
|
|
1399
|
+
function Rt(t) {
|
|
1400
1400
|
return Array.isArray(t) ? Ei(t) : t instanceof RegExp ? t : typeof t == "object" ? Li(t) : t;
|
|
1401
1401
|
}
|
|
1402
1402
|
function Ei(t) {
|
|
1403
1403
|
let e = [];
|
|
1404
1404
|
for (let n = 0, r = t.length; n < r; n++)
|
|
1405
|
-
e[n] =
|
|
1405
|
+
e[n] = Rt(t[n]);
|
|
1406
1406
|
return e;
|
|
1407
1407
|
}
|
|
1408
1408
|
function Li(t) {
|
|
1409
1409
|
let e = {};
|
|
1410
1410
|
for (let n in t)
|
|
1411
|
-
e[n] =
|
|
1411
|
+
e[n] = Rt(t[n]);
|
|
1412
1412
|
return e;
|
|
1413
1413
|
}
|
|
1414
1414
|
function Un(t, ...e) {
|
|
@@ -1421,12 +1421,12 @@ function Fn(t) {
|
|
|
1421
1421
|
const e = ~t.lastIndexOf("/") || ~t.lastIndexOf("\\");
|
|
1422
1422
|
return e === 0 ? t : ~e === t.length - 1 ? Fn(t.substring(0, t.length - 1)) : t.substr(~e + 1);
|
|
1423
1423
|
}
|
|
1424
|
-
var
|
|
1424
|
+
var Xe = /\$(\d+)|\${(\d+):\/(downcase|upcase)}/g, Te = class {
|
|
1425
1425
|
static hasCaptures(t) {
|
|
1426
|
-
return t === null ? !1 : (
|
|
1426
|
+
return t === null ? !1 : (Xe.lastIndex = 0, Xe.test(t));
|
|
1427
1427
|
}
|
|
1428
1428
|
static replaceCaptures(t, e, n) {
|
|
1429
|
-
return t.replace(
|
|
1429
|
+
return t.replace(Xe, (r, o, i, s) => {
|
|
1430
1430
|
let a = n[parseInt(o || i, 10)];
|
|
1431
1431
|
if (a) {
|
|
1432
1432
|
let l = e.substring(a.start, a.end);
|
|
@@ -1514,7 +1514,7 @@ var qn = class {
|
|
|
1514
1514
|
r.background
|
|
1515
1515
|
) : null;
|
|
1516
1516
|
}
|
|
1517
|
-
},
|
|
1517
|
+
}, Qe = class Ne {
|
|
1518
1518
|
constructor(e, n) {
|
|
1519
1519
|
this.parent = e, this.scopeName = n;
|
|
1520
1520
|
}
|
|
@@ -1650,7 +1650,7 @@ function $i(t, e) {
|
|
|
1650
1650
|
let l = t.shift();
|
|
1651
1651
|
l.fontStyle !== -1 && (n = l.fontStyle), l.foreground !== null && (r = l.foreground), l.background !== null && (o = l.background);
|
|
1652
1652
|
}
|
|
1653
|
-
let i = new Mi(e), s = new Vn(n, i.getId(r), i.getId(o)), a = new Di(new
|
|
1653
|
+
let i = new Mi(e), s = new Vn(n, i.getId(r), i.getId(o)), a = new Di(new ct(0, null, -1, 0, 0), []);
|
|
1654
1654
|
for (let l = 0, c = t.length; l < c; l++) {
|
|
1655
1655
|
let u = t[l];
|
|
1656
1656
|
a.insert(0, u.scope, u.parentScopes, u.fontStyle, i.getId(u.foreground), i.getId(u.background));
|
|
@@ -1684,7 +1684,7 @@ var Mi = class {
|
|
|
1684
1684
|
getColorMap() {
|
|
1685
1685
|
return this._id2color.slice(0);
|
|
1686
1686
|
}
|
|
1687
|
-
}, ji = Object.freeze([]),
|
|
1687
|
+
}, ji = Object.freeze([]), ct = class Kn {
|
|
1688
1688
|
scopeDepth;
|
|
1689
1689
|
parentScopes;
|
|
1690
1690
|
fontStyle;
|
|
@@ -1705,7 +1705,7 @@ var Mi = class {
|
|
|
1705
1705
|
acceptOverwrite(e, n, r, o) {
|
|
1706
1706
|
this.scopeDepth > e ? console.log("how did this happen?") : this.scopeDepth = e, n !== -1 && (this.fontStyle = n), r !== 0 && (this.foreground = r), o !== 0 && (this.background = o);
|
|
1707
1707
|
}
|
|
1708
|
-
}, Di = class
|
|
1708
|
+
}, Di = class ut {
|
|
1709
1709
|
constructor(e, n = [], r = {}) {
|
|
1710
1710
|
this._mainRule = e, this._children = r, this._rulesWithParentScopes = n;
|
|
1711
1711
|
}
|
|
@@ -1729,7 +1729,7 @@ var Mi = class {
|
|
|
1729
1729
|
return this._children[o].match(i);
|
|
1730
1730
|
}
|
|
1731
1731
|
const n = this._rulesWithParentScopes.concat(this._mainRule);
|
|
1732
|
-
return n.sort(
|
|
1732
|
+
return n.sort(ut._cmpBySpecificity), n;
|
|
1733
1733
|
}
|
|
1734
1734
|
insert(e, n, r, o, i, s) {
|
|
1735
1735
|
if (n === "") {
|
|
@@ -1739,7 +1739,7 @@ var Mi = class {
|
|
|
1739
1739
|
let a = n.indexOf("."), l, c;
|
|
1740
1740
|
a === -1 ? (l = n, c = "") : (l = n.substring(0, a), c = n.substring(a + 1));
|
|
1741
1741
|
let u;
|
|
1742
|
-
this._children.hasOwnProperty(l) ? u = this._children[l] : (u = new
|
|
1742
|
+
this._children.hasOwnProperty(l) ? u = this._children[l] : (u = new ut(this._mainRule.clone(), ct.cloneArr(this._rulesWithParentScopes)), this._children[l] = u), u.insert(e + 1, c, r, o, i, s);
|
|
1743
1743
|
}
|
|
1744
1744
|
_doInsertHere(e, n, r, o, i) {
|
|
1745
1745
|
if (n === null) {
|
|
@@ -1753,7 +1753,7 @@ var Mi = class {
|
|
|
1753
1753
|
return;
|
|
1754
1754
|
}
|
|
1755
1755
|
}
|
|
1756
|
-
r === -1 && (r = this._mainRule.fontStyle), o === 0 && (o = this._mainRule.foreground), i === 0 && (i = this._mainRule.background), this._rulesWithParentScopes.push(new
|
|
1756
|
+
r === -1 && (r = this._mainRule.fontStyle), o === 0 && (o = this._mainRule.foreground), i === 0 && (i = this._mainRule.background), this._rulesWithParentScopes.push(new ct(e, n, r, o, i));
|
|
1757
1757
|
}
|
|
1758
1758
|
}, ae = class B {
|
|
1759
1759
|
static toBinaryStr(e) {
|
|
@@ -1934,7 +1934,7 @@ function Hi(t, e, n, r) {
|
|
|
1934
1934
|
return;
|
|
1935
1935
|
}
|
|
1936
1936
|
const i = n.lookup(e);
|
|
1937
|
-
t instanceof ge ? Ee({ baseGrammar: i, selfGrammar: o }, r) :
|
|
1937
|
+
t instanceof ge ? Ee({ baseGrammar: i, selfGrammar: o }, r) : pt(
|
|
1938
1938
|
t.ruleName,
|
|
1939
1939
|
{ baseGrammar: i, selfGrammar: o, repository: o.repository },
|
|
1940
1940
|
r
|
|
@@ -1944,7 +1944,7 @@ function Hi(t, e, n, r) {
|
|
|
1944
1944
|
for (const a of s)
|
|
1945
1945
|
r.add(new ge(a));
|
|
1946
1946
|
}
|
|
1947
|
-
function
|
|
1947
|
+
function pt(t, e, n) {
|
|
1948
1948
|
if (e.repository && e.repository[t]) {
|
|
1949
1949
|
const r = e.repository[t];
|
|
1950
1950
|
ze([r], e, n);
|
|
@@ -1980,14 +1980,14 @@ function ze(t, e, n) {
|
|
|
1980
1980
|
Ee(e, n);
|
|
1981
1981
|
break;
|
|
1982
1982
|
case 2:
|
|
1983
|
-
|
|
1983
|
+
pt(s.ruleName, { ...e, repository: o }, n);
|
|
1984
1984
|
break;
|
|
1985
1985
|
case 3:
|
|
1986
1986
|
case 4:
|
|
1987
1987
|
const a = s.scopeName === e.selfGrammar.scopeName ? e.selfGrammar : s.scopeName === e.baseGrammar.scopeName ? e.baseGrammar : void 0;
|
|
1988
1988
|
if (a) {
|
|
1989
1989
|
const l = { baseGrammar: e.baseGrammar, selfGrammar: a, repository: o };
|
|
1990
|
-
s.kind === 4 ?
|
|
1990
|
+
s.kind === 4 ? pt(s.ruleName, l, n) : Ee(l, n);
|
|
1991
1991
|
} else
|
|
1992
1992
|
s.kind === 4 ? n.add(new Gi(s.scopeName, s.ruleName)) : n.add(new ge(s.scopeName));
|
|
1993
1993
|
break;
|
|
@@ -2114,7 +2114,7 @@ var we = class {
|
|
|
2114
2114
|
_getCachedCompiledPatterns(t) {
|
|
2115
2115
|
return this._cachedCompiledPatterns || (this._cachedCompiledPatterns = new _e(), this.collectPatterns(t, this._cachedCompiledPatterns)), this._cachedCompiledPatterns;
|
|
2116
2116
|
}
|
|
2117
|
-
},
|
|
2117
|
+
}, ht = class extends we {
|
|
2118
2118
|
_begin;
|
|
2119
2119
|
beginCaptures;
|
|
2120
2120
|
_end;
|
|
@@ -2243,7 +2243,7 @@ var we = class {
|
|
|
2243
2243
|
e.while,
|
|
2244
2244
|
I._compileCaptures(e.whileCaptures || e.captures, n, r),
|
|
2245
2245
|
I._compilePatterns(e.patterns, n, r)
|
|
2246
|
-
) : new
|
|
2246
|
+
) : new ht(
|
|
2247
2247
|
e.$vscodeTextmateLocation,
|
|
2248
2248
|
e.id,
|
|
2249
2249
|
e.name,
|
|
@@ -2312,7 +2312,7 @@ var we = class {
|
|
|
2312
2312
|
if (l !== -1) {
|
|
2313
2313
|
const c = n.getRule(l);
|
|
2314
2314
|
let u = !1;
|
|
2315
|
-
if ((c instanceof ln || c instanceof
|
|
2315
|
+
if ((c instanceof ln || c instanceof ht || c instanceof $e) && c.hasMissingPatterns && c.patterns.length === 0 && (u = !0), u)
|
|
2316
2316
|
continue;
|
|
2317
2317
|
o.push(l);
|
|
2318
2318
|
}
|
|
@@ -2437,15 +2437,15 @@ var we = class {
|
|
|
2437
2437
|
captureIndices: r.captureIndices
|
|
2438
2438
|
} : null;
|
|
2439
2439
|
}
|
|
2440
|
-
},
|
|
2440
|
+
}, et = class {
|
|
2441
2441
|
constructor(t, e) {
|
|
2442
2442
|
this.languageId = t, this.tokenType = e;
|
|
2443
2443
|
}
|
|
2444
|
-
}, es = class
|
|
2444
|
+
}, es = class dt {
|
|
2445
2445
|
_defaultAttributes;
|
|
2446
2446
|
_embeddedLanguagesMatcher;
|
|
2447
2447
|
constructor(e, n) {
|
|
2448
|
-
this._defaultAttributes = new
|
|
2448
|
+
this._defaultAttributes = new et(
|
|
2449
2449
|
e,
|
|
2450
2450
|
8
|
|
2451
2451
|
/* NotSet */
|
|
@@ -2455,12 +2455,12 @@ var we = class {
|
|
|
2455
2455
|
return this._defaultAttributes;
|
|
2456
2456
|
}
|
|
2457
2457
|
getBasicScopeAttributes(e) {
|
|
2458
|
-
return e === null ?
|
|
2458
|
+
return e === null ? dt._NULL_SCOPE_METADATA : this._getBasicScopeAttributes.get(e);
|
|
2459
2459
|
}
|
|
2460
|
-
static _NULL_SCOPE_METADATA = new
|
|
2460
|
+
static _NULL_SCOPE_METADATA = new et(0, 0);
|
|
2461
2461
|
_getBasicScopeAttributes = new qn((e) => {
|
|
2462
2462
|
const n = this._scopeToLanguage(e), r = this._toStandardTokenType(e);
|
|
2463
|
-
return new
|
|
2463
|
+
return new et(n, r);
|
|
2464
2464
|
});
|
|
2465
2465
|
/**
|
|
2466
2466
|
* Given a produced TM scope, return the language that token describes or null if unknown.
|
|
@@ -2470,7 +2470,7 @@ var we = class {
|
|
|
2470
2470
|
return this._embeddedLanguagesMatcher.match(e) || 0;
|
|
2471
2471
|
}
|
|
2472
2472
|
_toStandardTokenType(e) {
|
|
2473
|
-
const n = e.match(
|
|
2473
|
+
const n = e.match(dt.STANDARD_TOKEN_TYPE_REGEXP);
|
|
2474
2474
|
if (!n)
|
|
2475
2475
|
return 8;
|
|
2476
2476
|
switch (n[1]) {
|
|
@@ -2583,7 +2583,7 @@ function tr(t, e, n, r, o, i, s, a) {
|
|
|
2583
2583
|
null,
|
|
2584
2584
|
v,
|
|
2585
2585
|
v
|
|
2586
|
-
), y instanceof
|
|
2586
|
+
), y instanceof ht) {
|
|
2587
2587
|
const C = y;
|
|
2588
2588
|
he(
|
|
2589
2589
|
t,
|
|
@@ -2937,7 +2937,7 @@ var us = class {
|
|
|
2937
2937
|
this._grammar.repository
|
|
2938
2938
|
), this.getInjections());
|
|
2939
2939
|
let o;
|
|
2940
|
-
if (!e || e ===
|
|
2940
|
+
if (!e || e === mt.NULL) {
|
|
2941
2941
|
o = !0;
|
|
2942
2942
|
const c = this._basicScopeAttributesProvider.getDefaultAttributes(), u = this.themeProvider.getDefaults(), p = ae.set(
|
|
2943
2943
|
0,
|
|
@@ -2959,7 +2959,7 @@ var us = class {
|
|
|
2959
2959
|
) : d = de.createRoot(
|
|
2960
2960
|
"unknown",
|
|
2961
2961
|
p
|
|
2962
|
-
), e = new
|
|
2962
|
+
), e = new mt(
|
|
2963
2963
|
null,
|
|
2964
2964
|
this._rootId,
|
|
2965
2965
|
-1,
|
|
@@ -3018,14 +3018,14 @@ var de = class U {
|
|
|
3018
3018
|
static fromExtension(e, n) {
|
|
3019
3019
|
let r = e, o = e?.scopePath ?? null;
|
|
3020
3020
|
for (const i of n)
|
|
3021
|
-
o =
|
|
3021
|
+
o = Qe.push(o, i.scopeNames), r = new U(r, o, i.encodedTokenAttributes);
|
|
3022
3022
|
return r;
|
|
3023
3023
|
}
|
|
3024
3024
|
static createRoot(e, n) {
|
|
3025
|
-
return new U(null, new
|
|
3025
|
+
return new U(null, new Qe(null, e), n);
|
|
3026
3026
|
}
|
|
3027
3027
|
static createRootAndLookUpScopeName(e, n, r) {
|
|
3028
|
-
const o = r.getMetadataForScope(e), i = new
|
|
3028
|
+
const o = r.getMetadataForScope(e), i = new Qe(null, e), s = r.themeProvider.themeMatch(i), a = U.mergeAttributes(
|
|
3029
3029
|
n,
|
|
3030
3030
|
o,
|
|
3031
3031
|
s
|
|
@@ -3094,7 +3094,7 @@ var de = class U {
|
|
|
3094
3094
|
}), r = r.parent;
|
|
3095
3095
|
return r === e ? n.reverse() : void 0;
|
|
3096
3096
|
}
|
|
3097
|
-
},
|
|
3097
|
+
}, mt = class V {
|
|
3098
3098
|
/**
|
|
3099
3099
|
* Invariant:
|
|
3100
3100
|
* ```
|
|
@@ -3517,7 +3517,7 @@ var de = class U {
|
|
|
3517
3517
|
i
|
|
3518
3518
|
);
|
|
3519
3519
|
}
|
|
3520
|
-
},
|
|
3520
|
+
}, ft = mt.NULL;
|
|
3521
3521
|
const fs = [
|
|
3522
3522
|
"area",
|
|
3523
3523
|
"base",
|
|
@@ -3564,7 +3564,7 @@ function rr(t, e) {
|
|
|
3564
3564
|
Object.assign(n, o.property), Object.assign(r, o.normal);
|
|
3565
3565
|
return new ve(n, r, e);
|
|
3566
3566
|
}
|
|
3567
|
-
function
|
|
3567
|
+
function gt(t) {
|
|
3568
3568
|
return t.toLowerCase();
|
|
3569
3569
|
}
|
|
3570
3570
|
class $ {
|
|
@@ -3593,24 +3593,24 @@ $.prototype.property = "";
|
|
|
3593
3593
|
$.prototype.spaceSeparated = !1;
|
|
3594
3594
|
$.prototype.space = void 0;
|
|
3595
3595
|
let gs = 0;
|
|
3596
|
-
const k = ee(), R = ee(),
|
|
3596
|
+
const k = ee(), R = ee(), yt = ee(), g = ee(), T = ee(), ie = ee(), j = ee();
|
|
3597
3597
|
function ee() {
|
|
3598
3598
|
return 2 ** ++gs;
|
|
3599
3599
|
}
|
|
3600
|
-
const
|
|
3600
|
+
const _t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3601
3601
|
__proto__: null,
|
|
3602
3602
|
boolean: k,
|
|
3603
3603
|
booleanish: R,
|
|
3604
3604
|
commaOrSpaceSeparated: j,
|
|
3605
3605
|
commaSeparated: ie,
|
|
3606
3606
|
number: g,
|
|
3607
|
-
overloadedBoolean:
|
|
3607
|
+
overloadedBoolean: yt,
|
|
3608
3608
|
spaceSeparated: T
|
|
3609
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3609
|
+
}, Symbol.toStringTag, { value: "Module" })), tt = (
|
|
3610
3610
|
/** @type {ReadonlyArray<keyof typeof types>} */
|
|
3611
|
-
Object.keys(
|
|
3611
|
+
Object.keys(_t)
|
|
3612
3612
|
);
|
|
3613
|
-
class
|
|
3613
|
+
class At extends $ {
|
|
3614
3614
|
/**
|
|
3615
3615
|
* @constructor
|
|
3616
3616
|
* @param {string} property
|
|
@@ -3627,26 +3627,26 @@ class Nt extends $ {
|
|
|
3627
3627
|
constructor(e, n, r, o) {
|
|
3628
3628
|
let i = -1;
|
|
3629
3629
|
if (super(e, n), dn(this, "space", o), typeof r == "number")
|
|
3630
|
-
for (; ++i <
|
|
3631
|
-
const s =
|
|
3632
|
-
dn(this,
|
|
3630
|
+
for (; ++i < tt.length; ) {
|
|
3631
|
+
const s = tt[i];
|
|
3632
|
+
dn(this, tt[i], (r & _t[s]) === _t[s]);
|
|
3633
3633
|
}
|
|
3634
3634
|
}
|
|
3635
3635
|
}
|
|
3636
|
-
|
|
3636
|
+
At.prototype.defined = !0;
|
|
3637
3637
|
function dn(t, e, n) {
|
|
3638
3638
|
n && (t[e] = n);
|
|
3639
3639
|
}
|
|
3640
3640
|
function ce(t) {
|
|
3641
3641
|
const e = {}, n = {};
|
|
3642
3642
|
for (const [r, o] of Object.entries(t.properties)) {
|
|
3643
|
-
const i = new
|
|
3643
|
+
const i = new At(
|
|
3644
3644
|
r,
|
|
3645
3645
|
t.transform(t.attributes || {}, r),
|
|
3646
3646
|
o,
|
|
3647
3647
|
t.space
|
|
3648
3648
|
);
|
|
3649
|
-
t.mustUseProperty && t.mustUseProperty.includes(r) && (i.mustUseProperty = !0), e[r] = i, n[
|
|
3649
|
+
t.mustUseProperty && t.mustUseProperty.includes(r) && (i.mustUseProperty = !0), e[r] = i, n[gt(r)] = r, n[gt(i.attribute)] = r;
|
|
3650
3650
|
}
|
|
3651
3651
|
return new ve(e, n, t.space);
|
|
3652
3652
|
}
|
|
@@ -3760,7 +3760,7 @@ const ys = ce({
|
|
|
3760
3760
|
dir: null,
|
|
3761
3761
|
dirName: null,
|
|
3762
3762
|
disabled: k,
|
|
3763
|
-
download:
|
|
3763
|
+
download: yt,
|
|
3764
3764
|
draggable: R,
|
|
3765
3765
|
encType: null,
|
|
3766
3766
|
enterKeyHint: null,
|
|
@@ -3773,7 +3773,7 @@ const ys = ce({
|
|
|
3773
3773
|
formTarget: null,
|
|
3774
3774
|
headers: T,
|
|
3775
3775
|
height: g,
|
|
3776
|
-
hidden:
|
|
3776
|
+
hidden: yt,
|
|
3777
3777
|
high: g,
|
|
3778
3778
|
href: null,
|
|
3779
3779
|
hrefLang: null,
|
|
@@ -4659,7 +4659,7 @@ const ys = ce({
|
|
|
4659
4659
|
}
|
|
4660
4660
|
}), bs = /[A-Z]/g, mn = /-[a-z]/g, ws = /^data[-\w.:]+$/i;
|
|
4661
4661
|
function vs(t, e) {
|
|
4662
|
-
const n =
|
|
4662
|
+
const n = gt(e);
|
|
4663
4663
|
let r = e, o = $;
|
|
4664
4664
|
if (n in t.normal)
|
|
4665
4665
|
return t.property[t.normal[n]];
|
|
@@ -4674,7 +4674,7 @@ function vs(t, e) {
|
|
|
4674
4674
|
s.charAt(0) !== "-" && (s = "-" + s), e = "data" + s;
|
|
4675
4675
|
}
|
|
4676
4676
|
}
|
|
4677
|
-
o =
|
|
4677
|
+
o = At;
|
|
4678
4678
|
}
|
|
4679
4679
|
return new o(r, e);
|
|
4680
4680
|
}
|
|
@@ -4853,7 +4853,7 @@ const Ms = [
|
|
|
4853
4853
|
"yacute",
|
|
4854
4854
|
"yen",
|
|
4855
4855
|
"yuml"
|
|
4856
|
-
],
|
|
4856
|
+
], nt = {
|
|
4857
4857
|
nbsp: " ",
|
|
4858
4858
|
iexcl: "¡",
|
|
4859
4859
|
cent: "¢",
|
|
@@ -5115,15 +5115,15 @@ const Ms = [
|
|
|
5115
5115
|
"not",
|
|
5116
5116
|
"para",
|
|
5117
5117
|
"times"
|
|
5118
|
-
], pr = {}.hasOwnProperty,
|
|
5118
|
+
], pr = {}.hasOwnProperty, bt = {};
|
|
5119
5119
|
let Pe;
|
|
5120
|
-
for (Pe in
|
|
5121
|
-
pr.call(
|
|
5120
|
+
for (Pe in nt)
|
|
5121
|
+
pr.call(nt, Pe) && (bt[nt[Pe]] = Pe);
|
|
5122
5122
|
const Ds = /[^\dA-Za-z]/;
|
|
5123
5123
|
function Bs(t, e, n, r) {
|
|
5124
5124
|
const o = String.fromCharCode(t);
|
|
5125
|
-
if (pr.call(
|
|
5126
|
-
const i =
|
|
5125
|
+
if (pr.call(bt, o)) {
|
|
5126
|
+
const i = bt[o], s = "&" + i;
|
|
5127
5127
|
return n && Ms.includes(i) && !js.includes(i) && (!r || e && e !== 61 && Ds.test(String.fromCharCode(e))) ? s : s + ";";
|
|
5128
5128
|
}
|
|
5129
5129
|
return "";
|
|
@@ -5183,7 +5183,7 @@ function Vs(t) {
|
|
|
5183
5183
|
return t.join(" ").trim();
|
|
5184
5184
|
}
|
|
5185
5185
|
const Ks = /[ \t\n\f\r]/g;
|
|
5186
|
-
function
|
|
5186
|
+
function Nt(t) {
|
|
5187
5187
|
return typeof t == "object" ? t.type === "text" ? _n(t.value) : !1 : _n(t);
|
|
5188
5188
|
}
|
|
5189
5189
|
function _n(t) {
|
|
@@ -5196,7 +5196,7 @@ function dr(t) {
|
|
|
5196
5196
|
const i = n ? n.children : Js;
|
|
5197
5197
|
let s = (r || 0) + t, a = i[s];
|
|
5198
5198
|
if (!o)
|
|
5199
|
-
for (; a &&
|
|
5199
|
+
for (; a && Nt(a); )
|
|
5200
5200
|
s += t, a = i[s];
|
|
5201
5201
|
return a;
|
|
5202
5202
|
}
|
|
@@ -5208,13 +5208,13 @@ function mr(t) {
|
|
|
5208
5208
|
return Ys.call(t, n.tagName) && t[n.tagName](n, r, o);
|
|
5209
5209
|
}
|
|
5210
5210
|
}
|
|
5211
|
-
const
|
|
5211
|
+
const Et = mr({
|
|
5212
5212
|
body: Qs,
|
|
5213
|
-
caption:
|
|
5214
|
-
colgroup:
|
|
5213
|
+
caption: rt,
|
|
5214
|
+
colgroup: rt,
|
|
5215
5215
|
dd: ra,
|
|
5216
5216
|
dt: na,
|
|
5217
|
-
head:
|
|
5217
|
+
head: rt,
|
|
5218
5218
|
html: Xs,
|
|
5219
5219
|
li: ta,
|
|
5220
5220
|
optgroup: oa,
|
|
@@ -5229,9 +5229,9 @@ const Lt = mr({
|
|
|
5229
5229
|
thead: sa,
|
|
5230
5230
|
tr: ca
|
|
5231
5231
|
});
|
|
5232
|
-
function
|
|
5232
|
+
function rt(t, e, n) {
|
|
5233
5233
|
const r = L(n, e, !0);
|
|
5234
|
-
return !r || r.type !== "comment" && !(r.type === "text" &&
|
|
5234
|
+
return !r || r.type !== "comment" && !(r.type === "text" && Nt(r.value.charAt(0)));
|
|
5235
5235
|
}
|
|
5236
5236
|
function Xs(t, e, n) {
|
|
5237
5237
|
const r = L(n, e);
|
|
@@ -5312,15 +5312,15 @@ function ha(t) {
|
|
|
5312
5312
|
}
|
|
5313
5313
|
function da(t) {
|
|
5314
5314
|
const e = L(t, -1, !0);
|
|
5315
|
-
return !e || e.type !== "comment" && !(e.type === "text" &&
|
|
5315
|
+
return !e || e.type !== "comment" && !(e.type === "text" && Nt(e.value.charAt(0))) && !(e.type === "element" && (e.tagName === "meta" || e.tagName === "link" || e.tagName === "script" || e.tagName === "style" || e.tagName === "template"));
|
|
5316
5316
|
}
|
|
5317
5317
|
function ma(t, e, n) {
|
|
5318
5318
|
const r = hr(n, e), o = L(t, -1, !0);
|
|
5319
|
-
return n && r && r.type === "element" && r.tagName === "colgroup" &&
|
|
5319
|
+
return n && r && r.type === "element" && r.tagName === "colgroup" && Et(r, n.children.indexOf(r), n) ? !1 : !!(o && o.type === "element" && o.tagName === "col");
|
|
5320
5320
|
}
|
|
5321
5321
|
function fa(t, e, n) {
|
|
5322
5322
|
const r = hr(n, e), o = L(t, -1);
|
|
5323
|
-
return n && r && r.type === "element" && (r.tagName === "thead" || r.tagName === "tbody") &&
|
|
5323
|
+
return n && r && r.type === "element" && (r.tagName === "thead" || r.tagName === "tbody") && Et(r, n.children.indexOf(r), n) ? !1 : !!(o && o.type === "element" && o.tagName === "tr");
|
|
5324
5324
|
}
|
|
5325
5325
|
const Re = {
|
|
5326
5326
|
// See: <https://html.spec.whatwg.org/#attribute-name-state>.
|
|
@@ -5361,7 +5361,7 @@ function ga(t, e, n, r) {
|
|
|
5361
5361
|
const c = ya(r, t.properties), u = r.all(
|
|
5362
5362
|
o.space === "html" && t.tagName === "template" ? t.content : t
|
|
5363
5363
|
);
|
|
5364
|
-
return r.schema = o, u && (s = !1), (c || !i || !ua(t, e, n)) && (a.push("<", t.tagName, c ? " " + c : ""), s && (o.space === "svg" || r.settings.closeSelfClosing) && (l = c.charAt(c.length - 1), (!r.settings.tightSelfClosing || l === "/" || l && l !== '"' && l !== "'") && a.push(" "), a.push("/")), a.push(">")), a.push(u), !s && (!i || !
|
|
5364
|
+
return r.schema = o, u && (s = !1), (c || !i || !ua(t, e, n)) && (a.push("<", t.tagName, c ? " " + c : ""), s && (o.space === "svg" || r.settings.closeSelfClosing) && (l = c.charAt(c.length - 1), (!r.settings.tightSelfClosing || l === "/" || l && l !== '"' && l !== "'") && a.push(" "), a.push("/")), a.push(">")), a.push(u), !s && (!i || !Et(t, e, n)) && a.push("</" + t.tagName + ">"), a.join("");
|
|
5365
5365
|
}
|
|
5366
5366
|
function ya(t, e) {
|
|
5367
5367
|
const n = [];
|
|
@@ -5499,17 +5499,17 @@ function La(t) {
|
|
|
5499
5499
|
async function gr(t) {
|
|
5500
5500
|
return Promise.resolve(typeof t == "function" ? t() : t).then((e) => e.default || e);
|
|
5501
5501
|
}
|
|
5502
|
-
function
|
|
5502
|
+
function Lt(t) {
|
|
5503
5503
|
return !t || ["plaintext", "txt", "text", "plain"].includes(t);
|
|
5504
5504
|
}
|
|
5505
5505
|
function yr(t) {
|
|
5506
|
-
return t === "ansi" ||
|
|
5506
|
+
return t === "ansi" || Lt(t);
|
|
5507
5507
|
}
|
|
5508
|
-
function
|
|
5508
|
+
function xt(t) {
|
|
5509
5509
|
return t === "none";
|
|
5510
5510
|
}
|
|
5511
5511
|
function _r(t) {
|
|
5512
|
-
return
|
|
5512
|
+
return xt(t);
|
|
5513
5513
|
}
|
|
5514
5514
|
function br(t, e) {
|
|
5515
5515
|
if (!e)
|
|
@@ -5520,7 +5520,7 @@ function br(t, e) {
|
|
|
5520
5520
|
r && !t.properties.class.includes(r) && t.properties.class.push(r);
|
|
5521
5521
|
return t;
|
|
5522
5522
|
}
|
|
5523
|
-
function
|
|
5523
|
+
function We(t, e = !1) {
|
|
5524
5524
|
if (t.length === 0)
|
|
5525
5525
|
return [["", 0]];
|
|
5526
5526
|
const n = t.split(/(\r?\n)/g);
|
|
@@ -5533,7 +5533,7 @@ function Ze(t, e = !1) {
|
|
|
5533
5533
|
return o;
|
|
5534
5534
|
}
|
|
5535
5535
|
function xa(t) {
|
|
5536
|
-
const e =
|
|
5536
|
+
const e = We(t, !0).map(([o]) => o);
|
|
5537
5537
|
function n(o) {
|
|
5538
5538
|
if (o === t.length)
|
|
5539
5539
|
return {
|
|
@@ -5583,7 +5583,7 @@ function Oa(t, e, n) {
|
|
|
5583
5583
|
const o = n.getBundledLanguages();
|
|
5584
5584
|
return Array.from(r).filter((i) => i && o[i]);
|
|
5585
5585
|
}
|
|
5586
|
-
const
|
|
5586
|
+
const Ot = "light-dark()", Ia = ["color", "background-color"];
|
|
5587
5587
|
function za(t, e) {
|
|
5588
5588
|
let n = 0;
|
|
5589
5589
|
const r = [];
|
|
@@ -5619,7 +5619,7 @@ function Ma(t, e, n, r, o = "css-vars") {
|
|
|
5619
5619
|
for (const h of a) {
|
|
5620
5620
|
const d = u[h] || "inherit";
|
|
5621
5621
|
if (p === 0 && r && Ia.includes(h))
|
|
5622
|
-
if (r ===
|
|
5622
|
+
if (r === Ot && s.length > 1) {
|
|
5623
5623
|
const m = e.findIndex((b) => b === "light"), _ = e.findIndex((b) => b === "dark");
|
|
5624
5624
|
if (m === -1 || _ === -1)
|
|
5625
5625
|
throw new A('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');
|
|
@@ -5641,11 +5641,11 @@ function De(t) {
|
|
|
5641
5641
|
}
|
|
5642
5642
|
return e;
|
|
5643
5643
|
}
|
|
5644
|
-
function
|
|
5644
|
+
function wt(t) {
|
|
5645
5645
|
return typeof t == "string" ? t : Object.entries(t).map(([e, n]) => `${e}:${n}`).join(";");
|
|
5646
5646
|
}
|
|
5647
5647
|
const wr = /* @__PURE__ */ new WeakMap();
|
|
5648
|
-
function
|
|
5648
|
+
function Ze(t, e) {
|
|
5649
5649
|
wr.set(t, e);
|
|
5650
5650
|
}
|
|
5651
5651
|
function be(t) {
|
|
@@ -5671,7 +5671,7 @@ class ue {
|
|
|
5671
5671
|
*/
|
|
5672
5672
|
static initial(e, n) {
|
|
5673
5673
|
return new ue(
|
|
5674
|
-
Object.fromEntries(La(n).map((r) => [r,
|
|
5674
|
+
Object.fromEntries(La(n).map((r) => [r, ft])),
|
|
5675
5675
|
e
|
|
5676
5676
|
);
|
|
5677
5677
|
}
|
|
@@ -5886,7 +5886,7 @@ var K = [
|
|
|
5886
5886
|
"brightMagenta",
|
|
5887
5887
|
"brightCyan",
|
|
5888
5888
|
"brightWhite"
|
|
5889
|
-
],
|
|
5889
|
+
], ot = {
|
|
5890
5890
|
1: "bold",
|
|
5891
5891
|
2: "dim",
|
|
5892
5892
|
3: "italic",
|
|
@@ -5935,12 +5935,12 @@ function Wa(t) {
|
|
|
5935
5935
|
if (r === 0)
|
|
5936
5936
|
e.push({ type: "resetAll" });
|
|
5937
5937
|
else if (r <= 9)
|
|
5938
|
-
|
|
5938
|
+
ot[r] && e.push({
|
|
5939
5939
|
type: "setDecoration",
|
|
5940
|
-
value:
|
|
5940
|
+
value: ot[r]
|
|
5941
5941
|
});
|
|
5942
5942
|
else if (r <= 29) {
|
|
5943
|
-
const o =
|
|
5943
|
+
const o = ot[r - 20];
|
|
5944
5944
|
o && (e.push({
|
|
5945
5945
|
type: "resetDecoration",
|
|
5946
5946
|
value: o
|
|
@@ -6096,7 +6096,7 @@ const Ka = {
|
|
|
6096
6096
|
brightWhite: "#FFFFFF"
|
|
6097
6097
|
};
|
|
6098
6098
|
function Ja(t, e, n) {
|
|
6099
|
-
const r = je(t, n), o =
|
|
6099
|
+
const r = je(t, n), o = We(e), i = Object.fromEntries(
|
|
6100
6100
|
K.map((l) => {
|
|
6101
6101
|
const c = `terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`, u = t.colors?.[c];
|
|
6102
6102
|
return [l, u || Ka[l]];
|
|
@@ -6140,12 +6140,12 @@ function Ya(t) {
|
|
|
6140
6140
|
const n = t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);
|
|
6141
6141
|
return n ? `var(${n[1]}-dim)` : t;
|
|
6142
6142
|
}
|
|
6143
|
-
function
|
|
6143
|
+
function It(t, e, n = {}) {
|
|
6144
6144
|
const {
|
|
6145
6145
|
theme: r = t.getLoadedThemes()[0]
|
|
6146
6146
|
} = n, o = t.resolveLangAlias(n.lang || "text");
|
|
6147
|
-
if (
|
|
6148
|
-
return
|
|
6147
|
+
if (Lt(o) || xt(r))
|
|
6148
|
+
return We(e).map((l) => [{ content: l[0], offset: l[1] }]);
|
|
6149
6149
|
const { theme: i, colorMap: s } = t.setTheme(r);
|
|
6150
6150
|
if (o === "ansi")
|
|
6151
6151
|
return Ja(i, e, n);
|
|
@@ -6165,31 +6165,31 @@ function Xa(...t) {
|
|
|
6165
6165
|
lang: o = "text",
|
|
6166
6166
|
theme: i = e.getLoadedThemes()[0]
|
|
6167
6167
|
} = r;
|
|
6168
|
-
if (
|
|
6168
|
+
if (Lt(o) || xt(i))
|
|
6169
6169
|
throw new A("Plain language does not have grammar state");
|
|
6170
6170
|
if (o === "ansi")
|
|
6171
6171
|
throw new A("ANSI language does not have grammar state");
|
|
6172
6172
|
const { theme: s, colorMap: a } = e.setTheme(i), l = e.getLanguage(o);
|
|
6173
6173
|
return new ue(
|
|
6174
|
-
|
|
6174
|
+
zt(n, l, s, a, r).stateStack,
|
|
6175
6175
|
l.name,
|
|
6176
6176
|
s.name
|
|
6177
6177
|
);
|
|
6178
6178
|
}
|
|
6179
6179
|
function Qa(t, e, n, r, o) {
|
|
6180
|
-
const i =
|
|
6181
|
-
|
|
6180
|
+
const i = zt(t, e, n, r, o), s = new ue(
|
|
6181
|
+
i.stateStack,
|
|
6182
6182
|
e.name,
|
|
6183
6183
|
n.name
|
|
6184
6184
|
);
|
|
6185
|
-
return
|
|
6185
|
+
return Ze(i.tokens, s), i.tokens;
|
|
6186
6186
|
}
|
|
6187
|
-
function
|
|
6187
|
+
function zt(t, e, n, r, o) {
|
|
6188
6188
|
const i = je(n, o), {
|
|
6189
6189
|
tokenizeMaxLineLength: s = 0,
|
|
6190
6190
|
tokenizeTimeLimit: a = 500
|
|
6191
|
-
} = o, l =
|
|
6192
|
-
let c = o.grammarState ? Da(o.grammarState, n.name) ??
|
|
6191
|
+
} = o, l = We(t);
|
|
6192
|
+
let c = o.grammarState ? Da(o.grammarState, n.name) ?? ft : o.grammarContextCode != null ? zt(
|
|
6193
6193
|
o.grammarContextCode,
|
|
6194
6194
|
e,
|
|
6195
6195
|
n,
|
|
@@ -6199,7 +6199,7 @@ function Ge(t, e, n, r, o) {
|
|
|
6199
6199
|
grammarState: void 0,
|
|
6200
6200
|
grammarContextCode: void 0
|
|
6201
6201
|
}
|
|
6202
|
-
).stateStack :
|
|
6202
|
+
).stateStack : ft, u = [];
|
|
6203
6203
|
const p = [];
|
|
6204
6204
|
for (let h = 0, d = l.length; h < d; h++) {
|
|
6205
6205
|
const [m, _] = l[h];
|
|
@@ -6226,7 +6226,7 @@ function Ge(t, e, n, r, o) {
|
|
|
6226
6226
|
const jt = f.tokens[2 * C + 1], Ar = W(
|
|
6227
6227
|
r[ae.getForeground(jt)],
|
|
6228
6228
|
i
|
|
6229
|
-
), Nr = ae.getFontStyle(jt),
|
|
6229
|
+
), Nr = ae.getFontStyle(jt), Ke = {
|
|
6230
6230
|
content: m.substring(M, q),
|
|
6231
6231
|
offset: _ + M,
|
|
6232
6232
|
color: Ar,
|
|
@@ -6239,7 +6239,7 @@ function Ge(t, e, n, r, o) {
|
|
|
6239
6239
|
let te;
|
|
6240
6240
|
switch (typeof H.scope) {
|
|
6241
6241
|
case "string":
|
|
6242
|
-
te = H.scope.split(/,/).map((
|
|
6242
|
+
te = H.scope.split(/,/).map((Je) => Je.trim());
|
|
6243
6243
|
break;
|
|
6244
6244
|
case "object":
|
|
6245
6245
|
te = H.scope;
|
|
@@ -6249,17 +6249,17 @@ function Ge(t, e, n, r, o) {
|
|
|
6249
6249
|
}
|
|
6250
6250
|
Dt.push({
|
|
6251
6251
|
settings: H,
|
|
6252
|
-
selectors: te.map((
|
|
6252
|
+
selectors: te.map((Je) => Je.split(/ /))
|
|
6253
6253
|
});
|
|
6254
6254
|
}
|
|
6255
|
-
|
|
6255
|
+
Ke.explanation = [];
|
|
6256
6256
|
let Bt = 0;
|
|
6257
6257
|
for (; M + Bt < q; ) {
|
|
6258
6258
|
const H = y[b], te = m.substring(
|
|
6259
6259
|
H.startIndex,
|
|
6260
6260
|
H.endIndex
|
|
6261
6261
|
);
|
|
6262
|
-
Bt += te.length,
|
|
6262
|
+
Bt += te.length, Ke.explanation.push({
|
|
6263
6263
|
content: te,
|
|
6264
6264
|
scopes: o.includeExplanation === "scopeName" ? el(
|
|
6265
6265
|
H.scopes
|
|
@@ -6270,7 +6270,7 @@ function Ge(t, e, n, r, o) {
|
|
|
6270
6270
|
}), b += 1;
|
|
6271
6271
|
}
|
|
6272
6272
|
}
|
|
6273
|
-
u.push(
|
|
6273
|
+
u.push(Ke);
|
|
6274
6274
|
}
|
|
6275
6275
|
p.push(u), u = [], c = f.ruleStack;
|
|
6276
6276
|
}
|
|
@@ -6316,7 +6316,7 @@ function rl(t, e, n) {
|
|
|
6316
6316
|
}
|
|
6317
6317
|
function Sr(t, e, n) {
|
|
6318
6318
|
const r = Object.entries(n.themes).filter((l) => l[1]).map((l) => ({ color: l[0], theme: l[1] })), o = r.map((l) => {
|
|
6319
|
-
const c =
|
|
6319
|
+
const c = It(t, e, {
|
|
6320
6320
|
...n,
|
|
6321
6321
|
theme: l.theme
|
|
6322
6322
|
}), u = be(c), p = typeof l.theme == "string" ? l.theme : l.theme.name;
|
|
@@ -6348,7 +6348,7 @@ function Sr(t, e, n) {
|
|
|
6348
6348
|
Object.fromEntries(o.map((l) => [l.theme, l.state?.getInternalStack(l.theme)])),
|
|
6349
6349
|
o[0].state.lang
|
|
6350
6350
|
) : void 0;
|
|
6351
|
-
return a &&
|
|
6351
|
+
return a && Ze(s, a), s;
|
|
6352
6352
|
}
|
|
6353
6353
|
function ol(...t) {
|
|
6354
6354
|
const e = t.map(() => []), n = t.length;
|
|
@@ -6373,7 +6373,7 @@ function ol(...t) {
|
|
|
6373
6373
|
}
|
|
6374
6374
|
return e;
|
|
6375
6375
|
}
|
|
6376
|
-
function
|
|
6376
|
+
function Ge(t, e, n) {
|
|
6377
6377
|
let r, o, i, s, a, l;
|
|
6378
6378
|
if ("themes" in n) {
|
|
6379
6379
|
const {
|
|
@@ -6388,15 +6388,15 @@ function Ue(t, e, n) {
|
|
|
6388
6388
|
e,
|
|
6389
6389
|
n
|
|
6390
6390
|
);
|
|
6391
|
-
if (l = be(d), c &&
|
|
6391
|
+
if (l = be(d), c && Ot !== c && !h.find((y) => y.color === c))
|
|
6392
6392
|
throw new A(`\`themes\` option must contain the defaultColor key \`${c}\``);
|
|
6393
6393
|
const m = h.map((y) => t.getTheme(y.theme)), _ = h.map((y) => y.color);
|
|
6394
|
-
i = d.map((y) => y.map((b) => Ma(b, _, u, c, p))), l &&
|
|
6394
|
+
i = d.map((y) => y.map((b) => Ma(b, _, u, c, p))), l && Ze(i, l);
|
|
6395
6395
|
const w = h.map((y) => je(y.theme, n));
|
|
6396
6396
|
o = kn(h, m, w, u, c, "fg", p), r = kn(h, m, w, u, c, "bg", p), s = `shiki-themes ${m.map((y) => y.name).join(" ")}`, a = c ? void 0 : [o, r].join(";");
|
|
6397
6397
|
} else if ("theme" in n) {
|
|
6398
6398
|
const c = je(n.theme, n);
|
|
6399
|
-
i =
|
|
6399
|
+
i = It(
|
|
6400
6400
|
t,
|
|
6401
6401
|
e,
|
|
6402
6402
|
n
|
|
@@ -6418,7 +6418,7 @@ function kn(t, e, n, r, o, i, s) {
|
|
|
6418
6418
|
return t.map((a, l) => {
|
|
6419
6419
|
const c = W(e[l][i], n[l]) || "inherit", u = `${r + a.color}${i === "bg" ? "-bg" : ""}:${c}`;
|
|
6420
6420
|
if (l === 0 && o) {
|
|
6421
|
-
if (o ===
|
|
6421
|
+
if (o === Ot && t.length > 1) {
|
|
6422
6422
|
const p = t.findIndex((_) => _.color === "light"), h = t.findIndex((_) => _.color === "dark");
|
|
6423
6423
|
if (p === -1 || h === -1)
|
|
6424
6424
|
throw new A('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');
|
|
@@ -6430,11 +6430,11 @@ function kn(t, e, n, r, o, i, s) {
|
|
|
6430
6430
|
return s === "css-vars" ? u : null;
|
|
6431
6431
|
}).filter((a) => !!a).join(";");
|
|
6432
6432
|
}
|
|
6433
|
-
function
|
|
6433
|
+
function Ue(t, e, n, r = {
|
|
6434
6434
|
meta: {},
|
|
6435
6435
|
options: n,
|
|
6436
|
-
codeToHast: (o, i) =>
|
|
6437
|
-
codeToTokens: (o, i) =>
|
|
6436
|
+
codeToHast: (o, i) => Ue(t, o, i),
|
|
6437
|
+
codeToTokens: (o, i) => Ge(t, o, i)
|
|
6438
6438
|
}) {
|
|
6439
6439
|
let o = e;
|
|
6440
6440
|
for (const m of Be(n))
|
|
@@ -6446,7 +6446,7 @@ function Fe(t, e, n, r = {
|
|
|
6446
6446
|
themeName: l,
|
|
6447
6447
|
rootStyle: c,
|
|
6448
6448
|
grammarState: u
|
|
6449
|
-
} =
|
|
6449
|
+
} = Ge(t, o, n);
|
|
6450
6450
|
const {
|
|
6451
6451
|
mergeWhitespaces: p = !0,
|
|
6452
6452
|
mergeSameStyleTokens: h = !1
|
|
@@ -6541,7 +6541,7 @@ function il(t, e, n, r = be(t)) {
|
|
|
6541
6541
|
},
|
|
6542
6542
|
children: [{ type: "text", value: f.content }]
|
|
6543
6543
|
};
|
|
6544
|
-
const C =
|
|
6544
|
+
const C = wt(f.htmlStyle || De(f));
|
|
6545
6545
|
C && (v.properties.style = C);
|
|
6546
6546
|
for (const M of o)
|
|
6547
6547
|
v = M?.span?.call(d, v, w + 1, b, y, f) || v;
|
|
@@ -6593,7 +6593,7 @@ function il(t, e, n, r = be(t)) {
|
|
|
6593
6593
|
let m = s;
|
|
6594
6594
|
for (const _ of o)
|
|
6595
6595
|
m = _?.root?.call(d, m) || m;
|
|
6596
|
-
return r &&
|
|
6596
|
+
return r && Ze(m, r), m;
|
|
6597
6597
|
}
|
|
6598
6598
|
function sl(t) {
|
|
6599
6599
|
return t.map((e) => {
|
|
@@ -6647,7 +6647,7 @@ function ll(t) {
|
|
|
6647
6647
|
n.push({ ...r });
|
|
6648
6648
|
continue;
|
|
6649
6649
|
}
|
|
6650
|
-
const o = n[n.length - 1], i =
|
|
6650
|
+
const o = n[n.length - 1], i = wt(o.htmlStyle || De(o)), s = wt(r.htmlStyle || De(r)), a = o.fontStyle && (o.fontStyle & z.Underline || o.fontStyle & z.Strikethrough), l = r.fontStyle && (r.fontStyle & z.Underline || r.fontStyle & z.Strikethrough);
|
|
6651
6651
|
!a && !l && i === s ? o.content += r.content : n.push({ ...r });
|
|
6652
6652
|
}
|
|
6653
6653
|
return n;
|
|
@@ -6658,10 +6658,10 @@ function ul(t, e, n) {
|
|
|
6658
6658
|
const r = {
|
|
6659
6659
|
meta: {},
|
|
6660
6660
|
options: n,
|
|
6661
|
-
codeToHast: (i, s) =>
|
|
6662
|
-
codeToTokens: (i, s) =>
|
|
6661
|
+
codeToHast: (i, s) => Ue(t, i, s),
|
|
6662
|
+
codeToTokens: (i, s) => Ge(t, i, s)
|
|
6663
6663
|
};
|
|
6664
|
-
let o = cl(
|
|
6664
|
+
let o = cl(Ue(t, e, n, r));
|
|
6665
6665
|
for (const i of Be(n))
|
|
6666
6666
|
o = i.postprocess?.call(r, o, n) || o;
|
|
6667
6667
|
return o;
|
|
@@ -6978,10 +6978,10 @@ async function yl(t) {
|
|
|
6978
6978
|
const e = await gl(t);
|
|
6979
6979
|
return {
|
|
6980
6980
|
getLastGrammarState: (...n) => Xa(e, ...n),
|
|
6981
|
-
codeToTokensBase: (n, r) =>
|
|
6981
|
+
codeToTokensBase: (n, r) => It(e, n, r),
|
|
6982
6982
|
codeToTokensWithThemes: (n, r) => Sr(e, n, r),
|
|
6983
|
-
codeToTokens: (n, r) =>
|
|
6984
|
-
codeToHast: (n, r) =>
|
|
6983
|
+
codeToTokens: (n, r) => Ge(e, n, r),
|
|
6984
|
+
codeToHast: (n, r) => Ue(e, n, r),
|
|
6985
6985
|
codeToHtml: (n, r) => ul(e, n, r),
|
|
6986
6986
|
getBundledLanguages: () => ({}),
|
|
6987
6987
|
getBundledThemes: () => ({}),
|
|
@@ -8916,10 +8916,10 @@ let x = null;
|
|
|
8916
8916
|
function xl(t) {
|
|
8917
8917
|
throw new Mt(t.UTF8ToString(t.getLastOnigError()));
|
|
8918
8918
|
}
|
|
8919
|
-
class
|
|
8919
|
+
class qe {
|
|
8920
8920
|
constructor(e) {
|
|
8921
8921
|
N(this, "utf16Length"), N(this, "utf8Length"), N(this, "utf16Value"), N(this, "utf8Value"), N(this, "utf16OffsetToUtf8"), N(this, "utf8OffsetToUtf16");
|
|
8922
|
-
const n = e.length, r =
|
|
8922
|
+
const n = e.length, r = qe._utf8ByteLength(e), o = r !== n, i = o ? new Uint32Array(n + 1) : null;
|
|
8923
8923
|
o && (i[n] = r);
|
|
8924
8924
|
const s = o ? new Uint32Array(r + 1) : null;
|
|
8925
8925
|
o && (s[r] = n);
|
|
@@ -8954,12 +8954,12 @@ class Ve {
|
|
|
8954
8954
|
return e.HEAPU8.set(this.utf8Value, n), n;
|
|
8955
8955
|
}
|
|
8956
8956
|
}
|
|
8957
|
-
const
|
|
8957
|
+
const Ve = class F {
|
|
8958
8958
|
constructor(e) {
|
|
8959
8959
|
if (N(this, "id", ++F.LAST_ID), N(this, "_onigBinding"), N(this, "content"), N(this, "utf16Length"), N(this, "utf8Length"), N(this, "utf16OffsetToUtf8"), N(this, "utf8OffsetToUtf16"), N(this, "ptr"), !x)
|
|
8960
8960
|
throw new Mt("Must invoke loadWasm first.");
|
|
8961
8961
|
this._onigBinding = x, this.content = e;
|
|
8962
|
-
const n = new
|
|
8962
|
+
const n = new qe(e);
|
|
8963
8963
|
this.utf16Length = n.utf16Length, this.utf8Length = n.utf8Length, this.utf16OffsetToUtf8 = n.utf16OffsetToUtf8, this.utf8OffsetToUtf16 = n.utf8OffsetToUtf16, this.utf8Length < 1e4 && !F._sharedPtrInUse ? (F._sharedPtr || (F._sharedPtr = x.omalloc(1e4)), F._sharedPtrInUse = !0, x.HEAPU8.set(n.utf8Value, F._sharedPtr), this.ptr = F._sharedPtr) : this.ptr = n.createString(x);
|
|
8964
8964
|
}
|
|
8965
8965
|
convertUtf8OffsetToUtf16(e) {
|
|
@@ -8972,17 +8972,17 @@ const Ke = class F {
|
|
|
8972
8972
|
this.ptr === F._sharedPtr ? F._sharedPtrInUse = !1 : this._onigBinding.ofree(this.ptr);
|
|
8973
8973
|
}
|
|
8974
8974
|
};
|
|
8975
|
-
N(
|
|
8976
|
-
N(
|
|
8977
|
-
N(
|
|
8978
|
-
let Rr =
|
|
8975
|
+
N(Ve, "LAST_ID", 0);
|
|
8976
|
+
N(Ve, "_sharedPtr", 0);
|
|
8977
|
+
N(Ve, "_sharedPtrInUse", !1);
|
|
8978
|
+
let Rr = Ve;
|
|
8979
8979
|
class Ol {
|
|
8980
8980
|
constructor(e) {
|
|
8981
8981
|
if (N(this, "_onigBinding"), N(this, "_ptr"), !x)
|
|
8982
8982
|
throw new Mt("Must invoke loadWasm first.");
|
|
8983
8983
|
const n = [], r = [];
|
|
8984
8984
|
for (let a = 0, l = e.length; a < l; a++) {
|
|
8985
|
-
const c = new
|
|
8985
|
+
const c = new qe(e[a]);
|
|
8986
8986
|
n[a] = c.createString(x), r[a] = c.utf8Length;
|
|
8987
8987
|
}
|
|
8988
8988
|
const o = x.omalloc(4 * e.length);
|
|
@@ -9049,12 +9049,12 @@ function Dl(t) {
|
|
|
9049
9049
|
async function e() {
|
|
9050
9050
|
x = await Nl(async (n) => {
|
|
9051
9051
|
let r = t;
|
|
9052
|
-
return r = await r, typeof r == "function" && (r = await r(n)), typeof r == "function" && (r = await r(n)), Il(r) ? r = await r.instantiator(n) : zl(r) ? r = await r.default(n) : ($l(r) && (r = r.data), Ml(r) ? typeof WebAssembly.instantiateStreaming == "function" ? r = await Bl(r)(n) : r = await Gl(r)(n) : jl(r) ? r = await
|
|
9052
|
+
return r = await r, typeof r == "function" && (r = await r(n)), typeof r == "function" && (r = await r(n)), Il(r) ? r = await r.instantiator(n) : zl(r) ? r = await r.default(n) : ($l(r) && (r = r.data), Ml(r) ? typeof WebAssembly.instantiateStreaming == "function" ? r = await Bl(r)(n) : r = await Gl(r)(n) : jl(r) ? r = await it(r)(n) : r instanceof WebAssembly.Module ? r = await it(r)(n) : "default" in r && r.default instanceof WebAssembly.Module && (r = await it(r.default)(n))), "instance" in r && (r = r.instance), "exports" in r && (r = r.exports), r;
|
|
9053
9053
|
});
|
|
9054
9054
|
}
|
|
9055
9055
|
return Ae = e(), Ae;
|
|
9056
9056
|
}
|
|
9057
|
-
function
|
|
9057
|
+
function it(t) {
|
|
9058
9058
|
return (e) => WebAssembly.instantiate(t, e);
|
|
9059
9059
|
}
|
|
9060
9060
|
function Bl(t) {
|
|
@@ -9087,9 +9087,9 @@ const Fl = /* @__PURE__ */ _l({
|
|
|
9087
9087
|
{ guessEmbeddedLanguages: Oa }
|
|
9088
9088
|
), Hl = ii({
|
|
9089
9089
|
mode: Dn(["html", "svelte", "react"]),
|
|
9090
|
-
include:
|
|
9091
|
-
exclude:
|
|
9092
|
-
shikiOptions:
|
|
9090
|
+
include: Ye().optional(),
|
|
9091
|
+
exclude: Ye().optional(),
|
|
9092
|
+
shikiOptions: Ye().optional()
|
|
9093
9093
|
}), An = {
|
|
9094
9094
|
html: Pi,
|
|
9095
9095
|
svelte: Ri,
|