uilint-react 0.2.47 → 0.2.49
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/dist/DevTool.d.ts +1 -2
- package/dist/DevTool.d.ts.map +1 -1
- package/dist/components/ui-lint/index.d.ts +3 -10
- package/dist/components/ui-lint/index.d.ts.map +1 -1
- package/dist/consistency/highlights.d.ts.map +1 -1
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/plugin-system/index.d.ts +7 -0
- package/dist/core/plugin-system/index.d.ts.map +1 -0
- package/dist/core/plugin-system/loader.d.ts +38 -0
- package/dist/core/plugin-system/loader.d.ts.map +1 -0
- package/dist/core/plugin-system/registry.d.ts +130 -0
- package/dist/core/plugin-system/registry.d.ts.map +1 -0
- package/dist/core/plugin-system/types.d.ts +353 -0
- package/dist/core/plugin-system/types.d.ts.map +1 -0
- package/dist/core/services/dom-observer.d.ts +171 -0
- package/dist/core/services/dom-observer.d.ts.map +1 -0
- package/dist/core/services/index.d.ts +6 -0
- package/dist/core/services/index.d.ts.map +1 -0
- package/dist/core/services/websocket.d.ts +112 -0
- package/dist/core/services/websocket.d.ts.map +1 -0
- package/dist/core/store/composed-store.d.ts +212 -0
- package/dist/core/store/composed-store.d.ts.map +1 -0
- package/dist/core/store/core-slice.d.ts +126 -0
- package/dist/core/store/core-slice.d.ts.map +1 -0
- package/dist/core/store/index.d.ts +6 -0
- package/dist/core/store/index.d.ts.map +1 -0
- package/dist/devtools.js +117 -136
- package/dist/devtools.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1675 -12464
- package/dist/index.js.map +1 -1
- package/dist/plugins/eslint/commands.d.ts +6 -0
- package/dist/plugins/eslint/commands.d.ts.map +1 -0
- package/dist/plugins/eslint/index.d.ts +10 -0
- package/dist/plugins/eslint/index.d.ts.map +1 -0
- package/dist/plugins/eslint/slice.d.ts +66 -0
- package/dist/plugins/eslint/slice.d.ts.map +1 -0
- package/dist/plugins/eslint/types.d.ts +128 -0
- package/dist/plugins/eslint/types.d.ts.map +1 -0
- package/dist/plugins/semantic/commands.d.ts +6 -0
- package/dist/plugins/semantic/commands.d.ts.map +1 -0
- package/dist/plugins/semantic/index.d.ts +15 -0
- package/dist/plugins/semantic/index.d.ts.map +1 -0
- package/dist/plugins/semantic/slice.d.ts +52 -0
- package/dist/plugins/semantic/slice.d.ts.map +1 -0
- package/dist/plugins/semantic/types.d.ts +121 -0
- package/dist/plugins/semantic/types.d.ts.map +1 -0
- package/dist/plugins/vision/commands.d.ts +6 -0
- package/dist/plugins/vision/commands.d.ts.map +1 -0
- package/dist/plugins/vision/index.d.ts +12 -0
- package/dist/plugins/vision/index.d.ts.map +1 -0
- package/dist/plugins/vision/slice.d.ts +104 -0
- package/dist/plugins/vision/slice.d.ts.map +1 -0
- package/dist/plugins/vision/types.d.ts +169 -0
- package/dist/plugins/vision/types.d.ts.map +1 -0
- package/dist/scanner/vision-capture.d.ts.map +1 -1
- package/dist/ui/UILint.d.ts +11 -0
- package/dist/ui/UILint.d.ts.map +1 -0
- package/dist/ui/components/CommandPalette/CommandPalette.d.ts +3 -0
- package/dist/ui/components/CommandPalette/CommandPalette.d.ts.map +1 -0
- package/dist/ui/components/CommandPalette/ResultItem.d.ts +9 -0
- package/dist/ui/components/CommandPalette/ResultItem.d.ts.map +1 -0
- package/dist/ui/components/CommandPalette/SearchInput.d.ts +8 -0
- package/dist/ui/components/CommandPalette/SearchInput.d.ts.map +1 -0
- package/dist/ui/components/CommandPalette/index.d.ts +2 -0
- package/dist/ui/components/CommandPalette/index.d.ts.map +1 -0
- package/dist/ui/components/FloatingIcon.d.ts +3 -0
- package/dist/ui/components/FloatingIcon.d.ts.map +1 -0
- package/dist/ui/components/HeatmapOverlay.d.ts.map +1 -0
- package/dist/ui/components/Inspector/ElementDetail.d.ts +8 -0
- package/dist/ui/components/Inspector/ElementDetail.d.ts.map +1 -0
- package/dist/ui/components/Inspector/InspectorSidebar.d.ts +3 -0
- package/dist/ui/components/Inspector/InspectorSidebar.d.ts.map +1 -0
- package/dist/ui/components/Inspector/IssueDetail.d.ts +7 -0
- package/dist/ui/components/Inspector/IssueDetail.d.ts.map +1 -0
- package/dist/ui/components/Inspector/index.d.ts +2 -0
- package/dist/ui/components/Inspector/index.d.ts.map +1 -0
- package/dist/ui/hooks/index.d.ts +4 -0
- package/dist/ui/hooks/index.d.ts.map +1 -0
- package/dist/ui/hooks/useElementRects.d.ts +12 -0
- package/dist/ui/hooks/useElementRects.d.ts.map +1 -0
- package/dist/ui/hooks/useIssues.d.ts +17 -0
- package/dist/ui/hooks/useIssues.d.ts.map +1 -0
- package/dist/ui/hooks/useKeyboardShortcuts.d.ts +8 -0
- package/dist/ui/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/dist/ui/icons.d.ts +20 -0
- package/dist/ui/icons.d.ts.map +1 -0
- package/dist/ui/index.d.ts +16 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/types.d.ts +69 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/package.json +3 -3
- package/dist/components/ui-lint/FloatingIcon.d.ts +0 -3
- package/dist/components/ui-lint/FloatingIcon.d.ts.map +0 -1
- package/dist/components/ui-lint/HeatmapOverlay.d.ts.map +0 -1
- package/dist/components/ui-lint/IndexingIndicator.d.ts +0 -3
- package/dist/components/ui-lint/IndexingIndicator.d.ts.map +0 -1
- package/dist/components/ui-lint/RegionSelector.d.ts +0 -18
- package/dist/components/ui-lint/RegionSelector.d.ts.map +0 -1
- package/dist/components/ui-lint/ScreenshotViewer.d.ts +0 -11
- package/dist/components/ui-lint/ScreenshotViewer.d.ts.map +0 -1
- package/dist/components/ui-lint/UILintUI.d.ts +0 -5
- package/dist/components/ui-lint/UILintUI.d.ts.map +0 -1
- package/dist/components/ui-lint/VisionIssuesPanel.d.ts +0 -12
- package/dist/components/ui-lint/VisionIssuesPanel.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/CategorySidebar.d.ts +0 -29
- package/dist/components/ui-lint/command-palette/CategorySidebar.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/CommandPalette.d.ts +0 -7
- package/dist/components/ui-lint/command-palette/CommandPalette.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/CommandPaletteInput.d.ts +0 -18
- package/dist/components/ui-lint/command-palette/CommandPaletteInput.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/CommandPaletteItem.d.ts +0 -26
- package/dist/components/ui-lint/command-palette/CommandPaletteItem.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/CommandPaletteResults.d.ts +0 -46
- package/dist/components/ui-lint/command-palette/CommandPaletteResults.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/FilterChips.d.ts +0 -11
- package/dist/components/ui-lint/command-palette/FilterChips.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/RuleDetailItem.d.ts +0 -15
- package/dist/components/ui-lint/command-palette/RuleDetailItem.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/RuleEditor.d.ts +0 -22
- package/dist/components/ui-lint/command-palette/RuleEditor.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/RuleToggleItem.d.ts +0 -20
- package/dist/components/ui-lint/command-palette/RuleToggleItem.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/SourceCodePreview.d.ts +0 -17
- package/dist/components/ui-lint/command-palette/SourceCodePreview.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/icons.d.ts +0 -39
- package/dist/components/ui-lint/command-palette/icons.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/index.d.ts +0 -13
- package/dist/components/ui-lint/command-palette/index.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/types.d.ts +0 -160
- package/dist/components/ui-lint/command-palette/types.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/use-fuzzy-search.d.ts +0 -19
- package/dist/components/ui-lint/command-palette/use-fuzzy-search.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/use-keyboard-navigation.d.ts +0 -10
- package/dist/components/ui-lint/command-palette/use-keyboard-navigation.d.ts.map +0 -1
- package/dist/components/ui-lint/hooks/index.d.ts +0 -4
- package/dist/components/ui-lint/hooks/index.d.ts.map +0 -1
- package/dist/components/ui-lint/hooks/useAutoScans.d.ts +0 -5
- package/dist/components/ui-lint/hooks/useAutoScans.d.ts.map +0 -1
- package/dist/components/ui-lint/hooks/useDevToolEventHandlers.d.ts +0 -5
- package/dist/components/ui-lint/hooks/useDevToolEventHandlers.d.ts.map +0 -1
- package/dist/components/ui-lint/hooks/useNavigationDetection.d.ts +0 -6
- package/dist/components/ui-lint/hooks/useNavigationDetection.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/ElementInspector.d.ts +0 -9
- package/dist/components/ui-lint/inspector/ElementInspector.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/FixesInspector.d.ts +0 -6
- package/dist/components/ui-lint/inspector/FixesInspector.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/FullFileViewer.d.ts +0 -17
- package/dist/components/ui-lint/inspector/FullFileViewer.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/InspectorSidebar.d.ts +0 -12
- package/dist/components/ui-lint/inspector/InspectorSidebar.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/IssueInspector.d.ts +0 -12
- package/dist/components/ui-lint/inspector/IssueInspector.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/MarkdownRenderer.d.ts +0 -11
- package/dist/components/ui-lint/inspector/MarkdownRenderer.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/ResizeHandle.d.ts +0 -19
- package/dist/components/ui-lint/inspector/ResizeHandle.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/RuleInspector.d.ts +0 -10
- package/dist/components/ui-lint/inspector/RuleInspector.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/index.d.ts +0 -8
- package/dist/components/ui-lint/inspector/index.d.ts.map +0 -1
- package/dist/components/ui-lint/portal-host.d.ts +0 -3
- package/dist/components/ui-lint/portal-host.d.ts.map +0 -1
- package/dist/components/ui-lint/store.d.ts +0 -431
- package/dist/components/ui-lint/store.d.ts.map +0 -1
- package/dist/components/ui-lint/useDOMObserver.d.ts +0 -11
- package/dist/components/ui-lint/useDOMObserver.d.ts.map +0 -1
- package/dist/index-L3Zm-CoX.js +0 -513
- package/dist/index-L3Zm-CoX.js.map +0 -1
- package/dist/vision-capture-8mhdjw77.js +0 -235
- package/dist/vision-capture-8mhdjw77.js.map +0 -1
- /package/dist/{components/ui-lint → ui/components}/HeatmapOverlay.d.ts +0 -0
package/dist/index-L3Zm-CoX.js
DELETED
|
@@ -1,513 +0,0 @@
|
|
|
1
|
-
function B(t, e) {
|
|
2
|
-
if (t.match(/^[a-z]+:\/\//i))
|
|
3
|
-
return t;
|
|
4
|
-
if (t.match(/^\/\//))
|
|
5
|
-
return window.location.protocol + t;
|
|
6
|
-
if (t.match(/^[a-z]+:/i))
|
|
7
|
-
return t;
|
|
8
|
-
const n = document.implementation.createHTMLDocument(), r = n.createElement("base"), s = n.createElement("a");
|
|
9
|
-
return n.head.appendChild(r), n.body.appendChild(s), e && (r.href = e), s.href = t, s.href;
|
|
10
|
-
}
|
|
11
|
-
const j = /* @__PURE__ */ (() => {
|
|
12
|
-
let t = 0;
|
|
13
|
-
const e = () => (
|
|
14
|
-
// eslint-disable-next-line no-bitwise
|
|
15
|
-
`0000${(Math.random() * 36 ** 4 << 0).toString(36)}`.slice(-4)
|
|
16
|
-
);
|
|
17
|
-
return () => (t += 1, `u${e()}${t}`);
|
|
18
|
-
})();
|
|
19
|
-
function m(t) {
|
|
20
|
-
const e = [];
|
|
21
|
-
for (let n = 0, r = t.length; n < r; n++)
|
|
22
|
-
e.push(t[n]);
|
|
23
|
-
return e;
|
|
24
|
-
}
|
|
25
|
-
let g = null;
|
|
26
|
-
function v(t = {}) {
|
|
27
|
-
return g || (t.includeStyleProperties ? (g = t.includeStyleProperties, g) : (g = m(window.getComputedStyle(document.documentElement)), g));
|
|
28
|
-
}
|
|
29
|
-
function y(t, e) {
|
|
30
|
-
const r = (t.ownerDocument.defaultView || window).getComputedStyle(t).getPropertyValue(e);
|
|
31
|
-
return r ? parseFloat(r.replace("px", "")) : 0;
|
|
32
|
-
}
|
|
33
|
-
function z(t) {
|
|
34
|
-
const e = y(t, "border-left-width"), n = y(t, "border-right-width");
|
|
35
|
-
return t.clientWidth + e + n;
|
|
36
|
-
}
|
|
37
|
-
function G(t) {
|
|
38
|
-
const e = y(t, "border-top-width"), n = y(t, "border-bottom-width");
|
|
39
|
-
return t.clientHeight + e + n;
|
|
40
|
-
}
|
|
41
|
-
function R(t, e = {}) {
|
|
42
|
-
const n = e.width || z(t), r = e.height || G(t);
|
|
43
|
-
return { width: n, height: r };
|
|
44
|
-
}
|
|
45
|
-
function X() {
|
|
46
|
-
let t, e;
|
|
47
|
-
try {
|
|
48
|
-
e = process;
|
|
49
|
-
} catch {
|
|
50
|
-
}
|
|
51
|
-
const n = e && e.env ? e.env.devicePixelRatio : null;
|
|
52
|
-
return n && (t = parseInt(n, 10), Number.isNaN(t) && (t = 1)), t || window.devicePixelRatio || 1;
|
|
53
|
-
}
|
|
54
|
-
const u = 16384;
|
|
55
|
-
function J(t) {
|
|
56
|
-
(t.width > u || t.height > u) && (t.width > u && t.height > u ? t.width > t.height ? (t.height *= u / t.width, t.width = u) : (t.width *= u / t.height, t.height = u) : t.width > u ? (t.height *= u / t.width, t.width = u) : (t.width *= u / t.height, t.height = u));
|
|
57
|
-
}
|
|
58
|
-
function K(t, e = {}) {
|
|
59
|
-
return t.toBlob ? new Promise((n) => {
|
|
60
|
-
t.toBlob(n, e.type ? e.type : "image/png", e.quality ? e.quality : 1);
|
|
61
|
-
}) : new Promise((n) => {
|
|
62
|
-
const r = window.atob(t.toDataURL(e.type ? e.type : void 0, e.quality ? e.quality : void 0).split(",")[1]), s = r.length, i = new Uint8Array(s);
|
|
63
|
-
for (let a = 0; a < s; a += 1)
|
|
64
|
-
i[a] = r.charCodeAt(a);
|
|
65
|
-
n(new Blob([i], {
|
|
66
|
-
type: e.type ? e.type : "image/png"
|
|
67
|
-
}));
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
function w(t) {
|
|
71
|
-
return new Promise((e, n) => {
|
|
72
|
-
const r = new Image();
|
|
73
|
-
r.onload = () => {
|
|
74
|
-
r.decode().then(() => {
|
|
75
|
-
requestAnimationFrame(() => e(r));
|
|
76
|
-
});
|
|
77
|
-
}, r.onerror = n, r.crossOrigin = "anonymous", r.decoding = "async", r.src = t;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
async function Q(t) {
|
|
81
|
-
return Promise.resolve().then(() => new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then((e) => `data:image/svg+xml;charset=utf-8,${e}`);
|
|
82
|
-
}
|
|
83
|
-
async function Y(t, e, n) {
|
|
84
|
-
const r = "http://www.w3.org/2000/svg", s = document.createElementNS(r, "svg"), i = document.createElementNS(r, "foreignObject");
|
|
85
|
-
return s.setAttribute("width", `${e}`), s.setAttribute("height", `${n}`), s.setAttribute("viewBox", `0 0 ${e} ${n}`), i.setAttribute("width", "100%"), i.setAttribute("height", "100%"), i.setAttribute("x", "0"), i.setAttribute("y", "0"), i.setAttribute("externalResourcesRequired", "true"), s.appendChild(i), i.appendChild(t), Q(s);
|
|
86
|
-
}
|
|
87
|
-
const l = (t, e) => {
|
|
88
|
-
if (t instanceof e)
|
|
89
|
-
return !0;
|
|
90
|
-
const n = Object.getPrototypeOf(t);
|
|
91
|
-
return n === null ? !1 : n.constructor.name === e.name || l(n, e);
|
|
92
|
-
};
|
|
93
|
-
function Z(t) {
|
|
94
|
-
const e = t.getPropertyValue("content");
|
|
95
|
-
return `${t.cssText} content: '${e.replace(/'|"/g, "")}';`;
|
|
96
|
-
}
|
|
97
|
-
function N(t, e) {
|
|
98
|
-
return v(e).map((n) => {
|
|
99
|
-
const r = t.getPropertyValue(n), s = t.getPropertyPriority(n);
|
|
100
|
-
return `${n}: ${r}${s ? " !important" : ""};`;
|
|
101
|
-
}).join(" ");
|
|
102
|
-
}
|
|
103
|
-
function tt(t, e, n, r) {
|
|
104
|
-
const s = `.${t}:${e}`, i = n.cssText ? Z(n) : N(n, r);
|
|
105
|
-
return document.createTextNode(`${s}{${i}}`);
|
|
106
|
-
}
|
|
107
|
-
function $(t, e, n, r) {
|
|
108
|
-
const s = window.getComputedStyle(t, n), i = s.getPropertyValue("content");
|
|
109
|
-
if (i === "" || i === "none")
|
|
110
|
-
return;
|
|
111
|
-
const a = j();
|
|
112
|
-
try {
|
|
113
|
-
e.className = `${e.className} ${a}`;
|
|
114
|
-
} catch {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
const c = document.createElement("style");
|
|
118
|
-
c.appendChild(tt(a, n, s, r)), e.appendChild(c);
|
|
119
|
-
}
|
|
120
|
-
function et(t, e, n) {
|
|
121
|
-
$(t, e, ":before", n), $(t, e, ":after", n);
|
|
122
|
-
}
|
|
123
|
-
const T = "application/font-woff", L = "image/jpeg", nt = {
|
|
124
|
-
woff: T,
|
|
125
|
-
woff2: T,
|
|
126
|
-
ttf: "application/font-truetype",
|
|
127
|
-
eot: "application/vnd.ms-fontobject",
|
|
128
|
-
png: "image/png",
|
|
129
|
-
jpg: L,
|
|
130
|
-
jpeg: L,
|
|
131
|
-
gif: "image/gif",
|
|
132
|
-
tiff: "image/tiff",
|
|
133
|
-
svg: "image/svg+xml",
|
|
134
|
-
webp: "image/webp"
|
|
135
|
-
};
|
|
136
|
-
function rt(t) {
|
|
137
|
-
const e = /\.([^./]*?)$/g.exec(t);
|
|
138
|
-
return e ? e[1] : "";
|
|
139
|
-
}
|
|
140
|
-
function C(t) {
|
|
141
|
-
const e = rt(t).toLowerCase();
|
|
142
|
-
return nt[e] || "";
|
|
143
|
-
}
|
|
144
|
-
function it(t) {
|
|
145
|
-
return t.split(/,/)[1];
|
|
146
|
-
}
|
|
147
|
-
function x(t) {
|
|
148
|
-
return t.search(/^(data:)/) !== -1;
|
|
149
|
-
}
|
|
150
|
-
function st(t, e) {
|
|
151
|
-
return `data:${e};base64,${t}`;
|
|
152
|
-
}
|
|
153
|
-
async function U(t, e, n) {
|
|
154
|
-
const r = await fetch(t, e);
|
|
155
|
-
if (r.status === 404)
|
|
156
|
-
throw new Error(`Resource "${r.url}" not found`);
|
|
157
|
-
const s = await r.blob();
|
|
158
|
-
return new Promise((i, a) => {
|
|
159
|
-
const c = new FileReader();
|
|
160
|
-
c.onerror = a, c.onloadend = () => {
|
|
161
|
-
try {
|
|
162
|
-
i(n({ res: r, result: c.result }));
|
|
163
|
-
} catch (o) {
|
|
164
|
-
a(o);
|
|
165
|
-
}
|
|
166
|
-
}, c.readAsDataURL(s);
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
const E = {};
|
|
170
|
-
function at(t, e, n) {
|
|
171
|
-
let r = t.replace(/\?.*/, "");
|
|
172
|
-
return n && (r = t), /ttf|otf|eot|woff2?/i.test(r) && (r = r.replace(/.*\//, "")), e ? `[${e}]${r}` : r;
|
|
173
|
-
}
|
|
174
|
-
async function P(t, e, n) {
|
|
175
|
-
const r = at(t, e, n.includeQueryParams);
|
|
176
|
-
if (E[r] != null)
|
|
177
|
-
return E[r];
|
|
178
|
-
n.cacheBust && (t += (/\?/.test(t) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
|
|
179
|
-
let s;
|
|
180
|
-
try {
|
|
181
|
-
const i = await U(t, n.fetchRequestInit, ({ res: a, result: c }) => (e || (e = a.headers.get("Content-Type") || ""), it(c)));
|
|
182
|
-
s = st(i, e);
|
|
183
|
-
} catch (i) {
|
|
184
|
-
s = n.imagePlaceholder || "";
|
|
185
|
-
let a = `Failed to fetch resource: ${t}`;
|
|
186
|
-
i && (a = typeof i == "string" ? i : i.message), a && console.warn(a);
|
|
187
|
-
}
|
|
188
|
-
return E[r] = s, s;
|
|
189
|
-
}
|
|
190
|
-
async function ct(t) {
|
|
191
|
-
const e = t.toDataURL();
|
|
192
|
-
return e === "data:," ? t.cloneNode(!1) : w(e);
|
|
193
|
-
}
|
|
194
|
-
async function ot(t, e) {
|
|
195
|
-
if (t.currentSrc) {
|
|
196
|
-
const i = document.createElement("canvas"), a = i.getContext("2d");
|
|
197
|
-
i.width = t.clientWidth, i.height = t.clientHeight, a?.drawImage(t, 0, 0, i.width, i.height);
|
|
198
|
-
const c = i.toDataURL();
|
|
199
|
-
return w(c);
|
|
200
|
-
}
|
|
201
|
-
const n = t.poster, r = C(n), s = await P(n, r, e);
|
|
202
|
-
return w(s);
|
|
203
|
-
}
|
|
204
|
-
async function lt(t, e) {
|
|
205
|
-
var n;
|
|
206
|
-
try {
|
|
207
|
-
if (!((n = t?.contentDocument) === null || n === void 0) && n.body)
|
|
208
|
-
return await p(t.contentDocument.body, e, !0);
|
|
209
|
-
} catch {
|
|
210
|
-
}
|
|
211
|
-
return t.cloneNode(!1);
|
|
212
|
-
}
|
|
213
|
-
async function ut(t, e) {
|
|
214
|
-
return l(t, HTMLCanvasElement) ? ct(t) : l(t, HTMLVideoElement) ? ot(t, e) : l(t, HTMLIFrameElement) ? lt(t, e) : t.cloneNode(k(t));
|
|
215
|
-
}
|
|
216
|
-
const ft = (t) => t.tagName != null && t.tagName.toUpperCase() === "SLOT", k = (t) => t.tagName != null && t.tagName.toUpperCase() === "SVG";
|
|
217
|
-
async function ht(t, e, n) {
|
|
218
|
-
var r, s;
|
|
219
|
-
if (k(e))
|
|
220
|
-
return e;
|
|
221
|
-
let i = [];
|
|
222
|
-
return ft(t) && t.assignedNodes ? i = m(t.assignedNodes()) : l(t, HTMLIFrameElement) && (!((r = t.contentDocument) === null || r === void 0) && r.body) ? i = m(t.contentDocument.body.childNodes) : i = m(((s = t.shadowRoot) !== null && s !== void 0 ? s : t).childNodes), i.length === 0 || l(t, HTMLVideoElement) || await i.reduce((a, c) => a.then(() => p(c, n)).then((o) => {
|
|
223
|
-
o && e.appendChild(o);
|
|
224
|
-
}), Promise.resolve()), e;
|
|
225
|
-
}
|
|
226
|
-
function mt(t, e, n) {
|
|
227
|
-
const r = e.style;
|
|
228
|
-
if (!r)
|
|
229
|
-
return;
|
|
230
|
-
const s = window.getComputedStyle(t);
|
|
231
|
-
s.cssText ? (r.cssText = s.cssText, r.transformOrigin = s.transformOrigin) : v(n).forEach((i) => {
|
|
232
|
-
let a = s.getPropertyValue(i);
|
|
233
|
-
i === "font-size" && a.endsWith("px") && (a = `${Math.floor(parseFloat(a.substring(0, a.length - 2))) - 0.1}px`), l(t, HTMLIFrameElement) && i === "display" && a === "inline" && (a = "block"), i === "d" && e.getAttribute("d") && (a = `path(${e.getAttribute("d")})`), r.setProperty(i, a, s.getPropertyPriority(i));
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
function gt(t, e) {
|
|
237
|
-
l(t, HTMLTextAreaElement) && (e.innerHTML = t.value), l(t, HTMLInputElement) && e.setAttribute("value", t.value);
|
|
238
|
-
}
|
|
239
|
-
function dt(t, e) {
|
|
240
|
-
if (l(t, HTMLSelectElement)) {
|
|
241
|
-
const r = Array.from(e.children).find((s) => t.value === s.getAttribute("value"));
|
|
242
|
-
r && r.setAttribute("selected", "");
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
function yt(t, e, n) {
|
|
246
|
-
return l(e, Element) && (mt(t, e, n), et(t, e, n), gt(t, e), dt(t, e)), e;
|
|
247
|
-
}
|
|
248
|
-
async function wt(t, e) {
|
|
249
|
-
const n = t.querySelectorAll ? t.querySelectorAll("use") : [];
|
|
250
|
-
if (n.length === 0)
|
|
251
|
-
return t;
|
|
252
|
-
const r = {};
|
|
253
|
-
for (let i = 0; i < n.length; i++) {
|
|
254
|
-
const c = n[i].getAttribute("xlink:href");
|
|
255
|
-
if (c) {
|
|
256
|
-
const o = t.querySelector(c), f = document.querySelector(c);
|
|
257
|
-
!o && f && !r[c] && (r[c] = await p(f, e, !0));
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
const s = Object.values(r);
|
|
261
|
-
if (s.length) {
|
|
262
|
-
const i = "http://www.w3.org/1999/xhtml", a = document.createElementNS(i, "svg");
|
|
263
|
-
a.setAttribute("xmlns", i), a.style.position = "absolute", a.style.width = "0", a.style.height = "0", a.style.overflow = "hidden", a.style.display = "none";
|
|
264
|
-
const c = document.createElementNS(i, "defs");
|
|
265
|
-
a.appendChild(c);
|
|
266
|
-
for (let o = 0; o < s.length; o++)
|
|
267
|
-
c.appendChild(s[o]);
|
|
268
|
-
t.appendChild(a);
|
|
269
|
-
}
|
|
270
|
-
return t;
|
|
271
|
-
}
|
|
272
|
-
async function p(t, e, n) {
|
|
273
|
-
return !n && e.filter && !e.filter(t) ? null : Promise.resolve(t).then((r) => ut(r, e)).then((r) => ht(t, r, e)).then((r) => yt(t, r, e)).then((r) => wt(r, e));
|
|
274
|
-
}
|
|
275
|
-
const H = /url\((['"]?)([^'"]+?)\1\)/g, pt = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, St = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
|
|
276
|
-
function bt(t) {
|
|
277
|
-
const e = t.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
|
|
278
|
-
return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`, "g");
|
|
279
|
-
}
|
|
280
|
-
function Et(t) {
|
|
281
|
-
const e = [];
|
|
282
|
-
return t.replace(H, (n, r, s) => (e.push(s), n)), e.filter((n) => !x(n));
|
|
283
|
-
}
|
|
284
|
-
async function xt(t, e, n, r, s) {
|
|
285
|
-
try {
|
|
286
|
-
const i = n ? B(e, n) : e, a = C(e);
|
|
287
|
-
let c;
|
|
288
|
-
return s || (c = await P(i, a, r)), t.replace(bt(e), `$1${c}$3`);
|
|
289
|
-
} catch {
|
|
290
|
-
}
|
|
291
|
-
return t;
|
|
292
|
-
}
|
|
293
|
-
function Rt(t, { preferredFontFormat: e }) {
|
|
294
|
-
return e ? t.replace(St, (n) => {
|
|
295
|
-
for (; ; ) {
|
|
296
|
-
const [r, , s] = pt.exec(n) || [];
|
|
297
|
-
if (!s)
|
|
298
|
-
return "";
|
|
299
|
-
if (s === e)
|
|
300
|
-
return `src: ${r};`;
|
|
301
|
-
}
|
|
302
|
-
}) : t;
|
|
303
|
-
}
|
|
304
|
-
function V(t) {
|
|
305
|
-
return t.search(H) !== -1;
|
|
306
|
-
}
|
|
307
|
-
async function M(t, e, n) {
|
|
308
|
-
if (!V(t))
|
|
309
|
-
return t;
|
|
310
|
-
const r = Rt(t, n);
|
|
311
|
-
return Et(r).reduce((i, a) => i.then((c) => xt(c, a, e, n)), Promise.resolve(r));
|
|
312
|
-
}
|
|
313
|
-
async function d(t, e, n) {
|
|
314
|
-
var r;
|
|
315
|
-
const s = (r = e.style) === null || r === void 0 ? void 0 : r.getPropertyValue(t);
|
|
316
|
-
if (s) {
|
|
317
|
-
const i = await M(s, null, n);
|
|
318
|
-
return e.style.setProperty(t, i, e.style.getPropertyPriority(t)), !0;
|
|
319
|
-
}
|
|
320
|
-
return !1;
|
|
321
|
-
}
|
|
322
|
-
async function Ct(t, e) {
|
|
323
|
-
await d("background", t, e) || await d("background-image", t, e), await d("mask", t, e) || await d("-webkit-mask", t, e) || await d("mask-image", t, e) || await d("-webkit-mask-image", t, e);
|
|
324
|
-
}
|
|
325
|
-
async function Pt(t, e) {
|
|
326
|
-
const n = l(t, HTMLImageElement);
|
|
327
|
-
if (!(n && !x(t.src)) && !(l(t, SVGImageElement) && !x(t.href.baseVal)))
|
|
328
|
-
return;
|
|
329
|
-
const r = n ? t.src : t.href.baseVal, s = await P(r, C(r), e);
|
|
330
|
-
await new Promise((i, a) => {
|
|
331
|
-
t.onload = i, t.onerror = e.onImageErrorHandler ? (...o) => {
|
|
332
|
-
try {
|
|
333
|
-
i(e.onImageErrorHandler(...o));
|
|
334
|
-
} catch (f) {
|
|
335
|
-
a(f);
|
|
336
|
-
}
|
|
337
|
-
} : a;
|
|
338
|
-
const c = t;
|
|
339
|
-
c.decode && (c.decode = i), c.loading === "lazy" && (c.loading = "eager"), n ? (t.srcset = "", t.src = s) : t.href.baseVal = s;
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
async function $t(t, e) {
|
|
343
|
-
const r = m(t.childNodes).map((s) => O(s, e));
|
|
344
|
-
await Promise.all(r).then(() => t);
|
|
345
|
-
}
|
|
346
|
-
async function O(t, e) {
|
|
347
|
-
l(t, Element) && (await Ct(t, e), await Pt(t, e), await $t(t, e));
|
|
348
|
-
}
|
|
349
|
-
function Tt(t, e) {
|
|
350
|
-
const { style: n } = t;
|
|
351
|
-
e.backgroundColor && (n.backgroundColor = e.backgroundColor), e.width && (n.width = `${e.width}px`), e.height && (n.height = `${e.height}px`);
|
|
352
|
-
const r = e.style;
|
|
353
|
-
return r != null && Object.keys(r).forEach((s) => {
|
|
354
|
-
n[s] = r[s];
|
|
355
|
-
}), t;
|
|
356
|
-
}
|
|
357
|
-
const F = {};
|
|
358
|
-
async function I(t) {
|
|
359
|
-
let e = F[t];
|
|
360
|
-
if (e != null)
|
|
361
|
-
return e;
|
|
362
|
-
const r = await (await fetch(t)).text();
|
|
363
|
-
return e = { url: t, cssText: r }, F[t] = e, e;
|
|
364
|
-
}
|
|
365
|
-
async function A(t, e) {
|
|
366
|
-
let n = t.cssText;
|
|
367
|
-
const r = /url\(["']?([^"')]+)["']?\)/g, i = (n.match(/url\([^)]+\)/g) || []).map(async (a) => {
|
|
368
|
-
let c = a.replace(r, "$1");
|
|
369
|
-
return c.startsWith("https://") || (c = new URL(c, t.url).href), U(c, e.fetchRequestInit, ({ result: o }) => (n = n.replace(a, `url(${o})`), [a, o]));
|
|
370
|
-
});
|
|
371
|
-
return Promise.all(i).then(() => n);
|
|
372
|
-
}
|
|
373
|
-
function D(t) {
|
|
374
|
-
if (t == null)
|
|
375
|
-
return [];
|
|
376
|
-
const e = [], n = /(\/\*[\s\S]*?\*\/)/gi;
|
|
377
|
-
let r = t.replace(n, "");
|
|
378
|
-
const s = new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
|
|
379
|
-
for (; ; ) {
|
|
380
|
-
const o = s.exec(r);
|
|
381
|
-
if (o === null)
|
|
382
|
-
break;
|
|
383
|
-
e.push(o[0]);
|
|
384
|
-
}
|
|
385
|
-
r = r.replace(s, "");
|
|
386
|
-
const i = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, a = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", c = new RegExp(a, "gi");
|
|
387
|
-
for (; ; ) {
|
|
388
|
-
let o = i.exec(r);
|
|
389
|
-
if (o === null) {
|
|
390
|
-
if (o = c.exec(r), o === null)
|
|
391
|
-
break;
|
|
392
|
-
i.lastIndex = c.lastIndex;
|
|
393
|
-
} else
|
|
394
|
-
c.lastIndex = i.lastIndex;
|
|
395
|
-
e.push(o[0]);
|
|
396
|
-
}
|
|
397
|
-
return e;
|
|
398
|
-
}
|
|
399
|
-
async function Lt(t, e) {
|
|
400
|
-
const n = [], r = [];
|
|
401
|
-
return t.forEach((s) => {
|
|
402
|
-
if ("cssRules" in s)
|
|
403
|
-
try {
|
|
404
|
-
m(s.cssRules || []).forEach((i, a) => {
|
|
405
|
-
if (i.type === CSSRule.IMPORT_RULE) {
|
|
406
|
-
let c = a + 1;
|
|
407
|
-
const o = i.href, f = I(o).then((h) => A(h, e)).then((h) => D(h).forEach((b) => {
|
|
408
|
-
try {
|
|
409
|
-
s.insertRule(b, b.startsWith("@import") ? c += 1 : s.cssRules.length);
|
|
410
|
-
} catch (W) {
|
|
411
|
-
console.error("Error inserting rule from remote css", {
|
|
412
|
-
rule: b,
|
|
413
|
-
error: W
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
})).catch((h) => {
|
|
417
|
-
console.error("Error loading remote css", h.toString());
|
|
418
|
-
});
|
|
419
|
-
r.push(f);
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
} catch (i) {
|
|
423
|
-
const a = t.find((c) => c.href == null) || document.styleSheets[0];
|
|
424
|
-
s.href != null && r.push(I(s.href).then((c) => A(c, e)).then((c) => D(c).forEach((o) => {
|
|
425
|
-
a.insertRule(o, a.cssRules.length);
|
|
426
|
-
})).catch((c) => {
|
|
427
|
-
console.error("Error loading remote stylesheet", c);
|
|
428
|
-
})), console.error("Error inlining remote css file", i);
|
|
429
|
-
}
|
|
430
|
-
}), Promise.all(r).then(() => (t.forEach((s) => {
|
|
431
|
-
if ("cssRules" in s)
|
|
432
|
-
try {
|
|
433
|
-
m(s.cssRules || []).forEach((i) => {
|
|
434
|
-
n.push(i);
|
|
435
|
-
});
|
|
436
|
-
} catch (i) {
|
|
437
|
-
console.error(`Error while reading CSS rules from ${s.href}`, i);
|
|
438
|
-
}
|
|
439
|
-
}), n));
|
|
440
|
-
}
|
|
441
|
-
function Ft(t) {
|
|
442
|
-
return t.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => V(e.style.getPropertyValue("src")));
|
|
443
|
-
}
|
|
444
|
-
async function It(t, e) {
|
|
445
|
-
if (t.ownerDocument == null)
|
|
446
|
-
throw new Error("Provided element is not within a Document");
|
|
447
|
-
const n = m(t.ownerDocument.styleSheets), r = await Lt(n, e);
|
|
448
|
-
return Ft(r);
|
|
449
|
-
}
|
|
450
|
-
function _(t) {
|
|
451
|
-
return t.trim().replace(/["']/g, "");
|
|
452
|
-
}
|
|
453
|
-
function At(t) {
|
|
454
|
-
const e = /* @__PURE__ */ new Set();
|
|
455
|
-
function n(r) {
|
|
456
|
-
(r.style.fontFamily || getComputedStyle(r).fontFamily).split(",").forEach((i) => {
|
|
457
|
-
e.add(_(i));
|
|
458
|
-
}), Array.from(r.children).forEach((i) => {
|
|
459
|
-
i instanceof HTMLElement && n(i);
|
|
460
|
-
});
|
|
461
|
-
}
|
|
462
|
-
return n(t), e;
|
|
463
|
-
}
|
|
464
|
-
async function q(t, e) {
|
|
465
|
-
const n = await It(t, e), r = At(t);
|
|
466
|
-
return (await Promise.all(n.filter((i) => r.has(_(i.style.fontFamily))).map((i) => {
|
|
467
|
-
const a = i.parentStyleSheet ? i.parentStyleSheet.href : null;
|
|
468
|
-
return M(i.cssText, a, e);
|
|
469
|
-
}))).join(`
|
|
470
|
-
`);
|
|
471
|
-
}
|
|
472
|
-
async function Dt(t, e) {
|
|
473
|
-
const n = e.fontEmbedCSS != null ? e.fontEmbedCSS : e.skipFonts ? null : await q(t, e);
|
|
474
|
-
if (n) {
|
|
475
|
-
const r = document.createElement("style"), s = document.createTextNode(n);
|
|
476
|
-
r.appendChild(s), t.firstChild ? t.insertBefore(r, t.firstChild) : t.appendChild(r);
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
async function vt(t, e = {}) {
|
|
480
|
-
const { width: n, height: r } = R(t, e), s = await p(t, e, !0);
|
|
481
|
-
return await Dt(s, e), await O(s, e), Tt(s, e), await Y(s, n, r);
|
|
482
|
-
}
|
|
483
|
-
async function S(t, e = {}) {
|
|
484
|
-
const { width: n, height: r } = R(t, e), s = await vt(t, e), i = await w(s), a = document.createElement("canvas"), c = a.getContext("2d"), o = e.pixelRatio || X(), f = e.canvasWidth || n, h = e.canvasHeight || r;
|
|
485
|
-
return a.width = f * o, a.height = h * o, e.skipAutoScale || J(a), a.style.width = `${f}`, a.style.height = `${h}`, e.backgroundColor && (c.fillStyle = e.backgroundColor, c.fillRect(0, 0, a.width, a.height)), c.drawImage(i, 0, 0, a.width, a.height), a;
|
|
486
|
-
}
|
|
487
|
-
async function Ut(t, e = {}) {
|
|
488
|
-
const { width: n, height: r } = R(t, e);
|
|
489
|
-
return (await S(t, e)).getContext("2d").getImageData(0, 0, n, r).data;
|
|
490
|
-
}
|
|
491
|
-
async function kt(t, e = {}) {
|
|
492
|
-
return (await S(t, e)).toDataURL();
|
|
493
|
-
}
|
|
494
|
-
async function Ht(t, e = {}) {
|
|
495
|
-
return (await S(t, e)).toDataURL("image/jpeg", e.quality || 1);
|
|
496
|
-
}
|
|
497
|
-
async function Vt(t, e = {}) {
|
|
498
|
-
const n = await S(t, e);
|
|
499
|
-
return await K(n);
|
|
500
|
-
}
|
|
501
|
-
async function Mt(t, e = {}) {
|
|
502
|
-
return q(t, e);
|
|
503
|
-
}
|
|
504
|
-
export {
|
|
505
|
-
Mt as getFontEmbedCSS,
|
|
506
|
-
Vt as toBlob,
|
|
507
|
-
S as toCanvas,
|
|
508
|
-
Ht as toJpeg,
|
|
509
|
-
Ut as toPixelData,
|
|
510
|
-
kt as toPng,
|
|
511
|
-
vt as toSvg
|
|
512
|
-
};
|
|
513
|
-
//# sourceMappingURL=index-L3Zm-CoX.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-L3Zm-CoX.js","sources":["../../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/util.js","../../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/clone-pseudos.js","../../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/mimes.js","../../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/dataurl.js","../../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/clone-node.js","../../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-resources.js","../../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-images.js","../../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/apply-style.js","../../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-webfonts.js","../../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/index.js"],"sourcesContent":["export function resolveUrl(url, baseUrl) {\n // url is absolute already\n if (url.match(/^[a-z]+:\\/\\//i)) {\n return url;\n }\n // url is absolute already, without protocol\n if (url.match(/^\\/\\//)) {\n return window.location.protocol + url;\n }\n // dataURI, mailto:, tel:, etc.\n if (url.match(/^[a-z]+:/i)) {\n return url;\n }\n const doc = document.implementation.createHTMLDocument();\n const base = doc.createElement('base');\n const a = doc.createElement('a');\n doc.head.appendChild(base);\n doc.body.appendChild(a);\n if (baseUrl) {\n base.href = baseUrl;\n }\n a.href = url;\n return a.href;\n}\nexport const uuid = (() => {\n // generate uuid for className of pseudo elements.\n // We should not use GUIDs, otherwise pseudo elements sometimes cannot be captured.\n let counter = 0;\n // ref: http://stackoverflow.com/a/6248722/2519373\n const random = () => \n // eslint-disable-next-line no-bitwise\n `0000${((Math.random() * 36 ** 4) << 0).toString(36)}`.slice(-4);\n return () => {\n counter += 1;\n return `u${random()}${counter}`;\n };\n})();\nexport function delay(ms) {\n return (args) => new Promise((resolve) => {\n setTimeout(() => resolve(args), ms);\n });\n}\nexport function toArray(arrayLike) {\n const arr = [];\n for (let i = 0, l = arrayLike.length; i < l; i++) {\n arr.push(arrayLike[i]);\n }\n return arr;\n}\nlet styleProps = null;\nexport function getStyleProperties(options = {}) {\n if (styleProps) {\n return styleProps;\n }\n if (options.includeStyleProperties) {\n styleProps = options.includeStyleProperties;\n return styleProps;\n }\n styleProps = toArray(window.getComputedStyle(document.documentElement));\n return styleProps;\n}\nfunction px(node, styleProperty) {\n const win = node.ownerDocument.defaultView || window;\n const val = win.getComputedStyle(node).getPropertyValue(styleProperty);\n return val ? parseFloat(val.replace('px', '')) : 0;\n}\nfunction getNodeWidth(node) {\n const leftBorder = px(node, 'border-left-width');\n const rightBorder = px(node, 'border-right-width');\n return node.clientWidth + leftBorder + rightBorder;\n}\nfunction getNodeHeight(node) {\n const topBorder = px(node, 'border-top-width');\n const bottomBorder = px(node, 'border-bottom-width');\n return node.clientHeight + topBorder + bottomBorder;\n}\nexport function getImageSize(targetNode, options = {}) {\n const width = options.width || getNodeWidth(targetNode);\n const height = options.height || getNodeHeight(targetNode);\n return { width, height };\n}\nexport function getPixelRatio() {\n let ratio;\n let FINAL_PROCESS;\n try {\n FINAL_PROCESS = process;\n }\n catch (e) {\n // pass\n }\n const val = FINAL_PROCESS && FINAL_PROCESS.env\n ? FINAL_PROCESS.env.devicePixelRatio\n : null;\n if (val) {\n ratio = parseInt(val, 10);\n if (Number.isNaN(ratio)) {\n ratio = 1;\n }\n }\n return ratio || window.devicePixelRatio || 1;\n}\n// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#maximum_canvas_size\nconst canvasDimensionLimit = 16384;\nexport function checkCanvasDimensions(canvas) {\n if (canvas.width > canvasDimensionLimit ||\n canvas.height > canvasDimensionLimit) {\n if (canvas.width > canvasDimensionLimit &&\n canvas.height > canvasDimensionLimit) {\n if (canvas.width > canvas.height) {\n canvas.height *= canvasDimensionLimit / canvas.width;\n canvas.width = canvasDimensionLimit;\n }\n else {\n canvas.width *= canvasDimensionLimit / canvas.height;\n canvas.height = canvasDimensionLimit;\n }\n }\n else if (canvas.width > canvasDimensionLimit) {\n canvas.height *= canvasDimensionLimit / canvas.width;\n canvas.width = canvasDimensionLimit;\n }\n else {\n canvas.width *= canvasDimensionLimit / canvas.height;\n canvas.height = canvasDimensionLimit;\n }\n }\n}\nexport function canvasToBlob(canvas, options = {}) {\n if (canvas.toBlob) {\n return new Promise((resolve) => {\n canvas.toBlob(resolve, options.type ? options.type : 'image/png', options.quality ? options.quality : 1);\n });\n }\n return new Promise((resolve) => {\n const binaryString = window.atob(canvas\n .toDataURL(options.type ? options.type : undefined, options.quality ? options.quality : undefined)\n .split(',')[1]);\n const len = binaryString.length;\n const binaryArray = new Uint8Array(len);\n for (let i = 0; i < len; i += 1) {\n binaryArray[i] = binaryString.charCodeAt(i);\n }\n resolve(new Blob([binaryArray], {\n type: options.type ? options.type : 'image/png',\n }));\n });\n}\nexport function createImage(url) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => {\n img.decode().then(() => {\n requestAnimationFrame(() => resolve(img));\n });\n };\n img.onerror = reject;\n img.crossOrigin = 'anonymous';\n img.decoding = 'async';\n img.src = url;\n });\n}\nexport async function svgToDataURL(svg) {\n return Promise.resolve()\n .then(() => new XMLSerializer().serializeToString(svg))\n .then(encodeURIComponent)\n .then((html) => `data:image/svg+xml;charset=utf-8,${html}`);\n}\nexport async function nodeToDataURL(node, width, height) {\n const xmlns = 'http://www.w3.org/2000/svg';\n const svg = document.createElementNS(xmlns, 'svg');\n const foreignObject = document.createElementNS(xmlns, 'foreignObject');\n svg.setAttribute('width', `${width}`);\n svg.setAttribute('height', `${height}`);\n svg.setAttribute('viewBox', `0 0 ${width} ${height}`);\n foreignObject.setAttribute('width', '100%');\n foreignObject.setAttribute('height', '100%');\n foreignObject.setAttribute('x', '0');\n foreignObject.setAttribute('y', '0');\n foreignObject.setAttribute('externalResourcesRequired', 'true');\n svg.appendChild(foreignObject);\n foreignObject.appendChild(node);\n return svgToDataURL(svg);\n}\nexport const isInstanceOfElement = (node, instance) => {\n if (node instanceof instance)\n return true;\n const nodePrototype = Object.getPrototypeOf(node);\n if (nodePrototype === null)\n return false;\n return (nodePrototype.constructor.name === instance.name ||\n isInstanceOfElement(nodePrototype, instance));\n};\n//# sourceMappingURL=util.js.map","import { uuid, getStyleProperties } from './util';\nfunction formatCSSText(style) {\n const content = style.getPropertyValue('content');\n return `${style.cssText} content: '${content.replace(/'|\"/g, '')}';`;\n}\nfunction formatCSSProperties(style, options) {\n return getStyleProperties(options)\n .map((name) => {\n const value = style.getPropertyValue(name);\n const priority = style.getPropertyPriority(name);\n return `${name}: ${value}${priority ? ' !important' : ''};`;\n })\n .join(' ');\n}\nfunction getPseudoElementStyle(className, pseudo, style, options) {\n const selector = `.${className}:${pseudo}`;\n const cssText = style.cssText\n ? formatCSSText(style)\n : formatCSSProperties(style, options);\n return document.createTextNode(`${selector}{${cssText}}`);\n}\nfunction clonePseudoElement(nativeNode, clonedNode, pseudo, options) {\n const style = window.getComputedStyle(nativeNode, pseudo);\n const content = style.getPropertyValue('content');\n if (content === '' || content === 'none') {\n return;\n }\n const className = uuid();\n try {\n clonedNode.className = `${clonedNode.className} ${className}`;\n }\n catch (err) {\n return;\n }\n const styleElement = document.createElement('style');\n styleElement.appendChild(getPseudoElementStyle(className, pseudo, style, options));\n clonedNode.appendChild(styleElement);\n}\nexport function clonePseudoElements(nativeNode, clonedNode, options) {\n clonePseudoElement(nativeNode, clonedNode, ':before', options);\n clonePseudoElement(nativeNode, clonedNode, ':after', options);\n}\n//# sourceMappingURL=clone-pseudos.js.map","const WOFF = 'application/font-woff';\nconst JPEG = 'image/jpeg';\nconst mimes = {\n woff: WOFF,\n woff2: WOFF,\n ttf: 'application/font-truetype',\n eot: 'application/vnd.ms-fontobject',\n png: 'image/png',\n jpg: JPEG,\n jpeg: JPEG,\n gif: 'image/gif',\n tiff: 'image/tiff',\n svg: 'image/svg+xml',\n webp: 'image/webp',\n};\nfunction getExtension(url) {\n const match = /\\.([^./]*?)$/g.exec(url);\n return match ? match[1] : '';\n}\nexport function getMimeType(url) {\n const extension = getExtension(url).toLowerCase();\n return mimes[extension] || '';\n}\n//# sourceMappingURL=mimes.js.map","function getContentFromDataUrl(dataURL) {\n return dataURL.split(/,/)[1];\n}\nexport function isDataUrl(url) {\n return url.search(/^(data:)/) !== -1;\n}\nexport function makeDataUrl(content, mimeType) {\n return `data:${mimeType};base64,${content}`;\n}\nexport async function fetchAsDataURL(url, init, process) {\n const res = await fetch(url, init);\n if (res.status === 404) {\n throw new Error(`Resource \"${res.url}\" not found`);\n }\n const blob = await res.blob();\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = reject;\n reader.onloadend = () => {\n try {\n resolve(process({ res, result: reader.result }));\n }\n catch (error) {\n reject(error);\n }\n };\n reader.readAsDataURL(blob);\n });\n}\nconst cache = {};\nfunction getCacheKey(url, contentType, includeQueryParams) {\n let key = url.replace(/\\?.*/, '');\n if (includeQueryParams) {\n key = url;\n }\n // font resource\n if (/ttf|otf|eot|woff2?/i.test(key)) {\n key = key.replace(/.*\\//, '');\n }\n return contentType ? `[${contentType}]${key}` : key;\n}\nexport async function resourceToDataURL(resourceUrl, contentType, options) {\n const cacheKey = getCacheKey(resourceUrl, contentType, options.includeQueryParams);\n if (cache[cacheKey] != null) {\n return cache[cacheKey];\n }\n // ref: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache\n if (options.cacheBust) {\n // eslint-disable-next-line no-param-reassign\n resourceUrl += (/\\?/.test(resourceUrl) ? '&' : '?') + new Date().getTime();\n }\n let dataURL;\n try {\n const content = await fetchAsDataURL(resourceUrl, options.fetchRequestInit, ({ res, result }) => {\n if (!contentType) {\n // eslint-disable-next-line no-param-reassign\n contentType = res.headers.get('Content-Type') || '';\n }\n return getContentFromDataUrl(result);\n });\n dataURL = makeDataUrl(content, contentType);\n }\n catch (error) {\n dataURL = options.imagePlaceholder || '';\n let msg = `Failed to fetch resource: ${resourceUrl}`;\n if (error) {\n msg = typeof error === 'string' ? error : error.message;\n }\n if (msg) {\n console.warn(msg);\n }\n }\n cache[cacheKey] = dataURL;\n return dataURL;\n}\n//# sourceMappingURL=dataurl.js.map","import { clonePseudoElements } from './clone-pseudos';\nimport { createImage, toArray, isInstanceOfElement, getStyleProperties, } from './util';\nimport { getMimeType } from './mimes';\nimport { resourceToDataURL } from './dataurl';\nasync function cloneCanvasElement(canvas) {\n const dataURL = canvas.toDataURL();\n if (dataURL === 'data:,') {\n return canvas.cloneNode(false);\n }\n return createImage(dataURL);\n}\nasync function cloneVideoElement(video, options) {\n if (video.currentSrc) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n canvas.width = video.clientWidth;\n canvas.height = video.clientHeight;\n ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);\n const dataURL = canvas.toDataURL();\n return createImage(dataURL);\n }\n const poster = video.poster;\n const contentType = getMimeType(poster);\n const dataURL = await resourceToDataURL(poster, contentType, options);\n return createImage(dataURL);\n}\nasync function cloneIFrameElement(iframe, options) {\n var _a;\n try {\n if ((_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentDocument) === null || _a === void 0 ? void 0 : _a.body) {\n return (await cloneNode(iframe.contentDocument.body, options, true));\n }\n }\n catch (_b) {\n // Failed to clone iframe\n }\n return iframe.cloneNode(false);\n}\nasync function cloneSingleNode(node, options) {\n if (isInstanceOfElement(node, HTMLCanvasElement)) {\n return cloneCanvasElement(node);\n }\n if (isInstanceOfElement(node, HTMLVideoElement)) {\n return cloneVideoElement(node, options);\n }\n if (isInstanceOfElement(node, HTMLIFrameElement)) {\n return cloneIFrameElement(node, options);\n }\n return node.cloneNode(isSVGElement(node));\n}\nconst isSlotElement = (node) => node.tagName != null && node.tagName.toUpperCase() === 'SLOT';\nconst isSVGElement = (node) => node.tagName != null && node.tagName.toUpperCase() === 'SVG';\nasync function cloneChildren(nativeNode, clonedNode, options) {\n var _a, _b;\n if (isSVGElement(clonedNode)) {\n return clonedNode;\n }\n let children = [];\n if (isSlotElement(nativeNode) && nativeNode.assignedNodes) {\n children = toArray(nativeNode.assignedNodes());\n }\n else if (isInstanceOfElement(nativeNode, HTMLIFrameElement) &&\n ((_a = nativeNode.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) {\n children = toArray(nativeNode.contentDocument.body.childNodes);\n }\n else {\n children = toArray(((_b = nativeNode.shadowRoot) !== null && _b !== void 0 ? _b : nativeNode).childNodes);\n }\n if (children.length === 0 ||\n isInstanceOfElement(nativeNode, HTMLVideoElement)) {\n return clonedNode;\n }\n await children.reduce((deferred, child) => deferred\n .then(() => cloneNode(child, options))\n .then((clonedChild) => {\n if (clonedChild) {\n clonedNode.appendChild(clonedChild);\n }\n }), Promise.resolve());\n return clonedNode;\n}\nfunction cloneCSSStyle(nativeNode, clonedNode, options) {\n const targetStyle = clonedNode.style;\n if (!targetStyle) {\n return;\n }\n const sourceStyle = window.getComputedStyle(nativeNode);\n if (sourceStyle.cssText) {\n targetStyle.cssText = sourceStyle.cssText;\n targetStyle.transformOrigin = sourceStyle.transformOrigin;\n }\n else {\n getStyleProperties(options).forEach((name) => {\n let value = sourceStyle.getPropertyValue(name);\n if (name === 'font-size' && value.endsWith('px')) {\n const reducedFont = Math.floor(parseFloat(value.substring(0, value.length - 2))) - 0.1;\n value = `${reducedFont}px`;\n }\n if (isInstanceOfElement(nativeNode, HTMLIFrameElement) &&\n name === 'display' &&\n value === 'inline') {\n value = 'block';\n }\n if (name === 'd' && clonedNode.getAttribute('d')) {\n value = `path(${clonedNode.getAttribute('d')})`;\n }\n targetStyle.setProperty(name, value, sourceStyle.getPropertyPriority(name));\n });\n }\n}\nfunction cloneInputValue(nativeNode, clonedNode) {\n if (isInstanceOfElement(nativeNode, HTMLTextAreaElement)) {\n clonedNode.innerHTML = nativeNode.value;\n }\n if (isInstanceOfElement(nativeNode, HTMLInputElement)) {\n clonedNode.setAttribute('value', nativeNode.value);\n }\n}\nfunction cloneSelectValue(nativeNode, clonedNode) {\n if (isInstanceOfElement(nativeNode, HTMLSelectElement)) {\n const clonedSelect = clonedNode;\n const selectedOption = Array.from(clonedSelect.children).find((child) => nativeNode.value === child.getAttribute('value'));\n if (selectedOption) {\n selectedOption.setAttribute('selected', '');\n }\n }\n}\nfunction decorate(nativeNode, clonedNode, options) {\n if (isInstanceOfElement(clonedNode, Element)) {\n cloneCSSStyle(nativeNode, clonedNode, options);\n clonePseudoElements(nativeNode, clonedNode, options);\n cloneInputValue(nativeNode, clonedNode);\n cloneSelectValue(nativeNode, clonedNode);\n }\n return clonedNode;\n}\nasync function ensureSVGSymbols(clone, options) {\n const uses = clone.querySelectorAll ? clone.querySelectorAll('use') : [];\n if (uses.length === 0) {\n return clone;\n }\n const processedDefs = {};\n for (let i = 0; i < uses.length; i++) {\n const use = uses[i];\n const id = use.getAttribute('xlink:href');\n if (id) {\n const exist = clone.querySelector(id);\n const definition = document.querySelector(id);\n if (!exist && definition && !processedDefs[id]) {\n // eslint-disable-next-line no-await-in-loop\n processedDefs[id] = (await cloneNode(definition, options, true));\n }\n }\n }\n const nodes = Object.values(processedDefs);\n if (nodes.length) {\n const ns = 'http://www.w3.org/1999/xhtml';\n const svg = document.createElementNS(ns, 'svg');\n svg.setAttribute('xmlns', ns);\n svg.style.position = 'absolute';\n svg.style.width = '0';\n svg.style.height = '0';\n svg.style.overflow = 'hidden';\n svg.style.display = 'none';\n const defs = document.createElementNS(ns, 'defs');\n svg.appendChild(defs);\n for (let i = 0; i < nodes.length; i++) {\n defs.appendChild(nodes[i]);\n }\n clone.appendChild(svg);\n }\n return clone;\n}\nexport async function cloneNode(node, options, isRoot) {\n if (!isRoot && options.filter && !options.filter(node)) {\n return null;\n }\n return Promise.resolve(node)\n .then((clonedNode) => cloneSingleNode(clonedNode, options))\n .then((clonedNode) => cloneChildren(node, clonedNode, options))\n .then((clonedNode) => decorate(node, clonedNode, options))\n .then((clonedNode) => ensureSVGSymbols(clonedNode, options));\n}\n//# sourceMappingURL=clone-node.js.map","import { resolveUrl } from './util';\nimport { getMimeType } from './mimes';\nimport { isDataUrl, makeDataUrl, resourceToDataURL } from './dataurl';\nconst URL_REGEX = /url\\((['\"]?)([^'\"]+?)\\1\\)/g;\nconst URL_WITH_FORMAT_REGEX = /url\\([^)]+\\)\\s*format\\(([\"']?)([^\"']+)\\1\\)/g;\nconst FONT_SRC_REGEX = /src:\\s*(?:url\\([^)]+\\)\\s*format\\([^)]+\\)[,;]\\s*)+/g;\nfunction toRegex(url) {\n // eslint-disable-next-line no-useless-escape\n const escaped = url.replace(/([.*+?^${}()|\\[\\]\\/\\\\])/g, '\\\\$1');\n return new RegExp(`(url\\\\(['\"]?)(${escaped})(['\"]?\\\\))`, 'g');\n}\nexport function parseURLs(cssText) {\n const urls = [];\n cssText.replace(URL_REGEX, (raw, quotation, url) => {\n urls.push(url);\n return raw;\n });\n return urls.filter((url) => !isDataUrl(url));\n}\nexport async function embed(cssText, resourceURL, baseURL, options, getContentFromUrl) {\n try {\n const resolvedURL = baseURL ? resolveUrl(resourceURL, baseURL) : resourceURL;\n const contentType = getMimeType(resourceURL);\n let dataURL;\n if (getContentFromUrl) {\n const content = await getContentFromUrl(resolvedURL);\n dataURL = makeDataUrl(content, contentType);\n }\n else {\n dataURL = await resourceToDataURL(resolvedURL, contentType, options);\n }\n return cssText.replace(toRegex(resourceURL), `$1${dataURL}$3`);\n }\n catch (error) {\n // pass\n }\n return cssText;\n}\nfunction filterPreferredFontFormat(str, { preferredFontFormat }) {\n return !preferredFontFormat\n ? str\n : str.replace(FONT_SRC_REGEX, (match) => {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const [src, , format] = URL_WITH_FORMAT_REGEX.exec(match) || [];\n if (!format) {\n return '';\n }\n if (format === preferredFontFormat) {\n return `src: ${src};`;\n }\n }\n });\n}\nexport function shouldEmbed(url) {\n return url.search(URL_REGEX) !== -1;\n}\nexport async function embedResources(cssText, baseUrl, options) {\n if (!shouldEmbed(cssText)) {\n return cssText;\n }\n const filteredCSSText = filterPreferredFontFormat(cssText, options);\n const urls = parseURLs(filteredCSSText);\n return urls.reduce((deferred, url) => deferred.then((css) => embed(css, url, baseUrl, options)), Promise.resolve(filteredCSSText));\n}\n//# sourceMappingURL=embed-resources.js.map","import { embedResources } from './embed-resources';\nimport { toArray, isInstanceOfElement } from './util';\nimport { isDataUrl, resourceToDataURL } from './dataurl';\nimport { getMimeType } from './mimes';\nasync function embedProp(propName, node, options) {\n var _a;\n const propValue = (_a = node.style) === null || _a === void 0 ? void 0 : _a.getPropertyValue(propName);\n if (propValue) {\n const cssString = await embedResources(propValue, null, options);\n node.style.setProperty(propName, cssString, node.style.getPropertyPriority(propName));\n return true;\n }\n return false;\n}\nasync function embedBackground(clonedNode, options) {\n ;\n (await embedProp('background', clonedNode, options)) ||\n (await embedProp('background-image', clonedNode, options));\n (await embedProp('mask', clonedNode, options)) ||\n (await embedProp('-webkit-mask', clonedNode, options)) ||\n (await embedProp('mask-image', clonedNode, options)) ||\n (await embedProp('-webkit-mask-image', clonedNode, options));\n}\nasync function embedImageNode(clonedNode, options) {\n const isImageElement = isInstanceOfElement(clonedNode, HTMLImageElement);\n if (!(isImageElement && !isDataUrl(clonedNode.src)) &&\n !(isInstanceOfElement(clonedNode, SVGImageElement) &&\n !isDataUrl(clonedNode.href.baseVal))) {\n return;\n }\n const url = isImageElement ? clonedNode.src : clonedNode.href.baseVal;\n const dataURL = await resourceToDataURL(url, getMimeType(url), options);\n await new Promise((resolve, reject) => {\n clonedNode.onload = resolve;\n clonedNode.onerror = options.onImageErrorHandler\n ? (...attributes) => {\n try {\n resolve(options.onImageErrorHandler(...attributes));\n }\n catch (error) {\n reject(error);\n }\n }\n : reject;\n const image = clonedNode;\n if (image.decode) {\n image.decode = resolve;\n }\n if (image.loading === 'lazy') {\n image.loading = 'eager';\n }\n if (isImageElement) {\n clonedNode.srcset = '';\n clonedNode.src = dataURL;\n }\n else {\n clonedNode.href.baseVal = dataURL;\n }\n });\n}\nasync function embedChildren(clonedNode, options) {\n const children = toArray(clonedNode.childNodes);\n const deferreds = children.map((child) => embedImages(child, options));\n await Promise.all(deferreds).then(() => clonedNode);\n}\nexport async function embedImages(clonedNode, options) {\n if (isInstanceOfElement(clonedNode, Element)) {\n await embedBackground(clonedNode, options);\n await embedImageNode(clonedNode, options);\n await embedChildren(clonedNode, options);\n }\n}\n//# sourceMappingURL=embed-images.js.map","export function applyStyle(node, options) {\n const { style } = node;\n if (options.backgroundColor) {\n style.backgroundColor = options.backgroundColor;\n }\n if (options.width) {\n style.width = `${options.width}px`;\n }\n if (options.height) {\n style.height = `${options.height}px`;\n }\n const manual = options.style;\n if (manual != null) {\n Object.keys(manual).forEach((key) => {\n style[key] = manual[key];\n });\n }\n return node;\n}\n//# sourceMappingURL=apply-style.js.map","import { toArray } from './util';\nimport { fetchAsDataURL } from './dataurl';\nimport { shouldEmbed, embedResources } from './embed-resources';\nconst cssFetchCache = {};\nasync function fetchCSS(url) {\n let cache = cssFetchCache[url];\n if (cache != null) {\n return cache;\n }\n const res = await fetch(url);\n const cssText = await res.text();\n cache = { url, cssText };\n cssFetchCache[url] = cache;\n return cache;\n}\nasync function embedFonts(data, options) {\n let cssText = data.cssText;\n const regexUrl = /url\\([\"']?([^\"')]+)[\"']?\\)/g;\n const fontLocs = cssText.match(/url\\([^)]+\\)/g) || [];\n const loadFonts = fontLocs.map(async (loc) => {\n let url = loc.replace(regexUrl, '$1');\n if (!url.startsWith('https://')) {\n url = new URL(url, data.url).href;\n }\n return fetchAsDataURL(url, options.fetchRequestInit, ({ result }) => {\n cssText = cssText.replace(loc, `url(${result})`);\n return [loc, result];\n });\n });\n return Promise.all(loadFonts).then(() => cssText);\n}\nfunction parseCSS(source) {\n if (source == null) {\n return [];\n }\n const result = [];\n const commentsRegex = /(\\/\\*[\\s\\S]*?\\*\\/)/gi;\n // strip out comments\n let cssText = source.replace(commentsRegex, '');\n // eslint-disable-next-line prefer-regex-literals\n const keyframesRegex = new RegExp('((@.*?keyframes [\\\\s\\\\S]*?){([\\\\s\\\\S]*?}\\\\s*?)})', 'gi');\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const matches = keyframesRegex.exec(cssText);\n if (matches === null) {\n break;\n }\n result.push(matches[0]);\n }\n cssText = cssText.replace(keyframesRegex, '');\n const importRegex = /@import[\\s\\S]*?url\\([^)]*\\)[\\s\\S]*?;/gi;\n // to match css & media queries together\n const combinedCSSRegex = '((\\\\s*?(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)?\\\\s*?@media[\\\\s\\\\S]' +\n '*?){([\\\\s\\\\S]*?)}\\\\s*?})|(([\\\\s\\\\S]*?){([\\\\s\\\\S]*?)})';\n // unified regex\n const unifiedRegex = new RegExp(combinedCSSRegex, 'gi');\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let matches = importRegex.exec(cssText);\n if (matches === null) {\n matches = unifiedRegex.exec(cssText);\n if (matches === null) {\n break;\n }\n else {\n importRegex.lastIndex = unifiedRegex.lastIndex;\n }\n }\n else {\n unifiedRegex.lastIndex = importRegex.lastIndex;\n }\n result.push(matches[0]);\n }\n return result;\n}\nasync function getCSSRules(styleSheets, options) {\n const ret = [];\n const deferreds = [];\n // First loop inlines imports\n styleSheets.forEach((sheet) => {\n if ('cssRules' in sheet) {\n try {\n toArray(sheet.cssRules || []).forEach((item, index) => {\n if (item.type === CSSRule.IMPORT_RULE) {\n let importIndex = index + 1;\n const url = item.href;\n const deferred = fetchCSS(url)\n .then((metadata) => embedFonts(metadata, options))\n .then((cssText) => parseCSS(cssText).forEach((rule) => {\n try {\n sheet.insertRule(rule, rule.startsWith('@import')\n ? (importIndex += 1)\n : sheet.cssRules.length);\n }\n catch (error) {\n console.error('Error inserting rule from remote css', {\n rule,\n error,\n });\n }\n }))\n .catch((e) => {\n console.error('Error loading remote css', e.toString());\n });\n deferreds.push(deferred);\n }\n });\n }\n catch (e) {\n const inline = styleSheets.find((a) => a.href == null) || document.styleSheets[0];\n if (sheet.href != null) {\n deferreds.push(fetchCSS(sheet.href)\n .then((metadata) => embedFonts(metadata, options))\n .then((cssText) => parseCSS(cssText).forEach((rule) => {\n inline.insertRule(rule, inline.cssRules.length);\n }))\n .catch((err) => {\n console.error('Error loading remote stylesheet', err);\n }));\n }\n console.error('Error inlining remote css file', e);\n }\n }\n });\n return Promise.all(deferreds).then(() => {\n // Second loop parses rules\n styleSheets.forEach((sheet) => {\n if ('cssRules' in sheet) {\n try {\n toArray(sheet.cssRules || []).forEach((item) => {\n ret.push(item);\n });\n }\n catch (e) {\n console.error(`Error while reading CSS rules from ${sheet.href}`, e);\n }\n }\n });\n return ret;\n });\n}\nfunction getWebFontRules(cssRules) {\n return cssRules\n .filter((rule) => rule.type === CSSRule.FONT_FACE_RULE)\n .filter((rule) => shouldEmbed(rule.style.getPropertyValue('src')));\n}\nasync function parseWebFontRules(node, options) {\n if (node.ownerDocument == null) {\n throw new Error('Provided element is not within a Document');\n }\n const styleSheets = toArray(node.ownerDocument.styleSheets);\n const cssRules = await getCSSRules(styleSheets, options);\n return getWebFontRules(cssRules);\n}\nfunction normalizeFontFamily(font) {\n return font.trim().replace(/[\"']/g, '');\n}\nfunction getUsedFonts(node) {\n const fonts = new Set();\n function traverse(node) {\n const fontFamily = node.style.fontFamily || getComputedStyle(node).fontFamily;\n fontFamily.split(',').forEach((font) => {\n fonts.add(normalizeFontFamily(font));\n });\n Array.from(node.children).forEach((child) => {\n if (child instanceof HTMLElement) {\n traverse(child);\n }\n });\n }\n traverse(node);\n return fonts;\n}\nexport async function getWebFontCSS(node, options) {\n const rules = await parseWebFontRules(node, options);\n const usedFonts = getUsedFonts(node);\n const cssTexts = await Promise.all(rules\n .filter((rule) => usedFonts.has(normalizeFontFamily(rule.style.fontFamily)))\n .map((rule) => {\n const baseUrl = rule.parentStyleSheet\n ? rule.parentStyleSheet.href\n : null;\n return embedResources(rule.cssText, baseUrl, options);\n }));\n return cssTexts.join('\\n');\n}\nexport async function embedWebFonts(clonedNode, options) {\n const cssText = options.fontEmbedCSS != null\n ? options.fontEmbedCSS\n : options.skipFonts\n ? null\n : await getWebFontCSS(clonedNode, options);\n if (cssText) {\n const styleNode = document.createElement('style');\n const sytleContent = document.createTextNode(cssText);\n styleNode.appendChild(sytleContent);\n if (clonedNode.firstChild) {\n clonedNode.insertBefore(styleNode, clonedNode.firstChild);\n }\n else {\n clonedNode.appendChild(styleNode);\n }\n }\n}\n//# sourceMappingURL=embed-webfonts.js.map","import { cloneNode } from './clone-node';\nimport { embedImages } from './embed-images';\nimport { applyStyle } from './apply-style';\nimport { embedWebFonts, getWebFontCSS } from './embed-webfonts';\nimport { getImageSize, getPixelRatio, createImage, canvasToBlob, nodeToDataURL, checkCanvasDimensions, } from './util';\nexport async function toSvg(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const clonedNode = (await cloneNode(node, options, true));\n await embedWebFonts(clonedNode, options);\n await embedImages(clonedNode, options);\n applyStyle(clonedNode, options);\n const datauri = await nodeToDataURL(clonedNode, width, height);\n return datauri;\n}\nexport async function toCanvas(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const svg = await toSvg(node, options);\n const img = await createImage(svg);\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n const ratio = options.pixelRatio || getPixelRatio();\n const canvasWidth = options.canvasWidth || width;\n const canvasHeight = options.canvasHeight || height;\n canvas.width = canvasWidth * ratio;\n canvas.height = canvasHeight * ratio;\n if (!options.skipAutoScale) {\n checkCanvasDimensions(canvas);\n }\n canvas.style.width = `${canvasWidth}`;\n canvas.style.height = `${canvasHeight}`;\n if (options.backgroundColor) {\n context.fillStyle = options.backgroundColor;\n context.fillRect(0, 0, canvas.width, canvas.height);\n }\n context.drawImage(img, 0, 0, canvas.width, canvas.height);\n return canvas;\n}\nexport async function toPixelData(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const canvas = await toCanvas(node, options);\n const ctx = canvas.getContext('2d');\n return ctx.getImageData(0, 0, width, height).data;\n}\nexport async function toPng(node, options = {}) {\n const canvas = await toCanvas(node, options);\n return canvas.toDataURL();\n}\nexport async function toJpeg(node, options = {}) {\n const canvas = await toCanvas(node, options);\n return canvas.toDataURL('image/jpeg', options.quality || 1);\n}\nexport async function toBlob(node, options = {}) {\n const canvas = await toCanvas(node, options);\n const blob = await canvasToBlob(canvas);\n return blob;\n}\nexport async function getFontEmbedCSS(node, options = {}) {\n return getWebFontCSS(node, options);\n}\n//# sourceMappingURL=index.js.map"],"names":["resolveUrl","url","baseUrl","doc","base","a","uuid","counter","random","toArray","arrayLike","arr","i","l","styleProps","getStyleProperties","options","px","node","styleProperty","val","getNodeWidth","leftBorder","rightBorder","getNodeHeight","topBorder","bottomBorder","getImageSize","targetNode","width","height","getPixelRatio","ratio","FINAL_PROCESS","canvasDimensionLimit","checkCanvasDimensions","canvas","canvasToBlob","resolve","binaryString","len","binaryArray","createImage","reject","img","svgToDataURL","svg","html","nodeToDataURL","xmlns","foreignObject","isInstanceOfElement","instance","nodePrototype","formatCSSText","style","content","formatCSSProperties","name","value","priority","getPseudoElementStyle","className","pseudo","selector","cssText","clonePseudoElement","nativeNode","clonedNode","styleElement","clonePseudoElements","WOFF","JPEG","mimes","getExtension","match","getMimeType","extension","getContentFromDataUrl","dataURL","isDataUrl","makeDataUrl","mimeType","fetchAsDataURL","init","process","res","blob","reader","error","cache","getCacheKey","contentType","includeQueryParams","key","resourceToDataURL","resourceUrl","cacheKey","result","msg","cloneCanvasElement","cloneVideoElement","video","ctx","poster","cloneIFrameElement","iframe","_a","cloneNode","cloneSingleNode","isSVGElement","isSlotElement","cloneChildren","_b","children","deferred","child","clonedChild","cloneCSSStyle","targetStyle","sourceStyle","cloneInputValue","cloneSelectValue","selectedOption","decorate","ensureSVGSymbols","clone","uses","processedDefs","id","exist","definition","nodes","ns","defs","isRoot","URL_REGEX","URL_WITH_FORMAT_REGEX","FONT_SRC_REGEX","toRegex","escaped","parseURLs","urls","raw","quotation","embed","resourceURL","baseURL","getContentFromUrl","resolvedURL","filterPreferredFontFormat","str","preferredFontFormat","src","format","shouldEmbed","embedResources","filteredCSSText","css","embedProp","propName","propValue","cssString","embedBackground","embedImageNode","isImageElement","attributes","image","embedChildren","deferreds","embedImages","applyStyle","manual","cssFetchCache","fetchCSS","embedFonts","data","regexUrl","loadFonts","loc","parseCSS","source","commentsRegex","keyframesRegex","matches","importRegex","combinedCSSRegex","unifiedRegex","getCSSRules","styleSheets","ret","sheet","item","index","importIndex","metadata","rule","e","inline","err","getWebFontRules","cssRules","parseWebFontRules","normalizeFontFamily","font","getUsedFonts","fonts","traverse","getWebFontCSS","rules","usedFonts","embedWebFonts","styleNode","sytleContent","toSvg","toCanvas","context","canvasWidth","canvasHeight","toPixelData","toPng","toJpeg","toBlob","getFontEmbedCSS"],"mappings":"AAAO,SAASA,EAAWC,GAAKC,GAAS;AAErC,MAAID,EAAI,MAAM,eAAe;AACzB,WAAOA;AAGX,MAAIA,EAAI,MAAM,OAAO;AACjB,WAAO,OAAO,SAAS,WAAWA;AA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