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