@doderasoftware/restify-ai 0.1.0-beta.3 → 0.1.0-beta.4
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/restify-ai.js +462 -456
- package/dist/restify-ai.umd.cjs +11 -11
- package/dist/store.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/restify-ai.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var zs = Object.defineProperty;
|
|
2
2
|
var Hs = (n, e, t) => e in n ? zs(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var W = (n, e, t) => Hs(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { ref as q, nextTick as Oe, onUnmounted as yt, computed as O, onMounted as xt, watch as Ue, isRef as Fs, onBeforeUnmount as Bs, defineComponent as he, createElementBlock as v, openBlock as
|
|
4
|
+
import { ref as q, nextTick as Oe, onUnmounted as yt, computed as O, onMounted as xt, watch as Ue, isRef as Fs, onBeforeUnmount as Bs, defineComponent as he, createElementBlock as v, openBlock as w, normalizeClass as T, renderSlot as me, createElementVNode as p, createCommentVNode as B, Fragment as ke, renderList as Ne, toDisplayString as N, createBlock as Me, resolveDynamicComponent as nn, withCtx as Ce, createVNode as ge, normalizeStyle as un, Transition as mt, withModifiers as et, unref as D, withDirectives as Us, vModelText as qs, createStaticVNode as Nn, createTextVNode as js, Teleport as Ws, normalizeProps as Pn, guardReactiveProps as zn } from "vue";
|
|
5
5
|
import { defineStore as Ks } from "pinia";
|
|
6
6
|
let qe = null;
|
|
7
7
|
const Vs = q(null), rs = {
|
|
@@ -64,7 +64,7 @@ function Gs(n) {
|
|
|
64
64
|
function ee() {
|
|
65
65
|
return qe;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function wa() {
|
|
68
68
|
if (!qe)
|
|
69
69
|
throw new Error(
|
|
70
70
|
"[@doderasoftware/restify-ai] Plugin not initialized. Make sure to call app.use(RestifyAiPlugin, config) before using the components."
|
|
@@ -190,7 +190,7 @@ var Js = function(n, e) {
|
|
|
190
190
|
const sn = "text/event-stream", er = 1e3, Bn = "last-event-id";
|
|
191
191
|
function tr(n, e) {
|
|
192
192
|
var { signal: t, headers: s, onopen: r, onmessage: o, onclose: i, onerror: a, openWhenHidden: c, fetch: u } = e, d = Js(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
193
|
-
return new Promise((g,
|
|
193
|
+
return new Promise((g, k) => {
|
|
194
194
|
const y = Object.assign({}, s);
|
|
195
195
|
y.accept || (y.accept = sn);
|
|
196
196
|
let h;
|
|
@@ -205,13 +205,13 @@ function tr(n, e) {
|
|
|
205
205
|
t == null || t.addEventListener("abort", () => {
|
|
206
206
|
S(), g();
|
|
207
207
|
});
|
|
208
|
-
const C = u ?? window.fetch,
|
|
208
|
+
const C = u ?? window.fetch, b = r ?? nr;
|
|
209
209
|
async function z() {
|
|
210
210
|
var F;
|
|
211
211
|
h = new AbortController();
|
|
212
212
|
try {
|
|
213
213
|
const V = await C(n, Object.assign(Object.assign({}, d), { headers: y, signal: h.signal }));
|
|
214
|
-
await
|
|
214
|
+
await b(V), await Qs(V.body, Zs(Ys((E) => {
|
|
215
215
|
E ? y[Bn] = E : delete y[Bn];
|
|
216
216
|
}, (E) => {
|
|
217
217
|
m = E;
|
|
@@ -222,7 +222,7 @@ function tr(n, e) {
|
|
|
222
222
|
const E = (F = a == null ? void 0 : a(V)) !== null && F !== void 0 ? F : m;
|
|
223
223
|
window.clearTimeout(f), f = window.setTimeout(z, E);
|
|
224
224
|
} catch (E) {
|
|
225
|
-
S(),
|
|
225
|
+
S(), k(E);
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
}
|
|
@@ -236,12 +236,18 @@ function nr(n) {
|
|
|
236
236
|
}
|
|
237
237
|
let it = new AbortController();
|
|
238
238
|
function It(n) {
|
|
239
|
+
if (!n)
|
|
240
|
+
throw console.error("[RestifyAi] Endpoint is undefined. Check your endpoints configuration."), new Error("AI service endpoint is not configured. Please contact support.");
|
|
239
241
|
const e = ee(), t = (e == null ? void 0 : e.baseUrl) || "";
|
|
240
242
|
if (!t || n.startsWith("http://") || n.startsWith("https://")) return n;
|
|
241
243
|
const s = t.endsWith("/") ? t.slice(0, -1) : t, r = n.startsWith("/") ? n : `/${n}`;
|
|
242
244
|
return `${s}${r}`;
|
|
243
245
|
}
|
|
244
246
|
function sr(n) {
|
|
247
|
+
const t = (n instanceof Error ? n.message : String(n)).toLowerCase();
|
|
248
|
+
return t.includes("failed to fetch") || t.includes("network") || t.includes("fetch") ? "Unable to connect to the AI service. Please check your internet connection and try again." : t.includes("500") || t.includes("internal server error") ? "The AI service is temporarily unavailable. Please try again in a few moments." : t.includes("timeout") || t.includes("timed out") ? "The request took too long. Please try again." : t.includes("401") || t.includes("unauthorized") || t.includes("authentication") ? "Your session has expired. Please refresh the page and try again." : t.includes("429") || t.includes("rate limit") || t.includes("too many requests") ? "Too many requests. Please wait a moment before trying again." : t.includes("cors") || t.includes("cross-origin") ? "Unable to connect to the AI service. Please contact support." : t.includes("endpoint is not configured") ? "AI service endpoint is not configured. Please contact support." : "Something went wrong. Please try again later.";
|
|
249
|
+
}
|
|
250
|
+
function rr(n) {
|
|
245
251
|
var e, t, s;
|
|
246
252
|
try {
|
|
247
253
|
if (n === "[DONE]") return "[DONE]";
|
|
@@ -251,7 +257,7 @@ function sr(n) {
|
|
|
251
257
|
return null;
|
|
252
258
|
}
|
|
253
259
|
}
|
|
254
|
-
function
|
|
260
|
+
function or(n) {
|
|
255
261
|
return new Promise((e) => setTimeout(e, n));
|
|
256
262
|
}
|
|
257
263
|
function Pe(n) {
|
|
@@ -265,14 +271,14 @@ function $t(n) {
|
|
|
265
271
|
console.warn("[RestifyAi] Failed to save chat history:", e);
|
|
266
272
|
}
|
|
267
273
|
}
|
|
268
|
-
function
|
|
274
|
+
function ir(n) {
|
|
269
275
|
try {
|
|
270
276
|
n.message || n.failedQuestion ? sessionStorage.setItem("restify_ai_error_state", JSON.stringify(n)) : sessionStorage.removeItem("restify_ai_error_state");
|
|
271
277
|
} catch (e) {
|
|
272
278
|
console.warn("[RestifyAi] Failed to save error state:", e);
|
|
273
279
|
}
|
|
274
280
|
}
|
|
275
|
-
function
|
|
281
|
+
function ar() {
|
|
276
282
|
try {
|
|
277
283
|
const n = sessionStorage.getItem("restify_ai_error_state");
|
|
278
284
|
if (n)
|
|
@@ -282,14 +288,14 @@ function ir() {
|
|
|
282
288
|
}
|
|
283
289
|
return null;
|
|
284
290
|
}
|
|
285
|
-
function
|
|
291
|
+
function lr() {
|
|
286
292
|
try {
|
|
287
293
|
sessionStorage.removeItem("restify_ai_error_state");
|
|
288
294
|
} catch (n) {
|
|
289
295
|
console.warn("[RestifyAi] Failed to clear error state:", n);
|
|
290
296
|
}
|
|
291
297
|
}
|
|
292
|
-
function
|
|
298
|
+
function ur() {
|
|
293
299
|
try {
|
|
294
300
|
const n = sessionStorage.getItem(Pe("chatHistory"));
|
|
295
301
|
if (n) {
|
|
@@ -318,7 +324,7 @@ function lr() {
|
|
|
318
324
|
}
|
|
319
325
|
return { history: [], hasOrphanedUserMessage: !1 };
|
|
320
326
|
}
|
|
321
|
-
function
|
|
327
|
+
function cr() {
|
|
322
328
|
try {
|
|
323
329
|
sessionStorage.removeItem(Pe("chatHistory"));
|
|
324
330
|
} catch (n) {
|
|
@@ -332,7 +338,7 @@ function Qt(n) {
|
|
|
332
338
|
console.warn("[RestifyAi] Failed to save drawer state:", e);
|
|
333
339
|
}
|
|
334
340
|
}
|
|
335
|
-
function
|
|
341
|
+
function dr() {
|
|
336
342
|
try {
|
|
337
343
|
const n = localStorage.getItem(Pe("drawerState"));
|
|
338
344
|
if (n !== null)
|
|
@@ -342,7 +348,7 @@ function cr() {
|
|
|
342
348
|
}
|
|
343
349
|
return !1;
|
|
344
350
|
}
|
|
345
|
-
function
|
|
351
|
+
function pr() {
|
|
346
352
|
try {
|
|
347
353
|
return localStorage.getItem(Pe("setupComplete")) === "true";
|
|
348
354
|
} catch {
|
|
@@ -356,7 +362,7 @@ function Un() {
|
|
|
356
362
|
console.warn("[RestifyAi] Failed to mark setup complete:", n);
|
|
357
363
|
}
|
|
358
364
|
}
|
|
359
|
-
function
|
|
365
|
+
function hr(n) {
|
|
360
366
|
const e = {};
|
|
361
367
|
return n.forEach((t) => {
|
|
362
368
|
var s;
|
|
@@ -377,7 +383,7 @@ function qn() {
|
|
|
377
383
|
}
|
|
378
384
|
const We = Ks("restifyAiStore", {
|
|
379
385
|
state: () => {
|
|
380
|
-
const n =
|
|
386
|
+
const n = ur(), e = ar();
|
|
381
387
|
let t = {
|
|
382
388
|
message: null,
|
|
383
389
|
failedQuestion: null,
|
|
@@ -400,9 +406,9 @@ const We = Ks("restifyAiStore", {
|
|
|
400
406
|
}), {
|
|
401
407
|
chatHistoryLimit: tt("chatHistoryLimit") || 15,
|
|
402
408
|
chatHistory: n.history,
|
|
403
|
-
uploadedFiles:
|
|
409
|
+
uploadedFiles: hr(n.history),
|
|
404
410
|
loading: !1,
|
|
405
|
-
showChat:
|
|
411
|
+
showChat: dr(),
|
|
406
412
|
isFullscreen: !1,
|
|
407
413
|
sending: !1,
|
|
408
414
|
pageContext: null,
|
|
@@ -413,7 +419,7 @@ const We = Ks("restifyAiStore", {
|
|
|
413
419
|
},
|
|
414
420
|
error: t,
|
|
415
421
|
supportRequestMode: !1,
|
|
416
|
-
setupState: !os() && !
|
|
422
|
+
setupState: !os() && !pr() ? { ...qn(), isActive: !0 } : qn()
|
|
417
423
|
};
|
|
418
424
|
},
|
|
419
425
|
getters: {
|
|
@@ -429,7 +435,7 @@ const We = Ks("restifyAiStore", {
|
|
|
429
435
|
},
|
|
430
436
|
parseStreamContent(n) {
|
|
431
437
|
const e = ee(), t = e == null ? void 0 : e.parseStreamContent;
|
|
432
|
-
return t ? t(n.data) :
|
|
438
|
+
return t ? t(n.data) : rr(n.data);
|
|
433
439
|
},
|
|
434
440
|
async askQuestion(n, e = [], t = [], s = !1) {
|
|
435
441
|
var y;
|
|
@@ -456,7 +462,7 @@ const We = Ks("restifyAiStore", {
|
|
|
456
462
|
mentions: t,
|
|
457
463
|
timestamp: Date.now()
|
|
458
464
|
}), g.forEach((h) => this.registerUploadedFile(h)), $t(this.chatHistory), this.sending = !0, this.chatHistory.length >= this.chatHistoryLimit && ((y = r.onError) == null || y.call(r, new Error("Chat history limit reached")));
|
|
459
|
-
const
|
|
465
|
+
const k = async () => {
|
|
460
466
|
var h, A, m;
|
|
461
467
|
try {
|
|
462
468
|
const f = this.chatHistory.map((L) => ({
|
|
@@ -476,7 +482,7 @@ const We = Ks("restifyAiStore", {
|
|
|
476
482
|
var ne;
|
|
477
483
|
(ne = L.attachments) == null || ne.forEach(C);
|
|
478
484
|
}), g.forEach(C);
|
|
479
|
-
const
|
|
485
|
+
const b = Object.values(S), z = this.chatHistory.length;
|
|
480
486
|
this.chatHistory.push({
|
|
481
487
|
id: crypto.randomUUID(),
|
|
482
488
|
role: nt.Assistant,
|
|
@@ -495,7 +501,7 @@ const We = Ks("restifyAiStore", {
|
|
|
495
501
|
question: n,
|
|
496
502
|
history: f,
|
|
497
503
|
stream: !0,
|
|
498
|
-
...
|
|
504
|
+
...b.length > 0 && { files: b },
|
|
499
505
|
...t.length > 0 && { mentions: t },
|
|
500
506
|
...this.supportRequestMode && { contact_support: !0 }
|
|
501
507
|
};
|
|
@@ -546,12 +552,12 @@ const We = Ks("restifyAiStore", {
|
|
|
546
552
|
} catch (f) {
|
|
547
553
|
i = !0;
|
|
548
554
|
const S = this.chatHistory.length - 1;
|
|
549
|
-
return this.chatHistory.splice(S, 1), f.name === "AbortError" ? !0 : d < c && (a.shouldRetry ? a.shouldRetry(f, d) : !0) ? (d++, await
|
|
550
|
-
message: f
|
|
555
|
+
return this.chatHistory.splice(S, 1), f.name === "AbortError" ? !0 : d < c && (a.shouldRetry ? a.shouldRetry(f, d) : !0) ? (d++, await or(u * d), k()) : (this.error = {
|
|
556
|
+
message: sr(f),
|
|
551
557
|
failedQuestion: n,
|
|
552
558
|
failedAttachments: g,
|
|
553
559
|
timestamp: Date.now()
|
|
554
|
-
},
|
|
560
|
+
}, ir({
|
|
555
561
|
message: this.error.message,
|
|
556
562
|
failedQuestion: this.error.failedQuestion,
|
|
557
563
|
failedAttachments: this.error.failedAttachments || null
|
|
@@ -560,7 +566,7 @@ const We = Ks("restifyAiStore", {
|
|
|
560
566
|
this.sending = !1;
|
|
561
567
|
}
|
|
562
568
|
};
|
|
563
|
-
return
|
|
569
|
+
return k();
|
|
564
570
|
},
|
|
565
571
|
cancelRequest() {
|
|
566
572
|
it == null || it.abort(), this.chatHistory = this.chatHistory.map((n) => ({
|
|
@@ -572,7 +578,7 @@ const We = Ks("restifyAiStore", {
|
|
|
572
578
|
clearChatHistory() {
|
|
573
579
|
var e;
|
|
574
580
|
const n = ee();
|
|
575
|
-
this.chatHistory = [], this.sending = !1, this.uploadedFiles = {}, this.clearError(), this.quota.remaining > 0 && (this.supportRequestMode = !1),
|
|
581
|
+
this.chatHistory = [], this.sending = !1, this.uploadedFiles = {}, this.clearError(), this.quota.remaining > 0 && (this.supportRequestMode = !1), cr(), (e = n == null ? void 0 : n.onNewChat) == null || e.call(n);
|
|
576
582
|
},
|
|
577
583
|
async retry() {
|
|
578
584
|
if (!this.error.failedQuestion)
|
|
@@ -587,7 +593,7 @@ const We = Ks("restifyAiStore", {
|
|
|
587
593
|
failedAttachments: null,
|
|
588
594
|
timestamp: null,
|
|
589
595
|
quotaExceeded: !1
|
|
590
|
-
},
|
|
596
|
+
}, lr();
|
|
591
597
|
},
|
|
592
598
|
toggleSupportMode() {
|
|
593
599
|
this.supportRequestMode = !this.supportRequestMode;
|
|
@@ -631,8 +637,8 @@ const We = Ks("restifyAiStore", {
|
|
|
631
637
|
};
|
|
632
638
|
(o = e.onFileUploadStart) == null || o.call(e, s);
|
|
633
639
|
try {
|
|
634
|
-
const u = await e.getAuthToken(), d = e.getCustomHeaders ? await e.getCustomHeaders() : {}, g = It(e.endpoints.uploadFile),
|
|
635
|
-
|
|
640
|
+
const u = await e.getAuthToken(), d = e.getCustomHeaders ? await e.getCustomHeaders() : {}, g = It(e.endpoints.uploadFile), k = new FormData();
|
|
641
|
+
k.append("file", n);
|
|
636
642
|
const y = await new Promise((h, A) => {
|
|
637
643
|
const m = new XMLHttpRequest();
|
|
638
644
|
m.upload.addEventListener("progress", (f) => {
|
|
@@ -645,14 +651,14 @@ const We = Ks("restifyAiStore", {
|
|
|
645
651
|
var f, S;
|
|
646
652
|
if (m.status >= 200 && m.status < 300)
|
|
647
653
|
try {
|
|
648
|
-
const C = JSON.parse(m.responseText),
|
|
654
|
+
const C = JSON.parse(m.responseText), b = {
|
|
649
655
|
...s,
|
|
650
656
|
url: C.url || ((f = C.data) == null ? void 0 : f.url),
|
|
651
657
|
extractedText: C.extracted_text || ((S = C.data) == null ? void 0 : S.extracted_text),
|
|
652
658
|
uploading: !1,
|
|
653
659
|
progress: 100
|
|
654
660
|
};
|
|
655
|
-
h(
|
|
661
|
+
h(b);
|
|
656
662
|
} catch {
|
|
657
663
|
A(new Error("Failed to parse upload response"));
|
|
658
664
|
}
|
|
@@ -662,7 +668,7 @@ const We = Ks("restifyAiStore", {
|
|
|
662
668
|
A(new Error("Upload failed"));
|
|
663
669
|
}), m.open("POST", g), u && m.setRequestHeader("Authorization", `Bearer ${u}`), Object.entries(d).forEach(([f, S]) => {
|
|
664
670
|
m.setRequestHeader(f, S);
|
|
665
|
-
}), m.send(
|
|
671
|
+
}), m.send(k);
|
|
666
672
|
});
|
|
667
673
|
return (i = e.onFileUploadComplete) == null || i.call(e, y), y;
|
|
668
674
|
} catch (u) {
|
|
@@ -759,7 +765,7 @@ function is(n) {
|
|
|
759
765
|
mentions: t
|
|
760
766
|
};
|
|
761
767
|
}
|
|
762
|
-
function
|
|
768
|
+
function fr(n) {
|
|
763
769
|
const { cleanText: e } = is(n);
|
|
764
770
|
return e;
|
|
765
771
|
}
|
|
@@ -789,7 +795,7 @@ function us(n, e) {
|
|
|
789
795
|
var t, s;
|
|
790
796
|
return e != null && e.getSubtitle ? e.getSubtitle(n) : ((t = n.attributes) == null ? void 0 : t.email) || ((s = n.attributes) == null ? void 0 : s.description) || null;
|
|
791
797
|
}
|
|
792
|
-
function
|
|
798
|
+
function gr(n, e) {
|
|
793
799
|
return e != null && e.buildMentionText ? e.buildMentionText(n) : `@[${cn(n, e)}](${n.type}:${n.id})`;
|
|
794
800
|
}
|
|
795
801
|
function cs(n) {
|
|
@@ -801,14 +807,14 @@ function ds(n) {
|
|
|
801
807
|
const e = ee(), t = (e == null ? void 0 : e.mentionProviders) || [];
|
|
802
808
|
return n ? t.filter((s) => s.routes ? s.routes.some((r) => r.endsWith("*") ? n.startsWith(r.slice(0, -1)) : n === r || n.startsWith(r + "/")) : !0) : t;
|
|
803
809
|
}
|
|
804
|
-
function
|
|
810
|
+
function mr(n) {
|
|
805
811
|
return n.map((e) => ({
|
|
806
812
|
type: e.type,
|
|
807
813
|
id: e.id,
|
|
808
814
|
name: e.name
|
|
809
815
|
}));
|
|
810
816
|
}
|
|
811
|
-
function
|
|
817
|
+
function yr(n) {
|
|
812
818
|
return n.reduce((e, t) => {
|
|
813
819
|
const s = t.type || "default";
|
|
814
820
|
return e[s] || (e[s] = []), e[s].push(t), e;
|
|
@@ -817,16 +823,16 @@ function mr(n) {
|
|
|
817
823
|
function ka() {
|
|
818
824
|
return {
|
|
819
825
|
extractMentions: is,
|
|
820
|
-
parseAndCleanMessage:
|
|
826
|
+
parseAndCleanMessage: fr,
|
|
821
827
|
renderMentionsInHtml: as,
|
|
822
828
|
detectMentionContext: ls,
|
|
823
829
|
getMentionDisplayName: cn,
|
|
824
830
|
getMentionSubtitle: us,
|
|
825
|
-
buildMentionText:
|
|
831
|
+
buildMentionText: gr,
|
|
826
832
|
getMentionProvider: cs,
|
|
827
833
|
getActiveMentionProviders: ds,
|
|
828
|
-
formatMentionsForApi:
|
|
829
|
-
groupMentionsByType:
|
|
834
|
+
formatMentionsForApi: mr,
|
|
835
|
+
groupMentionsByType: yr
|
|
830
836
|
};
|
|
831
837
|
}
|
|
832
838
|
function dn() {
|
|
@@ -847,7 +853,7 @@ let Ke = dn();
|
|
|
847
853
|
function ps(n) {
|
|
848
854
|
Ke = n;
|
|
849
855
|
}
|
|
850
|
-
const hs = /[&<>"']/,
|
|
856
|
+
const hs = /[&<>"']/, xr = new RegExp(hs.source, "g"), fs = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, wr = new RegExp(fs.source, "g"), kr = {
|
|
851
857
|
"&": "&",
|
|
852
858
|
"<": "<",
|
|
853
859
|
">": ">",
|
|
@@ -857,9 +863,9 @@ const hs = /[&<>"']/, yr = new RegExp(hs.source, "g"), fs = /[<>"']|&(?!(#\d{1,7
|
|
|
857
863
|
function ye(n, e) {
|
|
858
864
|
if (e) {
|
|
859
865
|
if (hs.test(n))
|
|
860
|
-
return n.replace(
|
|
866
|
+
return n.replace(xr, jn);
|
|
861
867
|
} else if (fs.test(n))
|
|
862
|
-
return n.replace(
|
|
868
|
+
return n.replace(wr, jn);
|
|
863
869
|
return n;
|
|
864
870
|
}
|
|
865
871
|
const br = /(^|[^\[])\^/g;
|
|
@@ -911,7 +917,7 @@ function at(n, e, t) {
|
|
|
911
917
|
r++;
|
|
912
918
|
return n.slice(0, s - r);
|
|
913
919
|
}
|
|
914
|
-
function
|
|
920
|
+
function vr(n, e) {
|
|
915
921
|
if (n.indexOf(e[1]) === -1)
|
|
916
922
|
return -1;
|
|
917
923
|
let t = 0;
|
|
@@ -946,7 +952,7 @@ function Vn(n, e, t, s) {
|
|
|
946
952
|
text: ye(i)
|
|
947
953
|
};
|
|
948
954
|
}
|
|
949
|
-
function
|
|
955
|
+
function Tr(n, e) {
|
|
950
956
|
const t = n.match(/^(\s+)(?:```)/);
|
|
951
957
|
if (t === null)
|
|
952
958
|
return e;
|
|
@@ -994,7 +1000,7 @@ class Pt {
|
|
|
994
1000
|
fences(e) {
|
|
995
1001
|
const t = this.rules.block.fences.exec(e);
|
|
996
1002
|
if (t) {
|
|
997
|
-
const s = t[0], r =
|
|
1003
|
+
const s = t[0], r = Tr(s, t[3] || "");
|
|
998
1004
|
return {
|
|
999
1005
|
type: "code",
|
|
1000
1006
|
raw: s,
|
|
@@ -1054,8 +1060,8 @@ class Pt {
|
|
|
1054
1060
|
r = r ? `${r}
|
|
1055
1061
|
${d}` : d, o = o ? `${o}
|
|
1056
1062
|
${g}` : g;
|
|
1057
|
-
const
|
|
1058
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(g, i, !0), this.lexer.state.top =
|
|
1063
|
+
const k = this.lexer.state.top;
|
|
1064
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(g, i, !0), this.lexer.state.top = k, s.length === 0)
|
|
1059
1065
|
break;
|
|
1060
1066
|
const y = i[i.length - 1];
|
|
1061
1067
|
if ((y == null ? void 0 : y.type) === "code")
|
|
@@ -1104,27 +1110,27 @@ ${g}` : g;
|
|
|
1104
1110
|
break;
|
|
1105
1111
|
u = t[0], e = e.substring(u.length);
|
|
1106
1112
|
let g = t[2].split(`
|
|
1107
|
-
`, 1)[0].replace(/^\t+/, (f) => " ".repeat(3 * f.length)),
|
|
1113
|
+
`, 1)[0].replace(/^\t+/, (f) => " ".repeat(3 * f.length)), k = e.split(`
|
|
1108
1114
|
`, 1)[0], y = !g.trim(), h = 0;
|
|
1109
|
-
if (this.options.pedantic ? (h = 2, d = g.trimStart()) : y ? h = t[1].length + 1 : (h = t[2].search(/[^ ]/), h = h > 4 ? 1 : h, d = g.slice(h), h += t[1].length), y && /^[ \t]*$/.test(
|
|
1110
|
-
`, e = e.substring(
|
|
1111
|
-
const f = new RegExp(`^ {0,${Math.min(3, h - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), S = new RegExp(`^ {0,${Math.min(3, h - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), C = new RegExp(`^ {0,${Math.min(3, h - 1)}}(?:\`\`\`|~~~)`),
|
|
1115
|
+
if (this.options.pedantic ? (h = 2, d = g.trimStart()) : y ? h = t[1].length + 1 : (h = t[2].search(/[^ ]/), h = h > 4 ? 1 : h, d = g.slice(h), h += t[1].length), y && /^[ \t]*$/.test(k) && (u += k + `
|
|
1116
|
+
`, e = e.substring(k.length + 1), c = !0), !c) {
|
|
1117
|
+
const f = new RegExp(`^ {0,${Math.min(3, h - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), S = new RegExp(`^ {0,${Math.min(3, h - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), C = new RegExp(`^ {0,${Math.min(3, h - 1)}}(?:\`\`\`|~~~)`), b = new RegExp(`^ {0,${Math.min(3, h - 1)}}#`), z = new RegExp(`^ {0,${Math.min(3, h - 1)}}<(?:[a-z].*>|!--)`, "i");
|
|
1112
1118
|
for (; e; ) {
|
|
1113
1119
|
const F = e.split(`
|
|
1114
1120
|
`, 1)[0];
|
|
1115
1121
|
let V;
|
|
1116
|
-
if (
|
|
1122
|
+
if (k = F, this.options.pedantic ? (k = k.replace(/^ {1,4}(?=( {4})*[^ ])/g, " "), V = k) : V = k.replace(/\t/g, " "), C.test(k) || b.test(k) || z.test(k) || f.test(k) || S.test(k))
|
|
1117
1123
|
break;
|
|
1118
|
-
if (V.search(/[^ ]/) >= h || !
|
|
1124
|
+
if (V.search(/[^ ]/) >= h || !k.trim())
|
|
1119
1125
|
d += `
|
|
1120
1126
|
` + V.slice(h);
|
|
1121
1127
|
else {
|
|
1122
|
-
if (y || g.replace(/\t/g, " ").search(/[^ ]/) >= 4 || C.test(g) ||
|
|
1128
|
+
if (y || g.replace(/\t/g, " ").search(/[^ ]/) >= 4 || C.test(g) || b.test(g) || S.test(g))
|
|
1123
1129
|
break;
|
|
1124
1130
|
d += `
|
|
1125
|
-
` +
|
|
1131
|
+
` + k;
|
|
1126
1132
|
}
|
|
1127
|
-
!y && !
|
|
1133
|
+
!y && !k.trim() && (y = !0), u += F + `
|
|
1128
1134
|
`, e = e.substring(F.length + 1), g = V.slice(h);
|
|
1129
1135
|
}
|
|
1130
1136
|
}
|
|
@@ -1274,7 +1280,7 @@ ${g}` : g;
|
|
|
1274
1280
|
if ((s.length - i.length) % 2 === 0)
|
|
1275
1281
|
return;
|
|
1276
1282
|
} else {
|
|
1277
|
-
const i =
|
|
1283
|
+
const i = vr(t[2], "()");
|
|
1278
1284
|
if (i > -1) {
|
|
1279
1285
|
const c = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + i;
|
|
1280
1286
|
t[2] = t[2].substring(0, i), t[0] = t[0].substring(0, c).trim(), t[3] = "";
|
|
@@ -1328,7 +1334,7 @@ ${g}` : g;
|
|
|
1328
1334
|
if (u -= c, u > 0)
|
|
1329
1335
|
continue;
|
|
1330
1336
|
c = Math.min(c, c + u + d);
|
|
1331
|
-
const
|
|
1337
|
+
const k = [...r[0]][0].length, y = e.slice(0, i + r.index + k + c);
|
|
1332
1338
|
if (Math.min(i, c) % 2) {
|
|
1333
1339
|
const A = y.slice(1, -1);
|
|
1334
1340
|
return {
|
|
@@ -1438,25 +1444,25 @@ ${g}` : g;
|
|
|
1438
1444
|
}
|
|
1439
1445
|
}
|
|
1440
1446
|
}
|
|
1441
|
-
const
|
|
1442
|
-
blockquote:
|
|
1443
|
-
code:
|
|
1444
|
-
def:
|
|
1445
|
-
fences:
|
|
1446
|
-
heading:
|
|
1447
|
-
hr:
|
|
1448
|
-
html:
|
|
1447
|
+
const Sr = /^(?:[ \t]*(?:\n|$))+/, Ar = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Cr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, wt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Er = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, gs = /(?:[*+-]|\d{1,9}[.)])/, ms = j(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, gs).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/).getRegex(), pn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Mr = /^[^\n]+/, hn = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Rr = j(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", hn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Lr = j(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, gs).getRegex(), Ft = "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", fn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ir = j("^ {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", fn).replace("tag", Ft).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ys = j(pn).replace("hr", wt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ft).getRegex(), $r = j(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ys).getRegex(), gn = {
|
|
1448
|
+
blockquote: $r,
|
|
1449
|
+
code: Ar,
|
|
1450
|
+
def: Rr,
|
|
1451
|
+
fences: Cr,
|
|
1452
|
+
heading: Er,
|
|
1453
|
+
hr: wt,
|
|
1454
|
+
html: Ir,
|
|
1449
1455
|
lheading: ms,
|
|
1450
|
-
list:
|
|
1451
|
-
newline:
|
|
1456
|
+
list: Lr,
|
|
1457
|
+
newline: Sr,
|
|
1452
1458
|
paragraph: ys,
|
|
1453
1459
|
table: ft,
|
|
1454
|
-
text:
|
|
1455
|
-
}, Gn = j("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",
|
|
1460
|
+
text: Mr
|
|
1461
|
+
}, Gn = j("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", wt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ft).getRegex(), Dr = {
|
|
1456
1462
|
...gn,
|
|
1457
1463
|
table: Gn,
|
|
1458
|
-
paragraph: j(pn).replace("hr",
|
|
1459
|
-
},
|
|
1464
|
+
paragraph: j(pn).replace("hr", wt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Gn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ft).getRegex()
|
|
1465
|
+
}, _r = {
|
|
1460
1466
|
...gn,
|
|
1461
1467
|
html: j(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", fn).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(),
|
|
1462
1468
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
@@ -1464,30 +1470,30 @@ const Tr = /^(?:[ \t]*(?:\n|$))+/, Sr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*
|
|
|
1464
1470
|
fences: ft,
|
|
1465
1471
|
// fences not supported
|
|
1466
1472
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
1467
|
-
paragraph: j(pn).replace("hr",
|
|
1473
|
+
paragraph: j(pn).replace("hr", wt).replace("heading", ` *#{1,6} *[^
|
|
1468
1474
|
]`).replace("lheading", ms).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
1469
|
-
}, xs = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
|
|
1475
|
+
}, xs = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Or = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ws = /^( {2,}|\\)\n(?!\s*$)/, Nr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, kt = "\\p{P}\\p{S}", Pr = j(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, kt).getRegex(), zr = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, Hr = j(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, kt).getRegex(), Fr = j("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, kt).getRegex(), Br = j("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, kt).getRegex(), Ur = j(/\\([punct])/, "gu").replace(/punct/g, kt).getRegex(), qr = j(/^<(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 = j(fn).replace("(?:-->|$)", "-->").getRegex(), Wr = j("^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(), zt = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Kr = j(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", zt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ks = j(/^!?\[(label)\]\[(ref)\]/).replace("label", zt).replace("ref", hn).getRegex(), bs = j(/^!?\[(ref)\](?:\[\])?/).replace("ref", hn).getRegex(), Vr = j("reflink|nolink(?!\\()", "g").replace("reflink", ks).replace("nolink", bs).getRegex(), mn = {
|
|
1470
1476
|
_backpedal: ft,
|
|
1471
1477
|
// only used for GFM url
|
|
1472
|
-
anyPunctuation:
|
|
1473
|
-
autolink:
|
|
1474
|
-
blockSkip:
|
|
1475
|
-
br:
|
|
1476
|
-
code:
|
|
1478
|
+
anyPunctuation: Ur,
|
|
1479
|
+
autolink: qr,
|
|
1480
|
+
blockSkip: zr,
|
|
1481
|
+
br: ws,
|
|
1482
|
+
code: Or,
|
|
1477
1483
|
del: ft,
|
|
1478
|
-
emStrongLDelim:
|
|
1479
|
-
emStrongRDelimAst:
|
|
1480
|
-
emStrongRDelimUnd:
|
|
1484
|
+
emStrongLDelim: Hr,
|
|
1485
|
+
emStrongRDelimAst: Fr,
|
|
1486
|
+
emStrongRDelimUnd: Br,
|
|
1481
1487
|
escape: xs,
|
|
1482
|
-
link:
|
|
1483
|
-
nolink:
|
|
1484
|
-
punctuation:
|
|
1485
|
-
reflink:
|
|
1486
|
-
reflinkSearch:
|
|
1487
|
-
tag:
|
|
1488
|
-
text:
|
|
1488
|
+
link: Kr,
|
|
1489
|
+
nolink: bs,
|
|
1490
|
+
punctuation: Pr,
|
|
1491
|
+
reflink: ks,
|
|
1492
|
+
reflinkSearch: Vr,
|
|
1493
|
+
tag: Wr,
|
|
1494
|
+
text: Nr,
|
|
1489
1495
|
url: ft
|
|
1490
|
-
},
|
|
1496
|
+
}, Gr = {
|
|
1491
1497
|
...mn,
|
|
1492
1498
|
link: j(/^!?\[(label)\]\((.*?)\)/).replace("label", zt).getRegex(),
|
|
1493
1499
|
reflink: j(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", zt).getRegex()
|
|
@@ -1498,19 +1504,19 @@ const Tr = /^(?:[ \t]*(?:\n|$))+/, Sr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*
|
|
|
1498
1504
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1499
1505
|
del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
|
|
1500
1506
|
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
|
|
1501
|
-
},
|
|
1507
|
+
}, Qr = {
|
|
1502
1508
|
...rn,
|
|
1503
|
-
br: j(
|
|
1509
|
+
br: j(ws).replace("{2,}", "*").getRegex(),
|
|
1504
1510
|
text: j(rn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
1505
1511
|
}, Dt = {
|
|
1506
1512
|
normal: gn,
|
|
1507
|
-
gfm:
|
|
1508
|
-
pedantic:
|
|
1513
|
+
gfm: Dr,
|
|
1514
|
+
pedantic: _r
|
|
1509
1515
|
}, lt = {
|
|
1510
1516
|
normal: mn,
|
|
1511
1517
|
gfm: rn,
|
|
1512
|
-
breaks:
|
|
1513
|
-
pedantic:
|
|
1518
|
+
breaks: Qr,
|
|
1519
|
+
pedantic: Gr
|
|
1514
1520
|
};
|
|
1515
1521
|
class xe {
|
|
1516
1522
|
constructor(e) {
|
|
@@ -1714,9 +1720,9 @@ class xe {
|
|
|
1714
1720
|
if (o = e, this.options.extensions && this.options.extensions.startInline) {
|
|
1715
1721
|
let d = 1 / 0;
|
|
1716
1722
|
const g = e.slice(1);
|
|
1717
|
-
let
|
|
1723
|
+
let k;
|
|
1718
1724
|
this.options.extensions.startInline.forEach((y) => {
|
|
1719
|
-
|
|
1725
|
+
k = y.call({ lexer: this }, g), typeof k == "number" && k >= 0 && (d = Math.min(d, k));
|
|
1720
1726
|
}), d < 1 / 0 && d >= 0 && (o = e.substring(0, d + 1));
|
|
1721
1727
|
}
|
|
1722
1728
|
if (s = this.tokenizer.inlineText(o)) {
|
|
@@ -1898,7 +1904,7 @@ class yn {
|
|
|
1898
1904
|
return "";
|
|
1899
1905
|
}
|
|
1900
1906
|
}
|
|
1901
|
-
class
|
|
1907
|
+
class we {
|
|
1902
1908
|
constructor(e) {
|
|
1903
1909
|
W(this, "options");
|
|
1904
1910
|
W(this, "renderer");
|
|
@@ -1909,13 +1915,13 @@ class ke {
|
|
|
1909
1915
|
* Static Parse Method
|
|
1910
1916
|
*/
|
|
1911
1917
|
static parse(e, t) {
|
|
1912
|
-
return new
|
|
1918
|
+
return new we(t).parse(e);
|
|
1913
1919
|
}
|
|
1914
1920
|
/**
|
|
1915
1921
|
* Static Parse Inline Method
|
|
1916
1922
|
*/
|
|
1917
1923
|
static parseInline(e, t) {
|
|
1918
|
-
return new
|
|
1924
|
+
return new we(t).parseInline(e);
|
|
1919
1925
|
}
|
|
1920
1926
|
/**
|
|
1921
1927
|
* Parse Loop
|
|
@@ -2094,7 +2100,7 @@ class gt {
|
|
|
2094
2100
|
* Provide function to parse tokens
|
|
2095
2101
|
*/
|
|
2096
2102
|
provideParser() {
|
|
2097
|
-
return this.block ?
|
|
2103
|
+
return this.block ? we.parse : we.parseInline;
|
|
2098
2104
|
}
|
|
2099
2105
|
}
|
|
2100
2106
|
W(gt, "passThroughHooks", /* @__PURE__ */ new Set([
|
|
@@ -2102,13 +2108,13 @@ W(gt, "passThroughHooks", /* @__PURE__ */ new Set([
|
|
|
2102
2108
|
"postprocess",
|
|
2103
2109
|
"processAllTokens"
|
|
2104
2110
|
]));
|
|
2105
|
-
class
|
|
2111
|
+
class Zr {
|
|
2106
2112
|
constructor(...e) {
|
|
2107
2113
|
W(this, "defaults", dn());
|
|
2108
2114
|
W(this, "options", this.setOptions);
|
|
2109
2115
|
W(this, "parse", this.parseMarkdown(!0));
|
|
2110
2116
|
W(this, "parseInline", this.parseMarkdown(!1));
|
|
2111
|
-
W(this, "Parser",
|
|
2117
|
+
W(this, "Parser", we);
|
|
2112
2118
|
W(this, "Renderer", Ht);
|
|
2113
2119
|
W(this, "TextRenderer", yn);
|
|
2114
2120
|
W(this, "Lexer", xe);
|
|
@@ -2209,7 +2215,7 @@ class Qr {
|
|
|
2209
2215
|
const a = i, c = s.hooks[a], u = o[a];
|
|
2210
2216
|
gt.passThroughHooks.has(i) ? o[a] = (d) => {
|
|
2211
2217
|
if (this.defaults.async)
|
|
2212
|
-
return Promise.resolve(c.call(o, d)).then((
|
|
2218
|
+
return Promise.resolve(c.call(o, d)).then((k) => u.call(o, k));
|
|
2213
2219
|
const g = c.call(o, d);
|
|
2214
2220
|
return u.call(o, g);
|
|
2215
2221
|
} : o[a] = (...d) => {
|
|
@@ -2236,7 +2242,7 @@ class Qr {
|
|
|
2236
2242
|
return xe.lex(e, t ?? this.defaults);
|
|
2237
2243
|
}
|
|
2238
2244
|
parser(e, t) {
|
|
2239
|
-
return
|
|
2245
|
+
return we.parse(e, t ?? this.defaults);
|
|
2240
2246
|
}
|
|
2241
2247
|
parseMarkdown(e) {
|
|
2242
2248
|
return (s, r) => {
|
|
@@ -2248,7 +2254,7 @@ class Qr {
|
|
|
2248
2254
|
if (typeof s != "string")
|
|
2249
2255
|
return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(s) + ", string expected"));
|
|
2250
2256
|
i.hooks && (i.hooks.options = i, i.hooks.block = e);
|
|
2251
|
-
const c = i.hooks ? i.hooks.provideLexer() : e ? xe.lex : xe.lexInline, u = i.hooks ? i.hooks.provideParser() : e ?
|
|
2257
|
+
const c = i.hooks ? i.hooks.provideLexer() : e ? xe.lex : xe.lexInline, u = i.hooks ? i.hooks.provideParser() : e ? we.parse : we.parseInline;
|
|
2252
2258
|
if (i.async)
|
|
2253
2259
|
return Promise.resolve(i.hooks ? i.hooks.preprocess(s) : s).then((d) => c(d, i)).then((d) => i.hooks ? i.hooks.processAllTokens(d) : d).then((d) => i.walkTokens ? Promise.all(this.walkTokens(d, i.walkTokens)).then(() => d) : d).then((d) => u(d, i)).then((d) => i.hooks ? i.hooks.postprocess(d) : d).catch(a);
|
|
2254
2260
|
try {
|
|
@@ -2275,7 +2281,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
2275
2281
|
};
|
|
2276
2282
|
}
|
|
2277
2283
|
}
|
|
2278
|
-
const je = new
|
|
2284
|
+
const je = new Zr();
|
|
2279
2285
|
function U(n, e) {
|
|
2280
2286
|
return je.parse(n, e);
|
|
2281
2287
|
}
|
|
@@ -2291,8 +2297,8 @@ U.walkTokens = function(n, e) {
|
|
|
2291
2297
|
return je.walkTokens(n, e);
|
|
2292
2298
|
};
|
|
2293
2299
|
U.parseInline = je.parseInline;
|
|
2294
|
-
U.Parser =
|
|
2295
|
-
U.parser =
|
|
2300
|
+
U.Parser = we;
|
|
2301
|
+
U.parser = we.parse;
|
|
2296
2302
|
U.Renderer = Ht;
|
|
2297
2303
|
U.TextRenderer = yn;
|
|
2298
2304
|
U.Lexer = xe;
|
|
@@ -2305,19 +2311,19 @@ U.setOptions;
|
|
|
2305
2311
|
U.use;
|
|
2306
2312
|
U.walkTokens;
|
|
2307
2313
|
U.parseInline;
|
|
2308
|
-
|
|
2314
|
+
we.parse;
|
|
2309
2315
|
xe.lex;
|
|
2310
2316
|
/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */
|
|
2311
2317
|
const {
|
|
2312
2318
|
entries: vs,
|
|
2313
2319
|
setPrototypeOf: Qn,
|
|
2314
|
-
isFrozen:
|
|
2315
|
-
getPrototypeOf:
|
|
2316
|
-
getOwnPropertyDescriptor:
|
|
2320
|
+
isFrozen: Yr,
|
|
2321
|
+
getPrototypeOf: Xr,
|
|
2322
|
+
getOwnPropertyDescriptor: Jr
|
|
2317
2323
|
} = Object;
|
|
2318
2324
|
let {
|
|
2319
2325
|
freeze: de,
|
|
2320
|
-
seal:
|
|
2326
|
+
seal: be,
|
|
2321
2327
|
create: on
|
|
2322
2328
|
} = Object, {
|
|
2323
2329
|
apply: an,
|
|
@@ -2326,7 +2332,7 @@ let {
|
|
|
2326
2332
|
de || (de = function(e) {
|
|
2327
2333
|
return e;
|
|
2328
2334
|
});
|
|
2329
|
-
|
|
2335
|
+
be || (be = function(e) {
|
|
2330
2336
|
return e;
|
|
2331
2337
|
});
|
|
2332
2338
|
an || (an = function(e, t) {
|
|
@@ -2339,7 +2345,7 @@ ln || (ln = function(e) {
|
|
|
2339
2345
|
s[r - 1] = arguments[r];
|
|
2340
2346
|
return new e(...s);
|
|
2341
2347
|
});
|
|
2342
|
-
const _t = pe(Array.prototype.forEach),
|
|
2348
|
+
const _t = pe(Array.prototype.forEach), eo = pe(Array.prototype.lastIndexOf), Zn = pe(Array.prototype.pop), ut = pe(Array.prototype.push), to = pe(Array.prototype.splice), Nt = pe(String.prototype.toLowerCase), Zt = pe(String.prototype.toString), Yt = pe(String.prototype.match), ct = pe(String.prototype.replace), no = pe(String.prototype.indexOf), so = pe(String.prototype.trim), ve = pe(Object.prototype.hasOwnProperty), ce = pe(RegExp.prototype.test), dt = ro(TypeError);
|
|
2343
2349
|
function pe(n) {
|
|
2344
2350
|
return function(e) {
|
|
2345
2351
|
e instanceof RegExp && (e.lastIndex = 0);
|
|
@@ -2348,7 +2354,7 @@ function pe(n) {
|
|
|
2348
2354
|
return an(n, e, s);
|
|
2349
2355
|
};
|
|
2350
2356
|
}
|
|
2351
|
-
function
|
|
2357
|
+
function ro(n) {
|
|
2352
2358
|
return function() {
|
|
2353
2359
|
for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
|
|
2354
2360
|
t[s] = arguments[s];
|
|
@@ -2363,13 +2369,13 @@ function H(n, e) {
|
|
|
2363
2369
|
let r = e[s];
|
|
2364
2370
|
if (typeof r == "string") {
|
|
2365
2371
|
const o = t(r);
|
|
2366
|
-
o !== r && (
|
|
2372
|
+
o !== r && (Yr(e) || (e[s] = o), r = o);
|
|
2367
2373
|
}
|
|
2368
2374
|
n[r] = !0;
|
|
2369
2375
|
}
|
|
2370
2376
|
return n;
|
|
2371
2377
|
}
|
|
2372
|
-
function
|
|
2378
|
+
function oo(n) {
|
|
2373
2379
|
for (let e = 0; e < n.length; e++)
|
|
2374
2380
|
ve(n, e) || (n[e] = null);
|
|
2375
2381
|
return n;
|
|
@@ -2377,44 +2383,44 @@ function ro(n) {
|
|
|
2377
2383
|
function _e(n) {
|
|
2378
2384
|
const e = on(null);
|
|
2379
2385
|
for (const [t, s] of vs(n))
|
|
2380
|
-
ve(n, t) && (Array.isArray(s) ? e[t] =
|
|
2386
|
+
ve(n, t) && (Array.isArray(s) ? e[t] = oo(s) : s && typeof s == "object" && s.constructor === Object ? e[t] = _e(s) : e[t] = s);
|
|
2381
2387
|
return e;
|
|
2382
2388
|
}
|
|
2383
2389
|
function pt(n, e) {
|
|
2384
2390
|
for (; n !== null; ) {
|
|
2385
|
-
const s =
|
|
2391
|
+
const s = Jr(n, e);
|
|
2386
2392
|
if (s) {
|
|
2387
2393
|
if (s.get)
|
|
2388
2394
|
return pe(s.get);
|
|
2389
2395
|
if (typeof s.value == "function")
|
|
2390
2396
|
return pe(s.value);
|
|
2391
2397
|
}
|
|
2392
|
-
n =
|
|
2398
|
+
n = Xr(n);
|
|
2393
2399
|
}
|
|
2394
2400
|
function t() {
|
|
2395
2401
|
return null;
|
|
2396
2402
|
}
|
|
2397
2403
|
return t;
|
|
2398
2404
|
}
|
|
2399
|
-
const Yn = de(["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"]), Xt = de(["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"]), Jt = de(["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"]),
|
|
2405
|
+
const Yn = de(["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"]), Xt = de(["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"]), Jt = de(["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"]), io = de(["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"]), en = de(["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"]), ao = de(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Xn = de(["#text"]), Jn = de(["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", "slot"]), tn = de(["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"]), es = de(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Ot = de(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), lo = be(/\{\{[\w\W]*|[\w\W]*\}\}/gm), uo = be(/<%[\w\W]*|[\w\W]*%>/gm), co = be(/\$\{[\w\W]*/gm), po = be(/^data-[\-\w.\u00B7-\uFFFF]+$/), ho = be(/^aria-[\-\w]+$/), Ts = be(
|
|
2400
2406
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
2401
2407
|
// eslint-disable-line no-useless-escape
|
|
2402
|
-
),
|
|
2408
|
+
), fo = be(/^(?:\w+script|data):/i), go = be(
|
|
2403
2409
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
2404
2410
|
// eslint-disable-line no-control-regex
|
|
2405
|
-
), Ss =
|
|
2411
|
+
), Ss = be(/^html$/i), mo = be(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
2406
2412
|
var ts = /* @__PURE__ */ Object.freeze({
|
|
2407
2413
|
__proto__: null,
|
|
2408
|
-
ARIA_ATTR:
|
|
2409
|
-
ATTR_WHITESPACE:
|
|
2410
|
-
CUSTOM_ELEMENT:
|
|
2411
|
-
DATA_ATTR:
|
|
2414
|
+
ARIA_ATTR: ho,
|
|
2415
|
+
ATTR_WHITESPACE: go,
|
|
2416
|
+
CUSTOM_ELEMENT: mo,
|
|
2417
|
+
DATA_ATTR: po,
|
|
2412
2418
|
DOCTYPE_NAME: Ss,
|
|
2413
|
-
ERB_EXPR:
|
|
2419
|
+
ERB_EXPR: uo,
|
|
2414
2420
|
IS_ALLOWED_URI: Ts,
|
|
2415
|
-
IS_SCRIPT_OR_DATA:
|
|
2416
|
-
MUSTACHE_EXPR:
|
|
2417
|
-
TMPLIT_EXPR:
|
|
2421
|
+
IS_SCRIPT_OR_DATA: fo,
|
|
2422
|
+
MUSTACHE_EXPR: lo,
|
|
2423
|
+
TMPLIT_EXPR: co
|
|
2418
2424
|
});
|
|
2419
2425
|
const ht = {
|
|
2420
2426
|
element: 1,
|
|
@@ -2423,9 +2429,9 @@ const ht = {
|
|
|
2423
2429
|
progressingInstruction: 7,
|
|
2424
2430
|
comment: 8,
|
|
2425
2431
|
document: 9
|
|
2426
|
-
},
|
|
2432
|
+
}, yo = function() {
|
|
2427
2433
|
return typeof window > "u" ? null : window;
|
|
2428
|
-
},
|
|
2434
|
+
}, xo = function(e, t) {
|
|
2429
2435
|
if (typeof e != "object" || typeof e.createPolicy != "function")
|
|
2430
2436
|
return null;
|
|
2431
2437
|
let s = null;
|
|
@@ -2458,7 +2464,7 @@ const ht = {
|
|
|
2458
2464
|
};
|
|
2459
2465
|
};
|
|
2460
2466
|
function As() {
|
|
2461
|
-
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
2467
|
+
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : yo();
|
|
2462
2468
|
const e = ($) => As($);
|
|
2463
2469
|
if (e.version = "3.3.0", e.removed = [], !n || !n.document || n.document.nodeType !== ht.document || !n.Element)
|
|
2464
2470
|
return e.isSupported = !1, e;
|
|
@@ -2473,14 +2479,14 @@ function As() {
|
|
|
2473
2479
|
NodeFilter: u,
|
|
2474
2480
|
NamedNodeMap: d = n.NamedNodeMap || n.MozNamedAttrMap,
|
|
2475
2481
|
HTMLFormElement: g,
|
|
2476
|
-
DOMParser:
|
|
2482
|
+
DOMParser: k,
|
|
2477
2483
|
trustedTypes: y
|
|
2478
2484
|
} = n, h = c.prototype, A = pt(h, "cloneNode"), m = pt(h, "remove"), f = pt(h, "nextSibling"), S = pt(h, "childNodes"), C = pt(h, "parentNode");
|
|
2479
2485
|
if (typeof i == "function") {
|
|
2480
2486
|
const $ = t.createElement("template");
|
|
2481
2487
|
$.content && $.content.ownerDocument && (t = $.content.ownerDocument);
|
|
2482
2488
|
}
|
|
2483
|
-
let
|
|
2489
|
+
let b, z = "";
|
|
2484
2490
|
const {
|
|
2485
2491
|
implementation: F,
|
|
2486
2492
|
createNodeIterator: V,
|
|
@@ -2498,7 +2504,7 @@ function As() {
|
|
|
2498
2504
|
DATA_ATTR: ze,
|
|
2499
2505
|
ARIA_ATTR: Re,
|
|
2500
2506
|
IS_SCRIPT_OR_DATA: He,
|
|
2501
|
-
ATTR_WHITESPACE:
|
|
2507
|
+
ATTR_WHITESPACE: bt,
|
|
2502
2508
|
CUSTOM_ELEMENT: Bt
|
|
2503
2509
|
} = ts;
|
|
2504
2510
|
let {
|
|
@@ -2541,11 +2547,11 @@ function As() {
|
|
|
2541
2547
|
value: null
|
|
2542
2548
|
}
|
|
2543
2549
|
}));
|
|
2544
|
-
let St = !0, Ge = !0, _ = !1, K = !0, G = !1, te = !0, X = !1, J = !1, ue = !1, Se = !1, At = !1, Ct = !1, xn = !0,
|
|
2550
|
+
let St = !0, Ge = !0, _ = !1, K = !0, G = !1, te = !0, X = !1, J = !1, ue = !1, Se = !1, At = !1, Ct = !1, xn = !0, wn = !1;
|
|
2545
2551
|
const Ls = "user-content-";
|
|
2546
2552
|
let Ut = !0, rt = !1, Qe = {}, Ze = null;
|
|
2547
|
-
const
|
|
2548
|
-
let
|
|
2553
|
+
const kn = H({}, ["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"]);
|
|
2554
|
+
let bn = null;
|
|
2549
2555
|
const vn = H({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
2550
2556
|
let qt = null;
|
|
2551
2557
|
const Tn = H({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Et = "http://www.w3.org/1998/Math/MathML", Mt = "http://www.w3.org/2000/svg", Ie = "http://www.w3.org/1999/xhtml";
|
|
@@ -2562,17 +2568,17 @@ function As() {
|
|
|
2562
2568
|
let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2563
2569
|
if (!(Xe && Xe === l)) {
|
|
2564
2570
|
if ((!l || typeof l != "object") && (l = {}), l = _e(l), ot = // eslint-disable-next-line unicorn/prefer-includes
|
|
2565
|
-
Ds.indexOf(l.PARSER_MEDIA_TYPE) === -1 ? _s : l.PARSER_MEDIA_TYPE, oe = ot === "application/xhtml+xml" ? Zt : Nt, Y = ve(l, "ALLOWED_TAGS") ? H({}, l.ALLOWED_TAGS, oe) : st, se = ve(l, "ALLOWED_ATTR") ? H({}, l.ALLOWED_ATTR, oe) : Tt, Wt = ve(l, "ALLOWED_NAMESPACES") ? H({}, l.ALLOWED_NAMESPACES, Zt) : Is, qt = ve(l, "ADD_URI_SAFE_ATTR") ? H(_e(Tn), l.ADD_URI_SAFE_ATTR, oe) : Tn,
|
|
2571
|
+
Ds.indexOf(l.PARSER_MEDIA_TYPE) === -1 ? _s : l.PARSER_MEDIA_TYPE, oe = ot === "application/xhtml+xml" ? Zt : Nt, Y = ve(l, "ALLOWED_TAGS") ? H({}, l.ALLOWED_TAGS, oe) : st, se = ve(l, "ALLOWED_ATTR") ? H({}, l.ALLOWED_ATTR, oe) : Tt, Wt = ve(l, "ALLOWED_NAMESPACES") ? H({}, l.ALLOWED_NAMESPACES, Zt) : Is, qt = ve(l, "ADD_URI_SAFE_ATTR") ? H(_e(Tn), l.ADD_URI_SAFE_ATTR, oe) : Tn, bn = ve(l, "ADD_DATA_URI_TAGS") ? H(_e(vn), l.ADD_DATA_URI_TAGS, oe) : vn, Ze = ve(l, "FORBID_CONTENTS") ? H({}, l.FORBID_CONTENTS, oe) : kn, Fe = ve(l, "FORBID_TAGS") ? H({}, l.FORBID_TAGS, oe) : _e({}), Ve = ve(l, "FORBID_ATTR") ? H({}, l.FORBID_ATTR, oe) : _e({}), Qe = ve(l, "USE_PROFILES") ? l.USE_PROFILES : !1, St = l.ALLOW_ARIA_ATTR !== !1, Ge = l.ALLOW_DATA_ATTR !== !1, _ = l.ALLOW_UNKNOWN_PROTOCOLS || !1, K = l.ALLOW_SELF_CLOSE_IN_ATTR !== !1, G = l.SAFE_FOR_TEMPLATES || !1, te = l.SAFE_FOR_XML !== !1, X = l.WHOLE_DOCUMENT || !1, Se = l.RETURN_DOM || !1, At = l.RETURN_DOM_FRAGMENT || !1, Ct = l.RETURN_TRUSTED_TYPE || !1, ue = l.FORCE_BODY || !1, xn = l.SANITIZE_DOM !== !1, wn = l.SANITIZE_NAMED_PROPS || !1, Ut = l.KEEP_CONTENT !== !1, rt = l.IN_PLACE || !1, vt = l.ALLOWED_URI_REGEXP || Ts, Ye = l.NAMESPACE || Ie, Rt = l.MATHML_TEXT_INTEGRATION_POINTS || Rt, Lt = l.HTML_INTEGRATION_POINTS || Lt, Z = l.CUSTOM_ELEMENT_HANDLING || {}, l.CUSTOM_ELEMENT_HANDLING && Sn(l.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (Z.tagNameCheck = l.CUSTOM_ELEMENT_HANDLING.tagNameCheck), l.CUSTOM_ELEMENT_HANDLING && Sn(l.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (Z.attributeNameCheck = l.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), l.CUSTOM_ELEMENT_HANDLING && typeof l.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (Z.allowCustomizedBuiltInElements = l.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), G && (Ge = !1), At && (Se = !0), Qe && (Y = H({}, Xn), se = [], Qe.html === !0 && (H(Y, Yn), H(se, Jn)), Qe.svg === !0 && (H(Y, Xt), H(se, tn), H(se, Ot)), Qe.svgFilters === !0 && (H(Y, Jt), H(se, tn), H(se, Ot)), Qe.mathMl === !0 && (H(Y, en), H(se, es), H(se, Ot))), l.ADD_TAGS && (typeof l.ADD_TAGS == "function" ? Le.tagCheck = l.ADD_TAGS : (Y === st && (Y = _e(Y)), H(Y, l.ADD_TAGS, oe))), l.ADD_ATTR && (typeof l.ADD_ATTR == "function" ? Le.attributeCheck = l.ADD_ATTR : (se === Tt && (se = _e(se)), H(se, l.ADD_ATTR, oe))), l.ADD_URI_SAFE_ATTR && H(qt, l.ADD_URI_SAFE_ATTR, oe), l.FORBID_CONTENTS && (Ze === kn && (Ze = _e(Ze)), H(Ze, l.FORBID_CONTENTS, oe)), Ut && (Y["#text"] = !0), X && H(Y, ["html", "head", "body"]), Y.table && (H(Y, ["tbody"]), delete Fe.tbody), l.TRUSTED_TYPES_POLICY) {
|
|
2566
2572
|
if (typeof l.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
2567
2573
|
throw dt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2568
2574
|
if (typeof l.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
2569
2575
|
throw dt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2570
|
-
|
|
2576
|
+
b = l.TRUSTED_TYPES_POLICY, z = b.createHTML("");
|
|
2571
2577
|
} else
|
|
2572
|
-
|
|
2578
|
+
b === void 0 && (b = xo(y, r)), b !== null && typeof z == "string" && (z = b.createHTML(""));
|
|
2573
2579
|
de && de(l), Xe = l;
|
|
2574
2580
|
}
|
|
2575
|
-
}, An = H({}, [...Xt, ...Jt, ...
|
|
2581
|
+
}, An = H({}, [...Xt, ...Jt, ...io]), Cn = H({}, [...en, ...ao]), Ns = function(l) {
|
|
2576
2582
|
let x = C(l);
|
|
2577
2583
|
(!x || !x.tagName) && (x = {
|
|
2578
2584
|
namespaceURI: Ye,
|
|
@@ -2621,10 +2627,10 @@ function As() {
|
|
|
2621
2627
|
R = re && re[0];
|
|
2622
2628
|
}
|
|
2623
2629
|
ot === "application/xhtml+xml" && Ye === Ie && (l = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + l + "</body></html>");
|
|
2624
|
-
const Q =
|
|
2630
|
+
const Q = b ? b.createHTML(l) : l;
|
|
2625
2631
|
if (Ye === Ie)
|
|
2626
2632
|
try {
|
|
2627
|
-
x = new
|
|
2633
|
+
x = new k().parseFromString(Q, ot);
|
|
2628
2634
|
} catch {
|
|
2629
2635
|
}
|
|
2630
2636
|
if (!x || !x.documentElement) {
|
|
@@ -2700,9 +2706,9 @@ function As() {
|
|
|
2700
2706
|
x === "is" && Z.allowCustomizedBuiltInElements && (Z.tagNameCheck instanceof RegExp && ce(Z.tagNameCheck, R) || Z.tagNameCheck instanceof Function && Z.tagNameCheck(R)))
|
|
2701
2707
|
) return !1;
|
|
2702
2708
|
} else if (!qt[x]) {
|
|
2703
|
-
if (!ce(vt, ct(R,
|
|
2704
|
-
if (!((x === "src" || x === "xlink:href" || x === "href") && l !== "script" &&
|
|
2705
|
-
if (!(_ && !ce(He, ct(R,
|
|
2709
|
+
if (!ce(vt, ct(R, bt, ""))) {
|
|
2710
|
+
if (!((x === "src" || x === "xlink:href" || x === "href") && l !== "script" && no(R, "data:") === 0 && bn[l])) {
|
|
2711
|
+
if (!(_ && !ce(He, ct(R, bt, "")))) {
|
|
2706
2712
|
if (R)
|
|
2707
2713
|
return !1;
|
|
2708
2714
|
}
|
|
@@ -2736,8 +2742,8 @@ function As() {
|
|
|
2736
2742
|
namespaceURI: fe,
|
|
2737
2743
|
value: De
|
|
2738
2744
|
} = ae, Je = oe(re), Gt = De;
|
|
2739
|
-
let ie = re === "value" ? Gt :
|
|
2740
|
-
if (R.attrName = Je, R.attrValue = ie, R.keepAttr = !0, R.forceKeepAttr = void 0, $e(P.uponSanitizeAttribute, l, R), ie = R.attrValue,
|
|
2745
|
+
let ie = re === "value" ? Gt : so(Gt);
|
|
2746
|
+
if (R.attrName = Je, R.attrValue = ie, R.keepAttr = !0, R.forceKeepAttr = void 0, $e(P.uponSanitizeAttribute, l, R), ie = R.attrValue, wn && (Je === "id" || Je === "name") && (Be(re, l), ie = Ls + ie), te && ce(/((--!?|])>)|<\/(style|title|textarea)/i, ie)) {
|
|
2741
2747
|
Be(re, l);
|
|
2742
2748
|
continue;
|
|
2743
2749
|
}
|
|
@@ -2763,14 +2769,14 @@ function As() {
|
|
|
2763
2769
|
Be(re, l);
|
|
2764
2770
|
continue;
|
|
2765
2771
|
}
|
|
2766
|
-
if (
|
|
2772
|
+
if (b && typeof y == "object" && typeof y.getAttributeType == "function" && !fe)
|
|
2767
2773
|
switch (y.getAttributeType(_n, Je)) {
|
|
2768
2774
|
case "TrustedHTML": {
|
|
2769
|
-
ie =
|
|
2775
|
+
ie = b.createHTML(ie);
|
|
2770
2776
|
break;
|
|
2771
2777
|
}
|
|
2772
2778
|
case "TrustedScriptURL": {
|
|
2773
|
-
ie =
|
|
2779
|
+
ie = b.createScriptURL(ie);
|
|
2774
2780
|
break;
|
|
2775
2781
|
}
|
|
2776
2782
|
}
|
|
@@ -2810,7 +2816,7 @@ function As() {
|
|
|
2810
2816
|
else {
|
|
2811
2817
|
if (!Se && !G && !X && // eslint-disable-next-line unicorn/prefer-includes
|
|
2812
2818
|
$.indexOf("<") === -1)
|
|
2813
|
-
return
|
|
2819
|
+
return b && Ct ? b.createHTML($) : $;
|
|
2814
2820
|
if (x = En($), !x)
|
|
2815
2821
|
return Se ? null : Ct ? z : "";
|
|
2816
2822
|
}
|
|
@@ -2832,7 +2838,7 @@ function As() {
|
|
|
2832
2838
|
return X && Y["!doctype"] && x.ownerDocument && x.ownerDocument.doctype && x.ownerDocument.doctype.name && ce(Ss, x.ownerDocument.doctype.name) && (fe = "<!DOCTYPE " + x.ownerDocument.doctype.name + `>
|
|
2833
2839
|
` + fe), G && _t([L, ne, Te], (De) => {
|
|
2834
2840
|
fe = ct(fe, De, " ");
|
|
2835
|
-
}),
|
|
2841
|
+
}), b && Ct ? b.createHTML(fe) : fe;
|
|
2836
2842
|
}, e.setConfig = function() {
|
|
2837
2843
|
let $ = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2838
2844
|
Kt($), J = !0;
|
|
@@ -2846,8 +2852,8 @@ function As() {
|
|
|
2846
2852
|
typeof l == "function" && ut(P[$], l);
|
|
2847
2853
|
}, e.removeHook = function($, l) {
|
|
2848
2854
|
if (l !== void 0) {
|
|
2849
|
-
const x =
|
|
2850
|
-
return x === -1 ? void 0 :
|
|
2855
|
+
const x = eo(P[$], l);
|
|
2856
|
+
return x === -1 ? void 0 : to(P[$], x, 1)[0];
|
|
2851
2857
|
}
|
|
2852
2858
|
return Zn(P[$]);
|
|
2853
2859
|
}, e.removeHooks = function($) {
|
|
@@ -2856,7 +2862,7 @@ function As() {
|
|
|
2856
2862
|
P = ns();
|
|
2857
2863
|
}, e;
|
|
2858
2864
|
}
|
|
2859
|
-
var
|
|
2865
|
+
var wo = As();
|
|
2860
2866
|
function ko() {
|
|
2861
2867
|
return {
|
|
2862
2868
|
parseMarkdown: (e) => {
|
|
@@ -2867,7 +2873,7 @@ function ko() {
|
|
|
2867
2873
|
breaks: !0,
|
|
2868
2874
|
gfm: !0
|
|
2869
2875
|
});
|
|
2870
|
-
return
|
|
2876
|
+
return wo.sanitize(s, {
|
|
2871
2877
|
ALLOWED_TAGS: [
|
|
2872
2878
|
"p",
|
|
2873
2879
|
"br",
|
|
@@ -2944,7 +2950,7 @@ function ba() {
|
|
|
2944
2950
|
cleanupAutoScroll: r
|
|
2945
2951
|
};
|
|
2946
2952
|
}
|
|
2947
|
-
function
|
|
2953
|
+
function va() {
|
|
2948
2954
|
const n = We(), e = O(() => n.error), t = O(() => {
|
|
2949
2955
|
var o, i;
|
|
2950
2956
|
return ((o = e.value) == null ? void 0 : o.message) !== null && ((i = e.value) == null ? void 0 : i.message) !== void 0;
|
|
@@ -2998,16 +3004,16 @@ function bo() {
|
|
|
2998
3004
|
const n = ee();
|
|
2999
3005
|
n != null && n.suggestionProviders && Ee.push(...n.suggestionProviders), Ee.push(Es);
|
|
3000
3006
|
}
|
|
3001
|
-
function
|
|
3007
|
+
function vo(n, e) {
|
|
3002
3008
|
const t = [...Ee].sort((s, r) => (r.priority || 0) - (s.priority || 0));
|
|
3003
3009
|
for (const s of t)
|
|
3004
3010
|
if (s.matcher && s.matcher(n, e) || s.routes && s.routes.some((o) => o.endsWith("*") ? n.startsWith(o.slice(0, -1)) : n === o || n.startsWith(o + "/")))
|
|
3005
3011
|
return s;
|
|
3006
3012
|
return Es;
|
|
3007
3013
|
}
|
|
3008
|
-
function
|
|
3014
|
+
function To(n, e) {
|
|
3009
3015
|
Ee.length === 0 && bo();
|
|
3010
|
-
const t =
|
|
3016
|
+
const t = vo(n, e), s = e || {
|
|
3011
3017
|
pageType: "default",
|
|
3012
3018
|
routePath: n
|
|
3013
3019
|
};
|
|
@@ -3016,7 +3022,7 @@ function vo(n, e) {
|
|
|
3016
3022
|
...t.extractContext(n)
|
|
3017
3023
|
}), t.getSuggestions(s) || [];
|
|
3018
3024
|
}
|
|
3019
|
-
function
|
|
3025
|
+
function So(n) {
|
|
3020
3026
|
const e = Ee.findIndex((t) => t.id === n.id);
|
|
3021
3027
|
if (e >= 0)
|
|
3022
3028
|
Ee[e] = n;
|
|
@@ -3025,7 +3031,7 @@ function To(n) {
|
|
|
3025
3031
|
t >= 0 ? Ee.splice(t, 0, n) : Ee.push(n);
|
|
3026
3032
|
}
|
|
3027
3033
|
}
|
|
3028
|
-
const
|
|
3034
|
+
const Ta = So;
|
|
3029
3035
|
function Ms() {
|
|
3030
3036
|
const { context: n } = Cs(), e = We(), t = O(() => {
|
|
3031
3037
|
var c;
|
|
@@ -3042,7 +3048,7 @@ function Ms() {
|
|
|
3042
3048
|
}
|
|
3043
3049
|
] : [];
|
|
3044
3050
|
}
|
|
3045
|
-
const o = ((c = n.value) == null ? void 0 : c.routePath) || (typeof window < "u" ? window.location.pathname : "/"), i =
|
|
3051
|
+
const o = ((c = n.value) == null ? void 0 : c.routePath) || (typeof window < "u" ? window.location.pathname : "/"), i = To(o, n.value) || [], a = ee();
|
|
3046
3052
|
return a != null && a.can ? i.filter((u) => !(u.permission && !a.can(u.permission))) : i;
|
|
3047
3053
|
}), s = O(() => n.value !== null && n.value.pageType !== "default");
|
|
3048
3054
|
function r(o) {
|
|
@@ -3056,7 +3062,7 @@ function Ms() {
|
|
|
3056
3062
|
resolvePrompt: r
|
|
3057
3063
|
};
|
|
3058
3064
|
}
|
|
3059
|
-
function
|
|
3065
|
+
function Sa(n, e) {
|
|
3060
3066
|
const { setContext: t, clearContext: s, updateContext: r } = Cs();
|
|
3061
3067
|
function o() {
|
|
3062
3068
|
if (!e)
|
|
@@ -3088,7 +3094,7 @@ function Ta(n, e) {
|
|
|
3088
3094
|
setupContext: i
|
|
3089
3095
|
};
|
|
3090
3096
|
}
|
|
3091
|
-
function
|
|
3097
|
+
function Ao(n) {
|
|
3092
3098
|
const e = n.toLowerCase().split("+");
|
|
3093
3099
|
return {
|
|
3094
3100
|
key: e.pop() || "",
|
|
@@ -3100,7 +3106,7 @@ function So(n) {
|
|
|
3100
3106
|
// Platform-independent: Cmd on Mac, Ctrl on Windows/Linux
|
|
3101
3107
|
};
|
|
3102
3108
|
}
|
|
3103
|
-
function
|
|
3109
|
+
function Co(n, e) {
|
|
3104
3110
|
const t = n.key.toLowerCase();
|
|
3105
3111
|
if (e.mod) {
|
|
3106
3112
|
const u = navigator.platform.toUpperCase().indexOf("MAC") >= 0 || navigator.userAgent.toUpperCase().indexOf("MAC") >= 0 ? n.metaKey : n.ctrlKey, d = e.shift ? n.shiftKey : !n.shiftKey, g = e.alt ? n.altKey : !n.altKey;
|
|
@@ -3110,18 +3116,18 @@ function Ao(n, e) {
|
|
|
3110
3116
|
let a = s && r && o && i;
|
|
3111
3117
|
return (e.meta && !e.ctrl || !e.meta && e.ctrl) && (a = (n.metaKey || n.ctrlKey) && o && i), t === e.key && a;
|
|
3112
3118
|
}
|
|
3113
|
-
function
|
|
3119
|
+
function Eo(n) {
|
|
3114
3120
|
const { onToggle: e, enabled: t = !0 } = n, s = q(!1), r = n.shortcut !== void 0 ? n.shortcut : tt("keyboardShortcut") ?? "mod+g";
|
|
3115
3121
|
if (r === null)
|
|
3116
3122
|
return { isActive: s };
|
|
3117
|
-
const o =
|
|
3123
|
+
const o = Ao(r);
|
|
3118
3124
|
function i(a) {
|
|
3119
3125
|
if (!t) return;
|
|
3120
3126
|
const c = a.target, u = c.tagName === "INPUT" || c.tagName === "TEXTAREA", d = c.isContentEditable, g = c.closest("[data-ai-input]");
|
|
3121
|
-
if (!((u || d) && !g) &&
|
|
3127
|
+
if (!((u || d) && !g) && Co(a, o)) {
|
|
3122
3128
|
a.preventDefault(), a.stopPropagation();
|
|
3123
|
-
const
|
|
3124
|
-
if (
|
|
3129
|
+
const k = ee();
|
|
3130
|
+
if (k != null && k.canToggle && !k.canToggle())
|
|
3125
3131
|
return;
|
|
3126
3132
|
s.value = !s.value, e();
|
|
3127
3133
|
}
|
|
@@ -3132,15 +3138,15 @@ function Co(n) {
|
|
|
3132
3138
|
window.removeEventListener("keydown", i, !0);
|
|
3133
3139
|
}), { isActive: s };
|
|
3134
3140
|
}
|
|
3135
|
-
function
|
|
3141
|
+
function Aa(n) {
|
|
3136
3142
|
const e = We();
|
|
3137
|
-
return
|
|
3143
|
+
return Eo({
|
|
3138
3144
|
onToggle: () => {
|
|
3139
3145
|
n ? n.value = !n.value : e.showChat = !e.showChat;
|
|
3140
3146
|
}
|
|
3141
3147
|
});
|
|
3142
3148
|
}
|
|
3143
|
-
function
|
|
3149
|
+
function Mo(n, e) {
|
|
3144
3150
|
const t = q(le("loadingText"));
|
|
3145
3151
|
let s = [];
|
|
3146
3152
|
function r() {
|
|
@@ -3165,12 +3171,12 @@ function Eo(n, e) {
|
|
|
3165
3171
|
i();
|
|
3166
3172
|
const u = e == null ? void 0 : e(), d = (u == null ? void 0 : u.messages) ?? r(), g = (u == null ? void 0 : u.intervals) ?? o();
|
|
3167
3173
|
t.value = d[0] || le("loadingText");
|
|
3168
|
-
let
|
|
3174
|
+
let k = 0;
|
|
3169
3175
|
for (let y = 1; y < d.length; y++) {
|
|
3170
|
-
|
|
3176
|
+
k += g[y] || 2e3;
|
|
3171
3177
|
const h = y, A = window.setTimeout(() => {
|
|
3172
3178
|
n() && (t.value = d[h]);
|
|
3173
|
-
},
|
|
3179
|
+
}, k);
|
|
3174
3180
|
s.push(A);
|
|
3175
3181
|
}
|
|
3176
3182
|
}
|
|
@@ -3183,7 +3189,7 @@ function Eo(n, e) {
|
|
|
3183
3189
|
clearLoadingTextTimers: i
|
|
3184
3190
|
};
|
|
3185
3191
|
}
|
|
3186
|
-
function
|
|
3192
|
+
function Ro(n) {
|
|
3187
3193
|
const {
|
|
3188
3194
|
getHistoryLength: e,
|
|
3189
3195
|
getStoreLimit: t,
|
|
@@ -3203,12 +3209,12 @@ function Mo(n) {
|
|
|
3203
3209
|
return ((C = s()) == null ? void 0 : C.showWarningAt) ?? c.value - 2;
|
|
3204
3210
|
}), d = O(() => Math.max(0, c.value - e())), g = O(
|
|
3205
3211
|
() => d.value <= c.value - u.value && d.value > 0
|
|
3206
|
-
),
|
|
3207
|
-
var C,
|
|
3208
|
-
return a.value.isReached ? ((C = r()) == null ? void 0 : C.historyLimitReachedTitle) ?? "Chat Limit Reached" : ((
|
|
3212
|
+
), k = O(() => d.value === 0), y = O(() => {
|
|
3213
|
+
var C, b;
|
|
3214
|
+
return a.value.isReached ? ((C = r()) == null ? void 0 : C.historyLimitReachedTitle) ?? "Chat Limit Reached" : ((b = r()) == null ? void 0 : b.historyLimitWarningTitle) ?? "Approaching Chat Limit";
|
|
3209
3215
|
}), h = O(() => {
|
|
3210
|
-
var C,
|
|
3211
|
-
return a.value.isReached ? ((C = s()) == null ? void 0 : C.limitMessage) ?? ((
|
|
3216
|
+
var C, b, z, F;
|
|
3217
|
+
return a.value.isReached ? ((C = s()) == null ? void 0 : C.limitMessage) ?? ((b = r()) == null ? void 0 : b.historyLimitReachedMessage) ?? "You have reached the maximum number of messages in this conversation. Start a new chat to continue." : ((z = s()) == null ? void 0 : z.warningMessage) ?? ((F = r()) == null ? void 0 : F.historyLimitWarningMessage) ?? `You have ${d.value} message${d.value === 1 ? "" : "s"} remaining in this conversation.`;
|
|
3212
3218
|
});
|
|
3213
3219
|
function A() {
|
|
3214
3220
|
a.value.showWarning = !1, a.value.isReached = !1, a.value.pendingMessage = null;
|
|
@@ -3219,13 +3225,13 @@ function Mo(n) {
|
|
|
3219
3225
|
if (C != null && C.onLimitReached && !await C.onLimitReached())
|
|
3220
3226
|
return a.value.isReached = !1, null;
|
|
3221
3227
|
if (o(), i(), a.value.isReached = !1, a.value.pendingMessage) {
|
|
3222
|
-
const
|
|
3223
|
-
return a.value.pendingMessage = null,
|
|
3228
|
+
const b = a.value.pendingMessage;
|
|
3229
|
+
return a.value.pendingMessage = null, b;
|
|
3224
3230
|
}
|
|
3225
3231
|
return null;
|
|
3226
3232
|
}
|
|
3227
3233
|
function f() {
|
|
3228
|
-
return
|
|
3234
|
+
return k.value ? (a.value.isReached = !0, a.value.showWarning = !0, !1) : (g.value && !a.value.showWarning && (a.value.showWarning = !0), !0);
|
|
3229
3235
|
}
|
|
3230
3236
|
function S(C) {
|
|
3231
3237
|
a.value.pendingMessage = C;
|
|
@@ -3246,7 +3252,7 @@ function Mo(n) {
|
|
|
3246
3252
|
setPendingMessage: S
|
|
3247
3253
|
};
|
|
3248
3254
|
}
|
|
3249
|
-
function
|
|
3255
|
+
function Lo() {
|
|
3250
3256
|
const n = We(), e = q([]), t = q(!1), s = q(0), r = tt("maxAttachments") || 5, o = tt("maxFileSize") || 10 * 1024 * 1024, i = tt("acceptedFileTypes") || "image/*,.pdf,.txt,.doc,.docx,.xls,.xlsx,.csv", a = O(() => e.value.length > 0), c = O(() => e.value.some((E) => E.uploading)), u = O(() => e.value.length < r);
|
|
3251
3257
|
function d(E) {
|
|
3252
3258
|
return (E.type || "").startsWith("image/") ? !0 : /(png|jpe?g|gif|webp)$/i.test(E.name);
|
|
@@ -3256,7 +3262,7 @@ function Ro() {
|
|
|
3256
3262
|
const M = typeof E == "string" ? parseInt(E, 10) : E;
|
|
3257
3263
|
return Number.isNaN(M) ? "" : M >= 1024 * 1024 ? `${(M / (1024 * 1024)).toFixed(1)} MB` : M >= 1024 ? `${Math.round(M / 1024)} KB` : `${M} B`;
|
|
3258
3264
|
}
|
|
3259
|
-
function
|
|
3265
|
+
function k(E) {
|
|
3260
3266
|
var Te;
|
|
3261
3267
|
const M = crypto.randomUUID(), I = E.type.startsWith("image/") ? URL.createObjectURL(E) : void 0, P = ee(), L = !!((Te = P == null ? void 0 : P.endpoints) != null && Te.uploadFile), ne = {
|
|
3262
3268
|
id: M,
|
|
@@ -3315,7 +3321,7 @@ function Ro() {
|
|
|
3315
3321
|
const M = Array.from(E);
|
|
3316
3322
|
for (const I of M) {
|
|
3317
3323
|
if (e.value.length >= r) break;
|
|
3318
|
-
I.size > o ||
|
|
3324
|
+
I.size > o || k(I);
|
|
3319
3325
|
}
|
|
3320
3326
|
}
|
|
3321
3327
|
function S(E) {
|
|
@@ -3325,7 +3331,7 @@ function Ro() {
|
|
|
3325
3331
|
function C(E) {
|
|
3326
3332
|
S(E) && (s.value += 1, t.value = !0);
|
|
3327
3333
|
}
|
|
3328
|
-
function
|
|
3334
|
+
function b(E) {
|
|
3329
3335
|
S(E) || E.preventDefault();
|
|
3330
3336
|
}
|
|
3331
3337
|
function z(E) {
|
|
@@ -3361,12 +3367,12 @@ function Ro() {
|
|
|
3361
3367
|
handleFileSelect: V,
|
|
3362
3368
|
// Drag & Drop
|
|
3363
3369
|
handleDragEnter: C,
|
|
3364
|
-
handleDragOver:
|
|
3370
|
+
handleDragOver: b,
|
|
3365
3371
|
handleDragLeave: z,
|
|
3366
3372
|
handleDrop: F
|
|
3367
3373
|
};
|
|
3368
3374
|
}
|
|
3369
|
-
function
|
|
3375
|
+
function Io(n, e, t) {
|
|
3370
3376
|
const s = q(!1), r = q([]), o = q(0), i = q({ inMention: !1, query: "", startPos: 0 }), a = q([]), c = O(() => {
|
|
3371
3377
|
const A = ee();
|
|
3372
3378
|
return (A == null ? void 0 : A.mentionProviders) || [];
|
|
@@ -3387,15 +3393,15 @@ function Lo(n, e, t) {
|
|
|
3387
3393
|
for (const S of m)
|
|
3388
3394
|
try {
|
|
3389
3395
|
const C = await S.search(A);
|
|
3390
|
-
f.push(...C.map((
|
|
3396
|
+
f.push(...C.map((b) => ({ ...b, type: S.type })));
|
|
3391
3397
|
} catch (C) {
|
|
3392
3398
|
console.warn(`Mention provider ${S.type} failed:`, C);
|
|
3393
3399
|
}
|
|
3394
3400
|
r.value = f.slice(0, 10), s.value = f.length > 0, o.value = 0;
|
|
3395
3401
|
}
|
|
3396
3402
|
function g(A) {
|
|
3397
|
-
const { startPos: m } = i.value, f = n(), S = t(), C = f.slice(0, m),
|
|
3398
|
-
e(`${C}@${z} ${
|
|
3403
|
+
const { startPos: m } = i.value, f = n(), S = t(), C = f.slice(0, m), b = f.slice((S == null ? void 0 : S.selectionStart) || m), z = A.name || A.label || A.title || A.id;
|
|
3404
|
+
e(`${C}@${z} ${b}`), a.value.push({
|
|
3399
3405
|
id: A.id,
|
|
3400
3406
|
name: z,
|
|
3401
3407
|
type: A.type,
|
|
@@ -3407,7 +3413,7 @@ function Lo(n, e, t) {
|
|
|
3407
3413
|
F == null || F.setSelectionRange(V, V);
|
|
3408
3414
|
}, 0);
|
|
3409
3415
|
}
|
|
3410
|
-
function
|
|
3416
|
+
function k(A) {
|
|
3411
3417
|
if (!s.value || r.value.length === 0)
|
|
3412
3418
|
return !1;
|
|
3413
3419
|
if (A.key === "ArrowDown")
|
|
@@ -3436,12 +3442,12 @@ function Lo(n, e, t) {
|
|
|
3436
3442
|
// Actions
|
|
3437
3443
|
checkForMentions: u,
|
|
3438
3444
|
handleMentionSelect: g,
|
|
3439
|
-
handleMentionKeyDown:
|
|
3445
|
+
handleMentionKeyDown: k,
|
|
3440
3446
|
clearMentions: y,
|
|
3441
3447
|
getMentions: h
|
|
3442
3448
|
};
|
|
3443
3449
|
}
|
|
3444
|
-
function
|
|
3450
|
+
function $o(n, e, t, s, r) {
|
|
3445
3451
|
const o = q(!1), i = q(-1), a = q(null);
|
|
3446
3452
|
function c() {
|
|
3447
3453
|
setTimeout(() => {
|
|
@@ -3473,7 +3479,7 @@ function Io(n, e, t, s, r) {
|
|
|
3473
3479
|
const y = s(), h = e(), A = t(), m = n();
|
|
3474
3480
|
y && !h && A && m.length > 0 ? o.value = !0 : o.value = !1;
|
|
3475
3481
|
}
|
|
3476
|
-
function
|
|
3482
|
+
function k() {
|
|
3477
3483
|
o.value = !1, i.value = -1;
|
|
3478
3484
|
}
|
|
3479
3485
|
return {
|
|
@@ -3483,10 +3489,10 @@ function Io(n, e, t, s, r) {
|
|
|
3483
3489
|
handleSuggestionKeyDown: u,
|
|
3484
3490
|
handleSuggestionClick: d,
|
|
3485
3491
|
updateSuggestionsVisibility: g,
|
|
3486
|
-
hideSuggestions:
|
|
3492
|
+
hideSuggestions: k
|
|
3487
3493
|
};
|
|
3488
3494
|
}
|
|
3489
|
-
function
|
|
3495
|
+
function Do(n, e = 300) {
|
|
3490
3496
|
function t() {
|
|
3491
3497
|
const s = n();
|
|
3492
3498
|
if (!s) return;
|
|
@@ -3500,7 +3506,7 @@ function $o(n, e = 300) {
|
|
|
3500
3506
|
adjustTextareaHeight: t
|
|
3501
3507
|
};
|
|
3502
3508
|
}
|
|
3503
|
-
const
|
|
3509
|
+
const _o = /* @__PURE__ */ he({
|
|
3504
3510
|
__name: "AiAvatar",
|
|
3505
3511
|
props: {
|
|
3506
3512
|
ui: {}
|
|
@@ -3508,13 +3514,13 @@ const Do = /* @__PURE__ */ he({
|
|
|
3508
3514
|
setup(n) {
|
|
3509
3515
|
return (e, t) => {
|
|
3510
3516
|
var s;
|
|
3511
|
-
return
|
|
3517
|
+
return w(), v("div", {
|
|
3512
3518
|
class: T(["w-6 h-6 min-w-[24px] flex items-center justify-center rounded-full border border-gray-300 dark:border-gray-600", (s = n.ui) == null ? void 0 : s.container])
|
|
3513
3519
|
}, [
|
|
3514
3520
|
me(e.$slots, "default", {}, () => {
|
|
3515
3521
|
var r;
|
|
3516
3522
|
return [
|
|
3517
|
-
(
|
|
3523
|
+
(w(), v("svg", {
|
|
3518
3524
|
class: T(["w-4 h-4 text-gray-400 dark:text-gray-500", (r = n.ui) == null ? void 0 : r.icon]),
|
|
3519
3525
|
fill: "none",
|
|
3520
3526
|
viewBox: "0 0 24 24",
|
|
@@ -3532,7 +3538,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
3532
3538
|
], 2);
|
|
3533
3539
|
};
|
|
3534
3540
|
}
|
|
3535
|
-
}),
|
|
3541
|
+
}), Ca = /* @__PURE__ */ he({
|
|
3536
3542
|
__name: "UserAvatar",
|
|
3537
3543
|
props: {
|
|
3538
3544
|
ui: {}
|
|
@@ -3540,13 +3546,13 @@ const Do = /* @__PURE__ */ he({
|
|
|
3540
3546
|
setup(n) {
|
|
3541
3547
|
return (e, t) => {
|
|
3542
3548
|
var s;
|
|
3543
|
-
return
|
|
3549
|
+
return w(), v("div", {
|
|
3544
3550
|
class: T(["w-8 h-8 rounded-full bg-gray-200 dark:bg-gray-700 flex items-center justify-center flex-shrink-0", (s = n.ui) == null ? void 0 : s.container])
|
|
3545
3551
|
}, [
|
|
3546
3552
|
me(e.$slots, "default", {}, () => {
|
|
3547
3553
|
var r;
|
|
3548
3554
|
return [
|
|
3549
|
-
(
|
|
3555
|
+
(w(), v("svg", {
|
|
3550
3556
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3551
3557
|
viewBox: "0 0 24 24",
|
|
3552
3558
|
fill: "currentColor",
|
|
@@ -3563,7 +3569,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
3563
3569
|
], 2);
|
|
3564
3570
|
};
|
|
3565
3571
|
}
|
|
3566
|
-
}),
|
|
3572
|
+
}), Oo = ["onClick", "onMouseenter"], No = /* @__PURE__ */ he({
|
|
3567
3573
|
__name: "MentionList",
|
|
3568
3574
|
props: {
|
|
3569
3575
|
items: {},
|
|
@@ -3597,10 +3603,10 @@ const Do = /* @__PURE__ */ he({
|
|
|
3597
3603
|
function u(m, f) {
|
|
3598
3604
|
let S = 0;
|
|
3599
3605
|
const C = Object.keys(i.value);
|
|
3600
|
-
for (const
|
|
3601
|
-
if (
|
|
3606
|
+
for (const b of C) {
|
|
3607
|
+
if (b === m)
|
|
3602
3608
|
return S + f;
|
|
3603
|
-
S += i.value[
|
|
3609
|
+
S += i.value[b].length;
|
|
3604
3610
|
}
|
|
3605
3611
|
return S;
|
|
3606
3612
|
}
|
|
@@ -3610,7 +3616,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
3610
3616
|
function g(m) {
|
|
3611
3617
|
o.value = m, r("update:selectedIndex", m);
|
|
3612
3618
|
}
|
|
3613
|
-
function
|
|
3619
|
+
function k(m) {
|
|
3614
3620
|
const f = a(m.type);
|
|
3615
3621
|
return cn(m, f);
|
|
3616
3622
|
}
|
|
@@ -3631,20 +3637,20 @@ const Do = /* @__PURE__ */ he({
|
|
|
3631
3637
|
function A(m) {
|
|
3632
3638
|
return m.split(" ").map((f) => f[0]).join("").slice(0, 2).toUpperCase();
|
|
3633
3639
|
}
|
|
3634
|
-
return (m, f) => n.items.length > 0 ? (
|
|
3640
|
+
return (m, f) => n.items.length > 0 ? (w(), v("div", {
|
|
3635
3641
|
key: 0,
|
|
3636
3642
|
class: T(["absolute bottom-full left-0 right-0 mb-2 bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-lg max-h-60 overflow-y-auto z-50", s.value.root])
|
|
3637
3643
|
}, [
|
|
3638
3644
|
p("div", {
|
|
3639
3645
|
class: T(["p-2", s.value.container])
|
|
3640
3646
|
}, [
|
|
3641
|
-
(
|
|
3642
|
-
Object.keys(i.value).length > 1 ? (
|
|
3647
|
+
(w(!0), v(ke, null, Ne(i.value, (S, C) => (w(), v(ke, { key: C }, [
|
|
3648
|
+
Object.keys(i.value).length > 1 ? (w(), v("div", {
|
|
3643
3649
|
key: 0,
|
|
3644
3650
|
class: T(["px-3 py-1.5 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide", s.value.groupHeader])
|
|
3645
3651
|
}, N(c(C)), 3)) : B("", !0),
|
|
3646
|
-
(
|
|
3647
|
-
key:
|
|
3652
|
+
(w(!0), v(ke, null, Ne(S, (b, z) => (w(), v("button", {
|
|
3653
|
+
key: b.id,
|
|
3648
3654
|
type: "button",
|
|
3649
3655
|
class: T(["w-full flex items-center gap-3 px-3 py-2 rounded-lg text-left transition-colors mb-0.5", [
|
|
3650
3656
|
s.value.item,
|
|
@@ -3653,40 +3659,40 @@ const Do = /* @__PURE__ */ he({
|
|
|
3653
3659
|
"hover:bg-gray-50 dark:hover:bg-gray-700": u(C, z) !== o.value
|
|
3654
3660
|
}
|
|
3655
3661
|
]]),
|
|
3656
|
-
onClick: (F) => d(
|
|
3662
|
+
onClick: (F) => d(b),
|
|
3657
3663
|
onMouseenter: (F) => g(u(C, z))
|
|
3658
3664
|
}, [
|
|
3659
3665
|
me(m.$slots, "item-icon", {
|
|
3660
|
-
item:
|
|
3666
|
+
item: b,
|
|
3661
3667
|
type: C
|
|
3662
3668
|
}, () => [
|
|
3663
3669
|
p("span", {
|
|
3664
|
-
class: T(["w-8 h-8 flex items-center justify-center rounded-full text-xs font-semibold flex-shrink-0", [s.value.itemIcon, h(
|
|
3665
|
-
}, N(A(b
|
|
3670
|
+
class: T(["w-8 h-8 flex items-center justify-center rounded-full text-xs font-semibold flex-shrink-0", [s.value.itemIcon, h(b.type)]])
|
|
3671
|
+
}, N(A(k(b))), 3)
|
|
3666
3672
|
]),
|
|
3667
3673
|
p("div", {
|
|
3668
3674
|
class: T(["flex-1 min-w-0", s.value.itemContent])
|
|
3669
3675
|
}, [
|
|
3670
3676
|
p("p", {
|
|
3671
3677
|
class: T(["text-sm font-medium text-gray-900 dark:text-gray-100 truncate", s.value.itemName])
|
|
3672
|
-
}, N(b
|
|
3673
|
-
y(
|
|
3678
|
+
}, N(k(b)), 3),
|
|
3679
|
+
y(b) ? (w(), v("p", {
|
|
3674
3680
|
key: 0,
|
|
3675
3681
|
class: T(["text-xs text-gray-500 dark:text-gray-400 truncate", s.value.itemSubtitle])
|
|
3676
|
-
}, N(y(
|
|
3682
|
+
}, N(y(b)), 3)) : B("", !0)
|
|
3677
3683
|
], 2)
|
|
3678
|
-
], 42,
|
|
3684
|
+
], 42, Oo))), 128))
|
|
3679
3685
|
], 64))), 128))
|
|
3680
3686
|
], 2)
|
|
3681
3687
|
], 2)) : B("", !0);
|
|
3682
3688
|
}
|
|
3683
|
-
}),
|
|
3689
|
+
}), Po = ["title"], zo = {
|
|
3684
3690
|
key: 0,
|
|
3685
3691
|
class: "w-4 h-4 text-gray-500 dark:text-gray-400",
|
|
3686
3692
|
fill: "none",
|
|
3687
3693
|
viewBox: "0 0 24 24",
|
|
3688
3694
|
stroke: "currentColor"
|
|
3689
|
-
},
|
|
3695
|
+
}, Ho = /* @__PURE__ */ he({
|
|
3690
3696
|
__name: "ChatMessageActions",
|
|
3691
3697
|
props: {
|
|
3692
3698
|
message: {},
|
|
@@ -3711,7 +3717,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
3711
3717
|
console.error("Failed to copy:", c);
|
|
3712
3718
|
}
|
|
3713
3719
|
}
|
|
3714
|
-
return (c, u) => (
|
|
3720
|
+
return (c, u) => (w(), v("div", {
|
|
3715
3721
|
class: T(["flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity", o.value.container])
|
|
3716
3722
|
}, [
|
|
3717
3723
|
p("button", {
|
|
@@ -3720,7 +3726,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
3720
3726
|
title: i.value ? r("copied") : r("copyToClipboard"),
|
|
3721
3727
|
onClick: a
|
|
3722
3728
|
}, [
|
|
3723
|
-
i.value ? (
|
|
3729
|
+
i.value ? (w(), v("svg", {
|
|
3724
3730
|
key: 1,
|
|
3725
3731
|
class: T(["w-4 h-4 text-green-500", o.value.successState]),
|
|
3726
3732
|
fill: "none",
|
|
@@ -3733,7 +3739,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
3733
3739
|
"stroke-width": "2",
|
|
3734
3740
|
d: "M5 13l4 4L19 7"
|
|
3735
3741
|
}, null, -1)
|
|
3736
|
-
])], 2)) : (
|
|
3742
|
+
])], 2)) : (w(), v("svg", zo, [...u[0] || (u[0] = [
|
|
3737
3743
|
p("path", {
|
|
3738
3744
|
"stroke-linecap": "round",
|
|
3739
3745
|
"stroke-linejoin": "round",
|
|
@@ -3741,33 +3747,33 @@ const Do = /* @__PURE__ */ he({
|
|
|
3741
3747
|
d: "M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184"
|
|
3742
3748
|
}, null, -1)
|
|
3743
3749
|
])]))
|
|
3744
|
-
], 10,
|
|
3750
|
+
], 10, Po)
|
|
3745
3751
|
], 2));
|
|
3746
3752
|
}
|
|
3747
|
-
}),
|
|
3753
|
+
}), Fo = { class: "h-12 w-12 flex items-center justify-center rounded-lg bg-white/20 overflow-hidden" }, Bo = ["src"], Uo = {
|
|
3748
3754
|
key: 1,
|
|
3749
3755
|
class: "w-5 h-5 text-white",
|
|
3750
3756
|
fill: "none",
|
|
3751
3757
|
viewBox: "0 0 24 24",
|
|
3752
3758
|
stroke: "currentColor"
|
|
3753
|
-
},
|
|
3759
|
+
}, qo = { class: "flex-1 min-w-0" }, jo = { class: "text-sm font-semibold text-white truncate" }, Wo = { class: "text-xs text-white/70" }, Ko = {
|
|
3754
3760
|
key: 0,
|
|
3755
3761
|
class: "text-xs font-medium text-white/90"
|
|
3756
|
-
},
|
|
3762
|
+
}, Vo = ["src"], Go = {
|
|
3757
3763
|
key: 1,
|
|
3758
3764
|
class: "h-4 w-4 text-white",
|
|
3759
3765
|
viewBox: "0 0 24 24",
|
|
3760
3766
|
fill: "currentColor"
|
|
3761
|
-
},
|
|
3767
|
+
}, Qo = { class: "flex-shrink-0 mt-0.5" }, Zo = { class: "text-gray-600 dark:text-gray-400" }, Yo = ["id", "innerHTML"], Xo = { class: "h-12 w-12 flex items-center justify-center rounded-lg bg-white dark:bg-gray-800 overflow-hidden border border-gray-200 dark:border-gray-600" }, Jo = ["src"], ei = {
|
|
3762
3768
|
key: 1,
|
|
3763
3769
|
class: "w-5 h-5 text-gray-500 dark:text-gray-400",
|
|
3764
3770
|
fill: "none",
|
|
3765
3771
|
viewBox: "0 0 24 24",
|
|
3766
3772
|
stroke: "currentColor"
|
|
3767
|
-
},
|
|
3773
|
+
}, ti = { class: "flex-1 min-w-0" }, ni = { class: "text-sm font-semibold text-gray-800 dark:text-gray-200 truncate" }, si = { class: "text-xs text-gray-500 dark:text-gray-400" }, ri = {
|
|
3768
3774
|
key: 0,
|
|
3769
3775
|
class: "text-xs font-medium text-primary"
|
|
3770
|
-
},
|
|
3776
|
+
}, oi = /* @__PURE__ */ he({
|
|
3771
3777
|
__name: "ChatMessage",
|
|
3772
3778
|
props: {
|
|
3773
3779
|
message: {},
|
|
@@ -3796,7 +3802,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
3796
3802
|
function g() {
|
|
3797
3803
|
a.value = !a.value;
|
|
3798
3804
|
}
|
|
3799
|
-
function
|
|
3805
|
+
function k(f) {
|
|
3800
3806
|
return (f.type || "").startsWith("image/") ? !0 : /(png|jpe?g|gif|webp)$/i.test(f.name || "");
|
|
3801
3807
|
}
|
|
3802
3808
|
const y = O(() => {
|
|
@@ -3821,7 +3827,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
3821
3827
|
}
|
|
3822
3828
|
return (f, S) => {
|
|
3823
3829
|
var C;
|
|
3824
|
-
return
|
|
3830
|
+
return w(), v("div", {
|
|
3825
3831
|
class: T(["group relative animate-in fade-in slide-in-from-bottom-2 duration-300", [
|
|
3826
3832
|
o.value.root,
|
|
3827
3833
|
{
|
|
@@ -3830,41 +3836,41 @@ const Do = /* @__PURE__ */ he({
|
|
|
3830
3836
|
}
|
|
3831
3837
|
]])
|
|
3832
3838
|
}, [
|
|
3833
|
-
n.message.role === "user" ? (
|
|
3839
|
+
n.message.role === "user" ? (w(), v("div", {
|
|
3834
3840
|
key: 0,
|
|
3835
3841
|
class: T(["flex gap-3 justify-end", o.value.userMessage])
|
|
3836
3842
|
}, [
|
|
3837
3843
|
p("div", {
|
|
3838
3844
|
class: T(["rounded-2xl px-4 py-3 bg-primary-500 text-white max-w-fit", o.value.userBubble])
|
|
3839
3845
|
}, [
|
|
3840
|
-
n.message.message ? (
|
|
3846
|
+
n.message.message ? (w(), v("p", {
|
|
3841
3847
|
key: 0,
|
|
3842
3848
|
class: T(["text-sm whitespace-pre-wrap", [o.value.content, { "line-clamp-4": !a.value && d.value }]])
|
|
3843
3849
|
}, N(n.message.message), 3)) : B("", !0),
|
|
3844
|
-
d.value ? (
|
|
3850
|
+
d.value ? (w(), v("button", {
|
|
3845
3851
|
key: 1,
|
|
3846
3852
|
class: T(["mt-2 text-xs text-white/80 hover:text-white underline", o.value.showMoreButton]),
|
|
3847
3853
|
onClick: g
|
|
3848
3854
|
}, N(a.value ? r("showLess") : r("showMore")), 3)) : B("", !0),
|
|
3849
|
-
u.value ? (
|
|
3855
|
+
u.value ? (w(), v("div", {
|
|
3850
3856
|
key: 2,
|
|
3851
3857
|
class: T(["mt-3 space-y-2", o.value.attachmentsContainer])
|
|
3852
3858
|
}, [
|
|
3853
|
-
(
|
|
3854
|
-
key:
|
|
3855
|
-
href:
|
|
3856
|
-
target:
|
|
3859
|
+
(w(!0), v(ke, null, Ne(c.value, (b) => (w(), Me(nn(b.url ? "a" : "div"), {
|
|
3860
|
+
key: b.id,
|
|
3861
|
+
href: b.url || void 0,
|
|
3862
|
+
target: b.url ? "_blank" : void 0,
|
|
3857
3863
|
rel: "noopener noreferrer",
|
|
3858
|
-
class: T(["flex items-center gap-3 rounded-xl border border-white/20 bg-white/10 p-2 transition", [o.value.attachmentItem,
|
|
3864
|
+
class: T(["flex items-center gap-3 rounded-xl border border-white/20 bg-white/10 p-2 transition", [o.value.attachmentItem, b.url ? "hover:bg-white/20 cursor-pointer" : ""]])
|
|
3859
3865
|
}, {
|
|
3860
3866
|
default: Ce(() => [
|
|
3861
|
-
p("div",
|
|
3862
|
-
|
|
3867
|
+
p("div", Fo, [
|
|
3868
|
+
b.url && k(b) ? (w(), v("img", {
|
|
3863
3869
|
key: 0,
|
|
3864
|
-
src:
|
|
3870
|
+
src: b.url,
|
|
3865
3871
|
class: "object-cover h-full w-full",
|
|
3866
3872
|
alt: ""
|
|
3867
|
-
}, null, 8,
|
|
3873
|
+
}, null, 8, Bo)) : (w(), v("svg", Uo, [...S[0] || (S[0] = [
|
|
3868
3874
|
p("path", {
|
|
3869
3875
|
"stroke-linecap": "round",
|
|
3870
3876
|
"stroke-linejoin": "round",
|
|
@@ -3873,11 +3879,11 @@ const Do = /* @__PURE__ */ he({
|
|
|
3873
3879
|
}, null, -1)
|
|
3874
3880
|
])]))
|
|
3875
3881
|
]),
|
|
3876
|
-
p("div",
|
|
3877
|
-
p("p",
|
|
3878
|
-
p("p",
|
|
3882
|
+
p("div", qo, [
|
|
3883
|
+
p("p", jo, N(b.name || r("attachment")), 1),
|
|
3884
|
+
p("p", Wo, N(h(b.size)), 1)
|
|
3879
3885
|
]),
|
|
3880
|
-
|
|
3886
|
+
b.url ? (w(), v("span", Ko, N(r("openAttachment")), 1)) : B("", !0)
|
|
3881
3887
|
]),
|
|
3882
3888
|
_: 2
|
|
3883
3889
|
}, 1032, ["href", "target", "class"]))), 128))
|
|
@@ -3886,12 +3892,12 @@ const Do = /* @__PURE__ */ he({
|
|
|
3886
3892
|
p("div", {
|
|
3887
3893
|
class: T(["flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary-500 overflow-hidden", o.value.userAvatar])
|
|
3888
3894
|
}, [
|
|
3889
|
-
y.value ? (
|
|
3895
|
+
y.value ? (w(), v("img", {
|
|
3890
3896
|
key: 0,
|
|
3891
3897
|
src: y.value,
|
|
3892
3898
|
alt: "User",
|
|
3893
3899
|
class: "h-full w-full object-cover"
|
|
3894
|
-
}, null, 8,
|
|
3900
|
+
}, null, 8, Vo)) : (w(), v("svg", Go, [...S[1] || (S[1] = [
|
|
3895
3901
|
p("path", {
|
|
3896
3902
|
"fill-rule": "evenodd",
|
|
3897
3903
|
d: "M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z",
|
|
@@ -3899,17 +3905,17 @@ const Do = /* @__PURE__ */ he({
|
|
|
3899
3905
|
}, null, -1)
|
|
3900
3906
|
])]))
|
|
3901
3907
|
], 2)
|
|
3902
|
-
], 2)) : (
|
|
3908
|
+
], 2)) : (w(), v("div", {
|
|
3903
3909
|
key: 1,
|
|
3904
3910
|
class: T(["flex items-start gap-3", o.value.assistantMessage])
|
|
3905
3911
|
}, [
|
|
3906
|
-
p("div",
|
|
3907
|
-
ge(
|
|
3912
|
+
p("div", Qo, [
|
|
3913
|
+
ge(_o)
|
|
3908
3914
|
]),
|
|
3909
3915
|
p("div", {
|
|
3910
3916
|
class: T(["bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 px-5 py-4 shadow-sm rounded-2xl transition-all duration-200 flex-1", o.value.assistantBubble])
|
|
3911
3917
|
}, [
|
|
3912
|
-
n.message.loading ? (
|
|
3918
|
+
n.message.loading ? (w(), v("div", {
|
|
3913
3919
|
key: 0,
|
|
3914
3920
|
class: T(["flex items-center gap-2 text-sm min-w-[150px]", o.value.loadingIndicator])
|
|
3915
3921
|
}, [
|
|
@@ -3929,32 +3935,32 @@ const Do = /* @__PURE__ */ he({
|
|
|
3929
3935
|
style: { "animation-delay": "300ms" }
|
|
3930
3936
|
}, null, -1)
|
|
3931
3937
|
])], 2),
|
|
3932
|
-
p("span",
|
|
3933
|
-
], 2)) : n.message.message ? (
|
|
3938
|
+
p("span", Zo, N(((C = n.texts) == null ? void 0 : C.loadingText) || n.loadingText), 1)
|
|
3939
|
+
], 2)) : n.message.message ? (w(), v("div", {
|
|
3934
3940
|
key: 1,
|
|
3935
3941
|
id: n.message.id,
|
|
3936
3942
|
class: T(["prose prose-sm max-w-none prose-gray dark:prose-invert", o.value.content]),
|
|
3937
3943
|
innerHTML: A.value
|
|
3938
|
-
}, null, 10,
|
|
3939
|
-
!n.message.loading && u.value ? (
|
|
3944
|
+
}, null, 10, Yo)) : B("", !0),
|
|
3945
|
+
!n.message.loading && u.value ? (w(), v("div", {
|
|
3940
3946
|
key: 2,
|
|
3941
3947
|
class: T(["mt-4 space-y-2", o.value.attachmentsContainer])
|
|
3942
3948
|
}, [
|
|
3943
|
-
(
|
|
3944
|
-
key:
|
|
3945
|
-
href:
|
|
3946
|
-
target:
|
|
3949
|
+
(w(!0), v(ke, null, Ne(c.value, (b) => (w(), Me(nn(b.url ? "a" : "div"), {
|
|
3950
|
+
key: b.id,
|
|
3951
|
+
href: b.url || void 0,
|
|
3952
|
+
target: b.url ? "_blank" : void 0,
|
|
3947
3953
|
rel: "noopener noreferrer",
|
|
3948
|
-
class: T(["flex items-center gap-3 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 p-3 transition", [o.value.attachmentItem,
|
|
3954
|
+
class: T(["flex items-center gap-3 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 p-3 transition", [o.value.attachmentItem, b.url ? "hover:bg-white dark:hover:bg-gray-600 cursor-pointer" : ""]])
|
|
3949
3955
|
}, {
|
|
3950
3956
|
default: Ce(() => [
|
|
3951
|
-
p("div",
|
|
3952
|
-
|
|
3957
|
+
p("div", Xo, [
|
|
3958
|
+
b.url && k(b) ? (w(), v("img", {
|
|
3953
3959
|
key: 0,
|
|
3954
|
-
src:
|
|
3960
|
+
src: b.url,
|
|
3955
3961
|
class: "object-cover h-full w-full",
|
|
3956
3962
|
alt: ""
|
|
3957
|
-
}, null, 8,
|
|
3963
|
+
}, null, 8, Jo)) : (w(), v("svg", ei, [...S[3] || (S[3] = [
|
|
3958
3964
|
p("path", {
|
|
3959
3965
|
"stroke-linecap": "round",
|
|
3960
3966
|
"stroke-linejoin": "round",
|
|
@@ -3963,18 +3969,18 @@ const Do = /* @__PURE__ */ he({
|
|
|
3963
3969
|
}, null, -1)
|
|
3964
3970
|
])]))
|
|
3965
3971
|
]),
|
|
3966
|
-
p("div",
|
|
3967
|
-
p("p",
|
|
3968
|
-
p("p",
|
|
3972
|
+
p("div", ti, [
|
|
3973
|
+
p("p", ni, N(b.name || r("attachment")), 1),
|
|
3974
|
+
p("p", si, N(h(b.size)), 1)
|
|
3969
3975
|
]),
|
|
3970
|
-
|
|
3976
|
+
b.url ? (w(), v("span", ri, N(r("openAttachment")), 1)) : B("", !0)
|
|
3971
3977
|
]),
|
|
3972
3978
|
_: 2
|
|
3973
3979
|
}, 1032, ["href", "target", "class"]))), 128))
|
|
3974
3980
|
], 2)) : B("", !0)
|
|
3975
3981
|
], 2)
|
|
3976
3982
|
], 2)),
|
|
3977
|
-
n.message.role === "assistant" && !n.message.loading && !n.message.streaming && n.showActions ? (
|
|
3983
|
+
n.message.role === "assistant" && !n.message.loading && !n.message.streaming && n.showActions ? (w(), Me(Ho, {
|
|
3978
3984
|
key: 2,
|
|
3979
3985
|
message: n.message,
|
|
3980
3986
|
class: T(["absolute -bottom-8 left-14", o.value.actionsContainer]),
|
|
@@ -3988,19 +3994,19 @@ const Do = /* @__PURE__ */ he({
|
|
|
3988
3994
|
for (const [s, r] of e)
|
|
3989
3995
|
t[s] = r;
|
|
3990
3996
|
return t;
|
|
3991
|
-
},
|
|
3997
|
+
}, ii = /* @__PURE__ */ Rs(oi, [["__scopeId", "data-v-b5ba399c"]]), ai = { class: "text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide" }, li = { class: "space-y-2" }, ui = ["src"], ci = {
|
|
3992
3998
|
key: 1,
|
|
3993
3999
|
class: "w-5 h-5 text-gray-500 dark:text-gray-400",
|
|
3994
4000
|
fill: "none",
|
|
3995
4001
|
viewBox: "0 0 24 24",
|
|
3996
4002
|
stroke: "currentColor"
|
|
3997
|
-
},
|
|
4003
|
+
}, di = { class: "flex-1 min-w-0" }, pi = { class: "text-sm font-medium text-gray-800 dark:text-gray-200 truncate" }, hi = { class: "text-xs text-gray-500 dark:text-gray-400" }, fi = {
|
|
3998
4004
|
key: 0,
|
|
3999
4005
|
class: "mt-1 h-1 bg-gray-200 dark:bg-gray-600 rounded-full overflow-hidden"
|
|
4000
|
-
},
|
|
4006
|
+
}, gi = {
|
|
4001
4007
|
key: 0,
|
|
4002
4008
|
class: "text-xs text-gray-400"
|
|
4003
|
-
},
|
|
4009
|
+
}, mi = ["disabled", "onClick"], yi = /* @__PURE__ */ he({
|
|
4004
4010
|
__name: "AttachmentsPreview",
|
|
4005
4011
|
props: {
|
|
4006
4012
|
attachments: {},
|
|
@@ -4013,24 +4019,24 @@ const Do = /* @__PURE__ */ he({
|
|
|
4013
4019
|
setup(n) {
|
|
4014
4020
|
return (e, t) => {
|
|
4015
4021
|
var s;
|
|
4016
|
-
return
|
|
4022
|
+
return w(), v("div", {
|
|
4017
4023
|
class: T(["border border-gray-200 dark:border-gray-700 rounded-2xl p-3 bg-gray-50 dark:bg-gray-800 space-y-3", n.ui.attachmentsContainer])
|
|
4018
4024
|
}, [
|
|
4019
|
-
p("p",
|
|
4020
|
-
p("ul",
|
|
4021
|
-
(
|
|
4025
|
+
p("p", ai, N(((s = n.texts) == null ? void 0 : s.attachedFiles) || "Attached files"), 1),
|
|
4026
|
+
p("ul", li, [
|
|
4027
|
+
(w(!0), v(ke, null, Ne(n.attachments, (r) => (w(), v("li", {
|
|
4022
4028
|
key: r.id,
|
|
4023
4029
|
class: T(["flex items-center gap-3 rounded-xl bg-white dark:bg-gray-700 p-2 shadow-sm border border-gray-100 dark:border-gray-600", n.ui.attachmentItem])
|
|
4024
4030
|
}, [
|
|
4025
4031
|
p("div", {
|
|
4026
4032
|
class: T(["h-10 w-10 flex items-center justify-center rounded-lg bg-gray-100 dark:bg-gray-600 overflow-hidden", n.ui.attachmentThumbnail])
|
|
4027
4033
|
}, [
|
|
4028
|
-
n.isImage(r) ? (
|
|
4034
|
+
n.isImage(r) ? (w(), v("img", {
|
|
4029
4035
|
key: 0,
|
|
4030
4036
|
src: r.previewUrl || r.url,
|
|
4031
4037
|
class: "object-cover h-full w-full",
|
|
4032
4038
|
alt: ""
|
|
4033
|
-
}, null, 8,
|
|
4039
|
+
}, null, 8, ui)) : (w(), v("svg", ci, [...t[0] || (t[0] = [
|
|
4034
4040
|
p("path", {
|
|
4035
4041
|
"stroke-linecap": "round",
|
|
4036
4042
|
"stroke-linejoin": "round",
|
|
@@ -4039,17 +4045,17 @@ const Do = /* @__PURE__ */ he({
|
|
|
4039
4045
|
}, null, -1)
|
|
4040
4046
|
])]))
|
|
4041
4047
|
], 2),
|
|
4042
|
-
p("div",
|
|
4043
|
-
p("p",
|
|
4044
|
-
p("p",
|
|
4045
|
-
r.uploading ? (
|
|
4048
|
+
p("div", di, [
|
|
4049
|
+
p("p", pi, N(r.name), 1),
|
|
4050
|
+
p("p", hi, N(n.formatFileSize(r.size)), 1),
|
|
4051
|
+
r.uploading ? (w(), v("div", fi, [
|
|
4046
4052
|
p("div", {
|
|
4047
4053
|
class: "h-full bg-primary transition-all",
|
|
4048
4054
|
style: un({ width: `${r.progress ?? 10}%` })
|
|
4049
4055
|
}, null, 4)
|
|
4050
4056
|
])) : B("", !0)
|
|
4051
4057
|
]),
|
|
4052
|
-
r.uploading ? (
|
|
4058
|
+
r.uploading ? (w(), v("span", gi, N(Math.round(r.progress ?? 0)) + "% ", 1)) : B("", !0),
|
|
4053
4059
|
p("button", {
|
|
4054
4060
|
type: "button",
|
|
4055
4061
|
class: T(["p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed", n.ui.attachmentRemove]),
|
|
@@ -4069,13 +4075,13 @@ const Do = /* @__PURE__ */ he({
|
|
|
4069
4075
|
d: "M6 18L18 6M6 6l12 12"
|
|
4070
4076
|
})
|
|
4071
4077
|
], -1)
|
|
4072
|
-
])], 10,
|
|
4078
|
+
])], 10, mi)
|
|
4073
4079
|
], 2))), 128))
|
|
4074
4080
|
])
|
|
4075
4081
|
], 2);
|
|
4076
4082
|
};
|
|
4077
4083
|
}
|
|
4078
|
-
}),
|
|
4084
|
+
}), xi = { class: "py-1" }, wi = ["onClick", "onMouseenter"], ki = { class: "flex items-start gap-3" }, bi = { class: "flex-1 min-w-0" }, vi = { class: "text-sm font-medium text-gray-900 dark:text-gray-100" }, Ti = { class: "text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2" }, Si = /* @__PURE__ */ he({
|
|
4079
4085
|
__name: "SuggestionsDropdown",
|
|
4080
4086
|
props: {
|
|
4081
4087
|
suggestions: {},
|
|
@@ -4085,7 +4091,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4085
4091
|
emits: ["select", "hover"],
|
|
4086
4092
|
setup(n, { expose: e }) {
|
|
4087
4093
|
const t = q(null);
|
|
4088
|
-
return e({ dropdownRef: t }), (s, r) => (
|
|
4094
|
+
return e({ dropdownRef: t }), (s, r) => (w(), Me(mt, {
|
|
4089
4095
|
"enter-active-class": "transition ease-out duration-100",
|
|
4090
4096
|
"enter-from-class": "transform opacity-0 scale-95",
|
|
4091
4097
|
"enter-to-class": "transform opacity-100 scale-100",
|
|
@@ -4099,8 +4105,8 @@ const Do = /* @__PURE__ */ he({
|
|
|
4099
4105
|
ref: t,
|
|
4100
4106
|
class: T(["absolute bottom-full left-0 right-0 mb-2 bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-lg max-h-80 overflow-y-auto z-10", n.ui.suggestionsDropdown])
|
|
4101
4107
|
}, [
|
|
4102
|
-
p("ul",
|
|
4103
|
-
(
|
|
4108
|
+
p("ul", xi, [
|
|
4109
|
+
(w(!0), v(ke, null, Ne(n.suggestions, (o, i) => (w(), v("li", {
|
|
4104
4110
|
key: o.id,
|
|
4105
4111
|
class: T(["px-4 py-3 cursor-pointer transition-colors border-b border-gray-100 dark:border-gray-700 last:border-b-0", [
|
|
4106
4112
|
n.ui.suggestionItem,
|
|
@@ -4114,29 +4120,29 @@ const Do = /* @__PURE__ */ he({
|
|
|
4114
4120
|
}, [
|
|
4115
4121
|
p("div", ki, [
|
|
4116
4122
|
p("div", bi, [
|
|
4117
|
-
p("p",
|
|
4118
|
-
p("p",
|
|
4123
|
+
p("p", vi, N(o.title), 1),
|
|
4124
|
+
p("p", Ti, N(o.description), 1)
|
|
4119
4125
|
])
|
|
4120
4126
|
])
|
|
4121
|
-
], 42,
|
|
4127
|
+
], 42, wi))), 128))
|
|
4122
4128
|
])
|
|
4123
4129
|
], 2)
|
|
4124
4130
|
]),
|
|
4125
4131
|
_: 1
|
|
4126
4132
|
}));
|
|
4127
4133
|
}
|
|
4128
|
-
}),
|
|
4134
|
+
}), Ai = { class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1 z-10" }, Ci = ["title"], Ei = ["title"], Mi = ["disabled"], Ri = {
|
|
4129
4135
|
key: 0,
|
|
4130
4136
|
class: "w-4 h-4",
|
|
4131
4137
|
fill: "none",
|
|
4132
4138
|
viewBox: "0 0 24 24",
|
|
4133
4139
|
stroke: "currentColor"
|
|
4134
|
-
},
|
|
4140
|
+
}, Li = {
|
|
4135
4141
|
key: 1,
|
|
4136
4142
|
class: "w-4 h-4",
|
|
4137
4143
|
viewBox: "0 0 24 24",
|
|
4138
4144
|
fill: "currentColor"
|
|
4139
|
-
},
|
|
4145
|
+
}, Ii = /* @__PURE__ */ he({
|
|
4140
4146
|
__name: "InputActions",
|
|
4141
4147
|
props: {
|
|
4142
4148
|
sending: { type: Boolean },
|
|
@@ -4151,8 +4157,8 @@ const Do = /* @__PURE__ */ he({
|
|
|
4151
4157
|
const e = n, t = O(() => e.sending ? [e.ui.stopButton || "bg-red-500 text-white hover:bg-red-600"] : e.canSend ? [e.ui.sendButtonActive || "bg-primary-500 text-white hover:bg-primary-600"] : [e.ui.sendButtonDisabled || "bg-gray-200 dark:bg-gray-700 text-gray-400 dark:text-gray-500 cursor-not-allowed opacity-60"]);
|
|
4152
4158
|
return (s, r) => {
|
|
4153
4159
|
var o, i, a;
|
|
4154
|
-
return
|
|
4155
|
-
n.showSupportModeToggle && !n.supportRequestMode ? (
|
|
4160
|
+
return w(), v("div", Ai, [
|
|
4161
|
+
n.showSupportModeToggle && !n.supportRequestMode ? (w(), v("button", {
|
|
4156
4162
|
key: 0,
|
|
4157
4163
|
type: "button",
|
|
4158
4164
|
class: T(["h-9 w-9 rounded-xl flex items-center justify-center text-gray-400 hover:text-primary hover:bg-gray-100 dark:hover:bg-gray-700 transition flex-shrink-0", n.ui.supportToggle]),
|
|
@@ -4172,8 +4178,8 @@ const Do = /* @__PURE__ */ he({
|
|
|
4172
4178
|
d: "M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"
|
|
4173
4179
|
})
|
|
4174
4180
|
], -1)
|
|
4175
|
-
])], 10,
|
|
4176
|
-
n.showSupportModeToggle && n.supportRequestMode ? (
|
|
4181
|
+
])], 10, Ci)) : B("", !0),
|
|
4182
|
+
n.showSupportModeToggle && n.supportRequestMode ? (w(), v("button", {
|
|
4177
4183
|
key: 1,
|
|
4178
4184
|
type: "button",
|
|
4179
4185
|
class: T(["h-7 px-2 rounded-lg flex items-center gap-1 text-xs font-medium bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-400 hover:bg-amber-200 dark:hover:bg-amber-900/50 transition flex-shrink-0", n.ui.supportBadge]),
|
|
@@ -4207,20 +4213,20 @@ const Do = /* @__PURE__ */ he({
|
|
|
4207
4213
|
d: "M6 18L18 6M6 6l12 12"
|
|
4208
4214
|
})
|
|
4209
4215
|
], -1))
|
|
4210
|
-
], 10,
|
|
4216
|
+
], 10, Ei)) : B("", !0),
|
|
4211
4217
|
p("button", {
|
|
4212
4218
|
disabled: !n.canSend && !n.sending,
|
|
4213
4219
|
class: T(["h-9 w-9 rounded-xl flex items-center justify-center transition-all duration-200 flex-shrink-0", t.value]),
|
|
4214
4220
|
type: "button",
|
|
4215
4221
|
onClick: r[2] || (r[2] = et((c) => s.$emit("click"), ["prevent"]))
|
|
4216
4222
|
}, [
|
|
4217
|
-
n.sending ? (
|
|
4223
|
+
n.sending ? (w(), v("svg", Li, [...r[7] || (r[7] = [
|
|
4218
4224
|
p("path", {
|
|
4219
4225
|
"fill-rule": "evenodd",
|
|
4220
4226
|
d: "M4.5 7.5a3 3 0 013-3h9a3 3 0 013 3v9a3 3 0 01-3 3h-9a3 3 0 01-3-3v-9z",
|
|
4221
4227
|
"clip-rule": "evenodd"
|
|
4222
4228
|
}, null, -1)
|
|
4223
|
-
])])) : (
|
|
4229
|
+
])])) : (w(), v("svg", Ri, [...r[6] || (r[6] = [
|
|
4224
4230
|
p("path", {
|
|
4225
4231
|
"stroke-linecap": "round",
|
|
4226
4232
|
"stroke-linejoin": "round",
|
|
@@ -4228,14 +4234,14 @@ const Do = /* @__PURE__ */ he({
|
|
|
4228
4234
|
d: "M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"
|
|
4229
4235
|
}, null, -1)
|
|
4230
4236
|
])]))
|
|
4231
|
-
], 10,
|
|
4237
|
+
], 10, Mi)
|
|
4232
4238
|
]);
|
|
4233
4239
|
};
|
|
4234
4240
|
}
|
|
4235
|
-
}),
|
|
4241
|
+
}), $i = { class: "max-w-3xl mx-auto space-y-3" }, Di = ["accept"], _i = ["title"], Oi = { class: "flex items-center" }, Ni = ["placeholder", "disabled"], Pi = {
|
|
4236
4242
|
key: 0,
|
|
4237
4243
|
class: "flex justify-center"
|
|
4238
|
-
},
|
|
4244
|
+
}, zi = /* @__PURE__ */ he({
|
|
4239
4245
|
__name: "ChatInput",
|
|
4240
4246
|
props: {
|
|
4241
4247
|
modelValue: {},
|
|
@@ -4254,13 +4260,13 @@ const Do = /* @__PURE__ */ he({
|
|
|
4254
4260
|
},
|
|
4255
4261
|
emits: ["update:modelValue", "submit", "cancel", "suggestion-select", "toggle-support-mode", "context-link-click"],
|
|
4256
4262
|
setup(n, { emit: e }) {
|
|
4257
|
-
const t = n, s = O(() => t.ui || {}), r = e, o = q(t.modelValue), i = q(null), a = q(null), c = q(!1), u =
|
|
4263
|
+
const t = n, s = O(() => t.ui || {}), r = e, o = q(t.modelValue), i = q(null), a = q(null), c = q(!1), u = Lo(), d = Io(
|
|
4258
4264
|
() => o.value,
|
|
4259
4265
|
(M) => {
|
|
4260
4266
|
o.value = M;
|
|
4261
4267
|
},
|
|
4262
4268
|
() => i.value
|
|
4263
|
-
), g =
|
|
4269
|
+
), g = $o(
|
|
4264
4270
|
() => t.suggestions,
|
|
4265
4271
|
() => t.hasHistory,
|
|
4266
4272
|
() => c.value,
|
|
@@ -4271,21 +4277,21 @@ const Do = /* @__PURE__ */ he({
|
|
|
4271
4277
|
return (I = i.value) == null ? void 0 : I.focus();
|
|
4272
4278
|
});
|
|
4273
4279
|
}
|
|
4274
|
-
), { adjustTextareaHeight:
|
|
4280
|
+
), { adjustTextareaHeight: k } = Do(() => i.value), y = O(() => t.supportRequestMode ? t.supportPlaceholder : t.placeholder), h = O(() => t.showSupportModeToggle ? t.supportRequestMode ? { paddingLeft: "3rem", paddingRight: "8rem" } : { paddingLeft: "3rem", paddingRight: "6rem" } : { paddingLeft: "3rem", paddingRight: "3.5rem" }), A = O(() => {
|
|
4275
4281
|
var I;
|
|
4276
4282
|
return (((I = o.value) == null ? void 0 : I.trim()) ?? "").length >= t.minLength ? !0 : u.hasAttachments.value;
|
|
4277
4283
|
}), m = O(
|
|
4278
4284
|
() => !t.disabled && !t.sending && A.value && !u.isUploading.value
|
|
4279
4285
|
);
|
|
4280
4286
|
Ue(() => t.modelValue, (M) => {
|
|
4281
|
-
o.value = M, Oe(
|
|
4287
|
+
o.value = M, Oe(k);
|
|
4282
4288
|
}), Ue(o, (M) => {
|
|
4283
|
-
r("update:modelValue", M), Oe(
|
|
4289
|
+
r("update:modelValue", M), Oe(k), d.checkForMentions(M), g.updateSuggestionsVisibility();
|
|
4284
4290
|
}), Ue(() => t.suggestions, () => {
|
|
4285
4291
|
g.updateSuggestionsVisibility();
|
|
4286
4292
|
});
|
|
4287
4293
|
function f() {
|
|
4288
|
-
|
|
4294
|
+
k();
|
|
4289
4295
|
}
|
|
4290
4296
|
function S(M) {
|
|
4291
4297
|
if (!d.handleMentionKeyDown(M) && !g.handleSuggestionKeyDown(M) && M.key === "Enter") {
|
|
@@ -4301,9 +4307,9 @@ const Do = /* @__PURE__ */ he({
|
|
|
4301
4307
|
attachments: M,
|
|
4302
4308
|
mentions: P,
|
|
4303
4309
|
isSupportRequest: t.supportRequestMode
|
|
4304
|
-
}), o.value = "", u.clearAttachments(), d.clearMentions(), Oe(
|
|
4310
|
+
}), o.value = "", u.clearAttachments(), d.clearMentions(), Oe(k);
|
|
4305
4311
|
}
|
|
4306
|
-
function
|
|
4312
|
+
function b() {
|
|
4307
4313
|
t.sending ? r("cancel") : m.value && C();
|
|
4308
4314
|
}
|
|
4309
4315
|
function z() {
|
|
@@ -4322,10 +4328,10 @@ const Do = /* @__PURE__ */ he({
|
|
|
4322
4328
|
}, 200);
|
|
4323
4329
|
}
|
|
4324
4330
|
return xt(() => {
|
|
4325
|
-
Oe(
|
|
4331
|
+
Oe(k);
|
|
4326
4332
|
}), (M, I) => {
|
|
4327
4333
|
var P;
|
|
4328
|
-
return
|
|
4334
|
+
return w(), v("div", {
|
|
4329
4335
|
class: T(["px-4 pb-4 bg-white dark:bg-gray-900 sticky bottom-0", s.value.root]),
|
|
4330
4336
|
onDragenter: I[6] || (I[6] = et(
|
|
4331
4337
|
//@ts-ignore
|
|
@@ -4352,7 +4358,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4352
4358
|
onSubmit: et(C, ["prevent"]),
|
|
4353
4359
|
class: T(s.value.form)
|
|
4354
4360
|
}, [
|
|
4355
|
-
p("div",
|
|
4361
|
+
p("div", $i, [
|
|
4356
4362
|
p("input", {
|
|
4357
4363
|
ref_key: "fileInputRef",
|
|
4358
4364
|
ref: a,
|
|
@@ -4362,8 +4368,8 @@ const Do = /* @__PURE__ */ he({
|
|
|
4362
4368
|
accept: D(u).acceptedFileTypes,
|
|
4363
4369
|
onChange: I[0] || (I[0] = //@ts-ignore
|
|
4364
4370
|
(...L) => D(u).handleFileSelect && D(u).handleFileSelect(...L))
|
|
4365
|
-
}, null, 40,
|
|
4366
|
-
D(u).hasAttachments.value ? (
|
|
4371
|
+
}, null, 40, Di),
|
|
4372
|
+
D(u).hasAttachments.value ? (w(), Me(yi, {
|
|
4367
4373
|
key: 0,
|
|
4368
4374
|
attachments: D(u).attachments.value,
|
|
4369
4375
|
ui: s.value,
|
|
@@ -4375,7 +4381,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4375
4381
|
p("div", {
|
|
4376
4382
|
class: T(["relative", s.value.inputContainer])
|
|
4377
4383
|
}, [
|
|
4378
|
-
D(g).showSuggestions.value && n.suggestions.length > 0 ? (
|
|
4384
|
+
D(g).showSuggestions.value && n.suggestions.length > 0 ? (w(), Me(Si, {
|
|
4379
4385
|
key: 0,
|
|
4380
4386
|
ref: "suggestionsHandler.dropdownRef.value",
|
|
4381
4387
|
suggestions: n.suggestions,
|
|
@@ -4393,7 +4399,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4393
4399
|
"leave-to-class": "transform opacity-0 scale-95"
|
|
4394
4400
|
}, {
|
|
4395
4401
|
default: Ce(() => [
|
|
4396
|
-
D(d).showMentions.value && D(d).mentionItems.value.length > 0 ? (
|
|
4402
|
+
D(d).showMentions.value && D(d).mentionItems.value.length > 0 ? (w(), Me(No, {
|
|
4397
4403
|
key: 0,
|
|
4398
4404
|
items: D(d).mentionItems.value,
|
|
4399
4405
|
"selected-index": D(d).selectedMentionIndex.value,
|
|
@@ -4432,8 +4438,8 @@ const Do = /* @__PURE__ */ he({
|
|
|
4432
4438
|
d: "M18.375 12.739l-7.693 7.693a4.5 4.5 0 01-6.364-6.364l10.94-10.94A3 3 0 1119.5 7.372L8.552 18.32m.009-.01l-.01.01m5.699-9.941l-7.81 7.81a1.5 1.5 0 002.112 2.13"
|
|
4433
4439
|
})
|
|
4434
4440
|
], -1)
|
|
4435
|
-
])], 10,
|
|
4436
|
-
p("div",
|
|
4441
|
+
])], 10, _i),
|
|
4442
|
+
p("div", Oi, [
|
|
4437
4443
|
Us(p("textarea", {
|
|
4438
4444
|
ref_key: "textareaRef",
|
|
4439
4445
|
ref: i,
|
|
@@ -4448,11 +4454,11 @@ const Do = /* @__PURE__ */ he({
|
|
|
4448
4454
|
onKeydown: S,
|
|
4449
4455
|
onFocus: V,
|
|
4450
4456
|
onBlur: E
|
|
4451
|
-
}, null, 46,
|
|
4457
|
+
}, null, 46, Ni), [
|
|
4452
4458
|
[qs, o.value]
|
|
4453
4459
|
])
|
|
4454
4460
|
]),
|
|
4455
|
-
ge(
|
|
4461
|
+
ge(Ii, {
|
|
4456
4462
|
sending: n.sending,
|
|
4457
4463
|
"can-send": m.value,
|
|
4458
4464
|
"support-request-mode": n.supportRequestMode,
|
|
@@ -4460,12 +4466,12 @@ const Do = /* @__PURE__ */ he({
|
|
|
4460
4466
|
ui: s.value,
|
|
4461
4467
|
texts: n.texts,
|
|
4462
4468
|
onToggleSupportMode: I[4] || (I[4] = (L) => M.$emit("toggle-support-mode")),
|
|
4463
|
-
onClick:
|
|
4469
|
+
onClick: b
|
|
4464
4470
|
}, null, 8, ["sending", "can-send", "support-request-mode", "show-support-mode-toggle", "ui", "texts"])
|
|
4465
4471
|
], 2)
|
|
4466
4472
|
], 2),
|
|
4467
4473
|
me(M.$slots, "context-link", {}, () => [
|
|
4468
|
-
n.contextLinkText ? (
|
|
4474
|
+
n.contextLinkText ? (w(), v("div", Pi, [
|
|
4469
4475
|
p("button", {
|
|
4470
4476
|
type: "button",
|
|
4471
4477
|
class: T(["text-xs text-gray-400 hover:text-primary transition-colors", s.value.contextLink]),
|
|
@@ -4478,7 +4484,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4478
4484
|
], 34);
|
|
4479
4485
|
};
|
|
4480
4486
|
}
|
|
4481
|
-
}),
|
|
4487
|
+
}), Hi = ["onClick"], Fi = /* @__PURE__ */ he({
|
|
4482
4488
|
__name: "AiEmptyState",
|
|
4483
4489
|
props: {
|
|
4484
4490
|
ui: {},
|
|
@@ -4486,26 +4492,26 @@ const Do = /* @__PURE__ */ he({
|
|
|
4486
4492
|
},
|
|
4487
4493
|
emits: ["item-click"],
|
|
4488
4494
|
setup(n, { emit: e }) {
|
|
4489
|
-
const t = n, s = e, r = (
|
|
4495
|
+
const t = n, s = e, r = (k) => {
|
|
4490
4496
|
var h;
|
|
4491
|
-
return (h = t.texts) != null && h[
|
|
4497
|
+
return (h = t.texts) != null && h[k] ? t.texts[k] : le({
|
|
4492
4498
|
aiName: "aiName",
|
|
4493
4499
|
title: "emptyStateTitle",
|
|
4494
4500
|
description: "emptyStateDescription"
|
|
4495
|
-
}[
|
|
4501
|
+
}[k]);
|
|
4496
4502
|
}, o = O(() => t.ui || {}), { suggestions: i, resolvePrompt: a } = Ms();
|
|
4497
|
-
function c(
|
|
4503
|
+
function c(k) {
|
|
4498
4504
|
const y = {
|
|
4499
|
-
...
|
|
4500
|
-
prompt: a(
|
|
4505
|
+
...k,
|
|
4506
|
+
prompt: a(k)
|
|
4501
4507
|
};
|
|
4502
4508
|
s("item-click", y);
|
|
4503
4509
|
}
|
|
4504
|
-
function u(
|
|
4505
|
-
return
|
|
4510
|
+
function u(k) {
|
|
4511
|
+
return k.gradientClass ? k.gradientClass : k.className ? k.className : "bg-gradient-to-br from-white to-gray-50 dark:from-gray-800 dark:to-gray-900";
|
|
4506
4512
|
}
|
|
4507
|
-
function d(
|
|
4508
|
-
const y =
|
|
4513
|
+
function d(k) {
|
|
4514
|
+
const y = k.category || "default", h = {
|
|
4509
4515
|
hr: "bg-blue-100 dark:bg-blue-900/30",
|
|
4510
4516
|
finance: "bg-green-100 dark:bg-green-900/30",
|
|
4511
4517
|
analytics: "bg-purple-100 dark:bg-purple-900/30",
|
|
@@ -4514,8 +4520,8 @@ const Do = /* @__PURE__ */ he({
|
|
|
4514
4520
|
};
|
|
4515
4521
|
return h[y] || h.default;
|
|
4516
4522
|
}
|
|
4517
|
-
function g(
|
|
4518
|
-
const y =
|
|
4523
|
+
function g(k) {
|
|
4524
|
+
const y = k.category || "default", h = {
|
|
4519
4525
|
hr: "text-blue-600 dark:text-blue-400",
|
|
4520
4526
|
finance: "text-green-600 dark:text-green-400",
|
|
4521
4527
|
analytics: "text-purple-600 dark:text-purple-400",
|
|
@@ -4524,7 +4530,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4524
4530
|
};
|
|
4525
4531
|
return h[y] || h.default;
|
|
4526
4532
|
}
|
|
4527
|
-
return (
|
|
4533
|
+
return (k, y) => (w(), v("div", {
|
|
4528
4534
|
class: T(["flex items-center justify-center p-4 h-full", o.value.root])
|
|
4529
4535
|
}, [
|
|
4530
4536
|
p("div", {
|
|
@@ -4561,7 +4567,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4561
4567
|
p("div", {
|
|
4562
4568
|
class: T(["mb-8 grid gap-3 sm:grid-cols-2 lg:grid-cols-3", o.value.grid])
|
|
4563
4569
|
}, [
|
|
4564
|
-
(
|
|
4570
|
+
(w(!0), v(ke, null, Ne(D(i), (h, A) => (w(), v("button", {
|
|
4565
4571
|
key: h.id || A,
|
|
4566
4572
|
class: T(["group relative overflow-hidden rounded-xl border border-gray-300 dark:border-gray-600 p-4 text-left transition-all hover:shadow-md hover:scale-[1.02]", [o.value.suggestionCard, u(h)]]),
|
|
4567
4573
|
onClick: (m) => c(h)
|
|
@@ -4569,10 +4575,10 @@ const Do = /* @__PURE__ */ he({
|
|
|
4569
4575
|
p("div", {
|
|
4570
4576
|
class: T(["mb-2 inline-flex h-10 w-10 items-center justify-center rounded-lg", [o.value.suggestionIconContainer, d(h)]])
|
|
4571
4577
|
}, [
|
|
4572
|
-
h.icon ? (
|
|
4578
|
+
h.icon ? (w(), Me(nn(h.icon), {
|
|
4573
4579
|
key: 0,
|
|
4574
4580
|
class: T(["h-5 w-5", [o.value.suggestionIcon, g(h)]])
|
|
4575
|
-
}, null, 8, ["class"])) : (
|
|
4581
|
+
}, null, 8, ["class"])) : (w(), v("svg", {
|
|
4576
4582
|
key: 1,
|
|
4577
4583
|
class: T(["h-5 w-5", [o.value.suggestionIcon, g(h)]]),
|
|
4578
4584
|
fill: "none",
|
|
@@ -4593,35 +4599,35 @@ const Do = /* @__PURE__ */ he({
|
|
|
4593
4599
|
p("p", {
|
|
4594
4600
|
class: T(["text-xs text-gray-600 dark:text-gray-400", o.value.suggestionDescription])
|
|
4595
4601
|
}, N(h.description), 3)
|
|
4596
|
-
], 10,
|
|
4602
|
+
], 10, Hi))), 128))
|
|
4597
4603
|
], 2)
|
|
4598
4604
|
], 2)
|
|
4599
4605
|
], 2));
|
|
4600
4606
|
}
|
|
4601
|
-
}),
|
|
4607
|
+
}), Bi = { class: "flex items-center gap-3" }, Ui = {
|
|
4602
4608
|
key: 1,
|
|
4603
4609
|
class: "text-xs text-gray-400 dark:text-gray-500 font-medium"
|
|
4604
|
-
},
|
|
4610
|
+
}, qi = {
|
|
4605
4611
|
key: 1,
|
|
4606
4612
|
class: "flex items-center gap-2"
|
|
4607
|
-
},
|
|
4613
|
+
}, ji = {
|
|
4608
4614
|
key: 0,
|
|
4609
4615
|
class: "flex items-center gap-2 ml-auto mr-3"
|
|
4610
|
-
},
|
|
4616
|
+
}, Wi = ["title"], Ki = ["title"], Vi = ["title"], Gi = {
|
|
4611
4617
|
key: 0,
|
|
4612
4618
|
class: "w-5 h-5 text-gray-600 dark:text-gray-400",
|
|
4613
4619
|
fill: "none",
|
|
4614
4620
|
viewBox: "0 0 24 24",
|
|
4615
4621
|
stroke: "currentColor",
|
|
4616
4622
|
"stroke-width": "1.5"
|
|
4617
|
-
},
|
|
4623
|
+
}, Qi = {
|
|
4618
4624
|
key: 1,
|
|
4619
4625
|
class: "w-5 h-5 text-gray-600 dark:text-gray-400",
|
|
4620
4626
|
fill: "none",
|
|
4621
4627
|
viewBox: "0 0 24 24",
|
|
4622
4628
|
stroke: "currentColor",
|
|
4623
4629
|
"stroke-width": "1.5"
|
|
4624
|
-
},
|
|
4630
|
+
}, Zi = /* @__PURE__ */ he({
|
|
4625
4631
|
__name: "DrawerHeader",
|
|
4626
4632
|
props: {
|
|
4627
4633
|
ui: {},
|
|
@@ -4640,15 +4646,15 @@ const Do = /* @__PURE__ */ he({
|
|
|
4640
4646
|
setup(n) {
|
|
4641
4647
|
return (e, t) => {
|
|
4642
4648
|
var s, r, o, i, a, c;
|
|
4643
|
-
return
|
|
4649
|
+
return w(), v("div", {
|
|
4644
4650
|
class: T(["flex items-center justify-between px-4 sm:px-6 pt-4 border-b border-gray-200 dark:border-gray-700 pb-4", (s = n.ui) == null ? void 0 : s.header])
|
|
4645
4651
|
}, [
|
|
4646
|
-
p("div",
|
|
4647
|
-
n.isSetupMode ? (
|
|
4652
|
+
p("div", Bi, [
|
|
4653
|
+
n.isSetupMode ? (w(), v("div", qi, [...t[5] || (t[5] = [
|
|
4648
4654
|
p("span", { class: "flex h-2 w-2 rounded-full bg-amber-500 animate-pulse" }, null, -1),
|
|
4649
4655
|
p("span", { class: "text-sm font-medium text-gray-700 dark:text-gray-300" }, "Setup Required", -1)
|
|
4650
|
-
])])) : (
|
|
4651
|
-
n.showNewChatButton && n.hasHistory ? (
|
|
4656
|
+
])])) : (w(), v(ke, { key: 0 }, [
|
|
4657
|
+
n.showNewChatButton && n.hasHistory ? (w(), v("button", {
|
|
4652
4658
|
key: 0,
|
|
4653
4659
|
type: "button",
|
|
4654
4660
|
class: T(["inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 hover:border-gray-400 transition-all duration-200 shadow-sm", (r = n.ui) == null ? void 0 : r.newChatButton]),
|
|
@@ -4668,17 +4674,17 @@ const Do = /* @__PURE__ */ he({
|
|
|
4668
4674
|
})
|
|
4669
4675
|
], -1)),
|
|
4670
4676
|
p("span", null, N(n.t("newChat")), 1)
|
|
4671
|
-
], 2)) : (
|
|
4677
|
+
], 2)) : (w(), v("span", Ui, N(n.t("keyboardShortcutHint")), 1))
|
|
4672
4678
|
], 64))
|
|
4673
4679
|
]),
|
|
4674
|
-
n.showQuota && !n.isSetupMode ? (
|
|
4680
|
+
n.showQuota && !n.isSetupMode ? (w(), v("div", ji, [
|
|
4675
4681
|
me(e.$slots, "quota", {}, () => {
|
|
4676
4682
|
var u, d;
|
|
4677
4683
|
return [
|
|
4678
|
-
n.quota.remaining > 0 ? (
|
|
4684
|
+
n.quota.remaining > 0 ? (w(), v("span", {
|
|
4679
4685
|
key: 0,
|
|
4680
4686
|
class: T(["text-xs text-green-600 dark:text-green-400", (u = n.ui) == null ? void 0 : u.quotaDisplay])
|
|
4681
|
-
}, N(n.quota.remaining) + " " + N(n.t("quotaRemaining")), 3)) : n.quota.remaining === 0 ? (
|
|
4687
|
+
}, N(n.quota.remaining) + " " + N(n.t("quotaRemaining")), 3)) : n.quota.remaining === 0 ? (w(), v("span", {
|
|
4682
4688
|
key: 1,
|
|
4683
4689
|
class: T(["text-xs text-red-600 dark:text-red-400", (d = n.ui) == null ? void 0 : d.quotaDisplay])
|
|
4684
4690
|
}, N(n.t("noQuota")), 3)) : B("", !0)
|
|
@@ -4688,7 +4694,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4688
4694
|
p("div", {
|
|
4689
4695
|
class: T(["flex items-center gap-1", (o = n.ui) == null ? void 0 : o.headerActions])
|
|
4690
4696
|
}, [
|
|
4691
|
-
n.showCloseButton ? (
|
|
4697
|
+
n.showCloseButton ? (w(), v("button", {
|
|
4692
4698
|
key: 0,
|
|
4693
4699
|
type: "button",
|
|
4694
4700
|
class: T(["p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors", (i = n.ui) == null ? void 0 : i.headerActionButton]),
|
|
@@ -4708,8 +4714,8 @@ const Do = /* @__PURE__ */ he({
|
|
|
4708
4714
|
d: "M6 18L18 6M6 6l12 12"
|
|
4709
4715
|
})
|
|
4710
4716
|
], -1)
|
|
4711
|
-
])], 10,
|
|
4712
|
-
n.showMinimizeButton ? (
|
|
4717
|
+
])], 10, Wi)) : B("", !0),
|
|
4718
|
+
n.showMinimizeButton ? (w(), v("button", {
|
|
4713
4719
|
key: 1,
|
|
4714
4720
|
type: "button",
|
|
4715
4721
|
class: T(["p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors", (a = n.ui) == null ? void 0 : a.headerActionButton]),
|
|
@@ -4729,36 +4735,36 @@ const Do = /* @__PURE__ */ he({
|
|
|
4729
4735
|
d: "M5 12h14"
|
|
4730
4736
|
})
|
|
4731
4737
|
], -1)
|
|
4732
|
-
])], 10,
|
|
4733
|
-
n.showFullscreenToggle ? (
|
|
4738
|
+
])], 10, Ki)) : B("", !0),
|
|
4739
|
+
n.showFullscreenToggle ? (w(), v("button", {
|
|
4734
4740
|
key: 2,
|
|
4735
4741
|
type: "button",
|
|
4736
4742
|
class: T(["p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors", (c = n.ui) == null ? void 0 : c.headerActionButton]),
|
|
4737
4743
|
title: n.isFullscreen ? n.t("exitFullscreen") : n.t("fullscreen"),
|
|
4738
4744
|
onClick: t[3] || (t[3] = (u) => e.$emit("toggle-fullscreen"))
|
|
4739
4745
|
}, [
|
|
4740
|
-
n.isFullscreen ? (
|
|
4746
|
+
n.isFullscreen ? (w(), v("svg", Qi, [...t[9] || (t[9] = [
|
|
4741
4747
|
p("path", {
|
|
4742
4748
|
"stroke-linecap": "round",
|
|
4743
4749
|
"stroke-linejoin": "round",
|
|
4744
4750
|
d: "M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25"
|
|
4745
4751
|
}, null, -1)
|
|
4746
|
-
])])) : (
|
|
4752
|
+
])])) : (w(), v("svg", Gi, [...t[8] || (t[8] = [
|
|
4747
4753
|
p("path", {
|
|
4748
4754
|
"stroke-linecap": "round",
|
|
4749
4755
|
"stroke-linejoin": "round",
|
|
4750
4756
|
d: "M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"
|
|
4751
4757
|
}, null, -1)
|
|
4752
4758
|
])]))
|
|
4753
|
-
], 10,
|
|
4759
|
+
], 10, Vi)) : B("", !0)
|
|
4754
4760
|
], 2)
|
|
4755
4761
|
], 2);
|
|
4756
4762
|
};
|
|
4757
4763
|
}
|
|
4758
|
-
}),
|
|
4764
|
+
}), Yi = { class: "max-w-3xl mx-auto px-4 space-y-6" }, Xi = { class: "flex justify-center" }, Ji = { class: "inline-flex items-center gap-2 rounded-full bg-primary/10 px-4 py-2 text-sm font-medium text-primary" }, ea = {
|
|
4759
4765
|
key: 0,
|
|
4760
4766
|
class: "flex justify-center"
|
|
4761
|
-
},
|
|
4767
|
+
}, ta = ["title"], na = /* @__PURE__ */ he({
|
|
4762
4768
|
__name: "DrawerMessageList",
|
|
4763
4769
|
props: {
|
|
4764
4770
|
messages: {},
|
|
@@ -4772,9 +4778,9 @@ const Do = /* @__PURE__ */ he({
|
|
|
4772
4778
|
setup(n) {
|
|
4773
4779
|
return (e, t) => {
|
|
4774
4780
|
var s, r, o;
|
|
4775
|
-
return
|
|
4776
|
-
p("div",
|
|
4777
|
-
p("div",
|
|
4781
|
+
return w(), v("div", Yi, [
|
|
4782
|
+
p("div", Xi, [
|
|
4783
|
+
p("div", Ji, [
|
|
4778
4784
|
t[3] || (t[3] = p("svg", {
|
|
4779
4785
|
class: "w-4 h-4",
|
|
4780
4786
|
fill: "none",
|
|
@@ -4791,20 +4797,20 @@ const Do = /* @__PURE__ */ he({
|
|
|
4791
4797
|
p("span", null, N(n.t("title") || D(le)("aiName")), 1)
|
|
4792
4798
|
])
|
|
4793
4799
|
]),
|
|
4794
|
-
(
|
|
4800
|
+
(w(!0), v(ke, null, Ne(n.messages, (i, a) => me(e.$slots, "message", {
|
|
4795
4801
|
key: i.id || a,
|
|
4796
4802
|
message: i,
|
|
4797
4803
|
isUser: i.role === "user",
|
|
4798
4804
|
isLoading: i.loading,
|
|
4799
4805
|
isStreaming: i.streaming
|
|
4800
4806
|
}, () => [
|
|
4801
|
-
ge(
|
|
4807
|
+
ge(ii, {
|
|
4802
4808
|
message: i,
|
|
4803
4809
|
"loading-text": n.loadingMessage,
|
|
4804
4810
|
onCopy: t[0] || (t[0] = (c) => e.$emit("copy", c))
|
|
4805
4811
|
}, null, 8, ["message", "loading-text"])
|
|
4806
4812
|
])), 128)),
|
|
4807
|
-
n.quota.remaining === 0 ? (
|
|
4813
|
+
n.quota.remaining === 0 ? (w(), v("div", ea, [
|
|
4808
4814
|
p("button", {
|
|
4809
4815
|
type: "button",
|
|
4810
4816
|
class: "inline-flex items-center gap-2 px-6 py-3 bg-primary-500 text-white rounded-lg hover:bg-primary-600 transition-all shadow-sm",
|
|
@@ -4826,7 +4832,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4826
4832
|
p("span", null, N(D(le)("contactSupport")), 1)
|
|
4827
4833
|
])
|
|
4828
4834
|
])) : B("", !0),
|
|
4829
|
-
n.error.message ? (
|
|
4835
|
+
n.error.message ? (w(), v("div", {
|
|
4830
4836
|
key: 1,
|
|
4831
4837
|
class: T(["flex items-center gap-2 text-sm text-red-600 dark:text-red-400 px-2 py-1 pb-6", (s = n.ui) == null ? void 0 : s.errorContainer])
|
|
4832
4838
|
}, [
|
|
@@ -4852,23 +4858,23 @@ const Do = /* @__PURE__ */ he({
|
|
|
4852
4858
|
d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
|
|
4853
4859
|
})
|
|
4854
4860
|
], -1)
|
|
4855
|
-
])], 10,
|
|
4861
|
+
])], 10, ta)
|
|
4856
4862
|
], 2)) : B("", !0)
|
|
4857
4863
|
]);
|
|
4858
4864
|
};
|
|
4859
4865
|
}
|
|
4860
|
-
}),
|
|
4866
|
+
}), sa = { class: "w-full max-w-md" }, ra = { class: "bg-gray-900 rounded-xl overflow-hidden" }, oa = { class: "flex items-center justify-between px-4 py-2 bg-gray-800/50 border-b border-gray-700" }, ia = /* @__PURE__ */ he({
|
|
4861
4867
|
__name: "SetupGuide",
|
|
4862
4868
|
props: {
|
|
4863
4869
|
copied: { type: Boolean }
|
|
4864
4870
|
},
|
|
4865
4871
|
emits: ["copy"],
|
|
4866
4872
|
setup(n) {
|
|
4867
|
-
return (e, t) => (
|
|
4873
|
+
return (e, t) => (w(), v(ke, null, [
|
|
4868
4874
|
t[4] || (t[4] = Nn('<div class="w-14 h-14 rounded-2xl bg-primary/10 flex items-center justify-center mb-5"><svg class="w-7 h-7 text-primary" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09Z"></path></svg></div><h2 class="text-lg font-semibold text-gray-900 dark:text-white mb-1"> Almost there! </h2><p class="text-sm text-gray-500 dark:text-gray-400 mb-6 max-w-sm text-center"> Configure the plugin in your app entry file to start using AI. </p>', 3)),
|
|
4869
|
-
p("div",
|
|
4870
|
-
p("div",
|
|
4871
|
-
p("div",
|
|
4875
|
+
p("div", sa, [
|
|
4876
|
+
p("div", ra, [
|
|
4877
|
+
p("div", oa, [
|
|
4872
4878
|
t[1] || (t[1] = p("span", { class: "text-xs text-gray-400" }, "main.ts", -1)),
|
|
4873
4879
|
p("button", {
|
|
4874
4880
|
type: "button",
|
|
@@ -4897,16 +4903,16 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
|
|
|
4897
4903
|
])
|
|
4898
4904
|
], 64));
|
|
4899
4905
|
}
|
|
4900
|
-
}),
|
|
4906
|
+
}), aa = {
|
|
4901
4907
|
key: 0,
|
|
4902
4908
|
class: "absolute inset-0 bg-black/50 flex items-center justify-center z-10"
|
|
4903
|
-
},
|
|
4909
|
+
}, la = {
|
|
4904
4910
|
key: 0,
|
|
4905
4911
|
class: "flex items-center gap-3 mb-4"
|
|
4906
|
-
},
|
|
4912
|
+
}, ua = { class: "text-lg font-semibold text-gray-900 dark:text-white" }, ca = {
|
|
4907
4913
|
key: 1,
|
|
4908
4914
|
class: "text-lg font-semibold text-gray-900 dark:text-white mb-2"
|
|
4909
|
-
},
|
|
4915
|
+
}, da = { class: "text-sm text-gray-600 dark:text-gray-400 mb-6" }, pa = { class: "flex justify-end gap-3" }, ss = /* @__PURE__ */ he({
|
|
4910
4916
|
__name: "ConfirmDialog",
|
|
4911
4917
|
props: {
|
|
4912
4918
|
show: { type: Boolean },
|
|
@@ -4928,7 +4934,7 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
|
|
|
4928
4934
|
const r = e.confirmVariant === "danger" ? "bg-red-600 hover:bg-red-700" : "bg-primary-500 hover:bg-primary-600", o = e.confirmVariant === "danger" ? (i = e.ui) == null ? void 0 : i.closeConfirmButton : (a = e.ui) == null ? void 0 : a.historyLimitButton;
|
|
4929
4935
|
return [r, o];
|
|
4930
4936
|
});
|
|
4931
|
-
return (r, o) => (
|
|
4937
|
+
return (r, o) => (w(), Me(mt, {
|
|
4932
4938
|
"enter-active-class": "transition ease-out duration-200",
|
|
4933
4939
|
"enter-from-class": "opacity-0",
|
|
4934
4940
|
"enter-to-class": "opacity-100",
|
|
@@ -4939,11 +4945,11 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
|
|
|
4939
4945
|
default: Ce(() => {
|
|
4940
4946
|
var i;
|
|
4941
4947
|
return [
|
|
4942
|
-
n.show ? (
|
|
4948
|
+
n.show ? (w(), v("div", aa, [
|
|
4943
4949
|
p("div", {
|
|
4944
4950
|
class: T(["bg-white dark:bg-gray-800 rounded-xl p-6 m-4 max-w-sm w-full shadow-xl", t.value])
|
|
4945
4951
|
}, [
|
|
4946
|
-
n.icon === "warning" ? (
|
|
4952
|
+
n.icon === "warning" ? (w(), v("div", la, [
|
|
4947
4953
|
o[2] || (o[2] = p("div", { class: "flex-shrink-0 w-10 h-10 rounded-full bg-amber-100 dark:bg-amber-900/30 flex items-center justify-center" }, [
|
|
4948
4954
|
p("svg", {
|
|
4949
4955
|
class: "w-5 h-5 text-amber-600 dark:text-amber-400",
|
|
@@ -4959,10 +4965,10 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
|
|
|
4959
4965
|
})
|
|
4960
4966
|
])
|
|
4961
4967
|
], -1)),
|
|
4962
|
-
p("h3",
|
|
4963
|
-
])) : (
|
|
4964
|
-
p("p",
|
|
4965
|
-
p("div",
|
|
4968
|
+
p("h3", ua, N(n.title), 1)
|
|
4969
|
+
])) : (w(), v("h3", ca, N(n.title), 1)),
|
|
4970
|
+
p("p", da, N(n.message), 1),
|
|
4971
|
+
p("div", pa, [
|
|
4966
4972
|
p("button", {
|
|
4967
4973
|
type: "button",
|
|
4968
4974
|
class: T(["px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors", (i = n.ui) == null ? void 0 : i.cancelButton]),
|
|
@@ -4981,13 +4987,13 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
|
|
|
4981
4987
|
_: 1
|
|
4982
4988
|
}));
|
|
4983
4989
|
}
|
|
4984
|
-
}),
|
|
4990
|
+
}), ha = {
|
|
4985
4991
|
key: 0,
|
|
4986
4992
|
class: "flex-1 flex flex-col items-center justify-center p-6 overflow-y-auto"
|
|
4987
|
-
},
|
|
4993
|
+
}, fa = {
|
|
4988
4994
|
key: 0,
|
|
4989
4995
|
class: "flex-1 flex flex-col overflow-y-auto"
|
|
4990
|
-
},
|
|
4996
|
+
}, ga = /* @__PURE__ */ he({
|
|
4991
4997
|
__name: "AiChatDrawer",
|
|
4992
4998
|
props: {
|
|
4993
4999
|
modelValue: { type: Boolean },
|
|
@@ -5028,7 +5034,7 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
|
|
|
5028
5034
|
}
|
|
5029
5035
|
return le(_, K);
|
|
5030
5036
|
}
|
|
5031
|
-
const i = We(), a = q(""), c = q(null), u = q(!1), d = q(!1), g = q(!1), { loadingMessage:
|
|
5037
|
+
const i = We(), a = q(""), c = q(null), u = q(!1), d = q(!1), g = q(!1), { loadingMessage: k, startLoadingText: y, resetLoadingText: h } = Mo(
|
|
5032
5038
|
() => i.sending,
|
|
5033
5039
|
() => t.loadingText
|
|
5034
5040
|
), {
|
|
@@ -5037,10 +5043,10 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
|
|
|
5037
5043
|
historyLimitDialogTitle: f,
|
|
5038
5044
|
historyLimitDialogMessage: S,
|
|
5039
5045
|
dismissHistoryLimitWarning: C,
|
|
5040
|
-
handleHistoryLimitAction:
|
|
5046
|
+
handleHistoryLimitAction: b,
|
|
5041
5047
|
checkHistoryLimit: z,
|
|
5042
5048
|
setPendingMessage: F
|
|
5043
|
-
} =
|
|
5049
|
+
} = Ro({
|
|
5044
5050
|
getHistoryLength: () => i.chatHistory.length,
|
|
5045
5051
|
getStoreLimit: () => i.chatHistoryLimit,
|
|
5046
5052
|
getConfig: () => t.historyLimit,
|
|
@@ -5091,7 +5097,7 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
|
|
|
5091
5097
|
function He() {
|
|
5092
5098
|
t.confirmClose && !V.value && i.chatHistory.length > 0 ? g.value = !0 : (r.value = !1, s("close"));
|
|
5093
5099
|
}
|
|
5094
|
-
function
|
|
5100
|
+
function bt() {
|
|
5095
5101
|
g.value = !1, i.clearChatHistory(), r.value = !1, s("close");
|
|
5096
5102
|
}
|
|
5097
5103
|
function Bt() {
|
|
@@ -5127,7 +5133,7 @@ app.use(RestifyAiPlugin, {
|
|
|
5127
5133
|
}, 2e3);
|
|
5128
5134
|
}
|
|
5129
5135
|
async function Fe() {
|
|
5130
|
-
const _ = await
|
|
5136
|
+
const _ = await b();
|
|
5131
5137
|
_ && (await Oe(), await Ve(_.message, _.attachments, _.mentions, _.isSupportRequest));
|
|
5132
5138
|
}
|
|
5133
5139
|
async function Ve(_, K, G, te) {
|
|
@@ -5164,12 +5170,12 @@ app.use(RestifyAiPlugin, {
|
|
|
5164
5170
|
window.addEventListener("keydown", Ge);
|
|
5165
5171
|
}), yt(() => {
|
|
5166
5172
|
window.removeEventListener("keydown", Ge);
|
|
5167
|
-
}), (_, K) => (
|
|
5173
|
+
}), (_, K) => (w(), Me(Ws, { to: "body" }, [
|
|
5168
5174
|
ge(mt, { name: "rai-fade" }, {
|
|
5169
5175
|
default: Ce(() => {
|
|
5170
5176
|
var G;
|
|
5171
5177
|
return [
|
|
5172
|
-
r.value && n.showBackdrop ? (
|
|
5178
|
+
r.value && n.showBackdrop ? (w(), v("div", {
|
|
5173
5179
|
key: 0,
|
|
5174
5180
|
class: T(["fixed inset-0 bg-black/30 z-40", (G = n.ui) == null ? void 0 : G.backdrop]),
|
|
5175
5181
|
onClick: K[0] || (K[0] = (te) => n.closeOnBackdropClick && Re())
|
|
@@ -5184,7 +5190,7 @@ app.use(RestifyAiPlugin, {
|
|
|
5184
5190
|
default: Ce(() => {
|
|
5185
5191
|
var G, te, X;
|
|
5186
5192
|
return [
|
|
5187
|
-
r.value ? (
|
|
5193
|
+
r.value ? (w(), v("aside", {
|
|
5188
5194
|
key: 0,
|
|
5189
5195
|
class: T(["fixed bottom-0 z-50 flex-shrink-0 border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-2xl will-change-transform", [
|
|
5190
5196
|
n.position === "left" ? "left-0 border-r" : "right-0 border-l",
|
|
@@ -5196,7 +5202,7 @@ app.use(RestifyAiPlugin, {
|
|
|
5196
5202
|
class: T(["h-full flex flex-col relative bg-white dark:bg-gray-900", (te = n.ui) == null ? void 0 : te.panel])
|
|
5197
5203
|
}, [
|
|
5198
5204
|
me(_.$slots, "header", Pn(zn(L.value)), () => [
|
|
5199
|
-
ge(
|
|
5205
|
+
ge(Zi, {
|
|
5200
5206
|
ui: n.ui,
|
|
5201
5207
|
"is-setup-mode": V.value,
|
|
5202
5208
|
"show-new-chat-button": n.showNewChatButton,
|
|
@@ -5224,30 +5230,30 @@ app.use(RestifyAiPlugin, {
|
|
|
5224
5230
|
p("div", {
|
|
5225
5231
|
class: T(["h-full flex flex-col mx-auto w-full overflow-hidden", [{ "max-w-5xl": u.value }, (X = n.ui) == null ? void 0 : X.body]])
|
|
5226
5232
|
}, [
|
|
5227
|
-
V.value ? (
|
|
5233
|
+
V.value ? (w(), v("div", ha, [
|
|
5228
5234
|
me(_.$slots, "setup", {}, () => [
|
|
5229
|
-
ge(
|
|
5235
|
+
ge(ia, {
|
|
5230
5236
|
copied: d.value,
|
|
5231
5237
|
onCopy: Z
|
|
5232
5238
|
}, null, 8, ["copied"])
|
|
5233
5239
|
], !0)
|
|
5234
|
-
])) : (
|
|
5235
|
-
D(i).chatHistory.length === 0 ? (
|
|
5240
|
+
])) : (w(), v(ke, { key: 1 }, [
|
|
5241
|
+
D(i).chatHistory.length === 0 ? (w(), v("div", fa, [
|
|
5236
5242
|
me(_.$slots, "empty-state", {
|
|
5237
5243
|
suggestions: P.value,
|
|
5238
5244
|
onClick: st
|
|
5239
5245
|
}, () => [
|
|
5240
|
-
ge(
|
|
5246
|
+
ge(Fi, { onItemClick: st })
|
|
5241
5247
|
], !0)
|
|
5242
|
-
])) : (
|
|
5248
|
+
])) : (w(), v("div", {
|
|
5243
5249
|
key: 1,
|
|
5244
5250
|
ref_key: "chatContainer",
|
|
5245
5251
|
ref: c,
|
|
5246
5252
|
class: "flex-1 overflow-y-auto py-6 pb-24"
|
|
5247
5253
|
}, [
|
|
5248
|
-
ge(
|
|
5254
|
+
ge(na, {
|
|
5249
5255
|
messages: D(i).chatHistory,
|
|
5250
|
-
"loading-message": D(
|
|
5256
|
+
"loading-message": D(k),
|
|
5251
5257
|
quota: D(i).quota,
|
|
5252
5258
|
error: D(i).error,
|
|
5253
5259
|
ui: n.ui,
|
|
@@ -5274,7 +5280,7 @@ app.use(RestifyAiPlugin, {
|
|
|
5274
5280
|
me(_.$slots, "input", Pn(zn(ne.value)), () => {
|
|
5275
5281
|
var J, ue;
|
|
5276
5282
|
return [
|
|
5277
|
-
ge(
|
|
5283
|
+
ge(zi, {
|
|
5278
5284
|
modelValue: a.value,
|
|
5279
5285
|
"onUpdate:modelValue": K[1] || (K[1] = (Se) => a.value = Se),
|
|
5280
5286
|
sending: D(i).sending,
|
|
@@ -5307,7 +5313,7 @@ app.use(RestifyAiPlugin, {
|
|
|
5307
5313
|
"cancel-text": o("cancel"),
|
|
5308
5314
|
ui: n.ui,
|
|
5309
5315
|
"confirm-variant": "danger",
|
|
5310
|
-
onConfirm:
|
|
5316
|
+
onConfirm: bt,
|
|
5311
5317
|
onCancel: K[2] || (K[2] = (J) => g.value = !1)
|
|
5312
5318
|
}, null, 8, ["show", "title", "message", "confirm-text", "cancel-text", "ui"]),
|
|
5313
5319
|
ge(ss, {
|
|
@@ -5329,7 +5335,7 @@ app.use(RestifyAiPlugin, {
|
|
|
5329
5335
|
}, 8, ["name"])
|
|
5330
5336
|
]));
|
|
5331
5337
|
}
|
|
5332
|
-
}),
|
|
5338
|
+
}), Ea = /* @__PURE__ */ Rs(ga, [["__scopeId", "data-v-e286ec63"]]), Ma = {
|
|
5333
5339
|
install(n, e) {
|
|
5334
5340
|
if (!e.endpoints || !e.getAuthToken) {
|
|
5335
5341
|
console.warn("[@doderasoftware/restify-ai] Plugin requires endpoints and getAuthToken options.");
|
|
@@ -5399,36 +5405,36 @@ app.use(RestifyAiPlugin, {
|
|
|
5399
5405
|
}
|
|
5400
5406
|
};
|
|
5401
5407
|
export {
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
+
_o as AiAvatar,
|
|
5409
|
+
Ea as AiChatDrawer,
|
|
5410
|
+
Fi as AiEmptyState,
|
|
5411
|
+
zi as ChatInput,
|
|
5412
|
+
ii as ChatMessage,
|
|
5413
|
+
Ho as ChatMessageActions,
|
|
5408
5414
|
nt as ChatRoles,
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5415
|
+
No as MentionList,
|
|
5416
|
+
Ma as RestifyAiPlugin,
|
|
5417
|
+
Ca as UserAvatar,
|
|
5418
|
+
Ma as default,
|
|
5413
5419
|
rs as defaultLabels,
|
|
5414
|
-
|
|
5420
|
+
mr as formatMentionsForApi,
|
|
5415
5421
|
tt as getConfigValue,
|
|
5416
5422
|
le as getLabel,
|
|
5417
5423
|
ee as getRestifyAiConfig,
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5424
|
+
wa as getRestifyAiConfigOrThrow,
|
|
5425
|
+
To as getSuggestionsForPath,
|
|
5426
|
+
yr as groupMentionsByType,
|
|
5421
5427
|
os as isConfigured,
|
|
5422
|
-
|
|
5428
|
+
Ta as registerSuggestionProvider,
|
|
5423
5429
|
Gs as setRestifyAiConfig,
|
|
5424
5430
|
Cs as useAiContext,
|
|
5425
|
-
|
|
5431
|
+
Aa as useAiDrawerShortcut,
|
|
5426
5432
|
Ms as useAiSuggestions,
|
|
5427
|
-
|
|
5433
|
+
va as useChatErrorHandling,
|
|
5428
5434
|
ko as useChatMarkdown,
|
|
5429
5435
|
ba as useChatScroll,
|
|
5430
|
-
|
|
5436
|
+
Eo as useKeyboardShortcut,
|
|
5431
5437
|
ka as useMentionParsing,
|
|
5432
|
-
|
|
5438
|
+
Sa as usePageAiContext,
|
|
5433
5439
|
We as useRestifyAiStore
|
|
5434
5440
|
};
|