markstream-angular 0.0.2-beta.6 → 0.0.2-beta.7

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/index.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import { CommonModule as _ } from "@angular/common";
2
- import { Input as c, Component as b, ChangeDetectionStrategy as k, forwardRef as p, inject as X, ChangeDetectorRef as me, ViewChild as B, ViewContainerRef as xi, ElementRef as uo, Renderer2 as bi, Directive as ki, HostListener as ho, EventEmitter as mt, Output as Pt } from "@angular/core";
3
- import { normalizeCustomHtmlTags as dt, normalizeCustomHtmlTagName as Ut, mergeCustomHtmlTags as sr, parseMarkdownToStructure as en, getMarkdown as tn, BLOCKED_HTML_TAGS as Ci, VOID_HTML_TAGS as mo, DANGEROUS_HTML_ATTRS as fo, URL_HTML_ATTRS as po, isUnsafeHtmlUrl as go, NON_STRUCTURING_HTML_TAGS as yo, stripCustomHtmlWrapper as Ti, getHtmlTagFromContent as Pi, STANDARD_HTML_TAGS as Si, hasCompleteHtmlTagContent as _i } from "stream-markdown-parser";
2
+ import { Input as c, Component as b, ChangeDetectionStrategy as k, forwardRef as p, inject as X, ChangeDetectorRef as me, ViewChild as B, ViewContainerRef as bi, ElementRef as ho, Renderer2 as ki, Directive as Ci, HostListener as mo, EventEmitter as mt, Output as Pt } from "@angular/core";
3
+ import { normalizeCustomHtmlTags as dt, normalizeCustomHtmlTagName as Ut, mergeCustomHtmlTags as sr, parseMarkdownToStructure as tn, getMarkdown as rn, BLOCKED_HTML_TAGS as Ti, VOID_HTML_TAGS as fo, DANGEROUS_HTML_ATTRS as po, URL_HTML_ATTRS as go, isUnsafeHtmlUrl as yo, NON_STRUCTURING_HTML_TAGS as vo, stripCustomHtmlWrapper as Pi, getHtmlTagFromContent as Si, STANDARD_HTML_TAGS as _i, hasCompleteHtmlTagContent as Mi } from "stream-markdown-parser";
4
4
  const Ht = /<\/?([A-Z][\w:-]*)(?:\s[^<>]*)?>/gi;
