@record-evolution/widget-markdown 1.0.4 → 1.0.5
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/widget-markdown.js +410 -390
- package/dist/widget-markdown.js.map +1 -1
- package/package.json +5 -1
- package/src/definition-schema.d.ts +9 -3
- package/src/definition-schema.json +5 -3
- package/src/widget-markdown.ts +46 -24
package/dist/widget-markdown.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const
|
|
1
|
+
const st = globalThis, Mt = st.ShadowRoot && (st.ShadyCSS === void 0 || st.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ot = /* @__PURE__ */ Symbol(), un = /* @__PURE__ */ new WeakMap();
|
|
2
2
|
let On = class {
|
|
3
3
|
constructor(e, n, o) {
|
|
4
|
-
if (this._$cssResult$ = !0, o !==
|
|
4
|
+
if (this._$cssResult$ = !0, o !== Ot) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = e, this.t = n;
|
|
6
6
|
}
|
|
7
7
|
get styleSheet() {
|
|
8
8
|
let e = this.o;
|
|
9
9
|
const n = this.t;
|
|
10
|
-
if (
|
|
10
|
+
if (Mt && e === void 0) {
|
|
11
11
|
const o = n !== void 0 && n.length === 1;
|
|
12
12
|
o && (e = un.get(n)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), o && un.set(n, e));
|
|
13
13
|
}
|
|
@@ -17,25 +17,25 @@ let On = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
20
|
+
const At = (t) => new On(typeof t == "string" ? t : t + "", void 0, Ot), no = (t, ...e) => {
|
|
21
21
|
const n = t.length === 1 ? t[0] : e.reduce(((o, r, s) => o + ((i) => {
|
|
22
22
|
if (i._$cssResult$ === !0) return i.cssText;
|
|
23
23
|
if (typeof i == "number") return i;
|
|
24
24
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + i + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
25
|
})(r) + t[s + 1]), t[0]);
|
|
26
|
-
return new On(n, t,
|
|
26
|
+
return new On(n, t, Ot);
|
|
27
27
|
}, ro = (t, e) => {
|
|
28
|
-
if (
|
|
28
|
+
if (Mt) t.adoptedStyleSheets = e.map(((n) => n instanceof CSSStyleSheet ? n : n.styleSheet));
|
|
29
29
|
else for (const n of e) {
|
|
30
|
-
const o = document.createElement("style"), r =
|
|
30
|
+
const o = document.createElement("style"), r = st.litNonce;
|
|
31
31
|
r !== void 0 && o.setAttribute("nonce", r), o.textContent = n.cssText, t.appendChild(o);
|
|
32
32
|
}
|
|
33
|
-
}, pn =
|
|
33
|
+
}, pn = Mt ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
|
|
34
34
|
let n = "";
|
|
35
35
|
for (const o of e.cssRules) n += o.cssText;
|
|
36
|
-
return
|
|
36
|
+
return At(n);
|
|
37
37
|
})(t) : t;
|
|
38
|
-
const { is: oo, defineProperty: io, getOwnPropertyDescriptor: so, getOwnPropertyNames: ao, getOwnPropertySymbols: lo, getPrototypeOf: co } = Object,
|
|
38
|
+
const { is: oo, defineProperty: io, getOwnPropertyDescriptor: so, getOwnPropertyNames: ao, getOwnPropertySymbols: lo, getPrototypeOf: co } = Object, pt = globalThis, gn = pt.trustedTypes, ho = gn ? gn.emptyScript : "", uo = pt.reactiveElementPolyfillSupport, Ze = (t, e) => t, at = { toAttribute(t, e) {
|
|
39
39
|
switch (e) {
|
|
40
40
|
case Boolean:
|
|
41
41
|
t = t ? ho : null;
|
|
@@ -63,9 +63,9 @@ const { is: oo, defineProperty: io, getOwnPropertyDescriptor: so, getOwnProperty
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return n;
|
|
66
|
-
} },
|
|
67
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
68
|
-
let
|
|
66
|
+
} }, It = (t, e) => !oo(t, e), bn = { attribute: !0, type: String, converter: at, reflect: !1, useDefault: !1, hasChanged: It };
|
|
67
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), pt.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
+
let Ie = class extends HTMLElement {
|
|
69
69
|
static addInitializer(e) {
|
|
70
70
|
this._$Ei(), (this.l ??= []).push(e);
|
|
71
71
|
}
|
|
@@ -162,21 +162,21 @@ let Oe = class extends HTMLElement {
|
|
|
162
162
|
_$ET(e, n) {
|
|
163
163
|
const o = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, o);
|
|
164
164
|
if (r !== void 0 && o.reflect === !0) {
|
|
165
|
-
const s = (o.converter?.toAttribute !== void 0 ? o.converter :
|
|
165
|
+
const s = (o.converter?.toAttribute !== void 0 ? o.converter : at).toAttribute(n, o.type);
|
|
166
166
|
this._$Em = e, s == null ? this.removeAttribute(r) : this.setAttribute(r, s), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
_$AK(e, n) {
|
|
170
170
|
const o = this.constructor, r = o._$Eh.get(e);
|
|
171
171
|
if (r !== void 0 && this._$Em !== r) {
|
|
172
|
-
const s = o.getPropertyOptions(r), i = typeof s.converter == "function" ? { fromAttribute: s.converter } : s.converter?.fromAttribute !== void 0 ? s.converter :
|
|
172
|
+
const s = o.getPropertyOptions(r), i = typeof s.converter == "function" ? { fromAttribute: s.converter } : s.converter?.fromAttribute !== void 0 ? s.converter : at;
|
|
173
173
|
this._$Em = r, this[r] = i.fromAttribute(n, s.type) ?? this._$Ej?.get(r) ?? null, this._$Em = null;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
requestUpdate(e, n, o) {
|
|
177
177
|
if (e !== void 0) {
|
|
178
178
|
const r = this.constructor, s = this[e];
|
|
179
|
-
if (o ??= r.getPropertyOptions(e), !((o.hasChanged ??
|
|
179
|
+
if (o ??= r.getPropertyOptions(e), !((o.hasChanged ?? It)(s, n) || o.useDefault && o.reflect && s === this._$Ej?.get(e) && !this.hasAttribute(r._$Eu(e, o)))) return;
|
|
180
180
|
this.C(e, n, o);
|
|
181
181
|
}
|
|
182
182
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -244,12 +244,12 @@ let Oe = class extends HTMLElement {
|
|
|
244
244
|
firstUpdated(e) {
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
\f\r]`, He = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, mn = /-->/g, yn = />/g,
|
|
250
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), kn = /'/g, wn = /"/g, zn = /^(?:script|style|textarea|title)$/i, bo = (t) => (e, ...n) => ({ _$litType$: t, strings: e, values: n }), fo = bo(1),
|
|
247
|
+
Ie.elementStyles = [], Ie.shadowRootOptions = { mode: "open" }, Ie[Ze("elementProperties")] = /* @__PURE__ */ new Map(), Ie[Ze("finalized")] = /* @__PURE__ */ new Map(), uo?.({ ReactiveElement: Ie }), (pt.reactiveElementVersions ??= []).push("2.1.0");
|
|
248
|
+
const Lt = globalThis, lt = Lt.trustedTypes, fn = lt ? lt.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, In = "$lit$", me = `lit$${Math.random().toFixed(9).slice(2)}$`, Ln = "?" + me, po = `<${Ln}>`, Se = document, We = () => Se.createComment(""), Xe = (t) => t === null || typeof t != "object" && typeof t != "function", zt = Array.isArray, go = (t) => zt(t) || typeof t?.[Symbol.iterator] == "function", Et = `[
|
|
249
|
+
\f\r]`, He = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, mn = /-->/g, yn = />/g, ve = RegExp(`>|${Et}(?:([^\\s"'>=/]+)(${Et}*=${Et}*(?:[^
|
|
250
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), kn = /'/g, wn = /"/g, zn = /^(?:script|style|textarea|title)$/i, bo = (t) => (e, ...n) => ({ _$litType$: t, strings: e, values: n }), fo = bo(1), Ae = /* @__PURE__ */ Symbol.for("lit-noChange"), D = /* @__PURE__ */ Symbol.for("lit-nothing"), xn = /* @__PURE__ */ new WeakMap(), Ee = Se.createTreeWalker(Se, 129);
|
|
251
251
|
function Pn(t, e) {
|
|
252
|
-
if (!
|
|
252
|
+
if (!zt(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
253
253
|
return fn !== void 0 ? fn.createHTML(e) : e;
|
|
254
254
|
}
|
|
255
255
|
const mo = (t, e) => {
|
|
@@ -258,13 +258,13 @@ const mo = (t, e) => {
|
|
|
258
258
|
for (let l = 0; l < n; l++) {
|
|
259
259
|
const c = t[l];
|
|
260
260
|
let h, f, b = -1, m = 0;
|
|
261
|
-
for (; m < c.length && (i.lastIndex = m, f = i.exec(c), f !== null); ) m = i.lastIndex, i === He ? f[1] === "!--" ? i = mn : f[1] !== void 0 ? i = yn : f[2] !== void 0 ? (zn.test(f[2]) && (r = RegExp("</" + f[2], "g")), i =
|
|
262
|
-
const $ = i ===
|
|
263
|
-
s += i === He ? c + po : b >= 0 ? (o.push(h), c.slice(0, b) + In + c.slice(b) +
|
|
261
|
+
for (; m < c.length && (i.lastIndex = m, f = i.exec(c), f !== null); ) m = i.lastIndex, i === He ? f[1] === "!--" ? i = mn : f[1] !== void 0 ? i = yn : f[2] !== void 0 ? (zn.test(f[2]) && (r = RegExp("</" + f[2], "g")), i = ve) : f[3] !== void 0 && (i = ve) : i === ve ? f[0] === ">" ? (i = r ?? He, b = -1) : f[1] === void 0 ? b = -2 : (b = i.lastIndex - f[2].length, h = f[1], i = f[3] === void 0 ? ve : f[3] === '"' ? wn : kn) : i === wn || i === kn ? i = ve : i === mn || i === yn ? i = He : (i = ve, r = void 0);
|
|
262
|
+
const $ = i === ve && t[l + 1].startsWith("/>") ? " " : "";
|
|
263
|
+
s += i === He ? c + po : b >= 0 ? (o.push(h), c.slice(0, b) + In + c.slice(b) + me + $) : c + me + (b === -2 ? l : $);
|
|
264
264
|
}
|
|
265
265
|
return [Pn(t, s + (t[n] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), o];
|
|
266
266
|
};
|
|
267
|
-
let
|
|
267
|
+
let $t = class Bn {
|
|
268
268
|
constructor({ strings: e, _$litType$: n }, o) {
|
|
269
269
|
let r;
|
|
270
270
|
this.parts = [];
|
|
@@ -277,13 +277,13 @@ let At = class Bn {
|
|
|
277
277
|
for (; (r = Ee.nextNode()) !== null && c.length < l; ) {
|
|
278
278
|
if (r.nodeType === 1) {
|
|
279
279
|
if (r.hasAttributes()) for (const b of r.getAttributeNames()) if (b.endsWith(In)) {
|
|
280
|
-
const m = f[i++], $ = r.getAttribute(b).split(
|
|
281
|
-
c.push({ type: 1, index: s, name:
|
|
282
|
-
} else b.startsWith(
|
|
280
|
+
const m = f[i++], $ = r.getAttribute(b).split(me), E = /([.?@])?(.*)/.exec(m);
|
|
281
|
+
c.push({ type: 1, index: s, name: E[2], strings: $, ctor: E[1] === "." ? ko : E[1] === "?" ? wo : E[1] === "@" ? xo : gt }), r.removeAttribute(b);
|
|
282
|
+
} else b.startsWith(me) && (c.push({ type: 6, index: s }), r.removeAttribute(b));
|
|
283
283
|
if (zn.test(r.tagName)) {
|
|
284
|
-
const b = r.textContent.split(
|
|
284
|
+
const b = r.textContent.split(me), m = b.length - 1;
|
|
285
285
|
if (m > 0) {
|
|
286
|
-
r.textContent =
|
|
286
|
+
r.textContent = lt ? lt.emptyScript : "";
|
|
287
287
|
for (let $ = 0; $ < m; $++) r.append(b[$], We()), Ee.nextNode(), c.push({ type: 2, index: ++s });
|
|
288
288
|
r.append(b[m], We());
|
|
289
289
|
}
|
|
@@ -291,21 +291,21 @@ let At = class Bn {
|
|
|
291
291
|
} else if (r.nodeType === 8) if (r.data === Ln) c.push({ type: 2, index: s });
|
|
292
292
|
else {
|
|
293
293
|
let b = -1;
|
|
294
|
-
for (; (b = r.data.indexOf(
|
|
294
|
+
for (; (b = r.data.indexOf(me, b + 1)) !== -1; ) c.push({ type: 7, index: s }), b += me.length - 1;
|
|
295
295
|
}
|
|
296
296
|
s++;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
static createElement(e, n) {
|
|
300
|
-
const o =
|
|
300
|
+
const o = Se.createElement("template");
|
|
301
301
|
return o.innerHTML = e, o;
|
|
302
302
|
}
|
|
303
303
|
};
|
|
304
|
-
function
|
|
305
|
-
if (e ===
|
|
304
|
+
function Le(t, e, n = t, o) {
|
|
305
|
+
if (e === Ae) return e;
|
|
306
306
|
let r = o !== void 0 ? n._$Co?.[o] : n._$Cl;
|
|
307
307
|
const s = Xe(e) ? void 0 : e._$litDirective$;
|
|
308
|
-
return r?.constructor !== s && (r?._$AO?.(!1), s === void 0 ? r = void 0 : (r = new s(t), r._$AT(t, n, o)), o !== void 0 ? (n._$Co ??= [])[o] = r : n._$Cl = r), r !== void 0 && (e =
|
|
308
|
+
return r?.constructor !== s && (r?._$AO?.(!1), s === void 0 ? r = void 0 : (r = new s(t), r._$AT(t, n, o)), o !== void 0 ? (n._$Co ??= [])[o] = r : n._$Cl = r), r !== void 0 && (e = Le(t, r._$AS(t, e.values), r, o)), e;
|
|
309
309
|
}
|
|
310
310
|
let yo = class {
|
|
311
311
|
constructor(e, n) {
|
|
@@ -318,23 +318,23 @@ let yo = class {
|
|
|
318
318
|
return this._$AM._$AU;
|
|
319
319
|
}
|
|
320
320
|
u(e) {
|
|
321
|
-
const { el: { content: n }, parts: o } = this._$AD, r = (e?.creationScope ??
|
|
321
|
+
const { el: { content: n }, parts: o } = this._$AD, r = (e?.creationScope ?? Se).importNode(n, !0);
|
|
322
322
|
Ee.currentNode = r;
|
|
323
323
|
let s = Ee.nextNode(), i = 0, l = 0, c = o[0];
|
|
324
324
|
for (; c !== void 0; ) {
|
|
325
325
|
if (i === c.index) {
|
|
326
326
|
let h;
|
|
327
|
-
c.type === 2 ? h = new
|
|
327
|
+
c.type === 2 ? h = new Pt(s, s.nextSibling, this, e) : c.type === 1 ? h = new c.ctor(s, c.name, c.strings, this, e) : c.type === 6 && (h = new _o(s, this, e)), this._$AV.push(h), c = o[++l];
|
|
328
328
|
}
|
|
329
329
|
i !== c?.index && (s = Ee.nextNode(), i++);
|
|
330
330
|
}
|
|
331
|
-
return Ee.currentNode =
|
|
331
|
+
return Ee.currentNode = Se, r;
|
|
332
332
|
}
|
|
333
333
|
p(e) {
|
|
334
334
|
let n = 0;
|
|
335
335
|
for (const o of this._$AV) o !== void 0 && (o.strings !== void 0 ? (o._$AI(e, o, n), n += o.strings.length - 2) : o._$AI(e[n])), n++;
|
|
336
336
|
}
|
|
337
|
-
},
|
|
337
|
+
}, Pt = class Dn {
|
|
338
338
|
get _$AU() {
|
|
339
339
|
return this._$AM?._$AU ?? this._$Cv;
|
|
340
340
|
}
|
|
@@ -353,7 +353,7 @@ let yo = class {
|
|
|
353
353
|
return this._$AB;
|
|
354
354
|
}
|
|
355
355
|
_$AI(e, n = this) {
|
|
356
|
-
e =
|
|
356
|
+
e = Le(this, e, n), Xe(e) ? e === D || e == null || e === "" ? (this._$AH !== D && this._$AR(), this._$AH = D) : e !== this._$AH && e !== Ae && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : go(e) ? this.k(e) : this._(e);
|
|
357
357
|
}
|
|
358
358
|
O(e) {
|
|
359
359
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -362,10 +362,10 @@ let yo = class {
|
|
|
362
362
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
363
363
|
}
|
|
364
364
|
_(e) {
|
|
365
|
-
this._$AH !== D && Xe(this._$AH) ? this._$AA.nextSibling.data = e : this.T(
|
|
365
|
+
this._$AH !== D && Xe(this._$AH) ? this._$AA.nextSibling.data = e : this.T(Se.createTextNode(e)), this._$AH = e;
|
|
366
366
|
}
|
|
367
367
|
$(e) {
|
|
368
|
-
const { values: n, _$litType$: o } = e, r = typeof o == "number" ? this._$AC(e) : (o.el === void 0 && (o.el =
|
|
368
|
+
const { values: n, _$litType$: o } = e, r = typeof o == "number" ? this._$AC(e) : (o.el === void 0 && (o.el = $t.createElement(Pn(o.h, o.h[0]), this.options)), o);
|
|
369
369
|
if (this._$AH?._$AD === r) this._$AH.p(n);
|
|
370
370
|
else {
|
|
371
371
|
const s = new yo(r, this), i = s.u(this.options);
|
|
@@ -374,10 +374,10 @@ let yo = class {
|
|
|
374
374
|
}
|
|
375
375
|
_$AC(e) {
|
|
376
376
|
let n = xn.get(e.strings);
|
|
377
|
-
return n === void 0 && xn.set(e.strings, n = new
|
|
377
|
+
return n === void 0 && xn.set(e.strings, n = new $t(e)), n;
|
|
378
378
|
}
|
|
379
379
|
k(e) {
|
|
380
|
-
|
|
380
|
+
zt(this._$AH) || (this._$AH = [], this._$AR());
|
|
381
381
|
const n = this._$AH;
|
|
382
382
|
let o, r = 0;
|
|
383
383
|
for (const s of e) r === n.length ? n.push(o = new Dn(this.O(We()), this.O(We()), this, this.options)) : o = n[r], o._$AI(s), r++;
|
|
@@ -393,7 +393,7 @@ let yo = class {
|
|
|
393
393
|
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
394
394
|
}
|
|
395
395
|
};
|
|
396
|
-
class
|
|
396
|
+
class gt {
|
|
397
397
|
get tagName() {
|
|
398
398
|
return this.element.tagName;
|
|
399
399
|
}
|
|
@@ -406,11 +406,11 @@ class pt {
|
|
|
406
406
|
_$AI(e, n = this, o, r) {
|
|
407
407
|
const s = this.strings;
|
|
408
408
|
let i = !1;
|
|
409
|
-
if (s === void 0) e =
|
|
409
|
+
if (s === void 0) e = Le(this, e, n, 0), i = !Xe(e) || e !== this._$AH && e !== Ae, i && (this._$AH = e);
|
|
410
410
|
else {
|
|
411
411
|
const l = e;
|
|
412
412
|
let c, h;
|
|
413
|
-
for (e = s[0], c = 0; c < s.length - 1; c++) h =
|
|
413
|
+
for (e = s[0], c = 0; c < s.length - 1; c++) h = Le(this, l[o + c], n, c), h === Ae && (h = this._$AH[c]), i ||= !Xe(h) || h !== this._$AH[c], h === D ? e = D : e !== D && (e += (h ?? "") + s[c + 1]), this._$AH[c] = h;
|
|
414
414
|
}
|
|
415
415
|
i && !r && this.j(e);
|
|
416
416
|
}
|
|
@@ -418,7 +418,7 @@ class pt {
|
|
|
418
418
|
e === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
class ko extends
|
|
421
|
+
class ko extends gt {
|
|
422
422
|
constructor() {
|
|
423
423
|
super(...arguments), this.type = 3;
|
|
424
424
|
}
|
|
@@ -426,19 +426,19 @@ class ko extends pt {
|
|
|
426
426
|
this.element[this.name] = e === D ? void 0 : e;
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
let wo = class extends
|
|
429
|
+
let wo = class extends gt {
|
|
430
430
|
constructor() {
|
|
431
431
|
super(...arguments), this.type = 4;
|
|
432
432
|
}
|
|
433
433
|
j(e) {
|
|
434
434
|
this.element.toggleAttribute(this.name, !!e && e !== D);
|
|
435
435
|
}
|
|
436
|
-
}, xo = class extends
|
|
436
|
+
}, xo = class extends gt {
|
|
437
437
|
constructor(e, n, o, r, s) {
|
|
438
438
|
super(e, n, o, r, s), this.type = 5;
|
|
439
439
|
}
|
|
440
440
|
_$AI(e, n = this) {
|
|
441
|
-
if ((e =
|
|
441
|
+
if ((e = Le(this, e, n, 0) ?? D) === Ae) return;
|
|
442
442
|
const o = this._$AH, r = e === D && o !== D || e.capture !== o.capture || e.once !== o.once || e.passive !== o.passive, s = e !== D && (o === D || r);
|
|
443
443
|
r && this.element.removeEventListener(this.name, this, o), s && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
444
444
|
}
|
|
@@ -453,22 +453,22 @@ let wo = class extends pt {
|
|
|
453
453
|
return this._$AM._$AU;
|
|
454
454
|
}
|
|
455
455
|
_$AI(e) {
|
|
456
|
-
|
|
456
|
+
Le(this, e);
|
|
457
457
|
}
|
|
458
458
|
};
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
const
|
|
459
|
+
const vo = Lt.litHtmlPolyfillSupport;
|
|
460
|
+
vo?.($t, Pt), (Lt.litHtmlVersions ??= []).push("3.3.0");
|
|
461
|
+
const Eo = (t, e, n) => {
|
|
462
462
|
const o = n?.renderBefore ?? e;
|
|
463
463
|
let r = o._$litPart$;
|
|
464
464
|
if (r === void 0) {
|
|
465
465
|
const s = n?.renderBefore ?? null;
|
|
466
|
-
o._$litPart$ = r = new
|
|
466
|
+
o._$litPart$ = r = new Pt(e.insertBefore(We(), s), s, void 0, n ?? {});
|
|
467
467
|
}
|
|
468
468
|
return r._$AI(t), r;
|
|
469
469
|
};
|
|
470
|
-
const
|
|
471
|
-
let qe = class extends
|
|
470
|
+
const Bt = globalThis;
|
|
471
|
+
let qe = class extends Ie {
|
|
472
472
|
constructor() {
|
|
473
473
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
474
474
|
}
|
|
@@ -478,7 +478,7 @@ let qe = class extends Oe {
|
|
|
478
478
|
}
|
|
479
479
|
update(e) {
|
|
480
480
|
const n = this.render();
|
|
481
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do =
|
|
481
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Eo(n, this.renderRoot, this.renderOptions);
|
|
482
482
|
}
|
|
483
483
|
connectedCallback() {
|
|
484
484
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -487,13 +487,13 @@ let qe = class extends Oe {
|
|
|
487
487
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
488
488
|
}
|
|
489
489
|
render() {
|
|
490
|
-
return
|
|
490
|
+
return Ae;
|
|
491
491
|
}
|
|
492
492
|
};
|
|
493
|
-
qe._$litElement$ = !0, qe.finalized = !0,
|
|
494
|
-
const So =
|
|
493
|
+
qe._$litElement$ = !0, qe.finalized = !0, Bt.litElementHydrateSupport?.({ LitElement: qe });
|
|
494
|
+
const So = Bt.litElementPolyfillSupport;
|
|
495
495
|
So?.({ LitElement: qe });
|
|
496
|
-
(
|
|
496
|
+
(Bt.litElementVersions ??= []).push("4.2.0");
|
|
497
497
|
const Ao = { CHILD: 2 }, $o = (t) => (...e) => ({ _$litDirective$: t, values: e });
|
|
498
498
|
class Ro {
|
|
499
499
|
constructor(e) {
|
|
@@ -511,13 +511,13 @@ class Ro {
|
|
|
511
511
|
return this.render(...n);
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
|
-
class
|
|
514
|
+
class Rt extends Ro {
|
|
515
515
|
constructor(e) {
|
|
516
516
|
if (super(e), this.it = D, e.type !== Ao.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
517
517
|
}
|
|
518
518
|
render(e) {
|
|
519
519
|
if (e === D || e == null) return this._t = void 0, this.it = e;
|
|
520
|
-
if (e ===
|
|
520
|
+
if (e === Ae) return e;
|
|
521
521
|
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
522
522
|
if (e === this.it) return this._t;
|
|
523
523
|
this.it = e;
|
|
@@ -525,14 +525,14 @@ class $t extends Ro {
|
|
|
525
525
|
return n.raw = n, this._t = { _$litType$: this.constructor.resultType, strings: n, values: [] };
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
|
|
529
|
-
const To = $o(
|
|
530
|
-
function
|
|
528
|
+
Rt.directiveName = "unsafeHTML", Rt.resultType = 1;
|
|
529
|
+
const To = $o(Rt);
|
|
530
|
+
function Dt() {
|
|
531
531
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
532
532
|
}
|
|
533
|
-
var
|
|
533
|
+
var Re = Dt();
|
|
534
534
|
function Un(t) {
|
|
535
|
-
|
|
535
|
+
Re = t;
|
|
536
536
|
}
|
|
537
537
|
var Ke = { exec: () => null };
|
|
538
538
|
function N(t, e = "") {
|
|
@@ -542,15 +542,15 @@ function N(t, e = "") {
|
|
|
542
542
|
}, getRegex: () => new RegExp(n, e) };
|
|
543
543
|
return o;
|
|
544
544
|
}
|
|
545
|
-
var K = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (t) => new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}#`), htmlBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}<(?:[a-z].*>|!--)`, "i") }, Co = /^(?:[ \t]*(?:\n|$))+/, No = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Mo = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Ve = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Oo = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
|
|
546
|
-
]`).replace("lheading", jn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, jo = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Fo = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Gn = /^( {2,}|\\)\n(?!\s*$)/, Go = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
|
|
545
|
+
var K = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (t) => new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}#`), htmlBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}<(?:[a-z].*>|!--)`, "i") }, Co = /^(?:[ \t]*(?:\n|$))+/, No = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Mo = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Ve = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Oo = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Ut = /(?:[*+-]|\d{1,9}[.)])/, Hn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, jn = N(Hn).replace(/bull/g, Ut).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Io = N(Hn).replace(/bull/g, Ut).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Ht = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Lo = /^[^\n]+/, jt = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, zo = N(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", jt).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Po = N(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Ut).getRegex(), bt = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Ft = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Bo = N("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Ft).replace("tag", bt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Fn = N(Ht).replace("hr", Ve).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", bt).getRegex(), Do = N(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Fn).getRegex(), Gt = { blockquote: Do, code: No, def: zo, fences: Mo, heading: Oo, hr: Ve, html: Bo, lheading: jn, list: Po, newline: Co, paragraph: Fn, table: Ke, text: Lo }, _n = N("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Ve).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", bt).getRegex(), Uo = { ...Gt, lheading: Io, table: _n, paragraph: N(Ht).replace("hr", Ve).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", _n).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", bt).getRegex() }, Ho = { ...Gt, html: N(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", Ft).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: Ke, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: N(Ht).replace("hr", Ve).replace("heading", ` *#{1,6} *[^
|
|
546
|
+
]`).replace("lheading", jn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, jo = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Fo = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Gn = /^( {2,}|\\)\n(?!\s*$)/, Go = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, ft = /[\p{P}\p{S}]/u, Zt = /[\s\p{P}\p{S}]/u, Zn = /[^\s\p{P}\p{S}]/u, Zo = N(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Zt).getRegex(), qn = /(?!~)[\p{P}\p{S}]/u, qo = /(?!~)[\s\p{P}\p{S}]/u, Ko = /(?:[^\s\p{P}\p{S}]|~)/u, Wo = /\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g, Kn = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Xo = N(Kn, "u").replace(/punct/g, ft).getRegex(), Vo = N(Kn, "u").replace(/punct/g, qn).getRegex(), Wn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Yo = N(Wn, "gu").replace(/notPunctSpace/g, Zn).replace(/punctSpace/g, Zt).replace(/punct/g, ft).getRegex(), Qo = N(Wn, "gu").replace(/notPunctSpace/g, Ko).replace(/punctSpace/g, qo).replace(/punct/g, qn).getRegex(), Jo = N("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Zn).replace(/punctSpace/g, Zt).replace(/punct/g, ft).getRegex(), ei = N(/\\(punct)/, "gu").replace(/punct/g, ft).getRegex(), ti = N(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), ni = N(Ft).replace("(?:-->|$)", "-->").getRegex(), ri = N("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", ni).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), ct = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/, oi = N(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", ct).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Xn = N(/^!?\[(label)\]\[(ref)\]/).replace("label", ct).replace("ref", jt).getRegex(), Vn = N(/^!?\[(ref)\](?:\[\])?/).replace("ref", jt).getRegex(), ii = N("reflink|nolink(?!\\()", "g").replace("reflink", Xn).replace("nolink", Vn).getRegex(), qt = { _backpedal: Ke, anyPunctuation: ei, autolink: ti, blockSkip: Wo, br: Gn, code: Fo, del: Ke, emStrongLDelim: Xo, emStrongRDelimAst: Yo, emStrongRDelimUnd: Jo, escape: jo, link: oi, nolink: Vn, punctuation: Zo, reflink: Xn, reflinkSearch: ii, tag: ri, text: Go, url: Ke }, si = { ...qt, link: N(/^!?\[(label)\]\((.*?)\)/).replace("label", ct).getRegex(), reflink: N(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", ct).getRegex() }, Tt = { ...qt, emStrongRDelimAst: Qo, emStrongLDelim: Vo, url: N(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/ }, ai = { ...Tt, br: N(Gn).replace("{2,}", "*").getRegex(), text: N(Tt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, it = { normal: Gt, gfm: Uo, pedantic: Ho }, je = { normal: qt, gfm: Tt, breaks: ai, pedantic: si }, li = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, vn = (t) => li[t];
|
|
547
547
|
function ae(t, e) {
|
|
548
548
|
if (e) {
|
|
549
|
-
if (K.escapeTest.test(t)) return t.replace(K.escapeReplace,
|
|
550
|
-
} else if (K.escapeTestNoEncode.test(t)) return t.replace(K.escapeReplaceNoEncode,
|
|
549
|
+
if (K.escapeTest.test(t)) return t.replace(K.escapeReplace, vn);
|
|
550
|
+
} else if (K.escapeTestNoEncode.test(t)) return t.replace(K.escapeReplaceNoEncode, vn);
|
|
551
551
|
return t;
|
|
552
552
|
}
|
|
553
|
-
function
|
|
553
|
+
function En(t) {
|
|
554
554
|
try {
|
|
555
555
|
t = encodeURI(t).replace(K.percentDecode, "%");
|
|
556
556
|
} catch {
|
|
@@ -604,12 +604,12 @@ function di(t, e, n) {
|
|
|
604
604
|
}).join(`
|
|
605
605
|
`);
|
|
606
606
|
}
|
|
607
|
-
var
|
|
607
|
+
var dt = class {
|
|
608
608
|
options;
|
|
609
609
|
rules;
|
|
610
610
|
lexer;
|
|
611
611
|
constructor(t) {
|
|
612
|
-
this.options = t ||
|
|
612
|
+
this.options = t || Re;
|
|
613
613
|
}
|
|
614
614
|
space(t) {
|
|
615
615
|
let e = this.rules.block.newline.exec(t);
|
|
@@ -669,16 +669,16 @@ ${f}` : f;
|
|
|
669
669
|
let m = s.at(-1);
|
|
670
670
|
if (m?.type === "code") break;
|
|
671
671
|
if (m?.type === "blockquote") {
|
|
672
|
-
let $ = m,
|
|
672
|
+
let $ = m, E = $.raw + `
|
|
673
673
|
` + n.join(`
|
|
674
|
-
`), R = this.blockquote(
|
|
674
|
+
`), R = this.blockquote(E);
|
|
675
675
|
s[s.length - 1] = R, o = o.substring(0, o.length - $.raw.length) + R.raw, r = r.substring(0, r.length - $.text.length) + R.text;
|
|
676
676
|
break;
|
|
677
677
|
} else if (m?.type === "list") {
|
|
678
|
-
let $ = m,
|
|
678
|
+
let $ = m, E = $.raw + `
|
|
679
679
|
` + n.join(`
|
|
680
|
-
`), R = this.list(
|
|
681
|
-
s[s.length - 1] = R, o = o.substring(0, o.length - m.raw.length) + R.raw, r = r.substring(0, r.length - $.raw.length) + R.raw, n =
|
|
680
|
+
`), R = this.list(E);
|
|
681
|
+
s[s.length - 1] = R, o = o.substring(0, o.length - m.raw.length) + R.raw, r = r.substring(0, r.length - $.raw.length) + R.raw, n = E.substring(s.at(-1).raw.length).split(`
|
|
682
682
|
`);
|
|
683
683
|
continue;
|
|
684
684
|
}
|
|
@@ -698,23 +698,23 @@ ${f}` : f;
|
|
|
698
698
|
h = e[0], t = t.substring(h.length);
|
|
699
699
|
let b = e[2].split(`
|
|
700
700
|
`, 1)[0].replace(this.rules.other.listReplaceTabs, (X) => " ".repeat(3 * X.length)), m = t.split(`
|
|
701
|
-
`, 1)[0], $ = !b.trim(),
|
|
702
|
-
if (this.options.pedantic ? (
|
|
701
|
+
`, 1)[0], $ = !b.trim(), E = 0;
|
|
702
|
+
if (this.options.pedantic ? (E = 2, f = b.trimStart()) : $ ? E = e[1].length + 1 : (E = e[2].search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, f = b.slice(E), E += e[1].length), $ && this.rules.other.blankLine.test(m) && (h += m + `
|
|
703
703
|
`, t = t.substring(m.length + 1), c = !0), !c) {
|
|
704
|
-
let X = this.rules.other.nextBulletRegex(
|
|
704
|
+
let X = this.rules.other.nextBulletRegex(E), G = this.rules.other.hrRegex(E), J = this.rules.other.fencesBeginRegex(E), oe = this.rules.other.headingBeginRegex(E), V = this.rules.other.htmlBeginRegex(E);
|
|
705
705
|
for (; t; ) {
|
|
706
706
|
let j = t.split(`
|
|
707
707
|
`, 1)[0], ee;
|
|
708
708
|
if (m = j, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), ee = m) : ee = m.replace(this.rules.other.tabCharGlobal, " "), J.test(m) || oe.test(m) || V.test(m) || X.test(m) || G.test(m)) break;
|
|
709
|
-
if (ee.search(this.rules.other.nonSpaceChar) >=
|
|
710
|
-
` + ee.slice(
|
|
709
|
+
if (ee.search(this.rules.other.nonSpaceChar) >= E || !m.trim()) f += `
|
|
710
|
+
` + ee.slice(E);
|
|
711
711
|
else {
|
|
712
712
|
if ($ || b.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || J.test(b) || oe.test(b) || G.test(b)) break;
|
|
713
713
|
f += `
|
|
714
714
|
` + m;
|
|
715
715
|
}
|
|
716
716
|
!$ && !m.trim() && ($ = !0), h += j + `
|
|
717
|
-
`, t = t.substring(j.length + 1), b = ee.slice(
|
|
717
|
+
`, t = t.substring(j.length + 1), b = ee.slice(E);
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
720
|
r.loose || (i ? r.loose = !0 : this.rules.other.doubleBlankLine.test(h) && (i = !0));
|
|
@@ -884,25 +884,25 @@ ${f}` : f;
|
|
|
884
884
|
return { type: "text", raw: e[0], text: e[0], escaped: n };
|
|
885
885
|
}
|
|
886
886
|
}
|
|
887
|
-
},
|
|
887
|
+
}, pe = class Ct {
|
|
888
888
|
tokens;
|
|
889
889
|
options;
|
|
890
890
|
state;
|
|
891
891
|
tokenizer;
|
|
892
892
|
inlineQueue;
|
|
893
893
|
constructor(e) {
|
|
894
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e ||
|
|
895
|
-
let n = { other: K, block:
|
|
896
|
-
this.options.pedantic ? (n.block =
|
|
894
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || Re, this.options.tokenizer = this.options.tokenizer || new dt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
895
|
+
let n = { other: K, block: it.normal, inline: je.normal };
|
|
896
|
+
this.options.pedantic ? (n.block = it.pedantic, n.inline = je.pedantic) : this.options.gfm && (n.block = it.gfm, this.options.breaks ? n.inline = je.breaks : n.inline = je.gfm), this.tokenizer.rules = n;
|
|
897
897
|
}
|
|
898
898
|
static get rules() {
|
|
899
|
-
return { block:
|
|
899
|
+
return { block: it, inline: je };
|
|
900
900
|
}
|
|
901
901
|
static lex(e, n) {
|
|
902
|
-
return new
|
|
902
|
+
return new Ct(n).lex(e);
|
|
903
903
|
}
|
|
904
904
|
static lexInline(e, n) {
|
|
905
|
-
return new
|
|
905
|
+
return new Ct(n).inlineTokens(e);
|
|
906
906
|
}
|
|
907
907
|
lex(e) {
|
|
908
908
|
e = e.replace(K.carriageReturn, `
|
|
@@ -1090,11 +1090,11 @@ ${f}` : f;
|
|
|
1090
1090
|
}
|
|
1091
1091
|
return n;
|
|
1092
1092
|
}
|
|
1093
|
-
},
|
|
1093
|
+
}, ht = class {
|
|
1094
1094
|
options;
|
|
1095
1095
|
parser;
|
|
1096
1096
|
constructor(t) {
|
|
1097
|
-
this.options = t ||
|
|
1097
|
+
this.options = t || Re;
|
|
1098
1098
|
}
|
|
1099
1099
|
space(t) {
|
|
1100
1100
|
return "";
|
|
@@ -1195,7 +1195,7 @@ ${t}</tr>
|
|
|
1195
1195
|
return `<del>${this.parser.parseInline(t)}</del>`;
|
|
1196
1196
|
}
|
|
1197
1197
|
link({ href: t, title: e, tokens: n }) {
|
|
1198
|
-
let o = this.parser.parseInline(n), r =
|
|
1198
|
+
let o = this.parser.parseInline(n), r = En(t);
|
|
1199
1199
|
if (r === null) return o;
|
|
1200
1200
|
t = r;
|
|
1201
1201
|
let s = '<a href="' + t + '"';
|
|
@@ -1203,7 +1203,7 @@ ${t}</tr>
|
|
|
1203
1203
|
}
|
|
1204
1204
|
image({ href: t, title: e, text: n, tokens: o }) {
|
|
1205
1205
|
o && (n = this.parser.parseInline(o, this.parser.textRenderer));
|
|
1206
|
-
let r =
|
|
1206
|
+
let r = En(t);
|
|
1207
1207
|
if (r === null) return ae(n);
|
|
1208
1208
|
t = r;
|
|
1209
1209
|
let s = `<img src="${t}" alt="${n}"`;
|
|
@@ -1212,7 +1212,7 @@ ${t}</tr>
|
|
|
1212
1212
|
text(t) {
|
|
1213
1213
|
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : ae(t.text);
|
|
1214
1214
|
}
|
|
1215
|
-
},
|
|
1215
|
+
}, Kt = class {
|
|
1216
1216
|
strong({ text: t }) {
|
|
1217
1217
|
return t;
|
|
1218
1218
|
}
|
|
@@ -1240,18 +1240,18 @@ ${t}</tr>
|
|
|
1240
1240
|
br() {
|
|
1241
1241
|
return "";
|
|
1242
1242
|
}
|
|
1243
|
-
},
|
|
1243
|
+
}, ge = class Nt {
|
|
1244
1244
|
options;
|
|
1245
1245
|
renderer;
|
|
1246
1246
|
textRenderer;
|
|
1247
1247
|
constructor(e) {
|
|
1248
|
-
this.options = e ||
|
|
1248
|
+
this.options = e || Re, this.options.renderer = this.options.renderer || new ht(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Kt();
|
|
1249
1249
|
}
|
|
1250
1250
|
static parse(e, n) {
|
|
1251
|
-
return new
|
|
1251
|
+
return new Nt(n).parse(e);
|
|
1252
1252
|
}
|
|
1253
1253
|
static parseInline(e, n) {
|
|
1254
|
-
return new
|
|
1254
|
+
return new Nt(n).parseInline(e);
|
|
1255
1255
|
}
|
|
1256
1256
|
parse(e, n = !0) {
|
|
1257
1257
|
let o = "";
|
|
@@ -1388,7 +1388,7 @@ ${t}</tr>
|
|
|
1388
1388
|
options;
|
|
1389
1389
|
block;
|
|
1390
1390
|
constructor(t) {
|
|
1391
|
-
this.options = t ||
|
|
1391
|
+
this.options = t || Re;
|
|
1392
1392
|
}
|
|
1393
1393
|
static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
|
|
1394
1394
|
static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
@@ -1405,21 +1405,21 @@ ${t}</tr>
|
|
|
1405
1405
|
return t;
|
|
1406
1406
|
}
|
|
1407
1407
|
provideLexer() {
|
|
1408
|
-
return this.block ?
|
|
1408
|
+
return this.block ? pe.lex : pe.lexInline;
|
|
1409
1409
|
}
|
|
1410
1410
|
provideParser() {
|
|
1411
|
-
return this.block ?
|
|
1411
|
+
return this.block ? ge.parse : ge.parseInline;
|
|
1412
1412
|
}
|
|
1413
1413
|
}, Yn = class {
|
|
1414
|
-
defaults =
|
|
1414
|
+
defaults = Dt();
|
|
1415
1415
|
options = this.setOptions;
|
|
1416
1416
|
parse = this.parseMarkdown(!0);
|
|
1417
1417
|
parseInline = this.parseMarkdown(!1);
|
|
1418
|
-
Parser =
|
|
1419
|
-
Renderer =
|
|
1420
|
-
TextRenderer =
|
|
1421
|
-
Lexer =
|
|
1422
|
-
Tokenizer =
|
|
1418
|
+
Parser = ge;
|
|
1419
|
+
Renderer = ht;
|
|
1420
|
+
TextRenderer = Kt;
|
|
1421
|
+
Lexer = pe;
|
|
1422
|
+
Tokenizer = dt;
|
|
1423
1423
|
Hooks = Ge;
|
|
1424
1424
|
constructor(...t) {
|
|
1425
1425
|
this.use(...t);
|
|
@@ -1468,7 +1468,7 @@ ${t}</tr>
|
|
|
1468
1468
|
}
|
|
1469
1469
|
"childTokens" in r && r.childTokens && (e.childTokens[r.name] = r.childTokens);
|
|
1470
1470
|
}), o.extensions = e), n.renderer) {
|
|
1471
|
-
let r = this.defaults.renderer || new
|
|
1471
|
+
let r = this.defaults.renderer || new ht(this.defaults);
|
|
1472
1472
|
for (let s in n.renderer) {
|
|
1473
1473
|
if (!(s in r)) throw new Error(`renderer '${s}' does not exist`);
|
|
1474
1474
|
if (["options", "parser"].includes(s)) continue;
|
|
@@ -1481,7 +1481,7 @@ ${t}</tr>
|
|
|
1481
1481
|
o.renderer = r;
|
|
1482
1482
|
}
|
|
1483
1483
|
if (n.tokenizer) {
|
|
1484
|
-
let r = this.defaults.tokenizer || new
|
|
1484
|
+
let r = this.defaults.tokenizer || new dt(this.defaults);
|
|
1485
1485
|
for (let s in n.tokenizer) {
|
|
1486
1486
|
if (!(s in r)) throw new Error(`tokenizer '${s}' does not exist`);
|
|
1487
1487
|
if (["options", "rules", "lexer"].includes(s)) continue;
|
|
@@ -1524,10 +1524,10 @@ ${t}</tr>
|
|
|
1524
1524
|
return this.defaults = { ...this.defaults, ...t }, this;
|
|
1525
1525
|
}
|
|
1526
1526
|
lexer(t, e) {
|
|
1527
|
-
return
|
|
1527
|
+
return pe.lex(t, e ?? this.defaults);
|
|
1528
1528
|
}
|
|
1529
1529
|
parser(t, e) {
|
|
1530
|
-
return
|
|
1530
|
+
return ge.parse(t, e ?? this.defaults);
|
|
1531
1531
|
}
|
|
1532
1532
|
parseMarkdown(t) {
|
|
1533
1533
|
return (e, n) => {
|
|
@@ -1536,7 +1536,7 @@ ${t}</tr>
|
|
|
1536
1536
|
if (typeof e > "u" || e === null) return s(new Error("marked(): input parameter is undefined or null"));
|
|
1537
1537
|
if (typeof e != "string") return s(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
|
|
1538
1538
|
r.hooks && (r.hooks.options = r, r.hooks.block = t);
|
|
1539
|
-
let i = r.hooks ? r.hooks.provideLexer() : t ?
|
|
1539
|
+
let i = r.hooks ? r.hooks.provideLexer() : t ? pe.lex : pe.lexInline, l = r.hooks ? r.hooks.provideParser() : t ? ge.parse : ge.parseInline;
|
|
1540
1540
|
if (r.async) return Promise.resolve(r.hooks ? r.hooks.preprocess(e) : e).then((c) => i(c, r)).then((c) => r.hooks ? r.hooks.processAllTokens(c) : c).then((c) => r.walkTokens ? Promise.all(this.walkTokens(c, r.walkTokens)).then(() => c) : c).then((c) => l(c, r)).then((c) => r.hooks ? r.hooks.postprocess(c) : c).catch(s);
|
|
1541
1541
|
try {
|
|
1542
1542
|
r.hooks && (e = r.hooks.preprocess(e));
|
|
@@ -1560,29 +1560,29 @@ Please report this to https://github.com/markedjs/marked.`, t) {
|
|
|
1560
1560
|
throw n;
|
|
1561
1561
|
};
|
|
1562
1562
|
}
|
|
1563
|
-
},
|
|
1563
|
+
}, $e = new Yn();
|
|
1564
1564
|
function O(t, e) {
|
|
1565
|
-
return
|
|
1565
|
+
return $e.parse(t, e);
|
|
1566
1566
|
}
|
|
1567
1567
|
O.options = O.setOptions = function(t) {
|
|
1568
|
-
return
|
|
1568
|
+
return $e.setOptions(t), O.defaults = $e.defaults, Un(O.defaults), O;
|
|
1569
1569
|
};
|
|
1570
|
-
O.getDefaults =
|
|
1571
|
-
O.defaults =
|
|
1570
|
+
O.getDefaults = Dt;
|
|
1571
|
+
O.defaults = Re;
|
|
1572
1572
|
O.use = function(...t) {
|
|
1573
|
-
return
|
|
1573
|
+
return $e.use(...t), O.defaults = $e.defaults, Un(O.defaults), O;
|
|
1574
1574
|
};
|
|
1575
1575
|
O.walkTokens = function(t, e) {
|
|
1576
|
-
return
|
|
1576
|
+
return $e.walkTokens(t, e);
|
|
1577
1577
|
};
|
|
1578
|
-
O.parseInline =
|
|
1579
|
-
O.Parser =
|
|
1580
|
-
O.parser =
|
|
1581
|
-
O.Renderer =
|
|
1582
|
-
O.TextRenderer =
|
|
1583
|
-
O.Lexer =
|
|
1584
|
-
O.lexer =
|
|
1585
|
-
O.Tokenizer =
|
|
1578
|
+
O.parseInline = $e.parseInline;
|
|
1579
|
+
O.Parser = ge;
|
|
1580
|
+
O.parser = ge.parse;
|
|
1581
|
+
O.Renderer = ht;
|
|
1582
|
+
O.TextRenderer = Kt;
|
|
1583
|
+
O.Lexer = pe;
|
|
1584
|
+
O.lexer = pe.lex;
|
|
1585
|
+
O.Tokenizer = dt;
|
|
1586
1586
|
O.Hooks = Ge;
|
|
1587
1587
|
O.parse = O;
|
|
1588
1588
|
O.options;
|
|
@@ -1590,8 +1590,8 @@ O.setOptions;
|
|
|
1590
1590
|
O.use;
|
|
1591
1591
|
O.walkTokens;
|
|
1592
1592
|
O.parseInline;
|
|
1593
|
-
|
|
1594
|
-
|
|
1593
|
+
ge.parse;
|
|
1594
|
+
pe.lex;
|
|
1595
1595
|
function hi(t) {
|
|
1596
1596
|
if (typeof t == "function" && (t = {
|
|
1597
1597
|
highlight: t
|
|
@@ -1647,9 +1647,9 @@ function Cn(t, e) {
|
|
|
1647
1647
|
function bi(t) {
|
|
1648
1648
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1649
1649
|
}
|
|
1650
|
-
var
|
|
1650
|
+
var St, Nn;
|
|
1651
1651
|
function fi() {
|
|
1652
|
-
if (Nn) return
|
|
1652
|
+
if (Nn) return St;
|
|
1653
1653
|
Nn = 1;
|
|
1654
1654
|
function t(a) {
|
|
1655
1655
|
return a instanceof Map ? a.clear = a.delete = a.set = function() {
|
|
@@ -1657,8 +1657,8 @@ function fi() {
|
|
|
1657
1657
|
} : a instanceof Set && (a.add = a.clear = a.delete = function() {
|
|
1658
1658
|
throw new Error("set is read-only");
|
|
1659
1659
|
}), Object.freeze(a), Object.getOwnPropertyNames(a).forEach((d) => {
|
|
1660
|
-
const p = a[d],
|
|
1661
|
-
(
|
|
1660
|
+
const p = a[d], v = typeof p;
|
|
1661
|
+
(v === "object" || v === "function") && !Object.isFrozen(p) && t(p);
|
|
1662
1662
|
}), a;
|
|
1663
1663
|
}
|
|
1664
1664
|
class e {
|
|
@@ -1677,11 +1677,11 @@ function fi() {
|
|
|
1677
1677
|
}
|
|
1678
1678
|
function o(a, ...d) {
|
|
1679
1679
|
const p = /* @__PURE__ */ Object.create(null);
|
|
1680
|
-
for (const
|
|
1681
|
-
p[
|
|
1682
|
-
return d.forEach(function(
|
|
1683
|
-
for (const z in
|
|
1684
|
-
p[z] =
|
|
1680
|
+
for (const v in a)
|
|
1681
|
+
p[v] = a[v];
|
|
1682
|
+
return d.forEach(function(v) {
|
|
1683
|
+
for (const z in v)
|
|
1684
|
+
p[z] = v[z];
|
|
1685
1685
|
}), /** @type {T} */
|
|
1686
1686
|
p;
|
|
1687
1687
|
}
|
|
@@ -1692,7 +1692,7 @@ function fi() {
|
|
|
1692
1692
|
const p = a.split(".");
|
|
1693
1693
|
return [
|
|
1694
1694
|
`${d}${p.shift()}`,
|
|
1695
|
-
...p.map((
|
|
1695
|
+
...p.map((v, z) => `${v}${"_".repeat(z + 1)}`)
|
|
1696
1696
|
].join(" ");
|
|
1697
1697
|
}
|
|
1698
1698
|
return `${d}${a}`;
|
|
@@ -1793,7 +1793,7 @@ function fi() {
|
|
|
1793
1793
|
* @param {Node} node
|
|
1794
1794
|
*/
|
|
1795
1795
|
static _walk(d, p) {
|
|
1796
|
-
return typeof p == "string" ? d.addText(p) : p.children && (d.openNode(p), p.children.forEach((
|
|
1796
|
+
return typeof p == "string" ? d.addText(p) : p.children && (d.openNode(p), p.children.forEach((v) => this._walk(d, v)), d.closeNode(p)), d;
|
|
1797
1797
|
}
|
|
1798
1798
|
/**
|
|
1799
1799
|
* @param {Node} node
|
|
@@ -1829,8 +1829,8 @@ function fi() {
|
|
|
1829
1829
|
* @param {string} name
|
|
1830
1830
|
*/
|
|
1831
1831
|
__addSublanguage(d, p) {
|
|
1832
|
-
const
|
|
1833
|
-
p && (
|
|
1832
|
+
const v = d.root;
|
|
1833
|
+
p && (v.scope = `language:${p}`), this.add(v);
|
|
1834
1834
|
}
|
|
1835
1835
|
toHTML() {
|
|
1836
1836
|
return new l(this, this.options).value();
|
|
@@ -1848,7 +1848,7 @@ function fi() {
|
|
|
1848
1848
|
function $(a) {
|
|
1849
1849
|
return R("(?:", a, ")*");
|
|
1850
1850
|
}
|
|
1851
|
-
function
|
|
1851
|
+
function E(a) {
|
|
1852
1852
|
return R("(?:", a, ")?");
|
|
1853
1853
|
}
|
|
1854
1854
|
function R(...a) {
|
|
@@ -1859,7 +1859,7 @@ function fi() {
|
|
|
1859
1859
|
return typeof d == "object" && d.constructor === Object ? (a.splice(a.length - 1, 1), d) : {};
|
|
1860
1860
|
}
|
|
1861
1861
|
function X(...a) {
|
|
1862
|
-
return "(" + (W(a).capture ? "" : "?:") + a.map((
|
|
1862
|
+
return "(" + (W(a).capture ? "" : "?:") + a.map((v) => b(v)).join("|") + ")";
|
|
1863
1863
|
}
|
|
1864
1864
|
function G(a) {
|
|
1865
1865
|
return new RegExp(a.toString() + "|").exec("").length - 1;
|
|
@@ -1871,10 +1871,10 @@ function fi() {
|
|
|
1871
1871
|
const oe = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
|
|
1872
1872
|
function V(a, { joinWith: d }) {
|
|
1873
1873
|
let p = 0;
|
|
1874
|
-
return a.map((
|
|
1874
|
+
return a.map((v) => {
|
|
1875
1875
|
p += 1;
|
|
1876
1876
|
const z = p;
|
|
1877
|
-
let P = b(
|
|
1877
|
+
let P = b(v), k = "";
|
|
1878
1878
|
for (; P.length > 0; ) {
|
|
1879
1879
|
const y = oe.exec(P);
|
|
1880
1880
|
if (!y) {
|
|
@@ -1884,9 +1884,9 @@ function fi() {
|
|
|
1884
1884
|
k += P.substring(0, y.index), P = P.substring(y.index + y[0].length), y[0][0] === "\\" && y[1] ? k += "\\" + String(Number(y[1]) + z) : (k += y[0], y[0] === "(" && p++);
|
|
1885
1885
|
}
|
|
1886
1886
|
return k;
|
|
1887
|
-
}).map((
|
|
1887
|
+
}).map((v) => `(${v})`).join(d);
|
|
1888
1888
|
}
|
|
1889
|
-
const j = /\b\B/, ee = "[a-zA-Z]\\w*",
|
|
1889
|
+
const j = /\b\B/, ee = "[a-zA-Z]\\w*", ce = "[a-zA-Z_]\\w*", Te = "\\b\\d+(\\.\\d+)?", Ce = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", Ne = "\\b(0b[01]+)", ze = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", Pe = (a = {}) => {
|
|
1890
1890
|
const d = /^#![ ]*\//;
|
|
1891
1891
|
return a.binary && (a.begin = R(
|
|
1892
1892
|
d,
|
|
@@ -1899,11 +1899,11 @@ function fi() {
|
|
|
1899
1899
|
end: /$/,
|
|
1900
1900
|
relevance: 0,
|
|
1901
1901
|
/** @type {ModeCallback} */
|
|
1902
|
-
"on:begin": (p,
|
|
1903
|
-
p.index !== 0 &&
|
|
1902
|
+
"on:begin": (p, v) => {
|
|
1903
|
+
p.index !== 0 && v.ignoreMatch();
|
|
1904
1904
|
}
|
|
1905
1905
|
}, a);
|
|
1906
|
-
},
|
|
1906
|
+
}, de = {
|
|
1907
1907
|
begin: "\\\\[\\s\\S]",
|
|
1908
1908
|
relevance: 0
|
|
1909
1909
|
}, Be = {
|
|
@@ -1911,17 +1911,17 @@ function fi() {
|
|
|
1911
1911
|
begin: "'",
|
|
1912
1912
|
end: "'",
|
|
1913
1913
|
illegal: "\\n",
|
|
1914
|
-
contains: [
|
|
1915
|
-
},
|
|
1914
|
+
contains: [de]
|
|
1915
|
+
}, ke = {
|
|
1916
1916
|
scope: "string",
|
|
1917
1917
|
begin: '"',
|
|
1918
1918
|
end: '"',
|
|
1919
1919
|
illegal: "\\n",
|
|
1920
|
-
contains: [
|
|
1920
|
+
contains: [de]
|
|
1921
1921
|
}, De = {
|
|
1922
1922
|
begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
|
|
1923
1923
|
}, C = function(a, d, p = {}) {
|
|
1924
|
-
const
|
|
1924
|
+
const v = o(
|
|
1925
1925
|
{
|
|
1926
1926
|
scope: "comment",
|
|
1927
1927
|
begin: a,
|
|
@@ -1930,7 +1930,7 @@ function fi() {
|
|
|
1930
1930
|
},
|
|
1931
1931
|
p
|
|
1932
1932
|
);
|
|
1933
|
-
|
|
1933
|
+
v.contains.push({
|
|
1934
1934
|
scope: "doctag",
|
|
1935
1935
|
// hack to avoid the space from being included. the space is necessary to
|
|
1936
1936
|
// match here to prevent the plain text rule below from gobbling up doctags
|
|
@@ -1960,7 +1960,7 @@ function fi() {
|
|
|
1960
1960
|
/[A-Za-z][a-z]{2,}/
|
|
1961
1961
|
// allow capitalized words at beginning of sentences
|
|
1962
1962
|
);
|
|
1963
|
-
return
|
|
1963
|
+
return v.contains.push(
|
|
1964
1964
|
{
|
|
1965
1965
|
// TODO: how to include ", (, ) without breaking grammars that use these for
|
|
1966
1966
|
// comment delimiters?
|
|
@@ -1985,30 +1985,30 @@ function fi() {
|
|
|
1985
1985
|
)
|
|
1986
1986
|
// look for 3 words in a row
|
|
1987
1987
|
}
|
|
1988
|
-
),
|
|
1989
|
-
}, q = C("//", "$"), Y = C("/\\*", "\\*/"), ne = C("#", "$"),
|
|
1988
|
+
), v;
|
|
1989
|
+
}, q = C("//", "$"), Y = C("/\\*", "\\*/"), ne = C("#", "$"), he = {
|
|
1990
1990
|
scope: "number",
|
|
1991
|
-
begin:
|
|
1991
|
+
begin: Te,
|
|
1992
1992
|
relevance: 0
|
|
1993
|
-
},
|
|
1993
|
+
}, we = {
|
|
1994
1994
|
scope: "number",
|
|
1995
|
-
begin:
|
|
1995
|
+
begin: Ce,
|
|
1996
1996
|
relevance: 0
|
|
1997
1997
|
}, pr = {
|
|
1998
1998
|
scope: "number",
|
|
1999
|
-
begin:
|
|
1999
|
+
begin: Ne,
|
|
2000
2000
|
relevance: 0
|
|
2001
2001
|
}, gr = {
|
|
2002
2002
|
scope: "regexp",
|
|
2003
2003
|
begin: /\/(?=[^/\n]*\/)/,
|
|
2004
2004
|
end: /\/[gimuy]*/,
|
|
2005
2005
|
contains: [
|
|
2006
|
-
|
|
2006
|
+
de,
|
|
2007
2007
|
{
|
|
2008
2008
|
begin: /\[/,
|
|
2009
2009
|
end: /\]/,
|
|
2010
2010
|
relevance: 0,
|
|
2011
|
-
contains: [
|
|
2011
|
+
contains: [de]
|
|
2012
2012
|
}
|
|
2013
2013
|
]
|
|
2014
2014
|
}, br = {
|
|
@@ -2017,24 +2017,24 @@ function fi() {
|
|
|
2017
2017
|
relevance: 0
|
|
2018
2018
|
}, fr = {
|
|
2019
2019
|
scope: "title",
|
|
2020
|
-
begin:
|
|
2020
|
+
begin: ce,
|
|
2021
2021
|
relevance: 0
|
|
2022
2022
|
}, mr = {
|
|
2023
2023
|
// excludes method names from keyword processing
|
|
2024
|
-
begin: "\\.\\s*" +
|
|
2024
|
+
begin: "\\.\\s*" + ce,
|
|
2025
2025
|
relevance: 0
|
|
2026
2026
|
};
|
|
2027
|
-
var
|
|
2027
|
+
var Qe = /* @__PURE__ */ Object.freeze({
|
|
2028
2028
|
__proto__: null,
|
|
2029
2029
|
APOS_STRING_MODE: Be,
|
|
2030
|
-
BACKSLASH_ESCAPE:
|
|
2030
|
+
BACKSLASH_ESCAPE: de,
|
|
2031
2031
|
BINARY_NUMBER_MODE: pr,
|
|
2032
|
-
BINARY_NUMBER_RE:
|
|
2032
|
+
BINARY_NUMBER_RE: Ne,
|
|
2033
2033
|
COMMENT: C,
|
|
2034
2034
|
C_BLOCK_COMMENT_MODE: Y,
|
|
2035
2035
|
C_LINE_COMMENT_MODE: q,
|
|
2036
|
-
C_NUMBER_MODE:
|
|
2037
|
-
C_NUMBER_RE:
|
|
2036
|
+
C_NUMBER_MODE: we,
|
|
2037
|
+
C_NUMBER_RE: Ce,
|
|
2038
2038
|
END_SAME_AS_BEGIN: function(a) {
|
|
2039
2039
|
return Object.assign(
|
|
2040
2040
|
a,
|
|
@@ -2054,15 +2054,15 @@ function fi() {
|
|
|
2054
2054
|
IDENT_RE: ee,
|
|
2055
2055
|
MATCH_NOTHING_RE: j,
|
|
2056
2056
|
METHOD_GUARD: mr,
|
|
2057
|
-
NUMBER_MODE:
|
|
2058
|
-
NUMBER_RE:
|
|
2057
|
+
NUMBER_MODE: he,
|
|
2058
|
+
NUMBER_RE: Te,
|
|
2059
2059
|
PHRASAL_WORDS_MODE: De,
|
|
2060
|
-
QUOTE_STRING_MODE:
|
|
2060
|
+
QUOTE_STRING_MODE: ke,
|
|
2061
2061
|
REGEXP_MODE: gr,
|
|
2062
2062
|
RE_STARTERS_RE: ze,
|
|
2063
2063
|
SHEBANG: Pe,
|
|
2064
2064
|
TITLE_MODE: br,
|
|
2065
|
-
UNDERSCORE_IDENT_RE:
|
|
2065
|
+
UNDERSCORE_IDENT_RE: ce,
|
|
2066
2066
|
UNDERSCORE_TITLE_MODE: fr
|
|
2067
2067
|
});
|
|
2068
2068
|
function yr(a, d) {
|
|
@@ -2083,15 +2083,15 @@ function fi() {
|
|
|
2083
2083
|
a.begin = a.match, delete a.match;
|
|
2084
2084
|
}
|
|
2085
2085
|
}
|
|
2086
|
-
function
|
|
2086
|
+
function vr(a, d) {
|
|
2087
2087
|
a.relevance === void 0 && (a.relevance = 1);
|
|
2088
2088
|
}
|
|
2089
|
-
const
|
|
2089
|
+
const Er = (a, d) => {
|
|
2090
2090
|
if (!a.beforeMatch) return;
|
|
2091
2091
|
if (a.starts) throw new Error("beforeMatch cannot be used with starts");
|
|
2092
2092
|
const p = Object.assign({}, a);
|
|
2093
|
-
Object.keys(a).forEach((
|
|
2094
|
-
delete a[
|
|
2093
|
+
Object.keys(a).forEach((v) => {
|
|
2094
|
+
delete a[v];
|
|
2095
2095
|
}), a.keywords = p.keywords, a.begin = R(p.beforeMatch, m(p.begin)), a.starts = {
|
|
2096
2096
|
relevance: 0,
|
|
2097
2097
|
contains: [
|
|
@@ -2115,17 +2115,17 @@ function fi() {
|
|
|
2115
2115
|
// common variable name
|
|
2116
2116
|
], Ar = "keyword";
|
|
2117
2117
|
function Xt(a, d, p = Ar) {
|
|
2118
|
-
const
|
|
2118
|
+
const v = /* @__PURE__ */ Object.create(null);
|
|
2119
2119
|
return typeof a == "string" ? z(p, a.split(" ")) : Array.isArray(a) ? z(p, a) : Object.keys(a).forEach(function(P) {
|
|
2120
2120
|
Object.assign(
|
|
2121
|
-
|
|
2121
|
+
v,
|
|
2122
2122
|
Xt(a[P], d, P)
|
|
2123
2123
|
);
|
|
2124
|
-
}),
|
|
2124
|
+
}), v;
|
|
2125
2125
|
function z(P, k) {
|
|
2126
2126
|
d && (k = k.map((y) => y.toLowerCase())), k.forEach(function(y) {
|
|
2127
2127
|
const _ = y.split("|");
|
|
2128
|
-
|
|
2128
|
+
v[_[0]] = [P, $r(_[0], _[1])];
|
|
2129
2129
|
});
|
|
2130
2130
|
}
|
|
2131
2131
|
}
|
|
@@ -2135,35 +2135,35 @@ function fi() {
|
|
|
2135
2135
|
function Rr(a) {
|
|
2136
2136
|
return Sr.includes(a.toLowerCase());
|
|
2137
2137
|
}
|
|
2138
|
-
const Vt = {},
|
|
2138
|
+
const Vt = {}, xe = (a) => {
|
|
2139
2139
|
console.error(a);
|
|
2140
2140
|
}, Yt = (a, ...d) => {
|
|
2141
2141
|
console.log(`WARN: ${a}`, ...d);
|
|
2142
|
-
},
|
|
2142
|
+
}, Me = (a, d) => {
|
|
2143
2143
|
Vt[`${a}/${d}`] || (console.log(`Deprecated as of ${a}. ${d}`), Vt[`${a}/${d}`] = !0);
|
|
2144
|
-
},
|
|
2144
|
+
}, Je = new Error();
|
|
2145
2145
|
function Qt(a, d, { key: p }) {
|
|
2146
|
-
let
|
|
2146
|
+
let v = 0;
|
|
2147
2147
|
const z = a[p], P = {}, k = {};
|
|
2148
2148
|
for (let y = 1; y <= d.length; y++)
|
|
2149
|
-
k[y +
|
|
2149
|
+
k[y + v] = z[y], P[y + v] = !0, v += G(d[y - 1]);
|
|
2150
2150
|
a[p] = k, a[p]._emit = P, a[p]._multi = !0;
|
|
2151
2151
|
}
|
|
2152
2152
|
function Tr(a) {
|
|
2153
2153
|
if (Array.isArray(a.begin)) {
|
|
2154
2154
|
if (a.skip || a.excludeBegin || a.returnBegin)
|
|
2155
|
-
throw
|
|
2155
|
+
throw xe("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), Je;
|
|
2156
2156
|
if (typeof a.beginScope != "object" || a.beginScope === null)
|
|
2157
|
-
throw
|
|
2157
|
+
throw xe("beginScope must be object"), Je;
|
|
2158
2158
|
Qt(a, a.begin, { key: "beginScope" }), a.begin = V(a.begin, { joinWith: "" });
|
|
2159
2159
|
}
|
|
2160
2160
|
}
|
|
2161
2161
|
function Cr(a) {
|
|
2162
2162
|
if (Array.isArray(a.end)) {
|
|
2163
2163
|
if (a.skip || a.excludeEnd || a.returnEnd)
|
|
2164
|
-
throw
|
|
2164
|
+
throw xe("skip, excludeEnd, returnEnd not compatible with endScope: {}"), Je;
|
|
2165
2165
|
if (typeof a.endScope != "object" || a.endScope === null)
|
|
2166
|
-
throw
|
|
2166
|
+
throw xe("endScope must be object"), Je;
|
|
2167
2167
|
Qt(a, a.end, { key: "endScope" }), a.end = V(a.end, { joinWith: "" });
|
|
2168
2168
|
}
|
|
2169
2169
|
}
|
|
@@ -2199,11 +2199,11 @@ function fi() {
|
|
|
2199
2199
|
const _ = this.matcherRe.exec(y);
|
|
2200
2200
|
if (!_)
|
|
2201
2201
|
return null;
|
|
2202
|
-
const H = _.findIndex((Ue,
|
|
2202
|
+
const H = _.findIndex((Ue, yt) => yt > 0 && Ue !== void 0), B = this.matchIndexes[H];
|
|
2203
2203
|
return _.splice(0, H), Object.assign(_, B);
|
|
2204
2204
|
}
|
|
2205
2205
|
}
|
|
2206
|
-
class
|
|
2206
|
+
class v {
|
|
2207
2207
|
constructor() {
|
|
2208
2208
|
this.rules = [], this.multiRegexes = [], this.count = 0, this.lastIndex = 0, this.regexIndex = 0;
|
|
2209
2209
|
}
|
|
@@ -2236,7 +2236,7 @@ function fi() {
|
|
|
2236
2236
|
}
|
|
2237
2237
|
}
|
|
2238
2238
|
function z(k) {
|
|
2239
|
-
const y = new
|
|
2239
|
+
const y = new v();
|
|
2240
2240
|
return k.contains.forEach((_) => y.addRule(_.begin, { rule: _, type: "begin" })), k.terminatorEnd && y.addRule(k.terminatorEnd, { type: "end" }), k.illegal && y.addRule(k.illegal, { type: "illegal" }), y;
|
|
2241
2241
|
}
|
|
2242
2242
|
function P(k, y) {
|
|
@@ -2251,14 +2251,14 @@ function fi() {
|
|
|
2251
2251
|
// the distinction between match/begin
|
|
2252
2252
|
_r,
|
|
2253
2253
|
Mr,
|
|
2254
|
-
|
|
2254
|
+
Er
|
|
2255
2255
|
].forEach((B) => B(k, y)), a.compilerExtensions.forEach((B) => B(k, y)), k.__beforeBegin = null, [
|
|
2256
2256
|
wr,
|
|
2257
2257
|
// do this later so compiler extensions that come earlier have access to the
|
|
2258
2258
|
// raw array if they wanted to perhaps manipulate it, etc.
|
|
2259
2259
|
xr,
|
|
2260
2260
|
// default to 1 relevance if not specified
|
|
2261
|
-
|
|
2261
|
+
vr
|
|
2262
2262
|
].forEach((B) => B(k, y)), k.isCompiled = !0;
|
|
2263
2263
|
let H = null;
|
|
2264
2264
|
return typeof k.keywords == "object" && k.keywords.$pattern && (k.keywords = Object.assign({}, k.keywords), H = k.keywords.$pattern, delete k.keywords.$pattern), H = H || /\w+/, k.keywords && (k.keywords = Xt(k.keywords, a.case_insensitive)), _.keywordPatternRe = d(H, !0), y && (k.begin || (k.begin = /\B|\b/), _.beginRe = d(_.begin), !k.end && !k.endsWithParent && (k.end = /\B|\b/), k.end && (_.endRe = d(_.end)), _.terminatorEnd = b(_.end) || "", k.endsWithParent && y.terminatorEnd && (_.terminatorEnd += (k.end ? "|" : "") + y.terminatorEnd)), k.illegal && (_.illegalRe = d(
|
|
@@ -2295,8 +2295,8 @@ function fi() {
|
|
|
2295
2295
|
super(d), this.name = "HTMLInjectionError", this.html = p;
|
|
2296
2296
|
}
|
|
2297
2297
|
}
|
|
2298
|
-
const
|
|
2299
|
-
const d = /* @__PURE__ */ Object.create(null), p = /* @__PURE__ */ Object.create(null),
|
|
2298
|
+
const mt = n, en = o, tn = /* @__PURE__ */ Symbol("nomatch"), Pr = 7, nn = function(a) {
|
|
2299
|
+
const d = /* @__PURE__ */ Object.create(null), p = /* @__PURE__ */ Object.create(null), v = [];
|
|
2300
2300
|
let z = !0;
|
|
2301
2301
|
const P = "Could not find the language '{}', did you forget to load/include a language module?", k = { disableAutodetect: !0, name: "Plain text", contains: [] };
|
|
2302
2302
|
let y = {
|
|
@@ -2319,29 +2319,29 @@ function fi() {
|
|
|
2319
2319
|
x += u.parentNode ? u.parentNode.className : "";
|
|
2320
2320
|
const T = y.languageDetectRe.exec(x);
|
|
2321
2321
|
if (T) {
|
|
2322
|
-
const I =
|
|
2322
|
+
const I = be(T[1]);
|
|
2323
2323
|
return I || (Yt(P.replace("{}", T[1])), Yt("Falling back to no-highlight mode for this block.", u)), I ? T[1] : "no-highlight";
|
|
2324
2324
|
}
|
|
2325
|
-
return x.split(/\s+/).find((I) => _(I) ||
|
|
2325
|
+
return x.split(/\s+/).find((I) => _(I) || be(I));
|
|
2326
2326
|
}
|
|
2327
2327
|
function B(u, x, T) {
|
|
2328
2328
|
let I = "", U = "";
|
|
2329
|
-
typeof x == "object" ? (I = u, T = x.ignoreIllegals, U = x.language) : (
|
|
2329
|
+
typeof x == "object" ? (I = u, T = x.ignoreIllegals, U = x.language) : (Me("10.7.0", "highlight(lang, code, ...args) has been deprecated."), Me("10.7.0", `Please use highlight(code, options) instead.
|
|
2330
2330
|
https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T === void 0 && (T = !0);
|
|
2331
2331
|
const re = {
|
|
2332
2332
|
code: I,
|
|
2333
2333
|
language: U
|
|
2334
2334
|
};
|
|
2335
|
-
|
|
2336
|
-
const
|
|
2337
|
-
return
|
|
2335
|
+
tt("before:highlight", re);
|
|
2336
|
+
const fe = re.result ? re.result : Ue(re.language, re.code, T);
|
|
2337
|
+
return fe.code = re.code, tt("after:highlight", fe), fe;
|
|
2338
2338
|
}
|
|
2339
2339
|
function Ue(u, x, T, I) {
|
|
2340
2340
|
const U = /* @__PURE__ */ Object.create(null);
|
|
2341
2341
|
function re(g, w) {
|
|
2342
2342
|
return g.keywords[w];
|
|
2343
2343
|
}
|
|
2344
|
-
function
|
|
2344
|
+
function fe() {
|
|
2345
2345
|
if (!S.keywords) {
|
|
2346
2346
|
F.addText(L);
|
|
2347
2347
|
return;
|
|
@@ -2353,11 +2353,11 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2353
2353
|
A += L.substring(g, w.index);
|
|
2354
2354
|
const M = se.case_insensitive ? w[0].toLowerCase() : w[0], Z = re(S, M);
|
|
2355
2355
|
if (Z) {
|
|
2356
|
-
const [
|
|
2357
|
-
if (F.addText(A), A = "", U[M] = (U[M] || 0) + 1, U[M] <= Pr && (
|
|
2356
|
+
const [ue, eo] = Z;
|
|
2357
|
+
if (F.addText(A), A = "", U[M] = (U[M] || 0) + 1, U[M] <= Pr && (ot += eo), ue.startsWith("_"))
|
|
2358
2358
|
A += w[0];
|
|
2359
2359
|
else {
|
|
2360
|
-
const to = se.classNameAliases[
|
|
2360
|
+
const to = se.classNameAliases[ue] || ue;
|
|
2361
2361
|
ie(w[0], to);
|
|
2362
2362
|
}
|
|
2363
2363
|
} else
|
|
@@ -2366,7 +2366,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2366
2366
|
}
|
|
2367
2367
|
A += L.substring(g), F.addText(A);
|
|
2368
2368
|
}
|
|
2369
|
-
function
|
|
2369
|
+
function nt() {
|
|
2370
2370
|
if (L === "") return;
|
|
2371
2371
|
let g = null;
|
|
2372
2372
|
if (typeof S.subLanguage == "string") {
|
|
@@ -2377,11 +2377,11 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2377
2377
|
g = Ue(S.subLanguage, L, !0, hn[S.subLanguage]), hn[S.subLanguage] = /** @type {CompiledMode} */
|
|
2378
2378
|
g._top;
|
|
2379
2379
|
} else
|
|
2380
|
-
g =
|
|
2381
|
-
S.relevance > 0 && (
|
|
2380
|
+
g = kt(L, S.subLanguage.length ? S.subLanguage : null);
|
|
2381
|
+
S.relevance > 0 && (ot += g.relevance), F.__addSublanguage(g._emitter, g.language);
|
|
2382
2382
|
}
|
|
2383
2383
|
function Q() {
|
|
2384
|
-
S.subLanguage != null ?
|
|
2384
|
+
S.subLanguage != null ? nt() : fe(), L = "";
|
|
2385
2385
|
}
|
|
2386
2386
|
function ie(g, w) {
|
|
2387
2387
|
g !== "" && (F.startScope(w), F.addText(g), F.endScope());
|
|
@@ -2394,8 +2394,8 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2394
2394
|
A++;
|
|
2395
2395
|
continue;
|
|
2396
2396
|
}
|
|
2397
|
-
const Z = se.classNameAliases[g[A]] || g[A],
|
|
2398
|
-
Z ? ie(
|
|
2397
|
+
const Z = se.classNameAliases[g[A]] || g[A], ue = w[A];
|
|
2398
|
+
Z ? ie(ue, Z) : (L = ue, fe(), L = ""), A++;
|
|
2399
2399
|
}
|
|
2400
2400
|
}
|
|
2401
2401
|
function ln(g, w) {
|
|
@@ -2418,12 +2418,12 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2418
2418
|
return cn(g.parent, w, A);
|
|
2419
2419
|
}
|
|
2420
2420
|
function Xr(g) {
|
|
2421
|
-
return S.matcher.regexIndex === 0 ? (L += g[0], 1) : (
|
|
2421
|
+
return S.matcher.regexIndex === 0 ? (L += g[0], 1) : (vt = !0, 0);
|
|
2422
2422
|
}
|
|
2423
2423
|
function Vr(g) {
|
|
2424
2424
|
const w = g[0], A = g.rule, M = new e(A), Z = [A.__beforeBegin, A["on:begin"]];
|
|
2425
|
-
for (const
|
|
2426
|
-
if (
|
|
2425
|
+
for (const ue of Z)
|
|
2426
|
+
if (ue && (ue(g, M), M.isMatchIgnored))
|
|
2427
2427
|
return Xr(w);
|
|
2428
2428
|
return A.skip ? L += w : (A.excludeBegin && (L += w), Q(), !A.returnBegin && !A.excludeBegin && (L = w)), ln(A, g), A.returnBegin ? 0 : w.length;
|
|
2429
2429
|
}
|
|
@@ -2434,7 +2434,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2434
2434
|
const Z = S;
|
|
2435
2435
|
S.endScope && S.endScope._wrap ? (Q(), ie(w, S.endScope._wrap)) : S.endScope && S.endScope._multi ? (Q(), an(S.endScope, g)) : Z.skip ? L += w : (Z.returnEnd || Z.excludeEnd || (L += w), Q(), Z.excludeEnd && (L = w));
|
|
2436
2436
|
do
|
|
2437
|
-
S.scope && F.closeNode(), !S.skip && !S.subLanguage && (
|
|
2437
|
+
S.scope && F.closeNode(), !S.skip && !S.subLanguage && (ot += S.relevance), S = S.parent;
|
|
2438
2438
|
while (S !== M.parent);
|
|
2439
2439
|
return M.starts && ln(M.starts, g), Z.returnEnd ? 0 : w.length;
|
|
2440
2440
|
}
|
|
@@ -2444,19 +2444,19 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2444
2444
|
w.scope && g.unshift(w.scope);
|
|
2445
2445
|
g.forEach((w) => F.openNode(w));
|
|
2446
2446
|
}
|
|
2447
|
-
let
|
|
2447
|
+
let rt = {};
|
|
2448
2448
|
function dn(g, w) {
|
|
2449
2449
|
const A = w && w[0];
|
|
2450
2450
|
if (L += g, A == null)
|
|
2451
2451
|
return Q(), 0;
|
|
2452
|
-
if (
|
|
2452
|
+
if (rt.type === "begin" && w.type === "end" && rt.index === w.index && A === "") {
|
|
2453
2453
|
if (L += x.slice(w.index, w.index + 1), !z) {
|
|
2454
2454
|
const M = new Error(`0 width match regex (${u})`);
|
|
2455
|
-
throw M.languageName = u, M.badRule =
|
|
2455
|
+
throw M.languageName = u, M.badRule = rt.rule, M;
|
|
2456
2456
|
}
|
|
2457
2457
|
return 1;
|
|
2458
2458
|
}
|
|
2459
|
-
if (
|
|
2459
|
+
if (rt = w, w.type === "begin")
|
|
2460
2460
|
return Vr(w);
|
|
2461
2461
|
if (w.type === "illegal" && !T) {
|
|
2462
2462
|
const M = new Error('Illegal lexeme "' + A + '" for mode "' + (S.scope || "<unnamed>") + '"');
|
|
@@ -2469,35 +2469,35 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2469
2469
|
if (w.type === "illegal" && A === "")
|
|
2470
2470
|
return L += `
|
|
2471
2471
|
`, 1;
|
|
2472
|
-
if (
|
|
2472
|
+
if (_t > 1e5 && _t > w.index * 3)
|
|
2473
2473
|
throw new Error("potential infinite loop, way more iterations than matches");
|
|
2474
2474
|
return L += A, A.length;
|
|
2475
2475
|
}
|
|
2476
|
-
const se =
|
|
2476
|
+
const se = be(u);
|
|
2477
2477
|
if (!se)
|
|
2478
|
-
throw
|
|
2478
|
+
throw xe(P.replace("{}", u)), new Error('Unknown language: "' + u + '"');
|
|
2479
2479
|
const Jr = Or(se);
|
|
2480
|
-
let
|
|
2480
|
+
let xt = "", S = I || Jr;
|
|
2481
2481
|
const hn = {}, F = new y.__emitter(y);
|
|
2482
2482
|
Qr();
|
|
2483
|
-
let L = "",
|
|
2483
|
+
let L = "", ot = 0, _e = 0, _t = 0, vt = !1;
|
|
2484
2484
|
try {
|
|
2485
2485
|
if (se.__emitTokens)
|
|
2486
2486
|
se.__emitTokens(x, F);
|
|
2487
2487
|
else {
|
|
2488
2488
|
for (S.matcher.considerAll(); ; ) {
|
|
2489
|
-
|
|
2489
|
+
_t++, vt ? vt = !1 : S.matcher.considerAll(), S.matcher.lastIndex = _e;
|
|
2490
2490
|
const g = S.matcher.exec(x);
|
|
2491
2491
|
if (!g) break;
|
|
2492
|
-
const w = x.substring(
|
|
2493
|
-
|
|
2492
|
+
const w = x.substring(_e, g.index), A = dn(w, g);
|
|
2493
|
+
_e = g.index + A;
|
|
2494
2494
|
}
|
|
2495
|
-
dn(x.substring(
|
|
2495
|
+
dn(x.substring(_e));
|
|
2496
2496
|
}
|
|
2497
|
-
return F.finalize(),
|
|
2497
|
+
return F.finalize(), xt = F.toHTML(), {
|
|
2498
2498
|
language: u,
|
|
2499
|
-
value:
|
|
2500
|
-
relevance:
|
|
2499
|
+
value: xt,
|
|
2500
|
+
relevance: ot,
|
|
2501
2501
|
illegal: !1,
|
|
2502
2502
|
_emitter: F,
|
|
2503
2503
|
_top: S
|
|
@@ -2506,22 +2506,22 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2506
2506
|
if (g.message && g.message.includes("Illegal"))
|
|
2507
2507
|
return {
|
|
2508
2508
|
language: u,
|
|
2509
|
-
value:
|
|
2509
|
+
value: mt(x),
|
|
2510
2510
|
illegal: !0,
|
|
2511
2511
|
relevance: 0,
|
|
2512
2512
|
_illegalBy: {
|
|
2513
2513
|
message: g.message,
|
|
2514
|
-
index:
|
|
2515
|
-
context: x.slice(
|
|
2514
|
+
index: _e,
|
|
2515
|
+
context: x.slice(_e - 100, _e + 100),
|
|
2516
2516
|
mode: g.mode,
|
|
2517
|
-
resultSoFar:
|
|
2517
|
+
resultSoFar: xt
|
|
2518
2518
|
},
|
|
2519
2519
|
_emitter: F
|
|
2520
2520
|
};
|
|
2521
2521
|
if (z)
|
|
2522
2522
|
return {
|
|
2523
2523
|
language: u,
|
|
2524
|
-
value:
|
|
2524
|
+
value: mt(x),
|
|
2525
2525
|
illegal: !1,
|
|
2526
2526
|
relevance: 0,
|
|
2527
2527
|
errorRaised: g,
|
|
@@ -2531,9 +2531,9 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2531
2531
|
throw g;
|
|
2532
2532
|
}
|
|
2533
2533
|
}
|
|
2534
|
-
function
|
|
2534
|
+
function yt(u) {
|
|
2535
2535
|
const x = {
|
|
2536
|
-
value:
|
|
2536
|
+
value: mt(u),
|
|
2537
2537
|
illegal: !1,
|
|
2538
2538
|
relevance: 0,
|
|
2539
2539
|
_top: k,
|
|
@@ -2541,33 +2541,33 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2541
2541
|
};
|
|
2542
2542
|
return x._emitter.addText(u), x;
|
|
2543
2543
|
}
|
|
2544
|
-
function
|
|
2544
|
+
function kt(u, x) {
|
|
2545
2545
|
x = x || y.languages || Object.keys(d);
|
|
2546
|
-
const T =
|
|
2546
|
+
const T = yt(u), I = x.filter(be).filter(sn).map(
|
|
2547
2547
|
(Q) => Ue(Q, u, !1)
|
|
2548
2548
|
);
|
|
2549
2549
|
I.unshift(T);
|
|
2550
2550
|
const U = I.sort((Q, ie) => {
|
|
2551
2551
|
if (Q.relevance !== ie.relevance) return ie.relevance - Q.relevance;
|
|
2552
2552
|
if (Q.language && ie.language) {
|
|
2553
|
-
if (
|
|
2553
|
+
if (be(Q.language).supersetOf === ie.language)
|
|
2554
2554
|
return 1;
|
|
2555
|
-
if (
|
|
2555
|
+
if (be(ie.language).supersetOf === Q.language)
|
|
2556
2556
|
return -1;
|
|
2557
2557
|
}
|
|
2558
2558
|
return 0;
|
|
2559
|
-
}), [re,
|
|
2560
|
-
return
|
|
2559
|
+
}), [re, fe] = U, nt = re;
|
|
2560
|
+
return nt.secondBest = fe, nt;
|
|
2561
2561
|
}
|
|
2562
2562
|
function Br(u, x, T) {
|
|
2563
2563
|
const I = x && p[x] || T;
|
|
2564
2564
|
u.classList.add("hljs"), u.classList.add(`language-${I}`);
|
|
2565
2565
|
}
|
|
2566
|
-
function
|
|
2566
|
+
function wt(u) {
|
|
2567
2567
|
let x = null;
|
|
2568
2568
|
const T = H(u);
|
|
2569
2569
|
if (_(T)) return;
|
|
2570
|
-
if (
|
|
2570
|
+
if (tt(
|
|
2571
2571
|
"before:highlightElement",
|
|
2572
2572
|
{ el: u, language: T }
|
|
2573
2573
|
), u.dataset.highlighted) {
|
|
@@ -2580,7 +2580,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2580
2580
|
u.innerHTML
|
|
2581
2581
|
);
|
|
2582
2582
|
x = u;
|
|
2583
|
-
const I = x.textContent, U = T ? B(I, { language: T, ignoreIllegals: !0 }) :
|
|
2583
|
+
const I = x.textContent, U = T ? B(I, { language: T, ignoreIllegals: !0 }) : kt(I);
|
|
2584
2584
|
u.innerHTML = U.value, u.dataset.highlighted = "yes", Br(u, T, U.language), u.result = {
|
|
2585
2585
|
language: U.language,
|
|
2586
2586
|
// TODO: remove with version 11.0
|
|
@@ -2589,35 +2589,35 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2589
2589
|
}, U.secondBest && (u.secondBest = {
|
|
2590
2590
|
language: U.secondBest.language,
|
|
2591
2591
|
relevance: U.secondBest.relevance
|
|
2592
|
-
}),
|
|
2592
|
+
}), tt("after:highlightElement", { el: u, result: U, text: I });
|
|
2593
2593
|
}
|
|
2594
2594
|
function Dr(u) {
|
|
2595
2595
|
y = en(y, u);
|
|
2596
2596
|
}
|
|
2597
2597
|
const Ur = () => {
|
|
2598
|
-
|
|
2598
|
+
et(), Me("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
|
|
2599
2599
|
};
|
|
2600
2600
|
function Hr() {
|
|
2601
|
-
|
|
2601
|
+
et(), Me("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
|
|
2602
2602
|
}
|
|
2603
2603
|
let rn = !1;
|
|
2604
|
-
function
|
|
2604
|
+
function et() {
|
|
2605
2605
|
function u() {
|
|
2606
|
-
|
|
2606
|
+
et();
|
|
2607
2607
|
}
|
|
2608
2608
|
if (document.readyState === "loading") {
|
|
2609
2609
|
rn || window.addEventListener("DOMContentLoaded", u, !1), rn = !0;
|
|
2610
2610
|
return;
|
|
2611
2611
|
}
|
|
2612
|
-
document.querySelectorAll(y.cssSelector).forEach(
|
|
2612
|
+
document.querySelectorAll(y.cssSelector).forEach(wt);
|
|
2613
2613
|
}
|
|
2614
2614
|
function jr(u, x) {
|
|
2615
2615
|
let T = null;
|
|
2616
2616
|
try {
|
|
2617
2617
|
T = x(a);
|
|
2618
2618
|
} catch (I) {
|
|
2619
|
-
if (
|
|
2620
|
-
|
|
2619
|
+
if (xe("Language definition for '{}' could not be registered.".replace("{}", u)), z)
|
|
2620
|
+
xe(I);
|
|
2621
2621
|
else
|
|
2622
2622
|
throw I;
|
|
2623
2623
|
T = k;
|
|
@@ -2632,7 +2632,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2632
2632
|
function Gr() {
|
|
2633
2633
|
return Object.keys(d);
|
|
2634
2634
|
}
|
|
2635
|
-
function
|
|
2635
|
+
function be(u) {
|
|
2636
2636
|
return u = (u || "").toLowerCase(), d[u] || d[p[u]];
|
|
2637
2637
|
}
|
|
2638
2638
|
function on(u, { languageName: x }) {
|
|
@@ -2641,7 +2641,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2641
2641
|
});
|
|
2642
2642
|
}
|
|
2643
2643
|
function sn(u) {
|
|
2644
|
-
const x =
|
|
2644
|
+
const x = be(u);
|
|
2645
2645
|
return x && !x.disableAutodetect;
|
|
2646
2646
|
}
|
|
2647
2647
|
function Zr(u) {
|
|
@@ -2656,26 +2656,26 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2656
2656
|
});
|
|
2657
2657
|
}
|
|
2658
2658
|
function qr(u) {
|
|
2659
|
-
Zr(u),
|
|
2659
|
+
Zr(u), v.push(u);
|
|
2660
2660
|
}
|
|
2661
2661
|
function Kr(u) {
|
|
2662
|
-
const x =
|
|
2663
|
-
x !== -1 &&
|
|
2662
|
+
const x = v.indexOf(u);
|
|
2663
|
+
x !== -1 && v.splice(x, 1);
|
|
2664
2664
|
}
|
|
2665
|
-
function
|
|
2665
|
+
function tt(u, x) {
|
|
2666
2666
|
const T = u;
|
|
2667
|
-
|
|
2667
|
+
v.forEach(function(I) {
|
|
2668
2668
|
I[T] && I[T](x);
|
|
2669
2669
|
});
|
|
2670
2670
|
}
|
|
2671
2671
|
function Wr(u) {
|
|
2672
|
-
return
|
|
2672
|
+
return Me("10.7.0", "highlightBlock will be removed entirely in v12.0"), Me("10.7.0", "Please use highlightElement now."), wt(u);
|
|
2673
2673
|
}
|
|
2674
2674
|
Object.assign(a, {
|
|
2675
2675
|
highlight: B,
|
|
2676
|
-
highlightAuto:
|
|
2677
|
-
highlightAll:
|
|
2678
|
-
highlightElement:
|
|
2676
|
+
highlightAuto: kt,
|
|
2677
|
+
highlightAll: et,
|
|
2678
|
+
highlightElement: wt,
|
|
2679
2679
|
// TODO: Remove with v12 API
|
|
2680
2680
|
highlightBlock: Wr,
|
|
2681
2681
|
configure: Dr,
|
|
@@ -2684,7 +2684,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2684
2684
|
registerLanguage: jr,
|
|
2685
2685
|
unregisterLanguage: Fr,
|
|
2686
2686
|
listLanguages: Gr,
|
|
2687
|
-
getLanguage:
|
|
2687
|
+
getLanguage: be,
|
|
2688
2688
|
registerAliases: on,
|
|
2689
2689
|
autoDetection: sn,
|
|
2690
2690
|
inherit: en,
|
|
@@ -2698,14 +2698,14 @@ https://github.com/highlightjs/highlight.js/issues/2277`), U = u, I = x), T ===
|
|
|
2698
2698
|
concat: R,
|
|
2699
2699
|
lookahead: m,
|
|
2700
2700
|
either: X,
|
|
2701
|
-
optional:
|
|
2701
|
+
optional: E,
|
|
2702
2702
|
anyNumberOfTimes: $
|
|
2703
2703
|
};
|
|
2704
|
-
for (const u in
|
|
2705
|
-
typeof
|
|
2706
|
-
return Object.assign(a,
|
|
2707
|
-
},
|
|
2708
|
-
return
|
|
2704
|
+
for (const u in Qe)
|
|
2705
|
+
typeof Qe[u] == "object" && t(Qe[u]);
|
|
2706
|
+
return Object.assign(a, Qe), a;
|
|
2707
|
+
}, Oe = nn({});
|
|
2708
|
+
return Oe.newInstance = () => nn({}), St = Oe, Oe.HighlightJS = Oe, Oe.default = Oe, St;
|
|
2709
2709
|
}
|
|
2710
2710
|
var mi = /* @__PURE__ */ fi();
|
|
2711
2711
|
const te = /* @__PURE__ */ bi(mi);
|
|
@@ -2957,7 +2957,7 @@ function yi(t) {
|
|
|
2957
2957
|
t.APOS_STRING_MODE,
|
|
2958
2958
|
t.QUOTE_STRING_MODE
|
|
2959
2959
|
]
|
|
2960
|
-
}, m = "[0-9](_?[0-9])*", $ = `(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,
|
|
2960
|
+
}, m = "[0-9](_?[0-9])*", $ = `(\\b(${m}))?\\.(${m})|\\b(${m})\\.`, E = `\\b|${o.join("|")}`, R = {
|
|
2961
2961
|
className: "number",
|
|
2962
2962
|
relevance: 0,
|
|
2963
2963
|
variants: [
|
|
@@ -2972,7 +2972,7 @@ function yi(t) {
|
|
|
2972
2972
|
// because both MUST contain a decimal point and so cannot be confused with
|
|
2973
2973
|
// the interior part of an identifier
|
|
2974
2974
|
{
|
|
2975
|
-
begin: `(\\b(${m})|(${$}))[eE][+-]?(${m})[jJ]?(?=${
|
|
2975
|
+
begin: `(\\b(${m})|(${$}))[eE][+-]?(${m})[jJ]?(?=${E})`
|
|
2976
2976
|
},
|
|
2977
2977
|
{
|
|
2978
2978
|
begin: `(${$})[jJ]?`
|
|
@@ -2984,21 +2984,21 @@ function yi(t) {
|
|
|
2984
2984
|
// decinteger is optionally imaginary
|
|
2985
2985
|
// https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
|
|
2986
2986
|
{
|
|
2987
|
-
begin: `\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${
|
|
2987
|
+
begin: `\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${E})`
|
|
2988
2988
|
},
|
|
2989
2989
|
{
|
|
2990
|
-
begin: `\\b0[bB](_?[01])+[lL]?(?=${
|
|
2990
|
+
begin: `\\b0[bB](_?[01])+[lL]?(?=${E})`
|
|
2991
2991
|
},
|
|
2992
2992
|
{
|
|
2993
|
-
begin: `\\b0[oO](_?[0-7])+[lL]?(?=${
|
|
2993
|
+
begin: `\\b0[oO](_?[0-7])+[lL]?(?=${E})`
|
|
2994
2994
|
},
|
|
2995
2995
|
{
|
|
2996
|
-
begin: `\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${
|
|
2996
|
+
begin: `\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${E})`
|
|
2997
2997
|
},
|
|
2998
2998
|
// imagnumber (digitpart-based)
|
|
2999
2999
|
// https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
|
|
3000
3000
|
{
|
|
3001
|
-
begin: `\\b(${m})[jJ](?=${
|
|
3001
|
+
begin: `\\b(${m})[jJ](?=${E})`
|
|
3002
3002
|
}
|
|
3003
3003
|
]
|
|
3004
3004
|
}, W = {
|
|
@@ -3301,13 +3301,13 @@ function or(t) {
|
|
|
3301
3301
|
return;
|
|
3302
3302
|
}
|
|
3303
3303
|
ne === ">" && (n(C, { after: Y }) || q.ignoreMatch());
|
|
3304
|
-
let
|
|
3305
|
-
const
|
|
3306
|
-
if (
|
|
3304
|
+
let he;
|
|
3305
|
+
const we = C.input.substring(Y);
|
|
3306
|
+
if (he = we.match(/^\s*=/)) {
|
|
3307
3307
|
q.ignoreMatch();
|
|
3308
3308
|
return;
|
|
3309
3309
|
}
|
|
3310
|
-
if ((
|
|
3310
|
+
if ((he = we.match(/^\s+extends\s+/)) && he.index === 0) {
|
|
3311
3311
|
q.ignoreMatch();
|
|
3312
3312
|
return;
|
|
3313
3313
|
}
|
|
@@ -3354,7 +3354,7 @@ function or(t) {
|
|
|
3354
3354
|
],
|
|
3355
3355
|
subLanguage: "xml"
|
|
3356
3356
|
}
|
|
3357
|
-
},
|
|
3357
|
+
}, E = {
|
|
3358
3358
|
begin: ".?css`",
|
|
3359
3359
|
end: "",
|
|
3360
3360
|
starts: {
|
|
@@ -3435,7 +3435,7 @@ function or(t) {
|
|
|
3435
3435
|
t.APOS_STRING_MODE,
|
|
3436
3436
|
t.QUOTE_STRING_MODE,
|
|
3437
3437
|
$,
|
|
3438
|
-
|
|
3438
|
+
E,
|
|
3439
3439
|
R,
|
|
3440
3440
|
W,
|
|
3441
3441
|
// Skip numbers when they are part of a variable name
|
|
@@ -3506,7 +3506,7 @@ function or(t) {
|
|
|
3506
3506
|
}
|
|
3507
3507
|
}
|
|
3508
3508
|
]
|
|
3509
|
-
},
|
|
3509
|
+
}, ce = {
|
|
3510
3510
|
relevance: 0,
|
|
3511
3511
|
match: e.either(
|
|
3512
3512
|
// Hard coded exceptions
|
|
@@ -3530,12 +3530,12 @@ function or(t) {
|
|
|
3530
3530
|
...nr
|
|
3531
3531
|
]
|
|
3532
3532
|
}
|
|
3533
|
-
},
|
|
3533
|
+
}, Te = {
|
|
3534
3534
|
label: "use_strict",
|
|
3535
3535
|
className: "meta",
|
|
3536
3536
|
relevance: 10,
|
|
3537
3537
|
begin: /^\s*['"]use (strict|asm)['"]/
|
|
3538
|
-
},
|
|
3538
|
+
}, Ce = {
|
|
3539
3539
|
variants: [
|
|
3540
3540
|
{
|
|
3541
3541
|
match: [
|
|
@@ -3560,7 +3560,7 @@ function or(t) {
|
|
|
3560
3560
|
label: "func.def",
|
|
3561
3561
|
contains: [j],
|
|
3562
3562
|
illegal: /%/
|
|
3563
|
-
},
|
|
3563
|
+
}, Ne = {
|
|
3564
3564
|
relevance: 0,
|
|
3565
3565
|
match: /\b[A-Z][A-Z_0-9]+\b/,
|
|
3566
3566
|
className: "variable.constant"
|
|
@@ -3581,7 +3581,7 @@ function or(t) {
|
|
|
3581
3581
|
),
|
|
3582
3582
|
className: "title.function",
|
|
3583
3583
|
relevance: 0
|
|
3584
|
-
},
|
|
3584
|
+
}, de = {
|
|
3585
3585
|
begin: e.concat(/\./, e.lookahead(
|
|
3586
3586
|
e.concat(o, /(?![0-9A-Za-z$_(])/)
|
|
3587
3587
|
)),
|
|
@@ -3608,7 +3608,7 @@ function or(t) {
|
|
|
3608
3608
|
},
|
|
3609
3609
|
j
|
|
3610
3610
|
]
|
|
3611
|
-
},
|
|
3611
|
+
}, ke = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + t.UNDERSCORE_IDENT_RE + ")\\s*=>", De = {
|
|
3612
3612
|
match: [
|
|
3613
3613
|
/const|var|let/,
|
|
3614
3614
|
/\s+/,
|
|
@@ -3617,7 +3617,7 @@ function or(t) {
|
|
|
3617
3617
|
/=\s*/,
|
|
3618
3618
|
/(async\s*)?/,
|
|
3619
3619
|
// async is optional
|
|
3620
|
-
e.lookahead(
|
|
3620
|
+
e.lookahead(ke)
|
|
3621
3621
|
],
|
|
3622
3622
|
keywords: "async",
|
|
3623
3623
|
className: {
|
|
@@ -3633,7 +3633,7 @@ function or(t) {
|
|
|
3633
3633
|
aliases: ["js", "jsx", "mjs", "cjs"],
|
|
3634
3634
|
keywords: l,
|
|
3635
3635
|
// this will be extended by TypeScript
|
|
3636
|
-
exports: { PARAMS_CONTAINS: V, CLASS_REFERENCE:
|
|
3636
|
+
exports: { PARAMS_CONTAINS: V, CLASS_REFERENCE: ce },
|
|
3637
3637
|
illegal: /#(?![$_A-z])/,
|
|
3638
3638
|
contains: [
|
|
3639
3639
|
t.SHEBANG({
|
|
@@ -3641,18 +3641,18 @@ function or(t) {
|
|
|
3641
3641
|
binary: "node",
|
|
3642
3642
|
relevance: 5
|
|
3643
3643
|
}),
|
|
3644
|
-
|
|
3644
|
+
Te,
|
|
3645
3645
|
t.APOS_STRING_MODE,
|
|
3646
3646
|
t.QUOTE_STRING_MODE,
|
|
3647
3647
|
$,
|
|
3648
|
-
|
|
3648
|
+
E,
|
|
3649
3649
|
R,
|
|
3650
3650
|
W,
|
|
3651
3651
|
G,
|
|
3652
3652
|
// Skip numbers when they are part of a variable name
|
|
3653
3653
|
{ match: /\$\d+/ },
|
|
3654
3654
|
b,
|
|
3655
|
-
|
|
3655
|
+
ce,
|
|
3656
3656
|
{
|
|
3657
3657
|
scope: "attr",
|
|
3658
3658
|
match: o + e.lookahead(":"),
|
|
@@ -3672,7 +3672,7 @@ function or(t) {
|
|
|
3672
3672
|
// we have to count the parens to make sure we actually have the
|
|
3673
3673
|
// correct bounding ( ) before the =>. There could be any number of
|
|
3674
3674
|
// sub-expressions inside also surrounded by parens.
|
|
3675
|
-
begin:
|
|
3675
|
+
begin: ke,
|
|
3676
3676
|
returnBegin: !0,
|
|
3677
3677
|
end: "\\s*=>",
|
|
3678
3678
|
contains: [
|
|
@@ -3734,7 +3734,7 @@ function or(t) {
|
|
|
3734
3734
|
}
|
|
3735
3735
|
]
|
|
3736
3736
|
},
|
|
3737
|
-
|
|
3737
|
+
Ce,
|
|
3738
3738
|
{
|
|
3739
3739
|
// prevent this from getting swallowed up by function
|
|
3740
3740
|
// since they appear "function like"
|
|
@@ -3758,7 +3758,7 @@ function or(t) {
|
|
|
3758
3758
|
match: /\.\.\./,
|
|
3759
3759
|
relevance: 0
|
|
3760
3760
|
},
|
|
3761
|
-
|
|
3761
|
+
de,
|
|
3762
3762
|
// hack: prevents detection of keywords in some circumstances
|
|
3763
3763
|
// .keyword()
|
|
3764
3764
|
// $keyword = x
|
|
@@ -3772,7 +3772,7 @@ function or(t) {
|
|
|
3772
3772
|
contains: [j]
|
|
3773
3773
|
},
|
|
3774
3774
|
Pe,
|
|
3775
|
-
|
|
3775
|
+
Ne,
|
|
3776
3776
|
ee,
|
|
3777
3777
|
Be,
|
|
3778
3778
|
{
|
|
@@ -3782,7 +3782,7 @@ function or(t) {
|
|
|
3782
3782
|
]
|
|
3783
3783
|
};
|
|
3784
3784
|
}
|
|
3785
|
-
function
|
|
3785
|
+
function vi(t) {
|
|
3786
3786
|
return {
|
|
3787
3787
|
name: "Plain text",
|
|
3788
3788
|
aliases: [
|
|
@@ -3792,7 +3792,7 @@ function Ei(t) {
|
|
|
3792
3792
|
disableAutodetect: !0
|
|
3793
3793
|
};
|
|
3794
3794
|
}
|
|
3795
|
-
const
|
|
3795
|
+
const ut = "[A-Za-z$_][0-9A-Za-z$_]*", ir = [
|
|
3796
3796
|
"as",
|
|
3797
3797
|
// for exports
|
|
3798
3798
|
"in",
|
|
@@ -3938,11 +3938,11 @@ const ht = "[A-Za-z$_][0-9A-Za-z$_]*", ir = [
|
|
|
3938
3938
|
ar,
|
|
3939
3939
|
lr
|
|
3940
3940
|
);
|
|
3941
|
-
function
|
|
3941
|
+
function Ei(t) {
|
|
3942
3942
|
const e = t.regex, n = (C, { after: q }) => {
|
|
3943
3943
|
const Y = "</" + C[0].slice(1);
|
|
3944
3944
|
return C.input.indexOf(Y, q) !== -1;
|
|
3945
|
-
}, o =
|
|
3945
|
+
}, o = ut, r = {
|
|
3946
3946
|
begin: "<>",
|
|
3947
3947
|
end: "</>"
|
|
3948
3948
|
}, s = /<[A-Za-z0-9\\._:-]+\s*\/>/, i = {
|
|
@@ -3966,19 +3966,19 @@ function vi(t) {
|
|
|
3966
3966
|
return;
|
|
3967
3967
|
}
|
|
3968
3968
|
ne === ">" && (n(C, { after: Y }) || q.ignoreMatch());
|
|
3969
|
-
let
|
|
3970
|
-
const
|
|
3971
|
-
if (
|
|
3969
|
+
let he;
|
|
3970
|
+
const we = C.input.substring(Y);
|
|
3971
|
+
if (he = we.match(/^\s*=/)) {
|
|
3972
3972
|
q.ignoreMatch();
|
|
3973
3973
|
return;
|
|
3974
3974
|
}
|
|
3975
|
-
if ((
|
|
3975
|
+
if ((he = we.match(/^\s+extends\s+/)) && he.index === 0) {
|
|
3976
3976
|
q.ignoreMatch();
|
|
3977
3977
|
return;
|
|
3978
3978
|
}
|
|
3979
3979
|
}
|
|
3980
3980
|
}, l = {
|
|
3981
|
-
$pattern:
|
|
3981
|
+
$pattern: ut,
|
|
3982
3982
|
keyword: ir,
|
|
3983
3983
|
literal: sr,
|
|
3984
3984
|
built_in: hr,
|
|
@@ -4019,7 +4019,7 @@ function vi(t) {
|
|
|
4019
4019
|
],
|
|
4020
4020
|
subLanguage: "xml"
|
|
4021
4021
|
}
|
|
4022
|
-
},
|
|
4022
|
+
}, E = {
|
|
4023
4023
|
begin: ".?css`",
|
|
4024
4024
|
end: "",
|
|
4025
4025
|
starts: {
|
|
@@ -4100,7 +4100,7 @@ function vi(t) {
|
|
|
4100
4100
|
t.APOS_STRING_MODE,
|
|
4101
4101
|
t.QUOTE_STRING_MODE,
|
|
4102
4102
|
$,
|
|
4103
|
-
|
|
4103
|
+
E,
|
|
4104
4104
|
R,
|
|
4105
4105
|
W,
|
|
4106
4106
|
// Skip numbers when they are part of a variable name
|
|
@@ -4171,7 +4171,7 @@ function vi(t) {
|
|
|
4171
4171
|
}
|
|
4172
4172
|
}
|
|
4173
4173
|
]
|
|
4174
|
-
},
|
|
4174
|
+
}, ce = {
|
|
4175
4175
|
relevance: 0,
|
|
4176
4176
|
match: e.either(
|
|
4177
4177
|
// Hard coded exceptions
|
|
@@ -4195,12 +4195,12 @@ function vi(t) {
|
|
|
4195
4195
|
...lr
|
|
4196
4196
|
]
|
|
4197
4197
|
}
|
|
4198
|
-
},
|
|
4198
|
+
}, Te = {
|
|
4199
4199
|
label: "use_strict",
|
|
4200
4200
|
className: "meta",
|
|
4201
4201
|
relevance: 10,
|
|
4202
4202
|
begin: /^\s*['"]use (strict|asm)['"]/
|
|
4203
|
-
},
|
|
4203
|
+
}, Ce = {
|
|
4204
4204
|
variants: [
|
|
4205
4205
|
{
|
|
4206
4206
|
match: [
|
|
@@ -4225,7 +4225,7 @@ function vi(t) {
|
|
|
4225
4225
|
label: "func.def",
|
|
4226
4226
|
contains: [j],
|
|
4227
4227
|
illegal: /%/
|
|
4228
|
-
},
|
|
4228
|
+
}, Ne = {
|
|
4229
4229
|
relevance: 0,
|
|
4230
4230
|
match: /\b[A-Z][A-Z_0-9]+\b/,
|
|
4231
4231
|
className: "variable.constant"
|
|
@@ -4246,7 +4246,7 @@ function vi(t) {
|
|
|
4246
4246
|
),
|
|
4247
4247
|
className: "title.function",
|
|
4248
4248
|
relevance: 0
|
|
4249
|
-
},
|
|
4249
|
+
}, de = {
|
|
4250
4250
|
begin: e.concat(/\./, e.lookahead(
|
|
4251
4251
|
e.concat(o, /(?![0-9A-Za-z$_(])/)
|
|
4252
4252
|
)),
|
|
@@ -4273,7 +4273,7 @@ function vi(t) {
|
|
|
4273
4273
|
},
|
|
4274
4274
|
j
|
|
4275
4275
|
]
|
|
4276
|
-
},
|
|
4276
|
+
}, ke = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + t.UNDERSCORE_IDENT_RE + ")\\s*=>", De = {
|
|
4277
4277
|
match: [
|
|
4278
4278
|
/const|var|let/,
|
|
4279
4279
|
/\s+/,
|
|
@@ -4282,7 +4282,7 @@ function vi(t) {
|
|
|
4282
4282
|
/=\s*/,
|
|
4283
4283
|
/(async\s*)?/,
|
|
4284
4284
|
// async is optional
|
|
4285
|
-
e.lookahead(
|
|
4285
|
+
e.lookahead(ke)
|
|
4286
4286
|
],
|
|
4287
4287
|
keywords: "async",
|
|
4288
4288
|
className: {
|
|
@@ -4298,7 +4298,7 @@ function vi(t) {
|
|
|
4298
4298
|
aliases: ["js", "jsx", "mjs", "cjs"],
|
|
4299
4299
|
keywords: l,
|
|
4300
4300
|
// this will be extended by TypeScript
|
|
4301
|
-
exports: { PARAMS_CONTAINS: V, CLASS_REFERENCE:
|
|
4301
|
+
exports: { PARAMS_CONTAINS: V, CLASS_REFERENCE: ce },
|
|
4302
4302
|
illegal: /#(?![$_A-z])/,
|
|
4303
4303
|
contains: [
|
|
4304
4304
|
t.SHEBANG({
|
|
@@ -4306,18 +4306,18 @@ function vi(t) {
|
|
|
4306
4306
|
binary: "node",
|
|
4307
4307
|
relevance: 5
|
|
4308
4308
|
}),
|
|
4309
|
-
|
|
4309
|
+
Te,
|
|
4310
4310
|
t.APOS_STRING_MODE,
|
|
4311
4311
|
t.QUOTE_STRING_MODE,
|
|
4312
4312
|
$,
|
|
4313
|
-
|
|
4313
|
+
E,
|
|
4314
4314
|
R,
|
|
4315
4315
|
W,
|
|
4316
4316
|
G,
|
|
4317
4317
|
// Skip numbers when they are part of a variable name
|
|
4318
4318
|
{ match: /\$\d+/ },
|
|
4319
4319
|
b,
|
|
4320
|
-
|
|
4320
|
+
ce,
|
|
4321
4321
|
{
|
|
4322
4322
|
scope: "attr",
|
|
4323
4323
|
match: o + e.lookahead(":"),
|
|
@@ -4337,7 +4337,7 @@ function vi(t) {
|
|
|
4337
4337
|
// we have to count the parens to make sure we actually have the
|
|
4338
4338
|
// correct bounding ( ) before the =>. There could be any number of
|
|
4339
4339
|
// sub-expressions inside also surrounded by parens.
|
|
4340
|
-
begin:
|
|
4340
|
+
begin: ke,
|
|
4341
4341
|
returnBegin: !0,
|
|
4342
4342
|
end: "\\s*=>",
|
|
4343
4343
|
contains: [
|
|
@@ -4399,7 +4399,7 @@ function vi(t) {
|
|
|
4399
4399
|
}
|
|
4400
4400
|
]
|
|
4401
4401
|
},
|
|
4402
|
-
|
|
4402
|
+
Ce,
|
|
4403
4403
|
{
|
|
4404
4404
|
// prevent this from getting swallowed up by function
|
|
4405
4405
|
// since they appear "function like"
|
|
@@ -4423,7 +4423,7 @@ function vi(t) {
|
|
|
4423
4423
|
match: /\.\.\./,
|
|
4424
4424
|
relevance: 0
|
|
4425
4425
|
},
|
|
4426
|
-
|
|
4426
|
+
de,
|
|
4427
4427
|
// hack: prevents detection of keywords in some circumstances
|
|
4428
4428
|
// .keyword()
|
|
4429
4429
|
// $keyword = x
|
|
@@ -4437,7 +4437,7 @@ function vi(t) {
|
|
|
4437
4437
|
contains: [j]
|
|
4438
4438
|
},
|
|
4439
4439
|
Pe,
|
|
4440
|
-
|
|
4440
|
+
Ne,
|
|
4441
4441
|
ee,
|
|
4442
4442
|
Be,
|
|
4443
4443
|
{
|
|
@@ -4448,7 +4448,7 @@ function vi(t) {
|
|
|
4448
4448
|
};
|
|
4449
4449
|
}
|
|
4450
4450
|
function ur(t) {
|
|
4451
|
-
const e = t.regex, n =
|
|
4451
|
+
const e = t.regex, n = Ei(t), o = ut, r = [
|
|
4452
4452
|
"any",
|
|
4453
4453
|
"void",
|
|
4454
4454
|
"number",
|
|
@@ -4497,7 +4497,7 @@ function ur(t) {
|
|
|
4497
4497
|
"override",
|
|
4498
4498
|
"satisfies"
|
|
4499
4499
|
], h = {
|
|
4500
|
-
$pattern:
|
|
4500
|
+
$pattern: ut,
|
|
4501
4501
|
keyword: ir.concat(c),
|
|
4502
4502
|
literal: sr,
|
|
4503
4503
|
built_in: hr.concat(r),
|
|
@@ -4531,8 +4531,8 @@ function ur(t) {
|
|
|
4531
4531
|
$
|
|
4532
4532
|
// Added for optional property assignment highlighting
|
|
4533
4533
|
]), b(n, "shebang", t.SHEBANG()), b(n, "use_strict", l);
|
|
4534
|
-
const
|
|
4535
|
-
return
|
|
4534
|
+
const E = n.contains.find((R) => R.label === "func.def");
|
|
4535
|
+
return E.relevance = 0, Object.assign(n, {
|
|
4536
4536
|
name: "TypeScript",
|
|
4537
4537
|
aliases: [
|
|
4538
4538
|
"ts",
|
|
@@ -5503,7 +5503,7 @@ const Pi = (t) => (e, n) => {
|
|
|
5503
5503
|
customElements.define(t, e);
|
|
5504
5504
|
})) : customElements.define(t, e);
|
|
5505
5505
|
};
|
|
5506
|
-
const Bi = { attribute: !0, type: String, converter:
|
|
5506
|
+
const Bi = { attribute: !0, type: String, converter: at, reflect: !1, hasChanged: It }, Di = (t = Bi, e, n) => {
|
|
5507
5507
|
const { kind: o, metadata: r } = n;
|
|
5508
5508
|
let s = globalThis.litPropertyMetadata.get(r);
|
|
5509
5509
|
if (s === void 0 && globalThis.litPropertyMetadata.set(r, s = /* @__PURE__ */ new Map()), o === "setter" && ((t = Object.create(t)).wrapped = !0), s.set(n.name, t), o === "accessor") {
|
|
@@ -5524,16 +5524,16 @@ const Bi = { attribute: !0, type: String, converter: st, reflect: !1, hasChanged
|
|
|
5524
5524
|
}
|
|
5525
5525
|
throw Error("Unsupported decorator location: " + o);
|
|
5526
5526
|
};
|
|
5527
|
-
function
|
|
5527
|
+
function Wt(t) {
|
|
5528
5528
|
return (e, n) => typeof n == "object" ? Di(t, e, n) : ((o, r, s) => {
|
|
5529
5529
|
const i = r.hasOwnProperty(s);
|
|
5530
5530
|
return r.constructor.createProperty(s, o), i ? Object.getOwnPropertyDescriptor(r, s) : void 0;
|
|
5531
5531
|
})(t, e, n);
|
|
5532
5532
|
}
|
|
5533
|
-
function
|
|
5534
|
-
return
|
|
5533
|
+
function Ye(t) {
|
|
5534
|
+
return Wt({ ...t, state: !0, attribute: !1 });
|
|
5535
5535
|
}
|
|
5536
|
-
var Ui = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor,
|
|
5536
|
+
var Ui = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, ye = (t, e, n, o) => {
|
|
5537
5537
|
for (var r = o > 1 ? void 0 : o ? Hi(e, n) : e, s = t.length - 1, i; s >= 0; s--)
|
|
5538
5538
|
(i = t[s]) && (r = (o ? i(e, n, r) : i(r)) || r);
|
|
5539
5539
|
return o && r && Ui(e, n, r), r;
|
|
@@ -5547,10 +5547,10 @@ te.registerLanguage("typescript", ur);
|
|
|
5547
5547
|
te.registerLanguage("ts", ur);
|
|
5548
5548
|
te.registerLanguage("json", Si);
|
|
5549
5549
|
te.registerLanguage("css", Ii);
|
|
5550
|
-
te.registerLanguage("plaintext",
|
|
5551
|
-
let
|
|
5550
|
+
te.registerLanguage("plaintext", vi);
|
|
5551
|
+
let le = class extends qe {
|
|
5552
5552
|
constructor() {
|
|
5553
|
-
super(), this.version = "1.0.
|
|
5553
|
+
super(), this.version = "1.0.5", this.marked = new Yn(
|
|
5554
5554
|
hi({
|
|
5555
5555
|
emptyLangClass: "hljs",
|
|
5556
5556
|
langPrefix: "hljs language-",
|
|
@@ -5572,38 +5572,52 @@ let me = class extends qe {
|
|
|
5572
5572
|
this.themeBgColor = n || this.theme?.theme_object?.backgroundColor, this.themeTitleColor = e || this.theme?.theme_object?.title?.textStyle?.color, this.themeSubtitleColor = e || this.theme?.theme_object?.title?.subtextStyle?.color || this.themeTitleColor;
|
|
5573
5573
|
}
|
|
5574
5574
|
/**
|
|
5575
|
-
*
|
|
5576
|
-
*
|
|
5575
|
+
* Converts {{variableName}} to spans with data attributes for efficient updating.
|
|
5576
|
+
* Markdown is parsed once, then only variable spans are updated.
|
|
5577
5577
|
*/
|
|
5578
|
-
|
|
5579
|
-
return
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5578
|
+
convertVariablesToSpans(t) {
|
|
5579
|
+
return t.replace(/\{\{([^}]+)\}\}/g, (e, n) => `<span class="md-var" data-var="${n.trim()}"></span>`);
|
|
5580
|
+
}
|
|
5581
|
+
/**
|
|
5582
|
+
* Updates variable spans in the rendered DOM without recreating the entire structure.
|
|
5583
|
+
*/
|
|
5584
|
+
updated(t) {
|
|
5585
|
+
super.updated(t), t.has("inputData") && this.shadowRoot?.querySelectorAll(".md-var")?.forEach((n) => {
|
|
5586
|
+
const o = n.getAttribute("data-var");
|
|
5587
|
+
if (o) {
|
|
5588
|
+
const s = this.inputData?.data?.find((i) => i.label === o)?.value;
|
|
5589
|
+
if (s == null)
|
|
5590
|
+
n.textContent = `{{${o}}}`;
|
|
5591
|
+
else if (typeof s == "object")
|
|
5592
|
+
try {
|
|
5593
|
+
n.textContent = JSON.stringify(s);
|
|
5594
|
+
} catch {
|
|
5595
|
+
n.textContent = `{{${o}}}`;
|
|
5596
|
+
}
|
|
5597
|
+
else
|
|
5598
|
+
n.textContent = String(s);
|
|
5599
|
+
}
|
|
5600
|
+
});
|
|
5592
5601
|
}
|
|
5593
5602
|
render() {
|
|
5594
|
-
const t = String(this.inputData?.markdown ?? "")
|
|
5603
|
+
const t = String(this.inputData?.markdown ?? "");
|
|
5604
|
+
if (t !== this.lastMarkdown) {
|
|
5605
|
+
this.lastMarkdown = t;
|
|
5606
|
+
const e = this.convertVariablesToSpans(t);
|
|
5607
|
+
this.cachedHtmlTemplate = this.marked.parse(e);
|
|
5608
|
+
}
|
|
5595
5609
|
return fo`
|
|
5596
5610
|
<div class="wrapper" style="background-color: ${this.themeBgColor}">
|
|
5597
5611
|
<div class="paging markdown-body" ?active=${this.inputData?.markdown}>
|
|
5598
|
-
${To(
|
|
5612
|
+
${To(this.cachedHtmlTemplate ?? "")}
|
|
5599
5613
|
</div>
|
|
5600
5614
|
</div>
|
|
5601
5615
|
`;
|
|
5602
5616
|
}
|
|
5603
5617
|
};
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5618
|
+
le.styles = [
|
|
5619
|
+
At(zi),
|
|
5620
|
+
At(Li),
|
|
5607
5621
|
no`
|
|
5608
5622
|
:host {
|
|
5609
5623
|
display: block;
|
|
@@ -5651,25 +5665,31 @@ me.styles = [
|
|
|
5651
5665
|
}
|
|
5652
5666
|
`
|
|
5653
5667
|
];
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
],
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
],
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
],
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
],
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
],
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
],
|
|
5668
|
+
ye([
|
|
5669
|
+
Wt({ type: Object })
|
|
5670
|
+
], le.prototype, "inputData", 2);
|
|
5671
|
+
ye([
|
|
5672
|
+
Wt({ type: Object })
|
|
5673
|
+
], le.prototype, "theme", 2);
|
|
5674
|
+
ye([
|
|
5675
|
+
Ye()
|
|
5676
|
+
], le.prototype, "themeBgColor", 2);
|
|
5677
|
+
ye([
|
|
5678
|
+
Ye()
|
|
5679
|
+
], le.prototype, "themeTitleColor", 2);
|
|
5680
|
+
ye([
|
|
5681
|
+
Ye()
|
|
5682
|
+
], le.prototype, "themeSubtitleColor", 2);
|
|
5683
|
+
ye([
|
|
5684
|
+
Ye()
|
|
5685
|
+
], le.prototype, "cachedHtmlTemplate", 2);
|
|
5686
|
+
ye([
|
|
5687
|
+
Ye()
|
|
5688
|
+
], le.prototype, "lastMarkdown", 2);
|
|
5689
|
+
le = ye([
|
|
5690
|
+
Pi("widget-markdown-1.0.5")
|
|
5691
|
+
], le);
|
|
5672
5692
|
export {
|
|
5673
|
-
|
|
5693
|
+
le as WidgetMarkdown
|
|
5674
5694
|
};
|
|
5675
5695
|
//# sourceMappingURL=widget-markdown.js.map
|