@gpustack/core-ui 1.0.33 → 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.d.ts +7 -0
- package/dist/charts.es.js +859 -0
- package/dist/{useIntl-ClqxSZNY.js → classnames-fDEzIsab.js} +4 -35
- package/dist/{editor-wrap-BYfIcvle.js → editor-wrap-CwTlkQeF.js} +1 -1
- package/dist/{excel-reader-Bgm6Gd2H.js → excel-reader-fp4wfcR5.js} +2 -2
- package/dist/excel.es.js +1 -1
- package/dist/file-readers.es.js +3 -3
- package/dist/{highlight-code-DrKwSNa-.js → highlight-code-D8pDWkNV.js} +79 -75
- package/dist/index.css +1 -1
- package/dist/index.es.js +10415 -19095
- package/dist/lib/components/form/wrapper/index.d.ts +5 -5
- package/dist/lib/components/index.d.ts +0 -9
- package/dist/lib/components/table/components/layout.d.ts +5 -5
- package/dist/lib-pzRljAkJ.js +2 -0
- package/dist/{mammoth-3bu5V8Au.js → mammoth-CCaoEfUd.js} +1 -1
- package/dist/markdown.es.js +8 -8
- 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/useCoreUIContext-_TAsecw_.js +29 -0
- package/dist/useIntl-CBh5liUu.js +12 -0
- package/dist/{utils-KsqXE63M.js → utils-CHekcXoK.js} +121 -440
- package/dist/utils.es.js +4 -4
- package/dist/{word-reader-CSmNlWcx.js → word-reader-Dy0F38kq.js} +4 -4
- package/dist/yaml-editor.es.js +19 -19
- package/package.json +9 -1
- package/dist/lib-EFH8CfCi.js +0 -2
- /package/dist/{epubjs-DKV8rhQU.js → epubjs-CCPXKy-j.js} +0 -0
- /package/dist/{jszip-1lXK4oQn.js → jszip-D49X9-jp.js} +0 -0
- /package/dist/{lodash-i3XVVuwG.js → lodash-CFrt21kh.js} +0 -0
- /package/dist/{pdfjs-dist-DwiA-2_8.js → pdfjs-dist-D4wgLSOe.js} +0 -0
- /package/dist/{xlsx-DLkyLHwb.js → xlsx-C7SIkCvo.js} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { i as e, o as t, r as n } from "./rolldown-runtime-BETGA6I9.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
2
|
+
import { t as r } from "./lodash-CFrt21kh.js";
|
|
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
6
|
import { message as ee } from "antd";
|
|
7
|
+
import { saveAs as te } from "file-saver";
|
|
7
8
|
//#region node_modules/.pnpm/tinycolor2@1.6.0/node_modules/tinycolor2/esm/tinycolor.js
|
|
8
9
|
function f(e) {
|
|
9
10
|
"@babel/helpers - typeof";
|
|
@@ -13,11 +14,11 @@ function f(e) {
|
|
|
13
14
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
14
15
|
}, f(e);
|
|
15
16
|
}
|
|
16
|
-
var
|
|
17
|
+
var ne = /^\s+/, re = /\s+$/;
|
|
17
18
|
function p(e, t) {
|
|
18
19
|
if (e ||= "", t ||= {}, e instanceof p) return e;
|
|
19
20
|
if (!(this instanceof p)) return new p(e, t);
|
|
20
|
-
var n =
|
|
21
|
+
var n = ie(e);
|
|
21
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;
|
|
22
23
|
}
|
|
23
24
|
p.prototype = {
|
|
@@ -83,7 +84,7 @@ p.prototype = {
|
|
|
83
84
|
return "#" + this.toHex(e);
|
|
84
85
|
},
|
|
85
86
|
toHex8: function(e) {
|
|
86
|
-
return
|
|
87
|
+
return ce(this._r, this._g, this._b, this._a, e);
|
|
87
88
|
},
|
|
88
89
|
toHex8String: function(e) {
|
|
89
90
|
return "#" + this.toHex8(e);
|
|
@@ -111,7 +112,7 @@ p.prototype = {
|
|
|
111
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 + ")";
|
|
112
113
|
},
|
|
113
114
|
toName: function() {
|
|
114
|
-
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;
|
|
115
116
|
},
|
|
116
117
|
toFilter: function(e) {
|
|
117
118
|
var t = "#" + _(this._r, this._g, this._b, this._a), n = t, r = this._gradientType ? "GradientType = 1, " : "";
|
|
@@ -135,40 +136,40 @@ p.prototype = {
|
|
|
135
136
|
return this._r = n._r, this._g = n._g, this._b = n._b, this.setAlpha(n._a), this;
|
|
136
137
|
},
|
|
137
138
|
lighten: function() {
|
|
138
|
-
return this._applyModification(
|
|
139
|
+
return this._applyModification(fe, arguments);
|
|
139
140
|
},
|
|
140
141
|
brighten: function() {
|
|
141
|
-
return this._applyModification(
|
|
142
|
+
return this._applyModification(pe, arguments);
|
|
142
143
|
},
|
|
143
144
|
darken: function() {
|
|
144
|
-
return this._applyModification(
|
|
145
|
+
return this._applyModification(me, arguments);
|
|
145
146
|
},
|
|
146
147
|
desaturate: function() {
|
|
147
|
-
return this._applyModification(
|
|
148
|
+
return this._applyModification(le, arguments);
|
|
148
149
|
},
|
|
149
150
|
saturate: function() {
|
|
150
|
-
return this._applyModification(
|
|
151
|
+
return this._applyModification(ue, arguments);
|
|
151
152
|
},
|
|
152
153
|
greyscale: function() {
|
|
153
|
-
return this._applyModification(
|
|
154
|
+
return this._applyModification(de, arguments);
|
|
154
155
|
},
|
|
155
156
|
spin: function() {
|
|
156
|
-
return this._applyModification(
|
|
157
|
+
return this._applyModification(he, arguments);
|
|
157
158
|
},
|
|
158
159
|
_applyCombination: function(e, t) {
|
|
159
160
|
return e.apply(null, [this].concat([].slice.call(t)));
|
|
160
161
|
},
|
|
161
162
|
analogous: function() {
|
|
162
|
-
return this._applyCombination(
|
|
163
|
+
return this._applyCombination(ve, arguments);
|
|
163
164
|
},
|
|
164
165
|
complement: function() {
|
|
165
|
-
return this._applyCombination(
|
|
166
|
+
return this._applyCombination(ge, arguments);
|
|
166
167
|
},
|
|
167
168
|
monochromatic: function() {
|
|
168
|
-
return this._applyCombination(
|
|
169
|
+
return this._applyCombination(ye, arguments);
|
|
169
170
|
},
|
|
170
171
|
splitcomplement: function() {
|
|
171
|
-
return this._applyCombination(
|
|
172
|
+
return this._applyCombination(_e, arguments);
|
|
172
173
|
},
|
|
173
174
|
triad: function() {
|
|
174
175
|
return this._applyCombination(v, [3]);
|
|
@@ -184,13 +185,13 @@ p.prototype = {
|
|
|
184
185
|
}
|
|
185
186
|
return p(e, t);
|
|
186
187
|
};
|
|
187
|
-
function
|
|
188
|
+
function ie(e) {
|
|
188
189
|
var t = {
|
|
189
190
|
r: 0,
|
|
190
191
|
g: 0,
|
|
191
192
|
b: 0
|
|
192
193
|
}, n = 1, r = null, i = null, a = null, o = !1, s = !1;
|
|
193
|
-
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), {
|
|
194
195
|
ok: o,
|
|
195
196
|
format: e.format || s,
|
|
196
197
|
r: Math.min(255, Math.max(t.r, 0)),
|
|
@@ -199,7 +200,7 @@ function re(e) {
|
|
|
199
200
|
a: n
|
|
200
201
|
};
|
|
201
202
|
}
|
|
202
|
-
function
|
|
203
|
+
function ae(e, t, n) {
|
|
203
204
|
return {
|
|
204
205
|
r: x(e, 255) * 255,
|
|
205
206
|
g: x(t, 255) * 255,
|
|
@@ -231,7 +232,7 @@ function m(e, t, n) {
|
|
|
231
232
|
l: s
|
|
232
233
|
};
|
|
233
234
|
}
|
|
234
|
-
function
|
|
235
|
+
function oe(e, t, n) {
|
|
235
236
|
var r, i, a;
|
|
236
237
|
e = x(e, 360), t = x(t, 100), n = x(n, 100);
|
|
237
238
|
function o(e, t, n) {
|
|
@@ -272,7 +273,7 @@ function h(e, t, n) {
|
|
|
272
273
|
v: s
|
|
273
274
|
};
|
|
274
275
|
}
|
|
275
|
-
function
|
|
276
|
+
function se(e, t, n) {
|
|
276
277
|
e = x(e, 360) * 6, t = x(t, 100), n = x(n, 100);
|
|
277
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 = [
|
|
278
279
|
n,
|
|
@@ -310,7 +311,7 @@ function g(e, t, n, r) {
|
|
|
310
311
|
];
|
|
311
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("");
|
|
312
313
|
}
|
|
313
|
-
function
|
|
314
|
+
function ce(e, t, n, r, i) {
|
|
314
315
|
var a = [
|
|
315
316
|
w(Math.round(e).toString(16)),
|
|
316
317
|
w(Math.round(t).toString(16)),
|
|
@@ -336,39 +337,39 @@ p.equals = function(e, t) {
|
|
|
336
337
|
b: Math.random()
|
|
337
338
|
});
|
|
338
339
|
};
|
|
339
|
-
function
|
|
340
|
+
function le(e, t) {
|
|
340
341
|
t = t === 0 ? 0 : t || 10;
|
|
341
342
|
var n = p(e).toHsl();
|
|
342
343
|
return n.s -= t / 100, n.s = S(n.s), p(n);
|
|
343
344
|
}
|
|
344
|
-
function
|
|
345
|
+
function ue(e, t) {
|
|
345
346
|
t = t === 0 ? 0 : t || 10;
|
|
346
347
|
var n = p(e).toHsl();
|
|
347
348
|
return n.s += t / 100, n.s = S(n.s), p(n);
|
|
348
349
|
}
|
|
349
|
-
function
|
|
350
|
+
function de(e) {
|
|
350
351
|
return p(e).desaturate(100);
|
|
351
352
|
}
|
|
352
|
-
function
|
|
353
|
+
function fe(e, t) {
|
|
353
354
|
t = t === 0 ? 0 : t || 10;
|
|
354
355
|
var n = p(e).toHsl();
|
|
355
356
|
return n.l += t / 100, n.l = S(n.l), p(n);
|
|
356
357
|
}
|
|
357
|
-
function
|
|
358
|
+
function pe(e, t) {
|
|
358
359
|
t = t === 0 ? 0 : t || 10;
|
|
359
360
|
var n = p(e).toRgb();
|
|
360
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);
|
|
361
362
|
}
|
|
362
|
-
function
|
|
363
|
+
function me(e, t) {
|
|
363
364
|
t = t === 0 ? 0 : t || 10;
|
|
364
365
|
var n = p(e).toHsl();
|
|
365
366
|
return n.l -= t / 100, n.l = S(n.l), p(n);
|
|
366
367
|
}
|
|
367
|
-
function
|
|
368
|
+
function he(e, t) {
|
|
368
369
|
var n = p(e).toHsl(), r = (n.h + t) % 360;
|
|
369
370
|
return n.h = r < 0 ? 360 + r : r, p(n);
|
|
370
371
|
}
|
|
371
|
-
function
|
|
372
|
+
function ge(e) {
|
|
372
373
|
var t = p(e).toHsl();
|
|
373
374
|
return t.h = (t.h + 180) % 360, p(t);
|
|
374
375
|
}
|
|
@@ -381,7 +382,7 @@ function v(e, t) {
|
|
|
381
382
|
}));
|
|
382
383
|
return r;
|
|
383
384
|
}
|
|
384
|
-
function
|
|
385
|
+
function _e(e) {
|
|
385
386
|
var t = p(e).toHsl(), n = t.h;
|
|
386
387
|
return [
|
|
387
388
|
p(e),
|
|
@@ -397,13 +398,13 @@ function ge(e) {
|
|
|
397
398
|
})
|
|
398
399
|
];
|
|
399
400
|
}
|
|
400
|
-
function
|
|
401
|
+
function ve(e, t, n) {
|
|
401
402
|
t ||= 6, n ||= 30;
|
|
402
403
|
var r = p(e).toHsl(), i = 360 / n, a = [p(e)];
|
|
403
404
|
for (r.h = (r.h - (i * t >> 1) + 720) % 360; --t;) r.h = (r.h + i) % 360, a.push(p(r));
|
|
404
405
|
return a;
|
|
405
406
|
}
|
|
406
|
-
function
|
|
407
|
+
function ye(e, t) {
|
|
407
408
|
t ||= 6;
|
|
408
409
|
for (var n = p(e).toHsv(), r = n.h, i = n.s, a = n.v, o = [], s = 1 / t; t--;) o.push(p({
|
|
409
410
|
h: r,
|
|
@@ -426,7 +427,7 @@ p.mix = function(e, t, n) {
|
|
|
426
427
|
return (Math.max(n.getLuminance(), r.getLuminance()) + .05) / (Math.min(n.getLuminance(), r.getLuminance()) + .05);
|
|
427
428
|
}, p.isReadable = function(e, t, n) {
|
|
428
429
|
var r = p.readability(e, t), i, a = !1;
|
|
429
|
-
switch (i =
|
|
430
|
+
switch (i = Te(n), i.level + i.size) {
|
|
430
431
|
case "AAsmall":
|
|
431
432
|
case "AAAlarge":
|
|
432
433
|
a = r >= 4.5;
|
|
@@ -598,8 +599,8 @@ var y = p.names = {
|
|
|
598
599
|
whitesmoke: "f5f5f5",
|
|
599
600
|
yellow: "ff0",
|
|
600
601
|
yellowgreen: "9acd32"
|
|
601
|
-
},
|
|
602
|
-
function
|
|
602
|
+
}, be = p.hexNames = xe(y);
|
|
603
|
+
function xe(e) {
|
|
603
604
|
var t = {};
|
|
604
605
|
for (var n in e) e.hasOwnProperty(n) && (t[e[n]] = n);
|
|
605
606
|
return t;
|
|
@@ -608,8 +609,8 @@ function b(e) {
|
|
|
608
609
|
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
609
610
|
}
|
|
610
611
|
function x(e, t) {
|
|
611
|
-
|
|
612
|
-
var n =
|
|
612
|
+
Se(e) && (e = "100%");
|
|
613
|
+
var n = Ce(e);
|
|
613
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);
|
|
614
615
|
}
|
|
615
616
|
function S(e) {
|
|
@@ -618,10 +619,10 @@ function S(e) {
|
|
|
618
619
|
function C(e) {
|
|
619
620
|
return parseInt(e, 16);
|
|
620
621
|
}
|
|
621
|
-
function
|
|
622
|
+
function Se(e) {
|
|
622
623
|
return typeof e == "string" && e.indexOf(".") != -1 && parseFloat(e) === 1;
|
|
623
624
|
}
|
|
624
|
-
function
|
|
625
|
+
function Ce(e) {
|
|
625
626
|
return typeof e == "string" && e.indexOf("%") != -1;
|
|
626
627
|
}
|
|
627
628
|
function w(e) {
|
|
@@ -655,8 +656,8 @@ var O = function() {
|
|
|
655
656
|
function k(e) {
|
|
656
657
|
return !!O.CSS_UNIT.exec(e);
|
|
657
658
|
}
|
|
658
|
-
function
|
|
659
|
-
e = e.replace(
|
|
659
|
+
function we(e) {
|
|
660
|
+
e = e.replace(ne, "").replace(re, "").toLowerCase();
|
|
660
661
|
var t = !1;
|
|
661
662
|
if (y[e]) e = y[e], t = !0;
|
|
662
663
|
else if (e == "transparent") return {
|
|
@@ -718,7 +719,7 @@ function Ce(e) {
|
|
|
718
719
|
format: t ? "name" : "hex"
|
|
719
720
|
} : !1;
|
|
720
721
|
}
|
|
721
|
-
function
|
|
722
|
+
function Te(e) {
|
|
722
723
|
var t, n;
|
|
723
724
|
return e ||= {
|
|
724
725
|
level: "AA",
|
|
@@ -731,328 +732,8 @@ function we(e) {
|
|
|
731
732
|
//#endregion
|
|
732
733
|
//#region src/lib/utils/download-stream.ts
|
|
733
734
|
var A = (e, t) => {
|
|
734
|
-
|
|
735
|
-
}, j =
|
|
736
|
-
function P(e, t) {
|
|
737
|
-
try {
|
|
738
|
-
return [decodeURIComponent(e.join(""))];
|
|
739
|
-
} catch {}
|
|
740
|
-
if (e.length === 1) return e;
|
|
741
|
-
t ||= 1;
|
|
742
|
-
let n = e.slice(0, t), r = e.slice(t);
|
|
743
|
-
return Array.prototype.concat.call([], P(n), P(r));
|
|
744
|
-
}
|
|
745
|
-
function Te(e) {
|
|
746
|
-
try {
|
|
747
|
-
return decodeURIComponent(e);
|
|
748
|
-
} catch {
|
|
749
|
-
let t = e.match(M) || [];
|
|
750
|
-
for (let n = 1; n < t.length; n++) e = P(t, n).join(""), t = e.match(M) || [];
|
|
751
|
-
return e;
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
function Ee(e) {
|
|
755
|
-
let t = {
|
|
756
|
-
"%FE%FF": "��",
|
|
757
|
-
"%FF%FE": "��"
|
|
758
|
-
}, n = N.exec(e);
|
|
759
|
-
for (; n;) {
|
|
760
|
-
try {
|
|
761
|
-
t[n[0]] = decodeURIComponent(n[0]);
|
|
762
|
-
} catch {
|
|
763
|
-
let e = Te(n[0]);
|
|
764
|
-
e !== n[0] && (t[n[0]] = e);
|
|
765
|
-
}
|
|
766
|
-
n = N.exec(e);
|
|
767
|
-
}
|
|
768
|
-
t["%C2"] = "�";
|
|
769
|
-
let r = Object.keys(t);
|
|
770
|
-
for (let n of r) e = e.replace(new RegExp(n, "g"), t[n]);
|
|
771
|
-
return e;
|
|
772
|
-
}
|
|
773
|
-
function De(e) {
|
|
774
|
-
if (typeof e != "string") throw TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof e + "`");
|
|
775
|
-
try {
|
|
776
|
-
return decodeURIComponent(e);
|
|
777
|
-
} catch {
|
|
778
|
-
return Ee(e);
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
//#endregion
|
|
782
|
-
//#region node_modules/.pnpm/filter-obj@5.1.0/node_modules/filter-obj/index.js
|
|
783
|
-
function Oe(e, t) {
|
|
784
|
-
let n = {};
|
|
785
|
-
if (Array.isArray(t)) for (let r of t) {
|
|
786
|
-
let t = Object.getOwnPropertyDescriptor(e, r);
|
|
787
|
-
t?.enumerable && Object.defineProperty(n, r, t);
|
|
788
|
-
}
|
|
789
|
-
else for (let r of Reflect.ownKeys(e)) {
|
|
790
|
-
let i = Object.getOwnPropertyDescriptor(e, r);
|
|
791
|
-
if (i.enumerable) {
|
|
792
|
-
let a = e[r];
|
|
793
|
-
t(r, a, e) && Object.defineProperty(n, r, i);
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
return n;
|
|
797
|
-
}
|
|
798
|
-
//#endregion
|
|
799
|
-
//#region node_modules/.pnpm/split-on-first@3.0.0/node_modules/split-on-first/index.js
|
|
800
|
-
function F(e, t) {
|
|
801
|
-
if (!(typeof e == "string" && typeof t == "string")) throw TypeError("Expected the arguments to be of type `string`");
|
|
802
|
-
if (e === "" || t === "") return [];
|
|
803
|
-
let n = e.indexOf(t);
|
|
804
|
-
return n === -1 ? [] : [e.slice(0, n), e.slice(n + t.length)];
|
|
805
|
-
}
|
|
806
|
-
//#endregion
|
|
807
|
-
//#region node_modules/.pnpm/query-string@9.3.1/node_modules/query-string/base.js
|
|
808
|
-
var ke = /* @__PURE__ */ n({
|
|
809
|
-
exclude: () => Le,
|
|
810
|
-
extract: () => H,
|
|
811
|
-
parse: () => U,
|
|
812
|
-
parseUrl: () => G,
|
|
813
|
-
pick: () => Ie,
|
|
814
|
-
stringify: () => W,
|
|
815
|
-
stringifyUrl: () => K
|
|
816
|
-
}), Ae = (e) => e == null, je = (e) => encodeURIComponent(e).replaceAll(/[!'()*]/g, (e) => `%${e.charCodeAt(0).toString(16).toUpperCase()}`), I = Symbol("encodeFragmentIdentifier");
|
|
817
|
-
function Me(e) {
|
|
818
|
-
switch (e.arrayFormat) {
|
|
819
|
-
case "index": return (t) => (n, r) => {
|
|
820
|
-
let i = n.length;
|
|
821
|
-
return r === void 0 || e.skipNull && r === null || e.skipEmptyString && r === "" ? n : r === null ? [...n, [
|
|
822
|
-
R(t, e),
|
|
823
|
-
"[",
|
|
824
|
-
i,
|
|
825
|
-
"]"
|
|
826
|
-
].join("")] : [...n, [
|
|
827
|
-
R(t, e),
|
|
828
|
-
"[",
|
|
829
|
-
R(i, e),
|
|
830
|
-
"]=",
|
|
831
|
-
R(r, e)
|
|
832
|
-
].join("")];
|
|
833
|
-
};
|
|
834
|
-
case "bracket": return (t) => (n, r) => r === void 0 || e.skipNull && r === null || e.skipEmptyString && r === "" ? n : r === null ? [...n, [R(t, e), "[]"].join("")] : [...n, [
|
|
835
|
-
R(t, e),
|
|
836
|
-
"[]=",
|
|
837
|
-
R(r, e)
|
|
838
|
-
].join("")];
|
|
839
|
-
case "colon-list-separator": return (t) => (n, r) => r === void 0 || e.skipNull && r === null || e.skipEmptyString && r === "" ? n : r === null ? [...n, [R(t, e), ":list="].join("")] : [...n, [
|
|
840
|
-
R(t, e),
|
|
841
|
-
":list=",
|
|
842
|
-
R(r, e)
|
|
843
|
-
].join("")];
|
|
844
|
-
case "comma":
|
|
845
|
-
case "separator":
|
|
846
|
-
case "bracket-separator": {
|
|
847
|
-
let t = e.arrayFormat === "bracket-separator" ? "[]=" : "=";
|
|
848
|
-
return (n) => (r, i) => i === void 0 || e.skipNull && i === null || e.skipEmptyString && i === "" ? r : (i = i === null ? "" : i, r.length === 0 ? [[
|
|
849
|
-
R(n, e),
|
|
850
|
-
t,
|
|
851
|
-
R(i, e)
|
|
852
|
-
].join("")] : [[r, R(i, e)].join(e.arrayFormatSeparator)]);
|
|
853
|
-
}
|
|
854
|
-
default: return (t) => (n, r) => r === void 0 || e.skipNull && r === null || e.skipEmptyString && r === "" ? n : r === null ? [...n, R(t, e)] : [...n, [
|
|
855
|
-
R(t, e),
|
|
856
|
-
"=",
|
|
857
|
-
R(r, e)
|
|
858
|
-
].join("")];
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
function Ne(e) {
|
|
862
|
-
let t;
|
|
863
|
-
switch (e.arrayFormat) {
|
|
864
|
-
case "index": return (e, n, r) => {
|
|
865
|
-
if (t = /\[(\d*)]$/.exec(e), e = e.replace(/\[\d*]$/, ""), !t) {
|
|
866
|
-
r[e] = n;
|
|
867
|
-
return;
|
|
868
|
-
}
|
|
869
|
-
r[e] === void 0 && (r[e] = {}), r[e][t[1]] = n;
|
|
870
|
-
};
|
|
871
|
-
case "bracket": return (e, n, r) => {
|
|
872
|
-
if (t = /(\[])$/.exec(e), e = e.replace(/\[]$/, ""), !t) {
|
|
873
|
-
r[e] = n;
|
|
874
|
-
return;
|
|
875
|
-
}
|
|
876
|
-
if (r[e] === void 0) {
|
|
877
|
-
r[e] = [n];
|
|
878
|
-
return;
|
|
879
|
-
}
|
|
880
|
-
r[e] = [...r[e], n];
|
|
881
|
-
};
|
|
882
|
-
case "colon-list-separator": return (e, n, r) => {
|
|
883
|
-
if (t = /(:list)$/.exec(e), e = e.replace(/:list$/, ""), !t) {
|
|
884
|
-
r[e] = n;
|
|
885
|
-
return;
|
|
886
|
-
}
|
|
887
|
-
if (r[e] === void 0) {
|
|
888
|
-
r[e] = [n];
|
|
889
|
-
return;
|
|
890
|
-
}
|
|
891
|
-
r[e] = [...r[e], n];
|
|
892
|
-
};
|
|
893
|
-
case "comma":
|
|
894
|
-
case "separator": return (t, n, r) => {
|
|
895
|
-
r[t] = typeof n == "string" && n.includes(e.arrayFormatSeparator) ? n.split(e.arrayFormatSeparator).map((t) => z(t, e)) : n === null ? n : z(n, e);
|
|
896
|
-
};
|
|
897
|
-
case "bracket-separator": return (t, n, r) => {
|
|
898
|
-
let i = /(\[])$/.test(t);
|
|
899
|
-
if (t = t.replace(/\[]$/, ""), !i) {
|
|
900
|
-
r[t] = n && z(n, e);
|
|
901
|
-
return;
|
|
902
|
-
}
|
|
903
|
-
let a = n === null ? [] : z(n, e).split(e.arrayFormatSeparator);
|
|
904
|
-
if (r[t] === void 0) {
|
|
905
|
-
r[t] = a;
|
|
906
|
-
return;
|
|
907
|
-
}
|
|
908
|
-
r[t] = [...r[t], ...a];
|
|
909
|
-
};
|
|
910
|
-
default: return (e, t, n) => {
|
|
911
|
-
if (n[e] === void 0) {
|
|
912
|
-
n[e] = t;
|
|
913
|
-
return;
|
|
914
|
-
}
|
|
915
|
-
n[e] = [...[n[e]].flat(), t];
|
|
916
|
-
};
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
function L(e) {
|
|
920
|
-
if (typeof e != "string" || e.length !== 1) throw TypeError("arrayFormatSeparator must be single character string");
|
|
921
|
-
}
|
|
922
|
-
function R(e, t) {
|
|
923
|
-
return t.encode ? t.strict ? je(e) : encodeURIComponent(e) : e;
|
|
924
|
-
}
|
|
925
|
-
function z(e, t) {
|
|
926
|
-
return t.decode ? De(e) : e;
|
|
927
|
-
}
|
|
928
|
-
function B(e) {
|
|
929
|
-
return Array.isArray(e) ? e.sort() : typeof e == "object" ? B(Object.keys(e)).sort((e, t) => Number(e) - Number(t)).map((t) => e[t]) : e;
|
|
930
|
-
}
|
|
931
|
-
function V(e) {
|
|
932
|
-
let t = e.indexOf("#");
|
|
933
|
-
return t !== -1 && (e = e.slice(0, t)), e;
|
|
934
|
-
}
|
|
935
|
-
function Pe(e) {
|
|
936
|
-
let t = "", n = e.indexOf("#");
|
|
937
|
-
return n !== -1 && (t = e.slice(n)), t;
|
|
938
|
-
}
|
|
939
|
-
function Fe(e, t, n) {
|
|
940
|
-
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;
|
|
941
|
-
}
|
|
942
|
-
function H(e) {
|
|
943
|
-
e = V(e);
|
|
944
|
-
let t = e.indexOf("?");
|
|
945
|
-
return t === -1 ? "" : e.slice(t + 1);
|
|
946
|
-
}
|
|
947
|
-
function U(e, t) {
|
|
948
|
-
t = {
|
|
949
|
-
decode: !0,
|
|
950
|
-
sort: !0,
|
|
951
|
-
arrayFormat: "none",
|
|
952
|
-
arrayFormatSeparator: ",",
|
|
953
|
-
parseNumbers: !1,
|
|
954
|
-
parseBooleans: !1,
|
|
955
|
-
types: Object.create(null),
|
|
956
|
-
...t
|
|
957
|
-
}, L(t.arrayFormatSeparator);
|
|
958
|
-
let n = Ne(t), r = Object.create(null);
|
|
959
|
-
if (typeof e != "string" || (e = e.trim().replace(/^[?#&]/, ""), !e)) return r;
|
|
960
|
-
for (let i of e.split("&")) {
|
|
961
|
-
if (i === "") continue;
|
|
962
|
-
let e = t.decode ? i.replaceAll("+", " ") : i, [a, o] = F(e, "=");
|
|
963
|
-
a === void 0 && (a = e), o = o === void 0 ? null : [
|
|
964
|
-
"comma",
|
|
965
|
-
"separator",
|
|
966
|
-
"bracket-separator"
|
|
967
|
-
].includes(t.arrayFormat) ? o : z(o, t), n(z(a, t), o, r);
|
|
968
|
-
}
|
|
969
|
-
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)) {
|
|
970
|
-
let a = t.types[e], o = typeof a == "function" ? a : a ? a.replace("[]", "") : void 0;
|
|
971
|
-
n[r] = Fe(i, t, o);
|
|
972
|
-
}
|
|
973
|
-
else typeof n == "object" && n && t.types[e] === "string" ? r[e] = Object.values(n).join(t.arrayFormatSeparator) : r[e] = Fe(n, t, t.types[e]);
|
|
974
|
-
return t.sort === !1 ? r : (t.sort === !0 ? Object.keys(r).sort() : Object.keys(r).sort(t.sort)).reduce((e, t) => {
|
|
975
|
-
let n = r[t];
|
|
976
|
-
return e[t] = n && typeof n == "object" && !Array.isArray(n) ? B(n) : n, e;
|
|
977
|
-
}, Object.create(null));
|
|
978
|
-
}
|
|
979
|
-
function W(e, t) {
|
|
980
|
-
if (!e) return "";
|
|
981
|
-
t = {
|
|
982
|
-
encode: !0,
|
|
983
|
-
strict: !0,
|
|
984
|
-
arrayFormat: "none",
|
|
985
|
-
arrayFormatSeparator: ",",
|
|
986
|
-
...t
|
|
987
|
-
}, L(t.arrayFormatSeparator);
|
|
988
|
-
let n = (n) => t.skipNull && Ae(e[n]) || t.skipEmptyString && e[n] === "", r = Me(t), i = {};
|
|
989
|
-
for (let [t, r] of Object.entries(e)) n(t) || (i[t] = r);
|
|
990
|
-
let a = Object.keys(i);
|
|
991
|
-
return t.sort !== !1 && a.sort(t.sort), a.map((n) => {
|
|
992
|
-
let i = e[n];
|
|
993
|
-
if (t.replacer && (i = t.replacer(n, i), i === void 0) || i === void 0) return "";
|
|
994
|
-
if (i === null) return R(n, t);
|
|
995
|
-
if (Array.isArray(i)) {
|
|
996
|
-
if (i.length === 0 && t.arrayFormat === "bracket-separator") return R(n, t) + "[]";
|
|
997
|
-
let e = i;
|
|
998
|
-
return t.replacer && (e = i.map((e, r) => t.replacer(`${n}[${r}]`, e)).filter((e) => e !== void 0)), e.reduce(r(n), []).join("&");
|
|
999
|
-
}
|
|
1000
|
-
return R(n, t) + "=" + R(i, t);
|
|
1001
|
-
}).filter((e) => e.length > 0).join("&");
|
|
1002
|
-
}
|
|
1003
|
-
function G(e, t) {
|
|
1004
|
-
t = {
|
|
1005
|
-
decode: !0,
|
|
1006
|
-
...t
|
|
1007
|
-
};
|
|
1008
|
-
let [n, r] = F(e, "#");
|
|
1009
|
-
return n === void 0 && (n = e), {
|
|
1010
|
-
url: n?.split("?")?.[0] ?? "",
|
|
1011
|
-
query: U(H(e), t),
|
|
1012
|
-
...t && t.parseFragmentIdentifier && r ? { fragmentIdentifier: z(r, t) } : {}
|
|
1013
|
-
};
|
|
1014
|
-
}
|
|
1015
|
-
function K(e, t) {
|
|
1016
|
-
t = {
|
|
1017
|
-
encode: !0,
|
|
1018
|
-
strict: !0,
|
|
1019
|
-
[I]: !0,
|
|
1020
|
-
...t
|
|
1021
|
-
};
|
|
1022
|
-
let n = V(e.url).split("?")[0] || "", r = W({
|
|
1023
|
-
...U(H(e.url), {
|
|
1024
|
-
sort: !1,
|
|
1025
|
-
...t
|
|
1026
|
-
}),
|
|
1027
|
-
...e.query
|
|
1028
|
-
}, t);
|
|
1029
|
-
r &&= `?${r}`;
|
|
1030
|
-
let i = Pe(e.url);
|
|
1031
|
-
if (typeof e.fragmentIdentifier == "string") {
|
|
1032
|
-
let r = new URL(n);
|
|
1033
|
-
r.hash = e.fragmentIdentifier, i = t[I] ? r.hash : `#${e.fragmentIdentifier}`;
|
|
1034
|
-
}
|
|
1035
|
-
return `${n}${r}${i}`;
|
|
1036
|
-
}
|
|
1037
|
-
function Ie(e, t, n) {
|
|
1038
|
-
n = {
|
|
1039
|
-
parseFragmentIdentifier: !0,
|
|
1040
|
-
[I]: !1,
|
|
1041
|
-
...n
|
|
1042
|
-
};
|
|
1043
|
-
let { url: r, query: i, fragmentIdentifier: a } = G(e, n);
|
|
1044
|
-
return K({
|
|
1045
|
-
url: r,
|
|
1046
|
-
query: Oe(i, t),
|
|
1047
|
-
fragmentIdentifier: a
|
|
1048
|
-
}, n);
|
|
1049
|
-
}
|
|
1050
|
-
function Le(e, t, n) {
|
|
1051
|
-
return Ie(e, Array.isArray(t) ? (e) => !t.includes(e) : (e, n) => !t(e, n), n);
|
|
1052
|
-
}
|
|
1053
|
-
//#endregion
|
|
1054
|
-
//#region node_modules/.pnpm/query-string@9.3.1/node_modules/query-string/index.js
|
|
1055
|
-
var Re = ke, q = /* @__PURE__ */ t(u(), 1), ze = (e) => {
|
|
735
|
+
te(e, t);
|
|
736
|
+
}, j = /* @__PURE__ */ t(r(), 1), M = (e) => {
|
|
1056
737
|
let t = [];
|
|
1057
738
|
if (!e) return {
|
|
1058
739
|
results: t,
|
|
@@ -1078,7 +759,7 @@ var Re = ke, q = /* @__PURE__ */ t(u(), 1), ze = (e) => {
|
|
|
1078
759
|
results: t,
|
|
1079
760
|
remaining: r
|
|
1080
761
|
};
|
|
1081
|
-
},
|
|
762
|
+
}, N = async (e) => {
|
|
1082
763
|
try {
|
|
1083
764
|
return {
|
|
1084
765
|
error: !0,
|
|
@@ -1090,9 +771,9 @@ var Re = ke, q = /* @__PURE__ */ t(u(), 1), ze = (e) => {
|
|
|
1090
771
|
message: e.statusText
|
|
1091
772
|
};
|
|
1092
773
|
}
|
|
1093
|
-
},
|
|
774
|
+
}, P = async (e) => {
|
|
1094
775
|
let t = e.method || "POST", n = e.url;
|
|
1095
|
-
e.params && (n = `${n}?${
|
|
776
|
+
e.params && (n = `${n}?${i.stringify(e.params)}`);
|
|
1096
777
|
let r = await fetch(n, {
|
|
1097
778
|
method: t,
|
|
1098
779
|
body: t === "POST" ? JSON.stringify(e.data) : null,
|
|
@@ -1105,24 +786,24 @@ var Re = ke, q = /* @__PURE__ */ t(u(), 1), ze = (e) => {
|
|
|
1105
786
|
return r.ok ? {
|
|
1106
787
|
reader: r?.body?.getReader(),
|
|
1107
788
|
decoder: new TextDecoder("utf-8", { fatal: !0 })
|
|
1108
|
-
} : await
|
|
1109
|
-
},
|
|
789
|
+
} : await N(r);
|
|
790
|
+
}, F = (e) => {
|
|
1110
791
|
let t = new FormData(), n = (e, n) => {
|
|
1111
792
|
n instanceof File ? t.append(e, n) : typeof n == "object" && n ? t.append(e, JSON.stringify(n)) : n != null && t.append(e, n);
|
|
1112
793
|
};
|
|
1113
794
|
for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && n(t, e[t]);
|
|
1114
795
|
return t;
|
|
1115
|
-
},
|
|
796
|
+
}, I = async (e) => {
|
|
1116
797
|
let { url: t } = e, n = await fetch(t, {
|
|
1117
798
|
method: "POST",
|
|
1118
|
-
body:
|
|
799
|
+
body: F(e.data),
|
|
1119
800
|
signal: e.signal
|
|
1120
801
|
});
|
|
1121
802
|
return n.ok ? {
|
|
1122
803
|
reader: n?.body?.getReader(),
|
|
1123
804
|
decoder: new TextDecoder("utf-8", { fatal: !0 })
|
|
1124
|
-
} : await
|
|
1125
|
-
},
|
|
805
|
+
} : await N(n);
|
|
806
|
+
}, Ee = async (e, t, n, r = 200) => {
|
|
1126
807
|
class i {
|
|
1127
808
|
buffer = [];
|
|
1128
809
|
add(e) {
|
|
@@ -1138,7 +819,7 @@ var Re = ke, q = /* @__PURE__ */ t(u(), 1), ze = (e) => {
|
|
|
1138
819
|
return this.buffer;
|
|
1139
820
|
}
|
|
1140
821
|
}
|
|
1141
|
-
let a = new i(), o = (0,
|
|
822
|
+
let a = new i(), o = (0, j.throttle)(() => {
|
|
1142
823
|
a.flush();
|
|
1143
824
|
}, r), s = !0, c = "";
|
|
1144
825
|
for (; s;) {
|
|
@@ -1153,7 +834,7 @@ var Re = ke, q = /* @__PURE__ */ t(u(), 1), ze = (e) => {
|
|
|
1153
834
|
let e = c.slice(7).trim(), t = JSON.parse(e);
|
|
1154
835
|
a.add({ error: t }), c = "";
|
|
1155
836
|
} else {
|
|
1156
|
-
let { results: e, remaining: t } =
|
|
837
|
+
let { results: e, remaining: t } = M(c);
|
|
1157
838
|
e.forEach((e) => {
|
|
1158
839
|
a.add(e);
|
|
1159
840
|
}), c = t;
|
|
@@ -1164,14 +845,14 @@ var Re = ke, q = /* @__PURE__ */ t(u(), 1), ze = (e) => {
|
|
|
1164
845
|
}
|
|
1165
846
|
if (n) {
|
|
1166
847
|
if (c += t.decode(), c) {
|
|
1167
|
-
let { results: e, remaining: t } =
|
|
848
|
+
let { results: e, remaining: t } = M(c);
|
|
1168
849
|
e.forEach((e) => a.add(e));
|
|
1169
850
|
}
|
|
1170
851
|
a.flush(), s = !1;
|
|
1171
852
|
break;
|
|
1172
853
|
}
|
|
1173
854
|
}
|
|
1174
|
-
},
|
|
855
|
+
}, De = async (e, t, n) => {
|
|
1175
856
|
if (!e) return;
|
|
1176
857
|
let r = e.split("\n");
|
|
1177
858
|
for (let e of r) {
|
|
@@ -1195,7 +876,7 @@ var Re = ke, q = /* @__PURE__ */ t(u(), 1), ze = (e) => {
|
|
|
1195
876
|
}
|
|
1196
877
|
}
|
|
1197
878
|
}
|
|
1198
|
-
},
|
|
879
|
+
}, L = async (e, t, n, r = 200) => {
|
|
1199
880
|
let i = "";
|
|
1200
881
|
class a {
|
|
1201
882
|
buffer = [];
|
|
@@ -1217,7 +898,7 @@ var Re = ke, q = /* @__PURE__ */ t(u(), 1), ze = (e) => {
|
|
|
1217
898
|
for (this.failed = !1, this.isFlushing = !0; this.buffer.length > 0;) {
|
|
1218
899
|
let t = this.buffer.shift();
|
|
1219
900
|
try {
|
|
1220
|
-
|
|
901
|
+
De(t, this.callback, e);
|
|
1221
902
|
} catch (e) {
|
|
1222
903
|
console.error("Error processing buffer:", e), this.failed = !0, this.buffer.unshift(t);
|
|
1223
904
|
break;
|
|
@@ -1230,7 +911,7 @@ var Re = ke, q = /* @__PURE__ */ t(u(), 1), ze = (e) => {
|
|
|
1230
911
|
return this.buffer;
|
|
1231
912
|
}
|
|
1232
913
|
}
|
|
1233
|
-
let o = new a(n), s = (0,
|
|
914
|
+
let o = new a(n), s = (0, j.throttle)(async () => {
|
|
1234
915
|
o.flush();
|
|
1235
916
|
}, r);
|
|
1236
917
|
for (;;) {
|
|
@@ -1252,11 +933,11 @@ var Re = ke, q = /* @__PURE__ */ t(u(), 1), ze = (e) => {
|
|
|
1252
933
|
console.log("Error reading stream data:", e);
|
|
1253
934
|
}
|
|
1254
935
|
}
|
|
1255
|
-
},
|
|
936
|
+
}, R = (e) => new Promise((t, n) => {
|
|
1256
937
|
let r = new FileReader();
|
|
1257
938
|
r.readAsDataURL(e), r.onload = () => t(r.result), r.onerror = (e) => n(e);
|
|
1258
|
-
}),
|
|
1259
|
-
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);
|
|
1260
941
|
o.src = s, o.addEventListener("loadedmetadata", () => {
|
|
1261
942
|
let e = o.duration;
|
|
1262
943
|
n({
|
|
@@ -1271,13 +952,13 @@ var Re = ke, q = /* @__PURE__ */ t(u(), 1), ze = (e) => {
|
|
|
1271
952
|
}), o.addEventListener("error", () => {
|
|
1272
953
|
URL.revokeObjectURL(s), ee.error("Failed to load audio metadata invalid file"), r(/* @__PURE__ */ Error("Failed to load audio metadata invalid file"));
|
|
1273
954
|
});
|
|
1274
|
-
}),
|
|
955
|
+
}), B = async (e) => new Promise((t, n) => {
|
|
1275
956
|
let r = new FileReader();
|
|
1276
957
|
r.onload = async function(r) {
|
|
1277
958
|
try {
|
|
1278
959
|
let n = r.target.result;
|
|
1279
960
|
t({
|
|
1280
|
-
...await
|
|
961
|
+
...await z(n, e.type) || {},
|
|
1281
962
|
name: e.name
|
|
1282
963
|
});
|
|
1283
964
|
} catch (e) {
|
|
@@ -1287,53 +968,53 @@ var Re = ke, q = /* @__PURE__ */ t(u(), 1), ze = (e) => {
|
|
|
1287
968
|
});
|
|
1288
969
|
//#endregion
|
|
1289
970
|
//#region src/lib/utils/pcm-to-wav.ts
|
|
1290
|
-
function
|
|
971
|
+
function V(e, t, n) {
|
|
1291
972
|
for (let r = 0; r < n.length; r++) e.setUint8(t + r, n.charCodeAt(r));
|
|
1292
973
|
}
|
|
1293
|
-
function
|
|
974
|
+
function H(e, t = 24e3, n = 1, r = 16) {
|
|
1294
975
|
let i = new Uint8Array(e), a = i.length, o = new ArrayBuffer(44 + a), s = new DataView(o);
|
|
1295
|
-
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" });
|
|
1296
977
|
}
|
|
1297
978
|
//#endregion
|
|
1298
979
|
//#region src/lib/utils/index.ts
|
|
1299
|
-
var
|
|
1300
|
-
base64ToFile: () =>
|
|
1301
|
-
convertFileSize: () =>
|
|
1302
|
-
convertFileSizeByUnit: () =>
|
|
1303
|
-
convertFileToBase64: () =>
|
|
1304
|
-
cosineSimilarity: () =>
|
|
1305
|
-
createFormData: () =>
|
|
980
|
+
var Oe = /* @__PURE__ */ n({
|
|
981
|
+
base64ToFile: () => Fe,
|
|
982
|
+
convertFileSize: () => K,
|
|
983
|
+
convertFileSizeByUnit: () => q,
|
|
984
|
+
convertFileToBase64: () => R,
|
|
985
|
+
cosineSimilarity: () => Ae,
|
|
986
|
+
createFormData: () => F,
|
|
1306
987
|
downloadFile: () => A,
|
|
1307
|
-
errorHandler: () =>
|
|
1308
|
-
exportJsonToExcel: () =>
|
|
1309
|
-
fetchChunkedData: () =>
|
|
1310
|
-
fetchChunkedDataPostFormData: () =>
|
|
1311
|
-
formatLargeNumber: () =>
|
|
1312
|
-
formatNumber: () =>
|
|
1313
|
-
formatTime: () =>
|
|
1314
|
-
genColors: () =>
|
|
1315
|
-
generateRandomNumber: () =>
|
|
1316
|
-
handleBatchRequest: () =>
|
|
1317
|
-
isHTMLDocumentString: () =>
|
|
1318
|
-
isNotEmptyValue: () =>
|
|
1319
|
-
isNotEmptyValueAllowNull: () =>
|
|
1320
|
-
isOnline: () =>
|
|
1321
|
-
loadAudioData: () =>
|
|
1322
|
-
loadLanguageConfig: () =>
|
|
1323
|
-
parseParamsString: () =>
|
|
1324
|
-
pcmToWav: () =>
|
|
1325
|
-
platformCall: () =>
|
|
1326
|
-
readAudioFile: () =>
|
|
1327
|
-
readBlob: () =>
|
|
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,
|
|
1328
1009
|
readEpubContent: () => a,
|
|
1329
|
-
readExcelContent: () =>
|
|
1010
|
+
readExcelContent: () => u,
|
|
1330
1011
|
readHtmlContent: () => s,
|
|
1331
|
-
readLargeStreamData: () =>
|
|
1012
|
+
readLargeStreamData: () => L,
|
|
1332
1013
|
readPDFContent: () => o,
|
|
1333
1014
|
readPptxContent: () => c,
|
|
1334
|
-
readStreamData: () =>
|
|
1015
|
+
readStreamData: () => Ee,
|
|
1335
1016
|
readWordContent: () => l
|
|
1336
|
-
}),
|
|
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) => {
|
|
1337
1018
|
if (!e) return n ? "" : 0;
|
|
1338
1019
|
let r = 1024, i = [
|
|
1339
1020
|
"B",
|
|
@@ -1349,8 +1030,8 @@ var Je = /* @__PURE__ */ n({
|
|
|
1349
1030
|
2
|
|
1350
1031
|
], o = e, s = 0;
|
|
1351
1032
|
for (; o >= r && s < i.length - 1;) o /= r, s++;
|
|
1352
|
-
return `${
|
|
1353
|
-
},
|
|
1033
|
+
return `${j.default.round(o, a[s])} ${i[s]}`;
|
|
1034
|
+
}, q = (e) => {
|
|
1354
1035
|
let { sizeInBytes: t, allowEmpty: n = !1, defaultUnit: r = "B" } = e;
|
|
1355
1036
|
if (!t) return n ? "" : 0;
|
|
1356
1037
|
let i = 1024, a = [
|
|
@@ -1367,14 +1048,14 @@ var Je = /* @__PURE__ */ n({
|
|
|
1367
1048
|
2
|
|
1368
1049
|
], s = t, c = a.indexOf(r);
|
|
1369
1050
|
for (; s >= i && c < a.length - 1;) s /= i, c++;
|
|
1370
|
-
return `${
|
|
1371
|
-
},
|
|
1051
|
+
return `${j.default.round(s, o[c])} ${a[c]}`;
|
|
1052
|
+
}, J = () => {
|
|
1372
1053
|
let e = navigator.userAgent;
|
|
1373
1054
|
return {
|
|
1374
1055
|
isMac: e.indexOf("Mac") !== -1,
|
|
1375
1056
|
isWin: e.indexOf("Win") !== -1
|
|
1376
1057
|
};
|
|
1377
|
-
},
|
|
1058
|
+
}, Y = (e) => {
|
|
1378
1059
|
if (isNaN(e) || !e || e === Infinity) return "00:00";
|
|
1379
1060
|
let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.floor(e % 60), i = [
|
|
1380
1061
|
t.toString().padStart(2, "0"),
|
|
@@ -1382,15 +1063,15 @@ var Je = /* @__PURE__ */ n({
|
|
|
1382
1063
|
r.toString().padStart(2, "0")
|
|
1383
1064
|
];
|
|
1384
1065
|
return t > 0 ? `${i[0]}:${i[1]}:${i[2]}` : `${i[1]}:${i[2]}`;
|
|
1385
|
-
},
|
|
1386
|
-
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) {
|
|
1387
1068
|
let n = e.context(`./${t}`, !1, /\.ts$/), r = {};
|
|
1388
1069
|
return n.keys().forEach((e) => {
|
|
1389
1070
|
let t = n(e).default, i = e.replace(/(\.\/|\.ts)/g, "");
|
|
1390
1071
|
r[i] = t;
|
|
1391
1072
|
}), r;
|
|
1392
1073
|
}
|
|
1393
|
-
function
|
|
1074
|
+
function ke(e) {
|
|
1394
1075
|
return new Promise((t) => {
|
|
1395
1076
|
let n = new FileReader();
|
|
1396
1077
|
n.onload = function(e) {
|
|
@@ -1398,13 +1079,13 @@ function rt(e) {
|
|
|
1398
1079
|
}, n.readAsText(e, "utf-8");
|
|
1399
1080
|
});
|
|
1400
1081
|
}
|
|
1401
|
-
var
|
|
1082
|
+
var Ae = (e, t) => {
|
|
1402
1083
|
if (e.length !== t.length) throw Error("both vectors must have the same length");
|
|
1403
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));
|
|
1404
1085
|
if (r === 0 || i === 0) throw Error("both vectors must have a length greater than 0");
|
|
1405
1086
|
return n / (r * i);
|
|
1406
|
-
},
|
|
1407
|
-
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) {
|
|
1408
1089
|
try {
|
|
1409
1090
|
let r = e.replace(/^data:image\/[^;]+;base64,/, ""), i = atob(r), a = [];
|
|
1410
1091
|
for (let e = 0; e < i.length; e += n) {
|
|
@@ -1418,22 +1099,22 @@ function ct(e, t = "", n = 512) {
|
|
|
1418
1099
|
return null;
|
|
1419
1100
|
}
|
|
1420
1101
|
}
|
|
1421
|
-
var
|
|
1102
|
+
var Fe = (e, t) => {
|
|
1422
1103
|
try {
|
|
1423
1104
|
if (!e) return null;
|
|
1424
1105
|
console.log("base64String:", e);
|
|
1425
1106
|
let n = e.match(/data:(.*?);base64,/);
|
|
1426
1107
|
if (!n) throw Error("Invalid base64 string");
|
|
1427
|
-
let r = n[1], i =
|
|
1108
|
+
let r = n[1], i = Pe(e, r);
|
|
1428
1109
|
if (!i) throw Error("Failed to convert base64 to blob");
|
|
1429
1110
|
return new File([i], t || r, { type: r });
|
|
1430
1111
|
} catch {
|
|
1431
1112
|
return null;
|
|
1432
1113
|
}
|
|
1433
|
-
},
|
|
1114
|
+
}, Ie = () => window.navigator.onLine, Le = ({ color: e, alpha1: t, alpha2: n }) => {
|
|
1434
1115
|
let r = p(e), i = t || r.getAlpha(), a = n || r.getAlpha();
|
|
1435
1116
|
return [r.setAlpha(i).toRgbString(), r.setAlpha(a).toRgbString()];
|
|
1436
|
-
},
|
|
1117
|
+
}, $ = (e) => {
|
|
1437
1118
|
if (!e || !e.trim()) return [];
|
|
1438
1119
|
let t = e.replace(/\n/g, " ").replace(/\s\\\s/g, " ").replace(/\s+/g, " ").trim(), n = [], r = [], i = "", a = !1, o = "", s = 0;
|
|
1439
1120
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -1452,4 +1133,4 @@ var lt = (e, t) => {
|
|
|
1452
1133
|
return n;
|
|
1453
1134
|
};
|
|
1454
1135
|
//#endregion
|
|
1455
|
-
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 };
|