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