@telia-ace/ace-chat-flamingo 1.1.120-rc.6 → 1.1.120-rc.8

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/index.mjs CHANGED
@@ -1,30 +1,6 @@
1
1
  var cl = Object.defineProperty;
2
2
  var ul = (n, e, t) => e in n ? cl(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var A = (n, e, t) => ul(n, typeof e != "symbol" ? e + "" : e, t);
4
- class Xi {
5
- constructor() {
6
- this.registeredProviders = /* @__PURE__ */ new Map();
7
- }
8
- static async getInstance(e) {
9
- let t = await e.get("conversation");
10
- return t || (t = new Xi(), await e.register("conversation", t), t);
11
- }
12
- registerProvider(e, t) {
13
- this.registeredProviders.set(e, t);
14
- }
15
- // private getProviderByConfiguration(
16
- // component: Conversation
17
- // ): ProviderFactory | undefined {
18
- // const [providerKey] = (component.properties['providers'] || []) as string[];
19
- // if (!providerKey) {
20
- // console.warn(
21
- // `No providers registered. You most likely forgot to add a provider to the conversation component properties.`
22
- // );
23
- // return;
24
- // }
25
- // return this.registeredProviders.get(providerKey);
26
- // }
27
- }
28
4
  var Ai = function(n, e) {
29
5
  return Ai = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
30
6
  t.__proto__ = i;
@@ -68,7 +44,7 @@ function hl(n, e, t, i) {
68
44
  c((i = i.apply(n, e || [])).next());
69
45
  });
70
46
  }
