@soyio/soyio-widget 0.0.6 → 0.0.7
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/constants.d.ts +1 -1
- package/dist/index.js +24 -24
- package/dist/index.umd.cjs +4 -4
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const CONTAINER_ID = "soyio-widget-iframe-container";
|
|
2
|
-
export declare const DEVELOPMENT_WIDGET_URL = "
|
|
2
|
+
export declare const DEVELOPMENT_WIDGET_URL = "https://pl-soyio-staging-7a391ba45b99.herokuapp.com/widget";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var jr = Object.defineProperty;
|
|
2
2
|
var Cr = (E, z, F) => z in E ? jr(E, z, { enumerable: !0, configurable: !0, writable: !0, value: F }) : E[z] = F;
|
|
3
3
|
var pn = (E, z, F) => (Cr(E, typeof z != "symbol" ? z + "" : z, F), F);
|
|
4
|
-
const Mr = "soyio-widget-iframe-container", Tr = "
|
|
4
|
+
const Mr = "soyio-widget-iframe-container", Tr = "https://pl-soyio-staging-7a391ba45b99.herokuapp.com/widget", Lr = Tr;
|
|
5
5
|
function Fr() {
|
|
6
6
|
return document.getElementById(Mr);
|
|
7
7
|
}
|
|
@@ -93,7 +93,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
93
93
|
}), g.d(A, "send", function() {
|
|
94
94
|
return Z;
|
|
95
95
|
}), g.d(A, "markWindowKnown", function() {
|
|
96
|
-
return
|
|
96
|
+
return Kn;
|
|
97
97
|
}), g.d(A, "cleanUpWindow", function() {
|
|
98
98
|
return Nr;
|
|
99
99
|
}), g.d(A, "bridge", function() {
|
|
@@ -878,7 +878,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
878
878
|
t = {};
|
|
879
879
|
}, Fn(r, Ln(n) + "::promiseMemoized");
|
|
880
880
|
}
|
|
881
|
-
function
|
|
881
|
+
function k() {
|
|
882
882
|
}
|
|
883
883
|
function en(n, t) {
|
|
884
884
|
if (t === void 0 && (t = 1), t >= 3)
|
|
@@ -1091,7 +1091,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1091
1091
|
};
|
|
1092
1092
|
});
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1094
|
+
function kn(n, t) {
|
|
1095
1095
|
var r = t.send;
|
|
1096
1096
|
return C("windowInstanceIDPromises").getOrSet(n, function() {
|
|
1097
1097
|
return xn(n, {
|
|
@@ -1101,7 +1101,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1101
1101
|
});
|
|
1102
1102
|
});
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1104
|
+
function Kn(n) {
|
|
1105
1105
|
C("knownWindows").set(n, !0);
|
|
1106
1106
|
}
|
|
1107
1107
|
function Sn(n) {
|
|
@@ -1110,7 +1110,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1110
1110
|
function Xn(n) {
|
|
1111
1111
|
return n === void 0 ? "undefined" : n === null ? "null" : Array.isArray(n) ? "array" : typeof n == "function" ? "function" : typeof n == "object" ? n instanceof Error ? "error" : typeof n.then == "function" ? "promise" : {}.toString.call(n) === "[object RegExp]" ? "regex" : {}.toString.call(n) === "[object Date]" ? "date" : "object" : typeof n == "string" ? "string" : typeof n == "number" ? "number" : typeof n == "boolean" ? "boolean" : void 0;
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1113
|
+
function K(n, t) {
|
|
1114
1114
|
return {
|
|
1115
1115
|
__type__: n,
|
|
1116
1116
|
__val__: t
|
|
@@ -1118,7 +1118,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1118
1118
|
}
|
|
1119
1119
|
var M, gr = ((M = {}).function = function() {
|
|
1120
1120
|
}, M.error = function(n) {
|
|
1121
|
-
return
|
|
1121
|
+
return K("error", {
|
|
1122
1122
|
message: n.message,
|
|
1123
1123
|
stack: n.stack,
|
|
1124
1124
|
code: n.code,
|
|
@@ -1126,9 +1126,9 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1126
1126
|
});
|
|
1127
1127
|
}, M.promise = function() {
|
|
1128
1128
|
}, M.regex = function(n) {
|
|
1129
|
-
return
|
|
1129
|
+
return K("regex", n.source);
|
|
1130
1130
|
}, M.date = function(n) {
|
|
1131
|
-
return
|
|
1131
|
+
return K("date", n.toJSON());
|
|
1132
1132
|
}, M.array = function(n) {
|
|
1133
1133
|
return n;
|
|
1134
1134
|
}, M.object = function(n) {
|
|
@@ -1142,7 +1142,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1142
1142
|
}, M.null = function(n) {
|
|
1143
1143
|
return n;
|
|
1144
1144
|
}, M[void 0] = function(n) {
|
|
1145
|
-
return
|
|
1145
|
+
return K("undefined", n);
|
|
1146
1146
|
}, M), yr = {}, T, Er = ((T = {}).function = function() {
|
|
1147
1147
|
throw new Error("Function serialization is not implemented; nothing to deserialize");
|
|
1148
1148
|
}, T.error = function(n) {
|
|
@@ -1193,7 +1193,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1193
1193
|
throw new Error("Window is closed, can not determine type");
|
|
1194
1194
|
return zn(c) ? "popup" : "iframe";
|
|
1195
1195
|
});
|
|
1196
|
-
i.catch(
|
|
1196
|
+
i.catch(k), a.catch(k);
|
|
1197
1197
|
var s = function() {
|
|
1198
1198
|
return n.then(function(c) {
|
|
1199
1199
|
if (!B(c))
|
|
@@ -1207,7 +1207,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1207
1207
|
},
|
|
1208
1208
|
getInstanceID: vr(function() {
|
|
1209
1209
|
return n.then(function(c) {
|
|
1210
|
-
return
|
|
1210
|
+
return kn(c, {
|
|
1211
1211
|
send: r
|
|
1212
1212
|
});
|
|
1213
1213
|
});
|
|
@@ -1338,7 +1338,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1338
1338
|
return x.try(function() {
|
|
1339
1339
|
return o.actualWindow ? r === o.actualWindow : x.hash({
|
|
1340
1340
|
proxyInstanceID: o.getInstanceID(),
|
|
1341
|
-
knownWindowInstanceID:
|
|
1341
|
+
knownWindowInstanceID: kn(r, {
|
|
1342
1342
|
send: i
|
|
1343
1343
|
})
|
|
1344
1344
|
}).then(function(a) {
|
|
@@ -1459,7 +1459,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1459
1459
|
var u = r.__name__ || r.name || e;
|
|
1460
1460
|
return typeof u == "string" && typeof u.indexOf == "function" && u.indexOf("anonymous::") === 0 && (u = u.replace("anonymous::", e + "::")), L.isProxyWindow(n) ? (Pn(c, r, u, n, t), n.awaitWindow().then(function(h) {
|
|
1461
1461
|
Pn(c, r, u, h, t);
|
|
1462
|
-
})) : Pn(c, r, u, n, t),
|
|
1462
|
+
})) : Pn(c, r, u, n, t), K("cross_domain_function", {
|
|
1463
1463
|
id: c,
|
|
1464
1464
|
name: u
|
|
1465
1465
|
});
|
|
@@ -1481,7 +1481,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1481
1481
|
return u === void 0 ? "undefined" : u;
|
|
1482
1482
|
}(r, ((o = {}).promise = function(s, c) {
|
|
1483
1483
|
return function(u, h, f, d, l) {
|
|
1484
|
-
return
|
|
1484
|
+
return K("cross_domain_zalgo_promise", {
|
|
1485
1485
|
then: _n(u, h, function(m, v) {
|
|
1486
1486
|
return f.then(m, v);
|
|
1487
1487
|
}, d, {
|
|
@@ -1499,7 +1499,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1499
1499
|
send: a
|
|
1500
1500
|
});
|
|
1501
1501
|
}, o.object = function(s) {
|
|
1502
|
-
return hn(s) || L.isProxyWindow(s) ?
|
|
1502
|
+
return hn(s) || L.isProxyWindow(s) ? K("cross_domain_window", L.serialize(s, {
|
|
1503
1503
|
send: a
|
|
1504
1504
|
})) : s;
|
|
1505
1505
|
}, o));
|
|
@@ -1609,7 +1609,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1609
1609
|
}), a.flush.then(function() {
|
|
1610
1610
|
delete a.flush;
|
|
1611
1611
|
});
|
|
1612
|
-
}).then(
|
|
1612
|
+
}).then(k);
|
|
1613
1613
|
}
|
|
1614
1614
|
function tr(n) {
|
|
1615
1615
|
return R("responseListeners").get(n);
|
|
@@ -1708,7 +1708,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1708
1708
|
return c("success", u);
|
|
1709
1709
|
}, function(u) {
|
|
1710
1710
|
return c("error", null, u);
|
|
1711
|
-
})]).then(
|
|
1711
|
+
})]).then(k).catch(function(u) {
|
|
1712
1712
|
if (a && a.handleError)
|
|
1713
1713
|
return a.handleError(u);
|
|
1714
1714
|
throw u;
|
|
@@ -1775,7 +1775,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1775
1775
|
send: e
|
|
1776
1776
|
});
|
|
1777
1777
|
if (s) {
|
|
1778
|
-
|
|
1778
|
+
Kn(i);
|
|
1779
1779
|
for (var c = 0; c < s.length; c++) {
|
|
1780
1780
|
var u = s[c];
|
|
1781
1781
|
if (o.has(u.id) || (o.set(u.id, !0), B(i) && !u.fireAndForget))
|
|
@@ -1815,7 +1815,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
1815
1815
|
cancel: function() {
|
|
1816
1816
|
f.then(function(I) {
|
|
1817
1817
|
return I.cancel();
|
|
1818
|
-
},
|
|
1818
|
+
}, k);
|
|
1819
1819
|
}
|
|
1820
1820
|
};
|
|
1821
1821
|
}
|
|
@@ -2029,7 +2029,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
2029
2029
|
}();
|
|
2030
2030
|
l.finally(function() {
|
|
2031
2031
|
N.cancel(), w.splice(w.indexOf(l, 1));
|
|
2032
|
-
}).catch(
|
|
2032
|
+
}).catch(k);
|
|
2033
2033
|
}
|
|
2034
2034
|
return An(u, f, {
|
|
2035
2035
|
id: J(),
|
|
@@ -2156,7 +2156,7 @@ var cr = { exports: {} }, sr = { exports: {} };
|
|
|
2156
2156
|
var Rr = !0;
|
|
2157
2157
|
function Nr(n) {
|
|
2158
2158
|
for (var t = 0, r = C("requestPromises").get(n, []); t < r.length; t++)
|
|
2159
|
-
r[t].reject(new Error("Window " + (B(n) ? "closed" : "cleaned up") + " before response")).catch(
|
|
2159
|
+
r[t].reject(new Error("Window " + (B(n) ? "closed" : "cleaned up") + " before response")).catch(k);
|
|
2160
2160
|
}
|
|
2161
2161
|
ur();
|
|
2162
2162
|
}]);
|
|
@@ -2179,7 +2179,7 @@ function qr(E) {
|
|
|
2179
2179
|
function Vr(E, z) {
|
|
2180
2180
|
Dn.send(E.contentWindow, "config", z);
|
|
2181
2181
|
}
|
|
2182
|
-
class
|
|
2182
|
+
class kr {
|
|
2183
2183
|
constructor({ userEmail: z = void 0, companyName: F = void 0 }) {
|
|
2184
2184
|
pn(this, "iframe");
|
|
2185
2185
|
pn(this, "userEmail");
|
|
@@ -2191,5 +2191,5 @@ class Kr {
|
|
|
2191
2191
|
}
|
|
2192
2192
|
}
|
|
2193
2193
|
export {
|
|
2194
|
-
|
|
2194
|
+
kr as default
|
|
2195
2195
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(H,L){typeof exports=="object"&&typeof module<"u"?module.exports=L():typeof define=="function"&&define.amd?define(L):(H=typeof globalThis<"u"?globalThis:H||self,H["soyio-widget"]=L())})(this,function(){"use strict";var Vr=Object.defineProperty;var Yr=(H,L,V)=>L in H?Vr(H,L,{enumerable:!0,configurable:!0,writable:!0,value:V}):H[L]=V;var En=(H,L,V)=>(Yr(H,typeof L!="symbol"?L+"":L,V),V);const H="soyio-widget-iframe-container",V="
|
|
2
|
-
`;function G(n){return n===void 0&&(n=window),n.location.protocol}function nn(n){if(n===void 0&&(n=window),n.mockDomain){var t=n.mockDomain.split("//")[0];if(t)return t}return G(n)}function dn(n){return n===void 0&&(n=window),nn(n)==="about:"}function Y(n){if(n===void 0&&(n=window),n)try{if(n.parent&&n.parent!==n)return n.parent}catch{}}function Cn(n){if(n===void 0&&(n=window),n&&!Y(n))try{return n.opener}catch{}}function hn(n){try{return!0}catch{}return!1}function ln(n){n===void 0&&(n=window);var t=n.location;if(!t)throw new Error("Can not read window location");var r=G(n);if(!r)throw new Error("Can not read window protocol");if(r==="file:")return"file://";if(r==="about:"){var e=Y(n);return e&&hn()?ln(e):"about://"}var o=t.host;if(!o)throw new Error("Can not read window host");return r+"//"+o}function N(n){n===void 0&&(n=window);var t=ln(n);return t&&n.mockDomain&&n.mockDomain.indexOf("mock:")===0?n.mockDomain:t}function K(n){if(!function(t){try{if(t===window)return!0}catch{}try{var r=Object.getOwnPropertyDescriptor(t,"location");if(r&&r.enumerable===!1)return!1}catch{}try{if(dn(t)&&hn())return!0}catch{}try{if(function(e){return e===void 0&&(e=window),nn(e)==="mock:"}(t)&&hn())return!0}catch{}try{if(ln(t)===ln(window))return!0}catch{}return!1}(n))return!1;try{if(n===window||dn(n)&&hn()||N(window)===N(n))return!0}catch{}return!1}function vn(n){if(!K(n))throw new Error("Expected window to be same domain");return n}function Tn(n,t){if(!n||!t)return!1;var r=Y(t);return r?r===n:function(e){var o=[];try{for(;e.parent!==e;)o.push(e.parent),e=e.parent}catch{}return o}(t).indexOf(n)!==-1}function Ln(n){var t=[],r;try{r=n.frames}catch{r=n}var e;try{e=r.length}catch{}if(e===0)return t;if(e){for(var o=0;o<e;o++){var i=void 0;try{i=r[o]}catch{continue}t.push(i)}return t}for(var a=0;a<100;a++){var s=void 0;try{s=r[a]}catch{return t}if(!s)return t;t.push(s)}return t}var Sr=[],br=[];function F(n,t){t===void 0&&(t=!0);try{if(n===window)return!1}catch{return!0}try{if(!n)return!0}catch{return!0}try{if(n.closed)return!0}catch(o){return!o||o.message!==E}if(t&&K(n))try{if(n.mockclosed)return!0}catch{}try{if(!n.parent||!n.top)return!0}catch{}var r=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch{}return-1}(Sr,n);if(r!==-1){var e=br[r];if(e&&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}(e))return!0}return!1}function Fn(n){return n===void 0&&(n=window),Cn(n=n||window)||Y(n)||void 0}function _(n,t){if(typeof n=="string"){if(typeof t=="string")return n==="*"||t===n;if(p(t)||Array.isArray(t))return!1}return p(n)?p(t)?n.toString()===t.toString():!Array.isArray(t)&&!!t.match(n):!!Array.isArray(n)&&(Array.isArray(t)?JSON.stringify(n)===JSON.stringify(t):!p(t)&&n.some(function(r){return _(r,t)}))}function wn(n){try{if(n===window)return!0}catch(t){if(t&&t.message===E)return!0}try{if({}.toString.call(n)==="[object Window]")return!0}catch(t){if(t&&t.message===E)return!0}try{if(window.Window&&n instanceof window.Window)return!0}catch(t){if(t&&t.message===E)return!0}try{if(n&&n.self===n)return!0}catch(t){if(t&&t.message===E)return!0}try{if(n&&n.parent===n)return!0}catch(t){if(t&&t.message===E)return!0}try{if(n&&n.top===n)return!0}catch(t){if(t&&t.message===E)return!0}try{if(n&&n.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in n&&"self"in n&&"location"in n)return!0}catch{}return!1}function Bn(n){if(K(n))return vn(n).frameElement;for(var t=0,r=document.querySelectorAll("iframe");t<r.length;t++){var e=r[t];if(e&&e.contentWindow&&e.contentWindow===n)return e}}function Pr(n){if(function(r){return r===void 0&&(r=window),!!Y(r)}(n)){var t=Bn(n);if(t&&t.parentElement){t.parentElement.removeChild(t);return}}try{n.close()}catch{}}function k(n){try{if(!n)return!1;if(typeof Promise<"u"&&n instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&n instanceof window.Window||typeof window<"u"&&typeof window.constructor=="function"&&n instanceof window.constructor)return!1;var t={}.toString;if(t){var r=t.call(n);if(r==="[object Window]"||r==="[object global]"||r==="[object DOMWindow]")return!1}if(typeof n.then=="function")return!0}catch{return!1}return!1}var Hn=[],rn=[],xn=0,tn;function Jn(){if(!xn&&tn){var n=tn;tn=null,n.resolve()}}function Sn(){xn+=1}function en(){xn-=1,Jn()}var W=function(){function n(r){var e=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=[],r){var o,i,a=!1,s=!1,c=!1;Sn();try{r(function(u){c?e.resolve(u):(a=!0,o=u)},function(u){c?e.reject(u):(s=!0,i=u)})}catch(u){en(),this.reject(u);return}en(),c=!0,a?this.resolve(o):s&&this.reject(i)}}var t=n.prototype;return t.resolve=function(r){if(this.resolved||this.rejected)return this;if(k(r))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=r,this.dispatch(),this},t.reject=function(r){var e=this;if(this.resolved||this.rejected)return this;if(k(r))throw new Error("Can not reject promise with another promise");if(!r){var o=r&&typeof r.toString=="function"?r.toString():{}.toString.call(r);r=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=r,this.errorHandled||setTimeout(function(){e.errorHandled||function(i,a){if(Hn.indexOf(i)===-1){Hn.push(i),setTimeout(function(){throw i},1);for(var s=0;s<rn.length;s++)rn[s](i,a)}}(r,e)},1),this.dispatch(),this},t.asyncReject=function(r){return this.errorHandled=!0,this.reject(r),this},t.dispatch=function(){var r=this.resolved,e=this.rejected,o=this.handlers;if(!this.dispatching&&(r||e)){this.dispatching=!0,Sn();for(var i=function(l,m){return l.then(function(v){m.resolve(v)},function(v){m.reject(v)})},a=0;a<o.length;a++){var s=o[a],c=s.onSuccess,u=s.onError,h=s.promise,f=void 0;if(r)try{f=c?c(this.value):this.value}catch(l){h.reject(l);continue}else if(e){if(!u){h.reject(this.error);continue}try{f=u(this.error)}catch(l){h.reject(l);continue}}if(f instanceof n&&(f.resolved||f.rejected)){var d=f;d.resolved?h.resolve(d.value):h.reject(d.error),d.errorHandled=!0}else k(f)?f instanceof n&&(f.resolved||f.rejected)?f.resolved?h.resolve(f.value):h.reject(f.error):i(f,h):h.resolve(f)}o.length=0,this.dispatching=!1,en()}},t.then=function(r,e){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for success handler");if(e&&typeof e!="function"&&!e.call)throw new Error("Promise.then expected a function for error handler");var o=new n;return this.handlers.push({promise:o,onSuccess:r,onError:e}),this.errorHandled=!0,this.dispatch(),o},t.catch=function(r){return this.then(void 0,r)},t.finally=function(r){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.finally expected a function");return this.then(function(e){return n.try(r).then(function(){return e})},function(e){return n.try(r).then(function(){throw e})})},t.timeout=function(r,e){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(e||new Error("Promise timed out after "+r+"ms"))},r);return this.then(function(a){return clearTimeout(i),a})},t.toPromise=function(){if(typeof Promise>"u")throw new TypeError("Could not find Promise");return Promise.resolve(this)},t.lazy=function(){return this.errorHandled=!0,this},n.resolve=function(r){return r instanceof n?r:k(r)?new n(function(e,o){return r.then(e,o)}):new n().resolve(r)},n.reject=function(r){return new n().reject(r)},n.asyncReject=function(r){return new n().asyncReject(r)},n.all=function(r){var e=new n,o=r.length,i=[].slice();if(!o)return e.resolve(i),e;for(var a=function(u,h,f){return h.then(function(d){i[u]=d,(o-=1)==0&&e.resolve(i)},function(d){f.reject(d)})},s=0;s<r.length;s++){var c=r[s];if(c instanceof n){if(c.resolved){i[s]=c.value,o-=1;continue}}else if(!k(c)){i[s]=c,o-=1;continue}a(s,n.resolve(c),e)}return o===0&&e.resolve(i),e},n.hash=function(r){var e={},o=[],i=function(s){if(r.hasOwnProperty(s)){var c=r[s];k(c)?o.push(c.then(function(u){e[s]=u})):e[s]=c}};for(var a in r)i(a);return n.all(o).then(function(){return e})},n.map=function(r,e){return n.all(r.map(e))},n.onPossiblyUnhandledException=function(r){return function(e){return rn.push(e),{cancel:function(){rn.splice(rn.indexOf(e),1)}}}(r)},n.try=function(r,e,o){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.try expected a function");var i;Sn();try{i=r.apply(e,o||[])}catch(a){return en(),n.reject(a)}return en(),n.resolve(i)},n.delay=function(r){return new n(function(e){setTimeout(e,r)})},n.isPromise=function(r){return!!(r&&r instanceof n)||k(r)},n.flush=function(){return function(r){var e=tn=tn||new r;return Jn(),e}(n)},n}();function mn(n,t){for(var r=0;r<n.length;r++)try{if(n[r]===t)return r}catch{}return-1}var bn=function(){function n(){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>"u"||Object.freeze===void 0)return!1;try{var r=new WeakMap,e={};return Object.freeze(e),r.set(e,"__testvalue__"),r.get(e)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var t=n.prototype;return t._cleanupClosedWindows=function(){for(var r=this.weakmap,e=this.keys,o=0;o<e.length;o++){var i=e[o];if(wn(i)&&F(i)){if(r)try{r.delete(i)}catch{}e.splice(o,1),this.values.splice(o,1),o-=1}}},t.isSafeToReadWrite=function(r){return!wn(r)},t.set=function(r,e){if(!r)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(r,e)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var i=this.name,a=r[i];a&&a[0]===r?a[1]=e:Object.defineProperty(r,i,{value:[r,e],writable:!0});return}catch{}this._cleanupClosedWindows();var s=this.keys,c=this.values,u=mn(s,r);u===-1?(s.push(r),c.push(e)):c[u]=e},t.get=function(r){if(!r)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{if(e.has(r))return e.get(r)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var o=r[this.name];return o&&o[0]===r?o[1]:void 0}catch{}this._cleanupClosedWindows();var i=mn(this.keys,r);if(i!==-1)return this.values[i]},t.delete=function(r){if(!r)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{e.delete(r)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var o=r[this.name];o&&o[0]===r&&(o[0]=o[1]=void 0)}catch{}this._cleanupClosedWindows();var i=this.keys,a=mn(i,r);a!==-1&&(i.splice(a,1),this.values.splice(a,1))},t.has=function(r){if(!r)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{if(e.has(r))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var o=r[this.name];return!(!o||o[0]!==r)}catch{}return this._cleanupClosedWindows(),mn(this.keys,r)!==-1},t.getOrSet=function(r,e){if(this.has(r))return this.get(r);var o=e();return this.set(r,o),o},n}();function Un(n){return n.name||n.__name__||n.displayName||"anonymous"}function Gn(n,t){try{delete n.name,n.name=t}catch{}return n.__name__=n.displayName=t,n}function U(){var n="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return n.charAt(Math.floor(Math.random()*n.length))})+"_"+function(t){if(typeof btoa=="function")return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(r,e){return String.fromCharCode(parseInt(e,16))})).replace(/[=]/g,"");if(typeof Buffer<"u")return Buffer.from(t,"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 pn;function Zn(n){try{return JSON.stringify([].slice.call(n),function(t,r){return typeof r=="function"?"memoize["+function(e){if(pn=pn||new bn,e==null||typeof e!="object"&&typeof e!="function")throw new Error("Invalid object");var o=pn.get(e);return o||(o=typeof e+":"+U(),pn.set(e,o)),o}(r)+"]":typeof window<"u"&&r instanceof window.Element||r!==null&&typeof r=="object"&&r.nodeType===1&&typeof r.style=="object"&&typeof r.ownerDocument=="object"?{}:r})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function Or(){return{}}var on=0,qn=0;function an(n,t){t===void 0&&(t={});var r=t.thisNamespace,e=r!==void 0&&r,o=t.time,i,a,s=on;on+=1;var c=function(){for(var u=arguments.length,h=new Array(u),f=0;f<u;f++)h[f]=arguments[f];s<qn&&(i=null,a=null,s=on,on+=1);var d;d=e?(a=a||new bn).getOrSet(this,Or):i=i||{};var l;try{l=Zn(h)}catch{return n.apply(this,arguments)}var m=d[l];if(m&&o&&Date.now()-m.time<o&&(delete d[l],m=null),m)return m.value;var v=Date.now(),w=n.apply(this,arguments);return d[l]={time:v,value:w},w};return c.reset=function(){i=null,a=null},Gn(c,(t.name||Un(n))+"::memoized")}an.clear=function(){qn=on};function Ir(n){var t={};function r(){for(var e=arguments,o=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var c=Zn(a);return t.hasOwnProperty(c)||(t[c]=W.try(function(){return n.apply(o,e)}).finally(function(){delete t[c]})),t[c]}return r.reset=function(){t={}},Gn(r,Un(n)+"::promiseMemoized")}function X(){}function un(n,t){if(t===void 0&&(t=1),t>=3)return"stringifyError stack overflow";try{if(!n)return"<unknown error: "+{}.toString.call(n)+">";if(typeof n=="string")return n;if(n instanceof Error){var r=n&&n.stack,e=n&&n.message;if(r&&e)return r.indexOf(e)!==-1?r:e+`
|
|
3
|
-
`+r;if(r)return r;if(e)return e}return n&&n.toString&&typeof n.toString=="function"?n.toString():{}.toString.call(n)}catch(o){return"Error while stringifying error: "+un(o,t+1)}}function Vn(n){return typeof n=="string"?n:n&&n.toString&&typeof n.toString=="function"?n.toString():{}.toString.call(n)}an(function(n){if(Object.values)return Object.values(n);var t=[];for(var r in n)n.hasOwnProperty(r)&&t.push(n[r]);return t});function Pn(n){return{}.toString.call(n)==="[object RegExp]"}function cn(n,t,r){if(n.hasOwnProperty(t))return n[t];var e=r();return n[t]=e,e}function Yn(){var n=document.body;if(!n)throw new Error("Body element not found");return n}function
|
|
1
|
+
(function(H,L){typeof exports=="object"&&typeof module<"u"?module.exports=L():typeof define=="function"&&define.amd?define(L):(H=typeof globalThis<"u"?globalThis:H||self,H["soyio-widget"]=L())})(this,function(){"use strict";var Vr=Object.defineProperty;var Yr=(H,L,V)=>L in H?Vr(H,L,{enumerable:!0,configurable:!0,writable:!0,value:V}):H[L]=V;var En=(H,L,V)=>(Yr(H,typeof L!="symbol"?L+"":L,V),V);const H="soyio-widget-iframe-container",V="https://pl-soyio-staging-7a391ba45b99.herokuapp.com/widget";function lr(){return document.getElementById(H)}function vr(){const I=lr();if(!I)throw new Error("Iframe container does not exist");const J=document.createElement("iframe");return J.src=V,J.style.width="100%",J.style.height="100%",I.appendChild(J),J}var wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mr(I){return I&&I.__esModule&&Object.prototype.hasOwnProperty.call(I,"default")?I.default:I}var jn={exports:{}},Mn={exports:{}};(function(I,J){(function($,O){I.exports=O()})(typeof self<"u"?self:wr,function(){return function($){var O={};function g(p){if(O[p])return O[p].exports;var E=O[p]={i:p,l:!1,exports:{}};return $[p].call(E.exports,E,E.exports,g),E.l=!0,E.exports}return g.m=$,g.c=O,g.d=function(p,E,G){g.o(p,E)||Object.defineProperty(p,E,{enumerable:!0,get:G})},g.r=function(p){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(p,"__esModule",{value:!0})},g.t=function(p,E){if(1&E&&(p=g(p)),8&E||4&E&&typeof p=="object"&&p&&p.__esModule)return p;var G=Object.create(null);if(g.r(G),Object.defineProperty(G,"default",{enumerable:!0,value:p}),2&E&&typeof p!="string")for(var nn in p)g.d(G,nn,(function(dn){return p[dn]}).bind(null,nn));return G},g.n=function(p){var E=p&&p.__esModule?function(){return p.default}:function(){return p};return g.d(E,"a",E),E},g.o=function(p,E){return{}.hasOwnProperty.call(p,E)},g.p="",g(g.s=0)}([function($,O,g){g.r(O),g.d(O,"Promise",function(){return W}),g.d(O,"TYPES",function(){return Zr}),g.d(O,"ProxyWindow",function(){return T}),g.d(O,"setup",function(){return hr}),g.d(O,"destroy",function(){return Gr}),g.d(O,"serializeMessage",function(){return Br}),g.d(O,"deserializeMessage",function(){return Hr}),g.d(O,"createProxyWindow",function(){return Jr}),g.d(O,"toProxyWindow",function(){return Ur}),g.d(O,"on",function(){return Z}),g.d(O,"once",function(){return Fr}),g.d(O,"send",function(){return q}),g.d(O,"markWindowKnown",function(){return nr}),g.d(O,"cleanUpWindow",function(){return qr}),g.d(O,"bridge",function(){});function p(n){return{}.toString.call(n)==="[object RegExp]"}var E=`Call was rejected by callee.\r
|
|
2
|
+
`;function G(n){return n===void 0&&(n=window),n.location.protocol}function nn(n){if(n===void 0&&(n=window),n.mockDomain){var t=n.mockDomain.split("//")[0];if(t)return t}return G(n)}function dn(n){return n===void 0&&(n=window),nn(n)==="about:"}function Y(n){if(n===void 0&&(n=window),n)try{if(n.parent&&n.parent!==n)return n.parent}catch{}}function Cn(n){if(n===void 0&&(n=window),n&&!Y(n))try{return n.opener}catch{}}function hn(n){try{return!0}catch{}return!1}function ln(n){n===void 0&&(n=window);var t=n.location;if(!t)throw new Error("Can not read window location");var r=G(n);if(!r)throw new Error("Can not read window protocol");if(r==="file:")return"file://";if(r==="about:"){var e=Y(n);return e&&hn()?ln(e):"about://"}var o=t.host;if(!o)throw new Error("Can not read window host");return r+"//"+o}function N(n){n===void 0&&(n=window);var t=ln(n);return t&&n.mockDomain&&n.mockDomain.indexOf("mock:")===0?n.mockDomain:t}function k(n){if(!function(t){try{if(t===window)return!0}catch{}try{var r=Object.getOwnPropertyDescriptor(t,"location");if(r&&r.enumerable===!1)return!1}catch{}try{if(dn(t)&&hn())return!0}catch{}try{if(function(e){return e===void 0&&(e=window),nn(e)==="mock:"}(t)&&hn())return!0}catch{}try{if(ln(t)===ln(window))return!0}catch{}return!1}(n))return!1;try{if(n===window||dn(n)&&hn()||N(window)===N(n))return!0}catch{}return!1}function vn(n){if(!k(n))throw new Error("Expected window to be same domain");return n}function Tn(n,t){if(!n||!t)return!1;var r=Y(t);return r?r===n:function(e){var o=[];try{for(;e.parent!==e;)o.push(e.parent),e=e.parent}catch{}return o}(t).indexOf(n)!==-1}function Ln(n){var t=[],r;try{r=n.frames}catch{r=n}var e;try{e=r.length}catch{}if(e===0)return t;if(e){for(var o=0;o<e;o++){var i=void 0;try{i=r[o]}catch{continue}t.push(i)}return t}for(var a=0;a<100;a++){var s=void 0;try{s=r[a]}catch{return t}if(!s)return t;t.push(s)}return t}var Sr=[],br=[];function F(n,t){t===void 0&&(t=!0);try{if(n===window)return!1}catch{return!0}try{if(!n)return!0}catch{return!0}try{if(n.closed)return!0}catch(o){return!o||o.message!==E}if(t&&k(n))try{if(n.mockclosed)return!0}catch{}try{if(!n.parent||!n.top)return!0}catch{}var r=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch{}return-1}(Sr,n);if(r!==-1){var e=br[r];if(e&&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}(e))return!0}return!1}function Fn(n){return n===void 0&&(n=window),Cn(n=n||window)||Y(n)||void 0}function _(n,t){if(typeof n=="string"){if(typeof t=="string")return n==="*"||t===n;if(p(t)||Array.isArray(t))return!1}return p(n)?p(t)?n.toString()===t.toString():!Array.isArray(t)&&!!t.match(n):!!Array.isArray(n)&&(Array.isArray(t)?JSON.stringify(n)===JSON.stringify(t):!p(t)&&n.some(function(r){return _(r,t)}))}function wn(n){try{if(n===window)return!0}catch(t){if(t&&t.message===E)return!0}try{if({}.toString.call(n)==="[object Window]")return!0}catch(t){if(t&&t.message===E)return!0}try{if(window.Window&&n instanceof window.Window)return!0}catch(t){if(t&&t.message===E)return!0}try{if(n&&n.self===n)return!0}catch(t){if(t&&t.message===E)return!0}try{if(n&&n.parent===n)return!0}catch(t){if(t&&t.message===E)return!0}try{if(n&&n.top===n)return!0}catch(t){if(t&&t.message===E)return!0}try{if(n&&n.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in n&&"self"in n&&"location"in n)return!0}catch{}return!1}function Bn(n){if(k(n))return vn(n).frameElement;for(var t=0,r=document.querySelectorAll("iframe");t<r.length;t++){var e=r[t];if(e&&e.contentWindow&&e.contentWindow===n)return e}}function Pr(n){if(function(r){return r===void 0&&(r=window),!!Y(r)}(n)){var t=Bn(n);if(t&&t.parentElement){t.parentElement.removeChild(t);return}}try{n.close()}catch{}}function K(n){try{if(!n)return!1;if(typeof Promise<"u"&&n instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&n instanceof window.Window||typeof window<"u"&&typeof window.constructor=="function"&&n instanceof window.constructor)return!1;var t={}.toString;if(t){var r=t.call(n);if(r==="[object Window]"||r==="[object global]"||r==="[object DOMWindow]")return!1}if(typeof n.then=="function")return!0}catch{return!1}return!1}var Hn=[],rn=[],xn=0,tn;function Jn(){if(!xn&&tn){var n=tn;tn=null,n.resolve()}}function Sn(){xn+=1}function en(){xn-=1,Jn()}var W=function(){function n(r){var e=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=[],r){var o,i,a=!1,s=!1,c=!1;Sn();try{r(function(u){c?e.resolve(u):(a=!0,o=u)},function(u){c?e.reject(u):(s=!0,i=u)})}catch(u){en(),this.reject(u);return}en(),c=!0,a?this.resolve(o):s&&this.reject(i)}}var t=n.prototype;return t.resolve=function(r){if(this.resolved||this.rejected)return this;if(K(r))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=r,this.dispatch(),this},t.reject=function(r){var e=this;if(this.resolved||this.rejected)return this;if(K(r))throw new Error("Can not reject promise with another promise");if(!r){var o=r&&typeof r.toString=="function"?r.toString():{}.toString.call(r);r=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=r,this.errorHandled||setTimeout(function(){e.errorHandled||function(i,a){if(Hn.indexOf(i)===-1){Hn.push(i),setTimeout(function(){throw i},1);for(var s=0;s<rn.length;s++)rn[s](i,a)}}(r,e)},1),this.dispatch(),this},t.asyncReject=function(r){return this.errorHandled=!0,this.reject(r),this},t.dispatch=function(){var r=this.resolved,e=this.rejected,o=this.handlers;if(!this.dispatching&&(r||e)){this.dispatching=!0,Sn();for(var i=function(l,m){return l.then(function(v){m.resolve(v)},function(v){m.reject(v)})},a=0;a<o.length;a++){var s=o[a],c=s.onSuccess,u=s.onError,h=s.promise,f=void 0;if(r)try{f=c?c(this.value):this.value}catch(l){h.reject(l);continue}else if(e){if(!u){h.reject(this.error);continue}try{f=u(this.error)}catch(l){h.reject(l);continue}}if(f instanceof n&&(f.resolved||f.rejected)){var d=f;d.resolved?h.resolve(d.value):h.reject(d.error),d.errorHandled=!0}else K(f)?f instanceof n&&(f.resolved||f.rejected)?f.resolved?h.resolve(f.value):h.reject(f.error):i(f,h):h.resolve(f)}o.length=0,this.dispatching=!1,en()}},t.then=function(r,e){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for success handler");if(e&&typeof e!="function"&&!e.call)throw new Error("Promise.then expected a function for error handler");var o=new n;return this.handlers.push({promise:o,onSuccess:r,onError:e}),this.errorHandled=!0,this.dispatch(),o},t.catch=function(r){return this.then(void 0,r)},t.finally=function(r){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.finally expected a function");return this.then(function(e){return n.try(r).then(function(){return e})},function(e){return n.try(r).then(function(){throw e})})},t.timeout=function(r,e){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(e||new Error("Promise timed out after "+r+"ms"))},r);return this.then(function(a){return clearTimeout(i),a})},t.toPromise=function(){if(typeof Promise>"u")throw new TypeError("Could not find Promise");return Promise.resolve(this)},t.lazy=function(){return this.errorHandled=!0,this},n.resolve=function(r){return r instanceof n?r:K(r)?new n(function(e,o){return r.then(e,o)}):new n().resolve(r)},n.reject=function(r){return new n().reject(r)},n.asyncReject=function(r){return new n().asyncReject(r)},n.all=function(r){var e=new n,o=r.length,i=[].slice();if(!o)return e.resolve(i),e;for(var a=function(u,h,f){return h.then(function(d){i[u]=d,(o-=1)==0&&e.resolve(i)},function(d){f.reject(d)})},s=0;s<r.length;s++){var c=r[s];if(c instanceof n){if(c.resolved){i[s]=c.value,o-=1;continue}}else if(!K(c)){i[s]=c,o-=1;continue}a(s,n.resolve(c),e)}return o===0&&e.resolve(i),e},n.hash=function(r){var e={},o=[],i=function(s){if(r.hasOwnProperty(s)){var c=r[s];K(c)?o.push(c.then(function(u){e[s]=u})):e[s]=c}};for(var a in r)i(a);return n.all(o).then(function(){return e})},n.map=function(r,e){return n.all(r.map(e))},n.onPossiblyUnhandledException=function(r){return function(e){return rn.push(e),{cancel:function(){rn.splice(rn.indexOf(e),1)}}}(r)},n.try=function(r,e,o){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.try expected a function");var i;Sn();try{i=r.apply(e,o||[])}catch(a){return en(),n.reject(a)}return en(),n.resolve(i)},n.delay=function(r){return new n(function(e){setTimeout(e,r)})},n.isPromise=function(r){return!!(r&&r instanceof n)||K(r)},n.flush=function(){return function(r){var e=tn=tn||new r;return Jn(),e}(n)},n}();function mn(n,t){for(var r=0;r<n.length;r++)try{if(n[r]===t)return r}catch{}return-1}var bn=function(){function n(){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>"u"||Object.freeze===void 0)return!1;try{var r=new WeakMap,e={};return Object.freeze(e),r.set(e,"__testvalue__"),r.get(e)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var t=n.prototype;return t._cleanupClosedWindows=function(){for(var r=this.weakmap,e=this.keys,o=0;o<e.length;o++){var i=e[o];if(wn(i)&&F(i)){if(r)try{r.delete(i)}catch{}e.splice(o,1),this.values.splice(o,1),o-=1}}},t.isSafeToReadWrite=function(r){return!wn(r)},t.set=function(r,e){if(!r)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(r,e)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var i=this.name,a=r[i];a&&a[0]===r?a[1]=e:Object.defineProperty(r,i,{value:[r,e],writable:!0});return}catch{}this._cleanupClosedWindows();var s=this.keys,c=this.values,u=mn(s,r);u===-1?(s.push(r),c.push(e)):c[u]=e},t.get=function(r){if(!r)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{if(e.has(r))return e.get(r)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var o=r[this.name];return o&&o[0]===r?o[1]:void 0}catch{}this._cleanupClosedWindows();var i=mn(this.keys,r);if(i!==-1)return this.values[i]},t.delete=function(r){if(!r)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{e.delete(r)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var o=r[this.name];o&&o[0]===r&&(o[0]=o[1]=void 0)}catch{}this._cleanupClosedWindows();var i=this.keys,a=mn(i,r);a!==-1&&(i.splice(a,1),this.values.splice(a,1))},t.has=function(r){if(!r)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{if(e.has(r))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var o=r[this.name];return!(!o||o[0]!==r)}catch{}return this._cleanupClosedWindows(),mn(this.keys,r)!==-1},t.getOrSet=function(r,e){if(this.has(r))return this.get(r);var o=e();return this.set(r,o),o},n}();function Un(n){return n.name||n.__name__||n.displayName||"anonymous"}function Gn(n,t){try{delete n.name,n.name=t}catch{}return n.__name__=n.displayName=t,n}function U(){var n="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return n.charAt(Math.floor(Math.random()*n.length))})+"_"+function(t){if(typeof btoa=="function")return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(r,e){return String.fromCharCode(parseInt(e,16))})).replace(/[=]/g,"");if(typeof Buffer<"u")return Buffer.from(t,"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 pn;function Zn(n){try{return JSON.stringify([].slice.call(n),function(t,r){return typeof r=="function"?"memoize["+function(e){if(pn=pn||new bn,e==null||typeof e!="object"&&typeof e!="function")throw new Error("Invalid object");var o=pn.get(e);return o||(o=typeof e+":"+U(),pn.set(e,o)),o}(r)+"]":typeof window<"u"&&r instanceof window.Element||r!==null&&typeof r=="object"&&r.nodeType===1&&typeof r.style=="object"&&typeof r.ownerDocument=="object"?{}:r})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function Or(){return{}}var on=0,qn=0;function an(n,t){t===void 0&&(t={});var r=t.thisNamespace,e=r!==void 0&&r,o=t.time,i,a,s=on;on+=1;var c=function(){for(var u=arguments.length,h=new Array(u),f=0;f<u;f++)h[f]=arguments[f];s<qn&&(i=null,a=null,s=on,on+=1);var d;d=e?(a=a||new bn).getOrSet(this,Or):i=i||{};var l;try{l=Zn(h)}catch{return n.apply(this,arguments)}var m=d[l];if(m&&o&&Date.now()-m.time<o&&(delete d[l],m=null),m)return m.value;var v=Date.now(),w=n.apply(this,arguments);return d[l]={time:v,value:w},w};return c.reset=function(){i=null,a=null},Gn(c,(t.name||Un(n))+"::memoized")}an.clear=function(){qn=on};function Ir(n){var t={};function r(){for(var e=arguments,o=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var c=Zn(a);return t.hasOwnProperty(c)||(t[c]=W.try(function(){return n.apply(o,e)}).finally(function(){delete t[c]})),t[c]}return r.reset=function(){t={}},Gn(r,Un(n)+"::promiseMemoized")}function X(){}function un(n,t){if(t===void 0&&(t=1),t>=3)return"stringifyError stack overflow";try{if(!n)return"<unknown error: "+{}.toString.call(n)+">";if(typeof n=="string")return n;if(n instanceof Error){var r=n&&n.stack,e=n&&n.message;if(r&&e)return r.indexOf(e)!==-1?r:e+`
|
|
3
|
+
`+r;if(r)return r;if(e)return e}return n&&n.toString&&typeof n.toString=="function"?n.toString():{}.toString.call(n)}catch(o){return"Error while stringifying error: "+un(o,t+1)}}function Vn(n){return typeof n=="string"?n:n&&n.toString&&typeof n.toString=="function"?n.toString():{}.toString.call(n)}an(function(n){if(Object.values)return Object.values(n);var t=[];for(var r in n)n.hasOwnProperty(r)&&t.push(n[r]);return t});function Pn(n){return{}.toString.call(n)==="[object RegExp]"}function cn(n,t,r){if(n.hasOwnProperty(t))return n[t];var e=r();return n[t]=e,e}function Yn(){var n=document.body;if(!n)throw new Error("Body element not found");return n}function kn(){return!!document.body&&document.readyState==="complete"}function Kn(){return!!document.body&&document.readyState==="interactive"}an(function(){return new W(function(n){if(kn()||Kn())return n();var t=setInterval(function(){if(kn()||Kn())return clearInterval(t),n()},10)})});var gn=typeof document<"u"?document.currentScript:null,Ar=an(function(){if(gn||(gn=function(){try{var n=function(){try{throw new Error("_")}catch(a){return a.stack||""}}(),t=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(n),r=t&&t[1];if(!r)return;for(var e=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();e<o.length;e++){var i=o[e];if(i.src&&i.src===r)return i}}catch{}}()))return gn;throw new Error("Can not determine current script")}),Dr=U();an(function(){var n;try{n=Ar()}catch{return Dr}var t=n.getAttribute("data-uid");if(t&&typeof t=="string"||(t=n.getAttribute("data-uid-auto"))&&typeof t=="string")return t;if(n.src){var r=function(e){for(var o="",i=0;i<e.length;i++){var a=e[i].charCodeAt(0)*i;e[i+1]&&(a+=e[i+1].charCodeAt(0)*(i-1)),o+=String.fromCharCode(97+Math.abs(a)%26)}return o}(JSON.stringify({src:n.src,dataset:n.dataset}));t="uid_"+r.slice(r.length-30)}else t=U();return n.setAttribute("data-uid-auto",t),t});function sn(n){n===void 0&&(n=window);var t="__post_robot_10_0_46__";return n!==window?n[t]:n[t]=n[t]||{}}var Xn=function(){return{}};function z(n,t){return n===void 0&&(n="store"),t===void 0&&(t=Xn),cn(sn(),n,function(){var r=t();return{has:function(e){return r.hasOwnProperty(e)},get:function(e,o){return r.hasOwnProperty(e)?r[e]:o},set:function(e,o){return r[e]=o,o},del:function(e){delete r[e]},getOrSet:function(e,o){return cn(r,e,o)},reset:function(){r=t()},keys:function(){return Object.keys(r)}}})}var zr=function(){};function yn(){var n=sn();return n.WINDOW_WILDCARD=n.WINDOW_WILDCARD||new zr,n.WINDOW_WILDCARD}function j(n,t){return n===void 0&&(n="store"),t===void 0&&(t=Xn),z("windowStore").getOrSet(n,function(){var r=new bn,e=function(o){return r.getOrSet(o,t)};return{has:function(o){return e(o).hasOwnProperty(n)},get:function(o,i){var a=e(o);return a.hasOwnProperty(n)?a[n]:i},set:function(o,i){return e(o)[n]=i,i},del:function(o){delete e(o)[n]},getOrSet:function(o,i){return cn(e(o),n,i)}}})}function Qn(){return z("instance").getOrSet("instanceID",U)}function $n(n,t){var r=t.domain,e=j("helloPromises"),o=e.get(n);o&&o.resolve({domain:r});var i=W.resolve({domain:r});return e.set(n,i),i}function On(n,t){return(0,t.send)(n,"postrobot_hello",{instanceID:Qn()},{domain:"*",timeout:-1}).then(function(r){var e=r.origin,o=r.data.instanceID;return $n(n,{domain:e}),{win:n,domain:e,instanceID:o}})}function _n(n,t){var r=t.send;return j("windowInstanceIDPromises").getOrSet(n,function(){return On(n,{send:r}).then(function(e){return e.instanceID})})}function nr(n){j("knownWindows").set(n,!0)}function In(n){return typeof n=="object"&&n!==null&&typeof n.__type__=="string"}function rr(n){return n===void 0?"undefined":n===null?"null":Array.isArray(n)?"array":typeof n=="function"?"function":typeof n=="object"?n instanceof Error?"error":typeof n.then=="function"?"promise":{}.toString.call(n)==="[object RegExp]"?"regex":{}.toString.call(n)==="[object Date]"?"date":"object":typeof n=="string"?"string":typeof n=="number"?"number":typeof n=="boolean"?"boolean":void 0}function Q(n,t){return{__type__:n,__val__:t}}var M,Rr=((M={}).function=function(){},M.error=function(n){return Q("error",{message:n.message,stack:n.stack,code:n.code,data:n.data})},M.promise=function(){},M.regex=function(n){return Q("regex",n.source)},M.date=function(n){return Q("date",n.toJSON())},M.array=function(n){return n},M.object=function(n){return n},M.string=function(n){return n},M.number=function(n){return n},M.boolean=function(n){return n},M.null=function(n){return n},M[void 0]=function(n){return Q("undefined",n)},M),Nr={},C,jr=((C={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},C.error=function(n){var t=n.stack,r=n.code,e=n.data,o=new Error(n.message);return o.code=r,e&&(o.data=e),o.stack=t+`
|
|
4
4
|
|
|
5
|
-
`+o.stack,o},C.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},C.regex=function(n){return new RegExp(n)},C.date=function(n){return new Date(n)},C.array=function(n){return n},C.object=function(n){return n},C.string=function(n){return n},C.number=function(n){return n},C.boolean=function(n){return n},C.null=function(n){return n},C[void 0]=function(){},C),Mr={};new W(function(n){if(window.document&&window.document.body)return n(window.document.body);var t=setInterval(function(){if(window.document&&window.document.body)return clearInterval(t),n(window.document.body)},10)});function An(){for(var n=z("idToProxyWindow"),t=0,r=n.keys();t<r.length;t++){var e=r[t];n.get(e).shouldClean()&&n.del(e)}}function tr(n,t){var r=t.send,e=t.id,o=e===void 0?U():e,i=n.then(function(c){if(
|
|
5
|
+
`+o.stack,o},C.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},C.regex=function(n){return new RegExp(n)},C.date=function(n){return new Date(n)},C.array=function(n){return n},C.object=function(n){return n},C.string=function(n){return n},C.number=function(n){return n},C.boolean=function(n){return n},C.null=function(n){return n},C[void 0]=function(){},C),Mr={};new W(function(n){if(window.document&&window.document.body)return n(window.document.body);var t=setInterval(function(){if(window.document&&window.document.body)return clearInterval(t),n(window.document.body)},10)});function An(){for(var n=z("idToProxyWindow"),t=0,r=n.keys();t<r.length;t++){var e=r[t];n.get(e).shouldClean()&&n.del(e)}}function tr(n,t){var r=t.send,e=t.id,o=e===void 0?U():e,i=n.then(function(c){if(k(c))return vn(c).name}),a=n.then(function(c){if(F(c))throw new Error("Window is closed, can not determine type");return Cn(c)?"popup":"iframe"});i.catch(X),a.catch(X);var s=function(){return n.then(function(c){if(!F(c))return k(c)?vn(c).name:i})};return{id:o,getType:function(){return a},getInstanceID:Ir(function(){return n.then(function(c){return _n(c,{send:r})})}),close:function(){return n.then(Pr)},getName:s,focus:function(){return n.then(function(c){c.focus()})},isClosed:function(){return n.then(function(c){return F(c)})},setLocation:function(c,u){return u===void 0&&(u={}),n.then(function(h){var f=window.location.protocol+"//"+window.location.host,d=u.method,l=d===void 0?"get":d,m=u.body;if(c.indexOf("/")===0)c=""+f+c;else if(!c.match(/^https?:\/\//)&&c.indexOf(f)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(c));if(l==="post")return s().then(function(v){if(!v)throw new Error("Can not post to window without target name");(function(w){var x=w.url,D=w.target,b=w.body,S=w.method,R=S===void 0?"post":S,y=document.createElement("form");if(y.setAttribute("target",D),y.setAttribute("method",R),y.setAttribute("action",x),y.style.display="none",b)for(var P=0,B=Object.keys(b);P<B.length;P++){var A,fn=B[P],Nn=document.createElement("input");Nn.setAttribute("name",fn),Nn.setAttribute("value",(A=b[fn])==null?void 0:A.toString()),y.appendChild(Nn)}Yn().appendChild(y),y.submit(),Yn().removeChild(y)})({url:c,target:v,method:l,body:m})});if(l!=="get")throw new Error("Unsupported method: "+l);if(k(h))try{if(h.location&&typeof h.location.replace=="function"){h.location.replace(c);return}}catch{}h.location=c})},setName:function(c){return n.then(function(u){var h=k(u),f=Bn(u);if(!h)throw new Error("Can not set name for cross-domain window: "+c);vn(u).name=c,f&&f.setAttribute("name",c),i=W.resolve(c)})}}}var T=function(){function n(r){var e=r.send,o=r.win,i=r.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 W,this.serializedWindow=i||tr(this.actualWindowPromise,{send:e}),z("idToProxyWindow").set(this.getID(),this),o&&this.setWindow(o,{send:e})}var t=n.prototype;return t.getID=function(){return this.serializedWindow.id},t.getType=function(){return this.serializedWindow.getType()},t.isPopup=function(){return this.getType().then(function(r){return r==="popup"})},t.setLocation=function(r,e){var o=this;return this.serializedWindow.setLocation(r,e).then(function(){return o})},t.getName=function(){return this.serializedWindow.getName()},t.setName=function(r){var e=this;return this.serializedWindow.setName(r).then(function(){return e})},t.close=function(){var r=this;return this.serializedWindow.close().then(function(){return r})},t.focus=function(){var r=this,e=this.isPopup(),o=this.getName(),i=W.hash({isPopup:e,name:o}).then(function(s){var c=s.name;s.isPopup&&c&&window.open("",c,"noopener")}),a=this.serializedWindow.focus();return W.all([i,a]).then(function(){return r})},t.isClosed=function(){return this.serializedWindow.isClosed()},t.getWindow=function(){return this.actualWindow},t.setWindow=function(r,e){var o=e.send;this.actualWindow=r,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=tr(this.actualWindowPromise,{send:o,id:this.getID()}),j("winToProxyWindow").set(r,this)},t.awaitWindow=function(){return this.actualWindowPromise},t.matchWindow=function(r,e){var o=this,i=e.send;return W.try(function(){return o.actualWindow?r===o.actualWindow:W.hash({proxyInstanceID:o.getInstanceID(),knownWindowInstanceID:_n(r,{send:i})}).then(function(a){var s=a.proxyInstanceID===a.knownWindowInstanceID;return s&&o.setWindow(r,{send:i}),s})})},t.unwrap=function(){return this.actualWindow||this},t.getInstanceID=function(){return this.serializedWindow.getInstanceID()},t.shouldClean=function(){return!!(this.actualWindow&&F(this.actualWindow))},t.serialize=function(){return this.serializedWindow},n.unwrap=function(r){return n.isProxyWindow(r)?r.unwrap():r},n.serialize=function(r,e){var o=e.send;return An(),n.toProxyWindow(r,{send:o}).serialize()},n.deserialize=function(r,e){var o=e.send;return An(),z("idToProxyWindow").get(r.id)||new n({serializedWindow:r,send:o})},n.isProxyWindow=function(r){return!!(r&&!wn(r)&&r.isProxyWindow)},n.toProxyWindow=function(r,e){var o=e.send;if(An(),n.isProxyWindow(r))return r;var i=r;return j("winToProxyWindow").get(i)||new n({win:i,send:o})},n}();function Dn(n,t,r,e,o){var i=j("methodStore"),a=z("proxyWindowMethods");T.isProxyWindow(e)?a.set(n,{val:t,name:r,domain:o,source:e}):(a.del(n),i.getOrSet(e,function(){return{}})[n]={domain:o,name:r,val:t,source:e})}function er(n,t){var r=j("methodStore"),e=z("proxyWindowMethods");return r.getOrSet(n,function(){return{}})[t]||e.get(t)}function or(n,t,r,e,o){a=(i={on:o.on,send:o.send}).on,s=i.send,z("builtinListeners").getOrSet("functionCalls",function(){return a("postrobot_method",{domain:"*"},function(h){var f=h.source,d=h.origin,l=h.data,m=l.id,v=l.name,w=er(f,m);if(!w)throw new Error("Could not find method '"+v+"' with id: "+l.id+" in "+N(window));var x=w.source,D=w.domain,b=w.val;return W.try(function(){if(!_(D,d))throw new Error("Method '"+l.name+"' domain "+JSON.stringify(Pn(w.domain)?w.domain.source:w.domain)+" does not match origin "+d+" in "+N(window));if(T.isProxyWindow(x))return x.matchWindow(f,{send:s}).then(function(S){if(!S)throw new Error("Method call '"+l.name+"' failed - proxy window does not match source in "+N(window))})}).then(function(){return b.apply({source:f,origin:d},l.args)},function(S){return W.try(function(){if(b.onError)return b.onError(S)}).then(function(){throw S.stack&&(S.stack="Remote call to "+v+"("+function(R){return R===void 0&&(R=[]),(y=R,[].slice.call(y)).map(function(P){return typeof P=="string"?"'"+P+"'":P===void 0?"undefined":P===null?"null":typeof P=="boolean"?P.toString():Array.isArray(P)?"[ ... ]":typeof P=="object"?"{ ... }":typeof P=="function"?"() => { ... }":"<"+typeof P+">"}).join(", ");var y}(l.args)+`) failed
|
|
6
6
|
|
|
7
7
|
`+S.stack),S})}).then(function(S){return{result:S,id:m,name:v}})})});var i,a,s,c=r.__id__||U();n=T.unwrap(n);var u=r.__name__||r.name||e;return typeof u=="string"&&typeof u.indexOf=="function"&&u.indexOf("anonymous::")===0&&(u=u.replace("anonymous::",e+"::")),T.isProxyWindow(n)?(Dn(c,r,u,n,t),n.awaitWindow().then(function(h){Dn(c,r,u,h,t)})):Dn(c,r,u,n,t),Q("cross_domain_function",{id:c,name:u})}function ir(n,t,r,e){var o,i=e.on,a=e.send;return function(s,c){c===void 0&&(c=Nr);var u=JSON.stringify(s,function(h){var f=this[h];if(In(this))return f;var d=rr(f);if(!d)return f;var l=c[d]||Rr[d];return l?l(f,h):f});return u===void 0?"undefined":u}(r,((o={}).promise=function(s,c){return function(u,h,f,d,l){return Q("cross_domain_zalgo_promise",{then:or(u,h,function(m,v){return f.then(m,v)},d,{on:l.on,send:l.send})})}(n,t,s,c,{on:i,send:a})},o.function=function(s,c){return or(n,t,s,c,{on:i,send:a})},o.object=function(s){return wn(s)||T.isProxyWindow(s)?Q("cross_domain_window",T.serialize(s,{send:a})):s},o))}function ar(n,t,r,e){var o,i=e.send;return function(a,s){if(s===void 0&&(s=Mr),a!=="undefined")return JSON.parse(a,function(c,u){if(In(this))return u;var h,f;if(In(u)?(h=u.__type__,f=u.__val__):(h=rr(u),f=u),!h)return f;var d=s[h]||jr[h];return d?d(f,c):f})}(r,((o={}).cross_domain_zalgo_promise=function(a){return function(s,c,u){return new W(u.then)}(0,0,a)},o.cross_domain_function=function(a){return function(s,c,u,h){var f=u.id,d=u.name,l=h.send,m=function(w){w===void 0&&(w={});function x(){var D=arguments;return T.toProxyWindow(s,{send:l}).awaitWindow().then(function(b){var S=er(b,f);if(S&&S.val!==x)return S.val.apply({source:window,origin:N()},D);var R=[].slice.call(D);return w.fireAndForget?l(b,"postrobot_method",{id:f,name:d,args:R},{domain:c,fireAndForget:!0}):l(b,"postrobot_method",{id:f,name:d,args:R},{domain:c,fireAndForget:!1}).then(function(y){return y.data.result})}).catch(function(b){throw b})}return x.__name__=d,x.__origin__=c,x.__source__=s,x.__id__=f,x.origin=c,x},v=m();return v.fireAndForget=m({fireAndForget:!0}),v}(n,t,a,{send:i})},o.cross_domain_window=function(a){return T.deserialize(a,{send:i})},o))}var zn={};zn.postrobot_post_message=function(n,t,r){r.indexOf("file:")===0&&(r="*"),n.postMessage(t,r)};function Rn(n,t,r,e){var o=e.on,i=e.send;return W.try(function(){var a=j().getOrSet(n,function(){return{}});return a.buffer=a.buffer||[],a.buffer.push(r),a.flush=a.flush||W.flush().then(function(){if(F(n))throw new Error("Window is closed");var s=ir(n,t,((c={}).__post_robot_10_0_46__=a.buffer||[],c),{on:o,send:i}),c;delete a.buffer;for(var u=Object.keys(zn),h=[],f=0;f<u.length;f++){var d=u[f];try{zn[d](n,s,t)}catch(l){h.push(l)}}if(h.length===u.length)throw new Error(`All post-robot messaging strategies failed:
|
|
8
8
|
|