@bymos/agentkit-sdk 0.8.0 → 0.9.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/README.md +4 -4
- package/agentkit-widget.iife.js +238 -96
- package/agentkit-widget.js +239 -97
- package/index.cjs +238 -96
- package/index.d.ts +50 -12
- package/index.js +1004 -833
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRoot as e } from "preact/compat/client";
|
|
2
2
|
import { createElement as t, useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "preact/compat";
|
|
3
3
|
import { Fragment as s, jsx as c, jsxs as l } from "preact/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
5
5
|
var u;
|
|
6
6
|
(function(e) {
|
|
7
7
|
e.assertEqual = (e) => {};
|
|
@@ -148,8 +148,7 @@ var f = u.arrayToEnum([
|
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
150
|
h.create = (e) => new h(e);
|
|
151
|
-
|
|
152
|
-
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
151
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
153
152
|
var g = (e, t) => {
|
|
154
153
|
let n;
|
|
155
154
|
switch (e.code) {
|
|
@@ -208,8 +207,7 @@ var g = (e, t) => {
|
|
|
208
207
|
function v() {
|
|
209
208
|
return _;
|
|
210
209
|
}
|
|
211
|
-
|
|
212
|
-
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
210
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
213
211
|
var y = (e) => {
|
|
214
212
|
let { data: t, path: n, errorMaps: r, issueData: i } = e, a = [...n, ...i.path || []], o = {
|
|
215
213
|
...i,
|
|
@@ -299,8 +297,7 @@ var x = class e {
|
|
|
299
297
|
(function(e) {
|
|
300
298
|
e.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, e.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
301
299
|
})(k ||= {});
|
|
302
|
-
|
|
303
|
-
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
300
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
304
301
|
var A = class {
|
|
305
302
|
constructor(e, t, n, r) {
|
|
306
303
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
|
|
@@ -470,9 +467,9 @@ var M = class {
|
|
|
470
467
|
return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof t == "function" ? t(n, r) : t), !1));
|
|
471
468
|
}
|
|
472
469
|
_refinement(e) {
|
|
473
|
-
return new
|
|
470
|
+
return new L({
|
|
474
471
|
schema: this,
|
|
475
|
-
typeName:
|
|
472
|
+
typeName: z.ZodEffects,
|
|
476
473
|
effect: {
|
|
477
474
|
type: "refinement",
|
|
478
475
|
refinement: e
|
|
@@ -490,31 +487,31 @@ var M = class {
|
|
|
490
487
|
};
|
|
491
488
|
}
|
|
492
489
|
optional() {
|
|
493
|
-
return
|
|
490
|
+
return R.create(this, this._def);
|
|
494
491
|
}
|
|
495
492
|
nullable() {
|
|
496
|
-
return
|
|
493
|
+
return $e.create(this, this._def);
|
|
497
494
|
}
|
|
498
495
|
nullish() {
|
|
499
496
|
return this.nullable().optional();
|
|
500
497
|
}
|
|
501
498
|
array() {
|
|
502
|
-
return
|
|
499
|
+
return Ie.create(this);
|
|
503
500
|
}
|
|
504
501
|
promise() {
|
|
505
|
-
return
|
|
502
|
+
return Qe.create(this, this._def);
|
|
506
503
|
}
|
|
507
504
|
or(e) {
|
|
508
|
-
return
|
|
505
|
+
return Re.create([this, e], this._def);
|
|
509
506
|
}
|
|
510
507
|
and(e) {
|
|
511
|
-
return
|
|
508
|
+
return Ve.create(this, e, this._def);
|
|
512
509
|
}
|
|
513
510
|
transform(e) {
|
|
514
|
-
return new
|
|
511
|
+
return new L({
|
|
515
512
|
...j(this._def),
|
|
516
513
|
schema: this,
|
|
517
|
-
typeName:
|
|
514
|
+
typeName: z.ZodEffects,
|
|
518
515
|
effect: {
|
|
519
516
|
type: "transform",
|
|
520
517
|
transform: e
|
|
@@ -523,27 +520,27 @@ var M = class {
|
|
|
523
520
|
}
|
|
524
521
|
default(e) {
|
|
525
522
|
let t = typeof e == "function" ? e : () => e;
|
|
526
|
-
return new
|
|
523
|
+
return new et({
|
|
527
524
|
...j(this._def),
|
|
528
525
|
innerType: this,
|
|
529
526
|
defaultValue: t,
|
|
530
|
-
typeName:
|
|
527
|
+
typeName: z.ZodDefault
|
|
531
528
|
});
|
|
532
529
|
}
|
|
533
530
|
brand() {
|
|
534
|
-
return new
|
|
535
|
-
typeName:
|
|
531
|
+
return new rt({
|
|
532
|
+
typeName: z.ZodBranded,
|
|
536
533
|
type: this,
|
|
537
534
|
...j(this._def)
|
|
538
535
|
});
|
|
539
536
|
}
|
|
540
537
|
catch(e) {
|
|
541
538
|
let t = typeof e == "function" ? e : () => e;
|
|
542
|
-
return new
|
|
539
|
+
return new tt({
|
|
543
540
|
...j(this._def),
|
|
544
541
|
innerType: this,
|
|
545
542
|
catchValue: t,
|
|
546
|
-
typeName:
|
|
543
|
+
typeName: z.ZodCatch
|
|
547
544
|
});
|
|
548
545
|
}
|
|
549
546
|
describe(e) {
|
|
@@ -554,10 +551,10 @@ var M = class {
|
|
|
554
551
|
});
|
|
555
552
|
}
|
|
556
553
|
pipe(e) {
|
|
557
|
-
return
|
|
554
|
+
return it.create(this, e);
|
|
558
555
|
}
|
|
559
556
|
readonly() {
|
|
560
|
-
return
|
|
557
|
+
return at.create(this);
|
|
561
558
|
}
|
|
562
559
|
isOptional() {
|
|
563
560
|
return this.safeParse(void 0).success;
|
|
@@ -565,25 +562,25 @@ var M = class {
|
|
|
565
562
|
isNullable() {
|
|
566
563
|
return this.safeParse(null).success;
|
|
567
564
|
}
|
|
568
|
-
}, te = /^c[^\s-]{8,}$/i, ne = /^[0-9a-z]+$/,
|
|
569
|
-
function
|
|
565
|
+
}, te = /^c[^\s-]{8,}$/i, ne = /^[0-9a-z]+$/, N = /^[0-9A-HJKMNP-TV-Z]{26}$/i, re = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, ie = /^[a-z0-9_-]{21}$/i, ae = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, oe = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, se = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ce = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", le, ue = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, de = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, fe = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, pe = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, me = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, he = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, ge = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", _e = RegExp(`^${ge}$`);
|
|
566
|
+
function ve(e) {
|
|
570
567
|
let t = "[0-5]\\d";
|
|
571
568
|
e.precision ? t = `${t}\\.\\d{${e.precision}}` : e.precision ?? (t = `${t}(\\.\\d+)?`);
|
|
572
569
|
let n = e.precision ? "+" : "?";
|
|
573
570
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`;
|
|
574
571
|
}
|
|
575
|
-
function
|
|
576
|
-
return RegExp(`^${
|
|
572
|
+
function ye(e) {
|
|
573
|
+
return RegExp(`^${ve(e)}$`);
|
|
577
574
|
}
|
|
578
|
-
function
|
|
579
|
-
let t = `${
|
|
575
|
+
function be(e) {
|
|
576
|
+
let t = `${ge}T${ve(e)}`, n = [];
|
|
580
577
|
return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
|
|
581
578
|
}
|
|
582
|
-
function
|
|
583
|
-
return
|
|
579
|
+
function xe(e, t) {
|
|
580
|
+
return !((t !== "v4" && t || !ue.test(e)) && (t !== "v6" && t || !fe.test(e)));
|
|
584
581
|
}
|
|
585
|
-
function
|
|
586
|
-
if (!
|
|
582
|
+
function Se(e, t) {
|
|
583
|
+
if (!ae.test(e)) return !1;
|
|
587
584
|
try {
|
|
588
585
|
let [n] = e.split(".");
|
|
589
586
|
if (!n) return !1;
|
|
@@ -593,10 +590,10 @@ function Ce(e, t) {
|
|
|
593
590
|
return !1;
|
|
594
591
|
}
|
|
595
592
|
}
|
|
596
|
-
function
|
|
597
|
-
return
|
|
593
|
+
function Ce(e, t) {
|
|
594
|
+
return !((t !== "v4" && t || !de.test(e)) && (t !== "v6" && t || !pe.test(e)));
|
|
598
595
|
}
|
|
599
|
-
var
|
|
596
|
+
var we = class e extends M {
|
|
600
597
|
_parse(e) {
|
|
601
598
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
|
|
602
599
|
let t = this._getOrReturnCtx(e);
|
|
@@ -640,22 +637,22 @@ var Te = class e extends M {
|
|
|
640
637
|
exact: !0,
|
|
641
638
|
message: r.message
|
|
642
639
|
}), t.dirty());
|
|
643
|
-
} else if (r.kind === "email")
|
|
640
|
+
} else if (r.kind === "email") se.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
644
641
|
validation: "email",
|
|
645
642
|
code: m.invalid_string,
|
|
646
643
|
message: r.message
|
|
647
644
|
}), t.dirty());
|
|
648
|
-
else if (r.kind === "emoji")
|
|
645
|
+
else if (r.kind === "emoji") le ||= new RegExp(ce, "u"), le.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
649
646
|
validation: "emoji",
|
|
650
647
|
code: m.invalid_string,
|
|
651
648
|
message: r.message
|
|
652
649
|
}), t.dirty());
|
|
653
|
-
else if (r.kind === "uuid")
|
|
650
|
+
else if (r.kind === "uuid") re.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
654
651
|
validation: "uuid",
|
|
655
652
|
code: m.invalid_string,
|
|
656
653
|
message: r.message
|
|
657
654
|
}), t.dirty());
|
|
658
|
-
else if (r.kind === "nanoid")
|
|
655
|
+
else if (r.kind === "nanoid") ie.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
659
656
|
validation: "nanoid",
|
|
660
657
|
code: m.invalid_string,
|
|
661
658
|
message: r.message
|
|
@@ -670,7 +667,7 @@ var Te = class e extends M {
|
|
|
670
667
|
code: m.invalid_string,
|
|
671
668
|
message: r.message
|
|
672
669
|
}), t.dirty());
|
|
673
|
-
else if (r.kind === "ulid")
|
|
670
|
+
else if (r.kind === "ulid") N.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
674
671
|
validation: "ulid",
|
|
675
672
|
code: m.invalid_string,
|
|
676
673
|
message: r.message
|
|
@@ -703,39 +700,39 @@ var Te = class e extends M {
|
|
|
703
700
|
code: m.invalid_string,
|
|
704
701
|
validation: { endsWith: r.value },
|
|
705
702
|
message: r.message
|
|
706
|
-
}), t.dirty()) : r.kind === "datetime" ?
|
|
703
|
+
}), t.dirty()) : r.kind === "datetime" ? be(r).test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
707
704
|
code: m.invalid_string,
|
|
708
705
|
validation: "datetime",
|
|
709
706
|
message: r.message
|
|
710
|
-
}), t.dirty()) : r.kind === "date" ?
|
|
707
|
+
}), t.dirty()) : r.kind === "date" ? _e.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
711
708
|
code: m.invalid_string,
|
|
712
709
|
validation: "date",
|
|
713
710
|
message: r.message
|
|
714
|
-
}), t.dirty()) : r.kind === "time" ?
|
|
711
|
+
}), t.dirty()) : r.kind === "time" ? ye(r).test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
715
712
|
code: m.invalid_string,
|
|
716
713
|
validation: "time",
|
|
717
714
|
message: r.message
|
|
718
|
-
}), t.dirty()) : r.kind === "duration" ?
|
|
715
|
+
}), t.dirty()) : r.kind === "duration" ? oe.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
719
716
|
validation: "duration",
|
|
720
717
|
code: m.invalid_string,
|
|
721
718
|
message: r.message
|
|
722
|
-
}), t.dirty()) : r.kind === "ip" ?
|
|
719
|
+
}), t.dirty()) : r.kind === "ip" ? xe(e.data, r.version) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
723
720
|
validation: "ip",
|
|
724
721
|
code: m.invalid_string,
|
|
725
722
|
message: r.message
|
|
726
|
-
}), t.dirty()) : r.kind === "jwt" ?
|
|
723
|
+
}), t.dirty()) : r.kind === "jwt" ? Se(e.data, r.alg) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
727
724
|
validation: "jwt",
|
|
728
725
|
code: m.invalid_string,
|
|
729
726
|
message: r.message
|
|
730
|
-
}), t.dirty()) : r.kind === "cidr" ?
|
|
727
|
+
}), t.dirty()) : r.kind === "cidr" ? Ce(e.data, r.version) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
731
728
|
validation: "cidr",
|
|
732
729
|
code: m.invalid_string,
|
|
733
730
|
message: r.message
|
|
734
|
-
}), t.dirty()) : r.kind === "base64" ?
|
|
731
|
+
}), t.dirty()) : r.kind === "base64" ? me.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
735
732
|
validation: "base64",
|
|
736
733
|
code: m.invalid_string,
|
|
737
734
|
message: r.message
|
|
738
|
-
}), t.dirty()) : r.kind === "base64url" ?
|
|
735
|
+
}), t.dirty()) : r.kind === "base64url" ? he.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
739
736
|
validation: "base64url",
|
|
740
737
|
code: m.invalid_string,
|
|
741
738
|
message: r.message
|
|
@@ -1004,17 +1001,17 @@ var Te = class e extends M {
|
|
|
1004
1001
|
return e;
|
|
1005
1002
|
}
|
|
1006
1003
|
};
|
|
1007
|
-
|
|
1004
|
+
we.create = (e) => new we({
|
|
1008
1005
|
checks: [],
|
|
1009
|
-
typeName:
|
|
1006
|
+
typeName: z.ZodString,
|
|
1010
1007
|
coerce: e?.coerce ?? !1,
|
|
1011
1008
|
...j(e)
|
|
1012
1009
|
});
|
|
1013
|
-
function
|
|
1010
|
+
function Te(e, t) {
|
|
1014
1011
|
let n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, i = n > r ? n : r;
|
|
1015
1012
|
return Number.parseInt(e.toFixed(i).replace(".", "")) % Number.parseInt(t.toFixed(i).replace(".", "")) / 10 ** i;
|
|
1016
1013
|
}
|
|
1017
|
-
var
|
|
1014
|
+
var Ee = class e extends M {
|
|
1018
1015
|
constructor() {
|
|
1019
1016
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1020
1017
|
}
|
|
@@ -1047,7 +1044,7 @@ var De = class e extends M {
|
|
|
1047
1044
|
inclusive: r.inclusive,
|
|
1048
1045
|
exact: !1,
|
|
1049
1046
|
message: r.message
|
|
1050
|
-
}), n.dirty()) : r.kind === "multipleOf" ?
|
|
1047
|
+
}), n.dirty()) : r.kind === "multipleOf" ? Te(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), b(t, {
|
|
1051
1048
|
code: m.not_multiple_of,
|
|
1052
1049
|
multipleOf: r.value,
|
|
1053
1050
|
message: r.message
|
|
@@ -1173,13 +1170,13 @@ var De = class e extends M {
|
|
|
1173
1170
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1174
1171
|
}
|
|
1175
1172
|
};
|
|
1176
|
-
|
|
1173
|
+
Ee.create = (e) => new Ee({
|
|
1177
1174
|
checks: [],
|
|
1178
|
-
typeName:
|
|
1175
|
+
typeName: z.ZodNumber,
|
|
1179
1176
|
coerce: e?.coerce || !1,
|
|
1180
1177
|
...j(e)
|
|
1181
1178
|
});
|
|
1182
|
-
var
|
|
1179
|
+
var De = class e extends M {
|
|
1183
1180
|
constructor() {
|
|
1184
1181
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1185
1182
|
}
|
|
@@ -1300,13 +1297,13 @@ var Oe = class e extends M {
|
|
|
1300
1297
|
return e;
|
|
1301
1298
|
}
|
|
1302
1299
|
};
|
|
1303
|
-
|
|
1300
|
+
De.create = (e) => new De({
|
|
1304
1301
|
checks: [],
|
|
1305
|
-
typeName:
|
|
1302
|
+
typeName: z.ZodBigInt,
|
|
1306
1303
|
coerce: e?.coerce ?? !1,
|
|
1307
1304
|
...j(e)
|
|
1308
1305
|
});
|
|
1309
|
-
var
|
|
1306
|
+
var Oe = class extends M {
|
|
1310
1307
|
_parse(e) {
|
|
1311
1308
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
|
|
1312
1309
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1319,12 +1316,12 @@ var ke = class extends M {
|
|
|
1319
1316
|
return w(e.data);
|
|
1320
1317
|
}
|
|
1321
1318
|
};
|
|
1322
|
-
|
|
1323
|
-
typeName:
|
|
1319
|
+
Oe.create = (e) => new Oe({
|
|
1320
|
+
typeName: z.ZodBoolean,
|
|
1324
1321
|
coerce: e?.coerce || !1,
|
|
1325
1322
|
...j(e)
|
|
1326
1323
|
});
|
|
1327
|
-
var
|
|
1324
|
+
var ke = class e extends M {
|
|
1328
1325
|
_parse(e) {
|
|
1329
1326
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
|
|
1330
1327
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1387,13 +1384,13 @@ var Ae = class e extends M {
|
|
|
1387
1384
|
return e == null ? null : new Date(e);
|
|
1388
1385
|
}
|
|
1389
1386
|
};
|
|
1390
|
-
|
|
1387
|
+
ke.create = (e) => new ke({
|
|
1391
1388
|
checks: [],
|
|
1392
1389
|
coerce: e?.coerce || !1,
|
|
1393
|
-
typeName:
|
|
1390
|
+
typeName: z.ZodDate,
|
|
1394
1391
|
...j(e)
|
|
1395
1392
|
});
|
|
1396
|
-
var
|
|
1393
|
+
var Ae = class extends M {
|
|
1397
1394
|
_parse(e) {
|
|
1398
1395
|
if (this._getType(e) !== f.symbol) {
|
|
1399
1396
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1406,11 +1403,11 @@ var je = class extends M {
|
|
|
1406
1403
|
return w(e.data);
|
|
1407
1404
|
}
|
|
1408
1405
|
};
|
|
1409
|
-
|
|
1410
|
-
typeName:
|
|
1406
|
+
Ae.create = (e) => new Ae({
|
|
1407
|
+
typeName: z.ZodSymbol,
|
|
1411
1408
|
...j(e)
|
|
1412
1409
|
});
|
|
1413
|
-
var
|
|
1410
|
+
var je = class extends M {
|
|
1414
1411
|
_parse(e) {
|
|
1415
1412
|
if (this._getType(e) !== f.undefined) {
|
|
1416
1413
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1423,11 +1420,11 @@ var Me = class extends M {
|
|
|
1423
1420
|
return w(e.data);
|
|
1424
1421
|
}
|
|
1425
1422
|
};
|
|
1426
|
-
|
|
1427
|
-
typeName:
|
|
1423
|
+
je.create = (e) => new je({
|
|
1424
|
+
typeName: z.ZodUndefined,
|
|
1428
1425
|
...j(e)
|
|
1429
1426
|
});
|
|
1430
|
-
var
|
|
1427
|
+
var Me = class extends M {
|
|
1431
1428
|
_parse(e) {
|
|
1432
1429
|
if (this._getType(e) !== f.null) {
|
|
1433
1430
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1440,11 +1437,11 @@ var Ne = class extends M {
|
|
|
1440
1437
|
return w(e.data);
|
|
1441
1438
|
}
|
|
1442
1439
|
};
|
|
1443
|
-
|
|
1444
|
-
typeName:
|
|
1440
|
+
Me.create = (e) => new Me({
|
|
1441
|
+
typeName: z.ZodNull,
|
|
1445
1442
|
...j(e)
|
|
1446
1443
|
});
|
|
1447
|
-
var
|
|
1444
|
+
var Ne = class extends M {
|
|
1448
1445
|
constructor() {
|
|
1449
1446
|
super(...arguments), this._any = !0;
|
|
1450
1447
|
}
|
|
@@ -1452,11 +1449,11 @@ var Pe = class extends M {
|
|
|
1452
1449
|
return w(e.data);
|
|
1453
1450
|
}
|
|
1454
1451
|
};
|
|
1455
|
-
|
|
1456
|
-
typeName:
|
|
1452
|
+
Ne.create = (e) => new Ne({
|
|
1453
|
+
typeName: z.ZodAny,
|
|
1457
1454
|
...j(e)
|
|
1458
1455
|
});
|
|
1459
|
-
var
|
|
1456
|
+
var Pe = class extends M {
|
|
1460
1457
|
constructor() {
|
|
1461
1458
|
super(...arguments), this._unknown = !0;
|
|
1462
1459
|
}
|
|
@@ -1464,11 +1461,11 @@ var Fe = class extends M {
|
|
|
1464
1461
|
return w(e.data);
|
|
1465
1462
|
}
|
|
1466
1463
|
};
|
|
1467
|
-
|
|
1468
|
-
typeName:
|
|
1464
|
+
Pe.create = (e) => new Pe({
|
|
1465
|
+
typeName: z.ZodUnknown,
|
|
1469
1466
|
...j(e)
|
|
1470
1467
|
});
|
|
1471
|
-
var
|
|
1468
|
+
var P = class extends M {
|
|
1472
1469
|
_parse(e) {
|
|
1473
1470
|
let t = this._getOrReturnCtx(e);
|
|
1474
1471
|
return b(t, {
|
|
@@ -1478,11 +1475,11 @@ var N = class extends M {
|
|
|
1478
1475
|
}), S;
|
|
1479
1476
|
}
|
|
1480
1477
|
};
|
|
1481
|
-
|
|
1482
|
-
typeName:
|
|
1478
|
+
P.create = (e) => new P({
|
|
1479
|
+
typeName: z.ZodNever,
|
|
1483
1480
|
...j(e)
|
|
1484
1481
|
});
|
|
1485
|
-
var
|
|
1482
|
+
var Fe = class extends M {
|
|
1486
1483
|
_parse(e) {
|
|
1487
1484
|
if (this._getType(e) !== f.undefined) {
|
|
1488
1485
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1495,11 +1492,11 @@ var Ie = class extends M {
|
|
|
1495
1492
|
return w(e.data);
|
|
1496
1493
|
}
|
|
1497
1494
|
};
|
|
1498
|
-
|
|
1499
|
-
typeName:
|
|
1495
|
+
Fe.create = (e) => new Fe({
|
|
1496
|
+
typeName: z.ZodVoid,
|
|
1500
1497
|
...j(e)
|
|
1501
1498
|
});
|
|
1502
|
-
var
|
|
1499
|
+
var Ie = class e extends M {
|
|
1503
1500
|
_parse(e) {
|
|
1504
1501
|
let { ctx: t, status: n } = this._processInputParams(e), r = this._def;
|
|
1505
1502
|
if (t.parsedType !== f.array) return b(t, {
|
|
@@ -1571,35 +1568,32 @@ var Le = class e extends M {
|
|
|
1571
1568
|
return this.min(1, e);
|
|
1572
1569
|
}
|
|
1573
1570
|
};
|
|
1574
|
-
|
|
1571
|
+
Ie.create = (e, t) => new Ie({
|
|
1575
1572
|
type: e,
|
|
1576
1573
|
minLength: null,
|
|
1577
1574
|
maxLength: null,
|
|
1578
1575
|
exactLength: null,
|
|
1579
|
-
typeName:
|
|
1576
|
+
typeName: z.ZodArray,
|
|
1580
1577
|
...j(t)
|
|
1581
1578
|
});
|
|
1582
|
-
function
|
|
1583
|
-
if (e instanceof
|
|
1579
|
+
function Le(e) {
|
|
1580
|
+
if (e instanceof F) {
|
|
1584
1581
|
let t = {};
|
|
1585
1582
|
for (let n in e.shape) {
|
|
1586
1583
|
let r = e.shape[n];
|
|
1587
|
-
t[n] =
|
|
1584
|
+
t[n] = R.create(Le(r));
|
|
1588
1585
|
}
|
|
1589
|
-
return new
|
|
1586
|
+
return new F({
|
|
1590
1587
|
...e._def,
|
|
1591
1588
|
shape: () => t
|
|
1592
1589
|
});
|
|
1593
|
-
}
|
|
1590
|
+
}
|
|
1591
|
+
return e instanceof Ie ? new Ie({
|
|
1594
1592
|
...e._def,
|
|
1595
|
-
type:
|
|
1596
|
-
});
|
|
1597
|
-
else if (e instanceof L) return L.create(Re(e.unwrap()));
|
|
1598
|
-
else if (e instanceof et) return et.create(Re(e.unwrap()));
|
|
1599
|
-
else if (e instanceof Ue) return Ue.create(e.items.map((e) => Re(e)));
|
|
1600
|
-
else return e;
|
|
1593
|
+
type: Le(e.element)
|
|
1594
|
+
}) : e instanceof R ? R.create(Le(e.unwrap())) : e instanceof $e ? $e.create(Le(e.unwrap())) : e instanceof He ? He.create(e.items.map((e) => Le(e))) : e;
|
|
1601
1595
|
}
|
|
1602
|
-
var
|
|
1596
|
+
var F = class e extends M {
|
|
1603
1597
|
constructor() {
|
|
1604
1598
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1605
1599
|
}
|
|
@@ -1621,7 +1615,7 @@ var P = class e extends M {
|
|
|
1621
1615
|
}), S;
|
|
1622
1616
|
}
|
|
1623
1617
|
let { status: t, ctx: n } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), a = [];
|
|
1624
|
-
if (!(this._def.catchall instanceof
|
|
1618
|
+
if (!(this._def.catchall instanceof P && this._def.unknownKeys === "strip")) for (let e in n.data) i.includes(e) || a.push(e);
|
|
1625
1619
|
let o = [];
|
|
1626
1620
|
for (let e of i) {
|
|
1627
1621
|
let t = r[e], i = n.data[e];
|
|
@@ -1634,7 +1628,7 @@ var P = class e extends M {
|
|
|
1634
1628
|
alwaysSet: e in n.data
|
|
1635
1629
|
});
|
|
1636
1630
|
}
|
|
1637
|
-
if (this._def.catchall instanceof
|
|
1631
|
+
if (this._def.catchall instanceof P) {
|
|
1638
1632
|
let e = this._def.unknownKeys;
|
|
1639
1633
|
if (e === "passthrough") for (let e of a) o.push({
|
|
1640
1634
|
key: {
|
|
@@ -1720,7 +1714,7 @@ var P = class e extends M {
|
|
|
1720
1714
|
...this._def.shape(),
|
|
1721
1715
|
...t._def.shape()
|
|
1722
1716
|
}),
|
|
1723
|
-
typeName:
|
|
1717
|
+
typeName: z.ZodObject
|
|
1724
1718
|
});
|
|
1725
1719
|
}
|
|
1726
1720
|
setKey(e, t) {
|
|
@@ -1749,13 +1743,13 @@ var P = class e extends M {
|
|
|
1749
1743
|
});
|
|
1750
1744
|
}
|
|
1751
1745
|
deepPartial() {
|
|
1752
|
-
return
|
|
1746
|
+
return Le(this);
|
|
1753
1747
|
}
|
|
1754
1748
|
partial(t) {
|
|
1755
1749
|
let n = {};
|
|
1756
1750
|
for (let e of u.objectKeys(this.shape)) {
|
|
1757
1751
|
let r = this.shape[e];
|
|
1758
|
-
t && !t[e] ?
|
|
1752
|
+
n[e] = t && !t[e] ? r : r.optional();
|
|
1759
1753
|
}
|
|
1760
1754
|
return new e({
|
|
1761
1755
|
...this._def,
|
|
@@ -1767,7 +1761,7 @@ var P = class e extends M {
|
|
|
1767
1761
|
for (let e of u.objectKeys(this.shape)) if (t && !t[e]) n[e] = this.shape[e];
|
|
1768
1762
|
else {
|
|
1769
1763
|
let t = this.shape[e];
|
|
1770
|
-
for (; t instanceof
|
|
1764
|
+
for (; t instanceof R;) t = t._def.innerType;
|
|
1771
1765
|
n[e] = t;
|
|
1772
1766
|
}
|
|
1773
1767
|
return new e({
|
|
@@ -1776,29 +1770,29 @@ var P = class e extends M {
|
|
|
1776
1770
|
});
|
|
1777
1771
|
}
|
|
1778
1772
|
keyof() {
|
|
1779
|
-
return
|
|
1773
|
+
return Ye(u.objectKeys(this.shape));
|
|
1780
1774
|
}
|
|
1781
1775
|
};
|
|
1782
|
-
|
|
1776
|
+
F.create = (e, t) => new F({
|
|
1783
1777
|
shape: () => e,
|
|
1784
1778
|
unknownKeys: "strip",
|
|
1785
|
-
catchall:
|
|
1786
|
-
typeName:
|
|
1779
|
+
catchall: P.create(),
|
|
1780
|
+
typeName: z.ZodObject,
|
|
1787
1781
|
...j(t)
|
|
1788
|
-
}),
|
|
1782
|
+
}), F.strictCreate = (e, t) => new F({
|
|
1789
1783
|
shape: () => e,
|
|
1790
1784
|
unknownKeys: "strict",
|
|
1791
|
-
catchall:
|
|
1792
|
-
typeName:
|
|
1785
|
+
catchall: P.create(),
|
|
1786
|
+
typeName: z.ZodObject,
|
|
1793
1787
|
...j(t)
|
|
1794
|
-
}),
|
|
1788
|
+
}), F.lazycreate = (e, t) => new F({
|
|
1795
1789
|
shape: e,
|
|
1796
1790
|
unknownKeys: "strip",
|
|
1797
|
-
catchall:
|
|
1798
|
-
typeName:
|
|
1791
|
+
catchall: P.create(),
|
|
1792
|
+
typeName: z.ZodObject,
|
|
1799
1793
|
...j(t)
|
|
1800
1794
|
});
|
|
1801
|
-
var
|
|
1795
|
+
var Re = class extends M {
|
|
1802
1796
|
_parse(e) {
|
|
1803
1797
|
let { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
1804
1798
|
function r(e) {
|
|
@@ -1861,12 +1855,12 @@ var ze = class extends M {
|
|
|
1861
1855
|
return this._def.options;
|
|
1862
1856
|
}
|
|
1863
1857
|
};
|
|
1864
|
-
|
|
1858
|
+
Re.create = (e, t) => new Re({
|
|
1865
1859
|
options: e,
|
|
1866
|
-
typeName:
|
|
1860
|
+
typeName: z.ZodUnion,
|
|
1867
1861
|
...j(t)
|
|
1868
1862
|
});
|
|
1869
|
-
var
|
|
1863
|
+
var I = (e) => e instanceof qe ? I(e.schema) : e instanceof L ? I(e.innerType()) : e instanceof Je ? [e.value] : e instanceof Xe ? e.options : e instanceof Ze ? u.objectValues(e.enum) : e instanceof et ? I(e._def.innerType) : e instanceof je ? [void 0] : e instanceof Me ? [null] : e instanceof R ? [void 0, ...I(e.unwrap())] : e instanceof $e ? [null, ...I(e.unwrap())] : e instanceof rt || e instanceof at ? I(e.unwrap()) : e instanceof tt ? I(e._def.innerType) : [], ze = class e extends M {
|
|
1870
1864
|
_parse(e) {
|
|
1871
1865
|
let { ctx: t } = this._processInputParams(e);
|
|
1872
1866
|
if (t.parsedType !== f.object) return b(t, {
|
|
@@ -1901,7 +1895,7 @@ var F = (e) => e instanceof Je ? F(e.schema) : e instanceof I ? F(e.innerType())
|
|
|
1901
1895
|
static create(t, n, r) {
|
|
1902
1896
|
let i = /* @__PURE__ */ new Map();
|
|
1903
1897
|
for (let e of n) {
|
|
1904
|
-
let n =
|
|
1898
|
+
let n = I(e.shape[t]);
|
|
1905
1899
|
if (!n.length) throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
|
|
1906
1900
|
for (let r of n) {
|
|
1907
1901
|
if (i.has(r)) throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);
|
|
@@ -1909,7 +1903,7 @@ var F = (e) => e instanceof Je ? F(e.schema) : e instanceof I ? F(e.innerType())
|
|
|
1909
1903
|
}
|
|
1910
1904
|
}
|
|
1911
1905
|
return new e({
|
|
1912
|
-
typeName:
|
|
1906
|
+
typeName: z.ZodDiscriminatedUnion,
|
|
1913
1907
|
discriminator: t,
|
|
1914
1908
|
options: n,
|
|
1915
1909
|
optionsMap: i,
|
|
@@ -1917,7 +1911,7 @@ var F = (e) => e instanceof Je ? F(e.schema) : e instanceof I ? F(e.innerType())
|
|
|
1917
1911
|
});
|
|
1918
1912
|
}
|
|
1919
1913
|
};
|
|
1920
|
-
function
|
|
1914
|
+
function Be(e, t) {
|
|
1921
1915
|
let n = p(e), r = p(t);
|
|
1922
1916
|
if (e === t) return {
|
|
1923
1917
|
valid: !0,
|
|
@@ -1929,7 +1923,7 @@ function Ve(e, t) {
|
|
|
1929
1923
|
...t
|
|
1930
1924
|
};
|
|
1931
1925
|
for (let n of r) {
|
|
1932
|
-
let r =
|
|
1926
|
+
let r = Be(e[n], t[n]);
|
|
1933
1927
|
if (!r.valid) return { valid: !1 };
|
|
1934
1928
|
i[n] = r.data;
|
|
1935
1929
|
}
|
|
@@ -1937,11 +1931,12 @@ function Ve(e, t) {
|
|
|
1937
1931
|
valid: !0,
|
|
1938
1932
|
data: i
|
|
1939
1933
|
};
|
|
1940
|
-
}
|
|
1934
|
+
}
|
|
1935
|
+
if (n === f.array && r === f.array) {
|
|
1941
1936
|
if (e.length !== t.length) return { valid: !1 };
|
|
1942
1937
|
let n = [];
|
|
1943
1938
|
for (let r = 0; r < e.length; r++) {
|
|
1944
|
-
let i = e[r], a = t[r], o =
|
|
1939
|
+
let i = e[r], a = t[r], o = Be(i, a);
|
|
1945
1940
|
if (!o.valid) return { valid: !1 };
|
|
1946
1941
|
n.push(o.data);
|
|
1947
1942
|
}
|
|
@@ -1949,17 +1944,17 @@ function Ve(e, t) {
|
|
|
1949
1944
|
valid: !0,
|
|
1950
1945
|
data: n
|
|
1951
1946
|
};
|
|
1952
|
-
}
|
|
1947
|
+
}
|
|
1948
|
+
return n === f.date && r === f.date && +e == +t ? {
|
|
1953
1949
|
valid: !0,
|
|
1954
1950
|
data: e
|
|
1955
|
-
};
|
|
1956
|
-
else return { valid: !1 };
|
|
1951
|
+
} : { valid: !1 };
|
|
1957
1952
|
}
|
|
1958
|
-
var
|
|
1953
|
+
var Ve = class extends M {
|
|
1959
1954
|
_parse(e) {
|
|
1960
1955
|
let { status: t, ctx: n } = this._processInputParams(e), r = (e, r) => {
|
|
1961
1956
|
if (T(e) || T(r)) return S;
|
|
1962
|
-
let i =
|
|
1957
|
+
let i = Be(e.value, r.value);
|
|
1963
1958
|
return i.valid ? ((E(e) || E(r)) && t.dirty(), {
|
|
1964
1959
|
status: t.value,
|
|
1965
1960
|
value: i.data
|
|
@@ -1984,13 +1979,13 @@ var He = class extends M {
|
|
|
1984
1979
|
}));
|
|
1985
1980
|
}
|
|
1986
1981
|
};
|
|
1987
|
-
|
|
1982
|
+
Ve.create = (e, t, n) => new Ve({
|
|
1988
1983
|
left: e,
|
|
1989
1984
|
right: t,
|
|
1990
|
-
typeName:
|
|
1985
|
+
typeName: z.ZodIntersection,
|
|
1991
1986
|
...j(n)
|
|
1992
1987
|
});
|
|
1993
|
-
var
|
|
1988
|
+
var He = class e extends M {
|
|
1994
1989
|
_parse(e) {
|
|
1995
1990
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
1996
1991
|
if (n.parsedType !== f.array) return b(n, {
|
|
@@ -2028,16 +2023,16 @@ var Ue = class e extends M {
|
|
|
2028
2023
|
});
|
|
2029
2024
|
}
|
|
2030
2025
|
};
|
|
2031
|
-
|
|
2026
|
+
He.create = (e, t) => {
|
|
2032
2027
|
if (!Array.isArray(e)) throw Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2033
|
-
return new
|
|
2028
|
+
return new He({
|
|
2034
2029
|
items: e,
|
|
2035
|
-
typeName:
|
|
2030
|
+
typeName: z.ZodTuple,
|
|
2036
2031
|
rest: null,
|
|
2037
2032
|
...j(t)
|
|
2038
2033
|
});
|
|
2039
2034
|
};
|
|
2040
|
-
var
|
|
2035
|
+
var Ue = class e extends M {
|
|
2041
2036
|
get keySchema() {
|
|
2042
2037
|
return this._def.keyType;
|
|
2043
2038
|
}
|
|
@@ -2066,16 +2061,16 @@ var We = class e extends M {
|
|
|
2066
2061
|
return n instanceof M ? new e({
|
|
2067
2062
|
keyType: t,
|
|
2068
2063
|
valueType: n,
|
|
2069
|
-
typeName:
|
|
2064
|
+
typeName: z.ZodRecord,
|
|
2070
2065
|
...j(r)
|
|
2071
2066
|
}) : new e({
|
|
2072
|
-
keyType:
|
|
2067
|
+
keyType: we.create(),
|
|
2073
2068
|
valueType: t,
|
|
2074
|
-
typeName:
|
|
2069
|
+
typeName: z.ZodRecord,
|
|
2075
2070
|
...j(n)
|
|
2076
2071
|
});
|
|
2077
2072
|
}
|
|
2078
|
-
},
|
|
2073
|
+
}, We = class extends M {
|
|
2079
2074
|
get keySchema() {
|
|
2080
2075
|
return this._def.keyType;
|
|
2081
2076
|
}
|
|
@@ -2106,7 +2101,8 @@ var We = class e extends M {
|
|
|
2106
2101
|
value: e
|
|
2107
2102
|
};
|
|
2108
2103
|
});
|
|
2109
|
-
}
|
|
2104
|
+
}
|
|
2105
|
+
{
|
|
2110
2106
|
let e = /* @__PURE__ */ new Map();
|
|
2111
2107
|
for (let n of a) {
|
|
2112
2108
|
let r = n.key, i = n.value;
|
|
@@ -2120,13 +2116,13 @@ var We = class e extends M {
|
|
|
2120
2116
|
}
|
|
2121
2117
|
}
|
|
2122
2118
|
};
|
|
2123
|
-
|
|
2119
|
+
We.create = (e, t, n) => new We({
|
|
2124
2120
|
valueType: t,
|
|
2125
2121
|
keyType: e,
|
|
2126
|
-
typeName:
|
|
2122
|
+
typeName: z.ZodMap,
|
|
2127
2123
|
...j(n)
|
|
2128
2124
|
});
|
|
2129
|
-
var
|
|
2125
|
+
var Ge = class e extends M {
|
|
2130
2126
|
_parse(e) {
|
|
2131
2127
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2132
2128
|
if (n.parsedType !== f.set) return b(n, {
|
|
@@ -2190,14 +2186,14 @@ var Ke = class e extends M {
|
|
|
2190
2186
|
return this.min(1, e);
|
|
2191
2187
|
}
|
|
2192
2188
|
};
|
|
2193
|
-
|
|
2189
|
+
Ge.create = (e, t) => new Ge({
|
|
2194
2190
|
valueType: e,
|
|
2195
2191
|
minSize: null,
|
|
2196
2192
|
maxSize: null,
|
|
2197
|
-
typeName:
|
|
2193
|
+
typeName: z.ZodSet,
|
|
2198
2194
|
...j(t)
|
|
2199
2195
|
});
|
|
2200
|
-
var
|
|
2196
|
+
var Ke = class e extends M {
|
|
2201
2197
|
constructor() {
|
|
2202
2198
|
super(...arguments), this.validate = this.implement;
|
|
2203
2199
|
}
|
|
@@ -2241,7 +2237,7 @@ var qe = class e extends M {
|
|
|
2241
2237
|
});
|
|
2242
2238
|
}
|
|
2243
2239
|
let i = { errorMap: t.common.contextualErrorMap }, a = t.data;
|
|
2244
|
-
if (this._def.returns instanceof
|
|
2240
|
+
if (this._def.returns instanceof Qe) {
|
|
2245
2241
|
let e = this;
|
|
2246
2242
|
return w(async function(...t) {
|
|
2247
2243
|
let o = new h([]), s = await e._def.args.parseAsync(t, i).catch((e) => {
|
|
@@ -2251,7 +2247,8 @@ var qe = class e extends M {
|
|
|
2251
2247
|
throw o.addIssue(r(c, e)), o;
|
|
2252
2248
|
});
|
|
2253
2249
|
});
|
|
2254
|
-
}
|
|
2250
|
+
}
|
|
2251
|
+
{
|
|
2255
2252
|
let e = this;
|
|
2256
2253
|
return w(function(...t) {
|
|
2257
2254
|
let o = e._def.args.safeParse(t, i);
|
|
@@ -2271,7 +2268,7 @@ var qe = class e extends M {
|
|
|
2271
2268
|
args(...t) {
|
|
2272
2269
|
return new e({
|
|
2273
2270
|
...this._def,
|
|
2274
|
-
args:
|
|
2271
|
+
args: He.create(t).rest(Pe.create())
|
|
2275
2272
|
});
|
|
2276
2273
|
}
|
|
2277
2274
|
returns(t) {
|
|
@@ -2288,13 +2285,13 @@ var qe = class e extends M {
|
|
|
2288
2285
|
}
|
|
2289
2286
|
static create(t, n, r) {
|
|
2290
2287
|
return new e({
|
|
2291
|
-
args: t ||
|
|
2292
|
-
returns: n ||
|
|
2293
|
-
typeName:
|
|
2288
|
+
args: t || He.create([]).rest(Pe.create()),
|
|
2289
|
+
returns: n || Pe.create(),
|
|
2290
|
+
typeName: z.ZodFunction,
|
|
2294
2291
|
...j(r)
|
|
2295
2292
|
});
|
|
2296
2293
|
}
|
|
2297
|
-
},
|
|
2294
|
+
}, qe = class extends M {
|
|
2298
2295
|
get schema() {
|
|
2299
2296
|
return this._def.getter();
|
|
2300
2297
|
}
|
|
@@ -2307,12 +2304,12 @@ var qe = class e extends M {
|
|
|
2307
2304
|
});
|
|
2308
2305
|
}
|
|
2309
2306
|
};
|
|
2310
|
-
|
|
2307
|
+
qe.create = (e, t) => new qe({
|
|
2311
2308
|
getter: e,
|
|
2312
|
-
typeName:
|
|
2309
|
+
typeName: z.ZodLazy,
|
|
2313
2310
|
...j(t)
|
|
2314
2311
|
});
|
|
2315
|
-
var
|
|
2312
|
+
var Je = class extends M {
|
|
2316
2313
|
_parse(e) {
|
|
2317
2314
|
if (e.data !== this._def.value) {
|
|
2318
2315
|
let t = this._getOrReturnCtx(e);
|
|
@@ -2331,19 +2328,19 @@ var Ye = class extends M {
|
|
|
2331
2328
|
return this._def.value;
|
|
2332
2329
|
}
|
|
2333
2330
|
};
|
|
2334
|
-
|
|
2331
|
+
Je.create = (e, t) => new Je({
|
|
2335
2332
|
value: e,
|
|
2336
|
-
typeName:
|
|
2333
|
+
typeName: z.ZodLiteral,
|
|
2337
2334
|
...j(t)
|
|
2338
2335
|
});
|
|
2339
|
-
function
|
|
2340
|
-
return new
|
|
2336
|
+
function Ye(e, t) {
|
|
2337
|
+
return new Xe({
|
|
2341
2338
|
values: e,
|
|
2342
|
-
typeName:
|
|
2339
|
+
typeName: z.ZodEnum,
|
|
2343
2340
|
...j(t)
|
|
2344
2341
|
});
|
|
2345
2342
|
}
|
|
2346
|
-
var
|
|
2343
|
+
var Xe = class e extends M {
|
|
2347
2344
|
_parse(e) {
|
|
2348
2345
|
if (typeof e.data != "string") {
|
|
2349
2346
|
let t = this._getOrReturnCtx(e), n = this._def.values;
|
|
@@ -2394,8 +2391,8 @@ var Ze = class e extends M {
|
|
|
2394
2391
|
});
|
|
2395
2392
|
}
|
|
2396
2393
|
};
|
|
2397
|
-
|
|
2398
|
-
var
|
|
2394
|
+
Xe.create = Ye;
|
|
2395
|
+
var Ze = class extends M {
|
|
2399
2396
|
_parse(e) {
|
|
2400
2397
|
let t = u.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2401
2398
|
if (n.parsedType !== f.string && n.parsedType !== f.number) {
|
|
@@ -2420,12 +2417,12 @@ var Qe = class extends M {
|
|
|
2420
2417
|
return this._def.values;
|
|
2421
2418
|
}
|
|
2422
2419
|
};
|
|
2423
|
-
|
|
2420
|
+
Ze.create = (e, t) => new Ze({
|
|
2424
2421
|
values: e,
|
|
2425
|
-
typeName:
|
|
2422
|
+
typeName: z.ZodNativeEnum,
|
|
2426
2423
|
...j(t)
|
|
2427
2424
|
});
|
|
2428
|
-
var
|
|
2425
|
+
var Qe = class extends M {
|
|
2429
2426
|
unwrap() {
|
|
2430
2427
|
return this._def.type;
|
|
2431
2428
|
}
|
|
@@ -2441,17 +2438,17 @@ var $e = class extends M {
|
|
|
2441
2438
|
})));
|
|
2442
2439
|
}
|
|
2443
2440
|
};
|
|
2444
|
-
|
|
2441
|
+
Qe.create = (e, t) => new Qe({
|
|
2445
2442
|
type: e,
|
|
2446
|
-
typeName:
|
|
2443
|
+
typeName: z.ZodPromise,
|
|
2447
2444
|
...j(t)
|
|
2448
2445
|
});
|
|
2449
|
-
var
|
|
2446
|
+
var L = class extends M {
|
|
2450
2447
|
innerType() {
|
|
2451
2448
|
return this._def.schema;
|
|
2452
2449
|
}
|
|
2453
2450
|
sourceType() {
|
|
2454
|
-
return this._def.schema._def.typeName ===
|
|
2451
|
+
return this._def.schema._def.typeName === z.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2455
2452
|
}
|
|
2456
2453
|
_parse(e) {
|
|
2457
2454
|
let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, i = {
|
|
@@ -2500,7 +2497,8 @@ var I = class extends M {
|
|
|
2500
2497
|
status: t.value,
|
|
2501
2498
|
value: r.value
|
|
2502
2499
|
});
|
|
2503
|
-
}
|
|
2500
|
+
}
|
|
2501
|
+
return this._def.schema._parseAsync({
|
|
2504
2502
|
data: n.data,
|
|
2505
2503
|
path: n.path,
|
|
2506
2504
|
parent: n
|
|
@@ -2509,45 +2507,48 @@ var I = class extends M {
|
|
|
2509
2507
|
value: n.value
|
|
2510
2508
|
}))));
|
|
2511
2509
|
}
|
|
2512
|
-
if (r.type === "transform")
|
|
2513
|
-
|
|
2510
|
+
if (r.type === "transform") {
|
|
2511
|
+
if (n.common.async === !1) {
|
|
2512
|
+
let e = this._def.schema._parseSync({
|
|
2513
|
+
data: n.data,
|
|
2514
|
+
path: n.path,
|
|
2515
|
+
parent: n
|
|
2516
|
+
});
|
|
2517
|
+
if (!D(e)) return S;
|
|
2518
|
+
let a = r.transform(e.value, i);
|
|
2519
|
+
if (a instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2520
|
+
return {
|
|
2521
|
+
status: t.value,
|
|
2522
|
+
value: a
|
|
2523
|
+
};
|
|
2524
|
+
}
|
|
2525
|
+
return this._def.schema._parseAsync({
|
|
2514
2526
|
data: n.data,
|
|
2515
2527
|
path: n.path,
|
|
2516
2528
|
parent: n
|
|
2517
|
-
})
|
|
2518
|
-
if (!D(e)) return S;
|
|
2519
|
-
let a = r.transform(e.value, i);
|
|
2520
|
-
if (a instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2521
|
-
return {
|
|
2529
|
+
}).then((e) => D(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({
|
|
2522
2530
|
status: t.value,
|
|
2523
|
-
value:
|
|
2524
|
-
};
|
|
2525
|
-
}
|
|
2526
|
-
data: n.data,
|
|
2527
|
-
path: n.path,
|
|
2528
|
-
parent: n
|
|
2529
|
-
}).then((e) => D(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({
|
|
2530
|
-
status: t.value,
|
|
2531
|
-
value: e
|
|
2532
|
-
})) : S);
|
|
2531
|
+
value: e
|
|
2532
|
+
})) : S);
|
|
2533
|
+
}
|
|
2533
2534
|
u.assertNever(r);
|
|
2534
2535
|
}
|
|
2535
2536
|
};
|
|
2536
|
-
|
|
2537
|
+
L.create = (e, t, n) => new L({
|
|
2537
2538
|
schema: e,
|
|
2538
|
-
typeName:
|
|
2539
|
+
typeName: z.ZodEffects,
|
|
2539
2540
|
effect: t,
|
|
2540
2541
|
...j(n)
|
|
2541
|
-
}),
|
|
2542
|
+
}), L.createWithPreprocess = (e, t, n) => new L({
|
|
2542
2543
|
schema: t,
|
|
2543
2544
|
effect: {
|
|
2544
2545
|
type: "preprocess",
|
|
2545
2546
|
transform: e
|
|
2546
2547
|
},
|
|
2547
|
-
typeName:
|
|
2548
|
+
typeName: z.ZodEffects,
|
|
2548
2549
|
...j(n)
|
|
2549
2550
|
});
|
|
2550
|
-
var
|
|
2551
|
+
var R = class extends M {
|
|
2551
2552
|
_parse(e) {
|
|
2552
2553
|
return this._getType(e) === f.undefined ? w(void 0) : this._def.innerType._parse(e);
|
|
2553
2554
|
}
|
|
@@ -2555,12 +2556,12 @@ var L = class extends M {
|
|
|
2555
2556
|
return this._def.innerType;
|
|
2556
2557
|
}
|
|
2557
2558
|
};
|
|
2558
|
-
|
|
2559
|
+
R.create = (e, t) => new R({
|
|
2559
2560
|
innerType: e,
|
|
2560
|
-
typeName:
|
|
2561
|
+
typeName: z.ZodOptional,
|
|
2561
2562
|
...j(t)
|
|
2562
2563
|
});
|
|
2563
|
-
var
|
|
2564
|
+
var $e = class extends M {
|
|
2564
2565
|
_parse(e) {
|
|
2565
2566
|
return this._getType(e) === f.null ? w(null) : this._def.innerType._parse(e);
|
|
2566
2567
|
}
|
|
@@ -2568,12 +2569,12 @@ var et = class extends M {
|
|
|
2568
2569
|
return this._def.innerType;
|
|
2569
2570
|
}
|
|
2570
2571
|
};
|
|
2571
|
-
|
|
2572
|
+
$e.create = (e, t) => new $e({
|
|
2572
2573
|
innerType: e,
|
|
2573
|
-
typeName:
|
|
2574
|
+
typeName: z.ZodNullable,
|
|
2574
2575
|
...j(t)
|
|
2575
2576
|
});
|
|
2576
|
-
var
|
|
2577
|
+
var et = class extends M {
|
|
2577
2578
|
_parse(e) {
|
|
2578
2579
|
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2579
2580
|
return t.parsedType === f.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
|
|
@@ -2586,13 +2587,13 @@ var tt = class extends M {
|
|
|
2586
2587
|
return this._def.innerType;
|
|
2587
2588
|
}
|
|
2588
2589
|
};
|
|
2589
|
-
|
|
2590
|
+
et.create = (e, t) => new et({
|
|
2590
2591
|
innerType: e,
|
|
2591
|
-
typeName:
|
|
2592
|
+
typeName: z.ZodDefault,
|
|
2592
2593
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
2593
2594
|
...j(t)
|
|
2594
2595
|
});
|
|
2595
|
-
var
|
|
2596
|
+
var tt = class extends M {
|
|
2596
2597
|
_parse(e) {
|
|
2597
2598
|
let { ctx: t } = this._processInputParams(e), n = {
|
|
2598
2599
|
...t,
|
|
@@ -2627,13 +2628,13 @@ var nt = class extends M {
|
|
|
2627
2628
|
return this._def.innerType;
|
|
2628
2629
|
}
|
|
2629
2630
|
};
|
|
2630
|
-
|
|
2631
|
+
tt.create = (e, t) => new tt({
|
|
2631
2632
|
innerType: e,
|
|
2632
|
-
typeName:
|
|
2633
|
+
typeName: z.ZodCatch,
|
|
2633
2634
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
2634
2635
|
...j(t)
|
|
2635
2636
|
});
|
|
2636
|
-
var
|
|
2637
|
+
var nt = class extends M {
|
|
2637
2638
|
_parse(e) {
|
|
2638
2639
|
if (this._getType(e) !== f.nan) {
|
|
2639
2640
|
let t = this._getOrReturnCtx(e);
|
|
@@ -2649,11 +2650,11 @@ var rt = class extends M {
|
|
|
2649
2650
|
};
|
|
2650
2651
|
}
|
|
2651
2652
|
};
|
|
2652
|
-
|
|
2653
|
-
typeName:
|
|
2653
|
+
nt.create = (e) => new nt({
|
|
2654
|
+
typeName: z.ZodNaN,
|
|
2654
2655
|
...j(e)
|
|
2655
2656
|
});
|
|
2656
|
-
var
|
|
2657
|
+
var rt = class extends M {
|
|
2657
2658
|
_parse(e) {
|
|
2658
2659
|
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2659
2660
|
return this._def.type._parse({
|
|
@@ -2665,7 +2666,7 @@ var it = class extends M {
|
|
|
2665
2666
|
unwrap() {
|
|
2666
2667
|
return this._def.type;
|
|
2667
2668
|
}
|
|
2668
|
-
},
|
|
2669
|
+
}, it = class e extends M {
|
|
2669
2670
|
_parse(e) {
|
|
2670
2671
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2671
2672
|
if (n.common.async) return (async () => {
|
|
@@ -2700,10 +2701,10 @@ var it = class extends M {
|
|
|
2700
2701
|
return new e({
|
|
2701
2702
|
in: t,
|
|
2702
2703
|
out: n,
|
|
2703
|
-
typeName:
|
|
2704
|
+
typeName: z.ZodPipeline
|
|
2704
2705
|
});
|
|
2705
2706
|
}
|
|
2706
|
-
},
|
|
2707
|
+
}, at = class extends M {
|
|
2707
2708
|
_parse(e) {
|
|
2708
2709
|
let t = this._def.innerType._parse(e), n = (e) => (D(e) && (e.value = Object.freeze(e.value)), e);
|
|
2709
2710
|
return O(t) ? t.then((e) => n(e)) : n(t);
|
|
@@ -2712,83 +2713,82 @@ var it = class extends M {
|
|
|
2712
2713
|
return this._def.innerType;
|
|
2713
2714
|
}
|
|
2714
2715
|
};
|
|
2715
|
-
|
|
2716
|
+
at.create = (e, t) => new at({
|
|
2716
2717
|
innerType: e,
|
|
2717
|
-
typeName:
|
|
2718
|
+
typeName: z.ZodReadonly,
|
|
2718
2719
|
...j(t)
|
|
2719
|
-
}),
|
|
2720
|
-
var
|
|
2720
|
+
}), F.lazycreate;
|
|
2721
|
+
var z;
|
|
2721
2722
|
(function(e) {
|
|
2722
2723
|
e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
|
|
2723
|
-
})(
|
|
2724
|
-
var
|
|
2725
|
-
|
|
2726
|
-
var
|
|
2727
|
-
Ae.create, je.create, Me.create, Ne.create
|
|
2728
|
-
var
|
|
2729
|
-
|
|
2730
|
-
var
|
|
2731
|
-
|
|
2732
|
-
var
|
|
2733
|
-
Ge.create, Ke.create, qe.create, Je.create
|
|
2734
|
-
var
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
mode: dt([
|
|
2724
|
+
})(z ||= {});
|
|
2725
|
+
var B = we.create;
|
|
2726
|
+
Ee.create, nt.create, De.create;
|
|
2727
|
+
var ot = Oe.create;
|
|
2728
|
+
ke.create, Ae.create, je.create, Me.create, Ne.create;
|
|
2729
|
+
var st = Pe.create;
|
|
2730
|
+
P.create, Fe.create, Ie.create;
|
|
2731
|
+
var ct = F.create;
|
|
2732
|
+
F.strictCreate, Re.create, ze.create, Ve.create, He.create;
|
|
2733
|
+
var lt = Ue.create;
|
|
2734
|
+
We.create, Ge.create, Ke.create, qe.create, Je.create;
|
|
2735
|
+
var ut = Xe.create;
|
|
2736
|
+
Ze.create, Qe.create, L.create, R.create, $e.create, L.createWithPreprocess, it.create;
|
|
2737
|
+
// ../../packages/widget-sdk/src/config/schema.ts
|
|
2738
|
+
var dt = ct({
|
|
2739
|
+
mode: ut([
|
|
2740
2740
|
"light",
|
|
2741
2741
|
"dark",
|
|
2742
2742
|
"system"
|
|
2743
2743
|
]).optional(),
|
|
2744
|
-
accentColor:
|
|
2745
|
-
fontFamily:
|
|
2746
|
-
borderRadius:
|
|
2747
|
-
}),
|
|
2748
|
-
externalId:
|
|
2749
|
-
authId:
|
|
2750
|
-
name:
|
|
2751
|
-
email:
|
|
2752
|
-
}),
|
|
2753
|
-
agentId:
|
|
2754
|
-
apiBaseUrl:
|
|
2755
|
-
tenantId:
|
|
2756
|
-
user:
|
|
2757
|
-
sessionId:
|
|
2758
|
-
mode:
|
|
2759
|
-
title:
|
|
2760
|
-
subtitle:
|
|
2761
|
-
description:
|
|
2762
|
-
avatarUrl:
|
|
2763
|
-
streaming:
|
|
2764
|
-
preview:
|
|
2765
|
-
skipServerConfigFetch:
|
|
2766
|
-
configChannel:
|
|
2767
|
-
metadata:
|
|
2768
|
-
theme:
|
|
2769
|
-
}),
|
|
2744
|
+
accentColor: B().optional(),
|
|
2745
|
+
fontFamily: B().optional(),
|
|
2746
|
+
borderRadius: B().optional()
|
|
2747
|
+
}), ft = ct({
|
|
2748
|
+
externalId: B().optional(),
|
|
2749
|
+
authId: B().optional(),
|
|
2750
|
+
name: B().optional(),
|
|
2751
|
+
email: B().optional()
|
|
2752
|
+
}), pt = ct({
|
|
2753
|
+
agentId: B().min(1, "agentId is required"),
|
|
2754
|
+
apiBaseUrl: B().url("apiBaseUrl must be a valid URL"),
|
|
2755
|
+
tenantId: B().optional(),
|
|
2756
|
+
user: ft.optional(),
|
|
2757
|
+
sessionId: B().optional(),
|
|
2758
|
+
mode: ut(["floating", "inline"]).optional(),
|
|
2759
|
+
title: B().optional(),
|
|
2760
|
+
subtitle: B().optional(),
|
|
2761
|
+
description: B().optional(),
|
|
2762
|
+
avatarUrl: B().optional(),
|
|
2763
|
+
streaming: ot().optional(),
|
|
2764
|
+
preview: ot().optional(),
|
|
2765
|
+
skipServerConfigFetch: ot().optional(),
|
|
2766
|
+
configChannel: ut(["draft", "published"]).optional(),
|
|
2767
|
+
metadata: lt(st()).optional(),
|
|
2768
|
+
theme: dt.optional()
|
|
2769
|
+
}), mt = pt.omit({
|
|
2770
2770
|
agentId: !0,
|
|
2771
2771
|
apiBaseUrl: !0
|
|
2772
|
-
}).partial(),
|
|
2772
|
+
}).partial(), ht = {
|
|
2773
2773
|
mode: "floating",
|
|
2774
2774
|
streaming: !0,
|
|
2775
2775
|
title: "AI Assistant",
|
|
2776
2776
|
theme: {
|
|
2777
2777
|
mode: "light",
|
|
2778
|
-
accentColor: "#
|
|
2778
|
+
accentColor: "#4f46e5",
|
|
2779
2779
|
fontFamily: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
2780
2780
|
borderRadius: "12px"
|
|
2781
2781
|
}
|
|
2782
2782
|
};
|
|
2783
|
-
function
|
|
2784
|
-
|
|
2783
|
+
function gt(e, t) {
|
|
2784
|
+
pt.parse(e);
|
|
2785
2785
|
let n, r = t ? { ...t } : void 0;
|
|
2786
2786
|
r && typeof r.theme == "object" && r.theme !== null ? (n = r.theme, delete r.theme) : r && typeof r.theme == "string" && (n = { mode: r.theme }, delete r.theme);
|
|
2787
|
-
let i = r ?
|
|
2788
|
-
mode: a.theme?.mode ?? n?.mode ??
|
|
2789
|
-
accentColor: a.theme?.accentColor
|
|
2790
|
-
fontFamily: a.theme?.fontFamily ?? n?.fontFamily ??
|
|
2791
|
-
borderRadius: a.theme?.borderRadius ?? n?.borderRadius ??
|
|
2787
|
+
let i = r ? mt.passthrough().safeParse(r).data : void 0, a = i ? _t(i, e) : e, o = {
|
|
2788
|
+
mode: a.theme?.mode ?? n?.mode ?? ht.theme.mode,
|
|
2789
|
+
accentColor: a.theme?.accentColor || n?.accentColor || ht.theme.accentColor,
|
|
2790
|
+
fontFamily: a.theme?.fontFamily ?? n?.fontFamily ?? ht.theme.fontFamily,
|
|
2791
|
+
borderRadius: a.theme?.borderRadius ?? n?.borderRadius ?? ht.theme.borderRadius
|
|
2792
2792
|
};
|
|
2793
2793
|
return {
|
|
2794
2794
|
agentId: a.agentId,
|
|
@@ -2801,8 +2801,8 @@ function _t(e, t) {
|
|
|
2801
2801
|
email: a.user?.email
|
|
2802
2802
|
},
|
|
2803
2803
|
sessionId: a.sessionId,
|
|
2804
|
-
mode: a.mode ??
|
|
2805
|
-
title: a.title ??
|
|
2804
|
+
mode: a.mode ?? ht.mode,
|
|
2805
|
+
title: a.title ?? ht.title,
|
|
2806
2806
|
subtitle: a.subtitle,
|
|
2807
2807
|
description: a.description,
|
|
2808
2808
|
suggestedQuestions: (() => {
|
|
@@ -2810,7 +2810,7 @@ function _t(e, t) {
|
|
|
2810
2810
|
return Array.isArray(e) ? e : [];
|
|
2811
2811
|
})(),
|
|
2812
2812
|
avatarUrl: a.avatarUrl,
|
|
2813
|
-
streaming: a.streaming ??
|
|
2813
|
+
streaming: a.streaming ?? ht.streaming,
|
|
2814
2814
|
preview: a.preview === !0,
|
|
2815
2815
|
skipServerConfigFetch: a.skipServerConfigFetch === !0,
|
|
2816
2816
|
configChannel: a.configChannel,
|
|
@@ -2818,6 +2818,11 @@ function _t(e, t) {
|
|
|
2818
2818
|
theme: o,
|
|
2819
2819
|
photoSendingEnabled: i?.photoSendingEnabled === !0,
|
|
2820
2820
|
fileUploadEnabled: i?.fileUploadEnabled === !0,
|
|
2821
|
+
voiceNoteEnabled: i?.voiceNoteEnabled === !0,
|
|
2822
|
+
voiceNoteMaxDurationSec: (() => {
|
|
2823
|
+
let e = i?.voiceNoteMaxDurationSec;
|
|
2824
|
+
return typeof e == "number" && Number.isFinite(e) ? e : 120;
|
|
2825
|
+
})(),
|
|
2821
2826
|
attachmentMaxCount: (() => {
|
|
2822
2827
|
let e = i?.attachmentMaxCount;
|
|
2823
2828
|
return typeof e == "number" && Number.isFinite(e) ? e : 5;
|
|
@@ -2832,23 +2837,22 @@ function _t(e, t) {
|
|
|
2832
2837
|
})()
|
|
2833
2838
|
};
|
|
2834
2839
|
}
|
|
2835
|
-
function
|
|
2840
|
+
function _t(e, t) {
|
|
2836
2841
|
let n = { ...e };
|
|
2837
2842
|
for (let e of Object.keys(t)) {
|
|
2838
2843
|
let r = t[e];
|
|
2839
|
-
r != null && (typeof r == "object" && !Array.isArray(r) && n[e] !== null && typeof n[e] == "object" ?
|
|
2844
|
+
r != null && (n[e] = typeof r == "object" && !Array.isArray(r) && n[e] !== null && typeof n[e] == "object" ? _t(n[e], r) : r);
|
|
2840
2845
|
}
|
|
2841
2846
|
return n;
|
|
2842
2847
|
}
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
return yt = Object.assign || function(e) {
|
|
2848
|
+
// ../../node_modules/.pnpm/tslib@2.9.1/node_modules/tslib/tslib.es6.mjs
|
|
2849
|
+
var vt = function() {
|
|
2850
|
+
return vt = Object.assign || function(e) {
|
|
2847
2851
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
2848
2852
|
return e;
|
|
2849
|
-
},
|
|
2853
|
+
}, vt.apply(this, arguments);
|
|
2850
2854
|
};
|
|
2851
|
-
function
|
|
2855
|
+
function V(e, t, n, r) {
|
|
2852
2856
|
function i(e) {
|
|
2853
2857
|
return e instanceof n ? e : new n(function(t) {
|
|
2854
2858
|
t(e);
|
|
@@ -2875,7 +2879,7 @@ function B(e, t, n, r) {
|
|
|
2875
2879
|
c((r = r.apply(e, t || [])).next());
|
|
2876
2880
|
});
|
|
2877
2881
|
}
|
|
2878
|
-
function
|
|
2882
|
+
function H(e, t) {
|
|
2879
2883
|
var n = {
|
|
2880
2884
|
label: 0,
|
|
2881
2885
|
sent: function() {
|
|
@@ -2913,7 +2917,7 @@ function V(e, t) {
|
|
|
2913
2917
|
s = n.ops.pop(), n.trys.pop();
|
|
2914
2918
|
continue;
|
|
2915
2919
|
default:
|
|
2916
|
-
if (
|
|
2920
|
+
if (a = n.trys, !(a = a.length > 0 && a[a.length - 1]) && (s[0] === 6 || s[0] === 2)) {
|
|
2917
2921
|
n = 0;
|
|
2918
2922
|
continue;
|
|
2919
2923
|
}
|
|
@@ -2945,19 +2949,18 @@ function V(e, t) {
|
|
|
2945
2949
|
};
|
|
2946
2950
|
}
|
|
2947
2951
|
}
|
|
2948
|
-
function
|
|
2952
|
+
function yt(e, t, n) {
|
|
2949
2953
|
if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
|
|
2950
2954
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
2951
2955
|
}
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
function St(e, t) {
|
|
2956
|
+
// ../../node_modules/.pnpm/@fingerprintjs+fingerprintjs@4.6.2/node_modules/@fingerprintjs/fingerprintjs/dist/fp.esm.js
|
|
2957
|
+
var bt = "4.6.2";
|
|
2958
|
+
function xt(e, t) {
|
|
2956
2959
|
return new Promise(function(n) {
|
|
2957
2960
|
return setTimeout(n, e, t);
|
|
2958
2961
|
});
|
|
2959
2962
|
}
|
|
2960
|
-
function
|
|
2963
|
+
function St() {
|
|
2961
2964
|
return new Promise(function(e) {
|
|
2962
2965
|
var t = new MessageChannel();
|
|
2963
2966
|
t.port1.onmessage = function() {
|
|
@@ -2965,22 +2968,22 @@ function Ct() {
|
|
|
2965
2968
|
}, t.port2.postMessage(null);
|
|
2966
2969
|
});
|
|
2967
2970
|
}
|
|
2968
|
-
function
|
|
2971
|
+
function Ct(e, t) {
|
|
2969
2972
|
t === void 0 && (t = Infinity);
|
|
2970
2973
|
var n = window.requestIdleCallback;
|
|
2971
2974
|
return n ? new Promise(function(e) {
|
|
2972
2975
|
return n.call(window, function() {
|
|
2973
2976
|
return e();
|
|
2974
2977
|
}, { timeout: t });
|
|
2975
|
-
}) :
|
|
2978
|
+
}) : xt(Math.min(e, t));
|
|
2976
2979
|
}
|
|
2977
|
-
function
|
|
2980
|
+
function wt(e) {
|
|
2978
2981
|
return !!e && typeof e.then == "function";
|
|
2979
2982
|
}
|
|
2980
|
-
function
|
|
2983
|
+
function Tt(e, t) {
|
|
2981
2984
|
try {
|
|
2982
2985
|
var n = e();
|
|
2983
|
-
|
|
2986
|
+
wt(n) ? n.then(function(e) {
|
|
2984
2987
|
return t(!0, e);
|
|
2985
2988
|
}, function(e) {
|
|
2986
2989
|
return t(!1, e);
|
|
@@ -2989,13 +2992,13 @@ function Et(e, t) {
|
|
|
2989
2992
|
t(!1, e);
|
|
2990
2993
|
}
|
|
2991
2994
|
}
|
|
2992
|
-
function
|
|
2993
|
-
return n === void 0 && (n = 16),
|
|
2995
|
+
function Et(e, t, n) {
|
|
2996
|
+
return n === void 0 && (n = 16), V(this, void 0, void 0, function() {
|
|
2994
2997
|
var r, i, a, o;
|
|
2995
|
-
return
|
|
2998
|
+
return H(this, function(s) {
|
|
2996
2999
|
switch (s.label) {
|
|
2997
3000
|
case 0: r = Array(e.length), i = Date.now(), a = 0, s.label = 1;
|
|
2998
|
-
case 1: return a < e.length ? (r[a] = t(e[a], a), o = Date.now(), o >= i + n ? (i = o, [4,
|
|
3001
|
+
case 1: return a < e.length ? (r[a] = t(e[a], a), o = Date.now(), o >= i + n ? (i = o, [4, St()]) : [3, 3]) : [3, 4];
|
|
2999
3002
|
case 2: s.sent(), s.label = 3;
|
|
3000
3003
|
case 3: return ++a, [3, 1];
|
|
3001
3004
|
case 4: return [2, r];
|
|
@@ -3003,36 +3006,36 @@ function Dt(e, t, n) {
|
|
|
3003
3006
|
});
|
|
3004
3007
|
});
|
|
3005
3008
|
}
|
|
3006
|
-
function
|
|
3009
|
+
function Dt(e) {
|
|
3007
3010
|
return e.then(void 0, function() {}), e;
|
|
3008
3011
|
}
|
|
3009
|
-
function
|
|
3012
|
+
function Ot(e, t) {
|
|
3010
3013
|
for (var n = 0, r = e.length; n < r; ++n) if (e[n] === t) return !0;
|
|
3011
3014
|
return !1;
|
|
3012
3015
|
}
|
|
3013
|
-
function
|
|
3014
|
-
return !
|
|
3016
|
+
function kt(e, t) {
|
|
3017
|
+
return !Ot(e, t);
|
|
3015
3018
|
}
|
|
3016
|
-
function
|
|
3019
|
+
function At(e) {
|
|
3017
3020
|
return parseInt(e);
|
|
3018
3021
|
}
|
|
3019
|
-
function
|
|
3022
|
+
function U(e) {
|
|
3020
3023
|
return parseFloat(e);
|
|
3021
3024
|
}
|
|
3022
|
-
function
|
|
3025
|
+
function W(e, t) {
|
|
3023
3026
|
return typeof e == "number" && isNaN(e) ? t : e;
|
|
3024
3027
|
}
|
|
3025
|
-
function
|
|
3028
|
+
function G(e) {
|
|
3026
3029
|
return e.reduce(function(e, t) {
|
|
3027
3030
|
return e + +!!t;
|
|
3028
3031
|
}, 0);
|
|
3029
3032
|
}
|
|
3030
|
-
function
|
|
3033
|
+
function jt(e, t) {
|
|
3031
3034
|
if (t === void 0 && (t = 1), Math.abs(t) >= 1) return Math.round(e / t) * t;
|
|
3032
3035
|
var n = 1 / t;
|
|
3033
3036
|
return Math.round(e * n) / n;
|
|
3034
3037
|
}
|
|
3035
|
-
function
|
|
3038
|
+
function Mt(e) {
|
|
3036
3039
|
for (var t = `Unexpected syntax '${e}'`, n = /^\s*([a-z-]*)(.*)$/i.exec(e), r = n[1] || void 0, i = {}, a = /([.:#][\w-]+|\[.+?\])/gi, o = function(e, t) {
|
|
3037
3040
|
i[e] = i[e] || [], i[e].push(t);
|
|
3038
3041
|
};;) {
|
|
@@ -3056,7 +3059,7 @@ function Nt(e) {
|
|
|
3056
3059
|
}
|
|
3057
3060
|
return [r, i];
|
|
3058
3061
|
}
|
|
3059
|
-
function
|
|
3062
|
+
function Nt(e) {
|
|
3060
3063
|
for (var t = new Uint8Array(e.length), n = 0; n < e.length; n++) {
|
|
3061
3064
|
var r = e.charCodeAt(n);
|
|
3062
3065
|
if (r > 127) return new TextEncoder().encode(e);
|
|
@@ -3064,7 +3067,7 @@ function Pt(e) {
|
|
|
3064
3067
|
}
|
|
3065
3068
|
return t;
|
|
3066
3069
|
}
|
|
3067
|
-
function
|
|
3070
|
+
function Pt(e, t) {
|
|
3068
3071
|
var n = e[0] >>> 16, r = e[0] & 65535, i = e[1] >>> 16, a = e[1] & 65535, o = t[0] >>> 16, s = t[0] & 65535, c = t[1] >>> 16, l = t[1] & 65535, u = 0, d = 0, f = 0, p = 0;
|
|
3069
3072
|
p += a + l, f += p >>> 16, p &= 65535, f += i + c, d += f >>> 16, f &= 65535, d += r + s, u += d >>> 16, d &= 65535, u += n + o, u &= 65535, e[0] = u << 16 | d, e[1] = f << 16 | p;
|
|
3070
3073
|
}
|
|
@@ -3089,10 +3092,9 @@ function Rt(e) {
|
|
|
3089
3092
|
}
|
|
3090
3093
|
var zt = [2277735313, 289559509], Bt = [1291169091, 658871167], Vt = [0, 5], Ht = [0, 1390208809], Ut = [0, 944331445];
|
|
3091
3094
|
function Wt(e, t) {
|
|
3092
|
-
var n =
|
|
3095
|
+
var n = Nt(e);
|
|
3093
3096
|
t ||= 0;
|
|
3094
|
-
var r = [0, n.length], i = r[1] % 16, a = r[1] - i, o = [0, t], s = [0, t], c = [0, 0], l = [0, 0], u;
|
|
3095
|
-
for (u = 0; u < a; u += 16) c[0] = n[u + 4] | n[u + 5] << 8 | n[u + 6] << 16 | n[u + 7] << 24, c[1] = n[u] | n[u + 1] << 8 | n[u + 2] << 16 | n[u + 3] << 24, l[0] = n[u + 12] | n[u + 13] << 8 | n[u + 14] << 16 | n[u + 15] << 24, l[1] = n[u + 8] | n[u + 9] << 8 | n[u + 10] << 16 | n[u + 11] << 24, K(c, zt), Ft(c, 31), K(c, Bt), J(o, c), Ft(o, 27), G(o, s), K(o, Vt), G(o, Ht), K(l, Bt), Ft(l, 33), K(l, zt), J(s, l), Ft(s, 31), G(s, o), K(s, Vt), G(s, Ut);
|
|
3097
|
+
for (var r = [0, n.length], i = r[1] % 16, a = r[1] - i, o = [0, t], s = [0, t], c = [0, 0], l = [0, 0], u = 0; u < a; u += 16) c[0] = n[u + 4] | n[u + 5] << 8 | n[u + 6] << 16 | n[u + 7] << 24, c[1] = n[u] | n[u + 1] << 8 | n[u + 2] << 16 | n[u + 3] << 24, l[0] = n[u + 12] | n[u + 13] << 8 | n[u + 14] << 16 | n[u + 15] << 24, l[1] = n[u + 8] | n[u + 9] << 8 | n[u + 10] << 16 | n[u + 11] << 24, K(c, zt), Ft(c, 31), K(c, Bt), J(o, c), Ft(o, 27), Pt(o, s), K(o, Vt), Pt(o, Ht), K(l, Bt), Ft(l, 33), K(l, zt), J(s, l), Ft(s, 31), Pt(s, o), K(s, Vt), Pt(s, Ut);
|
|
3096
3098
|
c[0] = 0, c[1] = 0, l[0] = 0, l[1] = 0;
|
|
3097
3099
|
var d = [0, 0];
|
|
3098
3100
|
switch (i) {
|
|
@@ -3112,10 +3114,10 @@ function Wt(e, t) {
|
|
|
3112
3114
|
case 2: d[1] = n[u + 1], q(d, 8), J(c, d);
|
|
3113
3115
|
case 1: d[1] = n[u], J(c, d), K(c, zt), Ft(c, 31), K(c, Bt), J(o, c);
|
|
3114
3116
|
}
|
|
3115
|
-
return J(o, r), J(s, r),
|
|
3117
|
+
return J(o, r), J(s, r), Pt(o, s), Pt(s, o), Rt(o), Rt(s), Pt(o, s), Pt(s, o), ("00000000" + (o[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (o[1] >>> 0).toString(16)).slice(-8) + ("00000000" + (s[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (s[1] >>> 0).toString(16)).slice(-8);
|
|
3116
3118
|
}
|
|
3117
3119
|
function Gt(e) {
|
|
3118
|
-
return
|
|
3120
|
+
return vt({
|
|
3119
3121
|
name: e.name,
|
|
3120
3122
|
message: e.message,
|
|
3121
3123
|
stack: e.stack?.split("\n")
|
|
@@ -3128,9 +3130,9 @@ function qt(e) {
|
|
|
3128
3130
|
return typeof e != "function";
|
|
3129
3131
|
}
|
|
3130
3132
|
function Jt(e, t) {
|
|
3131
|
-
var n =
|
|
3133
|
+
var n = Dt(new Promise(function(n) {
|
|
3132
3134
|
var r = Date.now();
|
|
3133
|
-
|
|
3135
|
+
Tt(e.bind(null, t), function() {
|
|
3134
3136
|
var e = [...arguments], t = Date.now() - r;
|
|
3135
3137
|
if (!e[0]) return n(function() {
|
|
3136
3138
|
return {
|
|
@@ -3148,7 +3150,7 @@ function Jt(e, t) {
|
|
|
3148
3150
|
n(function() {
|
|
3149
3151
|
return new Promise(function(e) {
|
|
3150
3152
|
var n = Date.now();
|
|
3151
|
-
|
|
3153
|
+
Tt(i, function() {
|
|
3152
3154
|
var r = [...arguments], i = t + Date.now() - n;
|
|
3153
3155
|
if (!r[0]) return e({
|
|
3154
3156
|
error: r[1],
|
|
@@ -3171,18 +3173,18 @@ function Jt(e, t) {
|
|
|
3171
3173
|
}
|
|
3172
3174
|
function Yt(e, t, n, r) {
|
|
3173
3175
|
var i = Object.keys(e).filter(function(e) {
|
|
3174
|
-
return
|
|
3175
|
-
}), a =
|
|
3176
|
+
return kt(n, e);
|
|
3177
|
+
}), a = Dt(Et(i, function(n) {
|
|
3176
3178
|
return Jt(e[n], t);
|
|
3177
3179
|
}, r));
|
|
3178
3180
|
return function() {
|
|
3179
|
-
return
|
|
3181
|
+
return V(this, void 0, void 0, function() {
|
|
3180
3182
|
var e, t, n, o, s;
|
|
3181
|
-
return
|
|
3183
|
+
return H(this, function(c) {
|
|
3182
3184
|
switch (c.label) {
|
|
3183
3185
|
case 0: return [4, a];
|
|
3184
|
-
case 1: return e = c.sent(), [4,
|
|
3185
|
-
return
|
|
3186
|
+
case 1: return e = c.sent(), [4, Et(e, function(e) {
|
|
3187
|
+
return Dt(e());
|
|
3186
3188
|
}, r)];
|
|
3187
3189
|
case 2: return t = c.sent(), [4, Promise.all(t)];
|
|
3188
3190
|
case 3:
|
|
@@ -3195,7 +3197,7 @@ function Yt(e, t, n, r) {
|
|
|
3195
3197
|
}
|
|
3196
3198
|
function Xt() {
|
|
3197
3199
|
var e = window, t = navigator;
|
|
3198
|
-
return
|
|
3200
|
+
return G([
|
|
3199
3201
|
"MSCSSMatrix" in e,
|
|
3200
3202
|
"msSetImmediate" in e,
|
|
3201
3203
|
"msIndexedDB" in e,
|
|
@@ -3205,7 +3207,7 @@ function Xt() {
|
|
|
3205
3207
|
}
|
|
3206
3208
|
function Zt() {
|
|
3207
3209
|
var e = window, t = navigator;
|
|
3208
|
-
return
|
|
3210
|
+
return G([
|
|
3209
3211
|
"msWriteProfilerMark" in e,
|
|
3210
3212
|
"MSStream" in e,
|
|
3211
3213
|
"msLaunchUri" in t,
|
|
@@ -3214,7 +3216,7 @@ function Zt() {
|
|
|
3214
3216
|
}
|
|
3215
3217
|
function Qt() {
|
|
3216
3218
|
var e = window, t = navigator;
|
|
3217
|
-
return
|
|
3219
|
+
return G([
|
|
3218
3220
|
"webkitPersistentStorage" in t,
|
|
3219
3221
|
"webkitTemporaryStorage" in t,
|
|
3220
3222
|
(t.vendor || "").indexOf("Google") === 0,
|
|
@@ -3226,7 +3228,7 @@ function Qt() {
|
|
|
3226
3228
|
}
|
|
3227
3229
|
function Y() {
|
|
3228
3230
|
var e = window, t = navigator;
|
|
3229
|
-
return
|
|
3231
|
+
return G([
|
|
3230
3232
|
"ApplePayError" in e,
|
|
3231
3233
|
"CSSPrimitiveValue" in e,
|
|
3232
3234
|
"Counter" in e,
|
|
@@ -3237,7 +3239,7 @@ function Y() {
|
|
|
3237
3239
|
}
|
|
3238
3240
|
function $t() {
|
|
3239
3241
|
var e = window, t = e.HTMLElement, n = e.Document;
|
|
3240
|
-
return
|
|
3242
|
+
return G([
|
|
3241
3243
|
"safari" in e,
|
|
3242
3244
|
!("ongestureend" in e),
|
|
3243
3245
|
!("TouchEvent" in e),
|
|
@@ -3252,7 +3254,7 @@ function en() {
|
|
|
3252
3254
|
}
|
|
3253
3255
|
function tn() {
|
|
3254
3256
|
var e = window;
|
|
3255
|
-
return
|
|
3257
|
+
return G([
|
|
3256
3258
|
"buildID" in navigator,
|
|
3257
3259
|
"MozAppearance" in (document.documentElement?.style ?? {}),
|
|
3258
3260
|
"onmozfullscreenchange" in e,
|
|
@@ -3263,7 +3265,7 @@ function tn() {
|
|
|
3263
3265
|
}
|
|
3264
3266
|
function nn() {
|
|
3265
3267
|
var e = window;
|
|
3266
|
-
return
|
|
3268
|
+
return G([
|
|
3267
3269
|
!("MediaSettingsRange" in e),
|
|
3268
3270
|
"RTCEncodedAudioFrame" in e,
|
|
3269
3271
|
"" + e.Intl == "[object Intl]",
|
|
@@ -3272,7 +3274,7 @@ function nn() {
|
|
|
3272
3274
|
}
|
|
3273
3275
|
function rn() {
|
|
3274
3276
|
var e = window, t = e.URLPattern;
|
|
3275
|
-
return
|
|
3277
|
+
return G([
|
|
3276
3278
|
"union" in Set.prototype,
|
|
3277
3279
|
"Iterator" in e,
|
|
3278
3280
|
t && "hasRegExpGroups" in t.prototype,
|
|
@@ -3281,7 +3283,7 @@ function rn() {
|
|
|
3281
3283
|
}
|
|
3282
3284
|
function an() {
|
|
3283
3285
|
var e = window;
|
|
3284
|
-
return
|
|
3286
|
+
return G([
|
|
3285
3287
|
"DOMRectList" in e,
|
|
3286
3288
|
"RTCPeerConnectionIceEvent" in e,
|
|
3287
3289
|
"SVGGeometryElement" in e,
|
|
@@ -3290,7 +3292,7 @@ function an() {
|
|
|
3290
3292
|
}
|
|
3291
3293
|
function on() {
|
|
3292
3294
|
var e = window, t = navigator, n = e.CSS, r = e.HTMLButtonElement;
|
|
3293
|
-
return
|
|
3295
|
+
return G([
|
|
3294
3296
|
!("getStorageUpdates" in t),
|
|
3295
3297
|
r && "popover" in r.prototype,
|
|
3296
3298
|
"CSSCounterStyleRule" in e,
|
|
@@ -3301,7 +3303,7 @@ function on() {
|
|
|
3301
3303
|
function sn() {
|
|
3302
3304
|
if (navigator.platform === "iPad") return !0;
|
|
3303
3305
|
var e = screen, t = e.width / e.height;
|
|
3304
|
-
return
|
|
3306
|
+
return G([
|
|
3305
3307
|
"MediaSource" in window,
|
|
3306
3308
|
!!Element.prototype.webkitRequestFullscreen,
|
|
3307
3309
|
t > .65 && t < 1.53
|
|
@@ -3317,11 +3319,11 @@ function ln() {
|
|
|
3317
3319
|
}
|
|
3318
3320
|
function un() {
|
|
3319
3321
|
var e = Qt(), t = tn(), n = window, r = navigator, i = "connection";
|
|
3320
|
-
return e ?
|
|
3322
|
+
return e ? G([
|
|
3321
3323
|
!("SharedWorker" in n),
|
|
3322
3324
|
r[i] && "ontypechange" in r[i],
|
|
3323
3325
|
!("sinkId" in new Audio())
|
|
3324
|
-
]) >= 2 : t ?
|
|
3326
|
+
]) >= 2 : t ? G([
|
|
3325
3327
|
"onorientationchange" in n,
|
|
3326
3328
|
"orientation" in n,
|
|
3327
3329
|
/android/i.test(r.appVersion)
|
|
@@ -3329,7 +3331,7 @@ function un() {
|
|
|
3329
3331
|
}
|
|
3330
3332
|
function dn() {
|
|
3331
3333
|
var e = navigator, t = window, n = Audio.prototype, r = t.visualViewport;
|
|
3332
|
-
return
|
|
3334
|
+
return G([
|
|
3333
3335
|
"srLatency" in n,
|
|
3334
3336
|
"srChannelCount" in n,
|
|
3335
3337
|
"devicePosture" in e,
|
|
@@ -3348,7 +3350,7 @@ function pn() {
|
|
|
3348
3350
|
i.type = "triangle", i.frequency.value = 1e4;
|
|
3349
3351
|
var a = r.createDynamicsCompressor();
|
|
3350
3352
|
a.threshold.value = -50, a.knee.value = 40, a.ratio.value = 12, a.attack.value = 0, a.release.value = .25, i.connect(a), a.connect(r.destination), i.start(0);
|
|
3351
|
-
var o = gn(r), s = o[0], c = o[1], l =
|
|
3353
|
+
var o = gn(r), s = o[0], c = o[1], l = Dt(s.then(function(e) {
|
|
3352
3354
|
return _n(e.getChannelData(0).subarray(n));
|
|
3353
3355
|
}, function(e) {
|
|
3354
3356
|
if (e.name === "timeout" || e.name === "suspended") return -3;
|
|
@@ -3365,35 +3367,33 @@ function hn() {
|
|
|
3365
3367
|
return Y() && on() && en() || Qt() && dn() && rn();
|
|
3366
3368
|
}
|
|
3367
3369
|
function gn(e) {
|
|
3368
|
-
var t =
|
|
3369
|
-
return [new Promise(function(
|
|
3370
|
-
var
|
|
3370
|
+
var t = function() {};
|
|
3371
|
+
return [new Promise(function(n, r) {
|
|
3372
|
+
var i = !1, a = 0, o = 0;
|
|
3371
3373
|
e.oncomplete = function(e) {
|
|
3372
|
-
return
|
|
3374
|
+
return n(e.renderedBuffer);
|
|
3373
3375
|
};
|
|
3374
|
-
var
|
|
3376
|
+
var s = function() {
|
|
3375
3377
|
setTimeout(function() {
|
|
3376
|
-
return
|
|
3377
|
-
}, Math.min(
|
|
3378
|
-
},
|
|
3378
|
+
return r(vn("timeout"));
|
|
3379
|
+
}, Math.min(500, o + 5e3 - Date.now()));
|
|
3380
|
+
}, c = function() {
|
|
3379
3381
|
try {
|
|
3380
|
-
var
|
|
3381
|
-
switch (
|
|
3382
|
+
var t = e.startRendering();
|
|
3383
|
+
switch (wt(t) && Dt(t), e.state) {
|
|
3382
3384
|
case "running":
|
|
3383
|
-
|
|
3384
|
-
break;
|
|
3385
|
-
case "suspended":
|
|
3386
|
-
document.hidden || l++, c && l >= t ? s(vn("suspended")) : setTimeout(f, n);
|
|
3385
|
+
o = Date.now(), i && s();
|
|
3387
3386
|
break;
|
|
3387
|
+
case "suspended": document.hidden || a++, i && a >= 3 ? r(vn("suspended")) : setTimeout(c, 500);
|
|
3388
3388
|
}
|
|
3389
3389
|
} catch (e) {
|
|
3390
|
-
|
|
3390
|
+
r(e);
|
|
3391
3391
|
}
|
|
3392
3392
|
};
|
|
3393
|
-
|
|
3394
|
-
|
|
3393
|
+
c(), t = function() {
|
|
3394
|
+
i || (i = !0, o > 0 && s());
|
|
3395
3395
|
};
|
|
3396
|
-
}),
|
|
3396
|
+
}), t];
|
|
3397
3397
|
}
|
|
3398
3398
|
function _n(e) {
|
|
3399
3399
|
for (var t = 0, n = 0; n < e.length; ++n) t += Math.abs(e[n]);
|
|
@@ -3405,12 +3405,12 @@ function vn(e) {
|
|
|
3405
3405
|
}
|
|
3406
3406
|
function yn(e, t, n) {
|
|
3407
3407
|
var r;
|
|
3408
|
-
return n === void 0 && (n = 50),
|
|
3408
|
+
return n === void 0 && (n = 50), V(this, void 0, void 0, function() {
|
|
3409
3409
|
var i, a;
|
|
3410
|
-
return
|
|
3410
|
+
return H(this, function(o) {
|
|
3411
3411
|
switch (o.label) {
|
|
3412
3412
|
case 0: i = document, o.label = 1;
|
|
3413
|
-
case 1: return i.body ? [3, 3] : [4,
|
|
3413
|
+
case 1: return i.body ? [3, 3] : [4, xt(n)];
|
|
3414
3414
|
case 2: return o.sent(), [3, 1];
|
|
3415
3415
|
case 3: a = i.createElement("iframe"), o.label = 4;
|
|
3416
3416
|
case 4: return o.trys.push([
|
|
@@ -3433,7 +3433,7 @@ function yn(e, t, n) {
|
|
|
3433
3433
|
c();
|
|
3434
3434
|
})];
|
|
3435
3435
|
case 5: o.sent(), o.label = 6;
|
|
3436
|
-
case 6: return a.contentWindow?.document?.body ? [3, 8] : [4,
|
|
3436
|
+
case 6: return a.contentWindow?.document?.body ? [3, 8] : [4, xt(n)];
|
|
3437
3437
|
case 7: return o.sent(), [3, 6];
|
|
3438
3438
|
case 8: return [4, e(a, a.contentWindow)];
|
|
3439
3439
|
case 9: return [2, o.sent()];
|
|
@@ -3444,7 +3444,7 @@ function yn(e, t, n) {
|
|
|
3444
3444
|
});
|
|
3445
3445
|
}
|
|
3446
3446
|
function bn(e) {
|
|
3447
|
-
for (var t =
|
|
3447
|
+
for (var t = Mt(e), n = t[0], r = t[1], i = document.createElement(n ?? "div"), a = 0, o = Object.keys(r); a < o.length; a++) {
|
|
3448
3448
|
var s = o[a], c = r[s].join(" ");
|
|
3449
3449
|
s === "style" ? xn(i.style, c) : i.setAttribute(s, c);
|
|
3450
3450
|
}
|
|
@@ -3481,9 +3481,9 @@ function Dn() {
|
|
|
3481
3481
|
var e = this;
|
|
3482
3482
|
return yn(function(t, n) {
|
|
3483
3483
|
var r = n.document;
|
|
3484
|
-
return
|
|
3484
|
+
return V(e, void 0, void 0, function() {
|
|
3485
3485
|
var e, t, n, i, a, o, s, c, l, u, d, f;
|
|
3486
|
-
return
|
|
3486
|
+
return H(this, function(p) {
|
|
3487
3487
|
for (e = r.body, e.style.fontSize = wn, t = r.createElement("div"), t.style.setProperty("visibility", "hidden", "important"), n = {}, i = {}, a = function(e) {
|
|
3488
3488
|
var n = r.createElement("span"), i = n.style;
|
|
3489
3489
|
return i.position = "absolute", i.top = "0", i.left = "0", i.fontFamily = e, n.textContent = Cn, t.appendChild(n), n;
|
|
@@ -3564,7 +3564,7 @@ function Pn(e, t) {
|
|
|
3564
3564
|
}
|
|
3565
3565
|
function Fn(e, t) {
|
|
3566
3566
|
e.width = 240, e.height = 60, t.textBaseline = "alphabetic", t.fillStyle = "#f60", t.fillRect(100, 1, 62, 20), t.fillStyle = "#069", t.font = "11pt \"Times New Roman\"";
|
|
3567
|
-
var n =
|
|
3567
|
+
var n = "Cwm fjordbank gly 😃";
|
|
3568
3568
|
t.fillText(n, 2, 15), t.fillStyle = "rgba(102, 204, 0, 0.2)", t.font = "18pt Arial", t.fillText(n, 4, 45);
|
|
3569
3569
|
}
|
|
3570
3570
|
function In(e, t) {
|
|
@@ -3599,7 +3599,7 @@ function Rn() {
|
|
|
3599
3599
|
}
|
|
3600
3600
|
function zn() {
|
|
3601
3601
|
var e = navigator, t = 0, n;
|
|
3602
|
-
e.maxTouchPoints === void 0 ? e.msMaxTouchPoints !== void 0 && (t = e.msMaxTouchPoints) : t =
|
|
3602
|
+
e.maxTouchPoints === void 0 ? e.msMaxTouchPoints !== void 0 && (t = e.msMaxTouchPoints) : t = At(e.maxTouchPoints);
|
|
3603
3603
|
try {
|
|
3604
3604
|
document.createEvent("TouchEvent"), n = !0;
|
|
3605
3605
|
} catch {
|
|
@@ -3628,14 +3628,14 @@ function Hn() {
|
|
|
3628
3628
|
return window.screen.colorDepth;
|
|
3629
3629
|
}
|
|
3630
3630
|
function Un() {
|
|
3631
|
-
return U(
|
|
3631
|
+
return W(U(navigator.deviceMemory), void 0);
|
|
3632
3632
|
}
|
|
3633
3633
|
function Wn() {
|
|
3634
3634
|
if (!(Y() && on() && en())) return Gn();
|
|
3635
3635
|
}
|
|
3636
3636
|
function Gn() {
|
|
3637
3637
|
var e = screen, t = function(e) {
|
|
3638
|
-
return
|
|
3638
|
+
return W(At(e), null);
|
|
3639
3639
|
}, n = [t(e.width), t(e.height)];
|
|
3640
3640
|
return n.sort().reverse(), n;
|
|
3641
3641
|
}
|
|
@@ -3652,11 +3652,11 @@ function Xn() {
|
|
|
3652
3652
|
function Zn() {
|
|
3653
3653
|
var e = this;
|
|
3654
3654
|
return Xn(), function() {
|
|
3655
|
-
return
|
|
3655
|
+
return V(e, void 0, void 0, function() {
|
|
3656
3656
|
var e;
|
|
3657
|
-
return
|
|
3657
|
+
return H(this, function(t) {
|
|
3658
3658
|
switch (t.label) {
|
|
3659
|
-
case 0: return e = $n(), er(e) ? Jn ? [2,
|
|
3659
|
+
case 0: return e = $n(), er(e) ? Jn ? [2, yt([], Jn, !0)] : cn() ? [4, ln()] : [3, 2] : [3, 2];
|
|
3660
3660
|
case 1: t.sent(), e = $n(), t.label = 2;
|
|
3661
3661
|
case 2: return er(e) || (Jn = e), [2, e];
|
|
3662
3662
|
}
|
|
@@ -3671,13 +3671,13 @@ function Qn() {
|
|
|
3671
3671
|
};
|
|
3672
3672
|
var t = Zn();
|
|
3673
3673
|
return function() {
|
|
3674
|
-
return
|
|
3674
|
+
return V(e, void 0, void 0, function() {
|
|
3675
3675
|
var e, n;
|
|
3676
|
-
return
|
|
3676
|
+
return H(this, function(r) {
|
|
3677
3677
|
switch (r.label) {
|
|
3678
3678
|
case 0: return [4, t()];
|
|
3679
3679
|
case 1: return e = r.sent(), n = function(e) {
|
|
3680
|
-
return e === null ? null :
|
|
3680
|
+
return e === null ? null : jt(e, qn);
|
|
3681
3681
|
}, [2, [
|
|
3682
3682
|
n(e[0]),
|
|
3683
3683
|
n(e[1]),
|
|
@@ -3692,10 +3692,10 @@ function Qn() {
|
|
|
3692
3692
|
function $n() {
|
|
3693
3693
|
var e = screen;
|
|
3694
3694
|
return [
|
|
3695
|
-
U(
|
|
3696
|
-
U(
|
|
3697
|
-
U(
|
|
3698
|
-
U(
|
|
3695
|
+
W(U(e.availTop), null),
|
|
3696
|
+
W(U(e.width) - U(e.availWidth) - W(U(e.availLeft), 0), null),
|
|
3697
|
+
W(U(e.height) - U(e.availHeight) - W(U(e.availTop), 0), null),
|
|
3698
|
+
W(U(e.availLeft), null)
|
|
3699
3699
|
];
|
|
3700
3700
|
}
|
|
3701
3701
|
function er(e) {
|
|
@@ -3703,7 +3703,7 @@ function er(e) {
|
|
|
3703
3703
|
return !0;
|
|
3704
3704
|
}
|
|
3705
3705
|
function tr() {
|
|
3706
|
-
return
|
|
3706
|
+
return W(At(navigator.hardwareConcurrency), void 0);
|
|
3707
3707
|
}
|
|
3708
3708
|
function nr() {
|
|
3709
3709
|
var e = window.Intl?.DateTimeFormat;
|
|
@@ -3716,7 +3716,7 @@ function nr() {
|
|
|
3716
3716
|
}
|
|
3717
3717
|
function rr() {
|
|
3718
3718
|
var e = (/* @__PURE__ */ new Date()).getFullYear();
|
|
3719
|
-
return Math.max(
|
|
3719
|
+
return Math.max(U(new Date(e, 0, 1).getTimezoneOffset()), U(new Date(e, 6, 1).getTimezoneOffset()));
|
|
3720
3720
|
}
|
|
3721
3721
|
function ir() {
|
|
3722
3722
|
try {
|
|
@@ -4076,16 +4076,16 @@ function pr() {
|
|
|
4076
4076
|
}
|
|
4077
4077
|
function mr(e) {
|
|
4078
4078
|
var t = (e === void 0 ? {} : e).debug;
|
|
4079
|
-
return
|
|
4079
|
+
return V(this, void 0, void 0, function() {
|
|
4080
4080
|
var e, n, r, i, a, o;
|
|
4081
|
-
return
|
|
4081
|
+
return H(this, function(s) {
|
|
4082
4082
|
switch (s.label) {
|
|
4083
4083
|
case 0: return hr() ? (e = pr(), n = Object.keys(e), r = (o = []).concat.apply(o, n.map(function(t) {
|
|
4084
4084
|
return e[t];
|
|
4085
4085
|
})), [4, gr(r)]) : [2, void 0];
|
|
4086
4086
|
case 1: return i = s.sent(), t && vr(e, i), a = n.filter(function(t) {
|
|
4087
4087
|
var n = e[t];
|
|
4088
|
-
return
|
|
4088
|
+
return G(n.map(function(e) {
|
|
4089
4089
|
return i[e];
|
|
4090
4090
|
})) > n.length * .6;
|
|
4091
4091
|
}), a.sort(), [2, a];
|
|
@@ -4098,14 +4098,14 @@ function hr() {
|
|
|
4098
4098
|
}
|
|
4099
4099
|
function gr(e) {
|
|
4100
4100
|
var t;
|
|
4101
|
-
return
|
|
4101
|
+
return V(this, void 0, void 0, function() {
|
|
4102
4102
|
var n, r, i, a, o, s, c, o;
|
|
4103
|
-
return
|
|
4103
|
+
return H(this, function(l) {
|
|
4104
4104
|
switch (l.label) {
|
|
4105
4105
|
case 0:
|
|
4106
4106
|
for (n = document, r = n.createElement("div"), i = Array(e.length), a = {}, _r(r), o = 0; o < e.length; ++o) s = bn(e[o]), s.tagName === "DIALOG" && s.show(), c = n.createElement("div"), _r(c), c.appendChild(s), r.appendChild(c), i[o] = s;
|
|
4107
4107
|
l.label = 1;
|
|
4108
|
-
case 1: return n.body ? [3, 3] : [4,
|
|
4108
|
+
case 1: return n.body ? [3, 3] : [4, xt(50)];
|
|
4109
4109
|
case 2: return l.sent(), [3, 1];
|
|
4110
4110
|
case 3:
|
|
4111
4111
|
n.body.appendChild(r);
|
|
@@ -4209,11 +4209,11 @@ function Pr() {
|
|
|
4209
4209
|
asin: n(.12312423423423424),
|
|
4210
4210
|
asinh: r(1),
|
|
4211
4211
|
asinhPf: function(e) {
|
|
4212
|
-
return X.log(e + X.sqrt(
|
|
4212
|
+
return X.log(e + X.sqrt(2));
|
|
4213
4213
|
}(1),
|
|
4214
4214
|
atanh: i(.5),
|
|
4215
4215
|
atanhPf: function(e) {
|
|
4216
|
-
return X.log(
|
|
4216
|
+
return X.log(3) / 2;
|
|
4217
4217
|
}(.5),
|
|
4218
4218
|
atan: a(.5),
|
|
4219
4219
|
sin: o(-1e300),
|
|
@@ -4229,7 +4229,7 @@ function Pr() {
|
|
|
4229
4229
|
tan: u(-1e300),
|
|
4230
4230
|
tanh: d(1),
|
|
4231
4231
|
tanhPf: function(e) {
|
|
4232
|
-
return (X.exp(2
|
|
4232
|
+
return (X.exp(2) - 1) / (X.exp(2) + 1);
|
|
4233
4233
|
}(1),
|
|
4234
4234
|
exp: f(1),
|
|
4235
4235
|
expm1: p(1),
|
|
@@ -4238,7 +4238,7 @@ function Pr() {
|
|
|
4238
4238
|
}(1),
|
|
4239
4239
|
log1p: m(10),
|
|
4240
4240
|
log1pPf: function(e) {
|
|
4241
|
-
return X.log(
|
|
4241
|
+
return X.log(11);
|
|
4242
4242
|
}(10),
|
|
4243
4243
|
powPI: function(e) {
|
|
4244
4244
|
return X.pow(X.PI, e);
|
|
@@ -4277,7 +4277,7 @@ function Rr(e, t) {
|
|
|
4277
4277
|
var i = r.document, a = i.body, o = a.style;
|
|
4278
4278
|
o.width = `${t}px`, o.webkitTextSizeAdjust = o.textSizeAdjust = "none", Qt() ? a.style.zoom = `${1 / r.devicePixelRatio}` : Y() && (a.style.zoom = "reset");
|
|
4279
4279
|
var s = i.createElement("div");
|
|
4280
|
-
return s.textContent =
|
|
4280
|
+
return s.textContent = yt([], Array(t / 20 | 0), !0).map(function() {
|
|
4281
4281
|
return "word";
|
|
4282
4282
|
}).join(" "), a.appendChild(s), e(i, a);
|
|
4283
4283
|
}, "<!doctype html><html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
|
|
@@ -4286,7 +4286,7 @@ function zr() {
|
|
|
4286
4286
|
return navigator.pdfViewerEnabled;
|
|
4287
4287
|
}
|
|
4288
4288
|
function Br() {
|
|
4289
|
-
var e = new Float32Array(1), t = new Uint8Array(e.buffer);
|
|
4289
|
+
var e = /* @__PURE__ */ new Float32Array(1), t = new Uint8Array(e.buffer);
|
|
4290
4290
|
return e[0] = Infinity, e[0] -= e[0], t[3];
|
|
4291
4291
|
}
|
|
4292
4292
|
function Vr() {
|
|
@@ -4308,7 +4308,7 @@ function Wr() {
|
|
|
4308
4308
|
var e = document.createElement("a"), t = e.attributionSourceId ?? e.attributionsourceid;
|
|
4309
4309
|
return t === void 0 ? void 0 : String(t);
|
|
4310
4310
|
}
|
|
4311
|
-
var Gr = -1, Kr = -2, qr = new Set([
|
|
4311
|
+
var Gr = -1, Kr = -2, qr = /* @__PURE__ */ new Set([
|
|
4312
4312
|
10752,
|
|
4313
4313
|
2849,
|
|
4314
4314
|
2884,
|
|
@@ -4390,7 +4390,7 @@ var Gr = -1, Kr = -2, qr = new Set([
|
|
|
4390
4390
|
7936,
|
|
4391
4391
|
7937,
|
|
4392
4392
|
7938
|
|
4393
|
-
]), Jr = new Set([
|
|
4393
|
+
]), Jr = /* @__PURE__ */ new Set([
|
|
4394
4394
|
34047,
|
|
4395
4395
|
35723,
|
|
4396
4396
|
36063,
|
|
@@ -4440,11 +4440,8 @@ function ei(e) {
|
|
|
4440
4440
|
var b = y[v];
|
|
4441
4441
|
if (!(b === Zr && ai() || b === Qr && oi())) {
|
|
4442
4442
|
var x = n.getExtension(b);
|
|
4443
|
-
if (!x)
|
|
4444
|
-
|
|
4445
|
-
continue;
|
|
4446
|
-
}
|
|
4447
|
-
for (var S = 0, C = ri(x); S < C.length; S++) {
|
|
4443
|
+
if (!x) a.push(b);
|
|
4444
|
+
else for (var S = 0, C = ri(x); S < C.length; S++) {
|
|
4448
4445
|
var g = C[S], _ = x[g];
|
|
4449
4446
|
c.push(`${g}=${_}${Jr.has(_) ? `=${n.getParameter(_)}` : ""}`);
|
|
4450
4447
|
}
|
|
@@ -4575,7 +4572,7 @@ function mi(e) {
|
|
|
4575
4572
|
return /^Win/.test(t) ? .6 : /^Mac/.test(t) ? .5 : .7;
|
|
4576
4573
|
}
|
|
4577
4574
|
function hi(e) {
|
|
4578
|
-
return
|
|
4575
|
+
return jt(.99 + .01 * e, 1e-4);
|
|
4579
4576
|
}
|
|
4580
4577
|
function gi(e) {
|
|
4581
4578
|
for (var t = "", n = 0, r = Object.keys(e).sort(); n < r.length; n++) {
|
|
@@ -4603,17 +4600,17 @@ function yi(e) {
|
|
|
4603
4600
|
},
|
|
4604
4601
|
confidence: pi(e),
|
|
4605
4602
|
components: e,
|
|
4606
|
-
version:
|
|
4603
|
+
version: bt
|
|
4607
4604
|
};
|
|
4608
4605
|
}
|
|
4609
4606
|
function bi(e) {
|
|
4610
|
-
return e === void 0 && (e = 50),
|
|
4607
|
+
return e === void 0 && (e = 50), Ct(e, e * 2);
|
|
4611
4608
|
}
|
|
4612
4609
|
function xi(e, t) {
|
|
4613
4610
|
return { get: function(n) {
|
|
4614
|
-
return
|
|
4611
|
+
return V(this, void 0, void 0, function() {
|
|
4615
4612
|
var r, i;
|
|
4616
|
-
return
|
|
4613
|
+
return H(this, function(a) {
|
|
4617
4614
|
switch (a.label) {
|
|
4618
4615
|
case 0: return [4, e()];
|
|
4619
4616
|
case 1: return r = a.sent(), i = yi(r), t || n?.debug, [2, i];
|
|
@@ -4625,13 +4622,13 @@ function xi(e, t) {
|
|
|
4625
4622
|
function Si() {
|
|
4626
4623
|
if (!(window.__fpjs_d_m || Math.random() >= .001)) try {
|
|
4627
4624
|
var e = new XMLHttpRequest();
|
|
4628
|
-
e.open("get", `https://m1.openfpcdn.io/fingerprintjs/v${
|
|
4625
|
+
e.open("get", `https://m1.openfpcdn.io/fingerprintjs/v${bt}/npm-monitoring`, !0), e.send();
|
|
4629
4626
|
} catch {}
|
|
4630
4627
|
}
|
|
4631
4628
|
function Ci(e) {
|
|
4632
|
-
return e === void 0 && (e = {}),
|
|
4629
|
+
return e === void 0 && (e = {}), V(this, void 0, void 0, function() {
|
|
4633
4630
|
var t, n, r;
|
|
4634
|
-
return
|
|
4631
|
+
return H(this, function(i) {
|
|
4635
4632
|
switch (i.label) {
|
|
4636
4633
|
case 0: return (e.monitoring ?? !0) && Si(), t = e.delayFallback, n = e.debug, [4, bi(t)];
|
|
4637
4634
|
case 1: return i.sent(), r = di({
|
|
@@ -4647,8 +4644,7 @@ var wi = {
|
|
|
4647
4644
|
hashComponents: vi,
|
|
4648
4645
|
componentsToDebugString: _i
|
|
4649
4646
|
};
|
|
4650
|
-
|
|
4651
|
-
//#region ../../packages/widget-sdk/src/api/request-options.ts
|
|
4647
|
+
// ../../packages/widget-sdk/src/api/request-options.ts
|
|
4652
4648
|
function Ti(e) {
|
|
4653
4649
|
return e.preview ? "include" : "same-origin";
|
|
4654
4650
|
}
|
|
@@ -4658,8 +4654,7 @@ function Ei(e) {
|
|
|
4658
4654
|
function Di(e, t) {
|
|
4659
4655
|
return t.configChannel === "draft" ? `${e}${e.includes("?") ? "&" : "?"}configChannel=draft` : e;
|
|
4660
4656
|
}
|
|
4661
|
-
|
|
4662
|
-
//#region ../../packages/widget-sdk/src/api/client.ts
|
|
4657
|
+
// ../../packages/widget-sdk/src/api/client.ts
|
|
4663
4658
|
var Oi = class {
|
|
4664
4659
|
baseUrl;
|
|
4665
4660
|
options;
|
|
@@ -4815,6 +4810,25 @@ var Oi = class {
|
|
|
4815
4810
|
if (!o.success) throw Error(o.error ?? "Upload failed");
|
|
4816
4811
|
return { url: o.data.url };
|
|
4817
4812
|
}
|
|
4813
|
+
async uploadVoiceNote(e, t, n, r, i) {
|
|
4814
|
+
let a = await fetch(this.channel(`${this.baseUrl}/v1/upload`), {
|
|
4815
|
+
method: "POST",
|
|
4816
|
+
credentials: this.credentials,
|
|
4817
|
+
headers: this.authHeaders(),
|
|
4818
|
+
body: JSON.stringify({
|
|
4819
|
+
file: e,
|
|
4820
|
+
mimeType: t,
|
|
4821
|
+
fileName: n,
|
|
4822
|
+
agentId: r,
|
|
4823
|
+
tenantId: i,
|
|
4824
|
+
kind: "audio"
|
|
4825
|
+
})
|
|
4826
|
+
});
|
|
4827
|
+
if (!a.ok) throw Error(`Upload error: ${a.status} ${a.statusText}`);
|
|
4828
|
+
let o = await a.json();
|
|
4829
|
+
if (!o.success) throw Error(o.error ?? "Upload failed");
|
|
4830
|
+
return { url: o.data.url };
|
|
4831
|
+
}
|
|
4818
4832
|
async fetchWidgetConfig(e, t) {
|
|
4819
4833
|
try {
|
|
4820
4834
|
let n = t ? `?tenantId=${encodeURIComponent(t)}` : "", r = await fetch(this.channel(`${this.baseUrl}/v1/agents/${encodeURIComponent(e)}/widget-config${n}`), { credentials: this.credentials });
|
|
@@ -4843,8 +4857,7 @@ var Oi = class {
|
|
|
4843
4857
|
if (!s.success) throw Error(s.error ?? "Failed to end session");
|
|
4844
4858
|
}
|
|
4845
4859
|
};
|
|
4846
|
-
|
|
4847
|
-
//#region ../../packages/widget-sdk/src/api/sse-reader.ts
|
|
4860
|
+
// ../../packages/widget-sdk/src/api/sse-reader.ts
|
|
4848
4861
|
async function* ki(e, t) {
|
|
4849
4862
|
if (!e.body) return;
|
|
4850
4863
|
let n = e.body.getReader(), r = new TextDecoder(), i = "", a = () => {
|
|
@@ -4870,8 +4883,7 @@ async function* ki(e, t) {
|
|
|
4870
4883
|
}
|
|
4871
4884
|
}
|
|
4872
4885
|
}
|
|
4873
|
-
|
|
4874
|
-
//#region ../../packages/widget-sdk/src/api/stream.ts
|
|
4886
|
+
// ../../packages/widget-sdk/src/api/stream.ts
|
|
4875
4887
|
var Ai = 12e4;
|
|
4876
4888
|
async function ji(e, t, n, r = {}) {
|
|
4877
4889
|
let i = "", a = !1;
|
|
@@ -4927,6 +4939,10 @@ async function ji(e, t, n, r = {}) {
|
|
|
4927
4939
|
let e = t.documents;
|
|
4928
4940
|
return e && n.onDocuments && n.onDocuments(e), !1;
|
|
4929
4941
|
}
|
|
4942
|
+
if (t.type === "voice_transcript") {
|
|
4943
|
+
let e = t.transcript;
|
|
4944
|
+
return e && n.onVoiceTranscript && n.onVoiceTranscript(e), !1;
|
|
4945
|
+
}
|
|
4930
4946
|
if (t.type === "control_mode") {
|
|
4931
4947
|
let e = t.mode, r = !!t.queued;
|
|
4932
4948
|
return e && n.onControlMode && n.onControlMode(e, r), r ? (n.onEnd(i), !0) : !1;
|
|
@@ -4987,8 +5003,7 @@ function Mi(e) {
|
|
|
4987
5003
|
}
|
|
4988
5004
|
return e.response || (e.text ?? e.content ?? "");
|
|
4989
5005
|
}
|
|
4990
|
-
|
|
4991
|
-
//#region ../../packages/widget-sdk/src/api/reconnect.ts
|
|
5006
|
+
// ../../packages/widget-sdk/src/api/reconnect.ts
|
|
4992
5007
|
function Ni(e, t, n) {
|
|
4993
5008
|
let r = t * 2 ** (e - 1), i = Math.min(r, n), a = i * .3;
|
|
4994
5009
|
return Math.floor(i - a + a * 2 * Math.random());
|
|
@@ -5016,14 +5031,13 @@ async function Fi(e, t, n, r = {}) {
|
|
|
5016
5031
|
}
|
|
5017
5032
|
throw a ?? /* @__PURE__ */ Error(`Failed to fetch run ${n}`);
|
|
5018
5033
|
}
|
|
5019
|
-
|
|
5020
|
-
//#region ../../packages/widget-sdk/src/api/turnstile.ts
|
|
5034
|
+
// ../../packages/widget-sdk/src/api/turnstile.ts
|
|
5021
5035
|
var Ii = 15e3, Q, Li, Ri, zi, Bi = [];
|
|
5022
5036
|
function Vi() {
|
|
5023
5037
|
zi || (zi = (e) => {
|
|
5024
5038
|
if (!Q || e.source !== Q.contentWindow || Ri && e.origin !== Ri) return;
|
|
5025
5039
|
let t = e.data;
|
|
5026
|
-
|
|
5040
|
+
t && typeof t.type == "string" && (t.type === "turnstile-token" && typeof t.token == "string" ? Bi.shift()?.resolve(t.token) : t.type === "turnstile-error" && Bi.shift()?.reject(Error(t.message ?? "Turnstile verification failed")));
|
|
5027
5041
|
}, window.addEventListener("message", zi));
|
|
5028
5042
|
}
|
|
5029
5043
|
function Hi() {
|
|
@@ -5064,8 +5078,7 @@ async function Wi(e) {
|
|
|
5064
5078
|
Bi.push(i), t.postMessage({ type: "turnstile-solve" }, n);
|
|
5065
5079
|
});
|
|
5066
5080
|
}
|
|
5067
|
-
|
|
5068
|
-
//#region ../../packages/widget-sdk/src/events/emitter.ts
|
|
5081
|
+
// ../../packages/widget-sdk/src/events/emitter.ts
|
|
5069
5082
|
var Gi = class {
|
|
5070
5083
|
listeners = /* @__PURE__ */ new Map();
|
|
5071
5084
|
on(e, t) {
|
|
@@ -5102,8 +5115,7 @@ function Xi(e) {
|
|
|
5102
5115
|
sessionStorage.removeItem(qi(e));
|
|
5103
5116
|
} catch {}
|
|
5104
5117
|
}
|
|
5105
|
-
|
|
5106
|
-
//#region ../../packages/widget-sdk/src/progress-trail.ts
|
|
5118
|
+
// ../../packages/widget-sdk/src/progress-trail.ts
|
|
5107
5119
|
function Zi(e, t, n) {
|
|
5108
5120
|
return e.map((e) => {
|
|
5109
5121
|
if (e.status !== "active" || e.stage === "calling_tool") return e;
|
|
@@ -5130,12 +5142,28 @@ function $i(e) {
|
|
|
5130
5142
|
let t = Math.floor(e / 6e4), n = Math.round(e % 6e4 / 1e3);
|
|
5131
5143
|
return n > 0 ? `${t}m ${n}s` : `${t}m`;
|
|
5132
5144
|
}
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
function
|
|
5145
|
+
// ../../packages/widget-sdk/src/voice-transcript.ts
|
|
5146
|
+
var ea = "[Voice note] ";
|
|
5147
|
+
function ta(e, t) {
|
|
5148
|
+
let n = t?.trim();
|
|
5149
|
+
return n ? `${ea}${e}\n\n${n}` : `${ea}${e}`;
|
|
5150
|
+
}
|
|
5151
|
+
function na(e) {
|
|
5152
|
+
if (!e.startsWith("[Voice note] ")) return null;
|
|
5153
|
+
let t = e.slice(13), n = t.indexOf("\n\n");
|
|
5154
|
+
return n === -1 ? {
|
|
5155
|
+
transcript: t,
|
|
5156
|
+
rest: ""
|
|
5157
|
+
} : {
|
|
5158
|
+
transcript: t.slice(0, n),
|
|
5159
|
+
rest: t.slice(n + 2)
|
|
5160
|
+
};
|
|
5161
|
+
}
|
|
5162
|
+
// ../../packages/widget-sdk/src/create-client.ts
|
|
5163
|
+
function ra() {
|
|
5136
5164
|
return `msg-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 7)}`;
|
|
5137
5165
|
}
|
|
5138
|
-
var
|
|
5166
|
+
var ia = 2e3, aa = class {
|
|
5139
5167
|
hostConfig;
|
|
5140
5168
|
onStateChange;
|
|
5141
5169
|
sessionTokenPromise;
|
|
@@ -5197,7 +5225,7 @@ var ta = 2e3, na = class {
|
|
|
5197
5225
|
e ? (this.ensureSessionToken(), this.openWithGreeting()) : this.setState({ isOpen: !1 });
|
|
5198
5226
|
}
|
|
5199
5227
|
openWithGreeting() {
|
|
5200
|
-
this.state.initStatus
|
|
5228
|
+
this.state.initStatus !== "error" && this.state.initStatus !== "disabled" && this.setState({ isOpen: !0 });
|
|
5201
5229
|
}
|
|
5202
5230
|
async hydrate() {
|
|
5203
5231
|
let e = await this.apiClient.validateWidget(this.config.agentId, this.config.tenantId);
|
|
@@ -5217,7 +5245,7 @@ var ta = 2e3, na = class {
|
|
|
5217
5245
|
}
|
|
5218
5246
|
if (!this.config.skipServerConfigFetch) {
|
|
5219
5247
|
let e = await this.apiClient.fetchWidgetConfig(this.config.agentId, this.config.tenantId);
|
|
5220
|
-
e && (this.config =
|
|
5248
|
+
e && (this.config = gt(this.hostConfig, e), this.onStateChange(this.getState(), this.config));
|
|
5221
5249
|
}
|
|
5222
5250
|
if (this.setState({ initStatus: "ready" }), !this.state.sessionId) return;
|
|
5223
5251
|
this.openEventStream();
|
|
@@ -5232,10 +5260,10 @@ var ta = 2e3, na = class {
|
|
|
5232
5260
|
url: e.url,
|
|
5233
5261
|
mimeType: e.mimeType,
|
|
5234
5262
|
fileName: e.fileName,
|
|
5235
|
-
kind: e.mimeType.startsWith("image/") ? "image" : "file"
|
|
5263
|
+
kind: e.mimeType.startsWith("image/") ? "image" : e.mimeType.startsWith("audio/") ? "audio" : "file"
|
|
5236
5264
|
})) : void 0;
|
|
5237
5265
|
return {
|
|
5238
|
-
id:
|
|
5266
|
+
id: ra(),
|
|
5239
5267
|
role: e.role,
|
|
5240
5268
|
content: e.content,
|
|
5241
5269
|
images: !n && e.images && e.images.length > 0 ? e.images : void 0,
|
|
@@ -5272,7 +5300,7 @@ var ta = 2e3, na = class {
|
|
|
5272
5300
|
if (typeof e.content != "string" || e.id && this.state.messages.some((t) => t.id === e.id)) return;
|
|
5273
5301
|
if (e.direction === "human") {
|
|
5274
5302
|
let t = {
|
|
5275
|
-
id: e.id ??
|
|
5303
|
+
id: e.id ?? ra(),
|
|
5276
5304
|
role: "assistant",
|
|
5277
5305
|
content: e.content,
|
|
5278
5306
|
createdAt: e.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -5288,7 +5316,7 @@ var ta = 2e3, na = class {
|
|
|
5288
5316
|
}
|
|
5289
5317
|
if (e.direction === "ai") {
|
|
5290
5318
|
let t = {
|
|
5291
|
-
id: e.id ??
|
|
5319
|
+
id: e.id ?? ra(),
|
|
5292
5320
|
role: "assistant",
|
|
5293
5321
|
content: e.content,
|
|
5294
5322
|
createdAt: e.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -5345,7 +5373,7 @@ var ta = 2e3, na = class {
|
|
|
5345
5373
|
if (this.state.isLoading || !n || this.state.initStatus !== "ready") return;
|
|
5346
5374
|
let r = [];
|
|
5347
5375
|
if (t && t.length > 0) for (let e of t) try {
|
|
5348
|
-
let t = await
|
|
5376
|
+
let t = await sa(e.file);
|
|
5349
5377
|
if (e.kind === "image") {
|
|
5350
5378
|
let n = await this.apiClient.uploadImage(t, e.file.type, e.file.name, this.config.agentId, this.config.tenantId);
|
|
5351
5379
|
r.push({
|
|
@@ -5354,6 +5382,15 @@ var ta = 2e3, na = class {
|
|
|
5354
5382
|
fileName: e.file.name,
|
|
5355
5383
|
kind: "image"
|
|
5356
5384
|
});
|
|
5385
|
+
} else if (e.kind === "audio") {
|
|
5386
|
+
let n = await this.apiClient.uploadVoiceNote(t, e.file.type || "audio/webm", e.file.name, this.config.agentId, this.config.tenantId);
|
|
5387
|
+
r.push({
|
|
5388
|
+
url: n.url,
|
|
5389
|
+
mimeType: e.file.type || "audio/webm",
|
|
5390
|
+
fileName: e.file.name,
|
|
5391
|
+
durationMs: e.durationMs,
|
|
5392
|
+
kind: "audio"
|
|
5393
|
+
});
|
|
5357
5394
|
} else {
|
|
5358
5395
|
let n = await this.apiClient.uploadFile(t, e.file.type || "application/octet-stream", e.file.name, this.config.agentId, this.config.tenantId);
|
|
5359
5396
|
r.push({
|
|
@@ -5369,7 +5406,7 @@ var ta = 2e3, na = class {
|
|
|
5369
5406
|
return;
|
|
5370
5407
|
}
|
|
5371
5408
|
let i = r.filter((e) => e.kind === "image"), a = {
|
|
5372
|
-
id:
|
|
5409
|
+
id: ra(),
|
|
5373
5410
|
role: "user",
|
|
5374
5411
|
content: e.trim(),
|
|
5375
5412
|
uploadedImageUrl: i[0]?.url,
|
|
@@ -5399,7 +5436,7 @@ var ta = 2e3, na = class {
|
|
|
5399
5436
|
if (!this.config.turnstileSiteKey || this.apiClient.hasValidSessionToken()) return;
|
|
5400
5437
|
let e;
|
|
5401
5438
|
await Promise.race([this.ensureSessionToken(), new Promise((t) => {
|
|
5402
|
-
e = setTimeout(t,
|
|
5439
|
+
e = setTimeout(t, ia);
|
|
5403
5440
|
})]).finally(() => clearTimeout(e));
|
|
5404
5441
|
}
|
|
5405
5442
|
async sendNonStreaming(e, t, n, r = !1) {
|
|
@@ -5428,7 +5465,7 @@ var ta = 2e3, na = class {
|
|
|
5428
5465
|
return;
|
|
5429
5466
|
}
|
|
5430
5467
|
let i = {
|
|
5431
|
-
id:
|
|
5468
|
+
id: ra(),
|
|
5432
5469
|
role: "assistant",
|
|
5433
5470
|
content: r.content,
|
|
5434
5471
|
images: r.images,
|
|
@@ -5455,7 +5492,7 @@ var ta = 2e3, na = class {
|
|
|
5455
5492
|
}
|
|
5456
5493
|
async sendStreaming(e, t, n, r = !1) {
|
|
5457
5494
|
await this.awaitSessionToken();
|
|
5458
|
-
let i =
|
|
5495
|
+
let i = ra(), a = {
|
|
5459
5496
|
id: i,
|
|
5460
5497
|
role: "assistant",
|
|
5461
5498
|
content: "",
|
|
@@ -5490,8 +5527,12 @@ var ta = 2e3, na = class {
|
|
|
5490
5527
|
onDocuments: (e) => {
|
|
5491
5528
|
this.updateMessage(i, { documents: e });
|
|
5492
5529
|
},
|
|
5530
|
+
onVoiceTranscript: (e) => {
|
|
5531
|
+
let t = [...this.state.messages].reverse().find((e) => e.role === "user");
|
|
5532
|
+
t && this.updateMessage(t.id, { content: ta(e, t.content) });
|
|
5533
|
+
},
|
|
5493
5534
|
onToolCallsStarted: (e, t) => {
|
|
5494
|
-
t && c === null && (c = t), d = null, this.updateMessage(i, { answerStartedAtMs: null }), (t ?? c) !== "off" && this.updateMessage(i, { toolStatus:
|
|
5535
|
+
t && c === null && (c = t), d = null, this.updateMessage(i, { answerStartedAtMs: null }), (t ?? c) !== "off" && this.updateMessage(i, { toolStatus: oa(e) });
|
|
5495
5536
|
},
|
|
5496
5537
|
onAck: (e) => {
|
|
5497
5538
|
this.updateMessage(i, { ackText: e });
|
|
@@ -5608,13 +5649,9 @@ var ta = 2e3, na = class {
|
|
|
5608
5649
|
let t = this.state.messages.find((e) => e.id === i);
|
|
5609
5650
|
t && this.emitter.emit("message:received", t);
|
|
5610
5651
|
}, a = this.state.messages.find((e) => e.id === i)?.runId, s = this.state.sessionId;
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
}).catch(() => t(e.message || "Something went wrong. Please try again."));
|
|
5615
|
-
return;
|
|
5616
|
-
}
|
|
5617
|
-
t(e.message || "Something went wrong. Please try again.");
|
|
5652
|
+
a && s ? Fi(this.config.apiBaseUrl, s, a, { preview: this.config.preview }).then((r) => {
|
|
5653
|
+
r.status === "done" && r.finalText ? n(r.finalText) : t(r.errorMessage || e.message || "Something went wrong. Please try again.");
|
|
5654
|
+
}).catch(() => t(e.message || "Something went wrong. Please try again.")) : t(e.message || "Something went wrong. Please try again.");
|
|
5618
5655
|
}
|
|
5619
5656
|
}, {
|
|
5620
5657
|
preview: this.config.preview,
|
|
@@ -5623,13 +5660,13 @@ var ta = 2e3, na = class {
|
|
|
5623
5660
|
}), o && (this.handleSessionExpired(), await this.sendStreaming(e, t, n, !0));
|
|
5624
5661
|
}
|
|
5625
5662
|
};
|
|
5626
|
-
function
|
|
5663
|
+
function oa(e) {
|
|
5627
5664
|
let t = e[0];
|
|
5628
5665
|
if (!t) return "Working...";
|
|
5629
5666
|
let n = t.indexOf(".");
|
|
5630
5667
|
return n > 0 ? `Using ${t.slice(0, n).replace(/_/g, " ")}: ${t.slice(n + 1).replace(/_/g, " ")}${e.length > 1 ? ` +${e.length - 1}` : ""}` : `Using ${t.replace(/_/g, " ")}`;
|
|
5631
5668
|
}
|
|
5632
|
-
function
|
|
5669
|
+
function sa(e) {
|
|
5633
5670
|
return new Promise((t, n) => {
|
|
5634
5671
|
let r = new FileReader();
|
|
5635
5672
|
r.onload = () => {
|
|
@@ -5638,9 +5675,8 @@ function ia(e) {
|
|
|
5638
5675
|
}, r.onerror = () => n(/* @__PURE__ */ Error("Failed to read file")), r.readAsDataURL(e);
|
|
5639
5676
|
});
|
|
5640
5677
|
}
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
function aa(e) {
|
|
5678
|
+
// ../../packages/widget-sdk/src/dom/shadow-root.ts
|
|
5679
|
+
function ca(e) {
|
|
5644
5680
|
let t = document.createElement("div");
|
|
5645
5681
|
t.setAttribute("data-agentkit-widget", ""), e.appendChild(t);
|
|
5646
5682
|
let n = t.attachShadow({ mode: "open" }), r = document.createElement("style");
|
|
@@ -5653,53 +5689,39 @@ function aa(e) {
|
|
|
5653
5689
|
mountPoint: i
|
|
5654
5690
|
};
|
|
5655
5691
|
}
|
|
5656
|
-
function
|
|
5692
|
+
function la(e, t) {
|
|
5657
5693
|
e.textContent = t;
|
|
5658
5694
|
}
|
|
5659
|
-
function
|
|
5695
|
+
function ua(e) {
|
|
5660
5696
|
e.remove();
|
|
5661
5697
|
}
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
function ca(e) {
|
|
5698
|
+
// ../../packages/widget-sdk/src/dom/mount.ts
|
|
5699
|
+
function da(e) {
|
|
5665
5700
|
document.body ? document.body.appendChild(e) : document.addEventListener("DOMContentLoaded", () => document.body.appendChild(e), { once: !0 });
|
|
5666
5701
|
}
|
|
5667
|
-
function
|
|
5702
|
+
function fa() {
|
|
5668
5703
|
let e = document.createElement("div");
|
|
5669
|
-
return e.setAttribute("data-agentkit-root", "floating"), e.style.cssText =
|
|
5670
|
-
"position: fixed",
|
|
5671
|
-
"bottom: 24px",
|
|
5672
|
-
"right: 24px",
|
|
5673
|
-
"z-index: 2147483647",
|
|
5674
|
-
"pointer-events: none"
|
|
5675
|
-
].join("; "), ca(e), e;
|
|
5704
|
+
return e.setAttribute("data-agentkit-root", "floating"), e.style.cssText = "position: fixed; bottom: 24px; right: 24px; z-index: 2147483647; pointer-events: none", da(e), e;
|
|
5676
5705
|
}
|
|
5677
|
-
function
|
|
5706
|
+
function pa(e) {
|
|
5678
5707
|
getComputedStyle(e).position === "static" && (e.style.position = "relative");
|
|
5679
5708
|
let t = document.createElement("div");
|
|
5680
|
-
return t.setAttribute("data-agentkit-root", "floating"), t.style.cssText =
|
|
5681
|
-
"position: absolute",
|
|
5682
|
-
"bottom: 24px",
|
|
5683
|
-
"right: 24px",
|
|
5684
|
-
"z-index: 2147483647",
|
|
5685
|
-
"pointer-events: none"
|
|
5686
|
-
].join("; "), e.appendChild(t), t;
|
|
5709
|
+
return t.setAttribute("data-agentkit-root", "floating"), t.style.cssText = "position: absolute; bottom: 24px; right: 24px; z-index: 2147483647; pointer-events: none", e.appendChild(t), t;
|
|
5687
5710
|
}
|
|
5688
|
-
function
|
|
5711
|
+
function ma(e) {
|
|
5689
5712
|
return e.setAttribute("data-agentkit-root", "inline"), getComputedStyle(e).position === "static" && (e.style.position = "relative"), e;
|
|
5690
5713
|
}
|
|
5691
|
-
function
|
|
5714
|
+
function ha(e) {
|
|
5692
5715
|
e.remove();
|
|
5693
5716
|
}
|
|
5694
|
-
function
|
|
5717
|
+
function ga(e) {
|
|
5695
5718
|
e.removeAttribute("data-agentkit-root");
|
|
5696
5719
|
}
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
let l = new na(e, t, (e, t) => {
|
|
5720
|
+
// ../../packages/widget-sdk/src/create-widget.ts
|
|
5721
|
+
function _a(e, t, n, r, i) {
|
|
5722
|
+
let a = e.mode === "inline", o = !1, s = a && i ? ma(i) : !a && i ? pa(i) : fa(), c = ca(s);
|
|
5723
|
+
la(c.styleSlot, r);
|
|
5724
|
+
let l = new aa(e, t, (e, t) => {
|
|
5703
5725
|
o || u.update(e, t);
|
|
5704
5726
|
}), u = n(c.mountPoint, e, l.getState(), {
|
|
5705
5727
|
onOpen: () => d.open(),
|
|
@@ -5731,7 +5753,7 @@ function ma(e, t, n, r, i) {
|
|
|
5731
5753
|
o || (l.resetConversation(), l.emitter.emit("reset"));
|
|
5732
5754
|
},
|
|
5733
5755
|
destroy() {
|
|
5734
|
-
o || (o = !0, l.closeEventStream(), u.destroy(),
|
|
5756
|
+
o || (o = !0, l.closeEventStream(), u.destroy(), ua(c.host), a && i ? ga(i) : ha(s), l.emitter.emit("destroy"), l.emitter.removeAllListeners());
|
|
5735
5757
|
},
|
|
5736
5758
|
on(e, t) {
|
|
5737
5759
|
l.emitter.on(e, t);
|
|
@@ -5745,45 +5767,43 @@ function ma(e, t, n, r, i) {
|
|
|
5745
5767
|
};
|
|
5746
5768
|
return d;
|
|
5747
5769
|
}
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
let t = `agentkit-widget-${++ga}`, n = e.destroy.bind(e);
|
|
5770
|
+
// ../../packages/widget-sdk/src/init.ts
|
|
5771
|
+
var va = /* @__PURE__ */ new Map(), ya = 0;
|
|
5772
|
+
function ba(e) {
|
|
5773
|
+
let t = `agentkit-widget-${++ya}`, n = e.destroy.bind(e);
|
|
5753
5774
|
return e.destroy = () => {
|
|
5754
|
-
|
|
5755
|
-
},
|
|
5775
|
+
va.delete(t), n();
|
|
5776
|
+
}, va.set(t, e), t;
|
|
5756
5777
|
}
|
|
5757
|
-
function
|
|
5778
|
+
function xa(e, t, n) {
|
|
5758
5779
|
let r = {
|
|
5759
5780
|
...e,
|
|
5760
5781
|
mode: "floating"
|
|
5761
|
-
}, i =
|
|
5762
|
-
return
|
|
5782
|
+
}, i = _a(gt(r), r, t, n);
|
|
5783
|
+
return ba(i), i;
|
|
5763
5784
|
}
|
|
5764
|
-
function
|
|
5785
|
+
function Sa(e, t, n, r) {
|
|
5765
5786
|
let i = {
|
|
5766
5787
|
...t,
|
|
5767
5788
|
mode: "floating"
|
|
5768
|
-
}, a =
|
|
5769
|
-
return
|
|
5789
|
+
}, a = _a(gt(i), i, n, r, e);
|
|
5790
|
+
return ba(a), a;
|
|
5770
5791
|
}
|
|
5771
|
-
function
|
|
5792
|
+
function Ca(e, t, n, r) {
|
|
5772
5793
|
let i = {
|
|
5773
5794
|
...t,
|
|
5774
5795
|
mode: "inline"
|
|
5775
|
-
}, a =
|
|
5776
|
-
return
|
|
5796
|
+
}, a = _a(gt(i), i, n, r, e);
|
|
5797
|
+
return ba(a), a;
|
|
5777
5798
|
}
|
|
5778
|
-
function
|
|
5779
|
-
e ?
|
|
5799
|
+
function wa(e) {
|
|
5800
|
+
e ? va.get(e)?.destroy() : (va.forEach((e) => e.destroy()), va.clear());
|
|
5780
5801
|
}
|
|
5781
|
-
function
|
|
5782
|
-
return Array.from(
|
|
5802
|
+
function Ta() {
|
|
5803
|
+
return Array.from(va.keys());
|
|
5783
5804
|
}
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
function Ca(e) {
|
|
5805
|
+
// ../../packages/widget-ui/src/theme/tokens.ts
|
|
5806
|
+
function Ea(e) {
|
|
5787
5807
|
let { theme: t } = e, n = [
|
|
5788
5808
|
`--ak-accent: ${t.accentColor}`,
|
|
5789
5809
|
`--ak-font: ${t.fontFamily}`,
|
|
@@ -5791,15 +5811,13 @@ function Ca(e) {
|
|
|
5791
5811
|
];
|
|
5792
5812
|
return n.push(`--ak-accent-hover: color-mix(in srgb, ${t.accentColor} 85%, black)`), `:host { ${n.join("; ")} }`;
|
|
5793
5813
|
}
|
|
5794
|
-
function
|
|
5814
|
+
function Da(e) {
|
|
5795
5815
|
return e === "system" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : e;
|
|
5796
5816
|
}
|
|
5797
|
-
|
|
5798
|
-
//#region ../../packages/widget-ui/src/theme/styles.ts
|
|
5799
|
-
var Ta = "\n*, *::before, *::after {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\n:host {\n --ak-accent: #6366f1;\n --ak-accent-hover: #4f46e5;\n --ak-bg: #ffffff;\n --ak-surface: #f9fafb;\n --ak-text: #111827;\n --ak-text-muted: #6b7280;\n --ak-border: #e5e7eb;\n --ak-user-bg: var(--ak-accent);\n --ak-user-text: #ffffff;\n --ak-bot-bg: #f3f4f6;\n --ak-bot-text: #111827;\n --ak-maintenance-fg: #92400e;\n --ak-maintenance-bg: #fffbeb;\n --ak-maintenance-halo: #fcd34d;\n --ak-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n --ak-radius: 12px;\n /* Chat surface texture — scattered line doodles, tiled. Neutral stroke (not accent-tinted)\n so it stays a texture rather than competing with brand colour. Alpha is baked into the\n SVG stroke, so the light/dark variants differ only in stroke rgba. */\n --ak-pattern: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(0,0,0,0.045)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 30c5-8 14-8 19 0s14 8 19 0'/%3E%3Ccircle cx='96' cy='22' r='8'/%3E%3Cpath d='M150 34l6-11 6 11z'/%3E%3Cpath d='M196 18v14M189 25h14'/%3E%3Cpath d='M28 74h22M28 81h14'/%3E%3Cpath d='M84 68l8-8 8 8-8 8z'/%3E%3Cpath d='M186 76c0 7-6 12-13 12h-10l-6 6v-6c-5-1-8-6-8-12 0-7 6-12 13-12h11c7 0 13 5 13 12z'/%3E%3Ccircle cx='124' cy='104' r='5'/%3E%3Cpath d='M18 122c7-5 14-5 21 0'/%3E%3Cpath d='M62 132l7-13 7 13z'/%3E%3Cpath d='M106 156h20M106 163h12'/%3E%3Ccircle cx='176' cy='140' r='8'/%3E%3Cpath d='M32 170l6-6 6 6-6 6z'/%3E%3Cpath d='M148 196c5-7 13-7 18 0'/%3E%3Cpath d='M74 196v12M68 202h12'/%3E%3Ccircle cx='206' cy='178' r='4.5'/%3E%3Ccircle cx='58' cy='48' r='4'/%3E%3Cpath d='M128 56h16M128 62h10'/%3E%3Cpath d='M40 100l5-5 5 5-5 5z'/%3E%3Cpath d='M150 116c5-6 12-6 17 0'/%3E%3Ccircle cx='92' cy='128' r='4'/%3E%3Cpath d='M198 108v11M193 113h11'/%3E%3Cpath d='M8 148c5-7 12-7 17 0'/%3E%3Ccircle cx='142' cy='176' r='4'/%3E%3Cpath d='M76 166h16M76 172h9'/%3E%3Cpath d='M186 208l5-9 5 9z'/%3E%3Cpath d='M110 190l6-6 6 6-6 6z'/%3E%3Ccircle cx='46' cy='206' r='5'/%3E%3C/svg%3E\");\n --ak-pattern-size: 210px;\n --ak-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.08);\n --ak-launcher-size: 56px;\n /* Panel-to-launcher offset. Negative pulls the launcher up toward the panel.\n Applied as a margin on .ak-shell-wrap because CSS gap rejects negatives. */\n --ak-launcher-gap: -12px;\n font-family: var(--ak-font);\n -webkit-font-smoothing: antialiased;\n}\n\n/* Dark mode — set data-theme=\"dark\" on the shadow host element.\n Slate palette, aligned with the KlicForge dashboard dark tokens. */\n:host([data-theme=\"dark\"]) {\n --ak-bg: #0f172a; /* slate-900 — panel surface */\n --ak-surface: #1e293b; /* slate-800 — inputs, insets (lift off panel) */\n --ak-text: #f1f5f9; /* slate-100 */\n --ak-text-muted: #94a3b8;/* slate-400 */\n --ak-border: #334155; /* slate-700 */\n --ak-bot-bg: #1e293b; /* slate-800 — assistant bubble */\n --ak-bot-text: #f1f5f9; /* slate-100 */\n /* Same doodle tile, white stroke — dark surfaces need ~1.5x the alpha to read the same */\n --ak-pattern: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(255,255,255,0.07)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 30c5-8 14-8 19 0s14 8 19 0'/%3E%3Ccircle cx='96' cy='22' r='8'/%3E%3Cpath d='M150 34l6-11 6 11z'/%3E%3Cpath d='M196 18v14M189 25h14'/%3E%3Cpath d='M28 74h22M28 81h14'/%3E%3Cpath d='M84 68l8-8 8 8-8 8z'/%3E%3Cpath d='M186 76c0 7-6 12-13 12h-10l-6 6v-6c-5-1-8-6-8-12 0-7 6-12 13-12h11c7 0 13 5 13 12z'/%3E%3Ccircle cx='124' cy='104' r='5'/%3E%3Cpath d='M18 122c7-5 14-5 21 0'/%3E%3Cpath d='M62 132l7-13 7 13z'/%3E%3Cpath d='M106 156h20M106 163h12'/%3E%3Ccircle cx='176' cy='140' r='8'/%3E%3Cpath d='M32 170l6-6 6 6-6 6z'/%3E%3Cpath d='M148 196c5-7 13-7 18 0'/%3E%3Cpath d='M74 196v12M68 202h12'/%3E%3Ccircle cx='206' cy='178' r='4.5'/%3E%3Ccircle cx='58' cy='48' r='4'/%3E%3Cpath d='M128 56h16M128 62h10'/%3E%3Cpath d='M40 100l5-5 5 5-5 5z'/%3E%3Cpath d='M150 116c5-6 12-6 17 0'/%3E%3Ccircle cx='92' cy='128' r='4'/%3E%3Cpath d='M198 108v11M193 113h11'/%3E%3Cpath d='M8 148c5-7 12-7 17 0'/%3E%3Ccircle cx='142' cy='176' r='4'/%3E%3Cpath d='M76 166h16M76 172h9'/%3E%3Cpath d='M186 208l5-9 5 9z'/%3E%3Cpath d='M110 190l6-6 6 6-6 6z'/%3E%3Ccircle cx='46' cy='206' r='5'/%3E%3C/svg%3E\");\n --ak-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);\n --ak-maintenance-fg: #fde68a;\n --ak-maintenance-bg: rgba(253, 230, 138, 0.06);\n --ak-maintenance-halo: #f59e0b;\n}\n\n/* ── Floating layout ─────────────────────────────────────────── */\n.ak-floating {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 0;\n pointer-events: none;\n}\n.ak-floating > * {\n pointer-events: all;\n}\n\n/* ── Inline layout ───────────────────────────────────────────── */\n.ak-inline {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 400px;\n max-height: 100%;\n}\n\n/* ── Launcher button ─────────────────────────────────────────── */\n.ak-launcher {\n width: var(--ak-launcher-size);\n height: var(--ak-launcher-size);\n border-radius: 50%;\n background: var(--ak-accent);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);\n transition: background 0.2s, transform 0.15s, box-shadow 0.2s;\n flex-shrink: 0;\n}\n.ak-launcher:hover {\n background: var(--ak-accent-hover);\n transform: scale(1.08);\n box-shadow: 0 6px 24px rgba(99, 102, 241, 0.55);\n}\n.ak-launcher:active {\n transform: scale(0.95);\n}\n.ak-launcher svg {\n pointer-events: none;\n}\n/* Launcher showing avatar image instead of chat icon */\n.ak-launcher--avatar {\n padding: 0;\n overflow: hidden;\n}\n.ak-launcher__avatar-img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: 50%;\n pointer-events: none;\n}\n\n/* ── Shell wrapper (positions the hanging branding tab) ─────── */\n.ak-shell-wrap {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n margin-bottom: var(--ak-launcher-gap);\n}\n\n/* ── Widget shell / panel ────────────────────────────────────── */\n.ak-shell {\n background: var(--ak-bg);\n border-radius: var(--ak-radius);\n box-shadow: var(--ak-shadow);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n border: 1px solid var(--ak-border);\n}\n.ak-shell--floating {\n width: 380px;\n height: 580px;\n}\n.ak-shell--inline {\n width: 100%;\n height: 100%;\n min-height: 400px;\n max-height: 100%;\n border-radius: 0;\n box-shadow: none;\n border: none;\n display: flex;\n flex-direction: column;\n}\n/* Inline shell-wrap fills its container and suppresses the duplicate widget header\n (the sidebar already renders its own header and close button). */\n.ak-inline .ak-shell-wrap {\n width: 100%;\n height: 100%;\n /* No launcher in inline mode — the negative offset would overflow the host. */\n margin-bottom: 0;\n}\n.ak-inline .ak-header {\n display: none;\n}\n.ak-shell-enter {\n animation: ak-panel-in 0.2s ease-out;\n}\n@keyframes ak-panel-in {\n from { opacity: 0; transform: translateY(10px) scale(0.97); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n}\n\n/* ── Header ──────────────────────────────────────────────────── */\n.ak-header {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 10px 14px;\n background: var(--ak-accent);\n color: #fff;\n flex-shrink: 0;\n gap: 8px;\n}\n.ak-header--confirming {\n flex-direction: column;\n align-items: stretch;\n justify-content: flex-start;\n gap: 0;\n}\n.ak-header__row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n gap: 8px;\n}\n.ak-header__status {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: #4ade80;\n flex-shrink: 0;\n}\n.ak-header__title-group {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 1px;\n min-width: 0;\n}\n.ak-header__title {\n font-size: 15px;\n font-weight: 600;\n letter-spacing: -0.01em;\n}\n.ak-header__subtitle {\n font-size: 11px;\n font-weight: 400;\n opacity: 0.8;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ak-header__close {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n transition: background 0.15s;\n flex-shrink: 0;\n}\n.ak-header__close:hover {\n background: rgba(255, 255, 255, 0.35);\n}\n.ak-header__avatar {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n object-fit: cover;\n flex-shrink: 0;\n border: 2px solid rgba(255, 255, 255, 0.3);\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__bot-icon {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n flex-shrink: 0;\n}\n.ak-header__button {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n transition: background 0.15s;\n flex-shrink: 0;\n}\n.ak-header__button:hover {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__button--active {\n background: rgba(255, 255, 255, 0.3);\n}\n.ak-header__confirm {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 8px 0 0;\n margin: 8px 0 0;\n border-top: 1px solid rgba(255, 255, 255, 0.2);\n animation: ak-confirm-in 0.18s ease-out;\n}\n@keyframes ak-confirm-in {\n from { opacity: 0; transform: translateY(-4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.ak-header__confirm-text {\n display: flex;\n flex-direction: column;\n gap: 1px;\n flex: 1;\n min-width: 0;\n}\n.ak-header__confirm-title {\n font-size: 13px;\n font-weight: 600;\n color: #fff;\n line-height: 1.3;\n}\n.ak-header__confirm-sub {\n font-size: 11px;\n color: rgba(255, 255, 255, 0.75);\n line-height: 1.3;\n}\n.ak-header__confirm-actions {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-shrink: 0;\n}\n.ak-header__confirm-cancel {\n padding: 5px 10px;\n border-radius: 6px;\n border: 1px solid rgba(255, 255, 255, 0.4);\n background: transparent;\n color: #fff;\n font-family: var(--ak-font);\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.15s;\n white-space: nowrap;\n}\n.ak-header__confirm-cancel:hover {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__confirm-cancel:active {\n background: rgba(255, 255, 255, 0.25);\n}\n.ak-header__confirm-ok {\n padding: 5px 10px;\n border-radius: 6px;\n border: none;\n background: rgba(255, 255, 255, 0.2);\n color: #fff;\n font-family: var(--ak-font);\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n transition: background 0.15s;\n white-space: nowrap;\n}\n.ak-header__confirm-ok:hover {\n background: rgba(239, 68, 68, 0.7);\n}\n.ak-header__confirm-ok:active {\n background: rgba(239, 68, 68, 0.85);\n}\n\n/* ── Message list ────────────────────────────────────────────── */\n.ak-messages {\n flex: 1;\n overflow-y: auto;\n padding: 12px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n scroll-behavior: smooth;\n min-height: 0; /* Allow flex child to shrink below its content height */\n /* Faint doodle texture so bubbles read as objects on a surface, not floating on flat colour.\n background-attachment defaults to scroll = anchored to the padding box, so the\n pattern stays put while messages scroll. */\n background-image: var(--ak-pattern);\n background-size: var(--ak-pattern-size) var(--ak-pattern-size);\n}\n.ak-messages::-webkit-scrollbar { width: 4px; }\n.ak-messages::-webkit-scrollbar-track { background: transparent; }\n.ak-messages::-webkit-scrollbar-thumb {\n background: var(--ak-border);\n border-radius: 4px;\n}\n\n/* ── Empty state ─────────────────────────────────────────────── */\n.ak-empty-state {\n flex: 1;\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: safe center;\n padding: 16px;\n text-align: center;\n gap: 16px;\n overflow-y: auto;\n overflow-x: hidden;\n min-height: 0;\n /* Glow layer is translucent so the same doodle texture as .ak-messages shows through —\n keeps empty state and message list on one continuous surface. */\n background-color: var(--ak-bg);\n background-image:\n radial-gradient(ellipse 110% 55% at 50% 0%,\n color-mix(in srgb, var(--ak-accent) 10%, transparent),\n transparent 72%\n ),\n var(--ak-pattern);\n background-size: auto, var(--ak-pattern-size) var(--ak-pattern-size);\n}\n/* Decorative blurred orb behind the avatar */\n.ak-empty-state__glow {\n position: absolute;\n top: -24px;\n left: 50%;\n transform: translateX(-50%);\n width: 180px;\n height: 180px;\n border-radius: 50%;\n background: color-mix(in srgb, var(--ak-accent) 18%, transparent);\n filter: blur(48px);\n pointer-events: none;\n}\n.ak-empty-state__body {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n position: relative;\n width: 100%;\n}\n.ak-empty-state__avatar {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n background: var(--ak-bg);\n border: 2px solid color-mix(in srgb, var(--ak-accent) 25%, var(--ak-border));\n box-shadow:\n 0 0 0 4px color-mix(in srgb, var(--ak-accent) 10%, transparent),\n 0 4px 16px color-mix(in srgb, var(--ak-accent) 20%, transparent);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--ak-accent);\n margin-bottom: 4px;\n flex-shrink: 0;\n}\n.ak-empty-state__avatar-img {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n object-fit: cover;\n}\n.ak-empty-state__bot-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ak-empty-state__title {\n margin: 0;\n font-size: 16px;\n font-weight: 700;\n color: var(--ak-text);\n line-height: 1.3;\n letter-spacing: -0.01em;\n}\n.ak-empty-state__description {\n margin: 0;\n font-size: 13px;\n color: var(--ak-text-muted);\n line-height: 1.55;\n width: 100%;\n}\n/* Suggested question chips — 2-column grid */\n.ak-empty-state__suggestions {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n width: 100%;\n}\n.ak-empty-state__suggestion {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n background: color-mix(in srgb, var(--ak-accent) 5%, var(--ak-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 16%, var(--ak-border));\n border-radius: 10px;\n padding: 10px 12px;\n cursor: pointer;\n text-align: left;\n transition: background 0.15s ease, border-color 0.15s ease;\n}\n/* Odd last item spans both columns so the grid doesn't look lopsided */\n.ak-empty-state__suggestion:last-child:nth-child(odd) {\n grid-column: 1 / -1;\n}\n.ak-empty-state__suggestion:hover {\n background: color-mix(in srgb, var(--ak-accent) 10%, var(--ak-bg));\n border-color: color-mix(in srgb, var(--ak-accent) 30%, var(--ak-border));\n}\n.ak-empty-state__suggestion-title {\n font-size: 13px;\n font-weight: 700;\n color: var(--ak-text);\n line-height: 1.4;\n}\n.ak-empty-state__suggestion-desc {\n font-size: 12px;\n color: var(--ak-text-muted);\n line-height: 1.4;\n margin-top: 2px;\n}\n\n/* ── Message bubbles ─────────────────────────────────────────── */\n.ak-message {\n display: flex;\n flex-direction: column;\n max-width: 86%;\n animation: ak-msg-in 0.15s ease-out;\n}\n@keyframes ak-msg-in {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.ak-message--user {\n align-self: flex-end;\n align-items: flex-end;\n}\n.ak-message--assistant {\n align-self: flex-start;\n align-items: flex-start;\n}\n.ak-message__bubble {\n padding: 8px 12px;\n border-radius: 16px;\n font-size: 14px;\n line-height: 1.55;\n word-break: break-word;\n white-space: pre-wrap;\n max-width: 100%;\n min-width: 0;\n}\n.ak-message__bubble--md {\n white-space: normal;\n}\n.ak-message--user .ak-message__bubble {\n background: var(--ak-user-bg);\n color: var(--ak-user-text);\n border-bottom-right-radius: 4px;\n}\n.ak-message--assistant .ak-message__bubble {\n background: var(--ak-bot-bg);\n color: var(--ak-bot-text);\n border-bottom-left-radius: 4px;\n border: 1px solid var(--ak-border);\n}\n.ak-message--error .ak-message__bubble {\n background: #fee2e2;\n color: #991b1b;\n border-color: #fca5a5;\n}\n.ak-message--operator .ak-message__bubble--operator {\n background: color-mix(in srgb, var(--ak-accent) 8%, var(--ak-bot-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 22%, var(--ak-border));\n}\n.ak-message__time {\n display: block;\n text-align: right;\n font-size: 11px;\n color: var(--ak-text-muted);\n margin-top: 2px;\n padding: 0 4px;\n}\n.ak-message--user .ak-message__time {\n color: rgba(255, 255, 255, 0.7);\n}\n.ak-message__sender-label {\n font-size: 11px;\n font-weight: 500;\n color: var(--ak-text-muted);\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 0 2px;\n margin-bottom: 4px;\n}\n.ak-message--operator .ak-message__sender-label {\n color: var(--ak-accent);\n font-weight: 600;\n}\n.ak-message__operator-avatar {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 18px;\n height: 18px;\n border-radius: 50%;\n background: var(--ak-accent);\n color: #fff;\n font-size: 10px;\n font-weight: 700;\n line-height: 1;\n flex-shrink: 0;\n}\n.ak-message__operator-name {\n line-height: 1;\n}\n.ak-handoff-divider {\n display: flex;\n align-items: center;\n gap: 10px;\n margin: 8px 4px;\n color: var(--ak-text-muted);\n font-size: 11px;\n font-weight: 500;\n}\n.ak-handoff-divider::before,\n.ak-handoff-divider::after {\n content: '';\n flex: 1;\n height: 1px;\n background: var(--ak-border);\n}\n.ak-handoff-divider__label {\n white-space: nowrap;\n padding: 2px 8px;\n border-radius: 999px;\n background: color-mix(in srgb, var(--ak-accent) 6%, var(--ak-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 14%, var(--ak-border));\n color: color-mix(in srgb, var(--ak-accent) 70%, var(--ak-text));\n}\n/* ── Message avatar (assistant only, when avatarUrl is set) ─── */\n.ak-message--with-avatar {\n flex-direction: row;\n align-items: flex-end;\n gap: 8px;\n}\n.ak-message__avatar {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n object-fit: cover;\n flex-shrink: 0;\n background: var(--ak-surface);\n}\n.ak-message__body {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n min-width: 0;\n}\n\n/* ── Generated images ────────────────────────────────────────── */\n\n/* Bubble that contains an image — remove padding so image is flush at top */\n.ak-message__bubble--has-image {\n padding: 0;\n overflow: hidden;\n}\n\n.ak-message__images {\n display: flex;\n flex-direction: column;\n gap: 0;\n}\n\n.ak-message__image-wrap {\n position: relative;\n line-height: 0;\n}\n\n/* Clicking the image opens it in a new tab */\n.ak-message__image-link {\n display: block;\n line-height: 0;\n}\n\n.ak-message__image {\n width: 100%;\n display: block;\n transition: filter 0.2s;\n}\n\n.ak-message__image-link:hover .ak-message__image {\n filter: brightness(0.93);\n}\n\n/* ── Image gallery (count-aware layouts) ───────────────────────────────── */\n.ak-gallery {\n position: relative;\n width: 100%;\n background: #ffffff;\n overflow: hidden;\n}\n\n/* Single hero: natural aspect, contained inside a white frame so transparent\n * product PNGs read clearly. Caps at 320px tall to keep bubble compact. */\n.ak-gallery--single {\n line-height: 0;\n}\n.ak-gallery--single .ak-gallery__cell--hero {\n display: block;\n background: #ffffff;\n}\n.ak-gallery__img--contain {\n width: 100%;\n max-height: 320px;\n object-fit: contain;\n background: #ffffff;\n display: block;\n}\n\n/* 2-up: side-by-side squares, gap-1 */\n.ak-gallery--two {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 2px;\n background: #e2e8f0;\n}\n\n/* 3-up: big left + 2 stacked right; container holds aspect */\n.ak-gallery--three {\n display: grid;\n grid-template-columns: 2fr 1fr;\n gap: 2px;\n background: #e2e8f0;\n aspect-ratio: 4 / 3;\n}\n.ak-gallery--three > .ak-gallery__cell {\n aspect-ratio: auto;\n height: 100%;\n}\n.ak-gallery--three .ak-gallery__col {\n display: grid;\n grid-template-rows: 1fr 1fr;\n gap: 2px;\n}\n\n/* 4-up (and 5+): 2x2 grid */\n.ak-gallery--grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 2px;\n background: #e2e8f0;\n}\n\n.ak-gallery__cell {\n position: relative;\n display: block;\n overflow: hidden;\n background: #f8fafc;\n aspect-ratio: 1 / 1;\n line-height: 0;\n text-decoration: none;\n}\n\n/* Override aspect-ratio for the 3-up layout's column cells (they take parent height) */\n.ak-gallery--three .ak-gallery__col .ak-gallery__cell {\n aspect-ratio: auto;\n height: 100%;\n width: 100%;\n}\n\n.ak-gallery__img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n transition: transform 0.2s ease-out, filter 0.2s;\n}\n\n.ak-gallery__cell:hover .ak-gallery__img {\n transform: scale(1.04);\n filter: brightness(0.97);\n}\n\n.ak-gallery__cell:focus-visible {\n outline: 2px solid var(--ak-primary, #6366f1);\n outline-offset: -2px;\n}\n\n.ak-gallery__overlay {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(15, 23, 42, 0.6);\n color: #ffffff;\n font-size: 22px;\n font-weight: 600;\n letter-spacing: -0.01em;\n pointer-events: none;\n}\n\n/* ── File chips (user-uploaded .pdf/.md/.txt/.csv) ─────────────────────── */\n.ak-message__files {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px 10px 4px;\n}\n.ak-message__bubble--has-image .ak-message__files {\n padding: 8px 8px 4px;\n}\n\n.ak-file-chip {\n display: inline-flex;\n align-items: center;\n gap: 10px;\n padding: 8px 10px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border, #e2e8f0);\n border-radius: 12px;\n text-decoration: none;\n color: var(--ak-text, #0f172a);\n transition: border-color 0.15s, box-shadow 0.15s;\n max-width: 100%;\n}\n\n.ak-file-chip:hover {\n border-color: #cbd5e1;\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);\n}\n\n.ak-file-chip:focus-visible {\n outline: 2px solid var(--ak-primary, #6366f1);\n outline-offset: 2px;\n}\n\n.ak-file-chip__icon {\n flex-shrink: 0;\n width: 34px;\n height: 34px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n}\n\n.ak-file-chip__icon--pdf { background: #fff1f2; color: #e11d48; }\n.ak-file-chip__icon--csv { background: #ecfdf5; color: #059669; }\n.ak-file-chip__icon--md { background: #f5f3ff; color: #7c3aed; }\n.ak-file-chip__icon--txt { background: #f1f5f9; color: #475569; }\n.ak-file-chip__icon--default { background: #eef2ff; color: #4f46e5; }\n\n.ak-file-chip__body {\n display: flex;\n flex-direction: column;\n min-width: 0;\n line-height: 1.2;\n}\n\n.ak-file-chip__name {\n font-size: 13px;\n font-weight: 500;\n color: var(--ak-text, #0f172a);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 220px;\n}\n\n.ak-file-chip__label {\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 0.05em;\n color: #64748b;\n margin-top: 2px;\n}\n\n/* In user-side bubble (dark primary background), invert chip surface for legibility */\n.ak-message--user .ak-file-chip {\n background: rgba(255, 255, 255, 0.96);\n border-color: transparent;\n}\n\n/* ── Lightbox (image preview modal) ────────────────────────────────────── */\n.ak-lightbox {\n position: fixed;\n inset: 0;\n z-index: 2147483600; /* near max int — sits above any host-page content */\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n background: rgba(15, 23, 42, 0.85);\n backdrop-filter: blur(6px);\n -webkit-backdrop-filter: blur(6px);\n animation: ak-lightbox-in 0.12s ease-out;\n}\n\n@keyframes ak-lightbox-in {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n.ak-lightbox__img {\n max-width: 92vw;\n max-height: 88vh;\n border-radius: 8px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);\n user-select: none;\n display: block;\n}\n\n.ak-lightbox__toolbar {\n position: absolute;\n top: 16px;\n right: 16px;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.ak-lightbox__counter {\n display: inline-flex;\n align-items: center;\n height: 28px;\n padding: 0 12px;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n font-size: 12px;\n font-weight: 500;\n font-variant-numeric: tabular-nums;\n}\n\n.ak-lightbox__btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border: none;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n cursor: pointer;\n transition: background 0.15s;\n text-decoration: none;\n padding: 0;\n}\n\n.ak-lightbox__btn:hover {\n background: rgba(255, 255, 255, 0.22);\n}\n\n.ak-lightbox__btn:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.8);\n outline-offset: 2px;\n}\n\n.ak-lightbox__nav {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border: none;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n cursor: pointer;\n transition: background 0.15s;\n padding: 0;\n}\n\n.ak-lightbox__nav:hover {\n background: rgba(255, 255, 255, 0.22);\n}\n\n.ak-lightbox__nav--prev { left: 16px; }\n.ak-lightbox__nav--next { right: 16px; }\n\n.ak-lightbox__nav:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.8);\n outline-offset: 2px;\n}\n\n/* Gallery cells must be styled as plain buttons (we converted from <a>) */\n.ak-gallery__cell {\n border: none;\n padding: 0;\n margin: 0;\n cursor: zoom-in;\n font: inherit;\n color: inherit;\n background: #f8fafc;\n}\n\n.ak-gallery__cell:focus-visible {\n outline: 2px solid var(--ak-primary, #6366f1);\n outline-offset: -2px;\n}\n\n/* Faint download icon — always present, top-right corner of the image */\n.ak-message__image-dl-icon {\n position: absolute;\n top: 8px;\n right: 8px;\n width: 26px;\n height: 26px;\n background: rgba(0, 0, 0, 0.28);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: rgba(255, 255, 255, 0.75);\n text-decoration: none;\n transition: background 0.15s, color 0.15s;\n}\n\n.ak-message__image-dl-icon:hover {\n background: rgba(0, 0, 0, 0.55);\n color: #ffffff;\n}\n\n/* Caption / text below the image, inside the same bubble */\n.ak-message__image-caption {\n padding: 8px 10px 8px;\n font-size: 14px;\n font-style: normal;\n color: var(--ak-text);\n line-height: 1.45;\n}\n\n/* User-uploaded image caption uses user bubble colors */\n.ak-message--user .ak-message__image-caption {\n color: rgba(255, 255, 255, 0.8);\n font-style: normal;\n}\n\n/* ── Typing indicator ────────────────────────────────────────── */\n.ak-typing {\n display: flex;\n align-items: center;\n gap: 5px;\n padding: 9px 12px;\n background: var(--ak-bot-bg);\n border-radius: 16px;\n border-bottom-left-radius: 4px;\n border: 1px solid var(--ak-border);\n align-self: flex-start;\n width: fit-content;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-typing__dot {\n width: 7px;\n height: 7px;\n background: var(--ak-text-muted);\n border-radius: 50%;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-typing__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-typing__dot:nth-child(3) { animation-delay: 0.4s; }\n@keyframes ak-bounce {\n 0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }\n 30% { transform: translateY(-5px); opacity: 1; }\n}\n\n/* ── Init status (validating / error) ───────────────────────── */\n.ak-init-status {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 24px;\n}\n.ak-init-spinner {\n width: 28px;\n height: 28px;\n border: 3px solid var(--ak-border);\n border-top-color: var(--ak-accent);\n border-radius: 50%;\n animation: ak-spin 0.7s linear infinite;\n}\n@keyframes ak-spin {\n to { transform: rotate(360deg); }\n}\n.ak-init-status--error {\n justify-content: flex-start;\n}\n.ak-init-status--maintenance {\n padding: 28px 24px;\n}\n\n/* ── Composer ────────────────────────────────────────────────── */\n.ak-composer {\n position: relative; /* establishes positioning context for the attachment submenu */\n padding: 8px 12px 10px;\n border-top: 1px solid var(--ak-border);\n display: flex;\n flex-direction: column;\n gap: 8px;\n background: var(--ak-bg);\n flex-shrink: 0;\n}\n\n/* Hidden native file input */\n.ak-composer__file-input {\n display: none;\n}\n\n/* Unified input container — wraps +, textarea, send as one row */\n.ak-composer__input-wrap {\n display: flex;\n align-items: center;\n gap: 6px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border);\n border-radius: 14px;\n padding: 5px 5px 5px 6px;\n transition: border-color 0.15s;\n}\n.ak-composer__input-wrap:focus-within {\n border-color: var(--ak-accent);\n}\n\n/* Attach button wrapper */\n.ak-composer__attach-wrap {\n flex-shrink: 0;\n}\n\n/* \"+\" attachment button — square with rounded corners */\n.ak-composer__attach {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n background: var(--ak-bg);\n border: 1px solid var(--ak-border);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--ak-text-muted);\n transition: color 0.15s, border-color 0.15s, background 0.15s;\n flex-shrink: 0;\n}\n.ak-composer__attach:hover:not(:disabled) {\n color: var(--ak-accent);\n border-color: var(--ak-accent);\n}\n.ak-composer__attach--open {\n color: var(--ak-accent);\n border-color: var(--ak-accent);\n background: color-mix(in srgb, var(--ak-accent) 8%, transparent);\n}\n.ak-composer__attach:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n/* Attachment submenu — floats above the composer, positioned relative to .ak-composer */\n.ak-composer__attach-menu {\n position: absolute;\n bottom: calc(100% + 6px);\n left: 12px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border);\n border-radius: 10px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n padding: 4px;\n min-width: 130px;\n z-index: 10;\n}\n\n/* Individual item inside the attachment submenu */\n.ak-composer__attach-menu-item {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 7px 10px;\n border: none;\n border-radius: 7px;\n background: transparent;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 13px;\n cursor: pointer;\n transition: background 0.12s;\n text-align: left;\n}\n.ak-composer__attach-menu-item:hover:not(:disabled) {\n background: var(--ak-bg);\n}\n.ak-composer__attach-menu-item:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n/* Textarea — borderless, transparent, sits inside the container */\n.ak-composer__input {\n flex: 1;\n padding: 4px 6px;\n border: none;\n border-radius: 0;\n background: transparent;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 14px;\n line-height: 1.45;\n resize: none;\n outline: none;\n min-height: 28px;\n max-height: 110px;\n overflow-y: auto;\n}\n.ak-composer__input::placeholder {\n color: var(--ak-text-muted);\n}\n\n/* Send button — square with rounded corners */\n.ak-composer__send {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n background: var(--ak-accent);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n transition: background 0.15s, opacity 0.15s;\n flex-shrink: 0;\n}\n.ak-composer__send:hover:not(:disabled) {\n background: var(--ak-accent-hover);\n}\n.ak-composer__send:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n/* Old photo button — hidden but keep so file-input trigger still works */\n.ak-composer__photo {\n display: none;\n}\n\n/* Image preview strip above the input row */\n.ak-composer__preview {\n display: flex;\n gap: 6px;\n padding: 0 2px;\n}\n.ak-composer__preview-wrap {\n position: relative;\n width: 60px;\n height: 60px;\n border-radius: 8px;\n overflow: hidden;\n border: 1px solid var(--ak-border);\n flex-shrink: 0;\n}\n.ak-composer__preview-img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n}\n.ak-composer__preview-remove {\n position: absolute;\n top: 3px;\n right: 3px;\n width: 18px;\n height: 18px;\n border-radius: 50%;\n background: rgba(0, 0, 0, 0.55);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #ffffff;\n padding: 0;\n transition: background 0.15s;\n}\n.ak-composer__preview-remove:hover {\n background: rgba(0, 0, 0, 0.8);\n}\n\n/* ── Streaming cursor ────────────────────────────────────────── */\n.ak-cursor {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n margin-left: 4px;\n vertical-align: middle;\n}\n.ak-cursor__dot {\n display: inline-block;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: currentColor;\n opacity: 0.6;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-cursor__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-cursor__dot:nth-child(3) { animation-delay: 0.4s; }\n\n/* Pre-first-chunk wait — deliberately shares the metrics of .ak-progress__item\n and .ak-progress__summary so dots → activity line → summary never reflow. */\n.ak-typing-row {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 2px 0;\n margin: 0 0 4px;\n /* One text line at the shared row metrics, so the dots occupy exactly the\n box the activity line and summary will occupy (border-box). */\n min-height: calc(0.76rem * 1.4 + 4px);\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-typing-row__dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--ak-bot-text);\n opacity: 0.5;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-typing-row__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-typing-row__dot:nth-child(3) { animation-delay: 0.4s; }\n@media (prefers-reduced-motion: reduce) {\n .ak-typing-row__dot,\n .ak-cursor__dot,\n .ak-typing__dot,\n .ak-progress__item--active,\n .ak-agent-status__icon {\n animation: none;\n }\n}\n\n/* ── Markdown rendering ──────────────────────────────────────── */\n.ak-message__bubble--md {\n white-space: normal;\n min-width: 0;\n}\n.ak-message__bubble--md .ak-md-p {\n margin: 0 0 0.4em 0;\n}\n.ak-message__bubble--md .ak-md-p:last-child {\n margin-bottom: 0;\n}\n/* Collapse margins between paragraph and following list */\n.ak-message__bubble--md .ak-md-p + .ak-md-ul,\n.ak-message__bubble--md .ak-md-p + .ak-md-ol {\n margin-top: 0;\n}\n.ak-message__bubble--md .ak-md-h1,\n.ak-message__bubble--md .ak-md-h2,\n.ak-message__bubble--md .ak-md-h3 {\n font-weight: 700;\n line-height: 1.3;\n margin: 0.6em 0 0.3em;\n}\n.ak-message__bubble--md .ak-md-h1:first-child,\n.ak-message__bubble--md .ak-md-h2:first-child,\n.ak-message__bubble--md .ak-md-h3:first-child {\n margin-top: 0;\n}\n.ak-message__bubble--md .ak-md-h1 { font-size: 1.12em; }\n.ak-message__bubble--md .ak-md-h2 { font-size: 1.04em; }\n.ak-message__bubble--md .ak-md-h3 { font-size: 0.97em; }\n.ak-message__bubble--md .ak-md-ul,\n.ak-message__bubble--md .ak-md-ol {\n padding-left: 1.4em;\n margin: 0.4em 0;\n}\n.ak-message__bubble--md .ak-md-ul li,\n.ak-message__bubble--md .ak-md-ol li {\n margin-bottom: 0.15em;\n}\n.ak-message__bubble--md .ak-md-pre-wrap {\n position: relative;\n margin: 0.4em 0;\n border-radius: 6px;\n overflow-x: auto;\n overflow-y: hidden;\n background: rgba(0, 0, 0, 0.08);\n max-width: 100%;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-pre-wrap {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-message__bubble--md .ak-md-pre-lang {\n display: block;\n padding: 3px 10px;\n font-size: 10px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n opacity: 0.55;\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\n}\n.ak-message--user .ak-message__bubble--md .ak-md-pre-lang {\n border-bottom-color: rgba(255, 255, 255, 0.15);\n}\n.ak-message__bubble--md .ak-md-pre {\n margin: 0;\n padding: 8px 10px;\n font-size: 12px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n white-space: pre;\n box-sizing: border-box;\n}\n.ak-message__bubble--md .ak-md-code {\n display: block;\n font-family: inherit;\n font-size: inherit;\n}\n.ak-message__bubble--md .ak-md-ic {\n background: rgba(0, 0, 0, 0.08);\n border-radius: 3px;\n padding: 1px 5px;\n font-size: 0.87em;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-ic {\n background: rgba(255, 255, 255, 0.2);\n}\n.ak-message__bubble--md .ak-md-hr {\n border: none;\n border-top: 1px solid currentColor;\n opacity: 0.2;\n margin: 0.5em 0;\n}\n.ak-message__bubble--md a {\n color: var(--ak-accent);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.ak-message--user .ak-message__bubble--md a {\n color: rgba(255, 255, 255, 0.9);\n}\n.ak-message__bubble--md .ak-md-table {\n width: 100%;\n border-collapse: collapse;\n margin: 0.4em 0;\n font-size: 0.95em;\n line-height: 1.5;\n}\n.ak-message__bubble--md .ak-md-th {\n padding: 8px 10px;\n text-align: left;\n border-bottom: 2px solid var(--ak-accent) !important;\n background: color-mix(in srgb, var(--ak-accent) 8%, transparent) !important;\n font-weight: 600;\n color: var(--ak-text) !important;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-th {\n border-bottom-color: rgba(255, 255, 255, 0.5) !important;\n background: rgba(0, 0, 0, 0.25) !important;\n color: #ffffff !important;\n font-weight: 700;\n}\n.ak-message__bubble--md .ak-md-td {\n padding: 6px 10px;\n border-bottom: 1px solid var(--ak-border) !important;\n color: var(--ak-text) !important;\n}\n.ak-message__bubble--md tr:nth-child(even) .ak-md-td {\n background: color-mix(in srgb, var(--ak-surface), transparent 40%) !important;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-td {\n color: #ffffff !important;\n border-bottom-color: rgba(255, 255, 255, 0.25) !important;\n}\n.ak-message--user .ak-message__bubble--md tr:nth-child(even) .ak-md-td {\n background: rgba(0, 0, 0, 0.15) !important;\n}\n\n/* ── Composer disclaimer ─────────────────────────────────────── */\n.ak-composer__disclaimer {\n font-size: 11px;\n color: var(--ak-text-muted);\n text-align: center;\n line-height: 1.4;\n}\n.ak-composer__disclaimer a {\n color: var(--ak-text-muted);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.ak-composer__disclaimer a:hover {\n color: var(--ak-accent);\n}\n\n/* ── Maintenance state ───────────────────────────────────────── */\n.ak-maintenance {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n max-width: 320px;\n padding: 8px 4px;\n animation: ak-maintenance-enter 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;\n}\n.ak-maintenance__halo {\n position: absolute;\n top: -6px;\n left: 50%;\n width: 120px;\n height: 120px;\n transform: translateX(-50%);\n border-radius: 50%;\n background: radial-gradient(\n closest-side,\n var(--ak-maintenance-halo) 0%,\n transparent 72%\n );\n opacity: 0.22;\n filter: blur(4px);\n pointer-events: none;\n animation: ak-maintenance-pulse 2.8s ease-in-out infinite;\n}\n.ak-maintenance__icon {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 56px;\n border-radius: 50%;\n background: var(--ak-maintenance-bg);\n color: var(--ak-maintenance-fg);\n border: 1px solid color-mix(in srgb, var(--ak-maintenance-halo) 40%, transparent);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n}\n.ak-maintenance__title {\n margin-top: 16px;\n font-size: 15px;\n font-weight: 600;\n color: var(--ak-text);\n line-height: 1.3;\n letter-spacing: -0.01em;\n}\n.ak-maintenance__description {\n margin-top: 6px;\n font-size: 13px;\n color: var(--ak-text-muted);\n line-height: 1.5;\n max-width: 28ch;\n}\n\n@keyframes ak-maintenance-enter {\n from {\n opacity: 0;\n transform: translateY(6px) scale(0.98);\n }\n to {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n}\n@keyframes ak-maintenance-pulse {\n 0%, 100% { opacity: 0.18; transform: translateX(-50%) scale(1); }\n 50% { opacity: 0.32; transform: translateX(-50%) scale(1.06); }\n}\n@media (prefers-reduced-motion: reduce) {\n .ak-maintenance,\n .ak-maintenance__halo,\n .ak-maintenance__icon {\n animation: none;\n }\n}\n\n/* ── Error banner ────────────────────────────────────────────── */\n.ak-error {\n padding: 12px 16px;\n background: #fee2e2;\n color: #991b1b;\n font-size: 13px;\n border-top: 1px solid #fca5a5;\n text-align: left;\n flex-shrink: 0;\n display: flex;\n align-items: flex-start;\n gap: 10px;\n}\n\n.ak-error__icon {\n font-size: 16px;\n line-height: 1;\n flex-shrink: 0;\n margin-top: 1px;\n}\n\n.ak-error__content {\n flex: 1;\n}\n\n.ak-error__title {\n font-size: 14px;\n font-weight: 600;\n margin: 0 0 4px 0;\n line-height: 1.3;\n}\n\n.ak-error__description {\n font-size: 13px;\n margin: 0 0 4px 0;\n line-height: 1.4;\n opacity: 0.9;\n}\n\n.ak-error__message {\n font-size: 13px;\n margin: 0;\n line-height: 1.4;\n opacity: 0.85;\n}\n\n/* Specific styling for origin restriction errors */\n.ak-error--origin {\n background: #fef3c7; /* Amber background instead of red for less scary appearance */\n color: #92400e; /* Amber text color */\n border-top: 1px solid #fbbf24;\n}\n\n/* ── Agent status indicator ──────────────────────────────────── */\n/* Same bare row as .ak-progress__item / .ak-typing-row — activity-off tenants\n see the tool status swap in without the surrounding box changing size. */\n.ak-agent-status {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n margin-bottom: 4px;\n padding: 2px 0;\n color: var(--ak-bot-text);\n font-size: 0.76rem;\n line-height: 1.4;\n opacity: 0.6;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-agent-status__icon {\n flex-shrink: 0;\n color: var(--ak-primary, #6366f1);\n animation: ak-sparkle-pulse 2.5s ease-in-out infinite;\n}\n.ak-agent-status__text {\n line-height: 1.4;\n}\n@keyframes ak-sparkle-pulse {\n 0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }\n 50% { opacity: 0.45; transform: scale(0.85) rotate(15deg); }\n}\n\n/* ── Progress block (tool execution / streaming chain) ───────── */\n.ak-progress {\n margin-bottom: 4px;\n max-width: 80%;\n}\n.ak-progress__block {\n display: inline-flex;\n flex-direction: column;\n gap: 3px;\n padding: 6px 12px;\n border-radius: 14px;\n background: var(--ak-bot-bg);\n border: 1px solid var(--ak-border);\n font-size: 0.8rem;\n color: var(--ak-bot-text);\n opacity: 0.85;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-progress__header {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.ak-progress__label {\n font-weight: 600;\n font-size: 0.78rem;\n color: var(--ak-primary, #6366f1);\n}\n.ak-progress__toggle {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n padding: 1px 7px;\n border: 1px solid var(--ak-border);\n border-radius: 8px;\n background: transparent;\n color: var(--ak-bot-text);\n font-size: 0.72rem;\n cursor: pointer;\n opacity: 0.65;\n transition: opacity 0.15s;\n}\n.ak-progress__toggle:hover { opacity: 0.9; }\n.ak-progress__toggle--collapsed {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 5px 10px;\n border: 1px solid var(--ak-border);\n border-radius: 12px;\n background: transparent;\n color: var(--ak-bot-text);\n font-size: 0.78rem;\n cursor: pointer;\n opacity: 0.55;\n transition: opacity 0.15s;\n margin-bottom: 4px;\n}\n.ak-progress__toggle--collapsed:hover { opacity: 0.85; }\n.ak-progress__text {\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n line-height: 1.4;\n margin: 0;\n}\n/* Active streaming state */\n.ak-progress__list {\n list-style: none;\n margin: 0 0 4px;\n padding: 0;\n}\n/* Bare row, not a pill — identical metrics to .ak-progress__summary so the\n live line and the post-turn \"Worked for Ns\" swap without a size change. */\n.ak-progress__item {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n font-size: 0.76rem;\n line-height: 1.4;\n color: var(--ak-bot-text);\n opacity: 0.6;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-progress__item--active {\n /* inherits base .ak-progress__item; subtle pulse to signal in-flight */\n animation: ak-msg-in 0.15s ease-out, ak-active-pulse 2s ease-in-out infinite;\n}\n@keyframes ak-active-pulse {\n 0%, 100% { opacity: 0.6; }\n 50% { opacity: 0.9; }\n}\n/* Claude-style step list (detailed mode) */\n.ak-progress__steps {\n list-style: none;\n margin: 0 0 4px;\n padding: 2px 0;\n}\n.ak-progress__step {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n opacity: 0.6;\n line-height: 1.4;\n}\n.ak-progress__step--active {\n opacity: 0.9;\n}\n.ak-progress__step-text {\n min-width: 0;\n}\n.ak-progress__step-dur {\n opacity: 0.65;\n flex-shrink: 0;\n}\n.ak-progress__step-icon {\n flex-shrink: 0;\n opacity: 0.55;\n}\n.ak-progress__step-icon--fail {\n color: #ef4444;\n opacity: 0.9;\n}\n/* Post-turn summary row (\"Worked for Ns · N steps\") */\n.ak-progress__summary {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n margin: 0 0 4px;\n /* Shrink-to-fit as a column flex item would otherwise break \"Worked for 8.4s\"\n onto two lines, doubling the row height as the turn ends. */\n white-space: nowrap;\n border: none;\n background: transparent;\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n opacity: 0.6;\n cursor: pointer;\n transition: opacity 0.15s;\n}\n.ak-progress__summary:hover { opacity: 0.85; }\n.ak-progress__summary--static {\n cursor: default;\n}\n.ak-progress__summary--static:hover { opacity: 0.6; }\n.ak-progress__spinner {\n display: inline-block;\n width: 11px;\n height: 11px;\n border: 1.5px solid var(--ak-border);\n border-top-color: var(--ak-primary, #6366f1);\n border-radius: 50%;\n flex-shrink: 0;\n animation: ak-spin 0.7s linear infinite;\n}\n\n/* ── Powered by hanging tab ──────────────────────────────────── */\n.ak-branding {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px 4px;\n background: var(--ak-bg);\n border: 1px solid var(--ak-border);\n border-top: none;\n border-radius: 0 0 8px 8px;\n margin-left: 16px;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);\n}\n.ak-branding__logo {\n width: 11px;\n height: 11px;\n flex-shrink: 0;\n color: var(--ak-accent);\n opacity: 0.75;\n}\n.ak-branding__label {\n font-size: 9px;\n color: var(--ak-text-muted);\n opacity: 0.75;\n}\n.ak-branding__name {\n font-size: 9px;\n font-weight: 600;\n color: var(--ak-accent);\n opacity: 0.75;\n letter-spacing: -0.01em;\n}\n\n/* ── Mobile: full-viewport panel ─────────────────────────────── */\n@media (max-width: 639px) {\n @keyframes ak-panel-in-mobile {\n from { opacity: 0; transform: translateY(32px); }\n to { opacity: 1; transform: translateY(0); }\n }\n\n /* The shadow host (data-agentkit-widget) sits inside the outer fixed container.\n Give it its own fixed position so it fills the viewport independently,\n bypassing the outer container's bottom/right offsets. */\n :host([data-open]) {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 2147483647;\n pointer-events: none;\n }\n\n :host([data-open]) .ak-floating {\n width: 100%;\n height: 100%;\n align-items: stretch;\n gap: 0;\n }\n\n :host([data-open]) .ak-shell-wrap {\n flex: 1;\n min-height: 0;\n width: 100%;\n align-items: stretch;\n /* Launcher is hidden here — the negative offset would leave a dead strip. */\n margin-bottom: 0;\n }\n\n :host([data-open]) .ak-shell--floating {\n width: 100%;\n flex: 1;\n height: auto;\n border-radius: 0;\n box-shadow: none;\n border-left: none;\n border-right: none;\n border-top: none;\n }\n\n :host([data-open]) .ak-launcher {\n display: none;\n }\n\n :host([data-open]) .ak-shell-enter {\n animation: ak-panel-in-mobile 0.22s ease-out;\n }\n\n :host([data-open]) .ak-branding {\n display: none;\n }\n}\n";
|
|
5800
|
-
|
|
5801
|
-
//#region ../../packages/widget-ui/src/components/Header.tsx
|
|
5802
|
-
function Ea() {
|
|
5817
|
+
// ../../packages/widget-ui/src/theme/styles.ts
|
|
5818
|
+
var Oa = "\n*, *::before, *::after {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\n:host {\n /* Neutral and status defaults are copied from packages/design-tokens/tokens.css (light\n :root / dark .dark) — the widget is CDN-bundled, so they stay literals here.\n __tests__/design-token-parity.test.ts fails when the two drift. */\n --ak-accent: #4f46e5; /* --primary (white text 6.3:1) */\n --ak-accent-hover: #4338ca; /* --primary-hover */\n --ak-bg: #ffffff; /* --surface */\n --ak-surface: #f7f8fa; /* --bg */\n --ak-text: #0e1220; /* --fg */\n --ak-text-muted: #525c70; /* --fg-muted */\n --ak-border: #e3e6ec; /* --border */\n --ak-border-strong: #818a9d; /* --border-strong */\n --ak-hover: rgb(14 18 32 / 0.04); /* --hover */\n --ak-user-bg: var(--ak-accent);\n --ak-user-text: #ffffff;\n --ak-bot-bg: #eef0f4; /* --surface-muted */\n --ak-bot-text: #0e1220; /* --fg */\n --ak-success: #0a9466; /* --success */\n --ak-warning: #d98a0b; /* --warning */\n --ak-warning-fg: #8a4b06; /* --warning-fg */\n --ak-warning-soft: #fdf3e2; /* --warning-soft */\n --ak-danger: #c4302b; /* --danger */\n --ak-danger-fg: #b4232b; /* --danger-fg */\n --ak-danger-soft: #fdeced; /* --danger-soft */\n --ak-danger-border: color-mix(in srgb, var(--ak-danger) 35%, transparent);\n --ak-maintenance-fg: var(--ak-warning-fg);\n --ak-maintenance-bg: var(--ak-warning-soft);\n --ak-maintenance-halo: var(--ak-warning);\n --ak-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n --ak-radius: 12px;\n /* Chat surface texture — scattered line doodles, tiled. Neutral stroke (not accent-tinted)\n so it stays a texture rather than competing with brand colour. Alpha is baked into the\n SVG stroke, so the light/dark variants differ only in stroke rgba. */\n --ak-pattern: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(0,0,0,0.045)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 30c5-8 14-8 19 0s14 8 19 0'/%3E%3Ccircle cx='96' cy='22' r='8'/%3E%3Cpath d='M150 34l6-11 6 11z'/%3E%3Cpath d='M196 18v14M189 25h14'/%3E%3Cpath d='M28 74h22M28 81h14'/%3E%3Cpath d='M84 68l8-8 8 8-8 8z'/%3E%3Cpath d='M186 76c0 7-6 12-13 12h-10l-6 6v-6c-5-1-8-6-8-12 0-7 6-12 13-12h11c7 0 13 5 13 12z'/%3E%3Ccircle cx='124' cy='104' r='5'/%3E%3Cpath d='M18 122c7-5 14-5 21 0'/%3E%3Cpath d='M62 132l7-13 7 13z'/%3E%3Cpath d='M106 156h20M106 163h12'/%3E%3Ccircle cx='176' cy='140' r='8'/%3E%3Cpath d='M32 170l6-6 6 6-6 6z'/%3E%3Cpath d='M148 196c5-7 13-7 18 0'/%3E%3Cpath d='M74 196v12M68 202h12'/%3E%3Ccircle cx='206' cy='178' r='4.5'/%3E%3Ccircle cx='58' cy='48' r='4'/%3E%3Cpath d='M128 56h16M128 62h10'/%3E%3Cpath d='M40 100l5-5 5 5-5 5z'/%3E%3Cpath d='M150 116c5-6 12-6 17 0'/%3E%3Ccircle cx='92' cy='128' r='4'/%3E%3Cpath d='M198 108v11M193 113h11'/%3E%3Cpath d='M8 148c5-7 12-7 17 0'/%3E%3Ccircle cx='142' cy='176' r='4'/%3E%3Cpath d='M76 166h16M76 172h9'/%3E%3Cpath d='M186 208l5-9 5 9z'/%3E%3Cpath d='M110 190l6-6 6 6-6 6z'/%3E%3Ccircle cx='46' cy='206' r='5'/%3E%3C/svg%3E\");\n --ak-pattern-size: 210px;\n --ak-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.08);\n --ak-launcher-size: 56px;\n /* Panel-to-launcher offset. Negative pulls the launcher up toward the panel.\n Applied as a margin on .ak-shell-wrap because CSS gap rejects negatives. */\n --ak-launcher-gap: -12px;\n font-family: var(--ak-font);\n -webkit-font-smoothing: antialiased;\n}\n\n/* Dark mode — set data-theme=\"dark\" on the shadow host element.\n Values from tokens.css .dark (see the :host note above). */\n:host([data-theme=\"dark\"]) {\n --ak-bg: #111521; /* --surface — panel */\n --ak-surface: #171c2a; /* --surface-raised — inputs, insets lift off the panel */\n --ak-text: #eef0f6; /* --fg */\n --ak-text-muted: #a3acbd; /* --fg-muted */\n --ak-border: #232a3a; /* --border */\n --ak-border-strong: #5f687c; /* --border-strong */\n --ak-hover: rgb(255 255 255 / 0.05); /* --hover */\n --ak-bot-bg: #20263a; /* --surface-muted — assistant bubble */\n --ak-bot-text: #eef0f6; /* --fg */\n --ak-success: #2fbf87;\n --ak-warning: #e5a43a;\n --ak-warning-fg: #f2bd5c;\n --ak-warning-soft: #2c2110;\n --ak-danger: #d93a3f;\n --ak-danger-fg: #ff8a8f;\n --ak-danger-soft: #331417;\n /* Same doodle tile, white stroke — dark surfaces need ~1.5x the alpha to read the same */\n --ak-pattern: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(255,255,255,0.07)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 30c5-8 14-8 19 0s14 8 19 0'/%3E%3Ccircle cx='96' cy='22' r='8'/%3E%3Cpath d='M150 34l6-11 6 11z'/%3E%3Cpath d='M196 18v14M189 25h14'/%3E%3Cpath d='M28 74h22M28 81h14'/%3E%3Cpath d='M84 68l8-8 8 8-8 8z'/%3E%3Cpath d='M186 76c0 7-6 12-13 12h-10l-6 6v-6c-5-1-8-6-8-12 0-7 6-12 13-12h11c7 0 13 5 13 12z'/%3E%3Ccircle cx='124' cy='104' r='5'/%3E%3Cpath d='M18 122c7-5 14-5 21 0'/%3E%3Cpath d='M62 132l7-13 7 13z'/%3E%3Cpath d='M106 156h20M106 163h12'/%3E%3Ccircle cx='176' cy='140' r='8'/%3E%3Cpath d='M32 170l6-6 6 6-6 6z'/%3E%3Cpath d='M148 196c5-7 13-7 18 0'/%3E%3Cpath d='M74 196v12M68 202h12'/%3E%3Ccircle cx='206' cy='178' r='4.5'/%3E%3Ccircle cx='58' cy='48' r='4'/%3E%3Cpath d='M128 56h16M128 62h10'/%3E%3Cpath d='M40 100l5-5 5 5-5 5z'/%3E%3Cpath d='M150 116c5-6 12-6 17 0'/%3E%3Ccircle cx='92' cy='128' r='4'/%3E%3Cpath d='M198 108v11M193 113h11'/%3E%3Cpath d='M8 148c5-7 12-7 17 0'/%3E%3Ccircle cx='142' cy='176' r='4'/%3E%3Cpath d='M76 166h16M76 172h9'/%3E%3Cpath d='M186 208l5-9 5 9z'/%3E%3Cpath d='M110 190l6-6 6 6-6 6z'/%3E%3Ccircle cx='46' cy='206' r='5'/%3E%3C/svg%3E\");\n --ak-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);\n}\n\n/* ── Floating layout ─────────────────────────────────────────── */\n.ak-floating {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 0;\n pointer-events: none;\n}\n.ak-floating > * {\n pointer-events: all;\n}\n\n/* ── Inline layout ───────────────────────────────────────────── */\n.ak-inline {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 400px;\n max-height: 100%;\n}\n\n/* ── Launcher button ─────────────────────────────────────────── */\n.ak-launcher {\n width: var(--ak-launcher-size);\n height: var(--ak-launcher-size);\n border-radius: 50%;\n background: var(--ak-accent);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n box-shadow: 0 4px 16px color-mix(in srgb, var(--ak-accent) 45%, transparent);\n transition: background 0.2s, transform 0.15s, box-shadow 0.2s;\n flex-shrink: 0;\n}\n.ak-launcher:hover {\n background: var(--ak-accent-hover);\n transform: scale(1.08);\n box-shadow: 0 6px 24px color-mix(in srgb, var(--ak-accent) 55%, transparent);\n}\n.ak-launcher:active {\n transform: scale(0.95);\n}\n.ak-launcher svg {\n pointer-events: none;\n}\n/* Launcher showing avatar image instead of chat icon */\n.ak-launcher--avatar {\n padding: 0;\n overflow: hidden;\n}\n.ak-launcher__avatar-img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: 50%;\n pointer-events: none;\n}\n\n/* ── Shell wrapper (positions the hanging branding tab) ─────── */\n.ak-shell-wrap {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n margin-bottom: var(--ak-launcher-gap);\n}\n\n/* ── Widget shell / panel ────────────────────────────────────── */\n.ak-shell {\n background: var(--ak-bg);\n border-radius: var(--ak-radius);\n box-shadow: var(--ak-shadow);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n border: 1px solid var(--ak-border);\n}\n.ak-shell--floating {\n width: 380px;\n height: 580px;\n}\n.ak-shell--inline {\n width: 100%;\n height: 100%;\n min-height: 400px;\n max-height: 100%;\n border-radius: 0;\n box-shadow: none;\n border: none;\n display: flex;\n flex-direction: column;\n}\n/* Inline shell-wrap fills its container and suppresses the duplicate widget header\n (the sidebar already renders its own header and close button). */\n.ak-inline .ak-shell-wrap {\n width: 100%;\n height: 100%;\n /* No launcher in inline mode — the negative offset would overflow the host. */\n margin-bottom: 0;\n}\n.ak-inline .ak-header {\n display: none;\n}\n.ak-shell-enter {\n animation: ak-panel-in 0.2s ease-out;\n}\n@keyframes ak-panel-in {\n from { opacity: 0; transform: translateY(10px) scale(0.97); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n}\n\n/* ── Header ──────────────────────────────────────────────────── */\n.ak-header {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 10px 14px;\n background: var(--ak-accent);\n color: #fff;\n flex-shrink: 0;\n gap: 8px;\n}\n.ak-header--confirming {\n flex-direction: column;\n align-items: stretch;\n justify-content: flex-start;\n gap: 0;\n}\n.ak-header__row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n gap: 8px;\n}\n.ak-header__status {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n /* Not --ak-success: this dot sits on the accent fill, where the token green is too dark. */\n background: #4ade80;\n flex-shrink: 0;\n}\n.ak-header__title-group {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 1px;\n min-width: 0;\n}\n.ak-header__title {\n font-size: 15px;\n font-weight: 600;\n letter-spacing: -0.01em;\n}\n.ak-header__subtitle {\n font-size: 11px;\n font-weight: 400;\n opacity: 0.8;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ak-header__close {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n transition: background 0.15s;\n flex-shrink: 0;\n}\n.ak-header__close:hover {\n background: rgba(255, 255, 255, 0.35);\n}\n.ak-header__avatar {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n object-fit: cover;\n flex-shrink: 0;\n border: 2px solid rgba(255, 255, 255, 0.3);\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__bot-icon {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n flex-shrink: 0;\n}\n.ak-header__button {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n transition: background 0.15s;\n flex-shrink: 0;\n}\n.ak-header__button:hover {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__button--active {\n background: rgba(255, 255, 255, 0.3);\n}\n.ak-header__confirm {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 8px 0 0;\n margin: 8px 0 0;\n border-top: 1px solid rgba(255, 255, 255, 0.2);\n animation: ak-confirm-in 0.18s ease-out;\n}\n@keyframes ak-confirm-in {\n from { opacity: 0; transform: translateY(-4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.ak-header__confirm-text {\n display: flex;\n flex-direction: column;\n gap: 1px;\n flex: 1;\n min-width: 0;\n}\n.ak-header__confirm-title {\n font-size: 13px;\n font-weight: 600;\n color: #fff;\n line-height: 1.3;\n}\n.ak-header__confirm-sub {\n font-size: 11px;\n color: rgba(255, 255, 255, 0.75);\n line-height: 1.3;\n}\n.ak-header__confirm-actions {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-shrink: 0;\n}\n.ak-header__confirm-cancel {\n padding: 5px 10px;\n border-radius: 6px;\n border: 1px solid rgba(255, 255, 255, 0.4);\n background: transparent;\n color: #fff;\n font-family: var(--ak-font);\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.15s;\n white-space: nowrap;\n}\n.ak-header__confirm-cancel:hover {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__confirm-cancel:active {\n background: rgba(255, 255, 255, 0.25);\n}\n.ak-header__confirm-ok {\n padding: 5px 10px;\n border-radius: 6px;\n border: none;\n background: rgba(255, 255, 255, 0.2);\n color: #fff;\n font-family: var(--ak-font);\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n transition: background 0.15s;\n white-space: nowrap;\n}\n.ak-header__confirm-ok:hover {\n background: rgba(239, 68, 68, 0.7);\n}\n.ak-header__confirm-ok:active {\n background: rgba(239, 68, 68, 0.85);\n}\n\n/* ── Message list ────────────────────────────────────────────── */\n.ak-messages {\n flex: 1;\n overflow-y: auto;\n padding: 12px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n scroll-behavior: smooth;\n min-height: 0; /* Allow flex child to shrink below its content height */\n /* Faint doodle texture so bubbles read as objects on a surface, not floating on flat colour.\n background-attachment defaults to scroll = anchored to the padding box, so the\n pattern stays put while messages scroll. */\n background-image: var(--ak-pattern);\n background-size: var(--ak-pattern-size) var(--ak-pattern-size);\n}\n.ak-messages::-webkit-scrollbar { width: 4px; }\n.ak-messages::-webkit-scrollbar-track { background: transparent; }\n.ak-messages::-webkit-scrollbar-thumb {\n background: var(--ak-border);\n border-radius: 4px;\n}\n\n/* ── Empty state ─────────────────────────────────────────────── */\n.ak-empty-state {\n flex: 1;\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: safe center;\n padding: 16px;\n text-align: center;\n gap: 16px;\n overflow-y: auto;\n overflow-x: hidden;\n min-height: 0;\n /* Glow layer is translucent so the same doodle texture as .ak-messages shows through —\n keeps empty state and message list on one continuous surface. */\n background-color: var(--ak-bg);\n background-image:\n radial-gradient(ellipse 110% 55% at 50% 0%,\n color-mix(in srgb, var(--ak-accent) 10%, transparent),\n transparent 72%\n ),\n var(--ak-pattern);\n background-size: auto, var(--ak-pattern-size) var(--ak-pattern-size);\n}\n/* Decorative blurred orb behind the avatar */\n.ak-empty-state__glow {\n position: absolute;\n top: -24px;\n left: 50%;\n transform: translateX(-50%);\n width: 180px;\n height: 180px;\n border-radius: 50%;\n background: color-mix(in srgb, var(--ak-accent) 18%, transparent);\n filter: blur(48px);\n pointer-events: none;\n}\n.ak-empty-state__body {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n position: relative;\n width: 100%;\n}\n.ak-empty-state__avatar {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n background: var(--ak-bg);\n border: 2px solid color-mix(in srgb, var(--ak-accent) 25%, var(--ak-border));\n box-shadow:\n 0 0 0 4px color-mix(in srgb, var(--ak-accent) 10%, transparent),\n 0 4px 16px color-mix(in srgb, var(--ak-accent) 20%, transparent);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--ak-accent);\n margin-bottom: 4px;\n flex-shrink: 0;\n}\n.ak-empty-state__avatar-img {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n object-fit: cover;\n}\n.ak-empty-state__bot-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ak-empty-state__title {\n margin: 0;\n font-size: 16px;\n font-weight: 700;\n color: var(--ak-text);\n line-height: 1.3;\n letter-spacing: -0.01em;\n}\n.ak-empty-state__description {\n margin: 0;\n font-size: 13px;\n color: var(--ak-text-muted);\n line-height: 1.55;\n width: 100%;\n}\n/* Suggested question chips — 2-column grid */\n.ak-empty-state__suggestions {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n width: 100%;\n}\n.ak-empty-state__suggestion {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n background: color-mix(in srgb, var(--ak-accent) 5%, var(--ak-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 16%, var(--ak-border));\n border-radius: 10px;\n padding: 10px 12px;\n cursor: pointer;\n text-align: left;\n transition: background 0.15s ease, border-color 0.15s ease;\n}\n/* Odd last item spans both columns so the grid doesn't look lopsided */\n.ak-empty-state__suggestion:last-child:nth-child(odd) {\n grid-column: 1 / -1;\n}\n.ak-empty-state__suggestion:hover {\n background: color-mix(in srgb, var(--ak-accent) 10%, var(--ak-bg));\n border-color: color-mix(in srgb, var(--ak-accent) 30%, var(--ak-border));\n}\n.ak-empty-state__suggestion-title {\n font-size: 13px;\n font-weight: 700;\n color: var(--ak-text);\n line-height: 1.4;\n}\n.ak-empty-state__suggestion-desc {\n font-size: 12px;\n color: var(--ak-text-muted);\n line-height: 1.4;\n margin-top: 2px;\n}\n\n/* ── Message bubbles ─────────────────────────────────────────── */\n.ak-message {\n display: flex;\n flex-direction: column;\n max-width: 86%;\n animation: ak-msg-in 0.15s ease-out;\n}\n@keyframes ak-msg-in {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.ak-message--user {\n align-self: flex-end;\n align-items: flex-end;\n}\n.ak-message--assistant {\n align-self: flex-start;\n align-items: flex-start;\n}\n.ak-message__bubble {\n padding: 8px 12px;\n border-radius: 16px;\n font-size: 14px;\n line-height: 1.55;\n word-break: break-word;\n white-space: pre-wrap;\n max-width: 100%;\n min-width: 0;\n}\n.ak-message__bubble--md {\n white-space: normal;\n}\n.ak-message--user .ak-message__bubble {\n background: var(--ak-user-bg);\n color: var(--ak-user-text);\n border-bottom-right-radius: 4px;\n}\n.ak-message--assistant .ak-message__bubble {\n background: var(--ak-bot-bg);\n color: var(--ak-bot-text);\n border-bottom-left-radius: 4px;\n border: 1px solid var(--ak-border);\n}\n.ak-message--error .ak-message__bubble {\n background: var(--ak-danger-soft);\n color: var(--ak-danger-fg);\n border-color: var(--ak-danger-border);\n}\n.ak-message--operator .ak-message__bubble--operator {\n background: color-mix(in srgb, var(--ak-accent) 8%, var(--ak-bot-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 22%, var(--ak-border));\n}\n.ak-message__time {\n display: block;\n text-align: right;\n font-size: 11px;\n color: var(--ak-text-muted);\n margin-top: 2px;\n padding: 0 4px;\n}\n.ak-message--user .ak-message__time {\n color: rgba(255, 255, 255, 0.7);\n}\n.ak-message__sender-label {\n font-size: 11px;\n font-weight: 500;\n color: var(--ak-text-muted);\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 0 2px;\n margin-bottom: 4px;\n}\n.ak-message--operator .ak-message__sender-label {\n color: var(--ak-accent);\n font-weight: 600;\n}\n.ak-message__operator-avatar {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 18px;\n height: 18px;\n border-radius: 50%;\n background: var(--ak-accent);\n color: #fff;\n font-size: 10px;\n font-weight: 700;\n line-height: 1;\n flex-shrink: 0;\n}\n.ak-message__operator-name {\n line-height: 1;\n}\n.ak-handoff-divider {\n display: flex;\n align-items: center;\n gap: 10px;\n margin: 8px 4px;\n color: var(--ak-text-muted);\n font-size: 11px;\n font-weight: 500;\n}\n.ak-handoff-divider::before,\n.ak-handoff-divider::after {\n content: '';\n flex: 1;\n height: 1px;\n background: var(--ak-border);\n}\n.ak-handoff-divider__label {\n white-space: nowrap;\n padding: 2px 8px;\n border-radius: 999px;\n background: color-mix(in srgb, var(--ak-accent) 6%, var(--ak-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 14%, var(--ak-border));\n color: color-mix(in srgb, var(--ak-accent) 70%, var(--ak-text));\n}\n/* ── Message avatar (assistant only, when avatarUrl is set) ─── */\n.ak-message--with-avatar {\n flex-direction: row;\n align-items: flex-end;\n gap: 8px;\n}\n.ak-message__avatar {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n object-fit: cover;\n flex-shrink: 0;\n background: var(--ak-surface);\n}\n.ak-message__body {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n min-width: 0;\n}\n\n/* ── Generated images ────────────────────────────────────────── */\n\n/* Bubble that contains an image — remove padding so image is flush at top */\n.ak-message__bubble--has-image {\n padding: 0;\n overflow: hidden;\n}\n\n.ak-message__images {\n display: flex;\n flex-direction: column;\n gap: 0;\n}\n\n.ak-message__image-wrap {\n position: relative;\n line-height: 0;\n}\n\n/* Clicking the image opens it in a new tab */\n.ak-message__image-link {\n display: block;\n line-height: 0;\n}\n\n.ak-message__image {\n width: 100%;\n display: block;\n transition: filter 0.2s;\n}\n\n.ak-message__image-link:hover .ak-message__image {\n filter: brightness(0.93);\n}\n\n/* ── Image gallery (count-aware layouts) ───────────────────────────────── */\n.ak-gallery {\n position: relative;\n width: 100%;\n background: var(--ak-bg);\n overflow: hidden;\n}\n\n/* Single hero: natural aspect, contained inside a white frame so transparent\n * product PNGs read clearly. Caps at 320px tall to keep bubble compact. */\n.ak-gallery--single {\n line-height: 0;\n}\n.ak-gallery--single .ak-gallery__cell--hero {\n display: block;\n background: var(--ak-bg);\n}\n.ak-gallery__img--contain {\n width: 100%;\n max-height: 320px;\n object-fit: contain;\n background: var(--ak-bg);\n display: block;\n}\n\n/* 2-up: side-by-side squares, gap-1 */\n.ak-gallery--two {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 2px;\n background: var(--ak-border);\n}\n\n/* 3-up: big left + 2 stacked right; container holds aspect */\n.ak-gallery--three {\n display: grid;\n grid-template-columns: 2fr 1fr;\n gap: 2px;\n background: var(--ak-border);\n aspect-ratio: 4 / 3;\n}\n.ak-gallery--three > .ak-gallery__cell {\n aspect-ratio: auto;\n height: 100%;\n}\n.ak-gallery--three .ak-gallery__col {\n display: grid;\n grid-template-rows: 1fr 1fr;\n gap: 2px;\n}\n\n/* 4-up (and 5+): 2x2 grid */\n.ak-gallery--grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 2px;\n background: var(--ak-border);\n}\n\n.ak-gallery__cell {\n position: relative;\n display: block;\n overflow: hidden;\n background: var(--ak-surface);\n aspect-ratio: 1 / 1;\n line-height: 0;\n text-decoration: none;\n}\n\n/* Override aspect-ratio for the 3-up layout's column cells (they take parent height) */\n.ak-gallery--three .ak-gallery__col .ak-gallery__cell {\n aspect-ratio: auto;\n height: 100%;\n width: 100%;\n}\n\n.ak-gallery__img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n transition: transform 0.2s ease-out, filter 0.2s;\n}\n\n.ak-gallery__cell:hover .ak-gallery__img {\n transform: scale(1.04);\n filter: brightness(0.97);\n}\n\n.ak-gallery__cell:focus-visible {\n outline: 2px solid var(--ak-accent);\n outline-offset: -2px;\n}\n\n.ak-gallery__overlay {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(15, 23, 42, 0.6);\n color: #ffffff;\n font-size: 22px;\n font-weight: 600;\n letter-spacing: -0.01em;\n pointer-events: none;\n}\n\n/* ── File chips (user-uploaded .pdf/.md/.txt/.csv) ─────────────────────── */\n.ak-message__files {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px 10px 4px;\n}\n.ak-message__bubble--has-image .ak-message__files {\n padding: 8px 8px 4px;\n}\n\n.ak-file-chip {\n display: inline-flex;\n align-items: center;\n gap: 10px;\n padding: 8px 10px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border);\n border-radius: 12px;\n text-decoration: none;\n color: var(--ak-text);\n transition: border-color 0.15s, box-shadow 0.15s;\n max-width: 100%;\n}\n\n.ak-file-chip:hover {\n border-color: var(--ak-border-strong);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);\n}\n\n.ak-file-chip:focus-visible {\n outline: 2px solid var(--ak-accent);\n outline-offset: 2px;\n}\n\n.ak-file-chip__icon {\n flex-shrink: 0;\n width: 34px;\n height: 34px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n}\n\n.ak-file-chip__icon--pdf { background: #fff1f2; color: #e11d48; }\n.ak-file-chip__icon--csv { background: #ecfdf5; color: #059669; }\n.ak-file-chip__icon--md { background: #f5f3ff; color: #7c3aed; }\n.ak-file-chip__icon--txt { background: #f1f5f9; color: #475569; }\n.ak-file-chip__icon--default { background: #eef2ff; color: #4f46e5; }\n\n.ak-file-chip__body {\n display: flex;\n flex-direction: column;\n min-width: 0;\n line-height: 1.2;\n}\n\n.ak-file-chip__name {\n font-size: 13px;\n font-weight: 500;\n color: var(--ak-text);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 220px;\n}\n\n.ak-file-chip__label {\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 0.05em;\n color: var(--ak-text-muted);\n margin-top: 2px;\n}\n\n/* In user-side bubble (dark primary background), invert chip surface for legibility */\n.ak-message--user .ak-file-chip {\n background: rgba(255, 255, 255, 0.96);\n border-color: transparent;\n}\n\n/* ── Voice note player (audio attachment) ──────────────────────────────── */\n.ak-audio-chip {\n display: inline-flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px 10px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border);\n border-radius: 12px;\n max-width: 100%;\n}\n\n.ak-message--user .ak-audio-chip {\n background: rgba(255, 255, 255, 0.96);\n border-color: transparent;\n}\n\n.ak-audio-chip__player {\n height: 36px;\n max-width: 260px;\n}\n\n.ak-audio-chip__transcript {\n margin: 0;\n font-size: 12px;\n font-style: italic;\n line-height: 1.4;\n color: var(--ak-text-muted);\n}\n\n/* ── Lightbox (image preview modal) ────────────────────────────────────── */\n.ak-lightbox {\n position: fixed;\n inset: 0;\n z-index: 2147483600; /* near max int — sits above any host-page content */\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n background: rgba(15, 23, 42, 0.85);\n backdrop-filter: blur(6px);\n -webkit-backdrop-filter: blur(6px);\n animation: ak-lightbox-in 0.12s ease-out;\n}\n\n@keyframes ak-lightbox-in {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n.ak-lightbox__img {\n max-width: 92vw;\n max-height: 88vh;\n border-radius: 8px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);\n user-select: none;\n display: block;\n}\n\n.ak-lightbox__toolbar {\n position: absolute;\n top: 16px;\n right: 16px;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.ak-lightbox__counter {\n display: inline-flex;\n align-items: center;\n height: 28px;\n padding: 0 12px;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n font-size: 12px;\n font-weight: 500;\n font-variant-numeric: tabular-nums;\n}\n\n.ak-lightbox__btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border: none;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n cursor: pointer;\n transition: background 0.15s;\n text-decoration: none;\n padding: 0;\n}\n\n.ak-lightbox__btn:hover {\n background: rgba(255, 255, 255, 0.22);\n}\n\n.ak-lightbox__btn:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.8);\n outline-offset: 2px;\n}\n\n.ak-lightbox__nav {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border: none;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n cursor: pointer;\n transition: background 0.15s;\n padding: 0;\n}\n\n.ak-lightbox__nav:hover {\n background: rgba(255, 255, 255, 0.22);\n}\n\n.ak-lightbox__nav--prev { left: 16px; }\n.ak-lightbox__nav--next { right: 16px; }\n\n.ak-lightbox__nav:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.8);\n outline-offset: 2px;\n}\n\n/* Gallery cells must be styled as plain buttons (we converted from <a>) */\n.ak-gallery__cell {\n border: none;\n padding: 0;\n margin: 0;\n cursor: zoom-in;\n font: inherit;\n color: inherit;\n background: var(--ak-surface);\n}\n\n.ak-gallery__cell:focus-visible {\n outline: 2px solid var(--ak-accent);\n outline-offset: -2px;\n}\n\n/* Faint download icon — always present, top-right corner of the image */\n.ak-message__image-dl-icon {\n position: absolute;\n top: 8px;\n right: 8px;\n width: 26px;\n height: 26px;\n background: rgba(0, 0, 0, 0.28);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: rgba(255, 255, 255, 0.75);\n text-decoration: none;\n transition: background 0.15s, color 0.15s;\n}\n\n.ak-message__image-dl-icon:hover {\n background: rgba(0, 0, 0, 0.55);\n color: #ffffff;\n}\n\n/* Caption / text below the image, inside the same bubble */\n.ak-message__image-caption {\n padding: 8px 10px 8px;\n font-size: 14px;\n font-style: normal;\n color: var(--ak-text);\n line-height: 1.45;\n}\n\n/* User-uploaded image caption uses user bubble colors */\n.ak-message--user .ak-message__image-caption {\n color: rgba(255, 255, 255, 0.8);\n font-style: normal;\n}\n\n/* ── Typing indicator ────────────────────────────────────────── */\n.ak-typing {\n display: flex;\n align-items: center;\n gap: 5px;\n padding: 9px 12px;\n background: var(--ak-bot-bg);\n border-radius: 16px;\n border-bottom-left-radius: 4px;\n border: 1px solid var(--ak-border);\n align-self: flex-start;\n width: fit-content;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-typing__dot {\n width: 7px;\n height: 7px;\n background: var(--ak-text-muted);\n border-radius: 50%;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-typing__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-typing__dot:nth-child(3) { animation-delay: 0.4s; }\n@keyframes ak-bounce {\n 0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }\n 30% { transform: translateY(-5px); opacity: 1; }\n}\n\n/* ── Init status (validating / error) ───────────────────────── */\n.ak-init-status {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 24px;\n}\n.ak-init-spinner {\n width: 28px;\n height: 28px;\n border: 3px solid var(--ak-border);\n border-top-color: var(--ak-accent);\n border-radius: 50%;\n animation: ak-spin 0.7s linear infinite;\n}\n@keyframes ak-spin {\n to { transform: rotate(360deg); }\n}\n.ak-init-status--error {\n justify-content: flex-start;\n}\n.ak-init-status--maintenance {\n padding: 28px 24px;\n}\n\n/* ── Composer ────────────────────────────────────────────────── */\n.ak-composer {\n position: relative; /* establishes positioning context for the attachment submenu */\n padding: 8px 12px 10px;\n border-top: 1px solid var(--ak-border);\n display: flex;\n flex-direction: column;\n gap: 8px;\n background: var(--ak-bg);\n flex-shrink: 0;\n}\n\n/* Hidden native file input */\n.ak-composer__file-input {\n display: none;\n}\n\n/* Composer card — the dashboard ChatComposer layout: the message row (text, mic at its\n right edge) over a divider and a toolbar (+ … send), both on the same side padding.\n The + and mic glyphs (20px in a 32px box) are pulled flush with the text edges. */\n.ak-composer__input-wrap {\n display: flex;\n flex-direction: column;\n background: var(--ak-bg);\n border: 1px solid color-mix(in srgb, var(--ak-border-strong) 40%, transparent);\n border-radius: 16px;\n box-shadow: 0 1px 3px rgba(14, 18, 32, 0.06), 0 1px 2px rgba(14, 18, 32, 0.04);\n transition: border-color 0.15s;\n}\n.ak-composer__input-wrap:focus-within {\n border-color: var(--ak-accent);\n}\n.ak-composer__row {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 10px 12px 8px;\n}\n.ak-composer__toolbar {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 12px;\n border-top: 1px solid var(--ak-border);\n}\n\n/* Attach button wrapper */\n.ak-composer__attach-wrap {\n flex-shrink: 0;\n margin-left: -6px;\n}\n\n/* Icon controls (\"+\" and mic): borderless, a hover fill rather than an outline */\n.ak-composer__attach,\n.ak-composer__mic {\n width: 32px;\n height: 32px;\n border-radius: 8px;\n background: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--ak-text-muted);\n transition: color 0.15s, background 0.15s;\n flex-shrink: 0;\n}\n.ak-composer__attach:hover:not(:disabled),\n.ak-composer__mic:hover:not(:disabled),\n.ak-composer__attach--open {\n color: var(--ak-text);\n background: var(--ak-hover);\n}\n.ak-composer__attach:focus-visible,\n.ak-composer__mic:focus-visible,\n.ak-composer__send:focus-visible {\n outline: 2px solid var(--ak-accent);\n outline-offset: 2px;\n}\n.ak-composer__attach:disabled,\n.ak-composer__mic:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n/* Flush right, and -4px vertically so the 32px box doesn't grow the 24px text row */\n.ak-composer__mic {\n margin: -4px -6px -4px 0;\n}\n\n/* Attachment submenu — floats above the composer, positioned relative to .ak-composer */\n.ak-composer__attach-menu {\n position: absolute;\n bottom: calc(100% + 6px);\n left: 12px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border);\n border-radius: 10px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n padding: 4px;\n min-width: 130px;\n z-index: 10;\n}\n\n/* Individual item inside the attachment submenu */\n.ak-composer__attach-menu-item {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 7px 10px;\n border: none;\n border-radius: 7px;\n background: transparent;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 13px;\n cursor: pointer;\n transition: background 0.12s;\n text-align: left;\n}\n.ak-composer__attach-menu-item:hover:not(:disabled) {\n background: var(--ak-bg);\n}\n.ak-composer__attach-menu-item:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n/* Textarea — borderless, transparent, fills the message row */\n.ak-composer__input {\n flex: 1;\n padding: 0;\n border: none;\n border-radius: 0;\n background: transparent;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 16px; /* iOS zooms the page when a focused input is under 16px */\n line-height: 1.5;\n resize: none;\n outline: none;\n min-height: 24px;\n max-height: 110px;\n overflow-y: auto;\n}\n.ak-composer__input::placeholder {\n color: var(--ak-text-muted);\n}\n\n/* Recording bar — replaces the input row while a voice note is being recorded */\n.ak-composer__recording {\n display: flex;\n align-items: center;\n gap: 10px;\n flex: 1;\n padding: 8px 12px;\n}\n.ak-composer__recording-timer {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 13px;\n font-variant-numeric: tabular-nums;\n}\n.ak-composer__recording-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--ak-danger);\n animation: ak-recording-pulse 1.4s ease-in-out infinite;\n}\n@keyframes ak-recording-pulse {\n 0%,\n 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.35;\n }\n}\n.ak-composer__recording-cancel,\n.ak-composer__recording-stop {\n width: 32px;\n height: 32px;\n border-radius: 8px;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n transition: background 0.15s, color 0.15s;\n}\n.ak-composer__recording-cancel {\n background: transparent;\n color: var(--ak-text-muted);\n}\n.ak-composer__recording-cancel:hover {\n color: var(--ak-text);\n background: var(--ak-hover);\n}\n.ak-composer__recording-stop {\n background: var(--ak-accent);\n color: white;\n}\n.ak-composer__recording-stop:hover {\n background: var(--ak-accent-hover);\n}\n\n/* Send button — rounded square at the toolbar's right end */\n.ak-composer__send {\n width: 32px;\n height: 32px;\n margin-left: auto;\n border-radius: 8px;\n background: var(--ak-accent);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n transition: background 0.15s, color 0.15s;\n flex-shrink: 0;\n}\n.ak-composer__send:hover:not(:disabled) {\n background: var(--ak-accent-hover);\n}\n/* Disabled sits on the muted fill rather than a faded accent, so it stays visible on dark */\n.ak-composer__send:disabled {\n background: var(--ak-bot-bg);\n color: var(--ak-text-muted);\n cursor: not-allowed;\n}\n\n/* Old photo button — hidden but keep so file-input trigger still works */\n.ak-composer__photo {\n display: none;\n}\n\n/* Image preview strip above the input row */\n.ak-composer__preview {\n display: flex;\n gap: 6px;\n padding: 0 2px;\n}\n.ak-composer__preview-wrap {\n position: relative;\n width: 60px;\n height: 60px;\n border-radius: 8px;\n overflow: hidden;\n border: 1px solid var(--ak-border);\n flex-shrink: 0;\n}\n.ak-composer__preview-img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n}\n.ak-composer__preview-remove {\n position: absolute;\n top: 3px;\n right: 3px;\n width: 18px;\n height: 18px;\n border-radius: 50%;\n background: rgba(0, 0, 0, 0.55);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #ffffff;\n padding: 0;\n transition: background 0.15s;\n}\n.ak-composer__preview-remove:hover {\n background: rgba(0, 0, 0, 0.8);\n}\n\n/* ── Streaming cursor ────────────────────────────────────────── */\n.ak-cursor {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n margin-left: 4px;\n vertical-align: middle;\n}\n.ak-cursor__dot {\n display: inline-block;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: currentColor;\n opacity: 0.6;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-cursor__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-cursor__dot:nth-child(3) { animation-delay: 0.4s; }\n\n/* Pre-first-chunk wait — deliberately shares the metrics of .ak-progress__item\n and .ak-progress__summary so dots → activity line → summary never reflow. */\n.ak-typing-row {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 2px 0;\n margin: 0 0 4px;\n /* One text line at the shared row metrics, so the dots occupy exactly the\n box the activity line and summary will occupy (border-box). */\n min-height: calc(0.76rem * 1.4 + 4px);\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-typing-row__dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--ak-bot-text);\n opacity: 0.5;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-typing-row__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-typing-row__dot:nth-child(3) { animation-delay: 0.4s; }\n@media (prefers-reduced-motion: reduce) {\n .ak-typing-row__dot,\n .ak-cursor__dot,\n .ak-typing__dot,\n .ak-progress__item--active,\n .ak-agent-status__icon {\n animation: none;\n }\n}\n\n/* ── Markdown rendering ──────────────────────────────────────── */\n.ak-message__bubble--md {\n white-space: normal;\n min-width: 0;\n}\n.ak-message__bubble--md .ak-md-p {\n margin: 0 0 0.4em 0;\n}\n.ak-message__bubble--md .ak-md-p:last-child {\n margin-bottom: 0;\n}\n/* Collapse margins between paragraph and following list */\n.ak-message__bubble--md .ak-md-p + .ak-md-ul,\n.ak-message__bubble--md .ak-md-p + .ak-md-ol {\n margin-top: 0;\n}\n.ak-message__bubble--md .ak-md-h1,\n.ak-message__bubble--md .ak-md-h2,\n.ak-message__bubble--md .ak-md-h3 {\n font-weight: 700;\n line-height: 1.3;\n margin: 0.6em 0 0.3em;\n}\n.ak-message__bubble--md .ak-md-h1:first-child,\n.ak-message__bubble--md .ak-md-h2:first-child,\n.ak-message__bubble--md .ak-md-h3:first-child {\n margin-top: 0;\n}\n.ak-message__bubble--md .ak-md-h1 { font-size: 1.12em; }\n.ak-message__bubble--md .ak-md-h2 { font-size: 1.04em; }\n.ak-message__bubble--md .ak-md-h3 { font-size: 0.97em; }\n.ak-message__bubble--md .ak-md-ul,\n.ak-message__bubble--md .ak-md-ol {\n padding-left: 1.4em;\n margin: 0.4em 0;\n}\n.ak-message__bubble--md .ak-md-ul li,\n.ak-message__bubble--md .ak-md-ol li {\n margin-bottom: 0.15em;\n}\n.ak-message__bubble--md .ak-md-pre-wrap {\n position: relative;\n margin: 0.4em 0;\n border-radius: 6px;\n overflow-x: auto;\n overflow-y: hidden;\n background: rgba(0, 0, 0, 0.08);\n max-width: 100%;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-pre-wrap {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-message__bubble--md .ak-md-pre-lang {\n display: block;\n padding: 3px 10px;\n font-size: 10px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n opacity: 0.55;\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\n}\n.ak-message--user .ak-message__bubble--md .ak-md-pre-lang {\n border-bottom-color: rgba(255, 255, 255, 0.15);\n}\n.ak-message__bubble--md .ak-md-pre {\n margin: 0;\n padding: 8px 10px;\n font-size: 12px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n white-space: pre;\n box-sizing: border-box;\n}\n.ak-message__bubble--md .ak-md-code {\n display: block;\n font-family: inherit;\n font-size: inherit;\n}\n.ak-message__bubble--md .ak-md-ic {\n background: rgba(0, 0, 0, 0.08);\n border-radius: 3px;\n padding: 1px 5px;\n font-size: 0.87em;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-ic {\n background: rgba(255, 255, 255, 0.2);\n}\n.ak-message__bubble--md .ak-md-hr {\n border: none;\n border-top: 1px solid currentColor;\n opacity: 0.2;\n margin: 0.5em 0;\n}\n.ak-message__bubble--md a {\n color: var(--ak-accent);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.ak-message--user .ak-message__bubble--md a {\n color: rgba(255, 255, 255, 0.9);\n}\n.ak-message__bubble--md .ak-md-table {\n width: 100%;\n border-collapse: collapse;\n margin: 0.4em 0;\n font-size: 0.95em;\n line-height: 1.5;\n}\n.ak-message__bubble--md .ak-md-th {\n padding: 8px 10px;\n text-align: left;\n border-bottom: 2px solid var(--ak-accent) !important;\n background: color-mix(in srgb, var(--ak-accent) 8%, transparent) !important;\n font-weight: 600;\n color: var(--ak-text) !important;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-th {\n border-bottom-color: rgba(255, 255, 255, 0.5) !important;\n background: rgba(0, 0, 0, 0.25) !important;\n color: #ffffff !important;\n font-weight: 700;\n}\n.ak-message__bubble--md .ak-md-td {\n padding: 6px 10px;\n border-bottom: 1px solid var(--ak-border) !important;\n color: var(--ak-text) !important;\n}\n.ak-message__bubble--md tr:nth-child(even) .ak-md-td {\n background: color-mix(in srgb, var(--ak-surface), transparent 40%) !important;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-td {\n color: #ffffff !important;\n border-bottom-color: rgba(255, 255, 255, 0.25) !important;\n}\n.ak-message--user .ak-message__bubble--md tr:nth-child(even) .ak-md-td {\n background: rgba(0, 0, 0, 0.15) !important;\n}\n\n/* ── Composer disclaimer ─────────────────────────────────────── */\n.ak-composer__disclaimer {\n font-size: 11px;\n color: var(--ak-text-muted);\n text-align: center;\n line-height: 1.4;\n}\n.ak-composer__disclaimer a {\n color: var(--ak-text-muted);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.ak-composer__disclaimer a:hover {\n color: var(--ak-accent);\n}\n\n/* ── Maintenance state ───────────────────────────────────────── */\n.ak-maintenance {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n max-width: 320px;\n padding: 8px 4px;\n animation: ak-maintenance-enter 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;\n}\n.ak-maintenance__halo {\n position: absolute;\n top: -6px;\n left: 50%;\n width: 120px;\n height: 120px;\n transform: translateX(-50%);\n border-radius: 50%;\n background: radial-gradient(\n closest-side,\n var(--ak-maintenance-halo) 0%,\n transparent 72%\n );\n opacity: 0.22;\n filter: blur(4px);\n pointer-events: none;\n animation: ak-maintenance-pulse 2.8s ease-in-out infinite;\n}\n.ak-maintenance__icon {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 56px;\n border-radius: 50%;\n background: var(--ak-maintenance-bg);\n color: var(--ak-maintenance-fg);\n border: 1px solid color-mix(in srgb, var(--ak-maintenance-halo) 40%, transparent);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n}\n.ak-maintenance__title {\n margin-top: 16px;\n font-size: 15px;\n font-weight: 600;\n color: var(--ak-text);\n line-height: 1.3;\n letter-spacing: -0.01em;\n}\n.ak-maintenance__description {\n margin-top: 6px;\n font-size: 13px;\n color: var(--ak-text-muted);\n line-height: 1.5;\n max-width: 28ch;\n}\n\n@keyframes ak-maintenance-enter {\n from {\n opacity: 0;\n transform: translateY(6px) scale(0.98);\n }\n to {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n}\n@keyframes ak-maintenance-pulse {\n 0%, 100% { opacity: 0.18; transform: translateX(-50%) scale(1); }\n 50% { opacity: 0.32; transform: translateX(-50%) scale(1.06); }\n}\n@media (prefers-reduced-motion: reduce) {\n .ak-maintenance,\n .ak-maintenance__halo,\n .ak-maintenance__icon {\n animation: none;\n }\n}\n\n/* ── Error banner ────────────────────────────────────────────── */\n.ak-error {\n padding: 12px 16px;\n background: var(--ak-danger-soft);\n color: var(--ak-danger-fg);\n font-size: 13px;\n border-top: 1px solid var(--ak-danger-border);\n text-align: left;\n flex-shrink: 0;\n display: flex;\n align-items: flex-start;\n gap: 10px;\n}\n\n.ak-error__icon {\n font-size: 16px;\n line-height: 1;\n flex-shrink: 0;\n margin-top: 1px;\n}\n\n.ak-error__content {\n flex: 1;\n}\n\n.ak-error__title {\n font-size: 14px;\n font-weight: 600;\n margin: 0 0 4px 0;\n line-height: 1.3;\n}\n\n.ak-error__description {\n font-size: 13px;\n margin: 0 0 4px 0;\n line-height: 1.4;\n opacity: 0.9;\n}\n\n.ak-error__message {\n font-size: 13px;\n margin: 0;\n line-height: 1.4;\n opacity: 0.85;\n}\n\n/* Specific styling for origin restriction errors */\n.ak-error--origin {\n background: var(--ak-warning-soft); /* warning, not danger: less alarming */\n color: var(--ak-warning-fg);\n border-top: 1px solid var(--ak-warning);\n}\n\n/* ── Agent status indicator ──────────────────────────────────── */\n/* Same bare row as .ak-progress__item / .ak-typing-row — activity-off tenants\n see the tool status swap in without the surrounding box changing size. */\n.ak-agent-status {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n margin-bottom: 4px;\n padding: 2px 0;\n color: var(--ak-bot-text);\n font-size: 0.76rem;\n line-height: 1.4;\n opacity: 0.6;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-agent-status__icon {\n flex-shrink: 0;\n color: var(--ak-accent);\n animation: ak-sparkle-pulse 2.5s ease-in-out infinite;\n}\n.ak-agent-status__text {\n line-height: 1.4;\n}\n@keyframes ak-sparkle-pulse {\n 0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }\n 50% { opacity: 0.45; transform: scale(0.85) rotate(15deg); }\n}\n\n/* ── Progress block (tool execution / streaming chain) ───────── */\n.ak-progress {\n margin-bottom: 4px;\n max-width: 80%;\n}\n.ak-progress__block {\n display: inline-flex;\n flex-direction: column;\n gap: 3px;\n padding: 6px 12px;\n border-radius: 14px;\n background: var(--ak-bot-bg);\n border: 1px solid var(--ak-border);\n font-size: 0.8rem;\n color: var(--ak-bot-text);\n opacity: 0.85;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-progress__header {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.ak-progress__label {\n font-weight: 600;\n font-size: 0.78rem;\n color: var(--ak-accent);\n}\n.ak-progress__toggle {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n padding: 1px 7px;\n border: 1px solid var(--ak-border);\n border-radius: 8px;\n background: transparent;\n color: var(--ak-bot-text);\n font-size: 0.72rem;\n cursor: pointer;\n opacity: 0.65;\n transition: opacity 0.15s;\n}\n.ak-progress__toggle:hover { opacity: 0.9; }\n.ak-progress__toggle--collapsed {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 5px 10px;\n border: 1px solid var(--ak-border);\n border-radius: 12px;\n background: transparent;\n color: var(--ak-bot-text);\n font-size: 0.78rem;\n cursor: pointer;\n opacity: 0.55;\n transition: opacity 0.15s;\n margin-bottom: 4px;\n}\n.ak-progress__toggle--collapsed:hover { opacity: 0.85; }\n.ak-progress__text {\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n line-height: 1.4;\n margin: 0;\n}\n/* Active streaming state */\n.ak-progress__list {\n list-style: none;\n margin: 0 0 4px;\n padding: 0;\n}\n/* Bare row, not a pill — identical metrics to .ak-progress__summary so the\n live line and the post-turn \"Worked for Ns\" swap without a size change. */\n.ak-progress__item {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n font-size: 0.76rem;\n line-height: 1.4;\n color: var(--ak-bot-text);\n opacity: 0.6;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-progress__item--active {\n /* inherits base .ak-progress__item; subtle pulse to signal in-flight */\n animation: ak-msg-in 0.15s ease-out, ak-active-pulse 2s ease-in-out infinite;\n}\n@keyframes ak-active-pulse {\n 0%, 100% { opacity: 0.6; }\n 50% { opacity: 0.9; }\n}\n/* Claude-style step list (detailed mode) */\n.ak-progress__steps {\n list-style: none;\n margin: 0 0 4px;\n padding: 2px 0;\n}\n.ak-progress__step {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n opacity: 0.6;\n line-height: 1.4;\n}\n.ak-progress__step--active {\n opacity: 0.9;\n}\n.ak-progress__step-text {\n min-width: 0;\n}\n.ak-progress__step-dur {\n opacity: 0.65;\n flex-shrink: 0;\n}\n.ak-progress__step-icon {\n flex-shrink: 0;\n opacity: 0.55;\n}\n.ak-progress__step-icon--fail {\n color: var(--ak-danger);\n opacity: 0.9;\n}\n/* Post-turn summary row (\"Worked for Ns · N steps\") */\n.ak-progress__summary {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n margin: 0 0 4px;\n /* Shrink-to-fit as a column flex item would otherwise break \"Worked for 8.4s\"\n onto two lines, doubling the row height as the turn ends. */\n white-space: nowrap;\n border: none;\n background: transparent;\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n opacity: 0.6;\n cursor: pointer;\n transition: opacity 0.15s;\n}\n.ak-progress__summary:hover { opacity: 0.85; }\n.ak-progress__summary--static {\n cursor: default;\n}\n.ak-progress__summary--static:hover { opacity: 0.6; }\n.ak-progress__spinner {\n display: inline-block;\n width: 11px;\n height: 11px;\n border: 1.5px solid var(--ak-border);\n border-top-color: var(--ak-accent);\n border-radius: 50%;\n flex-shrink: 0;\n animation: ak-spin 0.7s linear infinite;\n}\n\n/* ── Powered by hanging tab ──────────────────────────────────── */\n.ak-branding {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px 4px;\n background: var(--ak-bg);\n border: 1px solid var(--ak-border);\n border-top: none;\n border-radius: 0 0 8px 8px;\n margin-left: 16px;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);\n}\n.ak-branding__logo {\n width: 11px;\n height: 11px;\n flex-shrink: 0;\n color: var(--ak-accent);\n opacity: 0.75;\n}\n.ak-branding__label {\n font-size: 9px;\n color: var(--ak-text-muted);\n opacity: 0.75;\n}\n.ak-branding__name {\n font-size: 9px;\n font-weight: 600;\n color: var(--ak-accent);\n opacity: 0.75;\n letter-spacing: -0.01em;\n}\n\n/* ── Mobile: full-viewport panel ─────────────────────────────── */\n@media (max-width: 639px) {\n @keyframes ak-panel-in-mobile {\n from { opacity: 0; transform: translateY(32px); }\n to { opacity: 1; transform: translateY(0); }\n }\n\n /* The shadow host (data-agentkit-widget) sits inside the outer fixed container.\n Give it its own fixed position so it fills the viewport independently,\n bypassing the outer container's bottom/right offsets. */\n :host([data-open]) {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 2147483647;\n pointer-events: none;\n }\n\n :host([data-open]) .ak-floating {\n width: 100%;\n height: 100%;\n align-items: stretch;\n gap: 0;\n }\n\n :host([data-open]) .ak-shell-wrap {\n flex: 1;\n min-height: 0;\n width: 100%;\n align-items: stretch;\n /* Launcher is hidden here — the negative offset would leave a dead strip. */\n margin-bottom: 0;\n }\n\n :host([data-open]) .ak-shell--floating {\n width: 100%;\n flex: 1;\n height: auto;\n border-radius: 0;\n box-shadow: none;\n border-left: none;\n border-right: none;\n border-top: none;\n }\n\n :host([data-open]) .ak-launcher {\n display: none;\n }\n\n :host([data-open]) .ak-shell-enter {\n animation: ak-panel-in-mobile 0.22s ease-out;\n }\n\n :host([data-open]) .ak-branding {\n display: none;\n }\n}\n";
|
|
5819
|
+
// ../../packages/widget-ui/src/components/Header.tsx
|
|
5820
|
+
function ka() {
|
|
5803
5821
|
return /* @__PURE__ */ l("svg", {
|
|
5804
5822
|
width: "16",
|
|
5805
5823
|
height: "16",
|
|
@@ -5838,7 +5856,7 @@ function Ea() {
|
|
|
5838
5856
|
]
|
|
5839
5857
|
});
|
|
5840
5858
|
}
|
|
5841
|
-
function
|
|
5859
|
+
function Aa() {
|
|
5842
5860
|
return /* @__PURE__ */ l("svg", {
|
|
5843
5861
|
width: "14",
|
|
5844
5862
|
height: "14",
|
|
@@ -5860,7 +5878,7 @@ function Da() {
|
|
|
5860
5878
|
})]
|
|
5861
5879
|
});
|
|
5862
5880
|
}
|
|
5863
|
-
function
|
|
5881
|
+
function ja() {
|
|
5864
5882
|
return /* @__PURE__ */ l("svg", {
|
|
5865
5883
|
width: "16",
|
|
5866
5884
|
height: "16",
|
|
@@ -5873,7 +5891,7 @@ function Oa() {
|
|
|
5873
5891
|
children: [/* @__PURE__ */ c("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), /* @__PURE__ */ c("path", { d: "M3 3v5h5" })]
|
|
5874
5892
|
});
|
|
5875
5893
|
}
|
|
5876
|
-
function
|
|
5894
|
+
function Ma({ title: e, subtitle: t, avatarUrl: n, onClose: r, onReset: i, hideClose: a = !1 }) {
|
|
5877
5895
|
let [s, u] = o(!1);
|
|
5878
5896
|
return /* @__PURE__ */ l("div", {
|
|
5879
5897
|
className: `ak-header${s ? " ak-header--confirming" : ""}`,
|
|
@@ -5888,7 +5906,7 @@ function ka({ title: e, subtitle: t, avatarUrl: n, onClose: r, onReset: i, hideC
|
|
|
5888
5906
|
}) : /* @__PURE__ */ c("span", {
|
|
5889
5907
|
className: "ak-header__bot-icon",
|
|
5890
5908
|
"aria-hidden": "true",
|
|
5891
|
-
children: /* @__PURE__ */ c(
|
|
5909
|
+
children: /* @__PURE__ */ c(ka, {})
|
|
5892
5910
|
}),
|
|
5893
5911
|
/* @__PURE__ */ l("div", {
|
|
5894
5912
|
className: "ak-header__title-group",
|
|
@@ -5917,14 +5935,14 @@ function ka({ title: e, subtitle: t, avatarUrl: n, onClose: r, onReset: i, hideC
|
|
|
5917
5935
|
"aria-label": "New conversation",
|
|
5918
5936
|
type: "button",
|
|
5919
5937
|
title: "Start a new conversation (Retains current conversation to memory)",
|
|
5920
|
-
children: /* @__PURE__ */ c(
|
|
5938
|
+
children: /* @__PURE__ */ c(ja, {})
|
|
5921
5939
|
}),
|
|
5922
5940
|
!a && /* @__PURE__ */ c("button", {
|
|
5923
5941
|
className: "ak-header__close",
|
|
5924
5942
|
onClick: r,
|
|
5925
5943
|
"aria-label": "Close chat",
|
|
5926
5944
|
type: "button",
|
|
5927
|
-
children: /* @__PURE__ */ c(
|
|
5945
|
+
children: /* @__PURE__ */ c(Aa, {})
|
|
5928
5946
|
})
|
|
5929
5947
|
]
|
|
5930
5948
|
})
|
|
@@ -5960,9 +5978,8 @@ function ka({ title: e, subtitle: t, avatarUrl: n, onClose: r, onReset: i, hideC
|
|
|
5960
5978
|
})]
|
|
5961
5979
|
});
|
|
5962
5980
|
}
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
function Aa(e) {
|
|
5981
|
+
// ../../packages/widget-ui/src/lib/safe-url.ts
|
|
5982
|
+
function Na(e) {
|
|
5966
5983
|
if (!e) return null;
|
|
5967
5984
|
let t = e.trim();
|
|
5968
5985
|
if (!t) return null;
|
|
@@ -5975,14 +5992,12 @@ function Aa(e) {
|
|
|
5975
5992
|
"tel"
|
|
5976
5993
|
].includes(n) ? t : null : t;
|
|
5977
5994
|
}
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
return e.replace(/\\text\{([^}]*)\}/g, "$1").replace(/\\implies/g, "→").replace(/\\Rightarrow/g, "⟹").replace(/\\times/g, "×").replace(/\\div/g, "÷").replace(/\\cdot/g, "·").replace(/\\quad/g, " ").replace(/\\qquad/g, " ").replace(/\\leq/g, "≤").replace(/\\geq/g, "≥").replace(/\\neq/g, "≠").replace(/\\approx/g, "≈").replace(/\\infty/g, "∞").replace(/\\\((.+?)\\\)/gs, "$1").replace(/\\\[[\s\S]+?\\\]/g, "").replace(/\\\$/g, "\0DOLLAR\0").replace(/\$\$(?!\d)[\s\S]+?\$\$/g, "").replace(/\$(?![\s\d])([^$\n]+?)(?<!\s)\$/g, "$1").replace(/\x00DOLLAR\x00/g, "$").replace(/\\[a-zA-Z]+\*?/g, "").replace(/\n{3,}/g, "\n\n");
|
|
5995
|
+
// ../../packages/widget-ui/src/lib/strip-latex.ts
|
|
5996
|
+
function Pa(e) {
|
|
5997
|
+
return e.replace(/\\text\{([^}]*)\}/g, "$1").replace(/\\implies/g, "→").replace(/\\Rightarrow/g, "⟹").replace(/\\times/g, "×").replace(/\\div/g, "÷").replace(/\\cdot/g, "·").replace(/\\quad/g, " ").replace(/\\qquad/g, " ").replace(/\\leq/g, "≤").replace(/\\geq/g, "≥").replace(/\\neq/g, "≠").replace(/\\approx/g, "≈").replace(/\\infty/g, "∞").replace(/\\\((.+?)\\\)/gs, "$1").replace(/\\\[[\s\S]+?\\\]/g, "").replace(/\\\$/g, "\0DOLLAR\0").replace(/\$\$(?!\d)[\s\S]+?\$\$/g, "").replace(/\$(?![\s\d])([^$\n]+?)(?<!\s)\$(?!\d)/g, "$1").replace(/\x00DOLLAR\x00/g, "$").replace(/\\[a-zA-Z]+\*?/g, "").replace(/\n{3,}/g, "\n\n");
|
|
5982
5998
|
}
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
function Ma(e) {
|
|
5999
|
+
// ../../packages/widget-ui/src/components/ProgressBlock.tsx
|
|
6000
|
+
function Fa(e) {
|
|
5986
6001
|
let [, t] = o(0);
|
|
5987
6002
|
r(() => {
|
|
5988
6003
|
if (!e) return;
|
|
@@ -5990,8 +6005,8 @@ function Ma(e) {
|
|
|
5990
6005
|
return () => clearInterval(n);
|
|
5991
6006
|
}, [e]);
|
|
5992
6007
|
}
|
|
5993
|
-
var
|
|
5994
|
-
function
|
|
6008
|
+
var Ia = 800;
|
|
6009
|
+
function La({ up: e }) {
|
|
5995
6010
|
return /* @__PURE__ */ c("svg", {
|
|
5996
6011
|
width: "10",
|
|
5997
6012
|
height: "10",
|
|
@@ -6005,7 +6020,7 @@ function Pa({ up: e }) {
|
|
|
6005
6020
|
children: /* @__PURE__ */ c("polyline", { points: e ? "18 15 12 9 6 15" : "6 9 12 15 18 9" })
|
|
6006
6021
|
});
|
|
6007
6022
|
}
|
|
6008
|
-
function
|
|
6023
|
+
function Ra({ event: e, active: t }) {
|
|
6009
6024
|
return t ? /* @__PURE__ */ c("span", {
|
|
6010
6025
|
className: "ak-progress__spinner",
|
|
6011
6026
|
"aria-hidden": "true"
|
|
@@ -6033,8 +6048,8 @@ function Fa({ event: e, active: t }) {
|
|
|
6033
6048
|
})] }) : /* @__PURE__ */ c("polyline", { points: "20 6 9 17 4 12" })
|
|
6034
6049
|
});
|
|
6035
6050
|
}
|
|
6036
|
-
function
|
|
6037
|
-
|
|
6051
|
+
function za({ events: e, live: t, answerStartedAtMs: n }) {
|
|
6052
|
+
Fa(t && !n && e.some((e) => e.status === "active"));
|
|
6038
6053
|
let r = n ?? Date.now(), i = e[0]?.startedAtMs, a = e.reduce((e, t, n) => t.status === "active" ? n : e, -1);
|
|
6039
6054
|
return /* @__PURE__ */ c("ul", {
|
|
6040
6055
|
className: "ak-progress__steps",
|
|
@@ -6044,7 +6059,7 @@ function Ia({ events: e, live: t, answerStartedAtMs: n }) {
|
|
|
6044
6059
|
return /* @__PURE__ */ l("li", {
|
|
6045
6060
|
className: o ? "ak-progress__step ak-progress__step--active" : "ak-progress__step",
|
|
6046
6061
|
children: [
|
|
6047
|
-
/* @__PURE__ */ c(
|
|
6062
|
+
/* @__PURE__ */ c(Ra, {
|
|
6048
6063
|
event: e,
|
|
6049
6064
|
active: o
|
|
6050
6065
|
}),
|
|
@@ -6061,11 +6076,11 @@ function Ia({ events: e, live: t, answerStartedAtMs: n }) {
|
|
|
6061
6076
|
})
|
|
6062
6077
|
});
|
|
6063
6078
|
}
|
|
6064
|
-
function
|
|
6079
|
+
function Ba({ events: e, answerStartedAtMs: t }) {
|
|
6065
6080
|
let [n, i] = o(0), a = Math.min(n, e.length - 1), s = a < e.length - 1;
|
|
6066
6081
|
r(() => {
|
|
6067
6082
|
if (!s) return;
|
|
6068
|
-
let t = setTimeout(() => i((t) => Math.min(t + 1, e.length - 1)),
|
|
6083
|
+
let t = setTimeout(() => i((t) => Math.min(t + 1, e.length - 1)), Ia);
|
|
6069
6084
|
return () => clearTimeout(t);
|
|
6070
6085
|
}, [
|
|
6071
6086
|
s,
|
|
@@ -6073,7 +6088,7 @@ function La({ events: e, answerStartedAtMs: t }) {
|
|
|
6073
6088
|
e.length
|
|
6074
6089
|
]);
|
|
6075
6090
|
let u = e[a], d = !s && u.status === "done";
|
|
6076
|
-
|
|
6091
|
+
Fa(!d && !t);
|
|
6077
6092
|
let f = e[0]?.startedAtMs, p = d ? null : $i(f ? (t ?? Date.now()) - f : void 0);
|
|
6078
6093
|
return /* @__PURE__ */ c("ul", {
|
|
6079
6094
|
className: "ak-progress__list",
|
|
@@ -6081,7 +6096,7 @@ function La({ events: e, answerStartedAtMs: t }) {
|
|
|
6081
6096
|
children: /* @__PURE__ */ l("li", {
|
|
6082
6097
|
className: "ak-progress__item ak-progress__item--active",
|
|
6083
6098
|
children: [
|
|
6084
|
-
d ? /* @__PURE__ */ c(
|
|
6099
|
+
d ? /* @__PURE__ */ c(Ra, {
|
|
6085
6100
|
event: u,
|
|
6086
6101
|
active: !1
|
|
6087
6102
|
}) : /* @__PURE__ */ c("span", {
|
|
@@ -6100,7 +6115,7 @@ function La({ events: e, answerStartedAtMs: t }) {
|
|
|
6100
6115
|
})
|
|
6101
6116
|
});
|
|
6102
6117
|
}
|
|
6103
|
-
function
|
|
6118
|
+
function Va({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1, turnMeta: a, answerStartedAtMs: s }) {
|
|
6104
6119
|
let [u, d] = o(!n);
|
|
6105
6120
|
r(() => {
|
|
6106
6121
|
i && d(!n);
|
|
@@ -6119,11 +6134,11 @@ function Ra({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
|
|
|
6119
6134
|
children: e
|
|
6120
6135
|
})]
|
|
6121
6136
|
})
|
|
6122
|
-
}) : null : f === "detailed" ? /* @__PURE__ */ c(
|
|
6137
|
+
}) : null : f === "detailed" ? /* @__PURE__ */ c(za, {
|
|
6123
6138
|
events: t,
|
|
6124
6139
|
live: !0,
|
|
6125
6140
|
answerStartedAtMs: s
|
|
6126
|
-
}) : /* @__PURE__ */ c(
|
|
6141
|
+
}) : /* @__PURE__ */ c(Ba, {
|
|
6127
6142
|
events: t,
|
|
6128
6143
|
answerStartedAtMs: s
|
|
6129
6144
|
});
|
|
@@ -6137,7 +6152,7 @@ function Ra({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
|
|
|
6137
6152
|
"aria-expanded": u,
|
|
6138
6153
|
"aria-label": u ? "Hide working steps" : "Show working steps",
|
|
6139
6154
|
children: [
|
|
6140
|
-
/* @__PURE__ */ c(
|
|
6155
|
+
/* @__PURE__ */ c(Ra, {
|
|
6141
6156
|
event: {
|
|
6142
6157
|
stage: "",
|
|
6143
6158
|
text: "",
|
|
@@ -6156,9 +6171,9 @@ function Ra({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
|
|
|
6156
6171
|
t.length === 1 ? "" : "s"
|
|
6157
6172
|
]
|
|
6158
6173
|
}),
|
|
6159
|
-
/* @__PURE__ */ c(
|
|
6174
|
+
/* @__PURE__ */ c(La, { up: u })
|
|
6160
6175
|
]
|
|
6161
|
-
}), u && /* @__PURE__ */ c(
|
|
6176
|
+
}), u && /* @__PURE__ */ c(za, {
|
|
6162
6177
|
events: t,
|
|
6163
6178
|
live: !1
|
|
6164
6179
|
})]
|
|
@@ -6166,7 +6181,7 @@ function Ra({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
|
|
|
6166
6181
|
className: "ak-progress",
|
|
6167
6182
|
children: /* @__PURE__ */ l("p", {
|
|
6168
6183
|
className: "ak-progress__summary ak-progress__summary--static",
|
|
6169
|
-
children: [/* @__PURE__ */ c(
|
|
6184
|
+
children: [/* @__PURE__ */ c(Ra, {
|
|
6170
6185
|
event: {
|
|
6171
6186
|
stage: "",
|
|
6172
6187
|
text: "",
|
|
@@ -6178,9 +6193,8 @@ function Ra({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
|
|
|
6178
6193
|
})
|
|
6179
6194
|
}) : null;
|
|
6180
6195
|
}
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
function za() {
|
|
6196
|
+
// ../../packages/widget-ui/src/components/MessageBubble.tsx
|
|
6197
|
+
function Ha() {
|
|
6184
6198
|
return /* @__PURE__ */ c("svg", {
|
|
6185
6199
|
className: "ak-agent-status__icon",
|
|
6186
6200
|
width: "13",
|
|
@@ -6191,18 +6205,18 @@ function za() {
|
|
|
6191
6205
|
children: /* @__PURE__ */ c("path", { d: "M12 2C12 2 12.7 8.1 14.5 9.5C16.3 10.9 22 12 22 12C22 12 16.3 13.1 14.5 14.5C12.7 15.9 12 22 12 22C12 22 11.3 15.9 9.5 14.5C7.7 13.1 2 12 2 12C2 12 7.7 10.9 9.5 9.5C11.3 8.1 12 2 12 2Z" })
|
|
6192
6206
|
});
|
|
6193
6207
|
}
|
|
6194
|
-
function
|
|
6208
|
+
function Ua({ status: e }) {
|
|
6195
6209
|
return /* @__PURE__ */ l("div", {
|
|
6196
6210
|
className: "ak-agent-status",
|
|
6197
6211
|
role: "status",
|
|
6198
6212
|
"aria-live": "polite",
|
|
6199
|
-
children: [/* @__PURE__ */ c(
|
|
6213
|
+
children: [/* @__PURE__ */ c(Ha, {}), /* @__PURE__ */ c("span", {
|
|
6200
6214
|
className: "ak-agent-status__text",
|
|
6201
6215
|
children: e
|
|
6202
6216
|
})]
|
|
6203
6217
|
});
|
|
6204
6218
|
}
|
|
6205
|
-
function
|
|
6219
|
+
function Wa({ messageId: e, images: t, onCellClick: n }) {
|
|
6206
6220
|
if (t.length === 0) return null;
|
|
6207
6221
|
let r = t.length;
|
|
6208
6222
|
if (r === 1) {
|
|
@@ -6220,7 +6234,7 @@ function Va({ messageId: e, images: t, onCellClick: n }) {
|
|
|
6220
6234
|
className: "ak-gallery__img ak-gallery__img--contain"
|
|
6221
6235
|
})
|
|
6222
6236
|
}), /* @__PURE__ */ c("a", {
|
|
6223
|
-
href:
|
|
6237
|
+
href: Na(e.downloadHref) ?? void 0,
|
|
6224
6238
|
download: !0,
|
|
6225
6239
|
className: "ak-message__image-dl-icon",
|
|
6226
6240
|
title: "Download image",
|
|
@@ -6250,7 +6264,7 @@ function Va({ messageId: e, images: t, onCellClick: n }) {
|
|
|
6250
6264
|
}
|
|
6251
6265
|
if (r === 2) return /* @__PURE__ */ c("div", {
|
|
6252
6266
|
className: "ak-gallery ak-gallery--two",
|
|
6253
|
-
children: t.map((t, r) => /* @__PURE__ */ c(
|
|
6267
|
+
children: t.map((t, r) => /* @__PURE__ */ c(Ga, {
|
|
6254
6268
|
src: t.src,
|
|
6255
6269
|
alt: t.alt,
|
|
6256
6270
|
onClick: () => n(r)
|
|
@@ -6258,17 +6272,17 @@ function Va({ messageId: e, images: t, onCellClick: n }) {
|
|
|
6258
6272
|
});
|
|
6259
6273
|
if (r === 3) return /* @__PURE__ */ l("div", {
|
|
6260
6274
|
className: "ak-gallery ak-gallery--three",
|
|
6261
|
-
children: [/* @__PURE__ */ c(
|
|
6275
|
+
children: [/* @__PURE__ */ c(Ga, {
|
|
6262
6276
|
src: t[0].src,
|
|
6263
6277
|
alt: t[0].alt,
|
|
6264
6278
|
onClick: () => n(0)
|
|
6265
6279
|
}, t[0].key ?? `${e}-0`), /* @__PURE__ */ l("div", {
|
|
6266
6280
|
className: "ak-gallery__col",
|
|
6267
|
-
children: [/* @__PURE__ */ c(
|
|
6281
|
+
children: [/* @__PURE__ */ c(Ga, {
|
|
6268
6282
|
src: t[1].src,
|
|
6269
6283
|
alt: t[1].alt,
|
|
6270
6284
|
onClick: () => n(1)
|
|
6271
|
-
}, t[1].key ?? `${e}-1`), /* @__PURE__ */ c(
|
|
6285
|
+
}, t[1].key ?? `${e}-1`), /* @__PURE__ */ c(Ga, {
|
|
6272
6286
|
src: t[2].src,
|
|
6273
6287
|
alt: t[2].alt,
|
|
6274
6288
|
onClick: () => n(2)
|
|
@@ -6280,7 +6294,7 @@ function Va({ messageId: e, images: t, onCellClick: n }) {
|
|
|
6280
6294
|
className: "ak-gallery ak-gallery--grid",
|
|
6281
6295
|
children: i.map((t, r) => {
|
|
6282
6296
|
let o = r === i.length - 1;
|
|
6283
|
-
return /* @__PURE__ */ c(
|
|
6297
|
+
return /* @__PURE__ */ c(Ga, {
|
|
6284
6298
|
src: t.src,
|
|
6285
6299
|
alt: t.alt,
|
|
6286
6300
|
overlayCount: o && a > 0 ? a : 0,
|
|
@@ -6289,7 +6303,7 @@ function Va({ messageId: e, images: t, onCellClick: n }) {
|
|
|
6289
6303
|
})
|
|
6290
6304
|
});
|
|
6291
6305
|
}
|
|
6292
|
-
function
|
|
6306
|
+
function Ga({ src: e, alt: t, overlayCount: n = 0, onClick: r }) {
|
|
6293
6307
|
return /* @__PURE__ */ l("button", {
|
|
6294
6308
|
type: "button",
|
|
6295
6309
|
onClick: r,
|
|
@@ -6306,7 +6320,7 @@ function Ha({ src: e, alt: t, overlayCount: n = 0, onClick: r }) {
|
|
|
6306
6320
|
})]
|
|
6307
6321
|
});
|
|
6308
6322
|
}
|
|
6309
|
-
function
|
|
6323
|
+
function Ka({ images: e, index: t, onClose: n, onIndexChange: i }) {
|
|
6310
6324
|
let a = t !== null, o = a && t !== null ? Math.min(Math.max(0, t), e.length - 1) : 0, u = a ? e[o] : null;
|
|
6311
6325
|
return r(() => {
|
|
6312
6326
|
if (!a) return;
|
|
@@ -6340,7 +6354,7 @@ function Ua({ images: e, index: t, onClose: n, onIndexChange: i }) {
|
|
|
6340
6354
|
]
|
|
6341
6355
|
}),
|
|
6342
6356
|
/* @__PURE__ */ c("a", {
|
|
6343
|
-
href:
|
|
6357
|
+
href: Na(u.downloadHref) ?? void 0,
|
|
6344
6358
|
download: !0,
|
|
6345
6359
|
target: "_blank",
|
|
6346
6360
|
rel: "noopener noreferrer",
|
|
@@ -6444,7 +6458,7 @@ function Ua({ images: e, index: t, onClose: n, onIndexChange: i }) {
|
|
|
6444
6458
|
]
|
|
6445
6459
|
});
|
|
6446
6460
|
}
|
|
6447
|
-
function
|
|
6461
|
+
function qa({ url: e, mimeType: t, fileName: n }) {
|
|
6448
6462
|
let r = (() => {
|
|
6449
6463
|
if (n) return n;
|
|
6450
6464
|
try {
|
|
@@ -6470,7 +6484,7 @@ function Wa({ url: e, mimeType: t, fileName: n }) {
|
|
|
6470
6484
|
label: i || "FILE"
|
|
6471
6485
|
};
|
|
6472
6486
|
return /* @__PURE__ */ l("a", {
|
|
6473
|
-
href:
|
|
6487
|
+
href: Na(e) ?? void 0,
|
|
6474
6488
|
target: "_blank",
|
|
6475
6489
|
rel: "noopener noreferrer",
|
|
6476
6490
|
className: "ak-file-chip",
|
|
@@ -6501,7 +6515,25 @@ function Wa({ url: e, mimeType: t, fileName: n }) {
|
|
|
6501
6515
|
})]
|
|
6502
6516
|
});
|
|
6503
6517
|
}
|
|
6504
|
-
function
|
|
6518
|
+
function Ja({ url: e, mimeType: t, transcript: n }) {
|
|
6519
|
+
return /* @__PURE__ */ l("div", {
|
|
6520
|
+
className: "ak-audio-chip",
|
|
6521
|
+
children: [/* @__PURE__ */ c("audio", {
|
|
6522
|
+
controls: !0,
|
|
6523
|
+
src: e,
|
|
6524
|
+
className: "ak-audio-chip__player",
|
|
6525
|
+
"aria-label": "Voice note",
|
|
6526
|
+
children: /* @__PURE__ */ c("source", {
|
|
6527
|
+
src: e,
|
|
6528
|
+
type: t
|
|
6529
|
+
})
|
|
6530
|
+
}), n && /* @__PURE__ */ c("p", {
|
|
6531
|
+
className: "ak-audio-chip__transcript",
|
|
6532
|
+
children: n
|
|
6533
|
+
})]
|
|
6534
|
+
});
|
|
6535
|
+
}
|
|
6536
|
+
function Ya(e) {
|
|
6505
6537
|
try {
|
|
6506
6538
|
return new Date(e).toLocaleTimeString([], {
|
|
6507
6539
|
hour: "2-digit",
|
|
@@ -6511,12 +6543,12 @@ function Ga(e) {
|
|
|
6511
6543
|
return "";
|
|
6512
6544
|
}
|
|
6513
6545
|
}
|
|
6514
|
-
var
|
|
6546
|
+
var Xa = /(`[^`\n]+`|\*\*[^*\n]+\*\*|\*[^*\n]+\*|!\[[^\]\n]*\]\([^)\n]+\)|\[[^\]\n]+\]\([^)\n]+\))/g;
|
|
6515
6547
|
function $(e) {
|
|
6516
6548
|
let t = [], n = 0, r = 0;
|
|
6517
|
-
|
|
6549
|
+
Xa.lastIndex = 0;
|
|
6518
6550
|
let i;
|
|
6519
|
-
for (; (i =
|
|
6551
|
+
for (; (i = Xa.exec(e)) !== null;) {
|
|
6520
6552
|
i.index > n && t.push(e.slice(n, i.index));
|
|
6521
6553
|
let a = i[0];
|
|
6522
6554
|
if (a.startsWith("`")) t.push(/* @__PURE__ */ c("code", {
|
|
@@ -6526,7 +6558,7 @@ function $(e) {
|
|
|
6526
6558
|
else if (a.startsWith("**")) t.push(/* @__PURE__ */ c("strong", { children: a.slice(2, -2) }, r++));
|
|
6527
6559
|
else if (a.startsWith("*")) t.push(/* @__PURE__ */ c("em", { children: a.slice(1, -1) }, r++));
|
|
6528
6560
|
else if (a.startsWith("![")) {
|
|
6529
|
-
let e = a.match(/!\[([^\]]*)\]\(([^)]+)\)/), n =
|
|
6561
|
+
let e = a.match(/!\[([^\]]*)\]\(([^)]+)\)/), n = Na(e?.[2]);
|
|
6530
6562
|
e && n ? t.push(/* @__PURE__ */ c("a", {
|
|
6531
6563
|
href: n,
|
|
6532
6564
|
target: "_blank",
|
|
@@ -6534,7 +6566,7 @@ function $(e) {
|
|
|
6534
6566
|
children: e[1] || "image"
|
|
6535
6567
|
}, r++)) : e && t.push(e[1] || "image");
|
|
6536
6568
|
} else {
|
|
6537
|
-
let e = a.match(/\[(.+?)\]\((.+?)\)/), n =
|
|
6569
|
+
let e = a.match(/\[(.+?)\]\((.+?)\)/), n = Na(e?.[2]);
|
|
6538
6570
|
e && n ? t.push(/* @__PURE__ */ c("a", {
|
|
6539
6571
|
href: n,
|
|
6540
6572
|
target: "_blank",
|
|
@@ -6546,8 +6578,8 @@ function $(e) {
|
|
|
6546
6578
|
}
|
|
6547
6579
|
return n < e.length && t.push(e.slice(n)), t;
|
|
6548
6580
|
}
|
|
6549
|
-
function
|
|
6550
|
-
e =
|
|
6581
|
+
function Za(e) {
|
|
6582
|
+
e = Pa(e);
|
|
6551
6583
|
let t = e.split("\n"), n = [], r = 0, i = 0;
|
|
6552
6584
|
for (; r < t.length;) {
|
|
6553
6585
|
let e = t[r], a = e.match(/^(\s*)```/);
|
|
@@ -6716,7 +6748,7 @@ function qa(e) {
|
|
|
6716
6748
|
}
|
|
6717
6749
|
return /* @__PURE__ */ c(s, { children: n });
|
|
6718
6750
|
}
|
|
6719
|
-
function
|
|
6751
|
+
function Qa({ message: e }) {
|
|
6720
6752
|
let [t, n] = o(null), [r, i] = o(null), a = e.role === "user", s = e.status === "error", u = e.status === "streaming", d = !!(e.images && e.images.length > 0), f = !!(e.documents && e.documents.length > 0), p = (() => {
|
|
6721
6753
|
if (!a) return [];
|
|
6722
6754
|
let t = (e.uploadedAttachments ?? []).filter((e) => e.kind === "image").map((e) => ({
|
|
@@ -6728,15 +6760,15 @@ function Ja({ message: e }) {
|
|
|
6728
6760
|
url: e.uploadedImageUrl,
|
|
6729
6761
|
mimeType: "image/jpeg"
|
|
6730
6762
|
}] : [];
|
|
6731
|
-
})(), m = a ? (e.uploadedAttachments ?? []).filter((e) => e.kind === "file") : [], h = p.length > 0,
|
|
6763
|
+
})(), m = a ? (e.uploadedAttachments ?? []).filter((e) => e.kind === "file") : [], h = a ? (e.uploadedAttachments ?? []).filter((e) => e.kind === "audio") : [], g = p.length > 0, _ = m.length > 0, v = h.length > 0, y = d || g, b = a && v ? na(e.content) : null, x = b ? b.rest : e.content, S = !!e.progressEvents && e.progressEvents.length > 0, C = u && !e.content && !e.toolStatus && !S, w = !a && !s, T = !!e.isHuman && !a, E = a ? "ak-message--user" : s ? "ak-message--assistant ak-message--error" : T ? "ak-message--assistant ak-message--operator" : "ak-message--assistant", D = [
|
|
6732
6764
|
"ak-message__bubble",
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
].filter(Boolean).join(" "),
|
|
6737
|
-
className:
|
|
6765
|
+
w ? "ak-message__bubble--md" : "",
|
|
6766
|
+
y ? "ak-message__bubble--has-image" : "",
|
|
6767
|
+
T ? "ak-message__bubble--operator" : ""
|
|
6768
|
+
].filter(Boolean).join(" "), O = T ? e.senderDisplay?.trim() || "Operator" : null, k = O ? O.charAt(0).toUpperCase() : "", A = /* @__PURE__ */ l("div", {
|
|
6769
|
+
className: D,
|
|
6738
6770
|
children: [
|
|
6739
|
-
|
|
6771
|
+
g && /* @__PURE__ */ c(Wa, {
|
|
6740
6772
|
messageId: `${e.id}-up`,
|
|
6741
6773
|
images: p.map((e) => ({
|
|
6742
6774
|
src: e.url,
|
|
@@ -6745,15 +6777,23 @@ function Ja({ message: e }) {
|
|
|
6745
6777
|
})),
|
|
6746
6778
|
onCellClick: (e) => n(e)
|
|
6747
6779
|
}),
|
|
6748
|
-
|
|
6780
|
+
_ && /* @__PURE__ */ c("div", {
|
|
6749
6781
|
className: "ak-message__files",
|
|
6750
|
-
children: m.map((t, n) => /* @__PURE__ */ c(
|
|
6782
|
+
children: m.map((t, n) => /* @__PURE__ */ c(qa, {
|
|
6751
6783
|
url: t.url,
|
|
6752
6784
|
mimeType: t.mimeType,
|
|
6753
6785
|
fileName: t.fileName
|
|
6754
6786
|
}, `${e.id}-up-file-${n}`))
|
|
6755
6787
|
}),
|
|
6756
|
-
|
|
6788
|
+
v && /* @__PURE__ */ c("div", {
|
|
6789
|
+
className: "ak-message__files",
|
|
6790
|
+
children: h.map((t, n) => /* @__PURE__ */ c(Ja, {
|
|
6791
|
+
url: t.url,
|
|
6792
|
+
mimeType: t.mimeType,
|
|
6793
|
+
transcript: n === 0 ? b?.transcript ?? null : null
|
|
6794
|
+
}, `${e.id}-up-audio-${n}`))
|
|
6795
|
+
}),
|
|
6796
|
+
d && /* @__PURE__ */ c(Wa, {
|
|
6757
6797
|
messageId: `${e.id}-asst`,
|
|
6758
6798
|
images: e.images.map((e, t) => {
|
|
6759
6799
|
let n = e.url ?? (e.base64 ? `data:${e.mimeType};base64,${e.base64}` : null);
|
|
@@ -6768,15 +6808,15 @@ function Ja({ message: e }) {
|
|
|
6768
6808
|
}),
|
|
6769
6809
|
f && /* @__PURE__ */ c("div", {
|
|
6770
6810
|
className: "ak-message__files",
|
|
6771
|
-
children: e.documents.map((t, n) => t.url ? /* @__PURE__ */ c(
|
|
6811
|
+
children: e.documents.map((t, n) => t.url ? /* @__PURE__ */ c(qa, {
|
|
6772
6812
|
url: t.url,
|
|
6773
6813
|
mimeType: t.mimeType,
|
|
6774
6814
|
fileName: t.fileName
|
|
6775
6815
|
}, `${e.id}-asst-doc-${n}`) : null)
|
|
6776
6816
|
}),
|
|
6777
|
-
|
|
6778
|
-
className:
|
|
6779
|
-
children: [
|
|
6817
|
+
x && /* @__PURE__ */ l("div", {
|
|
6818
|
+
className: y ? "ak-message__image-caption" : void 0,
|
|
6819
|
+
children: [w ? Za(x) : x, u && /* @__PURE__ */ l("span", {
|
|
6780
6820
|
className: "ak-cursor",
|
|
6781
6821
|
"aria-hidden": "true",
|
|
6782
6822
|
children: [
|
|
@@ -6788,14 +6828,14 @@ function Ja({ message: e }) {
|
|
|
6788
6828
|
}),
|
|
6789
6829
|
/* @__PURE__ */ c("span", {
|
|
6790
6830
|
className: "ak-message__time",
|
|
6791
|
-
children:
|
|
6831
|
+
children: Ya(e.createdAt)
|
|
6792
6832
|
})
|
|
6793
6833
|
]
|
|
6794
|
-
}),
|
|
6834
|
+
}), ee = !!e.content || y || _ || f || !u && !e.toolStatus;
|
|
6795
6835
|
return /* @__PURE__ */ l("div", {
|
|
6796
|
-
className: `ak-message ${
|
|
6836
|
+
className: `ak-message ${E}`,
|
|
6797
6837
|
children: [
|
|
6798
|
-
!a && (e.ackText || e.progressEvents && e.progressEvents.length > 0 || e.turnMeta) && /* @__PURE__ */ c(
|
|
6838
|
+
!a && (e.ackText || e.progressEvents && e.progressEvents.length > 0 || e.turnMeta) && /* @__PURE__ */ c(Va, {
|
|
6799
6839
|
ackText: e.ackText,
|
|
6800
6840
|
events: e.progressEvents,
|
|
6801
6841
|
collapsed: e.progressCollapsed,
|
|
@@ -6803,7 +6843,7 @@ function Ja({ message: e }) {
|
|
|
6803
6843
|
turnMeta: e.turnMeta,
|
|
6804
6844
|
answerStartedAtMs: e.answerStartedAtMs
|
|
6805
6845
|
}),
|
|
6806
|
-
|
|
6846
|
+
C && /* @__PURE__ */ l("div", {
|
|
6807
6847
|
className: "ak-typing-row",
|
|
6808
6848
|
role: "status",
|
|
6809
6849
|
"aria-label": "Assistant is typing",
|
|
@@ -6813,20 +6853,20 @@ function Ja({ message: e }) {
|
|
|
6813
6853
|
/* @__PURE__ */ c("span", { className: "ak-typing-row__dot" })
|
|
6814
6854
|
]
|
|
6815
6855
|
}),
|
|
6816
|
-
!a && e.toolStatus && !(e.progressEvents && e.progressEvents.length > 0) && /* @__PURE__ */ c(
|
|
6817
|
-
|
|
6856
|
+
!a && e.toolStatus && !(e.progressEvents && e.progressEvents.length > 0) && /* @__PURE__ */ c(Ua, { status: e.toolStatus }),
|
|
6857
|
+
T && /* @__PURE__ */ l("span", {
|
|
6818
6858
|
className: "ak-message__sender-label",
|
|
6819
6859
|
children: [/* @__PURE__ */ c("span", {
|
|
6820
6860
|
className: "ak-message__operator-avatar",
|
|
6821
6861
|
"aria-hidden": "true",
|
|
6822
|
-
children:
|
|
6862
|
+
children: k
|
|
6823
6863
|
}), /* @__PURE__ */ c("span", {
|
|
6824
6864
|
className: "ak-message__operator-name",
|
|
6825
|
-
children:
|
|
6865
|
+
children: O
|
|
6826
6866
|
})]
|
|
6827
6867
|
}),
|
|
6828
|
-
|
|
6829
|
-
p.length > 0 && /* @__PURE__ */ c(
|
|
6868
|
+
ee && A,
|
|
6869
|
+
p.length > 0 && /* @__PURE__ */ c(Ka, {
|
|
6830
6870
|
images: p.map((e) => ({
|
|
6831
6871
|
src: e.url,
|
|
6832
6872
|
alt: e.fileName ?? "Uploaded image",
|
|
@@ -6836,7 +6876,7 @@ function Ja({ message: e }) {
|
|
|
6836
6876
|
onClose: () => n(null),
|
|
6837
6877
|
onIndexChange: n
|
|
6838
6878
|
}),
|
|
6839
|
-
d && /* @__PURE__ */ c(
|
|
6879
|
+
d && /* @__PURE__ */ c(Ka, {
|
|
6840
6880
|
images: e.images.map((e) => {
|
|
6841
6881
|
let t = e.url ?? (e.base64 ? `data:${e.mimeType};base64,${e.base64}` : null);
|
|
6842
6882
|
return t ? {
|
|
@@ -6852,9 +6892,8 @@ function Ja({ message: e }) {
|
|
|
6852
6892
|
]
|
|
6853
6893
|
});
|
|
6854
6894
|
}
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
function Ya() {
|
|
6895
|
+
// ../../packages/widget-ui/src/components/TypingIndicator.tsx
|
|
6896
|
+
function $a() {
|
|
6858
6897
|
return /* @__PURE__ */ l("div", {
|
|
6859
6898
|
className: "ak-typing",
|
|
6860
6899
|
"aria-label": "Assistant is typing",
|
|
@@ -6865,9 +6904,8 @@ function Ya() {
|
|
|
6865
6904
|
]
|
|
6866
6905
|
});
|
|
6867
6906
|
}
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
function Xa(e, t) {
|
|
6907
|
+
// ../../packages/widget-ui/src/components/MessageList.tsx
|
|
6908
|
+
function eo(e, t) {
|
|
6871
6909
|
let n = [], r = null;
|
|
6872
6910
|
for (let i of e) {
|
|
6873
6911
|
if (i.role === "assistant") {
|
|
@@ -6885,9 +6923,9 @@ function Xa(e, t) {
|
|
|
6885
6923
|
}
|
|
6886
6924
|
return n;
|
|
6887
6925
|
}
|
|
6888
|
-
function
|
|
6889
|
-
let o = a(null), s = a(null), u = a(!0), d = i(() =>
|
|
6890
|
-
|
|
6926
|
+
function to({ messages: e, isLoading: t, operatorFallbackLabel: n = "Operator" }) {
|
|
6927
|
+
let o = a(null), s = a(null), u = a(!0), d = i(() => eo(e, n), [e, n]);
|
|
6928
|
+
r(() => {
|
|
6891
6929
|
if (!(o.current?.parentElement ?? o.current)) return;
|
|
6892
6930
|
let e = (e) => {
|
|
6893
6931
|
u.current = e.scrollHeight - e.scrollTop - e.clientHeight < 120;
|
|
@@ -6898,9 +6936,11 @@ function Za({ messages: e, isLoading: t, operatorFallbackLabel: n = "Operator" }
|
|
|
6898
6936
|
return t.addEventListener("scroll", n, { passive: !0 }), () => t.removeEventListener("scroll", n);
|
|
6899
6937
|
}, []), r(() => {
|
|
6900
6938
|
e[e.length - 1]?.role === "user" && (u.current = !0), u.current && s.current?.scrollIntoView({ behavior: "smooth" });
|
|
6901
|
-
}, [e])
|
|
6939
|
+
}, [e]);
|
|
6940
|
+
let f = e.find((e) => e.status === "streaming")?.content ?? "";
|
|
6941
|
+
return r(() => {
|
|
6902
6942
|
u.current && s.current?.scrollIntoView({ behavior: "smooth" });
|
|
6903
|
-
}, [t,
|
|
6943
|
+
}, [t, f]), /* @__PURE__ */ l("div", {
|
|
6904
6944
|
ref: o,
|
|
6905
6945
|
className: "ak-messages",
|
|
6906
6946
|
role: "log",
|
|
@@ -6914,15 +6954,14 @@ function Za({ messages: e, isLoading: t, operatorFallbackLabel: n = "Operator" }
|
|
|
6914
6954
|
className: "ak-handoff-divider__label",
|
|
6915
6955
|
children: e.label
|
|
6916
6956
|
})
|
|
6917
|
-
}, e.id) : /* @__PURE__ */ c(
|
|
6918
|
-
t && !e.some((e) => e.status === "streaming") && /* @__PURE__ */ c(
|
|
6957
|
+
}, e.id) : /* @__PURE__ */ c(Qa, { message: e.message }, e.message.id)),
|
|
6958
|
+
t && !e.some((e) => e.status === "streaming") && /* @__PURE__ */ c($a, {}),
|
|
6919
6959
|
/* @__PURE__ */ c("div", { ref: s })
|
|
6920
6960
|
]
|
|
6921
6961
|
});
|
|
6922
6962
|
}
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
function Qa() {
|
|
6963
|
+
// ../../packages/widget-ui/src/components/EmptyState.tsx
|
|
6964
|
+
function no() {
|
|
6926
6965
|
return /* @__PURE__ */ l("svg", {
|
|
6927
6966
|
width: "30",
|
|
6928
6967
|
height: "30",
|
|
@@ -6962,7 +7001,7 @@ function Qa() {
|
|
|
6962
7001
|
]
|
|
6963
7002
|
});
|
|
6964
7003
|
}
|
|
6965
|
-
function
|
|
7004
|
+
function ro({ title: e, description: t, suggestedQuestions: n, avatarUrl: r, onSelect: i }) {
|
|
6966
7005
|
let a = (n ?? []).filter((e) => (e.title ?? "").trim().length > 0);
|
|
6967
7006
|
return /* @__PURE__ */ l("div", {
|
|
6968
7007
|
className: "ak-empty-state",
|
|
@@ -6985,7 +7024,7 @@ function $a({ title: e, description: t, suggestedQuestions: n, avatarUrl: r, onS
|
|
|
6985
7024
|
}) : /* @__PURE__ */ c("span", {
|
|
6986
7025
|
className: "ak-empty-state__bot-icon",
|
|
6987
7026
|
"aria-hidden": "true",
|
|
6988
|
-
children: /* @__PURE__ */ c(
|
|
7027
|
+
children: /* @__PURE__ */ c(no, {})
|
|
6989
7028
|
})
|
|
6990
7029
|
}),
|
|
6991
7030
|
/* @__PURE__ */ c("p", {
|
|
@@ -7016,35 +7055,34 @@ function $a({ title: e, description: t, suggestedQuestions: n, avatarUrl: r, onS
|
|
|
7016
7055
|
]
|
|
7017
7056
|
});
|
|
7018
7057
|
}
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
function no() {
|
|
7058
|
+
// ../../packages/widget-ui/src/components/Composer.tsx
|
|
7059
|
+
var io = "https://klicforge.ai/privacy-policy", ao = "https://klicforge.ai/terms-of-service";
|
|
7060
|
+
function oo() {
|
|
7023
7061
|
return /* @__PURE__ */ l("svg", {
|
|
7024
7062
|
width: "16",
|
|
7025
7063
|
height: "16",
|
|
7026
7064
|
viewBox: "0 0 24 24",
|
|
7027
7065
|
fill: "none",
|
|
7028
7066
|
stroke: "currentColor",
|
|
7029
|
-
strokeWidth: "2
|
|
7067
|
+
strokeWidth: "2",
|
|
7030
7068
|
strokeLinecap: "round",
|
|
7031
7069
|
strokeLinejoin: "round",
|
|
7032
7070
|
children: [/* @__PURE__ */ c("line", {
|
|
7033
|
-
x1: "
|
|
7034
|
-
y1: "
|
|
7035
|
-
x2: "
|
|
7036
|
-
y2: "
|
|
7037
|
-
}), /* @__PURE__ */ c("
|
|
7071
|
+
x1: "12",
|
|
7072
|
+
y1: "19",
|
|
7073
|
+
x2: "12",
|
|
7074
|
+
y2: "5"
|
|
7075
|
+
}), /* @__PURE__ */ c("polyline", { points: "5 12 12 5 19 12" })]
|
|
7038
7076
|
});
|
|
7039
7077
|
}
|
|
7040
|
-
function
|
|
7078
|
+
function so() {
|
|
7041
7079
|
return /* @__PURE__ */ l("svg", {
|
|
7042
|
-
width: "
|
|
7043
|
-
height: "
|
|
7080
|
+
width: "20",
|
|
7081
|
+
height: "20",
|
|
7044
7082
|
viewBox: "0 0 24 24",
|
|
7045
7083
|
fill: "none",
|
|
7046
7084
|
stroke: "currentColor",
|
|
7047
|
-
strokeWidth: "2
|
|
7085
|
+
strokeWidth: "2",
|
|
7048
7086
|
strokeLinecap: "round",
|
|
7049
7087
|
children: [/* @__PURE__ */ c("line", {
|
|
7050
7088
|
x1: "12",
|
|
@@ -7059,7 +7097,7 @@ function ro() {
|
|
|
7059
7097
|
})]
|
|
7060
7098
|
});
|
|
7061
7099
|
}
|
|
7062
|
-
function
|
|
7100
|
+
function co() {
|
|
7063
7101
|
return /* @__PURE__ */ l("svg", {
|
|
7064
7102
|
width: "14",
|
|
7065
7103
|
height: "14",
|
|
@@ -7076,7 +7114,7 @@ function io() {
|
|
|
7076
7114
|
})]
|
|
7077
7115
|
});
|
|
7078
7116
|
}
|
|
7079
|
-
function
|
|
7117
|
+
function lo() {
|
|
7080
7118
|
return /* @__PURE__ */ l("svg", {
|
|
7081
7119
|
width: "14",
|
|
7082
7120
|
height: "14",
|
|
@@ -7089,7 +7127,7 @@ function ao() {
|
|
|
7089
7127
|
children: [/* @__PURE__ */ c("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), /* @__PURE__ */ c("polyline", { points: "14 2 14 8 20 8" })]
|
|
7090
7128
|
});
|
|
7091
7129
|
}
|
|
7092
|
-
function
|
|
7130
|
+
function uo() {
|
|
7093
7131
|
return /* @__PURE__ */ l("svg", {
|
|
7094
7132
|
width: "10",
|
|
7095
7133
|
height: "10",
|
|
@@ -7112,56 +7150,128 @@ function oo() {
|
|
|
7112
7150
|
})]
|
|
7113
7151
|
});
|
|
7114
7152
|
}
|
|
7115
|
-
|
|
7153
|
+
function fo() {
|
|
7154
|
+
return /* @__PURE__ */ l("svg", {
|
|
7155
|
+
width: "20",
|
|
7156
|
+
height: "20",
|
|
7157
|
+
viewBox: "0 0 24 24",
|
|
7158
|
+
fill: "none",
|
|
7159
|
+
stroke: "currentColor",
|
|
7160
|
+
strokeWidth: "2",
|
|
7161
|
+
strokeLinecap: "round",
|
|
7162
|
+
strokeLinejoin: "round",
|
|
7163
|
+
children: [
|
|
7164
|
+
/* @__PURE__ */ c("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
7165
|
+
/* @__PURE__ */ c("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
7166
|
+
/* @__PURE__ */ c("line", {
|
|
7167
|
+
x1: "12",
|
|
7168
|
+
y1: "19",
|
|
7169
|
+
x2: "12",
|
|
7170
|
+
y2: "23"
|
|
7171
|
+
}),
|
|
7172
|
+
/* @__PURE__ */ c("line", {
|
|
7173
|
+
x1: "8",
|
|
7174
|
+
y1: "23",
|
|
7175
|
+
x2: "16",
|
|
7176
|
+
y2: "23"
|
|
7177
|
+
})
|
|
7178
|
+
]
|
|
7179
|
+
});
|
|
7180
|
+
}
|
|
7181
|
+
function po() {
|
|
7182
|
+
return /* @__PURE__ */ c("svg", {
|
|
7183
|
+
width: "12",
|
|
7184
|
+
height: "12",
|
|
7185
|
+
viewBox: "0 0 24 24",
|
|
7186
|
+
fill: "currentColor",
|
|
7187
|
+
children: /* @__PURE__ */ c("rect", {
|
|
7188
|
+
x: "4",
|
|
7189
|
+
y: "4",
|
|
7190
|
+
width: "16",
|
|
7191
|
+
height: "16",
|
|
7192
|
+
rx: "2"
|
|
7193
|
+
})
|
|
7194
|
+
});
|
|
7195
|
+
}
|
|
7196
|
+
var mo = [
|
|
7116
7197
|
"application/pdf",
|
|
7117
7198
|
"text/markdown",
|
|
7118
7199
|
"text/plain",
|
|
7119
7200
|
"text/csv"
|
|
7120
|
-
],
|
|
7201
|
+
], ho = [
|
|
7121
7202
|
".pdf",
|
|
7122
7203
|
".md",
|
|
7123
7204
|
".txt",
|
|
7124
7205
|
".csv"
|
|
7125
|
-
],
|
|
7206
|
+
], go = [...ho, ...mo].join(","), _o = [
|
|
7126
7207
|
"image/jpeg",
|
|
7127
7208
|
"image/png",
|
|
7128
7209
|
"image/gif",
|
|
7129
7210
|
"image/webp"
|
|
7130
|
-
],
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7211
|
+
], vo = _o.join(","), yo = [
|
|
7212
|
+
"audio/webm;codecs=opus",
|
|
7213
|
+
"audio/webm",
|
|
7214
|
+
"audio/mp4",
|
|
7215
|
+
"audio/ogg;codecs=opus"
|
|
7216
|
+
];
|
|
7217
|
+
function bo() {
|
|
7218
|
+
return typeof MediaRecorder > "u" ? null : yo.find((e) => MediaRecorder.isTypeSupported(e)) ?? null;
|
|
7219
|
+
}
|
|
7220
|
+
function xo(e) {
|
|
7221
|
+
return e.includes("mp4") ? "mp4" : e.includes("ogg") ? "ogg" : "webm";
|
|
7135
7222
|
}
|
|
7136
|
-
function
|
|
7137
|
-
|
|
7223
|
+
function So(e) {
|
|
7224
|
+
let t = Math.floor(e / 1e3), n = Math.floor(t / 60), r = t % 60;
|
|
7225
|
+
return `${n}:${String(r).padStart(2, "0")}`;
|
|
7138
7226
|
}
|
|
7139
|
-
function
|
|
7140
|
-
|
|
7227
|
+
function Co(e) {
|
|
7228
|
+
if (mo.includes(e.type)) return !0;
|
|
7229
|
+
let t = e.name.toLowerCase();
|
|
7230
|
+
return ho.some((e) => t.endsWith(e));
|
|
7231
|
+
}
|
|
7232
|
+
function wo(e) {
|
|
7233
|
+
return _o.includes(e.type);
|
|
7234
|
+
}
|
|
7235
|
+
function To({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…", photoSendingEnabled: d = !1, fileUploadEnabled: f = !1, voiceNoteEnabled: p = !1, voiceNoteMaxDurationSec: m = 120, attachmentMaxCount: h = 5, attachmentMaxFileSizeMb: g = 1, onRecordingError: _ }) {
|
|
7236
|
+
let [v, y] = o(""), [b, x] = o([]), [S, C] = o(/* @__PURE__ */ new Map()), [w, T] = o(!1), [E, D] = o(!1), [O, k] = o(0), A = a(null), ee = a(null), j = a(null), M = a(null), te = a(null), ne = a(null), N = a(null), re = a([]), ie = a(null), ae = a(0), oe = a(null), se = a(!1), ce = a(!1), le = a(v);
|
|
7237
|
+
le.current = v;
|
|
7238
|
+
let ue = a(b);
|
|
7239
|
+
ue.current = b;
|
|
7240
|
+
let de = a(t);
|
|
7241
|
+
de.current = t;
|
|
7242
|
+
let fe = d || f, pe = i(() => g * 1024 * 1024, [g]), me = p && typeof window < "u" && typeof MediaRecorder < "u" && !!navigator.mediaDevices?.getUserMedia;
|
|
7141
7243
|
r(() => () => {
|
|
7142
|
-
|
|
7143
|
-
}, [])
|
|
7144
|
-
|
|
7244
|
+
S.forEach((e) => URL.revokeObjectURL(e));
|
|
7245
|
+
}, []);
|
|
7246
|
+
let he = a(null);
|
|
7247
|
+
r(() => {
|
|
7248
|
+
if (t) return;
|
|
7249
|
+
let e = he.current;
|
|
7250
|
+
he.current = t, e === null && typeof window < "u" && window.matchMedia?.("(pointer: coarse)").matches || A.current?.focus();
|
|
7145
7251
|
}, [t]);
|
|
7146
|
-
let
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7252
|
+
let ge = a(!1);
|
|
7253
|
+
r(() => {
|
|
7254
|
+
E ? ne.current?.focus() : ge.current && !de.current && A.current?.focus(), ge.current = E;
|
|
7255
|
+
}, [E]);
|
|
7256
|
+
let _e = n((e) => {
|
|
7257
|
+
if (!w) return;
|
|
7258
|
+
let t = e.composedPath ? e.composedPath() : [], n = !!M.current && t.includes(M.current), r = !!te.current && t.includes(te.current);
|
|
7259
|
+
!n && !r && T(!1);
|
|
7260
|
+
}, [w]);
|
|
7151
7261
|
r(() => {
|
|
7152
|
-
if (
|
|
7153
|
-
}, [
|
|
7154
|
-
|
|
7155
|
-
}, [
|
|
7156
|
-
function
|
|
7157
|
-
|
|
7158
|
-
}
|
|
7159
|
-
function
|
|
7160
|
-
|
|
7262
|
+
if (w) return document.addEventListener("click", _e), () => document.removeEventListener("click", _e);
|
|
7263
|
+
}, [w, _e]), r(() => {
|
|
7264
|
+
fe || T(!1);
|
|
7265
|
+
}, [fe]);
|
|
7266
|
+
function ve() {
|
|
7267
|
+
S.forEach((e) => URL.revokeObjectURL(e)), C(/* @__PURE__ */ new Map()), x([]), ee.current && (ee.current.value = ""), j.current && (j.current.value = "");
|
|
7268
|
+
}
|
|
7269
|
+
function ye(e) {
|
|
7270
|
+
x((t) => {
|
|
7161
7271
|
let n = t[e];
|
|
7162
7272
|
if (n) {
|
|
7163
|
-
let e =
|
|
7164
|
-
e && (URL.revokeObjectURL(e),
|
|
7273
|
+
let e = S.get(n.file);
|
|
7274
|
+
e && (URL.revokeObjectURL(e), C((e) => {
|
|
7165
7275
|
let t = new Map(e);
|
|
7166
7276
|
return t.delete(n.file), t;
|
|
7167
7277
|
}));
|
|
@@ -7169,92 +7279,125 @@ function ho({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7169
7279
|
return t.filter((t, n) => n !== e);
|
|
7170
7280
|
});
|
|
7171
7281
|
}
|
|
7172
|
-
function
|
|
7173
|
-
let n =
|
|
7174
|
-
!n &&
|
|
7282
|
+
function be() {
|
|
7283
|
+
let n = v.trim();
|
|
7284
|
+
!n && b.length === 0 || t || (e(n, b), y(""), ve(), A.current && (A.current.style.height = "auto"));
|
|
7175
7285
|
}
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
}
|
|
7179
|
-
|
|
7286
|
+
let xe = n(() => {
|
|
7287
|
+
ie.current?.getTracks().forEach((e) => e.stop()), ie.current = null;
|
|
7288
|
+
}, []);
|
|
7289
|
+
r(() => () => {
|
|
7290
|
+
oe.current && clearInterval(oe.current), N.current && N.current.state !== "inactive" && (se.current = !0, N.current.stop()), xe();
|
|
7291
|
+
}, [xe]);
|
|
7292
|
+
async function Se() {
|
|
7293
|
+
if (!me || E || ce.current || t) return;
|
|
7294
|
+
if (b.length >= h) {
|
|
7295
|
+
_?.(`Only ${h} attachments can be sent at once`);
|
|
7296
|
+
return;
|
|
7297
|
+
}
|
|
7298
|
+
let n = bo();
|
|
7299
|
+
if (!n) {
|
|
7300
|
+
_?.("Voice recording is not supported in this browser");
|
|
7301
|
+
return;
|
|
7302
|
+
}
|
|
7303
|
+
ce.current = !0;
|
|
7304
|
+
let r;
|
|
7305
|
+
try {
|
|
7306
|
+
r = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
7307
|
+
} catch {
|
|
7308
|
+
ce.current = !1, _?.("Microphone access was denied");
|
|
7309
|
+
return;
|
|
7310
|
+
}
|
|
7311
|
+
ce.current = !1, ie.current = r, re.current = [], se.current = !1;
|
|
7312
|
+
let i = new MediaRecorder(r, { mimeType: n });
|
|
7313
|
+
i.ondataavailable = (e) => {
|
|
7314
|
+
e.data.size > 0 && re.current.push(e.data);
|
|
7315
|
+
}, i.onstop = () => {
|
|
7316
|
+
xe();
|
|
7317
|
+
let t = se.current, r = Date.now() - ae.current, i = new Blob(re.current, { type: n });
|
|
7318
|
+
if (re.current = [], t || r < 300 || de.current) return;
|
|
7319
|
+
let a = new File([i], `voice-note.${xo(n)}`, { type: n }), o = le.current.trim(), s = [...ue.current, {
|
|
7320
|
+
file: a,
|
|
7321
|
+
kind: "audio",
|
|
7322
|
+
durationMs: r
|
|
7323
|
+
}];
|
|
7324
|
+
s.length > h ? _?.(`Only ${h} attachments can be sent at once`) : (e(o, s), y(""), ve(), A.current && (A.current.style.height = "auto"));
|
|
7325
|
+
}, N.current = i, ae.current = Date.now(), k(0), i.start(), D(!0), oe.current = setInterval(() => {
|
|
7326
|
+
let e = Date.now() - ae.current;
|
|
7327
|
+
k(e), e >= m * 1e3 && Ce(!1);
|
|
7328
|
+
}, 250);
|
|
7329
|
+
}
|
|
7330
|
+
function Ce(e) {
|
|
7331
|
+
oe.current &&= (clearInterval(oe.current), null), se.current = e, N.current && N.current.state !== "inactive" && N.current.stop(), D(!1), k(0);
|
|
7332
|
+
}
|
|
7333
|
+
function we(e) {
|
|
7334
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), be());
|
|
7335
|
+
}
|
|
7336
|
+
function Te(e) {
|
|
7180
7337
|
let t = e.currentTarget;
|
|
7181
|
-
|
|
7338
|
+
y(t.value), t.style.height = "auto", t.style.height = `${t.scrollHeight}px`;
|
|
7182
7339
|
}
|
|
7183
|
-
function
|
|
7340
|
+
function Ee(e, t) {
|
|
7184
7341
|
if (e.length === 0) return;
|
|
7185
7342
|
let n = [], r = [];
|
|
7186
|
-
for (let i of e) {
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
continue;
|
|
7194
|
-
}
|
|
7195
|
-
if (i.size > k) {
|
|
7196
|
-
r.push(`${i.name} (over ${m} MB)`);
|
|
7197
|
-
continue;
|
|
7198
|
-
}
|
|
7199
|
-
n.push({
|
|
7200
|
-
file: i,
|
|
7201
|
-
kind: t
|
|
7202
|
-
});
|
|
7203
|
-
}
|
|
7204
|
-
v((e) => {
|
|
7205
|
-
let t = [...e, ...n], i = t.slice(0, p);
|
|
7206
|
-
return t.length > p && r.push(`max ${p} attachments allowed`), b((e) => {
|
|
7343
|
+
for (let i of e) t === "image" && !wo(i) ? r.push(`${i.name} (image type not supported)`) : t === "file" && !Co(i) ? r.push(`${i.name} (file type not supported)`) : i.size > pe ? r.push(`${i.name} (over ${g} MB)`) : n.push({
|
|
7344
|
+
file: i,
|
|
7345
|
+
kind: t
|
|
7346
|
+
});
|
|
7347
|
+
x((e) => {
|
|
7348
|
+
let t = [...e, ...n], i = t.slice(0, h);
|
|
7349
|
+
return t.length > h && r.push(`max ${h} attachments allowed`), C((e) => {
|
|
7207
7350
|
let t = new Map(e);
|
|
7208
7351
|
for (let e of i) e.kind === "image" && !t.has(e.file) && t.set(e.file, URL.createObjectURL(e.file));
|
|
7209
7352
|
return t;
|
|
7210
7353
|
}), i;
|
|
7211
7354
|
}), r.length > 0 && alert(`Some attachments were not added:\n• ${r.join("\n• ")}`);
|
|
7212
7355
|
}
|
|
7213
|
-
function
|
|
7356
|
+
function De(e) {
|
|
7214
7357
|
let t = Array.from(e.currentTarget.files ?? []);
|
|
7215
|
-
e.currentTarget.value = "",
|
|
7358
|
+
e.currentTarget.value = "", Ee(t, "image");
|
|
7216
7359
|
}
|
|
7217
|
-
function
|
|
7360
|
+
function Oe(e) {
|
|
7218
7361
|
let t = Array.from(e.currentTarget.files ?? []);
|
|
7219
|
-
e.currentTarget.value = "",
|
|
7362
|
+
e.currentTarget.value = "", Ee(t, "file");
|
|
7220
7363
|
}
|
|
7221
|
-
function
|
|
7222
|
-
|
|
7364
|
+
function ke() {
|
|
7365
|
+
T(!1), ee.current?.click();
|
|
7223
7366
|
}
|
|
7224
|
-
function
|
|
7225
|
-
|
|
7367
|
+
function Ae() {
|
|
7368
|
+
T(!1), j.current?.click();
|
|
7226
7369
|
}
|
|
7227
|
-
let
|
|
7370
|
+
let je = !t && (!!v.trim() || b.length > 0);
|
|
7228
7371
|
return /* @__PURE__ */ l("div", {
|
|
7229
7372
|
className: "ak-composer",
|
|
7230
7373
|
children: [
|
|
7231
|
-
|
|
7232
|
-
ref:
|
|
7374
|
+
fe && w && /* @__PURE__ */ l("div", {
|
|
7375
|
+
ref: M,
|
|
7233
7376
|
className: "ak-composer__attach-menu",
|
|
7234
7377
|
role: "menu",
|
|
7235
7378
|
children: [d && /* @__PURE__ */ l("button", {
|
|
7236
7379
|
className: "ak-composer__attach-menu-item",
|
|
7237
|
-
onClick:
|
|
7380
|
+
onClick: ke,
|
|
7238
7381
|
type: "button",
|
|
7239
7382
|
role: "menuitem",
|
|
7240
7383
|
disabled: t,
|
|
7241
|
-
children: [/* @__PURE__ */ c(
|
|
7384
|
+
children: [/* @__PURE__ */ c(co, {}), /* @__PURE__ */ c("span", { children: "Photo" })]
|
|
7242
7385
|
}), f && /* @__PURE__ */ l("button", {
|
|
7243
7386
|
className: "ak-composer__attach-menu-item",
|
|
7244
|
-
onClick:
|
|
7387
|
+
onClick: Ae,
|
|
7245
7388
|
type: "button",
|
|
7246
7389
|
role: "menuitem",
|
|
7247
7390
|
disabled: t,
|
|
7248
|
-
children: [/* @__PURE__ */ c(
|
|
7391
|
+
children: [/* @__PURE__ */ c(lo, {}), /* @__PURE__ */ c("span", { children: "File" })]
|
|
7249
7392
|
})]
|
|
7250
7393
|
}),
|
|
7251
|
-
|
|
7394
|
+
b.length > 0 && /* @__PURE__ */ c("div", {
|
|
7252
7395
|
className: "ak-composer__attachments",
|
|
7253
7396
|
role: "list",
|
|
7254
|
-
children:
|
|
7397
|
+
children: b.map((e, n) => {
|
|
7255
7398
|
let r = `${e.file.name}-${n}`;
|
|
7256
7399
|
if (e.kind === "image") {
|
|
7257
|
-
let i =
|
|
7400
|
+
let i = S.get(e.file);
|
|
7258
7401
|
return /* @__PURE__ */ l("div", {
|
|
7259
7402
|
className: "ak-composer__preview-wrap",
|
|
7260
7403
|
role: "listitem",
|
|
@@ -7264,11 +7407,11 @@ function ho({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7264
7407
|
className: "ak-composer__preview-img"
|
|
7265
7408
|
}), /* @__PURE__ */ c("button", {
|
|
7266
7409
|
className: "ak-composer__preview-remove",
|
|
7267
|
-
onClick: () =>
|
|
7410
|
+
onClick: () => ye(n),
|
|
7268
7411
|
type: "button",
|
|
7269
7412
|
"aria-label": `Remove ${e.file.name}`,
|
|
7270
7413
|
disabled: t,
|
|
7271
|
-
children: /* @__PURE__ */ c(
|
|
7414
|
+
children: /* @__PURE__ */ c(uo, {})
|
|
7272
7415
|
})]
|
|
7273
7416
|
}, r);
|
|
7274
7417
|
}
|
|
@@ -7276,7 +7419,7 @@ function ho({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7276
7419
|
className: "ak-composer__file-chip",
|
|
7277
7420
|
role: "listitem",
|
|
7278
7421
|
children: [
|
|
7279
|
-
/* @__PURE__ */ c(
|
|
7422
|
+
/* @__PURE__ */ c(lo, {}),
|
|
7280
7423
|
/* @__PURE__ */ c("span", {
|
|
7281
7424
|
className: "ak-composer__file-chip-name",
|
|
7282
7425
|
title: e.file.name,
|
|
@@ -7284,75 +7427,105 @@ function ho({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7284
7427
|
}),
|
|
7285
7428
|
/* @__PURE__ */ c("button", {
|
|
7286
7429
|
className: "ak-composer__file-chip-remove",
|
|
7287
|
-
onClick: () =>
|
|
7430
|
+
onClick: () => ye(n),
|
|
7288
7431
|
type: "button",
|
|
7289
7432
|
"aria-label": `Remove ${e.file.name}`,
|
|
7290
7433
|
disabled: t,
|
|
7291
|
-
children: /* @__PURE__ */ c(
|
|
7434
|
+
children: /* @__PURE__ */ c(uo, {})
|
|
7292
7435
|
})
|
|
7293
7436
|
]
|
|
7294
7437
|
}, r);
|
|
7295
7438
|
})
|
|
7296
7439
|
}),
|
|
7297
|
-
/* @__PURE__ */ l("
|
|
7440
|
+
fe && /* @__PURE__ */ l(s, { children: [d && /* @__PURE__ */ c("input", {
|
|
7441
|
+
ref: ee,
|
|
7442
|
+
type: "file",
|
|
7443
|
+
multiple: !0,
|
|
7444
|
+
accept: vo,
|
|
7445
|
+
className: "ak-composer__file-input",
|
|
7446
|
+
onChange: De,
|
|
7447
|
+
disabled: t,
|
|
7448
|
+
"aria-label": "Attach images"
|
|
7449
|
+
}), f && /* @__PURE__ */ c("input", {
|
|
7450
|
+
ref: j,
|
|
7451
|
+
type: "file",
|
|
7452
|
+
multiple: !0,
|
|
7453
|
+
accept: go,
|
|
7454
|
+
className: "ak-composer__file-input",
|
|
7455
|
+
onChange: Oe,
|
|
7456
|
+
disabled: t,
|
|
7457
|
+
"aria-label": "Attach files"
|
|
7458
|
+
})] }),
|
|
7459
|
+
/* @__PURE__ */ c("div", {
|
|
7298
7460
|
className: "ak-composer__input-wrap",
|
|
7299
|
-
children:
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
disabled: t,
|
|
7309
|
-
"aria-label": "Attach images"
|
|
7461
|
+
children: E ? /* @__PURE__ */ l("div", {
|
|
7462
|
+
className: "ak-composer__recording",
|
|
7463
|
+
children: [
|
|
7464
|
+
/* @__PURE__ */ c("button", {
|
|
7465
|
+
className: "ak-composer__recording-cancel",
|
|
7466
|
+
onClick: () => Ce(!0),
|
|
7467
|
+
"aria-label": "Cancel recording",
|
|
7468
|
+
type: "button",
|
|
7469
|
+
children: /* @__PURE__ */ c(uo, {})
|
|
7310
7470
|
}),
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
multiple: !0,
|
|
7315
|
-
accept: lo,
|
|
7316
|
-
className: "ak-composer__file-input",
|
|
7317
|
-
onChange: ae,
|
|
7318
|
-
disabled: t,
|
|
7319
|
-
"aria-label": "Attach files"
|
|
7471
|
+
/* @__PURE__ */ l("span", {
|
|
7472
|
+
className: "ak-composer__recording-timer",
|
|
7473
|
+
children: [/* @__PURE__ */ c("span", { className: "ak-composer__recording-dot" }), So(O)]
|
|
7320
7474
|
}),
|
|
7321
|
-
/* @__PURE__ */ c("
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
"aria-label": "Attachment options",
|
|
7329
|
-
"aria-haspopup": "true",
|
|
7330
|
-
"aria-expanded": x,
|
|
7331
|
-
type: "button",
|
|
7332
|
-
children: /* @__PURE__ */ c(ro, {})
|
|
7333
|
-
})
|
|
7475
|
+
/* @__PURE__ */ c("button", {
|
|
7476
|
+
ref: ne,
|
|
7477
|
+
className: "ak-composer__recording-stop",
|
|
7478
|
+
onClick: () => Ce(!1),
|
|
7479
|
+
"aria-label": "Stop recording",
|
|
7480
|
+
type: "button",
|
|
7481
|
+
children: /* @__PURE__ */ c(po, {})
|
|
7334
7482
|
})
|
|
7335
|
-
]
|
|
7336
|
-
|
|
7337
|
-
|
|
7483
|
+
]
|
|
7484
|
+
}) : /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l("div", {
|
|
7485
|
+
className: "ak-composer__row",
|
|
7486
|
+
children: [/* @__PURE__ */ c("textarea", {
|
|
7487
|
+
ref: A,
|
|
7338
7488
|
className: "ak-composer__input",
|
|
7339
|
-
value:
|
|
7340
|
-
onInput:
|
|
7341
|
-
onKeyDown:
|
|
7489
|
+
value: v,
|
|
7490
|
+
onInput: Te,
|
|
7491
|
+
onKeyDown: we,
|
|
7342
7492
|
placeholder: u,
|
|
7343
7493
|
disabled: t,
|
|
7344
7494
|
rows: 1,
|
|
7345
7495
|
"aria-label": "Message input"
|
|
7346
|
-
}),
|
|
7347
|
-
|
|
7496
|
+
}), me && /* @__PURE__ */ c("button", {
|
|
7497
|
+
className: "ak-composer__mic",
|
|
7498
|
+
onClick: () => void Se(),
|
|
7499
|
+
disabled: t || b.length >= h,
|
|
7500
|
+
"aria-label": b.length >= h ? `Only ${h} attachments can be sent at once` : "Record a voice note",
|
|
7501
|
+
title: b.length >= h ? `Only ${h} attachments can be sent at once` : "Record a voice note",
|
|
7502
|
+
type: "button",
|
|
7503
|
+
children: /* @__PURE__ */ c(fo, {})
|
|
7504
|
+
})]
|
|
7505
|
+
}), /* @__PURE__ */ l("div", {
|
|
7506
|
+
className: "ak-composer__toolbar",
|
|
7507
|
+
children: [fe && /* @__PURE__ */ c("div", {
|
|
7508
|
+
className: "ak-composer__attach-wrap",
|
|
7509
|
+
children: /* @__PURE__ */ c("button", {
|
|
7510
|
+
ref: te,
|
|
7511
|
+
className: `ak-composer__attach${w ? " ak-composer__attach--open" : ""}`,
|
|
7512
|
+
onClick: () => T((e) => !e),
|
|
7513
|
+
disabled: t,
|
|
7514
|
+
"aria-label": "Attachment options",
|
|
7515
|
+
"aria-haspopup": "true",
|
|
7516
|
+
"aria-expanded": w,
|
|
7517
|
+
type: "button",
|
|
7518
|
+
children: /* @__PURE__ */ c(so, {})
|
|
7519
|
+
})
|
|
7520
|
+
}), /* @__PURE__ */ c("button", {
|
|
7348
7521
|
className: "ak-composer__send",
|
|
7349
|
-
onClick:
|
|
7350
|
-
disabled: !
|
|
7522
|
+
onClick: be,
|
|
7523
|
+
disabled: !je,
|
|
7351
7524
|
"aria-label": "Send message",
|
|
7352
7525
|
type: "button",
|
|
7353
|
-
children: /* @__PURE__ */ c(
|
|
7354
|
-
})
|
|
7355
|
-
]
|
|
7526
|
+
children: /* @__PURE__ */ c(oo, {})
|
|
7527
|
+
})]
|
|
7528
|
+
})] })
|
|
7356
7529
|
}),
|
|
7357
7530
|
/* @__PURE__ */ l("p", {
|
|
7358
7531
|
className: "ak-composer__disclaimer",
|
|
@@ -7360,7 +7533,7 @@ function ho({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7360
7533
|
"By chatting you agree to our",
|
|
7361
7534
|
" ",
|
|
7362
7535
|
/* @__PURE__ */ c("a", {
|
|
7363
|
-
href:
|
|
7536
|
+
href: io,
|
|
7364
7537
|
target: "_blank",
|
|
7365
7538
|
rel: "noopener noreferrer",
|
|
7366
7539
|
children: "Privacy Policy"
|
|
@@ -7369,7 +7542,7 @@ function ho({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7369
7542
|
"and",
|
|
7370
7543
|
" ",
|
|
7371
7544
|
/* @__PURE__ */ c("a", {
|
|
7372
|
-
href:
|
|
7545
|
+
href: ao,
|
|
7373
7546
|
target: "_blank",
|
|
7374
7547
|
rel: "noopener noreferrer",
|
|
7375
7548
|
children: "Terms of Service"
|
|
@@ -7381,9 +7554,8 @@ function ho({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7381
7554
|
]
|
|
7382
7555
|
});
|
|
7383
7556
|
}
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
function go({ message: e }) {
|
|
7557
|
+
// ../../packages/widget-ui/src/components/ErrorState.tsx
|
|
7558
|
+
function Eo({ message: e }) {
|
|
7387
7559
|
return e.includes("Origin not allowed") ? /* @__PURE__ */ l("div", {
|
|
7388
7560
|
className: "ak-error ak-error--origin",
|
|
7389
7561
|
role: "alert",
|
|
@@ -7415,9 +7587,8 @@ function go({ message: e }) {
|
|
|
7415
7587
|
})]
|
|
7416
7588
|
});
|
|
7417
7589
|
}
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
function _o() {
|
|
7590
|
+
// ../../packages/widget-ui/src/components/MaintenanceState.tsx
|
|
7591
|
+
function Do() {
|
|
7421
7592
|
return /* @__PURE__ */ l("svg", {
|
|
7422
7593
|
width: "28",
|
|
7423
7594
|
height: "28",
|
|
@@ -7435,7 +7606,7 @@ function _o() {
|
|
|
7435
7606
|
}), /* @__PURE__ */ c("path", { d: "M12 7v5l3 2" })]
|
|
7436
7607
|
});
|
|
7437
7608
|
}
|
|
7438
|
-
function
|
|
7609
|
+
function Oo() {
|
|
7439
7610
|
return /* @__PURE__ */ l("div", {
|
|
7440
7611
|
className: "ak-maintenance",
|
|
7441
7612
|
role: "status",
|
|
@@ -7447,7 +7618,7 @@ function vo() {
|
|
|
7447
7618
|
}),
|
|
7448
7619
|
/* @__PURE__ */ c("div", {
|
|
7449
7620
|
className: "ak-maintenance__icon",
|
|
7450
|
-
children: /* @__PURE__ */ c(
|
|
7621
|
+
children: /* @__PURE__ */ c(Do, {})
|
|
7451
7622
|
}),
|
|
7452
7623
|
/* @__PURE__ */ c("p", {
|
|
7453
7624
|
className: "ak-maintenance__title",
|
|
@@ -7460,9 +7631,8 @@ function vo() {
|
|
|
7460
7631
|
]
|
|
7461
7632
|
});
|
|
7462
7633
|
}
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
function yo() {
|
|
7634
|
+
// ../../packages/widget-ui/src/components/WidgetShell.tsx
|
|
7635
|
+
function ko() {
|
|
7466
7636
|
return /* @__PURE__ */ l("svg", {
|
|
7467
7637
|
width: "11",
|
|
7468
7638
|
height: "11",
|
|
@@ -7481,11 +7651,11 @@ function yo() {
|
|
|
7481
7651
|
})]
|
|
7482
7652
|
});
|
|
7483
7653
|
}
|
|
7484
|
-
function
|
|
7654
|
+
function Ao() {
|
|
7485
7655
|
return /* @__PURE__ */ l("div", {
|
|
7486
7656
|
className: "ak-branding",
|
|
7487
7657
|
children: [
|
|
7488
|
-
/* @__PURE__ */ c(
|
|
7658
|
+
/* @__PURE__ */ c(ko, {}),
|
|
7489
7659
|
/* @__PURE__ */ c("span", {
|
|
7490
7660
|
className: "ak-branding__label",
|
|
7491
7661
|
children: "Powered by"
|
|
@@ -7497,7 +7667,8 @@ function bo() {
|
|
|
7497
7667
|
]
|
|
7498
7668
|
});
|
|
7499
7669
|
}
|
|
7500
|
-
function
|
|
7670
|
+
function jo({ config: e, messages: t, isLoading: n, error: r, isInline: i, initStatus: a, initError: u, callbacks: d }) {
|
|
7671
|
+
let [f, p] = o(null);
|
|
7501
7672
|
return /* @__PURE__ */ l("div", {
|
|
7502
7673
|
className: i ? "ak-shell-wrap" : "ak-shell-wrap ak-shell-enter",
|
|
7503
7674
|
children: [/* @__PURE__ */ l("div", {
|
|
@@ -7505,12 +7676,12 @@ function xo({ config: e, messages: t, isLoading: n, error: r, isInline: i, initS
|
|
|
7505
7676
|
role: "dialog",
|
|
7506
7677
|
"aria-label": e.title,
|
|
7507
7678
|
children: [
|
|
7508
|
-
/* @__PURE__ */ c(
|
|
7679
|
+
/* @__PURE__ */ c(Ma, {
|
|
7509
7680
|
title: e.title,
|
|
7510
7681
|
subtitle: e.subtitle,
|
|
7511
7682
|
avatarUrl: e.avatarUrl,
|
|
7512
|
-
onClose:
|
|
7513
|
-
onReset: a === "ready" ?
|
|
7683
|
+
onClose: d.onClose,
|
|
7684
|
+
onReset: a === "ready" ? d.onReset : void 0,
|
|
7514
7685
|
hideClose: i
|
|
7515
7686
|
}),
|
|
7516
7687
|
a === "validating" && /* @__PURE__ */ c("div", {
|
|
@@ -7522,41 +7693,45 @@ function xo({ config: e, messages: t, isLoading: n, error: r, isInline: i, initS
|
|
|
7522
7693
|
}),
|
|
7523
7694
|
a === "error" && /* @__PURE__ */ c("div", {
|
|
7524
7695
|
className: "ak-init-status ak-init-status--error",
|
|
7525
|
-
children: /* @__PURE__ */ c(
|
|
7696
|
+
children: /* @__PURE__ */ c(Eo, { message: u ?? "Widget configuration is invalid." })
|
|
7526
7697
|
}),
|
|
7527
7698
|
a === "disabled" && /* @__PURE__ */ c("div", {
|
|
7528
7699
|
className: "ak-init-status ak-init-status--maintenance",
|
|
7529
|
-
children: /* @__PURE__ */ c(
|
|
7700
|
+
children: /* @__PURE__ */ c(Oo, {})
|
|
7530
7701
|
}),
|
|
7531
7702
|
a === "ready" && /* @__PURE__ */ l(s, { children: [
|
|
7532
|
-
t.length === 0 ? /* @__PURE__ */ c(
|
|
7703
|
+
t.length === 0 ? /* @__PURE__ */ c(ro, {
|
|
7533
7704
|
title: e.title,
|
|
7534
7705
|
description: e.description ?? e.subtitle,
|
|
7535
7706
|
suggestedQuestions: e.suggestedQuestions,
|
|
7536
7707
|
avatarUrl: e.avatarUrl,
|
|
7537
|
-
onSelect: (e) =>
|
|
7538
|
-
}) : /* @__PURE__ */ c(
|
|
7708
|
+
onSelect: (e) => d.onSendMessage(e, [])
|
|
7709
|
+
}) : /* @__PURE__ */ c(to, {
|
|
7539
7710
|
messages: t,
|
|
7540
7711
|
isLoading: n
|
|
7541
7712
|
}),
|
|
7542
|
-
r && /* @__PURE__ */ c(
|
|
7543
|
-
/* @__PURE__ */ c(
|
|
7544
|
-
onSend:
|
|
7713
|
+
(r || f) && /* @__PURE__ */ c(Eo, { message: r ?? f }),
|
|
7714
|
+
/* @__PURE__ */ c(To, {
|
|
7715
|
+
onSend: (e, t) => {
|
|
7716
|
+
p(null), d.onSendMessage(e, t);
|
|
7717
|
+
},
|
|
7718
|
+
onRecordingError: p,
|
|
7545
7719
|
disabled: n,
|
|
7546
7720
|
placeholder: "Type a message…",
|
|
7547
7721
|
photoSendingEnabled: e.photoSendingEnabled,
|
|
7548
7722
|
fileUploadEnabled: e.fileUploadEnabled,
|
|
7723
|
+
voiceNoteEnabled: e.voiceNoteEnabled,
|
|
7724
|
+
voiceNoteMaxDurationSec: e.voiceNoteMaxDurationSec,
|
|
7549
7725
|
attachmentMaxCount: e.attachmentMaxCount,
|
|
7550
7726
|
attachmentMaxFileSizeMb: e.attachmentMaxFileSizeMb
|
|
7551
7727
|
})
|
|
7552
7728
|
] })
|
|
7553
7729
|
]
|
|
7554
|
-
}), !i && /* @__PURE__ */ c(
|
|
7730
|
+
}), !i && /* @__PURE__ */ c(Ao, {})]
|
|
7555
7731
|
});
|
|
7556
7732
|
}
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
function So() {
|
|
7733
|
+
// ../../packages/widget-ui/src/components/Launcher.tsx
|
|
7734
|
+
function Mo() {
|
|
7560
7735
|
return /* @__PURE__ */ c("svg", {
|
|
7561
7736
|
width: "24",
|
|
7562
7737
|
height: "24",
|
|
@@ -7569,7 +7744,7 @@ function So() {
|
|
|
7569
7744
|
children: /* @__PURE__ */ c("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
|
|
7570
7745
|
});
|
|
7571
7746
|
}
|
|
7572
|
-
function
|
|
7747
|
+
function No() {
|
|
7573
7748
|
return /* @__PURE__ */ c("svg", {
|
|
7574
7749
|
width: "22",
|
|
7575
7750
|
height: "22",
|
|
@@ -7582,7 +7757,7 @@ function Co() {
|
|
|
7582
7757
|
children: /* @__PURE__ */ c("polyline", { points: "6,9 12,15 18,9" })
|
|
7583
7758
|
});
|
|
7584
7759
|
}
|
|
7585
|
-
function
|
|
7760
|
+
function Po({ isOpen: e, onClick: t, avatarUrl: n, ariaLabel: r = "Toggle chat" }) {
|
|
7586
7761
|
let i = !e && !!n;
|
|
7587
7762
|
return /* @__PURE__ */ c("button", {
|
|
7588
7763
|
className: `ak-launcher${i ? " ak-launcher--avatar" : ""}`,
|
|
@@ -7590,31 +7765,30 @@ function wo({ isOpen: e, onClick: t, avatarUrl: n, ariaLabel: r = "Toggle chat"
|
|
|
7590
7765
|
"aria-label": r,
|
|
7591
7766
|
"aria-expanded": e,
|
|
7592
7767
|
type: "button",
|
|
7593
|
-
children: e ? /* @__PURE__ */ c(
|
|
7768
|
+
children: e ? /* @__PURE__ */ c(No, {}) : i ? /* @__PURE__ */ c("img", {
|
|
7594
7769
|
src: n,
|
|
7595
7770
|
alt: "",
|
|
7596
7771
|
className: "ak-launcher__avatar-img",
|
|
7597
7772
|
"aria-hidden": "true"
|
|
7598
|
-
}) : /* @__PURE__ */ c(
|
|
7773
|
+
}) : /* @__PURE__ */ c(Mo, {})
|
|
7599
7774
|
});
|
|
7600
7775
|
}
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
function To({ config: e, state: t, callbacks: n }) {
|
|
7776
|
+
// ../../packages/widget-ui/src/WidgetApp.tsx
|
|
7777
|
+
function Fo({ config: e, state: t, callbacks: n }) {
|
|
7604
7778
|
let i = e.mode === "inline", o = a(null);
|
|
7605
7779
|
return r(() => {
|
|
7606
7780
|
let t = o.current?.getRootNode()?.host;
|
|
7607
7781
|
if (!t) return;
|
|
7608
|
-
let n =
|
|
7782
|
+
let n = Da(e.theme.mode);
|
|
7609
7783
|
t.setAttribute("data-theme", n);
|
|
7610
7784
|
}, [e.theme.mode]), r(() => {
|
|
7611
7785
|
if (i) return;
|
|
7612
7786
|
let e = o.current?.getRootNode()?.host;
|
|
7613
7787
|
e && (t.isOpen ? e.setAttribute("data-open", "") : e.removeAttribute("data-open"));
|
|
7614
|
-
}, [i, t.isOpen]), i ? /* @__PURE__ */ c("div", {
|
|
7788
|
+
}, [i, t.isOpen]), t.initStatus === "disabled" && !i ? null : i ? /* @__PURE__ */ c("div", {
|
|
7615
7789
|
ref: o,
|
|
7616
7790
|
className: "ak-inline",
|
|
7617
|
-
children: /* @__PURE__ */ c(
|
|
7791
|
+
children: /* @__PURE__ */ c(jo, {
|
|
7618
7792
|
config: e,
|
|
7619
7793
|
messages: t.messages,
|
|
7620
7794
|
isLoading: t.isLoading,
|
|
@@ -7627,7 +7801,7 @@ function To({ config: e, state: t, callbacks: n }) {
|
|
|
7627
7801
|
}) : /* @__PURE__ */ l("div", {
|
|
7628
7802
|
ref: o,
|
|
7629
7803
|
className: "ak-floating",
|
|
7630
|
-
children: [t.isOpen && /* @__PURE__ */ c(
|
|
7804
|
+
children: [t.isOpen && /* @__PURE__ */ c(jo, {
|
|
7631
7805
|
config: e,
|
|
7632
7806
|
messages: t.messages,
|
|
7633
7807
|
isLoading: t.isLoading,
|
|
@@ -7636,24 +7810,23 @@ function To({ config: e, state: t, callbacks: n }) {
|
|
|
7636
7810
|
initStatus: t.initStatus,
|
|
7637
7811
|
initError: t.initError,
|
|
7638
7812
|
callbacks: n
|
|
7639
|
-
}), /* @__PURE__ */ c(
|
|
7813
|
+
}), /* @__PURE__ */ c(Po, {
|
|
7640
7814
|
isOpen: t.isOpen,
|
|
7641
7815
|
onClick: t.isOpen ? n.onClose : n.onOpen,
|
|
7642
7816
|
avatarUrl: e.avatarUrl
|
|
7643
7817
|
})]
|
|
7644
7818
|
});
|
|
7645
7819
|
}
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
var Eo = (n, r, i, a) => {
|
|
7820
|
+
// ../../packages/widget-ui/src/index.ts
|
|
7821
|
+
var Io = (n, r, i, a) => {
|
|
7649
7822
|
let o = e(n);
|
|
7650
|
-
return o.render(t(
|
|
7823
|
+
return o.render(t(Fo, {
|
|
7651
7824
|
config: r,
|
|
7652
7825
|
state: i,
|
|
7653
7826
|
callbacks: a
|
|
7654
7827
|
})), {
|
|
7655
7828
|
update(e, n) {
|
|
7656
|
-
o.render(t(
|
|
7829
|
+
o.render(t(Fo, {
|
|
7657
7830
|
config: n,
|
|
7658
7831
|
state: e,
|
|
7659
7832
|
callbacks: a
|
|
@@ -7666,28 +7839,26 @@ var Eo = (n, r, i, a) => {
|
|
|
7666
7839
|
}
|
|
7667
7840
|
};
|
|
7668
7841
|
};
|
|
7669
|
-
function
|
|
7670
|
-
return
|
|
7842
|
+
function Lo(e) {
|
|
7843
|
+
return Oa + "\n" + Ea(e);
|
|
7671
7844
|
}
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
return Do(_t({
|
|
7845
|
+
// src/api.ts
|
|
7846
|
+
function Ro(e, t) {
|
|
7847
|
+
return Lo(gt({
|
|
7676
7848
|
...e,
|
|
7677
7849
|
mode: t
|
|
7678
7850
|
}));
|
|
7679
7851
|
}
|
|
7680
|
-
function
|
|
7681
|
-
return
|
|
7852
|
+
function zo(e, t = Io, n) {
|
|
7853
|
+
return xa(e, t, n ?? Ro(e, "floating"));
|
|
7682
7854
|
}
|
|
7683
|
-
function
|
|
7684
|
-
return
|
|
7855
|
+
function Bo(e, t, n = Io, r) {
|
|
7856
|
+
return Ca(e, t, n, r ?? Ro(t, "inline"));
|
|
7685
7857
|
}
|
|
7686
|
-
function
|
|
7687
|
-
return
|
|
7858
|
+
function Vo(e, t, n = Io, r) {
|
|
7859
|
+
return Sa(e, t, n, r ?? Ro(t, "floating"));
|
|
7688
7860
|
}
|
|
7689
|
-
function
|
|
7690
|
-
|
|
7861
|
+
function Ho(e) {
|
|
7862
|
+
wa(e);
|
|
7691
7863
|
}
|
|
7692
|
-
|
|
7693
|
-
export { Oi as ApiClient, ho as Composer, go as ErrorState, Gi as EventEmitter, ka as Header, wo as Launcher, Ja as MessageBubble, Za as MessageList, Ya as TypingIndicator, To as WidgetApp, na as WidgetClient, xo as WidgetShell, Ca as buildThemeVars, Do as buildWidgetCSS, Xi as clearSession, la as createFloatingContainer, aa as createShadowHost, ma as createWidget, Mo as destroy, xa as destroyWidget, Ji as getSessionId, ko as init, oa as injectStyles, Sa as listWidgets, Ao as mount, jo as mountFloating, _t as normalizeConfig, da as prepareInlineContainer, sa as removeShadowHost, Eo as renderWidget, wa as resolveThemeMode, Yi as setSessionId, ji as streamChat, Ta as widgetCSS };
|
|
7864
|
+
export { Oi as ApiClient, To as Composer, Eo as ErrorState, Gi as EventEmitter, Ma as Header, Po as Launcher, Qa as MessageBubble, to as MessageList, $a as TypingIndicator, Fo as WidgetApp, aa as WidgetClient, jo as WidgetShell, Ea as buildThemeVars, Lo as buildWidgetCSS, Xi as clearSession, fa as createFloatingContainer, ca as createShadowHost, _a as createWidget, Ho as destroy, wa as destroyWidget, Ji as getSessionId, zo as init, la as injectStyles, Ta as listWidgets, Bo as mount, Vo as mountFloating, gt as normalizeConfig, ma as prepareInlineContainer, ua as removeShadowHost, Io as renderWidget, Da as resolveThemeMode, Yi as setSessionId, ji as streamChat, Oa as widgetCSS };
|