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