@soyio/soyio-widget 2.14.0 → 2.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -61,7 +61,6 @@ This doesn't require any previous setup. Given your company and disclosure templ
61
61
  userReference: "<user identifier of company>",
62
62
  userEmail: "<user email>",
63
63
  templateId: "<template id>",
64
- forceError: "<error type>",
65
64
  customColor: "<custom color>",
66
65
  },
67
66
  onEvent: (data) => console.log(data),
@@ -83,7 +82,6 @@ This doesn't require any previous setup. Given your company and disclosure templ
83
82
  Optional props:
84
83
 
85
84
  - `userEmail`
86
- - `forceError`
87
85
  - `customColor`.
88
86
 
89
87
  ### 2. Created Disclosure Request
@@ -105,7 +103,6 @@ To use this option, simply specify the disclosure request ID along with any opti
105
103
  request: "disclosure",
106
104
  configProps: {
107
105
  disclosureRequestId: "<disclosure request id>",
108
- forceError: "<error type>",
109
106
  customColor: "<custom color>",
110
107
  },
111
108
  onEvent: (data) => console.log(data),
@@ -126,7 +123,6 @@ To use this option, simply specify the disclosure request ID along with any opti
126
123
 
127
124
  Optional properties:
128
125
 
129
- - `forceError`
130
126
  - `customColor`
131
127
 
132
128
  Note: User and template properties are not specified here because they must be specified when creating the disclosure request beforehand.
@@ -161,19 +157,9 @@ The `onEvent` callback is designed to handle various events that occur during wi
161
157
  - **`disclosureRequestId`**: If created beforehand, you can target a specific disclosure request that the user must complete. It is useful if you need to match some data between the disclosure process and your database records. It must start with `'dreq_'`
162
158
  - **`identityId`**: This identifier must start with `'id_'` and signifies the user's identity.
163
159
  - **`isSandbox`**: Indicates if the widget should operate in sandbox mode, defaulting to `false`.
164
- - **`forceError`**: Triggers specific errors for testing or debugging. Used to simulate failure scenarios. Only works in `sandbox` mode.
165
160
  - **`onEvent`**: A callback function triggered upon event occurrences, used for capturing and logging event-related data.
166
161
  - **`customColor`**: A hex code string that specifies the base color of the interface.
167
162
 
168
- ### Force Error Types
169
-
170
- The `forceError` parameter can simulate the following error conditions:
171
-
172
- - `'facial_validation_error'`: Simulates a failure in the facial video liveness test, indicating the system could not verify the user's live presence.
173
- - `'document_validation_error'`: Indicates an issue with validating the photos of the documents provided by the user.
174
- - `'unknown_error'`: Generates a generic error, representing an unspecified problem.
175
- - `'expiration_error'`: Occurs when there is an issue with the identity provider that prevents the validation of one or both documents provided by the user, due to unspecified problems in the validation process.
176
-
177
163
  ## Signature Attempt
178
164
 
179
165
  The **`signature_attempt`** is a process where, using a previously created `signature_attempt_id`, a request is initiated in which a user can digitally sign a document. To sign the document, the user must be authenticated. This authentication can occur either through an access key or facial video. It's important to note that for this request, the user must have been previously verified with Soyio.
@@ -189,7 +175,6 @@ The **`signature_attempt`** is a process where, using a previously created `sign
189
175
  request: "signature",
190
176
  configProps: {
191
177
  signatureAttemptId: "<signature attempt id>",
192
- forceError: "<error type>",
193
178
  customColor: "<custom color>",
194
179
  },
195
180
  onEvent: (data) => console.log(data),
@@ -210,7 +195,6 @@ The **`signature_attempt`** is a process where, using a previously created `sign
210
195
 
211
196
  Optional props:
212
197
 
213
- - `forceError`
214
198
  - `customColor`.
215
199
 
216
200
  ### Signature Attempt Events
@@ -229,18 +213,9 @@ Optional props:
229
213
 
230
214
  - **`signatureAttemptId`**: Identifier of signature attempt obtained when creating the `SignatureAttempt`. It must start with `'sa_'`.
231
215
  - **`isSandbox`**: Indicates if the widget should operate in sandbox mode, defaulting to `false`.
232
- - **`forceError`**: Triggers specific errors for testing or debugging. Used to simulate failure scenarios. Only works in `sandbox` mode.
233
216
  - **`onEvent`**: A callback function triggered upon event occurrences, used for capturing and logging event-related data.
234
217
  - **`customColor`**: A hex code string that specifies the base color of the interface.
235
218
 
236
- ### Force Error Types
237
-
238
- The `forceError` parameter can simulate the following error conditions:
239
-
240
- - `'facial_validation_error'`: Simulates a failure in the facial video liveness test, indicating the system could not verify the user's live presence.
241
- - `'unknown_error'`: Generates a generic error, representing an unspecified problem.
242
- - `'expiration_error'`: Occurs when there is an issue with the identity provider that prevents the validation of one or both documents provided by the user, due to unspecified problems in the validation process.
243
-
244
219
  ## Auth Request
245
220
 
246
221
  The **`auth_request`** is a process where, using a previously created `auth_request_id`, a request is initiated in which a user can authenticate. This authentication can occur either through an access key or facial video. It's important to note that for this request, the user must have been previously verified with Soyio.
@@ -379,12 +354,11 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
379
354
  // Configuration for the Privacy Center
380
355
  const privacyCenterOptions = {
381
356
  // Choose ONE of the following authentication modes:
382
- // 1) Session token mode
383
- // sessionToken: "<session token>",
384
-
385
- // 2) Company/subject mode
357
+ // 1) Public mode
386
358
  companyId: "<company id>", // e.g. com_...
387
- subjectId: "<subject id>", // Optional, e.g. ent_...
359
+
360
+ // 2) Authenticated mode
361
+ // sessionToken: "<session token>",
388
362
 
389
363
  // Feature flags (optional)
390
364
  enabledFeatures: ["DataSubjectRequest", "ConsentManagement"],
@@ -394,7 +368,7 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
394
368
 
395
369
  // Common options
396
370
  onEvent: (event) => console.log(event),
397
- onReady: () => console.log("PrivacyCenterBox is ready"),
371
+ onReady: () => console.log("PrivacyCenterBox is ready"), // Optional
398
372
  isSandbox: true, // Optional
399
373
  appearance: {}, // Optional
400
374
  };
@@ -411,7 +385,6 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
411
385
 
412
386
  - `sessionToken`: Use this to authenticate a session directly.
413
387
  - `companyId`: The company identifier. Must start with `com_`. Use this when Privacy Center is mounted in a non authenticated environment.
414
- - `subjectId`: Optional subject identifier. Must start with `ent_`.
415
388
  - `enabledFeatures`: Optional array of features to show. Supported values: `"DataSubjectRequest"`, `"ConsentManagement"`.
416
389
  - `dataSubjects`: Optional array of data subject categories. When present, the consent management view only shows consent for the specified categories. Supported values include: `"anonymous_user"`, `"citizen_voter"`, `"commuter"`, `"consultant"`, `"customer"`, `"employee"`, `"job_applicant"`, `"next_of_kin"`, `"passenger"`, `"patient"`, `"prospect"`, `"shareholder"`, `"supplier_vendor"`, `"trainee"`, `"visitor"`.
417
390
  - `isSandbox`: Whether to use the sandbox environment. Defaults to `false`.
@@ -420,13 +393,12 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
420
393
  - `onReady`: Optional callback fired when the iframe becomes ready.
421
394
 
422
395
  Note:
423
- - When `sessionToken` is provided, do not pass `companyId` or `subjectId`.
396
+ - When `sessionToken` is provided, do not pass `companyId`.
424
397
 
425
398
  ### Privacy Center Events
426
399
 
427
400
  - **`REQUEST_SUBMITTED`**: This event occurs when a user successfully submits a Data Subject Request. The event object includes:
428
401
  - `eventName`: The name of the event, in this case, `'REQUEST_SUBMITTED'`.
429
- - `subjectId`: The identifier for the user.
430
402
  - `kind`: The kind of the Data Subject Request submitted. Supported values are: `access`, `opposition`, `rectification`, `suppression` and `portability`
431
403
 
432
404
  # Appearance
package/dist/index.d.ts CHANGED
@@ -164,12 +164,9 @@ declare type ExistingDisclosureRequestProps = {
164
164
  disclosureRequestId: `dreq_${string}`;
165
165
  userReference?: never;
166
166
  userEmail?: never;
167
- forceError?: ForceErrors;
168
167
  customColor?: string;
169
168
  };
170
169
 
171
- declare type ForceErrors = 'facial_validation_error' | 'document_validation_error' | 'unknown_error' | 'expiration_error' | 'camera_permission_error';
172
-
173
170
  declare interface IBaseEventData {
174
171
  identifier: string;
175
172
  eventName: string;
@@ -200,7 +197,6 @@ declare type NewDisclosureRequestProps = {
200
197
  disclosureRequestId?: never;
201
198
  userReference: string;
202
199
  userEmail?: string;
203
- forceError?: ForceErrors;
204
200
  customColor?: string;
205
201
  };
206
202
 
@@ -212,23 +208,16 @@ export declare class PrivacyCenterBox extends BaseIframeBox<PrivacyCenterConfig>
212
208
  iframeUrl(): string;
213
209
  }
214
210
 
215
- declare type PrivacyCenterConfig = PrivacyCenterConfigWithSessionToken | PrivacyCenterConfigWithoutSessionToken;
216
-
217
- declare type PrivacyCenterConfigWithoutSessionToken = BaseConfig & {
218
- sessionToken?: never;
211
+ declare type PrivacyCenterConfig = BaseConfig & {
219
212
  enabledFeatures?: PrivacyManagerFeature[];
220
- companyId: `com_${string}`;
221
- subjectId?: `ent_${string}`;
222
213
  dataSubjects?: DataSubject[];
223
- };
224
-
225
- declare type PrivacyCenterConfigWithSessionToken = BaseConfig & {
214
+ } & ({
215
+ companyId: `com_${string}`;
216
+ sessionToken?: never;
217
+ } | {
226
218
  sessionToken: string;
227
- enabledFeatures?: PrivacyManagerFeature[];
228
219
  companyId?: never;
229
- subjectId?: never;
230
- dataSubjects?: DataSubject[];
231
- };
220
+ });
232
221
 
233
222
  declare type PrivacyManagerFeature = 'DataSubjectRequest' | 'ConsentManagement' | 'RequestTracking';
234
223
 
@@ -238,7 +227,6 @@ declare type RequestConfig = DisclosureRequestConfig | SignatureRequestConfig |
238
227
 
239
228
  declare type SignatureAttemptProps = {
240
229
  signatureAttemptId: `sa_${string}`;
241
- forceError?: ForceErrors;
242
230
  customColor?: string;
243
231
  };
244
232
 
@@ -293,7 +281,6 @@ declare namespace SoyioTypes {
293
281
  ConsentConfig,
294
282
  PrivacyCenterConfig,
295
283
  SoyioAppearance,
296
- ForceErrors,
297
284
  Request_2 as Request,
298
285
  NewDisclosureRequestProps,
299
286
  ExistingDisclosureRequestProps,
@@ -311,7 +298,6 @@ export { SoyioTypes }
311
298
 
312
299
  declare namespace SoyioTypes_2 {
313
300
  export {
314
- ForceErrors,
315
301
  Request_2 as Request,
316
302
  NewDisclosureRequestProps,
317
303
  ExistingDisclosureRequestProps,
package/dist/index.js CHANGED
@@ -178,7 +178,7 @@ function Wn() {
178
178
  })));
179
179
  });
180
180
  }
181
- function Mt(c, d) {
181
+ function jt(c, d) {
182
182
  const {
183
183
  onHeightChange: h,
184
184
  onIframeReady: f,
@@ -236,7 +236,7 @@ const zt = "https://app.soyio.id", Lt = "https://sandbox.soyio.id", An = "https:
236
236
  "DENIED_CAMERA_PERMISSION",
237
237
  "REJECTED_SIGNATURE",
238
238
  "CLOSE_POPUP"
239
- ], jn = "WIDGET_CLOSED", Mn = 420, zn = 720, Ln = 500, kn = {
239
+ ], Mn = "WIDGET_CLOSED", jn = 420, zn = 720, Ln = 500, kn = {
240
240
  minWidth: "375px"
241
241
  }, Un = {
242
242
  minWidth: "0px"
@@ -288,7 +288,7 @@ class We {
288
288
  onTooltipChange: this.handleTooltipChange.bind(this),
289
289
  onInfo: this.options.onEvent.bind(this)
290
290
  };
291
- Mt(this.uniqueIdentifier, d);
291
+ jt(this.uniqueIdentifier, d);
292
292
  });
293
293
  }
294
294
  mount(d) {
@@ -432,7 +432,7 @@ class Hn {
432
432
  this.element.style.opacity = "0", setTimeout(() => this.element.remove(), 300);
433
433
  }
434
434
  }
