@pagelines/sdk 1.0.657 → 1.0.658
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var us = Object.defineProperty;
|
|
2
2
|
var ma = (a, t, e) => t in a ? us(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
3
|
var d = (a, t) => us(a, "name", { value: t, configurable: !0 });
|
|
4
|
-
var
|
|
4
|
+
var P = (a, t, e) => ma(a, typeof t != "symbol" ? t + "" : t, e);
|
|
5
5
|
import { defineComponent as Re, openBlock as p, createElementBlock as f, createElementVNode as k, normalizeClass as M, ref as ge, computed as T, shallowRef as dt, watch as Jt, createCommentVNode as H, renderSlot as vn, onMounted as en, unref as Qt, Fragment as Q, toDisplayString as W, reactive as ga, onUnmounted as Ns, createBlock as bt, Teleport as va, createVNode as Fe, Transition as xa, withCtx as Ps, withDirectives as Bs, normalizeStyle as q, createTextVNode as rt, vShow as ba, nextTick as Fs, renderList as me, onBeforeUnmount as Us, withModifiers as Me, vModelText as ya, withKeys as Ht } from "vue";
|
|
6
6
|
import { SettingsObject as Hs, Agent as hn, CHAT_ISSUE_COPY as ka, getDefaultAvatarUrl as Fn, parseChatVisualFencePayload as wa, createLogger as Ta } from "@pagelines/core";
|
|
7
7
|
import { P as Sa } from "./sdkClient.js";
|
|
@@ -47,19 +47,19 @@ d(Ca, "recorderMimeType");
|
|
|
47
47
|
const Xn = class Xn extends Hs {
|
|
48
48
|
constructor(e) {
|
|
49
49
|
super("VoiceRecorderController", e);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
P(this, "state", ge({ phase: "idle", elapsedMs: 0 }));
|
|
51
|
+
P(this, "isActive", T(() => this.state.value.phase !== "idle"));
|
|
52
|
+
P(this, "isBusy", T(() => this.state.value.phase !== "idle"));
|
|
53
|
+
P(this, "elapsedLabel", T(() => _a({ ms: this.state.value.elapsedMs })));
|
|
54
|
+
P(this, "statusText", T(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send"));
|
|
55
|
+
P(this, "recorder");
|
|
56
|
+
P(this, "stream");
|
|
57
|
+
P(this, "chunks", []);
|
|
58
|
+
P(this, "timer");
|
|
59
|
+
P(this, "startedAt", 0);
|
|
60
|
+
P(this, "cancelOnStop", !1);
|
|
61
|
+
P(this, "stopAfterStart", !1);
|
|
62
|
+
P(this, "startToken", 0);
|
|
63
63
|
}
|
|
64
64
|
get canUseBrowserRecording() {
|
|
65
65
|
return !!this.settings.getUserMedia || typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia && typeof MediaRecorder < "u";
|
|
@@ -222,11 +222,11 @@ function zn(a) {
|
|
|
222
222
|
if (e === "failed") {
|
|
223
223
|
const O = t.filter((G) => G.status === "failed").sort(On).pop(), D = /* @__PURE__ */ new Set();
|
|
224
224
|
O && D.add(O.activityId);
|
|
225
|
-
const { visibleRows: j, hiddenRows:
|
|
225
|
+
const { visibleRows: j, hiddenRows: B } = dn(Yt(t, D));
|
|
226
226
|
return {
|
|
227
227
|
outcome: e,
|
|
228
228
|
visibleRows: j,
|
|
229
|
-
hiddenRows:
|
|
229
|
+
hiddenRows: B,
|
|
230
230
|
terminal: {
|
|
231
231
|
id: "work-failed",
|
|
232
232
|
tone: "failed",
|
|
@@ -247,10 +247,10 @@ function zn(a) {
|
|
|
247
247
|
const { visibleRows: c, hiddenRows: h } = dn(Yt(t, /* @__PURE__ */ new Set())), u = t.filter((O) => O.status === "started").sort(On).pop(), g = t.reduce(
|
|
248
248
|
(O, D) => Math.max(O, Lt(D)),
|
|
249
249
|
s ?? Number.NEGATIVE_INFINITY
|
|
250
|
-
),
|
|
250
|
+
), S = Number.isFinite(g) ? g : n, b = t.reduce((O, D) => {
|
|
251
251
|
const j = pn(D.startedAt) ?? pn(D.endedAt);
|
|
252
252
|
return j === void 0 ? O : Math.min(O, j);
|
|
253
|
-
}, Number.POSITIVE_INFINITY), w =
|
|
253
|
+
}, Number.POSITIVE_INFINITY), w = S + js, $ = (Number.isFinite(b) ? b : S) + Ia, E = n >= w, N = u || E ? {
|
|
254
254
|
id: u?.activityId ?? "work-active",
|
|
255
255
|
tone: "active",
|
|
256
256
|
label: E ? u ? vt.waiting : vt.finishing : u.label
|
|
@@ -259,7 +259,7 @@ function zn(a) {
|
|
|
259
259
|
outcome: e,
|
|
260
260
|
visibleRows: c,
|
|
261
261
|
hiddenRows: h,
|
|
262
|
-
...
|
|
262
|
+
...N ? { terminal: N } : {},
|
|
263
263
|
...ee ? { hint: ee } : {},
|
|
264
264
|
...R !== void 0 ? { nextBoundaryAtMs: R } : {}
|
|
265
265
|
};
|
|
@@ -274,25 +274,26 @@ function $a(a) {
|
|
|
274
274
|
...s !== void 0 ? { lastVisibleProgressAtMs: s } : {}
|
|
275
275
|
}), "liveModel");
|
|
276
276
|
if (t.length === 0)
|
|
277
|
-
return e.length === 0 ? [] : [{ kind: "work", journal: c(e) }];
|
|
277
|
+
return e.length === 0 ? [] : [{ kind: "work", id: "work-unsegmented", journal: c(e) }];
|
|
278
278
|
const h = [], u = t.length - 1;
|
|
279
|
-
if (t.forEach((g,
|
|
279
|
+
if (t.forEach((g, S) => {
|
|
280
280
|
if (g.kind === "text") {
|
|
281
|
-
g.content && h.push({ kind: "text", content: g.content });
|
|
281
|
+
g.content && h.push({ kind: "text", id: `text-${S}`, content: g.content });
|
|
282
282
|
return;
|
|
283
283
|
}
|
|
284
|
-
const b = g.activityIds.map((
|
|
284
|
+
const b = g.activityIds.map((N) => l.get(N)).filter((N) => N !== void 0);
|
|
285
285
|
if (b.length === 0)
|
|
286
286
|
return;
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
const w = `work-${g.activityIds[0] ?? S}`;
|
|
288
|
+
if (S === u) {
|
|
289
|
+
h.push({ kind: "work", id: w, journal: c(b) });
|
|
289
290
|
return;
|
|
290
291
|
}
|
|
291
|
-
const { visibleRows:
|
|
292
|
-
|
|
292
|
+
const { visibleRows: $, hiddenRows: E } = dn(Yt(b, /* @__PURE__ */ new Set()));
|
|
293
|
+
$.length === 0 && E.length === 0 || h.push({ kind: "work", id: w, journal: { outcome: "running", visibleRows: $, hiddenRows: E } });
|
|
293
294
|
}), t[u]?.kind === "text") {
|
|
294
295
|
const g = c([]);
|
|
295
|
-
(g.terminal || g.hint) && h.push({ kind: "work", journal: g });
|
|
296
|
+
(g.terminal || g.hint) && h.push({ kind: "work", id: "work-tail", journal: g });
|
|
296
297
|
}
|
|
297
298
|
return h;
|
|
298
299
|
}
|
|
@@ -323,33 +324,33 @@ d(Na, "transcriptMessageForChatStreamError");
|
|
|
323
324
|
const Zn = class Zn extends Hs {
|
|
324
325
|
constructor(e) {
|
|
325
326
|
super("AgentChatController", e);
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
327
|
+
P(this, "isTextMode", !1);
|
|
328
|
+
P(this, "lastMessage", { hash: "", time: 0 });
|
|
329
|
+
P(this, "isConnecting", !1);
|
|
330
|
+
P(this, "activeTurnGeneration", 0);
|
|
330
331
|
// One projection clock, advanced only when a scheduled boundary fires — never
|
|
331
332
|
// a ticking counter. buildWorkJournalModel reads this to decide the slow/long
|
|
332
333
|
// transitions; it never creates a row (plans/bots/bot-tool-calling.md).
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
334
|
+
P(this, "boundaryTimer");
|
|
335
|
+
P(this, "nowMs", dt(Date.now()));
|
|
336
|
+
P(this, "toolActivityTiming", dt({}));
|
|
337
|
+
P(this, "lastVisibleProgressAtMs", dt());
|
|
337
338
|
// Arrival-ordered slices of the live turn (mockup 28c): work groups and the
|
|
338
339
|
// text each group produced. The projection interleaves them; the view
|
|
339
340
|
// renders blocks at the live anchor and hides the raw streaming bubble.
|
|
340
|
-
|
|
341
|
-
|
|
341
|
+
P(this, "liveSegments", dt([]));
|
|
342
|
+
P(this, "liveStreamMessageId", dt(void 0));
|
|
342
343
|
// Chat conversation tracking (server-managed persistence)
|
|
343
|
-
|
|
344
|
-
|
|
344
|
+
P(this, "conversationId");
|
|
345
|
+
P(this, "textState", ge({
|
|
345
346
|
isActive: !1,
|
|
346
347
|
isConnected: !1,
|
|
347
348
|
isThinking: !1,
|
|
348
349
|
connectionStatus: "disconnected"
|
|
349
350
|
}));
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
351
|
+
P(this, "agentMode", ge("self"));
|
|
352
|
+
P(this, "sharedMessages", ge([]));
|
|
353
|
+
P(this, "composerState", ge({
|
|
353
354
|
text: "",
|
|
354
355
|
pendingAttachments: [],
|
|
355
356
|
isUploading: !1
|
|
@@ -360,7 +361,7 @@ const Zn = class Zn extends Hs {
|
|
|
360
361
|
* the two are mutually exclusive). Transient live work is always `running`;
|
|
361
362
|
* Task 7 owns `stopped`.
|
|
362
363
|
*/
|
|
363
|
-
|
|
364
|
+
P(this, "workJournal", T(() => {
|
|
364
365
|
const e = this.textState.value.isThinking ? "running" : this.textState.value.turnOutcome;
|
|
365
366
|
if (!e)
|
|
366
367
|
return;
|
|
@@ -379,7 +380,7 @@ const Zn = class Zn extends Hs {
|
|
|
379
380
|
* running. Terminal outcomes (stopped / failed live) keep the single
|
|
380
381
|
* journal from `workJournal`; the canonical row owns completed endings.
|
|
381
382
|
*/
|
|
382
|
-
|
|
383
|
+
P(this, "liveTurnBlocks", T(() => {
|
|
383
384
|
if (!this.textState.value.isThinking)
|
|
384
385
|
return [];
|
|
385
386
|
const e = this.textState.value.toolActivities ?? [], n = this.liveSegments.value;
|
|
@@ -391,10 +392,10 @@ const Zn = class Zn extends Hs {
|
|
|
391
392
|
lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
|
|
392
393
|
});
|
|
393
394
|
}));
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
395
|
+
P(this, "canUseComposer", T(() => this.textState.value.isConnected && !this.textState.value.sendBlockedReason && !this.composerState.value.isUploading && !this.textState.value.isThinking));
|
|
396
|
+
P(this, "canAttachFile", T(() => !!this.settings.uploadFileFn));
|
|
397
|
+
P(this, "canRecordAudio", T(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0));
|
|
398
|
+
P(this, "voiceRecorder", new Ln({
|
|
398
399
|
getCanRecord: /* @__PURE__ */ d(() => this.canRecordAudio.value, "getCanRecord"),
|
|
399
400
|
getUploadFn: /* @__PURE__ */ d(() => {
|
|
400
401
|
const e = this.settings.uploadFileFn;
|
|
@@ -402,10 +403,10 @@ const Zn = class Zn extends Hs {
|
|
|
402
403
|
}, "getUploadFn"),
|
|
403
404
|
getChatController: /* @__PURE__ */ d(() => this, "getChatController")
|
|
404
405
|
}));
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
406
|
+
P(this, "canSend", T(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value));
|
|
407
|
+
P(this, "canStop", T(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value));
|
|
408
|
+
P(this, "composerAction", T(() => this.canStop.value ? "stop" : this.canSend.value ? "send" : "idle"));
|
|
409
|
+
P(this, "_agent");
|
|
409
410
|
this._agent = e.agent instanceof hn ? e.agent : new hn({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher(), this.setupBoundaryWatcher();
|
|
410
411
|
}
|
|
411
412
|
get chatEnabled() {
|
|
@@ -695,7 +696,7 @@ Current User:
|
|
|
695
696
|
this.addMessage(e, "user", n), this.resetWorkJournalTiming(), this.updateState(this.textState, { isThinking: !0, workingDescription: void 0, toolActivities: [], transientIssue: void 0, turnOutcome: void 0 });
|
|
696
697
|
const l = ++this.activeTurnGeneration, c = `stream-${Date.now()}`;
|
|
697
698
|
let h = !1, u = !1;
|
|
698
|
-
const g = /* @__PURE__ */ d(() => l === this.activeTurnGeneration, "isCurrentTurn"),
|
|
699
|
+
const g = /* @__PURE__ */ d(() => l === this.activeTurnGeneration, "isCurrentTurn"), S = /* @__PURE__ */ d((R, O = "assistant") => {
|
|
699
700
|
if (!g())
|
|
700
701
|
return;
|
|
701
702
|
this.updateState(this.textState, { workingDescription: void 0 }), O === "assistant" && (this.lastVisibleProgressAtMs.value = Date.now()), h || (h = !0, this.liveStreamMessageId.value = c, this.sharedMessages.value = [
|
|
@@ -704,8 +705,8 @@ Current User:
|
|
|
704
705
|
]);
|
|
705
706
|
const D = this.liveSegments.value, j = D[D.length - 1];
|
|
706
707
|
this.liveSegments.value = j?.kind === "text" ? [...D.slice(0, -1), { kind: "text", content: j.content + R }] : [...D, { kind: "text", content: R }];
|
|
707
|
-
const
|
|
708
|
-
G?.id === c && (G.text += R, this.sharedMessages.value = [...
|
|
708
|
+
const B = this.sharedMessages.value, G = B[B.length - 1];
|
|
709
|
+
G?.id === c && (G.text += R, this.sharedMessages.value = [...B]);
|
|
709
710
|
}, "onDelta"), b = /* @__PURE__ */ d((R) => {
|
|
710
711
|
if (!g())
|
|
711
712
|
return;
|
|
@@ -718,16 +719,16 @@ Current User:
|
|
|
718
719
|
toolActivities: [],
|
|
719
720
|
turnOutcome: void 0
|
|
720
721
|
});
|
|
721
|
-
const
|
|
722
|
+
const B = this.sharedMessages.value, G = B.findIndex((se) => se.id === j.id);
|
|
722
723
|
if (G >= 0)
|
|
723
724
|
this.sharedMessages.value = [
|
|
724
|
-
...
|
|
725
|
+
...B.slice(0, G),
|
|
725
726
|
j,
|
|
726
|
-
...
|
|
727
|
+
...B.slice(G + 1)
|
|
727
728
|
];
|
|
728
729
|
else {
|
|
729
|
-
const se =
|
|
730
|
-
this.sharedMessages.value = se?.id === c ? [...
|
|
730
|
+
const se = B[B.length - 1];
|
|
731
|
+
this.sharedMessages.value = se?.id === c ? [...B.slice(0, -1), j] : [...B, j];
|
|
731
732
|
}
|
|
732
733
|
j.sender === "system" && j.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : j.sender === "system" && j.issue?.code && Gs.has(j.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
|
|
733
734
|
}, "onMessage"), w = /* @__PURE__ */ d((R) => {
|
|
@@ -741,8 +742,8 @@ Current User:
|
|
|
741
742
|
const O = this.sharedMessages.value, D = O[O.length - 1];
|
|
742
743
|
if (D?.id === c && D.sender === "agent" && D.text) {
|
|
743
744
|
let j = D.text;
|
|
744
|
-
for (const
|
|
745
|
-
|
|
745
|
+
for (const B of Da)
|
|
746
|
+
B.pattern.test(j) && (console.debug(`[chat] filtered directive: ${B.label}`), j = j.replace(B.pattern, "").trim(), B.pattern.lastIndex = 0);
|
|
746
747
|
j ? j !== D.text && (D.text = j, this.sharedMessages.value = [...O]) : this.sharedMessages.value = O.slice(0, -1);
|
|
747
748
|
}
|
|
748
749
|
R && (this.conversationId = R), this.updateState(this.textState, { isThinking: !1, workingDescription: void 0, transientIssue: void 0 });
|
|
@@ -776,14 +777,14 @@ Current User:
|
|
|
776
777
|
})) : this.handleError(new Error(R.error));
|
|
777
778
|
return;
|
|
778
779
|
}
|
|
779
|
-
const j = typeof R == "string" ? R : R.error,
|
|
780
|
-
this.isTransientError(j) ? (this.logger.warn("Chat turn failed (transient):", { raw: j, friendly:
|
|
780
|
+
const j = typeof R == "string" ? R : R.error, B = this.mapChatError(j);
|
|
781
|
+
this.isTransientError(j) ? (this.logger.warn("Chat turn failed (transient):", { raw: j, friendly: B }), this.addMessage(B, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(B), j);
|
|
781
782
|
}, "onError"), E = /* @__PURE__ */ d((R) => {
|
|
782
783
|
if (!g())
|
|
783
784
|
return;
|
|
784
785
|
const O = R.trim();
|
|
785
786
|
this.updateState(this.textState, { workingDescription: O || void 0 });
|
|
786
|
-
}, "onStatus"),
|
|
787
|
+
}, "onStatus"), N = /* @__PURE__ */ d((R) => {
|
|
787
788
|
if (g()) {
|
|
788
789
|
if (this.lastVisibleProgressAtMs.value = Date.now(), R.status === "started") {
|
|
789
790
|
const O = this.liveSegments.value, D = O[O.length - 1];
|
|
@@ -800,12 +801,12 @@ Current User:
|
|
|
800
801
|
attachments: n,
|
|
801
802
|
conversationId: this.conversationId,
|
|
802
803
|
history: this.buildHistory(),
|
|
803
|
-
onDelta:
|
|
804
|
+
onDelta: S,
|
|
804
805
|
onMessage: b,
|
|
805
806
|
onDone: w,
|
|
806
807
|
onError: $,
|
|
807
808
|
onStatus: E,
|
|
808
|
-
onToolActivity:
|
|
809
|
+
onToolActivity: N,
|
|
809
810
|
onWorkingEnd: ee
|
|
810
811
|
}) : s.chat.chatStreamPublic({
|
|
811
812
|
handle: this._agent.handle.value,
|
|
@@ -813,12 +814,12 @@ Current User:
|
|
|
813
814
|
attachments: n,
|
|
814
815
|
anonymousId: s.user.generateAnonId(),
|
|
815
816
|
context: this.getDynamicSettings().context || void 0,
|
|
816
|
-
onDelta:
|
|
817
|
+
onDelta: S,
|
|
817
818
|
onMessage: b,
|
|
818
819
|
onDone: w,
|
|
819
820
|
onError: $,
|
|
820
821
|
onStatus: E,
|
|
821
|
-
onToolActivity:
|
|
822
|
+
onToolActivity: N,
|
|
822
823
|
onWorkingEnd: ee
|
|
823
824
|
}));
|
|
824
825
|
} catch (R) {
|
|
@@ -1077,23 +1078,23 @@ const Pa = {
|
|
|
1077
1078
|
function h() {
|
|
1078
1079
|
if (!t.value || !e.value)
|
|
1079
1080
|
return;
|
|
1080
|
-
const E = t.value.getBoundingClientRect(),
|
|
1081
|
+
const E = t.value.getBoundingClientRect(), N = e.value.getBoundingClientRect(), ee = 8;
|
|
1081
1082
|
let R, O;
|
|
1082
1083
|
switch (a.direction) {
|
|
1083
1084
|
case "bottom":
|
|
1084
|
-
R = E.left + window.scrollX + E.width / 2 -
|
|
1085
|
+
R = E.left + window.scrollX + E.width / 2 - N.width / 2, O = E.bottom + window.scrollY + ee;
|
|
1085
1086
|
break;
|
|
1086
1087
|
case "top":
|
|
1087
|
-
R = E.left + window.scrollX + E.width / 2 -
|
|
1088
|
+
R = E.left + window.scrollX + E.width / 2 - N.width / 2, O = E.top + window.scrollY - N.height - ee;
|
|
1088
1089
|
break;
|
|
1089
1090
|
case "left":
|
|
1090
|
-
R = E.left + window.scrollX -
|
|
1091
|
+
R = E.left + window.scrollX - N.width - ee, O = E.top + window.scrollY + E.height / 2 - N.height / 2;
|
|
1091
1092
|
break;
|
|
1092
1093
|
default:
|
|
1093
|
-
R = E.right + window.scrollX + ee, O = E.top + window.scrollY + E.height / 2 -
|
|
1094
|
+
R = E.right + window.scrollX + ee, O = E.top + window.scrollY + E.height / 2 - N.height / 2;
|
|
1094
1095
|
}
|
|
1095
1096
|
const D = 8;
|
|
1096
|
-
R = Math.max(D, Math.min(R, window.innerWidth -
|
|
1097
|
+
R = Math.max(D, Math.min(R, window.innerWidth - N.width - D)), O = Math.max(D, Math.min(O, window.innerHeight - N.height - D)), l.left = `${R}px`, l.top = `${O}px`;
|
|
1097
1098
|
}
|
|
1098
1099
|
d(h, "updatePosition");
|
|
1099
1100
|
function u() {
|
|
@@ -1106,16 +1107,16 @@ const Pa = {
|
|
|
1106
1107
|
a.disabled || (s.value && (clearTimeout(s.value), s.value = null), i.value = setTimeout(u, a.delay));
|
|
1107
1108
|
}
|
|
1108
1109
|
d(g, "onMouseEnter");
|
|
1109
|
-
function
|
|
1110
|
+
function S() {
|
|
1110
1111
|
i.value && (clearTimeout(i.value), i.value = null), s.value && (clearTimeout(s.value), s.value = null), t.value?.dataset.originalTitle && (t.value.setAttribute("title", t.value.dataset.originalTitle), delete t.value.dataset.originalTitle), n.value = !1;
|
|
1111
1112
|
}
|
|
1112
|
-
d(
|
|
1113
|
+
d(S, "onMouseLeave");
|
|
1113
1114
|
function b() {
|
|
1114
1115
|
a.disabled || (i.value && (clearTimeout(i.value), i.value = null), u());
|
|
1115
1116
|
}
|
|
1116
1117
|
d(b, "onFocusIn");
|
|
1117
1118
|
function w() {
|
|
1118
|
-
|
|
1119
|
+
S();
|
|
1119
1120
|
}
|
|
1120
1121
|
d(w, "onFocusOut"), en(() => {
|
|
1121
1122
|
window.addEventListener("resize", h), window.addEventListener("scroll", h, !0);
|
|
@@ -1128,11 +1129,11 @@ const Pa = {
|
|
|
1128
1129
|
left: "right-[-4px] top-1/2 -translate-y-1/2",
|
|
1129
1130
|
right: "left-[-4px] top-1/2 -translate-y-1/2"
|
|
1130
1131
|
}[a.direction]}`);
|
|
1131
|
-
return (E,
|
|
1132
|
+
return (E, N) => (p(), f("div", {
|
|
1132
1133
|
ref_key: "triggerRef",
|
|
1133
1134
|
ref: t,
|
|
1134
1135
|
onMouseenter: g,
|
|
1135
|
-
onMouseleave:
|
|
1136
|
+
onMouseleave: S,
|
|
1136
1137
|
onFocusin: b,
|
|
1137
1138
|
onFocusout: w
|
|
1138
1139
|
}, [
|
|
@@ -1334,7 +1335,7 @@ const Pa = {
|
|
|
1334
1335
|
function u(g) {
|
|
1335
1336
|
return g === "active" ? t.isLight ? "text-[13px] font-medium text-theme-900" : "text-[13px] font-medium text-white" : g === "failed" ? "text-[12.5px] font-medium text-red-600" : g === "stopped" ? t.isLight ? "text-[13px] font-medium text-theme-600" : "text-[13px] font-medium text-white/70" : t.isLight ? "text-[12.5px] text-theme-500" : "text-[12.5px] text-white/55";
|
|
1336
1337
|
}
|
|
1337
|
-
return d(u, "labelClass"), (g,
|
|
1338
|
+
return d(u, "labelClass"), (g, S) => (p(), f("div", {
|
|
1338
1339
|
class: M(["w-full py-0.5", h.value.muted])
|
|
1339
1340
|
}, [
|
|
1340
1341
|
l.value ? (p(), f("span", ei, W(l.value), 1)) : H("", !0),
|
|
@@ -1348,7 +1349,7 @@ const Pa = {
|
|
|
1348
1349
|
class: M(["grid min-h-11 w-full grid-cols-[1.25rem_minmax(0,1fr)_auto] items-center gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-default", h.value.ring]),
|
|
1349
1350
|
onClick: n
|
|
1350
1351
|
}, [
|
|
1351
|
-
|
|
1352
|
+
S[0] || (S[0] = k("span", {
|
|
1352
1353
|
class: "grid size-5 shrink-0 place-items-center",
|
|
1353
1354
|
"data-journal-station": "completed",
|
|
1354
1355
|
"aria-hidden": "true"
|
|
@@ -1675,12 +1676,12 @@ function Ks() {
|
|
|
1675
1676
|
a.DocumentFragment;
|
|
1676
1677
|
const s = a.HTMLTemplateElement, l = a.Node, c = a.Element, h = a.NodeFilter, u = a.NamedNodeMap;
|
|
1677
1678
|
u === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
|
|
1678
|
-
const g = a.DOMParser,
|
|
1679
|
+
const g = a.DOMParser, S = a.trustedTypes, b = c.prototype, w = nt(b, "cloneNode"), $ = nt(b, "remove"), E = nt(b, "nextSibling"), N = nt(b, "childNodes"), ee = nt(b, "parentNode"), R = nt(b, "shadowRoot"), O = nt(b, "attributes"), D = l && l.prototype ? nt(l.prototype, "nodeType") : null, j = l && l.prototype ? nt(l.prototype, "nodeName") : null;
|
|
1679
1680
|
if (typeof s == "function") {
|
|
1680
1681
|
const F = e.createElement("template");
|
|
1681
1682
|
F.content && F.content.ownerDocument && (e = F.content.ownerDocument);
|
|
1682
1683
|
}
|
|
1683
|
-
let
|
|
1684
|
+
let B, G = "";
|
|
1684
1685
|
const se = e, ue = se.implementation, Se = se.createNodeIterator, ze = se.createDocumentFragment, Ie = se.getElementsByTagName, He = n.importNode;
|
|
1685
1686
|
let ce = _s();
|
|
1686
1687
|
t.isSupported = typeof Vs == "function" && typeof ee == "function" && ue && ue.createHTMLDocument !== void 0;
|
|
@@ -1723,12 +1724,12 @@ function Ks() {
|
|
|
1723
1724
|
value: null
|
|
1724
1725
|
}
|
|
1725
1726
|
}));
|
|
1726
|
-
let v = !0,
|
|
1727
|
+
let v = !0, A = !0, o = !1, I = !0, C = !1, L = !0, J = !1, pe = !1, be = !1, le = !1, de = !1, Ce = !1, Ne = !0, Oe = !1;
|
|
1727
1728
|
const Je = "user-content-";
|
|
1728
1729
|
let Pe = !0, _ = !1, m = {}, y = null;
|
|
1729
1730
|
const te = V({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
1730
1731
|
let U = null;
|
|
1731
|
-
const
|
|
1732
|
+
const ie = V({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
1732
1733
|
let Ge = null;
|
|
1733
1734
|
const Tt = V({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), nn = "http://www.w3.org/1998/Math/MathML", sn = "http://www.w3.org/2000/svg", Qe = "http://www.w3.org/1999/xhtml";
|
|
1734
1735
|
let St = Qe, yn = !1, kn = null;
|
|
@@ -1745,16 +1746,16 @@ function Ks() {
|
|
|
1745
1746
|
if (At && At === r)
|
|
1746
1747
|
return;
|
|
1747
1748
|
(!r || typeof r != "object") && (r = {}), r = we(r), Ft = // eslint-disable-next-line unicorn/prefer-includes
|
|
1748
|
-
ua.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? da : r.PARSER_MEDIA_TYPE, fe = Ft === "application/xhtml+xml" ? Rn : Xt, K = he(r, "ALLOWED_TAGS") && Ee(r.ALLOWED_TAGS) ? V({}, r.ALLOWED_TAGS, fe) : We, Z = he(r, "ALLOWED_ATTR") && Ee(r.ALLOWED_ATTR) ? V({}, r.ALLOWED_ATTR, fe) : ot, kn = he(r, "ALLOWED_NAMESPACES") && Ee(r.ALLOWED_NAMESPACES) ? V({}, r.ALLOWED_NAMESPACES, Rn) : oa, Ge = he(r, "ADD_URI_SAFE_ATTR") && Ee(r.ADD_URI_SAFE_ATTR) ? V(we(Tt), r.ADD_URI_SAFE_ATTR, fe) : Tt, U = he(r, "ADD_DATA_URI_TAGS") && Ee(r.ADD_DATA_URI_TAGS) ? V(we(
|
|
1749
|
+
ua.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? da : r.PARSER_MEDIA_TYPE, fe = Ft === "application/xhtml+xml" ? Rn : Xt, K = he(r, "ALLOWED_TAGS") && Ee(r.ALLOWED_TAGS) ? V({}, r.ALLOWED_TAGS, fe) : We, Z = he(r, "ALLOWED_ATTR") && Ee(r.ALLOWED_ATTR) ? V({}, r.ALLOWED_ATTR, fe) : ot, kn = he(r, "ALLOWED_NAMESPACES") && Ee(r.ALLOWED_NAMESPACES) ? V({}, r.ALLOWED_NAMESPACES, Rn) : oa, Ge = he(r, "ADD_URI_SAFE_ATTR") && Ee(r.ADD_URI_SAFE_ATTR) ? V(we(Tt), r.ADD_URI_SAFE_ATTR, fe) : Tt, U = he(r, "ADD_DATA_URI_TAGS") && Ee(r.ADD_DATA_URI_TAGS) ? V(we(ie), r.ADD_DATA_URI_TAGS, fe) : ie, y = he(r, "FORBID_CONTENTS") && Ee(r.FORBID_CONTENTS) ? V({}, r.FORBID_CONTENTS, fe) : te, Ze = he(r, "FORBID_TAGS") && Ee(r.FORBID_TAGS) ? V({}, r.FORBID_TAGS, fe) : we({}), De = he(r, "FORBID_ATTR") && Ee(r.FORBID_ATTR) ? V({}, r.FORBID_ATTR, fe) : we({}), m = he(r, "USE_PROFILES") ? r.USE_PROFILES && typeof r.USE_PROFILES == "object" ? we(r.USE_PROFILES) : r.USE_PROFILES : !1, v = r.ALLOW_ARIA_ATTR !== !1, A = r.ALLOW_DATA_ATTR !== !1, o = r.ALLOW_UNKNOWN_PROTOCOLS || !1, I = r.ALLOW_SELF_CLOSE_IN_ATTR !== !1, C = r.SAFE_FOR_TEMPLATES || !1, L = r.SAFE_FOR_XML !== !1, J = r.WHOLE_DOCUMENT || !1, le = r.RETURN_DOM || !1, de = r.RETURN_DOM_FRAGMENT || !1, Ce = r.RETURN_TRUSTED_TYPE || !1, be = r.FORCE_BODY || !1, Ne = r.SANITIZE_DOM !== !1, Oe = r.SANITIZE_NAMED_PROPS || !1, Pe = r.KEEP_CONTENT !== !1, _ = r.IN_PLACE || !1, Xe = Si(r.ALLOWED_URI_REGEXP) ? r.ALLOWED_URI_REGEXP : Es, St = typeof r.NAMESPACE == "string" ? r.NAMESPACE : Qe, wn = he(r, "MATHML_TEXT_INTEGRATION_POINTS") && r.MATHML_TEXT_INTEGRATION_POINTS && typeof r.MATHML_TEXT_INTEGRATION_POINTS == "object" ? we(r.MATHML_TEXT_INTEGRATION_POINTS) : V({}, ["mi", "mo", "mn", "ms", "mtext"]), Tn = he(r, "HTML_INTEGRATION_POINTS") && r.HTML_INTEGRATION_POINTS && typeof r.HTML_INTEGRATION_POINTS == "object" ? we(r.HTML_INTEGRATION_POINTS) : V({}, ["annotation-xml"]);
|
|
1749
1750
|
const x = he(r, "CUSTOM_ELEMENT_HANDLING") && r.CUSTOM_ELEMENT_HANDLING && typeof r.CUSTOM_ELEMENT_HANDLING == "object" ? we(r.CUSTOM_ELEMENT_HANDLING) : Dt(null);
|
|
1750
|
-
if (re = Dt(null), he(x, "tagNameCheck") && Jn(x.tagNameCheck) && (re.tagNameCheck = x.tagNameCheck), he(x, "attributeNameCheck") && Jn(x.attributeNameCheck) && (re.attributeNameCheck = x.attributeNameCheck), he(x, "allowCustomizedBuiltInElements") && typeof x.allowCustomizedBuiltInElements == "boolean" && (re.allowCustomizedBuiltInElements = x.allowCustomizedBuiltInElements), C && (
|
|
1751
|
+
if (re = Dt(null), he(x, "tagNameCheck") && Jn(x.tagNameCheck) && (re.tagNameCheck = x.tagNameCheck), he(x, "attributeNameCheck") && Jn(x.attributeNameCheck) && (re.attributeNameCheck = x.attributeNameCheck), he(x, "allowCustomizedBuiltInElements") && typeof x.allowCustomizedBuiltInElements == "boolean" && (re.allowCustomizedBuiltInElements = x.allowCustomizedBuiltInElements), C && (A = !1), de && (le = !0), m && (K = V({}, Ts), Z = Dt(null), m.html === !0 && (V(K, ws), V(Z, Ss)), m.svg === !0 && (V(K, Cn), V(Z, $n), V(Z, cn)), m.svgFilters === !0 && (V(K, Mn), V(Z, $n), V(Z, cn)), m.mathMl === !0 && (V(K, In), V(Z, As), V(Z, cn))), Le.tagCheck = null, Le.attributeCheck = null, he(r, "ADD_TAGS") && (typeof r.ADD_TAGS == "function" ? Le.tagCheck = r.ADD_TAGS : Ee(r.ADD_TAGS) && (K === We && (K = we(K)), V(K, r.ADD_TAGS, fe))), he(r, "ADD_ATTR") && (typeof r.ADD_ATTR == "function" ? Le.attributeCheck = r.ADD_ATTR : Ee(r.ADD_ATTR) && (Z === ot && (Z = we(Z)), V(Z, r.ADD_ATTR, fe))), he(r, "ADD_URI_SAFE_ATTR") && Ee(r.ADD_URI_SAFE_ATTR) && V(Ge, r.ADD_URI_SAFE_ATTR, fe), he(r, "FORBID_CONTENTS") && Ee(r.FORBID_CONTENTS) && (y === te && (y = we(y)), V(y, r.FORBID_CONTENTS, fe)), he(r, "ADD_FORBID_CONTENTS") && Ee(r.ADD_FORBID_CONTENTS) && (y === te && (y = we(y)), V(y, r.ADD_FORBID_CONTENTS, fe)), Pe && (K["#text"] = !0), J && V(K, ["html", "head", "body"]), K.table && (V(K, ["tbody"]), delete Ze.tbody), r.TRUSTED_TYPES_POLICY) {
|
|
1751
1752
|
if (typeof r.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
1752
1753
|
throw Wt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
1753
1754
|
if (typeof r.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
1754
1755
|
throw Wt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
1755
|
-
|
|
1756
|
+
B = r.TRUSTED_TYPES_POLICY, G = B.createHTML("");
|
|
1756
1757
|
} else
|
|
1757
|
-
|
|
1758
|
+
B === void 0 && (B = Ni(S, i)), B !== null && typeof G == "string" && (G = B.createHTML(""));
|
|
1758
1759
|
(ce.uponSanitizeElement.length > 0 || ce.uponSanitizeAttribute.length > 0) && K === We && (K = we(K)), ce.uponSanitizeAttribute.length > 0 && Z === ot && (Z = we(Z)), _e && _e(r), At = r;
|
|
1759
1760
|
}, "_parseConfig"), Qn = V({}, [...Cn, ...Mn, ...Ai]), es = V({}, [...In, ...Ei]), pa = /* @__PURE__ */ d(function(r) {
|
|
1760
1761
|
let x = ee(r);
|
|
@@ -1762,8 +1763,8 @@ function Ks() {
|
|
|
1762
1763
|
namespaceURI: St,
|
|
1763
1764
|
tagName: "template"
|
|
1764
1765
|
});
|
|
1765
|
-
const z = Xt(r.tagName),
|
|
1766
|
-
return kn[r.namespaceURI] ? r.namespaceURI === sn ? x.namespaceURI === Qe ? z === "svg" : x.namespaceURI === nn ? z === "svg" && (
|
|
1766
|
+
const z = Xt(r.tagName), ae = Xt(x.tagName);
|
|
1767
|
+
return kn[r.namespaceURI] ? r.namespaceURI === sn ? x.namespaceURI === Qe ? z === "svg" : x.namespaceURI === nn ? z === "svg" && (ae === "annotation-xml" || wn[ae]) : !!Qn[z] : r.namespaceURI === nn ? x.namespaceURI === Qe ? z === "math" : x.namespaceURI === sn ? z === "math" && Tn[ae] : !!es[z] : r.namespaceURI === Qe ? x.namespaceURI === sn && !Tn[ae] || x.namespaceURI === nn && !wn[ae] ? !1 : !es[z] && (ca[z] || !Qn[z]) : !!(Ft === "application/xhtml+xml" && kn[r.namespaceURI]) : !1;
|
|
1767
1768
|
}, "_checkValidNamespace"), Ve = /* @__PURE__ */ d(function(r) {
|
|
1768
1769
|
Rt(t.removed, {
|
|
1769
1770
|
element: r
|
|
@@ -1805,16 +1806,16 @@ function Ks() {
|
|
|
1805
1806
|
z = oe && oe[0];
|
|
1806
1807
|
}
|
|
1807
1808
|
Ft === "application/xhtml+xml" && St === Qe && (r = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + r + "</body></html>");
|
|
1808
|
-
const
|
|
1809
|
+
const ae = B ? B.createHTML(r) : r;
|
|
1809
1810
|
if (St === Qe)
|
|
1810
1811
|
try {
|
|
1811
|
-
x = new g().parseFromString(
|
|
1812
|
+
x = new g().parseFromString(ae, Ft);
|
|
1812
1813
|
} catch {
|
|
1813
1814
|
}
|
|
1814
1815
|
if (!x || !x.documentElement) {
|
|
1815
1816
|
x = ue.createDocument(St, "template", null);
|
|
1816
1817
|
try {
|
|
1817
|
-
x.documentElement.innerHTML = yn ? G :
|
|
1818
|
+
x.documentElement.innerHTML = yn ? G : ae;
|
|
1818
1819
|
} catch {
|
|
1819
1820
|
}
|
|
1820
1821
|
}
|
|
@@ -1839,10 +1840,10 @@ function Ks() {
|
|
|
1839
1840
|
);
|
|
1840
1841
|
let z = x.nextNode();
|
|
1841
1842
|
for (; z; ) {
|
|
1842
|
-
let
|
|
1843
|
+
let ae = z.data;
|
|
1843
1844
|
_t([je, at, lt], (Y) => {
|
|
1844
|
-
|
|
1845
|
-
}), z.data =
|
|
1845
|
+
ae = Ct(ae, Y, " ");
|
|
1846
|
+
}), z.data = ae, z = x.nextNode();
|
|
1846
1847
|
}
|
|
1847
1848
|
}, "_scrubTemplateExpressions"), an = /* @__PURE__ */ d(function(r) {
|
|
1848
1849
|
const x = j ? j(r) : null;
|
|
@@ -1869,7 +1870,7 @@ function Ks() {
|
|
|
1869
1870
|
// select, etc.) regardless of whether the named child happens to
|
|
1870
1871
|
// carry a numeric .length, which a typeof-based probe would miss
|
|
1871
1872
|
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
1872
|
-
r.childNodes !==
|
|
1873
|
+
r.childNodes !== N(r);
|
|
1873
1874
|
}, "_isClobbered"), Ut = /* @__PURE__ */ d(function(r) {
|
|
1874
1875
|
if (!D || typeof r != "object" || r === null)
|
|
1875
1876
|
return !1;
|
|
@@ -1907,7 +1908,7 @@ function Ks() {
|
|
|
1907
1908
|
if (!Ze[z] && rs(z) && (re.tagNameCheck instanceof RegExp && ye(re.tagNameCheck, z) || re.tagNameCheck instanceof Function && re.tagNameCheck(z)))
|
|
1908
1909
|
return !1;
|
|
1909
1910
|
if (Pe && !y[z]) {
|
|
1910
|
-
const Y = ee(r), oe =
|
|
1911
|
+
const Y = ee(r), oe = N(r);
|
|
1911
1912
|
if (oe && Y) {
|
|
1912
1913
|
const Be = oe.length;
|
|
1913
1914
|
for (let et = Be - 1; et >= 0; --et) {
|
|
@@ -1926,10 +1927,10 @@ function Ks() {
|
|
|
1926
1927
|
}, "_sanitizeElements"), is = /* @__PURE__ */ d(function(r, x, z) {
|
|
1927
1928
|
if (De[x] || Ne && (x === "id" || x === "name") && (z in e || z in ha))
|
|
1928
1929
|
return !1;
|
|
1929
|
-
const
|
|
1930
|
-
if (!(
|
|
1930
|
+
const ae = Z[x] || Le.attributeCheck instanceof Function && Le.attributeCheck(x, r);
|
|
1931
|
+
if (!(A && !De[x] && ye(Ae, x))) {
|
|
1931
1932
|
if (!(v && ye(mt, x))) {
|
|
1932
|
-
if (!
|
|
1933
|
+
if (!ae || De[x]) {
|
|
1933
1934
|
if (
|
|
1934
1935
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1935
1936
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
@@ -1965,9 +1966,9 @@ function Ks() {
|
|
|
1965
1966
|
allowedAttributes: Z,
|
|
1966
1967
|
forceKeepAttr: void 0
|
|
1967
1968
|
};
|
|
1968
|
-
let
|
|
1969
|
-
for (;
|
|
1970
|
-
const Y = x[
|
|
1969
|
+
let ae = x.length;
|
|
1970
|
+
for (; ae--; ) {
|
|
1971
|
+
const Y = x[ae], oe = Y.name, Be = Y.namespaceURI, et = Y.value, qe = fe(oe), An = et;
|
|
1971
1972
|
let xe = oe === "value" ? An : xi(An);
|
|
1972
1973
|
if (z.attrName = qe, z.attrValue = xe, z.keepAttr = !0, z.forceKeepAttr = void 0, it(ce.uponSanitizeAttribute, r, z), xe = z.attrValue, Oe && (qe === "id" || qe === "name") && bs(xe, Je) !== 0 && (gt(oe, r), xe = Je + xe), L && ye(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, xe)) {
|
|
1973
1974
|
gt(oe, r);
|
|
@@ -1995,14 +1996,14 @@ function Ks() {
|
|
|
1995
1996
|
gt(oe, r);
|
|
1996
1997
|
continue;
|
|
1997
1998
|
}
|
|
1998
|
-
if (
|
|
1999
|
-
switch (
|
|
1999
|
+
if (B && typeof S == "object" && typeof S.getAttributeType == "function" && !Be)
|
|
2000
|
+
switch (S.getAttributeType(os, qe)) {
|
|
2000
2001
|
case "TrustedHTML": {
|
|
2001
|
-
xe =
|
|
2002
|
+
xe = B.createHTML(xe);
|
|
2002
2003
|
break;
|
|
2003
2004
|
}
|
|
2004
2005
|
case "TrustedScriptURL": {
|
|
2005
|
-
xe =
|
|
2006
|
+
xe = B.createScriptURL(xe);
|
|
2006
2007
|
break;
|
|
2007
2008
|
}
|
|
2008
2009
|
}
|
|
@@ -2029,14 +2030,14 @@ function Ks() {
|
|
|
2029
2030
|
const Y = R ? R(r) : r.shadowRoot;
|
|
2030
2031
|
Ut(Y) && (Et(Y), ln(Y));
|
|
2031
2032
|
}
|
|
2032
|
-
const z =
|
|
2033
|
+
const z = N ? N(r) : r.childNodes;
|
|
2033
2034
|
if (!z)
|
|
2034
2035
|
return;
|
|
2035
|
-
const
|
|
2036
|
+
const ae = [];
|
|
2036
2037
|
_t(z, (Y) => {
|
|
2037
|
-
Rt(
|
|
2038
|
+
Rt(ae, Y);
|
|
2038
2039
|
});
|
|
2039
|
-
for (const Y of
|
|
2040
|
+
for (const Y of ae)
|
|
2040
2041
|
Et(Y);
|
|
2041
2042
|
if (x === tt.element) {
|
|
2042
2043
|
const Y = j ? j(r) : null;
|
|
@@ -2047,7 +2048,7 @@ function Ks() {
|
|
|
2047
2048
|
}
|
|
2048
2049
|
}, "_sanitizeAttachedShadowRoots");
|
|
2049
2050
|
return t.sanitize = function(F) {
|
|
2050
|
-
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, x = null, z = null,
|
|
2051
|
+
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, x = null, z = null, ae = null, Y = null;
|
|
2051
2052
|
if (yn = !F, yn && (F = "<!-->"), typeof F != "string" && !rn(F) && (F = Ti(F), typeof F != "string"))
|
|
2052
2053
|
throw Wt("dirty is not a string, aborting");
|
|
2053
2054
|
if (!t.isSupported)
|
|
@@ -2067,14 +2068,14 @@ function Ks() {
|
|
|
2067
2068
|
else {
|
|
2068
2069
|
if (!le && !C && !J && // eslint-disable-next-line unicorn/prefer-includes
|
|
2069
2070
|
F.indexOf("<") === -1)
|
|
2070
|
-
return
|
|
2071
|
+
return B && Ce ? B.createHTML(F) : F;
|
|
2071
2072
|
if (x = ts(F), !x)
|
|
2072
2073
|
return le ? null : Ce ? G : "";
|
|
2073
2074
|
}
|
|
2074
2075
|
x && be && Ve(x.firstChild);
|
|
2075
2076
|
const oe = ns(_ ? F : x);
|
|
2076
|
-
for (;
|
|
2077
|
-
as(
|
|
2077
|
+
for (; ae = oe.nextNode(); )
|
|
2078
|
+
as(ae), ls(ae), Ut(ae.content) && ln(ae.content);
|
|
2078
2079
|
if (_)
|
|
2079
2080
|
return C && ss(F), F;
|
|
2080
2081
|
if (le) {
|
|
@@ -2089,7 +2090,7 @@ function Ks() {
|
|
|
2089
2090
|
return J && K["!doctype"] && x.ownerDocument && x.ownerDocument.doctype && x.ownerDocument.doctype.name && ye(Li, x.ownerDocument.doctype.name) && (Be = "<!DOCTYPE " + x.ownerDocument.doctype.name + `>
|
|
2090
2091
|
` + Be), C && _t([je, at, lt], (et) => {
|
|
2091
2092
|
Be = Ct(Be, et, " ");
|
|
2092
|
-
}),
|
|
2093
|
+
}), B && Ce ? B.createHTML(Be) : Be;
|
|
2093
2094
|
}, t.setConfig = function() {
|
|
2094
2095
|
let F = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2095
2096
|
Sn(F), pe = !0;
|
|
@@ -2097,8 +2098,8 @@ function Ks() {
|
|
|
2097
2098
|
At = null, pe = !1;
|
|
2098
2099
|
}, t.isValidAttribute = function(F, r, x) {
|
|
2099
2100
|
At || Sn({});
|
|
2100
|
-
const z = fe(F),
|
|
2101
|
-
return is(z,
|
|
2101
|
+
const z = fe(F), ae = fe(r);
|
|
2102
|
+
return is(z, ae, x);
|
|
2102
2103
|
}, t.addHook = function(F, r) {
|
|
2103
2104
|
typeof r == "function" && Rt(ce[F], r);
|
|
2104
2105
|
}, t.removeHook = function(F, r) {
|
|
@@ -2235,9 +2236,9 @@ function Sr(a, t, e) {
|
|
|
2235
2236
|
d(Sr, "st");
|
|
2236
2237
|
var Ot, mn = (Ot = class {
|
|
2237
2238
|
constructor(t) {
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2239
|
+
P(this, "options");
|
|
2240
|
+
P(this, "rules");
|
|
2241
|
+
P(this, "lexer");
|
|
2241
2242
|
this.options = t || kt;
|
|
2242
2243
|
}
|
|
2243
2244
|
space(t) {
|
|
@@ -2288,26 +2289,26 @@ var Ot, mn = (Ot = class {
|
|
|
2288
2289
|
else break;
|
|
2289
2290
|
n = n.slice(u);
|
|
2290
2291
|
let g = h.join(`
|
|
2291
|
-
`),
|
|
2292
|
+
`), S = g.replace(this.rules.other.blockquoteSetextReplace, `
|
|
2292
2293
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
2293
2294
|
i = i ? `${i}
|
|
2294
2295
|
${g}` : g, s = s ? `${s}
|
|
2295
|
-
${
|
|
2296
|
+
${S}` : S;
|
|
2296
2297
|
let b = this.lexer.state.top;
|
|
2297
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(
|
|
2298
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(S, l, !0), this.lexer.state.top = b, n.length === 0) break;
|
|
2298
2299
|
let w = l.at(-1);
|
|
2299
2300
|
if (w?.type === "code") break;
|
|
2300
2301
|
if (w?.type === "blockquote") {
|
|
2301
2302
|
let $ = w, E = $.raw + `
|
|
2302
2303
|
` + n.join(`
|
|
2303
|
-
`),
|
|
2304
|
-
l[l.length - 1] =
|
|
2304
|
+
`), N = this.blockquote(E);
|
|
2305
|
+
l[l.length - 1] = N, i = i.substring(0, i.length - $.raw.length) + N.raw, s = s.substring(0, s.length - $.text.length) + N.text;
|
|
2305
2306
|
break;
|
|
2306
2307
|
} else if (w?.type === "list") {
|
|
2307
2308
|
let $ = w, E = $.raw + `
|
|
2308
2309
|
` + n.join(`
|
|
2309
|
-
`),
|
|
2310
|
-
l[l.length - 1] =
|
|
2310
|
+
`), N = this.list(E);
|
|
2311
|
+
l[l.length - 1] = N, i = i.substring(0, i.length - w.raw.length) + N.raw, s = s.substring(0, s.length - $.raw.length) + N.raw, n = E.substring(l.at(-1).raw.length).split(`
|
|
2311
2312
|
`);
|
|
2312
2313
|
continue;
|
|
2313
2314
|
}
|
|
@@ -2322,31 +2323,31 @@ ${A}` : A;
|
|
|
2322
2323
|
n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
|
|
2323
2324
|
let l = this.rules.other.listItemRegex(n), c = !1;
|
|
2324
2325
|
for (; t; ) {
|
|
2325
|
-
let u = !1, g = "",
|
|
2326
|
+
let u = !1, g = "", S = "";
|
|
2326
2327
|
if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
2327
2328
|
g = e[0], t = t.substring(g.length);
|
|
2328
2329
|
let b = Tr(e[2].split(`
|
|
2329
2330
|
`, 1)[0], e[1].length), w = t.split(`
|
|
2330
2331
|
`, 1)[0], $ = !b.trim(), E = 0;
|
|
2331
|
-
if (this.options.pedantic ? (E = 2,
|
|
2332
|
+
if (this.options.pedantic ? (E = 2, S = b.trimStart()) : $ ? E = e[1].length + 1 : (E = b.search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, S = b.slice(E), E += e[1].length), $ && this.rules.other.blankLine.test(w) && (g += w + `
|
|
2332
2333
|
`, t = t.substring(w.length + 1), u = !0), !u) {
|
|
2333
|
-
let
|
|
2334
|
+
let N = this.rules.other.nextBulletRegex(E), ee = this.rules.other.hrRegex(E), R = this.rules.other.fencesBeginRegex(E), O = this.rules.other.headingBeginRegex(E), D = this.rules.other.htmlBeginRegex(E), j = this.rules.other.blockquoteBeginRegex(E);
|
|
2334
2335
|
for (; t; ) {
|
|
2335
|
-
let
|
|
2336
|
+
let B = t.split(`
|
|
2336
2337
|
`, 1)[0], G;
|
|
2337
|
-
if (w =
|
|
2338
|
-
if (G.search(this.rules.other.nonSpaceChar) >= E || !w.trim())
|
|
2338
|
+
if (w = B, this.options.pedantic ? (w = w.replace(this.rules.other.listReplaceNesting, " "), G = w) : G = w.replace(this.rules.other.tabCharGlobal, " "), R.test(w) || O.test(w) || D.test(w) || j.test(w) || N.test(w) || ee.test(w)) break;
|
|
2339
|
+
if (G.search(this.rules.other.nonSpaceChar) >= E || !w.trim()) S += `
|
|
2339
2340
|
` + G.slice(E);
|
|
2340
2341
|
else {
|
|
2341
2342
|
if ($ || b.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || R.test(b) || O.test(b) || ee.test(b)) break;
|
|
2342
|
-
|
|
2343
|
+
S += `
|
|
2343
2344
|
` + w;
|
|
2344
2345
|
}
|
|
2345
|
-
$ = !w.trim(), g +=
|
|
2346
|
-
`, t = t.substring(
|
|
2346
|
+
$ = !w.trim(), g += B + `
|
|
2347
|
+
`, t = t.substring(B.length + 1), b = G.slice(E);
|
|
2347
2348
|
}
|
|
2348
2349
|
}
|
|
2349
|
-
s.loose || (c ? s.loose = !0 : this.rules.other.doubleBlankLine.test(g) && (c = !0)), s.items.push({ type: "list_item", raw: g, task: !!this.options.gfm && this.rules.other.listIsTask.test(
|
|
2350
|
+
s.loose || (c ? s.loose = !0 : this.rules.other.doubleBlankLine.test(g) && (c = !0)), s.items.push({ type: "list_item", raw: g, task: !!this.options.gfm && this.rules.other.listIsTask.test(S), loose: !1, text: S, tokens: [] }), s.raw += g;
|
|
2350
2351
|
}
|
|
2351
2352
|
let h = s.items.at(-1);
|
|
2352
2353
|
if (h) h.raw = h.raw.trimEnd(), h.text = h.text.trimEnd();
|
|
@@ -2361,14 +2362,14 @@ ${A}` : A;
|
|
|
2361
2362
|
this.lexer.inlineQueue[b].src = this.lexer.inlineQueue[b].src.replace(this.rules.other.listReplaceTask, "");
|
|
2362
2363
|
break;
|
|
2363
2364
|
}
|
|
2364
|
-
let
|
|
2365
|
-
if (
|
|
2366
|
-
let b = { type: "checkbox", raw:
|
|
2365
|
+
let S = this.rules.other.listTaskCheckbox.exec(u.raw);
|
|
2366
|
+
if (S) {
|
|
2367
|
+
let b = { type: "checkbox", raw: S[0] + " ", checked: S[0] !== "[ ]" };
|
|
2367
2368
|
u.checked = b.checked, s.loose ? u.tokens[0] && ["paragraph", "text"].includes(u.tokens[0].type) && "tokens" in u.tokens[0] && u.tokens[0].tokens ? (u.tokens[0].raw = b.raw + u.tokens[0].raw, u.tokens[0].text = b.raw + u.tokens[0].text, u.tokens[0].tokens.unshift(b)) : u.tokens.unshift({ type: "paragraph", raw: b.raw, text: b.raw, tokens: [b] }) : u.tokens.unshift(b);
|
|
2368
2369
|
}
|
|
2369
2370
|
} else u.task && (u.task = !1);
|
|
2370
2371
|
if (!s.loose) {
|
|
2371
|
-
let
|
|
2372
|
+
let S = u.tokens.filter((w) => w.type === "space"), b = S.length > 0 && S.some((w) => this.rules.other.anyLine.test(w.raw));
|
|
2372
2373
|
s.loose = b;
|
|
2373
2374
|
}
|
|
2374
2375
|
}
|
|
@@ -2485,7 +2486,7 @@ ${A}` : A;
|
|
|
2485
2486
|
}
|
|
2486
2487
|
if (h -= c, h > 0) continue;
|
|
2487
2488
|
c = Math.min(c, c + h + u);
|
|
2488
|
-
let
|
|
2489
|
+
let S = [...i[0]][0].length, b = t.slice(0, s + i.index + S + c);
|
|
2489
2490
|
if (Math.min(s, c) % 2) {
|
|
2490
2491
|
let $ = b.slice(1, -1);
|
|
2491
2492
|
return { type: "em", raw: b, text: $, tokens: this.lexer.inlineTokens($) };
|
|
@@ -2518,8 +2519,8 @@ ${A}` : A;
|
|
|
2518
2519
|
}
|
|
2519
2520
|
if (h -= c, h > 0) continue;
|
|
2520
2521
|
c = Math.min(c, c + h);
|
|
2521
|
-
let g = [...i[0]][0].length,
|
|
2522
|
-
return { type: "del", raw:
|
|
2522
|
+
let g = [...i[0]][0].length, S = t.slice(0, s + i.index + g + c), b = S.slice(s, -s);
|
|
2523
|
+
return { type: "del", raw: S, text: b, tokens: this.lexer.inlineTokens(b) };
|
|
2523
2524
|
}
|
|
2524
2525
|
}
|
|
2525
2526
|
}
|
|
@@ -2554,11 +2555,11 @@ ${A}` : A;
|
|
|
2554
2555
|
}
|
|
2555
2556
|
}, d(Ot, "w"), Ot), pt, Ke = (pt = class {
|
|
2556
2557
|
constructor(t) {
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2558
|
+
P(this, "tokens");
|
|
2559
|
+
P(this, "options");
|
|
2560
|
+
P(this, "state");
|
|
2561
|
+
P(this, "inlineQueue");
|
|
2562
|
+
P(this, "tokenizer");
|
|
2562
2563
|
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || kt, this.options.tokenizer = this.options.tokenizer || new mn(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
2563
2564
|
let e = { other: Te, block: un.normal, inline: Gt.normal };
|
|
2564
2565
|
this.options.pedantic ? (e.block = un.pedantic, e.inline = Gt.pedantic) : this.options.gfm && (e.block = un.gfm, this.options.breaks ? e.inline = Gt.breaks : e.inline = Gt.gfm), this.tokenizer.rules = e;
|
|
@@ -2703,7 +2704,7 @@ ${A}` : A;
|
|
|
2703
2704
|
}
|
|
2704
2705
|
l || (c = ""), l = !1;
|
|
2705
2706
|
let u;
|
|
2706
|
-
if (this.options.extensions?.inline?.some((
|
|
2707
|
+
if (this.options.extensions?.inline?.some((S) => (u = S.call({ lexer: this }, t, e)) ? (t = t.substring(u.raw.length), e.push(u), !0) : !1)) continue;
|
|
2707
2708
|
if (u = this.tokenizer.escape(t)) {
|
|
2708
2709
|
t = t.substring(u.raw.length), e.push(u);
|
|
2709
2710
|
continue;
|
|
@@ -2718,8 +2719,8 @@ ${A}` : A;
|
|
|
2718
2719
|
}
|
|
2719
2720
|
if (u = this.tokenizer.reflink(t, this.tokens.links)) {
|
|
2720
2721
|
t = t.substring(u.raw.length);
|
|
2721
|
-
let
|
|
2722
|
-
u.type === "text" &&
|
|
2722
|
+
let S = e.at(-1);
|
|
2723
|
+
u.type === "text" && S?.type === "text" ? (S.raw += u.raw, S.text += u.text) : e.push(u);
|
|
2723
2724
|
continue;
|
|
2724
2725
|
}
|
|
2725
2726
|
if (u = this.tokenizer.emStrong(t, n, c)) {
|
|
@@ -2748,15 +2749,15 @@ ${A}` : A;
|
|
|
2748
2749
|
}
|
|
2749
2750
|
let g = t;
|
|
2750
2751
|
if (this.options.extensions?.startInline) {
|
|
2751
|
-
let
|
|
2752
|
+
let S = 1 / 0, b = t.slice(1), w;
|
|
2752
2753
|
this.options.extensions.startInline.forEach(($) => {
|
|
2753
|
-
w = $.call({ lexer: this }, b), typeof w == "number" && w >= 0 && (
|
|
2754
|
-
}),
|
|
2754
|
+
w = $.call({ lexer: this }, b), typeof w == "number" && w >= 0 && (S = Math.min(S, w));
|
|
2755
|
+
}), S < 1 / 0 && S >= 0 && (g = t.substring(0, S + 1));
|
|
2755
2756
|
}
|
|
2756
2757
|
if (u = this.tokenizer.inlineText(g)) {
|
|
2757
2758
|
t = t.substring(u.raw.length), u.raw.slice(-1) !== "_" && (c = u.raw.slice(-1)), l = !0;
|
|
2758
|
-
let
|
|
2759
|
-
|
|
2759
|
+
let S = e.at(-1);
|
|
2760
|
+
S?.type === "text" ? (S.raw += u.raw, S.text += u.text) : e.push(u);
|
|
2760
2761
|
continue;
|
|
2761
2762
|
}
|
|
2762
2763
|
if (t) {
|
|
@@ -2773,8 +2774,8 @@ ${A}` : A;
|
|
|
2773
2774
|
}
|
|
2774
2775
|
}, d(pt, "l"), pt), zt, gn = (zt = class {
|
|
2775
2776
|
constructor(t) {
|
|
2776
|
-
|
|
2777
|
-
|
|
2777
|
+
P(this, "options");
|
|
2778
|
+
P(this, "parser");
|
|
2778
2779
|
this.options = t || kt;
|
|
2779
2780
|
}
|
|
2780
2781
|
space(t) {
|
|
@@ -2921,9 +2922,9 @@ ${t}</tr>
|
|
|
2921
2922
|
}
|
|
2922
2923
|
}, d(Nt, "L"), Nt), ft, Ye = (ft = class {
|
|
2923
2924
|
constructor(t) {
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2925
|
+
P(this, "options");
|
|
2926
|
+
P(this, "renderer");
|
|
2927
|
+
P(this, "textRenderer");
|
|
2927
2928
|
this.options = t || kt, this.options.renderer = this.options.renderer || new gn(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Yn();
|
|
2928
2929
|
}
|
|
2929
2930
|
static parse(t, e) {
|
|
@@ -3072,8 +3073,8 @@ ${t}</tr>
|
|
|
3072
3073
|
}
|
|
3073
3074
|
}, d(ft, "l"), ft), ht, Zt = (ht = class {
|
|
3074
3075
|
constructor(t) {
|
|
3075
|
-
|
|
3076
|
-
|
|
3076
|
+
P(this, "options");
|
|
3077
|
+
P(this, "block");
|
|
3077
3078
|
this.options = t || kt;
|
|
3078
3079
|
}
|
|
3079
3080
|
preprocess(t) {
|
|
@@ -3094,18 +3095,18 @@ ${t}</tr>
|
|
|
3094
3095
|
provideParser(t = this.block) {
|
|
3095
3096
|
return t ? Ye.parse : Ye.parseInline;
|
|
3096
3097
|
}
|
|
3097
|
-
}, d(ht, "P"),
|
|
3098
|
+
}, d(ht, "P"), P(ht, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), P(ht, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), ht), Pt, Ar = (Pt = class {
|
|
3098
3099
|
constructor(...t) {
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3100
|
+
P(this, "defaults", Un());
|
|
3101
|
+
P(this, "options", this.setOptions);
|
|
3102
|
+
P(this, "parse", this.parseMarkdown(!0));
|
|
3103
|
+
P(this, "parseInline", this.parseMarkdown(!1));
|
|
3104
|
+
P(this, "Parser", Ye);
|
|
3105
|
+
P(this, "Renderer", gn);
|
|
3106
|
+
P(this, "TextRenderer", Yn);
|
|
3107
|
+
P(this, "Lexer", Ke);
|
|
3108
|
+
P(this, "Tokenizer", mn);
|
|
3109
|
+
P(this, "Hooks", Zt);
|
|
3109
3110
|
this.use(...t);
|
|
3110
3111
|
}
|
|
3111
3112
|
walkTokens(t, e) {
|
|
@@ -3158,8 +3159,8 @@ ${t}</tr>
|
|
|
3158
3159
|
if (["options", "parser"].includes(l)) continue;
|
|
3159
3160
|
let c = l, h = n.renderer[c], u = s[c];
|
|
3160
3161
|
s[c] = (...g) => {
|
|
3161
|
-
let
|
|
3162
|
-
return
|
|
3162
|
+
let S = h.apply(s, g);
|
|
3163
|
+
return S === !1 && (S = u.apply(s, g)), S || "";
|
|
3163
3164
|
};
|
|
3164
3165
|
}
|
|
3165
3166
|
i.renderer = s;
|
|
@@ -3171,8 +3172,8 @@ ${t}</tr>
|
|
|
3171
3172
|
if (["options", "rules", "lexer"].includes(l)) continue;
|
|
3172
3173
|
let c = l, h = n.tokenizer[c], u = s[c];
|
|
3173
3174
|
s[c] = (...g) => {
|
|
3174
|
-
let
|
|
3175
|
-
return
|
|
3175
|
+
let S = h.apply(s, g);
|
|
3176
|
+
return S === !1 && (S = u.apply(s, g)), S;
|
|
3176
3177
|
};
|
|
3177
3178
|
}
|
|
3178
3179
|
i.tokenizer = s;
|
|
@@ -3188,15 +3189,15 @@ ${t}</tr>
|
|
|
3188
3189
|
let b = await h.call(s, g);
|
|
3189
3190
|
return u.call(s, b);
|
|
3190
3191
|
})();
|
|
3191
|
-
let
|
|
3192
|
-
return u.call(s,
|
|
3192
|
+
let S = h.call(s, g);
|
|
3193
|
+
return u.call(s, S);
|
|
3193
3194
|
} : s[c] = (...g) => {
|
|
3194
3195
|
if (this.defaults.async) return (async () => {
|
|
3195
3196
|
let b = await h.apply(s, g);
|
|
3196
3197
|
return b === !1 && (b = await u.apply(s, g)), b;
|
|
3197
3198
|
})();
|
|
3198
|
-
let
|
|
3199
|
-
return
|
|
3199
|
+
let S = h.apply(s, g);
|
|
3200
|
+
return S === !1 && (S = u.apply(s, g)), S;
|
|
3200
3201
|
};
|
|
3201
3202
|
}
|
|
3202
3203
|
i.hooks = s;
|
|
@@ -3325,13 +3326,13 @@ function Rr(a) {
|
|
|
3325
3326
|
const i = [...n.entries()].sort(([b], [w]) => b - w), s = Math.max(1, ...i.map(([, b]) => b.length)), l = Math.max(1, i.length), c = t === "horizontal" ? ut * 2 + l * It + (l - 1) * Vt : ut * 2 + s * It + (s - 1) * Vt, h = t === "horizontal" ? ut * 2 + s * $t + (s - 1) * qt : ut * 2 + l * $t + (l - 1) * qt, u = [];
|
|
3326
3327
|
for (const [b, [, w]] of i.entries()) {
|
|
3327
3328
|
const $ = (s - w.length) * (t === "horizontal" ? $t + qt : It + Vt) / 2;
|
|
3328
|
-
for (const [E,
|
|
3329
|
+
for (const [E, N] of w.entries()) {
|
|
3329
3330
|
const ee = t === "horizontal" ? ut + b * (It + Vt) : ut + $ + E * (It + Vt), R = t === "horizontal" ? ut + $ + E * ($t + qt) : ut + b * ($t + qt);
|
|
3330
3331
|
u.push({
|
|
3331
|
-
id:
|
|
3332
|
-
label:
|
|
3333
|
-
...
|
|
3334
|
-
...
|
|
3332
|
+
id: N.id,
|
|
3333
|
+
label: N.label,
|
|
3334
|
+
...N.detail ? { detail: N.detail } : {},
|
|
3335
|
+
...N.kind ? { kind: N.kind } : {},
|
|
3335
3336
|
x: ee,
|
|
3336
3337
|
y: R,
|
|
3337
3338
|
width: It,
|
|
@@ -3339,25 +3340,25 @@ function Rr(a) {
|
|
|
3339
3340
|
});
|
|
3340
3341
|
}
|
|
3341
3342
|
}
|
|
3342
|
-
const g = new Map(u.map((b) => [b.id, b])),
|
|
3343
|
+
const g = new Map(u.map((b) => [b.id, b])), S = a.edges.flatMap((b, w) => {
|
|
3343
3344
|
const $ = g.get(b.from), E = g.get(b.to);
|
|
3344
3345
|
if (!$ || !E)
|
|
3345
3346
|
return [];
|
|
3346
|
-
const
|
|
3347
|
+
const N = t === "horizontal" ? $.x + $.width : $.x + $.width / 2, ee = t === "horizontal" ? $.y + $.height / 2 : $.y + $.height, R = t === "horizontal" ? E.x : E.x + E.width / 2, O = t === "horizontal" ? E.y + E.height / 2 : E.y;
|
|
3347
3348
|
return [{
|
|
3348
3349
|
key: `${b.from}-${b.to}-${w}`,
|
|
3349
3350
|
from: b.from,
|
|
3350
3351
|
to: b.to,
|
|
3351
3352
|
...b.label ? { label: b.label } : {},
|
|
3352
|
-
x1:
|
|
3353
|
+
x1: N,
|
|
3353
3354
|
y1: ee,
|
|
3354
3355
|
x2: R,
|
|
3355
3356
|
y2: O,
|
|
3356
|
-
labelX: (
|
|
3357
|
+
labelX: (N + R) / 2,
|
|
3357
3358
|
labelY: (ee + O) / 2
|
|
3358
3359
|
}];
|
|
3359
3360
|
});
|
|
3360
|
-
return { width: c, height: h, orientation: t, nodes: u, edges:
|
|
3361
|
+
return { width: c, height: h, orientation: t, nodes: u, edges: S };
|
|
3361
3362
|
}
|
|
3362
3363
|
d(Rr, "layoutChatDiagram");
|
|
3363
3364
|
function ia(a) {
|
|
@@ -3469,60 +3470,60 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3469
3470
|
return v?.chartType === "pie";
|
|
3470
3471
|
}
|
|
3471
3472
|
d(l, "isPieChart");
|
|
3472
|
-
const c = T(() => n.value?.data ?? []), h = T(() => s(n.value) ? n.value : null), u = T(() => h.value?.series ?? []), g = T(() => l(n.value) ? n.value : null),
|
|
3473
|
+
const c = T(() => n.value?.data ?? []), h = T(() => s(n.value) ? n.value : null), u = T(() => h.value?.series ?? []), g = T(() => l(n.value) ? n.value : null), S = T(() => h.value?.chartType === "bar" && h.value.stacking === "stacked");
|
|
3473
3474
|
function b(v) {
|
|
3474
3475
|
return typeof v == "number" && Number.isFinite(v) ? v : null;
|
|
3475
3476
|
}
|
|
3476
3477
|
d(b, "numericValue");
|
|
3477
|
-
function w(v,
|
|
3478
|
-
return String(v[
|
|
3478
|
+
function w(v, A) {
|
|
3479
|
+
return String(v[A] ?? "").trim();
|
|
3479
3480
|
}
|
|
3480
3481
|
d(w, "categoryLabel");
|
|
3481
|
-
function $(v,
|
|
3482
|
-
const o = v.map((L) => w(L,
|
|
3482
|
+
function $(v, A) {
|
|
3483
|
+
const o = v.map((L) => w(L, A)).filter(Boolean);
|
|
3483
3484
|
if (!o.length)
|
|
3484
3485
|
return !1;
|
|
3485
3486
|
const I = Math.max(...o.map((L) => L.length)), C = o.reduce((L, J) => L + J.length, 0) / o.length;
|
|
3486
3487
|
return I >= 16 || o.length > 5 && C >= 10;
|
|
3487
3488
|
}
|
|
3488
3489
|
d($, "hasLongCategoryLabels");
|
|
3489
|
-
function E(v,
|
|
3490
|
+
function E(v, A) {
|
|
3490
3491
|
return v.data.map((o, I) => {
|
|
3491
|
-
const C = b(o[
|
|
3492
|
+
const C = b(o[A]);
|
|
3492
3493
|
return C === null ? null : { index: I, value: C };
|
|
3493
3494
|
}).filter((o) => o !== null);
|
|
3494
3495
|
}
|
|
3495
3496
|
d(E, "trendLinePoints");
|
|
3496
|
-
function
|
|
3497
|
+
function N(v) {
|
|
3497
3498
|
if (v.length < 2) return null;
|
|
3498
|
-
const
|
|
3499
|
+
const A = v.length, o = v.reduce((le, de) => le + de.index, 0), I = v.reduce((le, de) => le + de.value, 0), C = v.reduce((le, de) => le + de.index * de.index, 0), L = v.reduce((le, de) => le + de.index * de.value, 0), J = A * C - o * o;
|
|
3499
3500
|
if (J === 0) return null;
|
|
3500
|
-
const pe = (
|
|
3501
|
+
const pe = (A * L - o * I) / J, be = (I - pe * o) / A;
|
|
3501
3502
|
return { slope: pe, intercept: be };
|
|
3502
3503
|
}
|
|
3503
|
-
d(
|
|
3504
|
+
d(N, "linearTrend");
|
|
3504
3505
|
const ee = T(() => {
|
|
3505
|
-
const v = [],
|
|
3506
|
-
if (!
|
|
3507
|
-
if (
|
|
3508
|
-
for (const o of
|
|
3506
|
+
const v = [], A = h.value;
|
|
3507
|
+
if (!A) return v;
|
|
3508
|
+
if (A.chartType === "bar" && A.stacking === "stacked")
|
|
3509
|
+
for (const o of A.data) {
|
|
3509
3510
|
let I = 0, C = 0;
|
|
3510
|
-
for (const L of
|
|
3511
|
+
for (const L of A.series) {
|
|
3511
3512
|
const J = b(o[L.dataKey]);
|
|
3512
3513
|
J !== null && (J >= 0 ? I += J : C += J);
|
|
3513
3514
|
}
|
|
3514
3515
|
v.push(I, C);
|
|
3515
3516
|
}
|
|
3516
3517
|
else
|
|
3517
|
-
for (const o of
|
|
3518
|
-
for (const I of
|
|
3518
|
+
for (const o of A.data)
|
|
3519
|
+
for (const I of A.series) {
|
|
3519
3520
|
const C = b(o[I.dataKey]);
|
|
3520
3521
|
C !== null && v.push(C);
|
|
3521
3522
|
}
|
|
3522
|
-
if (
|
|
3523
|
-
const o = E(
|
|
3523
|
+
if (A.trendLine && (A.chartType === "line" || A.chartType === "scatter")) {
|
|
3524
|
+
const o = E(A, A.trendLine.dataKey);
|
|
3524
3525
|
v.push(...o.map((C) => C.value));
|
|
3525
|
-
const I =
|
|
3526
|
+
const I = N(o);
|
|
3526
3527
|
if (I && o.length) {
|
|
3527
3528
|
const C = o[0].index, L = o[o.length - 1].index;
|
|
3528
3529
|
v.push(I.intercept + I.slope * C, I.intercept + I.slope * L);
|
|
@@ -3530,17 +3531,17 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3530
3531
|
}
|
|
3531
3532
|
return v;
|
|
3532
3533
|
});
|
|
3533
|
-
function R(v,
|
|
3534
|
+
function R(v, A) {
|
|
3534
3535
|
const o = v > 0 ? v : 1, I = Math.floor(Math.log10(o)), C = o / 10 ** I;
|
|
3535
3536
|
let L;
|
|
3536
|
-
return
|
|
3537
|
+
return A ? L = C < 1.5 ? 1 : C < 3 ? 2 : C < 7 ? 5 : 10 : L = C <= 1 ? 1 : C <= 2 ? 2 : C <= 5 ? 5 : 10, L * 10 ** I;
|
|
3537
3538
|
}
|
|
3538
3539
|
d(R, "niceNum");
|
|
3539
3540
|
const O = T(() => {
|
|
3540
|
-
const v = ee.value,
|
|
3541
|
-
if (o ===
|
|
3542
|
-
return { min: 0, max:
|
|
3543
|
-
const I = 4, C = R(
|
|
3541
|
+
const v = ee.value, A = v.length ? Math.max(0, ...v) : 1, o = v.length ? Math.min(0, ...v) : 0;
|
|
3542
|
+
if (o === A)
|
|
3543
|
+
return { min: 0, max: A || 1, ticks: [0, A || 1] };
|
|
3544
|
+
const I = 4, C = R(A - o, !1), L = R(C / (I - 1), !0), J = Math.floor(o / L) * L, pe = Math.ceil(A / L) * L, be = [];
|
|
3544
3545
|
for (let le = J; le <= pe + L * 0.5; le += L)
|
|
3545
3546
|
be.push(Number(le.toFixed(6)));
|
|
3546
3547
|
return { min: J, max: pe, ticks: be };
|
|
@@ -3548,16 +3549,16 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3548
3549
|
const v = h.value;
|
|
3549
3550
|
if (!v)
|
|
3550
3551
|
return { mode: "horizontal", entries: [] };
|
|
3551
|
-
const
|
|
3552
|
+
const A = v.xKey;
|
|
3552
3553
|
return Or({
|
|
3553
|
-
labels: v.data.map((o) => String(o?.[
|
|
3554
|
+
labels: v.data.map((o) => String(o?.[A] ?? "")),
|
|
3554
3555
|
// Provisional inner width — the frame depends on the plan's mode, so the
|
|
3555
3556
|
// plan uses the narrowest plausible plot; drawing positions still come
|
|
3556
3557
|
// from the real frame.
|
|
3557
3558
|
plotWidth: 318
|
|
3558
3559
|
});
|
|
3559
|
-
}),
|
|
3560
|
-
const v = D.value?.valueFormat,
|
|
3560
|
+
}), B = T(() => {
|
|
3561
|
+
const v = D.value?.valueFormat, A = !!(D.value && (v === "currency" || v === "percent" || D.value.valuePrefix || D.value.valueSuffix)), o = v === "duration" ? 46 : A ? 38 : 30, I = j.value.mode === "angled";
|
|
3561
3562
|
return {
|
|
3562
3563
|
width: 360,
|
|
3563
3564
|
height: 168 + (I ? zs : 0),
|
|
@@ -3567,39 +3568,39 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3567
3568
|
bottom: 24 + (I ? zs : 0)
|
|
3568
3569
|
};
|
|
3569
3570
|
});
|
|
3570
|
-
function G(v,
|
|
3571
|
-
const o = h.value, I =
|
|
3571
|
+
function G(v, A) {
|
|
3572
|
+
const o = h.value, I = B.value;
|
|
3572
3573
|
if (o?.chartType === "bar") {
|
|
3573
3574
|
const C = I.width - I.left - I.right;
|
|
3574
|
-
return I.left + (v + 0.5) * (C / Math.max(
|
|
3575
|
+
return I.left + (v + 0.5) * (C / Math.max(A, 1));
|
|
3575
3576
|
}
|
|
3576
|
-
return se(v,
|
|
3577
|
+
return se(v, A);
|
|
3577
3578
|
}
|
|
3578
3579
|
d(G, "labelCenterX");
|
|
3579
|
-
function se(v,
|
|
3580
|
-
const o =
|
|
3581
|
-
return
|
|
3580
|
+
function se(v, A) {
|
|
3581
|
+
const o = B.value, I = o.width - o.left - o.right;
|
|
3582
|
+
return A <= 1 ? o.left + I / 2 : o.left + I * v / (A - 1);
|
|
3582
3583
|
}
|
|
3583
3584
|
d(se, "xForIndex");
|
|
3584
3585
|
function ue(v) {
|
|
3585
|
-
const { min:
|
|
3586
|
-
return I.top + (o - v) / (o -
|
|
3586
|
+
const { min: A, max: o } = O.value, I = B.value, C = I.height - I.top - I.bottom;
|
|
3587
|
+
return I.top + (o - v) / (o - A || 1) * C;
|
|
3587
3588
|
}
|
|
3588
3589
|
d(ue, "yForValue");
|
|
3589
3590
|
function Se(v) {
|
|
3590
|
-
const
|
|
3591
|
-
return
|
|
3591
|
+
const A = h.value;
|
|
3592
|
+
return A ? A.data.map((o, I) => {
|
|
3592
3593
|
const C = b(o[v]) ?? 0;
|
|
3593
|
-
return `${I === 0 ? "M" : "L"} ${se(I,
|
|
3594
|
+
return `${I === 0 ? "M" : "L"} ${se(I, A.data.length).toFixed(1)} ${ue(C).toFixed(1)}`;
|
|
3594
3595
|
}).join(" ") : "";
|
|
3595
3596
|
}
|
|
3596
3597
|
d(Se, "pathForSeries");
|
|
3597
3598
|
const ze = T(() => {
|
|
3598
3599
|
const v = h.value;
|
|
3599
3600
|
if (!v?.trendLine || v.chartType !== "line" && v.chartType !== "scatter") return null;
|
|
3600
|
-
const
|
|
3601
|
-
if (!o || !
|
|
3602
|
-
const I =
|
|
3601
|
+
const A = E(v, v.trendLine.dataKey), o = N(A);
|
|
3602
|
+
if (!o || !A.length) return null;
|
|
3603
|
+
const I = A[0].index, C = A[A.length - 1].index, L = o.intercept + o.slope * I, J = o.intercept + o.slope * C, pe = Math.max(0, v.series.findIndex((be) => be.dataKey === v.trendLine?.dataKey));
|
|
3603
3604
|
return {
|
|
3604
3605
|
path: `M ${se(I, v.data.length).toFixed(1)} ${ue(L).toFixed(1)} L ${se(C, v.data.length).toFixed(1)} ${ue(J).toFixed(1)}`,
|
|
3605
3606
|
dataKey: v.trendLine.dataKey,
|
|
@@ -3608,20 +3609,20 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3608
3609
|
}), Ie = T(() => {
|
|
3609
3610
|
const v = h.value;
|
|
3610
3611
|
if (!v || v.chartType !== "bar") return [];
|
|
3611
|
-
const
|
|
3612
|
-
if (
|
|
3612
|
+
const A = B.value, I = (A.width - A.left - A.right) / Math.max(v.data.length, 1), C = ue(0);
|
|
3613
|
+
if (S.value) {
|
|
3613
3614
|
const le = Math.max(4, Math.min(24, I * 0.42));
|
|
3614
3615
|
return v.data.flatMap((de, Ce) => {
|
|
3615
3616
|
let Ne = 0, Oe = 0;
|
|
3616
|
-
const Je =
|
|
3617
|
+
const Je = A.left + Ce * I + (I - le) / 2;
|
|
3617
3618
|
return v.series.map((Pe, _) => {
|
|
3618
|
-
const m = b(de[Pe.dataKey]) ?? 0, y = m >= 0 ? Ne : Oe, te = y + m, U = ue(y),
|
|
3619
|
+
const m = b(de[Pe.dataKey]) ?? 0, y = m >= 0 ? Ne : Oe, te = y + m, U = ue(y), ie = ue(te);
|
|
3619
3620
|
return m >= 0 ? Ne = te : Oe = te, {
|
|
3620
3621
|
key: `${Ce}-${Pe.dataKey}`,
|
|
3621
3622
|
x: Je,
|
|
3622
|
-
y: Math.min(U,
|
|
3623
|
+
y: Math.min(U, ie),
|
|
3623
3624
|
width: le,
|
|
3624
|
-
height: Math.max(1.5, Math.abs(U -
|
|
3625
|
+
height: Math.max(1.5, Math.abs(U - ie)),
|
|
3625
3626
|
seriesIndex: _,
|
|
3626
3627
|
rowIndex: Ce,
|
|
3627
3628
|
dataKey: Pe.dataKey
|
|
@@ -3631,7 +3632,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3631
3632
|
}
|
|
3632
3633
|
const L = Math.max(v.series.length, 1), J = L > 1 ? 2 : 0, pe = Math.max(3, Math.min(20, (I * 0.62 - J * (L - 1)) / L)), be = pe * L + J * (L - 1);
|
|
3633
3634
|
return v.data.flatMap((le, de) => v.series.map((Ce, Ne) => {
|
|
3634
|
-
const Oe = b(le[Ce.dataKey]) ?? 0, Je = ue(Oe), Pe =
|
|
3635
|
+
const Oe = b(le[Ce.dataKey]) ?? 0, Je = ue(Oe), Pe = A.left + de * I + (I - be) / 2 + Ne * (pe + J);
|
|
3635
3636
|
return {
|
|
3636
3637
|
key: `${de}-${Ce.dataKey}`,
|
|
3637
3638
|
x: Pe,
|
|
@@ -3646,22 +3647,22 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3646
3647
|
}), He = T(() => {
|
|
3647
3648
|
const v = h.value;
|
|
3648
3649
|
if (!v) return [];
|
|
3649
|
-
const
|
|
3650
|
-
if (!
|
|
3651
|
-
const o =
|
|
3650
|
+
const A = v.data;
|
|
3651
|
+
if (!A.length) return [];
|
|
3652
|
+
const o = A.length - 1, I = j.value, C = I.mode === "angled";
|
|
3652
3653
|
return I.entries.map(({ index: L, text: J }) => ({
|
|
3653
3654
|
key: `${L}`,
|
|
3654
3655
|
label: J,
|
|
3655
|
-
x: G(L,
|
|
3656
|
+
x: G(L, A.length),
|
|
3656
3657
|
anchor: C ? "end" : L === 0 ? "start" : L === o ? "end" : "middle",
|
|
3657
3658
|
angled: C
|
|
3658
3659
|
})).filter((L) => L.label);
|
|
3659
3660
|
}), ce = T(() => {
|
|
3660
3661
|
const v = h.value;
|
|
3661
|
-
if (!v || v.chartType !== "bar" || v.series.length !== 1 ||
|
|
3662
|
+
if (!v || v.chartType !== "bar" || v.series.length !== 1 || S.value)
|
|
3662
3663
|
return [];
|
|
3663
|
-
const
|
|
3664
|
-
const pe = w(L, v.xKey), be = b(L[
|
|
3664
|
+
const A = v.series[0], o = v.data.map((L, J) => {
|
|
3665
|
+
const pe = w(L, v.xKey), be = b(L[A.dataKey]);
|
|
3665
3666
|
return !pe || be === null ? null : { key: `${J}-${pe}`, label: pe, rawValue: be };
|
|
3666
3667
|
}).filter((L) => L !== null);
|
|
3667
3668
|
if (!o.length || o.some((L) => L.rawValue < 0))
|
|
@@ -3672,16 +3673,16 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3672
3673
|
return o.map((L) => ({
|
|
3673
3674
|
key: L.key,
|
|
3674
3675
|
label: L.label,
|
|
3675
|
-
value: Dn({ value: L.rawValue, series:
|
|
3676
|
+
value: Dn({ value: L.rawValue, series: A }),
|
|
3676
3677
|
width: L.rawValue <= 0 ? 0 : Math.max(2, L.rawValue / C * 100),
|
|
3677
3678
|
seriesIndex: 0
|
|
3678
3679
|
}));
|
|
3679
3680
|
}), je = T(() => {
|
|
3680
3681
|
const v = h.value;
|
|
3681
3682
|
if (!v?.data.length) return [];
|
|
3682
|
-
const
|
|
3683
|
+
const A = v.data[v.data.length - 1];
|
|
3683
3684
|
return v.series.map((o, I) => {
|
|
3684
|
-
const C = b(
|
|
3685
|
+
const C = b(A?.[o.dataKey]);
|
|
3685
3686
|
return {
|
|
3686
3687
|
key: o.dataKey,
|
|
3687
3688
|
label: o.label || o.dataKey,
|
|
@@ -3692,19 +3693,19 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3692
3693
|
}), at = T(() => {
|
|
3693
3694
|
const v = h.value;
|
|
3694
3695
|
if (!v?.data.length || v.chartType !== "line") return [];
|
|
3695
|
-
const
|
|
3696
|
+
const A = v.data.length - 1, o = v.data[A];
|
|
3696
3697
|
return v.series.map((I, C) => {
|
|
3697
3698
|
const L = b(o?.[I.dataKey]);
|
|
3698
|
-
return L === null ? null : { key: I.dataKey, cx: se(
|
|
3699
|
+
return L === null ? null : { key: I.dataKey, cx: se(A, v.data.length), cy: ue(L), seriesIndex: C };
|
|
3699
3700
|
}).filter((I) => I !== null);
|
|
3700
3701
|
}), lt = T(() => {
|
|
3701
3702
|
const v = g.value;
|
|
3702
3703
|
if (!v) return [];
|
|
3703
|
-
const
|
|
3704
|
+
const A = v.data.map((C) => ({
|
|
3704
3705
|
name: String(C[v.nameKey] ?? ""),
|
|
3705
3706
|
value: b(C[v.valueKey]) ?? 0
|
|
3706
|
-
})).filter((C) => C.name && C.value >= 0).sort((C, L) => L.value - C.value), o =
|
|
3707
|
-
return
|
|
3707
|
+
})).filter((C) => C.name && C.value >= 0).sort((C, L) => L.value - C.value), o = A.reduce((C, L) => C + L.value, 0) || 1, I = v.series?.[0];
|
|
3708
|
+
return A.map((C, L) => ({
|
|
3708
3709
|
...C,
|
|
3709
3710
|
key: `${L}-${C.name}`,
|
|
3710
3711
|
percent: C.value / o,
|
|
@@ -3720,8 +3721,8 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3720
3721
|
"rgba(255, 255, 255, 0.55)"
|
|
3721
3722
|
];
|
|
3722
3723
|
function ke(v) {
|
|
3723
|
-
const
|
|
3724
|
-
return
|
|
3724
|
+
const A = t.inverted ? wt : mt;
|
|
3725
|
+
return A[v % A.length];
|
|
3725
3726
|
}
|
|
3726
3727
|
d(ke, "seriesColor");
|
|
3727
3728
|
function $e(v) {
|
|
@@ -3733,12 +3734,12 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3733
3734
|
}
|
|
3734
3735
|
d(Xe, "diagramNodeStroke");
|
|
3735
3736
|
const K = T(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), We = T(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), Z = T(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), ot = T(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), re = T(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Ze = T(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), De = T(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), Le = T(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
|
|
3736
|
-
return (v,
|
|
3737
|
+
return (v, A) => e.value ? (p(), f("section", {
|
|
3737
3738
|
key: 0,
|
|
3738
3739
|
"data-test": "chat-visual",
|
|
3739
3740
|
"data-visual-type": e.value.visualType,
|
|
3740
3741
|
"data-chart-type": n.value?.chartType,
|
|
3741
|
-
"data-stacking":
|
|
3742
|
+
"data-stacking": S.value ? "stacked" : void 0,
|
|
3742
3743
|
"data-diagram-type": i.value?.diagramType,
|
|
3743
3744
|
class: "my-6 w-full border-y py-5",
|
|
3744
3745
|
style: q({ borderColor: Ze.value }),
|
|
@@ -3789,15 +3790,15 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3789
3790
|
])) : (p(), f("svg", {
|
|
3790
3791
|
key: 1,
|
|
3791
3792
|
class: "block h-auto w-full overflow-visible",
|
|
3792
|
-
viewBox: `0 0 ${
|
|
3793
|
-
style: q({ aspectRatio: `${
|
|
3793
|
+
viewBox: `0 0 ${B.value.width} ${B.value.height}`,
|
|
3794
|
+
style: q({ aspectRatio: `${B.value.width} / ${B.value.height}` }),
|
|
3794
3795
|
preserveAspectRatio: "xMidYMid meet",
|
|
3795
3796
|
"aria-hidden": "true"
|
|
3796
3797
|
}, [
|
|
3797
3798
|
(p(!0), f(Q, null, me(O.value.ticks, (o) => (p(), f("line", {
|
|
3798
3799
|
key: `grid-${o}`,
|
|
3799
|
-
x1:
|
|
3800
|
-
x2:
|
|
3800
|
+
x1: B.value.left,
|
|
3801
|
+
x2: B.value.width - B.value.right,
|
|
3801
3802
|
y1: ue(o),
|
|
3802
3803
|
y2: ue(o),
|
|
3803
3804
|
"stroke-width": "1",
|
|
@@ -3807,7 +3808,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3807
3808
|
k("g", null, [
|
|
3808
3809
|
(p(!0), f(Q, null, me(O.value.ticks, (o) => (p(), f("text", {
|
|
3809
3810
|
key: `y-${o}`,
|
|
3810
|
-
x:
|
|
3811
|
+
x: B.value.left - 7,
|
|
3811
3812
|
y: ue(o) + 3,
|
|
3812
3813
|
"text-anchor": "end",
|
|
3813
3814
|
"font-size": "9.5",
|
|
@@ -3876,10 +3877,10 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3876
3877
|
(p(!0), f(Q, null, me(He.value, (o) => (p(), f("text", {
|
|
3877
3878
|
key: o.key,
|
|
3878
3879
|
x: o.x,
|
|
3879
|
-
y: o.angled ?
|
|
3880
|
+
y: o.angled ? B.value.height - B.value.bottom + 12 : B.value.height - 6,
|
|
3880
3881
|
"text-anchor": o.anchor,
|
|
3881
3882
|
"font-size": "9.5",
|
|
3882
|
-
transform: o.angled ? `rotate(${Qt(Lr)} ${o.x} ${
|
|
3883
|
+
transform: o.angled ? `rotate(${Qt(Lr)} ${o.x} ${B.value.height - B.value.bottom + 12})` : void 0,
|
|
3883
3884
|
style: q({ fill: Z.value })
|
|
3884
3885
|
}, W(o.label), 13, Yr))), 128))
|
|
3885
3886
|
], 12, Ur)),
|
|
@@ -4053,14 +4054,14 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4053
4054
|
const E = w.trim();
|
|
4054
4055
|
if (!E || E === "#")
|
|
4055
4056
|
return $;
|
|
4056
|
-
let
|
|
4057
|
+
let N = !1;
|
|
4057
4058
|
if (typeof window < "u")
|
|
4058
4059
|
try {
|
|
4059
|
-
|
|
4060
|
+
N = new URL(w, window.location.href).origin === window.location.origin;
|
|
4060
4061
|
} catch {
|
|
4061
|
-
|
|
4062
|
+
N = !1;
|
|
4062
4063
|
}
|
|
4063
|
-
return
|
|
4064
|
+
return N ? `<a href="${w}">${$}</a>` : `<a href="${w}" target="_blank" rel="noopener noreferrer">${$}</a>`;
|
|
4064
4065
|
}, ne.setOptions({ breaks: !0, gfm: !0, renderer: i });
|
|
4065
4066
|
function s(w) {
|
|
4066
4067
|
if (!w) return "";
|
|
@@ -4111,15 +4112,15 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4111
4112
|
}
|
|
4112
4113
|
d(u, "onRichTextAssetError");
|
|
4113
4114
|
const g = /```(?:pl-visual|pl-platform-visual)[ \t]*(?:\r?\n|$)/;
|
|
4114
|
-
function
|
|
4115
|
-
const { text: $, streaming: E } = w,
|
|
4115
|
+
function S(w) {
|
|
4116
|
+
const { text: $, streaming: E } = w, N = [], ee = /```(?:pl-visual|pl-platform-visual)[ \t]*\r?\n([\s\S]*?)```/g;
|
|
4116
4117
|
let R = 0, O = 0, D = ee.exec($);
|
|
4117
4118
|
for (; D !== null; ) {
|
|
4118
4119
|
const se = $.slice(R, D.index), ue = s(se);
|
|
4119
|
-
ue &&
|
|
4120
|
+
ue && N.push({ kind: "markdown", key: `md-${O}`, html: ue });
|
|
4120
4121
|
const Se = wa(D[1].trim());
|
|
4121
4122
|
if (Se.ok)
|
|
4122
|
-
|
|
4123
|
+
N.push({ kind: "visual", key: `visual-${O}`, result: Se });
|
|
4123
4124
|
else {
|
|
4124
4125
|
typeof console < "u" && console.warn("[pl-visual] parse_failed", {
|
|
4125
4126
|
reason: Se.reason,
|
|
@@ -4129,22 +4130,22 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4129
4130
|
...c(D[1].trim())
|
|
4130
4131
|
});
|
|
4131
4132
|
const ze = Se.fallbackMarkdown ? s(Se.fallbackMarkdown) : "";
|
|
4132
|
-
ze &&
|
|
4133
|
+
ze && N.push({ kind: "markdown", key: `visual-${O}`, html: ze });
|
|
4133
4134
|
}
|
|
4134
4135
|
R = D.index + D[0].length, O += 1, D = ee.exec($);
|
|
4135
4136
|
}
|
|
4136
|
-
const j = $.slice(R),
|
|
4137
|
-
if (
|
|
4138
|
-
const se = s(j.slice(0,
|
|
4139
|
-
return se &&
|
|
4137
|
+
const j = $.slice(R), B = E ? g.exec(j) : null;
|
|
4138
|
+
if (B) {
|
|
4139
|
+
const se = s(j.slice(0, B.index));
|
|
4140
|
+
return se && N.push({ kind: "markdown", key: `md-${O}`, html: se }), N.push({ kind: "pending-visual", key: `pending-${O}` }), N;
|
|
4140
4141
|
}
|
|
4141
4142
|
const G = s(j);
|
|
4142
|
-
return G &&
|
|
4143
|
+
return G && N.push({ kind: "markdown", key: `md-${O}`, html: G }), N;
|
|
4143
4144
|
}
|
|
4144
|
-
d(
|
|
4145
|
+
d(S, "richTextSegments");
|
|
4145
4146
|
const b = T(() => {
|
|
4146
4147
|
const w = e.value;
|
|
4147
|
-
return w ?
|
|
4148
|
+
return w ? S({ text: w, streaming: !!t.streaming }) : [];
|
|
4148
4149
|
});
|
|
4149
4150
|
return (w, $) => (p(), f("div", {
|
|
4150
4151
|
class: "chat-msg-rich break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed",
|
|
@@ -4301,16 +4302,16 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4301
4302
|
return !te || te.sender !== y.sender;
|
|
4302
4303
|
}
|
|
4303
4304
|
d(u, "shouldShowAvatar");
|
|
4304
|
-
const g = T(() => a.chatController?.textState.value),
|
|
4305
|
+
const g = T(() => a.chatController?.textState.value), S = T(() => g.value?.isConnected ?? !1), b = T(() => g.value?.isThinking ?? !1), w = T(() => g.value?.connectionStatus === "disconnected" && !!g.value?.error), $ = T(() => g.value?.connectionStatus !== "connected" && !g.value?.error), E = T(() => g.value?.error), N = T(() => a.chatController?.liveTurnBlocks?.value ?? []), ee = T(() => a.chatController?.liveStreamMessageId?.value), R = T(() => {
|
|
4305
4306
|
const _ = a.chatController?.sharedMessages.value ?? [];
|
|
4306
|
-
return
|
|
4307
|
+
return N.value.length && ee.value ? _.filter((m) => m.id !== ee.value) : _;
|
|
4307
4308
|
}), O = T(() => a.chatController?.workJournal?.value ? void 0 : g.value?.workingDescription?.trim() || void 0), D = T(() => a.chatController?.workJournal?.value), j = T(() => {
|
|
4308
|
-
if (!D.value && !
|
|
4309
|
+
if (!D.value && !N.value.length)
|
|
4309
4310
|
return;
|
|
4310
4311
|
const _ = R.value, m = _[_.length - 1];
|
|
4311
4312
|
if (m)
|
|
4312
4313
|
return m.sender === "agent" || m.sender === "system" ? _.length >= 2 ? _[_.length - 2].id : void 0 : m.id;
|
|
4313
|
-
}),
|
|
4314
|
+
}), B = T(() => {
|
|
4314
4315
|
const _ = {};
|
|
4315
4316
|
for (const m of R.value) {
|
|
4316
4317
|
if (m.sender === "user" || !m.toolActivities?.length)
|
|
@@ -4325,7 +4326,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4325
4326
|
return _;
|
|
4326
4327
|
});
|
|
4327
4328
|
function G(_) {
|
|
4328
|
-
return
|
|
4329
|
+
return B.value[_.id];
|
|
4329
4330
|
}
|
|
4330
4331
|
d(G, "messageWorkJournal");
|
|
4331
4332
|
function se(_, m) {
|
|
@@ -4344,22 +4345,22 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4344
4345
|
const m = _.text ?? "";
|
|
4345
4346
|
if (_.sender !== "agent")
|
|
4346
4347
|
return m ? [{ kind: "text", key: `${_.id}:text`, text: m }] : [];
|
|
4347
|
-
const y = (_.attachments ?? []).map((
|
|
4348
|
+
const y = (_.attachments ?? []).map((ie, Ge) => ({ attachment: ie, index: Ge, offset: se(ie, m) })).filter((ie) => ie.offset !== null).sort((ie, Ge) => ie.offset - Ge.offset || ie.index - Ge.index);
|
|
4348
4349
|
if (y.length === 0)
|
|
4349
4350
|
return m ? [{ kind: "text", key: `${_.id}:text`, text: m }] : [];
|
|
4350
4351
|
const te = [];
|
|
4351
4352
|
let U = 0;
|
|
4352
|
-
for (const
|
|
4353
|
-
|
|
4353
|
+
for (const ie of y)
|
|
4354
|
+
ie.offset > U && te.push({
|
|
4354
4355
|
kind: "text",
|
|
4355
4356
|
key: `${_.id}:text:${U}`,
|
|
4356
|
-
text: m.slice(U,
|
|
4357
|
+
text: m.slice(U, ie.offset)
|
|
4357
4358
|
}), te.push({
|
|
4358
4359
|
kind: "attachment",
|
|
4359
|
-
key: `${_.id}:attachment:${ue(
|
|
4360
|
-
attachment:
|
|
4360
|
+
key: `${_.id}:attachment:${ue(ie.attachment, ie.index)}`,
|
|
4361
|
+
attachment: ie.attachment,
|
|
4361
4362
|
placement: "inline"
|
|
4362
|
-
}), U =
|
|
4363
|
+
}), U = ie.offset;
|
|
4363
4364
|
return U < m.length && te.push({
|
|
4364
4365
|
kind: "text",
|
|
4365
4366
|
key: `${_.id}:text:${U}`,
|
|
@@ -4371,18 +4372,18 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4371
4372
|
if (!b.value) return;
|
|
4372
4373
|
const _ = R.value, m = _[_.length - 1];
|
|
4373
4374
|
return m?.sender === "agent" || m?.sender === "system" ? m.id : void 0;
|
|
4374
|
-
}), ce = T(() => !b.value || O.value || D.value ||
|
|
4375
|
+
}), ce = T(() => !b.value || O.value || D.value || N.value.length ? !1 : He.value === void 0), je = T(() => g.value?.sendBlockedReason), at = T(() => !S.value || je.value !== void 0), lt = T(() => w.value ? "Agent is offline" : $.value ? "Connecting..." : je.value === "agent_deleted" ? "This assistant was deleted" : je.value === "account" ? "Open billing to keep chatting" : "Message"), Ae = T(() => a.chatController?.composerState?.value ?? {
|
|
4375
4376
|
text: "",
|
|
4376
4377
|
pendingAttachments: [],
|
|
4377
4378
|
isUploading: !1
|
|
4378
4379
|
}), mt = T({
|
|
4379
4380
|
get: /* @__PURE__ */ d(() => Ae.value.text, "get"),
|
|
4380
4381
|
set: /* @__PURE__ */ d((_) => a.chatController?.setComposerText?.({ text: _ }), "set")
|
|
4381
|
-
}), wt = T(() => Ae.value.pendingAttachments), ke = T(() => Ae.value.isUploading), $e = T(() => a.chatController?.voiceRecorder), Xe = T(() => $e.value?.isBusy.value ?? !1), K = T(() => a.chatController?.canAttachFile?.value ?? !1), We = T(() => a.chatController?.canRecordAudio?.value ?? !1), Z = T(() => a.chatController?.composerAction?.value ?? "idle"), ot = T(() => Z.value !== "idle"), re = T(() => Z.value === "stop" ? "Stop reply" : "Send message"), Ze = T(() => Z.value === "idle" && We.value && !Xe.value && !!$e.value?.canUseBrowserRecording), De = T(() => $e.value?.isActive.value ?? !1), Le = T(() => $e.value?.elapsedLabel.value ?? "0:00"), v = T(() => $e.value?.statusText.value ?? "Release to send"),
|
|
4382
|
+
}), wt = T(() => Ae.value.pendingAttachments), ke = T(() => Ae.value.isUploading), $e = T(() => a.chatController?.voiceRecorder), Xe = T(() => $e.value?.isBusy.value ?? !1), K = T(() => a.chatController?.canAttachFile?.value ?? !1), We = T(() => a.chatController?.canRecordAudio?.value ?? !1), Z = T(() => a.chatController?.composerAction?.value ?? "idle"), ot = T(() => Z.value !== "idle"), re = T(() => Z.value === "stop" ? "Stop reply" : "Send message"), Ze = T(() => Z.value === "idle" && We.value && !Xe.value && !!$e.value?.canUseBrowserRecording), De = T(() => $e.value?.isActive.value ?? !1), Le = T(() => $e.value?.elapsedLabel.value ?? "0:00"), v = T(() => $e.value?.statusText.value ?? "Release to send"), A = T(() => $e.value?.state.value.phase === "sending" ? "Sending voice message" : De.value ? "Release to send voice message" : "Hold to record voice message"), o = T(() => a.variant === "light"), I = T(
|
|
4382
4383
|
() => o.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
|
|
4383
4384
|
), C = T(() => o.value ? "text-theme-300" : "text-white/30");
|
|
4384
4385
|
en(async () => {
|
|
4385
|
-
a.chatController && !
|
|
4386
|
+
a.chatController && !S.value && await a.chatController.startTextConversation();
|
|
4386
4387
|
}), Ns(() => {
|
|
4387
4388
|
a.chatController?.voiceRecorder?.teardown();
|
|
4388
4389
|
});
|
|
@@ -4437,16 +4438,16 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4437
4438
|
function Pe(_) {
|
|
4438
4439
|
const m = /* @__PURE__ */ new Date(), y = _.toDateString() === m.toDateString(), te = new Date(m);
|
|
4439
4440
|
te.setDate(te.getDate() - 1);
|
|
4440
|
-
const U = _.toDateString() === te.toDateString(),
|
|
4441
|
-
if (y) return
|
|
4442
|
-
if (U) return `Yesterday, ${
|
|
4441
|
+
const U = _.toDateString() === te.toDateString(), ie = _.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
4442
|
+
if (y) return ie;
|
|
4443
|
+
if (U) return `Yesterday, ${ie}`;
|
|
4443
4444
|
const Ge = _.getFullYear() === m.getFullYear();
|
|
4444
4445
|
return `${_.toLocaleDateString("en-US", {
|
|
4445
4446
|
weekday: "long",
|
|
4446
4447
|
month: "short",
|
|
4447
4448
|
day: "numeric",
|
|
4448
4449
|
...Ge ? {} : { year: "numeric" }
|
|
4449
|
-
})}, ${
|
|
4450
|
+
})}, ${ie}`;
|
|
4450
4451
|
}
|
|
4451
4452
|
return d(Pe, "formatTimeDivider"), (_, m) => (p(), f("div", fl, [
|
|
4452
4453
|
o.value ? a.showHeader ? (p(), f("div", gl, [
|
|
@@ -4466,7 +4467,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4466
4467
|
])) : H("", !0) : (p(), f("div", ml, [
|
|
4467
4468
|
Fe(Va, {
|
|
4468
4469
|
agent: a.agent,
|
|
4469
|
-
"is-online":
|
|
4470
|
+
"is-online": S.value
|
|
4470
4471
|
}, null, 8, ["agent", "is-online"])
|
|
4471
4472
|
])),
|
|
4472
4473
|
w.value ? (p(), f("div", {
|
|
@@ -4505,7 +4506,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4505
4506
|
alt: a.agent.displayName.value,
|
|
4506
4507
|
class: M(["size-full rounded-full object-cover ring-1", o.value ? "ring-black/5" : "ring-white/10"])
|
|
4507
4508
|
}, null, 10, Sl),
|
|
4508
|
-
|
|
4509
|
+
S.value ? (p(), f("span", {
|
|
4509
4510
|
key: 0,
|
|
4510
4511
|
class: M(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", o.value ? "bg-white" : "bg-theme-900"])
|
|
4511
4512
|
}, [...m[20] || (m[20] = [
|
|
@@ -4653,8 +4654,8 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4653
4654
|
key: 0,
|
|
4654
4655
|
class: M(["mb-1 space-y-1", y.sender === "user" ? "flex flex-col items-end" : ""])
|
|
4655
4656
|
}, [
|
|
4656
|
-
(p(!0), f(Q, null, me(Se(y), ({ attachment: U, index:
|
|
4657
|
-
key: ue(U,
|
|
4657
|
+
(p(!0), f(Q, null, me(Se(y), ({ attachment: U, index: ie }) => (p(), f(Q, {
|
|
4658
|
+
key: ue(U, ie)
|
|
4658
4659
|
}, [
|
|
4659
4660
|
U.type === "image" ? (p(), f("img", {
|
|
4660
4661
|
key: 0,
|
|
@@ -4733,7 +4734,9 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4733
4734
|
], 2)
|
|
4734
4735
|
], 10, $l)),
|
|
4735
4736
|
y.id === j.value ? (p(), f(Q, { key: 5 }, [
|
|
4736
|
-
|
|
4737
|
+
N.value.length ? (p(!0), f(Q, { key: 0 }, me(N.value, (U, ie) => (p(), f(Q, {
|
|
4738
|
+
key: U.id
|
|
4739
|
+
}, [
|
|
4737
4740
|
U.kind === "work" ? (p(), f("div", {
|
|
4738
4741
|
key: 0,
|
|
4739
4742
|
"data-test": "messaging-tool-activity",
|
|
@@ -4752,7 +4755,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4752
4755
|
Fe(Kt, {
|
|
4753
4756
|
text: U.content,
|
|
4754
4757
|
inverted: !o.value,
|
|
4755
|
-
streaming:
|
|
4758
|
+
streaming: ie === N.value.length - 1,
|
|
4756
4759
|
onClick: m[4] || (m[4] = Me(() => {
|
|
4757
4760
|
}, ["stop"]))
|
|
4758
4761
|
}, null, 8, ["text", "inverted", "streaming"])
|
|
@@ -4912,8 +4915,8 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4912
4915
|
key: 2,
|
|
4913
4916
|
"data-test": "messaging-record-audio-btn",
|
|
4914
4917
|
class: M(["mb-0.5 mr-0.5 flex size-9 shrink-0 items-center justify-center rounded-full transition-transform duration-200 @sm/chat:size-10", De.value ? "bg-theme-900 text-theme-0 scale-105 cursor-pointer" : o.value ? "text-theme-500 hover:bg-black/5 hover:text-theme-700 cursor-pointer" : "text-white/60 hover:bg-white/10 hover:text-white cursor-pointer"]),
|
|
4915
|
-
"aria-label":
|
|
4916
|
-
title:
|
|
4918
|
+
"aria-label": A.value,
|
|
4919
|
+
title: A.value,
|
|
4917
4920
|
onPointerdown: m[10] || (m[10] = Me((y) => Ne(), ["prevent"])),
|
|
4918
4921
|
onPointerup: m[11] || (m[11] = Me((y) => Oe({ cancelled: !1 }), ["prevent"])),
|
|
4919
4922
|
onPointercancel: m[12] || (m[12] = Me((y) => Oe({ cancelled: !0 }), ["prevent"])),
|
|
@@ -4930,7 +4933,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4930
4933
|
k("i", {
|
|
4931
4934
|
class: M([De.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-5"])
|
|
4932
4935
|
}, null, 2),
|
|
4933
|
-
k("span", co, W(
|
|
4936
|
+
k("span", co, W(A.value), 1)
|
|
4934
4937
|
], 42, oo)) : (p(), f("button", {
|
|
4935
4938
|
key: 3,
|
|
4936
4939
|
"data-test": "messaging-send-btn",
|