@getpinax/widget 0.0.0-stage → 1.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/LICENSE +21 -0
- package/README.md +513 -2
- package/dist/a11y/scan.d.ts +25 -0
- package/dist/api.d.ts +83 -0
- package/dist/capture/breadcrumbs.d.ts +49 -0
- package/dist/capture/console.d.ts +17 -0
- package/dist/capture/env.d.ts +25 -0
- package/dist/capture/network.d.ts +23 -0
- package/dist/capture/ring.d.ts +14 -0
- package/dist/capture/signature.d.ts +7 -0
- package/dist/capture/text.d.ts +23 -0
- package/dist/capture/ua.d.ts +13 -0
- package/dist/chunks/editor-0Kr31Uly.mjs +1368 -0
- package/dist/chunks/privacy-B_b1_Y1n.mjs +39 -0
- package/dist/chunks/recorder-tu4yugLw.mjs +2874 -0
- package/dist/chunks/scan-CFQwrtAQ.mjs +46137 -0
- package/dist/chunks/text-D9SaDBT0.mjs +36 -0
- package/dist/chunks/widget-BpTBdX2R.mjs +1272 -0
- package/dist/editor/annotator.d.ts +20 -0
- package/dist/editor/capture.d.ts +28 -0
- package/dist/editor/encode.d.ts +7 -0
- package/dist/editor/index.d.ts +5 -0
- package/dist/editor/mask.d.ts +29 -0
- package/dist/editor/pii.d.ts +22 -0
- package/dist/editor/shapes.d.ts +31 -0
- package/dist/editor-loader.d.ts +9 -0
- package/dist/editor-loader.embed.d.ts +6 -0
- package/dist/fixcheck.d.ts +42 -0
- package/dist/index.d.ts +85 -0
- package/dist/known.d.ts +27 -0
- package/dist/mount.d.ts +8 -0
- package/dist/navigation.d.ts +1 -0
- package/dist/paths.d.ts +4 -0
- package/dist/pinax-axe.js +46167 -0
- package/dist/pinax-editor.js +1417 -0
- package/dist/pinax-recorder.js +2915 -0
- package/dist/pinax.js +135 -0
- package/dist/pinax.mjs +1270 -0
- package/dist/preview.d.ts +48 -0
- package/dist/preview.mjs +67 -0
- package/dist/privacy.d.ts +24 -0
- package/dist/queue.d.ts +10 -0
- package/dist/replay/buffer.d.ts +40 -0
- package/dist/replay/recorder.d.ts +25 -0
- package/dist/replay/sanitize.d.ts +19 -0
- package/dist/report.d.ts +128 -0
- package/dist/segment.d.ts +31 -0
- package/dist/settings.d.ts +40 -0
- package/dist/types.d.ts +247 -0
- package/dist/ui/color.d.ts +7 -0
- package/dist/ui/dom.d.ts +14 -0
- package/dist/ui/styles.d.ts +3 -0
- package/dist/ui/widget.d.ts +241 -0
- package/package.json +74 -4
|
@@ -0,0 +1,1368 @@
|
|
|
1
|
+
import { c as e, r as t } from "./widget-BpTBdX2R.mjs";
|
|
2
|
+
import { a as n, i as r, n as i, r as a, t as o } from "./privacy-B_b1_Y1n.mjs";
|
|
3
|
+
// src/editor/shapes.ts
|
|
4
|
+
var s = "#FF5C35", c = "#CC3F1B";
|
|
5
|
+
function l(e) {
|
|
6
|
+
return e.type === "arrow" || e.type === "text" ? e : {
|
|
7
|
+
...e,
|
|
8
|
+
x: Math.min(e.x, e.x + e.w),
|
|
9
|
+
y: Math.min(e.y, e.y + e.h),
|
|
10
|
+
w: Math.abs(e.w),
|
|
11
|
+
h: Math.abs(e.h)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function u(e, t) {
|
|
15
|
+
return Math.max(3, Math.round(Math.min(e, t) / 220));
|
|
16
|
+
}
|
|
17
|
+
function d(e, t) {
|
|
18
|
+
return Math.max(13, Math.round(Math.min(e, t) / 55));
|
|
19
|
+
}
|
|
20
|
+
function f(e, t, n, r, i, a) {
|
|
21
|
+
let o = Math.min(a, r / 2, i / 2);
|
|
22
|
+
e.beginPath(), e.moveTo(t + o, n), e.arcTo(t + r, n, t + r, n + i, o), e.arcTo(t + r, n + i, t, n + i, o), e.arcTo(t, n + i, t, n, o), e.arcTo(t, n, t + r, n, o), e.closePath();
|
|
23
|
+
}
|
|
24
|
+
function p(e, t, n) {
|
|
25
|
+
e.font = `700 ${n}px Manrope, system-ui, sans-serif`;
|
|
26
|
+
let r = Math.round(n * .6);
|
|
27
|
+
return {
|
|
28
|
+
w: Math.ceil(e.measureText(t).width) + r * 2,
|
|
29
|
+
h: Math.round(n * 1.9),
|
|
30
|
+
pad: r
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function m(e, t, n, r, i) {
|
|
34
|
+
let a = u(r, i), o = l(t);
|
|
35
|
+
if (e.save(), o.type === "box") e.strokeStyle = s, e.lineWidth = a, f(e, o.x, o.y, o.w, o.h, a * 2.5), e.stroke();
|
|
36
|
+
else if (o.type === "blur") {
|
|
37
|
+
let t = Math.max(1, Math.round(o.w)), a = Math.max(1, Math.round(o.h)), s = Math.max(8, Math.round(Math.min(r, i) / 70)), c = n, l = o.x, u = o.y, d = t, f = a, p = Math.max(1, Math.ceil(t / s)), m = Math.max(1, Math.ceil(a / s));
|
|
38
|
+
for (; d > p || f > m;) {
|
|
39
|
+
let e = Math.max(p, Math.ceil(d / 2)), t = Math.max(m, Math.ceil(f / 2)), n = document.createElement("canvas");
|
|
40
|
+
n.width = e, n.height = t;
|
|
41
|
+
let r = n.getContext("2d");
|
|
42
|
+
if (!r) break;
|
|
43
|
+
r.imageSmoothingEnabled = !0, r.imageSmoothingQuality = "high", r.drawImage(c, l, u, d, f, 0, 0, e, t), c = n, l = 0, u = 0, d = e, f = t;
|
|
44
|
+
}
|
|
45
|
+
e.imageSmoothingEnabled = !1, e.drawImage(c, l, u, d, f, o.x, o.y, t, a);
|
|
46
|
+
} else if (o.type === "arrow") {
|
|
47
|
+
let t = o.x + o.w, n = o.y + o.h, r = Math.atan2(o.h, o.w), i = a * 4.5;
|
|
48
|
+
e.strokeStyle = s, e.lineWidth = a, e.lineCap = "round", e.lineJoin = "round", e.beginPath(), e.moveTo(o.x, o.y), e.lineTo(t, n), e.moveTo(t - i * Math.cos(r - Math.PI / 6), n - i * Math.sin(r - Math.PI / 6)), e.lineTo(t, n), e.lineTo(t - i * Math.cos(r + Math.PI / 6), n - i * Math.sin(r + Math.PI / 6)), e.stroke();
|
|
49
|
+
} else if (o.type === "text" && o.text) {
|
|
50
|
+
let t = d(r, i), n = p(e, o.text, t);
|
|
51
|
+
e.fillStyle = c, f(e, o.x, o.y, n.w, n.h, t * .5), e.fill(), e.fillStyle = "#FFFFFF", e.textBaseline = "middle", e.fillText(o.text, o.x + n.pad, o.y + n.h / 2);
|
|
52
|
+
}
|
|
53
|
+
e.restore();
|
|
54
|
+
}
|
|
55
|
+
function h(e, t, n) {
|
|
56
|
+
let r = [];
|
|
57
|
+
for (let i of e) {
|
|
58
|
+
let e = l(i), a = e.type === "text" ? n(e) : {
|
|
59
|
+
w: e.w,
|
|
60
|
+
h: e.h
|
|
61
|
+
}, o = Math.min(e.x, e.x + a.w), s = Math.max(e.x, e.x + a.w), c = Math.min(e.y, e.y + a.h), u = Math.max(e.y, e.y + a.h);
|
|
62
|
+
if (s < t.x || o > t.x + t.w || u < t.y || c > t.y + t.h) continue;
|
|
63
|
+
let d = {
|
|
64
|
+
type: e.type,
|
|
65
|
+
x: (e.x - t.x) / t.w,
|
|
66
|
+
y: (e.y - t.y) / t.h,
|
|
67
|
+
w: a.w / t.w,
|
|
68
|
+
h: a.h / t.h
|
|
69
|
+
};
|
|
70
|
+
e.type === "text" && (d.text = e.text), r.push(d);
|
|
71
|
+
}
|
|
72
|
+
return r;
|
|
73
|
+
}
|
|
74
|
+
// src/editor/annotator.ts
|
|
75
|
+
var g = "\n.ed { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; gap: 12px; padding: 12px; background: rgba(7,11,23,0.92); font-family: Manrope, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif; color: #E8ECF7; font-size: 13px; }\n.ed * { box-sizing: border-box; }\n.ed button { font: inherit; cursor: pointer; }\n.ed :focus-visible { outline: 3px solid #B8F35C; outline-offset: 2px; }\n.ed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; background: #0E1426; box-shadow: inset 0 0 0 1px rgba(157,180,255,0.16); }\n.ed-grp { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }\n.ed-sep { width: 1px; align-self: stretch; background: rgba(157,180,255,0.16); margin: 0 2px; }\n.ed-t { min-height: 36px; padding: 8px 12px; border: 0; border-radius: 8px; background: rgba(255,255,255,0.06); color: #E8ECF7; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }\n.ed-t:hover { background: rgba(255,255,255,0.1); }\n.ed-t[aria-pressed=true] { background: #B8F35C; color: #0B1300; font-weight: 700; }\n.ed-t:disabled { opacity: .45; cursor: default; }\n.ed-sp { flex: 1; }\n.ed-done { background: #B8F35C; color: #0B1300; font-weight: 800; }\n.ed-done:hover { background: #CFF59A; }\n.ed-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }\n.ed-cv { display: block; max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6); touch-action: none; cursor: crosshair; background: #FFFFFF; }\n.ed-hint { margin: 0; text-align: center; color: #A7B2CC; font-size: 13px; }\n.ed-txt { position: absolute; min-width: 160px; padding: 8px 10px; border: 0; border-radius: 8px; background: #CC3F1B; color: #FFFFFF; font: 700 14px Manrope, system-ui, sans-serif; box-shadow: 0 0 0 3px #FFFFFF; }\n.ed-txt::placeholder { color: rgba(255,255,255,0.85); }\n.ed-txt:focus { outline: none; }\n.ed-auto { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: #CFF59A; font-size: 13px; font-weight: 600; text-align: center; }\n.ed-auto i { flex: none; width: 18px; height: 12px; border-radius: 3px; border: 2px dashed #B8F35C; background: repeating-linear-gradient(90deg, #D8DEE9 0 4px, #C7CFDC 4px 8px); }\n.ed-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n@media (max-width: 640px) { .ed { padding: 8px; gap: 8px; } .ed-bar { padding: 8px; gap: 6px; } .ed-t { padding: 8px 10px; } .ed-sep { display: none; } }\n", _ = [
|
|
76
|
+
["box", "Box"],
|
|
77
|
+
["arrow", "Arrow"],
|
|
78
|
+
["text", "Text"],
|
|
79
|
+
["blur", "Blur"]
|
|
80
|
+
], v = 6;
|
|
81
|
+
function y(e, n, r, i = []) {
|
|
82
|
+
return new Promise((a) => {
|
|
83
|
+
let o = n.width, s = n.height, c = r ? r.shapes.map((e) => ({ ...e })) : [], u = r?.area ? { ...r.area } : null, f = "box", y = u ? "area" : "full", x = null, S = null, C = null, w = e.activeElement, T = t("style");
|
|
84
|
+
T.textContent = g;
|
|
85
|
+
let E = t("div", {
|
|
86
|
+
class: "ed-sr",
|
|
87
|
+
role: "status",
|
|
88
|
+
"aria-live": "polite"
|
|
89
|
+
}), D = (e) => {
|
|
90
|
+
E.textContent = e;
|
|
91
|
+
}, O = t("canvas", {
|
|
92
|
+
class: "ed-cv",
|
|
93
|
+
width: o,
|
|
94
|
+
height: s,
|
|
95
|
+
tabindex: 0,
|
|
96
|
+
role: "img"
|
|
97
|
+
}), k = O.getContext("2d"), A = (e, n = "ed-t", r = {}) => t("button", {
|
|
98
|
+
type: "button",
|
|
99
|
+
class: n,
|
|
100
|
+
...r
|
|
101
|
+
}, e), j = A("Whole screen", "ed-t", { "aria-pressed": "true" }), M = A("Select area", "ed-t", { "aria-pressed": "false" }), N = _.map(([e, t]) => {
|
|
102
|
+
let n = A(t, "ed-t", {
|
|
103
|
+
"aria-pressed": "false",
|
|
104
|
+
"data-tool": e
|
|
105
|
+
});
|
|
106
|
+
return n.addEventListener("click", () => {
|
|
107
|
+
f = e, R = !1, u || (y = "full"), H();
|
|
108
|
+
}), n;
|
|
109
|
+
}), P = A("Undo"), F = A("Clear"), I = A("Cancel"), te = A("Done", "ed-t ed-done"), ne = t("p", {
|
|
110
|
+
class: "ed-hint",
|
|
111
|
+
id: "pnx-ed-hint"
|
|
112
|
+
}), L = i.length ? t("p", {
|
|
113
|
+
class: "ed-auto",
|
|
114
|
+
id: "pnx-ed-auto"
|
|
115
|
+
}, t("i", { "aria-hidden": "true" }), `${i.length === 1 ? "1 private detail was" : `${i.length} private details were`} blurred automatically (outlined). They stay blurred.`) : null;
|
|
116
|
+
O.setAttribute("aria-describedby", L ? "pnx-ed-hint pnx-ed-auto" : "pnx-ed-hint");
|
|
117
|
+
let R = !1;
|
|
118
|
+
j.addEventListener("click", () => {
|
|
119
|
+
u = null, y = "full", R = !1, D("Whole screen selected."), H();
|
|
120
|
+
}), M.addEventListener("click", () => {
|
|
121
|
+
y = "area", R = !0, D("Drag over the part of the screenshot to keep."), H(), O.focus();
|
|
122
|
+
}), P.addEventListener("click", () => {
|
|
123
|
+
c.pop() && D("Last mark removed."), H();
|
|
124
|
+
}), F.addEventListener("click", () => {
|
|
125
|
+
c.length = 0, D("All marks cleared."), H();
|
|
126
|
+
});
|
|
127
|
+
let re = t("div", {
|
|
128
|
+
class: "ed-bar",
|
|
129
|
+
role: "toolbar",
|
|
130
|
+
"aria-label": "Screenshot tools"
|
|
131
|
+
}, t("div", {
|
|
132
|
+
class: "ed-grp",
|
|
133
|
+
role: "group",
|
|
134
|
+
"aria-label": "Capture"
|
|
135
|
+
}, j, M), t("span", {
|
|
136
|
+
class: "ed-sep",
|
|
137
|
+
"aria-hidden": "true"
|
|
138
|
+
}), t("div", {
|
|
139
|
+
class: "ed-grp",
|
|
140
|
+
role: "group",
|
|
141
|
+
"aria-label": "Draw"
|
|
142
|
+
}, ...N), t("span", {
|
|
143
|
+
class: "ed-sep",
|
|
144
|
+
"aria-hidden": "true"
|
|
145
|
+
}), t("div", { class: "ed-grp" }, P, F), t("span", { class: "ed-sp" }), t("div", { class: "ed-grp" }, I, te)), z = t("div", { class: "ed-stage" }, O), B = t("div", {
|
|
146
|
+
class: "ed",
|
|
147
|
+
role: "dialog",
|
|
148
|
+
"aria-modal": "true",
|
|
149
|
+
"aria-label": "Mark up screenshot"
|
|
150
|
+
}, re, z, ne, L, E), ie = (e) => p(k, e.text ?? "", d(o, s));
|
|
151
|
+
function V() {
|
|
152
|
+
k.clearRect(0, 0, o, s), k.drawImage(n, 0, 0);
|
|
153
|
+
for (let e of c) m(k, e, n, o, s);
|
|
154
|
+
x && m(k, x, n, o, s), ae();
|
|
155
|
+
let e = S ? b(S) : u;
|
|
156
|
+
if (e) {
|
|
157
|
+
k.save(), k.fillStyle = "rgba(7,11,23,0.55)", k.beginPath(), k.rect(0, 0, o, s), k.rect(e.x, e.y, e.w, e.h), k.fill("evenodd");
|
|
158
|
+
let t = Math.max(2, Math.round(Math.min(o, s) / 400));
|
|
159
|
+
k.setLineDash([t * 4, t * 3]), k.lineWidth = t, k.strokeStyle = "#7C9CFF", k.strokeRect(e.x, e.y, e.w, e.h), k.restore();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function ae() {
|
|
163
|
+
if (!i.length) return;
|
|
164
|
+
let e = Math.max(2, Math.round(Math.min(o, s) / 450)), t = Math.max(11, Math.round(d(o, s) * .75));
|
|
165
|
+
k.save(), k.lineWidth = e, k.setLineDash([e * 3, e * 2]), k.strokeStyle = "#B8F35C", k.font = `800 ${t}px Manrope, system-ui, sans-serif`, k.textBaseline = "middle";
|
|
166
|
+
for (let e of i) k.strokeRect(e.x, e.y, e.w, e.h);
|
|
167
|
+
let n = i[0], r = "Auto-blurred", a = Math.round(t * .5), c = Math.ceil(k.measureText(r).width) + a * 2, l = Math.round(t * 1.7), u = Math.min(Math.max(0, n.x), o - c), f = n.y - l - e >= 0 ? n.y - l - e : n.y + n.h + e;
|
|
168
|
+
k.setLineDash([]), k.fillStyle = "#B8F35C", k.fillRect(u, f, c, l), k.fillStyle = "#0B1300", k.fillText(r, u + a, f + l / 2), k.restore();
|
|
169
|
+
}
|
|
170
|
+
function H() {
|
|
171
|
+
j.setAttribute("aria-pressed", String(y === "full")), M.setAttribute("aria-pressed", String(y === "area"));
|
|
172
|
+
for (let e of N) e.setAttribute("aria-pressed", String(!R && e.dataset.tool === f));
|
|
173
|
+
P.disabled = c.length === 0, F.disabled = c.length === 0;
|
|
174
|
+
let e = c.length;
|
|
175
|
+
O.setAttribute("aria-label", `Screenshot of the page${e ? `, ${e} ${e === 1 ? "mark" : "marks"}` : ""}${i.length ? `, ${i.length} blurred automatically` : ""}${u ? ", area selected" : ""}`), ne.textContent = R ? "Drag over the part you want to send." : f === "text" ? "Tap where the label should go, then type." : `Drag to draw a ${f === "blur" ? "blurred area" : f}, or tap to place one.`, V();
|
|
176
|
+
}
|
|
177
|
+
function U(e) {
|
|
178
|
+
let t = O.getBoundingClientRect();
|
|
179
|
+
return {
|
|
180
|
+
x: (e.clientX - t.left) / t.width * o,
|
|
181
|
+
y: (e.clientY - t.top) / t.height * s
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function oe(e, t, n) {
|
|
185
|
+
let r = o * .16, i = s * .12;
|
|
186
|
+
if (e === "arrow") {
|
|
187
|
+
let e = o * .08, r = s * .08, i = t - e < 0 ? 1 : -1, a = n - r < 0 ? 1 : -1;
|
|
188
|
+
return {
|
|
189
|
+
type: "arrow",
|
|
190
|
+
x: t + i * e,
|
|
191
|
+
y: n + a * r,
|
|
192
|
+
w: -i * e,
|
|
193
|
+
h: -a * r
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
return {
|
|
197
|
+
type: e,
|
|
198
|
+
x: se(t - r / 2, r),
|
|
199
|
+
y: W(n - i / 2, i),
|
|
200
|
+
w: r,
|
|
201
|
+
h: i
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
let se = (e, t) => Math.min(Math.max(0, e), o - t), W = (e, t) => Math.min(Math.max(0, e), s - t);
|
|
205
|
+
function G(e) {
|
|
206
|
+
c.push(l(e)), D(`${e.type === "blur" ? "Blurred area" : e.type[0].toUpperCase() + e.type.slice(1)} added.`), H();
|
|
207
|
+
}
|
|
208
|
+
function K(e, n) {
|
|
209
|
+
C?.remove();
|
|
210
|
+
let r = t("input", {
|
|
211
|
+
class: "ed-txt",
|
|
212
|
+
type: "text",
|
|
213
|
+
maxlength: 120,
|
|
214
|
+
"aria-label": "Label text",
|
|
215
|
+
placeholder: "Type a label, then Enter",
|
|
216
|
+
autocomplete: "off"
|
|
217
|
+
}), i = O.getBoundingClientRect(), a = z.getBoundingClientRect(), c = i.left - a.left + e / o * i.width, l = i.top - a.top + n / s * i.height;
|
|
218
|
+
r.style.left = `${Math.min(c, a.width - 170)}px`, r.style.top = `${Math.min(l, a.height - 40)}px`;
|
|
219
|
+
let u = !1, f = (t) => {
|
|
220
|
+
if (u) return;
|
|
221
|
+
u = !0;
|
|
222
|
+
let i = r.value.trim();
|
|
223
|
+
if (r.remove(), C = null, t && i) {
|
|
224
|
+
let t = d(o, s), r = p(k, i, t);
|
|
225
|
+
G({
|
|
226
|
+
type: "text",
|
|
227
|
+
x: se(e, r.w),
|
|
228
|
+
y: W(n, r.h),
|
|
229
|
+
w: r.w,
|
|
230
|
+
h: r.h,
|
|
231
|
+
text: i
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
O.focus();
|
|
235
|
+
};
|
|
236
|
+
r.addEventListener("keydown", (e) => {
|
|
237
|
+
e.stopPropagation(), e.key === "Enter" && f(!0), e.key === "Escape" && f(!1);
|
|
238
|
+
}), r.addEventListener("blur", () => f(!0)), z.append(r), C = r, r.focus();
|
|
239
|
+
}
|
|
240
|
+
let q = null;
|
|
241
|
+
O.addEventListener("pointerdown", (e) => {
|
|
242
|
+
q || e.pointerType === "mouse" && e.button !== 0 || (e.preventDefault(), O.setPointerCapture?.(e.pointerId), q = {
|
|
243
|
+
...U(e),
|
|
244
|
+
cx: e.clientX,
|
|
245
|
+
cy: e.clientY,
|
|
246
|
+
id: e.pointerId
|
|
247
|
+
});
|
|
248
|
+
}), O.addEventListener("pointermove", (e) => {
|
|
249
|
+
if (!q || e.pointerId !== q.id) return;
|
|
250
|
+
let t = U(e);
|
|
251
|
+
R ? S = {
|
|
252
|
+
x: q.x,
|
|
253
|
+
y: q.y,
|
|
254
|
+
w: t.x - q.x,
|
|
255
|
+
h: t.y - q.y
|
|
256
|
+
} : f !== "text" && (x = {
|
|
257
|
+
type: f,
|
|
258
|
+
x: q.x,
|
|
259
|
+
y: q.y,
|
|
260
|
+
w: t.x - q.x,
|
|
261
|
+
h: t.y - q.y
|
|
262
|
+
}), V();
|
|
263
|
+
});
|
|
264
|
+
let ce = (e, t = !1) => {
|
|
265
|
+
if (!q || e.pointerId !== q.id) return;
|
|
266
|
+
let n = q;
|
|
267
|
+
q = null;
|
|
268
|
+
let r = Math.hypot(e.clientX - n.cx, e.clientY - n.cy) > v, i = U(e);
|
|
269
|
+
if (x = null, t) S = null, V();
|
|
270
|
+
else if (R) {
|
|
271
|
+
S = null;
|
|
272
|
+
let e = ee(b({
|
|
273
|
+
x: n.x,
|
|
274
|
+
y: n.y,
|
|
275
|
+
w: i.x - n.x,
|
|
276
|
+
h: i.y - n.y
|
|
277
|
+
}), o, s);
|
|
278
|
+
r && e.w > 8 && e.h > 8 && (u = e, R = !1, D("Area selected.")), H();
|
|
279
|
+
} else f === "text" ? K(n.x, n.y) : G(r ? {
|
|
280
|
+
type: f,
|
|
281
|
+
x: n.x,
|
|
282
|
+
y: n.y,
|
|
283
|
+
w: i.x - n.x,
|
|
284
|
+
h: i.y - n.y
|
|
285
|
+
} : oe(f, n.x, n.y));
|
|
286
|
+
};
|
|
287
|
+
O.addEventListener("pointerup", (e) => ce(e)), O.addEventListener("pointercancel", (e) => ce(e, !0)), O.addEventListener("keydown", (e) => {
|
|
288
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), R ? (u = {
|
|
289
|
+
x: o * .2,
|
|
290
|
+
y: s * .2,
|
|
291
|
+
w: o * .6,
|
|
292
|
+
h: s * .6
|
|
293
|
+
}, R = !1, D("Middle of the screenshot selected."), H()) : f === "text" ? K(o * .4, s * .45) : G(oe(f, o / 2, s / 2)));
|
|
294
|
+
});
|
|
295
|
+
function J(e) {
|
|
296
|
+
B.removeEventListener("keydown", ue, !0), B.remove(), T.remove();
|
|
297
|
+
try {
|
|
298
|
+
w?.focus();
|
|
299
|
+
} catch {}
|
|
300
|
+
a(e);
|
|
301
|
+
}
|
|
302
|
+
function le() {
|
|
303
|
+
let e = u ?? {
|
|
304
|
+
x: 0,
|
|
305
|
+
y: 0,
|
|
306
|
+
w: o,
|
|
307
|
+
h: s
|
|
308
|
+
}, t = document.createElement("canvas");
|
|
309
|
+
t.width = Math.max(1, Math.round(e.w)), t.height = Math.max(1, Math.round(e.h));
|
|
310
|
+
let r = t.getContext("2d"), i = document.createElement("canvas");
|
|
311
|
+
i.width = o, i.height = s;
|
|
312
|
+
let a = i.getContext("2d");
|
|
313
|
+
a.drawImage(n, 0, 0);
|
|
314
|
+
for (let e of c) m(a, e, n, o, s);
|
|
315
|
+
r.drawImage(i, e.x, e.y, e.w, e.h, 0, 0, t.width, t.height), i.width = 0, i.height = 0, J({
|
|
316
|
+
canvas: t,
|
|
317
|
+
annotations: h(c, e, ie),
|
|
318
|
+
state: {
|
|
319
|
+
shapes: c.map((e) => ({ ...e })),
|
|
320
|
+
area: u
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
I.addEventListener("click", () => J(null)), te.addEventListener("click", le);
|
|
325
|
+
function ue(t) {
|
|
326
|
+
if (t.key === "Escape") t.preventDefault(), t.stopPropagation(), J(null);
|
|
327
|
+
else if ((t.metaKey || t.ctrlKey) && t.key.toLowerCase() === "z") t.preventDefault(), c.pop() && D("Last mark removed."), H();
|
|
328
|
+
else if (t.key === "Tab") {
|
|
329
|
+
let n = [...B.querySelectorAll("button:not(:disabled), canvas, input")];
|
|
330
|
+
if (!n.length) return;
|
|
331
|
+
let r = n[0], i = n[n.length - 1], a = e.activeElement;
|
|
332
|
+
t.shiftKey && a === r ? (t.preventDefault(), i.focus()) : !t.shiftKey && a === i && (t.preventDefault(), r.focus());
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
B.addEventListener("keydown", ue, !0), e.append(T, B), H(), N[0].focus();
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
function b(e) {
|
|
339
|
+
return {
|
|
340
|
+
x: Math.min(e.x, e.x + e.w),
|
|
341
|
+
y: Math.min(e.y, e.y + e.h),
|
|
342
|
+
w: Math.abs(e.w),
|
|
343
|
+
h: Math.abs(e.h)
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
function ee(e, t, n) {
|
|
347
|
+
let r = Math.max(0, e.x), i = Math.max(0, e.y);
|
|
348
|
+
return {
|
|
349
|
+
x: r,
|
|
350
|
+
y: i,
|
|
351
|
+
w: Math.max(0, Math.min(t, e.x + e.w) - r),
|
|
352
|
+
h: Math.max(0, Math.min(n, e.y + e.h) - i)
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
var x = "[modern-screenshot]", S = typeof window < "u", C = S && "Worker" in window;
|
|
356
|
+
S && "atob" in window, S && "btoa" in window;
|
|
357
|
+
var w = S ? window.navigator?.userAgent : "", T = w.includes("Chrome"), E = w.includes("AppleWebKit") && !T, D = w.includes("Firefox"), O = (e) => e && "__CONTEXT__" in e, k = (e) => e.constructor.name === "CSSFontFaceRule", A = (e) => e.constructor.name === "CSSImportRule", j = (e) => e.constructor.name === "CSSLayerBlockRule", M = (e) => e.nodeType === 1, N = (e) => typeof e.className == "object", P = (e) => e.tagName === "image", F = (e) => e.tagName === "use", I = (e) => M(e) && e.style !== void 0 && !N(e), te = (e) => e.nodeType === 8, ne = (e) => e.nodeType === 3, L = (e) => e.tagName === "IMG", R = (e) => e.tagName === "VIDEO", re = (e) => e.tagName === "CANVAS", z = (e) => e.tagName === "TEXTAREA", B = (e) => e.tagName === "INPUT", ie = (e) => e.tagName === "STYLE", V = (e) => e.tagName === "SCRIPT", ae = (e) => e.tagName === "SELECT", H = (e) => e.tagName === "SLOT", U = (e) => e.tagName === "IFRAME", oe = (...e) => console.warn(x, ...e);
|
|
358
|
+
function se(e) {
|
|
359
|
+
let t = e?.createElement?.("canvas");
|
|
360
|
+
return t && (t.height = t.width = 1), !!t && "toDataURL" in t && !!t.toDataURL("image/webp").includes("image/webp");
|
|
361
|
+
}
|
|
362
|
+
var W = (e) => e.startsWith("data:");
|
|
363
|
+
function G(e, t) {
|
|
364
|
+
if (e.match(/^[a-z]+:\/\//i)) return e;
|
|
365
|
+
if (S && e.match(/^\/\//)) return window.location.protocol + e;
|
|
366
|
+
if (e.match(/^[a-z]+:/i) || !S) return e;
|
|
367
|
+
let n = K().implementation.createHTMLDocument(), r = n.createElement("base"), i = n.createElement("a");
|
|
368
|
+
return n.head.appendChild(r), n.body.appendChild(i), t && (r.href = t), i.href = e, i.href;
|
|
369
|
+
}
|
|
370
|
+
function K(e) {
|
|
371
|
+
return (e && M(e) ? e?.ownerDocument : e) ?? window.document;
|
|
372
|
+
}
|
|
373
|
+
var q = "http://www.w3.org/2000/svg";
|
|
374
|
+
function ce(e, t, n) {
|
|
375
|
+
let r = K(n).createElementNS(q, "svg");
|
|
376
|
+
return r.setAttributeNS(null, "width", e.toString()), r.setAttributeNS(null, "height", t.toString()), r.setAttributeNS(null, "viewBox", `0 0 ${e} ${t}`), r;
|
|
377
|
+
}
|
|
378
|
+
function J(e, t) {
|
|
379
|
+
let n = new XMLSerializer().serializeToString(e);
|
|
380
|
+
return t && (n = n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu, "")), `data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`;
|
|
381
|
+
}
|
|
382
|
+
function le(e, t) {
|
|
383
|
+
return new Promise((n, r) => {
|
|
384
|
+
let i = new FileReader();
|
|
385
|
+
i.onload = () => n(i.result), i.onerror = () => r(i.error), i.onabort = () => r(/* @__PURE__ */ Error(`Failed read blob to ${t}`)), t === "dataUrl" ? i.readAsDataURL(e) : t === "arrayBuffer" && i.readAsArrayBuffer(e);
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
var ue = (e) => le(e, "dataUrl");
|
|
389
|
+
function Y(e, t) {
|
|
390
|
+
let n = K(t).createElement("img");
|
|
391
|
+
return n.decoding = "sync", n.loading = "eager", n.src = e, n;
|
|
392
|
+
}
|
|
393
|
+
function X(e, t) {
|
|
394
|
+
return new Promise((n) => {
|
|
395
|
+
let { timeout: r, ownerDocument: i, onError: a, onWarn: o } = t ?? {}, s = typeof e == "string" ? Y(e, K(i)) : e, c = null, l = null;
|
|
396
|
+
function u() {
|
|
397
|
+
n(s), c && clearTimeout(c), l?.();
|
|
398
|
+
}
|
|
399
|
+
if (r && (c = setTimeout(u, r)), R(s)) {
|
|
400
|
+
let e = s.currentSrc || s.src;
|
|
401
|
+
if (!e) return s.poster ? X(s.poster, t).then(n) : u();
|
|
402
|
+
if (s.readyState >= 2) return u();
|
|
403
|
+
let r = u, i = (t) => {
|
|
404
|
+
o?.("Failed video load", e, t), a?.(t), u();
|
|
405
|
+
};
|
|
406
|
+
l = () => {
|
|
407
|
+
s.removeEventListener("loadeddata", r), s.removeEventListener("error", i);
|
|
408
|
+
}, s.addEventListener("loadeddata", r, { once: !0 }), s.addEventListener("error", i, { once: !0 });
|
|
409
|
+
} else {
|
|
410
|
+
let e = P(s) ? s.href.baseVal : s.currentSrc || s.src;
|
|
411
|
+
if (!e) return u();
|
|
412
|
+
let t = async () => {
|
|
413
|
+
if (L(s) && "decode" in s) try {
|
|
414
|
+
await s.decode();
|
|
415
|
+
} catch (t) {
|
|
416
|
+
o?.("Failed to decode image, trying to render anyway", s.dataset.originalSrc || e, t);
|
|
417
|
+
}
|
|
418
|
+
u();
|
|
419
|
+
}, n = (t) => {
|
|
420
|
+
o?.("Failed image load", s.dataset.originalSrc || e, t), u();
|
|
421
|
+
};
|
|
422
|
+
if (L(s) && s.complete) return t();
|
|
423
|
+
l = () => {
|
|
424
|
+
s.removeEventListener("load", t), s.removeEventListener("error", n);
|
|
425
|
+
}, s.addEventListener("load", t, { once: !0 }), s.addEventListener("error", n, { once: !0 });
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
async function de(e, t) {
|
|
430
|
+
I(e) && (L(e) || R(e) ? await X(e, t) : await Promise.all(["img", "video"].flatMap((n) => Array.from(e.querySelectorAll(n)).map((e) => X(e, t)))));
|
|
431
|
+
}
|
|
432
|
+
var fe = /* @__PURE__ */ function() {
|
|
433
|
+
let e = 0, t = () => `0000${(Math.random() * 36 ** 4 | 0).toString(36)}`.slice(-4);
|
|
434
|
+
return () => (e += 1, `u${t()}${e}`);
|
|
435
|
+
}();
|
|
436
|
+
function pe(e) {
|
|
437
|
+
return e?.split(",").map((e) => e.trim().replace(/"|'/g, "").toLowerCase()).filter(Boolean);
|
|
438
|
+
}
|
|
439
|
+
var me = 0;
|
|
440
|
+
function he(e) {
|
|
441
|
+
let t = `${x}[#${me}]`;
|
|
442
|
+
return me++, {
|
|
443
|
+
time: (n) => e && console.time(`${t} ${n}`),
|
|
444
|
+
timeEnd: (n) => e && console.timeEnd(`${t} ${n}`),
|
|
445
|
+
warn: (...t) => e && oe(...t)
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
function ge(e) {
|
|
449
|
+
return { cache: e ? "no-cache" : "force-cache" };
|
|
450
|
+
}
|
|
451
|
+
async function _e(e, t) {
|
|
452
|
+
return O(e) ? e : ve(e, {
|
|
453
|
+
...t,
|
|
454
|
+
autoDestruct: !0
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
async function ve(e, t) {
|
|
458
|
+
let { scale: n = 1, workerUrl: r, workerNumber: i = 1 } = t || {}, a = !!t?.debug, o = t?.features ?? !0, s = e.ownerDocument ?? (S ? window.document : void 0), c = e.ownerDocument?.defaultView ?? (S ? window : void 0), l = /* @__PURE__ */ new Map(), u = {
|
|
459
|
+
width: 0,
|
|
460
|
+
height: 0,
|
|
461
|
+
quality: 1,
|
|
462
|
+
type: "image/png",
|
|
463
|
+
scale: n,
|
|
464
|
+
backgroundColor: null,
|
|
465
|
+
style: null,
|
|
466
|
+
filter: null,
|
|
467
|
+
maximumCanvasSize: 0,
|
|
468
|
+
timeout: 3e4,
|
|
469
|
+
progress: null,
|
|
470
|
+
debug: a,
|
|
471
|
+
fetch: {
|
|
472
|
+
requestInit: ge(t?.fetch?.bypassingCache),
|
|
473
|
+
placeholderImage: "data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
|
|
474
|
+
bypassingCache: !1,
|
|
475
|
+
...t?.fetch
|
|
476
|
+
},
|
|
477
|
+
fetchFn: null,
|
|
478
|
+
font: {},
|
|
479
|
+
drawImageInterval: 100,
|
|
480
|
+
workerUrl: null,
|
|
481
|
+
workerNumber: i,
|
|
482
|
+
onCloneEachNode: null,
|
|
483
|
+
onCloneNode: null,
|
|
484
|
+
onEmbedNode: null,
|
|
485
|
+
onCreateForeignObjectSvg: null,
|
|
486
|
+
includeStyleProperties: null,
|
|
487
|
+
autoDestruct: !1,
|
|
488
|
+
...t,
|
|
489
|
+
__CONTEXT__: !0,
|
|
490
|
+
log: he(a),
|
|
491
|
+
node: e,
|
|
492
|
+
ownerDocument: s,
|
|
493
|
+
ownerWindow: c,
|
|
494
|
+
dpi: n === 1 ? null : 96 * n,
|
|
495
|
+
svgStyleElement: ye(s),
|
|
496
|
+
svgDefsElement: s?.createElementNS(q, "defs"),
|
|
497
|
+
svgStyles: /* @__PURE__ */ new Map(),
|
|
498
|
+
defaultComputedStyles: /* @__PURE__ */ new Map(),
|
|
499
|
+
workers: [...Array.from({ length: C && r && i ? i : 0 })].map(() => {
|
|
500
|
+
try {
|
|
501
|
+
let e = new Worker(r);
|
|
502
|
+
return e.onmessage = async (e) => {
|
|
503
|
+
let { url: t, result: n } = e.data;
|
|
504
|
+
n ? l.get(t)?.resolve?.(n) : l.get(t)?.reject?.(/* @__PURE__ */ Error(`Error receiving message from worker: ${t}`));
|
|
505
|
+
}, e.onmessageerror = (e) => {
|
|
506
|
+
let { url: t } = e.data;
|
|
507
|
+
l.get(t)?.reject?.(/* @__PURE__ */ Error(`Error receiving message from worker: ${t}`));
|
|
508
|
+
}, e;
|
|
509
|
+
} catch (e) {
|
|
510
|
+
return u.log.warn("Failed to new Worker", e), null;
|
|
511
|
+
}
|
|
512
|
+
}).filter(Boolean),
|
|
513
|
+
fontFamilies: /* @__PURE__ */ new Map(),
|
|
514
|
+
fontCssTexts: /* @__PURE__ */ new Map(),
|
|
515
|
+
acceptOfImage: `${[
|
|
516
|
+
se(s) && "image/webp",
|
|
517
|
+
"image/svg+xml",
|
|
518
|
+
"image/*",
|
|
519
|
+
"*/*"
|
|
520
|
+
].filter(Boolean).join(",")};q=0.8`,
|
|
521
|
+
requests: l,
|
|
522
|
+
drawImageCount: 0,
|
|
523
|
+
tasks: [],
|
|
524
|
+
features: o,
|
|
525
|
+
isEnable: (e) => e === "restoreScrollPosition" ? typeof o == "boolean" ? !1 : o[e] ?? !1 : typeof o == "boolean" ? o : o[e] ?? !0,
|
|
526
|
+
shadowRoots: []
|
|
527
|
+
};
|
|
528
|
+
u.log.time("wait until load"), await de(e, {
|
|
529
|
+
timeout: u.timeout,
|
|
530
|
+
onWarn: u.log.warn
|
|
531
|
+
}), u.log.timeEnd("wait until load");
|
|
532
|
+
let { width: d, height: f } = be(e, u);
|
|
533
|
+
return u.width = d, u.height = f, u;
|
|
534
|
+
}
|
|
535
|
+
function ye(e) {
|
|
536
|
+
if (!e) return;
|
|
537
|
+
let t = e.createElement("style"), n = t.ownerDocument.createTextNode("\n.______background-clip--text {\n background-clip: text;\n -webkit-background-clip: text;\n}\n");
|
|
538
|
+
return t.appendChild(n), t;
|
|
539
|
+
}
|
|
540
|
+
function be(e, t) {
|
|
541
|
+
let { width: n, height: r } = t;
|
|
542
|
+
if (M(e) && (!n || !r)) {
|
|
543
|
+
let t = e.getBoundingClientRect();
|
|
544
|
+
n = n || t.width || Number(e.getAttribute("width")) || 0, r = r || t.height || Number(e.getAttribute("height")) || 0;
|
|
545
|
+
}
|
|
546
|
+
return {
|
|
547
|
+
width: n,
|
|
548
|
+
height: r
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
async function xe(e, t) {
|
|
552
|
+
let { log: n, timeout: r, drawImageCount: i, drawImageInterval: a } = t;
|
|
553
|
+
n.time("image to canvas");
|
|
554
|
+
let o = await X(e, {
|
|
555
|
+
timeout: r,
|
|
556
|
+
onWarn: t.log.warn
|
|
557
|
+
}), { canvas: s, context2d: c } = Se(e.ownerDocument, t), l = () => {
|
|
558
|
+
try {
|
|
559
|
+
c?.drawImage(o, 0, 0, s.width, s.height);
|
|
560
|
+
} catch (e) {
|
|
561
|
+
t.log.warn("Failed to drawImage", e);
|
|
562
|
+
}
|
|
563
|
+
};
|
|
564
|
+
if (l(), t.isEnable("fixSvgXmlDecode")) for (let e = 0; e < i; e++) await new Promise((t) => {
|
|
565
|
+
setTimeout(() => {
|
|
566
|
+
c?.clearRect(0, 0, s.width, s.height), l(), t();
|
|
567
|
+
}, e + a);
|
|
568
|
+
});
|
|
569
|
+
return t.drawImageCount = 0, n.timeEnd("image to canvas"), s;
|
|
570
|
+
}
|
|
571
|
+
function Se(e, t) {
|
|
572
|
+
let { width: n, height: r, scale: i, backgroundColor: a, maximumCanvasSize: o } = t, s = e.createElement("canvas");
|
|
573
|
+
s.width = Math.floor(n * i), s.height = Math.floor(r * i), s.style.width = `${n}px`, s.style.height = `${r}px`, o && (s.width > o || s.height > o) && (s.width > o && s.height > o ? s.width > s.height ? (s.height *= o / s.width, s.width = o) : (s.width *= o / s.height, s.height = o) : s.width > o ? (s.height *= o / s.width, s.width = o) : (s.width *= o / s.height, s.height = o));
|
|
574
|
+
let c = s.getContext("2d");
|
|
575
|
+
return c && a && (c.fillStyle = a, c.fillRect(0, 0, s.width, s.height)), {
|
|
576
|
+
canvas: s,
|
|
577
|
+
context2d: c
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
function Ce(e, t) {
|
|
581
|
+
if (e.ownerDocument) try {
|
|
582
|
+
let t = e.toDataURL();
|
|
583
|
+
if (t !== "data:,") return Y(t, e.ownerDocument);
|
|
584
|
+
} catch (e) {
|
|
585
|
+
t.log.warn("Failed to clone canvas", e);
|
|
586
|
+
}
|
|
587
|
+
let n = e.cloneNode(!1), r = e.getContext("2d"), i = n.getContext("2d");
|
|
588
|
+
try {
|
|
589
|
+
return r && i && i.putImageData(r.getImageData(0, 0, e.width, e.height), 0, 0), n;
|
|
590
|
+
} catch (e) {
|
|
591
|
+
t.log.warn("Failed to clone canvas", e);
|
|
592
|
+
}
|
|
593
|
+
return n;
|
|
594
|
+
}
|
|
595
|
+
function we(e, t) {
|
|
596
|
+
try {
|
|
597
|
+
if (e?.contentDocument?.documentElement) return We(e.contentDocument.documentElement, t);
|
|
598
|
+
} catch (e) {
|
|
599
|
+
t.log.warn("Failed to clone iframe", e);
|
|
600
|
+
}
|
|
601
|
+
return e.cloneNode(!1);
|
|
602
|
+
}
|
|
603
|
+
function Te(e) {
|
|
604
|
+
let t = e.cloneNode(!1);
|
|
605
|
+
return e.currentSrc && e.currentSrc !== e.src && (t.src = e.currentSrc, t.srcset = ""), t.loading === "lazy" && (t.loading = "eager"), t;
|
|
606
|
+
}
|
|
607
|
+
async function Ee(e, t) {
|
|
608
|
+
if (e.ownerDocument && !e.currentSrc && e.poster) return Y(e.poster, e.ownerDocument);
|
|
609
|
+
let n = e.cloneNode(!1);
|
|
610
|
+
n.crossOrigin = "anonymous", e.currentSrc && e.currentSrc !== e.src && (n.src = e.currentSrc);
|
|
611
|
+
let r = n.ownerDocument;
|
|
612
|
+
if (r) {
|
|
613
|
+
let i = !0;
|
|
614
|
+
if (await X(n, {
|
|
615
|
+
onError: () => i = !1,
|
|
616
|
+
onWarn: t.log.warn
|
|
617
|
+
}), !i) return e.poster ? Y(e.poster, e.ownerDocument) : n;
|
|
618
|
+
n.currentTime = e.currentTime, await new Promise((e) => {
|
|
619
|
+
n.addEventListener("seeked", e, { once: !0 });
|
|
620
|
+
});
|
|
621
|
+
let a = r.createElement("canvas");
|
|
622
|
+
a.width = e.offsetWidth, a.height = e.offsetHeight;
|
|
623
|
+
try {
|
|
624
|
+
let e = a.getContext("2d");
|
|
625
|
+
e && e.drawImage(n, 0, 0, a.width, a.height);
|
|
626
|
+
} catch (r) {
|
|
627
|
+
return t.log.warn("Failed to clone video", r), e.poster ? Y(e.poster, e.ownerDocument) : n;
|
|
628
|
+
}
|
|
629
|
+
return Ce(a, t);
|
|
630
|
+
}
|
|
631
|
+
return n;
|
|
632
|
+
}
|
|
633
|
+
function De(e, t) {
|
|
634
|
+
return re(e) ? Ce(e, t) : U(e) ? we(e, t) : L(e) ? Te(e) : R(e) ? Ee(e, t) : e.cloneNode(!1);
|
|
635
|
+
}
|
|
636
|
+
function Oe(e) {
|
|
637
|
+
let t = e.sandbox;
|
|
638
|
+
if (!t) {
|
|
639
|
+
let { ownerDocument: n } = e;
|
|
640
|
+
try {
|
|
641
|
+
n && (t = n.createElement("iframe"), t.id = `__SANDBOX__${fe()}`, t.width = "0", t.height = "0", t.style.visibility = "hidden", t.style.position = "fixed", n.body.appendChild(t), t.srcdoc = "<!DOCTYPE html><meta charset=\"UTF-8\"><title></title><body>", e.sandbox = t);
|
|
642
|
+
} catch (t) {
|
|
643
|
+
e.log.warn("Failed to getSandBox", t);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
return t;
|
|
647
|
+
}
|
|
648
|
+
var ke = [
|
|
649
|
+
"width",
|
|
650
|
+
"height",
|
|
651
|
+
"-webkit-text-fill-color"
|
|
652
|
+
], Ae = ["stroke", "fill"];
|
|
653
|
+
function je(e, t, n) {
|
|
654
|
+
let { defaultComputedStyles: r } = n, i = e.nodeName.toLowerCase(), a = N(e) && i !== "svg", o = a ? Ae.map((t) => [t, e.getAttribute(t)]).filter(([, e]) => e !== null) : [], s = [
|
|
655
|
+
a && "svg",
|
|
656
|
+
i,
|
|
657
|
+
o.map((e, t) => `${e}=${t}`).join(","),
|
|
658
|
+
t
|
|
659
|
+
].filter(Boolean).join(":");
|
|
660
|
+
if (r.has(s)) return r.get(s);
|
|
661
|
+
let c = Oe(n)?.contentWindow;
|
|
662
|
+
if (!c) return /* @__PURE__ */ new Map();
|
|
663
|
+
let l = c?.document, u, d;
|
|
664
|
+
a ? (u = l.createElementNS(q, "svg"), d = u.ownerDocument.createElementNS(u.namespaceURI, i), o.forEach(([e, t]) => {
|
|
665
|
+
d.setAttributeNS(null, e, t);
|
|
666
|
+
}), u.appendChild(d)) : u = d = l.createElement(i), d.textContent = " ", l.body.appendChild(u);
|
|
667
|
+
let f = c.getComputedStyle(d, t), p = /* @__PURE__ */ new Map();
|
|
668
|
+
for (let e = f.length, t = 0; t < e; t++) {
|
|
669
|
+
let e = f.item(t);
|
|
670
|
+
ke.includes(e) || p.set(e, f.getPropertyValue(e));
|
|
671
|
+
}
|
|
672
|
+
return l.body.removeChild(u), r.set(s, p), p;
|
|
673
|
+
}
|
|
674
|
+
function Me(e, t, n) {
|
|
675
|
+
let r = /* @__PURE__ */ new Map(), i = [], a = /* @__PURE__ */ new Map();
|
|
676
|
+
if (n) for (let e of n) o(e);
|
|
677
|
+
else for (let t = e.length, n = 0; n < t; n++) o(e.item(n));
|
|
678
|
+
for (let e = i.length, t = 0; t < e; t++) a.get(i[t])?.forEach((e, t) => r.set(t, e));
|
|
679
|
+
function o(n) {
|
|
680
|
+
let o = e.getPropertyValue(n), s = e.getPropertyPriority(n), c = n.lastIndexOf("-"), l = c > -1 ? n.substring(0, c) : void 0;
|
|
681
|
+
if (l) {
|
|
682
|
+
let e = a.get(l);
|
|
683
|
+
e || (e = /* @__PURE__ */ new Map(), a.set(l, e)), e.set(n, [o, s]);
|
|
684
|
+
}
|
|
685
|
+
(t.get(n) !== o || s) && (l ? i.push(l) : r.set(n, [o, s]));
|
|
686
|
+
}
|
|
687
|
+
return r;
|
|
688
|
+
}
|
|
689
|
+
function Ne(e, t, n, r) {
|
|
690
|
+
let { ownerWindow: i, includeStyleProperties: a, currentParentNodeStyle: o } = r, s = t.style, c = i.getComputedStyle(e), l = je(e, null, r);
|
|
691
|
+
o?.forEach((e, t) => {
|
|
692
|
+
l.delete(t);
|
|
693
|
+
});
|
|
694
|
+
let u = Me(c, l, a);
|
|
695
|
+
u.delete("transition-property"), u.delete("all"), u.delete("d"), u.delete("content"), n && (u.delete("position"), u.delete("margin-top"), u.delete("margin-right"), u.delete("margin-bottom"), u.delete("margin-left"), u.delete("margin-block-start"), u.delete("margin-block-end"), u.delete("margin-inline-start"), u.delete("margin-inline-end"), u.set("box-sizing", ["border-box", ""])), u.get("background-clip")?.[0] === "text" && t.classList.add("______background-clip--text"), T && (u.has("font-kerning") || u.set("font-kerning", ["normal", ""]), (u.get("overflow-x")?.[0] === "hidden" || u.get("overflow-y")?.[0] === "hidden") && u.get("text-overflow")?.[0] === "ellipsis" && e.scrollWidth === e.clientWidth && u.set("text-overflow", ["clip", ""]));
|
|
696
|
+
for (let e = s.length, t = 0; t < e; t++) s.removeProperty(s.item(t));
|
|
697
|
+
return u.forEach(([e, t], n) => {
|
|
698
|
+
s.setProperty(n, e, t);
|
|
699
|
+
}), u;
|
|
700
|
+
}
|
|
701
|
+
function Pe(e, t) {
|
|
702
|
+
(z(e) || B(e) || ae(e)) && t.setAttribute("value", e.value);
|
|
703
|
+
}
|
|
704
|
+
var Fe = ["::before", "::after"], Ie = [
|
|
705
|
+
"::-webkit-scrollbar",
|
|
706
|
+
"::-webkit-scrollbar-button",
|
|
707
|
+
"::-webkit-scrollbar-thumb",
|
|
708
|
+
"::-webkit-scrollbar-track",
|
|
709
|
+
"::-webkit-scrollbar-track-piece",
|
|
710
|
+
"::-webkit-scrollbar-corner",
|
|
711
|
+
"::-webkit-resizer"
|
|
712
|
+
];
|
|
713
|
+
function Le(e, t, n, r, i) {
|
|
714
|
+
let { ownerWindow: a, svgStyleElement: o, svgStyles: s, currentNodeStyle: c } = r;
|
|
715
|
+
if (!o || !a) return;
|
|
716
|
+
function l(n) {
|
|
717
|
+
let o = a.getComputedStyle(e, n), l = o.getPropertyValue("content");
|
|
718
|
+
if (!l || l === "none") return;
|
|
719
|
+
i?.(l), l = l.replace(/(')|(")|(counter\(.+\))/g, "");
|
|
720
|
+
let u = [fe()], d = je(e, n, r);
|
|
721
|
+
c?.forEach((e, t) => {
|
|
722
|
+
d.delete(t);
|
|
723
|
+
});
|
|
724
|
+
let f = Me(o, d, r.includeStyleProperties);
|
|
725
|
+
f.delete("content"), f.delete("-webkit-locale"), f.get("background-clip")?.[0] === "text" && t.classList.add("______background-clip--text");
|
|
726
|
+
let p = [`content: '${l}';`];
|
|
727
|
+
if (f.forEach(([e, t], n) => {
|
|
728
|
+
p.push(`${n}: ${e}${t ? " !important" : ""};`);
|
|
729
|
+
}), p.length === 1) return;
|
|
730
|
+
try {
|
|
731
|
+
t.className = [t.className, ...u].join(" ");
|
|
732
|
+
} catch (e) {
|
|
733
|
+
r.log.warn("Failed to copyPseudoClass", e);
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
let m = p.join("\n "), h = s.get(m);
|
|
737
|
+
h || (h = [], s.set(m, h)), h.push(`.${u[0]}${n}`);
|
|
738
|
+
}
|
|
739
|
+
Fe.forEach(l), n && Ie.forEach(l);
|
|
740
|
+
}
|
|
741
|
+
var Re = /* @__PURE__ */ new Set(["symbol"]);
|
|
742
|
+
async function ze(e, t, n, r, i) {
|
|
743
|
+
if (M(n) && (ie(n) || V(n)) || r.filter && !r.filter(n)) return;
|
|
744
|
+
r.currentParentNodeStyle = Re.has(t.nodeName) || Re.has(n.nodeName) ? void 0 : r.currentNodeStyle;
|
|
745
|
+
let a = await We(n, r, !1, i);
|
|
746
|
+
r.isEnable("restoreScrollPosition") && Ve(e, a), t.appendChild(a);
|
|
747
|
+
}
|
|
748
|
+
async function Be(e, t, n, r) {
|
|
749
|
+
let i = e.firstChild;
|
|
750
|
+
M(e) && e.shadowRoot && (i = e.shadowRoot?.firstChild, n.shadowRoots.push(e.shadowRoot));
|
|
751
|
+
for (let a = i; a; a = a.nextSibling) if (!te(a)) {
|
|
752
|
+
if (M(a) && H(a) && typeof a.assignedNodes == "function") {
|
|
753
|
+
let i = a.assignedNodes();
|
|
754
|
+
for (let a = 0; a < i.length; a++) await ze(e, t, i[a], n, r);
|
|
755
|
+
} else await ze(e, t, a, n, r);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
function Ve(e, t) {
|
|
759
|
+
if (!I(e) || !I(t)) return;
|
|
760
|
+
let { scrollTop: n, scrollLeft: r } = e;
|
|
761
|
+
if (!n && !r) return;
|
|
762
|
+
let { transform: i } = t.style, a = new DOMMatrix(i), { a: o, b: s, c, d: l } = a;
|
|
763
|
+
a.a = 1, a.b = 0, a.c = 0, a.d = 1, a.translateSelf(-r, -n), a.a = o, a.b = s, a.c = c, a.d = l, t.style.transform = a.toString();
|
|
764
|
+
}
|
|
765
|
+
function He(e, t) {
|
|
766
|
+
let { backgroundColor: n, width: r, height: i, style: a } = t, o = e.style;
|
|
767
|
+
if (n && o.setProperty("background-color", n, "important"), r && o.setProperty("width", `${r}px`, "important"), i && o.setProperty("height", `${i}px`, "important"), a) for (let e in a) o[e] = a[e];
|
|
768
|
+
}
|
|
769
|
+
var Ue = /^[\w-:]+$/;
|
|
770
|
+
async function We(e, t, n = !1, r) {
|
|
771
|
+
let { ownerDocument: i, ownerWindow: a, fontFamilies: o, onCloneEachNode: s } = t;
|
|
772
|
+
if (i && ne(e)) return r && /\S/.test(e.data) && r(e.data), i.createTextNode(e.data);
|
|
773
|
+
if (i && a && M(e) && (I(e) || N(e))) {
|
|
774
|
+
let r = await De(e, t);
|
|
775
|
+
if (t.isEnable("removeAbnormalAttributes")) {
|
|
776
|
+
let e = r.getAttributeNames();
|
|
777
|
+
for (let t = e.length, n = 0; n < t; n++) {
|
|
778
|
+
let t = e[n];
|
|
779
|
+
Ue.test(t) || r.removeAttribute(t);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
let i = t.currentNodeStyle = Ne(e, r, n, t);
|
|
783
|
+
n && He(r, t);
|
|
784
|
+
let a = !1;
|
|
785
|
+
if (t.isEnable("copyScrollbar")) {
|
|
786
|
+
let t = [i.get("overflow-x")?.[0], i.get("overflow-y")?.[0]];
|
|
787
|
+
a = t.includes("scroll") || (t.includes("auto") || t.includes("overlay")) && (e.scrollHeight > e.clientHeight || e.scrollWidth > e.clientWidth);
|
|
788
|
+
}
|
|
789
|
+
let c = i.get("text-transform")?.[0], l = pe(i.get("font-family")?.[0]), u = l ? (e) => {
|
|
790
|
+
c === "uppercase" ? e = e.toUpperCase() : c === "lowercase" ? e = e.toLowerCase() : c === "capitalize" && (e = e[0].toUpperCase() + e.substring(1)), l.forEach((t) => {
|
|
791
|
+
let n = o.get(t);
|
|
792
|
+
n || o.set(t, n = /* @__PURE__ */ new Set()), e.split("").forEach((e) => n.add(e));
|
|
793
|
+
});
|
|
794
|
+
} : void 0;
|
|
795
|
+
return Le(e, r, a, t, u), Pe(e, r), R(e) || await Be(e, r, t, u), await s?.(r), r;
|
|
796
|
+
}
|
|
797
|
+
let c = e.cloneNode(!1);
|
|
798
|
+
return await Be(e, c, t), await s?.(c), c;
|
|
799
|
+
}
|
|
800
|
+
function Ge(e) {
|
|
801
|
+
if (e.ownerDocument = void 0, e.ownerWindow = void 0, e.svgStyleElement = void 0, e.svgDefsElement = void 0, e.svgStyles.clear(), e.defaultComputedStyles.clear(), e.sandbox) {
|
|
802
|
+
try {
|
|
803
|
+
e.sandbox.remove();
|
|
804
|
+
} catch (t) {
|
|
805
|
+
e.log.warn("Failed to destroyContext", t);
|
|
806
|
+
}
|
|
807
|
+
e.sandbox = void 0;
|
|
808
|
+
}
|
|
809
|
+
e.workers = [], e.fontFamilies.clear(), e.fontCssTexts.clear(), e.requests.clear(), e.tasks = [], e.shadowRoots = [];
|
|
810
|
+
}
|
|
811
|
+
function Ke(e) {
|
|
812
|
+
let { url: t, timeout: n, responseType: r, ...i } = e, a = new AbortController(), o = n ? setTimeout(() => a.abort(), n) : void 0;
|
|
813
|
+
return fetch(t, {
|
|
814
|
+
signal: a.signal,
|
|
815
|
+
...i
|
|
816
|
+
}).then((e) => {
|
|
817
|
+
if (!e.ok) throw Error("Failed fetch, not 2xx response", { cause: e });
|
|
818
|
+
switch (r) {
|
|
819
|
+
case "arrayBuffer": return e.arrayBuffer();
|
|
820
|
+
case "dataUrl": return e.blob().then(ue);
|
|
821
|
+
default: return e.text();
|
|
822
|
+
}
|
|
823
|
+
}).finally(() => clearTimeout(o));
|
|
824
|
+
}
|
|
825
|
+
function Z(e, t) {
|
|
826
|
+
let { url: n, requestType: r = "text", responseType: i = "text", imageDom: a } = t, o = n, { timeout: s, acceptOfImage: c, requests: l, fetchFn: u, fetch: { requestInit: d, bypassingCache: f, placeholderImage: p }, font: m, workers: h, fontFamilies: g } = e;
|
|
827
|
+
r === "image" && (E || D) && e.drawImageCount++;
|
|
828
|
+
let _ = l.get(n);
|
|
829
|
+
if (!_) {
|
|
830
|
+
f && f instanceof RegExp && f.test(o) && (o += (/\?/.test(o) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
|
|
831
|
+
let t = r.startsWith("font") && m && m.minify, v = /* @__PURE__ */ new Set();
|
|
832
|
+
t && r.split(";")[1].split(",").forEach((e) => {
|
|
833
|
+
g.has(e) && g.get(e).forEach((e) => v.add(e));
|
|
834
|
+
});
|
|
835
|
+
let y = t && v.size, b = {
|
|
836
|
+
url: o,
|
|
837
|
+
timeout: s,
|
|
838
|
+
responseType: y ? "arrayBuffer" : i,
|
|
839
|
+
headers: r === "image" ? { accept: c } : void 0,
|
|
840
|
+
...d
|
|
841
|
+
};
|
|
842
|
+
_ = {
|
|
843
|
+
type: r,
|
|
844
|
+
resolve: void 0,
|
|
845
|
+
reject: void 0,
|
|
846
|
+
response: null
|
|
847
|
+
}, _.response = (async () => {
|
|
848
|
+
if (u && r === "image") {
|
|
849
|
+
let e = await u(n);
|
|
850
|
+
if (e) return e;
|
|
851
|
+
}
|
|
852
|
+
return !E && n.startsWith("http") && h.length ? new Promise((e, t) => {
|
|
853
|
+
h[l.size & h.length - 1].postMessage({
|
|
854
|
+
rawUrl: n,
|
|
855
|
+
...b
|
|
856
|
+
}), _.resolve = e, _.reject = t;
|
|
857
|
+
}) : Ke(b);
|
|
858
|
+
})().catch((t) => {
|
|
859
|
+
if (l.delete(n), r === "image" && p) return e.log.warn("Failed to fetch image base64, trying to use placeholder image", o), typeof p == "string" ? p : p(a);
|
|
860
|
+
throw t;
|
|
861
|
+
}), l.set(n, _);
|
|
862
|
+
}
|
|
863
|
+
return _.response;
|
|
864
|
+
}
|
|
865
|
+
async function qe(e, t, n, r) {
|
|
866
|
+
if (!Je(e)) return e;
|
|
867
|
+
for (let [i, a] of Xe(e, t)) try {
|
|
868
|
+
let t = await Z(n, {
|
|
869
|
+
url: a,
|
|
870
|
+
requestType: r ? "image" : "text",
|
|
871
|
+
responseType: "dataUrl"
|
|
872
|
+
});
|
|
873
|
+
e = e.replace(Ze(i), `$1${t}$3`);
|
|
874
|
+
} catch (e) {
|
|
875
|
+
n.log.warn("Failed to fetch css data url", i, e);
|
|
876
|
+
}
|
|
877
|
+
return e;
|
|
878
|
+
}
|
|
879
|
+
function Je(e) {
|
|
880
|
+
return /url\((['"]?)([^'"]+?)\1\)/.test(e);
|
|
881
|
+
}
|
|
882
|
+
var Ye = /url\((['"]?)([^'"]+?)\1\)/g;
|
|
883
|
+
function Xe(e, t) {
|
|
884
|
+
let n = [];
|
|
885
|
+
return e.replace(Ye, (e, r, i) => (n.push([i, G(i, t)]), e)), n.filter(([e]) => !W(e));
|
|
886
|
+
}
|
|
887
|
+
function Ze(e) {
|
|
888
|
+
let t = e.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
|
|
889
|
+
return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
|
|
890
|
+
}
|
|
891
|
+
var Qe = [
|
|
892
|
+
"background-image",
|
|
893
|
+
"border-image-source",
|
|
894
|
+
"-webkit-border-image",
|
|
895
|
+
"-webkit-mask-image",
|
|
896
|
+
"list-style-image"
|
|
897
|
+
];
|
|
898
|
+
function $e(e, t) {
|
|
899
|
+
return Qe.map((n) => {
|
|
900
|
+
let r = e.getPropertyValue(n);
|
|
901
|
+
return !r || r === "none" ? null : ((E || D) && t.drawImageCount++, qe(r, null, t, !0).then((t) => {
|
|
902
|
+
t && r !== t && e.setProperty(n, t, e.getPropertyPriority(n));
|
|
903
|
+
}));
|
|
904
|
+
}).filter(Boolean);
|
|
905
|
+
}
|
|
906
|
+
function et(e, t) {
|
|
907
|
+
if (L(e)) {
|
|
908
|
+
let n = e.currentSrc || e.src;
|
|
909
|
+
if (!W(n)) return [Z(t, {
|
|
910
|
+
url: n,
|
|
911
|
+
imageDom: e,
|
|
912
|
+
requestType: "image",
|
|
913
|
+
responseType: "dataUrl"
|
|
914
|
+
}).then((t) => {
|
|
915
|
+
t && (e.srcset = "", e.dataset.originalSrc = n, e.src = t || "");
|
|
916
|
+
})];
|
|
917
|
+
(E || D) && t.drawImageCount++;
|
|
918
|
+
} else if (N(e) && !W(e.href.baseVal)) {
|
|
919
|
+
let n = e.href.baseVal;
|
|
920
|
+
return [Z(t, {
|
|
921
|
+
url: n,
|
|
922
|
+
imageDom: e,
|
|
923
|
+
requestType: "image",
|
|
924
|
+
responseType: "dataUrl"
|
|
925
|
+
}).then((t) => {
|
|
926
|
+
t && (e.dataset.originalSrc = n, e.href.baseVal = t || "");
|
|
927
|
+
})];
|
|
928
|
+
}
|
|
929
|
+
return [];
|
|
930
|
+
}
|
|
931
|
+
function tt(e, t) {
|
|
932
|
+
let { ownerDocument: n, svgDefsElement: r } = t, i = e.getAttribute("href") ?? e.getAttribute("xlink:href");
|
|
933
|
+
if (!i) return [];
|
|
934
|
+
let [a, o] = i.split("#");
|
|
935
|
+
if (o) {
|
|
936
|
+
let i = `#${o}`, s = t.shadowRoots.reduce((e, t) => e ?? t.querySelector(`svg ${i}`), n?.querySelector(`svg ${i}`));
|
|
937
|
+
if (a && e.setAttribute("href", i), r?.querySelector(i)) return [];
|
|
938
|
+
if (s) return r?.appendChild(s.cloneNode(!0)), [];
|
|
939
|
+
if (a) return [Z(t, {
|
|
940
|
+
url: a,
|
|
941
|
+
responseType: "text"
|
|
942
|
+
}).then((e) => {
|
|
943
|
+
r?.insertAdjacentHTML("beforeend", e);
|
|
944
|
+
})];
|
|
945
|
+
}
|
|
946
|
+
return [];
|
|
947
|
+
}
|
|
948
|
+
function nt(e, t) {
|
|
949
|
+
let { tasks: n } = t;
|
|
950
|
+
M(e) && ((L(e) || P(e)) && n.push(...et(e, t)), F(e) && n.push(...tt(e, t))), I(e) && n.push(...$e(e.style, t)), e.childNodes.forEach((e) => {
|
|
951
|
+
nt(e, t);
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
async function rt(e, t) {
|
|
955
|
+
let { ownerDocument: n, svgStyleElement: r, fontFamilies: i, fontCssTexts: a, tasks: o, font: s } = t;
|
|
956
|
+
if (n && r && i.size) {
|
|
957
|
+
if (s && s.cssText) {
|
|
958
|
+
let e = lt(s.cssText, t);
|
|
959
|
+
r.appendChild(n.createTextNode(`${e}
|
|
960
|
+
`));
|
|
961
|
+
} else {
|
|
962
|
+
let e = Array.from(n.styleSheets).filter((e) => {
|
|
963
|
+
try {
|
|
964
|
+
return "cssRules" in e && !!e.cssRules.length;
|
|
965
|
+
} catch (n) {
|
|
966
|
+
return t.log.warn(`Error while reading CSS rules from ${e.href}`, n), !1;
|
|
967
|
+
}
|
|
968
|
+
}), s = n.implementation.createHTMLDocument(""), c = s.createElement("style");
|
|
969
|
+
s.head.appendChild(c);
|
|
970
|
+
let l = c.sheet;
|
|
971
|
+
await Promise.all(e.flatMap((e) => Array.from(e.cssRules).map(async (e) => {
|
|
972
|
+
if (A(e)) {
|
|
973
|
+
let n = e.href, r = "";
|
|
974
|
+
try {
|
|
975
|
+
r = await Z(t, {
|
|
976
|
+
url: n,
|
|
977
|
+
requestType: "text",
|
|
978
|
+
responseType: "text"
|
|
979
|
+
});
|
|
980
|
+
} catch (e) {
|
|
981
|
+
t.log.warn(`Error fetch remote css import from ${n}`, e);
|
|
982
|
+
}
|
|
983
|
+
let i = r.replace(Ye, (e, t, r) => e.replace(r, G(r, n)));
|
|
984
|
+
for (let e of ot(i)) try {
|
|
985
|
+
l.insertRule(e, l.cssRules.length);
|
|
986
|
+
} catch (n) {
|
|
987
|
+
t.log.warn("Error inserting rule from remote css import", {
|
|
988
|
+
rule: e,
|
|
989
|
+
error: n
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
}))), l.cssRules.length && e.push(l);
|
|
994
|
+
let u = [];
|
|
995
|
+
e.forEach((e) => {
|
|
996
|
+
ut(e.cssRules, u);
|
|
997
|
+
}), u.filter((e) => k(e) && Je(e.style.getPropertyValue("src")) && pe(e.style.getPropertyValue("font-family"))?.some((e) => i.has(e))).forEach((e) => {
|
|
998
|
+
let i = e, s = a.get(i.cssText);
|
|
999
|
+
s ? r.appendChild(n.createTextNode(`${s}
|
|
1000
|
+
`)) : o.push(qe(i.cssText, i.parentStyleSheet ? i.parentStyleSheet.href : null, t).then((e) => {
|
|
1001
|
+
e = lt(e, t), a.set(i.cssText, e), r.appendChild(n.createTextNode(`${e}
|
|
1002
|
+
`));
|
|
1003
|
+
}));
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
var it = /(\/\*[\s\S]*?\*\/)/g, at = /((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;
|
|
1009
|
+
function ot(e) {
|
|
1010
|
+
if (e == null) return [];
|
|
1011
|
+
let t = [], n = e.replace(it, "");
|
|
1012
|
+
for (;;) {
|
|
1013
|
+
let e = at.exec(n);
|
|
1014
|
+
if (!e) break;
|
|
1015
|
+
t.push(e[0]);
|
|
1016
|
+
}
|
|
1017
|
+
n = n.replace(at, "");
|
|
1018
|
+
let r = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, i = /* @__PURE__ */ RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", "gi");
|
|
1019
|
+
for (;;) {
|
|
1020
|
+
let e = r.exec(n);
|
|
1021
|
+
if (e) i.lastIndex = r.lastIndex;
|
|
1022
|
+
else if (e = i.exec(n), e) r.lastIndex = i.lastIndex;
|
|
1023
|
+
else break;
|
|
1024
|
+
t.push(e[0]);
|
|
1025
|
+
}
|
|
1026
|
+
return t;
|
|
1027
|
+
}
|
|
1028
|
+
var st = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, ct = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
|
|
1029
|
+
function lt(e, t) {
|
|
1030
|
+
let { font: n } = t, r = n ? n?.preferredFormat : void 0;
|
|
1031
|
+
return r ? e.replace(ct, (e) => {
|
|
1032
|
+
for (;;) {
|
|
1033
|
+
let [t, , n] = st.exec(e) || [];
|
|
1034
|
+
if (!n) return "";
|
|
1035
|
+
if (n === r) return `src: ${t};`;
|
|
1036
|
+
}
|
|
1037
|
+
}) : e;
|
|
1038
|
+
}
|
|
1039
|
+
function ut(e, t = []) {
|
|
1040
|
+
for (let n of Array.from(e)) j(n) ? t.push(...ut(n.cssRules)) : "cssRules" in n ? ut(n.cssRules, t) : t.push(n);
|
|
1041
|
+
return t;
|
|
1042
|
+
}
|
|
1043
|
+
var dt = /\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;
|
|
1044
|
+
function ft(e) {
|
|
1045
|
+
return dt.test(e.innerHTML);
|
|
1046
|
+
}
|
|
1047
|
+
async function pt(e, t) {
|
|
1048
|
+
let n = await _e(e, t);
|
|
1049
|
+
if (M(n.node) && N(n.node) && !ft(n.node)) return n.node;
|
|
1050
|
+
let { ownerDocument: r, log: i, tasks: a, svgStyleElement: o, svgDefsElement: s, svgStyles: c, font: l, progress: u, autoDestruct: d, onCloneNode: f, onEmbedNode: p, onCreateForeignObjectSvg: m } = n;
|
|
1051
|
+
i.time("clone node");
|
|
1052
|
+
let h = await We(n.node, n, !0);
|
|
1053
|
+
if (o && r) {
|
|
1054
|
+
let e = "";
|
|
1055
|
+
c.forEach((t, n) => {
|
|
1056
|
+
e += `${t.join(",\n")} {
|
|
1057
|
+
${n}
|
|
1058
|
+
}
|
|
1059
|
+
`;
|
|
1060
|
+
}), o.appendChild(r.createTextNode(e));
|
|
1061
|
+
}
|
|
1062
|
+
i.timeEnd("clone node"), await f?.(h), l !== !1 && M(h) && (i.time("embed web font"), await rt(h, n), i.timeEnd("embed web font")), i.time("embed node"), nt(h, n);
|
|
1063
|
+
let g = a.length, _ = 0, v = async () => {
|
|
1064
|
+
for (;;) {
|
|
1065
|
+
let e = a.pop();
|
|
1066
|
+
if (!e) break;
|
|
1067
|
+
try {
|
|
1068
|
+
await e;
|
|
1069
|
+
} catch (e) {
|
|
1070
|
+
n.log.warn("Failed to run task", e);
|
|
1071
|
+
}
|
|
1072
|
+
u?.(++_, g);
|
|
1073
|
+
}
|
|
1074
|
+
};
|
|
1075
|
+
u?.(_, g), await Promise.all([...Array.from({ length: 4 })].map(v)), i.timeEnd("embed node"), await p?.(h);
|
|
1076
|
+
let y = mt(h, n);
|
|
1077
|
+
return s && y.insertBefore(s, y.children[0]), o && y.insertBefore(o, y.children[0]), d && Ge(n), await m?.(y), y;
|
|
1078
|
+
}
|
|
1079
|
+
function mt(e, t) {
|
|
1080
|
+
let { width: n, height: r } = t, i = ce(n, r, e.ownerDocument), a = i.ownerDocument.createElementNS(i.namespaceURI, "foreignObject");
|
|
1081
|
+
return a.setAttributeNS(null, "x", "0%"), a.setAttributeNS(null, "y", "0%"), a.setAttributeNS(null, "width", "100%"), a.setAttributeNS(null, "height", "100%"), a.append(e), i.appendChild(a), i;
|
|
1082
|
+
}
|
|
1083
|
+
async function ht(e, t) {
|
|
1084
|
+
let n = await _e(e, t), r = await pt(n), i = J(r, n.isEnable("removeControlCharacter"));
|
|
1085
|
+
return n.autoDestruct || (n.svgStyleElement = ye(n.ownerDocument), n.svgDefsElement = n.ownerDocument?.createElementNS(q, "defs"), n.svgStyles.clear()), await xe(Y(i, r.ownerDocument), n);
|
|
1086
|
+
}
|
|
1087
|
+
// src/editor/mask.ts
|
|
1088
|
+
var gt = "input:not([type=hidden]):not([type=submit]):not([type=button]):not([type=reset]):not([type=image]),textarea,select,[contenteditable]:not([contenteditable=false]),[data-pinax-mask],.pinax-mask";
|
|
1089
|
+
function _t(e) {
|
|
1090
|
+
try {
|
|
1091
|
+
return e.matches(gt);
|
|
1092
|
+
} catch {
|
|
1093
|
+
return !1;
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
function vt(e, t, n) {
|
|
1097
|
+
let r = [];
|
|
1098
|
+
for (let i of e.querySelectorAll(gt)) {
|
|
1099
|
+
if (n?.contains(i)) continue;
|
|
1100
|
+
let e = i.getBoundingClientRect();
|
|
1101
|
+
if (e.width <= 0 || e.height <= 0) continue;
|
|
1102
|
+
let a = Math.max(0, e.left), o = Math.max(0, e.top), s = Math.min(t.w, e.right), c = Math.min(t.h, e.bottom);
|
|
1103
|
+
s <= a || c <= o || r.push({
|
|
1104
|
+
x: a,
|
|
1105
|
+
y: o,
|
|
1106
|
+
w: s - a,
|
|
1107
|
+
h: c - o
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
return r;
|
|
1111
|
+
}
|
|
1112
|
+
function yt(e) {
|
|
1113
|
+
if (e.nodeType !== 1) return;
|
|
1114
|
+
let t = e;
|
|
1115
|
+
if (!_t(t)) return;
|
|
1116
|
+
let n = t.tagName;
|
|
1117
|
+
if (n === "INPUT" || n === "TEXTAREA") {
|
|
1118
|
+
let e = t;
|
|
1119
|
+
try {
|
|
1120
|
+
e.value = "";
|
|
1121
|
+
} catch {}
|
|
1122
|
+
e.removeAttribute("value"), e.removeAttribute("placeholder"), n === "TEXTAREA" && (e.textContent = "");
|
|
1123
|
+
}
|
|
1124
|
+
t.style.setProperty("visibility", "hidden", "important");
|
|
1125
|
+
}
|
|
1126
|
+
function bt(e, t, n) {
|
|
1127
|
+
for (let r of t) {
|
|
1128
|
+
let t = r.x * n, i = r.y * n, a = r.w * n, o = r.h * n;
|
|
1129
|
+
e.save(), e.beginPath(), e.rect(t, i, a, o), e.clip(), e.fillStyle = "#D8DEE9", e.fillRect(t, i, a, o), e.fillStyle = "#C7CFDC";
|
|
1130
|
+
let s = 8 * n;
|
|
1131
|
+
for (let n = t; n < t + a; n += s * 2) e.fillRect(n, i, s, o);
|
|
1132
|
+
e.restore();
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
// src/editor/pii.ts
|
|
1136
|
+
var xt = /^(SCRIPT|STYLE|NOSCRIPT|TEMPLATE|TEXTAREA|OPTION)$/, St = "a[href],button,[role=button],[role=link],summary", Ct = "[autocomplete~=name],[autocomplete~=given-name],[autocomplete~=family-name],[autocomplete~=nickname],[autocomplete~=username],[itemtype*=\"schema.org/Person\"] [itemprop=name]", wt = 2e4;
|
|
1137
|
+
function Q(e, t) {
|
|
1138
|
+
if (!e || t?.contains(e) || xt.test(e.tagName)) return !0;
|
|
1139
|
+
try {
|
|
1140
|
+
return !!e.closest(gt);
|
|
1141
|
+
} catch {
|
|
1142
|
+
return !1;
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
function Tt(e) {
|
|
1146
|
+
let t = e.nodeValue ?? "", n = t.length - t.trimStart().length, r = t.trimEnd().length;
|
|
1147
|
+
return r > n ? {
|
|
1148
|
+
node: e,
|
|
1149
|
+
start: n,
|
|
1150
|
+
end: r,
|
|
1151
|
+
reason: "name"
|
|
1152
|
+
} : null;
|
|
1153
|
+
}
|
|
1154
|
+
function Et(e, t) {
|
|
1155
|
+
let r = e.ownerDocument, i = e.parentElement?.parentElement ?? e.parentElement;
|
|
1156
|
+
if (!i) return null;
|
|
1157
|
+
let a = r.createTreeWalker(i, NodeFilter.SHOW_TEXT);
|
|
1158
|
+
a.currentNode = e;
|
|
1159
|
+
let o = a.nextNode();
|
|
1160
|
+
for (; o && e.contains(o);) o = a.nextNode();
|
|
1161
|
+
for (let e = 0; o && e < 4; e++, o = a.nextNode()) {
|
|
1162
|
+
let e = (o.nodeValue ?? "").trim();
|
|
1163
|
+
if (!e) continue;
|
|
1164
|
+
let r = o.parentElement;
|
|
1165
|
+
return Q(r, t) || r?.closest(St) ? null : n(e) ? o : null;
|
|
1166
|
+
}
|
|
1167
|
+
return null;
|
|
1168
|
+
}
|
|
1169
|
+
function Dt(e, t, n) {
|
|
1170
|
+
let r = e.parentElement;
|
|
1171
|
+
if (!r || r.closest(St) || r.closest("label")) return;
|
|
1172
|
+
let i = r.closest("th");
|
|
1173
|
+
if (i) {
|
|
1174
|
+
let e = i.closest("table"), r = i.cellIndex;
|
|
1175
|
+
if (!e || r < 0) return;
|
|
1176
|
+
for (let a of e.tBodies) for (let e of a.rows) {
|
|
1177
|
+
let a = e.cells[r];
|
|
1178
|
+
a && a !== i && !Q(a, t) && n.push({
|
|
1179
|
+
element: a,
|
|
1180
|
+
reason: "name"
|
|
1181
|
+
});
|
|
1182
|
+
}
|
|
1183
|
+
return;
|
|
1184
|
+
}
|
|
1185
|
+
let a = r.closest("dt");
|
|
1186
|
+
if (a) {
|
|
1187
|
+
let e = a.nextElementSibling;
|
|
1188
|
+
for (; e && e.tagName === "DD";) Q(e, t) || n.push({
|
|
1189
|
+
element: e,
|
|
1190
|
+
reason: "name"
|
|
1191
|
+
}), e = e.nextElementSibling;
|
|
1192
|
+
return;
|
|
1193
|
+
}
|
|
1194
|
+
let o = Et(r, t);
|
|
1195
|
+
if (o) {
|
|
1196
|
+
let e = Tt(o);
|
|
1197
|
+
e && n.push(e);
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
function Ot(e, t = null) {
|
|
1201
|
+
let s = [], c = e.body;
|
|
1202
|
+
if (!c) return s;
|
|
1203
|
+
let l = e.createTreeWalker(c, NodeFilter.SHOW_TEXT), u = 0;
|
|
1204
|
+
for (let e = l.nextNode(); e && u < wt; e = l.nextNode(), u++) {
|
|
1205
|
+
let c = e.nodeValue ?? "";
|
|
1206
|
+
if (c.trim().length < 2 || Q(e.parentElement, t)) continue;
|
|
1207
|
+
for (let t of r(c)) s.push({
|
|
1208
|
+
node: e,
|
|
1209
|
+
start: t.start,
|
|
1210
|
+
end: t.end,
|
|
1211
|
+
reason: t.kind
|
|
1212
|
+
});
|
|
1213
|
+
let l = c.trim(), u = c.length - c.trimStart().length, d = o.exec(l);
|
|
1214
|
+
if (d && n(l.slice(d[0].length))) {
|
|
1215
|
+
s.push({
|
|
1216
|
+
node: e,
|
|
1217
|
+
start: u + d[0].length,
|
|
1218
|
+
end: u + l.length,
|
|
1219
|
+
reason: "name"
|
|
1220
|
+
});
|
|
1221
|
+
continue;
|
|
1222
|
+
}
|
|
1223
|
+
let f = a.exec(c);
|
|
1224
|
+
if (f) {
|
|
1225
|
+
let t = f.index + f[0].length, r = c.slice(t), i = r.search(/[!?|•·\n]|\.(?=\s|$)/), a = (i < 0 ? r : r.slice(0, i)).trimEnd();
|
|
1226
|
+
n(a) && s.push({
|
|
1227
|
+
node: e,
|
|
1228
|
+
start: t,
|
|
1229
|
+
end: t + a.length,
|
|
1230
|
+
reason: "name"
|
|
1231
|
+
});
|
|
1232
|
+
} else i.test(l) && Dt(e, t, s);
|
|
1233
|
+
}
|
|
1234
|
+
for (let n of e.querySelectorAll(Ct)) _t(n) || Q(n, t) || s.push({
|
|
1235
|
+
element: n,
|
|
1236
|
+
reason: "name"
|
|
1237
|
+
});
|
|
1238
|
+
return s;
|
|
1239
|
+
}
|
|
1240
|
+
var $ = 2;
|
|
1241
|
+
function kt(e, t, n = null) {
|
|
1242
|
+
let r = [], i = (e) => {
|
|
1243
|
+
if (e.width <= 0 || e.height <= 0) return;
|
|
1244
|
+
let n = Math.max(0, e.left - $), i = Math.max(0, e.top - $), a = Math.min(t.w, e.right + $), o = Math.min(t.h, e.bottom + $);
|
|
1245
|
+
a <= n || o <= i || r.push({
|
|
1246
|
+
x: n,
|
|
1247
|
+
y: i,
|
|
1248
|
+
w: a - n,
|
|
1249
|
+
h: o - i
|
|
1250
|
+
});
|
|
1251
|
+
}, a = (t) => {
|
|
1252
|
+
if (!t) return !1;
|
|
1253
|
+
let n = t.checkVisibility;
|
|
1254
|
+
return typeof n == "function" ? n.call(t) : e.defaultView?.getComputedStyle(t)?.visibility !== "hidden";
|
|
1255
|
+
};
|
|
1256
|
+
for (let t of Ot(e, n)) try {
|
|
1257
|
+
if ("element" in t) {
|
|
1258
|
+
a(t.element) && i(t.element.getBoundingClientRect());
|
|
1259
|
+
continue;
|
|
1260
|
+
}
|
|
1261
|
+
if (!a(t.node.parentElement)) continue;
|
|
1262
|
+
let n = e.createRange();
|
|
1263
|
+
n.setStart(t.node, t.start), n.setEnd(t.node, t.end);
|
|
1264
|
+
for (let e of n.getClientRects()) i(e);
|
|
1265
|
+
} catch {}
|
|
1266
|
+
return At(r);
|
|
1267
|
+
}
|
|
1268
|
+
function At(e) {
|
|
1269
|
+
return e.filter((t, n) => !e.some((e, r) => r !== n && e.x <= t.x && e.y <= t.y && e.x + e.w >= t.x + t.w && e.y + e.h >= t.y + t.h && (e.w * e.h > t.w * t.h || r < n)));
|
|
1270
|
+
}
|
|
1271
|
+
// src/editor/capture.ts
|
|
1272
|
+
var jt = 2560, Mt = 5e6;
|
|
1273
|
+
function Nt(e, t) {
|
|
1274
|
+
let n = Math.max(1, e.w), r = Math.max(1, e.h);
|
|
1275
|
+
return Math.min(t || 1, 2, jt / Math.max(n, r), Math.sqrt(Mt / (n * r)));
|
|
1276
|
+
}
|
|
1277
|
+
var Pt = "data:image/gif;base64,R0lGODlhAQABAIAAAMfP3AAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==";
|
|
1278
|
+
async function Ft(e, t = window, n = {}) {
|
|
1279
|
+
let r = t.document, i = {
|
|
1280
|
+
w: t.innerWidth,
|
|
1281
|
+
h: t.innerHeight
|
|
1282
|
+
}, a = Nt(i, t.devicePixelRatio), o = vt(r, i, e), s = [];
|
|
1283
|
+
if (n.autoBlur) try {
|
|
1284
|
+
s = kt(r, i, e);
|
|
1285
|
+
} catch {
|
|
1286
|
+
s = [];
|
|
1287
|
+
}
|
|
1288
|
+
let c = r.documentElement, l = t.scrollX, u = t.scrollY, d = t.getComputedStyle(r.body).backgroundColor || t.getComputedStyle(c).backgroundColor, f = await ht(c, {
|
|
1289
|
+
width: i.w,
|
|
1290
|
+
height: i.h,
|
|
1291
|
+
scale: a,
|
|
1292
|
+
backgroundColor: d && d !== "rgba(0, 0, 0, 0)" && d !== "transparent" ? d : "#FFFFFF",
|
|
1293
|
+
filter: (t) => t !== e,
|
|
1294
|
+
onCloneEachNode: (e) => yt(e),
|
|
1295
|
+
style: {
|
|
1296
|
+
transform: `translate(${-l}px, ${-u}px)`,
|
|
1297
|
+
transformOrigin: "0 0"
|
|
1298
|
+
},
|
|
1299
|
+
timeout: 15e3,
|
|
1300
|
+
maximumCanvasSize: jt,
|
|
1301
|
+
fetch: { placeholderImage: Pt }
|
|
1302
|
+
}), p = f.getContext("2d"), m = f.width / i.w;
|
|
1303
|
+
return p && bt(p, [...o, ...s], m), {
|
|
1304
|
+
canvas: f,
|
|
1305
|
+
auto: s.map((e) => ({
|
|
1306
|
+
x: e.x * m,
|
|
1307
|
+
y: e.y * m,
|
|
1308
|
+
w: e.w * m,
|
|
1309
|
+
h: e.h * m
|
|
1310
|
+
}))
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
1313
|
+
// src/editor/encode.ts
|
|
1314
|
+
var It = 1572864;
|
|
1315
|
+
function Lt(e) {
|
|
1316
|
+
return Math.floor((e.length - e.indexOf(",") - 1) * 3 / 4);
|
|
1317
|
+
}
|
|
1318
|
+
function Rt(e, t) {
|
|
1319
|
+
let n = document.createElement("canvas");
|
|
1320
|
+
return n.width = Math.max(1, Math.round(e.width * t)), n.height = Math.max(1, Math.round(e.height * t)), n.getContext("2d")?.drawImage(e, 0, 0, n.width, n.height), n;
|
|
1321
|
+
}
|
|
1322
|
+
function zt(t, n = It) {
|
|
1323
|
+
let r = t, i = "";
|
|
1324
|
+
for (let e = 0; e < 6; e++) {
|
|
1325
|
+
for (let e of [
|
|
1326
|
+
.85,
|
|
1327
|
+
.7,
|
|
1328
|
+
.55
|
|
1329
|
+
]) {
|
|
1330
|
+
let t = r.toDataURL("image/webp", e);
|
|
1331
|
+
if (t.startsWith("data:image/webp") || (t = r.toDataURL("image/jpeg", e)), i = t, Lt(t) <= n) return t;
|
|
1332
|
+
}
|
|
1333
|
+
r = Rt(r, .75);
|
|
1334
|
+
}
|
|
1335
|
+
if (Lt(i) > e.screenshotBytes || i.length > e.screenshotChars) throw Error("Screenshot too large");
|
|
1336
|
+
return i;
|
|
1337
|
+
}
|
|
1338
|
+
// src/editor/index.ts
|
|
1339
|
+
async function Bt(e, t = {}) {
|
|
1340
|
+
let { canvas: n, auto: r } = await Ft(e, window, t), i = {
|
|
1341
|
+
base: n,
|
|
1342
|
+
auto: r
|
|
1343
|
+
};
|
|
1344
|
+
return {
|
|
1345
|
+
dataUrl: zt(n),
|
|
1346
|
+
annotations: [],
|
|
1347
|
+
edit: i,
|
|
1348
|
+
autoBlurred: r.length
|
|
1349
|
+
};
|
|
1350
|
+
}
|
|
1351
|
+
async function Vt(e, t) {
|
|
1352
|
+
let n = t.edit;
|
|
1353
|
+
if (!n?.base) return null;
|
|
1354
|
+
let r = await y(e, n.base, n.state, n.auto);
|
|
1355
|
+
return r ? {
|
|
1356
|
+
dataUrl: zt(r.canvas),
|
|
1357
|
+
annotations: r.annotations,
|
|
1358
|
+
edit: {
|
|
1359
|
+
base: n.base,
|
|
1360
|
+
state: r.state,
|
|
1361
|
+
auto: n.auto
|
|
1362
|
+
},
|
|
1363
|
+
autoBlurred: t.autoBlurred
|
|
1364
|
+
} : null;
|
|
1365
|
+
}
|
|
1366
|
+
export { Vt as markUp, Bt as takeScreenshot };
|
|
1367
|
+
|
|
1368
|
+
//# sourceMappingURL=editor-0Kr31Uly.mjs.map
|