435
- const He = "2.14.0";
435
+ const He = "2.14.2";
436
436
  function _n(c) {
437
437
  var E;
438
438
  const d = [
@@ -475,7 +475,7 @@ class kt extends We {
475
475
  }
476
476
  setupListeners() {
477
477
  return _(this, null, function* () {
478
- yield Pt(kt.prototype, this, "setupListeners").call(this), Mt(this.uniqueIdentifier, {
478
+ yield Pt(kt.prototype, this, "setupListeners").call(this), jt(this.uniqueIdentifier, {
479
479
  onStateChange: this.handleStateChange.bind(this)
480
480
  });
481
481
  });
@@ -487,7 +487,7 @@ class kt extends We {
487
487
  function qn(c) {
488
488
  var y, E, S;
489
489
  const d = (y = c.isSandbox) != null ? y : !1, h = c.developmentUrl || (d ? Nn : An), f = new URLSearchParams();
490
- f.set("sdkVersion", He), c.sessionToken ? f.set("sessionToken", c.sessionToken) : c.companyId && (f.set("companyId", c.companyId), c.subjectId && f.set("subjectId", c.subjectId)), (E = c.enabledFeatures) != null && E.length && f.set("enabledFeatures", c.enabledFeatures.join(",")), (S = c.dataSubjects) != null && S.length && f.set("dataSubjects", c.dataSubjects.join(","));
490
+ f.set("sdkVersion", He), c.sessionToken ? f.set("sessionToken", c.sessionToken) : c.companyId && f.set("companyId", c.companyId), (E = c.enabledFeatures) != null && E.length && f.set("enabledFeatures", c.enabledFeatures.join(",")), (S = c.dataSubjects) != null && S.length && f.set("dataSubjects", c.dataSubjects.join(","));
491
491
  const v = f.toString();
492
492
  return `${h}${v ? `?${v}` : ""}`;
493
493
  }
@@ -530,7 +530,7 @@ function Vn() {
530
530
  }, Ln);
531
531
  }
532
532
  function Jn(c) {
533
- const d = Gn(c), h = Mn, f = zn, v = 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, S = window.innerHeight || document.documentElement.clientHeight || window.screen.height, A = E / window.screen.availWidth, D = (E - h) / 2 / A + v, k = (S - f) / 2 / A + y;
533
+ const d = Gn(c), h = jn, f = zn, v = 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, S = window.innerHeight || document.documentElement.clientHeight || window.screen.height, A = E / window.screen.availWidth, D = (E - h) / 2 / A + v, k = (S - f) / 2 / A + y;
534
534
  document.body.style.filter = "blur(5px)", document.body.addEventListener("click", Ue), Y = window.open(
535
535
  d,
536
536
  "Soyio",
@@ -552,7 +552,7 @@ function Kn(c) {
552
552
  return _(this, null, function* () {
553
553
  const { onEvent: d } = c, h = yield Promise.resolve().then(() => qe);
554
554
  me && Zn(), me = h.on($n, (v) => _(null, [v], function* ({ data: f }) {
555
- return d(f), Dn.includes(f.eventName) ? Yn() : f.eventName === jn && _e(), Promise.resolve();
555
+ return d(f), Dn.includes(f.eventName) ? Yn() : f.eventName === Mn && _e(), Promise.resolve();
556
556
  }));
557
557
  });
558
558
  }
@@ -1675,10 +1675,10 @@ function tr() {
1675
1675
  if (g === "post") return l().then(function(x) {
1676
1676
  if (!x) throw new Error("Can not post to window without target name");
1677
1677
  (function(b) {
1678
- var C = b.url, M = b.target, R = b.body, T = b.method, L = T === void 0 ? "post" : T, W = document.createElement("form");
1679
- if (W.setAttribute("target", M), W.setAttribute("method", L), W.setAttribute("action", C), W.style.display = "none", R) for (var O = 0, V = Object.keys(R); O < V.length; O++) {
1680
- var j, he = V[O], ze = document.createElement("input");
1681
- ze.setAttribute("name", he), ze.setAttribute("value", (j = R[he]) == null ? void 0 : j.toString()), W.appendChild(ze);
1678
+ var C = b.url, j = b.target, R = b.body, T = b.method, L = T === void 0 ? "post" : T, W = document.createElement("form");
1679
+ if (W.setAttribute("target", j), W.setAttribute("method", L), W.setAttribute("action", C), W.style.display = "none", R) for (var O = 0, V = Object.keys(R); O < V.length; O++) {
1680
+ var M, he = V[O], ze = document.createElement("input");
1681
+ ze.setAttribute("name", he), ze.setAttribute("value", (M = R[he]) == null ? void 0 : M.toString()), W.appendChild(ze);
1682
1682
  }
1683
1683
  tt().appendChild(W), W.submit(), tt().removeChild(W);
1684
1684
  })({
@@ -1846,9 +1846,9 @@ function tr() {
1846
1846
  }, function(w) {
1847
1847
  var m = w.source, p = w.origin, g = w.data, I = g.id, x = g.name, b = ft(m, I);
1848
1848
  if (!b) throw new Error("Could not find method '" + x + "' with id: " + g.id + " in " + F(window));
1849
- var C = b.source, M = b.domain, R = b.val;
1849
+ var C = b.source, j = b.domain, R = b.val;
1850
1850
  return P.try(function() {
1851
- if (!re(M, p)) throw new Error("Method '" + g.name + "' domain " + JSON.stringify(Re(b.domain) ? b.domain.source : b.domain) + " does not match origin " + p + " in " + F(window));
1851
+ if (!re(j, p)) throw new Error("Method '" + g.name + "' domain " + JSON.stringify(Re(b.domain) ? b.domain.source : b.domain) + " does not match origin " + p + " in " + F(window));
1852
1852
  if (B.isProxyWindow(C)) return C.matchWindow(m, {
1853
1853
  send: l
1854
1854
  }).then(function(T) {
@@ -1948,7 +1948,7 @@ function tr() {
1948
1948
  var m = s.id, p = s.name, g = w.send, I = function(b) {
1949
1949
  b === void 0 && (b = {});
1950
1950
  function C() {
1951
- var M = arguments;
1951
+ var j = arguments;
1952
1952
  return B.toProxyWindow(l, {
1953
1953
  send: g
1954
1954
  }).awaitWindow().then(function(R) {
@@ -1956,8 +1956,8 @@ function tr() {
1956
1956
  if (T && T.val !== C) return T.val.apply({
1957
1957
  source: window,
1958
1958
  origin: F()
1959
- }, M);
1960
- var L = [].slice.call(M);
1959
+ }, j);
1960
+ var L = [].slice.call(j);
1961
1961
  return b.fireAndForget ? g(R, "postrobot_method", {
1962
1962
  id: m,
1963
1963
  name: p,
@@ -1993,11 +1993,11 @@ function tr() {
1993
1993
  });
1994
1994
  }, o));
1995
1995
  }
1996
- var je = {};
1997
- je.postrobot_post_message = function(e, n, t) {
1996
+ var Me = {};
1997
+ Me.postrobot_post_message = function(e, n, t) {
1998
1998
  t.indexOf("file:") === 0 && (t = "*"), e.postMessage(n, t);
1999
1999
  };
2000
- function Me(e, n, t, r) {
2000
+ function je(e, n, t, r) {
2001
2001
  var o = r.on, i = r.send;
2002
2002
  return P.try(function() {
2003
2003
  var a = H().getOrSet(e, function() {
@@ -2010,10 +2010,10 @@ function tr() {
2010
2010
  send: i
2011
2011
  }), u;
2012
2012
  delete a.buffer;
2013
- for (var s = Object.keys(je), w = [], m = 0; m < s.length; m++) {
2013
+ for (var s = Object.keys(Me), w = [], m = 0; m < s.length; m++) {
2014
2014
  var p = s[m];
2015
2015
  try {
2016
- je[p](e, l, n);
2016
+ Me[p](e, l, n);
2017
2017
  } catch (g) {
2018
2018
  w.push(g);
2019
2019
  }
@@ -2071,7 +2071,7 @@ function tr() {
2071
2071
  function u(s, w, m) {
2072
2072
  return P.flush().then(function() {
2073
2073
  if (!t.fireAndForget && !G(e)) try {
2074
- return Me(e, n, {
2074
+ return je(e, n, {
2075
2075
  id: J(),
2076
2076
  origin: F(window),
2077
2077
  type: "postrobot_message_response",
@@ -2093,7 +2093,7 @@ function tr() {
2093
2093
  }
2094
2094
  return P.all([P.flush().then(function() {
2095
2095
  if (!t.fireAndForget && !G(e)) try {
2096
- return Me(e, n, {
2096
+ return je(e, n, {
2097
2097
  id: J(),
2098
2098
  origin: F(window),
2099
2099
  type: "postrobot_message_ack",
@@ -2165,7 +2165,7 @@ function tr() {
2165
2165
  on: I,
2166
2166
  send: x
2167
2167
  });
2168
- } catch (M) {
2168
+ } catch (j) {
2169
2169
  return;
2170
2170
  }
2171
2171
  if (b && typeof b == "object" && b !== null) {
@@ -2202,17 +2202,17 @@ function tr() {
2202
2202
  var l = i.name, u = i.win, s = i.domain, w = H("requestListeners");
2203
2203
  if (!l || typeof l != "string") throw new Error("Name required to add request listener");
2204
2204
  if (u && u !== "*" && B.isProxyWindow(u)) {
2205
- var m = u.awaitWindow().then(function(j) {
2205
+ var m = u.awaitWindow().then(function(M) {
2206
2206
  return o({
2207
2207
  name: l,
2208
- win: j,
2208
+ win: M,
2209
2209
  domain: s
2210
2210
  }, a);
2211
2211
  });
2212
2212
  return {
2213
2213
  cancel: function() {
2214
- m.then(function(j) {
2215
- return j.cancel();
2214
+ m.then(function(M) {
2215
+ return M.cancel();
2216
2216
  }, ee);
2217
2217
  }
2218
2218
  };
@@ -2226,19 +2226,19 @@ function tr() {
2226
2226
  }, a));
2227
2227
  return {
2228
2228
  cancel: function() {
2229
- for (var j = 0; j < g.length; j++) g[j].cancel();
2229
+ for (var M = 0; M < g.length; M++) g[M].cancel();
2230
2230
  }
2231
2231
  };
2232
2232
  }
2233
2233
  if (Array.isArray(s)) {
2234
- for (var b = [], C = 0, M = s; C < M.length; C++) b.push(o({
2234
+ for (var b = [], C = 0, j = s; C < j.length; C++) b.push(o({
2235
2235
  name: l,
2236
2236
  win: p,
2237
- domain: M[C]
2237
+ domain: j[C]
2238
2238
  }, a));
2239
2239
  return {
2240
2240
  cancel: function() {
2241
- for (var j = 0; j < b.length; j++) b[j].cancel();
2241
+ for (var M = 0; M < b.length; M++) b[M].cancel();
2242
2242
  }
2243
2243
  };
2244
2244
  }
@@ -2322,16 +2322,16 @@ function tr() {
2322
2322
  for (var L = [], W = 0, O = Be(T); W < O.length; W++) {
2323
2323
  var V = O[W];
2324
2324
  L.push(V);
2325
- for (var j = 0, he = R(V); j < he.length; j++) L.push(he[j]);
2325
+ for (var M = 0, he = R(V); M < he.length; M++) L.push(he[M]);
2326
2326
  }
2327
2327
  return L;
2328
2328
  }(x); b < C.length; b++) {
2329
- var M = C[b];
2329
+ var j = C[b];
2330
2330
  try {
2331
- if (M.top) return M.top;
2331
+ if (j.top) return j.top;
2332
2332
  } catch (R) {
2333
2333
  }
2334
- if (k(M) === M) return M;
2334
+ if (k(j) === j) return j;
2335
2335
  }
2336
2336
  }(m) === m) return !1;
2337
2337
  for (var g = 0, I = Be(w); g < I.length; g++) if (I[g] === m) return !0;
@@ -2385,15 +2385,15 @@ function tr() {
2385
2385
  });
2386
2386
  var C = function(W) {
2387
2387
  return H("knownWindows").get(W, !1);
2388
- }(s) ? 1e4 : 2e3, M = a, R = C, T = M, L = function(W, O) {
2388
+ }(s) ? 1e4 : 2e3, j = a, R = C, T = j, L = function(W, O) {
2389
2389
  var V;
2390
- return function j() {
2390
+ return function M() {
2391
2391
  V = setTimeout(function() {
2392
2392
  (function() {
2393
2393
  if (G(s)) return g.reject(new Error("Window closed for " + t + " before " + (x.ack ? "response" : "ack")));
2394
2394
  if (x.cancelled) return g.reject(new Error("Response listener was cancelled for " + t));
2395
- R = Math.max(R - 500, 0), T !== -1 && (T = Math.max(T - 500, 0)), x.ack || R !== 0 ? T === 0 && g.reject(new Error("No response for postMessage " + p + " in " + F() + " in " + M + "ms")) : g.reject(new Error("No ack for postMessage " + p + " in " + F() + " in " + C + "ms"));
2396
- })(), j();
2395
+ R = Math.max(R - 500, 0), T !== -1 && (T = Math.max(T - 500, 0)), x.ack || R !== 0 ? T === 0 && g.reject(new Error("No response for postMessage " + p + " in " + F() + " in " + j + "ms")) : g.reject(new Error("No ack for postMessage " + p + " in " + F() + " in " + C + "ms"));
2396
+ })(), M();
2397
2397
  }, 500);
2398
2398
  }(), {
2399
2399
  cancel: function() {
@@ -2405,7 +2405,7 @@ function tr() {
2405
2405
  L.cancel(), b.splice(b.indexOf(g, 1));
2406
2406
  }).catch(ee);
2407
2407
  }
2408
- return Me(s, m, {
2408
+ return je(s, m, {
2409
2409
  id: J(),
2410
2410
  origin: F(window),
2411
2411
  type: "postrobot_message_request",
@@ -2534,9 +2534,9 @@ function tr() {
2534
2534
  });
2535
2535
  }(xe)), xe.exports;
2536
2536
  }
2537
- var jt;
2537
+ var Mt;
2538
2538
  function nr() {
2539
- return jt || (jt = 1, function(c) {
2539
+ return Mt || (Mt = 1, function(c) {
2540
2540
  c.exports = tr(), c.exports.default = c.exports;
2541
2541
  }(ke)), ke.exports;
2542
2542
  }
@@ -1,4 +1,4 @@
1
- (function(I,T){typeof exports=="object"&&typeof module!="undefined"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(I=typeof globalThis!="undefined"?globalThis:I||self,T(I["soyio-widget"]={}))})(this,function(I){"use strict";var er=Object.defineProperty;var _t=Object.getOwnPropertySymbols,tr=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty,rr=Object.prototype.propertyIsEnumerable,or=Reflect.get;var qt=I=>{throw TypeError(I)};var ir=(I,T,R)=>T in I?er(I,T,{enumerable:!0,configurable:!0,writable:!0,value:R}):I[T]=R;var Bt=(I,T)=>{var R={};for(var _ in I)nr.call(I,_)&&T.indexOf(_)<0&&(R[_]=I[_]);if(I!=null&&_t)for(var _ of _t(I))T.indexOf(_)<0&&rr.call(I,_)&&(R[_]=I[_]);return R};var j=(I,T,R)=>ir(I,typeof T!="symbol"?T+"":T,R),ar=(I,T,R)=>T.has(I)||qt("Cannot "+R);var $t=(I,T,R)=>T.has(I)?qt("Cannot add the same private member more than once"):T instanceof WeakSet?T.add(I):T.set(I,R);var Gt=(I,T,R)=>(ar(I,T,"access private method"),R);var Vt=(I,T,R)=>or(tr(I),R,T);var G=(I,T,R)=>new Promise((_,re)=>{var De=Q=>{try{de(R.next(Q))}catch(fe){re(fe)}},je=Q=>{try{de(R.throw(Q))}catch(fe){re(fe)}},de=Q=>Q.done?_(Q.value):Promise.resolve(Q.value).then(De,je);de((R=R.apply(I,T)).next())});var We,Jt;function T(l,f){for(var g=0;g<f.length;g++){const d=f[g];if(typeof d!="string"&&!Array.isArray(d)){for(const v in d)if(v!=="default"&&!(v in l)){const y=Object.getOwnPropertyDescriptor(d,v);y&&Object.defineProperty(l,v,y.get?y:{enumerable:!0,get:()=>d[v]})}}}return Object.freeze(Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}))}const R=!!(typeof window!="undefined"&&window.document&&window.document.createElement),_=200;class re{constructor(){j(this,"tooltipElement",null);j(this,"tooltipContent",null);j(this,"tooltipClass","soyio-tooltip");j(this,"hideTimeout",null);R&&this.createTooltipElement()}createTooltipElement(){const f=document.querySelector(`.${this.tooltipClass}`);if(f){this.tooltipElement=f,this.tooltipContent=this.tooltipElement.querySelector(".soyio-tooltip-content");return}this.tooltipElement=document.createElement("div"),this.tooltipElement.className=this.tooltipClass,this.tooltipElement.style.cssText=`
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 er=Object.defineProperty;var _t=Object.getOwnPropertySymbols,tr=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty,rr=Object.prototype.propertyIsEnumerable,or=Reflect.get;var qt=I=>{throw TypeError(I)};var ir=(I,C,R)=>C in I?er(I,C,{enumerable:!0,configurable:!0,writable:!0,value:R}):I[C]=R;var Bt=(I,C)=>{var R={};for(var _ in I)nr.call(I,_)&&C.indexOf(_)<0&&(R[_]=I[_]);if(I!=null&&_t)for(var _ of _t(I))C.indexOf(_)<0&&rr.call(I,_)&&(R[_]=I[_]);return R};var M=(I,C,R)=>ir(I,typeof C!="symbol"?C+"":C,R),ar=(I,C,R)=>C.has(I)||qt("Cannot "+R);var $t=(I,C,R)=>C.has(I)?qt("Cannot add the same private member more than once"):C instanceof WeakSet?C.add(I):C.set(I,R);var Gt=(I,C,R)=>(ar(I,C,"access private method"),R);var Vt=(I,C,R)=>or(tr(I),R,C);var G=(I,C,R)=>new Promise((_,re)=>{var De=Q=>{try{de(R.next(Q))}catch(fe){re(fe)}},Me=Q=>{try{de(R.throw(Q))}catch(fe){re(fe)}},de=Q=>Q.done?_(Q.value):Promise.resolve(Q.value).then(De,Me);de((R=R.apply(I,C)).next())});var We,Jt;function C(h,f){for(var g=0;g<f.length;g++){const d=f[g];if(typeof d!="string"&&!Array.isArray(d)){for(const v in d)if(v!=="default"&&!(v in h)){const y=Object.getOwnPropertyDescriptor(d,v);y&&Object.defineProperty(h,v,y.get?y:{enumerable:!0,get:()=>d[v]})}}}return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}const R=!!(typeof window!="undefined"&&window.document&&window.document.createElement),_=200;class re{constructor(){M(this,"tooltipElement",null);M(this,"tooltipContent",null);M(this,"tooltipClass","soyio-tooltip");M(this,"hideTimeout",null);R&&this.createTooltipElement()}createTooltipElement(){const f=document.querySelector(`.${this.tooltipClass}`);if(f){this.tooltipElement=f,this.tooltipContent=this.tooltipElement.querySelector(".soyio-tooltip-content");return}this.tooltipElement=document.createElement("div"),this.tooltipElement.className=this.tooltipClass,this.tooltipElement.style.cssText=`
2
2
  position: fixed;
3
3
  z-index: 99999;
4
4
  background: rgba(30, 30, 30, 0.9);
@@ -16,7 +16,7 @@
16
16
  backdrop-filter: blur(5px);
17
17
  -webkit-backdrop-filter: blur(5px);
18
18
  transform: scale(0.95);
19
- `,this.tooltipContent=document.createElement("div"),this.tooltipContent.className="soyio-tooltip-content",this.tooltipElement.appendChild(this.tooltipContent),document.body.appendChild(this.tooltipElement)}show(f,g,d){if(!this.tooltipElement||!this.tooltipContent)return;this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.tooltipContent.textContent=f,this.tooltipElement.style.opacity="0",this.tooltipElement.style.transform="scale(0.95)";const v=this.calculateOptimalPlacement(g,d);this.applyPlacement(v),requestAnimationFrame(()=>{this.tooltipElement&&(this.tooltipElement.style.opacity="1",this.tooltipElement.style.transform="scale(1)")})}calculateOptimalPlacement(f,g){const d=this.tooltipElement.offsetWidth,v=this.tooltipElement.offsetHeight,{innerWidth:y,innerHeight:E}=window,W=4,q={top:{top:g-v-W,left:f-d/2,placement:"top"},bottom:{top:g+W,left:f-d/2,placement:"bottom"},right:{top:g-v/2,left:f+W,placement:"right"},left:{top:g-v/2,left:f-d-W,placement:"left"}};for(const[,H]of Object.entries(q))if(re.fitsInViewport(H,d,v,y,E))return H;const U=q.top;return U.left=Math.max(W,Math.min(U.left,y-d-W)),U.top=Math.max(W,Math.min(U.top,E-v-W)),U}static fitsInViewport(f,g,d,v,y){return f.top>=0&&f.left>=0&&f.top+d<=y&&f.left+g<=v}applyPlacement(f){this.tooltipElement&&(this.tooltipElement.style.left=`${f.left}px`,this.tooltipElement.style.top=`${f.top}px`)}hide(){this.tooltipElement&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.tooltipElement.style.opacity="0",this.tooltipElement.style.transform="scale(0.95)")}destroy(){var f;(f=this.tooltipElement)==null||f.remove(),this.tooltipElement=null,this.tooltipContent=null,this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)}}function De(l,f,g){return G(this,null,function*(){if(!l.contentWindow)throw new Error("Invalid iframe: contentWindow is null");const d=yield Promise.resolve().then(()=>He);try{yield d.send(l.contentWindow,"SET_APPEARANCE",{appearance:f,identifier:g})}catch(v){console.error("Failed to send appearance config:",v)}})}const je="IFRAME_READY",de="IFRAME_HEIGHT_CHANGE",Q="TOOLTIP_STATE_CHANGE",fe="INFO_EVENT",Yt="CONSENT_STATE_CHANGE",F={onHeightChange:{},onIframeReady:{},onTooltipChange:{},onInfo:{},onStateChange:{}};let Qe,et,tt,nt,rt;function Zt(){return G(this,null,function*(){const l=yield Promise.resolve().then(()=>He);Qe||et||tt||nt||rt||(Qe=l.on(de,f=>G(null,null,function*(){const g=f.data,d=F.onHeightChange[g.identifier];return d&&d(g.height),Promise.resolve()})),et=l.on(je,f=>G(null,null,function*(){const g=f.data,d=F.onIframeReady[g.identifier];return d&&d(),Promise.resolve()})),tt=l.on(Q,f=>G(null,null,function*(){const g=f.data,d=F.onTooltipChange[g.identifier];return d&&d(g),Promise.resolve()})),nt=l.on(Yt,f=>G(null,null,function*(){const g=f.data,d=F.onStateChange[g.identifier];return d&&d(g),Promise.resolve()})),rt=l.on(fe,g=>G(null,[g],function*({data:f}){const E=f,{identifier:d}=E,v=Bt(E,["identifier"]),y=F.onInfo[d];return y&&y(v),Promise.resolve()})))})}function ot(l,f){const{onHeightChange:g,onIframeReady:d,onTooltipChange:v,onStateChange:y,onInfo:E}=f;g&&(F.onHeightChange[l]=g),d&&(F.onIframeReady[l]=d),v&&(F.onTooltipChange[l]=v),y&&(F.onStateChange[l]=y),E&&(F.onInfo[l]=E)}function Kt(l){delete F.onHeightChange[l],delete F.onIframeReady[l],delete F.onTooltipChange[l],delete F.onStateChange[l],delete F.onInfo[l]}function Xt(l){const f=document.getElementById(l);f&&(console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."),f.remove())}function Qt(l){const f=document.querySelector(l);if(!f)throw new Error(`Iframe div container with id '${l}' not found`);if(f.tagName.toLowerCase()!=="div")throw new Error(`Iframe container with id '${l}' must be a <div> element`);const g=f;return g.style.position="relative",g.style.cssText+=`
19
+ `,this.tooltipContent=document.createElement("div"),this.tooltipContent.className="soyio-tooltip-content",this.tooltipElement.appendChild(this.tooltipContent),document.body.appendChild(this.tooltipElement)}show(f,g,d){if(!this.tooltipElement||!this.tooltipContent)return;this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.tooltipContent.textContent=f,this.tooltipElement.style.opacity="0",this.tooltipElement.style.transform="scale(0.95)";const v=this.calculateOptimalPlacement(g,d);this.applyPlacement(v),requestAnimationFrame(()=>{this.tooltipElement&&(this.tooltipElement.style.opacity="1",this.tooltipElement.style.transform="scale(1)")})}calculateOptimalPlacement(f,g){const d=this.tooltipElement.offsetWidth,v=this.tooltipElement.offsetHeight,{innerWidth:y,innerHeight:E}=window,W=4,q={top:{top:g-v-W,left:f-d/2,placement:"top"},bottom:{top:g+W,left:f-d/2,placement:"bottom"},right:{top:g-v/2,left:f+W,placement:"right"},left:{top:g-v/2,left:f-d-W,placement:"left"}};for(const[,H]of Object.entries(q))if(re.fitsInViewport(H,d,v,y,E))return H;const U=q.top;return U.left=Math.max(W,Math.min(U.left,y-d-W)),U.top=Math.max(W,Math.min(U.top,E-v-W)),U}static fitsInViewport(f,g,d,v,y){return f.top>=0&&f.left>=0&&f.top+d<=y&&f.left+g<=v}applyPlacement(f){this.tooltipElement&&(this.tooltipElement.style.left=`${f.left}px`,this.tooltipElement.style.top=`${f.top}px`)}hide(){this.tooltipElement&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.tooltipElement.style.opacity="0",this.tooltipElement.style.transform="scale(0.95)")}destroy(){var f;(f=this.tooltipElement)==null||f.remove(),this.tooltipElement=null,this.tooltipContent=null,this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)}}function De(h,f,g){return G(this,null,function*(){if(!h.contentWindow)throw new Error("Invalid iframe: contentWindow is null");const d=yield Promise.resolve().then(()=>He);try{yield d.send(h.contentWindow,"SET_APPEARANCE",{appearance:f,identifier:g})}catch(v){console.error("Failed to send appearance config:",v)}})}const Me="IFRAME_READY",de="IFRAME_HEIGHT_CHANGE",Q="TOOLTIP_STATE_CHANGE",fe="INFO_EVENT",Yt="CONSENT_STATE_CHANGE",F={onHeightChange:{},onIframeReady:{},onTooltipChange:{},onInfo:{},onStateChange:{}};let Qe,et,tt,nt,rt;function Zt(){return G(this,null,function*(){const h=yield Promise.resolve().then(()=>He);Qe||et||tt||nt||rt||(Qe=h.on(de,f=>G(null,null,function*(){const g=f.data,d=F.onHeightChange[g.identifier];return d&&d(g.height),Promise.resolve()})),et=h.on(Me,f=>G(null,null,function*(){const g=f.data,d=F.onIframeReady[g.identifier];return d&&d(),Promise.resolve()})),tt=h.on(Q,f=>G(null,null,function*(){const g=f.data,d=F.onTooltipChange[g.identifier];return d&&d(g),Promise.resolve()})),nt=h.on(Yt,f=>G(null,null,function*(){const g=f.data,d=F.onStateChange[g.identifier];return d&&d(g),Promise.resolve()})),rt=h.on(fe,g=>G(null,[g],function*({data:f}){const E=f,{identifier:d}=E,v=Bt(E,["identifier"]),y=F.onInfo[d];return y&&y(v),Promise.resolve()})))})}function ot(h,f){const{onHeightChange:g,onIframeReady:d,onTooltipChange:v,onStateChange:y,onInfo:E}=f;g&&(F.onHeightChange[h]=g),d&&(F.onIframeReady[h]=d),v&&(F.onTooltipChange[h]=v),y&&(F.onStateChange[h]=y),E&&(F.onInfo[h]=E)}function Kt(h){delete F.onHeightChange[h],delete F.onIframeReady[h],delete F.onTooltipChange[h],delete F.onStateChange[h],delete F.onInfo[h]}function Xt(h){const f=document.getElementById(h);f&&(console.warn("ConsentBox iframe already exists. Removing existing before mounting new one."),f.remove())}function Qt(h){const f=document.querySelector(h);if(!f)throw new Error(`Iframe div container with id '${h}' not found`);if(f.tagName.toLowerCase()!=="div")throw new Error(`Iframe container with id '${h}' must be a <div> element`);const g=f;return g.style.position="relative",g.style.cssText+=`
20
20
  padding: 0 !important;
21
21
  margin: 0 !important;
22
22
  display: flex !important;
@@ -25,7 +25,7 @@
25
25
  border: none !important;
26
26
  transition: height 0.35s !important;
27
27
  opacity: 1 !important;
28
- `,g}function en(l,f,g){const d=document.createElement("iframe");return d.id=f,d.src=l,d.style.cssText+=`
28
+ `,g}function en(h,f,g){const d=document.createElement("iframe");return d.id=f,d.src=h,d.style.cssText+=`
29
29
  width: 100% !important;
30
30
  min-width: ${g.minWidth} !important;
31
31
  border: none !important;
@@ -33,7 +33,7 @@
33
33
  opacity: 1;
34
34
  transition: height 0.35s,
35
35
  opacity 0.4s 0.1s;
36
- `,d}function tn(){return Math.random().toString(36).substring(2,10)}const it="https://app.soyio.id",at="https://sandbox.soyio.id",nn="https://privacy.soyio.id",rn="https://privacy-sandbox.soyio.id",on=["DISCLOSURE_REQUEST_SUCCESSFUL","IDENTITY_REGISTERED","IDENTITY_SIGNATURE","UNEXPECTED_ERROR","DENIED_CAMERA_PERMISSION","REJECTED_SIGNATURE","CLOSE_POPUP"],an="WIDGET_CLOSED",sn=420,un=720,cn=500,dn={minWidth:"375px"},fn={minWidth:"0px"},ln={minWidth:"375px"};class xe{constructor(f){j(this,"iframe",null);j(this,"skeleton",null);j(this,"options");j(this,"appearance");j(this,"tooltipManager");j(this,"defaultIframeCSSConfig",dn);j(this,"Skeleton",null);j(this,"defaultUniqueId");this.options=f,this.appearance=f.appearance||null,this.tooltipManager=new re,this.defaultUniqueId=xe.generateUniqueId()}static generateUniqueId(){return tn()}get uniqueIdentifier(){return this.defaultUniqueId}get iframeIdentifier(){return`${this.defaultIframePrefix}-${this.uniqueIdentifier}`}handleHeightChange(f){if(!this.iframe||(this.iframe.style.height=`${f}px`,f>0))return;const{parentElement:g}=this.iframe;g&&(g.style.display="none")}handleIframeReady(){return G(this,null,function*(){this.iframe&&(this.options.onReady&&this.options.onReady(),yield De(this.iframe,this.appearance,this.uniqueIdentifier),this.skeleton&&this.skeleton.hide())})}handleTooltipChange(f){if(!this.iframe)return;const g=this.iframe.getBoundingClientRect(),{text:d,coordinates:v,isVisible:y}=f,E=v.x+g.left,W=v.y+g.top;y?this.tooltipManager.show(d,E,W):this.tooltipManager.hide()}setupListeners(){return G(this,null,function*(){yield Zt();const f={onHeightChange:this.handleHeightChange.bind(this),onIframeReady:this.handleIframeReady.bind(this),onTooltipChange:this.handleTooltipChange.bind(this),onInfo:this.options.onEvent.bind(this)};ot(this.uniqueIdentifier,f)})}mount(f){return G(this,null,function*(){if(!R)return this;yield this.setupListeners(),Xt(this.iframeIdentifier);const g=Qt(f),d=this.iframeUrl();return this.iframe=en(d,this.iframeIdentifier,this.defaultIframeCSSConfig),this.Skeleton&&(this.skeleton=new this.Skeleton(this.uniqueIdentifier),this.skeleton.mount(g)),g.appendChild(this.iframe),this})}unmount(){R&&(Kt(this.uniqueIdentifier),this.skeleton&&(this.skeleton.hide(),this.skeleton=null),this.iframe&&(this.iframe.remove(),this.iframe=null))}}class hn{constructor(f){j(this,"element");j(this,"identifier");this.identifier=`skeleton-${f}`,this.element=document.createElement("div"),this.element.id=this.identifier,this.element.style.cssText=`
36
+ `,d}function tn(){return Math.random().toString(36).substring(2,10)}const it="https://app.soyio.id",at="https://sandbox.soyio.id",nn="https://privacy.soyio.id",rn="https://privacy-sandbox.soyio.id",on=["DISCLOSURE_REQUEST_SUCCESSFUL","IDENTITY_REGISTERED","IDENTITY_SIGNATURE","UNEXPECTED_ERROR","DENIED_CAMERA_PERMISSION","REJECTED_SIGNATURE","CLOSE_POPUP"],an="WIDGET_CLOSED",sn=420,un=720,cn=500,dn={minWidth:"375px"},fn={minWidth:"0px"},ln={minWidth:"375px"};class be{constructor(f){M(this,"iframe",null);M(this,"skeleton",null);M(this,"options");M(this,"appearance");M(this,"tooltipManager");M(this,"defaultIframeCSSConfig",dn);M(this,"Skeleton",null);M(this,"defaultUniqueId");this.options=f,this.appearance=f.appearance||null,this.tooltipManager=new re,this.defaultUniqueId=be.generateUniqueId()}static generateUniqueId(){return tn()}get uniqueIdentifier(){return this.defaultUniqueId}get iframeIdentifier(){return`${this.defaultIframePrefix}-${this.uniqueIdentifier}`}handleHeightChange(f){if(!this.iframe||(this.iframe.style.height=`${f}px`,f>0))return;const{parentElement:g}=this.iframe;g&&(g.style.display="none")}handleIframeReady(){return G(this,null,function*(){this.iframe&&(this.options.onReady&&this.options.onReady(),yield De(this.iframe,this.appearance,this.uniqueIdentifier),this.skeleton&&this.skeleton.hide())})}handleTooltipChange(f){if(!this.iframe)return;const g=this.iframe.getBoundingClientRect(),{text:d,coordinates:v,isVisible:y}=f,E=v.x+g.left,W=v.y+g.top;y?this.tooltipManager.show(d,E,W):this.tooltipManager.hide()}setupListeners(){return G(this,null,function*(){yield Zt();const f={onHeightChange:this.handleHeightChange.bind(this),onIframeReady:this.handleIframeReady.bind(this),onTooltipChange:this.handleTooltipChange.bind(this),onInfo:this.options.onEvent.bind(this)};ot(this.uniqueIdentifier,f)})}mount(f){return G(this,null,function*(){if(!R)return this;yield this.setupListeners(),Xt(this.iframeIdentifier);const g=Qt(f),d=this.iframeUrl();return this.iframe=en(d,this.iframeIdentifier,this.defaultIframeCSSConfig),this.Skeleton&&(this.skeleton=new this.Skeleton(this.uniqueIdentifier),this.skeleton.mount(g)),g.appendChild(this.iframe),this})}unmount(){R&&(Kt(this.uniqueIdentifier),this.skeleton&&(this.skeleton.hide(),this.skeleton=null),this.iframe&&(this.iframe.remove(),this.iframe=null))}}class hn{constructor(f){M(this,"element");M(this,"identifier");this.identifier=`skeleton-${f}`,this.element=document.createElement("div"),this.element.id=this.identifier,this.element.style.cssText=`
37
37
  position: absolute;
38
38
  left: 50%;
39
39
  top: 50%;
@@ -121,24 +121,24 @@
121
121
  0% { background-position: 200% 0; }
122
122
  100% { background-position: -200% 0; }
123
123
  }
124
- `,document.head.appendChild(te)}d.appendChild(v),d.appendChild(y),d.appendChild(E),U.appendChild(H),U.appendChild(he),W.appendChild(q),W.appendChild(U),g.appendChild(d),g.appendChild(W),this.element.appendChild(g)}cleanupExistingSkeleton(){const f=document.getElementById(this.identifier);f&&f.remove()}mount(f){this.cleanupExistingSkeleton(),f.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}const Me="2.14.0";function mn(l){var E;const f=["actionToken","entityId","context","optionalReconsentBehavior","mandatoryReconsentBehavior"],g=(E=l.isSandbox)!=null?E:!1,d=l.developmentUrl||(g?at:it),v=new URLSearchParams;v.set("sdkVersion",Me),f.forEach(W=>{l[W]&&v.set(W,l[W])});const y=v.toString();return`${d}/embed/consents/${l.consentTemplateId}${y?`?${y}`:""}`}class ze extends xe{constructor(g){super(g);j(this,"defaultIframePrefix","consent-box");j(this,"defaultIframeCSSConfig",fn);j(this,"state",{isSelected:!1,actionToken:null});this.Skeleton=hn}get uniqueIdentifier(){return this.options.consentTemplateId}iframeUrl(){return mn(this.options)}handleStateChange(g){const{isSelected:d,actionToken:v}=g;this.state={isSelected:d,actionToken:v},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:d,actionToken:v})}setupListeners(){return G(this,null,function*(){yield Vt(ze.prototype,this,"setupListeners").call(this),ot(this.uniqueIdentifier,{onStateChange:this.handleStateChange.bind(this)})})}getState(){return this.state}}function pn(l){var y,E,W;const f=(y=l.isSandbox)!=null?y:!1,g=l.developmentUrl||(f?rn:nn),d=new URLSearchParams;d.set("sdkVersion",Me),l.sessionToken?d.set("sessionToken",l.sessionToken):l.companyId&&(d.set("companyId",l.companyId),l.subjectId&&d.set("subjectId",l.subjectId)),(E=l.enabledFeatures)!=null&&E.length&&d.set("enabledFeatures",l.enabledFeatures.join(",")),(W=l.dataSubjects)!=null&&W.length&&d.set("dataSubjects",l.dataSubjects.join(","));const v=d.toString();return`${g}${v?`?${v}`:""}`}class vn extends xe{constructor(){super(...arguments);j(this,"defaultIframePrefix","privacy-center");j(this,"_uniqueIdentifier","privacy-center");j(this,"defaultIframeCSSConfig",ln)}get uniqueIdentifier(){return this._uniqueIdentifier}iframeUrl(){return pn(this.options)}}const wn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gn="WIDGET_EVENT";function yn(l){let f="widget/";return"disclosureRequestId"in l.configProps?f+=["disclosures",l.configProps.disclosureRequestId].join("/"):f+=l.request,f}function En(l){var y;const f=(y=l.isSandbox)!=null?y:!1,g=l.developmentUrl||(f?at:it),d=Object.entries(l.configProps).filter(([E,W])=>W||E==="disclosureRequestId").map(([E,W])=>`${E}=${encodeURIComponent(W)}`).join("&"),v=yn(l);return`${g}/${v}?sdk=web&sdkVersion=${Me}&${d}`}let ee=null,Le=null;function ke(l=null){ee&&!ee.closed&&ee.focus(),l==null||l.preventDefault()}function Ue(){document.body.style.filter="",document.body.removeEventListener("click",ke)}function Sn(){Le=setInterval(()=>{(!ee||ee.closed)&&(Le&&clearInterval(Le),Ue())},cn)}function bn(l){const f=En(l),g=sn,d=un,v=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,W=window.innerHeight||document.documentElement.clientHeight||window.screen.height,q=E/window.screen.availWidth,U=(E-g)/2/q+v,H=(W-d)/2/q+y;document.body.style.filter="blur(5px)",document.body.addEventListener("click",ke),ee=window.open(f,"Soyio",`scrollbars=yes,
124
+ `,document.head.appendChild(te)}d.appendChild(v),d.appendChild(y),d.appendChild(E),U.appendChild(H),U.appendChild(he),W.appendChild(q),W.appendChild(U),g.appendChild(d),g.appendChild(W),this.element.appendChild(g)}cleanupExistingSkeleton(){const f=document.getElementById(this.identifier);f&&f.remove()}mount(f){this.cleanupExistingSkeleton(),f.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}const je="2.14.2";function mn(h){var E;const f=["actionToken","entityId","context","optionalReconsentBehavior","mandatoryReconsentBehavior"],g=(E=h.isSandbox)!=null?E:!1,d=h.developmentUrl||(g?at:it),v=new URLSearchParams;v.set("sdkVersion",je),f.forEach(W=>{h[W]&&v.set(W,h[W])});const y=v.toString();return`${d}/embed/consents/${h.consentTemplateId}${y?`?${y}`:""}`}class ze extends be{constructor(g){super(g);M(this,"defaultIframePrefix","consent-box");M(this,"defaultIframeCSSConfig",fn);M(this,"state",{isSelected:!1,actionToken:null});this.Skeleton=hn}get uniqueIdentifier(){return this.options.consentTemplateId}iframeUrl(){return mn(this.options)}handleStateChange(g){const{isSelected:d,actionToken:v}=g;this.state={isSelected:d,actionToken:v},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:d,actionToken:v})}setupListeners(){return G(this,null,function*(){yield Vt(ze.prototype,this,"setupListeners").call(this),ot(this.uniqueIdentifier,{onStateChange:this.handleStateChange.bind(this)})})}getState(){return this.state}}function pn(h){var y,E,W;const f=(y=h.isSandbox)!=null?y:!1,g=h.developmentUrl||(f?rn:nn),d=new URLSearchParams;d.set("sdkVersion",je),h.sessionToken?d.set("sessionToken",h.sessionToken):h.companyId&&d.set("companyId",h.companyId),(E=h.enabledFeatures)!=null&&E.length&&d.set("enabledFeatures",h.enabledFeatures.join(",")),(W=h.dataSubjects)!=null&&W.length&&d.set("dataSubjects",h.dataSubjects.join(","));const v=d.toString();return`${g}${v?`?${v}`:""}`}class vn extends be{constructor(){super(...arguments);M(this,"defaultIframePrefix","privacy-center");M(this,"_uniqueIdentifier","privacy-center");M(this,"defaultIframeCSSConfig",ln)}get uniqueIdentifier(){return this._uniqueIdentifier}iframeUrl(){return pn(this.options)}}const wn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gn="WIDGET_EVENT";function yn(h){let f="widget/";return"disclosureRequestId"in h.configProps?f+=["disclosures",h.configProps.disclosureRequestId].join("/"):f+=h.request,f}function En(h){var y;const f=(y=h.isSandbox)!=null?y:!1,g=h.developmentUrl||(f?at:it),d=Object.entries(h.configProps).filter(([E,W])=>W||E==="disclosureRequestId").map(([E,W])=>`${E}=${encodeURIComponent(W)}`).join("&"),v=yn(h);return`${g}/${v}?sdk=web&sdkVersion=${je}&${d}`}let ee=null,Le=null;function ke(h=null){ee&&!ee.closed&&ee.focus(),h==null||h.preventDefault()}function Ue(){document.body.style.filter="",document.body.removeEventListener("click",ke)}function Sn(){Le=setInterval(()=>{(!ee||ee.closed)&&(Le&&clearInterval(Le),Ue())},cn)}function xn(h){const f=En(h),g=sn,d=un,v=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,W=window.innerHeight||document.documentElement.clientHeight||window.screen.height,q=E/window.screen.availWidth,U=(E-g)/2/q+v,H=(W-d)/2/q+y;document.body.style.filter="blur(5px)",document.body.addEventListener("click",ke),ee=window.open(f,"Soyio",`scrollbars=yes,
125
125
  width=${g},
126
126
  height=${d},
127
127
  top=${H},
128
- left=${U}`),ke(),Sn()}function xn(){ee&&(ee.close(),ee=null),Ue()}let le=null;function In(){le&&(le.cancel(),le=null)}function Wn(l){return G(this,null,function*(){const{onEvent:f}=l,g=yield Promise.resolve().then(()=>He);le&&In(),le=g.on(gn,v=>G(null,[v],function*({data:d}){return f(d),on.includes(d.eventName)?xn():d.eventName===an&&Ue(),Promise.resolve()}))})}function Pn(l){Wn(l)}class st{constructor(f){$t(this,We);j(this,"onEvent");this.onEvent=f.onEvent,R&&(bn(f),Pn({onEvent:Gt(this,We,Jt).bind(this)}))}}We=new WeakSet,Jt=function(f){this.onEvent(f)};function Tn(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Fe={exports:{}},Ie={exports:{}},Cn=Ie.exports,ut;function Rn(){return ut||(ut=1,function(l,f){(function(g,d){l.exports=d()})(typeof self!="undefined"?self:Cn,function(){return function(g){var d={};function v(y){if(d[y])return d[y].exports;var E=d[y]={i:y,l:!1,exports:{}};return g[y].call(E.exports,E,E.exports,v),E.l=!0,E.exports}return v.m=g,v.c=d,v.d=function(y,E,W){v.o(y,E)||Object.defineProperty(y,E,{enumerable:!0,get:W})},v.r=function(y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},v.t=function(y,E){if(1&E&&(y=v(y)),8&E||4&E&&typeof y=="object"&&y&&y.__esModule)return y;var W=Object.create(null);if(v.r(W),Object.defineProperty(W,"default",{enumerable:!0,value:y}),2&E&&typeof y!="string")for(var q in y)v.d(W,q,function(U){return y[U]}.bind(null,q));return W},v.n=function(y){var E=y&&y.__esModule?function(){return y.default}:function(){return y};return v.d(E,"a",E),E},v.o=function(y,E){return{}.hasOwnProperty.call(y,E)},v.p="",v(v.s=0)}([function(g,d,v){v.r(d),v.d(d,"Promise",function(){return C}),v.d(d,"TYPES",function(){return Xn}),v.d(d,"ProxyWindow",function(){return Y}),v.d(d,"setup",function(){return Ht}),v.d(d,"destroy",function(){return Kn}),v.d(d,"serializeMessage",function(){return Vn}),v.d(d,"deserializeMessage",function(){return Jn}),v.d(d,"createProxyWindow",function(){return Yn}),v.d(d,"toProxyWindow",function(){return Zn}),v.d(d,"on",function(){return ue}),v.d(d,"once",function(){return Gn}),v.d(d,"send",function(){return ne}),v.d(d,"markWindowKnown",function(){return Rt}),v.d(d,"cleanUpWindow",function(){return Qn}),v.d(d,"bridge",function(){});function y(e){return{}.toString.call(e)==="[object RegExp]"}var E=`Call was rejected by callee.\r
129
- `;function W(e){return e===void 0&&(e=window),e.location.protocol}function q(e){if(e===void 0&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return W(e)}function U(e){return e===void 0&&(e=window),q(e)==="about:"}function H(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&&!H(e))try{return e.opener}catch(n){}}function te(e){try{return!0}catch(n){}return!1}function Pe(e){e===void 0&&(e=window);var n=e.location;if(!n)throw new Error("Can not read window location");var t=W(e);if(!t)throw new Error("Can not read window protocol");if(t==="file:")return"file://";if(t==="about:"){var r=H(e);return r&&te()?Pe(r):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function B(e){e===void 0&&(e=window);var n=Pe(e);return n&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:n}function oe(e){if(!function(n){try{if(n===window)return!0}catch(r){}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&t.enumerable===!1)return!1}catch(r){}try{if(U(n)&&te())return!0}catch(r){}try{if(function(r){return r===void 0&&(r=window),q(r)==="mock:"}(n)&&te())return!0}catch(r){}try{if(Pe(n)===Pe(window))return!0}catch(r){}return!1}(e))return!1;try{if(e===window||U(e)&&te()||B(window)===B(e))return!0}catch(n){}return!1}function Te(e){if(!oe(e))throw new Error("Expected window to be same domain");return e}function ft(e,n){if(!e||!n)return!1;var t=H(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 lt(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 An=[],Nn=[];function Z(e,n){n===void 0&&(n=!0);try{if(e===window)return!1}catch(o){return!0}try{if(!e)return!0}catch(o){return!0}try{if(e.closed)return!0}catch(o){return!o||o.message!==E}if(n&&oe(e))try{if(e.mockclosed)return!0}catch(o){}try{if(!e.parent||!e.top)return!0}catch(o){}var t=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch(c){}return-1}(An,e);if(t!==-1){var r=Nn[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 ht(e){return e===void 0&&(e=window),he(e=e||window)||H(e)||void 0}function ce(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 ce(t,n)}))}function Ce(e){try{if(e===window)return!0}catch(n){if(n&&n.message===E)return!0}try{if({}.toString.call(e)==="[object Window]")return!0}catch(n){if(n&&n.message===E)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.self===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.parent===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.top===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch(n){return!0}try{if("postMessage"in e&&"self"in e&&"location"in e)return!0}catch(n){}return!1}function mt(e){if(oe(e))return Te(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 Dn(e){if(function(t){return t===void 0&&(t=window),!!H(t)}(e)){var n=mt(e);if(n&&n.parentElement){n.parentElement.removeChild(n);return}}try{e.close()}catch(t){}}function ie(e){try{if(!e)return!1;if(typeof Promise!="undefined"&&e instanceof Promise)return!0;if(typeof window!="undefined"&&typeof window.Window=="function"&&e instanceof window.Window||typeof window!="undefined"&&typeof window.constructor=="function"&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var t=n.call(e);if(t==="[object Window]"||t==="[object global]"||t==="[object DOMWindow]")return!1}if(typeof e.then=="function")return!0}catch(r){return!1}return!1}var pt=[],me=[],_e=0,pe;function vt(){if(!_e&&pe){var e=pe;pe=null,e.resolve()}}function qe(){_e+=1}function ve(){_e-=1,vt()}var C=function(){function e(t){var r=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],t){var o,i,a=!1,c=!1,u=!1;qe();try{t(function(s){u?r.resolve(s):(a=!0,o=s)},function(s){u?r.reject(s):(c=!0,i=s)})}catch(s){ve(),this.reject(s);return}ve(),u=!0,a?this.resolve(o):c&&this.reject(i)}}var n=e.prototype;return n.resolve=function(t){if(this.resolved||this.rejected)return this;if(ie(t))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=t,this.dispatch(),this},n.reject=function(t){var r=this;if(this.resolved||this.rejected)return this;if(ie(t))throw new Error("Can not reject promise with another promise");if(!t){var o=t&&typeof t.toString=="function"?t.toString():{}.toString.call(t);t=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=t,this.errorHandled||setTimeout(function(){r.errorHandled||function(i,a){if(pt.indexOf(i)===-1){pt.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,qe();for(var i=function(w,x){return w.then(function(S){x.resolve(S)},function(S){x.reject(S)})},a=0;a<o.length;a++){var c=o[a],u=c.onSuccess,s=c.onError,p=c.promise,h=void 0;if(t)try{h=u?u(this.value):this.value}catch(w){p.reject(w);continue}else if(r){if(!s){p.reject(this.error);continue}try{h=s(this.error)}catch(w){p.reject(w);continue}}if(h instanceof e&&(h.resolved||h.rejected)){var m=h;m.resolved?p.resolve(m.value):p.reject(m.error),m.errorHandled=!0}else ie(h)?h instanceof e&&(h.resolved||h.rejected)?h.resolved?p.resolve(h.value):p.reject(h.error):i(h,p):p.resolve(h)}o.length=0,this.dispatching=!1,ve()}},n.then=function(t,r){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.then expected a function for success handler");if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for error handler");var o=new e;return this.handlers.push({promise:o,onSuccess:t,onError:r}),this.errorHandled=!0,this.dispatch(),o},n.catch=function(t){return this.then(void 0,t)},n.finally=function(t){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(t).then(function(){return r})},function(r){return e.try(t).then(function(){throw r})})},n.timeout=function(t,r){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(r||new Error("Promise timed out after "+t+"ms"))},t);return this.then(function(a){return clearTimeout(i),a})},n.toPromise=function(){if(typeof Promise=="undefined")throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.lazy=function(){return this.errorHandled=!0,this},e.resolve=function(t){return t instanceof e?t:ie(t)?new e(function(r,o){return t.then(r,o)}):new e().resolve(t)},e.reject=function(t){return new e().reject(t)},e.asyncReject=function(t){return new e().asyncReject(t)},e.all=function(t){var r=new e,o=t.length,i=[].slice();if(!o)return r.resolve(i),r;for(var a=function(s,p,h){return p.then(function(m){i[s]=m,(o-=1)==0&&r.resolve(i)},function(m){h.reject(m)})},c=0;c<t.length;c++){var u=t[c];if(u instanceof e){if(u.resolved){i[c]=u.value,o-=1;continue}}else if(!ie(u)){i[c]=u,o-=1;continue}a(c,e.resolve(u),r)}return o===0&&r.resolve(i),r},e.hash=function(t){var r={},o=[],i=function(c){if(t.hasOwnProperty(c)){var u=t[c];ie(u)?o.push(u.then(function(s){r[c]=s})):r[c]=u}};for(var a in t)i(a);return e.all(o).then(function(){return r})},e.map=function(t,r){return e.all(t.map(r))},e.onPossiblyUnhandledException=function(t){return function(r){return me.push(r),{cancel:function(){me.splice(me.indexOf(r),1)}}}(t)},e.try=function(t,r,o){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.try expected a function");var i;qe();try{i=t.apply(r,o||[])}catch(a){return ve(),e.reject(a)}return ve(),e.resolve(i)},e.delay=function(t){return new e(function(r){setTimeout(r,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||ie(t)},e.flush=function(){return function(t){var r=pe=pe||new t;return vt(),r}(e)},e}();function Re(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(r){}return-1}var Be=function(){function e(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if(typeof WeakMap=="undefined"||Object.freeze===void 0)return!1;try{var t=new WeakMap,r={};return Object.freeze(r),t.set(r,"__testvalue__"),t.get(r)==="__testvalue__"}catch(o){return!1}}())try{this.weakmap=new WeakMap}catch(t){}this.keys=[],this.values=[]}var n=e.prototype;return n._cleanupClosedWindows=function(){for(var t=this.weakmap,r=this.keys,o=0;o<r.length;o++){var i=r[o];if(Ce(i)&&Z(i)){if(t)try{t.delete(i)}catch(a){}r.splice(o,1),this.values.splice(o,1),o-=1}}},n.isSafeToReadWrite=function(t){return!Ce(t)},n.set=function(t,r){if(!t)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(t,r)}catch(p){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(p){}this._cleanupClosedWindows();var c=this.keys,u=this.values,s=Re(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=Re(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=Re(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(),Re(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 wt(e){return e.name||e.__name__||e.displayName||"anonymous"}function gt(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 Oe;function yt(e){try{return JSON.stringify([].slice.call(e),function(n,t){return typeof t=="function"?"memoize["+function(r){if(Oe=Oe||new Be,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=Oe.get(r);return o||(o=typeof r+":"+X(),Oe.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 jn(){return{}}var we=0,Et=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,p=new Array(s),h=0;h<s;h++)p[h]=arguments[h];c<Et&&(i=null,a=null,c=we,we+=1);var m;m=r?(a=a||new Be).getOrSet(this,jn):i=i||{};var w;try{w=yt(p)}catch(O){return e.apply(this,arguments)}var x=m[w];if(x&&o&&Date.now()-x.time<o&&(delete m[w],x=null),x)return x.value;var S=Date.now(),b=e.apply(this,arguments);return m[w]={time:S,value:b},b};return u.reset=function(){i=null,a=null},gt(u,(n.name||wt(e))+"::memoized")}ge.clear=function(){Et=we};function Mn(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=yt(a);return n.hasOwnProperty(u)||(n[u]=C.try(function(){return e.apply(o,r)}).finally(function(){delete n[u]})),n[u]}return t.reset=function(){n={}},gt(t,wt(e)+"::promiseMemoized")}function ae(){}function ye(e,n){if(n===void 0&&(n=1),n>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+{}.toString.call(e)+">";if(typeof e=="string")return e;if(e instanceof Error){var t=e&&e.stack,r=e&&e.message;if(t&&r)return t.indexOf(r)!==-1?t:r+`
130
- `+t;if(t)return t;if(r)return r}return e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}catch(o){return"Error while stringifying error: "+ye(o,n+1)}}function St(e){return typeof e=="string"?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 bt(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function xt(){return!!document.body&&document.readyState==="complete"}function It(){return!!document.body&&document.readyState==="interactive"}ge(function(){return new C(function(e){if(xt()||It())return e();var n=setInterval(function(){if(xt()||It())return clearInterval(n),e()},10)})});var Ae=typeof document!="undefined"?document.currentScript:null,zn=ge(function(){if(Ae||(Ae=function(){try{var e=function(){try{throw new Error("_")}catch(a){return a.stack||""}}(),n=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e),t=n&&n[1];if(!t)return;for(var r=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();r<o.length;r++){var i=o[r];if(i.src&&i.src===t)return i}}catch(a){}}()))return Ae;throw new Error("Can not determine current script")}),Ln=X();ge(function(){var e;try{e=zn()}catch(r){return Ln}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 Se(e){e===void 0&&(e=window);var n="__post_robot_10_0_46__";return e!==window?e[n]:e[n]=e[n]||{}}var Wt=function(){return{}};function L(e,n){return e===void 0&&(e="store"),n===void 0&&(n=Wt),Ee(Se(),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 kn=function(){};function Ne(){var e=Se();return e.WINDOW_WILDCARD=e.WINDOW_WILDCARD||new kn,e.WINDOW_WILDCARD}function $(e,n){return e===void 0&&(e="store"),n===void 0&&(n=Wt),L("windowStore").getOrSet(e,function(){var t=new Be,r=function(o){return t.getOrSet(o,n)};return{has:function(o){return r(o).hasOwnProperty(e)},get:function(o,i){var a=r(o);return a.hasOwnProperty(e)?a[e]:i},set:function(o,i){return r(o)[e]=i,i},del:function(o){delete r(o)[e]},getOrSet:function(o,i){return Ee(r(o),e,i)}}})}function Pt(){return L("instance").getOrSet("instanceID",X)}function Tt(e,n){var t=n.domain,r=$("helloPromises"),o=r.get(e);o&&o.resolve({domain:t});var i=C.resolve({domain:t});return r.set(e,i),i}function Ge(e,n){return(0,n.send)(e,"postrobot_hello",{instanceID:Pt()},{domain:"*",timeout:-1}).then(function(t){var r=t.origin,o=t.data.instanceID;return Tt(e,{domain:r}),{win:e,domain:r,instanceID:o}})}function Ct(e,n){var t=n.send;return $("windowInstanceIDPromises").getOrSet(e,function(){return Ge(e,{send:t}).then(function(r){return r.instanceID})})}function Rt(e){$("knownWindows").set(e,!0)}function Ve(e){return typeof e=="object"&&e!==null&&typeof e.__type__=="string"}function Ot(e){return e===void 0?"undefined":e===null?"null":Array.isArray(e)?"array":typeof e=="function"?"function":typeof e=="object"?e instanceof Error?"error":typeof e.then=="function"?"promise":{}.toString.call(e)==="[object RegExp]"?"regex":{}.toString.call(e)==="[object Date]"?"date":"object":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":void 0}function se(e,n){return{__type__:e,__val__:n}}var V,Un=((V={}).function=function(){},V.error=function(e){return se("error",{message:e.message,stack:e.stack,code:e.code,data:e.data})},V.promise=function(){},V.regex=function(e){return se("regex",e.source)},V.date=function(e){return se("date",e.toJSON())},V.array=function(e){return e},V.object=function(e){return e},V.string=function(e){return e},V.number=function(e){return e},V.boolean=function(e){return e},V.null=function(e){return e},V[void 0]=function(e){return se("undefined",e)},V),Fn={},J,Hn=((J={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},J.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+`
128
+ left=${U}`),ke(),Sn()}function bn(){ee&&(ee.close(),ee=null),Ue()}let le=null;function In(){le&&(le.cancel(),le=null)}function Wn(h){return G(this,null,function*(){const{onEvent:f}=h,g=yield Promise.resolve().then(()=>He);le&&In(),le=g.on(gn,v=>G(null,[v],function*({data:d}){return f(d),on.includes(d.eventName)?bn():d.eventName===an&&Ue(),Promise.resolve()}))})}function Pn(h){Wn(h)}class st{constructor(f){$t(this,We);M(this,"onEvent");this.onEvent=f.onEvent,R&&(xn(f),Pn({onEvent:Gt(this,We,Jt).bind(this)}))}}We=new WeakSet,Jt=function(f){this.onEvent(f)};function Cn(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var Fe={exports:{}},Ie={exports:{}},Tn=Ie.exports,ut;function Rn(){return ut||(ut=1,function(h,f){(function(g,d){h.exports=d()})(typeof self!="undefined"?self:Tn,function(){return function(g){var d={};function v(y){if(d[y])return d[y].exports;var E=d[y]={i:y,l:!1,exports:{}};return g[y].call(E.exports,E,E.exports,v),E.l=!0,E.exports}return v.m=g,v.c=d,v.d=function(y,E,W){v.o(y,E)||Object.defineProperty(y,E,{enumerable:!0,get:W})},v.r=function(y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},v.t=function(y,E){if(1&E&&(y=v(y)),8&E||4&E&&typeof y=="object"&&y&&y.__esModule)return y;var W=Object.create(null);if(v.r(W),Object.defineProperty(W,"default",{enumerable:!0,value:y}),2&E&&typeof y!="string")for(var q in y)v.d(W,q,function(U){return y[U]}.bind(null,q));return W},v.n=function(y){var E=y&&y.__esModule?function(){return y.default}:function(){return y};return v.d(E,"a",E),E},v.o=function(y,E){return{}.hasOwnProperty.call(y,E)},v.p="",v(v.s=0)}([function(g,d,v){v.r(d),v.d(d,"Promise",function(){return T}),v.d(d,"TYPES",function(){return Xn}),v.d(d,"ProxyWindow",function(){return Y}),v.d(d,"setup",function(){return Ht}),v.d(d,"destroy",function(){return Kn}),v.d(d,"serializeMessage",function(){return Vn}),v.d(d,"deserializeMessage",function(){return Jn}),v.d(d,"createProxyWindow",function(){return Yn}),v.d(d,"toProxyWindow",function(){return Zn}),v.d(d,"on",function(){return ue}),v.d(d,"once",function(){return Gn}),v.d(d,"send",function(){return ne}),v.d(d,"markWindowKnown",function(){return Rt}),v.d(d,"cleanUpWindow",function(){return Qn}),v.d(d,"bridge",function(){});function y(e){return{}.toString.call(e)==="[object RegExp]"}var E=`Call was rejected by callee.\r
129
+ `;function W(e){return e===void 0&&(e=window),e.location.protocol}function q(e){if(e===void 0&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return W(e)}function U(e){return e===void 0&&(e=window),q(e)==="about:"}function H(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&&!H(e))try{return e.opener}catch(n){}}function te(e){try{return!0}catch(n){}return!1}function Pe(e){e===void 0&&(e=window);var n=e.location;if(!n)throw new Error("Can not read window location");var t=W(e);if(!t)throw new Error("Can not read window protocol");if(t==="file:")return"file://";if(t==="about:"){var r=H(e);return r&&te()?Pe(r):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function B(e){e===void 0&&(e=window);var n=Pe(e);return n&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:n}function oe(e){if(!function(n){try{if(n===window)return!0}catch(r){}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&t.enumerable===!1)return!1}catch(r){}try{if(U(n)&&te())return!0}catch(r){}try{if(function(r){return r===void 0&&(r=window),q(r)==="mock:"}(n)&&te())return!0}catch(r){}try{if(Pe(n)===Pe(window))return!0}catch(r){}return!1}(e))return!1;try{if(e===window||U(e)&&te()||B(window)===B(e))return!0}catch(n){}return!1}function Ce(e){if(!oe(e))throw new Error("Expected window to be same domain");return e}function ft(e,n){if(!e||!n)return!1;var t=H(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 lt(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 An=[],Nn=[];function Z(e,n){n===void 0&&(n=!0);try{if(e===window)return!1}catch(o){return!0}try{if(!e)return!0}catch(o){return!0}try{if(e.closed)return!0}catch(o){return!o||o.message!==E}if(n&&oe(e))try{if(e.mockclosed)return!0}catch(o){}try{if(!e.parent||!e.top)return!0}catch(o){}var t=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch(c){}return-1}(An,e);if(t!==-1){var r=Nn[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 ht(e){return e===void 0&&(e=window),he(e=e||window)||H(e)||void 0}function ce(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 ce(t,n)}))}function Te(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 mt(e){if(oe(e))return Ce(e).frameElement;for(var n=0,t=document.querySelectorAll("iframe");n<t.length;n++){var r=t[n];if(r&&r.contentWindow&&r.contentWindow===e)return r}}function Dn(e){if(function(t){return t===void 0&&(t=window),!!H(t)}(e)){var n=mt(e);if(n&&n.parentElement){n.parentElement.removeChild(n);return}}try{e.close()}catch(t){}}function ie(e){try{if(!e)return!1;if(typeof Promise!="undefined"&&e instanceof Promise)return!0;if(typeof window!="undefined"&&typeof window.Window=="function"&&e instanceof window.Window||typeof window!="undefined"&&typeof window.constructor=="function"&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var t=n.call(e);if(t==="[object Window]"||t==="[object global]"||t==="[object DOMWindow]")return!1}if(typeof e.then=="function")return!0}catch(r){return!1}return!1}var pt=[],me=[],_e=0,pe;function vt(){if(!_e&&pe){var e=pe;pe=null,e.resolve()}}function qe(){_e+=1}function ve(){_e-=1,vt()}var T=function(){function e(t){var r=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],t){var o,i,a=!1,c=!1,u=!1;qe();try{t(function(s){u?r.resolve(s):(a=!0,o=s)},function(s){u?r.reject(s):(c=!0,i=s)})}catch(s){ve(),this.reject(s);return}ve(),u=!0,a?this.resolve(o):c&&this.reject(i)}}var n=e.prototype;return n.resolve=function(t){if(this.resolved||this.rejected)return this;if(ie(t))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=t,this.dispatch(),this},n.reject=function(t){var r=this;if(this.resolved||this.rejected)return this;if(ie(t))throw new Error("Can not reject promise with another promise");if(!t){var o=t&&typeof t.toString=="function"?t.toString():{}.toString.call(t);t=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=t,this.errorHandled||setTimeout(function(){r.errorHandled||function(i,a){if(pt.indexOf(i)===-1){pt.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,qe();for(var i=function(w,b){return w.then(function(S){b.resolve(S)},function(S){b.reject(S)})},a=0;a<o.length;a++){var c=o[a],u=c.onSuccess,s=c.onError,p=c.promise,l=void 0;if(t)try{l=u?u(this.value):this.value}catch(w){p.reject(w);continue}else if(r){if(!s){p.reject(this.error);continue}try{l=s(this.error)}catch(w){p.reject(w);continue}}if(l instanceof e&&(l.resolved||l.rejected)){var m=l;m.resolved?p.resolve(m.value):p.reject(m.error),m.errorHandled=!0}else ie(l)?l instanceof e&&(l.resolved||l.rejected)?l.resolved?p.resolve(l.value):p.reject(l.error):i(l,p):p.resolve(l)}o.length=0,this.dispatching=!1,ve()}},n.then=function(t,r){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.then expected a function for success handler");if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for error handler");var o=new e;return this.handlers.push({promise:o,onSuccess:t,onError:r}),this.errorHandled=!0,this.dispatch(),o},n.catch=function(t){return this.then(void 0,t)},n.finally=function(t){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(t).then(function(){return r})},function(r){return e.try(t).then(function(){throw r})})},n.timeout=function(t,r){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(r||new Error("Promise timed out after "+t+"ms"))},t);return this.then(function(a){return clearTimeout(i),a})},n.toPromise=function(){if(typeof Promise=="undefined")throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.lazy=function(){return this.errorHandled=!0,this},e.resolve=function(t){return t instanceof e?t:ie(t)?new e(function(r,o){return t.then(r,o)}):new e().resolve(t)},e.reject=function(t){return new e().reject(t)},e.asyncReject=function(t){return new e().asyncReject(t)},e.all=function(t){var r=new e,o=t.length,i=[].slice();if(!o)return r.resolve(i),r;for(var a=function(s,p,l){return p.then(function(m){i[s]=m,(o-=1)==0&&r.resolve(i)},function(m){l.reject(m)})},c=0;c<t.length;c++){var u=t[c];if(u instanceof e){if(u.resolved){i[c]=u.value,o-=1;continue}}else if(!ie(u)){i[c]=u,o-=1;continue}a(c,e.resolve(u),r)}return o===0&&r.resolve(i),r},e.hash=function(t){var r={},o=[],i=function(c){if(t.hasOwnProperty(c)){var u=t[c];ie(u)?o.push(u.then(function(s){r[c]=s})):r[c]=u}};for(var a in t)i(a);return e.all(o).then(function(){return r})},e.map=function(t,r){return e.all(t.map(r))},e.onPossiblyUnhandledException=function(t){return function(r){return me.push(r),{cancel:function(){me.splice(me.indexOf(r),1)}}}(t)},e.try=function(t,r,o){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.try expected a function");var i;qe();try{i=t.apply(r,o||[])}catch(a){return ve(),e.reject(a)}return ve(),e.resolve(i)},e.delay=function(t){return new e(function(r){setTimeout(r,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||ie(t)},e.flush=function(){return function(t){var r=pe=pe||new t;return vt(),r}(e)},e}();function Re(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(r){}return-1}var Be=function(){function e(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if(typeof WeakMap=="undefined"||Object.freeze===void 0)return!1;try{var t=new WeakMap,r={};return Object.freeze(r),t.set(r,"__testvalue__"),t.get(r)==="__testvalue__"}catch(o){return!1}}())try{this.weakmap=new WeakMap}catch(t){}this.keys=[],this.values=[]}var n=e.prototype;return n._cleanupClosedWindows=function(){for(var t=this.weakmap,r=this.keys,o=0;o<r.length;o++){var i=r[o];if(Te(i)&&Z(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!Te(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(p){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(p){}this._cleanupClosedWindows();var c=this.keys,u=this.values,s=Re(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=Re(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=Re(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(),Re(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 wt(e){return e.name||e.__name__||e.displayName||"anonymous"}function gt(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 Oe;function yt(e){try{return JSON.stringify([].slice.call(e),function(n,t){return typeof t=="function"?"memoize["+function(r){if(Oe=Oe||new Be,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=Oe.get(r);return o||(o=typeof r+":"+X(),Oe.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 Mn(){return{}}var we=0,Et=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,p=new Array(s),l=0;l<s;l++)p[l]=arguments[l];c<Et&&(i=null,a=null,c=we,we+=1);var m;m=r?(a=a||new Be).getOrSet(this,Mn):i=i||{};var w;try{w=yt(p)}catch(O){return e.apply(this,arguments)}var b=m[w];if(b&&o&&Date.now()-b.time<o&&(delete m[w],b=null),b)return b.value;var S=Date.now(),x=e.apply(this,arguments);return m[w]={time:S,value:x},x};return u.reset=function(){i=null,a=null},gt(u,(n.name||wt(e))+"::memoized")}ge.clear=function(){Et=we};function jn(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=yt(a);return n.hasOwnProperty(u)||(n[u]=T.try(function(){return e.apply(o,r)}).finally(function(){delete n[u]})),n[u]}return t.reset=function(){n={}},gt(t,wt(e)+"::promiseMemoized")}function ae(){}function ye(e,n){if(n===void 0&&(n=1),n>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+{}.toString.call(e)+">";if(typeof e=="string")return e;if(e instanceof Error){var t=e&&e.stack,r=e&&e.message;if(t&&r)return t.indexOf(r)!==-1?t:r+`
130
+ `+t;if(t)return t;if(r)return r}return e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}catch(o){return"Error while stringifying error: "+ye(o,n+1)}}function St(e){return typeof e=="string"?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 xt(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function bt(){return!!document.body&&document.readyState==="complete"}function It(){return!!document.body&&document.readyState==="interactive"}ge(function(){return new T(function(e){if(bt()||It())return e();var n=setInterval(function(){if(bt()||It())return clearInterval(n),e()},10)})});var Ae=typeof document!="undefined"?document.currentScript:null,zn=ge(function(){if(Ae||(Ae=function(){try{var e=function(){try{throw new Error("_")}catch(a){return a.stack||""}}(),n=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e),t=n&&n[1];if(!t)return;for(var r=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();r<o.length;r++){var i=o[r];if(i.src&&i.src===t)return i}}catch(a){}}()))return Ae;throw new Error("Can not determine current script")}),Ln=X();ge(function(){var e;try{e=zn()}catch(r){return Ln}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 Se(e){e===void 0&&(e=window);var n="__post_robot_10_0_46__";return e!==window?e[n]:e[n]=e[n]||{}}var Wt=function(){return{}};function L(e,n){return e===void 0&&(e="store"),n===void 0&&(n=Wt),Ee(Se(),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 kn=function(){};function Ne(){var e=Se();return e.WINDOW_WILDCARD=e.WINDOW_WILDCARD||new kn,e.WINDOW_WILDCARD}function $(e,n){return e===void 0&&(e="store"),n===void 0&&(n=Wt),L("windowStore").getOrSet(e,function(){var t=new Be,r=function(o){return t.getOrSet(o,n)};return{has:function(o){return r(o).hasOwnProperty(e)},get:function(o,i){var a=r(o);return a.hasOwnProperty(e)?a[e]:i},set:function(o,i){return r(o)[e]=i,i},del:function(o){delete r(o)[e]},getOrSet:function(o,i){return Ee(r(o),e,i)}}})}function Pt(){return L("instance").getOrSet("instanceID",X)}function Ct(e,n){var t=n.domain,r=$("helloPromises"),o=r.get(e);o&&o.resolve({domain:t});var i=T.resolve({domain:t});return r.set(e,i),i}function Ge(e,n){return(0,n.send)(e,"postrobot_hello",{instanceID:Pt()},{domain:"*",timeout:-1}).then(function(t){var r=t.origin,o=t.data.instanceID;return Ct(e,{domain:r}),{win:e,domain:r,instanceID:o}})}function Tt(e,n){var t=n.send;return $("windowInstanceIDPromises").getOrSet(e,function(){return Ge(e,{send:t}).then(function(r){return r.instanceID})})}function Rt(e){$("knownWindows").set(e,!0)}function Ve(e){return typeof e=="object"&&e!==null&&typeof e.__type__=="string"}function Ot(e){return e===void 0?"undefined":e===null?"null":Array.isArray(e)?"array":typeof e=="function"?"function":typeof e=="object"?e instanceof Error?"error":typeof e.then=="function"?"promise":{}.toString.call(e)==="[object RegExp]"?"regex":{}.toString.call(e)==="[object Date]"?"date":"object":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":void 0}function se(e,n){return{__type__:e,__val__:n}}var V,Un=((V={}).function=function(){},V.error=function(e){return se("error",{message:e.message,stack:e.stack,code:e.code,data:e.data})},V.promise=function(){},V.regex=function(e){return se("regex",e.source)},V.date=function(e){return se("date",e.toJSON())},V.array=function(e){return e},V.object=function(e){return e},V.string=function(e){return e},V.number=function(e){return e},V.boolean=function(e){return e},V.null=function(e){return e},V[void 0]=function(e){return se("undefined",e)},V),Fn={},J,Hn=((J={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},J.error=function(e){var n=e.stack,t=e.code,r=e.data,o=new Error(e.message);return o.code=t,r&&(o.data=r),o.stack=n+`
131
131
 
132
- `+o.stack,o},J.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},J.regex=function(e){return new RegExp(e)},J.date=function(e){return new Date(e)},J.array=function(e){return e},J.object=function(e){return e},J.string=function(e){return e},J.number=function(e){return e},J.boolean=function(e){return e},J.null=function(e){return e},J[void 0]=function(){},J),_n={};new C(function(e){if(window.document&&window.document.body)return e(window.document.body);var n=setInterval(function(){if(window.document&&window.document.body)return clearInterval(n),e(window.document.body)},10)});function Je(){for(var e=L("idToProxyWindow"),n=0,t=e.keys();n<t.length;n++){var r=t[n];e.get(r).shouldClean()&&e.del(r)}}function At(e,n){var t=n.send,r=n.id,o=r===void 0?X():r,i=e.then(function(u){if(oe(u))return Te(u).name}),a=e.then(function(u){if(Z(u))throw new Error("Window is closed, can not determine type");return he(u)?"popup":"iframe"});i.catch(ae),a.catch(ae);var c=function(){return e.then(function(u){if(!Z(u))return oe(u)?Te(u).name:i})};return{id:o,getType:function(){return a},getInstanceID:Mn(function(){return e.then(function(u){return Ct(u,{send:t})})}),close:function(){return e.then(Dn)},getName:c,focus:function(){return e.then(function(u){u.focus()})},isClosed:function(){return e.then(function(u){return Z(u)})},setLocation:function(u,s){return s===void 0&&(s={}),e.then(function(p){var h=window.location.protocol+"//"+window.location.host,m=s.method,w=m===void 0?"get":m,x=s.body;if(u.indexOf("/")===0)u=""+h+u;else if(!u.match(/^https?:\/\//)&&u.indexOf(h)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(u));if(w==="post")return c().then(function(S){if(!S)throw new Error("Can not post to window without target name");(function(b){var O=b.url,z=b.target,N=b.body,A=b.method,k=A===void 0?"post":A,P=document.createElement("form");if(P.setAttribute("target",z),P.setAttribute("method",k),P.setAttribute("action",O),P.style.display="none",N)for(var D=0,K=Object.keys(N);D<K.length;D++){var M,be=K[D],Xe=document.createElement("input");Xe.setAttribute("name",be),Xe.setAttribute("value",(M=N[be])==null?void 0:M.toString()),P.appendChild(Xe)}bt().appendChild(P),P.submit(),bt().removeChild(P)})({url:u,target:S,method:w,body:x})});if(w!=="get")throw new Error("Unsupported method: "+w);if(oe(p))try{if(p.location&&typeof p.location.replace=="function"){p.location.replace(u);return}}catch(S){}p.location=u})},setName:function(u){return e.then(function(s){var p=oe(s),h=mt(s);if(!p)throw new Error("Can not set name for cross-domain window: "+u);Te(s).name=u,h&&h.setAttribute("name",u),i=C.resolve(u)})}}}var Y=function(){function e(t){var r=t.send,o=t.win,i=t.serializedWindow;this.id=void 0,this.isProxyWindow=!0,this.serializedWindow=void 0,this.actualWindow=void 0,this.actualWindowPromise=void 0,this.send=void 0,this.name=void 0,this.actualWindowPromise=new C,this.serializedWindow=i||At(this.actualWindowPromise,{send:r}),L("idToProxyWindow").set(this.getID(),this),o&&this.setWindow(o,{send:r})}var n=e.prototype;return n.getID=function(){return this.serializedWindow.id},n.getType=function(){return this.serializedWindow.getType()},n.isPopup=function(){return this.getType().then(function(t){return t==="popup"})},n.setLocation=function(t,r){var o=this;return this.serializedWindow.setLocation(t,r).then(function(){return o})},n.getName=function(){return this.serializedWindow.getName()},n.setName=function(t){var r=this;return this.serializedWindow.setName(t).then(function(){return r})},n.close=function(){var t=this;return this.serializedWindow.close().then(function(){return t})},n.focus=function(){var t=this,r=this.isPopup(),o=this.getName(),i=C.hash({isPopup:r,name:o}).then(function(c){var u=c.name;c.isPopup&&u&&window.open("",u,"noopener")}),a=this.serializedWindow.focus();return C.all([i,a]).then(function(){return t})},n.isClosed=function(){return this.serializedWindow.isClosed()},n.getWindow=function(){return this.actualWindow},n.setWindow=function(t,r){var o=r.send;this.actualWindow=t,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=At(this.actualWindowPromise,{send:o,id:this.getID()}),$("winToProxyWindow").set(t,this)},n.awaitWindow=function(){return this.actualWindowPromise},n.matchWindow=function(t,r){var o=this,i=r.send;return C.try(function(){return o.actualWindow?t===o.actualWindow:C.hash({proxyInstanceID:o.getInstanceID(),knownWindowInstanceID:Ct(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&&Z(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 Je(),e.toProxyWindow(t,{send:o}).serialize()},e.deserialize=function(t,r){var o=r.send;return Je(),L("idToProxyWindow").get(t.id)||new e({serializedWindow:t,send:o})},e.isProxyWindow=function(t){return!!(t&&!Ce(t)&&t.isProxyWindow)},e.toProxyWindow=function(t,r){var o=r.send;if(Je(),e.isProxyWindow(t))return t;var i=t;return $("winToProxyWindow").get(i)||new e({win:i,send:o})},e}();function Ye(e,n,t,r,o){var i=$("methodStore"),a=L("proxyWindowMethods");Y.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 Nt(e,n){var t=$("methodStore"),r=L("proxyWindowMethods");return t.getOrSet(e,function(){return{}})[n]||r.get(n)}function Dt(e,n,t,r,o){a=(i={on:o.on,send:o.send}).on,c=i.send,L("builtinListeners").getOrSet("functionCalls",function(){return a("postrobot_method",{domain:"*"},function(p){var h=p.source,m=p.origin,w=p.data,x=w.id,S=w.name,b=Nt(h,x);if(!b)throw new Error("Could not find method '"+S+"' with id: "+w.id+" in "+B(window));var O=b.source,z=b.domain,N=b.val;return C.try(function(){if(!ce(z,m))throw new Error("Method '"+w.name+"' domain "+JSON.stringify($e(b.domain)?b.domain.source:b.domain)+" does not match origin "+m+" in "+B(window));if(Y.isProxyWindow(O))return O.matchWindow(h,{send:c}).then(function(A){if(!A)throw new Error("Method call '"+w.name+"' failed - proxy window does not match source in "+B(window))})}).then(function(){return N.apply({source:h,origin:m},w.args)},function(A){return C.try(function(){if(N.onError)return N.onError(A)}).then(function(){throw A.stack&&(A.stack="Remote call to "+S+"("+function(k){return k===void 0&&(k=[]),(P=k,[].slice.call(P)).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 P}(w.args)+`) failed
132
+ `+o.stack,o},J.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},J.regex=function(e){return new RegExp(e)},J.date=function(e){return new Date(e)},J.array=function(e){return e},J.object=function(e){return e},J.string=function(e){return e},J.number=function(e){return e},J.boolean=function(e){return e},J.null=function(e){return e},J[void 0]=function(){},J),_n={};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 Je(){for(var e=L("idToProxyWindow"),n=0,t=e.keys();n<t.length;n++){var r=t[n];e.get(r).shouldClean()&&e.del(r)}}function At(e,n){var t=n.send,r=n.id,o=r===void 0?X():r,i=e.then(function(u){if(oe(u))return Ce(u).name}),a=e.then(function(u){if(Z(u))throw new Error("Window is closed, can not determine type");return he(u)?"popup":"iframe"});i.catch(ae),a.catch(ae);var c=function(){return e.then(function(u){if(!Z(u))return oe(u)?Ce(u).name:i})};return{id:o,getType:function(){return a},getInstanceID:jn(function(){return e.then(function(u){return Tt(u,{send:t})})}),close:function(){return e.then(Dn)},getName:c,focus:function(){return e.then(function(u){u.focus()})},isClosed:function(){return e.then(function(u){return Z(u)})},setLocation:function(u,s){return s===void 0&&(s={}),e.then(function(p){var l=window.location.protocol+"//"+window.location.host,m=s.method,w=m===void 0?"get":m,b=s.body;if(u.indexOf("/")===0)u=""+l+u;else if(!u.match(/^https?:\/\//)&&u.indexOf(l)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(u));if(w==="post")return c().then(function(S){if(!S)throw new Error("Can not post to window without target name");(function(x){var O=x.url,z=x.target,N=x.body,A=x.method,k=A===void 0?"post":A,P=document.createElement("form");if(P.setAttribute("target",z),P.setAttribute("method",k),P.setAttribute("action",O),P.style.display="none",N)for(var D=0,K=Object.keys(N);D<K.length;D++){var j,xe=K[D],Xe=document.createElement("input");Xe.setAttribute("name",xe),Xe.setAttribute("value",(j=N[xe])==null?void 0:j.toString()),P.appendChild(Xe)}xt().appendChild(P),P.submit(),xt().removeChild(P)})({url:u,target:S,method:w,body:b})});if(w!=="get")throw new Error("Unsupported method: "+w);if(oe(p))try{if(p.location&&typeof p.location.replace=="function"){p.location.replace(u);return}}catch(S){}p.location=u})},setName:function(u){return e.then(function(s){var p=oe(s),l=mt(s);if(!p)throw new Error("Can not set name for cross-domain window: "+u);Ce(s).name=u,l&&l.setAttribute("name",u),i=T.resolve(u)})}}}var Y=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||At(this.actualWindowPromise,{send:r}),L("idToProxyWindow").set(this.getID(),this),o&&this.setWindow(o,{send:r})}var n=e.prototype;return n.getID=function(){return this.serializedWindow.id},n.getType=function(){return this.serializedWindow.getType()},n.isPopup=function(){return this.getType().then(function(t){return t==="popup"})},n.setLocation=function(t,r){var o=this;return this.serializedWindow.setLocation(t,r).then(function(){return o})},n.getName=function(){return this.serializedWindow.getName()},n.setName=function(t){var r=this;return this.serializedWindow.setName(t).then(function(){return r})},n.close=function(){var t=this;return this.serializedWindow.close().then(function(){return t})},n.focus=function(){var t=this,r=this.isPopup(),o=this.getName(),i=T.hash({isPopup:r,name:o}).then(function(c){var u=c.name;c.isPopup&&u&&window.open("",u,"noopener")}),a=this.serializedWindow.focus();return T.all([i,a]).then(function(){return t})},n.isClosed=function(){return this.serializedWindow.isClosed()},n.getWindow=function(){return this.actualWindow},n.setWindow=function(t,r){var o=r.send;this.actualWindow=t,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=At(this.actualWindowPromise,{send:o,id:this.getID()}),$("winToProxyWindow").set(t,this)},n.awaitWindow=function(){return this.actualWindowPromise},n.matchWindow=function(t,r){var o=this,i=r.send;return T.try(function(){return o.actualWindow?t===o.actualWindow:T.hash({proxyInstanceID:o.getInstanceID(),knownWindowInstanceID:Tt(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&&Z(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 Je(),e.toProxyWindow(t,{send:o}).serialize()},e.deserialize=function(t,r){var o=r.send;return Je(),L("idToProxyWindow").get(t.id)||new e({serializedWindow:t,send:o})},e.isProxyWindow=function(t){return!!(t&&!Te(t)&&t.isProxyWindow)},e.toProxyWindow=function(t,r){var o=r.send;if(Je(),e.isProxyWindow(t))return t;var i=t;return $("winToProxyWindow").get(i)||new e({win:i,send:o})},e}();function Ye(e,n,t,r,o){var i=$("methodStore"),a=L("proxyWindowMethods");Y.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 Nt(e,n){var t=$("methodStore"),r=L("proxyWindowMethods");return t.getOrSet(e,function(){return{}})[n]||r.get(n)}function Dt(e,n,t,r,o){a=(i={on:o.on,send:o.send}).on,c=i.send,L("builtinListeners").getOrSet("functionCalls",function(){return a("postrobot_method",{domain:"*"},function(p){var l=p.source,m=p.origin,w=p.data,b=w.id,S=w.name,x=Nt(l,b);if(!x)throw new Error("Could not find method '"+S+"' with id: "+w.id+" in "+B(window));var O=x.source,z=x.domain,N=x.val;return T.try(function(){if(!ce(z,m))throw new Error("Method '"+w.name+"' domain "+JSON.stringify($e(x.domain)?x.domain.source:x.domain)+" does not match origin "+m+" in "+B(window));if(Y.isProxyWindow(O))return O.matchWindow(l,{send:c}).then(function(A){if(!A)throw new Error("Method call '"+w.name+"' failed - proxy window does not match source in "+B(window))})}).then(function(){return N.apply({source:l,origin:m},w.args)},function(A){return T.try(function(){if(N.onError)return N.onError(A)}).then(function(){throw A.stack&&(A.stack="Remote call to "+S+"("+function(k){return k===void 0&&(k=[]),(P=k,[].slice.call(P)).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 P}(w.args)+`) failed
133
133
 
134
- `+A.stack),A})}).then(function(A){return{result:A,id:x,name:S}})})});var i,a,c,u=t.__id__||X();e=Y.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+"::")),Y.isProxyWindow(e)?(Ye(u,t,s,e,n),e.awaitWindow().then(function(p){Ye(u,t,s,p,n)})):Ye(u,t,s,e,n),se("cross_domain_function",{id:u,name:s})}function jt(e,n,t,r){var o,i=r.on,a=r.send;return function(c,u){u===void 0&&(u=Fn);var s=JSON.stringify(c,function(p){var h=this[p];if(Ve(this))return h;var m=Ot(h);if(!m)return h;var w=u[m]||Un[m];return w?w(h,p):h});return s===void 0?"undefined":s}(t,((o={}).promise=function(c,u){return function(s,p,h,m,w){return se("cross_domain_zalgo_promise",{then:Dt(s,p,function(x,S){return h.then(x,S)},m,{on:w.on,send:w.send})})}(e,n,c,u,{on:i,send:a})},o.function=function(c,u){return Dt(e,n,c,u,{on:i,send:a})},o.object=function(c){return Ce(c)||Y.isProxyWindow(c)?se("cross_domain_window",Y.serialize(c,{send:a})):c},o))}function Mt(e,n,t,r){var o,i=r.send;return function(a,c){if(c===void 0&&(c=_n),a!=="undefined")return JSON.parse(a,function(u,s){if(Ve(this))return s;var p,h;if(Ve(s)?(p=s.__type__,h=s.__val__):(p=Ot(s),h=s),!p)return h;var m=c[p]||Hn[p];return m?m(h,u):h})}(t,((o={}).cross_domain_zalgo_promise=function(a){return function(c,u,s){return new C(s.then)}(0,0,a)},o.cross_domain_function=function(a){return function(c,u,s,p){var h=s.id,m=s.name,w=p.send,x=function(b){b===void 0&&(b={});function O(){var z=arguments;return Y.toProxyWindow(c,{send:w}).awaitWindow().then(function(N){var A=Nt(N,h);if(A&&A.val!==O)return A.val.apply({source:window,origin:B()},z);var k=[].slice.call(z);return b.fireAndForget?w(N,"postrobot_method",{id:h,name:m,args:k},{domain:u,fireAndForget:!0}):w(N,"postrobot_method",{id:h,name:m,args:k},{domain:u,fireAndForget:!1}).then(function(P){return P.data.result})}).catch(function(N){throw N})}return O.__name__=m,O.__origin__=u,O.__source__=c,O.__id__=h,O.origin=u,O},S=x();return S.fireAndForget=x({fireAndForget:!0}),S}(e,n,a,{send:i})},o.cross_domain_window=function(a){return Y.deserialize(a,{send:i})},o))}var Ze={};Ze.postrobot_post_message=function(e,n,t){t.indexOf("file:")===0&&(t="*"),e.postMessage(n,t)};function Ke(e,n,t,r){var o=r.on,i=r.send;return C.try(function(){var a=$().getOrSet(e,function(){return{}});return a.buffer=a.buffer||[],a.buffer.push(t),a.flush=a.flush||C.flush().then(function(){if(Z(e))throw new Error("Window is closed");var c=jt(e,n,((u={}).__post_robot_10_0_46__=a.buffer||[],u),{on:o,send:i}),u;delete a.buffer;for(var s=Object.keys(Ze),p=[],h=0;h<s.length;h++){var m=s[h];try{Ze[m](e,c,n)}catch(w){p.push(w)}}if(p.length===s.length)throw new Error(`All post-robot messaging strategies failed:
134
+ `+A.stack),A})}).then(function(A){return{result:A,id:b,name:S}})})});var i,a,c,u=t.__id__||X();e=Y.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+"::")),Y.isProxyWindow(e)?(Ye(u,t,s,e,n),e.awaitWindow().then(function(p){Ye(u,t,s,p,n)})):Ye(u,t,s,e,n),se("cross_domain_function",{id:u,name:s})}function Mt(e,n,t,r){var o,i=r.on,a=r.send;return function(c,u){u===void 0&&(u=Fn);var s=JSON.stringify(c,function(p){var l=this[p];if(Ve(this))return l;var m=Ot(l);if(!m)return l;var w=u[m]||Un[m];return w?w(l,p):l});return s===void 0?"undefined":s}(t,((o={}).promise=function(c,u){return function(s,p,l,m,w){return se("cross_domain_zalgo_promise",{then:Dt(s,p,function(b,S){return l.then(b,S)},m,{on:w.on,send:w.send})})}(e,n,c,u,{on:i,send:a})},o.function=function(c,u){return Dt(e,n,c,u,{on:i,send:a})},o.object=function(c){return Te(c)||Y.isProxyWindow(c)?se("cross_domain_window",Y.serialize(c,{send:a})):c},o))}function jt(e,n,t,r){var o,i=r.send;return function(a,c){if(c===void 0&&(c=_n),a!=="undefined")return JSON.parse(a,function(u,s){if(Ve(this))return s;var p,l;if(Ve(s)?(p=s.__type__,l=s.__val__):(p=Ot(s),l=s),!p)return l;var m=c[p]||Hn[p];return m?m(l,u):l})}(t,((o={}).cross_domain_zalgo_promise=function(a){return function(c,u,s){return new T(s.then)}(0,0,a)},o.cross_domain_function=function(a){return function(c,u,s,p){var l=s.id,m=s.name,w=p.send,b=function(x){x===void 0&&(x={});function O(){var z=arguments;return Y.toProxyWindow(c,{send:w}).awaitWindow().then(function(N){var A=Nt(N,l);if(A&&A.val!==O)return A.val.apply({source:window,origin:B()},z);var k=[].slice.call(z);return x.fireAndForget?w(N,"postrobot_method",{id:l,name:m,args:k},{domain:u,fireAndForget:!0}):w(N,"postrobot_method",{id:l,name:m,args:k},{domain:u,fireAndForget:!1}).then(function(P){return P.data.result})}).catch(function(N){throw N})}return O.__name__=m,O.__origin__=u,O.__source__=c,O.__id__=l,O.origin=u,O},S=b();return S.fireAndForget=b({fireAndForget:!0}),S}(e,n,a,{send:i})},o.cross_domain_window=function(a){return Y.deserialize(a,{send:i})},o))}var Ze={};Ze.postrobot_post_message=function(e,n,t){t.indexOf("file:")===0&&(t="*"),e.postMessage(n,t)};function Ke(e,n,t,r){var o=r.on,i=r.send;return T.try(function(){var a=$().getOrSet(e,function(){return{}});return a.buffer=a.buffer||[],a.buffer.push(t),a.flush=a.flush||T.flush().then(function(){if(Z(e))throw new Error("Window is closed");var c=Mt(e,n,((u={}).__post_robot_10_0_46__=a.buffer||[],u),{on:o,send:i}),u;delete a.buffer;for(var s=Object.keys(Ze),p=[],l=0;l<s.length;l++){var m=s[l];try{Ze[m](e,c,n)}catch(w){p.push(w)}}if(p.length===s.length)throw new Error(`All post-robot messaging strategies failed:
135
135
 
136
- `+p.map(function(w,x){return x+". "+ye(w)}).join(`
136
+ `+p.map(function(w,b){return b+". "+ye(w)}).join(`
137
137
 
138
- `))}),a.flush.then(function(){delete a.flush})}).then(ae)}function zt(e){return L("responseListeners").get(e)}function Lt(e){L("responseListeners").del(e)}function kt(e){return L("erroredResponseListeners").has(e)}function Ut(e){var n=e.name,t=e.win,r=e.domain,o=$("requestListeners");if(t==="*"&&(t=null),r==="*"&&(r=null),!n)throw new Error("Name required to get request listener");for(var i=0,a=[t,Ne()];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 p=0,h=s.__domain_regex__;p<h.length;p++){var m=h[p],w=m.listener;if(ce(m.regex,r))return w}}if(s["*"])return s["*"]}}}}}function qn(e,n,t,r){var o=r.on,i=r.send,a=Ut({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,p,h){return C.flush().then(function(){if(!t.fireAndForget&&!Z(e))try{return Ke(e,n,{id:X(),origin:B(window),type:"postrobot_message_response",hash:t.hash,name:t.name,ack:s,data:p,error:h},{on:o,send:i})}catch(m){throw new Error("Send response message failed for "+c+" in "+B()+`
138
+ `))}),a.flush.then(function(){delete a.flush})}).then(ae)}function zt(e){return L("responseListeners").get(e)}function Lt(e){L("responseListeners").del(e)}function kt(e){return L("erroredResponseListeners").has(e)}function Ut(e){var n=e.name,t=e.win,r=e.domain,o=$("requestListeners");if(t==="*"&&(t=null),r==="*"&&(r=null),!n)throw new Error("Name required to get request listener");for(var i=0,a=[t,Ne()];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 p=0,l=s.__domain_regex__;p<l.length;p++){var m=l[p],w=m.listener;if(ce(m.regex,r))return w}}if(s["*"])return s["*"]}}}}}function qn(e,n,t,r){var o=r.on,i=r.send,a=Ut({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,p,l){return T.flush().then(function(){if(!t.fireAndForget&&!Z(e))try{return Ke(e,n,{id:X(),origin:B(window),type:"postrobot_message_response",hash:t.hash,name:t.name,ack:s,data:p,error:l},{on:o,send:i})}catch(m){throw new Error("Send response message failed for "+c+" in "+B()+`
139
139
 
140
- `+ye(m))}})}return C.all([C.flush().then(function(){if(!t.fireAndForget&&!Z(e))try{return Ke(e,n,{id:X(),origin:B(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 "+B()+`
140
+ `+ye(m))}})}return T.all([T.flush().then(function(){if(!t.fireAndForget&&!Z(e))try{return Ke(e,n,{id:X(),origin:B(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 "+B()+`
141
141
 
142
- `+ye(s))}}),C.try(function(){if(!a)throw new Error("No handler found for post message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return a.handler({source:e,origin:n,data:t.data})}).then(function(s){return u("success",s)},function(s){return u("error",null,s)})]).then(ae).catch(function(s){if(a&&a.handleError)return a.handleError(s);throw s})}function Bn(e,n,t){if(!kt(t.hash)){var r=zt(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(!ce(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 $n(e,n,t){if(!kt(t.hash)){var r=zt(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(!ce(r.domain,n))throw new Error("Response origin "+n+" does not match domain "+(o=r.domain,Array.isArray(o)?"("+o.join(" | ")+")":y(o)?"RegExp("+o.toString()+")":o.toString()));var o;if(e!==r.win)throw new Error("Response source does not match registered window");Lt(t.hash),t.ack==="error"?r.promise.reject(t.error):t.ack==="success"&&r.promise.resolve({source:e,origin:n,data:t.data})}}function Ft(e,n){var t=n.on,r=n.send,o=L("receivedMessages");try{if(!window||window.closed||!e.source)return}catch(p){return}var i=e.source,a=e.origin,c=function(p,h,m,w){var x=w.on,S=w.send,b;try{b=Mt(h,m,p,{on:x,send:S})}catch(z){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(c){Rt(i);for(var u=0;u<c.length;u++){var s=c[u];if(o.has(s.id)||(o.set(s.id,!0),Z(i)&&!s.fireAndForget))return;s.origin.indexOf("file:")===0&&(a="file://");try{s.type==="postrobot_message_request"?qn(i,a,s,{on:t,send:r}):s.type==="postrobot_message_response"?$n(i,a,s):s.type==="postrobot_message_ack"&&Bn(i,a,s)}catch(p){setTimeout(function(){throw p},0)}}}}function ue(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,p=$("requestListeners");if(!c||typeof c!="string")throw new Error("Name required to add request listener");if(u&&u!=="*"&&Y.isProxyWindow(u)){var h=u.awaitWindow().then(function(M){return o({name:c,win:M,domain:s},a)});return{cancel:function(){h.then(function(M){return M.cancel()},ae)}}}var m=u;if(Array.isArray(m)){for(var w=[],x=0,S=m;x<S.length;x++)w.push(o({name:c,domain:s,win:S[x]},a));return{cancel:function(){for(var M=0;M<w.length;M++)w[M].cancel()}}}if(Array.isArray(s)){for(var b=[],O=0,z=s;O<z.length;O++)b.push(o({name:c,win:m,domain:z[O]},a));return{cancel:function(){for(var M=0;M<b.length;M++)b[M].cancel()}}}var N=Ut({name:c,win:m,domain:s});m&&m!=="*"||(m=Ne());var A=(s=s||"*").toString();if(N)throw m&&s?new Error("Request listener already exists for "+c+" on domain "+s.toString()+" for "+(m===Ne()?"wildcard":"specified")+" window"):m?new Error("Request listener already exists for "+c+" for "+(m===Ne()?"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=p.getOrSet(m,function(){return{}}),P=Ee(k,c,function(){return{}}),D,K;return $e(s)?(D=Ee(P,"__domain_regex__",function(){return[]})).push(K={regex:s,listener:a}):P[A]=a,{cancel:function(){delete P[A],K&&(D.splice(D.indexOf(K,1)),D.length||delete P.__domain_regex__),Object.keys(P).length||delete k[c],m&&!Object.keys(k).length&&p.del(m)}}}({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 Gn(e,n,t){typeof(n=n||{})=="function"&&(t=n,n={});var r=new C,o;return n.errorHandler=function(i){o.cancel(),r.reject(i)},o=ue(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 Y.toProxyWindow(n,{send:e}).awaitWindow().then(function(s){return C.try(function(){if(function(p,h,m){if(!p)throw new Error("Expected name");if(typeof m!="string"&&!Array.isArray(m)&&!$e(m))throw new TypeError("Can not send "+p+". Expected domain "+JSON.stringify(m)+" to be a string, array, or regex");if(Z(h))throw new Error("Can not send "+p+". Target window is closed")}(t,s,i),function(p,h){var m=ht(h);if(m)return m===p;if(h===p||function(S){S===void 0&&(S=window);try{if(S.top)return S.top}catch(N){}if(H(S)===S)return S;try{if(ft(window,S)&&window.top)return window.top}catch(N){}try{if(ft(S,window)&&window.top)return window.top}catch(N){}for(var b=0,O=function N(A){for(var k=[],P=0,D=lt(A);P<D.length;P++){var K=D[P];k.push(K);for(var M=0,be=N(K);M<be.length;M++)k.push(be[M])}return k}(S);b<O.length;b++){var z=O[b];try{if(z.top)return z.top}catch(N){}if(H(z)===z)return z}}(h)===h)return!1;for(var w=0,x=lt(p);w<x.length;w++)if(x[w]===h)return!0;return!1}(window,s))return function(p,h,m){h===void 0&&(h=5e3),m===void 0&&(m="Window");var w=function(x){return $("helloPromises").getOrSet(x,function(){return new C})}(p);return h!==-1&&(w=w.timeout(h,new Error(m+" did not load after "+h+"ms"))),w}(s,c)}).then(function(p){return function(h,m,w,x){var S=x.send;return C.try(function(){return typeof m=="string"?m:C.try(function(){return w||Ge(h,{send:S}).then(function(b){return b.domain})}).then(function(b){if(!ce(m,m))throw new Error("Domain "+St(m)+" does not match "+St(m));return b})})}(s,i,(p===void 0?{}:p).domain,{send:e})}).then(function(p){var h=p,m=t==="postrobot_method"&&r&&typeof r.name=="string"?r.name+"()":t,w=new C,x=t+"_"+X();if(!u){var S={name:t,win:s,domain:h,promise:w};(function(P,D){L("responseListeners").set(P,D)})(x,S);var b=$("requestPromises").getOrSet(s,function(){return[]});b.push(w),w.catch(function(){(function(P){L("erroredResponseListeners").set(P,!0)})(x),Lt(x)});var O=function(P){return $("knownWindows").get(P,!1)}(s)?1e4:2e3,z=a,N=O,A=z,k=function(P,D){var K;return function M(){K=setTimeout(function(){(function(){if(Z(s))return w.reject(new Error("Window closed for "+t+" before "+(S.ack?"response":"ack")));if(S.cancelled)return w.reject(new Error("Response listener was cancelled for "+t));N=Math.max(N-500,0),A!==-1&&(A=Math.max(A-500,0)),S.ack||N!==0?A===0&&w.reject(new Error("No response for postMessage "+m+" in "+B()+" in "+z+"ms")):w.reject(new Error("No ack for postMessage "+m+" in "+B()+" in "+O+"ms"))})(),M()},500)}(),{cancel:function(){clearTimeout(K)}}}();w.finally(function(){k.cancel(),b.splice(b.indexOf(w,1))}).catch(ae)}return Ke(s,h,{id:X(),origin:B(window),type:"postrobot_message_request",hash:x,name:t,data:r,fireAndForget:u},{on:ue,send:e}).then(function(){return u?w.resolve():w},function(P){throw new Error("Send request message failed for "+m+" in "+B()+`
142
+ `+ye(s))}}),T.try(function(){if(!a)throw new Error("No handler found for post message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return a.handler({source:e,origin:n,data:t.data})}).then(function(s){return u("success",s)},function(s){return u("error",null,s)})]).then(ae).catch(function(s){if(a&&a.handleError)return a.handleError(s);throw s})}function Bn(e,n,t){if(!kt(t.hash)){var r=zt(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(!ce(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 $n(e,n,t){if(!kt(t.hash)){var r=zt(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(!ce(r.domain,n))throw new Error("Response origin "+n+" does not match domain "+(o=r.domain,Array.isArray(o)?"("+o.join(" | ")+")":y(o)?"RegExp("+o.toString()+")":o.toString()));var o;if(e!==r.win)throw new Error("Response source does not match registered window");Lt(t.hash),t.ack==="error"?r.promise.reject(t.error):t.ack==="success"&&r.promise.resolve({source:e,origin:n,data:t.data})}}function Ft(e,n){var t=n.on,r=n.send,o=L("receivedMessages");try{if(!window||window.closed||!e.source)return}catch(p){return}var i=e.source,a=e.origin,c=function(p,l,m,w){var b=w.on,S=w.send,x;try{x=jt(l,m,p,{on:b,send:S})}catch(z){return}if(x&&typeof x=="object"&&x!==null){var O=x.__post_robot_10_0_46__;if(Array.isArray(O))return O}}(e.data,i,a,{on:t,send:r});if(c){Rt(i);for(var u=0;u<c.length;u++){var s=c[u];if(o.has(s.id)||(o.set(s.id,!0),Z(i)&&!s.fireAndForget))return;s.origin.indexOf("file:")===0&&(a="file://");try{s.type==="postrobot_message_request"?qn(i,a,s,{on:t,send:r}):s.type==="postrobot_message_response"?$n(i,a,s):s.type==="postrobot_message_ack"&&Bn(i,a,s)}catch(p){setTimeout(function(){throw p},0)}}}}function ue(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,p=$("requestListeners");if(!c||typeof c!="string")throw new Error("Name required to add request listener");if(u&&u!=="*"&&Y.isProxyWindow(u)){var l=u.awaitWindow().then(function(j){return o({name:c,win:j,domain:s},a)});return{cancel:function(){l.then(function(j){return j.cancel()},ae)}}}var m=u;if(Array.isArray(m)){for(var w=[],b=0,S=m;b<S.length;b++)w.push(o({name:c,domain:s,win:S[b]},a));return{cancel:function(){for(var j=0;j<w.length;j++)w[j].cancel()}}}if(Array.isArray(s)){for(var x=[],O=0,z=s;O<z.length;O++)x.push(o({name:c,win:m,domain:z[O]},a));return{cancel:function(){for(var j=0;j<x.length;j++)x[j].cancel()}}}var N=Ut({name:c,win:m,domain:s});m&&m!=="*"||(m=Ne());var A=(s=s||"*").toString();if(N)throw m&&s?new Error("Request listener already exists for "+c+" on domain "+s.toString()+" for "+(m===Ne()?"wildcard":"specified")+" window"):m?new Error("Request listener already exists for "+c+" for "+(m===Ne()?"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=p.getOrSet(m,function(){return{}}),P=Ee(k,c,function(){return{}}),D,K;return $e(s)?(D=Ee(P,"__domain_regex__",function(){return[]})).push(K={regex:s,listener:a}):P[A]=a,{cancel:function(){delete P[A],K&&(D.splice(D.indexOf(K,1)),D.length||delete P.__domain_regex__),Object.keys(P).length||delete k[c],m&&!Object.keys(k).length&&p.del(m)}}}({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 Gn(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=ue(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 Y.toProxyWindow(n,{send:e}).awaitWindow().then(function(s){return T.try(function(){if(function(p,l,m){if(!p)throw new Error("Expected name");if(typeof m!="string"&&!Array.isArray(m)&&!$e(m))throw new TypeError("Can not send "+p+". Expected domain "+JSON.stringify(m)+" to be a string, array, or regex");if(Z(l))throw new Error("Can not send "+p+". Target window is closed")}(t,s,i),function(p,l){var m=ht(l);if(m)return m===p;if(l===p||function(S){S===void 0&&(S=window);try{if(S.top)return S.top}catch(N){}if(H(S)===S)return S;try{if(ft(window,S)&&window.top)return window.top}catch(N){}try{if(ft(S,window)&&window.top)return window.top}catch(N){}for(var x=0,O=function N(A){for(var k=[],P=0,D=lt(A);P<D.length;P++){var K=D[P];k.push(K);for(var j=0,xe=N(K);j<xe.length;j++)k.push(xe[j])}return k}(S);x<O.length;x++){var z=O[x];try{if(z.top)return z.top}catch(N){}if(H(z)===z)return z}}(l)===l)return!1;for(var w=0,b=lt(p);w<b.length;w++)if(b[w]===l)return!0;return!1}(window,s))return function(p,l,m){l===void 0&&(l=5e3),m===void 0&&(m="Window");var w=function(b){return $("helloPromises").getOrSet(b,function(){return new T})}(p);return l!==-1&&(w=w.timeout(l,new Error(m+" did not load after "+l+"ms"))),w}(s,c)}).then(function(p){return function(l,m,w,b){var S=b.send;return T.try(function(){return typeof m=="string"?m:T.try(function(){return w||Ge(l,{send:S}).then(function(x){return x.domain})}).then(function(x){if(!ce(m,m))throw new Error("Domain "+St(m)+" does not match "+St(m));return x})})}(s,i,(p===void 0?{}:p).domain,{send:e})}).then(function(p){var l=p,m=t==="postrobot_method"&&r&&typeof r.name=="string"?r.name+"()":t,w=new T,b=t+"_"+X();if(!u){var S={name:t,win:s,domain:l,promise:w};(function(P,D){L("responseListeners").set(P,D)})(b,S);var x=$("requestPromises").getOrSet(s,function(){return[]});x.push(w),w.catch(function(){(function(P){L("erroredResponseListeners").set(P,!0)})(b),Lt(b)});var O=function(P){return $("knownWindows").get(P,!1)}(s)?1e4:2e3,z=a,N=O,A=z,k=function(P,D){var K;return function j(){K=setTimeout(function(){(function(){if(Z(s))return w.reject(new Error("Window closed for "+t+" before "+(S.ack?"response":"ack")));if(S.cancelled)return w.reject(new Error("Response listener was cancelled for "+t));N=Math.max(N-500,0),A!==-1&&(A=Math.max(A-500,0)),S.ack||N!==0?A===0&&w.reject(new Error("No response for postMessage "+m+" in "+B()+" in "+z+"ms")):w.reject(new Error("No ack for postMessage "+m+" in "+B()+" in "+O+"ms"))})(),j()},500)}(),{cancel:function(){clearTimeout(K)}}}();w.finally(function(){k.cancel(),x.splice(x.indexOf(w,1))}).catch(ae)}return Ke(s,l,{id:X(),origin:B(window),type:"postrobot_message_request",hash:b,name:t,data:r,fireAndForget:u},{on:ue,send:e}).then(function(){return u?w.resolve():w},function(P){throw new Error("Send request message failed for "+m+" in "+B()+`
143
143
 
144
- `+ye(P))})})})};function Vn(e,n,t){return jt(e,n,t,{on:ue,send:ne})}function Jn(e,n,t){return Mt(e,n,t,{send:ne})}function Yn(e){return new Y({send:ne,win:e})}function Zn(e){return Y.toProxyWindow(e,{send:ne})}function Ht(){Se().initialized||(Se().initialized=!0,n=(e={on:ue,send:ne}).on,t=e.send,(r=Se()).receiveMessage=r.receiveMessage||function(o){return Ft(o,{on:n,send:t})},function(o){var i=o.on,a=o.send;L().getOrSet("postMessageListener",function(){return function(c,u,s){return c.addEventListener("message",s),{cancel:function(){c.removeEventListener("message",s)}}}(window,0,function(c){(function(u,s){var p=s.on,h=s.send;C.try(function(){var m=u.source||u.sourceElement,w=u.origin||u.originalEvent&&u.originalEvent.origin,x=u.data;if(w==="null"&&(w="file://"),m){if(!w)throw new Error("Post message did not have origin domain");Ft({source:m,origin:w,data:x},{on:p,send:h})}})})(c,{on:i,send:a})})})}({on:ue,send:ne}),function(o){var i=o.on,a=o.send;L("builtinListeners").getOrSet("helloListener",function(){var c=i("postrobot_hello",{domain:"*"},function(s){return Tt(s.source,{domain:s.origin}),{instanceID:Pt()}}),u=ht();return u&&Ge(u,{send:a}).catch(function(s){}),c})}({on:ue,send:ne}));var e,n,t,r}function Kn(){(function(){for(var n=L("responseListeners"),t=0,r=n.keys();t<r.length;t++){var o=r[t],i=n.get(o);i&&(i.cancelled=!0),n.del(o)}})(),(e=L().get("postMessageListener"))&&e.cancel();var e;delete window.__post_robot_10_0_46__}var Xn=!0;function Qn(e){for(var n=0,t=$("requestPromises").get(e,[]);n<t.length;n++)t[n].reject(new Error("Window "+(Z(e)?"closed":"cleaned up")+" before response")).catch(ae)}Ht()}])})}(Ie)),Ie.exports}var ct;function On(){return ct||(ct=1,function(l){l.exports=Rn(),l.exports.default=l.exports}(Fe)),Fe.exports}var dt=On();const He=T({__proto__:null,default:Tn(dt)},[dt]);I.ConsentBox=ze,I.PrivacyCenterBox=vn,I.SoyioTypes=wn,I.SoyioWidget=st,I._TooltipManager=re,I.default=st,Object.defineProperties(I,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
144
+ `+ye(P))})})})};function Vn(e,n,t){return Mt(e,n,t,{on:ue,send:ne})}function Jn(e,n,t){return jt(e,n,t,{send:ne})}function Yn(e){return new Y({send:ne,win:e})}function Zn(e){return Y.toProxyWindow(e,{send:ne})}function Ht(){Se().initialized||(Se().initialized=!0,n=(e={on:ue,send:ne}).on,t=e.send,(r=Se()).receiveMessage=r.receiveMessage||function(o){return Ft(o,{on:n,send:t})},function(o){var i=o.on,a=o.send;L().getOrSet("postMessageListener",function(){return function(c,u,s){return c.addEventListener("message",s),{cancel:function(){c.removeEventListener("message",s)}}}(window,0,function(c){(function(u,s){var p=s.on,l=s.send;T.try(function(){var m=u.source||u.sourceElement,w=u.origin||u.originalEvent&&u.originalEvent.origin,b=u.data;if(w==="null"&&(w="file://"),m){if(!w)throw new Error("Post message did not have origin domain");Ft({source:m,origin:w,data:b},{on:p,send:l})}})})(c,{on:i,send:a})})})}({on:ue,send:ne}),function(o){var i=o.on,a=o.send;L("builtinListeners").getOrSet("helloListener",function(){var c=i("postrobot_hello",{domain:"*"},function(s){return Ct(s.source,{domain:s.origin}),{instanceID:Pt()}}),u=ht();return u&&Ge(u,{send:a}).catch(function(s){}),c})}({on:ue,send:ne}));var e,n,t,r}function Kn(){(function(){for(var n=L("responseListeners"),t=0,r=n.keys();t<r.length;t++){var o=r[t],i=n.get(o);i&&(i.cancelled=!0),n.del(o)}})(),(e=L().get("postMessageListener"))&&e.cancel();var e;delete window.__post_robot_10_0_46__}var Xn=!0;function Qn(e){for(var n=0,t=$("requestPromises").get(e,[]);n<t.length;n++)t[n].reject(new Error("Window "+(Z(e)?"closed":"cleaned up")+" before response")).catch(ae)}Ht()}])})}(Ie)),Ie.exports}var ct;function On(){return ct||(ct=1,function(h){h.exports=Rn(),h.exports.default=h.exports}(Fe)),Fe.exports}var dt=On();const He=C({__proto__:null,default:Cn(dt)},[dt]);I.ConsentBox=ze,I.PrivacyCenterBox=vn,I.SoyioTypes=wn,I.SoyioWidget=st,I._TooltipManager=re,I.default=st,Object.defineProperties(I,{__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.14.0",
3
+ "version": "2.14.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",