@iframe-resizer/core 6.0.0-beta.0 → 6.0.0-beta.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/index.esm.js CHANGED
@@ -1,43 +1,43 @@
1
- import Je, { NORMAL as Ye, HIGHLIGHT as l, FOREGROUND as v } from "auto-console-group";
2
- const C = "6.0.0-beta.0", pe = "iframeResizer", S = ":", Xe = "[iFrameResizerChild]Ready", de = "autoResize", Ke = "beforeUnload", Qe = "close", et = "inPageLink", $ = "init", he = "iframeReady", tt = "lazy", W = "load", R = "message", nt = "mouseenter", ot = "mouseleave", ge = "onload", me = "pageInfo", be = "parentInfo", it = "pageInfoStop", rt = "parentInfoStop", H = "reset", Z = "resize", st = "scrollBy", ct = "scrollTo", at = "scrollToOffset", lt = "title", Q = 1, ut = "height", ft = "width", pt = "offset", dt = "offsetSize", ee = "scroll", P = `
3
- `, ht = "hidden", gt = "child", D = "parent", J = "string", mt = "number", ye = "object", ve = "function", G = "auto", bt = "font-weight: bold;", we = "none", ze = "both", F = "vertical", Ee = "horizontal", yt = R.length, x = "[iFrameSizer]", U = x.length, vt = Object.freeze({
1
+ import nt, { NORMAL as ot, HIGHLIGHT as l, FOREGROUND as z } from "auto-console-group";
2
+ const _ = "6.0.0-beta.2", de = "iframeResizer", L = ":", it = "[iFrameResizerChild]Ready", ge = "autoResize", st = "beforeUnload", rt = "close", at = "inPageLink", j = "init", ye = "iframeReady", ct = "lazy", G = "load", A = "message", lt = "mouseenter", ut = "mouseleave", me = "onload", be = "pageInfo", ve = "parentInfo", ft = "pageInfoStop", pt = "parentInfoStop", U = "reset", Y = "resize", ht = "scrollBy", dt = "scrollTo", gt = "scrollToOffset", yt = "title", ee = 1, mt = "height", bt = "width", vt = "offset", zt = "offsetSize", te = "scroll", N = `
3
+ `, wt = "hidden", Et = "child", V = "parent", X = "string", Ot = "number", ze = "object", we = "function", q = "auto", Tt = "font-weight: bold;", Ee = "none", Oe = "both", D = "vertical", Te = "horizontal", kt = "omit", It = A.length, F = "[iFrameSizer]", Z = F.length, $t = Object.freeze({
4
4
  max: 1,
5
5
  scroll: 1,
6
6
  bodyScroll: 1,
7
7
  documentElementScroll: 1
8
- }), te = Object.freeze({
9
- [ge]: 1,
10
- [$]: 1,
11
- [he]: 1
12
- }), V = "expanded", Y = "collapsed", wt = Object.freeze({
13
- [V]: 1,
14
- [Y]: 1
15
- }), Oe = "Use of the old name will be removed in a future version of <i>iframe-resizer</>.", Te = (e) => typeof e === ye && e !== null, X = (e) => typeof e === J;
16
- function zt(e) {
17
- if (!Te(e)) return !1;
8
+ }), ne = Object.freeze({
9
+ [me]: 1,
10
+ [j]: 1,
11
+ [ye]: 1
12
+ }), M = "expanded", S = "collapsed", ke = 0, Ie = 1, $e = 2, Mt = Object.freeze({
13
+ [M]: 1,
14
+ [S]: 1
15
+ }), Me = "Use of the old name will be removed in a future version of <i>iframe-resizer</>.", Se = (e) => typeof e === ze && e !== null, K = (e) => typeof e === X;
16
+ function St(e) {
17
+ if (!Se(e)) return !1;
18
18
  try {
19
19
  return e.tagName === "IFRAME" || e instanceof HTMLIFrameElement;
20
20
  } catch {
21
21
  return !1;
22
22
  }
23
23
  }
24
- const Et = (e, ...t) => setTimeout(() => e(...t), 0), Ot = (e) => {
24
+ const jt = (e, ...t) => setTimeout(() => e(...t), 0), Rt = (e) => {
25
25
  let t = !1;
26
26
  return function(...n) {
27
27
  return t ? void 0 : (t = !0, e.apply(this, n));
28
28
  };
29
- }, Tt = (e, t) => Object.prototype.hasOwnProperty.call(e, t), k = (e, t) => Object.hasOwn ? Object.hasOwn(e, t) : Tt(e, t), It = (e) => e, Mt = (e) => e.charAt(0).toUpperCase() + e.slice(1), $t = (e) => (
29
+ }, Lt = (e, t) => Object.prototype.hasOwnProperty.call(e, t), P = (e, t) => Object.hasOwn ? Object.hasOwn(e, t) : Lt(e, t), At = (e) => e, Pt = (e) => e.charAt(0).toUpperCase() + e.slice(1), Ct = (e) => (
30
30
  // eslint-disable-next-line no-underscore-dangle
31
31
  e?.__esModule ? e.default : e
32
- ), St = (e, t, n) => {
32
+ ), Nt = (e, t, n) => {
33
33
  if (typeof e !== t)
34
- throw new TypeError(`${n} is not a ${Mt(t)}`);
35
- }, Rt = (e) => (t, n = "renamed to") => (o, r, s = "", c = "") => e(
36
- c,
34
+ throw new TypeError(`${n} is not a ${Pt(t)}`);
35
+ }, xt = (e) => (t, n = "renamed to") => (o, s, a = "", r = "") => e(
36
+ r,
37
37
  `<rb>Deprecated ${t}(${o.replace("()", "")})</>
38
38
 
39
- The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${s}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`
40
- ), Ie = {
39
+ The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${s}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`
40
+ ), je = {
41
41
  br: `
42
42
  `,
43
43
  rb: "\x1B[31;1m",
@@ -52,50 +52,54 @@ The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${s}Use of the old $
52
52
  // underline
53
53
  "/": "\x1B[m"
54
54
  // reset
55
- }, kt = Object.keys(Ie), jt = new RegExp(`<(${kt.join("|")})>`, "gi"), Lt = (e, t) => Ie[t] ?? "", At = (e) => e.replace(jt, Lt), Pt = (e) => e.replaceAll("<br>", P).replaceAll(/<\/?[^>]+>/gi, ""), Me = (e) => (t) => e(
56
- X(t) ? window.chrome ? At(t) : Pt(t) : t
57
- ), i = {}, $e = $t(Je);
58
- let K = !0;
59
- const Nt = $e({
55
+ }, _t = Object.keys(je), Ft = new RegExp(`<(${_t.join("|")})>`, "gi"), Bt = (e, t) => je[t] ?? "", Wt = (e) => e.replace(Ft, Bt), Dt = (e) => e.replaceAll("<br>", N).replaceAll(/<\/?[^>]+>/gi, ""), Re = (e) => (t) => e(
56
+ K(t) ? window.chrome ? Wt(t) : Dt(t) : t
57
+ ), i = {}, Le = Ct(nt);
58
+ let Q = !0;
59
+ const Ht = Le({
60
60
  expand: !1,
61
- label: D
62
- }), Ct = (e) => window.top === window.self ? `parent(${e})` : `nested parent(${e})`, xt = (e) => i[e] ? i[e].log : K;
63
- function _t({ enabled: e, expand: t, iframeId: n }) {
64
- const o = $e({
61
+ label: V
62
+ }), Gt = (e) => window.top === window.self ? `parent(${e})` : `nested parent(${e})`, Ut = (e) => i[e] ? i[e].log : Q;
63
+ function Vt({
64
+ enabled: e,
65
+ expand: t,
66
+ iframeId: n
67
+ }) {
68
+ const o = Le({
65
69
  expand: t,
66
- label: Ct(n)
70
+ label: Gt(n)
67
71
  });
68
- K = e, i[n] || (i[n] = {
72
+ Q = e, i[n] || (i[n] = {
69
73
  console: o
70
74
  });
71
75
  }
72
- const I = (e) => (t, ...n) => i[t] ? i[t].console[e](...n) : Nt[e](...n), Se = (e) => (t, ...n) => xt(t) === !0 ? I(e)(t, ...n) : null, u = Se("log"), m = u, Ft = Se("debug"), M = I("warn"), Bt = I("error"), y = I("event"), Wt = I("purge"), Ht = I("endAutoGroup"), Re = I("errorBoundary");
73
- function Dt(e, t) {
76
+ const I = (e) => (t, ...n) => i[t] ? i[t].console[e](...n) : Ht[e](...n), Ae = (e) => (t, ...n) => Ut(t) === !0 ? I(e)(t, ...n) : null, u = Ae("log"), m = u, qt = Ae("debug"), w = I("warn"), Zt = I("error"), b = I("event"), Jt = I("purge"), Yt = I("endAutoGroup"), Pe = I("errorBoundary");
77
+ function Xt(e, t) {
74
78
  queueMicrotask(
75
79
  () => (
76
80
  // eslint-disable-next-line no-console
77
81
  console.info(
78
82
  `%ciframe-resizer ${e}`,
79
- K || t < 1 ? bt : Ye
83
+ Q || t < 1 ? Tt : ot
80
84
  )
81
85
  )
82
86
  );
83
87
  }
84
- const Gt = (e) => (...t) => [`${pe}(${e})`, ...t].join(" "), Ut = Me(It), b = (e, ...t) => i[e] ? i[e].console.warn(...t.map(Ut)) : queueMicrotask(() => {
85
- const n = Me(Gt(e));
88
+ const Kt = (e) => (...t) => [`${de}(${e})`, ...t].join(" "), Qt = Re(At), y = (e, ...t) => i[e] ? i[e].console.warn(...t.map(Qt)) : queueMicrotask(() => {
89
+ const n = Re(Kt(e));
86
90
  console?.warn(...t.map(n));
87
- }), Vt = Rt(b), qt = Vt("Option"), Zt = (e) => {
88
- typeof i[e.id].onInit === ve && (qt("init()", "onReady()", "", e.id), i[e.id].onInit(e));
89
- }, _ = Object.freeze({
91
+ }), en = xt(y), tn = en("Option"), nn = (e) => {
92
+ typeof i[e.id].onInit === we && (tn("init()", "onReady()", "", e.id), i[e.id].onInit(e));
93
+ }, B = Object.freeze({
90
94
  autoResize: !0,
91
95
  bodyBackground: null,
92
96
  bodyMargin: null,
93
97
  bodyPadding: null,
94
98
  checkOrigin: !0,
95
- direction: F,
99
+ direction: D,
96
100
  firstRun: !0,
97
101
  inPageLinks: !1,
98
- heightCalculationMethod: G,
102
+ heightCalculationMethod: q,
99
103
  id: "iFrameResizer",
100
104
  // TODO: v6 change to 'iframeResizer'
101
105
  log: !1,
@@ -113,7 +117,7 @@ const Gt = (e) => (...t) => [`${pe}(${e})`, ...t].join(" "), Ut = Me(It), b = (e
113
117
  tolerance: 0,
114
118
  waitForLoad: !1,
115
119
  warningTimeout: 5e3,
116
- widthCalculationMethod: G,
120
+ widthCalculationMethod: q,
117
121
  onBeforeClose: () => !0,
118
122
  onAfterClose() {
119
123
  },
@@ -123,116 +127,136 @@ const Gt = (e) => (...t) => [`${pe}(${e})`, ...t].join(" "), Ut = Me(It), b = (e
123
127
  },
124
128
  onMouseLeave() {
125
129
  },
126
- onReady: Zt,
130
+ onReady: nn,
127
131
  onResized() {
128
132
  },
129
133
  onScroll: () => !0
130
134
  });
131
- let ne = 0;
132
- function Jt(e) {
133
- const t = e?.id || _.id + ne++;
134
- return document.getElementById(t) === null ? t : `${t}${ne++}`;
135
+ let oe = 0;
136
+ function on(e) {
137
+ const t = e?.id || B.id + oe++;
138
+ return document.getElementById(t) === null ? t : `${t}${oe++}`;
135
139
  }
136
- function Yt(e, t) {
140
+ function sn(e, t) {
137
141
  let { id: n } = e;
138
- if (n && !X(n))
142
+ if (n && !K(n))
139
143
  throw new TypeError("Invalid id for iFrame. Expected String");
140
- return (!n || n === "") && (n = Jt(t), e.id = n, y(n, "assignId"), u(n, `Added missing iframe ID: ${n} (${e.src})`)), n;
144
+ return (!n || n === "") && (n = on(t), e.id = n, b(n, "assignId"), u(n, `Added missing iframe ID: ${n} (${e.src})`)), n;
141
145
  }
142
- function Xt(e) {
146
+ function rn(e) {
143
147
  const { search: t } = window.location;
144
- t.includes("ifrlog") && (e.log = Y, e.logExpand = t.includes("ifrlog=expanded"));
148
+ if (t.includes("ifrlog"))
149
+ switch (new URLSearchParams(t).get("ifrlog")) {
150
+ case String(ke): {
151
+ e.log = !1;
152
+ break;
153
+ }
154
+ case M:
155
+ case String($e): {
156
+ e.log = M;
157
+ break;
158
+ }
159
+ case S:
160
+ case String(Ie): {
161
+ e.log = S;
162
+ break;
163
+ }
164
+ default:
165
+ e.log = S;
166
+ }
145
167
  }
146
- const j = (e, t, n, o) => e.addEventListener(t, n, o || !1), oe = (e, t, n) => e.removeEventListener(t, n, !1), Kt = (e) => e.split(S).filter((t, n) => n !== 19).join(S);
147
- function Qt(e, t, n) {
168
+ const C = (e, t, n, o) => e.addEventListener(t, n, o || !1), ie = (e, t, n) => e.removeEventListener(t, n, !1), an = (e) => e.split(L).filter((t, n) => n !== 19).join(L);
169
+ function cn(e, t, n) {
148
170
  function o(f) {
149
- const p = e in te ? Kt(t) : t;
150
- m(n, f, l, v, l), m(n, `Message data: %c${p}`, l);
171
+ const p = e in ne ? an(t) : t;
172
+ m(n, f, l, z, l), m(n, `Message data: %c${p}`, l);
151
173
  }
152
- const { iframe: r, postMessageTarget: s, sameOrigin: c, targetOrigin: a } = i[n];
153
- if (c)
174
+ const { iframe: s, postMessageTarget: a, sameOrigin: r, targetOrigin: c } = i[n];
175
+ if (r)
154
176
  try {
155
- r.contentWindow.iframeChildListener(x + t), o(`Sending message to iframe %c${n}%c via same origin%c`);
177
+ s.contentWindow.iframeChildListener(F + t), o(`Sending message to iframe %c${n}%c via same origin%c`);
156
178
  return;
157
179
  } catch {
158
- e in te ? (i[n].sameOrigin = !1, u(n, "New iframe does not support same origin")) : M(n, "Same origin messaging failed, falling back to postMessage");
180
+ e in ne ? (i[n].sameOrigin = !1, u(n, "New iframe does not support same origin")) : w(n, "Same origin messaging failed, falling back to postMessage");
159
181
  }
160
182
  o(
161
- `Sending message to iframe: %c${n}%c targetOrigin: %c${a}`
162
- ), s.postMessage(x + t, a);
183
+ `Sending message to iframe: %c${n}%c targetOrigin: %c${c.join(", ")}`
184
+ );
185
+ for (const f of c)
186
+ a.postMessage(F + t, f);
163
187
  }
164
- function O(e, t, n) {
165
- if (y(n, e), !i[n]?.postMessageTarget) {
166
- M(n, "Iframe not found");
188
+ function T(e, t, n) {
189
+ if (b(n, e), !i[n]?.postMessageTarget) {
190
+ w(n, "Iframe not found");
167
191
  return;
168
192
  }
169
- Qt(e, t, n);
193
+ cn(e, t, n);
170
194
  }
171
- const en = (e, t) => Object.values(i).filter(({ autoResize: n, firstRun: o }) => n && !o).forEach(({ iframe: n }) => O(e, t, n.id));
172
- function tn() {
173
- document.hidden !== !0 && en("tabVisible", Z);
195
+ const ln = (e, t) => Object.values(i).filter(({ autoResize: n, firstRun: o }) => n && !o).forEach(({ iframe: n }) => T(e, t, n.id));
196
+ function un() {
197
+ document.hidden !== !0 && ln("tabVisible", Y);
174
198
  }
175
- function nn(e) {
199
+ function fn(e) {
176
200
  if (e.boxSizing !== "border-box") return 0;
177
201
  const t = e.paddingTop ? parseInt(e.paddingTop, 10) : 0, n = e.paddingBottom ? parseInt(e.paddingBottom, 10) : 0;
178
202
  return t + n;
179
203
  }
180
- function on(e) {
204
+ function pn(e) {
181
205
  if (e.boxSizing !== "border-box") return 0;
182
206
  const t = e.borderTopWidth ? parseInt(e.borderTopWidth, 10) : 0, n = e.borderBottomWidth ? parseInt(e.borderBottomWidth, 10) : 0;
183
207
  return t + n;
184
208
  }
185
- function rn(e) {
186
- const t = e.slice(U).split(":"), n = t[1] ? Number(t[1]) : 0, o = i[t[0]]?.iframe, r = getComputedStyle(o), s = {
209
+ function hn(e) {
210
+ const t = e.slice(Z).split(":"), n = t[1] ? Number(t[1]) : 0, o = i[t[0]]?.iframe, s = o ? getComputedStyle(o) : null, a = s ? fn(s) + pn(s) : 0, r = {
187
211
  iframe: o,
188
212
  id: t[0],
189
- height: n + nn(r) + on(r),
213
+ height: n + a,
190
214
  width: Number(t[2]),
191
215
  type: t[3],
192
216
  msg: t[4],
193
217
  message: t[4]
194
218
  };
195
- return t[5] && (s.mode = t[5]), s;
219
+ return t[5] && (r.mode = t[5]), r;
196
220
  }
197
- const sn = { true: 1, false: 1, undefined: 1 };
198
- function cn(e) {
199
- const { id: t, msg: n, iframe: o } = e, r = zt(o);
200
- return r || (u(t, `Received: %c${n}`, l), M(t, "The target iframe was not found.")), r;
221
+ const dn = { true: 1, false: 1, undefined: 1 };
222
+ function gn(e) {
223
+ const { id: t, msg: n, iframe: o } = e, s = St(o);
224
+ return s || (u(t, `Received: %c${n}`, l), w(t, "The target iframe was not found.")), s;
201
225
  }
202
- function an(e, t) {
203
- function n() {
226
+ function yn(e, t) {
227
+ const { id: n } = e, { data: o, origin: s } = t;
228
+ if ("sameOrigin" in t && t.sameOrigin) return !0;
229
+ const r = i[n]?.checkOrigin;
230
+ function c() {
204
231
  function f() {
205
232
  u(
206
- o,
207
- `Checking connection is from allowed list of origins: %c${a}`,
233
+ n,
234
+ `Checking connection is from allowed list of origins: %c${r}`,
208
235
  l
209
236
  );
210
- for (const g of a)
211
- if (g === s)
237
+ for (const h of r)
238
+ if (h === s)
212
239
  return !0;
213
240
  return !1;
214
241
  }
215
242
  function p() {
216
- const g = i[o]?.remoteHost;
217
- return u(o, `Checking connection is from: %c${g}`, l), s === g;
243
+ const h = i[n]?.remoteHost;
244
+ return u(n, `Checking connection is from: %c${h}`, l), s === h;
218
245
  }
219
- return a.constructor === Array ? f() : p();
246
+ return r.constructor === Array ? f() : p();
220
247
  }
221
- const { id: o } = e, { data: r, origin: s } = t;
222
- if ("sameOrigin" in t && t.sameOrigin) return !0;
223
- let a = i[o]?.checkOrigin;
224
- if (a && `${s}` != "null" && !n())
248
+ if (r && `${s}` != "null" && !c())
225
249
  throw new Error(
226
- `Unexpected message received from: ${s} for ${o}. Message was: ${r}. This error can be disabled by setting the checkOrigin: false option or by providing an array of trusted domains.`
250
+ `Unexpected message received from: ${s} for ${n}. Message was: ${o}. This error can be disabled by setting the checkOrigin: false option or by providing an array of trusted domains.`
227
251
  );
228
252
  return !0;
229
253
  }
230
- const ln = (e) => x === `${e}`.slice(0, U) && e.slice(U).split(":")[0] in i;
231
- function un(e) {
232
- const { id: t, type: n } = e, o = n in sn;
254
+ const mn = (e) => F === `${e}`.slice(0, Z) && e.slice(Z).split(":")[0] in i;
255
+ function bn(e) {
256
+ const { id: t, type: n } = e, o = n in dn;
233
257
  return o && u(t, "Ignoring init message from meta parent page"), o;
234
258
  }
235
- function fn(e) {
259
+ function vn(e) {
236
260
  try {
237
261
  i[e].sameOrigin = !!i[e]?.iframe?.contentWindow?.iframeChildListener;
238
262
  } catch {
@@ -240,10 +264,10 @@ function fn(e) {
240
264
  }
241
265
  u(e, `sameOrigin: %c${i[e].sameOrigin}`, l);
242
266
  }
243
- function pn(e, t) {
244
- if (t !== C) {
267
+ function zn(e, t) {
268
+ if (t !== _) {
245
269
  if (t === void 0) {
246
- b(
270
+ y(
247
271
  e,
248
272
  `<rb>Legacy version detected in iframe</>
249
273
 
@@ -256,79 +280,79 @@ See <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.
256
280
  }
257
281
  u(
258
282
  e,
259
- `Version mismatch (Child: %c${t}%c !== Parent: %c${C})`,
283
+ `Version mismatch (Child: %c${t}%c !== Parent: %c${_})`,
260
284
  l,
261
- v,
285
+ z,
262
286
  l
263
287
  );
264
288
  }
265
289
  }