71
- function Co(n, e) {
47
+ function _o(n, e) {
72
48
  var t = { label: 0, sent: function() {
73
49
  if (r[0] & 1) throw r[1];
74
50
  return r[1];
@@ -220,7 +196,7 @@ function pl(n) {
220
196
  }, o);
221
197
  }
222
198
  }
223
- function C(n) {
199
+ function _(n) {
224
200
  return typeof n == "function";
225
201
  }
226
202
  function Eo(n) {
@@ -272,7 +248,7 @@ var Yt = function() {
272
248
  else
273
249
  o.remove(this);
274
250
  var u = this.initialTeardown;
275
- if (C(u))
251
+ if (_(u))
276
252
  try {
277
253
  u();
278
254
  } catch ($) {
@@ -334,10 +310,10 @@ var Yt = function() {
334
310
  }(), n;
335
311
  }(), Ao = Yt.EMPTY;
336
312
  function To(n) {
337
- return n instanceof Yt || n && "closed" in n && C(n.remove) && C(n.add) && C(n.unsubscribe);
313
+ return n instanceof Yt || n && "closed" in n && _(n.remove) && _(n.add) && _(n.unsubscribe);
338
314
  }
339
315
  function $r(n) {
340
- C(n) ? n() : n.unsubscribe();
316
+ _(n) ? n() : n.unsubscribe();
341
317
  }
342
318
  var fl = {
343
319
  Promise: void 0
@@ -362,7 +338,7 @@ function $n() {
362
338
  function gn(n) {
363
339
  n();
364
340
  }
365
- var Ki = function(n) {
341
+ var Xi = function(n) {
366
342
  Ae(e, n);
367
343
  function e(t) {
368
344
  var i = n.call(this) || this;
@@ -428,14 +404,14 @@ var Ki = function(n) {
428
404
  Ae(e, n);
429
405
  function e(t, i, s) {
430
406
  var r = n.call(this) || this, o;
431
- return C(t) || !t ? o = {
407
+ return _(t) || !t ? o = {
432
408
  next: t ?? void 0,
433
409
  error: i ?? void 0,
434
410
  complete: s ?? void 0
435
411
  } : o = t, r.destination = new ml(o), r;
436
412
  }
437
413
  return e;
438
- }(Ki);
414
+ }(Xi);
439
415
  function un(n) {
440
416
  Oo(n);
441
417
  }
@@ -447,7 +423,7 @@ var bl = {
447
423
  next: $n,
448
424
  error: vl,
449
425
  complete: $n
450
- }, Ji = function() {
426
+ }, Ki = function() {
451
427
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
452
428
  }();
453
429
  function wt(n) {
@@ -498,7 +474,7 @@ var j = function() {
498
474
  }, n.prototype._subscribe = function(e) {
499
475
  var t;
500
476
  return (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(e);
501
- }, n.prototype[Ji] = function() {
477
+ }, n.prototype[Ki] = function() {
502
478
  return this;
503
479
  }, n.prototype.pipe = function() {
504
480
  for (var e = [], t = 0; t < arguments.length; t++)
@@ -525,13 +501,13 @@ function wr(n) {
525
501
  return (e = n ?? fl.Promise) !== null && e !== void 0 ? e : Promise;
526
502
  }
527
503
  function $l(n) {
528
- return n && C(n.next) && C(n.error) && C(n.complete);
504
+ return n && _(n.next) && _(n.error) && _(n.complete);
529
505
  }
530
506
  function wl(n) {
531
- return n && n instanceof Ki || $l(n) && To(n);
507
+ return n && n instanceof Xi || $l(n) && To(n);
532
508
  }
533
509
  function xl(n) {
534
- return C(n == null ? void 0 : n.lift);
510
+ return _(n == null ? void 0 : n.lift);
535
511
  }
536
512
  function ne(n) {
537
513
  return function(e) {
@@ -584,7 +560,7 @@ var kl = function(n) {
584
560
  n.prototype.unsubscribe.call(this), !i && ((t = this.onFinalize) === null || t === void 0 || t.call(this));
585
561
  }
586
562
  }, e;
587
- }(Ki), Sl = Eo(function(n) {
563
+ }(Xi), Sl = Eo(function(n) {
588
564
  return function() {
589
565
  n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
590
566
  };
@@ -709,11 +685,11 @@ var kl = function(n) {
709
685
  }, e.prototype.next = function(t) {
710
686
  n.prototype.next.call(this, this._value = t);
711
687
  }, e;
712
- }(P), _l = {
688
+ }(P), Cl = {
713
689
  now: function() {
714
690
  return Date.now();
715
691
  }
716
- }, Cl = function(n) {
692
+ }, _l = function(n) {
717
693
  Ae(e, n);
718
694
  function e(t, i) {
719
695
  return n.call(this) || this;
@@ -773,13 +749,13 @@ var kl = function(n) {
773
749
  this.work = this.state = this.scheduler = null, this.pending = !1, yn(r, this), i != null && (this.id = this.recycleAsyncId(s, i, null)), this.delay = null, n.prototype.unsubscribe.call(this);
774
750
  }
775
751
  }, e;
776
- }(Cl), Sr = function() {
752
+ }(_l), Sr = function() {
777
753
  function n(e, t) {
778
754
  t === void 0 && (t = n.now), this.schedulerActionCtor = e, this.now = t;
779
755
  }
780
756
  return n.prototype.schedule = function(e, t, i) {
781
757
  return t === void 0 && (t = 0), new this.schedulerActionCtor(this, e).schedule(i, t);
782
- }, n.now = _l.now, n;
758
+ }, n.now = Cl.now, n;
783
759
  }(), Al = function(n) {
784
760
  Ae(e, n);
785
761
  function e(t, i) {
@@ -810,31 +786,31 @@ var Xe = new j(function(n) {
810
786
  return n.complete();
811
787
  });
812
788
  function Tl(n) {
813
- return n && C(n.schedule);
789
+ return n && _(n.schedule);
814
790
  }
815
- function es(n) {
791
+ function Ji(n) {
816
792
  return n[n.length - 1];
817
793
  }
818
794
  function Lo(n) {
819
- return C(es(n)) ? n.pop() : void 0;
795
+ return _(Ji(n)) ? n.pop() : void 0;
820
796
  }
821
- function ts(n) {
822
- return Tl(es(n)) ? n.pop() : void 0;
797
+ function es(n) {
798
+ return Tl(Ji(n)) ? n.pop() : void 0;
823
799
  }
824
800
  function Ol(n, e) {
825
- return typeof es(n) == "number" ? n.pop() : e;
801
+ return typeof Ji(n) == "number" ? n.pop() : e;
826
802
  }
827
- var ns = function(n) {
803
+ var ts = function(n) {
828
804
  return n && typeof n.length == "number" && typeof n != "function";
829
805
  };
830
806
  function Ro(n) {
831
- return C(n == null ? void 0 : n.then);
807
+ return _(n == null ? void 0 : n.then);
832
808
  }
833
809
  function Io(n) {
834
- return C(n[Ji]);
810
+ return _(n[Ki]);
835
811
  }
836
812
  function Po(n) {
837
- return Symbol.asyncIterator && C(n == null ? void 0 : n[Symbol.asyncIterator]);
813
+ return Symbol.asyncIterator && _(n == null ? void 0 : n[Symbol.asyncIterator]);
838
814
  }
839
815
  function Mo(n) {
840
816
  return new TypeError("You provided " + (n !== null && typeof n == "object" ? "an invalid object" : "'" + n + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
@@ -844,12 +820,12 @@ function Ll() {
844
820
  }
845
821
  var Do = Ll();
846
822
  function Uo(n) {
847
- return C(n == null ? void 0 : n[Do]);
823
+ return _(n == null ? void 0 : n[Do]);
848
824
  }
849
825
  function No(n) {
850
826
  return dl(this, arguments, function() {
851
827
  var t, i, s, r;
852
- return Co(this, function(o) {
828
+ return _o(this, function(o) {
853
829
  switch (o.label) {
854
830
  case 0:
855
831
  t = n.getReader(), o.label = 1;
@@ -878,7 +854,7 @@ function No(n) {
878
854
  });
879
855
  }
880
856
  function zo(n) {
881
- return C(n == null ? void 0 : n.getReader);
857
+ return _(n == null ? void 0 : n.getReader);
882
858
  }
883
859
  function ie(n) {
884
860
  if (n instanceof j)
@@ -886,7 +862,7 @@ function ie(n) {
886
862
  if (n != null) {
887
863
  if (Io(n))
888
864
  return Rl(n);
889
- if (ns(n))
865
+ if (ts(n))
890
866
  return Il(n);
891
867
  if (Ro(n))
892
868
  return Pl(n);
@@ -901,8 +877,8 @@ function ie(n) {
901
877
  }
902
878
  function Rl(n) {
903
879
  return new j(function(e) {
904
- var t = n[Ji]();
905
- if (C(t.subscribe))
880
+ var t = n[Ki]();
881
+ if (_(t.subscribe))
906
882
  return t.subscribe(e);
907
883
  throw new TypeError("Provided object does not correctly implement Symbol.observable");
908
884
  });
@@ -958,7 +934,7 @@ function Ul(n, e) {
958
934
  var t, i, s, r;
959
935
  return hl(this, void 0, void 0, function() {
960
936
  var o, a;
961
- return Co(this, function(l) {
937
+ return _o(this, function(l) {
962
938
  switch (l.label) {
963
939
  case 0:
964
940
  l.trys.push([0, 5, 6, 11]), t = pl(n), l.label = 1;
@@ -1053,7 +1029,7 @@ function Hl(n, e) {
1053
1029
  o ? t.complete() : t.next(r);
1054
1030
  }, 0, !0);
1055
1031
  }), function() {
1056
- return C(i == null ? void 0 : i.return) && i.return();
1032
+ return _(i == null ? void 0 : i.return) && i.return();
1057
1033
  };
1058
1034
  });
1059
1035
  }
@@ -1078,7 +1054,7 @@ function Bl(n, e) {
1078
1054
  if (n != null) {
1079
1055
  if (Io(n))
1080
1056
  return Nl(n, e);
1081
- if (ns(n))
1057
+ if (ts(n))
1082
1058
  return jl(n, e);
1083
1059
  if (Ro(n))
1084
1060
  return zl(n, e);
@@ -1097,7 +1073,7 @@ function Ve(n, e) {
1097
1073
  function Oi() {
1098
1074
  for (var n = [], e = 0; e < arguments.length; e++)
1099
1075
  n[e] = arguments[e];
1100
- var t = ts(n);
1076
+ var t = es(n);
1101
1077
  return Ve(n, t);
1102
1078
  }
1103
1079
  function wn(n, e) {
@@ -1146,7 +1122,7 @@ function Kl(n, e) {
1146
1122
  function Jl() {
1147
1123
  for (var n = [], e = 0; e < arguments.length; e++)
1148
1124
  n[e] = arguments[e];
1149
- var t = ts(n), i = Lo(n), s = Ql(n), r = s.args, o = s.keys;
1125
+ var t = es(n), i = Lo(n), s = Ql(n), r = s.args, o = s.keys;
1150
1126
  if (r.length === 0)
1151
1127
  return Ve([], t);
1152
1128
  var a = new j(ec(r, t, o ? function(l) {
@@ -1156,9 +1132,9 @@ function Jl() {
1156
1132
  }
1157
1133
  function ec(n, e, t) {
1158
1134
  return t === void 0 && (t = wt), function(i) {
1159
- _r(e, function() {
1135
+ Cr(e, function() {
1160
1136
  for (var s = n.length, r = new Array(s), o = s, a = s, l = function(u) {
1161
- _r(e, function() {
1137
+ Cr(e, function() {
1162
1138
  var p = Ve(n[u], e), d = !1;
1163
1139
  p.subscribe(G(i, function(g) {
1164
1140
  r[u] = g, d || (d = !0, a--), a || i.next(t(r.slice()));
@@ -1171,7 +1147,7 @@ function ec(n, e, t) {
1171
1147
  }, i);
1172
1148
  };
1173
1149
  }
1174
- function _r(n, e, t) {
1150
+ function Cr(n, e, t) {
1175
1151
  n ? Pe(t, n, e) : e();
1176
1152
  }
1177
1153
  function tc(n, e, t, i, s, r, o, a) {
@@ -1207,7 +1183,7 @@ function tc(n, e, t, i, s, r, o, a) {
1207
1183
  };
1208
1184
  }
1209
1185
  function zt(n, e, t) {
1210
- return t === void 0 && (t = 1 / 0), C(e) ? zt(function(i, s) {
1186
+ return t === void 0 && (t = 1 / 0), _(e) ? zt(function(i, s) {
1211
1187
  return wn(function(r, o) {
1212
1188
  return e(i, r, s, o);
1213
1189
  })(ie(n(i, s)));
@@ -1225,14 +1201,14 @@ function ic(n) {
1225
1201
  }
1226
1202
  var sc = ["addListener", "removeListener"], rc = ["addEventListener", "removeEventListener"], oc = ["on", "off"];
1227
1203
  function xn(n, e, t, i) {
1228
- if (C(t) && (i = t, t = void 0), i)
1204
+ if (_(t) && (i = t, t = void 0), i)
1229
1205
  return xn(n, e, t).pipe(qo(i));
1230
1206
  var s = De(cc(n) ? rc.map(function(a) {
1231
1207
  return function(l) {
1232
1208
  return n[a](e, l, t);
1233
1209
  };
1234
- }) : ac(n) ? sc.map(Cr(n, e)) : lc(n) ? oc.map(Cr(n, e)) : [], 2), r = s[0], o = s[1];
1235
- if (!r && ns(n))
1210
+ }) : ac(n) ? sc.map(_r(n, e)) : lc(n) ? oc.map(_r(n, e)) : [], 2), r = s[0], o = s[1];
1211
+ if (!r && ts(n))
1236
1212
  return zt(function(a) {
1237
1213
  return xn(a, e, t);
1238
1214
  })(ie(n));
@@ -1249,7 +1225,7 @@ function xn(n, e, t, i) {
1249
1225
  };
1250
1226
  });
1251
1227
  }
1252
- function Cr(n, e) {
1228
+ function _r(n, e) {
1253
1229
  return function(t) {
1254
1230
  return function(i) {
1255
1231
  return n[t](e, i);
@@ -1257,18 +1233,18 @@ function Cr(n, e) {
1257
1233
  };
1258
1234
  }
1259
1235
  function ac(n) {
1260
- return C(n.addListener) && C(n.removeListener);
1236
+ return _(n.addListener) && _(n.removeListener);
1261
1237
  }
1262
1238
  function lc(n) {
1263
- return C(n.on) && C(n.off);
1239
+ return _(n.on) && _(n.off);
1264
1240
  }
1265
1241
  function cc(n) {
1266
- return C(n.addEventListener) && C(n.removeEventListener);
1242
+ return _(n.addEventListener) && _(n.removeEventListener);
1267
1243
  }
1268
1244
  function uc() {
1269
1245
  for (var n = [], e = 0; e < arguments.length; e++)
1270
1246
  n[e] = arguments[e];
1271
- var t = ts(n), i = Ol(n, 1 / 0), s = n;
1247
+ var t = es(n), i = Ol(n, 1 / 0), s = n;
1272
1248
  return s.length ? s.length === 1 ? ie(s[0]) : nc(i)(Ve(s, t)) : Xe;
1273
1249
  }
1274
1250
  function K(n, e) {
@@ -1288,7 +1264,7 @@ function Li(n) {
1288
1264
  });
1289
1265
  }
1290
1266
  function pi(n, e) {
1291
- return C(e) ? zt(n, e, 1) : zt(n, 1);
1267
+ return _(e) ? zt(n, e, 1) : zt(n, 1);
1292
1268
  }
1293
1269
  function he(n) {
1294
1270
  return n <= 0 ? function() {
@@ -1318,7 +1294,7 @@ function fi(n) {
1318
1294
  l();
1319
1295
  });
1320
1296
  }
1321
- function _e(n, e) {
1297
+ function Ce(n, e) {
1322
1298
  return ne(function(t, i) {
1323
1299
  var s = null, r = 0, o = !1, a = function() {
1324
1300
  return o && !s && i.complete();
@@ -1344,7 +1320,7 @@ function B(n) {
1344
1320
  });
1345
1321
  }
1346
1322
  function hc(n, e, t) {
1347
- var i = C(n) || e || t ? { next: n, error: e, complete: t } : n;
1323
+ var i = _(n) || e || t ? { next: n, error: e, complete: t } : n;
1348
1324
  return i ? ne(function(s, r) {
1349
1325
  var o;
1350
1326
  (o = i.subscribe) === null || o === void 0 || o.call(i);
@@ -1385,6 +1361,30 @@ function Ri() {
1385
1361
  }));
1386
1362
  });
1387
1363
  }
1364
+ class ns {
1365
+ constructor() {
1366
+ this.registeredProviders = /* @__PURE__ */ new Map();
1367
+ }
1368
+ static async getInstance(e) {
1369
+ let t = await e.get("conversation");
1370
+ return t || (t = new ns(), await e.register("conversation", t), t);
1371
+ }
1372
+ registerProvider(e, t) {
1373
+ this.registeredProviders.set(e, t);
1374
+ }
1375
+ // private getProviderByConfiguration(
1376
+ // component: Conversation
1377
+ // ): ProviderFactory | undefined {
1378
+ // const [providerKey] = (component.properties['providers'] || []) as string[];
1379
+ // if (!providerKey) {
1380
+ // console.warn(
1381
+ // `No providers registered. You most likely forgot to add a provider to the conversation component properties.`
1382
+ // );
1383
+ // return;
1384
+ // }
1385
+ // return this.registeredProviders.get(providerKey);
1386
+ // }
1387
+ }
1388
1388
  var z = /* @__PURE__ */ ((n) => (n.User = "user", n.Agent = "agent", n.System = "system", n))(z || {});
1389
1389
  const dc = () => "10000000-1000-4000-8000-100000000000".replace(
1390
1390
  /[018]/g,
@@ -1658,10 +1658,10 @@ const bc = (n) => new Go(typeof n == "string" ? n : n + "", void 0, ss), T = (n,
1658
1658
  * Copyright 2017 Google LLC
1659
1659
  * SPDX-License-Identifier: BSD-3-Clause
1660
1660
  */
1661
- const { is: $c, defineProperty: wc, getOwnPropertyDescriptor: xc, getOwnPropertyNames: kc, getOwnPropertySymbols: Sc, getPrototypeOf: _c } = Object, Me = globalThis, Or = Me.trustedTypes, Cc = Or ? Or.emptyScript : "", gi = Me.reactiveElementPolyfillSupport, Mt = (n, e) => n, kn = { toAttribute(n, e) {
1661
+ const { is: $c, defineProperty: wc, getOwnPropertyDescriptor: xc, getOwnPropertyNames: kc, getOwnPropertySymbols: Sc, getPrototypeOf: Cc } = Object, Me = globalThis, Or = Me.trustedTypes, _c = Or ? Or.emptyScript : "", gi = Me.reactiveElementPolyfillSupport, Mt = (n, e) => n, kn = { toAttribute(n, e) {
1662
1662
  switch (e) {
1663
1663
  case Boolean:
1664
- n = n ? Cc : null;
1664
+ n = n ? _c : null;
1665
1665
  break;
1666
1666
  case Object:
1667
1667
  case Array:
@@ -1717,7 +1717,7 @@ let at = class extends HTMLElement {
1717
1717
  }
1718
1718
  static _$Ei() {
1719
1719
  if (this.hasOwnProperty(Mt("elementProperties"))) return;
1720
- const e = _c(this);
1720
+ const e = Cc(this);
1721
1721
  e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
1722
1722
  }
1723
1723
  static finalize() {
@@ -1897,7 +1897,7 @@ at.elementStyles = [], at.shadowRootOptions = { mode: "open" }, at[Mt("elementPr
1897
1897
  */
1898
1898
  const Dt = globalThis, Sn = Dt.trustedTypes, Rr = Sn ? Sn.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Zo = "$lit$", Re = `lit$${Math.random().toFixed(9).slice(2)}$`, Yo = "?" + Re, Ec = `<${Yo}>`, Ze = document, jt = () => Ze.createComment(""), Ht = (n) => n === null || typeof n != "object" && typeof n != "function", os = Array.isArray, Ac = (n) => os(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", mi = `[
1899
1899
  \f\r]`, Et = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ir = /-->/g, Pr = />/g, Fe = RegExp(`>|${mi}(?:([^\\s"'>=/]+)(${mi}*=${mi}*(?:[^
1900
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Mr = /'/g, Dr = /"/g, Qo = /^(?:script|style|textarea|title)$/i, Tc = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), y = Tc(1), Ce = Symbol.for("lit-noChange"), w = Symbol.for("lit-nothing"), Ur = /* @__PURE__ */ new WeakMap(), qe = Ze.createTreeWalker(Ze, 129);
1900
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Mr = /'/g, Dr = /"/g, Qo = /^(?:script|style|textarea|title)$/i, Tc = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), y = Tc(1), _e = Symbol.for("lit-noChange"), w = Symbol.for("lit-nothing"), Ur = /* @__PURE__ */ new WeakMap(), qe = Ze.createTreeWalker(Ze, 129);
1901
1901
  function Xo(n, e) {
1902
1902
  if (!os(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
1903
1903
  return Rr !== void 0 ? Rr.createHTML(e) : e;
@@ -1953,7 +1953,7 @@ let Mi = class Ko {
1953
1953
  };
1954
1954
  function mt(n, e, t = n, i) {
1955
1955
  var o, a;
1956
- if (e === Ce) return e;
1956
+ if (e === _e) return e;
1957
1957
  let s = i !== void 0 ? (o = t._$Co) == null ? void 0 : o[i] : t._$Cl;
1958
1958
  const r = Ht(e) ? void 0 : e._$litDirective$;
1959
1959
  return (s == null ? void 0 : s.constructor) !== r && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), r === void 0 ? s = void 0 : (s = new r(n), s._$AT(n, t, i)), i !== void 0 ? (t._$Co ?? (t._$Co = []))[i] = s : t._$Cl = s), s !== void 0 && (e = mt(n, s._$AS(n, e.values), s, i)), e;
@@ -2006,7 +2006,7 @@ class Qt {
2006
2006
  return this._$AB;
2007
2007
  }
2008
2008
  _$AI(e, t = this) {
2009
- e = mt(this, e, t), Ht(e) ? e === w || e == null || e === "" ? (this._$AH !== w && this._$AR(), this._$AH = w) : e !== this._$AH && e !== Ce && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ac(e) ? this.k(e) : this._(e);
2009
+ e = mt(this, e, t), Ht(e) ? e === w || e == null || e === "" ? (this._$AH !== w && this._$AR(), this._$AH = w) : e !== this._$AH && e !== _e && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ac(e) ? this.k(e) : this._(e);
2010
2010
  }
2011
2011
  O(e) {
2012
2012
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -2062,11 +2062,11 @@ class Vn {
2062
2062
  _$AI(e, t = this, i, s) {
2063
2063
  const r = this.strings;
2064
2064
  let o = !1;
2065
- if (r === void 0) e = mt(this, e, t, 0), o = !Ht(e) || e !== this._$AH && e !== Ce, o && (this._$AH = e);
2065
+ if (r === void 0) e = mt(this, e, t, 0), o = !Ht(e) || e !== this._$AH && e !== _e, o && (this._$AH = e);
2066
2066
  else {
2067
2067
  const a = e;
2068
2068
  let l, c;
2069
- for (e = r[0], l = 0; l < r.length - 1; l++) c = mt(this, a[i + l], t, l), c === Ce && (c = this._$AH[l]), o || (o = !Ht(c) || c !== this._$AH[l]), c === w ? e = w : e !== w && (e += (c ?? "") + r[l + 1]), this._$AH[l] = c;
2069
+ for (e = r[0], l = 0; l < r.length - 1; l++) c = mt(this, a[i + l], t, l), c === _e && (c = this._$AH[l]), o || (o = !Ht(c) || c !== this._$AH[l]), c === w ? e = w : e !== w && (e += (c ?? "") + r[l + 1]), this._$AH[l] = c;
2070
2070
  }
2071
2071
  o && !s && this.j(e);
2072
2072
  }
@@ -2095,7 +2095,7 @@ class Pc extends Vn {
2095
2095
  super(e, t, i, s, r), this.type = 5;
2096
2096
  }
2097
2097
  _$AI(e, t = this) {
2098
- if ((e = mt(this, e, t, 0) ?? w) === Ce) return;
2098
+ if ((e = mt(this, e, t, 0) ?? w) === _e) return;
2099
2099
  const i = this._$AH, s = e === w && i !== w || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, r = e !== w && (i === w || s);
2100
2100
  s && this.element.removeEventListener(this.name, this, i), r && this.element.addEventListener(this.name, this, e), this._$AH = e;
2101
2101
  }
@@ -2154,11 +2154,11 @@ let E = class extends at {
2154
2154
  super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
2155
2155
  }
2156
2156
  render() {
2157
- return Ce;
2157
+ return _e;
2158
2158
  }
2159
2159
  };
2160
- var _o;
2161
- E._$litElement$ = !0, E.finalized = !0, (_o = We.litElementHydrateSupport) == null || _o.call(We, { LitElement: E });
2160
+ var Co;
2161
+ E._$litElement$ = !0, E.finalized = !0, (Co = We.litElementHydrateSupport) == null || Co.call(We, { LitElement: E });
2162
2162
  const bi = We.litElementPolyfillSupport;
2163
2163
  bi == null || bi({ LitElement: E });
2164
2164
  (We.litElementVersions ?? (We.litElementVersions = [])).push("4.2.0");
@@ -2246,7 +2246,7 @@ const Uc = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" f
2246
2246
  transformTagName: !1,
2247
2247
  attachStyles: !0
2248
2248
  };
2249
- let ct, ia, Wn, sa = !1, _n = !1, ls = !1, ee = !1, jr = null, Di = !1;
2249
+ let ct, ia, Wn, sa = !1, Cn = !1, ls = !1, ee = !1, jr = null, Di = !1;
2250
2250
  const Gn = typeof window < "u" ? window : {}, fe = Gn.document || { head: {} }, ra = Gn.HTMLElement || class {
2251
2251
  }, Z = {
2252
2252
  $flags$: 0,
@@ -2307,7 +2307,7 @@ const Gn = typeof window < "u" ? window : {}, fe = Gn.document || { head: {} },
2307
2307
  let i = null, s = null, r = null, o = !1, a = !1, l = [];
2308
2308
  const c = (p) => {
2309
2309
  for (let d = 0; d < p.length; d++)
2310
- i = p[d], Array.isArray(i) ? c(i) : i != null && typeof i != "boolean" && ((o = typeof n != "function" && !cs(i)) && (i = String(i)), o && a ? l[l.length - 1].$text$ += i : l.push(o ? Cn(null, i) : i), a = o);
2310
+ i = p[d], Array.isArray(i) ? c(i) : i != null && typeof i != "boolean" && ((o = typeof n != "function" && !cs(i)) && (i = String(i)), o && a ? l[l.length - 1].$text$ += i : l.push(o ? _n(null, i) : i), a = o);
2311
2311
  };
2312
2312
  if (c(t), e) {
2313
2313
  e.key && (s = e.key), e.name && (r = e.name);
@@ -2318,9 +2318,9 @@ const Gn = typeof window < "u" ? window : {}, fe = Gn.document || { head: {} },
2318
2318
  }
2319
2319
  if (typeof n == "function")
2320
2320
  return n(e === null ? {} : e, l, su);
2321
- const u = Cn(n, null);
2321
+ const u = _n(n, null);
2322
2322
  return u.$attrs$ = e, l.length > 0 && (u.$children$ = l), u.$key$ = s, u.$name$ = r, u;
2323
- }, Cn = (n, e) => {
2323
+ }, _n = (n, e) => {
2324
2324
  const t = {
2325
2325
  $flags$: 0,
2326
2326
  $tag$: n,
@@ -2344,7 +2344,7 @@ const Gn = typeof window < "u" ? window : {}, fe = Gn.document || { head: {} },
2344
2344
  const t = Object.assign({}, n.vattrs);
2345
2345
  return n.vkey && (t.key = n.vkey), n.vname && (t.name = n.vname), dt(n.vtag, t, ...n.vchildren || []);
2346
2346
  }
2347
- const e = Cn(n.vtag, n.vtext);
2347
+ const e = _n(n.vtag, n.vtext);
2348
2348
  return e.$attrs$ = n.vattrs, e.$children$ = n.vchildren, e.$key$ = n.vkey, e.$name$ = n.vname, e;
2349
2349
  }, Vr = (n, e, t, i, s, r) => {
2350
2350
  if (t !== i) {
@@ -2417,7 +2417,7 @@ const Gn = typeof window < "u" ? window : {}, fe = Gn.document || { head: {} },
2417
2417
  i[s] && (a = En(null, t, s, n), a && (i[s].$elm$ = a, o.insertBefore(a, hs(e))));
2418
2418
  }, ua = (n, e, t, i, s) => {
2419
2419
  for (; e <= t; ++e)
2420
- (i = n[e]) && (s = i.$elm$, fa(i), _n = !0, s["s-ol"] ? s["s-ol"].remove() : Ft(s, !0), s.remove());
2420
+ (i = n[e]) && (s = i.$elm$, fa(i), Cn = !0, s["s-ol"] ? s["s-ol"].remove() : Ft(s, !0), s.remove());
2421
2421
  }, au = (n, e, t, i) => {
2422
2422
  let s = 0, r = 0, o = 0, a = 0, l = e.length - 1, c = e[0], u = e[l], p = i.length - 1, d = i[0], g = i[p], m, $;
2423
2423
  for (; s <= l && r <= p; )
@@ -2473,7 +2473,7 @@ const Gn = typeof window < "u" ? window : {}, fe = Gn.document || { head: {} },
2473
2473
  for (; a < c; a++) {
2474
2474
  if (e = l[a], e["s-sr"] && (t = e["s-cr"]) && t.parentNode)
2475
2475
  for (i = t.parentNode.childNodes, s = e["s-sn"], o = i.length - 1; o >= 0; o--)
2476
- t = i[o], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== e["s-hn"] && (Gr(t, s) ? (r = oe.find((u) => u.$nodeToRelocate$ === t), _n = !0, t["s-sn"] = t["s-sn"] || s, r ? r.$slotRefNode$ = e : oe.push({
2476
+ t = i[o], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== e["s-hn"] && (Gr(t, s) ? (r = oe.find((u) => u.$nodeToRelocate$ === t), Cn = !0, t["s-sn"] = t["s-sn"] || s, r ? r.$slotRefNode$ = e : oe.push({
2477
2477
  $slotRefNode$: e,
2478
2478
  $nodeToRelocate$: t
2479
2479
  }), t["s-sr"] && oe.map((u) => {
@@ -2486,8 +2486,8 @@ const Gn = typeof window < "u" ? window : {}, fe = Gn.document || { head: {} },
2486
2486
  }, Gr = (n, e) => n.nodeType === 1 ? n.getAttribute("slot") === null && e === "" || n.getAttribute("slot") === e : n["s-sn"] === e ? !0 : e === "", fa = (n) => {
2487
2487
  n.$attrs$ && n.$attrs$.ref && n.$attrs$.ref(null), n.$children$ && n.$children$.map(fa);
2488
2488
  }, lu = (n, e) => {
2489
- const t = n.$hostElement$, i = n.$cmpMeta$, s = n.$vnode$ || Cn(null, null), r = iu(e) ? e : dt(null, null, e);
2490
- Wn = t.tagName, i.$attrsToReflect$ && (r.$attrs$ = r.$attrs$ || {}, i.$attrsToReflect$.map(([o, a]) => r.$attrs$[a] = t[o])), r.$tag$ = null, r.$flags$ |= 4, n.$vnode$ = r, r.$elm$ = s.$elm$ = t.shadowRoot || t, ct = t["s-sc"], ia = t["s-cr"], sa = (i.$flags$ & 1) !== 0, _n = !1, ut(s, r);
2489
+ const t = n.$hostElement$, i = n.$cmpMeta$, s = n.$vnode$ || _n(null, null), r = iu(e) ? e : dt(null, null, e);
2490
+ Wn = t.tagName, i.$attrsToReflect$ && (r.$attrs$ = r.$attrs$ || {}, i.$attrsToReflect$.map(([o, a]) => r.$attrs$[a] = t[o])), r.$tag$ = null, r.$flags$ |= 4, n.$vnode$ = r, r.$elm$ = s.$elm$ = t.shadowRoot || t, ct = t["s-sc"], ia = t["s-cr"], sa = (i.$flags$ & 1) !== 0, Cn = !1, ut(s, r);
2491
2491
  {
2492
2492
  if (Z.$flags$ |= 1, ls) {
2493
2493
  pa(r.$elm$);
@@ -2505,7 +2505,7 @@ const Gn = typeof window < "u" ? window : {}, fe = Gn.document || { head: {} },
2505
2505
  } else
2506
2506
  a.nodeType === 1 && (a.hidden = !0);
2507
2507
  }
2508
- _n && da(r.$elm$), Z.$flags$ &= -2, oe.length = 0;
2508
+ Cn && da(r.$elm$), Z.$flags$ &= -2, oe.length = 0;
2509
2509
  }
2510
2510
  }, cu = (n) => n, uu = (n, e, t) => {
2511
2511
  const i = cu(n);
@@ -2633,7 +2633,7 @@ const Gn = typeof window < "u" ? window : {}, fe = Gn.document || { head: {} },
2633
2633
  }, Su = (n) => {
2634
2634
  const e = n["s-cr"] = fe.createComment("");
2635
2635
  e["s-cn"] = !0, n.insertBefore(e, n.firstChild);
2636
- }, _u = (n) => {
2636
+ }, Cu = (n) => {
2637
2637
  if ((Z.$flags$ & 1) === 0) {
2638
2638
  const e = Zn(n);
2639
2639
  e.$rmListeners$ && (e.$rmListeners$.map((t) => t()), e.$rmListeners$ = void 0);
@@ -2647,13 +2647,13 @@ const Gn = typeof window < "u" ? window : {}, fe = Gn.document || { head: {} },
2647
2647
  const i = n.prototype.connectedCallback, s = n.prototype.disconnectedCallback;
2648
2648
  return Object.assign(n.prototype, {
2649
2649
  __registerHost() {
2650
- Cu(this, t);
2650
+ _u(this, t);
2651
2651
  },
2652
2652
  connectedCallback() {
2653
2653
  ku(this), i && i.call(this);
2654
2654
  },
2655
2655
  disconnectedCallback() {
2656
- _u(this), s && s.call(this);
2656
+ Cu(this), s && s.call(this);
2657
2657
  },
2658
2658
  __attachShadow() {
2659
2659
  this.attachShadow({
@@ -2662,7 +2662,7 @@ const Gn = typeof window < "u" ? window : {}, fe = Gn.document || { head: {} },
2662
2662
  });
2663
2663
  }
2664
2664
  }), n.is = t.$tagName$, $u(n, t);
2665
- }, va = /* @__PURE__ */ new WeakMap(), Zn = (n) => va.get(n), Cu = (n, e) => {
2665
+ }, va = /* @__PURE__ */ new WeakMap(), Zn = (n) => va.get(n), _u = (n, e) => {
2666
2666
  const t = {
2667
2667
  $flags$: 0,
2668
2668
  $hostElement$: n,
@@ -2982,7 +2982,7 @@ const vt = Jt(class extends Yn {
2982
2982
  const o = !!e[r];
2983
2983
  o === this.st.has(r) || (s = this.nt) != null && s.has(r) || (o ? (t.add(r), this.st.add(r)) : (t.remove(r), this.st.delete(r)));
2984
2984
  }
2985
- return Ce;
2985
+ return _e;
2986
2986
  }
2987
2987
  });
2988
2988
  var Yu = Object.defineProperty, Qu = (n, e, t, i) => {
@@ -2990,7 +2990,7 @@ var Yu = Object.defineProperty, Qu = (n, e, t, i) => {
2990
2990
  (o = n[r]) && (s = o(e, t, s) || s);
2991
2991
  return s && Yu(e, t, s), s;
2992
2992
  };
2993
- const Cs = class Cs extends E {
2993
+ const _s = class _s extends E {
2994
2994
  constructor() {
2995
2995
  super(...arguments), this.anchor = "BottomRight";
2996
2996
  }
@@ -3002,7 +3002,7 @@ const Cs = class Cs extends E {
3002
3002
  return this.anchor === "BottomLeft" ? this.renderRoot.host.classList.add("bottom-left") : this.anchor === "BottomRight" && this.renderRoot.host.classList.add("bottom-right"), w;
3003
3003
  }
3004
3004
  };
3005
- Cs.styles = [
3005
+ _s.styles = [
3006
3006
  T`
3007
3007
  :host {
3008
3008
  position: fixed;
@@ -3021,7 +3021,7 @@ Cs.styles = [
3021
3021
  }
3022
3022
  `
3023
3023
  ];
3024
- let On = Cs;
3024
+ let On = _s;
3025
3025
  Qu([
3026
3026
  k({ attribute: !0 })
3027
3027
  ], On.prototype, "anchor");
@@ -3793,7 +3793,7 @@ function Te({ context: n, subscribe: e }) {
3793
3793
  });
3794
3794
  };
3795
3795
  }
3796
- var ch = Object.defineProperty, _a = (n, e, t, i) => {
3796
+ var ch = Object.defineProperty, Ca = (n, e, t, i) => {
3797
3797
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
3798
3798
  (o = n[r]) && (s = o(e, t, s) || s);
3799
3799
  return s && ch(e, t, s), s;
@@ -3997,10 +3997,10 @@ Ts.styles = T`
3997
3997
  }
3998
3998
  `;
3999
3999
  let qt = Ts;
4000
- _a([
4000
+ Ca([
4001
4001
  k({ attribute: !0 })
4002
4002
  ], qt.prototype, "fullscreen");
4003
- _a([
4003
+ Ca([
4004
4004
  k({ attribute: !1 }),
4005
4005
  lh({ context: ge })
4006
4006
  ], qt.prototype, "application");
@@ -4121,7 +4121,7 @@ class hh {
4121
4121
  class lo {
4122
4122
  constructor(e, t, i, s, r) {
4123
4123
  this.id = e, this.providerKey = t, this.providerOptions = i, this.component = r, this.provider$ = new ae(null), this.entries$ = new ae([]), this.removeEntryAction$ = new P(), this.kill$ = new P(), this.isTyping$ = new ae(!1), this.data$ = new ae({}), this.complete$ = this.provider$.pipe(
4124
- _e((l) => l ? l.onComplete() : Xe)
4124
+ Ce((l) => l ? l.onComplete() : Xe)
4125
4125
  );
4126
4126
  const o = this._getProviderFactory(t);
4127
4127
  if (!o)
@@ -4164,7 +4164,7 @@ class lo {
4164
4164
  }
4165
4165
  _addEntryRemoveHandler(e) {
4166
4166
  e.remove$.pipe(
4167
- _e(() => this.entries$),
4167
+ Ce(() => this.entries$),
4168
4168
  he(1)
4169
4169
  ).subscribe((t) => {
4170
4170
  this.removeEntryAction$.next(e), this.entries$.next(t.filter((i) => i !== e));
@@ -4275,8 +4275,8 @@ class dh {
4275
4275
  class ph {
4276
4276
  constructor(e, t) {
4277
4277
  this.state$ = e, this.component = t, this.entries$ = new ae([]), this.session = () => this.session$, this.isTyping = () => this.isTyping$, this.entries = () => this.entries$.asObservable(), this.sessionService = new dh(this.component), this.session$ = this.sessionService.currentSession(), this.isTyping$ = this.session$.pipe(
4278
- _e((i) => i ? i.provider$.pipe(
4279
- _e((s) => s ? s.isTyping() : Oi(!1))
4278
+ Ce((i) => i ? i.provider$.pipe(
4279
+ Ce((s) => s ? s.isTyping() : Oi(!1))
4280
4280
  ) : Oi(!1))
4281
4281
  ), e.subscribe((i) => {
4282
4282
  switch (i) {
@@ -4301,7 +4301,7 @@ class ph {
4301
4301
  }
4302
4302
  rehydrate() {
4303
4303
  this.session$.pipe(
4304
- _e((e) => {
4304
+ Ce((e) => {
4305
4305
  if (!e)
4306
4306
  return Xe;
4307
4307
  const t = e.removeEntryAction$.pipe(Ri(this.entries$)).pipe(
@@ -4569,7 +4569,7 @@ let Ln = Ls;
4569
4569
  gh([
4570
4570
  k({ attribute: !1 })
4571
4571
  ], Ln.prototype, "entry");
4572
- var mh = Object.defineProperty, Ca = (n, e, t, i) => {
4572
+ var mh = Object.defineProperty, _a = (n, e, t, i) => {
4573
4573
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
4574
4574
  (o = n[r]) && (s = o(e, t, s) || s);
4575
4575
  return s && mh(e, t, s), s;
@@ -4630,10 +4630,10 @@ Rs.styles = [
4630
4630
  `
4631
4631
  ];
4632
4632
  let Vt = Rs;
4633
- Ca([
4633
+ _a([
4634
4634
  k({ attribute: !1 })
4635
4635
  ], Vt.prototype, "entries");
4636
- Ca([
4636
+ _a([
4637
4637
  k({ type: Boolean })
4638
4638
  ], Vt.prototype, "loading");
4639
4639
  /**
@@ -4757,7 +4757,7 @@ class Fi extends Yn {
4757
4757
  }
4758
4758
  render(e) {
4759
4759
  if (e === w || e == null) return this._t = void 0, this.it = e;
4760
- if (e === Ce) return e;
4760
+ if (e === _e) return e;
4761
4761
  if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
4762
4762
  if (e === this.it) return this._t;
4763
4763
  this.it = e;
@@ -4795,7 +4795,7 @@ Bi || (Bi = function(e, t, i) {
4795
4795
  qi || (qi = function(e, t) {
4796
4796
  return new e(...t);
4797
4797
  });
4798
- const dn = Q(Array.prototype.forEach), Sh = Q(Array.prototype.lastIndexOf), uo = Q(Array.prototype.pop), At = Q(Array.prototype.push), _h = Q(Array.prototype.splice), vn = Q(String.prototype.toLowerCase), xi = Q(String.prototype.toString), ho = Q(String.prototype.match), Tt = Q(String.prototype.replace), Ch = Q(String.prototype.indexOf), Eh = Q(String.prototype.trim), re = Q(Object.prototype.hasOwnProperty), V = Q(RegExp.prototype.test), Ot = Ah(TypeError);
4798
+ const dn = Q(Array.prototype.forEach), Sh = Q(Array.prototype.lastIndexOf), uo = Q(Array.prototype.pop), At = Q(Array.prototype.push), Ch = Q(Array.prototype.splice), vn = Q(String.prototype.toLowerCase), xi = Q(String.prototype.toString), ho = Q(String.prototype.match), Tt = Q(String.prototype.replace), _h = Q(String.prototype.indexOf), Eh = Q(String.prototype.trim), re = Q(Object.prototype.hasOwnProperty), V = Q(RegExp.prototype.test), Ot = Ah(TypeError);
4799
4799
  function Q(n) {
4800
4800
  return function(e) {
4801
4801
  e instanceof RegExp && (e.lastIndex = 0);
@@ -4852,7 +4852,7 @@ function Lt(n, e) {
4852
4852
  }
4853
4853
  return t;
4854
4854
  }
4855
- const po = Y(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), ki = Y(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Si = Y(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Oh = Y(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), _i = Y(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Lh = Y(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), fo = Y(["#text"]), go = Y(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Ci = Y(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), mo = Y(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), pn = Y(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Rh = te(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Ih = te(/<%[\w\W]*|[\w\W]*%>/gm), Ph = te(/\$\{[\w\W]*/gm), Mh = te(/^data-[\-\w.\u00B7-\uFFFF]+$/), Dh = te(/^aria-[\-\w]+$/), Ta = te(
4855
+ const po = Y(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), ki = Y(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Si = Y(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Oh = Y(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Ci = Y(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Lh = Y(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), fo = Y(["#text"]), go = Y(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), _i = Y(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), mo = Y(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), pn = Y(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Rh = te(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Ih = te(/<%[\w\W]*|[\w\W]*%>/gm), Ph = te(/\$\{[\w\W]*/gm), Mh = te(/^data-[\-\w.\u00B7-\uFFFF]+$/), Dh = te(/^aria-[\-\w]+$/), Ta = te(
4856
4856
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
4857
4857
  // eslint-disable-line no-useless-escape
4858
4858
  ), Uh = te(/^(?:\w+script|data):/i), Nh = te(
@@ -4960,9 +4960,9 @@ function La() {
4960
4960
  let {
4961
4961
  IS_ALLOWED_URI: Qs
4962
4962
  } = vo, D = null;
4963
- const Xs = x({}, [...po, ...ki, ...Si, ..._i, ...fo]);
4963
+ const Xs = x({}, [...po, ...ki, ...Si, ...Ci, ...fo]);
4964
4964
  let N = null;
4965
- const Ks = x({}, [...go, ...Ci, ...mo, ...pn]);
4965
+ const Ks = x({}, [...go, ..._i, ...mo, ...pn]);
4966
4966
  let R = Object.seal(Aa(null, {
4967
4967
  tagNameCheck: {
4968
4968
  writable: !0,
@@ -4994,7 +4994,7 @@ function La() {
4994
4994
  const nl = x({}, [on, an, ve], xi);
4995
4995
  let ln = x({}, ["mi", "mo", "mn", "ms", "mtext"]), cn = x({}, ["annotation-xml"]);
4996
4996
  const il = x({}, ["title", "style", "font", "a", "script"]);
4997
- let _t = null;
4997
+ let Ct = null;
4998
4998
  const sl = ["application/xhtml+xml", "text/html"], rl = "text/html";
4999
4999
  let U = null, rt = null;
5000
5000
  const ol = t.createElement("form"), lr = function(h) {
@@ -5002,8 +5002,8 @@ function La() {
5002
5002
  }, ci = function() {
5003
5003
  let h = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
5004
5004
  if (!(rt && rt === h)) {
5005
- if ((!h || typeof h != "object") && (h = {}), h = xe(h), _t = // eslint-disable-next-line unicorn/prefer-includes
5006
- sl.indexOf(h.PARSER_MEDIA_TYPE) === -1 ? rl : h.PARSER_MEDIA_TYPE, U = _t === "application/xhtml+xml" ? xi : vn, D = re(h, "ALLOWED_TAGS") ? x({}, h.ALLOWED_TAGS, U) : Xs, N = re(h, "ALLOWED_ATTR") ? x({}, h.ALLOWED_ATTR, U) : Ks, li = re(h, "ALLOWED_NAMESPACES") ? x({}, h.ALLOWED_NAMESPACES, xi) : nl, oi = re(h, "ADD_URI_SAFE_ATTR") ? x(xe(ar), h.ADD_URI_SAFE_ATTR, U) : ar, rr = re(h, "ADD_DATA_URI_TAGS") ? x(xe(or), h.ADD_DATA_URI_TAGS, U) : or, it = re(h, "FORBID_CONTENTS") ? x({}, h.FORBID_CONTENTS, U) : sr, kt = re(h, "FORBID_TAGS") ? x({}, h.FORBID_TAGS, U) : xe({}), ti = re(h, "FORBID_ATTR") ? x({}, h.FORBID_ATTR, U) : xe({}), nt = re(h, "USE_PROFILES") ? h.USE_PROFILES : !1, Js = h.ALLOW_ARIA_ATTR !== !1, ni = h.ALLOW_DATA_ATTR !== !1, er = h.ALLOW_UNKNOWN_PROTOCOLS || !1, tr = h.ALLOW_SELF_CLOSE_IN_ATTR !== !1, et = h.SAFE_FOR_TEMPLATES || !1, nn = h.SAFE_FOR_XML !== !1, He = h.WHOLE_DOCUMENT || !1, tt = h.RETURN_DOM || !1, sn = h.RETURN_DOM_FRAGMENT || !1, rn = h.RETURN_TRUSTED_TYPE || !1, si = h.FORCE_BODY || !1, nr = h.SANITIZE_DOM !== !1, ir = h.SANITIZE_NAMED_PROPS || !1, ri = h.KEEP_CONTENT !== !1, St = h.IN_PLACE || !1, Qs = h.ALLOWED_URI_REGEXP || Ta, st = h.NAMESPACE || ve, ln = h.MATHML_TEXT_INTEGRATION_POINTS || ln, cn = h.HTML_INTEGRATION_POINTS || cn, R = h.CUSTOM_ELEMENT_HANDLING || {}, h.CUSTOM_ELEMENT_HANDLING && lr(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (R.tagNameCheck = h.CUSTOM_ELEMENT_HANDLING.tagNameCheck), h.CUSTOM_ELEMENT_HANDLING && lr(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (R.attributeNameCheck = h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), h.CUSTOM_ELEMENT_HANDLING && typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (R.allowCustomizedBuiltInElements = h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), et && (ni = !1), sn && (tt = !0), nt && (D = x({}, fo), N = [], nt.html === !0 && (x(D, po), x(N, go)), nt.svg === !0 && (x(D, ki), x(N, Ci), x(N, pn)), nt.svgFilters === !0 && (x(D, Si), x(N, Ci), x(N, pn)), nt.mathMl === !0 && (x(D, _i), x(N, mo), x(N, pn))), h.ADD_TAGS && (D === Xs && (D = xe(D)), x(D, h.ADD_TAGS, U)), h.ADD_ATTR && (N === Ks && (N = xe(N)), x(N, h.ADD_ATTR, U)), h.ADD_URI_SAFE_ATTR && x(oi, h.ADD_URI_SAFE_ATTR, U), h.FORBID_CONTENTS && (it === sr && (it = xe(it)), x(it, h.FORBID_CONTENTS, U)), ri && (D["#text"] = !0), He && x(D, ["html", "head", "body"]), D.table && (x(D, ["tbody"]), delete kt.tbody), h.TRUSTED_TYPES_POLICY) {
5005
+ if ((!h || typeof h != "object") && (h = {}), h = xe(h), Ct = // eslint-disable-next-line unicorn/prefer-includes
5006
+ sl.indexOf(h.PARSER_MEDIA_TYPE) === -1 ? rl : h.PARSER_MEDIA_TYPE, U = Ct === "application/xhtml+xml" ? xi : vn, D = re(h, "ALLOWED_TAGS") ? x({}, h.ALLOWED_TAGS, U) : Xs, N = re(h, "ALLOWED_ATTR") ? x({}, h.ALLOWED_ATTR, U) : Ks, li = re(h, "ALLOWED_NAMESPACES") ? x({}, h.ALLOWED_NAMESPACES, xi) : nl, oi = re(h, "ADD_URI_SAFE_ATTR") ? x(xe(ar), h.ADD_URI_SAFE_ATTR, U) : ar, rr = re(h, "ADD_DATA_URI_TAGS") ? x(xe(or), h.ADD_DATA_URI_TAGS, U) : or, it = re(h, "FORBID_CONTENTS") ? x({}, h.FORBID_CONTENTS, U) : sr, kt = re(h, "FORBID_TAGS") ? x({}, h.FORBID_TAGS, U) : xe({}), ti = re(h, "FORBID_ATTR") ? x({}, h.FORBID_ATTR, U) : xe({}), nt = re(h, "USE_PROFILES") ? h.USE_PROFILES : !1, Js = h.ALLOW_ARIA_ATTR !== !1, ni = h.ALLOW_DATA_ATTR !== !1, er = h.ALLOW_UNKNOWN_PROTOCOLS || !1, tr = h.ALLOW_SELF_CLOSE_IN_ATTR !== !1, et = h.SAFE_FOR_TEMPLATES || !1, nn = h.SAFE_FOR_XML !== !1, He = h.WHOLE_DOCUMENT || !1, tt = h.RETURN_DOM || !1, sn = h.RETURN_DOM_FRAGMENT || !1, rn = h.RETURN_TRUSTED_TYPE || !1, si = h.FORCE_BODY || !1, nr = h.SANITIZE_DOM !== !1, ir = h.SANITIZE_NAMED_PROPS || !1, ri = h.KEEP_CONTENT !== !1, St = h.IN_PLACE || !1, Qs = h.ALLOWED_URI_REGEXP || Ta, st = h.NAMESPACE || ve, ln = h.MATHML_TEXT_INTEGRATION_POINTS || ln, cn = h.HTML_INTEGRATION_POINTS || cn, R = h.CUSTOM_ELEMENT_HANDLING || {}, h.CUSTOM_ELEMENT_HANDLING && lr(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (R.tagNameCheck = h.CUSTOM_ELEMENT_HANDLING.tagNameCheck), h.CUSTOM_ELEMENT_HANDLING && lr(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (R.attributeNameCheck = h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), h.CUSTOM_ELEMENT_HANDLING && typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (R.allowCustomizedBuiltInElements = h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), et && (ni = !1), sn && (tt = !0), nt && (D = x({}, fo), N = [], nt.html === !0 && (x(D, po), x(N, go)), nt.svg === !0 && (x(D, ki), x(N, _i), x(N, pn)), nt.svgFilters === !0 && (x(D, Si), x(N, _i), x(N, pn)), nt.mathMl === !0 && (x(D, Ci), x(N, mo), x(N, pn))), h.ADD_TAGS && (D === Xs && (D = xe(D)), x(D, h.ADD_TAGS, U)), h.ADD_ATTR && (N === Ks && (N = xe(N)), x(N, h.ADD_ATTR, U)), h.ADD_URI_SAFE_ATTR && x(oi, h.ADD_URI_SAFE_ATTR, U), h.FORBID_CONTENTS && (it === sr && (it = xe(it)), x(it, h.FORBID_CONTENTS, U)), ri && (D["#text"] = !0), He && x(D, ["html", "head", "body"]), D.table && (x(D, ["tbody"]), delete kt.tbody), h.TRUSTED_TYPES_POLICY) {
5007
5007
  if (typeof h.TRUSTED_TYPES_POLICY.createHTML != "function")
5008
5008
  throw Ot('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
5009
5009
  if (typeof h.TRUSTED_TYPES_POLICY.createScriptURL != "function")
@@ -5013,14 +5013,14 @@ function La() {
5013
5013
  M === void 0 && (M = Hh(g, s)), M !== null && typeof Ne == "string" && (Ne = M.createHTML(""));
5014
5014
  Y && Y(h), rt = h;
5015
5015
  }
5016
- }, cr = x({}, [...ki, ...Si, ...Oh]), ur = x({}, [..._i, ...Lh]), al = function(h) {
5016
+ }, cr = x({}, [...ki, ...Si, ...Oh]), ur = x({}, [...Ci, ...Lh]), al = function(h) {
5017
5017
  let f = Ue(h);
5018
5018
  (!f || !f.tagName) && (f = {
5019
5019
  namespaceURI: st,
5020
5020
  tagName: "template"
5021
5021
  });
5022
5022
  const v = vn(h.tagName), L = vn(f.tagName);
5023
- return li[h.namespaceURI] ? h.namespaceURI === an ? f.namespaceURI === ve ? v === "svg" : f.namespaceURI === on ? v === "svg" && (L === "annotation-xml" || ln[L]) : !!cr[v] : h.namespaceURI === on ? f.namespaceURI === ve ? v === "math" : f.namespaceURI === an ? v === "math" && cn[L] : !!ur[v] : h.namespaceURI === ve ? f.namespaceURI === an && !cn[L] || f.namespaceURI === on && !ln[L] ? !1 : !ur[v] && (il[v] || !cr[v]) : !!(_t === "application/xhtml+xml" && li[h.namespaceURI]) : !1;
5023
+ return li[h.namespaceURI] ? h.namespaceURI === an ? f.namespaceURI === ve ? v === "svg" : f.namespaceURI === on ? v === "svg" && (L === "annotation-xml" || ln[L]) : !!cr[v] : h.namespaceURI === on ? f.namespaceURI === ve ? v === "math" : f.namespaceURI === an ? v === "math" && cn[L] : !!ur[v] : h.namespaceURI === ve ? f.namespaceURI === an && !cn[L] || f.namespaceURI === on && !ln[L] ? !1 : !ur[v] && (il[v] || !cr[v]) : !!(Ct === "application/xhtml+xml" && li[h.namespaceURI]) : !1;
5024
5024
  }, ce = function(h) {
5025
5025
  At(e.removed, {
5026
5026
  element: h
@@ -5061,11 +5061,11 @@ function La() {
5061
5061
  const I = ho(h, /^[\r\n\t ]+/);
5062
5062
  v = I && I[0];
5063
5063
  }
5064
- _t === "application/xhtml+xml" && st === ve && (h = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + h + "</body></html>");
5064
+ Ct === "application/xhtml+xml" && st === ve && (h = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + h + "</body></html>");
5065
5065
  const L = M ? M.createHTML(h) : h;
5066
5066
  if (st === ve)
5067
5067
  try {
5068
- f = new d().parseFromString(L, _t);
5068
+ f = new d().parseFromString(L, Ct);
5069
5069
  } catch {
5070
5070
  }
5071
5071
  if (!f || !f.documentElement) {
@@ -5141,7 +5141,7 @@ function La() {
5141
5141
  ) return !1;
5142
5142
  } else if (!oi[f]) {
5143
5143
  if (!V(Qs, Tt(v, Ys, ""))) {
5144
- if (!((f === "src" || f === "xlink:href" || f === "href") && h !== "script" && Ch(v, "data:") === 0 && rr[h])) {
5144
+ if (!((f === "src" || f === "xlink:href" || f === "href") && h !== "script" && _h(v, "data:") === 0 && rr[h])) {
5145
5145
  if (!(er && !V(Ja, Tt(v, Ys, "")))) {
5146
5146
  if (v)
5147
5147
  return !1;
@@ -5174,9 +5174,9 @@ function La() {
5174
5174
  name: I,
5175
5175
  namespaceURI: X,
5176
5176
  value: ye
5177
- } = H, Ct = U(I), hi = ye;
5177
+ } = H, _t = U(I), hi = ye;
5178
5178
  let F = I === "value" ? hi : Eh(hi);
5179
- if (v.attrName = Ct, v.attrValue = F, v.keepAttr = !0, v.forceKeepAttr = void 0, be(q.uponSanitizeAttribute, h, v), F = v.attrValue, ir && (Ct === "id" || Ct === "name") && (ot(I, h), F = tl + F), nn && V(/((--!?|])>)|<\/(style|title)/i, F)) {
5179
+ if (v.attrName = _t, v.attrValue = F, v.keepAttr = !0, v.forceKeepAttr = void 0, be(q.uponSanitizeAttribute, h, v), F = v.attrValue, ir && (_t === "id" || _t === "name") && (ot(I, h), F = tl + F), nn && V(/((--!?|])>)|<\/(style|title)/i, F)) {
5180
5180
  ot(I, h);
5181
5181
  continue;
5182
5182
  }
@@ -5194,12 +5194,12 @@ function La() {
5194
5194
  F = Tt(F, yr, " ");
5195
5195
  });
5196
5196
  const br = U(h.nodeName);
5197
- if (!gr(br, Ct, F)) {
5197
+ if (!gr(br, _t, F)) {
5198
5198
  ot(I, h);
5199
5199
  continue;
5200
5200
  }
5201
5201
  if (M && typeof g == "object" && typeof g.getAttributeType == "function" && !X)
5202
- switch (g.getAttributeType(br, Ct)) {
5202
+ switch (g.getAttributeType(br, _t)) {
5203
5203
  case "TrustedHTML": {
5204
5204
  F = M.createHTML(F);
5205
5205
  break;
@@ -5282,7 +5282,7 @@ function La() {
5282
5282
  }, e.removeHook = function(b, h) {
5283
5283
  if (h !== void 0) {
5284
5284
  const f = Sh(q[b], h);
5285
- return f === -1 ? void 0 : _h(q[b], f, 1)[0];
5285
+ return f === -1 ? void 0 : Ch(q[b], f, 1)[0];
5286
5286
  }
5287
5287
  return uo(q[b]);
5288
5288
  }, e.removeHooks = function(b) {
@@ -5363,7 +5363,7 @@ function Ia(n) {
5363
5363
  Ke = n;
5364
5364
  }
5365
5365
  var Nt = { exec: () => null };
5366
- function _(n, e = "") {
5366
+ function C(n, e = "") {
5367
5367
  let t = typeof n == "string" ? n : n.source;
5368
5368
  const i = {
5369
5369
  replace: (s, r) => {
@@ -5431,10 +5431,10 @@ var W = {
5431
5431
  fencesBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:\`\`\`|~~~)`),
5432
5432
  headingBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}#`),
5433
5433
  htmlBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}<(?:[a-z].*>|!--)`, "i")
5434
- }, qh = /^(?:[ \t]*(?:\n|$))+/, Vh = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Wh = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, tn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Gh = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, fs = /(?:[*+-]|\d{1,9}[.)])/, Pa = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ma = _(Pa).replace(/bull/g, fs).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Zh = _(Pa).replace(/bull/g, fs).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), gs = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Yh = /^[^\n]+/, ms = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Qh = _(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ms).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Xh = _(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, fs).getRegex(), Qn = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", vs = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Kh = _(
5434
+ }, qh = /^(?:[ \t]*(?:\n|$))+/, Vh = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Wh = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, tn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Gh = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, fs = /(?:[*+-]|\d{1,9}[.)])/, Pa = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ma = C(Pa).replace(/bull/g, fs).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Zh = C(Pa).replace(/bull/g, fs).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), gs = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Yh = /^[^\n]+/, ms = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Qh = C(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ms).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Xh = C(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, fs).getRegex(), Qn = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", vs = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Kh = C(
5435
5435
  "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))",
5436
5436
  "i"
5437
- ).replace("comment", vs).replace("tag", Qn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Da = _(gs).replace("hr", tn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Qn).getRegex(), Jh = _(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Da).getRegex(), bs = {
5437
+ ).replace("comment", vs).replace("tag", Qn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Da = C(gs).replace("hr", tn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Qn).getRegex(), Jh = C(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Da).getRegex(), bs = {
5438
5438
  blockquote: Jh,
5439
5439
  code: Vh,
5440
5440
  def: Qh,
@@ -5448,16 +5448,16 @@ var W = {
5448
5448
  paragraph: Da,
5449
5449
  table: Nt,
5450
5450
  text: Yh
5451
- }, yo = _(
5451
+ }, yo = C(
5452
5452
  "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
5453
5453
  ).replace("hr", tn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Qn).getRegex(), ed = {
5454
5454
  ...bs,
5455
5455
  lheading: Zh,
5456
5456
  table: yo,
5457
- paragraph: _(gs).replace("hr", tn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", yo).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Qn).getRegex()
5457
+ paragraph: C(gs).replace("hr", tn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", yo).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Qn).getRegex()
5458
5458
  }, td = {
5459
5459
  ...bs,
5460
- html: _(
5460
+ html: C(
5461
5461
  `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
5462
5462
  ).replace("comment", vs).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
5463
5463
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
@@ -5465,14 +5465,14 @@ var W = {
5465
5465
  fences: Nt,
5466
5466
  // fences not supported
5467
5467
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
5468
- paragraph: _(gs).replace("hr", tn).replace("heading", ` *#{1,6} *[^
5468
+ paragraph: C(gs).replace("hr", tn).replace("heading", ` *#{1,6} *[^
5469
5469
  ]`).replace("lheading", Ma).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
5470
- }, nd = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, id = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Ua = /^( {2,}|\\)\n(?!\s*$)/, sd = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Xn = /[\p{P}\p{S}]/u, ys = /[\s\p{P}\p{S}]/u, Na = /[^\s\p{P}\p{S}]/u, rd = _(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, ys).getRegex(), za = /(?!~)[\p{P}\p{S}]/u, od = /(?!~)[\s\p{P}\p{S}]/u, ad = /(?:[^\s\p{P}\p{S}]|~)/u, ld = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, ja = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, cd = _(ja, "u").replace(/punct/g, Xn).getRegex(), ud = _(ja, "u").replace(/punct/g, za).getRegex(), Ha = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", hd = _(Ha, "gu").replace(/notPunctSpace/g, Na).replace(/punctSpace/g, ys).replace(/punct/g, Xn).getRegex(), dd = _(Ha, "gu").replace(/notPunctSpace/g, ad).replace(/punctSpace/g, od).replace(/punct/g, za).getRegex(), pd = _(
5470
+ }, nd = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, id = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Ua = /^( {2,}|\\)\n(?!\s*$)/, sd = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Xn = /[\p{P}\p{S}]/u, ys = /[\s\p{P}\p{S}]/u, Na = /[^\s\p{P}\p{S}]/u, rd = C(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, ys).getRegex(), za = /(?!~)[\p{P}\p{S}]/u, od = /(?!~)[\s\p{P}\p{S}]/u, ad = /(?:[^\s\p{P}\p{S}]|~)/u, ld = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, ja = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, cd = C(ja, "u").replace(/punct/g, Xn).getRegex(), ud = C(ja, "u").replace(/punct/g, za).getRegex(), Ha = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", hd = C(Ha, "gu").replace(/notPunctSpace/g, Na).replace(/punctSpace/g, ys).replace(/punct/g, Xn).getRegex(), dd = C(Ha, "gu").replace(/notPunctSpace/g, ad).replace(/punctSpace/g, od).replace(/punct/g, za).getRegex(), pd = C(
5471
5471
  "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)",
5472
5472
  "gu"
5473
- ).replace(/notPunctSpace/g, Na).replace(/punctSpace/g, ys).replace(/punct/g, Xn).getRegex(), fd = _(/\\(punct)/, "gu").replace(/punct/g, Xn).getRegex(), gd = _(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), md = _(vs).replace("(?:-->|$)", "-->").getRegex(), vd = _(
5473
+ ).replace(/notPunctSpace/g, Na).replace(/punctSpace/g, ys).replace(/punct/g, Xn).getRegex(), fd = C(/\\(punct)/, "gu").replace(/punct/g, Xn).getRegex(), gd = C(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), md = C(vs).replace("(?:-->|$)", "-->").getRegex(), vd = C(
5474
5474
  "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
5475
- ).replace("comment", md).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Pn = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, bd = _(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", Pn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Fa = _(/^!?\[(label)\]\[(ref)\]/).replace("label", Pn).replace("ref", ms).getRegex(), Ba = _(/^!?\[(ref)\](?:\[\])?/).replace("ref", ms).getRegex(), yd = _("reflink|nolink(?!\\()", "g").replace("reflink", Fa).replace("nolink", Ba).getRegex(), $s = {
5475
+ ).replace("comment", md).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Pn = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, bd = C(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", Pn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Fa = C(/^!?\[(label)\]\[(ref)\]/).replace("label", Pn).replace("ref", ms).getRegex(), Ba = C(/^!?\[(ref)\](?:\[\])?/).replace("ref", ms).getRegex(), yd = C("reflink|nolink(?!\\()", "g").replace("reflink", Fa).replace("nolink", Ba).getRegex(), $s = {
5476
5476
  _backpedal: Nt,
5477
5477
  // only used for GFM url
5478
5478
  anyPunctuation: fd,
@@ -5495,20 +5495,20 @@ var W = {
5495
5495
  url: Nt
5496
5496
  }, $d = {
5497
5497
  ...$s,
5498
- link: _(/^!?\[(label)\]\((.*?)\)/).replace("label", Pn).getRegex(),
5499
- reflink: _(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Pn).getRegex()
5498
+ link: C(/^!?\[(label)\]\((.*?)\)/).replace("label", Pn).getRegex(),
5499
+ reflink: C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Pn).getRegex()
5500
5500
  }, Vi = {
5501
5501
  ...$s,
5502
5502
  emStrongRDelimAst: dd,
5503
5503
  emStrongLDelim: ud,
5504
- url: _(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
5504
+ url: C(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
5505
5505
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
5506
5506
  del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
5507
5507
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
5508
5508
  }, wd = {
5509
5509
  ...Vi,
5510
- br: _(Ua).replace("{2,}", "*").getRegex(),
5511
- text: _(Vi.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
5510
+ br: C(Ua).replace("{2,}", "*").getRegex(),
5511
+ text: C(Vi.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
5512
5512
  }, fn = {
5513
5513
  normal: bs,
5514
5514
  gfm: ed,
@@ -6700,7 +6700,7 @@ ${n}</tr>
6700
6700
  "preprocess",
6701
6701
  "postprocess",
6702
6702
  "processAllTokens"
6703
- ])), Ei), _d = class {
6703
+ ])), Ei), Cd = class {
6704
6704
  constructor(...n) {
6705
6705
  A(this, "defaults", ps());
6706
6706
  A(this, "options", this.setOptions);
@@ -6872,7 +6872,7 @@ Please report this to https://github.com/markedjs/marked.`, n) {
6872
6872
  throw t;
6873
6873
  };
6874
6874
  }
6875
- }, Qe = new _d();
6875
+ }, Qe = new Cd();
6876
6876
  function S(n, e) {
6877
6877
  return Qe.parse(n, e);
6878
6878
  }
@@ -6904,10 +6904,10 @@ S.walkTokens;
6904
6904
  S.parseInline;
6905
6905
  Se.parse;
6906
6906
  ke.lex;
6907
- var Cd = Object.defineProperty, qa = (n, e, t, i) => {
6907
+ var _d = Object.defineProperty, qa = (n, e, t, i) => {
6908
6908
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
6909
6909
  (o = n[r]) && (s = o(e, t, s) || s);
6910
- return s && Cd(e, t, s), s;
6910
+ return s && _d(e, t, s), s;
6911
6911
  };
6912
6912
  const Va = new Wt();
6913
6913
  Va.link = function({ href: n, title: e, text: t }) {
@@ -7148,7 +7148,7 @@ customElements.get("ace-lightbox") || customElements.define("ace-lightbox", Dn);
7148
7148
  const So = ka(E), Ns = class Ns extends So {
7149
7149
  constructor() {
7150
7150
  super(...arguments), this.message = "", this.disabledInput = !1, this.disabledSkipToLatest = !1, this.disabledSubmit = !1, this.chatOverlayActive = !1, this.textAreaLength = 0, this.isMuted = !1, this.conversationContentRef = de(), this.conversationFeedRef = de(), this.formRef = de(), this.inputRef = de(), this.scrollRef = de(), this.counterRef = de(), this.chatScrollHeight = 0, this.chatCurrentScrollPosition = 0, this.toast = new hh(this), this.messageMaxLength = 1e3, this.messageMaxLengthLabel = "Maximum character limit reached", this.skipToLatestMessageLabel = "Skip to latest message", this.platform = null, this.entries = [], this.typing = !1, this.conversationState$ = new ae("waiting"), this.stateMachine = new ph(this.conversationState$, this), this.provider$ = this.stateMachine.session().pipe(
7151
- _e((e) => e ? e == null ? void 0 : e.provider$ : Oi(null))
7151
+ Ce((e) => e ? e == null ? void 0 : e.provider$ : Oi(null))
7152
7152
  ), this.userTyping$ = new P();
7153
7153
  }
7154
7154
  async connectedCallback() {
@@ -7710,7 +7710,61 @@ Oe([
7710
7710
  Oe([
7711
7711
  O()
7712
7712
  ], le.prototype, "typing");
7713
- const we = (n) => n.objectType === "info", Od = (n) => n.objectType === "chatEntry", Ld = (n) => n.objectType === "pen", Rd = (n) => n.objectType === "chatButtonClicked", Id = (n) => n.objectType === "endVideoButtonClicked", Pd = (n) => n.type === "queue-status", Md = (n) => n.type === "established", Dd = (n) => n.type === "pen-status", Ud = (n) => n.type === "prepareVideo", Nd = (n) => n.type === "videoPrepared", zd = (n) => n.type === "chatButtonClicked", jd = (n) => n.type === "endVideoButtonClicked", Hd = (n) => n.type === "chat-ended";
7713
+ class Od {
7714
+ constructor(e) {
7715
+ this.url = "", this.maxRetries = 300, this.orderRef = "", this.tunnistusUrl = "", this.url = `${e.idHubUrl}/${e.idHubCustomerKey}/${e.idHubOrgKey}/${e.idHubEidType.toLowerCase()}`, this.maxRetries = e.idHubMaxRetries;
7716
+ }
7717
+ async auth() {
7718
+ console.log("\x1B[31mID-Hub \x1B[32m - Initializing auth");
7719
+ try {
7720
+ const t = await (await fetch(this.url + "/auth", {
7721
+ headers: {
7722
+ accept: "application/json",
7723
+ "accept-language": "sv-SE,sv;q=0.9,en-US;q=0.8,en;q=0.7",
7724
+ "content-type": "application/json"
7725
+ },
7726
+ body: `{
7727
+ "clientName": "idhub-web-1.0.0",
7728
+ "register": {
7729
+ "clientType": "ACEWIDGET",
7730
+ "agentId": "ACEWIDGET",
7731
+ "userName": "ACEWIDGET"
7732
+ }
7733
+ }`,
7734
+ method: "POST"
7735
+ })).json();
7736
+ return console.log("\x1B[31mID-Hub \x1B[32m - Initializing result", t), this.tunnistusUrl = t.tunnistusURL, this.orderRef = t.orderRef, this.tunnistusUrl;
7737
+ } catch {
7738
+ return;
7739
+ }
7740
+ }
7741
+ async collectPolling() {
7742
+ let e = this.maxRetries, t;
7743
+ do
7744
+ await new Promise((i) => setTimeout(i, 1e3)), t = await this.collect(), e--;
7745
+ while (t.status == "pending" && e > 0);
7746
+ return t;
7747
+ }
7748
+ async collect() {
7749
+ if (this.orderRef === "")
7750
+ throw new Error("OrderRef is missing");
7751
+ const t = await (await fetch(this.url + "/collect", {
7752
+ headers: {
7753
+ accept: "application/json",
7754
+ "accept-language": "sv-SE,sv;q=0.9,en-US;q=0.8,en;q=0.7",
7755
+ "content-type": "application/json"
7756
+ },
7757
+ body: `{
7758
+ "clientName": "idhub-web-1.0.0",
7759
+ "orderRef": "${this.orderRef}",
7760
+ "method": "auth"
7761
+ }`,
7762
+ method: "POST"
7763
+ })).json();
7764
+ return console.log("\x1B[31mID-Hub \x1B[32m - Collect result", t), t;
7765
+ }
7766
+ }
7767
+ const we = (n) => n.objectType === "info", Ld = (n) => n.objectType === "chatEntry", Rd = (n) => n.objectType === "pen", Id = (n) => n.objectType === "chatButtonClicked", Pd = (n) => n.objectType === "endVideoButtonClicked", Md = (n) => n.type === "queue-status", Dd = (n) => n.type === "established", Ud = (n) => n.type === "pen-status", Nd = (n) => n.type === "prepareVideo", zd = (n) => n.type === "videoPrepared", jd = (n) => n.type === "chatButtonClicked", Hd = (n) => n.type === "endVideoButtonClicked", Fd = (n) => n.type === "chat-ended";
7714
7768
  class Un extends Error {
7715
7769
  constructor(e) {
7716
7770
  super(e), this.name = "EngineException";
@@ -7849,17 +7903,22 @@ class xs {
7849
7903
  return e.replace(/\/+$/, "");
7850
7904
  }
7851
7905
  }
7852
- const Fd = () => "10000000-1000-4000-8000-100000000000".replace(
7906
+ const Bd = () => "10000000-1000-4000-8000-100000000000".replace(
7853
7907
  /[018]/g,
7854
7908
  (n) => (+n ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +n / 4).toString(16)
7855
- ), Zi = () => typeof crypto.randomUUID == "function" ? crypto.randomUUID() : Fd();
7909
+ ), Zi = () => typeof crypto.randomUUID == "function" ? crypto.randomUUID() : Bd();
7856
7910
  function Yi(n) {
7857
7911
  return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n);
7858
7912
  }
7859
7913
  function Wa(n) {
7860
7914
  return n.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
7861
7915
  }
7862
- class Bd {
7916
+ function qd(n) {
7917
+ return decodeURIComponent(
7918
+ atob(n).split("").map((e) => "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2)).join("")
7919
+ );
7920
+ }
7921
+ class Vd {
7863
7922
  constructor(e, t) {
7864
7923
  this.config = e, this.messageSubject$ = new P(), this.actionsSubject$ = new P(), this.messages = () => this.messageSubject$.asObservable(), this.actions = () => this.actionsSubject$.asObservable(), this.sessionId = "", this.lastObjectId = 0, this.sessionId = t ?? Zi(), this.client = new xs(this.config.engineUrl, this.config.engineTimeout);
7865
7924
  }
@@ -7877,7 +7936,7 @@ class Bd {
7877
7936
  text: this.config.errorMessage ?? "An error occured",
7878
7937
  source: "system"
7879
7938
  }), new j())),
7880
- _e(() => this.poll().pipe(
7939
+ Ce(() => this.poll().pipe(
7881
7940
  pi(() => this.poll()),
7882
7941
  // Using concatMap here to ensure that each http request gets handled in order
7883
7942
  fi()
@@ -7904,7 +7963,7 @@ class Bd {
7904
7963
  text: this.config.errorMessage ?? "An error occured",
7905
7964
  source: "system"
7906
7965
  }), new j())),
7907
- _e(() => this.poll().pipe(
7966
+ Ce(() => this.poll().pipe(
7908
7967
  pi(() => this.poll()),
7909
7968
  // Using concatMap here to ensure that each http request gets handled in order
7910
7969
  fi()
@@ -7981,12 +8040,12 @@ class Bd {
7981
8040
  }
7982
8041
  processMessages(e) {
7983
8042
  e.dataObjects.forEach((t) => {
7984
- Od(t) && t.source && t.objectId >= this.lastObjectId && this.messageSubject$.next({
8043
+ Ld(t) && t.source && t.objectId >= this.lastObjectId && this.messageSubject$.next({
7985
8044
  text: t.message,
7986
8045
  source: t.source,
7987
8046
  invitationNo: t.invitationNo.toString(),
7988
8047
  alias: t.alias
7989
- }), Ld(t) && this.actionsSubject$.next({
8048
+ }), Rd(t) && this.actionsSubject$.next({
7990
8049
  penStatus: t.penStatus,
7991
8050
  type: "pen-status"
7992
8051
  }), we(t) && t.infoType === "queue" && this.actionsSubject$.next({
@@ -8008,10 +8067,10 @@ class Bd {
8008
8067
  agent: t.agent,
8009
8068
  type: "videoPrepared",
8010
8069
  userUrl: t.userUrl
8011
- }), Rd(t) && this.actionsSubject$.next({
8070
+ }), Id(t) && this.actionsSubject$.next({
8012
8071
  guestId: t.guestId,
8013
8072
  type: "chatButtonClicked"
8014
- }), Id(t) && this.actionsSubject$.next({
8073
+ }), Pd(t) && this.actionsSubject$.next({
8015
8074
  guestId: t.guestId,
8016
8075
  type: "endVideoButtonClicked"
8017
8076
  }), we(t) && ["afterChat", "finished"].includes(t.infoType) && this.actionsSubject$.next({
@@ -8100,10 +8159,10 @@ class Ie {
8100
8159
  this._email = "", this._host.requestUpdate();
8101
8160
  }
8102
8161
  }
8103
- var qd = Object.defineProperty, xt = (n, e, t, i) => {
8162
+ var Wd = Object.defineProperty, xt = (n, e, t, i) => {
8104
8163
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
8105
8164
  (o = n[r]) && (s = o(e, t, s) || s);
8106
- return s && qd(e, t, s), s;
8165
+ return s && Wd(e, t, s), s;
8107
8166
  }, ft;
8108
8167
  let Je = (ft = class extends E {
8109
8168
  constructor() {
@@ -8112,7 +8171,7 @@ let Je = (ft = class extends E {
8112
8171
  connectedCallback() {
8113
8172
  var r, o, a, l;
8114
8173
  super.connectedCallback();
8115
- const e = this.application.settings.components.conversation, t = this.application.userData, i = ((o = (r = e == null ? void 0 : e.properties) == null ? void 0 : r.chat) == null ? void 0 : o.customData) || [];
8174
+ const e = this.application.settings.components.conversation, t = this.application.userData, i = ((o = (r = e == null ? void 0 : e.properties) == null ? void 0 : r.chat) == null ? void 0 : o.customData) ?? [];
8116
8175
  this.customData = i.map((c) => {
8117
8176
  let u;
8118
8177
  switch (c.entryType) {
@@ -8132,7 +8191,7 @@ let Je = (ft = class extends E {
8132
8191
  const s = this.customData.find(
8133
8192
  (c) => c.name === "customerName"
8134
8193
  );
8135
- s && (this.customerName = ((l = (a = t.completionData) == null ? void 0 : a.user) == null ? void 0 : l.name) || "", s.value = this.customerName);
8194
+ s && (this.customerName = ((l = (a = t.completionData) == null ? void 0 : a.user) == null ? void 0 : l.name) ?? "", s.value = this.customerName);
8136
8195
  }
8137
8196
  _onStartChat(e) {
8138
8197
  if (e.preventDefault(), this.showValidationWarning = !1, this.customData.forEach((c) => {
@@ -8173,9 +8232,9 @@ let Je = (ft = class extends E {
8173
8232
  this.customData = this.customData.map((i) => (i.name === t.name && (i.value = e), i));
8174
8233
  }
8175
8234
  validateCustomDataEntry(e) {
8176
- e.required && (e.name === "customerEmailAddress" && !Yi(e.value) ? this.validationErrors.includes(e.name) || this.validationErrors.push(e.name) : e.value ? this.validationErrors = this.validationErrors.filter(
8235
+ e.required && (e.name === "customerEmailAddress" && !Yi(e.value) || !e.value ? this.validationErrors.includes(e.name) || this.validationErrors.push(e.name) : this.validationErrors = this.validationErrors.filter(
8177
8236
  (t) => t !== e.name
8178
- ) : this.validationErrors.includes(e.name) || this.validationErrors.push(e.name));
8237
+ ));
8179
8238
  }
8180
8239
  render() {
8181
8240
  if (this.submitted)
@@ -8340,10 +8399,10 @@ xt([
8340
8399
  k({ attribute: !1 })
8341
8400
  ], Je.prototype, "application");
8342
8401
  window.customElements.get("ace-welcome-form") || window.customElements.define("ace-welcome-form", Je);
8343
- var Vd = Object.defineProperty, ks = (n, e, t, i) => {
8402
+ var Gd = Object.defineProperty, ks = (n, e, t, i) => {
8344
8403
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
8345
8404
  (o = n[r]) && (s = o(e, t, s) || s);
8346
- return s && Vd(e, t, s), s;
8405
+ return s && Gd(e, t, s), s;
8347
8406
  };
8348
8407
  const zs = class zs extends E {
8349
8408
  constructor() {
@@ -8503,10 +8562,10 @@ ks([
8503
8562
  k({ attribute: !1 })
8504
8563
  ], yt.prototype, "application");
8505
8564
  window.customElements.get("ace-welcome-form-third-party") || window.customElements.define("ace-welcome-form-third-party", yt);
8506
- var Wd = Object.defineProperty, Ss = (n, e, t, i) => {
8565
+ var Zd = Object.defineProperty, Ss = (n, e, t, i) => {
8507
8566
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
8508
8567
  (o = n[r]) && (s = o(e, t, s) || s);
8509
- return s && Wd(e, t, s), s;
8568
+ return s && Zd(e, t, s), s;
8510
8569
  };
8511
8570
  const js = class js extends E {
8512
8571
  constructor() {
@@ -8669,10 +8728,10 @@ window.customElements.get("ace-conversation-ended-form") || window.customElement
8669
8728
  "ace-conversation-ended-form",
8670
8729
  $t
8671
8730
  );
8672
- var Gd = Object.defineProperty, Zd = (n, e, t, i) => {
8731
+ var Yd = Object.defineProperty, Qd = (n, e, t, i) => {
8673
8732
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
8674
8733
  (o = n[r]) && (s = o(e, t, s) || s);
8675
- return s && Gd(e, t, s), s;
8734
+ return s && Yd(e, t, s), s;
8676
8735
  };
8677
8736
  const Hs = class Hs extends E {
8678
8737
  _onStartVideo(e) {
@@ -8800,15 +8859,15 @@ Hs.styles = [
8800
8859
  `
8801
8860
  ];
8802
8861
  let Nn = Hs;
8803
- Zd([
8862
+ Qd([
8804
8863
  Te({ context: ge }),
8805
8864
  k({ attribute: !1 })
8806
8865
  ], Nn.prototype, "application");
8807
8866
  window.customElements.get("ace-video-confirm-dialog") || window.customElements.define("ace-video-confirm-dialog", Nn);
8808
- var Yd = Object.defineProperty, Qd = (n, e, t, i) => {
8867
+ var Xd = Object.defineProperty, Kd = (n, e, t, i) => {
8809
8868
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
8810
8869
  (o = n[r]) && (s = o(e, t, s) || s);
8811
- return s && Yd(e, t, s), s;
8870
+ return s && Xd(e, t, s), s;
8812
8871
  };
8813
8872
  const Fs = class Fs extends E {
8814
8873
  constructor(e) {
@@ -8886,15 +8945,15 @@ Fs.styles = [
8886
8945
  `
8887
8946
  ];
8888
8947
  let zn = Fs;
8889
- Qd([
8948
+ Kd([
8890
8949
  Te({ context: ge }),
8891
8950
  k({ attribute: !1 })
8892
8951
  ], zn.prototype, "application");
8893
8952
  window.customElements.get("ace-survey") || window.customElements.define("ace-survey", zn);
8894
- var Xd = Object.defineProperty, Kd = (n, e, t, i) => {
8953
+ var Jd = Object.defineProperty, ep = (n, e, t, i) => {
8895
8954
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
8896
8955
  (o = n[r]) && (s = o(e, t, s) || s);
8897
- return s && Xd(e, t, s), s;
8956
+ return s && Jd(e, t, s), s;
8898
8957
  };
8899
8958
  const Bs = class Bs extends E {
8900
8959
  _onClose() {
@@ -8903,20 +8962,24 @@ const Bs = class Bs extends E {
8903
8962
  render() {
8904
8963
  const e = this.application.texts;
8905
8964
  return y`<div class="container">
8906
- <h3>
8965
+ <h3 data-testid="entrance-closed-title">
8907
8966
  ${e.getOrFallback(
8908
8967
  "entrance-closed.title",
8909
8968
  "We're currently closed"
8910
8969
  )}
8911
8970
  </h3>
8912
- <p>
8971
+ <p data-testid="entrance-closed-ingress">
8913
8972
  ${e.getOrFallback(
8914
8973
  "entrance-closed.ingress",
8915
8974
  "Our team is currently away, but we'll be back during our regular opening hours."
8916
8975
  )}
8917
8976
  </p>
8918
8977
  <div class="button-container">
8919
- <button type="button" @click=${this._onClose}>
8978
+ <button
8979
+ type="button"
8980
+ @click=${this._onClose}
8981
+ data-testid="entrance-closed-button"
8982
+ >
8920
8983
  <telia-icon svg=${as.svg}></telia-icon>
8921
8984
  ${e.getOrFallback("entrance-closed.close-button", "Close chat")}
8922
8985
  </button>
@@ -8979,7 +9042,7 @@ Bs.styles = [
8979
9042
  `
8980
9043
  ];
8981
9044
  let jn = Bs;
8982
- Kd([
9045
+ ep([
8983
9046
  Te({ context: ge }),
8984
9047
  k({ attribute: !1 })
8985
9048
  ], jn.prototype, "application");
@@ -8987,10 +9050,10 @@ window.customElements.get("ace-entrance-closed-dialog") || window.customElements
8987
9050
  "ace-entrance-closed-dialog",
8988
9051
  jn
8989
9052
  );
8990
- var Jd = Object.defineProperty, ep = (n, e, t, i) => {
9053
+ var tp = Object.defineProperty, np = (n, e, t, i) => {
8991
9054
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
8992
9055
  (o = n[r]) && (s = o(e, t, s) || s);
8993
- return s && Jd(e, t, s), s;
9056
+ return s && tp(e, t, s), s;
8994
9057
  };
8995
9058
  const qs = class qs extends E {
8996
9059
  connectedCallback() {
@@ -9147,14 +9210,14 @@ qs.styles = [
9147
9210
  `
9148
9211
  ];
9149
9212
  let Hn = qs;
9150
- ep([
9213
+ np([
9151
9214
  k({ attribute: !1 })
9152
9215
  ], Hn.prototype, "entry");
9153
9216
  window.customElements.get("ace-contact-data-field") || window.customElements.define("ace-contact-data-field", Hn);
9154
- var tp = Object.defineProperty, np = (n, e, t, i) => {
9217
+ var ip = Object.defineProperty, sp = (n, e, t, i) => {
9155
9218
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
9156
9219
  (o = n[r]) && (s = o(e, t, s) || s);
9157
- return s && tp(e, t, s), s;
9220
+ return s && ip(e, t, s), s;
9158
9221
  };
9159
9222
  const Vs = class Vs extends E {
9160
9223
  _onQuit() {
@@ -9267,15 +9330,15 @@ Vs.styles = [
9267
9330
  `
9268
9331
  ];
9269
9332
  let Fn = Vs;
9270
- np([
9333
+ sp([
9271
9334
  Te({ context: ge }),
9272
9335
  k({ attribute: !1 })
9273
9336
  ], Fn.prototype, "application");
9274
9337
  window.customElements.get("ace-quit-confirm-dialog") || window.customElements.define("ace-quit-confirm-dialog", Fn);
9275
- var ip = Object.defineProperty, sp = (n, e, t, i) => {
9338
+ var rp = Object.defineProperty, op = (n, e, t, i) => {
9276
9339
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
9277
9340
  (o = n[r]) && (s = o(e, t, s) || s);
9278
- return s && ip(e, t, s), s;
9341
+ return s && rp(e, t, s), s;
9279
9342
  };
9280
9343
  const Ws = class Ws extends E {
9281
9344
  _onQuit() {
@@ -9388,7 +9451,7 @@ Ws.styles = [
9388
9451
  `
9389
9452
  ];
9390
9453
  let Bn = Ws;
9391
- sp([
9454
+ op([
9392
9455
  Te({ context: ge }),
9393
9456
  k({ attribute: !1 })
9394
9457
  ], Bn.prototype, "application");
@@ -9426,6 +9489,7 @@ const Gs = class Gs extends E {
9426
9489
  target="_blank"
9427
9490
  href="${this.tunnistusURL}"
9428
9491
  @click=${this._onStartAuth}
9492
+ data-testid="card-auth-link"
9429
9493
  >
9430
9494
  Authenticate with Tunnistus
9431
9495
  <telia-icon svg=${ta.svg} size="sm"></telia-icon>
@@ -9506,13 +9570,13 @@ Gs.styles = [
9506
9570
  `
9507
9571
  ];
9508
9572
  let Qi = Gs;
9509
- window.customElements.get("tunnistus-link-button") || window.customElements.define("tunnistus-link-button", Qi);
9573
+ window.customElements.get("ace-tunnistus-auth-card") || window.customElements.define("ace-tunnistus-auth-card", Qi);
9510
9574
  /**
9511
9575
  * @license
9512
9576
  * Copyright 2018 Google LLC
9513
9577
  * SPDX-License-Identifier: BSD-3-Clause
9514
9578
  */
9515
- const Ga = "important", rp = " !" + Ga, op = Jt(class extends Yn {
9579
+ const Ga = "important", ap = " !" + Ga, lp = Jt(class extends Yn {
9516
9580
  constructor(n) {
9517
9581
  var e;
9518
9582
  if (super(n), n.type !== Kt.ATTRIBUTE || n.name !== "style" || ((e = n.strings) == null ? void 0 : e.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
@@ -9531,17 +9595,17 @@ const Ga = "important", rp = " !" + Ga, op = Jt(class extends Yn {
9531
9595
  const s = e[i];
9532
9596
  if (s != null) {
9533
9597
  this.ft.add(i);
9534
- const r = typeof s == "string" && s.endsWith(rp);
9598
+ const r = typeof s == "string" && s.endsWith(ap);
9535
9599
  i.includes("-") || r ? t.setProperty(i, r ? s.slice(0, -11) : s, r ? Ga : "") : t[i] = s;
9536
9600
  }
9537
9601
  }
9538
- return Ce;
9602
+ return _e;
9539
9603
  }
9540
9604
  });
9541
- var ap = Object.defineProperty, lp = (n, e, t, i) => {
9605
+ var cp = Object.defineProperty, up = (n, e, t, i) => {
9542
9606
  for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
9543
9607
  (o = n[r]) && (s = o(e, t, s) || s);
9544
- return s && ap(e, t, s), s;
9608
+ return s && cp(e, t, s), s;
9545
9609
  };
9546
9610
  const Zs = class Zs extends E {
9547
9611
  constructor(e, t) {
@@ -9573,7 +9637,7 @@ const Zs = class Zs extends E {
9573
9637
  top: this.headerHeight + e + "px",
9574
9638
  bottom: this.copyrightHeight + e + "px"
9575
9639
  };
9576
- return y` <div class="container" style=${op(t)}>
9640
+ return y` <div class="container" style=${lp(t)}>
9577
9641
  <iframe
9578
9642
  class="video-iframe"
9579
9643
  src=${this.userUrl.href}
@@ -9607,78 +9671,17 @@ Zs.styles = [
9607
9671
  `
9608
9672
  ];
9609
9673
  let Zt = Zs;
9610
- lp([
9674
+ up([
9611
9675
  Te({ context: ge }),
9612
9676
  k({ attribute: !1 })
9613
9677
  ], Zt.prototype, "application");
9614
9678
  window.customElements.get("ace-video-iframe") || window.customElements.define("ace-video-iframe", Zt);
9615
- class cp {
9616
- constructor(e) {
9617
- this.url = "", this.maxRetries = 300, this.orderRef = "", this.tunnistusUrl = "", this.url = `${e.idHubUrl}/${e.idHubCustomerKey}/${e.idHubOrgKey}/${e.idHubEidType.toLowerCase()}`, this.maxRetries = e.idHubMaxRetries;
9618
- }
9619
- async auth() {
9620
- console.log("\x1B[31mID-Hub \x1B[32m - Initializing auth");
9621
- try {
9622
- const t = await (await fetch(this.url + "/auth", {
9623
- headers: {
9624
- accept: "application/json",
9625
- "accept-language": "sv-SE,sv;q=0.9,en-US;q=0.8,en;q=0.7",
9626
- "content-type": "application/json"
9627
- },
9628
- body: `{
9629
- "clientName": "idhub-web-1.0.0",
9630
- "register": {
9631
- "clientType": "ACEWIDGET",
9632
- "agentId": "ACEWIDGET",
9633
- "userName": "ACEWIDGET"
9634
- }
9635
- }`,
9636
- method: "POST"
9637
- })).json();
9638
- return console.log("\x1B[31mID-Hub \x1B[32m - Initializing result", t), this.tunnistusUrl = t.tunnistusURL, this.orderRef = t.orderRef, this.tunnistusUrl;
9639
- } catch {
9640
- return;
9641
- }
9642
- }
9643
- async collectPolling() {
9644
- let e = this.maxRetries, t;
9645
- do
9646
- await new Promise((i) => setTimeout(i, 1e3)), t = await this.collect(), e--;
9647
- while (t.status == "pending" && e > 0);
9648
- return t;
9649
- }
9650
- async collect() {
9651
- if (this.orderRef === "")
9652
- throw new Error("OrderRef is missing");
9653
- const t = await (await fetch(this.url + "/collect", {
9654
- headers: {
9655
- accept: "application/json",
9656
- "accept-language": "sv-SE,sv;q=0.9,en-US;q=0.8,en;q=0.7",
9657
- "content-type": "application/json"
9658
- },
9659
- body: `{
9660
- "clientName": "idhub-web-1.0.0",
9661
- "orderRef": "${this.orderRef}",
9662
- "method": "auth"
9663
- }`,
9664
- method: "POST"
9665
- })).json();
9666
- return console.log("\x1B[31mID-Hub \x1B[32m - Collect result", t), t;
9667
- }
9668
- }
9669
- function up(n) {
9670
- return decodeURIComponent(
9671
- atob(n).split("").map(function(e) {
9672
- return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
9673
- }).join("")
9674
- );
9675
- }
9676
- class _s extends vc {
9679
+ class Cs extends vc {
9677
9680
  constructor(e, t) {
9678
9681
  var i, s;
9679
- super(e, t), this.agent = this.createAgent(""), this.user = this.createUser(""), this.pendingMessages = [], this.texts = this.component.application.texts, this.isThirdPartyParticipant = this.component.properties.chat.isThirdPartyWidget, this.disconnected$ = new P(), this.agentUsername = null, this.conversationOption = null, this._conversationOptions = {}, this.sessionId = null, this.contactId = null, this.errand = null, this.entrance = null, this.guestId = null, this.chatOverlayActive = !1, this.inVideoCall = !1, this._onQueueStatusReceived = (r) => {
9680
- this._setQueueStatus(r.text || null);
9681
- }, this._onEstablished = (r) => {
9682
+ super(e, t), this.pendingMessages = [], this.texts = this.component.application.texts, this.headerComponent = this.component.application.getComponent("widget-header"), this.isThirdPartyParticipant = this.component.properties.chat.isThirdPartyWidget, this.agent = this.createAgent(""), this.user = this.createUser(""), this.params = new URLSearchParams(document.location.search), this.invitationUid = this.params.get("invitationUid"), this.customerName = this.params.get("customerName") || void 0, this.disconnected$ = new P(), this.agentUsername = null, this.conversationOption = null, this._conversationOptions = {}, this.sessionId = null, this.contactId = null, this.errand = null, this.entrance = null, this.guestId = null, this.chatOverlayActive = !1, this.inVideoCall = !1, this.onQueueStatusReceived = (r) => {
9683
+ this.setQueueStatus(r.text || null);
9684
+ }, this.onEstablished = (r) => {
9682
9685
  this.contactId = r.contactId, this.errand = r.errand, this.entrance = r.entrance, this.agentUsername = r.agentUsername;
9683
9686
  const o = {
9684
9687
  contactId: this.contactId,
@@ -9688,57 +9691,57 @@ class _s extends vc {
9688
9691
  };
9689
9692
  this.save({
9690
9693
  survey: o
9691
- }), this._setQueueStatus(null), this.agent.name = r.agent, r.videoEnded && this.removeVideo();
9692
- }, this._onPrepareVideo = () => {
9693
- this.prepareVideo();
9694
- }, this._onVideoPrepared = (r) => {
9695
- this.showVideo(r.userUrl);
9696
- }, this._onChatButtonClicked = (r) => {
9694
+ }), this.setQueueStatus(null), this.agent.name = r.agent, r.videoEnded && this.removeVideo();
9695
+ }, this.onPrepareVideo = () => {
9696
+ this.showVideoConfirmDialog();
9697
+ }, this.onVideoPrepared = (r) => {
9698
+ this.showVideoIFrame(r.userUrl);
9699
+ }, this.onChatButtonClicked = (r) => {
9697
9700
  this.showChatOverVideo(r.guestId);
9698
- }, this._onEndVideoButtonClicked = (r) => {
9699
- this.handleEndVideoConference(r.guestId);
9700
- }, this._onPenStatusChange = (r) => {
9701
+ }, this.onEndVideoButtonClicked = (r) => {
9702
+ this.guestId && (r == null ? void 0 : r.guestId) === this.guestId && this.removeVideo();
9703
+ }, this.onPenStatusChange = (r) => {
9701
9704
  r.penStatus === "on" ? this.setTypingState(!0) : this.setTypingState(!1);
9702
- }, this._onChatEnded = async (r) => {
9705
+ }, this.onChatEnded = async (r) => {
9703
9706
  var a, l;
9704
9707
  this.setToastMessage(null), this.setTypingState(!1), this.videoConfirmDialogEntry && this.videoConfirmDialogEntry.remove(), this.component.disableInput(), r.showForm && this.showConversationEndedForm();
9705
9708
  const o = this.component.application.settings;
9706
- (a = o == null ? void 0 : o.survey) != null && a.shouldUseSurvey && ((l = o == null ? void 0 : o.survey) != null && l.surveyBaseUrl) && this.showSurvey(), this.isThirdPartyParticipant ? this._removeHeaderOptions() : this._setStartNewChatOption(), this.complete();
9707
- }, this.headerComponent = this.component.application.getComponent("widget-header"), this.params = new URLSearchParams(document.location.search), this.invitationUid = this.params.get("invitationUid"), this.customerName = this.params.get("customerName") || void 0, this.properties = t.properties, (i = this.component.application.settings) != null && i.auth && (this.idHubClient = new cp(
9709
+ (a = o == null ? void 0 : o.survey) != null && a.shouldUseSurvey && ((l = o == null ? void 0 : o.survey) != null && l.surveyBaseUrl) && this.showSurvey(), this.isThirdPartyParticipant ? this.removeHeaderOptions() : this.setStartNewChatOption(), this.complete();
9710
+ }, this.properties = t.properties, (i = this.component.application.settings) != null && i.auth && (this.idHubClient = new Od(
9708
9711
  (s = this.component.application.settings) == null ? void 0 : s.auth
9709
9712
  ));
9710
9713
  }
9711
- static getInstance(e, t) {
9712
- return t.providerInstance ?? (t.providerInstance = new _s(e, t)), t.providerInstance;
9713
- }
9714
+ // =============================
9715
+ // LIFECYCLE METHODS (overrides)
9716
+ // =============================
9714
9717
  connect(e = {}) {
9715
- super.connect(), this._conversationOptions = e;
9718
+ super.connect(), this.headerComponent && (this.headerComponent.provider = this), this._conversationOptions = e;
9716
9719
  const t = {
9717
9720
  ...this.properties.chat ?? {},
9718
9721
  ...e
9719
9722
  }, i = !!this.sessionId;
9720
9723
  if (!i) {
9721
9724
  const r = Zi();
9722
- this._setSessionId(r);
9725
+ this.setSessionId(r);
9723
9726
  }
9724
9727
  this.save({
9725
9728
  chatSessionId: this.sessionId
9726
- }), this.engine = new Bd(t, this.sessionId), this.engine.messages().subscribe((r) => {
9729
+ }), this.engine = new Vd(t, this.sessionId), this.engine.messages().subscribe((r) => {
9727
9730
  switch (r.source) {
9728
9731
  case "agent":
9729
9732
  this.printAgent(r.text);
9730
9733
  break;
9731
9734
  case "customer":
9732
- this._clearPendingMessages(), this.isThirdPartyParticipant ? r.source === "customer" && r.invitationNo === "0" ? this.printAgent(r.text, r.alias) : this.printUser(r.text) : r.source === "customer" && Number(r.invitationNo) > 0 ? this.printAgent(r.text, r.alias) : this.printUser(r.text);
9735
+ this.clearPendingMessages(), this.isThirdPartyParticipant ? r.source === "customer" && r.invitationNo === "0" ? this.printAgent(r.text, r.alias) : this.printUser(r.text) : r.source === "customer" && Number(r.invitationNo) > 0 ? this.printAgent(r.text, r.alias) : this.printUser(r.text);
9733
9736
  break;
9734
9737
  case "system":
9735
9738
  this.printSystem(r.text);
9736
9739
  break;
9737
9740
  }
9738
- }), this.engine.actions().pipe(B(this.disconnected$), K(Pd)).subscribe(this._onQueueStatusReceived), this.engine.actions().pipe(B(this.disconnected$), K(Md)).subscribe(this._onEstablished), this.engine.actions().pipe(B(this.disconnected$), K(Ud)).subscribe(this._onPrepareVideo), this.engine.actions().pipe(B(this.disconnected$), K(Nd)).subscribe(this._onVideoPrepared), this.engine.actions().pipe(B(this.disconnected$), K(zd)).subscribe(this._onChatButtonClicked), this.engine.actions().pipe(
9741
+ }), this.engine.actions().pipe(B(this.disconnected$), K(Md)).subscribe(this.onQueueStatusReceived), this.engine.actions().pipe(B(this.disconnected$), K(Dd)).subscribe(this.onEstablished), this.engine.actions().pipe(B(this.disconnected$), K(Nd)).subscribe(this.onPrepareVideo), this.engine.actions().pipe(B(this.disconnected$), K(zd)).subscribe(this.onVideoPrepared), this.engine.actions().pipe(B(this.disconnected$), K(jd)).subscribe(this.onChatButtonClicked), this.engine.actions().pipe(
9739
9742
  B(this.disconnected$),
9740
- K(jd)
9741
- ).subscribe(this._onEndVideoButtonClicked), this.engine.actions().pipe(B(this.disconnected$), K(Dd)).subscribe(this._onPenStatusChange), this.engine.actions().pipe(B(this.disconnected$), K(Hd)).subscribe(this._onChatEnded), this.setHeaderOption();
9743
+ K(Hd)
9744
+ ).subscribe(this.onEndVideoButtonClicked), this.engine.actions().pipe(B(this.disconnected$), K(Ud)).subscribe(this.onPenStatusChange), this.engine.actions().pipe(B(this.disconnected$), K(Fd)).subscribe(this.onChatEnded), this.setHeaderOption();
9742
9745
  const s = this.component.application.trigger;
9743
9746
  s && s.widgetActive$.pipe(B(s.componentIsDestroyed$)).subscribe((r) => {
9744
9747
  r && (this.conversationOption = null, this.setHeaderOption());
@@ -9761,46 +9764,110 @@ class _s extends vc {
9761
9764
  console.error("Failed to initialize chat:", r);
9762
9765
  });
9763
9766
  }
9764
- // Change header option based on chat status
9765
- async setHeaderOption() {
9766
- switch (await this.engine.getChatStatus()) {
9767
- case "finished":
9768
- this.isThirdPartyParticipant ? this._removeHeaderOptions() : this._setStartNewChatOption();
9769
- break;
9770
- case "active":
9771
- this._setEndConversationOption();
9772
- break;
9773
- case "noSession":
9774
- this.conversationOption = null;
9775
- }
9776
- }
9777
9767
  disconnected() {
9778
9768
  super.disconnected(), this.disconnected$.next();
9779
9769
  }
9780
- _removeHeaderOptions() {
9781
- const e = this.component.application.getComponent("widget-header");
9782
- e && e.removeOption(this.conversationOption);
9770
+ onUserSubmit(e) {
9771
+ const t = this.printUser(e.text);
9772
+ t.setStatus("pending"), this.pendingMessages.push(t), (async () => {
9773
+ var i;
9774
+ try {
9775
+ await ((i = this.engine) == null ? void 0 : i.chatWrite(e.text));
9776
+ } catch (s) {
9777
+ s instanceof Un ? t.setStatus("failed") : (t.setStatus("failed"), console.warn("Unhandled error:", s));
9778
+ }
9779
+ })();
9783
9780
  }
9784
- _addHeaderOptions(e, t, i, s, r = !0) {
9785
- const o = this.component.application.getComponent("widget-header");
9786
- if (o)
9787
- return this.conversationOption ? (this.conversationOption.label = e, this.conversationOption.key = t, this.conversationOption.icon = i, this.conversationOption.onClick = s, this.conversationOption.enabled = r, o.requestUpdate(), this.conversationOption) : o.addOption({
9788
- label: e,
9789
- icon: i,
9790
- closeOnClick: !0,
9791
- key: t,
9792
- onClick: s,
9793
- enabled: r
9794
- });
9781
+ save(e) {
9782
+ this.component.stateMachine.session().pipe(
9783
+ Ce((t) => (t == null ? void 0 : t.data$) || Xe),
9784
+ he(1)
9785
+ ).subscribe((t) => {
9786
+ this.saveToCurrentSession$.next({ ...t, ...e });
9787
+ });
9795
9788
  }
9796
- _startChat(e) {
9797
- var i, s;
9798
- if (!this.engine)
9799
- return;
9800
- const t = e.customData.errand ?? this.engine.config.defaultErrand;
9801
- if (!t)
9802
- throw new Error("Errand is required but was not configured");
9803
- if (this.isThirdPartyParticipant)
9789
+ async rehydrate(e) {
9790
+ e.chatSessionId && this.setSessionId(e.chatSessionId), e.survey && (this.contactId = e.survey.contactId, this.errand = e.survey.errand, this.entrance = e.survey.entrance, this.agentUsername = e.survey.agentUsername);
9791
+ }
9792
+ // ==============
9793
+ // STATIC METHODS
9794
+ // ==============
9795
+ static getInstance(e, t) {
9796
+ return t.providerInstance ?? (t.providerInstance = new Cs(e, t)), t.providerInstance;
9797
+ }
9798
+ // ==================
9799
+ // PUBLIC API METHODS
9800
+ // ==================
9801
+ showLogoutConfirmDialog() {
9802
+ var e;
9803
+ (e = this.logoutConfirmDialogEntry) == null || e.remove(), this.logoutConfirmDialogEntry = new J(
9804
+ z.System,
9805
+ {
9806
+ name: ""
9807
+ },
9808
+ [
9809
+ {
9810
+ items: [["ace-logout-confirm-dialog", { content: "" }]]
9811
+ }
9812
+ ]
9813
+ ), this.printEntry(this.logoutConfirmDialogEntry), this.logoutConfirmDialogEntry.actions$.pipe(
9814
+ K((t) => t.key === "logout-chat"),
9815
+ he(1)
9816
+ ).subscribe(async (t) => {
9817
+ var i;
9818
+ this.logoutConfirmDialogEntry && this.logoutConfirmDialogEntry.remove(), ((i = t.data) == null ? void 0 : i.result) === "logout" && (await this.engine.getChatStatus() === "noSession" ? (this.headerComponent._logout(), this.setSessionId(null), this.component.clearMessages(), this.startAuthenticationFlow()) : this.endConversation());
9819
+ });
9820
+ }
9821
+ async handleAuthentication(e) {
9822
+ var i, s, r, o;
9823
+ this.headerComponent.UserName = "Authenticating...", this.headerComponent.authState = "authenticating", this.headerComponent.requestUpdate();
9824
+ const t = await ((i = this.idHubClient) == null ? void 0 : i.collectPolling());
9825
+ if (this.component.application.userData = t, (t == null ? void 0 : t.status) === "authenticated") {
9826
+ const a = qd(
9827
+ ((s = t == null ? void 0 : t.idhubEIDToken) == null ? void 0 : s.split(".")[1]) ?? ""
9828
+ ), l = JSON.parse(a), c = ((o = (r = l == null ? void 0 : l.completionData) == null ? void 0 : r.user) == null ? void 0 : o.name) ?? "";
9829
+ this.headerComponent.UserName = c, this.headerComponent.authState = "authenticated", this.component.application.storage.set("auth", {
9830
+ name: c,
9831
+ authenticated: !0
9832
+ }), e == null || e.remove(), this.handleWelcomeForm(this.engine.config);
9833
+ }
9834
+ }
9835
+ // ========================
9836
+ // INTERNAL UTILITY METHODS
9837
+ // ========================
9838
+ async initializeChat(e) {
9839
+ var t, i;
9840
+ (i = (t = this.component.application.settings) == null ? void 0 : t.auth) != null && i.shouldUseAuth ? await this.startAuthenticationFlow() : this.handleWelcomeForm(e);
9841
+ }
9842
+ async startAuthenticationFlow() {
9843
+ var i;
9844
+ const e = await ((i = this.idHubClient) == null ? void 0 : i.auth());
9845
+ let t;
9846
+ e && (this.headerComponent.authUrl = e, this.headerComponent.provider = this, this.headerComponent.authState = "non-authenticated", t = this.showTunnistusAuthCard(e), this.headerComponent.idref = t, t.actions$.pipe(
9847
+ K((s) => s.key === "start-auth"),
9848
+ he(1)
9849
+ ).subscribe(() => {
9850
+ this.handleAuthentication(t);
9851
+ }));
9852
+ }
9853
+ async handleWelcomeForm(e) {
9854
+ let t = !0;
9855
+ e.webApiUrl && (t = await this.isEntranceOpen(
9856
+ e.webApiUrl,
9857
+ e.entrance
9858
+ )), t ? this.customerName ? this.startChat({
9859
+ customerName: this.customerName,
9860
+ customData: {}
9861
+ }) : this.showWelcomeForm() : this.showEntranceClosedDialog();
9862
+ }
9863
+ startChat(e) {
9864
+ var i, s;
9865
+ if (!this.engine)
9866
+ return;
9867
+ const t = e.customData.errand ?? this.engine.config.defaultErrand;
9868
+ if (!t)
9869
+ throw new Error("Errand is required but was not configured");
9870
+ if (this.isThirdPartyParticipant)
9804
9871
  this.component.application.root.style.visibility = "visible", this.engine.chatJoin({
9805
9872
  invitationUid: this.invitationUid,
9806
9873
  customerName: this.customerName ?? e.customerName
@@ -9816,11 +9883,78 @@ class _s extends vc {
9816
9883
  ...r && { authToken: r }
9817
9884
  }).pipe(B(this.disconnected$)).subscribe();
9818
9885
  }
9819
- this.component.enableInput(), this.component.enableSkipToLatestMessage(), this._setEndConversationOption();
9886
+ this.component.enableInput(), this.component.enableSkipToLatestMessage(), this.setEndConversationOption();
9887
+ }
9888
+ restartNewChat() {
9889
+ this.engine && (this.setSessionId(null), this.component.clearMessages(), this.removeHeaderOptions(), this.connect(this._conversationOptions));
9820
9890
  }
9821
- _restartNewChat() {
9822
- this.engine && (this._setSessionId(null), this.component.clearMessages(), this._removeHeaderOptions(), this.connect(this._conversationOptions));
9891
+ setQueueStatus(e) {
9892
+ this.setToastMessage(e);
9893
+ }
9894
+ async endConversation() {
9895
+ var e, t, i;
9896
+ (t = (e = this.component.application.settings) == null ? void 0 : e.auth) != null && t.shouldUseAuth && this.headerComponent._logout("chat-ended"), await ((i = this.engine) == null ? void 0 : i.chatQuit());
9823
9897
  }
9898
+ async sendConversationEmail(e) {
9899
+ var t;
9900
+ try {
9901
+ await ((t = this.engine) == null ? void 0 : t.chatEmailSession(e)), this.printSystem(
9902
+ this.texts.getOrFallback(
9903
+ "email-form.email-sent-label",
9904
+ "An email with the conversation was sent."
9905
+ )
9906
+ );
9907
+ } catch (i) {
9908
+ this.printSystem(
9909
+ this.texts.getOrFallback(
9910
+ "email-form.error-message",
9911
+ "Unable to send email with the conversation."
9912
+ )
9913
+ ), i instanceof Un || console.warn("Unhandled error:", i);
9914
+ }
9915
+ }
9916
+ clearPendingMessages() {
9917
+ this.pendingMessages.forEach((e) => {
9918
+ e.remove();
9919
+ });
9920
+ }
9921
+ setSessionId(e) {
9922
+ this.sessionId = e;
9923
+ }
9924
+ async isEntranceOpen(e, t) {
9925
+ var s;
9926
+ let i = !1;
9927
+ try {
9928
+ const r = await fetch(
9929
+ `${e}/1/entrances/${t}/is-open`
9930
+ ), o = await r.json();
9931
+ r.ok ? i = (s = o == null ? void 0 : o.resultData) == null ? void 0 : s.isOpen : console.log(
9932
+ `Problem when fetching open status for entrance ${t}:`,
9933
+ o == null ? void 0 : o.resultMessage
9934
+ );
9935
+ } catch (r) {
9936
+ console.log(`Failed to fetch open status for ${t}:`, r);
9937
+ }
9938
+ return i;
9939
+ }
9940
+ // =====================
9941
+ // CONVERSATION PRINTERS
9942
+ // =====================
9943
+ printAgent(e, t = "") {
9944
+ const i = t.length > 0 ? this.agent.print(e, "markdown", t) : this.agent.print(e, "markdown");
9945
+ return this.setTypingState(!1), i;
9946
+ }
9947
+ printUser(e) {
9948
+ const t = Ii(Er(e));
9949
+ return this.user.print(t);
9950
+ }
9951
+ printSystem(e) {
9952
+ const t = Ii(Er(e));
9953
+ return this.system.print(t);
9954
+ }
9955
+ // ------------
9956
+ // UI INJECTORS
9957
+ // ------------
9824
9958
  showSurvey() {
9825
9959
  const e = new J(
9826
9960
  z.System,
@@ -9837,7 +9971,6 @@ class _s extends vc {
9837
9971
  agentUsername: this.agentUsername ?? "",
9838
9972
  entrance: this.entrance ?? this.engine.config.entrance,
9839
9973
  errand: this.errand ?? this.engine.config.defaultErrand,
9840
- // TODO: not always default errand
9841
9974
  contactId: this.contactId ?? ""
9842
9975
  }
9843
9976
  ]
@@ -9847,46 +9980,7 @@ class _s extends vc {
9847
9980
  );
9848
9981
  this.printEntry(e);
9849
9982
  }
9850
- async startAuthenticationFlow() {
9851
- var i;
9852
- const e = await ((i = this.idHubClient) == null ? void 0 : i.auth());
9853
- let t;
9854
- e && (this.headerComponent.authUrl = e, this.headerComponent.provider = this, this.headerComponent.authState = "non-authenticated", t = this.showTunnistusLinkButton(e), this.headerComponent.idref = t, t.actions$.pipe(
9855
- K((s) => s.key === "start-auth"),
9856
- he(1)
9857
- ).subscribe(() => {
9858
- this.handleAuthentication(t);
9859
- }));
9860
- }
9861
- async handleAuthentication(e) {
9862
- var i, s, r, o;
9863
- this.headerComponent.UserName = "Authenticating...", this.headerComponent.authState = "authenticating", this.headerComponent.requestUpdate();
9864
- const t = await ((i = this.idHubClient) == null ? void 0 : i.collectPolling());
9865
- if (this.component.application.userData = t, (t == null ? void 0 : t.status) === "authenticated") {
9866
- const a = up(
9867
- ((s = t == null ? void 0 : t.idhubEIDToken) == null ? void 0 : s.split(".")[1]) || ""
9868
- ), l = JSON.parse(a), c = ((o = (r = l == null ? void 0 : l.completionData) == null ? void 0 : r.user) == null ? void 0 : o.name) || "";
9869
- this.headerComponent.UserName = c, this.headerComponent.authState = "authenticated", this.component.application.storage.set("auth", {
9870
- name: c,
9871
- authenticated: !0
9872
- }), e == null || e.remove(), this.handleWelcomeForm(this.engine.config);
9873
- }
9874
- }
9875
- async handleWelcomeForm(e) {
9876
- let t = !0;
9877
- e.webApiUrl && (t = await this.isEntranceOpen(
9878
- e.webApiUrl,
9879
- e.entrance
9880
- )), t ? this.customerName ? this._startChat({
9881
- customerName: this.customerName,
9882
- customData: {}
9883
- }) : this.showWelcomeForm() : this.showEntranceClosedDialog();
9884
- }
9885
- async initializeChat(e) {
9886
- var t, i;
9887
- (i = (t = this.component.application.settings) == null ? void 0 : t.auth) != null && i.shouldUseAuth ? await this.startAuthenticationFlow() : this.handleWelcomeForm(e);
9888
- }
9889
- showTunnistusLinkButton(e) {
9983
+ showTunnistusAuthCard(e) {
9890
9984
  const t = new J(
9891
9985
  z.System,
9892
9986
  {
@@ -9896,7 +9990,7 @@ class _s extends vc {
9896
9990
  {
9897
9991
  items: [
9898
9992
  [
9899
- "tunnistus-link-button",
9993
+ "ace-tunnistus-auth-card",
9900
9994
  { content: "" },
9901
9995
  {
9902
9996
  tunnistusURL: e
@@ -9935,7 +10029,7 @@ class _s extends vc {
9935
10029
  K((t) => t.key === "submitted"),
9936
10030
  he(1)
9937
10031
  ).subscribe((t) => {
9938
- e.remove(), this._startChat({
10032
+ e.remove(), this.startChat({
9939
10033
  customerName: t.data.name,
9940
10034
  customerEmailAddress: t.data.email,
9941
10035
  visitorQuestion: t.data.question,
@@ -9958,29 +10052,6 @@ class _s extends vc {
9958
10052
  );
9959
10053
  this.printEntry(e);
9960
10054
  }
9961
- _setQueueStatus(e) {
9962
- this.setToastMessage(e);
9963
- }
9964
- showLogoutConfirmDialog() {
9965
- var e;
9966
- (e = this.logoutConfirmDialogEntry) == null || e.remove(), this.logoutConfirmDialogEntry = new J(
9967
- z.System,
9968
- {
9969
- name: ""
9970
- },
9971
- [
9972
- {
9973
- items: [["ace-logout-confirm-dialog", { content: "" }]]
9974
- }
9975
- ]
9976
- ), this.printEntry(this.logoutConfirmDialogEntry), this.logoutConfirmDialogEntry.actions$.pipe(
9977
- K((t) => t.key === "logout-chat"),
9978
- he(1)
9979
- ).subscribe(async (t) => {
9980
- var i;
9981
- this.logoutConfirmDialogEntry && this.logoutConfirmDialogEntry.remove(), ((i = t.data) == null ? void 0 : i.result) === "logout" && (await this.engine.getChatStatus() === "noSession" ? (this.headerComponent._logout(), this._setSessionId(null), this.component.clearMessages(), this.startAuthenticationFlow()) : this.endConversation());
9982
- });
9983
- }
9984
10055
  showQuitConfirmDialog() {
9985
10056
  var e;
9986
10057
  (e = this.quitConfirmDialogEntry) == null || e.remove(), this.quitConfirmDialogEntry = new J(
@@ -10020,7 +10091,7 @@ class _s extends vc {
10020
10091
  e.remove(), t.data.email && this.sendConversationEmail(t.data.email);
10021
10092
  });
10022
10093
  }
10023
- prepareVideo() {
10094
+ showVideoConfirmDialog() {
10024
10095
  this.videoConfirmDialogEntry = new J(
10025
10096
  z.System,
10026
10097
  {
@@ -10039,7 +10110,7 @@ class _s extends vc {
10039
10110
  this.videoConfirmDialogEntry && this.videoConfirmDialogEntry.remove(), e.data.result === "declined" && (this.guestId = null), (t = this.engine) == null || t.videoPrepared(e.data.result), this.printSystem(e.data.text);
10040
10111
  });
10041
10112
  }
10042
- showVideo(e) {
10113
+ showVideoIFrame(e) {
10043
10114
  var i;
10044
10115
  this.guestId = Zi(), this.videoIFrameElement = new Zt(e, this.guestId);
10045
10116
  const t = this.component.application.root;
@@ -10048,23 +10119,47 @@ class _s extends vc {
10048
10119
  showChatOverVideo(e) {
10049
10120
  this.guestId && e === this.guestId && (this.chatOverlayActive = !0, this.showChatOverlay$.next(this.chatOverlayActive));
10050
10121
  }
10051
- handleEndVideoConference(e) {
10052
- this.guestId && e === this.guestId && this.removeVideo();
10122
+ // -----------
10123
+ // UI REMOVERS
10124
+ // -----------
10125
+ removeVideo() {
10126
+ var e;
10127
+ (e = this.videoIFrameElement) == null || e.remove(), this.guestId = null, this.chatOverlayActive && (this.chatOverlayActive = !1, this.showChatOverlay$.next(this.chatOverlayActive)), this.inVideoCall = !1, this.setHeaderOption();
10053
10128
  }
10054
- printAgent(e, t = "") {
10055
- const i = t.length > 0 ? this.agent.print(e, "markdown", t) : this.agent.print(e, "markdown");
10056
- return this.setTypingState(!1), i;
10129
+ // ----------------------
10130
+ // OPTION MENU FUNCTIONS
10131
+ // ----------------------
10132
+ addHeaderOptions(e, t, i, s, r = !0) {
10133
+ const o = this.component.application.getComponent("widget-header");
10134
+ if (o)
10135
+ return this.conversationOption ? (this.conversationOption.label = e, this.conversationOption.key = t, this.conversationOption.icon = i, this.conversationOption.onClick = s, this.conversationOption.enabled = r, o.requestUpdate(), this.conversationOption) : o.addOption({
10136
+ label: e,
10137
+ icon: i,
10138
+ closeOnClick: !0,
10139
+ key: t,
10140
+ onClick: s,
10141
+ enabled: r
10142
+ });
10057
10143
  }
10058
- printUser(e) {
10059
- const t = Ii(Er(e));
10060
- return this.user.print(t);
10144
+ removeHeaderOptions() {
10145
+ const e = this.component.application.getComponent("widget-header");
10146
+ e && e.removeOption(this.conversationOption);
10061
10147
  }
10062
- printSystem(e) {
10063
- const t = Ii(Er(e));
10064
- return this.system.print(t);
10148
+ setStartNewChatOption() {
10149
+ this.conversationOption = this.addHeaderOptions(
10150
+ this.texts.getOrFallback(
10151
+ "widget-header.start-new-chat",
10152
+ "Start new chat"
10153
+ ),
10154
+ "start-new-chat-button",
10155
+ na.svg,
10156
+ () => {
10157
+ this.restartNewChat();
10158
+ }
10159
+ );
10065
10160
  }
10066
- _setEndConversationOption() {
10067
- this.conversationOption = this._addHeaderOptions(
10161
+ setEndConversationOption() {
10162
+ this.conversationOption = this.addHeaderOptions(
10068
10163
  this.texts.getOrFallback(
10069
10164
  "widget-header.end-conversation",
10070
10165
  "End conversation"
@@ -10078,97 +10173,23 @@ class _s extends vc {
10078
10173
  !this.inVideoCall
10079
10174
  );
10080
10175
  }
10081
- _setStartNewChatOption() {
10082
- this.conversationOption = this._addHeaderOptions(
10083
- this.texts.getOrFallback(
10084
- "widget-header.start-new-chat",
10085
- "Start new chat"
10086
- ),
10087
- "start-new-chat-button",
10088
- na.svg,
10089
- () => {
10090
- this._restartNewChat();
10091
- }
10092
- );
10093
- }
10094
- removeVideo() {
10095
- var e;
10096
- (e = this.videoIFrameElement) == null || e.remove(), this.guestId = null, this.chatOverlayActive && (this.chatOverlayActive = !1, this.showChatOverlay$.next(this.chatOverlayActive)), this.inVideoCall = !1, this.setHeaderOption();
10097
- }
10098
- async endConversation() {
10099
- var e, t, i;
10100
- (t = (e = this.component.application.settings) == null ? void 0 : e.auth) != null && t.shouldUseAuth && this.headerComponent._logout("chat-ended"), await ((i = this.engine) == null ? void 0 : i.chatQuit());
10101
- }
10102
- async sendConversationEmail(e) {
10103
- var t;
10104
- try {
10105
- await ((t = this.engine) == null ? void 0 : t.chatEmailSession(e)), this.printSystem(
10106
- this.texts.getOrFallback(
10107
- "email-form.email-sent-label",
10108
- "An email with the conversation was sent."
10109
- )
10110
- );
10111
- } catch (i) {
10112
- this.printSystem(
10113
- this.texts.getOrFallback(
10114
- "email-form.error-message",
10115
- "Unable to send email with the conversation."
10116
- )
10117
- ), i instanceof Un || console.warn("Unhandled error:", i);
10118
- }
10119
- }
10120
- _clearPendingMessages() {
10121
- this.pendingMessages.forEach((e) => {
10122
- e.remove();
10123
- });
10124
- }
10125
- _setSessionId(e) {
10126
- this.sessionId = e;
10127
- }
10128
- onUserSubmit(e) {
10129
- const t = this.printUser(e.text);
10130
- t.setStatus("pending"), this.pendingMessages.push(t), (async () => {
10131
- var i;
10132
- try {
10133
- await ((i = this.engine) == null ? void 0 : i.chatWrite(e.text));
10134
- } catch (s) {
10135
- s instanceof Un ? t.setStatus("failed") : (t.setStatus("failed"), console.warn("Unhandled error:", s));
10136
- }
10137
- })();
10138
- }
10139
- async rehydrate(e) {
10140
- e.chatSessionId && this._setSessionId(e.chatSessionId), e.survey && (this.contactId = e.survey.contactId, this.errand = e.survey.errand, this.entrance = e.survey.entrance, this.agentUsername = e.survey.agentUsername);
10141
- }
10142
- save(e) {
10143
- this.component.stateMachine.session().pipe(
10144
- _e((t) => (t == null ? void 0 : t.data$) || Xe),
10145
- he(1)
10146
- ).subscribe((t) => {
10147
- this.saveToCurrentSession$.next({ ...t, ...e });
10148
- });
10149
- }
10150
- // Use "ACE Web API" to check if an entrance is open.
10151
- async isEntranceOpen(e, t) {
10152
- var s;
10153
- let i = !1;
10154
- try {
10155
- const r = await fetch(
10156
- `${e}/1/entrances/${t}/is-open`
10157
- ), o = await r.json();
10158
- r.ok ? i = (s = o == null ? void 0 : o.resultData) == null ? void 0 : s.isOpen : console.log(
10159
- `Problem when fetching open status for entrance ${t}:`,
10160
- o == null ? void 0 : o.resultMessage
10161
- );
10162
- } catch (r) {
10163
- console.log(`Failed to fetch open status for ${t}:`, r);
10176
+ async setHeaderOption() {
10177
+ switch (await this.engine.getChatStatus()) {
10178
+ case "finished":
10179
+ this.isThirdPartyParticipant ? this.removeHeaderOptions() : this.setStartNewChatOption();
10180
+ break;
10181
+ case "active":
10182
+ this.setEndConversationOption();
10183
+ break;
10184
+ case "noSession":
10185
+ this.conversationOption = null;
10164
10186
  }
10165
- return i;
10166
10187
  }
10167
10188
  }
10168
10189
  const kp = async (n) => {
10169
- (await Xi.getInstance(n.container)).registerProvider(
10190
+ (await ns.getInstance(n.container)).registerProvider(
10170
10191
  "ace-chat",
10171
- (t) => _s.getInstance("ace-chat", t)
10192
+ (t) => Cs.getInstance("ace-chat", t)
10172
10193
  );
10173
10194
  };
10174
10195
  export {