@iframe-resizer/child 6.0.0-beta.3 → 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,102 +1,46 @@
1
- import $n, { NORMAL as Z, HIGHLIGHT as a, FOREGROUND as v, BOLD as st, ITALIC as Tn } from "auto-console-group";
2
- const K = "6.0.0-beta.3", je = "iframeResizer", pe = ":", An = "[iFrameResizerChild]Ready", In = "autoResize", Nn = "beforeUnload", Ln = "close", Cn = "inPageLink", ye = "init", $e = "message", jn = "mouseenter", Pn = "mouseleave", Ct = "pageHide", _n = "pageInfo", jt = "parentInfo", xn = "parentInfoStop", Bn = "scrollBy", Dn = "scrollTo", Pt = "scrollToOffset", Fn = "title", Y = 1, Pe = "data-iframe-size", _t = "data-iframe-overflowed", X = "data-iframe-ignore", ve = "height", xt = "width", rt = "offsetSize", _e = `
3
- `, ee = "string", _ = "number", Hn = "boolean", Vn = "object", xe = "function", Wn = "undefined", Un = "false", Gn = "null", Q = "auto", Bt = "readystatechange", Dt = "bottom", Ft = "right", Te = "autoResizeEnabled", it = /* @__PURE__ */ Symbol("sizeChanged"), Be = "manualResize", De = "parentResize", Se = {
4
- [Be]: 1,
5
- [De]: 1
6
- }, Ht = "setOffsetSize", Vt = "resizeObserver", Fe = "overflowObserver", Wt = "mutationObserver", Ut = "visibilityObserver", qn = "font-weight: bold;", He = "none", ct = "No change in content size detected", le = "[iFrameSizer]", Gt = le.length, Zn = Q, qt = 128, Zt = /* @__PURE__ */ new Set([
7
- "head",
8
- "body",
9
- "meta",
10
- "base",
11
- "title",
12
- "script",
13
- "link",
14
- "style",
15
- "map",
16
- "area",
17
- "option",
18
- "optgroup",
19
- "template",
20
- "track",
21
- "wbr",
22
- "nobr"
23
- ]), Yn = (e) => typeof e === ee, ze = (e, ...t) => setTimeout(() => e(...t), 0), Yt = (e) => {
24
- let t = !1;
25
- return function(...n) {
26
- return t ? void 0 : (t = !0, e.apply(this, n));
27
- };
28
- }, ue = (e) => e, at = 1e3, P = (e) => Math.round(e * at) / at, Qt = (e) => e.charAt(0).toUpperCase() + e.slice(1), N = (e) => `${e}` != "" && e !== void 0, Qn = (e) => e(), Jn = (e) => e.toLowerCase();
29
- function Kn(e) {
30
- switch (!0) {
31
- case !N(e):
32
- return "";
33
- case N(e.id):
34
- return `${e.nodeName}#${e.id}`;
35
- case N(e.name):
36
- return `${e.nodeName} (${e.name}`;
37
- case N(e.className):
38
- return `${e.nodeName}.${e.className}`;
39
- default:
40
- return e.nodeName;
41
- }
42
- }
43
- const Xn = (e) => (
44
- // eslint-disable-next-line no-underscore-dangle
45
- e?.__esModule ? e.default : e
46
- ), k = (e, t, n) => {
47
- if (typeof e !== t)
48
- throw new TypeError(`${n} is not a ${Qt(t)}`);
49
- }, Jt = {
50
- br: `
51
- `,
52
- rb: "\x1B[31;1m",
53
- // red bold
54
- bb: "\x1B[34;1m",
55
- // blue bold
56
- b: "\x1B[1m",
57
- // bold
58
- i: "\x1B[3m",
59
- // italic
60
- u: "\x1B[4m",
61
- // underline
62
- "/": "\x1B[m"
63
- // reset
64
- }, eo = Object.keys(Jt), to = new RegExp(`<(${eo.join("|")})>`, "gi"), no = (e, t) => Jt[t] ?? "", oo = (e) => e.replace(to, no), so = (e) => e.replaceAll("<br>", _e).replaceAll(/<\/?[^>]+>/gi, ""), ro = (e) => (t) => e(
65
- Yn(t) ? window.chrome ? oo(t) : so(t) : t
66
- );
67
- let Ve = !0, lt = je;
68
- const io = Xn($n), J = io({
69
- label: `${je}(child)`,
1
+ import { LABEL as Ne, BOLD as vn, CHILD_READY_MESSAGE as En, MESSAGE_ID as Re, MESSAGE_ID_LENGTH as zt, SEPARATOR as fe, AUTO as se, NONE as Le, IGNORE_ATTR as j, VERSION as Y, READY_STATE_CHANGE as $t, SIZE_ATTR as Ce, FALSE as On, INIT as ue, MOUSE_ENTER as yn, MOUSE_LEAVE as Sn, PAGE_HIDE as It, BEFORE_UNLOAD as Rn, MIN_SIZE as W, HEIGHT as me, IGNORE_TAGS as At, HEIGHT_EDGE as Pe, WIDTH as kt, WIDTH_EDGE as Nt, NO_CHANGE as et, VISIBILITY_OBSERVER as Lt, RESIZE_OBSERVER as Ct, MUTATION_OBSERVER as Pt, OVERFLOW_OBSERVER as _e, SET_OFFSET_SIZE as _t, PARENT_RESIZE_REQUEST as Dt, MANUAL_RESIZE_REQUEST as Bt, SIZE_CHANGE_DETECTED as tt, ENABLE as Me, IGNORE_DISABLE_RESIZE as we, HEIGHT_CALC_MODE_DEFAULT as Mn, BOOLEAN as Tn, AUTO_RESIZE as zn, STRING as ge, NUMBER as P, FUNCTION as De, PARENT_INFO as xt, PARENT_INFO_STOP as $n, SCROLL_BY as In, SCROLL_TO as An, SCROLL_TO_OFFSET as Ft, MESSAGE as Te, CLOSE as kn, NEW_LINE as Ht, OVERFLOW_ATTR as Vt, TITLE as Nn, NULL as Ln, EVENT_CANCEL_TIMER as Gt, IN_PAGE_LINK as Cn, OBJECT as Pn, OFFSET_SIZE as nt, PAGE_INFO as _n, UNDEFINED as Dn } from "@iframe-resizer/common/consts";
2
+ import Bn from "@iframe-resizer/common/deprecate";
3
+ import xn from "@iframe-resizer/common/format-advise";
4
+ import { esModuleInterop as Fn, id as ie, isDef as ne, isolateUserCode as he, once as Ut, round as C, lower as Hn, invoke as Vn, capitalizeFirstLetter as Gn, typeAssert as T, getElementName as Un } from "@iframe-resizer/common/utils";
5
+ import Wn, { NORMAL as q, HIGHLIGHT as c, FOREGROUND as w, BOLD as ot, ITALIC as qn } from "auto-console-group";
6
+ import rt, { getModeData as I, getModeLabel as Zn, checkMode as Be, getKey as st } from "@iframe-resizer/common/mode";
7
+ let xe = !0, it = Ne;
8
+ const jn = Fn(Wn), Z = jn({
9
+ label: `${Ne}(child)`,
70
10
  expand: !1
71
11
  });
72
- function co(e) {
73
- lt = e.id || je, J.label(`${lt}`), J.expand(e.expand), Ve = e.enabled;
12
+ function Yn(e) {
13
+ it = e.id || Ne, Z.label(`${it}`), Z.expand(e.expand), xe = e.enabled;
74
14
  }
75
- const Kt = (e) => (...t) => Ve ? J[e](...t) : !0, l = Kt("log"), u = l, de = Kt("debug");
76
- function ao(e, t) {
77
- console.info(`%ciframe-resizer ${e}`, Ve || t < 1 ? qn : Z);
15
+ const Wt = (e) => (...t) => xe ? Z[e](...t) : !0, a = Wt("log"), l = a, ce = Wt("debug");
16
+ function Qn(e, t) {
17
+ console.info(`%ciframe-resizer ${e}`, xe || t < 1 ? vn : q);
78
18
  }
79
19
  const {
80
- assert: lo,
81
- endAutoGroup: x,
82
- error: Xt,
83
- errorBoundary: We,
84
- event: h,
85
- label: mi,
86
- purge: hi,
87
- warn: H
88
- } = J, en = ro(ue), w = (...e) => J.warn(...e.map(en)), uo = (...e) => (
20
+ assert: Jn,
21
+ endAutoGroup: _,
22
+ error: qt,
23
+ errorBoundary: Fe,
24
+ event: g,
25
+ label: Js,
26
+ purge: Ks,
27
+ warn: x
28
+ } = Z, Zt = xn(ie), O = (...e) => Z.warn(...e.map(Zt)), Kn = (...e) => (
89
29
  // eslint-disable-next-line no-console
90
- console.warn(...e.map(en))
91
- ), Ue = [];
92
- function tn(e, t) {
93
- l(`${e} event listener: %c${t}`, a);
94
- }
95
- const nn = (e, t, n, o) => {
96
- e.removeEventListener(t, n, o), tn("Removed", t);
97
- }, C = (e, t, n, o = !1) => {
98
- e.addEventListener(t, n, o), Ue.push(() => nn(e, t, n, o)), tn("Added", t);
99
- }, r = {
30
+ console.warn(...e.map(Zt))
31
+ ), He = Bn((e, t) => O(t));
32
+ He("Method");
33
+ He("Method", "replaced with");
34
+ He("Option");
35
+ const Ve = [];
36
+ function jt(e, t) {
37
+ a(`${e} event listener: %c${t}`, c);
38
+ }
39
+ const Yt = (e, t, n, o) => {
40
+ e.removeEventListener(t, n, o), jt("Removed", t);
41
+ }, N = (e, t, n, o = !1) => {
42
+ e.addEventListener(t, n, o), Ve.push(() => Yt(e, t, n, o)), jt("Added", t);
43
+ }, s = {
100
44
  applySelectors: null,
101
45
  firstRun: !0,
102
46
  hasTags: !1,
@@ -119,70 +63,70 @@ const nn = (e, t, n, o) => {
119
63
  onPageInfo: null,
120
64
  onParentInfo: null
121
65
  };
122
- let ut = !1;
123
- function dt(e) {
66
+ let ct = !1;
67
+ function at(e) {
124
68
  const t = window?.iframeResizer?.targetOrigin || "*", n = Array.isArray(t) ? t : [t];
125
69
  for (const o of n)
126
- e.postMessage(An, o);
70
+ e.postMessage(En, o);
127
71
  }
128
- function ft() {
129
- if (document.readyState === "loading" || !r.firstRun || ut) return;
72
+ function dt() {
73
+ if (document.readyState === "loading" || !s.firstRun || ct) return;
130
74
  const { parent: e, top: t } = window;
131
- h("ready"), l(
75
+ g("ready"), a(
132
76
  "Sending%c ready%c to parent from",
133
- a,
134
- v,
77
+ c,
78
+ w,
135
79
  window.location.href
136
- ), dt(e), e !== t && dt(t), ut = !0;
80
+ ), at(e), e !== t && at(t), ct = !0;
137
81
  }
138
- const mt = "iframeResize", fo = (e) => le === `${e.data}`.slice(0, Gt), mo = () => mt in window || // @ts-ignore
139
- window.jQuery !== void 0 && mt in window.jQuery.prototype, ho = (e) => e.data.split(pe)[2] in { true: 1, false: 1 }, go = () => [document.documentElement, document.body], po = ["min-height", "min-width", "max-height", "max-width"], ht = /* @__PURE__ */ new Set(), yo = (e) => !!e && e !== "0px" && e !== Q && e !== He, on = (e) => e.tagName ? e.tagName.toLowerCase() : "unknown", sn = (e, t) => window.getComputedStyle(e).getPropertyValue(t), vo = (e, t) => yo(sn(e, t));
140
- function zo(e, t) {
82
+ const lt = "iframeResize", Xn = (e) => Re === `${e.data}`.slice(0, zt), eo = () => lt in window || // @ts-ignore
83
+ window.jQuery !== void 0 && lt in window.jQuery.prototype, to = (e) => e.data.split(fe)[2] in { true: 1, false: 1 }, no = () => [document.documentElement, document.body], oo = ["min-height", "min-width", "max-height", "max-width"], ft = /* @__PURE__ */ new Set(), ro = (e) => !!e && e !== "0px" && e !== se && e !== Le, Qt = (e) => e.tagName ? e.tagName.toLowerCase() : "unknown", Jt = (e, t) => window.getComputedStyle(e).getPropertyValue(t), so = (e, t) => ro(Jt(e, t));
84
+ function io(e, t) {
141
85
  const n = e.style.getPropertyValue(t);
142
86
  return n ? { source: "an inline style attribute", value: n } : null;
143
87
  }
144
- function bo({
88
+ function co({
145
89
  href: e
146
90
  }) {
147
- ht.has(e) || (l("Unable to access stylesheet:", e), ht.add(e));
91
+ ft.has(e) || (a("Unable to access stylesheet:", e), ft.add(e));
148
92
  }
149
- function wo(e, t) {
93
+ function ao(e, t) {
150
94
  for (const n of document.styleSheets)
151
95
  try {
152
96
  for (const o of n.cssRules || []) {
153
97
  if (!("selectorText" in o)) continue;
154
- const s = o;
155
- if (!e.matches(s.selectorText)) continue;
156
- const d = s.style.getPropertyValue(t);
157
- if (!d) continue;
158
- const { ownerNode: c } = n;
98
+ const r = o;
99
+ if (!e.matches(r.selectorText)) continue;
100
+ const f = r.style.getPropertyValue(t);
101
+ if (!f) continue;
102
+ const { ownerNode: d } = n;
159
103
  return {
160
- source: c instanceof Element && c.tagName === "STYLE" ? "an inline <style> block" : `stylesheet (${n.href})`,
161
- value: d
104
+ source: d instanceof Element && d.tagName === "STYLE" ? "an inline <style> block" : `stylesheet (${n.href})`,
105
+ value: f
162
106
  };
163
107
  }
164
108
  } catch {
165
- bo(n);
109
+ co(n);
166
110
  }
167
111
  return {
168
112
  source: "cross-origin stylesheet",
169
- value: sn(e, t)
113
+ value: Jt(e, t)
170
114
  };
171
115
  }
172
- const So = (e, t) => zo(e, t) || wo(e, t), Eo = (e, t) => {
173
- const { source: n, value: o } = So(e, t), s = on(e);
174
- w(
175
- `The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${s}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.
116
+ const lo = (e, t) => io(e, t) || ao(e, t), fo = (e, t) => {
117
+ const { source: n, value: o } = lo(e, t), r = Qt(e);
118
+ O(
119
+ `The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.
176
120
 
177
121
  If you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`
178
122
  );
179
123
  };
180
- function Oo() {
181
- for (const e of go())
182
- for (const t of po)
183
- l(`Checking <${on(e)}> for blocking CSS: ${t}`), vo(e, t) && Eo(e, t);
124
+ function uo() {
125
+ for (const e of no())
126
+ for (const t of oo)
127
+ a(`Checking <${Qt(e)}> for blocking CSS: ${t}`), so(e, t) && fo(e, t);
184
128
  }
185
- const Ro = ({
129
+ const mo = ({
186
130
  calculateWidth: e,
187
131
  calculateHeight: t
188
132
  }) => e === t, i = {
@@ -194,7 +138,7 @@ const Ro = ({
194
138
  bodyPadding: "",
195
139
  calculateHeight: !0,
196
140
  calculateWidth: !1,
197
- heightCalcMode: Q,
141
+ heightCalcMode: se,
198
142
  ignoreSelector: "",
199
143
  inPageLinks: !1,
200
144
  logging: !1,
@@ -207,397 +151,345 @@ const Ro = ({
207
151
  sizeSelector: "",
208
152
  targetOrigin: "*",
209
153
  tolerance: 0,
210
- widthCalcMode: Q,
154
+ widthCalcMode: se,
211
155
  onBeforeResize: void 0,
212
156
  onMessage: () => {
213
- H("onMessage function not defined");
157
+ x("onMessage function not defined");
214
158
  },
215
159
  onReady: () => {
216
160
  }
217
161
  };
218
- function ko() {
162
+ function go() {
219
163
  try {
220
- r.sameOrigin = i.mode === 1 || "iframeParentListener" in window.parent;
164
+ s.sameOrigin = i.mode === 1 || "iframeParentListener" in window.parent;
221
165
  } catch {
222
- l("Cross domain iframe detected");
166
+ a("Cross domain iframe detected");
223
167
  }
224
168
  }
225
- let gt = 0;
226
- function Mo(e) {
169
+ let ut = 0;
170
+ function ho(e) {
227
171
  const t = e.length === 1 ? "" : "s";
228
- H(
229
- `%c[${X}]%c found on %c${e.length}%c element${t}`,
230
- st,
231
- Z,
232
- st,
233
- Z
172
+ x(
173
+ `%c[${j}]%c found on %c${e.length}%c element${t}`,
174
+ ot,
175
+ q,
176
+ ot,
177
+ q
234
178
  );
235
179
  }
236
- function $o() {
237
- const e = document.querySelectorAll(`*[${X}]`), t = e.length > 0;
238
- return t && e.length !== gt && (Mo(e), gt = e.length), t;
239
- }
240
- const fe = (e) => {
241
- if (!e) return "";
242
- let t = -559038744, n = 1103547984;
243
- for (let o, s = 0; s < e.length; s++)
244
- o = e.codePointAt(s), t = Math.imul(t ^ o, 2246822519), n = Math.imul(n ^ o, 3266489917);
245
- 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);
246
- }, A = (e) => e.replace(
247
- /[A-Za-z]/g,
248
- (t) => String.fromCodePoint(
249
- (t <= "Z" ? 90 : 122) >= (t = t.codePointAt(0) + 19) ? t : t - 26
250
- )
251
- ), To = /* @__PURE__ */ new Date(), rn = (e) => new Set(Array.from({ length: 9 }, e)), pt = " - lewpylk", F = ["spjluzl", "rlf", "clyzpvu", "rlf2", "nlaMbssFlhy"], Ao = [
252
- "<yi>Puchspk Spjluzl Rlf</><iy><iy>",
253
- "<yi>Tpzzpun Spjluzl Rlf</><iy><iy>",
254
- "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</>. Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>",
255
- "<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</>.",
256
- "<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.",
257
- "Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz.",
258
- "<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.",
259
- "<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.",
260
- "<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.",
261
- "<yi>Bzl dpao slnhjf jspluaz</><iy><iy>Dolu bzpun <p>pmyhtl-ylzpgly</> jopsk whjrhnl dpao hu vskly clyzpvu vm aol whylua, fvb jhu zla aol spjluzl rlf pu aol pmyhtl. Mvy klahpsz vu ovd av zla aopz bw, wslhzl zll aol kvjbtluahapvu ha:<iy><iy>oaawz://pmyhtl-ylzpgly.jvt/zlabw/jopsk/#spjluzl"
262
- ], Io = (e) => [
263
- e[0],
264
- ...e.slice(1).map((t) => `${t}${pt}`),
265
- `${e[4]}${pt}`,
266
- ...e.slice(1)
267
- ], No = Io(["NWSc3", "zvsv", "wyv", "ibzpulzz", "VLT"]), yt = Object.fromEntries(
268
- [
269
- "2cgs7fdf4xb",
270
- "1c9ctcccr4z",
271
- "1q2pc4eebgb",
272
- "ueokt0969w",
273
- "w2zxchhgqz",
274
- "1umuxblj2e5",
275
- "1foobarqaz",
276
- "2b5sdlfhbev",
277
- "zo4ui3arjo",
278
- "oclbb4thgl",
279
- "igb1wzrjqr"
280
- ].map((e, t) => [e, Math.max(0, t - 1)])
281
- ), Lo = /* @__PURE__ */ new Set([1, 6]), cn = To[A(F[4])](), Co = rn((e, t) => fe(`${cn + t}`)), jo = rn((e, t) => fe(`${cn - ++t}`)), Po = (e) => Co.has(e) ? 9 : jo.has(e) ? 5 : -2, Ge = (e) => Lo.has(e), T = (e) => A(Ao[e]), _o = (e) => A(No[e]), vt = (e) => A(F[e]), zt = (e) => {
282
- const t = e[A(F[0])] || e[A(F[1])] || e[A(F[2])] || e[A(F[3])];
283
- if (!t) return -1;
284
- const n = t.split("-");
285
- let o = (function(s = "", d = "") {
286
- let c = -2;
287
- const f = fe(A(s));
288
- return f in yt && (c = yt[f]), c === 9 ? Po(d) : c;
289
- })(...n);
290
- return o === 0 || ((s) => s[2] === fe(s[0] + s[1]))(n) || (o = -2), o;
291
- };
292
- function xo(e, t, n) {
293
- (!N(n) || t > -1 && e > t) && (ao(`v${K} (${_o(e)})`, e), e === 0 && uo(T(3)));
180
+ function po() {
181
+ const e = document.querySelectorAll(`*[${j}]`), t = e.length > 0;
182
+ return t && e.length !== ut && (ho(e), ut = e.length), t;
183
+ }
184
+ function bo(e, t, n) {
185
+ (!ne(n) || t > -1 && e > t) && (Qn(`v${Y} (${Zn(e)})`, e), e === 0 && Kn(I(3)));
294
186
  }
295
- function Bo({
187
+ function wo({
296
188
  key: e,
297
189
  key2: t,
298
190
  mode: n,
299
191
  version: o
300
192
  }) {
301
- const s = n, d = N(e) ? zt({ key: e }) : -1, c = N(t) ? zt({ key: t }) : -1;
302
- let f;
303
- switch (n = Math.max(d, c), n) {
193
+ const r = n, f = ne(e) ? rt({ key: e }) : -1, d = ne(t) ? rt({ key: t }) : -1;
194
+ let u;
195
+ switch (n = Math.max(f, d), n) {
304
196
  case -2:
305
197
  case -1:
306
- f = `${T(Math.min(d, c) + 2)}${T(2)}`, r.firstRun = !1;
198
+ u = `${I(Math.min(f, d) + 2)}${I(2)}`, s.firstRun = !1;
307
199
  break;
308
200
  case 1:
309
201
  case 2:
310
202
  case 3:
311
- f = T(6);
203
+ u = I(6);
312
204
  break;
313
205
  case 4:
314
- f = T(7);
206
+ u = I(7);
315
207
  break;
316
208
  case 5:
317
- f = T(8);
209
+ u = I(8);
318
210
  break;
319
211
  }
320
- if (n >= 0 && xo(n, s, o), (!N(o) || !r.firstRun) && (f && w(f), n < 0))
321
- throw w(T(9)), f.split("<br>")[0].replace(/<\/?[a-z][^>]*>|<\/>/gi, "");
212
+ if (n >= 0 && bo(n, r, o), (!ne(o) || !s.firstRun) && (u && O(u), n < 0))
213
+ throw O(I(9)), u.split("<br>")[0].replace(/<\/?[a-z][^>]*>|<\/>/gi, "");
322
214
  i.mode = n;
323
215
  }
324
- const Do = "BackCompat", Fo = `<rb>Quirks Mode Detected</>
216
+ const vo = "BackCompat", Eo = `<rb>Quirks Mode Detected</>
325
217
 
326
218
  This iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.
327
219
 
328
220
  For more information see <u>https://iframe-resizer.com/quirks-mode</>.
329
221
  `;
330
- function Ho() {
331
- document.compatMode === Do && w(Fo);
222
+ function Oo() {
223
+ document.compatMode === vo && O(Eo);
332
224
  }
333
- const Vo = "complete";
334
- let bt = !1;
335
- function an(e) {
336
- document.readyState === Vo ? ze(e) : bt || C(
225
+ const yo = "complete";
226
+ let mt = !1;
227
+ function Kt(e) {
228
+ document.readyState === yo ? he(e) : mt || N(
337
229
  document,
338
- Bt,
339
- () => an(e)
340
- ), bt = !0;
230
+ $t,
231
+ () => Kt(e)
232
+ ), mt = !0;
341
233
  }
342
- const Wo = () => {
343
- u(`Set targetOrigin for parent: %c${i.targetOrigin}`, a), i.autoResize !== !0 && l("Auto Resize disabled");
234
+ const So = () => {
235
+ l(`Set targetOrigin for parent: %c${i.targetOrigin}`, c), i.autoResize !== !0 && a("Auto Resize disabled");
344
236
  };
345
- function ln() {
346
- r.taggedElements = document.querySelectorAll(`[${Pe}]`), r.hasTags = r.taggedElements.length > 0, l(`Tagged elements found: %c${r.hasTags}`, a);
237
+ function Xt() {
238
+ s.taggedElements = document.querySelectorAll(`[${Ce}]`), s.hasTags = s.taggedElements.length > 0, a(`Tagged elements found: %c${s.hasTags}`, c);
347
239
  }
348
- const Uo = `<rb>Legacy version detected on parent page</>
240
+ const Ro = `<rb>Legacy version detected on parent page</>
349
241
 
350
242
  Detected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.
351
243
 
352
244
  See <u>https://iframe-resizer.com/setup/</> for more details.
353
- `, Go = (e) => `<b>Version mismatch</>
245
+ `, Mo = (e) => `<b>Version mismatch</>
354
246
 
355
247
  The parent and child pages are running different versions of <i>iframe resizer</>.
356
248
 
357
- Parent page: ${e} - Child page: ${K}.
249
+ Parent page: ${e} - Child page: ${Y}.
358
250
  `;
359
- function qo({ version: e }) {
360
- !e || e === "" || e === Un ? w(Uo) : e !== K && w(Go(e));
251
+ function To({ version: e }) {
252
+ !e || e === "" || e === On ? O(Ro) : e !== Y && O(Mo(e));
361
253
  }
362
- const Zo = Yt(() => w(T(4)));
363
- function Yo(e) {
364
- if (!r.timerActive) return;
365
- const t = P(performance.now() - r.totalTime), n = e === ye ? `Initialised iframe in %c${t}ms` : `Size calculated in %c${t}ms`;
366
- l(n, a);
254
+ const zo = Ut(() => O(I(4)));
255
+ function $o(e) {
256
+ if (!s.timerActive) return;
257
+ const t = C(performance.now() - s.totalTime), n = e === ue ? `Initialised iframe in %c${t}ms` : `Size calculated in %c${t}ms`;
258
+ a(n, c);
367
259
  }
368
- function Qo(e) {
369
- return e === void 0 ? e = i.targetOrigin : l(`Message targetOrigin: %c${e}`, a), e;
260
+ function Io(e) {
261
+ return e === void 0 ? e = i.targetOrigin : a(`Message targetOrigin: %c${e}`, c), e;
370
262
  }
371
- function Jo(e, t) {
372
- const { mode: n } = i, { sameOrigin: o, target: s } = r;
263
+ function Ao(e, t) {
264
+ const { mode: n } = i, { sameOrigin: o, target: r } = s;
373
265
  if (o)
374
266
  try {
375
- window.parent.iframeParentListener(le + e);
376
- } catch (d) {
377
- if (Ge(n)) Zo();
378
- else throw new Error(d);
267
+ window.parent.iframeParentListener(Re + e);
268
+ } catch (f) {
269
+ if (Be(n)) zo();
270
+ else throw new Error(f);
379
271
  return !1;
380
272
  }
381
273
  else {
382
- lo(s, "Internal error: postMessage target is undefined");
383
- const d = Qo(t), c = Array.isArray(d) ? d : [d];
384
- for (const f of c)
385
- s.postMessage(le + e, f);
274
+ Jn(r, "Internal error: postMessage target is undefined");
275
+ const f = Io(t), d = Array.isArray(f) ? f : [f];
276
+ for (const u of d)
277
+ r.postMessage(Re + e, u);
386
278
  }
387
279
  return !0;
388
280
  }
389
- function un(e, t, n, o, s) {
390
- const { parentId: d } = i, { sameOrigin: c } = r, f = `${e}:${t}`, y = `${d}:${f}:${n}${o === void 0 ? "" : `:${o}`}`;
391
- i.mode < -1 || !Jo(y, s) || (Yo(n), u(
392
- `Sending message to parent page via ${c ? "sameOrigin" : "postMessage"}: %c%c${y}`,
393
- Tn,
394
- a
281
+ function en(e, t, n, o, r) {
282
+ const { parentId: f } = i, { sameOrigin: d } = s, u = `${e}:${t}`, b = `${f}:${u}:${n}${o === void 0 ? "" : `:${o}`}`;
283
+ i.mode < -1 || !Ao(b, r) || ($o(n), l(
284
+ `Sending message to parent page via ${d ? "sameOrigin" : "postMessage"}: %c%c${b}`,
285
+ qn,
286
+ c
395
287
  ));
396
288
  }
397
- const z = We(
398
- (e, t, n, o, s) => {
399
- h(n), un(e, t, n, o, s), x();
289
+ const v = Fe(
290
+ (e, t, n, o, r) => {
291
+ g(n), en(e, t, n, o, r), _();
400
292
  }
401
- ), Ko = (e) => z(0, 0, e.type, `${e.screenY}:${e.screenX}`);
402
- function wt(e, t) {
403
- l(`Add event listener: %c${t}`, a), C(window.document, e, Ko);
293
+ ), ko = (e) => v(0, 0, e.type, `${e.screenY}:${e.screenX}`);
294
+ function gt(e, t) {
295
+ a(`Add event listener: %c${t}`, c), N(window.document, e, ko);
404
296
  }
405
- function Xo({
297
+ function No({
406
298
  mouseEvents: e
407
299
  }) {
408
- e === !0 && (wt(jn, "Mouse Enter"), wt(Pn, "Mouse Leave"));
300
+ e === !0 && (gt(yn, "Mouse Enter"), gt(Sn, "Mouse Leave"));
409
301
  }
410
- const es = () => z(0, 0, Nn);
411
- function ts({ persisted: e }) {
412
- e || es(), h(Ct), u("Page persisted:", e), !e && Ue.forEach(Qn);
302
+ const Lo = () => v(0, 0, Rn);
303
+ function Co({ persisted: e }) {
304
+ e || Lo(), g(It), l("Page persisted:", e), !e && Ve.forEach(Vn);
413
305
  }
414
- const ns = () => C(window, Jn(Ct), ts), St = (e, t) => !(Math.abs(e - t) <= i.tolerance);
415
- function os(e, t) {
416
- const { calculateHeight: n, calculateWidth: o } = i, { height: s, width: d } = r;
417
- return n && St(s, e) || o && St(d, t);
306
+ const Po = () => N(window, Hn(It), Co), ht = (e, t) => !(Math.abs(e - t) <= i.tolerance);
307
+ function _o(e, t) {
308
+ const { calculateHeight: n, calculateWidth: o } = i, { height: r, width: f } = s;
309
+ return n && ht(r, e) || o && ht(f, t);
418
310
  }
419
- const I = [a, v, a], ce = {
311
+ const A = [c, w, c], oe = {
420
312
  height: 0,
421
313
  width: 0
422
- }, D = {
314
+ }, B = {
423
315
  height: 0,
424
316
  width: 0
425
317
  };
426
- function B(e, t, n) {
427
- return D[e] = t, ce[e] = n, t;
318
+ function D(e, t, n) {
319
+ return B[e] = t, oe[e] = n, t;
428
320
  }
429
- function ss(e) {
321
+ function Do(e) {
430
322
  const t = e.getOffset();
431
- return t !== 0 && u(`Page offsetSize: %c${t}px`, a), t;
323
+ return t !== 0 && l(`Page offsetSize: %c${t}px`, c), t;
432
324
  }
433
- const rs = (e) => e.documentElementScroll() + Math.max(0, e.getOffset());
434
- function dn(e) {
435
- const { hasOverflow: t, hasTags: n, triggerLocked: o } = r, s = e.label, d = s === ve, c = e.boundingClientRect(), f = Math.ceil(c), y = Math.floor(c), m = rs(e), b = `HTML: %c${c}px %cPage: %c${m}px`;
436
- let g;
325
+ const Bo = (e) => e.documentElementScroll() + Math.max(0, e.getOffset());
326
+ function tn(e) {
327
+ const { hasOverflow: t, hasTags: n, triggerLocked: o } = s, r = e.label, f = r === me, d = e.boundingClientRect(), u = Math.ceil(d), b = Math.floor(d), m = Bo(e), E = `HTML: %c${d}px %cPage: %c${m}px`;
328
+ let h;
437
329
  switch (!0) {
438
330
  case !e.enabled():
439
- return Math.max(m, Y);
331
+ return Math.max(m, W);
440
332
  case n:
441
- u("Found element with data-iframe-size attribute"), g = e.taggedElement();
333
+ l("Found element with data-iframe-size attribute"), h = e.taggedElement();
442
334
  break;
443
- case (!t && r.firstRun && D[s] === 0 && ce[s] === 0):
444
- u(`Initial page size values: ${b}`, ...I), g = B(
445
- s,
446
- c,
335
+ case (!t && s.firstRun && B[r] === 0 && oe[r] === 0):
336
+ l(`Initial page size values: ${E}`, ...A), h = D(
337
+ r,
338
+ d,
447
339
  m
448
340
  );
449
341
  break;
450
- case (o && c === D[s] && m === ce[s]):
451
- u(`Size unchanged: ${b}`, ...I), g = Math.max(c, m);
342
+ case (o && d === B[r] && m === oe[r]):
343
+ l(`Size unchanged: ${E}`, ...A), h = Math.max(d, m);
452
344
  break;
453
- case (c === 0 && m !== 0):
454
- u(`Page is hidden: ${b}`, ...I), g = m;
345
+ case (d === 0 && m !== 0):
346
+ l(`Page is hidden: ${E}`, ...A), h = m;
455
347
  break;
456
- case (!t && c !== D[s] && m <= ce[s]):
457
- u(`New <html> size: ${b} `, ...I), u(
458
- `Previous <html> size: %c${D[s]}px`,
459
- a
460
- ), g = B(
461
- s,
462
- c,
348
+ case (!t && d !== B[r] && m <= oe[r]):
349
+ l(`New <html> size: ${E} `, ...A), l(
350
+ `Previous <html> size: %c${B[r]}px`,
351
+ c
352
+ ), h = D(
353
+ r,
354
+ d,
463
355
  m
464
356
  );
465
357
  break;
466
- case !d:
467
- g = e.taggedElement();
358
+ case !f:
359
+ h = e.taggedElement();
468
360
  break;
469
- case (!t && c < D[s]):
470
- u(`<html> size decreased: ${b}`, ...I), g = B(
471
- s,
472
- c,
361
+ case (!t && d < B[r]):
362
+ l(`<html> size decreased: ${E}`, ...A), h = D(
363
+ r,
364
+ d,
473
365
  m
474
366
  );
475
367
  break;
476
- case (m === y || m === f):
477
- u(`<html> size equals page size: ${b}`, ...I), g = B(
478
- s,
479
- c,
368
+ case (m === b || m === u):
369
+ l(`<html> size equals page size: ${E}`, ...A), h = D(
370
+ r,
371
+ d,
480
372
  m
481
373
  );
482
374
  break;
483
- case c > m:
484
- u(`Page size < <html> size: ${b}`, ...I), g = B(
485
- s,
486
- c,
375
+ case d > m:
376
+ l(`Page size < <html> size: ${E}`, ...A), h = D(
377
+ r,
378
+ d,
487
379
  m
488
380
  );
489
381
  break;
490
382
  case t:
491
- u("Found elements possibly overflowing <html> "), g = e.taggedElement();
383
+ l("Found elements possibly overflowing <html> "), h = e.taggedElement();
492
384
  break;
493
385
  default:
494
- u(`Using <html> size: ${b}`, ...I), g = B(
495
- s,
496
- c,
386
+ l(`Using <html> size: ${E}`, ...A), h = D(
387
+ r,
388
+ d,
497
389
  m
498
390
  );
499
391
  }
500
- return u(`Content ${s}: %c${g}px`, a), g += ss(e), Math.max(g, Y);
392
+ return l(`Content ${r}: %c${h}px`, c), h += Do(e), Math.max(h, W);
501
393
  }
502
- const is = 1e3, cs = 5 * is, as = 4, ls = 10, us = 100, qe = "--ifr-start", me = "--ifr-end", fn = "--ifr-measure", p = [];
503
- let ae = {}, Et = 0, Ae;
504
- function mn() {
394
+ const xo = 1e3, Fo = 5 * xo, Ho = 4, Vo = 10, Go = 100, Ge = "--ifr-start", ae = "--ifr-end", nn = "--ifr-measure", p = [];
395
+ let re = {}, pt = 0, ze;
396
+ function on() {
505
397
  try {
506
- performance.clearMarks(qe), performance.clearMarks(me), performance.clearMeasures(fn);
398
+ performance.clearMarks(Ge), performance.clearMarks(ae), performance.clearMeasures(nn);
507
399
  } catch {
508
400
  }
509
401
  }
510
- function ds() {
511
- Ae = setInterval(() => {
512
- if (p.length < ls || ae.hasTags && ae.len < 25) return;
402
+ function Uo() {
403
+ ze = setInterval(() => {
404
+ if (p.length < Vo || re.hasTags && re.len < 25) return;
513
405
  p.sort();
514
406
  const e = Math.min(
515
407
  p.reduce((n, o) => n + o, 0) / p.length,
516
408
  p[Math.floor(p.length / 2)]
517
- ), t = P(e);
518
- t > Et && (Et = t, h("performanceObserver"), l("Mean time:", P(p[Math.floor(p.length / 2)])), l(
409
+ ), t = C(e);
410
+ t > pt && (pt = t, g("performanceObserver"), a("Mean time:", C(p[Math.floor(p.length / 2)])), a(
519
411
  "Median time:",
520
- P(p.reduce((n, o) => n + o, 0) / p.length)
521
- ), l("Average time:", t), l("Max time:", P(Math.max(...p)))), mn(), !(e <= as) && (clearInterval(Ae), w(
412
+ C(p.reduce((n, o) => n + o, 0) / p.length)
413
+ ), a("Average time:", t), a("Max time:", C(Math.max(...p)))), on(), !(e <= Ho) && (clearInterval(ze), O(
522
414
  `<rb>Performance Warning</>
523
415
 
524
- Calculating the page size is taking an excessive amount of time (${P(e)}ms).
416
+ Calculating the page size is taking an excessive amount of time (${C(e)}ms).
525
417
 
526
- To improve performance add the <b>data-iframe-size</> attribute to the ${ae.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`
418
+ To improve performance add the <b>data-iframe-size</> attribute to the ${re.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`
527
419
  ));
528
- }, cs);
420
+ }, Fo);
529
421
  }
530
- function fs(e) {
422
+ function Wo(e) {
531
423
  e.getEntries().forEach((t) => {
532
- if (t.name === me)
424
+ if (t.name === ae)
533
425
  try {
534
426
  const { duration: n } = performance.measure(
535
- fn,
536
- qe,
537
- me
427
+ nn,
428
+ Ge,
429
+ ae
538
430
  );
539
- ae = t.detail, p.push(n), p.length > us && p.shift();
431
+ re = t.detail, p.push(n), p.length > Go && p.shift();
540
432
  } catch {
541
433
  }
542
434
  });
543
435
  }
544
- function ms() {
545
- u("Attached%c PerformanceObserver%c to page", a, v);
546
- const e = new PerformanceObserver(fs);
547
- return e.observe({ entryTypes: ["mark"] }), ds(), {
436
+ function qo() {
437
+ l("Attached%c PerformanceObserver%c to page", c, w);
438
+ const e = new PerformanceObserver(Wo);
439
+ return e.observe({ entryTypes: ["mark"] }), Uo(), {
548
440
  disconnect: () => {
549
- mn(), clearInterval(Ae), e.disconnect(), u("Detached%c PerformanceObserver", a);
441
+ on(), clearInterval(ze), e.disconnect(), l("Detached%c PerformanceObserver", c);
550
442
  }
551
443
  };
552
444
  }
553
- const hs = (e) => `:not(${e})`, gs = `* ${Array.from(Zt).map(hs).join("")}`, Ze = (e) => e.querySelectorAll(gs);
554
- function ps() {
555
- const { hasOverflow: e, hasTags: t, overflowedNodeSet: n, taggedElements: o } = r;
556
- return t ? o : e ? Array.from(n) : Ze(document.documentElement);
445
+ const Zo = (e) => `:not(${e})`, jo = `* ${Array.from(At).map(Zo).join("")}`, Ue = (e) => e.querySelectorAll(jo);
446
+ function Yo() {
447
+ const { hasOverflow: e, hasTags: t, overflowedNodeSet: n, taggedElements: o } = s;
448
+ return t ? o : e ? Array.from(n) : Ue(document.documentElement);
557
449
  }
558
- function ys(e, t) {
450
+ function Qo(e, t) {
559
451
  const n = `margin-${t}`;
560
- let o, s = document.documentElement, d = r.hasTags ? Y : document.documentElement.getBoundingClientRect().bottom;
561
- for (const c of e)
562
- o = c.getBoundingClientRect()[t] + parseFloat(getComputedStyle(c).getPropertyValue(n)), o > d && (d = o, s = c);
563
- return { maxEl: s, maxVal: d };
564
- }
565
- function hn(e) {
566
- performance.mark(qe);
567
- const t = Qt(e), { logging: n } = i, { hasTags: o } = r, s = ps(), { maxEl: d, maxVal: c } = ys(s, e);
568
- return u(`${t} position calculated from:`, d), u(`Checked %c${s.length}%c elements`, a, v), performance.mark(me, {
452
+ let o, r = document.documentElement, f = s.hasTags ? W : document.documentElement.getBoundingClientRect().bottom;
453
+ for (const d of e)
454
+ o = d.getBoundingClientRect()[t] + parseFloat(getComputedStyle(d).getPropertyValue(n)), o > f && (f = o, r = d);
455
+ return { maxEl: r, maxVal: f };
456
+ }
457
+ function rn(e) {
458
+ performance.mark(Ge);
459
+ const t = Gn(e), { logging: n } = i, { hasTags: o } = s, r = Yo(), { maxEl: f, maxVal: d } = Qo(r, e);
460
+ return l(`${t} position calculated from:`, f), l(`Checked %c${r.length}%c elements`, c, w), performance.mark(ae, {
569
461
  detail: {
570
462
  hasTags: o,
571
- len: s.length,
463
+ len: r.length,
572
464
  logging: n,
573
465
  Side: t
574
466
  }
575
- }), c;
467
+ }), d;
576
468
  }
577
- const Ye = {
578
- label: ve,
469
+ const We = {
470
+ label: me,
579
471
  enabled: () => i.calculateHeight,
580
472
  getOffset: () => i.offsetHeight,
581
- auto: () => dn(Ye),
473
+ auto: () => tn(We),
582
474
  boundingClientRect: () => Math.max(
583
475
  document.documentElement.getBoundingClientRect().bottom,
584
476
  document.body.getBoundingClientRect().bottom
585
477
  ),
586
478
  documentElementScroll: () => document.documentElement.scrollHeight,
587
- taggedElement: () => hn(Dt)
588
- }, Qe = {
589
- label: xt,
479
+ taggedElement: () => rn(Pe)
480
+ }, qe = {
481
+ label: kt,
590
482
  enabled: () => i.calculateWidth,
591
483
  getOffset: () => i.offsetWidth,
592
- auto: () => dn(Qe),
484
+ auto: () => tn(qe),
593
485
  boundingClientRect: () => Math.max(
594
486
  document.documentElement.getBoundingClientRect().right,
595
487
  document.body.getBoundingClientRect().right
596
488
  ),
597
489
  documentElementScroll: () => document.documentElement.scrollWidth,
598
- taggedElement: () => hn(Ft)
490
+ taggedElement: () => rn(Nt)
599
491
  };
600
- function vs(e, t, n) {
492
+ function Jo(e, t, n) {
601
493
  const o = i.onBeforeResize(e, t, n);
602
494
  if (o === void 0)
603
495
  throw new TypeError(
@@ -607,777 +499,777 @@ function vs(e, t, n) {
607
499
  throw new TypeError(
608
500
  `Invalid value returned from onBeforeResize(): ${o}, expected Number`
609
501
  );
610
- if (o < Y)
502
+ if (o < W)
611
503
  throw new RangeError(
612
- `Out of range value returned from onBeforeResize(): ${o}, must be at least ${Y}`
504
+ `Out of range value returned from onBeforeResize(): ${o}, must be at least ${W}`
613
505
  );
614
506
  return o;
615
507
  }
616
- const gn = (e, t) => (n, o) => {
617
- const s = e[n]();
618
- return e.enabled() && i.onBeforeResize !== void 0 ? vs(s, o, t) : s;
619
- }, zs = gn(Ye, ve), bs = gn(Qe, xt);
620
- function ws() {
621
- (window.scrollY !== 0 || window.scrollX !== 0) && (u("Reset iframe scroll position to (0, 0)"), window.scrollTo(0, 0));
622
- }
623
- function Ss(e, t, n, o) {
624
- const { heightCalcMode: s, widthCalcMode: d } = i;
625
- ws();
626
- const c = n ?? zs(s, e), f = o ?? bs(d, e), y = os(c, f) ? it : e;
627
- switch (l(`Resize event: %c${t}`, a), y) {
628
- case ye:
629
- case Te:
630
- case it:
631
- case Be:
632
- case De:
633
- r.height = c, r.width = f;
508
+ const sn = (e, t) => (n, o) => {
509
+ const r = e[n]();
510
+ return e.enabled() && i.onBeforeResize !== void 0 ? Jo(r, o, t) : r;
511
+ }, Ko = sn(We, me), Xo = sn(qe, kt);
512
+ function er() {
513
+ (window.scrollY !== 0 || window.scrollX !== 0) && (l("Reset iframe scroll position to (0, 0)"), window.scrollTo(0, 0));
514
+ }
515
+ function tr(e, t, n, o) {
516
+ const { heightCalcMode: r, widthCalcMode: f } = i;
517
+ er();
518
+ const d = n ?? Ko(r, e), u = o ?? Xo(f, e), b = _o(d, u) ? tt : e;
519
+ switch (a(`Resize event: %c${t}`, c), b) {
520
+ case ue:
521
+ case Me:
522
+ case tt:
523
+ case Bt:
524
+ case Dt:
525
+ s.height = d, s.width = u;
634
526
  // eslint-disable-next-line no-fallthrough
635
- case Ht:
636
- return r;
527
+ case _t:
528
+ return s;
637
529
  // the following case needs {} to prevent a compile error on Next.js
638
- case Fe:
639
- case Wt:
640
- case Vt:
641
- case Ut: {
642
- l(ct);
530
+ case _e:
531
+ case Pt:
532
+ case Ct:
533
+ case Lt: {
534
+ a(et);
643
535
  break;
644
536
  }
645
537
  default:
646
- u(ct);
538
+ l(et);
647
539
  }
648
540
  return null;
649
541
  }
650
- let se = !1, Ee = !1, U = null;
651
- function Es(e, t, n, o, s) {
652
- const { autoResize: d } = i, { isHidden: c } = r;
653
- switch (h(e), !0) {
542
+ let X = !1, ve = !1, V = null;
543
+ function nr(e, t, n, o, r) {
544
+ const { autoResize: f } = i, { isHidden: d } = s;
545
+ switch (g(e), !0) {
654
546
  // Allow manual and parent resize requests to bypass the hidden check
655
- case (c === !0 && !(e in Se)): {
656
- if (Ee === !0) break;
657
- l("Iframe hidden - Ignored resize request"), Ee = !0, se = !1, cancelAnimationFrame(U), U = null;
547
+ case (d === !0 && !(e in we)): {
548
+ if (ve === !0) break;
549
+ a("Iframe hidden - Ignored resize request"), ve = !0, X = !1, cancelAnimationFrame(V), V = null;
658
550
  break;
659
551
  }
660
552
  // Ignore overflowObserver here, as more efficient than using
661
553
  // mutationObserver to detect OVERFLOW_ATTR changes
662
554
  // Also allow manual and parent resize requests to bypass the pending check
663
- case (se === !0 && e !== Fe && !(e in Se)): {
664
- l("Resize already pending - Ignored resize request");
555
+ case (X === !0 && e !== _e && !(e in we)): {
556
+ a("Resize already pending - Ignored resize request");
665
557
  break;
666
558
  }
667
- case (!d && !(e in Se)): {
668
- u("Resizing disabled");
559
+ case (!f && !(e in we)): {
560
+ l("Resizing disabled");
669
561
  break;
670
562
  }
671
563
  default: {
672
- Ee = !1, se = !0, r.totalTime = performance.now(), r.timerActive = !0;
673
- const f = Ss(
564
+ ve = !1, X = !0, s.totalTime = performance.now(), s.timerActive = !0;
565
+ const u = tr(
674
566
  e,
675
567
  t,
676
568
  n,
677
569
  o
678
570
  );
679
- f && un(f.height, f.width, e, s), U || (U = requestAnimationFrame(() => {
680
- se = !1, U = null, h("requestAnimationFrame"), de(`Reset sendPending: %c${e}`, a);
681
- })), r.timerActive = !1;
571
+ u && en(u.height, u.width, e, r), V || (V = requestAnimationFrame(() => {
572
+ X = !1, V = null, g("requestAnimationFrame"), ce(`Reset sendPending: %c${e}`, c);
573
+ })), s.timerActive = !1;
682
574
  }
683
575
  }
684
- x();
576
+ _();
685
577
  }
686
- const M = We(Es);
687
- function Ot({
578
+ const z = Fe(nr);
579
+ function bt({
688
580
  eventType: e,
689
581
  eventName: t
690
582
  }) {
691
- C(window, t, () => M(t, e), { passive: !0 });
583
+ N(window, t, () => z(t, e), { passive: !0 });
692
584
  }
693
- function Os() {
694
- Ot({
585
+ function or() {
586
+ bt({
695
587
  eventType: "After Print",
696
588
  eventName: "afterprint"
697
- }), Ot({
589
+ }), bt({
698
590
  eventType: "Before Print",
699
591
  eventName: "beforeprint"
700
592
  });
701
593
  }
702
- function Rs() {
703
- if (r.triggerLocked) {
704
- l("TriggerLock blocked calculation");
594
+ function rr() {
595
+ if (s.triggerLocked) {
596
+ a("TriggerLock blocked calculation");
705
597
  return;
706
598
  }
707
- r.triggerLocked = !0, de("Trigger event lock on"), requestAnimationFrame(() => {
708
- r.triggerLocked = !1, de("Trigger event lock off");
599
+ s.triggerLocked = !0, ce("Trigger event lock on"), requestAnimationFrame(() => {
600
+ s.triggerLocked = !1, ce("Trigger event lock off");
709
601
  });
710
602
  }
711
- function pn(e) {
712
- const { heightCalcMode: t, widthCalcMode: n } = i, o = Ye[t](), s = Qe[n]();
713
- l(`Reset trigger event: %c${e}`, a), z(o, s, e);
603
+ function cn(e) {
604
+ const { heightCalcMode: t, widthCalcMode: n } = i, o = We[t](), r = qe[n]();
605
+ a(`Reset trigger event: %c${e}`, c), v(o, r, e);
714
606
  }
715
- function ks(e) {
607
+ function sr(e) {
716
608
  const t = i.heightCalcMode;
717
- l(`Reset trigger event: %c${e}`, a), i.heightCalcMode = Zn, Rs(), pn("reset"), i.heightCalcMode = t;
609
+ a(`Reset trigger event: %c${e}`, c), i.heightCalcMode = Mn, rr(), cn("reset"), i.heightCalcMode = t;
718
610
  }
719
- const Ms = `Auto Resize can not be changed when <b>direction</> is set to '${He}'.`;
720
- function $s(e) {
721
- k(e, Hn, "parentIframe.autoResize(enable) enable");
611
+ const ir = `Auto Resize can not be changed when <b>direction</> is set to '${Le}'.`;
612
+ function cr(e) {
613
+ T(e, Tn, "parentIframe.autoResize(enable) enable");
722
614
  const {
723
615
  autoResize: t,
724
616
  calculateHeight: n,
725
617
  calculateWidth: o
726
618
  } = i;
727
- return o === !1 && n === !1 ? (h(Te), w(Ms), !1) : (e === !0 && t === !1 ? (i.autoResize = !0, queueMicrotask(() => M(Te, "Auto Resize enabled"))) : e === !1 && t === !0 && (i.autoResize = !1), z(0, 0, In, JSON.stringify(i.autoResize)), i.autoResize);
619
+ return o === !1 && n === !1 ? (g(Me), O(ir), !1) : (e === !0 && t === !1 ? (i.autoResize = !0, queueMicrotask(() => z(Me, "Auto Resize enabled"))) : e === !1 && t === !0 && (i.autoResize = !1), v(0, 0, zn, JSON.stringify(i.autoResize)), i.autoResize);
728
620
  }
729
- function Ts(e) {
730
- k(e, ee, "parentIframe.moveToAnchor(anchor) anchor"), r.inPageLinks.findTarget(e);
621
+ function ar(e) {
622
+ T(e, ge, "parentIframe.moveToAnchor(anchor) anchor"), s.inPageLinks.findTarget(e);
731
623
  }
732
- function As(e) {
733
- k(e, _, "parentIframe.setOffsetSize(offset) offset"), i.offsetHeight = e, i.offsetWidth = e, M(Ht, `parentIframe.setOffsetSize(${e})`);
624
+ function dr(e) {
625
+ T(e, P, "parentIframe.setOffsetSize(offset) offset"), i.offsetHeight = e, i.offsetWidth = e, z(_t, `parentIframe.setOffsetSize(${e})`);
734
626
  }
735
- const Is = () => r.origin;
736
- function Ns(e) {
737
- k(
627
+ const lr = () => s.origin;
628
+ function fr(e) {
629
+ T(
738
630
  e,
739
- ee,
631
+ ge,
740
632
  "parentIframe.setTargetOrigin(targetOrigin) targetOrigin"
741
- ), l(`Set targetOrigin: %c${e}`, a), i.targetOrigin = e;
633
+ ), a(`Set targetOrigin: %c${e}`, c), i.targetOrigin = e;
742
634
  }
743
- function Ls(e) {
744
- return k(
635
+ function ur(e) {
636
+ return T(
745
637
  e,
746
- xe,
638
+ De,
747
639
  "parentIframe.getParentProps(callback) callback"
748
- ), r.onParentInfo = e, z(0, 0, jt), () => {
749
- r.onParentInfo = null, z(0, 0, xn);
640
+ ), s.onParentInfo = e, v(0, 0, xt), () => {
641
+ s.onParentInfo = null, v(0, 0, $n);
750
642
  };
751
643
  }
752
- function Cs(e, t) {
753
- e !== void 0 && k(
644
+ function mr(e, t) {
645
+ e !== void 0 && T(
754
646
  e,
755
- _,
647
+ P,
756
648
  "parentIframe.resize(customHeight, customWidth) customHeight"
757
- ), t !== void 0 && k(
649
+ ), t !== void 0 && T(
758
650
  t,
759
- _,
651
+ P,
760
652
  "parentIframe.resize(customHeight, customWidth) customWidth"
761
653
  );
762
- const n = e === void 0 ? "" : e, o = t === void 0 ? "" : `,${t}`, s = `${n}${o}`;
763
- M(
764
- Be,
765
- `parentIframe.resize(${s})`,
654
+ const n = e === void 0 ? "" : e, o = t === void 0 ? "" : `,${t}`, r = `${n}${o}`;
655
+ z(
656
+ Bt,
657
+ `parentIframe.resize(${r})`,
766
658
  e,
767
659
  t
768
660
  );
769
661
  }
770
- const Je = (e) => (t, n) => {
771
- k(t, _, `parentIframe.${e}(x, y) x`), k(n, _, `parentIframe.${e}(x, y) y`), z(n, t, e);
772
- }, js = Je(Bn), Ps = Je(Dn), _s = Je(Pt);
773
- function xs(e, t) {
774
- t && k(
662
+ const Ze = (e) => (t, n) => {
663
+ T(t, P, `parentIframe.${e}(x, y) x`), T(n, P, `parentIframe.${e}(x, y) y`), v(n, t, e);
664
+ }, gr = Ze(In), hr = Ze(An), pr = Ze(Ft);
665
+ function br(e, t) {
666
+ t && T(
775
667
  t,
776
- ee,
668
+ ge,
777
669
  "parentIframe.sendMessage(msg, targetOrigin) targetOrigin"
778
- ), z(0, 0, $e, JSON.stringify(e), t);
670
+ ), v(0, 0, Te, JSON.stringify(e), t);
779
671
  }
780
- const Bs = () => z(0, 0, Ln), Ds = () => i.parentId, Fs = () => ks("parentIframe.reset");
781
- function Hs() {
782
- const { win: e } = r;
672
+ const wr = () => v(0, 0, kn), vr = () => i.parentId, Er = () => sr("parentIframe.reset");
673
+ function Or() {
674
+ const { win: e } = s;
783
675
  i.mode !== 1 && (e.parentIframe = Object.freeze({
784
- autoResize: $s,
785
- close: Bs,
786
- getId: Ds,
787
- getParentOrigin: Is,
788
- getParentProps: Ls,
789
- moveToAnchor: Ts,
790
- reset: Fs,
791
- setOffsetSize: As,
792
- scrollBy: js,
793
- scrollTo: Ps,
794
- scrollToOffset: _s,
795
- sendMessage: xs,
796
- setTargetOrigin: Ns,
797
- resize: Cs
676
+ autoResize: cr,
677
+ close: wr,
678
+ getId: vr,
679
+ getParentOrigin: lr,
680
+ getParentProps: ur,
681
+ moveToAnchor: ar,
682
+ reset: Er,
683
+ setOffsetSize: dr,
684
+ scrollBy: gr,
685
+ scrollTo: hr,
686
+ scrollToOffset: pr,
687
+ sendMessage: br,
688
+ setTargetOrigin: fr,
689
+ resize: mr
798
690
  }));
799
691
  }
800
- const te = (e = "") => (t) => (n) => {
801
- n.size > 0 && de(
692
+ const Q = (e = "") => (t) => (n) => {
693
+ n.size > 0 && ce(
802
694
  `${t}Observer ${e}:`,
803
- ...Array.from(n).flatMap((o) => [_e, o])
695
+ ...Array.from(n).flatMap((o) => [Ht, o])
804
696
  );
805
- }, Vs = (e = "") => (t) => (n) => {
806
- n.size > 0 && Xt(
697
+ }, yr = (e = "") => (t) => (n) => {
698
+ n.size > 0 && qt(
807
699
  `${t}Observer ${e}:`,
808
- ...Array.from(n).flatMap((o) => [_e, o])
700
+ ...Array.from(n).flatMap((o) => [Ht, o])
809
701
  );
810
- }, yn = te("attached to"), vn = Vs("already attached"), Ws = te("detached from"), be = (e, t = !0) => (n) => {
811
- n > 0 && u(
702
+ }, an = Q("attached to"), dn = yr("already attached"), Sr = Q("detached from"), pe = (e, t = !0) => (n) => {
703
+ n > 0 && l(
812
704
  `${t ? "At" : "De"}tached %c${e}Observer%c ${t ? "to" : "from"} %c${n}%c element${n === 1 ? "" : "s"}`,
813
- a,
814
- Z,
815
- a,
816
- Z
705
+ c,
706
+ q,
707
+ c,
708
+ q
817
709
  );
818
- }, zn = (e, t, n, o) => {
819
- const s = Ws(e);
820
- return (d) => {
821
- const c = /* @__PURE__ */ new Set();
822
- let f = 0;
823
- for (const y of d)
824
- n.has(y) && (t.unobserve(y), n.delete(y), c.add(y), f += 1);
825
- s(c), o(f), c.clear();
710
+ }, ln = (e, t, n, o) => {
711
+ const r = Sr(e);
712
+ return (f) => {
713
+ const d = /* @__PURE__ */ new Set();
714
+ let u = 0;
715
+ for (const b of f)
716
+ n.has(b) && (t.unobserve(b), n.delete(b), d.add(b), u += 1);
717
+ r(d), o(u), d.clear();
826
718
  };
827
- }, Rt = 16, kt = 2, Us = 200, Ke = "Mutation", O = /* @__PURE__ */ new Set(), L = /* @__PURE__ */ new Set(), Ie = /* @__PURE__ */ new Set(), he = [], Gs = {
719
+ }, wt = 16, vt = 2, Rr = 200, je = "Mutation", R = /* @__PURE__ */ new Set(), k = /* @__PURE__ */ new Set(), $e = /* @__PURE__ */ new Set(), de = [], Mr = {
828
720
  attributes: !0,
829
- attributeFilter: [X, Pe],
721
+ attributeFilter: [j, Ce],
830
722
  attributeOldValue: !1,
831
723
  characterData: !1,
832
724
  characterDataOldValue: !1,
833
725
  childList: !0,
834
726
  subtree: !0
835
727
  };
836
- let Oe = 1, Xe, Ne = !1, Le = 0;
837
- const qs = te("added")(Ke), Zs = te("removed (page)")(Ke), Ys = te("removed (added)")(Ke), bn = (e) => e.nodeType !== Node.ELEMENT_NODE || Zt.has(e.tagName.toLowerCase());
838
- function Qs(e) {
728
+ let Ee = 1, Ye, Ie = !1, Ae = 0;
729
+ const Tr = Q("added")(je), zr = Q("removed (page)")(je), $r = Q("removed (added)")(je), fn = (e) => e.nodeType !== Node.ELEMENT_NODE || At.has(e.tagName.toLowerCase());
730
+ function Ir(e) {
839
731
  const t = e.addedNodes;
840
732
  for (const n of t)
841
- bn(n) || O.add(n);
733
+ fn(n) || R.add(n);
842
734
  }
843
- function Js(e) {
735
+ function Ar(e) {
844
736
  const t = e.removedNodes;
845
737
  for (const n of t)
846
- bn(n) || (O.has(n) ? (O.delete(n), Ie.add(n)) : L.add(n));
738
+ fn(n) || (R.has(n) ? (R.delete(n), $e.add(n)) : k.add(n));
847
739
  }
848
- const Ks = (e) => {
849
- u("Mutations:", e);
740
+ const kr = (e) => {
741
+ l("Mutations:", e);
850
742
  for (const t of e)
851
- Qs(t), Js(t);
852
- qs(O), Zs(L), Ys(Ie), Ie.clear();
743
+ Ir(t), Ar(t);
744
+ Tr(R), zr(k), $r($e), $e.clear();
853
745
  };
854
- function Xs() {
855
- L.size > 0 && l(
856
- `Detected %c${L.size} %cremoved element${L.size > 1 ? "s" : ""}`,
857
- a,
858
- v
859
- ), O.size > 0 && l(
860
- `Found %c${O.size} %cnew element${O.size > 1 ? "s" : ""}`,
861
- a,
862
- v
746
+ function Nr() {
747
+ k.size > 0 && a(
748
+ `Detected %c${k.size} %cremoved element${k.size > 1 ? "s" : ""}`,
749
+ c,
750
+ w
751
+ ), R.size > 0 && a(
752
+ `Found %c${R.size} %cnew element${R.size > 1 ? "s" : ""}`,
753
+ c,
754
+ w
863
755
  );
864
756
  }
865
- const er = (e) => () => {
866
- const t = performance.now(), n = t - Le, o = Rt * Oe++ + kt;
867
- if (n > o && n < Us) {
868
- h("mutationThrottled"), u("Update delayed due to heavy workload on the callStack"), u(
869
- `EventLoop busy time: %c${P(n)}ms %c> Max wait: %c${o - kt}ms`,
870
- a,
871
- v,
872
- a
873
- ), setTimeout(Xe, Rt * Oe), Le = t;
757
+ const Lr = (e) => () => {
758
+ const t = performance.now(), n = t - Ae, o = wt * Ee++ + vt;
759
+ if (n > o && n < Rr) {
760
+ g("mutationThrottled"), l("Update delayed due to heavy workload on the callStack"), l(
761
+ `EventLoop busy time: %c${C(n)}ms %c> Max wait: %c${o - vt}ms`,
762
+ c,
763
+ w,
764
+ c
765
+ ), setTimeout(Ye, wt * Ee), Ae = t;
874
766
  return;
875
767
  }
876
- Oe = 1, he.forEach(Ks), he.length = 0, Ne = !1, Xs(), e({ addedNodes: O, removedNodes: L }), O.clear(), L.clear();
768
+ Ee = 1, de.forEach(kr), de.length = 0, Ie = !1, Nr(), e({ addedNodes: R, removedNodes: k }), R.clear(), k.clear();
877
769
  };
878
- function tr(e) {
879
- he.push(e), !Ne && (Le = performance.now(), Ne = !0, requestAnimationFrame(Xe));
770
+ function Cr(e) {
771
+ de.push(e), !Ie && (Ae = performance.now(), Ie = !0, requestAnimationFrame(Ye));
880
772
  }
881
- function nr(e) {
882
- const t = new window.MutationObserver(tr), n = document.body || document.documentElement;
883
- return Xe = er(e), t.observe(n, Gs), u("Attached%c MutationObserver%c to body", a, v), {
773
+ function Pr(e) {
774
+ const t = new window.MutationObserver(Cr), n = document.body || document.documentElement;
775
+ return Ye = Lr(e), t.observe(n, Mr), l("Attached%c MutationObserver%c to body", c, w), {
884
776
  disconnect: () => {
885
- O.clear(), L.clear(), he.length = 0, t.disconnect(), u("Detached%c MutationObserver", a);
777
+ R.clear(), k.clear(), de.length = 0, t.disconnect(), l("Detached%c MutationObserver", c);
886
778
  }
887
779
  };
888
780
  }
889
- const or = {
781
+ const _r = {
890
782
  characterData: !0,
891
783
  childList: !0,
892
784
  subtree: !0
893
785
  };
894
- function sr(e) {
786
+ function Dr(e) {
895
787
  const t = document.querySelector("title") ?? document.head ?? document.documentElement, n = new MutationObserver(e);
896
- return n.observe(t, or), u("Attached%c TitleObserver%c to head", a, v), setTimeout(e), {
788
+ return n.observe(t, _r), l("Attached%c TitleObserver%c to head", c, w), setTimeout(e), {
897
789
  disconnect: () => {
898
- n.disconnect(), u("Detached%c TitleObserver", a);
790
+ n.disconnect(), l("Detached%c TitleObserver", c);
899
791
  }
900
792
  };
901
793
  }
902
- function rr(e) {
794
+ function Br(e) {
903
795
  const t = new IntersectionObserver(
904
796
  (o) => e(o.at(-1)?.isIntersecting ?? !1),
905
797
  {
906
798
  threshold: 0
907
799
  }
908
800
  ), n = document.documentElement;
909
- return t.observe(n), u("Attached%c VisibilityObserver%c to page", a, v), {
801
+ return t.observe(n), l("Attached%c VisibilityObserver%c to page", c, w), {
910
802
  disconnect: () => {
911
- t.disconnect(), u("Detached%c VisibilityObserver", a);
803
+ t.disconnect(), l("Detached%c VisibilityObserver", c);
912
804
  }
913
805
  };
914
806
  }
915
- let Mt = /* @__PURE__ */ new Set();
916
- function ir(e) {
807
+ let Et = /* @__PURE__ */ new Set();
808
+ function xr(e) {
917
809
  const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
918
810
  for (const o of e)
919
- o.closest(`[${X}]`) ? n.add(o) : t.add(o);
811
+ o.closest(`[${j}]`) ? n.add(o) : t.add(o);
920
812
  return n.size > 0 && queueMicrotask(() => {
921
- h("overflowIgnored"), u(`Ignoring elements with [data-iframe-ignore] > *:
922
- `, n), x();
813
+ g("overflowIgnored"), l(`Ignoring elements with [data-iframe-ignore] > *:
814
+ `, n), _();
923
815
  }), t;
924
816
  }
925
- function wn() {
926
- const e = document.querySelectorAll(`[${_t}]`), t = ir(e);
817
+ function un() {
818
+ const e = document.querySelectorAll(`[${Vt}]`), t = xr(e);
927
819
  let n = !0;
928
- return typeof Set.prototype.symmetricDifference === xe && (n = t.symmetricDifference(Mt).size > 0), Mt = t, r.overflowedNodeSet = t, r.hasOverflow = t.size > 0, { hasOverflowUpdated: n, overflowedNodeSet: t };
820
+ return typeof Set.prototype.symmetricDifference === De && (n = t.symmetricDifference(Et).size > 0), Et = t, s.overflowedNodeSet = t, s.hasOverflow = t.size > 0, { hasOverflowUpdated: n, overflowedNodeSet: t };
929
821
  }
930
- const R = {}, Sn = (e) => {
822
+ const M = {}, mn = (e) => {
931
823
  const t = /* @__PURE__ */ new Set();
932
824
  for (const n of e)
933
825
  if (n instanceof Element) {
934
826
  t.add(n);
935
- for (const o of Ze(n)) t.add(o);
827
+ for (const o of Ue(n)) t.add(o);
936
828
  }
937
- return u(`Inspecting:
829
+ return l(`Inspecting:
938
830
  `, t), t;
939
- }, cr = (e) => {
831
+ }, Fr = (e) => {
940
832
  if (e.size === 0) return;
941
- h("addObservers");
942
- const t = Sn(e);
943
- R.overflow.attachObservers(t), R.resize.attachObserverToNonStaticElements(t), x();
944
- }, ar = (e) => {
833
+ g("addObservers");
834
+ const t = mn(e);
835
+ M.overflow.attachObservers(t), M.resize.attachObserverToNonStaticElements(t), _();
836
+ }, Hr = (e) => {
945
837
  if (e.size === 0) return;
946
- h("removeObservers");
947
- const t = Sn(e);
948
- R.overflow.detachObservers(t), R.resize.detachObservers(t), x();
838
+ g("removeObservers");
839
+ const t = mn(e);
840
+ M.overflow.detachObservers(t), M.resize.detachObservers(t), _();
949
841
  };
950
- function lr({
842
+ function Vr({
951
843
  addedNodes: e,
952
844
  removedNodes: t
953
845
  }) {
954
- h("contentMutated"), r.applySelectors(), ln(), wn(), x(), ar(t), cr(e);
846
+ g("contentMutated"), s.applySelectors(), Xt(), un(), _(), Hr(t), Fr(e);
955
847
  }
956
- function ur(e) {
957
- lr(e), M(Wt, "Mutation Observed");
848
+ function Gr(e) {
849
+ Vr(e), z(Pt, "Mutation Observed");
958
850
  }
959
- const ne = "Overflow", dr = be(ne), fr = be(ne, !1), mr = yn(ne), hr = vn(ne), gr = (e) => e instanceof HTMLElement && (!!e.hidden || e.offsetParent === null || e.style.display === He), pr = (e, t) => {
960
- const n = t.side, o = {
851
+ const J = "Overflow", Ur = pe(J), Wr = pe(J, !1), qr = an(J), Zr = dn(J), jr = (e) => e instanceof HTMLElement && (!!e.hidden || e.offsetParent === null || e.style.display === Le), Yr = (e, t) => {
852
+ const n = t.side || Pe, o = {
961
853
  root: t.root,
962
854
  rootMargin: "0px",
963
855
  threshold: 1
964
- }, s = window?.requestAnimationFrame || ue, d = (S = !1) => e(S), c = (S, $) => S === 0 || S > $[n], f = (S, $) => {
965
- S.toggleAttribute(_t, $);
856
+ }, r = window?.requestAnimationFrame || ie, f = (y = !1) => e(y), d = (y, $) => y === 0 || y > $[n], u = (y, $) => {
857
+ y.toggleAttribute(Vt, $);
966
858
  };
967
- function y(S) {
968
- for (const $ of S) {
969
- const { boundingClientRect: V, rootBounds: W, target: E } = $;
970
- if (!W) continue;
971
- const kn = V[n], Mn = c(kn, W) && !(E instanceof HTMLElement && gr(E));
972
- f(E, Mn);
859
+ function b(y) {
860
+ for (const $ of y) {
861
+ const { boundingClientRect: F, rootBounds: H, target: S } = $;
862
+ if (!H) continue;
863
+ const bn = F[n], wn = d(bn, H) && !(S instanceof HTMLElement && jr(S));
864
+ u(S, wn);
973
865
  }
974
- s(d);
866
+ r(f);
975
867
  }
976
- const m = new IntersectionObserver(y, o), b = /* @__PURE__ */ new WeakSet();
977
- function g(S) {
978
- const $ = /* @__PURE__ */ new Set(), V = /* @__PURE__ */ new Set();
979
- let W = 0;
980
- for (const E of S)
981
- if (E instanceof Element) {
982
- if (b.has(E)) {
983
- $.add(E);
868
+ const m = new IntersectionObserver(b, o), E = /* @__PURE__ */ new WeakSet();
869
+ function h(y) {
870
+ const $ = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ new Set();
871
+ let H = 0;
872
+ for (const S of y)
873
+ if (S instanceof Element) {
874
+ if (E.has(S)) {
875
+ $.add(S);
984
876
  continue;
985
877
  }
986
- m.observe(E), b.add(E), V.add(E), W += 1;
878
+ m.observe(S), E.add(S), F.add(S), H += 1;
987
879
  }
988
- hr($), mr(V), dr(W), V.clear(), $.clear();
880
+ Zr($), qr(F), Ur(H), F.clear(), $.clear();
989
881
  }
990
882
  return {
991
- attachObservers: g,
992
- detachObservers: zn(
993
- ne,
883
+ attachObservers: h,
884
+ detachObservers: ln(
885
+ J,
994
886
  m,
995
- b,
996
- fr
887
+ E,
888
+ Wr
997
889
  ),
998
890
  disconnect: () => {
999
- m.disconnect(), u("Detached%c OverflowObserver", a);
891
+ m.disconnect(), l("Detached%c OverflowObserver", c);
1000
892
  }
1001
893
  };
1002
894
  };
1003
- function yr() {
1004
- const { hasOverflow: e } = r, { hasOverflowUpdated: t, overflowedNodeSet: n } = wn();
895
+ function Qr() {
896
+ const { hasOverflow: e } = s, { hasOverflowUpdated: t, overflowedNodeSet: n } = un();
1005
897
  switch (!0) {
1006
898
  case !t:
1007
899
  return;
1008
900
  case n.size > 1:
1009
- u("Overflowed Elements:", n);
901
+ l("Overflowed Elements:", n);
1010
902
  break;
1011
903
  case e:
1012
904
  break;
1013
905
  default:
1014
- u("No overflow detected");
906
+ l("No overflow detected");
1015
907
  }
1016
- M(Fe, "Overflow updated");
908
+ z(_e, "Overflow updated");
1017
909
  }
1018
- function vr(e) {
910
+ function Jr(e) {
1019
911
  const t = {
1020
912
  root: document.documentElement,
1021
- side: i.calculateHeight ? Dt : Ft
913
+ side: i.calculateHeight ? Pe : Nt
1022
914
  };
1023
- return R.overflow = pr(yr, t), R.overflow.attachObservers(e), R.overflow;
915
+ return M.overflow = Yr(Qr, t), M.overflow.attachObservers(e), M.overflow;
1024
916
  }
1025
- const oe = "Resize", zr = be(oe), br = be(oe, !1), wr = yn(oe), Sr = vn(oe), ge = /* @__PURE__ */ new WeakSet(), Re = /* @__PURE__ */ new Set(), ke = /* @__PURE__ */ new Set();
1026
- let q;
1027
- function Er(e) {
917
+ const K = "Resize", Kr = pe(K), Xr = pe(K, !1), es = an(K), ts = dn(K), le = /* @__PURE__ */ new WeakSet(), Oe = /* @__PURE__ */ new Set(), ye = /* @__PURE__ */ new Set();
918
+ let U;
919
+ function ns(e) {
1028
920
  let t = 0;
1029
921
  for (const n of e) {
1030
922
  if (!(n instanceof Element)) continue;
1031
923
  const o = getComputedStyle(n)?.position;
1032
924
  if (!(o === "" || o === "static")) {
1033
- if (ge.has(n)) {
1034
- Re.add(n);
925
+ if (le.has(n)) {
926
+ Oe.add(n);
1035
927
  continue;
1036
928
  }
1037
- q.observe(n), ge.add(n), ke.add(n), t += 1;
929
+ U.observe(n), le.add(n), ye.add(n), t += 1;
1038
930
  }
1039
931
  }
1040
- Sr(Re), wr(ke), zr(t), ke.clear(), Re.clear();
1041
- }
1042
- const Or = (e) => (q = new ResizeObserver(e), q.observe(document.body), ge.add(document.body), u("Attached%c ResizeObserver%c to body", a, v), {
1043
- attachObserverToNonStaticElements: Er,
1044
- detachObservers: zn(
1045
- oe,
1046
- q,
1047
- ge,
1048
- br
932
+ ts(Oe), es(ye), Kr(t), ye.clear(), Oe.clear();
933
+ }
934
+ const os = (e) => (U = new ResizeObserver(e), U.observe(document.body), le.add(document.body), l("Attached%c ResizeObserver%c to body", c, w), {
935
+ attachObserverToNonStaticElements: ns,
936
+ detachObservers: ln(
937
+ K,
938
+ U,
939
+ le,
940
+ Xr
1049
941
  ),
1050
942
  disconnect: () => {
1051
- q.disconnect(), u("Detached%c ResizeObserver", a);
943
+ U.disconnect(), l("Detached%c ResizeObserver", c);
1052
944
  }
1053
945
  });
1054
- function Rr(e) {
946
+ function rs(e) {
1055
947
  if (!Array.isArray(e) || e.length === 0) return;
1056
948
  const t = e[0].target;
1057
- M(Vt, `Element resized <${Kn(t)}>`);
949
+ z(Ct, `Element resized <${Un(t)}>`);
1058
950
  }
1059
- function kr(e) {
1060
- return R.resize = Or(Rr), R.resize.attachObserverToNonStaticElements(e), R.resize;
951
+ function ss(e) {
952
+ return M.resize = os(rs), M.resize.attachObserverToNonStaticElements(e), M.resize;
1061
953
  }
1062
- let $t;
1063
- function Mr() {
954
+ let Ot;
955
+ function is() {
1064
956
  const e = document.title;
1065
- e !== $t && ($t = e, l(`Title: %c${e}`, a), e && z(0, 0, Fn, e));
1066
- }
1067
- function $r(e) {
1068
- l(`Visible: %c${e}`, a), r.isHidden = !e, M(Ut, "Visibility changed");
1069
- }
1070
- function Tr(e) {
1071
- Ue.push(...e.map((t) => t.disconnect));
1072
- }
1073
- function Ar() {
1074
- h("attachObservers");
1075
- const e = Ze(document.documentElement), t = [
1076
- nr(ur),
1077
- vr(e),
1078
- ms(),
1079
- kr(e),
1080
- sr(Mr),
1081
- rr($r)
957
+ e !== Ot && (Ot = e, a(`Title: %c${e}`, c), e && v(0, 0, Nn, e));
958
+ }
959
+ function cs(e) {
960
+ a(`Visible: %c${e}`, c), s.isHidden = !e, z(Lt, "Visibility changed");
961
+ }
962
+ function as(e) {
963
+ Ve.push(...e.map((t) => t.disconnect));
964
+ }
965
+ function ds() {
966
+ g("attachObservers");
967
+ const e = Ue(document.documentElement), t = [
968
+ Pr(Gr),
969
+ Jr(e),
970
+ qo(),
971
+ ss(e),
972
+ Dr(is),
973
+ Br(cs)
1082
974
  ];
1083
- Tr(t);
975
+ as(t);
1084
976
  }
1085
- const Tt = (e, t, n) => {
977
+ const yt = (e, t, n) => {
1086
978
  if (n !== "") {
1087
- l(`${e}: %c${n}`, a);
979
+ a(`${e}: %c${n}`, c);
1088
980
  for (const o of document.querySelectorAll(n))
1089
- l(`Applying ${t} to:`, o), o.toggleAttribute(t, !0);
981
+ a(`Applying ${t} to:`, o), o.toggleAttribute(t, !0);
1090
982
  }
1091
983
  };
1092
- function Ir({
984
+ function ls({
1093
985
  sizeSelector: e,
1094
986
  ignoreSelector: t
1095
987
  }) {
1096
988
  return () => {
1097
- Tt("sizeSelector", Pe, e), Tt("ignoreSelector", X, t);
989
+ yt("sizeSelector", Ce, e), yt("ignoreSelector", j, t);
1098
990
  };
1099
991
  }
1100
- function Nr() {
992
+ function fs() {
1101
993
  const e = document.createElement("div");
1102
994
  e.style.clear = "both", e.style.display = "block", e.style.height = "0", document.body.append(e);
1103
995
  }
1104
- function Lr(e, t) {
1105
- return t.includes("-") && (H(`Negative CSS value ignored for ${e}`), t = ""), t;
996
+ function us(e, t) {
997
+ return t.includes("-") && (x(`Negative CSS value ignored for ${e}`), t = ""), t;
1106
998
  }
1107
- function Ce(e, t) {
1108
- t === void 0 || t === "" || t === Gn || (document.body.style.setProperty(e, t), u(`Set body ${e}: %c${t}`, a));
999
+ function ke(e, t) {
1000
+ t === void 0 || t === "" || t === Ln || (document.body.style.setProperty(e, t), l(`Set body ${e}: %c${t}`, c));
1109
1001
  }
1110
- function Cr({
1002
+ function ms({
1111
1003
  bodyMarginStr: e,
1112
1004
  bodyMargin: t
1113
1005
  }) {
1114
- e === void 0 && (e = `${t}px`), Ce("margin", Lr("margin", e));
1006
+ e === void 0 && (e = `${t}px`), ke("margin", us("margin", e));
1115
1007
  }
1116
- const jr = () => ({
1008
+ const gs = () => ({
1117
1009
  x: document.documentElement.scrollLeft,
1118
1010
  y: document.documentElement.scrollTop
1119
1011
  });
1120
- function Pr(e) {
1121
- const t = e.getBoundingClientRect(), n = jr();
1012
+ function hs(e) {
1013
+ const t = e.getBoundingClientRect(), n = gs();
1122
1014
  return {
1123
1015
  x: Math.round(t.left + n.x),
1124
1016
  y: Math.round(t.top + n.y)
1125
1017
  };
1126
1018
  }
1127
- function _r(e, t) {
1128
- const n = Pr(t);
1129
- l(
1019
+ function ps(e, t) {
1020
+ const n = hs(t);
1021
+ a(
1130
1022
  `Moving to in page link (%c#${e}%c) at x: %c${n.x}%c y: %c${n.y}`,
1131
- a,
1132
- v,
1133
- a,
1134
- v,
1135
- a
1136
- ), z(n.y, n.x, Pt);
1137
- }
1138
- function et(e) {
1023
+ c,
1024
+ w,
1025
+ c,
1026
+ w,
1027
+ c
1028
+ ), v(n.y, n.x, Ft);
1029
+ }
1030
+ function Qe(e) {
1139
1031
  const t = e.split("#")[1] || e, n = decodeURIComponent(t), o = document.getElementById(n) || document.getElementsByName(n)[0];
1140
1032
  if (o !== void 0) {
1141
- _r(t, o);
1033
+ ps(t, o);
1142
1034
  return;
1143
1035
  }
1144
- l(`In page link (#${t}) not found in iframe, so sending to parent`), z(0, 0, Cn, `#${t}`);
1036
+ a(`In page link (#${t}) not found in iframe, so sending to parent`), v(0, 0, Cn, `#${t}`);
1145
1037
  }
1146
- function En() {
1038
+ function gn() {
1147
1039
  const { hash: e, href: t } = window.location;
1148
- e !== "" && e !== "#" && et(t);
1040
+ e !== "" && e !== "#" && Qe(t);
1149
1041
  }
1150
- function xr() {
1042
+ function bs() {
1151
1043
  for (const e of document.querySelectorAll('a[href^="#"]'))
1152
- e.getAttribute("href") !== "#" && C(e, "click", (t) => {
1153
- t.preventDefault(), et(e.getAttribute("href"));
1044
+ e.getAttribute("href") !== "#" && N(e, "click", (t) => {
1045
+ t.preventDefault(), Qe(e.getAttribute("href"));
1154
1046
  });
1155
1047
  }
1156
- function Br() {
1157
- C(window, "hashchange", En);
1048
+ function ws() {
1049
+ N(window, "hashchange", gn);
1158
1050
  }
1159
- function Dr() {
1160
- setTimeout(En, qt);
1051
+ function vs() {
1052
+ setTimeout(gn, Gt);
1161
1053
  }
1162
- function Fr() {
1163
- l("Setting up location.hash handlers"), xr(), Br(), Dr(), r.inPageLinks = {
1164
- findTarget: et
1054
+ function Es() {
1055
+ a("Setting up location.hash handlers"), bs(), ws(), vs(), s.inPageLinks = {
1056
+ findTarget: Qe
1165
1057
  };
1166
1058
  }
1167
- function Hr(e) {
1059
+ function Os(e) {
1168
1060
  const { mode: t } = i;
1169
- e ? Ge(t) ? w(T(5)) : Fr() : l("In page linking not enabled");
1061
+ e ? Be(t) ? O(I(5)) : Es() : a("In page linking not enabled");
1170
1062
  }
1171
- const Vr = "important";
1172
- function Wr() {
1173
- const e = (t) => t.style.setProperty(ve, Q, Vr);
1174
- e(document.documentElement), e(document.body), l("Set HTML & body height: %cauto !important", a);
1063
+ const ys = "important";
1064
+ function Ss() {
1065
+ const e = (t) => t.style.setProperty(me, se, ys);
1066
+ e(document.documentElement), e(document.body), a("Set HTML & body height: %cauto !important", c);
1175
1067
  }
1176
- const tt = (e) => (t, n) => {
1068
+ const Je = (e) => (t, n) => {
1177
1069
  if (n in t) {
1178
1070
  if (typeof t[n] === e) return t[n];
1179
1071
  throw new TypeError(`${n} is not a ${e}.`);
1180
1072
  }
1181
- }, Me = tt(xe), At = tt(_), re = tt(ee), Ur = (e) => e !== null && typeof e === Vn && !Array.isArray(e);
1182
- function Gr(e) {
1073
+ }, Se = Je(De), St = Je(P), ee = Je(ge), Rs = (e) => e !== null && typeof e === Pn && !Array.isArray(e);
1074
+ function Ms(e) {
1183
1075
  const { calculateHeight: t, calculateWidth: n } = i;
1184
- let o, s;
1185
- return typeof e?.offsetSize === _ && (t && (o = At(e, rt)), n && (s = At(e, rt))), { offsetHeight: o, offsetWidth: s };
1076
+ let o, r;
1077
+ return typeof e?.offsetSize === P && (t && (o = St(e, nt)), n && (r = St(e, nt))), { offsetHeight: o, offsetWidth: r };
1186
1078
  }
1187
- function qr(e) {
1188
- l("Reading data from page:", Object.keys(e));
1189
- const { offsetHeight: t, offsetWidth: n } = Gr(e);
1079
+ function Ts(e) {
1080
+ a("Reading data from page:", Object.keys(e));
1081
+ const { offsetHeight: t, offsetWidth: n } = Ms(e);
1190
1082
  return {
1191
1083
  offsetHeight: t,
1192
1084
  offsetWidth: n,
1193
- ignoreSelector: re(e, "ignoreSelector"),
1194
- [vt(3)]: re(e, vt(0)),
1195
- sizeSelector: re(e, "sizeSelector"),
1196
- targetOrigin: re(e, "targetOrigin"),
1197
- onBeforeResize: Me(e, "onBeforeResize"),
1198
- onMessage: Me(e, "onMessage"),
1199
- onReady: Me(e, "onReady")
1085
+ ignoreSelector: ee(e, "ignoreSelector"),
1086
+ [st(3)]: ee(e, st(0)),
1087
+ sizeSelector: ee(e, "sizeSelector"),
1088
+ targetOrigin: ee(e, "targetOrigin"),
1089
+ onBeforeResize: Se(e, "onBeforeResize"),
1090
+ onMessage: Se(e, "onMessage"),
1091
+ onReady: Se(e, "onReady")
1200
1092
  };
1201
1093
  }
1202
- function Zr() {
1094
+ function zs() {
1203
1095
  const { mode: e } = i;
1204
- if (Ge(e)) return {};
1096
+ if (Be(e)) return {};
1205
1097
  const t = window.iframeResizer || window.iFrameResizer;
1206
- return Ur(t) ? qr(t) : {};
1098
+ return Rs(t) ? Ts(t) : {};
1207
1099
  }
1208
- const Yr = (e) => e === "true", On = (e) => (t) => t === void 0 ? void 0 : e(t), j = On(Yr), G = On(Number), Qr = (e) => ({
1100
+ const $s = (e) => e === "true", hn = (e) => (t) => t === void 0 ? void 0 : e(t), L = hn($s), G = hn(Number), Is = (e) => ({
1209
1101
  parentId: e[0],
1210
1102
  bodyMargin: G(e[1]),
1211
- calculateWidth: j(e[2]),
1212
- logging: j(e[3]),
1103
+ calculateWidth: L(e[2]),
1104
+ logging: L(e[3]),
1213
1105
  // data[4] no longer used (was intervalTimer)
1214
- autoResize: j(e[6]),
1106
+ autoResize: L(e[6]),
1215
1107
  bodyMarginStr: e[7],
1216
1108
  // data[8] no longer used (was heightCalcMode)
1217
1109
  bodyBackground: e[9],
1218
1110
  bodyPadding: e[10],
1219
1111
  tolerance: G(e[11]),
1220
- inPageLinks: j(e[12]),
1112
+ inPageLinks: L(e[12]),
1221
1113
  // data[13] no longer used (was resizeFrom)
1222
1114
  // data[14] no longer used (was widthCalcMode)
1223
- mouseEvents: j(e[15]),
1115
+ mouseEvents: L(e[15]),
1224
1116
  offsetHeight: G(e[16]),
1225
1117
  offsetWidth: G(e[17]),
1226
- calculateHeight: j(e[18]),
1118
+ calculateHeight: L(e[18]),
1227
1119
  key: e[19],
1228
1120
  version: e[20],
1229
1121
  mode: G(e[21]),
1230
1122
  // sizeSelector: data[22] // Now only available via page settings
1231
- logExpand: j(e[23])
1123
+ logExpand: L(e[23])
1232
1124
  });
1233
- function Jr(e) {
1125
+ function As(e) {
1234
1126
  const { mode: t } = i;
1235
1127
  e.forEach((n) => {
1236
1128
  try {
1237
1129
  n();
1238
1130
  } catch (o) {
1239
1131
  if (t < 0) throw o;
1240
- w(
1132
+ O(
1241
1133
  `<rb>Error in setup function</>
1242
1134
  <i>iframe-resizer</> detected an error during setup.
1243
1135
 
1244
1136
  Please report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>`
1245
- ), Xt(o);
1137
+ ), qt(o);
1246
1138
  }
1247
1139
  });
1248
1140
  }
1249
- function It(e) {
1141
+ function Rt(e) {
1250
1142
  for (const [t, n] of Object.entries(e))
1251
1143
  n !== void 0 && (i[t] = n);
1252
1144
  }
1253
- function Kr({
1145
+ function ks({
1254
1146
  logExpand: e,
1255
1147
  logging: t,
1256
1148
  parentId: n = ""
1257
1149
  }) {
1258
- co({ id: n, enabled: t, expand: e }), h("initReceived"), l(`Initialising iframe v${K} ${window.location.href}`);
1150
+ Yn({ id: n, enabled: t, expand: e }), g("initReceived"), a(`Initialising iframe v${Y} ${window.location.href}`);
1259
1151
  }
1260
- function Xr(e) {
1261
- h("ready"), an(Yt(e)), l("Initialization complete", (({ key: t, key2: n, ...o }) => o)(i));
1152
+ function Ns(e) {
1153
+ g("ready"), Kt(Ut(e)), a("Initialization complete", (({ key: t, key2: n, ...o }) => o)(i));
1262
1154
  }
1263
- function ei({
1155
+ function Ls({
1264
1156
  bodyBackground: e,
1265
1157
  bodyPadding: t,
1266
1158
  inPageLinks: n,
1267
1159
  onReady: o
1268
1160
  }) {
1269
- const s = Ro(i), d = [
1270
- $o,
1271
- ko,
1272
- Ho,
1273
- ln,
1274
- Wo,
1275
- s ? ue : Oo,
1276
- () => Cr(i),
1277
- () => Ce("background", e),
1278
- () => Ce("padding", t),
1279
- s ? ue : Wr,
1280
- Nr,
1281
- r.applySelectors,
1282
- () => Hr(n),
1283
- Os,
1284
- () => Xo(i),
1285
- ns,
1286
- () => Hs(),
1287
- () => M(
1288
- ye,
1161
+ const r = mo(i), f = [
1162
+ po,
1163
+ go,
1164
+ Oo,
1165
+ Xt,
1166
+ So,
1167
+ r ? ie : uo,
1168
+ () => ms(i),
1169
+ () => ke("background", e),
1170
+ () => ke("padding", t),
1171
+ r ? ie : Ss,
1172
+ fs,
1173
+ s.applySelectors,
1174
+ () => Os(n),
1175
+ or,
1176
+ () => No(i),
1177
+ Po,
1178
+ () => Or(),
1179
+ () => z(
1180
+ ue,
1289
1181
  "Init message from host page",
1290
1182
  void 0,
1291
1183
  void 0,
1292
- `${K}:${i.mode}`
1184
+ `${Y}:${i.mode}`
1293
1185
  ),
1294
- Ar,
1295
- x
1186
+ ds,
1187
+ _
1296
1188
  ];
1297
- qo(i), Bo(i), Jr(d), Xr(o);
1189
+ To(i), wo(i), As(f), Ns(o);
1298
1190
  }
1299
- function ti(e) {
1300
- r.firstRun && (It(Qr(e)), Kr(i), It(Zr()), r.applySelectors = Ir(i), ei(i));
1191
+ function Cs(e) {
1192
+ s.firstRun && (Rt(Is(e)), ks(i), Rt(zs()), s.applySelectors = ls(i), Ls(i));
1301
1193
  }
1302
- function ni(e) {
1194
+ function Ps(e) {
1303
1195
  if (document.readyState === "loading") {
1304
- l("Page not ready, ignoring init message");
1196
+ a("Page not ready, ignoring init message");
1305
1197
  return;
1306
1198
  }
1307
- const t = e.data.slice(Gt).split(pe);
1308
- r.target = e.source, r.origin = e.origin, ti(t), r.firstRun = !1, setTimeout(() => {
1309
- r.initLock = !1;
1310
- }, qt);
1311
- }
1312
- const { freeze: oi } = Object, { parse: nt } = JSON, ot = (e) => oi(nt(e)), Rn = (e) => z(0, 0, `${e}Stop`), we = (e) => e.data.slice(e.data.indexOf(pe) + 1), si = (e) => ho(e) ? ye : e.data.split("]")[1].split(pe)[0];
1313
- function ri(e) {
1314
- const t = we(e);
1315
- l("onMessage called from parent:%c", a, ot(t)), ze(i.onMessage, nt(t));
1316
- }
1317
- function ii(e) {
1318
- const { onPageInfo: t } = r, n = we(e);
1319
- l("PageInfo received from parent:", ot(n)), t ? ze(t, nt(n)) : Rn(_n);
1320
- }
1321
- function ci(e) {
1322
- const { onParentInfo: t } = r, n = ot(we(e));
1323
- l("ParentInfo received from parent:", n), t ? ze(t, n) : Rn(jt);
1324
- }
1325
- function ai() {
1326
- if (r.initLock) {
1327
- l("Page reset ignored by init");
1199
+ const t = e.data.slice(zt).split(fe);
1200
+ s.target = e.source, s.origin = e.origin, Cs(t), s.firstRun = !1, setTimeout(() => {
1201
+ s.initLock = !1;
1202
+ }, Gt);
1203
+ }
1204
+ const { freeze: _s } = Object, { parse: Ke } = JSON, Xe = (e) => _s(Ke(e)), pn = (e) => v(0, 0, `${e}Stop`), be = (e) => e.data.slice(e.data.indexOf(fe) + 1), Ds = (e) => to(e) ? ue : e.data.split("]")[1].split(fe)[0];
1205
+ function Bs(e) {
1206
+ const t = be(e);
1207
+ a("onMessage called from parent:%c", c, Xe(t)), he(i.onMessage, Ke(t));
1208
+ }
1209
+ function xs(e) {
1210
+ const { onPageInfo: t } = s, n = be(e);
1211
+ a("PageInfo received from parent:", Xe(n)), t ? he(t, Ke(n)) : pn(_n);
1212
+ }
1213
+ function Fs(e) {
1214
+ const { onParentInfo: t } = s, n = Xe(be(e));
1215
+ a("ParentInfo received from parent:", n), t ? he(t, n) : pn(xt);
1216
+ }
1217
+ function Hs() {
1218
+ if (s.initLock) {
1219
+ a("Page reset ignored by init");
1328
1220
  return;
1329
1221
  }
1330
- l("Page size reset by host page"), pn("resetPage");
1222
+ a("Page size reset by host page"), cn("resetPage");
1331
1223
  }
1332
- function li() {
1333
- l("Resize requested by host page"), M(De, "Parent window requested size check");
1224
+ function Vs() {
1225
+ a("Resize requested by host page"), z(Dt, "Parent window requested size check");
1334
1226
  }
1335
- const Nt = (e) => r.inPageLinks.findTarget(we(e)), Lt = {
1336
- init: ni,
1337
- reset: ai,
1338
- resize: li,
1339
- moveToAnchor: Nt,
1340
- inPageLink: Nt,
1227
+ const Mt = (e) => s.inPageLinks.findTarget(be(e)), Tt = {
1228
+ init: Ps,
1229
+ reset: Hs,
1230
+ resize: Vs,
1231
+ moveToAnchor: Mt,
1232
+ inPageLink: Mt,
1341
1233
  // Backward compatibility
1342
- pageInfo: ii,
1343
- parentInfo: ci,
1344
- message: ri
1234
+ pageInfo: xs,
1235
+ parentInfo: Fs,
1236
+ message: Bs
1345
1237
  };
1346
- function ui(e) {
1347
- const { firstRun: t } = r, n = si(e);
1348
- switch (h(n), !0) {
1349
- case n in Lt:
1350
- Lt[n](e);
1238
+ function Gs(e) {
1239
+ const { firstRun: t } = s, n = Ds(e);
1240
+ switch (g(n), !0) {
1241
+ case n in Tt:
1242
+ Tt[n](e);
1351
1243
  break;
1352
- case (t && mo()):
1353
- H(
1244
+ case (t && eo()):
1245
+ x(
1354
1246
  `Ignored message of type "${n}". Received before initialization.`
1355
1247
  );
1356
1248
  break;
1357
1249
  default:
1358
- H(
1250
+ x(
1359
1251
  `Unexpected message (${e.data}), this is likely due to a newer version of iframe-resizer running on the parent page.`
1360
1252
  );
1361
1253
  }
1362
1254
  }
1363
- const ie = We((e) => {
1364
- fo(e) && ui(e);
1255
+ const te = Fe((e) => {
1256
+ Xn(e) && Gs(e);
1365
1257
  });
1366
- function di() {
1258
+ function Us() {
1367
1259
  if ("iframeChildListener" in window) {
1368
- H("Already setup");
1260
+ x("Already setup");
1369
1261
  return;
1370
1262
  }
1371
1263
  window.iframeChildListener = ((t) => {
1372
- setTimeout(() => ie({ data: t, sameOrigin: !0 }));
1373
- }), h("listen"), C(window, $e, ie), C(document, Bt, ft), ft();
1264
+ setTimeout(() => te({ data: t, sameOrigin: !0 }));
1265
+ }), g("listen"), N(window, Te, te), N(document, $t, dt), dt();
1374
1266
  function e(t) {
1375
- return ie(t), r.win;
1267
+ return te(t), s.win;
1376
1268
  }
1377
1269
  try {
1378
- top?.document?.getElementById("banner") && (r.win = {}, window.mockMsgListener = e, nn(window, $e, ie), typeof window.define == "function" && window.define([], () => e));
1270
+ top?.document?.getElementById("banner") && (s.win = {}, window.mockMsgListener = e, Yt(window, Te, te), typeof window.define == "function" && window.define([], () => e));
1379
1271
  } catch {
1380
1272
  }
1381
1273
  }
1382
- typeof window !== Wn && di();
1274
+ typeof window !== Dn && Us();
1383
1275
  //# sourceMappingURL=index.esm.js.map