@soyio/soyio-widget 2.9.0 → 2.10.0
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 +9 -4
- package/dist/index.js +773 -735
- package/dist/index.umd.cjs +48 -48
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
|
-
(function(I,
|
|
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 Un=Object.defineProperty;var Hn=Object.getPrototypeOf;var Fn=Reflect.get;var Bn=(I,P,N)=>P in I?Un(I,P,{enumerable:!0,configurable:!0,writable:!0,value:N}):I[P]=N;var U=(I,P,N)=>(Bn(I,typeof P!="symbol"?P+"":P,N),N),qn=(I,P,N)=>{if(!P.has(I))throw TypeError("Cannot "+N)};var Mt=(I,P,N)=>{if(P.has(I))throw TypeError("Cannot add the same private member more than once");P instanceof WeakSet?P.add(I):P.set(I,N)};var Lt=(I,P,N)=>(qn(I,P,"access private method"),N),kt=(I,P,N)=>Fn(Hn(I),N,P);var Y=(I,P,N)=>new Promise((Oe,Ee)=>{var Ae=z=>{try{ue(N.next(z))}catch(ae){Ee(ae)}},De=z=>{try{ue(N.throw(z))}catch(ae){Ee(ae)}},ue=z=>z.done?Oe(z.value):Promise.resolve(z.value).then(Ae,De);ue((N=N.apply(I,P)).next())});var be,Ut;function P(m,p){for(var w=0;w<p.length;w++){const h=p[w];if(typeof h!="string"&&!Array.isArray(h)){for(const g in h)if(g!=="default"&&!(g in m)){const y=Object.getOwnPropertyDescriptor(h,g);y&&Object.defineProperty(m,g,y.get?y:{enumerable:!0,get:()=>h[g]})}}}return Object.freeze(Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}))}class N{constructor(){U(this,"tooltipElement",null);U(this,"tooltipContent",null);U(this,"tooltipClass","soyio-tooltip");U(this,"hideTimeout",null);this.createTooltipElement(),this.setupGlobalListeners()}createTooltipElement(){const p=document.querySelector(`.${this.tooltipClass}`);p==null||p.remove(),this.tooltipElement=document.createElement("div"),this.tooltipElement.className=this.tooltipClass,this.tooltipElement.style.cssText=`
|
|
2
|
+
position: fixed;
|
|
3
|
+
z-index: 99999;
|
|
4
|
+
background: white;
|
|
5
|
+
padding: 8px 12px;
|
|
6
|
+
border-radius: 4px;
|
|
7
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
|
|
8
|
+
font-size: 14px;
|
|
9
|
+
font-family: Helvetica neue, Helvetica, Arial, sans-serif;
|
|
10
|
+
max-width: 300px;
|
|
11
|
+
word-wrap: break-word;
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
opacity: 0;
|
|
14
|
+
transition: opacity 0.2s ease-in-out;
|
|
15
|
+
transform: translateX(-50%) translateY(-100%);
|
|
16
|
+
margin-top: -8px;
|
|
17
|
+
`,this.tooltipContent=document.createElement("div"),this.tooltipContent.style.cssText="text-align: center;",this.tooltipElement.appendChild(this.tooltipContent);const w=document.createElement("div");w.style.cssText=`
|
|
18
|
+
position: absolute;
|
|
19
|
+
bottom: -4px;
|
|
20
|
+
left: 50%;
|
|
21
|
+
transform: translateX(-50%) rotate(45deg);
|
|
22
|
+
width: 8px;
|
|
23
|
+
height: 8px;
|
|
24
|
+
background: white;
|
|
25
|
+
box-shadow: 2px 2px 2px rgba(0,0,0,0.1);
|
|
26
|
+
`,this.tooltipElement.appendChild(w),document.body.appendChild(this.tooltipElement)}setupGlobalListeners(){window.addEventListener("scroll",()=>this.hide(),!0),window.addEventListener("resize",()=>this.hide()),window.addEventListener("orientationchange",()=>this.hide())}show(p,w,h){!this.tooltipElement||!this.tooltipContent||(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.tooltipContent.textContent=p,this.tooltipElement.style.left=`${w}px`,this.tooltipElement.style.top=`${h}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 Oe(m,p,w){return Y(this,null,function*(){if(!m.contentWindow)throw new Error("Invalid iframe: contentWindow is null");const h=yield Promise.resolve().then(()=>Ue);try{yield h.send(m.contentWindow,"SET_APPEARANCE",{appearance:p,identifier:w})}catch(g){console.error("Failed to send appearance config:",g)}})}const Ee="IFRAME_READY",Ae="IFRAME_HEIGHT_CHANGE",De="TOOLTIP_STATE_CHANGE",ue="CONSENT_STATE_CHANGE",z={onHeightChange:{},onIframeReady:{},onTooltipChange:{},onStateChange:{}};let ae,Ve,Xe,Qe;function Ht(){return Y(this,null,function*(){const m=yield Promise.resolve().then(()=>Ue);ae||Ve||Xe||Qe||(ae=m.on(Ae,p=>Y(this,null,function*(){const w=p.data,h=z.onHeightChange[w.identifier];h&&h(w.height)})),Ve=m.on(Ee,p=>Y(this,null,function*(){const w=p.data,h=z.onIframeReady[w.identifier];h&&h()})),Xe=m.on(De,p=>Y(this,null,function*(){const w=p.data,h=z.onTooltipChange[w.identifier];h&&h(w)})),Qe=m.on(ue,p=>Y(this,null,function*(){const w=p.data,h=z.onStateChange[w.identifier];h&&h(w)})))})}function et(m,p){const{onHeightChange:w,onIframeReady:h,onTooltipChange:g,onStateChange:y}=p;w&&(z.onHeightChange[m]=w),h&&(z.onIframeReady[m]=h),g&&(z.onTooltipChange[m]=g),y&&(z.onStateChange[m]=y)}function Ft(m){delete z.onHeightChange[m],delete z.onIframeReady[m],delete z.onTooltipChange[m],delete z.onStateChange[m]}function Bt(m){const p=document.getElementById(m);p&&(console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."),p.remove())}function qt(m){const p=document.querySelector(m);if(!p)throw new Error(`Iframe div container with id '${m}' not found`);if(p.tagName.toLowerCase()!=="div")throw new Error(`Iframe container with id '${m}' must be a <div> element`);const w=p;return w.style.position="relative",w.style.cssText+=`
|
|
2
27
|
padding: 0 !important;
|
|
3
28
|
margin: 0 !important;
|
|
4
29
|
display: flex !important;
|
|
@@ -7,7 +32,7 @@
|
|
|
7
32
|
border: none !important;
|
|
8
33
|
transition: height 0.35s !important;
|
|
9
34
|
opacity: 1 !important;
|
|
10
|
-
`,w}function
|
|
35
|
+
`,w}function Gt(m,p){const w=document.createElement("iframe");return w.id=p,w.src=m,w.style.cssText+=`
|
|
11
36
|
width: 100% !important;
|
|
12
37
|
min-width: 375px !important;
|
|
13
38
|
max-width: 36rem !important;
|
|
@@ -17,7 +42,7 @@
|
|
|
17
42
|
opacity: 1;
|
|
18
43
|
transition: height 0.35s,
|
|
19
44
|
opacity 0.4s 0.1s;
|
|
20
|
-
`,w}function
|
|
45
|
+
`,w}function _t(){return Math.random().toString(36).substring(2,10)}class xe{constructor(p){U(this,"iframe",null);U(this,"skeleton",null);U(this,"defaultIframePrefix","soyio-iframe");U(this,"options");U(this,"appearance");U(this,"tooltipManager");U(this,"SkeletonKlass",null);U(this,"defaultUniqueId");this.options=p,this.appearance=p.appearance||null,this.tooltipManager=new N,this.defaultUniqueId=xe.generateUniqueId()}static generateUniqueId(){return _t()}get uniqueIdentifier(){return this.defaultUniqueId}get iframePrefix(){return this.defaultIframePrefix}get iframeIdentifier(){return`${this.iframePrefix}-${this.uniqueIdentifier}`}handleHeightChange(p){if(!this.iframe||(this.iframe.style.height=`${p}px`,p>0))return;const{parentElement:w}=this.iframe;w&&(w.style.display="none")}handleIframeReady(){this.iframe&&(this.options.onReady&&this.options.onReady(),this.appearance&&Oe(this.iframe,this.appearance,this.uniqueIdentifier),this.skeleton&&this.skeleton.hide())}handleTooltipChange(p){if(!this.iframe)return;const w=this.iframe.getBoundingClientRect(),{text:h,coordinates:g,isVisible:y}=p,E=g.x+w.left,T=g.y+w.top;y?this.tooltipManager.show(h,E,T):this.tooltipManager.hide()}setupListeners(){return Y(this,null,function*(){yield Ht();const p={onHeightChange:this.handleHeightChange.bind(this),onIframeReady:this.handleIframeReady.bind(this),onTooltipChange:this.handleTooltipChange.bind(this)};et(this.uniqueIdentifier,p)})}mount(p){return Y(this,null,function*(){yield this.setupListeners(),Bt(this.iframeIdentifier);const w=qt(p),h=this.iframeUrl();return this.iframe=Gt(h,this.iframeIdentifier),this.SkeletonKlass&&(this.skeleton=new this.SkeletonKlass(this.uniqueIdentifier),this.skeleton.mount(w)),w.appendChild(this.iframe),this})}unmount(){Ft(this.uniqueIdentifier),this.skeleton&&(this.skeleton.hide(),this.skeleton=null),this.iframe&&(this.iframe.remove(),this.iframe=null)}}class $t{constructor(p){U(this,"element");U(this,"identifier");this.identifier=`skeleton-${p}`,this.element=document.createElement("div"),this.element.id=this.identifier,this.element.style.cssText=`
|
|
21
46
|
position: absolute;
|
|
22
47
|
left: 50%;
|
|
23
48
|
top: 50%;
|
|
@@ -41,7 +66,7 @@
|
|
|
41
66
|
display: flex;
|
|
42
67
|
flex-direction: column;
|
|
43
68
|
justify-content: space-between;
|
|
44
|
-
`;const
|
|
69
|
+
`;const h=document.createElement("div");h.style.cssText=`
|
|
45
70
|
display: flex;
|
|
46
71
|
align-items: center;
|
|
47
72
|
gap: 0.75rem;
|
|
@@ -69,11 +94,11 @@
|
|
|
69
94
|
border-radius: 50%;
|
|
70
95
|
margin-left: auto;
|
|
71
96
|
margin-right: 3px;
|
|
72
|
-
`;const
|
|
97
|
+
`;const T=document.createElement("div");T.style.cssText=`
|
|
73
98
|
display: flex;
|
|
74
99
|
align-items: center;
|
|
75
100
|
gap: 1rem;
|
|
76
|
-
`;const
|
|
101
|
+
`;const Z=document.createElement("div");Z.style.cssText=`
|
|
77
102
|
width: 1rem;
|
|
78
103
|
height: 1rem;
|
|
79
104
|
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
@@ -82,73 +107,48 @@
|
|
|
82
107
|
border-radius: 0.25rem;
|
|
83
108
|
flex-shrink: 0;
|
|
84
109
|
margin-left: 10px;
|
|
85
|
-
`;const
|
|
110
|
+
`;const K=document.createElement("div");K.style.cssText=`
|
|
86
111
|
flex-grow: 1;
|
|
87
112
|
display: flex;
|
|
88
113
|
flex-direction: column;
|
|
89
114
|
gap: 0.5rem;
|
|
90
|
-
`;const
|
|
115
|
+
`;const _=document.createElement("div");_.style.cssText=`
|
|
91
116
|
height: 0.875rem;
|
|
92
117
|
width: 80%;
|
|
93
118
|
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
94
119
|
background-size: 200% 100%;
|
|
95
120
|
animation: shimmer 1.5s infinite;
|
|
96
121
|
border-radius: 0.125rem;
|
|
97
|
-
`;const
|
|
122
|
+
`;const de=document.createElement("div");if(de.style.cssText=`
|
|
98
123
|
height: 0.875rem;
|
|
99
124
|
width: 60%;
|
|
100
125
|
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
101
126
|
background-size: 200% 100%;
|
|
102
127
|
animation: shimmer 1.5s infinite;
|
|
103
128
|
border-radius: 0.125rem;
|
|
104
|
-
`,!document.getElementById("skeleton-animation")){const
|
|
129
|
+
`,!document.getElementById("skeleton-animation")){const Q=document.createElement("style");Q.id="skeleton-animation",Q.textContent=`
|
|
105
130
|
@keyframes shimmer {
|
|
106
131
|
0% { background-position: 200% 0; }
|
|
107
132
|
100% { background-position: -200% 0; }
|
|
108
133
|
}
|
|
109
|
-
`,document.head.appendChild(
|
|
110
|
-
position: fixed;
|
|
111
|
-
z-index: 99999;
|
|
112
|
-
background: white;
|
|
113
|
-
padding: 8px 12px;
|
|
114
|
-
border-radius: 4px;
|
|
115
|
-
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
|
|
116
|
-
font-size: 14px;
|
|
117
|
-
font-family: Helvetica neue, Helvetica, Arial, sans-serif;
|
|
118
|
-
max-width: 300px;
|
|
119
|
-
word-wrap: break-word;
|
|
120
|
-
pointer-events: none;
|
|
121
|
-
opacity: 0;
|
|
122
|
-
transition: opacity 0.2s ease-in-out;
|
|
123
|
-
transform: translateX(-50%) translateY(-100%);
|
|
124
|
-
margin-top: -8px;
|
|
125
|
-
`,this.tooltipContent=document.createElement("div"),this.tooltipContent.style.cssText="text-align: center;",this.tooltipElement.appendChild(this.tooltipContent);const w=document.createElement("div");w.style.cssText=`
|
|
126
|
-
position: absolute;
|
|
127
|
-
bottom: -4px;
|
|
128
|
-
left: 50%;
|
|
129
|
-
transform: translateX(-50%) rotate(45deg);
|
|
130
|
-
width: 8px;
|
|
131
|
-
height: 8px;
|
|
132
|
-
background: white;
|
|
133
|
-
box-shadow: 2px 2px 2px rgba(0,0,0,0.1);
|
|
134
|
-
`,this.tooltipElement.appendChild(w),document.body.appendChild(this.tooltipElement)}setupGlobalListeners(){window.addEventListener("scroll",()=>this.hide(),!0),window.addEventListener("resize",()=>this.hide()),window.addEventListener("orientationchange",()=>this.hide())}show(v,w,m){!this.tooltipElement||!this.tooltipContent||(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.tooltipContent.textContent=v,this.tooltipElement.style.left=`${w}px`,this.tooltipElement.style.top=`${m}px`,this.tooltipElement.style.opacity="1")}hide(){this.tooltipElement&&(this.tooltipElement.style.opacity="0")}destroy(){var v;(v=this.tooltipElement)==null||v.remove(),this.tooltipElement=null,this.tooltipContent=null,this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)}}class Kt{constructor(v){F(this,"appearance");F(this,"options");F(this,"tooltipManager");F(this,"skeleton");F(this,"iframe",null);F(this,"state",{isSelected:!1,actionToken:null});this.options=v,this.appearance=v.appearance||null,this.tooltipManager=new Qe,this.skeleton=new Xt(this.uniqueIdentifier),this.setup()}handleHeightChange(v){if(!this.iframe||(this.iframe.style.height=`${v}px`,v>0))return;const{parentElement:w}=this.iframe;w&&(w.style.display="none")}handleIframeReady(){return V(this,null,function*(){this.iframe&&(this.skeleton.hide(),this.options.onReady&&this.options.onReady(),this.appearance&&P(this.iframe,this.appearance,this.uniqueIdentifier))})}handleStateChange(v){const{isSelected:w,actionToken:m}=v;this.state={isSelected:w,actionToken:m},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:w,actionToken:m})}setup(){return V(this,null,function*(){yield Yt(),Zt(this.uniqueIdentifier,{onHeightChange:this.handleHeightChange.bind(this),onIframeReady:this.handleIframeReady.bind(this),onStateChange:this.handleStateChange.bind(this),onTooltipChange:this.handleTooltipChange.bind(this)})})}handleTooltipChange(v){if(!this.iframe)return;const w=this.iframe.getBoundingClientRect(),{text:m,coordinates:g,isVisible:y}=v,E=g.x+w.left,R=g.y+w.top;y?this.tooltipManager.show(m,E,R):this.tooltipManager.hide()}mount(v){Ft(this.iframeIdentifier);const w=Ut(v),m=Gt(this.options);return this.iframe=Bt(m,this.iframeIdentifier),this.skeleton.mount(w),w.appendChild(this.iframe),this}unmount(){Vt(this.uniqueIdentifier),this.skeleton.hide(),this.iframe&&(this.iframe.remove(),this.iframe=null)}getState(){return Mt({},this.state)}get iframeIdentifier(){return`consent-box-${this.uniqueIdentifier}`}get uniqueIdentifier(){return this.options.consentTemplateId}}const Qt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function en(p){let v="widget/";return"disclosureRequestId"in p.configProps?v+=["disclosures",p.configProps.disclosureRequestId].join("/"):v+=p.request,v}function tn(p){var y;const v=(y=p.isSandbox)!=null?y:!1,w=p.developmentUrl||(v?ce:be),m=Object.entries(p.configProps).filter(([E,R])=>R||E==="disclosureRequestId").map(([E,R])=>`${E}=${encodeURIComponent(R)}`).join("&"),g=en(p);return`${w}/${g}?sdk=web&${m}`}const nn=!!(typeof window!="undefined"&&window.document&&window.document.createElement);let Q=null,De=null;function ze(p=null){Q&&!Q.closed&&Q.focus(),p==null||p.preventDefault()}function je(){document.body.style.filter="",document.body.removeEventListener("click",ze)}function rn(){De=setInterval(()=>{(!Q||Q.closed)&&(De&&clearInterval(De),je())},de)}function on(p){const v=tn(p),w=ue,m=K,g=window.screenLeft!==void 0?window.screenLeft:window.screenX,y=window.screenTop!==void 0?window.screenTop:window.screenY,E=window.innerWidth||document.documentElement.clientWidth||window.screen.width,R=window.innerHeight||document.documentElement.clientHeight||window.screen.height,Y=E/window.screen.availWidth,Z=(E-w)/2/Y+g,$=(R-m)/2/Y+y;document.body.style.filter="blur(5px)",document.body.addEventListener("click",ze),Q=window.open(v,"Soyio",`scrollbars=yes,
|
|
134
|
+
`,document.head.appendChild(Q)}h.appendChild(g),h.appendChild(y),h.appendChild(E),K.appendChild(_),K.appendChild(de),T.appendChild(Z),T.appendChild(K),w.appendChild(h),w.appendChild(T),this.element.appendChild(w)}cleanupExistingSkeleton(){const p=document.getElementById(this.identifier);p&&p.remove()}mount(p){this.cleanupExistingSkeleton(),p.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}const Ne="https://app.soyio.id",ze="https://sandbox.soyio.id",Jt=["DISCLOSURE_REQUEST_SUCCESSFUL","IDENTITY_REGISTERED","IDENTITY_SIGNATURE","UNEXPECTED_ERROR","DENIED_CAMERA_PERMISSION","REJECTED_SIGNATURE"],Yt="WIDGET_CLOSED",Zt=420,Kt=720,Vt=500;function Xt(m){var E;const p=["actionToken","entityId","context","optionalReconsentBehavior","mandatoryReconsentBehavior"],w=(E=m.isSandbox)!=null?E:!1,h=m.developmentUrl||(w?ze:Ne),g=new URLSearchParams;p.forEach(T=>{m[T]&&g.set(T,m[T])});const y=g.toString();return`${h}/embed/consents/${m.consentTemplateId}${y?`?${y}`:""}`}class je extends xe{constructor(w){super(w);U(this,"state",{isSelected:!1,actionToken:null});this.defaultIframePrefix="consent-box",this.SkeletonKlass=$t}get uniqueIdentifier(){return this.options.consentTemplateId}iframeUrl(){return Xt(this.options)}handleStateChange(w){const{isSelected:h,actionToken:g}=w;this.state={isSelected:h,actionToken:g},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:h,actionToken:g})}setupListeners(){return Y(this,null,function*(){yield kt(je.prototype,this,"setupListeners").call(this),et(this.uniqueIdentifier,{onStateChange:this.handleStateChange.bind(this)})})}getState(){return this.state}}function Qt(m){var h;return m.developmentUrl?m.developmentUrl:`${((h=m.isSandbox)!=null?h:!1)?ze:Ne}/embed/privacy-center`}class en extends xe{constructor(p){super(p),this.defaultIframePrefix="privacy-center"}iframeUrl(){return Qt(this.options)}}const tn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function nn(m){let p="widget/";return"disclosureRequestId"in m.configProps?p+=["disclosures",m.configProps.disclosureRequestId].join("/"):p+=m.request,p}function rn(m){var y;const p=(y=m.isSandbox)!=null?y:!1,w=m.developmentUrl||(p?ze:Ne),h=Object.entries(m.configProps).filter(([E,T])=>T||E==="disclosureRequestId").map(([E,T])=>`${E}=${encodeURIComponent(T)}`).join("&"),g=nn(m);return`${w}/${g}?sdk=web&${h}`}const on=!!(typeof window!="undefined"&&window.document&&window.document.createElement);let X=null,Me=null;function Le(m=null){X&&!X.closed&&X.focus(),m==null||m.preventDefault()}function ke(){document.body.style.filter="",document.body.removeEventListener("click",Le)}function an(){Me=setInterval(()=>{(!X||X.closed)&&(Me&&clearInterval(Me),ke())},Vt)}function sn(m){const p=rn(m),w=Zt,h=Kt,g=window.screenLeft!==void 0?window.screenLeft:window.screenX,y=window.screenTop!==void 0?window.screenTop:window.screenY,E=window.innerWidth||document.documentElement.clientWidth||window.screen.width,T=window.innerHeight||document.documentElement.clientHeight||window.screen.height,Z=E/window.screen.availWidth,K=(E-w)/2/Z+g,_=(T-h)/2/Z+y;document.body.style.filter="blur(5px)",document.body.addEventListener("click",Le),X=window.open(p,"Soyio",`scrollbars=yes,
|
|
135
135
|
width=${w},
|
|
136
|
-
height=${
|
|
137
|
-
top=${
|
|
138
|
-
left=${
|
|
139
|
-
`;function R(e){return e===void 0&&(e=window),e.location.protocol}function Y(e){if(e===void 0&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return R(e)}function Z(e){return e===void 0&&(e=window),Y(e)==="about:"}function $(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&&!$(e))try{return e.opener}catch(n){}}function ee(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=$(e);return r&&ee()?We(r):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function k(e){e===void 0&&(e=window);var n=We(e);return n&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:n}function re(e){if(!function(n){try{if(n===window)return!0}catch(r){}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&t.enumerable===!1)return!1}catch(r){}try{if(Z(n)&&ee())return!0}catch(r){}try{if(function(r){return r===void 0&&(r=window),Y(r)==="mock:"}(n)&&ee())return!0}catch(r){}try{if(We(n)===We(window))return!0}catch(r){}return!1}(e))return!1;try{if(e===window||Z(e)&&ee()||k(window)===k(e))return!0}catch(n){}return!1}function Ce(e){if(!re(e))throw new Error("Expected window to be same domain");return e}function ot(e,n){if(!e||!n)return!1;var t=$(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 it(e){var n=[],t;try{t=e.frames}catch(c){t=e}var r;try{r=t.length}catch(c){}if(r===0)return n;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch(c){continue}n.push(i)}return n}for(var a=0;a<100;a++){var u=void 0;try{u=t[a]}catch(c){return n}if(!u)return n;n.push(u)}return n}var mn=[],pn=[];function q(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&&re(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(u){}return-1}(mn,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 at(e){return e===void 0&&(e=window),le(e=e||window)||$(e)||void 0}function se(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 se(t,n)}))}function Ie(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 st(e){if(re(e))return Ce(e).frameElement;for(var n=0,t=document.querySelectorAll("iframe");n<t.length;n++){var r=t[n];if(r&&r.contentWindow&&r.contentWindow===e)return r}}function vn(e){if(function(t){return t===void 0&&(t=window),!!$(t)}(e)){var n=st(e);if(n&&n.parentElement){n.parentElement.removeChild(n);return}}try{e.close()}catch(t){}}function oe(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 ct=[],he=[],Le=0,me;function ut(){if(!Le&&me){var e=me;me=null,e.resolve()}}function ke(){Le+=1}function pe(){Le-=1,ut()}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,u=!1,c=!1;ke();try{t(function(s){c?r.resolve(s):(a=!0,o=s)},function(s){c?r.reject(s):(u=!0,i=s)})}catch(s){pe(),this.reject(s);return}pe(),c=!0,a?this.resolve(o):u&&this.reject(i)}}var n=e.prototype;return n.resolve=function(t){if(this.resolved||this.rejected)return this;if(oe(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(oe(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(ct.indexOf(i)===-1){ct.push(i),setTimeout(function(){throw i},1);for(var u=0;u<he.length;u++)he[u](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,ke();for(var i=function(h,S){return h.then(function(x){S.resolve(x)},function(x){S.reject(x)})},a=0;a<o.length;a++){var u=o[a],c=u.onSuccess,s=u.onError,l=u.promise,d=void 0;if(t)try{d=c?c(this.value):this.value}catch(h){l.reject(h);continue}else if(r){if(!s){l.reject(this.error);continue}try{d=s(this.error)}catch(h){l.reject(h);continue}}if(d instanceof e&&(d.resolved||d.rejected)){var f=d;f.resolved?l.resolve(f.value):l.reject(f.error),f.errorHandled=!0}else oe(d)?d instanceof e&&(d.resolved||d.rejected)?d.resolved?l.resolve(d.value):l.reject(d.error):i(d,l):l.resolve(d)}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:oe(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,l,d){return l.then(function(f){i[s]=f,(o-=1)==0&&r.resolve(i)},function(f){d.reject(f)})},u=0;u<t.length;u++){var c=t[u];if(c instanceof e){if(c.resolved){i[u]=c.value,o-=1;continue}}else if(!oe(c)){i[u]=c,o-=1;continue}a(u,e.resolve(c),r)}return o===0&&r.resolve(i),r},e.hash=function(t){var r={},o=[],i=function(u){if(t.hasOwnProperty(u)){var c=t[u];oe(c)?o.push(c.then(function(s){r[u]=s})):r[u]=c}};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;ke();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)||oe(t)},e.flush=function(){return function(t){var r=me=me||new t;return ut(),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(Ie(i)&&q(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!Ie(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(l){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(l){}this._cleanupClosedWindows();var u=this.keys,c=this.values,s=Te(u,t);s===-1?(u.push(t),c.push(r)):c[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(u){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];o&&o[0]===t&&(o[0]=o[1]=void 0)}catch(u){}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 dt(e){return e.name||e.__name__||e.displayName||"anonymous"}function ft(e,n){try{delete e.name,e.name=n}catch(t){}return e.__name__=e.displayName=n,e}function X(){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 Pe;function lt(e){try{return JSON.stringify([].slice.call(e),function(n,t){return typeof t=="function"?"memoize["+function(r){if(Pe=Pe||new He,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=Pe.get(r);return o||(o=typeof r+":"+X(),Pe.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 wn(){return{}}var ve=0,ht=0;function we(e,n){n===void 0&&(n={});var t=n.thisNamespace,r=t!==void 0&&t,o=n.time,i,a,u=ve;ve+=1;var c=function(){for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];u<ht&&(i=null,a=null,u=ve,ve+=1);var f;f=r?(a=a||new He).getOrSet(this,wn):i=i||{};var h;try{h=lt(l)}catch(O){return e.apply(this,arguments)}var S=f[h];if(S&&o&&Date.now()-S.time<o&&(delete f[h],S=null),S)return S.value;var x=Date.now(),b=e.apply(this,arguments);return f[h]={time:x,value:b},b};return c.reset=function(){i=null,a=null},ft(c,(n.name||dt(e))+"::memoized")}we.clear=function(){ht=ve};function gn(e){var n={};function t(){for(var r=arguments,o=this,i=arguments.length,a=new Array(i),u=0;u<i;u++)a[u]=arguments[u];var c=lt(a);return n.hasOwnProperty(c)||(n[c]=T.try(function(){return e.apply(o,r)}).finally(function(){delete n[c]})),n[c]}return t.reset=function(){n={}},ft(t,dt(e)+"::promiseMemoized")}function ie(){}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+`
|
|
140
|
-
`+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: "+
|
|
136
|
+
height=${h},
|
|
137
|
+
top=${_},
|
|
138
|
+
left=${K}`),Le(),an()}function un(){X&&(X.close(),X=null),ke()}const cn="WIDGET_EVENT";let ce=null;function dn(){ce&&(ce.cancel(),ce=null)}function fn(m){return Y(this,null,function*(){const{onEvent:p}=m,w=yield Promise.resolve().then(()=>Ue);ce&&dn(),ce=w.on(cn,h=>Y(this,null,function*(){p(h.data),Jt.includes(h.data.eventName)?un():h.data.eventName===Yt&&ke()}))})}function ln(m){fn(m)}class tt{constructor(p){Mt(this,be);U(this,"onEvent");this.onEvent=p.onEvent,on&&(sn(p),ln({onEvent:Lt(this,be,Ut).bind(this)}))}}be=new WeakSet,Ut=function(p){this.onEvent(p)};var hn=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function mn(m){return m&&m.__esModule&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m}var nt={exports:{}},rt={exports:{}};(function(m,p){(function(w,h){m.exports=h()})(typeof self!="undefined"?self:hn,function(){return function(w){var h={};function g(y){if(h[y])return h[y].exports;var E=h[y]={i:y,l:!1,exports:{}};return w[y].call(E.exports,E,E.exports,g),E.l=!0,E.exports}return g.m=w,g.c=h,g.d=function(y,E,T){g.o(y,E)||Object.defineProperty(y,E,{enumerable:!0,get:T})},g.r=function(y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},g.t=function(y,E){if(1&E&&(y=g(y)),8&E||4&E&&typeof y=="object"&&y&&y.__esModule)return y;var T=Object.create(null);if(g.r(T),Object.defineProperty(T,"default",{enumerable:!0,value:y}),2&E&&typeof y!="string")for(var Z in y)g.d(T,Z,function(K){return y[K]}.bind(null,Z));return T},g.n=function(y){var E=y&&y.__esModule?function(){return y.default}:function(){return y};return g.d(E,"a",E),E},g.o=function(y,E){return{}.hasOwnProperty.call(y,E)},g.p="",g(g.s=0)}([function(w,h,g){g.r(h),g.d(h,"Promise",function(){return C}),g.d(h,"TYPES",function(){return Ln}),g.d(h,"ProxyWindow",function(){return G}),g.d(h,"setup",function(){return jt}),g.d(h,"destroy",function(){return Mn}),g.d(h,"serializeMessage",function(){return Dn}),g.d(h,"deserializeMessage",function(){return Nn}),g.d(h,"createProxyWindow",function(){return zn}),g.d(h,"toProxyWindow",function(){return jn}),g.d(h,"on",function(){return ee}),g.d(h,"once",function(){return An}),g.d(h,"send",function(){return te}),g.d(h,"markWindowKnown",function(){return St}),g.d(h,"cleanUpWindow",function(){return kn}),g.d(h,"bridge",function(){});function y(e){return{}.toString.call(e)==="[object RegExp]"}var E=`Call was rejected by callee.\r
|
|
139
|
+
`;function T(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 T(e)}function K(e){return e===void 0&&(e=window),Z(e)==="about:"}function _(e){if(e===void 0&&(e=window),e)try{if(e.parent&&e.parent!==e)return e.parent}catch(n){}}function de(e){if(e===void 0&&(e=window),e&&!_(e))try{return e.opener}catch(n){}}function Q(e){try{return!0}catch(n){}return!1}function Se(e){e===void 0&&(e=window);var n=e.location;if(!n)throw new Error("Can not read window location");var t=T(e);if(!t)throw new Error("Can not read window protocol");if(t==="file:")return"file://";if(t==="about:"){var r=_(e);return r&&Q()?Se(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=Se(e);return n&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:n}function ne(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(K(n)&&Q())return!0}catch(r){}try{if(function(r){return r===void 0&&(r=window),Z(r)==="mock:"}(n)&&Q())return!0}catch(r){}try{if(Se(n)===Se(window))return!0}catch(r){}return!1}(e))return!1;try{if(e===window||K(e)&&Q()||H(window)===H(e))return!0}catch(n){}return!1}function We(e){if(!ne(e))throw new Error("Expected window to be same domain");return e}function it(e,n){if(!e||!n)return!1;var t=_(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 at(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 vn=[],wn=[];function $(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&&ne(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}(vn,e);if(t!==-1){var r=wn[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 st(e){return e===void 0&&(e=window),de(e=e||window)||_(e)||void 0}function se(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 se(t,n)}))}function Ie(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 ut(e){if(ne(e))return We(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 gn(e){if(function(t){return t===void 0&&(t=window),!!_(t)}(e)){var n=ut(e);if(n&&n.parentElement){n.parentElement.removeChild(n);return}}try{e.close()}catch(t){}}function re(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 ct=[],fe=[],He=0,le;function dt(){if(!He&&le){var e=le;le=null,e.resolve()}}function Fe(){He+=1}function he(){He-=1,dt()}var C=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){he(),this.reject(s);return}he(),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(re(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(re(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(ct.indexOf(i)===-1){ct.push(i),setTimeout(function(){throw i},1);for(var c=0;c<fe.length;c++)fe[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,S){return v.then(function(x){S.resolve(x)},function(x){S.reject(x)})},a=0;a<o.length;a++){var c=o[a],u=c.onSuccess,s=c.onError,l=c.promise,d=void 0;if(t)try{d=u?u(this.value):this.value}catch(v){l.reject(v);continue}else if(r){if(!s){l.reject(this.error);continue}try{d=s(this.error)}catch(v){l.reject(v);continue}}if(d instanceof e&&(d.resolved||d.rejected)){var f=d;f.resolved?l.resolve(f.value):l.reject(f.error),f.errorHandled=!0}else re(d)?d instanceof e&&(d.resolved||d.rejected)?d.resolved?l.resolve(d.value):l.reject(d.error):i(d,l):l.resolve(d)}o.length=0,this.dispatching=!1,he()}},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:re(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,l,d){return l.then(function(f){i[s]=f,(o-=1)==0&&r.resolve(i)},function(f){d.reject(f)})},c=0;c<t.length;c++){var u=t[c];if(u instanceof e){if(u.resolved){i[c]=u.value,o-=1;continue}}else if(!re(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];re(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 fe.push(r),{cancel:function(){fe.splice(fe.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 he(),e.reject(a)}return he(),e.resolve(i)},e.delay=function(t){return new e(function(r){setTimeout(r,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||re(t)},e.flush=function(){return function(t){var r=le=le||new t;return dt(),r}(e)},e}();function Ce(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(r){}return-1}var Be=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(Ie(i)&&$(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!Ie(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(l){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(l){}this._cleanupClosedWindows();var c=this.keys,u=this.values,s=Ce(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=Ce(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=Ce(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(),Ce(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 ft(e){return e.name||e.__name__||e.displayName||"anonymous"}function lt(e,n){try{delete e.name,e.name=n}catch(t){}return e.__name__=e.displayName=n,e}function V(){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 Pe;function ht(e){try{return JSON.stringify([].slice.call(e),function(n,t){return typeof t=="function"?"memoize["+function(r){if(Pe=Pe||new Be,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=Pe.get(r);return o||(o=typeof r+":"+V(),Pe.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 yn(){return{}}var me=0,mt=0;function pe(e,n){n===void 0&&(n={});var t=n.thisNamespace,r=t!==void 0&&t,o=n.time,i,a,c=me;me+=1;var u=function(){for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];c<mt&&(i=null,a=null,c=me,me+=1);var f;f=r?(a=a||new Be).getOrSet(this,yn):i=i||{};var v;try{v=ht(l)}catch(R){return e.apply(this,arguments)}var S=f[v];if(S&&o&&Date.now()-S.time<o&&(delete f[v],S=null),S)return S.value;var x=Date.now(),b=e.apply(this,arguments);return f[v]={time:x,value:b},b};return u.reset=function(){i=null,a=null},lt(u,(n.name||ft(e))+"::memoized")}pe.clear=function(){mt=me};function En(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=ht(a);return n.hasOwnProperty(u)||(n[u]=C.try(function(){return e.apply(o,r)}).finally(function(){delete n[u]})),n[u]}return t.reset=function(){n={}},lt(t,ft(e)+"::promiseMemoized")}function oe(){}function ve(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+`
|
|
140
|
+
`+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: "+ve(o,n+1)}}function pt(e){return typeof e=="string"?e:e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}pe(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 qe(e){return{}.toString.call(e)==="[object RegExp]"}function we(e,n,t){if(e.hasOwnProperty(n))return e[n];var r=t();return e[n]=r,r}function vt(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function wt(){return!!document.body&&document.readyState==="complete"}function gt(){return!!document.body&&document.readyState==="interactive"}pe(function(){return new C(function(e){if(wt()||gt())return e();var n=setInterval(function(){if(wt()||gt())return clearInterval(n),e()},10)})});var Te=typeof document!="undefined"?document.currentScript:null,xn=pe(function(){if(Te||(Te=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 Te;throw new Error("Can not determine current script")}),bn=V();pe(function(){var e;try{e=xn()}catch(r){return bn}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=V();return e.setAttribute("data-uid-auto",n),n});function ge(e){e===void 0&&(e=window);var n="__post_robot_10_0_46__";return e!==window?e[n]:e[n]=e[n]||{}}var yt=function(){return{}};function L(e,n){return e===void 0&&(e="store"),n===void 0&&(n=yt),we(ge(),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 we(t,r,o)},reset:function(){t=n()},keys:function(){return Object.keys(t)}}})}var Sn=function(){};function Re(){var e=ge();return e.WINDOW_WILDCARD=e.WINDOW_WILDCARD||new Sn,e.WINDOW_WILDCARD}function F(e,n){return e===void 0&&(e="store"),n===void 0&&(n=yt),L("windowStore").getOrSet(e,function(){var t=new Be,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 we(r(o),e,i)}}})}function Et(){return L("instance").getOrSet("instanceID",V)}function xt(e,n){var t=n.domain,r=F("helloPromises"),o=r.get(e);o&&o.resolve({domain:t});var i=C.resolve({domain:t});return r.set(e,i),i}function Ge(e,n){return(0,n.send)(e,"postrobot_hello",{instanceID:Et()},{domain:"*",timeout:-1}).then(function(t){var r=t.origin,o=t.data.instanceID;return xt(e,{domain:r}),{win:e,domain:r,instanceID:o}})}function bt(e,n){var t=n.send;return F("windowInstanceIDPromises").getOrSet(e,function(){return Ge(e,{send:t}).then(function(r){return r.instanceID})})}function St(e){F("knownWindows").set(e,!0)}function _e(e){return typeof e=="object"&&e!==null&&typeof e.__type__=="string"}function Wt(e){return e===void 0?"undefined":e===null?"null":Array.isArray(e)?"array":typeof e=="function"?"function":typeof e=="object"?e instanceof Error?"error":typeof e.then=="function"?"promise":{}.toString.call(e)==="[object RegExp]"?"regex":{}.toString.call(e)==="[object Date]"?"date":"object":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":void 0}function ie(e,n){return{__type__:e,__val__:n}}var B,Wn=((B={}).function=function(){},B.error=function(e){return ie("error",{message:e.message,stack:e.stack,code:e.code,data:e.data})},B.promise=function(){},B.regex=function(e){return ie("regex",e.source)},B.date=function(e){return ie("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 ie("undefined",e)},B),In={},q,Cn=((q={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},q.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+`
|
|
141
141
|
|
|
142
|
-
`+o.stack,o},
|
|
142
|
+
`+o.stack,o},q.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},q.regex=function(e){return new RegExp(e)},q.date=function(e){return new Date(e)},q.array=function(e){return e},q.object=function(e){return e},q.string=function(e){return e},q.number=function(e){return e},q.boolean=function(e){return e},q.null=function(e){return e},q[void 0]=function(){},q),Pn={};new C(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 $e(){for(var e=L("idToProxyWindow"),n=0,t=e.keys();n<t.length;n++){var r=t[n];e.get(r).shouldClean()&&e.del(r)}}function It(e,n){var t=n.send,r=n.id,o=r===void 0?V():r,i=e.then(function(u){if(ne(u))return We(u).name}),a=e.then(function(u){if($(u))throw new Error("Window is closed, can not determine type");return de(u)?"popup":"iframe"});i.catch(oe),a.catch(oe);var c=function(){return e.then(function(u){if(!$(u))return ne(u)?We(u).name:i})};return{id:o,getType:function(){return a},getInstanceID:En(function(){return e.then(function(u){return bt(u,{send:t})})}),close:function(){return e.then(gn)},getName:c,focus:function(){return e.then(function(u){u.focus()})},isClosed:function(){return e.then(function(u){return $(u)})},setLocation:function(u,s){return s===void 0&&(s={}),e.then(function(l){var d=window.location.protocol+"//"+window.location.host,f=s.method,v=f===void 0?"get":f,S=s.body;if(u.indexOf("/")===0)u=""+d+u;else if(!u.match(/^https?:\/\//)&&u.indexOf(d)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(u));if(v==="post")return c().then(function(x){if(!x)throw new Error("Can not post to window without target name");(function(b){var R=b.url,M=b.target,A=b.body,O=b.method,k=O===void 0?"post":O,W=document.createElement("form");if(W.setAttribute("target",M),W.setAttribute("method",k),W.setAttribute("action",R),W.style.display="none",A)for(var D=0,J=Object.keys(A);D<J.length;D++){var j,ye=J[D],Ke=document.createElement("input");Ke.setAttribute("name",ye),Ke.setAttribute("value",(j=A[ye])==null?void 0:j.toString()),W.appendChild(Ke)}vt().appendChild(W),W.submit(),vt().removeChild(W)})({url:u,target:x,method:v,body:S})});if(v!=="get")throw new Error("Unsupported method: "+v);if(ne(l))try{if(l.location&&typeof l.location.replace=="function"){l.location.replace(u);return}}catch(x){}l.location=u})},setName:function(u){return e.then(function(s){var l=ne(s),d=ut(s);if(!l)throw new Error("Can not set name for cross-domain window: "+u);We(s).name=u,d&&d.setAttribute("name",u),i=C.resolve(u)})}}}var G=function(){function e(t){var r=t.send,o=t.win,i=t.serializedWindow;this.id=void 0,this.isProxyWindow=!0,this.serializedWindow=void 0,this.actualWindow=void 0,this.actualWindowPromise=void 0,this.send=void 0,this.name=void 0,this.actualWindowPromise=new C,this.serializedWindow=i||It(this.actualWindowPromise,{send:r}),L("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=C.hash({isPopup:r,name:o}).then(function(c){var u=c.name;c.isPopup&&u&&window.open("",u,"noopener")}),a=this.serializedWindow.focus();return C.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=It(this.actualWindowPromise,{send:o,id:this.getID()}),F("winToProxyWindow").set(t,this)},n.awaitWindow=function(){return this.actualWindowPromise},n.matchWindow=function(t,r){var o=this,i=r.send;return C.try(function(){return o.actualWindow?t===o.actualWindow:C.hash({proxyInstanceID:o.getInstanceID(),knownWindowInstanceID:bt(t,{send:i})}).then(function(a){var c=a.proxyInstanceID===a.knownWindowInstanceID;return c&&o.setWindow(t,{send:i}),c})})},n.unwrap=function(){return this.actualWindow||this},n.getInstanceID=function(){return this.serializedWindow.getInstanceID()},n.shouldClean=function(){return!!(this.actualWindow&&$(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 $e(),e.toProxyWindow(t,{send:o}).serialize()},e.deserialize=function(t,r){var o=r.send;return $e(),L("idToProxyWindow").get(t.id)||new e({serializedWindow:t,send:o})},e.isProxyWindow=function(t){return!!(t&&!Ie(t)&&t.isProxyWindow)},e.toProxyWindow=function(t,r){var o=r.send;if($e(),e.isProxyWindow(t))return t;var i=t;return F("winToProxyWindow").get(i)||new e({win:i,send:o})},e}();function Je(e,n,t,r,o){var i=F("methodStore"),a=L("proxyWindowMethods");G.isProxyWindow(r)?a.set(e,{val:n,name:t,domain:o,source:r}):(a.del(e),i.getOrSet(r,function(){return{}})[e]={domain:o,name:t,val:n,source:r})}function Ct(e,n){var t=F("methodStore"),r=L("proxyWindowMethods");return t.getOrSet(e,function(){return{}})[n]||r.get(n)}function Pt(e,n,t,r,o){a=(i={on:o.on,send:o.send}).on,c=i.send,L("builtinListeners").getOrSet("functionCalls",function(){return a("postrobot_method",{domain:"*"},function(l){var d=l.source,f=l.origin,v=l.data,S=v.id,x=v.name,b=Ct(d,S);if(!b)throw new Error("Could not find method '"+x+"' with id: "+v.id+" in "+H(window));var R=b.source,M=b.domain,A=b.val;return C.try(function(){if(!se(M,f))throw new Error("Method '"+v.name+"' domain "+JSON.stringify(qe(b.domain)?b.domain.source:b.domain)+" does not match origin "+f+" in "+H(window));if(G.isProxyWindow(R))return R.matchWindow(d,{send:c}).then(function(O){if(!O)throw new Error("Method call '"+v.name+"' failed - proxy window does not match source in "+H(window))})}).then(function(){return A.apply({source:d,origin:f},v.args)},function(O){return C.try(function(){if(A.onError)return A.onError(O)}).then(function(){throw O.stack&&(O.stack="Remote call to "+x+"("+function(k){return k===void 0&&(k=[]),(W=k,[].slice.call(W)).map(function(D){return typeof D=="string"?"'"+D+"'":D===void 0?"undefined":D===null?"null":typeof D=="boolean"?D.toString():Array.isArray(D)?"[ ... ]":typeof D=="object"?"{ ... }":typeof D=="function"?"() => { ... }":"<"+typeof D+">"}).join(", ");var W}(v.args)+`) failed
|
|
143
143
|
|
|
144
|
-
`+
|
|
144
|
+
`+O.stack),O})}).then(function(O){return{result:O,id:S,name:x}})})});var i,a,c,u=t.__id__||V();e=G.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+"::")),G.isProxyWindow(e)?(Je(u,t,s,e,n),e.awaitWindow().then(function(l){Je(u,t,s,l,n)})):Je(u,t,s,e,n),ie("cross_domain_function",{id:u,name:s})}function Tt(e,n,t,r){var o,i=r.on,a=r.send;return function(c,u){u===void 0&&(u=In);var s=JSON.stringify(c,function(l){var d=this[l];if(_e(this))return d;var f=Wt(d);if(!f)return d;var v=u[f]||Wn[f];return v?v(d,l):d});return s===void 0?"undefined":s}(t,((o={}).promise=function(c,u){return function(s,l,d,f,v){return ie("cross_domain_zalgo_promise",{then:Pt(s,l,function(S,x){return d.then(S,x)},f,{on:v.on,send:v.send})})}(e,n,c,u,{on:i,send:a})},o.function=function(c,u){return Pt(e,n,c,u,{on:i,send:a})},o.object=function(c){return Ie(c)||G.isProxyWindow(c)?ie("cross_domain_window",G.serialize(c,{send:a})):c},o))}function Rt(e,n,t,r){var o,i=r.send;return function(a,c){if(c===void 0&&(c=Pn),a!=="undefined")return JSON.parse(a,function(u,s){if(_e(this))return s;var l,d;if(_e(s)?(l=s.__type__,d=s.__val__):(l=Wt(s),d=s),!l)return d;var f=c[l]||Cn[l];return f?f(d,u):d})}(t,((o={}).cross_domain_zalgo_promise=function(a){return function(c,u,s){return new C(s.then)}(0,0,a)},o.cross_domain_function=function(a){return function(c,u,s,l){var d=s.id,f=s.name,v=l.send,S=function(b){b===void 0&&(b={});function R(){var M=arguments;return G.toProxyWindow(c,{send:v}).awaitWindow().then(function(A){var O=Ct(A,d);if(O&&O.val!==R)return O.val.apply({source:window,origin:H()},M);var k=[].slice.call(M);return b.fireAndForget?v(A,"postrobot_method",{id:d,name:f,args:k},{domain:u,fireAndForget:!0}):v(A,"postrobot_method",{id:d,name:f,args:k},{domain:u,fireAndForget:!1}).then(function(W){return W.data.result})}).catch(function(A){throw A})}return R.__name__=f,R.__origin__=u,R.__source__=c,R.__id__=d,R.origin=u,R},x=S();return x.fireAndForget=S({fireAndForget:!0}),x}(e,n,a,{send:i})},o.cross_domain_window=function(a){return G.deserialize(a,{send:i})},o))}var Ye={};Ye.postrobot_post_message=function(e,n,t){t.indexOf("file:")===0&&(t="*"),e.postMessage(n,t)};function Ze(e,n,t,r){var o=r.on,i=r.send;return C.try(function(){var a=F().getOrSet(e,function(){return{}});return a.buffer=a.buffer||[],a.buffer.push(t),a.flush=a.flush||C.flush().then(function(){if($(e))throw new Error("Window is closed");var c=Tt(e,n,((u={}).__post_robot_10_0_46__=a.buffer||[],u),{on:o,send:i}),u;delete a.buffer;for(var s=Object.keys(Ye),l=[],d=0;d<s.length;d++){var f=s[d];try{Ye[f](e,c,n)}catch(v){l.push(v)}}if(l.length===s.length)throw new Error(`All post-robot messaging strategies failed:
|
|
145
145
|
|
|
146
|
-
`+l.map(function(
|
|
146
|
+
`+l.map(function(v,S){return S+". "+ve(v)}).join(`
|
|
147
147
|
|
|
148
|
-
`))}),a.flush.then(function(){delete a.flush})}).then(
|
|
148
|
+
`))}),a.flush.then(function(){delete a.flush})}).then(oe)}function Ot(e){return L("responseListeners").get(e)}function At(e){L("responseListeners").del(e)}function Dt(e){return L("erroredResponseListeners").has(e)}function Nt(e){var n=e.name,t=e.win,r=e.domain,o=F("requestListeners");if(t==="*"&&(t=null),r==="*"&&(r=null),!n)throw new Error("Name required to get request listener");for(var i=0,a=[t,Re()];i<a.length;i++){var c=a[i];if(c){var u=o.get(c);if(u){var s=u[n];if(s){if(r&&typeof r=="string"){if(s[r])return s[r];if(s.__domain_regex__)for(var l=0,d=s.__domain_regex__;l<d.length;l++){var f=d[l],v=f.listener;if(se(f.regex,r))return v}}if(s["*"])return s["*"]}}}}}function Tn(e,n,t,r){var o=r.on,i=r.send,a=Nt({name:t.name,win:e,domain:n}),c=t.name==="postrobot_method"&&t.data&&typeof t.data.name=="string"?t.data.name+"()":t.name;function u(s,l,d){return C.flush().then(function(){if(!t.fireAndForget&&!$(e))try{return Ze(e,n,{id:V(),origin:H(window),type:"postrobot_message_response",hash:t.hash,name:t.name,ack:s,data:l,error:d},{on:o,send:i})}catch(f){throw new Error("Send response message failed for "+c+" in "+H()+`
|
|
149
149
|
|
|
150
|
-
`+
|
|
150
|
+
`+ve(f))}})}return C.all([C.flush().then(function(){if(!t.fireAndForget&&!$(e))try{return Ze(e,n,{id:V(),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()+`
|
|
151
151
|
|
|
152
|
-
`+
|
|
152
|
+
`+ve(s))}}),C.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(oe).catch(function(s){if(a&&a.handleError)return a.handleError(s);throw s})}function Rn(e,n,t){if(!Dt(t.hash)){var r=Ot(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(!se(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 On(e,n,t){if(!Dt(t.hash)){var r=Ot(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(!se(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");At(t.hash),t.ack==="error"?r.promise.reject(t.error):t.ack==="success"&&r.promise.resolve({source:e,origin:n,data:t.data})}}function zt(e,n){var t=n.on,r=n.send,o=L("receivedMessages");try{if(!window||window.closed||!e.source)return}catch(l){return}var i=e.source,a=e.origin,c=function(l,d,f,v){var S=v.on,x=v.send,b;try{b=Rt(d,f,l,{on:S,send:x})}catch(M){return}if(b&&typeof b=="object"&&b!==null){var R=b.__post_robot_10_0_46__;if(Array.isArray(R))return R}}(e.data,i,a,{on:t,send:r});if(c){St(i);for(var u=0;u<c.length;u++){var s=c[u];if(o.has(s.id)||(o.set(s.id,!0),$(i)&&!s.fireAndForget))return;s.origin.indexOf("file:")===0&&(a="file://");try{s.type==="postrobot_message_request"?Tn(i,a,s,{on:t,send:r}):s.type==="postrobot_message_response"?On(i,a,s):s.type==="postrobot_message_ack"&&Rn(i,a,s)}catch(l){setTimeout(function(){throw l},0)}}}}function ee(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,l=F("requestListeners");if(!c||typeof c!="string")throw new Error("Name required to add request listener");if(u&&u!=="*"&&G.isProxyWindow(u)){var d=u.awaitWindow().then(function(j){return o({name:c,win:j,domain:s},a)});return{cancel:function(){d.then(function(j){return j.cancel()},oe)}}}var f=u;if(Array.isArray(f)){for(var v=[],S=0,x=f;S<x.length;S++)v.push(o({name:c,domain:s,win:x[S]},a));return{cancel:function(){for(var j=0;j<v.length;j++)v[j].cancel()}}}if(Array.isArray(s)){for(var b=[],R=0,M=s;R<M.length;R++)b.push(o({name:c,win:f,domain:M[R]},a));return{cancel:function(){for(var j=0;j<b.length;j++)b[j].cancel()}}}var A=Nt({name:c,win:f,domain:s});f&&f!=="*"||(f=Re());var O=(s=s||"*").toString();if(A)throw f&&s?new Error("Request listener already exists for "+c+" on domain "+s.toString()+" for "+(f===Re()?"wildcard":"specified")+" window"):f?new Error("Request listener already exists for "+c+" for "+(f===Re()?"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=l.getOrSet(f,function(){return{}}),W=we(k,c,function(){return{}}),D,J;return qe(s)?(D=we(W,"__domain_regex__",function(){return[]})).push(J={regex:s,listener:a}):W[O]=a,{cancel:function(){delete W[O],J&&(D.splice(D.indexOf(J,1)),D.length||delete W.__domain_regex__),Object.keys(W).length||delete k[c],f&&!Object.keys(k).length&&l.del(f)}}}({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 An(e,n,t){typeof(n=n||{})=="function"&&(t=n,n={});var r=new C,o;return n.errorHandler=function(i){o.cancel(),r.reject(i)},o=ee(e,n,function(i){if(o.cancel(),r.resolve(i),t)return t(i)}),r.cancel=o.cancel,r}var te=function e(n,t,r,o){var i=(o=o||{}).domain||"*",a=o.timeout||-1,c=o.timeout||5e3,u=o.fireAndForget||!1;return G.toProxyWindow(n,{send:e}).awaitWindow().then(function(s){return C.try(function(){if(function(l,d,f){if(!l)throw new Error("Expected name");if(f&&typeof f!="string"&&!Array.isArray(f)&&!qe(f))throw new TypeError("Can not send "+l+". Expected domain "+JSON.stringify(f)+" to be a string, array, or regex");if($(d))throw new Error("Can not send "+l+". Target window is closed")}(t,s,i),function(l,d){var f=st(d);if(f)return f===l;if(d===l||function(x){x===void 0&&(x=window);try{if(x.top)return x.top}catch(A){}if(_(x)===x)return x;try{if(it(window,x)&&window.top)return window.top}catch(A){}try{if(it(x,window)&&window.top)return window.top}catch(A){}for(var b=0,R=function A(O){for(var k=[],W=0,D=at(O);W<D.length;W++){var J=D[W];k.push(J);for(var j=0,ye=A(J);j<ye.length;j++)k.push(ye[j])}return k}(x);b<R.length;b++){var M=R[b];try{if(M.top)return M.top}catch(A){}if(_(M)===M)return M}}(d)===d)return!1;for(var v=0,S=at(l);v<S.length;v++)if(S[v]===d)return!0;return!1}(window,s))return function(l,d,f){d===void 0&&(d=5e3),f===void 0&&(f="Window");var v=function(S){return F("helloPromises").getOrSet(S,function(){return new C})}(l);return d!==-1&&(v=v.timeout(d,new Error(f+" did not load after "+d+"ms"))),v}(s,c)}).then(function(l){return function(d,f,v,S){var x=S.send;return C.try(function(){return typeof f=="string"?f:C.try(function(){return v||Ge(d,{send:x}).then(function(b){return b.domain})}).then(function(b){if(!se(f,f))throw new Error("Domain "+pt(f)+" does not match "+pt(f));return b})})}(s,i,(l===void 0?{}:l).domain,{send:e})}).then(function(l){var d=l,f=t==="postrobot_method"&&r&&typeof r.name=="string"?r.name+"()":t,v=new C,S=t+"_"+V();if(!u){var x={name:t,win:s,domain:d,promise:v};(function(W,D){L("responseListeners").set(W,D)})(S,x);var b=F("requestPromises").getOrSet(s,function(){return[]});b.push(v),v.catch(function(){(function(W){L("erroredResponseListeners").set(W,!0)})(S),At(S)});var R=function(W){return F("knownWindows").get(W,!1)}(s)?1e4:2e3,M=a,A=R,O=M,k=function(W,D){var J;return function j(){J=setTimeout(function(){(function(){if($(s))return v.reject(new Error("Window closed for "+t+" before "+(x.ack?"response":"ack")));if(x.cancelled)return v.reject(new Error("Response listener was cancelled for "+t));A=Math.max(A-500,0),O!==-1&&(O=Math.max(O-500,0)),x.ack||A!==0?O===0&&v.reject(new Error("No response for postMessage "+f+" in "+H()+" in "+M+"ms")):v.reject(new Error("No ack for postMessage "+f+" in "+H()+" in "+R+"ms"))})(),j()},500)}(),{cancel:function(){clearTimeout(J)}}}();v.finally(function(){k.cancel(),b.splice(b.indexOf(v,1))}).catch(oe)}return Ze(s,d,{id:V(),origin:H(window),type:"postrobot_message_request",hash:S,name:t,data:r,fireAndForget:u},{on:ee,send:e}).then(function(){return u?v.resolve():v},function(W){throw new Error("Send request message failed for "+f+" in "+H()+`
|
|
153
153
|
|
|
154
|
-
`+
|
|
154
|
+
`+ve(W))})})})};function Dn(e,n,t){return Tt(e,n,t,{on:ee,send:te})}function Nn(e,n,t){return Rt(e,n,t,{on:ee,send:te})}function zn(e){return new G({send:te,win:e})}function jn(e){return G.toProxyWindow(e,{send:te})}function jt(){ge().initialized||(ge().initialized=!0,n=(e={on:ee,send:te}).on,t=e.send,(r=ge()).receiveMessage=r.receiveMessage||function(o){return zt(o,{on:n,send:t})},function(o){var i=o.on,a=o.send;L().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 l=s.on,d=s.send;C.try(function(){var f=u.source||u.sourceElement,v=u.origin||u.originalEvent&&u.originalEvent.origin,S=u.data;if(v==="null"&&(v="file://"),f){if(!v)throw new Error("Post message did not have origin domain");zt({source:f,origin:v,data:S},{on:l,send:d})}})})(c,{on:i,send:a})})})}({on:ee,send:te}),function(o){var i=o.on,a=o.send;L("builtinListeners").getOrSet("helloListener",function(){var c=i("postrobot_hello",{domain:"*"},function(s){return xt(s.source,{domain:s.origin}),{instanceID:Et()}}),u=st();return u&&Ge(u,{send:a}).catch(function(s){}),c})}({on:ee,send:te}));var e,n,t,r}function Mn(){(function(){for(var n=L("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=L().get("postMessageListener"))&&e.cancel();var e;delete window.__post_robot_10_0_46__}var Ln=!0;function kn(e){for(var n=0,t=F("requestPromises").get(e,[]);n<t.length;n++)t[n].reject(new Error("Window "+($(e)?"closed":"cleaned up")+" before response")).catch(oe)}jt()}])})})(rt);var pn=rt.exports;(function(m){m.exports=pn,m.exports.default=m.exports})(nt);var ot=nt.exports;const Ue=P({__proto__:null,default:mn(ot)},[ot]);I.ConsentBox=je,I.PrivacyCenterBox=en,I.SoyioTypes=tn,I.SoyioWidget=tt,I._TooltipManager=N,I.default=tt,Object.defineProperties(I,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|