@soyio/soyio-widget 2.11.0 → 2.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var rn = Object.defineProperty;
2
- var vt = Object.getOwnPropertySymbols, on = Object.getPrototypeOf, an = Object.prototype.hasOwnProperty, sn = Object.prototype.propertyIsEnumerable, cn = Reflect.get;
3
- var un = (d, f, h) => f in d ? rn(d, f, { enumerable: !0, configurable: !0, writable: !0, value: h }) : d[f] = h;
2
+ var vt = Object.getOwnPropertySymbols, on = Object.getPrototypeOf, an = Object.prototype.hasOwnProperty, sn = Object.prototype.propertyIsEnumerable, un = Reflect.get;
3
+ var cn = (d, f, h) => f in d ? rn(d, f, { enumerable: !0, configurable: !0, writable: !0, value: h }) : d[f] = h;
4
4
  var wt = (d, f) => {
5
5
  var h = {};
6
6
  for (var l in d)
@@ -10,7 +10,7 @@ var wt = (d, f) => {
10
10
  f.indexOf(l) < 0 && sn.call(d, l) && (h[l] = d[l]);
11
11
  return h;
12
12
  };
13
- var O = (d, f, h) => (un(d, typeof f != "symbol" ? f + "" : f, h), h), dn = (d, f, h) => {
13
+ var O = (d, f, h) => (cn(d, typeof f != "symbol" ? f + "" : f, h), h), dn = (d, f, h) => {
14
14
  if (!f.has(d))
15
15
  throw TypeError("Cannot " + h);
16
16
  };
@@ -19,7 +19,7 @@ var gt = (d, f, h) => {
19
19
  throw TypeError("Cannot add the same private member more than once");
20
20
  f instanceof WeakSet ? f.add(d) : f.set(d, h);
21
21
  };
22
- var yt = (d, f, h) => (dn(d, f, "access private method"), h), Et = (d, f, h) => cn(on(d), h, f);
22
+ var yt = (d, f, h) => (dn(d, f, "access private method"), h), Et = (d, f, h) => un(on(d), h, f);
23
23
  var G = (d, f, h) => new Promise((l, g) => {
24
24
  var y = (D) => {
25
25
  try {
@@ -62,7 +62,7 @@ class ln {
62
62
  }
63
63
  createTooltipElement() {
64
64
  const f = document.querySelector(`.${this.tooltipClass}`);
65
- f == null || f.remove(), this.tooltipElement = document.createElement("div"), this.tooltipElement.className = this.tooltipClass, this.tooltipElement.style.cssText = `
65
+ this.tooltipElement = f || document.createElement("div"), this.tooltipElement.className = this.tooltipClass, this.tooltipElement.style.cssText = `
66
66
  position: fixed;
67
67
  z-index: 99999;
68
68
  background: white;
@@ -78,18 +78,9 @@ class ln {
78
78
  transition: opacity 0.2s ease-in-out;
79
79
  transform: translateX(-50%) translateY(-100%);
80
80
  margin-top: -8px;
81
- `, this.tooltipContent = document.createElement("div"), this.tooltipContent.style.cssText = "text-align: center;", this.tooltipElement.appendChild(this.tooltipContent);
82
- const h = document.createElement("div");
83
- h.style.cssText = `
84
- position: absolute;
85
- bottom: -4px;
86
- left: 50%;
87
- transform: translateX(-50%) rotate(45deg);
88
- width: 8px;
89
- height: 8px;
90
- background: white;
91
- box-shadow: 2px 2px 2px rgba(0,0,0,0.1);
92
- `, this.tooltipElement.appendChild(h), document.body.appendChild(this.tooltipElement);
81
+ `;
82
+ const h = this.tooltipElement.children[0];
83
+ this.tooltipContent = h || document.createElement("div"), this.tooltipContent.style.cssText = "text-align: left;", this.tooltipElement.appendChild(this.tooltipContent), document.body.appendChild(this.tooltipElement);
93
84
  }
94
85
  setupGlobalListeners() {
95
86
  window.addEventListener("scroll", () => this.hide(), !0), window.addEventListener("resize", () => this.hide()), window.addEventListener("orientationchange", () => this.hide());
@@ -384,13 +375,13 @@ class zn {
384
375
  animation: shimmer 1.5s infinite;
385
376
  border-radius: 0.125rem;
386
377
  `, !document.getElementById("skeleton-animation")) {
387
- const X = document.createElement("style");
388
- X.id = "skeleton-animation", X.textContent = `
378
+ const Z = document.createElement("style");
379
+ Z.id = "skeleton-animation", Z.textContent = `
389
380
  @keyframes shimmer {
390
381
  0% { background-position: 200% 0; }
391
382
  100% { background-position: -200% 0; }
392
383
  }
393
- `, document.head.appendChild(X);
384
+ `, document.head.appendChild(Z);
394
385
  }
395
386
  l.appendChild(g), l.appendChild(y), l.appendChild(E), j.appendChild(B), j.appendChild(oe), I.appendChild(D), I.appendChild(j), h.appendChild(l), h.appendChild(I), this.element.appendChild(h);
396
387
  }
@@ -618,15 +609,15 @@ var Ot = { exports: {} }, Nt = { exports: {} };
618
609
  }), g.d(l, "destroy", function() {
619
610
  return en;
620
611
  }), g.d(l, "serializeMessage", function() {
621
- return Xt;
622
- }), g.d(l, "deserializeMessage", function() {
623
612
  return Zt;
613
+ }), g.d(l, "deserializeMessage", function() {
614
+ return Xt;
624
615
  }), g.d(l, "createProxyWindow", function() {
625
616
  return Kt;
626
617
  }), g.d(l, "toProxyWindow", function() {
627
618
  return Qt;
628
619
  }), g.d(l, "on", function() {
629
- return Z;
620
+ return X;
630
621
  }), g.d(l, "once", function() {
631
622
  return Jt;
632
623
  }), g.d(l, "send", function() {
@@ -671,7 +662,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
671
662
  } catch (n) {
672
663
  }
673
664
  }
674
- function X(e) {
665
+ function Z(e) {
675
666
  try {
676
667
  return !0;
677
668
  } catch (n) {
@@ -690,7 +681,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
690
681
  return "file://";
691
682
  if (t === "about:") {
692
683
  var r = B(e);
693
- return r && X() ? pe(r) : "about://";
684
+ return r && Z() ? pe(r) : "about://";
694
685
  }
695
686
  var o = n.host;
696
687
  if (!o)
@@ -716,14 +707,14 @@ var Ot = { exports: {} }, Nt = { exports: {} };
716
707
  } catch (r) {
717
708
  }
718
709
  try {
719
- if (j(n) && X())
710
+ if (j(n) && Z())
720
711
  return !0;
721
712
  } catch (r) {
722
713
  }
723
714
  try {
724
715
  if (function(r) {
725
716
  return r === void 0 && (r = window), D(r) === "mock:";
726
- }(n) && X())
717
+ }(n) && Z())
727
718
  return !0;
728
719
  } catch (r) {
729
720
  }
@@ -736,7 +727,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
736
727
  }(e))
737
728
  return !1;
738
729
  try {
739
- if (e === window || j(e) && X() || U(window) === U(e))
730
+ if (e === window || j(e) && Z() || U(window) === U(e))
740
731
  return !0;
741
732
  } catch (n) {
742
733
  }
@@ -765,13 +756,13 @@ var Ot = { exports: {} }, Nt = { exports: {} };
765
756
  var n = [], t;
766
757
  try {
767
758
  t = e.frames;
768
- } catch (c) {
759
+ } catch (u) {
769
760
  t = e;
770
761
  }
771
762
  var r;
772
763
  try {
773
764
  r = t.length;
774
- } catch (c) {
765
+ } catch (u) {
775
766
  }
776
767
  if (r === 0)
777
768
  return n;
@@ -780,7 +771,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
780
771
  var i = void 0;
781
772
  try {
782
773
  i = t[o];
783
- } catch (c) {
774
+ } catch (u) {
784
775
  continue;
785
776
  }
786
777
  n.push(i);
@@ -788,15 +779,15 @@ var Ot = { exports: {} }, Nt = { exports: {} };
788
779
  return n;
789
780
  }
790
781
  for (var a = 0; a < 100; a++) {
791
- var u = void 0;
782
+ var c = void 0;
792
783
  try {
793
- u = t[a];
794
- } catch (c) {
784
+ c = t[a];
785
+ } catch (u) {
795
786
  return n;
796
787
  }
797
- if (!u)
788
+ if (!c)
798
789
  return n;
799
- n.push(u);
790
+ n.push(c);
800
791
  }
801
792
  return n;
802
793
  }
@@ -837,7 +828,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
837
828
  try {
838
829
  if (o[a] === i)
839
830
  return a;
840
- } catch (u) {
831
+ } catch (c) {
841
832
  }
842
833
  return -1;
843
834
  }(Lt, e);
@@ -991,19 +982,19 @@ var Ot = { exports: {} }, Nt = { exports: {} };
991
982
  function e(t) {
992
983
  var r = this;
993
984
  if (this.resolved = void 0, this.rejected = void 0, this.errorHandled = void 0, this.value = void 0, this.error = void 0, this.handlers = void 0, this.dispatching = void 0, this.stack = void 0, this.resolved = !1, this.rejected = !1, this.errorHandled = !1, this.handlers = [], t) {
994
- var o, i, a = !1, u = !1, c = !1;
985
+ var o, i, a = !1, c = !1, u = !1;
995
986
  We();
996
987
  try {
997
988
  t(function(s) {
998
- c ? r.resolve(s) : (a = !0, o = s);
989
+ u ? r.resolve(s) : (a = !0, o = s);
999
990
  }, function(s) {
1000
- c ? r.reject(s) : (u = !0, i = s);
991
+ u ? r.reject(s) : (c = !0, i = s);
1001
992
  });
1002
993
  } catch (s) {
1003
994
  se(), this.reject(s);
1004
995
  return;
1005
996
  }
1006
- se(), c = !0, a ? this.resolve(o) : u && this.reject(i);
997
+ se(), u = !0, a ? this.resolve(o) : c && this.reject(i);
1007
998
  }
1008
999
  }
1009
1000
  var n = e.prototype;
@@ -1029,8 +1020,8 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1029
1020
  qe.push(i), setTimeout(function() {
1030
1021
  throw i;
1031
1022
  }, 1);
1032
- for (var u = 0; u < ie.length; u++)
1033
- ie[u](i, a);
1023
+ for (var c = 0; c < ie.length; c++)
1024
+ ie[c](i, a);
1034
1025
  }
1035
1026
  }(t, r);
1036
1027
  }, 1), this.dispatch(), this;
@@ -1047,10 +1038,10 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1047
1038
  b.reject(x);
1048
1039
  });
1049
1040
  }, a = 0; a < o.length; a++) {
1050
- var u = o[a], c = u.onSuccess, s = u.onError, v = u.promise, m = void 0;
1041
+ var c = o[a], u = c.onSuccess, s = c.onError, v = c.promise, m = void 0;
1051
1042
  if (t)
1052
1043
  try {
1053
- m = c ? c(this.value) : this.value;
1044
+ m = u ? u(this.value) : this.value;
1054
1045
  } catch (w) {
1055
1046
  v.reject(w);
1056
1047
  continue;
@@ -1134,27 +1125,27 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1134
1125
  }, function(p) {
1135
1126
  m.reject(p);
1136
1127
  });
1137
- }, u = 0; u < t.length; u++) {
1138
- var c = t[u];
1139
- if (c instanceof e) {
1140
- if (c.resolved) {
1141
- i[u] = c.value, o -= 1;
1128
+ }, c = 0; c < t.length; c++) {
1129
+ var u = t[c];
1130
+ if (u instanceof e) {
1131
+ if (u.resolved) {
1132
+ i[c] = u.value, o -= 1;
1142
1133
  continue;
1143
1134
  }
1144
- } else if (!ee(c)) {
1145
- i[u] = c, o -= 1;
1135
+ } else if (!ee(u)) {
1136
+ i[c] = u, o -= 1;
1146
1137
  continue;
1147
1138
  }
1148
- a(u, e.resolve(c), r);
1139
+ a(c, e.resolve(u), r);
1149
1140
  }
1150
1141
  return o === 0 && r.resolve(i), r;
1151
1142
  }, e.hash = function(t) {
1152
- var r = {}, o = [], i = function(u) {
1153
- if (t.hasOwnProperty(u)) {
1154
- var c = t[u];
1155
- ee(c) ? o.push(c.then(function(s) {
1156
- r[u] = s;
1157
- })) : r[u] = c;
1143
+ var r = {}, o = [], i = function(c) {
1144
+ if (t.hasOwnProperty(c)) {
1145
+ var u = t[c];
1146
+ ee(u) ? o.push(u.then(function(s) {
1147
+ r[c] = s;
1148
+ })) : r[c] = u;
1158
1149
  }
1159
1150
  };
1160
1151
  for (var a in t)
@@ -1259,8 +1250,8 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1259
1250
  } catch (v) {
1260
1251
  }
1261
1252
  this._cleanupClosedWindows();
1262
- var u = this.keys, c = this.values, s = ge(u, t);
1263
- s === -1 ? (u.push(t), c.push(r)) : c[s] = r;
1253
+ var c = this.keys, u = this.values, s = ge(c, t);
1254
+ s === -1 ? (c.push(t), u.push(r)) : u[s] = r;
1264
1255
  }, n.get = function(t) {
1265
1256
  if (!t)
1266
1257
  throw new Error("WeakMap expected key");
@@ -1289,14 +1280,14 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1289
1280
  if (r)
1290
1281
  try {
1291
1282
  r.delete(t);
1292
- } catch (u) {
1283
+ } catch (c) {
1293
1284
  delete this.weakmap;
1294
1285
  }
1295
1286
  if (this.isSafeToReadWrite(t))
1296
1287
  try {
1297
1288
  var o = t[this.name];
1298
1289
  o && o[0] === t && (o[0] = o[1] = void 0);
1299
- } catch (u) {
1290
+ } catch (c) {
1300
1291
  }
1301
1292
  this._cleanupClosedWindows();
1302
1293
  var i = this.keys, a = ge(i, t);
@@ -1368,15 +1359,15 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1368
1359
  function jt() {
1369
1360
  return {};
1370
1361
  }
1371
- var ce = 0, Ye = 0;
1372
- function ue(e, n) {
1362
+ var ue = 0, Ye = 0;
1363
+ function ce(e, n) {
1373
1364
  n === void 0 && (n = {});
1374
- var t = n.thisNamespace, r = t !== void 0 && t, o = n.time, i, a, u = ce;
1375
- ce += 1;
1376
- var c = function() {
1365
+ var t = n.thisNamespace, r = t !== void 0 && t, o = n.time, i, a, c = ue;
1366
+ ue += 1;
1367
+ var u = function() {
1377
1368
  for (var s = arguments.length, v = new Array(s), m = 0; m < s; m++)
1378
1369
  v[m] = arguments[m];
1379
- u < Ye && (i = null, a = null, u = ce, ce += 1);
1370
+ c < Ye && (i = null, a = null, c = ue, ue += 1);
1380
1371
  var p;
1381
1372
  p = r ? (a = a || new Ce()).getOrSet(this, jt) : i = i || {};
1382
1373
  var w;
@@ -1394,24 +1385,24 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1394
1385
  value: S
1395
1386
  }, S;
1396
1387
  };
1397
- return c.reset = function() {
1388
+ return u.reset = function() {
1398
1389
  i = null, a = null;
1399
- }, $e(c, (n.name || Be(e)) + "::memoized");
1390
+ }, $e(u, (n.name || Be(e)) + "::memoized");
1400
1391
  }
1401
- ue.clear = function() {
1402
- Ye = ce;
1392
+ ce.clear = function() {
1393
+ Ye = ue;
1403
1394
  };
1404
1395
  function kt(e) {
1405
1396
  var n = {};
1406
1397
  function t() {
1407
- for (var r = arguments, o = this, i = arguments.length, a = new Array(i), u = 0; u < i; u++)
1408
- a[u] = arguments[u];
1409
- var c = Ve(a);
1410
- return n.hasOwnProperty(c) || (n[c] = C.try(function() {
1398
+ for (var r = arguments, o = this, i = arguments.length, a = new Array(i), c = 0; c < i; c++)
1399
+ a[c] = arguments[c];
1400
+ var u = Ve(a);
1401
+ return n.hasOwnProperty(u) || (n[u] = C.try(function() {
1411
1402
  return e.apply(o, r);
1412
1403
  }).finally(function() {
1413
- delete n[c];
1414
- })), n[c];
1404
+ delete n[u];
1405
+ })), n[u];
1415
1406
  }
1416
1407
  return t.reset = function() {
1417
1408
  n = {};
@@ -1445,7 +1436,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1445
1436
  function Je(e) {
1446
1437
  return typeof e == "string" ? e : e && e.toString && typeof e.toString == "function" ? e.toString() : {}.toString.call(e);
1447
1438
  }
1448
- ue(function(e) {
1439
+ ce(function(e) {
1449
1440
  if (Object.values)
1450
1441
  return Object.values(e);
1451
1442
  var n = [];
@@ -1462,29 +1453,29 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1462
1453
  var r = t();
1463
1454
  return e[n] = r, r;
1464
1455
  }
1465
- function Xe() {
1456
+ function Ze() {
1466
1457
  var e = document.body;
1467
1458
  if (!e)
1468
1459
  throw new Error("Body element not found");
1469
1460
  return e;
1470
1461
  }
1471
- function Ze() {
1462
+ function Xe() {
1472
1463
  return !!document.body && document.readyState === "complete";
1473
1464
  }
1474
1465
  function Ke() {
1475
1466
  return !!document.body && document.readyState === "interactive";
1476
1467
  }
1477
- ue(function() {
1468
+ ce(function() {
1478
1469
  return new C(function(e) {
1479
- if (Ze() || Ke())
1470
+ if (Xe() || Ke())
1480
1471
  return e();
1481
1472
  var n = setInterval(function() {
1482
- if (Ze() || Ke())
1473
+ if (Xe() || Ke())
1483
1474
  return clearInterval(n), e();
1484
1475
  }, 10);
1485
1476
  });
1486
1477
  });
1487
- var Ee = typeof document != "undefined" ? document.currentScript : null, Ut = ue(function() {
1478
+ var Ee = typeof document != "undefined" ? document.currentScript : null, Ut = ce(function() {
1488
1479
  if (Ee || (Ee = function() {
1489
1480
  try {
1490
1481
  var e = function() {
@@ -1507,7 +1498,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1507
1498
  return Ee;
1508
1499
  throw new Error("Can not determine current script");
1509
1500
  }), Ft = Y();
1510
- ue(function() {
1501
+ ce(function() {
1511
1502
  var e;
1512
1503
  try {
1513
1504
  e = Ut();
@@ -1724,19 +1715,19 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1724
1715
  }
1725
1716
  }
1726
1717
  function it(e, n) {
1727
- var t = n.send, r = n.id, o = r === void 0 ? Y() : r, i = e.then(function(c) {
1728
- if (Q(c))
1729
- return ve(c).name;
1730
- }), a = e.then(function(c) {
1731
- if ($(c))
1718
+ var t = n.send, r = n.id, o = r === void 0 ? Y() : r, i = e.then(function(u) {
1719
+ if (Q(u))
1720
+ return ve(u).name;
1721
+ }), a = e.then(function(u) {
1722
+ if ($(u))
1732
1723
  throw new Error("Window is closed, can not determine type");
1733
- return oe(c) ? "popup" : "iframe";
1724
+ return oe(u) ? "popup" : "iframe";
1734
1725
  });
1735
1726
  i.catch(te), a.catch(te);
1736
- var u = function() {
1737
- return e.then(function(c) {
1738
- if (!$(c))
1739
- return Q(c) ? ve(c).name : i;
1727
+ var c = function() {
1728
+ return e.then(function(u) {
1729
+ if (!$(u))
1730
+ return Q(u) ? ve(u).name : i;
1740
1731
  });
1741
1732
  };
1742
1733
  return {
@@ -1745,8 +1736,8 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1745
1736
  return a;
1746
1737
  },
1747
1738
  getInstanceID: kt(function() {
1748
- return e.then(function(c) {
1749
- return nt(c, {
1739
+ return e.then(function(u) {
1740
+ return nt(u, {
1750
1741
  send: t
1751
1742
  });
1752
1743
  });
@@ -1754,26 +1745,26 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1754
1745
  close: function() {
1755
1746
  return e.then(Mt);
1756
1747
  },
1757
- getName: u,
1748
+ getName: c,
1758
1749
  focus: function() {
1759
- return e.then(function(c) {
1760
- c.focus();
1750
+ return e.then(function(u) {
1751
+ u.focus();
1761
1752
  });
1762
1753
  },
1763
1754
  isClosed: function() {
1764
- return e.then(function(c) {
1765
- return $(c);
1755
+ return e.then(function(u) {
1756
+ return $(u);
1766
1757
  });
1767
1758
  },
1768
- setLocation: function(c, s) {
1759
+ setLocation: function(u, s) {
1769
1760
  return s === void 0 && (s = {}), e.then(function(v) {
1770
1761
  var m = window.location.protocol + "//" + window.location.host, p = s.method, w = p === void 0 ? "get" : p, b = s.body;
1771
- if (c.indexOf("/") === 0)
1772
- c = "" + m + c;
1773
- else if (!c.match(/^https?:\/\//) && c.indexOf(m) !== 0)
1774
- throw new Error("Expected url to be http or https url, or absolute path, got " + JSON.stringify(c));
1762
+ if (u.indexOf("/") === 0)
1763
+ u = "" + m + u;
1764
+ else if (!u.match(/^https?:\/\//) && u.indexOf(m) !== 0)
1765
+ throw new Error("Expected url to be http or https url, or absolute path, got " + JSON.stringify(u));
1775
1766
  if (w === "post")
1776
- return u().then(function(x) {
1767
+ return c().then(function(x) {
1777
1768
  if (!x)
1778
1769
  throw new Error("Can not post to window without target name");
1779
1770
  (function(S) {
@@ -1783,9 +1774,9 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1783
1774
  var N, he = V[A], Le = document.createElement("input");
1784
1775
  Le.setAttribute("name", he), Le.setAttribute("value", (N = R[he]) == null ? void 0 : N.toString()), W.appendChild(Le);
1785
1776
  }
1786
- Xe().appendChild(W), W.submit(), Xe().removeChild(W);
1777
+ Ze().appendChild(W), W.submit(), Ze().removeChild(W);
1787
1778
  })({
1788
- url: c,
1779
+ url: u,
1789
1780
  target: x,
1790
1781
  method: w,
1791
1782
  body: b
@@ -1796,20 +1787,20 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1796
1787
  if (Q(v))
1797
1788
  try {
1798
1789
  if (v.location && typeof v.location.replace == "function") {
1799
- v.location.replace(c);
1790
+ v.location.replace(u);
1800
1791
  return;
1801
1792
  }
1802
1793
  } catch (x) {
1803
1794
  }
1804
- v.location = c;
1795
+ v.location = u;
1805
1796
  });
1806
1797
  },
1807
- setName: function(c) {
1798
+ setName: function(u) {
1808
1799
  return e.then(function(s) {
1809
1800
  var v = Q(s), m = _e(s);
1810
1801
  if (!v)
1811
- throw new Error("Can not set name for cross-domain window: " + c);
1812
- ve(s).name = c, m && m.setAttribute("name", c), i = C.resolve(c);
1802
+ throw new Error("Can not set name for cross-domain window: " + u);
1803
+ ve(s).name = u, m && m.setAttribute("name", u), i = C.resolve(u);
1813
1804
  });
1814
1805
  }
1815
1806
  };
@@ -1853,9 +1844,9 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1853
1844
  var t = this, r = this.isPopup(), o = this.getName(), i = C.hash({
1854
1845
  isPopup: r,
1855
1846
  name: o
1856
- }).then(function(u) {
1857
- var c = u.name;
1858
- u.isPopup && c && window.open("", c, "noopener");
1847
+ }).then(function(c) {
1848
+ var u = c.name;
1849
+ c.isPopup && u && window.open("", u, "noopener");
1859
1850
  }), a = this.serializedWindow.focus();
1860
1851
  return C.all([i, a]).then(function() {
1861
1852
  return t;
@@ -1881,10 +1872,10 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1881
1872
  send: i
1882
1873
  })
1883
1874
  }).then(function(a) {
1884
- var u = a.proxyInstanceID === a.knownWindowInstanceID;
1885
- return u && o.setWindow(t, {
1875
+ var c = a.proxyInstanceID === a.knownWindowInstanceID;
1876
+ return c && o.setWindow(t, {
1886
1877
  send: i
1887
- }), u;
1878
+ }), c;
1888
1879
  });
1889
1880
  });
1890
1881
  }, n.unwrap = function() {
@@ -1947,7 +1938,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1947
1938
  a = (i = {
1948
1939
  on: o.on,
1949
1940
  send: o.send
1950
- }).on, u = i.send, z("builtinListeners").getOrSet("functionCalls", function() {
1941
+ }).on, c = i.send, z("builtinListeners").getOrSet("functionCalls", function() {
1951
1942
  return a("postrobot_method", {
1952
1943
  domain: "*"
1953
1944
  }, function(v) {
@@ -1960,7 +1951,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1960
1951
  throw new Error("Method '" + w.name + "' domain " + JSON.stringify(Pe(S.domain) ? S.domain.source : S.domain) + " does not match origin " + p + " in " + U(window));
1961
1952
  if (q.isProxyWindow(P))
1962
1953
  return P.matchWindow(m, {
1963
- send: u
1954
+ send: c
1964
1955
  }).then(function(T) {
1965
1956
  if (!T)
1966
1957
  throw new Error("Method call '" + w.name + "' failed - proxy window does not match source in " + U(window));
@@ -1993,32 +1984,32 @@ var Ot = { exports: {} }, Nt = { exports: {} };
1993
1984
  });
1994
1985
  });
1995
1986
  });
1996
- var i, a, u, c = t.__id__ || Y();
1987
+ var i, a, c, u = t.__id__ || Y();
1997
1988
  e = q.unwrap(e);
1998
1989
  var s = t.__name__ || t.name || r;
1999
- return typeof s == "string" && typeof s.indexOf == "function" && s.indexOf("anonymous::") === 0 && (s = s.replace("anonymous::", r + "::")), q.isProxyWindow(e) ? (Oe(c, t, s, e, n), e.awaitWindow().then(function(v) {
2000
- Oe(c, t, s, v, n);
2001
- })) : Oe(c, t, s, e, n), ne("cross_domain_function", {
2002
- id: c,
1990
+ return typeof s == "string" && typeof s.indexOf == "function" && s.indexOf("anonymous::") === 0 && (s = s.replace("anonymous::", r + "::")), q.isProxyWindow(e) ? (Oe(u, t, s, e, n), e.awaitWindow().then(function(v) {
1991
+ Oe(u, t, s, v, n);
1992
+ })) : Oe(u, t, s, e, n), ne("cross_domain_function", {
1993
+ id: u,
2003
1994
  name: s
2004
1995
  });
2005
1996
  }
2006
- function ct(e, n, t, r) {
1997
+ function ut(e, n, t, r) {
2007
1998
  var o, i = r.on, a = r.send;
2008
- return function(u, c) {
2009
- c === void 0 && (c = qt);
2010
- var s = JSON.stringify(u, function(v) {
1999
+ return function(c, u) {
2000
+ u === void 0 && (u = qt);
2001
+ var s = JSON.stringify(c, function(v) {
2011
2002
  var m = this[v];
2012
2003
  if (Re(this))
2013
2004
  return m;
2014
2005
  var p = ot(m);
2015
2006
  if (!p)
2016
2007
  return m;
2017
- var w = c[p] || _t[p];
2008
+ var w = u[p] || _t[p];
2018
2009
  return w ? w(m, v) : m;
2019
2010
  });
2020
2011
  return s === void 0 ? "undefined" : s;
2021
- }(t, ((o = {}).promise = function(u, c) {
2012
+ }(t, ((o = {}).promise = function(c, u) {
2022
2013
  return function(s, v, m, p, w) {
2023
2014
  return ne("cross_domain_zalgo_promise", {
2024
2015
  then: st(s, v, function(b, x) {
@@ -2028,45 +2019,45 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2028
2019
  send: w.send
2029
2020
  })
2030
2021
  });
2031
- }(e, n, u, c, {
2022
+ }(e, n, c, u, {
2032
2023
  on: i,
2033
2024
  send: a
2034
2025
  });
2035
- }, o.function = function(u, c) {
2036
- return st(e, n, u, c, {
2026
+ }, o.function = function(c, u) {
2027
+ return st(e, n, c, u, {
2037
2028
  on: i,
2038
2029
  send: a
2039
2030
  });
2040
- }, o.object = function(u) {
2041
- return we(u) || q.isProxyWindow(u) ? ne("cross_domain_window", q.serialize(u, {
2031
+ }, o.object = function(c) {
2032
+ return we(c) || q.isProxyWindow(c) ? ne("cross_domain_window", q.serialize(c, {
2042
2033
  send: a
2043
- })) : u;
2034
+ })) : c;
2044
2035
  }, o));
2045
2036
  }
2046
- function ut(e, n, t, r) {
2037
+ function ct(e, n, t, r) {
2047
2038
  var o, i = r.send;
2048
- return function(a, u) {
2049
- if (u === void 0 && (u = Bt), a !== "undefined")
2050
- return JSON.parse(a, function(c, s) {
2039
+ return function(a, c) {
2040
+ if (c === void 0 && (c = Bt), a !== "undefined")
2041
+ return JSON.parse(a, function(u, s) {
2051
2042
  if (Re(this))
2052
2043
  return s;
2053
2044
  var v, m;
2054
2045
  if (Re(s) ? (v = s.__type__, m = s.__val__) : (v = ot(s), m = s), !v)
2055
2046
  return m;
2056
- var p = u[v] || Gt[v];
2057
- return p ? p(m, c) : m;
2047
+ var p = c[v] || Gt[v];
2048
+ return p ? p(m, u) : m;
2058
2049
  });
2059
2050
  }(t, ((o = {}).cross_domain_zalgo_promise = function(a) {
2060
- return function(u, c, s) {
2051
+ return function(c, u, s) {
2061
2052
  return new C(s.then);
2062
2053
  }(0, 0, a);
2063
2054
  }, o.cross_domain_function = function(a) {
2064
- return function(u, c, s, v) {
2055
+ return function(c, u, s, v) {
2065
2056
  var m = s.id, p = s.name, w = v.send, b = function(S) {
2066
2057
  S === void 0 && (S = {});
2067
2058
  function P() {
2068
2059
  var L = arguments;
2069
- return q.toProxyWindow(u, {
2060
+ return q.toProxyWindow(c, {
2070
2061
  send: w
2071
2062
  }).awaitWindow().then(function(R) {
2072
2063
  var T = at(R, m);
@@ -2081,14 +2072,14 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2081
2072
  name: p,
2082
2073
  args: M
2083
2074
  }, {
2084
- domain: c,
2075
+ domain: u,
2085
2076
  fireAndForget: !0
2086
2077
  }) : w(R, "postrobot_method", {
2087
2078
  id: m,
2088
2079
  name: p,
2089
2080
  args: M
2090
2081
  }, {
2091
- domain: c,
2082
+ domain: u,
2092
2083
  fireAndForget: !1
2093
2084
  }).then(function(W) {
2094
2085
  return W.data.result;
@@ -2097,7 +2088,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2097
2088
  throw R;
2098
2089
  });
2099
2090
  }
2100
- return P.__name__ = p, P.__origin__ = c, P.__source__ = u, P.__id__ = m, P.origin = c, P;
2091
+ return P.__name__ = p, P.__origin__ = u, P.__source__ = c, P.__id__ = m, P.origin = u, P;
2101
2092
  }, x = b();
2102
2093
  return x.fireAndForget = b({
2103
2094
  fireAndForget: !0
@@ -2124,15 +2115,15 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2124
2115
  return a.buffer = a.buffer || [], a.buffer.push(t), a.flush = a.flush || C.flush().then(function() {
2125
2116
  if ($(e))
2126
2117
  throw new Error("Window is closed");
2127
- var u = ct(e, n, ((c = {}).__post_robot_10_0_46__ = a.buffer || [], c), {
2118
+ var c = ut(e, n, ((u = {}).__post_robot_10_0_46__ = a.buffer || [], u), {
2128
2119
  on: o,
2129
2120
  send: i
2130
- }), c;
2121
+ }), u;
2131
2122
  delete a.buffer;
2132
2123
  for (var s = Object.keys(Ne), v = [], m = 0; m < s.length; m++) {
2133
2124
  var p = s[m];
2134
2125
  try {
2135
- Ne[p](e, u, n);
2126
+ Ne[p](e, c, n);
2136
2127
  } catch (w) {
2137
2128
  v.push(w);
2138
2129
  }
@@ -2164,11 +2155,11 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2164
2155
  if (t === "*" && (t = null), r === "*" && (r = null), !n)
2165
2156
  throw new Error("Name required to get request listener");
2166
2157
  for (var i = 0, a = [t, xe()]; i < a.length; i++) {
2167
- var u = a[i];
2168
- if (u) {
2169
- var c = o.get(u);
2170
- if (c) {
2171
- var s = c[n];
2158
+ var c = a[i];
2159
+ if (c) {
2160
+ var u = o.get(c);
2161
+ if (u) {
2162
+ var s = u[n];
2172
2163
  if (s) {
2173
2164
  if (r && typeof r == "string") {
2174
2165
  if (s[r])
@@ -2192,8 +2183,8 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2192
2183
  name: t.name,
2193
2184
  win: e,
2194
2185
  domain: n
2195
- }), u = t.name === "postrobot_method" && t.data && typeof t.data.name == "string" ? t.data.name + "()" : t.name;
2196
- function c(s, v, m) {
2186
+ }), c = t.name === "postrobot_method" && t.data && typeof t.data.name == "string" ? t.data.name + "()" : t.name;
2187
+ function u(s, v, m) {
2197
2188
  return C.flush().then(function() {
2198
2189
  if (!t.fireAndForget && !$(e))
2199
2190
  try {
@@ -2211,7 +2202,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2211
2202
  send: i
2212
2203
  });
2213
2204
  } catch (p) {
2214
- throw new Error("Send response message failed for " + u + " in " + U() + `
2205
+ throw new Error("Send response message failed for " + c + " in " + U() + `
2215
2206
 
2216
2207
  ` + de(p));
2217
2208
  }
@@ -2231,7 +2222,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2231
2222
  send: i
2232
2223
  });
2233
2224
  } catch (s) {
2234
- throw new Error("Send ack message failed for " + u + " in " + U() + `
2225
+ throw new Error("Send ack message failed for " + c + " in " + U() + `
2235
2226
 
2236
2227
  ` + de(s));
2237
2228
  }
@@ -2244,9 +2235,9 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2244
2235
  data: t.data
2245
2236
  });
2246
2237
  }).then(function(s) {
2247
- return c("success", s);
2238
+ return u("success", s);
2248
2239
  }, function(s) {
2249
- return c("error", null, s);
2240
+ return u("error", null, s);
2250
2241
  })]).then(te).catch(function(s) {
2251
2242
  if (a && a.handleError)
2252
2243
  return a.handleError(s);
@@ -2294,10 +2285,10 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2294
2285
  } catch (v) {
2295
2286
  return;
2296
2287
  }
2297
- var i = e.source, a = e.origin, u = function(v, m, p, w) {
2288
+ var i = e.source, a = e.origin, c = function(v, m, p, w) {
2298
2289
  var b = w.on, x = w.send, S;
2299
2290
  try {
2300
- S = ut(m, p, v, {
2291
+ S = ct(m, p, v, {
2301
2292
  on: b,
2302
2293
  send: x
2303
2294
  });
@@ -2313,10 +2304,10 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2313
2304
  on: t,
2314
2305
  send: r
2315
2306
  });
2316
- if (u) {
2307
+ if (c) {
2317
2308
  rt(i);
2318
- for (var c = 0; c < u.length; c++) {
2319
- var s = u[c];
2309
+ for (var u = 0; u < c.length; u++) {
2310
+ var s = c[u];
2320
2311
  if (o.has(s.id) || (o.set(s.id, !0), $(i) && !s.fireAndForget))
2321
2312
  return;
2322
2313
  s.origin.indexOf("file:") === 0 && (a = "file://");
@@ -2333,19 +2324,19 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2333
2324
  }
2334
2325
  }
2335
2326
  }
2336
- function Z(e, n, t) {
2327
+ function X(e, n, t) {
2337
2328
  if (!e)
2338
2329
  throw new Error("Expected name");
2339
2330
  if (typeof (n = n || {}) == "function" && (t = n, n = {}), !t)
2340
2331
  throw new Error("Expected handler");
2341
2332
  var r = function o(i, a) {
2342
- var u = i.name, c = i.win, s = i.domain, v = F("requestListeners");
2343
- if (!u || typeof u != "string")
2333
+ var c = i.name, u = i.win, s = i.domain, v = F("requestListeners");
2334
+ if (!c || typeof c != "string")
2344
2335
  throw new Error("Name required to add request listener");
2345
- if (c && c !== "*" && q.isProxyWindow(c)) {
2346
- var m = c.awaitWindow().then(function(N) {
2336
+ if (u && u !== "*" && q.isProxyWindow(u)) {
2337
+ var m = u.awaitWindow().then(function(N) {
2347
2338
  return o({
2348
- name: u,
2339
+ name: c,
2349
2340
  win: N,
2350
2341
  domain: s
2351
2342
  }, a);
@@ -2358,11 +2349,11 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2358
2349
  }
2359
2350
  };
2360
2351
  }
2361
- var p = c;
2352
+ var p = u;
2362
2353
  if (Array.isArray(p)) {
2363
2354
  for (var w = [], b = 0, x = p; b < x.length; b++)
2364
2355
  w.push(o({
2365
- name: u,
2356
+ name: c,
2366
2357
  domain: s,
2367
2358
  win: x[b]
2368
2359
  }, a));
@@ -2376,7 +2367,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2376
2367
  if (Array.isArray(s)) {
2377
2368
  for (var S = [], P = 0, L = s; P < L.length; P++)
2378
2369
  S.push(o({
2379
- name: u,
2370
+ name: c,
2380
2371
  win: p,
2381
2372
  domain: L[P]
2382
2373
  }, a));
@@ -2388,17 +2379,17 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2388
2379
  };
2389
2380
  }
2390
2381
  var R = ht({
2391
- name: u,
2382
+ name: c,
2392
2383
  win: p,
2393
2384
  domain: s
2394
2385
  });
2395
2386
  p && p !== "*" || (p = xe());
2396
2387
  var T = (s = s || "*").toString();
2397
2388
  if (R)
2398
- throw p && s ? new Error("Request listener already exists for " + u + " on domain " + s.toString() + " for " + (p === xe() ? "wildcard" : "specified") + " window") : p ? new Error("Request listener already exists for " + u + " for " + (p === xe() ? "wildcard" : "specified") + " window") : s ? new Error("Request listener already exists for " + u + " on domain " + s.toString()) : new Error("Request listener already exists for " + u);
2389
+ throw p && s ? new Error("Request listener already exists for " + c + " on domain " + s.toString() + " for " + (p === xe() ? "wildcard" : "specified") + " window") : p ? new Error("Request listener already exists for " + c + " for " + (p === xe() ? "wildcard" : "specified") + " window") : s ? new Error("Request listener already exists for " + c + " on domain " + s.toString()) : new Error("Request listener already exists for " + c);
2399
2390
  var M = v.getOrSet(p, function() {
2400
2391
  return {};
2401
- }), W = fe(M, u, function() {
2392
+ }), W = fe(M, c, function() {
2402
2393
  return {};
2403
2394
  }), A, V;
2404
2395
  return Pe(s) ? (A = fe(W, "__domain_regex__", function() {
@@ -2408,7 +2399,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2408
2399
  listener: a
2409
2400
  }) : W[T] = a, {
2410
2401
  cancel: function() {
2411
- delete W[T], V && (A.splice(A.indexOf(V, 1)), A.length || delete W.__domain_regex__), Object.keys(W).length || delete M[u], p && !Object.keys(M).length && v.del(p);
2402
+ delete W[T], V && (A.splice(A.indexOf(V, 1)), A.length || delete W.__domain_regex__), Object.keys(W).length || delete M[c], p && !Object.keys(M).length && v.del(p);
2412
2403
  }
2413
2404
  };
2414
2405
  }({
@@ -2432,13 +2423,13 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2432
2423
  var r = new C(), o;
2433
2424
  return n.errorHandler = function(i) {
2434
2425
  o.cancel(), r.reject(i);
2435
- }, o = Z(e, n, function(i) {
2426
+ }, o = X(e, n, function(i) {
2436
2427
  if (o.cancel(), r.resolve(i), t)
2437
2428
  return t(i);
2438
2429
  }), r.cancel = o.cancel, r;
2439
2430
  }
2440
2431
  var K = function e(n, t, r, o) {
2441
- var i = (o = o || {}).domain || "*", a = o.timeout || -1, u = o.timeout || 5e3, c = o.fireAndForget || !1;
2432
+ var i = (o = o || {}).domain || "*", a = o.timeout || -1, c = o.timeout || 5e3, u = o.fireAndForget || !1;
2442
2433
  return q.toProxyWindow(n, {
2443
2434
  send: e
2444
2435
  }).awaitWindow().then(function(s) {
@@ -2506,7 +2497,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2506
2497
  });
2507
2498
  }(v);
2508
2499
  return m !== -1 && (w = w.timeout(m, new Error(p + " did not load after " + m + "ms"))), w;
2509
- }(s, u);
2500
+ }(s, c);
2510
2501
  }).then(function(v) {
2511
2502
  return function(m, p, w, b) {
2512
2503
  var x = b.send;
@@ -2528,7 +2519,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2528
2519
  });
2529
2520
  }).then(function(v) {
2530
2521
  var m = v, p = t === "postrobot_method" && r && typeof r.name == "string" ? r.name + "()" : t, w = new C(), b = t + "_" + Y();
2531
- if (!c) {
2522
+ if (!u) {
2532
2523
  var x = {
2533
2524
  name: t,
2534
2525
  win: s,
@@ -2577,12 +2568,12 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2577
2568
  hash: b,
2578
2569
  name: t,
2579
2570
  data: r,
2580
- fireAndForget: c
2571
+ fireAndForget: u
2581
2572
  }, {
2582
- on: Z,
2573
+ on: X,
2583
2574
  send: e
2584
2575
  }).then(function() {
2585
- return c ? w.resolve() : w;
2576
+ return u ? w.resolve() : w;
2586
2577
  }, function(W) {
2587
2578
  throw new Error("Send request message failed for " + p + " in " + U() + `
2588
2579
 
@@ -2591,15 +2582,15 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2591
2582
  });
2592
2583
  });
2593
2584
  };
2594
- function Xt(e, n, t) {
2595
- return ct(e, n, t, {
2596
- on: Z,
2585
+ function Zt(e, n, t) {
2586
+ return ut(e, n, t, {
2587
+ on: X,
2597
2588
  send: K
2598
2589
  });
2599
2590
  }
2600
- function Zt(e, n, t) {
2601
- return ut(e, n, t, {
2602
- on: Z,
2591
+ function Xt(e, n, t) {
2592
+ return ct(e, n, t, {
2593
+ on: X,
2603
2594
  send: K
2604
2595
  });
2605
2596
  }
@@ -2616,7 +2607,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2616
2607
  }
2617
2608
  function pt() {
2618
2609
  le().initialized || (le().initialized = !0, n = (e = {
2619
- on: Z,
2610
+ on: X,
2620
2611
  send: K
2621
2612
  }).on, t = e.send, (r = le()).receiveMessage = r.receiveMessage || function(o) {
2622
2613
  return mt(o, {
@@ -2626,17 +2617,17 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2626
2617
  }, function(o) {
2627
2618
  var i = o.on, a = o.send;
2628
2619
  z().getOrSet("postMessageListener", function() {
2629
- return function(u, c, s) {
2630
- return u.addEventListener("message", s), {
2620
+ return function(c, u, s) {
2621
+ return c.addEventListener("message", s), {
2631
2622
  cancel: function() {
2632
- u.removeEventListener("message", s);
2623
+ c.removeEventListener("message", s);
2633
2624
  }
2634
2625
  };
2635
- }(window, 0, function(u) {
2636
- (function(c, s) {
2626
+ }(window, 0, function(c) {
2627
+ (function(u, s) {
2637
2628
  var v = s.on, m = s.send;
2638
2629
  C.try(function() {
2639
- var p = c.source || c.sourceElement, w = c.origin || c.originalEvent && c.originalEvent.origin, b = c.data;
2630
+ var p = u.source || u.sourceElement, w = u.origin || u.originalEvent && u.originalEvent.origin, b = u.data;
2640
2631
  if (w === "null" && (w = "file://"), p) {
2641
2632
  if (!w)
2642
2633
  throw new Error("Post message did not have origin domain");
@@ -2650,19 +2641,19 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2650
2641
  });
2651
2642
  }
2652
2643
  });
2653
- })(u, {
2644
+ })(c, {
2654
2645
  on: i,
2655
2646
  send: a
2656
2647
  });
2657
2648
  });
2658
2649
  });
2659
2650
  }({
2660
- on: Z,
2651
+ on: X,
2661
2652
  send: K
2662
2653
  }), function(o) {
2663
2654
  var i = o.on, a = o.send;
2664
2655
  z("builtinListeners").getOrSet("helloListener", function() {
2665
- var u = i("postrobot_hello", {
2656
+ var c = i("postrobot_hello", {
2666
2657
  domain: "*"
2667
2658
  }, function(s) {
2668
2659
  return tt(s.source, {
@@ -2670,14 +2661,14 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2670
2661
  }), {
2671
2662
  instanceID: et()
2672
2663
  };
2673
- }), c = He();
2674
- return c && Te(c, {
2664
+ }), u = He();
2665
+ return u && Te(u, {
2675
2666
  send: a
2676
2667
  }).catch(function(s) {
2677
- }), u;
2668
+ }), c;
2678
2669
  });
2679
2670
  }({
2680
- on: Z,
2671
+ on: X,
2681
2672
  send: K
2682
2673
  }));
2683
2674
  var e, n, t, r;
@@ -2701,14 +2692,14 @@ var Ot = { exports: {} }, Nt = { exports: {} };
2701
2692
  }]);
2702
2693
  });
2703
2694
  })(Nt);
2704
- var Xn = Nt.exports;
2695
+ var Zn = Nt.exports;
2705
2696
  (function(d) {
2706
- d.exports = Xn, d.exports.default = d.exports;
2697
+ d.exports = Zn, d.exports.default = d.exports;
2707
2698
  })(Ot);
2708
2699
  var Dt = Ot.exports;
2709
- const Zn = /* @__PURE__ */ Jn(Dt), ke = /* @__PURE__ */ fn({
2700
+ const Xn = /* @__PURE__ */ Jn(Dt), ke = /* @__PURE__ */ fn({
2710
2701
  __proto__: null,
2711
- default: Zn
2702
+ default: Xn
2712
2703
  }, [Dt]);
2713
2704
  export {
2714
2705
  Rt as ConsentBox,
@@ -1,4 +1,4 @@
1
- (function(I,P){typeof exports=="object"&&typeof module!="undefined"?P(exports):typeof define=="function"&&define.amd?define(["exports"],P):(I=typeof globalThis!="undefined"?globalThis:I||self,P(I["soyio-widget"]={}))})(this,function(I){"use strict";var Yn=Object.defineProperty;var jt=Object.getOwnPropertySymbols,Jn=Object.getPrototypeOf,Xn=Object.prototype.hasOwnProperty,Zn=Object.prototype.propertyIsEnumerable,Kn=Reflect.get;var Qn=(I,P,O)=>P in I?Yn(I,P,{enumerable:!0,configurable:!0,writable:!0,value:O}):I[P]=O;var kt=(I,P)=>{var O={};for(var F in I)Xn.call(I,F)&&P.indexOf(F)<0&&(O[F]=I[F]);if(I!=null&&jt)for(var F of jt(I))P.indexOf(F)<0&&Zn.call(I,F)&&(O[F]=I[F]);return O};var L=(I,P,O)=>(Qn(I,typeof P!="symbol"?P+"":P,O),O),er=(I,P,O)=>{if(!P.has(I))throw TypeError("Cannot "+O)};var Ut=(I,P,O)=>{if(P.has(I))throw TypeError("Cannot add the same private member more than once");P instanceof WeakSet?P.add(I):P.set(I,O)};var Ft=(I,P,O)=>(er(I,P,"access private method"),O),Ht=(I,P,O)=>Kn(Jn(I),O,P);var $=(I,P,O)=>new Promise((F,ce)=>{var Ne=Q=>{try{de(O.next(Q))}catch(fe){ce(fe)}},De=Q=>{try{de(O.throw(Q))}catch(fe){ce(fe)}},de=Q=>Q.done?F(Q.value):Promise.resolve(Q.value).then(Ne,De);de((O=O.apply(I,P)).next())});var Ie,_t;function P(h,p){for(var w=0;w<p.length;w++){const l=p[w];if(typeof l!="string"&&!Array.isArray(l)){for(const g in l)if(g!=="default"&&!(g in h)){const y=Object.getOwnPropertyDescriptor(l,g);y&&Object.defineProperty(h,g,y.get?y:{enumerable:!0,get:()=>l[g]})}}}return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}class O{constructor(){L(this,"tooltipElement",null);L(this,"tooltipContent",null);L(this,"tooltipClass","soyio-tooltip");L(this,"hideTimeout",null);this.createTooltipElement(),this.setupGlobalListeners()}createTooltipElement(){const p=document.querySelector(`.${this.tooltipClass}`);p==null||p.remove(),this.tooltipElement=document.createElement("div"),this.tooltipElement.className=this.tooltipClass,this.tooltipElement.style.cssText=`
1
+ (function(I,P){typeof exports=="object"&&typeof module!="undefined"?P(exports):typeof define=="function"&&define.amd?define(["exports"],P):(I=typeof globalThis!="undefined"?globalThis:I||self,P(I["soyio-widget"]={}))})(this,function(I){"use strict";var Yn=Object.defineProperty;var jt=Object.getOwnPropertySymbols,Jn=Object.getPrototypeOf,Zn=Object.prototype.hasOwnProperty,Xn=Object.prototype.propertyIsEnumerable,Kn=Reflect.get;var Qn=(I,P,O)=>P in I?Yn(I,P,{enumerable:!0,configurable:!0,writable:!0,value:O}):I[P]=O;var kt=(I,P)=>{var O={};for(var F in I)Zn.call(I,F)&&P.indexOf(F)<0&&(O[F]=I[F]);if(I!=null&&jt)for(var F of jt(I))P.indexOf(F)<0&&Xn.call(I,F)&&(O[F]=I[F]);return O};var L=(I,P,O)=>(Qn(I,typeof P!="symbol"?P+"":P,O),O),er=(I,P,O)=>{if(!P.has(I))throw TypeError("Cannot "+O)};var Ut=(I,P,O)=>{if(P.has(I))throw TypeError("Cannot add the same private member more than once");P instanceof WeakSet?P.add(I):P.set(I,O)};var Ft=(I,P,O)=>(er(I,P,"access private method"),O),Ht=(I,P,O)=>Kn(Jn(I),O,P);var $=(I,P,O)=>new Promise((F,ce)=>{var Ne=Q=>{try{de(O.next(Q))}catch(fe){ce(fe)}},De=Q=>{try{de(O.throw(Q))}catch(fe){ce(fe)}},de=Q=>Q.done?F(Q.value):Promise.resolve(Q.value).then(Ne,De);de((O=O.apply(I,P)).next())});var Ie,_t;function P(h,p){for(var g=0;g<p.length;g++){const l=p[g];if(typeof l!="string"&&!Array.isArray(l)){for(const w in l)if(w!=="default"&&!(w in h)){const y=Object.getOwnPropertyDescriptor(l,w);y&&Object.defineProperty(h,w,y.get?y:{enumerable:!0,get:()=>l[w]})}}}return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}class O{constructor(){L(this,"tooltipElement",null);L(this,"tooltipContent",null);L(this,"tooltipClass","soyio-tooltip");L(this,"hideTimeout",null);this.createTooltipElement(),this.setupGlobalListeners()}createTooltipElement(){const p=document.querySelector(`.${this.tooltipClass}`);this.tooltipElement=p||document.createElement("div"),this.tooltipElement.className=this.tooltipClass,this.tooltipElement.style.cssText=`
2
2
  position: fixed;
3
3
  z-index: 99999;
4
4
  background: white;
@@ -14,16 +14,7 @@
14
14
  transition: opacity 0.2s ease-in-out;
15
15
  transform: translateX(-50%) translateY(-100%);
16
16
  margin-top: -8px;
17
- `,this.tooltipContent=document.createElement("div"),this.tooltipContent.style.cssText="text-align: center;",this.tooltipElement.appendChild(this.tooltipContent);const w=document.createElement("div");w.style.cssText=`
18
- position: absolute;
19
- bottom: -4px;
20
- left: 50%;
21
- transform: translateX(-50%) rotate(45deg);
22
- width: 8px;
23
- height: 8px;
24
- background: white;
25
- box-shadow: 2px 2px 2px rgba(0,0,0,0.1);
26
- `,this.tooltipElement.appendChild(w),document.body.appendChild(this.tooltipElement)}setupGlobalListeners(){window.addEventListener("scroll",()=>this.hide(),!0),window.addEventListener("resize",()=>this.hide()),window.addEventListener("orientationchange",()=>this.hide())}show(p,w,l){!this.tooltipElement||!this.tooltipContent||(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.tooltipContent.textContent=p,this.tooltipElement.style.left=`${w}px`,this.tooltipElement.style.top=`${l}px`,this.tooltipElement.style.opacity="1")}hide(){this.tooltipElement&&(this.tooltipElement.style.opacity="0")}destroy(){var p;(p=this.tooltipElement)==null||p.remove(),this.tooltipElement=null,this.tooltipContent=null,this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)}}const F="https://app.soyio.id",ce="https://sandbox.soyio.id",Ne="https://privacy.soyio.id",De="https://privacy-sandbox.soyio.id",de=["DISCLOSURE_REQUEST_SUCCESSFUL","IDENTITY_REGISTERED","IDENTITY_SIGNATURE","UNEXPECTED_ERROR","DENIED_CAMERA_PERMISSION","REJECTED_SIGNATURE"],Q="WIDGET_CLOSED",fe=420,qt=720,Bt=500,Gt={minWidth:"375px",maxWidth:"50rem"},$t={minWidth:"375px",maxWidth:"36rem"},Vt={minWidth:"375px",maxWidth:"50rem"};function Yt(h,p,w){return $(this,null,function*(){if(!h.contentWindow)throw new Error("Invalid iframe: contentWindow is null");const l=yield Promise.resolve().then(()=>ke);try{yield l.send(h.contentWindow,"SET_APPEARANCE",{appearance:p,identifier:w})}catch(g){console.error("Failed to send appearance config:",g)}})}const Jt="IFRAME_READY",Xt="IFRAME_HEIGHT_CHANGE",Zt="TOOLTIP_STATE_CHANGE",Kt="INFO_EVENT",Qt="CONSENT_STATE_CHANGE",U={onHeightChange:{},onIframeReady:{},onTooltipChange:{},onInfo:{},onStateChange:{}};let Xe,Ze,Ke,Qe,et;function en(){return $(this,null,function*(){const h=yield Promise.resolve().then(()=>ke);Xe||Ze||Ke||Qe||et||(Xe=h.on(Xt,p=>$(this,null,function*(){const w=p.data,l=U.onHeightChange[w.identifier];l&&l(w.height)})),Ze=h.on(Jt,p=>$(this,null,function*(){const w=p.data,l=U.onIframeReady[w.identifier];l&&l()})),Ke=h.on(Zt,p=>$(this,null,function*(){const w=p.data,l=U.onTooltipChange[w.identifier];l&&l(w)})),Qe=h.on(Qt,p=>$(this,null,function*(){const w=p.data,l=U.onStateChange[w.identifier];l&&l(w)})),et=h.on(Kt,w=>$(this,[w],function*({data:p}){const E=p,{identifier:l}=E,g=kt(E,["identifier"]),y=U.onInfo[l];y&&y(g)})))})}function tt(h,p){const{onHeightChange:w,onIframeReady:l,onTooltipChange:g,onStateChange:y,onInfo:E}=p;w&&(U.onHeightChange[h]=w),l&&(U.onIframeReady[h]=l),g&&(U.onTooltipChange[h]=g),y&&(U.onStateChange[h]=y),E&&(U.onInfo[h]=E)}function tn(h){delete U.onHeightChange[h],delete U.onIframeReady[h],delete U.onTooltipChange[h],delete U.onStateChange[h],delete U.onInfo[h]}function nn(h){const p=document.getElementById(h);p&&(console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."),p.remove())}function rn(h){const p=document.querySelector(h);if(!p)throw new Error(`Iframe div container with id '${h}' not found`);if(p.tagName.toLowerCase()!=="div")throw new Error(`Iframe container with id '${h}' must be a <div> element`);const w=p;return w.style.position="relative",w.style.cssText+=`
17
+ `;const g=this.tooltipElement.children[0];this.tooltipContent=g||document.createElement("div"),this.tooltipContent.style.cssText="text-align: left;",this.tooltipElement.appendChild(this.tooltipContent),document.body.appendChild(this.tooltipElement)}setupGlobalListeners(){window.addEventListener("scroll",()=>this.hide(),!0),window.addEventListener("resize",()=>this.hide()),window.addEventListener("orientationchange",()=>this.hide())}show(p,g,l){!this.tooltipElement||!this.tooltipContent||(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.tooltipContent.textContent=p,this.tooltipElement.style.left=`${g}px`,this.tooltipElement.style.top=`${l}px`,this.tooltipElement.style.opacity="1")}hide(){this.tooltipElement&&(this.tooltipElement.style.opacity="0")}destroy(){var p;(p=this.tooltipElement)==null||p.remove(),this.tooltipElement=null,this.tooltipContent=null,this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)}}const F="https://app.soyio.id",ce="https://sandbox.soyio.id",Ne="https://privacy.soyio.id",De="https://privacy-sandbox.soyio.id",de=["DISCLOSURE_REQUEST_SUCCESSFUL","IDENTITY_REGISTERED","IDENTITY_SIGNATURE","UNEXPECTED_ERROR","DENIED_CAMERA_PERMISSION","REJECTED_SIGNATURE"],Q="WIDGET_CLOSED",fe=420,qt=720,Bt=500,Gt={minWidth:"375px",maxWidth:"50rem"},$t={minWidth:"375px",maxWidth:"36rem"},Vt={minWidth:"375px",maxWidth:"50rem"};function Yt(h,p,g){return $(this,null,function*(){if(!h.contentWindow)throw new Error("Invalid iframe: contentWindow is null");const l=yield Promise.resolve().then(()=>ke);try{yield l.send(h.contentWindow,"SET_APPEARANCE",{appearance:p,identifier:g})}catch(w){console.error("Failed to send appearance config:",w)}})}const Jt="IFRAME_READY",Zt="IFRAME_HEIGHT_CHANGE",Xt="TOOLTIP_STATE_CHANGE",Kt="INFO_EVENT",Qt="CONSENT_STATE_CHANGE",U={onHeightChange:{},onIframeReady:{},onTooltipChange:{},onInfo:{},onStateChange:{}};let Ze,Xe,Ke,Qe,et;function en(){return $(this,null,function*(){const h=yield Promise.resolve().then(()=>ke);Ze||Xe||Ke||Qe||et||(Ze=h.on(Zt,p=>$(this,null,function*(){const g=p.data,l=U.onHeightChange[g.identifier];l&&l(g.height)})),Xe=h.on(Jt,p=>$(this,null,function*(){const g=p.data,l=U.onIframeReady[g.identifier];l&&l()})),Ke=h.on(Xt,p=>$(this,null,function*(){const g=p.data,l=U.onTooltipChange[g.identifier];l&&l(g)})),Qe=h.on(Qt,p=>$(this,null,function*(){const g=p.data,l=U.onStateChange[g.identifier];l&&l(g)})),et=h.on(Kt,g=>$(this,[g],function*({data:p}){const E=p,{identifier:l}=E,w=kt(E,["identifier"]),y=U.onInfo[l];y&&y(w)})))})}function tt(h,p){const{onHeightChange:g,onIframeReady:l,onTooltipChange:w,onStateChange:y,onInfo:E}=p;g&&(U.onHeightChange[h]=g),l&&(U.onIframeReady[h]=l),w&&(U.onTooltipChange[h]=w),y&&(U.onStateChange[h]=y),E&&(U.onInfo[h]=E)}function tn(h){delete U.onHeightChange[h],delete U.onIframeReady[h],delete U.onTooltipChange[h],delete U.onStateChange[h],delete U.onInfo[h]}function nn(h){const p=document.getElementById(h);p&&(console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."),p.remove())}function rn(h){const p=document.querySelector(h);if(!p)throw new Error(`Iframe div container with id '${h}' not found`);if(p.tagName.toLowerCase()!=="div")throw new Error(`Iframe container with id '${h}' must be a <div> element`);const g=p;return g.style.position="relative",g.style.cssText+=`
27
18
  padding: 0 !important;
28
19
  margin: 0 !important;
29
20
  display: flex !important;
@@ -32,16 +23,16 @@
32
23
  border: none !important;
33
24
  transition: height 0.35s !important;
34
25
  opacity: 1 !important;
35
- `,w}function on(h,p,w){const l=document.createElement("iframe");return l.id=p,l.src=h,l.style.cssText+=`
26
+ `,g}function on(h,p,g){const l=document.createElement("iframe");return l.id=p,l.src=h,l.style.cssText+=`
36
27
  width: 100% !important;
37
- min-width: ${w.minWidth} !important;
38
- max-width: ${w.maxWidth} !important;
28
+ min-width: ${g.minWidth} !important;
29
+ max-width: ${g.maxWidth} !important;
39
30
  border: none !important;
40
31
  overflow: hidden !important;
41
32
  opacity: 1;
42
33
  transition: height 0.35s,
43
34
  opacity 0.4s 0.1s;
44
- `,l}function an(){return Math.random().toString(36).substring(2,10)}class be{constructor(p){L(this,"iframe",null);L(this,"skeleton",null);L(this,"options");L(this,"appearance");L(this,"tooltipManager");L(this,"defaultIframeCSSConfig",Gt);L(this,"Skeleton",null);L(this,"defaultUniqueId");this.options=p,this.appearance=p.appearance||null,this.tooltipManager=new O,this.defaultUniqueId=be.generateUniqueId()}static generateUniqueId(){return an()}get uniqueIdentifier(){return this.defaultUniqueId}get iframeIdentifier(){return`${this.defaultIframePrefix}-${this.uniqueIdentifier}`}handleHeightChange(p){if(!this.iframe||(this.iframe.style.height=`${p}px`,p>0))return;const{parentElement:w}=this.iframe;w&&(w.style.display="none")}handleIframeReady(){this.iframe&&(this.options.onReady&&this.options.onReady(),Yt(this.iframe,this.appearance,this.uniqueIdentifier),this.skeleton&&this.skeleton.hide())}handleTooltipChange(p){if(!this.iframe)return;const w=this.iframe.getBoundingClientRect(),{text:l,coordinates:g,isVisible:y}=p,E=g.x+w.left,C=g.y+w.top;y?this.tooltipManager.show(l,E,C):this.tooltipManager.hide()}setupListeners(){return $(this,null,function*(){yield en();const p={onHeightChange:this.handleHeightChange.bind(this),onIframeReady:this.handleIframeReady.bind(this),onTooltipChange:this.handleTooltipChange.bind(this),onInfo:this.options.onEvent.bind(this)};tt(this.uniqueIdentifier,p)})}mount(p){return $(this,null,function*(){yield this.setupListeners(),nn(this.iframeIdentifier);const w=rn(p),l=this.iframeUrl();return this.iframe=on(l,this.iframeIdentifier,this.defaultIframeCSSConfig),this.Skeleton&&(this.skeleton=new this.Skeleton(this.uniqueIdentifier),this.skeleton.mount(w)),w.appendChild(this.iframe),this})}unmount(){tn(this.uniqueIdentifier),this.skeleton&&(this.skeleton.hide(),this.skeleton=null),this.iframe&&(this.iframe.remove(),this.iframe=null)}}class sn{constructor(p){L(this,"element");L(this,"identifier");this.identifier=`skeleton-${p}`,this.element=document.createElement("div"),this.element.id=this.identifier,this.element.style.cssText=`
35
+ `,l}function an(){return Math.random().toString(36).substring(2,10)}class be{constructor(p){L(this,"iframe",null);L(this,"skeleton",null);L(this,"options");L(this,"appearance");L(this,"tooltipManager");L(this,"defaultIframeCSSConfig",Gt);L(this,"Skeleton",null);L(this,"defaultUniqueId");this.options=p,this.appearance=p.appearance||null,this.tooltipManager=new O,this.defaultUniqueId=be.generateUniqueId()}static generateUniqueId(){return an()}get uniqueIdentifier(){return this.defaultUniqueId}get iframeIdentifier(){return`${this.defaultIframePrefix}-${this.uniqueIdentifier}`}handleHeightChange(p){if(!this.iframe||(this.iframe.style.height=`${p}px`,p>0))return;const{parentElement:g}=this.iframe;g&&(g.style.display="none")}handleIframeReady(){this.iframe&&(this.options.onReady&&this.options.onReady(),Yt(this.iframe,this.appearance,this.uniqueIdentifier),this.skeleton&&this.skeleton.hide())}handleTooltipChange(p){if(!this.iframe)return;const g=this.iframe.getBoundingClientRect(),{text:l,coordinates:w,isVisible:y}=p,E=w.x+g.left,C=w.y+g.top;y?this.tooltipManager.show(l,E,C):this.tooltipManager.hide()}setupListeners(){return $(this,null,function*(){yield en();const p={onHeightChange:this.handleHeightChange.bind(this),onIframeReady:this.handleIframeReady.bind(this),onTooltipChange:this.handleTooltipChange.bind(this),onInfo:this.options.onEvent.bind(this)};tt(this.uniqueIdentifier,p)})}mount(p){return $(this,null,function*(){yield this.setupListeners(),nn(this.iframeIdentifier);const g=rn(p),l=this.iframeUrl();return this.iframe=on(l,this.iframeIdentifier,this.defaultIframeCSSConfig),this.Skeleton&&(this.skeleton=new this.Skeleton(this.uniqueIdentifier),this.skeleton.mount(g)),g.appendChild(this.iframe),this})}unmount(){tn(this.uniqueIdentifier),this.skeleton&&(this.skeleton.hide(),this.skeleton=null),this.iframe&&(this.iframe.remove(),this.iframe=null)}}class sn{constructor(p){L(this,"element");L(this,"identifier");this.identifier=`skeleton-${p}`,this.element=document.createElement("div"),this.element.id=this.identifier,this.element.style.cssText=`
45
36
  position: absolute;
46
37
  left: 50%;
47
38
  top: 50%;
@@ -58,7 +49,7 @@
58
49
  display: flex;
59
50
  flex-direction: column;
60
51
  gap: 1rem;
61
- `;const w=document.createElement("div");w.style.cssText=`
52
+ `;const g=document.createElement("div");g.style.cssText=`
62
53
  padding: 1rem;
63
54
  height: 100%;
64
55
  max-width: 100%;
@@ -69,7 +60,7 @@
69
60
  display: flex;
70
61
  align-items: center;
71
62
  gap: 0.75rem;
72
- `;const g=document.createElement("div");g.style.cssText=`
63
+ `;const w=document.createElement("div");w.style.cssText=`
73
64
  width: 2rem;
74
65
  height: 2rem;
75
66
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
@@ -97,7 +88,7 @@
97
88
  display: flex;
98
89
  align-items: center;
99
90
  gap: 1rem;
100
- `;const X=document.createElement("div");X.style.cssText=`
91
+ `;const Z=document.createElement("div");Z.style.cssText=`
101
92
  width: 1rem;
102
93
  height: 1rem;
103
94
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
@@ -106,7 +97,7 @@
106
97
  border-radius: 0.25rem;
107
98
  flex-shrink: 0;
108
99
  margin-left: 10px;
109
- `;const Z=document.createElement("div");Z.style.cssText=`
100
+ `;const X=document.createElement("div");X.style.cssText=`
110
101
  flex-grow: 1;
111
102
  display: flex;
112
103
  flex-direction: column;
@@ -130,12 +121,12 @@
130
121
  0% { background-position: 200% 0; }
131
122
  100% { background-position: -200% 0; }
132
123
  }
133
- `,document.head.appendChild(te)}l.appendChild(g),l.appendChild(y),l.appendChild(E),Z.appendChild(V),Z.appendChild(he),C.appendChild(X),C.appendChild(Z),w.appendChild(l),w.appendChild(C),this.element.appendChild(w)}cleanupExistingSkeleton(){const p=document.getElementById(this.identifier);p&&p.remove()}mount(p){this.cleanupExistingSkeleton(),p.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}function un(h){var E;const p=["actionToken","entityId","context","optionalReconsentBehavior","mandatoryReconsentBehavior"],w=(E=h.isSandbox)!=null?E:!1,l=h.developmentUrl||(w?ce:F),g=new URLSearchParams;p.forEach(C=>{h[C]&&g.set(C,h[C])});const y=g.toString();return`${l}/embed/consents/${h.consentTemplateId}${y?`?${y}`:""}`}class Le extends be{constructor(w){super(w);L(this,"defaultIframePrefix","consent-box");L(this,"defaultIframeCSSConfig",$t);L(this,"state",{isSelected:!1,actionToken:null});this.Skeleton=sn}get uniqueIdentifier(){return this.options.consentTemplateId}iframeUrl(){return un(this.options)}handleStateChange(w){const{isSelected:l,actionToken:g}=w;this.state={isSelected:l,actionToken:g},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:l,actionToken:g})}setupListeners(){return $(this,null,function*(){yield Ht(Le.prototype,this,"setupListeners").call(this),tt(this.uniqueIdentifier,{onStateChange:this.handleStateChange.bind(this)})})}getState(){return this.state}}function cn(h){var E;const p=["subjectId","companyId"],w=(E=h.isSandbox)!=null?E:!1,l=h.developmentUrl||(w?De:Ne),g=new URLSearchParams;p.forEach(C=>{h[C]&&g.set(C,h[C])});const y=g.toString();return`${l}/${y?`?${y}`:""}`}class dn extends be{constructor(){super(...arguments);L(this,"defaultIframePrefix","privacy-center");L(this,"_uniqueIdentifier","privacy-center");L(this,"defaultIframeCSSConfig",Vt)}get uniqueIdentifier(){return this._uniqueIdentifier}iframeUrl(){return cn(this.options)}}const fn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function ln(h){let p="widget/";return"disclosureRequestId"in h.configProps?p+=["disclosures",h.configProps.disclosureRequestId].join("/"):p+=h.request,p}function hn(h){var y;const p=(y=h.isSandbox)!=null?y:!1,w=h.developmentUrl||(p?ce:F),l=Object.entries(h.configProps).filter(([E,C])=>C||E==="disclosureRequestId").map(([E,C])=>`${E}=${encodeURIComponent(C)}`).join("&"),g=ln(h);return`${w}/${g}?sdk=web&${l}`}const mn=!!(typeof window!="undefined"&&window.document&&window.document.createElement);let ee=null,ze=null;function Me(h=null){ee&&!ee.closed&&ee.focus(),h==null||h.preventDefault()}function je(){document.body.style.filter="",document.body.removeEventListener("click",Me)}function pn(){ze=setInterval(()=>{(!ee||ee.closed)&&(ze&&clearInterval(ze),je())},Bt)}function vn(h){const p=hn(h),w=fe,l=qt,g=window.screenLeft!==void 0?window.screenLeft:window.screenX,y=window.screenTop!==void 0?window.screenTop:window.screenY,E=window.innerWidth||document.documentElement.clientWidth||window.screen.width,C=window.innerHeight||document.documentElement.clientHeight||window.screen.height,X=E/window.screen.availWidth,Z=(E-w)/2/X+g,V=(C-l)/2/X+y;document.body.style.filter="blur(5px)",document.body.addEventListener("click",Me),ee=window.open(p,"Soyio",`scrollbars=yes,
134
- width=${w},
124
+ `,document.head.appendChild(te)}l.appendChild(w),l.appendChild(y),l.appendChild(E),X.appendChild(V),X.appendChild(he),C.appendChild(Z),C.appendChild(X),g.appendChild(l),g.appendChild(C),this.element.appendChild(g)}cleanupExistingSkeleton(){const p=document.getElementById(this.identifier);p&&p.remove()}mount(p){this.cleanupExistingSkeleton(),p.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}function un(h){var E;const p=["actionToken","entityId","context","optionalReconsentBehavior","mandatoryReconsentBehavior"],g=(E=h.isSandbox)!=null?E:!1,l=h.developmentUrl||(g?ce:F),w=new URLSearchParams;p.forEach(C=>{h[C]&&w.set(C,h[C])});const y=w.toString();return`${l}/embed/consents/${h.consentTemplateId}${y?`?${y}`:""}`}class Le extends be{constructor(g){super(g);L(this,"defaultIframePrefix","consent-box");L(this,"defaultIframeCSSConfig",$t);L(this,"state",{isSelected:!1,actionToken:null});this.Skeleton=sn}get uniqueIdentifier(){return this.options.consentTemplateId}iframeUrl(){return un(this.options)}handleStateChange(g){const{isSelected:l,actionToken:w}=g;this.state={isSelected:l,actionToken:w},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:l,actionToken:w})}setupListeners(){return $(this,null,function*(){yield Ht(Le.prototype,this,"setupListeners").call(this),tt(this.uniqueIdentifier,{onStateChange:this.handleStateChange.bind(this)})})}getState(){return this.state}}function cn(h){var E;const p=["subjectId","companyId"],g=(E=h.isSandbox)!=null?E:!1,l=h.developmentUrl||(g?De:Ne),w=new URLSearchParams;p.forEach(C=>{h[C]&&w.set(C,h[C])});const y=w.toString();return`${l}/${y?`?${y}`:""}`}class dn extends be{constructor(){super(...arguments);L(this,"defaultIframePrefix","privacy-center");L(this,"_uniqueIdentifier","privacy-center");L(this,"defaultIframeCSSConfig",Vt)}get uniqueIdentifier(){return this._uniqueIdentifier}iframeUrl(){return cn(this.options)}}const fn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function ln(h){let p="widget/";return"disclosureRequestId"in h.configProps?p+=["disclosures",h.configProps.disclosureRequestId].join("/"):p+=h.request,p}function hn(h){var y;const p=(y=h.isSandbox)!=null?y:!1,g=h.developmentUrl||(p?ce:F),l=Object.entries(h.configProps).filter(([E,C])=>C||E==="disclosureRequestId").map(([E,C])=>`${E}=${encodeURIComponent(C)}`).join("&"),w=ln(h);return`${g}/${w}?sdk=web&${l}`}const mn=!!(typeof window!="undefined"&&window.document&&window.document.createElement);let ee=null,ze=null;function Me(h=null){ee&&!ee.closed&&ee.focus(),h==null||h.preventDefault()}function je(){document.body.style.filter="",document.body.removeEventListener("click",Me)}function pn(){ze=setInterval(()=>{(!ee||ee.closed)&&(ze&&clearInterval(ze),je())},Bt)}function vn(h){const p=hn(h),g=fe,l=qt,w=window.screenLeft!==void 0?window.screenLeft:window.screenX,y=window.screenTop!==void 0?window.screenTop:window.screenY,E=window.innerWidth||document.documentElement.clientWidth||window.screen.width,C=window.innerHeight||document.documentElement.clientHeight||window.screen.height,Z=E/window.screen.availWidth,X=(E-g)/2/Z+w,V=(C-l)/2/Z+y;document.body.style.filter="blur(5px)",document.body.addEventListener("click",Me),ee=window.open(p,"Soyio",`scrollbars=yes,
125
+ width=${g},
135
126
  height=${l},
136
127
  top=${V},
137
- left=${Z}`),Me(),pn()}function wn(){ee&&(ee.close(),ee=null),je()}const gn="WIDGET_EVENT";let le=null;function yn(){le&&(le.cancel(),le=null)}function En(h){return $(this,null,function*(){const{onEvent:p}=h,w=yield Promise.resolve().then(()=>ke);le&&yn(),le=w.on(gn,l=>$(this,null,function*(){p(l.data),de.includes(l.data.eventName)?wn():l.data.eventName===Q&&je()}))})}function xn(h){En(h)}class nt{constructor(p){Ut(this,Ie);L(this,"onEvent");this.onEvent=p.onEvent,mn&&(vn(p),xn({onEvent:Ft(this,Ie,_t).bind(this)}))}}Ie=new WeakSet,_t=function(p){this.onEvent(p)};var Sn=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function bn(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var rt={exports:{}},ot={exports:{}};(function(h,p){(function(w,l){h.exports=l()})(typeof self!="undefined"?self:Sn,function(){return function(w){var l={};function g(y){if(l[y])return l[y].exports;var E=l[y]={i:y,l:!1,exports:{}};return w[y].call(E.exports,E,E.exports,g),E.l=!0,E.exports}return g.m=w,g.c=l,g.d=function(y,E,C){g.o(y,E)||Object.defineProperty(y,E,{enumerable:!0,get:C})},g.r=function(y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},g.t=function(y,E){if(1&E&&(y=g(y)),8&E||4&E&&typeof y=="object"&&y&&y.__esModule)return y;var C=Object.create(null);if(g.r(C),Object.defineProperty(C,"default",{enumerable:!0,value:y}),2&E&&typeof y!="string")for(var X in y)g.d(C,X,function(Z){return y[Z]}.bind(null,X));return C},g.n=function(y){var E=y&&y.__esModule?function(){return y.default}:function(){return y};return g.d(E,"a",E),E},g.o=function(y,E){return{}.hasOwnProperty.call(y,E)},g.p="",g(g.s=0)}([function(w,l,g){g.r(l),g.d(l,"Promise",function(){return T}),g.d(l,"TYPES",function(){return $n}),g.d(l,"ProxyWindow",function(){return G}),g.d(l,"setup",function(){return Mt}),g.d(l,"destroy",function(){return Gn}),g.d(l,"serializeMessage",function(){return Hn}),g.d(l,"deserializeMessage",function(){return _n}),g.d(l,"createProxyWindow",function(){return qn}),g.d(l,"toProxyWindow",function(){return Bn}),g.d(l,"on",function(){return ne}),g.d(l,"once",function(){return Fn}),g.d(l,"send",function(){return re}),g.d(l,"markWindowKnown",function(){return It}),g.d(l,"cleanUpWindow",function(){return Vn}),g.d(l,"bridge",function(){});function y(e){return{}.toString.call(e)==="[object RegExp]"}var E=`Call was rejected by callee.\r
138
- `;function C(e){return e===void 0&&(e=window),e.location.protocol}function X(e){if(e===void 0&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return C(e)}function Z(e){return e===void 0&&(e=window),X(e)==="about:"}function V(e){if(e===void 0&&(e=window),e)try{if(e.parent&&e.parent!==e)return e.parent}catch(n){}}function he(e){if(e===void 0&&(e=window),e&&!V(e))try{return e.opener}catch(n){}}function te(e){try{return!0}catch(n){}return!1}function We(e){e===void 0&&(e=window);var n=e.location;if(!n)throw new Error("Can not read window location");var t=C(e);if(!t)throw new Error("Can not read window protocol");if(t==="file:")return"file://";if(t==="about:"){var r=V(e);return r&&te()?We(r):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function H(e){e===void 0&&(e=window);var n=We(e);return n&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:n}function oe(e){if(!function(n){try{if(n===window)return!0}catch(r){}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&t.enumerable===!1)return!1}catch(r){}try{if(Z(n)&&te())return!0}catch(r){}try{if(function(r){return r===void 0&&(r=window),X(r)==="mock:"}(n)&&te())return!0}catch(r){}try{if(We(n)===We(window))return!0}catch(r){}return!1}(e))return!1;try{if(e===window||Z(e)&&te()||H(window)===H(e))return!0}catch(n){}return!1}function Ce(e){if(!oe(e))throw new Error("Expected window to be same domain");return e}function at(e,n){if(!e||!n)return!1;var t=V(n);return t?t===e:function(r){var o=[];try{for(;r.parent!==r;)o.push(r.parent),r=r.parent}catch(i){}return o}(n).indexOf(e)!==-1}function st(e){var n=[],t;try{t=e.frames}catch(u){t=e}var r;try{r=t.length}catch(u){}if(r===0)return n;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch(u){continue}n.push(i)}return n}for(var a=0;a<100;a++){var c=void 0;try{c=t[a]}catch(u){return n}if(!c)return n;n.push(c)}return n}var Wn=[],Cn=[];function Y(e,n){n===void 0&&(n=!0);try{if(e===window)return!1}catch(o){return!0}try{if(!e)return!0}catch(o){return!0}try{if(e.closed)return!0}catch(o){return!o||o.message!==E}if(n&&oe(e))try{if(e.mockclosed)return!0}catch(o){}try{if(!e.parent||!e.top)return!0}catch(o){}var t=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch(c){}return-1}(Wn,e);if(t!==-1){var r=Cn[t];if(r&&function(o){if(!o.contentWindow||!o.parentNode)return!0;var i=o.ownerDocument;if(i&&i.documentElement&&!i.documentElement.contains(o)){for(var a=o;a.parentNode&&a.parentNode!==a;)a=a.parentNode;if(!a.host||!i.documentElement.contains(a.host))return!0}return!1}(r))return!0}return!1}function ut(e){return e===void 0&&(e=window),he(e=e||window)||V(e)||void 0}function ue(e,n){if(typeof e=="string"){if(typeof n=="string")return e==="*"||n===e;if(y(n)||Array.isArray(n))return!1}return y(e)?y(n)?e.toString()===n.toString():!Array.isArray(n)&&!!n.match(e):!!Array.isArray(e)&&(Array.isArray(n)?JSON.stringify(e)===JSON.stringify(n):!y(n)&&e.some(function(t){return ue(t,n)}))}function Pe(e){try{if(e===window)return!0}catch(n){if(n&&n.message===E)return!0}try{if({}.toString.call(e)==="[object Window]")return!0}catch(n){if(n&&n.message===E)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.self===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.parent===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.top===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch(n){return!0}try{if("postMessage"in e&&"self"in e&&"location"in e)return!0}catch(n){}return!1}function ct(e){if(oe(e))return Ce(e).frameElement;for(var n=0,t=document.querySelectorAll("iframe");n<t.length;n++){var r=t[n];if(r&&r.contentWindow&&r.contentWindow===e)return r}}function Pn(e){if(function(t){return t===void 0&&(t=window),!!V(t)}(e)){var n=ct(e);if(n&&n.parentElement){n.parentElement.removeChild(n);return}}try{e.close()}catch(t){}}function ie(e){try{if(!e)return!1;if(typeof Promise!="undefined"&&e instanceof Promise)return!0;if(typeof window!="undefined"&&typeof window.Window=="function"&&e instanceof window.Window||typeof window!="undefined"&&typeof window.constructor=="function"&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var t=n.call(e);if(t==="[object Window]"||t==="[object global]"||t==="[object DOMWindow]")return!1}if(typeof e.then=="function")return!0}catch(r){return!1}return!1}var dt=[],me=[],Ue=0,pe;function ft(){if(!Ue&&pe){var e=pe;pe=null,e.resolve()}}function Fe(){Ue+=1}function ve(){Ue-=1,ft()}var T=function(){function e(t){var r=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],t){var o,i,a=!1,c=!1,u=!1;Fe();try{t(function(s){u?r.resolve(s):(a=!0,o=s)},function(s){u?r.reject(s):(c=!0,i=s)})}catch(s){ve(),this.reject(s);return}ve(),u=!0,a?this.resolve(o):c&&this.reject(i)}}var n=e.prototype;return n.resolve=function(t){if(this.resolved||this.rejected)return this;if(ie(t))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=t,this.dispatch(),this},n.reject=function(t){var r=this;if(this.resolved||this.rejected)return this;if(ie(t))throw new Error("Can not reject promise with another promise");if(!t){var o=t&&typeof t.toString=="function"?t.toString():{}.toString.call(t);t=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=t,this.errorHandled||setTimeout(function(){r.errorHandled||function(i,a){if(dt.indexOf(i)===-1){dt.push(i),setTimeout(function(){throw i},1);for(var c=0;c<me.length;c++)me[c](i,a)}}(t,r)},1),this.dispatch(),this},n.asyncReject=function(t){return this.errorHandled=!0,this.reject(t),this},n.dispatch=function(){var t=this.resolved,r=this.rejected,o=this.handlers;if(!this.dispatching&&(t||r)){this.dispatching=!0,Fe();for(var i=function(v,b){return v.then(function(x){b.resolve(x)},function(x){b.reject(x)})},a=0;a<o.length;a++){var c=o[a],u=c.onSuccess,s=c.onError,m=c.promise,d=void 0;if(t)try{d=u?u(this.value):this.value}catch(v){m.reject(v);continue}else if(r){if(!s){m.reject(this.error);continue}try{d=s(this.error)}catch(v){m.reject(v);continue}}if(d instanceof e&&(d.resolved||d.rejected)){var f=d;f.resolved?m.resolve(f.value):m.reject(f.error),f.errorHandled=!0}else ie(d)?d instanceof e&&(d.resolved||d.rejected)?d.resolved?m.resolve(d.value):m.reject(d.error):i(d,m):m.resolve(d)}o.length=0,this.dispatching=!1,ve()}},n.then=function(t,r){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.then expected a function for success handler");if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for error handler");var o=new e;return this.handlers.push({promise:o,onSuccess:t,onError:r}),this.errorHandled=!0,this.dispatch(),o},n.catch=function(t){return this.then(void 0,t)},n.finally=function(t){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(t).then(function(){return r})},function(r){return e.try(t).then(function(){throw r})})},n.timeout=function(t,r){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(r||new Error("Promise timed out after "+t+"ms"))},t);return this.then(function(a){return clearTimeout(i),a})},n.toPromise=function(){if(typeof Promise=="undefined")throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.lazy=function(){return this.errorHandled=!0,this},e.resolve=function(t){return t instanceof e?t:ie(t)?new e(function(r,o){return t.then(r,o)}):new e().resolve(t)},e.reject=function(t){return new e().reject(t)},e.asyncReject=function(t){return new e().asyncReject(t)},e.all=function(t){var r=new e,o=t.length,i=[].slice();if(!o)return r.resolve(i),r;for(var a=function(s,m,d){return m.then(function(f){i[s]=f,(o-=1)==0&&r.resolve(i)},function(f){d.reject(f)})},c=0;c<t.length;c++){var u=t[c];if(u instanceof e){if(u.resolved){i[c]=u.value,o-=1;continue}}else if(!ie(u)){i[c]=u,o-=1;continue}a(c,e.resolve(u),r)}return o===0&&r.resolve(i),r},e.hash=function(t){var r={},o=[],i=function(c){if(t.hasOwnProperty(c)){var u=t[c];ie(u)?o.push(u.then(function(s){r[c]=s})):r[c]=u}};for(var a in t)i(a);return e.all(o).then(function(){return r})},e.map=function(t,r){return e.all(t.map(r))},e.onPossiblyUnhandledException=function(t){return function(r){return me.push(r),{cancel:function(){me.splice(me.indexOf(r),1)}}}(t)},e.try=function(t,r,o){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.try expected a function");var i;Fe();try{i=t.apply(r,o||[])}catch(a){return ve(),e.reject(a)}return ve(),e.resolve(i)},e.delay=function(t){return new e(function(r){setTimeout(r,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||ie(t)},e.flush=function(){return function(t){var r=pe=pe||new t;return ft(),r}(e)},e}();function Te(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(r){}return-1}var He=function(){function e(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if(typeof WeakMap=="undefined"||Object.freeze===void 0)return!1;try{var t=new WeakMap,r={};return Object.freeze(r),t.set(r,"__testvalue__"),t.get(r)==="__testvalue__"}catch(o){return!1}}())try{this.weakmap=new WeakMap}catch(t){}this.keys=[],this.values=[]}var n=e.prototype;return n._cleanupClosedWindows=function(){for(var t=this.weakmap,r=this.keys,o=0;o<r.length;o++){var i=r[o];if(Pe(i)&&Y(i)){if(t)try{t.delete(i)}catch(a){}r.splice(o,1),this.values.splice(o,1),o-=1}}},n.isSafeToReadWrite=function(t){return!Pe(t)},n.set=function(t,r){if(!t)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(t,r)}catch(m){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var i=this.name,a=t[i];a&&a[0]===t?a[1]=r:Object.defineProperty(t,i,{value:[t,r],writable:!0});return}catch(m){}this._cleanupClosedWindows();var c=this.keys,u=this.values,s=Te(c,t);s===-1?(c.push(t),u.push(r)):u[s]=r},n.get=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return r.get(t)}catch(a){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return o&&o[0]===t?o[1]:void 0}catch(a){}this._cleanupClosedWindows();var i=Te(this.keys,t);if(i!==-1)return this.values[i]},n.delete=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.delete(t)}catch(c){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];o&&o[0]===t&&(o[0]=o[1]=void 0)}catch(c){}this._cleanupClosedWindows();var i=this.keys,a=Te(i,t);a!==-1&&(i.splice(a,1),this.values.splice(a,1))},n.has=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return!0}catch(i){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return!(!o||o[0]!==t)}catch(i){}return this._cleanupClosedWindows(),Te(this.keys,t)!==-1},n.getOrSet=function(t,r){if(this.has(t))return this.get(t);var o=r();return this.set(t,o),o},e}();function lt(e){return e.name||e.__name__||e.displayName||"anonymous"}function ht(e,n){try{delete e.name,e.name=n}catch(t){}return e.__name__=e.displayName=n,e}function K(){var e="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})+"_"+function(n){if(typeof btoa=="function")return btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,function(t,r){return String.fromCharCode(parseInt(r,16))})).replace(/[=]/g,"");if(typeof Buffer!="undefined")return Buffer.from(n,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}(new Date().toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var Re;function mt(e){try{return JSON.stringify([].slice.call(e),function(n,t){return typeof t=="function"?"memoize["+function(r){if(Re=Re||new He,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=Re.get(r);return o||(o=typeof r+":"+K(),Re.set(r,o)),o}(t)+"]":typeof window!="undefined"&&t instanceof window.Element||t!==null&&typeof t=="object"&&t.nodeType===1&&typeof t.style=="object"&&typeof t.ownerDocument=="object"?{}:t})}catch(n){throw new Error("Arguments not serializable -- can not be used to memoize")}}function Tn(){return{}}var we=0,pt=0;function ge(e,n){n===void 0&&(n={});var t=n.thisNamespace,r=t!==void 0&&t,o=n.time,i,a,c=we;we+=1;var u=function(){for(var s=arguments.length,m=new Array(s),d=0;d<s;d++)m[d]=arguments[d];c<pt&&(i=null,a=null,c=we,we+=1);var f;f=r?(a=a||new He).getOrSet(this,Tn):i=i||{};var v;try{v=mt(m)}catch(R){return e.apply(this,arguments)}var b=f[v];if(b&&o&&Date.now()-b.time<o&&(delete f[v],b=null),b)return b.value;var x=Date.now(),S=e.apply(this,arguments);return f[v]={time:x,value:S},S};return u.reset=function(){i=null,a=null},ht(u,(n.name||lt(e))+"::memoized")}ge.clear=function(){pt=we};function Rn(e){var n={};function t(){for(var r=arguments,o=this,i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];var u=mt(a);return n.hasOwnProperty(u)||(n[u]=T.try(function(){return e.apply(o,r)}).finally(function(){delete n[u]})),n[u]}return t.reset=function(){n={}},ht(t,lt(e)+"::promiseMemoized")}function ae(){}function ye(e,n){if(n===void 0&&(n=1),n>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+{}.toString.call(e)+">";if(typeof e=="string")return e;if(e instanceof Error){var t=e&&e.stack,r=e&&e.message;if(t&&r)return t.indexOf(r)!==-1?t:r+`
128
+ left=${X}`),Me(),pn()}function wn(){ee&&(ee.close(),ee=null),je()}const gn="WIDGET_EVENT";let le=null;function yn(){le&&(le.cancel(),le=null)}function En(h){return $(this,null,function*(){const{onEvent:p}=h,g=yield Promise.resolve().then(()=>ke);le&&yn(),le=g.on(gn,l=>$(this,null,function*(){p(l.data),de.includes(l.data.eventName)?wn():l.data.eventName===Q&&je()}))})}function xn(h){En(h)}class nt{constructor(p){Ut(this,Ie);L(this,"onEvent");this.onEvent=p.onEvent,mn&&(vn(p),xn({onEvent:Ft(this,Ie,_t).bind(this)}))}}Ie=new WeakSet,_t=function(p){this.onEvent(p)};var Sn=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function bn(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var rt={exports:{}},ot={exports:{}};(function(h,p){(function(g,l){h.exports=l()})(typeof self!="undefined"?self:Sn,function(){return function(g){var l={};function w(y){if(l[y])return l[y].exports;var E=l[y]={i:y,l:!1,exports:{}};return g[y].call(E.exports,E,E.exports,w),E.l=!0,E.exports}return w.m=g,w.c=l,w.d=function(y,E,C){w.o(y,E)||Object.defineProperty(y,E,{enumerable:!0,get:C})},w.r=function(y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},w.t=function(y,E){if(1&E&&(y=w(y)),8&E||4&E&&typeof y=="object"&&y&&y.__esModule)return y;var C=Object.create(null);if(w.r(C),Object.defineProperty(C,"default",{enumerable:!0,value:y}),2&E&&typeof y!="string")for(var Z in y)w.d(C,Z,function(X){return y[X]}.bind(null,Z));return C},w.n=function(y){var E=y&&y.__esModule?function(){return y.default}:function(){return y};return w.d(E,"a",E),E},w.o=function(y,E){return{}.hasOwnProperty.call(y,E)},w.p="",w(w.s=0)}([function(g,l,w){w.r(l),w.d(l,"Promise",function(){return T}),w.d(l,"TYPES",function(){return $n}),w.d(l,"ProxyWindow",function(){return G}),w.d(l,"setup",function(){return Mt}),w.d(l,"destroy",function(){return Gn}),w.d(l,"serializeMessage",function(){return Hn}),w.d(l,"deserializeMessage",function(){return _n}),w.d(l,"createProxyWindow",function(){return qn}),w.d(l,"toProxyWindow",function(){return Bn}),w.d(l,"on",function(){return ne}),w.d(l,"once",function(){return Fn}),w.d(l,"send",function(){return re}),w.d(l,"markWindowKnown",function(){return It}),w.d(l,"cleanUpWindow",function(){return Vn}),w.d(l,"bridge",function(){});function y(e){return{}.toString.call(e)==="[object RegExp]"}var E=`Call was rejected by callee.\r
129
+ `;function C(e){return e===void 0&&(e=window),e.location.protocol}function Z(e){if(e===void 0&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return C(e)}function X(e){return e===void 0&&(e=window),Z(e)==="about:"}function V(e){if(e===void 0&&(e=window),e)try{if(e.parent&&e.parent!==e)return e.parent}catch(n){}}function he(e){if(e===void 0&&(e=window),e&&!V(e))try{return e.opener}catch(n){}}function te(e){try{return!0}catch(n){}return!1}function We(e){e===void 0&&(e=window);var n=e.location;if(!n)throw new Error("Can not read window location");var t=C(e);if(!t)throw new Error("Can not read window protocol");if(t==="file:")return"file://";if(t==="about:"){var r=V(e);return r&&te()?We(r):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function H(e){e===void 0&&(e=window);var n=We(e);return n&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:n}function oe(e){if(!function(n){try{if(n===window)return!0}catch(r){}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&t.enumerable===!1)return!1}catch(r){}try{if(X(n)&&te())return!0}catch(r){}try{if(function(r){return r===void 0&&(r=window),Z(r)==="mock:"}(n)&&te())return!0}catch(r){}try{if(We(n)===We(window))return!0}catch(r){}return!1}(e))return!1;try{if(e===window||X(e)&&te()||H(window)===H(e))return!0}catch(n){}return!1}function Ce(e){if(!oe(e))throw new Error("Expected window to be same domain");return e}function at(e,n){if(!e||!n)return!1;var t=V(n);return t?t===e:function(r){var o=[];try{for(;r.parent!==r;)o.push(r.parent),r=r.parent}catch(i){}return o}(n).indexOf(e)!==-1}function st(e){var n=[],t;try{t=e.frames}catch(u){t=e}var r;try{r=t.length}catch(u){}if(r===0)return n;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch(u){continue}n.push(i)}return n}for(var a=0;a<100;a++){var c=void 0;try{c=t[a]}catch(u){return n}if(!c)return n;n.push(c)}return n}var Wn=[],Cn=[];function Y(e,n){n===void 0&&(n=!0);try{if(e===window)return!1}catch(o){return!0}try{if(!e)return!0}catch(o){return!0}try{if(e.closed)return!0}catch(o){return!o||o.message!==E}if(n&&oe(e))try{if(e.mockclosed)return!0}catch(o){}try{if(!e.parent||!e.top)return!0}catch(o){}var t=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch(c){}return-1}(Wn,e);if(t!==-1){var r=Cn[t];if(r&&function(o){if(!o.contentWindow||!o.parentNode)return!0;var i=o.ownerDocument;if(i&&i.documentElement&&!i.documentElement.contains(o)){for(var a=o;a.parentNode&&a.parentNode!==a;)a=a.parentNode;if(!a.host||!i.documentElement.contains(a.host))return!0}return!1}(r))return!0}return!1}function ut(e){return e===void 0&&(e=window),he(e=e||window)||V(e)||void 0}function ue(e,n){if(typeof e=="string"){if(typeof n=="string")return e==="*"||n===e;if(y(n)||Array.isArray(n))return!1}return y(e)?y(n)?e.toString()===n.toString():!Array.isArray(n)&&!!n.match(e):!!Array.isArray(e)&&(Array.isArray(n)?JSON.stringify(e)===JSON.stringify(n):!y(n)&&e.some(function(t){return ue(t,n)}))}function Pe(e){try{if(e===window)return!0}catch(n){if(n&&n.message===E)return!0}try{if({}.toString.call(e)==="[object Window]")return!0}catch(n){if(n&&n.message===E)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.self===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.parent===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.top===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch(n){return!0}try{if("postMessage"in e&&"self"in e&&"location"in e)return!0}catch(n){}return!1}function ct(e){if(oe(e))return Ce(e).frameElement;for(var n=0,t=document.querySelectorAll("iframe");n<t.length;n++){var r=t[n];if(r&&r.contentWindow&&r.contentWindow===e)return r}}function Pn(e){if(function(t){return t===void 0&&(t=window),!!V(t)}(e)){var n=ct(e);if(n&&n.parentElement){n.parentElement.removeChild(n);return}}try{e.close()}catch(t){}}function ie(e){try{if(!e)return!1;if(typeof Promise!="undefined"&&e instanceof Promise)return!0;if(typeof window!="undefined"&&typeof window.Window=="function"&&e instanceof window.Window||typeof window!="undefined"&&typeof window.constructor=="function"&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var t=n.call(e);if(t==="[object Window]"||t==="[object global]"||t==="[object DOMWindow]")return!1}if(typeof e.then=="function")return!0}catch(r){return!1}return!1}var dt=[],me=[],Ue=0,pe;function ft(){if(!Ue&&pe){var e=pe;pe=null,e.resolve()}}function Fe(){Ue+=1}function ve(){Ue-=1,ft()}var T=function(){function e(t){var r=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],t){var o,i,a=!1,c=!1,u=!1;Fe();try{t(function(s){u?r.resolve(s):(a=!0,o=s)},function(s){u?r.reject(s):(c=!0,i=s)})}catch(s){ve(),this.reject(s);return}ve(),u=!0,a?this.resolve(o):c&&this.reject(i)}}var n=e.prototype;return n.resolve=function(t){if(this.resolved||this.rejected)return this;if(ie(t))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=t,this.dispatch(),this},n.reject=function(t){var r=this;if(this.resolved||this.rejected)return this;if(ie(t))throw new Error("Can not reject promise with another promise");if(!t){var o=t&&typeof t.toString=="function"?t.toString():{}.toString.call(t);t=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=t,this.errorHandled||setTimeout(function(){r.errorHandled||function(i,a){if(dt.indexOf(i)===-1){dt.push(i),setTimeout(function(){throw i},1);for(var c=0;c<me.length;c++)me[c](i,a)}}(t,r)},1),this.dispatch(),this},n.asyncReject=function(t){return this.errorHandled=!0,this.reject(t),this},n.dispatch=function(){var t=this.resolved,r=this.rejected,o=this.handlers;if(!this.dispatching&&(t||r)){this.dispatching=!0,Fe();for(var i=function(v,b){return v.then(function(x){b.resolve(x)},function(x){b.reject(x)})},a=0;a<o.length;a++){var c=o[a],u=c.onSuccess,s=c.onError,m=c.promise,d=void 0;if(t)try{d=u?u(this.value):this.value}catch(v){m.reject(v);continue}else if(r){if(!s){m.reject(this.error);continue}try{d=s(this.error)}catch(v){m.reject(v);continue}}if(d instanceof e&&(d.resolved||d.rejected)){var f=d;f.resolved?m.resolve(f.value):m.reject(f.error),f.errorHandled=!0}else ie(d)?d instanceof e&&(d.resolved||d.rejected)?d.resolved?m.resolve(d.value):m.reject(d.error):i(d,m):m.resolve(d)}o.length=0,this.dispatching=!1,ve()}},n.then=function(t,r){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.then expected a function for success handler");if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for error handler");var o=new e;return this.handlers.push({promise:o,onSuccess:t,onError:r}),this.errorHandled=!0,this.dispatch(),o},n.catch=function(t){return this.then(void 0,t)},n.finally=function(t){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(t).then(function(){return r})},function(r){return e.try(t).then(function(){throw r})})},n.timeout=function(t,r){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(r||new Error("Promise timed out after "+t+"ms"))},t);return this.then(function(a){return clearTimeout(i),a})},n.toPromise=function(){if(typeof Promise=="undefined")throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.lazy=function(){return this.errorHandled=!0,this},e.resolve=function(t){return t instanceof e?t:ie(t)?new e(function(r,o){return t.then(r,o)}):new e().resolve(t)},e.reject=function(t){return new e().reject(t)},e.asyncReject=function(t){return new e().asyncReject(t)},e.all=function(t){var r=new e,o=t.length,i=[].slice();if(!o)return r.resolve(i),r;for(var a=function(s,m,d){return m.then(function(f){i[s]=f,(o-=1)==0&&r.resolve(i)},function(f){d.reject(f)})},c=0;c<t.length;c++){var u=t[c];if(u instanceof e){if(u.resolved){i[c]=u.value,o-=1;continue}}else if(!ie(u)){i[c]=u,o-=1;continue}a(c,e.resolve(u),r)}return o===0&&r.resolve(i),r},e.hash=function(t){var r={},o=[],i=function(c){if(t.hasOwnProperty(c)){var u=t[c];ie(u)?o.push(u.then(function(s){r[c]=s})):r[c]=u}};for(var a in t)i(a);return e.all(o).then(function(){return r})},e.map=function(t,r){return e.all(t.map(r))},e.onPossiblyUnhandledException=function(t){return function(r){return me.push(r),{cancel:function(){me.splice(me.indexOf(r),1)}}}(t)},e.try=function(t,r,o){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.try expected a function");var i;Fe();try{i=t.apply(r,o||[])}catch(a){return ve(),e.reject(a)}return ve(),e.resolve(i)},e.delay=function(t){return new e(function(r){setTimeout(r,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||ie(t)},e.flush=function(){return function(t){var r=pe=pe||new t;return ft(),r}(e)},e}();function Te(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(r){}return-1}var He=function(){function e(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if(typeof WeakMap=="undefined"||Object.freeze===void 0)return!1;try{var t=new WeakMap,r={};return Object.freeze(r),t.set(r,"__testvalue__"),t.get(r)==="__testvalue__"}catch(o){return!1}}())try{this.weakmap=new WeakMap}catch(t){}this.keys=[],this.values=[]}var n=e.prototype;return n._cleanupClosedWindows=function(){for(var t=this.weakmap,r=this.keys,o=0;o<r.length;o++){var i=r[o];if(Pe(i)&&Y(i)){if(t)try{t.delete(i)}catch(a){}r.splice(o,1),this.values.splice(o,1),o-=1}}},n.isSafeToReadWrite=function(t){return!Pe(t)},n.set=function(t,r){if(!t)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(t,r)}catch(m){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var i=this.name,a=t[i];a&&a[0]===t?a[1]=r:Object.defineProperty(t,i,{value:[t,r],writable:!0});return}catch(m){}this._cleanupClosedWindows();var c=this.keys,u=this.values,s=Te(c,t);s===-1?(c.push(t),u.push(r)):u[s]=r},n.get=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return r.get(t)}catch(a){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return o&&o[0]===t?o[1]:void 0}catch(a){}this._cleanupClosedWindows();var i=Te(this.keys,t);if(i!==-1)return this.values[i]},n.delete=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.delete(t)}catch(c){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];o&&o[0]===t&&(o[0]=o[1]=void 0)}catch(c){}this._cleanupClosedWindows();var i=this.keys,a=Te(i,t);a!==-1&&(i.splice(a,1),this.values.splice(a,1))},n.has=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return!0}catch(i){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return!(!o||o[0]!==t)}catch(i){}return this._cleanupClosedWindows(),Te(this.keys,t)!==-1},n.getOrSet=function(t,r){if(this.has(t))return this.get(t);var o=r();return this.set(t,o),o},e}();function lt(e){return e.name||e.__name__||e.displayName||"anonymous"}function ht(e,n){try{delete e.name,e.name=n}catch(t){}return e.__name__=e.displayName=n,e}function K(){var e="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})+"_"+function(n){if(typeof btoa=="function")return btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,function(t,r){return String.fromCharCode(parseInt(r,16))})).replace(/[=]/g,"");if(typeof Buffer!="undefined")return Buffer.from(n,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}(new Date().toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var Re;function mt(e){try{return JSON.stringify([].slice.call(e),function(n,t){return typeof t=="function"?"memoize["+function(r){if(Re=Re||new He,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=Re.get(r);return o||(o=typeof r+":"+K(),Re.set(r,o)),o}(t)+"]":typeof window!="undefined"&&t instanceof window.Element||t!==null&&typeof t=="object"&&t.nodeType===1&&typeof t.style=="object"&&typeof t.ownerDocument=="object"?{}:t})}catch(n){throw new Error("Arguments not serializable -- can not be used to memoize")}}function Tn(){return{}}var we=0,pt=0;function ge(e,n){n===void 0&&(n={});var t=n.thisNamespace,r=t!==void 0&&t,o=n.time,i,a,c=we;we+=1;var u=function(){for(var s=arguments.length,m=new Array(s),d=0;d<s;d++)m[d]=arguments[d];c<pt&&(i=null,a=null,c=we,we+=1);var f;f=r?(a=a||new He).getOrSet(this,Tn):i=i||{};var v;try{v=mt(m)}catch(R){return e.apply(this,arguments)}var b=f[v];if(b&&o&&Date.now()-b.time<o&&(delete f[v],b=null),b)return b.value;var x=Date.now(),S=e.apply(this,arguments);return f[v]={time:x,value:S},S};return u.reset=function(){i=null,a=null},ht(u,(n.name||lt(e))+"::memoized")}ge.clear=function(){pt=we};function Rn(e){var n={};function t(){for(var r=arguments,o=this,i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];var u=mt(a);return n.hasOwnProperty(u)||(n[u]=T.try(function(){return e.apply(o,r)}).finally(function(){delete n[u]})),n[u]}return t.reset=function(){n={}},ht(t,lt(e)+"::promiseMemoized")}function ae(){}function ye(e,n){if(n===void 0&&(n=1),n>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+{}.toString.call(e)+">";if(typeof e=="string")return e;if(e instanceof Error){var t=e&&e.stack,r=e&&e.message;if(t&&r)return t.indexOf(r)!==-1?t:r+`
139
130
  `+t;if(t)return t;if(r)return r}return e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}catch(o){return"Error while stringifying error: "+ye(o,n+1)}}function vt(e){return typeof e=="string"?e:e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}ge(function(e){if(Object.values)return Object.values(e);var n=[];for(var t in e)e.hasOwnProperty(t)&&n.push(e[t]);return n});function _e(e){return{}.toString.call(e)==="[object RegExp]"}function Ee(e,n,t){if(e.hasOwnProperty(n))return e[n];var r=t();return e[n]=r,r}function wt(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function gt(){return!!document.body&&document.readyState==="complete"}function yt(){return!!document.body&&document.readyState==="interactive"}ge(function(){return new T(function(e){if(gt()||yt())return e();var n=setInterval(function(){if(gt()||yt())return clearInterval(n),e()},10)})});var Ae=typeof document!="undefined"?document.currentScript:null,An=ge(function(){if(Ae||(Ae=function(){try{var e=function(){try{throw new Error("_")}catch(a){return a.stack||""}}(),n=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e),t=n&&n[1];if(!t)return;for(var r=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();r<o.length;r++){var i=o[r];if(i.src&&i.src===t)return i}}catch(a){}}()))return Ae;throw new Error("Can not determine current script")}),On=K();ge(function(){var e;try{e=An()}catch(r){return On}var n=e.getAttribute("data-uid");if(n&&typeof n=="string"||(n=e.getAttribute("data-uid-auto"))&&typeof n=="string")return n;if(e.src){var t=function(r){for(var o="",i=0;i<r.length;i++){var a=r[i].charCodeAt(0)*i;r[i+1]&&(a+=r[i+1].charCodeAt(0)*(i-1)),o+=String.fromCharCode(97+Math.abs(a)%26)}return o}(JSON.stringify({src:e.src,dataset:e.dataset}));n="uid_"+t.slice(t.length-30)}else n=K();return e.setAttribute("data-uid-auto",n),n});function xe(e){e===void 0&&(e=window);var n="__post_robot_10_0_46__";return e!==window?e[n]:e[n]=e[n]||{}}var Et=function(){return{}};function j(e,n){return e===void 0&&(e="store"),n===void 0&&(n=Et),Ee(xe(),e,function(){var t=n();return{has:function(r){return t.hasOwnProperty(r)},get:function(r,o){return t.hasOwnProperty(r)?t[r]:o},set:function(r,o){return t[r]=o,o},del:function(r){delete t[r]},getOrSet:function(r,o){return Ee(t,r,o)},reset:function(){t=n()},keys:function(){return Object.keys(t)}}})}var Nn=function(){};function Oe(){var e=xe();return e.WINDOW_WILDCARD=e.WINDOW_WILDCARD||new Nn,e.WINDOW_WILDCARD}function _(e,n){return e===void 0&&(e="store"),n===void 0&&(n=Et),j("windowStore").getOrSet(e,function(){var t=new He,r=function(o){return t.getOrSet(o,n)};return{has:function(o){return r(o).hasOwnProperty(e)},get:function(o,i){var a=r(o);return a.hasOwnProperty(e)?a[e]:i},set:function(o,i){return r(o)[e]=i,i},del:function(o){delete r(o)[e]},getOrSet:function(o,i){return Ee(r(o),e,i)}}})}function xt(){return j("instance").getOrSet("instanceID",K)}function St(e,n){var t=n.domain,r=_("helloPromises"),o=r.get(e);o&&o.resolve({domain:t});var i=T.resolve({domain:t});return r.set(e,i),i}function qe(e,n){return(0,n.send)(e,"postrobot_hello",{instanceID:xt()},{domain:"*",timeout:-1}).then(function(t){var r=t.origin,o=t.data.instanceID;return St(e,{domain:r}),{win:e,domain:r,instanceID:o}})}function bt(e,n){var t=n.send;return _("windowInstanceIDPromises").getOrSet(e,function(){return qe(e,{send:t}).then(function(r){return r.instanceID})})}function It(e){_("knownWindows").set(e,!0)}function Be(e){return typeof e=="object"&&e!==null&&typeof e.__type__=="string"}function Wt(e){return e===void 0?"undefined":e===null?"null":Array.isArray(e)?"array":typeof e=="function"?"function":typeof e=="object"?e instanceof Error?"error":typeof e.then=="function"?"promise":{}.toString.call(e)==="[object RegExp]"?"regex":{}.toString.call(e)==="[object Date]"?"date":"object":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":void 0}function se(e,n){return{__type__:e,__val__:n}}var q,Dn=((q={}).function=function(){},q.error=function(e){return se("error",{message:e.message,stack:e.stack,code:e.code,data:e.data})},q.promise=function(){},q.regex=function(e){return se("regex",e.source)},q.date=function(e){return se("date",e.toJSON())},q.array=function(e){return e},q.object=function(e){return e},q.string=function(e){return e},q.number=function(e){return e},q.boolean=function(e){return e},q.null=function(e){return e},q[void 0]=function(e){return se("undefined",e)},q),Ln={},B,zn=((B={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},B.error=function(e){var n=e.stack,t=e.code,r=e.data,o=new Error(e.message);return o.code=t,r&&(o.data=r),o.stack=n+`
140
131
 
141
132
  `+o.stack,o},B.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},B.regex=function(e){return new RegExp(e)},B.date=function(e){return new Date(e)},B.array=function(e){return e},B.object=function(e){return e},B.string=function(e){return e},B.number=function(e){return e},B.boolean=function(e){return e},B.null=function(e){return e},B[void 0]=function(){},B),Mn={};new T(function(e){if(window.document&&window.document.body)return e(window.document.body);var n=setInterval(function(){if(window.document&&window.document.body)return clearInterval(n),e(window.document.body)},10)});function Ge(){for(var e=j("idToProxyWindow"),n=0,t=e.keys();n<t.length;n++){var r=t[n];e.get(r).shouldClean()&&e.del(r)}}function Ct(e,n){var t=n.send,r=n.id,o=r===void 0?K():r,i=e.then(function(u){if(oe(u))return Ce(u).name}),a=e.then(function(u){if(Y(u))throw new Error("Window is closed, can not determine type");return he(u)?"popup":"iframe"});i.catch(ae),a.catch(ae);var c=function(){return e.then(function(u){if(!Y(u))return oe(u)?Ce(u).name:i})};return{id:o,getType:function(){return a},getInstanceID:Rn(function(){return e.then(function(u){return bt(u,{send:t})})}),close:function(){return e.then(Pn)},getName:c,focus:function(){return e.then(function(u){u.focus()})},isClosed:function(){return e.then(function(u){return Y(u)})},setLocation:function(u,s){return s===void 0&&(s={}),e.then(function(m){var d=window.location.protocol+"//"+window.location.host,f=s.method,v=f===void 0?"get":f,b=s.body;if(u.indexOf("/")===0)u=""+d+u;else if(!u.match(/^https?:\/\//)&&u.indexOf(d)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(u));if(v==="post")return c().then(function(x){if(!x)throw new Error("Can not post to window without target name");(function(S){var R=S.url,M=S.target,N=S.body,A=S.method,k=A===void 0?"post":A,W=document.createElement("form");if(W.setAttribute("target",M),W.setAttribute("method",k),W.setAttribute("action",R),W.style.display="none",N)for(var D=0,J=Object.keys(N);D<J.length;D++){var z,Se=J[D],Je=document.createElement("input");Je.setAttribute("name",Se),Je.setAttribute("value",(z=N[Se])==null?void 0:z.toString()),W.appendChild(Je)}wt().appendChild(W),W.submit(),wt().removeChild(W)})({url:u,target:x,method:v,body:b})});if(v!=="get")throw new Error("Unsupported method: "+v);if(oe(m))try{if(m.location&&typeof m.location.replace=="function"){m.location.replace(u);return}}catch(x){}m.location=u})},setName:function(u){return e.then(function(s){var m=oe(s),d=ct(s);if(!m)throw new Error("Can not set name for cross-domain window: "+u);Ce(s).name=u,d&&d.setAttribute("name",u),i=T.resolve(u)})}}}var G=function(){function e(t){var r=t.send,o=t.win,i=t.serializedWindow;this.id=void 0,this.isProxyWindow=!0,this.serializedWindow=void 0,this.actualWindow=void 0,this.actualWindowPromise=void 0,this.send=void 0,this.name=void 0,this.actualWindowPromise=new T,this.serializedWindow=i||Ct(this.actualWindowPromise,{send:r}),j("idToProxyWindow").set(this.getID(),this),o&&this.setWindow(o,{send:r})}var n=e.prototype;return n.getID=function(){return this.serializedWindow.id},n.getType=function(){return this.serializedWindow.getType()},n.isPopup=function(){return this.getType().then(function(t){return t==="popup"})},n.setLocation=function(t,r){var o=this;return this.serializedWindow.setLocation(t,r).then(function(){return o})},n.getName=function(){return this.serializedWindow.getName()},n.setName=function(t){var r=this;return this.serializedWindow.setName(t).then(function(){return r})},n.close=function(){var t=this;return this.serializedWindow.close().then(function(){return t})},n.focus=function(){var t=this,r=this.isPopup(),o=this.getName(),i=T.hash({isPopup:r,name:o}).then(function(c){var u=c.name;c.isPopup&&u&&window.open("",u,"noopener")}),a=this.serializedWindow.focus();return T.all([i,a]).then(function(){return t})},n.isClosed=function(){return this.serializedWindow.isClosed()},n.getWindow=function(){return this.actualWindow},n.setWindow=function(t,r){var o=r.send;this.actualWindow=t,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=Ct(this.actualWindowPromise,{send:o,id:this.getID()}),_("winToProxyWindow").set(t,this)},n.awaitWindow=function(){return this.actualWindowPromise},n.matchWindow=function(t,r){var o=this,i=r.send;return T.try(function(){return o.actualWindow?t===o.actualWindow:T.hash({proxyInstanceID:o.getInstanceID(),knownWindowInstanceID:bt(t,{send:i})}).then(function(a){var c=a.proxyInstanceID===a.knownWindowInstanceID;return c&&o.setWindow(t,{send:i}),c})})},n.unwrap=function(){return this.actualWindow||this},n.getInstanceID=function(){return this.serializedWindow.getInstanceID()},n.shouldClean=function(){return!!(this.actualWindow&&Y(this.actualWindow))},n.serialize=function(){return this.serializedWindow},e.unwrap=function(t){return e.isProxyWindow(t)?t.unwrap():t},e.serialize=function(t,r){var o=r.send;return Ge(),e.toProxyWindow(t,{send:o}).serialize()},e.deserialize=function(t,r){var o=r.send;return Ge(),j("idToProxyWindow").get(t.id)||new e({serializedWindow:t,send:o})},e.isProxyWindow=function(t){return!!(t&&!Pe(t)&&t.isProxyWindow)},e.toProxyWindow=function(t,r){var o=r.send;if(Ge(),e.isProxyWindow(t))return t;var i=t;return _("winToProxyWindow").get(i)||new e({win:i,send:o})},e}();function $e(e,n,t,r,o){var i=_("methodStore"),a=j("proxyWindowMethods");G.isProxyWindow(r)?a.set(e,{val:n,name:t,domain:o,source:r}):(a.del(e),i.getOrSet(r,function(){return{}})[e]={domain:o,name:t,val:n,source:r})}function Pt(e,n){var t=_("methodStore"),r=j("proxyWindowMethods");return t.getOrSet(e,function(){return{}})[n]||r.get(n)}function Tt(e,n,t,r,o){a=(i={on:o.on,send:o.send}).on,c=i.send,j("builtinListeners").getOrSet("functionCalls",function(){return a("postrobot_method",{domain:"*"},function(m){var d=m.source,f=m.origin,v=m.data,b=v.id,x=v.name,S=Pt(d,b);if(!S)throw new Error("Could not find method '"+x+"' with id: "+v.id+" in "+H(window));var R=S.source,M=S.domain,N=S.val;return T.try(function(){if(!ue(M,f))throw new Error("Method '"+v.name+"' domain "+JSON.stringify(_e(S.domain)?S.domain.source:S.domain)+" does not match origin "+f+" in "+H(window));if(G.isProxyWindow(R))return R.matchWindow(d,{send:c}).then(function(A){if(!A)throw new Error("Method call '"+v.name+"' failed - proxy window does not match source in "+H(window))})}).then(function(){return N.apply({source:d,origin:f},v.args)},function(A){return T.try(function(){if(N.onError)return N.onError(A)}).then(function(){throw A.stack&&(A.stack="Remote call to "+x+"("+function(k){return k===void 0&&(k=[]),(W=k,[].slice.call(W)).map(function(D){return typeof D=="string"?"'"+D+"'":D===void 0?"undefined":D===null?"null":typeof D=="boolean"?D.toString():Array.isArray(D)?"[ ... ]":typeof D=="object"?"{ ... }":typeof D=="function"?"() => { ... }":"<"+typeof D+">"}).join(", ");var W}(v.args)+`) failed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soyio/soyio-widget",
3
- "version": "2.11.0",
3
+ "version": "2.11.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",