@gpustack/core-ui 1.0.34 → 1.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts.es.js +1 -1
- package/dist/{classnames-1RsQ5HaB.js → classnames-fDEzIsab.js} +3 -11
- package/dist/{editor-wrap-DV6LD3QO.js → editor-wrap-CwTlkQeF.js} +1 -1
- package/dist/{excel-reader-Dm-T5v37.js → excel-reader-fp4wfcR5.js} +2 -2
- package/dist/excel.es.js +1 -1
- package/dist/file-readers.es.js +2 -2
- package/dist/{highlight-code-DFrfrxgM.js → highlight-code-D8pDWkNV.js} +2 -1
- package/dist/index.css +1 -1
- package/dist/index.es.js +1606 -9438
- package/dist/lib/components/index.d.ts +0 -2
- package/dist/lib-pzRljAkJ.js +2 -0
- package/dist/{mammoth-D6zSLJGM.js → mammoth-CCaoEfUd.js} +1 -1
- package/dist/markdown.es.js +1 -1
- package/dist/query-string-D_RrDOJF.js +325 -0
- package/dist/resize-panel-D5BF2EHO.js +529 -0
- package/dist/terminal.d.ts +5 -0
- package/dist/terminal.es.js +7333 -0
- package/dist/useIntl-CBh5liUu.js +12 -0
- package/dist/{utils-B4OCyMbr.js → utils-CHekcXoK.js} +256 -578
- package/dist/utils.es.js +3 -3
- package/dist/{word-reader-DZfu7nOd.js → word-reader-Dy0F38kq.js} +4 -4
- package/dist/yaml-editor.es.js +2 -2
- package/package.json +5 -1
- package/dist/lib-BIUIGY5e.js +0 -2
- /package/dist/{epubjs-DDuu_UAH.js → epubjs-CCPXKy-j.js} +0 -0
- /package/dist/{jszip-CYj7myrF.js → jszip-D49X9-jp.js} +0 -0
- /package/dist/{pdfjs-dist-CHJ4PZaN.js → pdfjs-dist-D4wgLSOe.js} +0 -0
- /package/dist/{xlsx-CkHo9SHP.js → xlsx-C7SIkCvo.js} +0 -0
|
@@ -1,349 +1,27 @@
|
|
|
1
1
|
import { i as e, o as t, r as n } from "./rolldown-runtime-BETGA6I9.js";
|
|
2
2
|
import { t as r } from "./lodash-CFrt21kh.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
var te = "%[a-f0-9]{2}", f = RegExp("(" + te + ")|([^%]+?)", "gi"), p = RegExp("(" + te + ")+", "gi");
|
|
9
|
-
function m(e, t) {
|
|
10
|
-
try {
|
|
11
|
-
return [decodeURIComponent(e.join(""))];
|
|
12
|
-
} catch {}
|
|
13
|
-
if (e.length === 1) return e;
|
|
14
|
-
t ||= 1;
|
|
15
|
-
let n = e.slice(0, t), r = e.slice(t);
|
|
16
|
-
return Array.prototype.concat.call([], m(n), m(r));
|
|
17
|
-
}
|
|
18
|
-
function ne(e) {
|
|
19
|
-
try {
|
|
20
|
-
return decodeURIComponent(e);
|
|
21
|
-
} catch {
|
|
22
|
-
let t = e.match(f) || [];
|
|
23
|
-
for (let n = 1; n < t.length; n++) e = m(t, n).join(""), t = e.match(f) || [];
|
|
24
|
-
return e;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function re(e) {
|
|
28
|
-
let t = {
|
|
29
|
-
"%FE%FF": "��",
|
|
30
|
-
"%FF%FE": "��"
|
|
31
|
-
}, n = p.exec(e);
|
|
32
|
-
for (; n;) {
|
|
33
|
-
try {
|
|
34
|
-
t[n[0]] = decodeURIComponent(n[0]);
|
|
35
|
-
} catch {
|
|
36
|
-
let e = ne(n[0]);
|
|
37
|
-
e !== n[0] && (t[n[0]] = e);
|
|
38
|
-
}
|
|
39
|
-
n = p.exec(e);
|
|
40
|
-
}
|
|
41
|
-
t["%C2"] = "�";
|
|
42
|
-
let r = Object.keys(t);
|
|
43
|
-
for (let n of r) e = e.replace(new RegExp(n, "g"), t[n]);
|
|
44
|
-
return e;
|
|
45
|
-
}
|
|
46
|
-
function ie(e) {
|
|
47
|
-
if (typeof e != "string") throw TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof e + "`");
|
|
48
|
-
try {
|
|
49
|
-
return decodeURIComponent(e);
|
|
50
|
-
} catch {
|
|
51
|
-
return re(e);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region node_modules/.pnpm/filter-obj@5.1.0/node_modules/filter-obj/index.js
|
|
56
|
-
function ae(e, t) {
|
|
57
|
-
let n = {};
|
|
58
|
-
if (Array.isArray(t)) for (let r of t) {
|
|
59
|
-
let t = Object.getOwnPropertyDescriptor(e, r);
|
|
60
|
-
t?.enumerable && Object.defineProperty(n, r, t);
|
|
61
|
-
}
|
|
62
|
-
else for (let r of Reflect.ownKeys(e)) {
|
|
63
|
-
let i = Object.getOwnPropertyDescriptor(e, r);
|
|
64
|
-
if (i.enumerable) {
|
|
65
|
-
let a = e[r];
|
|
66
|
-
t(r, a, e) && Object.defineProperty(n, r, i);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return n;
|
|
70
|
-
}
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region node_modules/.pnpm/split-on-first@3.0.0/node_modules/split-on-first/index.js
|
|
73
|
-
function h(e, t) {
|
|
74
|
-
if (!(typeof e == "string" && typeof t == "string")) throw TypeError("Expected the arguments to be of type `string`");
|
|
75
|
-
if (e === "" || t === "") return [];
|
|
76
|
-
let n = e.indexOf(t);
|
|
77
|
-
return n === -1 ? [] : [e.slice(0, n), e.slice(n + t.length)];
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region node_modules/.pnpm/query-string@9.3.1/node_modules/query-string/base.js
|
|
81
|
-
var oe = /* @__PURE__ */ n({
|
|
82
|
-
exclude: () => ge,
|
|
83
|
-
extract: () => b,
|
|
84
|
-
parse: () => x,
|
|
85
|
-
parseUrl: () => S,
|
|
86
|
-
pick: () => w,
|
|
87
|
-
stringify: () => he,
|
|
88
|
-
stringifyUrl: () => C
|
|
89
|
-
}), se = (e) => e == null, ce = (e) => encodeURIComponent(e).replaceAll(/[!'()*]/g, (e) => `%${e.charCodeAt(0).toString(16).toUpperCase()}`), g = Symbol("encodeFragmentIdentifier");
|
|
90
|
-
function le(e) {
|
|
91
|
-
switch (e.arrayFormat) {
|
|
92
|
-
case "index": return (t) => (n, r) => {
|
|
93
|
-
let i = n.length;
|
|
94
|
-
return r === void 0 || e.skipNull && r === null || e.skipEmptyString && r === "" ? n : r === null ? [...n, [
|
|
95
|
-
_(t, e),
|
|
96
|
-
"[",
|
|
97
|
-
i,
|
|
98
|
-
"]"
|
|
99
|
-
].join("")] : [...n, [
|
|
100
|
-
_(t, e),
|
|
101
|
-
"[",
|
|
102
|
-
_(i, e),
|
|
103
|
-
"]=",
|
|
104
|
-
_(r, e)
|
|
105
|
-
].join("")];
|
|
106
|
-
};
|
|
107
|
-
case "bracket": return (t) => (n, r) => r === void 0 || e.skipNull && r === null || e.skipEmptyString && r === "" ? n : r === null ? [...n, [_(t, e), "[]"].join("")] : [...n, [
|
|
108
|
-
_(t, e),
|
|
109
|
-
"[]=",
|
|
110
|
-
_(r, e)
|
|
111
|
-
].join("")];
|
|
112
|
-
case "colon-list-separator": return (t) => (n, r) => r === void 0 || e.skipNull && r === null || e.skipEmptyString && r === "" ? n : r === null ? [...n, [_(t, e), ":list="].join("")] : [...n, [
|
|
113
|
-
_(t, e),
|
|
114
|
-
":list=",
|
|
115
|
-
_(r, e)
|
|
116
|
-
].join("")];
|
|
117
|
-
case "comma":
|
|
118
|
-
case "separator":
|
|
119
|
-
case "bracket-separator": {
|
|
120
|
-
let t = e.arrayFormat === "bracket-separator" ? "[]=" : "=";
|
|
121
|
-
return (n) => (r, i) => i === void 0 || e.skipNull && i === null || e.skipEmptyString && i === "" ? r : (i = i === null ? "" : i, r.length === 0 ? [[
|
|
122
|
-
_(n, e),
|
|
123
|
-
t,
|
|
124
|
-
_(i, e)
|
|
125
|
-
].join("")] : [[r, _(i, e)].join(e.arrayFormatSeparator)]);
|
|
126
|
-
}
|
|
127
|
-
default: return (t) => (n, r) => r === void 0 || e.skipNull && r === null || e.skipEmptyString && r === "" ? n : r === null ? [...n, _(t, e)] : [...n, [
|
|
128
|
-
_(t, e),
|
|
129
|
-
"=",
|
|
130
|
-
_(r, e)
|
|
131
|
-
].join("")];
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
function ue(e) {
|
|
135
|
-
let t;
|
|
136
|
-
switch (e.arrayFormat) {
|
|
137
|
-
case "index": return (e, n, r) => {
|
|
138
|
-
if (t = /\[(\d*)]$/.exec(e), e = e.replace(/\[\d*]$/, ""), !t) {
|
|
139
|
-
r[e] = n;
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
r[e] === void 0 && (r[e] = {}), r[e][t[1]] = n;
|
|
143
|
-
};
|
|
144
|
-
case "bracket": return (e, n, r) => {
|
|
145
|
-
if (t = /(\[])$/.exec(e), e = e.replace(/\[]$/, ""), !t) {
|
|
146
|
-
r[e] = n;
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if (r[e] === void 0) {
|
|
150
|
-
r[e] = [n];
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
r[e] = [...r[e], n];
|
|
154
|
-
};
|
|
155
|
-
case "colon-list-separator": return (e, n, r) => {
|
|
156
|
-
if (t = /(:list)$/.exec(e), e = e.replace(/:list$/, ""), !t) {
|
|
157
|
-
r[e] = n;
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
if (r[e] === void 0) {
|
|
161
|
-
r[e] = [n];
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
r[e] = [...r[e], n];
|
|
165
|
-
};
|
|
166
|
-
case "comma":
|
|
167
|
-
case "separator": return (t, n, r) => {
|
|
168
|
-
r[t] = typeof n == "string" && n.includes(e.arrayFormatSeparator) ? n.split(e.arrayFormatSeparator).map((t) => v(t, e)) : n === null ? n : v(n, e);
|
|
169
|
-
};
|
|
170
|
-
case "bracket-separator": return (t, n, r) => {
|
|
171
|
-
let i = /(\[])$/.test(t);
|
|
172
|
-
if (t = t.replace(/\[]$/, ""), !i) {
|
|
173
|
-
r[t] = n && v(n, e);
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
let a = n === null ? [] : v(n, e).split(e.arrayFormatSeparator);
|
|
177
|
-
if (r[t] === void 0) {
|
|
178
|
-
r[t] = a;
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
r[t] = [...r[t], ...a];
|
|
182
|
-
};
|
|
183
|
-
default: return (e, t, n) => {
|
|
184
|
-
if (n[e] === void 0) {
|
|
185
|
-
n[e] = t;
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
n[e] = [...[n[e]].flat(), t];
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
function de(e) {
|
|
193
|
-
if (typeof e != "string" || e.length !== 1) throw TypeError("arrayFormatSeparator must be single character string");
|
|
194
|
-
}
|
|
195
|
-
function _(e, t) {
|
|
196
|
-
return t.encode ? t.strict ? ce(e) : encodeURIComponent(e) : e;
|
|
197
|
-
}
|
|
198
|
-
function v(e, t) {
|
|
199
|
-
return t.decode ? ie(e) : e;
|
|
200
|
-
}
|
|
201
|
-
function fe(e) {
|
|
202
|
-
return Array.isArray(e) ? e.sort() : typeof e == "object" ? fe(Object.keys(e)).sort((e, t) => Number(e) - Number(t)).map((t) => e[t]) : e;
|
|
203
|
-
}
|
|
204
|
-
function pe(e) {
|
|
205
|
-
let t = e.indexOf("#");
|
|
206
|
-
return t !== -1 && (e = e.slice(0, t)), e;
|
|
207
|
-
}
|
|
208
|
-
function me(e) {
|
|
209
|
-
let t = "", n = e.indexOf("#");
|
|
210
|
-
return n !== -1 && (t = e.slice(n)), t;
|
|
211
|
-
}
|
|
212
|
-
function y(e, t, n) {
|
|
213
|
-
return n === "string" && typeof e == "string" ? e : typeof n == "function" && typeof e == "string" ? n(e) : n === "boolean" && e === null ? !0 : n === "boolean" && e !== null && (e.toLowerCase() === "true" || e.toLowerCase() === "false") ? e.toLowerCase() === "true" : n === "boolean" && e !== null && (e.toLowerCase() === "1" || e.toLowerCase() === "0") ? e.toLowerCase() === "1" : n === "string[]" && t.arrayFormat !== "none" && typeof e == "string" ? [e] : n === "number[]" && t.arrayFormat !== "none" && !Number.isNaN(Number(e)) && typeof e == "string" && e.trim() !== "" ? [Number(e)] : n === "number" && !Number.isNaN(Number(e)) && typeof e == "string" && e.trim() !== "" ? Number(e) : t.parseBooleans && e !== null && (e.toLowerCase() === "true" || e.toLowerCase() === "false") ? e.toLowerCase() === "true" : t.parseNumbers && !Number.isNaN(Number(e)) && typeof e == "string" && e.trim() !== "" ? Number(e) : e;
|
|
214
|
-
}
|
|
215
|
-
function b(e) {
|
|
216
|
-
e = pe(e);
|
|
217
|
-
let t = e.indexOf("?");
|
|
218
|
-
return t === -1 ? "" : e.slice(t + 1);
|
|
219
|
-
}
|
|
220
|
-
function x(e, t) {
|
|
221
|
-
t = {
|
|
222
|
-
decode: !0,
|
|
223
|
-
sort: !0,
|
|
224
|
-
arrayFormat: "none",
|
|
225
|
-
arrayFormatSeparator: ",",
|
|
226
|
-
parseNumbers: !1,
|
|
227
|
-
parseBooleans: !1,
|
|
228
|
-
types: Object.create(null),
|
|
229
|
-
...t
|
|
230
|
-
}, de(t.arrayFormatSeparator);
|
|
231
|
-
let n = ue(t), r = Object.create(null);
|
|
232
|
-
if (typeof e != "string" || (e = e.trim().replace(/^[?#&]/, ""), !e)) return r;
|
|
233
|
-
for (let i of e.split("&")) {
|
|
234
|
-
if (i === "") continue;
|
|
235
|
-
let e = t.decode ? i.replaceAll("+", " ") : i, [a, o] = h(e, "=");
|
|
236
|
-
a === void 0 && (a = e), o = o === void 0 ? null : [
|
|
237
|
-
"comma",
|
|
238
|
-
"separator",
|
|
239
|
-
"bracket-separator"
|
|
240
|
-
].includes(t.arrayFormat) ? o : v(o, t), n(v(a, t), o, r);
|
|
241
|
-
}
|
|
242
|
-
for (let [e, n] of Object.entries(r)) if (typeof n == "object" && n && t.types[e] !== "string") for (let [r, i] of Object.entries(n)) {
|
|
243
|
-
let a = t.types[e], o = typeof a == "function" ? a : a ? a.replace("[]", "") : void 0;
|
|
244
|
-
n[r] = y(i, t, o);
|
|
245
|
-
}
|
|
246
|
-
else typeof n == "object" && n && t.types[e] === "string" ? r[e] = Object.values(n).join(t.arrayFormatSeparator) : r[e] = y(n, t, t.types[e]);
|
|
247
|
-
return t.sort === !1 ? r : (t.sort === !0 ? Object.keys(r).sort() : Object.keys(r).sort(t.sort)).reduce((e, t) => {
|
|
248
|
-
let n = r[t];
|
|
249
|
-
return e[t] = n && typeof n == "object" && !Array.isArray(n) ? fe(n) : n, e;
|
|
250
|
-
}, Object.create(null));
|
|
251
|
-
}
|
|
252
|
-
function he(e, t) {
|
|
253
|
-
if (!e) return "";
|
|
254
|
-
t = {
|
|
255
|
-
encode: !0,
|
|
256
|
-
strict: !0,
|
|
257
|
-
arrayFormat: "none",
|
|
258
|
-
arrayFormatSeparator: ",",
|
|
259
|
-
...t
|
|
260
|
-
}, de(t.arrayFormatSeparator);
|
|
261
|
-
let n = (n) => t.skipNull && se(e[n]) || t.skipEmptyString && e[n] === "", r = le(t), i = {};
|
|
262
|
-
for (let [t, r] of Object.entries(e)) n(t) || (i[t] = r);
|
|
263
|
-
let a = Object.keys(i);
|
|
264
|
-
return t.sort !== !1 && a.sort(t.sort), a.map((n) => {
|
|
265
|
-
let i = e[n];
|
|
266
|
-
if (t.replacer && (i = t.replacer(n, i), i === void 0) || i === void 0) return "";
|
|
267
|
-
if (i === null) return _(n, t);
|
|
268
|
-
if (Array.isArray(i)) {
|
|
269
|
-
if (i.length === 0 && t.arrayFormat === "bracket-separator") return _(n, t) + "[]";
|
|
270
|
-
let e = i;
|
|
271
|
-
return t.replacer && (e = i.map((e, r) => t.replacer(`${n}[${r}]`, e)).filter((e) => e !== void 0)), e.reduce(r(n), []).join("&");
|
|
272
|
-
}
|
|
273
|
-
return _(n, t) + "=" + _(i, t);
|
|
274
|
-
}).filter((e) => e.length > 0).join("&");
|
|
275
|
-
}
|
|
276
|
-
function S(e, t) {
|
|
277
|
-
t = {
|
|
278
|
-
decode: !0,
|
|
279
|
-
...t
|
|
280
|
-
};
|
|
281
|
-
let [n, r] = h(e, "#");
|
|
282
|
-
return n === void 0 && (n = e), {
|
|
283
|
-
url: n?.split("?")?.[0] ?? "",
|
|
284
|
-
query: x(b(e), t),
|
|
285
|
-
...t && t.parseFragmentIdentifier && r ? { fragmentIdentifier: v(r, t) } : {}
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
function C(e, t) {
|
|
289
|
-
t = {
|
|
290
|
-
encode: !0,
|
|
291
|
-
strict: !0,
|
|
292
|
-
[g]: !0,
|
|
293
|
-
...t
|
|
294
|
-
};
|
|
295
|
-
let n = pe(e.url).split("?")[0] || "", r = he({
|
|
296
|
-
...x(b(e.url), {
|
|
297
|
-
sort: !1,
|
|
298
|
-
...t
|
|
299
|
-
}),
|
|
300
|
-
...e.query
|
|
301
|
-
}, t);
|
|
302
|
-
r &&= `?${r}`;
|
|
303
|
-
let i = me(e.url);
|
|
304
|
-
if (typeof e.fragmentIdentifier == "string") {
|
|
305
|
-
let r = new URL(n);
|
|
306
|
-
r.hash = e.fragmentIdentifier, i = t[g] ? r.hash : `#${e.fragmentIdentifier}`;
|
|
307
|
-
}
|
|
308
|
-
return `${n}${r}${i}`;
|
|
309
|
-
}
|
|
310
|
-
function w(e, t, n) {
|
|
311
|
-
n = {
|
|
312
|
-
parseFragmentIdentifier: !0,
|
|
313
|
-
[g]: !1,
|
|
314
|
-
...n
|
|
315
|
-
};
|
|
316
|
-
let { url: r, query: i, fragmentIdentifier: a } = S(e, n);
|
|
317
|
-
return C({
|
|
318
|
-
url: r,
|
|
319
|
-
query: ae(i, t),
|
|
320
|
-
fragmentIdentifier: a
|
|
321
|
-
}, n);
|
|
322
|
-
}
|
|
323
|
-
function ge(e, t, n) {
|
|
324
|
-
return w(e, Array.isArray(t) ? (e) => !t.includes(e) : (e, n) => !t(e, n), n);
|
|
325
|
-
}
|
|
326
|
-
//#endregion
|
|
327
|
-
//#region node_modules/.pnpm/query-string@9.3.1/node_modules/query-string/index.js
|
|
328
|
-
var T = oe;
|
|
329
|
-
//#endregion
|
|
3
|
+
import { t as i } from "./query-string-D_RrDOJF.js";
|
|
4
|
+
import { a, i as o, n as s, r as c, t as l } from "./word-reader-Dy0F38kq.js";
|
|
5
|
+
import { n as u, t as d } from "./excel-reader-fp4wfcR5.js";
|
|
6
|
+
import { message as ee } from "antd";
|
|
7
|
+
import { saveAs as te } from "file-saver";
|
|
330
8
|
//#region node_modules/.pnpm/tinycolor2@1.6.0/node_modules/tinycolor2/esm/tinycolor.js
|
|
331
|
-
function
|
|
9
|
+
function f(e) {
|
|
332
10
|
"@babel/helpers - typeof";
|
|
333
|
-
return
|
|
11
|
+
return f = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
334
12
|
return typeof e;
|
|
335
13
|
} : function(e) {
|
|
336
14
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
337
|
-
},
|
|
15
|
+
}, f(e);
|
|
338
16
|
}
|
|
339
|
-
var
|
|
340
|
-
function
|
|
341
|
-
if (e ||= "", t ||= {}, e instanceof
|
|
342
|
-
if (!(this instanceof
|
|
343
|
-
var n =
|
|
17
|
+
var ne = /^\s+/, re = /\s+$/;
|
|
18
|
+
function p(e, t) {
|
|
19
|
+
if (e ||= "", t ||= {}, e instanceof p) return e;
|
|
20
|
+
if (!(this instanceof p)) return new p(e, t);
|
|
21
|
+
var n = ie(e);
|
|
344
22
|
this._originalInput = e, this._r = n.r, this._g = n.g, this._b = n.b, this._a = n.a, this._roundA = Math.round(100 * this._a) / 100, this._format = t.format || n.format, this._gradientType = t.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = n.ok;
|
|
345
23
|
}
|
|
346
|
-
|
|
24
|
+
p.prototype = {
|
|
347
25
|
isDark: function() {
|
|
348
26
|
return this.getBrightness() < 128;
|
|
349
27
|
},
|
|
@@ -371,10 +49,10 @@ D.prototype = {
|
|
|
371
49
|
return .2126 * i + .7152 * a + .0722 * o;
|
|
372
50
|
},
|
|
373
51
|
setAlpha: function(e) {
|
|
374
|
-
return this._a =
|
|
52
|
+
return this._a = b(e), this._roundA = Math.round(100 * this._a) / 100, this;
|
|
375
53
|
},
|
|
376
54
|
toHsv: function() {
|
|
377
|
-
var e =
|
|
55
|
+
var e = h(this._r, this._g, this._b);
|
|
378
56
|
return {
|
|
379
57
|
h: e.h * 360,
|
|
380
58
|
s: e.s,
|
|
@@ -383,11 +61,11 @@ D.prototype = {
|
|
|
383
61
|
};
|
|
384
62
|
},
|
|
385
63
|
toHsvString: function() {
|
|
386
|
-
var e =
|
|
64
|
+
var e = h(this._r, this._g, this._b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.v * 100);
|
|
387
65
|
return this._a == 1 ? "hsv(" + t + ", " + n + "%, " + r + "%)" : "hsva(" + t + ", " + n + "%, " + r + "%, " + this._roundA + ")";
|
|
388
66
|
},
|
|
389
67
|
toHsl: function() {
|
|
390
|
-
var e =
|
|
68
|
+
var e = m(this._r, this._g, this._b);
|
|
391
69
|
return {
|
|
392
70
|
h: e.h * 360,
|
|
393
71
|
s: e.s,
|
|
@@ -396,17 +74,17 @@ D.prototype = {
|
|
|
396
74
|
};
|
|
397
75
|
},
|
|
398
76
|
toHslString: function() {
|
|
399
|
-
var e =
|
|
77
|
+
var e = m(this._r, this._g, this._b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.l * 100);
|
|
400
78
|
return this._a == 1 ? "hsl(" + t + ", " + n + "%, " + r + "%)" : "hsla(" + t + ", " + n + "%, " + r + "%, " + this._roundA + ")";
|
|
401
79
|
},
|
|
402
80
|
toHex: function(e) {
|
|
403
|
-
return
|
|
81
|
+
return g(this._r, this._g, this._b, e);
|
|
404
82
|
},
|
|
405
83
|
toHexString: function(e) {
|
|
406
84
|
return "#" + this.toHex(e);
|
|
407
85
|
},
|
|
408
86
|
toHex8: function(e) {
|
|
409
|
-
return
|
|
87
|
+
return ce(this._r, this._g, this._b, this._a, e);
|
|
410
88
|
},
|
|
411
89
|
toHex8String: function(e) {
|
|
412
90
|
return "#" + this.toHex8(e);
|
|
@@ -424,23 +102,23 @@ D.prototype = {
|
|
|
424
102
|
},
|
|
425
103
|
toPercentageRgb: function() {
|
|
426
104
|
return {
|
|
427
|
-
r: Math.round(
|
|
428
|
-
g: Math.round(
|
|
429
|
-
b: Math.round(
|
|
105
|
+
r: Math.round(x(this._r, 255) * 100) + "%",
|
|
106
|
+
g: Math.round(x(this._g, 255) * 100) + "%",
|
|
107
|
+
b: Math.round(x(this._b, 255) * 100) + "%",
|
|
430
108
|
a: this._a
|
|
431
109
|
};
|
|
432
110
|
},
|
|
433
111
|
toPercentageRgbString: function() {
|
|
434
|
-
return this._a == 1 ? "rgb(" + Math.round(
|
|
112
|
+
return this._a == 1 ? "rgb(" + Math.round(x(this._r, 255) * 100) + "%, " + Math.round(x(this._g, 255) * 100) + "%, " + Math.round(x(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(x(this._r, 255) * 100) + "%, " + Math.round(x(this._g, 255) * 100) + "%, " + Math.round(x(this._b, 255) * 100) + "%, " + this._roundA + ")";
|
|
435
113
|
},
|
|
436
114
|
toName: function() {
|
|
437
|
-
return this._a === 0 ? "transparent" : this._a < 1 ? !1 :
|
|
115
|
+
return this._a === 0 ? "transparent" : this._a < 1 ? !1 : be[g(this._r, this._g, this._b, !0)] || !1;
|
|
438
116
|
},
|
|
439
117
|
toFilter: function(e) {
|
|
440
|
-
var t = "#" +
|
|
118
|
+
var t = "#" + _(this._r, this._g, this._b, this._a), n = t, r = this._gradientType ? "GradientType = 1, " : "";
|
|
441
119
|
if (e) {
|
|
442
|
-
var i =
|
|
443
|
-
n = "#" +
|
|
120
|
+
var i = p(e);
|
|
121
|
+
n = "#" + _(i._r, i._g, i._b, i._a);
|
|
444
122
|
}
|
|
445
123
|
return "progid:DXImageTransform.Microsoft.gradient(" + r + "startColorstr=" + t + ",endColorstr=" + n + ")";
|
|
446
124
|
},
|
|
@@ -451,69 +129,69 @@ D.prototype = {
|
|
|
451
129
|
return !t && r && (e === "hex" || e === "hex6" || e === "hex3" || e === "hex4" || e === "hex8" || e === "name") ? e === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (n = this.toHexString()), e === "hex3" && (n = this.toHexString(!0)), e === "hex4" && (n = this.toHex8String(!0)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), n || this.toHexString());
|
|
452
130
|
},
|
|
453
131
|
clone: function() {
|
|
454
|
-
return
|
|
132
|
+
return p(this.toString());
|
|
455
133
|
},
|
|
456
134
|
_applyModification: function(e, t) {
|
|
457
135
|
var n = e.apply(null, [this].concat([].slice.call(t)));
|
|
458
136
|
return this._r = n._r, this._g = n._g, this._b = n._b, this.setAlpha(n._a), this;
|
|
459
137
|
},
|
|
460
138
|
lighten: function() {
|
|
461
|
-
return this._applyModification(
|
|
139
|
+
return this._applyModification(fe, arguments);
|
|
462
140
|
},
|
|
463
141
|
brighten: function() {
|
|
464
|
-
return this._applyModification(
|
|
142
|
+
return this._applyModification(pe, arguments);
|
|
465
143
|
},
|
|
466
144
|
darken: function() {
|
|
467
|
-
return this._applyModification(
|
|
145
|
+
return this._applyModification(me, arguments);
|
|
468
146
|
},
|
|
469
147
|
desaturate: function() {
|
|
470
|
-
return this._applyModification(
|
|
148
|
+
return this._applyModification(le, arguments);
|
|
471
149
|
},
|
|
472
150
|
saturate: function() {
|
|
473
|
-
return this._applyModification(
|
|
151
|
+
return this._applyModification(ue, arguments);
|
|
474
152
|
},
|
|
475
153
|
greyscale: function() {
|
|
476
|
-
return this._applyModification(
|
|
154
|
+
return this._applyModification(de, arguments);
|
|
477
155
|
},
|
|
478
156
|
spin: function() {
|
|
479
|
-
return this._applyModification(
|
|
157
|
+
return this._applyModification(he, arguments);
|
|
480
158
|
},
|
|
481
159
|
_applyCombination: function(e, t) {
|
|
482
160
|
return e.apply(null, [this].concat([].slice.call(t)));
|
|
483
161
|
},
|
|
484
162
|
analogous: function() {
|
|
485
|
-
return this._applyCombination(
|
|
163
|
+
return this._applyCombination(ve, arguments);
|
|
486
164
|
},
|
|
487
165
|
complement: function() {
|
|
488
|
-
return this._applyCombination(
|
|
166
|
+
return this._applyCombination(ge, arguments);
|
|
489
167
|
},
|
|
490
168
|
monochromatic: function() {
|
|
491
|
-
return this._applyCombination(
|
|
169
|
+
return this._applyCombination(ye, arguments);
|
|
492
170
|
},
|
|
493
171
|
splitcomplement: function() {
|
|
494
|
-
return this._applyCombination(
|
|
172
|
+
return this._applyCombination(_e, arguments);
|
|
495
173
|
},
|
|
496
174
|
triad: function() {
|
|
497
|
-
return this._applyCombination(
|
|
175
|
+
return this._applyCombination(v, [3]);
|
|
498
176
|
},
|
|
499
177
|
tetrad: function() {
|
|
500
|
-
return this._applyCombination(
|
|
178
|
+
return this._applyCombination(v, [4]);
|
|
501
179
|
}
|
|
502
|
-
},
|
|
503
|
-
if (
|
|
180
|
+
}, p.fromRatio = function(e, t) {
|
|
181
|
+
if (f(e) == "object") {
|
|
504
182
|
var n = {};
|
|
505
|
-
for (var r in e) e.hasOwnProperty(r) && (r === "a" ? n[r] = e[r] : n[r] =
|
|
183
|
+
for (var r in e) e.hasOwnProperty(r) && (r === "a" ? n[r] = e[r] : n[r] = T(e[r]));
|
|
506
184
|
e = n;
|
|
507
185
|
}
|
|
508
|
-
return
|
|
186
|
+
return p(e, t);
|
|
509
187
|
};
|
|
510
|
-
function
|
|
188
|
+
function ie(e) {
|
|
511
189
|
var t = {
|
|
512
190
|
r: 0,
|
|
513
191
|
g: 0,
|
|
514
192
|
b: 0
|
|
515
193
|
}, n = 1, r = null, i = null, a = null, o = !1, s = !1;
|
|
516
|
-
return typeof e == "string" && (e =
|
|
194
|
+
return typeof e == "string" && (e = we(e)), f(e) == "object" && (k(e.r) && k(e.g) && k(e.b) ? (t = ae(e.r, e.g, e.b), o = !0, s = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : k(e.h) && k(e.s) && k(e.v) ? (r = T(e.s), i = T(e.v), t = se(e.h, r, i), o = !0, s = "hsv") : k(e.h) && k(e.s) && k(e.l) && (r = T(e.s), a = T(e.l), t = oe(e.h, r, a), o = !0, s = "hsl"), e.hasOwnProperty("a") && (n = e.a)), n = b(n), {
|
|
517
195
|
ok: o,
|
|
518
196
|
format: e.format || s,
|
|
519
197
|
r: Math.min(255, Math.max(t.r, 0)),
|
|
@@ -522,15 +200,15 @@ function ye(e) {
|
|
|
522
200
|
a: n
|
|
523
201
|
};
|
|
524
202
|
}
|
|
525
|
-
function
|
|
203
|
+
function ae(e, t, n) {
|
|
526
204
|
return {
|
|
527
|
-
r:
|
|
528
|
-
g:
|
|
529
|
-
b:
|
|
205
|
+
r: x(e, 255) * 255,
|
|
206
|
+
g: x(t, 255) * 255,
|
|
207
|
+
b: x(n, 255) * 255
|
|
530
208
|
};
|
|
531
209
|
}
|
|
532
|
-
function
|
|
533
|
-
e =
|
|
210
|
+
function m(e, t, n) {
|
|
211
|
+
e = x(e, 255), t = x(t, 255), n = x(n, 255);
|
|
534
212
|
var r = Math.max(e, t, n), i = Math.min(e, t, n), a, o, s = (r + i) / 2;
|
|
535
213
|
if (r == i) a = o = 0;
|
|
536
214
|
else {
|
|
@@ -554,9 +232,9 @@ function O(e, t, n) {
|
|
|
554
232
|
l: s
|
|
555
233
|
};
|
|
556
234
|
}
|
|
557
|
-
function
|
|
235
|
+
function oe(e, t, n) {
|
|
558
236
|
var r, i, a;
|
|
559
|
-
e =
|
|
237
|
+
e = x(e, 360), t = x(t, 100), n = x(n, 100);
|
|
560
238
|
function o(e, t, n) {
|
|
561
239
|
return n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
562
240
|
}
|
|
@@ -571,8 +249,8 @@ function xe(e, t, n) {
|
|
|
571
249
|
b: a * 255
|
|
572
250
|
};
|
|
573
251
|
}
|
|
574
|
-
function
|
|
575
|
-
e =
|
|
252
|
+
function h(e, t, n) {
|
|
253
|
+
e = x(e, 255), t = x(t, 255), n = x(n, 255);
|
|
576
254
|
var r = Math.max(e, t, n), i = Math.min(e, t, n), a, o, s = r, c = r - i;
|
|
577
255
|
if (o = r === 0 ? 0 : c / r, r == i) a = 0;
|
|
578
256
|
else {
|
|
@@ -595,8 +273,8 @@ function k(e, t, n) {
|
|
|
595
273
|
v: s
|
|
596
274
|
};
|
|
597
275
|
}
|
|
598
|
-
function
|
|
599
|
-
e =
|
|
276
|
+
function se(e, t, n) {
|
|
277
|
+
e = x(e, 360) * 6, t = x(t, 100), n = x(n, 100);
|
|
600
278
|
var r = Math.floor(e), i = e - r, a = n * (1 - t), o = n * (1 - i * t), s = n * (1 - (1 - i) * t), c = r % 6, l = [
|
|
601
279
|
n,
|
|
602
280
|
o,
|
|
@@ -625,131 +303,131 @@ function Se(e, t, n) {
|
|
|
625
303
|
b: d * 255
|
|
626
304
|
};
|
|
627
305
|
}
|
|
628
|
-
function
|
|
306
|
+
function g(e, t, n, r) {
|
|
629
307
|
var i = [
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
308
|
+
w(Math.round(e).toString(16)),
|
|
309
|
+
w(Math.round(t).toString(16)),
|
|
310
|
+
w(Math.round(n).toString(16))
|
|
633
311
|
];
|
|
634
312
|
return r && i[0].charAt(0) == i[0].charAt(1) && i[1].charAt(0) == i[1].charAt(1) && i[2].charAt(0) == i[2].charAt(1) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join("");
|
|
635
313
|
}
|
|
636
|
-
function
|
|
314
|
+
function ce(e, t, n, r, i) {
|
|
637
315
|
var a = [
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
316
|
+
w(Math.round(e).toString(16)),
|
|
317
|
+
w(Math.round(t).toString(16)),
|
|
318
|
+
w(Math.round(n).toString(16)),
|
|
319
|
+
w(E(r))
|
|
642
320
|
];
|
|
643
321
|
return i && a[0].charAt(0) == a[0].charAt(1) && a[1].charAt(0) == a[1].charAt(1) && a[2].charAt(0) == a[2].charAt(1) && a[3].charAt(0) == a[3].charAt(1) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
|
|
644
322
|
}
|
|
645
|
-
function
|
|
323
|
+
function _(e, t, n, r) {
|
|
646
324
|
return [
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
325
|
+
w(E(r)),
|
|
326
|
+
w(Math.round(e).toString(16)),
|
|
327
|
+
w(Math.round(t).toString(16)),
|
|
328
|
+
w(Math.round(n).toString(16))
|
|
651
329
|
].join("");
|
|
652
330
|
}
|
|
653
|
-
|
|
654
|
-
return !e || !t ? !1 :
|
|
655
|
-
},
|
|
656
|
-
return
|
|
331
|
+
p.equals = function(e, t) {
|
|
332
|
+
return !e || !t ? !1 : p(e).toRgbString() == p(t).toRgbString();
|
|
333
|
+
}, p.random = function() {
|
|
334
|
+
return p.fromRatio({
|
|
657
335
|
r: Math.random(),
|
|
658
336
|
g: Math.random(),
|
|
659
337
|
b: Math.random()
|
|
660
338
|
});
|
|
661
339
|
};
|
|
662
|
-
function
|
|
340
|
+
function le(e, t) {
|
|
663
341
|
t = t === 0 ? 0 : t || 10;
|
|
664
|
-
var n =
|
|
665
|
-
return n.s -= t / 100, n.s =
|
|
342
|
+
var n = p(e).toHsl();
|
|
343
|
+
return n.s -= t / 100, n.s = S(n.s), p(n);
|
|
666
344
|
}
|
|
667
|
-
function
|
|
345
|
+
function ue(e, t) {
|
|
668
346
|
t = t === 0 ? 0 : t || 10;
|
|
669
|
-
var n =
|
|
670
|
-
return n.s += t / 100, n.s =
|
|
347
|
+
var n = p(e).toHsl();
|
|
348
|
+
return n.s += t / 100, n.s = S(n.s), p(n);
|
|
671
349
|
}
|
|
672
|
-
function
|
|
673
|
-
return
|
|
350
|
+
function de(e) {
|
|
351
|
+
return p(e).desaturate(100);
|
|
674
352
|
}
|
|
675
|
-
function
|
|
353
|
+
function fe(e, t) {
|
|
676
354
|
t = t === 0 ? 0 : t || 10;
|
|
677
|
-
var n =
|
|
678
|
-
return n.l += t / 100, n.l =
|
|
355
|
+
var n = p(e).toHsl();
|
|
356
|
+
return n.l += t / 100, n.l = S(n.l), p(n);
|
|
679
357
|
}
|
|
680
|
-
function
|
|
358
|
+
function pe(e, t) {
|
|
681
359
|
t = t === 0 ? 0 : t || 10;
|
|
682
|
-
var n =
|
|
683
|
-
return n.r = Math.max(0, Math.min(255, n.r - Math.round(255 * -(t / 100)))), n.g = Math.max(0, Math.min(255, n.g - Math.round(255 * -(t / 100)))), n.b = Math.max(0, Math.min(255, n.b - Math.round(255 * -(t / 100)))),
|
|
360
|
+
var n = p(e).toRgb();
|
|
361
|
+
return n.r = Math.max(0, Math.min(255, n.r - Math.round(255 * -(t / 100)))), n.g = Math.max(0, Math.min(255, n.g - Math.round(255 * -(t / 100)))), n.b = Math.max(0, Math.min(255, n.b - Math.round(255 * -(t / 100)))), p(n);
|
|
684
362
|
}
|
|
685
|
-
function
|
|
363
|
+
function me(e, t) {
|
|
686
364
|
t = t === 0 ? 0 : t || 10;
|
|
687
|
-
var n =
|
|
688
|
-
return n.l -= t / 100, n.l =
|
|
365
|
+
var n = p(e).toHsl();
|
|
366
|
+
return n.l -= t / 100, n.l = S(n.l), p(n);
|
|
689
367
|
}
|
|
690
|
-
function
|
|
691
|
-
var n =
|
|
692
|
-
return n.h = r < 0 ? 360 + r : r,
|
|
368
|
+
function he(e, t) {
|
|
369
|
+
var n = p(e).toHsl(), r = (n.h + t) % 360;
|
|
370
|
+
return n.h = r < 0 ? 360 + r : r, p(n);
|
|
693
371
|
}
|
|
694
|
-
function
|
|
695
|
-
var t =
|
|
696
|
-
return t.h = (t.h + 180) % 360,
|
|
372
|
+
function ge(e) {
|
|
373
|
+
var t = p(e).toHsl();
|
|
374
|
+
return t.h = (t.h + 180) % 360, p(t);
|
|
697
375
|
}
|
|
698
|
-
function
|
|
376
|
+
function v(e, t) {
|
|
699
377
|
if (isNaN(t) || t <= 0) throw Error("Argument to polyad must be a positive number");
|
|
700
|
-
for (var n =
|
|
378
|
+
for (var n = p(e).toHsl(), r = [p(e)], i = 360 / t, a = 1; a < t; a++) r.push(p({
|
|
701
379
|
h: (n.h + a * i) % 360,
|
|
702
380
|
s: n.s,
|
|
703
381
|
l: n.l
|
|
704
382
|
}));
|
|
705
383
|
return r;
|
|
706
384
|
}
|
|
707
|
-
function
|
|
708
|
-
var t =
|
|
385
|
+
function _e(e) {
|
|
386
|
+
var t = p(e).toHsl(), n = t.h;
|
|
709
387
|
return [
|
|
710
|
-
|
|
711
|
-
|
|
388
|
+
p(e),
|
|
389
|
+
p({
|
|
712
390
|
h: (n + 72) % 360,
|
|
713
391
|
s: t.s,
|
|
714
392
|
l: t.l
|
|
715
393
|
}),
|
|
716
|
-
|
|
394
|
+
p({
|
|
717
395
|
h: (n + 216) % 360,
|
|
718
396
|
s: t.s,
|
|
719
397
|
l: t.l
|
|
720
398
|
})
|
|
721
399
|
];
|
|
722
400
|
}
|
|
723
|
-
function
|
|
401
|
+
function ve(e, t, n) {
|
|
724
402
|
t ||= 6, n ||= 30;
|
|
725
|
-
var r =
|
|
726
|
-
for (r.h = (r.h - (i * t >> 1) + 720) % 360; --t;) r.h = (r.h + i) % 360, a.push(
|
|
403
|
+
var r = p(e).toHsl(), i = 360 / n, a = [p(e)];
|
|
404
|
+
for (r.h = (r.h - (i * t >> 1) + 720) % 360; --t;) r.h = (r.h + i) % 360, a.push(p(r));
|
|
727
405
|
return a;
|
|
728
406
|
}
|
|
729
|
-
function
|
|
407
|
+
function ye(e, t) {
|
|
730
408
|
t ||= 6;
|
|
731
|
-
for (var n =
|
|
409
|
+
for (var n = p(e).toHsv(), r = n.h, i = n.s, a = n.v, o = [], s = 1 / t; t--;) o.push(p({
|
|
732
410
|
h: r,
|
|
733
411
|
s: i,
|
|
734
412
|
v: a
|
|
735
413
|
})), a = (a + s) % 1;
|
|
736
414
|
return o;
|
|
737
415
|
}
|
|
738
|
-
|
|
416
|
+
p.mix = function(e, t, n) {
|
|
739
417
|
n = n === 0 ? 0 : n || 50;
|
|
740
|
-
var r =
|
|
741
|
-
return
|
|
418
|
+
var r = p(e).toRgb(), i = p(t).toRgb(), a = n / 100;
|
|
419
|
+
return p({
|
|
742
420
|
r: (i.r - r.r) * a + r.r,
|
|
743
421
|
g: (i.g - r.g) * a + r.g,
|
|
744
422
|
b: (i.b - r.b) * a + r.b,
|
|
745
423
|
a: (i.a - r.a) * a + r.a
|
|
746
424
|
});
|
|
747
|
-
},
|
|
748
|
-
var n =
|
|
425
|
+
}, p.readability = function(e, t) {
|
|
426
|
+
var n = p(e), r = p(t);
|
|
749
427
|
return (Math.max(n.getLuminance(), r.getLuminance()) + .05) / (Math.min(n.getLuminance(), r.getLuminance()) + .05);
|
|
750
|
-
},
|
|
751
|
-
var r =
|
|
752
|
-
switch (i =
|
|
428
|
+
}, p.isReadable = function(e, t, n) {
|
|
429
|
+
var r = p.readability(e, t), i, a = !1;
|
|
430
|
+
switch (i = Te(n), i.level + i.size) {
|
|
753
431
|
case "AAsmall":
|
|
754
432
|
case "AAAlarge":
|
|
755
433
|
a = r >= 4.5;
|
|
@@ -762,16 +440,16 @@ D.mix = function(e, t, n) {
|
|
|
762
440
|
break;
|
|
763
441
|
}
|
|
764
442
|
return a;
|
|
765
|
-
},
|
|
443
|
+
}, p.mostReadable = function(e, t, n) {
|
|
766
444
|
var r = null, i = 0, a, o, s, c;
|
|
767
445
|
n ||= {}, o = n.includeFallbackColors, s = n.level, c = n.size;
|
|
768
|
-
for (var l = 0; l < t.length; l++) a =
|
|
769
|
-
return
|
|
446
|
+
for (var l = 0; l < t.length; l++) a = p.readability(e, t[l]), a > i && (i = a, r = p(t[l]));
|
|
447
|
+
return p.isReadable(e, r, {
|
|
770
448
|
level: s,
|
|
771
449
|
size: c
|
|
772
|
-
}) || !o ? r : (n.includeFallbackColors = !1,
|
|
450
|
+
}) || !o ? r : (n.includeFallbackColors = !1, p.mostReadable(e, ["#fff", "#000"], n));
|
|
773
451
|
};
|
|
774
|
-
var
|
|
452
|
+
var y = p.names = {
|
|
775
453
|
aliceblue: "f0f8ff",
|
|
776
454
|
antiquewhite: "faebd7",
|
|
777
455
|
aqua: "0ff",
|
|
@@ -921,45 +599,45 @@ var N = D.names = {
|
|
|
921
599
|
whitesmoke: "f5f5f5",
|
|
922
600
|
yellow: "ff0",
|
|
923
601
|
yellowgreen: "9acd32"
|
|
924
|
-
},
|
|
925
|
-
function
|
|
602
|
+
}, be = p.hexNames = xe(y);
|
|
603
|
+
function xe(e) {
|
|
926
604
|
var t = {};
|
|
927
605
|
for (var n in e) e.hasOwnProperty(n) && (t[e[n]] = n);
|
|
928
606
|
return t;
|
|
929
607
|
}
|
|
930
|
-
function
|
|
608
|
+
function b(e) {
|
|
931
609
|
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
932
610
|
}
|
|
933
|
-
function
|
|
934
|
-
|
|
935
|
-
var n =
|
|
611
|
+
function x(e, t) {
|
|
612
|
+
Se(e) && (e = "100%");
|
|
613
|
+
var n = Ce(e);
|
|
936
614
|
return e = Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(e * t, 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : e % t / parseFloat(t);
|
|
937
615
|
}
|
|
938
|
-
function
|
|
616
|
+
function S(e) {
|
|
939
617
|
return Math.min(1, Math.max(0, e));
|
|
940
618
|
}
|
|
941
|
-
function
|
|
619
|
+
function C(e) {
|
|
942
620
|
return parseInt(e, 16);
|
|
943
621
|
}
|
|
944
|
-
function
|
|
622
|
+
function Se(e) {
|
|
945
623
|
return typeof e == "string" && e.indexOf(".") != -1 && parseFloat(e) === 1;
|
|
946
624
|
}
|
|
947
|
-
function
|
|
625
|
+
function Ce(e) {
|
|
948
626
|
return typeof e == "string" && e.indexOf("%") != -1;
|
|
949
627
|
}
|
|
950
|
-
function
|
|
628
|
+
function w(e) {
|
|
951
629
|
return e.length == 1 ? "0" + e : "" + e;
|
|
952
630
|
}
|
|
953
|
-
function
|
|
631
|
+
function T(e) {
|
|
954
632
|
return e <= 1 && (e = e * 100 + "%"), e;
|
|
955
633
|
}
|
|
956
|
-
function
|
|
634
|
+
function E(e) {
|
|
957
635
|
return Math.round(parseFloat(e) * 255).toString(16);
|
|
958
636
|
}
|
|
959
|
-
function
|
|
960
|
-
return
|
|
637
|
+
function D(e) {
|
|
638
|
+
return C(e) / 255;
|
|
961
639
|
}
|
|
962
|
-
var
|
|
640
|
+
var O = function() {
|
|
963
641
|
var e = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)", t = "[\\s|\\(]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")\\s*\\)?", n = "[\\s|\\(]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")\\s*\\)?";
|
|
964
642
|
return {
|
|
965
643
|
CSS_UNIT: new RegExp(e),
|
|
@@ -975,13 +653,13 @@ var H = function() {
|
|
|
975
653
|
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
976
654
|
};
|
|
977
655
|
}();
|
|
978
|
-
function
|
|
979
|
-
return !!
|
|
656
|
+
function k(e) {
|
|
657
|
+
return !!O.CSS_UNIT.exec(e);
|
|
980
658
|
}
|
|
981
|
-
function
|
|
982
|
-
e = e.replace(
|
|
659
|
+
function we(e) {
|
|
660
|
+
e = e.replace(ne, "").replace(re, "").toLowerCase();
|
|
983
661
|
var t = !1;
|
|
984
|
-
if (
|
|
662
|
+
if (y[e]) e = y[e], t = !0;
|
|
985
663
|
else if (e == "transparent") return {
|
|
986
664
|
r: 0,
|
|
987
665
|
g: 0,
|
|
@@ -990,58 +668,58 @@ function ze(e) {
|
|
|
990
668
|
format: "name"
|
|
991
669
|
};
|
|
992
670
|
var n;
|
|
993
|
-
return (n =
|
|
671
|
+
return (n = O.rgb.exec(e)) ? {
|
|
994
672
|
r: n[1],
|
|
995
673
|
g: n[2],
|
|
996
674
|
b: n[3]
|
|
997
|
-
} : (n =
|
|
675
|
+
} : (n = O.rgba.exec(e)) ? {
|
|
998
676
|
r: n[1],
|
|
999
677
|
g: n[2],
|
|
1000
678
|
b: n[3],
|
|
1001
679
|
a: n[4]
|
|
1002
|
-
} : (n =
|
|
680
|
+
} : (n = O.hsl.exec(e)) ? {
|
|
1003
681
|
h: n[1],
|
|
1004
682
|
s: n[2],
|
|
1005
683
|
l: n[3]
|
|
1006
|
-
} : (n =
|
|
684
|
+
} : (n = O.hsla.exec(e)) ? {
|
|
1007
685
|
h: n[1],
|
|
1008
686
|
s: n[2],
|
|
1009
687
|
l: n[3],
|
|
1010
688
|
a: n[4]
|
|
1011
|
-
} : (n =
|
|
689
|
+
} : (n = O.hsv.exec(e)) ? {
|
|
1012
690
|
h: n[1],
|
|
1013
691
|
s: n[2],
|
|
1014
692
|
v: n[3]
|
|
1015
|
-
} : (n =
|
|
693
|
+
} : (n = O.hsva.exec(e)) ? {
|
|
1016
694
|
h: n[1],
|
|
1017
695
|
s: n[2],
|
|
1018
696
|
v: n[3],
|
|
1019
697
|
a: n[4]
|
|
1020
|
-
} : (n =
|
|
1021
|
-
r:
|
|
1022
|
-
g:
|
|
1023
|
-
b:
|
|
1024
|
-
a:
|
|
698
|
+
} : (n = O.hex8.exec(e)) ? {
|
|
699
|
+
r: C(n[1]),
|
|
700
|
+
g: C(n[2]),
|
|
701
|
+
b: C(n[3]),
|
|
702
|
+
a: D(n[4]),
|
|
1025
703
|
format: t ? "name" : "hex8"
|
|
1026
|
-
} : (n =
|
|
1027
|
-
r:
|
|
1028
|
-
g:
|
|
1029
|
-
b:
|
|
704
|
+
} : (n = O.hex6.exec(e)) ? {
|
|
705
|
+
r: C(n[1]),
|
|
706
|
+
g: C(n[2]),
|
|
707
|
+
b: C(n[3]),
|
|
1030
708
|
format: t ? "name" : "hex"
|
|
1031
|
-
} : (n =
|
|
1032
|
-
r:
|
|
1033
|
-
g:
|
|
1034
|
-
b:
|
|
1035
|
-
a:
|
|
709
|
+
} : (n = O.hex4.exec(e)) ? {
|
|
710
|
+
r: C(n[1] + "" + n[1]),
|
|
711
|
+
g: C(n[2] + "" + n[2]),
|
|
712
|
+
b: C(n[3] + "" + n[3]),
|
|
713
|
+
a: D(n[4] + "" + n[4]),
|
|
1036
714
|
format: t ? "name" : "hex8"
|
|
1037
|
-
} : (n =
|
|
1038
|
-
r:
|
|
1039
|
-
g:
|
|
1040
|
-
b:
|
|
715
|
+
} : (n = O.hex3.exec(e)) ? {
|
|
716
|
+
r: C(n[1] + "" + n[1]),
|
|
717
|
+
g: C(n[2] + "" + n[2]),
|
|
718
|
+
b: C(n[3] + "" + n[3]),
|
|
1041
719
|
format: t ? "name" : "hex"
|
|
1042
720
|
} : !1;
|
|
1043
721
|
}
|
|
1044
|
-
function
|
|
722
|
+
function Te(e) {
|
|
1045
723
|
var t, n;
|
|
1046
724
|
return e ||= {
|
|
1047
725
|
level: "AA",
|
|
@@ -1053,9 +731,9 @@ function Be(e) {
|
|
|
1053
731
|
}
|
|
1054
732
|
//#endregion
|
|
1055
733
|
//#region src/lib/utils/download-stream.ts
|
|
1056
|
-
var
|
|
1057
|
-
|
|
1058
|
-
},
|
|
734
|
+
var A = (e, t) => {
|
|
735
|
+
te(e, t);
|
|
736
|
+
}, j = /* @__PURE__ */ t(r(), 1), M = (e) => {
|
|
1059
737
|
let t = [];
|
|
1060
738
|
if (!e) return {
|
|
1061
739
|
results: t,
|
|
@@ -1081,7 +759,7 @@ var W = (e, t) => {
|
|
|
1081
759
|
results: t,
|
|
1082
760
|
remaining: r
|
|
1083
761
|
};
|
|
1084
|
-
},
|
|
762
|
+
}, N = async (e) => {
|
|
1085
763
|
try {
|
|
1086
764
|
return {
|
|
1087
765
|
error: !0,
|
|
@@ -1093,9 +771,9 @@ var W = (e, t) => {
|
|
|
1093
771
|
message: e.statusText
|
|
1094
772
|
};
|
|
1095
773
|
}
|
|
1096
|
-
},
|
|
774
|
+
}, P = async (e) => {
|
|
1097
775
|
let t = e.method || "POST", n = e.url;
|
|
1098
|
-
e.params && (n = `${n}?${
|
|
776
|
+
e.params && (n = `${n}?${i.stringify(e.params)}`);
|
|
1099
777
|
let r = await fetch(n, {
|
|
1100
778
|
method: t,
|
|
1101
779
|
body: t === "POST" ? JSON.stringify(e.data) : null,
|
|
@@ -1108,24 +786,24 @@ var W = (e, t) => {
|
|
|
1108
786
|
return r.ok ? {
|
|
1109
787
|
reader: r?.body?.getReader(),
|
|
1110
788
|
decoder: new TextDecoder("utf-8", { fatal: !0 })
|
|
1111
|
-
} : await
|
|
1112
|
-
},
|
|
789
|
+
} : await N(r);
|
|
790
|
+
}, F = (e) => {
|
|
1113
791
|
let t = new FormData(), n = (e, n) => {
|
|
1114
792
|
n instanceof File ? t.append(e, n) : typeof n == "object" && n ? t.append(e, JSON.stringify(n)) : n != null && t.append(e, n);
|
|
1115
793
|
};
|
|
1116
794
|
for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && n(t, e[t]);
|
|
1117
795
|
return t;
|
|
1118
|
-
},
|
|
796
|
+
}, I = async (e) => {
|
|
1119
797
|
let { url: t } = e, n = await fetch(t, {
|
|
1120
798
|
method: "POST",
|
|
1121
|
-
body:
|
|
799
|
+
body: F(e.data),
|
|
1122
800
|
signal: e.signal
|
|
1123
801
|
});
|
|
1124
802
|
return n.ok ? {
|
|
1125
803
|
reader: n?.body?.getReader(),
|
|
1126
804
|
decoder: new TextDecoder("utf-8", { fatal: !0 })
|
|
1127
|
-
} : await
|
|
1128
|
-
},
|
|
805
|
+
} : await N(n);
|
|
806
|
+
}, Ee = async (e, t, n, r = 200) => {
|
|
1129
807
|
class i {
|
|
1130
808
|
buffer = [];
|
|
1131
809
|
add(e) {
|
|
@@ -1141,7 +819,7 @@ var W = (e, t) => {
|
|
|
1141
819
|
return this.buffer;
|
|
1142
820
|
}
|
|
1143
821
|
}
|
|
1144
|
-
let a = new i(), o = (0,
|
|
822
|
+
let a = new i(), o = (0, j.throttle)(() => {
|
|
1145
823
|
a.flush();
|
|
1146
824
|
}, r), s = !0, c = "";
|
|
1147
825
|
for (; s;) {
|
|
@@ -1156,7 +834,7 @@ var W = (e, t) => {
|
|
|
1156
834
|
let e = c.slice(7).trim(), t = JSON.parse(e);
|
|
1157
835
|
a.add({ error: t }), c = "";
|
|
1158
836
|
} else {
|
|
1159
|
-
let { results: e, remaining: t } =
|
|
837
|
+
let { results: e, remaining: t } = M(c);
|
|
1160
838
|
e.forEach((e) => {
|
|
1161
839
|
a.add(e);
|
|
1162
840
|
}), c = t;
|
|
@@ -1167,14 +845,14 @@ var W = (e, t) => {
|
|
|
1167
845
|
}
|
|
1168
846
|
if (n) {
|
|
1169
847
|
if (c += t.decode(), c) {
|
|
1170
|
-
let { results: e, remaining: t } =
|
|
848
|
+
let { results: e, remaining: t } = M(c);
|
|
1171
849
|
e.forEach((e) => a.add(e));
|
|
1172
850
|
}
|
|
1173
851
|
a.flush(), s = !1;
|
|
1174
852
|
break;
|
|
1175
853
|
}
|
|
1176
854
|
}
|
|
1177
|
-
},
|
|
855
|
+
}, De = async (e, t, n) => {
|
|
1178
856
|
if (!e) return;
|
|
1179
857
|
let r = e.split("\n");
|
|
1180
858
|
for (let e of r) {
|
|
@@ -1198,7 +876,7 @@ var W = (e, t) => {
|
|
|
1198
876
|
}
|
|
1199
877
|
}
|
|
1200
878
|
}
|
|
1201
|
-
},
|
|
879
|
+
}, L = async (e, t, n, r = 200) => {
|
|
1202
880
|
let i = "";
|
|
1203
881
|
class a {
|
|
1204
882
|
buffer = [];
|
|
@@ -1220,7 +898,7 @@ var W = (e, t) => {
|
|
|
1220
898
|
for (this.failed = !1, this.isFlushing = !0; this.buffer.length > 0;) {
|
|
1221
899
|
let t = this.buffer.shift();
|
|
1222
900
|
try {
|
|
1223
|
-
|
|
901
|
+
De(t, this.callback, e);
|
|
1224
902
|
} catch (e) {
|
|
1225
903
|
console.error("Error processing buffer:", e), this.failed = !0, this.buffer.unshift(t);
|
|
1226
904
|
break;
|
|
@@ -1233,7 +911,7 @@ var W = (e, t) => {
|
|
|
1233
911
|
return this.buffer;
|
|
1234
912
|
}
|
|
1235
913
|
}
|
|
1236
|
-
let o = new a(n), s = (0,
|
|
914
|
+
let o = new a(n), s = (0, j.throttle)(async () => {
|
|
1237
915
|
o.flush();
|
|
1238
916
|
}, r);
|
|
1239
917
|
for (;;) {
|
|
@@ -1255,11 +933,11 @@ var W = (e, t) => {
|
|
|
1255
933
|
console.log("Error reading stream data:", e);
|
|
1256
934
|
}
|
|
1257
935
|
}
|
|
1258
|
-
},
|
|
936
|
+
}, R = (e) => new Promise((t, n) => {
|
|
1259
937
|
let r = new FileReader();
|
|
1260
938
|
r.readAsDataURL(e), r.onload = () => t(r.result), r.onerror = (e) => n(e);
|
|
1261
|
-
}),
|
|
1262
|
-
let i = new Blob([e], { type: t }), a =
|
|
939
|
+
}), z = async (e, t) => new Promise((n, r) => {
|
|
940
|
+
let i = new Blob([e], { type: t }), a = K(i.size), o = document.createElement("audio"), s = URL.createObjectURL(i);
|
|
1263
941
|
o.src = s, o.addEventListener("loadedmetadata", () => {
|
|
1264
942
|
let e = o.duration;
|
|
1265
943
|
n({
|
|
@@ -1272,15 +950,15 @@ var W = (e, t) => {
|
|
|
1272
950
|
}), o.addEventListener("ended", () => {
|
|
1273
951
|
URL.revokeObjectURL(o.src);
|
|
1274
952
|
}), o.addEventListener("error", () => {
|
|
1275
|
-
URL.revokeObjectURL(s),
|
|
953
|
+
URL.revokeObjectURL(s), ee.error("Failed to load audio metadata invalid file"), r(/* @__PURE__ */ Error("Failed to load audio metadata invalid file"));
|
|
1276
954
|
});
|
|
1277
|
-
}),
|
|
955
|
+
}), B = async (e) => new Promise((t, n) => {
|
|
1278
956
|
let r = new FileReader();
|
|
1279
957
|
r.onload = async function(r) {
|
|
1280
958
|
try {
|
|
1281
959
|
let n = r.target.result;
|
|
1282
960
|
t({
|
|
1283
|
-
...await
|
|
961
|
+
...await z(n, e.type) || {},
|
|
1284
962
|
name: e.name
|
|
1285
963
|
});
|
|
1286
964
|
} catch (e) {
|
|
@@ -1290,53 +968,53 @@ var W = (e, t) => {
|
|
|
1290
968
|
});
|
|
1291
969
|
//#endregion
|
|
1292
970
|
//#region src/lib/utils/pcm-to-wav.ts
|
|
1293
|
-
function
|
|
971
|
+
function V(e, t, n) {
|
|
1294
972
|
for (let r = 0; r < n.length; r++) e.setUint8(t + r, n.charCodeAt(r));
|
|
1295
973
|
}
|
|
1296
|
-
function
|
|
974
|
+
function H(e, t = 24e3, n = 1, r = 16) {
|
|
1297
975
|
let i = new Uint8Array(e), a = i.length, o = new ArrayBuffer(44 + a), s = new DataView(o);
|
|
1298
|
-
return
|
|
976
|
+
return V(s, 0, "RIFF"), s.setUint32(4, 36 + a, !0), V(s, 8, "WAVE"), V(s, 12, "fmt "), s.setUint32(16, 16, !0), s.setUint16(20, 1, !0), s.setUint16(22, n, !0), s.setUint32(24, t, !0), s.setUint32(28, t * n * (r / 8), !0), s.setUint16(32, r / 8 * n, !0), s.setUint16(34, r, !0), V(s, 36, "data"), s.setUint32(40, a, !0), new Uint8Array(o).set(i, 44), new Blob([o], { type: "audio/wav" });
|
|
1299
977
|
}
|
|
1300
978
|
//#endregion
|
|
1301
979
|
//#region src/lib/utils/index.ts
|
|
1302
|
-
var
|
|
1303
|
-
base64ToFile: () =>
|
|
1304
|
-
convertFileSize: () =>
|
|
1305
|
-
convertFileSizeByUnit: () =>
|
|
1306
|
-
convertFileToBase64: () =>
|
|
1307
|
-
cosineSimilarity: () =>
|
|
1308
|
-
createFormData: () =>
|
|
1309
|
-
downloadFile: () =>
|
|
1310
|
-
errorHandler: () =>
|
|
1311
|
-
exportJsonToExcel: () =>
|
|
1312
|
-
fetchChunkedData: () =>
|
|
1313
|
-
fetchChunkedDataPostFormData: () =>
|
|
1314
|
-
formatLargeNumber: () =>
|
|
1315
|
-
formatNumber: () =>
|
|
1316
|
-
formatTime: () =>
|
|
1317
|
-
genColors: () =>
|
|
1318
|
-
generateRandomNumber: () =>
|
|
1319
|
-
handleBatchRequest: () =>
|
|
1320
|
-
isHTMLDocumentString: () =>
|
|
1321
|
-
isNotEmptyValue: () =>
|
|
1322
|
-
isNotEmptyValueAllowNull: () =>
|
|
1323
|
-
isOnline: () =>
|
|
1324
|
-
loadAudioData: () =>
|
|
1325
|
-
loadLanguageConfig: () =>
|
|
1326
|
-
parseParamsString: () =>
|
|
1327
|
-
pcmToWav: () =>
|
|
1328
|
-
platformCall: () =>
|
|
1329
|
-
readAudioFile: () =>
|
|
1330
|
-
readBlob: () =>
|
|
1331
|
-
readEpubContent: () =>
|
|
1332
|
-
readExcelContent: () =>
|
|
1333
|
-
readHtmlContent: () =>
|
|
1334
|
-
readLargeStreamData: () =>
|
|
1335
|
-
readPDFContent: () =>
|
|
1336
|
-
readPptxContent: () =>
|
|
1337
|
-
readStreamData: () =>
|
|
1338
|
-
readWordContent: () =>
|
|
1339
|
-
}),
|
|
980
|
+
var Oe = /* @__PURE__ */ n({
|
|
981
|
+
base64ToFile: () => Fe,
|
|
982
|
+
convertFileSize: () => K,
|
|
983
|
+
convertFileSizeByUnit: () => q,
|
|
984
|
+
convertFileToBase64: () => R,
|
|
985
|
+
cosineSimilarity: () => Ae,
|
|
986
|
+
createFormData: () => F,
|
|
987
|
+
downloadFile: () => A,
|
|
988
|
+
errorHandler: () => N,
|
|
989
|
+
exportJsonToExcel: () => d,
|
|
990
|
+
fetchChunkedData: () => P,
|
|
991
|
+
fetchChunkedDataPostFormData: () => I,
|
|
992
|
+
formatLargeNumber: () => Z,
|
|
993
|
+
formatNumber: () => X,
|
|
994
|
+
formatTime: () => Y,
|
|
995
|
+
genColors: () => Le,
|
|
996
|
+
generateRandomNumber: () => Ne,
|
|
997
|
+
handleBatchRequest: () => G,
|
|
998
|
+
isHTMLDocumentString: () => Me,
|
|
999
|
+
isNotEmptyValue: () => U,
|
|
1000
|
+
isNotEmptyValueAllowNull: () => W,
|
|
1001
|
+
isOnline: () => Ie,
|
|
1002
|
+
loadAudioData: () => z,
|
|
1003
|
+
loadLanguageConfig: () => Q,
|
|
1004
|
+
parseParamsString: () => $,
|
|
1005
|
+
pcmToWav: () => H,
|
|
1006
|
+
platformCall: () => J,
|
|
1007
|
+
readAudioFile: () => B,
|
|
1008
|
+
readBlob: () => ke,
|
|
1009
|
+
readEpubContent: () => a,
|
|
1010
|
+
readExcelContent: () => u,
|
|
1011
|
+
readHtmlContent: () => s,
|
|
1012
|
+
readLargeStreamData: () => L,
|
|
1013
|
+
readPDFContent: () => o,
|
|
1014
|
+
readPptxContent: () => c,
|
|
1015
|
+
readStreamData: () => Ee,
|
|
1016
|
+
readWordContent: () => l
|
|
1017
|
+
}), U = (e) => Array.isArray(e) ? e.length > 0 : !!e || e === 0 || e === !1, W = (e) => Array.isArray(e) ? e.length > 0 : !!e || e === 0 || e === !1 || e === null, G = async (e, t) => Promise.allSettled(e.map((e) => t(e))), K = (e, t = 1, n = !1) => {
|
|
1340
1018
|
if (!e) return n ? "" : 0;
|
|
1341
1019
|
let r = 1024, i = [
|
|
1342
1020
|
"B",
|
|
@@ -1352,8 +1030,8 @@ var Je = /* @__PURE__ */ n({
|
|
|
1352
1030
|
2
|
|
1353
1031
|
], o = e, s = 0;
|
|
1354
1032
|
for (; o >= r && s < i.length - 1;) o /= r, s++;
|
|
1355
|
-
return `${
|
|
1356
|
-
},
|
|
1033
|
+
return `${j.default.round(o, a[s])} ${i[s]}`;
|
|
1034
|
+
}, q = (e) => {
|
|
1357
1035
|
let { sizeInBytes: t, allowEmpty: n = !1, defaultUnit: r = "B" } = e;
|
|
1358
1036
|
if (!t) return n ? "" : 0;
|
|
1359
1037
|
let i = 1024, a = [
|
|
@@ -1370,14 +1048,14 @@ var Je = /* @__PURE__ */ n({
|
|
|
1370
1048
|
2
|
|
1371
1049
|
], s = t, c = a.indexOf(r);
|
|
1372
1050
|
for (; s >= i && c < a.length - 1;) s /= i, c++;
|
|
1373
|
-
return `${
|
|
1374
|
-
},
|
|
1051
|
+
return `${j.default.round(s, o[c])} ${a[c]}`;
|
|
1052
|
+
}, J = () => {
|
|
1375
1053
|
let e = navigator.userAgent;
|
|
1376
1054
|
return {
|
|
1377
1055
|
isMac: e.indexOf("Mac") !== -1,
|
|
1378
1056
|
isWin: e.indexOf("Win") !== -1
|
|
1379
1057
|
};
|
|
1380
|
-
},
|
|
1058
|
+
}, Y = (e) => {
|
|
1381
1059
|
if (isNaN(e) || !e || e === Infinity) return "00:00";
|
|
1382
1060
|
let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.floor(e % 60), i = [
|
|
1383
1061
|
t.toString().padStart(2, "0"),
|
|
@@ -1385,15 +1063,15 @@ var Je = /* @__PURE__ */ n({
|
|
|
1385
1063
|
r.toString().padStart(2, "0")
|
|
1386
1064
|
];
|
|
1387
1065
|
return t > 0 ? `${i[0]}:${i[1]}:${i[2]}` : `${i[1]}:${i[2]}`;
|
|
1388
|
-
},
|
|
1389
|
-
function
|
|
1066
|
+
}, X = (e) => e ? e >= 1e6 ? (e / 1e6).toFixed(2) + "M" : e >= 1e3 ? (e / 1e3).toFixed(2) + "k" : e.toString() : "0", Z = (e) => typeof e != "number" || isNaN(e) ? e : e >= 1e9 ? (e / 1e9).toFixed(1).replace(/\.0$/, "") + "B" : e >= 1e6 ? (e / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : e;
|
|
1067
|
+
function Q(t) {
|
|
1390
1068
|
let n = e.context(`./${t}`, !1, /\.ts$/), r = {};
|
|
1391
1069
|
return n.keys().forEach((e) => {
|
|
1392
1070
|
let t = n(e).default, i = e.replace(/(\.\/|\.ts)/g, "");
|
|
1393
1071
|
r[i] = t;
|
|
1394
1072
|
}), r;
|
|
1395
1073
|
}
|
|
1396
|
-
function
|
|
1074
|
+
function ke(e) {
|
|
1397
1075
|
return new Promise((t) => {
|
|
1398
1076
|
let n = new FileReader();
|
|
1399
1077
|
n.onload = function(e) {
|
|
@@ -1401,13 +1079,13 @@ function rt(e) {
|
|
|
1401
1079
|
}, n.readAsText(e, "utf-8");
|
|
1402
1080
|
});
|
|
1403
1081
|
}
|
|
1404
|
-
var
|
|
1082
|
+
var Ae = (e, t) => {
|
|
1405
1083
|
if (e.length !== t.length) throw Error("both vectors must have the same length");
|
|
1406
1084
|
let n = e.reduce((e, n, r) => e + n * (t?.[r] || 0), 0), r = Math.sqrt(e.reduce((e, t) => e + t * t, 0)), i = Math.sqrt(t.reduce((e, t) => e + t * t, 0));
|
|
1407
1085
|
if (r === 0 || i === 0) throw Error("both vectors must have a length greater than 0");
|
|
1408
1086
|
return n / (r * i);
|
|
1409
|
-
},
|
|
1410
|
-
function
|
|
1087
|
+
}, je = /^<html>(.|\n|\r)*<\/html>$/i, Me = (e) => je.test(e?.trim()), Ne = () => Math.floor(Math.random() * 4294967296);
|
|
1088
|
+
function Pe(e, t = "", n = 512) {
|
|
1411
1089
|
try {
|
|
1412
1090
|
let r = e.replace(/^data:image\/[^;]+;base64,/, ""), i = atob(r), a = [];
|
|
1413
1091
|
for (let e = 0; e < i.length; e += n) {
|
|
@@ -1421,22 +1099,22 @@ function ct(e, t = "", n = 512) {
|
|
|
1421
1099
|
return null;
|
|
1422
1100
|
}
|
|
1423
1101
|
}
|
|
1424
|
-
var
|
|
1102
|
+
var Fe = (e, t) => {
|
|
1425
1103
|
try {
|
|
1426
1104
|
if (!e) return null;
|
|
1427
1105
|
console.log("base64String:", e);
|
|
1428
1106
|
let n = e.match(/data:(.*?);base64,/);
|
|
1429
1107
|
if (!n) throw Error("Invalid base64 string");
|
|
1430
|
-
let r = n[1], i =
|
|
1108
|
+
let r = n[1], i = Pe(e, r);
|
|
1431
1109
|
if (!i) throw Error("Failed to convert base64 to blob");
|
|
1432
1110
|
return new File([i], t || r, { type: r });
|
|
1433
1111
|
} catch {
|
|
1434
1112
|
return null;
|
|
1435
1113
|
}
|
|
1436
|
-
},
|
|
1437
|
-
let r =
|
|
1114
|
+
}, Ie = () => window.navigator.onLine, Le = ({ color: e, alpha1: t, alpha2: n }) => {
|
|
1115
|
+
let r = p(e), i = t || r.getAlpha(), a = n || r.getAlpha();
|
|
1438
1116
|
return [r.setAlpha(i).toRgbString(), r.setAlpha(a).toRgbString()];
|
|
1439
|
-
},
|
|
1117
|
+
}, $ = (e) => {
|
|
1440
1118
|
if (!e || !e.trim()) return [];
|
|
1441
1119
|
let t = e.replace(/\n/g, " ").replace(/\s\\\s/g, " ").replace(/\s+/g, " ").trim(), n = [], r = [], i = "", a = !1, o = "", s = 0;
|
|
1442
1120
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -1455,4 +1133,4 @@ var lt = (e, t) => {
|
|
|
1455
1133
|
return n;
|
|
1456
1134
|
};
|
|
1457
1135
|
//#endregion
|
|
1458
|
-
export {
|
|
1136
|
+
export { A, B as C, I as D, P as E, L as O, z as S, N as T, J as _, Z as a, H as b, Le as c, Me as d, U as f, $ as g, Q as h, Ae as i, Ee as k, Ne as l, Ie as m, K as n, X as o, W as p, q as r, Y as s, Fe as t, G as u, ke as v, F as w, R as x, Oe as y };
|