@pagelines/sdk 1.0.516 → 1.0.517
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/AgentProvider.vue_vue_type_script_setup_true_lang.js +706 -635
- package/dist/AgentProvider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js +985 -1023
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/agent/AgentController.d.ts +0 -10
- package/dist/agent/schema.d.ts +3 -3
- package/dist/agent/ui/ElCreateAgent.vue.d.ts +26 -12
- package/dist/api.d.ts +2 -18
- package/dist/clients/ChatClient.d.ts +5 -3
- package/dist/clients/types.d.ts +1 -5
- package/dist/contract/test/conversation-wire-shapes.unit.test.d.ts +14 -0
- package/dist/demo/index.d.ts +13 -6
- package/dist/index.js +291 -289
- package/dist/index.js.map +1 -1
- package/dist/sdkClient.d.ts +33 -40
- package/dist/sdkClient.js +357 -324
- package/dist/sdkClient.js.map +1 -1
- package/dist/widget/PLWidget.d.ts +1 -0
- package/dist/widget/composables/useWidgetState.d.ts +39 -18
- package/package.json +6 -7
- package/dist/types/SDKAppType.stub.d.ts +0 -6
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
var Ln = Object.defineProperty;
|
|
2
2
|
var Ds = (a, t, e) => t in a ? Ln(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
-
var
|
|
3
|
+
var h = (a, t) => Ln(a, "name", { value: t, configurable: !0 });
|
|
4
4
|
var D = (a, t, e) => Ds(a, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
-
import { defineComponent as
|
|
6
|
-
import { SettingsObject as Os, Agent as
|
|
5
|
+
import { defineComponent as ve, openBlock as y, createElementBlock as T, createElementVNode as A, normalizeClass as E, ref as Q, watch as Xe, computed as B, createCommentVNode as j, renderSlot as nn, onMounted as Et, Fragment as Se, renderList as ot, withDirectives as rs, vModelText as is, unref as Qt, toDisplayString as le, shallowRef as as, onBeforeUnmount as ls, nextTick as Ms, createVNode as Le, withCtx as Ls, withModifiers as bt, createTextVNode as On } from "vue";
|
|
6
|
+
import { SettingsObject as Os, Agent as yt, getDefaultAvatarUrl as os, createLogger as zs } from "@pagelines/core";
|
|
7
7
|
import { P as Ps } from "./sdkClient.js";
|
|
8
8
|
const Ns = { class: "spinner max-w-sm" }, $s = {
|
|
9
9
|
class: "ring-circular h-full w-full origin-center",
|
|
10
10
|
viewBox: "25 25 50 50"
|
|
11
|
-
}, zn = /* @__PURE__ */
|
|
11
|
+
}, zn = /* @__PURE__ */ ve({
|
|
12
12
|
__name: "FSpinner",
|
|
13
13
|
props: {
|
|
14
14
|
width: { type: String, default: "" },
|
|
15
15
|
colorMode: { type: String, default: "primary" }
|
|
16
16
|
},
|
|
17
17
|
setup(a) {
|
|
18
|
-
return (t, e) => (
|
|
19
|
-
(
|
|
18
|
+
return (t, e) => (y(), T("div", Ns, [
|
|
19
|
+
(y(), T("svg", $s, [
|
|
20
20
|
A("circle", {
|
|
21
|
-
class:
|
|
21
|
+
class: E([a.colorMode, "ring-path"]),
|
|
22
22
|
cx: "50",
|
|
23
23
|
cy: "50",
|
|
24
24
|
r: "20",
|
|
@@ -33,7 +33,7 @@ const Ns = { class: "spinner max-w-sm" }, $s = {
|
|
|
33
33
|
}), Us = [
|
|
34
34
|
{ pattern: /\bNO_REP\w*\b/g, label: "NO_REPLY — bot chose not to respond" },
|
|
35
35
|
{ pattern: /\bHEARTBEAT_OK\b/g, label: "HEARTBEAT_OK — scheduled check, nothing to do" }
|
|
36
|
-
], Bs = 9e4, cs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Fs = /* @__PURE__ */ new Set([...cs, "EMPTY_STREAM", "RATE_LIMIT"]),
|
|
36
|
+
], Bs = 9e4, cs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Fs = /* @__PURE__ */ new Set([...cs, "EMPTY_STREAM", "RATE_LIMIT"]), dn = class dn extends Os {
|
|
37
37
|
constructor(e) {
|
|
38
38
|
super("AgentChatController", e);
|
|
39
39
|
D(this, "isTextMode", !1);
|
|
@@ -50,7 +50,7 @@ const Ns = { class: "spinner max-w-sm" }, $s = {
|
|
|
50
50
|
D(this, "agentMode", Q("self"));
|
|
51
51
|
D(this, "sharedMessages", Q([]));
|
|
52
52
|
D(this, "_agent");
|
|
53
|
-
this._agent = e.agent instanceof
|
|
53
|
+
this._agent = e.agent instanceof yt ? e.agent : new yt({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
|
|
54
54
|
}
|
|
55
55
|
get chatEnabled() {
|
|
56
56
|
return this._agent.chatAvailable.value;
|
|
@@ -72,13 +72,13 @@ const Ns = { class: "spinner max-w-sm" }, $s = {
|
|
|
72
72
|
return e.includes("timed out") || e.includes("starting up") || e.includes("503") || e.includes("429") || e.includes("[no-reply]") || e.includes("[stream-open]") || e.includes("[stream-read]") || e.includes("[api]");
|
|
73
73
|
}
|
|
74
74
|
isDuplicateMessage(e, n) {
|
|
75
|
-
const
|
|
76
|
-
return l || (this.lastMessage = { hash:
|
|
75
|
+
const r = `${n}:${e.toLowerCase().trim()}`, s = Date.now(), l = r === this.lastMessage.hash && s - this.lastMessage.time < 500;
|
|
76
|
+
return l || (this.lastMessage = { hash: r, time: s }), l;
|
|
77
77
|
}
|
|
78
|
-
addMessage(e, n,
|
|
78
|
+
addMessage(e, n, r, s) {
|
|
79
79
|
this.isDuplicateMessage(e, n) || (this.sharedMessages.value = [
|
|
80
80
|
...this.sharedMessages.value,
|
|
81
|
-
{ id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments:
|
|
81
|
+
{ id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments: r, ...s ? { issue: s } : {} }
|
|
82
82
|
]);
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
@@ -96,13 +96,13 @@ const Ns = { class: "spinner max-w-sm" }, $s = {
|
|
|
96
96
|
getDynamicSettings() {
|
|
97
97
|
const { sdk: e } = this.settings;
|
|
98
98
|
if (!e) return { context: this.settings.context || "", firstMessage: this.settings.firstMessage || "" };
|
|
99
|
-
const n = e.activeUser.value,
|
|
99
|
+
const n = e.activeUser.value, r = n?.agents?.find((l) => l.agentId === n.primaryAgentId), s = n ? `
|
|
100
100
|
|
|
101
101
|
Current User:
|
|
102
|
-
- Name: ${
|
|
102
|
+
- Name: ${r?.name || "Anonymous"}
|
|
103
103
|
- Email: ${n.email}
|
|
104
|
-
- Title: ${
|
|
105
|
-
- About: ${
|
|
104
|
+
- Title: ${r?.title || ""}
|
|
105
|
+
- About: ${r?.summary || ""}
|
|
106
106
|
` : "";
|
|
107
107
|
return {
|
|
108
108
|
context: `${this.settings.context || ""}${s}`.trim(),
|
|
@@ -122,12 +122,12 @@ Current User:
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
setupModeWatcher() {
|
|
125
|
-
|
|
125
|
+
Xe(this.agentMode, async (e, n) => {
|
|
126
126
|
this.logger.info(`Mode changed from ${n} to ${e}`), this.isTextMode && (n === "talk" || n === "chat") && await this.endConversation();
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
setupAvailabilityWatcher() {
|
|
130
|
-
|
|
130
|
+
Xe(() => this._agent.chatAvailable.value, (e) => {
|
|
131
131
|
if (!(!this.isTextMode || this.isConnecting)) {
|
|
132
132
|
if (e) {
|
|
133
133
|
this.textState.value.isConnected || this.updateState(this.textState, {
|
|
@@ -154,9 +154,9 @@ Current User:
|
|
|
154
154
|
* agent/client.ts survive into the console line).
|
|
155
155
|
*/
|
|
156
156
|
handleError(e, n) {
|
|
157
|
-
const
|
|
158
|
-
this.logger.error("Conversation error:", { message:
|
|
159
|
-
error:
|
|
157
|
+
const r = e.message;
|
|
158
|
+
this.logger.error("Conversation error:", { message: r, raw: n, error: e }), this.addMessage(r, "system"), this.resetState(), this.updateState(this.textState, {
|
|
159
|
+
error: r,
|
|
160
160
|
connectionStatus: "error"
|
|
161
161
|
});
|
|
162
162
|
}
|
|
@@ -195,105 +195,89 @@ Current User:
|
|
|
195
195
|
this.isTextMode = !1;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
/**
|
|
199
|
-
* Start a fresh conversation — clears the visible transcript and unsets
|
|
200
|
-
* conversationId so the next send creates a new thread on the server.
|
|
201
|
-
* Prior session stays in DB for history; only the in-memory view resets.
|
|
202
|
-
* Use when an issue bubble (billing, error) is blocking the current
|
|
203
|
-
* conversation and the user wants a clean slate after resolving it.
|
|
204
|
-
*/
|
|
205
|
-
newConversation() {
|
|
206
|
-
this.conversationId = void 0, this.sharedMessages.value = [], this.lastMessage = { hash: "", time: 0 }, this.updateState(this.textState, {
|
|
207
|
-
isThinking: !1,
|
|
208
|
-
accountGated: !1,
|
|
209
|
-
isConnected: this.chatEnabled,
|
|
210
|
-
connectionStatus: this.chatEnabled ? "connected" : "disconnected",
|
|
211
|
-
error: void 0
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
198
|
async sendChatMessage(e, n) {
|
|
215
199
|
if (!this.isTextMode)
|
|
216
200
|
return;
|
|
217
|
-
const { chatStreamFn:
|
|
201
|
+
const { chatStreamFn: r } = this.settings;
|
|
218
202
|
if (!this.chatEnabled) {
|
|
219
203
|
this.addMessage("Agent is currently offline.", "system");
|
|
220
204
|
return;
|
|
221
205
|
}
|
|
222
206
|
const { sdk: s } = this.settings;
|
|
223
|
-
if (!
|
|
207
|
+
if (!r && !this._agent.handle.value) {
|
|
224
208
|
this.handleError(new Error("Agent handle required for chat"));
|
|
225
209
|
return;
|
|
226
210
|
}
|
|
227
211
|
this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0 });
|
|
228
212
|
const l = `stream-${Date.now()}`;
|
|
229
213
|
let o = !1, d = !1;
|
|
230
|
-
const c = /* @__PURE__ */
|
|
214
|
+
const c = /* @__PURE__ */ h((g, v = "assistant") => {
|
|
231
215
|
o || (o = !0, this.sharedMessages.value = [
|
|
232
216
|
...this.sharedMessages.value,
|
|
233
|
-
{ id: l, text: "", sender:
|
|
217
|
+
{ id: l, text: "", sender: v === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
|
|
234
218
|
]);
|
|
235
|
-
const
|
|
236
|
-
z?.id === l && (z.text +=
|
|
237
|
-
}, "onDelta"),
|
|
219
|
+
const I = this.sharedMessages.value, z = I[I.length - 1];
|
|
220
|
+
z?.id === l && (z.text += g, this.sharedMessages.value = [...I]);
|
|
221
|
+
}, "onDelta"), x = /* @__PURE__ */ h((g) => {
|
|
238
222
|
d = !0, o = !0;
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
223
|
+
const v = this.sharedMessages.value, I = v.findIndex((z) => z.id === g.id);
|
|
224
|
+
if (I >= 0)
|
|
241
225
|
this.sharedMessages.value = [
|
|
242
|
-
...
|
|
243
|
-
|
|
244
|
-
...
|
|
226
|
+
...v.slice(0, I),
|
|
227
|
+
g,
|
|
228
|
+
...v.slice(I + 1)
|
|
245
229
|
];
|
|
246
230
|
else {
|
|
247
|
-
const z =
|
|
248
|
-
this.sharedMessages.value = z?.id === l ? [...
|
|
231
|
+
const z = v[v.length - 1];
|
|
232
|
+
this.sharedMessages.value = z?.id === l ? [...v.slice(0, -1), g] : [...v, g];
|
|
249
233
|
}
|
|
250
|
-
|
|
251
|
-
}, "onMessage"),
|
|
234
|
+
g.sender === "system" && g.issue?.bucket === "account" && this.updateState(this.textState, { accountGated: !0 });
|
|
235
|
+
}, "onMessage"), p = /* @__PURE__ */ h((g) => {
|
|
252
236
|
if (!o && !d) {
|
|
253
|
-
|
|
237
|
+
m("empty_stream — assistant returned no content");
|
|
254
238
|
return;
|
|
255
239
|
}
|
|
256
|
-
const
|
|
257
|
-
if (
|
|
258
|
-
let z =
|
|
259
|
-
for (const
|
|
260
|
-
|
|
261
|
-
z ? z !==
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
}, "onDone"),
|
|
265
|
-
const
|
|
266
|
-
if (
|
|
267
|
-
const { bucket:
|
|
268
|
-
if (
|
|
269
|
-
const Re =
|
|
270
|
-
code:
|
|
240
|
+
const v = this.sharedMessages.value, I = v[v.length - 1];
|
|
241
|
+
if (I?.id === l && I.sender === "agent" && I.text) {
|
|
242
|
+
let z = I.text;
|
|
243
|
+
for (const X of Us)
|
|
244
|
+
X.pattern.test(z) && (console.debug(`[chat] filtered directive: ${X.label}`), z = z.replace(X.pattern, "").trim(), X.pattern.lastIndex = 0);
|
|
245
|
+
z ? z !== I.text && (I.text = z, this.sharedMessages.value = [...v]) : this.sharedMessages.value = v.slice(0, -1);
|
|
246
|
+
}
|
|
247
|
+
g && (this.conversationId = g), this.updateState(this.textState, { isThinking: !1 });
|
|
248
|
+
}, "onDone"), m = /* @__PURE__ */ h((g) => {
|
|
249
|
+
const v = this.sharedMessages.value, I = v[v.length - 1];
|
|
250
|
+
if (I?.id === l && !I.text && (this.sharedMessages.value = v.slice(0, -1)), typeof g == "object" && g.code && g.error) {
|
|
251
|
+
const { bucket: re, actionUrl: $, actionLabel: V, help: te } = g;
|
|
252
|
+
if (re !== void 0 || Fs.has(g.code)) {
|
|
253
|
+
const Re = re ?? (cs.has(g.code) ? "account" : "error"), be = {
|
|
254
|
+
code: g.code,
|
|
271
255
|
bucket: Re,
|
|
272
|
-
...
|
|
273
|
-
|
|
256
|
+
...V ? { actionLabel: V } : {},
|
|
257
|
+
...$ ? { actionUrl: $ } : {},
|
|
274
258
|
...te ? { help: te } : {}
|
|
275
259
|
};
|
|
276
|
-
this.addMessage(
|
|
260
|
+
this.addMessage(g.error, "system", void 0, be), Re === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
|
|
277
261
|
} else
|
|
278
|
-
this.handleError(new Error(
|
|
262
|
+
this.handleError(new Error(g.error));
|
|
279
263
|
return;
|
|
280
264
|
}
|
|
281
|
-
const z = typeof
|
|
282
|
-
this.isTransientError(z) ? (this.logger.warn("Chat turn failed (transient):", { raw: z, friendly:
|
|
283
|
-
}, "onError"),
|
|
284
|
-
this.addMessage(
|
|
265
|
+
const z = typeof g == "string" ? g : g.error, X = this.mapChatError(z);
|
|
266
|
+
this.isTransientError(z) ? (this.logger.warn("Chat turn failed (transient):", { raw: z, friendly: X }), this.addMessage(X, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(X), z);
|
|
267
|
+
}, "onError"), b = /* @__PURE__ */ h((g) => {
|
|
268
|
+
this.addMessage(g, "system");
|
|
285
269
|
}, "onStatus");
|
|
286
270
|
try {
|
|
287
|
-
const
|
|
271
|
+
const g = r ? r({
|
|
288
272
|
message: e,
|
|
289
273
|
attachments: n,
|
|
290
274
|
conversationId: this.conversationId,
|
|
291
275
|
history: this.buildHistory(),
|
|
292
276
|
onDelta: c,
|
|
293
|
-
onMessage:
|
|
294
|
-
onDone:
|
|
295
|
-
onError:
|
|
296
|
-
onStatus:
|
|
277
|
+
onMessage: x,
|
|
278
|
+
onDone: p,
|
|
279
|
+
onError: m,
|
|
280
|
+
onStatus: b
|
|
297
281
|
}) : s.chat.chatStreamPublic({
|
|
298
282
|
handle: this._agent.handle.value,
|
|
299
283
|
message: e,
|
|
@@ -301,17 +285,17 @@ Current User:
|
|
|
301
285
|
anonymousId: s.user.generateAnonId(),
|
|
302
286
|
context: this.getDynamicSettings().context || void 0,
|
|
303
287
|
onDelta: c,
|
|
304
|
-
onMessage:
|
|
305
|
-
onDone:
|
|
306
|
-
onError:
|
|
307
|
-
onStatus:
|
|
288
|
+
onMessage: x,
|
|
289
|
+
onDone: p,
|
|
290
|
+
onError: m,
|
|
291
|
+
onStatus: b
|
|
308
292
|
});
|
|
309
293
|
await Promise.race([
|
|
310
|
-
|
|
311
|
-
new Promise((
|
|
294
|
+
g,
|
|
295
|
+
new Promise((v, I) => setTimeout(() => I(new Error("timed out")), Bs))
|
|
312
296
|
]);
|
|
313
|
-
} catch (
|
|
314
|
-
|
|
297
|
+
} catch (g) {
|
|
298
|
+
m(g.message || "Something went wrong");
|
|
315
299
|
}
|
|
316
300
|
}
|
|
317
301
|
buildHistory() {
|
|
@@ -327,38 +311,34 @@ Current User:
|
|
|
327
311
|
const n = this.sharedMessages.value;
|
|
328
312
|
this.sharedMessages.value = [...e.messages, ...n];
|
|
329
313
|
}
|
|
330
|
-
/** Reset conversation state so the next message starts a fresh server session. */
|
|
331
|
-
resetConversation() {
|
|
332
|
-
this.conversationId = `conv_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
|
|
333
|
-
}
|
|
334
314
|
async destroy() {
|
|
335
315
|
await this.endConversation();
|
|
336
316
|
}
|
|
337
317
|
};
|
|
338
|
-
|
|
339
|
-
let Pn =
|
|
318
|
+
h(dn, "AgentChatController");
|
|
319
|
+
let Pn = dn;
|
|
340
320
|
function Nn(a) {
|
|
341
321
|
return a ? typeof a == "string" ? a : a.src || "" : "";
|
|
342
322
|
}
|
|
343
|
-
|
|
344
|
-
function
|
|
323
|
+
h(Nn, "getImageSrc");
|
|
324
|
+
function Xi(a) {
|
|
345
325
|
return Nn(a.cover) || Nn(a.avatar) || os(a.name);
|
|
346
326
|
}
|
|
347
|
-
|
|
327
|
+
h(Xi, "getAgentAvatarUrl");
|
|
348
328
|
function $n(a) {
|
|
349
329
|
const t = a.target;
|
|
350
330
|
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = os());
|
|
351
331
|
}
|
|
352
|
-
|
|
353
|
-
function
|
|
332
|
+
h($n, "handleImageError");
|
|
333
|
+
function Ki(a) {
|
|
354
334
|
const { template: t, agent: e } = a;
|
|
355
335
|
return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
|
|
356
336
|
}
|
|
357
|
-
|
|
337
|
+
h(Ki, "parseButtonTemplate");
|
|
358
338
|
const Hs = {
|
|
359
339
|
key: 0,
|
|
360
340
|
class: "absolute inset-0 flex items-center justify-center"
|
|
361
|
-
},
|
|
341
|
+
}, Qi = /* @__PURE__ */ ve({
|
|
362
342
|
__name: "ElAgentButton",
|
|
363
343
|
props: {
|
|
364
344
|
theme: { default: "primary" },
|
|
@@ -368,42 +348,42 @@ const Hs = {
|
|
|
368
348
|
iconAfter: {}
|
|
369
349
|
},
|
|
370
350
|
setup(a) {
|
|
371
|
-
const t =
|
|
351
|
+
const t = B(() => ({
|
|
372
352
|
primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
|
|
373
353
|
green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
|
|
374
354
|
red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
|
|
375
355
|
default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20"
|
|
376
|
-
})[a.theme]), e =
|
|
356
|
+
})[a.theme]), e = B(() => ({
|
|
377
357
|
sm: "px-4 py-2 text-sm",
|
|
378
358
|
md: "px-6 py-3 text-base",
|
|
379
359
|
lg: "px-8 py-4 text-base"
|
|
380
|
-
})[a.size]), n =
|
|
360
|
+
})[a.size]), n = B(() => ({
|
|
381
361
|
sm: "size-4",
|
|
382
362
|
md: "size-4",
|
|
383
363
|
lg: "size-5"
|
|
384
364
|
})[a.size]);
|
|
385
|
-
return (
|
|
386
|
-
class:
|
|
365
|
+
return (r, s) => (y(), T("button", {
|
|
366
|
+
class: E(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
|
|
387
367
|
}, [
|
|
388
|
-
a.loading ? (
|
|
368
|
+
a.loading ? (y(), T("div", Hs, [...s[0] || (s[0] = [
|
|
389
369
|
A("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
|
|
390
|
-
])])) :
|
|
370
|
+
])])) : j("", !0),
|
|
391
371
|
A("span", {
|
|
392
|
-
class:
|
|
372
|
+
class: E(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
|
|
393
373
|
}, [
|
|
394
|
-
a.icon ? (
|
|
374
|
+
a.icon ? (y(), T("i", {
|
|
395
375
|
key: 0,
|
|
396
|
-
class:
|
|
397
|
-
}, null, 2)) :
|
|
398
|
-
|
|
399
|
-
a.iconAfter ? (
|
|
376
|
+
class: E([a.icon, n.value])
|
|
377
|
+
}, null, 2)) : j("", !0),
|
|
378
|
+
nn(r.$slots, "default"),
|
|
379
|
+
a.iconAfter ? (y(), T("i", {
|
|
400
380
|
key: 1,
|
|
401
|
-
class:
|
|
402
|
-
}, null, 2)) :
|
|
381
|
+
class: E([a.iconAfter, n.value])
|
|
382
|
+
}, null, 2)) : j("", !0)
|
|
403
383
|
], 2)
|
|
404
384
|
], 2));
|
|
405
385
|
}
|
|
406
|
-
}), Gs = ["value"],
|
|
386
|
+
}), Gs = ["value"], Ji = /* @__PURE__ */ ve({
|
|
407
387
|
__name: "AgentInputEmail",
|
|
408
388
|
props: {
|
|
409
389
|
modelValue: { default: "" }
|
|
@@ -411,17 +391,17 @@ const Hs = {
|
|
|
411
391
|
emits: ["update:modelValue"],
|
|
412
392
|
setup(a, { emit: t }) {
|
|
413
393
|
const e = t;
|
|
414
|
-
return (n,
|
|
394
|
+
return (n, r) => (y(), T("input", {
|
|
415
395
|
type: "email",
|
|
416
396
|
autocomplete: "email",
|
|
417
397
|
placeholder: "Enter your email",
|
|
418
398
|
value: a.modelValue,
|
|
419
399
|
class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-all",
|
|
420
400
|
style: { "font-size": "16px" },
|
|
421
|
-
onInput:
|
|
401
|
+
onInput: r[0] || (r[0] = (s) => e("update:modelValue", s.target.value))
|
|
422
402
|
}, null, 40, Gs));
|
|
423
403
|
}
|
|
424
|
-
}), js = { class: "flex gap-1.5 justify-center" }, Ws = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"],
|
|
404
|
+
}), js = { class: "flex gap-1.5 justify-center" }, Ws = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], ea = /* @__PURE__ */ ve({
|
|
425
405
|
__name: "AgentInputOneTimeCode",
|
|
426
406
|
props: {
|
|
427
407
|
modelValue: {},
|
|
@@ -430,73 +410,73 @@ const Hs = {
|
|
|
430
410
|
},
|
|
431
411
|
emits: ["update:modelValue", "autoSubmit"],
|
|
432
412
|
setup(a, { emit: t }) {
|
|
433
|
-
const e = a, n = t,
|
|
434
|
-
|
|
435
|
-
e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) &&
|
|
436
|
-
}),
|
|
437
|
-
s.value =
|
|
438
|
-
}),
|
|
439
|
-
const
|
|
440
|
-
n("update:modelValue",
|
|
413
|
+
const e = a, n = t, r = Q([]), s = Q(Array.from({ length: e.length }).fill("")), l = Q(!1);
|
|
414
|
+
Et(() => {
|
|
415
|
+
e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && r.value[0]?.focus();
|
|
416
|
+
}), Xe(() => e.modelValue, (p) => {
|
|
417
|
+
s.value = p ? p.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
|
|
418
|
+
}), Xe(s, () => {
|
|
419
|
+
const p = s.value.filter(Boolean).join("");
|
|
420
|
+
n("update:modelValue", p), p.length === e.length && n("autoSubmit", p);
|
|
441
421
|
}, { deep: !0 });
|
|
442
|
-
function o(
|
|
443
|
-
|
|
444
|
-
const
|
|
445
|
-
if (
|
|
446
|
-
s.value =
|
|
447
|
-
|
|
422
|
+
function o(p, m) {
|
|
423
|
+
m.preventDefault(), l.value = !0;
|
|
424
|
+
const b = (m.clipboardData?.getData("text") || "").replace(/\D/g, "");
|
|
425
|
+
if (b.length === e.length)
|
|
426
|
+
s.value = b.split(""), setTimeout(() => {
|
|
427
|
+
r.value[e.length - 1]?.focus(), l.value = !1;
|
|
448
428
|
}, 10);
|
|
449
429
|
else {
|
|
450
|
-
const
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
}), s.value =
|
|
454
|
-
const
|
|
430
|
+
const g = [...s.value];
|
|
431
|
+
b.split("").slice(0, e.length - p).forEach((I, z) => {
|
|
432
|
+
g[p + z] = I;
|
|
433
|
+
}), s.value = g;
|
|
434
|
+
const v = Math.min(p + b.length, e.length - 1);
|
|
455
435
|
setTimeout(() => {
|
|
456
|
-
|
|
436
|
+
r.value[v]?.focus(), l.value = !1;
|
|
457
437
|
}, 10);
|
|
458
438
|
}
|
|
459
439
|
}
|
|
460
|
-
|
|
461
|
-
function d(
|
|
462
|
-
const
|
|
463
|
-
s.value[
|
|
440
|
+
h(o, "onPaste");
|
|
441
|
+
function d(p, m) {
|
|
442
|
+
const b = m.target.value.slice(-1).replace(/\D/g, "");
|
|
443
|
+
s.value[p] = b, b && p < e.length - 1 && r.value[p + 1]?.focus();
|
|
464
444
|
}
|
|
465
|
-
|
|
466
|
-
function c(
|
|
467
|
-
|
|
445
|
+
h(d, "onInput");
|
|
446
|
+
function c(p, m) {
|
|
447
|
+
m.key === "Backspace" ? (m.preventDefault(), s.value[p] = "", p > 0 && r.value[p - 1]?.focus()) : m.key === "ArrowLeft" && p > 0 ? r.value[p - 1]?.focus() : m.key === "ArrowRight" && p < e.length - 1 && r.value[p + 1]?.focus();
|
|
468
448
|
}
|
|
469
|
-
|
|
470
|
-
function
|
|
471
|
-
if (
|
|
472
|
-
for (let
|
|
473
|
-
s.value[
|
|
449
|
+
h(c, "onKeydown");
|
|
450
|
+
function x(p) {
|
|
451
|
+
if (r.value[p]?.select(), !l.value && s.value[p])
|
|
452
|
+
for (let m = p; m < e.length; m++)
|
|
453
|
+
s.value[m] = "";
|
|
474
454
|
}
|
|
475
|
-
return
|
|
476
|
-
(
|
|
477
|
-
key:
|
|
455
|
+
return h(x, "onFocus"), (p, m) => (y(), T("div", js, [
|
|
456
|
+
(y(!0), T(Se, null, ot(a.length, (b) => rs((y(), T("input", {
|
|
457
|
+
key: b,
|
|
478
458
|
ref_for: !0,
|
|
479
|
-
ref: /* @__PURE__ */
|
|
480
|
-
"onUpdate:modelValue": /* @__PURE__ */
|
|
459
|
+
ref: /* @__PURE__ */ h((g) => r.value[b - 1] = g, "ref"),
|
|
460
|
+
"onUpdate:modelValue": /* @__PURE__ */ h((g) => s.value[b - 1] = g, "onUpdate:modelValue"),
|
|
481
461
|
type: "text",
|
|
482
462
|
inputmode: "numeric",
|
|
483
463
|
autocomplete: "one-time-code",
|
|
484
464
|
class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
|
|
485
465
|
style: { "font-size": "16px" },
|
|
486
466
|
maxlength: "1",
|
|
487
|
-
onInput: /* @__PURE__ */
|
|
488
|
-
onKeydown: /* @__PURE__ */
|
|
489
|
-
onPaste: /* @__PURE__ */
|
|
490
|
-
onFocus: /* @__PURE__ */
|
|
467
|
+
onInput: /* @__PURE__ */ h((g) => d(b - 1, g), "onInput"),
|
|
468
|
+
onKeydown: /* @__PURE__ */ h((g) => c(b - 1, g), "onKeydown"),
|
|
469
|
+
onPaste: /* @__PURE__ */ h((g) => o(b - 1, g), "onPaste"),
|
|
470
|
+
onFocus: /* @__PURE__ */ h((g) => x(b - 1), "onFocus")
|
|
491
471
|
}, null, 40, Ws)), [
|
|
492
|
-
[
|
|
472
|
+
[is, s.value[b - 1]]
|
|
493
473
|
])), 128))
|
|
494
474
|
]));
|
|
495
475
|
}
|
|
496
476
|
}), qs = { class: "relative flex-shrink-0" }, Vs = ["src", "alt"], Ys = { class: "absolute top-1 right-1" }, Zs = {
|
|
497
477
|
key: 1,
|
|
498
478
|
class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
|
|
499
|
-
}, Xs = { class: "min-w-0" }, Ks = /* @__PURE__ */
|
|
479
|
+
}, Xs = { class: "min-w-0" }, Ks = /* @__PURE__ */ ve({
|
|
500
480
|
__name: "ElModeHeader",
|
|
501
481
|
props: {
|
|
502
482
|
agent: {},
|
|
@@ -505,42 +485,42 @@ const Hs = {
|
|
|
505
485
|
layout: { default: "centered" }
|
|
506
486
|
},
|
|
507
487
|
setup(a) {
|
|
508
|
-
return (t, e) => (
|
|
509
|
-
class:
|
|
488
|
+
return (t, e) => (y(), T("div", {
|
|
489
|
+
class: E(["flex gap-4", [
|
|
510
490
|
a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
|
|
511
491
|
]])
|
|
512
492
|
}, [
|
|
513
493
|
A("div", qs, [
|
|
514
494
|
A("div", {
|
|
515
|
-
class:
|
|
495
|
+
class: E(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
|
|
516
496
|
}, [
|
|
517
497
|
A("img", {
|
|
518
498
|
src: a.agent.avatarUrl.value,
|
|
519
499
|
alt: a.agent.displayName.value,
|
|
520
500
|
class: "w-full h-full object-cover",
|
|
521
501
|
onError: e[0] || (e[0] = //@ts-ignore
|
|
522
|
-
(...n) =>
|
|
502
|
+
(...n) => Qt($n) && Qt($n)(...n))
|
|
523
503
|
}, null, 40, Vs)
|
|
524
504
|
], 2),
|
|
525
505
|
A("div", Ys, [
|
|
526
|
-
a.isOnline ? (
|
|
506
|
+
a.isOnline ? (y(), T(Se, { key: 0 }, [
|
|
527
507
|
e[1] || (e[1] = A("div", {
|
|
528
508
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
529
509
|
style: { "animation-duration": "3s" }
|
|
530
510
|
}, null, -1)),
|
|
531
511
|
e[2] || (e[2] = A("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
|
|
532
|
-
], 64)) : (
|
|
512
|
+
], 64)) : (y(), T("div", Zs))
|
|
533
513
|
])
|
|
534
514
|
]),
|
|
535
515
|
A("div", Xs, [
|
|
536
516
|
A("h1", {
|
|
537
|
-
class:
|
|
517
|
+
class: E(["font-light text-white mb-1 truncate", [
|
|
538
518
|
a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
|
|
539
519
|
a.layout === "horizontal" ? "text-white/95" : ""
|
|
540
520
|
]])
|
|
541
521
|
}, le(a.agent.displayName.value), 3),
|
|
542
522
|
A("p", {
|
|
543
|
-
class:
|
|
523
|
+
class: E(["font-light line-clamp-1", [
|
|
544
524
|
a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
|
|
545
525
|
a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
|
|
546
526
|
]])
|
|
@@ -554,153 +534,153 @@ const {
|
|
|
554
534
|
setPrototypeOf: Un,
|
|
555
535
|
isFrozen: Qs,
|
|
556
536
|
getPrototypeOf: Js,
|
|
557
|
-
getOwnPropertyDescriptor:
|
|
537
|
+
getOwnPropertyDescriptor: er
|
|
558
538
|
} = Object;
|
|
559
539
|
let {
|
|
560
540
|
freeze: se,
|
|
561
541
|
seal: ce,
|
|
562
|
-
create:
|
|
542
|
+
create: je
|
|
563
543
|
} = Object, {
|
|
564
|
-
apply:
|
|
565
|
-
construct:
|
|
544
|
+
apply: Jt,
|
|
545
|
+
construct: en
|
|
566
546
|
} = typeof Reflect < "u" && Reflect;
|
|
567
|
-
se || (se = /* @__PURE__ */
|
|
547
|
+
se || (se = /* @__PURE__ */ h(function(t) {
|
|
568
548
|
return t;
|
|
569
549
|
}, "freeze"));
|
|
570
|
-
ce || (ce = /* @__PURE__ */
|
|
550
|
+
ce || (ce = /* @__PURE__ */ h(function(t) {
|
|
571
551
|
return t;
|
|
572
552
|
}, "seal"));
|
|
573
|
-
|
|
574
|
-
for (var n = arguments.length,
|
|
575
|
-
|
|
576
|
-
return t.apply(e,
|
|
553
|
+
Jt || (Jt = /* @__PURE__ */ h(function(t, e) {
|
|
554
|
+
for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
|
|
555
|
+
r[s - 2] = arguments[s];
|
|
556
|
+
return t.apply(e, r);
|
|
577
557
|
}, "apply"));
|
|
578
|
-
|
|
579
|
-
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0),
|
|
580
|
-
n[
|
|
558
|
+
en || (en = /* @__PURE__ */ h(function(t) {
|
|
559
|
+
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
|
|
560
|
+
n[r - 1] = arguments[r];
|
|
581
561
|
return new t(...n);
|
|
582
562
|
}, "construct"));
|
|
583
|
-
const st =
|
|
584
|
-
function
|
|
563
|
+
const st = W(Array.prototype.forEach), tr = W(Array.prototype.lastIndexOf), Bn = W(Array.prototype.pop), rt = W(Array.prototype.push), nr = W(Array.prototype.splice), ne = Array.isArray, ct = W(String.prototype.toLowerCase), qt = W(String.prototype.toString), Fn = W(String.prototype.match), Ge = W(String.prototype.replace), Hn = W(String.prototype.indexOf), sr = W(String.prototype.trim), rr = W(Number.prototype.toString), ir = W(Boolean.prototype.toString), Gn = typeof BigInt > "u" ? null : W(BigInt.prototype.toString), jn = typeof Symbol > "u" ? null : W(Symbol.prototype.toString), U = W(Object.prototype.hasOwnProperty), it = W(Object.prototype.toString), K = W(RegExp.prototype.test), kt = ar(TypeError);
|
|
564
|
+
function W(a) {
|
|
585
565
|
return function(t) {
|
|
586
566
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
587
|
-
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0),
|
|
588
|
-
n[
|
|
589
|
-
return
|
|
567
|
+
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
|
|
568
|
+
n[r - 1] = arguments[r];
|
|
569
|
+
return Jt(a, t, n);
|
|
590
570
|
};
|
|
591
571
|
}
|
|
592
|
-
|
|
593
|
-
function
|
|
572
|
+
h(W, "unapply");
|
|
573
|
+
function ar(a) {
|
|
594
574
|
return function() {
|
|
595
575
|
for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
|
|
596
576
|
e[n] = arguments[n];
|
|
597
|
-
return
|
|
577
|
+
return en(a, e);
|
|
598
578
|
};
|
|
599
579
|
}
|
|
600
|
-
|
|
580
|
+
h(ar, "unconstruct");
|
|
601
581
|
function R(a, t) {
|
|
602
582
|
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ct;
|
|
603
583
|
if (Un && Un(a, null), !ne(t))
|
|
604
584
|
return a;
|
|
605
585
|
let n = t.length;
|
|
606
586
|
for (; n--; ) {
|
|
607
|
-
let
|
|
608
|
-
if (typeof
|
|
609
|
-
const s = e(
|
|
610
|
-
s !==
|
|
587
|
+
let r = t[n];
|
|
588
|
+
if (typeof r == "string") {
|
|
589
|
+
const s = e(r);
|
|
590
|
+
s !== r && (Qs(t) || (t[n] = s), r = s);
|
|
611
591
|
}
|
|
612
|
-
a[
|
|
592
|
+
a[r] = !0;
|
|
613
593
|
}
|
|
614
594
|
return a;
|
|
615
595
|
}
|
|
616
|
-
|
|
617
|
-
function
|
|
596
|
+
h(R, "addToSet");
|
|
597
|
+
function lr(a) {
|
|
618
598
|
for (let t = 0; t < a.length; t++)
|
|
619
|
-
|
|
599
|
+
U(a, t) || (a[t] = null);
|
|
620
600
|
return a;
|
|
621
601
|
}
|
|
622
|
-
|
|
602
|
+
h(lr, "cleanArray");
|
|
623
603
|
function ae(a) {
|
|
624
|
-
const t =
|
|
604
|
+
const t = je(null);
|
|
625
605
|
for (const [e, n] of us(a))
|
|
626
|
-
|
|
606
|
+
U(a, e) && (ne(n) ? t[e] = lr(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = ae(n) : t[e] = n);
|
|
627
607
|
return t;
|
|
628
608
|
}
|
|
629
|
-
|
|
630
|
-
function
|
|
609
|
+
h(ae, "clone");
|
|
610
|
+
function or(a) {
|
|
631
611
|
switch (typeof a) {
|
|
632
612
|
case "string":
|
|
633
613
|
return a;
|
|
634
614
|
case "number":
|
|
635
|
-
return
|
|
615
|
+
return rr(a);
|
|
636
616
|
case "boolean":
|
|
637
|
-
return
|
|
617
|
+
return ir(a);
|
|
638
618
|
case "bigint":
|
|
639
619
|
return Gn ? Gn(a) : "0";
|
|
640
620
|
case "symbol":
|
|
641
621
|
return jn ? jn(a) : "Symbol()";
|
|
642
622
|
case "undefined":
|
|
643
|
-
return
|
|
623
|
+
return it(a);
|
|
644
624
|
case "function":
|
|
645
625
|
case "object": {
|
|
646
626
|
if (a === null)
|
|
647
|
-
return
|
|
648
|
-
const t = a, e =
|
|
627
|
+
return it(a);
|
|
628
|
+
const t = a, e = We(t, "toString");
|
|
649
629
|
if (typeof e == "function") {
|
|
650
630
|
const n = e(t);
|
|
651
|
-
return typeof n == "string" ? n :
|
|
631
|
+
return typeof n == "string" ? n : it(n);
|
|
652
632
|
}
|
|
653
|
-
return
|
|
633
|
+
return it(a);
|
|
654
634
|
}
|
|
655
635
|
default:
|
|
656
|
-
return
|
|
636
|
+
return it(a);
|
|
657
637
|
}
|
|
658
638
|
}
|
|
659
|
-
|
|
660
|
-
function
|
|
639
|
+
h(or, "stringifyValue");
|
|
640
|
+
function We(a, t) {
|
|
661
641
|
for (; a !== null; ) {
|
|
662
|
-
const n =
|
|
642
|
+
const n = er(a, t);
|
|
663
643
|
if (n) {
|
|
664
644
|
if (n.get)
|
|
665
|
-
return
|
|
645
|
+
return W(n.get);
|
|
666
646
|
if (typeof n.value == "function")
|
|
667
|
-
return
|
|
647
|
+
return W(n.value);
|
|
668
648
|
}
|
|
669
649
|
a = Js(a);
|
|
670
650
|
}
|
|
671
651
|
function e() {
|
|
672
652
|
return null;
|
|
673
653
|
}
|
|
674
|
-
return
|
|
654
|
+
return h(e, "fallbackValue"), e;
|
|
675
655
|
}
|
|
676
|
-
|
|
677
|
-
function
|
|
656
|
+
h(We, "lookupGetter");
|
|
657
|
+
function cr(a) {
|
|
678
658
|
try {
|
|
679
659
|
return K(a, ""), !0;
|
|
680
660
|
} catch {
|
|
681
661
|
return !1;
|
|
682
662
|
}
|
|
683
663
|
}
|
|
684
|
-
|
|
685
|
-
const Wn = se(["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"]),
|
|
664
|
+
h(cr, "isRegex");
|
|
665
|
+
const Wn = se(["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"]), Vt = se(["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"]), Yt = se(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), ur = se(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Zt = se(["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"]), hr = se(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), qn = se(["#text"]), Vn = se(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "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"]), Xt = se(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Yn = se(["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"]), wt = se(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), pr = ce(/\{\{[\w\W]*|[\w\W]*\}\}/gm), dr = ce(/<%[\w\W]*|[\w\W]*%>/gm), fr = ce(/\$\{[\w\W]*/gm), gr = ce(/^data-[\-\w.\u00B7-\uFFFF]+$/), mr = ce(/^aria-[\-\w]+$/), hs = ce(
|
|
686
666
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
687
667
|
// eslint-disable-line no-useless-escape
|
|
688
|
-
),
|
|
668
|
+
), xr = ce(/^(?:\w+script|data):/i), br = ce(
|
|
689
669
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
690
670
|
// eslint-disable-line no-control-regex
|
|
691
|
-
), ps = ce(/^html$/i),
|
|
671
|
+
), ps = ce(/^html$/i), kr = ce(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
692
672
|
var Zn = /* @__PURE__ */ Object.freeze({
|
|
693
673
|
__proto__: null,
|
|
694
|
-
ARIA_ATTR:
|
|
695
|
-
ATTR_WHITESPACE:
|
|
696
|
-
CUSTOM_ELEMENT:
|
|
697
|
-
DATA_ATTR:
|
|
674
|
+
ARIA_ATTR: mr,
|
|
675
|
+
ATTR_WHITESPACE: br,
|
|
676
|
+
CUSTOM_ELEMENT: kr,
|
|
677
|
+
DATA_ATTR: gr,
|
|
698
678
|
DOCTYPE_NAME: ps,
|
|
699
|
-
ERB_EXPR:
|
|
679
|
+
ERB_EXPR: dr,
|
|
700
680
|
IS_ALLOWED_URI: hs,
|
|
701
|
-
IS_SCRIPT_OR_DATA:
|
|
702
|
-
MUSTACHE_EXPR:
|
|
703
|
-
TMPLIT_EXPR:
|
|
681
|
+
IS_SCRIPT_OR_DATA: xr,
|
|
682
|
+
MUSTACHE_EXPR: pr,
|
|
683
|
+
TMPLIT_EXPR: fr
|
|
704
684
|
});
|
|
705
685
|
const at = {
|
|
706
686
|
element: 1,
|
|
@@ -709,14 +689,14 @@ const at = {
|
|
|
709
689
|
progressingInstruction: 7,
|
|
710
690
|
comment: 8,
|
|
711
691
|
document: 9
|
|
712
|
-
},
|
|
692
|
+
}, wr = /* @__PURE__ */ h(function() {
|
|
713
693
|
return typeof window > "u" ? null : window;
|
|
714
|
-
}, "getGlobal"),
|
|
694
|
+
}, "getGlobal"), vr = /* @__PURE__ */ h(function(t, e) {
|
|
715
695
|
if (typeof t != "object" || typeof t.createPolicy != "function")
|
|
716
696
|
return null;
|
|
717
697
|
let n = null;
|
|
718
|
-
const
|
|
719
|
-
e && e.hasAttribute(
|
|
698
|
+
const r = "data-tt-policy-suffix";
|
|
699
|
+
e && e.hasAttribute(r) && (n = e.getAttribute(r));
|
|
720
700
|
const s = "dompurify" + (n ? "#" + n : "");
|
|
721
701
|
try {
|
|
722
702
|
return t.createPolicy(s, {
|
|
@@ -730,7 +710,7 @@ const at = {
|
|
|
730
710
|
} catch {
|
|
731
711
|
return console.warn("TrustedTypes policy " + s + " could not be created."), null;
|
|
732
712
|
}
|
|
733
|
-
}, "_createTrustedTypesPolicy"), Xn = /* @__PURE__ */
|
|
713
|
+
}, "_createTrustedTypesPolicy"), Xn = /* @__PURE__ */ h(function() {
|
|
734
714
|
return {
|
|
735
715
|
afterSanitizeAttributes: [],
|
|
736
716
|
afterSanitizeElements: [],
|
|
@@ -744,56 +724,56 @@ const at = {
|
|
|
744
724
|
};
|
|
745
725
|
}, "_createHooksMap");
|
|
746
726
|
function ds() {
|
|
747
|
-
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
748
|
-
const t = /* @__PURE__ */
|
|
727
|
+
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : wr();
|
|
728
|
+
const t = /* @__PURE__ */ h((S) => ds(S), "DOMPurify");
|
|
749
729
|
if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !== at.document || !a.Element)
|
|
750
730
|
return t.isSupported = !1, t;
|
|
751
731
|
let {
|
|
752
732
|
document: e
|
|
753
733
|
} = a;
|
|
754
|
-
const n = e,
|
|
734
|
+
const n = e, r = n.currentScript, {
|
|
755
735
|
DocumentFragment: s,
|
|
756
736
|
HTMLTemplateElement: l,
|
|
757
737
|
Node: o,
|
|
758
738
|
Element: d,
|
|
759
739
|
NodeFilter: c,
|
|
760
|
-
NamedNodeMap:
|
|
761
|
-
HTMLFormElement:
|
|
762
|
-
DOMParser:
|
|
763
|
-
trustedTypes:
|
|
764
|
-
} = a,
|
|
740
|
+
NamedNodeMap: x = a.NamedNodeMap || a.MozNamedAttrMap,
|
|
741
|
+
HTMLFormElement: p,
|
|
742
|
+
DOMParser: m,
|
|
743
|
+
trustedTypes: b
|
|
744
|
+
} = a, g = d.prototype, v = We(g, "cloneNode"), I = We(g, "remove"), z = We(g, "nextSibling"), X = We(g, "childNodes"), re = We(g, "parentNode");
|
|
765
745
|
if (typeof l == "function") {
|
|
766
|
-
const
|
|
767
|
-
|
|
746
|
+
const S = e.createElement("template");
|
|
747
|
+
S.content && S.content.ownerDocument && (e = S.content.ownerDocument);
|
|
768
748
|
}
|
|
769
|
-
let
|
|
749
|
+
let $, V = "";
|
|
770
750
|
const {
|
|
771
751
|
implementation: te,
|
|
772
752
|
createNodeIterator: fe,
|
|
773
753
|
createDocumentFragment: Re,
|
|
774
|
-
getElementsByTagName:
|
|
754
|
+
getElementsByTagName: be
|
|
775
755
|
} = e, {
|
|
776
756
|
importNode: It
|
|
777
757
|
} = n;
|
|
778
|
-
let
|
|
779
|
-
t.isSupported = typeof us == "function" && typeof
|
|
758
|
+
let Y = Xn();
|
|
759
|
+
t.isSupported = typeof us == "function" && typeof re == "function" && te && te.createHTMLDocument !== void 0;
|
|
780
760
|
const {
|
|
781
|
-
MUSTACHE_EXPR:
|
|
782
|
-
ERB_EXPR:
|
|
761
|
+
MUSTACHE_EXPR: C,
|
|
762
|
+
ERB_EXPR: Ie,
|
|
783
763
|
TMPLIT_EXPR: ye,
|
|
784
|
-
DATA_ATTR:
|
|
785
|
-
ARIA_ATTR:
|
|
786
|
-
IS_SCRIPT_OR_DATA:
|
|
764
|
+
DATA_ATTR: Qe,
|
|
765
|
+
ARIA_ATTR: Ct,
|
|
766
|
+
IS_SCRIPT_OR_DATA: Dt,
|
|
787
767
|
ATTR_WHITESPACE: pt,
|
|
788
|
-
CUSTOM_ELEMENT:
|
|
768
|
+
CUSTOM_ELEMENT: Mt
|
|
789
769
|
} = Zn;
|
|
790
770
|
let {
|
|
791
771
|
IS_ALLOWED_URI: dt
|
|
792
772
|
} = Zn, F = null;
|
|
793
|
-
const
|
|
773
|
+
const Je = R({}, [...Wn, ...Vt, ...Yt, ...Zt, ...qn]);
|
|
794
774
|
let H = null;
|
|
795
|
-
const
|
|
796
|
-
let
|
|
775
|
+
const _ = R({}, [...Vn, ...Xt, ...Yn, ...wt]);
|
|
776
|
+
let f = Object.seal(je(null, {
|
|
797
777
|
tagNameCheck: {
|
|
798
778
|
writable: !0,
|
|
799
779
|
configurable: !1,
|
|
@@ -812,8 +792,8 @@ function ds() {
|
|
|
812
792
|
enumerable: !0,
|
|
813
793
|
value: !1
|
|
814
794
|
}
|
|
815
|
-
})),
|
|
816
|
-
const
|
|
795
|
+
})), k = null, L = null;
|
|
796
|
+
const N = Object.seal(je(null, {
|
|
817
797
|
tagCheck: {
|
|
818
798
|
writable: !0,
|
|
819
799
|
configurable: !1,
|
|
@@ -827,172 +807,172 @@ function ds() {
|
|
|
827
807
|
value: null
|
|
828
808
|
}
|
|
829
809
|
}));
|
|
830
|
-
let
|
|
810
|
+
let ke = !0, Ne = !0, $e = !1, fn = !0, Ce = !1, et = !0, De = !1, Lt = !1, Ot = !1, Ue = !1, ft = !1, gt = !1, gn = !0, mn = !1;
|
|
831
811
|
const xn = "user-content-";
|
|
832
|
-
let
|
|
833
|
-
const
|
|
812
|
+
let zt = !0, tt = !1, Be = {}, ge = null;
|
|
813
|
+
const Pt = R({}, ["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"]);
|
|
834
814
|
let bn = null;
|
|
835
815
|
const kn = R({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
836
|
-
let
|
|
837
|
-
const
|
|
838
|
-
let
|
|
839
|
-
const Ss = R({}, [
|
|
840
|
-
let
|
|
816
|
+
let Nt = null;
|
|
817
|
+
const wn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), mt = "http://www.w3.org/1998/Math/MathML", xt = "http://www.w3.org/2000/svg", me = "http://www.w3.org/1999/xhtml";
|
|
818
|
+
let Fe = me, $t = !1, Ut = null;
|
|
819
|
+
const Ss = R({}, [mt, xt, me], qt);
|
|
820
|
+
let Bt = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ft = R({}, ["annotation-xml"]);
|
|
841
821
|
const As = R({}, ["title", "style", "font", "a", "script"]);
|
|
842
822
|
let nt = null;
|
|
843
823
|
const Es = ["application/xhtml+xml", "text/html"], _s = "text/html";
|
|
844
|
-
let q = null,
|
|
845
|
-
const Rs = e.createElement("form"),
|
|
846
|
-
return
|
|
847
|
-
}, "isRegexOrFunction"),
|
|
848
|
-
let
|
|
849
|
-
if (
|
|
824
|
+
let q = null, He = null;
|
|
825
|
+
const Rs = e.createElement("form"), vn = /* @__PURE__ */ h(function(i) {
|
|
826
|
+
return i instanceof RegExp || i instanceof Function;
|
|
827
|
+
}, "isRegexOrFunction"), Ht = /* @__PURE__ */ h(function() {
|
|
828
|
+
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
829
|
+
if (He && He === i)
|
|
850
830
|
return;
|
|
851
|
-
(!
|
|
852
|
-
Es.indexOf(
|
|
853
|
-
const
|
|
854
|
-
if (
|
|
855
|
-
if (typeof
|
|
856
|
-
throw
|
|
857
|
-
if (typeof
|
|
858
|
-
throw
|
|
859
|
-
|
|
831
|
+
(!i || typeof i != "object") && (i = {}), i = ae(i), nt = // eslint-disable-next-line unicorn/prefer-includes
|
|
832
|
+
Es.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? _s : i.PARSER_MEDIA_TYPE, q = nt === "application/xhtml+xml" ? qt : ct, F = U(i, "ALLOWED_TAGS") && ne(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, q) : Je, H = U(i, "ALLOWED_ATTR") && ne(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, q) : _, Ut = U(i, "ALLOWED_NAMESPACES") && ne(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, qt) : Ss, Nt = U(i, "ADD_URI_SAFE_ATTR") && ne(i.ADD_URI_SAFE_ATTR) ? R(ae(wn), i.ADD_URI_SAFE_ATTR, q) : wn, bn = U(i, "ADD_DATA_URI_TAGS") && ne(i.ADD_DATA_URI_TAGS) ? R(ae(kn), i.ADD_DATA_URI_TAGS, q) : kn, ge = U(i, "FORBID_CONTENTS") && ne(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, q) : Pt, k = U(i, "FORBID_TAGS") && ne(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, q) : ae({}), L = U(i, "FORBID_ATTR") && ne(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, q) : ae({}), Be = U(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? ae(i.USE_PROFILES) : i.USE_PROFILES : !1, ke = i.ALLOW_ARIA_ATTR !== !1, Ne = i.ALLOW_DATA_ATTR !== !1, $e = i.ALLOW_UNKNOWN_PROTOCOLS || !1, fn = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ce = i.SAFE_FOR_TEMPLATES || !1, et = i.SAFE_FOR_XML !== !1, De = i.WHOLE_DOCUMENT || !1, Ue = i.RETURN_DOM || !1, ft = i.RETURN_DOM_FRAGMENT || !1, gt = i.RETURN_TRUSTED_TYPE || !1, Ot = i.FORCE_BODY || !1, gn = i.SANITIZE_DOM !== !1, mn = i.SANITIZE_NAMED_PROPS || !1, zt = i.KEEP_CONTENT !== !1, tt = i.IN_PLACE || !1, dt = cr(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : hs, Fe = typeof i.NAMESPACE == "string" ? i.NAMESPACE : me, Bt = U(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? ae(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ft = U(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? ae(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
|
|
833
|
+
const u = U(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? ae(i.CUSTOM_ELEMENT_HANDLING) : je(null);
|
|
834
|
+
if (f = je(null), U(u, "tagNameCheck") && vn(u.tagNameCheck) && (f.tagNameCheck = u.tagNameCheck), U(u, "attributeNameCheck") && vn(u.attributeNameCheck) && (f.attributeNameCheck = u.attributeNameCheck), U(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (f.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), Ce && (Ne = !1), ft && (Ue = !0), Be && (F = R({}, qn), H = je(null), Be.html === !0 && (R(F, Wn), R(H, Vn)), Be.svg === !0 && (R(F, Vt), R(H, Xt), R(H, wt)), Be.svgFilters === !0 && (R(F, Yt), R(H, Xt), R(H, wt)), Be.mathMl === !0 && (R(F, Zt), R(H, Yn), R(H, wt))), N.tagCheck = null, N.attributeCheck = null, U(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? N.tagCheck = i.ADD_TAGS : ne(i.ADD_TAGS) && (F === Je && (F = ae(F)), R(F, i.ADD_TAGS, q))), U(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? N.attributeCheck = i.ADD_ATTR : ne(i.ADD_ATTR) && (H === _ && (H = ae(H)), R(H, i.ADD_ATTR, q))), U(i, "ADD_URI_SAFE_ATTR") && ne(i.ADD_URI_SAFE_ATTR) && R(Nt, i.ADD_URI_SAFE_ATTR, q), U(i, "FORBID_CONTENTS") && ne(i.FORBID_CONTENTS) && (ge === Pt && (ge = ae(ge)), R(ge, i.FORBID_CONTENTS, q)), U(i, "ADD_FORBID_CONTENTS") && ne(i.ADD_FORBID_CONTENTS) && (ge === Pt && (ge = ae(ge)), R(ge, i.ADD_FORBID_CONTENTS, q)), zt && (F["#text"] = !0), De && R(F, ["html", "head", "body"]), F.table && (R(F, ["tbody"]), delete k.tbody), i.TRUSTED_TYPES_POLICY) {
|
|
835
|
+
if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
836
|
+
throw kt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
837
|
+
if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
838
|
+
throw kt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
839
|
+
$ = i.TRUSTED_TYPES_POLICY, V = $.createHTML("");
|
|
860
840
|
} else
|
|
861
|
-
|
|
862
|
-
se && se(
|
|
863
|
-
}, "_parseConfig"), yn = R({}, [...
|
|
864
|
-
let
|
|
865
|
-
(!
|
|
866
|
-
namespaceURI:
|
|
841
|
+
$ === void 0 && ($ = vr(b, r)), $ !== null && typeof V == "string" && (V = $.createHTML(""));
|
|
842
|
+
se && se(i), He = i;
|
|
843
|
+
}, "_parseConfig"), yn = R({}, [...Vt, ...Yt, ...ur]), Tn = R({}, [...Zt, ...hr]), Is = /* @__PURE__ */ h(function(i) {
|
|
844
|
+
let u = re(i);
|
|
845
|
+
(!u || !u.tagName) && (u = {
|
|
846
|
+
namespaceURI: Fe,
|
|
867
847
|
tagName: "template"
|
|
868
848
|
});
|
|
869
|
-
const
|
|
870
|
-
return
|
|
871
|
-
}, "_checkValidNamespace"), ue = /* @__PURE__ */
|
|
872
|
-
|
|
873
|
-
element:
|
|
849
|
+
const w = ct(i.tagName), P = ct(u.tagName);
|
|
850
|
+
return Ut[i.namespaceURI] ? i.namespaceURI === xt ? u.namespaceURI === me ? w === "svg" : u.namespaceURI === mt ? w === "svg" && (P === "annotation-xml" || Bt[P]) : !!yn[w] : i.namespaceURI === mt ? u.namespaceURI === me ? w === "math" : u.namespaceURI === xt ? w === "math" && Ft[P] : !!Tn[w] : i.namespaceURI === me ? u.namespaceURI === xt && !Ft[P] || u.namespaceURI === mt && !Bt[P] ? !1 : !Tn[w] && (As[w] || !yn[w]) : !!(nt === "application/xhtml+xml" && Ut[i.namespaceURI]) : !1;
|
|
851
|
+
}, "_checkValidNamespace"), ue = /* @__PURE__ */ h(function(i) {
|
|
852
|
+
rt(t.removed, {
|
|
853
|
+
element: i
|
|
874
854
|
});
|
|
875
855
|
try {
|
|
876
|
-
|
|
856
|
+
re(i).removeChild(i);
|
|
877
857
|
} catch {
|
|
878
|
-
|
|
858
|
+
I(i);
|
|
879
859
|
}
|
|
880
|
-
}, "_forceRemove"), Me = /* @__PURE__ */
|
|
860
|
+
}, "_forceRemove"), Me = /* @__PURE__ */ h(function(i, u) {
|
|
881
861
|
try {
|
|
882
|
-
|
|
883
|
-
attribute:
|
|
884
|
-
from:
|
|
862
|
+
rt(t.removed, {
|
|
863
|
+
attribute: u.getAttributeNode(i),
|
|
864
|
+
from: u
|
|
885
865
|
});
|
|
886
866
|
} catch {
|
|
887
|
-
|
|
867
|
+
rt(t.removed, {
|
|
888
868
|
attribute: null,
|
|
889
|
-
from:
|
|
869
|
+
from: u
|
|
890
870
|
});
|
|
891
871
|
}
|
|
892
|
-
if (
|
|
893
|
-
if (
|
|
872
|
+
if (u.removeAttribute(i), i === "is")
|
|
873
|
+
if (Ue || ft)
|
|
894
874
|
try {
|
|
895
|
-
ue(
|
|
875
|
+
ue(u);
|
|
896
876
|
} catch {
|
|
897
877
|
}
|
|
898
878
|
else
|
|
899
879
|
try {
|
|
900
|
-
|
|
880
|
+
u.setAttribute(i, "");
|
|
901
881
|
} catch {
|
|
902
882
|
}
|
|
903
|
-
}, "_removeAttribute"), Sn = /* @__PURE__ */
|
|
904
|
-
let
|
|
905
|
-
if (
|
|
906
|
-
|
|
883
|
+
}, "_removeAttribute"), Sn = /* @__PURE__ */ h(function(i) {
|
|
884
|
+
let u = null, w = null;
|
|
885
|
+
if (Ot)
|
|
886
|
+
i = "<remove></remove>" + i;
|
|
907
887
|
else {
|
|
908
|
-
const G = Fn(
|
|
909
|
-
|
|
888
|
+
const G = Fn(i, /^[\r\n\t ]+/);
|
|
889
|
+
w = G && G[0];
|
|
910
890
|
}
|
|
911
|
-
nt === "application/xhtml+xml" &&
|
|
912
|
-
const P =
|
|
913
|
-
if (
|
|
891
|
+
nt === "application/xhtml+xml" && Fe === me && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
|
|
892
|
+
const P = $ ? $.createHTML(i) : i;
|
|
893
|
+
if (Fe === me)
|
|
914
894
|
try {
|
|
915
|
-
|
|
895
|
+
u = new m().parseFromString(P, nt);
|
|
916
896
|
} catch {
|
|
917
897
|
}
|
|
918
|
-
if (!
|
|
919
|
-
|
|
898
|
+
if (!u || !u.documentElement) {
|
|
899
|
+
u = te.createDocument(Fe, "template", null);
|
|
920
900
|
try {
|
|
921
|
-
|
|
901
|
+
u.documentElement.innerHTML = $t ? V : P;
|
|
922
902
|
} catch {
|
|
923
903
|
}
|
|
924
904
|
}
|
|
925
|
-
const J =
|
|
926
|
-
return
|
|
927
|
-
}, "_initDocument"), An = /* @__PURE__ */
|
|
905
|
+
const J = u.body || u.documentElement;
|
|
906
|
+
return i && w && J.insertBefore(e.createTextNode(w), J.childNodes[0] || null), Fe === me ? be.call(u, De ? "html" : "body")[0] : De ? u.documentElement : J;
|
|
907
|
+
}, "_initDocument"), An = /* @__PURE__ */ h(function(i) {
|
|
928
908
|
return fe.call(
|
|
929
|
-
|
|
930
|
-
|
|
909
|
+
i.ownerDocument || i,
|
|
910
|
+
i,
|
|
931
911
|
// eslint-disable-next-line no-bitwise
|
|
932
912
|
c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
|
|
933
913
|
null
|
|
934
914
|
);
|
|
935
|
-
}, "_createNodeIterator"),
|
|
936
|
-
return
|
|
937
|
-
}, "_isClobbered"),
|
|
938
|
-
return typeof o == "function" &&
|
|
915
|
+
}, "_createNodeIterator"), Gt = /* @__PURE__ */ h(function(i) {
|
|
916
|
+
return i instanceof p && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof x) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
|
|
917
|
+
}, "_isClobbered"), jt = /* @__PURE__ */ h(function(i) {
|
|
918
|
+
return typeof o == "function" && i instanceof o;
|
|
939
919
|
}, "_isNode");
|
|
940
|
-
function
|
|
941
|
-
st(
|
|
942
|
-
|
|
920
|
+
function we(S, i, u) {
|
|
921
|
+
st(S, (w) => {
|
|
922
|
+
w.call(t, i, u, He);
|
|
943
923
|
});
|
|
944
924
|
}
|
|
945
|
-
|
|
946
|
-
const En = /* @__PURE__ */
|
|
947
|
-
let
|
|
948
|
-
if (
|
|
949
|
-
return ue(
|
|
950
|
-
const
|
|
951
|
-
if (
|
|
952
|
-
tagName:
|
|
925
|
+
h(we, "_executeHooks");
|
|
926
|
+
const En = /* @__PURE__ */ h(function(i) {
|
|
927
|
+
let u = null;
|
|
928
|
+
if (we(Y.beforeSanitizeElements, i, null), Gt(i))
|
|
929
|
+
return ue(i), !0;
|
|
930
|
+
const w = q(i.nodeName);
|
|
931
|
+
if (we(Y.uponSanitizeElement, i, {
|
|
932
|
+
tagName: w,
|
|
953
933
|
allowedTags: F
|
|
954
|
-
}), et &&
|
|
955
|
-
return ue(
|
|
956
|
-
if (
|
|
957
|
-
if (!
|
|
934
|
+
}), et && i.hasChildNodes() && !jt(i.firstElementChild) && K(/<[/\w!]/g, i.innerHTML) && K(/<[/\w!]/g, i.textContent) || et && i.namespaceURI === me && w === "style" && jt(i.firstElementChild) || i.nodeType === at.progressingInstruction || et && i.nodeType === at.comment && K(/<[/\w]/g, i.data))
|
|
935
|
+
return ue(i), !0;
|
|
936
|
+
if (k[w] || !(N.tagCheck instanceof Function && N.tagCheck(w)) && !F[w]) {
|
|
937
|
+
if (!k[w] && Rn(w) && (f.tagNameCheck instanceof RegExp && K(f.tagNameCheck, w) || f.tagNameCheck instanceof Function && f.tagNameCheck(w)))
|
|
958
938
|
return !1;
|
|
959
|
-
if (
|
|
960
|
-
const P =
|
|
939
|
+
if (zt && !ge[w]) {
|
|
940
|
+
const P = re(i) || i.parentNode, J = X(i) || i.childNodes;
|
|
961
941
|
if (J && P) {
|
|
962
942
|
const G = J.length;
|
|
963
|
-
for (let
|
|
964
|
-
const oe =
|
|
965
|
-
P.insertBefore(oe, z(
|
|
943
|
+
for (let ie = G - 1; ie >= 0; --ie) {
|
|
944
|
+
const oe = v(J[ie], !0);
|
|
945
|
+
P.insertBefore(oe, z(i));
|
|
966
946
|
}
|
|
967
947
|
}
|
|
968
948
|
}
|
|
969
|
-
return ue(
|
|
949
|
+
return ue(i), !0;
|
|
970
950
|
}
|
|
971
|
-
return
|
|
972
|
-
|
|
973
|
-
}),
|
|
974
|
-
element:
|
|
975
|
-
}),
|
|
976
|
-
}, "_sanitizeElements"), _n = /* @__PURE__ */
|
|
977
|
-
if (
|
|
951
|
+
return i instanceof d && !Is(i) || (w === "noscript" || w === "noembed" || w === "noframes") && K(/<\/no(script|embed|frames)/i, i.innerHTML) ? (ue(i), !0) : (Ce && i.nodeType === at.text && (u = i.textContent, st([C, Ie, ye], (P) => {
|
|
952
|
+
u = Ge(u, P, " ");
|
|
953
|
+
}), i.textContent !== u && (rt(t.removed, {
|
|
954
|
+
element: i.cloneNode()
|
|
955
|
+
}), i.textContent = u)), we(Y.afterSanitizeElements, i, null), !1);
|
|
956
|
+
}, "_sanitizeElements"), _n = /* @__PURE__ */ h(function(i, u, w) {
|
|
957
|
+
if (L[u] || gn && (u === "id" || u === "name") && (w in e || w in Rs))
|
|
978
958
|
return !1;
|
|
979
|
-
if (!(
|
|
980
|
-
if (!(
|
|
981
|
-
if (!(
|
|
982
|
-
if (!H[
|
|
959
|
+
if (!(Ne && !L[u] && K(Qe, u))) {
|
|
960
|
+
if (!(ke && K(Ct, u))) {
|
|
961
|
+
if (!(N.attributeCheck instanceof Function && N.attributeCheck(u, i))) {
|
|
962
|
+
if (!H[u] || L[u]) {
|
|
983
963
|
if (
|
|
984
964
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
985
965
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
986
966
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
987
|
-
!(Rn(
|
|
967
|
+
!(Rn(i) && (f.tagNameCheck instanceof RegExp && K(f.tagNameCheck, i) || f.tagNameCheck instanceof Function && f.tagNameCheck(i)) && (f.attributeNameCheck instanceof RegExp && K(f.attributeNameCheck, u) || f.attributeNameCheck instanceof Function && f.attributeNameCheck(u, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
988
968
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
989
|
-
|
|
969
|
+
u === "is" && f.allowCustomizedBuiltInElements && (f.tagNameCheck instanceof RegExp && K(f.tagNameCheck, w) || f.tagNameCheck instanceof Function && f.tagNameCheck(w)))
|
|
990
970
|
) return !1;
|
|
991
|
-
} else if (
|
|
992
|
-
if (!K(dt,
|
|
993
|
-
if (!((
|
|
994
|
-
if (!(
|
|
995
|
-
if (
|
|
971
|
+
} else if (!Nt[u]) {
|
|
972
|
+
if (!K(dt, Ge(w, pt, ""))) {
|
|
973
|
+
if (!((u === "src" || u === "xlink:href" || u === "href") && i !== "script" && Hn(w, "data:") === 0 && bn[i])) {
|
|
974
|
+
if (!($e && !K(Dt, Ge(w, pt, "")))) {
|
|
975
|
+
if (w)
|
|
996
976
|
return !1;
|
|
997
977
|
}
|
|
998
978
|
}
|
|
@@ -1002,188 +982,188 @@ function ds() {
|
|
|
1002
982
|
}
|
|
1003
983
|
}
|
|
1004
984
|
return !0;
|
|
1005
|
-
}, "_isValidAttribute"),
|
|
1006
|
-
return !
|
|
1007
|
-
}, "_isBasicCustomElement"),
|
|
1008
|
-
|
|
985
|
+
}, "_isValidAttribute"), Cs = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Rn = /* @__PURE__ */ h(function(i) {
|
|
986
|
+
return !Cs[ct(i)] && K(Mt, i);
|
|
987
|
+
}, "_isBasicCustomElement"), In = /* @__PURE__ */ h(function(i) {
|
|
988
|
+
we(Y.beforeSanitizeAttributes, i, null);
|
|
1009
989
|
const {
|
|
1010
|
-
attributes:
|
|
1011
|
-
} =
|
|
1012
|
-
if (!
|
|
990
|
+
attributes: u
|
|
991
|
+
} = i;
|
|
992
|
+
if (!u || Gt(i))
|
|
1013
993
|
return;
|
|
1014
|
-
const
|
|
994
|
+
const w = {
|
|
1015
995
|
attrName: "",
|
|
1016
996
|
attrValue: "",
|
|
1017
997
|
keepAttr: !0,
|
|
1018
998
|
allowedAttributes: H,
|
|
1019
999
|
forceKeepAttr: void 0
|
|
1020
1000
|
};
|
|
1021
|
-
let P =
|
|
1001
|
+
let P = u.length;
|
|
1022
1002
|
for (; P--; ) {
|
|
1023
|
-
const J =
|
|
1003
|
+
const J = u[P], {
|
|
1024
1004
|
name: G,
|
|
1025
|
-
namespaceURI:
|
|
1005
|
+
namespaceURI: ie,
|
|
1026
1006
|
value: oe
|
|
1027
|
-
} = J, he = q(G),
|
|
1028
|
-
let
|
|
1029
|
-
if (
|
|
1030
|
-
Me(G,
|
|
1007
|
+
} = J, he = q(G), Wt = oe;
|
|
1008
|
+
let Z = G === "value" ? Wt : sr(Wt);
|
|
1009
|
+
if (w.attrName = he, w.attrValue = Z, w.keepAttr = !0, w.forceKeepAttr = void 0, we(Y.uponSanitizeAttribute, i, w), Z = w.attrValue, mn && (he === "id" || he === "name") && Hn(Z, xn) !== 0 && (Me(G, i), Z = xn + Z), et && K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, Z)) {
|
|
1010
|
+
Me(G, i);
|
|
1031
1011
|
continue;
|
|
1032
1012
|
}
|
|
1033
|
-
if (he === "attributename" && Fn(
|
|
1034
|
-
Me(G,
|
|
1013
|
+
if (he === "attributename" && Fn(Z, "href")) {
|
|
1014
|
+
Me(G, i);
|
|
1035
1015
|
continue;
|
|
1036
1016
|
}
|
|
1037
|
-
if (
|
|
1017
|
+
if (w.forceKeepAttr)
|
|
1038
1018
|
continue;
|
|
1039
|
-
if (!
|
|
1040
|
-
Me(G,
|
|
1019
|
+
if (!w.keepAttr) {
|
|
1020
|
+
Me(G, i);
|
|
1041
1021
|
continue;
|
|
1042
1022
|
}
|
|
1043
|
-
if (!
|
|
1044
|
-
Me(G,
|
|
1023
|
+
if (!fn && K(/\/>/i, Z)) {
|
|
1024
|
+
Me(G, i);
|
|
1045
1025
|
continue;
|
|
1046
1026
|
}
|
|
1047
|
-
|
|
1048
|
-
|
|
1027
|
+
Ce && st([C, Ie, ye], (Mn) => {
|
|
1028
|
+
Z = Ge(Z, Mn, " ");
|
|
1049
1029
|
});
|
|
1050
|
-
const Dn = q(
|
|
1051
|
-
if (!_n(Dn, he,
|
|
1052
|
-
Me(G,
|
|
1030
|
+
const Dn = q(i.nodeName);
|
|
1031
|
+
if (!_n(Dn, he, Z)) {
|
|
1032
|
+
Me(G, i);
|
|
1053
1033
|
continue;
|
|
1054
1034
|
}
|
|
1055
|
-
if (
|
|
1056
|
-
switch (
|
|
1035
|
+
if ($ && typeof b == "object" && typeof b.getAttributeType == "function" && !ie)
|
|
1036
|
+
switch (b.getAttributeType(Dn, he)) {
|
|
1057
1037
|
case "TrustedHTML": {
|
|
1058
|
-
|
|
1038
|
+
Z = $.createHTML(Z);
|
|
1059
1039
|
break;
|
|
1060
1040
|
}
|
|
1061
1041
|
case "TrustedScriptURL": {
|
|
1062
|
-
|
|
1042
|
+
Z = $.createScriptURL(Z);
|
|
1063
1043
|
break;
|
|
1064
1044
|
}
|
|
1065
1045
|
}
|
|
1066
|
-
if (
|
|
1046
|
+
if (Z !== Wt)
|
|
1067
1047
|
try {
|
|
1068
|
-
|
|
1048
|
+
ie ? i.setAttributeNS(ie, G, Z) : i.setAttribute(G, Z), Gt(i) ? ue(i) : Bn(t.removed);
|
|
1069
1049
|
} catch {
|
|
1070
|
-
Me(G,
|
|
1050
|
+
Me(G, i);
|
|
1071
1051
|
}
|
|
1072
1052
|
}
|
|
1073
|
-
|
|
1074
|
-
}, "_sanitizeAttributes"),
|
|
1075
|
-
let
|
|
1076
|
-
const
|
|
1077
|
-
for (
|
|
1078
|
-
|
|
1079
|
-
|
|
1053
|
+
we(Y.afterSanitizeAttributes, i, null);
|
|
1054
|
+
}, "_sanitizeAttributes"), Cn = /* @__PURE__ */ h(function(i) {
|
|
1055
|
+
let u = null;
|
|
1056
|
+
const w = An(i);
|
|
1057
|
+
for (we(Y.beforeSanitizeShadowDOM, i, null); u = w.nextNode(); )
|
|
1058
|
+
we(Y.uponSanitizeShadowNode, u, null), En(u), In(u), u.content instanceof s && Cn(u.content);
|
|
1059
|
+
we(Y.afterSanitizeShadowDOM, i, null);
|
|
1080
1060
|
}, "_sanitizeShadowDOM");
|
|
1081
|
-
return t.sanitize = function(
|
|
1082
|
-
let
|
|
1083
|
-
if (
|
|
1084
|
-
throw
|
|
1061
|
+
return t.sanitize = function(S) {
|
|
1062
|
+
let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, w = null, P = null, J = null;
|
|
1063
|
+
if ($t = !S, $t && (S = "<!-->"), typeof S != "string" && !jt(S) && (S = or(S), typeof S != "string"))
|
|
1064
|
+
throw kt("dirty is not a string, aborting");
|
|
1085
1065
|
if (!t.isSupported)
|
|
1086
|
-
return
|
|
1087
|
-
if (
|
|
1088
|
-
const oe =
|
|
1066
|
+
return S;
|
|
1067
|
+
if (Lt || Ht(i), t.removed = [], typeof S == "string" && (tt = !1), tt) {
|
|
1068
|
+
const oe = S.nodeName;
|
|
1089
1069
|
if (typeof oe == "string") {
|
|
1090
1070
|
const he = q(oe);
|
|
1091
|
-
if (!F[he] ||
|
|
1092
|
-
throw
|
|
1071
|
+
if (!F[he] || k[he])
|
|
1072
|
+
throw kt("root node is forbidden and cannot be sanitized in-place");
|
|
1093
1073
|
}
|
|
1094
|
-
} else if (
|
|
1095
|
-
|
|
1074
|
+
} else if (S instanceof o)
|
|
1075
|
+
u = Sn("<!---->"), w = u.ownerDocument.importNode(S, !0), w.nodeType === at.element && w.nodeName === "BODY" || w.nodeName === "HTML" ? u = w : u.appendChild(w);
|
|
1096
1076
|
else {
|
|
1097
|
-
if (
|
|
1098
|
-
|
|
1099
|
-
return
|
|
1100
|
-
if (
|
|
1101
|
-
return
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
const G = An(tt ?
|
|
1077
|
+
if (!Ue && !Ce && !De && // eslint-disable-next-line unicorn/prefer-includes
|
|
1078
|
+
S.indexOf("<") === -1)
|
|
1079
|
+
return $ && gt ? $.createHTML(S) : S;
|
|
1080
|
+
if (u = Sn(S), !u)
|
|
1081
|
+
return Ue ? null : gt ? V : "";
|
|
1082
|
+
}
|
|
1083
|
+
u && Ot && ue(u.firstChild);
|
|
1084
|
+
const G = An(tt ? S : u);
|
|
1105
1085
|
for (; P = G.nextNode(); )
|
|
1106
|
-
En(P),
|
|
1086
|
+
En(P), In(P), P.content instanceof s && Cn(P.content);
|
|
1107
1087
|
if (tt)
|
|
1108
|
-
return
|
|
1109
|
-
if (
|
|
1110
|
-
if (
|
|
1111
|
-
|
|
1112
|
-
let oe =
|
|
1113
|
-
st([
|
|
1114
|
-
oe =
|
|
1115
|
-
}),
|
|
1116
|
-
}
|
|
1117
|
-
if (
|
|
1118
|
-
for (J = Re.call(
|
|
1119
|
-
J.appendChild(
|
|
1088
|
+
return S;
|
|
1089
|
+
if (Ue) {
|
|
1090
|
+
if (Ce) {
|
|
1091
|
+
u.normalize();
|
|
1092
|
+
let oe = u.innerHTML;
|
|
1093
|
+
st([C, Ie, ye], (he) => {
|
|
1094
|
+
oe = Ge(oe, he, " ");
|
|
1095
|
+
}), u.innerHTML = oe;
|
|
1096
|
+
}
|
|
1097
|
+
if (ft)
|
|
1098
|
+
for (J = Re.call(u.ownerDocument); u.firstChild; )
|
|
1099
|
+
J.appendChild(u.firstChild);
|
|
1120
1100
|
else
|
|
1121
|
-
J =
|
|
1101
|
+
J = u;
|
|
1122
1102
|
return (H.shadowroot || H.shadowrootmode) && (J = It.call(n, J, !0)), J;
|
|
1123
1103
|
}
|
|
1124
|
-
let
|
|
1125
|
-
return De && F["!doctype"] &&
|
|
1126
|
-
` +
|
|
1127
|
-
|
|
1128
|
-
}),
|
|
1104
|
+
let ie = De ? u.outerHTML : u.innerHTML;
|
|
1105
|
+
return De && F["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && K(ps, u.ownerDocument.doctype.name) && (ie = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
|
|
1106
|
+
` + ie), Ce && st([C, Ie, ye], (oe) => {
|
|
1107
|
+
ie = Ge(ie, oe, " ");
|
|
1108
|
+
}), $ && gt ? $.createHTML(ie) : ie;
|
|
1129
1109
|
}, t.setConfig = function() {
|
|
1130
|
-
let
|
|
1131
|
-
|
|
1110
|
+
let S = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1111
|
+
Ht(S), Lt = !0;
|
|
1132
1112
|
}, t.clearConfig = function() {
|
|
1133
|
-
|
|
1134
|
-
}, t.isValidAttribute = function(
|
|
1135
|
-
|
|
1136
|
-
const
|
|
1137
|
-
return _n(
|
|
1138
|
-
}, t.addHook = function(
|
|
1139
|
-
typeof
|
|
1140
|
-
}, t.removeHook = function(
|
|
1141
|
-
if (
|
|
1142
|
-
const
|
|
1143
|
-
return
|
|
1144
|
-
}
|
|
1145
|
-
return Bn(
|
|
1146
|
-
}, t.removeHooks = function(
|
|
1147
|
-
|
|
1113
|
+
He = null, Lt = !1;
|
|
1114
|
+
}, t.isValidAttribute = function(S, i, u) {
|
|
1115
|
+
He || Ht({});
|
|
1116
|
+
const w = q(S), P = q(i);
|
|
1117
|
+
return _n(w, P, u);
|
|
1118
|
+
}, t.addHook = function(S, i) {
|
|
1119
|
+
typeof i == "function" && rt(Y[S], i);
|
|
1120
|
+
}, t.removeHook = function(S, i) {
|
|
1121
|
+
if (i !== void 0) {
|
|
1122
|
+
const u = tr(Y[S], i);
|
|
1123
|
+
return u === -1 ? void 0 : nr(Y[S], u, 1)[0];
|
|
1124
|
+
}
|
|
1125
|
+
return Bn(Y[S]);
|
|
1126
|
+
}, t.removeHooks = function(S) {
|
|
1127
|
+
Y[S] = [];
|
|
1148
1128
|
}, t.removeAllHooks = function() {
|
|
1149
|
-
|
|
1129
|
+
Y = Xn();
|
|
1150
1130
|
}, t;
|
|
1151
1131
|
}
|
|
1152
|
-
|
|
1153
|
-
var
|
|
1154
|
-
function
|
|
1132
|
+
h(ds, "createDOMPurify");
|
|
1133
|
+
var yr = ds();
|
|
1134
|
+
function sn() {
|
|
1155
1135
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
1156
1136
|
}
|
|
1157
|
-
|
|
1158
|
-
var Pe =
|
|
1137
|
+
h(sn, "z");
|
|
1138
|
+
var Pe = sn();
|
|
1159
1139
|
function fs(a) {
|
|
1160
1140
|
Pe = a;
|
|
1161
1141
|
}
|
|
1162
|
-
|
|
1163
|
-
var Oe = { exec: /* @__PURE__ */
|
|
1164
|
-
function
|
|
1165
|
-
let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */
|
|
1142
|
+
h(fs, "G");
|
|
1143
|
+
var Oe = { exec: /* @__PURE__ */ h(() => null, "exec") };
|
|
1144
|
+
function M(a, t = "") {
|
|
1145
|
+
let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ h((r, s) => {
|
|
1166
1146
|
let l = typeof s == "string" ? s : s.source;
|
|
1167
|
-
return l = l.replace(ee.caret, "$1"), e = e.replace(
|
|
1168
|
-
}, "replace"), getRegex: /* @__PURE__ */
|
|
1147
|
+
return l = l.replace(ee.caret, "$1"), e = e.replace(r, l), n;
|
|
1148
|
+
}, "replace"), getRegex: /* @__PURE__ */ h(() => new RegExp(e, t), "getRegex") };
|
|
1169
1149
|
return n;
|
|
1170
1150
|
}
|
|
1171
|
-
|
|
1172
|
-
var
|
|
1151
|
+
h(M, "d");
|
|
1152
|
+
var Tr = ((a = "") => {
|
|
1173
1153
|
try {
|
|
1174
1154
|
return !!new RegExp("(?<=1)(?<!1)" + a);
|
|
1175
1155
|
} catch {
|
|
1176
1156
|
return !1;
|
|
1177
1157
|
}
|
|
1178
|
-
})(), ee = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */
|
|
1179
|
-
]`).replace("lheading", ms).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() },
|
|
1180
|
-
function
|
|
1158
|
+
})(), ee = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ h((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") }, Sr = /^(?:[ \t]*(?:\n|$))+/, Ar = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Er = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ht = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, _r = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, rn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, gs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ms = M(gs).replace(/bull/g, rn).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(), Rr = M(gs).replace(/bull/g, rn).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(), an = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Ir = /^[^\n]+/, ln = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Cr = M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ln).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Dr = M(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, rn).getRegex(), _t = "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", on = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Mr = M("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", on).replace("tag", _t).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), xs = M(an).replace("hr", ht).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _t).getRegex(), Lr = M(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", xs).getRegex(), cn = { blockquote: Lr, code: Ar, def: Cr, fences: Er, heading: _r, hr: ht, html: Mr, lheading: ms, list: Dr, newline: Sr, paragraph: xs, table: Oe, text: Ir }, Kn = M("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ht).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", _t).getRegex(), Or = { ...cn, lheading: Rr, table: Kn, paragraph: M(an).replace("hr", ht).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Kn).replace("blockquote", " {0,3}>").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", _t).getRegex() }, zr = { ...cn, html: M(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", on).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: Oe, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: M(an).replace("hr", ht).replace("heading", ` *#{1,6} *[^
|
|
1159
|
+
]`).replace("lheading", ms).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Pr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Nr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, bs = /^( {2,}|\\)\n(?!\s*$)/, $r = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ke = /[\p{P}\p{S}]/u, Rt = /[\s\p{P}\p{S}]/u, un = /[^\s\p{P}\p{S}]/u, Ur = M(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Rt).getRegex(), ks = /(?!~)[\p{P}\p{S}]/u, Br = /(?!~)[\s\p{P}\p{S}]/u, Fr = /(?:[^\s\p{P}\p{S}]|~)/u, Hr = M(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Tr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ws = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Gr = M(ws, "u").replace(/punct/g, Ke).getRegex(), jr = M(ws, "u").replace(/punct/g, ks).getRegex(), vs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Wr = M(vs, "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, Ke).getRegex(), qr = M(vs, "gu").replace(/notPunctSpace/g, Fr).replace(/punctSpace/g, Br).replace(/punct/g, ks).getRegex(), Vr = M("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, Ke).getRegex(), Yr = M(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ke).getRegex(), Zr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Xr = M(Zr, "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, Ke).getRegex(), Kr = M(/\\(punct)/, "gu").replace(/punct/g, Ke).getRegex(), Qr = M(/^<(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(), Jr = M(on).replace("(?:-->|$)", "-->").getRegex(), ei = M("^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", Jr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Tt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, ti = M(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Tt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ys = M(/^!?\[(label)\]\[(ref)\]/).replace("label", Tt).replace("ref", ln).getRegex(), Ts = M(/^!?\[(ref)\](?:\[\])?/).replace("ref", ln).getRegex(), ni = M("reflink|nolink(?!\\()", "g").replace("reflink", ys).replace("nolink", Ts).getRegex(), Qn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, hn = { _backpedal: Oe, anyPunctuation: Kr, autolink: Qr, blockSkip: Hr, br: bs, code: Nr, del: Oe, delLDelim: Oe, delRDelim: Oe, emStrongLDelim: Gr, emStrongRDelimAst: Wr, emStrongRDelimUnd: Vr, escape: Pr, link: ti, nolink: Ts, punctuation: Ur, reflink: ys, reflinkSearch: ni, tag: ei, text: $r, url: Oe }, si = { ...hn, link: M(/^!?\[(label)\]\((.*?)\)/).replace("label", Tt).getRegex(), reflink: M(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Tt).getRegex() }, tn = { ...hn, emStrongRDelimAst: qr, emStrongLDelim: jr, delLDelim: Yr, delRDelim: Xr, url: M(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Qn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: M(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Qn).getRegex() }, ri = { ...tn, br: M(bs).replace("{2,}", "*").getRegex(), text: M(tn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, vt = { normal: cn, gfm: Or, pedantic: zr }, lt = { normal: hn, gfm: tn, breaks: ri, pedantic: si }, ii = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, Jn = /* @__PURE__ */ h((a) => ii[a], "de");
|
|
1160
|
+
function xe(a, t) {
|
|
1181
1161
|
if (t) {
|
|
1182
1162
|
if (ee.escapeTest.test(a)) return a.replace(ee.escapeReplace, Jn);
|
|
1183
1163
|
} else if (ee.escapeTestNoEncode.test(a)) return a.replace(ee.escapeReplaceNoEncode, Jn);
|
|
1184
1164
|
return a;
|
|
1185
1165
|
}
|
|
1186
|
-
|
|
1166
|
+
h(xe, "O");
|
|
1187
1167
|
function es(a) {
|
|
1188
1168
|
try {
|
|
1189
1169
|
a = encodeURI(a).replace(ee.percentDecode, "%");
|
|
@@ -1192,28 +1172,28 @@ function es(a) {
|
|
|
1192
1172
|
}
|
|
1193
1173
|
return a;
|
|
1194
1174
|
}
|
|
1195
|
-
|
|
1175
|
+
h(es, "J");
|
|
1196
1176
|
function ts(a, t) {
|
|
1197
1177
|
let e = a.replace(ee.findPipe, (s, l, o) => {
|
|
1198
1178
|
let d = !1, c = l;
|
|
1199
1179
|
for (; --c >= 0 && o[c] === "\\"; ) d = !d;
|
|
1200
1180
|
return d ? "|" : " |";
|
|
1201
|
-
}), n = e.split(ee.splitPipe),
|
|
1181
|
+
}), n = e.split(ee.splitPipe), r = 0;
|
|
1202
1182
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
|
|
1203
1183
|
else for (; n.length < t; ) n.push("");
|
|
1204
|
-
for (;
|
|
1184
|
+
for (; r < n.length; r++) n[r] = n[r].trim().replace(ee.slashPipe, "|");
|
|
1205
1185
|
return n;
|
|
1206
1186
|
}
|
|
1207
|
-
|
|
1187
|
+
h(ts, "V");
|
|
1208
1188
|
function Te(a, t, e) {
|
|
1209
1189
|
let n = a.length;
|
|
1210
1190
|
if (n === 0) return "";
|
|
1211
|
-
let
|
|
1212
|
-
for (;
|
|
1213
|
-
|
|
1214
|
-
return a.slice(0, n -
|
|
1191
|
+
let r = 0;
|
|
1192
|
+
for (; r < n && a.charAt(n - r - 1) === t; )
|
|
1193
|
+
r++;
|
|
1194
|
+
return a.slice(0, n - r);
|
|
1215
1195
|
}
|
|
1216
|
-
|
|
1196
|
+
h(Te, "$");
|
|
1217
1197
|
function ns(a) {
|
|
1218
1198
|
let t = a.split(`
|
|
1219
1199
|
`), e = t.length - 1;
|
|
@@ -1221,8 +1201,8 @@ function ns(a) {
|
|
|
1221
1201
|
return t.length - e <= 2 ? a : t.slice(0, e + 1).join(`
|
|
1222
1202
|
`);
|
|
1223
1203
|
}
|
|
1224
|
-
|
|
1225
|
-
function
|
|
1204
|
+
h(ns, "Y");
|
|
1205
|
+
function ai(a, t) {
|
|
1226
1206
|
if (a.indexOf(t[1]) === -1) return -1;
|
|
1227
1207
|
let e = 0;
|
|
1228
1208
|
for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;
|
|
@@ -1230,38 +1210,38 @@ function ar(a, t) {
|
|
|
1230
1210
|
else if (a[n] === t[1] && (e--, e < 0)) return n;
|
|
1231
1211
|
return e > 0 ? -2 : -1;
|
|
1232
1212
|
}
|
|
1233
|
-
|
|
1234
|
-
function
|
|
1213
|
+
h(ai, "ge");
|
|
1214
|
+
function li(a, t = 0) {
|
|
1235
1215
|
let e = t, n = "";
|
|
1236
|
-
for (let
|
|
1216
|
+
for (let r of a) if (r === " ") {
|
|
1237
1217
|
let s = 4 - e % 4;
|
|
1238
1218
|
n += " ".repeat(s), e += s;
|
|
1239
|
-
} else n +=
|
|
1219
|
+
} else n += r, e++;
|
|
1240
1220
|
return n;
|
|
1241
1221
|
}
|
|
1242
|
-
|
|
1243
|
-
function ss(a, t, e, n,
|
|
1244
|
-
let s = t.href, l = t.title || null, o = a[1].replace(
|
|
1222
|
+
h(li, "fe");
|
|
1223
|
+
function ss(a, t, e, n, r) {
|
|
1224
|
+
let s = t.href, l = t.title || null, o = a[1].replace(r.other.outputLinkReplace, "$1");
|
|
1245
1225
|
n.state.inLink = !0;
|
|
1246
1226
|
let d = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
|
|
1247
1227
|
return n.state.inLink = !1, d;
|
|
1248
1228
|
}
|
|
1249
|
-
|
|
1250
|
-
function
|
|
1229
|
+
h(ss, "me");
|
|
1230
|
+
function oi(a, t, e) {
|
|
1251
1231
|
let n = a.match(e.other.indentCodeCompensation);
|
|
1252
1232
|
if (n === null) return t;
|
|
1253
|
-
let
|
|
1233
|
+
let r = n[1];
|
|
1254
1234
|
return t.split(`
|
|
1255
1235
|
`).map((s) => {
|
|
1256
1236
|
let l = s.match(e.other.beginningSpace);
|
|
1257
1237
|
if (l === null) return s;
|
|
1258
1238
|
let [o] = l;
|
|
1259
|
-
return o.length >=
|
|
1239
|
+
return o.length >= r.length ? s.slice(r.length) : s;
|
|
1260
1240
|
}).join(`
|
|
1261
1241
|
`);
|
|
1262
1242
|
}
|
|
1263
|
-
|
|
1264
|
-
var
|
|
1243
|
+
h(oi, "rt");
|
|
1244
|
+
var qe, St = (qe = class {
|
|
1265
1245
|
constructor(t) {
|
|
1266
1246
|
D(this, "options");
|
|
1267
1247
|
D(this, "rules");
|
|
@@ -1275,15 +1255,15 @@ var We, At = (We = class {
|
|
|
1275
1255
|
code(t) {
|
|
1276
1256
|
let e = this.rules.block.code.exec(t);
|
|
1277
1257
|
if (e) {
|
|
1278
|
-
let n = this.options.pedantic ? e[0] : ns(e[0]),
|
|
1279
|
-
return { type: "code", raw: n, codeBlockStyle: "indented", text:
|
|
1258
|
+
let n = this.options.pedantic ? e[0] : ns(e[0]), r = n.replace(this.rules.other.codeRemoveIndent, "");
|
|
1259
|
+
return { type: "code", raw: n, codeBlockStyle: "indented", text: r };
|
|
1280
1260
|
}
|
|
1281
1261
|
}
|
|
1282
1262
|
fences(t) {
|
|
1283
1263
|
let e = this.rules.block.fences.exec(t);
|
|
1284
1264
|
if (e) {
|
|
1285
|
-
let n = e[0],
|
|
1286
|
-
return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text:
|
|
1265
|
+
let n = e[0], r = oi(n, e[3] || "", this.rules);
|
|
1266
|
+
return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
|
|
1287
1267
|
}
|
|
1288
1268
|
}
|
|
1289
1269
|
heading(t) {
|
|
@@ -1291,8 +1271,8 @@ var We, At = (We = class {
|
|
|
1291
1271
|
if (e) {
|
|
1292
1272
|
let n = e[2].trim();
|
|
1293
1273
|
if (this.rules.other.endingHash.test(n)) {
|
|
1294
|
-
let
|
|
1295
|
-
(this.options.pedantic || !
|
|
1274
|
+
let r = Te(n, "#");
|
|
1275
|
+
(this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
|
|
1296
1276
|
}
|
|
1297
1277
|
return { type: "heading", raw: Te(e[0], `
|
|
1298
1278
|
`), depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
@@ -1308,101 +1288,101 @@ var We, At = (We = class {
|
|
|
1308
1288
|
if (e) {
|
|
1309
1289
|
let n = Te(e[0], `
|
|
1310
1290
|
`).split(`
|
|
1311
|
-
`),
|
|
1291
|
+
`), r = "", s = "", l = [];
|
|
1312
1292
|
for (; n.length > 0; ) {
|
|
1313
1293
|
let o = !1, d = [], c;
|
|
1314
1294
|
for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c])) d.push(n[c]), o = !0;
|
|
1315
1295
|
else if (!o) d.push(n[c]);
|
|
1316
1296
|
else break;
|
|
1317
1297
|
n = n.slice(c);
|
|
1318
|
-
let
|
|
1319
|
-
`),
|
|
1298
|
+
let x = d.join(`
|
|
1299
|
+
`), p = x.replace(this.rules.other.blockquoteSetextReplace, `
|
|
1320
1300
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
1321
|
-
|
|
1322
|
-
${
|
|
1323
|
-
${
|
|
1324
|
-
let
|
|
1325
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(
|
|
1326
|
-
let
|
|
1327
|
-
if (
|
|
1328
|
-
if (
|
|
1329
|
-
let
|
|
1301
|
+
r = r ? `${r}
|
|
1302
|
+
${x}` : x, s = s ? `${s}
|
|
1303
|
+
${p}` : p;
|
|
1304
|
+
let m = this.lexer.state.top;
|
|
1305
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(p, l, !0), this.lexer.state.top = m, n.length === 0) break;
|
|
1306
|
+
let b = l.at(-1);
|
|
1307
|
+
if (b?.type === "code") break;
|
|
1308
|
+
if (b?.type === "blockquote") {
|
|
1309
|
+
let g = b, v = g.raw + `
|
|
1330
1310
|
` + n.join(`
|
|
1331
|
-
`),
|
|
1332
|
-
l[l.length - 1] =
|
|
1311
|
+
`), I = this.blockquote(v);
|
|
1312
|
+
l[l.length - 1] = I, r = r.substring(0, r.length - g.raw.length) + I.raw, s = s.substring(0, s.length - g.text.length) + I.text;
|
|
1333
1313
|
break;
|
|
1334
|
-
} else if (
|
|
1335
|
-
let
|
|
1314
|
+
} else if (b?.type === "list") {
|
|
1315
|
+
let g = b, v = g.raw + `
|
|
1336
1316
|
` + n.join(`
|
|
1337
|
-
`),
|
|
1338
|
-
l[l.length - 1] =
|
|
1317
|
+
`), I = this.list(v);
|
|
1318
|
+
l[l.length - 1] = I, r = r.substring(0, r.length - b.raw.length) + I.raw, s = s.substring(0, s.length - g.raw.length) + I.raw, n = v.substring(l.at(-1).raw.length).split(`
|
|
1339
1319
|
`);
|
|
1340
1320
|
continue;
|
|
1341
1321
|
}
|
|
1342
1322
|
}
|
|
1343
|
-
return { type: "blockquote", raw:
|
|
1323
|
+
return { type: "blockquote", raw: r, tokens: l, text: s };
|
|
1344
1324
|
}
|
|
1345
1325
|
}
|
|
1346
1326
|
list(t) {
|
|
1347
1327
|
let e = this.rules.block.list.exec(t);
|
|
1348
1328
|
if (e) {
|
|
1349
|
-
let n = e[1].trim(),
|
|
1350
|
-
n =
|
|
1329
|
+
let n = e[1].trim(), r = n.length > 1, s = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: !1, items: [] };
|
|
1330
|
+
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
1351
1331
|
let l = this.rules.other.listItemRegex(n), o = !1;
|
|
1352
1332
|
for (; t; ) {
|
|
1353
|
-
let c = !1,
|
|
1333
|
+
let c = !1, x = "", p = "";
|
|
1354
1334
|
if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
1355
|
-
|
|
1356
|
-
let
|
|
1357
|
-
`, 1)[0], e[1].length),
|
|
1358
|
-
`, 1)[0],
|
|
1359
|
-
if (this.options.pedantic ? (
|
|
1360
|
-
`, t = t.substring(
|
|
1361
|
-
let
|
|
1335
|
+
x = e[0], t = t.substring(x.length);
|
|
1336
|
+
let m = li(e[2].split(`
|
|
1337
|
+
`, 1)[0], e[1].length), b = t.split(`
|
|
1338
|
+
`, 1)[0], g = !m.trim(), v = 0;
|
|
1339
|
+
if (this.options.pedantic ? (v = 2, p = m.trimStart()) : g ? v = e[1].length + 1 : (v = m.search(this.rules.other.nonSpaceChar), v = v > 4 ? 1 : v, p = m.slice(v), v += e[1].length), g && this.rules.other.blankLine.test(b) && (x += b + `
|
|
1340
|
+
`, t = t.substring(b.length + 1), c = !0), !c) {
|
|
1341
|
+
let I = this.rules.other.nextBulletRegex(v), z = this.rules.other.hrRegex(v), X = this.rules.other.fencesBeginRegex(v), re = this.rules.other.headingBeginRegex(v), $ = this.rules.other.htmlBeginRegex(v), V = this.rules.other.blockquoteBeginRegex(v);
|
|
1362
1342
|
for (; t; ) {
|
|
1363
1343
|
let te = t.split(`
|
|
1364
1344
|
`, 1)[0], fe;
|
|
1365
|
-
if (
|
|
1366
|
-
if (fe.search(this.rules.other.nonSpaceChar) >=
|
|
1367
|
-
` + fe.slice(
|
|
1345
|
+
if (b = te, this.options.pedantic ? (b = b.replace(this.rules.other.listReplaceNesting, " "), fe = b) : fe = b.replace(this.rules.other.tabCharGlobal, " "), X.test(b) || re.test(b) || $.test(b) || V.test(b) || I.test(b) || z.test(b)) break;
|
|
1346
|
+
if (fe.search(this.rules.other.nonSpaceChar) >= v || !b.trim()) p += `
|
|
1347
|
+
` + fe.slice(v);
|
|
1368
1348
|
else {
|
|
1369
|
-
if (
|
|
1370
|
-
|
|
1371
|
-
` +
|
|
1349
|
+
if (g || m.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || X.test(m) || re.test(m) || z.test(m)) break;
|
|
1350
|
+
p += `
|
|
1351
|
+
` + b;
|
|
1372
1352
|
}
|
|
1373
|
-
|
|
1374
|
-
`, t = t.substring(te.length + 1),
|
|
1353
|
+
g = !b.trim(), x += te + `
|
|
1354
|
+
`, t = t.substring(te.length + 1), m = fe.slice(v);
|
|
1375
1355
|
}
|
|
1376
1356
|
}
|
|
1377
|
-
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(
|
|
1357
|
+
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(x) && (o = !0)), s.items.push({ type: "list_item", raw: x, task: !!this.options.gfm && this.rules.other.listIsTask.test(p), loose: !1, text: p, tokens: [] }), s.raw += x;
|
|
1378
1358
|
}
|
|
1379
1359
|
let d = s.items.at(-1);
|
|
1380
1360
|
if (d) d.raw = d.raw.trimEnd(), d.text = d.text.trimEnd();
|
|
1381
1361
|
else return;
|
|
1382
1362
|
s.raw = s.raw.trimEnd();
|
|
1383
1363
|
for (let c of s.items) {
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1364
|
+
this.lexer.state.top = !1, c.tokens = this.lexer.blockTokens(c.text, []);
|
|
1365
|
+
let x = c.tokens[0];
|
|
1366
|
+
if (c.task && (x?.type === "text" || x?.type === "paragraph")) {
|
|
1367
|
+
c.text = c.text.replace(this.rules.other.listReplaceTask, ""), x.raw = x.raw.replace(this.rules.other.listReplaceTask, ""), x.text = x.text.replace(this.rules.other.listReplaceTask, "");
|
|
1368
|
+
for (let m = this.lexer.inlineQueue.length - 1; m >= 0; m--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)) {
|
|
1369
|
+
this.lexer.inlineQueue[m].src = this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask, "");
|
|
1370
|
+
break;
|
|
1391
1371
|
}
|
|
1392
|
-
let
|
|
1393
|
-
if (
|
|
1394
|
-
let
|
|
1395
|
-
c.checked =
|
|
1372
|
+
let p = this.rules.other.listTaskCheckbox.exec(c.raw);
|
|
1373
|
+
if (p) {
|
|
1374
|
+
let m = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
|
|
1375
|
+
c.checked = m.checked, s.loose ? c.tokens[0] && ["paragraph", "text"].includes(c.tokens[0].type) && "tokens" in c.tokens[0] && c.tokens[0].tokens ? (c.tokens[0].raw = m.raw + c.tokens[0].raw, c.tokens[0].text = m.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(m)) : c.tokens.unshift({ type: "paragraph", raw: m.raw, text: m.raw, tokens: [m] }) : c.tokens.unshift(m);
|
|
1396
1376
|
}
|
|
1397
|
-
}
|
|
1377
|
+
} else c.task && (c.task = !1);
|
|
1398
1378
|
if (!s.loose) {
|
|
1399
|
-
let
|
|
1400
|
-
s.loose =
|
|
1379
|
+
let p = c.tokens.filter((b) => b.type === "space"), m = p.length > 0 && p.some((b) => this.rules.other.anyLine.test(b.raw));
|
|
1380
|
+
s.loose = m;
|
|
1401
1381
|
}
|
|
1402
1382
|
}
|
|
1403
1383
|
if (s.loose) for (let c of s.items) {
|
|
1404
1384
|
c.loose = !0;
|
|
1405
|
-
for (let
|
|
1385
|
+
for (let x of c.tokens) x.type === "text" && (x.type = "paragraph");
|
|
1406
1386
|
}
|
|
1407
1387
|
return s;
|
|
1408
1388
|
}
|
|
@@ -1417,19 +1397,19 @@ ${u}` : u;
|
|
|
1417
1397
|
def(t) {
|
|
1418
1398
|
let e = this.rules.block.def.exec(t);
|
|
1419
1399
|
if (e) {
|
|
1420
|
-
let n = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "),
|
|
1400
|
+
let n = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
|
|
1421
1401
|
return { type: "def", tag: n, raw: Te(e[0], `
|
|
1422
|
-
`), href:
|
|
1402
|
+
`), href: r, title: s };
|
|
1423
1403
|
}
|
|
1424
1404
|
}
|
|
1425
1405
|
table(t) {
|
|
1426
1406
|
let e = this.rules.block.table.exec(t);
|
|
1427
1407
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
1428
|
-
let n = ts(e[1]),
|
|
1408
|
+
let n = ts(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
1429
1409
|
`) : [], l = { type: "table", raw: Te(e[0], `
|
|
1430
1410
|
`), header: [], align: [], rows: [] };
|
|
1431
|
-
if (n.length ===
|
|
1432
|
-
for (let o of
|
|
1411
|
+
if (n.length === r.length) {
|
|
1412
|
+
for (let o of r) this.rules.other.tableAlignRight.test(o) ? l.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? l.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? l.align.push("left") : l.align.push(null);
|
|
1433
1413
|
for (let o = 0; o < n.length; o++) l.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: !0, align: l.align[o] });
|
|
1434
1414
|
for (let o of s) l.rows.push(ts(o, l.header.length).map((d, c) => ({ text: d, tokens: this.lexer.inline(d), header: !1, align: l.align[c] })));
|
|
1435
1415
|
return l;
|
|
@@ -1472,25 +1452,25 @@ ${u}` : u;
|
|
|
1472
1452
|
let l = Te(n.slice(0, -1), "\\");
|
|
1473
1453
|
if ((n.length - l.length) % 2 === 0) return;
|
|
1474
1454
|
} else {
|
|
1475
|
-
let l =
|
|
1455
|
+
let l = ai(e[2], "()");
|
|
1476
1456
|
if (l === -2) return;
|
|
1477
1457
|
if (l > -1) {
|
|
1478
1458
|
let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + l;
|
|
1479
1459
|
e[2] = e[2].substring(0, l), e[0] = e[0].substring(0, o).trim(), e[3] = "";
|
|
1480
1460
|
}
|
|
1481
1461
|
}
|
|
1482
|
-
let
|
|
1462
|
+
let r = e[2], s = "";
|
|
1483
1463
|
if (this.options.pedantic) {
|
|
1484
|
-
let l = this.rules.other.pedanticHrefTitle.exec(
|
|
1485
|
-
l && (
|
|
1464
|
+
let l = this.rules.other.pedanticHrefTitle.exec(r);
|
|
1465
|
+
l && (r = l[1], s = l[3]);
|
|
1486
1466
|
} else s = e[3] ? e[3].slice(1, -1) : "";
|
|
1487
|
-
return
|
|
1467
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), ss(e, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
|
|
1488
1468
|
}
|
|
1489
1469
|
}
|
|
1490
1470
|
reflink(t, e) {
|
|
1491
1471
|
let n;
|
|
1492
1472
|
if ((n = this.rules.inline.reflink.exec(t)) || (n = this.rules.inline.nolink.exec(t))) {
|
|
1493
|
-
let
|
|
1473
|
+
let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = e[r.toLowerCase()];
|
|
1494
1474
|
if (!s) {
|
|
1495
1475
|
let l = n[0].charAt(0);
|
|
1496
1476
|
return { type: "text", raw: l, text: l };
|
|
@@ -1499,35 +1479,35 @@ ${u}` : u;
|
|
|
1499
1479
|
}
|
|
1500
1480
|
}
|
|
1501
1481
|
emStrong(t, e, n = "") {
|
|
1502
|
-
let
|
|
1503
|
-
if (!(!
|
|
1504
|
-
let s = [...
|
|
1505
|
-
for (
|
|
1506
|
-
if (l =
|
|
1507
|
-
if (o = [...l].length,
|
|
1482
|
+
let r = this.rules.inline.emStrongLDelim.exec(t);
|
|
1483
|
+
if (!(!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[3]) || !n || this.rules.inline.punctuation.exec(n))) {
|
|
1484
|
+
let s = [...r[0]].length - 1, l, o, d = s, c = 0, x = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
1485
|
+
for (x.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = x.exec(e)) !== null; ) {
|
|
1486
|
+
if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l) continue;
|
|
1487
|
+
if (o = [...l].length, r[3] || r[4]) {
|
|
1508
1488
|
d += o;
|
|
1509
1489
|
continue;
|
|
1510
|
-
} else if ((
|
|
1490
|
+
} else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
|
|
1511
1491
|
c += o;
|
|
1512
1492
|
continue;
|
|
1513
1493
|
}
|
|
1514
1494
|
if (d -= o, d > 0) continue;
|
|
1515
1495
|
o = Math.min(o, o + d + c);
|
|
1516
|
-
let
|
|
1496
|
+
let p = [...r[0]][0].length, m = t.slice(0, s + r.index + p + o);
|
|
1517
1497
|
if (Math.min(s, o) % 2) {
|
|
1518
|
-
let
|
|
1519
|
-
return { type: "em", raw:
|
|
1498
|
+
let g = m.slice(1, -1);
|
|
1499
|
+
return { type: "em", raw: m, text: g, tokens: this.lexer.inlineTokens(g) };
|
|
1520
1500
|
}
|
|
1521
|
-
let
|
|
1522
|
-
return { type: "strong", raw:
|
|
1501
|
+
let b = m.slice(2, -2);
|
|
1502
|
+
return { type: "strong", raw: m, text: b, tokens: this.lexer.inlineTokens(b) };
|
|
1523
1503
|
}
|
|
1524
1504
|
}
|
|
1525
1505
|
}
|
|
1526
1506
|
codespan(t) {
|
|
1527
1507
|
let e = this.rules.inline.code.exec(t);
|
|
1528
1508
|
if (e) {
|
|
1529
|
-
let n = e[2].replace(this.rules.other.newLineCharGlobal, " "),
|
|
1530
|
-
return
|
|
1509
|
+
let n = e[2].replace(this.rules.other.newLineCharGlobal, " "), r = this.rules.other.nonSpaceChar.test(n), s = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
|
|
1510
|
+
return r && s && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: e[0], text: n };
|
|
1531
1511
|
}
|
|
1532
1512
|
}
|
|
1533
1513
|
br(t) {
|
|
@@ -1535,42 +1515,42 @@ ${u}` : u;
|
|
|
1535
1515
|
if (e) return { type: "br", raw: e[0] };
|
|
1536
1516
|
}
|
|
1537
1517
|
del(t, e, n = "") {
|
|
1538
|
-
let
|
|
1539
|
-
if (
|
|
1540
|
-
let s = [...
|
|
1541
|
-
for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (
|
|
1542
|
-
if (l =
|
|
1543
|
-
if (
|
|
1518
|
+
let r = this.rules.inline.delLDelim.exec(t);
|
|
1519
|
+
if (r && (!r[1] || !n || this.rules.inline.punctuation.exec(n))) {
|
|
1520
|
+
let s = [...r[0]].length - 1, l, o, d = s, c = this.rules.inline.delRDelim;
|
|
1521
|
+
for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = c.exec(e)) !== null; ) {
|
|
1522
|
+
if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l || (o = [...l].length, o !== s)) continue;
|
|
1523
|
+
if (r[3] || r[4]) {
|
|
1544
1524
|
d += o;
|
|
1545
1525
|
continue;
|
|
1546
1526
|
}
|
|
1547
1527
|
if (d -= o, d > 0) continue;
|
|
1548
1528
|
o = Math.min(o, o + d);
|
|
1549
|
-
let
|
|
1550
|
-
return { type: "del", raw:
|
|
1529
|
+
let x = [...r[0]][0].length, p = t.slice(0, s + r.index + x + o), m = p.slice(s, -s);
|
|
1530
|
+
return { type: "del", raw: p, text: m, tokens: this.lexer.inlineTokens(m) };
|
|
1551
1531
|
}
|
|
1552
1532
|
}
|
|
1553
1533
|
}
|
|
1554
1534
|
autolink(t) {
|
|
1555
1535
|
let e = this.rules.inline.autolink.exec(t);
|
|
1556
1536
|
if (e) {
|
|
1557
|
-
let n,
|
|
1558
|
-
return e[2] === "@" ? (n = e[1],
|
|
1537
|
+
let n, r;
|
|
1538
|
+
return e[2] === "@" ? (n = e[1], r = "mailto:" + n) : (n = e[1], r = n), { type: "link", raw: e[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
|
|
1559
1539
|
}
|
|
1560
1540
|
}
|
|
1561
1541
|
url(t) {
|
|
1562
1542
|
let e;
|
|
1563
1543
|
if (e = this.rules.inline.url.exec(t)) {
|
|
1564
|
-
let n,
|
|
1565
|
-
if (e[2] === "@") n = e[0],
|
|
1544
|
+
let n, r;
|
|
1545
|
+
if (e[2] === "@") n = e[0], r = "mailto:" + n;
|
|
1566
1546
|
else {
|
|
1567
1547
|
let s;
|
|
1568
1548
|
do
|
|
1569
1549
|
s = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])?.[0] ?? "";
|
|
1570
1550
|
while (s !== e[0]);
|
|
1571
|
-
n = e[0], e[1] === "www." ?
|
|
1551
|
+
n = e[0], e[1] === "www." ? r = "http://" + e[0] : r = e[0];
|
|
1572
1552
|
}
|
|
1573
|
-
return { type: "link", raw: e[0], text: n, href:
|
|
1553
|
+
return { type: "link", raw: e[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
|
|
1574
1554
|
}
|
|
1575
1555
|
}
|
|
1576
1556
|
inlineText(t) {
|
|
@@ -1580,19 +1560,19 @@ ${u}` : u;
|
|
|
1580
1560
|
return { type: "text", raw: e[0], text: e[0], escaped: n };
|
|
1581
1561
|
}
|
|
1582
1562
|
}
|
|
1583
|
-
},
|
|
1563
|
+
}, h(qe, "w"), qe), Ee, pe = (Ee = class {
|
|
1584
1564
|
constructor(t) {
|
|
1585
1565
|
D(this, "tokens");
|
|
1586
1566
|
D(this, "options");
|
|
1587
1567
|
D(this, "state");
|
|
1588
1568
|
D(this, "inlineQueue");
|
|
1589
1569
|
D(this, "tokenizer");
|
|
1590
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Pe, this.options.tokenizer = this.options.tokenizer || new
|
|
1591
|
-
let e = { other: ee, block:
|
|
1592
|
-
this.options.pedantic ? (e.block =
|
|
1570
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Pe, this.options.tokenizer = this.options.tokenizer || new St(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
1571
|
+
let e = { other: ee, block: vt.normal, inline: lt.normal };
|
|
1572
|
+
this.options.pedantic ? (e.block = vt.pedantic, e.inline = lt.pedantic) : this.options.gfm && (e.block = vt.gfm, this.options.breaks ? e.inline = lt.breaks : e.inline = lt.gfm), this.tokenizer.rules = e;
|
|
1593
1573
|
}
|
|
1594
1574
|
static get rules() {
|
|
1595
|
-
return { block:
|
|
1575
|
+
return { block: vt, inline: lt };
|
|
1596
1576
|
}
|
|
1597
1577
|
static lex(t, e) {
|
|
1598
1578
|
return new Ee(e).lex(t);
|
|
@@ -1611,9 +1591,9 @@ ${u}` : u;
|
|
|
1611
1591
|
}
|
|
1612
1592
|
blockTokens(t, e = [], n = !1) {
|
|
1613
1593
|
this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(ee.tabCharGlobal, " ").replace(ee.spaceLine, ""));
|
|
1614
|
-
let
|
|
1594
|
+
let r = 1 / 0;
|
|
1615
1595
|
for (; t; ) {
|
|
1616
|
-
if (t.length <
|
|
1596
|
+
if (t.length < r) r = t.length;
|
|
1617
1597
|
else {
|
|
1618
1598
|
this.infiniteLoopError(t.charCodeAt(0));
|
|
1619
1599
|
break;
|
|
@@ -1680,8 +1660,8 @@ ${u}` : u;
|
|
|
1680
1660
|
let l = t;
|
|
1681
1661
|
if (this.options.extensions?.startBlock) {
|
|
1682
1662
|
let o = 1 / 0, d = t.slice(1), c;
|
|
1683
|
-
this.options.extensions.startBlock.forEach((
|
|
1684
|
-
c =
|
|
1663
|
+
this.options.extensions.startBlock.forEach((x) => {
|
|
1664
|
+
c = x.call({ lexer: this }, d), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
|
|
1685
1665
|
}), o < 1 / 0 && o >= 0 && (l = t.substring(0, o + 1));
|
|
1686
1666
|
}
|
|
1687
1667
|
if (this.state.top && (s = this.tokenizer.paragraph(l))) {
|
|
@@ -1713,14 +1693,14 @@ ${u}` : u;
|
|
|
1713
1693
|
}
|
|
1714
1694
|
inlineTokens(t, e = []) {
|
|
1715
1695
|
this.tokenizer.lexer = this;
|
|
1716
|
-
let n = t,
|
|
1696
|
+
let n = t, r = null;
|
|
1717
1697
|
if (this.tokens.links) {
|
|
1718
1698
|
let c = Object.keys(this.tokens.links);
|
|
1719
|
-
if (c.length > 0) for (; (
|
|
1699
|
+
if (c.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null; ) c.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
1720
1700
|
}
|
|
1721
|
-
for (; (
|
|
1701
|
+
for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
1722
1702
|
let s;
|
|
1723
|
-
for (; (
|
|
1703
|
+
for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null; ) s = r[2] ? r[2].length : 0, n = n.slice(0, r.index + s) + "[" + "a".repeat(r[0].length - s - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
1724
1704
|
n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
1725
1705
|
let l = !1, o = "", d = 1 / 0;
|
|
1726
1706
|
for (; t; ) {
|
|
@@ -1731,7 +1711,7 @@ ${u}` : u;
|
|
|
1731
1711
|
}
|
|
1732
1712
|
l || (o = ""), l = !1;
|
|
1733
1713
|
let c;
|
|
1734
|
-
if (this.options.extensions?.inline?.some((
|
|
1714
|
+
if (this.options.extensions?.inline?.some((p) => (c = p.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
|
|
1735
1715
|
if (c = this.tokenizer.escape(t)) {
|
|
1736
1716
|
t = t.substring(c.raw.length), e.push(c);
|
|
1737
1717
|
continue;
|
|
@@ -1746,8 +1726,8 @@ ${u}` : u;
|
|
|
1746
1726
|
}
|
|
1747
1727
|
if (c = this.tokenizer.reflink(t, this.tokens.links)) {
|
|
1748
1728
|
t = t.substring(c.raw.length);
|
|
1749
|
-
let
|
|
1750
|
-
c.type === "text" &&
|
|
1729
|
+
let p = e.at(-1);
|
|
1730
|
+
c.type === "text" && p?.type === "text" ? (p.raw += c.raw, p.text += c.text) : e.push(c);
|
|
1751
1731
|
continue;
|
|
1752
1732
|
}
|
|
1753
1733
|
if (c = this.tokenizer.emStrong(t, n, o)) {
|
|
@@ -1774,17 +1754,17 @@ ${u}` : u;
|
|
|
1774
1754
|
t = t.substring(c.raw.length), e.push(c);
|
|
1775
1755
|
continue;
|
|
1776
1756
|
}
|
|
1777
|
-
let
|
|
1757
|
+
let x = t;
|
|
1778
1758
|
if (this.options.extensions?.startInline) {
|
|
1779
|
-
let
|
|
1780
|
-
this.options.extensions.startInline.forEach((
|
|
1781
|
-
|
|
1782
|
-
}),
|
|
1759
|
+
let p = 1 / 0, m = t.slice(1), b;
|
|
1760
|
+
this.options.extensions.startInline.forEach((g) => {
|
|
1761
|
+
b = g.call({ lexer: this }, m), typeof b == "number" && b >= 0 && (p = Math.min(p, b));
|
|
1762
|
+
}), p < 1 / 0 && p >= 0 && (x = t.substring(0, p + 1));
|
|
1783
1763
|
}
|
|
1784
|
-
if (c = this.tokenizer.inlineText(
|
|
1764
|
+
if (c = this.tokenizer.inlineText(x)) {
|
|
1785
1765
|
t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
|
|
1786
|
-
let
|
|
1787
|
-
|
|
1766
|
+
let p = e.at(-1);
|
|
1767
|
+
p?.type === "text" ? (p.raw += c.raw, p.text += c.text) : e.push(c);
|
|
1788
1768
|
continue;
|
|
1789
1769
|
}
|
|
1790
1770
|
if (t) {
|
|
@@ -1799,7 +1779,7 @@ ${u}` : u;
|
|
|
1799
1779
|
if (this.options.silent) console.error(e);
|
|
1800
1780
|
else throw new Error(e);
|
|
1801
1781
|
}
|
|
1802
|
-
},
|
|
1782
|
+
}, h(Ee, "l"), Ee), Ve, At = (Ve = class {
|
|
1803
1783
|
constructor(t) {
|
|
1804
1784
|
D(this, "options");
|
|
1805
1785
|
D(this, "parser");
|
|
@@ -1809,10 +1789,10 @@ ${u}` : u;
|
|
|
1809
1789
|
return "";
|
|
1810
1790
|
}
|
|
1811
1791
|
code({ text: t, lang: e, escaped: n }) {
|
|
1812
|
-
let
|
|
1792
|
+
let r = (e || "").match(ee.notSpaceStart)?.[0], s = t.replace(ee.endingNewline, "") + `
|
|
1813
1793
|
`;
|
|
1814
|
-
return
|
|
1815
|
-
` : "<pre><code>" + (n ? s :
|
|
1794
|
+
return r ? '<pre><code class="language-' + xe(r) + '">' + (n ? s : xe(s, !0)) + `</code></pre>
|
|
1795
|
+
` : "<pre><code>" + (n ? s : xe(s, !0)) + `</code></pre>
|
|
1816
1796
|
`;
|
|
1817
1797
|
}
|
|
1818
1798
|
blockquote({ tokens: t }) {
|
|
@@ -1835,14 +1815,14 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
1835
1815
|
`;
|
|
1836
1816
|
}
|
|
1837
1817
|
list(t) {
|
|
1838
|
-
let e = t.ordered, n = t.start,
|
|
1818
|
+
let e = t.ordered, n = t.start, r = "";
|
|
1839
1819
|
for (let o = 0; o < t.items.length; o++) {
|
|
1840
1820
|
let d = t.items[o];
|
|
1841
|
-
|
|
1821
|
+
r += this.listitem(d);
|
|
1842
1822
|
}
|
|
1843
1823
|
let s = e ? "ol" : "ul", l = e && n !== 1 ? ' start="' + n + '"' : "";
|
|
1844
1824
|
return "<" + s + l + `>
|
|
1845
|
-
` +
|
|
1825
|
+
` + r + "</" + s + `>
|
|
1846
1826
|
`;
|
|
1847
1827
|
}
|
|
1848
1828
|
listitem(t) {
|
|
@@ -1860,17 +1840,17 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
1860
1840
|
let e = "", n = "";
|
|
1861
1841
|
for (let s = 0; s < t.header.length; s++) n += this.tablecell(t.header[s]);
|
|
1862
1842
|
e += this.tablerow({ text: n });
|
|
1863
|
-
let
|
|
1843
|
+
let r = "";
|
|
1864
1844
|
for (let s = 0; s < t.rows.length; s++) {
|
|
1865
1845
|
let l = t.rows[s];
|
|
1866
1846
|
n = "";
|
|
1867
1847
|
for (let o = 0; o < l.length; o++) n += this.tablecell(l[o]);
|
|
1868
|
-
|
|
1848
|
+
r += this.tablerow({ text: n });
|
|
1869
1849
|
}
|
|
1870
|
-
return
|
|
1850
|
+
return r && (r = `<tbody>${r}</tbody>`), `<table>
|
|
1871
1851
|
<thead>
|
|
1872
1852
|
` + e + `</thead>
|
|
1873
|
-
` +
|
|
1853
|
+
` + r + `</table>
|
|
1874
1854
|
`;
|
|
1875
1855
|
}
|
|
1876
1856
|
tablerow({ text: t }) {
|
|
@@ -1890,7 +1870,7 @@ ${t}</tr>
|
|
|
1890
1870
|
return `<em>${this.parser.parseInline(t)}</em>`;
|
|
1891
1871
|
}
|
|
1892
1872
|
codespan({ text: t }) {
|
|
1893
|
-
return `<code>${
|
|
1873
|
+
return `<code>${xe(t, !0)}</code>`;
|
|
1894
1874
|
}
|
|
1895
1875
|
br(t) {
|
|
1896
1876
|
return "<br>";
|
|
@@ -1899,24 +1879,24 @@ ${t}</tr>
|
|
|
1899
1879
|
return `<del>${this.parser.parseInline(t)}</del>`;
|
|
1900
1880
|
}
|
|
1901
1881
|
link({ href: t, title: e, tokens: n }) {
|
|
1902
|
-
let
|
|
1903
|
-
if (s === null) return
|
|
1882
|
+
let r = this.parser.parseInline(n), s = es(t);
|
|
1883
|
+
if (s === null) return r;
|
|
1904
1884
|
t = s;
|
|
1905
1885
|
let l = '<a href="' + t + '"';
|
|
1906
|
-
return e && (l += ' title="' +
|
|
1886
|
+
return e && (l += ' title="' + xe(e) + '"'), l += ">" + r + "</a>", l;
|
|
1907
1887
|
}
|
|
1908
|
-
image({ href: t, title: e, text: n, tokens:
|
|
1909
|
-
|
|
1888
|
+
image({ href: t, title: e, text: n, tokens: r }) {
|
|
1889
|
+
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
1910
1890
|
let s = es(t);
|
|
1911
|
-
if (s === null) return
|
|
1891
|
+
if (s === null) return xe(n);
|
|
1912
1892
|
t = s;
|
|
1913
|
-
let l = `<img src="${t}" alt="${
|
|
1914
|
-
return e && (l += ` title="${
|
|
1893
|
+
let l = `<img src="${t}" alt="${xe(n)}"`;
|
|
1894
|
+
return e && (l += ` title="${xe(e)}"`), l += ">", l;
|
|
1915
1895
|
}
|
|
1916
1896
|
text(t) {
|
|
1917
|
-
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text :
|
|
1897
|
+
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : xe(t.text);
|
|
1918
1898
|
}
|
|
1919
|
-
},
|
|
1899
|
+
}, h(Ve, "y"), Ve), Ye, pn = (Ye = class {
|
|
1920
1900
|
strong({ text: t }) {
|
|
1921
1901
|
return t;
|
|
1922
1902
|
}
|
|
@@ -1947,12 +1927,12 @@ ${t}</tr>
|
|
|
1947
1927
|
checkbox({ raw: t }) {
|
|
1948
1928
|
return t;
|
|
1949
1929
|
}
|
|
1950
|
-
},
|
|
1930
|
+
}, h(Ye, "L"), Ye), _e, de = (_e = class {
|
|
1951
1931
|
constructor(t) {
|
|
1952
1932
|
D(this, "options");
|
|
1953
1933
|
D(this, "renderer");
|
|
1954
1934
|
D(this, "textRenderer");
|
|
1955
|
-
this.options = t || Pe, this.options.renderer = this.options.renderer || new
|
|
1935
|
+
this.options = t || Pe, this.options.renderer = this.options.renderer || new At(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new pn();
|
|
1956
1936
|
}
|
|
1957
1937
|
static parse(t, e) {
|
|
1958
1938
|
return new _e(e).parse(t);
|
|
@@ -1964,15 +1944,15 @@ ${t}</tr>
|
|
|
1964
1944
|
this.renderer.parser = this;
|
|
1965
1945
|
let e = "";
|
|
1966
1946
|
for (let n = 0; n < t.length; n++) {
|
|
1967
|
-
let
|
|
1968
|
-
if (this.options.extensions?.renderers?.[
|
|
1969
|
-
let l =
|
|
1947
|
+
let r = t[n];
|
|
1948
|
+
if (this.options.extensions?.renderers?.[r.type]) {
|
|
1949
|
+
let l = r, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
|
|
1970
1950
|
if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(l.type)) {
|
|
1971
1951
|
e += o || "";
|
|
1972
1952
|
continue;
|
|
1973
1953
|
}
|
|
1974
1954
|
}
|
|
1975
|
-
let s =
|
|
1955
|
+
let s = r;
|
|
1976
1956
|
switch (s.type) {
|
|
1977
1957
|
case "space": {
|
|
1978
1958
|
e += this.renderer.space(s);
|
|
@@ -2034,8 +2014,8 @@ ${t}</tr>
|
|
|
2034
2014
|
parseInline(t, e = this.renderer) {
|
|
2035
2015
|
this.renderer.parser = this;
|
|
2036
2016
|
let n = "";
|
|
2037
|
-
for (let
|
|
2038
|
-
let s = t[
|
|
2017
|
+
for (let r = 0; r < t.length; r++) {
|
|
2018
|
+
let s = t[r];
|
|
2039
2019
|
if (this.options.extensions?.renderers?.[s.type]) {
|
|
2040
2020
|
let o = this.options.extensions.renderers[s.type].call({ parser: this }, s);
|
|
2041
2021
|
if (o !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type)) {
|
|
@@ -2098,7 +2078,7 @@ ${t}</tr>
|
|
|
2098
2078
|
}
|
|
2099
2079
|
return n;
|
|
2100
2080
|
}
|
|
2101
|
-
},
|
|
2081
|
+
}, h(_e, "l"), _e), Ae, ut = (Ae = class {
|
|
2102
2082
|
constructor(t) {
|
|
2103
2083
|
D(this, "options");
|
|
2104
2084
|
D(this, "block");
|
|
@@ -2122,36 +2102,36 @@ ${t}</tr>
|
|
|
2122
2102
|
provideParser(t = this.block) {
|
|
2123
2103
|
return t ? de.parse : de.parseInline;
|
|
2124
2104
|
}
|
|
2125
|
-
},
|
|
2105
|
+
}, h(Ae, "P"), D(Ae, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), D(Ae, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Ae), Ze, ci = (Ze = class {
|
|
2126
2106
|
constructor(...t) {
|
|
2127
|
-
D(this, "defaults",
|
|
2107
|
+
D(this, "defaults", sn());
|
|
2128
2108
|
D(this, "options", this.setOptions);
|
|
2129
2109
|
D(this, "parse", this.parseMarkdown(!0));
|
|
2130
2110
|
D(this, "parseInline", this.parseMarkdown(!1));
|
|
2131
2111
|
D(this, "Parser", de);
|
|
2132
|
-
D(this, "Renderer",
|
|
2133
|
-
D(this, "TextRenderer",
|
|
2112
|
+
D(this, "Renderer", At);
|
|
2113
|
+
D(this, "TextRenderer", pn);
|
|
2134
2114
|
D(this, "Lexer", pe);
|
|
2135
|
-
D(this, "Tokenizer",
|
|
2115
|
+
D(this, "Tokenizer", St);
|
|
2136
2116
|
D(this, "Hooks", ut);
|
|
2137
2117
|
this.use(...t);
|
|
2138
2118
|
}
|
|
2139
2119
|
walkTokens(t, e) {
|
|
2140
2120
|
let n = [];
|
|
2141
|
-
for (let
|
|
2121
|
+
for (let r of t) switch (n = n.concat(e.call(this, r)), r.type) {
|
|
2142
2122
|
case "table": {
|
|
2143
|
-
let s =
|
|
2123
|
+
let s = r;
|
|
2144
2124
|
for (let l of s.header) n = n.concat(this.walkTokens(l.tokens, e));
|
|
2145
2125
|
for (let l of s.rows) for (let o of l) n = n.concat(this.walkTokens(o.tokens, e));
|
|
2146
2126
|
break;
|
|
2147
2127
|
}
|
|
2148
2128
|
case "list": {
|
|
2149
|
-
let s =
|
|
2129
|
+
let s = r;
|
|
2150
2130
|
n = n.concat(this.walkTokens(s.items, e));
|
|
2151
2131
|
break;
|
|
2152
2132
|
}
|
|
2153
2133
|
default: {
|
|
2154
|
-
let s =
|
|
2134
|
+
let s = r;
|
|
2155
2135
|
this.defaults.extensions?.childTokens?.[s.type] ? this.defaults.extensions.childTokens[s.type].forEach((l) => {
|
|
2156
2136
|
let o = s[l].flat(1 / 0);
|
|
2157
2137
|
n = n.concat(this.walkTokens(o, e));
|
|
@@ -2163,8 +2143,8 @@ ${t}</tr>
|
|
|
2163
2143
|
use(...t) {
|
|
2164
2144
|
let e = this.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
2165
2145
|
return t.forEach((n) => {
|
|
2166
|
-
let
|
|
2167
|
-
if (
|
|
2146
|
+
let r = { ...n };
|
|
2147
|
+
if (r.async = this.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((s) => {
|
|
2168
2148
|
if (!s.name) throw new Error("extension name required");
|
|
2169
2149
|
if ("renderer" in s) {
|
|
2170
2150
|
let l = e.renderers[s.name];
|
|
@@ -2179,31 +2159,31 @@ ${t}</tr>
|
|
|
2179
2159
|
l ? l.unshift(s.tokenizer) : e[s.level] = [s.tokenizer], s.start && (s.level === "block" ? e.startBlock ? e.startBlock.push(s.start) : e.startBlock = [s.start] : s.level === "inline" && (e.startInline ? e.startInline.push(s.start) : e.startInline = [s.start]));
|
|
2180
2160
|
}
|
|
2181
2161
|
"childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
|
|
2182
|
-
}),
|
|
2183
|
-
let s = this.defaults.renderer || new
|
|
2162
|
+
}), r.extensions = e), n.renderer) {
|
|
2163
|
+
let s = this.defaults.renderer || new At(this.defaults);
|
|
2184
2164
|
for (let l in n.renderer) {
|
|
2185
2165
|
if (!(l in s)) throw new Error(`renderer '${l}' does not exist`);
|
|
2186
2166
|
if (["options", "parser"].includes(l)) continue;
|
|
2187
2167
|
let o = l, d = n.renderer[o], c = s[o];
|
|
2188
|
-
s[o] = (...
|
|
2189
|
-
let
|
|
2190
|
-
return
|
|
2168
|
+
s[o] = (...x) => {
|
|
2169
|
+
let p = d.apply(s, x);
|
|
2170
|
+
return p === !1 && (p = c.apply(s, x)), p || "";
|
|
2191
2171
|
};
|
|
2192
2172
|
}
|
|
2193
|
-
|
|
2173
|
+
r.renderer = s;
|
|
2194
2174
|
}
|
|
2195
2175
|
if (n.tokenizer) {
|
|
2196
|
-
let s = this.defaults.tokenizer || new
|
|
2176
|
+
let s = this.defaults.tokenizer || new St(this.defaults);
|
|
2197
2177
|
for (let l in n.tokenizer) {
|
|
2198
2178
|
if (!(l in s)) throw new Error(`tokenizer '${l}' does not exist`);
|
|
2199
2179
|
if (["options", "rules", "lexer"].includes(l)) continue;
|
|
2200
2180
|
let o = l, d = n.tokenizer[o], c = s[o];
|
|
2201
|
-
s[o] = (...
|
|
2202
|
-
let
|
|
2203
|
-
return
|
|
2181
|
+
s[o] = (...x) => {
|
|
2182
|
+
let p = d.apply(s, x);
|
|
2183
|
+
return p === !1 && (p = c.apply(s, x)), p;
|
|
2204
2184
|
};
|
|
2205
2185
|
}
|
|
2206
|
-
|
|
2186
|
+
r.tokenizer = s;
|
|
2207
2187
|
}
|
|
2208
2188
|
if (n.hooks) {
|
|
2209
2189
|
let s = this.defaults.hooks || new ut();
|
|
@@ -2211,32 +2191,32 @@ ${t}</tr>
|
|
|
2211
2191
|
if (!(l in s)) throw new Error(`hook '${l}' does not exist`);
|
|
2212
2192
|
if (["options", "block"].includes(l)) continue;
|
|
2213
2193
|
let o = l, d = n.hooks[o], c = s[o];
|
|
2214
|
-
ut.passThroughHooks.has(l) ? s[o] = (
|
|
2194
|
+
ut.passThroughHooks.has(l) ? s[o] = (x) => {
|
|
2215
2195
|
if (this.defaults.async && ut.passThroughHooksRespectAsync.has(l)) return (async () => {
|
|
2216
|
-
let
|
|
2217
|
-
return c.call(s,
|
|
2196
|
+
let m = await d.call(s, x);
|
|
2197
|
+
return c.call(s, m);
|
|
2218
2198
|
})();
|
|
2219
|
-
let
|
|
2220
|
-
return c.call(s,
|
|
2221
|
-
} : s[o] = (...
|
|
2199
|
+
let p = d.call(s, x);
|
|
2200
|
+
return c.call(s, p);
|
|
2201
|
+
} : s[o] = (...x) => {
|
|
2222
2202
|
if (this.defaults.async) return (async () => {
|
|
2223
|
-
let
|
|
2224
|
-
return
|
|
2203
|
+
let m = await d.apply(s, x);
|
|
2204
|
+
return m === !1 && (m = await c.apply(s, x)), m;
|
|
2225
2205
|
})();
|
|
2226
|
-
let
|
|
2227
|
-
return
|
|
2206
|
+
let p = d.apply(s, x);
|
|
2207
|
+
return p === !1 && (p = c.apply(s, x)), p;
|
|
2228
2208
|
};
|
|
2229
2209
|
}
|
|
2230
|
-
|
|
2210
|
+
r.hooks = s;
|
|
2231
2211
|
}
|
|
2232
2212
|
if (n.walkTokens) {
|
|
2233
2213
|
let s = this.defaults.walkTokens, l = n.walkTokens;
|
|
2234
|
-
|
|
2214
|
+
r.walkTokens = function(o) {
|
|
2235
2215
|
let d = [];
|
|
2236
2216
|
return d.push(l.call(this, o)), s && (d = d.concat(s.call(this, o))), d;
|
|
2237
2217
|
};
|
|
2238
2218
|
}
|
|
2239
|
-
this.defaults = { ...this.defaults, ...
|
|
2219
|
+
this.defaults = { ...this.defaults, ...r };
|
|
2240
2220
|
}), this;
|
|
2241
2221
|
}
|
|
2242
2222
|
setOptions(t) {
|
|
@@ -2250,15 +2230,15 @@ ${t}</tr>
|
|
|
2250
2230
|
}
|
|
2251
2231
|
parseMarkdown(t) {
|
|
2252
2232
|
return (e, n) => {
|
|
2253
|
-
let
|
|
2254
|
-
if (this.defaults.async === !0 &&
|
|
2233
|
+
let r = { ...n }, s = { ...this.defaults, ...r }, l = this.onError(!!s.silent, !!s.async);
|
|
2234
|
+
if (this.defaults.async === !0 && r.async === !1) return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
2255
2235
|
if (typeof e > "u" || e === null) return l(new Error("marked(): input parameter is undefined or null"));
|
|
2256
2236
|
if (typeof e != "string") return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
|
|
2257
2237
|
if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
|
|
2258
2238
|
let o = s.hooks ? await s.hooks.preprocess(e) : e, d = await (s.hooks ? await s.hooks.provideLexer(t) : t ? pe.lex : pe.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(d) : d;
|
|
2259
2239
|
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
2260
|
-
let
|
|
2261
|
-
return s.hooks ? await s.hooks.postprocess(
|
|
2240
|
+
let x = await (s.hooks ? await s.hooks.provideParser(t) : t ? de.parse : de.parseInline)(c, s);
|
|
2241
|
+
return s.hooks ? await s.hooks.postprocess(x) : x;
|
|
2262
2242
|
})().catch(l);
|
|
2263
2243
|
try {
|
|
2264
2244
|
s.hooks && (e = s.hooks.preprocess(e));
|
|
@@ -2275,22 +2255,22 @@ ${t}</tr>
|
|
|
2275
2255
|
return (n) => {
|
|
2276
2256
|
if (n.message += `
|
|
2277
2257
|
Please report this to https://github.com/markedjs/marked.`, t) {
|
|
2278
|
-
let
|
|
2279
|
-
return e ? Promise.resolve(
|
|
2258
|
+
let r = "<p>An error occurred:</p><pre>" + xe(n.message + "", !0) + "</pre>";
|
|
2259
|
+
return e ? Promise.resolve(r) : r;
|
|
2280
2260
|
}
|
|
2281
2261
|
if (e) return Promise.reject(n);
|
|
2282
2262
|
throw n;
|
|
2283
2263
|
};
|
|
2284
2264
|
}
|
|
2285
|
-
},
|
|
2265
|
+
}, h(Ze, "D"), Ze), ze = new ci();
|
|
2286
2266
|
function O(a, t) {
|
|
2287
2267
|
return ze.parse(a, t);
|
|
2288
2268
|
}
|
|
2289
|
-
|
|
2269
|
+
h(O, "g");
|
|
2290
2270
|
O.options = O.setOptions = function(a) {
|
|
2291
2271
|
return ze.setOptions(a), O.defaults = ze.defaults, fs(O.defaults), O;
|
|
2292
2272
|
};
|
|
2293
|
-
O.getDefaults =
|
|
2273
|
+
O.getDefaults = sn;
|
|
2294
2274
|
O.defaults = Pe;
|
|
2295
2275
|
O.use = function(...a) {
|
|
2296
2276
|
return ze.use(...a), O.defaults = ze.defaults, fs(O.defaults), O;
|
|
@@ -2301,11 +2281,11 @@ O.walkTokens = function(a, t) {
|
|
|
2301
2281
|
O.parseInline = ze.parseInline;
|
|
2302
2282
|
O.Parser = de;
|
|
2303
2283
|
O.parser = de.parse;
|
|
2304
|
-
O.Renderer =
|
|
2305
|
-
O.TextRenderer =
|
|
2284
|
+
O.Renderer = At;
|
|
2285
|
+
O.TextRenderer = pn;
|
|
2306
2286
|
O.Lexer = pe;
|
|
2307
2287
|
O.lexer = pe.lex;
|
|
2308
|
-
O.Tokenizer =
|
|
2288
|
+
O.Tokenizer = St;
|
|
2309
2289
|
O.Hooks = ut;
|
|
2310
2290
|
O.parse = O;
|
|
2311
2291
|
O.options;
|
|
@@ -2315,7 +2295,7 @@ O.walkTokens;
|
|
|
2315
2295
|
O.parseInline;
|
|
2316
2296
|
de.parse;
|
|
2317
2297
|
pe.lex;
|
|
2318
|
-
const
|
|
2298
|
+
const ui = ["innerHTML"], Kt = /* @__PURE__ */ ve({
|
|
2319
2299
|
__name: "ChatRichText",
|
|
2320
2300
|
props: {
|
|
2321
2301
|
text: {},
|
|
@@ -2325,7 +2305,7 @@ const ur = ["innerHTML"], Qt = /* @__PURE__ */ we({
|
|
|
2325
2305
|
setup(a) {
|
|
2326
2306
|
const t = a, e = as(t.text);
|
|
2327
2307
|
let n;
|
|
2328
|
-
|
|
2308
|
+
Xe(
|
|
2329
2309
|
[() => t.text, () => t.streaming],
|
|
2330
2310
|
([l, o]) => {
|
|
2331
2311
|
if (!o) {
|
|
@@ -2339,8 +2319,8 @@ const ur = ["innerHTML"], Qt = /* @__PURE__ */ we({
|
|
|
2339
2319
|
), ls(() => {
|
|
2340
2320
|
n !== void 0 && cancelAnimationFrame(n);
|
|
2341
2321
|
});
|
|
2342
|
-
const
|
|
2343
|
-
|
|
2322
|
+
const r = new O.Renderer();
|
|
2323
|
+
r.link = ({ href: l, text: o }) => {
|
|
2344
2324
|
let d = !1;
|
|
2345
2325
|
if (typeof window < "u")
|
|
2346
2326
|
try {
|
|
@@ -2349,45 +2329,45 @@ const ur = ["innerHTML"], Qt = /* @__PURE__ */ we({
|
|
|
2349
2329
|
d = !1;
|
|
2350
2330
|
}
|
|
2351
2331
|
return d ? `<a href="${l}">${o}</a>` : `<a href="${l}" target="_blank" rel="noopener noreferrer">${o}</a>`;
|
|
2352
|
-
}, O.setOptions({ breaks: !0, gfm: !0, renderer:
|
|
2353
|
-
const s =
|
|
2332
|
+
}, O.setOptions({ breaks: !0, gfm: !0, renderer: r });
|
|
2333
|
+
const s = B(() => {
|
|
2354
2334
|
const l = e.value;
|
|
2355
2335
|
if (!l) return "";
|
|
2356
2336
|
const o = O.parse(l, { async: !1 });
|
|
2357
|
-
return
|
|
2337
|
+
return yr.sanitize(o, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
|
|
2358
2338
|
});
|
|
2359
|
-
return (l, o) => (
|
|
2360
|
-
class:
|
|
2339
|
+
return (l, o) => (y(), T("div", {
|
|
2340
|
+
class: E(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", a.inverted ? "chat-msg-prose-invert" : ""]),
|
|
2361
2341
|
innerHTML: s.value
|
|
2362
|
-
}, null, 10,
|
|
2342
|
+
}, null, 10, ui));
|
|
2363
2343
|
}
|
|
2364
|
-
}),
|
|
2344
|
+
}), hi = 80, pi = /* @__PURE__ */ ve({
|
|
2365
2345
|
__name: "ChatScroller",
|
|
2366
2346
|
setup(a, { expose: t }) {
|
|
2367
2347
|
const e = Q(), n = Q();
|
|
2368
|
-
let
|
|
2348
|
+
let r = !0, s;
|
|
2369
2349
|
function l() {
|
|
2370
2350
|
const c = e.value;
|
|
2371
2351
|
c && (c.scrollTop = c.scrollHeight);
|
|
2372
2352
|
}
|
|
2373
|
-
|
|
2353
|
+
h(l, "scrollToBottom");
|
|
2374
2354
|
function o() {
|
|
2375
2355
|
const c = e.value;
|
|
2376
|
-
c && (
|
|
2356
|
+
c && (r = c.scrollHeight - c.scrollTop - c.clientHeight <= hi);
|
|
2377
2357
|
}
|
|
2378
|
-
|
|
2358
|
+
h(o, "onScroll");
|
|
2379
2359
|
function d() {
|
|
2380
|
-
|
|
2360
|
+
r = !0, l();
|
|
2381
2361
|
}
|
|
2382
|
-
return
|
|
2362
|
+
return h(d, "pin"), t({ pin: d }), Et(() => {
|
|
2383
2363
|
requestAnimationFrame(() => {
|
|
2384
2364
|
l(), requestAnimationFrame(l);
|
|
2385
2365
|
}), n.value && (s = new ResizeObserver(() => {
|
|
2386
|
-
|
|
2366
|
+
r && l();
|
|
2387
2367
|
}), s.observe(n.value));
|
|
2388
2368
|
}), ls(() => {
|
|
2389
2369
|
s?.disconnect();
|
|
2390
|
-
}), (c,
|
|
2370
|
+
}), (c, x) => (y(), T("div", {
|
|
2391
2371
|
ref_key: "viewport",
|
|
2392
2372
|
ref: e,
|
|
2393
2373
|
class: "overflow-y-auto overflow-x-hidden min-h-0 [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
@@ -2397,45 +2377,42 @@ const ur = ["innerHTML"], Qt = /* @__PURE__ */ we({
|
|
|
2397
2377
|
ref_key: "content",
|
|
2398
2378
|
ref: n
|
|
2399
2379
|
}, [
|
|
2400
|
-
|
|
2380
|
+
nn(c.$slots, "default")
|
|
2401
2381
|
], 512)
|
|
2402
2382
|
], 544));
|
|
2403
2383
|
}
|
|
2404
|
-
}),
|
|
2384
|
+
}), di = { class: "@container/chat flex flex-col h-full relative" }, fi = {
|
|
2405
2385
|
key: 0,
|
|
2406
2386
|
class: "pb-4"
|
|
2407
|
-
},
|
|
2387
|
+
}, gi = { class: "pt-4 pb-[120px] px-3 space-y-1" }, mi = {
|
|
2408
2388
|
key: 0,
|
|
2409
2389
|
class: "flex flex-col items-center justify-center px-4 min-h-full"
|
|
2410
|
-
},
|
|
2390
|
+
}, xi = { class: "relative mb-4 size-20 @sm/chat:size-24" }, bi = ["src", "alt"], ki = {
|
|
2411
2391
|
key: 0,
|
|
2412
2392
|
class: "mt-5 flex flex-col items-stretch gap-2 w-full max-w-xs"
|
|
2413
|
-
},
|
|
2414
|
-
key: 1,
|
|
2415
|
-
class: "flex justify-end px-2 pb-2"
|
|
2416
|
-
}, Tr = {
|
|
2393
|
+
}, wi = ["onClick"], vi = ["title"], yi = {
|
|
2417
2394
|
key: 0,
|
|
2418
2395
|
class: "flex items-center gap-3 py-3 px-2"
|
|
2419
|
-
},
|
|
2396
|
+
}, Ti = ["data-issue-code", "data-issue-bucket"], Si = { class: "max-w-[85%] min-w-0" }, Ai = ["href"], Ei = ["data-test"], _i = {
|
|
2420
2397
|
key: 0,
|
|
2421
2398
|
class: "flex-shrink-0 size-7 @sm/chat:size-8"
|
|
2422
|
-
},
|
|
2423
|
-
key:
|
|
2399
|
+
}, Ri = ["src", "alt"], Ii = ["src", "alt"], Ci = ["src"], Di = ["href"], Mi = {
|
|
2400
|
+
key: 1,
|
|
2424
2401
|
"data-test": "messaging-thinking-indicator",
|
|
2425
2402
|
class: "flex gap-2 justify-start items-center mb-4"
|
|
2426
|
-
},
|
|
2403
|
+
}, Li = ["src", "alt"], Oi = {
|
|
2427
2404
|
key: 0,
|
|
2428
2405
|
class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
|
2429
|
-
},
|
|
2406
|
+
}, zi = ["src", "alt"], Pi = { class: "max-w-20 truncate" }, Ni = ["onClick"], $i = {
|
|
2430
2407
|
key: 0,
|
|
2431
2408
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
2432
|
-
},
|
|
2409
|
+
}, Ui = ["disabled"], Bi = {
|
|
2433
2410
|
key: 0,
|
|
2434
2411
|
class: "i-svg-spinners-ring-resize size-4"
|
|
2435
|
-
},
|
|
2412
|
+
}, Fi = {
|
|
2436
2413
|
key: 1,
|
|
2437
2414
|
class: "i-tabler-paperclip size-5"
|
|
2438
|
-
},
|
|
2415
|
+
}, Hi = ["placeholder", "disabled"], Gi = ["disabled"], ta = /* @__PURE__ */ ve({
|
|
2439
2416
|
__name: "ElAgentChat",
|
|
2440
2417
|
props: {
|
|
2441
2418
|
chatController: {},
|
|
@@ -2457,425 +2434,410 @@ const ur = ["innerHTML"], Qt = /* @__PURE__ */ we({
|
|
|
2457
2434
|
"Brief me on tomorrow",
|
|
2458
2435
|
"Triage my inbox",
|
|
2459
2436
|
"What's on my plate this week"
|
|
2460
|
-
], n =
|
|
2437
|
+
], n = B(
|
|
2461
2438
|
() => a.starterPrompts ?? e
|
|
2462
|
-
),
|
|
2463
|
-
const
|
|
2464
|
-
return a.scope === "org" && a.scopeName && (
|
|
2465
|
-
}), s = Q(""), l = Q(!1), o = Q(), d = Q(), c = Q(),
|
|
2466
|
-
function
|
|
2467
|
-
return
|
|
2468
|
-
}
|
|
2469
|
-
|
|
2470
|
-
function
|
|
2471
|
-
return
|
|
2472
|
-
}
|
|
2473
|
-
|
|
2474
|
-
function
|
|
2475
|
-
const
|
|
2476
|
-
return !
|
|
2477
|
-
}
|
|
2478
|
-
|
|
2479
|
-
const
|
|
2439
|
+
), r = B(() => {
|
|
2440
|
+
const _ = { ...t[a.scope] };
|
|
2441
|
+
return a.scope === "org" && a.scopeName && (_.label = a.scopeName, _.tooltip = `Visible to ${a.scopeName} members`), _;
|
|
2442
|
+
}), s = Q(""), l = Q(!1), o = Q(), d = Q(), c = Q(), x = Q([]), p = Q(!1);
|
|
2443
|
+
function m(_) {
|
|
2444
|
+
return _ ? /\[[^\]]+\]\([^)]+\)/.test(_) : !1;
|
|
2445
|
+
}
|
|
2446
|
+
h(m, "containsMarkdownLink");
|
|
2447
|
+
function b(_) {
|
|
2448
|
+
return _.sender === "system" && (!!_.issue || _.id === te.value);
|
|
2449
|
+
}
|
|
2450
|
+
h(b, "isSystemExplainerMessage");
|
|
2451
|
+
function g(_, f) {
|
|
2452
|
+
const k = _[f], L = _[f + 1];
|
|
2453
|
+
return !L || L.sender !== k.sender;
|
|
2454
|
+
}
|
|
2455
|
+
h(g, "shouldShowAvatar");
|
|
2456
|
+
const v = B(() => a.chatController?.textState.value), I = B(() => v.value?.isConnected ?? !1), z = B(() => v.value?.isThinking ?? !1), X = B(() => v.value?.connectionStatus === "disconnected" && !!v.value?.error), re = B(() => v.value?.connectionStatus !== "connected" && !v.value?.error), $ = B(() => v.value?.error), V = B(() => a.chatController?.sharedMessages.value ?? []), te = B(() => {
|
|
2480
2457
|
if (!z.value) return;
|
|
2481
|
-
const
|
|
2482
|
-
return
|
|
2483
|
-
}), fe =
|
|
2484
|
-
() =>
|
|
2485
|
-
), ye =
|
|
2486
|
-
|
|
2487
|
-
a.chatController && !
|
|
2458
|
+
const _ = V.value, f = _[_.length - 1];
|
|
2459
|
+
return f?.sender === "agent" || f?.sender === "system" ? f.id : void 0;
|
|
2460
|
+
}), fe = B(() => z.value ? te.value === void 0 : !1), Re = B(() => v.value?.accountGated ?? !1), be = B(() => !I.value || Re.value), It = B(() => X.value ? "Agent is offline" : re.value ? "Connecting..." : Re.value ? "Resolve the billing issue above to continue" : "Message"), Y = B(() => (s.value.trim() || x.value.length > 0) && !be.value && !p.value), C = B(() => a.variant === "light"), Ie = B(
|
|
2461
|
+
() => C.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
|
|
2462
|
+
), ye = B(() => C.value ? "text-theme-300" : "text-white/30");
|
|
2463
|
+
Et(async () => {
|
|
2464
|
+
a.chatController && !I.value && await a.chatController.startTextConversation();
|
|
2488
2465
|
});
|
|
2489
|
-
function
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
p(Dt, "startNewConversation");
|
|
2493
|
-
async function Ke() {
|
|
2494
|
-
const k = s.value.trim(), m = g.value.length > 0;
|
|
2495
|
-
if (!k && !m || !a.chatController || !C.value || u.value)
|
|
2466
|
+
async function Qe() {
|
|
2467
|
+
const _ = s.value.trim(), f = x.value.length > 0;
|
|
2468
|
+
if (!_ && !f || !a.chatController || !I.value || p.value)
|
|
2496
2469
|
return;
|
|
2497
|
-
const
|
|
2498
|
-
s.value = "",
|
|
2470
|
+
const k = s.value, L = f ? [...x.value] : void 0;
|
|
2471
|
+
s.value = "", x.value = [], d.value && (d.value.style.height = "auto", d.value.focus()), o.value?.pin(), await a.chatController.sendChatMessage(k, L);
|
|
2499
2472
|
}
|
|
2500
|
-
|
|
2501
|
-
async function
|
|
2502
|
-
|
|
2473
|
+
h(Qe, "sendMessage");
|
|
2474
|
+
async function Ct(_) {
|
|
2475
|
+
be.value || (s.value = _, await Qe());
|
|
2503
2476
|
}
|
|
2504
|
-
|
|
2505
|
-
async function
|
|
2506
|
-
|
|
2477
|
+
h(Ct, "sendStarterPrompt");
|
|
2478
|
+
async function Dt(_) {
|
|
2479
|
+
_.key === "Enter" && !_.shiftKey && (_.preventDefault(), await Qe());
|
|
2507
2480
|
}
|
|
2508
|
-
|
|
2509
|
-
function
|
|
2481
|
+
h(Dt, "handleKeydown");
|
|
2482
|
+
function pt() {
|
|
2510
2483
|
d.value && (d.value.style.height = "auto", d.value.style.height = `${Math.min(d.value.scrollHeight, 150)}px`);
|
|
2511
2484
|
}
|
|
2512
|
-
|
|
2513
|
-
function
|
|
2485
|
+
h(pt, "adjustTextareaHeight"), Xe(s, () => Ms(() => pt()));
|
|
2486
|
+
function Mt() {
|
|
2514
2487
|
c.value?.click();
|
|
2515
2488
|
}
|
|
2516
|
-
|
|
2517
|
-
async function
|
|
2518
|
-
const
|
|
2519
|
-
if (!(!
|
|
2520
|
-
|
|
2489
|
+
h(Mt, "triggerFileInput");
|
|
2490
|
+
async function dt(_) {
|
|
2491
|
+
const f = _.target, k = f.files?.[0];
|
|
2492
|
+
if (!(!k || !a.uploadFn)) {
|
|
2493
|
+
p.value = !0;
|
|
2521
2494
|
try {
|
|
2522
|
-
const
|
|
2523
|
-
|
|
2524
|
-
} catch (
|
|
2525
|
-
const
|
|
2526
|
-
a.chatController?.notify(`Upload failed — ${
|
|
2495
|
+
const L = await a.uploadFn(k);
|
|
2496
|
+
x.value = [...x.value, L];
|
|
2497
|
+
} catch (L) {
|
|
2498
|
+
const N = L instanceof Error ? L.message : "Couldn't attach that file.";
|
|
2499
|
+
a.chatController?.notify(`Upload failed — ${N}`);
|
|
2527
2500
|
} finally {
|
|
2528
|
-
|
|
2501
|
+
p.value = !1, f.value = "";
|
|
2529
2502
|
}
|
|
2530
2503
|
}
|
|
2531
2504
|
}
|
|
2532
|
-
|
|
2533
|
-
function
|
|
2534
|
-
|
|
2535
|
-
}
|
|
2536
|
-
|
|
2537
|
-
function
|
|
2538
|
-
if (
|
|
2539
|
-
const
|
|
2540
|
-
return
|
|
2541
|
-
}
|
|
2542
|
-
const
|
|
2543
|
-
if (!
|
|
2544
|
-
const
|
|
2545
|
-
return new Date(
|
|
2546
|
-
}
|
|
2547
|
-
|
|
2548
|
-
function
|
|
2549
|
-
const
|
|
2550
|
-
|
|
2551
|
-
const
|
|
2552
|
-
if (
|
|
2553
|
-
if (
|
|
2554
|
-
const
|
|
2555
|
-
return `${
|
|
2505
|
+
h(dt, "handleFileSelect");
|
|
2506
|
+
function F(_) {
|
|
2507
|
+
x.value = x.value.filter((f, k) => k !== _);
|
|
2508
|
+
}
|
|
2509
|
+
h(F, "removeAttachment");
|
|
2510
|
+
function Je(_, f) {
|
|
2511
|
+
if (f === 0) {
|
|
2512
|
+
const $e = _[f];
|
|
2513
|
+
return $e?.timestamp ? H(new Date($e.timestamp)) : null;
|
|
2514
|
+
}
|
|
2515
|
+
const k = _[f - 1], L = _[f];
|
|
2516
|
+
if (!k?.timestamp || !L?.timestamp) return null;
|
|
2517
|
+
const N = new Date(k.timestamp).getTime();
|
|
2518
|
+
return new Date(L.timestamp).getTime() - N > 36e5 ? H(new Date(L.timestamp)) : null;
|
|
2519
|
+
}
|
|
2520
|
+
h(Je, "shouldShowTimeDivider");
|
|
2521
|
+
function H(_) {
|
|
2522
|
+
const f = /* @__PURE__ */ new Date(), k = _.toDateString() === f.toDateString(), L = new Date(f);
|
|
2523
|
+
L.setDate(L.getDate() - 1);
|
|
2524
|
+
const N = _.toDateString() === L.toDateString(), ke = _.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
2525
|
+
if (k) return ke;
|
|
2526
|
+
if (N) return `Yesterday, ${ke}`;
|
|
2527
|
+
const Ne = _.getFullYear() === f.getFullYear();
|
|
2528
|
+
return `${_.toLocaleDateString("en-US", {
|
|
2556
2529
|
weekday: "long",
|
|
2557
2530
|
month: "short",
|
|
2558
2531
|
day: "numeric",
|
|
2559
|
-
...
|
|
2560
|
-
})}, ${
|
|
2532
|
+
...Ne ? {} : { year: "numeric" }
|
|
2533
|
+
})}, ${ke}`;
|
|
2561
2534
|
}
|
|
2562
|
-
return
|
|
2563
|
-
|
|
2535
|
+
return h(H, "formatTimeDivider"), (_, f) => (y(), T("div", di, [
|
|
2536
|
+
C.value ? j("", !0) : (y(), T("div", fi, [
|
|
2564
2537
|
Le(Ks, {
|
|
2565
2538
|
agent: a.agent,
|
|
2566
|
-
"is-online":
|
|
2539
|
+
"is-online": I.value
|
|
2567
2540
|
}, null, 8, ["agent", "is-online"])
|
|
2568
2541
|
])),
|
|
2569
|
-
|
|
2542
|
+
X.value ? (y(), T("div", {
|
|
2570
2543
|
key: 1,
|
|
2571
|
-
class:
|
|
2544
|
+
class: E(["py-16 flex flex-col items-center justify-center gap-3 text-sm", C.value ? "text-theme-400" : "text-white/60"])
|
|
2572
2545
|
}, [
|
|
2573
2546
|
A("i", {
|
|
2574
|
-
class:
|
|
2547
|
+
class: E(["i-heroicons-cloud-arrow-down size-8", C.value ? "text-theme-300" : "text-white/40"])
|
|
2575
2548
|
}, null, 2),
|
|
2576
|
-
A("span", null, le(
|
|
2577
|
-
], 2)) :
|
|
2549
|
+
A("span", null, le($.value), 1)
|
|
2550
|
+
], 2)) : re.value ? (y(), T("div", {
|
|
2578
2551
|
key: 2,
|
|
2579
|
-
class:
|
|
2552
|
+
class: E(["py-16 flex flex-col items-center justify-center gap-2 text-sm", C.value ? "text-theme-400" : "text-theme-600"])
|
|
2580
2553
|
}, [
|
|
2581
2554
|
Le(zn, { class: "size-4" })
|
|
2582
|
-
], 2)) : a.setupHint ? (
|
|
2555
|
+
], 2)) : a.setupHint ? (y(), T("div", {
|
|
2583
2556
|
key: 3,
|
|
2584
|
-
class:
|
|
2557
|
+
class: E(["flex items-center justify-center gap-1.5 py-2 text-[11px]", ye.value])
|
|
2585
2558
|
}, [
|
|
2586
|
-
|
|
2559
|
+
f[9] || (f[9] = A("i", { class: "i-tabler-tool size-3" }, null, -1)),
|
|
2587
2560
|
A("span", null, le(a.setupHint), 1)
|
|
2588
|
-
], 2)) :
|
|
2589
|
-
Le(
|
|
2561
|
+
], 2)) : j("", !0),
|
|
2562
|
+
Le(pi, {
|
|
2590
2563
|
ref_key: "chatScroller",
|
|
2591
2564
|
ref: o,
|
|
2592
2565
|
class: "flex-1"
|
|
2593
2566
|
}, {
|
|
2594
2567
|
default: Ls(() => [
|
|
2595
|
-
A("div",
|
|
2596
|
-
|
|
2597
|
-
A("div",
|
|
2568
|
+
A("div", gi, [
|
|
2569
|
+
V.value.length === 0 && !re.value && !X.value ? (y(), T("div", mi, [
|
|
2570
|
+
A("div", xi, [
|
|
2598
2571
|
A("img", {
|
|
2599
2572
|
src: a.agent.avatarUrl.value,
|
|
2600
2573
|
alt: a.agent.displayName.value,
|
|
2601
|
-
class:
|
|
2602
|
-
}, null, 10,
|
|
2603
|
-
|
|
2574
|
+
class: E(["size-full rounded-full object-cover ring-1", C.value ? "ring-black/5" : "ring-white/10"])
|
|
2575
|
+
}, null, 10, bi),
|
|
2576
|
+
I.value ? (y(), T("span", {
|
|
2604
2577
|
key: 0,
|
|
2605
|
-
class:
|
|
2606
|
-
}, [...
|
|
2578
|
+
class: E(["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", C.value ? "bg-white" : "bg-theme-900"])
|
|
2579
|
+
}, [...f[10] || (f[10] = [
|
|
2607
2580
|
A("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
|
|
2608
|
-
])], 2)) :
|
|
2581
|
+
])], 2)) : j("", !0)
|
|
2609
2582
|
]),
|
|
2610
2583
|
A("div", {
|
|
2611
|
-
class:
|
|
2584
|
+
class: E(["text-base @sm/chat:text-lg font-semibold", C.value ? "text-theme-900" : "text-white"])
|
|
2612
2585
|
}, le(a.agent.displayName.value), 3),
|
|
2613
2586
|
A("p", {
|
|
2614
|
-
class:
|
|
2587
|
+
class: E(["mt-1 text-center text-xs @sm/chat:text-sm", ye.value])
|
|
2615
2588
|
}, le(a.emptyStateMessage || "Tap a prompt to get started, or type your own."), 3),
|
|
2616
|
-
n.value.length > 0 && !
|
|
2617
|
-
(
|
|
2618
|
-
key:
|
|
2589
|
+
n.value.length > 0 && !be.value ? (y(), T("div", ki, [
|
|
2590
|
+
(y(!0), T(Se, null, ot(n.value, (k) => (y(), T("button", {
|
|
2591
|
+
key: k,
|
|
2619
2592
|
type: "button",
|
|
2620
2593
|
"data-test": "chat-starter-prompt",
|
|
2621
|
-
class:
|
|
2622
|
-
onClick: /* @__PURE__ */
|
|
2623
|
-
}, le(
|
|
2624
|
-
])) :
|
|
2594
|
+
class: E(["text-left text-sm rounded-2xl px-4 py-2.5 transition-colors cursor-pointer", C.value ? "bg-theme-25 border border-theme-200 text-theme-700 hover:bg-theme-50 hover:border-theme-300" : "bg-white/5 border border-white/10 text-white/80 hover:bg-white/10 hover:border-white/20"]),
|
|
2595
|
+
onClick: /* @__PURE__ */ h((L) => Ct(k), "onClick")
|
|
2596
|
+
}, le(k), 11, wi))), 128))
|
|
2597
|
+
])) : j("", !0),
|
|
2625
2598
|
A("div", {
|
|
2626
|
-
class:
|
|
2627
|
-
title:
|
|
2599
|
+
class: E(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", C.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
2600
|
+
title: r.value.tooltip
|
|
2628
2601
|
}, [
|
|
2629
2602
|
A("i", {
|
|
2630
|
-
class:
|
|
2603
|
+
class: E([r.value.icon, "size-3"])
|
|
2631
2604
|
}, null, 2),
|
|
2632
|
-
A("span", null, le(
|
|
2633
|
-
], 10,
|
|
2634
|
-
])) :
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
type: "button",
|
|
2638
|
-
"data-test": "chat-new-session",
|
|
2639
|
-
class: _(["inline-flex items-center gap-1 text-[11px] rounded-full px-2 py-1 transition-colors", I.value ? "text-theme-400 hover:text-theme-700 hover:bg-theme-50" : "text-white/40 hover:text-white hover:bg-white/5"]),
|
|
2640
|
-
onClick: Dt
|
|
2641
|
-
}, [...m[11] || (m[11] = [
|
|
2642
|
-
A("i", { class: "i-tabler-refresh size-3" }, null, -1),
|
|
2643
|
-
A("span", null, "New chat", -1)
|
|
2644
|
-
])], 2)
|
|
2645
|
-
])) : B("", !0),
|
|
2646
|
-
(T(!0), S(Se, null, ot(W.value, (x, M) => (T(), S(Se, {
|
|
2647
|
-
key: x.id
|
|
2605
|
+
A("span", null, le(r.value.label), 1)
|
|
2606
|
+
], 10, vi)
|
|
2607
|
+
])) : j("", !0),
|
|
2608
|
+
(y(!0), T(Se, null, ot(V.value, (k, L) => (y(), T(Se, {
|
|
2609
|
+
key: k.id
|
|
2648
2610
|
}, [
|
|
2649
|
-
|
|
2611
|
+
Je(V.value, L) ? (y(), T("div", yi, [
|
|
2650
2612
|
A("div", {
|
|
2651
|
-
class:
|
|
2613
|
+
class: E(["flex-1 h-px", Ie.value])
|
|
2652
2614
|
}, null, 2),
|
|
2653
2615
|
A("span", {
|
|
2654
|
-
class:
|
|
2655
|
-
}, le(
|
|
2616
|
+
class: E(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", ye.value])
|
|
2617
|
+
}, le(Je(V.value, L)), 3),
|
|
2656
2618
|
A("div", {
|
|
2657
|
-
class:
|
|
2619
|
+
class: E(["flex-1 h-px", Ie.value])
|
|
2658
2620
|
}, null, 2)
|
|
2659
|
-
])) :
|
|
2660
|
-
|
|
2621
|
+
])) : j("", !0),
|
|
2622
|
+
b(k) ? (y(), T("div", {
|
|
2661
2623
|
key: 1,
|
|
2662
2624
|
"data-test": "messaging-system-msg",
|
|
2663
|
-
"data-issue-code":
|
|
2664
|
-
"data-issue-bucket":
|
|
2625
|
+
"data-issue-code": k.issue?.code,
|
|
2626
|
+
"data-issue-bucket": k.issue?.bucket,
|
|
2665
2627
|
class: "flex gap-2 items-end justify-start mb-4"
|
|
2666
2628
|
}, [
|
|
2667
|
-
A("div",
|
|
2629
|
+
A("div", Si, [
|
|
2668
2630
|
A("div", {
|
|
2669
|
-
class:
|
|
2631
|
+
class: E(["mb-1 pl-1 text-[11px] font-medium", C.value ? "text-theme-500" : "text-white/45"])
|
|
2670
2632
|
}, " System Message ", 2),
|
|
2671
2633
|
A("div", {
|
|
2672
|
-
class:
|
|
2634
|
+
class: E(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content italic", C.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
|
|
2673
2635
|
}, [
|
|
2674
|
-
Le(
|
|
2675
|
-
text:
|
|
2676
|
-
inverted: !
|
|
2677
|
-
streaming:
|
|
2678
|
-
onClick:
|
|
2636
|
+
Le(Kt, {
|
|
2637
|
+
text: k.text,
|
|
2638
|
+
inverted: !C.value,
|
|
2639
|
+
streaming: k.id === te.value,
|
|
2640
|
+
onClick: f[0] || (f[0] = bt(() => {
|
|
2679
2641
|
}, ["stop"]))
|
|
2680
2642
|
}, null, 8, ["text", "inverted", "streaming"]),
|
|
2681
|
-
|
|
2643
|
+
k.issue?.help ? (y(), T("span", {
|
|
2682
2644
|
key: 0,
|
|
2683
|
-
class:
|
|
2684
|
-
}, le(
|
|
2685
|
-
|
|
2645
|
+
class: E(["mt-1.5 block text-[12px]", C.value ? "text-theme-500" : "text-white/55"])
|
|
2646
|
+
}, le(k.issue.help), 3)) : j("", !0),
|
|
2647
|
+
k.issue?.actionUrl && !m(k.text) ? (y(), T("a", {
|
|
2686
2648
|
key: 1,
|
|
2687
|
-
href:
|
|
2649
|
+
href: k.issue.actionUrl,
|
|
2688
2650
|
"data-test": "messaging-system-msg-action",
|
|
2689
|
-
class:
|
|
2690
|
-
onClick:
|
|
2651
|
+
class: E(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", C.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
2652
|
+
onClick: f[1] || (f[1] = bt(() => {
|
|
2691
2653
|
}, ["stop"]))
|
|
2692
2654
|
}, [
|
|
2693
|
-
On(le(
|
|
2694
|
-
|
|
2695
|
-
], 10,
|
|
2655
|
+
On(le(k.issue.actionLabel) + " ", 1),
|
|
2656
|
+
f[11] || (f[11] = A("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
|
|
2657
|
+
], 10, Ai)) : j("", !0)
|
|
2696
2658
|
], 2)
|
|
2697
2659
|
])
|
|
2698
|
-
], 8,
|
|
2660
|
+
], 8, Ti)) : k.sender === "system" ? (y(), T("div", {
|
|
2699
2661
|
key: 2,
|
|
2700
2662
|
"data-test": "messaging-system-status-msg",
|
|
2701
|
-
class:
|
|
2663
|
+
class: E(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", C.value ? "text-theme-500" : "text-white/60"])
|
|
2702
2664
|
}, [
|
|
2703
|
-
|
|
2704
|
-
Le(
|
|
2705
|
-
text:
|
|
2706
|
-
inverted: !
|
|
2707
|
-
onClick:
|
|
2665
|
+
f[12] || (f[12] = A("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
|
|
2666
|
+
Le(Kt, {
|
|
2667
|
+
text: k.text,
|
|
2668
|
+
inverted: !C.value,
|
|
2669
|
+
onClick: f[2] || (f[2] = bt(() => {
|
|
2708
2670
|
}, ["stop"]))
|
|
2709
2671
|
}, null, 8, ["text", "inverted"])
|
|
2710
|
-
], 2)) : (
|
|
2672
|
+
], 2)) : (y(), T("div", {
|
|
2711
2673
|
key: 3,
|
|
2712
|
-
"data-test":
|
|
2713
|
-
class:
|
|
2714
|
-
"justify-end":
|
|
2715
|
-
"justify-start":
|
|
2716
|
-
"mb-4":
|
|
2674
|
+
"data-test": k.sender === "agent" ? "messaging-assistant-msg" : k.sender === "user" ? "messaging-user-msg" : void 0,
|
|
2675
|
+
class: E(["flex gap-2 items-end", {
|
|
2676
|
+
"justify-end": k.sender === "user",
|
|
2677
|
+
"justify-start": k.sender === "agent",
|
|
2678
|
+
"mb-4": g(V.value, L)
|
|
2717
2679
|
}])
|
|
2718
2680
|
}, [
|
|
2719
|
-
|
|
2720
|
-
|
|
2681
|
+
k.sender === "agent" ? (y(), T("div", _i, [
|
|
2682
|
+
g(V.value, L) ? (y(), T("img", {
|
|
2721
2683
|
key: 0,
|
|
2722
2684
|
src: a.agent.avatarUrl.value,
|
|
2723
2685
|
alt: a.agent.displayName.value,
|
|
2724
|
-
class:
|
|
2725
|
-
}, null, 10,
|
|
2726
|
-
])) :
|
|
2686
|
+
class: E(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", C.value ? "ring-1 ring-black/5" : ""])
|
|
2687
|
+
}, null, 10, Ri)) : j("", !0)
|
|
2688
|
+
])) : j("", !0),
|
|
2727
2689
|
A("div", {
|
|
2728
|
-
class:
|
|
2690
|
+
class: E(k.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
|
|
2729
2691
|
}, [
|
|
2730
|
-
|
|
2692
|
+
k.attachments?.length ? (y(), T("div", {
|
|
2731
2693
|
key: 0,
|
|
2732
|
-
class:
|
|
2694
|
+
class: E(["mb-1 space-y-1", k.sender === "user" ? "flex flex-col items-end" : ""])
|
|
2733
2695
|
}, [
|
|
2734
|
-
(
|
|
2735
|
-
|
|
2696
|
+
(y(!0), T(Se, null, ot(k.attachments, (N, ke) => (y(), T(Se, { key: ke }, [
|
|
2697
|
+
N.type === "image" ? (y(), T("img", {
|
|
2736
2698
|
key: 0,
|
|
2737
|
-
src:
|
|
2738
|
-
alt:
|
|
2699
|
+
src: N.src,
|
|
2700
|
+
alt: N.filename,
|
|
2739
2701
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
2740
|
-
}, null, 8,
|
|
2702
|
+
}, null, 8, Ii)) : N.type === "audio" ? (y(), T("audio", {
|
|
2741
2703
|
key: 1,
|
|
2742
|
-
src:
|
|
2704
|
+
src: N.src,
|
|
2743
2705
|
controls: "",
|
|
2744
2706
|
class: "max-w-full"
|
|
2745
|
-
}, null, 8,
|
|
2707
|
+
}, null, 8, Ci)) : (y(), T("a", {
|
|
2746
2708
|
key: 2,
|
|
2747
|
-
href:
|
|
2709
|
+
href: N.src,
|
|
2748
2710
|
target: "_blank",
|
|
2749
2711
|
rel: "noopener",
|
|
2750
|
-
class:
|
|
2712
|
+
class: E(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", C.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
2751
2713
|
}, [
|
|
2752
|
-
|
|
2753
|
-
On(" " + le(
|
|
2754
|
-
], 10,
|
|
2714
|
+
f[13] || (f[13] = A("i", { class: "i-tabler-file size-3.5" }, null, -1)),
|
|
2715
|
+
On(" " + le(N.filename), 1)
|
|
2716
|
+
], 10, Di))
|
|
2755
2717
|
], 64))), 128))
|
|
2756
|
-
], 2)) :
|
|
2757
|
-
|
|
2718
|
+
], 2)) : j("", !0),
|
|
2719
|
+
k.text ? (y(), T("div", {
|
|
2758
2720
|
key: 1,
|
|
2759
|
-
class:
|
|
2760
|
-
|
|
2721
|
+
class: E(["rounded-2xl px-3.5 py-2", [
|
|
2722
|
+
k.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : C.value ? "bg-theme-50 text-theme-800 border border-black/[0.02] rounded-bl-[4px]" : "bg-white/15 backdrop-blur-sm text-white/95 rounded-bl-[4px]"
|
|
2761
2723
|
]])
|
|
2762
2724
|
}, [
|
|
2763
|
-
Le(
|
|
2764
|
-
text:
|
|
2765
|
-
inverted:
|
|
2766
|
-
streaming:
|
|
2767
|
-
onClick:
|
|
2725
|
+
Le(Kt, {
|
|
2726
|
+
text: k.text,
|
|
2727
|
+
inverted: k.sender === "user" || !C.value,
|
|
2728
|
+
streaming: k.id === te.value,
|
|
2729
|
+
onClick: f[3] || (f[3] = bt(() => {
|
|
2768
2730
|
}, ["stop"]))
|
|
2769
2731
|
}, null, 8, ["text", "inverted", "streaming"])
|
|
2770
|
-
], 2)) :
|
|
2732
|
+
], 2)) : j("", !0)
|
|
2771
2733
|
], 2)
|
|
2772
|
-
], 10,
|
|
2734
|
+
], 10, Ei))
|
|
2773
2735
|
], 64))), 128)),
|
|
2774
|
-
fe.value ? (
|
|
2736
|
+
fe.value ? (y(), T("div", Mi, [
|
|
2775
2737
|
A("img", {
|
|
2776
2738
|
src: a.agent.avatarUrl.value,
|
|
2777
2739
|
alt: a.agent.displayName.value,
|
|
2778
|
-
class:
|
|
2779
|
-
}, null, 10,
|
|
2740
|
+
class: E(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", C.value ? "ring-1 ring-black/5" : ""])
|
|
2741
|
+
}, null, 10, Li),
|
|
2780
2742
|
A("div", {
|
|
2781
|
-
class:
|
|
2743
|
+
class: E(["rounded-2xl px-3.5 py-2.5 flex items-center", C.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
|
|
2782
2744
|
}, [
|
|
2783
2745
|
A("i", {
|
|
2784
|
-
class:
|
|
2746
|
+
class: E(["i-svg-spinners-3-dots-bounce size-7", C.value ? "text-theme-400" : "text-white/50"])
|
|
2785
2747
|
}, null, 2)
|
|
2786
2748
|
], 2)
|
|
2787
|
-
])) :
|
|
2749
|
+
])) : j("", !0)
|
|
2788
2750
|
])
|
|
2789
2751
|
]),
|
|
2790
2752
|
_: 1
|
|
2791
2753
|
}, 512),
|
|
2792
2754
|
A("div", {
|
|
2793
|
-
class:
|
|
2755
|
+
class: E(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", C.value ? "bg-gradient-to-t from-theme-50/90 via-theme-50/55 to-transparent" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
|
|
2794
2756
|
}, [
|
|
2795
|
-
|
|
2796
|
-
(
|
|
2797
|
-
key:
|
|
2757
|
+
x.value.length > 0 ? (y(), T("div", Oi, [
|
|
2758
|
+
(y(!0), T(Se, null, ot(x.value, (k, L) => (y(), T("div", {
|
|
2759
|
+
key: L,
|
|
2798
2760
|
class: "relative shrink-0 group"
|
|
2799
2761
|
}, [
|
|
2800
|
-
|
|
2762
|
+
k.type === "image" ? (y(), T("img", {
|
|
2801
2763
|
key: 0,
|
|
2802
|
-
src:
|
|
2803
|
-
alt:
|
|
2804
|
-
class:
|
|
2805
|
-
}, null, 10,
|
|
2764
|
+
src: k.src,
|
|
2765
|
+
alt: k.filename,
|
|
2766
|
+
class: E(["size-14 rounded-xl object-cover border", C.value ? "border-black/10" : "border-white/20"])
|
|
2767
|
+
}, null, 10, zi)) : (y(), T("div", {
|
|
2806
2768
|
key: 1,
|
|
2807
|
-
class:
|
|
2769
|
+
class: E(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", C.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
2808
2770
|
}, [
|
|
2809
|
-
|
|
2810
|
-
A("span",
|
|
2771
|
+
f[14] || (f[14] = A("i", { class: "i-tabler-file size-4" }, null, -1)),
|
|
2772
|
+
A("span", Pi, le(k.filename), 1)
|
|
2811
2773
|
], 2)),
|
|
2812
2774
|
A("button", {
|
|
2813
2775
|
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",
|
|
2814
|
-
onClick: /* @__PURE__ */
|
|
2815
|
-
}, [...
|
|
2776
|
+
onClick: /* @__PURE__ */ h((N) => F(L), "onClick")
|
|
2777
|
+
}, [...f[15] || (f[15] = [
|
|
2816
2778
|
A("i", { class: "i-tabler-x size-3" }, null, -1)
|
|
2817
|
-
])], 8,
|
|
2779
|
+
])], 8, Ni)
|
|
2818
2780
|
]))), 128)),
|
|
2819
|
-
|
|
2781
|
+
p.value ? (y(), T("div", $i, [
|
|
2820
2782
|
Le(zn, { class: "size-5" })
|
|
2821
|
-
])) :
|
|
2822
|
-
])) :
|
|
2823
|
-
a.uploadFn ? (
|
|
2783
|
+
])) : j("", !0)
|
|
2784
|
+
])) : j("", !0),
|
|
2785
|
+
a.uploadFn ? (y(), T("input", {
|
|
2824
2786
|
key: 1,
|
|
2825
2787
|
ref_key: "fileInput",
|
|
2826
2788
|
ref: c,
|
|
2827
2789
|
type: "file",
|
|
2828
2790
|
accept: "image/*,audio/*,video/*",
|
|
2829
2791
|
class: "hidden",
|
|
2830
|
-
onChange:
|
|
2831
|
-
}, null, 544)) :
|
|
2792
|
+
onChange: dt
|
|
2793
|
+
}, null, 544)) : j("", !0),
|
|
2832
2794
|
A("div", {
|
|
2833
|
-
class:
|
|
2795
|
+
class: E(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200", C.value ? l.value ? "bg-theme-50 ring-1 ring-theme-300" : "bg-theme-25 ring-1 ring-theme-200 hover:ring-theme-300" : l.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
|
|
2834
2796
|
}, [
|
|
2835
2797
|
A("button", {
|
|
2836
|
-
class:
|
|
2798
|
+
class: E(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
|
|
2837
2799
|
a.uploadFn ? "cursor-pointer" : "cursor-default",
|
|
2838
|
-
|
|
2839
|
-
|
|
2800
|
+
C.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
|
|
2801
|
+
p.value ? "opacity-50 pointer-events-none" : ""
|
|
2840
2802
|
]]),
|
|
2841
|
-
disabled:
|
|
2842
|
-
onClick:
|
|
2803
|
+
disabled: be.value || p.value || !a.uploadFn,
|
|
2804
|
+
onClick: f[4] || (f[4] = (k) => a.uploadFn && Mt())
|
|
2843
2805
|
}, [
|
|
2844
|
-
|
|
2845
|
-
], 10,
|
|
2846
|
-
|
|
2806
|
+
p.value ? (y(), T("i", Bi)) : (y(), T("i", Fi))
|
|
2807
|
+
], 10, Ui),
|
|
2808
|
+
rs(A("textarea", {
|
|
2847
2809
|
ref_key: "textarea",
|
|
2848
2810
|
ref: d,
|
|
2849
|
-
"onUpdate:modelValue":
|
|
2811
|
+
"onUpdate:modelValue": f[5] || (f[5] = (k) => s.value = k),
|
|
2850
2812
|
"data-test": "messaging-input",
|
|
2851
2813
|
rows: "1",
|
|
2852
2814
|
enterkeyhint: "send",
|
|
2853
2815
|
placeholder: It.value,
|
|
2854
|
-
disabled:
|
|
2816
|
+
disabled: be.value,
|
|
2855
2817
|
style: { fontSize: "16px", resize: "none" },
|
|
2856
|
-
class:
|
|
2857
|
-
onKeydown:
|
|
2858
|
-
onFocus:
|
|
2859
|
-
onBlur:
|
|
2860
|
-
}, null, 42,
|
|
2861
|
-
[
|
|
2818
|
+
class: E(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", C.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
2819
|
+
onKeydown: Dt,
|
|
2820
|
+
onFocus: f[6] || (f[6] = (k) => l.value = !0),
|
|
2821
|
+
onBlur: f[7] || (f[7] = (k) => l.value = !1)
|
|
2822
|
+
}, null, 42, Hi), [
|
|
2823
|
+
[is, s.value]
|
|
2862
2824
|
]),
|
|
2863
2825
|
A("button", {
|
|
2864
2826
|
"data-test": "messaging-send-btn",
|
|
2865
|
-
class:
|
|
2866
|
-
disabled: !
|
|
2867
|
-
onClick:
|
|
2868
|
-
}, [...
|
|
2827
|
+
class: E(["shrink-0 flex items-center justify-center rounded-full transition-transform duration-200 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", Y.value ? "bg-primary-500 text-white hover:scale-105 active:scale-95 cursor-pointer" : C.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
|
|
2828
|
+
disabled: !Y.value,
|
|
2829
|
+
onClick: f[8] || (f[8] = (k) => Qe())
|
|
2830
|
+
}, [...f[16] || (f[16] = [
|
|
2869
2831
|
A("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
|
|
2870
|
-
])], 10,
|
|
2832
|
+
])], 10, Gi)
|
|
2871
2833
|
], 2)
|
|
2872
2834
|
], 2)
|
|
2873
2835
|
]));
|
|
2874
2836
|
}
|
|
2875
|
-
}),
|
|
2837
|
+
}), ji = { class: "agent-wrap" }, Wi = {
|
|
2876
2838
|
key: 0,
|
|
2877
2839
|
class: "flex items-center justify-center h-full"
|
|
2878
|
-
},
|
|
2840
|
+
}, na = /* @__PURE__ */ ve({
|
|
2879
2841
|
__name: "AgentWrap",
|
|
2880
2842
|
props: {
|
|
2881
2843
|
sdk: {},
|
|
@@ -2892,13 +2854,13 @@ const ur = ["innerHTML"], Qt = /* @__PURE__ */ we({
|
|
|
2892
2854
|
const t = zs("AgentWrap"), e = a, n = e.sdk || Ps.getInstance({
|
|
2893
2855
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
2894
2856
|
...e.apiBase && { apiBase: e.apiBase }
|
|
2895
|
-
}),
|
|
2896
|
-
return
|
|
2857
|
+
}), r = Q(!e.agent), s = as(e.agent ? new yt({ config: e.agent }) : void 0), l = Q();
|
|
2858
|
+
return Et(async () => {
|
|
2897
2859
|
if (e.agent) {
|
|
2898
2860
|
t.debug("Agent provided via props, skipping fetch", {
|
|
2899
2861
|
agentId: e.agent.agentId,
|
|
2900
2862
|
handle: e.agent.handle
|
|
2901
|
-
}),
|
|
2863
|
+
}), r.value = !1;
|
|
2902
2864
|
return;
|
|
2903
2865
|
}
|
|
2904
2866
|
if (!e.handle) {
|
|
@@ -2913,13 +2875,13 @@ const ur = ["innerHTML"], Qt = /* @__PURE__ */ we({
|
|
|
2913
2875
|
isDev: n.isDev,
|
|
2914
2876
|
apiBase: n.apiBase
|
|
2915
2877
|
}
|
|
2916
|
-
}),
|
|
2878
|
+
}), r.value = !1;
|
|
2917
2879
|
return;
|
|
2918
2880
|
}
|
|
2919
2881
|
try {
|
|
2920
|
-
|
|
2882
|
+
r.value = !0, t.debug("Fetching public agent", { handle: e.handle });
|
|
2921
2883
|
const o = await n.user.getPublicAgent({ handle: e.handle });
|
|
2922
|
-
o ? (s.value = new
|
|
2884
|
+
o ? (s.value = new yt({ config: o }), t.debug("Successfully fetched public agent", {
|
|
2923
2885
|
agentId: o.agentId,
|
|
2924
2886
|
handle: o.handle
|
|
2925
2887
|
}), o.agentId && n.user.track({
|
|
@@ -2951,9 +2913,9 @@ const ur = ["innerHTML"], Qt = /* @__PURE__ */ we({
|
|
|
2951
2913
|
}
|
|
2952
2914
|
});
|
|
2953
2915
|
} finally {
|
|
2954
|
-
|
|
2916
|
+
r.value = !1, s.value || t.debug("AgentWrap component will render empty (silent failure)", {
|
|
2955
2917
|
state: {
|
|
2956
|
-
loading:
|
|
2918
|
+
loading: r.value,
|
|
2957
2919
|
hasAgent: !!s.value,
|
|
2958
2920
|
error: l.value
|
|
2959
2921
|
},
|
|
@@ -2969,33 +2931,33 @@ const ur = ["innerHTML"], Qt = /* @__PURE__ */ we({
|
|
|
2969
2931
|
}
|
|
2970
2932
|
});
|
|
2971
2933
|
}
|
|
2972
|
-
}), (o, d) => (
|
|
2973
|
-
|
|
2934
|
+
}), (o, d) => (y(), T("div", ji, [
|
|
2935
|
+
r.value ? (y(), T("div", Wi, [...d[0] || (d[0] = [
|
|
2974
2936
|
A("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
|
|
2975
|
-
])])) : s.value ?
|
|
2937
|
+
])])) : s.value ? nn(o.$slots, "default", {
|
|
2976
2938
|
key: 1,
|
|
2977
|
-
sdk:
|
|
2939
|
+
sdk: Qt(n),
|
|
2978
2940
|
agent: s.value,
|
|
2979
2941
|
context: a.context,
|
|
2980
2942
|
firstMessage: a.firstMessage,
|
|
2981
2943
|
buttonText: a.buttonText,
|
|
2982
2944
|
buttonIcon: a.buttonIcon,
|
|
2983
|
-
loading:
|
|
2984
|
-
}) :
|
|
2945
|
+
loading: r.value
|
|
2946
|
+
}) : j("", !0)
|
|
2985
2947
|
]));
|
|
2986
2948
|
}
|
|
2987
2949
|
});
|
|
2988
2950
|
export {
|
|
2989
2951
|
Pn as A,
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2952
|
+
na as _,
|
|
2953
|
+
ta as a,
|
|
2954
|
+
Ji as b,
|
|
2955
|
+
Qi as c,
|
|
2956
|
+
ea as d,
|
|
2995
2957
|
zn as e,
|
|
2996
2958
|
Ks as f,
|
|
2997
|
-
|
|
2959
|
+
Xi as g,
|
|
2998
2960
|
$n as h,
|
|
2999
|
-
|
|
2961
|
+
Ki as p
|
|
3000
2962
|
};
|
|
3001
2963
|
//# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map
|