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