5
- function rn(e, t, r) {
5
+ function nn(e, t, r) {
6
6
  const o = dt(r), n = new Set(o);
7
7
  if (!t || n.size === 0 || !Array.isArray(e) || e.length === 0)
8
8
  return Array.isArray(e) ? e.slice() : [];
9
- const i = Mi(t, n);
9
+ const i = Oi(t, n);
10
10
  if (i.length === 0)
11
11
  return e.slice();
12
12
  let s = 0;
13
- const a = e.map((d) => jr(d)), l = (d) => {
13
+ const a = e.map((d) => Wr(d)), l = (d) => {
14
14
  if (!d || typeof d != "object")
15
15
  return;
16
- const u = Di(d, n);
16
+ const u = Ri(d, n);
17
17
  if (u) {
18
- const h = Ei(i, u, () => s, (f) => s = f);
18
+ const h = Di(i, u, () => s, (f) => s = f);
19
19
  h && (d.tag = u, d.type = u, d.content = h.innerContent, d.raw = h.raw, typeof d.loading != "boolean" && (d.loading = h.loading));
20
20
  }
21
21
  for (const h of Object.values(d))
@@ -27,7 +27,7 @@ function rn(e, t, r) {
27
27
  l(d);
28
28
  return a;
29
29
  }
30
- function Mi(e, t) {
30
+ function Oi(e, t) {
31
31
  const r = [], o = [];
32
32
  let n;
33
33
  for (Ht.lastIndex = 0; (n = Ht.exec(e)) !== null; ) {
@@ -42,7 +42,7 @@ function Mi(e, t) {
42
42
  });
43
43
  continue;
44
44
  }
45
- const l = Oi(r, s);
45
+ const l = Ei(r, s);
46
46
  if (l < 0)
47
47
  continue;
48
48
  const [d] = r.splice(l, 1), u = n.index, h = Ht.lastIndex;
@@ -66,13 +66,13 @@ function Mi(e, t) {
66
66
  });
67
67
  return o.sort((i, s) => i.start !== s.start ? i.start - s.start : s.end - i.end);
68
68
  }
69
- function Oi(e, t) {
69
+ function Ei(e, t) {
70
70
  for (let r = e.length - 1; r >= 0; r -= 1)
71
71
  if (e[r]?.tag === t)
72
72
  return r;
73
73
  return -1;
74
74
  }
75
- function Ei(e, t, r, o) {
75
+ function Di(e, t, r, o) {
76
76
  let n = r();
77
77
  for (; n < e.length; ) {
78
78
  const i = e[n];
@@ -81,38 +81,38 @@ function Ei(e, t, r, o) {
81
81
  }
82
82
  return o(n), null;
83
83
  }
84
- function Di(e, t) {
84
+ function Ri(e, t) {
85
85
  const r = Ut(e.tag);
86
86
  if (r && t.has(r))
87
87
  return r;
88
88
  const o = Ut(e.type);
89
89
  return o && t.has(o) ? o : "";
90
90
  }
91
- function jr(e) {
91
+ function Wr(e) {
92
92
  if (!e || typeof e != "object")
93
93
  return e;
94
- const t = Array.isArray(e) ? e.map((r) => jr(r)) : { ...e };
94
+ const t = Array.isArray(e) ? e.map((r) => Wr(r)) : { ...e };
95
95
  if (!Array.isArray(t))
96
96
  for (const [r, o] of Object.entries(t))
97
- Array.isArray(o) && (t[r] = o.map((n) => jr(n)));
97
+ Array.isArray(o) && (t[r] = o.map((n) => Wr(n)));
98
98
  return t;
99
99
  }
100
- const Ri = "markstream-angular-nested-nodes", Rn = /* @__PURE__ */ new Map();
101
- function Ii(e, t = {}) {
100
+ const Ii = "markstream-angular-nested-nodes", In = /* @__PURE__ */ new Map();
101
+ function Ni(e, t = {}) {
102
102
  if (Array.isArray(e.nodes))
103
103
  return e.nodes.slice();
104
104
  const r = e.node;
105
105
  if (r) {
106
- const s = Hi(r.children);
106
+ const s = Bi(r.children);
107
107
  if (s.length > 0)
108
108
  return s.slice();
109
109
  }
110
110
  const o = $i(e);
111
111
  if (!o)
112
112
  return [];
113
- const n = Ni(e, t), i = Li(t);
114
- return rn(
115
- en(o, i, n),
113
+ const n = Ai(e, t), i = Hi(t);
114
+ return nn(
115
+ tn(o, i, n),
116
116
  o,
117
117
  sr(t.customHtmlTags, n?.customHtmlTags)
118
118
  );
@@ -120,40 +120,40 @@ function Ii(e, t = {}) {
120
120
  function $i(e) {
121
121
  return typeof e.content == "string" ? e.content : typeof e.node?.content == "string" ? e.node.content : "";
122
122
  }
123
- function Ni(e, t) {
124
- const r = t.parseOptions ?? {}, o = t.final ?? Ai(e.node), n = sr(t.customHtmlTags, r.customHtmlTags);
123
+ function Ai(e, t) {
124
+ const r = t.parseOptions ?? {}, o = t.final ?? Li(e.node), n = sr(t.customHtmlTags, r.customHtmlTags);
125
125
  return o == null && n.length === 0 ? r : {
126
126
  ...r,
127
127
  ...o == null ? {} : { final: o },
128
128
  ...n.length === 0 ? {} : { customHtmlTags: n }
129
129
  };
130
130
  }
131
- function Ai(e) {
131
+ function Li(e) {
132
132
  if (!(!e || typeof e != "object") && typeof e.loading == "boolean")
133
133
  return !e.loading;
134
134
  }
135
- function Li(e) {
136
- const t = sr(e.customHtmlTags, e.parseOptions?.customHtmlTags), r = `${e.cacheKey || Ri}::${t.join(",")}`;
137
- let o = Rn.get(r);
138
- return o || (o = tn(r, {
135
+ function Hi(e) {
136
+ const t = sr(e.customHtmlTags, e.parseOptions?.customHtmlTags), r = `${e.cacheKey || Ii}::${t.join(",")}`;
137
+ let o = In.get(r);
138
+ return o || (o = rn(r, {
139
139
  customHtmlTags: t
140
- }), Rn.set(r, o)), e.customMarkdownIt ? e.customMarkdownIt(o) : o;
140
+ }), In.set(r, o)), e.customMarkdownIt ? e.customMarkdownIt(o) : o;
141
141
  }
142
- function Hi(e) {
142
+ function Bi(e) {
143
143
  return Array.isArray(e) ? e : [];
144
144
  }
145
- const ar = "__global__", Lr = "__MARKSTREAM_ANGULAR_CUSTOM_COMPONENTS_STORE__", G = (() => {
145
+ const ar = "__global__", Hr = "__MARKSTREAM_ANGULAR_CUSTOM_COMPONENTS_STORE__", G = (() => {
146
146
  const e = globalThis;
147
- if (e[Lr])
148
- return e[Lr];
147
+ if (e[Hr])
148
+ return e[Hr];
149
149
  const t = {
150
150
  scopedComponents: {},
151
151
  revision: 0,
152
152
  listeners: /* @__PURE__ */ new Set()
153
153
  };
154
- return e[Lr] = t, t;
154
+ return e[Hr] = t, t;
155
155
  })();
156
- function nn() {
156
+ function on() {
157
157
  G.revision += 1;
158
158
  for (const e of Array.from(G.listeners))
159
159
  try {
@@ -161,18 +161,18 @@ function nn() {
161
161
  } catch {
162
162
  }
163
163
  }
164
- function Bi(e) {
164
+ function Fi(e) {
165
165
  return G.listeners.add(e), () => {
166
166
  G.listeners.delete(e);
167
167
  };
168
168
  }
169
- function cd() {
169
+ function dd() {
170
170
  return G.revision;
171
171
  }
172
- function dd(e, t) {
173
- typeof e == "string" ? G.scopedComponents[e] = { ...t || {} } : G.scopedComponents[ar] = { ...e }, nn();
172
+ function ud(e, t) {
173
+ typeof e == "string" ? G.scopedComponents[e] = { ...t || {} } : G.scopedComponents[ar] = { ...e }, on();
174
174
  }
175
- function vo(e) {
175
+ function wo(e) {
176
176
  const t = G.scopedComponents[ar] || {};
177
177
  if (!e)
178
178
  return t;
@@ -182,15 +182,15 @@ function vo(e) {
182
182
  ...r
183
183
  };
184
184
  }
185
- function ud(e) {
185
+ function hd(e) {
186
186
  if (e === ar)
187
187
  throw new Error("removeCustomComponents: cannot delete global mapping; call clearGlobalCustomComponents instead.");
188
- delete G.scopedComponents[e], nn();
188
+ delete G.scopedComponents[e], on();
189
189
  }
190
- function hd() {
191
- delete G.scopedComponents[ar], nn();
190
+ function md() {
191
+ delete G.scopedComponents[ar], on();
192
192
  }
193
- const In = /* @__PURE__ */ new Map(), Fi = /* @__PURE__ */ new Set([
193
+ const Nn = /* @__PURE__ */ new Map(), Ki = /* @__PURE__ */ new Set([
194
194
  "table",
195
195
  "code_block",
196
196
  "html_block",
@@ -207,7 +207,7 @@ const In = /* @__PURE__ */ new Map(), Fi = /* @__PURE__ */ new Set([
207
207
  "thinking",
208
208
  "vmr_container"
209
209
  ]);
210
- function Ki(e, t = {}, r, o) {
210
+ function zi(e, t = {}, r, o) {
211
211
  const n = dt([
212
212
  ...e.customHtmlTags || [],
213
213
  ...e.parseOptions?.customHtmlTags || []
@@ -243,7 +243,7 @@ function Ki(e, t = {}, r, o) {
243
243
  events: t
244
244
  };
245
245
  }
246
- function zi(e) {
246
+ function ji(e) {
247
247
  if (Array.isArray(e.nodes))
248
248
  return e.nodes;
249
249
  const t = w(e.content);
@@ -253,13 +253,13 @@ function zi(e) {
253
253
  ...e.customHtmlTags || [],
254
254
  ...e.parseOptions?.customHtmlTags || []
255
255
  ]), o = `${e.customId || "markstream-angular"}::${r.join(",")}`;
256
- let n = In.get(o);
257
- n || (n = tn(o, { customHtmlTags: r }), In.set(o, n));
256
+ let n = Nn.get(o);
257
+ n || (n = rn(o, { customHtmlTags: r }), Nn.set(o, n));
258
258
  const i = e.customMarkdownIt ? e.customMarkdownIt(n) : n, s = {
259
259
  ...e.parseOptions ?? {}
260
260
  };
261
- return typeof e.final == "boolean" && (s.final = e.final), r.length > 0 && (s.customHtmlTags = r), rn(
262
- en(t, i, s),
261
+ return typeof e.final == "boolean" && (s.final = e.final), r.length > 0 && (s.customHtmlTags = r), nn(
262
+ tn(t, i, s),
263
263
  t,
264
264
  r
265
265
  );
@@ -270,20 +270,20 @@ function E(e) {
270
270
  function ze(e) {
271
271
  return w(e?.type) === "text" && w(e?.content).trim() === "";
272
272
  }
273
- function ji(e) {
273
+ function Wi(e) {
274
274
  return w(e?.type) !== "link" ? [] : E(e?.children).filter((t) => !ze(t));
275
275
  }
276
- function Wi(e) {
277
- const t = ji(e);
276
+ function Vi(e) {
277
+ const t = Wi(e);
278
278
  return t.length === 1 && w(t[0]?.type) === "image";
279
279
  }
280
- function wo(e) {
280
+ function xo(e) {
281
281
  const t = E(e).filter((r) => !ze(r));
282
- return t.length > 0 && t.every((r) => w(r?.type) === "image" || Wi(r));
282
+ return t.length > 0 && t.every((r) => w(r?.type) === "image" || Vi(r));
283
283
  }
284
- function Vi(e) {
284
+ function qi(e) {
285
285
  const t = E(e), r = t.filter((n) => !ze(n));
286
- if (!wo(t) || r.length <= 1)
286
+ if (!xo(t) || r.length <= 1)
287
287
  return t;
288
288
  const o = [];
289
289
  for (let n = 0; n < t.length; n += 1) {
@@ -304,40 +304,40 @@ function Vi(e) {
304
304
  function w(e) {
305
305
  return typeof e == "string" ? e : e == null ? "" : String(e);
306
306
  }
307
- function on(e) {
307
+ function sn(e) {
308
308
  return /^[^\s"'<>`=]+$/.test(e) && !/^on/i.test(e);
309
309
  }
310
- function sn(e) {
310
+ function an(e) {
311
311
  return w(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
312
312
  }
313
- function qi(e) {
314
- return sn(e).replace(/`/g, "&#96;");
313
+ function Ui(e) {
314
+ return an(e).replace(/`/g, "&#96;");
315
315
  }
316
- function xo(e) {
316
+ function bo(e) {
317
317
  return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
318
318
  }
319
- function Ui(e) {
319
+ function Xi(e) {
320
320
  const t = Math.trunc(Number(e) || 1);
321
321
  return Math.min(6, Math.max(1, t));
322
322
  }
323
- function Xi(e) {
323
+ function Gi(e) {
324
324
  return e ? `${e[0].toUpperCase()}${e.slice(1)}` : "";
325
325
  }
326
- function bo(e) {
326
+ function ko(e) {
327
327
  return String(String(e ?? "").split(/\s+/g)[0] ?? "").toLowerCase().replace(/[^\w-]/g, "") || "plaintext";
328
328
  }
329
- function Gi(e) {
330
- return bo(e?.language);
329
+ function Co(e) {
330
+ return ko(e?.language);
331
331
  }
332
332
  function Zi(e) {
333
- return !Array.isArray(e) || e.length === 0 ? null : e.reduce((t, [r, o]) => (!r || !on(r) || (t[r] = o ?? !0), t), {});
333
+ return !Array.isArray(e) || e.length === 0 ? null : e.reduce((t, [r, o]) => (!r || !sn(r) || (t[r] = o ?? !0), t), {});
334
334
  }
335
335
  function Yi(e) {
336
336
  const t = [], r = [], o = () => {
337
337
  r.length && (t.push({ kind: "inline", nodes: r.slice() }), r.length = 0);
338
338
  };
339
339
  for (const n of e)
340
- Fi.has(String(n?.type || "")) ? (o(), t.push({ kind: "block", node: n })) : r.push(n);
340
+ Ki.has(String(n?.type || "")) ? (o(), t.push({ kind: "block", node: n })) : r.push(n);
341
341
  return o(), t;
342
342
  }
343
343
  var Ji = Object.defineProperty, Qi = Object.getOwnPropertyDescriptor, lr = (e, t, r, o) => {
@@ -390,7 +390,7 @@ Ve = lr([
390
390
  changeDetection: k.OnPush
391
391
  })
392
392
  ], Ve);
393
- var es = Object.defineProperty, ts = Object.getOwnPropertyDescriptor, ko = (e, t, r, o) => {
393
+ var es = Object.defineProperty, ts = Object.getOwnPropertyDescriptor, To = (e, t, r, o) => {
394
394
  for (var n = o > 1 ? void 0 : o ? ts(t, r) : t, i = e.length - 1, s; i >= 0; i--)
395
395
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
396
396
  return o && n && es(t, r, n), n;
@@ -400,10 +400,10 @@ let Xt = class {
400
400
  return !!this.node?.checked;
401
401
  }
402
402
  };
403
- ko([
403
+ To([
404
404
  c({ required: !0 })
405
405
  ], Xt.prototype, "node", 2);
406
- Xt = ko([
406
+ Xt = To([
407
407
  b({
408
408
  selector: "markstream-angular-checkbox-node",
409
409
  standalone: !0,
@@ -414,7 +414,7 @@ Xt = ko([
414
414
  function rs(e) {
415
415
  return (e.split(".").pop() || e).replace(/[_-]/g, " ").replace(/([A-Z])/g, " $1").replace(/\s+/g, " ").replace(/\b\w/g, (r) => r.toUpperCase()).trim();
416
416
  }
417
- const Co = {
417
+ const Po = {
418
418
  "common.copy": "Copy",
419
419
  "common.copied": "Copied",
420
420
  "common.decrease": "Decrease",
@@ -433,17 +433,17 @@ const Co = {
433
433
  "artifacts.htmlPreviewTitle": "HTML Preview",
434
434
  "artifacts.svgPreviewTitle": "SVG Preview"
435
435
  };
436
- function md(e) {
437
- Object.assign(Co, e);
436
+ function fd(e) {
437
+ Object.assign(Po, e);
438
438
  }
439
- function To() {
439
+ function So() {
440
440
  return {
441
441
  t(e) {
442
- return Co[e] ?? rs(e);
442
+ return Po[e] ?? rs(e);
443
443
  }
444
444
  };
445
445
  }
446
- let ge = null, Hr = !1, ft = null, $n = !1;
446
+ let ge = null, Br = !1, ft = null, $n = !1;
447
447
  async function ns(e) {
448
448
  if ($n)
449
449
  return;
@@ -465,19 +465,19 @@ async function os(e) {
465
465
  return console.warn("[markstream-angular] Failed to warm up stream-monaco tokenizer; falling back to plain code rendering.", r), !1;
466
466
  }
467
467
  }
468
- async function Po() {
468
+ async function _o() {
469
469
  if (ge)
470
470
  return ge;
471
471
  if (ft)
472
472
  return await ft;
473
- if (Hr)
473
+ if (Br)
474
474
  return null;
475
475
  ft = (async () => {
476
476
  try {
477
477
  const e = await import("stream-monaco");
478
- return ge = e?.default ?? e, await ns(ge), await os(ge) ? ge : (ge = null, Hr = !0, null);
478
+ return ge = e?.default ?? e, await ns(ge), await os(ge) ? ge : (ge = null, Br = !0, null);
479
479
  } catch {
480
- return Hr = !0, null;
480
+ return Br = !0, null;
481
481
  }
482
482
  })();
483
483
  try {
@@ -501,7 +501,7 @@ const ve = `
501
501
  <path d="M12 9v2.5" />
502
502
  <path d="M12 11.5l-3.5 3.5" />
503
503
  <path d="M12 11.5l3.5 3.5" />
504
- </svg>`, Nn = `
504
+ </svg>`, An = `
505
505
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
506
506
  <path d="M8 7l-4 5l4 5" />
507
507
  <path d="M16 7l4 5l-4 5" />
@@ -516,7 +516,7 @@ const ve = `
516
516
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
517
517
  <path d="M9 4c-2 0-3 1.5-3 3.5v2c0 1.1-.4 1.8-1.5 2.5C5.6 12.7 6 13.4 6 14.5v2C6 18.5 7 20 9 20" />
518
518
  <path d="M15 4c2 0 3 1.5 3 3.5v2c0 1.1.4 1.8 1.5 2.5c-1.1.7-1.5 1.4-1.5 2.5v2c0 2-1 3.5-3 3.5" />
519
- </svg>`, An = `
519
+ </svg>`, Ln = `
520
520
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
521
521
  <path d="M5 6h14" />
522
522
  <path d="M12 6v12" />
@@ -555,21 +555,21 @@ const ve = `
555
555
  typescript: "TypeScript",
556
556
  vue: "Vue"
557
557
  }, ds = {
558
- "": An,
559
- html: Nn,
558
+ "": Ln,
559
+ html: An,
560
560
  javascript: ve,
561
561
  json: as,
562
562
  jsx: ve,
563
563
  markdown: ss,
564
564
  mermaid: is,
565
- plain: An,
565
+ plain: Ln,
566
566
  python: ve,
567
567
  shell: ve,
568
- svg: Nn,
568
+ svg: An,
569
569
  tsx: ve,
570
570
  typescript: ve
571
571
  };
572
- let Wr = null;
572
+ let Vr = null;
573
573
  function us(e) {
574
574
  if (!e)
575
575
  return "";
@@ -579,35 +579,35 @@ function us(e) {
579
579
  const [r] = t.split(/\s+/), [o] = r.split(":");
580
580
  return o.toLowerCase();
581
581
  }
582
- function an(e) {
582
+ function ln(e) {
583
583
  const t = us(e);
584
584
  return ls[t] ?? t;
585
585
  }
586
586
  function hs(e) {
587
- const t = an(e);
587
+ const t = ln(e);
588
588
  return !t || t === "plain" ? "plaintext" : t === "jsx" ? "javascript" : t === "tsx" ? "typescript" : t;
589
589
  }
590
- function fd(e) {
591
- Wr = e ?? null;
590
+ function pd(e) {
591
+ Vr = e ?? null;
592
592
  }
593
593
  function ms(e) {
594
- if (Wr) {
595
- const r = Wr(e);
594
+ if (Vr) {
595
+ const r = Vr(e);
596
596
  if (r != null && r !== "")
597
597
  return r;
598
598
  }
599
- const t = an(e);
599
+ const t = ln(e);
600
600
  return ds[t] || ve;
601
601
  }
602
602
  const fs = cs;
603
- var ps = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, So = (e, t, r, o) => {
603
+ var ps = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, Mo = (e, t, r, o) => {
604
604
  for (var n = o > 1 ? void 0 : o ? gs(t, r) : t, i = e.length - 1, s; i >= 0; i--)
605
605
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
606
606
  return o && n && ps(t, r, n), n;
607
607
  };
608
608
  let wt = class {
609
609
  get language() {
610
- return bo(this.node?.language);
610
+ return ko(this.node?.language);
611
611
  }
612
612
  get languageClass() {
613
613
  return `language-${this.language}`;
@@ -622,10 +622,10 @@ let wt = class {
622
622
  return this.node?.loading === !0;
623
623
  }
624
624
  };
625
- So([
625
+ Mo([
626
626
  c({ required: !0 })
627
627
  ], wt.prototype, "node", 2);
628
- wt = So([
628
+ wt = Mo([
629
629
  b({
630
630
  selector: "markstream-angular-pre-code-node",
631
631
  standalone: !0,
@@ -640,7 +640,7 @@ var ys = Object.defineProperty, vs = Object.getOwnPropertyDescriptor, St = (e, t
640
640
  };
641
641
  let Te = class {
642
642
  constructor() {
643
- this.code = "", this.isDark = !1, this.i18n = To();
643
+ this.code = "", this.isDark = !1, this.i18n = So();
644
644
  }
645
645
  get resolvedTitle() {
646
646
  return this.title || `HTML ${this.i18n.t("common.preview")}`;
@@ -735,7 +735,7 @@ var ws = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, _t = (e, t
735
735
  };
736
736
  let Pe = class {
737
737
  constructor() {
738
- this.cdr = X(me), this.i18n = To(), this.useFallback = !1, this.copied = !1, this.collapsed = !1, this.expanded = !1, this.inlinePreviewOpen = !1, this.editorReady = !1, this.defaultFontSize = 14, this.fontSize = 14, this.helpers = null, this.createPromise = null, this.syncPromise = null, this.editorKind = null, this.viewReady = !1, this.destroyed = !1, this.copyTimer = null, this.deferredHeightSyncRaf = null, this.closeInlinePreview = () => {
738
+ this.cdr = X(me), this.i18n = So(), this.useFallback = !1, this.copied = !1, this.collapsed = !1, this.expanded = !1, this.inlinePreviewOpen = !1, this.editorReady = !1, this.defaultFontSize = 14, this.fontSize = 14, this.helpers = null, this.createPromise = null, this.syncPromise = null, this.editorKind = null, this.viewReady = !1, this.destroyed = !1, this.copyTimer = null, this.deferredHeightSyncRaf = null, this.closeInlinePreview = () => {
739
739
  this.inlinePreviewOpen = !1, this.cdr.markForCheck();
740
740
  };
741
741
  }
@@ -806,7 +806,7 @@ let Pe = class {
806
806
  return w(this.node?.language || "plaintext");
807
807
  }
808
808
  get canonicalLanguage() {
809
- return an(this.rawLanguage) || "plain";
809
+ return ln(this.rawLanguage) || "plain";
810
810
  }
811
811
  get monacoLanguage() {
812
812
  return hs(this.rawLanguage);
@@ -943,7 +943,7 @@ let Pe = class {
943
943
  if (this.createPromise)
944
944
  return this.createPromise;
945
945
  this.createPromise = (async () => {
946
- const e = await Po();
946
+ const e = await _o();
947
947
  if (!e || typeof e.useMonaco != "function") {
948
948
  this.useFallback = !0;
949
949
  return;
@@ -1299,8 +1299,8 @@ Pe = _t([
1299
1299
  changeDetection: k.OnPush
1300
1300
  })
1301
1301
  ], Pe);
1302
- const ln = () => import("@terrastruct/d2");
1303
- let pt = null, cn = ln, He = null;
1302
+ const cn = () => import("@terrastruct/d2");
1303
+ let pt = null, dn = cn, He = null;
1304
1304
  function bs() {
1305
1305
  pt = null, He = null;
1306
1306
  }
@@ -1314,24 +1314,24 @@ function ks(e) {
1314
1314
  const t = e.default ?? e;
1315
1315
  return typeof t == "function" ? t : t?.D2 && typeof t.D2 == "function" ? t.D2 : t;
1316
1316
  }
1317
- function _o(e) {
1318
- cn = e, bs();
1319
- }
1320
- function pd(e) {
1321
- _o(e ?? ln);
1317
+ function Oo(e) {
1318
+ dn = e, bs();
1322
1319
  }
1323
- function gd() {
1324
- _o(null);
1320
+ function gd(e) {
1321
+ Oo(e ?? cn);
1325
1322
  }
1326
1323
  function yd() {
1327
- return typeof cn == "function";
1324
+ Oo(null);
1325
+ }
1326
+ function vd() {
1327
+ return typeof dn == "function";
1328
1328
  }
1329
- async function Mo() {
1329
+ async function Eo() {
1330
1330
  if (pt)
1331
1331
  return pt;
1332
1332
  if (He)
1333
1333
  return await He;
1334
- const e = cn;
1334
+ const e = dn;
1335
1335
  if (!e)
1336
1336
  return null;
1337
1337
  He = (async () => {
@@ -1339,7 +1339,7 @@ async function Mo() {
1339
1339
  try {
1340
1340
  t = await e();
1341
1341
  } catch (r) {
1342
- throw e === ln ? new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.') : r;
1342
+ throw e === cn ? new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.') : r;
1343
1343
  }
1344
1344
  return t ? (pt = ks(t), pt) : null;
1345
1345
  })();
@@ -1388,7 +1388,7 @@ function _s(e) {
1388
1388
  }
1389
1389
  }
1390
1390
  }
1391
- function dn(e) {
1391
+ function un(e) {
1392
1392
  if (typeof DOMParser > "u" || !e)
1393
1393
  return "";
1394
1394
  const t = Ps(e), o = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
@@ -1397,10 +1397,10 @@ function dn(e) {
1397
1397
  const n = o;
1398
1398
  return _s(n), n.outerHTML;
1399
1399
  }
1400
- function Oo(e) {
1400
+ function Do(e) {
1401
1401
  return e ? typeof e == "string" ? e : typeof e.svg == "string" ? e.svg : typeof e.data == "string" ? e.data : "" : "";
1402
1402
  }
1403
- async function un(e) {
1403
+ async function hn(e) {
1404
1404
  try {
1405
1405
  if (typeof navigator < "u" && navigator.clipboard?.writeText)
1406
1406
  return await navigator.clipboard.writeText(e), !0;
@@ -1434,13 +1434,13 @@ function ke(e, t) {
1434
1434
  e.innerHTML = t;
1435
1435
  }
1436
1436
  }
1437
- function hn(e, t) {
1437
+ function mn(e, t) {
1438
1438
  if (!e || typeof document > "u" || typeof URL > "u")
1439
1439
  return;
1440
1440
  const r = new Blob([e], { type: "image/svg+xml;charset=utf-8" }), o = URL.createObjectURL(r), n = document.createElement("a");
1441
1441
  n.href = o, n.download = t, document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(o);
1442
1442
  }
1443
- function mn(e, t) {
1443
+ function fn(e, t) {
1444
1444
  return e == null || e === "" ? t ?? null : typeof e == "number" ? `${e}px` : String(e);
1445
1445
  }
1446
1446
  function Be(e, t, r) {
@@ -1506,7 +1506,7 @@ let Se = class {
1506
1506
  return typeof this.mergedProps.showTooltips == "boolean" ? this.mergedProps.showTooltips : this.context?.showTooltips !== !1;
1507
1507
  }
1508
1508
  get resolvedMaxHeight() {
1509
- return mn(this.mergedProps.maxHeight, "500px");
1509
+ return fn(this.mergedProps.maxHeight, "500px");
1510
1510
  }
1511
1511
  get resolvedLoading() {
1512
1512
  return typeof this.mergedProps.loading == "boolean" ? this.mergedProps.loading : this.node?.loading === !0;
@@ -1534,12 +1534,12 @@ let Se = class {
1534
1534
  this.showSource = e, e || this.scheduleHostSync(), this.cdr.markForCheck();
1535
1535
  }
1536
1536
  async copySource() {
1537
- await un(this.code), this.copied = !0, this.context?.events.onCopy?.(this.code), this.copyTimer != null && typeof window < "u" && window.clearTimeout(this.copyTimer), typeof window < "u" && (this.copyTimer = window.setTimeout(() => {
1537
+ await hn(this.code), this.copied = !0, this.context?.events.onCopy?.(this.code), this.copyTimer != null && typeof window < "u" && window.clearTimeout(this.copyTimer), typeof window < "u" && (this.copyTimer = window.setTimeout(() => {
1538
1538
  this.copied = !1, this.cdr.markForCheck();
1539
1539
  }, 1e3)), this.cdr.markForCheck();
1540
1540
  }
1541
1541
  exportSvg() {
1542
- this.svgMarkup && hn(this.svgMarkup, `d2-${Date.now()}.svg`);
1542
+ this.svgMarkup && mn(this.svgMarkup, `d2-${Date.now()}.svg`);
1543
1543
  }
1544
1544
  toggleCollapsed() {
1545
1545
  this.collapsed = !this.collapsed, this.collapsed || queueMicrotask(() => {
@@ -1561,7 +1561,7 @@ let Se = class {
1561
1561
  const t = ++this.renderToken;
1562
1562
  this.rendering = !0, this.error = "", this.cdr.markForCheck();
1563
1563
  try {
1564
- const r = await Mo();
1564
+ const r = await Eo();
1565
1565
  if (!r)
1566
1566
  throw new Error("D2 renderer is not available.");
1567
1567
  const o = Ds(r);
@@ -1580,7 +1580,7 @@ let Se = class {
1580
1580
  const l = await o.render(i, a);
1581
1581
  if (this.destroyed || t !== this.renderToken)
1582
1582
  return;
1583
- const d = dn(Oo(l));
1583
+ const d = un(Do(l));
1584
1584
  if (!d)
1585
1585
  throw new Error("D2 render returned empty output.");
1586
1586
  this.svgMarkup = d, this.syncSvgHost();
@@ -1776,10 +1776,10 @@ qe = cr([
1776
1776
  changeDetection: k.OnPush
1777
1777
  })
1778
1778
  ], qe);
1779
- var $s = Object.defineProperty, Ns = Object.getOwnPropertyDescriptor, Ie = (e, t, r, o) => {
1780
- for (var n = o > 1 ? void 0 : o ? Ns(t, r) : t, i = e.length - 1, s; i >= 0; i--)
1779
+ var Ns = Object.defineProperty, $s = Object.getOwnPropertyDescriptor, Ie = (e, t, r, o) => {
1780
+ for (var n = o > 1 ? void 0 : o ? $s(t, r) : t, i = e.length - 1, s; i >= 0; i--)
1781
1781
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
1782
- return o && n && $s(t, r, n), n;
1782
+ return o && n && Ns(t, r, n), n;
1783
1783
  };
1784
1784
  let te = class {
1785
1785
  constructor() {
@@ -1832,7 +1832,7 @@ Ie([
1832
1832
  c()
1833
1833
  ], te.prototype, "inputs", 2);
1834
1834
  Ie([
1835
- B("container", { read: xi, static: !0 })
1835
+ B("container", { read: bi, static: !0 })
1836
1836
  ], te.prototype, "containerRef", 2);
1837
1837
  te = Ie([
1838
1838
  b({
@@ -1842,7 +1842,7 @@ te = Ie([
1842
1842
  changeDetection: k.OnPush
1843
1843
  })
1844
1844
  ], te);
1845
- var As = Object.defineProperty, Ls = Object.getOwnPropertyDescriptor, Eo = (e, t, r, o) => {
1845
+ var As = Object.defineProperty, Ls = Object.getOwnPropertyDescriptor, Ro = (e, t, r, o) => {
1846
1846
  for (var n = o > 1 ? void 0 : o ? Ls(t, r) : t, i = e.length - 1, s; i >= 0; i--)
1847
1847
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
1848
1848
  return o && n && As(t, r, n), n;
@@ -1852,10 +1852,10 @@ let Gt = class {
1852
1852
  return w(this.node?.raw || this.node?.markup || this.node?.content || this.node?.name);
1853
1853
  }
1854
1854
  };
1855
- Eo([
1855
+ Ro([
1856
1856
  c({ required: !0 })
1857
1857
  ], Gt.prototype, "node", 2);
1858
- Gt = Eo([
1858
+ Gt = Ro([
1859
1859
  b({
1860
1860
  selector: "markstream-angular-emoji-node",
1861
1861
  standalone: !0,
@@ -1921,10 +1921,10 @@ let Xe = class {
1921
1921
  return w(this.node?.tag || this.node?.type);
1922
1922
  }
1923
1923
  get customClassName() {
1924
- return `markstream-nested-custom--${xo(this.customTag) || "node"}`;
1924
+ return `markstream-nested-custom--${bo(this.customTag) || "node"}`;
1925
1925
  }
1926
1926
  get rawBodyHtml() {
1927
- return sn(w(this.node?.raw));
1927
+ return an(w(this.node?.raw));
1928
1928
  }
1929
1929
  get nestedPrefix() {
1930
1930
  return `${this.indexKey || "fallback"}-children`;
@@ -1972,7 +1972,7 @@ Xe = ur([
1972
1972
  changeDetection: k.OnPush
1973
1973
  })
1974
1974
  ], Xe);
1975
- var zs = Object.defineProperty, js = Object.getOwnPropertyDescriptor, Do = (e, t, r, o) => {
1975
+ var zs = Object.defineProperty, js = Object.getOwnPropertyDescriptor, Io = (e, t, r, o) => {
1976
1976
  for (var n = o > 1 ? void 0 : o ? js(t, r) : t, i = e.length - 1, s; i >= 0; i--)
1977
1977
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
1978
1978
  return o && n && zs(t, r, n), n;
@@ -1988,10 +1988,10 @@ let Zt = class {
1988
1988
  return `Back to reference ${this.id}`;
1989
1989
  }
1990
1990
  };
1991
- Do([
1991
+ Io([
1992
1992
  c({ required: !0 })
1993
1993
  ], Zt.prototype, "node", 2);
1994
- Zt = Do([
1994
+ Zt = Io([
1995
1995
  b({
1996
1996
  selector: "markstream-angular-footnote-anchor-node",
1997
1997
  standalone: !0,
@@ -2049,7 +2049,7 @@ Ge = hr([
2049
2049
  changeDetection: k.OnPush
2050
2050
  })
2051
2051
  ], Ge);
2052
- var qs = Object.defineProperty, Us = Object.getOwnPropertyDescriptor, Ro = (e, t, r, o) => {
2052
+ var qs = Object.defineProperty, Us = Object.getOwnPropertyDescriptor, No = (e, t, r, o) => {
2053
2053
  for (var n = o > 1 ? void 0 : o ? Us(t, r) : t, i = e.length - 1, s; i >= 0; i--)
2054
2054
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
2055
2055
  return o && n && qs(t, r, n), n;
@@ -2062,10 +2062,10 @@ let Yt = class {
2062
2062
  return `#fnref--${this.id}`;
2063
2063
  }
2064
2064
  };
2065
- Ro([
2065
+ No([
2066
2066
  c({ required: !0 })
2067
2067
  ], Yt.prototype, "node", 2);
2068
- Yt = Ro([
2068
+ Yt = No([
2069
2069
  b({
2070
2070
  selector: "markstream-angular-footnote-reference-node",
2071
2071
  standalone: !0,
@@ -2082,31 +2082,31 @@ var Xs = Object.getOwnPropertyDescriptor, Gs = (e, t, r, o) => {
2082
2082
  (s = e[i]) && (n = s(n) || n);
2083
2083
  return n;
2084
2084
  };
2085
- let Vr = class {
2085
+ let qr = class {
2086
2086
  };
2087
- Vr = Gs([
2087
+ qr = Gs([
2088
2088
  b({
2089
2089
  selector: "markstream-angular-hardbreak-node",
2090
2090
  standalone: !0,
2091
2091
  template: "<br>",
2092
2092
  changeDetection: k.OnPush
2093
2093
  })
2094
- ], Vr);
2095
- var Zs = Object.defineProperty, Ys = Object.getOwnPropertyDescriptor, Io = (e, t, r, o) => {
2094
+ ], qr);
2095
+ var Zs = Object.defineProperty, Ys = Object.getOwnPropertyDescriptor, $o = (e, t, r, o) => {
2096
2096
  for (var n = o > 1 ? void 0 : o ? Ys(t, r) : t, i = e.length - 1, s; i >= 0; i--)
2097
2097
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
2098
2098
  return o && n && Zs(t, r, n), n;
2099
2099
  };
2100
2100
  let xt = class {
2101
2101
  constructor() {
2102
- this.elementRef = X(uo), this.renderer = X(bi), this.appliedAttrs = /* @__PURE__ */ new Set(), this.appliedClasses = /* @__PURE__ */ new Set(), this.appliedStyles = /* @__PURE__ */ new Set();
2102
+ this.elementRef = X(ho), this.renderer = X(ki), this.appliedAttrs = /* @__PURE__ */ new Set(), this.appliedClasses = /* @__PURE__ */ new Set(), this.appliedStyles = /* @__PURE__ */ new Set();
2103
2103
  }
2104
2104
  ngOnChanges() {
2105
2105
  this.clearAppliedState();
2106
2106
  const e = this.markstreamSafeAttrs;
2107
2107
  if (e) {
2108
2108
  for (const [t, r] of Object.entries(e))
2109
- if (on(t)) {
2109
+ if (sn(t)) {
2110
2110
  if (t === "class" || t === "className") {
2111
2111
  for (const o of String(r || "").split(/\s+/g).map((n) => n.trim()).filter(Boolean))
2112
2112
  this.renderer.addClass(this.elementRef.nativeElement, o), this.appliedClasses.add(o);
@@ -2135,11 +2135,11 @@ let xt = class {
2135
2135
  this.appliedAttrs.clear(), this.appliedClasses.clear(), this.appliedStyles.clear();
2136
2136
  }
2137
2137
  };
2138
- Io([
2138
+ $o([
2139
2139
  c()
2140
2140
  ], xt.prototype, "markstreamSafeAttrs", 2);
2141
- xt = Io([
2142
- ki({
2141
+ xt = $o([
2142
+ Ci({
2143
2143
  selector: "[markstreamSafeAttrs]",
2144
2144
  standalone: !0
2145
2145
  })
@@ -2151,7 +2151,7 @@ var Js = Object.defineProperty, Qs = Object.getOwnPropertyDescriptor, mr = (e, t
2151
2151
  };
2152
2152
  let Ze = class {
2153
2153
  get level() {
2154
- return Ui(this.node?.level);
2154
+ return Xi(this.node?.level);
2155
2155
  }
2156
2156
  get attrs() {
2157
2157
  const e = this.node?.attrs;
@@ -2240,11 +2240,11 @@ Ye = fr([
2240
2240
  changeDetection: k.OnPush
2241
2241
  })
2242
2242
  ], Ye);
2243
- function Ln(e) {
2243
+ function Hn(e) {
2244
2244
  const t = {};
2245
2245
  for (const [r, o] of Object.entries(e)) {
2246
2246
  const n = r.trim(), i = n.toLowerCase();
2247
- !n || !on(n) || fo.has(i) || po.has(i) && o && go(o) || (t[n] = o);
2247
+ !n || !sn(n) || po.has(i) || go.has(i) && o && yo(o) || (t[n] = o);
2248
2248
  }
2249
2249
  return t;
2250
2250
  }
@@ -2308,7 +2308,7 @@ function ra(e) {
2308
2308
  }
2309
2309
  }
2310
2310
  t.push({
2311
- type: a || mo.has(d.toLowerCase()) ? "self_closing" : "tag_open",
2311
+ type: a || fo.has(d.toLowerCase()) ? "self_closing" : "tag_open",
2312
2312
  tagName: d,
2313
2313
  attrs: h
2314
2314
  }), r = n + 1;
@@ -2318,35 +2318,35 @@ function ra(e) {
2318
2318
  function na(e) {
2319
2319
  return String(e ?? "").trim().toLowerCase();
2320
2320
  }
2321
- function Hn(e) {
2321
+ function Bn(e) {
2322
2322
  const t = Object.entries(e);
2323
- return t.length === 0 ? "" : t.map(([r, o]) => o === "" ? ` ${r}` : ` ${r}="${qi(o)}"`).join("");
2323
+ return t.length === 0 ? "" : t.map(([r, o]) => o === "" ? ` ${r}` : ` ${r}="${Ui(o)}"`).join("");
2324
2324
  }
2325
- function fn(e) {
2325
+ function pn(e) {
2326
2326
  if (!e)
2327
2327
  return "";
2328
2328
  const t = ra(e), r = [], o = [];
2329
2329
  let n = 0;
2330
2330
  for (const i of t) {
2331
2331
  if (i.type === "text") {
2332
- n === 0 && o.push(sn(i.content ?? ""));
2332
+ n === 0 && o.push(an(i.content ?? ""));
2333
2333
  continue;
2334
2334
  }
2335
2335
  const s = na(i.tagName);
2336
2336
  if (!s)
2337
2337
  continue;
2338
- if (Ci.has(s)) {
2338
+ if (Ti.has(s)) {
2339
2339
  i.type === "tag_open" ? n += 1 : i.type === "tag_close" && n > 0 && (n -= 1);
2340
2340
  continue;
2341
2341
  }
2342
2342
  if (n > 0)
2343
2343
  continue;
2344
2344
  if (i.type === "self_closing") {
2345
- o.push(`<${s}${Hn(Ln(i.attrs ?? {}))}>`);
2345
+ o.push(`<${s}${Bn(Hn(i.attrs ?? {}))}>`);
2346
2346
  continue;
2347
2347
  }
2348
2348
  if (i.type === "tag_open") {
2349
- o.push(`<${s}${Hn(Ln(i.attrs ?? {}))}>`), mo.has(s) || r.push(s);
2349
+ o.push(`<${s}${Bn(Hn(i.attrs ?? {}))}>`), fo.has(s) || r.push(s);
2350
2350
  continue;
2351
2351
  }
2352
2352
  const a = r.lastIndexOf(s);
@@ -2365,7 +2365,7 @@ function fn(e) {
2365
2365
  }
2366
2366
  return o.join("");
2367
2367
  }
2368
- const oa = "markstream-angular-html", ia = "div", Bn = /* @__PURE__ */ new Map(), sa = /* @__PURE__ */ new Set([
2368
+ const oa = "markstream-angular-html", ia = "div", Fn = /* @__PURE__ */ new Map(), sa = /* @__PURE__ */ new Set([
2369
2369
  "admonition",
2370
2370
  "blockquote",
2371
2371
  "checkbox",
@@ -2402,7 +2402,7 @@ const oa = "markstream-angular-html", ia = "div", Bn = /* @__PURE__ */ new Map()
2402
2402
  "text",
2403
2403
  "thematic_break"
2404
2404
  ]);
2405
- function vd(e) {
2405
+ function wd(e) {
2406
2406
  const t = dt([
2407
2407
  ...e.customHtmlTags || [],
2408
2408
  ...e.parseOptions?.customHtmlTags || []
@@ -2412,17 +2412,17 @@ function vd(e) {
2412
2412
  }), o = la(e, r);
2413
2413
  return R(o, r);
2414
2414
  }
2415
- function wd(e, t = {}) {
2415
+ function xd(e, t = {}) {
2416
2416
  const r = pr(t);
2417
2417
  return ca(e, r);
2418
2418
  }
2419
- function xd(e, t = {}) {
2419
+ function bd(e, t = {}) {
2420
2420
  const r = pr(t);
2421
2421
  return R(e, r);
2422
2422
  }
2423
2423
  function aa(e, t = {}) {
2424
2424
  const r = pr(t);
2425
- return $o(e, r);
2425
+ return Ao(e, r);
2426
2426
  }
2427
2427
  function la(e, t) {
2428
2428
  if (Array.isArray(e.nodes))
@@ -2436,18 +2436,18 @@ function la(e, t) {
2436
2436
  ]), n = {
2437
2437
  ...e.parseOptions ?? {}
2438
2438
  };
2439
- return typeof e.final == "boolean" && (n.final = e.final), o.length > 0 && (n.customHtmlTags = o), rn(
2440
- en(r, t.markdown, n),
2439
+ return typeof e.final == "boolean" && (n.final = e.final), o.length > 0 && (n.customHtmlTags = o), nn(
2440
+ tn(r, t.markdown, n),
2441
2441
  r,
2442
2442
  o
2443
2443
  );
2444
2444
  }
2445
2445
  function pr(e) {
2446
2446
  const t = dt(e.customHtmlTags), r = `${e.cacheKey || oa}::${t.join(",")}`;
2447
- let o = Bn.get(r);
2448
- return o || (o = tn(r, {
2447
+ let o = Fn.get(r);
2448
+ return o || (o = rn(r, {
2449
2449
  customHtmlTags: t
2450
- }), Bn.set(r, o)), {
2450
+ }), Fn.set(r, o)), {
2451
2451
  markdown: o,
2452
2452
  options: {
2453
2453
  allowHtml: e.allowHtml !== !1,
@@ -2466,16 +2466,16 @@ function ca(e, t) {
2466
2466
  return R(o, t);
2467
2467
  const n = T(r.content);
2468
2468
  if (n)
2469
- return qr(n, t);
2469
+ return Ur(n, t);
2470
2470
  if (r.raw != null)
2471
2471
  return A(T(r.raw));
2472
2472
  }
2473
- return e.content ? qr(T(e.content), t) : "";
2473
+ return e.content ? Ur(T(e.content), t) : "";
2474
2474
  }
2475
2475
  function R(e, t) {
2476
- return (Array.isArray(e) ? e : []).map((r) => $o(r, t)).join("");
2476
+ return (Array.isArray(e) ? e : []).map((r) => Ao(r, t)).join("");
2477
2477
  }
2478
- function $o(e, t) {
2478
+ function Ao(e, t) {
2479
2479
  if (!e || typeof e != "object")
2480
2480
  return "";
2481
2481
  switch (e.type) {
@@ -2520,13 +2520,13 @@ function $o(e, t) {
2520
2520
  case "table":
2521
2521
  return va(e, t);
2522
2522
  case "table_row":
2523
- return No(e, t);
2523
+ return Lo(e, t);
2524
2524
  case "table_cell":
2525
- return Ao(e, t);
2525
+ return Ho(e, t);
2526
2526
  case "definition_list":
2527
2527
  return wa(e, t);
2528
2528
  case "definition_item":
2529
- return Lo(e, t);
2529
+ return Bo(e, t);
2530
2530
  case "footnote":
2531
2531
  return xa(e, t);
2532
2532
  case "footnote_reference":
@@ -2579,30 +2579,30 @@ function ga(e, t) {
2579
2579
  return `<h${r}>${R(I(e.children), t)}</h${r}>`;
2580
2580
  }
2581
2581
  function ya(e) {
2582
- const t = T(e.language).trim(), r = pn(t), o = r ? ` class="language-${r}"` : "", n = !!e.diff;
2582
+ const t = T(e.language).trim(), r = gn(t), o = r ? ` class="language-${r}"` : "", n = !!e.diff;
2583
2583
  return `<pre ${[
2584
2584
  'data-markstream-code-block="1"',
2585
2585
  t ? `data-markstream-language="${H(t)}"` : "",
2586
2586
  n ? 'data-markstream-diff="1"' : "",
2587
- n ? `data-markstream-original="${H(Fn(T(e.originalCode)))}"` : "",
2588
- n ? `data-markstream-updated="${H(Fn(T(e.updatedCode)))}"` : ""
2587
+ n ? `data-markstream-original="${H(Kn(T(e.originalCode)))}"` : "",
2588
+ n ? `data-markstream-updated="${H(Kn(T(e.updatedCode)))}"` : ""
2589
2589
  ].filter(Boolean).join(" ")}><code${o}>${A(T(e.code))}</code></pre>`;
2590
2590
  }
2591
2591
  function va(e, t) {
2592
- const r = e.header ? No(e.header, t, !0) : "", o = R(I(e.rows), t), n = r ? `<thead>${r}</thead>` : "", i = o ? `<tbody>${o}</tbody>` : "";
2592
+ const r = e.header ? Lo(e.header, t, !0) : "", o = R(I(e.rows), t), n = r ? `<thead>${r}</thead>` : "", i = o ? `<tbody>${o}</tbody>` : "";
2593
2593
  return `<table>${n}${i}</table>`;
2594
2594
  }
2595
- function No(e, t, r = !1) {
2596
- return `<tr>${I(e.cells).map((n) => Ao(n, t, r)).join("")}</tr>`;
2595
+ function Lo(e, t, r = !1) {
2596
+ return `<tr>${I(e.cells).map((n) => Ho(n, t, r)).join("")}</tr>`;
2597
2597
  }
2598
- function Ao(e, t, r = !1) {
2598
+ function Ho(e, t, r = !1) {
2599
2599
  const o = r || e.header ? "th" : "td", n = T(e.align), i = n ? ` style="text-align:${H(n)}"` : "";
2600
2600
  return `<${o}${i}>${R(I(e.children), t)}</${o}>`;
2601
2601
  }
2602
2602
  function wa(e, t) {
2603
- return `<dl>${I(e.items).map((r) => Lo(r, t)).join("")}</dl>`;
2603
+ return `<dl>${I(e.items).map((r) => Bo(r, t)).join("")}</dl>`;
2604
2604
  }
2605
- function Lo(e, t) {
2605
+ function Bo(e, t) {
2606
2606
  const r = R(I(e.term), t), o = R(I(e.definition), t);
2607
2607
  return `<dt>${r}</dt><dd>${o}</dd>`;
2608
2608
  }
@@ -2614,18 +2614,18 @@ function ba(e) {
2614
2614
  return `<sup class="markstream-nested-footnote-ref"><a href="#fnref--${H(T(e.id))}">[${t}]</a></sup>`;
2615
2615
  }
2616
2616
  function ka(e, t) {
2617
- const r = pn(T(e.kind || "note")) || "note", o = T(e.title) || Ea(r);
2617
+ const r = gn(T(e.kind || "note")) || "note", o = T(e.title) || Ea(r);
2618
2618
  return `<div class="markstream-nested-admonition markstream-nested-admonition--${r}"><div class="markstream-nested-admonition__title">${A(o)}</div><div class="markstream-nested-admonition__content">${R(I(e.children), t)}</div></div>`;
2619
2619
  }
2620
2620
  function Ca(e, t) {
2621
2621
  const o = T(e.content) || T(e.raw), n = T(e.tag).trim().toLowerCase(), i = I(e.children);
2622
2622
  if (!t.options.allowHtml || e.loading && !e.autoClosed)
2623
2623
  return A(o);
2624
- if (n && i.length > 0 && !yo.has(n)) {
2625
- const s = Bo(e.attrs);
2624
+ if (n && i.length > 0 && !vo.has(n)) {
2625
+ const s = Ko(e.attrs);
2626
2626
  return `<${n}${s}>${R(i, t)}</${n}>`;
2627
2627
  }
2628
- return fn(o);
2628
+ return pn(o);
2629
2629
  }
2630
2630
  function Ta(e, t) {
2631
2631
  const r = T(e.tag || e.type);
@@ -2633,9 +2633,9 @@ function Ta(e, t) {
2633
2633
  return A(T(e.content || e.raw));
2634
2634
  const o = [
2635
2635
  "markstream-nested-custom",
2636
- `markstream-nested-custom--${pn(r) || "node"}`,
2636
+ `markstream-nested-custom--${gn(r) || "node"}`,
2637
2637
  Sa(e, t.options.customNodeClass)
2638
- ].filter(Boolean).join(" "), n = Bo(e.attrs, o), i = Pa(e, t), s = t.options.customNodeTag;
2638
+ ].filter(Boolean).join(" "), n = Ko(e.attrs, o), i = Pa(e, t), s = t.options.customNodeTag;
2639
2639
  return `<${s}${n} data-markstream-custom-tag="${H(r)}">${i}</${s}>`;
2640
2640
  }
2641
2641
  function Pa(e, t) {
@@ -2643,25 +2643,25 @@ function Pa(e, t) {
2643
2643
  if (r.length > 0)
2644
2644
  return R(r, t);
2645
2645
  const o = T(e.content);
2646
- return o ? qr(o, t) : A(T(e.raw));
2646
+ return o ? Ur(o, t) : A(T(e.raw));
2647
2647
  }
2648
- function qr(e, t) {
2648
+ function Ur(e, t) {
2649
2649
  return e ? t.markdown.render(e) : "";
2650
2650
  }
2651
2651
  function Sa(e, t) {
2652
2652
  if (!t)
2653
2653
  return "";
2654
2654
  const r = typeof t == "function" ? t(e) : t;
2655
- return Ho(r);
2655
+ return Fo(r);
2656
2656
  }
2657
- function Ho(e) {
2658
- return Array.isArray(e) ? e.map((t) => Ho(t)).filter(Boolean).join(" ") : typeof e == "string" ? e.trim() : "";
2657
+ function Fo(e) {
2658
+ return Array.isArray(e) ? e.map((t) => Fo(t)).filter(Boolean).join(" ") : typeof e == "string" ? e.trim() : "";
2659
2659
  }
2660
- function Bo(e, t = "") {
2660
+ function Ko(e, t = "") {
2661
2661
  const r = _a(e), o = [], n = [t];
2662
2662
  for (const [s, a] of r) {
2663
2663
  const l = String(s).trim(), d = l.toLowerCase();
2664
- if (!(!l || !Ma(l)) && !fo.has(d) && !(a !== !0 && po.has(d) && a && go(String(a)))) {
2664
+ if (!(!l || !Ma(l)) && !po.has(d) && !(a !== !0 && go.has(d) && a && yo(String(a)))) {
2665
2665
  if (d === "class") {
2666
2666
  n.push(String(a));
2667
2667
  continue;
@@ -2692,7 +2692,7 @@ function T(e) {
2692
2692
  function Ma(e) {
2693
2693
  return /^[^\s"'<>`=]+$/.test(e) && !/^on/i.test(e);
2694
2694
  }
2695
- function pn(e) {
2695
+ function gn(e) {
2696
2696
  return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
2697
2697
  }
2698
2698
  function Oa(e) {
@@ -2708,7 +2708,7 @@ function H(e) {
2708
2708
  function Ea(e) {
2709
2709
  return `${e[0].toUpperCase()}${e.slice(1)}`;
2710
2710
  }
2711
- function Fn(e) {
2711
+ function Kn(e) {
2712
2712
  if (!e)
2713
2713
  return "";
2714
2714
  const t = globalThis?.require?.("buffer")?.Buffer;
@@ -2752,14 +2752,14 @@ let Je = class {
2752
2752
  e.textContent = t;
2753
2753
  return;
2754
2754
  }
2755
- if (r && o.length > 0 && !yo.has(r)) {
2755
+ if (r && o.length > 0 && !vo.has(r)) {
2756
2756
  e.innerHTML = aa(this.node, {
2757
2757
  allowHtml: this.context?.allowHtml,
2758
2758
  customHtmlTags: this.context?.customHtmlTags
2759
2759
  });
2760
2760
  return;
2761
2761
  }
2762
- e.innerHTML = fn(t);
2762
+ e.innerHTML = pn(t);
2763
2763
  }
2764
2764
  };
2765
2765
  gr([
@@ -2779,8 +2779,8 @@ Je = gr([
2779
2779
  changeDetection: k.OnPush
2780
2780
  })
2781
2781
  ], Je);
2782
- var Ia = Object.defineProperty, $a = Object.getOwnPropertyDescriptor, yr = (e, t, r, o) => {
2783
- for (var n = o > 1 ? void 0 : o ? $a(t, r) : t, i = e.length - 1, s; i >= 0; i--)
2782
+ var Ia = Object.defineProperty, Na = Object.getOwnPropertyDescriptor, yr = (e, t, r, o) => {
2783
+ for (var n = o > 1 ? void 0 : o ? Na(t, r) : t, i = e.length - 1, s; i >= 0; i--)
2784
2784
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
2785
2785
  return o && n && Ia(t, r, n), n;
2786
2786
  };
@@ -2808,7 +2808,7 @@ let Qe = class {
2808
2808
  e.textContent = t;
2809
2809
  return;
2810
2810
  }
2811
- e.innerHTML = fn(t);
2811
+ e.innerHTML = pn(t);
2812
2812
  }
2813
2813
  };
2814
2814
  yr([
@@ -2828,10 +2828,10 @@ Qe = yr([
2828
2828
  changeDetection: k.OnPush
2829
2829
  })
2830
2830
  ], Qe);
2831
- var Na = Object.defineProperty, Aa = Object.getOwnPropertyDescriptor, Fo = (e, t, r, o) => {
2831
+ var $a = Object.defineProperty, Aa = Object.getOwnPropertyDescriptor, zo = (e, t, r, o) => {
2832
2832
  for (var n = o > 1 ? void 0 : o ? Aa(t, r) : t, i = e.length - 1, s; i >= 0; i--)
2833
2833
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
2834
- return o && n && Na(t, r, n), n;
2834
+ return o && n && $a(t, r, n), n;
2835
2835
  };
2836
2836
  let Jt = class {
2837
2837
  get src() {
@@ -2844,10 +2844,10 @@ let Jt = class {
2844
2844
  return w(this.node?.title);
2845
2845
  }
2846
2846
  };
2847
- Fo([
2847
+ zo([
2848
2848
  c({ required: !0 })
2849
2849
  ], Jt.prototype, "node", 2);
2850
- Jt = Fo([
2850
+ Jt = zo([
2851
2851
  b({
2852
2852
  selector: "markstream-angular-image-node",
2853
2853
  standalone: !0,
@@ -2864,15 +2864,15 @@ Jt = Fo([
2864
2864
  changeDetection: k.OnPush
2865
2865
  })
2866
2866
  ], Jt);
2867
- let Bt = null, Br = null;
2868
- async function Ko() {
2869
- return Br || (Bt ? await Bt : (Bt = import("@antv/infographic").then((e) => {
2867
+ let Bt = null, Fr = null;
2868
+ async function jo() {
2869
+ return Fr || (Bt ? await Bt : (Bt = import("@antv/infographic").then((e) => {
2870
2870
  const t = e && e.default ? e.default : e;
2871
2871
  let r = t;
2872
- return typeof t == "function" && t.prototype && t.prototype.render ? r = t : e?.Infographic ? r = e.Infographic : t && t.Infographic && (r = t.Infographic), Br = r, r;
2872
+ return typeof t == "function" && t.prototype && t.prototype.render ? r = t : e?.Infographic ? r = e.Infographic : t && t.Infographic && (r = t.Infographic), Fr = r, r;
2873
2873
  }).catch((e) => (console.warn("[markstream-angular] Failed to load @antv/infographic", e), null)), await Bt));
2874
2874
  }
2875
- var La = Object.defineProperty, Ha = Object.getOwnPropertyDescriptor, $e = (e, t, r, o) => {
2875
+ var La = Object.defineProperty, Ha = Object.getOwnPropertyDescriptor, Ne = (e, t, r, o) => {
2876
2876
  for (var n = o > 1 ? void 0 : o ? Ha(t, r) : t, i = e.length - 1, s; i >= 0; i--)
2877
2877
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
2878
2878
  return o && n && La(t, r, n), n;
@@ -2918,7 +2918,7 @@ let re = class {
2918
2918
  return typeof this.mergedProps.showTooltips == "boolean" ? this.mergedProps.showTooltips : this.context?.showTooltips !== !1;
2919
2919
  }
2920
2920
  get resolvedMaxHeight() {
2921
- return mn(this.mergedProps.maxHeight, "500px");
2921
+ return fn(this.mergedProps.maxHeight, "500px");
2922
2922
  }
2923
2923
  resolveContainerMinHeight(e) {
2924
2924
  const t = Math.max(e, 280), r = this.mergedProps.maxHeight;
@@ -2959,12 +2959,12 @@ let re = class {
2959
2959
  this.showSource = e, e || this.schedulePreviewSync(), this.cdr.markForCheck();
2960
2960
  }
2961
2961
  async copySource() {
2962
- await un(this.code), this.copied = !0, this.context?.events.onCopy?.(this.code), this.copyTimer != null && typeof window < "u" && window.clearTimeout(this.copyTimer), typeof window < "u" && (this.copyTimer = window.setTimeout(() => {
2962
+ await hn(this.code), this.copied = !0, this.context?.events.onCopy?.(this.code), this.copyTimer != null && typeof window < "u" && window.clearTimeout(this.copyTimer), typeof window < "u" && (this.copyTimer = window.setTimeout(() => {
2963
2963
  this.copied = !1, this.cdr.markForCheck();
2964
2964
  }, 1e3)), this.cdr.markForCheck();
2965
2965
  }
2966
2966
  exportSvg() {
2967
- this.svgMarkup && hn(this.svgMarkup, `infographic-${Date.now()}.svg`);
2967
+ this.svgMarkup && mn(this.svgMarkup, `infographic-${Date.now()}.svg`);
2968
2968
  }
2969
2969
  openModal() {
2970
2970
  this.svgMarkup && (this.modalOpen = !0, typeof document < "u" && (document.body.style.overflow = "hidden"), queueMicrotask(() => this.syncModalPreview()), this.cdr.markForCheck());
@@ -3001,7 +3001,7 @@ let re = class {
3001
3001
  const r = ++this.renderToken;
3002
3002
  this.rendering = !0, this.error = "", this.cdr.markForCheck();
3003
3003
  try {
3004
- const o = await Ko();
3004
+ const o = await jo();
3005
3005
  if (!o)
3006
3006
  throw new Error("Infographic renderer is not available.");
3007
3007
  if (this.destroyed || r !== this.renderToken)
@@ -3052,25 +3052,25 @@ let re = class {
3052
3052
  });
3053
3053
  }
3054
3054
  };
3055
- $e([
3055
+ Ne([
3056
3056
  B("previewHost")
3057
3057
  ], re.prototype, "previewHost", 2);
3058
- $e([
3058
+ Ne([
3059
3059
  B("modalHost")
3060
3060
  ], re.prototype, "modalHost", 2);
3061
- $e([
3061
+ Ne([
3062
3062
  c({ required: !0 })
3063
3063
  ], re.prototype, "node", 2);
3064
- $e([
3064
+ Ne([
3065
3065
  c()
3066
3066
  ], re.prototype, "context", 2);
3067
- $e([
3067
+ Ne([
3068
3068
  c()
3069
3069
  ], re.prototype, "props", 2);
3070
- $e([
3071
- ho("window:keydown", ["$event"])
3070
+ Ne([
3071
+ mo("window:keydown", ["$event"])
3072
3072
  ], re.prototype, "handleWindowKeydown", 1);
3073
- re = $e([
3073
+ re = Ne([
3074
3074
  b({
3075
3075
  selector: "markstream-angular-infographic-block-node",
3076
3076
  standalone: !0,
@@ -3204,7 +3204,7 @@ re = $e([
3204
3204
  changeDetection: k.OnPush
3205
3205
  })
3206
3206
  ], re);
3207
- function zo({
3207
+ function Wo({
3208
3208
  nextContent: e,
3209
3209
  previousContent: t,
3210
3210
  typewriterEnabled: r
@@ -3237,7 +3237,7 @@ let _e = class {
3237
3237
  this.settledCode = "", this.streamedDelta = "", this.streamFadeVersion = 0;
3238
3238
  }
3239
3239
  ngOnChanges() {
3240
- const e = w(this.node?.code), t = w(this.indexKey).trim(), r = this.context?.textStreamState, o = `${this.settledCode}${this.streamedDelta}`, i = (t ? r?.get(t) : void 0) ?? o, s = zo({
3240
+ const e = w(this.node?.code), t = w(this.indexKey).trim(), r = this.context?.textStreamState, o = `${this.settledCode}${this.streamedDelta}`, i = (t ? r?.get(t) : void 0) ?? o, s = Wo({
3241
3241
  nextContent: e,
3242
3242
  previousContent: i,
3243
3243
  typewriterEnabled: this.typewriterEnabled
@@ -3332,7 +3332,7 @@ const Qt = Math.min, Ce = Math.max, er = Math.round, Ft = Math.floor, Q = (e) =>
3332
3332
  bottom: "top",
3333
3333
  top: "bottom"
3334
3334
  };
3335
- function Kn(e, t, r) {
3335
+ function zn(e, t, r) {
3336
3336
  return Ce(e, Qt(t, r));
3337
3337
  }
3338
3338
  function wr(e, t) {
@@ -3344,38 +3344,38 @@ function Me(e) {
3344
3344
  function xr(e) {
3345
3345
  return e.split("-")[1];
3346
3346
  }
3347
- function jo(e) {
3347
+ function Vo(e) {
3348
3348
  return e === "x" ? "y" : "x";
3349
3349
  }
3350
- function Wo(e) {
3350
+ function qo(e) {
3351
3351
  return e === "y" ? "height" : "width";
3352
3352
  }
3353
3353
  function se(e) {
3354
3354
  const t = e[0];
3355
3355
  return t === "t" || t === "b" ? "y" : "x";
3356
3356
  }
3357
- function Vo(e) {
3358
- return jo(se(e));
3357
+ function Uo(e) {
3358
+ return Vo(se(e));
3359
3359
  }
3360
3360
  function Wa(e, t, r) {
3361
3361
  r === void 0 && (r = !1);
3362
- const o = xr(e), n = Vo(e), i = Wo(n);
3362
+ const o = xr(e), n = Uo(e), i = qo(n);
3363
3363
  let s = n === "x" ? o === (r ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
3364
3364
  return t.reference[i] > t.floating[i] && (s = tr(s)), [s, tr(s)];
3365
3365
  }
3366
3366
  function Va(e) {
3367
3367
  const t = tr(e);
3368
- return [Ur(e), t, Ur(t)];
3368
+ return [Xr(e), t, Xr(t)];
3369
3369
  }
3370
- function Ur(e) {
3370
+ function Xr(e) {
3371
3371
  return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
3372
3372
  }
3373
- const zn = ["left", "right"], jn = ["right", "left"], qa = ["top", "bottom"], Ua = ["bottom", "top"];
3373
+ const jn = ["left", "right"], Wn = ["right", "left"], qa = ["top", "bottom"], Ua = ["bottom", "top"];
3374
3374
  function Xa(e, t, r) {
3375
3375
  switch (e) {
3376
3376
  case "top":
3377
3377
  case "bottom":
3378
- return r ? t ? jn : zn : t ? zn : jn;
3378
+ return r ? t ? Wn : jn : t ? jn : Wn;
3379
3379
  case "left":
3380
3380
  case "right":
3381
3381
  return t ? qa : Ua;
@@ -3386,7 +3386,7 @@ function Xa(e, t, r) {
3386
3386
  function Ga(e, t, r, o) {
3387
3387
  const n = xr(e);
3388
3388
  let i = Xa(Me(e), r === "start", o);
3389
- return n && (i = i.map((s) => s + "-" + n), t && (i = i.concat(i.map(Ur)))), i;
3389
+ return n && (i = i.map((s) => s + "-" + n), t && (i = i.concat(i.map(Xr)))), i;
3390
3390
  }
3391
3391
  function tr(e) {
3392
3392
  const t = Me(e);
@@ -3427,12 +3427,12 @@ function rr(e) {
3427
3427
  y: r
3428
3428
  };
3429
3429
  }
3430
- function Wn(e, t, r) {
3430
+ function Vn(e, t, r) {
3431
3431
  let {
3432
3432
  reference: o,
3433
3433
  floating: n
3434
3434
  } = e;
3435
- const i = se(t), s = Vo(t), a = Wo(s), l = Me(t), d = i === "y", u = o.x + o.width / 2 - n.width / 2, h = o.y + o.height / 2 - n.height / 2, f = o[a] / 2 - n[a] / 2;
3435
+ const i = se(t), s = Uo(t), a = qo(s), l = Me(t), d = i === "y", u = o.x + o.width / 2 - n.width / 2, h = o.y + o.height / 2 - n.height / 2, f = o[a] / 2 - n[a] / 2;
3436
3436
  let m;
3437
3437
  switch (l) {
3438
3438
  case "top":
@@ -3501,7 +3501,7 @@ async function Ja(e, t) {
3501
3501
  y: n,
3502
3502
  width: s.floating.width,
3503
3503
  height: s.floating.height
3504
- } : s.reference, D = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(a.floating)), $ = await (i.isElement == null ? void 0 : i.isElement(D)) ? await (i.getScale == null ? void 0 : i.getScale(D)) || {
3504
+ } : s.reference, D = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(a.floating)), N = await (i.isElement == null ? void 0 : i.isElement(D)) ? await (i.getScale == null ? void 0 : i.getScale(D)) || {
3505
3505
  x: 1,
3506
3506
  y: 1
3507
3507
  } : {
@@ -3514,10 +3514,10 @@ async function Ja(e, t) {
3514
3514
  strategy: l
3515
3515
  }) : M);
3516
3516
  return {
3517
- top: (v.top - j.top + g.top) / $.y,
3518
- bottom: (j.bottom - v.bottom + g.bottom) / $.y,
3519
- left: (v.left - j.left + g.left) / $.x,
3520
- right: (j.right - v.right + g.right) / $.x
3517
+ top: (v.top - j.top + g.top) / N.y,
3518
+ bottom: (j.bottom - v.bottom + g.bottom) / N.y,
3519
+ left: (v.left - j.left + g.left) / N.x,
3520
+ right: (j.right - v.right + g.right) / N.x
3521
3521
  };
3522
3522
  }
3523
3523
  const Qa = 50, el = async (e, t, r) => {
@@ -3537,7 +3537,7 @@ const Qa = 50, el = async (e, t, r) => {
3537
3537
  }), {
3538
3538
  x: u,
3539
3539
  y: h
3540
- } = Wn(d, o, l), f = o, m = 0;
3540
+ } = Vn(d, o, l), f = o, m = 0;
3541
3541
  const g = {};
3542
3542
  for (let y = 0; y < i.length; y++) {
3543
3543
  const P = i[y];
@@ -3548,7 +3548,7 @@ const Qa = 50, el = async (e, t, r) => {
3548
3548
  fn: M
3549
3549
  } = P, {
3550
3550
  x: D,
3551
- y: $,
3551
+ y: N,
3552
3552
  data: j,
3553
3553
  reset: F
3554
3554
  } = await M({
@@ -3565,7 +3565,7 @@ const Qa = 50, el = async (e, t, r) => {
3565
3565
  floating: t
3566
3566
  }
3567
3567
  });
3568
- u = D ?? u, h = $ ?? h, g[v] = {
3568
+ u = D ?? u, h = N ?? h, g[v] = {
3569
3569
  ...g[v],
3570
3570
  ...j
3571
3571
  }, F && m < Qa && (m++, typeof F == "object" && (F.placement && (f = F.placement), F.rects && (d = F.rects === !0 ? await s.getElementRects({
@@ -3575,7 +3575,7 @@ const Qa = 50, el = async (e, t, r) => {
3575
3575
  }) : F.rects), {
3576
3576
  x: u,
3577
3577
  y: h
3578
- } = Wn(d, f, l)), y = -1);
3578
+ } = Vn(d, f, l)), y = -1);
3579
3579
  }
3580
3580
  return {
3581
3581
  x: u,
@@ -3608,21 +3608,21 @@ const Qa = 50, el = async (e, t, r) => {
3608
3608
  } = wr(e, t);
3609
3609
  if ((r = i.arrow) != null && r.alignmentOffset)
3610
3610
  return {};
3611
- const v = Me(n), M = se(a), D = Me(a) === a, $ = await (l.isRTL == null ? void 0 : l.isRTL(d.floating)), j = f || (D || !y ? [tr(a)] : Va(a)), F = g !== "none";
3612
- !f && F && j.push(...Ga(a, y, g, $));
3613
- const Ae = [a, ...j], Nr = await l.detectOverflow(t, P), Lt = [];
3611
+ const v = Me(n), M = se(a), D = Me(a) === a, N = await (l.isRTL == null ? void 0 : l.isRTL(d.floating)), j = f || (D || !y ? [tr(a)] : Va(a)), F = g !== "none";
3612
+ !f && F && j.push(...Ga(a, y, g, N));
3613
+ const Ae = [a, ...j], Ar = await l.detectOverflow(t, P), Lt = [];
3614
3614
  let Le = ((o = i.flip) == null ? void 0 : o.overflows) || [];
3615
- if (u && Lt.push(Nr[v]), h) {
3616
- const fe = Wa(n, s, $);
3617
- Lt.push(Nr[fe[0]], Nr[fe[1]]);
3615
+ if (u && Lt.push(Ar[v]), h) {
3616
+ const fe = Wa(n, s, N);
3617
+ Lt.push(Ar[fe[0]], Ar[fe[1]]);
3618
3618
  }
3619
3619
  if (Le = [...Le, {
3620
3620
  placement: n,
3621
3621
  overflows: Lt
3622
3622
  }], !Lt.every((fe) => fe <= 0)) {
3623
- var On, En;
3624
- const fe = (((On = i.flip) == null ? void 0 : On.index) || 0) + 1, Ar = Ae[fe];
3625
- if (Ar && (!(h === "alignment" ? M !== se(Ar) : !1) || // We leave the current main axis only if every placement on that axis
3623
+ var En, Dn;
3624
+ const fe = (((En = i.flip) == null ? void 0 : En.index) || 0) + 1, Lr = Ae[fe];
3625
+ if (Lr && (!(h === "alignment" ? M !== se(Lr) : !1) || // We leave the current main axis only if every placement on that axis
3626
3626
  // overflows the main axis.
3627
3627
  Le.every((V) => se(V.placement) === M ? V.overflows[0] > 0 : !0)))
3628
3628
  return {
@@ -3631,15 +3631,15 @@ const Qa = 50, el = async (e, t, r) => {
3631
3631
  overflows: Le
3632
3632
  },
3633
3633
  reset: {
3634
- placement: Ar
3634
+ placement: Lr
3635
3635
  }
3636
3636
  };
3637
- let ht = (En = Le.filter((pe) => pe.overflows[0] <= 0).sort((pe, V) => pe.overflows[1] - V.overflows[1])[0]) == null ? void 0 : En.placement;
3637
+ let ht = (Dn = Le.filter((pe) => pe.overflows[0] <= 0).sort((pe, V) => pe.overflows[1] - V.overflows[1])[0]) == null ? void 0 : Dn.placement;
3638
3638
  if (!ht)
3639
3639
  switch (m) {
3640
3640
  case "bestFit": {
3641
- var Dn;
3642
- const pe = (Dn = Le.filter((V) => {
3641
+ var Rn;
3642
+ const pe = (Rn = Le.filter((V) => {
3643
3643
  if (F) {
3644
3644
  const ie = se(V.placement);
3645
3645
  return ie === M || // Create a bias to the `y` side axis due to horizontal
@@ -3647,7 +3647,7 @@ const Qa = 50, el = async (e, t, r) => {
3647
3647
  ie === "y";
3648
3648
  }
3649
3649
  return !0;
3650
- }).map((V) => [V.placement, V.overflows.filter((ie) => ie > 0).reduce((ie, wi) => ie + wi, 0)]).sort((V, ie) => V[1] - ie[1])[0]) == null ? void 0 : Dn[0];
3650
+ }).map((V) => [V.placement, V.overflows.filter((ie) => ie > 0).reduce((ie, xi) => ie + xi, 0)]).sort((V, ie) => V[1] - ie[1])[0]) == null ? void 0 : Rn[0];
3651
3651
  pe && (ht = pe);
3652
3652
  break;
3653
3653
  }
@@ -3744,15 +3744,15 @@ const ol = function(e) {
3744
3744
  } = wr(e, t), u = {
3745
3745
  x: r,
3746
3746
  y: o
3747
- }, h = await i.detectOverflow(t, d), f = se(Me(n)), m = jo(f);
3747
+ }, h = await i.detectOverflow(t, d), f = se(Me(n)), m = Vo(f);
3748
3748
  let g = u[m], y = u[f];
3749
3749
  if (s) {
3750
- const v = m === "y" ? "top" : "left", M = m === "y" ? "bottom" : "right", D = g + h[v], $ = g - h[M];
3751
- g = Kn(D, g, $);
3750
+ const v = m === "y" ? "top" : "left", M = m === "y" ? "bottom" : "right", D = g + h[v], N = g - h[M];
3751
+ g = zn(D, g, N);
3752
3752
  }
3753
3753
  if (a) {
3754
- const v = f === "y" ? "top" : "left", M = f === "y" ? "bottom" : "right", D = y + h[v], $ = y - h[M];
3755
- y = Kn(D, y, $);
3754
+ const v = f === "y" ? "top" : "left", M = f === "y" ? "bottom" : "right", D = y + h[v], N = y - h[M];
3755
+ y = zn(D, y, N);
3756
3756
  }
3757
3757
  const P = l.fn({
3758
3758
  ...t,
@@ -3777,7 +3777,7 @@ function br() {
3777
3777
  return typeof window < "u";
3778
3778
  }
3779
3779
  function ut(e) {
3780
- return qo(e) ? (e.nodeName || "").toLowerCase() : "#document";
3780
+ return Xo(e) ? (e.nodeName || "").toLowerCase() : "#document";
3781
3781
  }
3782
3782
  function z(e) {
3783
3783
  var t;
@@ -3785,9 +3785,9 @@ function z(e) {
3785
3785
  }
3786
3786
  function ee(e) {
3787
3787
  var t;
3788
- return (t = (qo(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
3788
+ return (t = (Xo(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
3789
3789
  }
3790
- function qo(e) {
3790
+ function Xo(e) {
3791
3791
  return br() ? e instanceof Node || e instanceof z(e).Node : !1;
3792
3792
  }
3793
3793
  function Z(e) {
@@ -3796,7 +3796,7 @@ function Z(e) {
3796
3796
  function oe(e) {
3797
3797
  return br() ? e instanceof HTMLElement || e instanceof z(e).HTMLElement : !1;
3798
3798
  }
3799
- function Vn(e) {
3799
+ function qn(e) {
3800
3800
  return !br() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof z(e).ShadowRoot;
3801
3801
  }
3802
3802
  function Et(e) {
@@ -3824,15 +3824,15 @@ function kr(e) {
3824
3824
  }
3825
3825
  }
3826
3826
  const al = /transform|translate|scale|rotate|perspective|filter/, ll = /paint|layout|strict|content/, ye = (e) => !!e && e !== "none";
3827
- let Fr;
3828
- function gn(e) {
3827
+ let Kr;
3828
+ function yn(e) {
3829
3829
  const t = Z(e) ? Y(e) : e;
3830
- return ye(t.transform) || ye(t.translate) || ye(t.scale) || ye(t.rotate) || ye(t.perspective) || !yn() && (ye(t.backdropFilter) || ye(t.filter)) || al.test(t.willChange || "") || ll.test(t.contain || "");
3830
+ return ye(t.transform) || ye(t.translate) || ye(t.scale) || ye(t.rotate) || ye(t.perspective) || !vn() && (ye(t.backdropFilter) || ye(t.filter)) || al.test(t.willChange || "") || ll.test(t.contain || "");
3831
3831
  }
3832
3832
  function cl(e) {
3833
3833
  let t = ce(e);
3834
3834
  for (; oe(t) && !tt(t); ) {
3835
- if (gn(t))
3835
+ if (yn(t))
3836
3836
  return t;
3837
3837
  if (kr(t))
3838
3838
  return null;
@@ -3840,8 +3840,8 @@ function cl(e) {
3840
3840
  }
3841
3841
  return null;
3842
3842
  }
3843
- function yn() {
3844
- return Fr == null && (Fr = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), Fr;
3843
+ function vn() {
3844
+ return Kr == null && (Kr = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), Kr;
3845
3845
  }
3846
3846
  function tt(e) {
3847
3847
  return /^(html|body|#document)$/.test(ut(e));
@@ -3865,29 +3865,29 @@ function ce(e) {
3865
3865
  // Step into the shadow DOM of the parent of a slotted node.
3866
3866
  e.assignedSlot || // DOM Element detected.
3867
3867
  e.parentNode || // ShadowRoot detected.
3868
- Vn(e) && e.host || // Fallback.
3868
+ qn(e) && e.host || // Fallback.
3869
3869
  ee(e)
3870
3870
  );
3871
- return Vn(t) ? t.host : t;
3871
+ return qn(t) ? t.host : t;
3872
3872
  }
3873
- function Uo(e) {
3873
+ function Go(e) {
3874
3874
  const t = ce(e);
3875
- return tt(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : oe(t) && Et(t) ? t : Uo(t);
3875
+ return tt(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : oe(t) && Et(t) ? t : Go(t);
3876
3876
  }
3877
3877
  function bt(e, t, r) {
3878
3878
  var o;
3879
3879
  t === void 0 && (t = []), r === void 0 && (r = !0);
3880
- const n = Uo(e), i = n === ((o = e.ownerDocument) == null ? void 0 : o.body), s = z(n);
3880
+ const n = Go(e), i = n === ((o = e.ownerDocument) == null ? void 0 : o.body), s = z(n);
3881
3881
  if (i) {
3882
- const a = Xr(s);
3882
+ const a = Gr(s);
3883
3883
  return t.concat(s, s.visualViewport || [], Et(n) ? n : [], a && r ? bt(a) : []);
3884
3884
  } else
3885
3885
  return t.concat(n, bt(n, [], r));
3886
3886
  }
3887
- function Xr(e) {
3887
+ function Gr(e) {
3888
3888
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
3889
3889
  }
3890
- function Xo(e) {
3890
+ function Zo(e) {
3891
3891
  const t = Y(e);
3892
3892
  let r = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
3893
3893
  const n = oe(e), i = n ? e.offsetWidth : r, s = n ? e.offsetHeight : o, a = er(r) !== i || er(o) !== s;
@@ -3897,18 +3897,18 @@ function Xo(e) {
3897
3897
  $: a
3898
3898
  };
3899
3899
  }
3900
- function vn(e) {
3900
+ function wn(e) {
3901
3901
  return Z(e) ? e : e.contextElement;
3902
3902
  }
3903
3903
  function je(e) {
3904
- const t = vn(e);
3904
+ const t = wn(e);
3905
3905
  if (!oe(t))
3906
3906
  return Q(1);
3907
3907
  const r = t.getBoundingClientRect(), {
3908
3908
  width: o,
3909
3909
  height: n,
3910
3910
  $: i
3911
- } = Xo(t);
3911
+ } = Zo(t);
3912
3912
  let s = (i ? er(r.width) : r.width) / o, a = (i ? er(r.height) : r.height) / n;
3913
3913
  return (!s || !Number.isFinite(s)) && (s = 1), (!a || !Number.isFinite(a)) && (a = 1), {
3914
3914
  x: s,
@@ -3916,9 +3916,9 @@ function je(e) {
3916
3916
  };
3917
3917
  }
3918
3918
  const dl = /* @__PURE__ */ Q(0);
3919
- function Go(e) {
3919
+ function Yo(e) {
3920
3920
  const t = z(e);
3921
- return !yn() || !t.visualViewport ? dl : {
3921
+ return !vn() || !t.visualViewport ? dl : {
3922
3922
  x: t.visualViewport.offsetLeft,
3923
3923
  y: t.visualViewport.offsetTop
3924
3924
  };
@@ -3928,17 +3928,17 @@ function ul(e, t, r) {
3928
3928
  }
3929
3929
  function Oe(e, t, r, o) {
3930
3930
  t === void 0 && (t = !1), r === void 0 && (r = !1);
3931
- const n = e.getBoundingClientRect(), i = vn(e);
3931
+ const n = e.getBoundingClientRect(), i = wn(e);
3932
3932
  let s = Q(1);
3933
3933
  t && (o ? Z(o) && (s = je(o)) : s = je(e));
3934
- const a = ul(i, r, o) ? Go(i) : Q(0);
3934
+ const a = ul(i, r, o) ? Yo(i) : Q(0);
3935
3935
  let l = (n.left + a.x) / s.x, d = (n.top + a.y) / s.y, u = n.width / s.x, h = n.height / s.y;
3936
3936
  if (i) {
3937
3937
  const f = z(i), m = o && Z(o) ? z(o) : o;
3938
- let g = f, y = Xr(g);
3938
+ let g = f, y = Gr(g);
3939
3939
  for (; y && o && m !== g; ) {
3940
- const P = je(y), v = y.getBoundingClientRect(), M = Y(y), D = v.left + (y.clientLeft + parseFloat(M.paddingLeft)) * P.x, $ = v.top + (y.clientTop + parseFloat(M.paddingTop)) * P.y;
3941
- l *= P.x, d *= P.y, u *= P.x, h *= P.y, l += D, d += $, g = z(y), y = Xr(g);
3940
+ const P = je(y), v = y.getBoundingClientRect(), M = Y(y), D = v.left + (y.clientLeft + parseFloat(M.paddingLeft)) * P.x, N = v.top + (y.clientTop + parseFloat(M.paddingTop)) * P.y;
3941
+ l *= P.x, d *= P.y, u *= P.x, h *= P.y, l += D, d += N, g = z(y), y = Gr(g);
3942
3942
  }
3943
3943
  }
3944
3944
  return rr({
@@ -3952,7 +3952,7 @@ function Tr(e, t) {
3952
3952
  const r = Cr(e).scrollLeft;
3953
3953
  return t ? t.left + r : Oe(ee(e)).left + r;
3954
3954
  }
3955
- function Zo(e, t) {
3955
+ function Jo(e, t) {
3956
3956
  const r = e.getBoundingClientRect(), o = r.left + t.scrollLeft - Tr(e, r), n = r.top + t.scrollTop;
3957
3957
  return {
3958
3958
  x: o,
@@ -3978,7 +3978,7 @@ function hl(e) {
3978
3978
  const m = Oe(o);
3979
3979
  d = je(o), u.x = m.x + o.clientLeft, u.y = m.y + o.clientTop;
3980
3980
  }
3981
- const f = s && !h && !i ? Zo(s, l) : Q(0);
3981
+ const f = s && !h && !i ? Jo(s, l) : Q(0);
3982
3982
  return {
3983
3983
  width: r.width * d.x,
3984
3984
  height: r.height * d.y,
@@ -4000,20 +4000,20 @@ function fl(e) {
4000
4000
  y: a
4001
4001
  };
4002
4002
  }
4003
- const qn = 25;
4003
+ const Un = 25;
4004
4004
  function pl(e, t) {
4005
4005
  const r = z(e), o = ee(e), n = r.visualViewport;
4006
4006
  let i = o.clientWidth, s = o.clientHeight, a = 0, l = 0;
4007
4007
  if (n) {
4008
4008
  i = n.width, s = n.height;
4009
- const u = yn();
4009
+ const u = vn();
4010
4010
  (!u || u && t === "fixed") && (a = n.offsetLeft, l = n.offsetTop);
4011
4011
  }
4012
4012
  const d = Tr(o);
4013
4013
  if (d <= 0) {
4014
4014
  const u = o.ownerDocument, h = u.body, f = getComputedStyle(h), m = u.compatMode === "CSS1Compat" && parseFloat(f.marginLeft) + parseFloat(f.marginRight) || 0, g = Math.abs(o.clientWidth - h.clientWidth - m);
4015
- g <= qn && (i -= g);
4016
- } else d <= qn && (i += d);
4015
+ g <= Un && (i -= g);
4016
+ } else d <= Un && (i += d);
4017
4017
  return {
4018
4018
  width: i,
4019
4019
  height: s,
@@ -4030,7 +4030,7 @@ function gl(e, t) {
4030
4030
  y: d
4031
4031
  };
4032
4032
  }
4033
- function Un(e, t, r) {
4033
+ function Xn(e, t, r) {
4034
4034
  let o;
4035
4035
  if (t === "viewport")
4036
4036
  o = pl(e, r);
@@ -4039,7 +4039,7 @@ function Un(e, t, r) {
4039
4039
  else if (Z(t))
4040
4040
  o = gl(t, r);
4041
4041
  else {
4042
- const n = Go(e);
4042
+ const n = Yo(e);
4043
4043
  o = {
4044
4044
  x: t.x - n.x,
4045
4045
  y: t.y - n.y,
@@ -4049,9 +4049,9 @@ function Un(e, t, r) {
4049
4049
  }
4050
4050
  return rr(o);
4051
4051
  }
4052
- function Yo(e, t) {
4052
+ function Qo(e, t) {
4053
4053
  const r = ce(e);
4054
- return r === t || !Z(r) || tt(r) ? !1 : Y(r).position === "fixed" || Yo(r, t);
4054
+ return r === t || !Z(r) || tt(r) ? !1 : Y(r).position === "fixed" || Qo(r, t);
4055
4055
  }
4056
4056
  function yl(e, t) {
4057
4057
  const r = t.get(e);
@@ -4061,8 +4061,8 @@ function yl(e, t) {
4061
4061
  const i = Y(e).position === "fixed";
4062
4062
  let s = i ? ce(e) : e;
4063
4063
  for (; Z(s) && !tt(s); ) {
4064
- const a = Y(s), l = gn(s);
4065
- !l && a.position === "fixed" && (n = null), (i ? !l && !n : !l && a.position === "static" && !!n && (n.position === "absolute" || n.position === "fixed") || Et(s) && !l && Yo(e, s)) ? o = o.filter((u) => u !== s) : n = a, s = ce(s);
4064
+ const a = Y(s), l = yn(s);
4065
+ !l && a.position === "fixed" && (n = null), (i ? !l && !n : !l && a.position === "static" && !!n && (n.position === "absolute" || n.position === "fixed") || Et(s) && !l && Qo(e, s)) ? o = o.filter((u) => u !== s) : n = a, s = ce(s);
4066
4066
  }
4067
4067
  return t.set(e, o), o;
4068
4068
  }
@@ -4073,10 +4073,10 @@ function vl(e) {
4073
4073
  rootBoundary: o,
4074
4074
  strategy: n
4075
4075
  } = e;
4076
- const s = [...r === "clippingAncestors" ? kr(t) ? [] : yl(t, this._c) : [].concat(r), o], a = Un(t, s[0], n);
4076
+ const s = [...r === "clippingAncestors" ? kr(t) ? [] : yl(t, this._c) : [].concat(r), o], a = Xn(t, s[0], n);
4077
4077
  let l = a.top, d = a.right, u = a.bottom, h = a.left;
4078
4078
  for (let f = 1; f < s.length; f++) {
4079
- const m = Un(t, s[f], n);
4079
+ const m = Xn(t, s[f], n);
4080
4080
  l = Ce(m.top, l), d = Qt(m.right, d), u = Qt(m.bottom, u), h = Ce(m.left, h);
4081
4081
  }
4082
4082
  return {
@@ -4090,7 +4090,7 @@ function wl(e) {
4090
4090
  const {
4091
4091
  width: t,
4092
4092
  height: r
4093
- } = Xo(e);
4093
+ } = Zo(e);
4094
4094
  return {
4095
4095
  width: t,
4096
4096
  height: r
@@ -4112,7 +4112,7 @@ function xl(e, t, r) {
4112
4112
  l.x = m.x + t.clientLeft, l.y = m.y + t.clientTop;
4113
4113
  } else n && d();
4114
4114
  i && !o && n && d();
4115
- const u = n && !o && !i ? Zo(n, a) : Q(0), h = s.left + a.scrollLeft - l.x - u.x, f = s.top + a.scrollTop - l.y - u.y;
4115
+ const u = n && !o && !i ? Jo(n, a) : Q(0), h = s.left + a.scrollLeft - l.x - u.x, f = s.top + a.scrollTop - l.y - u.y;
4116
4116
  return {
4117
4117
  x: h,
4118
4118
  y: f,
@@ -4120,10 +4120,10 @@ function xl(e, t, r) {
4120
4120
  height: s.height
4121
4121
  };
4122
4122
  }
4123
- function Kr(e) {
4123
+ function zr(e) {
4124
4124
  return Y(e).position === "static";
4125
4125
  }
4126
- function Xn(e, t) {
4126
+ function Gn(e, t) {
4127
4127
  if (!oe(e) || Y(e).position === "fixed")
4128
4128
  return null;
4129
4129
  if (t)
@@ -4131,26 +4131,26 @@ function Xn(e, t) {
4131
4131
  let r = e.offsetParent;
4132
4132
  return ee(e) === r && (r = r.ownerDocument.body), r;
4133
4133
  }
4134
- function Jo(e, t) {
4134
+ function ei(e, t) {
4135
4135
  const r = z(e);
4136
4136
  if (kr(e))
4137
4137
  return r;
4138
4138
  if (!oe(e)) {
4139
4139
  let n = ce(e);
4140
4140
  for (; n && !tt(n); ) {
4141
- if (Z(n) && !Kr(n))
4141
+ if (Z(n) && !zr(n))
4142
4142
  return n;
4143
4143
  n = ce(n);
4144
4144
  }
4145
4145
  return r;
4146
4146
  }
4147
- let o = Xn(e, t);
4148
- for (; o && sl(o) && Kr(o); )
4149
- o = Xn(o, t);
4150
- return o && tt(o) && Kr(o) && !gn(o) ? r : o || cl(e) || r;
4147
+ let o = Gn(e, t);
4148
+ for (; o && sl(o) && zr(o); )
4149
+ o = Gn(o, t);
4150
+ return o && tt(o) && zr(o) && !yn(o) ? r : o || cl(e) || r;
4151
4151
  }
4152
4152
  const bl = async function(e) {
4153
- const t = this.getOffsetParent || Jo, r = this.getDimensions, o = await r(e.floating);
4153
+ const t = this.getOffsetParent || ei, r = this.getDimensions, o = await r(e.floating);
4154
4154
  return {
4155
4155
  reference: xl(e.reference, await t(e.floating), e.strategy),
4156
4156
  floating: {
@@ -4168,7 +4168,7 @@ const Cl = {
4168
4168
  convertOffsetParentRelativeRectToViewportRelativeRect: hl,
4169
4169
  getDocumentElement: ee,
4170
4170
  getClippingRect: vl,
4171
- getOffsetParent: Jo,
4171
+ getOffsetParent: ei,
4172
4172
  getElementRects: bl,
4173
4173
  getClientRects: ml,
4174
4174
  getDimensions: wl,
@@ -4176,7 +4176,7 @@ const Cl = {
4176
4176
  isElement: Z,
4177
4177
  isRTL: kl
4178
4178
  };
4179
- function Qo(e, t) {
4179
+ function ti(e, t) {
4180
4180
  return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
4181
4181
  }
4182
4182
  function Tl(e, t) {
@@ -4200,17 +4200,17 @@ function Tl(e, t) {
4200
4200
  rootMargin: -g + "px " + -y + "px " + -P + "px " + -v + "px",
4201
4201
  threshold: Ce(0, Qt(1, l)) || 1
4202
4202
  };
4203
- let $ = !0;
4203
+ let N = !0;
4204
4204
  function j(F) {
4205
4205
  const Ae = F[0].intersectionRatio;
4206
4206
  if (Ae !== l) {
4207
- if (!$)
4207
+ if (!N)
4208
4208
  return s();
4209
4209
  Ae ? s(!1, Ae) : o = setTimeout(() => {
4210
4210
  s(!1, 1e-7);
4211
4211
  }, 1e3);
4212
4212
  }
4213
- Ae === 1 && !Qo(d, e.getBoundingClientRect()) && s(), $ = !1;
4213
+ Ae === 1 && !ti(d, e.getBoundingClientRect()) && s(), N = !1;
4214
4214
  }
4215
4215
  try {
4216
4216
  r = new IntersectionObserver(j, {
@@ -4233,7 +4233,7 @@ function Pl(e, t, r, o) {
4233
4233
  elementResize: s = typeof ResizeObserver == "function",
4234
4234
  layoutShift: a = typeof IntersectionObserver == "function",
4235
4235
  animationFrame: l = !1
4236
- } = o, d = vn(e), u = n || i ? [...d ? bt(d) : [], ...t ? bt(t) : []] : [];
4236
+ } = o, d = wn(e), u = n || i ? [...d ? bt(d) : [], ...t ? bt(t) : []] : [];
4237
4237
  u.forEach((v) => {
4238
4238
  n && v.addEventListener("scroll", r, {
4239
4239
  passive: !0
@@ -4252,7 +4252,7 @@ function Pl(e, t, r, o) {
4252
4252
  l && P();
4253
4253
  function P() {
4254
4254
  const v = Oe(e);
4255
- y && !Qo(y, v) && r(), y = v, g = requestAnimationFrame(P);
4255
+ y && !ti(y, v) && r(), y = v, g = requestAnimationFrame(P);
4256
4256
  }
4257
4257
  return r(), () => {
4258
4258
  var v;
@@ -4275,7 +4275,7 @@ const Sl = ol, _l = il, Ml = tl, Ol = (e, t, r) => {
4275
4275
  });
4276
4276
  };
4277
4277
  let O = null, We = null, nr = null, jt = null, Wt = null, vt = null;
4278
- function ei() {
4278
+ function ri() {
4279
4279
  jt && (clearTimeout(jt), jt = null), Wt && (clearTimeout(Wt), Wt = null);
4280
4280
  }
4281
4281
  function El() {
@@ -4297,7 +4297,7 @@ function Dl(e) {
4297
4297
  }
4298
4298
  return !1;
4299
4299
  }
4300
- async function Gn(e) {
4300
+ async function Zn(e) {
4301
4301
  if (!O || !We)
4302
4302
  return;
4303
4303
  const { x: t, y: r } = await Ol(We, O, {
@@ -4307,10 +4307,10 @@ async function Gn(e) {
4307
4307
  });
4308
4308
  O.style.transform = `translate3d(${Math.round(t)}px, ${Math.round(r)}px, 0)`;
4309
4309
  }
4310
- function Zn(e, t, r = "top", o = !1, n) {
4310
+ function Yn(e, t, r = "top", o = !1, n) {
4311
4311
  if (!e || typeof document > "u" || !El())
4312
4312
  return;
4313
- ei();
4313
+ ri();
4314
4314
  const s = async () => {
4315
4315
  if (O) {
4316
4316
  We = e, O.textContent = t, O.dataset.placement = r, O.dataset.dark = Dl(n) ? "true" : "false", O.dataset.visible = "false", vt = `tooltip-${Date.now()}-${Math.random().toString(36).slice(2)}`, O.id = vt;
@@ -4318,17 +4318,17 @@ function Zn(e, t, r = "top", o = !1, n) {
4318
4318
  e.setAttribute("aria-describedby", vt);
4319
4319
  } catch {
4320
4320
  }
4321
- await Gn(r), O.dataset.visible = "true", nr?.(), nr = Pl(e, O, () => {
4322
- Gn(r);
4321
+ await Zn(r), O.dataset.visible = "true", nr?.(), nr = Pl(e, O, () => {
4322
+ Zn(r);
4323
4323
  });
4324
4324
  }
4325
4325
  };
4326
4326
  o ? s() : jt = setTimeout(s, 80);
4327
4327
  }
4328
- function Yn(e = !1) {
4328
+ function Jn(e = !1) {
4329
4329
  if (!O)
4330
4330
  return;
4331
- ei();
4331
+ ri();
4332
4332
  const t = () => {
4333
4333
  if (O) {
4334
4334
  if (O.dataset.visible = "false", We && vt)
@@ -4360,7 +4360,7 @@ let de = class {
4360
4360
  this.streamedDelta && n ? this.settleStreamedDelta() : i !== e && (this.settledText = e, this.streamedDelta = ""), t && r?.set(t, e), this.lastStreamRenderVersion = o;
4361
4361
  return;
4362
4362
  }
4363
- const l = zo({
4363
+ const l = Wo({
4364
4364
  nextContent: e,
4365
4365
  previousContent: a,
4366
4366
  typewriterEnabled: this.typewriterEnabled
@@ -4422,10 +4422,10 @@ de = Dt([
4422
4422
  changeDetection: k.OnPush
4423
4423
  })
4424
4424
  ], de);
4425
- var $l = Object.defineProperty, Nl = Object.getOwnPropertyDescriptor, Rt = (e, t, r, o) => {
4426
- for (var n = o > 1 ? void 0 : o ? Nl(t, r) : t, i = e.length - 1, s; i >= 0; i--)
4425
+ var Nl = Object.defineProperty, $l = Object.getOwnPropertyDescriptor, Rt = (e, t, r, o) => {
4426
+ for (var n = o > 1 ? void 0 : o ? $l(t, r) : t, i = e.length - 1, s; i >= 0; i--)
4427
4427
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
4428
- return o && n && $l(t, r, n), n;
4428
+ return o && n && Nl(t, r, n), n;
4429
4429
  };
4430
4430
  let Ee = class {
4431
4431
  constructor() {
@@ -4474,16 +4474,16 @@ let Ee = class {
4474
4474
  this.syncTooltip();
4475
4475
  }
4476
4476
  ngOnDestroy() {
4477
- this.hovering && Yn(!0);
4477
+ this.hovering && Jn(!0);
4478
4478
  }
4479
4479
  onAnchorEnter() {
4480
- this.resolvedShowTooltip && (this.hovering = !0, Zn(this.anchorRef?.nativeElement || null, this.title, "top", !1, this.context?.isDark));
4480
+ this.resolvedShowTooltip && (this.hovering = !0, Yn(this.anchorRef?.nativeElement || null, this.title, "top", !1, this.context?.isDark));
4481
4481
  }
4482
4482
  onAnchorLeave() {
4483
- this.resolvedShowTooltip && (this.hovering = !1, Yn());
4483
+ this.resolvedShowTooltip && (this.hovering = !1, Jn());
4484
4484
  }
4485
4485
  syncTooltip() {
4486
- !this.hovering || !this.resolvedShowTooltip || Zn(this.anchorRef?.nativeElement || null, this.title, "top", !0, this.context?.isDark);
4486
+ !this.hovering || !this.resolvedShowTooltip || Yn(this.anchorRef?.nativeElement || null, this.title, "top", !0, this.context?.isDark);
4487
4487
  }
4488
4488
  };
4489
4489
  Rt([
@@ -4653,21 +4653,21 @@ rt = Pr([
4653
4653
  changeDetection: k.OnPush
4654
4654
  })
4655
4655
  ], rt);
4656
- let xe = null, Vt = !1, Fe = null, wn = ri;
4657
- function xn(e) {
4656
+ let xe = null, Vt = !1, Fe = null, xn = oi;
4657
+ function bn(e) {
4658
4658
  const t = e?.default ?? e;
4659
4659
  return t && typeof t.renderToString == "function" ? t : null;
4660
4660
  }
4661
- function ti() {
4661
+ function ni() {
4662
4662
  try {
4663
- return xn(globalThis?.katex);
4663
+ return bn(globalThis?.katex);
4664
4664
  } catch {
4665
4665
  return null;
4666
4666
  }
4667
4667
  }
4668
- function ri() {
4668
+ function oi() {
4669
4669
  return (async () => {
4670
- const e = ti();
4670
+ const e = ni();
4671
4671
  if (e)
4672
4672
  return e;
4673
4673
  const t = await import("katex");
@@ -4675,26 +4675,26 @@ function ri() {
4675
4675
  await import("katex/contrib/mhchem");
4676
4676
  } catch {
4677
4677
  }
4678
- return xn(t);
4678
+ return bn(t);
4679
4679
  })();
4680
4680
  }
4681
4681
  function Fl() {
4682
4682
  xe = null, Vt = !1, Fe = null;
4683
4683
  }
4684
- function ni(e) {
4685
- wn = e, Fl();
4684
+ function ii(e) {
4685
+ xn = e, Fl();
4686
4686
  }
4687
- function bd(e) {
4688
- ni(e ?? ri);
4687
+ function kd(e) {
4688
+ ii(e ?? oi);
4689
4689
  }
4690
- function kd() {
4691
- ni(null);
4690
+ function Cd() {
4691
+ ii(null);
4692
4692
  }
4693
- function oi() {
4694
- return typeof wn == "function";
4693
+ function si() {
4694
+ return typeof xn == "function";
4695
4695
  }
4696
- async function bn() {
4697
- const e = ti();
4696
+ async function kn() {
4697
+ const e = ni();
4698
4698
  if (e)
4699
4699
  return xe = e, xe;
4700
4700
  if (xe)
@@ -4703,12 +4703,12 @@ async function bn() {
4703
4703
  return await Fe;
4704
4704
  if (Vt)
4705
4705
  return null;
4706
- const t = wn;
4706
+ const t = xn;
4707
4707
  if (!t)
4708
4708
  return Vt = !0, null;
4709
4709
  Fe = (async () => {
4710
4710
  try {
4711
- const r = await t(), o = xn(r) ?? r;
4711
+ const r = await t(), o = bn(r) ?? r;
4712
4712
  if (o)
4713
4713
  return xe = o, xe;
4714
4714
  } catch {
@@ -4721,11 +4721,11 @@ async function bn() {
4721
4721
  Fe = null;
4722
4722
  }
4723
4723
  }
4724
- function $t(e) {
4724
+ function Nt(e) {
4725
4725
  return e ? e.replace(/·/g, "⋅").replace(/℃/g, "°C") : "";
4726
4726
  }
4727
- const Nt = "WORKER_BUSY";
4728
- let U = null, ae = null, Gr = !1;
4727
+ const $t = "WORKER_BUSY";
4728
+ let U = null, ae = null, Zr = !1;
4729
4729
  const K = /* @__PURE__ */ new Map(), gt = /* @__PURE__ */ new Map(), Kl = 200, be = /* @__PURE__ */ new Set();
4730
4730
  let De = 5;
4731
4731
  function kt() {
@@ -4739,13 +4739,13 @@ function kt() {
4739
4739
  } catch {
4740
4740
  }
4741
4741
  }
4742
- function ii(e, t, r) {
4742
+ function ai(e, t, r) {
4743
4743
  if (gt.set(`${t ? "d" : "i"}:${e}`, r), gt.size > Kl) {
4744
4744
  const o = gt.keys().next().value;
4745
4745
  o && gt.delete(o);
4746
4746
  }
4747
4747
  }
4748
- function Cd(e) {
4748
+ function Td(e) {
4749
4749
  U = e, ae = null, U.onmessage = (t) => {
4750
4750
  const { id: r, html: o, error: n, content: i, displayMode: s } = t.data || {}, a = K.get(r);
4751
4751
  if (a) {
@@ -4753,26 +4753,26 @@ function Cd(e) {
4753
4753
  a.reject(new Error(n));
4754
4754
  return;
4755
4755
  }
4756
- i && ii(String(i), !!s, String(o || "")), a.resolve(String(o || ""));
4756
+ i && ai(String(i), !!s, String(o || "")), a.resolve(String(o || ""));
4757
4757
  }
4758
4758
  }, U.onerror = (t) => {
4759
4759
  for (const [, r] of K.entries())
4760
4760
  clearTimeout(r.timeoutId), r.reject(new Error(`Worker error: ${t.message}`));
4761
4761
  K.clear(), kt();
4762
- }, Gr && U.postMessage({ type: "init", debug: !0 });
4762
+ }, Zr && U.postMessage({ type: "init", debug: !0 });
4763
4763
  }
4764
- function Td() {
4764
+ function Pd() {
4765
4765
  U && U.terminate?.(), U = null, ae = null;
4766
4766
  }
4767
4767
  function zl() {
4768
4768
  return U || (ae = new Error("[markstream-angular:katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."), ae.name = "WorkerInitError", ae.code = "WORKER_INIT_ERROR", null);
4769
4769
  }
4770
- function Pd(e) {
4771
- Gr = !!e, U && U.postMessage({ type: "init", debug: Gr });
4770
+ function Sd(e) {
4771
+ Zr = !!e, U && U.postMessage({ type: "init", debug: Zr });
4772
4772
  }
4773
4773
  async function jl(e, t = !0, r = 2e3, o) {
4774
- const n = $t(e);
4775
- if (!oi()) {
4774
+ const n = Nt(e);
4775
+ if (!si()) {
4776
4776
  const l = new Error("KaTeX rendering disabled");
4777
4777
  return l.name = "KaTeXDisabled", l.code = "KATEX_DISABLED", Promise.reject(l);
4778
4778
  }
@@ -4786,7 +4786,7 @@ async function jl(e, t = !0, r = 2e3, o) {
4786
4786
  return Promise.reject(ae);
4787
4787
  if (K.size >= De) {
4788
4788
  const l = new Error("Worker busy");
4789
- return l.name = "WorkerBusy", l.code = Nt, l.busy = !0, l.inFlight = K.size, l.max = De, Promise.reject(l);
4789
+ return l.name = "WorkerBusy", l.code = $t, l.busy = !0, l.inFlight = K.size, l.max = De, Promise.reject(l);
4790
4790
  }
4791
4791
  return new Promise((l, d) => {
4792
4792
  if (o?.aborted) {
@@ -4819,19 +4819,19 @@ async function jl(e, t = !0, r = 2e3, o) {
4819
4819
  });
4820
4820
  });
4821
4821
  }
4822
- function kn(e, t = !0, r) {
4823
- ii($t(e), t, r);
4822
+ function Cn(e, t = !0, r) {
4823
+ ai(Nt(e), t, r);
4824
4824
  }
4825
- function Sd() {
4825
+ function _d() {
4826
4826
  return {
4827
4827
  inFlight: K.size,
4828
4828
  max: De
4829
4829
  };
4830
4830
  }
4831
- function _d(e) {
4831
+ function Md(e) {
4832
4832
  Number.isFinite(e) && e > 0 && (De = Math.floor(e));
4833
4833
  }
4834
- function Md() {
4834
+ function Od() {
4835
4835
  return K.size >= De;
4836
4836
  }
4837
4837
  function Wl(e = 2e3, t) {
@@ -4864,14 +4864,14 @@ const J = {
4864
4864
  backoffMs: 30,
4865
4865
  maxRetries: 1
4866
4866
  }, Vl = 8;
4867
- function Od(e) {
4867
+ function Ed(e) {
4868
4868
  e.timeout != null && (J.timeout = Math.max(0, Math.floor(e.timeout))), e.waitTimeout != null && (J.waitTimeout = Math.max(0, Math.floor(e.waitTimeout))), e.backoffMs != null && (J.backoffMs = Math.max(0, Math.floor(e.backoffMs))), e.maxRetries != null && (J.maxRetries = Math.max(0, Math.floor(e.maxRetries)));
4869
4869
  }
4870
- function Ed() {
4870
+ function Dd() {
4871
4871
  return { ...J };
4872
4872
  }
4873
- async function Cn(e, t = !0, r = {}) {
4874
- if (!oi()) {
4873
+ async function Tn(e, t = !0, r = {}) {
4874
+ if (!si()) {
4875
4875
  const d = new Error("KaTeX rendering disabled");
4876
4876
  throw d.name = "KaTeXDisabled", d.code = "KATEX_DISABLED", d;
4877
4877
  }
@@ -4885,14 +4885,14 @@ async function Cn(e, t = !0, r = {}) {
4885
4885
  try {
4886
4886
  return await jl(e, t, o, r.signal);
4887
4887
  } catch (d) {
4888
- if (d?.code !== Nt || l >= a)
4888
+ if (d?.code !== $t || l >= a)
4889
4889
  throw d;
4890
4890
  l += 1, await Wl(n, r.signal).catch(() => {
4891
4891
  }), i > 0 && await new Promise((u) => globalThis.setTimeout(u, i * l));
4892
4892
  }
4893
4893
  }
4894
4894
  }
4895
- var ql = Object.defineProperty, Ul = Object.getOwnPropertyDescriptor, Tn = (e, t, r, o) => {
4895
+ var ql = Object.defineProperty, Ul = Object.getOwnPropertyDescriptor, Pn = (e, t, r, o) => {
4896
4896
  for (var n = o > 1 ? void 0 : o ? Ul(t, r) : t, i = e.length - 1, s; i >= 0; i--)
4897
4897
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
4898
4898
  return o && n && ql(t, r, n), n;
@@ -4917,7 +4917,7 @@ let Ct = class {
4917
4917
  const e = this.mathRef?.nativeElement;
4918
4918
  if (!e)
4919
4919
  return;
4920
- const t = $t(this.content), r = ++this.renderVersion;
4920
+ const t = Nt(this.content), r = ++this.renderVersion;
4921
4921
  if (!t) {
4922
4922
  e.textContent = "", this.rendering = !1, this.cdr.markForCheck();
4923
4923
  return;
@@ -4928,17 +4928,17 @@ let Ct = class {
4928
4928
  }
4929
4929
  async resolveKatexMarkup(e) {
4930
4930
  try {
4931
- return await Cn(e, !0, {
4931
+ return await Tn(e, !0, {
4932
4932
  timeout: 3e3,
4933
4933
  waitTimeout: 2e3,
4934
4934
  maxRetries: 1
4935
4935
  });
4936
4936
  } catch (r) {
4937
4937
  const o = r?.code || r?.name;
4938
- if (!(o === "WORKER_INIT_ERROR" || r?.fallbackToRenderer) && !(o === Nt || o === "WORKER_TIMEOUT"))
4938
+ if (!(o === "WORKER_INIT_ERROR" || r?.fallbackToRenderer) && !(o === $t || o === "WORKER_TIMEOUT"))
4939
4939
  return null;
4940
4940
  }
4941
- const t = await bn();
4941
+ const t = await kn();
4942
4942
  if (!t)
4943
4943
  return null;
4944
4944
  try {
@@ -4946,19 +4946,19 @@ let Ct = class {
4946
4946
  throwOnError: this.node?.loading === !0,
4947
4947
  displayMode: !0
4948
4948
  });
4949
- return kn(e, !0, r), r;
4949
+ return Cn(e, !0, r), r;
4950
4950
  } catch {
4951
4951
  return null;
4952
4952
  }
4953
4953
  }
4954
4954
  };
4955
- Tn([
4955
+ Pn([
4956
4956
  B("mathRef")
4957
4957
  ], Ct.prototype, "mathRef", 2);
4958
- Tn([
4958
+ Pn([
4959
4959
  c({ required: !0 })
4960
4960
  ], Ct.prototype, "node", 2);
4961
- Ct = Tn([
4961
+ Ct = Pn([
4962
4962
  b({
4963
4963
  selector: "markstream-angular-math-block-node",
4964
4964
  standalone: !0,
@@ -4971,7 +4971,7 @@ Ct = Tn([
4971
4971
  changeDetection: k.OnPush
4972
4972
  })
4973
4973
  ], Ct);
4974
- var Xl = Object.defineProperty, Gl = Object.getOwnPropertyDescriptor, Pn = (e, t, r, o) => {
4974
+ var Xl = Object.defineProperty, Gl = Object.getOwnPropertyDescriptor, Sn = (e, t, r, o) => {
4975
4975
  for (var n = o > 1 ? void 0 : o ? Gl(t, r) : t, i = e.length - 1, s; i >= 0; i--)
4976
4976
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
4977
4977
  return o && n && Xl(t, r, n), n;
@@ -4999,7 +4999,7 @@ let Tt = class {
4999
4999
  const e = this.mathRef?.nativeElement;
5000
5000
  if (!e)
5001
5001
  return;
5002
- const t = $t(this.content), r = ++this.renderVersion;
5002
+ const t = Nt(this.content), r = ++this.renderVersion;
5003
5003
  if (!t) {
5004
5004
  e.textContent = "", this.loading = !1, this.cdr.markForCheck();
5005
5005
  return;
@@ -5010,17 +5010,17 @@ let Tt = class {
5010
5010
  }
5011
5011
  async resolveKatexMarkup(e, t) {
5012
5012
  try {
5013
- return await Cn(e, t, {
5013
+ return await Tn(e, t, {
5014
5014
  timeout: 1500,
5015
5015
  waitTimeout: 0,
5016
5016
  maxRetries: 0
5017
5017
  });
5018
5018
  } catch (o) {
5019
5019
  const n = o?.code || o?.name;
5020
- if (!(n === "WORKER_INIT_ERROR" || o?.fallbackToRenderer) && !(n === Nt || n === "WORKER_TIMEOUT"))
5020
+ if (!(n === "WORKER_INIT_ERROR" || o?.fallbackToRenderer) && !(n === $t || n === "WORKER_TIMEOUT"))
5021
5021
  return null;
5022
5022
  }
5023
- const r = await bn();
5023
+ const r = await kn();
5024
5024
  if (!r)
5025
5025
  return null;
5026
5026
  try {
@@ -5028,19 +5028,19 @@ let Tt = class {
5028
5028
  throwOnError: this.node?.loading === !0,
5029
5029
  displayMode: t
5030
5030
  });
5031
- return kn(e, t, o), o;
5031
+ return Cn(e, t, o), o;
5032
5032
  } catch {
5033
5033
  return null;
5034
5034
  }
5035
5035
  }
5036
5036
  };
5037
- Pn([
5037
+ Sn([
5038
5038
  B("mathRef")
5039
5039
  ], Tt.prototype, "mathRef", 2);
5040
- Pn([
5040
+ Sn([
5041
5041
  c({ required: !0 })
5042
5042
  ], Tt.prototype, "node", 2);
5043
- Tt = Pn([
5043
+ Tt = Sn([
5044
5044
  b({
5045
5045
  selector: "markstream-angular-math-inline-node",
5046
5046
  standalone: !0,
@@ -5057,13 +5057,13 @@ Tt = Pn([
5057
5057
  changeDetection: k.OnPush
5058
5058
  })
5059
5059
  ], Tt);
5060
- const si = () => import("mermaid"), Sn = "__MARKSTREAM_ANGULAR_MERMAID__";
5061
- let q = null, yt = !1, Zr = null, Ke = null, _n = si;
5060
+ const li = () => import("mermaid"), _n = "__MARKSTREAM_ANGULAR_MERMAID__";
5061
+ let q = null, yt = !1, Yr = null, Ke = null, Mn = li;
5062
5062
  function Zl(e) {
5063
5063
  const t = String(e?.securityLevel ?? "loose"), r = e?.flowchart?.htmlLabels;
5064
5064
  return `${t}|htmlLabels:${r === !1 ? "0" : "1"}`;
5065
5065
  }
5066
- function ai(e) {
5066
+ function ci(e) {
5067
5067
  if (!e)
5068
5068
  return e;
5069
5069
  const t = e?.default ?? e;
@@ -5080,7 +5080,7 @@ function ai(e) {
5080
5080
  }
5081
5081
  return e?.mermaid && typeof e.mermaid.render == "function" ? e.mermaid : t;
5082
5082
  }
5083
- function Jn(e) {
5083
+ function Qn(e) {
5084
5084
  if (e)
5085
5085
  try {
5086
5086
  const t = e?.initialize;
@@ -5098,64 +5098,64 @@ function Kt(e, t) {
5098
5098
  if (!e || !t)
5099
5099
  return;
5100
5100
  const r = Zl(t);
5101
- if (Zr !== r)
5101
+ if (Yr !== r)
5102
5102
  try {
5103
- typeof e.initialize == "function" ? e.initialize(t) : e.mermaidAPI?.initialize && e.mermaidAPI.initialize(t), Zr = r;
5103
+ typeof e.initialize == "function" ? e.initialize(t) : e.mermaidAPI?.initialize && e.mermaidAPI.initialize(t), Yr = r;
5104
5104
  } catch {
5105
5105
  }
5106
5106
  }
5107
5107
  function Yl() {
5108
5108
  try {
5109
5109
  const e = globalThis;
5110
- return ai(e?.[Sn] ?? e?.mermaid);
5110
+ return ci(e?.[_n] ?? e?.mermaid);
5111
5111
  } catch {
5112
5112
  return null;
5113
5113
  }
5114
5114
  }
5115
- function Qn(e) {
5115
+ function eo(e) {
5116
5116
  try {
5117
- globalThis[Sn] = e;
5117
+ globalThis[_n] = e;
5118
5118
  } catch {
5119
5119
  }
5120
5120
  }
5121
5121
  function Jl() {
5122
- q = null, yt = !1, Zr = null, Ke = null;
5122
+ q = null, yt = !1, Yr = null, Ke = null;
5123
5123
  try {
5124
- delete globalThis[Sn];
5124
+ delete globalThis[_n];
5125
5125
  } catch {
5126
5126
  }
5127
5127
  }
5128
- function li(e) {
5129
- _n = e, Jl();
5128
+ function di(e) {
5129
+ Mn = e, Jl();
5130
5130
  }
5131
- function Dd(e) {
5132
- li(e ?? si);
5131
+ function Rd(e) {
5132
+ di(e ?? li);
5133
5133
  }
5134
- function Rd() {
5135
- li(null);
5134
+ function Id() {
5135
+ di(null);
5136
5136
  }
5137
5137
  function Ql() {
5138
- return typeof _n == "function";
5138
+ return typeof Mn == "function";
5139
5139
  }
5140
- async function ci(e) {
5140
+ async function ui(e) {
5141
5141
  if (q)
5142
5142
  return Kt(q, e), q;
5143
5143
  const t = Yl();
5144
5144
  if (t)
5145
- return Jn(t), q = t, Qn(q), Kt(q, e), q;
5145
+ return Qn(t), q = t, eo(q), Kt(q, e), q;
5146
5146
  if (Ke) {
5147
5147
  const o = await Ke;
5148
5148
  return o && Kt(o, e), o;
5149
5149
  }
5150
5150
  if (yt)
5151
5151
  return null;
5152
- const r = _n;
5152
+ const r = Mn;
5153
5153
  if (!r)
5154
5154
  return yt = !0, null;
5155
5155
  Ke = (async () => {
5156
5156
  try {
5157
- const o = await r(), n = ai(o);
5158
- return n ? (Jn(n), q = n, Qn(q), q) : (yt = !0, null);
5157
+ const o = await r(), n = ci(o);
5158
+ return n ? (Qn(n), q = n, eo(q), q) : (yt = !0, null);
5159
5159
  } catch {
5160
5160
  return yt = !0, null;
5161
5161
  }
@@ -5168,58 +5168,58 @@ async function ci(e) {
5168
5168
  }
5169
5169
  }
5170
5170
  let L = null, le = null;
5171
- const N = /* @__PURE__ */ new Map();
5172
- let or = 5, di = !1;
5173
- function Id(e) {
5174
- di = !!e;
5171
+ const $ = /* @__PURE__ */ new Map();
5172
+ let or = 5, hi = !1;
5173
+ function Nd(e) {
5174
+ hi = !!e;
5175
5175
  }
5176
5176
  function $d(e) {
5177
5177
  Number.isFinite(e) && e > 0 && (or = Math.floor(e));
5178
5178
  }
5179
- function Nd() {
5180
- return { inFlight: N.size, max: or };
5179
+ function Ad() {
5180
+ return { inFlight: $.size, max: or };
5181
5181
  }
5182
5182
  const ec = "WORKER_BUSY", tc = "MERMAID_DISABLED";
5183
- function Ad(e) {
5183
+ function Ld(e) {
5184
5184
  L = e, le = null;
5185
5185
  const t = e;
5186
5186
  L.onmessage = (r) => {
5187
5187
  if (L !== t)
5188
5188
  return;
5189
- const { id: o, ok: n, result: i, error: s } = r.data || {}, a = N.get(o);
5189
+ const { id: o, ok: n, result: i, error: s } = r.data || {}, a = $.get(o);
5190
5190
  a && (n === !1 || s ? a.reject(new Error(s || "Unknown error")) : a.resolve(i));
5191
5191
  }, L.onerror = (r) => {
5192
5192
  if (L === t) {
5193
- if (N.size === 0) {
5193
+ if ($.size === 0) {
5194
5194
  console.debug?.("[markstream-angular:mermaidWorkerClient] Worker error (idle):", r?.message || r);
5195
5195
  return;
5196
5196
  }
5197
5197
  try {
5198
- di ? console.error("[markstream-angular:mermaidWorkerClient] Worker error:", r?.message || r) : console.debug?.("[markstream-angular:mermaidWorkerClient] Worker error:", r?.message || r);
5198
+ hi ? console.error("[markstream-angular:mermaidWorkerClient] Worker error:", r?.message || r) : console.debug?.("[markstream-angular:mermaidWorkerClient] Worker error:", r?.message || r);
5199
5199
  } catch {
5200
5200
  }
5201
- for (const [, o] of N.entries())
5201
+ for (const [, o] of $.entries())
5202
5202
  o.reject(new Error(`Worker error: ${r.message}`));
5203
- N.clear();
5203
+ $.clear();
5204
5204
  }
5205
5205
  }, L.onmessageerror = (r) => {
5206
5206
  if (L === t) {
5207
- if (N.size === 0) {
5207
+ if ($.size === 0) {
5208
5208
  console.debug?.("[markstream-angular:mermaidWorkerClient] Worker messageerror (idle):", r);
5209
5209
  return;
5210
5210
  }
5211
- for (const [, o] of N.entries())
5211
+ for (const [, o] of $.entries())
5212
5212
  o.reject(new Error("Worker messageerror"));
5213
- N.clear();
5213
+ $.clear();
5214
5214
  }
5215
5215
  };
5216
5216
  }
5217
- function Ld() {
5217
+ function Hd() {
5218
5218
  if (L)
5219
5219
  try {
5220
- for (const [, e] of N.entries())
5220
+ for (const [, e] of $.entries())
5221
5221
  e.reject(new Error("Worker cleared"));
5222
- N.clear(), L.terminate?.();
5222
+ $.clear(), L.terminate?.();
5223
5223
  } catch {
5224
5224
  }
5225
5225
  L = null, le = null;
@@ -5227,7 +5227,7 @@ function Ld() {
5227
5227
  function rc() {
5228
5228
  return L || (le = new Error("[markstream-angular:mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."), le.name = "WorkerInitError", le.code = "WORKER_INIT_ERROR", null);
5229
5229
  }
5230
- function ui(e, t, r = 1400) {
5230
+ function mi(e, t, r = 1400) {
5231
5231
  if (!Ql()) {
5232
5232
  const n = new Error("Mermaid rendering disabled");
5233
5233
  return n.name = "MermaidDisabled", n.code = tc, Promise.reject(n);
@@ -5237,17 +5237,17 @@ function ui(e, t, r = 1400) {
5237
5237
  const o = rc();
5238
5238
  if (!o)
5239
5239
  return Promise.reject(le);
5240
- if (N.size >= or) {
5240
+ if ($.size >= or) {
5241
5241
  const n = new Error("Worker busy");
5242
- return n.name = "WorkerBusy", n.code = ec, n.inFlight = N.size, n.max = or, Promise.reject(n);
5242
+ return n.name = "WorkerBusy", n.code = ec, n.inFlight = $.size, n.max = or, Promise.reject(n);
5243
5243
  }
5244
5244
  return new Promise((n, i) => {
5245
5245
  const s = Math.random().toString(36).slice(2);
5246
5246
  let a = !1, l = null;
5247
5247
  const d = () => {
5248
- a || (a = !0, l != null && clearTimeout(l), N.delete(s));
5248
+ a || (a = !0, l != null && clearTimeout(l), $.delete(s));
5249
5249
  };
5250
- N.set(s, {
5250
+ $.set(s, {
5251
5251
  resolve: (u) => {
5252
5252
  d(), n(u);
5253
5253
  },
@@ -5258,40 +5258,40 @@ function ui(e, t, r = 1400) {
5258
5258
  try {
5259
5259
  o.postMessage({ id: s, action: e, payload: t });
5260
5260
  } catch (u) {
5261
- N.delete(s), i(u);
5261
+ $.delete(s), i(u);
5262
5262
  return;
5263
5263
  }
5264
5264
  l = setTimeout(() => {
5265
5265
  const u = new Error("Worker call timed out");
5266
- u.name = "WorkerTimeout", u.code = "WORKER_TIMEOUT", N.get(s)?.reject(u);
5266
+ u.name = "WorkerTimeout", u.code = "WORKER_TIMEOUT", $.get(s)?.reject(u);
5267
5267
  }, r);
5268
5268
  });
5269
5269
  }
5270
- async function hi(e, t, r = 1400) {
5271
- return await ui("canParse", { code: e, theme: t }, r);
5270
+ async function fi(e, t, r = 1400) {
5271
+ return await mi("canParse", { code: e, theme: t }, r);
5272
5272
  }
5273
- async function mi(e, t, r = 1400) {
5274
- return await ui("findPrefix", { code: e, theme: t }, r);
5273
+ async function pi(e, t, r = 1400) {
5274
+ return await mi("findPrefix", { code: e, theme: t }, r);
5275
5275
  }
5276
- function Hd() {
5276
+ function Bd() {
5277
5277
  if (L)
5278
5278
  try {
5279
- for (const [, e] of N.entries())
5279
+ for (const [, e] of $.entries())
5280
5280
  e.reject(new Error("Worker terminated"));
5281
- N.clear(), L.terminate();
5281
+ $.clear(), L.terminate();
5282
5282
  } finally {
5283
5283
  L = null;
5284
5284
  }
5285
5285
  }
5286
- var nc = Object.defineProperty, oc = Object.getOwnPropertyDescriptor, Ne = (e, t, r, o) => {
5286
+ var nc = Object.defineProperty, oc = Object.getOwnPropertyDescriptor, $e = (e, t, r, o) => {
5287
5287
  for (var n = o > 1 ? void 0 : o ? oc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
5288
5288
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
5289
5289
  return o && n && nc(t, r, n), n;
5290
5290
  };
5291
- let eo = 0, to = Promise.resolve();
5291
+ let to = 0, ro = Promise.resolve();
5292
5292
  function ic(e) {
5293
- const t = to.then(e, e);
5294
- return to = t.then(() => {
5293
+ const t = ro.then(e, e);
5294
+ return ro = t.then(() => {
5295
5295
  }, () => {
5296
5296
  }), t;
5297
5297
  }
@@ -5336,7 +5336,7 @@ let ne = class {
5336
5336
  return typeof this.mergedProps.showTooltips == "boolean" ? this.mergedProps.showTooltips : this.context?.showTooltips !== !1;
5337
5337
  }
5338
5338
  get resolvedMaxHeight() {
5339
- return mn(this.mergedProps.maxHeight, "500px");
5339
+ return fn(this.mergedProps.maxHeight, "500px");
5340
5340
  }
5341
5341
  get resolvedWorkerTimeout() {
5342
5342
  return Be(Number(this.mergedProps.workerTimeoutMs ?? 1400), 200, 1e4);
@@ -5388,12 +5388,12 @@ let ne = class {
5388
5388
  this.showSource = e, e || this.scheduleHostSync(), this.cdr.markForCheck();
5389
5389
  }
5390
5390
  async copySource() {
5391
- await un(this.code), this.copied = !0, this.context?.events.onCopy?.(this.code), this.copyTimer != null && typeof window < "u" && window.clearTimeout(this.copyTimer), typeof window < "u" && (this.copyTimer = window.setTimeout(() => {
5391
+ await hn(this.code), this.copied = !0, this.context?.events.onCopy?.(this.code), this.copyTimer != null && typeof window < "u" && window.clearTimeout(this.copyTimer), typeof window < "u" && (this.copyTimer = window.setTimeout(() => {
5392
5392
  this.copied = !1, this.cdr.markForCheck();
5393
5393
  }, 1e3)), this.cdr.markForCheck();
5394
5394
  }
5395
5395
  exportSvg() {
5396
- this.svgMarkup && hn(this.svgMarkup, `mermaid-${Date.now()}.svg`);
5396
+ this.svgMarkup && mn(this.svgMarkup, `mermaid-${Date.now()}.svg`);
5397
5397
  }
5398
5398
  openModal() {
5399
5399
  this.svgMarkup && (this.modalOpen = !0, typeof document < "u" && (document.body.style.overflow = "hidden"), queueMicrotask(() => this.syncSvgHosts()), this.cdr.markForCheck());
@@ -5430,7 +5430,7 @@ let ne = class {
5430
5430
  const t = ++this.renderToken;
5431
5431
  this.rendering = !0, this.error = "", this.cdr.markForCheck();
5432
5432
  try {
5433
- const r = await ci(this.strictMode ? {
5433
+ const r = await ui(this.strictMode ? {
5434
5434
  startOnLoad: !1,
5435
5435
  securityLevel: "strict",
5436
5436
  suppressErrorRendering: !0,
@@ -5460,7 +5460,7 @@ let ne = class {
5460
5460
  this.rendering = !1, this.cdr.markForCheck();
5461
5461
  return;
5462
5462
  }
5463
- const i = `markstream-angular-mermaid-${++eo}`, s = this.applyThemeTo(n, o), a = await ic(() => this.withTimeout(
5463
+ const i = `markstream-angular-mermaid-${++to}`, s = this.applyThemeTo(n, o), a = await ic(() => this.withTimeout(
5464
5464
  () => Promise.resolve(r.render(i, s)),
5465
5465
  this.resolvedLoading && this.resolvedProgressiveRender ? this.resolvedRenderTimeout : this.resolvedFullRenderTimeout
5466
5466
  ));
@@ -5469,7 +5469,7 @@ let ne = class {
5469
5469
  const l = typeof a == "string" ? a : a?.svg;
5470
5470
  if (this.isBrokenMermaidSvg(l))
5471
5471
  throw new Error("Mermaid produced invalid SVG during preview");
5472
- const d = dn(l);
5472
+ const d = un(l);
5473
5473
  if (!d)
5474
5474
  throw new Error("Mermaid returned empty output.");
5475
5475
  this.svgMarkup = d, this.svgMarkup || (this.showSource = !0), this.syncSvgHosts();
@@ -5504,7 +5504,7 @@ let ne = class {
5504
5504
  }
5505
5505
  async canParseWithFallback(e, t, r, o) {
5506
5506
  try {
5507
- const a = await hi(e, t, this.resolvedWorkerTimeout);
5507
+ const a = await fi(e, t, this.resolvedWorkerTimeout);
5508
5508
  if (this.destroyed || o !== this.renderToken)
5509
5509
  throw new DOMException("Aborted", "AbortError");
5510
5510
  if (a)
@@ -5519,7 +5519,7 @@ let ne = class {
5519
5519
  throw new DOMException("Aborted", "AbortError");
5520
5520
  return !0;
5521
5521
  }
5522
- const s = `markstream-angular-mermaid-parse-${++eo}`;
5522
+ const s = `markstream-angular-mermaid-parse-${++to}`;
5523
5523
  if (await this.withTimeout(() => Promise.resolve(i.render(s, n)), this.resolvedParseTimeout), this.destroyed || o !== this.renderToken)
5524
5524
  throw new DOMException("Aborted", "AbortError");
5525
5525
  return !0;
@@ -5548,7 +5548,7 @@ let ne = class {
5548
5548
  }
5549
5549
  async findPrefixCandidate(e, t, r) {
5550
5550
  try {
5551
- const o = await mi(e, t, this.resolvedWorkerTimeout);
5551
+ const o = await pi(e, t, this.resolvedWorkerTimeout);
5552
5552
  if (this.destroyed || r !== this.renderToken)
5553
5553
  throw new DOMException("Aborted", "AbortError");
5554
5554
  if (o)
@@ -5645,25 +5645,25 @@ ${e}`;
5645
5645
  });
5646
5646
  }
5647
5647
  };
5648
- Ne([
5648
+ $e([
5649
5649
  B("previewHost")
5650
5650
  ], ne.prototype, "previewHost", 2);
5651
- Ne([
5651
+ $e([
5652
5652
  B("modalHost")
5653
5653
  ], ne.prototype, "modalHost", 2);
5654
- Ne([
5654
+ $e([
5655
5655
  c({ required: !0 })
5656
5656
  ], ne.prototype, "node", 2);
5657
- Ne([
5657
+ $e([
5658
5658
  c()
5659
5659
  ], ne.prototype, "context", 2);
5660
- Ne([
5660
+ $e([
5661
5661
  c()
5662
5662
  ], ne.prototype, "props", 2);
5663
- Ne([
5664
- ho("window:keydown", ["$event"])
5663
+ $e([
5664
+ mo("window:keydown", ["$event"])
5665
5665
  ], ne.prototype, "handleWindowKeydown", 1);
5666
- ne = Ne([
5666
+ ne = $e([
5667
5667
  b({
5668
5668
  selector: "markstream-angular-mermaid-block-node",
5669
5669
  standalone: !0,
@@ -5823,10 +5823,10 @@ let nt = class {
5823
5823
  this.segments = Yi(this.children).map((e) => {
5824
5824
  if (e.kind === "block")
5825
5825
  return e;
5826
- const t = wo(e.nodes);
5826
+ const t = xo(e.nodes);
5827
5827
  return {
5828
5828
  kind: "inline",
5829
- nodes: t ? Vi(e.nodes) : e.nodes,
5829
+ nodes: t ? qi(e.nodes) : e.nodes,
5830
5830
  mediaOnly: t
5831
5831
  };
5832
5832
  });
@@ -5912,7 +5912,7 @@ nt = Sr([
5912
5912
  changeDetection: k.OnPush
5913
5913
  })
5914
5914
  ], nt);
5915
- var lc = Object.defineProperty, cc = Object.getOwnPropertyDescriptor, fi = (e, t, r, o) => {
5915
+ var lc = Object.defineProperty, cc = Object.getOwnPropertyDescriptor, gi = (e, t, r, o) => {
5916
5916
  for (var n = o > 1 ? void 0 : o ? cc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
5917
5917
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
5918
5918
  return o && n && lc(t, r, n), n;
@@ -5922,10 +5922,10 @@ let ir = class {
5922
5922
  return w(this.node?.id);
5923
5923
  }
5924
5924
  };
5925
- fi([
5925
+ gi([
5926
5926
  c({ required: !0 })
5927
5927
  ], ir.prototype, "node", 2);
5928
- ir = fi([
5928
+ ir = gi([
5929
5929
  b({
5930
5930
  selector: "markstream-angular-reference-node",
5931
5931
  standalone: !0,
@@ -5933,26 +5933,26 @@ ir = fi([
5933
5933
  changeDetection: k.OnPush
5934
5934
  })
5935
5935
  ], ir);
5936
- function pi(e, t) {
5936
+ function On(e, t) {
5937
5937
  if (t?.renderCodeBlocksAsPre)
5938
5938
  return "pre";
5939
- const r = Gi(e);
5939
+ const r = Co(e);
5940
5940
  return r === "d2" || r === "d2lang" ? "d2" : r === "infographic" ? "infographic" : r === "mermaid" ? "mermaid" : "code";
5941
5941
  }
5942
- function Mn(e) {
5943
- return String(e?.tag || "").trim().toLowerCase() || Pi(e?.content);
5942
+ function _r(e) {
5943
+ return String(e?.tag || "").trim().toLowerCase() || Si(e?.content);
5944
5944
  }
5945
5945
  function dc(e) {
5946
- const t = Mn(e);
5946
+ const t = _r(e);
5947
5947
  return t ? {
5948
5948
  ...e,
5949
5949
  type: t,
5950
5950
  tag: t,
5951
- content: Ti(e?.content, t)
5951
+ content: Pi(e?.content, t)
5952
5952
  } : e;
5953
5953
  }
5954
5954
  function uc(e, t) {
5955
- const r = Mn(e);
5955
+ const r = _r(e);
5956
5956
  return r ? {
5957
5957
  ...e,
5958
5958
  type: t,
@@ -5962,13 +5962,35 @@ function uc(e, t) {
5962
5962
  function hc(e, t) {
5963
5963
  if (String(e?.type || "") !== "code_block")
5964
5964
  return null;
5965
- const r = pi(e, t);
5965
+ const r = On(e, t);
5966
5966
  return r === "mermaid" ? t?.mermaidProps ?? null : r === "d2" ? t?.d2Props ?? null : r === "infographic" ? t?.infographicProps ?? null : t?.codeBlockProps ?? null;
5967
5967
  }
5968
- var mc = Object.defineProperty, fc = Object.getOwnPropertyDescriptor, _r = (e, t, r, o) => {
5969
- for (var n = o > 1 ? void 0 : o ? fc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
5968
+ function mc(e, t, r) {
5969
+ const o = r ?? t?.customComponents ?? null, n = String(e?.type || "");
5970
+ if (n === "code_block") {
5971
+ const a = Co(e), l = o?.[a];
5972
+ if (l)
5973
+ return l;
5974
+ const d = On(e, t);
5975
+ if (d === "mermaid" && o?.mermaid)
5976
+ return o.mermaid;
5977
+ if (d === "d2" && o?.d2)
5978
+ return o.d2;
5979
+ if (d === "infographic" && o?.infographic)
5980
+ return o.infographic;
5981
+ if (o?.code_block)
5982
+ return o.code_block;
5983
+ }
5984
+ const i = o?.[n];
5985
+ if (i)
5986
+ return i;
5987
+ const s = _r(e);
5988
+ return s && o?.[s] ? o[s] : null;
5989
+ }
5990
+ var fc = Object.defineProperty, pc = Object.getOwnPropertyDescriptor, Mr = (e, t, r, o) => {
5991
+ for (var n = o > 1 ? void 0 : o ? pc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
5970
5992
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
5971
- return o && n && mc(t, r, n), n;
5993
+ return o && n && fc(t, r, n), n;
5972
5994
  };
5973
5995
  let ot = class {
5974
5996
  get children() {
@@ -5978,16 +6000,16 @@ let ot = class {
5978
6000
  return `${this.indexKey || "strikethrough"}-strike`;
5979
6001
  }
5980
6002
  };
5981
- _r([
6003
+ Mr([
5982
6004
  c({ required: !0 })
5983
6005
  ], ot.prototype, "node", 2);
5984
- _r([
6006
+ Mr([
5985
6007
  c()
5986
6008
  ], ot.prototype, "context", 2);
5987
- _r([
6009
+ Mr([
5988
6010
  c()
5989
6011
  ], ot.prototype, "indexKey", 2);
5990
- ot = _r([
6012
+ ot = Mr([
5991
6013
  b({
5992
6014
  selector: "markstream-angular-strikethrough-node",
5993
6015
  standalone: !0,
@@ -6004,10 +6026,10 @@ ot = _r([
6004
6026
  changeDetection: k.OnPush
6005
6027
  })
6006
6028
  ], ot);
6007
- var pc = Object.defineProperty, gc = Object.getOwnPropertyDescriptor, Mr = (e, t, r, o) => {
6008
- for (var n = o > 1 ? void 0 : o ? gc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6029
+ var gc = Object.defineProperty, yc = Object.getOwnPropertyDescriptor, Or = (e, t, r, o) => {
6030
+ for (var n = o > 1 ? void 0 : o ? yc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6009
6031
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
6010
- return o && n && pc(t, r, n), n;
6032
+ return o && n && gc(t, r, n), n;
6011
6033
  };
6012
6034
  let it = class {
6013
6035
  get children() {
@@ -6017,16 +6039,16 @@ let it = class {
6017
6039
  return `${this.indexKey || "strong"}-strong`;
6018
6040
  }
6019
6041
  };
6020
- Mr([
6042
+ Or([
6021
6043
  c({ required: !0 })
6022
6044
  ], it.prototype, "node", 2);
6023
- Mr([
6045
+ Or([
6024
6046
  c()
6025
6047
  ], it.prototype, "context", 2);
6026
- Mr([
6048
+ Or([
6027
6049
  c()
6028
6050
  ], it.prototype, "indexKey", 2);
6029
- it = Mr([
6051
+ it = Or([
6030
6052
  b({
6031
6053
  selector: "markstream-angular-strong-node",
6032
6054
  standalone: !0,
@@ -6043,10 +6065,10 @@ it = Mr([
6043
6065
  changeDetection: k.OnPush
6044
6066
  })
6045
6067
  ], it);
6046
- var yc = Object.defineProperty, vc = Object.getOwnPropertyDescriptor, Or = (e, t, r, o) => {
6047
- for (var n = o > 1 ? void 0 : o ? vc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6068
+ var vc = Object.defineProperty, wc = Object.getOwnPropertyDescriptor, Er = (e, t, r, o) => {
6069
+ for (var n = o > 1 ? void 0 : o ? wc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6048
6070
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
6049
- return o && n && yc(t, r, n), n;
6071
+ return o && n && vc(t, r, n), n;
6050
6072
  };
6051
6073
  let st = class {
6052
6074
  get children() {
@@ -6056,16 +6078,16 @@ let st = class {
6056
6078
  return `${this.indexKey || "subscript"}-sub`;
6057
6079
  }
6058
6080
  };
6059
- Or([
6081
+ Er([
6060
6082
  c({ required: !0 })
6061
6083
  ], st.prototype, "node", 2);
6062
- Or([
6084
+ Er([
6063
6085
  c()
6064
6086
  ], st.prototype, "context", 2);
6065
- Or([
6087
+ Er([
6066
6088
  c()
6067
6089
  ], st.prototype, "indexKey", 2);
6068
- st = Or([
6090
+ st = Er([
6069
6091
  b({
6070
6092
  selector: "markstream-angular-subscript-node",
6071
6093
  standalone: !0,
@@ -6082,10 +6104,10 @@ st = Or([
6082
6104
  changeDetection: k.OnPush
6083
6105
  })
6084
6106
  ], st);
6085
- var wc = Object.defineProperty, xc = Object.getOwnPropertyDescriptor, Er = (e, t, r, o) => {
6086
- for (var n = o > 1 ? void 0 : o ? xc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6107
+ var xc = Object.defineProperty, bc = Object.getOwnPropertyDescriptor, Dr = (e, t, r, o) => {
6108
+ for (var n = o > 1 ? void 0 : o ? bc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6087
6109
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
6088
- return o && n && wc(t, r, n), n;
6110
+ return o && n && xc(t, r, n), n;
6089
6111
  };
6090
6112
  let at = class {
6091
6113
  get children() {
@@ -6095,16 +6117,16 @@ let at = class {
6095
6117
  return `${this.indexKey || "superscript"}-sup`;
6096
6118
  }
6097
6119
  };
6098
- Er([
6120
+ Dr([
6099
6121
  c({ required: !0 })
6100
6122
  ], at.prototype, "node", 2);
6101
- Er([
6123
+ Dr([
6102
6124
  c()
6103
6125
  ], at.prototype, "context", 2);
6104
- Er([
6126
+ Dr([
6105
6127
  c()
6106
6128
  ], at.prototype, "indexKey", 2);
6107
- at = Er([
6129
+ at = Dr([
6108
6130
  b({
6109
6131
  selector: "markstream-angular-superscript-node",
6110
6132
  standalone: !0,
@@ -6121,10 +6143,10 @@ at = Er([
6121
6143
  changeDetection: k.OnPush
6122
6144
  })
6123
6145
  ], at);
6124
- var bc = Object.defineProperty, kc = Object.getOwnPropertyDescriptor, At = (e, t, r, o) => {
6125
- for (var n = o > 1 ? void 0 : o ? kc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6146
+ var kc = Object.defineProperty, Cc = Object.getOwnPropertyDescriptor, At = (e, t, r, o) => {
6147
+ for (var n = o > 1 ? void 0 : o ? Cc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6126
6148
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
6127
- return o && n && bc(t, r, n), n;
6149
+ return o && n && kc(t, r, n), n;
6128
6150
  };
6129
6151
  let Re = class {
6130
6152
  constructor() {
@@ -6254,25 +6276,25 @@ Re = At([
6254
6276
  changeDetection: k.OnPush
6255
6277
  })
6256
6278
  ], Re);
6257
- var Cc = Object.getOwnPropertyDescriptor, Tc = (e, t, r, o) => {
6258
- for (var n = o > 1 ? void 0 : o ? Cc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6279
+ var Tc = Object.getOwnPropertyDescriptor, Pc = (e, t, r, o) => {
6280
+ for (var n = o > 1 ? void 0 : o ? Tc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6259
6281
  (s = e[i]) && (n = s(n) || n);
6260
6282
  return n;
6261
6283
  };
6262
- let Yr = class {
6284
+ let Jr = class {
6263
6285
  };
6264
- Yr = Tc([
6286
+ Jr = Pc([
6265
6287
  b({
6266
6288
  selector: "markstream-angular-thematic-break-node",
6267
6289
  standalone: !0,
6268
6290
  template: "<hr>",
6269
6291
  changeDetection: k.OnPush
6270
6292
  })
6271
- ], Yr);
6272
- var Pc = Object.defineProperty, Sc = Object.getOwnPropertyDescriptor, Dr = (e, t, r, o) => {
6273
- for (var n = o > 1 ? void 0 : o ? Sc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6293
+ ], Jr);
6294
+ var Sc = Object.defineProperty, _c = Object.getOwnPropertyDescriptor, Rr = (e, t, r, o) => {
6295
+ for (var n = o > 1 ? void 0 : o ? _c(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6274
6296
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
6275
- return o && n && Pc(t, r, n), n;
6297
+ return o && n && Sc(t, r, n), n;
6276
6298
  };
6277
6299
  let lt = class {
6278
6300
  get children() {
@@ -6282,16 +6304,16 @@ let lt = class {
6282
6304
  return `${this.indexKey || "vmr"}-container`;
6283
6305
  }
6284
6306
  };
6285
- Dr([
6307
+ Rr([
6286
6308
  c({ required: !0 })
6287
6309
  ], lt.prototype, "node", 2);
6288
- Dr([
6310
+ Rr([
6289
6311
  c()
6290
6312
  ], lt.prototype, "context", 2);
6291
- Dr([
6313
+ Rr([
6292
6314
  c()
6293
6315
  ], lt.prototype, "indexKey", 2);
6294
- lt = Dr([
6316
+ lt = Rr([
6295
6317
  b({
6296
6318
  selector: "markstream-angular-vmr-container-node",
6297
6319
  standalone: !0,
@@ -6308,41 +6330,29 @@ lt = Dr([
6308
6330
  changeDetection: k.OnPush
6309
6331
  })
6310
6332
  ], lt);
6311
- var _c = Object.defineProperty, Mc = Object.getOwnPropertyDescriptor, Rr = (e, t, r, o) => {
6312
- for (var n = o > 1 ? void 0 : o ? Mc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6333
+ var Mc = Object.defineProperty, Oc = Object.getOwnPropertyDescriptor, Ir = (e, t, r, o) => {
6334
+ for (var n = o > 1 ? void 0 : o ? Oc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6313
6335
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
6314
- return o && n && _c(t, r, n), n;
6336
+ return o && n && Mc(t, r, n), n;
6315
6337
  };
6316
6338
  let he = class {
6317
6339
  get resolvedType() {
6318
6340
  return String(this.node?.type || "");
6319
6341
  }
6320
6342
  get customComponentMap() {
6321
- return this.context?.customComponents || vo(this.context?.customId);
6343
+ return this.context?.customComponents || wo(this.context?.customId);
6322
6344
  }
6323
6345
  get resolvedCustomComponent() {
6324
- const e = this.customComponentMap, t = e?.[this.resolvedType];
6325
- if (t)
6326
- return t;
6327
- if (this.resolvedType === "code_block") {
6328
- if (this.codeMode === "mermaid" && e?.mermaid)
6329
- return e.mermaid;
6330
- if (this.codeMode === "d2" && e?.d2)
6331
- return e.d2;
6332
- if (this.codeMode === "infographic" && e?.infographic)
6333
- return e.infographic;
6334
- }
6335
- const r = this.htmlTag;
6336
- return r && e?.[r] ? e[r] : null;
6346
+ return mc(this.node, this.context, this.customComponentMap);
6337
6347
  }
6338
6348
  get customNode() {
6339
6349
  return dc(this.node);
6340
6350
  }
6341
6351
  get codeMode() {
6342
- return pi(this.node, this.context);
6352
+ return On(this.node, this.context);
6343
6353
  }
6344
6354
  get htmlTag() {
6345
- return Mn(this.node);
6355
+ return _r(this.node);
6346
6356
  }
6347
6357
  /**
6348
6358
  * Check if this HTML tag should be escaped (rendered as text) instead of being parsed as HTML.
@@ -6358,7 +6368,7 @@ let he = class {
6358
6368
  if (e !== "html_block" && e !== "html_inline")
6359
6369
  return !1;
6360
6370
  const t = this.htmlTag;
6361
- return !(!t || (this.context?.customHtmlTags ?? []).some((n) => String(n).toLowerCase() === t) || Si.has(t) || _i(this.node?.content ?? this.node?.raw, t));
6371
+ return !(!t || (this.context?.customHtmlTags ?? []).some((n) => String(n).toLowerCase() === t) || _i.has(t) || Mi(this.node?.content ?? this.node?.raw, t));
6362
6372
  }
6363
6373
  /**
6364
6374
  * Returns a text node for incomplete non-whitelisted, non-standard HTML tags.
@@ -6381,16 +6391,16 @@ let he = class {
6381
6391
  return hc(this.node, this.context);
6382
6392
  }
6383
6393
  };
6384
- Rr([
6394
+ Ir([
6385
6395
  c({ required: !0 })
6386
6396
  ], he.prototype, "node", 2);
6387
- Rr([
6397
+ Ir([
6388
6398
  c()
6389
6399
  ], he.prototype, "context", 2);
6390
- Rr([
6400
+ Ir([
6391
6401
  c()
6392
6402
  ], he.prototype, "indexKey", 2);
6393
- he = Rr([
6403
+ he = Ir([
6394
6404
  b({
6395
6405
  selector: "markstream-angular-node-outlet",
6396
6406
  standalone: !0,
@@ -6409,7 +6419,7 @@ he = Rr([
6409
6419
  p(() => Zt),
6410
6420
  p(() => Ge),
6411
6421
  p(() => Yt),
6412
- p(() => Vr),
6422
+ p(() => qr),
6413
6423
  p(() => Ze),
6414
6424
  p(() => Ye),
6415
6425
  p(() => Je),
@@ -6433,7 +6443,7 @@ he = Rr([
6433
6443
  p(() => at),
6434
6444
  p(() => Re),
6435
6445
  p(() => de),
6436
- p(() => Yr),
6446
+ p(() => Jr),
6437
6447
  p(() => lt)
6438
6448
  ],
6439
6449
  template: `
@@ -6532,10 +6542,10 @@ he = Rr([
6532
6542
  changeDetection: k.OnPush
6533
6543
  })
6534
6544
  ], he);
6535
- var Oc = Object.defineProperty, Ec = Object.getOwnPropertyDescriptor, W = (e, t, r, o) => {
6536
- for (var n = o > 1 ? void 0 : o ? Ec(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6545
+ var Ec = Object.defineProperty, Dc = Object.getOwnPropertyDescriptor, W = (e, t, r, o) => {
6546
+ for (var n = o > 1 ? void 0 : o ? Dc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6537
6547
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
6538
- return o && n && Oc(t, r, n), n;
6548
+ return o && n && Ec(t, r, n), n;
6539
6549
  };
6540
6550
  let S = class {
6541
6551
  constructor() {
@@ -6548,7 +6558,7 @@ let S = class {
6548
6558
  return `${this.indexPrefix}-${e}`;
6549
6559
  }
6550
6560
  get resolvedNodes() {
6551
- return Ii(
6561
+ return Ni(
6552
6562
  {
6553
6563
  node: this.node,
6554
6564
  nodes: this.nodes,
@@ -6661,20 +6671,20 @@ S = W([
6661
6671
  changeDetection: k.OnPush
6662
6672
  })
6663
6673
  ], S);
6664
- var Dc = Object.defineProperty, Rc = Object.getOwnPropertyDescriptor, Ir = (e, t, r, o) => {
6665
- for (var n = o > 1 ? void 0 : o ? Rc(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6674
+ var Rc = Object.defineProperty, Ic = Object.getOwnPropertyDescriptor, Nr = (e, t, r, o) => {
6675
+ for (var n = o > 1 ? void 0 : o ? Ic(t, r) : t, i = e.length - 1, s; i >= 0; i--)
6666
6676
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
6667
- return o && n && Dc(t, r, n), n;
6677
+ return o && n && Rc(t, r, n), n;
6668
6678
  };
6669
6679
  let ct = class {
6670
6680
  get kind() {
6671
- return xo(w(this.node?.kind || "note")) || "note";
6681
+ return bo(w(this.node?.kind || "note")) || "note";
6672
6682
  }
6673
6683
  get kindClass() {
6674
6684
  return `markstream-nested-admonition--${this.kind}`;
6675
6685
  }
6676
6686
  get resolvedTitle() {
6677
- return w(this.node?.title) || Xi(this.kind);
6687
+ return w(this.node?.title) || Gi(this.kind);
6678
6688
  }
6679
6689
  get children() {
6680
6690
  return E(this.node?.children);
@@ -6683,16 +6693,16 @@ let ct = class {
6683
6693
  return `${this.indexKey || "admonition"}-children`;
6684
6694
  }
6685
6695
  };
6686
- Ir([
6696
+ Nr([
6687
6697
  c({ required: !0 })
6688
6698
  ], ct.prototype, "node", 2);
6689
- Ir([
6699
+ Nr([
6690
6700
  c()
6691
6701
  ], ct.prototype, "context", 2);
6692
- Ir([
6702
+ Nr([
6693
6703
  c()
6694
6704
  ], ct.prototype, "indexKey", 2);
6695
- ct = Ir([
6705
+ ct = Nr([
6696
6706
  b({
6697
6707
  selector: "markstream-angular-admonition-node",
6698
6708
  standalone: !0,
@@ -6712,8 +6722,8 @@ ct = Ir([
6712
6722
  changeDetection: k.OnPush
6713
6723
  })
6714
6724
  ], ct);
6715
- let gi = 0;
6716
- const qt = /* @__PURE__ */ new WeakMap(), Ic = {
6725
+ let yi = 0;
6726
+ const qt = /* @__PURE__ */ new WeakMap(), Nc = {
6717
6727
  N1: "#E5E7EB",
6718
6728
  N2: "#CBD5E1",
6719
6729
  N3: "#94A3B8",
@@ -6749,8 +6759,8 @@ const qt = /* @__PURE__ */ new WeakMap(), Ic = {
6749
6759
  vue: "html",
6750
6760
  yml: "yaml"
6751
6761
  };
6752
- async function Nc(e, t = {}) {
6753
- yi(e);
6762
+ async function Ac(e, t = {}) {
6763
+ vi(e);
6754
6764
  const r = [];
6755
6765
  let o = !1;
6756
6766
  const n = () => !o && t.isCancelled?.() !== !0, i = {
@@ -6766,54 +6776,54 @@ async function Nc(e, t = {}) {
6766
6776
  }
6767
6777
  }
6768
6778
  };
6769
- if (qt.set(e, i), !n() || (await Ac(e, n), !n()) || (await Lc(e, r, t, n), !n()))
6779
+ if (qt.set(e, i), !n() || (await Lc(e, n), !n()) || (await Hc(e, r, t, n), !n()))
6770
6780
  return i;
6771
6781
  if (t.final !== !1) {
6772
- if (await Kc(e, r, t, n), !n() || (await zc(e, r, t, n), !n()))
6782
+ if (await zc(e, r, t, n), !n() || (await jc(e, r, t, n), !n()))
6773
6783
  return i;
6774
- t.renderCodeBlocksAsPre || await jc(e, r, t, n);
6784
+ t.renderCodeBlocksAsPre || await Wc(e, r, t, n);
6775
6785
  }
6776
6786
  return i;
6777
6787
  }
6778
- function yi(e) {
6788
+ function vi(e) {
6779
6789
  if (!e)
6780
6790
  return;
6781
6791
  qt.get(e)?.dispose();
6782
6792
  }
6783
- function ro(e, t) {
6793
+ function no(e, t) {
6784
6794
  const r = e.querySelector(t);
6785
6795
  return {
6786
6796
  sourceElement: r,
6787
6797
  source: (r?.textContent || (r ? "" : e.textContent) || "").trim()
6788
6798
  };
6789
6799
  }
6790
- function Jr(e, t) {
6800
+ function Qr(e, t) {
6791
6801
  return e.querySelector(t);
6792
6802
  }
6793
- function no(e, t) {
6794
- return !!(Jr(e, t) || e).querySelector(".katex, .katex-display");
6803
+ function oo(e, t) {
6804
+ return !!(Qr(e, t) || e).querySelector(".katex, .katex-display");
6795
6805
  }
6796
- function oo(e, t, r, o = {}) {
6806
+ function io(e, t, r, o = {}) {
6797
6807
  t ? t.innerHTML = r : e.innerHTML = r, e.dataset.markstreamKatex = "1", o.renderedClass && e.classList.add(o.renderedClass);
6798
6808
  }
6799
6809
  function zt(e, t, r = {}) {
6800
6810
  t && (t.innerHTML = ""), delete e.dataset.markstreamKatex, delete e.dataset.markstreamKatexSource, r.renderedClass && e.classList.remove(r.renderedClass);
6801
6811
  }
6802
- async function Ac(e, t) {
6812
+ async function Lc(e, t) {
6803
6813
  const r = Array.from(e.querySelectorAll(".markstream-nested-math"));
6804
6814
  for (const n of r) {
6805
6815
  if (!t())
6806
6816
  return;
6807
6817
  if (n.dataset.markstreamKatexManaged === "1")
6808
6818
  continue;
6809
- const { source: i } = ro(n, ".markstream-nested-math__source"), s = Jr(n, ".markstream-nested-math__render");
6819
+ const { source: i } = no(n, ".markstream-nested-math__source"), s = Qr(n, ".markstream-nested-math__render");
6810
6820
  if (!i) {
6811
6821
  zt(n, s);
6812
6822
  continue;
6813
6823
  }
6814
- if (!(n.dataset.markstreamKatex === "1" && n.dataset.markstreamKatexSource === i && no(n, ".markstream-nested-math__render")))
6824
+ if (!(n.dataset.markstreamKatex === "1" && n.dataset.markstreamKatexSource === i && oo(n, ".markstream-nested-math__render")))
6815
6825
  try {
6816
- oo(n, s, await io(i, n.dataset.display === "block")), n.dataset.markstreamKatexSource = i;
6826
+ io(n, s, await so(i, n.dataset.display === "block")), n.dataset.markstreamKatexSource = i;
6817
6827
  } catch {
6818
6828
  zt(n, s);
6819
6829
  }
@@ -6824,14 +6834,14 @@ async function Ac(e, t) {
6824
6834
  return;
6825
6835
  if (n.dataset.markstreamKatexManaged === "1")
6826
6836
  continue;
6827
- const { source: i } = ro(n, ".markstream-nested-math-block__source"), s = Jr(n, ".markstream-nested-math-block__render");
6837
+ const { source: i } = no(n, ".markstream-nested-math-block__source"), s = Qr(n, ".markstream-nested-math-block__render");
6828
6838
  if (!i) {
6829
6839
  zt(n, s, { renderedClass: "markstream-nested-math-block--rendered" });
6830
6840
  continue;
6831
6841
  }
6832
- if (!(n.dataset.markstreamKatex === "1" && n.dataset.markstreamKatexSource === i && no(n, ".markstream-nested-math-block__render")))
6842
+ if (!(n.dataset.markstreamKatex === "1" && n.dataset.markstreamKatexSource === i && oo(n, ".markstream-nested-math-block__render")))
6833
6843
  try {
6834
- oo(n, s, await io(i, !0), {
6844
+ io(n, s, await so(i, !0), {
6835
6845
  renderedClass: "markstream-nested-math-block--rendered"
6836
6846
  }), n.dataset.markstreamKatexSource = i;
6837
6847
  } catch {
@@ -6839,30 +6849,30 @@ async function Ac(e, t) {
6839
6849
  }
6840
6850
  }
6841
6851
  }
6842
- async function io(e, t) {
6843
- const r = $t(e);
6852
+ async function so(e, t) {
6853
+ const r = Nt(e);
6844
6854
  try {
6845
- return await Cn(r, t, {
6855
+ return await Tn(r, t, {
6846
6856
  timeout: 1500,
6847
6857
  waitTimeout: 0,
6848
6858
  maxRetries: 0
6849
6859
  });
6850
6860
  } catch (i) {
6851
6861
  const s = i?.code || i?.name;
6852
- if (!(s === "WORKER_INIT_ERROR" || i?.fallbackToRenderer) && !(s === Nt || s === "WORKER_TIMEOUT"))
6862
+ if (!(s === "WORKER_INIT_ERROR" || i?.fallbackToRenderer) && !(s === $t || s === "WORKER_TIMEOUT"))
6853
6863
  throw i;
6854
6864
  }
6855
- const o = await bn();
6865
+ const o = await kn();
6856
6866
  if (!o)
6857
6867
  throw new Error("KaTeX renderer is not available.");
6858
6868
  const n = o.renderToString(r, {
6859
6869
  displayMode: t,
6860
6870
  throwOnError: !1
6861
6871
  });
6862
- return kn(r, t, n), n;
6872
+ return Cn(r, t, n), n;
6863
6873
  }
6864
- async function Lc(e, t, r, o) {
6865
- const n = await ci({
6874
+ async function Hc(e, t, r, o) {
6875
+ const n = await ui({
6866
6876
  startOnLoad: !1,
6867
6877
  securityLevel: "loose",
6868
6878
  suppressErrorRendering: !0
@@ -6892,11 +6902,11 @@ async function Lc(e, t, r, o) {
6892
6902
  let f = l;
6893
6903
  if (r.final === !1)
6894
6904
  try {
6895
- await Hc(l, h, n, r);
6905
+ await Bc(l, h, n, r);
6896
6906
  } catch (P) {
6897
6907
  if (P?.name === "AbortError")
6898
6908
  return;
6899
- const v = await Bc(l, h, r);
6909
+ const v = await Fc(l, h, r);
6900
6910
  if (!o())
6901
6911
  return;
6902
6912
  if (!v) {
@@ -6905,8 +6915,8 @@ async function Lc(e, t, r, o) {
6905
6915
  }
6906
6916
  f = v;
6907
6917
  }
6908
- const m = `markstream-angular-mermaid-${++gi}`, g = await Qr(
6909
- () => Promise.resolve(n.render(m, vi(f, h))),
6918
+ const m = `markstream-angular-mermaid-${++yi}`, g = await en(
6919
+ () => Promise.resolve(n.render(m, wi(f, h))),
6910
6920
  r.final === !1 ? Number(r.mermaidProps?.renderTimeoutMs ?? 2500) : Number(r.mermaidProps?.fullRenderTimeoutMs ?? 4e3)
6911
6921
  );
6912
6922
  if (!o())
@@ -6922,38 +6932,38 @@ async function Lc(e, t, r, o) {
6922
6932
  }
6923
6933
  }
6924
6934
  }
6925
- function vi(e, t) {
6935
+ function wi(e, t) {
6926
6936
  return e.trimStart().startsWith("%%{") ? e : `%%{init: {"theme": "${t === "dark" ? "dark" : "default"}"}}%%
6927
6937
  ${e}`;
6928
6938
  }
6929
- async function Hc(e, t, r, o) {
6939
+ async function Bc(e, t, r, o) {
6930
6940
  const n = Number(o.mermaidProps?.workerTimeoutMs ?? 1400), i = Number(o.mermaidProps?.parseTimeoutMs ?? 1800);
6931
6941
  try {
6932
- if (await hi(e, t, n))
6942
+ if (await fi(e, t, n))
6933
6943
  return !0;
6934
6944
  } catch (l) {
6935
6945
  if (l?.name === "AbortError")
6936
6946
  throw l;
6937
6947
  }
6938
- const s = vi(e, t);
6948
+ const s = wi(e, t);
6939
6949
  if (typeof r?.parse == "function")
6940
- return await Qr(() => Promise.resolve(r.parse(s)), i), !0;
6941
- const a = `markstream-angular-mermaid-parse-${++gi}`;
6942
- return await Qr(() => Promise.resolve(r.render(a, s)), i), !0;
6950
+ return await en(() => Promise.resolve(r.parse(s)), i), !0;
6951
+ const a = `markstream-angular-mermaid-parse-${++yi}`;
6952
+ return await en(() => Promise.resolve(r.render(a, s)), i), !0;
6943
6953
  }
6944
- async function Bc(e, t, r) {
6954
+ async function Fc(e, t, r) {
6945
6955
  const o = Number(r.mermaidProps?.workerTimeoutMs ?? 1400);
6946
6956
  try {
6947
- const n = await mi(e, t, o);
6957
+ const n = await pi(e, t, o);
6948
6958
  if (n)
6949
6959
  return n;
6950
6960
  } catch (n) {
6951
6961
  if (n?.name === "AbortError")
6952
6962
  throw n;
6953
6963
  }
6954
- return Fc(e);
6964
+ return Kc(e);
6955
6965
  }
6956
- function Fc(e) {
6966
+ function Kc(e) {
6957
6967
  const t = e.split(`
6958
6968
  `);
6959
6969
  for (; t.length > 0; ) {
@@ -6969,7 +6979,7 @@ function Fc(e) {
6969
6979
  return t.join(`
6970
6980
  `);
6971
6981
  }
6972
- function Qr(e, t) {
6982
+ function en(e, t) {
6973
6983
  return !t || t <= 0 ? e() : new Promise((r, o) => {
6974
6984
  let n = !1;
6975
6985
  const i = globalThis.setTimeout(() => {
@@ -6982,8 +6992,8 @@ function Qr(e, t) {
6982
6992
  });
6983
6993
  });
6984
6994
  }
6985
- async function Kc(e, t, r, o) {
6986
- const n = await Ko();
6995
+ async function zc(e, t, r, o) {
6996
+ const n = await jo();
6987
6997
  if (!n || !o())
6988
6998
  return;
6989
6999
  const i = Array.from(e.querySelectorAll('pre[data-markstream-code-block="1"] > code.language-infographic'));
@@ -7016,8 +7026,8 @@ async function Kc(e, t, r, o) {
7016
7026
  }
7017
7027
  }
7018
7028
  }
7019
- async function zc(e, t, r, o) {
7020
- const n = await Mo();
7029
+ async function jc(e, t, r, o) {
7030
+ const n = await Eo();
7021
7031
  if (!n || !o())
7022
7032
  return;
7023
7033
  const i = Array.from(e.querySelectorAll('pre[data-markstream-code-block="1"] > code.language-d2, pre[data-markstream-code-block="1"] > code.language-d2lang'));
@@ -7032,21 +7042,21 @@ async function zc(e, t, r, o) {
7032
7042
  });
7033
7043
  a.replaceWith(u.wrapper);
7034
7044
  try {
7035
- const h = Wc(n);
7045
+ const h = Vc(n);
7036
7046
  if (!h || typeof h.compile != "function" || typeof h.render != "function")
7037
7047
  throw new TypeError("D2 instance is missing compile/render methods.");
7038
7048
  const f = await h.compile(l), m = f?.diagram ?? f, g = f?.renderOptions ?? f?.options ?? {}, y = r.d2ThemeId ?? g.themeID, P = r.d2DarkThemeId ?? g.darkThemeID, v = { ...g };
7039
7049
  if (v.themeID = r.isDark && P != null ? P : y, v.darkThemeID = null, v.darkThemeOverrides = null, r.isDark) {
7040
- const $ = g.themeOverrides && typeof g.themeOverrides == "object" ? g.themeOverrides : null;
7050
+ const N = g.themeOverrides && typeof g.themeOverrides == "object" ? g.themeOverrides : null;
7041
7051
  v.themeOverrides = {
7042
- ...Ic,
7043
- ...$ || {}
7052
+ ...Nc,
7053
+ ...N || {}
7044
7054
  };
7045
7055
  }
7046
7056
  const M = await h.render(m, v);
7047
7057
  if (!o())
7048
7058
  return;
7049
- const D = dn(Oo(M));
7059
+ const D = un(Do(M));
7050
7060
  if (!D)
7051
7061
  throw new Error("D2 render returned empty output.");
7052
7062
  u.body.innerHTML = D, u.wrapper.dataset.markstreamD2 = "1", t.push(() => {
@@ -7057,8 +7067,8 @@ async function zc(e, t, r, o) {
7057
7067
  }
7058
7068
  }
7059
7069
  }
7060
- async function jc(e, t, r, o) {
7061
- const n = await Po();
7070
+ async function Wc(e, t, r, o) {
7071
+ const n = await _o();
7062
7072
  if (!n || typeof n.useMonaco != "function" || !o())
7063
7073
  return;
7064
7074
  const i = Array.from(e.querySelectorAll('pre[data-markstream-code-block="1"]'));
@@ -7068,10 +7078,10 @@ async function jc(e, t, r, o) {
7068
7078
  const a = s.querySelector("code");
7069
7079
  if (!a)
7070
7080
  continue;
7071
- const l = Vc(s, a), d = l.trim().toLowerCase();
7081
+ const l = qc(s, a), d = l.trim().toLowerCase();
7072
7082
  if (d === "mermaid" || d === "infographic" || d === "d2" || d === "d2lang")
7073
7083
  continue;
7074
- const u = a.textContent || "", h = s.dataset.markstreamDiff === "1", f = Xc(s.dataset.markstreamUpdated), m = qc(l), g = h ? "plaintext" : m, y = $r(
7084
+ const u = a.textContent || "", h = s.dataset.markstreamDiff === "1", f = Gc(s.dataset.markstreamUpdated), m = Uc(l), g = h ? "plaintext" : m, y = $r(
7075
7085
  "code",
7076
7086
  h ? `Diff / ${m}` : `Code / ${m}`,
7077
7087
  u,
@@ -7081,7 +7091,7 @@ async function jc(e, t, r, o) {
7081
7091
  showHeader: r.codeBlockProps?.showHeader !== !1
7082
7092
  }
7083
7093
  );
7084
- y.body.classList.add("markstream-angular-enhanced-block__body--code"), y.body.style.minHeight = `${Uc(h && f || u, h)}px`;
7094
+ y.body.classList.add("markstream-angular-enhanced-block__body--code"), y.body.style.minHeight = `${Xc(h && f || u, h)}px`;
7085
7095
  const P = s.cloneNode(!0);
7086
7096
  s.replaceWith(y.wrapper);
7087
7097
  const v = n.useMonaco({
@@ -7119,7 +7129,7 @@ async function jc(e, t, r, o) {
7119
7129
  }
7120
7130
  }
7121
7131
  }
7122
- function Wc(e) {
7132
+ function Vc(e) {
7123
7133
  if (typeof e == "function") {
7124
7134
  const t = new e();
7125
7135
  if (t && typeof t.compile == "function")
@@ -7129,23 +7139,23 @@ function Wc(e) {
7129
7139
  }
7130
7140
  return e?.D2 && typeof e.D2 == "function" ? new e.D2() : typeof e?.compile == "function" ? e : null;
7131
7141
  }
7132
- function Vc(e, t) {
7142
+ function qc(e, t) {
7133
7143
  const r = e.dataset.markstreamLanguage?.trim();
7134
7144
  if (r)
7135
7145
  return r;
7136
7146
  const o = Array.from(t.classList).find((n) => n.startsWith("language-"));
7137
7147
  return o ? o.slice(9) : "plaintext";
7138
7148
  }
7139
- function qc(e) {
7149
+ function Uc(e) {
7140
7150
  const t = e.trim().toLowerCase();
7141
7151
  return $c[t] || t || "plaintext";
7142
7152
  }
7143
- function Uc(e, t) {
7153
+ function Xc(e, t) {
7144
7154
  const r = Math.max(1, e.split(`
7145
7155
  `).length);
7146
7156
  return Math.min(520, (t ? 180 : 96) + r * (t ? 20 : 18));
7147
7157
  }
7148
- function Xc(e) {
7158
+ function Gc(e) {
7149
7159
  if (!e)
7150
7160
  return "";
7151
7161
  const t = globalThis?.require?.("buffer")?.Buffer;
@@ -7163,7 +7173,7 @@ function $r(e, t, r, o, n, i = {}) {
7163
7173
  const l = document.createElement("div");
7164
7174
  l.className = "markstream-angular-enhanced-block__header";
7165
7175
  const d = document.createElement("span");
7166
- d.className = "markstream-angular-enhanced-block__badge", d.textContent = t, l.appendChild(d), l.appendChild(Gc(r, n)), s.appendChild(l);
7176
+ d.className = "markstream-angular-enhanced-block__badge", d.textContent = t, l.appendChild(d), l.appendChild(Zc(r, n)), s.appendChild(l);
7167
7177
  }
7168
7178
  const a = document.createElement("div");
7169
7179
  if (a.className = "markstream-angular-enhanced-block__body", s.appendChild(a), o) {
@@ -7178,15 +7188,15 @@ function $r(e, t, r, o, n, i = {}) {
7178
7188
  }
7179
7189
  return { wrapper: s, body: a };
7180
7190
  }
7181
- function Gc(e, t) {
7191
+ function Zc(e, t) {
7182
7192
  const r = document.createElement("div");
7183
7193
  r.className = "markstream-angular-enhanced-block__actions";
7184
7194
  const o = document.createElement("button");
7185
7195
  return o.type = "button", o.className = "markstream-angular-enhanced-block__action", o.textContent = "Copy", t.showTooltips !== !1 && (o.title = "Copy source"), o.addEventListener("click", () => {
7186
- Zc(e), t.onCopy?.(e);
7196
+ Yc(e), t.onCopy?.(e);
7187
7197
  }), r.appendChild(o), r;
7188
7198
  }
7189
- async function Zc(e) {
7199
+ async function Yc(e) {
7190
7200
  try {
7191
7201
  if (typeof navigator < "u" && navigator.clipboard?.writeText) {
7192
7202
  await navigator.clipboard.writeText(e);
@@ -7205,21 +7215,21 @@ async function Zc(e) {
7205
7215
  t.remove();
7206
7216
  }
7207
7217
  }
7208
- const Yc = 32, Jc = 900;
7209
- function Qc(e, t) {
7218
+ const Jc = 32, Qc = 900;
7219
+ function ed(e, t) {
7210
7220
  const r = Math.trunc(t ?? 320);
7211
7221
  if (!Number.isFinite(r) || r <= 0)
7212
7222
  return !1;
7213
7223
  const o = Math.max(1, r);
7214
7224
  return e > o;
7215
7225
  }
7216
- function ed(e) {
7226
+ function td(e) {
7217
7227
  if (e.deferNodesUntilVisible === !1)
7218
7228
  return !1;
7219
7229
  const t = Math.trunc(e.maxLiveNodes ?? 320);
7220
- return !Number.isFinite(t) || t <= 0 || e.virtualizationEnabled || e.parsedNodeCount > Jc ? !1 : e.viewportPriority !== !1;
7230
+ return !Number.isFinite(t) || t <= 0 || e.virtualizationEnabled || e.parsedNodeCount > Qc ? !1 : e.viewportPriority !== !1;
7221
7231
  }
7222
- function td(e, t = Yc) {
7232
+ function rd(e, t = Jc) {
7223
7233
  if (!e.size)
7224
7234
  return t;
7225
7235
  let r = 0;
@@ -7227,7 +7237,7 @@ function td(e, t = Yc) {
7227
7237
  r += o;
7228
7238
  return Math.max(16, r / e.size);
7229
7239
  }
7230
- function so(e, t, r, o) {
7240
+ function ao(e, t, r, o) {
7231
7241
  if (e >= t)
7232
7242
  return 0;
7233
7243
  let n = 0;
@@ -7235,7 +7245,7 @@ function so(e, t, r, o) {
7235
7245
  n += r.get(i) ?? o;
7236
7246
  return n;
7237
7247
  }
7238
- function ao(e, t, r, o) {
7248
+ function lo(e, t, r, o) {
7239
7249
  if (!e)
7240
7250
  return { start: 0, end: 0 };
7241
7251
  const n = Math.max(1, Math.trunc(r ?? 320)), i = Math.max(0, Math.trunc(o ?? 60)), s = Math.max(0, Math.min(Math.trunc(t), e - 1));
@@ -7253,15 +7263,15 @@ function ao(e, t, r, o) {
7253
7263
  end: Math.max(0, Math.min(Math.max(l, a), e))
7254
7264
  };
7255
7265
  }
7256
- var rd = Object.defineProperty, nd = Object.getOwnPropertyDescriptor, C = (e, t, r, o) => {
7257
- for (var n = o > 1 ? void 0 : o ? nd(t, r) : t, i = e.length - 1, s; i >= 0; i--)
7266
+ var nd = Object.defineProperty, od = Object.getOwnPropertyDescriptor, C = (e, t, r, o) => {
7267
+ for (var n = o > 1 ? void 0 : o ? od(t, r) : t, i = e.length - 1, s; i >= 0; i--)
7258
7268
  (s = e[i]) && (n = (o ? s(t, r, n) : s(n)) || n);
7259
- return o && n && rd(t, r, n), n;
7269
+ return o && n && nd(t, r, n), n;
7260
7270
  };
7261
- const lo = /auto|scroll|overlay/i;
7271
+ const co = /auto|scroll|overlay/i;
7262
7272
  let x = class {
7263
7273
  constructor() {
7264
- this.cdr = X(me), this.hostRef = X(uo), this.content = "", this.codeBlockStream = !0, this.renderCodeBlocksAsPre = !1, this.showTooltips = !0, this.isDark = !1, this.typewriter = !0, this.batchRendering = !0, this.initialRenderBatchSize = 40, this.renderBatchSize = 80, this.renderBatchDelay = 16, this.renderBatchBudgetMs = 6, this.renderBatchIdleTimeoutMs = 120, this.deferNodesUntilVisible = !0, this.maxLiveNodes = 320, this.liveNodeBuffer = 60, this.allowHtml = !0, this.copy = new mt(), this.handleArtifactClick = new mt(), this.click = new mt(), this.mouseover = new mt(), this.mouseout = new mt(), this.parsedNodes = [], this.visibleEntries = [], this.renderContext = { events: {} }, this.topSpacerHeight = 0, this.bottomSpacerHeight = 0, this.renderedCount = 0, this.focusIndex = 0, this.liveRange = { start: 0, end: 0 }, this.nodeHeights = /* @__PURE__ */ new Map(), this.nodeVisibility = /* @__PURE__ */ new Set(), this.nodeSeen = /* @__PURE__ */ new Set(), this.textStreamState = /* @__PURE__ */ new Map(), this.streamRenderVersion = 0, this.slotElements = /* @__PURE__ */ new Map(), this.observedElements = /* @__PURE__ */ new Map(), this.observer = null, this.observerConfig = null, this.observerIndexByElement = /* @__PURE__ */ new Map(), this.batchTimer = null, this.batchRaf = null, this.batchIdle = null, this.batchPending = !1, this.enhancementToken = 0, this.enhancementTimer = null, this.enhancementHandle = null, this.postRenderTimer = null, this.trackByEntry = (e, t) => `${this.resolvedIndexPrefix}-${t.index}`;
7274
+ this.cdr = X(me), this.hostRef = X(ho), this.content = "", this.codeBlockStream = !0, this.renderCodeBlocksAsPre = !1, this.showTooltips = !0, this.isDark = !1, this.typewriter = !0, this.batchRendering = !0, this.initialRenderBatchSize = 40, this.renderBatchSize = 80, this.renderBatchDelay = 16, this.renderBatchBudgetMs = 6, this.renderBatchIdleTimeoutMs = 120, this.deferNodesUntilVisible = !0, this.maxLiveNodes = 320, this.liveNodeBuffer = 60, this.allowHtml = !0, this.copy = new mt(), this.handleArtifactClick = new mt(), this.click = new mt(), this.mouseover = new mt(), this.mouseout = new mt(), this.parsedNodes = [], this.visibleEntries = [], this.renderContext = { events: {} }, this.topSpacerHeight = 0, this.bottomSpacerHeight = 0, this.renderedCount = 0, this.focusIndex = 0, this.liveRange = { start: 0, end: 0 }, this.nodeHeights = /* @__PURE__ */ new Map(), this.nodeVisibility = /* @__PURE__ */ new Set(), this.nodeSeen = /* @__PURE__ */ new Set(), this.textStreamState = /* @__PURE__ */ new Map(), this.streamRenderVersion = 0, this.slotElements = /* @__PURE__ */ new Map(), this.observedElements = /* @__PURE__ */ new Map(), this.observer = null, this.observerConfig = null, this.observerIndexByElement = /* @__PURE__ */ new Map(), this.batchTimer = null, this.batchRaf = null, this.batchIdle = null, this.batchPending = !1, this.enhancementToken = 0, this.enhancementTimer = null, this.enhancementHandle = null, this.postRenderTimer = null, this.trackByEntry = (e, t) => `${this.resolvedIndexPrefix}-${t.index}`;
7265
7275
  }
7266
7276
  get resolvedIndexPrefix() {
7267
7277
  return this.indexKey != null ? String(this.indexKey) : "renderer";
@@ -7286,13 +7296,13 @@ let x = class {
7286
7296
  return this.viewportPriority !== !1;
7287
7297
  }
7288
7298
  get virtualizationEnabled() {
7289
- return Qc(this.parsedNodes.length, this.maxLiveNodes);
7299
+ return ed(this.parsedNodes.length, this.maxLiveNodes);
7290
7300
  }
7291
7301
  get incrementalRenderingActive() {
7292
7302
  return this.batchRendering !== !1 && typeof window < "u" && !this.liveWindowEnabled && !this.virtualizationEnabled && this.parsedNodes.length > this.resolvedInitialBatchSize;
7293
7303
  }
7294
7304
  get deferNodesActive() {
7295
- return ed({
7305
+ return td({
7296
7306
  deferNodesUntilVisible: this.deferNodesUntilVisible,
7297
7307
  maxLiveNodes: this.maxLiveNodes,
7298
7308
  parsedNodeCount: this.parsedNodes.length,
@@ -7307,7 +7317,7 @@ let x = class {
7307
7317
  (e.content || e.nodes) && (this.streamRenderVersion += 1), this.rebuild();
7308
7318
  }
7309
7319
  ngOnInit() {
7310
- this.unsubscribeCustomComponents = Bi(() => {
7320
+ this.unsubscribeCustomComponents = Fi(() => {
7311
7321
  this.rebuild();
7312
7322
  });
7313
7323
  }
@@ -7328,14 +7338,14 @@ let x = class {
7328
7338
  }
7329
7339
  rebuild() {
7330
7340
  this.stopBatching(), this.disposeEnhancements(), this.cleanupTransientState();
7331
- const e = vo(this.customId), t = this.customComponents ? {
7341
+ const e = wo(this.customId), t = this.customComponents ? {
7332
7342
  ...e,
7333
7343
  ...this.customComponents
7334
7344
  } : e, r = {
7335
7345
  onCopy: (n) => this.copy.emit(n),
7336
7346
  onHandleArtifactClick: (n) => this.handleArtifactClick.emit(n)
7337
7347
  };
7338
- this.renderContext = Ki(
7348
+ this.renderContext = zi(
7339
7349
  {
7340
7350
  ...this,
7341
7351
  customComponents: t
@@ -7343,9 +7353,9 @@ let x = class {
7343
7353
  r,
7344
7354
  this.textStreamState,
7345
7355
  this.streamRenderVersion
7346
- ), this.parsedNodes = zi(this), this.trimMeasuredState();
7356
+ ), this.parsedNodes = ji(this), this.trimMeasuredState();
7347
7357
  const o = this.parsedNodes.length;
7348
- this.focusIndex = Math.max(0, Math.min(this.focusIndex, Math.max(0, o - 1))), this.virtualizationEnabled ? (this.renderedCount = o, this.liveRange = ao(o, this.focusIndex, this.resolvedMaxLiveNodes, this.resolvedLiveNodeBuffer)) : (this.liveRange = { start: 0, end: o }, this.renderedCount = this.incrementalRenderingActive ? Math.min(o, this.resolvedInitialBatchSize) : o), this.deferNodesActive || this.nodeVisibility.clear(), this.refreshVisibleEntries(), this.cdr.markForCheck(), this.schedulePostRenderWork(), this.incrementalRenderingActive && this.renderedCount < o && this.scheduleBatchStep();
7358
+ this.focusIndex = Math.max(0, Math.min(this.focusIndex, Math.max(0, o - 1))), this.virtualizationEnabled ? (this.renderedCount = o, this.liveRange = lo(o, this.focusIndex, this.resolvedMaxLiveNodes, this.resolvedLiveNodeBuffer)) : (this.liveRange = { start: 0, end: o }, this.renderedCount = this.incrementalRenderingActive ? Math.min(o, this.resolvedInitialBatchSize) : o), this.deferNodesActive || this.nodeVisibility.clear(), this.refreshVisibleEntries(), this.cdr.markForCheck(), this.schedulePostRenderWork(), this.incrementalRenderingActive && this.renderedCount < o && this.scheduleBatchStep();
7349
7359
  }
7350
7360
  cleanupTransientState() {
7351
7361
  this.slotElements.clear(), this.disconnectObserver();
@@ -7360,11 +7370,11 @@ let x = class {
7360
7370
  t >= e && this.nodeVisibility.delete(t);
7361
7371
  }
7362
7372
  refreshVisibleEntries() {
7363
- const e = td(this.nodeHeights), t = this.parsedNodes.length, r = this.virtualizationEnabled ? this.parsedNodes.slice(this.liveRange.start, this.liveRange.end).map((o, n) => ({
7373
+ const e = rd(this.nodeHeights), t = this.parsedNodes.length, r = this.virtualizationEnabled ? this.parsedNodes.slice(this.liveRange.start, this.liveRange.end).map((o, n) => ({
7364
7374
  node: o,
7365
7375
  index: this.liveRange.start + n
7366
7376
  })) : this.parsedNodes.map((o, n) => ({ node: o, index: n }));
7367
- this.topSpacerHeight = this.virtualizationEnabled ? so(0, Math.min(this.liveRange.start, t), this.nodeHeights, e) : 0, this.bottomSpacerHeight = this.virtualizationEnabled ? so(Math.min(this.liveRange.end, t), t, this.nodeHeights, e) : 0, this.visibleEntries = r.map(({ node: o, index: n }) => {
7377
+ this.topSpacerHeight = this.virtualizationEnabled ? ao(0, Math.min(this.liveRange.start, t), this.nodeHeights, e) : 0, this.bottomSpacerHeight = this.virtualizationEnabled ? ao(Math.min(this.liveRange.end, t), t, this.nodeHeights, e) : 0, this.visibleEntries = r.map(({ node: o, index: n }) => {
7368
7378
  const i = this.shouldRenderNode(n);
7369
7379
  let s = !1;
7370
7380
  return i && this.typewriter !== !1 && String(o?.type || "") !== "code_block" && !this.nodeSeen.has(n) && (s = !0, this.nodeSeen.add(n)), {
@@ -7478,7 +7488,7 @@ let x = class {
7478
7488
  let o = e.parentElement;
7479
7489
  for (; o && !(o === t.body || o === r); ) {
7480
7490
  const n = window.getComputedStyle(o), i = (n.overflowY || "").toLowerCase(), s = (n.overflow || "").toLowerCase();
7481
- if (lo.test(i) || lo.test(s))
7491
+ if (co.test(i) || co.test(s))
7482
7492
  return o;
7483
7493
  o = o.parentElement;
7484
7494
  }
@@ -7486,7 +7496,7 @@ let x = class {
7486
7496
  }
7487
7497
  markNodeVisible(e) {
7488
7498
  let t = !1;
7489
- this.deferNodesActive && !this.nodeVisibility.has(e) && (this.nodeVisibility.add(e), t = !0), this.virtualizationEnabled && e > this.focusIndex && (this.focusIndex = e, this.liveRange = ao(
7499
+ this.deferNodesActive && !this.nodeVisibility.has(e) && (this.nodeVisibility.add(e), t = !0), this.virtualizationEnabled && e > this.focusIndex && (this.focusIndex = e, this.liveRange = lo(
7490
7500
  this.parsedNodes.length,
7491
7501
  this.focusIndex,
7492
7502
  this.resolvedMaxLiveNodes,
@@ -7539,7 +7549,7 @@ let x = class {
7539
7549
  const t = this.rootRef?.nativeElement || this.hostRef.nativeElement.querySelector(".markstream-angular");
7540
7550
  if (!t)
7541
7551
  return;
7542
- const r = await Nc(t, {
7552
+ const r = await Ac(t, {
7543
7553
  final: this.final,
7544
7554
  isDark: this.isDark,
7545
7555
  renderCodeBlocksAsPre: this.renderCodeBlocksAsPre,
@@ -7563,7 +7573,7 @@ let x = class {
7563
7573
  disposeEnhancements() {
7564
7574
  this.enhancementHandle?.dispose(), this.enhancementHandle = null;
7565
7575
  const e = this.rootRef?.nativeElement || this.hostRef.nativeElement.querySelector(".markstream-angular");
7566
- e && yi(e);
7576
+ e && vi(e);
7567
7577
  }
7568
7578
  };
7569
7579
  C([
@@ -7749,17 +7759,17 @@ x = C([
7749
7759
  changeDetection: k.OnPush
7750
7760
  })
7751
7761
  ], x);
7752
- function zr(e) {
7762
+ function jr(e) {
7753
7763
  return JSON.stringify(e);
7754
7764
  }
7755
- function od(e) {
7765
+ function id(e) {
7756
7766
  const t = e.mode ?? "classic", r = {
7757
7767
  throwOnError: !0,
7758
7768
  displayMode: !0,
7759
7769
  output: "html",
7760
7770
  strict: "ignore",
7761
7771
  ...e.renderOptions || {}
7762
- }, o = zr(r), n = zr(e.katexUrl), i = e.mhchemUrl ? zr(e.mhchemUrl) : '""';
7772
+ }, o = jr(r), n = jr(e.katexUrl), i = e.mhchemUrl ? jr(e.mhchemUrl) : '""';
7763
7773
  return t === "module" ? `
7764
7774
  let DEBUG = false
7765
7775
  let katex = null
@@ -7895,8 +7905,8 @@ globalThis.addEventListener('message', (ev) => {
7895
7905
  })
7896
7906
  `.trimStart();
7897
7907
  }
7898
- function Bd(e) {
7899
- const t = od(e);
7908
+ function Fd(e) {
7909
+ const t = id(e);
7900
7910
  if (typeof Worker > "u" || typeof URL > "u" || typeof Blob > "u")
7901
7911
  return {
7902
7912
  worker: null,
@@ -7922,11 +7932,11 @@ function Bd(e) {
7922
7932
  }
7923
7933
  return { worker: l, dispose: i, source: t };
7924
7934
  }
7925
- function co(e) {
7935
+ function uo(e) {
7926
7936
  return JSON.stringify(e);
7927
7937
  }
7928
- function id(e) {
7929
- const t = e.mode ?? "module", r = co(e.mermaidUrl), n = `
7938
+ function sd(e) {
7939
+ const t = e.mode ?? "module", r = uo(e.mermaidUrl), n = `
7930
7940
  let DEBUG = false
7931
7941
  let mermaid = null
7932
7942
  let mermaidLoadError = null
@@ -8021,7 +8031,7 @@ function initMermaidOnce() {
8021
8031
  return
8022
8032
  try {
8023
8033
  if (typeof mermaid.initialize === 'function')
8024
- mermaid.initialize(${co({
8034
+ mermaid.initialize(${uo({
8025
8035
  startOnLoad: !1,
8026
8036
  securityLevel: "loose",
8027
8037
  ...e.initializeOptions || {}
@@ -8110,8 +8120,8 @@ function loadMermaidClassic() {
8110
8120
  loadMermaidClassic()
8111
8121
  `.trimStart();
8112
8122
  }
8113
- function Fd(e) {
8114
- const t = id(e);
8123
+ function Kd(e) {
8124
+ const t = sd(e);
8115
8125
  if (typeof Worker > "u" || typeof URL > "u" || typeof Blob > "u")
8116
8126
  return {
8117
8127
  worker: null,
@@ -8151,7 +8161,7 @@ export {
8151
8161
  Zt as FootnoteAnchorNode,
8152
8162
  Ge as FootnoteNode,
8153
8163
  Yt as FootnoteReferenceNode,
8154
- Vr as HardBreakNode,
8164
+ qr as HardBreakNode,
8155
8165
  Ze as HeadingNode,
8156
8166
  Ye as HighlightNode,
8157
8167
  Je as HtmlBlockNode,
@@ -8184,69 +8194,69 @@ export {
8184
8194
  at as SuperscriptNode,
8185
8195
  Re as TableNode,
8186
8196
  de as TextNode,
8187
- Yr as ThematicBreakNode,
8197
+ Jr as ThematicBreakNode,
8188
8198
  lt as VmrContainerNode,
8189
- Nt as WORKER_BUSY_CODE,
8190
- od as buildKaTeXCDNWorkerSource,
8191
- id as buildMermaidCDNWorkerSource,
8192
- Ki as buildRenderContext,
8193
- hi as canParseOffthread,
8194
- hd as clearGlobalCustomComponents,
8195
- Td as clearKaTeXWorker,
8196
- Ld as clearMermaidWorker,
8197
- Bd as createKaTeXWorkerFromCDN,
8198
- Fd as createMermaidWorkerFromCDN,
8199
+ $t as WORKER_BUSY_CODE,
8200
+ id as buildKaTeXCDNWorkerSource,
8201
+ sd as buildMermaidCDNWorkerSource,
8202
+ zi as buildRenderContext,
8203
+ fi as canParseOffthread,
8204
+ md as clearGlobalCustomComponents,
8205
+ Pd as clearKaTeXWorker,
8206
+ Hd as clearMermaidWorker,
8207
+ Fd as createKaTeXWorkerFromCDN,
8208
+ Kd as createMermaidWorkerFromCDN,
8199
8209
  x as default,
8200
- gd as disableD2,
8201
- kd as disableKatex,
8202
- Rd as disableMermaid,
8203
- yi as disposeRenderedHtmlEnhancements,
8204
- pd as enableD2,
8205
- bd as enableKatex,
8206
- Dd as enableMermaid,
8207
- Nc as enhanceRenderedHtml,
8208
- mi as findPrefixOffthread,
8209
- cd as getCustomComponentsRevision,
8210
- vo as getCustomNodeComponents,
8211
- Ed as getKaTeXBackpressureDefaults,
8212
- Sd as getKaTeXWorkerLoad,
8213
- bn as getKatex,
8210
+ yd as disableD2,
8211
+ Cd as disableKatex,
8212
+ Id as disableMermaid,
8213
+ vi as disposeRenderedHtmlEnhancements,
8214
+ gd as enableD2,
8215
+ kd as enableKatex,
8216
+ Rd as enableMermaid,
8217
+ Ac as enhanceRenderedHtml,
8218
+ pi as findPrefixOffthread,
8219
+ dd as getCustomComponentsRevision,
8220
+ wo as getCustomNodeComponents,
8221
+ Dd as getKaTeXBackpressureDefaults,
8222
+ _d as getKaTeXWorkerLoad,
8223
+ kn as getKatex,
8214
8224
  ms as getLanguageIcon,
8215
- ci as getMermaid,
8216
- Nd as getMermaidWorkerLoad,
8217
- yd as isD2Enabled,
8218
- Md as isKaTeXWorkerBusy,
8219
- oi as isKatexEnabled,
8225
+ ui as getMermaid,
8226
+ Ad as getMermaidWorkerLoad,
8227
+ vd as isD2Enabled,
8228
+ Od as isKaTeXWorkerBusy,
8229
+ si as isKatexEnabled,
8220
8230
  Ql as isMermaidEnabled,
8221
8231
  fs as languageMap,
8222
- an as normalizeLanguageIdentifier,
8223
- Ii as parseNestedMarkdownToNodes,
8224
- ud as removeCustomComponents,
8232
+ ln as normalizeLanguageIdentifier,
8233
+ Ni as parseNestedMarkdownToNodes,
8234
+ hd as removeCustomComponents,
8225
8235
  jl as renderKaTeXInWorker,
8226
- Cn as renderKaTeXWithBackpressure,
8236
+ Tn as renderKaTeXWithBackpressure,
8227
8237
  aa as renderMarkdownNodeToHtml,
8228
- xd as renderMarkdownNodesToHtml,
8229
- vd as renderMarkdownToHtml,
8230
- wd as renderNestedMarkdownToHtml,
8238
+ bd as renderMarkdownNodesToHtml,
8239
+ wd as renderMarkdownToHtml,
8240
+ xd as renderNestedMarkdownToHtml,
8231
8241
  hs as resolveMonacoLanguageId,
8232
- zi as resolveParsedNodes,
8233
- fn as sanitizeHtmlContent,
8234
- dd as setCustomComponents,
8235
- _o as setD2Loader,
8236
- md as setDefaultI18nMap,
8237
- Od as setKaTeXBackpressureDefaults,
8238
- kn as setKaTeXCache,
8239
- Cd as setKaTeXWorker,
8240
- Pd as setKaTeXWorkerDebug,
8241
- _d as setKaTeXWorkerMaxConcurrency,
8242
- ni as setKatexLoader,
8243
- fd as setLanguageIconResolver,
8244
- li as setMermaidLoader,
8245
- Ad as setMermaidWorker,
8246
- Id as setMermaidWorkerClientDebug,
8242
+ ji as resolveParsedNodes,
8243
+ pn as sanitizeHtmlContent,
8244
+ ud as setCustomComponents,
8245
+ Oo as setD2Loader,
8246
+ fd as setDefaultI18nMap,
8247
+ Ed as setKaTeXBackpressureDefaults,
8248
+ Cn as setKaTeXCache,
8249
+ Td as setKaTeXWorker,
8250
+ Sd as setKaTeXWorkerDebug,
8251
+ Md as setKaTeXWorkerMaxConcurrency,
8252
+ ii as setKatexLoader,
8253
+ pd as setLanguageIconResolver,
8254
+ di as setMermaidLoader,
8255
+ Ld as setMermaidWorker,
8256
+ Nd as setMermaidWorkerClientDebug,
8247
8257
  $d as setMermaidWorkerMaxConcurrency,
8248
- Bi as subscribeCustomComponents,
8249
- Hd as terminateWorker,
8250
- To as useSafeI18n,
8258
+ Fi as subscribeCustomComponents,
8259
+ Bd as terminateWorker,
8260
+ So as useSafeI18n,
8251
8261
  Wl as waitForKaTeXWorkerSlot
8252
8262
  };