@iframe-resizer/core 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/index.cjs.js +14 -14
- package/index.cjs.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.esm.js +530 -456
- package/index.esm.js.map +1 -1
- package/index.umd.js +17 -17
- package/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +7 -7
package/index.esm.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
`,
|
|
1
|
+
import nt, { NORMAL as ot, HIGHLIGHT as l, FOREGROUND as z } from "auto-console-group";
|
|
2
|
+
const _ = "6.0.0-beta.2", de = "iframeResizer", L = ":", it = "[iFrameResizerChild]Ready", ge = "autoResize", st = "beforeUnload", rt = "close", at = "inPageLink", j = "init", ye = "iframeReady", ct = "lazy", G = "load", A = "message", lt = "mouseenter", ut = "mouseleave", me = "onload", be = "pageInfo", ve = "parentInfo", ft = "pageInfoStop", pt = "parentInfoStop", U = "reset", Y = "resize", ht = "scrollBy", dt = "scrollTo", gt = "scrollToOffset", yt = "title", ee = 1, mt = "height", bt = "width", vt = "offset", zt = "offsetSize", te = "scroll", N = `
|
|
3
|
+
`, wt = "hidden", Et = "child", V = "parent", X = "string", Ot = "number", ze = "object", we = "function", q = "auto", Tt = "font-weight: bold;", Ee = "none", Oe = "both", D = "vertical", Te = "horizontal", kt = "omit", It = A.length, F = "[iFrameSizer]", Z = F.length, $t = Object.freeze({
|
|
4
4
|
max: 1,
|
|
5
5
|
scroll: 1,
|
|
6
6
|
bodyScroll: 1,
|
|
7
7
|
documentElementScroll: 1
|
|
8
|
-
}),
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
}),
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
}),
|
|
16
|
-
function
|
|
17
|
-
if (!
|
|
8
|
+
}), ne = Object.freeze({
|
|
9
|
+
[me]: 1,
|
|
10
|
+
[j]: 1,
|
|
11
|
+
[ye]: 1
|
|
12
|
+
}), M = "expanded", S = "collapsed", ke = 0, Ie = 1, $e = 2, Mt = Object.freeze({
|
|
13
|
+
[M]: 1,
|
|
14
|
+
[S]: 1
|
|
15
|
+
}), Me = "Use of the old name will be removed in a future version of <i>iframe-resizer</>.", Se = (e) => typeof e === ze && e !== null, K = (e) => typeof e === X;
|
|
16
|
+
function St(e) {
|
|
17
|
+
if (!Se(e)) return !1;
|
|
18
18
|
try {
|
|
19
19
|
return e.tagName === "IFRAME" || e instanceof HTMLIFrameElement;
|
|
20
20
|
} catch {
|
|
21
21
|
return !1;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const jt = (e, ...t) => setTimeout(() => e(...t), 0), Rt = (e) => {
|
|
25
25
|
let t = !1;
|
|
26
26
|
return function(...n) {
|
|
27
27
|
return t ? void 0 : (t = !0, e.apply(this, n));
|
|
28
28
|
};
|
|
29
|
-
},
|
|
29
|
+
}, Lt = (e, t) => Object.prototype.hasOwnProperty.call(e, t), P = (e, t) => Object.hasOwn ? Object.hasOwn(e, t) : Lt(e, t), At = (e) => e, Pt = (e) => e.charAt(0).toUpperCase() + e.slice(1), Ct = (e) => (
|
|
30
30
|
// eslint-disable-next-line no-underscore-dangle
|
|
31
31
|
e?.__esModule ? e.default : e
|
|
32
|
-
),
|
|
32
|
+
), Nt = (e, t, n) => {
|
|
33
33
|
if (typeof e !== t)
|
|
34
|
-
throw new TypeError(`${n} is not a ${
|
|
35
|
-
},
|
|
36
|
-
|
|
34
|
+
throw new TypeError(`${n} is not a ${Pt(t)}`);
|
|
35
|
+
}, xt = (e) => (t, n = "renamed to") => (o, s, a = "", r = "") => e(
|
|
36
|
+
r,
|
|
37
37
|
`<rb>Deprecated ${t}(${o.replace("()", "")})</>
|
|
38
38
|
|
|
39
|
-
The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${
|
|
40
|
-
),
|
|
39
|
+
The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${s}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`
|
|
40
|
+
), je = {
|
|
41
41
|
br: `
|
|
42
42
|
`,
|
|
43
43
|
rb: "\x1B[31;1m",
|
|
@@ -52,50 +52,54 @@ The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${s}Use of the old $
|
|
|
52
52
|
// underline
|
|
53
53
|
"/": "\x1B[m"
|
|
54
54
|
// reset
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
), i = {},
|
|
58
|
-
let
|
|
59
|
-
const
|
|
55
|
+
}, _t = Object.keys(je), Ft = new RegExp(`<(${_t.join("|")})>`, "gi"), Bt = (e, t) => je[t] ?? "", Wt = (e) => e.replace(Ft, Bt), Dt = (e) => e.replaceAll("<br>", N).replaceAll(/<\/?[^>]+>/gi, ""), Re = (e) => (t) => e(
|
|
56
|
+
K(t) ? window.chrome ? Wt(t) : Dt(t) : t
|
|
57
|
+
), i = {}, Le = Ct(nt);
|
|
58
|
+
let Q = !0;
|
|
59
|
+
const Ht = Le({
|
|
60
60
|
expand: !1,
|
|
61
|
-
label:
|
|
62
|
-
}),
|
|
63
|
-
function
|
|
64
|
-
|
|
61
|
+
label: V
|
|
62
|
+
}), Gt = (e) => window.top === window.self ? `parent(${e})` : `nested parent(${e})`, Ut = (e) => i[e] ? i[e].log : Q;
|
|
63
|
+
function Vt({
|
|
64
|
+
enabled: e,
|
|
65
|
+
expand: t,
|
|
66
|
+
iframeId: n
|
|
67
|
+
}) {
|
|
68
|
+
const o = Le({
|
|
65
69
|
expand: t,
|
|
66
|
-
label:
|
|
70
|
+
label: Gt(n)
|
|
67
71
|
});
|
|
68
|
-
|
|
72
|
+
Q = e, i[n] || (i[n] = {
|
|
69
73
|
console: o
|
|
70
74
|
});
|
|
71
75
|
}
|
|
72
|
-
const I = (e) => (t, ...n) => i[t] ? i[t].console[e](...n) :
|
|
73
|
-
function
|
|
76
|
+
const I = (e) => (t, ...n) => i[t] ? i[t].console[e](...n) : Ht[e](...n), Ae = (e) => (t, ...n) => Ut(t) === !0 ? I(e)(t, ...n) : null, u = Ae("log"), m = u, qt = Ae("debug"), w = I("warn"), Zt = I("error"), b = I("event"), Jt = I("purge"), Yt = I("endAutoGroup"), Pe = I("errorBoundary");
|
|
77
|
+
function Xt(e, t) {
|
|
74
78
|
queueMicrotask(
|
|
75
79
|
() => (
|
|
76
80
|
// eslint-disable-next-line no-console
|
|
77
81
|
console.info(
|
|
78
82
|
`%ciframe-resizer ${e}`,
|
|
79
|
-
|
|
83
|
+
Q || t < 1 ? Tt : ot
|
|
80
84
|
)
|
|
81
85
|
)
|
|
82
86
|
);
|
|
83
87
|
}
|
|
84
|
-
const
|
|
85
|
-
const n =
|
|
88
|
+
const Kt = (e) => (...t) => [`${de}(${e})`, ...t].join(" "), Qt = Re(At), y = (e, ...t) => i[e] ? i[e].console.warn(...t.map(Qt)) : queueMicrotask(() => {
|
|
89
|
+
const n = Re(Kt(e));
|
|
86
90
|
console?.warn(...t.map(n));
|
|
87
|
-
}),
|
|
88
|
-
typeof i[e.id].onInit ===
|
|
89
|
-
},
|
|
91
|
+
}), en = xt(y), tn = en("Option"), nn = (e) => {
|
|
92
|
+
typeof i[e.id].onInit === we && (tn("init()", "onReady()", "", e.id), i[e.id].onInit(e));
|
|
93
|
+
}, B = Object.freeze({
|
|
90
94
|
autoResize: !0,
|
|
91
95
|
bodyBackground: null,
|
|
92
96
|
bodyMargin: null,
|
|
93
97
|
bodyPadding: null,
|
|
94
98
|
checkOrigin: !0,
|
|
95
|
-
direction:
|
|
99
|
+
direction: D,
|
|
96
100
|
firstRun: !0,
|
|
97
101
|
inPageLinks: !1,
|
|
98
|
-
heightCalculationMethod:
|
|
102
|
+
heightCalculationMethod: q,
|
|
99
103
|
id: "iFrameResizer",
|
|
100
104
|
// TODO: v6 change to 'iframeResizer'
|
|
101
105
|
log: !1,
|
|
@@ -113,7 +117,7 @@ const Gt = (e) => (...t) => [`${pe}(${e})`, ...t].join(" "), Ut = Me(It), b = (e
|
|
|
113
117
|
tolerance: 0,
|
|
114
118
|
waitForLoad: !1,
|
|
115
119
|
warningTimeout: 5e3,
|
|
116
|
-
widthCalculationMethod:
|
|
120
|
+
widthCalculationMethod: q,
|
|
117
121
|
onBeforeClose: () => !0,
|
|
118
122
|
onAfterClose() {
|
|
119
123
|
},
|
|
@@ -123,116 +127,136 @@ const Gt = (e) => (...t) => [`${pe}(${e})`, ...t].join(" "), Ut = Me(It), b = (e
|
|
|
123
127
|
},
|
|
124
128
|
onMouseLeave() {
|
|
125
129
|
},
|
|
126
|
-
onReady:
|
|
130
|
+
onReady: nn,
|
|
127
131
|
onResized() {
|
|
128
132
|
},
|
|
129
133
|
onScroll: () => !0
|
|
130
134
|
});
|
|
131
|
-
let
|
|
132
|
-
function
|
|
133
|
-
const t = e?.id ||
|
|
134
|
-
return document.getElementById(t) === null ? t : `${t}${
|
|
135
|
+
let oe = 0;
|
|
136
|
+
function on(e) {
|
|
137
|
+
const t = e?.id || B.id + oe++;
|
|
138
|
+
return document.getElementById(t) === null ? t : `${t}${oe++}`;
|
|
135
139
|
}
|
|
136
|
-
function
|
|
140
|
+
function sn(e, t) {
|
|
137
141
|
let { id: n } = e;
|
|
138
|
-
if (n && !
|
|
142
|
+
if (n && !K(n))
|
|
139
143
|
throw new TypeError("Invalid id for iFrame. Expected String");
|
|
140
|
-
return (!n || n === "") && (n =
|
|
144
|
+
return (!n || n === "") && (n = on(t), e.id = n, b(n, "assignId"), u(n, `Added missing iframe ID: ${n} (${e.src})`)), n;
|
|
141
145
|
}
|
|
142
|
-
function
|
|
146
|
+
function rn(e) {
|
|
143
147
|
const { search: t } = window.location;
|
|
144
|
-
|
|
148
|
+
if (t.includes("ifrlog"))
|
|
149
|
+
switch (new URLSearchParams(t).get("ifrlog")) {
|
|
150
|
+
case String(ke): {
|
|
151
|
+
e.log = !1;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
case M:
|
|
155
|
+
case String($e): {
|
|
156
|
+
e.log = M;
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
case S:
|
|
160
|
+
case String(Ie): {
|
|
161
|
+
e.log = S;
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
default:
|
|
165
|
+
e.log = S;
|
|
166
|
+
}
|
|
145
167
|
}
|
|
146
|
-
const
|
|
147
|
-
function
|
|
168
|
+
const C = (e, t, n, o) => e.addEventListener(t, n, o || !1), ie = (e, t, n) => e.removeEventListener(t, n, !1), an = (e) => e.split(L).filter((t, n) => n !== 19).join(L);
|
|
169
|
+
function cn(e, t, n) {
|
|
148
170
|
function o(f) {
|
|
149
|
-
const p = e in
|
|
150
|
-
m(n, f, l,
|
|
171
|
+
const p = e in ne ? an(t) : t;
|
|
172
|
+
m(n, f, l, z, l), m(n, `Message data: %c${p}`, l);
|
|
151
173
|
}
|
|
152
|
-
const { iframe:
|
|
153
|
-
if (
|
|
174
|
+
const { iframe: s, postMessageTarget: a, sameOrigin: r, targetOrigin: c } = i[n];
|
|
175
|
+
if (r)
|
|
154
176
|
try {
|
|
155
|
-
|
|
177
|
+
s.contentWindow.iframeChildListener(F + t), o(`Sending message to iframe %c${n}%c via same origin%c`);
|
|
156
178
|
return;
|
|
157
179
|
} catch {
|
|
158
|
-
e in
|
|
180
|
+
e in ne ? (i[n].sameOrigin = !1, u(n, "New iframe does not support same origin")) : w(n, "Same origin messaging failed, falling back to postMessage");
|
|
159
181
|
}
|
|
160
182
|
o(
|
|
161
|
-
`Sending message to iframe: %c${n}%c targetOrigin: %c${
|
|
162
|
-
)
|
|
183
|
+
`Sending message to iframe: %c${n}%c targetOrigin: %c${c.join(", ")}`
|
|
184
|
+
);
|
|
185
|
+
for (const f of c)
|
|
186
|
+
a.postMessage(F + t, f);
|
|
163
187
|
}
|
|
164
|
-
function
|
|
165
|
-
if (
|
|
166
|
-
|
|
188
|
+
function T(e, t, n) {
|
|
189
|
+
if (b(n, e), !i[n]?.postMessageTarget) {
|
|
190
|
+
w(n, "Iframe not found");
|
|
167
191
|
return;
|
|
168
192
|
}
|
|
169
|
-
|
|
193
|
+
cn(e, t, n);
|
|
170
194
|
}
|
|
171
|
-
const
|
|
172
|
-
function
|
|
173
|
-
document.hidden !== !0 &&
|
|
195
|
+
const ln = (e, t) => Object.values(i).filter(({ autoResize: n, firstRun: o }) => n && !o).forEach(({ iframe: n }) => T(e, t, n.id));
|
|
196
|
+
function un() {
|
|
197
|
+
document.hidden !== !0 && ln("tabVisible", Y);
|
|
174
198
|
}
|
|
175
|
-
function
|
|
199
|
+
function fn(e) {
|
|
176
200
|
if (e.boxSizing !== "border-box") return 0;
|
|
177
201
|
const t = e.paddingTop ? parseInt(e.paddingTop, 10) : 0, n = e.paddingBottom ? parseInt(e.paddingBottom, 10) : 0;
|
|
178
202
|
return t + n;
|
|
179
203
|
}
|
|
180
|
-
function
|
|
204
|
+
function pn(e) {
|
|
181
205
|
if (e.boxSizing !== "border-box") return 0;
|
|
182
206
|
const t = e.borderTopWidth ? parseInt(e.borderTopWidth, 10) : 0, n = e.borderBottomWidth ? parseInt(e.borderBottomWidth, 10) : 0;
|
|
183
207
|
return t + n;
|
|
184
208
|
}
|
|
185
|
-
function
|
|
186
|
-
const t = e.slice(
|
|
209
|
+
function hn(e) {
|
|
210
|
+
const t = e.slice(Z).split(":"), n = t[1] ? Number(t[1]) : 0, o = i[t[0]]?.iframe, s = o ? getComputedStyle(o) : null, a = s ? fn(s) + pn(s) : 0, r = {
|
|
187
211
|
iframe: o,
|
|
188
212
|
id: t[0],
|
|
189
|
-
height: n +
|
|
213
|
+
height: n + a,
|
|
190
214
|
width: Number(t[2]),
|
|
191
215
|
type: t[3],
|
|
192
216
|
msg: t[4],
|
|
193
217
|
message: t[4]
|
|
194
218
|
};
|
|
195
|
-
return t[5] && (
|
|
219
|
+
return t[5] && (r.mode = t[5]), r;
|
|
196
220
|
}
|
|
197
|
-
const
|
|
198
|
-
function
|
|
199
|
-
const { id: t, msg: n, iframe: o } = e,
|
|
200
|
-
return
|
|
221
|
+
const dn = { true: 1, false: 1, undefined: 1 };
|
|
222
|
+
function gn(e) {
|
|
223
|
+
const { id: t, msg: n, iframe: o } = e, s = St(o);
|
|
224
|
+
return s || (u(t, `Received: %c${n}`, l), w(t, "The target iframe was not found.")), s;
|
|
201
225
|
}
|
|
202
|
-
function
|
|
203
|
-
|
|
226
|
+
function yn(e, t) {
|
|
227
|
+
const { id: n } = e, { data: o, origin: s } = t;
|
|
228
|
+
if ("sameOrigin" in t && t.sameOrigin) return !0;
|
|
229
|
+
const r = i[n]?.checkOrigin;
|
|
230
|
+
function c() {
|
|
204
231
|
function f() {
|
|
205
232
|
u(
|
|
206
|
-
|
|
207
|
-
`Checking connection is from allowed list of origins: %c${
|
|
233
|
+
n,
|
|
234
|
+
`Checking connection is from allowed list of origins: %c${r}`,
|
|
208
235
|
l
|
|
209
236
|
);
|
|
210
|
-
for (const
|
|
211
|
-
if (
|
|
237
|
+
for (const h of r)
|
|
238
|
+
if (h === s)
|
|
212
239
|
return !0;
|
|
213
240
|
return !1;
|
|
214
241
|
}
|
|
215
242
|
function p() {
|
|
216
|
-
const
|
|
217
|
-
return u(
|
|
243
|
+
const h = i[n]?.remoteHost;
|
|
244
|
+
return u(n, `Checking connection is from: %c${h}`, l), s === h;
|
|
218
245
|
}
|
|
219
|
-
return
|
|
246
|
+
return r.constructor === Array ? f() : p();
|
|
220
247
|
}
|
|
221
|
-
|
|
222
|
-
if ("sameOrigin" in t && t.sameOrigin) return !0;
|
|
223
|
-
let a = i[o]?.checkOrigin;
|
|
224
|
-
if (a && `${s}` != "null" && !n())
|
|
248
|
+
if (r && `${s}` != "null" && !c())
|
|
225
249
|
throw new Error(
|
|
226
|
-
`Unexpected message received from: ${s} for ${
|
|
250
|
+
`Unexpected message received from: ${s} for ${n}. Message was: ${o}. This error can be disabled by setting the checkOrigin: false option or by providing an array of trusted domains.`
|
|
227
251
|
);
|
|
228
252
|
return !0;
|
|
229
253
|
}
|
|
230
|
-
const
|
|
231
|
-
function
|
|
232
|
-
const { id: t, type: n } = e, o = n in
|
|
254
|
+
const mn = (e) => F === `${e}`.slice(0, Z) && e.slice(Z).split(":")[0] in i;
|
|
255
|
+
function bn(e) {
|
|
256
|
+
const { id: t, type: n } = e, o = n in dn;
|
|
233
257
|
return o && u(t, "Ignoring init message from meta parent page"), o;
|
|
234
258
|
}
|
|
235
|
-
function
|
|
259
|
+
function vn(e) {
|
|
236
260
|
try {
|
|
237
261
|
i[e].sameOrigin = !!i[e]?.iframe?.contentWindow?.iframeChildListener;
|
|
238
262
|
} catch {
|
|
@@ -240,10 +264,10 @@ function fn(e) {
|
|
|
240
264
|
}
|
|
241
265
|
u(e, `sameOrigin: %c${i[e].sameOrigin}`, l);
|
|
242
266
|
}
|
|
243
|
-
function
|
|
244
|
-
if (t !==
|
|
267
|
+
function zn(e, t) {
|
|
268
|
+
if (t !== _) {
|
|
245
269
|
if (t === void 0) {
|
|
246
|
-
|
|
270
|
+
y(
|
|
247
271
|
e,
|
|
248
272
|
`<rb>Legacy version detected in iframe</>
|
|
249
273
|
|
|
@@ -256,79 +280,79 @@ See <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.
|
|
|
256
280
|
}
|
|
257
281
|
u(
|
|
258
282
|
e,
|
|
259
|
-
`Version mismatch (Child: %c${t}%c !== Parent: %c${
|
|
283
|
+
`Version mismatch (Child: %c${t}%c !== Parent: %c${_})`,
|
|
260
284
|
l,
|
|
261
|
-
|
|
285
|
+
z,
|
|
262
286
|
l
|
|
263
287
|
);
|
|
264
288
|
}
|
|
265
289
|
}
|
|
266
|
-
function
|
|
290
|
+
function k(e, t, n) {
|
|
267
291
|
if (!i[e]) return null;
|
|
268
292
|
const o = i[e][t];
|
|
269
|
-
if (typeof o !==
|
|
293
|
+
if (typeof o !== we)
|
|
270
294
|
throw new TypeError(`${t} on iframe[${e}] is not a function`);
|
|
271
295
|
if (t !== "onBeforeClose" && t !== "onScroll")
|
|
272
|
-
return
|
|
296
|
+
return jt(o, n);
|
|
273
297
|
try {
|
|
274
298
|
return o(n);
|
|
275
|
-
} catch (
|
|
276
|
-
return console.error(
|
|
299
|
+
} catch (s) {
|
|
300
|
+
return console.error(s), w(e, `Error in ${t} callback`), null;
|
|
277
301
|
}
|
|
278
302
|
}
|
|
279
|
-
function
|
|
303
|
+
function wn(e, t) {
|
|
280
304
|
const { id: n, iframe: o } = e;
|
|
281
305
|
u(
|
|
282
306
|
n,
|
|
283
307
|
`onMessage passed: {iframe: %c${n}%c, message: %c${t}%c}`,
|
|
284
308
|
l,
|
|
285
|
-
|
|
309
|
+
z,
|
|
286
310
|
l,
|
|
287
|
-
|
|
288
|
-
),
|
|
311
|
+
z
|
|
312
|
+
), k(n, "onMessage", {
|
|
289
313
|
iframe: o,
|
|
290
314
|
message: JSON.parse(t)
|
|
291
315
|
});
|
|
292
316
|
}
|
|
293
|
-
function
|
|
317
|
+
function x(e, t) {
|
|
294
318
|
const { lastMessage: n } = i[e];
|
|
295
319
|
return n.slice(
|
|
296
|
-
n.indexOf(
|
|
320
|
+
n.indexOf(L) + It + t
|
|
297
321
|
);
|
|
298
322
|
}
|
|
299
|
-
function
|
|
300
|
-
const { id: n, iframe: o, height:
|
|
301
|
-
let
|
|
302
|
-
if (
|
|
303
|
-
const f =
|
|
304
|
-
|
|
323
|
+
function se(e, t) {
|
|
324
|
+
const { id: n, iframe: o, height: s, type: a, width: r } = t;
|
|
325
|
+
let c = { x: 0, y: 0 };
|
|
326
|
+
if (r === 0 && s === 0) {
|
|
327
|
+
const f = x(n, 9).split(L);
|
|
328
|
+
c = {
|
|
305
329
|
x: f[1],
|
|
306
330
|
y: f[0]
|
|
307
331
|
};
|
|
308
332
|
} else
|
|
309
|
-
|
|
310
|
-
x:
|
|
311
|
-
y:
|
|
333
|
+
c = {
|
|
334
|
+
x: r,
|
|
335
|
+
y: s
|
|
312
336
|
};
|
|
313
|
-
|
|
337
|
+
k(n, e, {
|
|
314
338
|
iframe: o,
|
|
315
|
-
screenX: Number(
|
|
316
|
-
screenY: Number(
|
|
317
|
-
type:
|
|
339
|
+
screenX: Number(c.x),
|
|
340
|
+
screenY: Number(c.y),
|
|
341
|
+
type: a
|
|
318
342
|
});
|
|
319
343
|
}
|
|
320
344
|
const d = {
|
|
321
345
|
position: null,
|
|
322
|
-
version:
|
|
346
|
+
version: _
|
|
323
347
|
};
|
|
324
|
-
function
|
|
348
|
+
function Ce() {
|
|
325
349
|
d.position = null;
|
|
326
350
|
}
|
|
327
|
-
const
|
|
328
|
-
function
|
|
351
|
+
const En = () => d.position;
|
|
352
|
+
function On(e) {
|
|
329
353
|
d.position = e;
|
|
330
354
|
}
|
|
331
|
-
function
|
|
355
|
+
function Ne(e) {
|
|
332
356
|
return d.position === null && (d.position = {
|
|
333
357
|
x: window.scrollX,
|
|
334
358
|
y: window.scrollY
|
|
@@ -336,38 +360,38 @@ function je(e) {
|
|
|
336
360
|
e,
|
|
337
361
|
`Get page position: %c${d.position.x}%c, %c${d.position.y}`,
|
|
338
362
|
l,
|
|
339
|
-
|
|
363
|
+
z,
|
|
340
364
|
l
|
|
341
365
|
), d.position;
|
|
342
366
|
}
|
|
343
|
-
function
|
|
367
|
+
function xe(e) {
|
|
344
368
|
d.position !== null && (window.scrollTo(d.position.x, d.position.y), m(
|
|
345
369
|
e,
|
|
346
370
|
`Set page position: %c${d.position.x}%c, %c${d.position.y}`,
|
|
347
371
|
l,
|
|
348
|
-
|
|
372
|
+
z,
|
|
349
373
|
l
|
|
350
|
-
),
|
|
374
|
+
), Ce());
|
|
351
375
|
}
|
|
352
376
|
function re(e, t) {
|
|
353
377
|
const { id: n } = t, o = `${t[e]}px`;
|
|
354
378
|
i[n].iframe.style[e] = o, m(n, `Set ${e}: %c${o}`, l);
|
|
355
379
|
}
|
|
356
|
-
function
|
|
380
|
+
function _e(e) {
|
|
357
381
|
const { id: t } = e, { sizeHeight: n, sizeWidth: o } = i[t];
|
|
358
|
-
n && re(
|
|
382
|
+
n && re(mt, e), o && re(bt, e);
|
|
359
383
|
}
|
|
360
|
-
function
|
|
384
|
+
function ae(e) {
|
|
361
385
|
const { id: t } = e;
|
|
362
|
-
|
|
386
|
+
_e(e), xe(t), k(t, "onResized", e);
|
|
363
387
|
}
|
|
364
|
-
function
|
|
388
|
+
function Fe(e) {
|
|
365
389
|
const { id: t } = e;
|
|
366
390
|
u(t, "Disconnected from iframe"), delete i[t], delete e.iframeResizer;
|
|
367
391
|
}
|
|
368
|
-
function
|
|
392
|
+
function Be(e) {
|
|
369
393
|
const { id: t } = e;
|
|
370
|
-
if (
|
|
394
|
+
if (k(t, "onBeforeClose", t) === !1) {
|
|
371
395
|
u(t, "Close iframe cancelled by onBeforeClose");
|
|
372
396
|
return;
|
|
373
397
|
}
|
|
@@ -375,75 +399,85 @@ function Ne(e) {
|
|
|
375
399
|
try {
|
|
376
400
|
e.parentNode && e.remove();
|
|
377
401
|
} catch (n) {
|
|
378
|
-
|
|
402
|
+
w(t, n);
|
|
379
403
|
}
|
|
380
|
-
|
|
404
|
+
k(t, "onAfterClose", t), Fe(e);
|
|
381
405
|
}
|
|
382
|
-
function
|
|
406
|
+
function We(e) {
|
|
383
407
|
const { id: t, type: n } = e;
|
|
384
408
|
u(
|
|
385
409
|
t,
|
|
386
|
-
`Size reset requested by ${n ===
|
|
387
|
-
),
|
|
410
|
+
`Size reset requested by ${n === j ? "parent page" : "child page"}`
|
|
411
|
+
), Ne(t), _e(e), T(U, U, t);
|
|
388
412
|
}
|
|
389
|
-
const
|
|
413
|
+
const De = (e, t) => {
|
|
390
414
|
const n = {};
|
|
391
|
-
return (o,
|
|
392
|
-
const { iframe:
|
|
393
|
-
function
|
|
415
|
+
return (o, s) => {
|
|
416
|
+
const { iframe: a } = i[s];
|
|
417
|
+
function r(f, p) {
|
|
394
418
|
n[p] || (f(), n[p] = requestAnimationFrame(() => {
|
|
395
419
|
n[p] = null;
|
|
396
420
|
}));
|
|
397
421
|
}
|
|
398
|
-
function
|
|
399
|
-
|
|
422
|
+
function c() {
|
|
423
|
+
T(`${o} (${e})`, `${e}:${t(a)}`, s);
|
|
400
424
|
}
|
|
401
|
-
c
|
|
425
|
+
r(c, s);
|
|
402
426
|
};
|
|
403
|
-
},
|
|
427
|
+
}, He = (e) => (t) => {
|
|
404
428
|
e in i[t] && (i[t][e](), delete i[t][e]);
|
|
405
|
-
},
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
|
|
429
|
+
}, Ge = (
|
|
430
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
431
|
+
((e, t) => (n) => {
|
|
432
|
+
let o = !1;
|
|
433
|
+
const s = (g) => () => {
|
|
434
|
+
i[n] ? (!o || o === g) && (e(g, n), o = g, requestAnimationFrame(() => {
|
|
435
|
+
o = !1;
|
|
436
|
+
})) : h();
|
|
437
|
+
}, a = s(te), r = s("resize window"), c = new ResizeObserver(s("pageObserver")), f = new ResizeObserver(s("iframeObserver"));
|
|
438
|
+
function p(g, E) {
|
|
439
|
+
u(n, `${g}listeners for send${t}`), E(window, te, a), E(window, Y, r);
|
|
440
|
+
}
|
|
441
|
+
function h() {
|
|
442
|
+
b(n, `stop${t}`), p("Remove ", ie), c.disconnect(), f.disconnect(), i[n] && ie(i[n].iframe, G, h);
|
|
443
|
+
}
|
|
444
|
+
function $() {
|
|
445
|
+
p("Add ", C), c.observe(document.body), f.observe(i[n].iframe);
|
|
446
|
+
}
|
|
447
|
+
i[n] && (i[n][`stop${t}`] = h, C(i[n].iframe, G, h), $());
|
|
448
|
+
})
|
|
449
|
+
);
|
|
450
|
+
function Tn(e) {
|
|
451
|
+
const t = document.body.getBoundingClientRect(), n = e.getBoundingClientRect(), { scrollY: o, scrollX: s, innerHeight: a, innerWidth: r } = window, { clientHeight: c, clientWidth: f } = document.documentElement;
|
|
426
452
|
return JSON.stringify({
|
|
427
453
|
iframeHeight: n.height,
|
|
428
454
|
iframeWidth: n.width,
|
|
429
|
-
clientHeight: Math.max(
|
|
430
|
-
clientWidth: Math.max(f,
|
|
455
|
+
clientHeight: Math.max(c, a || 0),
|
|
456
|
+
clientWidth: Math.max(f, r || 0),
|
|
431
457
|
offsetTop: Math.trunc(n.top - t.top),
|
|
432
458
|
offsetLeft: Math.trunc(n.left - t.left),
|
|
433
459
|
scrollTop: o,
|
|
434
|
-
scrollLeft:
|
|
435
|
-
documentHeight:
|
|
460
|
+
scrollLeft: s,
|
|
461
|
+
documentHeight: c,
|
|
436
462
|
documentWidth: f,
|
|
437
|
-
windowHeight:
|
|
438
|
-
windowWidth:
|
|
463
|
+
windowHeight: a,
|
|
464
|
+
windowWidth: r
|
|
439
465
|
});
|
|
440
466
|
}
|
|
441
|
-
const
|
|
442
|
-
|
|
467
|
+
const kn = De(be, Tn), In = Ge(
|
|
468
|
+
kn,
|
|
443
469
|
"PageInfo"
|
|
444
|
-
),
|
|
445
|
-
function
|
|
446
|
-
const { scrollWidth: t, scrollHeight: n } = document.documentElement,
|
|
470
|
+
), $n = He("stopPageInfo");
|
|
471
|
+
function Mn(e) {
|
|
472
|
+
const { scrollWidth: t, scrollHeight: n } = document.documentElement, o = typeof window < "u" && window.visualViewport ? window.visualViewport : {}, {
|
|
473
|
+
width: s = 0,
|
|
474
|
+
height: a = 0,
|
|
475
|
+
offsetLeft: r = 0,
|
|
476
|
+
offsetTop: c = 0,
|
|
477
|
+
pageLeft: f = 0,
|
|
478
|
+
pageTop: p = 0,
|
|
479
|
+
scale: h = 1
|
|
480
|
+
} = o;
|
|
447
481
|
return JSON.stringify({
|
|
448
482
|
iframe: e.getBoundingClientRect(),
|
|
449
483
|
document: {
|
|
@@ -451,69 +485,73 @@ function wn(e) {
|
|
|
451
485
|
scrollHeight: n
|
|
452
486
|
},
|
|
453
487
|
viewport: {
|
|
454
|
-
width:
|
|
455
|
-
height:
|
|
456
|
-
offsetLeft:
|
|
488
|
+
width: s,
|
|
489
|
+
height: a,
|
|
490
|
+
offsetLeft: r,
|
|
457
491
|
offsetTop: c,
|
|
458
|
-
pageLeft:
|
|
459
|
-
pageTop:
|
|
460
|
-
scale:
|
|
492
|
+
pageLeft: f,
|
|
493
|
+
pageTop: p,
|
|
494
|
+
scale: h
|
|
461
495
|
}
|
|
462
496
|
});
|
|
463
497
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
498
|
+
const Sn = De(ve, Mn), jn = Ge(
|
|
499
|
+
Sn,
|
|
466
500
|
"ParentInfo"
|
|
467
|
-
),
|
|
468
|
-
function
|
|
469
|
-
const t = e.getBoundingClientRect(), n =
|
|
501
|
+
), Rn = He("stopParentInfo");
|
|
502
|
+
function Ue(e) {
|
|
503
|
+
const t = e.getBoundingClientRect(), n = Ne(e.id);
|
|
470
504
|
return {
|
|
471
505
|
x: Number(t.left) + Number(n.x),
|
|
472
506
|
y: Number(t.top) + Number(n.y)
|
|
473
507
|
};
|
|
474
508
|
}
|
|
475
|
-
function
|
|
476
|
-
const { x: t, y: n } =
|
|
477
|
-
if (
|
|
478
|
-
|
|
509
|
+
function Ve(e) {
|
|
510
|
+
const { x: t, y: n } = En(), o = i[e]?.iframe;
|
|
511
|
+
if (k(e, "onScroll", { iframe: o, top: n, left: t, x: t, y: n }) === !1) {
|
|
512
|
+
Ce();
|
|
479
513
|
return;
|
|
480
514
|
}
|
|
481
|
-
|
|
515
|
+
xe(e);
|
|
482
516
|
}
|
|
483
|
-
function
|
|
484
|
-
const { id: t, height: n, width: o } = e,
|
|
517
|
+
function Ln(e) {
|
|
518
|
+
const { id: t, height: n, width: o } = e, s = window.parentIframe || window.parentIFrame || window;
|
|
485
519
|
m(
|
|
486
520
|
t,
|
|
487
521
|
`scrollBy: x: %c${o}%c y: %c${n}`,
|
|
488
522
|
l,
|
|
489
|
-
|
|
523
|
+
z,
|
|
490
524
|
l
|
|
491
|
-
),
|
|
525
|
+
), s.scrollBy(o, n);
|
|
492
526
|
}
|
|
493
|
-
const
|
|
494
|
-
|
|
495
|
-
|
|
527
|
+
const qe = (e) => (t) => {
|
|
528
|
+
const { id: n, iframe: o, height: s, width: a } = t;
|
|
529
|
+
function r(g) {
|
|
530
|
+
On(g), Ve(n);
|
|
496
531
|
}
|
|
497
|
-
function
|
|
498
|
-
|
|
532
|
+
function c(g, E) {
|
|
533
|
+
g[`scrollTo${e ? "Offset" : ""}`](
|
|
534
|
+
E.x,
|
|
535
|
+
E.y
|
|
536
|
+
);
|
|
499
537
|
}
|
|
500
|
-
const
|
|
501
|
-
x:
|
|
502
|
-
y:
|
|
503
|
-
}),
|
|
538
|
+
const f = (g) => ({
|
|
539
|
+
x: a + g.x,
|
|
540
|
+
y: s + g.y
|
|
541
|
+
}), p = e ? Ue(o) : { x: 0, y: 0 }, h = f(p), $ = window.parentIframe || window.parentIFrame;
|
|
504
542
|
m(
|
|
505
|
-
|
|
543
|
+
n,
|
|
506
544
|
`Reposition requested (offset x:%c${p.x}%c y:%c${p.y})`,
|
|
507
545
|
l,
|
|
508
|
-
|
|
546
|
+
z,
|
|
509
547
|
l
|
|
510
|
-
),
|
|
511
|
-
},
|
|
512
|
-
function
|
|
513
|
-
const { x: o, y:
|
|
514
|
-
m(e, `Moving to in page link: %c#${t}`, l), d.position = { x: o, y:
|
|
548
|
+
), $ ? c($, h) : r(h);
|
|
549
|
+
}, An = qe(!1), Pn = qe(!0);
|
|
550
|
+
function Cn(e, t, n) {
|
|
551
|
+
const { x: o, y: s } = Ue(n);
|
|
552
|
+
m(e, `Moving to in page link: %c#${t}`, l), d.position = { x: o, y: s }, Ve(e), window.location.hash = t;
|
|
515
553
|
}
|
|
516
|
-
function
|
|
554
|
+
function Nn(e, t) {
|
|
517
555
|
const n = window.parentIframe || window.parentIFrame;
|
|
518
556
|
if (!n) {
|
|
519
557
|
u(e, `In page link #${t} not found`);
|
|
@@ -521,44 +559,52 @@ function Sn(e, t) {
|
|
|
521
559
|
}
|
|
522
560
|
n.moveToAnchor(t);
|
|
523
561
|
}
|
|
524
|
-
function
|
|
525
|
-
const n = t.split("#")[1] || "", o = decodeURIComponent(n),
|
|
526
|
-
if (
|
|
527
|
-
|
|
562
|
+
function xn(e, t) {
|
|
563
|
+
const n = t.split("#")[1] || "", o = decodeURIComponent(n), s = document.getElementById(o) || document.getElementsByName(o)[0];
|
|
564
|
+
if (s) {
|
|
565
|
+
Cn(e, n, s);
|
|
528
566
|
return;
|
|
529
567
|
}
|
|
530
568
|
if (window.top === window.self) {
|
|
531
569
|
u(e, `In page link #${n} not found`);
|
|
532
570
|
return;
|
|
533
571
|
}
|
|
534
|
-
|
|
572
|
+
Nn(e, n);
|
|
535
573
|
}
|
|
536
|
-
function
|
|
574
|
+
function _n(e) {
|
|
537
575
|
const t = i[e]?.iframe?.title;
|
|
538
576
|
return t === "" || t === void 0;
|
|
539
577
|
}
|
|
540
|
-
function
|
|
578
|
+
function Fn(e, t) {
|
|
541
579
|
i[e]?.syncTitle && (i[e].iframe.title = t, m(e, `Set iframe title attribute: %c${t}`, l));
|
|
542
580
|
}
|
|
543
|
-
const
|
|
581
|
+
const W = (e) => {
|
|
544
582
|
if (!e) return "";
|
|
545
583
|
let t = -559038744, n = 1103547984;
|
|
546
|
-
for (let o,
|
|
547
|
-
o = e.codePointAt(
|
|
584
|
+
for (let o, s = 0; s < e.length; s++)
|
|
585
|
+
o = e.codePointAt(s), t = Math.imul(t ^ o, 2246822519), n = Math.imul(n ^ o, 3266489917);
|
|
548
586
|
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);
|
|
549
|
-
},
|
|
587
|
+
}, v = (e) => e.replace(
|
|
550
588
|
/[A-Za-z]/g,
|
|
551
589
|
(t) => String.fromCodePoint(
|
|
552
590
|
(t <= "Z" ? 90 : 122) >= (t = t.codePointAt(0) + 19) ? t : t - 26
|
|
553
591
|
)
|
|
554
|
-
),
|
|
592
|
+
), Bn = /* @__PURE__ */ new Date(), Ze = (e) => new Set(Array.from({ length: 9 }, e)), ce = " - lewpylk", R = ["spjluzl", "rlf", "clyzpvu", "rlf2", "nlaMbssFlhy"], Wn = [
|
|
555
593
|
"<yi>Puchspk Spjluzl Rlf</><iy><iy>",
|
|
556
594
|
"<yi>Tpzzpun Spjluzl Rlf</><iy><iy>",
|
|
557
595
|
"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</>",
|
|
558
596
|
"<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</>.",
|
|
559
597
|
"<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.",
|
|
560
|
-
"Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."
|
|
561
|
-
|
|
598
|
+
"Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz.",
|
|
599
|
+
"<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.",
|
|
600
|
+
"<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.",
|
|
601
|
+
"<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."
|
|
602
|
+
], Dn = (e) => [
|
|
603
|
+
e[0],
|
|
604
|
+
...e.slice(1).map((t) => `${t}${ce}`),
|
|
605
|
+
`${e[4]}${ce}`,
|
|
606
|
+
...e.slice(1)
|
|
607
|
+
], Hn = Dn(["NWSc3", "zvsv", "wyv", "ibzpulzz", "VLT"]), le = Object.fromEntries(
|
|
562
608
|
[
|
|
563
609
|
"2cgs7fdf4xb",
|
|
564
610
|
"1c9ctcccr4z",
|
|
@@ -566,103 +612,120 @@ const ce = (e) => {
|
|
|
566
612
|
"ueokt0969w",
|
|
567
613
|
"w2zxchhgqz",
|
|
568
614
|
"1umuxblj2e5",
|
|
615
|
+
"1foobarqaz",
|
|
569
616
|
"2b5sdlfhbev",
|
|
570
617
|
"zo4ui3arjo",
|
|
571
|
-
"oclbb4thgl"
|
|
618
|
+
"oclbb4thgl",
|
|
619
|
+
"igb1wzrjqr"
|
|
572
620
|
].map((e, t) => [e, Math.max(0, t - 1)])
|
|
573
|
-
),
|
|
574
|
-
const t = e[
|
|
621
|
+
), Je = Bn[v(R[4])](), Gn = Ze((e, t) => W(`${Je + t}`)), Un = Ze((e, t) => W(`${Je - ++t}`)), Vn = (e) => Gn.has(e) ? 9 : Un.has(e) ? 5 : -2, O = (e) => v(Wn[e]), qn = (e) => v(Hn[e]), Zn = (e) => {
|
|
622
|
+
const t = e[v(R[0])] || e[v(R[1])] || e[v(R[2])] || e[v(R[3])];
|
|
575
623
|
if (!t) return -1;
|
|
576
624
|
const n = t.split("-");
|
|
577
|
-
let o = (function(
|
|
578
|
-
let
|
|
579
|
-
const c =
|
|
580
|
-
return c in
|
|
581
|
-
})(n
|
|
582
|
-
return o === 0 || ((
|
|
625
|
+
let o = (function(s = "", a = "") {
|
|
626
|
+
let r = -2;
|
|
627
|
+
const c = W(v(s));
|
|
628
|
+
return c in le && (r = le[c]), r === 9 ? Vn(a) : r;
|
|
629
|
+
})(...n);
|
|
630
|
+
return o === 0 || ((s) => s[2] === W(s[0] + s[1]))(n) || (o = -2), o;
|
|
583
631
|
};
|
|
584
|
-
let
|
|
585
|
-
function
|
|
586
|
-
if (
|
|
632
|
+
let J = !1, Ye = !1;
|
|
633
|
+
function Xe(e, t = -3) {
|
|
634
|
+
if (J) return;
|
|
587
635
|
const n = Math.max(i[e].mode, t);
|
|
588
636
|
if (n > i[e].mode && (i[e].mode = n), n < 0)
|
|
589
|
-
throw
|
|
590
|
-
n >
|
|
637
|
+
throw Jt(e), i[e].vAdvised || y(e || "Parent", `${O(n + 2)}${O(2)}`), i[e].vAdvised = !0, O(n + 2).replace(/<\/?[a-z][^>]*>|<\/>/gi, "");
|
|
638
|
+
switch (n > 5 && Ye || Xt(`v${_} (${qn(n)})`, n), n) {
|
|
639
|
+
case 1:
|
|
640
|
+
case 2:
|
|
641
|
+
case 3:
|
|
642
|
+
y("Parent", O(6));
|
|
643
|
+
break;
|
|
644
|
+
case 4:
|
|
645
|
+
y("Parent", O(7));
|
|
646
|
+
break;
|
|
647
|
+
case 5:
|
|
648
|
+
y("Parent", O(8));
|
|
649
|
+
break;
|
|
650
|
+
default:
|
|
651
|
+
n < 1 && y("Parent", O(3));
|
|
652
|
+
}
|
|
653
|
+
J = !0;
|
|
591
654
|
}
|
|
592
|
-
function
|
|
593
|
-
if (
|
|
655
|
+
function Jn(e) {
|
|
656
|
+
if (J) return;
|
|
594
657
|
const { mode: t } = i[e];
|
|
595
|
-
t
|
|
658
|
+
t > 5 && Xe(e, t);
|
|
596
659
|
}
|
|
597
|
-
function
|
|
598
|
-
e?.log === -1 && (e.log = !1,
|
|
660
|
+
function Yn(e) {
|
|
661
|
+
e?.log === -1 && (e.log = !1, Ye = !0);
|
|
599
662
|
}
|
|
600
|
-
function
|
|
601
|
-
i[e] && (u(e, `First run for ${e}`),
|
|
663
|
+
function Xn(e, t) {
|
|
664
|
+
i[e] && (u(e, `First run for ${e}`), Xe(e, t === void 0 ? void 0 : Number(t)), i[e].firstRun = !1);
|
|
602
665
|
}
|
|
603
|
-
function
|
|
604
|
-
const { height: t, id: n, iframe: o, mode:
|
|
605
|
-
switch (i[n]?.firstRun &&
|
|
606
|
-
case
|
|
607
|
-
i[n].autoResize = JSON.parse(
|
|
666
|
+
function Kn(e) {
|
|
667
|
+
const { height: t, id: n, iframe: o, mode: s, message: a, type: r, width: c } = e, { lastMessage: f } = i[n];
|
|
668
|
+
switch (i[n]?.firstRun && Xn(n, s), u(n, `Received: %c${f}`, l), r) {
|
|
669
|
+
case ge:
|
|
670
|
+
i[n].autoResize = JSON.parse(x(n, 9));
|
|
608
671
|
break;
|
|
609
|
-
case
|
|
672
|
+
case st:
|
|
610
673
|
m(n, "Ready state reset"), i[n].initialised = !1;
|
|
611
674
|
break;
|
|
612
|
-
case
|
|
613
|
-
|
|
614
|
-
break;
|
|
615
|
-
case et:
|
|
616
|
-
Rn(n, N(n, 9));
|
|
675
|
+
case rt:
|
|
676
|
+
Be(o);
|
|
617
677
|
break;
|
|
618
|
-
case
|
|
619
|
-
|
|
678
|
+
case at:
|
|
679
|
+
xn(n, x(n, 9));
|
|
620
680
|
break;
|
|
621
|
-
case
|
|
622
|
-
|
|
681
|
+
case j:
|
|
682
|
+
ae(e), vn(n), zn(n, a), i[n].initialised = !0, k(n, "onReady", o);
|
|
623
683
|
break;
|
|
624
|
-
case
|
|
625
|
-
|
|
684
|
+
case A:
|
|
685
|
+
wn(e, x(n, 6));
|
|
626
686
|
break;
|
|
627
|
-
case
|
|
628
|
-
|
|
687
|
+
case lt:
|
|
688
|
+
se("onMouseEnter", e);
|
|
629
689
|
break;
|
|
630
|
-
case
|
|
631
|
-
|
|
690
|
+
case ut:
|
|
691
|
+
se("onMouseLeave", e);
|
|
632
692
|
break;
|
|
633
693
|
case be:
|
|
634
|
-
|
|
694
|
+
In(n);
|
|
635
695
|
break;
|
|
636
|
-
case
|
|
637
|
-
|
|
696
|
+
case ve:
|
|
697
|
+
jn(n);
|
|
638
698
|
break;
|
|
639
|
-
case
|
|
640
|
-
|
|
699
|
+
case ft:
|
|
700
|
+
$n(n);
|
|
641
701
|
break;
|
|
642
|
-
case
|
|
643
|
-
|
|
702
|
+
case pt:
|
|
703
|
+
Rn(n);
|
|
644
704
|
break;
|
|
645
|
-
case
|
|
646
|
-
|
|
705
|
+
case U:
|
|
706
|
+
We(e);
|
|
647
707
|
break;
|
|
648
|
-
case
|
|
649
|
-
|
|
708
|
+
case ht:
|
|
709
|
+
Ln(e);
|
|
650
710
|
break;
|
|
651
|
-
case
|
|
652
|
-
|
|
711
|
+
case dt:
|
|
712
|
+
An(e);
|
|
653
713
|
break;
|
|
654
|
-
case
|
|
655
|
-
|
|
714
|
+
case gt:
|
|
715
|
+
Pn(e);
|
|
716
|
+
break;
|
|
717
|
+
case yt:
|
|
718
|
+
Fn(n, a);
|
|
656
719
|
break;
|
|
657
720
|
default:
|
|
658
|
-
if (
|
|
659
|
-
|
|
721
|
+
if (c === 0 && t === 0) {
|
|
722
|
+
w(
|
|
660
723
|
n,
|
|
661
|
-
`Unsupported message received (${
|
|
724
|
+
`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`
|
|
662
725
|
);
|
|
663
726
|
return;
|
|
664
727
|
}
|
|
665
|
-
if (
|
|
728
|
+
if (c === 0 || t === 0) {
|
|
666
729
|
u(n, "Ignoring message with 0 height or width");
|
|
667
730
|
return;
|
|
668
731
|
}
|
|
@@ -670,49 +733,52 @@ function Fn(e) {
|
|
|
670
733
|
u(n, "Page hidden - ignored resize request");
|
|
671
734
|
return;
|
|
672
735
|
}
|
|
673
|
-
|
|
736
|
+
ae(e);
|
|
674
737
|
}
|
|
675
738
|
}
|
|
676
|
-
const
|
|
739
|
+
const Qn = (e) => ({
|
|
740
|
+
initChild: t,
|
|
741
|
+
postMessageTarget: n
|
|
742
|
+
}) => {
|
|
677
743
|
e === n && t();
|
|
678
|
-
},
|
|
679
|
-
function
|
|
744
|
+
}, eo = (e) => Object.values(i).forEach(Qn(e));
|
|
745
|
+
function ue(e) {
|
|
680
746
|
const t = e.data;
|
|
681
|
-
if (t ===
|
|
682
|
-
|
|
747
|
+
if (t === it) {
|
|
748
|
+
eo(e.source);
|
|
683
749
|
return;
|
|
684
750
|
}
|
|
685
|
-
if (!
|
|
686
|
-
if (typeof t !==
|
|
687
|
-
|
|
751
|
+
if (!mn(t)) {
|
|
752
|
+
if (typeof t !== X) return;
|
|
753
|
+
b(V, "ignoredMessage"), qt(V, t);
|
|
688
754
|
return;
|
|
689
755
|
}
|
|
690
|
-
const n =
|
|
691
|
-
switch (
|
|
756
|
+
const n = hn(t), { id: o, type: s } = n;
|
|
757
|
+
switch (b(o, s), !0) {
|
|
692
758
|
case !i[o]:
|
|
693
|
-
throw new Error(`${
|
|
694
|
-
case !
|
|
695
|
-
case
|
|
696
|
-
case !
|
|
759
|
+
throw new Error(`${s} No settings for ${o}. Message was: ${t}`);
|
|
760
|
+
case !gn(n):
|
|
761
|
+
case bn(n):
|
|
762
|
+
case !yn(n, e):
|
|
697
763
|
return;
|
|
698
764
|
default:
|
|
699
|
-
i[o].lastMessage = e.data,
|
|
765
|
+
i[o].lastMessage = e.data, Pe(o, Kn)(n);
|
|
700
766
|
}
|
|
701
767
|
}
|
|
702
|
-
const
|
|
703
|
-
|
|
704
|
-
}),
|
|
705
|
-
function
|
|
706
|
-
if (
|
|
768
|
+
const to = Rt(() => {
|
|
769
|
+
C(window, A, ue), C(document, "visibilitychange", un), window.iframeParentListener = (e) => setTimeout(() => ue({ data: e, sameOrigin: !0 }));
|
|
770
|
+
}), fe = {};
|
|
771
|
+
function no(e) {
|
|
772
|
+
if (fe[e] === !0) return !1;
|
|
707
773
|
const t = document.querySelectorAll(`iframe#${CSS.escape(e)}`);
|
|
708
774
|
if (t.length <= 1) return !0;
|
|
709
|
-
|
|
775
|
+
fe[e] = !0;
|
|
710
776
|
const n = Array.from(t).flatMap((o) => [
|
|
711
|
-
|
|
777
|
+
N,
|
|
712
778
|
o,
|
|
713
|
-
|
|
779
|
+
N
|
|
714
780
|
]);
|
|
715
|
-
return
|
|
781
|
+
return y(
|
|
716
782
|
e,
|
|
717
783
|
`<rb>Duplicate ID attributes detected</>
|
|
718
784
|
|
|
@@ -720,198 +786,198 @@ The <b>${e}</> ID is not unique. Having multiple iframes on the same page with t
|
|
|
720
786
|
|
|
721
787
|
Found <bb>${t.length}</> iframes with the <b>${e}</> ID:`,
|
|
722
788
|
...n,
|
|
723
|
-
|
|
789
|
+
N
|
|
724
790
|
), !1;
|
|
725
791
|
}
|
|
726
|
-
const
|
|
792
|
+
const oo = `<rb>Deprecated Method Name</>
|
|
727
793
|
|
|
728
|
-
The <b>removeListeners()</> method has been renamed to <b>disconnect()</>. ${
|
|
794
|
+
The <b>removeListeners()</> method has been renamed to <b>disconnect()</>. ${Me}`, io = `<rb>Deprecated Method</>
|
|
729
795
|
|
|
730
796
|
Use of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As there are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code.`;
|
|
731
|
-
function
|
|
797
|
+
function so(e) {
|
|
732
798
|
if (i[e]) {
|
|
733
799
|
const { iframe: t } = i[e], n = {
|
|
734
|
-
close:
|
|
735
|
-
disconnect:
|
|
800
|
+
close: Be.bind(null, t),
|
|
801
|
+
disconnect: Fe.bind(null, t),
|
|
736
802
|
moveToAnchor(o) {
|
|
737
|
-
|
|
803
|
+
Nt(o, X, "moveToAnchor(anchor) anchor"), T("Move to anchor", `moveToAnchor:${o}`, e);
|
|
738
804
|
},
|
|
739
805
|
removeListeners() {
|
|
740
|
-
|
|
806
|
+
y(e, oo), this.disconnect();
|
|
741
807
|
},
|
|
742
808
|
resize() {
|
|
743
|
-
|
|
809
|
+
y(e, io), T("Window resize", Y, e);
|
|
744
810
|
},
|
|
745
811
|
sendMessage(o) {
|
|
746
|
-
o = JSON.stringify(o),
|
|
812
|
+
o = JSON.stringify(o), T(A, `${A}:${o}`, e);
|
|
747
813
|
}
|
|
748
814
|
};
|
|
749
815
|
t.iframeResizer = n, t.iFrameResizer = n;
|
|
750
816
|
}
|
|
751
817
|
}
|
|
752
|
-
const
|
|
753
|
-
function
|
|
818
|
+
const ro = "8", ao = "32", co = Et, lo = !0;
|
|
819
|
+
function uo(e) {
|
|
754
820
|
const {
|
|
755
821
|
autoResize: t,
|
|
756
822
|
bodyBackground: n,
|
|
757
823
|
bodyMargin: o,
|
|
758
|
-
bodyPadding:
|
|
759
|
-
heightCalculationMethod:
|
|
760
|
-
inPageLinks:
|
|
761
|
-
license:
|
|
824
|
+
bodyPadding: s,
|
|
825
|
+
heightCalculationMethod: a,
|
|
826
|
+
inPageLinks: r,
|
|
827
|
+
license: c,
|
|
762
828
|
log: f,
|
|
763
829
|
logExpand: p,
|
|
764
|
-
mouseEvents:
|
|
765
|
-
offsetHeight:
|
|
766
|
-
offsetWidth:
|
|
767
|
-
mode:
|
|
768
|
-
sizeHeight:
|
|
830
|
+
mouseEvents: h,
|
|
831
|
+
offsetHeight: $,
|
|
832
|
+
offsetWidth: g,
|
|
833
|
+
mode: E,
|
|
834
|
+
sizeHeight: Ke,
|
|
769
835
|
// sizeSelector,
|
|
770
|
-
sizeWidth:
|
|
771
|
-
tolerance:
|
|
772
|
-
widthCalculationMethod:
|
|
836
|
+
sizeWidth: Qe,
|
|
837
|
+
tolerance: et,
|
|
838
|
+
widthCalculationMethod: tt
|
|
773
839
|
} = i[e];
|
|
774
840
|
return [
|
|
775
841
|
e,
|
|
776
|
-
|
|
777
|
-
|
|
842
|
+
ro,
|
|
843
|
+
Qe,
|
|
778
844
|
f,
|
|
779
|
-
|
|
780
|
-
|
|
845
|
+
ao,
|
|
846
|
+
lo,
|
|
781
847
|
t,
|
|
782
848
|
o,
|
|
783
|
-
|
|
849
|
+
a,
|
|
784
850
|
n,
|
|
851
|
+
s,
|
|
852
|
+
et,
|
|
785
853
|
r,
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
Jn,
|
|
789
|
-
Ze,
|
|
790
|
-
g,
|
|
791
|
-
w,
|
|
854
|
+
co,
|
|
855
|
+
tt,
|
|
792
856
|
h,
|
|
793
|
-
|
|
794
|
-
|
|
857
|
+
$,
|
|
858
|
+
g,
|
|
859
|
+
Ke,
|
|
860
|
+
c,
|
|
795
861
|
d.version,
|
|
796
|
-
|
|
862
|
+
E,
|
|
797
863
|
"",
|
|
798
864
|
// sizeSelector,
|
|
799
865
|
p
|
|
800
|
-
].join(
|
|
866
|
+
].join(L);
|
|
801
867
|
}
|
|
802
|
-
const
|
|
803
|
-
function
|
|
868
|
+
const fo = "0";
|
|
869
|
+
function po(e) {
|
|
804
870
|
const { bodyMargin: t } = i[e];
|
|
805
|
-
(typeof t ===
|
|
871
|
+
(typeof t === Ot || t === fo) && (i[e].bodyMargin = `${t}px`);
|
|
806
872
|
}
|
|
807
|
-
const
|
|
873
|
+
const ho = (e) => {
|
|
808
874
|
try {
|
|
809
875
|
return new URL(e).origin;
|
|
810
876
|
} catch {
|
|
811
877
|
return null;
|
|
812
878
|
}
|
|
813
|
-
},
|
|
814
|
-
function
|
|
879
|
+
}, go = (e) => typeof e === ze && e.length > 0 && !(e.contains("allow-scripts") && e.contains("allow-same-origin"));
|
|
880
|
+
function yo(e, t) {
|
|
815
881
|
const {
|
|
816
882
|
checkOrigin: n,
|
|
817
|
-
iframe: { src: o, sandbox:
|
|
818
|
-
initialisedFirstPage:
|
|
819
|
-
waitForLoad:
|
|
820
|
-
} = t[e],
|
|
821
|
-
|
|
883
|
+
iframe: { src: o, sandbox: s },
|
|
884
|
+
initialisedFirstPage: a,
|
|
885
|
+
waitForLoad: r
|
|
886
|
+
} = t[e], c = ho(o);
|
|
887
|
+
b(e, "noResponse"), y(
|
|
822
888
|
e,
|
|
823
889
|
`<rb>No response from iframe</>
|
|
824
890
|
|
|
825
891
|
The iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout / 1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.
|
|
826
|
-
${n &&
|
|
827
|
-
The <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${
|
|
828
|
-
` : ""}${
|
|
892
|
+
${n && c ? `
|
|
893
|
+
The <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${c}</>, then the connection to the iframe may be blocked by the browser. To disable this option, set <b>checkOrigin</> to <bb>false</> or an array of allowed origins. See <u>https://iframe-resizer.com/checkorigin</> for more information.
|
|
894
|
+
` : ""}${r && !a ? `
|
|
829
895
|
The <b>waitForLoad</> option is currently set to <bb>true</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <bb>false</>.
|
|
830
|
-
` : ""}${
|
|
896
|
+
` : ""}${go(s) ? `
|
|
831
897
|
The iframe has the <b>sandbox</> attribute, please ensure it contains both the <bb>allow-same-origin</> and <bb>allow-scripts</> values.
|
|
832
898
|
` : ""}
|
|
833
899
|
This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.
|
|
834
900
|
`
|
|
835
901
|
);
|
|
836
902
|
}
|
|
837
|
-
function
|
|
903
|
+
function mo(e, t) {
|
|
838
904
|
function n() {
|
|
839
905
|
if (t[e] === void 0) return;
|
|
840
|
-
const { initialised:
|
|
841
|
-
if (t[e].msgTimeout = void 0,
|
|
906
|
+
const { initialised: a, loadErrorShown: r } = t[e];
|
|
907
|
+
if (t[e].msgTimeout = void 0, a) {
|
|
842
908
|
t[e].initialisedFirstPage = !0;
|
|
843
909
|
return;
|
|
844
910
|
}
|
|
845
|
-
|
|
911
|
+
r || (t[e].loadErrorShown = !0, yo(e, t));
|
|
846
912
|
}
|
|
847
|
-
const { msgTimeout: o, warningTimeout:
|
|
848
|
-
|
|
913
|
+
const { msgTimeout: o, warningTimeout: s } = t[e];
|
|
914
|
+
s && (o && clearTimeout(o), t[e].msgTimeout = setTimeout(n, s));
|
|
849
915
|
}
|
|
850
|
-
const
|
|
851
|
-
function
|
|
852
|
-
i[e]?.heightCalculationMethod in
|
|
916
|
+
const bo = 1, vo = (e) => e.loading === ct, zo = (e) => e === j;
|
|
917
|
+
function wo(e) {
|
|
918
|
+
i[e]?.heightCalculationMethod in $t && We({
|
|
853
919
|
id: e,
|
|
854
920
|
iframe: i[e].iframe,
|
|
855
|
-
height:
|
|
856
|
-
width:
|
|
857
|
-
type:
|
|
921
|
+
height: ee,
|
|
922
|
+
width: ee,
|
|
923
|
+
type: j
|
|
858
924
|
});
|
|
859
925
|
}
|
|
860
|
-
function
|
|
861
|
-
|
|
926
|
+
function Eo(e, t) {
|
|
927
|
+
C(e, G, () => setTimeout(t, bo));
|
|
862
928
|
}
|
|
863
|
-
const
|
|
929
|
+
const Oo = (e) => {
|
|
864
930
|
const { src: t, srcdoc: n } = e;
|
|
865
931
|
return !n && (t == null || t === "" || t === "about:blank");
|
|
866
932
|
};
|
|
867
|
-
function
|
|
933
|
+
function To(e, t) {
|
|
868
934
|
const { iframe: n, waitForLoad: o } = i[e];
|
|
869
935
|
if (o !== !0) {
|
|
870
|
-
if (
|
|
936
|
+
if (Oo(n)) {
|
|
871
937
|
setTimeout(() => {
|
|
872
|
-
|
|
938
|
+
b(e, "noContent"), m(e, "No content detected in the iframe, delaying initialisation");
|
|
873
939
|
});
|
|
874
940
|
return;
|
|
875
941
|
}
|
|
876
942
|
setTimeout(t);
|
|
877
943
|
}
|
|
878
944
|
}
|
|
879
|
-
function
|
|
880
|
-
const n = (
|
|
945
|
+
function ko(e, t) {
|
|
946
|
+
const n = (s) => () => {
|
|
881
947
|
if (!i[e]) return;
|
|
882
|
-
const { firstRun:
|
|
883
|
-
|
|
948
|
+
const { firstRun: a, iframe: r } = i[e];
|
|
949
|
+
T(s, t, e), zo(s) && vo(r) || mo(e, i), a || wo(e);
|
|
884
950
|
}, { iframe: o } = i[e];
|
|
885
|
-
i[e].initChild = n(
|
|
951
|
+
i[e].initChild = n(ye), Eo(o, n(me)), To(e, n(j));
|
|
886
952
|
}
|
|
887
|
-
function
|
|
888
|
-
return t ? (("sizeWidth" in t || "sizeHeight" in t ||
|
|
953
|
+
function Io(e, t) {
|
|
954
|
+
return t ? (("sizeWidth" in t || "sizeHeight" in t || ge in t) && y(
|
|
889
955
|
e,
|
|
890
956
|
`<rb>Deprecated Option</>
|
|
891
957
|
|
|
892
|
-
The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${
|
|
958
|
+
The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${D}</>, <bb>${Te}</>, <bb>${Oe}</> or <bb>${Ee}</>.
|
|
893
959
|
`
|
|
894
960
|
), t) : {};
|
|
895
961
|
}
|
|
896
|
-
function
|
|
962
|
+
function $o(e) {
|
|
897
963
|
i[e].warningTimeout || m(e, "warningTimeout:%c disabled", l);
|
|
898
964
|
}
|
|
899
|
-
function
|
|
965
|
+
function Mo(e, { offset: t, offsetSize: n }) {
|
|
900
966
|
const o = n || t;
|
|
901
|
-
o && (i[e].direction ===
|
|
967
|
+
o && (i[e].direction === D ? (i[e].offsetHeight = o, u(e, `Offset height: %c${o}`, l)) : (i[e].offsetWidth = o, u(e, `Offset width: %c${o}`, l)));
|
|
902
968
|
}
|
|
903
|
-
function
|
|
969
|
+
function So(e) {
|
|
904
970
|
const { direction: t } = i[e];
|
|
905
971
|
switch (t) {
|
|
906
|
-
case
|
|
972
|
+
case D:
|
|
907
973
|
break;
|
|
908
|
-
case
|
|
974
|
+
case Te:
|
|
909
975
|
i[e].sizeHeight = !1;
|
|
910
976
|
// eslint-disable-next-line no-fallthrough
|
|
911
|
-
case
|
|
977
|
+
case Oe:
|
|
912
978
|
i[e].sizeWidth = !0;
|
|
913
979
|
break;
|
|
914
|
-
case
|
|
980
|
+
case Ee:
|
|
915
981
|
i[e].sizeWidth = !1, i[e].sizeHeight = !1, i[e].autoResize = !1;
|
|
916
982
|
break;
|
|
917
983
|
default:
|
|
@@ -919,84 +985,92 @@ function mo(e) {
|
|
|
919
985
|
}
|
|
920
986
|
u(e, `direction: %c${t}`, l);
|
|
921
987
|
}
|
|
922
|
-
const
|
|
923
|
-
function
|
|
924
|
-
|
|
988
|
+
const pe = (e) => e === "" || e.match(/^(about:blank|javascript:|file:\/\/)/) !== null ? "*" : e;
|
|
989
|
+
function jo(e) {
|
|
990
|
+
const { checkOrigin: t, remoteHost: n } = i[e];
|
|
991
|
+
Array.isArray(t) && t.length === 0 && w(
|
|
992
|
+
e,
|
|
993
|
+
"checkOrigin is an empty array — no messages will be sent to the iframe"
|
|
994
|
+
), i[e].targetOrigin = Array.isArray(t) ? t.map(pe) : [t === !1 ? "*" : pe(n)];
|
|
925
995
|
}
|
|
926
|
-
function
|
|
996
|
+
function Ro(e) {
|
|
927
997
|
const { id: t } = e;
|
|
928
998
|
i[t].postMessageTarget === null && (i[t].postMessageTarget = e.contentWindow);
|
|
929
999
|
}
|
|
930
|
-
function
|
|
931
|
-
|
|
1000
|
+
function H(e, t, n) {
|
|
1001
|
+
P(i[e], t) && (y(
|
|
932
1002
|
e,
|
|
933
1003
|
`<rb>Deprecated option</>
|
|
934
1004
|
|
|
935
|
-
The <b>${t}</> option has been renamed to <b>${n}</>. ${
|
|
1005
|
+
The <b>${t}</> option has been renamed to <b>${n}</>. ${Me}`
|
|
936
1006
|
), i[e][n] = i[e][t], delete i[e][t]);
|
|
937
1007
|
}
|
|
938
|
-
function
|
|
939
|
-
|
|
1008
|
+
function Lo(e) {
|
|
1009
|
+
H(e, vt, zt), H(e, "onClose", "onBeforeClose"), H(e, "onClosed", "onAfterClose");
|
|
940
1010
|
}
|
|
941
|
-
const
|
|
942
|
-
function
|
|
1011
|
+
const Ao = (e) => P(e, "onMouseEnter") || P(e, "onMouseLeave");
|
|
1012
|
+
function Po(e, t) {
|
|
943
1013
|
const { id: n } = e;
|
|
944
1014
|
i[n] = {
|
|
945
1015
|
...i[n],
|
|
946
1016
|
iframe: e,
|
|
947
1017
|
remoteHost: e?.src.split("/").slice(0, 3).join("/"),
|
|
948
|
-
...
|
|
949
|
-
...
|
|
950
|
-
mouseEvents:
|
|
951
|
-
mode:
|
|
952
|
-
syncTitle:
|
|
953
|
-
},
|
|
954
|
-
}
|
|
955
|
-
const
|
|
956
|
-
function
|
|
1018
|
+
...B,
|
|
1019
|
+
...Io(n, t),
|
|
1020
|
+
mouseEvents: Ao(t),
|
|
1021
|
+
mode: Zn(t),
|
|
1022
|
+
syncTitle: _n(n)
|
|
1023
|
+
}, Lo(n), So(n), Mo(n, t), $o(n), Ro(e), jo(n);
|
|
1024
|
+
}
|
|
1025
|
+
const Co = "yes", he = "no";
|
|
1026
|
+
function No(e) {
|
|
957
1027
|
const { id: t } = e;
|
|
958
1028
|
switch (u(
|
|
959
1029
|
t,
|
|
960
1030
|
`Iframe scrolling ${i[t]?.scrolling ? "enabled" : "disabled"} for ${t}`
|
|
961
|
-
), e.style.overflow = i[t]?.scrolling === !1 ?
|
|
962
|
-
case
|
|
1031
|
+
), e.style.overflow = i[t]?.scrolling === !1 ? wt : q, i[t]?.scrolling) {
|
|
1032
|
+
case kt:
|
|
963
1033
|
break;
|
|
964
1034
|
case !0:
|
|
965
|
-
e.scrolling =
|
|
1035
|
+
e.scrolling = Co;
|
|
966
1036
|
break;
|
|
967
1037
|
case !1:
|
|
968
|
-
e.scrolling =
|
|
1038
|
+
e.scrolling = he;
|
|
969
1039
|
break;
|
|
970
1040
|
default:
|
|
971
|
-
e.scrolling = i[t]?.scrolling ||
|
|
1041
|
+
e.scrolling = i[t]?.scrolling || he;
|
|
972
1042
|
}
|
|
973
1043
|
}
|
|
974
|
-
function
|
|
975
|
-
|
|
1044
|
+
function xo(e, t, n) {
|
|
1045
|
+
Po(t, n), u(e, `src: %c${t.srcdoc || t.src}`, l), Jn(e), No(t), po(e), ko(e, uo(e)), so(e), u(e, "Setup complete");
|
|
976
1046
|
}
|
|
977
|
-
function
|
|
1047
|
+
function _o(e, t) {
|
|
978
1048
|
const { id: n } = e;
|
|
979
|
-
|
|
1049
|
+
b(n, "setup"), no(n) && xo(n, e, t), Yt(n);
|
|
980
1050
|
}
|
|
981
|
-
function
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
1051
|
+
function Fo(e, t) {
|
|
1052
|
+
t.log === ke ? t.log = !1 : t.log === Ie ? t.log = S : t.log === $e && (t.log = M);
|
|
1053
|
+
const n = P(t, "log"), o = K(t.log), s = n ? o ? !0 : t.log : B.log;
|
|
1054
|
+
P(t, "logExpand") || (t.logExpand = n && o ? t.log === M : B.logExpand), Yn(t), Vt({
|
|
1055
|
+
enabled: s,
|
|
985
1056
|
expand: t.logExpand,
|
|
986
1057
|
iframeId: e
|
|
987
|
-
}), o && !(t.log in
|
|
1058
|
+
}), o && !(t.log in Mt) && Zt(
|
|
988
1059
|
e,
|
|
989
|
-
`Invalid value for options.log: Accepted values are "${
|
|
990
|
-
), t.log =
|
|
991
|
-
}
|
|
992
|
-
function
|
|
993
|
-
if (!
|
|
994
|
-
return
|
|
995
|
-
const n =
|
|
996
|
-
return
|
|
1060
|
+
`Invalid value for options.log: Accepted values are "${M}" and "${S}"`
|
|
1061
|
+
), t.log = s;
|
|
1062
|
+
}
|
|
1063
|
+
function Wo(e) {
|
|
1064
|
+
if (!Se(e)) throw new TypeError("Options is not an object");
|
|
1065
|
+
return to(), rn(e), (t) => {
|
|
1066
|
+
const n = sn(t, e);
|
|
1067
|
+
return de in t ? (b(n, "alreadySetup"), w(n, `Ignored iframe (${n}), already setup.`)) : (Fo(n, e), Pe(n, _o)(t, e)), t?.iframeResizer;
|
|
997
1068
|
};
|
|
998
1069
|
}
|
|
999
1070
|
export {
|
|
1000
|
-
|
|
1071
|
+
Ie as LOG_COLLAPSED,
|
|
1072
|
+
ke as LOG_DISABLED,
|
|
1073
|
+
$e as LOG_EXPANDED,
|
|
1074
|
+
Wo as default
|
|
1001
1075
|
};
|
|
1002
1076
|
//# sourceMappingURL=index.esm.js.map
|