@pagelines/sdk 1.0.611 → 1.0.612
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.
|
@@ -2,13 +2,13 @@ var Un = Object.defineProperty;
|
|
|
2
2
|
var Ps = (a, t, e) => t in a ? Un(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
3
|
var d = (a, t) => Un(a, "name", { value: t, configurable: !0 });
|
|
4
4
|
var C = (a, t, e) => Ps(a, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
-
import { defineComponent as
|
|
6
|
-
import { SettingsObject as Gs, Agent as
|
|
5
|
+
import { defineComponent as Re, openBlock as v, createElementBlock as w, createElementVNode as y, normalizeClass as S, ref as re, watch as zt, computed as F, createCommentVNode as j, renderSlot as dn, onMounted as Ut, unref as on, Fragment as Be, toDisplayString as ne, shallowRef as ps, onBeforeUnmount as fs, nextTick as Bs, createVNode as Ke, withCtx as Fs, renderList as tn, createBlock as Hn, withModifiers as ft, createTextVNode as Lt, withDirectives as Us, vModelText as Hs } from "vue";
|
|
6
|
+
import { SettingsObject as Gs, Agent as $t, getDefaultAvatarUrl as gs, createLogger as js } from "@pagelines/core";
|
|
7
7
|
import { P as Ws } from "./sdkClient.js";
|
|
8
8
|
const qs = { class: "spinner max-w-sm" }, Ys = {
|
|
9
9
|
class: "ring-circular h-full w-full origin-center",
|
|
10
10
|
viewBox: "25 25 50 50"
|
|
11
|
-
}, Gn = /* @__PURE__ */
|
|
11
|
+
}, Gn = /* @__PURE__ */ Re({
|
|
12
12
|
__name: "FSpinner",
|
|
13
13
|
props: {
|
|
14
14
|
width: { type: String, default: "" },
|
|
@@ -18,7 +18,7 @@ const qs = { class: "spinner max-w-sm" }, Ys = {
|
|
|
18
18
|
return (t, e) => (v(), w("div", qs, [
|
|
19
19
|
(v(), w("svg", Ys, [
|
|
20
20
|
y("circle", {
|
|
21
|
-
class:
|
|
21
|
+
class: S([a.colorMode, "ring-path"]),
|
|
22
22
|
cx: "50",
|
|
23
23
|
cy: "50",
|
|
24
24
|
r: "20",
|
|
@@ -54,16 +54,16 @@ const wn = class wn extends Gs {
|
|
|
54
54
|
C(this, "activeTurnGeneration", 0);
|
|
55
55
|
// Chat conversation tracking (server-managed persistence)
|
|
56
56
|
C(this, "conversationId");
|
|
57
|
-
C(this, "textState",
|
|
57
|
+
C(this, "textState", re({
|
|
58
58
|
isActive: !1,
|
|
59
59
|
isConnected: !1,
|
|
60
60
|
isThinking: !1,
|
|
61
61
|
connectionStatus: "disconnected"
|
|
62
62
|
}));
|
|
63
|
-
C(this, "agentMode",
|
|
64
|
-
C(this, "sharedMessages",
|
|
63
|
+
C(this, "agentMode", re("self"));
|
|
64
|
+
C(this, "sharedMessages", re([]));
|
|
65
65
|
C(this, "_agent");
|
|
66
|
-
this._agent = e.agent instanceof
|
|
66
|
+
this._agent = e.agent instanceof $t ? e.agent : new $t({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
|
|
67
67
|
}
|
|
68
68
|
get chatEnabled() {
|
|
69
69
|
const e = this._agent.state.value.lifecycle;
|
|
@@ -152,12 +152,12 @@ Current User:
|
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
setupModeWatcher() {
|
|
155
|
-
|
|
155
|
+
zt(this.agentMode, async (e, n) => {
|
|
156
156
|
this.logger.info(`Mode changed from ${n} to ${e}`), this.isTextMode && (n === "talk" || n === "chat") && await this.endConversation();
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
setupAvailabilityWatcher() {
|
|
160
|
-
|
|
160
|
+
zt(() => this.chatEnabled, (e) => {
|
|
161
161
|
if (!(!this.isTextMode || this.isConnecting)) {
|
|
162
162
|
if (e) {
|
|
163
163
|
this.textState.value.isConnected || this.updateState(this.textState, {
|
|
@@ -268,11 +268,11 @@ Current User:
|
|
|
268
268
|
this.sharedMessages.value = B?.id === o ? [...L.slice(0, -1), E] : [...L, E];
|
|
269
269
|
}
|
|
270
270
|
E.sender === "system" && E.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : E.sender === "system" && E.issue?.code && xs.has(E.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
|
|
271
|
-
}, "onMessage"),
|
|
271
|
+
}, "onMessage"), T = /* @__PURE__ */ d((E) => {
|
|
272
272
|
if (!m())
|
|
273
273
|
return;
|
|
274
274
|
if (!h && !c) {
|
|
275
|
-
|
|
275
|
+
U("empty_stream — assistant returned no content");
|
|
276
276
|
return;
|
|
277
277
|
}
|
|
278
278
|
this.finishToolActivities("completed");
|
|
@@ -284,16 +284,16 @@ Current User:
|
|
|
284
284
|
B ? B !== R.text && (R.text = B, this.sharedMessages.value = [...L]) : this.sharedMessages.value = L.slice(0, -1);
|
|
285
285
|
}
|
|
286
286
|
E && (this.conversationId = E), this.updateState(this.textState, { isThinking: !1, workingDescription: void 0, transientIssue: void 0 });
|
|
287
|
-
}, "onDone"),
|
|
287
|
+
}, "onDone"), U = /* @__PURE__ */ d((E) => {
|
|
288
288
|
if (!m())
|
|
289
289
|
return;
|
|
290
290
|
this.updateState(this.textState, { workingDescription: void 0 }), this.finishToolActivities("failed");
|
|
291
291
|
const L = this.sharedMessages.value, R = L[L.length - 1];
|
|
292
292
|
if (R?.id === o && !R.text && (this.sharedMessages.value = L.slice(0, -1)), typeof E == "object" && E.code && E.error) {
|
|
293
|
-
const
|
|
294
|
-
|
|
293
|
+
const W = Ks(E);
|
|
294
|
+
W.surface === "transient" ? this.updateState(this.textState, { isThinking: !1, transientIssue: W.issue }) : W.surface === "transcript" ? (this.addMessage(E.error, "system", void 0, W.issue), this.updateState(this.textState, {
|
|
295
295
|
isThinking: !1,
|
|
296
|
-
...
|
|
296
|
+
...W.sendBlockedReason ? { sendBlockedReason: W.sendBlockedReason } : {}
|
|
297
297
|
})) : this.handleError(new Error(E.error));
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
@@ -304,9 +304,9 @@ Current User:
|
|
|
304
304
|
return;
|
|
305
305
|
const L = E.trim();
|
|
306
306
|
this.updateState(this.textState, { workingDescription: L || void 0 });
|
|
307
|
-
}, "onStatus"),
|
|
307
|
+
}, "onStatus"), X = /* @__PURE__ */ d((E) => {
|
|
308
308
|
m() && this.updateToolActivity(E);
|
|
309
|
-
}, "onToolActivity"),
|
|
309
|
+
}, "onToolActivity"), oe = /* @__PURE__ */ d(() => {
|
|
310
310
|
m() && this.updateState(this.textState, { workingDescription: void 0 });
|
|
311
311
|
}, "onWorkingEnd");
|
|
312
312
|
try {
|
|
@@ -317,11 +317,11 @@ Current User:
|
|
|
317
317
|
history: this.buildHistory(),
|
|
318
318
|
onDelta: x,
|
|
319
319
|
onMessage: k,
|
|
320
|
-
onDone:
|
|
321
|
-
onError:
|
|
320
|
+
onDone: T,
|
|
321
|
+
onError: U,
|
|
322
322
|
onStatus: M,
|
|
323
|
-
onToolActivity:
|
|
324
|
-
onWorkingEnd:
|
|
323
|
+
onToolActivity: X,
|
|
324
|
+
onWorkingEnd: oe
|
|
325
325
|
}) : s.chat.chatStreamPublic({
|
|
326
326
|
handle: this._agent.handle.value,
|
|
327
327
|
message: e,
|
|
@@ -330,18 +330,18 @@ Current User:
|
|
|
330
330
|
context: this.getDynamicSettings().context || void 0,
|
|
331
331
|
onDelta: x,
|
|
332
332
|
onMessage: k,
|
|
333
|
-
onDone:
|
|
334
|
-
onError:
|
|
333
|
+
onDone: T,
|
|
334
|
+
onError: U,
|
|
335
335
|
onStatus: M,
|
|
336
|
-
onToolActivity:
|
|
337
|
-
onWorkingEnd:
|
|
336
|
+
onToolActivity: X,
|
|
337
|
+
onWorkingEnd: oe
|
|
338
338
|
});
|
|
339
339
|
await Promise.race([
|
|
340
340
|
E,
|
|
341
341
|
new Promise((L, R) => setTimeout(() => R(new Error("timed out")), Zs))
|
|
342
342
|
]);
|
|
343
343
|
} catch (E) {
|
|
344
|
-
|
|
344
|
+
U(E.message || "Something went wrong");
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
async stopChatTurn() {
|
|
@@ -401,7 +401,7 @@ d(vr, "parseButtonTemplate");
|
|
|
401
401
|
const Qs = {
|
|
402
402
|
key: 0,
|
|
403
403
|
class: "absolute inset-0 flex items-center justify-center"
|
|
404
|
-
}, yr = /* @__PURE__ */
|
|
404
|
+
}, yr = /* @__PURE__ */ Re({
|
|
405
405
|
__name: "ElAgentButton",
|
|
406
406
|
props: {
|
|
407
407
|
theme: { default: "primary" },
|
|
@@ -411,42 +411,42 @@ const Qs = {
|
|
|
411
411
|
iconAfter: {}
|
|
412
412
|
},
|
|
413
413
|
setup(a) {
|
|
414
|
-
const t =
|
|
414
|
+
const t = F(() => ({
|
|
415
415
|
primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
|
|
416
416
|
green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
|
|
417
417
|
red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
|
|
418
418
|
default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20"
|
|
419
|
-
})[a.theme]), e =
|
|
419
|
+
})[a.theme]), e = F(() => ({
|
|
420
420
|
sm: "px-4 py-2 text-sm",
|
|
421
421
|
md: "px-6 py-3 text-base",
|
|
422
422
|
lg: "px-8 py-4 text-base"
|
|
423
|
-
})[a.size]), n =
|
|
423
|
+
})[a.size]), n = F(() => ({
|
|
424
424
|
sm: "size-4",
|
|
425
425
|
md: "size-4",
|
|
426
426
|
lg: "size-5"
|
|
427
427
|
})[a.size]);
|
|
428
428
|
return (i, s) => (v(), w("button", {
|
|
429
|
-
class:
|
|
429
|
+
class: S(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
|
|
430
430
|
}, [
|
|
431
431
|
a.loading ? (v(), w("div", Qs, [...s[0] || (s[0] = [
|
|
432
432
|
y("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
|
|
433
|
-
])])) :
|
|
433
|
+
])])) : j("", !0),
|
|
434
434
|
y("span", {
|
|
435
|
-
class:
|
|
435
|
+
class: S(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
|
|
436
436
|
}, [
|
|
437
437
|
a.icon ? (v(), w("i", {
|
|
438
438
|
key: 0,
|
|
439
|
-
class:
|
|
440
|
-
}, null, 2)) :
|
|
439
|
+
class: S([a.icon, n.value])
|
|
440
|
+
}, null, 2)) : j("", !0),
|
|
441
441
|
dn(i.$slots, "default"),
|
|
442
442
|
a.iconAfter ? (v(), w("i", {
|
|
443
443
|
key: 1,
|
|
444
|
-
class:
|
|
445
|
-
}, null, 2)) :
|
|
444
|
+
class: S([a.iconAfter, n.value])
|
|
445
|
+
}, null, 2)) : j("", !0)
|
|
446
446
|
], 2)
|
|
447
447
|
], 2));
|
|
448
448
|
}
|
|
449
|
-
}), Js = ["value"], wr = /* @__PURE__ */
|
|
449
|
+
}), Js = ["value"], wr = /* @__PURE__ */ Re({
|
|
450
450
|
__name: "AgentInputEmail",
|
|
451
451
|
props: {
|
|
452
452
|
modelValue: { default: "" }
|
|
@@ -469,7 +469,7 @@ const Qs = {
|
|
|
469
469
|
onInput: i[0] || (i[0] = (s) => e("update:modelValue", s.target.value))
|
|
470
470
|
}, null, 40, Js));
|
|
471
471
|
}
|
|
472
|
-
}), ei = ["placeholder", "value"], Tr = /* @__PURE__ */
|
|
472
|
+
}), ei = ["placeholder", "value"], Tr = /* @__PURE__ */ Re({
|
|
473
473
|
__name: "AgentInputOneTimeCode",
|
|
474
474
|
props: {
|
|
475
475
|
modelValue: {},
|
|
@@ -478,8 +478,8 @@ const Qs = {
|
|
|
478
478
|
},
|
|
479
479
|
emits: ["update:modelValue", "autoSubmit"],
|
|
480
480
|
setup(a, { emit: t }) {
|
|
481
|
-
const e = a, n = t, i =
|
|
482
|
-
|
|
481
|
+
const e = a, n = t, i = re(null), s = F(() => "0".repeat(e.length));
|
|
482
|
+
Ut(() => {
|
|
483
483
|
e.focusFirst && !("ontouchstart" in window) && i.value?.focus();
|
|
484
484
|
});
|
|
485
485
|
function l(o) {
|
|
@@ -507,7 +507,7 @@ const Qs = {
|
|
|
507
507
|
}), ti = { class: "relative flex-shrink-0" }, ni = ["src", "alt"], si = { class: "absolute top-1 right-1" }, ii = {
|
|
508
508
|
key: 1,
|
|
509
509
|
class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
|
|
510
|
-
}, ai = { class: "min-w-0" }, ri = /* @__PURE__ */
|
|
510
|
+
}, ai = { class: "min-w-0" }, ri = /* @__PURE__ */ Re({
|
|
511
511
|
__name: "ElModeHeader",
|
|
512
512
|
props: {
|
|
513
513
|
agent: {},
|
|
@@ -517,13 +517,13 @@ const Qs = {
|
|
|
517
517
|
},
|
|
518
518
|
setup(a) {
|
|
519
519
|
return (t, e) => (v(), w("div", {
|
|
520
|
-
class:
|
|
520
|
+
class: S(["flex gap-4", [
|
|
521
521
|
a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
|
|
522
522
|
]])
|
|
523
523
|
}, [
|
|
524
524
|
y("div", ti, [
|
|
525
525
|
y("div", {
|
|
526
|
-
class:
|
|
526
|
+
class: S(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
|
|
527
527
|
}, [
|
|
528
528
|
y("img", {
|
|
529
529
|
src: a.agent.avatarUrl.value,
|
|
@@ -534,7 +534,7 @@ const Qs = {
|
|
|
534
534
|
}, null, 40, ni)
|
|
535
535
|
], 2),
|
|
536
536
|
y("div", si, [
|
|
537
|
-
a.isOnline ? (v(), w(
|
|
537
|
+
a.isOnline ? (v(), w(Be, { key: 0 }, [
|
|
538
538
|
e[1] || (e[1] = y("div", {
|
|
539
539
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
540
540
|
style: { "animation-duration": "3s" }
|
|
@@ -545,13 +545,13 @@ const Qs = {
|
|
|
545
545
|
]),
|
|
546
546
|
y("div", ai, [
|
|
547
547
|
y("h1", {
|
|
548
|
-
class:
|
|
548
|
+
class: S(["font-light text-white mb-1 truncate", [
|
|
549
549
|
a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
|
|
550
550
|
a.layout === "horizontal" ? "text-white/95" : ""
|
|
551
551
|
]])
|
|
552
552
|
}, ne(a.agent.displayName.value), 3),
|
|
553
553
|
y("p", {
|
|
554
|
-
class:
|
|
554
|
+
class: S(["font-light line-clamp-1", [
|
|
555
555
|
a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
|
|
556
556
|
a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
|
|
557
557
|
]])
|
|
@@ -607,8 +607,8 @@ function hi(a, t) {
|
|
|
607
607
|
}
|
|
608
608
|
d(hi, "_unsupportedIterableToArray");
|
|
609
609
|
const bs = Object.entries, Vn = Object.setPrototypeOf, di = Object.isFrozen, pi = Object.getPrototypeOf, fi = Object.getOwnPropertyDescriptor;
|
|
610
|
-
let
|
|
611
|
-
|
|
610
|
+
let le = Object.freeze, de = Object.seal, nt = Object.create, ks = typeof Reflect < "u" && Reflect, cn = ks.apply, un = ks.construct;
|
|
611
|
+
le || (le = /* @__PURE__ */ d(function(t) {
|
|
612
612
|
return t;
|
|
613
613
|
}, "freeze"));
|
|
614
614
|
de || (de = /* @__PURE__ */ d(function(t) {
|
|
@@ -624,8 +624,8 @@ un || (un = /* @__PURE__ */ d(function(t) {
|
|
|
624
624
|
n[i - 1] = arguments[i];
|
|
625
625
|
return new t(...n);
|
|
626
626
|
}, "construct"));
|
|
627
|
-
const
|
|
628
|
-
function
|
|
627
|
+
const Qe = J(Array.prototype.forEach), gi = J(Array.prototype.lastIndexOf), Zn = J(Array.prototype.pop), Je = J(Array.prototype.push), mi = J(Array.prototype.splice), ae = Array.isArray, bt = J(String.prototype.toLowerCase), nn = J(String.prototype.toString), Xn = J(String.prototype.match), et = J(String.prototype.replace), Kn = J(String.prototype.indexOf), xi = J(String.prototype.trim), bi = J(Number.prototype.toString), ki = J(Boolean.prototype.toString), Qn = typeof BigInt > "u" ? null : J(BigInt.prototype.toString), Jn = typeof Symbol > "u" ? null : J(Symbol.prototype.toString), Z = J(Object.prototype.hasOwnProperty), gt = J(Object.prototype.toString), te = J(RegExp.prototype.test), mt = vi(TypeError);
|
|
628
|
+
function J(a) {
|
|
629
629
|
return function(t) {
|
|
630
630
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
631
631
|
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
|
|
@@ -633,7 +633,7 @@ function Q(a) {
|
|
|
633
633
|
return cn(a, t, n);
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
|
-
d(
|
|
636
|
+
d(J, "unapply");
|
|
637
637
|
function vi(a) {
|
|
638
638
|
return function() {
|
|
639
639
|
for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
|
|
@@ -644,7 +644,7 @@ function vi(a) {
|
|
|
644
644
|
d(vi, "unconstruct");
|
|
645
645
|
function _(a, t) {
|
|
646
646
|
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : bt;
|
|
647
|
-
if (Vn && Vn(a, null), !
|
|
647
|
+
if (Vn && Vn(a, null), !ae(t))
|
|
648
648
|
return a;
|
|
649
649
|
let n = t.length;
|
|
650
650
|
for (; n--; ) {
|
|
@@ -660,16 +660,16 @@ function _(a, t) {
|
|
|
660
660
|
d(_, "addToSet");
|
|
661
661
|
function yi(a) {
|
|
662
662
|
for (let t = 0; t < a.length; t++)
|
|
663
|
-
|
|
663
|
+
Z(a, t) || (a[t] = null);
|
|
664
664
|
return a;
|
|
665
665
|
}
|
|
666
666
|
d(yi, "cleanArray");
|
|
667
667
|
function se(a) {
|
|
668
|
-
const t =
|
|
668
|
+
const t = nt(null);
|
|
669
669
|
for (const n of bs(a)) {
|
|
670
670
|
var e = ui(n, 2);
|
|
671
671
|
const i = e[0], s = e[1];
|
|
672
|
-
|
|
672
|
+
Z(a, i) && (ae(s) ? t[i] = yi(s) : s && typeof s == "object" && s.constructor === Object ? t[i] = se(s) : t[i] = s);
|
|
673
673
|
}
|
|
674
674
|
return t;
|
|
675
675
|
}
|
|
@@ -692,7 +692,7 @@ function wi(a) {
|
|
|
692
692
|
case "object": {
|
|
693
693
|
if (a === null)
|
|
694
694
|
return gt(a);
|
|
695
|
-
const t = a, e =
|
|
695
|
+
const t = a, e = Ae(t, "toString");
|
|
696
696
|
if (typeof e == "function") {
|
|
697
697
|
const n = e(t);
|
|
698
698
|
return typeof n == "string" ? n : gt(n);
|
|
@@ -704,14 +704,14 @@ function wi(a) {
|
|
|
704
704
|
}
|
|
705
705
|
}
|
|
706
706
|
d(wi, "stringifyValue");
|
|
707
|
-
function
|
|
707
|
+
function Ae(a, t) {
|
|
708
708
|
for (; a !== null; ) {
|
|
709
709
|
const n = fi(a, t);
|
|
710
710
|
if (n) {
|
|
711
711
|
if (n.get)
|
|
712
|
-
return
|
|
712
|
+
return J(n.get);
|
|
713
713
|
if (typeof n.value == "function")
|
|
714
|
-
return
|
|
714
|
+
return J(n.value);
|
|
715
715
|
}
|
|
716
716
|
a = pi(a);
|
|
717
717
|
}
|
|
@@ -720,7 +720,7 @@ function Se(a, t) {
|
|
|
720
720
|
}
|
|
721
721
|
return d(e, "fallbackValue"), e;
|
|
722
722
|
}
|
|
723
|
-
d(
|
|
723
|
+
d(Ae, "lookupGetter");
|
|
724
724
|
function Ti(a) {
|
|
725
725
|
try {
|
|
726
726
|
return te(a, ""), !0;
|
|
@@ -729,13 +729,13 @@ function Ti(a) {
|
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
731
|
d(Ti, "isRegex");
|
|
732
|
-
const es =
|
|
732
|
+
const es = le(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), sn = le(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), an = le(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Si = le(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), rn = le(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Ai = le(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ts = le(["#text"]), ns = le(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), ln = le(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), ss = le(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Ot = le(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Ei = de(/{{[\w\W]*|^[\w\W]*}}/g), _i = de(/<%[\w\W]*|^[\w\W]*%>/g), Ri = de(/\${[\w\W]*/g), Ii = de(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ci = de(/^aria-[\-\w]+$/), is = de(
|
|
733
733
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
734
734
|
// eslint-disable-line no-useless-escape
|
|
735
735
|
), Di = de(/^(?:\w+script|data):/i), Li = de(
|
|
736
736
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
737
737
|
// eslint-disable-line no-control-regex
|
|
738
|
-
), Oi = de(/^html$/i), Mi = de(/^[a-z][.\w]*(-[.\w]+)+$/i),
|
|
738
|
+
), Oi = de(/^html$/i), Mi = de(/^[a-z][.\w]*(-[.\w]+)+$/i), Se = {
|
|
739
739
|
element: 1,
|
|
740
740
|
attribute: 2,
|
|
741
741
|
text: 3,
|
|
@@ -788,28 +788,28 @@ const es = oe(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
|
|
|
788
788
|
function vs() {
|
|
789
789
|
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ni();
|
|
790
790
|
const t = /* @__PURE__ */ d((b) => vs(b), "DOMPurify");
|
|
791
|
-
if (t.version = "3.4.7", t.removed = [], !a || !a.document || a.document.nodeType !==
|
|
791
|
+
if (t.version = "3.4.7", t.removed = [], !a || !a.document || a.document.nodeType !== Se.document || !a.Element)
|
|
792
792
|
return t.isSupported = !1, t;
|
|
793
793
|
let e = a.document;
|
|
794
794
|
const n = e, i = n.currentScript;
|
|
795
795
|
a.DocumentFragment;
|
|
796
796
|
const s = a.HTMLTemplateElement, l = a.Node, o = a.Element, h = a.NodeFilter, c = a.NamedNodeMap;
|
|
797
797
|
c === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
|
|
798
|
-
const m = a.DOMParser, x = a.trustedTypes, k = o.prototype,
|
|
798
|
+
const m = a.DOMParser, x = a.trustedTypes, k = o.prototype, T = Ae(k, "cloneNode"), U = Ae(k, "remove"), M = Ae(k, "nextSibling"), X = Ae(k, "childNodes"), oe = Ae(k, "parentNode"), E = Ae(k, "shadowRoot"), L = Ae(k, "attributes"), R = l && l.prototype ? Ae(l.prototype, "nodeType") : null, B = l && l.prototype ? Ae(l.prototype, "nodeName") : null;
|
|
799
799
|
if (typeof s == "function") {
|
|
800
800
|
const b = e.createElement("template");
|
|
801
801
|
b.content && b.content.ownerDocument && (e = b.content.ownerDocument);
|
|
802
802
|
}
|
|
803
|
-
let z,
|
|
804
|
-
const
|
|
805
|
-
let
|
|
806
|
-
t.isSupported = typeof bs == "function" && typeof
|
|
807
|
-
const
|
|
808
|
-
let
|
|
803
|
+
let z, W = "";
|
|
804
|
+
const Oe = e, ce = Oe.implementation, ke = Oe.createNodeIterator, jt = Oe.createDocumentFragment, ot = Oe.getElementsByTagName, Ge = n.importNode;
|
|
805
|
+
let Q = as();
|
|
806
|
+
t.isSupported = typeof bs == "function" && typeof oe == "function" && ce && ce.createHTMLDocument !== void 0;
|
|
807
|
+
const je = Ei, Me = _i, pe = Ri, yt = Ii, I = Ci, wt = Di, We = Li, Tt = Mi;
|
|
808
|
+
let St = is, q = null;
|
|
809
809
|
const ct = _({}, [...es, ...sn, ...an, ...rn, ...ts]);
|
|
810
|
-
let
|
|
811
|
-
const ut = _({}, [...ns, ...ln, ...ss, ...
|
|
812
|
-
let
|
|
810
|
+
let V = null;
|
|
811
|
+
const ut = _({}, [...ns, ...ln, ...ss, ...Ot]);
|
|
812
|
+
let Y = Object.seal(nt(null, {
|
|
813
813
|
tagNameCheck: {
|
|
814
814
|
writable: !0,
|
|
815
815
|
configurable: !1,
|
|
@@ -828,8 +828,8 @@ function vs() {
|
|
|
828
828
|
enumerable: !0,
|
|
829
829
|
value: !1
|
|
830
830
|
}
|
|
831
|
-
})),
|
|
832
|
-
const
|
|
831
|
+
})), Ne = null, ze = null;
|
|
832
|
+
const fe = Object.seal(nt(null, {
|
|
833
833
|
tagCheck: {
|
|
834
834
|
writable: !0,
|
|
835
835
|
configurable: !1,
|
|
@@ -843,72 +843,72 @@ function vs() {
|
|
|
843
843
|
value: null
|
|
844
844
|
}
|
|
845
845
|
}));
|
|
846
|
-
let
|
|
846
|
+
let A = !0, g = !0, p = !1, O = !0, H = !1, ue = !0, ve = !1, $e = !1, Wt = !1, qe = !1, At = !1, Et = !1, Tn = !0, Sn = !1;
|
|
847
847
|
const An = "user-content-";
|
|
848
|
-
let qt = !0, ht = !1,
|
|
848
|
+
let qt = !0, ht = !1, Ye = {}, ye = null;
|
|
849
849
|
const Yt = _({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
850
850
|
let En = null;
|
|
851
851
|
const _n = _({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
852
852
|
let Vt = null;
|
|
853
|
-
const Rn = _({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]),
|
|
854
|
-
let
|
|
855
|
-
const Ds = _({}, [
|
|
853
|
+
const Rn = _({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), _t = "http://www.w3.org/1998/Math/MathML", Rt = "http://www.w3.org/2000/svg", we = "http://www.w3.org/1999/xhtml";
|
|
854
|
+
let Ve = we, Zt = !1, Xt = null;
|
|
855
|
+
const Ds = _({}, [_t, Rt, we], nn);
|
|
856
856
|
let Kt = _({}, ["mi", "mo", "mn", "ms", "mtext"]), Qt = _({}, ["annotation-xml"]);
|
|
857
857
|
const Ls = _({}, ["title", "style", "font", "a", "script"]);
|
|
858
858
|
let dt = null;
|
|
859
859
|
const Os = ["application/xhtml+xml", "text/html"], Ms = "text/html";
|
|
860
|
-
let
|
|
860
|
+
let K = null, Ze = null;
|
|
861
861
|
const Ns = e.createElement("form"), In = /* @__PURE__ */ d(function(r) {
|
|
862
862
|
return r instanceof RegExp || r instanceof Function;
|
|
863
863
|
}, "isRegexOrFunction"), Jt = /* @__PURE__ */ d(function() {
|
|
864
864
|
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
865
|
-
if (
|
|
865
|
+
if (Ze && Ze === r)
|
|
866
866
|
return;
|
|
867
867
|
(!r || typeof r != "object") && (r = {}), r = se(r), dt = // eslint-disable-next-line unicorn/prefer-includes
|
|
868
|
-
Os.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? Ms : r.PARSER_MEDIA_TYPE,
|
|
869
|
-
const u =
|
|
870
|
-
if (
|
|
868
|
+
Os.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? Ms : r.PARSER_MEDIA_TYPE, K = dt === "application/xhtml+xml" ? nn : bt, q = Z(r, "ALLOWED_TAGS") && ae(r.ALLOWED_TAGS) ? _({}, r.ALLOWED_TAGS, K) : ct, V = Z(r, "ALLOWED_ATTR") && ae(r.ALLOWED_ATTR) ? _({}, r.ALLOWED_ATTR, K) : ut, Xt = Z(r, "ALLOWED_NAMESPACES") && ae(r.ALLOWED_NAMESPACES) ? _({}, r.ALLOWED_NAMESPACES, nn) : Ds, Vt = Z(r, "ADD_URI_SAFE_ATTR") && ae(r.ADD_URI_SAFE_ATTR) ? _(se(Rn), r.ADD_URI_SAFE_ATTR, K) : Rn, En = Z(r, "ADD_DATA_URI_TAGS") && ae(r.ADD_DATA_URI_TAGS) ? _(se(_n), r.ADD_DATA_URI_TAGS, K) : _n, ye = Z(r, "FORBID_CONTENTS") && ae(r.FORBID_CONTENTS) ? _({}, r.FORBID_CONTENTS, K) : Yt, Ne = Z(r, "FORBID_TAGS") && ae(r.FORBID_TAGS) ? _({}, r.FORBID_TAGS, K) : se({}), ze = Z(r, "FORBID_ATTR") && ae(r.FORBID_ATTR) ? _({}, r.FORBID_ATTR, K) : se({}), Ye = Z(r, "USE_PROFILES") ? r.USE_PROFILES && typeof r.USE_PROFILES == "object" ? se(r.USE_PROFILES) : r.USE_PROFILES : !1, A = r.ALLOW_ARIA_ATTR !== !1, g = r.ALLOW_DATA_ATTR !== !1, p = r.ALLOW_UNKNOWN_PROTOCOLS || !1, O = r.ALLOW_SELF_CLOSE_IN_ATTR !== !1, H = r.SAFE_FOR_TEMPLATES || !1, ue = r.SAFE_FOR_XML !== !1, ve = r.WHOLE_DOCUMENT || !1, qe = r.RETURN_DOM || !1, At = r.RETURN_DOM_FRAGMENT || !1, Et = r.RETURN_TRUSTED_TYPE || !1, Wt = r.FORCE_BODY || !1, Tn = r.SANITIZE_DOM !== !1, Sn = r.SANITIZE_NAMED_PROPS || !1, qt = r.KEEP_CONTENT !== !1, ht = r.IN_PLACE || !1, St = Ti(r.ALLOWED_URI_REGEXP) ? r.ALLOWED_URI_REGEXP : is, Ve = typeof r.NAMESPACE == "string" ? r.NAMESPACE : we, Kt = Z(r, "MATHML_TEXT_INTEGRATION_POINTS") && r.MATHML_TEXT_INTEGRATION_POINTS && typeof r.MATHML_TEXT_INTEGRATION_POINTS == "object" ? se(r.MATHML_TEXT_INTEGRATION_POINTS) : _({}, ["mi", "mo", "mn", "ms", "mtext"]), Qt = Z(r, "HTML_INTEGRATION_POINTS") && r.HTML_INTEGRATION_POINTS && typeof r.HTML_INTEGRATION_POINTS == "object" ? se(r.HTML_INTEGRATION_POINTS) : _({}, ["annotation-xml"]);
|
|
869
|
+
const u = Z(r, "CUSTOM_ELEMENT_HANDLING") && r.CUSTOM_ELEMENT_HANDLING && typeof r.CUSTOM_ELEMENT_HANDLING == "object" ? se(r.CUSTOM_ELEMENT_HANDLING) : nt(null);
|
|
870
|
+
if (Y = nt(null), Z(u, "tagNameCheck") && In(u.tagNameCheck) && (Y.tagNameCheck = u.tagNameCheck), Z(u, "attributeNameCheck") && In(u.attributeNameCheck) && (Y.attributeNameCheck = u.attributeNameCheck), Z(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (Y.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), H && (g = !1), At && (qe = !0), Ye && (q = _({}, ts), V = nt(null), Ye.html === !0 && (_(q, es), _(V, ns)), Ye.svg === !0 && (_(q, sn), _(V, ln), _(V, Ot)), Ye.svgFilters === !0 && (_(q, an), _(V, ln), _(V, Ot)), Ye.mathMl === !0 && (_(q, rn), _(V, ss), _(V, Ot))), fe.tagCheck = null, fe.attributeCheck = null, Z(r, "ADD_TAGS") && (typeof r.ADD_TAGS == "function" ? fe.tagCheck = r.ADD_TAGS : ae(r.ADD_TAGS) && (q === ct && (q = se(q)), _(q, r.ADD_TAGS, K))), Z(r, "ADD_ATTR") && (typeof r.ADD_ATTR == "function" ? fe.attributeCheck = r.ADD_ATTR : ae(r.ADD_ATTR) && (V === ut && (V = se(V)), _(V, r.ADD_ATTR, K))), Z(r, "ADD_URI_SAFE_ATTR") && ae(r.ADD_URI_SAFE_ATTR) && _(Vt, r.ADD_URI_SAFE_ATTR, K), Z(r, "FORBID_CONTENTS") && ae(r.FORBID_CONTENTS) && (ye === Yt && (ye = se(ye)), _(ye, r.FORBID_CONTENTS, K)), Z(r, "ADD_FORBID_CONTENTS") && ae(r.ADD_FORBID_CONTENTS) && (ye === Yt && (ye = se(ye)), _(ye, r.ADD_FORBID_CONTENTS, K)), qt && (q["#text"] = !0), ve && _(q, ["html", "head", "body"]), q.table && (_(q, ["tbody"]), delete Ne.tbody), r.TRUSTED_TYPES_POLICY) {
|
|
871
871
|
if (typeof r.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
872
872
|
throw mt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
873
873
|
if (typeof r.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
874
874
|
throw mt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
875
|
-
z = r.TRUSTED_TYPES_POLICY,
|
|
875
|
+
z = r.TRUSTED_TYPES_POLICY, W = z.createHTML("");
|
|
876
876
|
} else
|
|
877
|
-
z === void 0 && (z = zi(x, i)), z !== null && typeof
|
|
878
|
-
(
|
|
877
|
+
z === void 0 && (z = zi(x, i)), z !== null && typeof W == "string" && (W = z.createHTML(""));
|
|
878
|
+
(Q.uponSanitizeElement.length > 0 || Q.uponSanitizeAttribute.length > 0) && q === ct && (q = se(q)), Q.uponSanitizeAttribute.length > 0 && V === ut && (V = se(V)), le && le(r), Ze = r;
|
|
879
879
|
}, "_parseConfig"), Cn = _({}, [...sn, ...an, ...Si]), Dn = _({}, [...rn, ...Ai]), zs = /* @__PURE__ */ d(function(r) {
|
|
880
|
-
let u =
|
|
880
|
+
let u = oe(r);
|
|
881
881
|
(!u || !u.tagName) && (u = {
|
|
882
|
-
namespaceURI:
|
|
882
|
+
namespaceURI: Ve,
|
|
883
883
|
tagName: "template"
|
|
884
884
|
});
|
|
885
885
|
const f = bt(r.tagName), P = bt(u.tagName);
|
|
886
|
-
return Xt[r.namespaceURI] ? r.namespaceURI ===
|
|
887
|
-
}, "_checkValidNamespace"),
|
|
888
|
-
|
|
886
|
+
return Xt[r.namespaceURI] ? r.namespaceURI === Rt ? u.namespaceURI === we ? f === "svg" : u.namespaceURI === _t ? f === "svg" && (P === "annotation-xml" || Kt[P]) : !!Cn[f] : r.namespaceURI === _t ? u.namespaceURI === we ? f === "math" : u.namespaceURI === Rt ? f === "math" && Qt[P] : !!Dn[f] : r.namespaceURI === we ? u.namespaceURI === Rt && !Qt[P] || u.namespaceURI === _t && !Kt[P] ? !1 : !Dn[f] && (Ls[f] || !Cn[f]) : !!(dt === "application/xhtml+xml" && Xt[r.namespaceURI]) : !1;
|
|
887
|
+
}, "_checkValidNamespace"), ge = /* @__PURE__ */ d(function(r) {
|
|
888
|
+
Je(t.removed, {
|
|
889
889
|
element: r
|
|
890
890
|
});
|
|
891
891
|
try {
|
|
892
|
-
|
|
892
|
+
oe(r).removeChild(r);
|
|
893
893
|
} catch {
|
|
894
|
-
|
|
894
|
+
U(r);
|
|
895
895
|
}
|
|
896
|
-
}, "_forceRemove"),
|
|
896
|
+
}, "_forceRemove"), Pe = /* @__PURE__ */ d(function(r, u) {
|
|
897
897
|
try {
|
|
898
|
-
|
|
898
|
+
Je(t.removed, {
|
|
899
899
|
attribute: u.getAttributeNode(r),
|
|
900
900
|
from: u
|
|
901
901
|
});
|
|
902
902
|
} catch {
|
|
903
|
-
|
|
903
|
+
Je(t.removed, {
|
|
904
904
|
attribute: null,
|
|
905
905
|
from: u
|
|
906
906
|
});
|
|
907
907
|
}
|
|
908
908
|
if (u.removeAttribute(r), r === "is")
|
|
909
|
-
if (
|
|
909
|
+
if (qe || At)
|
|
910
910
|
try {
|
|
911
|
-
|
|
911
|
+
ge(u);
|
|
912
912
|
} catch {
|
|
913
913
|
}
|
|
914
914
|
else
|
|
@@ -921,27 +921,27 @@ function vs() {
|
|
|
921
921
|
if (Wt)
|
|
922
922
|
r = "<remove></remove>" + r;
|
|
923
923
|
else {
|
|
924
|
-
const
|
|
925
|
-
f =
|
|
924
|
+
const G = Xn(r, /^[\r\n\t ]+/);
|
|
925
|
+
f = G && G[0];
|
|
926
926
|
}
|
|
927
|
-
dt === "application/xhtml+xml" &&
|
|
927
|
+
dt === "application/xhtml+xml" && Ve === we && (r = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + r + "</body></html>");
|
|
928
928
|
const P = z ? z.createHTML(r) : r;
|
|
929
|
-
if (
|
|
929
|
+
if (Ve === we)
|
|
930
930
|
try {
|
|
931
931
|
u = new m().parseFromString(P, dt);
|
|
932
932
|
} catch {
|
|
933
933
|
}
|
|
934
934
|
if (!u || !u.documentElement) {
|
|
935
|
-
u =
|
|
935
|
+
u = ce.createDocument(Ve, "template", null);
|
|
936
936
|
try {
|
|
937
|
-
u.documentElement.innerHTML = Zt ?
|
|
937
|
+
u.documentElement.innerHTML = Zt ? W : P;
|
|
938
938
|
} catch {
|
|
939
939
|
}
|
|
940
940
|
}
|
|
941
941
|
const D = u.body || u.documentElement;
|
|
942
|
-
return r && f && D.insertBefore(e.createTextNode(f), D.childNodes[0] || null),
|
|
942
|
+
return r && f && D.insertBefore(e.createTextNode(f), D.childNodes[0] || null), Ve === we ? ot.call(u, ve ? "html" : "body")[0] : ve ? u.documentElement : D;
|
|
943
943
|
}, "_initDocument"), On = /* @__PURE__ */ d(function(r) {
|
|
944
|
-
return
|
|
944
|
+
return ke.call(
|
|
945
945
|
r.ownerDocument || r,
|
|
946
946
|
r,
|
|
947
947
|
// eslint-disable-next-line no-bitwise
|
|
@@ -950,7 +950,7 @@ function vs() {
|
|
|
950
950
|
);
|
|
951
951
|
}, "_createNodeIterator"), Mn = /* @__PURE__ */ d(function(r) {
|
|
952
952
|
r.normalize();
|
|
953
|
-
const u =
|
|
953
|
+
const u = ke.call(
|
|
954
954
|
r.ownerDocument || r,
|
|
955
955
|
r,
|
|
956
956
|
// eslint-disable-next-line no-bitwise
|
|
@@ -960,13 +960,13 @@ function vs() {
|
|
|
960
960
|
let f = u.nextNode();
|
|
961
961
|
for (; f; ) {
|
|
962
962
|
let P = f.data;
|
|
963
|
-
|
|
964
|
-
P =
|
|
963
|
+
Qe([je, Me, pe], (D) => {
|
|
964
|
+
P = et(P, D, " ");
|
|
965
965
|
}), f.data = P, f = u.nextNode();
|
|
966
966
|
}
|
|
967
|
-
}, "_scrubTemplateExpressions"),
|
|
967
|
+
}, "_scrubTemplateExpressions"), It = /* @__PURE__ */ d(function(r) {
|
|
968
968
|
const u = B ? B(r) : null;
|
|
969
|
-
return typeof u != "string" ||
|
|
969
|
+
return typeof u != "string" || K(u) !== "form" ? !1 : typeof r.nodeName != "string" || typeof r.textContent != "string" || typeof r.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
|
|
970
970
|
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
971
971
|
// makes the direct read diverge from the cached read; a clean form
|
|
972
972
|
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
@@ -989,16 +989,16 @@ function vs() {
|
|
|
989
989
|
// select, etc.) regardless of whether the named child happens to
|
|
990
990
|
// carry a numeric .length, which a typeof-based probe would miss
|
|
991
991
|
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
992
|
-
r.childNodes !==
|
|
992
|
+
r.childNodes !== X(r);
|
|
993
993
|
}, "_isClobbered"), pt = /* @__PURE__ */ d(function(r) {
|
|
994
994
|
if (!R || typeof r != "object" || r === null)
|
|
995
995
|
return !1;
|
|
996
996
|
try {
|
|
997
|
-
return R(r) ===
|
|
997
|
+
return R(r) === Se.documentFragment;
|
|
998
998
|
} catch {
|
|
999
999
|
return !1;
|
|
1000
1000
|
}
|
|
1001
|
-
}, "_isDocumentFragment"),
|
|
1001
|
+
}, "_isDocumentFragment"), Ct = /* @__PURE__ */ d(function(r) {
|
|
1002
1002
|
if (!R || typeof r != "object" || r === null)
|
|
1003
1003
|
return !1;
|
|
1004
1004
|
try {
|
|
@@ -1007,61 +1007,61 @@ function vs() {
|
|
|
1007
1007
|
return !1;
|
|
1008
1008
|
}
|
|
1009
1009
|
}, "_isNode");
|
|
1010
|
-
function
|
|
1011
|
-
|
|
1012
|
-
f.call(t, r, u,
|
|
1010
|
+
function _e(b, r, u) {
|
|
1011
|
+
Qe(b, (f) => {
|
|
1012
|
+
f.call(t, r, u, Ze);
|
|
1013
1013
|
});
|
|
1014
1014
|
}
|
|
1015
|
-
d(
|
|
1015
|
+
d(_e, "_executeHooks");
|
|
1016
1016
|
const Nn = /* @__PURE__ */ d(function(r) {
|
|
1017
1017
|
let u = null;
|
|
1018
|
-
if (
|
|
1019
|
-
return
|
|
1020
|
-
const f =
|
|
1021
|
-
if (
|
|
1018
|
+
if (_e(Q.beforeSanitizeElements, r, null), It(r))
|
|
1019
|
+
return ge(r), !0;
|
|
1020
|
+
const f = K(r.nodeName);
|
|
1021
|
+
if (_e(Q.uponSanitizeElement, r, {
|
|
1022
1022
|
tagName: f,
|
|
1023
|
-
allowedTags:
|
|
1024
|
-
}),
|
|
1025
|
-
return
|
|
1026
|
-
if (
|
|
1027
|
-
if (!
|
|
1023
|
+
allowedTags: q
|
|
1024
|
+
}), ue && r.hasChildNodes() && !Ct(r.firstElementChild) && te(/<[/\w!]/g, r.innerHTML) && te(/<[/\w!]/g, r.textContent) || ue && r.namespaceURI === we && f === "style" && Ct(r.firstElementChild) || r.nodeType === Se.progressingInstruction || ue && r.nodeType === Se.comment && te(/<[/\w]/g, r.data))
|
|
1025
|
+
return ge(r), !0;
|
|
1026
|
+
if (Ne[f] || !(fe.tagCheck instanceof Function && fe.tagCheck(f)) && !q[f]) {
|
|
1027
|
+
if (!Ne[f] && $n(f) && (Y.tagNameCheck instanceof RegExp && te(Y.tagNameCheck, f) || Y.tagNameCheck instanceof Function && Y.tagNameCheck(f)))
|
|
1028
1028
|
return !1;
|
|
1029
|
-
if (qt && !
|
|
1030
|
-
const D =
|
|
1031
|
-
if (
|
|
1032
|
-
const he =
|
|
1033
|
-
for (let
|
|
1034
|
-
const
|
|
1035
|
-
D.insertBefore(
|
|
1029
|
+
if (qt && !ye[f]) {
|
|
1030
|
+
const D = oe(r), G = X(r);
|
|
1031
|
+
if (G && D) {
|
|
1032
|
+
const he = G.length;
|
|
1033
|
+
for (let Te = he - 1; Te >= 0; --Te) {
|
|
1034
|
+
const me = T(G[Te], !0);
|
|
1035
|
+
D.insertBefore(me, M(r));
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
return
|
|
1039
|
+
return ge(r), !0;
|
|
1040
1040
|
}
|
|
1041
|
-
return (R ? R(r) : r.nodeType) ===
|
|
1042
|
-
u =
|
|
1043
|
-
}), r.textContent !== u && (
|
|
1041
|
+
return (R ? R(r) : r.nodeType) === Se.element && !zs(r) || (f === "noscript" || f === "noembed" || f === "noframes") && te(/<\/no(script|embed|frames)/i, r.innerHTML) ? (ge(r), !0) : (H && r.nodeType === Se.text && (u = r.textContent, Qe([je, Me, pe], (D) => {
|
|
1042
|
+
u = et(u, D, " ");
|
|
1043
|
+
}), r.textContent !== u && (Je(t.removed, {
|
|
1044
1044
|
element: r.cloneNode()
|
|
1045
|
-
}), r.textContent = u)),
|
|
1045
|
+
}), r.textContent = u)), _e(Q.afterSanitizeElements, r, null), !1);
|
|
1046
1046
|
}, "_sanitizeElements"), zn = /* @__PURE__ */ d(function(r, u, f) {
|
|
1047
1047
|
if (ze[u] || Tn && (u === "id" || u === "name") && (f in e || f in Ns))
|
|
1048
1048
|
return !1;
|
|
1049
|
-
const P =
|
|
1050
|
-
if (!(
|
|
1051
|
-
if (!(
|
|
1049
|
+
const P = V[u] || fe.attributeCheck instanceof Function && fe.attributeCheck(u, r);
|
|
1050
|
+
if (!(g && !ze[u] && te(yt, u))) {
|
|
1051
|
+
if (!(A && te(I, u))) {
|
|
1052
1052
|
if (!P || ze[u]) {
|
|
1053
1053
|
if (
|
|
1054
1054
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1055
1055
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1056
1056
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
1057
|
-
!($n(r) && (
|
|
1057
|
+
!($n(r) && (Y.tagNameCheck instanceof RegExp && te(Y.tagNameCheck, r) || Y.tagNameCheck instanceof Function && Y.tagNameCheck(r)) && (Y.attributeNameCheck instanceof RegExp && te(Y.attributeNameCheck, u) || Y.attributeNameCheck instanceof Function && Y.attributeNameCheck(u, r)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
1058
1058
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1059
|
-
u === "is" &&
|
|
1059
|
+
u === "is" && Y.allowCustomizedBuiltInElements && (Y.tagNameCheck instanceof RegExp && te(Y.tagNameCheck, f) || Y.tagNameCheck instanceof Function && Y.tagNameCheck(f)))
|
|
1060
1060
|
) return !1;
|
|
1061
1061
|
} else if (!Vt[u]) {
|
|
1062
|
-
if (!te(
|
|
1062
|
+
if (!te(St, et(f, We, ""))) {
|
|
1063
1063
|
if (!((u === "src" || u === "xlink:href" || u === "href") && r !== "script" && Kn(f, "data:") === 0 && En[r])) {
|
|
1064
|
-
if (!(
|
|
1064
|
+
if (!(p && !te(wt, et(f, We, "")))) {
|
|
1065
1065
|
if (f)
|
|
1066
1066
|
return !1;
|
|
1067
1067
|
}
|
|
@@ -1072,51 +1072,51 @@ function vs() {
|
|
|
1072
1072
|
}
|
|
1073
1073
|
return !0;
|
|
1074
1074
|
}, "_isValidAttribute"), $s = _({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), $n = /* @__PURE__ */ d(function(r) {
|
|
1075
|
-
return !$s[bt(r)] && te(
|
|
1075
|
+
return !$s[bt(r)] && te(Tt, r);
|
|
1076
1076
|
}, "_isBasicCustomElement"), Pn = /* @__PURE__ */ d(function(r) {
|
|
1077
|
-
|
|
1077
|
+
_e(Q.beforeSanitizeAttributes, r, null);
|
|
1078
1078
|
const u = r.attributes;
|
|
1079
|
-
if (!u ||
|
|
1079
|
+
if (!u || It(r))
|
|
1080
1080
|
return;
|
|
1081
1081
|
const f = {
|
|
1082
1082
|
attrName: "",
|
|
1083
1083
|
attrValue: "",
|
|
1084
1084
|
keepAttr: !0,
|
|
1085
|
-
allowedAttributes:
|
|
1085
|
+
allowedAttributes: V,
|
|
1086
1086
|
forceKeepAttr: void 0
|
|
1087
1087
|
};
|
|
1088
1088
|
let P = u.length;
|
|
1089
1089
|
for (; P--; ) {
|
|
1090
|
-
const D = u[P],
|
|
1091
|
-
let ee =
|
|
1092
|
-
if (f.attrName =
|
|
1093
|
-
|
|
1090
|
+
const D = u[P], G = D.name, he = D.namespaceURI, Te = D.value, me = K(G), en = Te;
|
|
1091
|
+
let ee = G === "value" ? en : xi(en);
|
|
1092
|
+
if (f.attrName = me, f.attrValue = ee, f.keepAttr = !0, f.forceKeepAttr = void 0, _e(Q.uponSanitizeAttribute, r, f), ee = f.attrValue, Sn && (me === "id" || me === "name") && Kn(ee, An) !== 0 && (Pe(G, r), ee = An + ee), ue && te(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, ee)) {
|
|
1093
|
+
Pe(G, r);
|
|
1094
1094
|
continue;
|
|
1095
1095
|
}
|
|
1096
|
-
if (
|
|
1097
|
-
|
|
1096
|
+
if (me === "attributename" && Xn(ee, "href")) {
|
|
1097
|
+
Pe(G, r);
|
|
1098
1098
|
continue;
|
|
1099
1099
|
}
|
|
1100
1100
|
if (f.forceKeepAttr)
|
|
1101
1101
|
continue;
|
|
1102
1102
|
if (!f.keepAttr) {
|
|
1103
|
-
|
|
1103
|
+
Pe(G, r);
|
|
1104
1104
|
continue;
|
|
1105
1105
|
}
|
|
1106
|
-
if (!
|
|
1107
|
-
|
|
1106
|
+
if (!O && te(/\/>/i, ee)) {
|
|
1107
|
+
Pe(G, r);
|
|
1108
1108
|
continue;
|
|
1109
1109
|
}
|
|
1110
|
-
|
|
1111
|
-
ee =
|
|
1110
|
+
H && Qe([je, Me, pe], (Fn) => {
|
|
1111
|
+
ee = et(ee, Fn, " ");
|
|
1112
1112
|
});
|
|
1113
|
-
const Bn =
|
|
1114
|
-
if (!zn(Bn,
|
|
1115
|
-
|
|
1113
|
+
const Bn = K(r.nodeName);
|
|
1114
|
+
if (!zn(Bn, me, ee)) {
|
|
1115
|
+
Pe(G, r);
|
|
1116
1116
|
continue;
|
|
1117
1117
|
}
|
|
1118
1118
|
if (z && typeof x == "object" && typeof x.getAttributeType == "function" && !he)
|
|
1119
|
-
switch (x.getAttributeType(Bn,
|
|
1119
|
+
switch (x.getAttributeType(Bn, me)) {
|
|
1120
1120
|
case "TrustedHTML": {
|
|
1121
1121
|
ee = z.createHTML(ee);
|
|
1122
1122
|
break;
|
|
@@ -1128,109 +1128,109 @@ function vs() {
|
|
|
1128
1128
|
}
|
|
1129
1129
|
if (ee !== en)
|
|
1130
1130
|
try {
|
|
1131
|
-
he ? r.setAttributeNS(he,
|
|
1131
|
+
he ? r.setAttributeNS(he, G, ee) : r.setAttribute(G, ee), It(r) ? ge(r) : Zn(t.removed);
|
|
1132
1132
|
} catch {
|
|
1133
|
-
|
|
1133
|
+
Pe(G, r);
|
|
1134
1134
|
}
|
|
1135
1135
|
}
|
|
1136
|
-
|
|
1137
|
-
}, "_sanitizeAttributes"),
|
|
1136
|
+
_e(Q.afterSanitizeAttributes, r, null);
|
|
1137
|
+
}, "_sanitizeAttributes"), Dt = /* @__PURE__ */ d(function(r) {
|
|
1138
1138
|
let u = null;
|
|
1139
1139
|
const f = On(r);
|
|
1140
|
-
for (
|
|
1141
|
-
if (
|
|
1140
|
+
for (_e(Q.beforeSanitizeShadowDOM, r, null); u = f.nextNode(); )
|
|
1141
|
+
if (_e(Q.uponSanitizeShadowNode, u, null), Nn(u), Pn(u), pt(u.content) && Dt(u.content), (R ? R(u) : u.nodeType) === Se.element) {
|
|
1142
1142
|
const D = E ? E(u) : u.shadowRoot;
|
|
1143
|
-
pt(D) && (
|
|
1143
|
+
pt(D) && (Xe(D), Dt(D));
|
|
1144
1144
|
}
|
|
1145
|
-
|
|
1146
|
-
}, "_sanitizeShadowDOM"),
|
|
1145
|
+
_e(Q.afterSanitizeShadowDOM, r, null);
|
|
1146
|
+
}, "_sanitizeShadowDOM"), Xe = /* @__PURE__ */ d(function(r) {
|
|
1147
1147
|
const u = R ? R(r) : r.nodeType;
|
|
1148
|
-
if (u ===
|
|
1148
|
+
if (u === Se.element) {
|
|
1149
1149
|
const D = E ? E(r) : r.shadowRoot;
|
|
1150
|
-
pt(D) && (
|
|
1150
|
+
pt(D) && (Xe(D), Dt(D));
|
|
1151
1151
|
}
|
|
1152
|
-
const f =
|
|
1152
|
+
const f = X ? X(r) : r.childNodes;
|
|
1153
1153
|
if (!f)
|
|
1154
1154
|
return;
|
|
1155
1155
|
const P = [];
|
|
1156
|
-
|
|
1157
|
-
|
|
1156
|
+
Qe(f, (D) => {
|
|
1157
|
+
Je(P, D);
|
|
1158
1158
|
});
|
|
1159
1159
|
for (const D of P)
|
|
1160
|
-
|
|
1161
|
-
if (u ===
|
|
1160
|
+
Xe(D);
|
|
1161
|
+
if (u === Se.element) {
|
|
1162
1162
|
const D = B ? B(r) : null;
|
|
1163
|
-
if (typeof D == "string" &&
|
|
1164
|
-
const
|
|
1165
|
-
pt(
|
|
1163
|
+
if (typeof D == "string" && K(D) === "template") {
|
|
1164
|
+
const G = r.content;
|
|
1165
|
+
pt(G) && Xe(G);
|
|
1166
1166
|
}
|
|
1167
1167
|
}
|
|
1168
1168
|
}, "_sanitizeAttachedShadowRoots");
|
|
1169
1169
|
return t.sanitize = function(b) {
|
|
1170
1170
|
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, f = null, P = null, D = null;
|
|
1171
|
-
if (Zt = !b, Zt && (b = "<!-->"), typeof b != "string" && !
|
|
1171
|
+
if (Zt = !b, Zt && (b = "<!-->"), typeof b != "string" && !Ct(b) && (b = wi(b), typeof b != "string"))
|
|
1172
1172
|
throw mt("dirty is not a string, aborting");
|
|
1173
1173
|
if (!t.isSupported)
|
|
1174
1174
|
return b;
|
|
1175
|
-
if (
|
|
1176
|
-
const
|
|
1177
|
-
if (typeof
|
|
1178
|
-
const
|
|
1179
|
-
if (!
|
|
1175
|
+
if ($e || Jt(r), t.removed = [], typeof b == "string" && (ht = !1), ht) {
|
|
1176
|
+
const Te = B ? B(b) : b.nodeName;
|
|
1177
|
+
if (typeof Te == "string") {
|
|
1178
|
+
const me = K(Te);
|
|
1179
|
+
if (!q[me] || Ne[me])
|
|
1180
1180
|
throw mt("root node is forbidden and cannot be sanitized in-place");
|
|
1181
1181
|
}
|
|
1182
|
-
if (
|
|
1182
|
+
if (It(b))
|
|
1183
1183
|
throw mt("root node is clobbered and cannot be sanitized in-place");
|
|
1184
|
-
|
|
1185
|
-
} else if (
|
|
1186
|
-
u = Ln("<!---->"), f = u.ownerDocument.importNode(b, !0), f.nodeType ===
|
|
1184
|
+
Xe(b);
|
|
1185
|
+
} else if (Ct(b))
|
|
1186
|
+
u = Ln("<!---->"), f = u.ownerDocument.importNode(b, !0), f.nodeType === Se.element && f.nodeName === "BODY" || f.nodeName === "HTML" ? u = f : u.appendChild(f), Xe(f);
|
|
1187
1187
|
else {
|
|
1188
|
-
if (!
|
|
1188
|
+
if (!qe && !H && !ve && // eslint-disable-next-line unicorn/prefer-includes
|
|
1189
1189
|
b.indexOf("<") === -1)
|
|
1190
|
-
return z &&
|
|
1190
|
+
return z && Et ? z.createHTML(b) : b;
|
|
1191
1191
|
if (u = Ln(b), !u)
|
|
1192
|
-
return
|
|
1192
|
+
return qe ? null : Et ? W : "";
|
|
1193
1193
|
}
|
|
1194
|
-
u && Wt &&
|
|
1195
|
-
const
|
|
1196
|
-
for (; P =
|
|
1197
|
-
Nn(P), Pn(P), pt(P.content) &&
|
|
1194
|
+
u && Wt && ge(u.firstChild);
|
|
1195
|
+
const G = On(ht ? b : u);
|
|
1196
|
+
for (; P = G.nextNode(); )
|
|
1197
|
+
Nn(P), Pn(P), pt(P.content) && Dt(P.content);
|
|
1198
1198
|
if (ht)
|
|
1199
|
-
return
|
|
1200
|
-
if (
|
|
1201
|
-
if (
|
|
1202
|
-
for (D =
|
|
1199
|
+
return H && Mn(b), b;
|
|
1200
|
+
if (qe) {
|
|
1201
|
+
if (H && Mn(u), At)
|
|
1202
|
+
for (D = jt.call(u.ownerDocument); u.firstChild; )
|
|
1203
1203
|
D.appendChild(u.firstChild);
|
|
1204
1204
|
else
|
|
1205
1205
|
D = u;
|
|
1206
|
-
return (
|
|
1206
|
+
return (V.shadowroot || V.shadowrootmode) && (D = Ge.call(n, D, !0)), D;
|
|
1207
1207
|
}
|
|
1208
|
-
let he =
|
|
1209
|
-
return
|
|
1210
|
-
` + he),
|
|
1211
|
-
he =
|
|
1212
|
-
}), z &&
|
|
1208
|
+
let he = ve ? u.outerHTML : u.innerHTML;
|
|
1209
|
+
return ve && q["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && te(Oi, u.ownerDocument.doctype.name) && (he = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
|
|
1210
|
+
` + he), H && Qe([je, Me, pe], (Te) => {
|
|
1211
|
+
he = et(he, Te, " ");
|
|
1212
|
+
}), z && Et ? z.createHTML(he) : he;
|
|
1213
1213
|
}, t.setConfig = function() {
|
|
1214
1214
|
let b = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1215
|
-
Jt(b),
|
|
1215
|
+
Jt(b), $e = !0;
|
|
1216
1216
|
}, t.clearConfig = function() {
|
|
1217
|
-
|
|
1217
|
+
Ze = null, $e = !1;
|
|
1218
1218
|
}, t.isValidAttribute = function(b, r, u) {
|
|
1219
|
-
|
|
1220
|
-
const f =
|
|
1219
|
+
Ze || Jt({});
|
|
1220
|
+
const f = K(b), P = K(r);
|
|
1221
1221
|
return zn(f, P, u);
|
|
1222
1222
|
}, t.addHook = function(b, r) {
|
|
1223
|
-
typeof r == "function" &&
|
|
1223
|
+
typeof r == "function" && Je(Q[b], r);
|
|
1224
1224
|
}, t.removeHook = function(b, r) {
|
|
1225
1225
|
if (r !== void 0) {
|
|
1226
|
-
const u = gi(
|
|
1227
|
-
return u === -1 ? void 0 : mi(
|
|
1226
|
+
const u = gi(Q[b], r);
|
|
1227
|
+
return u === -1 ? void 0 : mi(Q[b], u, 1)[0];
|
|
1228
1228
|
}
|
|
1229
|
-
return Zn(
|
|
1229
|
+
return Zn(Q[b]);
|
|
1230
1230
|
}, t.removeHooks = function(b) {
|
|
1231
|
-
|
|
1231
|
+
Q[b] = [];
|
|
1232
1232
|
}, t.removeAllHooks = function() {
|
|
1233
|
-
|
|
1233
|
+
Q = as();
|
|
1234
1234
|
}, t;
|
|
1235
1235
|
}
|
|
1236
1236
|
d(vs, "createDOMPurify");
|
|
@@ -1239,20 +1239,20 @@ function pn() {
|
|
|
1239
1239
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
1240
1240
|
}
|
|
1241
1241
|
d(pn, "M");
|
|
1242
|
-
var
|
|
1242
|
+
var He = pn();
|
|
1243
1243
|
function ys(a) {
|
|
1244
|
-
|
|
1244
|
+
He = a;
|
|
1245
1245
|
}
|
|
1246
1246
|
d(ys, "N");
|
|
1247
|
-
var
|
|
1248
|
-
function
|
|
1247
|
+
var Fe = { exec: /* @__PURE__ */ d(() => null, "exec") };
|
|
1248
|
+
function tt(a) {
|
|
1249
1249
|
let t = [];
|
|
1250
1250
|
return (e) => {
|
|
1251
1251
|
let n = Math.max(0, Math.min(3, e - 1)), i = t[n];
|
|
1252
1252
|
return i || (i = a(n), t[n] = i), i;
|
|
1253
1253
|
};
|
|
1254
1254
|
}
|
|
1255
|
-
d(
|
|
1255
|
+
d(tt, "E");
|
|
1256
1256
|
function N(a, t = "") {
|
|
1257
1257
|
let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ d((i, s) => {
|
|
1258
1258
|
let l = typeof s == "string" ? s : s.source;
|
|
@@ -1267,15 +1267,15 @@ var Pi = ((a = "") => {
|
|
|
1267
1267
|
} catch {
|
|
1268
1268
|
return !1;
|
|
1269
1269
|
}
|
|
1270
|
-
})(), ie = { 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, 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, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ d((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex:
|
|
1271
|
-
]`).replace("lheading", Ts).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ki = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Qi = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, As = /^( {2,}|\\)\n(?!\s*$)/, Ji = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
|
|
1272
|
-
function
|
|
1270
|
+
})(), ie = { 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, 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, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ d((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: tt((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: tt((a) => new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: tt((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: tt((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: tt((a) => new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: tt((a) => new RegExp(`^ {0,${a}}>`)) }, Bi = /^(?:[ \t]*(?:\n|$))+/, Fi = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ui = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, vt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Hi = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, fn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ws = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ts = N(ws).replace(/bull/g, fn).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(), Gi = N(ws).replace(/bull/g, fn).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(), gn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, ji = /^[^\n]+/, mn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Wi = N(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", mn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), qi = N(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, fn).getRegex(), Ht = "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", xn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Yi = N("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", xn).replace("tag", Ht).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Ss = N(gn).replace("hr", vt).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[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ht).getRegex(), Vi = N(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ss).getRegex(), bn = { blockquote: Vi, code: Fi, def: Wi, fences: Ui, heading: Hi, hr: vt, html: Yi, lheading: Ts, list: qi, newline: Bi, paragraph: Ss, table: Fe, text: ji }, rs = N("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", vt).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[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ht).getRegex(), Zi = { ...bn, lheading: Gi, table: rs, paragraph: N(gn).replace("hr", vt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", rs).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ht).getRegex() }, Xi = { ...bn, html: N(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", xn).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: Fe, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: N(gn).replace("hr", vt).replace("heading", ` *#{1,6} *[^
|
|
1271
|
+
]`).replace("lheading", Ts).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ki = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Qi = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, As = /^( {2,}|\\)\n(?!\s*$)/, Ji = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, lt = /[\p{P}\p{S}]/u, Gt = /[\s\p{P}\p{S}]/u, kn = /[^\s\p{P}\p{S}]/u, ea = N(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Gt).getRegex(), Es = /(?!~)[\p{P}\p{S}]/u, ta = /(?!~)[\s\p{P}\p{S}]/u, na = /(?:[^\s\p{P}\p{S}]|~)/u, sa = N(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Pi ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), _s = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ia = N(_s, "u").replace(/punct/g, lt).getRegex(), aa = N(_s, "u").replace(/punct/g, Es).getRegex(), Rs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ra = N(Rs, "gu").replace(/notPunctSpace/g, kn).replace(/punctSpace/g, Gt).replace(/punct/g, lt).getRegex(), la = N(Rs, "gu").replace(/notPunctSpace/g, na).replace(/punctSpace/g, ta).replace(/punct/g, Es).getRegex(), oa = N("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, kn).replace(/punctSpace/g, Gt).replace(/punct/g, lt).getRegex(), ca = N(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, lt).getRegex(), ua = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", ha = N(ua, "gu").replace(/notPunctSpace/g, kn).replace(/punctSpace/g, Gt).replace(/punct/g, lt).getRegex(), da = N(/\\(punct)/, "gu").replace(/punct/g, lt).getRegex(), pa = N(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), fa = N(xn).replace("(?:-->|$)", "-->").getRegex(), ga = N("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", fa).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Pt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, ma = N(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Pt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Is = N(/^!?\[(label)\]\[(ref)\]/).replace("label", Pt).replace("ref", mn).getRegex(), Cs = N(/^!?\[(ref)\](?:\[\])?/).replace("ref", mn).getRegex(), xa = N("reflink|nolink(?!\\()", "g").replace("reflink", Is).replace("nolink", Cs).getRegex(), ls = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, vn = { _backpedal: Fe, anyPunctuation: da, autolink: pa, blockSkip: sa, br: As, code: Qi, del: Fe, delLDelim: Fe, delRDelim: Fe, emStrongLDelim: ia, emStrongRDelimAst: ra, emStrongRDelimUnd: oa, escape: Ki, link: ma, nolink: Cs, punctuation: ea, reflink: Is, reflinkSearch: xa, tag: ga, text: Ji, url: Fe }, ba = { ...vn, link: N(/^!?\[(label)\]\((.*?)\)/).replace("label", Pt).getRegex(), reflink: N(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Pt).getRegex() }, hn = { ...vn, emStrongRDelimAst: la, emStrongLDelim: aa, delLDelim: ca, delRDelim: ha, url: N(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ls).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: N(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ls).getRegex() }, ka = { ...hn, br: N(As).replace("{2,}", "*").getRegex(), text: N(hn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, Mt = { normal: bn, gfm: Zi, pedantic: Xi }, xt = { normal: vn, gfm: hn, breaks: ka, pedantic: ba }, va = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, os = /* @__PURE__ */ d((a) => va[a], "ge");
|
|
1272
|
+
function Ee(a, t) {
|
|
1273
1273
|
if (t) {
|
|
1274
1274
|
if (ie.escapeTest.test(a)) return a.replace(ie.escapeReplace, os);
|
|
1275
1275
|
} else if (ie.escapeTestNoEncode.test(a)) return a.replace(ie.escapeReplaceNoEncode, os);
|
|
1276
1276
|
return a;
|
|
1277
1277
|
}
|
|
1278
|
-
d(
|
|
1278
|
+
d(Ee, "O");
|
|
1279
1279
|
function cs(a) {
|
|
1280
1280
|
try {
|
|
1281
1281
|
a = encodeURI(a).replace(ie.percentDecode, "%");
|
|
@@ -1297,7 +1297,7 @@ function us(a, t) {
|
|
|
1297
1297
|
return n;
|
|
1298
1298
|
}
|
|
1299
1299
|
d(us, "Y");
|
|
1300
|
-
function
|
|
1300
|
+
function Ie(a, t, e) {
|
|
1301
1301
|
let n = a.length;
|
|
1302
1302
|
if (n === 0) return "";
|
|
1303
1303
|
let i = 0;
|
|
@@ -1305,7 +1305,7 @@ function Ce(a, t, e) {
|
|
|
1305
1305
|
i++;
|
|
1306
1306
|
return a.slice(0, n - i);
|
|
1307
1307
|
}
|
|
1308
|
-
d(
|
|
1308
|
+
d(Ie, "$");
|
|
1309
1309
|
function hs(a) {
|
|
1310
1310
|
let t = a.split(`
|
|
1311
1311
|
`), e = t.length - 1;
|
|
@@ -1353,12 +1353,12 @@ function Ta(a, t, e) {
|
|
|
1353
1353
|
`);
|
|
1354
1354
|
}
|
|
1355
1355
|
d(Ta, "st");
|
|
1356
|
-
var
|
|
1356
|
+
var st, Bt = (st = class {
|
|
1357
1357
|
constructor(t) {
|
|
1358
1358
|
C(this, "options");
|
|
1359
1359
|
C(this, "rules");
|
|
1360
1360
|
C(this, "lexer");
|
|
1361
|
-
this.options = t ||
|
|
1361
|
+
this.options = t || He;
|
|
1362
1362
|
}
|
|
1363
1363
|
space(t) {
|
|
1364
1364
|
let e = this.rules.block.newline.exec(t);
|
|
@@ -1383,22 +1383,22 @@ var tt, $t = (tt = class {
|
|
|
1383
1383
|
if (e) {
|
|
1384
1384
|
let n = e[2].trim();
|
|
1385
1385
|
if (this.rules.other.endingHash.test(n)) {
|
|
1386
|
-
let i =
|
|
1386
|
+
let i = Ie(n, "#");
|
|
1387
1387
|
(this.options.pedantic || !i || this.rules.other.endingSpaceChar.test(i)) && (n = i.trim());
|
|
1388
1388
|
}
|
|
1389
|
-
return { type: "heading", raw:
|
|
1389
|
+
return { type: "heading", raw: Ie(e[0], `
|
|
1390
1390
|
`), depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
1391
1391
|
}
|
|
1392
1392
|
}
|
|
1393
1393
|
hr(t) {
|
|
1394
1394
|
let e = this.rules.block.hr.exec(t);
|
|
1395
|
-
if (e) return { type: "hr", raw:
|
|
1395
|
+
if (e) return { type: "hr", raw: Ie(e[0], `
|
|
1396
1396
|
`) };
|
|
1397
1397
|
}
|
|
1398
1398
|
blockquote(t) {
|
|
1399
1399
|
let e = this.rules.block.blockquote.exec(t);
|
|
1400
1400
|
if (e) {
|
|
1401
|
-
let n =
|
|
1401
|
+
let n = Ie(e[0], `
|
|
1402
1402
|
`).split(`
|
|
1403
1403
|
`), i = "", s = "", l = [];
|
|
1404
1404
|
for (; n.length > 0; ) {
|
|
@@ -1415,19 +1415,19 @@ ${m}` : m, s = s ? `${s}
|
|
|
1415
1415
|
${x}` : x;
|
|
1416
1416
|
let k = this.lexer.state.top;
|
|
1417
1417
|
if (this.lexer.state.top = !0, this.lexer.blockTokens(x, l, !0), this.lexer.state.top = k, n.length === 0) break;
|
|
1418
|
-
let
|
|
1419
|
-
if (
|
|
1420
|
-
if (
|
|
1421
|
-
let
|
|
1418
|
+
let T = l.at(-1);
|
|
1419
|
+
if (T?.type === "code") break;
|
|
1420
|
+
if (T?.type === "blockquote") {
|
|
1421
|
+
let U = T, M = U.raw + `
|
|
1422
1422
|
` + n.join(`
|
|
1423
|
-
`),
|
|
1424
|
-
l[l.length - 1] =
|
|
1423
|
+
`), X = this.blockquote(M);
|
|
1424
|
+
l[l.length - 1] = X, i = i.substring(0, i.length - U.raw.length) + X.raw, s = s.substring(0, s.length - U.text.length) + X.text;
|
|
1425
1425
|
break;
|
|
1426
|
-
} else if (
|
|
1427
|
-
let
|
|
1426
|
+
} else if (T?.type === "list") {
|
|
1427
|
+
let U = T, M = U.raw + `
|
|
1428
1428
|
` + n.join(`
|
|
1429
|
-
`),
|
|
1430
|
-
l[l.length - 1] =
|
|
1429
|
+
`), X = this.list(M);
|
|
1430
|
+
l[l.length - 1] = X, i = i.substring(0, i.length - T.raw.length) + X.raw, s = s.substring(0, s.length - U.raw.length) + X.raw, n = M.substring(l.at(-1).raw.length).split(`
|
|
1431
1431
|
`);
|
|
1432
1432
|
continue;
|
|
1433
1433
|
}
|
|
@@ -1446,24 +1446,24 @@ ${x}` : x;
|
|
|
1446
1446
|
if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
1447
1447
|
m = e[0], t = t.substring(m.length);
|
|
1448
1448
|
let k = wa(e[2].split(`
|
|
1449
|
-
`, 1)[0], e[1].length),
|
|
1450
|
-
`, 1)[0],
|
|
1451
|
-
if (this.options.pedantic ? (M = 2, x = k.trimStart()) :
|
|
1452
|
-
`, t = t.substring(
|
|
1453
|
-
let
|
|
1449
|
+
`, 1)[0], e[1].length), T = t.split(`
|
|
1450
|
+
`, 1)[0], U = !k.trim(), M = 0;
|
|
1451
|
+
if (this.options.pedantic ? (M = 2, x = k.trimStart()) : U ? M = e[1].length + 1 : (M = k.search(this.rules.other.nonSpaceChar), M = M > 4 ? 1 : M, x = k.slice(M), M += e[1].length), U && this.rules.other.blankLine.test(T) && (m += T + `
|
|
1452
|
+
`, t = t.substring(T.length + 1), c = !0), !c) {
|
|
1453
|
+
let X = this.rules.other.nextBulletRegex(M), oe = this.rules.other.hrRegex(M), E = this.rules.other.fencesBeginRegex(M), L = this.rules.other.headingBeginRegex(M), R = this.rules.other.htmlBeginRegex(M), B = this.rules.other.blockquoteBeginRegex(M);
|
|
1454
1454
|
for (; t; ) {
|
|
1455
1455
|
let z = t.split(`
|
|
1456
|
-
`, 1)[0],
|
|
1457
|
-
if (
|
|
1458
|
-
if (
|
|
1459
|
-
` +
|
|
1456
|
+
`, 1)[0], W;
|
|
1457
|
+
if (T = z, this.options.pedantic ? (T = T.replace(this.rules.other.listReplaceNesting, " "), W = T) : W = T.replace(this.rules.other.tabCharGlobal, " "), E.test(T) || L.test(T) || R.test(T) || B.test(T) || X.test(T) || oe.test(T)) break;
|
|
1458
|
+
if (W.search(this.rules.other.nonSpaceChar) >= M || !T.trim()) x += `
|
|
1459
|
+
` + W.slice(M);
|
|
1460
1460
|
else {
|
|
1461
|
-
if (
|
|
1461
|
+
if (U || k.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || E.test(k) || L.test(k) || oe.test(k)) break;
|
|
1462
1462
|
x += `
|
|
1463
|
-
` +
|
|
1463
|
+
` + T;
|
|
1464
1464
|
}
|
|
1465
|
-
|
|
1466
|
-
`, t = t.substring(z.length + 1), k =
|
|
1465
|
+
U = !T.trim(), m += z + `
|
|
1466
|
+
`, t = t.substring(z.length + 1), k = W.slice(M);
|
|
1467
1467
|
}
|
|
1468
1468
|
}
|
|
1469
1469
|
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(m) && (o = !0)), s.items.push({ type: "list_item", raw: m, task: !!this.options.gfm && this.rules.other.listIsTask.test(x), loose: !1, text: x, tokens: [] }), s.raw += m;
|
|
@@ -1488,7 +1488,7 @@ ${x}` : x;
|
|
|
1488
1488
|
}
|
|
1489
1489
|
} else c.task && (c.task = !1);
|
|
1490
1490
|
if (!s.loose) {
|
|
1491
|
-
let x = c.tokens.filter((
|
|
1491
|
+
let x = c.tokens.filter((T) => T.type === "space"), k = x.length > 0 && x.some((T) => this.rules.other.anyLine.test(T.raw));
|
|
1492
1492
|
s.loose = k;
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
@@ -1510,7 +1510,7 @@ ${x}` : x;
|
|
|
1510
1510
|
let e = this.rules.block.def.exec(t);
|
|
1511
1511
|
if (e) {
|
|
1512
1512
|
let n = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), i = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
|
|
1513
|
-
return { type: "def", tag: n, raw:
|
|
1513
|
+
return { type: "def", tag: n, raw: Ie(e[0], `
|
|
1514
1514
|
`), href: i, title: s };
|
|
1515
1515
|
}
|
|
1516
1516
|
}
|
|
@@ -1518,7 +1518,7 @@ ${x}` : x;
|
|
|
1518
1518
|
let e = this.rules.block.table.exec(t);
|
|
1519
1519
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
1520
1520
|
let n = us(e[1]), i = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
1521
|
-
`) : [], l = { type: "table", raw:
|
|
1521
|
+
`) : [], l = { type: "table", raw: Ie(e[0], `
|
|
1522
1522
|
`), header: [], align: [], rows: [] };
|
|
1523
1523
|
if (n.length === i.length) {
|
|
1524
1524
|
for (let o of i) this.rules.other.tableAlignRight.test(o) ? l.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? l.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? l.align.push("left") : l.align.push(null);
|
|
@@ -1531,7 +1531,7 @@ ${x}` : x;
|
|
|
1531
1531
|
let e = this.rules.block.lheading.exec(t);
|
|
1532
1532
|
if (e) {
|
|
1533
1533
|
let n = e[1].trim();
|
|
1534
|
-
return { type: "heading", raw:
|
|
1534
|
+
return { type: "heading", raw: Ie(e[0], `
|
|
1535
1535
|
`), depth: e[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
@@ -1561,7 +1561,7 @@ ${x}` : x;
|
|
|
1561
1561
|
let n = e[2].trim();
|
|
1562
1562
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
1563
1563
|
if (!this.rules.other.endAngleBracket.test(n)) return;
|
|
1564
|
-
let l =
|
|
1564
|
+
let l = Ie(n.slice(0, -1), "\\");
|
|
1565
1565
|
if ((n.length - l.length) % 2 === 0) return;
|
|
1566
1566
|
} else {
|
|
1567
1567
|
let l = ya(e[2], "()");
|
|
@@ -1607,11 +1607,11 @@ ${x}` : x;
|
|
|
1607
1607
|
o = Math.min(o, o + h + c);
|
|
1608
1608
|
let x = [...i[0]][0].length, k = t.slice(0, s + i.index + x + o);
|
|
1609
1609
|
if (Math.min(s, o) % 2) {
|
|
1610
|
-
let
|
|
1611
|
-
return { type: "em", raw: k, text:
|
|
1610
|
+
let U = k.slice(1, -1);
|
|
1611
|
+
return { type: "em", raw: k, text: U, tokens: this.lexer.inlineTokens(U) };
|
|
1612
1612
|
}
|
|
1613
|
-
let
|
|
1614
|
-
return { type: "strong", raw: k, text:
|
|
1613
|
+
let T = k.slice(2, -2);
|
|
1614
|
+
return { type: "strong", raw: k, text: T, tokens: this.lexer.inlineTokens(T) };
|
|
1615
1615
|
}
|
|
1616
1616
|
}
|
|
1617
1617
|
}
|
|
@@ -1672,25 +1672,25 @@ ${x}` : x;
|
|
|
1672
1672
|
return { type: "text", raw: e[0], text: e[0], escaped: n };
|
|
1673
1673
|
}
|
|
1674
1674
|
}
|
|
1675
|
-
}, d(
|
|
1675
|
+
}, d(st, "w"), st), De, xe = (De = class {
|
|
1676
1676
|
constructor(t) {
|
|
1677
1677
|
C(this, "tokens");
|
|
1678
1678
|
C(this, "options");
|
|
1679
1679
|
C(this, "state");
|
|
1680
1680
|
C(this, "inlineQueue");
|
|
1681
1681
|
C(this, "tokenizer");
|
|
1682
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t ||
|
|
1683
|
-
let e = { other: ie, block:
|
|
1684
|
-
this.options.pedantic ? (e.block =
|
|
1682
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || He, this.options.tokenizer = this.options.tokenizer || new Bt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
1683
|
+
let e = { other: ie, block: Mt.normal, inline: xt.normal };
|
|
1684
|
+
this.options.pedantic ? (e.block = Mt.pedantic, e.inline = xt.pedantic) : this.options.gfm && (e.block = Mt.gfm, this.options.breaks ? e.inline = xt.breaks : e.inline = xt.gfm), this.tokenizer.rules = e;
|
|
1685
1685
|
}
|
|
1686
1686
|
static get rules() {
|
|
1687
|
-
return { block:
|
|
1687
|
+
return { block: Mt, inline: xt };
|
|
1688
1688
|
}
|
|
1689
1689
|
static lex(t, e) {
|
|
1690
|
-
return new
|
|
1690
|
+
return new De(e).lex(t);
|
|
1691
1691
|
}
|
|
1692
1692
|
static lexInline(t, e) {
|
|
1693
|
-
return new
|
|
1693
|
+
return new De(e).inlineTokens(t);
|
|
1694
1694
|
}
|
|
1695
1695
|
lex(t) {
|
|
1696
1696
|
t = t.replace(ie.carriageReturn, `
|
|
@@ -1868,9 +1868,9 @@ ${x}` : x;
|
|
|
1868
1868
|
}
|
|
1869
1869
|
let m = t;
|
|
1870
1870
|
if (this.options.extensions?.startInline) {
|
|
1871
|
-
let x = 1 / 0, k = t.slice(1),
|
|
1872
|
-
this.options.extensions.startInline.forEach((
|
|
1873
|
-
|
|
1871
|
+
let x = 1 / 0, k = t.slice(1), T;
|
|
1872
|
+
this.options.extensions.startInline.forEach((U) => {
|
|
1873
|
+
T = U.call({ lexer: this }, k), typeof T == "number" && T >= 0 && (x = Math.min(x, T));
|
|
1874
1874
|
}), x < 1 / 0 && x >= 0 && (m = t.substring(0, x + 1));
|
|
1875
1875
|
}
|
|
1876
1876
|
if (c = this.tokenizer.inlineText(m)) {
|
|
@@ -1891,11 +1891,11 @@ ${x}` : x;
|
|
|
1891
1891
|
if (this.options.silent) console.error(e);
|
|
1892
1892
|
else throw new Error(e);
|
|
1893
1893
|
}
|
|
1894
|
-
}, d(
|
|
1894
|
+
}, d(De, "l"), De), it, Ft = (it = class {
|
|
1895
1895
|
constructor(t) {
|
|
1896
1896
|
C(this, "options");
|
|
1897
1897
|
C(this, "parser");
|
|
1898
|
-
this.options = t ||
|
|
1898
|
+
this.options = t || He;
|
|
1899
1899
|
}
|
|
1900
1900
|
space(t) {
|
|
1901
1901
|
return "";
|
|
@@ -1903,8 +1903,8 @@ ${x}` : x;
|
|
|
1903
1903
|
code({ text: t, lang: e, escaped: n }) {
|
|
1904
1904
|
let i = (e || "").match(ie.notSpaceStart)?.[0], s = t.replace(ie.endingNewline, "") + `
|
|
1905
1905
|
`;
|
|
1906
|
-
return i ? '<pre><code class="language-' +
|
|
1907
|
-
` : "<pre><code>" + (n ? s :
|
|
1906
|
+
return i ? '<pre><code class="language-' + Ee(i) + '">' + (n ? s : Ee(s, !0)) + `</code></pre>
|
|
1907
|
+
` : "<pre><code>" + (n ? s : Ee(s, !0)) + `</code></pre>
|
|
1908
1908
|
`;
|
|
1909
1909
|
}
|
|
1910
1910
|
blockquote({ tokens: t }) {
|
|
@@ -1982,7 +1982,7 @@ ${t}</tr>
|
|
|
1982
1982
|
return `<em>${this.parser.parseInline(t)}</em>`;
|
|
1983
1983
|
}
|
|
1984
1984
|
codespan({ text: t }) {
|
|
1985
|
-
return `<code>${
|
|
1985
|
+
return `<code>${Ee(t, !0)}</code>`;
|
|
1986
1986
|
}
|
|
1987
1987
|
br(t) {
|
|
1988
1988
|
return "<br>";
|
|
@@ -1995,20 +1995,20 @@ ${t}</tr>
|
|
|
1995
1995
|
if (s === null) return i;
|
|
1996
1996
|
t = s;
|
|
1997
1997
|
let l = '<a href="' + t + '"';
|
|
1998
|
-
return e && (l += ' title="' +
|
|
1998
|
+
return e && (l += ' title="' + Ee(e) + '"'), l += ">" + i + "</a>", l;
|
|
1999
1999
|
}
|
|
2000
2000
|
image({ href: t, title: e, text: n, tokens: i }) {
|
|
2001
2001
|
i && (n = this.parser.parseInline(i, this.parser.textRenderer));
|
|
2002
2002
|
let s = cs(t);
|
|
2003
|
-
if (s === null) return
|
|
2003
|
+
if (s === null) return Ee(n);
|
|
2004
2004
|
t = s;
|
|
2005
|
-
let l = `<img src="${t}" alt="${
|
|
2006
|
-
return e && (l += ` title="${
|
|
2005
|
+
let l = `<img src="${t}" alt="${Ee(n)}"`;
|
|
2006
|
+
return e && (l += ` title="${Ee(e)}"`), l += ">", l;
|
|
2007
2007
|
}
|
|
2008
2008
|
text(t) {
|
|
2009
|
-
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text :
|
|
2009
|
+
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : Ee(t.text);
|
|
2010
2010
|
}
|
|
2011
|
-
}, d(
|
|
2011
|
+
}, d(it, "y"), it), at, yn = (at = class {
|
|
2012
2012
|
strong({ text: t }) {
|
|
2013
2013
|
return t;
|
|
2014
2014
|
}
|
|
@@ -2039,18 +2039,18 @@ ${t}</tr>
|
|
|
2039
2039
|
checkbox({ raw: t }) {
|
|
2040
2040
|
return t;
|
|
2041
2041
|
}
|
|
2042
|
-
}, d(
|
|
2042
|
+
}, d(at, "L"), at), Le, be = (Le = class {
|
|
2043
2043
|
constructor(t) {
|
|
2044
2044
|
C(this, "options");
|
|
2045
2045
|
C(this, "renderer");
|
|
2046
2046
|
C(this, "textRenderer");
|
|
2047
|
-
this.options = t ||
|
|
2047
|
+
this.options = t || He, this.options.renderer = this.options.renderer || new Ft(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new yn();
|
|
2048
2048
|
}
|
|
2049
2049
|
static parse(t, e) {
|
|
2050
|
-
return new
|
|
2050
|
+
return new Le(e).parse(t);
|
|
2051
2051
|
}
|
|
2052
2052
|
static parseInline(t, e) {
|
|
2053
|
-
return new
|
|
2053
|
+
return new Le(e).parseInline(t);
|
|
2054
2054
|
}
|
|
2055
2055
|
parse(t) {
|
|
2056
2056
|
this.renderer.parser = this;
|
|
@@ -2190,11 +2190,11 @@ ${t}</tr>
|
|
|
2190
2190
|
}
|
|
2191
2191
|
return n;
|
|
2192
2192
|
}
|
|
2193
|
-
}, d(
|
|
2193
|
+
}, d(Le, "l"), Le), Ce, kt = (Ce = class {
|
|
2194
2194
|
constructor(t) {
|
|
2195
2195
|
C(this, "options");
|
|
2196
2196
|
C(this, "block");
|
|
2197
|
-
this.options = t ||
|
|
2197
|
+
this.options = t || He;
|
|
2198
2198
|
}
|
|
2199
2199
|
preprocess(t) {
|
|
2200
2200
|
return t;
|
|
@@ -2209,22 +2209,22 @@ ${t}</tr>
|
|
|
2209
2209
|
return t;
|
|
2210
2210
|
}
|
|
2211
2211
|
provideLexer(t = this.block) {
|
|
2212
|
-
return t ?
|
|
2212
|
+
return t ? xe.lex : xe.lexInline;
|
|
2213
2213
|
}
|
|
2214
2214
|
provideParser(t = this.block) {
|
|
2215
|
-
return t ?
|
|
2215
|
+
return t ? be.parse : be.parseInline;
|
|
2216
2216
|
}
|
|
2217
|
-
}, d(
|
|
2217
|
+
}, d(Ce, "P"), C(Ce, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), C(Ce, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Ce), rt, Sa = (rt = class {
|
|
2218
2218
|
constructor(...t) {
|
|
2219
2219
|
C(this, "defaults", pn());
|
|
2220
2220
|
C(this, "options", this.setOptions);
|
|
2221
2221
|
C(this, "parse", this.parseMarkdown(!0));
|
|
2222
2222
|
C(this, "parseInline", this.parseMarkdown(!1));
|
|
2223
|
-
C(this, "Parser",
|
|
2224
|
-
C(this, "Renderer",
|
|
2223
|
+
C(this, "Parser", be);
|
|
2224
|
+
C(this, "Renderer", Ft);
|
|
2225
2225
|
C(this, "TextRenderer", yn);
|
|
2226
|
-
C(this, "Lexer",
|
|
2227
|
-
C(this, "Tokenizer",
|
|
2226
|
+
C(this, "Lexer", xe);
|
|
2227
|
+
C(this, "Tokenizer", Bt);
|
|
2228
2228
|
C(this, "Hooks", kt);
|
|
2229
2229
|
this.use(...t);
|
|
2230
2230
|
}
|
|
@@ -2272,7 +2272,7 @@ ${t}</tr>
|
|
|
2272
2272
|
}
|
|
2273
2273
|
"childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
|
|
2274
2274
|
}), i.extensions = e), n.renderer) {
|
|
2275
|
-
let s = this.defaults.renderer || new
|
|
2275
|
+
let s = this.defaults.renderer || new Ft(this.defaults);
|
|
2276
2276
|
for (let l in n.renderer) {
|
|
2277
2277
|
if (!(l in s)) throw new Error(`renderer '${l}' does not exist`);
|
|
2278
2278
|
if (["options", "parser"].includes(l)) continue;
|
|
@@ -2285,7 +2285,7 @@ ${t}</tr>
|
|
|
2285
2285
|
i.renderer = s;
|
|
2286
2286
|
}
|
|
2287
2287
|
if (n.tokenizer) {
|
|
2288
|
-
let s = this.defaults.tokenizer || new
|
|
2288
|
+
let s = this.defaults.tokenizer || new Bt(this.defaults);
|
|
2289
2289
|
for (let l in n.tokenizer) {
|
|
2290
2290
|
if (!(l in s)) throw new Error(`tokenizer '${l}' does not exist`);
|
|
2291
2291
|
if (["options", "rules", "lexer"].includes(l)) continue;
|
|
@@ -2335,10 +2335,10 @@ ${t}</tr>
|
|
|
2335
2335
|
return this.defaults = { ...this.defaults, ...t }, this;
|
|
2336
2336
|
}
|
|
2337
2337
|
lexer(t, e) {
|
|
2338
|
-
return
|
|
2338
|
+
return xe.lex(t, e ?? this.defaults);
|
|
2339
2339
|
}
|
|
2340
2340
|
parser(t, e) {
|
|
2341
|
-
return
|
|
2341
|
+
return be.parse(t, e ?? this.defaults);
|
|
2342
2342
|
}
|
|
2343
2343
|
parseMarkdown(t) {
|
|
2344
2344
|
return (e, n) => {
|
|
@@ -2347,16 +2347,16 @@ ${t}</tr>
|
|
|
2347
2347
|
if (typeof e > "u" || e === null) return l(new Error("marked(): input parameter is undefined or null"));
|
|
2348
2348
|
if (typeof e != "string") return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
|
|
2349
2349
|
if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
|
|
2350
|
-
let o = s.hooks ? await s.hooks.preprocess(e) : e, h = await (s.hooks ? await s.hooks.provideLexer(t) : t ?
|
|
2350
|
+
let o = s.hooks ? await s.hooks.preprocess(e) : e, h = await (s.hooks ? await s.hooks.provideLexer(t) : t ? xe.lex : xe.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(h) : h;
|
|
2351
2351
|
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
2352
|
-
let m = await (s.hooks ? await s.hooks.provideParser(t) : t ?
|
|
2352
|
+
let m = await (s.hooks ? await s.hooks.provideParser(t) : t ? be.parse : be.parseInline)(c, s);
|
|
2353
2353
|
return s.hooks ? await s.hooks.postprocess(m) : m;
|
|
2354
2354
|
})().catch(l);
|
|
2355
2355
|
try {
|
|
2356
2356
|
s.hooks && (e = s.hooks.preprocess(e));
|
|
2357
|
-
let o = (s.hooks ? s.hooks.provideLexer(t) : t ?
|
|
2357
|
+
let o = (s.hooks ? s.hooks.provideLexer(t) : t ? xe.lex : xe.lexInline)(e, s);
|
|
2358
2358
|
s.hooks && (o = s.hooks.processAllTokens(o)), s.walkTokens && this.walkTokens(o, s.walkTokens);
|
|
2359
|
-
let h = (s.hooks ? s.hooks.provideParser(t) : t ?
|
|
2359
|
+
let h = (s.hooks ? s.hooks.provideParser(t) : t ? be.parse : be.parseInline)(o, s);
|
|
2360
2360
|
return s.hooks && (h = s.hooks.postprocess(h)), h;
|
|
2361
2361
|
} catch (o) {
|
|
2362
2362
|
return l(o);
|
|
@@ -2367,37 +2367,37 @@ ${t}</tr>
|
|
|
2367
2367
|
return (n) => {
|
|
2368
2368
|
if (n.message += `
|
|
2369
2369
|
Please report this to https://github.com/markedjs/marked.`, t) {
|
|
2370
|
-
let i = "<p>An error occurred:</p><pre>" +
|
|
2370
|
+
let i = "<p>An error occurred:</p><pre>" + Ee(n.message + "", !0) + "</pre>";
|
|
2371
2371
|
return e ? Promise.resolve(i) : i;
|
|
2372
2372
|
}
|
|
2373
2373
|
if (e) return Promise.reject(n);
|
|
2374
2374
|
throw n;
|
|
2375
2375
|
};
|
|
2376
2376
|
}
|
|
2377
|
-
}, d(
|
|
2377
|
+
}, d(rt, "q"), rt), Ue = new Sa();
|
|
2378
2378
|
function $(a, t) {
|
|
2379
|
-
return
|
|
2379
|
+
return Ue.parse(a, t);
|
|
2380
2380
|
}
|
|
2381
2381
|
d($, "g");
|
|
2382
2382
|
$.options = $.setOptions = function(a) {
|
|
2383
|
-
return
|
|
2383
|
+
return Ue.setOptions(a), $.defaults = Ue.defaults, ys($.defaults), $;
|
|
2384
2384
|
};
|
|
2385
2385
|
$.getDefaults = pn;
|
|
2386
|
-
$.defaults =
|
|
2386
|
+
$.defaults = He;
|
|
2387
2387
|
$.use = function(...a) {
|
|
2388
|
-
return
|
|
2388
|
+
return Ue.use(...a), $.defaults = Ue.defaults, ys($.defaults), $;
|
|
2389
2389
|
};
|
|
2390
2390
|
$.walkTokens = function(a, t) {
|
|
2391
|
-
return
|
|
2391
|
+
return Ue.walkTokens(a, t);
|
|
2392
2392
|
};
|
|
2393
|
-
$.parseInline =
|
|
2394
|
-
$.Parser =
|
|
2395
|
-
$.parser =
|
|
2396
|
-
$.Renderer =
|
|
2393
|
+
$.parseInline = Ue.parseInline;
|
|
2394
|
+
$.Parser = be;
|
|
2395
|
+
$.parser = be.parse;
|
|
2396
|
+
$.Renderer = Ft;
|
|
2397
2397
|
$.TextRenderer = yn;
|
|
2398
|
-
$.Lexer =
|
|
2399
|
-
$.lexer =
|
|
2400
|
-
$.Tokenizer =
|
|
2398
|
+
$.Lexer = xe;
|
|
2399
|
+
$.lexer = xe.lex;
|
|
2400
|
+
$.Tokenizer = Bt;
|
|
2401
2401
|
$.Hooks = kt;
|
|
2402
2402
|
$.parse = $;
|
|
2403
2403
|
$.options;
|
|
@@ -2405,9 +2405,9 @@ $.setOptions;
|
|
|
2405
2405
|
$.use;
|
|
2406
2406
|
$.walkTokens;
|
|
2407
2407
|
$.parseInline;
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
const Aa = ["innerHTML"],
|
|
2408
|
+
be.parse;
|
|
2409
|
+
xe.lex;
|
|
2410
|
+
const Aa = ["innerHTML"], Nt = /* @__PURE__ */ Re({
|
|
2411
2411
|
__name: "ChatRichText",
|
|
2412
2412
|
props: {
|
|
2413
2413
|
text: {},
|
|
@@ -2417,7 +2417,7 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
2417
2417
|
setup(a) {
|
|
2418
2418
|
const t = a, e = ps(t.text);
|
|
2419
2419
|
let n;
|
|
2420
|
-
|
|
2420
|
+
zt(
|
|
2421
2421
|
[() => t.text, () => t.streaming],
|
|
2422
2422
|
([l, o]) => {
|
|
2423
2423
|
if (!o) {
|
|
@@ -2445,21 +2445,21 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
2445
2445
|
}
|
|
2446
2446
|
return c ? `<a href="${l}">${o}</a>` : `<a href="${l}" target="_blank" rel="noopener noreferrer">${o}</a>`;
|
|
2447
2447
|
}, $.setOptions({ breaks: !0, gfm: !0, renderer: i });
|
|
2448
|
-
const s =
|
|
2448
|
+
const s = F(() => {
|
|
2449
2449
|
const l = e.value;
|
|
2450
2450
|
if (!l) return "";
|
|
2451
2451
|
const o = $.parse(l, { async: !1 });
|
|
2452
2452
|
return $i.sanitize(o, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
|
|
2453
2453
|
});
|
|
2454
2454
|
return (l, o) => (v(), w("div", {
|
|
2455
|
-
class:
|
|
2455
|
+
class: S(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", a.inverted ? "chat-msg-prose-invert" : ""]),
|
|
2456
2456
|
innerHTML: s.value
|
|
2457
2457
|
}, null, 10, Aa));
|
|
2458
2458
|
}
|
|
2459
|
-
}), Ea = 80, _a = /* @__PURE__ */
|
|
2459
|
+
}), Ea = 80, _a = /* @__PURE__ */ Re({
|
|
2460
2460
|
__name: "ChatScroller",
|
|
2461
2461
|
setup(a, { expose: t }) {
|
|
2462
|
-
const e =
|
|
2462
|
+
const e = re(), n = re();
|
|
2463
2463
|
let i = !0, s;
|
|
2464
2464
|
function l() {
|
|
2465
2465
|
const c = e.value;
|
|
@@ -2474,7 +2474,7 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
2474
2474
|
function h() {
|
|
2475
2475
|
i = !0, l();
|
|
2476
2476
|
}
|
|
2477
|
-
return d(h, "pin"), t({ pin: h }),
|
|
2477
|
+
return d(h, "pin"), t({ pin: h }), Ut(() => {
|
|
2478
2478
|
requestAnimationFrame(() => {
|
|
2479
2479
|
l(), requestAnimationFrame(l);
|
|
2480
2480
|
}), n.value && (s = new ResizeObserver(() => {
|
|
@@ -2525,13 +2525,13 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
2525
2525
|
}, or = {
|
|
2526
2526
|
key: 1,
|
|
2527
2527
|
class: "i-tabler-paperclip size-5"
|
|
2528
|
-
}, cr = ["placeholder", "disabled"], ur = ["disabled", "aria-label"], hr = {
|
|
2528
|
+
}, cr = ["placeholder", "disabled"], ur = ["data-composer-action", "disabled", "aria-label"], hr = {
|
|
2529
2529
|
key: 0,
|
|
2530
2530
|
class: "i-tabler-player-stop-filled size-4"
|
|
2531
2531
|
}, dr = {
|
|
2532
2532
|
key: 1,
|
|
2533
2533
|
class: "i-tabler-arrow-up size-5"
|
|
2534
|
-
}, Sr = /* @__PURE__ */
|
|
2534
|
+
}, Sr = /* @__PURE__ */ Re({
|
|
2535
2535
|
__name: "ElAgentChat",
|
|
2536
2536
|
props: {
|
|
2537
2537
|
chatController: {},
|
|
@@ -2548,34 +2548,34 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
2548
2548
|
private: { icon: "i-tabler-lock", label: "Private", tooltip: "Only you can see this conversation" },
|
|
2549
2549
|
org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
|
|
2550
2550
|
public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
|
|
2551
|
-
}, e =
|
|
2552
|
-
const
|
|
2553
|
-
return a.scope === "org" && a.scopeName && (
|
|
2554
|
-
}), n =
|
|
2555
|
-
function m(
|
|
2556
|
-
return
|
|
2551
|
+
}, e = F(() => {
|
|
2552
|
+
const A = { ...t[a.scope] };
|
|
2553
|
+
return a.scope === "org" && a.scopeName && (A.label = a.scopeName, A.tooltip = `Visible to ${a.scopeName} members`), A;
|
|
2554
|
+
}), n = re(""), i = re(!1), s = re(), l = re(), o = re(), h = re([]), c = re(!1);
|
|
2555
|
+
function m(A) {
|
|
2556
|
+
return A ? /\[[^\]]+\]\([^)]+\)/.test(A) : !1;
|
|
2557
2557
|
}
|
|
2558
2558
|
d(m, "containsMarkdownLink");
|
|
2559
|
-
function x(
|
|
2560
|
-
return
|
|
2559
|
+
function x(A) {
|
|
2560
|
+
return A.sender === "system" && (!!A.issue || A.id === ke.value);
|
|
2561
2561
|
}
|
|
2562
2562
|
d(x, "isSystemExplainerMessage");
|
|
2563
|
-
function k(
|
|
2564
|
-
const p =
|
|
2563
|
+
function k(A, g) {
|
|
2564
|
+
const p = A[g], O = A[g + 1];
|
|
2565
2565
|
return !O || O.sender !== p.sender;
|
|
2566
2566
|
}
|
|
2567
2567
|
d(k, "shouldShowAvatar");
|
|
2568
|
-
const
|
|
2569
|
-
function
|
|
2570
|
-
if (!
|
|
2568
|
+
const T = F(() => a.chatController?.textState.value), U = F(() => T.value?.isConnected ?? !1), M = F(() => T.value?.isThinking ?? !1), X = F(() => T.value?.connectionStatus === "disconnected" && !!T.value?.error), oe = F(() => T.value?.connectionStatus !== "connected" && !T.value?.error), E = F(() => T.value?.error), L = F(() => a.chatController?.sharedMessages.value ?? []), R = F(() => T.value?.workingDescription?.trim() || void 0), B = F(() => M.value ? T.value?.toolActivities ?? [] : []), z = F(() => W(B.value));
|
|
2569
|
+
function W(A) {
|
|
2570
|
+
if (!A?.length)
|
|
2571
2571
|
return;
|
|
2572
|
-
const g =
|
|
2572
|
+
const g = Oe(A, "started");
|
|
2573
2573
|
if (g)
|
|
2574
2574
|
return { status: "started", icon: "i-tabler-loader-2 animate-spin", label: g.label };
|
|
2575
|
-
const p =
|
|
2575
|
+
const p = Oe(A, "failed");
|
|
2576
2576
|
if (p)
|
|
2577
2577
|
return { status: "failed", icon: "i-tabler-alert-circle text-theme-500", label: p.label };
|
|
2578
|
-
const O =
|
|
2578
|
+
const O = A.filter((H) => H.status === "completed").length;
|
|
2579
2579
|
if (O > 0)
|
|
2580
2580
|
return {
|
|
2581
2581
|
status: "completed",
|
|
@@ -2583,182 +2583,182 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
2583
2583
|
label: O === 1 ? "1 action completed" : `${O} actions completed`
|
|
2584
2584
|
};
|
|
2585
2585
|
}
|
|
2586
|
-
d(
|
|
2587
|
-
function
|
|
2588
|
-
for (let p =
|
|
2589
|
-
const O =
|
|
2586
|
+
d(W, "toolActivityLineFor");
|
|
2587
|
+
function Oe(A, g) {
|
|
2588
|
+
for (let p = A.length - 1; p >= 0; p--) {
|
|
2589
|
+
const O = A[p];
|
|
2590
2590
|
if (O?.status === g)
|
|
2591
2591
|
return O;
|
|
2592
2592
|
}
|
|
2593
2593
|
}
|
|
2594
|
-
d(
|
|
2595
|
-
const
|
|
2594
|
+
d(Oe, "lastToolActivityWithStatus");
|
|
2595
|
+
const ce = F(() => T.value?.transientIssue), ke = F(() => {
|
|
2596
2596
|
if (!M.value) return;
|
|
2597
|
-
const
|
|
2597
|
+
const A = L.value, g = A[A.length - 1];
|
|
2598
2598
|
return g?.sender === "agent" || g?.sender === "system" ? g.id : void 0;
|
|
2599
|
-
}),
|
|
2599
|
+
}), jt = F(() => !M.value || R.value ? !1 : ke.value === void 0), ot = F(() => T.value?.sendBlockedReason), Ge = F(() => !U.value || ot.value !== void 0), Q = F(() => X.value ? "Agent is offline" : oe.value ? "Connecting..." : ot.value === "agent_deleted" ? "This assistant was deleted" : ot.value === "account" ? "Resolve the billing issue above to continue" : "Message"), je = F(() => (n.value.trim() || h.value.length > 0) && !Ge.value && !c.value && !M.value), Me = F(() => !!a.chatController && M.value && !c.value), pe = F(() => Me.value ? "stop" : je.value ? "send" : "idle"), yt = F(() => pe.value !== "idle"), I = F(() => a.variant === "light"), wt = F(
|
|
2600
2600
|
() => I.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
|
|
2601
|
-
),
|
|
2602
|
-
|
|
2603
|
-
a.chatController && !
|
|
2601
|
+
), We = F(() => I.value ? "text-theme-300" : "text-white/30");
|
|
2602
|
+
Ut(async () => {
|
|
2603
|
+
a.chatController && !U.value && await a.chatController.startTextConversation();
|
|
2604
2604
|
});
|
|
2605
|
-
async function
|
|
2606
|
-
const
|
|
2607
|
-
if (!
|
|
2605
|
+
async function Tt() {
|
|
2606
|
+
const A = n.value.trim(), g = h.value.length > 0;
|
|
2607
|
+
if (!A && !g || !a.chatController || Ge.value || c.value || M.value)
|
|
2608
2608
|
return;
|
|
2609
2609
|
const p = n.value, O = g ? [...h.value] : void 0;
|
|
2610
2610
|
n.value = "", h.value = [], l.value && (l.value.style.height = "auto", l.value.focus()), s.value?.pin(), await a.chatController.sendChatMessage(p, O);
|
|
2611
2611
|
}
|
|
2612
|
-
d(
|
|
2613
|
-
async function
|
|
2614
|
-
!a.chatController || !
|
|
2612
|
+
d(Tt, "sendMessage");
|
|
2613
|
+
async function St() {
|
|
2614
|
+
!a.chatController || !Me.value || await a.chatController.stopChatTurn();
|
|
2615
2615
|
}
|
|
2616
|
-
d(
|
|
2617
|
-
async function
|
|
2618
|
-
if (
|
|
2619
|
-
await
|
|
2616
|
+
d(St, "stopMessage");
|
|
2617
|
+
async function q() {
|
|
2618
|
+
if (pe.value === "stop") {
|
|
2619
|
+
await St();
|
|
2620
2620
|
return;
|
|
2621
2621
|
}
|
|
2622
|
-
await
|
|
2622
|
+
pe.value === "send" && await Tt();
|
|
2623
2623
|
}
|
|
2624
|
-
d(
|
|
2625
|
-
async function
|
|
2626
|
-
|
|
2624
|
+
d(q, "handleComposerAction");
|
|
2625
|
+
async function ct(A) {
|
|
2626
|
+
A.key === "Enter" && !A.shiftKey && (A.preventDefault(), await Tt());
|
|
2627
2627
|
}
|
|
2628
|
-
d(
|
|
2629
|
-
function
|
|
2628
|
+
d(ct, "handleKeydown");
|
|
2629
|
+
function V() {
|
|
2630
2630
|
l.value && (l.value.style.height = "auto", l.value.style.height = `${Math.min(l.value.scrollHeight, 150)}px`);
|
|
2631
2631
|
}
|
|
2632
|
-
d(
|
|
2633
|
-
function
|
|
2632
|
+
d(V, "adjustTextareaHeight"), zt(n, () => Bs(() => V()));
|
|
2633
|
+
function ut() {
|
|
2634
2634
|
o.value?.click();
|
|
2635
2635
|
}
|
|
2636
|
-
d(
|
|
2637
|
-
async function
|
|
2638
|
-
const g =
|
|
2636
|
+
d(ut, "triggerFileInput");
|
|
2637
|
+
async function Y(A) {
|
|
2638
|
+
const g = A.target, p = g.files?.[0];
|
|
2639
2639
|
if (!(!p || !a.uploadFn)) {
|
|
2640
2640
|
c.value = !0;
|
|
2641
2641
|
try {
|
|
2642
2642
|
const O = await a.uploadFn(p);
|
|
2643
2643
|
h.value = [...h.value, O];
|
|
2644
2644
|
} catch (O) {
|
|
2645
|
-
const
|
|
2646
|
-
a.chatController?.notify(`Upload failed — ${
|
|
2645
|
+
const H = O instanceof Error ? O.message : "Couldn't attach that file.";
|
|
2646
|
+
a.chatController?.notify(`Upload failed — ${H}`);
|
|
2647
2647
|
} finally {
|
|
2648
2648
|
c.value = !1, g.value = "";
|
|
2649
2649
|
}
|
|
2650
2650
|
}
|
|
2651
2651
|
}
|
|
2652
|
-
d(
|
|
2653
|
-
function
|
|
2654
|
-
h.value = h.value.filter((g, p) => p !==
|
|
2652
|
+
d(Y, "handleFileSelect");
|
|
2653
|
+
function Ne(A) {
|
|
2654
|
+
h.value = h.value.filter((g, p) => p !== A);
|
|
2655
2655
|
}
|
|
2656
|
-
d(
|
|
2657
|
-
function
|
|
2656
|
+
d(Ne, "removeAttachment");
|
|
2657
|
+
function ze(A, g) {
|
|
2658
2658
|
if (g === 0) {
|
|
2659
|
-
const
|
|
2660
|
-
return
|
|
2659
|
+
const $e = A[g];
|
|
2660
|
+
return $e?.timestamp ? fe(new Date($e.timestamp)) : null;
|
|
2661
2661
|
}
|
|
2662
|
-
const p =
|
|
2662
|
+
const p = A[g - 1], O = A[g];
|
|
2663
2663
|
if (!p?.timestamp || !O?.timestamp) return null;
|
|
2664
|
-
const
|
|
2665
|
-
return new Date(O.timestamp).getTime() -
|
|
2664
|
+
const H = new Date(p.timestamp).getTime();
|
|
2665
|
+
return new Date(O.timestamp).getTime() - H > 36e5 ? fe(new Date(O.timestamp)) : null;
|
|
2666
2666
|
}
|
|
2667
|
-
d(
|
|
2668
|
-
function
|
|
2669
|
-
const g = /* @__PURE__ */ new Date(), p =
|
|
2667
|
+
d(ze, "shouldShowTimeDivider");
|
|
2668
|
+
function fe(A) {
|
|
2669
|
+
const g = /* @__PURE__ */ new Date(), p = A.toDateString() === g.toDateString(), O = new Date(g);
|
|
2670
2670
|
O.setDate(O.getDate() - 1);
|
|
2671
|
-
const
|
|
2672
|
-
if (p) return
|
|
2673
|
-
if (
|
|
2674
|
-
const
|
|
2675
|
-
return `${
|
|
2671
|
+
const H = A.toDateString() === O.toDateString(), ue = A.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
2672
|
+
if (p) return ue;
|
|
2673
|
+
if (H) return `Yesterday, ${ue}`;
|
|
2674
|
+
const ve = A.getFullYear() === g.getFullYear();
|
|
2675
|
+
return `${A.toLocaleDateString("en-US", {
|
|
2676
2676
|
weekday: "long",
|
|
2677
2677
|
month: "short",
|
|
2678
2678
|
day: "numeric",
|
|
2679
|
-
...
|
|
2680
|
-
})}, ${
|
|
2679
|
+
...ve ? {} : { year: "numeric" }
|
|
2680
|
+
})}, ${ue}`;
|
|
2681
2681
|
}
|
|
2682
|
-
return d(
|
|
2683
|
-
I.value ?
|
|
2684
|
-
|
|
2682
|
+
return d(fe, "formatTimeDivider"), (A, g) => (v(), w("div", Ra, [
|
|
2683
|
+
I.value ? j("", !0) : (v(), w("div", Ia, [
|
|
2684
|
+
Ke(ri, {
|
|
2685
2685
|
agent: a.agent,
|
|
2686
|
-
"is-online":
|
|
2686
|
+
"is-online": U.value
|
|
2687
2687
|
}, null, 8, ["agent", "is-online"])
|
|
2688
2688
|
])),
|
|
2689
|
-
|
|
2689
|
+
X.value ? (v(), w("div", {
|
|
2690
2690
|
key: 1,
|
|
2691
|
-
class:
|
|
2691
|
+
class: S(["py-16 flex flex-col items-center justify-center gap-3 text-sm", I.value ? "text-theme-400" : "text-white/60"])
|
|
2692
2692
|
}, [
|
|
2693
2693
|
y("i", {
|
|
2694
|
-
class:
|
|
2694
|
+
class: S(["i-heroicons-cloud-arrow-down size-8", I.value ? "text-theme-300" : "text-white/40"])
|
|
2695
2695
|
}, null, 2),
|
|
2696
2696
|
y("span", null, ne(E.value), 1)
|
|
2697
|
-
], 2)) :
|
|
2697
|
+
], 2)) : oe.value ? (v(), w("div", {
|
|
2698
2698
|
key: 2,
|
|
2699
|
-
class:
|
|
2699
|
+
class: S(["py-16 flex flex-col items-center justify-center gap-2 text-sm", I.value ? "text-theme-400" : "text-theme-600"])
|
|
2700
2700
|
}, [
|
|
2701
|
-
|
|
2701
|
+
Ke(Gn, { class: "size-4" })
|
|
2702
2702
|
], 2)) : a.setupHint ? (v(), w("div", {
|
|
2703
2703
|
key: 3,
|
|
2704
|
-
class:
|
|
2704
|
+
class: S(["flex items-center justify-center gap-1.5 py-2 text-[11px]", We.value])
|
|
2705
2705
|
}, [
|
|
2706
2706
|
g[10] || (g[10] = y("i", { class: "i-tabler-tool size-3" }, null, -1)),
|
|
2707
2707
|
y("span", null, ne(a.setupHint), 1)
|
|
2708
|
-
], 2)) :
|
|
2709
|
-
|
|
2708
|
+
], 2)) : j("", !0),
|
|
2709
|
+
Ke(_a, {
|
|
2710
2710
|
ref_key: "chatScroller",
|
|
2711
2711
|
ref: s,
|
|
2712
2712
|
class: "flex-1"
|
|
2713
2713
|
}, {
|
|
2714
2714
|
default: Fs(() => [
|
|
2715
2715
|
y("div", {
|
|
2716
|
-
class:
|
|
2716
|
+
class: S(L.value.length === 0 ? "flex-1 flex flex-col items-center justify-center px-3" : "pt-4 pb-[120px] px-3 space-y-1")
|
|
2717
2717
|
}, [
|
|
2718
|
-
L.value.length === 0 && !
|
|
2718
|
+
L.value.length === 0 && !oe.value && !X.value ? (v(), w("div", Ca, [
|
|
2719
2719
|
y("div", Da, [
|
|
2720
2720
|
y("img", {
|
|
2721
2721
|
src: a.agent.avatarUrl.value,
|
|
2722
2722
|
alt: a.agent.displayName.value,
|
|
2723
|
-
class:
|
|
2723
|
+
class: S(["size-full rounded-full object-cover ring-1", I.value ? "ring-black/5" : "ring-white/10"])
|
|
2724
2724
|
}, null, 10, La),
|
|
2725
|
-
|
|
2725
|
+
U.value ? (v(), w("span", {
|
|
2726
2726
|
key: 0,
|
|
2727
|
-
class:
|
|
2727
|
+
class: S(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", I.value ? "bg-white" : "bg-theme-900"])
|
|
2728
2728
|
}, [...g[11] || (g[11] = [
|
|
2729
2729
|
y("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
|
|
2730
|
-
])], 2)) :
|
|
2730
|
+
])], 2)) : j("", !0)
|
|
2731
2731
|
]),
|
|
2732
2732
|
y("div", {
|
|
2733
|
-
class:
|
|
2733
|
+
class: S(["text-base @sm/chat:text-lg font-semibold", I.value ? "text-theme-900" : "text-white"])
|
|
2734
2734
|
}, ne(a.agent.displayName.value), 3),
|
|
2735
2735
|
y("p", {
|
|
2736
|
-
class:
|
|
2736
|
+
class: S(["mt-1 text-center text-xs @sm/chat:text-sm", We.value])
|
|
2737
2737
|
}, ne(a.emptyStateMessage || "Type your message to get started."), 3),
|
|
2738
2738
|
y("div", {
|
|
2739
|
-
class:
|
|
2739
|
+
class: S(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", I.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
2740
2740
|
title: e.value.tooltip
|
|
2741
2741
|
}, [
|
|
2742
2742
|
y("i", {
|
|
2743
|
-
class:
|
|
2743
|
+
class: S([e.value.icon, "size-3"])
|
|
2744
2744
|
}, null, 2),
|
|
2745
2745
|
y("span", null, ne(e.value.label), 1)
|
|
2746
2746
|
], 10, Oa)
|
|
2747
|
-
])) :
|
|
2748
|
-
(v(!0), w(
|
|
2747
|
+
])) : j("", !0),
|
|
2748
|
+
(v(!0), w(Be, null, tn(L.value, (p, O) => (v(), w(Be, {
|
|
2749
2749
|
key: p.id
|
|
2750
2750
|
}, [
|
|
2751
|
-
|
|
2751
|
+
ze(L.value, O) ? (v(), w("div", Ma, [
|
|
2752
2752
|
y("div", {
|
|
2753
|
-
class:
|
|
2753
|
+
class: S(["flex-1 h-px", wt.value])
|
|
2754
2754
|
}, null, 2),
|
|
2755
2755
|
y("span", {
|
|
2756
|
-
class:
|
|
2757
|
-
}, ne(
|
|
2756
|
+
class: S(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", We.value])
|
|
2757
|
+
}, ne(ze(L.value, O)), 3),
|
|
2758
2758
|
y("div", {
|
|
2759
|
-
class:
|
|
2759
|
+
class: S(["flex-1 h-px", wt.value])
|
|
2760
2760
|
}, null, 2)
|
|
2761
|
-
])) :
|
|
2761
|
+
])) : j("", !0),
|
|
2762
2762
|
x(p) ? (v(), w("div", {
|
|
2763
2763
|
key: 1,
|
|
2764
2764
|
"data-test": "messaging-system-msg",
|
|
@@ -2771,39 +2771,39 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
2771
2771
|
"data-issue-bucket": p.issue?.bucket,
|
|
2772
2772
|
"data-issue-action-label": p.issue?.actionLabel,
|
|
2773
2773
|
"data-issue-action-url": p.issue?.actionUrl,
|
|
2774
|
-
"data-streaming": p.id ===
|
|
2774
|
+
"data-streaming": p.id === ke.value ? "true" : void 0,
|
|
2775
2775
|
class: "flex gap-2 items-end justify-start mb-4"
|
|
2776
2776
|
}, [
|
|
2777
2777
|
y("div", za, [
|
|
2778
2778
|
y("div", {
|
|
2779
|
-
class:
|
|
2779
|
+
class: S(["mb-1 pl-1 text-[11px] font-medium", I.value ? "text-theme-500" : "text-white/45"])
|
|
2780
2780
|
}, " System Message ", 2),
|
|
2781
2781
|
y("div", {
|
|
2782
|
-
class:
|
|
2782
|
+
class: S(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content", I.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
|
|
2783
2783
|
}, [
|
|
2784
|
-
p.text ? (v(), Hn(
|
|
2784
|
+
p.text ? (v(), Hn(Nt, {
|
|
2785
2785
|
key: 0,
|
|
2786
2786
|
text: p.text,
|
|
2787
2787
|
inverted: !I.value,
|
|
2788
|
-
streaming: p.id ===
|
|
2788
|
+
streaming: p.id === ke.value,
|
|
2789
2789
|
onClick: g[0] || (g[0] = ft(() => {
|
|
2790
2790
|
}, ["stop"]))
|
|
2791
|
-
}, null, 8, ["text", "inverted", "streaming"])) : p.issue?.help ? (v(), Hn(
|
|
2791
|
+
}, null, 8, ["text", "inverted", "streaming"])) : p.issue?.help ? (v(), Hn(Nt, {
|
|
2792
2792
|
key: 1,
|
|
2793
2793
|
text: p.issue.help,
|
|
2794
2794
|
inverted: !I.value
|
|
2795
|
-
}, null, 8, ["text", "inverted"])) :
|
|
2795
|
+
}, null, 8, ["text", "inverted"])) : j("", !0),
|
|
2796
2796
|
p.issue?.actionUrl && !m(p.text) ? (v(), w("a", {
|
|
2797
2797
|
key: 2,
|
|
2798
2798
|
href: p.issue.actionUrl,
|
|
2799
2799
|
"data-test": "messaging-system-msg-action",
|
|
2800
|
-
class:
|
|
2800
|
+
class: S(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", I.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
2801
2801
|
onClick: g[1] || (g[1] = ft(() => {
|
|
2802
2802
|
}, ["stop"]))
|
|
2803
2803
|
}, [
|
|
2804
|
-
|
|
2804
|
+
Lt(ne(p.issue.actionLabel) + " ", 1),
|
|
2805
2805
|
g[12] || (g[12] = y("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
|
|
2806
|
-
], 10, $a)) :
|
|
2806
|
+
], 10, $a)) : j("", !0)
|
|
2807
2807
|
], 2)
|
|
2808
2808
|
])
|
|
2809
2809
|
], 8, Na)) : p.sender === "system" ? (v(), w("div", {
|
|
@@ -2816,11 +2816,11 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
2816
2816
|
"data-system-kind": p.systemKind,
|
|
2817
2817
|
"data-issue-code": p.issue?.code,
|
|
2818
2818
|
"data-issue-bucket": p.issue?.bucket,
|
|
2819
|
-
"data-streaming": p.id ===
|
|
2820
|
-
class:
|
|
2819
|
+
"data-streaming": p.id === ke.value ? "true" : void 0,
|
|
2820
|
+
class: S(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", I.value ? "text-theme-500" : "text-white/60"])
|
|
2821
2821
|
}, [
|
|
2822
2822
|
g[13] || (g[13] = y("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
|
|
2823
|
-
|
|
2823
|
+
Ke(Nt, {
|
|
2824
2824
|
text: p.text,
|
|
2825
2825
|
inverted: !I.value,
|
|
2826
2826
|
onClick: g[2] || (g[2] = ft(() => {
|
|
@@ -2834,8 +2834,8 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
2834
2834
|
"data-conversation-id": p.conversationId,
|
|
2835
2835
|
"data-message-sequence": p.sequence,
|
|
2836
2836
|
"data-system-kind": p.systemKind,
|
|
2837
|
-
"data-streaming": p.id ===
|
|
2838
|
-
class:
|
|
2837
|
+
"data-streaming": p.id === ke.value ? "true" : void 0,
|
|
2838
|
+
class: S(["flex gap-2 items-end", {
|
|
2839
2839
|
"justify-end": p.sender === "user",
|
|
2840
2840
|
"justify-start": p.sender === "agent",
|
|
2841
2841
|
"mb-4": k(L.value, O)
|
|
@@ -2846,65 +2846,65 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
2846
2846
|
key: 0,
|
|
2847
2847
|
src: a.agent.avatarUrl.value,
|
|
2848
2848
|
alt: a.agent.displayName.value,
|
|
2849
|
-
class:
|
|
2850
|
-
}, null, 10, Ua)) :
|
|
2851
|
-
])) :
|
|
2849
|
+
class: S(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", I.value ? "ring-1 ring-black/5" : ""])
|
|
2850
|
+
}, null, 10, Ua)) : j("", !0)
|
|
2851
|
+
])) : j("", !0),
|
|
2852
2852
|
y("div", {
|
|
2853
|
-
class:
|
|
2853
|
+
class: S(p.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
|
|
2854
2854
|
}, [
|
|
2855
2855
|
p.attachments?.length ? (v(), w("div", {
|
|
2856
2856
|
key: 0,
|
|
2857
|
-
class:
|
|
2857
|
+
class: S(["mb-1 space-y-1", p.sender === "user" ? "flex flex-col items-end" : ""])
|
|
2858
2858
|
}, [
|
|
2859
|
-
(v(!0), w(
|
|
2860
|
-
|
|
2859
|
+
(v(!0), w(Be, null, tn(p.attachments, (H, ue) => (v(), w(Be, { key: ue }, [
|
|
2860
|
+
H.type === "image" ? (v(), w("img", {
|
|
2861
2861
|
key: 0,
|
|
2862
|
-
src:
|
|
2863
|
-
alt:
|
|
2862
|
+
src: H.src,
|
|
2863
|
+
alt: H.filename,
|
|
2864
2864
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
2865
|
-
}, null, 8, Ha)) :
|
|
2865
|
+
}, null, 8, Ha)) : H.type === "audio" ? (v(), w("audio", {
|
|
2866
2866
|
key: 1,
|
|
2867
|
-
src:
|
|
2867
|
+
src: H.src,
|
|
2868
2868
|
controls: "",
|
|
2869
2869
|
class: "max-w-full"
|
|
2870
2870
|
}, null, 8, Ga)) : (v(), w("a", {
|
|
2871
2871
|
key: 2,
|
|
2872
|
-
href:
|
|
2872
|
+
href: H.src,
|
|
2873
2873
|
target: "_blank",
|
|
2874
2874
|
rel: "noopener",
|
|
2875
|
-
class:
|
|
2875
|
+
class: S(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", I.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
2876
2876
|
}, [
|
|
2877
2877
|
g[14] || (g[14] = y("i", { class: "i-tabler-file size-3.5" }, null, -1)),
|
|
2878
|
-
|
|
2878
|
+
Lt(" " + ne(H.filename), 1)
|
|
2879
2879
|
], 10, ja))
|
|
2880
2880
|
], 64))), 128))
|
|
2881
|
-
], 2)) :
|
|
2881
|
+
], 2)) : j("", !0),
|
|
2882
2882
|
p.text ? (v(), w("div", {
|
|
2883
2883
|
key: 1,
|
|
2884
|
-
class:
|
|
2884
|
+
class: S(["rounded-2xl px-3.5 py-2", [
|
|
2885
2885
|
p.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : I.value ? "bg-theme-50 text-theme-800 border border-black/[0.02] rounded-bl-[4px]" : "bg-white/15 backdrop-blur-sm text-white/95 rounded-bl-[4px]"
|
|
2886
2886
|
]])
|
|
2887
2887
|
}, [
|
|
2888
|
-
|
|
2888
|
+
Ke(Nt, {
|
|
2889
2889
|
text: p.text,
|
|
2890
2890
|
inverted: p.sender === "user" || !I.value,
|
|
2891
|
-
streaming: p.id ===
|
|
2891
|
+
streaming: p.id === ke.value,
|
|
2892
2892
|
onClick: g[3] || (g[3] = ft(() => {
|
|
2893
2893
|
}, ["stop"]))
|
|
2894
2894
|
}, null, 8, ["text", "inverted", "streaming"])
|
|
2895
|
-
], 2)) :
|
|
2896
|
-
|
|
2895
|
+
], 2)) : j("", !0),
|
|
2896
|
+
W(p.toolActivities) ? (v(), w("div", {
|
|
2897
2897
|
key: 2,
|
|
2898
2898
|
"data-test": "messaging-message-tool-activity",
|
|
2899
|
-
"data-tool-activity-status":
|
|
2900
|
-
class:
|
|
2899
|
+
"data-tool-activity-status": W(p.toolActivities)?.status,
|
|
2900
|
+
class: S(["mt-1 flex items-center gap-1.5 pl-2 pr-3 text-[12px] leading-none", I.value ? "text-theme-500" : "text-white/45"])
|
|
2901
2901
|
}, [
|
|
2902
2902
|
y("i", {
|
|
2903
|
-
class:
|
|
2903
|
+
class: S(["size-3.5 shrink-0 opacity-80", W(p.toolActivities)?.icon]),
|
|
2904
2904
|
"aria-hidden": "true"
|
|
2905
2905
|
}, null, 2),
|
|
2906
|
-
y("span", qa, ne(
|
|
2907
|
-
], 10, Wa)) :
|
|
2906
|
+
y("span", qa, ne(W(p.toolActivities)?.label), 1)
|
|
2907
|
+
], 10, Wa)) : j("", !0)
|
|
2908
2908
|
], 2)
|
|
2909
2909
|
], 10, Ba))
|
|
2910
2910
|
], 64))), 128)),
|
|
@@ -2912,73 +2912,73 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
2912
2912
|
key: 1,
|
|
2913
2913
|
"data-test": "messaging-working-state",
|
|
2914
2914
|
"data-working-description": R.value,
|
|
2915
|
-
class:
|
|
2915
|
+
class: S(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", I.value ? "text-theme-500" : "text-white/45"])
|
|
2916
2916
|
}, [
|
|
2917
2917
|
g[15] || (g[15] = y("i", {
|
|
2918
2918
|
class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
|
|
2919
2919
|
"aria-hidden": "true"
|
|
2920
2920
|
}, null, -1)),
|
|
2921
2921
|
y("span", Va, ne(R.value), 1)
|
|
2922
|
-
], 10, Ya)) :
|
|
2922
|
+
], 10, Ya)) : j("", !0),
|
|
2923
2923
|
z.value ? (v(), w("div", {
|
|
2924
2924
|
key: 2,
|
|
2925
2925
|
"data-test": "messaging-tool-activity",
|
|
2926
2926
|
"data-tool-activity-status": z.value.status,
|
|
2927
|
-
class:
|
|
2927
|
+
class: S(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", I.value ? "text-theme-500" : "text-white/45"])
|
|
2928
2928
|
}, [
|
|
2929
2929
|
y("i", {
|
|
2930
|
-
class:
|
|
2930
|
+
class: S(["size-3.5 shrink-0 opacity-80", z.value.icon]),
|
|
2931
2931
|
"aria-hidden": "true"
|
|
2932
2932
|
}, null, 2),
|
|
2933
2933
|
y("span", Xa, ne(z.value.label), 1)
|
|
2934
|
-
], 10, Za)) :
|
|
2935
|
-
|
|
2934
|
+
], 10, Za)) : j("", !0),
|
|
2935
|
+
ce.value ? (v(), w("div", {
|
|
2936
2936
|
key: 3,
|
|
2937
2937
|
"data-test": "messaging-transient-issue",
|
|
2938
|
-
"data-issue-code":
|
|
2939
|
-
class:
|
|
2938
|
+
"data-issue-code": ce.value.code,
|
|
2939
|
+
class: S(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", I.value ? "text-theme-600" : "text-white/60"])
|
|
2940
2940
|
}, [
|
|
2941
2941
|
g[16] || (g[16] = y("i", {
|
|
2942
2942
|
class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
|
|
2943
2943
|
"aria-hidden": "true"
|
|
2944
2944
|
}, null, -1)),
|
|
2945
2945
|
y("span", null, [
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
], 64)) :
|
|
2946
|
+
Lt(ne(ce.value.message), 1),
|
|
2947
|
+
ce.value.help ? (v(), w(Be, { key: 0 }, [
|
|
2948
|
+
Lt(ne(ce.value.help), 1)
|
|
2949
|
+
], 64)) : j("", !0)
|
|
2950
2950
|
]),
|
|
2951
|
-
|
|
2951
|
+
ce.value.actionUrl && ce.value.actionLabel ? (v(), w("a", {
|
|
2952
2952
|
key: 0,
|
|
2953
|
-
href:
|
|
2953
|
+
href: ce.value.actionUrl,
|
|
2954
2954
|
class: "shrink-0 underline underline-offset-2",
|
|
2955
2955
|
onClick: g[4] || (g[4] = ft(() => {
|
|
2956
2956
|
}, ["stop"]))
|
|
2957
|
-
}, ne(
|
|
2958
|
-
], 10, Ka)) :
|
|
2959
|
-
|
|
2957
|
+
}, ne(ce.value.actionLabel), 9, Qa)) : j("", !0)
|
|
2958
|
+
], 10, Ka)) : j("", !0),
|
|
2959
|
+
jt.value ? (v(), w("div", Ja, [
|
|
2960
2960
|
y("img", {
|
|
2961
2961
|
src: a.agent.avatarUrl.value,
|
|
2962
2962
|
alt: a.agent.displayName.value,
|
|
2963
|
-
class:
|
|
2963
|
+
class: S(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", I.value ? "ring-1 ring-black/5" : ""])
|
|
2964
2964
|
}, null, 10, er),
|
|
2965
2965
|
y("div", {
|
|
2966
|
-
class:
|
|
2966
|
+
class: S(["rounded-2xl px-3.5 py-2.5 flex items-center", I.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
|
|
2967
2967
|
}, [
|
|
2968
2968
|
y("i", {
|
|
2969
|
-
class:
|
|
2969
|
+
class: S(["i-svg-spinners-3-dots-bounce size-7", I.value ? "text-theme-400" : "text-white/50"])
|
|
2970
2970
|
}, null, 2)
|
|
2971
2971
|
], 2)
|
|
2972
|
-
])) :
|
|
2972
|
+
])) : j("", !0)
|
|
2973
2973
|
], 2)
|
|
2974
2974
|
]),
|
|
2975
2975
|
_: 1
|
|
2976
2976
|
}, 512),
|
|
2977
2977
|
y("div", {
|
|
2978
|
-
class:
|
|
2978
|
+
class: S(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", I.value ? "bg-gradient-to-t from-theme-50/90 via-theme-50/55 to-transparent" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
|
|
2979
2979
|
}, [
|
|
2980
2980
|
h.value.length > 0 ? (v(), w("div", tr, [
|
|
2981
|
-
(v(!0), w(
|
|
2981
|
+
(v(!0), w(Be, null, tn(h.value, (p, O) => (v(), w("div", {
|
|
2982
2982
|
key: O,
|
|
2983
2983
|
class: "relative shrink-0 group"
|
|
2984
2984
|
}, [
|
|
@@ -2986,25 +2986,25 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
2986
2986
|
key: 0,
|
|
2987
2987
|
src: p.src,
|
|
2988
2988
|
alt: p.filename,
|
|
2989
|
-
class:
|
|
2989
|
+
class: S(["size-14 rounded-xl object-cover border", I.value ? "border-black/10" : "border-white/20"])
|
|
2990
2990
|
}, null, 10, nr)) : (v(), w("div", {
|
|
2991
2991
|
key: 1,
|
|
2992
|
-
class:
|
|
2992
|
+
class: S(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", I.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
2993
2993
|
}, [
|
|
2994
2994
|
g[17] || (g[17] = y("i", { class: "i-tabler-file size-4" }, null, -1)),
|
|
2995
2995
|
y("span", sr, ne(p.filename), 1)
|
|
2996
2996
|
], 2)),
|
|
2997
2997
|
y("button", {
|
|
2998
2998
|
class: "absolute -top-1.5 -right-1.5 size-5 flex items-center justify-center rounded-full bg-theme-800 text-white text-xs scale-0 group-hover:scale-100 transition-transform cursor-pointer",
|
|
2999
|
-
onClick: /* @__PURE__ */ d((
|
|
2999
|
+
onClick: /* @__PURE__ */ d((H) => Ne(O), "onClick")
|
|
3000
3000
|
}, [...g[18] || (g[18] = [
|
|
3001
3001
|
y("i", { class: "i-tabler-x size-3" }, null, -1)
|
|
3002
3002
|
])], 8, ir)
|
|
3003
3003
|
]))), 128)),
|
|
3004
3004
|
c.value ? (v(), w("div", ar, [
|
|
3005
|
-
|
|
3006
|
-
])) :
|
|
3007
|
-
])) :
|
|
3005
|
+
Ke(Gn, { class: "size-5" })
|
|
3006
|
+
])) : j("", !0)
|
|
3007
|
+
])) : j("", !0),
|
|
3008
3008
|
a.uploadFn ? (v(), w("input", {
|
|
3009
3009
|
key: 1,
|
|
3010
3010
|
ref_key: "fileInput",
|
|
@@ -3012,19 +3012,19 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
3012
3012
|
type: "file",
|
|
3013
3013
|
accept: "image/*,audio/*,video/*",
|
|
3014
3014
|
class: "hidden",
|
|
3015
|
-
onChange:
|
|
3016
|
-
}, null, 544)) :
|
|
3015
|
+
onChange: Y
|
|
3016
|
+
}, null, 544)) : j("", !0),
|
|
3017
3017
|
y("div", {
|
|
3018
|
-
class:
|
|
3018
|
+
class: S(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200", I.value ? i.value ? "bg-theme-50 ring-1 ring-theme-300" : "bg-theme-25 ring-1 ring-theme-200 hover:ring-theme-300" : i.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
|
|
3019
3019
|
}, [
|
|
3020
3020
|
y("button", {
|
|
3021
|
-
class:
|
|
3021
|
+
class: S(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
|
|
3022
3022
|
a.uploadFn ? "cursor-pointer" : "cursor-default",
|
|
3023
3023
|
I.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
|
|
3024
3024
|
c.value ? "opacity-50 pointer-events-none" : ""
|
|
3025
3025
|
]]),
|
|
3026
|
-
disabled:
|
|
3027
|
-
onClick: g[5] || (g[5] = (p) => a.uploadFn &&
|
|
3026
|
+
disabled: Ge.value || c.value || !a.uploadFn,
|
|
3027
|
+
onClick: g[5] || (g[5] = (p) => a.uploadFn && ut())
|
|
3028
3028
|
}, [
|
|
3029
3029
|
c.value ? (v(), w("i", lr)) : (v(), w("i", or))
|
|
3030
3030
|
], 10, rr),
|
|
@@ -3035,11 +3035,11 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
3035
3035
|
"data-test": "messaging-input",
|
|
3036
3036
|
rows: "1",
|
|
3037
3037
|
enterkeyhint: "send",
|
|
3038
|
-
placeholder:
|
|
3039
|
-
disabled:
|
|
3038
|
+
placeholder: Q.value,
|
|
3039
|
+
disabled: Ge.value,
|
|
3040
3040
|
style: { fontSize: "16px", resize: "none" },
|
|
3041
|
-
class:
|
|
3042
|
-
onKeydown:
|
|
3041
|
+
class: S(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", I.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
3042
|
+
onKeydown: ct,
|
|
3043
3043
|
onFocus: g[7] || (g[7] = (p) => i.value = !0),
|
|
3044
3044
|
onBlur: g[8] || (g[8] = (p) => i.value = !1)
|
|
3045
3045
|
}, null, 42, cr), [
|
|
@@ -3047,12 +3047,13 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
3047
3047
|
]),
|
|
3048
3048
|
y("button", {
|
|
3049
3049
|
"data-test": "messaging-send-btn",
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3050
|
+
"data-composer-action": pe.value,
|
|
3051
|
+
class: S(["shrink-0 flex items-center justify-center rounded-full transition-transform duration-200 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", yt.value ? "bg-primary-500 text-white hover:scale-105 active:scale-95 cursor-pointer" : I.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
|
|
3052
|
+
disabled: !yt.value,
|
|
3053
|
+
"aria-label": pe.value === "stop" ? "Stop reply" : "Send message",
|
|
3054
|
+
onClick: g[9] || (g[9] = (p) => q())
|
|
3054
3055
|
}, [
|
|
3055
|
-
|
|
3056
|
+
pe.value === "stop" ? (v(), w("i", hr)) : (v(), w("i", dr))
|
|
3056
3057
|
], 10, ur)
|
|
3057
3058
|
], 2)
|
|
3058
3059
|
], 2)
|
|
@@ -3061,7 +3062,7 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
3061
3062
|
}), pr = { class: "agent-wrap" }, fr = {
|
|
3062
3063
|
key: 0,
|
|
3063
3064
|
class: "flex items-center justify-center h-full"
|
|
3064
|
-
}, Ar = /* @__PURE__ */
|
|
3065
|
+
}, Ar = /* @__PURE__ */ Re({
|
|
3065
3066
|
__name: "AgentWrap",
|
|
3066
3067
|
props: {
|
|
3067
3068
|
sdk: {},
|
|
@@ -3078,8 +3079,8 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
3078
3079
|
const t = js("AgentWrap"), e = a, n = e.sdk || Ws.getInstance({
|
|
3079
3080
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
3080
3081
|
...e.apiBase && { apiBase: e.apiBase }
|
|
3081
|
-
}), i =
|
|
3082
|
-
return
|
|
3082
|
+
}), i = re(!e.agent), s = ps(e.agent ? new $t({ config: e.agent }) : void 0), l = re();
|
|
3083
|
+
return Ut(async () => {
|
|
3083
3084
|
if (e.agent) {
|
|
3084
3085
|
t.debug("Agent provided via props, skipping fetch", {
|
|
3085
3086
|
agentId: e.agent.agentId,
|
|
@@ -3105,7 +3106,7 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
3105
3106
|
try {
|
|
3106
3107
|
i.value = !0, t.debug("Fetching public agent", { handle: e.handle });
|
|
3107
3108
|
const o = await n.user.getPublicAgent({ handle: e.handle });
|
|
3108
|
-
o ? (s.value = new
|
|
3109
|
+
o ? (s.value = new $t({ config: o }), t.debug("Successfully fetched public agent", {
|
|
3109
3110
|
agentId: o.agentId,
|
|
3110
3111
|
handle: o.handle
|
|
3111
3112
|
}), o.agentId && n.user.track({
|
|
@@ -3167,7 +3168,7 @@ const Aa = ["innerHTML"], Ot = /* @__PURE__ */ _e({
|
|
|
3167
3168
|
buttonText: a.buttonText,
|
|
3168
3169
|
buttonIcon: a.buttonIcon,
|
|
3169
3170
|
loading: i.value
|
|
3170
|
-
}) :
|
|
3171
|
+
}) : j("", !0)
|
|
3171
3172
|
]));
|
|
3172
3173
|
}
|
|
3173
3174
|
});
|