@pagelines/sdk 1.0.690 → 1.0.692
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AgentWrap.js +463 -457
- package/dist/AgentWrap.js.map +1 -1
- package/dist/contract.js +1 -0
- package/dist/contract.js.map +1 -1
- package/dist/widget.js +1 -1
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
package/dist/AgentWrap.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./rolldown-runtime.js";
|
|
2
2
|
import { s as e, t } from "./sdkClient.js";
|
|
3
3
|
import { Agent as n, CHAT_ISSUE_COPY as r, SettingsObject as i, createLogger as a, getDefaultAvatarUrl as o, isAssistantSilenceControl as s, parseChatVisualFencePayload as c } from "@pagelines/core";
|
|
4
|
-
import { Fragment as u, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as _, createTextVNode as v, createVNode as b, defineComponent as x, nextTick as S, normalizeClass as C, normalizeStyle as T, onBeforeUnmount as te, onMounted as ne, onUnmounted as re, openBlock as k, ref as A, renderList as j, renderSlot as ie, resolveDynamicComponent as ae, shallowRef as P, toDisplayString as F, unref as oe, vModelText as I,
|
|
4
|
+
import { Fragment as u, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as _, createTextVNode as v, createVNode as b, defineComponent as x, nextTick as S, normalizeClass as C, normalizeStyle as T, onBeforeUnmount as te, onMounted as ne, onUnmounted as re, openBlock as k, ref as A, renderList as j, renderSlot as ie, resolveDynamicComponent as ae, shallowRef as P, toDisplayString as F, unref as oe, vModelText as I, vShow as se, watch as ce, withCtx as R, withDirectives as ue, withKeys as de, withModifiers as pe } from "vue";
|
|
5
5
|
//#region ui/FSpinner.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var he = { class: "spinner max-w-sm" }, z = {
|
|
7
7
|
class: "ring-circular h-full w-full origin-center",
|
|
8
8
|
viewBox: "25 25 50 50"
|
|
9
|
-
},
|
|
9
|
+
}, _e = /* @__PURE__ */ x({
|
|
10
10
|
__name: "FSpinner",
|
|
11
11
|
props: {
|
|
12
12
|
width: {
|
|
@@ -19,7 +19,7 @@ var de = { class: "spinner max-w-sm" }, pe = {
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
setup(e) {
|
|
22
|
-
return (t, n) => (k(), h("div",
|
|
22
|
+
return (t, n) => (k(), h("div", he, [(k(), h("svg", z, [_("circle", {
|
|
23
23
|
class: C([e.colorMode, "ring-path"]),
|
|
24
24
|
cx: "50",
|
|
25
25
|
cy: "50",
|
|
@@ -30,7 +30,7 @@ var de = { class: "spinner max-w-sm" }, pe = {
|
|
|
30
30
|
"stroke-miterlimit": "30"
|
|
31
31
|
}, null, 2)]))]));
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
33
|
+
}), ve = [
|
|
34
34
|
{
|
|
35
35
|
mode: "self",
|
|
36
36
|
label: "Overview",
|
|
@@ -185,7 +185,7 @@ var VoiceRecorderController = class extends i {
|
|
|
185
185
|
function durableJournalOutcome(e) {
|
|
186
186
|
return e.turnOutcome === "failed" ? "failed" : e.turnOutcome === "stopped" ? "stopped" : e.sender === "system" ? "failed" : "completed";
|
|
187
187
|
}
|
|
188
|
-
var
|
|
188
|
+
var B = {
|
|
189
189
|
waiting: "Waiting for results",
|
|
190
190
|
finishing: "Finishing up",
|
|
191
191
|
completed: "Work complete",
|
|
@@ -193,7 +193,7 @@ var ve = {
|
|
|
193
193
|
stopped: "Stopped",
|
|
194
194
|
notifyHint: "Taking longer than usual. You can leave and I’ll notify you when it’s ready.",
|
|
195
195
|
leaveHint: "Taking longer than usual. You can leave this chat while I work."
|
|
196
|
-
}, ye = 15e3,
|
|
196
|
+
}, ye = 15e3, H = 6e4, be = 3;
|
|
197
197
|
function toMs(e) {
|
|
198
198
|
if (!e) return;
|
|
199
199
|
let t = Date.parse(e);
|
|
@@ -230,12 +230,12 @@ function milestoneRows(e, t) {
|
|
|
230
230
|
}));
|
|
231
231
|
}
|
|
232
232
|
function splitRows(e) {
|
|
233
|
-
return e.length <=
|
|
233
|
+
return e.length <= be ? {
|
|
234
234
|
visibleRows: e,
|
|
235
235
|
hiddenRows: []
|
|
236
236
|
} : {
|
|
237
|
-
visibleRows: e.slice(e.length -
|
|
238
|
-
hiddenRows: e.slice(0, e.length -
|
|
237
|
+
visibleRows: e.slice(e.length - be),
|
|
238
|
+
hiddenRows: e.slice(0, e.length - be)
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
241
|
function buildWorkJournalModel(e) {
|
|
@@ -247,7 +247,7 @@ function buildWorkJournalModel(e) {
|
|
|
247
247
|
terminal: {
|
|
248
248
|
id: "work-complete",
|
|
249
249
|
tone: "completed",
|
|
250
|
-
label:
|
|
250
|
+
label: B.completed
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
253
|
if (n === "failed") {
|
|
@@ -261,7 +261,7 @@ function buildWorkJournalModel(e) {
|
|
|
261
261
|
terminal: {
|
|
262
262
|
id: "work-failed",
|
|
263
263
|
tone: "failed",
|
|
264
|
-
label:
|
|
264
|
+
label: B.failed,
|
|
265
265
|
...o && e?.note ? { note: e.note } : {}
|
|
266
266
|
}
|
|
267
267
|
};
|
|
@@ -275,18 +275,18 @@ function buildWorkJournalModel(e) {
|
|
|
275
275
|
terminal: {
|
|
276
276
|
id: "work-stopped",
|
|
277
277
|
tone: "stopped",
|
|
278
|
-
label:
|
|
278
|
+
label: B.stopped
|
|
279
279
|
}
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
282
|
let { visibleRows: s, hiddenRows: c } = splitRows(milestoneRows(t, /* @__PURE__ */ new Set())), u = t.filter((e) => e.status === "started").sort(byEvent).pop(), f = t.reduce((e, t) => Math.max(e, eventMs(t)), a ?? -Infinity), p = Number.isFinite(f) ? f : r, m = t.reduce((e, t) => {
|
|
283
283
|
let n = toMs(t.startedAt) ?? toMs(t.endedAt);
|
|
284
284
|
return n === void 0 ? e : Math.min(e, n);
|
|
285
|
-
}, Infinity), h = p + ye, _ = (Number.isFinite(m) ? m : p) +
|
|
285
|
+
}, Infinity), h = p + ye, _ = (Number.isFinite(m) ? m : p) + H, v = r >= h, b = u || v ? {
|
|
286
286
|
id: u?.activityId ?? "work-active",
|
|
287
287
|
tone: "active",
|
|
288
|
-
label: v ? u ?
|
|
289
|
-
} : void 0, x = v && r >= _ ? i ?
|
|
288
|
+
label: v ? u ? B.waiting : B.finishing : u.label
|
|
289
|
+
} : void 0, x = v && r >= _ ? i ? B.notifyHint : B.leaveHint : void 0, S = [h, _].filter((e) => e > r).sort((e, t) => e - t)[0];
|
|
290
290
|
return {
|
|
291
291
|
outcome: n,
|
|
292
292
|
visibleRows: s,
|
|
@@ -352,17 +352,17 @@ function buildLiveTurnBlocks(e) {
|
|
|
352
352
|
}
|
|
353
353
|
//#endregion
|
|
354
354
|
//#region agent/AgentController.ts
|
|
355
|
-
var
|
|
356
|
-
...
|
|
355
|
+
var U = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Se = /* @__PURE__ */ new Set([
|
|
356
|
+
...U,
|
|
357
357
|
"EMPTY_STREAM",
|
|
358
358
|
"RATE_LIMIT"
|
|
359
|
-
]),
|
|
359
|
+
]), W = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), G = {
|
|
360
360
|
CREDIT_LIMIT: "billing_budget_reached",
|
|
361
361
|
OVERAGE_CAP: "billing_runaway_cap"
|
|
362
362
|
};
|
|
363
363
|
function presentChatStreamError(e) {
|
|
364
|
-
if (!(e.bucket !== void 0 ||
|
|
365
|
-
let t = e.bucket ?? (
|
|
364
|
+
if (!(e.bucket !== void 0 || Se.has(e.code))) return { surface: "hard" };
|
|
365
|
+
let t = e.bucket ?? (U.has(e.code) ? "account" : "error"), n = {
|
|
366
366
|
...e.actionLabel ? { actionLabel: e.actionLabel } : {},
|
|
367
367
|
...e.actionUrl ? { actionUrl: e.actionUrl } : {},
|
|
368
368
|
...e.help ? { help: e.help } : {}
|
|
@@ -375,7 +375,7 @@ function presentChatStreamError(e) {
|
|
|
375
375
|
...n
|
|
376
376
|
},
|
|
377
377
|
sendBlockedReason: "account"
|
|
378
|
-
} :
|
|
378
|
+
} : W.has(e.code) ? {
|
|
379
379
|
surface: "transcript",
|
|
380
380
|
issue: {
|
|
381
381
|
code: e.code,
|
|
@@ -393,7 +393,7 @@ function presentChatStreamError(e) {
|
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
395
|
function transcriptMessageForChatStreamError(e) {
|
|
396
|
-
let t =
|
|
396
|
+
let t = G[e.code];
|
|
397
397
|
return t ? r[t].oneLine : e.error;
|
|
398
398
|
}
|
|
399
399
|
var AgentChatController = class extends i {
|
|
@@ -569,7 +569,7 @@ Current User:
|
|
|
569
569
|
});
|
|
570
570
|
}
|
|
571
571
|
setupBoundaryWatcher() {
|
|
572
|
-
|
|
572
|
+
ce(() => this.workJournal.value?.nextBoundaryAtMs, (e) => {
|
|
573
573
|
this.scheduleBoundary(e);
|
|
574
574
|
});
|
|
575
575
|
}
|
|
@@ -631,12 +631,12 @@ Current User:
|
|
|
631
631
|
});
|
|
632
632
|
}
|
|
633
633
|
setupModeWatcher() {
|
|
634
|
-
|
|
634
|
+
ce(this.agentMode, async (e, t) => {
|
|
635
635
|
this.logger.info(`Mode changed from ${t} to ${e}`), this.isTextMode && (t === "talk" || t === "chat") && await this.endConversation();
|
|
636
636
|
});
|
|
637
637
|
}
|
|
638
638
|
setupAvailabilityWatcher() {
|
|
639
|
-
|
|
639
|
+
ce(() => this.chatEnabled, (e) => {
|
|
640
640
|
if (!(!this.isTextMode || this.isConnecting)) {
|
|
641
641
|
if (e) {
|
|
642
642
|
this.textState.value.isConnected || this.updateState(this.textState, {
|
|
@@ -771,7 +771,7 @@ Current User:
|
|
|
771
771
|
let e = i[i.length - 1];
|
|
772
772
|
this.sharedMessages.value = e?.id === a ? [...i.slice(0, -1), r] : [...i, r];
|
|
773
773
|
}
|
|
774
|
-
r.sender === "system" && r.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : r.sender === "system" && r.issue?.code &&
|
|
774
|
+
r.sender === "system" && r.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : r.sender === "system" && r.issue?.code && W.has(r.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
|
|
775
775
|
}, onDone = (e) => {
|
|
776
776
|
if (!isCurrentTurn()) return;
|
|
777
777
|
if (!o && !c) {
|
|
@@ -1131,7 +1131,7 @@ var Ce = {
|
|
|
1131
1131
|
}, We = ["data-journal-row"], Ge = {
|
|
1132
1132
|
class: "flex w-5 shrink-0 flex-col items-center self-stretch",
|
|
1133
1133
|
"aria-hidden": "true"
|
|
1134
|
-
},
|
|
1134
|
+
}, K = { class: "flex h-[17px] shrink-0 items-center" }, Ke = {
|
|
1135
1135
|
key: 0,
|
|
1136
1136
|
class: "sr-only"
|
|
1137
1137
|
}, qe = /* @__PURE__ */ x({
|
|
@@ -1254,7 +1254,7 @@ var Ce = {
|
|
|
1254
1254
|
"data-test": "messaging-tool-activity-row",
|
|
1255
1255
|
"data-journal-row": e.tone,
|
|
1256
1256
|
class: C([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
|
|
1257
|
-
}, [_("div", Ge, [_("span",
|
|
1257
|
+
}, [_("div", Ge, [_("span", K, [(k(), p(ae(c.value[e.tone].station.tag), {
|
|
1258
1258
|
"data-journal-station": e.tone,
|
|
1259
1259
|
class: C(c.value[e.tone].station.class)
|
|
1260
1260
|
}, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? m("", !0) : (k(), h("span", {
|
|
@@ -1313,10 +1313,10 @@ function _unsupportedIterableToArray(e, t) {
|
|
|
1313
1313
|
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(e, t) : void 0;
|
|
1314
1314
|
}
|
|
1315
1315
|
}
|
|
1316
|
-
var Je = Object.entries, Ye = Object.setPrototypeOf, Xe = Object.isFrozen, Ze = Object.getPrototypeOf, Qe = Object.getOwnPropertyDescriptor,
|
|
1317
|
-
|
|
1316
|
+
var Je = Object.entries, Ye = Object.setPrototypeOf, Xe = Object.isFrozen, Ze = Object.getPrototypeOf, Qe = Object.getOwnPropertyDescriptor, q = Object.freeze, J = Object.seal, $e = Object.create, et = typeof Reflect < "u" && Reflect, tt = et.apply, nt = et.construct;
|
|
1317
|
+
q || (q = function freeze(e) {
|
|
1318
1318
|
return e;
|
|
1319
|
-
}),
|
|
1319
|
+
}), J || (J = function seal(e) {
|
|
1320
1320
|
return e;
|
|
1321
1321
|
}), tt || (tt = function apply(e, t) {
|
|
1322
1322
|
var n = [...arguments].slice(2);
|
|
@@ -1324,7 +1324,7 @@ K || (K = function freeze(e) {
|
|
|
1324
1324
|
}), nt || (nt = function construct(e) {
|
|
1325
1325
|
return new e(...[...arguments].slice(1));
|
|
1326
1326
|
});
|
|
1327
|
-
var rt = unapply(Array.prototype.forEach), it = unapply(Array.prototype.lastIndexOf), at = unapply(Array.prototype.pop), st = unapply(Array.prototype.push), ct = unapply(Array.prototype.splice), lt = Array.isArray, ut = unapply(String.prototype.toLowerCase), dt = unapply(String.prototype.toString), ft = unapply(String.prototype.match), pt = unapply(String.prototype.replace), mt = unapply(String.prototype.indexOf), ht = unapply(String.prototype.trim), gt = unapply(Number.prototype.toString), _t = unapply(Boolean.prototype.toString), vt = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), yt = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString),
|
|
1327
|
+
var rt = unapply(Array.prototype.forEach), it = unapply(Array.prototype.lastIndexOf), at = unapply(Array.prototype.pop), st = unapply(Array.prototype.push), ct = unapply(Array.prototype.splice), lt = Array.isArray, ut = unapply(String.prototype.toLowerCase), dt = unapply(String.prototype.toString), ft = unapply(String.prototype.match), pt = unapply(String.prototype.replace), mt = unapply(String.prototype.indexOf), ht = unapply(String.prototype.trim), gt = unapply(Number.prototype.toString), _t = unapply(Boolean.prototype.toString), vt = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), yt = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString), X = unapply(Object.prototype.hasOwnProperty), bt = unapply(Object.prototype.toString), Z = unapply(RegExp.prototype.test), xt = unconstruct(TypeError);
|
|
1328
1328
|
function unapply(e) {
|
|
1329
1329
|
return function(t) {
|
|
1330
1330
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -1352,7 +1352,7 @@ function addToSet(e, t) {
|
|
|
1352
1352
|
return e;
|
|
1353
1353
|
}
|
|
1354
1354
|
function cleanArray(e) {
|
|
1355
|
-
for (let t = 0; t < e.length; t++)
|
|
1355
|
+
for (let t = 0; t < e.length; t++) X(e, t) || (e[t] = null);
|
|
1356
1356
|
return e;
|
|
1357
1357
|
}
|
|
1358
1358
|
function clone(e) {
|
|
@@ -1360,7 +1360,7 @@ function clone(e) {
|
|
|
1360
1360
|
for (let r of Je(e)) {
|
|
1361
1361
|
var n = _slicedToArray(r, 2);
|
|
1362
1362
|
let i = n[0], a = n[1];
|
|
1363
|
-
|
|
1363
|
+
X(e, i) && (lt(a) ? t[i] = cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = clone(a) : t[i] = a);
|
|
1364
1364
|
}
|
|
1365
1365
|
return t;
|
|
1366
1366
|
}
|
|
@@ -1401,12 +1401,12 @@ function lookupGetter(e, t) {
|
|
|
1401
1401
|
}
|
|
1402
1402
|
function isRegex(e) {
|
|
1403
1403
|
try {
|
|
1404
|
-
return
|
|
1404
|
+
return Z(e, ""), !0;
|
|
1405
1405
|
} catch {
|
|
1406
1406
|
return !1;
|
|
1407
1407
|
}
|
|
1408
1408
|
}
|
|
1409
|
-
var St =
|
|
1409
|
+
var St = q(/* @__PURE__ */ "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".split(".")), Ct = q(/* @__PURE__ */ "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".split(".")), wt = q([
|
|
1410
1410
|
"feBlend",
|
|
1411
1411
|
"feColorMatrix",
|
|
1412
1412
|
"feComponentTransfer",
|
|
@@ -1432,7 +1432,7 @@ var St = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1432
1432
|
"feSpotLight",
|
|
1433
1433
|
"feTile",
|
|
1434
1434
|
"feTurbulence"
|
|
1435
|
-
]), Tt =
|
|
1435
|
+
]), Tt = q([
|
|
1436
1436
|
"animate",
|
|
1437
1437
|
"color-profile",
|
|
1438
1438
|
"cursor",
|
|
@@ -1455,7 +1455,7 @@ var St = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1455
1455
|
"solidcolor",
|
|
1456
1456
|
"unknown",
|
|
1457
1457
|
"use"
|
|
1458
|
-
]), Et =
|
|
1458
|
+
]), Et = q(/* @__PURE__ */ "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".split(".")), Dt = q([
|
|
1459
1459
|
"maction",
|
|
1460
1460
|
"maligngroup",
|
|
1461
1461
|
"malignmark",
|
|
@@ -1471,13 +1471,13 @@ var St = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1471
1471
|
"annotation-xml",
|
|
1472
1472
|
"mprescripts",
|
|
1473
1473
|
"none"
|
|
1474
|
-
]), Ot =
|
|
1474
|
+
]), Ot = q(["#text"]), kt = q(/* @__PURE__ */ "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".split(".")), At = q(/* @__PURE__ */ "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.dominant-baseline.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-orientation.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".split(".")), jt = q(/* @__PURE__ */ "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".split(".")), Mt = q([
|
|
1475
1475
|
"xlink:href",
|
|
1476
1476
|
"xml:id",
|
|
1477
1477
|
"xlink:title",
|
|
1478
1478
|
"xml:space",
|
|
1479
1479
|
"xmlns:xlink"
|
|
1480
|
-
]), Nt =
|
|
1480
|
+
]), Nt = J(/{{[\w\W]*|^[\w\W]*}}/g), Pt = J(/<%[\w\W]*|^[\w\W]*%>/g), Ft = J(/\${[\w\W]*/g), It = J(/^data-[\-\w.\u00B7-\uFFFF]+$/), Lt = J(/^aria-[\-\w]+$/), Rt = J(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), zt = J(/^(?:\w+script|data):/i), Bt = J(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Vt = J(/^html$/i), Ht = J(/^[a-z][.\w]*(-[.\w]+)+$/i), Ut = J(/<[/\w!]/g), Wt = J(/<[/\w]/g), Gt = J(/<\/no(script|embed|frames)/i), Kt = J(/\/>/i), qt = {
|
|
1481
1481
|
element: 1,
|
|
1482
1482
|
attribute: 2,
|
|
1483
1483
|
text: 3,
|
|
@@ -1522,7 +1522,7 @@ var St = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1522
1522
|
uponSanitizeShadowNode: []
|
|
1523
1523
|
};
|
|
1524
1524
|
}, Zt = function _resolveSetOption(e, t, n, r) {
|
|
1525
|
-
return
|
|
1525
|
+
return X(e, t) && lt(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
|
|
1526
1526
|
};
|
|
1527
1527
|
function createDOMPurify() {
|
|
1528
1528
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Jt(), DOMPurify = (e) => createDOMPurify(e);
|
|
@@ -1556,7 +1556,7 @@ function createDOMPurify() {
|
|
|
1556
1556
|
return re || (ne = Yt(u, r), re = !0), ne;
|
|
1557
1557
|
}, P = t, F = P.implementation, oe = P.createNodeIterator, I = P.createDocumentFragment, se = P.getElementsByTagName, ce = n.importNode, R = Xt();
|
|
1558
1558
|
DOMPurify.isSupported = typeof Je == "function" && typeof v == "function" && F && F.createHTMLDocument !== void 0;
|
|
1559
|
-
let ue = Nt,
|
|
1559
|
+
let ue = Nt, de = Pt, pe = Ft, he = It, z = Lt, _e = zt, ve = Bt, B = Ht, ye = Rt, H = null, be = addToSet({}, [
|
|
1560
1560
|
...St,
|
|
1561
1561
|
...Ct,
|
|
1562
1562
|
...wt,
|
|
@@ -1586,7 +1586,7 @@ function createDOMPurify() {
|
|
|
1586
1586
|
enumerable: !0,
|
|
1587
1587
|
value: !1
|
|
1588
1588
|
}
|
|
1589
|
-
})),
|
|
1589
|
+
})), G = null, Ce = null, we = Object.seal($e(null, {
|
|
1590
1590
|
tagCheck: {
|
|
1591
1591
|
writable: !0,
|
|
1592
1592
|
configurable: !1,
|
|
@@ -1599,14 +1599,14 @@ function createDOMPurify() {
|
|
|
1599
1599
|
enumerable: !0,
|
|
1600
1600
|
value: null
|
|
1601
1601
|
}
|
|
1602
|
-
})),
|
|
1602
|
+
})), Te = !0, Ee = !0, De = !1, Oe = !0, ke = !1, Ae = !0, je = !1, Me = !1, Ne = null, Pe = null, Fe = !1, Ie = !1, Le = !1, Re = !1, ze = !0, Be = !1, Ve = "user-content-", He = !0, Ue = !1, We = {}, Ge = null, K = addToSet({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), Ke = null, qe = addToSet({}, [
|
|
1603
1603
|
"audio",
|
|
1604
1604
|
"video",
|
|
1605
1605
|
"img",
|
|
1606
1606
|
"source",
|
|
1607
1607
|
"image",
|
|
1608
1608
|
"track"
|
|
1609
|
-
]),
|
|
1609
|
+
]), Ye = null, Xe = addToSet({}, [
|
|
1610
1610
|
"alt",
|
|
1611
1611
|
"class",
|
|
1612
1612
|
"for",
|
|
@@ -1621,40 +1621,40 @@ function createDOMPurify() {
|
|
|
1621
1621
|
"value",
|
|
1622
1622
|
"style",
|
|
1623
1623
|
"xmlns"
|
|
1624
|
-
]),
|
|
1624
|
+
]), Ze = "http://www.w3.org/1998/Math/MathML", Qe = "http://www.w3.org/2000/svg", et = "http://www.w3.org/1999/xhtml", tt = et, nt = !1, gt = null, _t = addToSet({}, [
|
|
1625
|
+
Ze,
|
|
1625
1626
|
Qe,
|
|
1626
|
-
et
|
|
1627
|
-
|
|
1628
|
-
], dt), yt = K([
|
|
1627
|
+
et
|
|
1628
|
+
], dt), vt = q([
|
|
1629
1629
|
"mi",
|
|
1630
1630
|
"mo",
|
|
1631
1631
|
"mn",
|
|
1632
1632
|
"ms",
|
|
1633
1633
|
"mtext"
|
|
1634
|
-
]),
|
|
1634
|
+
]), yt = addToSet({}, vt), bt = q(["annotation-xml"]), Qt = addToSet({}, bt), $t = addToSet({}, [
|
|
1635
1635
|
"title",
|
|
1636
1636
|
"style",
|
|
1637
1637
|
"font",
|
|
1638
1638
|
"a",
|
|
1639
1639
|
"script"
|
|
1640
|
-
]),
|
|
1640
|
+
]), en = null, tn = ["application/xhtml+xml", "text/html"], Q = null, nn = null, rn = t.createElement("form"), an = function isRegexOrFunction(e) {
|
|
1641
1641
|
return e instanceof RegExp || e instanceof Function;
|
|
1642
1642
|
}, on = function _parseConfig() {
|
|
1643
1643
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1644
1644
|
if (nn && nn === e) return;
|
|
1645
|
-
(!e || typeof e != "object") && (e = {}), e = clone(e),
|
|
1645
|
+
(!e || typeof e != "object") && (e = {}), e = clone(e), en = tn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Q = en === "application/xhtml+xml" ? dt : ut, H = Zt(e, "ALLOWED_TAGS", be, { transform: Q }), U = Zt(e, "ALLOWED_ATTR", Se, { transform: Q }), gt = Zt(e, "ALLOWED_NAMESPACES", _t, { transform: dt }), Ye = Zt(e, "ADD_URI_SAFE_ATTR", Xe, {
|
|
1646
1646
|
transform: Q,
|
|
1647
|
-
base:
|
|
1648
|
-
}),
|
|
1647
|
+
base: Xe
|
|
1648
|
+
}), Ke = Zt(e, "ADD_DATA_URI_TAGS", qe, {
|
|
1649
1649
|
transform: Q,
|
|
1650
|
-
base:
|
|
1651
|
-
}),
|
|
1652
|
-
let t =
|
|
1653
|
-
if (W = $e(null),
|
|
1650
|
+
base: qe
|
|
1651
|
+
}), Ge = Zt(e, "FORBID_CONTENTS", K, { transform: Q }), G = Zt(e, "FORBID_TAGS", clone({}), { transform: Q }), Ce = Zt(e, "FORBID_ATTR", clone({}), { transform: Q }), We = X(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? clone(e.USE_PROFILES) : e.USE_PROFILES : !1, Te = e.ALLOW_ARIA_ATTR !== !1, Ee = e.ALLOW_DATA_ATTR !== !1, De = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Oe = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ke = e.SAFE_FOR_TEMPLATES || !1, Ae = e.SAFE_FOR_XML !== !1, je = e.WHOLE_DOCUMENT || !1, Ie = e.RETURN_DOM || !1, Le = e.RETURN_DOM_FRAGMENT || !1, Re = e.RETURN_TRUSTED_TYPE || !1, Fe = e.FORCE_BODY || !1, ze = e.SANITIZE_DOM !== !1, Be = e.SANITIZE_NAMED_PROPS || !1, He = e.KEEP_CONTENT !== !1, Ue = e.IN_PLACE || !1, ye = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Rt, tt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : et, yt = X(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, vt), Qt = X(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, bt);
|
|
1652
|
+
let t = X(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? clone(e.CUSTOM_ELEMENT_HANDLING) : $e(null);
|
|
1653
|
+
if (W = $e(null), X(t, "tagNameCheck") && an(t.tagNameCheck) && (W.tagNameCheck = t.tagNameCheck), X(t, "attributeNameCheck") && an(t.attributeNameCheck) && (W.attributeNameCheck = t.attributeNameCheck), X(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), J(W), ke && (Ee = !1), Le && (Ie = !0), We && (H = addToSet({}, Ot), U = $e(null), We.html === !0 && (addToSet(H, St), addToSet(U, kt)), We.svg === !0 && (addToSet(H, Ct), addToSet(U, At), addToSet(U, Mt)), We.svgFilters === !0 && (addToSet(H, wt), addToSet(U, At), addToSet(U, Mt)), We.mathMl === !0 && (addToSet(H, Et), addToSet(U, jt), addToSet(U, Mt))), we.tagCheck = null, we.attributeCheck = null, X(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? we.tagCheck = e.ADD_TAGS : lt(e.ADD_TAGS) && (H === be && (H = clone(H)), addToSet(H, e.ADD_TAGS, Q))), X(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? we.attributeCheck = e.ADD_ATTR : lt(e.ADD_ATTR) && (U === Se && (U = clone(U)), addToSet(U, e.ADD_ATTR, Q))), X(e, "ADD_URI_SAFE_ATTR") && lt(e.ADD_URI_SAFE_ATTR) && addToSet(Ye, e.ADD_URI_SAFE_ATTR, Q), X(e, "FORBID_CONTENTS") && lt(e.FORBID_CONTENTS) && (Ge === K && (Ge = clone(Ge)), addToSet(Ge, e.FORBID_CONTENTS, Q)), X(e, "ADD_FORBID_CONTENTS") && lt(e.ADD_FORBID_CONTENTS) && (Ge === K && (Ge = clone(Ge)), addToSet(Ge, e.ADD_FORBID_CONTENTS, Q)), He && (H["#text"] = !0), je && addToSet(H, [
|
|
1654
1654
|
"html",
|
|
1655
1655
|
"head",
|
|
1656
1656
|
"body"
|
|
1657
|
-
]), H.table && (addToSet(H, ["tbody"]), delete
|
|
1657
|
+
]), H.table && (addToSet(H, ["tbody"]), delete G.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
1658
1658
|
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw xt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
1659
1659
|
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw xt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
1660
1660
|
let t = T;
|
|
@@ -1665,25 +1665,25 @@ function createDOMPurify() {
|
|
|
1665
1665
|
throw T = t, e;
|
|
1666
1666
|
}
|
|
1667
1667
|
} else e.TRUSTED_TYPES_POLICY === null ? (T = void 0, te = "") : (T === void 0 && (T = ae()), T && typeof te == "string" && (te = j("")));
|
|
1668
|
-
|
|
1668
|
+
q && q(e), nn = e;
|
|
1669
1669
|
}, sn = addToSet({}, [
|
|
1670
1670
|
...Ct,
|
|
1671
1671
|
...wt,
|
|
1672
1672
|
...Tt
|
|
1673
1673
|
]), cn = addToSet({}, [...Et, ...Dt]), ln = function _checkSvgNamespace(e, t, n) {
|
|
1674
|
-
return t.namespaceURI ===
|
|
1674
|
+
return t.namespaceURI === et ? e === "svg" : t.namespaceURI === Ze ? e === "svg" && (n === "annotation-xml" || yt[n]) : !!sn[e];
|
|
1675
1675
|
}, un = function _checkMathMlNamespace(e, t, n) {
|
|
1676
|
-
return t.namespaceURI ===
|
|
1676
|
+
return t.namespaceURI === et ? e === "math" : t.namespaceURI === Qe ? e === "math" && Qt[n] : !!cn[e];
|
|
1677
1677
|
}, dn = function _checkHtmlNamespace(e, t, n) {
|
|
1678
|
-
return t.namespaceURI ===
|
|
1678
|
+
return t.namespaceURI === Qe && !Qt[n] || t.namespaceURI === Ze && !yt[n] ? !1 : !cn[e] && ($t[e] || !sn[e]);
|
|
1679
1679
|
}, fn = function _checkValidNamespace(e) {
|
|
1680
1680
|
let t = v(e);
|
|
1681
1681
|
(!t || !t.tagName) && (t = {
|
|
1682
|
-
namespaceURI:
|
|
1682
|
+
namespaceURI: tt,
|
|
1683
1683
|
tagName: "template"
|
|
1684
1684
|
});
|
|
1685
1685
|
let n = ut(e.tagName), r = ut(t.tagName);
|
|
1686
|
-
return
|
|
1686
|
+
return gt[e.namespaceURI] ? e.namespaceURI === Qe ? ln(n, t, r) : e.namespaceURI === Ze ? un(n, t, r) : e.namespaceURI === et ? dn(n, t, r) : !!(en === "application/xhtml+xml" && gt[e.namespaceURI]) : !1;
|
|
1687
1687
|
}, pn = function _forceRemove(e) {
|
|
1688
1688
|
st(DOMPurify.removed, { element: e });
|
|
1689
1689
|
try {
|
|
@@ -1723,7 +1723,7 @@ function createDOMPurify() {
|
|
|
1723
1723
|
from: t
|
|
1724
1724
|
});
|
|
1725
1725
|
}
|
|
1726
|
-
if (t.removeAttribute(e), e === "is") if (
|
|
1726
|
+
if (t.removeAttribute(e), e === "is") if (Ie || Le) try {
|
|
1727
1727
|
pn(t);
|
|
1728
1728
|
} catch {}
|
|
1729
1729
|
else try {
|
|
@@ -1746,11 +1746,11 @@ function createDOMPurify() {
|
|
|
1746
1746
|
if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
|
|
1747
1747
|
}
|
|
1748
1748
|
}, vn = function _neutralizePatchLinkage(e) {
|
|
1749
|
-
if (!
|
|
1749
|
+
if (!Ae) return;
|
|
1750
1750
|
let t = [e];
|
|
1751
1751
|
for (; t.length > 0;) {
|
|
1752
1752
|
let e = t.pop(), n = S ? S(e) : e.nodeType;
|
|
1753
|
-
if (n === qt.processingInstruction || n === qt.comment &&
|
|
1753
|
+
if (n === qt.processingInstruction || n === qt.comment && Z(Wt, e.data)) {
|
|
1754
1754
|
try {
|
|
1755
1755
|
m(e);
|
|
1756
1756
|
} catch {}
|
|
@@ -1767,28 +1767,28 @@ function createDOMPurify() {
|
|
|
1767
1767
|
}
|
|
1768
1768
|
}, yn = function _initDocument(e) {
|
|
1769
1769
|
let n = null, r = null;
|
|
1770
|
-
if (
|
|
1770
|
+
if (Fe) e = "<remove></remove>" + e;
|
|
1771
1771
|
else {
|
|
1772
1772
|
let t = ft(e, /^[\r\n\t ]+/);
|
|
1773
1773
|
r = t && t[0];
|
|
1774
1774
|
}
|
|
1775
|
-
|
|
1775
|
+
en === "application/xhtml+xml" && tt === et && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
1776
1776
|
let i = T ? j(e) : e;
|
|
1777
|
-
if (
|
|
1778
|
-
n = new c().parseFromString(i,
|
|
1777
|
+
if (tt === et) try {
|
|
1778
|
+
n = new c().parseFromString(i, en);
|
|
1779
1779
|
} catch {}
|
|
1780
1780
|
if (!n || !n.documentElement) {
|
|
1781
|
-
n = F.createDocument(
|
|
1781
|
+
n = F.createDocument(tt, "template", null);
|
|
1782
1782
|
try {
|
|
1783
|
-
n.documentElement.innerHTML =
|
|
1783
|
+
n.documentElement.innerHTML = nt ? te : i;
|
|
1784
1784
|
} catch {}
|
|
1785
1785
|
}
|
|
1786
1786
|
let a = n.body || n.documentElement;
|
|
1787
|
-
return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null),
|
|
1787
|
+
return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), tt === et ? se.call(n, je ? "html" : "body")[0] : je ? n.documentElement : a;
|
|
1788
1788
|
}, bn = function _createNodeIterator(e) {
|
|
1789
1789
|
return oe.call(e.ownerDocument || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION, null);
|
|
1790
1790
|
}, xn = function _stripTemplateExpressions(e) {
|
|
1791
|
-
return e = pt(e, ue, " "), e = pt(e,
|
|
1791
|
+
return e = pt(e, ue, " "), e = pt(e, de, " "), e = pt(e, pe, " "), e;
|
|
1792
1792
|
}, Sn = function _scrubTemplateExpressions(e) {
|
|
1793
1793
|
e.normalize();
|
|
1794
1794
|
let t = oe.call(e.ownerDocument || e, e, s.SHOW_TEXT | s.SHOW_COMMENT | s.SHOW_CDATA_SECTION | s.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
|
|
@@ -1821,15 +1821,15 @@ function createDOMPurify() {
|
|
|
1821
1821
|
});
|
|
1822
1822
|
}
|
|
1823
1823
|
let En = function _isUnsafeNode(e, t) {
|
|
1824
|
-
return !!(
|
|
1824
|
+
return !!(Ae && e.hasChildNodes() && !Tn(e.firstElementChild) && Z(Ut, e.textContent) && Z(Ut, e.innerHTML) || Ae && e.namespaceURI === et && t === "style" && Tn(e.firstElementChild) || e.nodeType === qt.processingInstruction || Ae && e.nodeType === qt.comment && Z(Wt, e.data));
|
|
1825
1825
|
}, Dn = function _sanitizeDisallowedNode(e, t) {
|
|
1826
|
-
if (!
|
|
1827
|
-
if (
|
|
1826
|
+
if (!G[t] && jn(t) && (W.tagNameCheck instanceof RegExp && Z(W.tagNameCheck, t) || W.tagNameCheck instanceof Function && W.tagNameCheck(t))) return !1;
|
|
1827
|
+
if (He && !Ge[t]) {
|
|
1828
1828
|
let t = v(e), n = _(e);
|
|
1829
1829
|
if (n && t) {
|
|
1830
1830
|
let r = n.length;
|
|
1831
1831
|
for (let i = r - 1; i >= 0; --i) {
|
|
1832
|
-
let r =
|
|
1832
|
+
let r = Ue ? n[i] : p(n[i], !0);
|
|
1833
1833
|
t.insertBefore(r, h(e));
|
|
1834
1834
|
}
|
|
1835
1835
|
}
|
|
@@ -1844,23 +1844,23 @@ function createDOMPurify() {
|
|
|
1844
1844
|
allowedTags: H
|
|
1845
1845
|
}), e !== t && v(e) === null) return !0;
|
|
1846
1846
|
if (En(e, n)) return pn(e), !0;
|
|
1847
|
-
if (
|
|
1847
|
+
if (G[n] || !(we.tagCheck instanceof Function && we.tagCheck(n)) && !H[n]) {
|
|
1848
1848
|
let t = Dn(e, n);
|
|
1849
1849
|
return t === !1 && _executeHooks(R.afterSanitizeElements, e, null), t;
|
|
1850
1850
|
}
|
|
1851
|
-
if ((S ? S(e) : e.nodeType) === qt.element && !fn(e) || (n === "noscript" || n === "noembed" || n === "noframes") &&
|
|
1852
|
-
if (
|
|
1851
|
+
if ((S ? S(e) : e.nodeType) === qt.element && !fn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && Z(Gt, e.innerHTML)) return pn(e), !0;
|
|
1852
|
+
if (ke && e.nodeType === qt.text) {
|
|
1853
1853
|
let t = xn(e.textContent);
|
|
1854
1854
|
e.textContent !== t && (st(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
|
|
1855
1855
|
}
|
|
1856
1856
|
return _executeHooks(R.afterSanitizeElements, e, null), !1;
|
|
1857
1857
|
}, kn = function _isValidAttribute(e, n, r) {
|
|
1858
|
-
if (
|
|
1859
|
-
let i = U[n] ||
|
|
1860
|
-
if (!(
|
|
1858
|
+
if (Ce[n] || Ae && n === "patchsrc" || Ae && n === "for" && e !== "label" && e !== "output" || ze && (n === "id" || n === "name") && (r in t || r in rn)) return !1;
|
|
1859
|
+
let i = U[n] || we.attributeCheck instanceof Function && we.attributeCheck(n, e);
|
|
1860
|
+
if (!(Ee && Z(he, n)) && !(Te && Z(z, n))) {
|
|
1861
1861
|
if (!i) {
|
|
1862
|
-
if (!(jn(e) && (W.tagNameCheck instanceof RegExp &&
|
|
1863
|
-
} else if (!
|
|
1862
|
+
if (!(jn(e) && (W.tagNameCheck instanceof RegExp && Z(W.tagNameCheck, e) || W.tagNameCheck instanceof Function && W.tagNameCheck(e)) && (W.attributeNameCheck instanceof RegExp && Z(W.attributeNameCheck, n) || W.attributeNameCheck instanceof Function && W.attributeNameCheck(n, e)) || n === "is" && W.allowCustomizedBuiltInElements && (W.tagNameCheck instanceof RegExp && Z(W.tagNameCheck, r) || W.tagNameCheck instanceof Function && W.tagNameCheck(r)))) return !1;
|
|
1863
|
+
} else if (!Ye[n] && !Z(ye, pt(r, ve, "")) && !((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && mt(r, "data:") === 0 && Ke[e]) && !(De && !Z(_e, pt(r, ve, ""))) && r) return !1;
|
|
1864
1864
|
}
|
|
1865
1865
|
return !0;
|
|
1866
1866
|
}, An = addToSet({}, [
|
|
@@ -1873,7 +1873,7 @@ function createDOMPurify() {
|
|
|
1873
1873
|
"font-face-uri",
|
|
1874
1874
|
"missing-glyph"
|
|
1875
1875
|
]), jn = function _isBasicCustomElement(e) {
|
|
1876
|
-
return !An[ut(e)] &&
|
|
1876
|
+
return !An[ut(e)] && Z(B, e);
|
|
1877
1877
|
}, Mn = function _applyTrustedTypesToAttribute(e, t, n, r) {
|
|
1878
1878
|
if (T && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
1879
1879
|
case "TrustedHTML": return j(r);
|
|
@@ -1899,7 +1899,7 @@ function createDOMPurify() {
|
|
|
1899
1899
|
}, r = t.length, i = Q(e.nodeName);
|
|
1900
1900
|
for (; r--;) {
|
|
1901
1901
|
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, u = Q(o), f = c, p = o === "value" ? f : ht(f);
|
|
1902
|
-
if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(R.uponSanitizeAttribute, e, n), p = n.attrValue,
|
|
1902
|
+
if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(R.uponSanitizeAttribute, e, n), p = n.attrValue, Be && (u === "id" || u === "name") && mt(p, Ve) !== 0 && (hn(o, e), p = Ve + p), Ae && Z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, p)) {
|
|
1903
1903
|
hn(o, e);
|
|
1904
1904
|
continue;
|
|
1905
1905
|
}
|
|
@@ -1912,11 +1912,11 @@ function createDOMPurify() {
|
|
|
1912
1912
|
hn(o, e);
|
|
1913
1913
|
continue;
|
|
1914
1914
|
}
|
|
1915
|
-
if (!
|
|
1915
|
+
if (!Oe && Z(Kt, p)) {
|
|
1916
1916
|
hn(o, e);
|
|
1917
1917
|
continue;
|
|
1918
1918
|
}
|
|
1919
|
-
if (
|
|
1919
|
+
if (ke && (p = xn(p)), !kn(i, u, p)) {
|
|
1920
1920
|
hn(o, e);
|
|
1921
1921
|
continue;
|
|
1922
1922
|
}
|
|
@@ -1971,16 +1971,16 @@ function createDOMPurify() {
|
|
|
1971
1971
|
};
|
|
1972
1972
|
return DOMPurify.sanitize = function(e) {
|
|
1973
1973
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, i = null, a = null, o = null;
|
|
1974
|
-
if (
|
|
1974
|
+
if (nt = !e, nt && (e = "<!-->"), typeof e != "string" && !Tn(e) && (e = stringifyValue(e), typeof e != "string")) throw xt("dirty is not a string, aborting");
|
|
1975
1975
|
if (!DOMPurify.isSupported) return e;
|
|
1976
|
-
|
|
1977
|
-
let s =
|
|
1976
|
+
Me ? (H = Ne, U = Pe) : on(t), (R.uponSanitizeElement.length > 0 || R.uponSanitizeAttribute.length > 0) && (H = clone(H)), R.uponSanitizeAttribute.length > 0 && (U = clone(U)), DOMPurify.removed = [];
|
|
1977
|
+
let s = Ue && typeof e != "string" && Tn(e);
|
|
1978
1978
|
if (s) {
|
|
1979
1979
|
vn(e);
|
|
1980
1980
|
let t = C ? C(e) : e.nodeName;
|
|
1981
1981
|
if (typeof t == "string") {
|
|
1982
1982
|
let n = Q(t);
|
|
1983
|
-
if (!H[n] ||
|
|
1983
|
+
if (!H[n] || G[n]) throw mn(e), xt("root node is forbidden and cannot be sanitized in-place");
|
|
1984
1984
|
}
|
|
1985
1985
|
if (Cn(e)) throw mn(e), xt("root node is clobbered and cannot be sanitized in-place");
|
|
1986
1986
|
try {
|
|
@@ -1990,10 +1990,10 @@ function createDOMPurify() {
|
|
|
1990
1990
|
}
|
|
1991
1991
|
} else if (Tn(e)) r = yn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType === qt.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? r = i : r.appendChild(i), In(i);
|
|
1992
1992
|
else {
|
|
1993
|
-
if (!
|
|
1994
|
-
if (r = yn(e), !r) return
|
|
1993
|
+
if (!Ie && !ke && !je && e.indexOf("<") === -1) return T && Re ? j(e) : e;
|
|
1994
|
+
if (r = yn(e), !r) return Ie ? null : Re ? te : "";
|
|
1995
1995
|
}
|
|
1996
|
-
r &&
|
|
1996
|
+
r && Fe && pn(r.firstChild);
|
|
1997
1997
|
let c = s ? e : r, u = bn(c);
|
|
1998
1998
|
try {
|
|
1999
1999
|
for (; a = u.nextNode();) On(a, c), Pn(a), wn(a.content) && Fn(a.content);
|
|
@@ -2004,27 +2004,27 @@ function createDOMPurify() {
|
|
|
2004
2004
|
}
|
|
2005
2005
|
if (s) return rt(DOMPurify.removed, (e) => {
|
|
2006
2006
|
e.element && _n(e.element);
|
|
2007
|
-
}),
|
|
2008
|
-
if (
|
|
2009
|
-
if (
|
|
2007
|
+
}), ke && Sn(e), e;
|
|
2008
|
+
if (Ie) {
|
|
2009
|
+
if (ke && Sn(r), Le) for (o = I.call(r.ownerDocument); r.firstChild;) o.appendChild(r.firstChild);
|
|
2010
2010
|
else o = r;
|
|
2011
2011
|
return (U.shadowroot || U.shadowrootmode) && (o = ce.call(n, o, !0)), o;
|
|
2012
2012
|
}
|
|
2013
|
-
let f =
|
|
2014
|
-
return
|
|
2013
|
+
let f = je ? r.outerHTML : r.innerHTML;
|
|
2014
|
+
return je && H["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && Z(Vt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), ke && (f = xn(f)), T && Re ? j(f) : f;
|
|
2015
2015
|
}, DOMPurify.setConfig = function() {
|
|
2016
2016
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2017
|
-
on(e),
|
|
2017
|
+
on(e), Me = !0, Ne = H, Pe = U;
|
|
2018
2018
|
}, DOMPurify.clearConfig = function() {
|
|
2019
|
-
nn = null,
|
|
2019
|
+
nn = null, Me = !1, Ne = null, Pe = null, T = ne, te = "";
|
|
2020
2020
|
}, DOMPurify.isValidAttribute = function(e, t, n) {
|
|
2021
2021
|
nn || on({});
|
|
2022
2022
|
let r = Q(e), i = Q(t);
|
|
2023
2023
|
return kn(r, i, n);
|
|
2024
2024
|
}, DOMPurify.addHook = function(e, t) {
|
|
2025
|
-
typeof t == "function" &&
|
|
2025
|
+
typeof t == "function" && X(R, e) && st(R[e], t);
|
|
2026
2026
|
}, DOMPurify.removeHook = function(e, t) {
|
|
2027
|
-
if (
|
|
2027
|
+
if (X(R, e)) {
|
|
2028
2028
|
if (t !== void 0) {
|
|
2029
2029
|
let n = it(R[e], t);
|
|
2030
2030
|
return n === -1 ? void 0 : ct(R[e], n, 1)[0];
|
|
@@ -2032,7 +2032,7 @@ function createDOMPurify() {
|
|
|
2032
2032
|
return at(R[e]);
|
|
2033
2033
|
}
|
|
2034
2034
|
}, DOMPurify.removeHooks = function(e) {
|
|
2035
|
-
|
|
2035
|
+
X(R, e) && (R[e] = []);
|
|
2036
2036
|
}, DOMPurify.removeAllHooks = function() {
|
|
2037
2037
|
R = Xt();
|
|
2038
2038
|
}, DOMPurify;
|
|
@@ -2068,7 +2068,7 @@ function d(e, t = "") {
|
|
|
2068
2068
|
let n = typeof e == "string" ? e : e.source, r = {
|
|
2069
2069
|
replace: (e, t) => {
|
|
2070
2070
|
let i = typeof t == "string" ? t : t.source;
|
|
2071
|
-
return i = i.replace(
|
|
2071
|
+
return i = i.replace(Q.caret, "$1"), n = n.replace(e, i), r;
|
|
2072
2072
|
},
|
|
2073
2073
|
getRegex: () => new RegExp(n, t)
|
|
2074
2074
|
};
|
|
@@ -2080,7 +2080,7 @@ var tn = ((e = "") => {
|
|
|
2080
2080
|
} catch {
|
|
2081
2081
|
return !1;
|
|
2082
2082
|
}
|
|
2083
|
-
})(),
|
|
2083
|
+
})(), Q = {
|
|
2084
2084
|
codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
|
|
2085
2085
|
outputLinkReplace: /\\([\[\]])/g,
|
|
2086
2086
|
indentCodeCompensation: /^(\s+)(?:```)/,
|
|
@@ -2137,112 +2137,112 @@ var tn = ((e = "") => {
|
|
|
2137
2137
|
headingBeginRegex: E((e) => RegExp(`^ {0,${e}}#`)),
|
|
2138
2138
|
htmlBeginRegex: E((e) => RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")),
|
|
2139
2139
|
blockquoteBeginRegex: E((e) => RegExp(`^ {0,${e}}>`))
|
|
2140
|
-
},
|
|
2141
|
-
blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",
|
|
2142
|
-
code:
|
|
2143
|
-
def:
|
|
2144
|
-
fences:
|
|
2145
|
-
heading:
|
|
2146
|
-
hr:
|
|
2147
|
-
html:
|
|
2148
|
-
lheading: ln,
|
|
2149
|
-
list: hn,
|
|
2150
|
-
newline: Q,
|
|
2151
|
-
paragraph: yn,
|
|
2152
|
-
table: en,
|
|
2153
|
-
text: fn
|
|
2154
|
-
}, Sn = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", an).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", gn).getRegex(), Cn = {
|
|
2155
|
-
...xn,
|
|
2140
|
+
}, nn = /^(?:[ \t]*(?:\n|$))+/, rn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, an = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, on = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, sn = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, cn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ln = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, un = d(ln).replace(/bull/g, cn).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(), dn = d(ln).replace(/bull/g, cn).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(), fn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, pn = /^[^\n]+/, mn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, hn = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", mn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), gn = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, cn).getRegex(), _n = "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", vn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, yn = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n+|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n+|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\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", vn).replace("tag", _n).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), le = (e) => d(fn).replace("hr", on).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", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _n).getRegex(), bn = le(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), xn = le(/ {0,3}(?:[*+-]|\d{1,9}[.)])[ \t]+[^ \t\n]/), Sn = {
|
|
2141
|
+
blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", xn).getRegex(),
|
|
2142
|
+
code: rn,
|
|
2143
|
+
def: hn,
|
|
2144
|
+
fences: an,
|
|
2145
|
+
heading: sn,
|
|
2146
|
+
hr: on,
|
|
2147
|
+
html: yn,
|
|
2156
2148
|
lheading: un,
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2149
|
+
list: gn,
|
|
2150
|
+
newline: nn,
|
|
2151
|
+
paragraph: bn,
|
|
2152
|
+
table: en,
|
|
2153
|
+
text: pn
|
|
2154
|
+
}, Cn = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", on).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", _n).getRegex(), wn = {
|
|
2155
|
+
...Sn,
|
|
2156
|
+
lheading: dn,
|
|
2157
|
+
table: Cn,
|
|
2158
|
+
paragraph: d(fn).replace("hr", on).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Cn).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", _n).getRegex()
|
|
2159
|
+
}, Tn = {
|
|
2160
|
+
...Sn,
|
|
2161
|
+
html: d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", vn).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(),
|
|
2162
2162
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
2163
2163
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
2164
2164
|
fences: en,
|
|
2165
2165
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
2166
|
-
paragraph: d(
|
|
2167
|
-
},
|
|
2166
|
+
paragraph: d(fn).replace("hr", on).replace("heading", " *#{1,6} *[^\n]").replace("lheading", un).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
2167
|
+
}, En = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Dn = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, On = /^( {2,}|\\)\n(?!\s*$)/, kn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, An = /[\p{P}\p{S}]/u, jn = /[\s\p{P}\p{S}]/u, Mn = /[^\s\p{P}\p{S}]/u, Nn = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, jn).getRegex(), Pn = /(?!~)[\p{P}\p{S}]/u, Fn = /(?!~)[\s\p{P}\p{S}]/u, In = /(?:[^\s\p{P}\p{S}]|~)/u, Ln = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", tn ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Rn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, zn = d(Rn, "u").replace(/punct/g, An).getRegex(), Bn = d(Rn, "u").replace(/punct/g, Pn).getRegex(), Vn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Hn = d(Vn, "gu").replace(/notPunctSpace/g, Mn).replace(/punctSpace/g, jn).replace(/punct/g, An).getRegex(), Un = d(Vn, "gu").replace(/notPunctSpace/g, In).replace(/punctSpace/g, Fn).replace(/punct/g, Pn).getRegex(), Wn = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Mn).replace(/punctSpace/g, jn).replace(/punct/g, An).getRegex(), Gn = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, An).getRegex(), Kn = d("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Mn).replace(/punctSpace/g, jn).replace(/punct/g, An).getRegex(), qn = d(/\\(punct)/, "gu").replace(/punct/g, An).getRegex(), Jn = d(/^<(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(), Yn = d(vn).replace("(?:-->|$)", "-->").getRegex(), Xn = d("^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", Yn).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Zn = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Qn = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Zn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), $n = d(/^!?\[(label)\]\[(ref)\]/).replace("label", Zn).replace("ref", mn).getRegex(), er = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", mn).getRegex(), tr = d("reflink|nolink(?!\\()", "g").replace("reflink", $n).replace("nolink", er).getRegex(), nr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, rr = {
|
|
2168
2168
|
_backpedal: en,
|
|
2169
|
-
anyPunctuation:
|
|
2170
|
-
autolink:
|
|
2171
|
-
blockSkip:
|
|
2172
|
-
br:
|
|
2173
|
-
code:
|
|
2169
|
+
anyPunctuation: qn,
|
|
2170
|
+
autolink: Jn,
|
|
2171
|
+
blockSkip: Ln,
|
|
2172
|
+
br: On,
|
|
2173
|
+
code: Dn,
|
|
2174
2174
|
del: en,
|
|
2175
2175
|
delLDelim: en,
|
|
2176
2176
|
delRDelim: en,
|
|
2177
|
-
emStrongLDelim:
|
|
2178
|
-
emStrongRDelimAst:
|
|
2179
|
-
emStrongRDelimUnd:
|
|
2180
|
-
escape:
|
|
2181
|
-
link:
|
|
2182
|
-
nolink:
|
|
2183
|
-
punctuation:
|
|
2184
|
-
reflink:
|
|
2185
|
-
reflinkSearch:
|
|
2186
|
-
tag:
|
|
2187
|
-
text:
|
|
2177
|
+
emStrongLDelim: zn,
|
|
2178
|
+
emStrongRDelimAst: Hn,
|
|
2179
|
+
emStrongRDelimUnd: Wn,
|
|
2180
|
+
escape: En,
|
|
2181
|
+
link: Qn,
|
|
2182
|
+
nolink: er,
|
|
2183
|
+
punctuation: Nn,
|
|
2184
|
+
reflink: $n,
|
|
2185
|
+
reflinkSearch: tr,
|
|
2186
|
+
tag: Xn,
|
|
2187
|
+
text: kn,
|
|
2188
2188
|
url: en
|
|
2189
|
-
}, rr = {
|
|
2190
|
-
...nr,
|
|
2191
|
-
link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", Xn).getRegex(),
|
|
2192
|
-
reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Xn).getRegex()
|
|
2193
2189
|
}, ir = {
|
|
2194
|
-
...
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2190
|
+
...rr,
|
|
2191
|
+
link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", Zn).getRegex(),
|
|
2192
|
+
reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Zn).getRegex()
|
|
2193
|
+
}, ar = {
|
|
2194
|
+
...rr,
|
|
2195
|
+
emStrongRDelimAst: Un,
|
|
2196
|
+
emStrongLDelim: Bn,
|
|
2197
|
+
delLDelim: Gn,
|
|
2198
|
+
delRDelim: Kn,
|
|
2199
|
+
url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", nr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
2200
2200
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
2201
2201
|
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
2202
|
-
text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",
|
|
2203
|
-
}, ar = {
|
|
2204
|
-
...ir,
|
|
2205
|
-
br: d(Dn).replace("{2,}", "*").getRegex(),
|
|
2206
|
-
text: d(ir.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
2202
|
+
text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", nr).getRegex()
|
|
2207
2203
|
}, or = {
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2204
|
+
...ar,
|
|
2205
|
+
br: d(On).replace("{2,}", "*").getRegex(),
|
|
2206
|
+
text: d(ar.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
2211
2207
|
}, sr = {
|
|
2212
|
-
normal:
|
|
2213
|
-
gfm:
|
|
2214
|
-
|
|
2215
|
-
pedantic: rr
|
|
2208
|
+
normal: Sn,
|
|
2209
|
+
gfm: wn,
|
|
2210
|
+
pedantic: Tn
|
|
2216
2211
|
}, cr = {
|
|
2212
|
+
normal: rr,
|
|
2213
|
+
gfm: ar,
|
|
2214
|
+
breaks: or,
|
|
2215
|
+
pedantic: ir
|
|
2216
|
+
}, lr = {
|
|
2217
2217
|
"&": "&",
|
|
2218
2218
|
"<": "<",
|
|
2219
2219
|
">": ">",
|
|
2220
2220
|
"\"": """,
|
|
2221
2221
|
"'": "'"
|
|
2222
|
-
}, ge = (e) =>
|
|
2222
|
+
}, ge = (e) => lr[e];
|
|
2223
2223
|
function O(e, t) {
|
|
2224
2224
|
if (t) {
|
|
2225
|
-
if (
|
|
2226
|
-
} else if (
|
|
2225
|
+
if (Q.escapeTest.test(e)) return e.replace(Q.escapeReplace, ge);
|
|
2226
|
+
} else if (Q.escapeTestNoEncode.test(e)) return e.replace(Q.escapeReplaceNoEncode, ge);
|
|
2227
2227
|
return e;
|
|
2228
2228
|
}
|
|
2229
2229
|
function V(e) {
|
|
2230
2230
|
try {
|
|
2231
|
-
e = encodeURI(e).replace(
|
|
2231
|
+
e = encodeURI(e).replace(Q.percentDecode, "%");
|
|
2232
2232
|
} catch {
|
|
2233
2233
|
return null;
|
|
2234
2234
|
}
|
|
2235
2235
|
return e;
|
|
2236
2236
|
}
|
|
2237
2237
|
function Y(e, t) {
|
|
2238
|
-
let n = e.replace(
|
|
2238
|
+
let n = e.replace(Q.findPipe, (e, t, n) => {
|
|
2239
2239
|
let r = !1, i = t;
|
|
2240
2240
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
2241
2241
|
return r ? "|" : " |";
|
|
2242
|
-
}).split(
|
|
2242
|
+
}).split(Q.splitPipe), r = 0;
|
|
2243
2243
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
|
|
2244
2244
|
else for (; n.length < t;) n.push("");
|
|
2245
|
-
for (; r < n.length; r++) n[r] = n[r].trim().replace(
|
|
2245
|
+
for (; r < n.length; r++) n[r] = n[r].trim().replace(Q.slashPipe, "|");
|
|
2246
2246
|
return n;
|
|
2247
2247
|
}
|
|
2248
2248
|
function $(e, t, n) {
|
|
@@ -2259,7 +2259,7 @@ function $(e, t, n) {
|
|
|
2259
2259
|
}
|
|
2260
2260
|
function ee(e) {
|
|
2261
2261
|
let t = e.split("\n"), n = t.length - 1;
|
|
2262
|
-
for (; n >= 0 &&
|
|
2262
|
+
for (; n >= 0 && Q.blankLine.test(t[n]);) n--;
|
|
2263
2263
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
2264
2264
|
}
|
|
2265
2265
|
function fe(e, t) {
|
|
@@ -2754,7 +2754,7 @@ ${c}` : c;
|
|
|
2754
2754
|
};
|
|
2755
2755
|
}
|
|
2756
2756
|
}
|
|
2757
|
-
},
|
|
2757
|
+
}, ur = class l {
|
|
2758
2758
|
constructor(t) {
|
|
2759
2759
|
e(this, "tokens", void 0), e(this, "options", void 0), e(this, "state", void 0), e(this, "inlineQueue", void 0), e(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = t || $t, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
2760
2760
|
inLink: !1,
|
|
@@ -2762,16 +2762,16 @@ ${c}` : c;
|
|
|
2762
2762
|
top: !0
|
|
2763
2763
|
};
|
|
2764
2764
|
let n = {
|
|
2765
|
-
other:
|
|
2766
|
-
block:
|
|
2767
|
-
inline:
|
|
2765
|
+
other: Q,
|
|
2766
|
+
block: sr.normal,
|
|
2767
|
+
inline: cr.normal
|
|
2768
2768
|
};
|
|
2769
|
-
this.options.pedantic ? (n.block =
|
|
2769
|
+
this.options.pedantic ? (n.block = sr.pedantic, n.inline = cr.pedantic) : this.options.gfm && (n.block = sr.gfm, this.options.breaks ? n.inline = cr.breaks : n.inline = cr.gfm), this.tokenizer.rules = n;
|
|
2770
2770
|
}
|
|
2771
2771
|
static get rules() {
|
|
2772
2772
|
return {
|
|
2773
|
-
block:
|
|
2774
|
-
inline:
|
|
2773
|
+
block: sr,
|
|
2774
|
+
inline: cr
|
|
2775
2775
|
};
|
|
2776
2776
|
}
|
|
2777
2777
|
static lex(e, t) {
|
|
@@ -2781,7 +2781,7 @@ ${c}` : c;
|
|
|
2781
2781
|
return new l(t).inlineTokens(e);
|
|
2782
2782
|
}
|
|
2783
2783
|
lex(e) {
|
|
2784
|
-
e = e.replace(
|
|
2784
|
+
e = e.replace(Q.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
|
|
2785
2785
|
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
2786
2786
|
let t = this.inlineQueue[e];
|
|
2787
2787
|
this.inlineTokens(t.src, t.tokens);
|
|
@@ -2789,7 +2789,7 @@ ${c}` : c;
|
|
|
2789
2789
|
return this.inlineQueue = [], this.tokens;
|
|
2790
2790
|
}
|
|
2791
2791
|
blockTokens(e, t = [], n = !1) {
|
|
2792
|
-
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(
|
|
2792
|
+
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(Q.tabCharGlobal, " ").replace(Q.spaceLine, ""));
|
|
2793
2793
|
let r = Infinity;
|
|
2794
2794
|
for (; e;) {
|
|
2795
2795
|
if (e.length < r) r = e.length;
|
|
@@ -2979,7 +2979,7 @@ ${c}` : c;
|
|
|
2979
2979
|
return "";
|
|
2980
2980
|
}
|
|
2981
2981
|
code({ text: e, lang: t, escaped: n }) {
|
|
2982
|
-
let r = (t || "").match(
|
|
2982
|
+
let r = (t || "").match(Q.notSpaceStart)?.[0], i = e.replace(Q.endingNewline, "") + "\n";
|
|
2983
2983
|
return r ? "<pre><code class=\"language-" + O(r) + "\">" + (n ? i : O(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : O(i, !0)) + "</code></pre>\n";
|
|
2984
2984
|
}
|
|
2985
2985
|
blockquote({ tokens: e }) {
|
|
@@ -3107,7 +3107,7 @@ ${e}</tr>
|
|
|
3107
3107
|
checkbox({ raw: e }) {
|
|
3108
3108
|
return e;
|
|
3109
3109
|
}
|
|
3110
|
-
},
|
|
3110
|
+
}, dr = class l {
|
|
3111
3111
|
constructor(t) {
|
|
3112
3112
|
e(this, "options", void 0), e(this, "renderer", void 0), e(this, "textRenderer", void 0), this.options = t || $t, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
|
|
3113
3113
|
}
|
|
@@ -3255,7 +3255,7 @@ ${e}</tr>
|
|
|
3255
3255
|
}
|
|
3256
3256
|
return n;
|
|
3257
3257
|
}
|
|
3258
|
-
},
|
|
3258
|
+
}, fr = (_Class = class {
|
|
3259
3259
|
constructor(t) {
|
|
3260
3260
|
e(this, "options", void 0), e(this, "block", void 0), this.options = t || $t;
|
|
3261
3261
|
}
|
|
@@ -3272,10 +3272,10 @@ ${e}</tr>
|
|
|
3272
3272
|
return e;
|
|
3273
3273
|
}
|
|
3274
3274
|
provideLexer(e = this.block) {
|
|
3275
|
-
return e ?
|
|
3275
|
+
return e ? ur.lex : ur.lexInline;
|
|
3276
3276
|
}
|
|
3277
3277
|
provideParser(e = this.block) {
|
|
3278
|
-
return e ?
|
|
3278
|
+
return e ? dr.parse : dr.parseInline;
|
|
3279
3279
|
}
|
|
3280
3280
|
}, e(_Class, "passThroughHooks", /* @__PURE__ */ new Set([
|
|
3281
3281
|
"preprocess",
|
|
@@ -3288,7 +3288,7 @@ ${e}</tr>
|
|
|
3288
3288
|
"processAllTokens"
|
|
3289
3289
|
])), _Class), D = class {
|
|
3290
3290
|
constructor(...t) {
|
|
3291
|
-
e(this, "defaults", M()), e(this, "options", this.setOptions), e(this, "parse", this.parseMarkdown(!0)), e(this, "parseInline", this.parseMarkdown(!1)), e(this, "Parser",
|
|
3291
|
+
e(this, "defaults", M()), e(this, "options", this.setOptions), e(this, "parse", this.parseMarkdown(!0)), e(this, "parseInline", this.parseMarkdown(!1)), e(this, "Parser", dr), e(this, "Renderer", y), e(this, "TextRenderer", L), e(this, "Lexer", ur), e(this, "Tokenizer", w), e(this, "Hooks", fr), this.use(...t);
|
|
3292
3292
|
}
|
|
3293
3293
|
walkTokens(e, t) {
|
|
3294
3294
|
let n = [];
|
|
@@ -3367,13 +3367,13 @@ ${e}</tr>
|
|
|
3367
3367
|
n.tokenizer = t;
|
|
3368
3368
|
}
|
|
3369
3369
|
if (e.hooks) {
|
|
3370
|
-
let t = this.defaults.hooks || new
|
|
3370
|
+
let t = this.defaults.hooks || new fr();
|
|
3371
3371
|
for (let n in e.hooks) {
|
|
3372
3372
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
3373
3373
|
if (["options", "block"].includes(n)) continue;
|
|
3374
3374
|
let r = n, i = e.hooks[r], a = t[r];
|
|
3375
|
-
|
|
3376
|
-
if (this.defaults.async &&
|
|
3375
|
+
fr.passThroughHooks.has(n) ? t[r] = (e) => {
|
|
3376
|
+
if (this.defaults.async && fr.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
3377
3377
|
let n = await i.call(t, e);
|
|
3378
3378
|
return a.call(t, n);
|
|
3379
3379
|
})();
|
|
@@ -3410,10 +3410,10 @@ ${e}</tr>
|
|
|
3410
3410
|
}, this;
|
|
3411
3411
|
}
|
|
3412
3412
|
lexer(e, t) {
|
|
3413
|
-
return
|
|
3413
|
+
return ur.lex(e, t ?? this.defaults);
|
|
3414
3414
|
}
|
|
3415
3415
|
parser(e, t) {
|
|
3416
|
-
return
|
|
3416
|
+
return dr.parse(e, t ?? this.defaults);
|
|
3417
3417
|
}
|
|
3418
3418
|
parseMarkdown(e) {
|
|
3419
3419
|
return (t, n) => {
|
|
@@ -3425,16 +3425,16 @@ ${e}</tr>
|
|
|
3425
3425
|
if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
|
|
3426
3426
|
if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
|
|
3427
3427
|
if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
|
|
3428
|
-
let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ?
|
|
3428
|
+
let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? ur.lex : ur.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
|
|
3429
3429
|
i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
|
|
3430
|
-
let o = await (i.hooks ? await i.hooks.provideParser(e) : e ?
|
|
3430
|
+
let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? dr.parse : dr.parseInline)(a, i);
|
|
3431
3431
|
return i.hooks ? await i.hooks.postprocess(o) : o;
|
|
3432
3432
|
})().catch(a);
|
|
3433
3433
|
try {
|
|
3434
3434
|
i.hooks && (t = i.hooks.preprocess(t));
|
|
3435
|
-
let n = (i.hooks ? i.hooks.provideLexer(e) : e ?
|
|
3435
|
+
let n = (i.hooks ? i.hooks.provideLexer(e) : e ? ur.lex : ur.lexInline)(t, i);
|
|
3436
3436
|
i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
|
|
3437
|
-
let r = (i.hooks ? i.hooks.provideParser(e) : e ?
|
|
3437
|
+
let r = (i.hooks ? i.hooks.provideParser(e) : e ? dr.parse : dr.parseInline)(n, i);
|
|
3438
3438
|
return i.hooks && (r = i.hooks.postprocess(r)), r;
|
|
3439
3439
|
} catch (e) {
|
|
3440
3440
|
return a(e);
|
|
@@ -3451,25 +3451,25 @@ ${e}</tr>
|
|
|
3451
3451
|
throw n;
|
|
3452
3452
|
};
|
|
3453
3453
|
}
|
|
3454
|
-
},
|
|
3454
|
+
}, pr = new D();
|
|
3455
3455
|
function g(e, t) {
|
|
3456
|
-
return
|
|
3456
|
+
return pr.parse(e, t);
|
|
3457
3457
|
}
|
|
3458
3458
|
g.options = g.setOptions = function(e) {
|
|
3459
|
-
return
|
|
3459
|
+
return pr.setOptions(e), g.defaults = pr.defaults, N(g.defaults), g;
|
|
3460
3460
|
}, g.getDefaults = M, g.defaults = $t, g.use = function(...e) {
|
|
3461
|
-
return
|
|
3461
|
+
return pr.use(...e), g.defaults = pr.defaults, N(g.defaults), g;
|
|
3462
3462
|
}, g.walkTokens = function(e, t) {
|
|
3463
|
-
return
|
|
3464
|
-
}, g.parseInline =
|
|
3463
|
+
return pr.walkTokens(e, t);
|
|
3464
|
+
}, g.parseInline = pr.parseInline, g.Parser = dr, g.parser = dr.parse, g.Renderer = y, g.TextRenderer = L, g.Lexer = ur, g.lexer = ur.lex, g.Tokenizer = w, g.Hooks = fr, g.parse = g, g.options, g.setOptions, g.use, g.walkTokens, g.parseInline, dr.parse, ur.lex;
|
|
3465
3465
|
//#endregion
|
|
3466
3466
|
//#region agent/ui/chat-diagram-layout.ts
|
|
3467
|
-
var
|
|
3467
|
+
var mr = 112, hr = 52, gr = 14, _r = 54, vr = 34, yr = 260;
|
|
3468
3468
|
function nodeWidthFor(e) {
|
|
3469
3469
|
let { orientation: t, maxRows: n, maxWidth: r } = e;
|
|
3470
|
-
if (t === "horizontal" || !r) return
|
|
3471
|
-
let i = r -
|
|
3472
|
-
return Math.min(
|
|
3470
|
+
if (t === "horizontal" || !r) return mr;
|
|
3471
|
+
let i = r - gr * 2 - (n - 1) * _r;
|
|
3472
|
+
return Math.min(yr, Math.max(mr, Math.floor(i / n)));
|
|
3473
3473
|
}
|
|
3474
3474
|
function orientationFor(e) {
|
|
3475
3475
|
return e.layout === "left-to-right" || e.layout === "radial" ? "horizontal" : e.layout === "top-to-bottom" ? "vertical" : e.diagramType === "sequence" ? "horizontal" : "vertical";
|
|
@@ -3506,11 +3506,11 @@ function buildLayout(e, t, n) {
|
|
|
3506
3506
|
orientation: t,
|
|
3507
3507
|
maxRows: o,
|
|
3508
3508
|
...n === void 0 ? {} : { maxWidth: n }
|
|
3509
|
-
}), u = t === "horizontal" ?
|
|
3509
|
+
}), u = t === "horizontal" ? gr * 2 + s * c + (s - 1) * _r : gr * 2 + o * c + (o - 1) * _r, f = t === "horizontal" ? gr * 2 + o * hr + (o - 1) * vr : gr * 2 + s * hr + (s - 1) * vr, p = [];
|
|
3510
3510
|
for (let [e, [, n]] of a.entries()) {
|
|
3511
|
-
let r = (o - n.length) * (t === "horizontal" ? 86 : c +
|
|
3511
|
+
let r = (o - n.length) * (t === "horizontal" ? 86 : c + _r) / 2;
|
|
3512
3512
|
for (let [i, a] of n.entries()) {
|
|
3513
|
-
let n = t === "horizontal" ?
|
|
3513
|
+
let n = t === "horizontal" ? gr + e * (c + _r) : gr + r + i * (c + _r), o = t === "horizontal" ? gr + r + i * 86 : gr + e * 86;
|
|
3514
3514
|
p.push({
|
|
3515
3515
|
id: a.id,
|
|
3516
3516
|
label: a.label,
|
|
@@ -3519,7 +3519,7 @@ function buildLayout(e, t, n) {
|
|
|
3519
3519
|
x: n,
|
|
3520
3520
|
y: o,
|
|
3521
3521
|
width: c,
|
|
3522
|
-
height:
|
|
3522
|
+
height: hr
|
|
3523
3523
|
});
|
|
3524
3524
|
}
|
|
3525
3525
|
}
|
|
@@ -3596,14 +3596,14 @@ function formatChatVisualTick(e) {
|
|
|
3596
3596
|
let { prefix: r, suffix: i } = affixes(n);
|
|
3597
3597
|
return `${r}${formatChatVisualValue({ value: t })}${i}`;
|
|
3598
3598
|
}
|
|
3599
|
-
var
|
|
3599
|
+
var br = 5.4, xr = 10, Sr = 15, Cr = 16;
|
|
3600
3600
|
function planChatVisualXLabels(e) {
|
|
3601
3601
|
let { labels: t, plotWidth: n } = e;
|
|
3602
3602
|
if (!t.length || n <= 0) return {
|
|
3603
3603
|
mode: "horizontal",
|
|
3604
3604
|
entries: []
|
|
3605
3605
|
};
|
|
3606
|
-
let r = t.map((e) => e.length >
|
|
3606
|
+
let r = t.map((e) => e.length > Cr ? `${e.slice(0, Cr - 1).trimEnd()}\u2026` : e), i = t.length - 1;
|
|
3607
3607
|
if (i === 0) return {
|
|
3608
3608
|
mode: "horizontal",
|
|
3609
3609
|
entries: [{
|
|
@@ -3611,14 +3611,14 @@ function planChatVisualXLabels(e) {
|
|
|
3611
3611
|
text: r[0]
|
|
3612
3612
|
}]
|
|
3613
3613
|
};
|
|
3614
|
-
if ((Math.max(...r.map((e) => e.length *
|
|
3614
|
+
if ((Math.max(...r.map((e) => e.length * br)) + xr) * t.length <= n) return {
|
|
3615
3615
|
mode: "horizontal",
|
|
3616
3616
|
entries: r.map((e, t) => ({
|
|
3617
3617
|
index: t,
|
|
3618
3618
|
text: e
|
|
3619
3619
|
}))
|
|
3620
3620
|
};
|
|
3621
|
-
let a = Math.max(2, Math.floor(n /
|
|
3621
|
+
let a = Math.max(2, Math.floor(n / Sr));
|
|
3622
3622
|
if (t.length <= a) return {
|
|
3623
3623
|
mode: "angled",
|
|
3624
3624
|
entries: r.map((e, t) => ({
|
|
@@ -3638,22 +3638,22 @@ function planChatVisualXLabels(e) {
|
|
|
3638
3638
|
}
|
|
3639
3639
|
//#endregion
|
|
3640
3640
|
//#region agent/ui/ChatVisualBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3641
|
-
var
|
|
3641
|
+
var wr = [
|
|
3642
3642
|
"data-visual-type",
|
|
3643
3643
|
"data-chart-type",
|
|
3644
3644
|
"data-stacking",
|
|
3645
3645
|
"data-diagram-type",
|
|
3646
3646
|
"aria-label"
|
|
3647
|
-
],
|
|
3647
|
+
], Tr = { class: "mb-2.5" }, Er = ["aria-label"], Dr = {
|
|
3648
3648
|
key: 0,
|
|
3649
3649
|
"data-test": "chat-visual-horizontal-bars",
|
|
3650
3650
|
class: "grid gap-3"
|
|
3651
|
-
},
|
|
3651
|
+
}, Or = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, kr = ["viewBox"], Ar = [
|
|
3652
3652
|
"x1",
|
|
3653
3653
|
"x2",
|
|
3654
3654
|
"y1",
|
|
3655
3655
|
"y2"
|
|
3656
|
-
],
|
|
3656
|
+
], jr = ["x", "y"], Mr = [
|
|
3657
3657
|
"data-row-index",
|
|
3658
3658
|
"data-series-index",
|
|
3659
3659
|
"data-data-key",
|
|
@@ -3661,35 +3661,35 @@ var Cr = [
|
|
|
3661
3661
|
"y",
|
|
3662
3662
|
"width",
|
|
3663
3663
|
"height"
|
|
3664
|
-
],
|
|
3664
|
+
], Nr = ["data-trend-key", "d"], Pr = ["d"], Fr = ["cx", "cy"], Ir = ["cx", "cy"], Lr = [
|
|
3665
3665
|
"x",
|
|
3666
3666
|
"y",
|
|
3667
3667
|
"text-anchor",
|
|
3668
3668
|
"transform"
|
|
3669
|
-
],
|
|
3669
|
+
], Rr = {
|
|
3670
3670
|
key: 2,
|
|
3671
3671
|
class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
|
|
3672
|
-
},
|
|
3672
|
+
}, zr = {
|
|
3673
3673
|
key: 1,
|
|
3674
3674
|
class: "grid gap-3"
|
|
3675
|
-
},
|
|
3675
|
+
}, Br = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, Vr = { class: "shrink-0 tabular-nums" }, Hr = {
|
|
3676
3676
|
key: 2,
|
|
3677
3677
|
class: "overflow-x-auto"
|
|
3678
|
-
},
|
|
3678
|
+
}, Ur = ["viewBox", "aria-label"], Wr = [
|
|
3679
3679
|
"data-from",
|
|
3680
3680
|
"data-to",
|
|
3681
3681
|
"x1",
|
|
3682
3682
|
"y1",
|
|
3683
3683
|
"x2",
|
|
3684
3684
|
"y2"
|
|
3685
|
-
],
|
|
3685
|
+
], Gr = ["cx", "cy"], Kr = ["x", "y"], qr = [
|
|
3686
3686
|
"data-node-id",
|
|
3687
3687
|
"data-node-kind",
|
|
3688
3688
|
"transform"
|
|
3689
|
-
],
|
|
3689
|
+
], Jr = ["points"], Yr = ["width", "height"], Xr = ["width", "height"], Zr = {
|
|
3690
3690
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
3691
3691
|
class: "flex h-full min-w-0 flex-col items-center justify-center text-center"
|
|
3692
|
-
},
|
|
3692
|
+
}, Qr = /* @__PURE__ */ x({
|
|
3693
3693
|
__name: "ChatVisualBlock",
|
|
3694
3694
|
props: {
|
|
3695
3695
|
result: {},
|
|
@@ -3915,7 +3915,7 @@ var Cr = [
|
|
|
3915
3915
|
width: e.rawValue <= 0 ? 0 : Math.max(2, e.rawValue / r * 100),
|
|
3916
3916
|
seriesIndex: 0
|
|
3917
3917
|
}));
|
|
3918
|
-
}),
|
|
3918
|
+
}), de = f(() => {
|
|
3919
3919
|
let e = v.value;
|
|
3920
3920
|
if (!e?.data.length) return [];
|
|
3921
3921
|
let t = e.data[e.data.length - 1];
|
|
@@ -3931,7 +3931,7 @@ var Cr = [
|
|
|
3931
3931
|
seriesIndex: n
|
|
3932
3932
|
};
|
|
3933
3933
|
});
|
|
3934
|
-
}),
|
|
3934
|
+
}), pe = f(() => {
|
|
3935
3935
|
let e = v.value;
|
|
3936
3936
|
if (!e?.data.length || e.chartType !== "line") return [];
|
|
3937
3937
|
let t = e.data.length - 1, n = e.data[t];
|
|
@@ -3944,7 +3944,7 @@ var Cr = [
|
|
|
3944
3944
|
seriesIndex: i
|
|
3945
3945
|
};
|
|
3946
3946
|
}).filter((e) => e !== null);
|
|
3947
|
-
}),
|
|
3947
|
+
}), he = f(() => {
|
|
3948
3948
|
let e = x.value;
|
|
3949
3949
|
if (!e) return [];
|
|
3950
3950
|
let t = e.data.map((t) => ({
|
|
@@ -3960,7 +3960,7 @@ var Cr = [
|
|
|
3960
3960
|
series: r
|
|
3961
3961
|
})
|
|
3962
3962
|
}));
|
|
3963
|
-
}),
|
|
3963
|
+
}), z = f(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), _e = [
|
|
3964
3964
|
"var(--color-theme-900)",
|
|
3965
3965
|
"var(--color-primary-500)",
|
|
3966
3966
|
"color-mix(in oklch, var(--color-primary-500) 55%, var(--color-theme-500))"
|
|
@@ -3979,7 +3979,7 @@ var Cr = [
|
|
|
3979
3979
|
function diagramNodeStroke(e) {
|
|
3980
3980
|
return e === "decision" ? t.inverted ? "rgba(255, 255, 255, 0.26)" : "color-mix(in oklch, var(--color-primary-500) 32%, var(--color-theme-300))" : Se.value;
|
|
3981
3981
|
}
|
|
3982
|
-
let
|
|
3982
|
+
let B = f(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ye = f(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), H = f(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), be = f(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), U = f(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Se = f(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), W = f(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), G = f(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), Ce = f(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
|
|
3983
3983
|
return (e, r) => o.value ? (k(), h("section", {
|
|
3984
3984
|
key: 0,
|
|
3985
3985
|
"data-test": "chat-visual",
|
|
@@ -3991,13 +3991,13 @@ var Cr = [
|
|
|
3991
3991
|
style: T({ boxShadow: `inset 0 0 0 1px ${W.value}` }),
|
|
3992
3992
|
"aria-label": o.value.meta.title
|
|
3993
3993
|
}, [
|
|
3994
|
-
_("header",
|
|
3994
|
+
_("header", Tr, [_("h4", {
|
|
3995
3995
|
class: "text-[13px] font-semibold leading-tight",
|
|
3996
|
-
style: T({ color:
|
|
3996
|
+
style: T({ color: B.value })
|
|
3997
3997
|
}, F(o.value.meta.title), 5), o.value.meta.description ? (k(), h("p", {
|
|
3998
3998
|
key: 0,
|
|
3999
3999
|
class: "mt-0.5 text-[12px] leading-snug",
|
|
4000
|
-
style: T({ color:
|
|
4000
|
+
style: T({ color: ye.value })
|
|
4001
4001
|
}, F(o.value.meta.description), 5)) : m("", !0)]),
|
|
4002
4002
|
_("div", {
|
|
4003
4003
|
ref_key: "bodyEl",
|
|
@@ -4006,19 +4006,19 @@ var Cr = [
|
|
|
4006
4006
|
key: 0,
|
|
4007
4007
|
role: "img",
|
|
4008
4008
|
"aria-label": o.value.meta.title
|
|
4009
|
-
}, [ue.value.length ? (k(), h("div",
|
|
4009
|
+
}, [ue.value.length ? (k(), h("div", Dr, [(k(!0), h(u, null, j(ue.value, (e) => (k(), h("div", {
|
|
4010
4010
|
key: e.key,
|
|
4011
4011
|
"data-test": "chat-visual-horizontal-bar",
|
|
4012
4012
|
class: "min-w-0"
|
|
4013
|
-
}, [_("div",
|
|
4013
|
+
}, [_("div", Or, [_("span", {
|
|
4014
4014
|
class: "line-clamp-2 min-w-0 font-medium leading-snug",
|
|
4015
|
-
style: T({ color:
|
|
4015
|
+
style: T({ color: B.value })
|
|
4016
4016
|
}, F(e.label), 5), _("span", {
|
|
4017
4017
|
class: "shrink-0 font-semibold tabular-nums",
|
|
4018
|
-
style: T({ color:
|
|
4018
|
+
style: T({ color: B.value })
|
|
4019
4019
|
}, F(e.value), 5)]), _("div", {
|
|
4020
4020
|
class: "h-2 w-full overflow-hidden rounded-full",
|
|
4021
|
-
style: T({ background:
|
|
4021
|
+
style: T({ background: Ce.value })
|
|
4022
4022
|
}, [_("div", {
|
|
4023
4023
|
class: "h-full rounded-full",
|
|
4024
4024
|
style: T({
|
|
@@ -4042,7 +4042,7 @@ var Cr = [
|
|
|
4042
4042
|
"stroke-width": "1",
|
|
4043
4043
|
"vector-effect": "non-scaling-stroke",
|
|
4044
4044
|
style: T({ stroke: e === 0 ? U.value : be.value })
|
|
4045
|
-
}, null, 12,
|
|
4045
|
+
}, null, 12, Ar))), 128)),
|
|
4046
4046
|
_("g", null, [(k(!0), h(u, null, j(re.value.ticks, (e) => (k(), h("text", {
|
|
4047
4047
|
key: `y-${e}`,
|
|
4048
4048
|
x: I.value.left - 7,
|
|
@@ -4053,7 +4053,7 @@ var Cr = [
|
|
|
4053
4053
|
}, F(oe(formatChatVisualTick)({
|
|
4054
4054
|
value: e,
|
|
4055
4055
|
shared: ie.value
|
|
4056
|
-
})), 13,
|
|
4056
|
+
})), 13, jr))), 128))]),
|
|
4057
4057
|
v.value.chartType === "bar" ? (k(!0), h(u, { key: 0 }, j(ce.value, (e) => (k(), h("rect", {
|
|
4058
4058
|
key: e.key,
|
|
4059
4059
|
"data-test": "chat-visual-bar",
|
|
@@ -4066,7 +4066,7 @@ var Cr = [
|
|
|
4066
4066
|
height: e.height,
|
|
4067
4067
|
rx: "2.5",
|
|
4068
4068
|
style: T({ fill: seriesColor(e.seriesIndex) })
|
|
4069
|
-
}, null, 12,
|
|
4069
|
+
}, null, 12, Mr))), 128)) : (k(), h(u, { key: 1 }, [
|
|
4070
4070
|
se.value ? (k(), h("path", {
|
|
4071
4071
|
key: 0,
|
|
4072
4072
|
"data-test": "chat-visual-trend-line",
|
|
@@ -4079,7 +4079,7 @@ var Cr = [
|
|
|
4079
4079
|
"stroke-dasharray": "4 3",
|
|
4080
4080
|
"vector-effect": "non-scaling-stroke",
|
|
4081
4081
|
style: T({ stroke: seriesColor(se.value.seriesIndex) })
|
|
4082
|
-
}, null, 12,
|
|
4082
|
+
}, null, 12, Nr)) : m("", !0),
|
|
4083
4083
|
(k(!0), h(u, null, j(b.value, (e, t) => (k(), h("g", { key: e.dataKey }, [v.value.chartType === "line" ? (k(), h("path", {
|
|
4084
4084
|
key: 0,
|
|
4085
4085
|
d: pathForSeries(e.dataKey),
|
|
@@ -4089,20 +4089,20 @@ var Cr = [
|
|
|
4089
4089
|
"stroke-linejoin": "round",
|
|
4090
4090
|
"vector-effect": "non-scaling-stroke",
|
|
4091
4091
|
style: T({ stroke: seriesColor(t) })
|
|
4092
|
-
}, null, 12,
|
|
4092
|
+
}, null, 12, Pr)) : m("", !0), (k(!0), h(u, null, j(p.value, (n, r) => (k(), h(u, { key: `${e.dataKey}-${r}` }, [v.value.chartType === "scatter" ? (k(), h("circle", {
|
|
4093
4093
|
key: 0,
|
|
4094
4094
|
cx: xForIndex(r, p.value.length),
|
|
4095
4095
|
cy: yForValue(numericValue(n[e.dataKey]) ?? 0),
|
|
4096
4096
|
r: "2.6",
|
|
4097
4097
|
style: T({ fill: seriesColor(t) })
|
|
4098
|
-
}, null, 12,
|
|
4099
|
-
(k(!0), h(u, null, j(
|
|
4098
|
+
}, null, 12, Fr)) : m("", !0)], 64))), 128))]))), 128)),
|
|
4099
|
+
(k(!0), h(u, null, j(pe.value, (e) => (k(), h("circle", {
|
|
4100
4100
|
key: `marker-${e.key}`,
|
|
4101
4101
|
cx: e.cx,
|
|
4102
4102
|
cy: e.cy,
|
|
4103
4103
|
r: "3",
|
|
4104
4104
|
style: T({ fill: seriesColor(e.seriesIndex) })
|
|
4105
|
-
}, null, 12,
|
|
4105
|
+
}, null, 12, Ir))), 128))
|
|
4106
4106
|
], 64)),
|
|
4107
4107
|
(k(!0), h(u, null, j(R.value, (e) => (k(), h("text", {
|
|
4108
4108
|
key: e.key,
|
|
@@ -4112,8 +4112,8 @@ var Cr = [
|
|
|
4112
4112
|
"font-size": "9.5",
|
|
4113
4113
|
transform: e.angled ? `rotate(${oe(-40)} ${e.x} ${I.value.height - I.value.bottom + 12})` : void 0,
|
|
4114
4114
|
style: T({ fill: H.value })
|
|
4115
|
-
}, F(e.label), 13,
|
|
4116
|
-
], 12,
|
|
4115
|
+
}, F(e.label), 13, Lr))), 128))
|
|
4116
|
+
], 12, kr)), de.value.length > 1 || v.value.chartType !== "bar" ? (k(), h("div", Rr, [(k(!0), h(u, null, j(de.value, (e) => (k(), h("div", {
|
|
4117
4117
|
key: e.key,
|
|
4118
4118
|
class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
|
|
4119
4119
|
}, [
|
|
@@ -4121,41 +4121,41 @@ var Cr = [
|
|
|
4121
4121
|
class: "size-2.5 shrink-0 rounded-full",
|
|
4122
4122
|
style: T({ background: seriesColor(e.seriesIndex) })
|
|
4123
4123
|
}, null, 4),
|
|
4124
|
-
_("span", { style: T({ color:
|
|
4124
|
+
_("span", { style: T({ color: ye.value }) }, F(e.label), 5),
|
|
4125
4125
|
_("span", {
|
|
4126
4126
|
class: "font-semibold tabular-nums",
|
|
4127
|
-
style: T({ color:
|
|
4127
|
+
style: T({ color: B.value })
|
|
4128
4128
|
}, F(e.value), 5)
|
|
4129
|
-
]))), 128))])) : m("", !0)], 8,
|
|
4129
|
+
]))), 128))])) : m("", !0)], 8, Er)) : x.value ? (k(), h("div", zr, [(k(!0), h(u, null, j(he.value, (e, t) => (k(), h("div", { key: e.key }, [_("div", Br, [_("span", {
|
|
4130
4130
|
class: "truncate font-medium",
|
|
4131
|
-
style: T({ color:
|
|
4132
|
-
}, F(e.name), 5), _("span",
|
|
4131
|
+
style: T({ color: B.value })
|
|
4132
|
+
}, F(e.name), 5), _("span", Vr, [_("span", {
|
|
4133
4133
|
class: "font-semibold",
|
|
4134
|
-
style: T({ color:
|
|
4134
|
+
style: T({ color: B.value })
|
|
4135
4135
|
}, F(e.display), 5), _("span", {
|
|
4136
4136
|
class: "ml-1.5",
|
|
4137
|
-
style: T({ color:
|
|
4137
|
+
style: T({ color: ye.value })
|
|
4138
4138
|
}, F(Math.round(e.percent * 100)) + "%", 5)])]), _("div", {
|
|
4139
4139
|
class: "h-1.5 w-full overflow-hidden rounded-full",
|
|
4140
|
-
style: T({ background:
|
|
4140
|
+
style: T({ background: Ce.value })
|
|
4141
4141
|
}, [_("div", {
|
|
4142
4142
|
class: "h-full rounded-full",
|
|
4143
4143
|
style: T({
|
|
4144
4144
|
width: `${Math.max(2, e.percent * 100)}%`,
|
|
4145
4145
|
background: seriesColor(t)
|
|
4146
4146
|
})
|
|
4147
|
-
}, null, 4)], 4)]))), 128))])) : c.value &&
|
|
4147
|
+
}, null, 4)], 4)]))), 128))])) : c.value && z.value ? (k(), h("div", Hr, [(k(), h("svg", {
|
|
4148
4148
|
"data-test": "chat-visual-diagram-svg",
|
|
4149
4149
|
class: "block h-auto overflow-visible",
|
|
4150
|
-
viewBox: `0 0 ${
|
|
4150
|
+
viewBox: `0 0 ${z.value.width} ${z.value.height}`,
|
|
4151
4151
|
style: T({
|
|
4152
|
-
width: `${
|
|
4153
|
-
aspectRatio: `${
|
|
4152
|
+
width: `${z.value.width}px`,
|
|
4153
|
+
aspectRatio: `${z.value.width} / ${z.value.height}`
|
|
4154
4154
|
}),
|
|
4155
4155
|
role: "img",
|
|
4156
4156
|
"aria-label": o.value.meta.title
|
|
4157
4157
|
}, [
|
|
4158
|
-
(k(!0), h(u, null, j(
|
|
4158
|
+
(k(!0), h(u, null, j(z.value.edges, (e) => (k(), h("line", {
|
|
4159
4159
|
key: e.key,
|
|
4160
4160
|
"data-test": "chat-visual-diagram-edge",
|
|
4161
4161
|
"data-from": e.from,
|
|
@@ -4167,16 +4167,16 @@ var Cr = [
|
|
|
4167
4167
|
"stroke-width": "1.4",
|
|
4168
4168
|
"stroke-linecap": "round",
|
|
4169
4169
|
"vector-effect": "non-scaling-stroke",
|
|
4170
|
-
style: T({ stroke:
|
|
4171
|
-
}, null, 12,
|
|
4172
|
-
(k(!0), h(u, null, j(
|
|
4170
|
+
style: T({ stroke: G.value })
|
|
4171
|
+
}, null, 12, Wr))), 128)),
|
|
4172
|
+
(k(!0), h(u, null, j(z.value.edges, (e) => (k(), h("circle", {
|
|
4173
4173
|
key: `${e.key}-dot`,
|
|
4174
4174
|
cx: e.x2,
|
|
4175
4175
|
cy: e.y2,
|
|
4176
4176
|
r: "2.4",
|
|
4177
|
-
style: T({ fill:
|
|
4178
|
-
}, null, 12,
|
|
4179
|
-
(k(!0), h(u, null, j(
|
|
4177
|
+
style: T({ fill: G.value })
|
|
4178
|
+
}, null, 12, Gr))), 128)),
|
|
4179
|
+
(k(!0), h(u, null, j(z.value.edges.filter((e) => e.label), (e) => (k(), h("foreignObject", {
|
|
4180
4180
|
key: `${e.key}-label`,
|
|
4181
4181
|
x: e.labelX - 55,
|
|
4182
4182
|
y: e.labelY - 12,
|
|
@@ -4186,11 +4186,11 @@ var Cr = [
|
|
|
4186
4186
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
4187
4187
|
class: "flex h-full items-center justify-center px-1 text-center text-[10.5px] font-medium leading-none",
|
|
4188
4188
|
style: T({
|
|
4189
|
-
color:
|
|
4189
|
+
color: ye.value,
|
|
4190
4190
|
background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)"
|
|
4191
4191
|
})
|
|
4192
|
-
}, F(e.label), 5)], 8,
|
|
4193
|
-
(k(!0), h(u, null, j(
|
|
4192
|
+
}, F(e.label), 5)], 8, Kr))), 128)),
|
|
4193
|
+
(k(!0), h(u, null, j(z.value.nodes, (e) => (k(), h("g", {
|
|
4194
4194
|
key: e.id,
|
|
4195
4195
|
"data-test": "chat-visual-diagram-node",
|
|
4196
4196
|
"data-node-id": e.id,
|
|
@@ -4205,7 +4205,7 @@ var Cr = [
|
|
|
4205
4205
|
fill: diagramNodeFill(e.kind),
|
|
4206
4206
|
stroke: diagramNodeStroke(e.kind)
|
|
4207
4207
|
})
|
|
4208
|
-
}, null, 12,
|
|
4208
|
+
}, null, 12, Jr)) : (k(), h("rect", {
|
|
4209
4209
|
key: 1,
|
|
4210
4210
|
width: e.width,
|
|
4211
4211
|
height: e.height,
|
|
@@ -4216,28 +4216,28 @@ var Cr = [
|
|
|
4216
4216
|
fill: diagramNodeFill(e.kind),
|
|
4217
4217
|
stroke: diagramNodeStroke(e.kind)
|
|
4218
4218
|
})
|
|
4219
|
-
}, null, 12,
|
|
4219
|
+
}, null, 12, Yr)), (k(), h("foreignObject", {
|
|
4220
4220
|
x: "8",
|
|
4221
4221
|
y: "5",
|
|
4222
4222
|
width: e.width - 16,
|
|
4223
4223
|
height: e.height - 10
|
|
4224
|
-
}, [_("div",
|
|
4224
|
+
}, [_("div", Zr, [_("div", {
|
|
4225
4225
|
class: "line-clamp-2 text-[13px] font-semibold leading-tight",
|
|
4226
|
-
style: T({ color:
|
|
4226
|
+
style: T({ color: B.value })
|
|
4227
4227
|
}, F(e.label), 5), e.detail ? (k(), h("div", {
|
|
4228
4228
|
key: 0,
|
|
4229
4229
|
class: "mt-0.5 line-clamp-1 text-[10.5px] leading-none",
|
|
4230
|
-
style: T({ color:
|
|
4231
|
-
}, F(e.detail), 5)) : m("", !0)])], 8,
|
|
4232
|
-
], 12,
|
|
4230
|
+
style: T({ color: ye.value })
|
|
4231
|
+
}, F(e.detail), 5)) : m("", !0)])], 8, Xr))], 8, qr))), 128))
|
|
4232
|
+
], 12, Ur))])) : m("", !0)], 512),
|
|
4233
4233
|
o.value.meta.footer ? (k(), h("footer", {
|
|
4234
4234
|
key: 0,
|
|
4235
4235
|
class: "mt-3 text-[11px] leading-snug",
|
|
4236
4236
|
style: T({ color: H.value })
|
|
4237
4237
|
}, F(o.value.meta.footer), 5)) : m("", !0)
|
|
4238
|
-
], 12,
|
|
4238
|
+
], 12, wr)) : m("", !0);
|
|
4239
4239
|
}
|
|
4240
|
-
}),
|
|
4240
|
+
}), $r = ["innerHTML"], ei = /* @__PURE__ */ x({
|
|
4241
4241
|
__name: "ChatRichText",
|
|
4242
4242
|
props: {
|
|
4243
4243
|
text: {},
|
|
@@ -4246,7 +4246,7 @@ var Cr = [
|
|
|
4246
4246
|
},
|
|
4247
4247
|
setup(e) {
|
|
4248
4248
|
let t = e, n = P(t.text), r;
|
|
4249
|
-
|
|
4249
|
+
ce([() => t.text, () => t.streaming], ([e, i]) => {
|
|
4250
4250
|
if (!i) {
|
|
4251
4251
|
r !== void 0 && (cancelAnimationFrame(r), r = void 0), n.value = e;
|
|
4252
4252
|
return;
|
|
@@ -4396,7 +4396,7 @@ var Cr = [
|
|
|
4396
4396
|
key: 0,
|
|
4397
4397
|
class: C(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
|
|
4398
4398
|
innerHTML: t.html
|
|
4399
|
-
}, null, 10,
|
|
4399
|
+
}, null, 10, $r)) : t.kind === "visual" ? (k(), p(Qr, {
|
|
4400
4400
|
key: 1,
|
|
4401
4401
|
result: t.result,
|
|
4402
4402
|
inverted: e.inverted
|
|
@@ -4414,7 +4414,7 @@ var Cr = [
|
|
|
4414
4414
|
style: { background: "currentcolor" }
|
|
4415
4415
|
}, null, -1), v(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
|
|
4416
4416
|
}
|
|
4417
|
-
}),
|
|
4417
|
+
}), ti = 80, ni = /* @__PURE__ */ x({
|
|
4418
4418
|
__name: "ChatScroller",
|
|
4419
4419
|
setup(e, { expose: t }) {
|
|
4420
4420
|
let n = A(), r = A(), i = A(!0), a;
|
|
@@ -4424,7 +4424,7 @@ var Cr = [
|
|
|
4424
4424
|
}
|
|
4425
4425
|
function onScroll() {
|
|
4426
4426
|
let e = n.value;
|
|
4427
|
-
e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
4427
|
+
e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= ti);
|
|
4428
4428
|
}
|
|
4429
4429
|
function pin() {
|
|
4430
4430
|
i.value = !0, scrollToBottom();
|
|
@@ -4434,7 +4434,7 @@ var Cr = [
|
|
|
4434
4434
|
scrollToBottom(), requestAnimationFrame(scrollToBottom);
|
|
4435
4435
|
}), r.value && (a = new ResizeObserver(() => {
|
|
4436
4436
|
i.value && scrollToBottom();
|
|
4437
|
-
}), a.observe(r.value));
|
|
4437
|
+
}), a.observe(r.value), n.value && a.observe(n.value));
|
|
4438
4438
|
}), te(() => {
|
|
4439
4439
|
a?.disconnect();
|
|
4440
4440
|
}), (e, t) => (k(), h("div", {
|
|
@@ -4448,28 +4448,28 @@ var Cr = [
|
|
|
4448
4448
|
class: "flex-1 flex flex-col"
|
|
4449
4449
|
}, [ie(e.$slots, "default")], 512)], 34));
|
|
4450
4450
|
}
|
|
4451
|
-
}),
|
|
4451
|
+
}), ri = {
|
|
4452
4452
|
key: 0,
|
|
4453
4453
|
class: "pb-4"
|
|
4454
|
-
},
|
|
4454
|
+
}, ii = {
|
|
4455
4455
|
key: 1,
|
|
4456
4456
|
"data-test": "messaging-sdk-header",
|
|
4457
4457
|
class: "shrink-0 border-b border-theme-100 px-4 py-3"
|
|
4458
|
-
},
|
|
4458
|
+
}, ai = { class: "min-w-0 flex-1" }, oi = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, si = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, ci = {
|
|
4459
4459
|
key: 0,
|
|
4460
4460
|
class: "shrink-0 rounded-full bg-theme-50 px-2.5 py-1 font-mono text-[11px] font-medium text-theme-500"
|
|
4461
|
-
},
|
|
4461
|
+
}, li = {
|
|
4462
4462
|
key: 2,
|
|
4463
4463
|
class: "flex flex-col items-center justify-center px-6 py-16 text-center",
|
|
4464
4464
|
"data-test": "chat-offline"
|
|
4465
|
-
},
|
|
4465
|
+
}, ui = {
|
|
4466
4466
|
key: 0,
|
|
4467
4467
|
"data-test": "messaging-empty-state",
|
|
4468
4468
|
class: "flex flex-col items-center justify-center px-4"
|
|
4469
|
-
},
|
|
4469
|
+
}, di = ["title"], fi = {
|
|
4470
4470
|
key: 0,
|
|
4471
4471
|
class: "flex items-center gap-3 py-3 px-2"
|
|
4472
|
-
},
|
|
4472
|
+
}, pi = ["data-journal-outcome"], mi = [
|
|
4473
4473
|
"data-message-id",
|
|
4474
4474
|
"data-message-sender",
|
|
4475
4475
|
"data-conversation-id",
|
|
@@ -4480,7 +4480,7 @@ var Cr = [
|
|
|
4480
4480
|
"data-issue-action-label",
|
|
4481
4481
|
"data-issue-action-url",
|
|
4482
4482
|
"data-streaming"
|
|
4483
|
-
],
|
|
4483
|
+
], hi = { class: "max-w-[85%] min-w-0" }, gi = ["href"], _i = [
|
|
4484
4484
|
"data-message-id",
|
|
4485
4485
|
"data-message-sender",
|
|
4486
4486
|
"data-conversation-id",
|
|
@@ -4489,7 +4489,7 @@ var Cr = [
|
|
|
4489
4489
|
"data-issue-code",
|
|
4490
4490
|
"data-issue-bucket",
|
|
4491
4491
|
"data-streaming"
|
|
4492
|
-
],
|
|
4492
|
+
], vi = [
|
|
4493
4493
|
"data-test",
|
|
4494
4494
|
"data-message-id",
|
|
4495
4495
|
"data-message-sender",
|
|
@@ -4497,51 +4497,55 @@ var Cr = [
|
|
|
4497
4497
|
"data-message-sequence",
|
|
4498
4498
|
"data-system-kind",
|
|
4499
4499
|
"data-streaming"
|
|
4500
|
-
],
|
|
4500
|
+
], yi = ["src", "alt"], bi = ["src"], xi = ["href"], Si = {
|
|
4501
4501
|
key: 0,
|
|
4502
4502
|
"data-test": "messaging-message-text-part"
|
|
4503
|
-
},
|
|
4503
|
+
}, Ci = [
|
|
4504
4504
|
"src",
|
|
4505
4505
|
"alt",
|
|
4506
4506
|
"data-attachment-placement"
|
|
4507
|
-
],
|
|
4507
|
+
], wi = ["src", "data-attachment-placement"], Ti = ["href", "data-attachment-placement"], Ei = ["data-journal-outcome"], Di = {
|
|
4508
4508
|
key: 2,
|
|
4509
4509
|
"data-test": "messaging-tool-activity-tail",
|
|
4510
4510
|
"aria-label": "Assistant is still working",
|
|
4511
4511
|
class: "mb-4 grid h-[17px] w-5 place-items-center"
|
|
4512
|
-
},
|
|
4512
|
+
}, Oi = ["data-journal-outcome"], ki = ["data-working-description"], Ai = { class: "truncate" }, ji = ["data-issue-code"], Mi = ["href"], Ni = {
|
|
4513
4513
|
key: 3,
|
|
4514
4514
|
"data-test": "messaging-thinking-indicator",
|
|
4515
4515
|
class: "flex gap-2 justify-start items-center mb-4"
|
|
4516
|
-
},
|
|
4516
|
+
}, Pi = ["src", "alt"], Fi = { class: "max-w-20 truncate" }, Ii = ["onClick"], Li = {
|
|
4517
4517
|
key: 0,
|
|
4518
4518
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
4519
|
-
},
|
|
4519
|
+
}, Ri = ["data-composer-action"], zi = ["placeholder", "disabled"], Bi = { class: "font-mono text-sm tabular-nums" }, Vi = { class: "mt-2.5 flex items-center" }, Hi = [
|
|
4520
4520
|
"disabled",
|
|
4521
4521
|
"aria-label",
|
|
4522
4522
|
"title"
|
|
4523
|
-
],
|
|
4523
|
+
], Ui = {
|
|
4524
4524
|
key: 0,
|
|
4525
4525
|
class: "i-svg-spinners-ring-resize size-5"
|
|
4526
|
-
},
|
|
4526
|
+
}, Wi = {
|
|
4527
4527
|
key: 1,
|
|
4528
4528
|
class: "i-tabler-plus size-5"
|
|
4529
|
-
},
|
|
4529
|
+
}, Gi = { class: "sr-only" }, Ki = { class: "flex items-center gap-2" }, qi = ["aria-label", "title"], Ji = { class: "sr-only" }, Yi = [
|
|
4530
4530
|
"data-composer-action",
|
|
4531
4531
|
"disabled",
|
|
4532
4532
|
"aria-label",
|
|
4533
4533
|
"title"
|
|
4534
|
-
],
|
|
4534
|
+
], Xi = {
|
|
4535
4535
|
key: 0,
|
|
4536
4536
|
class: "i-tabler-player-stop-filled size-3.5"
|
|
4537
|
-
},
|
|
4537
|
+
}, Zi = {
|
|
4538
4538
|
key: 1,
|
|
4539
4539
|
class: "i-tabler-arrow-up size-[17px]"
|
|
4540
|
-
},
|
|
4540
|
+
}, Qi = { class: "sr-only" }, $i = {
|
|
4541
4541
|
key: 2,
|
|
4542
4542
|
"data-test": "messaging-suggested-prompts",
|
|
4543
4543
|
class: "mt-5 w-full sm:mx-auto sm:max-w-[720px]"
|
|
4544
|
-
},
|
|
4544
|
+
}, ea = { class: "flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-center" }, ta = [
|
|
4545
|
+
"disabled",
|
|
4546
|
+
"tabindex",
|
|
4547
|
+
"onClick"
|
|
4548
|
+
], na = ["aria-expanded"], ra = 2500, ia = /* @__PURE__ */ x({
|
|
4545
4549
|
__name: "ElAgentChat",
|
|
4546
4550
|
props: {
|
|
4547
4551
|
chatController: {},
|
|
@@ -4594,36 +4598,36 @@ var Cr = [
|
|
|
4594
4598
|
return !r || r.sender !== n.sender;
|
|
4595
4599
|
}
|
|
4596
4600
|
let s = f(() => e.chatController?.textState.value), c = f(() => s.value?.isConnected ?? !1), x = f(() => s.value?.isThinking ?? !1), T = f(() => s.value?.connectionStatus === "disconnected" && !!s.value?.error), te = f(() => s.value?.connectionStatus !== "connected" && !s.value?.error), ae = A(!1), P;
|
|
4597
|
-
|
|
4601
|
+
ce(T, (e) => {
|
|
4598
4602
|
if (clearTimeout(P), !e) {
|
|
4599
4603
|
ae.value = !1;
|
|
4600
4604
|
return;
|
|
4601
4605
|
}
|
|
4602
4606
|
P = setTimeout(() => {
|
|
4603
4607
|
ae.value = !0;
|
|
4604
|
-
},
|
|
4608
|
+
}, ra);
|
|
4605
4609
|
}, { immediate: !0 }), re(() => clearTimeout(P));
|
|
4606
|
-
let oe = f(() => T.value && ae.value),
|
|
4610
|
+
let oe = f(() => T.value && ae.value), he = f(() => te.value || T.value && !ae.value), z = A(!1);
|
|
4607
4611
|
async function retryConnection() {
|
|
4608
4612
|
await e.chatController?.startTextConversation();
|
|
4609
4613
|
}
|
|
4610
|
-
let
|
|
4611
|
-
for (let e =
|
|
4612
|
-
let t =
|
|
4614
|
+
let ve = f(() => e.chatController?.liveTurnBlocks?.value ?? []), B = f(() => {
|
|
4615
|
+
for (let e = ve.value.length - 1; e >= 0; e--) {
|
|
4616
|
+
let t = ve.value[e];
|
|
4613
4617
|
if (t?.kind === "text") return t.id;
|
|
4614
4618
|
}
|
|
4615
|
-
}), ye = f(() => e.chatController?.liveStreamMessageId?.value),
|
|
4619
|
+
}), ye = f(() => e.chatController?.liveStreamMessageId?.value), H = f(() => {
|
|
4616
4620
|
let t = e.chatController?.sharedMessages.value ?? [];
|
|
4617
|
-
return
|
|
4618
|
-
}),
|
|
4621
|
+
return ve.value.length && ye.value ? t.filter((e) => e.id !== ye.value) : t;
|
|
4622
|
+
}), be = f(() => {
|
|
4619
4623
|
if (!e.chatController?.workJournal?.value) return s.value?.workingDescription?.trim() || void 0;
|
|
4620
|
-
}),
|
|
4621
|
-
if (!
|
|
4622
|
-
let e =
|
|
4624
|
+
}), U = f(() => e.chatController?.workJournal?.value), Se = f(() => {
|
|
4625
|
+
if (!U.value && !ve.value.length) return;
|
|
4626
|
+
let e = H.value, t = e[e.length - 1];
|
|
4623
4627
|
if (t) return t.sender === "agent" || t.sender === "system" ? e.length >= 2 ? e[e.length - 2].id : void 0 : t.id;
|
|
4624
|
-
}),
|
|
4628
|
+
}), W = f(() => {
|
|
4625
4629
|
let t = {};
|
|
4626
|
-
for (let n of
|
|
4630
|
+
for (let n of H.value) {
|
|
4627
4631
|
if (n.sender === "user" || !n.toolActivities?.length) continue;
|
|
4628
4632
|
let r = e.chatController?.workJournalFor?.({
|
|
4629
4633
|
activities: n.toolActivities,
|
|
@@ -4635,7 +4639,7 @@ var Cr = [
|
|
|
4635
4639
|
return t;
|
|
4636
4640
|
});
|
|
4637
4641
|
function messageWorkJournal(e) {
|
|
4638
|
-
return
|
|
4642
|
+
return W.value[e.id];
|
|
4639
4643
|
}
|
|
4640
4644
|
function inlineOffset(e, t) {
|
|
4641
4645
|
return e.placement?.kind !== "inline" || !Number.isFinite(e.placement.offset) ? null : Math.max(0, Math.min(t.length, Math.trunc(e.placement.offset)));
|
|
@@ -4683,18 +4687,18 @@ var Cr = [
|
|
|
4683
4687
|
text: t.slice(i)
|
|
4684
4688
|
}), r;
|
|
4685
4689
|
}
|
|
4686
|
-
let
|
|
4690
|
+
let G = f(() => s.value?.transientIssue), Ce = f(() => {
|
|
4687
4691
|
if (!x.value) return;
|
|
4688
|
-
let e =
|
|
4692
|
+
let e = H.value, t = e[e.length - 1];
|
|
4689
4693
|
return t?.sender === "agent" || t?.sender === "system" ? t.id : void 0;
|
|
4690
|
-
}), we = f(() => !x.value ||
|
|
4694
|
+
}), we = f(() => !x.value || be.value || U.value || ve.value.length ? !1 : Ce.value === void 0), Te = f(() => s.value?.sendBlockedReason), Ee = f(() => !c.value || Te.value !== void 0), De = f(() => T.value ? "Agent is offline" : te.value ? "Connecting..." : Te.value === "agent_deleted" ? "This assistant was deleted" : Te.value === "account" ? "Open billing to keep chatting" : `Message ${e.agent.displayName.value || e.agent.name.value || "assistant"}`), Oe = f(() => e.chatController?.composerState?.value ?? {
|
|
4691
4695
|
text: "",
|
|
4692
4696
|
pendingAttachments: [],
|
|
4693
4697
|
isUploading: !1
|
|
4694
4698
|
}), ke = f({
|
|
4695
4699
|
get: () => Oe.value.text,
|
|
4696
4700
|
set: (t) => e.chatController?.setComposerText?.({ text: t })
|
|
4697
|
-
}), Ae = f(() => Oe.value.pendingAttachments), je = f(() => Oe.value.isUploading), Me = f(() => e.chatController?.voiceRecorder), Ne = f(() => Me.value?.isBusy.value ?? !1), Fe = f(() => e.chatController?.canAttachFile?.value ?? !1), Ie = f(() => e.chatController?.canRecordAudio?.value ?? !1), Le = f(() => e.chatController?.composerAction?.value ?? "idle"), Re = f(() => Le.value !== "idle"), Be = f(() => Le.value === "stop" ? "Stop reply" : "Send message"), Ve = f(() => Ie.value && !Ne.value && !!Me.value?.canUseBrowserRecording), He = f(() => Me.value?.isActive.value ?? !1), Ue = f(() => Me.value?.elapsedLabel.value ?? "0:00"), We = f(() => Me.value?.statusText.value ?? "Release to send"), Ge = f(() => Me.value?.state.value.phase === "sending" ? "Sending voice message" : He.value ? "Release to send voice message" : "Hold to record voice message"),
|
|
4701
|
+
}), Ae = f(() => Oe.value.pendingAttachments), je = f(() => Oe.value.isUploading), Me = f(() => e.chatController?.voiceRecorder), Ne = f(() => Me.value?.isBusy.value ?? !1), Fe = f(() => e.chatController?.canAttachFile?.value ?? !1), Ie = f(() => e.chatController?.canRecordAudio?.value ?? !1), Le = f(() => e.chatController?.composerAction?.value ?? "idle"), Re = f(() => Le.value !== "idle"), Be = f(() => Le.value === "stop" ? "Stop reply" : "Send message"), Ve = f(() => Ie.value && !Ne.value && !!Me.value?.canUseBrowserRecording), He = f(() => Me.value?.isActive.value ?? !1), Ue = f(() => Me.value?.elapsedLabel.value ?? "0:00"), We = f(() => Me.value?.statusText.value ?? "Release to send"), Ge = f(() => Me.value?.state.value.phase === "sending" ? "Sending voice message" : He.value ? "Release to send voice message" : "Hold to record voice message"), K = f(() => e.variant === "light"), Ke = f(() => K.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"), Je = f(() => K.value ? "text-theme-300" : "text-white/30");
|
|
4698
4702
|
ne(async () => {
|
|
4699
4703
|
e.chatController && !c.value && await e.chatController.startTextConversation();
|
|
4700
4704
|
}), re(() => {
|
|
@@ -4718,7 +4722,7 @@ var Cr = [
|
|
|
4718
4722
|
function adjustTextareaHeight() {
|
|
4719
4723
|
a.value && (a.value.style.height = "auto", a.value.style.height = `${Math.min(a.value.scrollHeight, 150)}px`);
|
|
4720
4724
|
}
|
|
4721
|
-
|
|
4725
|
+
ce(ke, () => S(() => adjustTextareaHeight()));
|
|
4722
4726
|
function triggerFileInput() {
|
|
4723
4727
|
o.value?.click();
|
|
4724
4728
|
}
|
|
@@ -4762,56 +4766,56 @@ var Cr = [
|
|
|
4762
4766
|
...o ? {} : { year: "numeric" }
|
|
4763
4767
|
})}, ${a}`;
|
|
4764
4768
|
}
|
|
4765
|
-
return (t, s) => (k(), h("div", { class: C(["@container/chat relative flex h-full flex-col",
|
|
4766
|
-
e.showHeader && !
|
|
4769
|
+
return (t, s) => (k(), h("div", { class: C(["@container/chat relative flex h-full flex-col", H.value.length === 0 ? "justify-center" : ""]) }, [
|
|
4770
|
+
e.showHeader && !K.value ? (k(), h("div", ri, [b(Pe, {
|
|
4767
4771
|
agent: e.agent,
|
|
4768
4772
|
"is-online": c.value
|
|
4769
|
-
}, null, 8, ["agent", "is-online"])])) : e.showHeader ? (k(), h("div",
|
|
4773
|
+
}, null, 8, ["agent", "is-online"])])) : e.showHeader ? (k(), h("div", ii, [_("div", { class: C(["flex items-center gap-3", e.centered ? "max-w-[720px] mx-auto" : ""]) }, [
|
|
4770
4774
|
b(ze, {
|
|
4771
4775
|
agent: e.agent,
|
|
4772
|
-
"is-light":
|
|
4776
|
+
"is-light": K.value,
|
|
4773
4777
|
class: "size-10"
|
|
4774
4778
|
}, null, 8, ["agent", "is-light"]),
|
|
4775
|
-
_("div",
|
|
4776
|
-
e.headerMeta ? (k(), h("span",
|
|
4779
|
+
_("div", ai, [_("div", oi, F(e.agent.displayName.value), 1), _("div", si, F(e.agent.title.value || "Assistant"), 1)]),
|
|
4780
|
+
e.headerMeta ? (k(), h("span", ci, F(e.headerMeta), 1)) : m("", !0)
|
|
4777
4781
|
], 2)])) : m("", !0),
|
|
4778
|
-
oe.value ? (k(), h("div",
|
|
4779
|
-
_("p", { class: C(["text-[15px] font-semibold",
|
|
4780
|
-
_("p", { class: C(["mt-1.5 max-w-[340px] text-pretty text-[13.5px] leading-relaxed",
|
|
4782
|
+
oe.value ? (k(), h("div", li, [
|
|
4783
|
+
_("p", { class: C(["text-[15px] font-semibold", K.value ? "text-theme-900" : "text-white"]) }, " Can't reach " + F(e.agent?.displayName.value || "your assistant") + " right now ", 3),
|
|
4784
|
+
_("p", { class: C(["mt-1.5 max-w-[340px] text-pretty text-[13.5px] leading-relaxed", K.value ? "text-theme-500" : "text-white/60"]) }, " Your messages are safe. This usually clears on its own. ", 2),
|
|
4781
4785
|
_("button", {
|
|
4782
4786
|
type: "button",
|
|
4783
4787
|
"data-test": "chat-offline-retry",
|
|
4784
|
-
class: C(["mt-5 cursor-pointer rounded-full px-4 py-2 text-[13.5px] font-semibold transition-colors",
|
|
4788
|
+
class: C(["mt-5 cursor-pointer rounded-full px-4 py-2 text-[13.5px] font-semibold transition-colors", K.value ? "text-theme-900 ring-1 ring-theme-200 hover:bg-theme-50" : "text-white ring-1 ring-white/20 hover:bg-white/10"]),
|
|
4785
4789
|
onClick: s[0] || (s[0] = (e) => retryConnection())
|
|
4786
4790
|
}, " Try again ", 2)
|
|
4787
|
-
])) :
|
|
4791
|
+
])) : he.value ? (k(), h("div", {
|
|
4788
4792
|
key: 3,
|
|
4789
|
-
class: C(["py-16 flex flex-col items-center justify-center gap-2 text-sm",
|
|
4790
|
-
}, [b(
|
|
4793
|
+
class: C(["py-16 flex flex-col items-center justify-center gap-2 text-sm", K.value ? "text-theme-400" : "text-theme-600"])
|
|
4794
|
+
}, [b(_e, { class: "size-4" })], 2)) : e.setupHint ? (k(), h("div", {
|
|
4791
4795
|
key: 4,
|
|
4792
4796
|
class: C(["flex items-center justify-center gap-1.5 py-2 text-[11px]", Je.value])
|
|
4793
4797
|
}, [s[21] || (s[21] = _("i", { class: "i-tabler-tool size-3" }, null, -1)), _("span", null, F(e.setupHint), 1)], 2)) : m("", !0),
|
|
4794
|
-
b(
|
|
4798
|
+
b(ni, {
|
|
4795
4799
|
ref_key: "chatScroller",
|
|
4796
4800
|
ref: i,
|
|
4797
|
-
class: C(
|
|
4801
|
+
class: C(H.value.length === 0 ? "flex-none" : "flex-1")
|
|
4798
4802
|
}, {
|
|
4799
|
-
default:
|
|
4800
|
-
|
|
4803
|
+
default: R(() => [_("div", { class: C([H.value.length === 0 ? "flex flex-col items-center justify-center px-3 py-4" : "pt-4 pb-[120px] px-3 space-y-2", e.centered ? "max-w-[720px] mx-auto w-full" : ""]) }, [
|
|
4804
|
+
H.value.length === 0 && !he.value && !oe.value ? (k(), h("div", ui, [ie(t.$slots, "empty-heading", {
|
|
4801
4805
|
agent: e.agent,
|
|
4802
|
-
isLight:
|
|
4806
|
+
isLight: K.value
|
|
4803
4807
|
}, () => [b(ze, {
|
|
4804
4808
|
agent: e.agent,
|
|
4805
|
-
"is-light":
|
|
4809
|
+
"is-light": K.value,
|
|
4806
4810
|
class: "mb-4 size-20 @sm/chat:size-24"
|
|
4807
|
-
}, null, 8, ["agent", "is-light"]), _("div", { class: C(["text-base @sm/chat:text-lg font-semibold",
|
|
4808
|
-
class: C(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]",
|
|
4811
|
+
}, null, 8, ["agent", "is-light"]), _("div", { class: C(["text-base @sm/chat:text-lg font-semibold", K.value ? "text-theme-900" : "text-white"]) }, F(e.agent.displayName.value), 3)]), e.emptyStateMessage === "" ? m("", !0) : (k(), h(u, { key: 0 }, [_("p", { class: C(["mt-1 text-center text-xs @sm/chat:text-sm", Je.value]) }, F(e.emptyStateMessage || "Type your message to get started."), 3), _("div", {
|
|
4812
|
+
class: C(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", K.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
4809
4813
|
title: n.value.tooltip
|
|
4810
|
-
}, [_("i", { class: C([n.value.icon, "size-3"]) }, null, 2), _("span", null, F(n.value.label), 1)], 10,
|
|
4811
|
-
(k(!0), h(u, null, j(
|
|
4812
|
-
shouldShowTimeDivider(
|
|
4814
|
+
}, [_("i", { class: C([n.value.icon, "size-3"]) }, null, 2), _("span", null, F(n.value.label), 1)], 10, di)], 64))])) : m("", !0),
|
|
4815
|
+
(k(!0), h(u, null, j(H.value, (e, t) => (k(), h(u, { key: e.id }, [
|
|
4816
|
+
shouldShowTimeDivider(H.value, t) ? (k(), h("div", fi, [
|
|
4813
4817
|
_("div", { class: C(["flex-1 h-px", Ke.value]) }, null, 2),
|
|
4814
|
-
_("span", { class: C(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", Je.value]) }, F(shouldShowTimeDivider(
|
|
4818
|
+
_("span", { class: C(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", Je.value]) }, F(shouldShowTimeDivider(H.value, t)), 3),
|
|
4815
4819
|
_("div", { class: C(["flex-1 h-px", Ke.value]) }, null, 2)
|
|
4816
4820
|
])) : m("", !0),
|
|
4817
4821
|
messageWorkJournal(e) ? (k(), h("div", {
|
|
@@ -4821,8 +4825,8 @@ var Cr = [
|
|
|
4821
4825
|
class: "mb-4 w-full"
|
|
4822
4826
|
}, [b(qe, {
|
|
4823
4827
|
model: messageWorkJournal(e),
|
|
4824
|
-
"is-light":
|
|
4825
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
4828
|
+
"is-light": K.value
|
|
4829
|
+
}, null, 8, ["model", "is-light"])], 8, pi)) : m("", !0),
|
|
4826
4830
|
isSystemExplainerMessage(e) ? (k(), h("div", {
|
|
4827
4831
|
key: 2,
|
|
4828
4832
|
"data-test": "messaging-system-msg",
|
|
@@ -4837,27 +4841,27 @@ var Cr = [
|
|
|
4837
4841
|
"data-issue-action-url": e.issue?.actionUrl,
|
|
4838
4842
|
"data-streaming": e.id === Ce.value ? "true" : void 0,
|
|
4839
4843
|
class: "flex gap-2 items-end justify-start mb-4"
|
|
4840
|
-
}, [_("div",
|
|
4844
|
+
}, [_("div", hi, [_("div", { class: C(["mb-1 pl-1 text-[11px] font-medium", K.value ? "text-theme-500" : "text-white/45"]) }, " System Message ", 2), _("div", { class: C(["rounded-[20px] rounded-bl-[4px] px-4 py-2.5 border system-msg-content", K.value ? "bg-theme-25 border-theme-100 text-theme-700" : "bg-white/[0.08] border-white/10 text-white/85"]) }, [e.text ? (k(), p(ei, {
|
|
4841
4845
|
key: 0,
|
|
4842
4846
|
text: e.text,
|
|
4843
|
-
inverted: !
|
|
4847
|
+
inverted: !K.value,
|
|
4844
4848
|
streaming: e.id === Ce.value,
|
|
4845
|
-
onClick: s[1] || (s[1] =
|
|
4849
|
+
onClick: s[1] || (s[1] = pe(() => {}, ["stop"]))
|
|
4846
4850
|
}, null, 8, [
|
|
4847
4851
|
"text",
|
|
4848
4852
|
"inverted",
|
|
4849
4853
|
"streaming"
|
|
4850
|
-
])) : e.issue?.help ? (k(), p(
|
|
4854
|
+
])) : e.issue?.help ? (k(), p(ei, {
|
|
4851
4855
|
key: 1,
|
|
4852
4856
|
text: e.issue.help,
|
|
4853
|
-
inverted: !
|
|
4857
|
+
inverted: !K.value
|
|
4854
4858
|
}, null, 8, ["text", "inverted"])) : m("", !0), e.issue?.actionUrl && !containsMarkdownLink(e.text) ? (k(), h("a", {
|
|
4855
4859
|
key: 2,
|
|
4856
4860
|
href: e.issue.actionUrl,
|
|
4857
4861
|
"data-test": "messaging-system-msg-action",
|
|
4858
|
-
class: C(["mt-2 text-[12px] font-medium inline-flex items-center gap-1",
|
|
4859
|
-
onClick: s[2] || (s[2] =
|
|
4860
|
-
}, [v(F(e.issue.actionLabel) + " ", 1), s[22] || (s[22] = _("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10,
|
|
4862
|
+
class: C(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", K.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
4863
|
+
onClick: s[2] || (s[2] = pe(() => {}, ["stop"]))
|
|
4864
|
+
}, [v(F(e.issue.actionLabel) + " ", 1), s[22] || (s[22] = _("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, gi)) : m("", !0)], 2)])], 8, mi)) : e.sender === "system" ? (k(), h("div", {
|
|
4861
4865
|
key: 3,
|
|
4862
4866
|
"data-test": "messaging-system-status-msg",
|
|
4863
4867
|
"data-message-id": e.id,
|
|
@@ -4868,12 +4872,12 @@ var Cr = [
|
|
|
4868
4872
|
"data-issue-code": e.issue?.code,
|
|
4869
4873
|
"data-issue-bucket": e.issue?.bucket,
|
|
4870
4874
|
"data-streaming": e.id === Ce.value ? "true" : void 0,
|
|
4871
|
-
class: C(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed",
|
|
4872
|
-
}, [s[23] || (s[23] = _("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)), b(
|
|
4875
|
+
class: C(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", K.value ? "text-theme-500" : "text-white/60"])
|
|
4876
|
+
}, [s[23] || (s[23] = _("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)), b(ei, {
|
|
4873
4877
|
text: e.text,
|
|
4874
|
-
inverted: !
|
|
4875
|
-
onClick: s[3] || (s[3] =
|
|
4876
|
-
}, null, 8, ["text", "inverted"])], 10,
|
|
4878
|
+
inverted: !K.value,
|
|
4879
|
+
onClick: s[3] || (s[3] = pe(() => {}, ["stop"]))
|
|
4880
|
+
}, null, 8, ["text", "inverted"])], 10, _i)) : (k(), h("div", {
|
|
4877
4881
|
key: 4,
|
|
4878
4882
|
"data-test": e.sender === "agent" ? "messaging-assistant-msg" : e.sender === "user" ? "messaging-user-msg" : void 0,
|
|
4879
4883
|
"data-message-id": e.id,
|
|
@@ -4885,7 +4889,7 @@ var Cr = [
|
|
|
4885
4889
|
class: C(["flex gap-2 items-end", {
|
|
4886
4890
|
"justify-end": e.sender === "user",
|
|
4887
4891
|
"justify-start": e.sender === "agent",
|
|
4888
|
-
"mb-6": isGroupEnd(
|
|
4892
|
+
"mb-6": isGroupEnd(H.value, t)
|
|
4889
4893
|
}])
|
|
4890
4894
|
}, [_("div", {
|
|
4891
4895
|
"data-test": "messaging-message-body",
|
|
@@ -4900,30 +4904,30 @@ var Cr = [
|
|
|
4900
4904
|
"data-test": "messaging-attachment",
|
|
4901
4905
|
"data-attachment-placement": "block",
|
|
4902
4906
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
4903
|
-
}, null, 8,
|
|
4907
|
+
}, null, 8, yi)) : e.type === "audio" ? (k(), h("audio", {
|
|
4904
4908
|
key: 1,
|
|
4905
4909
|
src: e.src,
|
|
4906
4910
|
controls: "",
|
|
4907
4911
|
"data-test": "messaging-attachment",
|
|
4908
4912
|
"data-attachment-placement": "block",
|
|
4909
4913
|
class: "max-w-full"
|
|
4910
|
-
}, null, 8,
|
|
4914
|
+
}, null, 8, bi)) : (k(), h("a", {
|
|
4911
4915
|
key: 2,
|
|
4912
4916
|
href: e.src,
|
|
4913
4917
|
target: "_blank",
|
|
4914
4918
|
rel: "noopener",
|
|
4915
4919
|
"data-test": "messaging-attachment",
|
|
4916
4920
|
"data-attachment-placement": "block",
|
|
4917
|
-
class: C(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs",
|
|
4918
|
-
}, [s[24] || (s[24] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + F(e.filename), 1)], 10,
|
|
4921
|
+
class: C(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", K.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
4922
|
+
}, [s[24] || (s[24] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + F(e.filename), 1)], 10, xi))], 64))), 128))], 2)) : m("", !0), messageRenderParts(e).length ? (k(), h("div", {
|
|
4919
4923
|
key: 1,
|
|
4920
4924
|
"data-test": "messaging-message-content",
|
|
4921
|
-
class: C(e.sender === "user" ?
|
|
4922
|
-
}, [(k(!0), h(u, null, j(messageRenderParts(e), (t) => (k(), h(u, { key: t.key }, [t.kind === "text" && t.text ? (k(), h("div",
|
|
4925
|
+
class: C(e.sender === "user" ? K.value ? "rounded-[20px] rounded-br-[4px] px-4 py-2.5 bg-theme-900 text-theme-0 shadow-[0_1px_2px_rgba(5,15,25,0.14)]" : "rounded-[20px] rounded-br-[4px] px-4 py-2.5 bg-theme-0 text-theme-950" : K.value ? "text-theme-800" : "text-white/95")
|
|
4926
|
+
}, [(k(!0), h(u, null, j(messageRenderParts(e), (t) => (k(), h(u, { key: t.key }, [t.kind === "text" && t.text ? (k(), h("div", Si, [b(ei, {
|
|
4923
4927
|
text: t.text,
|
|
4924
|
-
inverted: e.sender === "user" || !
|
|
4928
|
+
inverted: e.sender === "user" || !K.value,
|
|
4925
4929
|
streaming: e.id === Ce.value,
|
|
4926
|
-
onClick: s[4] || (s[4] =
|
|
4930
|
+
onClick: s[4] || (s[4] = pe(() => {}, ["stop"]))
|
|
4927
4931
|
}, null, 8, [
|
|
4928
4932
|
"text",
|
|
4929
4933
|
"inverted",
|
|
@@ -4935,88 +4939,88 @@ var Cr = [
|
|
|
4935
4939
|
"data-test": "messaging-attachment",
|
|
4936
4940
|
"data-attachment-placement": t.placement,
|
|
4937
4941
|
class: "my-2 rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
4938
|
-
}, null, 8,
|
|
4942
|
+
}, null, 8, Ci)) : t.kind === "attachment" && t.attachment.type === "audio" ? (k(), h("audio", {
|
|
4939
4943
|
key: 2,
|
|
4940
4944
|
src: t.attachment.src,
|
|
4941
4945
|
controls: "",
|
|
4942
4946
|
"data-test": "messaging-attachment",
|
|
4943
4947
|
"data-attachment-placement": t.placement,
|
|
4944
4948
|
class: "my-2 max-w-full"
|
|
4945
|
-
}, null, 8,
|
|
4949
|
+
}, null, 8, wi)) : t.kind === "attachment" ? (k(), h("a", {
|
|
4946
4950
|
key: 3,
|
|
4947
4951
|
href: t.attachment.src,
|
|
4948
4952
|
target: "_blank",
|
|
4949
4953
|
rel: "noopener",
|
|
4950
4954
|
"data-test": "messaging-attachment",
|
|
4951
4955
|
"data-attachment-placement": t.placement,
|
|
4952
|
-
class: C(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs",
|
|
4953
|
-
}, [s[25] || (s[25] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + F(t.attachment.filename), 1)], 10,
|
|
4954
|
-
e.id ===
|
|
4956
|
+
class: C(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", K.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
4957
|
+
}, [s[25] || (s[25] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + F(t.attachment.filename), 1)], 10, Ti)) : m("", !0)], 64))), 128))], 2)) : m("", !0)], 2)], 10, vi)),
|
|
4958
|
+
e.id === Se.value ? (k(), h(u, { key: 5 }, [ve.value.length ? (k(!0), h(u, { key: 0 }, j(ve.value, (e) => (k(), h(u, { key: e.id }, [e.kind === "work" ? (k(), h("div", {
|
|
4955
4959
|
key: 0,
|
|
4956
4960
|
"data-test": "messaging-tool-activity",
|
|
4957
4961
|
"data-journal-outcome": e.journal.outcome,
|
|
4958
4962
|
class: "mb-4 w-full"
|
|
4959
4963
|
}, [b(qe, {
|
|
4960
4964
|
model: e.journal,
|
|
4961
|
-
"is-light":
|
|
4962
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
4965
|
+
"is-light": K.value
|
|
4966
|
+
}, null, 8, ["model", "is-light"])], 8, Ei)) : e.kind === "text" && e.content ? (k(), h("div", {
|
|
4963
4967
|
key: 1,
|
|
4964
4968
|
"data-test": "messaging-live-text-block",
|
|
4965
|
-
class: C(["mb-4 @sm/chat:pr-[1em]",
|
|
4966
|
-
}, [b(
|
|
4969
|
+
class: C(["mb-4 @sm/chat:pr-[1em]", K.value ? "text-theme-800" : "text-white/95"])
|
|
4970
|
+
}, [b(ei, {
|
|
4967
4971
|
text: e.content,
|
|
4968
|
-
inverted: !
|
|
4969
|
-
streaming: e.id ===
|
|
4970
|
-
onClick: s[5] || (s[5] =
|
|
4972
|
+
inverted: !K.value,
|
|
4973
|
+
streaming: e.id === B.value,
|
|
4974
|
+
onClick: s[5] || (s[5] = pe(() => {}, ["stop"]))
|
|
4971
4975
|
}, null, 8, [
|
|
4972
4976
|
"text",
|
|
4973
4977
|
"inverted",
|
|
4974
4978
|
"streaming"
|
|
4975
|
-
])], 2)) : (k(), h("div",
|
|
4979
|
+
])], 2)) : (k(), h("div", Di, [b(_e, { class: C(["size-3.5", K.value ? "text-theme-500" : "text-white/70"]) }, null, 8, ["class"])]))], 64))), 128)) : U.value ? (k(), h("div", {
|
|
4976
4980
|
key: 1,
|
|
4977
4981
|
"data-test": "messaging-tool-activity",
|
|
4978
|
-
"data-journal-outcome":
|
|
4982
|
+
"data-journal-outcome": U.value.outcome,
|
|
4979
4983
|
class: "mb-4 w-full"
|
|
4980
4984
|
}, [b(qe, {
|
|
4981
|
-
model:
|
|
4982
|
-
"is-light":
|
|
4983
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
4985
|
+
model: U.value,
|
|
4986
|
+
"is-light": K.value
|
|
4987
|
+
}, null, 8, ["model", "is-light"])], 8, Oi)) : m("", !0)], 64)) : m("", !0)
|
|
4984
4988
|
], 64))), 128)),
|
|
4985
|
-
|
|
4989
|
+
be.value ? (k(), h("div", {
|
|
4986
4990
|
key: 1,
|
|
4987
4991
|
"data-test": "messaging-working-state",
|
|
4988
|
-
"data-working-description":
|
|
4989
|
-
class: C(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none",
|
|
4992
|
+
"data-working-description": be.value,
|
|
4993
|
+
class: C(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", K.value ? "text-theme-500" : "text-white/45"])
|
|
4990
4994
|
}, [s[26] || (s[26] = _("i", {
|
|
4991
4995
|
class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
|
|
4992
4996
|
"aria-hidden": "true"
|
|
4993
|
-
}, null, -1)), _("span",
|
|
4994
|
-
|
|
4997
|
+
}, null, -1)), _("span", Ai, F(be.value), 1)], 10, ki)) : m("", !0),
|
|
4998
|
+
G.value ? (k(), h("div", {
|
|
4995
4999
|
key: 2,
|
|
4996
5000
|
"data-test": "messaging-transient-issue",
|
|
4997
|
-
"data-issue-code":
|
|
4998
|
-
class: C(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug",
|
|
5001
|
+
"data-issue-code": G.value.code,
|
|
5002
|
+
class: C(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", K.value ? "text-theme-600" : "text-white/60"])
|
|
4999
5003
|
}, [
|
|
5000
5004
|
s[27] || (s[27] = _("i", {
|
|
5001
5005
|
class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
|
|
5002
5006
|
"aria-hidden": "true"
|
|
5003
5007
|
}, null, -1)),
|
|
5004
|
-
_("span", null, [v(F(
|
|
5005
|
-
|
|
5008
|
+
_("span", null, [v(F(G.value.message), 1), G.value.help ? (k(), h(u, { key: 0 }, [v(F(G.value.help), 1)], 64)) : m("", !0)]),
|
|
5009
|
+
G.value.actionUrl && G.value.actionLabel ? (k(), h("a", {
|
|
5006
5010
|
key: 0,
|
|
5007
|
-
href:
|
|
5011
|
+
href: G.value.actionUrl,
|
|
5008
5012
|
class: "shrink-0 underline underline-offset-2",
|
|
5009
|
-
onClick: s[6] || (s[6] =
|
|
5010
|
-
}, F(
|
|
5011
|
-
], 10,
|
|
5012
|
-
we.value ? (k(), h("div",
|
|
5013
|
-
class: C(["i-svg-spinners-3-dots-bounce size-7",
|
|
5013
|
+
onClick: s[6] || (s[6] = pe(() => {}, ["stop"]))
|
|
5014
|
+
}, F(G.value.actionLabel), 9, Mi)) : m("", !0)
|
|
5015
|
+
], 10, ji)) : m("", !0),
|
|
5016
|
+
we.value ? (k(), h("div", Ni, [_("i", {
|
|
5017
|
+
class: C(["i-svg-spinners-3-dots-bounce size-7", K.value ? "text-theme-400" : "text-white/50"]),
|
|
5014
5018
|
"aria-hidden": "true"
|
|
5015
5019
|
}, null, 2)])) : m("", !0)
|
|
5016
5020
|
], 2)]),
|
|
5017
5021
|
_: 3
|
|
5018
5022
|
}, 8, ["class"]),
|
|
5019
|
-
_("div", { class: C(["left-0 right-0 z-30 px-5 pb-4 pt-3", [
|
|
5023
|
+
_("div", { class: C(["left-0 right-0 z-30 px-5 pb-4 pt-3", [H.value.length === 0 ? "relative shrink-0" : "absolute bottom-0", K.value ? "bg-gradient-to-t from-theme-0/90 via-theme-0/55 to-transparent" : "bg-gradient-to-t from-black/90 via-black/60 to-transparent"]]) }, [
|
|
5020
5024
|
Ae.value.length > 0 ? (k(), h("div", {
|
|
5021
5025
|
key: 0,
|
|
5022
5026
|
class: C(["flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", e.centered ? "max-w-[720px] mx-auto" : ""])
|
|
@@ -5027,14 +5031,14 @@ var Cr = [
|
|
|
5027
5031
|
key: 0,
|
|
5028
5032
|
src: e.src,
|
|
5029
5033
|
alt: e.filename,
|
|
5030
|
-
class: C(["size-14 rounded-xl object-cover border",
|
|
5031
|
-
}, null, 10,
|
|
5034
|
+
class: C(["size-14 rounded-xl object-cover border", K.value ? "border-black/10" : "border-white/20"])
|
|
5035
|
+
}, null, 10, Pi)) : (k(), h("div", {
|
|
5032
5036
|
key: 1,
|
|
5033
|
-
class: C(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border",
|
|
5034
|
-
}, [s[28] || (s[28] = _("i", { class: "i-tabler-file size-4" }, null, -1)), _("span",
|
|
5037
|
+
class: C(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", K.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
5038
|
+
}, [s[28] || (s[28] = _("i", { class: "i-tabler-file size-4" }, null, -1)), _("span", Fi, F(e.filename), 1)], 2)), _("button", {
|
|
5035
5039
|
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",
|
|
5036
5040
|
onClick: (e) => removeAttachment(t)
|
|
5037
|
-
}, [...s[29] || (s[29] = [_("i", { class: "i-tabler-x size-3" }, null, -1)])], 8,
|
|
5041
|
+
}, [...s[29] || (s[29] = [_("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, Ii)]))), 128)), je.value ? (k(), h("div", Li, [b(_e, { class: "size-5" })])) : m("", !0)], 2)) : m("", !0),
|
|
5038
5042
|
Fe.value ? (k(), h("input", {
|
|
5039
5043
|
key: 1,
|
|
5040
5044
|
ref_key: "fileInput",
|
|
@@ -5047,17 +5051,17 @@ var Cr = [
|
|
|
5047
5051
|
_("div", {
|
|
5048
5052
|
"data-test": "messaging-composer",
|
|
5049
5053
|
"data-composer-action": Le.value,
|
|
5050
|
-
class: C(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-3 transition-colors duration-200", [e.centered ? "max-w-[720px] mx-auto" : "",
|
|
5054
|
+
class: C(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-3 transition-colors duration-200", [e.centered ? "max-w-[720px] mx-auto" : "", K.value ? r.value ? "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.05),0_8px_24px_rgba(15,23,42,0.05)] ring-1 ring-theme-300" : "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.05),0_8px_24px_rgba(15,23,42,0.05)] ring-1 ring-theme-200 hover:ring-theme-300" : r.value ? "bg-white/15 backdrop-blur-xl ring-1 ring-white/25" : "bg-white/10 backdrop-blur-xl ring-1 ring-white/15 hover:ring-white/25"]]),
|
|
5051
5055
|
onClick: focusComposer
|
|
5052
5056
|
}, [He.value ? (k(), h("div", {
|
|
5053
5057
|
key: 1,
|
|
5054
5058
|
"data-test": "messaging-recording-state",
|
|
5055
|
-
class: C(["flex min-w-0 items-center gap-2 py-1",
|
|
5059
|
+
class: C(["flex min-w-0 items-center gap-2 py-1", K.value ? "text-theme-700" : "text-white/80"])
|
|
5056
5060
|
}, [
|
|
5057
5061
|
s[30] || (s[30] = _("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
|
|
5058
|
-
_("span",
|
|
5059
|
-
_("span", { class: C(["min-w-0 truncate text-sm",
|
|
5060
|
-
], 2)) :
|
|
5062
|
+
_("span", Bi, F(Ue.value), 1),
|
|
5063
|
+
_("span", { class: C(["min-w-0 truncate text-sm", K.value ? "text-theme-400" : "text-white/45"]) }, F(We.value), 3)
|
|
5064
|
+
], 2)) : ue((k(), h("textarea", {
|
|
5061
5065
|
key: 0,
|
|
5062
5066
|
ref_key: "textarea",
|
|
5063
5067
|
ref: a,
|
|
@@ -5071,76 +5075,78 @@ var Cr = [
|
|
|
5071
5075
|
fontSize: "16px",
|
|
5072
5076
|
resize: "none"
|
|
5073
5077
|
},
|
|
5074
|
-
class: C(["block w-full bg-transparent leading-snug focus:outline-none disabled:opacity-50 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
5078
|
+
class: C(["block w-full bg-transparent leading-snug focus:outline-none disabled:opacity-50 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", K.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
5075
5079
|
onKeydown: handleKeydown,
|
|
5076
5080
|
onFocus: s[8] || (s[8] = (e) => r.value = !0),
|
|
5077
5081
|
onBlur: s[9] || (s[9] = (e) => r.value = !1)
|
|
5078
|
-
}, null, 42,
|
|
5082
|
+
}, null, 42, zi)), [[I, ke.value]]), _("div", Vi, [
|
|
5079
5083
|
_("button", {
|
|
5080
5084
|
class: C(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70", [
|
|
5081
5085
|
Fe.value ? "cursor-pointer" : "cursor-default",
|
|
5082
|
-
|
|
5086
|
+
K.value ? "text-theme-500" : "text-white/50",
|
|
5083
5087
|
je.value || Ne.value ? "opacity-50 pointer-events-none" : ""
|
|
5084
5088
|
]]),
|
|
5085
5089
|
disabled: Ee.value || je.value || Ne.value || !Fe.value,
|
|
5086
5090
|
"aria-label": Fe.value ? "Attach file" : "File attachments unavailable",
|
|
5087
5091
|
title: Fe.value ? "Attach file" : "File attachments unavailable",
|
|
5088
5092
|
onClick: s[10] || (s[10] = (e) => Fe.value && triggerFileInput())
|
|
5089
|
-
}, [je.value ? (k(), h("i",
|
|
5093
|
+
}, [je.value ? (k(), h("i", Ui)) : (k(), h("i", Wi)), _("span", Gi, F(Fe.value ? "Attach file" : "File attachments unavailable"), 1)], 10, Hi),
|
|
5090
5094
|
s[31] || (s[31] = _("div", { class: "flex-1" }, null, -1)),
|
|
5091
|
-
_("div",
|
|
5095
|
+
_("div", Ki, [Ve.value || He.value ? (k(), h("button", {
|
|
5092
5096
|
key: 0,
|
|
5093
5097
|
"data-test": "messaging-record-audio-btn",
|
|
5094
|
-
class: C(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 hover:opacity-70", He.value ?
|
|
5098
|
+
class: C(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 hover:opacity-70", He.value ? K.value ? "text-theme-900 scale-110" : "text-white scale-110" : K.value ? "text-theme-500" : "text-white/60"]),
|
|
5095
5099
|
"aria-label": Ge.value,
|
|
5096
5100
|
title: Ge.value,
|
|
5097
|
-
onPointerdown: s[11] || (s[11] =
|
|
5098
|
-
onPointerup: s[12] || (s[12] =
|
|
5099
|
-
onPointercancel: s[13] || (s[13] =
|
|
5101
|
+
onPointerdown: s[11] || (s[11] = pe((e) => startRecording(), ["prevent"])),
|
|
5102
|
+
onPointerup: s[12] || (s[12] = pe((e) => finishRecording({ cancelled: !1 }), ["prevent"])),
|
|
5103
|
+
onPointercancel: s[13] || (s[13] = pe((e) => finishRecording({ cancelled: !0 }), ["prevent"])),
|
|
5100
5104
|
onKeydown: [
|
|
5101
|
-
s[14] || (s[14] =
|
|
5102
|
-
s[16] || (s[16] =
|
|
5103
|
-
s[18] || (s[18] =
|
|
5105
|
+
s[14] || (s[14] = de(pe((e) => startRecording(), ["prevent"]), ["enter"])),
|
|
5106
|
+
s[16] || (s[16] = de(pe((e) => startRecording(), ["prevent"]), ["space"])),
|
|
5107
|
+
s[18] || (s[18] = de(pe((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
|
|
5104
5108
|
],
|
|
5105
|
-
onKeyup: [s[15] || (s[15] =
|
|
5106
|
-
}, [_("i", { class: C([He.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), _("span",
|
|
5109
|
+
onKeyup: [s[15] || (s[15] = de(pe((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["enter"])), s[17] || (s[17] = de(pe((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["space"]))]
|
|
5110
|
+
}, [_("i", { class: C([He.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), _("span", Ji, F(Ge.value), 1)], 42, qi)) : m("", !0), He.value ? m("", !0) : (k(), h("button", {
|
|
5107
5111
|
key: 1,
|
|
5108
5112
|
"data-test": "messaging-send-btn",
|
|
5109
5113
|
"data-composer-action": Le.value,
|
|
5110
|
-
class: C(["flex size-8 items-center justify-center rounded-full transition-colors duration-150", Re.value ?
|
|
5114
|
+
class: C(["flex size-8 items-center justify-center rounded-full transition-colors duration-150", Re.value ? K.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800 cursor-pointer" : "bg-theme-0 text-theme-950 hover:bg-theme-100 cursor-pointer" : K.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
|
|
5111
5115
|
disabled: !Re.value,
|
|
5112
5116
|
"aria-label": Be.value,
|
|
5113
5117
|
title: Be.value,
|
|
5114
5118
|
onClick: s[19] || (s[19] = (e) => handleComposerAction())
|
|
5115
|
-
}, [Le.value === "stop" ? (k(), h("i",
|
|
5116
|
-
])], 10,
|
|
5117
|
-
|
|
5119
|
+
}, [Le.value === "stop" ? (k(), h("i", Xi)) : (k(), h("i", Zi)), _("span", Qi, F(Be.value), 1)], 10, Yi))])
|
|
5120
|
+
])], 10, Ri),
|
|
5121
|
+
H.value.length === 0 && e.suggestedPrompts.length > 0 ? (k(), h("div", $i, [_("div", ea, [(k(!0), h(u, null, j(e.suggestedPrompts, (e, t) => ue((k(), h("button", {
|
|
5118
5122
|
key: e.id,
|
|
5119
5123
|
type: "button",
|
|
5120
5124
|
disabled: Ee.value,
|
|
5125
|
+
tabindex: z.value || t < 3 ? void 0 : -1,
|
|
5121
5126
|
"data-test": "messaging-suggested-prompt",
|
|
5122
|
-
class: C(["w-full rounded-2xl bg-theme-50 px-4 py-3 text-left text-[14.5px] font-medium transition-colors sm:w-auto sm:rounded-full sm:py-2 sm:text-center sm:text-[14px]",
|
|
5127
|
+
class: C(["w-full rounded-2xl bg-theme-50 px-4 py-3 text-left text-[14.5px] font-medium transition-colors sm:w-auto sm:rounded-full sm:py-2 sm:text-center sm:text-[14px]", Ee.value ? "cursor-not-allowed text-theme-300" : "cursor-pointer text-theme-600 hover:bg-theme-100 hover:text-theme-900"]),
|
|
5123
5128
|
onClick: (t) => sendSuggestedPrompt(e)
|
|
5124
|
-
}, F(e.label), 11,
|
|
5129
|
+
}, F(e.label), 11, ta)), [[se, z.value || t < 3]])), 128)), e.suggestedPrompts.length > 3 ? (k(), h("button", {
|
|
5125
5130
|
key: 0,
|
|
5126
5131
|
type: "button",
|
|
5127
5132
|
"data-test": "messaging-suggested-prompts-more",
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5133
|
+
"aria-expanded": z.value,
|
|
5134
|
+
class: C(["flex w-full cursor-pointer items-center gap-2 px-4 py-2.5 text-[13.5px] font-medium transition-colors sm:w-auto", z.value ? "text-theme-300 hover:text-theme-600" : "text-theme-400 hover:text-theme-900"]),
|
|
5135
|
+
onClick: s[20] || (s[20] = (e) => z.value = !z.value)
|
|
5136
|
+
}, [s[32] || (s[32] = _("i", { class: "i-tabler-dots size-4 shrink-0" }, null, -1)), v(" " + F(z.value ? "See less" : "See more"), 1)], 10, na)) : m("", !0)])])) : m("", !0)
|
|
5131
5137
|
], 2)
|
|
5132
5138
|
], 2));
|
|
5133
5139
|
}
|
|
5134
|
-
}),
|
|
5140
|
+
}), aa = { class: "agent-wrap" }, oa = {
|
|
5135
5141
|
key: 0,
|
|
5136
5142
|
class: "flex items-center justify-center h-full"
|
|
5137
|
-
},
|
|
5143
|
+
}, sa = {
|
|
5138
5144
|
key: 2,
|
|
5139
5145
|
class: "flex h-full flex-col items-center justify-center gap-4 px-6 text-center",
|
|
5140
5146
|
role: "status",
|
|
5141
5147
|
"aria-live": "polite",
|
|
5142
5148
|
"data-test": "agent-unavailable"
|
|
5143
|
-
},
|
|
5149
|
+
}, ca = /* @__PURE__ */ x({
|
|
5144
5150
|
__name: "AgentWrap",
|
|
5145
5151
|
props: {
|
|
5146
5152
|
sdk: {},
|
|
@@ -5236,7 +5242,7 @@ var Cr = [
|
|
|
5236
5242
|
});
|
|
5237
5243
|
}
|
|
5238
5244
|
}
|
|
5239
|
-
return ne(loadAgent), (t, n) => (k(), h("div",
|
|
5245
|
+
return ne(loadAgent), (t, n) => (k(), h("div", aa, [s.value ? (k(), h("div", oa, [_("div", { class: C(["size-6 animate-spin rounded-full border-b-2", i.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : c.value ? ie(t.$slots, "default", {
|
|
5240
5246
|
sdk: oe(o),
|
|
5241
5247
|
agent: c.value,
|
|
5242
5248
|
context: e.clientContext ?? e.context,
|
|
@@ -5244,7 +5250,7 @@ var Cr = [
|
|
|
5244
5250
|
buttonText: e.buttonText,
|
|
5245
5251
|
buttonIcon: e.buttonIcon,
|
|
5246
5252
|
loading: s.value
|
|
5247
|
-
}, void 0, void 0, 1) : u.value ? (k(), h("div",
|
|
5253
|
+
}, void 0, void 0, 1) : u.value ? (k(), h("div", sa, [n[0] || (n[0] = _("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), _("button", {
|
|
5248
5254
|
type: "button",
|
|
5249
5255
|
class: "min-h-11 rounded-full bg-theme-900 px-5 text-sm font-semibold text-theme-0 transition-colors hover:bg-theme-700",
|
|
5250
5256
|
"data-test": "agent-unavailable-retry",
|
|
@@ -5253,6 +5259,6 @@ var Cr = [
|
|
|
5253
5259
|
}
|
|
5254
5260
|
});
|
|
5255
5261
|
//#endregion
|
|
5256
|
-
export { Oe as a, getAgentAvatarUrl as c, AgentChatController as d,
|
|
5262
|
+
export { Oe as a, getAgentAvatarUrl as c, AgentChatController as d, ve as f, Pe as i, handleImageError as l, _e as m, ia as n, Ee as o, n as p, ei as r, we as s, ca as t, parseButtonTemplate as u };
|
|
5257
5263
|
|
|
5258
5264
|
//# sourceMappingURL=AgentWrap.js.map
|