artifactuse 0.1.23 → 0.1.25

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.
@@ -1,11 +1,11 @@
1
- var jr = Object.defineProperty;
2
- var Zr = (e, t, r) => t in e ? jr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var E = (e, t, r) => Zr(e, typeof t != "symbol" ? t + "" : t, r);
4
- const ze = {
1
+ var qr = Object.defineProperty;
2
+ var Hr = (e, t, r) => t in e ? qr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var T = (e, t, r) => Hr(e, typeof t != "symbol" ? t + "" : t, r);
4
+ const Ce = {
5
5
  CODE: "code",
6
6
  FORM: "form",
7
7
  SOCIAL: "social"
8
- }, qr = [
8
+ }, Zr = [
9
9
  // Code languages
10
10
  "html",
11
11
  "htm",
@@ -31,7 +31,7 @@ const ze = {
31
31
  // Structured artifacts
32
32
  "form",
33
33
  "social"
34
- ], Hr = [
34
+ ], Dr = [
35
35
  // Visual editors (always panel)
36
36
  "video",
37
37
  "videoeditor",
@@ -55,16 +55,16 @@ const ze = {
55
55
  // Structured artifacts (form can be panel based on complexity)
56
56
  "form"
57
57
  ];
58
- function Dr(e = "artifact") {
58
+ function Br(e = "artifact") {
59
59
  return `${e}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
60
60
  }
61
- function or(e) {
62
- return qr.includes(e == null ? void 0 : e.toLowerCase());
61
+ function cr(e) {
62
+ return Zr.includes(e == null ? void 0 : e.toLowerCase());
63
63
  }
64
64
  function Or(e) {
65
- return Hr.includes(e == null ? void 0 : e.toLowerCase());
65
+ return Dr.includes(e == null ? void 0 : e.toLowerCase());
66
66
  }
67
- function Br(e) {
67
+ function Fr(e) {
68
68
  return {
69
69
  // Code languages
70
70
  html: "HTML",
@@ -123,7 +123,7 @@ function Br(e) {
123
123
  txt: "Plain Text"
124
124
  }[e == null ? void 0 : e.toLowerCase()] || (e == null ? void 0 : e.toUpperCase()) || "Code";
125
125
  }
126
- function Ws(e) {
126
+ function Xs(e) {
127
127
  return {
128
128
  html: "html",
129
129
  htm: "html",
@@ -165,7 +165,7 @@ function Ws(e) {
165
165
  social: "json"
166
166
  }[e == null ? void 0 : e.toLowerCase()] || "txt";
167
167
  }
168
- function Fr(e) {
168
+ function Vr(e) {
169
169
  return {
170
170
  html: "html",
171
171
  htm: "html",
@@ -201,7 +201,7 @@ function Fr(e) {
201
201
  patch: "patch"
202
202
  }[e == null ? void 0 : e.toLowerCase()] || null;
203
203
  }
204
- function Xs(e) {
204
+ function Ks(e) {
205
205
  return {
206
206
  html: '<path d="M12 17.56l4.07-1.13.55-6.1H9.38l-.16-1.7h7.78l.16-1.7H6.85l.48 5.1h6.3l-.25 2.9-2.38.63-2.38-.63-.15-1.7H6.76l.3 3.2L12 17.56M4.07 3h15.86L18.5 19.2 12 21l-6.5-1.8L4.07 3z"/>',
207
207
  htm: '<path d="M12 17.56l4.07-1.13.55-6.1H9.38l-.16-1.7h7.78l.16-1.7H6.85l.48 5.1h6.3l-.25 2.9-2.38.63-2.38-.63-.15-1.7H6.76l.3 3.2L12 17.56M4.07 3h15.86L18.5 19.2 12 21l-6.5-1.8L4.07 3z"/>',
@@ -235,28 +235,28 @@ function Xs(e) {
235
235
  social: '<path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"/>'
236
236
  }[e == null ? void 0 : e.toLowerCase()] || '<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>';
237
237
  }
238
- function Ks(e) {
238
+ function Js(e) {
239
239
  if (e === 0) return "0 Bytes";
240
240
  const t = 1024, r = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(e) / Math.log(t));
241
241
  return parseFloat((e / Math.pow(t, a)).toFixed(2)) + " " + r[a];
242
242
  }
243
- function cr(e) {
243
+ function lr(e) {
244
244
  return e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&").replace(/&#10;/g, `
245
245
  `).replace(/&#13;/g, "\r").replace(/&#9;/g, " ").replace(/&nbsp;/g, " ");
246
246
  }
247
- function Vr(e) {
247
+ function Nr(e) {
248
248
  const t = JSON.stringify(e);
249
249
  return typeof btoa == "function" ? btoa(unescape(encodeURIComponent(t))) : typeof Buffer < "u" ? Buffer.from(t, "utf-8").toString("base64") : t.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
250
250
  }
251
- function Nr(e, t) {
251
+ function Ur(e, t) {
252
252
  const r = t == null ? void 0 : t.toLowerCase();
253
253
  if (r === "form" || r === "social")
254
254
  try {
255
- const c = JSON.parse(e);
255
+ const l = JSON.parse(e);
256
256
  if (r === "form")
257
- return c.title || "Form";
257
+ return l.title || "Form";
258
258
  if (r === "social")
259
- return `Social Preview - ${c.platform || "twitter"}`;
259
+ return `Social Preview - ${l.platform || "twitter"}`;
260
260
  } catch {
261
261
  }
262
262
  const a = e.match(/(?:\/\/|\/\*|<!--)\s*(?:filename|file):\s*([^\n*\->\s]+)/i);
@@ -271,28 +271,28 @@ function Nr(e, t) {
271
271
  const i = e.match(/(?:export\s+)?const\s+([A-Z][a-zA-Z0-9]+)\s*=\s*(?:\([^)]*\)|[a-zA-Z]+)\s*=>/);
272
272
  if (i) return i[1];
273
273
  if (r === "python" || r === "py") {
274
- const c = e.match(/class\s+([A-Z][a-zA-Z0-9_]+)/);
275
- if (c) return c[1];
274
+ const l = e.match(/class\s+([A-Z][a-zA-Z0-9_]+)/);
275
+ if (l) return l[1];
276
276
  const d = e.match(/def\s+([a-z_][a-zA-Z0-9_]+)\s*\(/);
277
277
  if (d && d[1] !== "main") return d[1];
278
278
  }
279
- const l = e.match(/<title>([^<]+)<\/title>/i);
280
- return l ? l[1].trim() : e.includes("<template>") && e.includes("<script>") ? "Vue Component" : e.includes("import React") || e.includes('from "react"') ? "React Component" : e.includes("<!DOCTYPE html>") || e.includes("<html") ? "HTML Document" : e.includes("@app.route") || e.includes("Flask") ? "Flask App" : e.includes("express()") ? "Express Server" : e.includes("CREATE TABLE") ? "SQL Schema" : e.includes("SELECT") && e.includes("FROM") ? "SQL Query" : `${Br(t)} Code`;
279
+ const u = e.match(/<title>([^<]+)<\/title>/i);
280
+ return u ? u[1].trim() : e.includes("<template>") && e.includes("<script>") ? "Vue Component" : e.includes("import React") || e.includes('from "react"') ? "React Component" : e.includes("<!DOCTYPE html>") || e.includes("<html") ? "HTML Document" : e.includes("@app.route") || e.includes("Flask") ? "Flask App" : e.includes("express()") ? "Express Server" : e.includes("CREATE TABLE") ? "SQL Schema" : e.includes("SELECT") && e.includes("FROM") ? "SQL Query" : `${Fr(t)} Code`;
281
281
  }
282
- function Ur(e, t = "panel") {
283
- const r = Vr(e);
282
+ function Gr(e, t = "panel") {
283
+ const r = Nr(e);
284
284
  return `<div class="${`artifactuse-placeholder artifactuse-${t}`}" data-artifact-id="${e.id}" data-artifact-type="${e.type}" data-artifact="${r}"></div>`;
285
285
  }
286
- function lr(e) {
286
+ function ur(e) {
287
287
  try {
288
288
  return JSON.parse(e);
289
289
  } catch {
290
290
  return null;
291
291
  }
292
292
  }
293
- function Gr(e) {
293
+ function Wr(e) {
294
294
  var s;
295
- const t = lr(e);
295
+ const t = ur(e);
296
296
  if (!t || t.display === "inline") return !0;
297
297
  if (t.display === "panel" || t.variant === "wizard") return !1;
298
298
  if (t.variant === "buttons") return !0;
@@ -301,25 +301,25 @@ function Gr(e) {
301
301
  const a = ["multiselect", "rating", "color", "range"];
302
302
  return !(r.some((n) => a.includes(n.type)) || r.filter((n) => n.type !== "buttons" && n.type !== "divider" && n.type !== "heading").length > 4 || r.some((n) => n.type === "textarea" && (n.rows || 3) > 4));
303
303
  }
304
- function Wr(e, t) {
304
+ function Xr(e, t) {
305
305
  const r = e == null ? void 0 : e.toLowerCase();
306
- return r === "social" ? !0 : r === "form" ? Gr(t) : !1;
306
+ return r === "social" ? !0 : r === "form" ? Wr(t) : !1;
307
307
  }
308
- function Xr(e) {
308
+ function Kr(e) {
309
309
  const t = e == null ? void 0 : e.toLowerCase();
310
- return t === "form" ? ze.FORM : t === "social" ? ze.SOCIAL : ze.CODE;
310
+ return t === "form" ? Ce.FORM : t === "social" ? Ce.SOCIAL : Ce.CODE;
311
311
  }
312
- function be(e, t, r, a) {
313
- const s = t == null ? void 0 : t.toLowerCase(), n = Xr(s), o = Wr(s, e);
312
+ function we(e, t, r, a) {
313
+ const s = t == null ? void 0 : t.toLowerCase(), n = Kr(s), o = Xr(s, e);
314
314
  return {
315
315
  id: `${r}-${n}-${a}`,
316
316
  messageId: r,
317
317
  type: n,
318
318
  language: s,
319
- title: Nr(e, s),
319
+ title: Ur(e, s),
320
320
  code: e,
321
321
  isInline: o,
322
- isPreviewable: or(s),
322
+ isPreviewable: cr(s),
323
323
  isPanelArtifact: Or(s),
324
324
  size: e.length,
325
325
  lineCount: e.split(`
@@ -331,41 +331,41 @@ function Qs(e, t) {
331
331
  const r = [], a = /<pre><code class="language-(\w+)">([\s\S]*?)<\/code><\/pre>/gi;
332
332
  let s, n = 0;
333
333
  for (; (s = a.exec(e)) !== null; ) {
334
- const o = s[1], i = cr(s[2]);
335
- let l = o.toLowerCase();
336
- if ((["xml", "markup", "html", "htm"].includes(l) || !l) && (i.trim().startsWith("<svg") || i.includes("<svg ") || i.includes("<svg>")) && (l = "svg"), (l === "form" || l === "social") && !lr(i)) {
337
- r.push(be(i, "json", t, n)), n++;
334
+ const o = s[1], i = lr(s[2]);
335
+ let u = o.toLowerCase();
336
+ if ((["xml", "markup", "html", "htm"].includes(u) || !u) && (i.trim().startsWith("<svg") || i.includes("<svg ") || i.includes("<svg>")) && (u = "svg"), (u === "form" || u === "social") && !ur(i)) {
337
+ r.push(we(i, "json", t, n)), n++;
338
338
  continue;
339
339
  }
340
- r.push(be(i, l, t, n)), n++;
340
+ r.push(we(i, u, t, n)), n++;
341
341
  }
342
342
  return r;
343
343
  }
344
- function Kr(e, t, r = {}) {
344
+ function Jr(e, t, r = {}) {
345
345
  const {
346
346
  minLines: a = 3,
347
347
  minLength: s = 50,
348
348
  extractAll: n = !1
349
349
  } = r, o = [], i = /<pre><code class="language-(\w+)">([\s\S]*?)<\/code><\/pre>/gi;
350
- let l = 0;
351
- const c = e.replace(i, (d, p, u) => {
352
- const f = cr(u).trim(), w = f.split(`
350
+ let u = 0;
351
+ const l = e.replace(i, (d, p, m) => {
352
+ const c = lr(m).trim(), g = c.split(`
353
353
  `).length;
354
- let h = p.toLowerCase();
355
- (["xml", "markup", "html", "htm"].includes(h) || !h) && f.trim().startsWith("<svg") && (h = "svg");
356
- const m = or(h);
357
- let g = !1;
358
- if (n ? g = !0 : h === "diff" || h === "patch" ? g = w > 10 : m ? g = !0 : g = f.length >= s && w >= a, g) {
359
- const b = be(f, h, t, l);
360
- l++, o.push(b);
354
+ let f = p.toLowerCase();
355
+ (["xml", "markup", "html", "htm"].includes(f) || !f) && c.trim().startsWith("<svg") && (f = "svg");
356
+ const b = cr(f);
357
+ let h = !1;
358
+ if (n ? h = !0 : f === "diff" || f === "patch" ? h = g > 10 : b ? h = !0 : h = c.length >= s && g >= a, h) {
359
+ const w = we(c, f, t, u);
360
+ u++, o.push(w);
361
361
  let v = "panel";
362
- return b.isInline && (v = b.type === "social" ? "inline-social" : "inline-form"), Ur(b, v);
362
+ return w.isInline && (v = w.type === "social" ? "inline-social" : "inline-form"), Gr(w, v);
363
363
  }
364
- return l++, d;
364
+ return u++, d;
365
365
  });
366
366
  return {
367
367
  artifacts: o,
368
- html: c
368
+ html: l
369
369
  };
370
370
  }
371
371
  function Qr() {
@@ -422,14 +422,14 @@ function Qr() {
422
422
  isPanelOpen: e.activeArtifactId === y ? !1 : e.isPanelOpen
423
423
  }, r();
424
424
  }
425
- function l(y) {
425
+ function u(y) {
426
426
  return e.artifacts.find(($) => $.id === y) || null;
427
427
  }
428
- function c() {
429
- return e.activeArtifactId ? l(e.activeArtifactId) : null;
428
+ function l() {
429
+ return e.activeArtifactId ? u(e.activeArtifactId) : null;
430
430
  }
431
431
  function d(y) {
432
- const $ = l(y);
432
+ const $ = u(y);
433
433
  let A = ($ == null ? void 0 : $.isPreviewable) === !1 ? "code" : "preview";
434
434
  $ != null && $.tabs && !$.tabs.includes(A) && (A = $.tabs[0]), e = {
435
435
  ...e,
@@ -443,14 +443,14 @@ function Qr() {
443
443
  activeArtifactId: null
444
444
  }, r();
445
445
  }
446
- function u(y) {
446
+ function m(y) {
447
447
  e = {
448
448
  ...e,
449
449
  isPanelOpen: y,
450
450
  isFullscreen: y ? e.isFullscreen : !1
451
451
  }, r();
452
452
  }
453
- function f(y) {
453
+ function c(y) {
454
454
  if (!["preview", "code", "split", "edit"].includes(y)) {
455
455
  console.warn(`Invalid view mode: ${y}`);
456
456
  return;
@@ -460,22 +460,22 @@ function Qr() {
460
460
  viewMode: y
461
461
  }, r();
462
462
  }
463
- function w(y) {
463
+ function g(y) {
464
464
  e = {
465
465
  ...e,
466
466
  isFullscreen: y
467
467
  }, r();
468
468
  }
469
- function h(y) {
469
+ function f(y) {
470
470
  return e.artifacts.filter(($) => $.messageId === y);
471
471
  }
472
- function m(y) {
472
+ function b(y) {
473
473
  return e.artifacts.filter(($) => $.type === y);
474
474
  }
475
- function g() {
475
+ function h() {
476
476
  return e.artifacts.length;
477
477
  }
478
- function b() {
478
+ function w() {
479
479
  e = {
480
480
  artifacts: [],
481
481
  activeArtifactId: null,
@@ -507,160 +507,160 @@ function Qr() {
507
507
  addArtifact: n,
508
508
  addArtifacts: o,
509
509
  removeArtifact: i,
510
- getArtifact: l,
511
- getActiveArtifact: c,
512
- getArtifactsByMessageId: h,
513
- getArtifactsByType: m,
514
- getArtifactCount: g,
510
+ getArtifact: u,
511
+ getActiveArtifact: l,
512
+ getArtifactsByMessageId: f,
513
+ getArtifactsByType: b,
514
+ getArtifactCount: h,
515
515
  // Panel state
516
516
  setActiveArtifact: d,
517
517
  clearActiveArtifact: p,
518
- setPanelOpen: u,
519
- setViewMode: f,
520
- setFullscreen: w,
518
+ setPanelOpen: m,
519
+ setViewMode: c,
520
+ setFullscreen: g,
521
521
  // Utilities
522
- clear: b,
522
+ clear: w,
523
523
  batch: v
524
524
  };
525
525
  }
526
- function st(e) {
526
+ function nt(e) {
527
527
  try {
528
528
  return new URL(e).hostname;
529
529
  } catch {
530
530
  return null;
531
531
  }
532
532
  }
533
- function Jr(e = []) {
533
+ function Yr(e = []) {
534
534
  const t = Array.isArray(e) ? e : [e].filter(Boolean), r = new Set(t), a = /* @__PURE__ */ new Map();
535
535
  let s = null, n = !1, o = !1;
536
536
  const i = [];
537
- function l(R) {
537
+ function u(R) {
538
538
  if (r.size === 0)
539
539
  return console.warn("Artifactuse bridge: No allowed origins configured, accepting all messages"), !0;
540
- const T = st(R);
541
- if (!T) return !1;
542
- for (const z of r) {
543
- const Z = st(z);
544
- if (Z && Z === T || z === T)
540
+ const P = nt(R);
541
+ if (!P) return !1;
542
+ for (const I of r) {
543
+ const _ = nt(I);
544
+ if (_ && _ === P || I === P)
545
545
  return !0;
546
546
  }
547
547
  return !1;
548
548
  }
549
- function c(R) {
550
- var k, M, x;
551
- if (((k = R.data) == null ? void 0 : k.type) === "artifactuse" && (console.log("[Bridge] Message from:", R.origin, "action:", (M = R.data) == null ? void 0 : M.action), console.log("[Bridge] Allowed origins:", u())), !l(R.origin)) {
552
- ((x = R.data) == null ? void 0 : x.type) === "artifactuse" && console.warn("[Bridge] Origin NOT allowed:", R.origin);
549
+ function l(R) {
550
+ var F, k, z;
551
+ if (((F = R.data) == null ? void 0 : F.type) === "artifactuse" && (console.log("[Bridge] Message from:", R.origin, "action:", (k = R.data) == null ? void 0 : k.action), console.log("[Bridge] Allowed origins:", m())), !u(R.origin)) {
552
+ ((z = R.data) == null ? void 0 : z.type) === "artifactuse" && console.warn("[Bridge] Origin NOT allowed:", R.origin);
553
553
  return;
554
554
  }
555
- const { type: T, action: z, data: Z, requestId: D } = R.data || {};
556
- if (T !== "artifactuse") return;
557
- if (z === "ready" || z === "panel:ready") {
558
- console.log("[Bridge] panel:ready received, setting isReady=true"), n = !0, o = !0, w();
555
+ const { type: P, action: I, data: _, requestId: Z } = R.data || {};
556
+ if (P !== "artifactuse") return;
557
+ if (I === "ready" || I === "panel:ready") {
558
+ console.log("[Bridge] panel:ready received, setting isReady=true"), n = !0, o = !0, g();
559
559
  return;
560
560
  }
561
- (a.get(z) || []).forEach((j) => {
561
+ (a.get(I) || []).forEach((x) => {
562
562
  try {
563
- j(Z, D);
564
- } catch (I) {
565
- console.error(`Artifactuse bridge handler error (${z}):`, I);
563
+ x(_, Z);
564
+ } catch (j) {
565
+ console.error(`Artifactuse bridge handler error (${I}):`, j);
566
566
  }
567
- }), (a.get("*") || []).forEach((j) => {
567
+ }), (a.get("*") || []).forEach((x) => {
568
568
  try {
569
- j({ action: z, data: Z, requestId: D });
570
- } catch (I) {
571
- console.error("Artifactuse bridge wildcard handler error:", I);
569
+ x({ action: I, data: _, requestId: Z });
570
+ } catch (j) {
571
+ console.error("Artifactuse bridge wildcard handler error:", j);
572
572
  }
573
573
  });
574
574
  }
575
- window.addEventListener("message", c);
575
+ window.addEventListener("message", l);
576
576
  function d(R) {
577
577
  R && typeof R == "string" && r.add(R);
578
578
  }
579
579
  function p(R) {
580
580
  R && typeof R == "string" && r.delete(R);
581
581
  }
582
- function u() {
582
+ function m() {
583
583
  return [...r];
584
584
  }
585
- function f(R) {
586
- console.log("[Bridge] setIframe called, current isReady:", n, "readySignalReceived:", o, "same iframe:", s === R), s !== R && (s = R, o ? (console.log("[Bridge] Ready signal was already received, keeping isReady=true"), n = !0) : n = !1), console.log("[Bridge] setIframe done, isReady:", n, "pendingMessages:", i.length), w();
585
+ function c(R) {
586
+ console.log("[Bridge] setIframe called, current isReady:", n, "readySignalReceived:", o, "same iframe:", s === R), s !== R && (s = R, o ? (console.log("[Bridge] Ready signal was already received, keeping isReady=true"), n = !0) : n = !1), console.log("[Bridge] setIframe done, isReady:", n, "pendingMessages:", i.length), g();
587
587
  }
588
- function w() {
589
- console.log("[Bridge] flushPendingMessages: isReady=", n, "hasIframe=", !!(s != null && s.contentWindow), "pending=", i.length), n && (s != null && s.contentWindow) && i.length > 0 && (console.log("[Bridge] Flushing", i.length, "pending messages"), i.forEach((R) => h(R)), i.length = 0);
588
+ function g() {
589
+ console.log("[Bridge] flushPendingMessages: isReady=", n, "hasIframe=", !!(s != null && s.contentWindow), "pending=", i.length), n && (s != null && s.contentWindow) && i.length > 0 && (console.log("[Bridge] Flushing", i.length, "pending messages"), i.forEach((R) => f(R)), i.length = 0);
590
590
  }
591
- function h(R, T = "*") {
591
+ function f(R, P = "*") {
592
592
  if (!(s != null && s.contentWindow))
593
593
  return console.warn("Artifactuse: No panel iframe available"), !1;
594
594
  try {
595
- return s.contentWindow.postMessage(R, T), !0;
596
- } catch (z) {
597
- return console.error("Artifactuse bridge send error:", z), !1;
595
+ return s.contentWindow.postMessage(R, P), !0;
596
+ } catch (I) {
597
+ return console.error("Artifactuse bridge send error:", I), !1;
598
598
  }
599
599
  }
600
- function m(R, T, z = null, Z = "*") {
601
- const D = {
600
+ function b(R, P, I = null, _ = "*") {
601
+ const Z = {
602
602
  type: "artifactuse",
603
603
  action: R,
604
- data: T,
605
- requestId: z || nt(),
604
+ data: P,
605
+ requestId: I || it(),
606
606
  timestamp: Date.now()
607
607
  };
608
- return n ? (h(D, Z), D.requestId) : (i.push(D), D.requestId);
609
- }
610
- function g(R, T, z = 3e4) {
611
- return new Promise((Z, D) => {
612
- const U = nt(), J = setTimeout(() => {
613
- v(`${R}:response`, k), D(new Error(`Artifactuse bridge request timeout: ${R}`));
614
- }, z), k = (M, x) => {
615
- x === U && (clearTimeout(J), v(`${R}:response`, k), Z(M));
608
+ return n ? (f(Z, _), Z.requestId) : (i.push(Z), Z.requestId);
609
+ }
610
+ function h(R, P, I = 3e4) {
611
+ return new Promise((_, Z) => {
612
+ const G = it(), Y = setTimeout(() => {
613
+ v(`${R}:response`, F), Z(new Error(`Artifactuse bridge request timeout: ${R}`));
614
+ }, I), F = (k, z) => {
615
+ z === G && (clearTimeout(Y), v(`${R}:response`, F), _(k));
616
616
  };
617
- b(`${R}:response`, k), m(R, T, U);
617
+ w(`${R}:response`, F), b(R, P, G);
618
618
  });
619
619
  }
620
- function b(R, T) {
621
- return a.has(R) || a.set(R, []), a.get(R).push(T), () => v(R, T);
620
+ function w(R, P) {
621
+ return a.has(R) || a.set(R, []), a.get(R).push(P), () => v(R, P);
622
622
  }
623
- function v(R, T) {
624
- const z = a.get(R);
625
- if (z) {
626
- const Z = z.indexOf(T);
627
- Z > -1 && z.splice(Z, 1);
623
+ function v(R, P) {
624
+ const I = a.get(R);
625
+ if (I) {
626
+ const _ = I.indexOf(P);
627
+ _ > -1 && I.splice(_, 1);
628
628
  }
629
629
  }
630
630
  function y(R) {
631
- return m("load:artifact", R);
631
+ return b("load:artifact", R);
632
632
  }
633
- function $(R, T) {
634
- return m("update:artifact", { artifactId: R, updates: T });
633
+ function $(R, P) {
634
+ return b("update:artifact", { artifactId: R, updates: P });
635
635
  }
636
636
  function A() {
637
- return g("save", {});
637
+ return h("save", {});
638
638
  }
639
639
  function S(R = "default") {
640
- return g("export", { format: R });
640
+ return h("export", { format: R });
641
641
  }
642
- function C(R, T) {
643
- return m("ai:response", R, T);
642
+ function C(R, P) {
643
+ return b("ai:response", R, P);
644
644
  }
645
- function q() {
646
- window.removeEventListener("message", c), a.clear(), r.clear(), s = null, n = !1, o = !1, i.length = 0;
645
+ function V() {
646
+ window.removeEventListener("message", l), a.clear(), r.clear(), s = null, n = !1, o = !1, i.length = 0;
647
647
  }
648
648
  return {
649
- setIframe: f,
650
- send: m,
651
- request: g,
652
- on: b,
649
+ setIframe: c,
650
+ send: b,
651
+ request: h,
652
+ on: w,
653
653
  off: v,
654
654
  loadArtifact: y,
655
655
  updateArtifact: $,
656
656
  requestSave: A,
657
657
  requestExport: S,
658
658
  sendAIResponse: C,
659
- destroy: q,
659
+ destroy: V,
660
660
  // Origin management
661
661
  addAllowedOrigin: d,
662
662
  removeAllowedOrigin: p,
663
- getAllowedOrigins: u,
663
+ getAllowedOrigins: m,
664
664
  // State
665
665
  get isReady() {
666
666
  return n;
@@ -670,10 +670,10 @@ function Jr(e = []) {
670
670
  }
671
671
  };
672
672
  }
673
- function nt() {
673
+ function it() {
674
674
  return `req-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
675
675
  }
676
- function Yr(e) {
676
+ function ea(e) {
677
677
  if (!e) return null;
678
678
  if (typeof e == "string" && e.includes(","))
679
679
  return e.trim();
@@ -683,22 +683,22 @@ function Yr(e) {
683
683
  const r = parseInt(t.slice(0, 2), 16), a = parseInt(t.slice(2, 4), 16), s = parseInt(t.slice(4, 6), 16);
684
684
  return `${r}, ${a}, ${s}`;
685
685
  }
686
- function ea(e) {
687
- return e ? Yr(e) : null;
686
+ function ta(e) {
687
+ return e ? ea(e) : null;
688
688
  }
689
- function fe(e) {
689
+ function he(e) {
690
690
  if (!e || typeof e != "object") return {};
691
691
  const t = {};
692
692
  for (const [r, a] of Object.entries(e))
693
693
  if (r === "gradientOpacity" || typeof a == "number")
694
694
  t[r] = a;
695
695
  else {
696
- const s = ea(a);
696
+ const s = ta(a);
697
697
  s && (t[r] = s);
698
698
  }
699
699
  return t;
700
700
  }
701
- const it = {
701
+ const ot = {
702
702
  // Dark theme
703
703
  dark: {
704
704
  primary: "99, 102, 241",
@@ -768,16 +768,16 @@ const it = {
768
768
  gradientOpacity: "0.25"
769
769
  }
770
770
  };
771
- function ta(e = "auto", t = {}) {
771
+ function ra(e = "auto", t = {}) {
772
772
  let r = e, a = {
773
- dark: { ...it.dark },
774
- light: { ...it.light }
773
+ dark: { ...ot.dark },
774
+ light: { ...ot.light }
775
775
  };
776
- t.dark && (a.dark = { ...a.dark, ...fe(t.dark) }), t.light && (a.light = { ...a.light, ...fe(t.light) });
776
+ t.dark && (a.dark = { ...a.dark, ...he(t.dark) }), t.light && (a.light = { ...a.light, ...he(t.light) });
777
777
  const s = { ...t };
778
778
  if (delete s.dark, delete s.light, Object.keys(s).length > 0) {
779
- const w = fe(s);
780
- a.dark = { ...a.dark, ...w }, a.light = { ...a.light, ...w };
779
+ const g = he(s);
780
+ a.dark = { ...a.dark, ...g }, a.light = { ...a.light, ...g };
781
781
  }
782
782
  function n() {
783
783
  return r === "auto" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : r;
@@ -786,55 +786,55 @@ function ta(e = "auto", t = {}) {
786
786
  return a[n()];
787
787
  }
788
788
  function i() {
789
- const w = o();
790
- return Object.entries(w).map(([h, m]) => `--artifactuse-${ae(h)}: ${m};`).join(`
789
+ const g = o();
790
+ return Object.entries(g).map(([f, b]) => `--artifactuse-${se(f)}: ${b};`).join(`
791
791
  `);
792
792
  }
793
- function l(w = document.documentElement) {
794
- const h = o(), m = n();
795
- Object.entries(h).forEach(([g, b]) => {
796
- w.style.setProperty(`--artifactuse-${ae(g)}`, b);
797
- }), w.setAttribute("data-artifactuse-theme", m), w.classList.remove("artifactuse-dark", "artifactuse-light"), w.classList.add(`artifactuse-${m}`);
793
+ function u(g = document.documentElement) {
794
+ const f = o(), b = n();
795
+ Object.entries(f).forEach(([h, w]) => {
796
+ g.style.setProperty(`--artifactuse-${se(h)}`, w);
797
+ }), g.setAttribute("data-artifactuse-theme", b), g.classList.remove("artifactuse-dark", "artifactuse-light"), g.classList.add(`artifactuse-${b}`);
798
798
  }
799
- function c(w) {
800
- if (!["dark", "light", "auto"].includes(w)) {
801
- console.warn(`Invalid theme: ${w}`);
799
+ function l(g) {
800
+ if (!["dark", "light", "auto"].includes(g)) {
801
+ console.warn(`Invalid theme: ${g}`);
802
802
  return;
803
803
  }
804
- r = w, l();
804
+ r = g, u();
805
805
  }
806
806
  function d() {
807
- const w = n();
808
- c(w === "dark" ? "light" : "dark");
807
+ const g = n();
808
+ l(g === "dark" ? "light" : "dark");
809
809
  }
810
- function p(w, h = null) {
811
- const m = fe(w);
812
- h ? a[h] = { ...a[h], ...m } : (a.dark = { ...a.dark, ...m }, a.light = { ...a.light, ...m }), l();
810
+ function p(g, f = null) {
811
+ const b = he(g);
812
+ f ? a[f] = { ...a[f], ...b } : (a.dark = { ...a.dark, ...b }, a.light = { ...a.light, ...b }), u();
813
813
  }
814
- function u(w) {
815
- const h = window.matchMedia("(prefers-color-scheme: dark)"), m = (g) => {
816
- r === "auto" && (l(), w && w(g.matches ? "dark" : "light"));
814
+ function m(g) {
815
+ const f = window.matchMedia("(prefers-color-scheme: dark)"), b = (h) => {
816
+ r === "auto" && (u(), g && g(h.matches ? "dark" : "light"));
817
817
  };
818
- return h.addEventListener("change", m), () => {
819
- h.removeEventListener("change", m);
818
+ return f.addEventListener("change", b), () => {
819
+ f.removeEventListener("change", b);
820
820
  };
821
821
  }
822
- function f() {
822
+ function c() {
823
823
  return `
824
824
  :root,
825
825
  [data-artifactuse-theme="dark"] {
826
- ${Object.entries(a.dark).map(([w, h]) => `--artifactuse-${ae(w)}: ${h};`).join(`
826
+ ${Object.entries(a.dark).map(([g, f]) => `--artifactuse-${se(g)}: ${f};`).join(`
827
827
  `)}
828
828
  }
829
829
 
830
830
  [data-artifactuse-theme="light"] {
831
- ${Object.entries(a.light).map(([w, h]) => `--artifactuse-${ae(w)}: ${h};`).join(`
831
+ ${Object.entries(a.light).map(([g, f]) => `--artifactuse-${se(g)}: ${f};`).join(`
832
832
  `)}
833
833
  }
834
834
 
835
835
  @media (prefers-color-scheme: light) {
836
836
  :root:not([data-artifactuse-theme]) {
837
- ${Object.entries(a.light).map(([w, h]) => `--artifactuse-${ae(w)}: ${h};`).join(`
837
+ ${Object.entries(a.light).map(([g, f]) => `--artifactuse-${se(g)}: ${f};`).join(`
838
838
  `)}
839
839
  }
840
840
  }
@@ -853,37 +853,37 @@ function ta(e = "auto", t = {}) {
853
853
  getResolvedTheme: n,
854
854
  getColors: o,
855
855
  getCSSVariables: i,
856
- getCSS: f,
857
- apply: l,
858
- set: c,
856
+ getCSS: c,
857
+ apply: u,
858
+ set: l,
859
859
  toggle: d,
860
860
  setColors: p,
861
- watchSystemTheme: u
861
+ watchSystemTheme: m
862
862
  };
863
863
  }
864
- function ae(e) {
864
+ function se(e) {
865
865
  return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
866
866
  }
867
- const Fe = "artifactuse_auth", ur = "https://app.artifactuse.com", ue = "https://api.artifactuse.com";
868
- function Ae() {
867
+ const Ve = "artifactuse_auth", dr = "https://app.artifactuse.com", de = "https://api.artifactuse.com";
868
+ function Re() {
869
869
  if (typeof window > "u" || !window.localStorage)
870
870
  return null;
871
871
  try {
872
- const e = localStorage.getItem(Fe);
872
+ const e = localStorage.getItem(Ve);
873
873
  return e ? JSON.parse(e) : null;
874
874
  } catch {
875
875
  return null;
876
876
  }
877
877
  }
878
- function ra(e) {
878
+ function aa(e) {
879
879
  if (!(typeof window > "u" || !window.localStorage))
880
880
  try {
881
- localStorage.setItem(Fe, JSON.stringify(e));
881
+ localStorage.setItem(Ve, JSON.stringify(e));
882
882
  } catch {
883
883
  }
884
884
  }
885
- async function aa(e, t = {}) {
886
- const { apiUrl: r = ue } = t, a = await fetch(`${r}/v1/project/share`, {
885
+ async function sa(e, t = {}) {
886
+ const { apiUrl: r = de } = t, a = await fetch(`${r}/v1/project/share`, {
887
887
  method: "POST",
888
888
  headers: {
889
889
  "Content-Type": "application/json"
@@ -900,8 +900,8 @@ async function aa(e, t = {}) {
900
900
  }
901
901
  return a.json();
902
902
  }
903
- async function sa(e, t = {}) {
904
- const { apiUrl: r = ue, getStoredAuthData: a = Ae } = t, s = a();
903
+ async function na(e, t = {}) {
904
+ const { apiUrl: r = de, getStoredAuthData: a = Re } = t, s = a();
905
905
  if (!(s != null && s.token))
906
906
  throw new Error("Authentication required. Please sign in first.");
907
907
  const n = await fetch(`${r}/v1/project/save`, {
@@ -922,42 +922,42 @@ async function sa(e, t = {}) {
922
922
  }
923
923
  return n.json();
924
924
  }
925
- function na(e = {}) {
925
+ function ia(e = {}) {
926
926
  const {
927
- appUrl: t = ur,
928
- setStoredAuthData: r = ra,
929
- getStoredAuthData: a = Ae
927
+ appUrl: t = dr,
928
+ setStoredAuthData: r = aa,
929
+ getStoredAuthData: a = Re
930
930
  } = e;
931
931
  return new Promise((s, n) => {
932
- const o = window.location.origin, i = `${t}/sdk/auth?origin=${encodeURIComponent(o)}`, l = window.open(
932
+ const o = window.location.origin, i = `${t}/sdk/auth?origin=${encodeURIComponent(o)}`, u = window.open(
933
933
  i,
934
934
  "Artifactuse Auth",
935
935
  "width=500,height=600,scrollbars=yes"
936
936
  );
937
- if (!l) {
937
+ if (!u) {
938
938
  n(new Error("Failed to open auth popup. Please allow popups for this site."));
939
939
  return;
940
940
  }
941
- const c = (p) => {
942
- var u;
943
- if (p.origin === t && ((u = p.data) == null ? void 0 : u.type) === "sdk-auth") {
944
- window.removeEventListener("message", c);
945
- const { token: f, user: w } = p.data;
946
- f ? (r({ token: f, user: w }), s({ token: f, user: w })) : n(new Error("Authentication failed"));
941
+ const l = (p) => {
942
+ var m;
943
+ if (p.origin === t && ((m = p.data) == null ? void 0 : m.type) === "sdk-auth") {
944
+ window.removeEventListener("message", l);
945
+ const { token: c, user: g } = p.data;
946
+ c ? (r({ token: c, user: g }), s({ token: c, user: g })) : n(new Error("Authentication failed"));
947
947
  }
948
948
  };
949
- window.addEventListener("message", c);
949
+ window.addEventListener("message", l);
950
950
  const d = setInterval(() => {
951
- if (l.closed) {
952
- clearInterval(d), window.removeEventListener("message", c);
951
+ if (u.closed) {
952
+ clearInterval(d), window.removeEventListener("message", l);
953
953
  const p = a();
954
954
  p != null && p.token ? s(p) : n(new Error("Authentication cancelled"));
955
955
  }
956
956
  }, 500);
957
957
  });
958
958
  }
959
- async function ia(e = {}) {
960
- const { apiUrl: t = ue, language: r, getStoredAuthData: a = Ae } = e, s = a();
959
+ async function oa(e = {}) {
960
+ const { apiUrl: t = de, language: r, getStoredAuthData: a = Re } = e, s = a();
961
961
  if (!(s != null && s.token))
962
962
  throw new Error("Authentication required. Please sign in first.");
963
963
  const n = new URLSearchParams();
@@ -975,8 +975,8 @@ async function ia(e = {}) {
975
975
  }
976
976
  return o.json();
977
977
  }
978
- async function oa(e, t, r = {}) {
979
- const { apiUrl: a = ue, getStoredAuthData: s = Ae } = r, n = s();
978
+ async function ca(e, t, r = {}) {
979
+ const { apiUrl: a = de, getStoredAuthData: s = Re } = r, n = s();
980
980
  if (!(n != null && n.token))
981
981
  throw new Error("Authentication required. Please sign in first.");
982
982
  const o = await fetch(`${a}/v1/project/update`, {
@@ -997,11 +997,11 @@ async function oa(e, t, r = {}) {
997
997
  }
998
998
  return o.json();
999
999
  }
1000
- function ca(e = {}) {
1000
+ function la(e = {}) {
1001
1001
  const {
1002
- apiUrl: t = ue,
1003
- appUrl: r = ur,
1004
- storageKey: a = Fe,
1002
+ apiUrl: t = de,
1003
+ appUrl: r = dr,
1004
+ storageKey: a = Ve,
1005
1005
  enabled: s = !0,
1006
1006
  allowAnonymous: n = !0,
1007
1007
  expiryDays: o = 30
@@ -1015,14 +1015,14 @@ function ca(e = {}) {
1015
1015
  return null;
1016
1016
  }
1017
1017
  }
1018
- function l(d) {
1018
+ function u(d) {
1019
1019
  if (!(typeof window > "u" || !window.localStorage))
1020
1020
  try {
1021
1021
  localStorage.setItem(a, JSON.stringify(d));
1022
1022
  } catch {
1023
1023
  }
1024
1024
  }
1025
- function c() {
1025
+ function l() {
1026
1026
  if (!(typeof window > "u" || !window.localStorage))
1027
1027
  try {
1028
1028
  localStorage.removeItem(a);
@@ -1045,25 +1045,25 @@ function ca(e = {}) {
1045
1045
  return ((p = (d = i()) == null ? void 0 : d.user) == null ? void 0 : p.email) || "";
1046
1046
  },
1047
1047
  getStoredAuthData: i,
1048
- setStoredAuthData: l,
1049
- clearStoredAuthData: c,
1050
- signOut: c,
1048
+ setStoredAuthData: u,
1049
+ clearStoredAuthData: l,
1050
+ signOut: l,
1051
1051
  // API methods
1052
- share: (d) => aa(d, { apiUrl: t }),
1053
- save: (d) => sa(d, { apiUrl: t, getStoredAuthData: i }),
1054
- listArtifacts: (d) => ia({ apiUrl: t, language: d, getStoredAuthData: i }),
1055
- updateArtifact: (d, p) => oa(d, p, { apiUrl: t, getStoredAuthData: i }),
1056
- openAuthPopup: () => na({ appUrl: r, setStoredAuthData: l, getStoredAuthData: i })
1052
+ share: (d) => sa(d, { apiUrl: t }),
1053
+ save: (d) => na(d, { apiUrl: t, getStoredAuthData: i }),
1054
+ listArtifacts: (d) => oa({ apiUrl: t, language: d, getStoredAuthData: i }),
1055
+ updateArtifact: (d, p) => ca(d, p, { apiUrl: t, getStoredAuthData: i }),
1056
+ openAuthPopup: () => ia({ appUrl: r, setStoredAuthData: u, getStoredAuthData: i })
1057
1057
  };
1058
1058
  }
1059
- function la(e = {}) {
1059
+ function ua(e = {}) {
1060
1060
  const t = e.modules || null;
1061
1061
  let r = e.theme || "dark";
1062
1062
  function a() {
1063
1063
  return !!(t != null && t.state && (t != null && t.view));
1064
1064
  }
1065
- function s(p) {
1066
- return p.theme({
1065
+ function s(m) {
1066
+ return m.theme({
1067
1067
  "&": {
1068
1068
  backgroundColor: "#1e1e1e",
1069
1069
  color: "#e4e4e7",
@@ -1135,8 +1135,8 @@ function la(e = {}) {
1135
1135
  }
1136
1136
  }, { dark: !0 });
1137
1137
  }
1138
- function n(p) {
1139
- return p.theme({
1138
+ function n(m) {
1139
+ return m.theme({
1140
1140
  "&": {
1141
1141
  backgroundColor: "#ffffff",
1142
1142
  color: "#27272a",
@@ -1209,173 +1209,209 @@ function la(e = {}) {
1209
1209
  }
1210
1210
  }, { dark: !1 });
1211
1211
  }
1212
- function o(p, u, f) {
1213
- return f ? p.define([
1214
- { tag: u.keyword, color: "#c084fc" },
1215
- { tag: u.operator, color: "#94a3b8" },
1216
- { tag: u.special(u.variableName), color: "#67e8f9" },
1217
- { tag: u.typeName, color: "#fbbf24" },
1218
- { tag: u.atom, color: "#fb923c" },
1219
- { tag: u.number, color: "#fb923c" },
1220
- { tag: u.definition(u.variableName), color: "#67e8f9" },
1221
- { tag: u.string, color: "#86efac" },
1222
- { tag: u.special(u.string), color: "#86efac" },
1223
- { tag: u.comment, color: "#6b7280", fontStyle: "italic" },
1224
- { tag: u.variableName, color: "#e4e4e7" },
1225
- { tag: u.tagName, color: "#f87171" },
1226
- { tag: u.bracket, color: "#a1a1aa" },
1227
- { tag: u.meta, color: "#fbbf24" },
1228
- { tag: u.link, color: "#60a5fa", textDecoration: "underline" },
1229
- { tag: u.heading, fontWeight: "bold", color: "#f472b6" },
1230
- { tag: u.emphasis, fontStyle: "italic" },
1231
- { tag: u.strong, fontWeight: "bold" },
1232
- { tag: u.strikethrough, textDecoration: "line-through" },
1233
- { tag: u.className, color: "#fbbf24" },
1234
- { tag: u.propertyName, color: "#60a5fa" },
1235
- { tag: u.function(u.variableName), color: "#60a5fa" },
1236
- { tag: u.function(u.propertyName), color: "#60a5fa" },
1237
- { tag: u.bool, color: "#fb923c" },
1238
- { tag: u.null, color: "#fb923c" },
1239
- { tag: u.regexp, color: "#f87171" }
1240
- ]) : p.define([
1241
- { tag: u.keyword, color: "#7c3aed" },
1242
- { tag: u.operator, color: "#64748b" },
1243
- { tag: u.special(u.variableName), color: "#0891b2" },
1244
- { tag: u.typeName, color: "#d97706" },
1245
- { tag: u.atom, color: "#ea580c" },
1246
- { tag: u.number, color: "#ea580c" },
1247
- { tag: u.definition(u.variableName), color: "#0891b2" },
1248
- { tag: u.string, color: "#16a34a" },
1249
- { tag: u.special(u.string), color: "#16a34a" },
1250
- { tag: u.comment, color: "#9ca3af", fontStyle: "italic" },
1251
- { tag: u.variableName, color: "#27272a" },
1252
- { tag: u.tagName, color: "#dc2626" },
1253
- { tag: u.bracket, color: "#71717a" },
1254
- { tag: u.meta, color: "#d97706" },
1255
- { tag: u.link, color: "#2563eb", textDecoration: "underline" },
1256
- { tag: u.heading, fontWeight: "bold", color: "#db2777" },
1257
- { tag: u.emphasis, fontStyle: "italic" },
1258
- { tag: u.strong, fontWeight: "bold" },
1259
- { tag: u.strikethrough, textDecoration: "line-through" },
1260
- { tag: u.className, color: "#d97706" },
1261
- { tag: u.propertyName, color: "#2563eb" },
1262
- { tag: u.function(u.variableName), color: "#2563eb" },
1263
- { tag: u.function(u.propertyName), color: "#2563eb" },
1264
- { tag: u.bool, color: "#ea580c" },
1265
- { tag: u.null, color: "#ea580c" },
1266
- { tag: u.regexp, color: "#dc2626" }
1212
+ function o(m, c, g) {
1213
+ return g ? m.define([
1214
+ { tag: c.keyword, color: "#c084fc" },
1215
+ { tag: c.operator, color: "#94a3b8" },
1216
+ { tag: c.special(c.variableName), color: "#67e8f9" },
1217
+ { tag: c.typeName, color: "#fbbf24" },
1218
+ { tag: c.atom, color: "#fb923c" },
1219
+ { tag: c.number, color: "#fb923c" },
1220
+ { tag: c.definition(c.variableName), color: "#67e8f9" },
1221
+ { tag: c.string, color: "#86efac" },
1222
+ { tag: c.special(c.string), color: "#86efac" },
1223
+ { tag: c.comment, color: "#6b7280", fontStyle: "italic" },
1224
+ { tag: c.variableName, color: "#e4e4e7" },
1225
+ { tag: c.tagName, color: "#f87171" },
1226
+ { tag: c.bracket, color: "#a1a1aa" },
1227
+ { tag: c.meta, color: "#fbbf24" },
1228
+ { tag: c.link, color: "#60a5fa", textDecoration: "underline" },
1229
+ { tag: c.heading, fontWeight: "bold", color: "#f472b6" },
1230
+ { tag: c.emphasis, fontStyle: "italic" },
1231
+ { tag: c.strong, fontWeight: "bold" },
1232
+ { tag: c.strikethrough, textDecoration: "line-through" },
1233
+ { tag: c.className, color: "#fbbf24" },
1234
+ { tag: c.propertyName, color: "#60a5fa" },
1235
+ { tag: c.function(c.variableName), color: "#60a5fa" },
1236
+ { tag: c.function(c.propertyName), color: "#60a5fa" },
1237
+ { tag: c.bool, color: "#fb923c" },
1238
+ { tag: c.null, color: "#fb923c" },
1239
+ { tag: c.regexp, color: "#f87171" }
1240
+ ]) : m.define([
1241
+ { tag: c.keyword, color: "#7c3aed" },
1242
+ { tag: c.operator, color: "#64748b" },
1243
+ { tag: c.special(c.variableName), color: "#0891b2" },
1244
+ { tag: c.typeName, color: "#d97706" },
1245
+ { tag: c.atom, color: "#ea580c" },
1246
+ { tag: c.number, color: "#ea580c" },
1247
+ { tag: c.definition(c.variableName), color: "#0891b2" },
1248
+ { tag: c.string, color: "#16a34a" },
1249
+ { tag: c.special(c.string), color: "#16a34a" },
1250
+ { tag: c.comment, color: "#9ca3af", fontStyle: "italic" },
1251
+ { tag: c.variableName, color: "#27272a" },
1252
+ { tag: c.tagName, color: "#dc2626" },
1253
+ { tag: c.bracket, color: "#71717a" },
1254
+ { tag: c.meta, color: "#d97706" },
1255
+ { tag: c.link, color: "#2563eb", textDecoration: "underline" },
1256
+ { tag: c.heading, fontWeight: "bold", color: "#db2777" },
1257
+ { tag: c.emphasis, fontStyle: "italic" },
1258
+ { tag: c.strong, fontWeight: "bold" },
1259
+ { tag: c.strikethrough, textDecoration: "line-through" },
1260
+ { tag: c.className, color: "#d97706" },
1261
+ { tag: c.propertyName, color: "#2563eb" },
1262
+ { tag: c.function(c.variableName), color: "#2563eb" },
1263
+ { tag: c.function(c.propertyName), color: "#2563eb" },
1264
+ { tag: c.bool, color: "#ea580c" },
1265
+ { tag: c.null, color: "#ea580c" },
1266
+ { tag: c.regexp, color: "#dc2626" }
1267
1267
  ]);
1268
1268
  }
1269
- function i(p) {
1270
- const u = p == null ? void 0 : p.toLowerCase();
1271
- return (u === "javascript" || u === "js" || u === "jsx" || u === "tsx" || u === "typescript" || u === "ts") && t.langJavascript ? t.langJavascript.javascript() : (u === "python" || u === "py") && t.langPython ? t.langPython.python() : [];
1269
+ const i = {
1270
+ javascript: { mod: "langJavascript", fn: "javascript" },
1271
+ js: { mod: "langJavascript", fn: "javascript" },
1272
+ jsx: { mod: "langJavascript", fn: "javascript", opts: { jsx: !0 } },
1273
+ typescript: { mod: "langJavascript", fn: "javascript", opts: { typescript: !0 } },
1274
+ ts: { mod: "langJavascript", fn: "javascript", opts: { typescript: !0 } },
1275
+ tsx: { mod: "langJavascript", fn: "javascript", opts: { jsx: !0, typescript: !0 } },
1276
+ python: { mod: "langPython", fn: "python" },
1277
+ py: { mod: "langPython", fn: "python" },
1278
+ html: { mod: "langHtml", fn: "html" },
1279
+ htm: { mod: "langHtml", fn: "html" },
1280
+ css: { mod: "langCss", fn: "css" },
1281
+ json: { mod: "langJson", fn: "json" },
1282
+ markdown: { mod: "langMarkdown", fn: "markdown" },
1283
+ md: { mod: "langMarkdown", fn: "markdown" },
1284
+ xml: { mod: "langXml", fn: "xml" },
1285
+ yaml: { mod: "langYaml", fn: "yaml" },
1286
+ yml: { mod: "langYaml", fn: "yaml" },
1287
+ sql: { mod: "langSql", fn: "sql" },
1288
+ java: { mod: "langJava", fn: "java" },
1289
+ cpp: { mod: "langCpp", fn: "cpp" },
1290
+ c: { mod: "langCpp", fn: "cpp" },
1291
+ "c++": { mod: "langCpp", fn: "cpp" },
1292
+ go: { mod: "langGo", fn: "go" },
1293
+ golang: { mod: "langGo", fn: "go" },
1294
+ rust: { mod: "langRust", fn: "rust" },
1295
+ rs: { mod: "langRust", fn: "rust" },
1296
+ php: { mod: "langPhp", fn: "php" },
1297
+ vue: { mod: "langVue", fn: "vue" },
1298
+ angular: { mod: "langAngular", fn: "angular" },
1299
+ less: { mod: "langLess", fn: "less" },
1300
+ sass: { mod: "langSass", fn: "sass", opts: { indented: !0 } },
1301
+ scss: { mod: "langSass", fn: "sass" }
1302
+ };
1303
+ function u(m) {
1304
+ const c = i[m == null ? void 0 : m.toLowerCase()];
1305
+ if (!c) return [];
1306
+ const g = t[c.mod];
1307
+ return !g || typeof g[c.fn] != "function" ? [] : c.opts ? g[c.fn](c.opts) : g[c.fn]();
1272
1308
  }
1273
- function l(p) {
1274
- return r === "auto" ? p === "dark" : r === "dark";
1309
+ function l(m) {
1310
+ return r === "auto" ? m === "dark" : r === "dark";
1275
1311
  }
1276
- function c(p, u = {}) {
1277
- var tt, rt;
1312
+ function d(m, c = {}) {
1313
+ var rt, at;
1278
1314
  if (!a())
1279
1315
  return console.warn("Artifactuse: CodeMirror modules not provided. Editor not available."), null;
1280
- const { EditorState: f } = t.state, {
1281
- EditorView: w,
1282
- keymap: h,
1283
- lineNumbers: m,
1284
- highlightActiveLineGutter: g,
1285
- highlightSpecialChars: b,
1286
- drawSelection: v,
1287
- dropCursor: y,
1288
- rectangularSelection: $,
1289
- crosshairCursor: A,
1290
- highlightActiveLine: S
1291
- } = t.view, { defaultKeymap: C, history: q, historyKeymap: R, indentWithTab: T } = t.commands, {
1292
- indentOnInput: z,
1316
+ const { EditorState: g } = t.state, {
1317
+ EditorView: f,
1318
+ keymap: b,
1319
+ lineNumbers: h,
1320
+ highlightActiveLineGutter: w,
1321
+ highlightSpecialChars: v,
1322
+ drawSelection: y,
1323
+ dropCursor: $,
1324
+ rectangularSelection: A,
1325
+ crosshairCursor: S,
1326
+ highlightActiveLine: C
1327
+ } = t.view, { defaultKeymap: V, history: R, historyKeymap: P, indentWithTab: I } = t.commands, {
1328
+ indentOnInput: _,
1293
1329
  syntaxHighlighting: Z,
1294
- bracketMatching: D,
1295
- foldGutter: U,
1296
- foldKeymap: J,
1330
+ bracketMatching: G,
1331
+ foldGutter: Y,
1332
+ foldKeymap: F,
1297
1333
  HighlightStyle: k
1298
1334
  } = t.language, {
1299
- closeBrackets: M,
1335
+ closeBrackets: z,
1300
1336
  closeBracketsKeymap: x,
1301
1337
  autocompletion: j,
1302
- completionKeymap: I
1303
- } = t.autocomplete, P = ((tt = t.lezerHighlight) == null ? void 0 : tt.tags) || ((rt = t.language) == null ? void 0 : rt.tags), Y = l(u.sdkTheme), Pr = Y ? s(w) : n(w), et = [
1304
- m(),
1305
- g(),
1306
- b(),
1307
- q(),
1308
- U({
1338
+ completionKeymap: q
1339
+ } = t.autocomplete, E = ((rt = t.lezerHighlight) == null ? void 0 : rt.tags) || ((at = t.language) == null ? void 0 : at.tags), ee = l(c.sdkTheme), jr = ee ? s(f) : n(f), tt = [
1340
+ h(),
1341
+ w(),
1342
+ v(),
1343
+ R(),
1344
+ Y({
1309
1345
  openText: "▾",
1310
1346
  closedText: "▸"
1311
1347
  }),
1312
- v(),
1313
1348
  y(),
1314
- f.allowMultipleSelections.of(!0),
1349
+ $(),
1350
+ g.allowMultipleSelections.of(!0),
1351
+ _(),
1352
+ ...E ? [Z(o(k, E, ee))] : [],
1353
+ G(),
1315
1354
  z(),
1316
- ...P ? [Z(o(k, P, Y))] : [],
1317
- D(),
1318
- M(),
1319
1355
  j(),
1320
- $(),
1321
1356
  A(),
1322
1357
  S(),
1323
- h.of([
1358
+ C(),
1359
+ b.of([
1324
1360
  ...x,
1325
- ...C,
1326
- ...R,
1327
- ...J,
1328
- ...I,
1329
- T
1361
+ ...V,
1362
+ ...P,
1363
+ ...F,
1364
+ ...q,
1365
+ I
1330
1366
  ]),
1331
- i(u.language),
1332
- Pr
1367
+ u(c.language),
1368
+ jr
1333
1369
  ];
1334
- u.onChange && et.push(
1335
- w.updateListener.of((re) => {
1336
- re.docChanged && u.onChange(re.state.doc.toString());
1370
+ c.onChange && tt.push(
1371
+ f.updateListener.of((ae) => {
1372
+ ae.docChanged && c.onChange(ae.state.doc.toString());
1337
1373
  })
1338
1374
  );
1339
- const Ir = f.create({
1340
- doc: u.code || "",
1341
- extensions: et
1342
- }), te = new w({
1375
+ const Ir = g.create({
1376
+ doc: c.code || "",
1377
+ extensions: tt
1378
+ }), re = new f({
1343
1379
  state: Ir,
1344
- parent: p
1380
+ parent: m
1345
1381
  });
1346
1382
  return {
1347
- view: te,
1383
+ view: re,
1348
1384
  getCode() {
1349
- return te.state.doc.toString();
1385
+ return re.state.doc.toString();
1350
1386
  },
1351
- setCode(re) {
1352
- const at = te.state.doc.toString();
1353
- at !== re && te.dispatch({
1354
- changes: { from: 0, to: at.length, insert: re }
1387
+ setCode(ae) {
1388
+ const st = re.state.doc.toString();
1389
+ st !== ae && re.dispatch({
1390
+ changes: { from: 0, to: st.length, insert: ae }
1355
1391
  });
1356
1392
  },
1357
1393
  destroy() {
1358
- te.destroy();
1394
+ re.destroy();
1359
1395
  }
1360
1396
  };
1361
1397
  }
1362
- function d(p) {
1363
- r = p;
1398
+ function p(m) {
1399
+ r = m;
1364
1400
  }
1365
1401
  return {
1366
1402
  isAvailable: a,
1367
- create: c,
1368
- setTheme: d
1403
+ create: d,
1404
+ setTheme: p
1369
1405
  };
1370
1406
  }
1371
- function Ve() {
1407
+ function Ne() {
1372
1408
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
1373
1409
  }
1374
- var Q = Ve();
1375
- function dr(e) {
1410
+ var Q = Ne();
1411
+ function pr(e) {
1376
1412
  Q = e;
1377
1413
  }
1378
- var le = { exec: () => null };
1414
+ var ue = { exec: () => null };
1379
1415
  function L(e, t = "") {
1380
1416
  let r = typeof e == "string" ? e : e.source, a = { replace: (s, n) => {
1381
1417
  let o = typeof n == "string" ? n : n.source;
@@ -1383,21 +1419,21 @@ function L(e, t = "") {
1383
1419
  }, getRegex: () => new RegExp(r, t) };
1384
1420
  return a;
1385
1421
  }
1386
- var ua = (() => {
1422
+ var da = (() => {
1387
1423
  try {
1388
1424
  return !!new RegExp("(?<=1)(?<!1)");
1389
1425
  } catch {
1390
1426
  return !1;
1391
1427
  }
1392
- })(), H = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (e) => new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}#`), htmlBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i") }, da = /^(?:[ \t]*(?:\n|$))+/, pa = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, fa = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, de = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ha = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Ne = /(?:[*+-]|\d{1,9}[.)])/, pr = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, fr = L(pr).replace(/bull/g, Ne).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), ga = L(pr).replace(/bull/g, Ne).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Ue = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, ma = /^[^\n]+/, Ge = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ba = L(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Ge).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), wa = L(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Ne).getRegex(), Re = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", We = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ya = L("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", We).replace("tag", Re).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), hr = L(Ue).replace("hr", de).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Re).getRegex(), va = L(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", hr).getRegex(), Xe = { blockquote: va, code: pa, def: ba, fences: fa, heading: ha, hr: de, html: ya, lheading: fr, list: wa, newline: da, paragraph: hr, table: le, text: ma }, ot = L("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", de).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Re).getRegex(), ka = { ...Xe, lheading: ga, table: ot, paragraph: L(Ue).replace("hr", de).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ot).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Re).getRegex() }, xa = { ...Xe, html: L(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", We).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: le, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: L(Ue).replace("hr", de).replace("heading", ` *#{1,6} *[^
1393
- ]`).replace("lheading", fr).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, $a = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Aa = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, gr = /^( {2,}|\\)\n(?!\s*$)/, Ra = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Se = /[\p{P}\p{S}]/u, Ke = /[\s\p{P}\p{S}]/u, mr = /[^\s\p{P}\p{S}]/u, Sa = L(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Ke).getRegex(), br = /(?!~)[\p{P}\p{S}]/u, za = /(?!~)[\s\p{P}\p{S}]/u, Ca = /(?:[^\s\p{P}\p{S}]|~)/u, La = L(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", ua ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), wr = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Ma = L(wr, "u").replace(/punct/g, Se).getRegex(), _a = L(wr, "u").replace(/punct/g, br).getRegex(), yr = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ea = L(yr, "gu").replace(/notPunctSpace/g, mr).replace(/punctSpace/g, Ke).replace(/punct/g, Se).getRegex(), Ta = L(yr, "gu").replace(/notPunctSpace/g, Ca).replace(/punctSpace/g, za).replace(/punct/g, br).getRegex(), Pa = L("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, mr).replace(/punctSpace/g, Ke).replace(/punct/g, Se).getRegex(), Ia = L(/\\(punct)/, "gu").replace(/punct/g, Se).getRegex(), ja = L(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Za = L(We).replace("(?:-->|$)", "-->").getRegex(), qa = L("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Za).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), we = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ha = L(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", we).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), vr = L(/^!?\[(label)\]\[(ref)\]/).replace("label", we).replace("ref", Ge).getRegex(), kr = L(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ge).getRegex(), Da = L("reflink|nolink(?!\\()", "g").replace("reflink", vr).replace("nolink", kr).getRegex(), ct = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Qe = { _backpedal: le, anyPunctuation: Ia, autolink: ja, blockSkip: La, br: gr, code: Aa, del: le, emStrongLDelim: Ma, emStrongRDelimAst: Ea, emStrongRDelimUnd: Pa, escape: $a, link: Ha, nolink: kr, punctuation: Sa, reflink: vr, reflinkSearch: Da, tag: qa, text: Ra, url: le }, Oa = { ...Qe, link: L(/^!?\[(label)\]\((.*?)\)/).replace("label", we).getRegex(), reflink: L(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", we).getRegex() }, _e = { ...Qe, emStrongRDelimAst: Ta, emStrongLDelim: _a, url: L(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ct).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: L(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ct).getRegex() }, Ba = { ..._e, br: L(gr).replace("{2,}", "*").getRegex(), text: L(_e.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, he = { normal: Xe, gfm: ka, pedantic: xa }, se = { normal: Qe, gfm: _e, breaks: Ba, pedantic: Oa }, Fa = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, lt = (e) => Fa[e];
1394
- function V(e, t) {
1428
+ })(), H = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (e) => new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}#`), htmlBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i") }, pa = /^(?:[ \t]*(?:\n|$))+/, fa = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ha = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, pe = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ga = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Ue = /(?:[*+-]|\d{1,9}[.)])/, fr = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, hr = L(fr).replace(/bull/g, Ue).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), ma = L(fr).replace(/bull/g, Ue).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Ge = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, ba = /^[^\n]+/, We = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, wa = L(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", We).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), ya = L(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Ue).getRegex(), Se = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Xe = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, va = L("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Xe).replace("tag", Se).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), gr = L(Ge).replace("hr", pe).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Se).getRegex(), ka = L(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", gr).getRegex(), Ke = { blockquote: ka, code: fa, def: wa, fences: ha, heading: ga, hr: pe, html: va, lheading: hr, list: ya, newline: pa, paragraph: gr, table: ue, text: ba }, ct = L("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", pe).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Se).getRegex(), xa = { ...Ke, lheading: ma, table: ct, paragraph: L(Ge).replace("hr", pe).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ct).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Se).getRegex() }, $a = { ...Ke, html: L(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", Xe).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: ue, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: L(Ge).replace("hr", pe).replace("heading", ` *#{1,6} *[^
1429
+ ]`).replace("lheading", hr).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Aa = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ra = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, mr = /^( {2,}|\\)\n(?!\s*$)/, Sa = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, ze = /[\p{P}\p{S}]/u, Je = /[\s\p{P}\p{S}]/u, br = /[^\s\p{P}\p{S}]/u, za = L(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Je).getRegex(), wr = /(?!~)[\p{P}\p{S}]/u, Ca = /(?!~)[\s\p{P}\p{S}]/u, La = /(?:[^\s\p{P}\p{S}]|~)/u, Ma = L(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", da ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), yr = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, _a = L(yr, "u").replace(/punct/g, ze).getRegex(), Ea = L(yr, "u").replace(/punct/g, wr).getRegex(), vr = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ta = L(vr, "gu").replace(/notPunctSpace/g, br).replace(/punctSpace/g, Je).replace(/punct/g, ze).getRegex(), Pa = L(vr, "gu").replace(/notPunctSpace/g, La).replace(/punctSpace/g, Ca).replace(/punct/g, wr).getRegex(), ja = L("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, br).replace(/punctSpace/g, Je).replace(/punct/g, ze).getRegex(), Ia = L(/\\(punct)/, "gu").replace(/punct/g, ze).getRegex(), qa = L(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ha = L(Xe).replace("(?:-->|$)", "-->").getRegex(), Za = L("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ha).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), ye = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Da = L(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", ye).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), kr = L(/^!?\[(label)\]\[(ref)\]/).replace("label", ye).replace("ref", We).getRegex(), xr = L(/^!?\[(ref)\](?:\[\])?/).replace("ref", We).getRegex(), Ba = L("reflink|nolink(?!\\()", "g").replace("reflink", kr).replace("nolink", xr).getRegex(), lt = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Qe = { _backpedal: ue, anyPunctuation: Ia, autolink: qa, blockSkip: Ma, br: mr, code: Ra, del: ue, emStrongLDelim: _a, emStrongRDelimAst: Ta, emStrongRDelimUnd: ja, escape: Aa, link: Da, nolink: xr, punctuation: za, reflink: kr, reflinkSearch: Ba, tag: Za, text: Sa, url: ue }, Oa = { ...Qe, link: L(/^!?\[(label)\]\((.*?)\)/).replace("label", ye).getRegex(), reflink: L(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", ye).getRegex() }, Ee = { ...Qe, emStrongRDelimAst: Pa, emStrongLDelim: Ea, url: L(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", lt).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: L(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", lt).getRegex() }, Fa = { ...Ee, br: L(mr).replace("{2,}", "*").getRegex(), text: L(Ee.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, ge = { normal: Ke, gfm: xa, pedantic: $a }, ne = { normal: Qe, gfm: Ee, breaks: Fa, pedantic: Oa }, Va = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, ut = (e) => Va[e];
1430
+ function N(e, t) {
1395
1431
  if (t) {
1396
- if (H.escapeTest.test(e)) return e.replace(H.escapeReplace, lt);
1397
- } else if (H.escapeTestNoEncode.test(e)) return e.replace(H.escapeReplaceNoEncode, lt);
1432
+ if (H.escapeTest.test(e)) return e.replace(H.escapeReplace, ut);
1433
+ } else if (H.escapeTestNoEncode.test(e)) return e.replace(H.escapeReplaceNoEncode, ut);
1398
1434
  return e;
1399
1435
  }
1400
- function ut(e) {
1436
+ function dt(e) {
1401
1437
  try {
1402
1438
  e = encodeURI(e).replace(H.percentDecode, "%");
1403
1439
  } catch {
@@ -1405,19 +1441,19 @@ function ut(e) {
1405
1441
  }
1406
1442
  return e;
1407
1443
  }
1408
- function dt(e, t) {
1444
+ function pt(e, t) {
1409
1445
  var n;
1410
- let r = e.replace(H.findPipe, (o, i, l) => {
1411
- let c = !1, d = i;
1412
- for (; --d >= 0 && l[d] === "\\"; ) c = !c;
1413
- return c ? "|" : " |";
1446
+ let r = e.replace(H.findPipe, (o, i, u) => {
1447
+ let l = !1, d = i;
1448
+ for (; --d >= 0 && u[d] === "\\"; ) l = !l;
1449
+ return l ? "|" : " |";
1414
1450
  }), a = r.split(H.splitPipe), s = 0;
1415
1451
  if (a[0].trim() || a.shift(), a.length > 0 && !((n = a.at(-1)) != null && n.trim()) && a.pop(), t) if (a.length > t) a.splice(t);
1416
1452
  else for (; a.length < t; ) a.push("");
1417
1453
  for (; s < a.length; s++) a[s] = a[s].trim().replace(H.slashPipe, "|");
1418
1454
  return a;
1419
1455
  }
1420
- function ne(e, t, r) {
1456
+ function ie(e, t, r) {
1421
1457
  let a = e.length;
1422
1458
  if (a === 0) return "";
1423
1459
  let s = 0;
@@ -1425,7 +1461,7 @@ function ne(e, t, r) {
1425
1461
  s++;
1426
1462
  return e.slice(0, a - s);
1427
1463
  }
1428
- function Va(e, t) {
1464
+ function Na(e, t) {
1429
1465
  if (e.indexOf(t[1]) === -1) return -1;
1430
1466
  let r = 0;
1431
1467
  for (let a = 0; a < e.length; a++) if (e[a] === "\\") a++;
@@ -1433,13 +1469,13 @@ function Va(e, t) {
1433
1469
  else if (e[a] === t[1] && (r--, r < 0)) return a;
1434
1470
  return r > 0 ? -2 : -1;
1435
1471
  }
1436
- function pt(e, t, r, a, s) {
1472
+ function ft(e, t, r, a, s) {
1437
1473
  let n = t.href, o = t.title || null, i = e[1].replace(s.other.outputLinkReplace, "$1");
1438
1474
  a.state.inLink = !0;
1439
- let l = { type: e[0].charAt(0) === "!" ? "image" : "link", raw: r, href: n, title: o, text: i, tokens: a.inlineTokens(i) };
1440
- return a.state.inLink = !1, l;
1475
+ let u = { type: e[0].charAt(0) === "!" ? "image" : "link", raw: r, href: n, title: o, text: i, tokens: a.inlineTokens(i) };
1476
+ return a.state.inLink = !1, u;
1441
1477
  }
1442
- function Na(e, t, r) {
1478
+ function Ua(e, t, r) {
1443
1479
  let a = e.match(r.other.indentCodeCompensation);
1444
1480
  if (a === null) return t;
1445
1481
  let s = a[1];
@@ -1452,11 +1488,11 @@ function Na(e, t, r) {
1452
1488
  }).join(`
1453
1489
  `);
1454
1490
  }
1455
- var ye = class {
1491
+ var ve = class {
1456
1492
  constructor(e) {
1457
- E(this, "options");
1458
- E(this, "rules");
1459
- E(this, "lexer");
1493
+ T(this, "options");
1494
+ T(this, "rules");
1495
+ T(this, "lexer");
1460
1496
  this.options = e || Q;
1461
1497
  }
1462
1498
  space(e) {
@@ -1467,14 +1503,14 @@ var ye = class {
1467
1503
  let t = this.rules.block.code.exec(e);
1468
1504
  if (t) {
1469
1505
  let r = t[0].replace(this.rules.other.codeRemoveIndent, "");
1470
- return { type: "code", raw: t[0], codeBlockStyle: "indented", text: this.options.pedantic ? r : ne(r, `
1506
+ return { type: "code", raw: t[0], codeBlockStyle: "indented", text: this.options.pedantic ? r : ie(r, `
1471
1507
  `) };
1472
1508
  }
1473
1509
  }
1474
1510
  fences(e) {
1475
1511
  let t = this.rules.block.fences.exec(e);
1476
1512
  if (t) {
1477
- let r = t[0], a = Na(r, t[3] || "", this.rules);
1513
+ let r = t[0], a = Ua(r, t[3] || "", this.rules);
1478
1514
  return { type: "code", raw: r, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: a };
1479
1515
  }
1480
1516
  }
@@ -1483,7 +1519,7 @@ var ye = class {
1483
1519
  if (t) {
1484
1520
  let r = t[2].trim();
1485
1521
  if (this.rules.other.endingHash.test(r)) {
1486
- let a = ne(r, "#");
1522
+ let a = ie(r, "#");
1487
1523
  (this.options.pedantic || !a || this.rules.other.endingSpaceChar.test(a)) && (r = a.trim());
1488
1524
  }
1489
1525
  return { type: "heading", raw: t[0], depth: t[1].length, text: r, tokens: this.lexer.inline(r) };
@@ -1491,42 +1527,42 @@ var ye = class {
1491
1527
  }
1492
1528
  hr(e) {
1493
1529
  let t = this.rules.block.hr.exec(e);
1494
- if (t) return { type: "hr", raw: ne(t[0], `
1530
+ if (t) return { type: "hr", raw: ie(t[0], `
1495
1531
  `) };
1496
1532
  }
1497
1533
  blockquote(e) {
1498
1534
  let t = this.rules.block.blockquote.exec(e);
1499
1535
  if (t) {
1500
- let r = ne(t[0], `
1536
+ let r = ie(t[0], `
1501
1537
  `).split(`
1502
1538
  `), a = "", s = "", n = [];
1503
1539
  for (; r.length > 0; ) {
1504
- let o = !1, i = [], l;
1505
- for (l = 0; l < r.length; l++) if (this.rules.other.blockquoteStart.test(r[l])) i.push(r[l]), o = !0;
1506
- else if (!o) i.push(r[l]);
1540
+ let o = !1, i = [], u;
1541
+ for (u = 0; u < r.length; u++) if (this.rules.other.blockquoteStart.test(r[u])) i.push(r[u]), o = !0;
1542
+ else if (!o) i.push(r[u]);
1507
1543
  else break;
1508
- r = r.slice(l);
1509
- let c = i.join(`
1510
- `), d = c.replace(this.rules.other.blockquoteSetextReplace, `
1544
+ r = r.slice(u);
1545
+ let l = i.join(`
1546
+ `), d = l.replace(this.rules.other.blockquoteSetextReplace, `
1511
1547
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
1512
1548
  a = a ? `${a}
1513
- ${c}` : c, s = s ? `${s}
1549
+ ${l}` : l, s = s ? `${s}
1514
1550
  ${d}` : d;
1515
1551
  let p = this.lexer.state.top;
1516
1552
  if (this.lexer.state.top = !0, this.lexer.blockTokens(d, n, !0), this.lexer.state.top = p, r.length === 0) break;
1517
- let u = n.at(-1);
1518
- if ((u == null ? void 0 : u.type) === "code") break;
1519
- if ((u == null ? void 0 : u.type) === "blockquote") {
1520
- let f = u, w = f.raw + `
1553
+ let m = n.at(-1);
1554
+ if ((m == null ? void 0 : m.type) === "code") break;
1555
+ if ((m == null ? void 0 : m.type) === "blockquote") {
1556
+ let c = m, g = c.raw + `
1521
1557
  ` + r.join(`
1522
- `), h = this.blockquote(w);
1523
- n[n.length - 1] = h, a = a.substring(0, a.length - f.raw.length) + h.raw, s = s.substring(0, s.length - f.text.length) + h.text;
1558
+ `), f = this.blockquote(g);
1559
+ n[n.length - 1] = f, a = a.substring(0, a.length - c.raw.length) + f.raw, s = s.substring(0, s.length - c.text.length) + f.text;
1524
1560
  break;
1525
- } else if ((u == null ? void 0 : u.type) === "list") {
1526
- let f = u, w = f.raw + `
1561
+ } else if ((m == null ? void 0 : m.type) === "list") {
1562
+ let c = m, g = c.raw + `
1527
1563
  ` + r.join(`
1528
- `), h = this.list(w);
1529
- n[n.length - 1] = h, a = a.substring(0, a.length - u.raw.length) + h.raw, s = s.substring(0, s.length - f.raw.length) + h.raw, r = w.substring(n.at(-1).raw.length).split(`
1564
+ `), f = this.list(g);
1565
+ n[n.length - 1] = f, a = a.substring(0, a.length - m.raw.length) + f.raw, s = s.substring(0, s.length - c.raw.length) + f.raw, r = g.substring(n.at(-1).raw.length).split(`
1530
1566
  `);
1531
1567
  continue;
1532
1568
  }
@@ -1540,56 +1576,56 @@ ${d}` : d;
1540
1576
  if (t) {
1541
1577
  let s = t[1].trim(), n = s.length > 1, o = { type: "list", raw: "", ordered: n, start: n ? +s.slice(0, -1) : "", loose: !1, items: [] };
1542
1578
  s = n ? `\\d{1,9}\\${s.slice(-1)}` : `\\${s}`, this.options.pedantic && (s = n ? s : "[*+-]");
1543
- let i = this.rules.other.listItemRegex(s), l = !1;
1579
+ let i = this.rules.other.listItemRegex(s), u = !1;
1544
1580
  for (; e; ) {
1545
- let d = !1, p = "", u = "";
1581
+ let d = !1, p = "", m = "";
1546
1582
  if (!(t = i.exec(e)) || this.rules.block.hr.test(e)) break;
1547
1583
  p = t[0], e = e.substring(p.length);
1548
- let f = t[2].split(`
1549
- `, 1)[0].replace(this.rules.other.listReplaceTabs, (g) => " ".repeat(3 * g.length)), w = e.split(`
1550
- `, 1)[0], h = !f.trim(), m = 0;
1551
- if (this.options.pedantic ? (m = 2, u = f.trimStart()) : h ? m = t[1].length + 1 : (m = t[2].search(this.rules.other.nonSpaceChar), m = m > 4 ? 1 : m, u = f.slice(m), m += t[1].length), h && this.rules.other.blankLine.test(w) && (p += w + `
1552
- `, e = e.substring(w.length + 1), d = !0), !d) {
1553
- let g = this.rules.other.nextBulletRegex(m), b = this.rules.other.hrRegex(m), v = this.rules.other.fencesBeginRegex(m), y = this.rules.other.headingBeginRegex(m), $ = this.rules.other.htmlBeginRegex(m);
1584
+ let c = t[2].split(`
1585
+ `, 1)[0].replace(this.rules.other.listReplaceTabs, (h) => " ".repeat(3 * h.length)), g = e.split(`
1586
+ `, 1)[0], f = !c.trim(), b = 0;
1587
+ if (this.options.pedantic ? (b = 2, m = c.trimStart()) : f ? b = t[1].length + 1 : (b = t[2].search(this.rules.other.nonSpaceChar), b = b > 4 ? 1 : b, m = c.slice(b), b += t[1].length), f && this.rules.other.blankLine.test(g) && (p += g + `
1588
+ `, e = e.substring(g.length + 1), d = !0), !d) {
1589
+ let h = this.rules.other.nextBulletRegex(b), w = this.rules.other.hrRegex(b), v = this.rules.other.fencesBeginRegex(b), y = this.rules.other.headingBeginRegex(b), $ = this.rules.other.htmlBeginRegex(b);
1554
1590
  for (; e; ) {
1555
1591
  let A = e.split(`
1556
1592
  `, 1)[0], S;
1557
- if (w = A, this.options.pedantic ? (w = w.replace(this.rules.other.listReplaceNesting, " "), S = w) : S = w.replace(this.rules.other.tabCharGlobal, " "), v.test(w) || y.test(w) || $.test(w) || g.test(w) || b.test(w)) break;
1558
- if (S.search(this.rules.other.nonSpaceChar) >= m || !w.trim()) u += `
1559
- ` + S.slice(m);
1593
+ if (g = A, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, " "), S = g) : S = g.replace(this.rules.other.tabCharGlobal, " "), v.test(g) || y.test(g) || $.test(g) || h.test(g) || w.test(g)) break;
1594
+ if (S.search(this.rules.other.nonSpaceChar) >= b || !g.trim()) m += `
1595
+ ` + S.slice(b);
1560
1596
  else {
1561
- if (h || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || v.test(f) || y.test(f) || b.test(f)) break;
1562
- u += `
1563
- ` + w;
1597
+ if (f || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || v.test(c) || y.test(c) || w.test(c)) break;
1598
+ m += `
1599
+ ` + g;
1564
1600
  }
1565
- !h && !w.trim() && (h = !0), p += A + `
1566
- `, e = e.substring(A.length + 1), f = S.slice(m);
1601
+ !f && !g.trim() && (f = !0), p += A + `
1602
+ `, e = e.substring(A.length + 1), c = S.slice(b);
1567
1603
  }
1568
1604
  }
1569
- o.loose || (l ? o.loose = !0 : this.rules.other.doubleBlankLine.test(p) && (l = !0)), o.items.push({ type: "list_item", raw: p, task: !!this.options.gfm && this.rules.other.listIsTask.test(u), loose: !1, text: u, tokens: [] }), o.raw += p;
1605
+ o.loose || (u ? o.loose = !0 : this.rules.other.doubleBlankLine.test(p) && (u = !0)), o.items.push({ type: "list_item", raw: p, task: !!this.options.gfm && this.rules.other.listIsTask.test(m), loose: !1, text: m, tokens: [] }), o.raw += p;
1570
1606
  }
1571
- let c = o.items.at(-1);
1572
- if (c) c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
1607
+ let l = o.items.at(-1);
1608
+ if (l) l.raw = l.raw.trimEnd(), l.text = l.text.trimEnd();
1573
1609
  else return;
1574
1610
  o.raw = o.raw.trimEnd();
1575
1611
  for (let d of o.items) {
1576
1612
  if (this.lexer.state.top = !1, d.tokens = this.lexer.blockTokens(d.text, []), d.task) {
1577
1613
  if (d.text = d.text.replace(this.rules.other.listReplaceTask, ""), ((r = d.tokens[0]) == null ? void 0 : r.type) === "text" || ((a = d.tokens[0]) == null ? void 0 : a.type) === "paragraph") {
1578
1614
  d.tokens[0].raw = d.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), d.tokens[0].text = d.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
1579
- for (let u = this.lexer.inlineQueue.length - 1; u >= 0; u--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)) {
1580
- this.lexer.inlineQueue[u].src = this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask, "");
1615
+ for (let m = this.lexer.inlineQueue.length - 1; m >= 0; m--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)) {
1616
+ this.lexer.inlineQueue[m].src = this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask, "");
1581
1617
  break;
1582
1618
  }
1583
1619
  }
1584
1620
  let p = this.rules.other.listTaskCheckbox.exec(d.raw);
1585
1621
  if (p) {
1586
- let u = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
1587
- d.checked = u.checked, o.loose ? d.tokens[0] && ["paragraph", "text"].includes(d.tokens[0].type) && "tokens" in d.tokens[0] && d.tokens[0].tokens ? (d.tokens[0].raw = u.raw + d.tokens[0].raw, d.tokens[0].text = u.raw + d.tokens[0].text, d.tokens[0].tokens.unshift(u)) : d.tokens.unshift({ type: "paragraph", raw: u.raw, text: u.raw, tokens: [u] }) : d.tokens.unshift(u);
1622
+ let m = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
1623
+ d.checked = m.checked, o.loose ? d.tokens[0] && ["paragraph", "text"].includes(d.tokens[0].type) && "tokens" in d.tokens[0] && d.tokens[0].tokens ? (d.tokens[0].raw = m.raw + d.tokens[0].raw, d.tokens[0].text = m.raw + d.tokens[0].text, d.tokens[0].tokens.unshift(m)) : d.tokens.unshift({ type: "paragraph", raw: m.raw, text: m.raw, tokens: [m] }) : d.tokens.unshift(m);
1588
1624
  }
1589
1625
  }
1590
1626
  if (!o.loose) {
1591
- let p = d.tokens.filter((f) => f.type === "space"), u = p.length > 0 && p.some((f) => this.rules.other.anyLine.test(f.raw));
1592
- o.loose = u;
1627
+ let p = d.tokens.filter((c) => c.type === "space"), m = p.length > 0 && p.some((c) => this.rules.other.anyLine.test(c.raw));
1628
+ o.loose = m;
1593
1629
  }
1594
1630
  }
1595
1631
  if (o.loose) for (let d of o.items) {
@@ -1614,12 +1650,12 @@ ${d}` : d;
1614
1650
  var o;
1615
1651
  let t = this.rules.block.table.exec(e);
1616
1652
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
1617
- let r = dt(t[1]), a = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = (o = t[3]) != null && o.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
1653
+ let r = pt(t[1]), a = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = (o = t[3]) != null && o.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
1618
1654
  `) : [], n = { type: "table", raw: t[0], header: [], align: [], rows: [] };
1619
1655
  if (r.length === a.length) {
1620
1656
  for (let i of a) this.rules.other.tableAlignRight.test(i) ? n.align.push("right") : this.rules.other.tableAlignCenter.test(i) ? n.align.push("center") : this.rules.other.tableAlignLeft.test(i) ? n.align.push("left") : n.align.push(null);
1621
1657
  for (let i = 0; i < r.length; i++) n.header.push({ text: r[i], tokens: this.lexer.inline(r[i]), header: !0, align: n.align[i] });
1622
- for (let i of s) n.rows.push(dt(i, n.header.length).map((l, c) => ({ text: l, tokens: this.lexer.inline(l), header: !1, align: n.align[c] })));
1658
+ for (let i of s) n.rows.push(pt(i, n.header.length).map((u, l) => ({ text: u, tokens: this.lexer.inline(u), header: !1, align: n.align[l] })));
1623
1659
  return n;
1624
1660
  }
1625
1661
  }
@@ -1653,10 +1689,10 @@ ${d}` : d;
1653
1689
  let r = t[2].trim();
1654
1690
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
1655
1691
  if (!this.rules.other.endAngleBracket.test(r)) return;
1656
- let n = ne(r.slice(0, -1), "\\");
1692
+ let n = ie(r.slice(0, -1), "\\");
1657
1693
  if ((r.length - n.length) % 2 === 0) return;
1658
1694
  } else {
1659
- let n = Va(t[2], "()");
1695
+ let n = Na(t[2], "()");
1660
1696
  if (n === -2) return;
1661
1697
  if (n > -1) {
1662
1698
  let o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + n;
@@ -1668,7 +1704,7 @@ ${d}` : d;
1668
1704
  let n = this.rules.other.pedanticHrefTitle.exec(a);
1669
1705
  n && (a = n[1], s = n[3]);
1670
1706
  } else s = t[3] ? t[3].slice(1, -1) : "";
1671
- return a = a.trim(), this.rules.other.startAngleBracket.test(a) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? a = a.slice(1) : a = a.slice(1, -1)), pt(t, { href: a && a.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
1707
+ return a = a.trim(), this.rules.other.startAngleBracket.test(a) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? a = a.slice(1) : a = a.slice(1, -1)), ft(t, { href: a && a.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
1672
1708
  }
1673
1709
  }
1674
1710
  reflink(e, t) {
@@ -1679,31 +1715,31 @@ ${d}` : d;
1679
1715
  let n = r[0].charAt(0);
1680
1716
  return { type: "text", raw: n, text: n };
1681
1717
  }
1682
- return pt(r, s, r[0], this.lexer, this.rules);
1718
+ return ft(r, s, r[0], this.lexer, this.rules);
1683
1719
  }
1684
1720
  }
1685
1721
  emStrong(e, t, r = "") {
1686
1722
  let a = this.rules.inline.emStrongLDelim.exec(e);
1687
1723
  if (!(!a || a[3] && r.match(this.rules.other.unicodeAlphaNumeric)) && (!(a[1] || a[2]) || !r || this.rules.inline.punctuation.exec(r))) {
1688
- let s = [...a[0]].length - 1, n, o, i = s, l = 0, c = a[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1689
- for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (a = c.exec(t)) != null; ) {
1724
+ let s = [...a[0]].length - 1, n, o, i = s, u = 0, l = a[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1725
+ for (l.lastIndex = 0, t = t.slice(-1 * e.length + s); (a = l.exec(t)) != null; ) {
1690
1726
  if (n = a[1] || a[2] || a[3] || a[4] || a[5] || a[6], !n) continue;
1691
1727
  if (o = [...n].length, a[3] || a[4]) {
1692
1728
  i += o;
1693
1729
  continue;
1694
1730
  } else if ((a[5] || a[6]) && s % 3 && !((s + o) % 3)) {
1695
- l += o;
1731
+ u += o;
1696
1732
  continue;
1697
1733
  }
1698
1734
  if (i -= o, i > 0) continue;
1699
- o = Math.min(o, o + i + l);
1735
+ o = Math.min(o, o + i + u);
1700
1736
  let d = [...a[0]][0].length, p = e.slice(0, s + a.index + d + o);
1701
1737
  if (Math.min(s, o) % 2) {
1702
- let f = p.slice(1, -1);
1703
- return { type: "em", raw: p, text: f, tokens: this.lexer.inlineTokens(f) };
1738
+ let c = p.slice(1, -1);
1739
+ return { type: "em", raw: p, text: c, tokens: this.lexer.inlineTokens(c) };
1704
1740
  }
1705
- let u = p.slice(2, -2);
1706
- return { type: "strong", raw: p, text: u, tokens: this.lexer.inlineTokens(u) };
1741
+ let m = p.slice(2, -2);
1742
+ return { type: "strong", raw: p, text: m, tokens: this.lexer.inlineTokens(m) };
1707
1743
  }
1708
1744
  }
1709
1745
  }
@@ -1752,25 +1788,25 @@ ${d}` : d;
1752
1788
  return { type: "text", raw: t[0], text: t[0], escaped: r };
1753
1789
  }
1754
1790
  }
1755
- }, B = class Ee {
1791
+ }, B = class Te {
1756
1792
  constructor(t) {
1757
- E(this, "tokens");
1758
- E(this, "options");
1759
- E(this, "state");
1760
- E(this, "inlineQueue");
1761
- E(this, "tokenizer");
1762
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Q, this.options.tokenizer = this.options.tokenizer || new ye(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1763
- let r = { other: H, block: he.normal, inline: se.normal };
1764
- this.options.pedantic ? (r.block = he.pedantic, r.inline = se.pedantic) : this.options.gfm && (r.block = he.gfm, this.options.breaks ? r.inline = se.breaks : r.inline = se.gfm), this.tokenizer.rules = r;
1793
+ T(this, "tokens");
1794
+ T(this, "options");
1795
+ T(this, "state");
1796
+ T(this, "inlineQueue");
1797
+ T(this, "tokenizer");
1798
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Q, this.options.tokenizer = this.options.tokenizer || new ve(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1799
+ let r = { other: H, block: ge.normal, inline: ne.normal };
1800
+ this.options.pedantic ? (r.block = ge.pedantic, r.inline = ne.pedantic) : this.options.gfm && (r.block = ge.gfm, this.options.breaks ? r.inline = ne.breaks : r.inline = ne.gfm), this.tokenizer.rules = r;
1765
1801
  }
1766
1802
  static get rules() {
1767
- return { block: he, inline: se };
1803
+ return { block: ge, inline: ne };
1768
1804
  }
1769
1805
  static lex(t, r) {
1770
- return new Ee(r).lex(t);
1806
+ return new Te(r).lex(t);
1771
1807
  }
1772
1808
  static lexInline(t, r) {
1773
- return new Ee(r).inlineTokens(t);
1809
+ return new Te(r).inlineTokens(t);
1774
1810
  }
1775
1811
  lex(t) {
1776
1812
  t = t.replace(H.carriageReturn, `
@@ -1785,21 +1821,21 @@ ${d}` : d;
1785
1821
  var s, n, o;
1786
1822
  for (this.options.pedantic && (t = t.replace(H.tabCharGlobal, " ").replace(H.spaceLine, "")); t; ) {
1787
1823
  let i;
1788
- if ((n = (s = this.options.extensions) == null ? void 0 : s.block) != null && n.some((c) => (i = c.call({ lexer: this }, t, r)) ? (t = t.substring(i.raw.length), r.push(i), !0) : !1)) continue;
1824
+ if ((n = (s = this.options.extensions) == null ? void 0 : s.block) != null && n.some((l) => (i = l.call({ lexer: this }, t, r)) ? (t = t.substring(i.raw.length), r.push(i), !0) : !1)) continue;
1789
1825
  if (i = this.tokenizer.space(t)) {
1790
1826
  t = t.substring(i.raw.length);
1791
- let c = r.at(-1);
1792
- i.raw.length === 1 && c !== void 0 ? c.raw += `
1827
+ let l = r.at(-1);
1828
+ i.raw.length === 1 && l !== void 0 ? l.raw += `
1793
1829
  ` : r.push(i);
1794
1830
  continue;
1795
1831
  }
1796
1832
  if (i = this.tokenizer.code(t)) {
1797
1833
  t = t.substring(i.raw.length);
1798
- let c = r.at(-1);
1799
- (c == null ? void 0 : c.type) === "paragraph" || (c == null ? void 0 : c.type) === "text" ? (c.raw += (c.raw.endsWith(`
1834
+ let l = r.at(-1);
1835
+ (l == null ? void 0 : l.type) === "paragraph" || (l == null ? void 0 : l.type) === "text" ? (l.raw += (l.raw.endsWith(`
1800
1836
  `) ? "" : `
1801
- `) + i.raw, c.text += `
1802
- ` + i.text, this.inlineQueue.at(-1).src = c.text) : r.push(i);
1837
+ `) + i.raw, l.text += `
1838
+ ` + i.text, this.inlineQueue.at(-1).src = l.text) : r.push(i);
1803
1839
  continue;
1804
1840
  }
1805
1841
  if (i = this.tokenizer.fences(t)) {
@@ -1828,11 +1864,11 @@ ${d}` : d;
1828
1864
  }
1829
1865
  if (i = this.tokenizer.def(t)) {
1830
1866
  t = t.substring(i.raw.length);
1831
- let c = r.at(-1);
1832
- (c == null ? void 0 : c.type) === "paragraph" || (c == null ? void 0 : c.type) === "text" ? (c.raw += (c.raw.endsWith(`
1867
+ let l = r.at(-1);
1868
+ (l == null ? void 0 : l.type) === "paragraph" || (l == null ? void 0 : l.type) === "text" ? (l.raw += (l.raw.endsWith(`
1833
1869
  `) ? "" : `
1834
- `) + i.raw, c.text += `
1835
- ` + i.raw, this.inlineQueue.at(-1).src = c.text) : this.tokens.links[i.tag] || (this.tokens.links[i.tag] = { href: i.href, title: i.title }, r.push(i));
1870
+ `) + i.raw, l.text += `
1871
+ ` + i.raw, this.inlineQueue.at(-1).src = l.text) : this.tokens.links[i.tag] || (this.tokens.links[i.tag] = { href: i.href, title: i.title }, r.push(i));
1836
1872
  continue;
1837
1873
  }
1838
1874
  if (i = this.tokenizer.table(t)) {
@@ -1843,36 +1879,36 @@ ${d}` : d;
1843
1879
  t = t.substring(i.raw.length), r.push(i);
1844
1880
  continue;
1845
1881
  }
1846
- let l = t;
1882
+ let u = t;
1847
1883
  if ((o = this.options.extensions) != null && o.startBlock) {
1848
- let c = 1 / 0, d = t.slice(1), p;
1849
- this.options.extensions.startBlock.forEach((u) => {
1850
- p = u.call({ lexer: this }, d), typeof p == "number" && p >= 0 && (c = Math.min(c, p));
1851
- }), c < 1 / 0 && c >= 0 && (l = t.substring(0, c + 1));
1884
+ let l = 1 / 0, d = t.slice(1), p;
1885
+ this.options.extensions.startBlock.forEach((m) => {
1886
+ p = m.call({ lexer: this }, d), typeof p == "number" && p >= 0 && (l = Math.min(l, p));
1887
+ }), l < 1 / 0 && l >= 0 && (u = t.substring(0, l + 1));
1852
1888
  }
1853
- if (this.state.top && (i = this.tokenizer.paragraph(l))) {
1854
- let c = r.at(-1);
1855
- a && (c == null ? void 0 : c.type) === "paragraph" ? (c.raw += (c.raw.endsWith(`
1889
+ if (this.state.top && (i = this.tokenizer.paragraph(u))) {
1890
+ let l = r.at(-1);
1891
+ a && (l == null ? void 0 : l.type) === "paragraph" ? (l.raw += (l.raw.endsWith(`
1856
1892
  `) ? "" : `
1857
- `) + i.raw, c.text += `
1858
- ` + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = c.text) : r.push(i), a = l.length !== t.length, t = t.substring(i.raw.length);
1893
+ `) + i.raw, l.text += `
1894
+ ` + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : r.push(i), a = u.length !== t.length, t = t.substring(i.raw.length);
1859
1895
  continue;
1860
1896
  }
1861
1897
  if (i = this.tokenizer.text(t)) {
1862
1898
  t = t.substring(i.raw.length);
1863
- let c = r.at(-1);
1864
- (c == null ? void 0 : c.type) === "text" ? (c.raw += (c.raw.endsWith(`
1899
+ let l = r.at(-1);
1900
+ (l == null ? void 0 : l.type) === "text" ? (l.raw += (l.raw.endsWith(`
1865
1901
  `) ? "" : `
1866
- `) + i.raw, c.text += `
1867
- ` + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = c.text) : r.push(i);
1902
+ `) + i.raw, l.text += `
1903
+ ` + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : r.push(i);
1868
1904
  continue;
1869
1905
  }
1870
1906
  if (t) {
1871
- let c = "Infinite loop on byte: " + t.charCodeAt(0);
1907
+ let l = "Infinite loop on byte: " + t.charCodeAt(0);
1872
1908
  if (this.options.silent) {
1873
- console.error(c);
1909
+ console.error(l);
1874
1910
  break;
1875
- } else throw new Error(c);
1911
+ } else throw new Error(l);
1876
1912
  }
1877
1913
  }
1878
1914
  return this.state.top = !0, r;
@@ -1881,90 +1917,90 @@ ${d}` : d;
1881
1917
  return this.inlineQueue.push({ src: t, tokens: r }), r;
1882
1918
  }
1883
1919
  inlineTokens(t, r = []) {
1884
- var l, c, d, p, u;
1920
+ var u, l, d, p, m;
1885
1921
  let a = t, s = null;
1886
1922
  if (this.tokens.links) {
1887
- let f = Object.keys(this.tokens.links);
1888
- if (f.length > 0) for (; (s = this.tokenizer.rules.inline.reflinkSearch.exec(a)) != null; ) f.includes(s[0].slice(s[0].lastIndexOf("[") + 1, -1)) && (a = a.slice(0, s.index) + "[" + "a".repeat(s[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1923
+ let c = Object.keys(this.tokens.links);
1924
+ if (c.length > 0) for (; (s = this.tokenizer.rules.inline.reflinkSearch.exec(a)) != null; ) c.includes(s[0].slice(s[0].lastIndexOf("[") + 1, -1)) && (a = a.slice(0, s.index) + "[" + "a".repeat(s[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1889
1925
  }
1890
1926
  for (; (s = this.tokenizer.rules.inline.anyPunctuation.exec(a)) != null; ) a = a.slice(0, s.index) + "++" + a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1891
1927
  let n;
1892
1928
  for (; (s = this.tokenizer.rules.inline.blockSkip.exec(a)) != null; ) n = s[2] ? s[2].length : 0, a = a.slice(0, s.index + n) + "[" + "a".repeat(s[0].length - n - 2) + "]" + a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1893
- a = ((c = (l = this.options.hooks) == null ? void 0 : l.emStrongMask) == null ? void 0 : c.call({ lexer: this }, a)) ?? a;
1929
+ a = ((l = (u = this.options.hooks) == null ? void 0 : u.emStrongMask) == null ? void 0 : l.call({ lexer: this }, a)) ?? a;
1894
1930
  let o = !1, i = "";
1895
1931
  for (; t; ) {
1896
1932
  o || (i = ""), o = !1;
1897
- let f;
1898
- if ((p = (d = this.options.extensions) == null ? void 0 : d.inline) != null && p.some((h) => (f = h.call({ lexer: this }, t, r)) ? (t = t.substring(f.raw.length), r.push(f), !0) : !1)) continue;
1899
- if (f = this.tokenizer.escape(t)) {
1900
- t = t.substring(f.raw.length), r.push(f);
1933
+ let c;
1934
+ if ((p = (d = this.options.extensions) == null ? void 0 : d.inline) != null && p.some((f) => (c = f.call({ lexer: this }, t, r)) ? (t = t.substring(c.raw.length), r.push(c), !0) : !1)) continue;
1935
+ if (c = this.tokenizer.escape(t)) {
1936
+ t = t.substring(c.raw.length), r.push(c);
1901
1937
  continue;
1902
1938
  }
1903
- if (f = this.tokenizer.tag(t)) {
1904
- t = t.substring(f.raw.length), r.push(f);
1939
+ if (c = this.tokenizer.tag(t)) {
1940
+ t = t.substring(c.raw.length), r.push(c);
1905
1941
  continue;
1906
1942
  }
1907
- if (f = this.tokenizer.link(t)) {
1908
- t = t.substring(f.raw.length), r.push(f);
1943
+ if (c = this.tokenizer.link(t)) {
1944
+ t = t.substring(c.raw.length), r.push(c);
1909
1945
  continue;
1910
1946
  }
1911
- if (f = this.tokenizer.reflink(t, this.tokens.links)) {
1912
- t = t.substring(f.raw.length);
1913
- let h = r.at(-1);
1914
- f.type === "text" && (h == null ? void 0 : h.type) === "text" ? (h.raw += f.raw, h.text += f.text) : r.push(f);
1947
+ if (c = this.tokenizer.reflink(t, this.tokens.links)) {
1948
+ t = t.substring(c.raw.length);
1949
+ let f = r.at(-1);
1950
+ c.type === "text" && (f == null ? void 0 : f.type) === "text" ? (f.raw += c.raw, f.text += c.text) : r.push(c);
1915
1951
  continue;
1916
1952
  }
1917
- if (f = this.tokenizer.emStrong(t, a, i)) {
1918
- t = t.substring(f.raw.length), r.push(f);
1953
+ if (c = this.tokenizer.emStrong(t, a, i)) {
1954
+ t = t.substring(c.raw.length), r.push(c);
1919
1955
  continue;
1920
1956
  }
1921
- if (f = this.tokenizer.codespan(t)) {
1922
- t = t.substring(f.raw.length), r.push(f);
1957
+ if (c = this.tokenizer.codespan(t)) {
1958
+ t = t.substring(c.raw.length), r.push(c);
1923
1959
  continue;
1924
1960
  }
1925
- if (f = this.tokenizer.br(t)) {
1926
- t = t.substring(f.raw.length), r.push(f);
1961
+ if (c = this.tokenizer.br(t)) {
1962
+ t = t.substring(c.raw.length), r.push(c);
1927
1963
  continue;
1928
1964
  }
1929
- if (f = this.tokenizer.del(t)) {
1930
- t = t.substring(f.raw.length), r.push(f);
1965
+ if (c = this.tokenizer.del(t)) {
1966
+ t = t.substring(c.raw.length), r.push(c);
1931
1967
  continue;
1932
1968
  }
1933
- if (f = this.tokenizer.autolink(t)) {
1934
- t = t.substring(f.raw.length), r.push(f);
1969
+ if (c = this.tokenizer.autolink(t)) {
1970
+ t = t.substring(c.raw.length), r.push(c);
1935
1971
  continue;
1936
1972
  }
1937
- if (!this.state.inLink && (f = this.tokenizer.url(t))) {
1938
- t = t.substring(f.raw.length), r.push(f);
1973
+ if (!this.state.inLink && (c = this.tokenizer.url(t))) {
1974
+ t = t.substring(c.raw.length), r.push(c);
1939
1975
  continue;
1940
1976
  }
1941
- let w = t;
1942
- if ((u = this.options.extensions) != null && u.startInline) {
1943
- let h = 1 / 0, m = t.slice(1), g;
1944
- this.options.extensions.startInline.forEach((b) => {
1945
- g = b.call({ lexer: this }, m), typeof g == "number" && g >= 0 && (h = Math.min(h, g));
1946
- }), h < 1 / 0 && h >= 0 && (w = t.substring(0, h + 1));
1977
+ let g = t;
1978
+ if ((m = this.options.extensions) != null && m.startInline) {
1979
+ let f = 1 / 0, b = t.slice(1), h;
1980
+ this.options.extensions.startInline.forEach((w) => {
1981
+ h = w.call({ lexer: this }, b), typeof h == "number" && h >= 0 && (f = Math.min(f, h));
1982
+ }), f < 1 / 0 && f >= 0 && (g = t.substring(0, f + 1));
1947
1983
  }
1948
- if (f = this.tokenizer.inlineText(w)) {
1949
- t = t.substring(f.raw.length), f.raw.slice(-1) !== "_" && (i = f.raw.slice(-1)), o = !0;
1950
- let h = r.at(-1);
1951
- (h == null ? void 0 : h.type) === "text" ? (h.raw += f.raw, h.text += f.text) : r.push(f);
1984
+ if (c = this.tokenizer.inlineText(g)) {
1985
+ t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (i = c.raw.slice(-1)), o = !0;
1986
+ let f = r.at(-1);
1987
+ (f == null ? void 0 : f.type) === "text" ? (f.raw += c.raw, f.text += c.text) : r.push(c);
1952
1988
  continue;
1953
1989
  }
1954
1990
  if (t) {
1955
- let h = "Infinite loop on byte: " + t.charCodeAt(0);
1991
+ let f = "Infinite loop on byte: " + t.charCodeAt(0);
1956
1992
  if (this.options.silent) {
1957
- console.error(h);
1993
+ console.error(f);
1958
1994
  break;
1959
- } else throw new Error(h);
1995
+ } else throw new Error(f);
1960
1996
  }
1961
1997
  }
1962
1998
  return r;
1963
1999
  }
1964
- }, ve = class {
2000
+ }, ke = class {
1965
2001
  constructor(e) {
1966
- E(this, "options");
1967
- E(this, "parser");
2002
+ T(this, "options");
2003
+ T(this, "parser");
1968
2004
  this.options = e || Q;
1969
2005
  }
1970
2006
  space(e) {
@@ -1974,8 +2010,8 @@ ${d}` : d;
1974
2010
  var n;
1975
2011
  let a = (n = (t || "").match(H.notSpaceStart)) == null ? void 0 : n[0], s = e.replace(H.endingNewline, "") + `
1976
2012
  `;
1977
- return a ? '<pre><code class="language-' + V(a) + '">' + (r ? s : V(s, !0)) + `</code></pre>
1978
- ` : "<pre><code>" + (r ? s : V(s, !0)) + `</code></pre>
2013
+ return a ? '<pre><code class="language-' + N(a) + '">' + (r ? s : N(s, !0)) + `</code></pre>
2014
+ ` : "<pre><code>" + (r ? s : N(s, !0)) + `</code></pre>
1979
2015
  `;
1980
2016
  }
1981
2017
  blockquote({ tokens: e }) {
@@ -2053,7 +2089,7 @@ ${e}</tr>
2053
2089
  return `<em>${this.parser.parseInline(e)}</em>`;
2054
2090
  }
2055
2091
  codespan({ text: e }) {
2056
- return `<code>${V(e, !0)}</code>`;
2092
+ return `<code>${N(e, !0)}</code>`;
2057
2093
  }
2058
2094
  br(e) {
2059
2095
  return "<br>";
@@ -2062,24 +2098,24 @@ ${e}</tr>
2062
2098
  return `<del>${this.parser.parseInline(e)}</del>`;
2063
2099
  }
2064
2100
  link({ href: e, title: t, tokens: r }) {
2065
- let a = this.parser.parseInline(r), s = ut(e);
2101
+ let a = this.parser.parseInline(r), s = dt(e);
2066
2102
  if (s === null) return a;
2067
2103
  e = s;
2068
2104
  let n = '<a href="' + e + '"';
2069
- return t && (n += ' title="' + V(t) + '"'), n += ">" + a + "</a>", n;
2105
+ return t && (n += ' title="' + N(t) + '"'), n += ">" + a + "</a>", n;
2070
2106
  }
2071
2107
  image({ href: e, title: t, text: r, tokens: a }) {
2072
2108
  a && (r = this.parser.parseInline(a, this.parser.textRenderer));
2073
- let s = ut(e);
2074
- if (s === null) return V(r);
2109
+ let s = dt(e);
2110
+ if (s === null) return N(r);
2075
2111
  e = s;
2076
2112
  let n = `<img src="${e}" alt="${r}"`;
2077
- return t && (n += ` title="${V(t)}"`), n += ">", n;
2113
+ return t && (n += ` title="${N(t)}"`), n += ">", n;
2078
2114
  }
2079
2115
  text(e) {
2080
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : V(e.text);
2116
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : N(e.text);
2081
2117
  }
2082
- }, Je = class {
2118
+ }, Ye = class {
2083
2119
  strong({ text: e }) {
2084
2120
  return e;
2085
2121
  }
@@ -2110,18 +2146,18 @@ ${e}</tr>
2110
2146
  checkbox({ raw: e }) {
2111
2147
  return e;
2112
2148
  }
2113
- }, F = class Te {
2149
+ }, O = class Pe {
2114
2150
  constructor(t) {
2115
- E(this, "options");
2116
- E(this, "renderer");
2117
- E(this, "textRenderer");
2118
- this.options = t || Q, this.options.renderer = this.options.renderer || new ve(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Je();
2151
+ T(this, "options");
2152
+ T(this, "renderer");
2153
+ T(this, "textRenderer");
2154
+ this.options = t || Q, this.options.renderer = this.options.renderer || new ke(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Ye();
2119
2155
  }
2120
2156
  static parse(t, r) {
2121
- return new Te(r).parse(t);
2157
+ return new Pe(r).parse(t);
2122
2158
  }
2123
2159
  static parseInline(t, r) {
2124
- return new Te(r).parseInline(t);
2160
+ return new Pe(r).parseInline(t);
2125
2161
  }
2126
2162
  parse(t) {
2127
2163
  var a, s;
@@ -2129,9 +2165,9 @@ ${e}</tr>
2129
2165
  for (let n = 0; n < t.length; n++) {
2130
2166
  let o = t[n];
2131
2167
  if ((s = (a = this.options.extensions) == null ? void 0 : a.renderers) != null && s[o.type]) {
2132
- let l = o, c = this.options.extensions.renderers[l.type].call({ parser: this }, l);
2133
- if (c !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(l.type)) {
2134
- r += c || "";
2168
+ let u = o, l = this.options.extensions.renderers[u.type].call({ parser: this }, u);
2169
+ if (l !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(u.type)) {
2170
+ r += l || "";
2135
2171
  continue;
2136
2172
  }
2137
2173
  }
@@ -2186,9 +2222,9 @@ ${e}</tr>
2186
2222
  break;
2187
2223
  }
2188
2224
  default: {
2189
- let l = 'Token with "' + i.type + '" type was not found.';
2190
- if (this.options.silent) return console.error(l), "";
2191
- throw new Error(l);
2225
+ let u = 'Token with "' + i.type + '" type was not found.';
2226
+ if (this.options.silent) return console.error(u), "";
2227
+ throw new Error(u);
2192
2228
  }
2193
2229
  }
2194
2230
  }
@@ -2200,71 +2236,71 @@ ${e}</tr>
2200
2236
  for (let o = 0; o < t.length; o++) {
2201
2237
  let i = t[o];
2202
2238
  if ((n = (s = this.options.extensions) == null ? void 0 : s.renderers) != null && n[i.type]) {
2203
- let c = this.options.extensions.renderers[i.type].call({ parser: this }, i);
2204
- if (c !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
2205
- a += c || "";
2239
+ let l = this.options.extensions.renderers[i.type].call({ parser: this }, i);
2240
+ if (l !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
2241
+ a += l || "";
2206
2242
  continue;
2207
2243
  }
2208
2244
  }
2209
- let l = i;
2210
- switch (l.type) {
2245
+ let u = i;
2246
+ switch (u.type) {
2211
2247
  case "escape": {
2212
- a += r.text(l);
2248
+ a += r.text(u);
2213
2249
  break;
2214
2250
  }
2215
2251
  case "html": {
2216
- a += r.html(l);
2252
+ a += r.html(u);
2217
2253
  break;
2218
2254
  }
2219
2255
  case "link": {
2220
- a += r.link(l);
2256
+ a += r.link(u);
2221
2257
  break;
2222
2258
  }
2223
2259
  case "image": {
2224
- a += r.image(l);
2260
+ a += r.image(u);
2225
2261
  break;
2226
2262
  }
2227
2263
  case "checkbox": {
2228
- a += r.checkbox(l);
2264
+ a += r.checkbox(u);
2229
2265
  break;
2230
2266
  }
2231
2267
  case "strong": {
2232
- a += r.strong(l);
2268
+ a += r.strong(u);
2233
2269
  break;
2234
2270
  }
2235
2271
  case "em": {
2236
- a += r.em(l);
2272
+ a += r.em(u);
2237
2273
  break;
2238
2274
  }
2239
2275
  case "codespan": {
2240
- a += r.codespan(l);
2276
+ a += r.codespan(u);
2241
2277
  break;
2242
2278
  }
2243
2279
  case "br": {
2244
- a += r.br(l);
2280
+ a += r.br(u);
2245
2281
  break;
2246
2282
  }
2247
2283
  case "del": {
2248
- a += r.del(l);
2284
+ a += r.del(u);
2249
2285
  break;
2250
2286
  }
2251
2287
  case "text": {
2252
- a += r.text(l);
2288
+ a += r.text(u);
2253
2289
  break;
2254
2290
  }
2255
2291
  default: {
2256
- let c = 'Token with "' + l.type + '" type was not found.';
2257
- if (this.options.silent) return console.error(c), "";
2258
- throw new Error(c);
2292
+ let l = 'Token with "' + u.type + '" type was not found.';
2293
+ if (this.options.silent) return console.error(l), "";
2294
+ throw new Error(l);
2259
2295
  }
2260
2296
  }
2261
2297
  }
2262
2298
  return a;
2263
2299
  }
2264
- }, me, oe = (me = class {
2300
+ }, be, ce = (be = class {
2265
2301
  constructor(e) {
2266
- E(this, "options");
2267
- E(this, "block");
2302
+ T(this, "options");
2303
+ T(this, "block");
2268
2304
  this.options = e || Q;
2269
2305
  }
2270
2306
  preprocess(e) {
@@ -2283,20 +2319,20 @@ ${e}</tr>
2283
2319
  return this.block ? B.lex : B.lexInline;
2284
2320
  }
2285
2321
  provideParser() {
2286
- return this.block ? F.parse : F.parseInline;
2322
+ return this.block ? O.parse : O.parseInline;
2287
2323
  }
2288
- }, E(me, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), E(me, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), me), Ua = class {
2324
+ }, T(be, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), T(be, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), be), Ga = class {
2289
2325
  constructor(...e) {
2290
- E(this, "defaults", Ve());
2291
- E(this, "options", this.setOptions);
2292
- E(this, "parse", this.parseMarkdown(!0));
2293
- E(this, "parseInline", this.parseMarkdown(!1));
2294
- E(this, "Parser", F);
2295
- E(this, "Renderer", ve);
2296
- E(this, "TextRenderer", Je);
2297
- E(this, "Lexer", B);
2298
- E(this, "Tokenizer", ye);
2299
- E(this, "Hooks", oe);
2326
+ T(this, "defaults", Ne());
2327
+ T(this, "options", this.setOptions);
2328
+ T(this, "parse", this.parseMarkdown(!0));
2329
+ T(this, "parseInline", this.parseMarkdown(!1));
2330
+ T(this, "Parser", O);
2331
+ T(this, "Renderer", ke);
2332
+ T(this, "TextRenderer", Ye);
2333
+ T(this, "Lexer", B);
2334
+ T(this, "Tokenizer", ve);
2335
+ T(this, "Hooks", ce);
2300
2336
  this.use(...e);
2301
2337
  }
2302
2338
  walkTokens(e, t) {
@@ -2306,7 +2342,7 @@ ${e}</tr>
2306
2342
  case "table": {
2307
2343
  let o = n;
2308
2344
  for (let i of o.header) r = r.concat(this.walkTokens(i.tokens, t));
2309
- for (let i of o.rows) for (let l of i) r = r.concat(this.walkTokens(l.tokens, t));
2345
+ for (let i of o.rows) for (let u of i) r = r.concat(this.walkTokens(u.tokens, t));
2310
2346
  break;
2311
2347
  }
2312
2348
  case "list": {
@@ -2317,8 +2353,8 @@ ${e}</tr>
2317
2353
  default: {
2318
2354
  let o = n;
2319
2355
  (s = (a = this.defaults.extensions) == null ? void 0 : a.childTokens) != null && s[o.type] ? this.defaults.extensions.childTokens[o.type].forEach((i) => {
2320
- let l = o[i].flat(1 / 0);
2321
- r = r.concat(this.walkTokens(l, t));
2356
+ let u = o[i].flat(1 / 0);
2357
+ r = r.concat(this.walkTokens(u, t));
2322
2358
  }) : o.tokens && (r = r.concat(this.walkTokens(o.tokens, t)));
2323
2359
  }
2324
2360
  }
@@ -2344,51 +2380,51 @@ ${e}</tr>
2344
2380
  }
2345
2381
  "childTokens" in s && s.childTokens && (t.childTokens[s.name] = s.childTokens);
2346
2382
  }), a.extensions = t), r.renderer) {
2347
- let s = this.defaults.renderer || new ve(this.defaults);
2383
+ let s = this.defaults.renderer || new ke(this.defaults);
2348
2384
  for (let n in r.renderer) {
2349
2385
  if (!(n in s)) throw new Error(`renderer '${n}' does not exist`);
2350
2386
  if (["options", "parser"].includes(n)) continue;
2351
- let o = n, i = r.renderer[o], l = s[o];
2352
- s[o] = (...c) => {
2353
- let d = i.apply(s, c);
2354
- return d === !1 && (d = l.apply(s, c)), d || "";
2387
+ let o = n, i = r.renderer[o], u = s[o];
2388
+ s[o] = (...l) => {
2389
+ let d = i.apply(s, l);
2390
+ return d === !1 && (d = u.apply(s, l)), d || "";
2355
2391
  };
2356
2392
  }
2357
2393
  a.renderer = s;
2358
2394
  }
2359
2395
  if (r.tokenizer) {
2360
- let s = this.defaults.tokenizer || new ye(this.defaults);
2396
+ let s = this.defaults.tokenizer || new ve(this.defaults);
2361
2397
  for (let n in r.tokenizer) {
2362
2398
  if (!(n in s)) throw new Error(`tokenizer '${n}' does not exist`);
2363
2399
  if (["options", "rules", "lexer"].includes(n)) continue;
2364
- let o = n, i = r.tokenizer[o], l = s[o];
2365
- s[o] = (...c) => {
2366
- let d = i.apply(s, c);
2367
- return d === !1 && (d = l.apply(s, c)), d;
2400
+ let o = n, i = r.tokenizer[o], u = s[o];
2401
+ s[o] = (...l) => {
2402
+ let d = i.apply(s, l);
2403
+ return d === !1 && (d = u.apply(s, l)), d;
2368
2404
  };
2369
2405
  }
2370
2406
  a.tokenizer = s;
2371
2407
  }
2372
2408
  if (r.hooks) {
2373
- let s = this.defaults.hooks || new oe();
2409
+ let s = this.defaults.hooks || new ce();
2374
2410
  for (let n in r.hooks) {
2375
2411
  if (!(n in s)) throw new Error(`hook '${n}' does not exist`);
2376
2412
  if (["options", "block"].includes(n)) continue;
2377
- let o = n, i = r.hooks[o], l = s[o];
2378
- oe.passThroughHooks.has(n) ? s[o] = (c) => {
2379
- if (this.defaults.async && oe.passThroughHooksRespectAsync.has(n)) return (async () => {
2380
- let p = await i.call(s, c);
2381
- return l.call(s, p);
2413
+ let o = n, i = r.hooks[o], u = s[o];
2414
+ ce.passThroughHooks.has(n) ? s[o] = (l) => {
2415
+ if (this.defaults.async && ce.passThroughHooksRespectAsync.has(n)) return (async () => {
2416
+ let p = await i.call(s, l);
2417
+ return u.call(s, p);
2382
2418
  })();
2383
- let d = i.call(s, c);
2384
- return l.call(s, d);
2385
- } : s[o] = (...c) => {
2419
+ let d = i.call(s, l);
2420
+ return u.call(s, d);
2421
+ } : s[o] = (...l) => {
2386
2422
  if (this.defaults.async) return (async () => {
2387
- let p = await i.apply(s, c);
2388
- return p === !1 && (p = await l.apply(s, c)), p;
2423
+ let p = await i.apply(s, l);
2424
+ return p === !1 && (p = await u.apply(s, l)), p;
2389
2425
  })();
2390
- let d = i.apply(s, c);
2391
- return d === !1 && (d = l.apply(s, c)), d;
2426
+ let d = i.apply(s, l);
2427
+ return d === !1 && (d = u.apply(s, l)), d;
2392
2428
  };
2393
2429
  }
2394
2430
  a.hooks = s;
@@ -2410,7 +2446,7 @@ ${e}</tr>
2410
2446
  return B.lex(e, t ?? this.defaults);
2411
2447
  }
2412
2448
  parser(e, t) {
2413
- return F.parse(e, t ?? this.defaults);
2449
+ return O.parse(e, t ?? this.defaults);
2414
2450
  }
2415
2451
  parseMarkdown(e) {
2416
2452
  return (t, r) => {
@@ -2419,16 +2455,16 @@ ${e}</tr>
2419
2455
  if (typeof t > "u" || t === null) return n(new Error("marked(): input parameter is undefined or null"));
2420
2456
  if (typeof t != "string") return n(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
2421
2457
  if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
2422
- let o = s.hooks ? await s.hooks.preprocess(t) : t, i = await (s.hooks ? await s.hooks.provideLexer() : e ? B.lex : B.lexInline)(o, s), l = s.hooks ? await s.hooks.processAllTokens(i) : i;
2423
- s.walkTokens && await Promise.all(this.walkTokens(l, s.walkTokens));
2424
- let c = await (s.hooks ? await s.hooks.provideParser() : e ? F.parse : F.parseInline)(l, s);
2425
- return s.hooks ? await s.hooks.postprocess(c) : c;
2458
+ let o = s.hooks ? await s.hooks.preprocess(t) : t, i = await (s.hooks ? await s.hooks.provideLexer() : e ? B.lex : B.lexInline)(o, s), u = s.hooks ? await s.hooks.processAllTokens(i) : i;
2459
+ s.walkTokens && await Promise.all(this.walkTokens(u, s.walkTokens));
2460
+ let l = await (s.hooks ? await s.hooks.provideParser() : e ? O.parse : O.parseInline)(u, s);
2461
+ return s.hooks ? await s.hooks.postprocess(l) : l;
2426
2462
  })().catch(n);
2427
2463
  try {
2428
2464
  s.hooks && (t = s.hooks.preprocess(t));
2429
2465
  let o = (s.hooks ? s.hooks.provideLexer() : e ? B.lex : B.lexInline)(t, s);
2430
2466
  s.hooks && (o = s.hooks.processAllTokens(o)), s.walkTokens && this.walkTokens(o, s.walkTokens);
2431
- let i = (s.hooks ? s.hooks.provideParser() : e ? F.parse : F.parseInline)(o, s);
2467
+ let i = (s.hooks ? s.hooks.provideParser() : e ? O.parse : O.parseInline)(o, s);
2432
2468
  return s.hooks && (i = s.hooks.postprocess(i)), i;
2433
2469
  } catch (o) {
2434
2470
  return n(o);
@@ -2439,47 +2475,47 @@ ${e}</tr>
2439
2475
  return (r) => {
2440
2476
  if (r.message += `
2441
2477
  Please report this to https://github.com/markedjs/marked.`, e) {
2442
- let a = "<p>An error occurred:</p><pre>" + V(r.message + "", !0) + "</pre>";
2478
+ let a = "<p>An error occurred:</p><pre>" + N(r.message + "", !0) + "</pre>";
2443
2479
  return t ? Promise.resolve(a) : a;
2444
2480
  }
2445
2481
  if (t) return Promise.reject(r);
2446
2482
  throw r;
2447
2483
  };
2448
2484
  }
2449
- }, X = new Ua();
2450
- function _(e, t) {
2451
- return X.parse(e, t);
2485
+ }, K = new Ga();
2486
+ function M(e, t) {
2487
+ return K.parse(e, t);
2452
2488
  }
2453
- _.options = _.setOptions = function(e) {
2454
- return X.setOptions(e), _.defaults = X.defaults, dr(_.defaults), _;
2489
+ M.options = M.setOptions = function(e) {
2490
+ return K.setOptions(e), M.defaults = K.defaults, pr(M.defaults), M;
2455
2491
  };
2456
- _.getDefaults = Ve;
2457
- _.defaults = Q;
2458
- _.use = function(...e) {
2459
- return X.use(...e), _.defaults = X.defaults, dr(_.defaults), _;
2492
+ M.getDefaults = Ne;
2493
+ M.defaults = Q;
2494
+ M.use = function(...e) {
2495
+ return K.use(...e), M.defaults = K.defaults, pr(M.defaults), M;
2460
2496
  };
2461
- _.walkTokens = function(e, t) {
2462
- return X.walkTokens(e, t);
2497
+ M.walkTokens = function(e, t) {
2498
+ return K.walkTokens(e, t);
2463
2499
  };
2464
- _.parseInline = X.parseInline;
2465
- _.Parser = F;
2466
- _.parser = F.parse;
2467
- _.Renderer = ve;
2468
- _.TextRenderer = Je;
2469
- _.Lexer = B;
2470
- _.lexer = B.lex;
2471
- _.Tokenizer = ye;
2472
- _.Hooks = oe;
2473
- _.parse = _;
2474
- _.options;
2475
- _.setOptions;
2476
- _.use;
2477
- _.walkTokens;
2478
- _.parseInline;
2479
- F.parse;
2500
+ M.parseInline = K.parseInline;
2501
+ M.Parser = O;
2502
+ M.parser = O.parse;
2503
+ M.Renderer = ke;
2504
+ M.TextRenderer = Ye;
2505
+ M.Lexer = B;
2506
+ M.lexer = B.lex;
2507
+ M.Tokenizer = ve;
2508
+ M.Hooks = ce;
2509
+ M.parse = M;
2510
+ M.options;
2511
+ M.setOptions;
2512
+ M.use;
2513
+ M.walkTokens;
2514
+ M.parseInline;
2515
+ O.parse;
2480
2516
  B.lex;
2481
- const Ga = ["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp", "ico", "avif"];
2482
- function Wa(e) {
2517
+ const Wa = ["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp", "ico", "avif"];
2518
+ function Xa(e) {
2483
2519
  const t = [];
2484
2520
  e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (n) => {
2485
2521
  const o = `__IMG_PROTECTED_${t.length}__`;
@@ -2494,31 +2530,31 @@ function Wa(e) {
2494
2530
  const o = `__IMG_PROTECTED_${t.length}__`;
2495
2531
  return t.push(n), o;
2496
2532
  });
2497
- const r = Ga.join("|"), a = new RegExp(
2533
+ const r = Wa.join("|"), a = new RegExp(
2498
2534
  `<a[^>]*href="(https?:\\/\\/[^"]+\\.(?:${r})(?:\\?[^"]*)?)"[^>]*>([^<]*)<\\/a>`,
2499
2535
  "gi"
2500
2536
  );
2501
2537
  e = e.replace(a, (n, o, i) => {
2502
- const l = i && !i.match(/^(view|see|open|click|image|photo|picture)$/i) ? i : "";
2503
- return Pe(o, l, l);
2538
+ const u = i && !i.match(/^(view|see|open|click|image|photo|picture)$/i) ? i : "";
2539
+ return je(o, u, u);
2504
2540
  });
2505
2541
  const s = new RegExp(
2506
2542
  `(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.(?:${r})(\\?[^\\s<>"]*)?)(?!["'])`,
2507
2543
  "gi"
2508
2544
  );
2509
- e = e.replace(s, (n, o) => Pe(o, "", ""));
2545
+ e = e.replace(s, (n, o) => je(o, "", ""));
2510
2546
  for (let n = t.length - 1; n >= 0; n--)
2511
2547
  e = e.replace(`__IMG_PROTECTED_${n}__`, t[n]);
2512
2548
  return e;
2513
2549
  }
2514
- function Pe(e, t, r) {
2550
+ function je(e, t, r) {
2515
2551
  const a = t || r || "";
2516
2552
  let s = "artifactuse-image";
2517
2553
  e.includes("large2x") || e.includes("large") || r != null && r.toLowerCase().includes("hero") ? s = "artifactuse-hero-image" : e.includes("small") || e.includes("tiny") ? s = "artifactuse-inline-image" : (r != null && r.toLowerCase().includes("aerial") || r != null && r.toLowerCase().includes("view")) && (s = "artifactuse-hero-image");
2518
2554
  let n = '<div class="artifactuse-image-container">';
2519
2555
  return n += `<img src="${e}" alt="${r || ""}" class="${s}" data-lightbox="true" data-caption="${a}" loading="lazy" />`, a && (n += `<div class="artifactuse-image-caption">${a}</div>`), n += "</div>", n;
2520
2556
  }
2521
- function Xa(e) {
2557
+ function Ka(e) {
2522
2558
  const t = e.split(`
2523
2559
  `), r = [];
2524
2560
  let a = [], s = !1;
@@ -2526,42 +2562,42 @@ function Xa(e) {
2526
2562
  const o = t[n].trim();
2527
2563
  if (o.includes('<div class="artifactuse-image-container">')) {
2528
2564
  s || (s = !0, a = []);
2529
- let i = "", l = n, c = 0;
2530
- for (; l < t.length; ) {
2531
- const d = t[l];
2565
+ let i = "", u = n, l = 0;
2566
+ for (; u < t.length; ) {
2567
+ const d = t[u];
2532
2568
  if (i += d + `
2533
- `, c += (d.match(/<div/g) || []).length, c -= (d.match(/<\/div>/g) || []).length, c === 0) break;
2534
- l++;
2569
+ `, l += (d.match(/<div/g) || []).length, l -= (d.match(/<\/div>/g) || []).length, l === 0) break;
2570
+ u++;
2535
2571
  }
2536
- a.push(i.trim()), n = l;
2572
+ a.push(i.trim()), n = u;
2537
2573
  } else if (o === "" || o.match(/^\s*$/)) {
2538
2574
  if (s) continue;
2539
2575
  r.push(t[n]);
2540
2576
  } else {
2541
2577
  if (s && a.length >= 2) {
2542
- const i = ft(a);
2578
+ const i = ht(a);
2543
2579
  r.push(i);
2544
2580
  } else s && a.length === 1 && r.push(a[0]);
2545
2581
  s = !1, a = [], r.push(t[n]);
2546
2582
  }
2547
2583
  }
2548
2584
  if (s && a.length >= 2) {
2549
- const n = ft(a);
2585
+ const n = ht(a);
2550
2586
  r.push(n);
2551
2587
  } else s && a.length === 1 && r.push(a[0]);
2552
2588
  return r.join(`
2553
2589
  `);
2554
2590
  }
2555
- function ft(e) {
2591
+ function ht(e) {
2556
2592
  return `<div class="artifactuse-image-gallery">
2557
2593
  ${e.map((r) => r.replace("artifactuse-image-container", "artifactuse-gallery-item").replace("artifactuse-image-caption", "artifactuse-gallery-caption").replace("artifactuse-image", "artifactuse-gallery-image").replace("artifactuse-hero-image", "artifactuse-gallery-image").replace("artifactuse-inline-image", "artifactuse-gallery-image")).join(`
2558
2594
  `)}
2559
2595
  </div>`;
2560
2596
  }
2561
- const xr = ["mp4", "webm", "mov", "avi", "mkv", "flv", "wmv", "m4v"];
2562
- function Ka(e) {
2597
+ const $r = ["mp4", "webm", "mov", "avi", "mkv", "flv", "wmv", "m4v"];
2598
+ function Ja(e) {
2563
2599
  if (!e) return !1;
2564
- const t = xr.join("|");
2600
+ const t = $r.join("|");
2565
2601
  return !!(new RegExp(`\\.(${t})(\\?.*)?$`, "i").test(e) || /(?:youtube\.com\/watch\?v=|youtu\.be\/)[a-zA-Z0-9_-]+/.test(e) || /vimeo\.com\/\d+/.test(e) || /loom\.com\/share\/[a-zA-Z0-9]+/.test(e) || /dailymotion\.com\/video\/[a-zA-Z0-9]+/.test(e));
2566
2602
  }
2567
2603
  function Qa(e) {
@@ -2571,66 +2607,66 @@ function Qa(e) {
2571
2607
  if (t = e.match(/vimeo\.com\/(\d+)/), t) return { type: "vimeo", id: t[1] };
2572
2608
  if (t = e.match(/loom\.com\/share\/([a-zA-Z0-9]+)/), t) return { type: "loom", id: t[1] };
2573
2609
  if (t = e.match(/dailymotion\.com\/video\/([a-zA-Z0-9]+)/), t) return { type: "dailymotion", id: t[1] };
2574
- const r = xr.join("|");
2610
+ const r = $r.join("|");
2575
2611
  return new RegExp(`\\.(${r})(\\?.*)?$`, "i").test(e) ? { type: "direct", id: e } : null;
2576
2612
  }
2577
- function Ja(e) {
2613
+ function Ya(e) {
2578
2614
  const t = Qa(e);
2579
2615
  if (!t) return `<a href="${e}" target="_blank" rel="noopener noreferrer">${e}</a>`;
2580
2616
  switch (t.type) {
2581
2617
  case "youtube":
2582
- return je(t.id);
2618
+ return qe(t.id);
2583
2619
  case "vimeo":
2584
- return Ze(t.id);
2620
+ return He(t.id);
2585
2621
  case "loom":
2586
- return qe(t.id);
2622
+ return Ze(t.id);
2587
2623
  case "dailymotion":
2588
- return He(t.id);
2624
+ return De(t.id);
2589
2625
  case "direct":
2590
2626
  return Ie(t.id);
2591
2627
  default:
2592
2628
  return `<a href="${e}" target="_blank" rel="noopener noreferrer">${e}</a>`;
2593
2629
  }
2594
2630
  }
2595
- function Ya(e) {
2631
+ function es(e) {
2596
2632
  const t = [];
2597
- e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (f) => {
2598
- const w = `__PROTECTED_${t.length}__`;
2599
- return t.push(f), w;
2600
- }), e = e.replace(/<code[^>]*>[\s\S]*?<\/code>/gi, (f) => {
2601
- const w = `__PROTECTED_${t.length}__`;
2602
- return t.push(f), w;
2603
- }), e = e.replace(/<(video|audio|iframe)[^>]*>[\s\S]*?<\/\1>/gi, (f) => {
2604
- const w = `__PROTECTED_${t.length}__`;
2605
- return t.push(f), w;
2633
+ e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (c) => {
2634
+ const g = `__PROTECTED_${t.length}__`;
2635
+ return t.push(c), g;
2636
+ }), e = e.replace(/<code[^>]*>[\s\S]*?<\/code>/gi, (c) => {
2637
+ const g = `__PROTECTED_${t.length}__`;
2638
+ return t.push(c), g;
2639
+ }), e = e.replace(/<(video|audio|iframe)[^>]*>[\s\S]*?<\/\1>/gi, (c) => {
2640
+ const g = `__PROTECTED_${t.length}__`;
2641
+ return t.push(c), g;
2606
2642
  });
2607
2643
  const r = /\[([^\]]+)\]\((https:\/\/www\.pexels\.com\/video\/[^)]+)\)\s*(?:<\/p>)?\s*(?:<p>)?\s*(?:Preview image:\s*)?!\[([^\]]*)\]\((https:\/\/images\.pexels\.com\/videos\/[^)]+)\)/gi;
2608
- e = e.replace(r, (f, w, h, m, g) => ts(w, h, g, m));
2644
+ e = e.replace(r, (c, g, f, b, h) => rs(g, f, h, b));
2609
2645
  const a = /<a[^>]*href="(https?:\/\/[^"]+\.(mp4|webm|mov|avi|mkv|flv|wmv|m4v)(?:\?[^"]*)?)"[^>]*>[^<]*<\/a>/gi;
2610
- e = e.replace(a, (f, w) => Ie(w));
2646
+ e = e.replace(a, (c, g) => Ie(g));
2611
2647
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.(mp4|webm|mov|avi|mkv|flv|wmv|m4v)(\\?[^\\s<>"]*)?)(?!["'])`, "gi");
2612
- e = e.replace(s, (f, w) => Ie(w));
2648
+ e = e.replace(s, (c, g) => Ie(g));
2613
2649
  const n = /<a[^>]*href="(https?:\/\/(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2614
- e = e.replace(n, (f, w, h) => je(h));
2650
+ e = e.replace(n, (c, g, f) => qe(f));
2615
2651
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?(?:youtube\\.com\\/watch\\?v=|youtu\\.be\\/)([a-zA-Z0-9_-]+))(?!["'])`, "gi");
2616
- e = e.replace(o, (f, w, h) => je(h));
2652
+ e = e.replace(o, (c, g, f) => qe(f));
2617
2653
  const i = /<a[^>]*href="(https?:\/\/(?:www\.)?vimeo\.com\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2618
- e = e.replace(i, (f, w, h) => Ze(h));
2619
- const l = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?vimeo\\.com\\/(\\d+))(?!["'])`, "gi");
2620
- e = e.replace(l, (f, w, h) => Ze(h));
2621
- const c = /<a[^>]*href="(https?:\/\/(?:www\.)?loom\.com\/share\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2622
- e = e.replace(c, (f, w, h) => qe(h));
2654
+ e = e.replace(i, (c, g, f) => He(f));
2655
+ const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?vimeo\\.com\\/(\\d+))(?!["'])`, "gi");
2656
+ e = e.replace(u, (c, g, f) => He(f));
2657
+ const l = /<a[^>]*href="(https?:\/\/(?:www\.)?loom\.com\/share\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2658
+ e = e.replace(l, (c, g, f) => Ze(f));
2623
2659
  const d = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?loom\\.com\\/share\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2624
- e = e.replace(d, (f, w, h) => qe(h));
2660
+ e = e.replace(d, (c, g, f) => Ze(f));
2625
2661
  const p = /<a[^>]*href="(https?:\/\/(?:www\.)?dailymotion\.com\/video\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2626
- e = e.replace(p, (f, w, h) => He(h));
2627
- const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?dailymotion\\.com\\/video\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2628
- e = e.replace(u, (f, w, h) => He(h));
2629
- for (let f = t.length - 1; f >= 0; f--)
2630
- e = e.replace(`__PROTECTED_${f}__`, t[f]);
2662
+ e = e.replace(p, (c, g, f) => De(f));
2663
+ const m = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?dailymotion\\.com\\/video\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2664
+ e = e.replace(m, (c, g, f) => De(f));
2665
+ for (let c = t.length - 1; c >= 0; c--)
2666
+ e = e.replace(`__PROTECTED_${c}__`, t[c]);
2631
2667
  return e;
2632
2668
  }
2633
- function es(e) {
2669
+ function ts(e) {
2634
2670
  const t = e.split("?")[0].split(".").pop().toLowerCase();
2635
2671
  return {
2636
2672
  mp4: "video/mp4",
@@ -2644,33 +2680,33 @@ function es(e) {
2644
2680
  }[t] || "video/mp4";
2645
2681
  }
2646
2682
  function Ie(e) {
2647
- const t = es(e);
2683
+ const t = ts(e);
2648
2684
  return `<div class="artifactuse-video-wrapper"><video controls preload="metadata" class="artifactuse-video"><source src="${e}" type="${t}">Your browser does not support the video tag.</video></div>`;
2649
2685
  }
2650
- function ts(e, t, r, a) {
2686
+ function rs(e, t, r, a) {
2651
2687
  return `<div class="artifactuse-video-preview-container"><div class="artifactuse-video-preview-wrapper" data-video-url="${t}"><img src="${r}" alt="${a}" class="artifactuse-video-preview-image" loading="lazy" /><div class="artifactuse-video-play-overlay"><svg class="artifactuse-play-icon" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg></div><div class="artifactuse-video-info-overlay"><h4 class="artifactuse-video-title">${e}</h4><p class="artifactuse-video-alt">${a}</p></div></div><div class="artifactuse-video-actions"><a href="${t}" target="_blank" rel="noopener" class="artifactuse-video-link">Watch on Pexels</a></div></div>`;
2652
2688
  }
2653
- function je(e) {
2689
+ function qe(e) {
2654
2690
  const t = `https://i.ytimg.com/vi/${e}/hqdefault.jpg`, a = `this.parentElement.innerHTML='<iframe src=\\'${`https://www.youtube.com/embed/${e}?autoplay=1`}\\' frameborder=\\'0\\' allow=\\'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\\' allowfullscreen class=\\'artifactuse-video-iframe\\'></iframe>'`;
2655
2691
  return `<div class="artifactuse-video-wrapper artifactuse-video-lazy" data-video-type="youtube" data-video-id="${e}"><button type="button" class="artifactuse-video-facade" aria-label="Play YouTube video" onclick="${a}"><img src="${t}" alt="YouTube video thumbnail" class="artifactuse-video-thumbnail" loading="lazy" /><div class="artifactuse-video-play-button artifactuse-youtube-play"><svg viewBox="0 0 68 48" width="68" height="48"><path class="artifactuse-youtube-play-bg" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z" fill="#f00"/><path d="M 45,24 27,14 27,34" fill="#fff"/></svg></div></button></div>`;
2656
2692
  }
2657
- function Ze(e) {
2693
+ function He(e) {
2658
2694
  const t = `https://player.vimeo.com/video/${e}?autoplay=1`, r = `https://vumbnail.com/${e}.jpg`, a = `this.parentElement.innerHTML='<iframe src=\\'${t}\\' frameborder=\\'0\\' allow=\\'autoplay; fullscreen; picture-in-picture\\' allowfullscreen class=\\'artifactuse-video-iframe\\'></iframe>'`;
2659
2695
  return `<div class="artifactuse-video-wrapper artifactuse-video-lazy" data-video-type="vimeo" data-video-id="${e}"><button type="button" class="artifactuse-video-facade" aria-label="Play Vimeo video" onclick="${a}"><img src="${r}" alt="Vimeo video thumbnail" class="artifactuse-video-thumbnail" loading="lazy" onerror="this.style.display='none'" /><div class="artifactuse-video-play-button artifactuse-vimeo-play"><svg viewBox="0 0 64 64" width="64" height="64"><circle cx="32" cy="32" r="31" fill="#1ab7ea"/><path d="M26 20 L26 44 L46 32 Z" fill="#fff"/></svg></div></button></div>`;
2660
2696
  }
2661
- function qe(e) {
2697
+ function Ze(e) {
2662
2698
  const t = `https://www.loom.com/embed/${e}?autoplay=1`, r = `https://cdn.loom.com/sessions/thumbnails/${e}-with-play.gif`, a = `this.parentElement.innerHTML='<iframe src=\\'${t}\\' frameborder=\\'0\\' allowfullscreen class=\\'artifactuse-video-iframe\\'></iframe>'`;
2663
2699
  return `<div class="artifactuse-video-wrapper artifactuse-video-lazy" data-video-type="loom" data-video-id="${e}"><button type="button" class="artifactuse-video-facade" aria-label="Play Loom video" onclick="${a}"><img src="${r}" alt="Loom video thumbnail" class="artifactuse-video-thumbnail" loading="lazy" onerror="this.style.display='none'" /><div class="artifactuse-video-play-button artifactuse-loom-play"><svg viewBox="0 0 64 64" width="64" height="64"><circle cx="32" cy="32" r="31" fill="#625df5"/><path d="M26 20 L26 44 L46 32 Z" fill="#fff"/></svg></div></button></div>`;
2664
2700
  }
2665
- function He(e) {
2701
+ function De(e) {
2666
2702
  const t = `https://www.dailymotion.com/embed/video/${e}?autoplay=1`, r = `https://www.dailymotion.com/thumbnail/video/${e}`, a = `this.parentElement.innerHTML='<iframe src=\\'${t}\\' frameborder=\\'0\\' allow=\\'autoplay; fullscreen; picture-in-picture\\' allowfullscreen class=\\'artifactuse-video-iframe\\'></iframe>'`;
2667
2703
  return `<div class="artifactuse-video-wrapper artifactuse-video-lazy" data-video-type="dailymotion" data-video-id="${e}"><button type="button" class="artifactuse-video-facade" aria-label="Play Dailymotion video" onclick="${a}"><img src="${r}" alt="Dailymotion video thumbnail" class="artifactuse-video-thumbnail" loading="lazy" onerror="this.style.display='none'" /><div class="artifactuse-video-play-button artifactuse-dailymotion-play"><svg viewBox="0 0 64 64" width="64" height="64"><circle cx="32" cy="32" r="31" fill="#0066dc"/><path d="M26 20 L26 44 L46 32 Z" fill="#fff"/></svg></div></button></div>`;
2668
2704
  }
2669
- function rs(e) {
2705
+ function as(e) {
2670
2706
  let t = e.replace(/<\/p>/g, "").replace(/<p>/g, "").replace(/<br\s*\/?>/g, "").replace(/<strong>.*?<\/strong>/g, "").replace(/<em>.*?<\/em>/g, "").replace(/<b>.*?<\/b>/g, "").replace(/<i>.*?<\/i>/g, "").replace(/\n/g, "").replace(/\s+/g, "").trim();
2671
2707
  return /<(?!\/)[^>]+>/.test(t) ? !1 : t.length < 200;
2672
2708
  }
2673
- function Ce(e) {
2709
+ function Le(e) {
2674
2710
  let t = e.match(/<p>((?:[^<]|<(?!\/p>))*?)(?:<br\s*\/?>)?\s*<\/p>\s*$/);
2675
2711
  if (t) {
2676
2712
  const r = t[1].trim(), a = r.replace(/<[^>]*>/g, "").trim();
@@ -2684,23 +2720,23 @@ function Ce(e) {
2684
2720
  }
2685
2721
  return "";
2686
2722
  }
2687
- function as(e) {
2723
+ function ss(e) {
2688
2724
  const t = /<div class="artifactuse-video-(wrapper|preview-container)/g, r = [];
2689
2725
  let a;
2690
2726
  for (; (a = t.exec(e)) !== null; ) {
2691
- const l = a.index;
2692
- let c = 0, d = l;
2693
- for (let p = l; p < e.length; p++)
2727
+ const u = a.index;
2728
+ let l = 0, d = u;
2729
+ for (let p = u; p < e.length; p++)
2694
2730
  if (e.substring(p, p + 4) === "<div")
2695
- c++;
2696
- else if (e.substring(p, p + 6) === "</div>" && (c--, c === 0)) {
2731
+ l++;
2732
+ else if (e.substring(p, p + 6) === "</div>" && (l--, l === 0)) {
2697
2733
  d = p + 6;
2698
2734
  break;
2699
2735
  }
2700
2736
  r.push({
2701
- start: l,
2737
+ start: u,
2702
2738
  end: d,
2703
- html: e.substring(l, d)
2739
+ html: e.substring(u, d)
2704
2740
  });
2705
2741
  }
2706
2742
  if (r.length < 2)
@@ -2708,36 +2744,36 @@ function as(e) {
2708
2744
  const s = [];
2709
2745
  let n = [{
2710
2746
  ...r[0],
2711
- caption: Ce(e.substring(0, r[0].start))
2747
+ caption: Le(e.substring(0, r[0].start))
2712
2748
  }];
2713
- for (let l = 1; l < r.length; l++) {
2714
- const c = r[l - 1], d = r[l], p = e.substring(c.end, d.start);
2715
- rs(p) ? n.push({
2749
+ for (let u = 1; u < r.length; u++) {
2750
+ const l = r[u - 1], d = r[u], p = e.substring(l.end, d.start);
2751
+ as(p) ? n.push({
2716
2752
  ...d,
2717
- caption: Ce(p)
2753
+ caption: Le(p)
2718
2754
  }) : (s.push([...n]), n = [{
2719
2755
  ...d,
2720
- caption: Ce(e.substring(c.end, d.start))
2756
+ caption: Le(e.substring(l.end, d.start))
2721
2757
  }]);
2722
2758
  }
2723
2759
  s.push(n);
2724
2760
  let o = "", i = 0;
2725
- for (const l of s) {
2726
- if (l.length === 0) continue;
2727
- const c = l[0];
2728
- let d = c.start;
2729
- const u = e.substring(i, c.start).match(/<p>((?:[^<]|<(?!\/p>))*?)(?:<br\s*\/?>)?\s*<\/p>\s*$/);
2730
- if (u && (d = c.start - u[0].length, l[0].caption = u[1].trim()), o += e.substring(i, d), l.length >= 2)
2731
- o += ss(l);
2761
+ for (const u of s) {
2762
+ if (u.length === 0) continue;
2763
+ const l = u[0];
2764
+ let d = l.start;
2765
+ const m = e.substring(i, l.start).match(/<p>((?:[^<]|<(?!\/p>))*?)(?:<br\s*\/?>)?\s*<\/p>\s*$/);
2766
+ if (m && (d = l.start - m[0].length, u[0].caption = m[1].trim()), o += e.substring(i, d), u.length >= 2)
2767
+ o += ns(u);
2732
2768
  else {
2733
- const f = l[0];
2734
- f.caption ? o += `<div class="artifactuse-video-container">${f.html}<div class="artifactuse-video-caption">${f.caption}</div></div>` : o += f.html;
2769
+ const c = u[0];
2770
+ c.caption ? o += `<div class="artifactuse-video-container">${c.html}<div class="artifactuse-video-caption">${c.caption}</div></div>` : o += c.html;
2735
2771
  }
2736
- i = l[l.length - 1].end;
2772
+ i = u[u.length - 1].end;
2737
2773
  }
2738
2774
  return o += e.substring(i), o = o.replace(/<p>\s*<\/p>/g, ""), o;
2739
2775
  }
2740
- function ss(e) {
2776
+ function ns(e) {
2741
2777
  return `<div class="artifactuse-video-gallery">
2742
2778
  ${e.map(({ html: r, caption: a }) => {
2743
2779
  let s = r.replace(
@@ -2752,10 +2788,10 @@ ${e.map(({ html: r, caption: a }) => {
2752
2788
  `)}
2753
2789
  </div>`;
2754
2790
  }
2755
- function ns() {
2791
+ function is() {
2756
2792
  return `audio-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
2757
2793
  }
2758
- function is(e, t = {}) {
2794
+ function os(e, t = {}) {
2759
2795
  const r = t.theme || "dark", a = [];
2760
2796
  e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (A) => {
2761
2797
  const S = `__PROTECTED_${a.length}__`;
@@ -2768,59 +2804,59 @@ function is(e, t = {}) {
2768
2804
  return a.push(A), S;
2769
2805
  });
2770
2806
  const s = /<a[^>]*href="(https?:\/\/[^"]+\.(mp3|wav|flac|aac|ogg|m4a|wma)(?:\?[^"]*)?)"[^>]*>[^<]*<\/a>/gi;
2771
- e = e.replace(s, (A, S) => ht(S));
2807
+ e = e.replace(s, (A, S) => gt(S));
2772
2808
  const n = new RegExp(`(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.(mp3|wav|flac|aac|ogg|m4a|wma)(\\?[^\\s<>"]*)?)(?!["'])`, "gi");
2773
- e = e.replace(n, (A, S) => ht(S));
2809
+ e = e.replace(n, (A, S) => gt(S));
2774
2810
  const o = /<a[^>]*href="(https?:\/\/(?:www\.)?soundcloud\.com\/[^"]+)"[^>]*>[^<]*<\/a>/gi;
2775
- e = e.replace(o, (A, S) => gt(S));
2811
+ e = e.replace(o, (A, S) => mt(S));
2776
2812
  const i = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?soundcloud\\.com\\/[^\\s<>"]+)(?!["'])`, "gi");
2777
- e = e.replace(i, (A, S) => gt(S));
2778
- const l = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/track\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2779
- e = e.replace(l, (A, S, C) => O("track", C, r));
2780
- const c = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/track\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2781
- e = e.replace(c, (A, S, C) => O("track", C, r));
2813
+ e = e.replace(i, (A, S) => mt(S));
2814
+ const u = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/track\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2815
+ e = e.replace(u, (A, S, C) => D("track", C, r));
2816
+ const l = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/track\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2817
+ e = e.replace(l, (A, S, C) => D("track", C, r));
2782
2818
  const d = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/album\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2783
- e = e.replace(d, (A, S, C) => O("album", C, r));
2819
+ e = e.replace(d, (A, S, C) => D("album", C, r));
2784
2820
  const p = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/album\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2785
- e = e.replace(p, (A, S, C) => O("album", C, r));
2786
- const u = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/playlist\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2787
- e = e.replace(u, (A, S, C) => O("playlist", C, r));
2788
- const f = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/playlist\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2789
- e = e.replace(f, (A, S, C) => O("playlist", C, r));
2790
- const w = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/artist\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2791
- e = e.replace(w, (A, S, C) => O("artist", C, r));
2792
- const h = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/artist\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2793
- e = e.replace(h, (A, S, C) => O("artist", C, r));
2794
- const m = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/episode\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2795
- e = e.replace(m, (A, S, C) => O("episode", C, r));
2796
- const g = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/episode\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2797
- e = e.replace(g, (A, S, C) => O("episode", C, r));
2798
- const b = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/show\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2799
- e = e.replace(b, (A, S, C) => O("show", C, r));
2821
+ e = e.replace(p, (A, S, C) => D("album", C, r));
2822
+ const m = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/playlist\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2823
+ e = e.replace(m, (A, S, C) => D("playlist", C, r));
2824
+ const c = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/playlist\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2825
+ e = e.replace(c, (A, S, C) => D("playlist", C, r));
2826
+ const g = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/artist\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2827
+ e = e.replace(g, (A, S, C) => D("artist", C, r));
2828
+ const f = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/artist\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2829
+ e = e.replace(f, (A, S, C) => D("artist", C, r));
2830
+ const b = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/episode\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2831
+ e = e.replace(b, (A, S, C) => D("episode", C, r));
2832
+ const h = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/episode\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2833
+ e = e.replace(h, (A, S, C) => D("episode", C, r));
2834
+ const w = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/show\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2835
+ e = e.replace(w, (A, S, C) => D("show", C, r));
2800
2836
  const v = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/show\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2801
- e = e.replace(v, (A, S, C) => O("show", C, r));
2837
+ e = e.replace(v, (A, S, C) => D("show", C, r));
2802
2838
  const y = /<a[^>]*href="(https?:\/\/music\.apple\.com\/([a-z]{2})\/([a-z-]+)\/[^\/]+\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2803
- e = e.replace(y, (A, S, C, q, R) => mt(C, q, R));
2839
+ e = e.replace(y, (A, S, C, V, R) => bt(C, V, R));
2804
2840
  const $ = new RegExp(`(?<!["'=])(https?:\\/\\/music\\.apple\\.com\\/([a-z]{2})\\/([a-z-]+)\\/[^\\/\\s]+\\/(\\d+))(?!["'])`, "gi");
2805
- e = e.replace($, (A, S, C, q, R) => mt(C, q, R));
2841
+ e = e.replace($, (A, S, C, V, R) => bt(C, V, R));
2806
2842
  for (let A = a.length - 1; A >= 0; A--)
2807
2843
  e = e.replace(`__PROTECTED_${A}__`, a[A]);
2808
2844
  return e;
2809
2845
  }
2810
- function os(e) {
2846
+ function cs(e) {
2811
2847
  const t = e.match(/\.([a-zA-Z0-9]+)(?:\?|$)/);
2812
2848
  return t ? t[1].toUpperCase() : "AUDIO";
2813
2849
  }
2814
- function ie(e) {
2850
+ function oe(e) {
2815
2851
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
2816
2852
  }
2817
- function ht(e) {
2818
- const t = ns(), r = decodeURIComponent(e.split("/").pop().split("?")[0]), a = os(e);
2853
+ function gt(e) {
2854
+ const t = is(), r = decodeURIComponent(e.split("/").pop().split("?")[0]), a = cs(e);
2819
2855
  return `
2820
- <div class="artifactuse-audio-player" data-player-id="${t}" data-audio-src="${ie(e)}">
2856
+ <div class="artifactuse-audio-player" data-player-id="${t}" data-audio-src="${oe(e)}">
2821
2857
  <!-- Hidden audio element -->
2822
2858
  <audio preload="metadata" class="artifactuse-audio-element">
2823
- <source src="${ie(e)}" type="audio/mpeg">
2859
+ <source src="${oe(e)}" type="audio/mpeg">
2824
2860
  </audio>
2825
2861
 
2826
2862
  <!-- Header -->
@@ -2833,7 +2869,7 @@ function ht(e) {
2833
2869
  </svg>
2834
2870
  </div>
2835
2871
  <div class="artifactuse-audio-meta">
2836
- <span class="artifactuse-audio-filename" title="${ie(r)}">${ie(r)}</span>
2872
+ <span class="artifactuse-audio-filename" title="${oe(r)}">${oe(r)}</span>
2837
2873
  <span class="artifactuse-audio-format">${a}</span>
2838
2874
  </div>
2839
2875
  <span class="artifactuse-audio-duration">--:--</span>
@@ -2894,7 +2930,7 @@ function ht(e) {
2894
2930
  </div>
2895
2931
 
2896
2932
  <!-- Download -->
2897
- <a href="${ie(e)}" download class="artifactuse-audio-btn artifactuse-audio-download-btn" aria-label="Download">
2933
+ <a href="${oe(e)}" download class="artifactuse-audio-btn artifactuse-audio-download-btn" aria-label="Download">
2898
2934
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
2899
2935
  <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
2900
2936
  <polyline points="7 10 12 15 17 10"></polyline>
@@ -2906,7 +2942,7 @@ function ht(e) {
2906
2942
  </div>
2907
2943
  `;
2908
2944
  }
2909
- function gt(e) {
2945
+ function mt(e) {
2910
2946
  return `
2911
2947
  <div class="artifactuse-soundcloud-wrapper">
2912
2948
  <iframe
@@ -2918,7 +2954,7 @@ function gt(e) {
2918
2954
  </div>
2919
2955
  `;
2920
2956
  }
2921
- function O(e, t, r = "dark") {
2957
+ function D(e, t, r = "dark") {
2922
2958
  const s = {
2923
2959
  track: 152,
2924
2960
  album: 352,
@@ -2941,7 +2977,7 @@ function O(e, t, r = "dark") {
2941
2977
  </div>
2942
2978
  `;
2943
2979
  }
2944
- function mt(e, t, r) {
2980
+ function bt(e, t, r) {
2945
2981
  return `
2946
2982
  <div class="artifactuse-apple-music-wrapper">
2947
2983
  <iframe
@@ -2955,18 +2991,18 @@ function mt(e, t, r) {
2955
2991
  </div>
2956
2992
  `;
2957
2993
  }
2958
- const K = /* @__PURE__ */ new Map(), Le = [0.5, 0.75, 1, 1.25, 1.5, 2];
2959
- function cs(e = document) {
2994
+ const J = /* @__PURE__ */ new Map(), Me = [0.5, 0.75, 1, 1.25, 1.5, 2];
2995
+ function ls(e = document) {
2960
2996
  e.querySelectorAll(".artifactuse-audio-player:not([data-initialized])").forEach((r) => {
2961
- ls(r);
2997
+ us(r);
2962
2998
  });
2963
2999
  }
2964
- function ls(e) {
3000
+ function us(e) {
2965
3001
  const t = e.dataset.playerId, r = e.dataset.audioSrc;
2966
3002
  if (!t || !r) return;
2967
- const a = e.querySelector(".artifactuse-audio-element"), s = e.querySelector(".artifactuse-audio-play-btn"), n = e.querySelector(".artifactuse-audio-icon-play"), o = e.querySelector(".artifactuse-audio-icon-pause"), i = e.querySelector(".artifactuse-audio-current"), l = e.querySelector(".artifactuse-audio-duration"), c = e.querySelector(".artifactuse-audio-waveform"), d = e.querySelector(".artifactuse-audio-waveform-canvas"), p = e.querySelector(".artifactuse-audio-waveform-progress"), u = e.querySelector(".artifactuse-audio-waveform-hover"), f = e.querySelector(".artifactuse-audio-mute-btn"), w = e.querySelector(".artifactuse-audio-icon-volume"), h = e.querySelector(".artifactuse-audio-icon-muted"), m = e.querySelector(".artifactuse-audio-volume-slider"), g = e.querySelector(".artifactuse-audio-speed-btn");
3003
+ const a = e.querySelector(".artifactuse-audio-element"), s = e.querySelector(".artifactuse-audio-play-btn"), n = e.querySelector(".artifactuse-audio-icon-play"), o = e.querySelector(".artifactuse-audio-icon-pause"), i = e.querySelector(".artifactuse-audio-current"), u = e.querySelector(".artifactuse-audio-duration"), l = e.querySelector(".artifactuse-audio-waveform"), d = e.querySelector(".artifactuse-audio-waveform-canvas"), p = e.querySelector(".artifactuse-audio-waveform-progress"), m = e.querySelector(".artifactuse-audio-waveform-hover"), c = e.querySelector(".artifactuse-audio-mute-btn"), g = e.querySelector(".artifactuse-audio-icon-volume"), f = e.querySelector(".artifactuse-audio-icon-muted"), b = e.querySelector(".artifactuse-audio-volume-slider"), h = e.querySelector(".artifactuse-audio-speed-btn");
2968
3004
  if (!a) return;
2969
- const b = {
3005
+ const w = {
2970
3006
  isPlaying: !1,
2971
3007
  isMuted: !1,
2972
3008
  volume: 1,
@@ -2975,41 +3011,41 @@ function ls(e) {
2975
3011
  currentTime: 0,
2976
3012
  waveformData: null
2977
3013
  };
2978
- K.set(t, { playerEl: e, audio: a, state: b }), us(d, t), s == null || s.addEventListener("click", () => {
2979
- b.isPlaying ? kt(t) : vt(t);
3014
+ J.set(t, { playerEl: e, audio: a, state: w }), ds(d, t), s == null || s.addEventListener("click", () => {
3015
+ w.isPlaying ? xt(t) : kt(t);
2980
3016
  }), a.addEventListener("loadedmetadata", () => {
2981
- b.duration = a.duration, l.textContent = yt(a.duration);
3017
+ w.duration = a.duration, u.textContent = vt(a.duration);
2982
3018
  }), a.addEventListener("timeupdate", () => {
2983
- b.currentTime = a.currentTime, i.textContent = yt(a.currentTime);
3019
+ w.currentTime = a.currentTime, i.textContent = vt(a.currentTime);
2984
3020
  const v = a.currentTime / a.duration * 100;
2985
3021
  p.style.width = `${v}%`;
2986
3022
  }), a.addEventListener("ended", () => {
2987
- b.isPlaying = !1, n.style.display = "", o.style.display = "none", e.classList.remove("is-playing"), p.style.width = "0%";
3023
+ w.isPlaying = !1, n.style.display = "", o.style.display = "none", e.classList.remove("is-playing"), p.style.width = "0%";
2988
3024
  }), a.addEventListener("play", () => {
2989
- b.isPlaying = !0, n.style.display = "none", o.style.display = "", e.classList.add("is-playing"), ds(t);
3025
+ w.isPlaying = !0, n.style.display = "none", o.style.display = "", e.classList.add("is-playing"), ps(t);
2990
3026
  }), a.addEventListener("pause", () => {
2991
- b.isPlaying = !1, n.style.display = "", o.style.display = "none", e.classList.remove("is-playing");
2992
- }), c == null || c.addEventListener("click", (v) => {
2993
- const y = c.getBoundingClientRect(), S = (v.clientX - y.left) / y.width * a.duration;
3027
+ w.isPlaying = !1, n.style.display = "", o.style.display = "none", e.classList.remove("is-playing");
3028
+ }), l == null || l.addEventListener("click", (v) => {
3029
+ const y = l.getBoundingClientRect(), S = (v.clientX - y.left) / y.width * a.duration;
2994
3030
  isNaN(S) || (a.currentTime = S);
2995
- }), c == null || c.addEventListener("mousemove", (v) => {
2996
- const y = c.getBoundingClientRect(), A = (v.clientX - y.left) / y.width * 100;
2997
- u.style.width = `${A}%`;
2998
- }), c == null || c.addEventListener("mouseleave", () => {
2999
- u.style.width = "0%";
3000
- }), f == null || f.addEventListener("click", () => {
3001
- b.isMuted = !b.isMuted, a.muted = b.isMuted, w.style.display = b.isMuted ? "none" : "", h.style.display = b.isMuted ? "" : "none", b.isMuted ? m.value = 0 : m.value = b.volume * 100;
3002
- }), m == null || m.addEventListener("input", (v) => {
3031
+ }), l == null || l.addEventListener("mousemove", (v) => {
3032
+ const y = l.getBoundingClientRect(), A = (v.clientX - y.left) / y.width * 100;
3033
+ m.style.width = `${A}%`;
3034
+ }), l == null || l.addEventListener("mouseleave", () => {
3035
+ m.style.width = "0%";
3036
+ }), c == null || c.addEventListener("click", () => {
3037
+ w.isMuted = !w.isMuted, a.muted = w.isMuted, g.style.display = w.isMuted ? "none" : "", f.style.display = w.isMuted ? "" : "none", w.isMuted ? b.value = 0 : b.value = w.volume * 100;
3038
+ }), b == null || b.addEventListener("input", (v) => {
3003
3039
  const y = parseInt(v.target.value, 10) / 100;
3004
- b.volume = y, a.volume = y, y === 0 ? (b.isMuted = !0, w.style.display = "none", h.style.display = "") : (b.isMuted = !1, a.muted = !1, w.style.display = "", h.style.display = "none");
3005
- }), g == null || g.addEventListener("click", () => {
3006
- const y = (Le.indexOf(b.playbackRate) + 1) % Le.length;
3007
- b.playbackRate = Le[y], a.playbackRate = b.playbackRate, g.querySelector("span").textContent = `${b.playbackRate}x`;
3040
+ w.volume = y, a.volume = y, y === 0 ? (w.isMuted = !0, g.style.display = "none", f.style.display = "") : (w.isMuted = !1, a.muted = !1, g.style.display = "", f.style.display = "none");
3041
+ }), h == null || h.addEventListener("click", () => {
3042
+ const y = (Me.indexOf(w.playbackRate) + 1) % Me.length;
3043
+ w.playbackRate = Me[y], a.playbackRate = w.playbackRate, h.querySelector("span").textContent = `${w.playbackRate}x`;
3008
3044
  }), e.addEventListener("keydown", (v) => {
3009
3045
  switch (v.key) {
3010
3046
  case " ":
3011
3047
  case "k":
3012
- v.preventDefault(), b.isPlaying ? kt(t) : vt(t);
3048
+ v.preventDefault(), w.isPlaying ? xt(t) : kt(t);
3013
3049
  break;
3014
3050
  case "ArrowLeft":
3015
3051
  v.preventDefault(), a.currentTime = Math.max(0, a.currentTime - 5);
@@ -3018,30 +3054,30 @@ function ls(e) {
3018
3054
  v.preventDefault(), a.currentTime = Math.min(a.duration, a.currentTime + 5);
3019
3055
  break;
3020
3056
  case "ArrowUp":
3021
- v.preventDefault(), b.volume = Math.min(1, b.volume + 0.1), a.volume = b.volume, m.value = b.volume * 100;
3057
+ v.preventDefault(), w.volume = Math.min(1, w.volume + 0.1), a.volume = w.volume, b.value = w.volume * 100;
3022
3058
  break;
3023
3059
  case "ArrowDown":
3024
- v.preventDefault(), b.volume = Math.max(0, b.volume - 0.1), a.volume = b.volume, m.value = b.volume * 100;
3060
+ v.preventDefault(), w.volume = Math.max(0, w.volume - 0.1), a.volume = w.volume, b.value = w.volume * 100;
3025
3061
  break;
3026
3062
  case "m":
3027
- v.preventDefault(), f == null || f.click();
3063
+ v.preventDefault(), c == null || c.click();
3028
3064
  break;
3029
3065
  }
3030
3066
  }), e.setAttribute("data-initialized", "true"), e.setAttribute("tabindex", "0");
3031
3067
  }
3032
- function us(e, t) {
3068
+ function ds(e, t) {
3033
3069
  if (!e) return;
3034
3070
  const r = e.getContext("2d"), a = window.devicePixelRatio || 1, s = e.parentElement.getBoundingClientRect();
3035
3071
  e.width = s.width * a, e.height = s.height * a, e.style.width = `${s.width}px`, e.style.height = `${s.height}px`, r.scale(a, a);
3036
- const n = s.width, o = s.height, i = Math.floor(n / 4), l = bt(i, t);
3037
- wt(r, l, n, o), new ResizeObserver(() => {
3072
+ const n = s.width, o = s.height, i = Math.floor(n / 4), u = wt(i, t);
3073
+ yt(r, u, n, o), new ResizeObserver(() => {
3038
3074
  const d = e.parentElement.getBoundingClientRect();
3039
3075
  e.width = d.width * a, e.height = d.height * a, e.style.width = `${d.width}px`, e.style.height = `${d.height}px`, r.scale(a, a);
3040
- const p = Math.floor(d.width / 4), u = bt(p, t);
3041
- wt(r, u, d.width, d.height);
3076
+ const p = Math.floor(d.width / 4), m = wt(p, t);
3077
+ yt(r, m, d.width, d.height);
3042
3078
  }).observe(e.parentElement);
3043
3079
  }
3044
- function bt(e, t) {
3080
+ function wt(e, t) {
3045
3081
  const r = [];
3046
3082
  let a = 0;
3047
3083
  for (let n = 0; n < t.length; n++) {
@@ -3053,115 +3089,115 @@ function bt(e, t) {
3053
3089
  const o = n / e;
3054
3090
  let i = 0.3 + 0.2 * Math.sin(o * Math.PI * 4 + s() * Math.PI) + 0.15 * Math.sin(o * Math.PI * 8 + s() * Math.PI) + 0.1 * Math.sin(o * Math.PI * 16 + s() * Math.PI);
3055
3091
  i += (s() - 0.5) * 0.3;
3056
- const l = Math.sin(o * Math.PI);
3057
- i *= 0.5 + 0.5 * l, i = Math.max(0.1, Math.min(1, i)), r.push(i);
3092
+ const u = Math.sin(o * Math.PI);
3093
+ i *= 0.5 + 0.5 * u, i = Math.max(0.1, Math.min(1, i)), r.push(i);
3058
3094
  }
3059
3095
  return r;
3060
3096
  }
3061
- function wt(e, t, r, a) {
3097
+ function yt(e, t, r, a) {
3062
3098
  e.clearRect(0, 0, r, a);
3063
- const s = 2, o = s + 2, i = a / 2, c = getComputedStyle(document.documentElement).getPropertyValue("--artifactuse-text-muted").trim() || "107, 114, 128";
3064
- e.fillStyle = `rgba(${c}, 0.4)`, t.forEach((d, p) => {
3065
- const u = p * o, f = d * (a * 0.8), w = f / 2, h = s / 2;
3066
- e.beginPath(), e.roundRect(u, i - w, s, f, h), e.fill();
3099
+ const s = 2, o = s + 2, i = a / 2, l = getComputedStyle(document.documentElement).getPropertyValue("--artifactuse-text-muted").trim() || "107, 114, 128";
3100
+ e.fillStyle = `rgba(${l}, 0.4)`, t.forEach((d, p) => {
3101
+ const m = p * o, c = d * (a * 0.8), g = c / 2, f = s / 2;
3102
+ e.beginPath(), e.roundRect(m, i - g, s, c, f), e.fill();
3067
3103
  });
3068
3104
  }
3069
- function yt(e) {
3105
+ function vt(e) {
3070
3106
  if (!e || isNaN(e)) return "0:00";
3071
3107
  const t = Math.floor(e / 3600), r = Math.floor(e % 3600 / 60), a = Math.floor(e % 60);
3072
3108
  return t > 0 ? `${t}:${r.toString().padStart(2, "0")}:${a.toString().padStart(2, "0")}` : `${r}:${a.toString().padStart(2, "0")}`;
3073
3109
  }
3074
- function vt(e) {
3075
- const t = K.get(e);
3110
+ function kt(e) {
3111
+ const t = J.get(e);
3076
3112
  t && t.audio.play();
3077
3113
  }
3078
- function kt(e) {
3079
- const t = K.get(e);
3114
+ function xt(e) {
3115
+ const t = J.get(e);
3080
3116
  t && t.audio.pause();
3081
3117
  }
3082
- function ds(e) {
3083
- K.forEach((t, r) => {
3118
+ function ps(e) {
3119
+ J.forEach((t, r) => {
3084
3120
  r !== e && t.state.isPlaying && t.audio.pause();
3085
3121
  });
3086
3122
  }
3087
- function ps(e) {
3088
- const t = K.get(e);
3089
- t && (t.audio.pause(), t.audio.src = "", K.delete(e));
3123
+ function fs(e) {
3124
+ const t = J.get(e);
3125
+ t && (t.audio.pause(), t.audio.src = "", J.delete(e));
3090
3126
  }
3091
- function fs() {
3092
- K.forEach((e, t) => {
3093
- ps(t);
3127
+ function hs() {
3128
+ J.forEach((e, t) => {
3129
+ fs(t);
3094
3130
  });
3095
3131
  }
3096
- function hs(e) {
3132
+ function gs(e) {
3097
3133
  const t = [];
3098
- e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (m) => {
3099
- const g = `__PROTECTED_MAP_${t.length}__`;
3100
- return t.push(m), g;
3101
- }), e = e.replace(/<code[^>]*>[\s\S]*?<\/code>/gi, (m) => {
3102
- const g = `__PROTECTED_MAP_${t.length}__`;
3103
- return t.push(m), g;
3104
- }), e = e.replace(/<iframe[^>]*>[\s\S]*?<\/iframe>/gi, (m) => {
3105
- const g = `__PROTECTED_MAP_${t.length}__`;
3106
- return t.push(m), g;
3134
+ e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (b) => {
3135
+ const h = `__PROTECTED_MAP_${t.length}__`;
3136
+ return t.push(b), h;
3137
+ }), e = e.replace(/<code[^>]*>[\s\S]*?<\/code>/gi, (b) => {
3138
+ const h = `__PROTECTED_MAP_${t.length}__`;
3139
+ return t.push(b), h;
3140
+ }), e = e.replace(/<iframe[^>]*>[\s\S]*?<\/iframe>/gi, (b) => {
3141
+ const h = `__PROTECTED_MAP_${t.length}__`;
3142
+ return t.push(b), h;
3107
3143
  });
3108
3144
  const r = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/embed\?pb=[^"]+)"[^>]*>[^<]*<\/a>/gi;
3109
- e = e.replace(r, (m, g) => {
3110
- const b = `__PROTECTED_MAP_${t.length}__`;
3111
- return t.push(xt(g)), b;
3145
+ e = e.replace(r, (b, h) => {
3146
+ const w = `__PROTECTED_MAP_${t.length}__`;
3147
+ return t.push($t(h)), w;
3112
3148
  });
3113
3149
  const a = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/embed\\?pb=[^\\s<>"]+)(?!["'])`, "gi");
3114
- e = e.replace(a, (m, g) => {
3115
- const b = `__PROTECTED_MAP_${t.length}__`;
3116
- return t.push(xt(g)), b;
3150
+ e = e.replace(a, (b, h) => {
3151
+ const w = `__PROTECTED_MAP_${t.length}__`;
3152
+ return t.push($t(h)), w;
3117
3153
  });
3118
3154
  const s = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/place\/([^\/\?"]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3119
- e = e.replace(s, (m, g, b) => N(decodeURIComponent(b.replace(/\+/g, " "))));
3155
+ e = e.replace(s, (b, h, w) => U(decodeURIComponent(w.replace(/\+/g, " "))));
3120
3156
  const n = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/place\\/([^\\/\\?\\s]+))(?!["'])`, "gi");
3121
- e = e.replace(n, (m, g, b) => N(decodeURIComponent(b.replace(/\+/g, " "))));
3157
+ e = e.replace(n, (b, h, w) => U(decodeURIComponent(w.replace(/\+/g, " "))));
3122
3158
  const o = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/@([0-9.-]+),([0-9.-]+),([0-9]+)z[^"]*)"[^>]*>[^<]*<\/a>/gi;
3123
- e = e.replace(o, (m, g, b, v, y) => De(b, v, y));
3159
+ e = e.replace(o, (b, h, w, v, y) => Be(w, v, y));
3124
3160
  const i = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/@([0-9.-]+),([0-9.-]+),([0-9]+)z)(?!["'])`, "gi");
3125
- e = e.replace(i, (m, g, b, v, y) => De(b, v, y));
3126
- const l = /<a[^>]*href="(https?:\/\/maps\.google\.com\/\?q=([^\s"&]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3127
- e = e.replace(l, (m, g, b) => N(decodeURIComponent(b)));
3128
- const c = new RegExp(`(?<!["'=])(https?:\\/\\/maps\\.google\\.com\\/\\?q=([^\\s"&]+))(?!["'])`, "gi");
3129
- e = e.replace(c, (m, g, b) => N(decodeURIComponent(b)));
3161
+ e = e.replace(i, (b, h, w, v, y) => Be(w, v, y));
3162
+ const u = /<a[^>]*href="(https?:\/\/maps\.google\.com\/\?q=([^\s"&]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3163
+ e = e.replace(u, (b, h, w) => U(decodeURIComponent(w)));
3164
+ const l = new RegExp(`(?<!["'=])(https?:\\/\\/maps\\.google\\.com\\/\\?q=([^\\s"&]+))(?!["'])`, "gi");
3165
+ e = e.replace(l, (b, h, w) => U(decodeURIComponent(w)));
3130
3166
  const d = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/search\/([^\/\?"]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3131
- e = e.replace(d, (m, g, b) => N(decodeURIComponent(b.replace(/\+/g, " "))));
3167
+ e = e.replace(d, (b, h, w) => U(decodeURIComponent(w.replace(/\+/g, " "))));
3132
3168
  const p = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/search\\/([^\\/\\?\\s]+))(?!["'])`, "gi");
3133
- e = e.replace(p, (m, g, b) => N(decodeURIComponent(b.replace(/\+/g, " "))));
3134
- const u = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/search\/\?[^"]*query=([^"&]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3135
- e = e.replace(u, (m, g, b) => N(decodeURIComponent(b.replace(/\+/g, " "))));
3136
- const f = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/search\\/\\?[^\\s"]*query=([^\\s"&]+))(?!["'])`, "gi");
3137
- e = e.replace(f, (m, g, b) => N(decodeURIComponent(b.replace(/\+/g, " "))));
3138
- const w = /<a[^>]*href="(https?:\/\/(?:www\.)?openstreetmap\.org\/[^"]*mlat=([0-9.-]+)[^"]*mlon=([0-9.-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3139
- e = e.replace(w, (m, g, b, v) => {
3140
- const y = g.match(/#map=(\d+)/), $ = y ? y[1] : 15;
3141
- return $t(b, v, $);
3169
+ e = e.replace(p, (b, h, w) => U(decodeURIComponent(w.replace(/\+/g, " "))));
3170
+ const m = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/search\/\?[^"]*query=([^"&]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3171
+ e = e.replace(m, (b, h, w) => U(decodeURIComponent(w.replace(/\+/g, " "))));
3172
+ const c = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/search\\/\\?[^\\s"]*query=([^\\s"&]+))(?!["'])`, "gi");
3173
+ e = e.replace(c, (b, h, w) => U(decodeURIComponent(w.replace(/\+/g, " "))));
3174
+ const g = /<a[^>]*href="(https?:\/\/(?:www\.)?openstreetmap\.org\/[^"]*mlat=([0-9.-]+)[^"]*mlon=([0-9.-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3175
+ e = e.replace(g, (b, h, w, v) => {
3176
+ const y = h.match(/#map=(\d+)/), $ = y ? y[1] : 15;
3177
+ return At(w, v, $);
3142
3178
  });
3143
- const h = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?openstreetmap\\.org\\/[^\\s]*mlat=([0-9.-]+)[^\\s]*mlon=([0-9.-]+))(?!["'])`, "gi");
3144
- e = e.replace(h, (m, g, b, v) => {
3145
- const y = g.match(/#map=(\d+)/), $ = y ? y[1] : 15;
3146
- return $t(b, v, $);
3179
+ const f = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?openstreetmap\\.org\\/[^\\s]*mlat=([0-9.-]+)[^\\s]*mlon=([0-9.-]+))(?!["'])`, "gi");
3180
+ e = e.replace(f, (b, h, w, v) => {
3181
+ const y = h.match(/#map=(\d+)/), $ = y ? y[1] : 15;
3182
+ return At(w, v, $);
3147
3183
  });
3148
- for (let m = t.length - 1; m >= 0; m--)
3149
- e = e.replace(`__PROTECTED_MAP_${m}__`, t[m]);
3184
+ for (let b = t.length - 1; b >= 0; b--)
3185
+ e = e.replace(`__PROTECTED_MAP_${b}__`, t[b]);
3150
3186
  return e;
3151
3187
  }
3152
- function xt(e) {
3188
+ function $t(e) {
3153
3189
  const t = e.match(/pb=([^&]+)/);
3154
3190
  if (t) {
3155
3191
  const r = decodeURIComponent(t[1]), a = r.match(/!3d(-?[\d.]+).*?!2d(-?[\d.]+)/), s = r.match(/!2d(-?[\d.]+).*?!3d(-?[\d.]+)/);
3156
3192
  let n, o;
3157
3193
  if (a ? (n = a[1], o = a[2]) : s && (o = s[1], n = s[2]), n && o) {
3158
3194
  const i = r.match(/!1d([\d.]+)/);
3159
- let l = 15;
3195
+ let u = 15;
3160
3196
  if (i) {
3161
- const c = parseFloat(i[1]);
3162
- c > 1e4 ? l = 10 : c > 5e3 ? l = 12 : c > 1e3 ? l = 14 : c > 500 ? l = 16 : l = 18;
3197
+ const l = parseFloat(i[1]);
3198
+ l > 1e4 ? u = 10 : l > 5e3 ? u = 12 : l > 1e3 ? u = 14 : l > 500 ? u = 16 : u = 18;
3163
3199
  }
3164
- return De(n, o, l);
3200
+ return Be(n, o, u);
3165
3201
  }
3166
3202
  }
3167
3203
  return `
@@ -3177,7 +3213,7 @@ function xt(e) {
3177
3213
  </div>
3178
3214
  `;
3179
3215
  }
3180
- function N(e) {
3216
+ function U(e) {
3181
3217
  const t = encodeURIComponent(e);
3182
3218
  return `
3183
3219
  <div class="artifactuse-map-wrapper">
@@ -3202,7 +3238,7 @@ function N(e) {
3202
3238
  </div>
3203
3239
  `;
3204
3240
  }
3205
- function De(e, t, r) {
3241
+ function Be(e, t, r) {
3206
3242
  return `
3207
3243
  <div class="artifactuse-map-wrapper">
3208
3244
  <iframe
@@ -3221,7 +3257,7 @@ function De(e, t, r) {
3221
3257
  </div>
3222
3258
  `;
3223
3259
  }
3224
- function $t(e, t, r = 15) {
3260
+ function At(e, t, r = 15) {
3225
3261
  return `
3226
3262
  <div class="artifactuse-map-wrapper">
3227
3263
  <iframe
@@ -3237,41 +3273,41 @@ function $t(e, t, r = 15) {
3237
3273
  </div>
3238
3274
  `;
3239
3275
  }
3240
- function gs(e, t = {}) {
3276
+ function ms(e, t = {}) {
3241
3277
  const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/(?:www\.)?(?:twitter\.com|x\.com)\/([a-zA-Z0-9_]+)\/status\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3242
- e = e.replace(a, (v, y, $, A) => At($, A, r));
3278
+ e = e.replace(a, (v, y, $, A) => Rt($, A, r));
3243
3279
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?(?:twitter\\.com|x\\.com)\\/([a-zA-Z0-9_]+)\\/status\\/(\\d+))(?!["'])`, "gi");
3244
- e = e.replace(s, (v, y, $, A) => At($, A, r));
3280
+ e = e.replace(s, (v, y, $, A) => Rt($, A, r));
3245
3281
  const n = /<a[^>]*href="(https?:\/\/(?:www\.)?instagram\.com\/p\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3246
- e = e.replace(n, (v, y, $) => Rt($));
3282
+ e = e.replace(n, (v, y, $) => St($));
3247
3283
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?instagram\\.com\\/p\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3248
- e = e.replace(o, (v, y, $) => Rt($));
3284
+ e = e.replace(o, (v, y, $) => St($));
3249
3285
  const i = /<a[^>]*href="(https?:\/\/(?:www\.)?instagram\.com\/reel\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3250
- e = e.replace(i, (v, y, $) => St($));
3251
- const l = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?instagram\\.com\\/reel\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3252
- e = e.replace(l, (v, y, $) => St($));
3253
- const c = /<a[^>]*href="(https?:\/\/(?:www\.)?tiktok\.com\/@([a-zA-Z0-9_.]+)\/video\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3254
- e = e.replace(c, (v, y, $, A) => zt(A));
3286
+ e = e.replace(i, (v, y, $) => zt($));
3287
+ const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?instagram\\.com\\/reel\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3288
+ e = e.replace(u, (v, y, $) => zt($));
3289
+ const l = /<a[^>]*href="(https?:\/\/(?:www\.)?tiktok\.com\/@([a-zA-Z0-9_.]+)\/video\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3290
+ e = e.replace(l, (v, y, $, A) => Ct(A));
3255
3291
  const d = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?tiktok\\.com\\/@([a-zA-Z0-9_.]+)\\/video\\/(\\d+))(?!["'])`, "gi");
3256
- e = e.replace(d, (v, y, $, A) => zt(A));
3292
+ e = e.replace(d, (v, y, $, A) => Ct(A));
3257
3293
  const p = /<a[^>]*href="(https?:\/\/(?:www\.)?linkedin\.com\/(?:posts|feed\/update)\/([a-zA-Z0-9_:-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3258
- e = e.replace(p, (v, y, $) => Ct($, y));
3259
- const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?linkedin\\.com\\/(?:posts|feed\\/update)\\/([a-zA-Z0-9_:-]+))(?!["'])`, "gi");
3260
- e = e.replace(u, (v, y, $) => Ct($, y));
3261
- const f = /<a[^>]*href="(https?:\/\/(?:www\.)?reddit\.com\/r\/([a-zA-Z0-9_]+)\/comments\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3262
- e = e.replace(f, (v, y, $, A) => Lt($, A, y));
3263
- const w = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?reddit\\.com\\/r\\/([a-zA-Z0-9_]+)\\/comments\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
3264
- e = e.replace(w, (v, y, $, A) => Lt($, A, y));
3265
- const h = /<a[^>]*href="(https?:\/\/(?:www\.)?facebook\.com\/[a-zA-Z0-9.]+\/posts\/\d+[^"]*)"[^>]*>[^<]*<\/a>/gi;
3266
- e = e.replace(h, (v, y) => Mt(y));
3267
- const m = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?facebook\\.com\\/[a-zA-Z0-9.]+\\/posts\\/\\d+)(?!["'])`, "gi");
3268
- e = e.replace(m, (v, y) => Mt(y));
3269
- const g = /<a[^>]*href="(https?:\/\/(?:www\.)?pinterest\.com\/pin\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3270
- e = e.replace(g, (v, y, $) => _t($));
3271
- const b = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?pinterest\\.com\\/pin\\/(\\d+))(?!["'])`, "gi");
3272
- return e = e.replace(b, (v, y, $) => _t($)), e;
3273
- }
3274
- function At(e, t, r = "dark") {
3294
+ e = e.replace(p, (v, y, $) => Lt($, y));
3295
+ const m = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?linkedin\\.com\\/(?:posts|feed\\/update)\\/([a-zA-Z0-9_:-]+))(?!["'])`, "gi");
3296
+ e = e.replace(m, (v, y, $) => Lt($, y));
3297
+ const c = /<a[^>]*href="(https?:\/\/(?:www\.)?reddit\.com\/r\/([a-zA-Z0-9_]+)\/comments\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3298
+ e = e.replace(c, (v, y, $, A) => Mt($, A, y));
3299
+ const g = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?reddit\\.com\\/r\\/([a-zA-Z0-9_]+)\\/comments\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
3300
+ e = e.replace(g, (v, y, $, A) => Mt($, A, y));
3301
+ const f = /<a[^>]*href="(https?:\/\/(?:www\.)?facebook\.com\/[a-zA-Z0-9.]+\/posts\/\d+[^"]*)"[^>]*>[^<]*<\/a>/gi;
3302
+ e = e.replace(f, (v, y) => _t(y));
3303
+ const b = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?facebook\\.com\\/[a-zA-Z0-9.]+\\/posts\\/\\d+)(?!["'])`, "gi");
3304
+ e = e.replace(b, (v, y) => _t(y));
3305
+ const h = /<a[^>]*href="(https?:\/\/(?:www\.)?pinterest\.com\/pin\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3306
+ e = e.replace(h, (v, y, $) => Et($));
3307
+ const w = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?pinterest\\.com\\/pin\\/(\\d+))(?!["'])`, "gi");
3308
+ return e = e.replace(w, (v, y, $) => Et($)), e;
3309
+ }
3310
+ function Rt(e, t, r = "dark") {
3275
3311
  return `
3276
3312
  <div class="artifactuse-twitter-wrapper">
3277
3313
  <blockquote class="twitter-tweet" data-dnt="true" data-theme="${r}">
@@ -3281,7 +3317,7 @@ function At(e, t, r = "dark") {
3281
3317
  </div>
3282
3318
  `;
3283
3319
  }
3284
- function Rt(e) {
3320
+ function St(e) {
3285
3321
  return `
3286
3322
  <div class="artifactuse-instagram-wrapper">
3287
3323
  <iframe
@@ -3295,7 +3331,7 @@ function Rt(e) {
3295
3331
  </div>
3296
3332
  `;
3297
3333
  }
3298
- function St(e) {
3334
+ function zt(e) {
3299
3335
  return `
3300
3336
  <div class="artifactuse-instagram-wrapper">
3301
3337
  <iframe
@@ -3309,7 +3345,7 @@ function St(e) {
3309
3345
  </div>
3310
3346
  `;
3311
3347
  }
3312
- function zt(e) {
3348
+ function Ct(e) {
3313
3349
  return `
3314
3350
  <div class="artifactuse-tiktok-wrapper">
3315
3351
  <iframe
@@ -3322,7 +3358,7 @@ function zt(e) {
3322
3358
  </div>
3323
3359
  `;
3324
3360
  }
3325
- function Ct(e, t) {
3361
+ function Lt(e, t) {
3326
3362
  return `
3327
3363
  <div class="artifactuse-linkedin-wrapper">
3328
3364
  <iframe
@@ -3338,7 +3374,7 @@ function Ct(e, t) {
3338
3374
  </div>
3339
3375
  `;
3340
3376
  }
3341
- function Lt(e, t, r) {
3377
+ function Mt(e, t, r) {
3342
3378
  return `
3343
3379
  <div class="artifactuse-reddit-wrapper">
3344
3380
  <iframe
@@ -3353,7 +3389,7 @@ function Lt(e, t, r) {
3353
3389
  </div>
3354
3390
  `;
3355
3391
  }
3356
- function Mt(e) {
3392
+ function _t(e) {
3357
3393
  return `
3358
3394
  <div class="artifactuse-facebook-wrapper">
3359
3395
  <iframe
@@ -3371,7 +3407,7 @@ function Mt(e) {
3371
3407
  </div>
3372
3408
  `;
3373
3409
  }
3374
- function _t(e) {
3410
+ function Et(e) {
3375
3411
  return `
3376
3412
  <div class="artifactuse-pinterest-wrapper">
3377
3413
  <a data-pin-do="embedPin" data-pin-width="large" href="https://www.pinterest.com/pin/${e}/"></a>
@@ -3379,13 +3415,13 @@ function _t(e) {
3379
3415
  </div>
3380
3416
  `;
3381
3417
  }
3382
- function ms(e) {
3418
+ function bs(e) {
3383
3419
  const t = /<a[^>]*href="(https?:\/\/[^"]+\.pdf(?:\?[^"]*)?)"[^>]*>[^<]*<\/a>/gi;
3384
- e = e.replace(t, (a, s) => Et(s));
3420
+ e = e.replace(t, (a, s) => Tt(s));
3385
3421
  const r = new RegExp(`(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.pdf(?:\\?[^\\s<>"]*)?)(?!["'])`, "gi");
3386
- return e = e.replace(r, (a, s) => Et(s)), e;
3422
+ return e = e.replace(r, (a, s) => Tt(s)), e;
3387
3423
  }
3388
- function Et(e) {
3424
+ function Tt(e) {
3389
3425
  return `
3390
3426
  <div class="artifactuse-pdf-wrapper">
3391
3427
  <div class="artifactuse-pdf-header">
@@ -3409,25 +3445,25 @@ function Et(e) {
3409
3445
  </div>
3410
3446
  `;
3411
3447
  }
3412
- function bs(e) {
3448
+ function ws(e) {
3413
3449
  const t = /<a[^>]*href="(https?:\/\/docs\.google\.com\/document\/d\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3414
- e = e.replace(t, (c, d, p) => ee(p, "document"));
3450
+ e = e.replace(t, (l, d, p) => te(p, "document"));
3415
3451
  const r = new RegExp(`(?<!["'=])(https?:\\/\\/docs\\.google\\.com\\/document\\/d\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3416
- e = e.replace(r, (c, d, p) => ee(p, "document"));
3452
+ e = e.replace(r, (l, d, p) => te(p, "document"));
3417
3453
  const a = /<a[^>]*href="(https?:\/\/docs\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3418
- e = e.replace(a, (c, d, p) => ee(p, "spreadsheets"));
3454
+ e = e.replace(a, (l, d, p) => te(p, "spreadsheets"));
3419
3455
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/docs\\.google\\.com\\/spreadsheets\\/d\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3420
- e = e.replace(s, (c, d, p) => ee(p, "spreadsheets"));
3456
+ e = e.replace(s, (l, d, p) => te(p, "spreadsheets"));
3421
3457
  const n = /<a[^>]*href="(https?:\/\/docs\.google\.com\/presentation\/d\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3422
- e = e.replace(n, (c, d, p) => ee(p, "presentation"));
3458
+ e = e.replace(n, (l, d, p) => te(p, "presentation"));
3423
3459
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/docs\\.google\\.com\\/presentation\\/d\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3424
- e = e.replace(o, (c, d, p) => ee(p, "presentation"));
3460
+ e = e.replace(o, (l, d, p) => te(p, "presentation"));
3425
3461
  const i = /<a[^>]*href="(https?:\/\/docs\.google\.com\/forms\/d\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3426
- e = e.replace(i, (c, d, p) => Tt(p));
3427
- const l = new RegExp(`(?<!["'=])(https?:\\/\\/docs\\.google\\.com\\/forms\\/d\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3428
- return e = e.replace(l, (c, d, p) => Tt(p)), e;
3462
+ e = e.replace(i, (l, d, p) => Pt(p));
3463
+ const u = new RegExp(`(?<!["'=])(https?:\\/\\/docs\\.google\\.com\\/forms\\/d\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3464
+ return e = e.replace(u, (l, d, p) => Pt(p)), e;
3429
3465
  }
3430
- function ee(e, t) {
3466
+ function te(e, t) {
3431
3467
  const r = {
3432
3468
  document: "Google Doc",
3433
3469
  spreadsheets: "Google Sheet",
@@ -3458,7 +3494,7 @@ function ee(e, t) {
3458
3494
  </div>
3459
3495
  `;
3460
3496
  }
3461
- function Tt(e) {
3497
+ function Pt(e) {
3462
3498
  return `
3463
3499
  <div class="artifactuse-google-form-wrapper">
3464
3500
  <iframe
@@ -3469,13 +3505,13 @@ function Tt(e) {
3469
3505
  </div>
3470
3506
  `;
3471
3507
  }
3472
- function ws(e) {
3508
+ function ys(e) {
3473
3509
  const t = /<a[^>]*href="(https?:\/\/[^"]+\.(docx?|xlsx?|pptx?)(?:\?[^"]*)?)"[^>]*>[^<]*<\/a>/gi;
3474
- e = e.replace(t, (a, s) => Pt(s));
3510
+ e = e.replace(t, (a, s) => jt(s));
3475
3511
  const r = new RegExp(`(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.(docx?|xlsx?|pptx?)(?:\\?[^\\s<>"]*)?)(?!["'])`, "gi");
3476
- return e = e.replace(r, (a, s) => Pt(s)), e;
3512
+ return e = e.replace(r, (a, s) => jt(s)), e;
3477
3513
  }
3478
- function Pt(e) {
3514
+ function jt(e) {
3479
3515
  const t = encodeURIComponent(e), r = e.split("/").pop().split("?")[0], a = r.split(".").pop().toLowerCase();
3480
3516
  return `
3481
3517
  <div class="artifactuse-office-wrapper">
@@ -3501,43 +3537,43 @@ function Pt(e) {
3501
3537
  </div>
3502
3538
  `;
3503
3539
  }
3504
- function ys(e) {
3540
+ function vs(e) {
3505
3541
  return `${e}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
3506
3542
  }
3507
- function vs(e, t = {}) {
3543
+ function ks(e, t = {}) {
3508
3544
  const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/gist\.github\.com\/([a-zA-Z0-9_-]+)\/([a-f0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3509
- e = e.replace(a, (h, m, g, b) => It(g, b));
3545
+ e = e.replace(a, (f, b, h, w) => It(h, w));
3510
3546
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/gist\\.github\\.com\\/([a-zA-Z0-9_-]+)\\/([a-f0-9]+))(?!["'])`, "gi");
3511
- e = e.replace(s, (h, m, g, b) => It(g, b));
3547
+ e = e.replace(s, (f, b, h, w) => It(h, w));
3512
3548
  const n = /<a[^>]*href="(https?:\/\/codepen\.io\/([a-zA-Z0-9_-]+)\/(?:pen|full|details)\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3513
- e = e.replace(n, (h, m, g, b) => jt(g, b, r));
3549
+ e = e.replace(n, (f, b, h, w) => qt(h, w, r));
3514
3550
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/codepen\\.io\\/([a-zA-Z0-9_-]+)\\/(?:pen|full|details)\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
3515
- e = e.replace(o, (h, m, g, b) => jt(g, b, r));
3551
+ e = e.replace(o, (f, b, h, w) => qt(h, w, r));
3516
3552
  const i = /<a[^>]*href="(https?:\/\/codesandbox\.io\/(?:s|embed)\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3517
- e = e.replace(i, (h, m, g) => Zt(g, r));
3518
- const l = new RegExp(`(?<!["'=])(https?:\\/\\/codesandbox\\.io\\/(?:s|embed)\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
3519
- e = e.replace(l, (h, m, g) => Zt(g, r));
3520
- const c = /<a[^>]*href="(https?:\/\/jsfiddle\.net\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3521
- e = e.replace(c, (h, m, g, b) => qt(g, b, r));
3553
+ e = e.replace(i, (f, b, h) => Ht(h, r));
3554
+ const u = new RegExp(`(?<!["'=])(https?:\\/\\/codesandbox\\.io\\/(?:s|embed)\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
3555
+ e = e.replace(u, (f, b, h) => Ht(h, r));
3556
+ const l = /<a[^>]*href="(https?:\/\/jsfiddle\.net\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3557
+ e = e.replace(l, (f, b, h, w) => Zt(h, w, r));
3522
3558
  const d = new RegExp(`(?<!["'=])(https?:\\/\\/jsfiddle\\.net\\/([a-zA-Z0-9_]+)\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
3523
- e = e.replace(d, (h, m, g, b) => qt(g, b, r));
3559
+ e = e.replace(d, (f, b, h, w) => Zt(h, w, r));
3524
3560
  const p = /<a[^>]*href="(https?:\/\/stackblitz\.com\/(?:edit|embed)\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3525
- e = e.replace(p, (h, m, g) => Ht(g, r));
3526
- const u = new RegExp(`(?<!["'=])(https?:\\/\\/stackblitz\\.com\\/(?:edit|embed)\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
3527
- e = e.replace(u, (h, m, g) => Ht(g, r));
3528
- const f = /<a[^>]*href="(https?:\/\/replit\.com\/@([a-zA-Z0-9_]+)\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3529
- e = e.replace(f, (h, m, g, b) => Dt(g, b, r));
3530
- const w = new RegExp(`(?<!["'=])(https?:\\/\\/replit\\.com\\/@([a-zA-Z0-9_]+)\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3531
- return e = e.replace(w, (h, m, g, b) => Dt(g, b, r)), e;
3561
+ e = e.replace(p, (f, b, h) => Dt(h, r));
3562
+ const m = new RegExp(`(?<!["'=])(https?:\\/\\/stackblitz\\.com\\/(?:edit|embed)\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
3563
+ e = e.replace(m, (f, b, h) => Dt(h, r));
3564
+ const c = /<a[^>]*href="(https?:\/\/replit\.com\/@([a-zA-Z0-9_]+)\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3565
+ e = e.replace(c, (f, b, h, w) => Bt(h, w, r));
3566
+ const g = new RegExp(`(?<!["'=])(https?:\\/\\/replit\\.com\\/@([a-zA-Z0-9_]+)\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3567
+ return e = e.replace(g, (f, b, h, w) => Bt(h, w, r)), e;
3532
3568
  }
3533
3569
  function It(e, t) {
3534
3570
  return `
3535
- <div class="artifactuse-gist-wrapper" id="${ys("gist")}">
3571
+ <div class="artifactuse-gist-wrapper" id="${vs("gist")}">
3536
3572
  <script src="https://gist.github.com/${e}/${t}.js"><\/script>
3537
3573
  </div>
3538
3574
  `;
3539
3575
  }
3540
- function jt(e, t, r = "dark") {
3576
+ function qt(e, t, r = "dark") {
3541
3577
  return `
3542
3578
  <div class="artifactuse-codepen-wrapper">
3543
3579
  <iframe
@@ -3554,7 +3590,7 @@ function jt(e, t, r = "dark") {
3554
3590
  </div>
3555
3591
  `;
3556
3592
  }
3557
- function Zt(e, t = "dark") {
3593
+ function Ht(e, t = "dark") {
3558
3594
  return `
3559
3595
  <div class="artifactuse-codesandbox-wrapper">
3560
3596
  <iframe
@@ -3568,7 +3604,7 @@ function Zt(e, t = "dark") {
3568
3604
  </div>
3569
3605
  `;
3570
3606
  }
3571
- function qt(e, t, r = "dark") {
3607
+ function Zt(e, t, r = "dark") {
3572
3608
  return `
3573
3609
  <div class="artifactuse-jsfiddle-wrapper">
3574
3610
  <iframe
@@ -3583,7 +3619,7 @@ function qt(e, t, r = "dark") {
3583
3619
  </div>
3584
3620
  `;
3585
3621
  }
3586
- function Ht(e, t = "dark") {
3622
+ function Dt(e, t = "dark") {
3587
3623
  return `
3588
3624
  <div class="artifactuse-stackblitz-wrapper">
3589
3625
  <iframe
@@ -3595,7 +3631,7 @@ function Ht(e, t = "dark") {
3595
3631
  </div>
3596
3632
  `;
3597
3633
  }
3598
- function Dt(e, t, r = "dark") {
3634
+ function Bt(e, t, r = "dark") {
3599
3635
  return `
3600
3636
  <div class="artifactuse-replit-wrapper">
3601
3637
  <iframe
@@ -3607,23 +3643,23 @@ function Dt(e, t, r = "dark") {
3607
3643
  </div>
3608
3644
  `;
3609
3645
  }
3610
- function ks(e) {
3646
+ function xs(e) {
3611
3647
  const t = /<a[^>]*href="(https?:\/\/public\.tableau\.com\/(?:views|profile)\/([^\s"]+))"[^>]*>[^<]*<\/a>/gi;
3612
- e = e.replace(t, (c, d, p) => Ot(p));
3648
+ e = e.replace(t, (l, d, p) => Ot(p));
3613
3649
  const r = new RegExp(`(?<!["'=])(https?:\\/\\/public\\.tableau\\.com\\/(?:views|profile)\\/([^\\s<>"]+))(?!["'])`, "gi");
3614
- e = e.replace(r, (c, d, p) => Ot(p));
3650
+ e = e.replace(r, (l, d, p) => Ot(p));
3615
3651
  const a = /<a[^>]*href="(https?:\/\/(?:public\.)?flourish\.studio\/visualisation\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3616
- e = e.replace(a, (c, d, p) => Bt(p));
3652
+ e = e.replace(a, (l, d, p) => Ft(p));
3617
3653
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/(?:public\\.)?flourish\\.studio\\/visualisation\\/(\\d+))(?!["'])`, "gi");
3618
- e = e.replace(s, (c, d, p) => Bt(p));
3654
+ e = e.replace(s, (l, d, p) => Ft(p));
3619
3655
  const n = /<a[^>]*href="(https?:\/\/datawrapper\.dwcdn\.net\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3620
- e = e.replace(n, (c, d, p) => Ft(p));
3656
+ e = e.replace(n, (l, d, p) => Vt(p));
3621
3657
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/datawrapper\\.dwcdn\\.net\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
3622
- e = e.replace(o, (c, d, p) => Ft(p));
3658
+ e = e.replace(o, (l, d, p) => Vt(p));
3623
3659
  const i = /<a[^>]*href="(https?:\/\/(?:e\.)?infogram\.com\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3624
- e = e.replace(i, (c, d, p) => Vt(p));
3625
- const l = new RegExp(`(?<!["'=])(https?:\\/\\/(?:e\\.)?infogram\\.com\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3626
- return e = e.replace(l, (c, d, p) => Vt(p)), e;
3660
+ e = e.replace(i, (l, d, p) => Nt(p));
3661
+ const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:e\\.)?infogram\\.com\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3662
+ return e = e.replace(u, (l, d, p) => Nt(p)), e;
3627
3663
  }
3628
3664
  function Ot(e) {
3629
3665
  return `
@@ -3637,7 +3673,7 @@ function Ot(e) {
3637
3673
  </div>
3638
3674
  `;
3639
3675
  }
3640
- function Bt(e) {
3676
+ function Ft(e) {
3641
3677
  return `
3642
3678
  <div class="artifactuse-flourish-wrapper">
3643
3679
  <iframe
@@ -3649,7 +3685,7 @@ function Bt(e) {
3649
3685
  </div>
3650
3686
  `;
3651
3687
  }
3652
- function Ft(e) {
3688
+ function Vt(e) {
3653
3689
  return `
3654
3690
  <div class="artifactuse-datawrapper-wrapper">
3655
3691
  <iframe
@@ -3661,7 +3697,7 @@ function Ft(e) {
3661
3697
  </div>
3662
3698
  `;
3663
3699
  }
3664
- function Vt(e) {
3700
+ function Nt(e) {
3665
3701
  return `
3666
3702
  <div class="artifactuse-infogram-wrapper">
3667
3703
  <iframe
@@ -3674,33 +3710,33 @@ function Vt(e) {
3674
3710
  </div>
3675
3711
  `;
3676
3712
  }
3677
- function xs(e, t = {}) {
3713
+ function $s(e, t = {}) {
3678
3714
  const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/sketchfab\.com\/(?:3d-)?models\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3679
- e = e.replace(a, (h, m, g) => Nt(g, r));
3715
+ e = e.replace(a, (f, b, h) => Ut(h, r));
3680
3716
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/sketchfab\\.com\\/(?:3d-)?models\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
3681
- e = e.replace(s, (h, m, g) => Nt(g, r));
3717
+ e = e.replace(s, (f, b, h) => Ut(h, r));
3682
3718
  const n = /<a[^>]*href="(https?:\/\/(?:www\.)?figma\.com\/(?:file|design)\/([a-zA-Z0-9]+)(?:\/[^?\s"]*)?(?:\?node-id=([^&\s"]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
3683
- e = e.replace(n, (h, m, g, b) => Ut(g, b));
3719
+ e = e.replace(n, (f, b, h, w) => Gt(h, w));
3684
3720
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?figma\\.com\\/(?:file|design)\\/([a-zA-Z0-9]+)(?:\\/[^?\\s]*)?(?:\\?node-id=([^&\\s]+))?)(?!["'])`, "gi");
3685
- e = e.replace(o, (h, m, g, b) => Ut(g, b));
3721
+ e = e.replace(o, (f, b, h, w) => Gt(h, w));
3686
3722
  const i = /<a[^>]*href="(https?:\/\/(?:www\.)?figma\.com\/proto\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3687
- e = e.replace(i, (h, m, g) => Gt(g, m));
3688
- const l = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?figma\\.com\\/proto\\/([a-zA-Z0-9]+)[^\\s]*)(?!["'])`, "gi");
3689
- e = e.replace(l, (h, m, g) => Gt(g, m));
3690
- const c = /<a[^>]*href="(https?:\/\/(?:www\.)?canva\.com\/design\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3691
- e = e.replace(c, (h, m, g) => Wt(g, m));
3723
+ e = e.replace(i, (f, b, h) => Wt(h, b));
3724
+ const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?figma\\.com\\/proto\\/([a-zA-Z0-9]+)[^\\s]*)(?!["'])`, "gi");
3725
+ e = e.replace(u, (f, b, h) => Wt(h, b));
3726
+ const l = /<a[^>]*href="(https?:\/\/(?:www\.)?canva\.com\/design\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3727
+ e = e.replace(l, (f, b, h) => Xt(h, b));
3692
3728
  const d = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?canva\\.com\\/design\\/([a-zA-Z0-9_-]+)[^\\s]*)(?!["'])`, "gi");
3693
- e = e.replace(d, (h, m, g) => Wt(g, m));
3729
+ e = e.replace(d, (f, b, h) => Xt(h, b));
3694
3730
  const p = /<a[^>]*href="(https?:\/\/dribbble\.com\/shots\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3695
- e = e.replace(p, (h, m, g) => Xt(g));
3696
- const u = new RegExp(`(?<!["'=])(https?:\\/\\/dribbble\\.com\\/shots\\/(\\d+))(?!["'])`, "gi");
3697
- e = e.replace(u, (h, m, g) => Xt(g));
3698
- const f = /<a[^>]*href="(https?:\/\/(?:www\.)?behance\.net\/gallery\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3699
- e = e.replace(f, (h, m, g) => Kt(g, m));
3700
- const w = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?behance\\.net\\/gallery\\/(\\d+)[^\\s]*)(?!["'])`, "gi");
3701
- return e = e.replace(w, (h, m, g) => Kt(g, m)), e;
3702
- }
3703
- function Nt(e, t = "dark") {
3731
+ e = e.replace(p, (f, b, h) => Kt(h));
3732
+ const m = new RegExp(`(?<!["'=])(https?:\\/\\/dribbble\\.com\\/shots\\/(\\d+))(?!["'])`, "gi");
3733
+ e = e.replace(m, (f, b, h) => Kt(h));
3734
+ const c = /<a[^>]*href="(https?:\/\/(?:www\.)?behance\.net\/gallery\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3735
+ e = e.replace(c, (f, b, h) => Jt(h, b));
3736
+ const g = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?behance\\.net\\/gallery\\/(\\d+)[^\\s]*)(?!["'])`, "gi");
3737
+ return e = e.replace(g, (f, b, h) => Jt(h, b)), e;
3738
+ }
3739
+ function Ut(e, t = "dark") {
3704
3740
  return `
3705
3741
  <div class="artifactuse-sketchfab-wrapper">
3706
3742
  <iframe
@@ -3715,7 +3751,7 @@ function Nt(e, t = "dark") {
3715
3751
  </div>
3716
3752
  `;
3717
3753
  }
3718
- function Ut(e, t) {
3754
+ function Gt(e, t) {
3719
3755
  const r = t ? `&node-id=${t}` : "";
3720
3756
  return `
3721
3757
  <div class="artifactuse-figma-wrapper">
@@ -3728,7 +3764,7 @@ function Ut(e, t) {
3728
3764
  </div>
3729
3765
  `;
3730
3766
  }
3731
- function Gt(e, t) {
3767
+ function Wt(e, t) {
3732
3768
  return `
3733
3769
  <div class="artifactuse-figma-wrapper">
3734
3770
  <iframe
@@ -3740,7 +3776,7 @@ function Gt(e, t) {
3740
3776
  </div>
3741
3777
  `;
3742
3778
  }
3743
- function Wt(e, t) {
3779
+ function Xt(e, t) {
3744
3780
  return `
3745
3781
  <div class="artifactuse-canva-wrapper">
3746
3782
  <div class="artifactuse-canva-preview">
@@ -3757,7 +3793,7 @@ function Wt(e, t) {
3757
3793
  </div>
3758
3794
  `;
3759
3795
  }
3760
- function Xt(e) {
3796
+ function Kt(e) {
3761
3797
  return `
3762
3798
  <div class="artifactuse-dribbble-wrapper">
3763
3799
  <iframe
@@ -3769,7 +3805,7 @@ function Xt(e) {
3769
3805
  </div>
3770
3806
  `;
3771
3807
  }
3772
- function Kt(e, t) {
3808
+ function Jt(e, t) {
3773
3809
  return `
3774
3810
  <div class="artifactuse-behance-wrapper">
3775
3811
  <iframe
@@ -3784,35 +3820,35 @@ function Kt(e, t) {
3784
3820
  </div>
3785
3821
  `;
3786
3822
  }
3787
- function $s(e, t = {}) {
3823
+ function As(e, t = {}) {
3788
3824
  const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/(?:[a-zA-Z0-9-]+\.)?typeform\.com\/to\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3789
- e = e.replace(a, (g, b, v) => Qt(v));
3825
+ e = e.replace(a, (h, w, v) => Qt(v));
3790
3826
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/(?:[a-zA-Z0-9-]+\\.)?typeform\\.com\\/to\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
3791
- e = e.replace(s, (g, b, v) => Qt(v));
3827
+ e = e.replace(s, (h, w, v) => Qt(v));
3792
3828
  const n = /<a[^>]*href="(https?:\/\/calendly\.com\/([a-zA-Z0-9_-]+)(?:\/([a-zA-Z0-9_-]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
3793
- e = e.replace(n, (g, b, v, y) => Jt(v, y));
3829
+ e = e.replace(n, (h, w, v, y) => Yt(v, y));
3794
3830
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/calendly\\.com\\/([a-zA-Z0-9_-]+)(?:\\/([a-zA-Z0-9_-]+))?)(?!["'])`, "gi");
3795
- e = e.replace(o, (g, b, v, y) => Jt(v, y));
3831
+ e = e.replace(o, (h, w, v, y) => Yt(v, y));
3796
3832
  const i = /<a[^>]*href="(https?:\/\/calendar\.google\.com\/calendar\/appointments\/schedules\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3797
- e = e.replace(i, (g, b, v) => Yt(v));
3798
- const l = new RegExp(`(?<!["'=])(https?:\\/\\/calendar\\.google\\.com\\/calendar\\/appointments\\/schedules\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3799
- e = e.replace(l, (g, b, v) => Yt(v));
3800
- const c = /<a[^>]*href="(https?:\/\/cal\.com\/([a-zA-Z0-9_-]+)(?:\/([a-zA-Z0-9_-]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
3801
- e = e.replace(c, (g, b, v, y) => er(v, y, r));
3833
+ e = e.replace(i, (h, w, v) => er(v));
3834
+ const u = new RegExp(`(?<!["'=])(https?:\\/\\/calendar\\.google\\.com\\/calendar\\/appointments\\/schedules\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3835
+ e = e.replace(u, (h, w, v) => er(v));
3836
+ const l = /<a[^>]*href="(https?:\/\/cal\.com\/([a-zA-Z0-9_-]+)(?:\/([a-zA-Z0-9_-]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
3837
+ e = e.replace(l, (h, w, v, y) => tr(v, y, r));
3802
3838
  const d = new RegExp(`(?<!["'=])(https?:\\/\\/cal\\.com\\/([a-zA-Z0-9_-]+)(?:\\/([a-zA-Z0-9_-]+))?)(?!["'])`, "gi");
3803
- e = e.replace(d, (g, b, v, y) => er(v, y, r));
3839
+ e = e.replace(d, (h, w, v, y) => tr(v, y, r));
3804
3840
  const p = /<a[^>]*href="(https?:\/\/(?:www\.)?notion\.so\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3805
- e = e.replace(p, (g, b, v) => tr(v));
3806
- const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?notion\\.so\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
3807
- e = e.replace(u, (g, b, v) => tr(v));
3808
- const f = /<a[^>]*href="(https?:\/\/airtable\.com\/(?:embed\/)?([a-zA-Z0-9]+)(?:\/([a-zA-Z0-9]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
3809
- e = e.replace(f, (g, b, v, y) => rr(v, y));
3810
- const w = new RegExp(`(?<!["'=])(https?:\\/\\/airtable\\.com\\/(?:embed\\/)?([a-zA-Z0-9]+)(?:\\/([a-zA-Z0-9]+))?)(?!["'])`, "gi");
3811
- e = e.replace(w, (g, b, v, y) => rr(v, y));
3812
- const h = /<a[^>]*href="(https?:\/\/miro\.com\/app\/board\/([a-zA-Z0-9_=-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3813
- e = e.replace(h, (g, b, v) => ar(v));
3814
- const m = new RegExp(`(?<!["'=])(https?:\\/\\/miro\\.com\\/app\\/board\\/([a-zA-Z0-9_=-]+))(?!["'])`, "gi");
3815
- return e = e.replace(m, (g, b, v) => ar(v)), e;
3841
+ e = e.replace(p, (h, w, v) => rr(v));
3842
+ const m = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?notion\\.so\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
3843
+ e = e.replace(m, (h, w, v) => rr(v));
3844
+ const c = /<a[^>]*href="(https?:\/\/airtable\.com\/(?:embed\/)?([a-zA-Z0-9]+)(?:\/([a-zA-Z0-9]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
3845
+ e = e.replace(c, (h, w, v, y) => ar(v, y));
3846
+ const g = new RegExp(`(?<!["'=])(https?:\\/\\/airtable\\.com\\/(?:embed\\/)?([a-zA-Z0-9]+)(?:\\/([a-zA-Z0-9]+))?)(?!["'])`, "gi");
3847
+ e = e.replace(g, (h, w, v, y) => ar(v, y));
3848
+ const f = /<a[^>]*href="(https?:\/\/miro\.com\/app\/board\/([a-zA-Z0-9_=-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3849
+ e = e.replace(f, (h, w, v) => sr(v));
3850
+ const b = new RegExp(`(?<!["'=])(https?:\\/\\/miro\\.com\\/app\\/board\\/([a-zA-Z0-9_=-]+))(?!["'])`, "gi");
3851
+ return e = e.replace(b, (h, w, v) => sr(v)), e;
3816
3852
  }
3817
3853
  function Qt(e) {
3818
3854
  return `
@@ -3825,7 +3861,7 @@ function Qt(e) {
3825
3861
  </div>
3826
3862
  `;
3827
3863
  }
3828
- function Jt(e, t = "") {
3864
+ function Yt(e, t = "") {
3829
3865
  return `
3830
3866
  <div class="artifactuse-calendly-wrapper">
3831
3867
  <iframe
@@ -3836,7 +3872,7 @@ function Jt(e, t = "") {
3836
3872
  </div>
3837
3873
  `;
3838
3874
  }
3839
- function Yt(e) {
3875
+ function er(e) {
3840
3876
  return `
3841
3877
  <div class="artifactuse-google-calendar-wrapper">
3842
3878
  <iframe
@@ -3847,7 +3883,7 @@ function Yt(e) {
3847
3883
  </div>
3848
3884
  `;
3849
3885
  }
3850
- function er(e, t = "", r = "dark") {
3886
+ function tr(e, t = "", r = "dark") {
3851
3887
  return `
3852
3888
  <div class="artifactuse-calcom-wrapper">
3853
3889
  <iframe
@@ -3858,7 +3894,7 @@ function er(e, t = "", r = "dark") {
3858
3894
  </div>
3859
3895
  `;
3860
3896
  }
3861
- function tr(e) {
3897
+ function rr(e) {
3862
3898
  return `
3863
3899
  <div class="artifactuse-notion-wrapper">
3864
3900
  <iframe
@@ -3870,7 +3906,7 @@ function tr(e) {
3870
3906
  </div>
3871
3907
  `;
3872
3908
  }
3873
- function rr(e, t) {
3909
+ function ar(e, t) {
3874
3910
  return `
3875
3911
  <div class="artifactuse-airtable-wrapper">
3876
3912
  <iframe
@@ -3881,7 +3917,7 @@ function rr(e, t) {
3881
3917
  </div>
3882
3918
  `;
3883
3919
  }
3884
- function ar(e) {
3920
+ function sr(e) {
3885
3921
  return `
3886
3922
  <div class="artifactuse-miro-wrapper">
3887
3923
  <iframe
@@ -3893,37 +3929,37 @@ function ar(e) {
3893
3929
  </div>
3894
3930
  `;
3895
3931
  }
3896
- let G = null, ke = !1, Ye = !1;
3897
- function $r(e) {
3932
+ let W = null, xe = !1, et = !1;
3933
+ function Ar(e) {
3898
3934
  const t = /<pre><code class="language-mermaid">([\s\S]*?)<\/code><\/pre>/gi;
3899
3935
  return e = e.replace(t, (r, a) => {
3900
- const s = As(a).trim();
3901
- return Rs(s);
3936
+ const s = Rs(a).trim();
3937
+ return Ss(s);
3902
3938
  }), e;
3903
3939
  }
3904
- function As(e) {
3940
+ function Rs(e) {
3905
3941
  return e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&nbsp;/g, " ");
3906
3942
  }
3907
- function Rs(e) {
3908
- const t = Ar(e);
3943
+ function Ss(e) {
3944
+ const t = Rr(e);
3909
3945
  return `
3910
3946
  <div class="artifactuse-mermaid-container" data-mermaid-id="${`mermaid-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`}" data-mermaid-diagram="${t}">
3911
3947
  <div class="artifactuse-mermaid-loading">Loading diagram...</div>
3912
3948
  </div>
3913
3949
  `;
3914
3950
  }
3915
- function Ar(e) {
3951
+ function Rr(e) {
3916
3952
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
3917
3953
  }
3918
- function Rr(e) {
3954
+ function Sr(e) {
3919
3955
  return e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&");
3920
3956
  }
3921
- function Sr(e = {}) {
3922
- return typeof mermaid > "u" ? ke ? (console.warn("Mermaid loading previously failed. Diagram rendering disabled."), Promise.resolve()) : (console.debug("Mermaid library not loaded. Attempting to load..."), zs().then(() => (console.log("Mermaid loaded, rendering diagrams..."), sr(e), xe())).catch((t) => {
3923
- console.error("Failed to load Mermaid library:", t), ke = !0, Ss();
3924
- })) : (Ye || sr(e), xe());
3957
+ function zr(e = {}) {
3958
+ return typeof mermaid > "u" ? xe ? (console.warn("Mermaid loading previously failed. Diagram rendering disabled."), Promise.resolve()) : (console.debug("Mermaid library not loaded. Attempting to load..."), Cs().then(() => (console.log("Mermaid loaded, rendering diagrams..."), nr(e), $e())).catch((t) => {
3959
+ console.error("Failed to load Mermaid library:", t), xe = !0, zs();
3960
+ })) : (et || nr(e), $e());
3925
3961
  }
3926
- function sr(e = {}) {
3962
+ function nr(e = {}) {
3927
3963
  if (typeof mermaid > "u") return;
3928
3964
  const r = {
3929
3965
  dark: "dark",
@@ -3951,9 +3987,9 @@ function sr(e = {}) {
3951
3987
  theme: r
3952
3988
  // Ensure theme is not overridden by spread
3953
3989
  };
3954
- mermaid.initialize(a), Ye = !0;
3990
+ mermaid.initialize(a), et = !0;
3955
3991
  }
3956
- async function xe() {
3992
+ async function $e() {
3957
3993
  if (typeof mermaid > "u") {
3958
3994
  console.warn("renderAllMermaid called but Mermaid is not available");
3959
3995
  return;
@@ -3961,7 +3997,7 @@ async function xe() {
3961
3997
  const e = document.querySelectorAll(".artifactuse-mermaid-container");
3962
3998
  for (const t of e) {
3963
3999
  if (t.dataset.rendered === "true") continue;
3964
- const r = Rr(t.dataset.mermaidDiagram), a = t.dataset.mermaidId;
4000
+ const r = Sr(t.dataset.mermaidDiagram), a = t.dataset.mermaidId;
3965
4001
  try {
3966
4002
  if (await mermaid.parse(r)) {
3967
4003
  const { svg: n } = await mermaid.render(a, r);
@@ -3981,10 +4017,10 @@ async function xe() {
3981
4017
  }
3982
4018
  }
3983
4019
  }
3984
- function Ss() {
4020
+ function zs() {
3985
4021
  document.querySelectorAll(".artifactuse-mermaid-container").forEach((e) => {
3986
4022
  if (e.dataset.rendered === "true") return;
3987
- const t = Rr(e.dataset.mermaidDiagram);
4023
+ const t = Sr(e.dataset.mermaidDiagram);
3988
4024
  e.innerHTML = `
3989
4025
  <div class="artifactuse-mermaid-fallback">
3990
4026
  <div class="artifactuse-mermaid-fallback-title">Mermaid Diagram</div>
@@ -3996,53 +4032,53 @@ function Ss() {
3996
4032
  function Oe(e) {
3997
4033
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
3998
4034
  }
3999
- function zs() {
4000
- return G || (typeof mermaid < "u" ? Promise.resolve() : (G = new Promise((e, t) => {
4035
+ function Cs() {
4036
+ return W || (typeof mermaid < "u" ? Promise.resolve() : (W = new Promise((e, t) => {
4001
4037
  const r = setTimeout(() => {
4002
- G = null, t(new Error("Mermaid loading timed out after 15 seconds"));
4038
+ W = null, t(new Error("Mermaid loading timed out after 15 seconds"));
4003
4039
  }, 15e3), a = document.createElement("script");
4004
4040
  a.src = "https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js", a.crossOrigin = "anonymous", a.onload = () => {
4005
4041
  clearTimeout(r), console.log("Mermaid script loaded successfully"), e();
4006
4042
  }, a.onerror = (s) => {
4007
- clearTimeout(r), G = null, console.error("Mermaid script failed to load:", s), t(new Error("Failed to load Mermaid script from CDN"));
4043
+ clearTimeout(r), W = null, console.error("Mermaid script failed to load:", s), t(new Error("Failed to load Mermaid script from CDN"));
4008
4044
  }, document.head.appendChild(a);
4009
- }), G));
4010
- }
4011
- function Js() {
4012
- G = null, ke = !1, Ye = !1;
4045
+ }), W));
4013
4046
  }
4014
4047
  function Ys() {
4015
- return typeof mermaid < "u";
4048
+ W = null, xe = !1, et = !1;
4016
4049
  }
4017
4050
  function en() {
4018
- return ke;
4051
+ return typeof mermaid < "u";
4019
4052
  }
4020
- function tn(e, t = {}) {
4053
+ function tn() {
4054
+ return xe;
4055
+ }
4056
+ function rn(e, t = {}) {
4021
4057
  if (!e) return Promise.resolve();
4022
4058
  let r = e.innerHTML;
4023
- return r = $r(r), e.innerHTML = r, Sr(t);
4059
+ return r = Ar(r), e.innerHTML = r, zr(t);
4024
4060
  }
4025
- async function rn(e) {
4061
+ async function an(e) {
4026
4062
  const t = document.querySelector(`[data-mermaid-id="${e}"]`);
4027
- t && (t.dataset.rendered = "false", t.innerHTML = '<div class="artifactuse-mermaid-loading">Loading diagram...</div>', await xe());
4063
+ t && (t.dataset.rendered = "false", t.innerHTML = '<div class="artifactuse-mermaid-loading">Loading diagram...</div>', await $e());
4028
4064
  }
4029
- async function an(e, t) {
4065
+ async function sn(e, t) {
4030
4066
  const r = document.querySelector(`[data-mermaid-id="${e}"]`);
4031
- r && (r.dataset.mermaidDiagram = Ar(t), r.dataset.rendered = "false", r.innerHTML = '<div class="artifactuse-mermaid-loading">Loading diagram...</div>', await xe());
4067
+ r && (r.dataset.mermaidDiagram = Rr(t), r.dataset.rendered = "false", r.innerHTML = '<div class="artifactuse-mermaid-loading">Loading diagram...</div>', await $e());
4032
4068
  }
4033
- function Cs(e) {
4069
+ function Ls(e) {
4034
4070
  const t = /<table([^>]*)>([\s\S]*?)<\/table>/gi;
4035
4071
  let r = 0;
4036
4072
  return e = e.replace(t, (a, s, n) => {
4037
4073
  const o = `artifactuse-table-${r++}`;
4038
- return Ls(o, s, n);
4074
+ return Ms(o, s, n);
4039
4075
  }), e;
4040
4076
  }
4041
- function Ls(e, t, r) {
4077
+ function Ms(e, t, r) {
4042
4078
  const a = /<thead/i.test(r) || /<th/i.test(r), s = (r.match(/<tr/gi) || []).length;
4043
4079
  if (!a || s < 3)
4044
4080
  return `<table${t} class="artifactuse-table">${r}</table>`;
4045
- const n = Ms(r);
4081
+ const n = _s(r);
4046
4082
  return `
4047
4083
  <div class="artifactuse-table-container" data-table-id="${e}">
4048
4084
  <div class="artifactuse-table-controls">
@@ -4085,7 +4121,7 @@ function Ls(e, t, r) {
4085
4121
  </div>
4086
4122
  `;
4087
4123
  }
4088
- function Ms(e) {
4124
+ function _s(e) {
4089
4125
  let t = 0;
4090
4126
  return e = e.replace(/<th(\s[^>]*)?>([\s\S]*?)<\/th>/gi, (r, a, s) => {
4091
4127
  const n = t++;
@@ -4104,7 +4140,7 @@ function Ms(e) {
4104
4140
  `;
4105
4141
  }), e;
4106
4142
  }
4107
- function _s(e) {
4143
+ function Es(e) {
4108
4144
  const t = e.querySelectorAll("tr"), r = [];
4109
4145
  return t.forEach((a) => {
4110
4146
  const s = a.querySelectorAll("th, td"), n = [];
@@ -4116,11 +4152,11 @@ function _s(e) {
4116
4152
  }), r.join(`
4117
4153
  `);
4118
4154
  }
4119
- function Es(e, t = "table-data.csv") {
4155
+ function Ts(e, t = "table-data.csv") {
4120
4156
  const r = new Blob([e], { type: "text/csv;charset=utf-8;" }), a = URL.createObjectURL(r), s = document.createElement("a");
4121
4157
  s.href = a, s.download = t, document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(a);
4122
4158
  }
4123
- function Ts(e) {
4159
+ function Ps(e) {
4124
4160
  const t = e.querySelectorAll("tr"), r = [];
4125
4161
  return t.forEach((a) => {
4126
4162
  const s = a.querySelectorAll("th, td"), n = [];
@@ -4130,17 +4166,17 @@ function Ts(e) {
4130
4166
  }), r.join(`
4131
4167
  `);
4132
4168
  }
4133
- function Ps(e, t, r = !0) {
4169
+ function js(e, t, r = !0) {
4134
4170
  const a = e.querySelector("tbody") || e, s = Array.from(a.querySelectorAll("tr")).filter((n) => !n.querySelector("th"));
4135
4171
  s.sort((n, o) => {
4136
- const i = n.cells[t], l = o.cells[t];
4137
- if (!i || !l) return 0;
4138
- let c = i.textContent.trim(), d = l.textContent.trim();
4139
- const p = parseFloat(c.replace(/[,$%]/g, "")), u = parseFloat(d.replace(/[,$%]/g, ""));
4140
- if (!isNaN(p) && !isNaN(u))
4141
- return r ? p - u : u - p;
4142
- const f = new Date(c), w = new Date(d);
4143
- return !isNaN(f.getTime()) && !isNaN(w.getTime()) ? r ? f - w : w - f : r ? c.localeCompare(d) : d.localeCompare(c);
4172
+ const i = n.cells[t], u = o.cells[t];
4173
+ if (!i || !u) return 0;
4174
+ let l = i.textContent.trim(), d = u.textContent.trim();
4175
+ const p = parseFloat(l.replace(/[,$%]/g, "")), m = parseFloat(d.replace(/[,$%]/g, ""));
4176
+ if (!isNaN(p) && !isNaN(m))
4177
+ return r ? p - m : m - p;
4178
+ const c = new Date(l), g = new Date(d);
4179
+ return !isNaN(c.getTime()) && !isNaN(g.getTime()) ? r ? c - g : g - c : r ? l.localeCompare(d) : d.localeCompare(l);
4144
4180
  }), s.forEach((n) => a.appendChild(n));
4145
4181
  }
4146
4182
  function Is(e, t) {
@@ -4155,7 +4191,7 @@ function Is(e, t) {
4155
4191
  n.style.display = i ? "" : "none", i && s++;
4156
4192
  }), s;
4157
4193
  }
4158
- function js() {
4194
+ function qs() {
4159
4195
  document.querySelectorAll("[data-table-search]").forEach((e) => {
4160
4196
  const t = e.dataset.tableSearch, r = document.getElementById(t), a = document.querySelector(`[data-table-count="${t}"]`);
4161
4197
  if (r) {
@@ -4170,21 +4206,21 @@ function js() {
4170
4206
  const t = e.closest("table"), r = parseInt(e.dataset.sortCol), s = e.dataset.sortDir !== "asc";
4171
4207
  t.querySelectorAll(".artifactuse-sortable-header").forEach((n) => {
4172
4208
  n.dataset.sortDir = "", n.classList.remove("sort-asc", "sort-desc");
4173
- }), e.dataset.sortDir = s ? "asc" : "desc", e.classList.add(s ? "sort-asc" : "sort-desc"), Ps(t, r, s);
4209
+ }), e.dataset.sortDir = s ? "asc" : "desc", e.classList.add(s ? "sort-asc" : "sort-desc"), js(t, r, s);
4174
4210
  });
4175
4211
  }), document.querySelectorAll("[data-table-export]").forEach((e) => {
4176
4212
  e.addEventListener("click", () => {
4177
4213
  const t = e.dataset.tableExport, r = document.getElementById(t);
4178
4214
  if (r) {
4179
- const a = _s(r);
4180
- Es(a, `${t}.csv`);
4215
+ const a = Es(r);
4216
+ Ts(a, `${t}.csv`);
4181
4217
  }
4182
4218
  });
4183
4219
  }), document.querySelectorAll("[data-table-copy]").forEach((e) => {
4184
4220
  e.addEventListener("click", async () => {
4185
4221
  const t = e.dataset.tableCopy, r = document.getElementById(t);
4186
4222
  if (r) {
4187
- const a = Ts(r);
4223
+ const a = Ps(r);
4188
4224
  try {
4189
4225
  await navigator.clipboard.writeText(a);
4190
4226
  const s = e.querySelector("span"), n = s ? s.textContent : "";
@@ -4198,52 +4234,52 @@ function js() {
4198
4234
  });
4199
4235
  });
4200
4236
  }
4201
- let W = null, $e = !1;
4202
- function zr(e) {
4203
- return e = Zs(e), e = e.replace(/\$\$([\s\S]*?)\$\$/g, (t, r) => ce(r.trim(), !0)), e = e.replace(/\\\[([\s\S]*?)\\\]/g, (t, r) => ce(r.trim(), !0)), e = e.replace(new RegExp("(?<!\\$)\\$(?!\\$)((?:[^$\\\\]|\\\\.)+?)\\$(?!\\$)", "g"), (t, r) => ce(r.trim(), !1)), e = e.replace(/\\\(([\s\S]*?)\\\)/g, (t, r) => ce(r.trim(), !1)), e;
4237
+ let X = null, Ae = !1;
4238
+ function Cr(e) {
4239
+ return e = Hs(e), e = e.replace(/\$\$([\s\S]*?)\$\$/g, (t, r) => le(r.trim(), !0)), e = e.replace(/\\\[([\s\S]*?)\\\]/g, (t, r) => le(r.trim(), !0)), e = e.replace(new RegExp("(?<!\\$)\\$(?!\\$)((?:[^$\\\\]|\\\\.)+?)\\$(?!\\$)", "g"), (t, r) => le(r.trim(), !1)), e = e.replace(/\\\(([\s\S]*?)\\\)/g, (t, r) => le(r.trim(), !1)), e;
4204
4240
  }
4205
- function Zs(e) {
4241
+ function Hs(e) {
4206
4242
  const t = /<pre><code class="language-(math|latex)">([\s\S]*?)<\/code><\/pre>/gi;
4207
4243
  return e = e.replace(t, (r, a, s) => {
4208
- const n = qs(s).trim();
4209
- return ce(n, !0);
4244
+ const n = Zs(s).trim();
4245
+ return le(n, !0);
4210
4246
  }), e;
4211
4247
  }
4212
- function qs(e) {
4248
+ function Zs(e) {
4213
4249
  return e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&nbsp;/g, " ");
4214
4250
  }
4215
- function ce(e, t = !1) {
4216
- const r = Hs(e);
4251
+ function le(e, t = !1) {
4252
+ const r = Ds(e);
4217
4253
  return `<span class="artifactuse-math-container ${t ? "artifactuse-math-display" : "artifactuse-math-inline"}" data-tex="${r}" data-display="${t ? "true" : "false"}"></span>`;
4218
4254
  }
4219
- function Hs(e) {
4255
+ function Ds(e) {
4220
4256
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
4221
4257
  }
4222
- function Cr(e) {
4258
+ function Lr(e) {
4223
4259
  return e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&");
4224
4260
  }
4225
- function Lr() {
4226
- return typeof katex > "u" ? $e ? (console.warn("KaTeX loading previously failed. Math rendering disabled."), Promise.resolve()) : (console.debug("KaTeX library not loaded. Attempting to load..."), Os().then(() => {
4227
- console.log("KaTeX loaded, rendering math..."), nr();
4261
+ function Mr() {
4262
+ return typeof katex > "u" ? Ae ? (console.warn("KaTeX loading previously failed. Math rendering disabled."), Promise.resolve()) : (console.debug("KaTeX library not loaded. Attempting to load..."), Os().then(() => {
4263
+ console.log("KaTeX loaded, rendering math..."), ir();
4228
4264
  }).catch((e) => {
4229
- console.error("Failed to load KaTeX library:", e), $e = !0, Ds();
4230
- })) : (nr(), Promise.resolve());
4265
+ console.error("Failed to load KaTeX library:", e), Ae = !0, Bs();
4266
+ })) : (ir(), Promise.resolve());
4231
4267
  }
4232
- function Ds() {
4268
+ function Bs() {
4233
4269
  document.querySelectorAll(".artifactuse-math-container").forEach((e) => {
4234
4270
  if (e.dataset.rendered === "true") return;
4235
- const t = Cr(e.dataset.tex);
4236
- e.innerHTML = `<code class="artifactuse-math-fallback" title="Math rendering unavailable">${Be(t)}</code>`, e.dataset.rendered = "true", e.classList.add("artifactuse-math-fallback-container");
4271
+ const t = Lr(e.dataset.tex);
4272
+ e.innerHTML = `<code class="artifactuse-math-fallback" title="Math rendering unavailable">${Fe(t)}</code>`, e.dataset.rendered = "true", e.classList.add("artifactuse-math-fallback-container");
4237
4273
  });
4238
4274
  }
4239
- function nr() {
4275
+ function ir() {
4240
4276
  if (typeof katex > "u") {
4241
4277
  console.warn("renderAllMath called but KaTeX is not available");
4242
4278
  return;
4243
4279
  }
4244
4280
  document.querySelectorAll(".artifactuse-math-container").forEach((e) => {
4245
4281
  if (e.dataset.rendered === "true") return;
4246
- const t = Cr(e.dataset.tex), r = e.dataset.display === "true";
4282
+ const t = Lr(e.dataset.tex), r = e.dataset.display === "true";
4247
4283
  try {
4248
4284
  katex.render(t, e, {
4249
4285
  displayMode: r,
@@ -4264,17 +4300,17 @@ function nr() {
4264
4300
  }
4265
4301
  }), e.dataset.rendered = "true";
4266
4302
  } catch (a) {
4267
- console.error("KaTeX rendering error:", a), e.innerHTML = `<span class="artifactuse-math-error" title="${Be(a.message)}">${Be(t)}</span>`, e.dataset.rendered = "true";
4303
+ console.error("KaTeX rendering error:", a), e.innerHTML = `<span class="artifactuse-math-error" title="${Fe(a.message)}">${Fe(t)}</span>`, e.dataset.rendered = "true";
4268
4304
  }
4269
4305
  });
4270
4306
  }
4271
- function Be(e) {
4307
+ function Fe(e) {
4272
4308
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
4273
4309
  }
4274
4310
  function Os() {
4275
- return W || (typeof katex < "u" ? Promise.resolve() : (W = new Promise((e, t) => {
4311
+ return X || (typeof katex < "u" ? Promise.resolve() : (X = new Promise((e, t) => {
4276
4312
  const r = setTimeout(() => {
4277
- W = null, t(new Error("KaTeX loading timed out after 10 seconds"));
4313
+ X = null, t(new Error("KaTeX loading timed out after 10 seconds"));
4278
4314
  }, 1e4), a = document.createElement("link");
4279
4315
  a.rel = "stylesheet", a.href = "https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css", a.crossOrigin = "anonymous", a.onerror = () => {
4280
4316
  console.warn("KaTeX CSS failed to load, math may not render correctly");
@@ -4283,25 +4319,25 @@ function Os() {
4283
4319
  s.src = "https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js", s.crossOrigin = "anonymous", s.onload = () => {
4284
4320
  clearTimeout(r), console.log("KaTeX script loaded successfully"), e();
4285
4321
  }, s.onerror = (n) => {
4286
- clearTimeout(r), W = null, console.error("KaTeX script failed to load:", n), t(new Error("Failed to load KaTeX script from CDN"));
4322
+ clearTimeout(r), X = null, console.error("KaTeX script failed to load:", n), t(new Error("Failed to load KaTeX script from CDN"));
4287
4323
  }, document.head.appendChild(s);
4288
- }), W));
4289
- }
4290
- function sn() {
4291
- W = null, $e = !1;
4324
+ }), X));
4292
4325
  }
4293
4326
  function nn() {
4294
- return typeof katex < "u";
4327
+ X = null, Ae = !1;
4295
4328
  }
4296
4329
  function on() {
4297
- return $e;
4330
+ return typeof katex < "u";
4331
+ }
4332
+ function cn() {
4333
+ return Ae;
4298
4334
  }
4299
- function cn(e) {
4335
+ function ln(e) {
4300
4336
  if (!e) return Promise.resolve();
4301
4337
  let t = e.innerHTML;
4302
- return t = zr(t), e.innerHTML = t, Lr();
4338
+ return t = Cr(t), e.innerHTML = t, Mr();
4303
4339
  }
4304
- const ln = {
4340
+ const un = {
4305
4341
  // Fractions
4306
4342
  fraction: (e, t) => `\\frac{${e}}{${t}}`,
4307
4343
  // Square root
@@ -4334,11 +4370,11 @@ const ln = {
4334
4370
  derivative: (e, t) => `\\frac{d${e}}{d${t}}`,
4335
4371
  partialDerivative: (e, t) => `\\frac{\\partial ${e}}{\\partial ${t}}`
4336
4372
  };
4337
- function pe() {
4373
+ function fe() {
4338
4374
  return typeof window < "u" && window.Prism;
4339
4375
  }
4340
- function Mr(e) {
4341
- if (!pe()) {
4376
+ function _r(e) {
4377
+ if (!fe()) {
4342
4378
  console.warn("Artifactuse: Prism.js not found. Install and include Prism.js for syntax highlighting.");
4343
4379
  return;
4344
4380
  }
@@ -4346,24 +4382,24 @@ function Mr(e) {
4346
4382
  if (!t) return;
4347
4383
  t.querySelectorAll("pre code").forEach((a) => {
4348
4384
  if (a.classList.contains("prism-highlighted")) return;
4349
- const s = Bs(a);
4385
+ const s = Fs(a);
4350
4386
  s && (a.className.includes(`language-${s}`) || a.classList.add(`language-${s}`), window.Prism.highlightElement(a), a.classList.add("prism-highlighted"));
4351
4387
  });
4352
4388
  }
4353
- function un(e, t) {
4354
- pe() && (t && !e.className.includes(`language-${t}`) && e.classList.add(`language-${t}`), window.Prism.highlightElement(e), e.classList.add("prism-highlighted"));
4355
- }
4356
4389
  function dn(e, t) {
4357
- if (!pe()) return ir(e);
4390
+ fe() && (t && !e.className.includes(`language-${t}`) && e.classList.add(`language-${t}`), window.Prism.highlightElement(e), e.classList.add("prism-highlighted"));
4391
+ }
4392
+ function pn(e, t) {
4393
+ if (!fe()) return or(e);
4358
4394
  const r = window.Prism.languages[t];
4359
- return r ? window.Prism.highlight(e, r, t) : ir(e);
4395
+ return r ? window.Prism.highlight(e, r, t) : or(e);
4360
4396
  }
4361
- function Bs(e) {
4397
+ function Fs(e) {
4362
4398
  const t = e.className.split(/\s+/);
4363
4399
  for (const s of t) {
4364
4400
  const n = s.match(/^(?:language-|lang-)(.+)$/);
4365
4401
  if (n)
4366
- return Me(n[1]);
4402
+ return _e(n[1]);
4367
4403
  }
4368
4404
  const r = e.closest("pre");
4369
4405
  if (r) {
@@ -4371,13 +4407,13 @@ function Bs(e) {
4371
4407
  for (const n of s) {
4372
4408
  const o = n.match(/^(?:language-|lang-)(.+)$/);
4373
4409
  if (o)
4374
- return Me(o[1]);
4410
+ return _e(o[1]);
4375
4411
  }
4376
4412
  }
4377
4413
  const a = e.dataset.language || (r == null ? void 0 : r.dataset.language);
4378
- return a ? Me(a) : null;
4414
+ return a ? _e(a) : null;
4379
4415
  }
4380
- function Me(e) {
4416
+ function _e(e) {
4381
4417
  const t = {
4382
4418
  js: "javascript",
4383
4419
  ts: "typescript",
@@ -4403,11 +4439,11 @@ function Me(e) {
4403
4439
  }, r = e.toLowerCase();
4404
4440
  return t[r] || r;
4405
4441
  }
4406
- function ir(e) {
4442
+ function or(e) {
4407
4443
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
4408
4444
  }
4409
- function pn(e) {
4410
- if (!pe())
4445
+ function fn(e) {
4446
+ if (!fe())
4411
4447
  return console.warn("Artifactuse: Prism.js not found. Auto-highlighting disabled."), null;
4412
4448
  const t = new MutationObserver((r) => {
4413
4449
  let a = !1;
@@ -4419,42 +4455,42 @@ function pn(e) {
4419
4455
  break;
4420
4456
  }
4421
4457
  }
4422
- a && Mr(e);
4458
+ a && _r(e);
4423
4459
  });
4424
4460
  return t.observe(e, {
4425
4461
  childList: !0,
4426
4462
  subtree: !0
4427
4463
  }), t;
4428
4464
  }
4429
- function fn() {
4430
- return pe() ? Object.keys(window.Prism.languages).filter(
4465
+ function hn() {
4466
+ return fe() ? Object.keys(window.Prism.languages).filter(
4431
4467
  (e) => typeof window.Prism.languages[e] == "object"
4432
4468
  ) : [];
4433
4469
  }
4434
- function ge(e) {
4470
+ function me(e) {
4435
4471
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
4436
4472
  }
4437
- function Fs() {
4473
+ function Vs() {
4438
4474
  const e = {
4439
4475
  image(a) {
4440
4476
  const s = typeof a == "string" ? a : a.href, n = typeof a == "string" ? arguments[1] : a.title, o = typeof a == "string" ? arguments[2] : a.text;
4441
- return Pe(s || "", n || "", o || "");
4477
+ return je(s || "", n || "", o || "");
4442
4478
  }
4443
4479
  }, t = {
4444
4480
  link(a) {
4445
4481
  const s = typeof a == "string" ? a : a.href, n = typeof a == "string" ? arguments[1] : a.title, o = typeof a == "string" ? arguments[2] : a.text;
4446
- if (Ka(s))
4447
- return Ja(s);
4448
- const i = n ? ` title="${ge(n)}"` : "";
4449
- return `<a href="${ge(s || "")}" target="_blank" rel="noopener noreferrer"${i}>${o || ""}</a>`;
4482
+ if (Ja(s))
4483
+ return Ya(s);
4484
+ const i = n ? ` title="${me(n)}"` : "";
4485
+ return `<a href="${me(s || "")}" target="_blank" rel="noopener noreferrer"${i}>${o || ""}</a>`;
4450
4486
  }
4451
4487
  }, r = {
4452
4488
  code(a) {
4453
- const s = typeof a == "string" ? a : a.text, o = (typeof a == "string" ? arguments[1] : a.lang) || "", i = ge(s || "");
4454
- return o ? `<pre><code class="language-${ge(o)}">${i}</code></pre>` : `<pre><code>${i}</code></pre>`;
4489
+ const s = typeof a == "string" ? a : a.text, o = (typeof a == "string" ? arguments[1] : a.lang) || "", i = me(s || "");
4490
+ return o ? `<pre><code class="language-${me(o)}">${i}</code></pre>` : `<pre><code>${i}</code></pre>`;
4455
4491
  }
4456
4492
  };
4457
- _.use({
4493
+ M.use({
4458
4494
  renderer: {
4459
4495
  ...e,
4460
4496
  ...t,
@@ -4464,8 +4500,8 @@ function Fs() {
4464
4500
  breaks: !0
4465
4501
  });
4466
4502
  }
4467
- Fs();
4468
- const _r = {
4503
+ Vs();
4504
+ const Er = {
4469
4505
  // Structured artifact types
4470
4506
  form: "form-panel",
4471
4507
  // Visual editors
@@ -4500,7 +4536,7 @@ const _r = {
4500
4536
  md: "html-panel",
4501
4537
  // Diagrams
4502
4538
  mermaid: "mermaid-panel"
4503
- }, Vs = {
4539
+ }, Ns = {
4504
4540
  // CDN URL for panel artifacts (video editor, canvas, etc.)
4505
4541
  cdnUrl: "https://cdn.artifactuse.com",
4506
4542
  // Theme: 'dark' | 'light' | 'auto'
@@ -4570,7 +4606,7 @@ const _r = {
4570
4606
  expiryDays: 30
4571
4607
  }
4572
4608
  };
4573
- function Er(e, t) {
4609
+ function Tr(e, t) {
4574
4610
  if (e == null)
4575
4611
  return null;
4576
4612
  try {
@@ -4585,7 +4621,7 @@ function Er(e, t) {
4585
4621
  }
4586
4622
  return null;
4587
4623
  }
4588
- function Ns(e, t) {
4624
+ function Us(e, t) {
4589
4625
  const r = /* @__PURE__ */ new Set();
4590
4626
  try {
4591
4627
  r.add(new URL(t).origin);
@@ -4593,61 +4629,61 @@ function Ns(e, t) {
4593
4629
  console.warn("Artifactuse: Invalid default CDN URL:", t);
4594
4630
  }
4595
4631
  for (const a of Object.values(e)) {
4596
- const s = Er(a, t);
4632
+ const s = Tr(a, t);
4597
4633
  s && r.add(s);
4598
4634
  }
4599
4635
  return [...r];
4600
4636
  }
4601
- function Us(e, t) {
4602
- const r = { ..._r };
4637
+ function Gs(e, t) {
4638
+ const r = { ...Er };
4603
4639
  if (e.panels)
4604
- for (const [l, c] of Object.entries(e.panels))
4605
- if (Array.isArray(l))
4606
- l.forEach((d) => {
4640
+ for (const [u, l] of Object.entries(e.panels))
4641
+ if (Array.isArray(u))
4642
+ u.forEach((d) => {
4607
4643
  const p = d == null ? void 0 : d.toLowerCase();
4608
- p && (r[p] = c);
4644
+ p && (r[p] = l);
4609
4645
  });
4610
4646
  else {
4611
- const d = l == null ? void 0 : l.toLowerCase();
4612
- d && (r[d] = c);
4647
+ const d = u == null ? void 0 : u.toLowerCase();
4648
+ d && (r[d] = l);
4613
4649
  }
4614
- function a(l, c = {}) {
4615
- const d = l == null ? void 0 : l.toLowerCase();
4650
+ function a(u, l = {}) {
4651
+ const d = u == null ? void 0 : u.toLowerCase();
4616
4652
  if (!d) return null;
4617
4653
  const p = r[d];
4618
4654
  if (p === null || p === void 0) return null;
4619
- let u;
4655
+ let m;
4620
4656
  if (typeof p == "string")
4621
- p.startsWith("http://") || p.startsWith("https://") ? u = p : u = `${e.cdnUrl}/${p}`;
4657
+ p.startsWith("http://") || p.startsWith("https://") ? m = p : m = `${e.cdnUrl}/${p}`;
4622
4658
  else if (typeof p == "object" && p.path)
4623
- u = `${p.cdn || e.cdnUrl}/${p.path}`;
4659
+ m = `${p.cdn || e.cdnUrl}/${p.path}`;
4624
4660
  else
4625
4661
  return null;
4626
- u.endsWith("/") || (u += "");
4627
- const f = new URLSearchParams();
4628
- c.theme && f.set("theme", c.theme), c.accent && f.set("accent", c.accent), c.params && Object.entries(c.params).forEach(([h, m]) => {
4629
- f.set(h, m);
4662
+ m.endsWith("/") || (m += "");
4663
+ const c = new URLSearchParams();
4664
+ l.theme && c.set("theme", l.theme), l.accent && c.set("accent", l.accent), l.params && Object.entries(l.params).forEach(([f, b]) => {
4665
+ c.set(f, b);
4630
4666
  });
4631
- const w = f.toString();
4632
- return w ? `${u}?${w}` : u;
4667
+ const g = c.toString();
4668
+ return g ? `${m}?${g}` : m;
4633
4669
  }
4634
- function s(l) {
4635
- const c = l == null ? void 0 : l.toLowerCase();
4636
- return c && r[c] !== void 0 && r[c] !== null;
4670
+ function s(u) {
4671
+ const l = u == null ? void 0 : u.toLowerCase();
4672
+ return l && r[l] !== void 0 && r[l] !== null;
4637
4673
  }
4638
4674
  function n() {
4639
- return Object.keys(r).filter((l) => r[l] !== null);
4675
+ return Object.keys(r).filter((u) => r[u] !== null);
4640
4676
  }
4641
- function o(l, c) {
4642
- (Array.isArray(l) ? l : [l]).forEach((u) => {
4643
- const f = u == null ? void 0 : u.toLowerCase();
4644
- f && (r[f] = c);
4677
+ function o(u, l) {
4678
+ (Array.isArray(u) ? u : [u]).forEach((m) => {
4679
+ const c = m == null ? void 0 : m.toLowerCase();
4680
+ c && (r[c] = l);
4645
4681
  });
4646
- const p = Er(c, e.cdnUrl);
4682
+ const p = Tr(l, e.cdnUrl);
4647
4683
  p && t && t.addAllowedOrigin(p);
4648
4684
  }
4649
- function i(l) {
4650
- (Array.isArray(l) ? l : [l]).forEach((d) => {
4685
+ function i(u) {
4686
+ (Array.isArray(u) ? u : [u]).forEach((d) => {
4651
4687
  const p = d == null ? void 0 : d.toLowerCase();
4652
4688
  p && (r[p] = null);
4653
4689
  });
@@ -4664,113 +4700,119 @@ function Us(e, t) {
4664
4700
  }
4665
4701
  };
4666
4702
  }
4667
- function hn(e = {}) {
4668
- const t = Tr(Vs, e), r = Qr(), a = { ..._r, ...t.panels }, s = Ns(a, t.cdnUrl), n = Jr(s), o = ta(t.theme, t.colors || {}), i = Us(t, n), l = ca(t.sharing), c = la(t.editor);
4669
- function d(k, M) {
4670
- let x = _.parse(k);
4671
- const j = [], I = { theme: o.resolved };
4703
+ function gn(e = {}) {
4704
+ const t = Pr(Ns, e), r = Qr(), a = { ...Er, ...t.panels }, s = Us(a, t.cdnUrl), n = Yr(s), o = ra(t.theme, t.colors || {}), i = Gs(t, n), u = la(t.sharing), l = ua(t.editor);
4705
+ function d(k, z) {
4706
+ let x = M.parse(k);
4707
+ const j = [], q = { theme: o.resolved };
4672
4708
  if (t.processors.codeBlocks) {
4673
- const P = Kr(x, M, t.codeExtraction);
4674
- x = P.html, j.push(...P.artifacts);
4709
+ const E = Jr(x, z, t.codeExtraction);
4710
+ x = E.html, j.push(...E.artifacts);
4675
4711
  }
4676
- return t.processors.images && (x = Wa(x)), t.processors.imageGalleries && (x = Xa(x)), t.processors.videos && (x = Ya(x)), t.processors.videoGalleries && (x = as(x)), t.processors.audio && (x = is(x, I)), t.processors.maps && (x = hs(x)), t.processors.social && (x = gs(x, I)), t.processors.documents && (x = ms(x), x = bs(x), x = ws(x)), t.processors.codeEmbeds && (x = vs(x, I)), t.processors.dataViz && (x = ks(x)), t.processors.design && (x = xs(x, I)), t.processors.interactive && (x = $s(x, I)), t.processors.tables && (x = Cs(x)), t.processors.math && (x = zr(x)), t.processors.mermaid && (x = $r(x)), j.forEach((P) => {
4677
- r.addArtifact(P);
4712
+ return t.processors.images && (x = Xa(x)), t.processors.imageGalleries && (x = Ka(x)), t.processors.videos && (x = es(x)), t.processors.videoGalleries && (x = ss(x)), t.processors.audio && (x = os(x, q)), t.processors.maps && (x = gs(x)), t.processors.social && (x = ms(x, q)), t.processors.documents && (x = bs(x), x = ws(x), x = ys(x)), t.processors.codeEmbeds && (x = ks(x, q)), t.processors.dataViz && (x = xs(x)), t.processors.design && (x = $s(x, q)), t.processors.interactive && (x = As(x, q)), t.processors.tables && (x = Ls(x)), t.processors.math && (x = Cr(x)), t.processors.mermaid && (x = Ar(x)), j.forEach((E) => {
4713
+ r.addArtifact(E);
4678
4714
  }), {
4679
4715
  html: x,
4680
4716
  artifacts: j
4681
4717
  };
4682
4718
  }
4683
4719
  async function p(k = document) {
4684
- const M = [], x = { theme: o.resolved };
4685
- t.processors.math && M.push(Lr()), t.processors.mermaid && M.push(Sr(x)), t.processors.tables && js(), t.processors.audio && cs(k), t.syntaxHighlight && Mr(k), await Promise.all(M);
4720
+ const z = [], x = { theme: o.resolved };
4721
+ t.processors.math && z.push(Mr()), t.processors.mermaid && z.push(zr(x)), t.processors.tables && qs(), t.processors.audio && ls(k), t.syntaxHighlight && _r(k), await Promise.all(z);
4686
4722
  }
4687
- function u(k) {
4723
+ function m(k) {
4688
4724
  if (k.isInline) {
4689
4725
  console.warn("Attempted to open inline artifact in panel:", k.id);
4690
4726
  return;
4691
4727
  }
4692
- r.setActiveArtifact(k.id), r.setPanelOpen(!0), z("artifact:opened", k);
4728
+ r.setActiveArtifact(k.id), r.setPanelOpen(!0), _("artifact:opened", k);
4693
4729
  }
4694
- function f(k, M, x = {}) {
4695
- const j = k.split(".").pop(), I = x.language || Fr(j) || j, P = x.title || k;
4696
- return w(M, I, { ...x, title: P });
4730
+ function c(k, z, x = {}) {
4731
+ const j = k.split(".").pop(), q = x.language || Vr(j) || j, E = x.title || k;
4732
+ return g(z, q, { ...x, title: E });
4697
4733
  }
4698
- function w(k, M, x = {}) {
4699
- const j = x.messageId || Dr("open"), I = y({ type: M, language: M }) ? M : "txt", P = be(k, I, j, 0);
4700
- return P.title = x.title || P.title, P.isInline = !1, x.tabs && (P.tabs = x.tabs), x.panelUrl && (P.panelUrl = x.panelUrl), r.addArtifact(P), u(P), x.viewMode ? r.setViewMode(x.viewMode) : x.tabs && r.setViewMode(x.tabs[0]), P;
4734
+ function g(k, z, x = {}) {
4735
+ const j = x.messageId || Br("open"), q = $({ type: z, language: z }) ? z : "txt", E = we(k, q, j, 0);
4736
+ return E.title = x.title || E.title, E.isInline = !1, E.editorLanguage = z, x.tabs && (E.tabs = x.tabs), x.panelUrl && (E.panelUrl = x.panelUrl), r.addArtifact(E), m(E), x.viewMode ? r.setViewMode(x.viewMode) : x.tabs && r.setViewMode(x.tabs[0]), E;
4701
4737
  }
4702
- function h() {
4703
- r.setPanelOpen(!1), r.setFullscreen(!1), z("panel:closed");
4738
+ function f(k, z, x = {}) {
4739
+ const j = typeof k == "string" ? k : k == null ? void 0 : k.id, q = r.getArtifact(j);
4740
+ if (!q) return null;
4741
+ const E = { ...q, code: z, _refreshToken: Date.now() };
4742
+ return x.title !== void 0 && (E.title = x.title), x.tabs !== void 0 && (E.tabs = x.tabs), x.panelUrl !== void 0 && (E.panelUrl = x.panelUrl), r.addArtifact(E), _("artifact:updated", { artifactId: j, artifact: r.getArtifact(j) }), r.getArtifact(j);
4704
4743
  }
4705
- function m() {
4744
+ function b() {
4745
+ r.setPanelOpen(!1), r.setFullscreen(!1), _("panel:closed");
4746
+ }
4747
+ function h() {
4706
4748
  const k = !r.getState().isPanelOpen;
4707
- r.clearActiveArtifact(), r.setPanelOpen(k), k || r.setFullscreen(!1), z("panel:toggled", { isOpen: k });
4749
+ r.clearActiveArtifact(), r.setPanelOpen(k), k || r.setFullscreen(!1), _("panel:toggled", { isOpen: k });
4708
4750
  }
4709
- function g() {
4751
+ function w() {
4710
4752
  const k = !r.getState().isFullscreen;
4711
- r.setFullscreen(k), z("fullscreen:toggled", { isFullscreen: k });
4753
+ r.setFullscreen(k), _("fullscreen:toggled", { isFullscreen: k });
4712
4754
  }
4713
- function b(k) {
4714
- r.setViewMode(k), z("viewMode:changed", { mode: k });
4755
+ function v(k) {
4756
+ r.setViewMode(k), _("viewMode:changed", { mode: k });
4715
4757
  }
4716
- function v(k, M = {}) {
4758
+ function y(k, z = {}) {
4717
4759
  if (!k) return null;
4718
4760
  if (k.panelUrl) return k.panelUrl;
4719
- const { type: x, language: j } = k, I = {
4720
- theme: M.theme || o.resolved
4721
- }, P = o.colors;
4722
- P != null && P.primary && (I.accent = P.primary);
4723
- let Y = i.resolve(x, I);
4724
- return !Y && j && (Y = i.resolve(j, I)), Y;
4725
- }
4726
- function y(k) {
4761
+ const { type: x, language: j } = k, q = {
4762
+ theme: z.theme || o.resolved
4763
+ }, E = o.colors;
4764
+ E != null && E.primary && (q.accent = E.primary);
4765
+ let ee = i.resolve(x, q);
4766
+ return !ee && j && (ee = i.resolve(j, q)), ee;
4767
+ }
4768
+ function $(k) {
4727
4769
  return k ? i.has(k.type) || i.has(k.language) : !1;
4728
4770
  }
4729
- function $(k, M) {
4730
- i.register(k, M);
4771
+ function A(k, z) {
4772
+ i.register(k, z);
4731
4773
  }
4732
- function A(k) {
4774
+ function S(k) {
4733
4775
  i.unregister(k);
4734
4776
  }
4735
- function S() {
4777
+ function C() {
4736
4778
  return i.getTypes();
4737
4779
  }
4738
- function C(k, M) {
4739
- n.send(k, M);
4780
+ function V(k, z) {
4781
+ n.send(k, z);
4740
4782
  }
4741
- const q = /* @__PURE__ */ new Map();
4742
- function R(k, M) {
4743
- return q.has(k) || q.set(k, /* @__PURE__ */ new Set()), q.get(k).add(M), () => {
4783
+ const R = /* @__PURE__ */ new Map();
4784
+ function P(k, z) {
4785
+ return R.has(k) || R.set(k, /* @__PURE__ */ new Set()), R.get(k).add(z), () => {
4744
4786
  var x;
4745
- (x = q.get(k)) == null || x.delete(M);
4787
+ (x = R.get(k)) == null || x.delete(z);
4746
4788
  };
4747
4789
  }
4748
- function T(k, M) {
4790
+ function I(k, z) {
4749
4791
  var x;
4750
- (x = q.get(k)) == null || x.delete(M);
4792
+ (x = R.get(k)) == null || x.delete(z);
4751
4793
  }
4752
- function z(k, M) {
4794
+ function _(k, z) {
4753
4795
  var x;
4754
- (x = q.get(k)) == null || x.forEach((j) => {
4796
+ (x = R.get(k)) == null || x.forEach((j) => {
4755
4797
  try {
4756
- j(M);
4757
- } catch (I) {
4758
- console.error(`Artifactuse event handler error (${k}):`, I);
4798
+ j(z);
4799
+ } catch (q) {
4800
+ console.error(`Artifactuse event handler error (${k}):`, q);
4759
4801
  }
4760
4802
  });
4761
4803
  }
4762
- n.on("ai:request", (k) => z("ai:request", k)), n.on("save:request", (k) => z("save:request", k)), n.on("export:complete", (k) => z("export:complete", k)), n.on("form:submit", (k) => z("form:submit", k)), n.on("form:cancel", (k) => z("form:cancel", k)), n.on("form:step", (k) => z("form:step", k)), n.on("social:copy", (k) => z("social:copy", k));
4804
+ n.on("ai:request", (k) => _("ai:request", k)), n.on("save:request", (k) => _("save:request", k)), n.on("export:complete", (k) => _("export:complete", k)), n.on("form:submit", (k) => _("form:submit", k)), n.on("form:cancel", (k) => _("form:cancel", k)), n.on("form:step", (k) => _("form:step", k)), n.on("social:copy", (k) => _("social:copy", k));
4763
4805
  function Z() {
4764
4806
  o.apply();
4765
4807
  }
4766
- function D(k) {
4808
+ function G(k) {
4767
4809
  o.set(k);
4768
4810
  }
4769
- function U() {
4811
+ function Y() {
4770
4812
  return o.resolved;
4771
4813
  }
4772
- function J() {
4773
- n.destroy(), q.clear(), r.clear(), fs();
4814
+ function F() {
4815
+ n.destroy(), R.clear(), r.clear(), hs();
4774
4816
  }
4775
4817
  return {
4776
4818
  // Config
@@ -4783,42 +4825,43 @@ function hn(e = {}) {
4783
4825
  processMessage: d,
4784
4826
  initializeContent: p,
4785
4827
  // Panel control
4786
- openArtifact: u,
4787
- openFile: f,
4788
- openCode: w,
4789
- closePanel: h,
4790
- togglePanel: m,
4791
- toggleFullscreen: g,
4792
- setViewMode: b,
4793
- getPanelUrl: v,
4794
- sendToPanel: C,
4828
+ openArtifact: m,
4829
+ openFile: c,
4830
+ openCode: g,
4831
+ updateFile: f,
4832
+ closePanel: b,
4833
+ togglePanel: h,
4834
+ toggleFullscreen: w,
4835
+ setViewMode: v,
4836
+ getPanelUrl: y,
4837
+ sendToPanel: V,
4795
4838
  // Panel management (new)
4796
- hasPanel: y,
4797
- registerPanel: $,
4798
- unregisterPanel: A,
4799
- getPanelTypes: S,
4839
+ hasPanel: $,
4840
+ registerPanel: A,
4841
+ unregisterPanel: S,
4842
+ getPanelTypes: C,
4800
4843
  panelResolver: i,
4801
4844
  // Expose for advanced use
4802
4845
  // Theme
4803
4846
  theme: o,
4804
4847
  applyTheme: Z,
4805
- setTheme: D,
4806
- getTheme: U,
4848
+ setTheme: G,
4849
+ getTheme: Y,
4807
4850
  // Events
4808
- on: R,
4809
- off: T,
4810
- emit: z,
4851
+ on: P,
4852
+ off: I,
4853
+ emit: _,
4811
4854
  // Editor (CodeMirror integration)
4812
- editor: c,
4855
+ editor: l,
4813
4856
  // Bridge (for advanced use)
4814
4857
  bridge: n,
4815
4858
  // Sharing
4816
- share: l,
4859
+ share: u,
4817
4860
  // Cleanup
4818
- destroy: J
4861
+ destroy: F
4819
4862
  };
4820
4863
  }
4821
- function Tr(e, t, r = /* @__PURE__ */ new WeakSet()) {
4864
+ function Pr(e, t, r = /* @__PURE__ */ new WeakSet()) {
4822
4865
  if (!t) return e;
4823
4866
  if (!e) return t;
4824
4867
  if (typeof t == "object" && t !== null) {
@@ -4839,7 +4882,7 @@ function Tr(e, t, r = /* @__PURE__ */ new WeakSet()) {
4839
4882
  continue;
4840
4883
  }
4841
4884
  if (typeof n == "object" && n.constructor === Object) {
4842
- a[s] = Tr(e[s] || {}, n, r);
4885
+ a[s] = Pr(e[s] || {}, n, r);
4843
4886
  continue;
4844
4887
  }
4845
4888
  a[s] = n;
@@ -4848,121 +4891,121 @@ function Tr(e, t, r = /* @__PURE__ */ new WeakSet()) {
4848
4891
  return a;
4849
4892
  }
4850
4893
  export {
4851
- ee as $,
4852
- Ze as A,
4853
- qe as B,
4854
- He as C,
4855
- _r as D,
4856
- is as E,
4857
- ht as F,
4858
- gt as G,
4859
- O as H,
4860
- mt as I,
4861
- cs as J,
4862
- fs as K,
4863
- hs as L,
4864
- N as M,
4865
- De as N,
4866
- $t as O,
4867
- gs as P,
4868
- At as Q,
4869
- Rt as R,
4870
- St as S,
4871
- zt as T,
4872
- Ct as U,
4873
- Lt as V,
4874
- Mt as W,
4875
- _t as X,
4876
- ms as Y,
4877
- Et as Z,
4878
- bs as _,
4879
- Xs as a,
4880
- Tt as a0,
4881
- ws as a1,
4882
- Pt as a2,
4883
- vs as a3,
4894
+ te as $,
4895
+ He as A,
4896
+ Ze as B,
4897
+ De as C,
4898
+ Er as D,
4899
+ os as E,
4900
+ gt as F,
4901
+ mt as G,
4902
+ D as H,
4903
+ bt as I,
4904
+ ls as J,
4905
+ hs as K,
4906
+ gs as L,
4907
+ U as M,
4908
+ Be as N,
4909
+ At as O,
4910
+ ms as P,
4911
+ Rt as Q,
4912
+ St as R,
4913
+ zt as S,
4914
+ Ct as T,
4915
+ Lt as U,
4916
+ Mt as V,
4917
+ _t as W,
4918
+ Et as X,
4919
+ bs as Y,
4920
+ Tt as Z,
4921
+ ws as _,
4922
+ Ks as a,
4923
+ Pt as a0,
4924
+ ys as a1,
4925
+ jt as a2,
4926
+ ks as a3,
4884
4927
  It as a4,
4885
- jt as a5,
4886
- Zt as a6,
4887
- qt as a7,
4888
- Ht as a8,
4889
- Dt as a9,
4890
- en as aA,
4891
- tn as aB,
4892
- rn as aC,
4893
- an as aD,
4894
- Cs as aE,
4895
- Ls as aF,
4896
- _s as aG,
4897
- Es as aH,
4898
- Ts as aI,
4899
- Ps as aJ,
4928
+ qt as a5,
4929
+ Ht as a6,
4930
+ Zt as a7,
4931
+ Dt as a8,
4932
+ Bt as a9,
4933
+ tn as aA,
4934
+ rn as aB,
4935
+ an as aC,
4936
+ sn as aD,
4937
+ Ls as aE,
4938
+ Ms as aF,
4939
+ Es as aG,
4940
+ Ts as aH,
4941
+ Ps as aI,
4942
+ js as aJ,
4900
4943
  Is as aK,
4901
- js as aL,
4902
- zr as aM,
4903
- ce as aN,
4904
- Lr as aO,
4944
+ qs as aL,
4945
+ Cr as aM,
4946
+ le as aN,
4947
+ Mr as aO,
4905
4948
  Os as aP,
4906
- sn as aQ,
4907
- nn as aR,
4908
- on as aS,
4909
- cn as aT,
4910
- ln as aU,
4911
- Mr as aV,
4912
- un as aW,
4913
- dn as aX,
4914
- Bs as aY,
4915
- pn as aZ,
4916
- fn as a_,
4917
- ks as aa,
4949
+ nn as aQ,
4950
+ on as aR,
4951
+ cn as aS,
4952
+ ln as aT,
4953
+ un as aU,
4954
+ _r as aV,
4955
+ dn as aW,
4956
+ pn as aX,
4957
+ Fs as aY,
4958
+ fn as aZ,
4959
+ hn as a_,
4960
+ xs as aa,
4918
4961
  Ot as ab,
4919
- Bt as ac,
4920
- Ft as ad,
4921
- Vt as ae,
4922
- xs as af,
4923
- Nt as ag,
4924
- Ut as ah,
4925
- Gt as ai,
4926
- Wt as aj,
4927
- Xt as ak,
4928
- Kt as al,
4929
- $s as am,
4962
+ Ft as ac,
4963
+ Vt as ad,
4964
+ Nt as ae,
4965
+ $s as af,
4966
+ Ut as ag,
4967
+ Gt as ah,
4968
+ Wt as ai,
4969
+ Xt as aj,
4970
+ Kt as ak,
4971
+ Jt as al,
4972
+ As as am,
4930
4973
  Qt as an,
4931
- Jt as ao,
4932
- Yt as ap,
4933
- er as aq,
4934
- tr as ar,
4935
- rr as as,
4936
- ar as at,
4937
- $r as au,
4938
- Rs as av,
4939
- Sr as aw,
4940
- zs as ax,
4941
- Js as ay,
4942
- Ys as az,
4943
- Ws as b,
4944
- hn as c,
4945
- Wr as d,
4946
- Kr as e,
4947
- Ks as f,
4948
- Br as g,
4974
+ Yt as ao,
4975
+ er as ap,
4976
+ tr as aq,
4977
+ rr as ar,
4978
+ ar as as,
4979
+ sr as at,
4980
+ Ar as au,
4981
+ Ss as av,
4982
+ zr as aw,
4983
+ Cs as ax,
4984
+ Ys as ay,
4985
+ en as az,
4986
+ Xs as b,
4987
+ gn as c,
4988
+ Xr as d,
4989
+ Jr as e,
4990
+ Js as f,
4991
+ Fr as g,
4949
4992
  Qr as h,
4950
- pe as i,
4951
- Jr as j,
4952
- ta as k,
4953
- la as l,
4954
- Wa as m,
4955
- Me as n,
4956
- Xa as o,
4993
+ fe as i,
4994
+ Yr as j,
4995
+ ra as k,
4996
+ ua as l,
4997
+ Xa as m,
4998
+ _e as n,
4999
+ Ka as o,
4957
5000
  Qs as p,
4958
- ft as q,
4959
- Pe as r,
4960
- Ya as s,
4961
- Ka as t,
4962
- Ja as u,
5001
+ ht as q,
5002
+ je as r,
5003
+ es as s,
5004
+ Ja as t,
5005
+ Ya as u,
4963
5006
  Ie as v,
4964
- as as w,
4965
- ss as x,
4966
- ts as y,
4967
- je as z
5007
+ ss as w,
5008
+ ns as x,
5009
+ rs as y,
5010
+ qe as z
4968
5011
  };