markstream-solid 0.0.0-stage → 2.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +120 -2
  2. package/dist/client/extended-BTbixd9o.js +38 -0
  3. package/dist/client/index.js +5640 -0
  4. package/dist/client/katexWorkerClient-ZLzkPVv_.js +260 -0
  5. package/dist/client/languageIcon-CDTPjsAQ.js +280 -0
  6. package/dist/client/mermaidWorkerClient-BAvGYsCO.js +243 -0
  7. package/dist/client/utils/index.js +31 -0
  8. package/dist/client/utils/katex-threshold.js +32 -0
  9. package/dist/client/utils/performance-monitor.js +73 -0
  10. package/dist/client/utils/safeRaf.js +27 -0
  11. package/dist/client/workers/katexCdnWorker.js +177 -0
  12. package/dist/client/workers/katexRenderer.worker.js +45 -0
  13. package/dist/client/workers/katexWorkerClient.js +16 -0
  14. package/dist/client/workers/mermaidCdnWorker.js +226 -0
  15. package/dist/client/workers/mermaidParser.worker.js +73 -0
  16. package/dist/client/workers/mermaidWorkerClient.js +13 -0
  17. package/dist/components/BuiltinNodes.d.ts +42 -0
  18. package/dist/components/CodeBlockNode.d.ts +10 -0
  19. package/dist/components/DiagramBlockNode.d.ts +27 -0
  20. package/dist/components/HtmlPreviewFrame.d.ts +10 -0
  21. package/dist/components/MarkstreamProvider.d.ts +5 -0
  22. package/dist/components/MarkstreamVirtualTimeline.d.ts +35 -0
  23. package/dist/components/MathNode.d.ts +6 -0
  24. package/dist/components/NodeRenderer.d.ts +27 -0
  25. package/dist/components/NodeSlot.d.ts +11 -0
  26. package/dist/components/PreCodeBlock.d.ts +3 -0
  27. package/dist/components/PreCodeNode.d.ts +9 -0
  28. package/dist/components/RenderNode.d.ts +11 -0
  29. package/dist/components/StreamingTextNode.d.ts +2 -0
  30. package/dist/components/ToolbarButton.d.ts +14 -0
  31. package/dist/components/ToolbarIcon.d.ts +18 -0
  32. package/dist/components/Tooltip.d.ts +13 -0
  33. package/dist/components/lifecycle.d.ts +6 -0
  34. package/dist/components/mathHeightCache.d.ts +5 -0
  35. package/dist/components/rendererModeDefaults.d.ts +4 -0
  36. package/dist/components/shared/diagram-height.d.ts +16 -0
  37. package/dist/components/shared/node-helpers.d.ts +78 -0
  38. package/dist/components/shared/node-outlet-helpers.d.ts +10 -0
  39. package/dist/components/shared/render-window.d.ts +18 -0
  40. package/dist/components/shared/reuseParsedNodes.d.ts +3 -0
  41. package/dist/components/viewport.d.ts +5 -0
  42. package/dist/components/virtualLayoutKey.d.ts +13 -0
  43. package/dist/configuration.d.ts +9 -0
  44. package/dist/customComponents.d.ts +36 -0
  45. package/dist/enhanceRenderedHtml.d.ts +25 -0
  46. package/dist/hydrateCustomTagContent.d.ts +2 -0
  47. package/dist/i18n/useSafeI18n.d.ts +4 -0
  48. package/dist/icon-themes/index.d.ts +2 -0
  49. package/dist/icon-themes/material/core.d.ts +2 -0
  50. package/dist/icon-themes/material/extended.d.ts +2 -0
  51. package/dist/icon-themes/material/index.d.ts +2 -0
  52. package/dist/icon-themes/registry.d.ts +9 -0
  53. package/dist/icon-themes/types.d.ts +11 -0
  54. package/dist/index.css +3279 -0
  55. package/dist/index.d.ts +48 -0
  56. package/dist/index.px.css +3279 -0
  57. package/dist/index.tailwind.css +3279 -0
  58. package/dist/optional/d2.d.ts +17 -0
  59. package/dist/optional/infographic.d.ts +31 -0
  60. package/dist/optional/katex.d.ts +9 -0
  61. package/dist/optional/mermaid.d.ts +27 -0
  62. package/dist/optional/streamDiffs.d.ts +29 -0
  63. package/dist/renderMarkdownHtml.d.ts +30 -0
  64. package/dist/sanitizeHtmlContent.d.ts +2 -0
  65. package/dist/server/extended-CKyCqQt3.js +69 -0
  66. package/dist/server/index.js +6264 -0
  67. package/dist/server/languageIcon-TXkIEBPf.js +353 -0
  68. package/dist/server/utils/index.js +31 -0
  69. package/dist/server/utils/katex-threshold.js +41 -0
  70. package/dist/server/utils/performance-monitor.js +120 -0
  71. package/dist/server/utils/safeRaf.js +28 -0
  72. package/dist/server/workers/katexCdnWorker.js +190 -0
  73. package/dist/server/workers/katexWorkerClient.js +373 -0
  74. package/dist/server/workers/mermaidCdnWorker.js +238 -0
  75. package/dist/server/workers/mermaidWorkerClient.js +333 -0
  76. package/dist/streamDiffsWorker.d.ts +72 -0
  77. package/dist/tailwind.d.ts +2 -0
  78. package/dist/tailwind.js +3 -0
  79. package/dist/tooltip/singletonTooltip.d.ts +7 -0
  80. package/dist/types/component-props.d.ts +253 -0
  81. package/dist/types/node-renderer-props.d.ts +333 -0
  82. package/dist/useSmoothMarkdownStream.d.ts +22 -0
  83. package/dist/utils/clipboard.d.ts +1 -0
  84. package/dist/utils/d2RenderSalt.d.ts +1 -0
  85. package/dist/utils/footnoteTarget.d.ts +1 -0
  86. package/dist/utils/index.d.ts +8 -0
  87. package/dist/utils/katex-threshold.d.ts +20 -0
  88. package/dist/utils/languageIcon.d.ts +8 -0
  89. package/dist/utils/mermaidRenderId.d.ts +1 -0
  90. package/dist/utils/normalizeKaTeXRenderInput.d.ts +1 -0
  91. package/dist/utils/performance-monitor.d.ts +121 -0
  92. package/dist/utils/resolveLanguageIcon.d.ts +2 -0
  93. package/dist/utils/safeRaf.d.ts +2 -0
  94. package/dist/utils/virtualItemMeasurement.d.ts +5 -0
  95. package/dist/virtual-adapter.d.ts +165 -0
  96. package/dist/workers/katexCdnWorker.d.ts +20 -0
  97. package/dist/workers/katexRenderer.worker.d.ts +1 -0
  98. package/dist/workers/katexWorkerClient.d.ts +35 -0
  99. package/dist/workers/mermaidCdnWorker.d.ts +15 -0
  100. package/dist/workers/mermaidParser.worker.d.ts +1 -0
  101. package/dist/workers/mermaidWorkerClient.d.ts +15 -0
  102. package/package.json +149 -3
