@bymos/agentkit-sdk 0.7.4 → 0.9.3
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 +129 -10
- package/agentkit-widget.js +129 -10
- package/index.cjs +130 -11
- package/index.d.ts +94 -12
- package/index.js +1140 -781
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -499,16 +499,16 @@ var M = class {
|
|
|
499
499
|
return this.nullable().optional();
|
|
500
500
|
}
|
|
501
501
|
array() {
|
|
502
|
-
return
|
|
502
|
+
return Ie.create(this);
|
|
503
503
|
}
|
|
504
504
|
promise() {
|
|
505
505
|
return Qe.create(this, this._def);
|
|
506
506
|
}
|
|
507
507
|
or(e) {
|
|
508
|
-
return
|
|
508
|
+
return Re.create([this, e], this._def);
|
|
509
509
|
}
|
|
510
510
|
and(e) {
|
|
511
|
-
return
|
|
511
|
+
return Ve.create(this, e, this._def);
|
|
512
512
|
}
|
|
513
513
|
transform(e) {
|
|
514
514
|
return new L({
|
|
@@ -565,25 +565,25 @@ var M = class {
|
|
|
565
565
|
isNullable() {
|
|
566
566
|
return this.safeParse(null).success;
|
|
567
567
|
}
|
|
568
|
-
}, te = /^c[^\s-]{8,}$/i, ne = /^[0-9a-z]+$/,
|
|
569
|
-
function
|
|
568
|
+
}, 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}$`);
|
|
569
|
+
function ve(e) {
|
|
570
570
|
let t = "[0-5]\\d";
|
|
571
571
|
e.precision ? t = `${t}\\.\\d{${e.precision}}` : e.precision ?? (t = `${t}(\\.\\d+)?`);
|
|
572
572
|
let n = e.precision ? "+" : "?";
|
|
573
573
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`;
|
|
574
574
|
}
|
|
575
|
-
function
|
|
576
|
-
return RegExp(`^${
|
|
575
|
+
function ye(e) {
|
|
576
|
+
return RegExp(`^${ve(e)}$`);
|
|
577
577
|
}
|
|
578
|
-
function
|
|
579
|
-
let t = `${
|
|
578
|
+
function be(e) {
|
|
579
|
+
let t = `${ge}T${ve(e)}`, n = [];
|
|
580
580
|
return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
|
|
581
581
|
}
|
|
582
|
-
function
|
|
583
|
-
return !!((t === "v4" || !t) &&
|
|
582
|
+
function xe(e, t) {
|
|
583
|
+
return !!((t === "v4" || !t) && ue.test(e) || (t === "v6" || !t) && fe.test(e));
|
|
584
584
|
}
|
|
585
|
-
function
|
|
586
|
-
if (!
|
|
585
|
+
function Se(e, t) {
|
|
586
|
+
if (!ae.test(e)) return !1;
|
|
587
587
|
try {
|
|
588
588
|
let [n] = e.split(".");
|
|
589
589
|
if (!n) return !1;
|
|
@@ -593,10 +593,10 @@ function Ce(e, t) {
|
|
|
593
593
|
return !1;
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
|
-
function
|
|
597
|
-
return !!((t === "v4" || !t) &&
|
|
596
|
+
function Ce(e, t) {
|
|
597
|
+
return !!((t === "v4" || !t) && de.test(e) || (t === "v6" || !t) && pe.test(e));
|
|
598
598
|
}
|
|
599
|
-
var
|
|
599
|
+
var we = class e extends M {
|
|
600
600
|
_parse(e) {
|
|
601
601
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
|
|
602
602
|
let t = this._getOrReturnCtx(e);
|
|
@@ -640,22 +640,22 @@ var Te = class e extends M {
|
|
|
640
640
|
exact: !0,
|
|
641
641
|
message: r.message
|
|
642
642
|
}), t.dirty());
|
|
643
|
-
} else if (r.kind === "email")
|
|
643
|
+
} else if (r.kind === "email") se.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
644
644
|
validation: "email",
|
|
645
645
|
code: m.invalid_string,
|
|
646
646
|
message: r.message
|
|
647
647
|
}), t.dirty());
|
|
648
|
-
else if (r.kind === "emoji")
|
|
648
|
+
else if (r.kind === "emoji") le ||= new RegExp(ce, "u"), le.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
649
649
|
validation: "emoji",
|
|
650
650
|
code: m.invalid_string,
|
|
651
651
|
message: r.message
|
|
652
652
|
}), t.dirty());
|
|
653
|
-
else if (r.kind === "uuid")
|
|
653
|
+
else if (r.kind === "uuid") re.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
654
654
|
validation: "uuid",
|
|
655
655
|
code: m.invalid_string,
|
|
656
656
|
message: r.message
|
|
657
657
|
}), t.dirty());
|
|
658
|
-
else if (r.kind === "nanoid")
|
|
658
|
+
else if (r.kind === "nanoid") ie.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
659
659
|
validation: "nanoid",
|
|
660
660
|
code: m.invalid_string,
|
|
661
661
|
message: r.message
|
|
@@ -670,7 +670,7 @@ var Te = class e extends M {
|
|
|
670
670
|
code: m.invalid_string,
|
|
671
671
|
message: r.message
|
|
672
672
|
}), t.dirty());
|
|
673
|
-
else if (r.kind === "ulid")
|
|
673
|
+
else if (r.kind === "ulid") N.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
674
674
|
validation: "ulid",
|
|
675
675
|
code: m.invalid_string,
|
|
676
676
|
message: r.message
|
|
@@ -703,39 +703,39 @@ var Te = class e extends M {
|
|
|
703
703
|
code: m.invalid_string,
|
|
704
704
|
validation: { endsWith: r.value },
|
|
705
705
|
message: r.message
|
|
706
|
-
}), t.dirty()) : r.kind === "datetime" ?
|
|
706
|
+
}), t.dirty()) : r.kind === "datetime" ? be(r).test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
707
707
|
code: m.invalid_string,
|
|
708
708
|
validation: "datetime",
|
|
709
709
|
message: r.message
|
|
710
|
-
}), t.dirty()) : r.kind === "date" ?
|
|
710
|
+
}), t.dirty()) : r.kind === "date" ? _e.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
711
711
|
code: m.invalid_string,
|
|
712
712
|
validation: "date",
|
|
713
713
|
message: r.message
|
|
714
|
-
}), t.dirty()) : r.kind === "time" ?
|
|
714
|
+
}), t.dirty()) : r.kind === "time" ? ye(r).test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
715
715
|
code: m.invalid_string,
|
|
716
716
|
validation: "time",
|
|
717
717
|
message: r.message
|
|
718
|
-
}), t.dirty()) : r.kind === "duration" ?
|
|
718
|
+
}), t.dirty()) : r.kind === "duration" ? oe.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
719
719
|
validation: "duration",
|
|
720
720
|
code: m.invalid_string,
|
|
721
721
|
message: r.message
|
|
722
|
-
}), t.dirty()) : r.kind === "ip" ?
|
|
722
|
+
}), t.dirty()) : r.kind === "ip" ? xe(e.data, r.version) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
723
723
|
validation: "ip",
|
|
724
724
|
code: m.invalid_string,
|
|
725
725
|
message: r.message
|
|
726
|
-
}), t.dirty()) : r.kind === "jwt" ?
|
|
726
|
+
}), t.dirty()) : r.kind === "jwt" ? Se(e.data, r.alg) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
727
727
|
validation: "jwt",
|
|
728
728
|
code: m.invalid_string,
|
|
729
729
|
message: r.message
|
|
730
|
-
}), t.dirty()) : r.kind === "cidr" ?
|
|
730
|
+
}), t.dirty()) : r.kind === "cidr" ? Ce(e.data, r.version) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
731
731
|
validation: "cidr",
|
|
732
732
|
code: m.invalid_string,
|
|
733
733
|
message: r.message
|
|
734
|
-
}), t.dirty()) : r.kind === "base64" ?
|
|
734
|
+
}), t.dirty()) : r.kind === "base64" ? me.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
735
735
|
validation: "base64",
|
|
736
736
|
code: m.invalid_string,
|
|
737
737
|
message: r.message
|
|
738
|
-
}), t.dirty()) : r.kind === "base64url" ?
|
|
738
|
+
}), t.dirty()) : r.kind === "base64url" ? he.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
739
739
|
validation: "base64url",
|
|
740
740
|
code: m.invalid_string,
|
|
741
741
|
message: r.message
|
|
@@ -1004,17 +1004,17 @@ var Te = class e extends M {
|
|
|
1004
1004
|
return e;
|
|
1005
1005
|
}
|
|
1006
1006
|
};
|
|
1007
|
-
|
|
1007
|
+
we.create = (e) => new we({
|
|
1008
1008
|
checks: [],
|
|
1009
1009
|
typeName: z.ZodString,
|
|
1010
1010
|
coerce: e?.coerce ?? !1,
|
|
1011
1011
|
...j(e)
|
|
1012
1012
|
});
|
|
1013
|
-
function
|
|
1013
|
+
function Te(e, t) {
|
|
1014
1014
|
let n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, i = n > r ? n : r;
|
|
1015
1015
|
return Number.parseInt(e.toFixed(i).replace(".", "")) % Number.parseInt(t.toFixed(i).replace(".", "")) / 10 ** i;
|
|
1016
1016
|
}
|
|
1017
|
-
var
|
|
1017
|
+
var Ee = class e extends M {
|
|
1018
1018
|
constructor() {
|
|
1019
1019
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1020
1020
|
}
|
|
@@ -1047,7 +1047,7 @@ var De = class e extends M {
|
|
|
1047
1047
|
inclusive: r.inclusive,
|
|
1048
1048
|
exact: !1,
|
|
1049
1049
|
message: r.message
|
|
1050
|
-
}), n.dirty()) : r.kind === "multipleOf" ?
|
|
1050
|
+
}), n.dirty()) : r.kind === "multipleOf" ? Te(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), b(t, {
|
|
1051
1051
|
code: m.not_multiple_of,
|
|
1052
1052
|
multipleOf: r.value,
|
|
1053
1053
|
message: r.message
|
|
@@ -1173,13 +1173,13 @@ var De = class e extends M {
|
|
|
1173
1173
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1174
1174
|
}
|
|
1175
1175
|
};
|
|
1176
|
-
|
|
1176
|
+
Ee.create = (e) => new Ee({
|
|
1177
1177
|
checks: [],
|
|
1178
1178
|
typeName: z.ZodNumber,
|
|
1179
1179
|
coerce: e?.coerce || !1,
|
|
1180
1180
|
...j(e)
|
|
1181
1181
|
});
|
|
1182
|
-
var
|
|
1182
|
+
var De = class e extends M {
|
|
1183
1183
|
constructor() {
|
|
1184
1184
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1185
1185
|
}
|
|
@@ -1300,13 +1300,13 @@ var Oe = class e extends M {
|
|
|
1300
1300
|
return e;
|
|
1301
1301
|
}
|
|
1302
1302
|
};
|
|
1303
|
-
|
|
1303
|
+
De.create = (e) => new De({
|
|
1304
1304
|
checks: [],
|
|
1305
1305
|
typeName: z.ZodBigInt,
|
|
1306
1306
|
coerce: e?.coerce ?? !1,
|
|
1307
1307
|
...j(e)
|
|
1308
1308
|
});
|
|
1309
|
-
var
|
|
1309
|
+
var Oe = class extends M {
|
|
1310
1310
|
_parse(e) {
|
|
1311
1311
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
|
|
1312
1312
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1319,12 +1319,12 @@ var ke = class extends M {
|
|
|
1319
1319
|
return w(e.data);
|
|
1320
1320
|
}
|
|
1321
1321
|
};
|
|
1322
|
-
|
|
1322
|
+
Oe.create = (e) => new Oe({
|
|
1323
1323
|
typeName: z.ZodBoolean,
|
|
1324
1324
|
coerce: e?.coerce || !1,
|
|
1325
1325
|
...j(e)
|
|
1326
1326
|
});
|
|
1327
|
-
var
|
|
1327
|
+
var ke = class e extends M {
|
|
1328
1328
|
_parse(e) {
|
|
1329
1329
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
|
|
1330
1330
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1387,13 +1387,13 @@ var Ae = class e extends M {
|
|
|
1387
1387
|
return e == null ? null : new Date(e);
|
|
1388
1388
|
}
|
|
1389
1389
|
};
|
|
1390
|
-
|
|
1390
|
+
ke.create = (e) => new ke({
|
|
1391
1391
|
checks: [],
|
|
1392
1392
|
coerce: e?.coerce || !1,
|
|
1393
1393
|
typeName: z.ZodDate,
|
|
1394
1394
|
...j(e)
|
|
1395
1395
|
});
|
|
1396
|
-
var
|
|
1396
|
+
var Ae = class extends M {
|
|
1397
1397
|
_parse(e) {
|
|
1398
1398
|
if (this._getType(e) !== f.symbol) {
|
|
1399
1399
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1406,11 +1406,11 @@ var je = class extends M {
|
|
|
1406
1406
|
return w(e.data);
|
|
1407
1407
|
}
|
|
1408
1408
|
};
|
|
1409
|
-
|
|
1409
|
+
Ae.create = (e) => new Ae({
|
|
1410
1410
|
typeName: z.ZodSymbol,
|
|
1411
1411
|
...j(e)
|
|
1412
1412
|
});
|
|
1413
|
-
var
|
|
1413
|
+
var je = class extends M {
|
|
1414
1414
|
_parse(e) {
|
|
1415
1415
|
if (this._getType(e) !== f.undefined) {
|
|
1416
1416
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1423,11 +1423,11 @@ var Me = class extends M {
|
|
|
1423
1423
|
return w(e.data);
|
|
1424
1424
|
}
|
|
1425
1425
|
};
|
|
1426
|
-
|
|
1426
|
+
je.create = (e) => new je({
|
|
1427
1427
|
typeName: z.ZodUndefined,
|
|
1428
1428
|
...j(e)
|
|
1429
1429
|
});
|
|
1430
|
-
var
|
|
1430
|
+
var Me = class extends M {
|
|
1431
1431
|
_parse(e) {
|
|
1432
1432
|
if (this._getType(e) !== f.null) {
|
|
1433
1433
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1440,11 +1440,11 @@ var Ne = class extends M {
|
|
|
1440
1440
|
return w(e.data);
|
|
1441
1441
|
}
|
|
1442
1442
|
};
|
|
1443
|
-
|
|
1443
|
+
Me.create = (e) => new Me({
|
|
1444
1444
|
typeName: z.ZodNull,
|
|
1445
1445
|
...j(e)
|
|
1446
1446
|
});
|
|
1447
|
-
var
|
|
1447
|
+
var Ne = class extends M {
|
|
1448
1448
|
constructor() {
|
|
1449
1449
|
super(...arguments), this._any = !0;
|
|
1450
1450
|
}
|
|
@@ -1452,11 +1452,11 @@ var Pe = class extends M {
|
|
|
1452
1452
|
return w(e.data);
|
|
1453
1453
|
}
|
|
1454
1454
|
};
|
|
1455
|
-
|
|
1455
|
+
Ne.create = (e) => new Ne({
|
|
1456
1456
|
typeName: z.ZodAny,
|
|
1457
1457
|
...j(e)
|
|
1458
1458
|
});
|
|
1459
|
-
var
|
|
1459
|
+
var Pe = class extends M {
|
|
1460
1460
|
constructor() {
|
|
1461
1461
|
super(...arguments), this._unknown = !0;
|
|
1462
1462
|
}
|
|
@@ -1464,11 +1464,11 @@ var Fe = class extends M {
|
|
|
1464
1464
|
return w(e.data);
|
|
1465
1465
|
}
|
|
1466
1466
|
};
|
|
1467
|
-
|
|
1467
|
+
Pe.create = (e) => new Pe({
|
|
1468
1468
|
typeName: z.ZodUnknown,
|
|
1469
1469
|
...j(e)
|
|
1470
1470
|
});
|
|
1471
|
-
var
|
|
1471
|
+
var P = class extends M {
|
|
1472
1472
|
_parse(e) {
|
|
1473
1473
|
let t = this._getOrReturnCtx(e);
|
|
1474
1474
|
return b(t, {
|
|
@@ -1478,11 +1478,11 @@ var N = class extends M {
|
|
|
1478
1478
|
}), S;
|
|
1479
1479
|
}
|
|
1480
1480
|
};
|
|
1481
|
-
|
|
1481
|
+
P.create = (e) => new P({
|
|
1482
1482
|
typeName: z.ZodNever,
|
|
1483
1483
|
...j(e)
|
|
1484
1484
|
});
|
|
1485
|
-
var
|
|
1485
|
+
var Fe = class extends M {
|
|
1486
1486
|
_parse(e) {
|
|
1487
1487
|
if (this._getType(e) !== f.undefined) {
|
|
1488
1488
|
let t = this._getOrReturnCtx(e);
|
|
@@ -1495,11 +1495,11 @@ var Ie = class extends M {
|
|
|
1495
1495
|
return w(e.data);
|
|
1496
1496
|
}
|
|
1497
1497
|
};
|
|
1498
|
-
|
|
1498
|
+
Fe.create = (e) => new Fe({
|
|
1499
1499
|
typeName: z.ZodVoid,
|
|
1500
1500
|
...j(e)
|
|
1501
1501
|
});
|
|
1502
|
-
var
|
|
1502
|
+
var Ie = class e extends M {
|
|
1503
1503
|
_parse(e) {
|
|
1504
1504
|
let { ctx: t, status: n } = this._processInputParams(e), r = this._def;
|
|
1505
1505
|
if (t.parsedType !== f.array) return b(t, {
|
|
@@ -1571,7 +1571,7 @@ var Le = class e extends M {
|
|
|
1571
1571
|
return this.min(1, e);
|
|
1572
1572
|
}
|
|
1573
1573
|
};
|
|
1574
|
-
|
|
1574
|
+
Ie.create = (e, t) => new Ie({
|
|
1575
1575
|
type: e,
|
|
1576
1576
|
minLength: null,
|
|
1577
1577
|
maxLength: null,
|
|
@@ -1579,27 +1579,27 @@ Le.create = (e, t) => new Le({
|
|
|
1579
1579
|
typeName: z.ZodArray,
|
|
1580
1580
|
...j(t)
|
|
1581
1581
|
});
|
|
1582
|
-
function
|
|
1583
|
-
if (e instanceof
|
|
1582
|
+
function Le(e) {
|
|
1583
|
+
if (e instanceof F) {
|
|
1584
1584
|
let t = {};
|
|
1585
1585
|
for (let n in e.shape) {
|
|
1586
1586
|
let r = e.shape[n];
|
|
1587
|
-
t[n] = R.create(
|
|
1587
|
+
t[n] = R.create(Le(r));
|
|
1588
1588
|
}
|
|
1589
|
-
return new
|
|
1589
|
+
return new F({
|
|
1590
1590
|
...e._def,
|
|
1591
1591
|
shape: () => t
|
|
1592
1592
|
});
|
|
1593
|
-
} else if (e instanceof
|
|
1593
|
+
} else if (e instanceof Ie) return new Ie({
|
|
1594
1594
|
...e._def,
|
|
1595
|
-
type:
|
|
1595
|
+
type: Le(e.element)
|
|
1596
1596
|
});
|
|
1597
|
-
else if (e instanceof R) return R.create(
|
|
1598
|
-
else if (e instanceof $e) return $e.create(
|
|
1599
|
-
else if (e instanceof
|
|
1597
|
+
else if (e instanceof R) return R.create(Le(e.unwrap()));
|
|
1598
|
+
else if (e instanceof $e) return $e.create(Le(e.unwrap()));
|
|
1599
|
+
else if (e instanceof He) return He.create(e.items.map((e) => Le(e)));
|
|
1600
1600
|
else return e;
|
|
1601
1601
|
}
|
|
1602
|
-
var
|
|
1602
|
+
var F = class e extends M {
|
|
1603
1603
|
constructor() {
|
|
1604
1604
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1605
1605
|
}
|
|
@@ -1621,7 +1621,7 @@ var P = class e extends M {
|
|
|
1621
1621
|
}), S;
|
|
1622
1622
|
}
|
|
1623
1623
|
let { status: t, ctx: n } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), a = [];
|
|
1624
|
-
if (!(this._def.catchall instanceof
|
|
1624
|
+
if (!(this._def.catchall instanceof P && this._def.unknownKeys === "strip")) for (let e in n.data) i.includes(e) || a.push(e);
|
|
1625
1625
|
let o = [];
|
|
1626
1626
|
for (let e of i) {
|
|
1627
1627
|
let t = r[e], i = n.data[e];
|
|
@@ -1634,7 +1634,7 @@ var P = class e extends M {
|
|
|
1634
1634
|
alwaysSet: e in n.data
|
|
1635
1635
|
});
|
|
1636
1636
|
}
|
|
1637
|
-
if (this._def.catchall instanceof
|
|
1637
|
+
if (this._def.catchall instanceof P) {
|
|
1638
1638
|
let e = this._def.unknownKeys;
|
|
1639
1639
|
if (e === "passthrough") for (let e of a) o.push({
|
|
1640
1640
|
key: {
|
|
@@ -1749,7 +1749,7 @@ var P = class e extends M {
|
|
|
1749
1749
|
});
|
|
1750
1750
|
}
|
|
1751
1751
|
deepPartial() {
|
|
1752
|
-
return
|
|
1752
|
+
return Le(this);
|
|
1753
1753
|
}
|
|
1754
1754
|
partial(t) {
|
|
1755
1755
|
let n = {};
|
|
@@ -1779,26 +1779,26 @@ var P = class e extends M {
|
|
|
1779
1779
|
return Ye(u.objectKeys(this.shape));
|
|
1780
1780
|
}
|
|
1781
1781
|
};
|
|
1782
|
-
|
|
1782
|
+
F.create = (e, t) => new F({
|
|
1783
1783
|
shape: () => e,
|
|
1784
1784
|
unknownKeys: "strip",
|
|
1785
|
-
catchall:
|
|
1785
|
+
catchall: P.create(),
|
|
1786
1786
|
typeName: z.ZodObject,
|
|
1787
1787
|
...j(t)
|
|
1788
|
-
}),
|
|
1788
|
+
}), F.strictCreate = (e, t) => new F({
|
|
1789
1789
|
shape: () => e,
|
|
1790
1790
|
unknownKeys: "strict",
|
|
1791
|
-
catchall:
|
|
1791
|
+
catchall: P.create(),
|
|
1792
1792
|
typeName: z.ZodObject,
|
|
1793
1793
|
...j(t)
|
|
1794
|
-
}),
|
|
1794
|
+
}), F.lazycreate = (e, t) => new F({
|
|
1795
1795
|
shape: e,
|
|
1796
1796
|
unknownKeys: "strip",
|
|
1797
|
-
catchall:
|
|
1797
|
+
catchall: P.create(),
|
|
1798
1798
|
typeName: z.ZodObject,
|
|
1799
1799
|
...j(t)
|
|
1800
1800
|
});
|
|
1801
|
-
var
|
|
1801
|
+
var Re = class extends M {
|
|
1802
1802
|
_parse(e) {
|
|
1803
1803
|
let { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
1804
1804
|
function r(e) {
|
|
@@ -1861,12 +1861,12 @@ var ze = class extends M {
|
|
|
1861
1861
|
return this._def.options;
|
|
1862
1862
|
}
|
|
1863
1863
|
};
|
|
1864
|
-
|
|
1864
|
+
Re.create = (e, t) => new Re({
|
|
1865
1865
|
options: e,
|
|
1866
1866
|
typeName: z.ZodUnion,
|
|
1867
1867
|
...j(t)
|
|
1868
1868
|
});
|
|
1869
|
-
var
|
|
1869
|
+
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
1870
|
_parse(e) {
|
|
1871
1871
|
let { ctx: t } = this._processInputParams(e);
|
|
1872
1872
|
if (t.parsedType !== f.object) return b(t, {
|
|
@@ -1901,7 +1901,7 @@ var F = (e) => e instanceof qe ? F(e.schema) : e instanceof L ? F(e.innerType())
|
|
|
1901
1901
|
static create(t, n, r) {
|
|
1902
1902
|
let i = /* @__PURE__ */ new Map();
|
|
1903
1903
|
for (let e of n) {
|
|
1904
|
-
let n =
|
|
1904
|
+
let n = I(e.shape[t]);
|
|
1905
1905
|
if (!n.length) throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
|
|
1906
1906
|
for (let r of n) {
|
|
1907
1907
|
if (i.has(r)) throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);
|
|
@@ -1917,7 +1917,7 @@ var F = (e) => e instanceof qe ? F(e.schema) : e instanceof L ? F(e.innerType())
|
|
|
1917
1917
|
});
|
|
1918
1918
|
}
|
|
1919
1919
|
};
|
|
1920
|
-
function
|
|
1920
|
+
function Be(e, t) {
|
|
1921
1921
|
let n = p(e), r = p(t);
|
|
1922
1922
|
if (e === t) return {
|
|
1923
1923
|
valid: !0,
|
|
@@ -1929,7 +1929,7 @@ function Ve(e, t) {
|
|
|
1929
1929
|
...t
|
|
1930
1930
|
};
|
|
1931
1931
|
for (let n of r) {
|
|
1932
|
-
let r =
|
|
1932
|
+
let r = Be(e[n], t[n]);
|
|
1933
1933
|
if (!r.valid) return { valid: !1 };
|
|
1934
1934
|
i[n] = r.data;
|
|
1935
1935
|
}
|
|
@@ -1941,7 +1941,7 @@ function Ve(e, t) {
|
|
|
1941
1941
|
if (e.length !== t.length) return { valid: !1 };
|
|
1942
1942
|
let n = [];
|
|
1943
1943
|
for (let r = 0; r < e.length; r++) {
|
|
1944
|
-
let i = e[r], a = t[r], o =
|
|
1944
|
+
let i = e[r], a = t[r], o = Be(i, a);
|
|
1945
1945
|
if (!o.valid) return { valid: !1 };
|
|
1946
1946
|
n.push(o.data);
|
|
1947
1947
|
}
|
|
@@ -1955,11 +1955,11 @@ function Ve(e, t) {
|
|
|
1955
1955
|
};
|
|
1956
1956
|
else return { valid: !1 };
|
|
1957
1957
|
}
|
|
1958
|
-
var
|
|
1958
|
+
var Ve = class extends M {
|
|
1959
1959
|
_parse(e) {
|
|
1960
1960
|
let { status: t, ctx: n } = this._processInputParams(e), r = (e, r) => {
|
|
1961
1961
|
if (T(e) || T(r)) return S;
|
|
1962
|
-
let i =
|
|
1962
|
+
let i = Be(e.value, r.value);
|
|
1963
1963
|
return i.valid ? ((E(e) || E(r)) && t.dirty(), {
|
|
1964
1964
|
status: t.value,
|
|
1965
1965
|
value: i.data
|
|
@@ -1984,13 +1984,13 @@ var He = class extends M {
|
|
|
1984
1984
|
}));
|
|
1985
1985
|
}
|
|
1986
1986
|
};
|
|
1987
|
-
|
|
1987
|
+
Ve.create = (e, t, n) => new Ve({
|
|
1988
1988
|
left: e,
|
|
1989
1989
|
right: t,
|
|
1990
1990
|
typeName: z.ZodIntersection,
|
|
1991
1991
|
...j(n)
|
|
1992
1992
|
});
|
|
1993
|
-
var
|
|
1993
|
+
var He = class e extends M {
|
|
1994
1994
|
_parse(e) {
|
|
1995
1995
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
1996
1996
|
if (n.parsedType !== f.array) return b(n, {
|
|
@@ -2028,9 +2028,9 @@ var I = class e extends M {
|
|
|
2028
2028
|
});
|
|
2029
2029
|
}
|
|
2030
2030
|
};
|
|
2031
|
-
|
|
2031
|
+
He.create = (e, t) => {
|
|
2032
2032
|
if (!Array.isArray(e)) throw Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2033
|
-
return new
|
|
2033
|
+
return new He({
|
|
2034
2034
|
items: e,
|
|
2035
2035
|
typeName: z.ZodTuple,
|
|
2036
2036
|
rest: null,
|
|
@@ -2069,7 +2069,7 @@ var Ue = class e extends M {
|
|
|
2069
2069
|
typeName: z.ZodRecord,
|
|
2070
2070
|
...j(r)
|
|
2071
2071
|
}) : new e({
|
|
2072
|
-
keyType:
|
|
2072
|
+
keyType: we.create(),
|
|
2073
2073
|
valueType: t,
|
|
2074
2074
|
typeName: z.ZodRecord,
|
|
2075
2075
|
...j(n)
|
|
@@ -2271,7 +2271,7 @@ var Ke = class e extends M {
|
|
|
2271
2271
|
args(...t) {
|
|
2272
2272
|
return new e({
|
|
2273
2273
|
...this._def,
|
|
2274
|
-
args:
|
|
2274
|
+
args: He.create(t).rest(Pe.create())
|
|
2275
2275
|
});
|
|
2276
2276
|
}
|
|
2277
2277
|
returns(t) {
|
|
@@ -2288,8 +2288,8 @@ var Ke = class e extends M {
|
|
|
2288
2288
|
}
|
|
2289
2289
|
static create(t, n, r) {
|
|
2290
2290
|
return new e({
|
|
2291
|
-
args: t ||
|
|
2292
|
-
returns: n ||
|
|
2291
|
+
args: t || He.create([]).rest(Pe.create()),
|
|
2292
|
+
returns: n || Pe.create(),
|
|
2293
2293
|
typeName: z.ZodFunction,
|
|
2294
2294
|
...j(r)
|
|
2295
2295
|
});
|
|
@@ -2716,19 +2716,19 @@ at.create = (e, t) => new at({
|
|
|
2716
2716
|
innerType: e,
|
|
2717
2717
|
typeName: z.ZodReadonly,
|
|
2718
2718
|
...j(t)
|
|
2719
|
-
}),
|
|
2719
|
+
}), F.lazycreate;
|
|
2720
2720
|
var z;
|
|
2721
2721
|
(function(e) {
|
|
2722
2722
|
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
2723
|
})(z ||= {});
|
|
2724
|
-
var B =
|
|
2725
|
-
|
|
2726
|
-
var ot =
|
|
2727
|
-
Ae.create, je.create, Me.create, Ne.create
|
|
2728
|
-
var st =
|
|
2729
|
-
|
|
2730
|
-
var ct =
|
|
2731
|
-
|
|
2724
|
+
var B = we.create;
|
|
2725
|
+
Ee.create, nt.create, De.create;
|
|
2726
|
+
var ot = Oe.create;
|
|
2727
|
+
ke.create, Ae.create, je.create, Me.create, Ne.create;
|
|
2728
|
+
var st = Pe.create;
|
|
2729
|
+
P.create, Fe.create, Ie.create;
|
|
2730
|
+
var ct = F.create;
|
|
2731
|
+
F.strictCreate, Re.create, ze.create, Ve.create, He.create;
|
|
2732
2732
|
var lt = Ue.create;
|
|
2733
2733
|
We.create, Ge.create, Ke.create, qe.create, Je.create;
|
|
2734
2734
|
var ut = Xe.create;
|
|
@@ -2818,6 +2818,11 @@ function gt(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;
|
|
@@ -2825,6 +2830,10 @@ function gt(e, t) {
|
|
|
2825
2830
|
attachmentMaxFileSizeMb: (() => {
|
|
2826
2831
|
let e = i?.attachmentMaxFileSizeMb;
|
|
2827
2832
|
return typeof e == "number" && Number.isFinite(e) ? e : 1;
|
|
2833
|
+
})(),
|
|
2834
|
+
turnstileSiteKey: (() => {
|
|
2835
|
+
let e = i?.turnstileSiteKey;
|
|
2836
|
+
return typeof e == "string" && e.length > 0 ? e : void 0;
|
|
2828
2837
|
})()
|
|
2829
2838
|
};
|
|
2830
2839
|
}
|
|
@@ -3060,70 +3069,70 @@ function Nt(e) {
|
|
|
3060
3069
|
}
|
|
3061
3070
|
return t;
|
|
3062
3071
|
}
|
|
3063
|
-
function
|
|
3072
|
+
function Pt(e, t) {
|
|
3064
3073
|
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;
|
|
3065
3074
|
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;
|
|
3066
3075
|
}
|
|
3067
|
-
function
|
|
3076
|
+
function K(e, t) {
|
|
3068
3077
|
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
3078
|
p += a * l, f += p >>> 16, p &= 65535, f += i * l, d += f >>> 16, f &= 65535, f += a * c, d += f >>> 16, f &= 65535, d += r * l, u += d >>> 16, d &= 65535, d += i * c, u += d >>> 16, d &= 65535, d += a * s, u += d >>> 16, d &= 65535, u += n * l + r * c + i * s + a * o, u &= 65535, e[0] = u << 16 | d, e[1] = f << 16 | p;
|
|
3070
3079
|
}
|
|
3071
|
-
function
|
|
3080
|
+
function Ft(e, t) {
|
|
3072
3081
|
var n = e[0];
|
|
3073
3082
|
t %= 64, t === 32 ? (e[0] = e[1], e[1] = n) : t < 32 ? (e[0] = n << t | e[1] >>> 32 - t, e[1] = e[1] << t | n >>> 32 - t) : (t -= 32, e[0] = e[1] << t | n >>> 32 - t, e[1] = n << t | e[1] >>> 32 - t);
|
|
3074
3083
|
}
|
|
3075
|
-
function
|
|
3084
|
+
function q(e, t) {
|
|
3076
3085
|
t %= 64, t !== 0 && (t < 32 ? (e[0] = e[1] >>> 32 - t, e[1] <<= t) : (e[0] = e[1] << t - 32, e[1] = 0));
|
|
3077
3086
|
}
|
|
3078
|
-
function
|
|
3087
|
+
function J(e, t) {
|
|
3079
3088
|
e[0] ^= t[0], e[1] ^= t[1];
|
|
3080
3089
|
}
|
|
3081
|
-
var
|
|
3082
|
-
function
|
|
3090
|
+
var It = [4283543511, 3981806797], Lt = [3301882366, 444984403];
|
|
3091
|
+
function Rt(e) {
|
|
3083
3092
|
var t = [0, e[0] >>> 1];
|
|
3084
|
-
|
|
3093
|
+
J(e, t), K(e, It), t[1] = e[0] >>> 1, J(e, t), K(e, Lt), t[1] = e[0] >>> 1, J(e, t);
|
|
3085
3094
|
}
|
|
3086
|
-
var
|
|
3087
|
-
function
|
|
3095
|
+
var zt = [2277735313, 289559509], Bt = [1291169091, 658871167], Vt = [0, 5], Ht = [0, 1390208809], Ut = [0, 944331445];
|
|
3096
|
+
function Wt(e, t) {
|
|
3088
3097
|
var n = Nt(e);
|
|
3089
3098
|
t ||= 0;
|
|
3090
3099
|
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;
|
|
3091
|
-
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,
|
|
3100
|
+
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), 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);
|
|
3092
3101
|
c[0] = 0, c[1] = 0, l[0] = 0, l[1] = 0;
|
|
3093
3102
|
var d = [0, 0];
|
|
3094
3103
|
switch (i) {
|
|
3095
|
-
case 15: d[1] = n[u + 14],
|
|
3096
|
-
case 14: d[1] = n[u + 13],
|
|
3097
|
-
case 13: d[1] = n[u + 12],
|
|
3098
|
-
case 12: d[1] = n[u + 11],
|
|
3099
|
-
case 11: d[1] = n[u + 10],
|
|
3100
|
-
case 10: d[1] = n[u + 9],
|
|
3101
|
-
case 9: d[1] = n[u + 8],
|
|
3102
|
-
case 8: d[1] = n[u + 7],
|
|
3103
|
-
case 7: d[1] = n[u + 6],
|
|
3104
|
-
case 6: d[1] = n[u + 5],
|
|
3105
|
-
case 5: d[1] = n[u + 4],
|
|
3106
|
-
case 4: d[1] = n[u + 3],
|
|
3107
|
-
case 3: d[1] = n[u + 2],
|
|
3108
|
-
case 2: d[1] = n[u + 1],
|
|
3109
|
-
case 1: d[1] = n[u],
|
|
3110
|
-
}
|
|
3111
|
-
return
|
|
3112
|
-
}
|
|
3113
|
-
function
|
|
3104
|
+
case 15: d[1] = n[u + 14], q(d, 48), J(l, d);
|
|
3105
|
+
case 14: d[1] = n[u + 13], q(d, 40), J(l, d);
|
|
3106
|
+
case 13: d[1] = n[u + 12], q(d, 32), J(l, d);
|
|
3107
|
+
case 12: d[1] = n[u + 11], q(d, 24), J(l, d);
|
|
3108
|
+
case 11: d[1] = n[u + 10], q(d, 16), J(l, d);
|
|
3109
|
+
case 10: d[1] = n[u + 9], q(d, 8), J(l, d);
|
|
3110
|
+
case 9: d[1] = n[u + 8], J(l, d), K(l, Bt), Ft(l, 33), K(l, zt), J(s, l);
|
|
3111
|
+
case 8: d[1] = n[u + 7], q(d, 56), J(c, d);
|
|
3112
|
+
case 7: d[1] = n[u + 6], q(d, 48), J(c, d);
|
|
3113
|
+
case 6: d[1] = n[u + 5], q(d, 40), J(c, d);
|
|
3114
|
+
case 5: d[1] = n[u + 4], q(d, 32), J(c, d);
|
|
3115
|
+
case 4: d[1] = n[u + 3], q(d, 24), J(c, d);
|
|
3116
|
+
case 3: d[1] = n[u + 2], q(d, 16), J(c, d);
|
|
3117
|
+
case 2: d[1] = n[u + 1], q(d, 8), J(c, d);
|
|
3118
|
+
case 1: d[1] = n[u], J(c, d), K(c, zt), Ft(c, 31), K(c, Bt), J(o, c);
|
|
3119
|
+
}
|
|
3120
|
+
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);
|
|
3121
|
+
}
|
|
3122
|
+
function Gt(e) {
|
|
3114
3123
|
return vt({
|
|
3115
3124
|
name: e.name,
|
|
3116
3125
|
message: e.message,
|
|
3117
3126
|
stack: e.stack?.split("\n")
|
|
3118
3127
|
}, e);
|
|
3119
3128
|
}
|
|
3120
|
-
function
|
|
3129
|
+
function Kt(e) {
|
|
3121
3130
|
return /^function\s.*?\{\s*\[native code]\s*}$/.test(String(e));
|
|
3122
3131
|
}
|
|
3123
|
-
function
|
|
3132
|
+
function qt(e) {
|
|
3124
3133
|
return typeof e != "function";
|
|
3125
3134
|
}
|
|
3126
|
-
function
|
|
3135
|
+
function Jt(e, t) {
|
|
3127
3136
|
var n = Dt(new Promise(function(n) {
|
|
3128
3137
|
var r = Date.now();
|
|
3129
3138
|
Tt(e.bind(null, t), function() {
|
|
@@ -3135,7 +3144,7 @@ function qt(e, t) {
|
|
|
3135
3144
|
};
|
|
3136
3145
|
});
|
|
3137
3146
|
var i = e[1];
|
|
3138
|
-
if (
|
|
3147
|
+
if (qt(i)) return n(function() {
|
|
3139
3148
|
return {
|
|
3140
3149
|
value: i,
|
|
3141
3150
|
duration: t
|
|
@@ -3165,11 +3174,11 @@ function qt(e, t) {
|
|
|
3165
3174
|
});
|
|
3166
3175
|
};
|
|
3167
3176
|
}
|
|
3168
|
-
function
|
|
3177
|
+
function Yt(e, t, n, r) {
|
|
3169
3178
|
var i = Object.keys(e).filter(function(e) {
|
|
3170
3179
|
return kt(n, e);
|
|
3171
3180
|
}), a = Dt(Et(i, function(n) {
|
|
3172
|
-
return
|
|
3181
|
+
return Jt(e[n], t);
|
|
3173
3182
|
}, r));
|
|
3174
3183
|
return function() {
|
|
3175
3184
|
return V(this, void 0, void 0, function() {
|
|
@@ -3189,7 +3198,7 @@ function Jt(e, t, n, r) {
|
|
|
3189
3198
|
});
|
|
3190
3199
|
};
|
|
3191
3200
|
}
|
|
3192
|
-
function
|
|
3201
|
+
function Xt() {
|
|
3193
3202
|
var e = window, t = navigator;
|
|
3194
3203
|
return G([
|
|
3195
3204
|
"MSCSSMatrix" in e,
|
|
@@ -3199,16 +3208,16 @@ function Yt() {
|
|
|
3199
3208
|
"msPointerEnabled" in t
|
|
3200
3209
|
]) >= 4;
|
|
3201
3210
|
}
|
|
3202
|
-
function
|
|
3211
|
+
function Zt() {
|
|
3203
3212
|
var e = window, t = navigator;
|
|
3204
3213
|
return G([
|
|
3205
3214
|
"msWriteProfilerMark" in e,
|
|
3206
3215
|
"MSStream" in e,
|
|
3207
3216
|
"msLaunchUri" in t,
|
|
3208
3217
|
"msSaveBlob" in t
|
|
3209
|
-
]) >= 3 && !
|
|
3218
|
+
]) >= 3 && !Xt();
|
|
3210
3219
|
}
|
|
3211
|
-
function
|
|
3220
|
+
function Qt() {
|
|
3212
3221
|
var e = window, t = navigator;
|
|
3213
3222
|
return G([
|
|
3214
3223
|
"webkitPersistentStorage" in t,
|
|
@@ -3220,7 +3229,7 @@ function Zt() {
|
|
|
3220
3229
|
"webkitSpeechGrammar" in e
|
|
3221
3230
|
]) >= 5;
|
|
3222
3231
|
}
|
|
3223
|
-
function
|
|
3232
|
+
function Y() {
|
|
3224
3233
|
var e = window, t = navigator;
|
|
3225
3234
|
return G([
|
|
3226
3235
|
"ApplePayError" in e,
|
|
@@ -3231,7 +3240,7 @@ function X() {
|
|
|
3231
3240
|
"WebKitMediaKeys" in e
|
|
3232
3241
|
]) >= 4;
|
|
3233
3242
|
}
|
|
3234
|
-
function
|
|
3243
|
+
function $t() {
|
|
3235
3244
|
var e = window, t = e.HTMLElement, n = e.Document;
|
|
3236
3245
|
return G([
|
|
3237
3246
|
"safari" in e,
|
|
@@ -3242,11 +3251,11 @@ function Qt() {
|
|
|
3242
3251
|
n && "pointerLockElement" in n.prototype
|
|
3243
3252
|
]) >= 4;
|
|
3244
3253
|
}
|
|
3245
|
-
function
|
|
3254
|
+
function en() {
|
|
3246
3255
|
var e = window;
|
|
3247
|
-
return
|
|
3256
|
+
return Kt(e.print) && String(e.browser) === "[object WebPageNamespace]";
|
|
3248
3257
|
}
|
|
3249
|
-
function
|
|
3258
|
+
function tn() {
|
|
3250
3259
|
var e = window;
|
|
3251
3260
|
return G([
|
|
3252
3261
|
"buildID" in navigator,
|
|
@@ -3257,7 +3266,7 @@ function en() {
|
|
|
3257
3266
|
"CanvasCaptureMediaStream" in e
|
|
3258
3267
|
]) >= 4;
|
|
3259
3268
|
}
|
|
3260
|
-
function
|
|
3269
|
+
function nn() {
|
|
3261
3270
|
var e = window;
|
|
3262
3271
|
return G([
|
|
3263
3272
|
!("MediaSettingsRange" in e),
|
|
@@ -3266,7 +3275,7 @@ function tn() {
|
|
|
3266
3275
|
"" + e.Reflect == "[object Reflect]"
|
|
3267
3276
|
]) >= 3;
|
|
3268
3277
|
}
|
|
3269
|
-
function
|
|
3278
|
+
function rn() {
|
|
3270
3279
|
var e = window, t = e.URLPattern;
|
|
3271
3280
|
return G([
|
|
3272
3281
|
"union" in Set.prototype,
|
|
@@ -3275,7 +3284,7 @@ function nn() {
|
|
|
3275
3284
|
"RGB8" in WebGLRenderingContext.prototype
|
|
3276
3285
|
]) >= 3;
|
|
3277
3286
|
}
|
|
3278
|
-
function
|
|
3287
|
+
function an() {
|
|
3279
3288
|
var e = window;
|
|
3280
3289
|
return G([
|
|
3281
3290
|
"DOMRectList" in e,
|
|
@@ -3284,7 +3293,7 @@ function rn() {
|
|
|
3284
3293
|
"ontransitioncancel" in e
|
|
3285
3294
|
]) >= 3;
|
|
3286
3295
|
}
|
|
3287
|
-
function
|
|
3296
|
+
function on() {
|
|
3288
3297
|
var e = window, t = navigator, n = e.CSS, r = e.HTMLButtonElement;
|
|
3289
3298
|
return G([
|
|
3290
3299
|
!("getStorageUpdates" in t),
|
|
@@ -3294,7 +3303,7 @@ function an() {
|
|
|
3294
3303
|
n.supports("text-transform: full-width")
|
|
3295
3304
|
]) >= 4;
|
|
3296
3305
|
}
|
|
3297
|
-
function
|
|
3306
|
+
function sn() {
|
|
3298
3307
|
if (navigator.platform === "iPad") return !0;
|
|
3299
3308
|
var e = screen, t = e.width / e.height;
|
|
3300
3309
|
return G([
|
|
@@ -3303,16 +3312,16 @@ function on() {
|
|
|
3303
3312
|
t > .65 && t < 1.53
|
|
3304
3313
|
]) >= 2;
|
|
3305
3314
|
}
|
|
3306
|
-
function
|
|
3315
|
+
function cn() {
|
|
3307
3316
|
var e = document;
|
|
3308
3317
|
return e.fullscreenElement || e.msFullscreenElement || e.mozFullScreenElement || e.webkitFullscreenElement || null;
|
|
3309
3318
|
}
|
|
3310
|
-
function
|
|
3319
|
+
function ln() {
|
|
3311
3320
|
var e = document;
|
|
3312
3321
|
return (e.exitFullscreen || e.msExitFullscreen || e.mozCancelFullScreen || e.webkitExitFullscreen).call(e);
|
|
3313
3322
|
}
|
|
3314
|
-
function
|
|
3315
|
-
var e =
|
|
3323
|
+
function un() {
|
|
3324
|
+
var e = Qt(), t = tn(), n = window, r = navigator, i = "connection";
|
|
3316
3325
|
return e ? G([
|
|
3317
3326
|
!("SharedWorker" in n),
|
|
3318
3327
|
r[i] && "ontypechange" in r[i],
|
|
@@ -3323,7 +3332,7 @@ function ln() {
|
|
|
3323
3332
|
/android/i.test(r.appVersion)
|
|
3324
3333
|
]) >= 2 : !1;
|
|
3325
3334
|
}
|
|
3326
|
-
function
|
|
3335
|
+
function dn() {
|
|
3327
3336
|
var e = navigator, t = window, n = Audio.prototype, r = t.visualViewport;
|
|
3328
3337
|
return G([
|
|
3329
3338
|
"srLatency" in n,
|
|
@@ -3333,19 +3342,19 @@ function un() {
|
|
|
3333
3342
|
"getTextInformation" in Image.prototype
|
|
3334
3343
|
]) >= 3;
|
|
3335
3344
|
}
|
|
3336
|
-
function dn() {
|
|
3337
|
-
return mn() ? -4 : fn();
|
|
3338
|
-
}
|
|
3339
3345
|
function fn() {
|
|
3346
|
+
return hn() ? -4 : pn();
|
|
3347
|
+
}
|
|
3348
|
+
function pn() {
|
|
3340
3349
|
var e = window, t = e.OfflineAudioContext || e.webkitOfflineAudioContext;
|
|
3341
3350
|
if (!t) return -2;
|
|
3342
|
-
if (
|
|
3351
|
+
if (mn()) return -1;
|
|
3343
3352
|
var n = 4500, r = new t(1, 5e3, 44100), i = r.createOscillator();
|
|
3344
3353
|
i.type = "triangle", i.frequency.value = 1e4;
|
|
3345
3354
|
var a = r.createDynamicsCompressor();
|
|
3346
3355
|
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);
|
|
3347
|
-
var o =
|
|
3348
|
-
return
|
|
3356
|
+
var o = gn(r), s = o[0], c = o[1], l = Dt(s.then(function(e) {
|
|
3357
|
+
return _n(e.getChannelData(0).subarray(n));
|
|
3349
3358
|
}, function(e) {
|
|
3350
3359
|
if (e.name === "timeout" || e.name === "suspended") return -3;
|
|
3351
3360
|
throw e;
|
|
@@ -3354,13 +3363,13 @@ function fn() {
|
|
|
3354
3363
|
return c(), l;
|
|
3355
3364
|
};
|
|
3356
3365
|
}
|
|
3357
|
-
function pn() {
|
|
3358
|
-
return X() && !Qt() && !rn();
|
|
3359
|
-
}
|
|
3360
3366
|
function mn() {
|
|
3361
|
-
return
|
|
3367
|
+
return Y() && !$t() && !an();
|
|
3368
|
+
}
|
|
3369
|
+
function hn() {
|
|
3370
|
+
return Y() && on() && en() || Qt() && dn() && rn();
|
|
3362
3371
|
}
|
|
3363
|
-
function
|
|
3372
|
+
function gn(e) {
|
|
3364
3373
|
var t = 3, n = 500, r = 500, i = 5e3, a = function() {};
|
|
3365
3374
|
return [new Promise(function(o, s) {
|
|
3366
3375
|
var c = !1, l = 0, u = 0;
|
|
@@ -3369,7 +3378,7 @@ function hn(e) {
|
|
|
3369
3378
|
};
|
|
3370
3379
|
var d = function() {
|
|
3371
3380
|
setTimeout(function() {
|
|
3372
|
-
return s(
|
|
3381
|
+
return s(vn("timeout"));
|
|
3373
3382
|
}, Math.min(r, u + i - Date.now()));
|
|
3374
3383
|
}, f = function() {
|
|
3375
3384
|
try {
|
|
@@ -3379,7 +3388,7 @@ function hn(e) {
|
|
|
3379
3388
|
u = Date.now(), c && d();
|
|
3380
3389
|
break;
|
|
3381
3390
|
case "suspended":
|
|
3382
|
-
document.hidden || l++, c && l >= t ? s(
|
|
3391
|
+
document.hidden || l++, c && l >= t ? s(vn("suspended")) : setTimeout(f, n);
|
|
3383
3392
|
break;
|
|
3384
3393
|
}
|
|
3385
3394
|
} catch (e) {
|
|
@@ -3391,15 +3400,15 @@ function hn(e) {
|
|
|
3391
3400
|
};
|
|
3392
3401
|
}), a];
|
|
3393
3402
|
}
|
|
3394
|
-
function
|
|
3403
|
+
function _n(e) {
|
|
3395
3404
|
for (var t = 0, n = 0; n < e.length; ++n) t += Math.abs(e[n]);
|
|
3396
3405
|
return t;
|
|
3397
3406
|
}
|
|
3398
|
-
function
|
|
3407
|
+
function vn(e) {
|
|
3399
3408
|
var t = Error(e);
|
|
3400
3409
|
return t.name = e, t;
|
|
3401
3410
|
}
|
|
3402
|
-
function
|
|
3411
|
+
function yn(e, t, n) {
|
|
3403
3412
|
var r;
|
|
3404
3413
|
return n === void 0 && (n = 50), V(this, void 0, void 0, function() {
|
|
3405
3414
|
var i, a;
|
|
@@ -3439,14 +3448,14 @@ function vn(e, t, n) {
|
|
|
3439
3448
|
});
|
|
3440
3449
|
});
|
|
3441
3450
|
}
|
|
3442
|
-
function
|
|
3451
|
+
function bn(e) {
|
|
3443
3452
|
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++) {
|
|
3444
3453
|
var s = o[a], c = r[s].join(" ");
|
|
3445
|
-
s === "style" ?
|
|
3454
|
+
s === "style" ? xn(i.style, c) : i.setAttribute(s, c);
|
|
3446
3455
|
}
|
|
3447
3456
|
return i;
|
|
3448
3457
|
}
|
|
3449
|
-
function
|
|
3458
|
+
function xn(e, t) {
|
|
3450
3459
|
for (var n = 0, r = t.split(";"); n < r.length; n++) {
|
|
3451
3460
|
var i = r[n], a = /^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(i);
|
|
3452
3461
|
if (a) {
|
|
@@ -3455,7 +3464,7 @@ function bn(e, t) {
|
|
|
3455
3464
|
}
|
|
3456
3465
|
}
|
|
3457
3466
|
}
|
|
3458
|
-
function
|
|
3467
|
+
function Sn() {
|
|
3459
3468
|
for (var e = window;;) {
|
|
3460
3469
|
var t = e.parent;
|
|
3461
3470
|
if (!t || t === e) return !1;
|
|
@@ -3468,48 +3477,48 @@ function xn() {
|
|
|
3468
3477
|
e = t;
|
|
3469
3478
|
}
|
|
3470
3479
|
}
|
|
3471
|
-
var
|
|
3480
|
+
var Cn = "mmMwWLliI0O&1", wn = "48px", Tn = [
|
|
3472
3481
|
"monospace",
|
|
3473
3482
|
"sans-serif",
|
|
3474
3483
|
"serif"
|
|
3475
|
-
],
|
|
3476
|
-
function
|
|
3484
|
+
], En = /* @__PURE__ */ "sans-serif-thin.ARNO PRO.Agency FB.Arabic Typesetting.Arial Unicode MS.AvantGarde Bk BT.BankGothic Md BT.Batang.Bitstream Vera Sans Mono.Calibri.Century.Century Gothic.Clarendon.EUROSTILE.Franklin Gothic.Futura Bk BT.Futura Md BT.GOTHAM.Gill Sans.HELV.Haettenschweiler.Helvetica Neue.Humanst521 BT.Leelawadee.Letter Gothic.Levenim MT.Lucida Bright.Lucida Sans.Menlo.MS Mincho.MS Outlook.MS Reference Specialty.MS UI Gothic.MT Extra.MYRIAD PRO.Marlett.Meiryo UI.Microsoft Uighur.Minion Pro.Monotype Corsiva.PMingLiU.Pristina.SCRIPTINA.Segoe UI Light.Serifa.SimHei.Small Fonts.Staccato222 BT.TRAJAN PRO.Univers CE 55 Medium.Vrinda.ZWAdobeF".split(".");
|
|
3485
|
+
function Dn() {
|
|
3477
3486
|
var e = this;
|
|
3478
|
-
return
|
|
3487
|
+
return yn(function(t, n) {
|
|
3479
3488
|
var r = n.document;
|
|
3480
3489
|
return V(e, void 0, void 0, function() {
|
|
3481
3490
|
var e, t, n, i, a, o, s, c, l, u, d, f;
|
|
3482
3491
|
return H(this, function(p) {
|
|
3483
|
-
for (e = r.body, e.style.fontSize =
|
|
3492
|
+
for (e = r.body, e.style.fontSize = wn, t = r.createElement("div"), t.style.setProperty("visibility", "hidden", "important"), n = {}, i = {}, a = function(e) {
|
|
3484
3493
|
var n = r.createElement("span"), i = n.style;
|
|
3485
|
-
return i.position = "absolute", i.top = "0", i.left = "0", i.fontFamily = e, n.textContent =
|
|
3494
|
+
return i.position = "absolute", i.top = "0", i.left = "0", i.fontFamily = e, n.textContent = Cn, t.appendChild(n), n;
|
|
3486
3495
|
}, o = function(e, t) {
|
|
3487
3496
|
return a(`'${e}',${t}`);
|
|
3488
3497
|
}, s = function() {
|
|
3489
|
-
return
|
|
3498
|
+
return Tn.map(a);
|
|
3490
3499
|
}, c = function() {
|
|
3491
3500
|
for (var e = {}, t = function(t) {
|
|
3492
|
-
e[t] =
|
|
3501
|
+
e[t] = Tn.map(function(e) {
|
|
3493
3502
|
return o(t, e);
|
|
3494
3503
|
});
|
|
3495
|
-
}, n = 0, r =
|
|
3504
|
+
}, n = 0, r = En; n < r.length; n++) {
|
|
3496
3505
|
var i = r[n];
|
|
3497
3506
|
t(i);
|
|
3498
3507
|
}
|
|
3499
3508
|
return e;
|
|
3500
3509
|
}, l = function(e) {
|
|
3501
|
-
return
|
|
3510
|
+
return Tn.some(function(t, r) {
|
|
3502
3511
|
return e[r].offsetWidth !== n[t] || e[r].offsetHeight !== i[t];
|
|
3503
3512
|
});
|
|
3504
|
-
}, u = s(), d = c(), e.appendChild(t), f = 0; f <
|
|
3505
|
-
return [2,
|
|
3513
|
+
}, u = s(), d = c(), e.appendChild(t), f = 0; f < Tn.length; f++) n[Tn[f]] = u[f].offsetWidth, i[Tn[f]] = u[f].offsetHeight;
|
|
3514
|
+
return [2, En.filter(function(e) {
|
|
3506
3515
|
return l(d[e]);
|
|
3507
3516
|
})];
|
|
3508
3517
|
});
|
|
3509
3518
|
});
|
|
3510
3519
|
});
|
|
3511
3520
|
}
|
|
3512
|
-
function
|
|
3521
|
+
function On() {
|
|
3513
3522
|
var e = navigator.plugins;
|
|
3514
3523
|
if (e) {
|
|
3515
3524
|
for (var t = [], n = 0; n < e.length; ++n) {
|
|
@@ -3532,38 +3541,38 @@ function Dn() {
|
|
|
3532
3541
|
return t;
|
|
3533
3542
|
}
|
|
3534
3543
|
}
|
|
3535
|
-
function
|
|
3536
|
-
return
|
|
3544
|
+
function kn() {
|
|
3545
|
+
return An(Rn());
|
|
3537
3546
|
}
|
|
3538
|
-
function
|
|
3539
|
-
var t, n = !1, r, i, a =
|
|
3540
|
-
return
|
|
3547
|
+
function An(e) {
|
|
3548
|
+
var t, n = !1, r, i, a = jn(), o = a[0], s = a[1];
|
|
3549
|
+
return Mn(o, s) ? (n = Nn(s), e ? r = i = "skipped" : (t = Pn(o, s), r = t[0], i = t[1])) : r = i = "unsupported", {
|
|
3541
3550
|
winding: n,
|
|
3542
3551
|
geometry: r,
|
|
3543
3552
|
text: i
|
|
3544
3553
|
};
|
|
3545
3554
|
}
|
|
3546
|
-
function
|
|
3555
|
+
function jn() {
|
|
3547
3556
|
var e = document.createElement("canvas");
|
|
3548
3557
|
return e.width = 1, e.height = 1, [e, e.getContext("2d")];
|
|
3549
3558
|
}
|
|
3550
|
-
function
|
|
3559
|
+
function Mn(e, t) {
|
|
3551
3560
|
return !!(t && e.toDataURL);
|
|
3552
3561
|
}
|
|
3553
|
-
function
|
|
3562
|
+
function Nn(e) {
|
|
3554
3563
|
return e.rect(0, 0, 10, 10), e.rect(2, 2, 6, 6), !e.isPointInPath(5, 5, "evenodd");
|
|
3555
3564
|
}
|
|
3556
|
-
function Nn(e, t) {
|
|
3557
|
-
Pn(e, t);
|
|
3558
|
-
var n = In(e);
|
|
3559
|
-
return n === In(e) ? (Fn(e, t), [In(e), n]) : ["unstable", "unstable"];
|
|
3560
|
-
}
|
|
3561
3565
|
function Pn(e, t) {
|
|
3566
|
+
Fn(e, t);
|
|
3567
|
+
var n = Ln(e);
|
|
3568
|
+
return n === Ln(e) ? (In(e, t), [Ln(e), n]) : ["unstable", "unstable"];
|
|
3569
|
+
}
|
|
3570
|
+
function Fn(e, t) {
|
|
3562
3571
|
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\"";
|
|
3563
3572
|
var n = `Cwm fjordbank gly ${String.fromCharCode(55357, 56835)}`;
|
|
3564
3573
|
t.fillText(n, 2, 15), t.fillStyle = "rgba(102, 204, 0, 0.2)", t.font = "18pt Arial", t.fillText(n, 4, 45);
|
|
3565
3574
|
}
|
|
3566
|
-
function
|
|
3575
|
+
function In(e, t) {
|
|
3567
3576
|
e.width = 122, e.height = 110, t.globalCompositeOperation = "multiply";
|
|
3568
3577
|
for (var n = 0, r = [
|
|
3569
3578
|
[
|
|
@@ -3587,13 +3596,13 @@ function Fn(e, t) {
|
|
|
3587
3596
|
}
|
|
3588
3597
|
t.fillStyle = "#f9c", t.arc(60, 60, 60, 0, Math.PI * 2, !0), t.arc(60, 60, 20, 0, Math.PI * 2, !0), t.fill("evenodd");
|
|
3589
3598
|
}
|
|
3590
|
-
function
|
|
3599
|
+
function Ln(e) {
|
|
3591
3600
|
return e.toDataURL();
|
|
3592
3601
|
}
|
|
3593
|
-
function Ln() {
|
|
3594
|
-
return X() && an() && $t();
|
|
3595
|
-
}
|
|
3596
3602
|
function Rn() {
|
|
3603
|
+
return Y() && on() && en();
|
|
3604
|
+
}
|
|
3605
|
+
function zn() {
|
|
3597
3606
|
var e = navigator, t = 0, n;
|
|
3598
3607
|
e.maxTouchPoints === void 0 ? e.msMaxTouchPoints !== void 0 && (t = e.msMaxTouchPoints) : t = At(e.maxTouchPoints);
|
|
3599
3608
|
try {
|
|
@@ -3608,64 +3617,64 @@ function Rn() {
|
|
|
3608
3617
|
touchStart: r
|
|
3609
3618
|
};
|
|
3610
3619
|
}
|
|
3611
|
-
function
|
|
3620
|
+
function Bn() {
|
|
3612
3621
|
return navigator.oscpu;
|
|
3613
3622
|
}
|
|
3614
|
-
function
|
|
3623
|
+
function Vn() {
|
|
3615
3624
|
var e = navigator, t = [], n = e.language || e.userLanguage || e.browserLanguage || e.systemLanguage;
|
|
3616
|
-
if (n !== void 0 && t.push([n]), Array.isArray(e.languages))
|
|
3625
|
+
if (n !== void 0 && t.push([n]), Array.isArray(e.languages)) Qt() && nn() || t.push(e.languages);
|
|
3617
3626
|
else if (typeof e.languages == "string") {
|
|
3618
3627
|
var r = e.languages;
|
|
3619
3628
|
r && t.push(r.split(","));
|
|
3620
3629
|
}
|
|
3621
3630
|
return t;
|
|
3622
3631
|
}
|
|
3623
|
-
function Vn() {
|
|
3624
|
-
return window.screen.colorDepth;
|
|
3625
|
-
}
|
|
3626
3632
|
function Hn() {
|
|
3627
|
-
return
|
|
3633
|
+
return window.screen.colorDepth;
|
|
3628
3634
|
}
|
|
3629
3635
|
function Un() {
|
|
3630
|
-
|
|
3636
|
+
return W(U(navigator.deviceMemory), void 0);
|
|
3631
3637
|
}
|
|
3632
3638
|
function Wn() {
|
|
3639
|
+
if (!(Y() && on() && en())) return Gn();
|
|
3640
|
+
}
|
|
3641
|
+
function Gn() {
|
|
3633
3642
|
var e = screen, t = function(e) {
|
|
3634
3643
|
return W(At(e), null);
|
|
3635
3644
|
}, n = [t(e.width), t(e.height)];
|
|
3636
3645
|
return n.sort().reverse(), n;
|
|
3637
3646
|
}
|
|
3638
|
-
var
|
|
3639
|
-
function
|
|
3640
|
-
if (
|
|
3647
|
+
var Kn = 2500, qn = 10, Jn, Yn;
|
|
3648
|
+
function Xn() {
|
|
3649
|
+
if (Yn === void 0) {
|
|
3641
3650
|
var e = function() {
|
|
3642
|
-
var t =
|
|
3643
|
-
|
|
3651
|
+
var t = $n();
|
|
3652
|
+
er(t) ? Yn = setTimeout(e, Kn) : (Jn = t, Yn = void 0);
|
|
3644
3653
|
};
|
|
3645
3654
|
e();
|
|
3646
3655
|
}
|
|
3647
3656
|
}
|
|
3648
|
-
function
|
|
3657
|
+
function Zn() {
|
|
3649
3658
|
var e = this;
|
|
3650
|
-
return
|
|
3659
|
+
return Xn(), function() {
|
|
3651
3660
|
return V(e, void 0, void 0, function() {
|
|
3652
3661
|
var e;
|
|
3653
3662
|
return H(this, function(t) {
|
|
3654
3663
|
switch (t.label) {
|
|
3655
|
-
case 0: return e =
|
|
3656
|
-
case 1: t.sent(), e =
|
|
3657
|
-
case 2: return
|
|
3664
|
+
case 0: return e = $n(), er(e) ? Jn ? [2, yt([], Jn, !0)] : cn() ? [4, ln()] : [3, 2] : [3, 2];
|
|
3665
|
+
case 1: t.sent(), e = $n(), t.label = 2;
|
|
3666
|
+
case 2: return er(e) || (Jn = e), [2, e];
|
|
3658
3667
|
}
|
|
3659
3668
|
});
|
|
3660
3669
|
});
|
|
3661
3670
|
};
|
|
3662
3671
|
}
|
|
3663
|
-
function
|
|
3672
|
+
function Qn() {
|
|
3664
3673
|
var e = this;
|
|
3665
|
-
if (
|
|
3674
|
+
if (Y() && on() && en()) return function() {
|
|
3666
3675
|
return Promise.resolve(void 0);
|
|
3667
3676
|
};
|
|
3668
|
-
var t =
|
|
3677
|
+
var t = Zn();
|
|
3669
3678
|
return function() {
|
|
3670
3679
|
return V(e, void 0, void 0, function() {
|
|
3671
3680
|
var e, n;
|
|
@@ -3673,7 +3682,7 @@ function Zn() {
|
|
|
3673
3682
|
switch (r.label) {
|
|
3674
3683
|
case 0: return [4, t()];
|
|
3675
3684
|
case 1: return e = r.sent(), n = function(e) {
|
|
3676
|
-
return e === null ? null : jt(e,
|
|
3685
|
+
return e === null ? null : jt(e, qn);
|
|
3677
3686
|
}, [2, [
|
|
3678
3687
|
n(e[0]),
|
|
3679
3688
|
n(e[1]),
|
|
@@ -3685,7 +3694,7 @@ function Zn() {
|
|
|
3685
3694
|
});
|
|
3686
3695
|
};
|
|
3687
3696
|
}
|
|
3688
|
-
function
|
|
3697
|
+
function $n() {
|
|
3689
3698
|
var e = screen;
|
|
3690
3699
|
return [
|
|
3691
3700
|
W(U(e.availTop), null),
|
|
@@ -3694,61 +3703,61 @@ function Qn() {
|
|
|
3694
3703
|
W(U(e.availLeft), null)
|
|
3695
3704
|
];
|
|
3696
3705
|
}
|
|
3697
|
-
function
|
|
3706
|
+
function er(e) {
|
|
3698
3707
|
for (var t = 0; t < 4; ++t) if (e[t]) return !1;
|
|
3699
3708
|
return !0;
|
|
3700
3709
|
}
|
|
3701
|
-
function
|
|
3710
|
+
function tr() {
|
|
3702
3711
|
return W(At(navigator.hardwareConcurrency), void 0);
|
|
3703
3712
|
}
|
|
3704
|
-
function
|
|
3713
|
+
function nr() {
|
|
3705
3714
|
var e = window.Intl?.DateTimeFormat;
|
|
3706
3715
|
if (e) {
|
|
3707
3716
|
var t = new e().resolvedOptions().timeZone;
|
|
3708
3717
|
if (t) return t;
|
|
3709
3718
|
}
|
|
3710
|
-
var n = -
|
|
3719
|
+
var n = -rr();
|
|
3711
3720
|
return `UTC${n >= 0 ? "+" : ""}${n}`;
|
|
3712
3721
|
}
|
|
3713
|
-
function
|
|
3722
|
+
function rr() {
|
|
3714
3723
|
var e = (/* @__PURE__ */ new Date()).getFullYear();
|
|
3715
3724
|
return Math.max(U(new Date(e, 0, 1).getTimezoneOffset()), U(new Date(e, 6, 1).getTimezoneOffset()));
|
|
3716
3725
|
}
|
|
3717
|
-
function
|
|
3726
|
+
function ir() {
|
|
3718
3727
|
try {
|
|
3719
3728
|
return !!window.sessionStorage;
|
|
3720
3729
|
} catch {
|
|
3721
3730
|
return !0;
|
|
3722
3731
|
}
|
|
3723
3732
|
}
|
|
3724
|
-
function
|
|
3733
|
+
function ar() {
|
|
3725
3734
|
try {
|
|
3726
3735
|
return !!window.localStorage;
|
|
3727
3736
|
} catch {
|
|
3728
3737
|
return !0;
|
|
3729
3738
|
}
|
|
3730
3739
|
}
|
|
3731
|
-
function
|
|
3732
|
-
if (!(
|
|
3740
|
+
function or() {
|
|
3741
|
+
if (!(Xt() || Zt())) try {
|
|
3733
3742
|
return !!window.indexedDB;
|
|
3734
3743
|
} catch {
|
|
3735
3744
|
return !0;
|
|
3736
3745
|
}
|
|
3737
3746
|
}
|
|
3738
|
-
function
|
|
3747
|
+
function sr() {
|
|
3739
3748
|
return !!window.openDatabase;
|
|
3740
3749
|
}
|
|
3741
|
-
function
|
|
3750
|
+
function cr() {
|
|
3742
3751
|
return navigator.cpuClass;
|
|
3743
3752
|
}
|
|
3744
|
-
function
|
|
3753
|
+
function lr() {
|
|
3745
3754
|
var e = navigator.platform;
|
|
3746
|
-
return e === "MacIntel" &&
|
|
3755
|
+
return e === "MacIntel" && Y() && !$t() ? sn() ? "iPad" : "iPhone" : e;
|
|
3747
3756
|
}
|
|
3748
|
-
function
|
|
3757
|
+
function ur() {
|
|
3749
3758
|
return navigator.vendor || "";
|
|
3750
3759
|
}
|
|
3751
|
-
function
|
|
3760
|
+
function dr() {
|
|
3752
3761
|
for (var e = [], t = 0, n = [
|
|
3753
3762
|
"chrome",
|
|
3754
3763
|
"safari",
|
|
@@ -3771,7 +3780,7 @@ function ur() {
|
|
|
3771
3780
|
}
|
|
3772
3781
|
return e.sort();
|
|
3773
3782
|
}
|
|
3774
|
-
function
|
|
3783
|
+
function fr() {
|
|
3775
3784
|
var e = document;
|
|
3776
3785
|
try {
|
|
3777
3786
|
e.cookie = "cookietest=1; SameSite=Strict;";
|
|
@@ -3781,7 +3790,7 @@ function dr() {
|
|
|
3781
3790
|
return !1;
|
|
3782
3791
|
}
|
|
3783
3792
|
}
|
|
3784
|
-
function
|
|
3793
|
+
function pr() {
|
|
3785
3794
|
var e = atob;
|
|
3786
3795
|
return {
|
|
3787
3796
|
abpIndo: [
|
|
@@ -4070,16 +4079,16 @@ function fr() {
|
|
|
4070
4079
|
]
|
|
4071
4080
|
};
|
|
4072
4081
|
}
|
|
4073
|
-
function
|
|
4082
|
+
function mr(e) {
|
|
4074
4083
|
var t = (e === void 0 ? {} : e).debug;
|
|
4075
4084
|
return V(this, void 0, void 0, function() {
|
|
4076
4085
|
var e, n, r, i, a, o;
|
|
4077
4086
|
return H(this, function(s) {
|
|
4078
4087
|
switch (s.label) {
|
|
4079
|
-
case 0: return
|
|
4088
|
+
case 0: return hr() ? (e = pr(), n = Object.keys(e), r = (o = []).concat.apply(o, n.map(function(t) {
|
|
4080
4089
|
return e[t];
|
|
4081
|
-
})), [4,
|
|
4082
|
-
case 1: return i = s.sent(), t &&
|
|
4090
|
+
})), [4, gr(r)]) : [2, void 0];
|
|
4091
|
+
case 1: return i = s.sent(), t && vr(e, i), a = n.filter(function(t) {
|
|
4083
4092
|
var n = e[t];
|
|
4084
4093
|
return G(n.map(function(e) {
|
|
4085
4094
|
return i[e];
|
|
@@ -4089,17 +4098,17 @@ function pr(e) {
|
|
|
4089
4098
|
});
|
|
4090
4099
|
});
|
|
4091
4100
|
}
|
|
4092
|
-
function
|
|
4093
|
-
return
|
|
4101
|
+
function hr() {
|
|
4102
|
+
return Y() || un();
|
|
4094
4103
|
}
|
|
4095
|
-
function
|
|
4104
|
+
function gr(e) {
|
|
4096
4105
|
var t;
|
|
4097
4106
|
return V(this, void 0, void 0, function() {
|
|
4098
4107
|
var n, r, i, a, o, s, c, o;
|
|
4099
4108
|
return H(this, function(l) {
|
|
4100
4109
|
switch (l.label) {
|
|
4101
4110
|
case 0:
|
|
4102
|
-
for (n = document, r = n.createElement("div"), i = Array(e.length), a = {},
|
|
4111
|
+
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;
|
|
4103
4112
|
l.label = 1;
|
|
4104
4113
|
case 1: return n.body ? [3, 3] : [4, xt(50)];
|
|
4105
4114
|
case 2: return l.sent(), [3, 1];
|
|
@@ -4115,10 +4124,10 @@ function hr(e) {
|
|
|
4115
4124
|
});
|
|
4116
4125
|
});
|
|
4117
4126
|
}
|
|
4118
|
-
function
|
|
4127
|
+
function _r(e) {
|
|
4119
4128
|
e.style.setProperty("visibility", "hidden", "important"), e.style.setProperty("display", "block", "important");
|
|
4120
4129
|
}
|
|
4121
|
-
function
|
|
4130
|
+
function vr(e, t) {
|
|
4122
4131
|
for (var n = "DOM blockers debug:\n```", r = 0, i = Object.keys(e); r < i.length; r++) {
|
|
4123
4132
|
var a = i[r];
|
|
4124
4133
|
n += `
|
|
@@ -4130,7 +4139,7 @@ ${a}:`;
|
|
|
4130
4139
|
}
|
|
4131
4140
|
}
|
|
4132
4141
|
}
|
|
4133
|
-
function
|
|
4142
|
+
function yr() {
|
|
4134
4143
|
for (var e = 0, t = [
|
|
4135
4144
|
"rec2020",
|
|
4136
4145
|
"p3",
|
|
@@ -4140,108 +4149,108 @@ function vr() {
|
|
|
4140
4149
|
if (matchMedia(`(color-gamut: ${n})`).matches) return n;
|
|
4141
4150
|
}
|
|
4142
4151
|
}
|
|
4143
|
-
function
|
|
4144
|
-
if (
|
|
4145
|
-
if (
|
|
4152
|
+
function br() {
|
|
4153
|
+
if (xr("inverted")) return !0;
|
|
4154
|
+
if (xr("none")) return !1;
|
|
4146
4155
|
}
|
|
4147
|
-
function
|
|
4156
|
+
function xr(e) {
|
|
4148
4157
|
return matchMedia(`(inverted-colors: ${e})`).matches;
|
|
4149
4158
|
}
|
|
4150
|
-
function
|
|
4151
|
-
if (
|
|
4152
|
-
if (
|
|
4159
|
+
function Sr() {
|
|
4160
|
+
if (Cr("active")) return !0;
|
|
4161
|
+
if (Cr("none")) return !1;
|
|
4153
4162
|
}
|
|
4154
|
-
function
|
|
4163
|
+
function Cr(e) {
|
|
4155
4164
|
return matchMedia(`(forced-colors: ${e})`).matches;
|
|
4156
4165
|
}
|
|
4157
|
-
var
|
|
4158
|
-
function
|
|
4166
|
+
var wr = 100;
|
|
4167
|
+
function Tr() {
|
|
4159
4168
|
if (matchMedia("(min-monochrome: 0)").matches) {
|
|
4160
|
-
for (var e = 0; e <=
|
|
4169
|
+
for (var e = 0; e <= wr; ++e) if (matchMedia(`(max-monochrome: ${e})`).matches) return e;
|
|
4161
4170
|
throw Error("Too high value");
|
|
4162
4171
|
}
|
|
4163
4172
|
}
|
|
4164
|
-
function
|
|
4165
|
-
if (
|
|
4166
|
-
if (
|
|
4167
|
-
if (
|
|
4168
|
-
if (
|
|
4173
|
+
function Er() {
|
|
4174
|
+
if (Dr("no-preference")) return 0;
|
|
4175
|
+
if (Dr("high") || Dr("more")) return 1;
|
|
4176
|
+
if (Dr("low") || Dr("less")) return -1;
|
|
4177
|
+
if (Dr("forced")) return 10;
|
|
4169
4178
|
}
|
|
4170
|
-
function
|
|
4179
|
+
function Dr(e) {
|
|
4171
4180
|
return matchMedia(`(prefers-contrast: ${e})`).matches;
|
|
4172
4181
|
}
|
|
4173
|
-
function
|
|
4174
|
-
if (
|
|
4175
|
-
if (
|
|
4182
|
+
function Or() {
|
|
4183
|
+
if (kr("reduce")) return !0;
|
|
4184
|
+
if (kr("no-preference")) return !1;
|
|
4176
4185
|
}
|
|
4177
|
-
function
|
|
4186
|
+
function kr(e) {
|
|
4178
4187
|
return matchMedia(`(prefers-reduced-motion: ${e})`).matches;
|
|
4179
4188
|
}
|
|
4180
|
-
function
|
|
4181
|
-
if (
|
|
4182
|
-
if (
|
|
4189
|
+
function Ar() {
|
|
4190
|
+
if (jr("reduce")) return !0;
|
|
4191
|
+
if (jr("no-preference")) return !1;
|
|
4183
4192
|
}
|
|
4184
|
-
function
|
|
4193
|
+
function jr(e) {
|
|
4185
4194
|
return matchMedia(`(prefers-reduced-transparency: ${e})`).matches;
|
|
4186
4195
|
}
|
|
4187
|
-
function
|
|
4188
|
-
if (
|
|
4189
|
-
if (
|
|
4196
|
+
function Mr() {
|
|
4197
|
+
if (Nr("high")) return !0;
|
|
4198
|
+
if (Nr("standard")) return !1;
|
|
4190
4199
|
}
|
|
4191
|
-
function
|
|
4200
|
+
function Nr(e) {
|
|
4192
4201
|
return matchMedia(`(dynamic-range: ${e})`).matches;
|
|
4193
4202
|
}
|
|
4194
|
-
var
|
|
4203
|
+
var X = Math, Z = function() {
|
|
4195
4204
|
return 0;
|
|
4196
4205
|
};
|
|
4197
|
-
function
|
|
4198
|
-
var e =
|
|
4206
|
+
function Pr() {
|
|
4207
|
+
var e = X.acos || Z, t = X.acosh || Z, n = X.asin || Z, r = X.asinh || Z, i = X.atanh || Z, a = X.atan || Z, o = X.sin || Z, s = X.sinh || Z, c = X.cos || Z, l = X.cosh || Z, u = X.tan || Z, d = X.tanh || Z, f = X.exp || Z, p = X.expm1 || Z, m = X.log1p || Z;
|
|
4199
4208
|
return {
|
|
4200
4209
|
acos: e(.12312423423423424),
|
|
4201
4210
|
acosh: t(1e308),
|
|
4202
4211
|
acoshPf: function(e) {
|
|
4203
|
-
return
|
|
4212
|
+
return X.log(e + X.sqrt(e * e - 1));
|
|
4204
4213
|
}(1e154),
|
|
4205
4214
|
asin: n(.12312423423423424),
|
|
4206
4215
|
asinh: r(1),
|
|
4207
4216
|
asinhPf: function(e) {
|
|
4208
|
-
return
|
|
4217
|
+
return X.log(e + X.sqrt(e * e + 1));
|
|
4209
4218
|
}(1),
|
|
4210
4219
|
atanh: i(.5),
|
|
4211
4220
|
atanhPf: function(e) {
|
|
4212
|
-
return
|
|
4221
|
+
return X.log((1 + e) / (1 - e)) / 2;
|
|
4213
4222
|
}(.5),
|
|
4214
4223
|
atan: a(.5),
|
|
4215
4224
|
sin: o(-1e300),
|
|
4216
4225
|
sinh: s(1),
|
|
4217
4226
|
sinhPf: function(e) {
|
|
4218
|
-
return
|
|
4227
|
+
return X.exp(e) - 1 / X.exp(e) / 2;
|
|
4219
4228
|
}(1),
|
|
4220
4229
|
cos: c(10.000000000123),
|
|
4221
4230
|
cosh: l(1),
|
|
4222
4231
|
coshPf: function(e) {
|
|
4223
|
-
return (
|
|
4232
|
+
return (X.exp(e) + 1 / X.exp(e)) / 2;
|
|
4224
4233
|
}(1),
|
|
4225
4234
|
tan: u(-1e300),
|
|
4226
4235
|
tanh: d(1),
|
|
4227
4236
|
tanhPf: function(e) {
|
|
4228
|
-
return (
|
|
4237
|
+
return (X.exp(2 * e) - 1) / (X.exp(2 * e) + 1);
|
|
4229
4238
|
}(1),
|
|
4230
4239
|
exp: f(1),
|
|
4231
4240
|
expm1: p(1),
|
|
4232
4241
|
expm1Pf: function(e) {
|
|
4233
|
-
return
|
|
4242
|
+
return X.exp(e) - 1;
|
|
4234
4243
|
}(1),
|
|
4235
4244
|
log1p: m(10),
|
|
4236
4245
|
log1pPf: function(e) {
|
|
4237
|
-
return
|
|
4246
|
+
return X.log(1 + e);
|
|
4238
4247
|
}(10),
|
|
4239
4248
|
powPI: function(e) {
|
|
4240
|
-
return
|
|
4249
|
+
return X.pow(X.PI, e);
|
|
4241
4250
|
}(-100)
|
|
4242
4251
|
};
|
|
4243
4252
|
}
|
|
4244
|
-
var
|
|
4253
|
+
var Fr = "mmMwWLliI0fiflO&1", Ir = {
|
|
4245
4254
|
default: [],
|
|
4246
4255
|
apple: [{ font: "-apple-system-body" }],
|
|
4247
4256
|
serif: [{ fontFamily: "serif" }],
|
|
@@ -4250,10 +4259,10 @@ var Pr = "mmMwWLliI0fiflO&1", Fr = {
|
|
|
4250
4259
|
min: [{ fontSize: "1px" }],
|
|
4251
4260
|
system: [{ fontFamily: "system-ui" }]
|
|
4252
4261
|
};
|
|
4253
|
-
function
|
|
4254
|
-
return
|
|
4255
|
-
for (var n = {}, r = {}, i = 0, a = Object.keys(
|
|
4256
|
-
var o = a[i], s =
|
|
4262
|
+
function Lr() {
|
|
4263
|
+
return Rr(function(e, t) {
|
|
4264
|
+
for (var n = {}, r = {}, i = 0, a = Object.keys(Ir); i < a.length; i++) {
|
|
4265
|
+
var o = a[i], s = Ir[o], c = s[0], l = c === void 0 ? {} : c, u = s[1], d = u === void 0 ? Fr : u, f = e.createElement("span");
|
|
4257
4266
|
f.textContent = d, f.style.whiteSpace = "nowrap";
|
|
4258
4267
|
for (var p = 0, m = Object.keys(l); p < m.length; p++) {
|
|
4259
4268
|
var h = m[p], g = l[h];
|
|
@@ -4261,50 +4270,50 @@ function Ir() {
|
|
|
4261
4270
|
}
|
|
4262
4271
|
n[o] = f, t.append(e.createElement("br"), f);
|
|
4263
4272
|
}
|
|
4264
|
-
for (var _ = 0, v = Object.keys(
|
|
4273
|
+
for (var _ = 0, v = Object.keys(Ir); _ < v.length; _++) {
|
|
4265
4274
|
var o = v[_];
|
|
4266
4275
|
r[o] = n[o].getBoundingClientRect().width;
|
|
4267
4276
|
}
|
|
4268
4277
|
return r;
|
|
4269
4278
|
});
|
|
4270
4279
|
}
|
|
4271
|
-
function
|
|
4272
|
-
return t === void 0 && (t = 4e3),
|
|
4280
|
+
function Rr(e, t) {
|
|
4281
|
+
return t === void 0 && (t = 4e3), yn(function(n, r) {
|
|
4273
4282
|
var i = r.document, a = i.body, o = a.style;
|
|
4274
|
-
o.width = `${t}px`, o.webkitTextSizeAdjust = o.textSizeAdjust = "none",
|
|
4283
|
+
o.width = `${t}px`, o.webkitTextSizeAdjust = o.textSizeAdjust = "none", Qt() ? a.style.zoom = `${1 / r.devicePixelRatio}` : Y() && (a.style.zoom = "reset");
|
|
4275
4284
|
var s = i.createElement("div");
|
|
4276
4285
|
return s.textContent = yt([], Array(t / 20 << 0), !0).map(function() {
|
|
4277
4286
|
return "word";
|
|
4278
4287
|
}).join(" "), a.appendChild(s), e(i, a);
|
|
4279
4288
|
}, "<!doctype html><html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
|
|
4280
4289
|
}
|
|
4281
|
-
function
|
|
4290
|
+
function zr() {
|
|
4282
4291
|
return navigator.pdfViewerEnabled;
|
|
4283
4292
|
}
|
|
4284
|
-
function
|
|
4293
|
+
function Br() {
|
|
4285
4294
|
var e = new Float32Array(1), t = new Uint8Array(e.buffer);
|
|
4286
4295
|
return e[0] = Infinity, e[0] -= e[0], t[3];
|
|
4287
4296
|
}
|
|
4288
|
-
function
|
|
4297
|
+
function Vr() {
|
|
4289
4298
|
var e = window.ApplePaySession;
|
|
4290
4299
|
if (typeof e?.canMakePayments != "function") return -1;
|
|
4291
|
-
if (
|
|
4300
|
+
if (Hr()) return -3;
|
|
4292
4301
|
try {
|
|
4293
4302
|
return +!!e.canMakePayments();
|
|
4294
4303
|
} catch (e) {
|
|
4295
|
-
return
|
|
4304
|
+
return Ur(e);
|
|
4296
4305
|
}
|
|
4297
4306
|
}
|
|
4298
|
-
var
|
|
4299
|
-
function
|
|
4307
|
+
var Hr = Sn;
|
|
4308
|
+
function Ur(e) {
|
|
4300
4309
|
if (e instanceof Error && e.name === "InvalidAccessError" && /\bfrom\b.*\binsecure\b/i.test(e.message)) return -2;
|
|
4301
4310
|
throw e;
|
|
4302
4311
|
}
|
|
4303
|
-
function
|
|
4312
|
+
function Wr() {
|
|
4304
4313
|
var e = document.createElement("a"), t = e.attributionSourceId ?? e.attributionsourceid;
|
|
4305
4314
|
return t === void 0 ? void 0 : String(t);
|
|
4306
4315
|
}
|
|
4307
|
-
var
|
|
4316
|
+
var Gr = -1, Kr = -2, qr = new Set([
|
|
4308
4317
|
10752,
|
|
4309
4318
|
2849,
|
|
4310
4319
|
2884,
|
|
@@ -4386,7 +4395,7 @@ var Wr = -1, Gr = -2, Kr = new Set([
|
|
|
4386
4395
|
7936,
|
|
4387
4396
|
7937,
|
|
4388
4397
|
7938
|
|
4389
|
-
]),
|
|
4398
|
+
]), Jr = new Set([
|
|
4390
4399
|
34047,
|
|
4391
4400
|
35723,
|
|
4392
4401
|
36063,
|
|
@@ -4397,19 +4406,19 @@ var Wr = -1, Gr = -2, Kr = new Set([
|
|
|
4397
4406
|
36392,
|
|
4398
4407
|
36795,
|
|
4399
4408
|
38449
|
|
4400
|
-
]),
|
|
4409
|
+
]), Yr = ["FRAGMENT_SHADER", "VERTEX_SHADER"], Xr = [
|
|
4401
4410
|
"LOW_FLOAT",
|
|
4402
4411
|
"MEDIUM_FLOAT",
|
|
4403
4412
|
"HIGH_FLOAT",
|
|
4404
4413
|
"LOW_INT",
|
|
4405
4414
|
"MEDIUM_INT",
|
|
4406
4415
|
"HIGH_INT"
|
|
4407
|
-
],
|
|
4408
|
-
function
|
|
4409
|
-
var t = e.cache, n =
|
|
4410
|
-
if (!n) return
|
|
4411
|
-
if (!
|
|
4412
|
-
var r =
|
|
4416
|
+
], Zr = "WEBGL_debug_renderer_info", Qr = "WEBGL_polygon_mode";
|
|
4417
|
+
function $r(e) {
|
|
4418
|
+
var t = e.cache, n = ti(t);
|
|
4419
|
+
if (!n) return Gr;
|
|
4420
|
+
if (!si(n)) return Kr;
|
|
4421
|
+
var r = ai() ? null : n.getExtension(Zr);
|
|
4413
4422
|
return {
|
|
4414
4423
|
version: n.getParameter(n.VERSION)?.toString() || "",
|
|
4415
4424
|
vendor: n.getParameter(n.VENDOR)?.toString() || "",
|
|
@@ -4419,35 +4428,35 @@ function Qr(e) {
|
|
|
4419
4428
|
shadingLanguageVersion: n.getParameter(n.SHADING_LANGUAGE_VERSION)?.toString() || ""
|
|
4420
4429
|
};
|
|
4421
4430
|
}
|
|
4422
|
-
function
|
|
4423
|
-
var t = e.cache, n =
|
|
4424
|
-
if (!n) return
|
|
4425
|
-
if (!
|
|
4431
|
+
function ei(e) {
|
|
4432
|
+
var t = e.cache, n = ti(t);
|
|
4433
|
+
if (!n) return Gr;
|
|
4434
|
+
if (!si(n)) return Kr;
|
|
4426
4435
|
var r = n.getSupportedExtensions(), i = n.getContextAttributes(), a = [], o = [], s = [], c = [], l = [];
|
|
4427
4436
|
if (i) for (var u = 0, d = Object.keys(i); u < d.length; u++) {
|
|
4428
4437
|
var f = d[u];
|
|
4429
4438
|
o.push(`${f}=${i[f]}`);
|
|
4430
4439
|
}
|
|
4431
|
-
for (var p =
|
|
4440
|
+
for (var p = ri(n), m = 0, h = p; m < h.length; m++) {
|
|
4432
4441
|
var g = h[m], _ = n[g];
|
|
4433
|
-
s.push(`${g}=${_}${
|
|
4442
|
+
s.push(`${g}=${_}${qr.has(_) ? `=${n.getParameter(_)}` : ""}`);
|
|
4434
4443
|
}
|
|
4435
4444
|
if (r) for (var v = 0, y = r; v < y.length; v++) {
|
|
4436
4445
|
var b = y[v];
|
|
4437
|
-
if (!(b ===
|
|
4446
|
+
if (!(b === Zr && ai() || b === Qr && oi())) {
|
|
4438
4447
|
var x = n.getExtension(b);
|
|
4439
4448
|
if (!x) {
|
|
4440
4449
|
a.push(b);
|
|
4441
4450
|
continue;
|
|
4442
4451
|
}
|
|
4443
|
-
for (var S = 0, C =
|
|
4452
|
+
for (var S = 0, C = ri(x); S < C.length; S++) {
|
|
4444
4453
|
var g = C[S], _ = x[g];
|
|
4445
|
-
c.push(`${g}=${_}${
|
|
4454
|
+
c.push(`${g}=${_}${Jr.has(_) ? `=${n.getParameter(_)}` : ""}`);
|
|
4446
4455
|
}
|
|
4447
4456
|
}
|
|
4448
4457
|
}
|
|
4449
|
-
for (var w = 0, T =
|
|
4450
|
-
var k = O[D], A =
|
|
4458
|
+
for (var w = 0, T = Yr; w < T.length; w++) for (var E = T[w], D = 0, O = Xr; D < O.length; D++) {
|
|
4459
|
+
var k = O[D], A = ni(n, E, k);
|
|
4451
4460
|
l.push(`${E}.${k}=${A.join(",")}`);
|
|
4452
4461
|
}
|
|
4453
4462
|
return c.sort(), s.sort(), {
|
|
@@ -4459,7 +4468,7 @@ function $r(e) {
|
|
|
4459
4468
|
unsupportedExtensions: a
|
|
4460
4469
|
};
|
|
4461
4470
|
}
|
|
4462
|
-
function
|
|
4471
|
+
function ti(e) {
|
|
4463
4472
|
if (e.webgl) return e.webgl.context;
|
|
4464
4473
|
var t = document.createElement("canvas"), n;
|
|
4465
4474
|
t.addEventListener("webglCreateContextError", function() {
|
|
@@ -4474,7 +4483,7 @@ function ei(e) {
|
|
|
4474
4483
|
}
|
|
4475
4484
|
return e.webgl = { context: n }, n;
|
|
4476
4485
|
}
|
|
4477
|
-
function
|
|
4486
|
+
function ni(e, t, n) {
|
|
4478
4487
|
var r = e.getShaderPrecisionFormat(e[t], e[n]);
|
|
4479
4488
|
return r ? [
|
|
4480
4489
|
r.rangeMin,
|
|
@@ -4482,188 +4491,228 @@ function ti(e, t, n) {
|
|
|
4482
4491
|
r.precision
|
|
4483
4492
|
] : [];
|
|
4484
4493
|
}
|
|
4485
|
-
function ni(e) {
|
|
4486
|
-
return Object.keys(e.__proto__).filter(ri);
|
|
4487
|
-
}
|
|
4488
4494
|
function ri(e) {
|
|
4489
|
-
return
|
|
4495
|
+
return Object.keys(e.__proto__).filter(ii);
|
|
4490
4496
|
}
|
|
4491
|
-
function ii() {
|
|
4492
|
-
return
|
|
4497
|
+
function ii(e) {
|
|
4498
|
+
return typeof e == "string" && !e.match(/[^A-Z0-9_x]/);
|
|
4493
4499
|
}
|
|
4494
4500
|
function ai() {
|
|
4495
|
-
return
|
|
4501
|
+
return tn();
|
|
4502
|
+
}
|
|
4503
|
+
function oi() {
|
|
4504
|
+
return Qt() || Y();
|
|
4496
4505
|
}
|
|
4497
|
-
function
|
|
4506
|
+
function si(e) {
|
|
4498
4507
|
return typeof e.getParameter == "function";
|
|
4499
4508
|
}
|
|
4500
|
-
function
|
|
4501
|
-
if (!(
|
|
4509
|
+
function ci() {
|
|
4510
|
+
if (!(un() || Y())) return -2;
|
|
4502
4511
|
if (!window.AudioContext) return -1;
|
|
4503
4512
|
var e = new AudioContext().baseLatency;
|
|
4504
4513
|
return e == null ? -1 : isFinite(e) ? e : -3;
|
|
4505
4514
|
}
|
|
4506
|
-
function
|
|
4515
|
+
function li() {
|
|
4507
4516
|
if (!window.Intl) return -1;
|
|
4508
4517
|
var e = window.Intl.DateTimeFormat;
|
|
4509
4518
|
if (!e) return -2;
|
|
4510
4519
|
var t = e().resolvedOptions().locale;
|
|
4511
4520
|
return !t && t !== "" ? -3 : t;
|
|
4512
4521
|
}
|
|
4513
|
-
var
|
|
4514
|
-
fonts:
|
|
4515
|
-
domBlockers:
|
|
4516
|
-
fontPreferences:
|
|
4517
|
-
audio:
|
|
4518
|
-
screenFrame:
|
|
4519
|
-
canvas:
|
|
4520
|
-
osCpu:
|
|
4521
|
-
languages:
|
|
4522
|
-
colorDepth:
|
|
4523
|
-
deviceMemory:
|
|
4524
|
-
screenResolution:
|
|
4525
|
-
hardwareConcurrency:
|
|
4526
|
-
timezone:
|
|
4527
|
-
sessionStorage:
|
|
4528
|
-
localStorage:
|
|
4529
|
-
indexedDB:
|
|
4530
|
-
openDatabase:
|
|
4531
|
-
cpuClass:
|
|
4532
|
-
platform:
|
|
4533
|
-
plugins:
|
|
4534
|
-
touchSupport:
|
|
4535
|
-
vendor:
|
|
4536
|
-
vendorFlavors:
|
|
4537
|
-
cookiesEnabled:
|
|
4538
|
-
colorGamut:
|
|
4539
|
-
invertedColors:
|
|
4540
|
-
forcedColors:
|
|
4541
|
-
monochrome:
|
|
4542
|
-
contrast:
|
|
4543
|
-
reducedMotion:
|
|
4544
|
-
reducedTransparency:
|
|
4545
|
-
hdr:
|
|
4546
|
-
math:
|
|
4547
|
-
pdfViewerEnabled:
|
|
4548
|
-
architecture:
|
|
4549
|
-
applePay:
|
|
4550
|
-
privateClickMeasurement:
|
|
4551
|
-
audioBaseLatency:
|
|
4552
|
-
dateTimeLocale:
|
|
4553
|
-
webGlBasics:
|
|
4554
|
-
webGlExtensions:
|
|
4522
|
+
var ui = {
|
|
4523
|
+
fonts: Dn,
|
|
4524
|
+
domBlockers: mr,
|
|
4525
|
+
fontPreferences: Lr,
|
|
4526
|
+
audio: fn,
|
|
4527
|
+
screenFrame: Qn,
|
|
4528
|
+
canvas: kn,
|
|
4529
|
+
osCpu: Bn,
|
|
4530
|
+
languages: Vn,
|
|
4531
|
+
colorDepth: Hn,
|
|
4532
|
+
deviceMemory: Un,
|
|
4533
|
+
screenResolution: Wn,
|
|
4534
|
+
hardwareConcurrency: tr,
|
|
4535
|
+
timezone: nr,
|
|
4536
|
+
sessionStorage: ir,
|
|
4537
|
+
localStorage: ar,
|
|
4538
|
+
indexedDB: or,
|
|
4539
|
+
openDatabase: sr,
|
|
4540
|
+
cpuClass: cr,
|
|
4541
|
+
platform: lr,
|
|
4542
|
+
plugins: On,
|
|
4543
|
+
touchSupport: zn,
|
|
4544
|
+
vendor: ur,
|
|
4545
|
+
vendorFlavors: dr,
|
|
4546
|
+
cookiesEnabled: fr,
|
|
4547
|
+
colorGamut: yr,
|
|
4548
|
+
invertedColors: br,
|
|
4549
|
+
forcedColors: Sr,
|
|
4550
|
+
monochrome: Tr,
|
|
4551
|
+
contrast: Er,
|
|
4552
|
+
reducedMotion: Or,
|
|
4553
|
+
reducedTransparency: Ar,
|
|
4554
|
+
hdr: Mr,
|
|
4555
|
+
math: Pr,
|
|
4556
|
+
pdfViewerEnabled: zr,
|
|
4557
|
+
architecture: Br,
|
|
4558
|
+
applePay: Vr,
|
|
4559
|
+
privateClickMeasurement: Wr,
|
|
4560
|
+
audioBaseLatency: ci,
|
|
4561
|
+
dateTimeLocale: li,
|
|
4562
|
+
webGlBasics: $r,
|
|
4563
|
+
webGlExtensions: ei
|
|
4555
4564
|
};
|
|
4556
|
-
function
|
|
4557
|
-
return
|
|
4565
|
+
function di(e) {
|
|
4566
|
+
return Yt(ui, e, []);
|
|
4558
4567
|
}
|
|
4559
|
-
var
|
|
4560
|
-
function
|
|
4561
|
-
var t =
|
|
4568
|
+
var fi = "$ if upgrade to Pro: https://fpjs.dev/pro";
|
|
4569
|
+
function pi(e) {
|
|
4570
|
+
var t = mi(e), n = hi(t);
|
|
4562
4571
|
return {
|
|
4563
4572
|
score: t,
|
|
4564
|
-
comment:
|
|
4573
|
+
comment: fi.replace(/\$/g, `${n}`)
|
|
4565
4574
|
};
|
|
4566
4575
|
}
|
|
4567
|
-
function
|
|
4568
|
-
if (
|
|
4569
|
-
if (
|
|
4576
|
+
function mi(e) {
|
|
4577
|
+
if (un()) return .4;
|
|
4578
|
+
if (Y()) return $t() && !(on() && en()) ? .5 : .3;
|
|
4570
4579
|
var t = "value" in e.platform ? e.platform.value : "";
|
|
4571
4580
|
return /^Win/.test(t) ? .6 : /^Mac/.test(t) ? .5 : .7;
|
|
4572
4581
|
}
|
|
4573
|
-
function
|
|
4582
|
+
function hi(e) {
|
|
4574
4583
|
return jt(.99 + .01 * e, 1e-4);
|
|
4575
4584
|
}
|
|
4576
|
-
function
|
|
4585
|
+
function gi(e) {
|
|
4577
4586
|
for (var t = "", n = 0, r = Object.keys(e).sort(); n < r.length; n++) {
|
|
4578
4587
|
var i = r[n], a = e[i], o = "error" in a ? "error" : JSON.stringify(a.value);
|
|
4579
4588
|
t += `${t ? "|" : ""}${i.replace(/([:|\\])/g, "\\$1")}:${o}`;
|
|
4580
4589
|
}
|
|
4581
4590
|
return t;
|
|
4582
4591
|
}
|
|
4583
|
-
function
|
|
4592
|
+
function _i(e) {
|
|
4584
4593
|
return JSON.stringify(e, function(e, t) {
|
|
4585
|
-
return t instanceof Error ?
|
|
4594
|
+
return t instanceof Error ? Gt(t) : t;
|
|
4586
4595
|
}, 2);
|
|
4587
4596
|
}
|
|
4588
|
-
function _i(e) {
|
|
4589
|
-
return Ut(hi(e));
|
|
4590
|
-
}
|
|
4591
4597
|
function vi(e) {
|
|
4598
|
+
return Wt(gi(e));
|
|
4599
|
+
}
|
|
4600
|
+
function yi(e) {
|
|
4592
4601
|
var t;
|
|
4593
4602
|
return {
|
|
4594
4603
|
get visitorId() {
|
|
4595
|
-
return t === void 0 && (t =
|
|
4604
|
+
return t === void 0 && (t = vi(this.components)), t;
|
|
4596
4605
|
},
|
|
4597
4606
|
set visitorId(e) {
|
|
4598
4607
|
t = e;
|
|
4599
4608
|
},
|
|
4600
|
-
confidence:
|
|
4609
|
+
confidence: pi(e),
|
|
4601
4610
|
components: e,
|
|
4602
4611
|
version: bt
|
|
4603
4612
|
};
|
|
4604
4613
|
}
|
|
4605
|
-
function
|
|
4614
|
+
function bi(e) {
|
|
4606
4615
|
return e === void 0 && (e = 50), Ct(e, e * 2);
|
|
4607
4616
|
}
|
|
4608
|
-
function
|
|
4617
|
+
function xi(e, t) {
|
|
4609
4618
|
return { get: function(n) {
|
|
4610
4619
|
return V(this, void 0, void 0, function() {
|
|
4611
4620
|
var r, i;
|
|
4612
4621
|
return H(this, function(a) {
|
|
4613
4622
|
switch (a.label) {
|
|
4614
4623
|
case 0: return [4, e()];
|
|
4615
|
-
case 1: return r = a.sent(), i =
|
|
4624
|
+
case 1: return r = a.sent(), i = yi(r), t || n?.debug, [2, i];
|
|
4616
4625
|
}
|
|
4617
4626
|
});
|
|
4618
4627
|
});
|
|
4619
4628
|
} };
|
|
4620
4629
|
}
|
|
4621
|
-
function
|
|
4630
|
+
function Si() {
|
|
4622
4631
|
if (!(window.__fpjs_d_m || Math.random() >= .001)) try {
|
|
4623
4632
|
var e = new XMLHttpRequest();
|
|
4624
4633
|
e.open("get", `https://m1.openfpcdn.io/fingerprintjs/v${bt}/npm-monitoring`, !0), e.send();
|
|
4625
4634
|
} catch {}
|
|
4626
4635
|
}
|
|
4627
|
-
function
|
|
4636
|
+
function Ci(e) {
|
|
4628
4637
|
return e === void 0 && (e = {}), V(this, void 0, void 0, function() {
|
|
4629
4638
|
var t, n, r;
|
|
4630
4639
|
return H(this, function(i) {
|
|
4631
4640
|
switch (i.label) {
|
|
4632
|
-
case 0: return (e.monitoring ?? !0) &&
|
|
4633
|
-
case 1: return i.sent(), r =
|
|
4641
|
+
case 0: return (e.monitoring ?? !0) && Si(), t = e.delayFallback, n = e.debug, [4, bi(t)];
|
|
4642
|
+
case 1: return i.sent(), r = di({
|
|
4634
4643
|
cache: {},
|
|
4635
4644
|
debug: n
|
|
4636
|
-
}), [2,
|
|
4645
|
+
}), [2, xi(r, n)];
|
|
4637
4646
|
}
|
|
4638
4647
|
});
|
|
4639
4648
|
});
|
|
4640
4649
|
}
|
|
4641
|
-
var
|
|
4642
|
-
load:
|
|
4643
|
-
hashComponents:
|
|
4644
|
-
componentsToDebugString:
|
|
4650
|
+
var wi = {
|
|
4651
|
+
load: Ci,
|
|
4652
|
+
hashComponents: vi,
|
|
4653
|
+
componentsToDebugString: _i
|
|
4645
4654
|
};
|
|
4646
4655
|
//#endregion
|
|
4647
4656
|
//#region ../../packages/widget-sdk/src/api/request-options.ts
|
|
4648
|
-
function
|
|
4657
|
+
function Ti(e) {
|
|
4649
4658
|
return e.preview ? "include" : "same-origin";
|
|
4650
4659
|
}
|
|
4651
|
-
function
|
|
4660
|
+
function Ei(e) {
|
|
4661
|
+
return e.sessionToken ? { "x-widget-session-token": e.sessionToken } : {};
|
|
4662
|
+
}
|
|
4663
|
+
function Di(e, t) {
|
|
4652
4664
|
return t.configChannel === "draft" ? `${e}${e.includes("?") ? "&" : "?"}configChannel=draft` : e;
|
|
4653
4665
|
}
|
|
4654
4666
|
//#endregion
|
|
4655
4667
|
//#region ../../packages/widget-sdk/src/api/client.ts
|
|
4656
|
-
var
|
|
4668
|
+
var Oi = class {
|
|
4657
4669
|
baseUrl;
|
|
4658
4670
|
options;
|
|
4671
|
+
sessionToken;
|
|
4672
|
+
sessionTokenExpiresAt;
|
|
4659
4673
|
constructor(e, t = {}) {
|
|
4660
4674
|
this.baseUrl = e, this.options = t;
|
|
4661
4675
|
}
|
|
4662
4676
|
get credentials() {
|
|
4663
|
-
return
|
|
4677
|
+
return Ti(this.options);
|
|
4664
4678
|
}
|
|
4665
4679
|
channel(e) {
|
|
4666
|
-
return
|
|
4680
|
+
return Di(e, this.options);
|
|
4681
|
+
}
|
|
4682
|
+
authHeaders() {
|
|
4683
|
+
return {
|
|
4684
|
+
"Content-Type": "application/json",
|
|
4685
|
+
...Ei({ sessionToken: this.sessionToken })
|
|
4686
|
+
};
|
|
4687
|
+
}
|
|
4688
|
+
getSessionToken() {
|
|
4689
|
+
return this.sessionToken;
|
|
4690
|
+
}
|
|
4691
|
+
hasValidSessionToken() {
|
|
4692
|
+
return !!this.sessionToken && !!this.sessionTokenExpiresAt && this.sessionTokenExpiresAt - 6e4 > Date.now();
|
|
4693
|
+
}
|
|
4694
|
+
async establishSession(e, t, n) {
|
|
4695
|
+
if (!t) return !1;
|
|
4696
|
+
try {
|
|
4697
|
+
let r = await fetch(this.channel(`${this.baseUrl}/v1/widget/session`), {
|
|
4698
|
+
method: "POST",
|
|
4699
|
+
credentials: this.credentials,
|
|
4700
|
+
headers: { "Content-Type": "application/json" },
|
|
4701
|
+
body: JSON.stringify({
|
|
4702
|
+
agentId: e,
|
|
4703
|
+
tenantId: t,
|
|
4704
|
+
turnstileToken: n
|
|
4705
|
+
})
|
|
4706
|
+
});
|
|
4707
|
+
if (!r.ok) return !1;
|
|
4708
|
+
let i = await r.json();
|
|
4709
|
+
if (!i.success || typeof i.data?.token != "string") return !1;
|
|
4710
|
+
this.sessionToken = i.data.token;
|
|
4711
|
+
let a = typeof i.data.expiresIn == "number" ? i.data.expiresIn : 0;
|
|
4712
|
+
return this.sessionTokenExpiresAt = Date.now() + a * 1e3, !0;
|
|
4713
|
+
} catch {
|
|
4714
|
+
return !1;
|
|
4715
|
+
}
|
|
4667
4716
|
}
|
|
4668
4717
|
async validateWidget(e, t) {
|
|
4669
4718
|
if (!t) return {
|
|
@@ -4697,7 +4746,7 @@ var Ei = class {
|
|
|
4697
4746
|
let t = await fetch(this.channel(`${this.baseUrl}/v1/agents/${encodeURIComponent(e.agentId)}/responses`), {
|
|
4698
4747
|
method: "POST",
|
|
4699
4748
|
credentials: this.credentials,
|
|
4700
|
-
headers:
|
|
4749
|
+
headers: this.authHeaders(),
|
|
4701
4750
|
body: JSON.stringify({
|
|
4702
4751
|
message: e.message,
|
|
4703
4752
|
sessionId: e.sessionId,
|
|
@@ -4738,7 +4787,7 @@ var Ei = class {
|
|
|
4738
4787
|
let a = await fetch(this.channel(`${this.baseUrl}/v1/upload`), {
|
|
4739
4788
|
method: "POST",
|
|
4740
4789
|
credentials: this.credentials,
|
|
4741
|
-
headers:
|
|
4790
|
+
headers: this.authHeaders(),
|
|
4742
4791
|
body: JSON.stringify({
|
|
4743
4792
|
file: e,
|
|
4744
4793
|
mimeType: t,
|
|
@@ -4756,7 +4805,7 @@ var Ei = class {
|
|
|
4756
4805
|
let a = await fetch(this.channel(`${this.baseUrl}/v1/upload`), {
|
|
4757
4806
|
method: "POST",
|
|
4758
4807
|
credentials: this.credentials,
|
|
4759
|
-
headers:
|
|
4808
|
+
headers: this.authHeaders(),
|
|
4760
4809
|
body: JSON.stringify({
|
|
4761
4810
|
file: e,
|
|
4762
4811
|
mimeType: t,
|
|
@@ -4771,6 +4820,25 @@ var Ei = class {
|
|
|
4771
4820
|
if (!o.success) throw Error(o.error ?? "Upload failed");
|
|
4772
4821
|
return { url: o.data.url };
|
|
4773
4822
|
}
|
|
4823
|
+
async uploadVoiceNote(e, t, n, r, i) {
|
|
4824
|
+
let a = await fetch(this.channel(`${this.baseUrl}/v1/upload`), {
|
|
4825
|
+
method: "POST",
|
|
4826
|
+
credentials: this.credentials,
|
|
4827
|
+
headers: this.authHeaders(),
|
|
4828
|
+
body: JSON.stringify({
|
|
4829
|
+
file: e,
|
|
4830
|
+
mimeType: t,
|
|
4831
|
+
fileName: n,
|
|
4832
|
+
agentId: r,
|
|
4833
|
+
tenantId: i,
|
|
4834
|
+
kind: "audio"
|
|
4835
|
+
})
|
|
4836
|
+
});
|
|
4837
|
+
if (!a.ok) throw Error(`Upload error: ${a.status} ${a.statusText}`);
|
|
4838
|
+
let o = await a.json();
|
|
4839
|
+
if (!o.success) throw Error(o.error ?? "Upload failed");
|
|
4840
|
+
return { url: o.data.url };
|
|
4841
|
+
}
|
|
4774
4842
|
async fetchWidgetConfig(e, t) {
|
|
4775
4843
|
try {
|
|
4776
4844
|
let n = t ? `?tenantId=${encodeURIComponent(t)}` : "", r = await fetch(this.channel(`${this.baseUrl}/v1/agents/${encodeURIComponent(e)}/widget-config${n}`), { credentials: this.credentials });
|
|
@@ -4801,7 +4869,7 @@ var Ei = class {
|
|
|
4801
4869
|
};
|
|
4802
4870
|
//#endregion
|
|
4803
4871
|
//#region ../../packages/widget-sdk/src/api/sse-reader.ts
|
|
4804
|
-
async function*
|
|
4872
|
+
async function* ki(e, t) {
|
|
4805
4873
|
if (!e.body) return;
|
|
4806
4874
|
let n = e.body.getReader(), r = new TextDecoder(), i = "", a = () => {
|
|
4807
4875
|
if (!t) return n.read();
|
|
@@ -4828,14 +4896,17 @@ async function* Di(e, t) {
|
|
|
4828
4896
|
}
|
|
4829
4897
|
//#endregion
|
|
4830
4898
|
//#region ../../packages/widget-sdk/src/api/stream.ts
|
|
4831
|
-
var
|
|
4832
|
-
async function
|
|
4899
|
+
var Ai = 12e4;
|
|
4900
|
+
async function ji(e, t, n, r = {}) {
|
|
4833
4901
|
let i = "", a = !1;
|
|
4834
4902
|
try {
|
|
4835
|
-
let o = await fetch(
|
|
4903
|
+
let o = await fetch(Di(`${e}/v1/agents/${encodeURIComponent(t.agentId)}/responses:stream`, r), {
|
|
4836
4904
|
method: "POST",
|
|
4837
|
-
credentials:
|
|
4838
|
-
headers: {
|
|
4905
|
+
credentials: Ti(r),
|
|
4906
|
+
headers: {
|
|
4907
|
+
"Content-Type": "application/json",
|
|
4908
|
+
...Ei(r)
|
|
4909
|
+
},
|
|
4839
4910
|
body: JSON.stringify({
|
|
4840
4911
|
message: t.message,
|
|
4841
4912
|
sessionId: t.sessionId,
|
|
@@ -4880,6 +4951,10 @@ async function ki(e, t, n, r = {}) {
|
|
|
4880
4951
|
let e = t.documents;
|
|
4881
4952
|
return e && n.onDocuments && n.onDocuments(e), !1;
|
|
4882
4953
|
}
|
|
4954
|
+
if (t.type === "voice_transcript") {
|
|
4955
|
+
let e = t.transcript;
|
|
4956
|
+
return e && n.onVoiceTranscript && n.onVoiceTranscript(e), !1;
|
|
4957
|
+
}
|
|
4883
4958
|
if (t.type === "control_mode") {
|
|
4884
4959
|
let e = t.mode, r = !!t.queued;
|
|
4885
4960
|
return e && n.onControlMode && n.onControlMode(e, r), r ? (n.onEnd(i), !0) : !1;
|
|
@@ -4914,20 +4989,20 @@ async function ki(e, t, n, r = {}) {
|
|
|
4914
4989
|
}
|
|
4915
4990
|
return !1;
|
|
4916
4991
|
}
|
|
4917
|
-
let r =
|
|
4992
|
+
let r = Mi(t);
|
|
4918
4993
|
r && (i += r, n.onDelta(r, i));
|
|
4919
4994
|
} catch (e) {
|
|
4920
4995
|
if (!(e instanceof SyntaxError)) throw e;
|
|
4921
4996
|
}
|
|
4922
4997
|
return !1;
|
|
4923
4998
|
};
|
|
4924
|
-
for await (let e of
|
|
4999
|
+
for await (let e of ki(o, Ai)) if (l(e)) break;
|
|
4925
5000
|
n.onEnd(i);
|
|
4926
5001
|
} catch (e) {
|
|
4927
5002
|
n.onError(e instanceof Error ? e : Error(String(e)));
|
|
4928
5003
|
}
|
|
4929
5004
|
}
|
|
4930
|
-
function
|
|
5005
|
+
function Mi(e) {
|
|
4931
5006
|
let t = e.choices;
|
|
4932
5007
|
if (Array.isArray(t) && t.length > 0) {
|
|
4933
5008
|
let e = t[0]?.delta, n = e?.content ?? e?.text ?? "";
|
|
@@ -4942,26 +5017,26 @@ function Ai(e) {
|
|
|
4942
5017
|
}
|
|
4943
5018
|
//#endregion
|
|
4944
5019
|
//#region ../../packages/widget-sdk/src/api/reconnect.ts
|
|
4945
|
-
function
|
|
5020
|
+
function Ni(e, t, n) {
|
|
4946
5021
|
let r = t * 2 ** (e - 1), i = Math.min(r, n), a = i * .3;
|
|
4947
5022
|
return Math.floor(i - a + a * 2 * Math.random());
|
|
4948
5023
|
}
|
|
4949
|
-
async function
|
|
5024
|
+
async function Pi(e, t, n, r = {}) {
|
|
4950
5025
|
let i = await fetch(`${e}/v1/sessions/${encodeURIComponent(t)}/runs/${encodeURIComponent(n)}`, { credentials: r.preview ? "include" : "same-origin" });
|
|
4951
5026
|
if (!i.ok) throw Error(`Failed to fetch run ${n}: ${i.status}`);
|
|
4952
5027
|
let a = await i.json();
|
|
4953
5028
|
if (!a.success || !a.data) throw Error(a.error ?? `Failed to fetch run ${n}`);
|
|
4954
5029
|
return a.data;
|
|
4955
5030
|
}
|
|
4956
|
-
async function
|
|
5031
|
+
async function Fi(e, t, n, r = {}) {
|
|
4957
5032
|
let i = r.maxAttempts ?? 3, a;
|
|
4958
5033
|
for (let o = 1; o <= i; o++) {
|
|
4959
5034
|
if (o > 1) {
|
|
4960
|
-
let e =
|
|
5035
|
+
let e = Ni(o - 1, 500, 4e3);
|
|
4961
5036
|
await new Promise((t) => setTimeout(t, e));
|
|
4962
5037
|
}
|
|
4963
5038
|
try {
|
|
4964
|
-
let a = await
|
|
5039
|
+
let a = await Pi(e, t, n, r);
|
|
4965
5040
|
if (a.status !== "running" || o === i) return a;
|
|
4966
5041
|
} catch (e) {
|
|
4967
5042
|
if (a = e instanceof Error ? e : Error(String(e)), o === i) throw a;
|
|
@@ -4970,8 +5045,56 @@ async function Ni(e, t, n, r = {}) {
|
|
|
4970
5045
|
throw a ?? /* @__PURE__ */ Error(`Failed to fetch run ${n}`);
|
|
4971
5046
|
}
|
|
4972
5047
|
//#endregion
|
|
5048
|
+
//#region ../../packages/widget-sdk/src/api/turnstile.ts
|
|
5049
|
+
var Ii = 15e3, Q, Li, Ri, zi, Bi = [];
|
|
5050
|
+
function Vi() {
|
|
5051
|
+
zi || (zi = (e) => {
|
|
5052
|
+
if (!Q || e.source !== Q.contentWindow || Ri && e.origin !== Ri) return;
|
|
5053
|
+
let t = e.data;
|
|
5054
|
+
!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")));
|
|
5055
|
+
}, window.addEventListener("message", zi));
|
|
5056
|
+
}
|
|
5057
|
+
function Hi() {
|
|
5058
|
+
Q?.remove(), Q = void 0, Li = void 0;
|
|
5059
|
+
}
|
|
5060
|
+
function Ui(e) {
|
|
5061
|
+
if (Q && Li) return Li;
|
|
5062
|
+
if (typeof window > "u" || typeof document > "u") return Promise.reject(/* @__PURE__ */ Error("Turnstile requires a browser environment"));
|
|
5063
|
+
Vi(), Ri = new URL(e).origin;
|
|
5064
|
+
let t = document.createElement("iframe");
|
|
5065
|
+
return t.src = `${e.replace(/\/$/, "")}/v1/widget/turnstile-challenge`, t.style.display = "none", t.setAttribute("aria-hidden", "true"), t.sandbox.add("allow-scripts", "allow-same-origin"), Li = new Promise((e, n) => {
|
|
5066
|
+
let r = setTimeout(() => {
|
|
5067
|
+
window.removeEventListener("message", i), n(/* @__PURE__ */ Error("Turnstile challenge page failed to load"));
|
|
5068
|
+
}, Ii);
|
|
5069
|
+
function i(n) {
|
|
5070
|
+
n.source === t.contentWindow && n.data?.type === "turnstile-ready" && (clearTimeout(r), window.removeEventListener("message", i), e());
|
|
5071
|
+
}
|
|
5072
|
+
window.addEventListener("message", i);
|
|
5073
|
+
}).catch((e) => {
|
|
5074
|
+
throw Hi(), e;
|
|
5075
|
+
}), Q = t, document.body.appendChild(t), Li;
|
|
5076
|
+
}
|
|
5077
|
+
async function Wi(e) {
|
|
5078
|
+
if (await Ui(e), !Q?.contentWindow) throw Error("Turnstile challenge frame unavailable");
|
|
5079
|
+
let t = Q.contentWindow, n = Ri;
|
|
5080
|
+
return new Promise((e, r) => {
|
|
5081
|
+
let i = {
|
|
5082
|
+
resolve: (t) => {
|
|
5083
|
+
clearTimeout(a), e(t);
|
|
5084
|
+
},
|
|
5085
|
+
reject: (e) => {
|
|
5086
|
+
clearTimeout(a), r(e);
|
|
5087
|
+
}
|
|
5088
|
+
}, a = setTimeout(() => {
|
|
5089
|
+
let e = Bi.indexOf(i);
|
|
5090
|
+
e !== -1 && Bi.splice(e, 1), r(/* @__PURE__ */ Error("Turnstile verification timed out"));
|
|
5091
|
+
}, Ii);
|
|
5092
|
+
Bi.push(i), t.postMessage({ type: "turnstile-solve" }, n);
|
|
5093
|
+
});
|
|
5094
|
+
}
|
|
5095
|
+
//#endregion
|
|
4973
5096
|
//#region ../../packages/widget-sdk/src/events/emitter.ts
|
|
4974
|
-
var
|
|
5097
|
+
var Gi = class {
|
|
4975
5098
|
listeners = /* @__PURE__ */ new Map();
|
|
4976
5099
|
on(e, t) {
|
|
4977
5100
|
this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(t);
|
|
@@ -4986,30 +5109,30 @@ var Pi = class {
|
|
|
4986
5109
|
removeAllListeners() {
|
|
4987
5110
|
this.listeners.clear();
|
|
4988
5111
|
}
|
|
4989
|
-
},
|
|
4990
|
-
function
|
|
4991
|
-
return `${
|
|
5112
|
+
}, Ki = "agentforge";
|
|
5113
|
+
function qi(e) {
|
|
5114
|
+
return `${Ki}:session:${e}`;
|
|
4992
5115
|
}
|
|
4993
|
-
function
|
|
5116
|
+
function Ji(e) {
|
|
4994
5117
|
try {
|
|
4995
|
-
return sessionStorage.getItem(
|
|
5118
|
+
return sessionStorage.getItem(qi(e)) ?? void 0;
|
|
4996
5119
|
} catch {
|
|
4997
5120
|
return;
|
|
4998
5121
|
}
|
|
4999
5122
|
}
|
|
5000
|
-
function
|
|
5123
|
+
function Yi(e, t) {
|
|
5001
5124
|
try {
|
|
5002
|
-
sessionStorage.setItem(
|
|
5125
|
+
sessionStorage.setItem(qi(e), t);
|
|
5003
5126
|
} catch {}
|
|
5004
5127
|
}
|
|
5005
|
-
function
|
|
5128
|
+
function Xi(e) {
|
|
5006
5129
|
try {
|
|
5007
|
-
sessionStorage.removeItem(
|
|
5130
|
+
sessionStorage.removeItem(qi(e));
|
|
5008
5131
|
} catch {}
|
|
5009
5132
|
}
|
|
5010
5133
|
//#endregion
|
|
5011
5134
|
//#region ../../packages/widget-sdk/src/progress-trail.ts
|
|
5012
|
-
function
|
|
5135
|
+
function Zi(e, t, n) {
|
|
5013
5136
|
return e.map((e) => {
|
|
5014
5137
|
if (e.status !== "active" || e.stage === "calling_tool") return e;
|
|
5015
5138
|
let r = n !== void 0 && e.serverTsMs !== void 0 && Number.isFinite(n) && Number.isFinite(e.serverTsMs) && n >= e.serverTsMs ? n - e.serverTsMs : void 0;
|
|
@@ -5020,7 +5143,7 @@ function Bi(e, t, n) {
|
|
|
5020
5143
|
};
|
|
5021
5144
|
});
|
|
5022
5145
|
}
|
|
5023
|
-
function
|
|
5146
|
+
function Qi(e) {
|
|
5024
5147
|
let t = Date.now();
|
|
5025
5148
|
return e.map((e) => e.status === "active" ? {
|
|
5026
5149
|
...e,
|
|
@@ -5028,7 +5151,7 @@ function Vi(e) {
|
|
|
5028
5151
|
durationMs: e.durationMs ?? (e.startedAtMs ? t - e.startedAtMs : void 0)
|
|
5029
5152
|
} : e);
|
|
5030
5153
|
}
|
|
5031
|
-
function
|
|
5154
|
+
function $i(e) {
|
|
5032
5155
|
if (e == null || e < 1e3) return null;
|
|
5033
5156
|
if (e < 1e4) return `${(e / 1e3).toFixed(1)}s`;
|
|
5034
5157
|
if (e < 6e4) return `${Math.round(e / 1e3)}s`;
|
|
@@ -5036,13 +5159,32 @@ function Hi(e) {
|
|
|
5036
5159
|
return n > 0 ? `${t}m ${n}s` : `${t}m`;
|
|
5037
5160
|
}
|
|
5038
5161
|
//#endregion
|
|
5162
|
+
//#region ../../packages/widget-sdk/src/voice-transcript.ts
|
|
5163
|
+
var ea = "[Voice note] ";
|
|
5164
|
+
function ta(e, t) {
|
|
5165
|
+
let n = t?.trim();
|
|
5166
|
+
return n ? `${ea}${e}\n\n${n}` : `${ea}${e}`;
|
|
5167
|
+
}
|
|
5168
|
+
function na(e) {
|
|
5169
|
+
if (!e.startsWith("[Voice note] ")) return null;
|
|
5170
|
+
let t = e.slice(13), n = t.indexOf("\n\n");
|
|
5171
|
+
return n === -1 ? {
|
|
5172
|
+
transcript: t,
|
|
5173
|
+
rest: ""
|
|
5174
|
+
} : {
|
|
5175
|
+
transcript: t.slice(0, n),
|
|
5176
|
+
rest: t.slice(n + 2)
|
|
5177
|
+
};
|
|
5178
|
+
}
|
|
5179
|
+
//#endregion
|
|
5039
5180
|
//#region ../../packages/widget-sdk/src/create-client.ts
|
|
5040
|
-
function
|
|
5181
|
+
function ra() {
|
|
5041
5182
|
return `msg-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 7)}`;
|
|
5042
5183
|
}
|
|
5043
|
-
var
|
|
5184
|
+
var ia = 2e3, aa = class {
|
|
5044
5185
|
hostConfig;
|
|
5045
5186
|
onStateChange;
|
|
5187
|
+
sessionTokenPromise;
|
|
5046
5188
|
config;
|
|
5047
5189
|
apiClient;
|
|
5048
5190
|
state;
|
|
@@ -5050,12 +5192,12 @@ var Wi = class {
|
|
|
5050
5192
|
eventSource = null;
|
|
5051
5193
|
emitter;
|
|
5052
5194
|
constructor(e, t, n) {
|
|
5053
|
-
this.hostConfig = t, this.onStateChange = n, this.config = e, this.apiClient = new
|
|
5195
|
+
this.hostConfig = t, this.onStateChange = n, this.config = e, this.apiClient = new Oi(e.apiBaseUrl, {
|
|
5054
5196
|
preview: e.preview,
|
|
5055
5197
|
configChannel: e.configChannel
|
|
5056
|
-
}), this.emitter = new
|
|
5057
|
-
let r = e.sessionId ??
|
|
5058
|
-
e.sessionId &&
|
|
5198
|
+
}), this.emitter = new Gi(), this.initializeFingerprint();
|
|
5199
|
+
let r = e.sessionId ?? Ji(e.agentId);
|
|
5200
|
+
e.sessionId && Yi(e.agentId, e.sessionId);
|
|
5059
5201
|
let i = e.mode === "inline";
|
|
5060
5202
|
this.state = {
|
|
5061
5203
|
isOpen: i,
|
|
@@ -5085,7 +5227,7 @@ var Wi = class {
|
|
|
5085
5227
|
}
|
|
5086
5228
|
async initializeFingerprint() {
|
|
5087
5229
|
try {
|
|
5088
|
-
let e = await (await
|
|
5230
|
+
let e = await (await wi.load()).get();
|
|
5089
5231
|
this.fingerprint = e.visitorId;
|
|
5090
5232
|
} catch {
|
|
5091
5233
|
this.fingerprint = void 0;
|
|
@@ -5098,7 +5240,7 @@ var Wi = class {
|
|
|
5098
5240
|
};
|
|
5099
5241
|
}
|
|
5100
5242
|
setOpen(e) {
|
|
5101
|
-
e ? this.openWithGreeting() : this.setState({ isOpen: !1 });
|
|
5243
|
+
e ? (this.ensureSessionToken(), this.openWithGreeting()) : this.setState({ isOpen: !1 });
|
|
5102
5244
|
}
|
|
5103
5245
|
openWithGreeting() {
|
|
5104
5246
|
this.state.initStatus === "error" || this.state.initStatus === "disabled" || this.setState({ isOpen: !0 });
|
|
@@ -5136,10 +5278,10 @@ var Wi = class {
|
|
|
5136
5278
|
url: e.url,
|
|
5137
5279
|
mimeType: e.mimeType,
|
|
5138
5280
|
fileName: e.fileName,
|
|
5139
|
-
kind: e.mimeType.startsWith("image/") ? "image" : "file"
|
|
5281
|
+
kind: e.mimeType.startsWith("image/") ? "image" : e.mimeType.startsWith("audio/") ? "audio" : "file"
|
|
5140
5282
|
})) : void 0;
|
|
5141
5283
|
return {
|
|
5142
|
-
id:
|
|
5284
|
+
id: ra(),
|
|
5143
5285
|
role: e.role,
|
|
5144
5286
|
content: e.content,
|
|
5145
5287
|
images: !n && e.images && e.images.length > 0 ? e.images : void 0,
|
|
@@ -5176,7 +5318,7 @@ var Wi = class {
|
|
|
5176
5318
|
if (typeof e.content != "string" || e.id && this.state.messages.some((t) => t.id === e.id)) return;
|
|
5177
5319
|
if (e.direction === "human") {
|
|
5178
5320
|
let t = {
|
|
5179
|
-
id: e.id ??
|
|
5321
|
+
id: e.id ?? ra(),
|
|
5180
5322
|
role: "assistant",
|
|
5181
5323
|
content: e.content,
|
|
5182
5324
|
createdAt: e.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -5192,7 +5334,7 @@ var Wi = class {
|
|
|
5192
5334
|
}
|
|
5193
5335
|
if (e.direction === "ai") {
|
|
5194
5336
|
let t = {
|
|
5195
|
-
id: e.id ??
|
|
5337
|
+
id: e.id ?? ra(),
|
|
5196
5338
|
role: "assistant",
|
|
5197
5339
|
content: e.content,
|
|
5198
5340
|
createdAt: e.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -5230,7 +5372,7 @@ var Wi = class {
|
|
|
5230
5372
|
if (this.state.sessionId) try {
|
|
5231
5373
|
await this.apiClient.endSession(this.state.sessionId, this.config.tenantId, this.config.agentId, this.fingerprint, this.config.user.externalId, !0);
|
|
5232
5374
|
} catch {}
|
|
5233
|
-
|
|
5375
|
+
Xi(this.config.agentId), this.closeEventStream(), this.setState({
|
|
5234
5376
|
sessionId: void 0,
|
|
5235
5377
|
messages: [],
|
|
5236
5378
|
isLoading: !1,
|
|
@@ -5239,7 +5381,7 @@ var Wi = class {
|
|
|
5239
5381
|
}), this.emitter.emit("reset", void 0), this.state.isOpen && this.openWithGreeting();
|
|
5240
5382
|
}
|
|
5241
5383
|
handleSessionExpired() {
|
|
5242
|
-
|
|
5384
|
+
Xi(this.config.agentId), this.closeEventStream(), this.setState({
|
|
5243
5385
|
sessionId: void 0,
|
|
5244
5386
|
controlMode: void 0
|
|
5245
5387
|
});
|
|
@@ -5249,7 +5391,7 @@ var Wi = class {
|
|
|
5249
5391
|
if (this.state.isLoading || !n || this.state.initStatus !== "ready") return;
|
|
5250
5392
|
let r = [];
|
|
5251
5393
|
if (t && t.length > 0) for (let e of t) try {
|
|
5252
|
-
let t = await
|
|
5394
|
+
let t = await sa(e.file);
|
|
5253
5395
|
if (e.kind === "image") {
|
|
5254
5396
|
let n = await this.apiClient.uploadImage(t, e.file.type, e.file.name, this.config.agentId, this.config.tenantId);
|
|
5255
5397
|
r.push({
|
|
@@ -5258,6 +5400,15 @@ var Wi = class {
|
|
|
5258
5400
|
fileName: e.file.name,
|
|
5259
5401
|
kind: "image"
|
|
5260
5402
|
});
|
|
5403
|
+
} else if (e.kind === "audio") {
|
|
5404
|
+
let n = await this.apiClient.uploadVoiceNote(t, e.file.type || "audio/webm", e.file.name, this.config.agentId, this.config.tenantId);
|
|
5405
|
+
r.push({
|
|
5406
|
+
url: n.url,
|
|
5407
|
+
mimeType: e.file.type || "audio/webm",
|
|
5408
|
+
fileName: e.file.name,
|
|
5409
|
+
durationMs: e.durationMs,
|
|
5410
|
+
kind: "audio"
|
|
5411
|
+
});
|
|
5261
5412
|
} else {
|
|
5262
5413
|
let n = await this.apiClient.uploadFile(t, e.file.type || "application/octet-stream", e.file.name, this.config.agentId, this.config.tenantId);
|
|
5263
5414
|
r.push({
|
|
@@ -5273,7 +5424,7 @@ var Wi = class {
|
|
|
5273
5424
|
return;
|
|
5274
5425
|
}
|
|
5275
5426
|
let i = r.filter((e) => e.kind === "image"), a = {
|
|
5276
|
-
id:
|
|
5427
|
+
id: ra(),
|
|
5277
5428
|
role: "user",
|
|
5278
5429
|
content: e.trim(),
|
|
5279
5430
|
uploadedImageUrl: i[0]?.url,
|
|
@@ -5289,7 +5440,25 @@ var Wi = class {
|
|
|
5289
5440
|
let s = r.length > 0 ? r : void 0;
|
|
5290
5441
|
this.config.streaming ? await this.sendStreaming(e.trim(), void 0, s) : await this.sendNonStreaming(e.trim(), void 0, s);
|
|
5291
5442
|
}
|
|
5443
|
+
ensureSessionToken() {
|
|
5444
|
+
return !this.config.turnstileSiteKey || this.apiClient.hasValidSessionToken() ? Promise.resolve() : (this.sessionTokenPromise ??= (async () => {
|
|
5445
|
+
try {
|
|
5446
|
+
let e = await Wi(this.config.apiBaseUrl);
|
|
5447
|
+
await this.apiClient.establishSession(this.config.agentId, this.config.tenantId, e);
|
|
5448
|
+
} catch {} finally {
|
|
5449
|
+
this.sessionTokenPromise = void 0;
|
|
5450
|
+
}
|
|
5451
|
+
})(), this.sessionTokenPromise);
|
|
5452
|
+
}
|
|
5453
|
+
async awaitSessionToken() {
|
|
5454
|
+
if (!this.config.turnstileSiteKey || this.apiClient.hasValidSessionToken()) return;
|
|
5455
|
+
let e;
|
|
5456
|
+
await Promise.race([this.ensureSessionToken(), new Promise((t) => {
|
|
5457
|
+
e = setTimeout(t, ia);
|
|
5458
|
+
})]).finally(() => clearTimeout(e));
|
|
5459
|
+
}
|
|
5292
5460
|
async sendNonStreaming(e, t, n, r = !1) {
|
|
5461
|
+
await this.awaitSessionToken();
|
|
5293
5462
|
try {
|
|
5294
5463
|
let r = await this.apiClient.chat({
|
|
5295
5464
|
agentId: this.config.agentId,
|
|
@@ -5310,11 +5479,11 @@ var Wi = class {
|
|
|
5310
5479
|
isLoading: !1,
|
|
5311
5480
|
controlMode: "human_takeover",
|
|
5312
5481
|
...r.sessionId ? { sessionId: r.sessionId } : {}
|
|
5313
|
-
}), r.sessionId && (
|
|
5482
|
+
}), r.sessionId && (Yi(this.config.agentId, r.sessionId), this.openEventStream());
|
|
5314
5483
|
return;
|
|
5315
5484
|
}
|
|
5316
5485
|
let i = {
|
|
5317
|
-
id:
|
|
5486
|
+
id: ra(),
|
|
5318
5487
|
role: "assistant",
|
|
5319
5488
|
content: r.content,
|
|
5320
5489
|
images: r.images,
|
|
@@ -5326,7 +5495,7 @@ var Wi = class {
|
|
|
5326
5495
|
messages: [...this.state.messages, i],
|
|
5327
5496
|
isLoading: !1,
|
|
5328
5497
|
...r.sessionId ? { sessionId: r.sessionId } : {}
|
|
5329
|
-
}), r.sessionId && (
|
|
5498
|
+
}), r.sessionId && (Yi(this.config.agentId, r.sessionId), this.openEventStream()), this.emitter.emit("message:received", i);
|
|
5330
5499
|
} catch (i) {
|
|
5331
5500
|
let a = i instanceof Error ? i.message : "Failed to send message";
|
|
5332
5501
|
if (!r && a.includes("410")) return this.handleSessionExpired(), this.sendNonStreaming(e, t, n, !0);
|
|
@@ -5340,7 +5509,8 @@ var Wi = class {
|
|
|
5340
5509
|
}
|
|
5341
5510
|
}
|
|
5342
5511
|
async sendStreaming(e, t, n, r = !1) {
|
|
5343
|
-
|
|
5512
|
+
await this.awaitSessionToken();
|
|
5513
|
+
let i = ra(), a = {
|
|
5344
5514
|
id: i,
|
|
5345
5515
|
role: "assistant",
|
|
5346
5516
|
content: "",
|
|
@@ -5349,7 +5519,7 @@ var Wi = class {
|
|
|
5349
5519
|
};
|
|
5350
5520
|
this.setState({ messages: [...this.state.messages, a] }), this.emitter.emit("stream:start");
|
|
5351
5521
|
let o = !1, s = !1, c = null, l = null, u = Date.now(), d = null;
|
|
5352
|
-
await
|
|
5522
|
+
await ji(this.config.apiBaseUrl, {
|
|
5353
5523
|
agentId: this.config.agentId,
|
|
5354
5524
|
message: e,
|
|
5355
5525
|
sessionId: this.state.sessionId,
|
|
@@ -5364,7 +5534,7 @@ var Wi = class {
|
|
|
5364
5534
|
attachments: n
|
|
5365
5535
|
}, {
|
|
5366
5536
|
onSession: (e) => {
|
|
5367
|
-
this.setState({ sessionId: e }),
|
|
5537
|
+
this.setState({ sessionId: e }), Yi(this.config.agentId, e), this.openEventStream();
|
|
5368
5538
|
},
|
|
5369
5539
|
onRunId: (e) => {
|
|
5370
5540
|
this.updateMessage(i, { runId: e });
|
|
@@ -5375,8 +5545,12 @@ var Wi = class {
|
|
|
5375
5545
|
onDocuments: (e) => {
|
|
5376
5546
|
this.updateMessage(i, { documents: e });
|
|
5377
5547
|
},
|
|
5548
|
+
onVoiceTranscript: (e) => {
|
|
5549
|
+
let t = [...this.state.messages].reverse().find((e) => e.role === "user");
|
|
5550
|
+
t && this.updateMessage(t.id, { content: ta(e, t.content) });
|
|
5551
|
+
},
|
|
5378
5552
|
onToolCallsStarted: (e, t) => {
|
|
5379
|
-
t && c === null && (c = t), d = null, this.updateMessage(i, { answerStartedAtMs: null }), (t ?? c) !== "off" && this.updateMessage(i, { toolStatus:
|
|
5553
|
+
t && c === null && (c = t), d = null, this.updateMessage(i, { answerStartedAtMs: null }), (t ?? c) !== "off" && this.updateMessage(i, { toolStatus: oa(e) });
|
|
5380
5554
|
},
|
|
5381
5555
|
onAck: (e) => {
|
|
5382
5556
|
this.updateMessage(i, { ackText: e });
|
|
@@ -5387,7 +5561,7 @@ var Wi = class {
|
|
|
5387
5561
|
totalMs: null,
|
|
5388
5562
|
collapseAfterFinal: null,
|
|
5389
5563
|
mode: n
|
|
5390
|
-
} })), this.updateMessage(i, { progressEvents: [...
|
|
5564
|
+
} })), this.updateMessage(i, { progressEvents: [...Zi(a, o, l), {
|
|
5391
5565
|
stage: e,
|
|
5392
5566
|
text: t,
|
|
5393
5567
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -5402,7 +5576,7 @@ var Wi = class {
|
|
|
5402
5576
|
totalMs: null,
|
|
5403
5577
|
collapseAfterFinal: null,
|
|
5404
5578
|
mode: r
|
|
5405
|
-
} })), this.updateMessage(i, { progressEvents: [...
|
|
5579
|
+
} })), this.updateMessage(i, { progressEvents: [...Zi(o, s, u), {
|
|
5406
5580
|
stage: "calling_tool",
|
|
5407
5581
|
toolId: e,
|
|
5408
5582
|
toolName: n,
|
|
@@ -5449,7 +5623,7 @@ var Wi = class {
|
|
|
5449
5623
|
content: e,
|
|
5450
5624
|
status: "sent",
|
|
5451
5625
|
toolStatus: void 0,
|
|
5452
|
-
progressEvents: n && t?.progressEvents?.length ?
|
|
5626
|
+
progressEvents: n && t?.progressEvents?.length ? Qi(t.progressEvents) : void 0,
|
|
5453
5627
|
progressCollapsed: n ? l ?? !0 : void 0,
|
|
5454
5628
|
turnMeta: r ? {
|
|
5455
5629
|
totalMs: (d ?? Date.now()) - u,
|
|
@@ -5494,7 +5668,7 @@ var Wi = class {
|
|
|
5494
5668
|
t && this.emitter.emit("message:received", t);
|
|
5495
5669
|
}, a = this.state.messages.find((e) => e.id === i)?.runId, s = this.state.sessionId;
|
|
5496
5670
|
if (a && s) {
|
|
5497
|
-
|
|
5671
|
+
Fi(this.config.apiBaseUrl, s, a, { preview: this.config.preview }).then((r) => {
|
|
5498
5672
|
r.status === "done" && r.finalText ? n(r.finalText) : t(r.errorMessage || e.message || "Something went wrong. Please try again.");
|
|
5499
5673
|
}).catch(() => t(e.message || "Something went wrong. Please try again."));
|
|
5500
5674
|
return;
|
|
@@ -5503,17 +5677,18 @@ var Wi = class {
|
|
|
5503
5677
|
}
|
|
5504
5678
|
}, {
|
|
5505
5679
|
preview: this.config.preview,
|
|
5506
|
-
configChannel: this.config.configChannel
|
|
5680
|
+
configChannel: this.config.configChannel,
|
|
5681
|
+
sessionToken: this.apiClient.getSessionToken()
|
|
5507
5682
|
}), o && (this.handleSessionExpired(), await this.sendStreaming(e, t, n, !0));
|
|
5508
5683
|
}
|
|
5509
5684
|
};
|
|
5510
|
-
function
|
|
5685
|
+
function oa(e) {
|
|
5511
5686
|
let t = e[0];
|
|
5512
5687
|
if (!t) return "Working...";
|
|
5513
5688
|
let n = t.indexOf(".");
|
|
5514
5689
|
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, " ")}`;
|
|
5515
5690
|
}
|
|
5516
|
-
function
|
|
5691
|
+
function sa(e) {
|
|
5517
5692
|
return new Promise((t, n) => {
|
|
5518
5693
|
let r = new FileReader();
|
|
5519
5694
|
r.onload = () => {
|
|
@@ -5524,7 +5699,7 @@ function Ki(e) {
|
|
|
5524
5699
|
}
|
|
5525
5700
|
//#endregion
|
|
5526
5701
|
//#region ../../packages/widget-sdk/src/dom/shadow-root.ts
|
|
5527
|
-
function
|
|
5702
|
+
function ca(e) {
|
|
5528
5703
|
let t = document.createElement("div");
|
|
5529
5704
|
t.setAttribute("data-agentkit-widget", ""), e.appendChild(t);
|
|
5530
5705
|
let n = t.attachShadow({ mode: "open" }), r = document.createElement("style");
|
|
@@ -5537,18 +5712,18 @@ function qi(e) {
|
|
|
5537
5712
|
mountPoint: i
|
|
5538
5713
|
};
|
|
5539
5714
|
}
|
|
5540
|
-
function
|
|
5715
|
+
function la(e, t) {
|
|
5541
5716
|
e.textContent = t;
|
|
5542
5717
|
}
|
|
5543
|
-
function
|
|
5718
|
+
function ua(e) {
|
|
5544
5719
|
e.remove();
|
|
5545
5720
|
}
|
|
5546
5721
|
//#endregion
|
|
5547
5722
|
//#region ../../packages/widget-sdk/src/dom/mount.ts
|
|
5548
|
-
function
|
|
5723
|
+
function da(e) {
|
|
5549
5724
|
document.body ? document.body.appendChild(e) : document.addEventListener("DOMContentLoaded", () => document.body.appendChild(e), { once: !0 });
|
|
5550
5725
|
}
|
|
5551
|
-
function
|
|
5726
|
+
function fa() {
|
|
5552
5727
|
let e = document.createElement("div");
|
|
5553
5728
|
return e.setAttribute("data-agentkit-root", "floating"), e.style.cssText = [
|
|
5554
5729
|
"position: fixed",
|
|
@@ -5556,9 +5731,9 @@ function Zi() {
|
|
|
5556
5731
|
"right: 24px",
|
|
5557
5732
|
"z-index: 2147483647",
|
|
5558
5733
|
"pointer-events: none"
|
|
5559
|
-
].join("; "),
|
|
5734
|
+
].join("; "), da(e), e;
|
|
5560
5735
|
}
|
|
5561
|
-
function
|
|
5736
|
+
function pa(e) {
|
|
5562
5737
|
getComputedStyle(e).position === "static" && (e.style.position = "relative");
|
|
5563
5738
|
let t = document.createElement("div");
|
|
5564
5739
|
return t.setAttribute("data-agentkit-root", "floating"), t.style.cssText = [
|
|
@@ -5569,21 +5744,21 @@ function Qi(e) {
|
|
|
5569
5744
|
"pointer-events: none"
|
|
5570
5745
|
].join("; "), e.appendChild(t), t;
|
|
5571
5746
|
}
|
|
5572
|
-
function
|
|
5747
|
+
function ma(e) {
|
|
5573
5748
|
return e.setAttribute("data-agentkit-root", "inline"), getComputedStyle(e).position === "static" && (e.style.position = "relative"), e;
|
|
5574
5749
|
}
|
|
5575
|
-
function
|
|
5750
|
+
function ha(e) {
|
|
5576
5751
|
e.remove();
|
|
5577
5752
|
}
|
|
5578
|
-
function
|
|
5753
|
+
function ga(e) {
|
|
5579
5754
|
e.removeAttribute("data-agentkit-root");
|
|
5580
5755
|
}
|
|
5581
5756
|
//#endregion
|
|
5582
5757
|
//#region ../../packages/widget-sdk/src/create-widget.ts
|
|
5583
|
-
function
|
|
5584
|
-
let a = e.mode === "inline", o = !1, s = a && i ?
|
|
5585
|
-
|
|
5586
|
-
let l = new
|
|
5758
|
+
function _a(e, t, n, r, i) {
|
|
5759
|
+
let a = e.mode === "inline", o = !1, s = a && i ? ma(i) : !a && i ? pa(i) : fa(), c = ca(s);
|
|
5760
|
+
la(c.styleSlot, r);
|
|
5761
|
+
let l = new aa(e, t, (e, t) => {
|
|
5587
5762
|
o || u.update(e, t);
|
|
5588
5763
|
}), u = n(c.mountPoint, e, l.getState(), {
|
|
5589
5764
|
onOpen: () => d.open(),
|
|
@@ -5615,7 +5790,7 @@ function na(e, t, n, r, i) {
|
|
|
5615
5790
|
o || (l.resetConversation(), l.emitter.emit("reset"));
|
|
5616
5791
|
},
|
|
5617
5792
|
destroy() {
|
|
5618
|
-
o || (o = !0, l.closeEventStream(), u.destroy(),
|
|
5793
|
+
o || (o = !0, l.closeEventStream(), u.destroy(), ua(c.host), a && i ? ga(i) : ha(s), l.emitter.emit("destroy"), l.emitter.removeAllListeners());
|
|
5619
5794
|
},
|
|
5620
5795
|
on(e, t) {
|
|
5621
5796
|
l.emitter.on(e, t);
|
|
@@ -5631,43 +5806,43 @@ function na(e, t, n, r, i) {
|
|
|
5631
5806
|
}
|
|
5632
5807
|
//#endregion
|
|
5633
5808
|
//#region ../../packages/widget-sdk/src/init.ts
|
|
5634
|
-
var
|
|
5635
|
-
function
|
|
5636
|
-
let t = `agentkit-widget-${++
|
|
5809
|
+
var va = /* @__PURE__ */ new Map(), ya = 0;
|
|
5810
|
+
function ba(e) {
|
|
5811
|
+
let t = `agentkit-widget-${++ya}`, n = e.destroy.bind(e);
|
|
5637
5812
|
return e.destroy = () => {
|
|
5638
|
-
|
|
5639
|
-
},
|
|
5813
|
+
va.delete(t), n();
|
|
5814
|
+
}, va.set(t, e), t;
|
|
5640
5815
|
}
|
|
5641
|
-
function
|
|
5816
|
+
function xa(e, t, n) {
|
|
5642
5817
|
let r = {
|
|
5643
5818
|
...e,
|
|
5644
5819
|
mode: "floating"
|
|
5645
|
-
}, i =
|
|
5646
|
-
return
|
|
5820
|
+
}, i = _a(gt(r), r, t, n);
|
|
5821
|
+
return ba(i), i;
|
|
5647
5822
|
}
|
|
5648
|
-
function
|
|
5823
|
+
function Sa(e, t, n, r) {
|
|
5649
5824
|
let i = {
|
|
5650
5825
|
...t,
|
|
5651
5826
|
mode: "floating"
|
|
5652
|
-
}, a =
|
|
5653
|
-
return
|
|
5827
|
+
}, a = _a(gt(i), i, n, r, e);
|
|
5828
|
+
return ba(a), a;
|
|
5654
5829
|
}
|
|
5655
|
-
function
|
|
5830
|
+
function Ca(e, t, n, r) {
|
|
5656
5831
|
let i = {
|
|
5657
5832
|
...t,
|
|
5658
5833
|
mode: "inline"
|
|
5659
|
-
}, a =
|
|
5660
|
-
return
|
|
5834
|
+
}, a = _a(gt(i), i, n, r, e);
|
|
5835
|
+
return ba(a), a;
|
|
5661
5836
|
}
|
|
5662
|
-
function
|
|
5663
|
-
e ?
|
|
5837
|
+
function wa(e) {
|
|
5838
|
+
e ? va.get(e)?.destroy() : (va.forEach((e) => e.destroy()), va.clear());
|
|
5664
5839
|
}
|
|
5665
|
-
function
|
|
5666
|
-
return Array.from(
|
|
5840
|
+
function Ta() {
|
|
5841
|
+
return Array.from(va.keys());
|
|
5667
5842
|
}
|
|
5668
5843
|
//#endregion
|
|
5669
5844
|
//#region ../../packages/widget-ui/src/theme/tokens.ts
|
|
5670
|
-
function
|
|
5845
|
+
function Ea(e) {
|
|
5671
5846
|
let { theme: t } = e, n = [
|
|
5672
5847
|
`--ak-accent: ${t.accentColor}`,
|
|
5673
5848
|
`--ak-font: ${t.fontFamily}`,
|
|
@@ -5675,15 +5850,15 @@ function da(e) {
|
|
|
5675
5850
|
];
|
|
5676
5851
|
return n.push(`--ak-accent-hover: color-mix(in srgb, ${t.accentColor} 85%, black)`), `:host { ${n.join("; ")} }`;
|
|
5677
5852
|
}
|
|
5678
|
-
function
|
|
5853
|
+
function Da(e) {
|
|
5679
5854
|
return e === "system" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : e;
|
|
5680
5855
|
}
|
|
5681
5856
|
//#endregion
|
|
5682
5857
|
//#region ../../packages/widget-ui/src/theme/styles.ts
|
|
5683
|
-
var pa = "\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";
|
|
5858
|
+
var Oa = "\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/* ── 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, #e2e8f0);\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: #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: 16px; /* iOS zooms the page when a focused input is under 16px */\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/* Mic button — square with rounded corners, sibling of the \"+\" attach button */\n.ak-composer__mic {\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__mic:hover:not(:disabled) {\n color: var(--ak-accent);\n border-color: var(--ak-accent);\n}\n.ak-composer__mic:disabled {\n opacity: 0.4;\n cursor: not-allowed;\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: 2px 2px 2px 6px;\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: #ef4444;\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: 28px;\n height: 28px;\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-bg);\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 — 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";
|
|
5684
5859
|
//#endregion
|
|
5685
5860
|
//#region ../../packages/widget-ui/src/components/Header.tsx
|
|
5686
|
-
function
|
|
5861
|
+
function ka() {
|
|
5687
5862
|
return /* @__PURE__ */ l("svg", {
|
|
5688
5863
|
width: "16",
|
|
5689
5864
|
height: "16",
|
|
@@ -5722,7 +5897,7 @@ function ma() {
|
|
|
5722
5897
|
]
|
|
5723
5898
|
});
|
|
5724
5899
|
}
|
|
5725
|
-
function
|
|
5900
|
+
function Aa() {
|
|
5726
5901
|
return /* @__PURE__ */ l("svg", {
|
|
5727
5902
|
width: "14",
|
|
5728
5903
|
height: "14",
|
|
@@ -5744,7 +5919,7 @@ function ha() {
|
|
|
5744
5919
|
})]
|
|
5745
5920
|
});
|
|
5746
5921
|
}
|
|
5747
|
-
function
|
|
5922
|
+
function ja() {
|
|
5748
5923
|
return /* @__PURE__ */ l("svg", {
|
|
5749
5924
|
width: "16",
|
|
5750
5925
|
height: "16",
|
|
@@ -5757,7 +5932,7 @@ function ga() {
|
|
|
5757
5932
|
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" })]
|
|
5758
5933
|
});
|
|
5759
5934
|
}
|
|
5760
|
-
function
|
|
5935
|
+
function Ma({ title: e, subtitle: t, avatarUrl: n, onClose: r, onReset: i, hideClose: a = !1 }) {
|
|
5761
5936
|
let [s, u] = o(!1);
|
|
5762
5937
|
return /* @__PURE__ */ l("div", {
|
|
5763
5938
|
className: `ak-header${s ? " ak-header--confirming" : ""}`,
|
|
@@ -5772,7 +5947,7 @@ function _a({ title: e, subtitle: t, avatarUrl: n, onClose: r, onReset: i, hideC
|
|
|
5772
5947
|
}) : /* @__PURE__ */ c("span", {
|
|
5773
5948
|
className: "ak-header__bot-icon",
|
|
5774
5949
|
"aria-hidden": "true",
|
|
5775
|
-
children: /* @__PURE__ */ c(
|
|
5950
|
+
children: /* @__PURE__ */ c(ka, {})
|
|
5776
5951
|
}),
|
|
5777
5952
|
/* @__PURE__ */ l("div", {
|
|
5778
5953
|
className: "ak-header__title-group",
|
|
@@ -5801,14 +5976,14 @@ function _a({ title: e, subtitle: t, avatarUrl: n, onClose: r, onReset: i, hideC
|
|
|
5801
5976
|
"aria-label": "New conversation",
|
|
5802
5977
|
type: "button",
|
|
5803
5978
|
title: "Start a new conversation (Retains current conversation to memory)",
|
|
5804
|
-
children: /* @__PURE__ */ c(
|
|
5979
|
+
children: /* @__PURE__ */ c(ja, {})
|
|
5805
5980
|
}),
|
|
5806
5981
|
!a && /* @__PURE__ */ c("button", {
|
|
5807
5982
|
className: "ak-header__close",
|
|
5808
5983
|
onClick: r,
|
|
5809
5984
|
"aria-label": "Close chat",
|
|
5810
5985
|
type: "button",
|
|
5811
|
-
children: /* @__PURE__ */ c(
|
|
5986
|
+
children: /* @__PURE__ */ c(Aa, {})
|
|
5812
5987
|
})
|
|
5813
5988
|
]
|
|
5814
5989
|
})
|
|
@@ -5846,7 +6021,7 @@ function _a({ title: e, subtitle: t, avatarUrl: n, onClose: r, onReset: i, hideC
|
|
|
5846
6021
|
}
|
|
5847
6022
|
//#endregion
|
|
5848
6023
|
//#region ../../packages/widget-ui/src/lib/safe-url.ts
|
|
5849
|
-
function
|
|
6024
|
+
function Na(e) {
|
|
5850
6025
|
if (!e) return null;
|
|
5851
6026
|
let t = e.trim();
|
|
5852
6027
|
if (!t) return null;
|
|
@@ -5861,12 +6036,12 @@ function va(e) {
|
|
|
5861
6036
|
}
|
|
5862
6037
|
//#endregion
|
|
5863
6038
|
//#region ../../packages/widget-ui/src/lib/strip-latex.ts
|
|
5864
|
-
function
|
|
5865
|
-
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)
|
|
6039
|
+
function Pa(e) {
|
|
6040
|
+
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");
|
|
5866
6041
|
}
|
|
5867
6042
|
//#endregion
|
|
5868
6043
|
//#region ../../packages/widget-ui/src/components/ProgressBlock.tsx
|
|
5869
|
-
function
|
|
6044
|
+
function Fa(e) {
|
|
5870
6045
|
let [, t] = o(0);
|
|
5871
6046
|
r(() => {
|
|
5872
6047
|
if (!e) return;
|
|
@@ -5874,8 +6049,8 @@ function ba(e) {
|
|
|
5874
6049
|
return () => clearInterval(n);
|
|
5875
6050
|
}, [e]);
|
|
5876
6051
|
}
|
|
5877
|
-
var
|
|
5878
|
-
function
|
|
6052
|
+
var Ia = 800;
|
|
6053
|
+
function La({ up: e }) {
|
|
5879
6054
|
return /* @__PURE__ */ c("svg", {
|
|
5880
6055
|
width: "10",
|
|
5881
6056
|
height: "10",
|
|
@@ -5889,7 +6064,7 @@ function Sa({ up: e }) {
|
|
|
5889
6064
|
children: /* @__PURE__ */ c("polyline", { points: e ? "18 15 12 9 6 15" : "6 9 12 15 18 9" })
|
|
5890
6065
|
});
|
|
5891
6066
|
}
|
|
5892
|
-
function
|
|
6067
|
+
function Ra({ event: e, active: t }) {
|
|
5893
6068
|
return t ? /* @__PURE__ */ c("span", {
|
|
5894
6069
|
className: "ak-progress__spinner",
|
|
5895
6070
|
"aria-hidden": "true"
|
|
@@ -5917,18 +6092,18 @@ function Ca({ event: e, active: t }) {
|
|
|
5917
6092
|
})] }) : /* @__PURE__ */ c("polyline", { points: "20 6 9 17 4 12" })
|
|
5918
6093
|
});
|
|
5919
6094
|
}
|
|
5920
|
-
function
|
|
5921
|
-
|
|
6095
|
+
function za({ events: e, live: t, answerStartedAtMs: n }) {
|
|
6096
|
+
Fa(t && !n && e.some((e) => e.status === "active"));
|
|
5922
6097
|
let r = n ?? Date.now(), i = e[0]?.startedAtMs, a = e.reduce((e, t, n) => t.status === "active" ? n : e, -1);
|
|
5923
6098
|
return /* @__PURE__ */ c("ul", {
|
|
5924
6099
|
className: "ak-progress__steps",
|
|
5925
6100
|
role: "list",
|
|
5926
6101
|
children: e.map((e, n) => {
|
|
5927
|
-
let o = t && e.status === "active", s = o && n === a ?
|
|
6102
|
+
let o = t && e.status === "active", s = o && n === a ? $i(i ? r - i : void 0) : o ? null : $i(e.durationMs);
|
|
5928
6103
|
return /* @__PURE__ */ l("li", {
|
|
5929
6104
|
className: o ? "ak-progress__step ak-progress__step--active" : "ak-progress__step",
|
|
5930
6105
|
children: [
|
|
5931
|
-
/* @__PURE__ */ c(
|
|
6106
|
+
/* @__PURE__ */ c(Ra, {
|
|
5932
6107
|
event: e,
|
|
5933
6108
|
active: o
|
|
5934
6109
|
}),
|
|
@@ -5945,11 +6120,11 @@ function wa({ events: e, live: t, answerStartedAtMs: n }) {
|
|
|
5945
6120
|
})
|
|
5946
6121
|
});
|
|
5947
6122
|
}
|
|
5948
|
-
function
|
|
6123
|
+
function Ba({ events: e, answerStartedAtMs: t }) {
|
|
5949
6124
|
let [n, i] = o(0), a = Math.min(n, e.length - 1), s = a < e.length - 1;
|
|
5950
6125
|
r(() => {
|
|
5951
6126
|
if (!s) return;
|
|
5952
|
-
let t = setTimeout(() => i((t) => Math.min(t + 1, e.length - 1)),
|
|
6127
|
+
let t = setTimeout(() => i((t) => Math.min(t + 1, e.length - 1)), Ia);
|
|
5953
6128
|
return () => clearTimeout(t);
|
|
5954
6129
|
}, [
|
|
5955
6130
|
s,
|
|
@@ -5957,15 +6132,15 @@ function Ta({ events: e, answerStartedAtMs: t }) {
|
|
|
5957
6132
|
e.length
|
|
5958
6133
|
]);
|
|
5959
6134
|
let u = e[a], d = !s && u.status === "done";
|
|
5960
|
-
|
|
5961
|
-
let f = e[0]?.startedAtMs, p = d ? null :
|
|
6135
|
+
Fa(!d && !t);
|
|
6136
|
+
let f = e[0]?.startedAtMs, p = d ? null : $i(f ? (t ?? Date.now()) - f : void 0);
|
|
5962
6137
|
return /* @__PURE__ */ c("ul", {
|
|
5963
6138
|
className: "ak-progress__list",
|
|
5964
6139
|
role: "list",
|
|
5965
6140
|
children: /* @__PURE__ */ l("li", {
|
|
5966
6141
|
className: "ak-progress__item ak-progress__item--active",
|
|
5967
6142
|
children: [
|
|
5968
|
-
d ? /* @__PURE__ */ c(
|
|
6143
|
+
d ? /* @__PURE__ */ c(Ra, {
|
|
5969
6144
|
event: u,
|
|
5970
6145
|
active: !1
|
|
5971
6146
|
}) : /* @__PURE__ */ c("span", {
|
|
@@ -5984,7 +6159,7 @@ function Ta({ events: e, answerStartedAtMs: t }) {
|
|
|
5984
6159
|
})
|
|
5985
6160
|
});
|
|
5986
6161
|
}
|
|
5987
|
-
function
|
|
6162
|
+
function Va({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1, turnMeta: a, answerStartedAtMs: s }) {
|
|
5988
6163
|
let [u, d] = o(!n);
|
|
5989
6164
|
r(() => {
|
|
5990
6165
|
i && d(!n);
|
|
@@ -6003,15 +6178,15 @@ function Ea({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
|
|
|
6003
6178
|
children: e
|
|
6004
6179
|
})]
|
|
6005
6180
|
})
|
|
6006
|
-
}) : null : f === "detailed" ? /* @__PURE__ */ c(
|
|
6181
|
+
}) : null : f === "detailed" ? /* @__PURE__ */ c(za, {
|
|
6007
6182
|
events: t,
|
|
6008
6183
|
live: !0,
|
|
6009
6184
|
answerStartedAtMs: s
|
|
6010
|
-
}) : /* @__PURE__ */ c(
|
|
6185
|
+
}) : /* @__PURE__ */ c(Ba, {
|
|
6011
6186
|
events: t,
|
|
6012
6187
|
answerStartedAtMs: s
|
|
6013
6188
|
});
|
|
6014
|
-
let p =
|
|
6189
|
+
let p = $i(a?.totalMs), m = p ? `Worked for ${p}` : "Finished working";
|
|
6015
6190
|
return f === "detailed" && t.length > 0 ? /* @__PURE__ */ l("div", {
|
|
6016
6191
|
className: "ak-progress",
|
|
6017
6192
|
children: [/* @__PURE__ */ l("button", {
|
|
@@ -6021,7 +6196,7 @@ function Ea({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
|
|
|
6021
6196
|
"aria-expanded": u,
|
|
6022
6197
|
"aria-label": u ? "Hide working steps" : "Show working steps",
|
|
6023
6198
|
children: [
|
|
6024
|
-
/* @__PURE__ */ c(
|
|
6199
|
+
/* @__PURE__ */ c(Ra, {
|
|
6025
6200
|
event: {
|
|
6026
6201
|
stage: "",
|
|
6027
6202
|
text: "",
|
|
@@ -6040,9 +6215,9 @@ function Ea({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
|
|
|
6040
6215
|
t.length === 1 ? "" : "s"
|
|
6041
6216
|
]
|
|
6042
6217
|
}),
|
|
6043
|
-
/* @__PURE__ */ c(
|
|
6218
|
+
/* @__PURE__ */ c(La, { up: u })
|
|
6044
6219
|
]
|
|
6045
|
-
}), u && /* @__PURE__ */ c(
|
|
6220
|
+
}), u && /* @__PURE__ */ c(za, {
|
|
6046
6221
|
events: t,
|
|
6047
6222
|
live: !1
|
|
6048
6223
|
})]
|
|
@@ -6050,7 +6225,7 @@ function Ea({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
|
|
|
6050
6225
|
className: "ak-progress",
|
|
6051
6226
|
children: /* @__PURE__ */ l("p", {
|
|
6052
6227
|
className: "ak-progress__summary ak-progress__summary--static",
|
|
6053
|
-
children: [/* @__PURE__ */ c(
|
|
6228
|
+
children: [/* @__PURE__ */ c(Ra, {
|
|
6054
6229
|
event: {
|
|
6055
6230
|
stage: "",
|
|
6056
6231
|
text: "",
|
|
@@ -6064,7 +6239,7 @@ function Ea({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
|
|
|
6064
6239
|
}
|
|
6065
6240
|
//#endregion
|
|
6066
6241
|
//#region ../../packages/widget-ui/src/components/MessageBubble.tsx
|
|
6067
|
-
function
|
|
6242
|
+
function Ha() {
|
|
6068
6243
|
return /* @__PURE__ */ c("svg", {
|
|
6069
6244
|
className: "ak-agent-status__icon",
|
|
6070
6245
|
width: "13",
|
|
@@ -6075,18 +6250,18 @@ function Da() {
|
|
|
6075
6250
|
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" })
|
|
6076
6251
|
});
|
|
6077
6252
|
}
|
|
6078
|
-
function
|
|
6253
|
+
function Ua({ status: e }) {
|
|
6079
6254
|
return /* @__PURE__ */ l("div", {
|
|
6080
6255
|
className: "ak-agent-status",
|
|
6081
6256
|
role: "status",
|
|
6082
6257
|
"aria-live": "polite",
|
|
6083
|
-
children: [/* @__PURE__ */ c(
|
|
6258
|
+
children: [/* @__PURE__ */ c(Ha, {}), /* @__PURE__ */ c("span", {
|
|
6084
6259
|
className: "ak-agent-status__text",
|
|
6085
6260
|
children: e
|
|
6086
6261
|
})]
|
|
6087
6262
|
});
|
|
6088
6263
|
}
|
|
6089
|
-
function
|
|
6264
|
+
function Wa({ messageId: e, images: t, onCellClick: n }) {
|
|
6090
6265
|
if (t.length === 0) return null;
|
|
6091
6266
|
let r = t.length;
|
|
6092
6267
|
if (r === 1) {
|
|
@@ -6104,7 +6279,7 @@ function ka({ messageId: e, images: t, onCellClick: n }) {
|
|
|
6104
6279
|
className: "ak-gallery__img ak-gallery__img--contain"
|
|
6105
6280
|
})
|
|
6106
6281
|
}), /* @__PURE__ */ c("a", {
|
|
6107
|
-
href:
|
|
6282
|
+
href: Na(e.downloadHref) ?? void 0,
|
|
6108
6283
|
download: !0,
|
|
6109
6284
|
className: "ak-message__image-dl-icon",
|
|
6110
6285
|
title: "Download image",
|
|
@@ -6134,7 +6309,7 @@ function ka({ messageId: e, images: t, onCellClick: n }) {
|
|
|
6134
6309
|
}
|
|
6135
6310
|
if (r === 2) return /* @__PURE__ */ c("div", {
|
|
6136
6311
|
className: "ak-gallery ak-gallery--two",
|
|
6137
|
-
children: t.map((t, r) => /* @__PURE__ */ c(
|
|
6312
|
+
children: t.map((t, r) => /* @__PURE__ */ c(Ga, {
|
|
6138
6313
|
src: t.src,
|
|
6139
6314
|
alt: t.alt,
|
|
6140
6315
|
onClick: () => n(r)
|
|
@@ -6142,17 +6317,17 @@ function ka({ messageId: e, images: t, onCellClick: n }) {
|
|
|
6142
6317
|
});
|
|
6143
6318
|
if (r === 3) return /* @__PURE__ */ l("div", {
|
|
6144
6319
|
className: "ak-gallery ak-gallery--three",
|
|
6145
|
-
children: [/* @__PURE__ */ c(
|
|
6320
|
+
children: [/* @__PURE__ */ c(Ga, {
|
|
6146
6321
|
src: t[0].src,
|
|
6147
6322
|
alt: t[0].alt,
|
|
6148
6323
|
onClick: () => n(0)
|
|
6149
6324
|
}, t[0].key ?? `${e}-0`), /* @__PURE__ */ l("div", {
|
|
6150
6325
|
className: "ak-gallery__col",
|
|
6151
|
-
children: [/* @__PURE__ */ c(
|
|
6326
|
+
children: [/* @__PURE__ */ c(Ga, {
|
|
6152
6327
|
src: t[1].src,
|
|
6153
6328
|
alt: t[1].alt,
|
|
6154
6329
|
onClick: () => n(1)
|
|
6155
|
-
}, t[1].key ?? `${e}-1`), /* @__PURE__ */ c(
|
|
6330
|
+
}, t[1].key ?? `${e}-1`), /* @__PURE__ */ c(Ga, {
|
|
6156
6331
|
src: t[2].src,
|
|
6157
6332
|
alt: t[2].alt,
|
|
6158
6333
|
onClick: () => n(2)
|
|
@@ -6164,7 +6339,7 @@ function ka({ messageId: e, images: t, onCellClick: n }) {
|
|
|
6164
6339
|
className: "ak-gallery ak-gallery--grid",
|
|
6165
6340
|
children: i.map((t, r) => {
|
|
6166
6341
|
let o = r === i.length - 1;
|
|
6167
|
-
return /* @__PURE__ */ c(
|
|
6342
|
+
return /* @__PURE__ */ c(Ga, {
|
|
6168
6343
|
src: t.src,
|
|
6169
6344
|
alt: t.alt,
|
|
6170
6345
|
overlayCount: o && a > 0 ? a : 0,
|
|
@@ -6173,7 +6348,7 @@ function ka({ messageId: e, images: t, onCellClick: n }) {
|
|
|
6173
6348
|
})
|
|
6174
6349
|
});
|
|
6175
6350
|
}
|
|
6176
|
-
function
|
|
6351
|
+
function Ga({ src: e, alt: t, overlayCount: n = 0, onClick: r }) {
|
|
6177
6352
|
return /* @__PURE__ */ l("button", {
|
|
6178
6353
|
type: "button",
|
|
6179
6354
|
onClick: r,
|
|
@@ -6190,7 +6365,7 @@ function Aa({ src: e, alt: t, overlayCount: n = 0, onClick: r }) {
|
|
|
6190
6365
|
})]
|
|
6191
6366
|
});
|
|
6192
6367
|
}
|
|
6193
|
-
function
|
|
6368
|
+
function Ka({ images: e, index: t, onClose: n, onIndexChange: i }) {
|
|
6194
6369
|
let a = t !== null, o = a && t !== null ? Math.min(Math.max(0, t), e.length - 1) : 0, u = a ? e[o] : null;
|
|
6195
6370
|
return r(() => {
|
|
6196
6371
|
if (!a) return;
|
|
@@ -6224,7 +6399,7 @@ function ja({ images: e, index: t, onClose: n, onIndexChange: i }) {
|
|
|
6224
6399
|
]
|
|
6225
6400
|
}),
|
|
6226
6401
|
/* @__PURE__ */ c("a", {
|
|
6227
|
-
href:
|
|
6402
|
+
href: Na(u.downloadHref) ?? void 0,
|
|
6228
6403
|
download: !0,
|
|
6229
6404
|
target: "_blank",
|
|
6230
6405
|
rel: "noopener noreferrer",
|
|
@@ -6328,7 +6503,7 @@ function ja({ images: e, index: t, onClose: n, onIndexChange: i }) {
|
|
|
6328
6503
|
]
|
|
6329
6504
|
});
|
|
6330
6505
|
}
|
|
6331
|
-
function
|
|
6506
|
+
function qa({ url: e, mimeType: t, fileName: n }) {
|
|
6332
6507
|
let r = (() => {
|
|
6333
6508
|
if (n) return n;
|
|
6334
6509
|
try {
|
|
@@ -6354,7 +6529,7 @@ function Ma({ url: e, mimeType: t, fileName: n }) {
|
|
|
6354
6529
|
label: i || "FILE"
|
|
6355
6530
|
};
|
|
6356
6531
|
return /* @__PURE__ */ l("a", {
|
|
6357
|
-
href:
|
|
6532
|
+
href: Na(e) ?? void 0,
|
|
6358
6533
|
target: "_blank",
|
|
6359
6534
|
rel: "noopener noreferrer",
|
|
6360
6535
|
className: "ak-file-chip",
|
|
@@ -6385,7 +6560,25 @@ function Ma({ url: e, mimeType: t, fileName: n }) {
|
|
|
6385
6560
|
})]
|
|
6386
6561
|
});
|
|
6387
6562
|
}
|
|
6388
|
-
function
|
|
6563
|
+
function Ja({ url: e, mimeType: t, transcript: n }) {
|
|
6564
|
+
return /* @__PURE__ */ l("div", {
|
|
6565
|
+
className: "ak-audio-chip",
|
|
6566
|
+
children: [/* @__PURE__ */ c("audio", {
|
|
6567
|
+
controls: !0,
|
|
6568
|
+
src: e,
|
|
6569
|
+
className: "ak-audio-chip__player",
|
|
6570
|
+
"aria-label": "Voice note",
|
|
6571
|
+
children: /* @__PURE__ */ c("source", {
|
|
6572
|
+
src: e,
|
|
6573
|
+
type: t
|
|
6574
|
+
})
|
|
6575
|
+
}), n && /* @__PURE__ */ c("p", {
|
|
6576
|
+
className: "ak-audio-chip__transcript",
|
|
6577
|
+
children: n
|
|
6578
|
+
})]
|
|
6579
|
+
});
|
|
6580
|
+
}
|
|
6581
|
+
function Ya(e) {
|
|
6389
6582
|
try {
|
|
6390
6583
|
return new Date(e).toLocaleTimeString([], {
|
|
6391
6584
|
hour: "2-digit",
|
|
@@ -6395,12 +6588,12 @@ function Na(e) {
|
|
|
6395
6588
|
return "";
|
|
6396
6589
|
}
|
|
6397
6590
|
}
|
|
6398
|
-
var
|
|
6591
|
+
var Xa = /(`[^`\n]+`|\*\*[^*\n]+\*\*|\*[^*\n]+\*|!\[[^\]\n]*\]\([^)\n]+\)|\[[^\]\n]+\]\([^)\n]+\))/g;
|
|
6399
6592
|
function $(e) {
|
|
6400
6593
|
let t = [], n = 0, r = 0;
|
|
6401
|
-
|
|
6594
|
+
Xa.lastIndex = 0;
|
|
6402
6595
|
let i;
|
|
6403
|
-
for (; (i =
|
|
6596
|
+
for (; (i = Xa.exec(e)) !== null;) {
|
|
6404
6597
|
i.index > n && t.push(e.slice(n, i.index));
|
|
6405
6598
|
let a = i[0];
|
|
6406
6599
|
if (a.startsWith("`")) t.push(/* @__PURE__ */ c("code", {
|
|
@@ -6410,7 +6603,7 @@ function $(e) {
|
|
|
6410
6603
|
else if (a.startsWith("**")) t.push(/* @__PURE__ */ c("strong", { children: a.slice(2, -2) }, r++));
|
|
6411
6604
|
else if (a.startsWith("*")) t.push(/* @__PURE__ */ c("em", { children: a.slice(1, -1) }, r++));
|
|
6412
6605
|
else if (a.startsWith("![")) {
|
|
6413
|
-
let e = a.match(/!\[([^\]]*)\]\(([^)]+)\)/), n =
|
|
6606
|
+
let e = a.match(/!\[([^\]]*)\]\(([^)]+)\)/), n = Na(e?.[2]);
|
|
6414
6607
|
e && n ? t.push(/* @__PURE__ */ c("a", {
|
|
6415
6608
|
href: n,
|
|
6416
6609
|
target: "_blank",
|
|
@@ -6418,7 +6611,7 @@ function $(e) {
|
|
|
6418
6611
|
children: e[1] || "image"
|
|
6419
6612
|
}, r++)) : e && t.push(e[1] || "image");
|
|
6420
6613
|
} else {
|
|
6421
|
-
let e = a.match(/\[(.+?)\]\((.+?)\)/), n =
|
|
6614
|
+
let e = a.match(/\[(.+?)\]\((.+?)\)/), n = Na(e?.[2]);
|
|
6422
6615
|
e && n ? t.push(/* @__PURE__ */ c("a", {
|
|
6423
6616
|
href: n,
|
|
6424
6617
|
target: "_blank",
|
|
@@ -6430,8 +6623,8 @@ function $(e) {
|
|
|
6430
6623
|
}
|
|
6431
6624
|
return n < e.length && t.push(e.slice(n)), t;
|
|
6432
6625
|
}
|
|
6433
|
-
function
|
|
6434
|
-
e =
|
|
6626
|
+
function Za(e) {
|
|
6627
|
+
e = Pa(e);
|
|
6435
6628
|
let t = e.split("\n"), n = [], r = 0, i = 0;
|
|
6436
6629
|
for (; r < t.length;) {
|
|
6437
6630
|
let e = t[r], a = e.match(/^(\s*)```/);
|
|
@@ -6600,7 +6793,7 @@ function Fa(e) {
|
|
|
6600
6793
|
}
|
|
6601
6794
|
return /* @__PURE__ */ c(s, { children: n });
|
|
6602
6795
|
}
|
|
6603
|
-
function
|
|
6796
|
+
function Qa({ message: e }) {
|
|
6604
6797
|
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 = (() => {
|
|
6605
6798
|
if (!a) return [];
|
|
6606
6799
|
let t = (e.uploadedAttachments ?? []).filter((e) => e.kind === "image").map((e) => ({
|
|
@@ -6612,15 +6805,15 @@ function Ia({ message: e }) {
|
|
|
6612
6805
|
url: e.uploadedImageUrl,
|
|
6613
6806
|
mimeType: "image/jpeg"
|
|
6614
6807
|
}] : [];
|
|
6615
|
-
})(), m = a ? (e.uploadedAttachments ?? []).filter((e) => e.kind === "file") : [], h = p.length > 0,
|
|
6808
|
+
})(), 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 = [
|
|
6616
6809
|
"ak-message__bubble",
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
].filter(Boolean).join(" "),
|
|
6621
|
-
className:
|
|
6810
|
+
w ? "ak-message__bubble--md" : "",
|
|
6811
|
+
y ? "ak-message__bubble--has-image" : "",
|
|
6812
|
+
T ? "ak-message__bubble--operator" : ""
|
|
6813
|
+
].filter(Boolean).join(" "), O = T ? e.senderDisplay?.trim() || "Operator" : null, k = O ? O.charAt(0).toUpperCase() : "", A = /* @__PURE__ */ l("div", {
|
|
6814
|
+
className: D,
|
|
6622
6815
|
children: [
|
|
6623
|
-
|
|
6816
|
+
g && /* @__PURE__ */ c(Wa, {
|
|
6624
6817
|
messageId: `${e.id}-up`,
|
|
6625
6818
|
images: p.map((e) => ({
|
|
6626
6819
|
src: e.url,
|
|
@@ -6629,15 +6822,23 @@ function Ia({ message: e }) {
|
|
|
6629
6822
|
})),
|
|
6630
6823
|
onCellClick: (e) => n(e)
|
|
6631
6824
|
}),
|
|
6632
|
-
|
|
6825
|
+
_ && /* @__PURE__ */ c("div", {
|
|
6633
6826
|
className: "ak-message__files",
|
|
6634
|
-
children: m.map((t, n) => /* @__PURE__ */ c(
|
|
6827
|
+
children: m.map((t, n) => /* @__PURE__ */ c(qa, {
|
|
6635
6828
|
url: t.url,
|
|
6636
6829
|
mimeType: t.mimeType,
|
|
6637
6830
|
fileName: t.fileName
|
|
6638
6831
|
}, `${e.id}-up-file-${n}`))
|
|
6639
6832
|
}),
|
|
6640
|
-
|
|
6833
|
+
v && /* @__PURE__ */ c("div", {
|
|
6834
|
+
className: "ak-message__files",
|
|
6835
|
+
children: h.map((t, n) => /* @__PURE__ */ c(Ja, {
|
|
6836
|
+
url: t.url,
|
|
6837
|
+
mimeType: t.mimeType,
|
|
6838
|
+
transcript: n === 0 ? b?.transcript ?? null : null
|
|
6839
|
+
}, `${e.id}-up-audio-${n}`))
|
|
6840
|
+
}),
|
|
6841
|
+
d && /* @__PURE__ */ c(Wa, {
|
|
6641
6842
|
messageId: `${e.id}-asst`,
|
|
6642
6843
|
images: e.images.map((e, t) => {
|
|
6643
6844
|
let n = e.url ?? (e.base64 ? `data:${e.mimeType};base64,${e.base64}` : null);
|
|
@@ -6652,15 +6853,15 @@ function Ia({ message: e }) {
|
|
|
6652
6853
|
}),
|
|
6653
6854
|
f && /* @__PURE__ */ c("div", {
|
|
6654
6855
|
className: "ak-message__files",
|
|
6655
|
-
children: e.documents.map((t, n) => t.url ? /* @__PURE__ */ c(
|
|
6856
|
+
children: e.documents.map((t, n) => t.url ? /* @__PURE__ */ c(qa, {
|
|
6656
6857
|
url: t.url,
|
|
6657
6858
|
mimeType: t.mimeType,
|
|
6658
6859
|
fileName: t.fileName
|
|
6659
6860
|
}, `${e.id}-asst-doc-${n}`) : null)
|
|
6660
6861
|
}),
|
|
6661
|
-
|
|
6662
|
-
className:
|
|
6663
|
-
children: [
|
|
6862
|
+
x && /* @__PURE__ */ l("div", {
|
|
6863
|
+
className: y ? "ak-message__image-caption" : void 0,
|
|
6864
|
+
children: [w ? Za(x) : x, u && /* @__PURE__ */ l("span", {
|
|
6664
6865
|
className: "ak-cursor",
|
|
6665
6866
|
"aria-hidden": "true",
|
|
6666
6867
|
children: [
|
|
@@ -6672,14 +6873,14 @@ function Ia({ message: e }) {
|
|
|
6672
6873
|
}),
|
|
6673
6874
|
/* @__PURE__ */ c("span", {
|
|
6674
6875
|
className: "ak-message__time",
|
|
6675
|
-
children:
|
|
6876
|
+
children: Ya(e.createdAt)
|
|
6676
6877
|
})
|
|
6677
6878
|
]
|
|
6678
|
-
}),
|
|
6879
|
+
}), ee = !!e.content || y || _ || f || !u && !e.toolStatus;
|
|
6679
6880
|
return /* @__PURE__ */ l("div", {
|
|
6680
|
-
className: `ak-message ${
|
|
6881
|
+
className: `ak-message ${E}`,
|
|
6681
6882
|
children: [
|
|
6682
|
-
!a && (e.ackText || e.progressEvents && e.progressEvents.length > 0 || e.turnMeta) && /* @__PURE__ */ c(
|
|
6883
|
+
!a && (e.ackText || e.progressEvents && e.progressEvents.length > 0 || e.turnMeta) && /* @__PURE__ */ c(Va, {
|
|
6683
6884
|
ackText: e.ackText,
|
|
6684
6885
|
events: e.progressEvents,
|
|
6685
6886
|
collapsed: e.progressCollapsed,
|
|
@@ -6687,7 +6888,7 @@ function Ia({ message: e }) {
|
|
|
6687
6888
|
turnMeta: e.turnMeta,
|
|
6688
6889
|
answerStartedAtMs: e.answerStartedAtMs
|
|
6689
6890
|
}),
|
|
6690
|
-
|
|
6891
|
+
C && /* @__PURE__ */ l("div", {
|
|
6691
6892
|
className: "ak-typing-row",
|
|
6692
6893
|
role: "status",
|
|
6693
6894
|
"aria-label": "Assistant is typing",
|
|
@@ -6697,20 +6898,20 @@ function Ia({ message: e }) {
|
|
|
6697
6898
|
/* @__PURE__ */ c("span", { className: "ak-typing-row__dot" })
|
|
6698
6899
|
]
|
|
6699
6900
|
}),
|
|
6700
|
-
!a && e.toolStatus && !(e.progressEvents && e.progressEvents.length > 0) && /* @__PURE__ */ c(
|
|
6701
|
-
|
|
6901
|
+
!a && e.toolStatus && !(e.progressEvents && e.progressEvents.length > 0) && /* @__PURE__ */ c(Ua, { status: e.toolStatus }),
|
|
6902
|
+
T && /* @__PURE__ */ l("span", {
|
|
6702
6903
|
className: "ak-message__sender-label",
|
|
6703
6904
|
children: [/* @__PURE__ */ c("span", {
|
|
6704
6905
|
className: "ak-message__operator-avatar",
|
|
6705
6906
|
"aria-hidden": "true",
|
|
6706
|
-
children:
|
|
6907
|
+
children: k
|
|
6707
6908
|
}), /* @__PURE__ */ c("span", {
|
|
6708
6909
|
className: "ak-message__operator-name",
|
|
6709
|
-
children:
|
|
6910
|
+
children: O
|
|
6710
6911
|
})]
|
|
6711
6912
|
}),
|
|
6712
|
-
|
|
6713
|
-
p.length > 0 && /* @__PURE__ */ c(
|
|
6913
|
+
ee && A,
|
|
6914
|
+
p.length > 0 && /* @__PURE__ */ c(Ka, {
|
|
6714
6915
|
images: p.map((e) => ({
|
|
6715
6916
|
src: e.url,
|
|
6716
6917
|
alt: e.fileName ?? "Uploaded image",
|
|
@@ -6720,7 +6921,7 @@ function Ia({ message: e }) {
|
|
|
6720
6921
|
onClose: () => n(null),
|
|
6721
6922
|
onIndexChange: n
|
|
6722
6923
|
}),
|
|
6723
|
-
d && /* @__PURE__ */ c(
|
|
6924
|
+
d && /* @__PURE__ */ c(Ka, {
|
|
6724
6925
|
images: e.images.map((e) => {
|
|
6725
6926
|
let t = e.url ?? (e.base64 ? `data:${e.mimeType};base64,${e.base64}` : null);
|
|
6726
6927
|
return t ? {
|
|
@@ -6738,7 +6939,7 @@ function Ia({ message: e }) {
|
|
|
6738
6939
|
}
|
|
6739
6940
|
//#endregion
|
|
6740
6941
|
//#region ../../packages/widget-ui/src/components/TypingIndicator.tsx
|
|
6741
|
-
function
|
|
6942
|
+
function $a() {
|
|
6742
6943
|
return /* @__PURE__ */ l("div", {
|
|
6743
6944
|
className: "ak-typing",
|
|
6744
6945
|
"aria-label": "Assistant is typing",
|
|
@@ -6751,7 +6952,7 @@ function La() {
|
|
|
6751
6952
|
}
|
|
6752
6953
|
//#endregion
|
|
6753
6954
|
//#region ../../packages/widget-ui/src/components/MessageList.tsx
|
|
6754
|
-
function
|
|
6955
|
+
function eo(e, t) {
|
|
6755
6956
|
let n = [], r = null;
|
|
6756
6957
|
for (let i of e) {
|
|
6757
6958
|
if (i.role === "assistant") {
|
|
@@ -6769,8 +6970,8 @@ function Ra(e, t) {
|
|
|
6769
6970
|
}
|
|
6770
6971
|
return n;
|
|
6771
6972
|
}
|
|
6772
|
-
function
|
|
6773
|
-
let o = a(null), s = a(null), u = a(!0), d = i(() =>
|
|
6973
|
+
function to({ messages: e, isLoading: t, operatorFallbackLabel: n = "Operator" }) {
|
|
6974
|
+
let o = a(null), s = a(null), u = a(!0), d = i(() => eo(e, n), [e, n]);
|
|
6774
6975
|
return r(() => {
|
|
6775
6976
|
if (!(o.current?.parentElement ?? o.current)) return;
|
|
6776
6977
|
let e = (e) => {
|
|
@@ -6798,15 +6999,15 @@ function za({ messages: e, isLoading: t, operatorFallbackLabel: n = "Operator" }
|
|
|
6798
6999
|
className: "ak-handoff-divider__label",
|
|
6799
7000
|
children: e.label
|
|
6800
7001
|
})
|
|
6801
|
-
}, e.id) : /* @__PURE__ */ c(
|
|
6802
|
-
t && !e.some((e) => e.status === "streaming") && /* @__PURE__ */ c(
|
|
7002
|
+
}, e.id) : /* @__PURE__ */ c(Qa, { message: e.message }, e.message.id)),
|
|
7003
|
+
t && !e.some((e) => e.status === "streaming") && /* @__PURE__ */ c($a, {}),
|
|
6803
7004
|
/* @__PURE__ */ c("div", { ref: s })
|
|
6804
7005
|
]
|
|
6805
7006
|
});
|
|
6806
7007
|
}
|
|
6807
7008
|
//#endregion
|
|
6808
7009
|
//#region ../../packages/widget-ui/src/components/EmptyState.tsx
|
|
6809
|
-
function
|
|
7010
|
+
function no() {
|
|
6810
7011
|
return /* @__PURE__ */ l("svg", {
|
|
6811
7012
|
width: "30",
|
|
6812
7013
|
height: "30",
|
|
@@ -6846,7 +7047,7 @@ function Ba() {
|
|
|
6846
7047
|
]
|
|
6847
7048
|
});
|
|
6848
7049
|
}
|
|
6849
|
-
function
|
|
7050
|
+
function ro({ title: e, description: t, suggestedQuestions: n, avatarUrl: r, onSelect: i }) {
|
|
6850
7051
|
let a = (n ?? []).filter((e) => (e.title ?? "").trim().length > 0);
|
|
6851
7052
|
return /* @__PURE__ */ l("div", {
|
|
6852
7053
|
className: "ak-empty-state",
|
|
@@ -6869,7 +7070,7 @@ function Va({ title: e, description: t, suggestedQuestions: n, avatarUrl: r, onS
|
|
|
6869
7070
|
}) : /* @__PURE__ */ c("span", {
|
|
6870
7071
|
className: "ak-empty-state__bot-icon",
|
|
6871
7072
|
"aria-hidden": "true",
|
|
6872
|
-
children: /* @__PURE__ */ c(
|
|
7073
|
+
children: /* @__PURE__ */ c(no, {})
|
|
6873
7074
|
})
|
|
6874
7075
|
}),
|
|
6875
7076
|
/* @__PURE__ */ c("p", {
|
|
@@ -6902,8 +7103,8 @@ function Va({ title: e, description: t, suggestedQuestions: n, avatarUrl: r, onS
|
|
|
6902
7103
|
}
|
|
6903
7104
|
//#endregion
|
|
6904
7105
|
//#region ../../packages/widget-ui/src/components/Composer.tsx
|
|
6905
|
-
var
|
|
6906
|
-
function
|
|
7106
|
+
var io = "https://klicforge.ai/privacy-policy", ao = "https://klicforge.ai/terms-of-service";
|
|
7107
|
+
function oo() {
|
|
6907
7108
|
return /* @__PURE__ */ l("svg", {
|
|
6908
7109
|
width: "16",
|
|
6909
7110
|
height: "16",
|
|
@@ -6921,7 +7122,7 @@ function Wa() {
|
|
|
6921
7122
|
}), /* @__PURE__ */ c("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })]
|
|
6922
7123
|
});
|
|
6923
7124
|
}
|
|
6924
|
-
function
|
|
7125
|
+
function so() {
|
|
6925
7126
|
return /* @__PURE__ */ l("svg", {
|
|
6926
7127
|
width: "14",
|
|
6927
7128
|
height: "14",
|
|
@@ -6943,7 +7144,7 @@ function Ga() {
|
|
|
6943
7144
|
})]
|
|
6944
7145
|
});
|
|
6945
7146
|
}
|
|
6946
|
-
function
|
|
7147
|
+
function co() {
|
|
6947
7148
|
return /* @__PURE__ */ l("svg", {
|
|
6948
7149
|
width: "14",
|
|
6949
7150
|
height: "14",
|
|
@@ -6960,7 +7161,7 @@ function Ka() {
|
|
|
6960
7161
|
})]
|
|
6961
7162
|
});
|
|
6962
7163
|
}
|
|
6963
|
-
function
|
|
7164
|
+
function lo() {
|
|
6964
7165
|
return /* @__PURE__ */ l("svg", {
|
|
6965
7166
|
width: "14",
|
|
6966
7167
|
height: "14",
|
|
@@ -6973,7 +7174,7 @@ function qa() {
|
|
|
6973
7174
|
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" })]
|
|
6974
7175
|
});
|
|
6975
7176
|
}
|
|
6976
|
-
function
|
|
7177
|
+
function uo() {
|
|
6977
7178
|
return /* @__PURE__ */ l("svg", {
|
|
6978
7179
|
width: "10",
|
|
6979
7180
|
height: "10",
|
|
@@ -6996,56 +7197,128 @@ function Ja() {
|
|
|
6996
7197
|
})]
|
|
6997
7198
|
});
|
|
6998
7199
|
}
|
|
6999
|
-
|
|
7200
|
+
function fo() {
|
|
7201
|
+
return /* @__PURE__ */ l("svg", {
|
|
7202
|
+
width: "14",
|
|
7203
|
+
height: "14",
|
|
7204
|
+
viewBox: "0 0 24 24",
|
|
7205
|
+
fill: "none",
|
|
7206
|
+
stroke: "currentColor",
|
|
7207
|
+
strokeWidth: "2",
|
|
7208
|
+
strokeLinecap: "round",
|
|
7209
|
+
strokeLinejoin: "round",
|
|
7210
|
+
children: [
|
|
7211
|
+
/* @__PURE__ */ c("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
7212
|
+
/* @__PURE__ */ c("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
7213
|
+
/* @__PURE__ */ c("line", {
|
|
7214
|
+
x1: "12",
|
|
7215
|
+
y1: "19",
|
|
7216
|
+
x2: "12",
|
|
7217
|
+
y2: "23"
|
|
7218
|
+
}),
|
|
7219
|
+
/* @__PURE__ */ c("line", {
|
|
7220
|
+
x1: "8",
|
|
7221
|
+
y1: "23",
|
|
7222
|
+
x2: "16",
|
|
7223
|
+
y2: "23"
|
|
7224
|
+
})
|
|
7225
|
+
]
|
|
7226
|
+
});
|
|
7227
|
+
}
|
|
7228
|
+
function po() {
|
|
7229
|
+
return /* @__PURE__ */ c("svg", {
|
|
7230
|
+
width: "12",
|
|
7231
|
+
height: "12",
|
|
7232
|
+
viewBox: "0 0 24 24",
|
|
7233
|
+
fill: "currentColor",
|
|
7234
|
+
children: /* @__PURE__ */ c("rect", {
|
|
7235
|
+
x: "4",
|
|
7236
|
+
y: "4",
|
|
7237
|
+
width: "16",
|
|
7238
|
+
height: "16",
|
|
7239
|
+
rx: "2"
|
|
7240
|
+
})
|
|
7241
|
+
});
|
|
7242
|
+
}
|
|
7243
|
+
var mo = [
|
|
7000
7244
|
"application/pdf",
|
|
7001
7245
|
"text/markdown",
|
|
7002
7246
|
"text/plain",
|
|
7003
7247
|
"text/csv"
|
|
7004
|
-
],
|
|
7248
|
+
], ho = [
|
|
7005
7249
|
".pdf",
|
|
7006
7250
|
".md",
|
|
7007
7251
|
".txt",
|
|
7008
7252
|
".csv"
|
|
7009
|
-
],
|
|
7253
|
+
], go = [...ho, ...mo].join(","), _o = [
|
|
7010
7254
|
"image/jpeg",
|
|
7011
7255
|
"image/png",
|
|
7012
7256
|
"image/gif",
|
|
7013
7257
|
"image/webp"
|
|
7014
|
-
],
|
|
7015
|
-
|
|
7016
|
-
|
|
7258
|
+
], vo = _o.join(","), yo = [
|
|
7259
|
+
"audio/webm;codecs=opus",
|
|
7260
|
+
"audio/webm",
|
|
7261
|
+
"audio/mp4",
|
|
7262
|
+
"audio/ogg;codecs=opus"
|
|
7263
|
+
];
|
|
7264
|
+
function bo() {
|
|
7265
|
+
return typeof MediaRecorder > "u" ? null : yo.find((e) => MediaRecorder.isTypeSupported(e)) ?? null;
|
|
7266
|
+
}
|
|
7267
|
+
function xo(e) {
|
|
7268
|
+
return e.includes("mp4") ? "mp4" : e.includes("ogg") ? "ogg" : "webm";
|
|
7269
|
+
}
|
|
7270
|
+
function So(e) {
|
|
7271
|
+
let t = Math.floor(e / 1e3), n = Math.floor(t / 60), r = t % 60;
|
|
7272
|
+
return `${n}:${String(r).padStart(2, "0")}`;
|
|
7273
|
+
}
|
|
7274
|
+
function Co(e) {
|
|
7275
|
+
if (mo.includes(e.type)) return !0;
|
|
7017
7276
|
let t = e.name.toLowerCase();
|
|
7018
|
-
return
|
|
7019
|
-
}
|
|
7020
|
-
function
|
|
7021
|
-
return
|
|
7022
|
-
}
|
|
7023
|
-
function
|
|
7024
|
-
let [
|
|
7277
|
+
return ho.some((e) => t.endsWith(e));
|
|
7278
|
+
}
|
|
7279
|
+
function wo(e) {
|
|
7280
|
+
return _o.includes(e.type);
|
|
7281
|
+
}
|
|
7282
|
+
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: _ }) {
|
|
7283
|
+
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);
|
|
7284
|
+
le.current = v;
|
|
7285
|
+
let ue = a(b);
|
|
7286
|
+
ue.current = b;
|
|
7287
|
+
let de = a(t);
|
|
7288
|
+
de.current = t;
|
|
7289
|
+
let fe = d || f, pe = i(() => g * 1024 * 1024, [g]), me = p && typeof window < "u" && typeof MediaRecorder < "u" && !!navigator.mediaDevices?.getUserMedia;
|
|
7025
7290
|
r(() => () => {
|
|
7026
|
-
|
|
7027
|
-
}, [])
|
|
7028
|
-
|
|
7291
|
+
S.forEach((e) => URL.revokeObjectURL(e));
|
|
7292
|
+
}, []);
|
|
7293
|
+
let he = a(null);
|
|
7294
|
+
r(() => {
|
|
7295
|
+
if (t) return;
|
|
7296
|
+
let e = he.current;
|
|
7297
|
+
he.current = t, !(e === null && typeof window < "u" && window.matchMedia?.("(pointer: coarse)").matches) && A.current?.focus();
|
|
7029
7298
|
}, [t]);
|
|
7030
|
-
let
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7299
|
+
let ge = a(!1);
|
|
7300
|
+
r(() => {
|
|
7301
|
+
E ? ne.current?.focus() : ge.current && !de.current && A.current?.focus(), ge.current = E;
|
|
7302
|
+
}, [E]);
|
|
7303
|
+
let _e = n((e) => {
|
|
7304
|
+
if (!w) return;
|
|
7305
|
+
let t = e.composedPath ? e.composedPath() : [], n = !!M.current && t.includes(M.current), r = !!te.current && t.includes(te.current);
|
|
7306
|
+
!n && !r && T(!1);
|
|
7307
|
+
}, [w]);
|
|
7035
7308
|
r(() => {
|
|
7036
|
-
if (
|
|
7037
|
-
}, [
|
|
7038
|
-
|
|
7039
|
-
}, [
|
|
7040
|
-
function
|
|
7041
|
-
|
|
7042
|
-
}
|
|
7043
|
-
function
|
|
7044
|
-
|
|
7309
|
+
if (w) return document.addEventListener("click", _e), () => document.removeEventListener("click", _e);
|
|
7310
|
+
}, [w, _e]), r(() => {
|
|
7311
|
+
fe || T(!1);
|
|
7312
|
+
}, [fe]);
|
|
7313
|
+
function ve() {
|
|
7314
|
+
S.forEach((e) => URL.revokeObjectURL(e)), C(/* @__PURE__ */ new Map()), x([]), ee.current && (ee.current.value = ""), j.current && (j.current.value = "");
|
|
7315
|
+
}
|
|
7316
|
+
function ye(e) {
|
|
7317
|
+
x((t) => {
|
|
7045
7318
|
let n = t[e];
|
|
7046
7319
|
if (n) {
|
|
7047
|
-
let e =
|
|
7048
|
-
e && (URL.revokeObjectURL(e),
|
|
7320
|
+
let e = S.get(n.file);
|
|
7321
|
+
e && (URL.revokeObjectURL(e), C((e) => {
|
|
7049
7322
|
let t = new Map(e);
|
|
7050
7323
|
return t.delete(n.file), t;
|
|
7051
7324
|
}));
|
|
@@ -7053,31 +7326,82 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7053
7326
|
return t.filter((t, n) => n !== e);
|
|
7054
7327
|
});
|
|
7055
7328
|
}
|
|
7056
|
-
function
|
|
7057
|
-
let n =
|
|
7058
|
-
!n &&
|
|
7329
|
+
function be() {
|
|
7330
|
+
let n = v.trim();
|
|
7331
|
+
!n && b.length === 0 || t || (e(n, b), y(""), ve(), A.current && (A.current.style.height = "auto"));
|
|
7059
7332
|
}
|
|
7060
|
-
|
|
7061
|
-
|
|
7333
|
+
let xe = n(() => {
|
|
7334
|
+
ie.current?.getTracks().forEach((e) => e.stop()), ie.current = null;
|
|
7335
|
+
}, []);
|
|
7336
|
+
r(() => () => {
|
|
7337
|
+
oe.current && clearInterval(oe.current), N.current && N.current.state !== "inactive" && (se.current = !0, N.current.stop()), xe();
|
|
7338
|
+
}, [xe]);
|
|
7339
|
+
async function Se() {
|
|
7340
|
+
if (!me || E || ce.current || t) return;
|
|
7341
|
+
if (b.length >= h) {
|
|
7342
|
+
_?.(`Only ${h} attachments can be sent at once`);
|
|
7343
|
+
return;
|
|
7344
|
+
}
|
|
7345
|
+
let n = bo();
|
|
7346
|
+
if (!n) {
|
|
7347
|
+
_?.("Voice recording is not supported in this browser");
|
|
7348
|
+
return;
|
|
7349
|
+
}
|
|
7350
|
+
ce.current = !0;
|
|
7351
|
+
let r;
|
|
7352
|
+
try {
|
|
7353
|
+
r = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
7354
|
+
} catch {
|
|
7355
|
+
ce.current = !1, _?.("Microphone access was denied");
|
|
7356
|
+
return;
|
|
7357
|
+
}
|
|
7358
|
+
ce.current = !1, ie.current = r, re.current = [], se.current = !1;
|
|
7359
|
+
let i = new MediaRecorder(r, { mimeType: n });
|
|
7360
|
+
i.ondataavailable = (e) => {
|
|
7361
|
+
e.data.size > 0 && re.current.push(e.data);
|
|
7362
|
+
}, i.onstop = () => {
|
|
7363
|
+
xe();
|
|
7364
|
+
let t = se.current, r = Date.now() - ae.current, i = new Blob(re.current, { type: n });
|
|
7365
|
+
if (re.current = [], t || r < 300 || de.current) return;
|
|
7366
|
+
let a = new File([i], `voice-note.${xo(n)}`, { type: n }), o = le.current.trim(), s = [...ue.current, {
|
|
7367
|
+
file: a,
|
|
7368
|
+
kind: "audio",
|
|
7369
|
+
durationMs: r
|
|
7370
|
+
}];
|
|
7371
|
+
if (s.length > h) {
|
|
7372
|
+
_?.(`Only ${h} attachments can be sent at once`);
|
|
7373
|
+
return;
|
|
7374
|
+
}
|
|
7375
|
+
e(o, s), y(""), ve(), A.current && (A.current.style.height = "auto");
|
|
7376
|
+
}, N.current = i, ae.current = Date.now(), k(0), i.start(), D(!0), oe.current = setInterval(() => {
|
|
7377
|
+
let e = Date.now() - ae.current;
|
|
7378
|
+
k(e), e >= m * 1e3 && Ce(!1);
|
|
7379
|
+
}, 250);
|
|
7380
|
+
}
|
|
7381
|
+
function Ce(e) {
|
|
7382
|
+
oe.current &&= (clearInterval(oe.current), null), se.current = e, N.current && N.current.state !== "inactive" && N.current.stop(), D(!1), k(0);
|
|
7383
|
+
}
|
|
7384
|
+
function we(e) {
|
|
7385
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), be());
|
|
7062
7386
|
}
|
|
7063
|
-
function
|
|
7387
|
+
function Te(e) {
|
|
7064
7388
|
let t = e.currentTarget;
|
|
7065
|
-
|
|
7389
|
+
y(t.value), t.style.height = "auto", t.style.height = `${t.scrollHeight}px`;
|
|
7066
7390
|
}
|
|
7067
|
-
function
|
|
7391
|
+
function Ee(e, t) {
|
|
7068
7392
|
if (e.length === 0) return;
|
|
7069
7393
|
let n = [], r = [];
|
|
7070
7394
|
for (let i of e) {
|
|
7071
|
-
if (t === "image" && !
|
|
7395
|
+
if (t === "image" && !wo(i)) {
|
|
7072
7396
|
r.push(`${i.name} (image type not supported)`);
|
|
7073
7397
|
continue;
|
|
7074
7398
|
}
|
|
7075
|
-
if (t === "file" && !
|
|
7399
|
+
if (t === "file" && !Co(i)) {
|
|
7076
7400
|
r.push(`${i.name} (file type not supported)`);
|
|
7077
7401
|
continue;
|
|
7078
7402
|
}
|
|
7079
|
-
if (i.size >
|
|
7080
|
-
r.push(`${i.name} (over ${
|
|
7403
|
+
if (i.size > pe) {
|
|
7404
|
+
r.push(`${i.name} (over ${g} MB)`);
|
|
7081
7405
|
continue;
|
|
7082
7406
|
}
|
|
7083
7407
|
n.push({
|
|
@@ -7085,60 +7409,60 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7085
7409
|
kind: t
|
|
7086
7410
|
});
|
|
7087
7411
|
}
|
|
7088
|
-
|
|
7089
|
-
let t = [...e, ...n], i = t.slice(0,
|
|
7090
|
-
return t.length >
|
|
7412
|
+
x((e) => {
|
|
7413
|
+
let t = [...e, ...n], i = t.slice(0, h);
|
|
7414
|
+
return t.length > h && r.push(`max ${h} attachments allowed`), C((e) => {
|
|
7091
7415
|
let t = new Map(e);
|
|
7092
7416
|
for (let e of i) e.kind === "image" && !t.has(e.file) && t.set(e.file, URL.createObjectURL(e.file));
|
|
7093
7417
|
return t;
|
|
7094
7418
|
}), i;
|
|
7095
7419
|
}), r.length > 0 && alert(`Some attachments were not added:\n• ${r.join("\n• ")}`);
|
|
7096
7420
|
}
|
|
7097
|
-
function
|
|
7421
|
+
function De(e) {
|
|
7098
7422
|
let t = Array.from(e.currentTarget.files ?? []);
|
|
7099
|
-
e.currentTarget.value = "",
|
|
7423
|
+
e.currentTarget.value = "", Ee(t, "image");
|
|
7100
7424
|
}
|
|
7101
|
-
function
|
|
7425
|
+
function Oe(e) {
|
|
7102
7426
|
let t = Array.from(e.currentTarget.files ?? []);
|
|
7103
|
-
e.currentTarget.value = "",
|
|
7427
|
+
e.currentTarget.value = "", Ee(t, "file");
|
|
7104
7428
|
}
|
|
7105
|
-
function
|
|
7106
|
-
|
|
7429
|
+
function ke() {
|
|
7430
|
+
T(!1), ee.current?.click();
|
|
7107
7431
|
}
|
|
7108
|
-
function
|
|
7109
|
-
|
|
7432
|
+
function Ae() {
|
|
7433
|
+
T(!1), j.current?.click();
|
|
7110
7434
|
}
|
|
7111
|
-
let
|
|
7435
|
+
let je = !t && (!!v.trim() || b.length > 0);
|
|
7112
7436
|
return /* @__PURE__ */ l("div", {
|
|
7113
7437
|
className: "ak-composer",
|
|
7114
7438
|
children: [
|
|
7115
|
-
|
|
7116
|
-
ref:
|
|
7439
|
+
fe && w && /* @__PURE__ */ l("div", {
|
|
7440
|
+
ref: M,
|
|
7117
7441
|
className: "ak-composer__attach-menu",
|
|
7118
7442
|
role: "menu",
|
|
7119
7443
|
children: [d && /* @__PURE__ */ l("button", {
|
|
7120
7444
|
className: "ak-composer__attach-menu-item",
|
|
7121
|
-
onClick:
|
|
7445
|
+
onClick: ke,
|
|
7122
7446
|
type: "button",
|
|
7123
7447
|
role: "menuitem",
|
|
7124
7448
|
disabled: t,
|
|
7125
|
-
children: [/* @__PURE__ */ c(
|
|
7449
|
+
children: [/* @__PURE__ */ c(co, {}), /* @__PURE__ */ c("span", { children: "Photo" })]
|
|
7126
7450
|
}), f && /* @__PURE__ */ l("button", {
|
|
7127
7451
|
className: "ak-composer__attach-menu-item",
|
|
7128
|
-
onClick:
|
|
7452
|
+
onClick: Ae,
|
|
7129
7453
|
type: "button",
|
|
7130
7454
|
role: "menuitem",
|
|
7131
7455
|
disabled: t,
|
|
7132
|
-
children: [/* @__PURE__ */ c(
|
|
7456
|
+
children: [/* @__PURE__ */ c(lo, {}), /* @__PURE__ */ c("span", { children: "File" })]
|
|
7133
7457
|
})]
|
|
7134
7458
|
}),
|
|
7135
|
-
|
|
7459
|
+
b.length > 0 && /* @__PURE__ */ c("div", {
|
|
7136
7460
|
className: "ak-composer__attachments",
|
|
7137
7461
|
role: "list",
|
|
7138
|
-
children:
|
|
7462
|
+
children: b.map((e, n) => {
|
|
7139
7463
|
let r = `${e.file.name}-${n}`;
|
|
7140
7464
|
if (e.kind === "image") {
|
|
7141
|
-
let i =
|
|
7465
|
+
let i = S.get(e.file);
|
|
7142
7466
|
return /* @__PURE__ */ l("div", {
|
|
7143
7467
|
className: "ak-composer__preview-wrap",
|
|
7144
7468
|
role: "listitem",
|
|
@@ -7148,11 +7472,11 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7148
7472
|
className: "ak-composer__preview-img"
|
|
7149
7473
|
}), /* @__PURE__ */ c("button", {
|
|
7150
7474
|
className: "ak-composer__preview-remove",
|
|
7151
|
-
onClick: () =>
|
|
7475
|
+
onClick: () => ye(n),
|
|
7152
7476
|
type: "button",
|
|
7153
7477
|
"aria-label": `Remove ${e.file.name}`,
|
|
7154
7478
|
disabled: t,
|
|
7155
|
-
children: /* @__PURE__ */ c(
|
|
7479
|
+
children: /* @__PURE__ */ c(uo, {})
|
|
7156
7480
|
})]
|
|
7157
7481
|
}, r);
|
|
7158
7482
|
}
|
|
@@ -7160,7 +7484,7 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7160
7484
|
className: "ak-composer__file-chip",
|
|
7161
7485
|
role: "listitem",
|
|
7162
7486
|
children: [
|
|
7163
|
-
/* @__PURE__ */ c(
|
|
7487
|
+
/* @__PURE__ */ c(lo, {}),
|
|
7164
7488
|
/* @__PURE__ */ c("span", {
|
|
7165
7489
|
className: "ak-composer__file-chip-name",
|
|
7166
7490
|
title: e.file.name,
|
|
@@ -7168,61 +7492,90 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7168
7492
|
}),
|
|
7169
7493
|
/* @__PURE__ */ c("button", {
|
|
7170
7494
|
className: "ak-composer__file-chip-remove",
|
|
7171
|
-
onClick: () =>
|
|
7495
|
+
onClick: () => ye(n),
|
|
7172
7496
|
type: "button",
|
|
7173
7497
|
"aria-label": `Remove ${e.file.name}`,
|
|
7174
7498
|
disabled: t,
|
|
7175
|
-
children: /* @__PURE__ */ c(
|
|
7499
|
+
children: /* @__PURE__ */ c(uo, {})
|
|
7176
7500
|
})
|
|
7177
7501
|
]
|
|
7178
7502
|
}, r);
|
|
7179
7503
|
})
|
|
7180
7504
|
}),
|
|
7181
|
-
/* @__PURE__ */ l("
|
|
7505
|
+
fe && /* @__PURE__ */ l(s, { children: [d && /* @__PURE__ */ c("input", {
|
|
7506
|
+
ref: ee,
|
|
7507
|
+
type: "file",
|
|
7508
|
+
multiple: !0,
|
|
7509
|
+
accept: vo,
|
|
7510
|
+
className: "ak-composer__file-input",
|
|
7511
|
+
onChange: De,
|
|
7512
|
+
disabled: t,
|
|
7513
|
+
"aria-label": "Attach images"
|
|
7514
|
+
}), f && /* @__PURE__ */ c("input", {
|
|
7515
|
+
ref: j,
|
|
7516
|
+
type: "file",
|
|
7517
|
+
multiple: !0,
|
|
7518
|
+
accept: go,
|
|
7519
|
+
className: "ak-composer__file-input",
|
|
7520
|
+
onChange: Oe,
|
|
7521
|
+
disabled: t,
|
|
7522
|
+
"aria-label": "Attach files"
|
|
7523
|
+
})] }),
|
|
7524
|
+
/* @__PURE__ */ c("div", {
|
|
7182
7525
|
className: "ak-composer__input-wrap",
|
|
7183
|
-
children:
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
disabled: t,
|
|
7193
|
-
"aria-label": "Attach images"
|
|
7526
|
+
children: E ? /* @__PURE__ */ l("div", {
|
|
7527
|
+
className: "ak-composer__recording",
|
|
7528
|
+
children: [
|
|
7529
|
+
/* @__PURE__ */ c("button", {
|
|
7530
|
+
className: "ak-composer__recording-cancel",
|
|
7531
|
+
onClick: () => Ce(!0),
|
|
7532
|
+
"aria-label": "Cancel recording",
|
|
7533
|
+
type: "button",
|
|
7534
|
+
children: /* @__PURE__ */ c(uo, {})
|
|
7194
7535
|
}),
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
multiple: !0,
|
|
7199
|
-
accept: Za,
|
|
7200
|
-
className: "ak-composer__file-input",
|
|
7201
|
-
onChange: ae,
|
|
7202
|
-
disabled: t,
|
|
7203
|
-
"aria-label": "Attach files"
|
|
7536
|
+
/* @__PURE__ */ l("span", {
|
|
7537
|
+
className: "ak-composer__recording-timer",
|
|
7538
|
+
children: [/* @__PURE__ */ c("span", { className: "ak-composer__recording-dot" }), So(O)]
|
|
7204
7539
|
}),
|
|
7205
|
-
/* @__PURE__ */ c("
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7540
|
+
/* @__PURE__ */ c("button", {
|
|
7541
|
+
ref: ne,
|
|
7542
|
+
className: "ak-composer__recording-stop",
|
|
7543
|
+
onClick: () => Ce(!1),
|
|
7544
|
+
"aria-label": "Stop recording",
|
|
7545
|
+
type: "button",
|
|
7546
|
+
children: /* @__PURE__ */ c(po, {})
|
|
7547
|
+
})
|
|
7548
|
+
]
|
|
7549
|
+
}) : /* @__PURE__ */ l(s, { children: [
|
|
7550
|
+
fe && /* @__PURE__ */ c("div", {
|
|
7551
|
+
className: "ak-composer__attach-wrap",
|
|
7552
|
+
children: /* @__PURE__ */ c("button", {
|
|
7553
|
+
ref: te,
|
|
7554
|
+
className: `ak-composer__attach${w ? " ak-composer__attach--open" : ""}`,
|
|
7555
|
+
onClick: () => T((e) => !e),
|
|
7556
|
+
disabled: t,
|
|
7557
|
+
"aria-label": "Attachment options",
|
|
7558
|
+
"aria-haspopup": "true",
|
|
7559
|
+
"aria-expanded": w,
|
|
7560
|
+
type: "button",
|
|
7561
|
+
children: /* @__PURE__ */ c(so, {})
|
|
7218
7562
|
})
|
|
7219
|
-
|
|
7563
|
+
}),
|
|
7564
|
+
me && /* @__PURE__ */ c("button", {
|
|
7565
|
+
className: "ak-composer__mic",
|
|
7566
|
+
onClick: () => void Se(),
|
|
7567
|
+
disabled: t || b.length >= h,
|
|
7568
|
+
"aria-label": b.length >= h ? `Only ${h} attachments can be sent at once` : "Record a voice note",
|
|
7569
|
+
title: b.length >= h ? `Only ${h} attachments can be sent at once` : "Record a voice note",
|
|
7570
|
+
type: "button",
|
|
7571
|
+
children: /* @__PURE__ */ c(fo, {})
|
|
7572
|
+
}),
|
|
7220
7573
|
/* @__PURE__ */ c("textarea", {
|
|
7221
|
-
ref:
|
|
7574
|
+
ref: A,
|
|
7222
7575
|
className: "ak-composer__input",
|
|
7223
|
-
value:
|
|
7224
|
-
onInput:
|
|
7225
|
-
onKeyDown:
|
|
7576
|
+
value: v,
|
|
7577
|
+
onInput: Te,
|
|
7578
|
+
onKeyDown: we,
|
|
7226
7579
|
placeholder: u,
|
|
7227
7580
|
disabled: t,
|
|
7228
7581
|
rows: 1,
|
|
@@ -7230,13 +7583,13 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7230
7583
|
}),
|
|
7231
7584
|
/* @__PURE__ */ c("button", {
|
|
7232
7585
|
className: "ak-composer__send",
|
|
7233
|
-
onClick:
|
|
7234
|
-
disabled: !
|
|
7586
|
+
onClick: be,
|
|
7587
|
+
disabled: !je,
|
|
7235
7588
|
"aria-label": "Send message",
|
|
7236
7589
|
type: "button",
|
|
7237
|
-
children: /* @__PURE__ */ c(
|
|
7590
|
+
children: /* @__PURE__ */ c(oo, {})
|
|
7238
7591
|
})
|
|
7239
|
-
]
|
|
7592
|
+
] })
|
|
7240
7593
|
}),
|
|
7241
7594
|
/* @__PURE__ */ l("p", {
|
|
7242
7595
|
className: "ak-composer__disclaimer",
|
|
@@ -7244,7 +7597,7 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7244
7597
|
"By chatting you agree to our",
|
|
7245
7598
|
" ",
|
|
7246
7599
|
/* @__PURE__ */ c("a", {
|
|
7247
|
-
href:
|
|
7600
|
+
href: io,
|
|
7248
7601
|
target: "_blank",
|
|
7249
7602
|
rel: "noopener noreferrer",
|
|
7250
7603
|
children: "Privacy Policy"
|
|
@@ -7253,7 +7606,7 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7253
7606
|
"and",
|
|
7254
7607
|
" ",
|
|
7255
7608
|
/* @__PURE__ */ c("a", {
|
|
7256
|
-
href:
|
|
7609
|
+
href: ao,
|
|
7257
7610
|
target: "_blank",
|
|
7258
7611
|
rel: "noopener noreferrer",
|
|
7259
7612
|
children: "Terms of Service"
|
|
@@ -7267,7 +7620,7 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7267
7620
|
}
|
|
7268
7621
|
//#endregion
|
|
7269
7622
|
//#region ../../packages/widget-ui/src/components/ErrorState.tsx
|
|
7270
|
-
function
|
|
7623
|
+
function Eo({ message: e }) {
|
|
7271
7624
|
return e.includes("Origin not allowed") ? /* @__PURE__ */ l("div", {
|
|
7272
7625
|
className: "ak-error ak-error--origin",
|
|
7273
7626
|
role: "alert",
|
|
@@ -7301,7 +7654,7 @@ function ro({ message: e }) {
|
|
|
7301
7654
|
}
|
|
7302
7655
|
//#endregion
|
|
7303
7656
|
//#region ../../packages/widget-ui/src/components/MaintenanceState.tsx
|
|
7304
|
-
function
|
|
7657
|
+
function Do() {
|
|
7305
7658
|
return /* @__PURE__ */ l("svg", {
|
|
7306
7659
|
width: "28",
|
|
7307
7660
|
height: "28",
|
|
@@ -7319,7 +7672,7 @@ function io() {
|
|
|
7319
7672
|
}), /* @__PURE__ */ c("path", { d: "M12 7v5l3 2" })]
|
|
7320
7673
|
});
|
|
7321
7674
|
}
|
|
7322
|
-
function
|
|
7675
|
+
function Oo() {
|
|
7323
7676
|
return /* @__PURE__ */ l("div", {
|
|
7324
7677
|
className: "ak-maintenance",
|
|
7325
7678
|
role: "status",
|
|
@@ -7331,7 +7684,7 @@ function ao() {
|
|
|
7331
7684
|
}),
|
|
7332
7685
|
/* @__PURE__ */ c("div", {
|
|
7333
7686
|
className: "ak-maintenance__icon",
|
|
7334
|
-
children: /* @__PURE__ */ c(
|
|
7687
|
+
children: /* @__PURE__ */ c(Do, {})
|
|
7335
7688
|
}),
|
|
7336
7689
|
/* @__PURE__ */ c("p", {
|
|
7337
7690
|
className: "ak-maintenance__title",
|
|
@@ -7346,7 +7699,7 @@ function ao() {
|
|
|
7346
7699
|
}
|
|
7347
7700
|
//#endregion
|
|
7348
7701
|
//#region ../../packages/widget-ui/src/components/WidgetShell.tsx
|
|
7349
|
-
function
|
|
7702
|
+
function ko() {
|
|
7350
7703
|
return /* @__PURE__ */ l("svg", {
|
|
7351
7704
|
width: "11",
|
|
7352
7705
|
height: "11",
|
|
@@ -7365,11 +7718,11 @@ function oo() {
|
|
|
7365
7718
|
})]
|
|
7366
7719
|
});
|
|
7367
7720
|
}
|
|
7368
|
-
function
|
|
7721
|
+
function Ao() {
|
|
7369
7722
|
return /* @__PURE__ */ l("div", {
|
|
7370
7723
|
className: "ak-branding",
|
|
7371
7724
|
children: [
|
|
7372
|
-
/* @__PURE__ */ c(
|
|
7725
|
+
/* @__PURE__ */ c(ko, {}),
|
|
7373
7726
|
/* @__PURE__ */ c("span", {
|
|
7374
7727
|
className: "ak-branding__label",
|
|
7375
7728
|
children: "Powered by"
|
|
@@ -7381,7 +7734,8 @@ function so() {
|
|
|
7381
7734
|
]
|
|
7382
7735
|
});
|
|
7383
7736
|
}
|
|
7384
|
-
function
|
|
7737
|
+
function jo({ config: e, messages: t, isLoading: n, error: r, isInline: i, initStatus: a, initError: u, callbacks: d }) {
|
|
7738
|
+
let [f, p] = o(null);
|
|
7385
7739
|
return /* @__PURE__ */ l("div", {
|
|
7386
7740
|
className: i ? "ak-shell-wrap" : "ak-shell-wrap ak-shell-enter",
|
|
7387
7741
|
children: [/* @__PURE__ */ l("div", {
|
|
@@ -7389,12 +7743,12 @@ function co({ config: e, messages: t, isLoading: n, error: r, isInline: i, initS
|
|
|
7389
7743
|
role: "dialog",
|
|
7390
7744
|
"aria-label": e.title,
|
|
7391
7745
|
children: [
|
|
7392
|
-
/* @__PURE__ */ c(
|
|
7746
|
+
/* @__PURE__ */ c(Ma, {
|
|
7393
7747
|
title: e.title,
|
|
7394
7748
|
subtitle: e.subtitle,
|
|
7395
7749
|
avatarUrl: e.avatarUrl,
|
|
7396
|
-
onClose:
|
|
7397
|
-
onReset: a === "ready" ?
|
|
7750
|
+
onClose: d.onClose,
|
|
7751
|
+
onReset: a === "ready" ? d.onReset : void 0,
|
|
7398
7752
|
hideClose: i
|
|
7399
7753
|
}),
|
|
7400
7754
|
a === "validating" && /* @__PURE__ */ c("div", {
|
|
@@ -7406,41 +7760,46 @@ function co({ config: e, messages: t, isLoading: n, error: r, isInline: i, initS
|
|
|
7406
7760
|
}),
|
|
7407
7761
|
a === "error" && /* @__PURE__ */ c("div", {
|
|
7408
7762
|
className: "ak-init-status ak-init-status--error",
|
|
7409
|
-
children: /* @__PURE__ */ c(
|
|
7763
|
+
children: /* @__PURE__ */ c(Eo, { message: u ?? "Widget configuration is invalid." })
|
|
7410
7764
|
}),
|
|
7411
7765
|
a === "disabled" && /* @__PURE__ */ c("div", {
|
|
7412
7766
|
className: "ak-init-status ak-init-status--maintenance",
|
|
7413
|
-
children: /* @__PURE__ */ c(
|
|
7767
|
+
children: /* @__PURE__ */ c(Oo, {})
|
|
7414
7768
|
}),
|
|
7415
7769
|
a === "ready" && /* @__PURE__ */ l(s, { children: [
|
|
7416
|
-
t.length === 0 ? /* @__PURE__ */ c(
|
|
7770
|
+
t.length === 0 ? /* @__PURE__ */ c(ro, {
|
|
7417
7771
|
title: e.title,
|
|
7418
7772
|
description: e.description ?? e.subtitle,
|
|
7419
7773
|
suggestedQuestions: e.suggestedQuestions,
|
|
7420
7774
|
avatarUrl: e.avatarUrl,
|
|
7421
|
-
onSelect: (e) =>
|
|
7422
|
-
}) : /* @__PURE__ */ c(
|
|
7775
|
+
onSelect: (e) => d.onSendMessage(e, [])
|
|
7776
|
+
}) : /* @__PURE__ */ c(to, {
|
|
7423
7777
|
messages: t,
|
|
7424
7778
|
isLoading: n
|
|
7425
7779
|
}),
|
|
7426
|
-
r && /* @__PURE__ */ c(
|
|
7427
|
-
/* @__PURE__ */ c(
|
|
7428
|
-
onSend:
|
|
7780
|
+
(r || f) && /* @__PURE__ */ c(Eo, { message: r ?? f }),
|
|
7781
|
+
/* @__PURE__ */ c(To, {
|
|
7782
|
+
onSend: (e, t) => {
|
|
7783
|
+
p(null), d.onSendMessage(e, t);
|
|
7784
|
+
},
|
|
7785
|
+
onRecordingError: p,
|
|
7429
7786
|
disabled: n,
|
|
7430
7787
|
placeholder: "Type a message…",
|
|
7431
7788
|
photoSendingEnabled: e.photoSendingEnabled,
|
|
7432
7789
|
fileUploadEnabled: e.fileUploadEnabled,
|
|
7790
|
+
voiceNoteEnabled: e.voiceNoteEnabled,
|
|
7791
|
+
voiceNoteMaxDurationSec: e.voiceNoteMaxDurationSec,
|
|
7433
7792
|
attachmentMaxCount: e.attachmentMaxCount,
|
|
7434
7793
|
attachmentMaxFileSizeMb: e.attachmentMaxFileSizeMb
|
|
7435
7794
|
})
|
|
7436
7795
|
] })
|
|
7437
7796
|
]
|
|
7438
|
-
}), !i && /* @__PURE__ */ c(
|
|
7797
|
+
}), !i && /* @__PURE__ */ c(Ao, {})]
|
|
7439
7798
|
});
|
|
7440
7799
|
}
|
|
7441
7800
|
//#endregion
|
|
7442
7801
|
//#region ../../packages/widget-ui/src/components/Launcher.tsx
|
|
7443
|
-
function
|
|
7802
|
+
function Mo() {
|
|
7444
7803
|
return /* @__PURE__ */ c("svg", {
|
|
7445
7804
|
width: "24",
|
|
7446
7805
|
height: "24",
|
|
@@ -7453,7 +7812,7 @@ function lo() {
|
|
|
7453
7812
|
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" })
|
|
7454
7813
|
});
|
|
7455
7814
|
}
|
|
7456
|
-
function
|
|
7815
|
+
function No() {
|
|
7457
7816
|
return /* @__PURE__ */ c("svg", {
|
|
7458
7817
|
width: "22",
|
|
7459
7818
|
height: "22",
|
|
@@ -7466,7 +7825,7 @@ function uo() {
|
|
|
7466
7825
|
children: /* @__PURE__ */ c("polyline", { points: "6,9 12,15 18,9" })
|
|
7467
7826
|
});
|
|
7468
7827
|
}
|
|
7469
|
-
function
|
|
7828
|
+
function Po({ isOpen: e, onClick: t, avatarUrl: n, ariaLabel: r = "Toggle chat" }) {
|
|
7470
7829
|
let i = !e && !!n;
|
|
7471
7830
|
return /* @__PURE__ */ c("button", {
|
|
7472
7831
|
className: `ak-launcher${i ? " ak-launcher--avatar" : ""}`,
|
|
@@ -7474,31 +7833,31 @@ function fo({ isOpen: e, onClick: t, avatarUrl: n, ariaLabel: r = "Toggle chat"
|
|
|
7474
7833
|
"aria-label": r,
|
|
7475
7834
|
"aria-expanded": e,
|
|
7476
7835
|
type: "button",
|
|
7477
|
-
children: e ? /* @__PURE__ */ c(
|
|
7836
|
+
children: e ? /* @__PURE__ */ c(No, {}) : i ? /* @__PURE__ */ c("img", {
|
|
7478
7837
|
src: n,
|
|
7479
7838
|
alt: "",
|
|
7480
7839
|
className: "ak-launcher__avatar-img",
|
|
7481
7840
|
"aria-hidden": "true"
|
|
7482
|
-
}) : /* @__PURE__ */ c(
|
|
7841
|
+
}) : /* @__PURE__ */ c(Mo, {})
|
|
7483
7842
|
});
|
|
7484
7843
|
}
|
|
7485
7844
|
//#endregion
|
|
7486
7845
|
//#region ../../packages/widget-ui/src/WidgetApp.tsx
|
|
7487
|
-
function
|
|
7846
|
+
function Fo({ config: e, state: t, callbacks: n }) {
|
|
7488
7847
|
let i = e.mode === "inline", o = a(null);
|
|
7489
7848
|
return r(() => {
|
|
7490
7849
|
let t = o.current?.getRootNode()?.host;
|
|
7491
7850
|
if (!t) return;
|
|
7492
|
-
let n =
|
|
7851
|
+
let n = Da(e.theme.mode);
|
|
7493
7852
|
t.setAttribute("data-theme", n);
|
|
7494
7853
|
}, [e.theme.mode]), r(() => {
|
|
7495
7854
|
if (i) return;
|
|
7496
7855
|
let e = o.current?.getRootNode()?.host;
|
|
7497
7856
|
e && (t.isOpen ? e.setAttribute("data-open", "") : e.removeAttribute("data-open"));
|
|
7498
|
-
}, [i, t.isOpen]), i ? /* @__PURE__ */ c("div", {
|
|
7857
|
+
}, [i, t.isOpen]), t.initStatus === "disabled" && !i ? null : i ? /* @__PURE__ */ c("div", {
|
|
7499
7858
|
ref: o,
|
|
7500
7859
|
className: "ak-inline",
|
|
7501
|
-
children: /* @__PURE__ */ c(
|
|
7860
|
+
children: /* @__PURE__ */ c(jo, {
|
|
7502
7861
|
config: e,
|
|
7503
7862
|
messages: t.messages,
|
|
7504
7863
|
isLoading: t.isLoading,
|
|
@@ -7511,7 +7870,7 @@ function po({ config: e, state: t, callbacks: n }) {
|
|
|
7511
7870
|
}) : /* @__PURE__ */ l("div", {
|
|
7512
7871
|
ref: o,
|
|
7513
7872
|
className: "ak-floating",
|
|
7514
|
-
children: [t.isOpen && /* @__PURE__ */ c(
|
|
7873
|
+
children: [t.isOpen && /* @__PURE__ */ c(jo, {
|
|
7515
7874
|
config: e,
|
|
7516
7875
|
messages: t.messages,
|
|
7517
7876
|
isLoading: t.isLoading,
|
|
@@ -7520,7 +7879,7 @@ function po({ config: e, state: t, callbacks: n }) {
|
|
|
7520
7879
|
initStatus: t.initStatus,
|
|
7521
7880
|
initError: t.initError,
|
|
7522
7881
|
callbacks: n
|
|
7523
|
-
}), /* @__PURE__ */ c(
|
|
7882
|
+
}), /* @__PURE__ */ c(Po, {
|
|
7524
7883
|
isOpen: t.isOpen,
|
|
7525
7884
|
onClick: t.isOpen ? n.onClose : n.onOpen,
|
|
7526
7885
|
avatarUrl: e.avatarUrl
|
|
@@ -7529,15 +7888,15 @@ function po({ config: e, state: t, callbacks: n }) {
|
|
|
7529
7888
|
}
|
|
7530
7889
|
//#endregion
|
|
7531
7890
|
//#region ../../packages/widget-ui/src/index.ts
|
|
7532
|
-
var
|
|
7891
|
+
var Io = (n, r, i, a) => {
|
|
7533
7892
|
let o = e(n);
|
|
7534
|
-
return o.render(t(
|
|
7893
|
+
return o.render(t(Fo, {
|
|
7535
7894
|
config: r,
|
|
7536
7895
|
state: i,
|
|
7537
7896
|
callbacks: a
|
|
7538
7897
|
})), {
|
|
7539
7898
|
update(e, n) {
|
|
7540
|
-
o.render(t(
|
|
7899
|
+
o.render(t(Fo, {
|
|
7541
7900
|
config: n,
|
|
7542
7901
|
state: e,
|
|
7543
7902
|
callbacks: a
|
|
@@ -7550,28 +7909,28 @@ var mo = (n, r, i, a) => {
|
|
|
7550
7909
|
}
|
|
7551
7910
|
};
|
|
7552
7911
|
};
|
|
7553
|
-
function
|
|
7554
|
-
return
|
|
7912
|
+
function Lo(e) {
|
|
7913
|
+
return Oa + "\n" + Ea(e);
|
|
7555
7914
|
}
|
|
7556
7915
|
//#endregion
|
|
7557
7916
|
//#region src/api.ts
|
|
7558
|
-
function
|
|
7559
|
-
return
|
|
7917
|
+
function Ro(e, t) {
|
|
7918
|
+
return Lo(gt({
|
|
7560
7919
|
...e,
|
|
7561
7920
|
mode: t
|
|
7562
7921
|
}));
|
|
7563
7922
|
}
|
|
7564
|
-
function
|
|
7565
|
-
return
|
|
7923
|
+
function zo(e, t = Io, n) {
|
|
7924
|
+
return xa(e, t, n ?? Ro(e, "floating"));
|
|
7566
7925
|
}
|
|
7567
|
-
function
|
|
7568
|
-
return
|
|
7926
|
+
function Bo(e, t, n = Io, r) {
|
|
7927
|
+
return Ca(e, t, n, r ?? Ro(t, "inline"));
|
|
7569
7928
|
}
|
|
7570
|
-
function
|
|
7571
|
-
return
|
|
7929
|
+
function Vo(e, t, n = Io, r) {
|
|
7930
|
+
return Sa(e, t, n, r ?? Ro(t, "floating"));
|
|
7572
7931
|
}
|
|
7573
|
-
function
|
|
7574
|
-
|
|
7932
|
+
function Ho(e) {
|
|
7933
|
+
wa(e);
|
|
7575
7934
|
}
|
|
7576
7935
|
//#endregion
|
|
7577
|
-
export {
|
|
7936
|
+
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 };
|