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