@@ -0,0 +1,260 @@
1
+ let T = null, g = !1, K = null, y = p;
2
+ function R(e) {
3
+ const r = e?.default ?? e;
4
+ return r && typeof r.renderToString == "function" ? r : null;
5
+ }
6
+ function A() {
7
+ try {
8
+ return R(globalThis?.katex);
9
+ } catch {
10
+ return null;
11
+ }
12
+ }
13
+ function p() {
14
+ return (async () => {
15
+ const e = A();
16
+ if (e)
17
+ return e;
18
+ const r = await import("katex");
19
+ try {
20
+ await import("katex/contrib/mhchem");
21
+ } catch {
22
+ }
23
+ return R(r);
24
+ })();
25
+ }
26
+ function D() {
27
+ T = null, g = !1, K = null;
28
+ }
29
+ function B(e) {
30
+ y = e, D();
31
+ }
32
+ function j(e) {
33
+ B(e ?? p);
34
+ }
35
+ function F() {
36
+ B(null);
37
+ }
38
+ function I() {
39
+ return typeof y == "function";
40
+ }
41
+ async function U() {
42
+ const e = A();
43
+ if (e)
44
+ return T = e, T;
45
+ if (T)
46
+ return T;
47
+ if (K)
48
+ return await K;
49
+ if (g)
50
+ return null;
51
+ const r = y;
52
+ if (!r)
53
+ return g = !0, null;
54
+ K = (async () => {
55
+ try {
56
+ const t = await r(), o = R(t) ?? t;
57
+ if (o)
58
+ return T = o, T;
59
+ } catch {
60
+ }
61
+ return g = !0, null;
62
+ })();
63
+ try {
64
+ return await K;
65
+ } finally {
66
+ K = null;
67
+ }
68
+ }
69
+ function S(e) {
70
+ return e ? e.replace(/·/g, "⋅").replace(/℃/g, "°C") : "";
71
+ }
72
+ const v = "WORKER_BUSY";
73
+ let m = null, b = null, W = !1;
74
+ const l = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), C = 200, k = /* @__PURE__ */ new Set();
75
+ let w = 5;
76
+ function E() {
77
+ if (l.size >= w || k.size === 0)
78
+ return;
79
+ const e = Array.from(k);
80
+ k.clear();
81
+ for (const r of e)
82
+ try {
83
+ r();
84
+ } catch {
85
+ }
86
+ }
87
+ function z(e, r, t) {
88
+ if (x.set(`${r ? "d" : "i"}:${e}`, t), x.size > C) {
89
+ const o = x.keys().next().value;
90
+ o && x.delete(o);
91
+ }
92
+ }
93
+ function $(e) {
94
+ m = e, b = null, m.onmessage = (r) => {
95
+ const { id: t, html: o, error: i, content: u, displayMode: f } = r.data || {}, a = l.get(t);
96
+ if (a) {
97
+ if (l.delete(t), clearTimeout(a.timeoutId), E(), i) {
98
+ a.reject(new Error(i));
99
+ return;
100
+ }
101
+ u && z(String(u), !!f, String(o || "")), a.resolve(String(o || ""));
102
+ }
103
+ }, m.onerror = (r) => {
104
+ for (const [, t] of l.entries())
105
+ clearTimeout(t.timeoutId), t.reject(new Error(`Worker error: ${r.message}`));
106
+ l.clear(), E();
107
+ }, W && m.postMessage({ type: "init", debug: !0 });
108
+ }
109
+ function N() {
110
+ m && m.terminate?.(), m = null, b = null;
111
+ }
112
+ function L() {
113
+ return m || (b = new Error("[markstream-solid:katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."), b.name = "WorkerInitError", b.code = "WORKER_INIT_ERROR", null);
114
+ }
115
+ function Y(e) {
116
+ W = !!e, m && m.postMessage({ type: "init", debug: W });
117
+ }
118
+ async function _(e, r = !0, t = 2e3, o) {
119
+ const i = S(e);
120
+ if (!I()) {
121
+ const n = new Error("KaTeX rendering disabled");
122
+ return n.name = "KaTeXDisabled", n.code = "KATEX_DISABLED", Promise.reject(n);
123
+ }
124
+ if (b)
125
+ return Promise.reject(b);
126
+ const u = `${r ? "d" : "i"}:${i}`, f = x.get(u);
127
+ if (f)
128
+ return f;
129
+ const a = L();
130
+ if (!a)
131
+ return Promise.reject(b);
132
+ if (l.size >= w) {
133
+ const n = new Error("Worker busy");
134
+ return n.name = "WorkerBusy", n.code = v, n.busy = !0, n.inFlight = l.size, n.max = w, Promise.reject(n);
135
+ }
136
+ return new Promise((n, s) => {
137
+ if (o?.aborted) {
138
+ const c = new Error("Aborted");
139
+ c.name = "AbortError", s(c);
140
+ return;
141
+ }
142
+ const h = Math.random().toString(36).slice(2), X = globalThis.setTimeout(() => {
143
+ l.delete(h), E();
144
+ const c = new Error("Worker render timed out");
145
+ c.name = "WorkerTimeout", c.code = "WORKER_TIMEOUT", s(c);
146
+ }, t), M = () => {
147
+ globalThis.clearTimeout(X), l.delete(h) && E();
148
+ const c = new Error("Aborted");
149
+ c.name = "AbortError", s(c);
150
+ };
151
+ o?.addEventListener("abort", M, { once: !0 }), l.set(h, {
152
+ timeoutId: X,
153
+ resolve: (c) => {
154
+ o?.removeEventListener("abort", M), n(c);
155
+ },
156
+ reject: (c) => {
157
+ o?.removeEventListener("abort", M), s(c);
158
+ }
159
+ }), a.postMessage({
160
+ id: h,
161
+ type: "render",
162
+ content: i,
163
+ displayMode: r
164
+ });
165
+ });
166
+ }
167
+ function q(e, r = !0, t) {
168
+ z(S(e), r, t);
169
+ }
170
+ function G() {
171
+ return {
172
+ inFlight: l.size,
173
+ max: w
174
+ };
175
+ }
176
+ function H(e) {
177
+ Number.isFinite(e) && e > 0 && (w = Math.floor(e));
178
+ }
179
+ function J() {
180
+ return l.size >= w;
181
+ }
182
+ function O(e = 2e3, r) {
183
+ return l.size < w ? Promise.resolve() : new Promise((t, o) => {
184
+ let i = !1, u = null;
185
+ const f = () => {
186
+ i || (i = !0, u && clearTimeout(u), k.delete(f), t());
187
+ };
188
+ if (k.add(f), u = setTimeout(() => {
189
+ if (i)
190
+ return;
191
+ i = !0, k.delete(f);
192
+ const a = new Error("Wait for worker slot timed out");
193
+ a.name = "WorkerBusyTimeout", a.code = "WORKER_BUSY_TIMEOUT", o(a);
194
+ }, e), queueMicrotask(() => E()), r) {
195
+ const a = () => {
196
+ if (i)
197
+ return;
198
+ i = !0, u && clearTimeout(u), k.delete(f);
199
+ const n = new Error("Aborted");
200
+ n.name = "AbortError", o(n);
201
+ };
202
+ r.aborted ? a() : r.addEventListener("abort", a, { once: !0 });
203
+ }
204
+ });
205
+ }
206
+ const d = {
207
+ timeout: 2e3,
208
+ waitTimeout: 1500,
209
+ backoffMs: 30,
210
+ maxRetries: 1
211
+ }, P = 8;
212
+ function Q(e) {
213
+ e.timeout != null && (d.timeout = Math.max(0, Math.floor(e.timeout))), e.waitTimeout != null && (d.waitTimeout = Math.max(0, Math.floor(e.waitTimeout))), e.backoffMs != null && (d.backoffMs = Math.max(0, Math.floor(e.backoffMs))), e.maxRetries != null && (d.maxRetries = Math.max(0, Math.floor(e.maxRetries)));
214
+ }
215
+ function V() {
216
+ return { ...d };
217
+ }
218
+ async function Z(e, r = !0, t = {}) {
219
+ if (!I()) {
220
+ const s = new Error("KaTeX rendering disabled");
221
+ throw s.name = "KaTeXDisabled", s.code = "KATEX_DISABLED", s;
222
+ }
223
+ const o = t.timeout ?? d.timeout, i = t.waitTimeout ?? d.waitTimeout, u = t.backoffMs ?? d.backoffMs, f = t.maxRetries ?? d.maxRetries, a = Number.isFinite(f) ? Math.max(0, Math.min(Math.floor(f), P)) : d.maxRetries;
224
+ let n = 0;
225
+ for (; ; ) {
226
+ if (t.signal?.aborted) {
227
+ const s = new Error("Aborted");
228
+ throw s.name = "AbortError", s;
229
+ }
230
+ try {
231
+ return await _(e, r, o, t.signal);
232
+ } catch (s) {
233
+ if (s?.code !== v || n >= a)
234
+ throw s;
235
+ n += 1, await O(i, t.signal).catch(() => {
236
+ }), u > 0 && await new Promise((h) => globalThis.setTimeout(h, u * n));
237
+ }
238
+ }
239
+ }
240
+ export {
241
+ v as W,
242
+ G as a,
243
+ U as b,
244
+ N as c,
245
+ F as d,
246
+ j as e,
247
+ I as f,
248
+ V as g,
249
+ Z as h,
250
+ J as i,
251
+ q as j,
252
+ $ as k,
253
+ Y as l,
254
+ H as m,
255
+ S as n,
256
+ B as o,
257
+ _ as r,
258
+ Q as s,
259
+ O as w
260
+ };
@@ -0,0 +1,280 @@
1
+ import { createContext as y, useContext as x, createEffect as A, onCleanup as I, createSignal as B } from "solid-js";
2
+ const M = y();
3
+ function f2(t, e, s) {
4
+ const n = x(M);
5
+ A(() => {
6
+ const a = t.indexKey;
7
+ if (!(a == null || !n)) {
8
+ if (e())
9
+ n.markPending(a);
10
+ else {
11
+ n.markSettled(a);
12
+ const w = s();
13
+ w && n.reportHeight(a, w.getBoundingClientRect().height);
14
+ }
15
+ I(() => n.markSettled(a));
16
+ }
17
+ });
18
+ }
19
+ function m2() {
20
+ return x(M) ?? null;
21
+ }
22
+ let o = null, g = !1, v = null, f = !1, H = !1;
23
+ function C(t) {
24
+ const e = t, s = typeof e?.createCodeBlockRuntime == "function" || typeof e?.useMonaco == "function" ? e : t?.default, n = s?.createCodeBlockRuntime ?? s?.useMonaco;
25
+ return typeof n != "function" ? null : {
26
+ createCodeBlockRuntime: (a) => n.call(s, a),
27
+ preloadStreamDiffs: s?.preloadStreamDiffs?.bind(s)
28
+ };
29
+ }
30
+ function d2() {
31
+ return H;
32
+ }
33
+ async function u2() {
34
+ return !!await b();
35
+ }
36
+ async function V(t) {
37
+ f || (f = !0, typeof t?.preloadStreamDiffs == "function" && await t.preloadStreamDiffs());
38
+ }
39
+ async function b() {
40
+ if (o)
41
+ return o;
42
+ if (v)
43
+ return await v;
44
+ if (g)
45
+ return null;
46
+ v = (async () => {
47
+ try {
48
+ const t = C(await import("stream-diffs/markstream"));
49
+ return t ? (o = t, await V(o), H = !0, o) : null;
50
+ } catch {
51
+ return g = !0, null;
52
+ }
53
+ })();
54
+ try {
55
+ return await v;
56
+ } finally {
57
+ v = null;
58
+ }
59
+ }
60
+ const k = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>', j = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>', m = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>', L = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>', S = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>', T = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>', R = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>', q = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>', Z = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>', P = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>', E = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>', D = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>', J = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>', G = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>', N = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>', U = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>', _ = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>', F = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>', X = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>', K = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>', O = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>', Y = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>', d = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>', $ = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>', Q = '<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>', W = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>', t2 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>', e2 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>', s2 = {
61
+ "": d,
62
+ plain: N,
63
+ text: d,
64
+ javascript: q,
65
+ typescript: Q,
66
+ jsx: P,
67
+ tsx: $,
68
+ html: T,
69
+ css: L,
70
+ scss: K,
71
+ json: Z,
72
+ python: _,
73
+ ruby: F,
74
+ go: S,
75
+ java: R,
76
+ kotlin: E,
77
+ c: k,
78
+ cpp: j,
79
+ cs: m,
80
+ csharp: m,
81
+ php: G,
82
+ shell: O,
83
+ powershell: U,
84
+ sql: Y,
85
+ yaml: e2,
86
+ markdown: D,
87
+ xml: t2,
88
+ rust: X,
89
+ vue: W,
90
+ mermaid: J
91
+ }, n2 = '<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>', a2 = {
92
+ id: "material",
93
+ core: s2,
94
+ fallback: n2,
95
+ loadExtended: () => import("./extended-BTbixd9o.js").then((t) => t.materialExtendedMap)
96
+ }, c = /* @__PURE__ */ new Map();
97
+ let h = "material";
98
+ const l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
99
+ let r = null;
100
+ function c2(t) {
101
+ r = t;
102
+ }
103
+ function l2(t) {
104
+ c.set(t.id, t);
105
+ }
106
+ function x2(t) {
107
+ if (!c.has(t))
108
+ throw new Error(`[markstream-vue] Unknown icon theme: "${t}". Registered: ${[...c.keys()].join(", ")}`);
109
+ h = t, r?.();
110
+ const e = c.get(t);
111
+ e.loadExtended && !l.has(t) && p(e);
112
+ }
113
+ function M2() {
114
+ return [...c.keys()];
115
+ }
116
+ function o2(t) {
117
+ const e = c.get(h);
118
+ if (!e)
119
+ return;
120
+ const s = e.core[t];
121
+ if (s)
122
+ return s;
123
+ const n = l.get(e.id);
124
+ if (n) {
125
+ const a = n[t];
126
+ if (a)
127
+ return a;
128
+ }
129
+ e.loadExtended && !l.has(e.id) && p(e);
130
+ }
131
+ function v2() {
132
+ return c.get(h)?.fallback ?? "";
133
+ }
134
+ async function p(t) {
135
+ if (l.has(t.id))
136
+ return l.get(t.id) ?? null;
137
+ let e = u.get(t.id);
138
+ return e || (e = (t.loadExtended?.() ?? Promise.resolve(null)).then((s) => (l.set(t.id, s), r?.(), s)).catch(() => (l.set(t.id, null), null)), u.set(t.id, e)), e;
139
+ }
140
+ async function h2() {
141
+ const t = c.get(h);
142
+ t?.loadExtended && await p(t);
143
+ }
144
+ let i = null;
145
+ const [i2, r2] = B(0), H2 = i2;
146
+ c2(() => {
147
+ r2((t) => t + 1);
148
+ });
149
+ l2(a2);
150
+ const p2 = {
151
+ "": "",
152
+ javascript: "javascript",
153
+ js: "javascript",
154
+ mjs: "javascript",
155
+ cjs: "javascript",
156
+ typescript: "typescript",
157
+ ts: "typescript",
158
+ jsx: "jsx",
159
+ tsx: "tsx",
160
+ golang: "go",
161
+ py: "python",
162
+ rb: "ruby",
163
+ sh: "shell",
164
+ bash: "shell",
165
+ zsh: "shell",
166
+ shellscript: "shell",
167
+ bat: "shell",
168
+ batch: "shell",
169
+ ps1: "powershell",
170
+ plaintext: "plain",
171
+ text: "plain",
172
+ txt: "plain",
173
+ "c++": "cpp",
174
+ "c#": "csharp",
175
+ cs: "csharp",
176
+ "objective-c": "objectivec",
177
+ "objective-c++": "objectivecpp",
178
+ yml: "yaml",
179
+ md: "markdown",
180
+ rs: "rust",
181
+ kt: "kotlin"
182
+ };
183
+ function w2(t) {
184
+ if (!t)
185
+ return "";
186
+ const e = t.trim();
187
+ if (!e)
188
+ return "";
189
+ const [s] = e.split(/\s+/), [n] = s.split(":");
190
+ return n.toLowerCase();
191
+ }
192
+ function z2(t) {
193
+ i = t ?? null;
194
+ }
195
+ function z(t) {
196
+ const e = w2(t);
197
+ return p2[e] ?? e;
198
+ }
199
+ function y2(t) {
200
+ const e = z(t);
201
+ if (!e)
202
+ return "plaintext";
203
+ switch (e) {
204
+ case "plain":
205
+ return "plaintext";
206
+ case "shell":
207
+ return "zsh";
208
+ case "svg":
209
+ return "xml";
210
+ case "objectivec":
211
+ return "objective-c";
212
+ case "objectivecpp":
213
+ return "objective-cpp";
214
+ default:
215
+ return e;
216
+ }
217
+ }
218
+ async function A2() {
219
+ await h2();
220
+ }
221
+ function I2(t) {
222
+ if (i) {
223
+ const n = i(t);
224
+ if (n != null && n !== "")
225
+ return n;
226
+ }
227
+ const e = z(t), s = o2(e);
228
+ return s || v2();
229
+ }
230
+ const B2 = {
231
+ js: "JavaScript",
232
+ javascript: "JavaScript",
233
+ ts: "TypeScript",
234
+ typescript: "TypeScript",
235
+ jsx: "JSX",
236
+ tsx: "TSX",
237
+ html: "HTML",
238
+ css: "CSS",
239
+ scss: "SCSS",
240
+ json: "JSON",
241
+ py: "Python",
242
+ python: "Python",
243
+ rb: "Ruby",
244
+ go: "Go",
245
+ java: "Java",
246
+ c: "C",
247
+ cpp: "C++",
248
+ cs: "C#",
249
+ csharp: "C#",
250
+ php: "PHP",
251
+ sh: "Shell",
252
+ bash: "Bash",
253
+ sql: "SQL",
254
+ yaml: "YAML",
255
+ md: "Markdown",
256
+ d2: "D2",
257
+ d2lang: "D2",
258
+ "": "Plain Text",
259
+ plain: "Plain Text"
260
+ };
261
+ export {
262
+ M as N,
263
+ M2 as a,
264
+ b,
265
+ v2 as c,
266
+ B2 as d,
267
+ A2 as e,
268
+ o2 as f,
269
+ I2 as g,
270
+ y2 as h,
271
+ d2 as i,
272
+ z2 as j,
273
+ f2 as k,
274
+ H2 as l,
275
+ z as n,
276
+ u2 as p,
277
+ l2 as r,
278
+ x2 as s,
279
+ m2 as u
280
+ };