@iframe-resizer/child 6.0.0-beta.1 → 6.0.0-beta.3

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