@iframe-resizer/core 6.0.0-beta.2 → 6.0.0-beta.4

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