266
- function T(e, t, n) {
290
+ function k(e, t, n) {
267
291
  if (!i[e]) return null;
268
292
  const o = i[e][t];
269
- if (typeof o !== ve)
293
+ if (typeof o !== we)
270
294
  throw new TypeError(`${t} on iframe[${e}] is not a function`);
271
295
  if (t !== "onBeforeClose" && t !== "onScroll")
272
- return Et(o, n);
296
+ return jt(o, n);
273
297
  try {
274
298
  return o(n);
275
- } catch (r) {
276
- return console.error(r), M(e, `Error in ${t} callback`), null;
299
+ } catch (s) {
300
+ return console.error(s), w(e, `Error in ${t} callback`), null;
277
301
  }
278
302
  }
279
- function dn(e, t) {
303
+ function wn(e, t) {
280
304
  const { id: n, iframe: o } = e;
281
305
  u(
282
306
  n,
283
307
  `onMessage passed: {iframe: %c${n}%c, message: %c${t}%c}`,
284
308
  l,
285
- v,
309
+ z,
286
310
  l,
287
- v
288
- ), T(n, "onMessage", {
311
+ z
312
+ ), k(n, "onMessage", {
289
313
  iframe: o,
290
314
  message: JSON.parse(t)
291
315
  });
292
316
  }
293
- function N(e, t) {
317
+ function x(e, t) {
294
318
  const { lastMessage: n } = i[e];
295
319
  return n.slice(
296
- n.indexOf(S) + yt + t
320
+ n.indexOf(L) + It + t
297
321
  );
298
322
  }
299
- function ie(e, t) {
300
- const { id: n, iframe: o, height: r, type: s, width: c } = t;
301
- let a = { x: 0, y: 0 };
302
- if (c === 0 && r === 0) {
303
- const f = N(n, 9).split(S);
304
- a = {
323
+ function se(e, t) {
324
+ const { id: n, iframe: o, height: s, type: a, width: r } = t;
325
+ let c = { x: 0, y: 0 };
326
+ if (r === 0 && s === 0) {
327
+ const f = x(n, 9).split(L);
328
+ c = {
305
329
  x: f[1],
306
330
  y: f[0]
307
331
  };
308
332
  } else
309
- a = {
310
- x: c,
311
- y: r
333
+ c = {
334
+ x: r,
335
+ y: s
312
336
  };
313
- T(n, e, {
337
+ k(n, e, {
314
338
  iframe: o,
315
- screenX: Number(a.x),
316
- screenY: Number(a.y),
317
- type: s
339
+ screenX: Number(c.x),
340
+ screenY: Number(c.y),
341
+ type: a
318
342
  });
319
343
  }
320
344
  const d = {
321
345
  position: null,
322
- version: C
346
+ version: _
323
347
  };
324
- function ke() {
348
+ function Ce() {
325
349
  d.position = null;
326
350
  }
327
- const hn = () => d.position;
328
- function gn(e) {
351
+ const En = () => d.position;
352
+ function On(e) {
329
353
  d.position = e;
330
354
  }
331
- function je(e) {
355
+ function Ne(e) {
332
356
  return d.position === null && (d.position = {
333
357
  x: window.scrollX,
334
358
  y: window.scrollY
@@ -336,38 +360,38 @@ function je(e) {
336
360
  e,
337
361
  `Get page position: %c${d.position.x}%c, %c${d.position.y}`,
338
362
  l,
339
- v,
363
+ z,
340
364
  l
341
365
  ), d.position;
342
366
  }
343
- function Le(e) {
367
+ function xe(e) {
344
368
  d.position !== null && (window.scrollTo(d.position.x, d.position.y), m(
345
369
  e,
346
370
  `Set page position: %c${d.position.x}%c, %c${d.position.y}`,
347
371
  l,
348
- v,
372
+ z,
349
373
  l
350
- ), ke());
374
+ ), Ce());
351
375
  }
352
376
  function re(e, t) {
353
377
  const { id: n } = t, o = `${t[e]}px`;
354
378
  i[n].iframe.style[e] = o, m(n, `Set ${e}: %c${o}`, l);
355
379
  }
356
- function Ae(e) {
380
+ function _e(e) {
357
381
  const { id: t } = e, { sizeHeight: n, sizeWidth: o } = i[t];
358
- n && re(ut, e), o && re(ft, e);
382
+ n && re(mt, e), o && re(bt, e);
359
383
  }
360
- function se(e) {
384
+ function ae(e) {
361
385
  const { id: t } = e;
362
- Ae(e), Le(t), T(t, "onResized", e);
386
+ _e(e), xe(t), k(t, "onResized", e);
363
387
  }
364
- function Pe(e) {
388
+ function Fe(e) {
365
389
  const { id: t } = e;
366
390
  u(t, "Disconnected from iframe"), delete i[t], delete e.iframeResizer;
367
391
  }
368
- function Ne(e) {
392
+ function Be(e) {
369
393
  const { id: t } = e;
370
- if (T(t, "onBeforeClose", t) === !1) {
394
+ if (k(t, "onBeforeClose", t) === !1) {
371
395
  u(t, "Close iframe cancelled by onBeforeClose");
372
396
  return;
373
397
  }
@@ -375,75 +399,85 @@ function Ne(e) {
375
399
  try {
376
400
  e.parentNode && e.remove();
377
401
  } catch (n) {
378
- M(t, n);
402
+ w(t, n);
379
403
  }
380
- T(t, "onAfterClose", t), Pe(e);
404
+ k(t, "onAfterClose", t), Fe(e);
381
405
  }
382
- function Ce(e) {
406
+ function We(e) {
383
407
  const { id: t, type: n } = e;
384
408
  u(
385
409
  t,
386
- `Size reset requested by ${n === $ ? "parent page" : "child page"}`
387
- ), je(t), Ae(e), O(H, H, t);
410
+ `Size reset requested by ${n === j ? "parent page" : "child page"}`
411
+ ), Ne(t), _e(e), T(U, U, t);
388
412
  }
389
- const xe = (e, t) => {
413
+ const De = (e, t) => {
390
414
  const n = {};
391
- return (o, r) => {
392
- const { iframe: s } = i[r];
393
- function c(f, p) {
415
+ return (o, s) => {
416
+ const { iframe: a } = i[s];
417
+ function r(f, p) {
394
418
  n[p] || (f(), n[p] = requestAnimationFrame(() => {
395
419
  n[p] = null;
396
420
  }));
397
421
  }
398
- function a() {
399
- O(`${o} (${e})`, `${e}:${t(s)}`, r);
422
+ function c() {
423
+ T(`${o} (${e})`, `${e}:${t(a)}`, s);
400
424
  }
401
- c(a, r);
425
+ r(c, s);
402
426
  };
403
- }, _e = (e) => (t) => {
427
+ }, He = (e) => (t) => {
404
428
  e in i[t] && (i[t][e](), delete i[t][e]);
405
- }, Fe = (e, t) => (n) => {
406
- let o = !1;
407
- const r = (h) => () => {
408
- i[n] ? (!o || o === h) && (e(h, n), o = h, requestAnimationFrame(() => {
409
- o = !1;
410
- })) : f();
411
- }, s = r(ee), c = r("resize window");
412
- function a(h, z) {
413
- u(n, `${h}listeners for send${t}`), z(window, ee, s), z(window, Z, c);
414
- }
415
- function f() {
416
- y(n, `stop${t}`), a("Remove ", oe), g.disconnect(), w.disconnect(), i[n] && oe(i[n].iframe, W, f);
417
- }
418
- function p() {
419
- a("Add ", j), g.observe(document.body), w.observe(i[n].iframe);
420
- }
421
- const g = new ResizeObserver(r("pageObserver")), w = new ResizeObserver(r("iframeObserver"));
422
- i[n] && (i[n][`stop${t}`] = f, j(i[n].iframe, W, f), p());
423
- };
424
- function mn(e) {
425
- const t = document.body.getBoundingClientRect(), n = e.getBoundingClientRect(), { scrollY: o, scrollX: r, innerHeight: s, innerWidth: c } = window, { clientHeight: a, clientWidth: f } = document.documentElement;
429
+ }, Ge = (
430
+ // eslint-disable-next-line @typescript-eslint/no-shadow
431
+ ((e, t) => (n) => {
432
+ let o = !1;
433
+ const s = (g) => () => {
434
+ i[n] ? (!o || o === g) && (e(g, n), o = g, requestAnimationFrame(() => {
435
+ o = !1;
436
+ })) : h();
437
+ }, a = s(te), r = s("resize window"), c = new ResizeObserver(s("pageObserver")), f = new ResizeObserver(s("iframeObserver"));
438
+ function p(g, E) {
439
+ u(n, `${g}listeners for send${t}`), E(window, te, a), E(window, Y, r);
440
+ }
441
+ function h() {
442
+ b(n, `stop${t}`), p("Remove ", ie), c.disconnect(), f.disconnect(), i[n] && ie(i[n].iframe, G, h);
443
+ }
444
+ function $() {
445
+ p("Add ", C), c.observe(document.body), f.observe(i[n].iframe);
446
+ }
447
+ i[n] && (i[n][`stop${t}`] = h, C(i[n].iframe, G, h), $());
448
+ })
449
+ );
450
+ function Tn(e) {
451
+ const t = document.body.getBoundingClientRect(), n = e.getBoundingClientRect(), { scrollY: o, scrollX: s, innerHeight: a, innerWidth: r } = window, { clientHeight: c, clientWidth: f } = document.documentElement;
426
452
  return JSON.stringify({
427
453
  iframeHeight: n.height,
428
454
  iframeWidth: n.width,
429
- clientHeight: Math.max(a, s || 0),
430
- clientWidth: Math.max(f, c || 0),
455
+ clientHeight: Math.max(c, a || 0),
456
+ clientWidth: Math.max(f, r || 0),
431
457
  offsetTop: Math.trunc(n.top - t.top),
432
458
  offsetLeft: Math.trunc(n.left - t.left),
433
459
  scrollTop: o,
434
- scrollLeft: r,
435
- documentHeight: a,
460
+ scrollLeft: s,
461
+ documentHeight: c,
436
462
  documentWidth: f,
437
- windowHeight: s,
438
- windowWidth: c
463
+ windowHeight: a,
464
+ windowWidth: r
439
465
  });
440
466
  }
441
- const bn = xe(me, mn), yn = Fe(
442
- bn,
467
+ const kn = De(be, Tn), In = Ge(
468
+ kn,
443
469
  "PageInfo"
444
- ), vn = _e("stopPageInfo");
445
- function wn(e) {
446
- const { scrollWidth: t, scrollHeight: n } = document.documentElement, { width: o, height: r, offsetLeft: s, offsetTop: c, pageLeft: a, pageTop: f, scale: p } = window.visualViewport;
470
+ ), $n = He("stopPageInfo");
471
+ function Mn(e) {
472
+ const { scrollWidth: t, scrollHeight: n } = document.documentElement, o = typeof window < "u" && window.visualViewport ? window.visualViewport : {}, {
473
+ width: s = 0,
474
+ height: a = 0,
475
+ offsetLeft: r = 0,
476
+ offsetTop: c = 0,
477
+ pageLeft: f = 0,
478
+ pageTop: p = 0,
479
+ scale: h = 1
480
+ } = o;
447
481
  return JSON.stringify({
448
482
  iframe: e.getBoundingClientRect(),
449
483
  document: {
@@ -451,69 +485,73 @@ function wn(e) {
451
485
  scrollHeight: n
452
486
  },
453
487
  viewport: {
454
- width: o,
455
- height: r,
456
- offsetLeft: s,
488
+ width: s,
489
+ height: a,
490
+ offsetLeft: r,
457
491
  offsetTop: c,
458
- pageLeft: a,
459
- pageTop: f,
460
- scale: p
492
+ pageLeft: f,
493
+ pageTop: p,
494
+ scale: h
461
495
  }
462
496
  });
463
497
  }
464
- const zn = xe(be, wn), En = Fe(
465
- zn,
498
+ const Sn = De(ve, Mn), jn = Ge(
499
+ Sn,
466
500
  "ParentInfo"
467
- ), On = _e("stopParentInfo");
468
- function Be(e) {
469
- const t = e.getBoundingClientRect(), n = je(e.id);
501
+ ), Rn = He("stopParentInfo");
502
+ function Ue(e) {
503
+ const t = e.getBoundingClientRect(), n = Ne(e.id);
470
504
  return {
471
505
  x: Number(t.left) + Number(n.x),
472
506
  y: Number(t.top) + Number(n.y)
473
507
  };
474
508
  }
475
- function We(e) {
476
- const { x: t, y: n } = hn(), o = i[e]?.iframe;
477
- if (T(e, "onScroll", { iframe: o, top: n, left: t, x: t, y: n }) === !1) {
478
- ke();
509
+ function Ve(e) {
510
+ const { x: t, y: n } = En(), o = i[e]?.iframe;
511
+ if (k(e, "onScroll", { iframe: o, top: n, left: t, x: t, y: n }) === !1) {
512
+ Ce();
479
513
  return;
480
514
  }
481
- Le(e);
515
+ xe(e);
482
516
  }
483
- function Tn(e) {
484
- const { id: t, height: n, width: o } = e, r = window.parentIframe || window.parentIFrame || window;
517
+ function Ln(e) {
518
+ const { id: t, height: n, width: o } = e, s = window.parentIframe || window.parentIFrame || window;
485
519
  m(
486
520
  t,
487
521
  `scrollBy: x: %c${o}%c y: %c${n}`,
488
522
  l,
489
- v,
523
+ z,
490
524
  l
491
- ), r.scrollBy(o, n);
525
+ ), s.scrollBy(o, n);
492
526
  }
493
- const He = (e) => (t) => {
494
- function n(h) {
495
- gn(h), We(s);
527
+ const qe = (e) => (t) => {
528
+ const { id: n, iframe: o, height: s, width: a } = t;
529
+ function r(g) {
530
+ On(g), Ve(n);
496
531
  }
497
- function o(h, z) {
498
- h[`scrollTo${e ? "Offset" : ""}`](z.x, z.y);
532
+ function c(g, E) {
533
+ g[`scrollTo${e ? "Offset" : ""}`](
534
+ E.x,
535
+ E.y
536
+ );
499
537
  }
500
- const r = (h) => ({
501
- x: f + h.x,
502
- y: a + h.y
503
- }), { id: s, iframe: c, height: a, width: f } = t, p = e ? Be(c) : { x: 0, y: 0 }, g = r(p), w = window.parentIframe || window.parentIFrame;
538
+ const f = (g) => ({
539
+ x: a + g.x,
540
+ y: s + g.y
541
+ }), p = e ? Ue(o) : { x: 0, y: 0 }, h = f(p), $ = window.parentIframe || window.parentIFrame;
504
542
  m(
505
- s,
543
+ n,
506
544
  `Reposition requested (offset x:%c${p.x}%c y:%c${p.y})`,
507
545
  l,
508
- v,
546
+ z,
509
547
  l
510
- ), w ? o(w, g) : n(g);
511
- }, In = He(!1), Mn = He(!0);
512
- function $n(e, t, n) {
513
- const { x: o, y: r } = Be(n);
514
- m(e, `Moving to in page link: %c#${t}`, l), d.position = { x: o, y: r }, We(e), window.location.hash = t;
548
+ ), $ ? c($, h) : r(h);
549
+ }, An = qe(!1), Pn = qe(!0);
550
+ function Cn(e, t, n) {
551
+ const { x: o, y: s } = Ue(n);
552
+ m(e, `Moving to in page link: %c#${t}`, l), d.position = { x: o, y: s }, Ve(e), window.location.hash = t;
515
553
  }
516
- function Sn(e, t) {
554
+ function Nn(e, t) {
517
555
  const n = window.parentIframe || window.parentIFrame;
518
556
  if (!n) {
519
557
  u(e, `In page link #${t} not found`);
@@ -521,44 +559,52 @@ function Sn(e, t) {
521
559
  }
522
560
  n.moveToAnchor(t);
523
561
  }
524
- function Rn(e, t) {
525
- const n = t.split("#")[1] || "", o = decodeURIComponent(n), r = document.getElementById(o) || document.getElementsByName(o)[0];
526
- if (r) {
527
- $n(e, n, r);
562
+ function xn(e, t) {
563
+ const n = t.split("#")[1] || "", o = decodeURIComponent(n), s = document.getElementById(o) || document.getElementsByName(o)[0];
564
+ if (s) {
565
+ Cn(e, n, s);
528
566
  return;
529
567
  }
530
568
  if (window.top === window.self) {
531
569
  u(e, `In page link #${n} not found`);
532
570
  return;
533
571
  }
534
- Sn(e, n);
572
+ Nn(e, n);
535
573
  }
536
- function kn(e) {
574
+ function _n(e) {
537
575
  const t = i[e]?.iframe?.title;
538
576
  return t === "" || t === void 0;
539
577
  }
540
- function jn(e, t) {
578
+ function Fn(e, t) {
541
579
  i[e]?.syncTitle && (i[e].iframe.title = t, m(e, `Set iframe title attribute: %c${t}`, l));
542
580
  }
543
- const ce = (e) => {
581
+ const W = (e) => {
544
582
  if (!e) return "";
545
583
  let t = -559038744, n = 1103547984;
546
- for (let o, r = 0; r < e.length; r++)
547
- o = e.codePointAt(r), t = Math.imul(t ^ o, 2246822519), n = Math.imul(n ^ o, 3266489917);
584
+ for (let o, s = 0; s < e.length; s++)
585
+ o = e.codePointAt(s), t = Math.imul(t ^ o, 2246822519), n = Math.imul(n ^ o, 3266489917);
548
586
  return t ^= Math.imul(t ^ n >>> 15, 1935289751), n ^= Math.imul(n ^ t >>> 15, 3405138345), t ^= n >>> 16, n ^= t >>> 16, (2097152 * (n >>> 0) + (t >>> 11)).toString(36);
549
- }, E = (e) => e.replace(
587
+ }, v = (e) => e.replace(
550
588
  /[A-Za-z]/g,
551
589
  (t) => String.fromCodePoint(
552
590
  (t <= "Z" ? 90 : 122) >= (t = t.codePointAt(0) + 19) ? t : t - 26
553
591
  )
554
- ), L = ["spjluzl", "rlf", "clyzpvu", "rlf2"], Ln = [
592
+ ), Bn = /* @__PURE__ */ new Date(), Ze = (e) => new Set(Array.from({ length: 9 }, e)), ce = " - lewpylk", R = ["spjluzl", "rlf", "clyzpvu", "rlf2", "nlaMbssFlhy"], Wn = [
555
593
  "<yi>Puchspk Spjluzl Rlf</><iy><iy>",
556
594
  "<yi>Tpzzpun Spjluzl Rlf</><iy><iy>",
557
595
  "Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>",
558
596
  "<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.",
559
597
  "<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.",
560
- "Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."
561
- ], An = ["NWSc3", "zvsv", "wyv", "ibzpulzz", "vlt"], ae = Object.fromEntries(
598
+ "Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz.",
599
+ "<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.</><iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> fvb jhu bzl aol <i>mpyza 11 johyhjalyz vm fvb spjluzl rlf</> av nla h 60% kpzjvbua ha oaawz://pmyhtl-ylzpgly.jvt/wypjpun.",
600
+ "<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.<iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> vm <p>pmyhtl-ylzpgly</> wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz.",
601
+ "<yi> VLT rlf lewpylk</><iy><iy>Aol spjluzl rlf fvb hyl bzpun mvy <p>pmyhtl-ylzpgly</> pz myvt h wypvy flhy huk ohz lewpylk. Hu bwkhalk rlf pz ylslhzlk vu aol mpyza vm Uvcltily lhjo flhy.<iy><iy>Wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz."
602
+ ], Dn = (e) => [
603
+ e[0],
604
+ ...e.slice(1).map((t) => `${t}${ce}`),
605
+ `${e[4]}${ce}`,
606
+ ...e.slice(1)
607
+ ], Hn = Dn(["NWSc3", "zvsv", "wyv", "ibzpulzz", "VLT"]), le = Object.fromEntries(
562
608
  [
563
609
  "2cgs7fdf4xb",
564
610
  "1c9ctcccr4z",
@@ -566,103 +612,120 @@ const ce = (e) => {
566
612
  "ueokt0969w",
567
613
  "w2zxchhgqz",
568
614
  "1umuxblj2e5",
615
+ "1foobarqaz",
569
616
  "2b5sdlfhbev",
570
617
  "zo4ui3arjo",
571
- "oclbb4thgl"
618
+ "oclbb4thgl",
619
+ "igb1wzrjqr"
572
620
  ].map((e, t) => [e, Math.max(0, t - 1)])
573
- ), A = (e) => E(Ln[e]), Pn = (e) => E(An[e]), Nn = (e) => {
574
- const t = e[E(L[0])] || e[E(L[1])] || e[E(L[2])] || e[E(L[3])];
621
+ ), Je = Bn[v(R[4])](), Gn = Ze((e, t) => W(`${Je + t}`)), Un = Ze((e, t) => W(`${Je - ++t}`)), Vn = (e) => Gn.has(e) ? 9 : Un.has(e) ? 5 : -2, O = (e) => v(Wn[e]), qn = (e) => v(Hn[e]), Zn = (e) => {
622
+ const t = e[v(R[0])] || e[v(R[1])] || e[v(R[2])] || e[v(R[3])];
575
623
  if (!t) return -1;
576
624
  const n = t.split("-");
577
- let o = (function(r = "") {
578
- let s = -2;
579
- const c = ce(E(r));
580
- return c in ae && (s = ae[c]), s > 4 ? s - 4 : s;
581
- })(n[0]);
582
- return o === 0 || ((r) => r[2] === ce(r[0] + r[1]))(n) || (o = -2), o;
625
+ let o = (function(s = "", a = "") {
626
+ let r = -2;
627
+ const c = W(v(s));
628
+ return c in le && (r = le[c]), r === 9 ? Vn(a) : r;
629
+ })(...n);
630
+ return o === 0 || ((s) => s[2] === W(s[0] + s[1]))(n) || (o = -2), o;
583
631
  };
584
- let q = !1, De = !1;
585
- function Ge(e, t = -3) {
586
- if (q) return;
632
+ let J = !1, Ye = !1;
633
+ function Xe(e, t = -3) {
634
+ if (J) return;
587
635
  const n = Math.max(i[e].mode, t);
588
636
  if (n > i[e].mode && (i[e].mode = n), n < 0)
589
- throw Wt(e), i[e].vAdvised || b(e || "Parent", `${A(n + 2)}${A(2)}`), i[e].vAdvised = !0, A(n + 2).replace(/<\/?[a-z][^>]*>|<\/>/gi, "");
590
- n > 0 && De || Dt(`v${C} (${Pn(n)})`, n), n < 1 && b("Parent", A(3)), q = !0;
637
+ throw Jt(e), i[e].vAdvised || y(e || "Parent", `${O(n + 2)}${O(2)}`), i[e].vAdvised = !0, O(n + 2).replace(/<\/?[a-z][^>]*>|<\/>/gi, "");
638
+ switch (n > 5 && Ye || Xt(`v${_} (${qn(n)})`, n), n) {
639
+ case 1:
640
+ case 2:
641
+ case 3:
642
+ y("Parent", O(6));
643
+ break;
644
+ case 4:
645
+ y("Parent", O(7));
646
+ break;
647
+ case 5:
648
+ y("Parent", O(8));
649
+ break;
650
+ default:
651
+ n < 1 && y("Parent", O(3));
652
+ }
653
+ J = !0;
591
654
  }
592
- function Cn(e) {
593
- if (q) return;
655
+ function Jn(e) {
656
+ if (J) return;
594
657
  const { mode: t } = i[e];
595
- t !== -1 && Ge(e, t);
658
+ t > 5 && Xe(e, t);
596
659
  }
597
- function xn(e) {
598
- e?.log === -1 && (e.log = !1, De = !0);
660
+ function Yn(e) {
661
+ e?.log === -1 && (e.log = !1, Ye = !0);
599
662
  }
600
- function _n(e, t) {
601
- i[e] && (u(e, `First run for ${e}`), Ge(e, t !== void 0 ? Number(t) : void 0), i[e].firstRun = !1);
663
+ function Xn(e, t) {
664
+ i[e] && (u(e, `First run for ${e}`), Xe(e, t === void 0 ? void 0 : Number(t)), i[e].firstRun = !1);
602
665
  }
603
- function Fn(e) {
604
- const { height: t, id: n, iframe: o, mode: r, message: s, type: c, width: a } = e, { lastMessage: f } = i[n];
605
- switch (i[n]?.firstRun && _n(n, r), u(n, `Received: %c${f}`, l), c) {
606
- case de:
607
- i[n].autoResize = JSON.parse(N(n, 9));
666
+ function Kn(e) {
667
+ const { height: t, id: n, iframe: o, mode: s, message: a, type: r, width: c } = e, { lastMessage: f } = i[n];
668
+ switch (i[n]?.firstRun && Xn(n, s), u(n, `Received: %c${f}`, l), r) {
669
+ case ge:
670
+ i[n].autoResize = JSON.parse(x(n, 9));
608
671
  break;
609
- case Ke:
672
+ case st:
610
673
  m(n, "Ready state reset"), i[n].initialised = !1;
611
674
  break;
612
- case Qe:
613
- Ne(o);
614
- break;
615
- case et:
616
- Rn(n, N(n, 9));
675
+ case rt:
676
+ Be(o);
617
677
  break;
618
- case $:
619
- se(e), fn(n), pn(n, s), i[n].initialised = !0, T(n, "onReady", o);
678
+ case at:
679
+ xn(n, x(n, 9));
620
680
  break;
621
- case R:
622
- dn(e, N(n, 6));
681
+ case j:
682
+ ae(e), vn(n), zn(n, a), i[n].initialised = !0, k(n, "onReady", o);
623
683
  break;
624
- case nt:
625
- ie("onMouseEnter", e);
684
+ case A:
685
+ wn(e, x(n, 6));
626
686
  break;
627
- case ot:
628
- ie("onMouseLeave", e);
687
+ case lt:
688
+ se("onMouseEnter", e);
629
689
  break;
630
- case me:
631
- yn(n);
690
+ case ut:
691
+ se("onMouseLeave", e);
632
692
  break;
633
693
  case be:
634
- En(n);
694
+ In(n);
635
695
  break;
636
- case it:
637
- vn(n);
696
+ case ve:
697
+ jn(n);
638
698
  break;
639
- case rt:
640
- On(n);
699
+ case ft:
700
+ $n(n);
641
701
  break;
642
- case H:
643
- Ce(e);
702
+ case pt:
703
+ Rn(n);
644
704
  break;
645
- case st:
646
- Tn(e);
705
+ case U:
706
+ We(e);
647
707
  break;
648
- case ct:
649
- In(e);
708
+ case ht:
709
+ Ln(e);
650
710
  break;
651
- case at:
652
- Mn(e);
711
+ case dt:
712
+ An(e);
653
713
  break;
654
- case lt:
655
- jn(n, s);
714
+ case gt:
715
+ Pn(e);
716
+ break;
717
+ case yt:
718
+ Fn(n, a);
656
719
  break;
657
720
  default:
658
- if (a === 0 && t === 0) {
659
- M(
721
+ if (c === 0 && t === 0) {
722
+ w(
660
723
  n,
661
- `Unsupported message received (${c}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`
724
+ `Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`
662
725
  );
663
726
  return;
664
727
  }
665
- if (a === 0 || t === 0) {
728
+ if (c === 0 || t === 0) {
666
729
  u(n, "Ignoring message with 0 height or width");
667
730
  return;
668
731
  }
@@ -670,49 +733,52 @@ function Fn(e) {
670
733
  u(n, "Page hidden - ignored resize request");
671
734
  return;
672
735
  }
673
- se(e);
736
+ ae(e);
674
737
  }
675
738
  }
676
- const Bn = (e) => ({ initChild: t, postMessageTarget: n }) => {
739
+ const Qn = (e) => ({
740
+ initChild: t,
741
+ postMessageTarget: n
742
+ }) => {
677
743
  e === n && t();
678
- }, Wn = (e) => Object.values(i).forEach(Bn(e));
679
- function le(e) {
744
+ }, eo = (e) => Object.values(i).forEach(Qn(e));
745
+ function ue(e) {
680
746
  const t = e.data;
681
- if (t === Xe) {
682
- Wn(e.source);
747
+ if (t === it) {
748
+ eo(e.source);
683
749
  return;
684
750
  }
685
- if (!ln(t)) {
686
- if (typeof t !== J) return;
687
- y(D, "ignoredMessage"), Ft(D, t);
751
+ if (!mn(t)) {
752
+ if (typeof t !== X) return;
753
+ b(V, "ignoredMessage"), qt(V, t);
688
754
  return;
689
755
  }
690
- const n = rn(t), { id: o, type: r } = n;
691
- switch (y(o, r), !0) {
756
+ const n = hn(t), { id: o, type: s } = n;
757
+ switch (b(o, s), !0) {
692
758
  case !i[o]:
693
- throw new Error(`${r} No settings for ${o}. Message was: ${t}`);
694
- case !cn(n):
695
- case un(n):
696
- case !an(n, e):
759
+ throw new Error(`${s} No settings for ${o}. Message was: ${t}`);
760
+ case !gn(n):
761
+ case bn(n):
762
+ case !yn(n, e):
697
763
  return;
698
764
  default:
699
- i[o].lastMessage = e.data, Re(o, Fn)(n);
765
+ i[o].lastMessage = e.data, Pe(o, Kn)(n);
700
766
  }
701
767
  }
702
- const Hn = Ot(() => {
703
- j(window, R, le), j(document, "visibilitychange", tn), window.iframeParentListener = (e) => setTimeout(() => le({ data: e, sameOrigin: !0 }));
704
- }), ue = {};
705
- function Dn(e) {
706
- if (ue[e] === !0) return !1;
768
+ const to = Rt(() => {
769
+ C(window, A, ue), C(document, "visibilitychange", un), window.iframeParentListener = (e) => setTimeout(() => ue({ data: e, sameOrigin: !0 }));
770
+ }), fe = {};
771
+ function no(e) {
772
+ if (fe[e] === !0) return !1;
707
773
  const t = document.querySelectorAll(`iframe#${CSS.escape(e)}`);
708
774
  if (t.length <= 1) return !0;
709
- ue[e] = !0;
775
+ fe[e] = !0;
710
776
  const n = Array.from(t).flatMap((o) => [
711
- P,
777
+ N,
712
778
  o,
713
- P
779
+ N
714
780
  ]);
715
- return b(
781
+ return y(
716
782
  e,
717
783
  `<rb>Duplicate ID attributes detected</>
718
784
 
@@ -720,198 +786,198 @@ The <b>${e}</> ID is not unique. Having multiple iframes on the same page with t
720
786
 
721
787
  Found <bb>${t.length}</> iframes with the <b>${e}</> ID:`,
722
788
  ...n,
723
- P
789
+ N
724
790
  ), !1;
725
791
  }
726
- const Gn = `<rb>Deprecated Method Name</>
792
+ const oo = `<rb>Deprecated Method Name</>
727
793
 
728
- The <b>removeListeners()</> method has been renamed to <b>disconnect()</>. ${Oe}`, Un = `<rb>Deprecated Method</>
794
+ The <b>removeListeners()</> method has been renamed to <b>disconnect()</>. ${Me}`, io = `<rb>Deprecated Method</>
729
795
 
730
796
  Use of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As there are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code.`;
731
- function Vn(e) {
797
+ function so(e) {
732
798
  if (i[e]) {
733
799
  const { iframe: t } = i[e], n = {
734
- close: Ne.bind(null, t),
735
- disconnect: Pe.bind(null, t),
800
+ close: Be.bind(null, t),
801
+ disconnect: Fe.bind(null, t),
736
802
  moveToAnchor(o) {
737
- St(o, J, "moveToAnchor(anchor) anchor"), O("Move to anchor", `moveToAnchor:${o}`, e);
803
+ Nt(o, X, "moveToAnchor(anchor) anchor"), T("Move to anchor", `moveToAnchor:${o}`, e);
738
804
  },
739
805
  removeListeners() {
740
- b(e, Gn), this.disconnect();
806
+ y(e, oo), this.disconnect();
741
807
  },
742
808
  resize() {
743
- b(e, Un), O("Window resize", Z, e);
809
+ y(e, io), T("Window resize", Y, e);
744
810
  },
745
811
  sendMessage(o) {
746
- o = JSON.stringify(o), O(R, `${R}:${o}`, e);
812
+ o = JSON.stringify(o), T(A, `${A}:${o}`, e);
747
813
  }
748
814
  };
749
815
  t.iframeResizer = n, t.iFrameResizer = n;
750
816
  }
751
817
  }
752
- const qn = "8", Zn = "32", Jn = gt, Yn = !0;
753
- function Xn(e) {
818
+ const ro = "8", ao = "32", co = Et, lo = !0;
819
+ function uo(e) {
754
820
  const {
755
821
  autoResize: t,
756
822
  bodyBackground: n,
757
823
  bodyMargin: o,
758
- bodyPadding: r,
759
- heightCalculationMethod: s,
760
- inPageLinks: c,
761
- license: a,
824
+ bodyPadding: s,
825
+ heightCalculationMethod: a,
826
+ inPageLinks: r,
827
+ license: c,
762
828
  log: f,
763
829
  logExpand: p,
764
- mouseEvents: g,
765
- offsetHeight: w,
766
- offsetWidth: h,
767
- mode: z,
768
- sizeHeight: Ue,
830
+ mouseEvents: h,
831
+ offsetHeight: $,
832
+ offsetWidth: g,
833
+ mode: E,
834
+ sizeHeight: Ke,
769
835
  // sizeSelector,
770
- sizeWidth: Ve,
771
- tolerance: qe,
772
- widthCalculationMethod: Ze
836
+ sizeWidth: Qe,
837
+ tolerance: et,
838
+ widthCalculationMethod: tt
773
839
  } = i[e];
774
840
  return [
775
841
  e,
776
- qn,
777
- Ve,
842
+ ro,
843
+ Qe,
778
844
  f,
779
- Zn,
780
- Yn,
845
+ ao,
846
+ lo,
781
847
  t,
782
848
  o,
783
- s,
849
+ a,
784
850
  n,
851
+ s,
852
+ et,
785
853
  r,
786
- qe,
787
- c,
788
- Jn,
789
- Ze,
790
- g,
791
- w,
854
+ co,
855
+ tt,
792
856
  h,
793
- Ue,
794
- a,
857
+ $,
858
+ g,
859
+ Ke,
860
+ c,
795
861
  d.version,
796
- z,
862
+ E,
797
863
  "",
798
864
  // sizeSelector,
799
865
  p
800
- ].join(S);
866
+ ].join(L);
801
867
  }
802
- const Kn = "0";
803
- function Qn(e) {
868
+ const fo = "0";
869
+ function po(e) {
804
870
  const { bodyMargin: t } = i[e];
805
- (typeof t === mt || t === Kn) && (i[e].bodyMargin = `${t}px`);
871
+ (typeof t === Ot || t === fo) && (i[e].bodyMargin = `${t}px`);
806
872
  }
807
- const eo = (e) => {
873
+ const ho = (e) => {
808
874
  try {
809
875
  return new URL(e).origin;
810
876
  } catch {
811
877
  return null;
812
878
  }
813
- }, to = (e) => typeof e === ye && e.length > 0 && !(e.contains("allow-scripts") && e.contains("allow-same-origin"));
814
- function no(e, t) {
879
+ }, go = (e) => typeof e === ze && e.length > 0 && !(e.contains("allow-scripts") && e.contains("allow-same-origin"));
880
+ function yo(e, t) {
815
881
  const {
816
882
  checkOrigin: n,
817
- iframe: { src: o, sandbox: r },
818
- initialisedFirstPage: s,
819
- waitForLoad: c
820
- } = t[e], a = eo(o);
821
- y(e, "noResponse"), b(
883
+ iframe: { src: o, sandbox: s },
884
+ initialisedFirstPage: a,
885
+ waitForLoad: r
886
+ } = t[e], c = ho(o);
887
+ b(e, "noResponse"), y(
822
888
  e,
823
889
  `<rb>No response from iframe</>
824
890
 
825
891
  The iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout / 1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.
826
- ${n && a ? `
827
- The <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${a}</>, then the connection to the iframe may be blocked by the browser. To disable this option, set <b>checkOrigin</> to <bb>false</> or an array of allowed origins. See <u>https://iframe-resizer.com/checkorigin</> for more information.
828
- ` : ""}${c && !s ? `
892
+ ${n && c ? `
893
+ The <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${c}</>, then the connection to the iframe may be blocked by the browser. To disable this option, set <b>checkOrigin</> to <bb>false</> or an array of allowed origins. See <u>https://iframe-resizer.com/checkorigin</> for more information.
894
+ ` : ""}${r && !a ? `
829
895
  The <b>waitForLoad</> option is currently set to <bb>true</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <bb>false</>.
830
- ` : ""}${to(r) ? `
896
+ ` : ""}${go(s) ? `
831
897
  The iframe has the <b>sandbox</> attribute, please ensure it contains both the <bb>allow-same-origin</> and <bb>allow-scripts</> values.
832
898
  ` : ""}
833
899
  This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.
834
900
  `
835
901
  );
836
902
  }
837
- function oo(e, t) {
903
+ function mo(e, t) {
838
904
  function n() {
839
905
  if (t[e] === void 0) return;
840
- const { initialised: s, loadErrorShown: c } = t[e];
841
- if (t[e].msgTimeout = void 0, s) {
906
+ const { initialised: a, loadErrorShown: r } = t[e];
907
+ if (t[e].msgTimeout = void 0, a) {
842
908
  t[e].initialisedFirstPage = !0;
843
909
  return;
844
910
  }
845
- c || (t[e].loadErrorShown = !0, no(e, t));
911
+ r || (t[e].loadErrorShown = !0, yo(e, t));
846
912
  }
847
- const { msgTimeout: o, warningTimeout: r } = t[e];
848
- r && (o && clearTimeout(o), t[e].msgTimeout = setTimeout(n, r));
913
+ const { msgTimeout: o, warningTimeout: s } = t[e];
914
+ s && (o && clearTimeout(o), t[e].msgTimeout = setTimeout(n, s));
849
915
  }
850
- const io = 1, ro = (e) => e.loading === tt, so = (e) => e === $;
851
- function co(e) {
852
- i[e]?.heightCalculationMethod in vt && Ce({
916
+ const bo = 1, vo = (e) => e.loading === ct, zo = (e) => e === j;
917
+ function wo(e) {
918
+ i[e]?.heightCalculationMethod in $t && We({
853
919
  id: e,
854
920
  iframe: i[e].iframe,
855
- height: Q,
856
- width: Q,
857
- type: $
921
+ height: ee,
922
+ width: ee,
923
+ type: j
858
924
  });
859
925
  }
860
- function ao(e, t) {
861
- j(e, W, () => setTimeout(t, io));
926
+ function Eo(e, t) {
927
+ C(e, G, () => setTimeout(t, bo));
862
928
  }
863
- const lo = (e) => {
929
+ const Oo = (e) => {
864
930
  const { src: t, srcdoc: n } = e;
865
931
  return !n && (t == null || t === "" || t === "about:blank");
866
932
  };
867
- function uo(e, t) {
933
+ function To(e, t) {
868
934
  const { iframe: n, waitForLoad: o } = i[e];
869
935
  if (o !== !0) {
870
- if (lo(n)) {
936
+ if (Oo(n)) {
871
937
  setTimeout(() => {
872
- y(e, "noContent"), m(e, "No content detected in the iframe, delaying initialisation");
938
+ b(e, "noContent"), m(e, "No content detected in the iframe, delaying initialisation");
873
939
  });
874
940
  return;
875
941
  }
876
942
  setTimeout(t);
877
943
  }
878
944
  }
879
- function fo(e, t) {
880
- const n = (r) => () => {
945
+ function ko(e, t) {
946
+ const n = (s) => () => {
881
947
  if (!i[e]) return;
882
- const { firstRun: s, iframe: c } = i[e];
883
- O(r, t, e), so(r) && ro(c) || oo(e, i), s || co(e);
948
+ const { firstRun: a, iframe: r } = i[e];
949
+ T(s, t, e), zo(s) && vo(r) || mo(e, i), a || wo(e);
884
950
  }, { iframe: o } = i[e];
885
- i[e].initChild = n(he), ao(o, n(ge)), uo(e, n($));
951
+ i[e].initChild = n(ye), Eo(o, n(me)), To(e, n(j));
886
952
  }
887
- function po(e, t) {
888
- return t ? (("sizeWidth" in t || "sizeHeight" in t || de in t) && b(
953
+ function Io(e, t) {
954
+ return t ? (("sizeWidth" in t || "sizeHeight" in t || ge in t) && y(
889
955
  e,
890
956
  `<rb>Deprecated Option</>
891
957
 
892
- The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${F}</>, <bb>${Ee}</>, <bb>${ze}</> or <bb>${we}</>.
958
+ The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${D}</>, <bb>${Te}</>, <bb>${Oe}</> or <bb>${Ee}</>.
893
959
  `
894
960
  ), t) : {};
895
961
  }
896
- function ho(e) {
962
+ function $o(e) {
897
963
  i[e].warningTimeout || m(e, "warningTimeout:%c disabled", l);
898
964
  }
899
- function go(e, { offset: t, offsetSize: n }) {
965
+ function Mo(e, { offset: t, offsetSize: n }) {
900
966
  const o = n || t;
901
- o && (i[e].direction === F ? (i[e].offsetHeight = o, u(e, `Offset height: %c${o}`, l)) : (i[e].offsetWidth = o, u(e, `Offset width: %c${o}`, l)));
967
+ o && (i[e].direction === D ? (i[e].offsetHeight = o, u(e, `Offset height: %c${o}`, l)) : (i[e].offsetWidth = o, u(e, `Offset width: %c${o}`, l)));
902
968
  }
903
- function mo(e) {
969
+ function So(e) {
904
970
  const { direction: t } = i[e];
905
971
  switch (t) {
906
- case F:
972
+ case D:
907
973
  break;
908
- case Ee:
974
+ case Te:
909
975
  i[e].sizeHeight = !1;
910
976
  // eslint-disable-next-line no-fallthrough
911
- case ze:
977
+ case Oe:
912
978
  i[e].sizeWidth = !0;
913
979
  break;
914
- case we:
980
+ case Ee:
915
981
  i[e].sizeWidth = !1, i[e].sizeHeight = !1, i[e].autoResize = !1;
916
982
  break;
917
983
  default:
@@ -919,84 +985,92 @@ function mo(e) {
919
985
  }
920
986
  u(e, `direction: %c${t}`, l);
921
987
  }
922
- const bo = (e) => e === "" || e.match(/^(about:blank|javascript:|file:\/\/)/) !== null ? "*" : e;
923
- function yo(e) {
924
- i[e].targetOrigin = i[e].checkOrigin === !0 ? bo(i[e].remoteHost) : "*";
988
+ const pe = (e) => e === "" || e.match(/^(about:blank|javascript:|file:\/\/)/) !== null ? "*" : e;
989
+ function jo(e) {
990
+ const { checkOrigin: t, remoteHost: n } = i[e];
991
+ Array.isArray(t) && t.length === 0 && w(
992
+ e,
993
+ "checkOrigin is an empty array — no messages will be sent to the iframe"
994
+ ), i[e].targetOrigin = Array.isArray(t) ? t.map(pe) : [t === !1 ? "*" : pe(n)];
925
995
  }
926
- function vo(e) {
996
+ function Ro(e) {
927
997
  const { id: t } = e;
928
998
  i[t].postMessageTarget === null && (i[t].postMessageTarget = e.contentWindow);
929
999
  }
930
- function B(e, t, n) {
931
- k(i[e], t) && (b(
1000
+ function H(e, t, n) {
1001
+ P(i[e], t) && (y(
932
1002
  e,
933
1003
  `<rb>Deprecated option</>
934
1004
 
935
- The <b>${t}</> option has been renamed to <b>${n}</>. ${Oe}`
1005
+ The <b>${t}</> option has been renamed to <b>${n}</>. ${Me}`
936
1006
  ), i[e][n] = i[e][t], delete i[e][t]);
937
1007
  }
938
- function wo(e) {
939
- B(e, pt, dt), B(e, "onClose", "onBeforeClose"), B(e, "onClosed", "onAfterClose");
1008
+ function Lo(e) {
1009
+ H(e, vt, zt), H(e, "onClose", "onBeforeClose"), H(e, "onClosed", "onAfterClose");
940
1010
  }
941
- const zo = (e) => k(e, "onMouseEnter") || k(e, "onMouseLeave");
942
- function Eo(e, t) {
1011
+ const Ao = (e) => P(e, "onMouseEnter") || P(e, "onMouseLeave");
1012
+ function Po(e, t) {
943
1013
  const { id: n } = e;
944
1014
  i[n] = {
945
1015
  ...i[n],
946
1016
  iframe: e,
947
1017
  remoteHost: e?.src.split("/").slice(0, 3).join("/"),
948
- ..._,
949
- ...po(n, t),
950
- mouseEvents: zo(t),
951
- mode: Nn(t),
952
- syncTitle: kn(n)
953
- }, wo(n), mo(n), go(n, t), ho(n), vo(e), yo(n);
954
- }
955
- const Oo = "yes", fe = "no", To = "omit";
956
- function Io(e) {
1018
+ ...B,
1019
+ ...Io(n, t),
1020
+ mouseEvents: Ao(t),
1021
+ mode: Zn(t),
1022
+ syncTitle: _n(n)
1023
+ }, Lo(n), So(n), Mo(n, t), $o(n), Ro(e), jo(n);
1024
+ }
1025
+ const Co = "yes", he = "no";
1026
+ function No(e) {
957
1027
  const { id: t } = e;
958
1028
  switch (u(
959
1029
  t,
960
1030
  `Iframe scrolling ${i[t]?.scrolling ? "enabled" : "disabled"} for ${t}`
961
- ), e.style.overflow = i[t]?.scrolling === !1 ? ht : G, i[t]?.scrolling) {
962
- case To:
1031
+ ), e.style.overflow = i[t]?.scrolling === !1 ? wt : q, i[t]?.scrolling) {
1032
+ case kt:
963
1033
  break;
964
1034
  case !0:
965
- e.scrolling = Oo;
1035
+ e.scrolling = Co;
966
1036
  break;
967
1037
  case !1:
968
- e.scrolling = fe;
1038
+ e.scrolling = he;
969
1039
  break;
970
1040
  default:
971
- e.scrolling = i[t]?.scrolling || fe;
1041
+ e.scrolling = i[t]?.scrolling || he;
972
1042
  }
973
1043
  }
974
- function Mo(e, t, n) {
975
- Eo(t, n), u(e, `src: %c${t.srcdoc || t.src}`, l), Cn(e), Io(t), Qn(e), fo(e, Xn(e)), Vn(e), u(e, "Setup complete");
1044
+ function xo(e, t, n) {
1045
+ Po(t, n), u(e, `src: %c${t.srcdoc || t.src}`, l), Jn(e), No(t), po(e), ko(e, uo(e)), so(e), u(e, "Setup complete");
976
1046
  }
977
- function $o(e, t) {
1047
+ function _o(e, t) {
978
1048
  const { id: n } = e;
979
- y(n, "setup"), Dn(n) && Mo(n, e, t), Ht(n);
1049
+ b(n, "setup"), no(n) && xo(n, e, t), Yt(n);
980
1050
  }
981
- function So(e, t) {
982
- const n = k(t, "log"), o = X(t.log), r = n ? o ? !0 : t.log : _.log;
983
- k(t, "logExpand") || (t.logExpand = n && o ? t.log === V : _.logExpand), xn(t), _t({
984
- enabled: r,
1051
+ function Fo(e, t) {
1052
+ t.log === ke ? t.log = !1 : t.log === Ie ? t.log = S : t.log === $e && (t.log = M);
1053
+ const n = P(t, "log"), o = K(t.log), s = n ? o ? !0 : t.log : B.log;
1054
+ P(t, "logExpand") || (t.logExpand = n && o ? t.log === M : B.logExpand), Yn(t), Vt({
1055
+ enabled: s,
985
1056
  expand: t.logExpand,
986
1057
  iframeId: e
987
- }), o && !(t.log in wt) && Bt(
1058
+ }), o && !(t.log in Mt) && Zt(
988
1059
  e,
989
- `Invalid value for options.log: Accepted values are "${V}" and "${Y}"`
990
- ), t.log = r;
991
- }
992
- function ko(e) {
993
- if (!Te(e)) throw new TypeError("Options is not an object");
994
- return Hn(), Xt(e), (t) => {
995
- const n = Yt(t, e);
996
- return pe in t ? (y(n, "alreadySetup"), M(n, `Ignored iframe (${n}), already setup.`)) : (So(n, e), Re(n, $o)(t, e)), t?.iframeResizer;
1060
+ `Invalid value for options.log: Accepted values are "${M}" and "${S}"`
1061
+ ), t.log = s;
1062
+ }
1063
+ function Wo(e) {
1064
+ if (!Se(e)) throw new TypeError("Options is not an object");
1065
+ return to(), rn(e), (t) => {
1066
+ const n = sn(t, e);
1067
+ return de in t ? (b(n, "alreadySetup"), w(n, `Ignored iframe (${n}), already setup.`)) : (Fo(n, e), Pe(n, _o)(t, e)), t?.iframeResizer;
997
1068
  };
998
1069
  }
999
1070
  export {
1000
- ko as default
1071
+ Ie as LOG_COLLAPSED,
1072
+ ke as LOG_DISABLED,
1073
+ $e as LOG_EXPANDED,
1074
+ Wo as default
1001
1075
  };
1002
1076
  //# sourceMappingURL=index.esm.js.map