@soyio/soyio-widget 2.11.0 → 2.11.1
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 +205 -216
- package/dist/index.umd.cjs +14 -23
- package/package.json +1 -1
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,
|
|
3
|
-
var
|
|
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) => (
|
|
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) =>
|
|
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 {
|
|
@@ -78,18 +78,7 @@ 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
|
+
`, this.tooltipContent = document.createElement("div"), this.tooltipContent.style.cssText = "text-align: center;", this.tooltipElement.appendChild(this.tooltipContent), document.body.appendChild(this.tooltipElement);
|
|
93
82
|
}
|
|
94
83
|
setupGlobalListeners() {
|
|
95
84
|
window.addEventListener("scroll", () => this.hide(), !0), window.addEventListener("resize", () => this.hide()), window.addEventListener("orientationchange", () => this.hide());
|
|
@@ -384,13 +373,13 @@ class zn {
|
|
|
384
373
|
animation: shimmer 1.5s infinite;
|
|
385
374
|
border-radius: 0.125rem;
|
|
386
375
|
`, !document.getElementById("skeleton-animation")) {
|
|
387
|
-
const
|
|
388
|
-
|
|
376
|
+
const Z = document.createElement("style");
|
|
377
|
+
Z.id = "skeleton-animation", Z.textContent = `
|
|
389
378
|
@keyframes shimmer {
|
|
390
379
|
0% { background-position: 200% 0; }
|
|
391
380
|
100% { background-position: -200% 0; }
|
|
392
381
|
}
|
|
393
|
-
`, document.head.appendChild(
|
|
382
|
+
`, document.head.appendChild(Z);
|
|
394
383
|
}
|
|
395
384
|
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
385
|
}
|
|
@@ -618,15 +607,15 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
618
607
|
}), g.d(l, "destroy", function() {
|
|
619
608
|
return en;
|
|
620
609
|
}), g.d(l, "serializeMessage", function() {
|
|
621
|
-
return Xt;
|
|
622
|
-
}), g.d(l, "deserializeMessage", function() {
|
|
623
610
|
return Zt;
|
|
611
|
+
}), g.d(l, "deserializeMessage", function() {
|
|
612
|
+
return Xt;
|
|
624
613
|
}), g.d(l, "createProxyWindow", function() {
|
|
625
614
|
return Kt;
|
|
626
615
|
}), g.d(l, "toProxyWindow", function() {
|
|
627
616
|
return Qt;
|
|
628
617
|
}), g.d(l, "on", function() {
|
|
629
|
-
return
|
|
618
|
+
return X;
|
|
630
619
|
}), g.d(l, "once", function() {
|
|
631
620
|
return Jt;
|
|
632
621
|
}), g.d(l, "send", function() {
|
|
@@ -671,7 +660,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
671
660
|
} catch (n) {
|
|
672
661
|
}
|
|
673
662
|
}
|
|
674
|
-
function
|
|
663
|
+
function Z(e) {
|
|
675
664
|
try {
|
|
676
665
|
return !0;
|
|
677
666
|
} catch (n) {
|
|
@@ -690,7 +679,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
690
679
|
return "file://";
|
|
691
680
|
if (t === "about:") {
|
|
692
681
|
var r = B(e);
|
|
693
|
-
return r &&
|
|
682
|
+
return r && Z() ? pe(r) : "about://";
|
|
694
683
|
}
|
|
695
684
|
var o = n.host;
|
|
696
685
|
if (!o)
|
|
@@ -716,14 +705,14 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
716
705
|
} catch (r) {
|
|
717
706
|
}
|
|
718
707
|
try {
|
|
719
|
-
if (j(n) &&
|
|
708
|
+
if (j(n) && Z())
|
|
720
709
|
return !0;
|
|
721
710
|
} catch (r) {
|
|
722
711
|
}
|
|
723
712
|
try {
|
|
724
713
|
if (function(r) {
|
|
725
714
|
return r === void 0 && (r = window), D(r) === "mock:";
|
|
726
|
-
}(n) &&
|
|
715
|
+
}(n) && Z())
|
|
727
716
|
return !0;
|
|
728
717
|
} catch (r) {
|
|
729
718
|
}
|
|
@@ -736,7 +725,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
736
725
|
}(e))
|
|
737
726
|
return !1;
|
|
738
727
|
try {
|
|
739
|
-
if (e === window || j(e) &&
|
|
728
|
+
if (e === window || j(e) && Z() || U(window) === U(e))
|
|
740
729
|
return !0;
|
|
741
730
|
} catch (n) {
|
|
742
731
|
}
|
|
@@ -765,13 +754,13 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
765
754
|
var n = [], t;
|
|
766
755
|
try {
|
|
767
756
|
t = e.frames;
|
|
768
|
-
} catch (
|
|
757
|
+
} catch (u) {
|
|
769
758
|
t = e;
|
|
770
759
|
}
|
|
771
760
|
var r;
|
|
772
761
|
try {
|
|
773
762
|
r = t.length;
|
|
774
|
-
} catch (
|
|
763
|
+
} catch (u) {
|
|
775
764
|
}
|
|
776
765
|
if (r === 0)
|
|
777
766
|
return n;
|
|
@@ -780,7 +769,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
780
769
|
var i = void 0;
|
|
781
770
|
try {
|
|
782
771
|
i = t[o];
|
|
783
|
-
} catch (
|
|
772
|
+
} catch (u) {
|
|
784
773
|
continue;
|
|
785
774
|
}
|
|
786
775
|
n.push(i);
|
|
@@ -788,15 +777,15 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
788
777
|
return n;
|
|
789
778
|
}
|
|
790
779
|
for (var a = 0; a < 100; a++) {
|
|
791
|
-
var
|
|
780
|
+
var c = void 0;
|
|
792
781
|
try {
|
|
793
|
-
|
|
794
|
-
} catch (
|
|
782
|
+
c = t[a];
|
|
783
|
+
} catch (u) {
|
|
795
784
|
return n;
|
|
796
785
|
}
|
|
797
|
-
if (!
|
|
786
|
+
if (!c)
|
|
798
787
|
return n;
|
|
799
|
-
n.push(
|
|
788
|
+
n.push(c);
|
|
800
789
|
}
|
|
801
790
|
return n;
|
|
802
791
|
}
|
|
@@ -837,7 +826,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
837
826
|
try {
|
|
838
827
|
if (o[a] === i)
|
|
839
828
|
return a;
|
|
840
|
-
} catch (
|
|
829
|
+
} catch (c) {
|
|
841
830
|
}
|
|
842
831
|
return -1;
|
|
843
832
|
}(Lt, e);
|
|
@@ -991,19 +980,19 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
991
980
|
function e(t) {
|
|
992
981
|
var r = this;
|
|
993
982
|
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,
|
|
983
|
+
var o, i, a = !1, c = !1, u = !1;
|
|
995
984
|
We();
|
|
996
985
|
try {
|
|
997
986
|
t(function(s) {
|
|
998
|
-
|
|
987
|
+
u ? r.resolve(s) : (a = !0, o = s);
|
|
999
988
|
}, function(s) {
|
|
1000
|
-
|
|
989
|
+
u ? r.reject(s) : (c = !0, i = s);
|
|
1001
990
|
});
|
|
1002
991
|
} catch (s) {
|
|
1003
992
|
se(), this.reject(s);
|
|
1004
993
|
return;
|
|
1005
994
|
}
|
|
1006
|
-
se(),
|
|
995
|
+
se(), u = !0, a ? this.resolve(o) : c && this.reject(i);
|
|
1007
996
|
}
|
|
1008
997
|
}
|
|
1009
998
|
var n = e.prototype;
|
|
@@ -1029,8 +1018,8 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1029
1018
|
qe.push(i), setTimeout(function() {
|
|
1030
1019
|
throw i;
|
|
1031
1020
|
}, 1);
|
|
1032
|
-
for (var
|
|
1033
|
-
ie[
|
|
1021
|
+
for (var c = 0; c < ie.length; c++)
|
|
1022
|
+
ie[c](i, a);
|
|
1034
1023
|
}
|
|
1035
1024
|
}(t, r);
|
|
1036
1025
|
}, 1), this.dispatch(), this;
|
|
@@ -1047,10 +1036,10 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1047
1036
|
b.reject(x);
|
|
1048
1037
|
});
|
|
1049
1038
|
}, a = 0; a < o.length; a++) {
|
|
1050
|
-
var
|
|
1039
|
+
var c = o[a], u = c.onSuccess, s = c.onError, v = c.promise, m = void 0;
|
|
1051
1040
|
if (t)
|
|
1052
1041
|
try {
|
|
1053
|
-
m =
|
|
1042
|
+
m = u ? u(this.value) : this.value;
|
|
1054
1043
|
} catch (w) {
|
|
1055
1044
|
v.reject(w);
|
|
1056
1045
|
continue;
|
|
@@ -1134,27 +1123,27 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1134
1123
|
}, function(p) {
|
|
1135
1124
|
m.reject(p);
|
|
1136
1125
|
});
|
|
1137
|
-
},
|
|
1138
|
-
var
|
|
1139
|
-
if (
|
|
1140
|
-
if (
|
|
1141
|
-
i[
|
|
1126
|
+
}, c = 0; c < t.length; c++) {
|
|
1127
|
+
var u = t[c];
|
|
1128
|
+
if (u instanceof e) {
|
|
1129
|
+
if (u.resolved) {
|
|
1130
|
+
i[c] = u.value, o -= 1;
|
|
1142
1131
|
continue;
|
|
1143
1132
|
}
|
|
1144
|
-
} else if (!ee(
|
|
1145
|
-
i[
|
|
1133
|
+
} else if (!ee(u)) {
|
|
1134
|
+
i[c] = u, o -= 1;
|
|
1146
1135
|
continue;
|
|
1147
1136
|
}
|
|
1148
|
-
a(
|
|
1137
|
+
a(c, e.resolve(u), r);
|
|
1149
1138
|
}
|
|
1150
1139
|
return o === 0 && r.resolve(i), r;
|
|
1151
1140
|
}, e.hash = function(t) {
|
|
1152
|
-
var r = {}, o = [], i = function(
|
|
1153
|
-
if (t.hasOwnProperty(
|
|
1154
|
-
var
|
|
1155
|
-
ee(
|
|
1156
|
-
r[
|
|
1157
|
-
})) : r[
|
|
1141
|
+
var r = {}, o = [], i = function(c) {
|
|
1142
|
+
if (t.hasOwnProperty(c)) {
|
|
1143
|
+
var u = t[c];
|
|
1144
|
+
ee(u) ? o.push(u.then(function(s) {
|
|
1145
|
+
r[c] = s;
|
|
1146
|
+
})) : r[c] = u;
|
|
1158
1147
|
}
|
|
1159
1148
|
};
|
|
1160
1149
|
for (var a in t)
|
|
@@ -1259,8 +1248,8 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1259
1248
|
} catch (v) {
|
|
1260
1249
|
}
|
|
1261
1250
|
this._cleanupClosedWindows();
|
|
1262
|
-
var
|
|
1263
|
-
s === -1 ? (
|
|
1251
|
+
var c = this.keys, u = this.values, s = ge(c, t);
|
|
1252
|
+
s === -1 ? (c.push(t), u.push(r)) : u[s] = r;
|
|
1264
1253
|
}, n.get = function(t) {
|
|
1265
1254
|
if (!t)
|
|
1266
1255
|
throw new Error("WeakMap expected key");
|
|
@@ -1289,14 +1278,14 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1289
1278
|
if (r)
|
|
1290
1279
|
try {
|
|
1291
1280
|
r.delete(t);
|
|
1292
|
-
} catch (
|
|
1281
|
+
} catch (c) {
|
|
1293
1282
|
delete this.weakmap;
|
|
1294
1283
|
}
|
|
1295
1284
|
if (this.isSafeToReadWrite(t))
|
|
1296
1285
|
try {
|
|
1297
1286
|
var o = t[this.name];
|
|
1298
1287
|
o && o[0] === t && (o[0] = o[1] = void 0);
|
|
1299
|
-
} catch (
|
|
1288
|
+
} catch (c) {
|
|
1300
1289
|
}
|
|
1301
1290
|
this._cleanupClosedWindows();
|
|
1302
1291
|
var i = this.keys, a = ge(i, t);
|
|
@@ -1368,15 +1357,15 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1368
1357
|
function jt() {
|
|
1369
1358
|
return {};
|
|
1370
1359
|
}
|
|
1371
|
-
var
|
|
1372
|
-
function
|
|
1360
|
+
var ue = 0, Ye = 0;
|
|
1361
|
+
function ce(e, n) {
|
|
1373
1362
|
n === void 0 && (n = {});
|
|
1374
|
-
var t = n.thisNamespace, r = t !== void 0 && t, o = n.time, i, a,
|
|
1375
|
-
|
|
1376
|
-
var
|
|
1363
|
+
var t = n.thisNamespace, r = t !== void 0 && t, o = n.time, i, a, c = ue;
|
|
1364
|
+
ue += 1;
|
|
1365
|
+
var u = function() {
|
|
1377
1366
|
for (var s = arguments.length, v = new Array(s), m = 0; m < s; m++)
|
|
1378
1367
|
v[m] = arguments[m];
|
|
1379
|
-
|
|
1368
|
+
c < Ye && (i = null, a = null, c = ue, ue += 1);
|
|
1380
1369
|
var p;
|
|
1381
1370
|
p = r ? (a = a || new Ce()).getOrSet(this, jt) : i = i || {};
|
|
1382
1371
|
var w;
|
|
@@ -1394,24 +1383,24 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1394
1383
|
value: S
|
|
1395
1384
|
}, S;
|
|
1396
1385
|
};
|
|
1397
|
-
return
|
|
1386
|
+
return u.reset = function() {
|
|
1398
1387
|
i = null, a = null;
|
|
1399
|
-
}, $e(
|
|
1388
|
+
}, $e(u, (n.name || Be(e)) + "::memoized");
|
|
1400
1389
|
}
|
|
1401
|
-
|
|
1402
|
-
Ye =
|
|
1390
|
+
ce.clear = function() {
|
|
1391
|
+
Ye = ue;
|
|
1403
1392
|
};
|
|
1404
1393
|
function kt(e) {
|
|
1405
1394
|
var n = {};
|
|
1406
1395
|
function t() {
|
|
1407
|
-
for (var r = arguments, o = this, i = arguments.length, a = new Array(i),
|
|
1408
|
-
a[
|
|
1409
|
-
var
|
|
1410
|
-
return n.hasOwnProperty(
|
|
1396
|
+
for (var r = arguments, o = this, i = arguments.length, a = new Array(i), c = 0; c < i; c++)
|
|
1397
|
+
a[c] = arguments[c];
|
|
1398
|
+
var u = Ve(a);
|
|
1399
|
+
return n.hasOwnProperty(u) || (n[u] = C.try(function() {
|
|
1411
1400
|
return e.apply(o, r);
|
|
1412
1401
|
}).finally(function() {
|
|
1413
|
-
delete n[
|
|
1414
|
-
})), n[
|
|
1402
|
+
delete n[u];
|
|
1403
|
+
})), n[u];
|
|
1415
1404
|
}
|
|
1416
1405
|
return t.reset = function() {
|
|
1417
1406
|
n = {};
|
|
@@ -1445,7 +1434,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1445
1434
|
function Je(e) {
|
|
1446
1435
|
return typeof e == "string" ? e : e && e.toString && typeof e.toString == "function" ? e.toString() : {}.toString.call(e);
|
|
1447
1436
|
}
|
|
1448
|
-
|
|
1437
|
+
ce(function(e) {
|
|
1449
1438
|
if (Object.values)
|
|
1450
1439
|
return Object.values(e);
|
|
1451
1440
|
var n = [];
|
|
@@ -1462,29 +1451,29 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1462
1451
|
var r = t();
|
|
1463
1452
|
return e[n] = r, r;
|
|
1464
1453
|
}
|
|
1465
|
-
function
|
|
1454
|
+
function Ze() {
|
|
1466
1455
|
var e = document.body;
|
|
1467
1456
|
if (!e)
|
|
1468
1457
|
throw new Error("Body element not found");
|
|
1469
1458
|
return e;
|
|
1470
1459
|
}
|
|
1471
|
-
function
|
|
1460
|
+
function Xe() {
|
|
1472
1461
|
return !!document.body && document.readyState === "complete";
|
|
1473
1462
|
}
|
|
1474
1463
|
function Ke() {
|
|
1475
1464
|
return !!document.body && document.readyState === "interactive";
|
|
1476
1465
|
}
|
|
1477
|
-
|
|
1466
|
+
ce(function() {
|
|
1478
1467
|
return new C(function(e) {
|
|
1479
|
-
if (
|
|
1468
|
+
if (Xe() || Ke())
|
|
1480
1469
|
return e();
|
|
1481
1470
|
var n = setInterval(function() {
|
|
1482
|
-
if (
|
|
1471
|
+
if (Xe() || Ke())
|
|
1483
1472
|
return clearInterval(n), e();
|
|
1484
1473
|
}, 10);
|
|
1485
1474
|
});
|
|
1486
1475
|
});
|
|
1487
|
-
var Ee = typeof document != "undefined" ? document.currentScript : null, Ut =
|
|
1476
|
+
var Ee = typeof document != "undefined" ? document.currentScript : null, Ut = ce(function() {
|
|
1488
1477
|
if (Ee || (Ee = function() {
|
|
1489
1478
|
try {
|
|
1490
1479
|
var e = function() {
|
|
@@ -1507,7 +1496,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1507
1496
|
return Ee;
|
|
1508
1497
|
throw new Error("Can not determine current script");
|
|
1509
1498
|
}), Ft = Y();
|
|
1510
|
-
|
|
1499
|
+
ce(function() {
|
|
1511
1500
|
var e;
|
|
1512
1501
|
try {
|
|
1513
1502
|
e = Ut();
|
|
@@ -1724,19 +1713,19 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1724
1713
|
}
|
|
1725
1714
|
}
|
|
1726
1715
|
function it(e, n) {
|
|
1727
|
-
var t = n.send, r = n.id, o = r === void 0 ? Y() : r, i = e.then(function(
|
|
1728
|
-
if (Q(
|
|
1729
|
-
return ve(
|
|
1730
|
-
}), a = e.then(function(
|
|
1731
|
-
if ($(
|
|
1716
|
+
var t = n.send, r = n.id, o = r === void 0 ? Y() : r, i = e.then(function(u) {
|
|
1717
|
+
if (Q(u))
|
|
1718
|
+
return ve(u).name;
|
|
1719
|
+
}), a = e.then(function(u) {
|
|
1720
|
+
if ($(u))
|
|
1732
1721
|
throw new Error("Window is closed, can not determine type");
|
|
1733
|
-
return oe(
|
|
1722
|
+
return oe(u) ? "popup" : "iframe";
|
|
1734
1723
|
});
|
|
1735
1724
|
i.catch(te), a.catch(te);
|
|
1736
|
-
var
|
|
1737
|
-
return e.then(function(
|
|
1738
|
-
if (!$(
|
|
1739
|
-
return Q(
|
|
1725
|
+
var c = function() {
|
|
1726
|
+
return e.then(function(u) {
|
|
1727
|
+
if (!$(u))
|
|
1728
|
+
return Q(u) ? ve(u).name : i;
|
|
1740
1729
|
});
|
|
1741
1730
|
};
|
|
1742
1731
|
return {
|
|
@@ -1745,8 +1734,8 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1745
1734
|
return a;
|
|
1746
1735
|
},
|
|
1747
1736
|
getInstanceID: kt(function() {
|
|
1748
|
-
return e.then(function(
|
|
1749
|
-
return nt(
|
|
1737
|
+
return e.then(function(u) {
|
|
1738
|
+
return nt(u, {
|
|
1750
1739
|
send: t
|
|
1751
1740
|
});
|
|
1752
1741
|
});
|
|
@@ -1754,26 +1743,26 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1754
1743
|
close: function() {
|
|
1755
1744
|
return e.then(Mt);
|
|
1756
1745
|
},
|
|
1757
|
-
getName:
|
|
1746
|
+
getName: c,
|
|
1758
1747
|
focus: function() {
|
|
1759
|
-
return e.then(function(
|
|
1760
|
-
|
|
1748
|
+
return e.then(function(u) {
|
|
1749
|
+
u.focus();
|
|
1761
1750
|
});
|
|
1762
1751
|
},
|
|
1763
1752
|
isClosed: function() {
|
|
1764
|
-
return e.then(function(
|
|
1765
|
-
return $(
|
|
1753
|
+
return e.then(function(u) {
|
|
1754
|
+
return $(u);
|
|
1766
1755
|
});
|
|
1767
1756
|
},
|
|
1768
|
-
setLocation: function(
|
|
1757
|
+
setLocation: function(u, s) {
|
|
1769
1758
|
return s === void 0 && (s = {}), e.then(function(v) {
|
|
1770
1759
|
var m = window.location.protocol + "//" + window.location.host, p = s.method, w = p === void 0 ? "get" : p, b = s.body;
|
|
1771
|
-
if (
|
|
1772
|
-
|
|
1773
|
-
else if (!
|
|
1774
|
-
throw new Error("Expected url to be http or https url, or absolute path, got " + JSON.stringify(
|
|
1760
|
+
if (u.indexOf("/") === 0)
|
|
1761
|
+
u = "" + m + u;
|
|
1762
|
+
else if (!u.match(/^https?:\/\//) && u.indexOf(m) !== 0)
|
|
1763
|
+
throw new Error("Expected url to be http or https url, or absolute path, got " + JSON.stringify(u));
|
|
1775
1764
|
if (w === "post")
|
|
1776
|
-
return
|
|
1765
|
+
return c().then(function(x) {
|
|
1777
1766
|
if (!x)
|
|
1778
1767
|
throw new Error("Can not post to window without target name");
|
|
1779
1768
|
(function(S) {
|
|
@@ -1783,9 +1772,9 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1783
1772
|
var N, he = V[A], Le = document.createElement("input");
|
|
1784
1773
|
Le.setAttribute("name", he), Le.setAttribute("value", (N = R[he]) == null ? void 0 : N.toString()), W.appendChild(Le);
|
|
1785
1774
|
}
|
|
1786
|
-
|
|
1775
|
+
Ze().appendChild(W), W.submit(), Ze().removeChild(W);
|
|
1787
1776
|
})({
|
|
1788
|
-
url:
|
|
1777
|
+
url: u,
|
|
1789
1778
|
target: x,
|
|
1790
1779
|
method: w,
|
|
1791
1780
|
body: b
|
|
@@ -1796,20 +1785,20 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1796
1785
|
if (Q(v))
|
|
1797
1786
|
try {
|
|
1798
1787
|
if (v.location && typeof v.location.replace == "function") {
|
|
1799
|
-
v.location.replace(
|
|
1788
|
+
v.location.replace(u);
|
|
1800
1789
|
return;
|
|
1801
1790
|
}
|
|
1802
1791
|
} catch (x) {
|
|
1803
1792
|
}
|
|
1804
|
-
v.location =
|
|
1793
|
+
v.location = u;
|
|
1805
1794
|
});
|
|
1806
1795
|
},
|
|
1807
|
-
setName: function(
|
|
1796
|
+
setName: function(u) {
|
|
1808
1797
|
return e.then(function(s) {
|
|
1809
1798
|
var v = Q(s), m = _e(s);
|
|
1810
1799
|
if (!v)
|
|
1811
|
-
throw new Error("Can not set name for cross-domain window: " +
|
|
1812
|
-
ve(s).name =
|
|
1800
|
+
throw new Error("Can not set name for cross-domain window: " + u);
|
|
1801
|
+
ve(s).name = u, m && m.setAttribute("name", u), i = C.resolve(u);
|
|
1813
1802
|
});
|
|
1814
1803
|
}
|
|
1815
1804
|
};
|
|
@@ -1853,9 +1842,9 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1853
1842
|
var t = this, r = this.isPopup(), o = this.getName(), i = C.hash({
|
|
1854
1843
|
isPopup: r,
|
|
1855
1844
|
name: o
|
|
1856
|
-
}).then(function(
|
|
1857
|
-
var
|
|
1858
|
-
|
|
1845
|
+
}).then(function(c) {
|
|
1846
|
+
var u = c.name;
|
|
1847
|
+
c.isPopup && u && window.open("", u, "noopener");
|
|
1859
1848
|
}), a = this.serializedWindow.focus();
|
|
1860
1849
|
return C.all([i, a]).then(function() {
|
|
1861
1850
|
return t;
|
|
@@ -1881,10 +1870,10 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1881
1870
|
send: i
|
|
1882
1871
|
})
|
|
1883
1872
|
}).then(function(a) {
|
|
1884
|
-
var
|
|
1885
|
-
return
|
|
1873
|
+
var c = a.proxyInstanceID === a.knownWindowInstanceID;
|
|
1874
|
+
return c && o.setWindow(t, {
|
|
1886
1875
|
send: i
|
|
1887
|
-
}),
|
|
1876
|
+
}), c;
|
|
1888
1877
|
});
|
|
1889
1878
|
});
|
|
1890
1879
|
}, n.unwrap = function() {
|
|
@@ -1947,7 +1936,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1947
1936
|
a = (i = {
|
|
1948
1937
|
on: o.on,
|
|
1949
1938
|
send: o.send
|
|
1950
|
-
}).on,
|
|
1939
|
+
}).on, c = i.send, z("builtinListeners").getOrSet("functionCalls", function() {
|
|
1951
1940
|
return a("postrobot_method", {
|
|
1952
1941
|
domain: "*"
|
|
1953
1942
|
}, function(v) {
|
|
@@ -1960,7 +1949,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1960
1949
|
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
1950
|
if (q.isProxyWindow(P))
|
|
1962
1951
|
return P.matchWindow(m, {
|
|
1963
|
-
send:
|
|
1952
|
+
send: c
|
|
1964
1953
|
}).then(function(T) {
|
|
1965
1954
|
if (!T)
|
|
1966
1955
|
throw new Error("Method call '" + w.name + "' failed - proxy window does not match source in " + U(window));
|
|
@@ -1993,32 +1982,32 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
1993
1982
|
});
|
|
1994
1983
|
});
|
|
1995
1984
|
});
|
|
1996
|
-
var i, a,
|
|
1985
|
+
var i, a, c, u = t.__id__ || Y();
|
|
1997
1986
|
e = q.unwrap(e);
|
|
1998
1987
|
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(
|
|
2000
|
-
Oe(
|
|
2001
|
-
})) : Oe(
|
|
2002
|
-
id:
|
|
1988
|
+
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) {
|
|
1989
|
+
Oe(u, t, s, v, n);
|
|
1990
|
+
})) : Oe(u, t, s, e, n), ne("cross_domain_function", {
|
|
1991
|
+
id: u,
|
|
2003
1992
|
name: s
|
|
2004
1993
|
});
|
|
2005
1994
|
}
|
|
2006
|
-
function
|
|
1995
|
+
function ut(e, n, t, r) {
|
|
2007
1996
|
var o, i = r.on, a = r.send;
|
|
2008
|
-
return function(
|
|
2009
|
-
|
|
2010
|
-
var s = JSON.stringify(
|
|
1997
|
+
return function(c, u) {
|
|
1998
|
+
u === void 0 && (u = qt);
|
|
1999
|
+
var s = JSON.stringify(c, function(v) {
|
|
2011
2000
|
var m = this[v];
|
|
2012
2001
|
if (Re(this))
|
|
2013
2002
|
return m;
|
|
2014
2003
|
var p = ot(m);
|
|
2015
2004
|
if (!p)
|
|
2016
2005
|
return m;
|
|
2017
|
-
var w =
|
|
2006
|
+
var w = u[p] || _t[p];
|
|
2018
2007
|
return w ? w(m, v) : m;
|
|
2019
2008
|
});
|
|
2020
2009
|
return s === void 0 ? "undefined" : s;
|
|
2021
|
-
}(t, ((o = {}).promise = function(
|
|
2010
|
+
}(t, ((o = {}).promise = function(c, u) {
|
|
2022
2011
|
return function(s, v, m, p, w) {
|
|
2023
2012
|
return ne("cross_domain_zalgo_promise", {
|
|
2024
2013
|
then: st(s, v, function(b, x) {
|
|
@@ -2028,45 +2017,45 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2028
2017
|
send: w.send
|
|
2029
2018
|
})
|
|
2030
2019
|
});
|
|
2031
|
-
}(e, n,
|
|
2020
|
+
}(e, n, c, u, {
|
|
2032
2021
|
on: i,
|
|
2033
2022
|
send: a
|
|
2034
2023
|
});
|
|
2035
|
-
}, o.function = function(
|
|
2036
|
-
return st(e, n,
|
|
2024
|
+
}, o.function = function(c, u) {
|
|
2025
|
+
return st(e, n, c, u, {
|
|
2037
2026
|
on: i,
|
|
2038
2027
|
send: a
|
|
2039
2028
|
});
|
|
2040
|
-
}, o.object = function(
|
|
2041
|
-
return we(
|
|
2029
|
+
}, o.object = function(c) {
|
|
2030
|
+
return we(c) || q.isProxyWindow(c) ? ne("cross_domain_window", q.serialize(c, {
|
|
2042
2031
|
send: a
|
|
2043
|
-
})) :
|
|
2032
|
+
})) : c;
|
|
2044
2033
|
}, o));
|
|
2045
2034
|
}
|
|
2046
|
-
function
|
|
2035
|
+
function ct(e, n, t, r) {
|
|
2047
2036
|
var o, i = r.send;
|
|
2048
|
-
return function(a,
|
|
2049
|
-
if (
|
|
2050
|
-
return JSON.parse(a, function(
|
|
2037
|
+
return function(a, c) {
|
|
2038
|
+
if (c === void 0 && (c = Bt), a !== "undefined")
|
|
2039
|
+
return JSON.parse(a, function(u, s) {
|
|
2051
2040
|
if (Re(this))
|
|
2052
2041
|
return s;
|
|
2053
2042
|
var v, m;
|
|
2054
2043
|
if (Re(s) ? (v = s.__type__, m = s.__val__) : (v = ot(s), m = s), !v)
|
|
2055
2044
|
return m;
|
|
2056
|
-
var p =
|
|
2057
|
-
return p ? p(m,
|
|
2045
|
+
var p = c[v] || Gt[v];
|
|
2046
|
+
return p ? p(m, u) : m;
|
|
2058
2047
|
});
|
|
2059
2048
|
}(t, ((o = {}).cross_domain_zalgo_promise = function(a) {
|
|
2060
|
-
return function(
|
|
2049
|
+
return function(c, u, s) {
|
|
2061
2050
|
return new C(s.then);
|
|
2062
2051
|
}(0, 0, a);
|
|
2063
2052
|
}, o.cross_domain_function = function(a) {
|
|
2064
|
-
return function(
|
|
2053
|
+
return function(c, u, s, v) {
|
|
2065
2054
|
var m = s.id, p = s.name, w = v.send, b = function(S) {
|
|
2066
2055
|
S === void 0 && (S = {});
|
|
2067
2056
|
function P() {
|
|
2068
2057
|
var L = arguments;
|
|
2069
|
-
return q.toProxyWindow(
|
|
2058
|
+
return q.toProxyWindow(c, {
|
|
2070
2059
|
send: w
|
|
2071
2060
|
}).awaitWindow().then(function(R) {
|
|
2072
2061
|
var T = at(R, m);
|
|
@@ -2081,14 +2070,14 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2081
2070
|
name: p,
|
|
2082
2071
|
args: M
|
|
2083
2072
|
}, {
|
|
2084
|
-
domain:
|
|
2073
|
+
domain: u,
|
|
2085
2074
|
fireAndForget: !0
|
|
2086
2075
|
}) : w(R, "postrobot_method", {
|
|
2087
2076
|
id: m,
|
|
2088
2077
|
name: p,
|
|
2089
2078
|
args: M
|
|
2090
2079
|
}, {
|
|
2091
|
-
domain:
|
|
2080
|
+
domain: u,
|
|
2092
2081
|
fireAndForget: !1
|
|
2093
2082
|
}).then(function(W) {
|
|
2094
2083
|
return W.data.result;
|
|
@@ -2097,7 +2086,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2097
2086
|
throw R;
|
|
2098
2087
|
});
|
|
2099
2088
|
}
|
|
2100
|
-
return P.__name__ = p, P.__origin__ =
|
|
2089
|
+
return P.__name__ = p, P.__origin__ = u, P.__source__ = c, P.__id__ = m, P.origin = u, P;
|
|
2101
2090
|
}, x = b();
|
|
2102
2091
|
return x.fireAndForget = b({
|
|
2103
2092
|
fireAndForget: !0
|
|
@@ -2124,15 +2113,15 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2124
2113
|
return a.buffer = a.buffer || [], a.buffer.push(t), a.flush = a.flush || C.flush().then(function() {
|
|
2125
2114
|
if ($(e))
|
|
2126
2115
|
throw new Error("Window is closed");
|
|
2127
|
-
var
|
|
2116
|
+
var c = ut(e, n, ((u = {}).__post_robot_10_0_46__ = a.buffer || [], u), {
|
|
2128
2117
|
on: o,
|
|
2129
2118
|
send: i
|
|
2130
|
-
}),
|
|
2119
|
+
}), u;
|
|
2131
2120
|
delete a.buffer;
|
|
2132
2121
|
for (var s = Object.keys(Ne), v = [], m = 0; m < s.length; m++) {
|
|
2133
2122
|
var p = s[m];
|
|
2134
2123
|
try {
|
|
2135
|
-
Ne[p](e,
|
|
2124
|
+
Ne[p](e, c, n);
|
|
2136
2125
|
} catch (w) {
|
|
2137
2126
|
v.push(w);
|
|
2138
2127
|
}
|
|
@@ -2164,11 +2153,11 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2164
2153
|
if (t === "*" && (t = null), r === "*" && (r = null), !n)
|
|
2165
2154
|
throw new Error("Name required to get request listener");
|
|
2166
2155
|
for (var i = 0, a = [t, xe()]; i < a.length; i++) {
|
|
2167
|
-
var
|
|
2168
|
-
if (
|
|
2169
|
-
var
|
|
2170
|
-
if (
|
|
2171
|
-
var s =
|
|
2156
|
+
var c = a[i];
|
|
2157
|
+
if (c) {
|
|
2158
|
+
var u = o.get(c);
|
|
2159
|
+
if (u) {
|
|
2160
|
+
var s = u[n];
|
|
2172
2161
|
if (s) {
|
|
2173
2162
|
if (r && typeof r == "string") {
|
|
2174
2163
|
if (s[r])
|
|
@@ -2192,8 +2181,8 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2192
2181
|
name: t.name,
|
|
2193
2182
|
win: e,
|
|
2194
2183
|
domain: n
|
|
2195
|
-
}),
|
|
2196
|
-
function
|
|
2184
|
+
}), c = t.name === "postrobot_method" && t.data && typeof t.data.name == "string" ? t.data.name + "()" : t.name;
|
|
2185
|
+
function u(s, v, m) {
|
|
2197
2186
|
return C.flush().then(function() {
|
|
2198
2187
|
if (!t.fireAndForget && !$(e))
|
|
2199
2188
|
try {
|
|
@@ -2211,7 +2200,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2211
2200
|
send: i
|
|
2212
2201
|
});
|
|
2213
2202
|
} catch (p) {
|
|
2214
|
-
throw new Error("Send response message failed for " +
|
|
2203
|
+
throw new Error("Send response message failed for " + c + " in " + U() + `
|
|
2215
2204
|
|
|
2216
2205
|
` + de(p));
|
|
2217
2206
|
}
|
|
@@ -2231,7 +2220,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2231
2220
|
send: i
|
|
2232
2221
|
});
|
|
2233
2222
|
} catch (s) {
|
|
2234
|
-
throw new Error("Send ack message failed for " +
|
|
2223
|
+
throw new Error("Send ack message failed for " + c + " in " + U() + `
|
|
2235
2224
|
|
|
2236
2225
|
` + de(s));
|
|
2237
2226
|
}
|
|
@@ -2244,9 +2233,9 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2244
2233
|
data: t.data
|
|
2245
2234
|
});
|
|
2246
2235
|
}).then(function(s) {
|
|
2247
|
-
return
|
|
2236
|
+
return u("success", s);
|
|
2248
2237
|
}, function(s) {
|
|
2249
|
-
return
|
|
2238
|
+
return u("error", null, s);
|
|
2250
2239
|
})]).then(te).catch(function(s) {
|
|
2251
2240
|
if (a && a.handleError)
|
|
2252
2241
|
return a.handleError(s);
|
|
@@ -2294,10 +2283,10 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2294
2283
|
} catch (v) {
|
|
2295
2284
|
return;
|
|
2296
2285
|
}
|
|
2297
|
-
var i = e.source, a = e.origin,
|
|
2286
|
+
var i = e.source, a = e.origin, c = function(v, m, p, w) {
|
|
2298
2287
|
var b = w.on, x = w.send, S;
|
|
2299
2288
|
try {
|
|
2300
|
-
S =
|
|
2289
|
+
S = ct(m, p, v, {
|
|
2301
2290
|
on: b,
|
|
2302
2291
|
send: x
|
|
2303
2292
|
});
|
|
@@ -2313,10 +2302,10 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2313
2302
|
on: t,
|
|
2314
2303
|
send: r
|
|
2315
2304
|
});
|
|
2316
|
-
if (
|
|
2305
|
+
if (c) {
|
|
2317
2306
|
rt(i);
|
|
2318
|
-
for (var
|
|
2319
|
-
var s = u
|
|
2307
|
+
for (var u = 0; u < c.length; u++) {
|
|
2308
|
+
var s = c[u];
|
|
2320
2309
|
if (o.has(s.id) || (o.set(s.id, !0), $(i) && !s.fireAndForget))
|
|
2321
2310
|
return;
|
|
2322
2311
|
s.origin.indexOf("file:") === 0 && (a = "file://");
|
|
@@ -2333,19 +2322,19 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2333
2322
|
}
|
|
2334
2323
|
}
|
|
2335
2324
|
}
|
|
2336
|
-
function
|
|
2325
|
+
function X(e, n, t) {
|
|
2337
2326
|
if (!e)
|
|
2338
2327
|
throw new Error("Expected name");
|
|
2339
2328
|
if (typeof (n = n || {}) == "function" && (t = n, n = {}), !t)
|
|
2340
2329
|
throw new Error("Expected handler");
|
|
2341
2330
|
var r = function o(i, a) {
|
|
2342
|
-
var
|
|
2343
|
-
if (!
|
|
2331
|
+
var c = i.name, u = i.win, s = i.domain, v = F("requestListeners");
|
|
2332
|
+
if (!c || typeof c != "string")
|
|
2344
2333
|
throw new Error("Name required to add request listener");
|
|
2345
|
-
if (
|
|
2346
|
-
var m =
|
|
2334
|
+
if (u && u !== "*" && q.isProxyWindow(u)) {
|
|
2335
|
+
var m = u.awaitWindow().then(function(N) {
|
|
2347
2336
|
return o({
|
|
2348
|
-
name:
|
|
2337
|
+
name: c,
|
|
2349
2338
|
win: N,
|
|
2350
2339
|
domain: s
|
|
2351
2340
|
}, a);
|
|
@@ -2358,11 +2347,11 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2358
2347
|
}
|
|
2359
2348
|
};
|
|
2360
2349
|
}
|
|
2361
|
-
var p =
|
|
2350
|
+
var p = u;
|
|
2362
2351
|
if (Array.isArray(p)) {
|
|
2363
2352
|
for (var w = [], b = 0, x = p; b < x.length; b++)
|
|
2364
2353
|
w.push(o({
|
|
2365
|
-
name:
|
|
2354
|
+
name: c,
|
|
2366
2355
|
domain: s,
|
|
2367
2356
|
win: x[b]
|
|
2368
2357
|
}, a));
|
|
@@ -2376,7 +2365,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2376
2365
|
if (Array.isArray(s)) {
|
|
2377
2366
|
for (var S = [], P = 0, L = s; P < L.length; P++)
|
|
2378
2367
|
S.push(o({
|
|
2379
|
-
name:
|
|
2368
|
+
name: c,
|
|
2380
2369
|
win: p,
|
|
2381
2370
|
domain: L[P]
|
|
2382
2371
|
}, a));
|
|
@@ -2388,17 +2377,17 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2388
2377
|
};
|
|
2389
2378
|
}
|
|
2390
2379
|
var R = ht({
|
|
2391
|
-
name:
|
|
2380
|
+
name: c,
|
|
2392
2381
|
win: p,
|
|
2393
2382
|
domain: s
|
|
2394
2383
|
});
|
|
2395
2384
|
p && p !== "*" || (p = xe());
|
|
2396
2385
|
var T = (s = s || "*").toString();
|
|
2397
2386
|
if (R)
|
|
2398
|
-
throw p && s ? new Error("Request listener already exists for " +
|
|
2387
|
+
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
2388
|
var M = v.getOrSet(p, function() {
|
|
2400
2389
|
return {};
|
|
2401
|
-
}), W = fe(M,
|
|
2390
|
+
}), W = fe(M, c, function() {
|
|
2402
2391
|
return {};
|
|
2403
2392
|
}), A, V;
|
|
2404
2393
|
return Pe(s) ? (A = fe(W, "__domain_regex__", function() {
|
|
@@ -2408,7 +2397,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2408
2397
|
listener: a
|
|
2409
2398
|
}) : W[T] = a, {
|
|
2410
2399
|
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[
|
|
2400
|
+
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
2401
|
}
|
|
2413
2402
|
};
|
|
2414
2403
|
}({
|
|
@@ -2432,13 +2421,13 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2432
2421
|
var r = new C(), o;
|
|
2433
2422
|
return n.errorHandler = function(i) {
|
|
2434
2423
|
o.cancel(), r.reject(i);
|
|
2435
|
-
}, o =
|
|
2424
|
+
}, o = X(e, n, function(i) {
|
|
2436
2425
|
if (o.cancel(), r.resolve(i), t)
|
|
2437
2426
|
return t(i);
|
|
2438
2427
|
}), r.cancel = o.cancel, r;
|
|
2439
2428
|
}
|
|
2440
2429
|
var K = function e(n, t, r, o) {
|
|
2441
|
-
var i = (o = o || {}).domain || "*", a = o.timeout || -1,
|
|
2430
|
+
var i = (o = o || {}).domain || "*", a = o.timeout || -1, c = o.timeout || 5e3, u = o.fireAndForget || !1;
|
|
2442
2431
|
return q.toProxyWindow(n, {
|
|
2443
2432
|
send: e
|
|
2444
2433
|
}).awaitWindow().then(function(s) {
|
|
@@ -2506,7 +2495,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2506
2495
|
});
|
|
2507
2496
|
}(v);
|
|
2508
2497
|
return m !== -1 && (w = w.timeout(m, new Error(p + " did not load after " + m + "ms"))), w;
|
|
2509
|
-
}(s,
|
|
2498
|
+
}(s, c);
|
|
2510
2499
|
}).then(function(v) {
|
|
2511
2500
|
return function(m, p, w, b) {
|
|
2512
2501
|
var x = b.send;
|
|
@@ -2528,7 +2517,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2528
2517
|
});
|
|
2529
2518
|
}).then(function(v) {
|
|
2530
2519
|
var m = v, p = t === "postrobot_method" && r && typeof r.name == "string" ? r.name + "()" : t, w = new C(), b = t + "_" + Y();
|
|
2531
|
-
if (!
|
|
2520
|
+
if (!u) {
|
|
2532
2521
|
var x = {
|
|
2533
2522
|
name: t,
|
|
2534
2523
|
win: s,
|
|
@@ -2577,12 +2566,12 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2577
2566
|
hash: b,
|
|
2578
2567
|
name: t,
|
|
2579
2568
|
data: r,
|
|
2580
|
-
fireAndForget:
|
|
2569
|
+
fireAndForget: u
|
|
2581
2570
|
}, {
|
|
2582
|
-
on:
|
|
2571
|
+
on: X,
|
|
2583
2572
|
send: e
|
|
2584
2573
|
}).then(function() {
|
|
2585
|
-
return
|
|
2574
|
+
return u ? w.resolve() : w;
|
|
2586
2575
|
}, function(W) {
|
|
2587
2576
|
throw new Error("Send request message failed for " + p + " in " + U() + `
|
|
2588
2577
|
|
|
@@ -2591,15 +2580,15 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2591
2580
|
});
|
|
2592
2581
|
});
|
|
2593
2582
|
};
|
|
2594
|
-
function
|
|
2595
|
-
return
|
|
2596
|
-
on:
|
|
2583
|
+
function Zt(e, n, t) {
|
|
2584
|
+
return ut(e, n, t, {
|
|
2585
|
+
on: X,
|
|
2597
2586
|
send: K
|
|
2598
2587
|
});
|
|
2599
2588
|
}
|
|
2600
|
-
function
|
|
2601
|
-
return
|
|
2602
|
-
on:
|
|
2589
|
+
function Xt(e, n, t) {
|
|
2590
|
+
return ct(e, n, t, {
|
|
2591
|
+
on: X,
|
|
2603
2592
|
send: K
|
|
2604
2593
|
});
|
|
2605
2594
|
}
|
|
@@ -2616,7 +2605,7 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2616
2605
|
}
|
|
2617
2606
|
function pt() {
|
|
2618
2607
|
le().initialized || (le().initialized = !0, n = (e = {
|
|
2619
|
-
on:
|
|
2608
|
+
on: X,
|
|
2620
2609
|
send: K
|
|
2621
2610
|
}).on, t = e.send, (r = le()).receiveMessage = r.receiveMessage || function(o) {
|
|
2622
2611
|
return mt(o, {
|
|
@@ -2626,17 +2615,17 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2626
2615
|
}, function(o) {
|
|
2627
2616
|
var i = o.on, a = o.send;
|
|
2628
2617
|
z().getOrSet("postMessageListener", function() {
|
|
2629
|
-
return function(
|
|
2630
|
-
return
|
|
2618
|
+
return function(c, u, s) {
|
|
2619
|
+
return c.addEventListener("message", s), {
|
|
2631
2620
|
cancel: function() {
|
|
2632
|
-
|
|
2621
|
+
c.removeEventListener("message", s);
|
|
2633
2622
|
}
|
|
2634
2623
|
};
|
|
2635
|
-
}(window, 0, function(
|
|
2636
|
-
(function(
|
|
2624
|
+
}(window, 0, function(c) {
|
|
2625
|
+
(function(u, s) {
|
|
2637
2626
|
var v = s.on, m = s.send;
|
|
2638
2627
|
C.try(function() {
|
|
2639
|
-
var p =
|
|
2628
|
+
var p = u.source || u.sourceElement, w = u.origin || u.originalEvent && u.originalEvent.origin, b = u.data;
|
|
2640
2629
|
if (w === "null" && (w = "file://"), p) {
|
|
2641
2630
|
if (!w)
|
|
2642
2631
|
throw new Error("Post message did not have origin domain");
|
|
@@ -2650,19 +2639,19 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2650
2639
|
});
|
|
2651
2640
|
}
|
|
2652
2641
|
});
|
|
2653
|
-
})(
|
|
2642
|
+
})(c, {
|
|
2654
2643
|
on: i,
|
|
2655
2644
|
send: a
|
|
2656
2645
|
});
|
|
2657
2646
|
});
|
|
2658
2647
|
});
|
|
2659
2648
|
}({
|
|
2660
|
-
on:
|
|
2649
|
+
on: X,
|
|
2661
2650
|
send: K
|
|
2662
2651
|
}), function(o) {
|
|
2663
2652
|
var i = o.on, a = o.send;
|
|
2664
2653
|
z("builtinListeners").getOrSet("helloListener", function() {
|
|
2665
|
-
var
|
|
2654
|
+
var c = i("postrobot_hello", {
|
|
2666
2655
|
domain: "*"
|
|
2667
2656
|
}, function(s) {
|
|
2668
2657
|
return tt(s.source, {
|
|
@@ -2670,14 +2659,14 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2670
2659
|
}), {
|
|
2671
2660
|
instanceID: et()
|
|
2672
2661
|
};
|
|
2673
|
-
}),
|
|
2674
|
-
return
|
|
2662
|
+
}), u = He();
|
|
2663
|
+
return u && Te(u, {
|
|
2675
2664
|
send: a
|
|
2676
2665
|
}).catch(function(s) {
|
|
2677
|
-
}),
|
|
2666
|
+
}), c;
|
|
2678
2667
|
});
|
|
2679
2668
|
}({
|
|
2680
|
-
on:
|
|
2669
|
+
on: X,
|
|
2681
2670
|
send: K
|
|
2682
2671
|
}));
|
|
2683
2672
|
var e, n, t, r;
|
|
@@ -2701,14 +2690,14 @@ var Ot = { exports: {} }, Nt = { exports: {} };
|
|
|
2701
2690
|
}]);
|
|
2702
2691
|
});
|
|
2703
2692
|
})(Nt);
|
|
2704
|
-
var
|
|
2693
|
+
var Zn = Nt.exports;
|
|
2705
2694
|
(function(d) {
|
|
2706
|
-
d.exports =
|
|
2695
|
+
d.exports = Zn, d.exports.default = d.exports;
|
|
2707
2696
|
})(Ot);
|
|
2708
2697
|
var Dt = Ot.exports;
|
|
2709
|
-
const
|
|
2698
|
+
const Xn = /* @__PURE__ */ Jn(Dt), ke = /* @__PURE__ */ fn({
|
|
2710
2699
|
__proto__: null,
|
|
2711
|
-
default:
|
|
2700
|
+
default: Xn
|
|
2712
2701
|
}, [Dt]);
|
|
2713
2702
|
export {
|
|
2714
2703
|
Rt as ConsentBox,
|
package/dist/index.umd.cjs
CHANGED
|
@@ -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,
|
|
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}`);p==null||p.remove(),this.tooltipElement=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.
|
|
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
|
+
`,this.tooltipContent=document.createElement("div"),this.tooltipContent.style.cssText="text-align: center;",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
|
-
`,
|
|
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: ${
|
|
38
|
-
max-width: ${
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
134
|
-
width=${
|
|
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=${
|
|
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
|