@untemps/react-vocal 2.0.0-beta.1 → 2.0.0-beta.2
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/.prettierrc +1 -1
- package/CHANGELOG.md +7 -0
- package/dev/yarn.lock +296 -172
- package/dist/index.es.js +308 -277
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Vocal.jsx +103 -65
- package/src/components/__tests__/Vocal.test.jsx +160 -0
- package/vitest.setup.js +3 -0
package/dist/index.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { cloneElement as e, isValidElement as t, useCallback as n, useEffect as r,
|
|
1
|
+
import { cloneElement as e, isValidElement as t, useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
|
-
var
|
|
3
|
+
var s = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), c = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
4
4
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
5
5
|
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
6
|
-
}),
|
|
6
|
+
}), l = function(e, t, n) {
|
|
7
7
|
return e(n = {
|
|
8
8
|
path: t,
|
|
9
9
|
exports: {},
|
|
@@ -291,7 +291,7 @@ var o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
291
291
|
Function("r", "regeneratorRuntime = r")(t);
|
|
292
292
|
}
|
|
293
293
|
}));
|
|
294
|
-
function
|
|
294
|
+
function u(e, t, n, r, i, a, o) {
|
|
295
295
|
try {
|
|
296
296
|
var s = e[a](o), c = s.value;
|
|
297
297
|
} catch (e) {
|
|
@@ -300,23 +300,23 @@ function l(e, t, n, r, i, a, o) {
|
|
|
300
300
|
}
|
|
301
301
|
s.done ? t(c) : Promise.resolve(c).then(r, i);
|
|
302
302
|
}
|
|
303
|
-
var
|
|
303
|
+
var d = function(e) {
|
|
304
304
|
return function() {
|
|
305
305
|
var t = this, n = arguments;
|
|
306
306
|
return new Promise((function(r, i) {
|
|
307
307
|
var a = e.apply(t, n);
|
|
308
308
|
function o(e) {
|
|
309
|
-
|
|
309
|
+
u(a, r, i, o, s, "next", e);
|
|
310
310
|
}
|
|
311
311
|
function s(e) {
|
|
312
|
-
|
|
312
|
+
u(a, r, i, o, s, "throw", e);
|
|
313
313
|
}
|
|
314
314
|
o(void 0);
|
|
315
315
|
}));
|
|
316
316
|
};
|
|
317
|
-
},
|
|
317
|
+
}, f = function(e) {
|
|
318
318
|
if (Array.isArray(e)) return e;
|
|
319
|
-
},
|
|
319
|
+
}, p = function(e, t) {
|
|
320
320
|
if (typeof Symbol < "u" && Symbol.iterator in Object(e)) {
|
|
321
321
|
var n = [], r = !0, i = !1, a = void 0;
|
|
322
322
|
try {
|
|
@@ -332,44 +332,44 @@ var u = function(e) {
|
|
|
332
332
|
}
|
|
333
333
|
return n;
|
|
334
334
|
}
|
|
335
|
-
},
|
|
335
|
+
}, m = function(e, t) {
|
|
336
336
|
(t == null || t > e.length) && (t = e.length);
|
|
337
337
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
338
338
|
return r;
|
|
339
|
-
},
|
|
339
|
+
}, h = function(e, t) {
|
|
340
340
|
if (e) {
|
|
341
|
-
if (typeof e == "string") return
|
|
341
|
+
if (typeof e == "string") return m(e, t);
|
|
342
342
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
343
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
343
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? m(e, t) : void 0;
|
|
344
344
|
}
|
|
345
|
-
},
|
|
345
|
+
}, g = function() {
|
|
346
346
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
347
|
-
}, g = function(e, t) {
|
|
348
|
-
return d(e) || f(e, t) || m(e, t) || h();
|
|
349
347
|
}, _ = function(e, t) {
|
|
348
|
+
return f(e) || p(e, t) || h(e, t) || g();
|
|
349
|
+
}, v = function(e, t) {
|
|
350
350
|
if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
|
|
351
351
|
};
|
|
352
|
-
function
|
|
352
|
+
function y(e, t) {
|
|
353
353
|
for (var n = 0; n < t.length; n++) {
|
|
354
354
|
var r = t[n];
|
|
355
355
|
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
var
|
|
359
|
-
return t &&
|
|
360
|
-
},
|
|
358
|
+
var b = function(e, t, n) {
|
|
359
|
+
return t && y(e.prototype, t), n && y(e, n), e;
|
|
360
|
+
}, x = function(e, t, n) {
|
|
361
361
|
return t in e ? Object.defineProperty(e, t, {
|
|
362
362
|
value: n,
|
|
363
363
|
enumerable: !0,
|
|
364
364
|
configurable: !0,
|
|
365
365
|
writable: !0
|
|
366
366
|
}) : e[t] = n, e;
|
|
367
|
-
}, x = function() {
|
|
368
|
-
return !!navigator.permissions;
|
|
369
367
|
}, S = function() {
|
|
368
|
+
return !!navigator.permissions;
|
|
369
|
+
}, C = function() {
|
|
370
370
|
return !!navigator.mediaDevices;
|
|
371
371
|
};
|
|
372
|
-
function
|
|
372
|
+
function w(e, t, n, r, i, a, o) {
|
|
373
373
|
try {
|
|
374
374
|
var s = e[a](o), c = s.value;
|
|
375
375
|
} catch (e) {
|
|
@@ -378,22 +378,22 @@ function C(e, t, n, r, i, a, o) {
|
|
|
378
378
|
}
|
|
379
379
|
s.done ? t(c) : Promise.resolve(c).then(r, i);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function T(e) {
|
|
382
382
|
return function() {
|
|
383
383
|
var t = this, n = arguments;
|
|
384
384
|
return new Promise((function(r, i) {
|
|
385
385
|
var a = e.apply(t, n);
|
|
386
386
|
function o(e) {
|
|
387
|
-
|
|
387
|
+
w(a, r, i, o, s, "next", e);
|
|
388
388
|
}
|
|
389
389
|
function s(e) {
|
|
390
|
-
|
|
390
|
+
w(a, r, i, o, s, "throw", e);
|
|
391
391
|
}
|
|
392
392
|
o(void 0);
|
|
393
393
|
}));
|
|
394
394
|
};
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function E(e, t) {
|
|
397
397
|
return function(e) {
|
|
398
398
|
if (Array.isArray(e)) return e;
|
|
399
399
|
}(e) || function(e, t) {
|
|
@@ -414,29 +414,29 @@ function T(e, t) {
|
|
|
414
414
|
}
|
|
415
415
|
}(e, t) || function(e, t) {
|
|
416
416
|
if (e) {
|
|
417
|
-
if (typeof e == "string") return
|
|
417
|
+
if (typeof e == "string") return D(e, t);
|
|
418
418
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
419
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
419
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? D(e, t) : void 0;
|
|
420
420
|
}
|
|
421
421
|
}(e, t) || function() {
|
|
422
422
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
423
423
|
}();
|
|
424
424
|
}
|
|
425
|
-
function
|
|
425
|
+
function D(e, t) {
|
|
426
426
|
(t == null || t > e.length) && (t = e.length);
|
|
427
427
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
428
428
|
return r;
|
|
429
429
|
}
|
|
430
|
-
var
|
|
431
|
-
var e =
|
|
430
|
+
var ee = function() {
|
|
431
|
+
var e = T(regeneratorRuntime.mark((function e(t) {
|
|
432
432
|
return regeneratorRuntime.wrap((function(e) {
|
|
433
433
|
for (;;) switch (e.prev = e.next) {
|
|
434
434
|
case 0: return e.abrupt("return", new Promise(function() {
|
|
435
|
-
var e =
|
|
435
|
+
var e = T(regeneratorRuntime.mark((function e(n, r) {
|
|
436
436
|
var i, a;
|
|
437
437
|
return regeneratorRuntime.wrap((function(e) {
|
|
438
438
|
for (;;) switch (e.prev = e.next) {
|
|
439
|
-
case 0: return
|
|
439
|
+
case 0: return S() || r(new DOMException("Navigator API: permissions not supported", "NOT_SUPPORTED_ERR")), e.prev = 1, e.next = 4, navigator.permissions.query({ name: t });
|
|
440
440
|
case 4:
|
|
441
441
|
i = e.sent, a = function e(t) {
|
|
442
442
|
i.removeEventListener("change", e), O(t.target.state, n, r);
|
|
@@ -468,19 +468,19 @@ var D = function() {
|
|
|
468
468
|
default: t(e);
|
|
469
469
|
}
|
|
470
470
|
}, k = function() {
|
|
471
|
-
var e =
|
|
471
|
+
var e = T(regeneratorRuntime.mark((function e(t, n) {
|
|
472
472
|
return regeneratorRuntime.wrap((function(e) {
|
|
473
473
|
for (;;) switch (e.prev = e.next) {
|
|
474
474
|
case 0: return e.abrupt("return", new Promise(function() {
|
|
475
|
-
var e =
|
|
475
|
+
var e = T(regeneratorRuntime.mark((function e(r, i) {
|
|
476
476
|
var a, o, s;
|
|
477
477
|
return regeneratorRuntime.wrap((function(e) {
|
|
478
478
|
for (;;) switch (e.prev = e.next) {
|
|
479
|
-
case 0: return
|
|
479
|
+
case 0: return S() && C() || i(new DOMException("Navigator API: permissions or Navigator API: mediaDevices not supported", "NOT_SUPPORTED_ERR")), e.prev = 1, e.t0 = Promise, e.next = 5, ee(t);
|
|
480
480
|
case 5: return e.t1 = e.sent, e.next = 8, navigator.mediaDevices.getUserMedia(n);
|
|
481
481
|
case 8: return e.t2 = e.sent, e.t3 = [e.t1, e.t2], e.next = 12, e.t0.all.call(e.t0, e.t3);
|
|
482
482
|
case 12:
|
|
483
|
-
a = e.sent, o =
|
|
483
|
+
a = e.sent, o = E(a, 2), s = o[1], r(s), e.next = 21;
|
|
484
484
|
break;
|
|
485
485
|
case 18: e.prev = 18, e.t4 = e.catch(1), i(e.t4);
|
|
486
486
|
case 21:
|
|
@@ -515,7 +515,7 @@ function j(e) {
|
|
|
515
515
|
for (var t = 1; t < arguments.length; t++) {
|
|
516
516
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
517
517
|
t % 2 ? A(Object(n), !0).forEach((function(t) {
|
|
518
|
-
|
|
518
|
+
x(e, t, n[t]);
|
|
519
519
|
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : A(Object(n)).forEach((function(t) {
|
|
520
520
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
521
521
|
}));
|
|
@@ -525,11 +525,11 @@ function j(e) {
|
|
|
525
525
|
var M = function() {
|
|
526
526
|
function e(t) {
|
|
527
527
|
var n = this;
|
|
528
|
-
|
|
528
|
+
v(this, e), x(this, "_instance", null), x(this, "_listeners", null);
|
|
529
529
|
var r = e._resolveSpeechRecognition();
|
|
530
530
|
if (!r) throw new DOMException("SpeechRecognition not supported", "NOT_SUPPORTED_ERR");
|
|
531
531
|
this._instance = new r(), this._listeners = {}, Object.entries(j(j({}, e.defaultOptions), t || {})).forEach((function(t) {
|
|
532
|
-
var r =
|
|
532
|
+
var r = _(t, 2), i = r[0], a = r[1];
|
|
533
533
|
if (i === "grammars" && !a) {
|
|
534
534
|
var o = e._resolveSpeechGrammarList();
|
|
535
535
|
o && (a = new o());
|
|
@@ -538,20 +538,20 @@ var M = function() {
|
|
|
538
538
|
}));
|
|
539
539
|
}
|
|
540
540
|
var t;
|
|
541
|
-
return
|
|
541
|
+
return b(e, null, [{
|
|
542
542
|
key: "isSupported",
|
|
543
543
|
get: function() {
|
|
544
|
-
return !!e._resolveSpeechRecognition() && !!
|
|
544
|
+
return !!e._resolveSpeechRecognition() && !!S() && !!C();
|
|
545
545
|
},
|
|
546
546
|
set: function(e) {
|
|
547
547
|
throw Error("You cannot set isSupported directly.");
|
|
548
548
|
}
|
|
549
|
-
}]),
|
|
549
|
+
}]), b(e, [
|
|
550
550
|
{
|
|
551
551
|
key: "start",
|
|
552
|
-
value: (t =
|
|
552
|
+
value: (t = d(l.mark((function e() {
|
|
553
553
|
var t;
|
|
554
|
-
return
|
|
554
|
+
return l.wrap((function(e) {
|
|
555
555
|
for (;;) switch (e.prev = e.next) {
|
|
556
556
|
case 0:
|
|
557
557
|
if (!this._instance) {
|
|
@@ -650,14 +650,14 @@ var M = function() {
|
|
|
650
650
|
}
|
|
651
651
|
}]), e;
|
|
652
652
|
}();
|
|
653
|
-
|
|
653
|
+
x(M, "defaultOptions", {
|
|
654
654
|
grammars: null,
|
|
655
655
|
lang: "en-US",
|
|
656
656
|
continuous: !1,
|
|
657
657
|
interimResults: !1,
|
|
658
658
|
maxAlternatives: 1,
|
|
659
659
|
serviceURI: null
|
|
660
|
-
}),
|
|
660
|
+
}), x(M, "eventTypes", {
|
|
661
661
|
AUDIO_END: "audioend",
|
|
662
662
|
AUDIO_START: "audiostart",
|
|
663
663
|
END: "end",
|
|
@@ -672,10 +672,10 @@ b(M, "defaultOptions", {
|
|
|
672
672
|
});
|
|
673
673
|
//#endregion
|
|
674
674
|
//#region node_modules/@untemps/utils/dist/function/isFunction.js
|
|
675
|
-
var
|
|
676
|
-
let o =
|
|
675
|
+
var te = (e) => typeof e == "function", N = (e = "en-US", t = null, i = null) => {
|
|
676
|
+
let o = a(null);
|
|
677
677
|
return r(() => {
|
|
678
|
-
if (M.isSupported) return o.current =
|
|
678
|
+
if (M.isSupported) return o.current = i || new M({
|
|
679
679
|
lang: e,
|
|
680
680
|
grammars: t
|
|
681
681
|
}), () => {
|
|
@@ -684,7 +684,7 @@ var N = (e) => typeof e == "function", P = (e = "en-US", t = null, a = null) =>
|
|
|
684
684
|
}, [
|
|
685
685
|
e,
|
|
686
686
|
t,
|
|
687
|
-
|
|
687
|
+
i
|
|
688
688
|
]), [o, {
|
|
689
689
|
start: n(() => {
|
|
690
690
|
o.current && o.current.start();
|
|
@@ -705,11 +705,11 @@ var N = (e) => typeof e == "function", P = (e = "en-US", t = null, a = null) =>
|
|
|
705
705
|
o.current && o.current.cleanup();
|
|
706
706
|
}, [])
|
|
707
707
|
}];
|
|
708
|
-
},
|
|
709
|
-
let
|
|
710
|
-
clearTimeout(
|
|
708
|
+
}, ne = (e, t = 0) => {
|
|
709
|
+
let i = a(-1), o = n(() => {
|
|
710
|
+
clearTimeout(i.current), i.current = -1;
|
|
711
711
|
}, []), s = n(() => {
|
|
712
|
-
o(),
|
|
712
|
+
o(), i.current = setTimeout(e, t);
|
|
713
713
|
}, [
|
|
714
714
|
e,
|
|
715
715
|
t,
|
|
@@ -719,48 +719,48 @@ var N = (e) => typeof e == "function", P = (e = "en-US", t = null, a = null) =>
|
|
|
719
719
|
};
|
|
720
720
|
//#endregion
|
|
721
721
|
//#region node_modules/fuse.js/dist/fuse.mjs
|
|
722
|
-
function
|
|
723
|
-
return Array.isArray ? Array.isArray(e) :
|
|
722
|
+
function P(e) {
|
|
723
|
+
return Array.isArray ? Array.isArray(e) : H(e) === "[object Array]";
|
|
724
724
|
}
|
|
725
|
-
function
|
|
725
|
+
function F(e) {
|
|
726
726
|
if (typeof e == "string") return e;
|
|
727
727
|
if (typeof e == "bigint") return e.toString();
|
|
728
728
|
let t = e + "";
|
|
729
729
|
return t == "0" && 1 / e == -Infinity ? "-0" : t;
|
|
730
730
|
}
|
|
731
|
-
function
|
|
732
|
-
return e == null ? "" :
|
|
731
|
+
function I(e) {
|
|
732
|
+
return e == null ? "" : F(e);
|
|
733
733
|
}
|
|
734
|
-
function
|
|
734
|
+
function L(e) {
|
|
735
735
|
return typeof e == "string";
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function R(e) {
|
|
738
738
|
return typeof e == "number";
|
|
739
739
|
}
|
|
740
|
-
function
|
|
741
|
-
return e === !0 || e === !1 ||
|
|
740
|
+
function re(e) {
|
|
741
|
+
return e === !0 || e === !1 || ie(e) && H(e) == "[object Boolean]";
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function z(e) {
|
|
744
744
|
return typeof e == "object";
|
|
745
745
|
}
|
|
746
|
-
function
|
|
747
|
-
return
|
|
746
|
+
function ie(e) {
|
|
747
|
+
return z(e) && e !== null;
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function B(e) {
|
|
750
750
|
return e != null;
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function V(e) {
|
|
753
753
|
return !e.trim().length;
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function H(e) {
|
|
756
756
|
return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
|
|
757
757
|
}
|
|
758
|
-
var
|
|
758
|
+
var U = "Incorrect 'index' type", W = (e) => `Invalid value for key ${e}`, G = (e) => `Pattern length exceeds max of ${e}.`, ae = (e) => `Missing ${e} property in key`, oe = (e) => `Property 'weight' in key '${e}' must be a positive integer`, se = Object.prototype.hasOwnProperty, ce = class {
|
|
759
759
|
constructor(e) {
|
|
760
760
|
this._keys = [], this._keyMap = {};
|
|
761
761
|
let t = 0;
|
|
762
762
|
e.forEach((e) => {
|
|
763
|
-
let n =
|
|
763
|
+
let n = le(e);
|
|
764
764
|
this._keys.push(n), this._keyMap[n.id] = n, t += n.weight;
|
|
765
765
|
}), this._keys.forEach((e) => {
|
|
766
766
|
e.weight /= t;
|
|
@@ -776,14 +776,14 @@ var ie = "Incorrect 'index' type", ae = (e) => `Invalid value for key ${e}`, oe
|
|
|
776
776
|
return JSON.stringify(this._keys);
|
|
777
777
|
}
|
|
778
778
|
};
|
|
779
|
-
function
|
|
779
|
+
function le(e) {
|
|
780
780
|
let t = null, n = null, r = null, i = 1, a = null;
|
|
781
|
-
if (
|
|
781
|
+
if (L(e) || P(e)) r = e, t = ue(e), n = de(e);
|
|
782
782
|
else {
|
|
783
|
-
if (!
|
|
783
|
+
if (!se.call(e, "name")) throw Error(ae("name"));
|
|
784
784
|
let o = e.name;
|
|
785
|
-
if (r = o,
|
|
786
|
-
t =
|
|
785
|
+
if (r = o, se.call(e, "weight") && (i = e.weight, i <= 0)) throw Error(oe(o));
|
|
786
|
+
t = ue(o), n = de(o), a = e.getFn;
|
|
787
787
|
}
|
|
788
788
|
return {
|
|
789
789
|
path: t,
|
|
@@ -793,66 +793,66 @@ function de(e) {
|
|
|
793
793
|
getFn: a
|
|
794
794
|
};
|
|
795
795
|
}
|
|
796
|
-
function
|
|
797
|
-
return
|
|
796
|
+
function ue(e) {
|
|
797
|
+
return P(e) ? e : e.split(".");
|
|
798
798
|
}
|
|
799
|
-
function
|
|
800
|
-
return
|
|
799
|
+
function de(e) {
|
|
800
|
+
return P(e) ? e.join(".") : e;
|
|
801
801
|
}
|
|
802
|
-
function
|
|
802
|
+
function fe(e, t) {
|
|
803
803
|
let n = [], r = !1, i = (e, t, a, o) => {
|
|
804
|
-
if (
|
|
804
|
+
if (B(e)) if (!t[a]) n.push(o === void 0 ? e : {
|
|
805
805
|
v: e,
|
|
806
806
|
i: o
|
|
807
807
|
});
|
|
808
808
|
else {
|
|
809
809
|
let s = e[t[a]];
|
|
810
|
-
if (!
|
|
811
|
-
if (a === t.length - 1 && (
|
|
812
|
-
v:
|
|
810
|
+
if (!B(s)) return;
|
|
811
|
+
if (a === t.length - 1 && (L(s) || R(s) || re(s) || typeof s == "bigint")) n.push(o === void 0 ? I(s) : {
|
|
812
|
+
v: I(s),
|
|
813
813
|
i: o
|
|
814
814
|
});
|
|
815
|
-
else if (
|
|
815
|
+
else if (P(s)) {
|
|
816
816
|
r = !0;
|
|
817
817
|
for (let e = 0, n = s.length; e < n; e += 1) i(s[e], t, a + 1, e);
|
|
818
818
|
} else t.length && i(s, t, a + 1, o);
|
|
819
819
|
}
|
|
820
820
|
};
|
|
821
|
-
return i(e,
|
|
821
|
+
return i(e, L(t) ? t.split(".") : t, 0), r ? n : n[0];
|
|
822
822
|
}
|
|
823
|
-
var
|
|
823
|
+
var pe = {
|
|
824
824
|
includeMatches: !1,
|
|
825
825
|
findAllMatches: !1,
|
|
826
826
|
minMatchCharLength: 1
|
|
827
|
-
},
|
|
827
|
+
}, me = {
|
|
828
828
|
isCaseSensitive: !1,
|
|
829
829
|
ignoreDiacritics: !1,
|
|
830
830
|
includeScore: !1,
|
|
831
831
|
keys: [],
|
|
832
832
|
shouldSort: !0,
|
|
833
833
|
sortFn: (e, t) => e.score === t.score ? e.idx < t.idx ? -1 : 1 : e.score < t.score ? -1 : 1
|
|
834
|
-
},
|
|
834
|
+
}, he = {
|
|
835
835
|
location: 0,
|
|
836
836
|
threshold: .6,
|
|
837
837
|
distance: 100
|
|
838
|
-
},
|
|
838
|
+
}, ge = {
|
|
839
839
|
useExtendedSearch: !1,
|
|
840
840
|
useTokenSearch: !1,
|
|
841
|
-
getFn:
|
|
841
|
+
getFn: fe,
|
|
842
842
|
ignoreLocation: !1,
|
|
843
843
|
ignoreFieldNorm: !1,
|
|
844
844
|
fieldNormWeight: 1
|
|
845
|
-
},
|
|
846
|
-
...he,
|
|
845
|
+
}, K = Object.freeze({
|
|
847
846
|
...me,
|
|
848
|
-
...
|
|
849
|
-
...
|
|
850
|
-
|
|
851
|
-
|
|
847
|
+
...pe,
|
|
848
|
+
...he,
|
|
849
|
+
...ge
|
|
850
|
+
}), _e = /[^ ]+/g;
|
|
851
|
+
function ve(e = 1, t = 3) {
|
|
852
852
|
let n = /* @__PURE__ */ new Map(), r = 10 ** t;
|
|
853
853
|
return {
|
|
854
854
|
get(t) {
|
|
855
|
-
let i = t.match(
|
|
855
|
+
let i = t.match(_e).length;
|
|
856
856
|
if (n.has(i)) return n.get(i);
|
|
857
857
|
let a = 1 / i ** (.5 * e), o = parseFloat(Math.round(a * r) / r);
|
|
858
858
|
return n.set(i, o), o;
|
|
@@ -862,9 +862,9 @@ function ye(e = 1, t = 3) {
|
|
|
862
862
|
}
|
|
863
863
|
};
|
|
864
864
|
}
|
|
865
|
-
var
|
|
866
|
-
constructor({ getFn: e =
|
|
867
|
-
this.norm =
|
|
865
|
+
var ye = class {
|
|
866
|
+
constructor({ getFn: e = K.getFn, fieldNormWeight: t = K.fieldNormWeight } = {}) {
|
|
867
|
+
this.norm = ve(t, 3), this.getFn = e, this.isCreated = !1, this.docs = [], this.keys = [], this._keysMap = {}, this.setIndexRecords();
|
|
868
868
|
}
|
|
869
869
|
setSources(e = []) {
|
|
870
870
|
this.docs = e;
|
|
@@ -878,7 +878,7 @@ var G = class {
|
|
|
878
878
|
});
|
|
879
879
|
}
|
|
880
880
|
create() {
|
|
881
|
-
this.isCreated || !this.docs.length || (this.isCreated = !0,
|
|
881
|
+
this.isCreated || !this.docs.length || (this.isCreated = !0, L(this.docs[0]) ? this.docs.forEach((e, t) => {
|
|
882
882
|
this._addString(e, t);
|
|
883
883
|
}) : this.docs.forEach((e, t) => {
|
|
884
884
|
this._addObject(e, t);
|
|
@@ -886,7 +886,7 @@ var G = class {
|
|
|
886
886
|
}
|
|
887
887
|
add(e) {
|
|
888
888
|
let t = this.size();
|
|
889
|
-
|
|
889
|
+
L(e) ? this._addString(e, t) : this._addObject(e, t);
|
|
890
890
|
}
|
|
891
891
|
removeAt(e) {
|
|
892
892
|
this.records.splice(e, 1);
|
|
@@ -903,7 +903,7 @@ var G = class {
|
|
|
903
903
|
return this.records.length;
|
|
904
904
|
}
|
|
905
905
|
_addString(e, t) {
|
|
906
|
-
if (!
|
|
906
|
+
if (!B(e) || V(e)) return;
|
|
907
907
|
let n = {
|
|
908
908
|
v: e,
|
|
909
909
|
i: t,
|
|
@@ -918,14 +918,14 @@ var G = class {
|
|
|
918
918
|
};
|
|
919
919
|
this.keys.forEach((t, r) => {
|
|
920
920
|
let i = t.getFn ? t.getFn(e) : this.getFn(e, t.path);
|
|
921
|
-
if (
|
|
922
|
-
if (
|
|
921
|
+
if (B(i)) {
|
|
922
|
+
if (P(i)) {
|
|
923
923
|
let e = [];
|
|
924
924
|
for (let t = 0, n = i.length; t < n; t += 1) {
|
|
925
925
|
let n = i[t];
|
|
926
|
-
if (
|
|
927
|
-
if (
|
|
928
|
-
if (!
|
|
926
|
+
if (B(n)) {
|
|
927
|
+
if (L(n)) {
|
|
928
|
+
if (!V(n)) {
|
|
929
929
|
let r = {
|
|
930
930
|
v: n,
|
|
931
931
|
i: t,
|
|
@@ -933,9 +933,9 @@ var G = class {
|
|
|
933
933
|
};
|
|
934
934
|
e.push(r);
|
|
935
935
|
}
|
|
936
|
-
} else if (
|
|
937
|
-
let t =
|
|
938
|
-
if (!
|
|
936
|
+
} else if (B(n.v)) {
|
|
937
|
+
let t = L(n.v) ? n.v : I(n.v);
|
|
938
|
+
if (!V(t)) {
|
|
939
939
|
let r = {
|
|
940
940
|
v: t,
|
|
941
941
|
i: n.i,
|
|
@@ -947,7 +947,7 @@ var G = class {
|
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
949
|
n.$[r] = e;
|
|
950
|
-
} else if (
|
|
950
|
+
} else if (L(i) && !V(i)) {
|
|
951
951
|
let e = {
|
|
952
952
|
v: i,
|
|
953
953
|
n: this.norm.get(i)
|
|
@@ -964,21 +964,21 @@ var G = class {
|
|
|
964
964
|
};
|
|
965
965
|
}
|
|
966
966
|
};
|
|
967
|
-
function be(e, t, { getFn: n =
|
|
968
|
-
let i = new
|
|
967
|
+
function be(e, t, { getFn: n = K.getFn, fieldNormWeight: r = K.fieldNormWeight } = {}) {
|
|
968
|
+
let i = new ye({
|
|
969
969
|
getFn: n,
|
|
970
970
|
fieldNormWeight: r
|
|
971
971
|
});
|
|
972
|
-
return i.setKeys(e.map(
|
|
972
|
+
return i.setKeys(e.map(le)), i.setSources(t), i.create(), i;
|
|
973
973
|
}
|
|
974
|
-
function xe(e, { getFn: t =
|
|
975
|
-
let { keys: r, records: i } = e, a = new
|
|
974
|
+
function xe(e, { getFn: t = K.getFn, fieldNormWeight: n = K.fieldNormWeight } = {}) {
|
|
975
|
+
let { keys: r, records: i } = e, a = new ye({
|
|
976
976
|
getFn: t,
|
|
977
977
|
fieldNormWeight: n
|
|
978
978
|
});
|
|
979
979
|
return a.setKeys(r), a.setIndexRecords(i), a;
|
|
980
980
|
}
|
|
981
|
-
function Se(e = [], t =
|
|
981
|
+
function Se(e = [], t = K.minMatchCharLength) {
|
|
982
982
|
let n = [], r = -1, i = -1, a = 0;
|
|
983
983
|
for (let o = e.length; a < o; a += 1) {
|
|
984
984
|
let o = e[a];
|
|
@@ -986,9 +986,9 @@ function Se(e = [], t = W.minMatchCharLength) {
|
|
|
986
986
|
}
|
|
987
987
|
return e[a - 1] && a - r >= t && n.push([r, a - 1]), n;
|
|
988
988
|
}
|
|
989
|
-
var
|
|
990
|
-
function Ce(e, t, n, { location: r =
|
|
991
|
-
if (t.length >
|
|
989
|
+
var q = 32;
|
|
990
|
+
function Ce(e, t, n, { location: r = K.location, distance: i = K.distance, threshold: a = K.threshold, findAllMatches: o = K.findAllMatches, minMatchCharLength: s = K.minMatchCharLength, includeMatches: c = K.includeMatches, ignoreLocation: l = K.ignoreLocation } = {}) {
|
|
991
|
+
if (t.length > q) throw Error(G(q));
|
|
992
992
|
let u = t.length, d = e.length, f = Math.max(0, Math.min(r, d)), p = a, m = f, h = (e, t) => {
|
|
993
993
|
let n = e / u;
|
|
994
994
|
if (l) return n;
|
|
@@ -1061,8 +1061,8 @@ var Ee = {
|
|
|
1061
1061
|
Ŧ: "T",
|
|
1062
1062
|
ı: "i",
|
|
1063
1063
|
ß: "ss"
|
|
1064
|
-
}, De = RegExp("[" + Object.keys(Ee).join("") + "]", "g"),
|
|
1065
|
-
constructor(e, { location: t =
|
|
1064
|
+
}, De = RegExp("[" + Object.keys(Ee).join("") + "]", "g"), J = String.prototype.normalize ? (e) => e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g, "").replace(De, (e) => Ee[e]) : (e) => e, Oe = class {
|
|
1065
|
+
constructor(e, { location: t = K.location, threshold: n = K.threshold, distance: r = K.distance, includeMatches: i = K.includeMatches, findAllMatches: a = K.findAllMatches, minMatchCharLength: o = K.minMatchCharLength, isCaseSensitive: s = K.isCaseSensitive, ignoreDiacritics: c = K.ignoreDiacritics, ignoreLocation: l = K.ignoreLocation } = {}) {
|
|
1066
1066
|
if (this.options = {
|
|
1067
1067
|
location: t,
|
|
1068
1068
|
threshold: n,
|
|
@@ -1073,7 +1073,7 @@ var Ee = {
|
|
|
1073
1073
|
isCaseSensitive: s,
|
|
1074
1074
|
ignoreDiacritics: c,
|
|
1075
1075
|
ignoreLocation: l
|
|
1076
|
-
}, e = s ? e : e.toLowerCase(), e = c ?
|
|
1076
|
+
}, e = s ? e : e.toLowerCase(), e = c ? J(e) : e, this.pattern = e, this.chunks = [], !this.pattern.length) return;
|
|
1077
1077
|
let u = (e, t) => {
|
|
1078
1078
|
this.chunks.push({
|
|
1079
1079
|
pattern: e,
|
|
@@ -1081,18 +1081,18 @@ var Ee = {
|
|
|
1081
1081
|
startIndex: t
|
|
1082
1082
|
});
|
|
1083
1083
|
}, d = this.pattern.length;
|
|
1084
|
-
if (d >
|
|
1085
|
-
let e = 0, t = d %
|
|
1086
|
-
for (; e < n;) u(this.pattern.substr(e,
|
|
1084
|
+
if (d > q) {
|
|
1085
|
+
let e = 0, t = d % q, n = d - t;
|
|
1086
|
+
for (; e < n;) u(this.pattern.substr(e, q), e), e += q;
|
|
1087
1087
|
if (t) {
|
|
1088
|
-
let e = d -
|
|
1088
|
+
let e = d - q;
|
|
1089
1089
|
u(this.pattern.substr(e), e);
|
|
1090
1090
|
}
|
|
1091
1091
|
} else u(this.pattern, 0);
|
|
1092
1092
|
}
|
|
1093
1093
|
searchIn(e) {
|
|
1094
1094
|
let { isCaseSensitive: t, ignoreDiacritics: n, includeMatches: r } = this.options;
|
|
1095
|
-
if (e = t ? e : e.toLowerCase(), e = n ?
|
|
1095
|
+
if (e = t ? e : e.toLowerCase(), e = n ? J(e) : e, this.pattern === e) {
|
|
1096
1096
|
let t = {
|
|
1097
1097
|
isMatch: !0,
|
|
1098
1098
|
score: 0
|
|
@@ -1118,7 +1118,7 @@ var Ee = {
|
|
|
1118
1118
|
};
|
|
1119
1119
|
return f && r && (p.indices = Te(u)), p;
|
|
1120
1120
|
}
|
|
1121
|
-
},
|
|
1121
|
+
}, Y = class {
|
|
1122
1122
|
constructor(e) {
|
|
1123
1123
|
this.pattern = e;
|
|
1124
1124
|
}
|
|
@@ -1139,7 +1139,7 @@ function ke(e, t) {
|
|
|
1139
1139
|
let n = e.match(t);
|
|
1140
1140
|
return n ? n[1] : null;
|
|
1141
1141
|
}
|
|
1142
|
-
var Ae = class extends
|
|
1142
|
+
var Ae = class extends Y {
|
|
1143
1143
|
constructor(e) {
|
|
1144
1144
|
super(e);
|
|
1145
1145
|
}
|
|
@@ -1160,7 +1160,7 @@ var Ae = class extends J {
|
|
|
1160
1160
|
indices: [0, this.pattern.length - 1]
|
|
1161
1161
|
};
|
|
1162
1162
|
}
|
|
1163
|
-
}, je = class extends
|
|
1163
|
+
}, je = class extends Y {
|
|
1164
1164
|
constructor(e) {
|
|
1165
1165
|
super(e);
|
|
1166
1166
|
}
|
|
@@ -1181,7 +1181,7 @@ var Ae = class extends J {
|
|
|
1181
1181
|
indices: [0, e.length - 1]
|
|
1182
1182
|
};
|
|
1183
1183
|
}
|
|
1184
|
-
}, Me = class extends
|
|
1184
|
+
}, Me = class extends Y {
|
|
1185
1185
|
constructor(e) {
|
|
1186
1186
|
super(e);
|
|
1187
1187
|
}
|
|
@@ -1202,7 +1202,7 @@ var Ae = class extends J {
|
|
|
1202
1202
|
indices: [0, this.pattern.length - 1]
|
|
1203
1203
|
};
|
|
1204
1204
|
}
|
|
1205
|
-
}, Ne = class extends
|
|
1205
|
+
}, Ne = class extends Y {
|
|
1206
1206
|
constructor(e) {
|
|
1207
1207
|
super(e);
|
|
1208
1208
|
}
|
|
@@ -1223,7 +1223,7 @@ var Ae = class extends J {
|
|
|
1223
1223
|
indices: [0, e.length - 1]
|
|
1224
1224
|
};
|
|
1225
1225
|
}
|
|
1226
|
-
}, Pe = class extends
|
|
1226
|
+
}, Pe = class extends Y {
|
|
1227
1227
|
constructor(e) {
|
|
1228
1228
|
super(e);
|
|
1229
1229
|
}
|
|
@@ -1244,7 +1244,7 @@ var Ae = class extends J {
|
|
|
1244
1244
|
indices: [e.length - this.pattern.length, e.length - 1]
|
|
1245
1245
|
};
|
|
1246
1246
|
}
|
|
1247
|
-
}, Fe = class extends
|
|
1247
|
+
}, Fe = class extends Y {
|
|
1248
1248
|
constructor(e) {
|
|
1249
1249
|
super(e);
|
|
1250
1250
|
}
|
|
@@ -1265,8 +1265,8 @@ var Ae = class extends J {
|
|
|
1265
1265
|
indices: [0, e.length - 1]
|
|
1266
1266
|
};
|
|
1267
1267
|
}
|
|
1268
|
-
}, Ie = class extends
|
|
1269
|
-
constructor(e, { location: t =
|
|
1268
|
+
}, Ie = class extends Y {
|
|
1269
|
+
constructor(e, { location: t = K.location, threshold: n = K.threshold, distance: r = K.distance, includeMatches: i = K.includeMatches, findAllMatches: a = K.findAllMatches, minMatchCharLength: o = K.minMatchCharLength, isCaseSensitive: s = K.isCaseSensitive, ignoreDiacritics: c = K.ignoreDiacritics, ignoreLocation: l = K.ignoreLocation } = {}) {
|
|
1270
1270
|
super(e), this._bitapSearch = new Oe(e, {
|
|
1271
1271
|
location: t,
|
|
1272
1272
|
threshold: n,
|
|
@@ -1291,7 +1291,7 @@ var Ae = class extends J {
|
|
|
1291
1291
|
search(e) {
|
|
1292
1292
|
return this._bitapSearch.searchIn(e);
|
|
1293
1293
|
}
|
|
1294
|
-
}, Le = class extends
|
|
1294
|
+
}, Le = class extends Y {
|
|
1295
1295
|
constructor(e) {
|
|
1296
1296
|
super(e);
|
|
1297
1297
|
}
|
|
@@ -1375,7 +1375,7 @@ function Ue(e, t = {}) {
|
|
|
1375
1375
|
});
|
|
1376
1376
|
}
|
|
1377
1377
|
var We = new Set([Ie.type, Le.type]), Ge = class {
|
|
1378
|
-
constructor(e, { isCaseSensitive: t =
|
|
1378
|
+
constructor(e, { isCaseSensitive: t = K.isCaseSensitive, ignoreDiacritics: n = K.ignoreDiacritics, includeMatches: r = K.includeMatches, minMatchCharLength: i = K.minMatchCharLength, ignoreLocation: a = K.ignoreLocation, findAllMatches: o = K.findAllMatches, location: s = K.location, threshold: c = K.threshold, distance: l = K.distance } = {}) {
|
|
1379
1379
|
this.query = null, this.options = {
|
|
1380
1380
|
isCaseSensitive: t,
|
|
1381
1381
|
ignoreDiacritics: n,
|
|
@@ -1386,7 +1386,7 @@ var We = new Set([Ie.type, Le.type]), Ge = class {
|
|
|
1386
1386
|
location: s,
|
|
1387
1387
|
threshold: c,
|
|
1388
1388
|
distance: l
|
|
1389
|
-
}, e = t ? e : e.toLowerCase(), e = n ?
|
|
1389
|
+
}, e = t ? e : e.toLowerCase(), e = n ? J(e) : e, this.pattern = e, this.query = Ue(this.pattern, this.options);
|
|
1390
1390
|
}
|
|
1391
1391
|
static condition(e, t) {
|
|
1392
1392
|
return t.useExtendedSearch;
|
|
@@ -1398,7 +1398,7 @@ var We = new Set([Ie.type, Le.type]), Ge = class {
|
|
|
1398
1398
|
score: 1
|
|
1399
1399
|
};
|
|
1400
1400
|
let { includeMatches: n, isCaseSensitive: r, ignoreDiacritics: i } = this.options;
|
|
1401
|
-
e = r ? e : e.toLowerCase(), e = i ?
|
|
1401
|
+
e = r ? e : e.toLowerCase(), e = i ? J(e) : e;
|
|
1402
1402
|
let a = 0, o = [], s = 0, c = !1;
|
|
1403
1403
|
for (let r = 0, i = t.length; r < i; r += 1) {
|
|
1404
1404
|
let i = t[r];
|
|
@@ -1431,39 +1431,39 @@ var We = new Set([Ie.type, Le.type]), Ge = class {
|
|
|
1431
1431
|
function qe(...e) {
|
|
1432
1432
|
Ke.push(...e);
|
|
1433
1433
|
}
|
|
1434
|
-
function
|
|
1434
|
+
function X(e, t) {
|
|
1435
1435
|
for (let n = 0, r = Ke.length; n < r; n += 1) {
|
|
1436
1436
|
let r = Ke[n];
|
|
1437
1437
|
if (r.condition(e, t)) return new r(e, t);
|
|
1438
1438
|
}
|
|
1439
1439
|
return new Oe(e, t);
|
|
1440
1440
|
}
|
|
1441
|
-
var
|
|
1441
|
+
var Z = {
|
|
1442
1442
|
AND: "$and",
|
|
1443
1443
|
OR: "$or"
|
|
1444
1444
|
}, Je = {
|
|
1445
1445
|
PATH: "$path",
|
|
1446
1446
|
PATTERN: "$val"
|
|
1447
|
-
}, Ye = (e) => !!(e[
|
|
1447
|
+
}, Ye = (e) => !!(e[Z.AND] || e[Z.OR]), Xe = (e) => !!e[Je.PATH], Ze = (e) => !P(e) && z(e) && !Ye(e), Qe = (e) => ({ [Z.AND]: Object.keys(e).map((t) => ({ [t]: e[t] })) });
|
|
1448
1448
|
function $e(e, t, { auto: n = !0 } = {}) {
|
|
1449
1449
|
let r = (e) => {
|
|
1450
|
-
if (
|
|
1450
|
+
if (L(e)) {
|
|
1451
1451
|
let r = {
|
|
1452
1452
|
keyId: null,
|
|
1453
1453
|
pattern: e
|
|
1454
1454
|
};
|
|
1455
|
-
return n && (r.searcher =
|
|
1455
|
+
return n && (r.searcher = X(e, t)), r;
|
|
1456
1456
|
}
|
|
1457
1457
|
let i = Object.keys(e), a = Xe(e);
|
|
1458
1458
|
if (!a && i.length > 1 && !Ye(e)) return r(Qe(e));
|
|
1459
1459
|
if (Ze(e)) {
|
|
1460
1460
|
let r = a ? e[Je.PATH] : i[0], o = a ? e[Je.PATTERN] : e[r];
|
|
1461
|
-
if (!
|
|
1461
|
+
if (!L(o)) throw Error(W(r));
|
|
1462
1462
|
let s = {
|
|
1463
|
-
keyId:
|
|
1463
|
+
keyId: de(r),
|
|
1464
1464
|
pattern: o
|
|
1465
1465
|
};
|
|
1466
|
-
return n && (s.searcher =
|
|
1466
|
+
return n && (s.searcher = X(o, t)), s;
|
|
1467
1467
|
}
|
|
1468
1468
|
let o = {
|
|
1469
1469
|
children: [],
|
|
@@ -1471,26 +1471,26 @@ function $e(e, t, { auto: n = !0 } = {}) {
|
|
|
1471
1471
|
};
|
|
1472
1472
|
return i.forEach((t) => {
|
|
1473
1473
|
let n = e[t];
|
|
1474
|
-
|
|
1474
|
+
P(n) && n.forEach((e) => {
|
|
1475
1475
|
o.children.push(r(e));
|
|
1476
1476
|
});
|
|
1477
1477
|
}), o;
|
|
1478
1478
|
};
|
|
1479
1479
|
return Ye(e) || (e = Qe(e)), r(e);
|
|
1480
1480
|
}
|
|
1481
|
-
function
|
|
1481
|
+
function et(e, { ignoreFieldNorm: t = K.ignoreFieldNorm }) {
|
|
1482
1482
|
let n = 1;
|
|
1483
1483
|
return e.forEach(({ key: e, norm: r, score: i }) => {
|
|
1484
1484
|
let a = e ? e.weight : null;
|
|
1485
1485
|
n *= (i === 0 && a ? 2 ** -52 : i) ** +((a || 1) * (t ? 1 : r));
|
|
1486
1486
|
}), n;
|
|
1487
1487
|
}
|
|
1488
|
-
function
|
|
1488
|
+
function tt(e, { ignoreFieldNorm: t = K.ignoreFieldNorm }) {
|
|
1489
1489
|
e.forEach((e) => {
|
|
1490
|
-
e.score =
|
|
1490
|
+
e.score = et(e.matches, { ignoreFieldNorm: t });
|
|
1491
1491
|
});
|
|
1492
1492
|
}
|
|
1493
|
-
var
|
|
1493
|
+
var nt = class {
|
|
1494
1494
|
constructor(e) {
|
|
1495
1495
|
this.limit = e, this.heap = [];
|
|
1496
1496
|
}
|
|
@@ -1527,10 +1527,10 @@ var tt = class {
|
|
|
1527
1527
|
} while (r !== e);
|
|
1528
1528
|
}
|
|
1529
1529
|
};
|
|
1530
|
-
function
|
|
1530
|
+
function rt(e, t) {
|
|
1531
1531
|
let n = e.matches;
|
|
1532
|
-
t.matches = [],
|
|
1533
|
-
if (!
|
|
1532
|
+
t.matches = [], B(n) && n.forEach((e) => {
|
|
1533
|
+
if (!B(e.indices) || !e.indices.length) return;
|
|
1534
1534
|
let { indices: n, value: r } = e, i = {
|
|
1535
1535
|
indices: n,
|
|
1536
1536
|
value: r
|
|
@@ -1538,12 +1538,12 @@ function nt(e, t) {
|
|
|
1538
1538
|
e.key && (i.key = e.key.src), e.idx > -1 && (i.refIndex = e.idx), t.matches.push(i);
|
|
1539
1539
|
});
|
|
1540
1540
|
}
|
|
1541
|
-
function
|
|
1541
|
+
function it(e, t) {
|
|
1542
1542
|
t.score = e.score;
|
|
1543
1543
|
}
|
|
1544
|
-
function
|
|
1544
|
+
function at(e, t, { includeMatches: n = K.includeMatches, includeScore: r = K.includeScore } = {}) {
|
|
1545
1545
|
let i = [];
|
|
1546
|
-
return n && i.push(
|
|
1546
|
+
return n && i.push(rt), r && i.push(it), e.map((e) => {
|
|
1547
1547
|
let { idx: n } = e, r = {
|
|
1548
1548
|
item: t[n],
|
|
1549
1549
|
refIndex: n
|
|
@@ -1553,13 +1553,13 @@ function it(e, t, { includeMatches: n = W.includeMatches, includeScore: r = W.in
|
|
|
1553
1553
|
}), r;
|
|
1554
1554
|
});
|
|
1555
1555
|
}
|
|
1556
|
-
var
|
|
1557
|
-
function
|
|
1556
|
+
var ot = /\b\w+\b/g;
|
|
1557
|
+
function st({ isCaseSensitive: e = !1, ignoreDiacritics: t = !1 } = {}) {
|
|
1558
1558
|
return { tokenize(n) {
|
|
1559
|
-
return e || (n = n.toLowerCase()), t && (n =
|
|
1559
|
+
return e || (n = n.toLowerCase()), t && (n = J(n)), n.match(ot) || [];
|
|
1560
1560
|
} };
|
|
1561
1561
|
}
|
|
1562
|
-
function
|
|
1562
|
+
function ct(e, t, n) {
|
|
1563
1563
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = 0;
|
|
1564
1564
|
function o(e, t, o, s) {
|
|
1565
1565
|
let c = n.tokenize(e);
|
|
@@ -1595,7 +1595,7 @@ function st(e, t, n) {
|
|
|
1595
1595
|
df: i
|
|
1596
1596
|
};
|
|
1597
1597
|
}
|
|
1598
|
-
function
|
|
1598
|
+
function lt(e, t, n, r) {
|
|
1599
1599
|
let { i, v: a, $: o } = t;
|
|
1600
1600
|
function s(t, n, a) {
|
|
1601
1601
|
let o = r.tokenize(t);
|
|
@@ -1623,7 +1623,7 @@ function ct(e, t, n, r) {
|
|
|
1623
1623
|
else s(t.v, e, -1);
|
|
1624
1624
|
}
|
|
1625
1625
|
}
|
|
1626
|
-
function
|
|
1626
|
+
function ut(e, t) {
|
|
1627
1627
|
for (let [n, r] of e.terms) {
|
|
1628
1628
|
let i = r.filter((e) => e.docIdx !== t), a = r.length - i.length;
|
|
1629
1629
|
a > 0 && (e.fieldCount -= a, e.df.set(n, (e.df.get(n) || 0) - a), i.length === 0 ? (e.terms.delete(n), e.df.delete(n)) : e.terms.set(n, i));
|
|
@@ -1632,52 +1632,52 @@ function lt(e, t) {
|
|
|
1632
1632
|
var Q = class {
|
|
1633
1633
|
constructor(e, t, n) {
|
|
1634
1634
|
this.options = {
|
|
1635
|
-
...
|
|
1635
|
+
...K,
|
|
1636
1636
|
...t
|
|
1637
|
-
}, this.options.useExtendedSearch, this.options.useTokenSearch, this._keyStore = new
|
|
1637
|
+
}, this.options.useExtendedSearch, this.options.useTokenSearch, this._keyStore = new ce(this.options.keys), this._docs = e, this._myIndex = null, this._invertedIndex = null, this.setCollection(e, n), this._lastQuery = null, this._lastSearcher = null;
|
|
1638
1638
|
}
|
|
1639
1639
|
_getSearcher(e) {
|
|
1640
1640
|
if (this._lastQuery === e) return this._lastSearcher;
|
|
1641
|
-
let t =
|
|
1641
|
+
let t = X(e, this._invertedIndex ? {
|
|
1642
1642
|
...this.options,
|
|
1643
1643
|
_invertedIndex: this._invertedIndex
|
|
1644
1644
|
} : this.options);
|
|
1645
1645
|
return this._lastQuery = e, this._lastSearcher = t, t;
|
|
1646
1646
|
}
|
|
1647
1647
|
setCollection(e, t) {
|
|
1648
|
-
if (this._docs = e, t && !(t instanceof
|
|
1648
|
+
if (this._docs = e, t && !(t instanceof ye)) throw Error(U);
|
|
1649
1649
|
if (this._myIndex = t || be(this.options.keys, this._docs, {
|
|
1650
1650
|
getFn: this.options.getFn,
|
|
1651
1651
|
fieldNormWeight: this.options.fieldNormWeight
|
|
1652
1652
|
}), this.options.useTokenSearch) {
|
|
1653
|
-
let e =
|
|
1653
|
+
let e = st({
|
|
1654
1654
|
isCaseSensitive: this.options.isCaseSensitive,
|
|
1655
1655
|
ignoreDiacritics: this.options.ignoreDiacritics
|
|
1656
1656
|
});
|
|
1657
|
-
this._invertedIndex =
|
|
1657
|
+
this._invertedIndex = ct(this._myIndex.records, this._myIndex.keys.length, e);
|
|
1658
1658
|
}
|
|
1659
1659
|
}
|
|
1660
1660
|
add(e) {
|
|
1661
|
-
if (
|
|
1662
|
-
let e = this._myIndex.records[this._myIndex.records.length - 1], t =
|
|
1661
|
+
if (B(e) && (this._docs.push(e), this._myIndex.add(e), this._invertedIndex)) {
|
|
1662
|
+
let e = this._myIndex.records[this._myIndex.records.length - 1], t = st({
|
|
1663
1663
|
isCaseSensitive: this.options.isCaseSensitive,
|
|
1664
1664
|
ignoreDiacritics: this.options.ignoreDiacritics
|
|
1665
1665
|
});
|
|
1666
|
-
|
|
1666
|
+
lt(this._invertedIndex, e, this._myIndex.keys.length, t);
|
|
1667
1667
|
}
|
|
1668
1668
|
}
|
|
1669
1669
|
remove(e = () => !1) {
|
|
1670
1670
|
let t = [], n = [];
|
|
1671
1671
|
for (let r = 0, i = this._docs.length; r < i; r += 1) e(this._docs[r], r) && (t.push(this._docs[r]), n.push(r));
|
|
1672
1672
|
if (n.length) {
|
|
1673
|
-
if (this._invertedIndex) for (let e of n)
|
|
1673
|
+
if (this._invertedIndex) for (let e of n) ut(this._invertedIndex, e);
|
|
1674
1674
|
for (let e = n.length - 1; e >= 0; --e) this._docs.splice(n[e], 1);
|
|
1675
1675
|
this._myIndex.removeAll(n);
|
|
1676
1676
|
}
|
|
1677
1677
|
return t;
|
|
1678
1678
|
}
|
|
1679
1679
|
removeAt(e) {
|
|
1680
|
-
this._invertedIndex &&
|
|
1680
|
+
this._invertedIndex && ut(this._invertedIndex, e);
|
|
1681
1681
|
let t = this._docs.splice(e, 1)[0];
|
|
1682
1682
|
return this._myIndex.removeAt(e), t;
|
|
1683
1683
|
}
|
|
@@ -1686,25 +1686,25 @@ var Q = class {
|
|
|
1686
1686
|
}
|
|
1687
1687
|
search(e, t) {
|
|
1688
1688
|
let { limit: n = -1 } = t || {}, { includeMatches: r, includeScore: i, shouldSort: a, sortFn: o, ignoreFieldNorm: s } = this.options;
|
|
1689
|
-
if (
|
|
1689
|
+
if (L(e) && !e.trim()) {
|
|
1690
1690
|
let e = this._docs.map((e, t) => ({
|
|
1691
1691
|
item: e,
|
|
1692
1692
|
refIndex: t
|
|
1693
1693
|
}));
|
|
1694
|
-
return
|
|
1694
|
+
return R(n) && n > -1 && (e = e.slice(0, n)), e;
|
|
1695
1695
|
}
|
|
1696
|
-
let c =
|
|
1696
|
+
let c = R(n) && n > 0 && L(e), l;
|
|
1697
1697
|
if (c) {
|
|
1698
|
-
let t = new
|
|
1699
|
-
|
|
1698
|
+
let t = new nt(n);
|
|
1699
|
+
L(this._docs[0]) ? this._searchStringList(e, {
|
|
1700
1700
|
heap: t,
|
|
1701
1701
|
ignoreFieldNorm: s
|
|
1702
1702
|
}) : this._searchObjectList(e, {
|
|
1703
1703
|
heap: t,
|
|
1704
1704
|
ignoreFieldNorm: s
|
|
1705
1705
|
}), l = t.extractSorted(o);
|
|
1706
|
-
} else l =
|
|
1707
|
-
return
|
|
1706
|
+
} else l = L(e) ? L(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e), tt(l, { ignoreFieldNorm: s }), a && l.sort(o), R(n) && n > -1 && (l = l.slice(0, n));
|
|
1707
|
+
return at(l, this._docs, {
|
|
1708
1708
|
includeMatches: r,
|
|
1709
1709
|
includeScore: i
|
|
1710
1710
|
});
|
|
@@ -1712,7 +1712,7 @@ var Q = class {
|
|
|
1712
1712
|
_searchStringList(e, { heap: t, ignoreFieldNorm: n } = {}) {
|
|
1713
1713
|
let r = this._getSearcher(e), { records: i } = this._myIndex, a = t ? null : [];
|
|
1714
1714
|
return i.forEach(({ v: e, i, n: o }) => {
|
|
1715
|
-
if (!
|
|
1715
|
+
if (!B(e)) return;
|
|
1716
1716
|
let { isMatch: s, score: c, indices: l } = r.searchIn(e);
|
|
1717
1717
|
if (s) {
|
|
1718
1718
|
let r = {
|
|
@@ -1725,7 +1725,7 @@ var Q = class {
|
|
|
1725
1725
|
indices: l
|
|
1726
1726
|
}]
|
|
1727
1727
|
};
|
|
1728
|
-
t ? (r.score =
|
|
1728
|
+
t ? (r.score = et(r.matches, { ignoreFieldNorm: n }), t.shouldInsert(r.score) && t.insert(r)) : a.push(r);
|
|
1729
1729
|
}
|
|
1730
1730
|
}), a;
|
|
1731
1731
|
}
|
|
@@ -1753,12 +1753,12 @@ var Q = class {
|
|
|
1753
1753
|
for (let e = 0, s = i.length; e < s; e += 1) {
|
|
1754
1754
|
let s = i[e], c = n(s, t, r);
|
|
1755
1755
|
if (c.length) o.push(...c);
|
|
1756
|
-
else if (a ===
|
|
1756
|
+
else if (a === Z.AND) return [];
|
|
1757
1757
|
}
|
|
1758
1758
|
return o;
|
|
1759
1759
|
}, r = this._myIndex.records, i = /* @__PURE__ */ new Map(), a = [];
|
|
1760
1760
|
return r.forEach(({ $: e, i: r }) => {
|
|
1761
|
-
if (
|
|
1761
|
+
if (B(e)) {
|
|
1762
1762
|
let o = n(t, e, r);
|
|
1763
1763
|
o.length && (i.has(r) || (i.set(r, {
|
|
1764
1764
|
idx: r,
|
|
@@ -1773,7 +1773,7 @@ var Q = class {
|
|
|
1773
1773
|
_searchObjectList(e, { heap: t, ignoreFieldNorm: n } = {}) {
|
|
1774
1774
|
let r = this._getSearcher(e), { keys: i, records: a } = this._myIndex, o = t ? null : [];
|
|
1775
1775
|
return a.forEach(({ $: e, i: a }) => {
|
|
1776
|
-
if (!
|
|
1776
|
+
if (!B(e)) return;
|
|
1777
1777
|
let s = [], c = !1, l = !1;
|
|
1778
1778
|
if (i.forEach((t, n) => {
|
|
1779
1779
|
let i = this._findMatches({
|
|
@@ -1788,15 +1788,15 @@ var Q = class {
|
|
|
1788
1788
|
item: e,
|
|
1789
1789
|
matches: s
|
|
1790
1790
|
};
|
|
1791
|
-
t ? (r.score =
|
|
1791
|
+
t ? (r.score = et(r.matches, { ignoreFieldNorm: n }), t.shouldInsert(r.score) && t.insert(r)) : o.push(r);
|
|
1792
1792
|
}
|
|
1793
1793
|
}), o;
|
|
1794
1794
|
}
|
|
1795
1795
|
_findMatches({ key: e, value: t, searcher: n }) {
|
|
1796
|
-
if (!
|
|
1796
|
+
if (!B(t)) return [];
|
|
1797
1797
|
let r = [];
|
|
1798
|
-
if (
|
|
1799
|
-
if (!
|
|
1798
|
+
if (P(t)) t.forEach(({ v: t, i, n: a }) => {
|
|
1799
|
+
if (!B(t)) return;
|
|
1800
1800
|
let { isMatch: o, score: s, indices: c, hasInverse: l } = n.searchIn(t);
|
|
1801
1801
|
o && r.push({
|
|
1802
1802
|
score: s,
|
|
@@ -1821,12 +1821,12 @@ var Q = class {
|
|
|
1821
1821
|
}
|
|
1822
1822
|
return r;
|
|
1823
1823
|
}
|
|
1824
|
-
},
|
|
1824
|
+
}, dt = class {
|
|
1825
1825
|
static condition(e, t) {
|
|
1826
1826
|
return t.useTokenSearch;
|
|
1827
1827
|
}
|
|
1828
1828
|
constructor(e, t) {
|
|
1829
|
-
this.options = t, this.analyzer =
|
|
1829
|
+
this.options = t, this.analyzer = st({
|
|
1830
1830
|
isCaseSensitive: t.isCaseSensitive,
|
|
1831
1831
|
ignoreDiacritics: t.ignoreDiacritics
|
|
1832
1832
|
});
|
|
@@ -1869,17 +1869,17 @@ var Q = class {
|
|
|
1869
1869
|
return this.options.includeMatches && t.length && (o.indices = Te(t)), o;
|
|
1870
1870
|
}
|
|
1871
1871
|
};
|
|
1872
|
-
Q.version = "7.3.0", Q.createIndex = be, Q.parseIndex = xe, Q.config =
|
|
1873
|
-
return
|
|
1874
|
-
...
|
|
1872
|
+
Q.version = "7.3.0", Q.createIndex = be, Q.parseIndex = xe, Q.config = K, Q.match = function(e, t, n) {
|
|
1873
|
+
return X(e, {
|
|
1874
|
+
...K,
|
|
1875
1875
|
...n
|
|
1876
1876
|
}).searchIn(t);
|
|
1877
|
-
}, Q.parseQuery = $e, qe(Ge), qe(
|
|
1877
|
+
}, Q.parseQuery = $e, qe(Ge), qe(dt), Q.use = function(...e) {
|
|
1878
1878
|
e.forEach((e) => qe(e));
|
|
1879
1879
|
};
|
|
1880
1880
|
//#endregion
|
|
1881
1881
|
//#region src/hooks/useCommands.js
|
|
1882
|
-
var
|
|
1882
|
+
var ft = (e, t = .4) => (e = e ? Object.entries(e)?.reduce((e, [t, n]) => ({ [t.toLowerCase()]: n }), {}) : {}, (n) => {
|
|
1883
1883
|
let r = new Q(Object.keys(e), {
|
|
1884
1884
|
includeScore: !0,
|
|
1885
1885
|
ignoreLocation: !0
|
|
@@ -1889,7 +1889,7 @@ var dt = (e, t = .4) => (e = e ? Object.entries(e)?.reduce((e, [t, n]) => ({ [t.
|
|
|
1889
1889
|
return e[t]?.(n);
|
|
1890
1890
|
}
|
|
1891
1891
|
return null;
|
|
1892
|
-
}),
|
|
1892
|
+
}), pt = /* @__PURE__ */ s(((e) => {
|
|
1893
1893
|
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
1894
1894
|
function r(e, n, r) {
|
|
1895
1895
|
var i = null;
|
|
@@ -1904,11 +1904,11 @@ var dt = (e, t = .4) => (e = e ? Object.entries(e)?.reduce((e, [t, n]) => ({ [t.
|
|
|
1904
1904
|
};
|
|
1905
1905
|
}
|
|
1906
1906
|
e.Fragment = n, e.jsx = r, e.jsxs = r;
|
|
1907
|
-
})),
|
|
1907
|
+
})), mt = /* @__PURE__ */ s(((e) => {
|
|
1908
1908
|
process.env.NODE_ENV !== "production" && (function() {
|
|
1909
1909
|
function t(e) {
|
|
1910
1910
|
if (e == null) return null;
|
|
1911
|
-
if (typeof e == "function") return e.$$typeof ===
|
|
1911
|
+
if (typeof e == "function") return e.$$typeof === O ? null : e.displayName || e.name || null;
|
|
1912
1912
|
if (typeof e == "string") return e;
|
|
1913
1913
|
switch (e) {
|
|
1914
1914
|
case v: return "Fragment";
|
|
@@ -1916,7 +1916,7 @@ var dt = (e, t = .4) => (e = e ? Object.entries(e)?.reduce((e, [t, n]) => ({ [t.
|
|
|
1916
1916
|
case y: return "StrictMode";
|
|
1917
1917
|
case w: return "Suspense";
|
|
1918
1918
|
case T: return "SuspenseList";
|
|
1919
|
-
case
|
|
1919
|
+
case ee: return "Activity";
|
|
1920
1920
|
}
|
|
1921
1921
|
if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
|
|
1922
1922
|
case _: return "Portal";
|
|
@@ -1961,14 +1961,14 @@ var dt = (e, t = .4) => (e = e ? Object.entries(e)?.reduce((e, [t, n]) => ({ [t.
|
|
|
1961
1961
|
}
|
|
1962
1962
|
}
|
|
1963
1963
|
function a() {
|
|
1964
|
-
var e =
|
|
1964
|
+
var e = k.A;
|
|
1965
1965
|
return e === null ? null : e.getOwner();
|
|
1966
1966
|
}
|
|
1967
1967
|
function o() {
|
|
1968
1968
|
return Error("react-stack-top-frame");
|
|
1969
1969
|
}
|
|
1970
|
-
function
|
|
1971
|
-
if (
|
|
1970
|
+
function s(e) {
|
|
1971
|
+
if (A.call(e, "key")) {
|
|
1972
1972
|
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
1973
1973
|
if (t && t.isReactWarning) return !1;
|
|
1974
1974
|
}
|
|
@@ -1976,7 +1976,7 @@ var dt = (e, t = .4) => (e = e ? Object.entries(e)?.reduce((e, [t, n]) => ({ [t.
|
|
|
1976
1976
|
}
|
|
1977
1977
|
function l(e, t) {
|
|
1978
1978
|
function n() {
|
|
1979
|
-
|
|
1979
|
+
te || (te = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
|
|
1980
1980
|
}
|
|
1981
1981
|
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
1982
1982
|
get: n,
|
|
@@ -1985,7 +1985,7 @@ var dt = (e, t = .4) => (e = e ? Object.entries(e)?.reduce((e, [t, n]) => ({ [t.
|
|
|
1985
1985
|
}
|
|
1986
1986
|
function u() {
|
|
1987
1987
|
var e = t(this.type);
|
|
1988
|
-
return
|
|
1988
|
+
return N[e] || (N[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
|
|
1989
1989
|
}
|
|
1990
1990
|
function d(e, t, n, r, i, a) {
|
|
1991
1991
|
var o = n.ref;
|
|
@@ -2023,23 +2023,23 @@ var dt = (e, t = .4) => (e = e ? Object.entries(e)?.reduce((e, [t, n]) => ({ [t.
|
|
|
2023
2023
|
value: a
|
|
2024
2024
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
2025
2025
|
}
|
|
2026
|
-
function f(e, n, i, o,
|
|
2026
|
+
function f(e, n, i, o, c, u) {
|
|
2027
2027
|
var f = n.children;
|
|
2028
|
-
if (f !== void 0) if (o) if (
|
|
2028
|
+
if (f !== void 0) if (o) if (j(f)) {
|
|
2029
2029
|
for (o = 0; o < f.length; o++) p(f[o]);
|
|
2030
2030
|
Object.freeze && Object.freeze(f);
|
|
2031
2031
|
} else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
2032
2032
|
else p(f);
|
|
2033
|
-
if (
|
|
2033
|
+
if (A.call(n, "key")) {
|
|
2034
2034
|
f = t(e);
|
|
2035
2035
|
var m = Object.keys(n).filter(function(e) {
|
|
2036
2036
|
return e !== "key";
|
|
2037
2037
|
});
|
|
2038
|
-
o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
2038
|
+
o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", F[f + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, f, m, f), F[f + o] = !0);
|
|
2039
2039
|
}
|
|
2040
|
-
if (f = null, i !== void 0 && (r(i), f = "" + i),
|
|
2040
|
+
if (f = null, i !== void 0 && (r(i), f = "" + i), s(n) && (r(n.key), f = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
|
|
2041
2041
|
else i = n;
|
|
2042
|
-
return f && l(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), d(e, f, i, a(),
|
|
2042
|
+
return f && l(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), d(e, f, i, a(), c, u);
|
|
2043
2043
|
}
|
|
2044
2044
|
function p(e) {
|
|
2045
2045
|
m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === D && (e._payload.status === "fulfilled" ? m(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
@@ -2047,24 +2047,24 @@ var dt = (e, t = .4) => (e = e ? Object.entries(e)?.reduce((e, [t, n]) => ({ [t.
|
|
|
2047
2047
|
function m(e) {
|
|
2048
2048
|
return typeof e == "object" && !!e && e.$$typeof === g;
|
|
2049
2049
|
}
|
|
2050
|
-
var h =
|
|
2050
|
+
var h = c("react"), g = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), S = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), ee = Symbol.for("react.activity"), O = Symbol.for("react.client.reference"), k = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, j = Array.isArray, M = console.createTask ? console.createTask : function() {
|
|
2051
2051
|
return null;
|
|
2052
2052
|
};
|
|
2053
2053
|
h = { react_stack_bottom_frame: function(e) {
|
|
2054
2054
|
return e();
|
|
2055
2055
|
} };
|
|
2056
|
-
var
|
|
2056
|
+
var te, N = {}, ne = h.react_stack_bottom_frame.bind(h, o)(), P = M(i(o)), F = {};
|
|
2057
2057
|
e.Fragment = v, e.jsx = function(e, t, n) {
|
|
2058
|
-
var r = 1e4 >
|
|
2059
|
-
return f(e, t, n, !1, r ? Error("react-stack-top-frame") :
|
|
2058
|
+
var r = 1e4 > k.recentlyCreatedOwnerStacks++;
|
|
2059
|
+
return f(e, t, n, !1, r ? Error("react-stack-top-frame") : ne, r ? M(i(e)) : P);
|
|
2060
2060
|
}, e.jsxs = function(e, t, n) {
|
|
2061
|
-
var r = 1e4 >
|
|
2062
|
-
return f(e, t, n, !0, r ? Error("react-stack-top-frame") :
|
|
2061
|
+
var r = 1e4 > k.recentlyCreatedOwnerStacks++;
|
|
2062
|
+
return f(e, t, n, !0, r ? Error("react-stack-top-frame") : ne, r ? M(i(e)) : P);
|
|
2063
2063
|
};
|
|
2064
2064
|
})();
|
|
2065
|
-
})), $ = (/* @__PURE__ */
|
|
2066
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
2067
|
-
})))(),
|
|
2065
|
+
})), $ = (/* @__PURE__ */ s(((e, t) => {
|
|
2066
|
+
process.env.NODE_ENV === "production" ? t.exports = pt() : t.exports = mt();
|
|
2067
|
+
})))(), ht = ({ color: e = "black", activeColor: t = "red", isActive: n = !1 }) => /* @__PURE__ */ (0, $.jsx)("svg", {
|
|
2068
2068
|
"data-testid": "__icon-root__",
|
|
2069
2069
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2070
2070
|
width: "100%",
|
|
@@ -2081,71 +2081,102 @@ var dt = (e, t = .4) => (e = e ? Object.entries(e)?.reduce((e, [t, n]) => ({ [t.
|
|
|
2081
2081
|
cy: "4",
|
|
2082
2082
|
r: "4"
|
|
2083
2083
|
})] })
|
|
2084
|
-
}),
|
|
2085
|
-
let
|
|
2086
|
-
|
|
2087
|
-
|
|
2084
|
+
}), gt = ({ children: r, commands: s = null, lang: c = "en-US", grammars: l = null, timeout: u = 3e3, ariaLabel: d = "start recognition", style: f = null, className: p = null, outlineStyle: m = "2px solid", onStart: h = null, onEnd: g = null, onSpeechStart: _ = null, onSpeechEnd: v = null, onResult: y = null, onError: b = null, onNoMatch: x = null, __rsInstance: S }) => {
|
|
2085
|
+
let C = a(null), [w, T] = o(!1), [, { start: E, stop: D, subscribe: ee, unsubscribe: O }] = N(c, l, S), k = ft(s), A = a({});
|
|
2086
|
+
A.current = {
|
|
2087
|
+
onStart: h,
|
|
2088
|
+
onEnd: g,
|
|
2089
|
+
onSpeechStart: _,
|
|
2090
|
+
onSpeechEnd: v,
|
|
2091
|
+
onResult: y,
|
|
2092
|
+
onError: b,
|
|
2093
|
+
onNoMatch: x
|
|
2094
|
+
};
|
|
2095
|
+
let j = a(k);
|
|
2096
|
+
j.current = k;
|
|
2097
|
+
let P = a(null), F = a(null), [I, L] = ne(n(() => F.current?.(), []), u), R = n(() => {
|
|
2088
2098
|
try {
|
|
2089
|
-
|
|
2099
|
+
T(!1), D();
|
|
2090
2100
|
} catch (e) {
|
|
2091
|
-
|
|
2101
|
+
A.current.onError?.(e);
|
|
2102
|
+
} finally {
|
|
2103
|
+
P.current?.();
|
|
2092
2104
|
}
|
|
2093
|
-
},
|
|
2105
|
+
}, [D]), re = n((e) => {
|
|
2106
|
+
I(), A.current.onStart?.(e);
|
|
2107
|
+
}, [I]), z = n((e) => {
|
|
2108
|
+
L(), A.current.onSpeechStart?.(e);
|
|
2109
|
+
}, [L]), ie = n((e) => {
|
|
2110
|
+
I(), A.current.onSpeechEnd?.(e);
|
|
2111
|
+
}, [I]), B = n((e, t) => {
|
|
2112
|
+
L(), R(), j.current(t), A.current.onResult?.(t, e);
|
|
2113
|
+
}, [L, R]), V = n((e) => {
|
|
2114
|
+
R(), A.current.onError?.(e);
|
|
2115
|
+
}, [R]), H = n((e) => {
|
|
2116
|
+
L(), R(), A.current.onNoMatch?.(e);
|
|
2117
|
+
}, [L, R]), U = n((e) => {
|
|
2118
|
+
L(), R(), A.current.onEnd?.(e);
|
|
2119
|
+
}, [L, R]);
|
|
2120
|
+
F.current = U;
|
|
2121
|
+
let W = i(() => ({
|
|
2122
|
+
start: re,
|
|
2123
|
+
end: U,
|
|
2124
|
+
speechstart: z,
|
|
2125
|
+
speechend: ie,
|
|
2126
|
+
result: B,
|
|
2127
|
+
error: V,
|
|
2128
|
+
nomatch: H
|
|
2129
|
+
}), [
|
|
2130
|
+
re,
|
|
2131
|
+
U,
|
|
2132
|
+
z,
|
|
2133
|
+
ie,
|
|
2134
|
+
B,
|
|
2135
|
+
V,
|
|
2136
|
+
H
|
|
2137
|
+
]);
|
|
2138
|
+
P.current = () => Object.entries(W).forEach(([e, t]) => O?.(e, t));
|
|
2139
|
+
let G = n(() => {
|
|
2094
2140
|
try {
|
|
2095
|
-
|
|
2141
|
+
T(!0), Object.entries(W).forEach(([e, t]) => ee(e, t)), E();
|
|
2096
2142
|
} catch (e) {
|
|
2097
|
-
|
|
2098
|
-
}
|
|
2099
|
-
}, L = () => {
|
|
2100
|
-
!d && f && (x.current.style.outline = f);
|
|
2101
|
-
}, R = () => {
|
|
2102
|
-
!d && f && (x.current.style.outline = "none");
|
|
2103
|
-
}, z = (e) => {
|
|
2104
|
-
A(), p?.(e);
|
|
2105
|
-
}, te = (e) => {
|
|
2106
|
-
j(), h?.(e);
|
|
2107
|
-
}, B = (e) => {
|
|
2108
|
-
A(), g?.(e);
|
|
2109
|
-
}, ne = (e, t) => {
|
|
2110
|
-
j(), I(), O(t), _?.(t, e);
|
|
2111
|
-
}, V = (e) => {
|
|
2112
|
-
I(), v?.(e);
|
|
2113
|
-
}, H = {
|
|
2114
|
-
start: z,
|
|
2115
|
-
end: k,
|
|
2116
|
-
speechstart: te,
|
|
2117
|
-
speechend: B,
|
|
2118
|
-
result: ne,
|
|
2119
|
-
error: V,
|
|
2120
|
-
nomatch: (e) => {
|
|
2121
|
-
j(), I(), y?.(e);
|
|
2143
|
+
V(e);
|
|
2122
2144
|
}
|
|
2123
|
-
},
|
|
2124
|
-
|
|
2145
|
+
}, [
|
|
2146
|
+
W,
|
|
2147
|
+
ee,
|
|
2148
|
+
E,
|
|
2149
|
+
V
|
|
2150
|
+
]), ae = () => {
|
|
2151
|
+
!p && m && (C.current.style.outline = m);
|
|
2152
|
+
}, oe = () => {
|
|
2153
|
+
!p && m && (C.current.style.outline = "none");
|
|
2154
|
+
};
|
|
2155
|
+
return M.isSupported ? te(r) ? r(G, R, w) : t(r) ? e(r, { ...!w && { onClick: G } }) : /* @__PURE__ */ (0, $.jsx)("button", {
|
|
2125
2156
|
"data-testid": "__vocal-root__",
|
|
2126
|
-
ref:
|
|
2157
|
+
ref: C,
|
|
2127
2158
|
role: "button",
|
|
2128
|
-
"aria-label":
|
|
2129
|
-
style:
|
|
2159
|
+
"aria-label": d,
|
|
2160
|
+
style: p ? null : {
|
|
2130
2161
|
width: 24,
|
|
2131
2162
|
height: 24,
|
|
2132
2163
|
backgroundColor: "transparent",
|
|
2133
2164
|
border: "none",
|
|
2134
2165
|
padding: 0,
|
|
2135
|
-
cursor:
|
|
2136
|
-
...
|
|
2166
|
+
cursor: w ? "default" : "pointer",
|
|
2167
|
+
...f
|
|
2137
2168
|
},
|
|
2138
|
-
className:
|
|
2139
|
-
onFocus:
|
|
2140
|
-
onBlur:
|
|
2141
|
-
onClick:
|
|
2142
|
-
children: /* @__PURE__ */ (0, $.jsx)(
|
|
2143
|
-
isActive:
|
|
2169
|
+
className: p,
|
|
2170
|
+
onFocus: ae,
|
|
2171
|
+
onBlur: oe,
|
|
2172
|
+
onClick: G,
|
|
2173
|
+
children: /* @__PURE__ */ (0, $.jsx)(ht, {
|
|
2174
|
+
isActive: w,
|
|
2144
2175
|
color: "#aaa"
|
|
2145
2176
|
})
|
|
2146
2177
|
}) : null;
|
|
2147
|
-
},
|
|
2178
|
+
}, _t = M.isSupported, vt = gt;
|
|
2148
2179
|
//#endregion
|
|
2149
|
-
export {
|
|
2180
|
+
export { vt as default, _t as isSupported, N as useVocal };
|
|
2150
2181
|
|
|
2151
2182
|
//# sourceMappingURL=index.es.js.map
|