@soyio/soyio-widget 2.13.0 → 2.13.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.d.ts +0 -1
- package/dist/index.js +3 -8
- package/dist/index.umd.cjs +9 -11
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -180,7 +180,6 @@ function In(c, f, h) {
|
|
|
180
180
|
return l.id = f, l.src = c, l.style.cssText += `
|
|
181
181
|
width: 100% !important;
|
|
182
182
|
min-width: ${h.minWidth} !important;
|
|
183
|
-
max-width: ${h.maxWidth} !important;
|
|
184
183
|
border: none !important;
|
|
185
184
|
overflow: hidden !important;
|
|
186
185
|
opacity: 1;
|
|
@@ -200,14 +199,11 @@ const Tt = "https://app.soyio.id", Rt = "https://sandbox.soyio.id", Pn = "https:
|
|
|
200
199
|
"REJECTED_SIGNATURE",
|
|
201
200
|
"CLOSE_POPUP"
|
|
202
201
|
], Rn = "WIDGET_CLOSED", On = 420, An = 720, Nn = 500, Dn = {
|
|
203
|
-
minWidth: "375px"
|
|
204
|
-
maxWidth: "50rem"
|
|
202
|
+
minWidth: "375px"
|
|
205
203
|
}, Ln = {
|
|
206
|
-
minWidth: "375px"
|
|
207
|
-
maxWidth: "36rem"
|
|
204
|
+
minWidth: "375px"
|
|
208
205
|
}, zn = {
|
|
209
|
-
minWidth: "375px"
|
|
210
|
-
maxWidth: "50rem"
|
|
206
|
+
minWidth: "375px"
|
|
211
207
|
};
|
|
212
208
|
class Ie {
|
|
213
209
|
constructor(f) {
|
|
@@ -283,7 +279,6 @@ class jn {
|
|
|
283
279
|
transform: translate(-50%, -50%);
|
|
284
280
|
width: 100%;
|
|
285
281
|
min-width: 375px;
|
|
286
|
-
max-width: 36rem;
|
|
287
282
|
height: 120px;
|
|
288
283
|
background: #FFFFFF;
|
|
289
284
|
border: 1px solid #E5E7EB;
|
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 Ut=Object.getOwnPropertySymbols,Jn=Object.getPrototypeOf,Zn=Object.prototype.hasOwnProperty,Xn=Object.prototype.propertyIsEnumerable,Kn=Reflect.get;var Qn=(I,P,C)=>P in I?Yn(I,P,{enumerable:!0,configurable:!0,writable:!0,value:C}):I[P]=C;var Ft=(I,P)=>{var C={};for(var F in I)Zn.call(I,F)&&P.indexOf(F)<0&&(C[F]=I[F]);if(I!=null&&Ut)for(var F of Ut(I))P.indexOf(F)<0&&Xn.call(I,F)&&(C[F]=I[F]);return C};var L=(I,P,C)=>(Qn(I,typeof P!="symbol"?P+"":P,C),C),er=(I,P,C)=>{if(!P.has(I))throw TypeError("Cannot "+C)};var Ht=(I,P,C)=>{if(P.has(I))throw TypeError("Cannot add the same private member more than once");P instanceof WeakSet?P.add(I):P.set(I,C)};var _t=(I,P,C)=>(er(I,P,"access private method"),C),qt=(I,P,C)=>Kn(Jn(I),C,P);var q=(I,P,C)=>new Promise((F,
|
|
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 Ut=Object.getOwnPropertySymbols,Jn=Object.getPrototypeOf,Zn=Object.prototype.hasOwnProperty,Xn=Object.prototype.propertyIsEnumerable,Kn=Reflect.get;var Qn=(I,P,C)=>P in I?Yn(I,P,{enumerable:!0,configurable:!0,writable:!0,value:C}):I[P]=C;var Ft=(I,P)=>{var C={};for(var F in I)Zn.call(I,F)&&P.indexOf(F)<0&&(C[F]=I[F]);if(I!=null&&Ut)for(var F of Ut(I))P.indexOf(F)<0&&Xn.call(I,F)&&(C[F]=I[F]);return C};var L=(I,P,C)=>(Qn(I,typeof P!="symbol"?P+"":P,C),C),er=(I,P,C)=>{if(!P.has(I))throw TypeError("Cannot "+C)};var Ht=(I,P,C)=>{if(P.has(I))throw TypeError("Cannot add the same private member more than once");P instanceof WeakSet?P.add(I):P.set(I,C)};var _t=(I,P,C)=>(er(I,P,"access private method"),C),qt=(I,P,C)=>Kn(Jn(I),C,P);var q=(I,P,C)=>new Promise((F,xe)=>{var Ne=Q=>{try{ce(C.next(Q))}catch(de){xe(de)}},De=Q=>{try{ce(C.throw(Q))}catch(de){xe(de)}},ce=Q=>Q.done?F(Q.value):Promise.resolve(Q.value).then(Ne,De);ce((C=C.apply(I,P)).next())});var Ie,Bt;function P(l,p){for(var g=0;g<p.length;g++){const d=p[g];if(typeof d!="string"&&!Array.isArray(d)){for(const w in d)if(w!=="default"&&!(w in l)){const y=Object.getOwnPropertyDescriptor(d,w);y&&Object.defineProperty(l,w,y.get?y:{enumerable:!0,get:()=>d[w]})}}}return Object.freeze(Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}))}const C=!!(typeof window!="undefined"&&window.document&&window.document.createElement);class F{constructor(){L(this,"tooltipElement",null);L(this,"tooltipContent",null);L(this,"tooltipClass","soyio-tooltip");L(this,"hideTimeout",null);C&&(this.createTooltipElement(),this.setupGlobalListeners())}createTooltipElement(){const p=document.querySelector(`.${this.tooltipClass}`);this.tooltipElement=p||document.createElement("div"),this.tooltipElement.className=this.tooltipClass,this.tooltipElement.style.cssText=`
|
|
2
2
|
position: fixed;
|
|
3
3
|
z-index: 99999;
|
|
4
4
|
background: white;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
transition: opacity 0.2s ease-in-out;
|
|
15
15
|
transform: translateX(-50%) translateY(-100%);
|
|
16
16
|
margin-top: -8px;
|
|
17
|
-
`;const g=this.tooltipElement.children[0];this.tooltipContent=g||document.createElement("div"),this.tooltipContent.style.cssText="text-align: left;",this.tooltipElement.appendChild(this.tooltipContent),document.body.appendChild(this.tooltipElement)}setupGlobalListeners(){window.addEventListener("scroll",()=>this.hide(),!0),window.addEventListener("resize",()=>this.hide()),window.addEventListener("orientationchange",()=>this.hide())}show(p,g,d){!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=`${d}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)}}function
|
|
17
|
+
`;const g=this.tooltipElement.children[0];this.tooltipContent=g||document.createElement("div"),this.tooltipContent.style.cssText="text-align: left;",this.tooltipElement.appendChild(this.tooltipContent),document.body.appendChild(this.tooltipElement)}setupGlobalListeners(){window.addEventListener("scroll",()=>this.hide(),!0),window.addEventListener("resize",()=>this.hide()),window.addEventListener("orientationchange",()=>this.hide())}show(p,g,d){!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=`${d}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)}}function xe(l,p,g){return q(this,null,function*(){if(!l.contentWindow)throw new Error("Invalid iframe: contentWindow is null");const d=yield Promise.resolve().then(()=>ke);try{yield d.send(l.contentWindow,"SET_APPEARANCE",{appearance:p,identifier:g})}catch(w){console.error("Failed to send appearance config:",w)}})}const Ne="IFRAME_READY",De="IFRAME_HEIGHT_CHANGE",ce="TOOLTIP_STATE_CHANGE",Q="INFO_EVENT",de="CONSENT_STATE_CHANGE",U={onHeightChange:{},onIframeReady:{},onTooltipChange:{},onInfo:{},onStateChange:{}};let Ze,Xe,Ke,Qe,et;function Gt(){return q(this,null,function*(){const l=yield Promise.resolve().then(()=>ke);Ze||Xe||Ke||Qe||et||(Ze=l.on(De,p=>q(this,null,function*(){const g=p.data,d=U.onHeightChange[g.identifier];return d&&d(g.height),Promise.resolve()})),Xe=l.on(Ne,p=>q(this,null,function*(){const g=p.data,d=U.onIframeReady[g.identifier];return d&&d(),Promise.resolve()})),Ke=l.on(ce,p=>q(this,null,function*(){const g=p.data,d=U.onTooltipChange[g.identifier];return d&&d(g),Promise.resolve()})),Qe=l.on(de,p=>q(this,null,function*(){const g=p.data,d=U.onStateChange[g.identifier];return d&&d(g),Promise.resolve()})),et=l.on(Q,g=>q(this,[g],function*({data:p}){const E=p,{identifier:d}=E,w=Ft(E,["identifier"]),y=U.onInfo[d];return y&&y(w),Promise.resolve()})))})}function tt(l,p){const{onHeightChange:g,onIframeReady:d,onTooltipChange:w,onStateChange:y,onInfo:E}=p;g&&(U.onHeightChange[l]=g),d&&(U.onIframeReady[l]=d),w&&(U.onTooltipChange[l]=w),y&&(U.onStateChange[l]=y),E&&(U.onInfo[l]=E)}function $t(l){delete U.onHeightChange[l],delete U.onIframeReady[l],delete U.onTooltipChange[l],delete U.onStateChange[l],delete U.onInfo[l]}function Vt(l){const p=document.getElementById(l);p&&(console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."),p.remove())}function Yt(l){const p=document.querySelector(l);if(!p)throw new Error(`Iframe div container with id '${l}' not found`);if(p.tagName.toLowerCase()!=="div")throw new Error(`Iframe container with id '${l}' must be a <div> element`);const g=p;return g.style.position="relative",g.style.cssText+=`
|
|
18
18
|
padding: 0 !important;
|
|
19
19
|
margin: 0 !important;
|
|
20
20
|
display: flex !important;
|
|
@@ -26,20 +26,18 @@
|
|
|
26
26
|
`,g}function Jt(l,p,g){const d=document.createElement("iframe");return d.id=p,d.src=l,d.style.cssText+=`
|
|
27
27
|
width: 100% !important;
|
|
28
28
|
min-width: ${g.minWidth} !important;
|
|
29
|
-
max-width: ${g.maxWidth} !important;
|
|
30
29
|
border: none !important;
|
|
31
30
|
overflow: hidden !important;
|
|
32
31
|
opacity: 1;
|
|
33
32
|
transition: height 0.35s,
|
|
34
33
|
opacity 0.4s 0.1s;
|
|
35
|
-
`,d}function Zt(){return Math.random().toString(36).substring(2,10)}const nt="https://app.soyio.id",rt="https://sandbox.soyio.id",Xt="https://privacy.soyio.id",Kt="https://privacy-sandbox.soyio.id",Qt=["DISCLOSURE_REQUEST_SUCCESSFUL","IDENTITY_REGISTERED","IDENTITY_SIGNATURE","UNEXPECTED_ERROR","DENIED_CAMERA_PERMISSION","REJECTED_SIGNATURE","CLOSE_POPUP"],en="WIDGET_CLOSED",tn=420,nn=720,rn=500,on={minWidth:"375px"
|
|
34
|
+
`,d}function Zt(){return Math.random().toString(36).substring(2,10)}const nt="https://app.soyio.id",rt="https://sandbox.soyio.id",Xt="https://privacy.soyio.id",Kt="https://privacy-sandbox.soyio.id",Qt=["DISCLOSURE_REQUEST_SUCCESSFUL","IDENTITY_REGISTERED","IDENTITY_SIGNATURE","UNEXPECTED_ERROR","DENIED_CAMERA_PERMISSION","REJECTED_SIGNATURE","CLOSE_POPUP"],en="WIDGET_CLOSED",tn=420,nn=720,rn=500,on={minWidth:"375px"},an={minWidth:"375px"},sn={minWidth:"375px"};class be{constructor(p){L(this,"iframe",null);L(this,"skeleton",null);L(this,"options");L(this,"appearance");L(this,"tooltipManager");L(this,"defaultIframeCSSConfig",on);L(this,"Skeleton",null);L(this,"defaultUniqueId");this.options=p,this.appearance=p.appearance||null,this.tooltipManager=new F,this.defaultUniqueId=be.generateUniqueId()}static generateUniqueId(){return Zt()}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(){return q(this,null,function*(){this.iframe&&(this.options.onReady&&this.options.onReady(),yield xe(this.iframe,this.appearance,this.uniqueIdentifier),this.skeleton&&this.skeleton.hide())})}handleTooltipChange(p){if(!this.iframe)return;const g=this.iframe.getBoundingClientRect(),{text:d,coordinates:w,isVisible:y}=p,E=w.x+g.left,R=w.y+g.top;y?this.tooltipManager.show(d,E,R):this.tooltipManager.hide()}setupListeners(){return q(this,null,function*(){yield Gt();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 q(this,null,function*(){if(!C)return this;yield this.setupListeners(),Vt(this.iframeIdentifier);const g=Yt(p),d=this.iframeUrl();return this.iframe=Jt(d,this.iframeIdentifier,this.defaultIframeCSSConfig),this.Skeleton&&(this.skeleton=new this.Skeleton(this.uniqueIdentifier),this.skeleton.mount(g)),g.appendChild(this.iframe),this})}unmount(){C&&($t(this.uniqueIdentifier),this.skeleton&&(this.skeleton.hide(),this.skeleton=null),this.iframe&&(this.iframe.remove(),this.iframe=null))}}class un{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=`
|
|
36
35
|
position: absolute;
|
|
37
36
|
left: 50%;
|
|
38
37
|
top: 50%;
|
|
39
38
|
transform: translate(-50%, -50%);
|
|
40
39
|
width: 100%;
|
|
41
40
|
min-width: 375px;
|
|
42
|
-
max-width: 36rem;
|
|
43
41
|
height: 120px;
|
|
44
42
|
background: #FFFFFF;
|
|
45
43
|
border: 1px solid #E5E7EB;
|
|
@@ -125,13 +123,13 @@
|
|
|
125
123
|
width=${g},
|
|
126
124
|
height=${d},
|
|
127
125
|
top=${V},
|
|
128
|
-
left=${X}`),ze(),vn()}function gn(){ee&&(ee.close(),ee=null),Me()}let fe=null;function yn(){fe&&(fe.cancel(),fe=null)}function En(l){return q(this,null,function*(){const{onEvent:p}=l,g=yield Promise.resolve().then(()=>ke);fe&&yn(),fe=g.on(hn,w=>q(this,[w],function*({data:d}){return p(d),Qt.includes(d.eventName)?gn():d.eventName===en&&Me(),Promise.resolve()}))})}function
|
|
129
|
-
`;function R(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 R(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 le(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=R(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 Pe(e){if(!oe(e))throw new Error("Expected window to be same domain");return e}function ut(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 ct(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=[],Pn=[];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=Pn[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 dt(e){return e===void 0&&(e=window),le(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 Ce(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 ft(e){if(oe(e))return Pe(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 Cn(e){if(function(t){return t===void 0&&(t=window),!!V(t)}(e)){var n=ft(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 lt=[],he=[],Ue=0,me;function ht(){if(!Ue&&me){var e=me;me=null,e.resolve()}}function Fe(){Ue+=1}function pe(){Ue-=1,ht()}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){pe(),this.reject(s);return}pe(),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(lt.indexOf(i)===-1){lt.push(i),setTimeout(function(){throw i},1);for(var c=0;c<he.length;c++)he[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,f=void 0;if(t)try{f=u?u(this.value):this.value}catch(v){m.reject(v);continue}else if(r){if(!s){m.reject(this.error);continue}try{f=s(this.error)}catch(v){m.reject(v);continue}}if(f instanceof e&&(f.resolved||f.rejected)){var h=f;h.resolved?m.resolve(h.value):m.reject(h.error),h.errorHandled=!0}else ie(f)?f instanceof e&&(f.resolved||f.rejected)?f.resolved?m.resolve(f.value):m.reject(f.error):i(f,m):m.resolve(f)}o.length=0,this.dispatching=!1,pe()}},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,f){return m.then(function(h){i[s]=h,(o-=1)==0&&r.resolve(i)},function(h){f.reject(h)})},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 he.push(r),{cancel:function(){he.splice(he.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 pe(),e.reject(a)}return pe(),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=me=me||new t;return ht(),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(Ce(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!Ce(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 mt(e){return e.name||e.__name__||e.displayName||"anonymous"}function pt(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 vt(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 ve=0,wt=0;function we(e,n){n===void 0&&(n={});var t=n.thisNamespace,r=t!==void 0&&t,o=n.time,i,a,c=ve;ve+=1;var u=function(){for(var s=arguments.length,m=new Array(s),f=0;f<s;f++)m[f]=arguments[f];c<wt&&(i=null,a=null,c=ve,ve+=1);var h;h=r?(a=a||new He).getOrSet(this,Tn):i=i||{};var v;try{v=vt(m)}catch(O){return e.apply(this,arguments)}var b=h[v];if(b&&o&&Date.now()-b.time<o&&(delete h[v],b=null),b)return b.value;var x=Date.now(),S=e.apply(this,arguments);return h[v]={time:x,value:S},S};return u.reset=function(){i=null,a=null},pt(u,(n.name||mt(e))+"::memoized")}we.clear=function(){wt=ve};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=vt(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={}},pt(t,mt(e)+"::promiseMemoized")}function ae(){}function ge(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+`
|
|
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: "+ge(o,n+1)}}function gt(e){return typeof e=="string"?e:e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}we(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 ye(e,n,t){if(e.hasOwnProperty(n))return e[n];var r=t();return e[n]=r,r}function yt(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function Et(){return!!document.body&&document.readyState==="complete"}function
|
|
126
|
+
left=${X}`),ze(),vn()}function gn(){ee&&(ee.close(),ee=null),Me()}let fe=null;function yn(){fe&&(fe.cancel(),fe=null)}function En(l){return q(this,null,function*(){const{onEvent:p}=l,g=yield Promise.resolve().then(()=>ke);fe&&yn(),fe=g.on(hn,w=>q(this,[w],function*({data:d}){return p(d),Qt.includes(d.eventName)?gn():d.eventName===en&&Me(),Promise.resolve()}))})}function Sn(l){En(l)}class ot{constructor(p){Ht(this,Ie);L(this,"onEvent");this.onEvent=p.onEvent,C&&(wn(p),Sn({onEvent:_t(this,Ie,Bt).bind(this)}))}}Ie=new WeakSet,Bt=function(p){this.onEvent(p)};var xn=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function bn(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var it={exports:{}},at={exports:{}};(function(l,p){(function(g,d){l.exports=d()})(typeof self!="undefined"?self:xn,function(){return function(g){var d={};function w(y){if(d[y])return d[y].exports;var E=d[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=d,w.d=function(y,E,R){w.o(y,E)||Object.defineProperty(y,E,{enumerable:!0,get:R})},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 R=Object.create(null);if(w.r(R),Object.defineProperty(R,"default",{enumerable:!0,value:y}),2&E&&typeof y!="string")for(var Z in y)w.d(R,Z,function(X){return y[X]}.bind(null,Z));return R},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,d,w){w.r(d),w.d(d,"Promise",function(){return T}),w.d(d,"TYPES",function(){return $n}),w.d(d,"ProxyWindow",function(){return $}),w.d(d,"setup",function(){return kt}),w.d(d,"destroy",function(){return Gn}),w.d(d,"serializeMessage",function(){return Hn}),w.d(d,"deserializeMessage",function(){return _n}),w.d(d,"createProxyWindow",function(){return qn}),w.d(d,"toProxyWindow",function(){return Bn}),w.d(d,"on",function(){return ne}),w.d(d,"once",function(){return Fn}),w.d(d,"send",function(){return re}),w.d(d,"markWindowKnown",function(){return Pt}),w.d(d,"cleanUpWindow",function(){return Vn}),w.d(d,"bridge",function(){});function y(e){return{}.toString.call(e)==="[object RegExp]"}var E=`Call was rejected by callee.\r
|
|
127
|
+
`;function R(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 R(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 le(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=R(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 Pe(e){if(!oe(e))throw new Error("Expected window to be same domain");return e}function ut(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 ct(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=[],Pn=[];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=Pn[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 dt(e){return e===void 0&&(e=window),le(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 Ce(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 ft(e){if(oe(e))return Pe(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 Cn(e){if(function(t){return t===void 0&&(t=window),!!V(t)}(e)){var n=ft(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 lt=[],he=[],Ue=0,me;function ht(){if(!Ue&&me){var e=me;me=null,e.resolve()}}function Fe(){Ue+=1}function pe(){Ue-=1,ht()}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){pe(),this.reject(s);return}pe(),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(lt.indexOf(i)===-1){lt.push(i),setTimeout(function(){throw i},1);for(var c=0;c<he.length;c++)he[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(S){b.resolve(S)},function(S){b.reject(S)})},a=0;a<o.length;a++){var c=o[a],u=c.onSuccess,s=c.onError,m=c.promise,f=void 0;if(t)try{f=u?u(this.value):this.value}catch(v){m.reject(v);continue}else if(r){if(!s){m.reject(this.error);continue}try{f=s(this.error)}catch(v){m.reject(v);continue}}if(f instanceof e&&(f.resolved||f.rejected)){var h=f;h.resolved?m.resolve(h.value):m.reject(h.error),h.errorHandled=!0}else ie(f)?f instanceof e&&(f.resolved||f.rejected)?f.resolved?m.resolve(f.value):m.reject(f.error):i(f,m):m.resolve(f)}o.length=0,this.dispatching=!1,pe()}},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,f){return m.then(function(h){i[s]=h,(o-=1)==0&&r.resolve(i)},function(h){f.reject(h)})},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 he.push(r),{cancel:function(){he.splice(he.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 pe(),e.reject(a)}return pe(),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=me=me||new t;return ht(),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(Ce(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!Ce(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 mt(e){return e.name||e.__name__||e.displayName||"anonymous"}function pt(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 vt(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 ve=0,wt=0;function we(e,n){n===void 0&&(n={});var t=n.thisNamespace,r=t!==void 0&&t,o=n.time,i,a,c=ve;ve+=1;var u=function(){for(var s=arguments.length,m=new Array(s),f=0;f<s;f++)m[f]=arguments[f];c<wt&&(i=null,a=null,c=ve,ve+=1);var h;h=r?(a=a||new He).getOrSet(this,Tn):i=i||{};var v;try{v=vt(m)}catch(O){return e.apply(this,arguments)}var b=h[v];if(b&&o&&Date.now()-b.time<o&&(delete h[v],b=null),b)return b.value;var S=Date.now(),x=e.apply(this,arguments);return h[v]={time:S,value:x},x};return u.reset=function(){i=null,a=null},pt(u,(n.name||mt(e))+"::memoized")}we.clear=function(){wt=ve};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=vt(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={}},pt(t,mt(e)+"::promiseMemoized")}function ae(){}function ge(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
|
+
`+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: "+ge(o,n+1)}}function gt(e){return typeof e=="string"?e:e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}we(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 ye(e,n,t){if(e.hasOwnProperty(n))return e[n];var r=t();return e[n]=r,r}function yt(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function Et(){return!!document.body&&document.readyState==="complete"}function St(){return!!document.body&&document.readyState==="interactive"}we(function(){return new T(function(e){if(Et()||St())return e();var n=setInterval(function(){if(Et()||St())return clearInterval(n),e()},10)})});var Oe=typeof document!="undefined"?document.currentScript:null,On=we(function(){if(Oe||(Oe=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 Oe;throw new Error("Can not determine current script")}),An=K();we(function(){var e;try{e=On()}catch(r){return An}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 Ee(e){e===void 0&&(e=window);var n="__post_robot_10_0_46__";return e!==window?e[n]:e[n]=e[n]||{}}var xt=function(){return{}};function M(e,n){return e===void 0&&(e="store"),n===void 0&&(n=xt),ye(Ee(),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 ye(t,r,o)},reset:function(){t=n()},keys:function(){return Object.keys(t)}}})}var Nn=function(){};function Ae(){var e=Ee();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=xt),M("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 ye(r(o),e,i)}}})}function bt(){return M("instance").getOrSet("instanceID",K)}function It(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:bt()},{domain:"*",timeout:-1}).then(function(t){var r=t.origin,o=t.data.instanceID;return It(e,{domain:r}),{win:e,domain:r,instanceID:o}})}function Wt(e,n){var t=n.send;return _("windowInstanceIDPromises").getOrSet(e,function(){return qe(e,{send:t}).then(function(r){return r.instanceID})})}function Pt(e){_("knownWindows").set(e,!0)}function Be(e){return typeof e=="object"&&e!==null&&typeof e.__type__=="string"}function Ct(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 B,Dn=((B={}).function=function(){},B.error=function(e){return se("error",{message:e.message,stack:e.stack,code:e.code,data:e.data})},B.promise=function(){},B.regex=function(e){return se("regex",e.source)},B.date=function(e){return se("date",e.toJSON())},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(e){return se("undefined",e)},B),Ln={},G,jn=((G={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},G.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+`
|
|
131
129
|
|
|
132
|
-
`+o.stack,o},G.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},G.regex=function(e){return new RegExp(e)},G.date=function(e){return new Date(e)},G.array=function(e){return e},G.object=function(e){return e},G.string=function(e){return e},G.number=function(e){return e},G.boolean=function(e){return e},G.null=function(e){return e},G[void 0]=function(){},G),zn={};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=M("idToProxyWindow"),n=0,t=e.keys();n<t.length;n++){var r=t[n];e.get(r).shouldClean()&&e.del(r)}}function Tt(e,n){var t=n.send,r=n.id,o=r===void 0?K():r,i=e.then(function(u){if(oe(u))return Pe(u).name}),a=e.then(function(u){if(Y(u))throw new Error("Window is closed, can not determine type");return le(u)?"popup":"iframe"});i.catch(ae),a.catch(ae);var c=function(){return e.then(function(u){if(!Y(u))return oe(u)?Pe(u).name:i})};return{id:o,getType:function(){return a},getInstanceID:Rn(function(){return e.then(function(u){return Wt(u,{send:t})})}),close:function(){return e.then(Cn)},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 f=window.location.protocol+"//"+window.location.host,h=s.method,v=h===void 0?"get":h,b=s.body;if(u.indexOf("/")===0)u=""+f+u;else if(!u.match(/^https?:\/\//)&&u.indexOf(f)!==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(
|
|
130
|
+
`+o.stack,o},G.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},G.regex=function(e){return new RegExp(e)},G.date=function(e){return new Date(e)},G.array=function(e){return e},G.object=function(e){return e},G.string=function(e){return e},G.number=function(e){return e},G.boolean=function(e){return e},G.null=function(e){return e},G[void 0]=function(){},G),zn={};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=M("idToProxyWindow"),n=0,t=e.keys();n<t.length;n++){var r=t[n];e.get(r).shouldClean()&&e.del(r)}}function Tt(e,n){var t=n.send,r=n.id,o=r===void 0?K():r,i=e.then(function(u){if(oe(u))return Pe(u).name}),a=e.then(function(u){if(Y(u))throw new Error("Window is closed, can not determine type");return le(u)?"popup":"iframe"});i.catch(ae),a.catch(ae);var c=function(){return e.then(function(u){if(!Y(u))return oe(u)?Pe(u).name:i})};return{id:o,getType:function(){return a},getInstanceID:Rn(function(){return e.then(function(u){return Wt(u,{send:t})})}),close:function(){return e.then(Cn)},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 f=window.location.protocol+"//"+window.location.host,h=s.method,v=h===void 0?"get":h,b=s.body;if(u.indexOf("/")===0)u=""+f+u;else if(!u.match(/^https?:\/\//)&&u.indexOf(f)!==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(S){if(!S)throw new Error("Can not post to window without target name");(function(x){var O=x.url,z=x.target,N=x.body,A=x.method,k=A===void 0?"post":A,W=document.createElement("form");if(W.setAttribute("target",z),W.setAttribute("method",k),W.setAttribute("action",O),W.style.display="none",N)for(var D=0,J=Object.keys(N);D<J.length;D++){var j,Se=J[D],Je=document.createElement("input");Je.setAttribute("name",Se),Je.setAttribute("value",(j=N[Se])==null?void 0:j.toString()),W.appendChild(Je)}yt().appendChild(W),W.submit(),yt().removeChild(W)})({url:u,target:S,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(S){}m.location=u})},setName:function(u){return e.then(function(s){var m=oe(s),f=ft(s);if(!m)throw new Error("Can not set name for cross-domain window: "+u);Pe(s).name=u,f&&f.setAttribute("name",u),i=T.resolve(u)})}}}var $=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||Tt(this.actualWindowPromise,{send:r}),M("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=Tt(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:Wt(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(),M("idToProxyWindow").get(t.id)||new e({serializedWindow:t,send:o})},e.isProxyWindow=function(t){return!!(t&&!Ce(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=M("proxyWindowMethods");$.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 Rt(e,n){var t=_("methodStore"),r=M("proxyWindowMethods");return t.getOrSet(e,function(){return{}})[n]||r.get(n)}function Ot(e,n,t,r,o){a=(i={on:o.on,send:o.send}).on,c=i.send,M("builtinListeners").getOrSet("functionCalls",function(){return a("postrobot_method",{domain:"*"},function(m){var f=m.source,h=m.origin,v=m.data,b=v.id,S=v.name,x=Rt(f,b);if(!x)throw new Error("Could not find method '"+S+"' with id: "+v.id+" in "+H(window));var O=x.source,z=x.domain,N=x.val;return T.try(function(){if(!ue(z,h))throw new Error("Method '"+v.name+"' domain "+JSON.stringify(_e(x.domain)?x.domain.source:x.domain)+" does not match origin "+h+" in "+H(window));if($.isProxyWindow(O))return O.matchWindow(f,{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:f,origin:h},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 "+S+"("+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
|
|
133
131
|
|
|
134
|
-
`+A.stack),A})}).then(function(A){return{result:A,id:b,name:
|
|
132
|
+
`+A.stack),A})}).then(function(A){return{result:A,id:b,name:S}})})});var i,a,c,u=t.__id__||K();e=$.unwrap(e);var s=t.__name__||t.name||r;return typeof s=="string"&&typeof s.indexOf=="function"&&s.indexOf("anonymous::")===0&&(s=s.replace("anonymous::",r+"::")),$.isProxyWindow(e)?($e(u,t,s,e,n),e.awaitWindow().then(function(m){$e(u,t,s,m,n)})):$e(u,t,s,e,n),se("cross_domain_function",{id:u,name:s})}function At(e,n,t,r){var o,i=r.on,a=r.send;return function(c,u){u===void 0&&(u=Ln);var s=JSON.stringify(c,function(m){var f=this[m];if(Be(this))return f;var h=Ct(f);if(!h)return f;var v=u[h]||Dn[h];return v?v(f,m):f});return s===void 0?"undefined":s}(t,((o={}).promise=function(c,u){return function(s,m,f,h,v){return se("cross_domain_zalgo_promise",{then:Ot(s,m,function(b,S){return f.then(b,S)},h,{on:v.on,send:v.send})})}(e,n,c,u,{on:i,send:a})},o.function=function(c,u){return Ot(e,n,c,u,{on:i,send:a})},o.object=function(c){return Ce(c)||$.isProxyWindow(c)?se("cross_domain_window",$.serialize(c,{send:a})):c},o))}function Nt(e,n,t,r){var o,i=r.send;return function(a,c){if(c===void 0&&(c=zn),a!=="undefined")return JSON.parse(a,function(u,s){if(Be(this))return s;var m,f;if(Be(s)?(m=s.__type__,f=s.__val__):(m=Ct(s),f=s),!m)return f;var h=c[m]||jn[m];return h?h(f,u):f})}(t,((o={}).cross_domain_zalgo_promise=function(a){return function(c,u,s){return new T(s.then)}(0,0,a)},o.cross_domain_function=function(a){return function(c,u,s,m){var f=s.id,h=s.name,v=m.send,b=function(x){x===void 0&&(x={});function O(){var z=arguments;return $.toProxyWindow(c,{send:v}).awaitWindow().then(function(N){var A=Rt(N,f);if(A&&A.val!==O)return A.val.apply({source:window,origin:H()},z);var k=[].slice.call(z);return x.fireAndForget?v(N,"postrobot_method",{id:f,name:h,args:k},{domain:u,fireAndForget:!0}):v(N,"postrobot_method",{id:f,name:h,args:k},{domain:u,fireAndForget:!1}).then(function(W){return W.data.result})}).catch(function(N){throw N})}return O.__name__=h,O.__origin__=u,O.__source__=c,O.__id__=f,O.origin=u,O},S=b();return S.fireAndForget=b({fireAndForget:!0}),S}(e,n,a,{send:i})},o.cross_domain_window=function(a){return $.deserialize(a,{send:i})},o))}var Ve={};Ve.postrobot_post_message=function(e,n,t){t.indexOf("file:")===0&&(t="*"),e.postMessage(n,t)};function Ye(e,n,t,r){var o=r.on,i=r.send;return T.try(function(){var a=_().getOrSet(e,function(){return{}});return a.buffer=a.buffer||[],a.buffer.push(t),a.flush=a.flush||T.flush().then(function(){if(Y(e))throw new Error("Window is closed");var c=At(e,n,((u={}).__post_robot_10_0_46__=a.buffer||[],u),{on:o,send:i}),u;delete a.buffer;for(var s=Object.keys(Ve),m=[],f=0;f<s.length;f++){var h=s[f];try{Ve[h](e,c,n)}catch(v){m.push(v)}}if(m.length===s.length)throw new Error(`All post-robot messaging strategies failed:
|
|
135
133
|
|
|
136
134
|
`+m.map(function(v,b){return b+". "+ge(v)}).join(`
|
|
137
135
|
|
|
@@ -139,6 +137,6 @@
|
|
|
139
137
|
|
|
140
138
|
`+ge(h))}})}return T.all([T.flush().then(function(){if(!t.fireAndForget&&!Y(e))try{return Ye(e,n,{id:K(),origin:H(window),type:"postrobot_message_ack",hash:t.hash,name:t.name},{on:o,send:i})}catch(s){throw new Error("Send ack message failed for "+c+" in "+H()+`
|
|
141
139
|
|
|
142
|
-
`+ge(s))}}),T.try(function(){if(!a)throw new Error("No handler found for post message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return a.handler({source:e,origin:n,data:t.data})}).then(function(s){return u("success",s)},function(s){return u("error",null,s)})]).then(ae).catch(function(s){if(a&&a.handleError)return a.handleError(s);throw s})}function kn(e,n,t){if(!jt(t.hash)){var r=Dt(t.hash);if(!r)throw new Error("No handler found for post message ack for message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!ue(r.domain,n))throw new Error("Ack origin "+n+" does not match domain "+r.domain.toString());if(e!==r.win)throw new Error("Ack source does not match registered window")}catch(o){r.promise.reject(o)}r.ack=!0}}function Un(e,n,t){if(!jt(t.hash)){var r=Dt(t.hash);if(!r)throw new Error("No handler found for post message response for message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!ue(r.domain,n))throw new Error("Response origin "+n+" does not match domain "+(o=r.domain,Array.isArray(o)?"("+o.join(" | ")+")":y(o)?"RegExp("+o.toString()+")":o.toString()));var o;if(e!==r.win)throw new Error("Response source does not match registered window");Lt(t.hash),t.ack==="error"?r.promise.reject(t.error):t.ack==="success"&&r.promise.resolve({source:e,origin:n,data:t.data})}}function Mt(e,n){var t=n.on,r=n.send,o=M("receivedMessages");try{if(!window||window.closed||!e.source)return}catch(m){return}var i=e.source,a=e.origin,c=function(m,f,h,v){var b=v.on,
|
|
140
|
+
`+ge(s))}}),T.try(function(){if(!a)throw new Error("No handler found for post message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return a.handler({source:e,origin:n,data:t.data})}).then(function(s){return u("success",s)},function(s){return u("error",null,s)})]).then(ae).catch(function(s){if(a&&a.handleError)return a.handleError(s);throw s})}function kn(e,n,t){if(!jt(t.hash)){var r=Dt(t.hash);if(!r)throw new Error("No handler found for post message ack for message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!ue(r.domain,n))throw new Error("Ack origin "+n+" does not match domain "+r.domain.toString());if(e!==r.win)throw new Error("Ack source does not match registered window")}catch(o){r.promise.reject(o)}r.ack=!0}}function Un(e,n,t){if(!jt(t.hash)){var r=Dt(t.hash);if(!r)throw new Error("No handler found for post message response for message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!ue(r.domain,n))throw new Error("Response origin "+n+" does not match domain "+(o=r.domain,Array.isArray(o)?"("+o.join(" | ")+")":y(o)?"RegExp("+o.toString()+")":o.toString()));var o;if(e!==r.win)throw new Error("Response source does not match registered window");Lt(t.hash),t.ack==="error"?r.promise.reject(t.error):t.ack==="success"&&r.promise.resolve({source:e,origin:n,data:t.data})}}function Mt(e,n){var t=n.on,r=n.send,o=M("receivedMessages");try{if(!window||window.closed||!e.source)return}catch(m){return}var i=e.source,a=e.origin,c=function(m,f,h,v){var b=v.on,S=v.send,x;try{x=Nt(f,h,m,{on:b,send:S})}catch(z){return}if(x&&typeof x=="object"&&x!==null){var O=x.__post_robot_10_0_46__;if(Array.isArray(O))return O}}(e.data,i,a,{on:t,send:r});if(c){Pt(i);for(var u=0;u<c.length;u++){var s=c[u];if(o.has(s.id)||(o.set(s.id,!0),Y(i)&&!s.fireAndForget))return;s.origin.indexOf("file:")===0&&(a="file://");try{s.type==="postrobot_message_request"?Mn(i,a,s,{on:t,send:r}):s.type==="postrobot_message_response"?Un(i,a,s):s.type==="postrobot_message_ack"&&kn(i,a,s)}catch(m){setTimeout(function(){throw m},0)}}}}function ne(e,n,t){if(!e)throw new Error("Expected name");if(typeof(n=n||{})=="function"&&(t=n,n={}),!t)throw new Error("Expected handler");var r=function o(i,a){var c=i.name,u=i.win,s=i.domain,m=_("requestListeners");if(!c||typeof c!="string")throw new Error("Name required to add request listener");if(u&&u!=="*"&&$.isProxyWindow(u)){var f=u.awaitWindow().then(function(j){return o({name:c,win:j,domain:s},a)});return{cancel:function(){f.then(function(j){return j.cancel()},ae)}}}var h=u;if(Array.isArray(h)){for(var v=[],b=0,S=h;b<S.length;b++)v.push(o({name:c,domain:s,win:S[b]},a));return{cancel:function(){for(var j=0;j<v.length;j++)v[j].cancel()}}}if(Array.isArray(s)){for(var x=[],O=0,z=s;O<z.length;O++)x.push(o({name:c,win:h,domain:z[O]},a));return{cancel:function(){for(var j=0;j<x.length;j++)x[j].cancel()}}}var N=zt({name:c,win:h,domain:s});h&&h!=="*"||(h=Ae());var A=(s=s||"*").toString();if(N)throw h&&s?new Error("Request listener already exists for "+c+" on domain "+s.toString()+" for "+(h===Ae()?"wildcard":"specified")+" window"):h?new Error("Request listener already exists for "+c+" for "+(h===Ae()?"wildcard":"specified")+" window"):s?new Error("Request listener already exists for "+c+" on domain "+s.toString()):new Error("Request listener already exists for "+c);var k=m.getOrSet(h,function(){return{}}),W=ye(k,c,function(){return{}}),D,J;return _e(s)?(D=ye(W,"__domain_regex__",function(){return[]})).push(J={regex:s,listener:a}):W[A]=a,{cancel:function(){delete W[A],J&&(D.splice(D.indexOf(J,1)),D.length||delete W.__domain_regex__),Object.keys(W).length||delete k[c],h&&!Object.keys(k).length&&m.del(h)}}}({name:e,win:n.window,domain:n.domain||"*"},{handler:t||n.handler,handleError:n.errorHandler||function(o){throw o}});return{cancel:function(){r.cancel()}}}function Fn(e,n,t){typeof(n=n||{})=="function"&&(t=n,n={});var r=new T,o;return n.errorHandler=function(i){o.cancel(),r.reject(i)},o=ne(e,n,function(i){if(o.cancel(),r.resolve(i),t)return t(i)}),r.cancel=o.cancel,r}var re=function e(n,t,r,o){var i=(o=o||{}).domain||"*",a=o.timeout||-1,c=o.timeout||5e3,u=o.fireAndForget||!1;return $.toProxyWindow(n,{send:e}).awaitWindow().then(function(s){return T.try(function(){if(function(m,f,h){if(!m)throw new Error("Expected name");if(h&&typeof h!="string"&&!Array.isArray(h)&&!_e(h))throw new TypeError("Can not send "+m+". Expected domain "+JSON.stringify(h)+" to be a string, array, or regex");if(Y(f))throw new Error("Can not send "+m+". Target window is closed")}(t,s,i),function(m,f){var h=dt(f);if(h)return h===m;if(f===m||function(S){S===void 0&&(S=window);try{if(S.top)return S.top}catch(N){}if(V(S)===S)return S;try{if(ut(window,S)&&window.top)return window.top}catch(N){}try{if(ut(S,window)&&window.top)return window.top}catch(N){}for(var x=0,O=function N(A){for(var k=[],W=0,D=ct(A);W<D.length;W++){var J=D[W];k.push(J);for(var j=0,Se=N(J);j<Se.length;j++)k.push(Se[j])}return k}(S);x<O.length;x++){var z=O[x];try{if(z.top)return z.top}catch(N){}if(V(z)===z)return z}}(f)===f)return!1;for(var v=0,b=ct(m);v<b.length;v++)if(b[v]===f)return!0;return!1}(window,s))return function(m,f,h){f===void 0&&(f=5e3),h===void 0&&(h="Window");var v=function(b){return _("helloPromises").getOrSet(b,function(){return new T})}(m);return f!==-1&&(v=v.timeout(f,new Error(h+" did not load after "+f+"ms"))),v}(s,c)}).then(function(m){return function(f,h,v,b){var S=b.send;return T.try(function(){return typeof h=="string"?h:T.try(function(){return v||qe(f,{send:S}).then(function(x){return x.domain})}).then(function(x){if(!ue(h,h))throw new Error("Domain "+gt(h)+" does not match "+gt(h));return x})})}(s,i,(m===void 0?{}:m).domain,{send:e})}).then(function(m){var f=m,h=t==="postrobot_method"&&r&&typeof r.name=="string"?r.name+"()":t,v=new T,b=t+"_"+K();if(!u){var S={name:t,win:s,domain:f,promise:v};(function(W,D){M("responseListeners").set(W,D)})(b,S);var x=_("requestPromises").getOrSet(s,function(){return[]});x.push(v),v.catch(function(){(function(W){M("erroredResponseListeners").set(W,!0)})(b),Lt(b)});var O=function(W){return _("knownWindows").get(W,!1)}(s)?1e4:2e3,z=a,N=O,A=z,k=function(W,D){var J;return function j(){J=setTimeout(function(){(function(){if(Y(s))return v.reject(new Error("Window closed for "+t+" before "+(S.ack?"response":"ack")));if(S.cancelled)return v.reject(new Error("Response listener was cancelled for "+t));N=Math.max(N-500,0),A!==-1&&(A=Math.max(A-500,0)),S.ack||N!==0?A===0&&v.reject(new Error("No response for postMessage "+h+" in "+H()+" in "+z+"ms")):v.reject(new Error("No ack for postMessage "+h+" in "+H()+" in "+O+"ms"))})(),j()},500)}(),{cancel:function(){clearTimeout(J)}}}();v.finally(function(){k.cancel(),x.splice(x.indexOf(v,1))}).catch(ae)}return Ye(s,f,{id:K(),origin:H(window),type:"postrobot_message_request",hash:b,name:t,data:r,fireAndForget:u},{on:ne,send:e}).then(function(){return u?v.resolve():v},function(W){throw new Error("Send request message failed for "+h+" in "+H()+`
|
|
143
141
|
|
|
144
142
|
`+ge(W))})})})};function Hn(e,n,t){return At(e,n,t,{on:ne,send:re})}function _n(e,n,t){return Nt(e,n,t,{on:ne,send:re})}function qn(e){return new $({send:re,win:e})}function Bn(e){return $.toProxyWindow(e,{send:re})}function kt(){Ee().initialized||(Ee().initialized=!0,n=(e={on:ne,send:re}).on,t=e.send,(r=Ee()).receiveMessage=r.receiveMessage||function(o){return Mt(o,{on:n,send:t})},function(o){var i=o.on,a=o.send;M().getOrSet("postMessageListener",function(){return function(c,u,s){return c.addEventListener("message",s),{cancel:function(){c.removeEventListener("message",s)}}}(window,0,function(c){(function(u,s){var m=s.on,f=s.send;T.try(function(){var h=u.source||u.sourceElement,v=u.origin||u.originalEvent&&u.originalEvent.origin,b=u.data;if(v==="null"&&(v="file://"),h){if(!v)throw new Error("Post message did not have origin domain");Mt({source:h,origin:v,data:b},{on:m,send:f})}})})(c,{on:i,send:a})})})}({on:ne,send:re}),function(o){var i=o.on,a=o.send;M("builtinListeners").getOrSet("helloListener",function(){var c=i("postrobot_hello",{domain:"*"},function(s){return It(s.source,{domain:s.origin}),{instanceID:bt()}}),u=dt();return u&&qe(u,{send:a}).catch(function(s){}),c})}({on:ne,send:re}));var e,n,t,r}function Gn(){(function(){for(var n=M("responseListeners"),t=0,r=n.keys();t<r.length;t++){var o=r[t],i=n.get(o);i&&(i.cancelled=!0),n.del(o)}})(),(e=M().get("postMessageListener"))&&e.cancel();var e;delete window.__post_robot_10_0_46__}var $n=!0;function Vn(e){for(var n=0,t=_("requestPromises").get(e,[]);n<t.length;n++)t[n].reject(new Error("Window "+(Y(e)?"closed":"cleaned up")+" before response")).catch(ae)}kt()}])})})(at);var In=at.exports;(function(l){l.exports=In,l.exports.default=l.exports})(it);var st=it.exports;const ke=P({__proto__:null,default:bn(st)},[st]);I.ConsentBox=Le,I.PrivacyCenterBox=fn,I.SoyioTypes=ln,I.SoyioWidget=ot,I._TooltipManager=F,I.default=ot,Object.defineProperties(I,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|