@makefully/notefully 0.1.58 → 0.1.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/notefully.iife.js +21 -21
- package/dist/notefully.js +1140 -1086
- package/package.json +1 -1
package/dist/notefully.js
CHANGED
|
@@ -1,404 +1,404 @@
|
|
|
1
|
-
function
|
|
2
|
-
if (
|
|
3
|
-
return
|
|
4
|
-
if (
|
|
5
|
-
return window.location.protocol +
|
|
6
|
-
if (
|
|
7
|
-
return
|
|
8
|
-
const n = document.implementation.createHTMLDocument(), r = n.createElement("base"),
|
|
9
|
-
return n.head.appendChild(r), n.body.appendChild(
|
|
1
|
+
function rn(e, t) {
|
|
2
|
+
if (e.match(/^[a-z]+:\/\//i))
|
|
3
|
+
return e;
|
|
4
|
+
if (e.match(/^\/\//))
|
|
5
|
+
return window.location.protocol + e;
|
|
6
|
+
if (e.match(/^[a-z]+:/i))
|
|
7
|
+
return e;
|
|
8
|
+
const n = document.implementation.createHTMLDocument(), r = n.createElement("base"), a = n.createElement("a");
|
|
9
|
+
return n.head.appendChild(r), n.body.appendChild(a), t && (r.href = t), a.href = e, a.href;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
let
|
|
13
|
-
const
|
|
11
|
+
const an = /* @__PURE__ */ (() => {
|
|
12
|
+
let e = 0;
|
|
13
|
+
const t = () => (
|
|
14
14
|
// eslint-disable-next-line no-bitwise
|
|
15
15
|
`0000${(Math.random() * 36 ** 4 << 0).toString(36)}`.slice(-4)
|
|
16
16
|
);
|
|
17
|
-
return () => (
|
|
17
|
+
return () => (e += 1, `u${t()}${e}`);
|
|
18
18
|
})();
|
|
19
|
-
function j(
|
|
20
|
-
const
|
|
21
|
-
for (let n = 0, r =
|
|
22
|
-
|
|
23
|
-
return
|
|
19
|
+
function j(e) {
|
|
20
|
+
const t = [];
|
|
21
|
+
for (let n = 0, r = e.length; n < r; n++)
|
|
22
|
+
t.push(e[n]);
|
|
23
|
+
return t;
|
|
24
24
|
}
|
|
25
25
|
let Z = null;
|
|
26
|
-
function
|
|
27
|
-
return Z || (
|
|
26
|
+
function yt(e = {}) {
|
|
27
|
+
return Z || (e.includeStyleProperties ? (Z = e.includeStyleProperties, Z) : (Z = j(window.getComputedStyle(document.documentElement)), Z));
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
const r = (
|
|
29
|
+
function ue(e, t) {
|
|
30
|
+
const r = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
|
|
31
31
|
return r ? parseFloat(r.replace("px", "")) : 0;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
return
|
|
33
|
+
function on(e) {
|
|
34
|
+
const t = ue(e, "border-left-width"), n = ue(e, "border-right-width");
|
|
35
|
+
return e.clientWidth + t + n;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
return
|
|
37
|
+
function sn(e) {
|
|
38
|
+
const t = ue(e, "border-top-width"), n = ue(e, "border-bottom-width");
|
|
39
|
+
return e.clientHeight + t + n;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
const n =
|
|
41
|
+
function mt(e, t = {}) {
|
|
42
|
+
const n = t.width || on(e), r = t.height || sn(e);
|
|
43
43
|
return { width: n, height: r };
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
let
|
|
45
|
+
function cn() {
|
|
46
|
+
let e, t;
|
|
47
47
|
try {
|
|
48
|
-
|
|
48
|
+
t = process;
|
|
49
49
|
} catch {
|
|
50
50
|
}
|
|
51
|
-
const n =
|
|
52
|
-
return n && (
|
|
51
|
+
const n = t && t.env ? t.env.devicePixelRatio : null;
|
|
52
|
+
return n && (e = parseInt(n, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
function
|
|
56
|
-
(
|
|
54
|
+
const A = 16384;
|
|
55
|
+
function ln(e) {
|
|
56
|
+
(e.width > A || e.height > A) && (e.width > A && e.height > A ? e.width > e.height ? (e.height *= A / e.width, e.width = A) : (e.width *= A / e.height, e.height = A) : e.width > A ? (e.height *= A / e.width, e.width = A) : (e.width *= A / e.height, e.height = A));
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
return new Promise((
|
|
58
|
+
function de(e) {
|
|
59
|
+
return new Promise((t, n) => {
|
|
60
60
|
const r = new Image();
|
|
61
61
|
r.onload = () => {
|
|
62
62
|
r.decode().then(() => {
|
|
63
|
-
requestAnimationFrame(() =>
|
|
63
|
+
requestAnimationFrame(() => t(r));
|
|
64
64
|
});
|
|
65
|
-
}, r.onerror = n, r.crossOrigin = "anonymous", r.decoding = "async", r.src =
|
|
65
|
+
}, r.onerror = n, r.crossOrigin = "anonymous", r.decoding = "async", r.src = e;
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
async function
|
|
69
|
-
return Promise.resolve().then(() => new XMLSerializer().serializeToString(
|
|
68
|
+
async function un(e) {
|
|
69
|
+
return Promise.resolve().then(() => new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then((t) => `data:image/svg+xml;charset=utf-8,${t}`);
|
|
70
70
|
}
|
|
71
|
-
async function
|
|
72
|
-
const r = "http://www.w3.org/2000/svg",
|
|
73
|
-
return
|
|
71
|
+
async function dn(e, t, n) {
|
|
72
|
+
const r = "http://www.w3.org/2000/svg", a = document.createElementNS(r, "svg"), i = document.createElementNS(r, "foreignObject");
|
|
73
|
+
return a.setAttribute("width", `${t}`), a.setAttribute("height", `${n}`), a.setAttribute("viewBox", `0 0 ${t} ${n}`), i.setAttribute("width", "100%"), i.setAttribute("height", "100%"), i.setAttribute("x", "0"), i.setAttribute("y", "0"), i.setAttribute("externalResourcesRequired", "true"), a.appendChild(i), i.appendChild(e), un(a);
|
|
74
74
|
}
|
|
75
|
-
const E = (
|
|
76
|
-
if (
|
|
75
|
+
const E = (e, t) => {
|
|
76
|
+
if (e instanceof t)
|
|
77
77
|
return !0;
|
|
78
|
-
const n = Object.getPrototypeOf(
|
|
79
|
-
return n === null ? !1 : n.constructor.name ===
|
|
78
|
+
const n = Object.getPrototypeOf(e);
|
|
79
|
+
return n === null ? !1 : n.constructor.name === t.name || E(n, t);
|
|
80
80
|
};
|
|
81
|
-
function
|
|
82
|
-
const
|
|
83
|
-
return `${
|
|
84
|
-
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
87
|
-
const r =
|
|
88
|
-
return `${n}: ${r}${
|
|
81
|
+
function fn(e) {
|
|
82
|
+
const t = e.getPropertyValue("content");
|
|
83
|
+
return `${e.cssText} content: '${t.replace(/'|"/g, "")}';`;
|
|
84
|
+
}
|
|
85
|
+
function hn(e, t) {
|
|
86
|
+
return yt(t).map((n) => {
|
|
87
|
+
const r = e.getPropertyValue(n), a = e.getPropertyPriority(n);
|
|
88
|
+
return `${n}: ${r}${a ? " !important" : ""};`;
|
|
89
89
|
}).join(" ");
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
const
|
|
93
|
-
return document.createTextNode(`${
|
|
91
|
+
function pn(e, t, n, r) {
|
|
92
|
+
const a = `.${e}:${t}`, i = n.cssText ? fn(n) : hn(n, r);
|
|
93
|
+
return document.createTextNode(`${a}{${i}}`);
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
const
|
|
97
|
-
if (
|
|
95
|
+
function Xe(e, t, n, r) {
|
|
96
|
+
const a = window.getComputedStyle(e, n), i = a.getPropertyValue("content");
|
|
97
|
+
if (i === "" || i === "none")
|
|
98
98
|
return;
|
|
99
|
-
const o =
|
|
99
|
+
const o = an();
|
|
100
100
|
try {
|
|
101
|
-
|
|
101
|
+
t.className = `${t.className} ${o}`;
|
|
102
102
|
} catch {
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
105
|
const c = document.createElement("style");
|
|
106
|
-
c.appendChild(
|
|
106
|
+
c.appendChild(pn(o, n, a, r)), t.appendChild(c);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
|
|
108
|
+
function yn(e, t, n) {
|
|
109
|
+
Xe(e, t, ":before", n), Xe(e, t, ":after", n);
|
|
110
110
|
}
|
|
111
|
-
const
|
|
112
|
-
woff:
|
|
113
|
-
woff2:
|
|
111
|
+
const Ye = "application/font-woff", Ge = "image/jpeg", mn = {
|
|
112
|
+
woff: Ye,
|
|
113
|
+
woff2: Ye,
|
|
114
114
|
ttf: "application/font-truetype",
|
|
115
115
|
eot: "application/vnd.ms-fontobject",
|
|
116
116
|
png: "image/png",
|
|
117
|
-
jpg:
|
|
118
|
-
jpeg:
|
|
117
|
+
jpg: Ge,
|
|
118
|
+
jpeg: Ge,
|
|
119
119
|
gif: "image/gif",
|
|
120
120
|
tiff: "image/tiff",
|
|
121
121
|
svg: "image/svg+xml",
|
|
122
122
|
webp: "image/webp"
|
|
123
123
|
};
|
|
124
|
-
function
|
|
125
|
-
const
|
|
126
|
-
return
|
|
124
|
+
function gn(e) {
|
|
125
|
+
const t = /\.([^./]*?)$/g.exec(e);
|
|
126
|
+
return t ? t[1] : "";
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
const
|
|
130
|
-
return
|
|
128
|
+
function Fe(e) {
|
|
129
|
+
const t = gn(e).toLowerCase();
|
|
130
|
+
return mn[t] || "";
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
return
|
|
132
|
+
function wn(e) {
|
|
133
|
+
return e.split(/,/)[1];
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
return
|
|
135
|
+
function Re(e) {
|
|
136
|
+
return e.search(/^(data:)/) !== -1;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
return `data:${
|
|
138
|
+
function vn(e, t) {
|
|
139
|
+
return `data:${t};base64,${e}`;
|
|
140
140
|
}
|
|
141
|
-
async function
|
|
142
|
-
const r = await fetch(
|
|
141
|
+
async function gt(e, t, n) {
|
|
142
|
+
const r = await fetch(e, t);
|
|
143
143
|
if (r.status === 404)
|
|
144
144
|
throw new Error(`Resource "${r.url}" not found`);
|
|
145
|
-
const
|
|
146
|
-
return new Promise((
|
|
145
|
+
const a = await r.blob();
|
|
146
|
+
return new Promise((i, o) => {
|
|
147
147
|
const c = new FileReader();
|
|
148
148
|
c.onerror = o, c.onloadend = () => {
|
|
149
149
|
try {
|
|
150
|
-
|
|
150
|
+
i(n({ res: r, result: c.result }));
|
|
151
151
|
} catch (l) {
|
|
152
152
|
o(l);
|
|
153
153
|
}
|
|
154
|
-
}, c.readAsDataURL(
|
|
154
|
+
}, c.readAsDataURL(a);
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
-
const
|
|
158
|
-
function
|
|
159
|
-
let r =
|
|
160
|
-
return n && (r =
|
|
161
|
-
}
|
|
162
|
-
async function
|
|
163
|
-
const r =
|
|
164
|
-
if (
|
|
165
|
-
return
|
|
166
|
-
n.cacheBust && (
|
|
167
|
-
let
|
|
157
|
+
const Ce = {};
|
|
158
|
+
function bn(e, t, n) {
|
|
159
|
+
let r = e.replace(/\?.*/, "");
|
|
160
|
+
return n && (r = e), /ttf|otf|eot|woff2?/i.test(r) && (r = r.replace(/.*\//, "")), t ? `[${t}]${r}` : r;
|
|
161
|
+
}
|
|
162
|
+
async function Ne(e, t, n) {
|
|
163
|
+
const r = bn(e, t, n.includeQueryParams);
|
|
164
|
+
if (Ce[r] != null)
|
|
165
|
+
return Ce[r];
|
|
166
|
+
n.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
|
|
167
|
+
let a;
|
|
168
168
|
try {
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
} catch (
|
|
172
|
-
|
|
173
|
-
let o = `Failed to fetch resource: ${
|
|
174
|
-
|
|
169
|
+
const i = await gt(e, n.fetchRequestInit, ({ res: o, result: c }) => (t || (t = o.headers.get("Content-Type") || ""), wn(c)));
|
|
170
|
+
a = vn(i, t);
|
|
171
|
+
} catch (i) {
|
|
172
|
+
a = n.imagePlaceholder || "";
|
|
173
|
+
let o = `Failed to fetch resource: ${e}`;
|
|
174
|
+
i && (o = typeof i == "string" ? i : i.message), o && console.warn(o);
|
|
175
175
|
}
|
|
176
|
-
return
|
|
177
|
-
}
|
|
178
|
-
async function
|
|
179
|
-
const
|
|
180
|
-
return
|
|
181
|
-
}
|
|
182
|
-
async function
|
|
183
|
-
if (
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
const c =
|
|
187
|
-
return
|
|
176
|
+
return Ce[r] = a, a;
|
|
177
|
+
}
|
|
178
|
+
async function Sn(e) {
|
|
179
|
+
const t = e.toDataURL();
|
|
180
|
+
return t === "data:," ? e.cloneNode(!1) : de(t);
|
|
181
|
+
}
|
|
182
|
+
async function xn(e, t) {
|
|
183
|
+
if (e.currentSrc) {
|
|
184
|
+
const i = document.createElement("canvas"), o = i.getContext("2d");
|
|
185
|
+
i.width = e.clientWidth, i.height = e.clientHeight, o == null || o.drawImage(e, 0, 0, i.width, i.height);
|
|
186
|
+
const c = i.toDataURL();
|
|
187
|
+
return de(c);
|
|
188
188
|
}
|
|
189
|
-
const n =
|
|
190
|
-
return
|
|
189
|
+
const n = e.poster, r = Fe(n), a = await Ne(n, r, t);
|
|
190
|
+
return de(a);
|
|
191
191
|
}
|
|
192
|
-
async function
|
|
192
|
+
async function En(e, t) {
|
|
193
193
|
var n;
|
|
194
194
|
try {
|
|
195
|
-
if (!((n =
|
|
196
|
-
return await
|
|
195
|
+
if (!((n = e == null ? void 0 : e.contentDocument) === null || n === void 0) && n.body)
|
|
196
|
+
return await ve(e.contentDocument.body, t, !0);
|
|
197
197
|
} catch {
|
|
198
198
|
}
|
|
199
|
-
return
|
|
199
|
+
return e.cloneNode(!1);
|
|
200
200
|
}
|
|
201
|
-
async function
|
|
202
|
-
return E(
|
|
201
|
+
async function Cn(e, t) {
|
|
202
|
+
return E(e, HTMLCanvasElement) ? Sn(e) : E(e, HTMLVideoElement) ? xn(e, t) : E(e, HTMLIFrameElement) ? En(e, t) : e.cloneNode(wt(e));
|
|
203
203
|
}
|
|
204
|
-
const
|
|
205
|
-
async function
|
|
206
|
-
var r,
|
|
207
|
-
if (
|
|
208
|
-
return
|
|
209
|
-
let
|
|
210
|
-
return
|
|
211
|
-
l &&
|
|
212
|
-
}), Promise.resolve()),
|
|
204
|
+
const An = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", wt = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
|
|
205
|
+
async function Ln(e, t, n) {
|
|
206
|
+
var r, a;
|
|
207
|
+
if (wt(t))
|
|
208
|
+
return t;
|
|
209
|
+
let i = [];
|
|
210
|
+
return An(e) && e.assignedNodes ? i = j(e.assignedNodes()) : E(e, HTMLIFrameElement) && (!((r = e.contentDocument) === null || r === void 0) && r.body) ? i = j(e.contentDocument.body.childNodes) : i = j(((a = e.shadowRoot) !== null && a !== void 0 ? a : e).childNodes), i.length === 0 || E(e, HTMLVideoElement) || await i.reduce((o, c) => o.then(() => ve(c, n)).then((l) => {
|
|
211
|
+
l && t.appendChild(l);
|
|
212
|
+
}), Promise.resolve()), t;
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
const r =
|
|
214
|
+
function kn(e, t, n) {
|
|
215
|
+
const r = t.style;
|
|
216
216
|
if (!r)
|
|
217
217
|
return;
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
let o =
|
|
221
|
-
|
|
218
|
+
const a = window.getComputedStyle(e);
|
|
219
|
+
a.cssText ? (r.cssText = a.cssText, r.transformOrigin = a.transformOrigin) : yt(n).forEach((i) => {
|
|
220
|
+
let o = a.getPropertyValue(i);
|
|
221
|
+
i === "font-size" && o.endsWith("px") && (o = `${Math.floor(parseFloat(o.substring(0, o.length - 2))) - 0.1}px`), E(e, HTMLIFrameElement) && i === "display" && o === "inline" && (o = "block"), i === "d" && t.getAttribute("d") && (o = `path(${t.getAttribute("d")})`), r.setProperty(i, o, a.getPropertyPriority(i));
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
E(
|
|
224
|
+
function Mn(e, t) {
|
|
225
|
+
E(e, HTMLTextAreaElement) && (t.innerHTML = e.value), E(e, HTMLInputElement) && t.setAttribute("value", e.value);
|
|
226
226
|
}
|
|
227
|
-
function
|
|
228
|
-
if (E(
|
|
229
|
-
const r = Array.from(
|
|
227
|
+
function $n(e, t) {
|
|
228
|
+
if (E(e, HTMLSelectElement)) {
|
|
229
|
+
const r = Array.from(t.children).find((a) => e.value === a.getAttribute("value"));
|
|
230
230
|
r && r.setAttribute("selected", "");
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
return E(
|
|
233
|
+
function Rn(e, t, n) {
|
|
234
|
+
return E(t, Element) && (kn(e, t, n), yn(e, t, n), Mn(e, t), $n(e, t)), t;
|
|
235
235
|
}
|
|
236
|
-
async function
|
|
237
|
-
const n =
|
|
236
|
+
async function Tn(e, t) {
|
|
237
|
+
const n = e.querySelectorAll ? e.querySelectorAll("use") : [];
|
|
238
238
|
if (n.length === 0)
|
|
239
|
-
return
|
|
239
|
+
return e;
|
|
240
240
|
const r = {};
|
|
241
|
-
for (let
|
|
242
|
-
const c = n[
|
|
241
|
+
for (let i = 0; i < n.length; i++) {
|
|
242
|
+
const c = n[i].getAttribute("xlink:href");
|
|
243
243
|
if (c) {
|
|
244
|
-
const l =
|
|
245
|
-
!l && u && !r[c] && (r[c] = await
|
|
244
|
+
const l = e.querySelector(c), u = document.querySelector(c);
|
|
245
|
+
!l && u && !r[c] && (r[c] = await ve(u, t, !0));
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
250
|
-
const
|
|
251
|
-
o.setAttribute("xmlns",
|
|
252
|
-
const c = document.createElementNS(
|
|
248
|
+
const a = Object.values(r);
|
|
249
|
+
if (a.length) {
|
|
250
|
+
const i = "http://www.w3.org/1999/xhtml", o = document.createElementNS(i, "svg");
|
|
251
|
+
o.setAttribute("xmlns", i), o.style.position = "absolute", o.style.width = "0", o.style.height = "0", o.style.overflow = "hidden", o.style.display = "none";
|
|
252
|
+
const c = document.createElementNS(i, "defs");
|
|
253
253
|
o.appendChild(c);
|
|
254
|
-
for (let l = 0; l <
|
|
255
|
-
c.appendChild(
|
|
256
|
-
|
|
254
|
+
for (let l = 0; l < a.length; l++)
|
|
255
|
+
c.appendChild(a[l]);
|
|
256
|
+
e.appendChild(o);
|
|
257
257
|
}
|
|
258
|
-
return
|
|
258
|
+
return e;
|
|
259
259
|
}
|
|
260
|
-
async function
|
|
261
|
-
return !n &&
|
|
260
|
+
async function ve(e, t, n) {
|
|
261
|
+
return !n && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((r) => Cn(r, t)).then((r) => Ln(e, r, t)).then((r) => Rn(e, r, t)).then((r) => Tn(r, t));
|
|
262
262
|
}
|
|
263
|
-
const
|
|
264
|
-
function
|
|
265
|
-
const
|
|
266
|
-
return new RegExp(`(url\\(['"]?)(${
|
|
263
|
+
const vt = /url\((['"]?)([^'"]+?)\1\)/g, Pn = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, In = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
|
|
264
|
+
function On(e) {
|
|
265
|
+
const t = e.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
|
|
266
|
+
return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
const
|
|
270
|
-
return
|
|
268
|
+
function Bn(e) {
|
|
269
|
+
const t = [];
|
|
270
|
+
return e.replace(vt, (n, r, a) => (t.push(a), n)), t.filter((n) => !Re(n));
|
|
271
271
|
}
|
|
272
|
-
async function
|
|
272
|
+
async function Dn(e, t, n, r, a) {
|
|
273
273
|
try {
|
|
274
|
-
const
|
|
274
|
+
const i = n ? rn(t, n) : t, o = Fe(t);
|
|
275
275
|
let c;
|
|
276
|
-
return
|
|
276
|
+
return a || (c = await Ne(i, o, r)), e.replace(On(t), `$1${c}$3`);
|
|
277
277
|
} catch {
|
|
278
278
|
}
|
|
279
|
-
return
|
|
279
|
+
return e;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
return
|
|
281
|
+
function Hn(e, { preferredFontFormat: t }) {
|
|
282
|
+
return t ? e.replace(In, (n) => {
|
|
283
283
|
for (; ; ) {
|
|
284
|
-
const [r, ,
|
|
285
|
-
if (!
|
|
284
|
+
const [r, , a] = Pn.exec(n) || [];
|
|
285
|
+
if (!a)
|
|
286
286
|
return "";
|
|
287
|
-
if (
|
|
287
|
+
if (a === t)
|
|
288
288
|
return `src: ${r};`;
|
|
289
289
|
}
|
|
290
|
-
}) :
|
|
290
|
+
}) : e;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
293
|
-
return
|
|
292
|
+
function bt(e) {
|
|
293
|
+
return e.search(vt) !== -1;
|
|
294
294
|
}
|
|
295
|
-
async function
|
|
296
|
-
if (!
|
|
297
|
-
return
|
|
298
|
-
const r =
|
|
299
|
-
return
|
|
295
|
+
async function St(e, t, n) {
|
|
296
|
+
if (!bt(e))
|
|
297
|
+
return e;
|
|
298
|
+
const r = Hn(e, n);
|
|
299
|
+
return Bn(r).reduce((i, o) => i.then((c) => Dn(c, o, t, n)), Promise.resolve(r));
|
|
300
300
|
}
|
|
301
|
-
async function
|
|
301
|
+
async function ee(e, t, n) {
|
|
302
302
|
var r;
|
|
303
|
-
const
|
|
304
|
-
if (
|
|
305
|
-
const
|
|
306
|
-
return
|
|
303
|
+
const a = (r = t.style) === null || r === void 0 ? void 0 : r.getPropertyValue(e);
|
|
304
|
+
if (a) {
|
|
305
|
+
const i = await St(a, null, n);
|
|
306
|
+
return t.style.setProperty(e, i, t.style.getPropertyPriority(e)), !0;
|
|
307
307
|
}
|
|
308
308
|
return !1;
|
|
309
309
|
}
|
|
310
|
-
async function
|
|
311
|
-
await
|
|
310
|
+
async function Fn(e, t) {
|
|
311
|
+
await ee("background", e, t) || await ee("background-image", e, t), await ee("mask", e, t) || await ee("-webkit-mask", e, t) || await ee("mask-image", e, t) || await ee("-webkit-mask-image", e, t);
|
|
312
312
|
}
|
|
313
|
-
async function
|
|
314
|
-
const n = E(
|
|
315
|
-
if (!(n && !
|
|
313
|
+
async function Nn(e, t) {
|
|
314
|
+
const n = E(e, HTMLImageElement);
|
|
315
|
+
if (!(n && !Re(e.src)) && !(E(e, SVGImageElement) && !Re(e.href.baseVal)))
|
|
316
316
|
return;
|
|
317
|
-
const r = n ?
|
|
318
|
-
await new Promise((
|
|
319
|
-
|
|
317
|
+
const r = n ? e.src : e.href.baseVal, a = await Ne(r, Fe(r), t);
|
|
318
|
+
await new Promise((i, o) => {
|
|
319
|
+
e.onload = i, e.onerror = t.onImageErrorHandler ? (...l) => {
|
|
320
320
|
try {
|
|
321
|
-
|
|
321
|
+
i(t.onImageErrorHandler(...l));
|
|
322
322
|
} catch (u) {
|
|
323
323
|
o(u);
|
|
324
324
|
}
|
|
325
325
|
} : o;
|
|
326
|
-
const c =
|
|
327
|
-
c.decode && (c.decode =
|
|
326
|
+
const c = e;
|
|
327
|
+
c.decode && (c.decode = i), c.loading === "lazy" && (c.loading = "eager"), n ? (e.srcset = "", e.src = a) : e.href.baseVal = a;
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
|
-
async function
|
|
331
|
-
const r = j(
|
|
332
|
-
await Promise.all(r).then(() =>
|
|
333
|
-
}
|
|
334
|
-
async function
|
|
335
|
-
E(
|
|
336
|
-
}
|
|
337
|
-
function
|
|
338
|
-
const { style: n } =
|
|
339
|
-
|
|
340
|
-
const r =
|
|
341
|
-
return r != null && Object.keys(r).forEach((
|
|
342
|
-
n[
|
|
343
|
-
}),
|
|
344
|
-
}
|
|
345
|
-
const
|
|
346
|
-
async function
|
|
347
|
-
let
|
|
348
|
-
if (
|
|
349
|
-
return
|
|
350
|
-
const r = await (await fetch(
|
|
351
|
-
return
|
|
330
|
+
async function Un(e, t) {
|
|
331
|
+
const r = j(e.childNodes).map((a) => xt(a, t));
|
|
332
|
+
await Promise.all(r).then(() => e);
|
|
333
|
+
}
|
|
334
|
+
async function xt(e, t) {
|
|
335
|
+
E(e, Element) && (await Fn(e, t), await Nn(e, t), await Un(e, t));
|
|
336
|
+
}
|
|
337
|
+
function _n(e, t) {
|
|
338
|
+
const { style: n } = e;
|
|
339
|
+
t.backgroundColor && (n.backgroundColor = t.backgroundColor), t.width && (n.width = `${t.width}px`), t.height && (n.height = `${t.height}px`);
|
|
340
|
+
const r = t.style;
|
|
341
|
+
return r != null && Object.keys(r).forEach((a) => {
|
|
342
|
+
n[a] = r[a];
|
|
343
|
+
}), e;
|
|
344
|
+
}
|
|
345
|
+
const Je = {};
|
|
346
|
+
async function Qe(e) {
|
|
347
|
+
let t = Je[e];
|
|
348
|
+
if (t != null)
|
|
349
|
+
return t;
|
|
350
|
+
const r = await (await fetch(e)).text();
|
|
351
|
+
return t = { url: e, cssText: r }, Je[e] = t, t;
|
|
352
352
|
}
|
|
353
|
-
async function
|
|
354
|
-
let n =
|
|
355
|
-
const r = /url\(["']?([^"')]+)["']?\)/g,
|
|
353
|
+
async function Ze(e, t) {
|
|
354
|
+
let n = e.cssText;
|
|
355
|
+
const r = /url\(["']?([^"')]+)["']?\)/g, i = (n.match(/url\([^)]+\)/g) || []).map(async (o) => {
|
|
356
356
|
let c = o.replace(r, "$1");
|
|
357
|
-
return c.startsWith("https://") || (c = new URL(c,
|
|
357
|
+
return c.startsWith("https://") || (c = new URL(c, e.url).href), gt(c, t.fetchRequestInit, ({ result: l }) => (n = n.replace(o, `url(${l})`), [o, l]));
|
|
358
358
|
});
|
|
359
|
-
return Promise.all(
|
|
359
|
+
return Promise.all(i).then(() => n);
|
|
360
360
|
}
|
|
361
|
-
function
|
|
362
|
-
if (
|
|
361
|
+
function et(e) {
|
|
362
|
+
if (e == null)
|
|
363
363
|
return [];
|
|
364
|
-
const
|
|
365
|
-
let r =
|
|
366
|
-
const
|
|
364
|
+
const t = [], n = /(\/\*[\s\S]*?\*\/)/gi;
|
|
365
|
+
let r = e.replace(n, "");
|
|
366
|
+
const a = new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
|
|
367
367
|
for (; ; ) {
|
|
368
|
-
const l =
|
|
368
|
+
const l = a.exec(r);
|
|
369
369
|
if (l === null)
|
|
370
370
|
break;
|
|
371
|
-
|
|
371
|
+
t.push(l[0]);
|
|
372
372
|
}
|
|
373
|
-
r = r.replace(
|
|
374
|
-
const
|
|
373
|
+
r = r.replace(a, "");
|
|
374
|
+
const i = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, o = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", c = new RegExp(o, "gi");
|
|
375
375
|
for (; ; ) {
|
|
376
|
-
let l =
|
|
376
|
+
let l = i.exec(r);
|
|
377
377
|
if (l === null) {
|
|
378
378
|
if (l = c.exec(r), l === null)
|
|
379
379
|
break;
|
|
380
|
-
|
|
380
|
+
i.lastIndex = c.lastIndex;
|
|
381
381
|
} else
|
|
382
|
-
c.lastIndex =
|
|
383
|
-
|
|
382
|
+
c.lastIndex = i.lastIndex;
|
|
383
|
+
t.push(l[0]);
|
|
384
384
|
}
|
|
385
|
-
return
|
|
385
|
+
return t;
|
|
386
386
|
}
|
|
387
|
-
async function
|
|
387
|
+
async function jn(e, t) {
|
|
388
388
|
const n = [], r = [];
|
|
389
|
-
return
|
|
390
|
-
if ("cssRules" in
|
|
389
|
+
return e.forEach((a) => {
|
|
390
|
+
if ("cssRules" in a)
|
|
391
391
|
try {
|
|
392
|
-
j(
|
|
393
|
-
if (
|
|
392
|
+
j(a.cssRules || []).forEach((i, o) => {
|
|
393
|
+
if (i.type === CSSRule.IMPORT_RULE) {
|
|
394
394
|
let c = o + 1;
|
|
395
|
-
const l =
|
|
395
|
+
const l = i.href, u = Qe(l).then((f) => Ze(f, t)).then((f) => et(f).forEach((y) => {
|
|
396
396
|
try {
|
|
397
|
-
|
|
398
|
-
} catch (
|
|
397
|
+
a.insertRule(y, y.startsWith("@import") ? c += 1 : a.cssRules.length);
|
|
398
|
+
} catch (m) {
|
|
399
399
|
console.error("Error inserting rule from remote css", {
|
|
400
400
|
rule: y,
|
|
401
|
-
error:
|
|
401
|
+
error: m
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
404
|
})).catch((f) => {
|
|
@@ -407,107 +407,107 @@ async function Un(t, e) {
|
|
|
407
407
|
r.push(u);
|
|
408
408
|
}
|
|
409
409
|
});
|
|
410
|
-
} catch (
|
|
411
|
-
const o =
|
|
412
|
-
|
|
410
|
+
} catch (i) {
|
|
411
|
+
const o = e.find((c) => c.href == null) || document.styleSheets[0];
|
|
412
|
+
a.href != null && r.push(Qe(a.href).then((c) => Ze(c, t)).then((c) => et(c).forEach((l) => {
|
|
413
413
|
o.insertRule(l, o.cssRules.length);
|
|
414
414
|
})).catch((c) => {
|
|
415
415
|
console.error("Error loading remote stylesheet", c);
|
|
416
|
-
})), console.error("Error inlining remote css file",
|
|
416
|
+
})), console.error("Error inlining remote css file", i);
|
|
417
417
|
}
|
|
418
|
-
}), Promise.all(r).then(() => (
|
|
419
|
-
if ("cssRules" in
|
|
418
|
+
}), Promise.all(r).then(() => (e.forEach((a) => {
|
|
419
|
+
if ("cssRules" in a)
|
|
420
420
|
try {
|
|
421
|
-
j(
|
|
422
|
-
n.push(
|
|
421
|
+
j(a.cssRules || []).forEach((i) => {
|
|
422
|
+
n.push(i);
|
|
423
423
|
});
|
|
424
|
-
} catch (
|
|
425
|
-
console.error(`Error while reading CSS rules from ${
|
|
424
|
+
} catch (i) {
|
|
425
|
+
console.error(`Error while reading CSS rules from ${a.href}`, i);
|
|
426
426
|
}
|
|
427
427
|
}), n));
|
|
428
428
|
}
|
|
429
|
-
function
|
|
430
|
-
return
|
|
429
|
+
function Vn(e) {
|
|
430
|
+
return e.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => bt(t.style.getPropertyValue("src")));
|
|
431
431
|
}
|
|
432
|
-
async function
|
|
433
|
-
if (
|
|
432
|
+
async function zn(e, t) {
|
|
433
|
+
if (e.ownerDocument == null)
|
|
434
434
|
throw new Error("Provided element is not within a Document");
|
|
435
|
-
const n = j(
|
|
436
|
-
return
|
|
435
|
+
const n = j(e.ownerDocument.styleSheets), r = await jn(n, t);
|
|
436
|
+
return Vn(r);
|
|
437
437
|
}
|
|
438
|
-
function
|
|
439
|
-
return
|
|
438
|
+
function Et(e) {
|
|
439
|
+
return e.trim().replace(/["']/g, "");
|
|
440
440
|
}
|
|
441
|
-
function
|
|
442
|
-
const
|
|
441
|
+
function Wn(e) {
|
|
442
|
+
const t = /* @__PURE__ */ new Set();
|
|
443
443
|
function n(r) {
|
|
444
|
-
(r.style.fontFamily || getComputedStyle(r).fontFamily).split(",").forEach((
|
|
445
|
-
|
|
446
|
-
}), Array.from(r.children).forEach((
|
|
447
|
-
|
|
444
|
+
(r.style.fontFamily || getComputedStyle(r).fontFamily).split(",").forEach((i) => {
|
|
445
|
+
t.add(Et(i));
|
|
446
|
+
}), Array.from(r.children).forEach((i) => {
|
|
447
|
+
i instanceof HTMLElement && n(i);
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
|
-
return n(
|
|
450
|
+
return n(e), t;
|
|
451
451
|
}
|
|
452
|
-
async function
|
|
453
|
-
const n = await
|
|
454
|
-
return (await Promise.all(n.filter((
|
|
455
|
-
const o =
|
|
456
|
-
return
|
|
452
|
+
async function Kn(e, t) {
|
|
453
|
+
const n = await zn(e, t), r = Wn(e);
|
|
454
|
+
return (await Promise.all(n.filter((i) => r.has(Et(i.style.fontFamily))).map((i) => {
|
|
455
|
+
const o = i.parentStyleSheet ? i.parentStyleSheet.href : null;
|
|
456
|
+
return St(i.cssText, o, t);
|
|
457
457
|
}))).join(`
|
|
458
458
|
`);
|
|
459
459
|
}
|
|
460
|
-
async function
|
|
461
|
-
const n =
|
|
460
|
+
async function qn(e, t) {
|
|
461
|
+
const n = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await Kn(e, t);
|
|
462
462
|
if (n) {
|
|
463
|
-
const r = document.createElement("style"),
|
|
464
|
-
r.appendChild(
|
|
463
|
+
const r = document.createElement("style"), a = document.createTextNode(n);
|
|
464
|
+
r.appendChild(a), e.firstChild ? e.insertBefore(r, e.firstChild) : e.appendChild(r);
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
|
-
async function
|
|
468
|
-
const { width: n, height: r } =
|
|
469
|
-
return await
|
|
467
|
+
async function Xn(e, t = {}) {
|
|
468
|
+
const { width: n, height: r } = mt(e, t), a = await ve(e, t, !0);
|
|
469
|
+
return await qn(a, t), await xt(a, t), _n(a, t), await dn(a, n, r);
|
|
470
470
|
}
|
|
471
|
-
async function
|
|
472
|
-
const { width: n, height: r } =
|
|
473
|
-
return o.width = u * l, o.height = f * l,
|
|
471
|
+
async function Yn(e, t = {}) {
|
|
472
|
+
const { width: n, height: r } = mt(e, t), a = await Xn(e, t), i = await de(a), o = document.createElement("canvas"), c = o.getContext("2d"), l = t.pixelRatio || cn(), u = t.canvasWidth || n, f = t.canvasHeight || r;
|
|
473
|
+
return o.width = u * l, o.height = f * l, t.skipAutoScale || ln(o), o.style.width = `${u}`, o.style.height = `${f}`, t.backgroundColor && (c.fillStyle = t.backgroundColor, c.fillRect(0, 0, o.width, o.height)), c.drawImage(i, 0, 0, o.width, o.height), o;
|
|
474
474
|
}
|
|
475
|
-
async function
|
|
476
|
-
return (await
|
|
475
|
+
async function tt(e, t = {}) {
|
|
476
|
+
return (await Yn(e, t)).toDataURL();
|
|
477
477
|
}
|
|
478
|
-
const
|
|
479
|
-
function
|
|
480
|
-
return
|
|
478
|
+
const fe = "data-nf-capture-chrome", Gn = "data-nf-canvas-snap", Jn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
|
|
479
|
+
function Ct(e) {
|
|
480
|
+
return e instanceof Element && (e.hasAttribute(fe) || e.hasAttribute("data-nf-mask-cover") || e.id === "notefully");
|
|
481
481
|
}
|
|
482
|
-
function
|
|
483
|
-
const
|
|
484
|
-
return Array.from(document.styleSheets).forEach((
|
|
482
|
+
function Qn() {
|
|
483
|
+
const e = [];
|
|
484
|
+
return Array.from(document.styleSheets).forEach((t) => {
|
|
485
485
|
try {
|
|
486
|
-
|
|
486
|
+
t.cssRules;
|
|
487
487
|
} catch {
|
|
488
488
|
try {
|
|
489
|
-
if (
|
|
489
|
+
if (t.disabled)
|
|
490
490
|
return;
|
|
491
|
-
|
|
491
|
+
t.disabled = !0, e.push(t);
|
|
492
492
|
} catch {
|
|
493
|
-
const n =
|
|
494
|
-
n && "disabled" in n && !n.disabled && (n.disabled = !0,
|
|
493
|
+
const n = t.ownerNode;
|
|
494
|
+
n && "disabled" in n && !n.disabled && (n.disabled = !0, e.push({ node: n }));
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
}), () => {
|
|
498
|
-
|
|
498
|
+
e.forEach((t) => {
|
|
499
499
|
try {
|
|
500
|
-
|
|
500
|
+
t && t.node ? t.node.disabled = !1 : t && (t.disabled = !1);
|
|
501
501
|
} catch {
|
|
502
502
|
}
|
|
503
503
|
});
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
|
-
function
|
|
507
|
-
const
|
|
506
|
+
function Zn() {
|
|
507
|
+
const e = [];
|
|
508
508
|
return document.querySelectorAll('input[type="password"], [data-notefully-mask]').forEach((n) => {
|
|
509
|
-
const r = n.getBoundingClientRect(),
|
|
510
|
-
|
|
509
|
+
const r = n.getBoundingClientRect(), a = document.createElement("div");
|
|
510
|
+
a.setAttribute("data-nf-mask-cover", "1"), a.style.cssText = [
|
|
511
511
|
"position:fixed",
|
|
512
512
|
`left:${r.left}px`,
|
|
513
513
|
`top:${r.top}px`,
|
|
@@ -516,50 +516,50 @@ function Gn() {
|
|
|
516
516
|
"background:#111",
|
|
517
517
|
"z-index:2147483646",
|
|
518
518
|
"pointer-events:none"
|
|
519
|
-
].join(";"), document.body.appendChild(
|
|
520
|
-
}), () =>
|
|
519
|
+
].join(";"), document.body.appendChild(a), e.push(a);
|
|
520
|
+
}), () => e.forEach((n) => n.remove());
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
const
|
|
524
|
-
if (
|
|
525
|
-
return
|
|
526
|
-
const
|
|
527
|
-
return
|
|
522
|
+
function er() {
|
|
523
|
+
const e = document.querySelector(`[${fe}]`);
|
|
524
|
+
if (e)
|
|
525
|
+
return e;
|
|
526
|
+
const t = document.createElement("div");
|
|
527
|
+
return t.setAttribute(fe, "1"), t.className = "nf-capture-chrome", t.setAttribute("role", "status"), t.setAttribute("aria-live", "polite"), t.innerHTML = '<span class="nf-capture-chrome-pill">Capturing…</span>', document.body.appendChild(t), t;
|
|
528
528
|
}
|
|
529
|
-
function
|
|
530
|
-
document.querySelectorAll(`[${
|
|
529
|
+
function tr() {
|
|
530
|
+
document.querySelectorAll(`[${fe}]`).forEach((e) => e.remove());
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
return new Promise((
|
|
534
|
-
requestAnimationFrame(() => requestAnimationFrame(
|
|
532
|
+
function Te() {
|
|
533
|
+
return new Promise((e) => {
|
|
534
|
+
requestAnimationFrame(() => requestAnimationFrame(e));
|
|
535
535
|
});
|
|
536
536
|
}
|
|
537
|
-
function V(
|
|
538
|
-
if (typeof
|
|
537
|
+
function V(e) {
|
|
538
|
+
if (typeof e != "string" || !e.startsWith("data:image/"))
|
|
539
539
|
return !1;
|
|
540
|
-
const
|
|
541
|
-
return
|
|
540
|
+
const t = e.indexOf(",");
|
|
541
|
+
return t > 0 && t < e.length - 1;
|
|
542
542
|
}
|
|
543
|
-
function
|
|
544
|
-
const
|
|
543
|
+
function nr() {
|
|
544
|
+
const e = document.documentElement, t = document.body, n = Math.max(
|
|
545
545
|
window.innerWidth || 0,
|
|
546
|
-
(
|
|
547
|
-
(t == null ? void 0 : t.scrollWidth) || 0,
|
|
546
|
+
(e == null ? void 0 : e.clientWidth) || 0,
|
|
548
547
|
(e == null ? void 0 : e.scrollWidth) || 0,
|
|
548
|
+
(t == null ? void 0 : t.scrollWidth) || 0,
|
|
549
549
|
1
|
|
550
550
|
), r = Math.max(
|
|
551
551
|
window.innerHeight || 0,
|
|
552
|
-
(
|
|
553
|
-
(t == null ? void 0 : t.scrollHeight) || 0,
|
|
552
|
+
(e == null ? void 0 : e.clientHeight) || 0,
|
|
554
553
|
(e == null ? void 0 : e.scrollHeight) || 0,
|
|
554
|
+
(t == null ? void 0 : t.scrollHeight) || 0,
|
|
555
555
|
1
|
|
556
556
|
);
|
|
557
557
|
return { width: n, height: r };
|
|
558
558
|
}
|
|
559
|
-
async function
|
|
560
|
-
const
|
|
561
|
-
for (const n of
|
|
562
|
-
if (n.closest("#notefully") ||
|
|
559
|
+
async function rr() {
|
|
560
|
+
const e = [], t = Array.from(document.querySelectorAll("canvas"));
|
|
561
|
+
for (const n of t) {
|
|
562
|
+
if (n.closest("#notefully") || Ct(n))
|
|
563
563
|
continue;
|
|
564
564
|
let r = "";
|
|
565
565
|
try {
|
|
@@ -569,16 +569,16 @@ async function tr() {
|
|
|
569
569
|
}
|
|
570
570
|
if (!r || r === "data:,")
|
|
571
571
|
continue;
|
|
572
|
-
const
|
|
573
|
-
|
|
572
|
+
const a = document.createElement("img"), i = getComputedStyle(n);
|
|
573
|
+
a.setAttribute(Gn, "1"), a.alt = "", a.src = r, a.className = n.className, a.style.cssText = n.style.cssText, a.style.width = i.width, a.style.height = i.height, a.style.maxWidth = i.maxWidth, a.style.maxHeight = i.maxHeight, a.style.objectFit = "fill", a.style.display = i.display === "inline" ? "inline-block" : i.display, n.replaceWith(a), e.push({ canvas: n, img: a });
|
|
574
574
|
}
|
|
575
|
-
return await Promise.all(
|
|
575
|
+
return await Promise.all(e.map(({ img: n }) => {
|
|
576
576
|
if (!n.complete)
|
|
577
577
|
return new Promise((r) => {
|
|
578
578
|
n.onload = () => r(), n.onerror = () => r();
|
|
579
579
|
});
|
|
580
580
|
})), () => {
|
|
581
|
-
|
|
581
|
+
e.forEach(({ canvas: n, img: r }) => {
|
|
582
582
|
try {
|
|
583
583
|
r.parentNode && r.replaceWith(n);
|
|
584
584
|
} catch {
|
|
@@ -586,38 +586,38 @@ async function tr() {
|
|
|
586
586
|
});
|
|
587
587
|
};
|
|
588
588
|
}
|
|
589
|
-
async function
|
|
590
|
-
if (!
|
|
589
|
+
async function ir(e) {
|
|
590
|
+
if (!e)
|
|
591
591
|
return null;
|
|
592
|
-
if (typeof
|
|
593
|
-
return V(
|
|
594
|
-
if (typeof HTMLCanvasElement < "u" &&
|
|
592
|
+
if (typeof e == "string")
|
|
593
|
+
return V(e) ? e : null;
|
|
594
|
+
if (typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement)
|
|
595
595
|
try {
|
|
596
|
-
const
|
|
597
|
-
return V(
|
|
596
|
+
const t = e.toDataURL("image/png");
|
|
597
|
+
return V(t) ? t : null;
|
|
598
598
|
} catch {
|
|
599
599
|
return null;
|
|
600
600
|
}
|
|
601
|
-
if (typeof Blob < "u" &&
|
|
602
|
-
const
|
|
603
|
-
return V(
|
|
601
|
+
if (typeof Blob < "u" && e instanceof Blob) {
|
|
602
|
+
const t = await ar(e);
|
|
603
|
+
return V(t) ? t : null;
|
|
604
604
|
}
|
|
605
605
|
return null;
|
|
606
606
|
}
|
|
607
|
-
async function
|
|
607
|
+
async function ar(e) {
|
|
608
608
|
if (typeof FileReader == "function")
|
|
609
|
-
return new Promise((r,
|
|
610
|
-
const
|
|
611
|
-
|
|
609
|
+
return new Promise((r, a) => {
|
|
610
|
+
const i = new FileReader();
|
|
611
|
+
i.onload = () => r(String(i.result || "")), i.onerror = () => a(i.error || new Error("Could not read capture blob")), i.readAsDataURL(e);
|
|
612
612
|
});
|
|
613
|
-
const
|
|
614
|
-
return `data:${
|
|
613
|
+
const t = Buffer.from(await e.arrayBuffer());
|
|
614
|
+
return `data:${e.type || "application/octet-stream"};base64,${t.toString("base64")}`;
|
|
615
615
|
}
|
|
616
|
-
async function
|
|
617
|
-
var
|
|
618
|
-
if (!((
|
|
616
|
+
async function or() {
|
|
617
|
+
var t;
|
|
618
|
+
if (!((t = navigator.mediaDevices) != null && t.getDisplayMedia))
|
|
619
619
|
throw new Error("Screen capture is not supported in this browser.");
|
|
620
|
-
const
|
|
620
|
+
const e = await navigator.mediaDevices.getDisplayMedia({
|
|
621
621
|
video: { displaySurface: "browser" },
|
|
622
622
|
audio: !1,
|
|
623
623
|
preferCurrentTab: !0,
|
|
@@ -625,76 +625,76 @@ async function rr() {
|
|
|
625
625
|
});
|
|
626
626
|
try {
|
|
627
627
|
const n = document.createElement("video");
|
|
628
|
-
n.muted = !0, n.playsInline = !0, n.srcObject =
|
|
628
|
+
n.muted = !0, n.playsInline = !0, n.srcObject = e, await n.play(), n.videoWidth || await new Promise((c) => {
|
|
629
629
|
n.onloadedmetadata = () => c();
|
|
630
|
-
}), await
|
|
631
|
-
const r = n.videoWidth || 1,
|
|
632
|
-
|
|
633
|
-
const o =
|
|
630
|
+
}), await Te();
|
|
631
|
+
const r = n.videoWidth || 1, a = n.videoHeight || 1, i = document.createElement("canvas");
|
|
632
|
+
i.width = r, i.height = a, i.getContext("2d").drawImage(n, 0, 0, r, a);
|
|
633
|
+
const o = i.toDataURL("image/png");
|
|
634
634
|
if (!V(o))
|
|
635
635
|
throw new Error("Screen capture produced an empty image.");
|
|
636
636
|
return o;
|
|
637
637
|
} finally {
|
|
638
|
-
|
|
638
|
+
e.getTracks().forEach((n) => n.stop());
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
|
-
async function
|
|
642
|
-
const
|
|
643
|
-
let
|
|
641
|
+
async function At(e = {}) {
|
|
642
|
+
const t = document.getElementById("notefully"), n = t ? t.style.display : "", r = er(), a = Qn();
|
|
643
|
+
let i = () => {
|
|
644
644
|
};
|
|
645
|
-
|
|
646
|
-
const o =
|
|
645
|
+
t && (t.style.display = "none");
|
|
646
|
+
const o = Zn();
|
|
647
647
|
try {
|
|
648
|
-
if (typeof
|
|
649
|
-
const y = await
|
|
648
|
+
if (typeof e.onBeforeCapture == "function" && await e.onBeforeCapture(), await Te(), typeof e.capture == "function") {
|
|
649
|
+
const y = await ir(await e.capture());
|
|
650
650
|
if (y)
|
|
651
651
|
return y;
|
|
652
652
|
}
|
|
653
|
-
|
|
654
|
-
const { width: c, height: l } =
|
|
653
|
+
i = await rr(), await Te();
|
|
654
|
+
const { width: c, height: l } = nr(), u = {
|
|
655
655
|
cacheBust: !0,
|
|
656
656
|
width: c,
|
|
657
657
|
height: l,
|
|
658
658
|
pixelRatio: Math.min(window.devicePixelRatio || 1, 2),
|
|
659
|
-
filter: (y) => !
|
|
659
|
+
filter: (y) => !Ct(y),
|
|
660
660
|
// 404 / CORS images must not abort the whole capture.
|
|
661
|
-
imagePlaceholder:
|
|
661
|
+
imagePlaceholder: Jn,
|
|
662
662
|
onImageErrorHandler: () => {
|
|
663
663
|
}
|
|
664
664
|
};
|
|
665
665
|
let f = "";
|
|
666
666
|
try {
|
|
667
|
-
f = await
|
|
667
|
+
f = await tt(document.body, u);
|
|
668
668
|
} catch {
|
|
669
|
-
f = await
|
|
669
|
+
f = await tt(document.body, { ...u, skipFonts: !0 });
|
|
670
670
|
}
|
|
671
671
|
if (!V(f))
|
|
672
672
|
throw new Error("Screenshot capture produced an empty image.");
|
|
673
673
|
return f;
|
|
674
674
|
} finally {
|
|
675
675
|
try {
|
|
676
|
-
|
|
676
|
+
i();
|
|
677
677
|
} catch {
|
|
678
678
|
}
|
|
679
|
-
o(),
|
|
679
|
+
o(), a(), r.remove(), tr(), t && (t.style.display = n);
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
|
-
function
|
|
683
|
-
const
|
|
684
|
-
return
|
|
682
|
+
function sr(e = "") {
|
|
683
|
+
const t = String(e || "");
|
|
684
|
+
return t ? /Windows NT/i.test(t) ? "Windows" : /iPhone|iPad|iPod/i.test(t) ? "iOS" : /Mac OS X|Macintosh/i.test(t) ? "macOS" : /Android/i.test(t) ? "Android" : /CrOS/i.test(t) ? "ChromeOS" : /Linux/i.test(t) ? "Linux" : "Other" : "";
|
|
685
685
|
}
|
|
686
|
-
function
|
|
687
|
-
const
|
|
688
|
-
return
|
|
686
|
+
function cr(e = "") {
|
|
687
|
+
const t = String(e || "");
|
|
688
|
+
return t ? /Edg\//i.test(t) ? "Edge" : /OPR\/|Opera/i.test(t) ? "Opera" : /Firefox\//i.test(t) ? "Firefox" : /Chrome\//i.test(t) || /CriOS\//i.test(t) ? "Chrome" : /Safari\//i.test(t) ? "Safari" : "Other" : "";
|
|
689
689
|
}
|
|
690
|
-
function
|
|
691
|
-
const
|
|
690
|
+
function lr(e = {}) {
|
|
691
|
+
const t = navigator.userAgent;
|
|
692
692
|
return {
|
|
693
693
|
url: location.href,
|
|
694
694
|
title: document.title,
|
|
695
|
-
userAgent:
|
|
696
|
-
os:
|
|
697
|
-
browser:
|
|
695
|
+
userAgent: t,
|
|
696
|
+
os: sr(t),
|
|
697
|
+
browser: cr(t),
|
|
698
698
|
language: navigator.language,
|
|
699
699
|
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
700
700
|
viewport: {
|
|
@@ -703,17 +703,17 @@ function or(t = {}) {
|
|
|
703
703
|
dpr: window.devicePixelRatio || 1
|
|
704
704
|
},
|
|
705
705
|
user: {
|
|
706
|
-
userId:
|
|
707
|
-
email:
|
|
708
|
-
displayName:
|
|
706
|
+
userId: e.userId || null,
|
|
707
|
+
email: e.email || null,
|
|
708
|
+
displayName: e.displayName || null
|
|
709
709
|
}
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
|
-
const
|
|
712
|
+
const nt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), rt = {
|
|
713
713
|
id: "userId",
|
|
714
714
|
username: "displayName",
|
|
715
715
|
name: "displayName"
|
|
716
|
-
},
|
|
716
|
+
}, it = /* @__PURE__ */ new Set([
|
|
717
717
|
"endpoint",
|
|
718
718
|
"projectKey",
|
|
719
719
|
"version",
|
|
@@ -726,8 +726,10 @@ const ee = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), ne = {
|
|
|
726
726
|
"kinds",
|
|
727
727
|
"capture",
|
|
728
728
|
"onBeforeCapture",
|
|
729
|
+
"onOpen",
|
|
730
|
+
"onClose",
|
|
729
731
|
"displayLink"
|
|
730
|
-
]),
|
|
732
|
+
]), at = {
|
|
731
733
|
slug: "Use init({ name }) for a per-app report prefix (same idea as package.json name). slug is not a widget option.",
|
|
732
734
|
projectSlug: "Use init({ name }) for a per-app report prefix. projectSlug is not a widget option.",
|
|
733
735
|
project: "Pass projectKey (nfk_…) from Showfully Notefully settings — there is no project option on the widget.",
|
|
@@ -736,76 +738,76 @@ const ee = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), ne = {
|
|
|
736
738
|
email: "Pass people via Notefully.identify({ userId, email, displayName }), not init().",
|
|
737
739
|
displayName: "Pass people via Notefully.identify({ userId, email, displayName }), not init()."
|
|
738
740
|
};
|
|
739
|
-
function
|
|
740
|
-
const n =
|
|
741
|
-
for (const o of
|
|
742
|
-
Object.prototype.hasOwnProperty.call(r, o) && (
|
|
743
|
-
for (const [o, c] of Object.entries(
|
|
744
|
-
Object.prototype.hasOwnProperty.call(r, o) && (Object.prototype.hasOwnProperty.call(
|
|
741
|
+
function ur(e = {}, t = {}) {
|
|
742
|
+
const n = t.warn || Lt, r = e && typeof e == "object" ? e : {}, a = {}, i = [];
|
|
743
|
+
for (const o of nt)
|
|
744
|
+
Object.prototype.hasOwnProperty.call(r, o) && (a[o] = r[o]);
|
|
745
|
+
for (const [o, c] of Object.entries(rt))
|
|
746
|
+
Object.prototype.hasOwnProperty.call(r, o) && (Object.prototype.hasOwnProperty.call(a, c) || (a[c] = r[o]));
|
|
745
747
|
for (const o of Object.keys(r))
|
|
746
|
-
|
|
747
|
-
if (
|
|
748
|
-
const o =
|
|
748
|
+
nt.has(o) || Object.prototype.hasOwnProperty.call(rt, o) || i.push(o);
|
|
749
|
+
if (i.length) {
|
|
750
|
+
const o = i.some((c) => c === "name" || c === "slug" || c === "projectSlug") ? " Pass the package/report name via Notefully.init({ name }), not identify()." : "";
|
|
749
751
|
n(
|
|
750
|
-
`Notefully.identify: ignoring unknown key(s): ${
|
|
752
|
+
`Notefully.identify: ignoring unknown key(s): ${i.join(", ")}. Supported: userId, email, displayName (aliases: id → userId; username/name → displayName).` + o
|
|
751
753
|
);
|
|
752
754
|
}
|
|
753
|
-
return
|
|
754
|
-
}
|
|
755
|
-
function
|
|
756
|
-
const n =
|
|
757
|
-
if (
|
|
758
|
-
for (const
|
|
759
|
-
if (
|
|
760
|
-
n(`Notefully.init: ignoring "${
|
|
755
|
+
return a;
|
|
756
|
+
}
|
|
757
|
+
function dr(e = {}, t = {}) {
|
|
758
|
+
const n = t.warn || Lt, r = e && typeof e == "object" ? e : {}, a = Object.keys(r).filter((i) => !it.has(i));
|
|
759
|
+
if (a.length)
|
|
760
|
+
for (const i of a) {
|
|
761
|
+
if (at[i]) {
|
|
762
|
+
n(`Notefully.init: ignoring "${i}". ${at[i]}`);
|
|
761
763
|
continue;
|
|
762
764
|
}
|
|
763
765
|
n(
|
|
764
|
-
`Notefully.init: ignoring unknown key "${
|
|
766
|
+
`Notefully.init: ignoring unknown key "${i}". Supported: ${[...it].join(", ")}.`
|
|
765
767
|
);
|
|
766
768
|
}
|
|
767
769
|
}
|
|
768
|
-
function
|
|
769
|
-
typeof console < "u" && typeof console.warn == "function" && console.warn(
|
|
770
|
+
function Lt(e) {
|
|
771
|
+
typeof console < "u" && typeof console.warn == "function" && console.warn(e);
|
|
770
772
|
}
|
|
771
|
-
const
|
|
772
|
-
function
|
|
773
|
-
const
|
|
773
|
+
const fr = 80;
|
|
774
|
+
function hr() {
|
|
775
|
+
const e = [], t = {};
|
|
774
776
|
let n = !1;
|
|
775
|
-
const r = (
|
|
777
|
+
const r = (i, o) => {
|
|
776
778
|
let c = "";
|
|
777
779
|
try {
|
|
778
780
|
c = o.map((l) => l instanceof Error ? l.stack || l.message : typeof l == "string" ? l : JSON.stringify(l)).join(" ");
|
|
779
781
|
} catch {
|
|
780
782
|
c = String(o[0]);
|
|
781
783
|
}
|
|
782
|
-
|
|
783
|
-
level:
|
|
784
|
+
e.push({
|
|
785
|
+
level: i,
|
|
784
786
|
text: c.slice(0, 2e3),
|
|
785
787
|
at: Date.now()
|
|
786
|
-
}),
|
|
788
|
+
}), e.length > fr && e.shift();
|
|
787
789
|
};
|
|
788
790
|
return {
|
|
789
791
|
hook: () => {
|
|
790
|
-
n || typeof window > "u" || (n = !0, ["log", "info", "warn", "error"].forEach((
|
|
791
|
-
|
|
792
|
-
r(
|
|
792
|
+
n || typeof window > "u" || (n = !0, ["log", "info", "warn", "error"].forEach((i) => {
|
|
793
|
+
t[i] = console[i].bind(console), console[i] = (...o) => {
|
|
794
|
+
r(i, o), t[i](...o);
|
|
793
795
|
};
|
|
794
|
-
}), window.addEventListener("error", (
|
|
795
|
-
r("error", [
|
|
796
|
-
}), window.addEventListener("unhandledrejection", (
|
|
797
|
-
r("error", [
|
|
796
|
+
}), window.addEventListener("error", (i) => {
|
|
797
|
+
r("error", [i.message || "window.error"]);
|
|
798
|
+
}), window.addEventListener("unhandledrejection", (i) => {
|
|
799
|
+
r("error", [i.reason || "unhandledrejection"]);
|
|
798
800
|
}));
|
|
799
801
|
},
|
|
800
802
|
snapshot() {
|
|
801
|
-
return
|
|
803
|
+
return e.slice();
|
|
802
804
|
}
|
|
803
805
|
};
|
|
804
806
|
}
|
|
805
|
-
function
|
|
806
|
-
const
|
|
807
|
+
function pr(e) {
|
|
808
|
+
const t = window.SpeechRecognition || window.webkitSpeechRecognition;
|
|
807
809
|
let n = null, r = !1;
|
|
808
|
-
const
|
|
810
|
+
const a = () => {
|
|
809
811
|
if (r = !1, n)
|
|
810
812
|
try {
|
|
811
813
|
n.stop();
|
|
@@ -814,40 +816,40 @@ function dr(t) {
|
|
|
814
816
|
};
|
|
815
817
|
return {
|
|
816
818
|
start: () => {
|
|
817
|
-
if (!
|
|
819
|
+
if (!t)
|
|
818
820
|
throw new Error("Speech recognition is not supported in this browser.");
|
|
819
|
-
return r ? (
|
|
821
|
+
return r ? (a(), !1) : (n = new t(), n.continuous = !0, n.interimResults = !0, n.lang = navigator.language || "en-US", n.onresult = (o) => {
|
|
820
822
|
let c = "";
|
|
821
823
|
for (let l = o.resultIndex; l < o.results.length; l += 1)
|
|
822
824
|
o.results[l].isFinal && (c += o.results[l][0].transcript);
|
|
823
|
-
c &&
|
|
825
|
+
c && e(c);
|
|
824
826
|
}, n.onerror = () => {
|
|
825
827
|
r = !1;
|
|
826
828
|
}, n.onend = () => {
|
|
827
829
|
r = !1;
|
|
828
830
|
}, n.start(), r = !0, !0);
|
|
829
831
|
},
|
|
830
|
-
stop:
|
|
831
|
-
isSupported: () => !!
|
|
832
|
+
stop: a,
|
|
833
|
+
isSupported: () => !!t,
|
|
832
834
|
isActive: () => r
|
|
833
835
|
};
|
|
834
836
|
}
|
|
835
|
-
const
|
|
836
|
-
function
|
|
837
|
-
let r = null,
|
|
837
|
+
const yr = 60 * 1e3;
|
|
838
|
+
function mr({ onStart: e, onStop: t, onError: n }) {
|
|
839
|
+
let r = null, a = null, i = [], o = null;
|
|
838
840
|
const c = () => {
|
|
839
|
-
if (o && (clearTimeout(o), o = null),
|
|
841
|
+
if (o && (clearTimeout(o), o = null), a && a.state !== "inactive")
|
|
840
842
|
try {
|
|
841
|
-
|
|
843
|
+
a.stop();
|
|
842
844
|
} catch {
|
|
843
845
|
}
|
|
844
846
|
r && (r.getTracks().forEach((f) => f.stop()), r = null);
|
|
845
847
|
}, l = () => {
|
|
846
|
-
if (
|
|
847
|
-
|
|
848
|
+
if (a && a.state === "recording") {
|
|
849
|
+
a.stop();
|
|
848
850
|
return;
|
|
849
851
|
}
|
|
850
|
-
c(),
|
|
852
|
+
c(), t(null);
|
|
851
853
|
};
|
|
852
854
|
return { start: async () => {
|
|
853
855
|
var f, y;
|
|
@@ -858,195 +860,214 @@ function hr({ onStart: t, onStop: e, onError: n }) {
|
|
|
858
860
|
audio: !1,
|
|
859
861
|
preferCurrentTab: !0,
|
|
860
862
|
selfBrowserSurface: "include"
|
|
861
|
-
}),
|
|
863
|
+
}), i = [], a = new MediaRecorder(r, {
|
|
862
864
|
mimeType: MediaRecorder.isTypeSupported("video/webm;codecs=vp9") ? "video/webm;codecs=vp9" : "video/webm"
|
|
863
|
-
}),
|
|
864
|
-
|
|
865
|
-
},
|
|
866
|
-
const
|
|
867
|
-
c(),
|
|
868
|
-
}, (y = r.getVideoTracks()[0]) == null || y.addEventListener("ended", () => l()),
|
|
865
|
+
}), a.ondataavailable = (m) => {
|
|
866
|
+
m.data && m.data.size && i.push(m.data);
|
|
867
|
+
}, a.onstop = () => {
|
|
868
|
+
const m = i.length ? new Blob(i, { type: a.mimeType || "video/webm" }) : null;
|
|
869
|
+
c(), t(m);
|
|
870
|
+
}, (y = r.getVideoTracks()[0]) == null || y.addEventListener("ended", () => l()), a.start(), o = setTimeout(l, yr);
|
|
869
871
|
}, stop: l };
|
|
870
872
|
}
|
|
871
|
-
function
|
|
872
|
-
const
|
|
873
|
+
function gr() {
|
|
874
|
+
const e = /* @__PURE__ */ new Set();
|
|
873
875
|
return {
|
|
874
876
|
alloc() {
|
|
875
|
-
let
|
|
876
|
-
for (;
|
|
877
|
-
|
|
878
|
-
return
|
|
877
|
+
let t = 1;
|
|
878
|
+
for (; e.has(t); )
|
|
879
|
+
t += 1;
|
|
880
|
+
return e.add(t), t;
|
|
879
881
|
},
|
|
880
|
-
free(
|
|
881
|
-
const n = Number(
|
|
882
|
-
Number.isInteger(n) && n > 0 &&
|
|
882
|
+
free(t) {
|
|
883
|
+
const n = Number(t);
|
|
884
|
+
Number.isInteger(n) && n > 0 && e.delete(n);
|
|
883
885
|
},
|
|
884
886
|
peekUsed() {
|
|
885
|
-
return [...
|
|
887
|
+
return [...e].sort((t, n) => t - n);
|
|
886
888
|
}
|
|
887
889
|
};
|
|
888
890
|
}
|
|
889
|
-
const
|
|
890
|
-
function
|
|
891
|
-
const
|
|
892
|
-
let
|
|
891
|
+
const Ae = { x: 0, y: 0, w: 1, h: 1 };
|
|
892
|
+
function Ue() {
|
|
893
|
+
const e = gr();
|
|
894
|
+
let t = [], n = { ...Ae }, r = 1;
|
|
893
895
|
return {
|
|
894
|
-
list: () =>
|
|
895
|
-
all: () =>
|
|
896
|
+
list: () => t.filter((i) => br(i, n)),
|
|
897
|
+
all: () => t.slice(),
|
|
896
898
|
crop: () => ({ ...n }),
|
|
897
|
-
setCrop(
|
|
898
|
-
return n =
|
|
899
|
+
setCrop(i) {
|
|
900
|
+
return n = vr(i), n;
|
|
899
901
|
},
|
|
900
902
|
resetCrop() {
|
|
901
|
-
return n = { ...
|
|
903
|
+
return n = { ...Ae }, n;
|
|
902
904
|
},
|
|
903
905
|
isCropped() {
|
|
904
906
|
return n.x > 1e-6 || n.y > 1e-6 || n.w < 1 - 1e-6 || n.h < 1 - 1e-6;
|
|
905
907
|
},
|
|
906
|
-
add(
|
|
908
|
+
add(i, o) {
|
|
907
909
|
const c = {
|
|
908
910
|
id: `s${r++}`,
|
|
909
|
-
type:
|
|
910
|
-
number:
|
|
911
|
+
type: i,
|
|
912
|
+
number: e.alloc(),
|
|
911
913
|
x: 0.2,
|
|
912
914
|
y: 0.2,
|
|
913
|
-
w:
|
|
914
|
-
h:
|
|
915
|
+
w: i === "arrow" ? 0.2 : 0.22,
|
|
916
|
+
h: i === "arrow" ? 0.05 : 0.16,
|
|
915
917
|
x2: 0.4,
|
|
916
918
|
y2: 0.28,
|
|
917
919
|
...o
|
|
918
920
|
};
|
|
919
|
-
return
|
|
921
|
+
return t.push(c), c;
|
|
920
922
|
},
|
|
921
|
-
update(
|
|
922
|
-
const c =
|
|
923
|
+
update(i, o) {
|
|
924
|
+
const c = t.find((l) => l.id === i);
|
|
923
925
|
return c ? (Object.assign(c, o), c) : null;
|
|
924
926
|
},
|
|
925
|
-
remove(
|
|
926
|
-
const o =
|
|
927
|
+
remove(i) {
|
|
928
|
+
const o = t.findIndex((l) => l.id === i);
|
|
927
929
|
if (o < 0)
|
|
928
930
|
return null;
|
|
929
|
-
const [c] =
|
|
930
|
-
return
|
|
931
|
+
const [c] = t.splice(o, 1);
|
|
932
|
+
return e.free(c.number), c;
|
|
931
933
|
},
|
|
932
934
|
reset() {
|
|
933
|
-
for (
|
|
934
|
-
|
|
935
|
+
for (t = [], n = { ...Ae }, r = 1; e.peekUsed().length; )
|
|
936
|
+
e.free(e.peekUsed()[0]);
|
|
935
937
|
}
|
|
936
938
|
};
|
|
937
939
|
}
|
|
938
|
-
function
|
|
939
|
-
const
|
|
940
|
-
return
|
|
940
|
+
function wr(e, t) {
|
|
941
|
+
const n = Number(t == null ? void 0 : t.w) || 1, r = Number(t == null ? void 0 : t.h) || 1, a = Number(t == null ? void 0 : t.x) || 0, i = Number(t == null ? void 0 : t.y) || 0;
|
|
942
|
+
return (Array.isArray(e) ? e : []).map((o) => {
|
|
943
|
+
const c = {
|
|
944
|
+
...o,
|
|
945
|
+
x: (o.x - a) / n,
|
|
946
|
+
y: (o.y - i) / r,
|
|
947
|
+
w: (o.w || 0) / n,
|
|
948
|
+
h: (o.h || 0) / r
|
|
949
|
+
};
|
|
950
|
+
return Number.isFinite(o.x2) && (c.x2 = (o.x2 - a) / n), Number.isFinite(o.y2) && (c.y2 = (o.y2 - i) / r), c;
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
function vr(e) {
|
|
954
|
+
const t = Math.min(Math.max(e.x, 0), 0.95), n = Math.min(Math.max(e.y, 0), 0.95), r = Math.min(Math.max(e.w, 0.05), 1 - t), a = Math.min(Math.max(e.h, 0.05), 1 - n);
|
|
955
|
+
return { x: t, y: n, w: r, h: a };
|
|
941
956
|
}
|
|
942
|
-
function
|
|
943
|
-
const n =
|
|
944
|
-
return n >=
|
|
957
|
+
function br(e, t) {
|
|
958
|
+
const n = e.type === "arrow" ? (e.x + (e.x2 ?? e.x)) / 2 : e.x + (e.w || 0) / 2, r = e.type === "arrow" ? (e.y + (e.y2 ?? e.y)) / 2 : e.y + (e.h || 0) / 2;
|
|
959
|
+
return n >= t.x && r >= t.y && n <= t.x + t.w && r <= t.y + t.h;
|
|
945
960
|
}
|
|
946
|
-
function
|
|
947
|
-
const
|
|
961
|
+
function _e(e) {
|
|
962
|
+
const t = Math.max(1, Number(e) || 1);
|
|
948
963
|
return {
|
|
949
|
-
stroke: Math.max(2,
|
|
950
|
-
badgeRadius: Math.max(8,
|
|
951
|
-
fontSize: Math.max(10,
|
|
952
|
-
arrowHead: Math.max(8,
|
|
964
|
+
stroke: Math.max(2, t * 75e-4),
|
|
965
|
+
badgeRadius: Math.max(8, t * 0.025),
|
|
966
|
+
fontSize: Math.max(10, t * 0.0275),
|
|
967
|
+
arrowHead: Math.max(8, t * 0.035),
|
|
953
968
|
arrowHeadAngle: 0.4
|
|
954
969
|
};
|
|
955
970
|
}
|
|
956
|
-
function
|
|
957
|
-
stickers:
|
|
971
|
+
function Sr(e, {
|
|
972
|
+
stickers: t = [],
|
|
958
973
|
crop: n = { x: 0, y: 0, w: 1, h: 1 },
|
|
959
974
|
width: r,
|
|
960
|
-
height:
|
|
961
|
-
colors:
|
|
975
|
+
height: a,
|
|
976
|
+
colors: i = {}
|
|
962
977
|
}) {
|
|
963
|
-
const o =
|
|
964
|
-
|
|
965
|
-
const f =
|
|
978
|
+
const o = i.mark || "#fdd341", c = i.markText || "#2a2140", l = _e(r);
|
|
979
|
+
e.save(), e.lineWidth = l.stroke, e.lineCap = "round", e.lineJoin = "round", e.strokeStyle = o, e.fillStyle = o, e.font = `700 ${Math.round(l.fontSize)}px ui-sans-serif, system-ui, sans-serif`, t.forEach((u) => {
|
|
980
|
+
const f = Pe(u.x, n, r), y = Ie(u.y, n, a), m = u.w / n.w * r, w = u.h / n.h * a, x = l.stroke / 2;
|
|
966
981
|
if (u.type === "rect")
|
|
967
|
-
|
|
982
|
+
e.strokeRect(
|
|
968
983
|
f + x,
|
|
969
984
|
y + x,
|
|
970
|
-
Math.max(0,
|
|
985
|
+
Math.max(0, m - l.stroke),
|
|
971
986
|
Math.max(0, w - l.stroke)
|
|
972
987
|
);
|
|
973
988
|
else if (u.type === "circle")
|
|
974
|
-
|
|
975
|
-
f +
|
|
989
|
+
e.beginPath(), e.ellipse(
|
|
990
|
+
f + m / 2,
|
|
976
991
|
y + w / 2,
|
|
977
|
-
Math.max(0.5,
|
|
992
|
+
Math.max(0.5, m / 2 - x),
|
|
978
993
|
Math.max(0.5, w / 2 - x),
|
|
979
994
|
0,
|
|
980
995
|
0,
|
|
981
996
|
Math.PI * 2
|
|
982
|
-
),
|
|
997
|
+
), e.stroke();
|
|
983
998
|
else if (u.type === "arrow") {
|
|
984
|
-
const
|
|
985
|
-
|
|
999
|
+
const k = Pe(u.x2 ?? u.x + u.w, n, r), H = Ie(u.y2 ?? u.y, n, a);
|
|
1000
|
+
Er(e, f, y, k, H, l);
|
|
986
1001
|
}
|
|
987
1002
|
if (u.number == null || u.number === "")
|
|
988
1003
|
return;
|
|
989
|
-
const C =
|
|
990
|
-
|
|
991
|
-
}),
|
|
1004
|
+
const C = xr(u, n, r, a, f, y, m), O = String(u.number);
|
|
1005
|
+
e.beginPath(), e.arc(C.x, C.y, l.badgeRadius, 0, Math.PI * 2), e.fillStyle = o, e.fill(), e.fillStyle = c, e.textAlign = "center", e.textBaseline = "middle", e.fillText(O, C.x, C.y + 0.5), e.fillStyle = o;
|
|
1006
|
+
}), e.restore();
|
|
992
1007
|
}
|
|
993
|
-
function
|
|
994
|
-
return (
|
|
1008
|
+
function Pe(e, t, n) {
|
|
1009
|
+
return (e - t.x) / t.w * n;
|
|
995
1010
|
}
|
|
996
|
-
function
|
|
997
|
-
return (
|
|
1011
|
+
function Ie(e, t, n) {
|
|
1012
|
+
return (e - t.y) / t.h * n;
|
|
998
1013
|
}
|
|
999
|
-
function
|
|
1000
|
-
if (
|
|
1001
|
-
const c =
|
|
1014
|
+
function xr(e, t, n, r, a, i, o) {
|
|
1015
|
+
if (e.type === "arrow") {
|
|
1016
|
+
const c = Pe(e.x2 ?? e.x + e.w, t, n), l = Ie(e.y2 ?? e.y, t, r);
|
|
1002
1017
|
return {
|
|
1003
|
-
x: (
|
|
1004
|
-
y: (
|
|
1018
|
+
x: (a + c) / 2,
|
|
1019
|
+
y: (i + l) / 2
|
|
1005
1020
|
};
|
|
1006
1021
|
}
|
|
1007
|
-
return { x:
|
|
1022
|
+
return { x: a + o / 2, y: i };
|
|
1008
1023
|
}
|
|
1009
|
-
function
|
|
1010
|
-
const
|
|
1011
|
-
x: l - o * Math.cos(
|
|
1012
|
-
y: u - o * Math.sin(
|
|
1024
|
+
function kt(e, t, n, r, a) {
|
|
1025
|
+
const i = Math.atan2(r - t, n - e), o = a.arrowHead, c = Math.min(a.stroke, o * 0.2), l = n, u = r, f = n - Math.cos(i) * o, y = r - Math.sin(i) * o, m = {
|
|
1026
|
+
x: l - o * Math.cos(i - a.arrowHeadAngle),
|
|
1027
|
+
y: u - o * Math.sin(i - a.arrowHeadAngle)
|
|
1013
1028
|
}, w = {
|
|
1014
|
-
x: l - o * Math.cos(
|
|
1015
|
-
y: u - o * Math.sin(
|
|
1029
|
+
x: l - o * Math.cos(i + a.arrowHeadAngle),
|
|
1030
|
+
y: u - o * Math.sin(i + a.arrowHeadAngle)
|
|
1016
1031
|
}, x = {
|
|
1017
|
-
x: n - Math.cos(
|
|
1018
|
-
y: r - Math.sin(
|
|
1032
|
+
x: n - Math.cos(i) * c,
|
|
1033
|
+
y: r - Math.sin(i) * c
|
|
1019
1034
|
};
|
|
1020
|
-
return { angle:
|
|
1035
|
+
return { angle: i, tipX: l, tipY: u, baseX: f, baseY: y, left: m, right: w, shaftEnd: x };
|
|
1036
|
+
}
|
|
1037
|
+
function Er(e, t, n, r, a, i) {
|
|
1038
|
+
const o = kt(t, n, r, a, i);
|
|
1039
|
+
e.beginPath(), e.moveTo(t, n), e.lineTo(o.shaftEnd.x, o.shaftEnd.y), e.stroke(), e.beginPath(), e.moveTo(o.tipX, o.tipY), e.lineTo(o.left.x, o.left.y), e.lineTo(o.right.x, o.right.y), e.closePath(), e.fill();
|
|
1021
1040
|
}
|
|
1022
|
-
function
|
|
1023
|
-
|
|
1024
|
-
t.beginPath(), t.moveTo(e, n), t.lineTo(o.shaftEnd.x, o.shaftEnd.y), t.stroke(), t.beginPath(), t.moveTo(o.tipX, o.tipY), t.lineTo(o.left.x, o.left.y), t.lineTo(o.right.x, o.right.y), t.closePath(), t.fill();
|
|
1041
|
+
function Cr(e, t) {
|
|
1042
|
+
return Mt(e, t, [], {});
|
|
1025
1043
|
}
|
|
1026
|
-
function
|
|
1027
|
-
return
|
|
1044
|
+
function Ar(e, t, n, r = {}) {
|
|
1045
|
+
return Mt(e, t, n, r);
|
|
1046
|
+
}
|
|
1047
|
+
function Mt(e, t, n, r) {
|
|
1048
|
+
return new Promise((a, i) => {
|
|
1028
1049
|
const o = new Image();
|
|
1029
1050
|
o.onload = () => {
|
|
1030
|
-
const c = Math.round(
|
|
1051
|
+
const c = Math.round(t.x * o.width), l = Math.round(t.y * o.height), u = Math.max(1, Math.round(t.w * o.width)), f = Math.max(1, Math.round(t.h * o.height)), y = document.createElement("canvas");
|
|
1031
1052
|
y.width = u, y.height = f;
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1053
|
+
const m = y.getContext("2d");
|
|
1054
|
+
m.drawImage(o, c, l, u, f, 0, 0, u, f), n != null && n.length && Sr(m, {
|
|
1034
1055
|
stickers: n,
|
|
1035
|
-
crop:
|
|
1056
|
+
crop: t,
|
|
1036
1057
|
width: u,
|
|
1037
1058
|
height: f,
|
|
1038
1059
|
colors: r
|
|
1039
1060
|
}), y.toBlob((w) => {
|
|
1040
1061
|
if (!w) {
|
|
1041
|
-
|
|
1062
|
+
i(new Error("Could not encode screenshot"));
|
|
1042
1063
|
return;
|
|
1043
1064
|
}
|
|
1044
|
-
|
|
1065
|
+
a(w);
|
|
1045
1066
|
}, "image/png");
|
|
1046
|
-
}, o.onerror = () =>
|
|
1067
|
+
}, o.onerror = () => i(new Error("Could not load screenshot")), o.src = e;
|
|
1047
1068
|
});
|
|
1048
1069
|
}
|
|
1049
|
-
const
|
|
1070
|
+
const Lr = [
|
|
1050
1071
|
{ key: "url", label: "URL" },
|
|
1051
1072
|
{ key: "title", label: "Title" },
|
|
1052
1073
|
{ key: "userAgent", label: "User agent" },
|
|
@@ -1057,120 +1078,120 @@ const Sr = [
|
|
|
1057
1078
|
{ key: "viewport", label: "Viewport" },
|
|
1058
1079
|
{ key: "user", label: "User" }
|
|
1059
1080
|
];
|
|
1060
|
-
function
|
|
1061
|
-
return !
|
|
1081
|
+
function kr(e) {
|
|
1082
|
+
return !e || typeof e != "object" ? !1 : !!(e.userId || e.email || e.displayName);
|
|
1062
1083
|
}
|
|
1063
|
-
function
|
|
1064
|
-
const
|
|
1065
|
-
for (const n of
|
|
1066
|
-
const r =
|
|
1067
|
-
r == null || r === "" || n.key === "user" && !
|
|
1084
|
+
function Mr(e = {}) {
|
|
1085
|
+
const t = [];
|
|
1086
|
+
for (const n of Lr) {
|
|
1087
|
+
const r = e[n.key];
|
|
1088
|
+
r == null || r === "" || n.key === "user" && !kr(r) || t.push({
|
|
1068
1089
|
key: n.key,
|
|
1069
1090
|
label: n.label,
|
|
1070
1091
|
value: r,
|
|
1071
1092
|
redacted: !1
|
|
1072
1093
|
});
|
|
1073
1094
|
}
|
|
1074
|
-
return
|
|
1095
|
+
return t;
|
|
1075
1096
|
}
|
|
1076
|
-
function
|
|
1077
|
-
return
|
|
1078
|
-
id: `log-${n}-${
|
|
1079
|
-
level:
|
|
1080
|
-
text: String(
|
|
1081
|
-
at:
|
|
1097
|
+
function $r(e = []) {
|
|
1098
|
+
return e.map((t, n) => ({
|
|
1099
|
+
id: `log-${n}-${t.at || 0}`,
|
|
1100
|
+
level: t.level || "log",
|
|
1101
|
+
text: String(t.text || ""),
|
|
1102
|
+
at: t.at || 0,
|
|
1082
1103
|
redacted: !1
|
|
1083
1104
|
}));
|
|
1084
1105
|
}
|
|
1085
|
-
function
|
|
1086
|
-
if (!
|
|
1106
|
+
function Rr(e = []) {
|
|
1107
|
+
if (!e.length)
|
|
1087
1108
|
return { checked: !1, indeterminate: !1 };
|
|
1088
|
-
const
|
|
1089
|
-
return
|
|
1109
|
+
const t = e.filter((n) => n.redacted).length;
|
|
1110
|
+
return t === 0 ? { checked: !1, indeterminate: !1 } : t === e.length ? { checked: !0, indeterminate: !1 } : { checked: !1, indeterminate: !0 };
|
|
1090
1111
|
}
|
|
1091
|
-
function
|
|
1092
|
-
|
|
1093
|
-
n.redacted = !!
|
|
1112
|
+
function he(e, t) {
|
|
1113
|
+
e.forEach((n) => {
|
|
1114
|
+
n.redacted = !!t;
|
|
1094
1115
|
});
|
|
1095
1116
|
}
|
|
1096
|
-
function
|
|
1097
|
-
const
|
|
1098
|
-
return r &&
|
|
1117
|
+
function Tr(e = {}) {
|
|
1118
|
+
const t = e.diagnostics || [], n = e.logs || [], r = t.some((i) => !i.redacted), a = n.length > 0 && n.some((i) => !i.redacted);
|
|
1119
|
+
return r && a ? "Also sending logs and diagnostic information" : r ? "Also sending diagnostic information" : a ? "Also sending logs" : "";
|
|
1099
1120
|
}
|
|
1100
|
-
function
|
|
1101
|
-
if (
|
|
1121
|
+
function Pr(e) {
|
|
1122
|
+
if (e == null)
|
|
1102
1123
|
return "";
|
|
1103
|
-
if (typeof
|
|
1104
|
-
return String(
|
|
1124
|
+
if (typeof e == "string" || typeof e == "number" || typeof e == "boolean")
|
|
1125
|
+
return String(e);
|
|
1105
1126
|
try {
|
|
1106
|
-
return JSON.stringify(
|
|
1127
|
+
return JSON.stringify(e);
|
|
1107
1128
|
} catch {
|
|
1108
|
-
return String(
|
|
1129
|
+
return String(e);
|
|
1109
1130
|
}
|
|
1110
1131
|
}
|
|
1111
|
-
function
|
|
1112
|
-
const
|
|
1113
|
-
|
|
1114
|
-
for (const r of
|
|
1115
|
-
r.redacted || (
|
|
1116
|
-
const n = (
|
|
1132
|
+
function Ir(e = {}) {
|
|
1133
|
+
const t = {};
|
|
1134
|
+
e.author != null && e.author !== "" && (t.author = e.author);
|
|
1135
|
+
for (const r of e.diagnostics || [])
|
|
1136
|
+
r.redacted || (t[r.key] = r.value);
|
|
1137
|
+
const n = (e.logs || []).filter((r) => !r.redacted).map((r) => ({
|
|
1117
1138
|
level: r.level,
|
|
1118
1139
|
text: r.text,
|
|
1119
1140
|
at: r.at
|
|
1120
1141
|
}));
|
|
1121
|
-
return
|
|
1142
|
+
return t.console = n, t;
|
|
1122
1143
|
}
|
|
1123
|
-
const
|
|
1144
|
+
const W = [
|
|
1124
1145
|
{ id: "bug", label: "Bug" },
|
|
1125
1146
|
{ id: "idea", label: "Idea" },
|
|
1126
1147
|
{ id: "other", label: "Other" }
|
|
1127
1148
|
];
|
|
1128
|
-
function
|
|
1129
|
-
return String(
|
|
1130
|
-
}
|
|
1131
|
-
function
|
|
1132
|
-
const
|
|
1133
|
-
return
|
|
1134
|
-
}
|
|
1135
|
-
function
|
|
1136
|
-
if (!Array.isArray(
|
|
1137
|
-
return
|
|
1138
|
-
const
|
|
1139
|
-
for (const r of
|
|
1140
|
-
let
|
|
1141
|
-
typeof r == "string" || typeof r == "number" ? (
|
|
1149
|
+
function ot(e) {
|
|
1150
|
+
return String(e || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32);
|
|
1151
|
+
}
|
|
1152
|
+
function Le(e) {
|
|
1153
|
+
const t = String(e || "").trim();
|
|
1154
|
+
return t ? t.split(/[-_\s]+/).filter(Boolean).map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join(" ") : "";
|
|
1155
|
+
}
|
|
1156
|
+
function Or(e) {
|
|
1157
|
+
if (!Array.isArray(e) || !e.length)
|
|
1158
|
+
return W.map((r) => ({ ...r }));
|
|
1159
|
+
const t = /* @__PURE__ */ new Set(), n = [];
|
|
1160
|
+
for (const r of e) {
|
|
1161
|
+
let a = "", i = "";
|
|
1162
|
+
typeof r == "string" || typeof r == "number" ? (a = ot(r), i = Le(a)) : r && typeof r == "object" && (a = ot(r.id ?? r.value ?? r.kind), i = String(r.label || r.name || Le(a)).trim() || Le(a)), !(!a || t.has(a)) && (t.add(a), n.push({ id: a, label: i }));
|
|
1142
1163
|
}
|
|
1143
|
-
return n.length ? n :
|
|
1164
|
+
return n.length ? n : W.map((r) => ({ ...r }));
|
|
1144
1165
|
}
|
|
1145
|
-
function
|
|
1166
|
+
function be(e) {
|
|
1146
1167
|
var n;
|
|
1147
|
-
const
|
|
1148
|
-
return
|
|
1168
|
+
const t = Array.isArray(e) && e.length ? e : W;
|
|
1169
|
+
return t.some((r) => r.id === "bug") ? "bug" : ((n = t[0]) == null ? void 0 : n.id) || "other";
|
|
1149
1170
|
}
|
|
1150
|
-
const
|
|
1171
|
+
const Br = ["maker", "all-business", "brighter-day", "quiet-night"], $t = "maker", Dr = /* @__PURE__ */ new Set(["crop", "arrow", "rect", "circle"]), Oe = 0.02, st = 0.05, Hr = `
|
|
1151
1172
|
<svg class="nf-launcher-icon" viewBox="0 0 24 24" aria-hidden="true">
|
|
1152
1173
|
<path fill="currentColor" d="M5.2 2.8h9.1A2.7 2.7 0 0 1 17 5.5v8.2c0 .4-.3.7-.7.7h-.1a.7.7 0 0 1-.7-.7V5.5c0-.7-.6-1.3-1.3-1.3H5.2c-.7 0-1.3.6-1.3 1.3v12.2c0 .7.6 1.3 1.3 1.3h6.4a.7.7 0 0 1 0 1.4H5.2A2.7 2.7 0 0 1 2.5 17.7V5.5A2.7 2.7 0 0 1 5.2 2.8zm1.6 4.2a.7.7 0 0 0 0 1.4h6.2a.7.7 0 0 0 0-1.4H6.8zm0 3.2a.7.7 0 0 0 0 1.4h6.2a.7.7 0 0 0 0-1.4H6.8zm0 3.2a.7.7 0 0 0 0 1.4h3.6a.7.7 0 0 0 0-1.4H6.8z"/>
|
|
1153
1174
|
<path fill="currentColor" d="M14.7 13.05 20.2 7.55a1.55 1.55 0 0 1 2.2 2.2l-5.5 5.5-.45 1.9a.6.6 0 0 1-.72.45l-1.9-.45.87-1.9z"/>
|
|
1154
1175
|
</svg>
|
|
1155
1176
|
`;
|
|
1156
|
-
function
|
|
1157
|
-
return `<svg class="nf-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${
|
|
1177
|
+
function R(e) {
|
|
1178
|
+
return `<svg class="nf-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${e}</svg>`;
|
|
1158
1179
|
}
|
|
1159
1180
|
const M = {
|
|
1160
|
-
crop:
|
|
1161
|
-
resetCrop:
|
|
1162
|
-
arrow:
|
|
1163
|
-
rect:
|
|
1164
|
-
circle:
|
|
1165
|
-
discard:
|
|
1166
|
-
recapture:
|
|
1167
|
-
privacy:
|
|
1168
|
-
audio:
|
|
1169
|
-
video:
|
|
1170
|
-
openArrow:
|
|
1171
|
-
},
|
|
1172
|
-
|
|
1173
|
-
const
|
|
1181
|
+
crop: R('<path d="M6 3v5H1M18 21v-5h5M8 5h8a2 2 0 0 1 2 2v8M16 19H8a2 2 0 0 1-2-2V8"/>'),
|
|
1182
|
+
resetCrop: R('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),
|
|
1183
|
+
arrow: R('<path d="M5 19 19 5"/><path d="M9 5h10v10"/>'),
|
|
1184
|
+
rect: R('<rect x="4" y="6" width="16" height="12" rx="1.5"/>'),
|
|
1185
|
+
circle: R('<circle cx="12" cy="12" r="8"/>'),
|
|
1186
|
+
discard: R('<path d="M4 7h16"/><path d="M9 7V5h6v2"/><path d="M6 7l1 13h10l1-13"/>'),
|
|
1187
|
+
recapture: R('<path d="M4 8h3l2-2h6l2 2h3v11H4z"/><circle cx="12" cy="13" r="3.5"/>'),
|
|
1188
|
+
privacy: R('<path d="M8 6h13M8 12h13M8 18h13"/><path d="M3 6h.01M3 12h.01M3 18h.01"/>'),
|
|
1189
|
+
audio: R('<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0"/><path d="M12 18v3"/>'),
|
|
1190
|
+
video: R('<rect x="3" y="7" width="13" height="10" rx="2"/><path d="M16 10.5 21 8v8l-5-2.5z"/>'),
|
|
1191
|
+
openArrow: R('<path d="M5 12h14"/><path d="m13 6 6 6-6 6"/>')
|
|
1192
|
+
}, Rt = hr();
|
|
1193
|
+
Rt.hook();
|
|
1194
|
+
const Tt = 10, Fr = 80, Pt = "notefully.author", It = "notefully.kind", Ot = "notefully.redactSections", Be = "Anonymous";
|
|
1174
1195
|
let d = {
|
|
1175
1196
|
endpoint: "",
|
|
1176
1197
|
projectKey: "",
|
|
@@ -1178,35 +1199,37 @@ let d = {
|
|
|
1178
1199
|
name: "",
|
|
1179
1200
|
targets: null,
|
|
1180
1201
|
hideLauncher: !1,
|
|
1181
|
-
theme:
|
|
1202
|
+
theme: $t,
|
|
1182
1203
|
video: !1,
|
|
1183
|
-
consoleLogLimit:
|
|
1184
|
-
kinds:
|
|
1204
|
+
consoleLogLimit: Tt,
|
|
1205
|
+
kinds: W.map((e) => ({ ...e })),
|
|
1185
1206
|
capture: null,
|
|
1186
1207
|
onBeforeCapture: null,
|
|
1208
|
+
onOpen: null,
|
|
1209
|
+
onClose: null,
|
|
1187
1210
|
displayLink: !1
|
|
1188
|
-
},
|
|
1189
|
-
function h(
|
|
1190
|
-
return p.querySelector(
|
|
1211
|
+
}, ie = !1, ke = !1, B = {}, p = null, s = {}, g = Ue(), P = "", te = "", D = null, z = be(W), _ = null, T = null, b = null, v = null, le = null, X = null, re = null, F = { w: 0, h: 0 }, Me = !1, Se = !1, xe = !1, N = [], I = [], q = !1;
|
|
1212
|
+
function h(e) {
|
|
1213
|
+
return p.querySelector(e);
|
|
1191
1214
|
}
|
|
1192
|
-
function
|
|
1193
|
-
const
|
|
1194
|
-
return
|
|
1215
|
+
function Bt(e) {
|
|
1216
|
+
const t = String(e || "").trim().toLowerCase().replace(/\s+/g, "-");
|
|
1217
|
+
return Br.includes(t) ? t : $t;
|
|
1195
1218
|
}
|
|
1196
|
-
function
|
|
1197
|
-
return p && getComputedStyle(p).getPropertyValue(
|
|
1219
|
+
function ct(e, t) {
|
|
1220
|
+
return p && getComputedStyle(p).getPropertyValue(e).trim() || t;
|
|
1198
1221
|
}
|
|
1199
|
-
async function
|
|
1200
|
-
return (await fetch(
|
|
1222
|
+
async function Nr(e) {
|
|
1223
|
+
return (await fetch(e)).blob();
|
|
1201
1224
|
}
|
|
1202
|
-
function S(
|
|
1203
|
-
s.status && (s.status.textContent =
|
|
1225
|
+
function S(e, t = !1) {
|
|
1226
|
+
s.status && (s.status.textContent = e || "", le && (clearTimeout(le), le = null), e && !t && (le = setTimeout(() => {
|
|
1204
1227
|
s.status.textContent = "";
|
|
1205
1228
|
}, 4e3)));
|
|
1206
1229
|
}
|
|
1207
|
-
function
|
|
1230
|
+
function je() {
|
|
1208
1231
|
return p && document.body.contains(p) || (p = document.createElement("div"), p.id = "notefully", p.innerHTML = `
|
|
1209
|
-
<button class="nf-launcher" type="button" title="Leave a note…" aria-label="Leave a note…">${
|
|
1232
|
+
<button class="nf-launcher" type="button" title="Leave a note…" aria-label="Leave a note…">${Hr}</button>
|
|
1210
1233
|
<div class="nf-dialog" hidden>
|
|
1211
1234
|
<div class="nf-panel">
|
|
1212
1235
|
<div class="nf-panel-body">
|
|
@@ -1285,607 +1308,621 @@ function _t() {
|
|
|
1285
1308
|
resetCrop: h(".nf-reset-crop"),
|
|
1286
1309
|
submit: h(".nf-submit"),
|
|
1287
1310
|
shot: null
|
|
1288
|
-
},
|
|
1311
|
+
}, Ur(), oe()), p;
|
|
1289
1312
|
}
|
|
1290
|
-
function
|
|
1291
|
-
var
|
|
1292
|
-
p && (p.dataset.theme =
|
|
1313
|
+
function oe() {
|
|
1314
|
+
var e;
|
|
1315
|
+
p && (p.dataset.theme = Bt(d.theme), d.hideLauncher ? p.setAttribute("data-nf-hidden-launcher", "") : p.removeAttribute("data-nf-hidden-launcher"), s.video && (s.video.hidden = !d.video), Dt(), (e = s.dialog) != null && e.hidden && pe());
|
|
1293
1316
|
}
|
|
1294
|
-
function
|
|
1317
|
+
function pe() {
|
|
1295
1318
|
s.launcher && (s.launcher.hidden = !!d.hideLauncher);
|
|
1296
1319
|
}
|
|
1297
|
-
function
|
|
1298
|
-
s.launcher.addEventListener("click", () =>
|
|
1299
|
-
|
|
1300
|
-
}), document.addEventListener("keydown",
|
|
1301
|
-
|
|
1302
|
-
}), s.resetCrop.addEventListener("click",
|
|
1303
|
-
const
|
|
1304
|
-
|
|
1305
|
-
const n =
|
|
1306
|
-
n &&
|
|
1307
|
-
}), s.discard.addEventListener("click",
|
|
1308
|
-
|
|
1309
|
-
}), s.restore.addEventListener("click",
|
|
1310
|
-
|
|
1311
|
-
}),
|
|
1312
|
-
}
|
|
1313
|
-
function L(
|
|
1314
|
-
return String(
|
|
1315
|
-
}
|
|
1316
|
-
function
|
|
1317
|
-
const
|
|
1318
|
-
if (!
|
|
1320
|
+
function Ur() {
|
|
1321
|
+
s.launcher.addEventListener("click", () => en()), h(".nf-dialog").addEventListener("click", (t) => {
|
|
1322
|
+
Se && !xe || t.target === s.dialog && ne();
|
|
1323
|
+
}), document.addEventListener("keydown", Xt), p.querySelectorAll(".nf-tool").forEach((t) => {
|
|
1324
|
+
t.addEventListener("click", () => ae(t.dataset.tool));
|
|
1325
|
+
}), s.resetCrop.addEventListener("click", Gr), s.canvas.addEventListener("pointerdown", Wr), s.canvas.addEventListener("dragstart", (t) => t.preventDefault());
|
|
1326
|
+
const e = h(".nf-kind");
|
|
1327
|
+
e && e.addEventListener("click", (t) => {
|
|
1328
|
+
const n = t.target.closest("[data-kind]");
|
|
1329
|
+
n && Ve(n.dataset.kind);
|
|
1330
|
+
}), s.discard.addEventListener("click", Jr), s.recapture.addEventListener("click", () => {
|
|
1331
|
+
Zr().catch((t) => S(t.message || "Recapture failed."));
|
|
1332
|
+
}), s.restore.addEventListener("click", Qr), s.audio.addEventListener("click", ei), s.video.addEventListener("click", ti), s.stop.addEventListener("click", () => re == null ? void 0 : re.stop()), s.privacyChange.addEventListener("click", () => we(!q)), s.privacyDone.addEventListener("click", () => we(!1)), s.privacyScroll.addEventListener("change", fi), h(".nf-submit").addEventListener("click", () => {
|
|
1333
|
+
nn().catch((t) => S(t.message || "Submit failed."));
|
|
1334
|
+
}), Dt(), ae(null);
|
|
1335
|
+
}
|
|
1336
|
+
function L(e) {
|
|
1337
|
+
return String(e || "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1338
|
+
}
|
|
1339
|
+
function Dt() {
|
|
1340
|
+
const e = p == null ? void 0 : p.querySelector(".nf-kind");
|
|
1341
|
+
if (!e)
|
|
1319
1342
|
return;
|
|
1320
|
-
const
|
|
1321
|
-
|
|
1322
|
-
const r =
|
|
1323
|
-
|
|
1343
|
+
const t = Array.isArray(d.kinds) && d.kinds.length ? d.kinds : W;
|
|
1344
|
+
e.innerHTML = t.map((a) => `<button type="button" data-kind="${L(a.id)}">${L(a.label)}</button>`).join("");
|
|
1345
|
+
const r = t.map((a) => a.id).includes(z) ? z : be(t);
|
|
1346
|
+
Ve(r);
|
|
1324
1347
|
}
|
|
1325
|
-
function
|
|
1326
|
-
|
|
1327
|
-
n.dataset.active = String(n.dataset.kind ===
|
|
1328
|
-
}),
|
|
1348
|
+
function Ve(e) {
|
|
1349
|
+
z = (d.kinds || W).map((n) => n.id).includes(e) ? e : be(d.kinds), p == null || p.querySelectorAll("[data-kind]").forEach((n) => {
|
|
1350
|
+
n.dataset.active = String(n.dataset.kind === z);
|
|
1351
|
+
}), jr(z);
|
|
1329
1352
|
}
|
|
1330
|
-
function
|
|
1353
|
+
function _r() {
|
|
1331
1354
|
try {
|
|
1332
|
-
return String(localStorage.getItem(
|
|
1355
|
+
return String(localStorage.getItem(It) || "").trim().toLowerCase();
|
|
1333
1356
|
} catch {
|
|
1334
1357
|
return "";
|
|
1335
1358
|
}
|
|
1336
1359
|
}
|
|
1337
|
-
function
|
|
1338
|
-
const
|
|
1339
|
-
if (
|
|
1360
|
+
function jr(e) {
|
|
1361
|
+
const t = String(e || "").trim().toLowerCase();
|
|
1362
|
+
if (t)
|
|
1340
1363
|
try {
|
|
1341
|
-
localStorage.setItem(
|
|
1364
|
+
localStorage.setItem(It, t);
|
|
1342
1365
|
} catch {
|
|
1343
1366
|
}
|
|
1344
1367
|
}
|
|
1345
|
-
function
|
|
1346
|
-
const
|
|
1347
|
-
return
|
|
1368
|
+
function Vr() {
|
|
1369
|
+
const e = (d.kinds || W).map((n) => n.id), t = _r();
|
|
1370
|
+
return t && e.includes(t) ? t : be(d.kinds);
|
|
1348
1371
|
}
|
|
1349
|
-
function
|
|
1350
|
-
_ =
|
|
1351
|
-
|
|
1352
|
-
}), s.canvas && (s.canvas.dataset.draw = _ ? "true" : "false"), K() &&
|
|
1372
|
+
function ae(e) {
|
|
1373
|
+
_ = Dr.has(e) ? e : null, T = null, p.querySelectorAll(".nf-tool").forEach((t) => {
|
|
1374
|
+
t.dataset.active = String(t.dataset.tool === _);
|
|
1375
|
+
}), s.canvas && (s.canvas.dataset.draw = _ ? "true" : "false"), K() && $();
|
|
1353
1376
|
}
|
|
1354
|
-
function
|
|
1355
|
-
return Math.min(1, Math.max(0,
|
|
1377
|
+
function lt(e) {
|
|
1378
|
+
return Math.min(1, Math.max(0, e));
|
|
1356
1379
|
}
|
|
1357
|
-
function
|
|
1380
|
+
function se() {
|
|
1358
1381
|
return s.shot || s.canvas;
|
|
1359
1382
|
}
|
|
1360
|
-
function
|
|
1361
|
-
const
|
|
1383
|
+
function ye(e) {
|
|
1384
|
+
const t = se().getBoundingClientRect();
|
|
1362
1385
|
return {
|
|
1363
|
-
x:
|
|
1364
|
-
y:
|
|
1386
|
+
x: lt((e.clientX - t.left) / Math.max(t.width, 1)),
|
|
1387
|
+
y: lt((e.clientY - t.top) / Math.max(t.height, 1))
|
|
1365
1388
|
};
|
|
1366
1389
|
}
|
|
1367
|
-
function
|
|
1368
|
-
const
|
|
1369
|
-
return
|
|
1390
|
+
function zr(e) {
|
|
1391
|
+
const t = se().getBoundingClientRect();
|
|
1392
|
+
return e.clientX >= t.left && e.clientX <= t.right && e.clientY >= t.top && e.clientY <= t.bottom;
|
|
1370
1393
|
}
|
|
1371
|
-
function
|
|
1372
|
-
const
|
|
1394
|
+
function Ht(e) {
|
|
1395
|
+
const t = ye(e), n = g.crop();
|
|
1373
1396
|
return {
|
|
1374
|
-
x: n.x +
|
|
1375
|
-
y: n.y +
|
|
1397
|
+
x: n.x + t.x * n.w,
|
|
1398
|
+
y: n.y + t.y * n.h
|
|
1376
1399
|
};
|
|
1377
1400
|
}
|
|
1378
|
-
function
|
|
1379
|
-
const n = Math.min(
|
|
1401
|
+
function Ee(e, t) {
|
|
1402
|
+
const n = Math.min(e.x, t.x), r = Math.min(e.y, t.y);
|
|
1380
1403
|
return {
|
|
1381
1404
|
x: n,
|
|
1382
1405
|
y: r,
|
|
1383
|
-
w: Math.max(
|
|
1384
|
-
h: Math.max(
|
|
1406
|
+
w: Math.max(Oe, Math.abs(t.x - e.x)),
|
|
1407
|
+
h: Math.max(Oe, Math.abs(t.y - e.y))
|
|
1385
1408
|
};
|
|
1386
1409
|
}
|
|
1387
|
-
function
|
|
1388
|
-
p && (
|
|
1410
|
+
function ze(e) {
|
|
1411
|
+
p && (e ? p.dataset.grabbing = "true" : delete p.dataset.grabbing);
|
|
1389
1412
|
}
|
|
1390
|
-
function
|
|
1413
|
+
function $e(e) {
|
|
1391
1414
|
try {
|
|
1392
|
-
s.canvas.setPointerCapture(
|
|
1415
|
+
s.canvas.setPointerCapture(e.pointerId);
|
|
1393
1416
|
} catch {
|
|
1394
1417
|
}
|
|
1395
1418
|
}
|
|
1396
|
-
function Bt() {
|
|
1397
|
-
window.addEventListener("pointermove", He), window.addEventListener("pointerup", yt), window.addEventListener("pointercancel", yt);
|
|
1398
|
-
}
|
|
1399
1419
|
function De() {
|
|
1400
|
-
window.
|
|
1420
|
+
window.addEventListener("pointermove", Nt), window.addEventListener("pointerup", me), window.addEventListener("pointercancel", me);
|
|
1421
|
+
}
|
|
1422
|
+
function Ft() {
|
|
1423
|
+
window.removeEventListener("pointermove", Nt), window.removeEventListener("pointerup", me), window.removeEventListener("pointercancel", me);
|
|
1401
1424
|
}
|
|
1402
|
-
function
|
|
1403
|
-
if (
|
|
1425
|
+
function Wr(e) {
|
|
1426
|
+
if (e.button !== 0 || !K())
|
|
1404
1427
|
return;
|
|
1405
|
-
if (!
|
|
1406
|
-
T = null,
|
|
1428
|
+
if (!e.target.closest(".nf-sticker") && !zr(e)) {
|
|
1429
|
+
T = null, $();
|
|
1407
1430
|
return;
|
|
1408
1431
|
}
|
|
1409
|
-
const
|
|
1432
|
+
const t = e.target.closest(".nf-handle"), n = e.target.closest(".nf-sticker");
|
|
1410
1433
|
if (n && n.dataset.preview !== "true") {
|
|
1411
|
-
|
|
1434
|
+
e.preventDefault(), e.stopPropagation(), T = n.dataset.id, $e(e), Kr({
|
|
1412
1435
|
kind: "sticker",
|
|
1413
1436
|
id: T,
|
|
1414
|
-
dir: (
|
|
1415
|
-
},
|
|
1437
|
+
dir: (t == null ? void 0 : t.dataset.dir) || "move"
|
|
1438
|
+
}, e), $();
|
|
1416
1439
|
return;
|
|
1417
1440
|
}
|
|
1418
1441
|
if (T = null, _ === "crop") {
|
|
1419
|
-
|
|
1442
|
+
e.preventDefault(), $e(e), b = { kind: "crop", start: ye(e), current: ye(e) }, De(), $();
|
|
1420
1443
|
return;
|
|
1421
1444
|
}
|
|
1422
1445
|
if (_ === "arrow" || _ === "rect" || _ === "circle") {
|
|
1423
|
-
|
|
1424
|
-
const r =
|
|
1425
|
-
b = { kind: "sticker", type: _, start: r, current: r },
|
|
1446
|
+
e.preventDefault(), $e(e);
|
|
1447
|
+
const r = Ht(e);
|
|
1448
|
+
b = { kind: "sticker", type: _, start: r, current: r }, De(), $();
|
|
1426
1449
|
return;
|
|
1427
1450
|
}
|
|
1428
|
-
|
|
1451
|
+
$();
|
|
1429
1452
|
}
|
|
1430
|
-
function
|
|
1431
|
-
|
|
1432
|
-
const n =
|
|
1453
|
+
function Kr(e, t) {
|
|
1454
|
+
t.preventDefault(), t.stopPropagation();
|
|
1455
|
+
const n = se().getBoundingClientRect(), r = g.list().find((a) => a.id === e.id);
|
|
1433
1456
|
v = {
|
|
1434
|
-
...
|
|
1435
|
-
startX:
|
|
1436
|
-
startY:
|
|
1437
|
-
crop:
|
|
1457
|
+
...e,
|
|
1458
|
+
startX: t.clientX,
|
|
1459
|
+
startY: t.clientY,
|
|
1460
|
+
crop: g.crop(),
|
|
1438
1461
|
sticker: r ? { ...r } : null,
|
|
1439
1462
|
rect: n
|
|
1440
|
-
},
|
|
1463
|
+
}, ze(e.dir === "move" || e.dir === "start" || e.dir === "end"), De();
|
|
1441
1464
|
}
|
|
1442
|
-
function
|
|
1465
|
+
function Nt(e) {
|
|
1443
1466
|
if (b) {
|
|
1444
|
-
b.current = b.kind === "crop" ?
|
|
1467
|
+
b.current = b.kind === "crop" ? ye(e) : Ht(e), $();
|
|
1445
1468
|
return;
|
|
1446
1469
|
}
|
|
1447
1470
|
if (!v)
|
|
1448
1471
|
return;
|
|
1449
|
-
const
|
|
1472
|
+
const t = (e.clientX - v.startX) / v.rect.width * v.crop.w, n = (e.clientY - v.startY) / v.rect.height * v.crop.h, r = v.sticker;
|
|
1450
1473
|
if (r) {
|
|
1451
1474
|
if (v.dir === "end")
|
|
1452
|
-
|
|
1453
|
-
x2: r.x2 +
|
|
1475
|
+
g.update(r.id, {
|
|
1476
|
+
x2: r.x2 + t,
|
|
1454
1477
|
y2: r.y2 + n
|
|
1455
1478
|
});
|
|
1456
1479
|
else if (v.dir === "start")
|
|
1457
|
-
|
|
1458
|
-
x: r.x +
|
|
1480
|
+
g.update(r.id, {
|
|
1481
|
+
x: r.x + t,
|
|
1459
1482
|
y: r.y + n
|
|
1460
1483
|
});
|
|
1461
1484
|
else if (v.dir === "move")
|
|
1462
|
-
|
|
1463
|
-
x: r.x +
|
|
1485
|
+
g.update(r.id, {
|
|
1486
|
+
x: r.x + t,
|
|
1464
1487
|
y: r.y + n,
|
|
1465
|
-
x2: (r.x2 || r.x) +
|
|
1488
|
+
x2: (r.x2 || r.x) + t,
|
|
1466
1489
|
y2: (r.y2 || r.y) + n
|
|
1467
1490
|
});
|
|
1468
1491
|
else {
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1492
|
+
const a = { x: r.x, y: r.y, w: r.w, h: r.h };
|
|
1493
|
+
qr(a, v.dir, t, n), g.update(r.id, a);
|
|
1471
1494
|
}
|
|
1472
|
-
|
|
1495
|
+
$();
|
|
1473
1496
|
}
|
|
1474
1497
|
}
|
|
1475
|
-
function
|
|
1476
|
-
if (
|
|
1477
|
-
const
|
|
1478
|
-
|
|
1498
|
+
function qr(e, t, n, r) {
|
|
1499
|
+
if (t.includes("e") && (e.w = Math.max(0.04, e.w + n)), t.includes("s") && (e.h = Math.max(0.04, e.h + r)), t.includes("w")) {
|
|
1500
|
+
const a = Math.max(0.04, e.w - n);
|
|
1501
|
+
e.x += e.w - a, e.w = a;
|
|
1479
1502
|
}
|
|
1480
|
-
if (
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1503
|
+
if (t.includes("n")) {
|
|
1504
|
+
const a = Math.max(0.04, e.h - r);
|
|
1505
|
+
e.y += e.h - a, e.h = a;
|
|
1483
1506
|
}
|
|
1484
1507
|
}
|
|
1485
|
-
function
|
|
1486
|
-
if (
|
|
1487
|
-
|
|
1508
|
+
function me(e) {
|
|
1509
|
+
if (Ft(), ze(!1), b) {
|
|
1510
|
+
Xr();
|
|
1488
1511
|
return;
|
|
1489
1512
|
}
|
|
1490
1513
|
if (v) {
|
|
1491
1514
|
if (v.kind === "sticker") {
|
|
1492
|
-
const
|
|
1493
|
-
(
|
|
1515
|
+
const t = s.canvas.getBoundingClientRect();
|
|
1516
|
+
(e.clientX < t.left - 24 || e.clientX > t.right + 24 || e.clientY < t.top - 24 || e.clientY > t.bottom + 24) && (g.remove(v.id), T = null);
|
|
1494
1517
|
}
|
|
1495
|
-
v = null,
|
|
1518
|
+
v = null, $();
|
|
1496
1519
|
}
|
|
1497
1520
|
}
|
|
1498
|
-
function
|
|
1499
|
-
const
|
|
1500
|
-
if (b = null, !
|
|
1521
|
+
function Xr() {
|
|
1522
|
+
const e = b;
|
|
1523
|
+
if (b = null, !e)
|
|
1501
1524
|
return;
|
|
1502
|
-
if (
|
|
1503
|
-
const n =
|
|
1504
|
-
if (Math.abs(
|
|
1505
|
-
|
|
1525
|
+
if (e.kind === "crop") {
|
|
1526
|
+
const n = Ee(e.start, e.current);
|
|
1527
|
+
if (Math.abs(e.current.x - e.start.x) < st || Math.abs(e.current.y - e.start.y) < st) {
|
|
1528
|
+
$();
|
|
1506
1529
|
return;
|
|
1507
1530
|
}
|
|
1508
|
-
const
|
|
1509
|
-
|
|
1510
|
-
x:
|
|
1511
|
-
y:
|
|
1512
|
-
w: n.w *
|
|
1513
|
-
h: n.h *
|
|
1531
|
+
const a = g.crop();
|
|
1532
|
+
g.setCrop({
|
|
1533
|
+
x: a.x + n.x * a.w,
|
|
1534
|
+
y: a.y + n.y * a.h,
|
|
1535
|
+
w: n.w * a.w,
|
|
1536
|
+
h: n.h * a.h
|
|
1514
1537
|
}), Y();
|
|
1515
1538
|
return;
|
|
1516
1539
|
}
|
|
1517
|
-
const
|
|
1518
|
-
|
|
1519
|
-
}
|
|
1520
|
-
function
|
|
1521
|
-
if (
|
|
1522
|
-
const
|
|
1523
|
-
return Math.hypot(
|
|
1524
|
-
x:
|
|
1525
|
-
y:
|
|
1526
|
-
x2:
|
|
1527
|
-
y2:
|
|
1540
|
+
const t = Yr(e);
|
|
1541
|
+
t && (T = t.id), $();
|
|
1542
|
+
}
|
|
1543
|
+
function Yr(e) {
|
|
1544
|
+
if (e.type === "arrow") {
|
|
1545
|
+
const t = e.current.x - e.start.x, n = e.current.y - e.start.y;
|
|
1546
|
+
return Math.hypot(t, n) < Oe ? g.add("arrow", {
|
|
1547
|
+
x: e.start.x,
|
|
1548
|
+
y: e.start.y,
|
|
1549
|
+
x2: e.start.x + 0.12,
|
|
1550
|
+
y2: e.start.y,
|
|
1528
1551
|
w: 0.12,
|
|
1529
1552
|
h: 0.02
|
|
1530
|
-
}) :
|
|
1531
|
-
x:
|
|
1532
|
-
y:
|
|
1533
|
-
x2:
|
|
1534
|
-
y2:
|
|
1535
|
-
w: Math.abs(
|
|
1553
|
+
}) : g.add("arrow", {
|
|
1554
|
+
x: e.start.x,
|
|
1555
|
+
y: e.start.y,
|
|
1556
|
+
x2: e.current.x,
|
|
1557
|
+
y2: e.current.y,
|
|
1558
|
+
w: Math.abs(t),
|
|
1536
1559
|
h: Math.abs(n)
|
|
1537
1560
|
});
|
|
1538
1561
|
}
|
|
1539
|
-
return
|
|
1562
|
+
return g.add(e.type, Ee(e.start, e.current));
|
|
1540
1563
|
}
|
|
1541
|
-
function
|
|
1542
|
-
|
|
1564
|
+
function Gr() {
|
|
1565
|
+
g.resetCrop(), T = null, Y();
|
|
1543
1566
|
}
|
|
1544
|
-
function
|
|
1545
|
-
s.resetCrop && (s.resetCrop.hidden = !
|
|
1567
|
+
function ge() {
|
|
1568
|
+
s.resetCrop && (s.resetCrop.hidden = !g.isCropped());
|
|
1546
1569
|
}
|
|
1547
|
-
function
|
|
1570
|
+
function We(e) {
|
|
1548
1571
|
if (!s.audio)
|
|
1549
1572
|
return;
|
|
1550
|
-
const
|
|
1551
|
-
s.audio.title =
|
|
1573
|
+
const t = e ? "Stop audio" : "Record audio";
|
|
1574
|
+
s.audio.title = t, s.audio.setAttribute("aria-label", t), s.audio.dataset.active = String(!!e);
|
|
1552
1575
|
}
|
|
1553
1576
|
function K() {
|
|
1554
|
-
return V(
|
|
1577
|
+
return V(P);
|
|
1555
1578
|
}
|
|
1556
|
-
function
|
|
1579
|
+
function ce() {
|
|
1557
1580
|
if (!s.stage || !s.palette || !s.actions || !s.recapture)
|
|
1558
1581
|
return;
|
|
1559
|
-
const
|
|
1560
|
-
s.stage.hidden = !
|
|
1582
|
+
const e = K();
|
|
1583
|
+
s.stage.hidden = !e && !D, s.palette.hidden = !e, s.discard && (s.discard.hidden = !e), s.restore && (s.restore.hidden = e || !te), e ? (s.palette.appendChild(s.discard), s.palette.appendChild(s.recapture)) : s.audio ? s.audio.after(s.recapture) : s.actions.insertBefore(s.recapture, s.submit || null), s.recapture.hidden = !1;
|
|
1561
1584
|
}
|
|
1562
|
-
function
|
|
1563
|
-
K() && (
|
|
1585
|
+
function Jr() {
|
|
1586
|
+
K() && (te = P), P = "", ae(null), ce(), Y();
|
|
1564
1587
|
}
|
|
1565
|
-
function
|
|
1566
|
-
V(
|
|
1588
|
+
function Qr() {
|
|
1589
|
+
V(te) && (P = te, ce(), Y());
|
|
1567
1590
|
}
|
|
1568
|
-
function
|
|
1591
|
+
function Ut() {
|
|
1569
1592
|
return {
|
|
1570
1593
|
capture: typeof d.capture == "function" ? d.capture : void 0,
|
|
1571
1594
|
onBeforeCapture: typeof d.onBeforeCapture == "function" ? d.onBeforeCapture : void 0
|
|
1572
1595
|
};
|
|
1573
1596
|
}
|
|
1574
|
-
function
|
|
1575
|
-
if (!V(
|
|
1597
|
+
function _t(e) {
|
|
1598
|
+
if (!V(e))
|
|
1576
1599
|
throw new Error("Screenshot failed; you can still send text.");
|
|
1577
|
-
|
|
1600
|
+
P = e, te = e, g = Ue(), F = { w: 0, h: 0 }, T = null, b = null, v = null, ae(null);
|
|
1578
1601
|
}
|
|
1579
|
-
async function
|
|
1580
|
-
if (!(
|
|
1581
|
-
|
|
1602
|
+
async function Zr() {
|
|
1603
|
+
if (!(ke || !s.dialog || s.dialog.hidden)) {
|
|
1604
|
+
ke = !0, s.recapture.disabled = !0, S("Capturing…", !0), s.dialog.hidden = !0;
|
|
1582
1605
|
try {
|
|
1583
|
-
let
|
|
1606
|
+
let e = "";
|
|
1584
1607
|
try {
|
|
1585
|
-
|
|
1608
|
+
e = await or();
|
|
1586
1609
|
} catch {
|
|
1587
|
-
|
|
1610
|
+
e = await At(Ut());
|
|
1588
1611
|
}
|
|
1589
|
-
|
|
1590
|
-
} catch (
|
|
1591
|
-
S((
|
|
1612
|
+
_t(e), S("");
|
|
1613
|
+
} catch (e) {
|
|
1614
|
+
S((e == null ? void 0 : e.message) || "Screenshot failed; you can still send text.");
|
|
1592
1615
|
} finally {
|
|
1593
|
-
s.dialog.hidden = !1, s.recapture.disabled = !1,
|
|
1616
|
+
s.dialog.hidden = !1, s.recapture.disabled = !1, ke = !1, ce(), Y();
|
|
1594
1617
|
}
|
|
1595
1618
|
}
|
|
1596
1619
|
}
|
|
1597
|
-
function
|
|
1620
|
+
function ei() {
|
|
1598
1621
|
try {
|
|
1599
|
-
if (X || (X =
|
|
1622
|
+
if (X || (X = pr((t) => {
|
|
1600
1623
|
const n = s.text.value.trim();
|
|
1601
|
-
s.text.value = n ? `${n} ${
|
|
1624
|
+
s.text.value = n ? `${n} ${t}` : t;
|
|
1602
1625
|
})), !X.isSupported()) {
|
|
1603
1626
|
S("Audio-to-text is not supported in this browser.");
|
|
1604
1627
|
return;
|
|
1605
1628
|
}
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1608
|
-
} catch (
|
|
1609
|
-
S(
|
|
1629
|
+
const e = X.start();
|
|
1630
|
+
We(e), S(e ? "Listening…" : "");
|
|
1631
|
+
} catch (e) {
|
|
1632
|
+
S(e.message);
|
|
1610
1633
|
}
|
|
1611
1634
|
}
|
|
1612
|
-
async function
|
|
1635
|
+
async function ti() {
|
|
1613
1636
|
if (!d.video) {
|
|
1614
1637
|
S("Video is disabled on this host.");
|
|
1615
1638
|
return;
|
|
1616
1639
|
}
|
|
1617
|
-
s.dialog.hidden = !0, s.stop.hidden = !1,
|
|
1640
|
+
s.dialog.hidden = !0, s.stop.hidden = !1, oe(), s.launcher.hidden = !0, re = mr({
|
|
1618
1641
|
onStart() {
|
|
1619
1642
|
},
|
|
1620
|
-
onStop(
|
|
1621
|
-
|
|
1643
|
+
onStop(e) {
|
|
1644
|
+
D = e, s.stop.hidden = !0, pe(), s.dialog.hidden = !1, ce(), Y(), S(e ? "Video attached." : "Recording cancelled.");
|
|
1622
1645
|
},
|
|
1623
|
-
onError(
|
|
1624
|
-
S(
|
|
1646
|
+
onError(e) {
|
|
1647
|
+
S(e.message);
|
|
1625
1648
|
}
|
|
1626
1649
|
});
|
|
1627
1650
|
try {
|
|
1628
|
-
await
|
|
1629
|
-
} catch (
|
|
1630
|
-
s.stop.hidden = !0,
|
|
1651
|
+
await re.start();
|
|
1652
|
+
} catch (e) {
|
|
1653
|
+
s.stop.hidden = !0, pe(), s.dialog.hidden = !1, S(e.message);
|
|
1631
1654
|
}
|
|
1632
1655
|
}
|
|
1633
1656
|
function Y() {
|
|
1634
1657
|
if (s.shot = null, !K()) {
|
|
1635
|
-
s.canvas.style.removeProperty("--nf-shot-aspect"), s.canvas.style.removeProperty("aspect-ratio"), s.canvas.innerHTML =
|
|
1658
|
+
s.canvas.style.removeProperty("--nf-shot-aspect"), s.canvas.style.removeProperty("aspect-ratio"), s.canvas.innerHTML = D ? `<video class="nf-recording-preview" controls src="${URL.createObjectURL(D)}"></video>` : "", ge();
|
|
1636
1659
|
return;
|
|
1637
1660
|
}
|
|
1638
|
-
s.canvas.innerHTML = `<div class="nf-shot"><img alt="Screenshot" src="${
|
|
1639
|
-
const
|
|
1640
|
-
|
|
1641
|
-
const
|
|
1642
|
-
|
|
1661
|
+
s.canvas.innerHTML = `<div class="nf-shot"><img alt="Screenshot" src="${P}" draggable="false"></div>`, s.shot = s.canvas.querySelector(".nf-shot");
|
|
1662
|
+
const e = s.shot.querySelector("img");
|
|
1663
|
+
e.draggable = !1, e.addEventListener("dragstart", (n) => n.preventDefault());
|
|
1664
|
+
const t = () => {
|
|
1665
|
+
ni(e), $();
|
|
1643
1666
|
};
|
|
1644
|
-
|
|
1667
|
+
e.addEventListener("load", t), e.complete && e.naturalWidth && t(), ge();
|
|
1645
1668
|
}
|
|
1646
|
-
function
|
|
1647
|
-
const
|
|
1648
|
-
if (
|
|
1669
|
+
function ni(e) {
|
|
1670
|
+
const t = e.naturalWidth || F.w, n = e.naturalHeight || F.h;
|
|
1671
|
+
if (t && n && (F = { w: t, h: n }, s.canvas.style.setProperty("--nf-shot-aspect", String(t / n)), s.canvas.style.aspectRatio = `${t} / ${n}`), !s.shot || !F.w || !F.h)
|
|
1649
1672
|
return;
|
|
1650
|
-
const r =
|
|
1651
|
-
s.shot.style.left = `${(1 - o) / 2 * 100}%`, s.shot.style.top = `${(1 - c) / 2 * 100}%`, s.shot.style.width = `${o * 100}%`, s.shot.style.height = `${c * 100}%`,
|
|
1673
|
+
const r = g.crop(), a = F.w / F.h, i = r.w / r.h * a, o = Math.min(1, i / a), c = Math.min(1, a / i);
|
|
1674
|
+
s.shot.style.left = `${(1 - o) / 2 * 100}%`, s.shot.style.top = `${(1 - c) / 2 * 100}%`, s.shot.style.width = `${o * 100}%`, s.shot.style.height = `${c * 100}%`, e.style.width = `${100 / r.w}%`, e.style.height = `${100 / r.h}%`, e.style.left = `${-r.x / r.w * 100}%`, e.style.top = `${-r.y / r.h * 100}%`;
|
|
1652
1675
|
}
|
|
1653
|
-
function
|
|
1654
|
-
return
|
|
1676
|
+
function ri(e) {
|
|
1677
|
+
return e.type === "arrow" ? {
|
|
1655
1678
|
id: "preview",
|
|
1656
1679
|
type: "arrow",
|
|
1657
1680
|
number: "",
|
|
1658
|
-
x:
|
|
1659
|
-
y:
|
|
1660
|
-
x2:
|
|
1661
|
-
y2:
|
|
1662
|
-
w: Math.abs(
|
|
1663
|
-
h: Math.abs(
|
|
1681
|
+
x: e.start.x,
|
|
1682
|
+
y: e.start.y,
|
|
1683
|
+
x2: e.current.x,
|
|
1684
|
+
y2: e.current.y,
|
|
1685
|
+
w: Math.abs(e.current.x - e.start.x),
|
|
1686
|
+
h: Math.abs(e.current.y - e.start.y)
|
|
1664
1687
|
} : {
|
|
1665
1688
|
id: "preview",
|
|
1666
|
-
type:
|
|
1689
|
+
type: e.type,
|
|
1667
1690
|
number: "",
|
|
1668
|
-
...
|
|
1691
|
+
...Ee(e.start, e.current)
|
|
1669
1692
|
};
|
|
1670
1693
|
}
|
|
1671
|
-
function
|
|
1672
|
-
if ((s.shot || s.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((
|
|
1673
|
-
|
|
1694
|
+
function $() {
|
|
1695
|
+
if ((s.shot || s.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((i) => i.remove()), !K() || !s.shot) {
|
|
1696
|
+
ge();
|
|
1674
1697
|
return;
|
|
1675
1698
|
}
|
|
1676
|
-
const
|
|
1699
|
+
const t = g.crop(), n = se(), r = _e(n.clientWidth || 400);
|
|
1677
1700
|
if (s.shot.style.setProperty("--nf-anno-stroke", `${r.stroke}px`), s.shot.style.setProperty("--nf-anno-badge", `${r.badgeRadius * 2}px`), s.shot.style.setProperty("--nf-anno-badge-font", `${r.fontSize}px`), s.shot.style.setProperty("--nf-anno-handle", `${Math.max(8, r.stroke * 2.5)}px`), (b == null ? void 0 : b.kind) === "crop") {
|
|
1678
|
-
const
|
|
1679
|
-
|
|
1701
|
+
const i = document.createElement("div");
|
|
1702
|
+
i.className = "nf-crop", ut(i, Ee(b.start, b.current), { x: 0, y: 0, w: 1, h: 1 }), s.shot.appendChild(i);
|
|
1680
1703
|
}
|
|
1681
|
-
const
|
|
1682
|
-
if ((b == null ? void 0 : b.kind) === "sticker" &&
|
|
1683
|
-
const o =
|
|
1684
|
-
if (l.className = `nf-sticker nf-${
|
|
1704
|
+
const a = g.list().slice();
|
|
1705
|
+
if ((b == null ? void 0 : b.kind) === "sticker" && a.push(ri(b)), a.forEach((i) => {
|
|
1706
|
+
const o = i.id === "preview", c = !o && i.id === T, l = document.createElement("div");
|
|
1707
|
+
if (l.className = `nf-sticker nf-${i.type}`, l.dataset.id = i.id, c && (l.dataset.selected = "true"), o && (l.dataset.preview = "true"), i.type === "arrow" ? ii(l, i, t, c, r) : (ut(l, i, t), c && ["nw", "ne", "sw", "se"].forEach((u) => He(l, u))), !o && i.number) {
|
|
1685
1708
|
const u = document.createElement("span");
|
|
1686
|
-
u.className = "nf-badge", u.textContent = String(
|
|
1709
|
+
u.className = "nf-badge", u.textContent = String(i.number), l.appendChild(u);
|
|
1687
1710
|
}
|
|
1688
1711
|
s.shot.appendChild(l);
|
|
1689
|
-
}), s.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((
|
|
1690
|
-
const
|
|
1691
|
-
|
|
1712
|
+
}), s.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((i) => i.remove()), D) {
|
|
1713
|
+
const i = document.createElement("video");
|
|
1714
|
+
i.className = "nf-recording-preview", i.controls = !0, i.src = URL.createObjectURL(D), i.style.position = "absolute", i.style.right = "8px", i.style.bottom = "8px", i.style.width = "160px", s.canvas.appendChild(i);
|
|
1692
1715
|
}
|
|
1693
|
-
|
|
1716
|
+
ge();
|
|
1694
1717
|
}
|
|
1695
|
-
function
|
|
1696
|
-
const
|
|
1697
|
-
|
|
1698
|
-
<line class="nf-arrow-hit" x1="${
|
|
1699
|
-
<line class="nf-arrow-shaft" x1="${
|
|
1700
|
-
<polygon class="nf-arrow-head" points="${
|
|
1701
|
-
`,
|
|
1718
|
+
function ii(e, t, n, r, a = _e(400)) {
|
|
1719
|
+
const i = se(), o = i.clientWidth, c = i.clientHeight, l = (t.x - n.x) / n.w * o, u = (t.y - n.y) / n.h * c, f = ((t.x2 ?? t.x + t.w) - n.x) / n.w * o, y = ((t.y2 ?? t.y) - n.y) / n.h * c, m = Math.max(18, a.arrowHead + a.stroke * 2), w = Math.min(l, f) - m, x = Math.min(u, y) - m, C = Math.max(2, Math.abs(f - l)) + m * 2, O = Math.max(2, Math.abs(y - u)) + m * 2, k = l - w, H = u - x, G = f - w, J = y - x, U = kt(k, H, G, J, a), Q = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1720
|
+
e.style.left = `${w}px`, e.style.top = `${x}px`, e.style.width = `${C}px`, e.style.height = `${O}px`, Q.setAttribute("class", "nf-arrow-svg"), Q.setAttribute("viewBox", `0 0 ${C} ${O}`), Q.setAttribute("width", String(C)), Q.setAttribute("height", String(O)), Q.innerHTML = `
|
|
1721
|
+
<line class="nf-arrow-hit" x1="${k}" y1="${H}" x2="${G}" y2="${J}" />
|
|
1722
|
+
<line class="nf-arrow-shaft" x1="${k}" y1="${H}" x2="${U.shaftEnd.x}" y2="${U.shaftEnd.y}" />
|
|
1723
|
+
<polygon class="nf-arrow-head" points="${U.tipX},${U.tipY} ${U.left.x},${U.left.y} ${U.right.x},${U.right.y}" />
|
|
1724
|
+
`, e.appendChild(Q), r && (He(e, "start", { left: k - 5, top: H - 5 }), He(e, "end", { left: G - 5, top: J - 5 }));
|
|
1702
1725
|
}
|
|
1703
|
-
function
|
|
1726
|
+
function He(e, t, n) {
|
|
1704
1727
|
const r = document.createElement("span");
|
|
1705
|
-
r.className = "nf-handle", r.dataset.dir =
|
|
1728
|
+
r.className = "nf-handle", r.dataset.dir = t, n && (r.style.left = `${n.left}px`, r.style.top = `${n.top}px`), e.appendChild(r);
|
|
1706
1729
|
}
|
|
1707
|
-
function
|
|
1708
|
-
|
|
1730
|
+
function ut(e, t, n) {
|
|
1731
|
+
e.style.left = `${(t.x - n.x) / n.w * 100}%`, e.style.top = `${(t.y - n.y) / n.h * 100}%`, e.style.width = `${t.w / n.w * 100}%`, e.style.height = `${t.h / n.h * 100}%`;
|
|
1709
1732
|
}
|
|
1710
|
-
function
|
|
1733
|
+
function jt() {
|
|
1711
1734
|
try {
|
|
1712
|
-
return String(localStorage.getItem(
|
|
1735
|
+
return String(localStorage.getItem(Pt) || "").trim();
|
|
1713
1736
|
} catch {
|
|
1714
1737
|
return "";
|
|
1715
1738
|
}
|
|
1716
1739
|
}
|
|
1717
|
-
function
|
|
1718
|
-
const
|
|
1719
|
-
if (!(!
|
|
1740
|
+
function ai(e) {
|
|
1741
|
+
const t = String(e || "").trim();
|
|
1742
|
+
if (!(!t || t === Be))
|
|
1720
1743
|
try {
|
|
1721
|
-
localStorage.setItem(
|
|
1744
|
+
localStorage.setItem(Pt, t);
|
|
1722
1745
|
} catch {
|
|
1723
1746
|
}
|
|
1724
1747
|
}
|
|
1725
|
-
function
|
|
1748
|
+
function Vt() {
|
|
1726
1749
|
try {
|
|
1727
|
-
const
|
|
1728
|
-
if (!
|
|
1750
|
+
const e = localStorage.getItem(Ot);
|
|
1751
|
+
if (!e)
|
|
1729
1752
|
return { diagnostics: !1, logs: !1 };
|
|
1730
|
-
const
|
|
1753
|
+
const t = JSON.parse(e);
|
|
1731
1754
|
return {
|
|
1732
|
-
diagnostics: !!(
|
|
1733
|
-
logs: !!(
|
|
1755
|
+
diagnostics: !!(t != null && t.diagnostics),
|
|
1756
|
+
logs: !!(t != null && t.logs)
|
|
1734
1757
|
};
|
|
1735
1758
|
} catch {
|
|
1736
1759
|
return { diagnostics: !1, logs: !1 };
|
|
1737
1760
|
}
|
|
1738
1761
|
}
|
|
1739
|
-
function
|
|
1740
|
-
const
|
|
1741
|
-
...
|
|
1742
|
-
...
|
|
1762
|
+
function dt(e = {}) {
|
|
1763
|
+
const t = {
|
|
1764
|
+
...Vt(),
|
|
1765
|
+
...e
|
|
1743
1766
|
};
|
|
1744
1767
|
try {
|
|
1745
|
-
localStorage.setItem(
|
|
1746
|
-
diagnostics: !!
|
|
1747
|
-
logs: !!
|
|
1768
|
+
localStorage.setItem(Ot, JSON.stringify({
|
|
1769
|
+
diagnostics: !!t.diagnostics,
|
|
1770
|
+
logs: !!t.logs
|
|
1748
1771
|
}));
|
|
1749
1772
|
} catch {
|
|
1750
1773
|
}
|
|
1751
1774
|
}
|
|
1752
|
-
function
|
|
1753
|
-
return !!(String(
|
|
1775
|
+
function zt() {
|
|
1776
|
+
return !!(String(B.userId || "").trim() || String(B.email || "").trim() || String(B.displayName || "").trim());
|
|
1754
1777
|
}
|
|
1755
|
-
function
|
|
1778
|
+
function Wt() {
|
|
1756
1779
|
return String(
|
|
1757
|
-
|
|
1780
|
+
B.displayName || B.email || B.userId || ""
|
|
1758
1781
|
).trim();
|
|
1759
1782
|
}
|
|
1760
|
-
function
|
|
1761
|
-
var
|
|
1762
|
-
if (
|
|
1763
|
-
return
|
|
1764
|
-
const
|
|
1765
|
-
return
|
|
1783
|
+
function oi() {
|
|
1784
|
+
var t;
|
|
1785
|
+
if (zt())
|
|
1786
|
+
return Wt() || Be;
|
|
1787
|
+
const e = String(((t = s.author) == null ? void 0 : t.value) || "").trim();
|
|
1788
|
+
return e ? (ai(e), e) : Be;
|
|
1766
1789
|
}
|
|
1767
|
-
function
|
|
1790
|
+
function Kt() {
|
|
1768
1791
|
if (!s.author)
|
|
1769
1792
|
return;
|
|
1770
|
-
const
|
|
1771
|
-
if (s.author.hidden =
|
|
1793
|
+
const e = zt();
|
|
1794
|
+
if (s.author.hidden = e, e) {
|
|
1772
1795
|
s.author.value = "";
|
|
1773
1796
|
return;
|
|
1774
1797
|
}
|
|
1775
|
-
s.author.value =
|
|
1798
|
+
s.author.value = jt();
|
|
1776
1799
|
}
|
|
1777
|
-
function
|
|
1778
|
-
const n = Number(
|
|
1779
|
-
return Number.isFinite(n) ? Math.min(
|
|
1800
|
+
function qt(e, t = Tt) {
|
|
1801
|
+
const n = Number(e);
|
|
1802
|
+
return Number.isFinite(n) ? Math.min(Fr, Math.max(0, Math.floor(n))) : t;
|
|
1780
1803
|
}
|
|
1781
|
-
function
|
|
1782
|
-
|
|
1804
|
+
function Xt(e) {
|
|
1805
|
+
e.key !== "Escape" || !s.dialog || s.dialog.hidden || Se && !xe || ne();
|
|
1783
1806
|
}
|
|
1784
|
-
function
|
|
1785
|
-
|
|
1786
|
-
const
|
|
1807
|
+
function Yt(e = {}) {
|
|
1808
|
+
dr(e);
|
|
1809
|
+
const t = Object.prototype.hasOwnProperty.call(e, "kinds");
|
|
1787
1810
|
d = {
|
|
1788
1811
|
...d,
|
|
1789
|
-
endpoint: String(
|
|
1790
|
-
projectKey:
|
|
1791
|
-
version:
|
|
1792
|
-
name:
|
|
1793
|
-
targets:
|
|
1794
|
-
hideLauncher:
|
|
1795
|
-
theme:
|
|
1796
|
-
video:
|
|
1797
|
-
consoleLogLimit:
|
|
1798
|
-
kinds:
|
|
1799
|
-
capture:
|
|
1800
|
-
onBeforeCapture:
|
|
1801
|
-
|
|
1812
|
+
endpoint: String(e.endpoint || d.endpoint || "").replace(/\/$/, ""),
|
|
1813
|
+
projectKey: e.projectKey == null ? d.projectKey : String(e.projectKey),
|
|
1814
|
+
version: e.version == null ? d.version : String(e.version),
|
|
1815
|
+
name: e.name == null ? d.name : String(e.name || ""),
|
|
1816
|
+
targets: e.targets === void 0 ? d.targets : e.targets,
|
|
1817
|
+
hideLauncher: e.hideLauncher == null ? d.hideLauncher : !!e.hideLauncher,
|
|
1818
|
+
theme: Bt(e.theme ?? d.theme),
|
|
1819
|
+
video: e.video == null ? d.video : !!e.video,
|
|
1820
|
+
consoleLogLimit: e.consoleLogLimit == null ? d.consoleLogLimit : qt(e.consoleLogLimit, d.consoleLogLimit),
|
|
1821
|
+
kinds: t ? Or(e.kinds) : d.kinds,
|
|
1822
|
+
capture: e.capture === void 0 ? d.capture : e.capture,
|
|
1823
|
+
onBeforeCapture: e.onBeforeCapture === void 0 ? d.onBeforeCapture : e.onBeforeCapture,
|
|
1824
|
+
onOpen: e.onOpen === void 0 ? d.onOpen : e.onOpen,
|
|
1825
|
+
onClose: e.onClose === void 0 ? d.onClose : e.onClose,
|
|
1826
|
+
displayLink: e.displayLink == null ? d.displayLink : !!e.displayLink
|
|
1802
1827
|
};
|
|
1803
1828
|
}
|
|
1804
|
-
function
|
|
1805
|
-
|
|
1829
|
+
function Gt(e) {
|
|
1830
|
+
const t = d[e];
|
|
1831
|
+
if (typeof t == "function")
|
|
1832
|
+
try {
|
|
1833
|
+
t();
|
|
1834
|
+
} catch (n) {
|
|
1835
|
+
console.warn(`Notefully.${e} failed:`, n);
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
function si() {
|
|
1839
|
+
return ie;
|
|
1806
1840
|
}
|
|
1807
|
-
function
|
|
1808
|
-
return
|
|
1841
|
+
function Ke(e = {}) {
|
|
1842
|
+
return Yt(e), p && oe(), qe;
|
|
1809
1843
|
}
|
|
1810
|
-
function
|
|
1811
|
-
return
|
|
1844
|
+
function ci(e = {}) {
|
|
1845
|
+
return Yt(e), je(), oe(), qe;
|
|
1812
1846
|
}
|
|
1813
|
-
function
|
|
1814
|
-
|
|
1815
|
-
return !e && p && s.dialog && !s.dialog.hidden && nt(), zt({ hideLauncher: !e });
|
|
1847
|
+
function li(e) {
|
|
1848
|
+
return Ke({ theme: e });
|
|
1816
1849
|
}
|
|
1817
|
-
function
|
|
1818
|
-
const t =
|
|
1819
|
-
|
|
1820
|
-
|
|
1850
|
+
function ui(e) {
|
|
1851
|
+
const t = !!e;
|
|
1852
|
+
return !t && p && s.dialog && !s.dialog.hidden && ne(), Ke({ hideLauncher: !t });
|
|
1853
|
+
}
|
|
1854
|
+
function di() {
|
|
1855
|
+
const e = Wt() || jt() || void 0, t = lr({
|
|
1856
|
+
...B,
|
|
1857
|
+
displayName: B.displayName || e
|
|
1821
1858
|
});
|
|
1822
|
-
|
|
1823
|
-
|
|
1859
|
+
N = Mr(t), I = $r(
|
|
1860
|
+
Rt.snapshot().slice(-qt(d.consoleLogLimit))
|
|
1824
1861
|
);
|
|
1825
|
-
const n =
|
|
1826
|
-
n.diagnostics &&
|
|
1862
|
+
const n = Vt();
|
|
1863
|
+
n.diagnostics && he(N, !0), n.logs && I.length && he(I, !0), q = !1;
|
|
1827
1864
|
}
|
|
1828
|
-
function
|
|
1829
|
-
q = !!
|
|
1865
|
+
function we(e) {
|
|
1866
|
+
q = !!e, s.privacyPanel && (s.privacyPanel.hidden = !q), s.privacyChange && (s.privacyChange.setAttribute("aria-expanded", q ? "true" : "false"), s.privacyChange.dataset.active = String(q)), q && Zt();
|
|
1830
1867
|
}
|
|
1831
|
-
function
|
|
1868
|
+
function Jt() {
|
|
1832
1869
|
if (!s.privacy || !s.privacyText || !s.privacyChange)
|
|
1833
1870
|
return;
|
|
1834
|
-
const
|
|
1835
|
-
diagnostics:
|
|
1836
|
-
logs:
|
|
1871
|
+
const e = Tr({
|
|
1872
|
+
diagnostics: N,
|
|
1873
|
+
logs: I
|
|
1837
1874
|
});
|
|
1838
|
-
s.privacyText.textContent =
|
|
1839
|
-
const
|
|
1840
|
-
s.privacySummary && (s.privacySummary.hidden =
|
|
1875
|
+
s.privacyText.textContent = e, s.privacyText.hidden = !e;
|
|
1876
|
+
const t = N.length === 0 && I.length === 0;
|
|
1877
|
+
s.privacySummary && (s.privacySummary.hidden = t), s.privacy.hidden = t, s.privacyChange.hidden = !1;
|
|
1841
1878
|
}
|
|
1842
|
-
function
|
|
1879
|
+
function Qt(e, t, n) {
|
|
1843
1880
|
return `<label class="nf-privacy-toggle">
|
|
1844
1881
|
<span class="nf-privacy-toggle-label">Redact</span>
|
|
1845
|
-
<input type="checkbox" ${
|
|
1882
|
+
<input type="checkbox" ${e ? "checked" : ""} ${t ? 'data-indeterminate="true"' : ""} aria-label="${L(n)}">
|
|
1846
1883
|
</label>`;
|
|
1847
1884
|
}
|
|
1848
|
-
function
|
|
1849
|
-
const
|
|
1850
|
-
if (
|
|
1885
|
+
function ft(e, t, n, r, a) {
|
|
1886
|
+
const i = Qt(a, !1, `Redact ${n}`);
|
|
1887
|
+
if (a) {
|
|
1851
1888
|
const o = r ? `${n}: ${r}` : n;
|
|
1852
|
-
return `<div class="nf-privacy-row" data-kind="${L(
|
|
1889
|
+
return `<div class="nf-privacy-row" data-kind="${L(e)}" data-id="${L(t)}" data-redacted="true">
|
|
1853
1890
|
<div class="nf-privacy-row-text">
|
|
1854
1891
|
<div class="nf-privacy-row-summary" title="${L(o)}">${L(o)}</div>
|
|
1855
1892
|
</div>
|
|
1856
|
-
${
|
|
1893
|
+
${i}
|
|
1857
1894
|
</div>`;
|
|
1858
1895
|
}
|
|
1859
|
-
return `<div class="nf-privacy-row" data-kind="${L(
|
|
1896
|
+
return `<div class="nf-privacy-row" data-kind="${L(e)}" data-id="${L(t)}">
|
|
1860
1897
|
<div class="nf-privacy-row-text">
|
|
1861
1898
|
<div class="nf-privacy-row-title">${L(n)}</div>
|
|
1862
1899
|
<div class="nf-privacy-row-detail">${L(r)}</div>
|
|
1863
1900
|
</div>
|
|
1864
|
-
${
|
|
1901
|
+
${i}
|
|
1865
1902
|
</div>`;
|
|
1866
1903
|
}
|
|
1867
|
-
function
|
|
1904
|
+
function ht(e, t, n, r) {
|
|
1868
1905
|
if (!n.length)
|
|
1869
1906
|
return "";
|
|
1870
|
-
const
|
|
1871
|
-
return `<section class="nf-privacy-section" data-section="${L(
|
|
1907
|
+
const a = Rr(n), i = a.checked && !a.indeterminate;
|
|
1908
|
+
return `<section class="nf-privacy-section" data-section="${L(e)}"${i ? ' data-redacted="true"' : ""}>
|
|
1872
1909
|
<div class="nf-privacy-section-head">
|
|
1873
|
-
<h3 class="nf-privacy-section-title">${L(
|
|
1874
|
-
${
|
|
1910
|
+
<h3 class="nf-privacy-section-title">${L(t)}</h3>
|
|
1911
|
+
${Qt(a.checked, a.indeterminate, `Redact all ${t.toLowerCase()}`)}
|
|
1875
1912
|
</div>
|
|
1876
|
-
<div class="nf-privacy-rows"${
|
|
1913
|
+
<div class="nf-privacy-rows"${i ? " hidden" : ""}>${r}</div>
|
|
1877
1914
|
</section>`;
|
|
1878
1915
|
}
|
|
1879
|
-
function
|
|
1916
|
+
function Zt() {
|
|
1880
1917
|
if (!s.privacyScroll)
|
|
1881
1918
|
return;
|
|
1882
|
-
const
|
|
1919
|
+
const e = N.map((n) => ft(
|
|
1883
1920
|
"diagnostic",
|
|
1884
1921
|
n.key,
|
|
1885
1922
|
n.label,
|
|
1886
|
-
|
|
1923
|
+
Pr(n.value),
|
|
1887
1924
|
n.redacted
|
|
1888
|
-
)).join(""),
|
|
1925
|
+
)).join(""), t = I.map((n) => ft(
|
|
1889
1926
|
"log",
|
|
1890
1927
|
n.id,
|
|
1891
1928
|
n.level,
|
|
@@ -1893,59 +1930,62 @@ function Ge() {
|
|
|
1893
1930
|
n.redacted
|
|
1894
1931
|
)).join("");
|
|
1895
1932
|
s.privacyScroll.innerHTML = [
|
|
1896
|
-
|
|
1897
|
-
|
|
1933
|
+
ht("diagnostics", "Diagnostics", N, e),
|
|
1934
|
+
I.length ? ht("logs", "Logs", I, t) : ""
|
|
1898
1935
|
].join(""), s.privacyScroll.querySelectorAll('input[data-indeterminate="true"]').forEach((n) => {
|
|
1899
1936
|
n.indeterminate = !0, n.removeAttribute("data-indeterminate");
|
|
1900
|
-
}),
|
|
1937
|
+
}), Jt();
|
|
1901
1938
|
}
|
|
1902
|
-
function
|
|
1903
|
-
const
|
|
1904
|
-
if (!(
|
|
1939
|
+
function fi(e) {
|
|
1940
|
+
const t = e.target;
|
|
1941
|
+
if (!(t instanceof HTMLInputElement) || t.type !== "checkbox")
|
|
1905
1942
|
return;
|
|
1906
|
-
const n =
|
|
1943
|
+
const n = t.closest("[data-section]"), r = t.closest(".nf-privacy-row"), a = t.checked;
|
|
1907
1944
|
if (r) {
|
|
1908
|
-
const
|
|
1909
|
-
if (
|
|
1910
|
-
const c =
|
|
1911
|
-
c && (c.redacted =
|
|
1912
|
-
} else if (
|
|
1913
|
-
const c =
|
|
1914
|
-
c && (c.redacted =
|
|
1945
|
+
const i = r.dataset.kind, o = r.dataset.id;
|
|
1946
|
+
if (i === "diagnostic") {
|
|
1947
|
+
const c = N.find((l) => l.key === o);
|
|
1948
|
+
c && (c.redacted = a);
|
|
1949
|
+
} else if (i === "log") {
|
|
1950
|
+
const c = I.find((l) => l.id === o);
|
|
1951
|
+
c && (c.redacted = a);
|
|
1915
1952
|
}
|
|
1916
1953
|
} else if (n) {
|
|
1917
|
-
const
|
|
1918
|
-
|
|
1954
|
+
const i = n.dataset.section;
|
|
1955
|
+
i === "diagnostics" ? (he(N, a), dt({ diagnostics: a })) : i === "logs" && (he(I, a), dt({ logs: a }));
|
|
1919
1956
|
} else
|
|
1920
1957
|
return;
|
|
1921
|
-
|
|
1958
|
+
Zt();
|
|
1922
1959
|
}
|
|
1923
|
-
async function
|
|
1924
|
-
|
|
1960
|
+
async function en() {
|
|
1961
|
+
je(), ie || (ie = !0, Gt("onOpen")), tn(), oe(), s.launcher.hidden = !0, g = Ue(), F = { w: 0, h: 0 }, D = null, P = "", te = "", T = null, b = null, v = null, z = Vr(), Ve(z), ae(null), We(!1), s.text.value = "", Kt(), S(""), di();
|
|
1925
1962
|
try {
|
|
1926
|
-
|
|
1963
|
+
_t(await At(Ut())), S("");
|
|
1927
1964
|
} catch (t) {
|
|
1928
|
-
|
|
1965
|
+
P = "", S((t == null ? void 0 : t.message) || "Screenshot failed; you can still send text.");
|
|
1929
1966
|
}
|
|
1930
|
-
|
|
1967
|
+
ce(), we(!1), Jt(), s.dialog.hidden = !1, Y(), s.text.focus();
|
|
1931
1968
|
}
|
|
1932
|
-
function
|
|
1933
|
-
|
|
1969
|
+
function ne() {
|
|
1970
|
+
if (!p)
|
|
1971
|
+
return;
|
|
1972
|
+
const e = ie;
|
|
1973
|
+
X == null || X.stop(), We(!1), Ft(), b = null, v = null, ze(!1), tn(), we(!1), s.dialog.hidden = !0, s.stop.hidden = !0, pe(), e && (ie = !1, Gt("onClose"));
|
|
1934
1974
|
}
|
|
1935
|
-
function
|
|
1936
|
-
const
|
|
1937
|
-
if (!
|
|
1975
|
+
function hi(e = "") {
|
|
1976
|
+
const t = s.dialog, n = s.panel, r = s.panelBody, a = s.successMsg, i = s.successLink, o = String(e || "").trim(), c = !!(d.displayLink && o);
|
|
1977
|
+
if (!t || !n || !r || !a)
|
|
1938
1978
|
return Promise.resolve(!1);
|
|
1939
|
-
|
|
1979
|
+
Se = !0, xe = c, S("");
|
|
1940
1980
|
const l = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, u = n.getBoundingClientRect();
|
|
1941
|
-
if (r.hidden = !0,
|
|
1981
|
+
if (r.hidden = !0, a.hidden = !1, t.classList.add("nf-success"), t.classList.toggle("nf-success-sticky", c), t.style.opacity = "1", i && (c ? (i.hidden = !1, i.href = o) : (i.hidden = !0, i.removeAttribute("href"))), c) {
|
|
1942
1982
|
if (l)
|
|
1943
1983
|
return Promise.resolve(!0);
|
|
1944
1984
|
const w = n.getBoundingClientRect(), x = w.width > 0 ? u.width / w.width : 1, C = w.height > 0 ? u.height / w.height : 1;
|
|
1945
|
-
return n.style.transformOrigin = "center center", n.style.transition = "none", n.style.transform = `scale(${x}, ${C})`, n.getBoundingClientRect(), new Promise((
|
|
1946
|
-
let
|
|
1985
|
+
return n.style.transformOrigin = "center center", n.style.transition = "none", n.style.transform = `scale(${x}, ${C})`, n.getBoundingClientRect(), new Promise((O) => {
|
|
1986
|
+
let k = !1;
|
|
1947
1987
|
const H = () => {
|
|
1948
|
-
|
|
1988
|
+
k || (k = !0, n.removeEventListener("transitionend", G), O(!0));
|
|
1949
1989
|
}, G = (J) => {
|
|
1950
1990
|
J.target !== n || J.propertyName !== "transform" || H();
|
|
1951
1991
|
};
|
|
@@ -1958,95 +1998,109 @@ function si(t = "") {
|
|
|
1958
1998
|
return new Promise((w) => {
|
|
1959
1999
|
window.setTimeout(() => w(!1), 1e3);
|
|
1960
2000
|
});
|
|
1961
|
-
const f = n.getBoundingClientRect(), y = f.width > 0 ? u.width / f.width : 1,
|
|
1962
|
-
return n.style.transformOrigin = "center center", n.style.transition = "none", n.style.transform = `scale(${y}, ${
|
|
2001
|
+
const f = n.getBoundingClientRect(), y = f.width > 0 ? u.width / f.width : 1, m = f.height > 0 ? u.height / f.height : 1;
|
|
2002
|
+
return n.style.transformOrigin = "center center", n.style.transition = "none", n.style.transform = `scale(${y}, ${m})`, n.getBoundingClientRect(), new Promise((w) => {
|
|
1963
2003
|
let x = !1;
|
|
1964
2004
|
const C = () => {
|
|
1965
|
-
x || (x = !0, n.removeEventListener("transitionend",
|
|
1966
|
-
|
|
2005
|
+
x || (x = !0, n.removeEventListener("transitionend", O), window.setTimeout(() => {
|
|
2006
|
+
t.style.transition = "opacity 0.28s ease", t.style.opacity = "0", window.setTimeout(() => w(!1), 280);
|
|
1967
2007
|
}, 1e3));
|
|
1968
|
-
},
|
|
1969
|
-
|
|
2008
|
+
}, O = (k) => {
|
|
2009
|
+
k.target !== n || k.propertyName !== "transform" || C();
|
|
1970
2010
|
};
|
|
1971
|
-
n.addEventListener("transitionend",
|
|
2011
|
+
n.addEventListener("transitionend", O), requestAnimationFrame(() => {
|
|
1972
2012
|
n.style.transition = "transform 0.48s cubic-bezier(0.22, 1, 0.36, 1)", n.style.transform = "scale(1)";
|
|
1973
2013
|
}), window.setTimeout(C, 700);
|
|
1974
2014
|
});
|
|
1975
2015
|
}
|
|
1976
|
-
function
|
|
1977
|
-
|
|
2016
|
+
function tn() {
|
|
2017
|
+
Se = !1, xe = !1, s.dialog && (s.dialog.classList.remove("nf-success", "nf-success-sticky"), s.dialog.style.opacity = "", s.dialog.style.transition = "", s.panel && (s.panel.style.transform = "", s.panel.style.transition = "", s.panel.style.transformOrigin = ""), s.panelBody && (s.panelBody.hidden = !1), s.successMsg && (s.successMsg.hidden = !0), s.successLink && (s.successLink.hidden = !0, s.successLink.removeAttribute("href")));
|
|
1978
2018
|
}
|
|
1979
|
-
function
|
|
1980
|
-
|
|
2019
|
+
function pi(e = {}) {
|
|
2020
|
+
B = { ...B, ...ur(e) }, Kt();
|
|
1981
2021
|
}
|
|
1982
|
-
async function
|
|
1983
|
-
if (
|
|
2022
|
+
async function nn() {
|
|
2023
|
+
if (je(), Me)
|
|
1984
2024
|
return null;
|
|
1985
|
-
const
|
|
1986
|
-
if (!
|
|
2025
|
+
const e = s.text.value.trim();
|
|
2026
|
+
if (!e && !K() && !D)
|
|
1987
2027
|
return S("Add a note, screenshot, or video first."), null;
|
|
1988
2028
|
if (!d.endpoint || !d.projectKey)
|
|
1989
2029
|
return S("Notefully is missing endpoint or projectKey."), null;
|
|
1990
|
-
|
|
2030
|
+
Me = !0, pt(!0), S("Submitting…", !0);
|
|
1991
2031
|
try {
|
|
1992
|
-
const
|
|
1993
|
-
|
|
1994
|
-
author:
|
|
1995
|
-
diagnostics:
|
|
1996
|
-
logs:
|
|
1997
|
-
})))
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2032
|
+
const t = oi(), n = new FormData();
|
|
2033
|
+
n.append("message", e), n.append("kind", z), n.append("version", d.version || "0.0.0"), n.append("author", t), d.name && n.append("name", d.name), n.append("context", JSON.stringify(Ir({
|
|
2034
|
+
author: t,
|
|
2035
|
+
diagnostics: N,
|
|
2036
|
+
logs: I
|
|
2037
|
+
})));
|
|
2038
|
+
const r = g.crop(), a = g.list(), i = g.isCropped() ? wr(a, r) : a;
|
|
2039
|
+
if (n.append("annotations", JSON.stringify(i)), Array.isArray(d.targets) && n.append("targets", JSON.stringify(d.targets)), K()) {
|
|
2040
|
+
const u = g.isCropped() ? await Cr(P, r) : await Nr(P);
|
|
2041
|
+
if (n.append("screenshot", u, "screenshot.png"), a.length) {
|
|
2042
|
+
const f = await Ar(
|
|
2043
|
+
P,
|
|
2044
|
+
r,
|
|
2045
|
+
a,
|
|
2004
2046
|
{
|
|
2005
|
-
mark:
|
|
2006
|
-
markText:
|
|
2047
|
+
mark: ct("--nf-mark", "#fdd341"),
|
|
2048
|
+
markText: ct("--nf-mark-text", "#2a2140")
|
|
2007
2049
|
}
|
|
2008
2050
|
);
|
|
2009
|
-
n.append("screenshotBaked",
|
|
2051
|
+
n.append("screenshotBaked", f, "screenshot.baked.png");
|
|
2010
2052
|
}
|
|
2011
2053
|
}
|
|
2012
|
-
|
|
2013
|
-
const
|
|
2054
|
+
D && n.append("recording", D, "recording.webm");
|
|
2055
|
+
const o = await fetch(`${d.endpoint}/v1/reports`, {
|
|
2014
2056
|
method: "POST",
|
|
2015
2057
|
headers: {
|
|
2016
2058
|
"X-Notefully-Key": d.projectKey
|
|
2017
2059
|
},
|
|
2018
2060
|
body: n
|
|
2019
2061
|
});
|
|
2020
|
-
let
|
|
2062
|
+
let c = null;
|
|
2021
2063
|
try {
|
|
2022
|
-
|
|
2064
|
+
c = await o.json();
|
|
2023
2065
|
} catch {
|
|
2024
|
-
|
|
2066
|
+
c = null;
|
|
2025
2067
|
}
|
|
2026
|
-
if (!
|
|
2027
|
-
throw S((
|
|
2028
|
-
return await
|
|
2068
|
+
if (!o.ok)
|
|
2069
|
+
throw S((c == null ? void 0 : c.error) || "Submit failed."), new Error((c == null ? void 0 : c.error) || `Submit failed (${o.status})`);
|
|
2070
|
+
return await hi((c == null ? void 0 : c.trackerUrl) || "") || ne(), c;
|
|
2029
2071
|
} finally {
|
|
2030
|
-
|
|
2072
|
+
Me = !1, pt(!1);
|
|
2031
2073
|
}
|
|
2032
2074
|
}
|
|
2033
|
-
function
|
|
2034
|
-
s.submit && (s.submit.disabled = !!
|
|
2035
|
-
}
|
|
2036
|
-
function
|
|
2037
|
-
|
|
2038
|
-
}
|
|
2039
|
-
const
|
|
2040
|
-
|
|
2075
|
+
function pt(e) {
|
|
2076
|
+
s.submit && (s.submit.disabled = !!e, s.submit.setAttribute("aria-busy", e ? "true" : "false"));
|
|
2077
|
+
}
|
|
2078
|
+
function yi() {
|
|
2079
|
+
ne(), document.removeEventListener("keydown", Xt), p == null || p.remove(), p = null, s = {};
|
|
2080
|
+
}
|
|
2081
|
+
const qe = {
|
|
2082
|
+
init: ci,
|
|
2083
|
+
configure: Ke,
|
|
2084
|
+
setTheme: li,
|
|
2085
|
+
setVisible: ui,
|
|
2086
|
+
open: en,
|
|
2087
|
+
close: ne,
|
|
2088
|
+
isOpen: si,
|
|
2089
|
+
identify: pi,
|
|
2090
|
+
submit: nn,
|
|
2091
|
+
destroy: yi
|
|
2092
|
+
};
|
|
2093
|
+
typeof window < "u" && (window.Notefully = qe);
|
|
2041
2094
|
export {
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2095
|
+
ne as close,
|
|
2096
|
+
Ke as configure,
|
|
2097
|
+
qe as default,
|
|
2098
|
+
yi as destroy,
|
|
2099
|
+
pi as identify,
|
|
2100
|
+
ci as init,
|
|
2101
|
+
si as isOpen,
|
|
2102
|
+
en as open,
|
|
2103
|
+
li as setTheme,
|
|
2104
|
+
ui as setVisible,
|
|
2105
|
+
nn as submit
|
|
2052
2106
|
};
|