@vinicunca/perkakas 0.0.10 → 0.1.0
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/index.cjs +150 -23
- package/dist/index.d.cts +229 -81
- package/dist/index.d.ts +229 -81
- package/dist/index.js +148 -23
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +3 -3
- package/package.json +7 -8
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
// src/aria/key-codes.ts
|
|
2
2
|
var KEY_CODES = {
|
|
3
|
-
|
|
3
|
+
ALT: "Alt",
|
|
4
4
|
ARROW_DOWN: "ArrowDown",
|
|
5
|
-
ARROW_UP: "ArrowUp",
|
|
6
5
|
ARROW_LEFT: "ArrowLeft",
|
|
7
6
|
ARROW_RIGHT: "ArrowRight",
|
|
7
|
+
ARROW_UP: "ArrowUp",
|
|
8
|
+
AT: "@",
|
|
9
|
+
BACKSPACE: "Backspace",
|
|
10
|
+
CTRL: "Control",
|
|
11
|
+
DELETE: "Delete",
|
|
12
|
+
END: "End",
|
|
8
13
|
ENTER: "Enter",
|
|
9
14
|
ESC: "Escape",
|
|
10
|
-
|
|
11
|
-
SHIFT: "Shift",
|
|
15
|
+
HOME: "Home",
|
|
12
16
|
KEY_F: "KEY_F",
|
|
13
|
-
CTRL: "Control",
|
|
14
|
-
ALT: "Alt",
|
|
15
17
|
META: "Meta",
|
|
16
|
-
|
|
17
|
-
DELETE: "Delete",
|
|
18
|
-
BACKSPACE: "Backspace",
|
|
19
|
-
HOME: "Home",
|
|
20
|
-
END: "End",
|
|
18
|
+
PAGE_DOWN: "PageDown",
|
|
21
19
|
PAGE_UP: "PageUp",
|
|
22
|
-
|
|
20
|
+
SHIFT: "Shift",
|
|
21
|
+
SPACE: "Space",
|
|
22
|
+
TAB: "Tab"
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
// src/function/pipe.ts
|
|
@@ -59,7 +59,7 @@ function pipe(value, ...operations) {
|
|
|
59
59
|
}
|
|
60
60
|
const acc = [];
|
|
61
61
|
for (const item of ret) {
|
|
62
|
-
if (_processItem({
|
|
62
|
+
if (_processItem({ acc, item, lazySeq })) {
|
|
63
63
|
break;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -74,9 +74,9 @@ function pipe(value, ...operations) {
|
|
|
74
74
|
return ret;
|
|
75
75
|
}
|
|
76
76
|
function _processItem({
|
|
77
|
+
acc,
|
|
77
78
|
item,
|
|
78
|
-
lazySeq
|
|
79
|
-
acc
|
|
79
|
+
lazySeq
|
|
80
80
|
}) {
|
|
81
81
|
if (lazySeq.length === 0) {
|
|
82
82
|
acc.push(item);
|
|
@@ -97,8 +97,8 @@ function _processItem({
|
|
|
97
97
|
const nextValues = lazyResult.next;
|
|
98
98
|
for (const subItem of nextValues) {
|
|
99
99
|
const subResult = _processItem({
|
|
100
|
-
item: subItem,
|
|
101
100
|
acc,
|
|
101
|
+
item: subItem,
|
|
102
102
|
lazySeq: lazySeq.slice(i + 1)
|
|
103
103
|
});
|
|
104
104
|
if (subResult) {
|
|
@@ -120,10 +120,7 @@ function _processItem({
|
|
|
120
120
|
if (lazyResult.hasNext) {
|
|
121
121
|
acc.push(item);
|
|
122
122
|
}
|
|
123
|
-
|
|
124
|
-
return true;
|
|
125
|
-
}
|
|
126
|
-
return false;
|
|
123
|
+
return !!isDone;
|
|
127
124
|
}
|
|
128
125
|
|
|
129
126
|
// src/function/create-pipe.ts
|
|
@@ -154,6 +151,103 @@ function once(fn) {
|
|
|
154
151
|
};
|
|
155
152
|
}
|
|
156
153
|
|
|
154
|
+
// src/function/debounce.ts
|
|
155
|
+
function debounce(func, {
|
|
156
|
+
maxWaitMs,
|
|
157
|
+
timing = "trailing",
|
|
158
|
+
waitMs
|
|
159
|
+
}) {
|
|
160
|
+
if (maxWaitMs !== void 0 && waitMs !== void 0 && maxWaitMs < waitMs) {
|
|
161
|
+
throw new Error(
|
|
162
|
+
`debounce: maxWaitMs (${maxWaitMs}) cannot be less than waitMs (${waitMs})`
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
let coolDownTimeoutId;
|
|
166
|
+
let maxWaitTimeoutId;
|
|
167
|
+
let latestCallArgs;
|
|
168
|
+
let result;
|
|
169
|
+
function handleDebouncedCall(args) {
|
|
170
|
+
latestCallArgs = args;
|
|
171
|
+
if (maxWaitMs !== void 0 && maxWaitTimeoutId === void 0) {
|
|
172
|
+
maxWaitTimeoutId = setTimeout(handleInvoke, maxWaitMs);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function handleInvoke() {
|
|
176
|
+
if (latestCallArgs === void 0) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (maxWaitTimeoutId !== void 0) {
|
|
180
|
+
const timeoutId = maxWaitTimeoutId;
|
|
181
|
+
maxWaitTimeoutId = void 0;
|
|
182
|
+
clearTimeout(timeoutId);
|
|
183
|
+
}
|
|
184
|
+
const args = latestCallArgs;
|
|
185
|
+
latestCallArgs = void 0;
|
|
186
|
+
result = func(...args);
|
|
187
|
+
}
|
|
188
|
+
function handleCoolDownEnd() {
|
|
189
|
+
if (coolDownTimeoutId === void 0) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const timeoutId = coolDownTimeoutId;
|
|
193
|
+
coolDownTimeoutId = void 0;
|
|
194
|
+
clearTimeout(timeoutId);
|
|
195
|
+
if (latestCallArgs !== void 0) {
|
|
196
|
+
handleInvoke();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
get cachedValue() {
|
|
201
|
+
return result;
|
|
202
|
+
},
|
|
203
|
+
call: (...args) => {
|
|
204
|
+
if (coolDownTimeoutId === void 0) {
|
|
205
|
+
if (timing === "trailing") {
|
|
206
|
+
handleDebouncedCall(args);
|
|
207
|
+
} else {
|
|
208
|
+
result = func(...args);
|
|
209
|
+
}
|
|
210
|
+
} else {
|
|
211
|
+
if (timing !== "leading") {
|
|
212
|
+
handleDebouncedCall(args);
|
|
213
|
+
}
|
|
214
|
+
const timeoutId = coolDownTimeoutId;
|
|
215
|
+
coolDownTimeoutId = void 0;
|
|
216
|
+
clearTimeout(timeoutId);
|
|
217
|
+
}
|
|
218
|
+
coolDownTimeoutId = setTimeout(
|
|
219
|
+
handleCoolDownEnd,
|
|
220
|
+
// If waitMs is not defined but maxWaitMs *is* it means the user is only
|
|
221
|
+
// interested in the leaky-bucket nature of the debouncer which is
|
|
222
|
+
// achieved by setting waitMs === maxWaitMs. If both are not defined we
|
|
223
|
+
// default to 0 which would wait until the end of the execution frame.
|
|
224
|
+
waitMs ?? maxWaitMs ?? 0
|
|
225
|
+
);
|
|
226
|
+
return result;
|
|
227
|
+
},
|
|
228
|
+
cancel: () => {
|
|
229
|
+
if (coolDownTimeoutId !== void 0) {
|
|
230
|
+
const timeoutId = coolDownTimeoutId;
|
|
231
|
+
coolDownTimeoutId = void 0;
|
|
232
|
+
clearTimeout(timeoutId);
|
|
233
|
+
}
|
|
234
|
+
if (maxWaitTimeoutId !== void 0) {
|
|
235
|
+
const timeoutId = maxWaitTimeoutId;
|
|
236
|
+
maxWaitTimeoutId = void 0;
|
|
237
|
+
clearTimeout(timeoutId);
|
|
238
|
+
}
|
|
239
|
+
latestCallArgs = void 0;
|
|
240
|
+
},
|
|
241
|
+
flush: () => {
|
|
242
|
+
handleCoolDownEnd();
|
|
243
|
+
return result;
|
|
244
|
+
},
|
|
245
|
+
get isPending() {
|
|
246
|
+
return coolDownTimeoutId !== void 0;
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
|
|
157
251
|
// src/function/purry.ts
|
|
158
252
|
function purry(fn, args, lazy) {
|
|
159
253
|
const diff = fn.length - args.length;
|
|
@@ -673,8 +767,8 @@ function _flatten(items) {
|
|
|
673
767
|
if (Array.isArray(next)) {
|
|
674
768
|
return {
|
|
675
769
|
done: false,
|
|
676
|
-
hasNext: true,
|
|
677
770
|
hasMany: true,
|
|
771
|
+
hasNext: true,
|
|
678
772
|
next
|
|
679
773
|
};
|
|
680
774
|
}
|
|
@@ -702,8 +796,8 @@ function _flatMap(array, fn) {
|
|
|
702
796
|
if (Array.isArray(next)) {
|
|
703
797
|
return {
|
|
704
798
|
done: false,
|
|
705
|
-
hasNext: true,
|
|
706
799
|
hasMany: true,
|
|
800
|
+
hasNext: true,
|
|
707
801
|
next
|
|
708
802
|
};
|
|
709
803
|
}
|
|
@@ -745,8 +839,8 @@ function _flattenDeepValue(value) {
|
|
|
745
839
|
if (Array.isArray(next)) {
|
|
746
840
|
return {
|
|
747
841
|
done: false,
|
|
748
|
-
hasNext: true,
|
|
749
842
|
hasMany: true,
|
|
843
|
+
hasNext: true,
|
|
750
844
|
next
|
|
751
845
|
};
|
|
752
846
|
}
|
|
@@ -1474,6 +1568,9 @@ function _zip(first2, second) {
|
|
|
1474
1568
|
}
|
|
1475
1569
|
return result;
|
|
1476
1570
|
}
|
|
1571
|
+
((zip2) => {
|
|
1572
|
+
zip2.strict = zip2;
|
|
1573
|
+
})(zip || (zip = {}));
|
|
1477
1574
|
|
|
1478
1575
|
// src/array/zip-obj.ts
|
|
1479
1576
|
function zipObj(...args) {
|
|
@@ -1752,6 +1849,32 @@ function _merge(a, b) {
|
|
|
1752
1849
|
return Object.assign({}, a, b);
|
|
1753
1850
|
}
|
|
1754
1851
|
|
|
1852
|
+
// src/object/merge-deep.ts
|
|
1853
|
+
function mergeDeep(...args) {
|
|
1854
|
+
return purry(mergeDeepImplementation, args);
|
|
1855
|
+
}
|
|
1856
|
+
function mergeDeepImplementation(destination, source) {
|
|
1857
|
+
const output = { ...destination, ...source };
|
|
1858
|
+
for (const key in source) {
|
|
1859
|
+
if (!(key in destination)) {
|
|
1860
|
+
continue;
|
|
1861
|
+
}
|
|
1862
|
+
const destinationValue = destination[key];
|
|
1863
|
+
if (!isRecord(destinationValue)) {
|
|
1864
|
+
continue;
|
|
1865
|
+
}
|
|
1866
|
+
const sourceValue = source[key];
|
|
1867
|
+
if (!isRecord(sourceValue)) {
|
|
1868
|
+
continue;
|
|
1869
|
+
}
|
|
1870
|
+
output[key] = mergeDeepImplementation(destinationValue, sourceValue);
|
|
1871
|
+
}
|
|
1872
|
+
return output;
|
|
1873
|
+
}
|
|
1874
|
+
function isRecord(object) {
|
|
1875
|
+
return typeof object === "object" && object !== null && Object.getPrototypeOf(object) === Object.prototype;
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1755
1878
|
// src/object/omit.ts
|
|
1756
1879
|
function omit(...args) {
|
|
1757
1880
|
return purry(_omit, args);
|
|
@@ -2029,6 +2152,7 @@ export {
|
|
|
2029
2152
|
concat,
|
|
2030
2153
|
countBy,
|
|
2031
2154
|
createPipe,
|
|
2155
|
+
debounce,
|
|
2032
2156
|
difference,
|
|
2033
2157
|
differenceWith,
|
|
2034
2158
|
drop,
|
|
@@ -2083,6 +2207,7 @@ export {
|
|
|
2083
2207
|
meanBy,
|
|
2084
2208
|
merge,
|
|
2085
2209
|
mergeAll,
|
|
2210
|
+
mergeDeep,
|
|
2086
2211
|
minBy,
|
|
2087
2212
|
noop,
|
|
2088
2213
|
omit,
|
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var nt={TAB:"Tab",ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ENTER:"Enter",ESC:"Escape",SPACE:"Space",SHIFT:"Shift",KEY_F:"KEY_F",CTRL:"Control",ALT:"Alt",META:"Meta",AT:"@",DELETE:"Delete",BACKSPACE:"Backspace",HOME:"Home",END:"End",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"};function on(n,...t){let e=n;const r=t.map(i=>{const{lazy:f,lazyArgs:c}=i;if(f){const s=f(...c||[]);return s.indexed=f.indexed,s.single=f.single,s.index=0,s.items=[],s}return null});let u=0;for(;u<t.length;){const i=t[u];if(!r[u]){e=i(e),u++;continue}const c=[];for(let l=u;l<t.length&&r[l];l++)if(c.push(r[l]),r[l].single)break;const s=[];for(const l of e)if(fn({item:l,acc:s,lazySeq:c}))break;c[c.length-1].single?e=s[0]:e=s,u+=c.length}return e}function fn({item:n,lazySeq:t,acc:e}){if(t.length===0)return e.push(n),!1;let r={done:!1,hasNext:!1},u=!1;for(let i=0;i<t.length;i++){const f=t[i],c=f.indexed,s=f.index,a=f.items;if(a.push(n),r=c?f(n,s,a):f(n),f.index++,r.hasNext)if(r.hasMany){const l=r.next;for(const N of l)if(fn({item:N,acc:e,lazySeq:t.slice(i+1)}))return!0;return!1}else n=r.next;if(!r.hasNext)break;r.done&&(u=!0)}return r.hasNext&&e.push(n),!!u}function tt(...n){return t=>on(t,...n)}function et(n){return n}function rt(){}function ut(n){let t=!1,e;return()=>(t||(e=n(),t=!0),e)}function o(n,t,e){const r=n.length-t.length,u=Array.from(t);if(r===0)return n(...u);if(r===1){const i=f=>n(f,...u);return(e||n.lazy)&&(i.lazy=e||n.lazy,i.lazyArgs=t),i}throw new Error("Wrong number of arguments")}function it(n){return new Promise(t=>{setTimeout(t,n)})}function ot(...n){return o(ft,n)}function ft(n,t){return t.every(e=>e(n))}function ct(...n){return o(st,n)}function st(n,t){return t.some(e=>e(n))}function lt(...n){return o(at,n)}function at(n,t){const e=Array.from({length:Math.ceil(n.length/t)});for(let r=0;r<e.length;r+=1)e[r]=n.slice(r*t,(r+1)*t);return e}function cn(n){return Array.isArray(n)}function dt(n){return typeof n=="boolean"}function ht(n){return n instanceof Date}function D(n){return typeof n<"u"&&n!==null}(n=>{function t(e){return e!==void 0}n.strict=t})(D||(D={}));function yt(n){return Object.prototype.toString.call(n)}function sn(n){return yt(n)==="[object Object]"}function j(n){return typeof n=="string"}function xt(n){if(cn(n)||j(n))return n.length===0;if(sn(n)){for(const t in n)return!1;return!(n instanceof RegExp)}return!1}function pt(n){return n instanceof Error}function zt(n){return typeof n=="function"}function gt(n){return n==null}function _t(n){return n!==null}function Nt(n){return t=>!n(t)}function At(n){return typeof n=="number"&&!Number.isNaN(n)}function mt(n){return n instanceof Promise}function ln(n){return!!n}function Et(n){return n.filter(ln)}function Ot(...n){return o(wt,n)}function wt(n,t){return n.concat(t)}function an(n){return(t,e)=>t.reduce((r,u,i)=>{const f=n?e(u,i,t):e(u);return r+(f?1:0)},0)}function W(...n){return o(an(!1),n)}(n=>{function t(...e){return o(an(!0),e)}n.indexed=t})(W||(W={}));function d(n,t,e){const r=[];for(let u=0;u<n.length;u++){const i=n[u],f=e?t(i,u,n):t(i);f.hasMany===!0?r.push(...f.next):f.hasNext&&r.push(f.next)}return r}function A(...n){return o(It,n,A.lazy)}function It(n,t,e){const r=A.lazy(t,e);return d(n,r)}(n=>{function t(e,r){return u=>e.every(i=>!r(u,i))?{done:!1,hasNext:!0,next:u}:{done:!1,hasNext:!1}}n.lazy=t})(A||(A={}));function m(...n){return o(Bt,n,m.lazy)}function Bt(n,t){const e=m.lazy(t);return d(n,e)}(n=>{function t(e){const r=new Set(e);return u=>r.has(u)?{done:!1,hasNext:!1}:{done:!1,hasNext:!0,next:u}}n.lazy=t})(m||(m={}));function Pt(...n){return o(St,n)}function St(n,t){const e=[...n];return t>0&&e.splice(-t),e}function E(...n){return o(Mt,n,E.lazy)}function Mt(n,t){return d(n,E.lazy(t))}(n=>{function t(e){let r=e;return u=>r>0?(r--,{done:!1,hasNext:!1}):{done:!1,hasNext:!0,next:u}}n.lazy=t})(E||(E={}));function h(n){return n.indexed=!0,n}function y(...n){return o(dn(!1),n,y.lazy)}function dn(n){return(t,e)=>d(t,n?y.lazyIndexed(e):y.lazy(e),n)}function hn(n){return t=>(e,r,u)=>(n?t(e,r,u):t(e))?{done:!1,hasNext:!0,next:e}:{done:!1,hasNext:!1}}(n=>{function t(...e){return o(dn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=hn(!1),n.lazyIndexed=h(hn(!0))})(y||(y={}));function S(n){return n.single=!0,n}function M(...n){return o(yn(!1),n,M.lazy)}function yn(n){return(t,e)=>n?t.findIndex(e):t.findIndex(r=>e(r))}function xn(n){return t=>{let e=0;return(r,u,i)=>(n?t(r,u,i):t(r))?{done:!0,hasNext:!0,next:e}:(e++,{done:!1,hasNext:!1})}}(n=>{function t(...e){return o(yn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=S(xn(!1)),n.lazyIndexed=S(h(xn(!0)))})(M||(M={}));function b(...n){return o(pn(!1),n)}function pn(n){return(t,e)=>{for(let r=t.length-1;r>=0;r--)if(n?e(t[r],r,t):e(t[r]))return r;return-1}}(n=>{function t(...e){return o(pn(!0),e)}n.indexed=t})(b||(b={}));function U(...n){return o(zn(!1),n)}function zn(n){return(t,e)=>{for(let r=t.length-1;r>=0;r--)if(n?e(t[r],r,t):e(t[r]))return t[r]}}(n=>{function t(...e){return o(zn(!0),e)}n.indexed=t})(U||(U={}));function L(...n){return o(gn(!1),n,L.lazy)}function gn(n){return(t,e)=>n?t.find(e):t.find(r=>e(r))}function _n(n){return t=>(e,r,u)=>{const i=n?t(e,r,u):t(e);return{done:i,hasNext:i,next:e}}}(n=>{function t(...e){return o(gn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=S(_n(!1)),n.lazyIndexed=S(h(_n(!0)))})(L||(L={}));function C(...n){return o(Lt,n,C.lazy)}function Lt([n]){return n}(n=>{function t(){return e=>({done:!0,hasNext:!0,next:e})}n.lazy=t,(e=>{e.single=!0})(t=n.lazy||(n.lazy={}))})(C||(C={}));function v(...n){return o(Nn(!1),n)}function Nn(n){return(t,e)=>t.reduce((r,u,i)=>((n?e(u,i,t):e(u)).forEach(([c,s])=>{r[c]=s}),r),{})}(n=>{function t(...e){return o(Nn(!0),e)}n.indexed=t})(v||(v={}));function x(...n){return o(Ct,n,x.lazy)}function Ct(n){return d(n,x.lazy())}(n=>{function t(){return e=>Array.isArray(e)?{done:!1,hasNext:!0,hasMany:!0,next:e}:{done:!1,hasNext:!0,next:e}}n.lazy=t})(x||(x={}));function T(...n){return o(Tt,n,T.lazy)}function Tt(n,t){return x(n.map(e=>t(e)))}(n=>{function t(e){return r=>{const u=e(r);return Array.isArray(u)?{done:!1,hasNext:!0,hasMany:!0,next:u}:{done:!1,hasNext:!0,next:u}}}n.lazy=t})(T||(T={}));function p(...n){return o(kt,n,p.lazy)}function kt(n){return d(n,p.lazy())}function Rt(n){if(!Array.isArray(n))return n;const t=[];return n.forEach(e=>{Array.isArray(e)?t.push(...p(e)):t.push(e)}),t}(n=>{function t(){return e=>{const r=Rt(e);return Array.isArray(r)?{done:!1,hasNext:!0,hasMany:!0,next:r}:{done:!1,hasNext:!0,next:r}}}n.lazy=t})(p||(p={}));function z(...n){return o(An(!1),n,z.lazy)}function An(n){return(t,e)=>d(t,n?z.lazyIndexed(e):z.lazy(e),n)}function mn(n){return t=>(e,r,u)=>(n?t(e,r,u):t(e),{done:!1,hasNext:!0,next:e})}(n=>{function t(...e){return o(An(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=mn(!1),n.lazyIndexed=h(mn(!0))})(z||(z={}));function q(...n){return o(En(!1),n)}function En(n){return(t,e)=>{const r={};return t.forEach((u,i)=>{const f=n?e(u,i,t):e(u);if(f!==void 0){const c=String(f);r[c]||(r[c]=[]),r[c].push(u)}}),r}}(n=>{function t(...e){return o(En(!0),e)}n.indexed=t,n.strict=n})(q||(q={}));function F(...n){return o(On(!1),n)}function On(n){return(t,e)=>t.reduce((r,u,i)=>{const f=n?e(u,i,t):e(u),c=String(f);return r[c]=u,r},{})}(n=>{function t(...e){return o(On(!0),e)}n.indexed=t})(F||(F={}));function O(...n){return o(Dt,n,O.lazy)}function Dt(n,t){const e=O.lazy(t);return d(n,e)}(n=>{function t(e){return r=>new Set(e).has(r)?{done:!1,hasNext:!0,next:r}:{done:!1,hasNext:!1}}n.lazy=t})(O||(O={}));function w(...n){return o(jt,n,w.lazy)}function jt(n,t,e){const r=w.lazy(t,e);return d(n,r)}(n=>{function t(e,r){return u=>e.some(i=>r(u,i))?{done:!1,hasNext:!0,next:u}:{done:!1,hasNext:!1}}n.lazy=t})(w||(w={}));function Wt(...n){return o(bt,n)}function bt(n,t){return n.join(t)}function Ut(...n){return o(vt,n)}function vt(n){return n[n.length-1]}function qt(...n){return o(Ft,n)}function Ft(n){return"length"in n?n.length:Array.from(n).length}function g(...n){return o(wn(!1),n,g.lazy)}function wn(n){return(t,e)=>d(t,n?g.lazyIndexed(e):g.lazy(e),n)}function In(n){return t=>(e,r,u)=>({done:!1,hasNext:!0,next:n?t(e,r,u):t(e)})}(n=>{function t(...e){return o(wn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=In(!1),n.lazyIndexed=h(In(!0)),n.strict=n})(g||(g={}));function K(...n){return o(Bn(!1),n)}function Bn(n){return(t,e)=>t.reduce((r,u,i)=>{const[f,c]=n?e(u,i,t):e(u);return r[f]=c,r},{})}(n=>{function t(...e){return o(Bn(!0),e)}n.indexed=t})(K||(K={}));function Pn(n){return(t,e)=>{let r,u;return t.forEach((i,f)=>{const c=n?e(i,f,t):e(i);(u===void 0||c>u)&&(r=i,u=c)}),r}}function $(...n){return o(Pn(!1),n)}(n=>{function t(...e){return o(Pn(!0),e)}n.indexed=t})($||($={}));function Sn(n){return(t,e)=>{if(t.length===0)return Number.NaN;let r=0;return t.forEach((u,i)=>{r+=n?e(u,i,t):e(u)}),r/t.length}}function G(...n){return o(Sn(!1),n)}(n=>{function t(...e){return o(Sn(!0),e)}n.indexed=t})(G||(G={}));function Kt(n){return n.reduce((t,e)=>({...t,...e}),{})}function Mn(n){return(t,e)=>{let r,u;return t.forEach((i,f)=>{const c=n?e(i,f,t):e(i);(u===void 0||c<u)&&(r=i,u=c)}),r}}function H(...n){return o(Mn(!1),n)}(n=>{function t(...e){return o(Mn(!0),e)}n.indexed=t})(H||(H={}));function Y(...n){return o(Ln(!1),n)}function Ln(n){return(t,e)=>{const r=[[],[]];return t.forEach((u,i)=>{const f=n?e(u,i,t):e(u);r[f?0:1].push(u)}),r}}(n=>{function t(...e){return o(Ln(!0),e)}n.indexed=t})(Y||(Y={}));function Cn(...n){return o($t,n)}function $t(n,t){const e=[];for(let r=n;r<t;r++)e.push(r);return e}function J(...n){return o(Tn(!1),n)}function Tn(n){return(t,e,r)=>t.reduce((u,i,f)=>n?e(u,i,f,t):e(u,i),r)}(n=>{function t(...e){return o(Tn(!0),e)}n.indexed=t})(J||(J={}));function _(...n){return o(kn(!1),n,_.lazy)}function kn(n){return(t,e)=>d(t,n?_.lazyIndexed(e):_.lazy(e),n)}function Rn(n){return t=>(e,r,u)=>(n?t(e,r,u):t(e))?{done:!1,hasNext:!1}:{done:!1,hasNext:!0,next:e}}(n=>{function t(...e){return o(kn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=Rn(!1),n.lazyIndexed=h(Rn(!0))})(_||(_={}));function Gt(...n){return o(Ht,n)}function Ht(n){return n.slice().reverse()}function Yt(...n){return o(Jt,n)}function Jt(n,t){if(t<0)throw new RangeError(`sampleSize must cannot be negative: ${t}`);if(!Number.isInteger(t))throw new TypeError(`sampleSize must be an integer: ${t}`);if(t>=n.length)return n;if(t===0)return[];const e=Math.min(t,n.length-t),r=new Set;for(;r.size<e;){const u=Math.floor(Math.random()*n.length);r.add(u)}return t===e?Array.from(r).sort((u,i)=>u-i).map(u=>n[u]):n.filter((u,i)=>!r.has(i))}function Qt(...n){return o(Vt,n)}function Vt(n){const t=n.slice();for(let e=0;e<n.length;e+=1){const r=e+Math.floor(Math.random()*(n.length-e)),u=t[r];t[r]=t[e],t[e]=u}return t}function Q(...n){return o(Xt,n)}function Xt(n,t){const e=[...n];return e.sort(t),e}(n=>{n.strict=n})(Q||(Q={}));var Zt=["asc","desc"],ne={asc:(n,t)=>n>t,desc:(n,t)=>n<t};function V(n,...t){const e=te(n)?[[n,...t]]:[n,t];return o(ee,e)}function te(n){if(typeof n=="function")return!0;const[t,e,...r]=n;return r.length>0?!1:typeof t=="function"&&Zt.includes(e)}function ee(n,t){return[...n].sort(Dn(...t))}function Dn(n,t,...e){const r=typeof n=="function"?n:n[0],u=typeof n=="function"?"asc":n[1],i=ne[u],f=t===void 0?void 0:Dn(t,...e);return(c,s)=>{const a=r(c),l=r(s);return i(a,l)?1:i(l,a)?-1:f?.(c,s)??0}}(n=>{n.strict=n})(V||(V={}));function jn(...n){return o(re,n)}function re(n,t){const e=[...n],r=e.splice(t);return[e,r]}function ue(...n){return o(ie,n)}function ie(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return jn(n,e);return[n,[]]}function Wn(n){return(t,e)=>{let r=0;return t.forEach((u,i)=>{const f=n?e(u,i,t):e(u);r+=f}),r}}function X(...n){return o(Wn(!1),n)}(n=>{function t(...e){return o(Wn(!0),e)}n.indexed=t})(X||(X={}));function oe(...n){return o(fe,n)}function fe(n,t,e){return typeof n=="string"?ce(n,t,e):bn(n,t,e)}function bn(n,t,e){const r=n.slice();if(Number.isNaN(t)||Number.isNaN(e))return r;const u=t<0?n.length+t:t,i=e<0?n.length+e:e;return u<0||u>n.length||i<0||i>n.length||(r[u]=n[i],r[i]=n[u]),r}function ce(n,t,e){return bn(n.split(""),t,e).join("")}function I(...n){return o(se,n,I.lazy)}function se(n,t){return d(n,I.lazy(t))}(n=>{function t(e){return r=>e===0?{done:!0,hasNext:!1}:(e--,e===0?{done:!0,hasNext:!0,next:r}:{done:!1,hasNext:!0,next:r})}n.lazy=t})(I||(I={}));function le(...n){return o(ae,n)}function ae(n,t){const e=[];for(const r of n){if(!t(r))break;e.push(r)}return e}function B(...n){return o(de,n,B.lazy)}function de(n){return d(n,B.lazy())}(n=>{function t(){const e=new Set;return r=>e.has(r)?{done:!1,hasNext:!1}:(e.add(r),{done:!1,hasNext:!0,next:r})}n.lazy=t})(B||(B={}));function he(...n){return o(ye,n,Un)}function ye(n,t){return d(n,Un(t))}function Un(n){const t=new Set;return e=>{const r=n(e);return t.has(r)?{done:!1,hasNext:!1}:(t.add(r),{done:!1,hasNext:!0,next:e})}}function P(...n){return o(xe,n,P.lazy)}function xe(n,t){const e=P.lazy(t);return d(n,e,!0)}function pe(n){return(t,e,r)=>r&&r.findIndex(u=>n(t,u))===e?{done:!1,hasNext:!0,next:t}:{done:!1,hasNext:!1}}(n=>{n.lazy=h(pe)})(P||(P={}));function ze(...n){return o(ge,n)}function ge(n,t){const e=n.length>t.length?t.length:n.length,r=[];for(let u=0;u<e;u++)r.push([n[u],t[u]]);return r}function _e(...n){return o(Ne,n)}function Ne(n,t){const e=n.length>t.length?t.length:n.length,r={};for(let u=0;u<e;u++)r[n[u]]=t[u];return r}function Ae(...n){if(typeof n[0]=="function"&&n.length===1)return function(t,e){return Z(t,e,n[0])};if(typeof n[0]=="function"&&n.length===2)return function(t){return Z(t,n[1],n[0])};if(n.length===3)return Z(n[0],n[1],n[2])}function Z(n,t,e){const r=n.length>t.length?t.length:n.length,u=[];for(let i=0;i<r;i++)u.push(e(n[i],t[i]));return u}function me(...n){return o(Ee,n)}function Ee(n,t){return t.min!=null&&t.min>n?t.min:t.max!=null&&t.max<n?t.max:n}function Oe(...n){return o(we,n)}function we(n,t,e){return{...n,[t]:e}}function vn(n){return n===null?"Null":n===void 0?"Undefined":Object.prototype.toString.call(n).slice(8,-1)}function Ie(n){return new RegExp(n.source,(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.sticky?"y":"")+(n.unicode?"u":""))}function qn(n,t,e,r){function u(i){const f=t.length;let c=0;for(;c<f;){if(n===t[c])return e[c];c+=1}t[c+1]=n,e[c+1]=i;for(const s in n)i[s]=r?qn(n[s],t,e,!0):n[s];return i}switch(vn(n)){case"Object":return u({});case"Array":return u([]);case"Date":return new Date(n.valueOf());case"RegExp":return Ie(n);default:return n}}function Be(n){return n!=null&&typeof n.clone=="function"?n.clone():qn(n,[],[],!0)}var Fn=Array.isArray,Kn=Object.keys;function nn(...n){return o(Pe,n)}function Pe(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){const e=Fn(n),r=Fn(t);let u,i,f;if(e&&r){if(i=n.length,i!==t.length)return!1;for(u=i;u--!==0;)if(!nn(n[u],t[u]))return!1;return!0}if(e!==r)return!1;const c=n instanceof Date,s=t instanceof Date;if(c!==s)return!1;if(c&&s)return n.getTime()===t.getTime();const a=n instanceof RegExp,l=t instanceof RegExp;if(a!==l)return!1;if(a&&l)return n.toString()===t.toString();const N=Kn(n);if(i=N.length,i!==Kn(t).length)return!1;for(u=i;u--!==0;)if(!Object.prototype.hasOwnProperty.call(t,N[u]))return!1;for(u=i;u--!==0;)if(f=N[u],!nn(n[f],t[f]))return!1;return!0}return n!==n&&t!==t}function tn(...n){return o($n(!1),n)}function $n(n){return(t,e)=>{for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const u=t[r];n?e(u,r,t):e(u)}return t}}(n=>{function t(...e){return o($n(!0),e)}n.indexed=t})(tn||(tn={}));function k(n){const t={};for(const[e,r]of n)t[e]=r;return t}(n=>{n.strict=n})(k||(k={}));function Se(...n){return o(Me,n)}function Me(n){const t={};for(const e in n)t[n[e]]=e;return t}function en(n){return Object.keys(n)}(n=>{n.strict=n})(en||(en={}));function Le(n,t){return arguments.length===1?e=>Gn(e,n):Gn(n,t)}function Gn(n,t){return Object.keys(n).reduce((e,r)=>(e[t(r,n[r])]=n[r],e),{})}function Ce(n,t){return arguments.length===1?e=>Hn(e,n):Hn(n,t)}function Hn(n,t){return Object.keys(n).reduce((e,r)=>(e[r]=t(n[r],r),e),{})}function Te(...n){return o(ke,n)}function ke(n,t){return Object.assign({},n,t)}function Re(...n){return o(De,n)}function De(n,t){if(t.length===0)return{...n};if(t.length===1){const[r]=t,{[r]:u,...i}=n;return i}if(!t.some(r=>r in n))return{...n};const e=new Set(t);return k(Object.entries(n).filter(([r])=>!e.has(r)))}function je(...n){return o(We,n)}function We(n,t){return Object.keys(n).reduce((e,r)=>(t(n[r],r)||(e[r]=n[r]),e),{})}function be(...n){return o(Ue,n)}function Ue(n,t,e){let r=n;for(const u of t){if(r==null||r[u]==null)return e;r=r[u]}return r}function ve(...n){return o(qe,n)}function qe(n,t){return n==null?{}:t.reduce((e,r)=>(r in n&&(e[r]=n[r]),e),{})}function Fe(...n){return o(Ke,n)}function Ke(n,t){return n==null?{}:Object.keys(n).reduce((e,r)=>(t(n[r],r)&&(e[r]=n[r]),e),{})}function $e(n){return({[n]:t})=>t}function Ge(...n){return o(He,n)}function He(n,t,e){return{...n,[t]:e}}function Ye(...n){return o(R,n)}function R(n,t,e){return t.length===0?e:Array.isArray(n)?n.map((r,u)=>u===t[0]?R(r,t.slice(1),e):r):{...n,[t[0]]:R(n[t[0]],t.slice(1),e)}}function Je(...n){return o(Qe,n)}function Qe(n,t,e){const{[t]:r,[e]:u}=n;return{...n,[t]:u,[e]:r}}function rn(n){return Object.entries(n)}(n=>{function t(e){return Object.entries(e)}n.strict=t})(rn||(rn={}));function Ve(n){return Object.values(n)}var Xe=/\d/,Ze=["-","_","/","."];function Yn(n=""){if(!Xe.test(n))return n.toUpperCase()===n}function un(n,t){const e=t??Ze,r=[];if(!n||!j(n))return r;let u="",i,f;for(const c of n){const s=e.includes(c);if(s===!0){r.push(u),u="",i=void 0;continue}const a=Yn(c);if(f===!1){if(i===!1&&a===!0){r.push(u),u=c,i=a;continue}if(i===!0&&a===!1&&u.length>1){const l=u[u.length-1];r.push(u.slice(0,Math.max(0,u.length-1))),u=l+c,i=a;continue}}u+=c,i=a,f=s}return r.push(u),r}function Jn(n){return n?n[0].toUpperCase()+n.slice(1):""}function Qn(n){return n?n[0].toLowerCase()+n.slice(1):""}function Vn(n){return n?(Array.isArray(n)?n:un(n)).map(t=>Jn(t)).join(""):""}function nr(n){return Qn(Vn(n||""))}function Xn(n,t){return n?(Array.isArray(n)?n:un(n)).map(e=>e.toLowerCase()).join(t??"-"):""}function tr(n){return Xn(n||"","_")}function er(n,t=1e3){if(n<t)return`${n} B`;const e=t===1024?["Ki","Mi","Gi"]:["k","M","G"];let r=-1;for(;Math.abs(n)>=t&&r<e.length-1;)n/=t,++r;return`${n.toFixed(1)} ${e[r]}B`}function rr(n){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=()=>t[Math.floor(Math.random()*t.length)];return Cn(0,n).reduce(r=>r+e(),"")}function ur(n){return n.normalize("NFD").replace(/[\u0300-\u036F]/g,"").toLowerCase().replace(/[^a-z0-9]/g," ").trim().replace(/\s+/g,"-")}function ir(n){return Zn(n)}function Zn(n){if(n.length===0)return[];const t=n.match(/^\[(.+?)\](.*)$/)??n.match(/^\.?([^.[\]]+)(.*)$/);if(t){const[,e,r]=t;return[e,...Zn(r)]}return[n]}var or=typeof window<"u";export{nt as KEY_CODES,R as _setPath,Oe as addProp,ot as allPass,ct as anyPass,lt as chunk,me as clamp,Be as clone,Et as compact,Ot as concat,W as countBy,tt as createPipe,m as difference,A as differenceWith,E as drop,Pt as dropLast,nn as equals,y as filter,L as find,M as findIndex,U as findLast,b as findLastIndex,C as first,T as flatMap,v as flatMapToObj,x as flatten,p as flattenDeep,z as forEach,tn as forEachObj,k as fromPairs,q as groupBy,er as humanReadableFileSize,et as identity,F as indexBy,O as intersection,w as intersectionWith,Se as invert,cn as isArray,dt as isBoolean,or as isBrowser,ht as isDate,D as isDefined,xt as isEmpty,pt as isError,zt as isFunction,gt as isNil,_t as isNonNull,Nt as isNot,At as isNumber,sn as isObject,mt as isPromise,j as isString,ln as isTruthy,Yn as isUppercase,Wt as join,en as keys,Ut as last,qt as length,g as map,Le as mapKeys,K as mapToObj,Ce as mapValues,$ as maxBy,G as meanBy,Te as merge,Kt as mergeAll,H as minBy,rt as noop,Re as omit,je as omitBy,ut as once,Y as partition,be as pathOr,ve as pick,Fe as pickBy,on as pipe,$e as prop,o as purry,rr as randomString,Cn as range,J as reduce,_ as reject,Gt as reverse,Yt as sample,Ge as set,Ye as setPath,Qt as shuffle,it as sleep,ur as slugify,Q as sort,V as sortBy,jn as splitAt,un as splitByCase,ue as splitWhen,ir as stringToPath,X as sumBy,oe as swapIndices,Je as swapProps,I as take,le as takeWhile,nr as toCamelCase,Xn as toKebabCase,Qn as toLowerFirst,rn as toPairs,Vn as toPascalCase,tr as toSnakeCase,Jn as toUpperFirst,vn as type,B as uniq,he as uniqBy,P as uniqWith,Ve as values,ze as zip,_e as zipObj,Ae as zipWith};
|
|
1
|
+
"use strict";var ut={ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",AT:"@",BACKSPACE:"Backspace",CTRL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESC:"Escape",HOME:"Home",KEY_F:"KEY_F",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:"Space",TAB:"Tab"};function cn(n,...t){let e=n;const r=t.map(o=>{const{lazy:f,lazyArgs:c}=o;if(f){const s=f(...c||[]);return s.indexed=f.indexed,s.single=f.single,s.index=0,s.items=[],s}return null});let u=0;for(;u<t.length;){const o=t[u];if(!r[u]){e=o(e),u++;continue}const c=[];for(let l=u;l<t.length&&r[l];l++)if(c.push(r[l]),r[l].single)break;const s=[];for(const l of e)if(sn({acc:s,item:l,lazySeq:c}))break;c[c.length-1].single?e=s[0]:e=s,u+=c.length}return e}function sn({acc:n,item:t,lazySeq:e}){if(e.length===0)return n.push(t),!1;let r={done:!1,hasNext:!1},u=!1;for(let o=0;o<e.length;o++){const f=e[o],c=f.indexed,s=f.index,d=f.items;if(d.push(t),r=c?f(t,s,d):f(t),f.index++,r.hasNext)if(r.hasMany){const l=r.next;for(const a of l)if(sn({acc:n,item:a,lazySeq:e.slice(o+1)}))return!0;return!1}else t=r.next;if(!r.hasNext)break;r.done&&(u=!0)}return r.hasNext&&n.push(t),!!u}function ot(...n){return t=>cn(t,...n)}function it(n){return n}function ft(){}function ct(n){let t=!1,e;return()=>(t||(e=n(),t=!0),e)}function st(n,{maxWaitMs:t,timing:e="trailing",waitMs:r}){if(t!==void 0&&r!==void 0&&t<r)throw new Error(`debounce: maxWaitMs (${t}) cannot be less than waitMs (${r})`);let u,o,f,c;function s(a){f=a,t!==void 0&&o===void 0&&(o=setTimeout(d,t))}function d(){if(f===void 0)return;if(o!==void 0){const P=o;o=void 0,clearTimeout(P)}const a=f;f=void 0,c=n(...a)}function l(){if(u===void 0)return;const a=u;u=void 0,clearTimeout(a),f!==void 0&&d()}return{get cachedValue(){return c},call:(...a)=>{if(u===void 0)e==="trailing"?s(a):c=n(...a);else{e!=="leading"&&s(a);const P=u;u=void 0,clearTimeout(P)}return u=setTimeout(l,r??t??0),c},cancel:()=>{if(u!==void 0){const a=u;u=void 0,clearTimeout(a)}if(o!==void 0){const a=o;o=void 0,clearTimeout(a)}f=void 0},flush:()=>(l(),c),get isPending(){return u!==void 0}}}function i(n,t,e){const r=n.length-t.length,u=Array.from(t);if(r===0)return n(...u);if(r===1){const o=f=>n(f,...u);return(e||n.lazy)&&(o.lazy=e||n.lazy,o.lazyArgs=t),o}throw new Error("Wrong number of arguments")}function lt(n){return new Promise(t=>{setTimeout(t,n)})}function at(...n){return i(dt,n)}function dt(n,t){return t.every(e=>e(n))}function ht(...n){return i(yt,n)}function yt(n,t){return t.some(e=>e(n))}function pt(...n){return i(xt,n)}function xt(n,t){const e=Array.from({length:Math.ceil(n.length/t)});for(let r=0;r<e.length;r+=1)e[r]=n.slice(r*t,(r+1)*t);return e}function ln(n){return Array.isArray(n)}function gt(n){return typeof n=="boolean"}function zt(n){return n instanceof Date}function M(n){return typeof n<"u"&&n!==null}(n=>{function t(e){return e!==void 0}n.strict=t})(M||(M={}));function _t(n){return Object.prototype.toString.call(n)}function an(n){return _t(n)==="[object Object]"}function b(n){return typeof n=="string"}function mt(n){if(ln(n)||b(n))return n.length===0;if(an(n)){for(const t in n)return!1;return!(n instanceof RegExp)}return!1}function At(n){return n instanceof Error}function Nt(n){return typeof n=="function"}function Et(n){return n==null}function It(n){return n!==null}function Ot(n){return t=>!n(t)}function wt(n){return typeof n=="number"&&!Number.isNaN(n)}function Bt(n){return n instanceof Promise}function dn(n){return!!n}function Tt(n){return n.filter(dn)}function Pt(...n){return i(vt,n)}function vt(n,t){return n.concat(t)}function hn(n){return(t,e)=>t.reduce((r,u,o)=>{const f=n?e(u,o,t):e(u);return r+(f?1:0)},0)}function j(...n){return i(hn(!1),n)}(n=>{function t(...e){return i(hn(!0),e)}n.indexed=t})(j||(j={}));function h(n,t,e){const r=[];for(let u=0;u<n.length;u++){const o=n[u],f=e?t(o,u,n):t(o);f.hasMany===!0?r.push(...f.next):f.hasNext&&r.push(f.next)}return r}function A(...n){return i(St,n,A.lazy)}function St(n,t,e){const r=A.lazy(t,e);return h(n,r)}(n=>{function t(e,r){return u=>e.every(o=>!r(u,o))?{done:!1,hasNext:!0,next:u}:{done:!1,hasNext:!1}}n.lazy=t})(A||(A={}));function N(...n){return i(Ct,n,N.lazy)}function Ct(n,t){const e=N.lazy(t);return h(n,e)}(n=>{function t(e){const r=new Set(e);return u=>r.has(u)?{done:!1,hasNext:!1}:{done:!1,hasNext:!0,next:u}}n.lazy=t})(N||(N={}));function Dt(...n){return i(kt,n)}function kt(n,t){const e=[...n];return t>0&&e.splice(-t),e}function E(...n){return i(Lt,n,E.lazy)}function Lt(n,t){return h(n,E.lazy(t))}(n=>{function t(e){let r=e;return u=>r>0?(r--,{done:!1,hasNext:!1}):{done:!1,hasNext:!0,next:u}}n.lazy=t})(E||(E={}));function y(n){return n.indexed=!0,n}function p(...n){return i(yn(!1),n,p.lazy)}function yn(n){return(t,e)=>h(t,n?p.lazyIndexed(e):p.lazy(e),n)}function pn(n){return t=>(e,r,u)=>(n?t(e,r,u):t(e))?{done:!1,hasNext:!0,next:e}:{done:!1,hasNext:!1}}(n=>{function t(...e){return i(yn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=pn(!1),n.lazyIndexed=y(pn(!0))})(p||(p={}));function v(n){return n.single=!0,n}function S(...n){return i(xn(!1),n,S.lazy)}function xn(n){return(t,e)=>n?t.findIndex(e):t.findIndex(r=>e(r))}function gn(n){return t=>{let e=0;return(r,u,o)=>(n?t(r,u,o):t(r))?{done:!0,hasNext:!0,next:e}:(e++,{done:!1,hasNext:!1})}}(n=>{function t(...e){return i(xn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=v(gn(!1)),n.lazyIndexed=v(y(gn(!0)))})(S||(S={}));function W(...n){return i(zn(!1),n)}function zn(n){return(t,e)=>{for(let r=t.length-1;r>=0;r--)if(n?e(t[r],r,t):e(t[r]))return r;return-1}}(n=>{function t(...e){return i(zn(!0),e)}n.indexed=t})(W||(W={}));function U(...n){return i(_n(!1),n)}function _n(n){return(t,e)=>{for(let r=t.length-1;r>=0;r--)if(n?e(t[r],r,t):e(t[r]))return t[r]}}(n=>{function t(...e){return i(_n(!0),e)}n.indexed=t})(U||(U={}));function C(...n){return i(mn(!1),n,C.lazy)}function mn(n){return(t,e)=>n?t.find(e):t.find(r=>e(r))}function An(n){return t=>(e,r,u)=>{const o=n?t(e,r,u):t(e);return{done:o,hasNext:o,next:e}}}(n=>{function t(...e){return i(mn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=v(An(!1)),n.lazyIndexed=v(y(An(!0)))})(C||(C={}));function D(...n){return i(Rt,n,D.lazy)}function Rt([n]){return n}(n=>{function t(){return e=>({done:!0,hasNext:!0,next:e})}n.lazy=t,(e=>{e.single=!0})(t=n.lazy||(n.lazy={}))})(D||(D={}));function q(...n){return i(Nn(!1),n)}function Nn(n){return(t,e)=>t.reduce((r,u,o)=>((n?e(u,o,t):e(u)).forEach(([c,s])=>{r[c]=s}),r),{})}(n=>{function t(...e){return i(Nn(!0),e)}n.indexed=t})(q||(q={}));function x(...n){return i(Mt,n,x.lazy)}function Mt(n){return h(n,x.lazy())}(n=>{function t(){return e=>Array.isArray(e)?{done:!1,hasMany:!0,hasNext:!0,next:e}:{done:!1,hasNext:!0,next:e}}n.lazy=t})(x||(x={}));function k(...n){return i(bt,n,k.lazy)}function bt(n,t){return x(n.map(e=>t(e)))}(n=>{function t(e){return r=>{const u=e(r);return Array.isArray(u)?{done:!1,hasMany:!0,hasNext:!0,next:u}:{done:!1,hasNext:!0,next:u}}}n.lazy=t})(k||(k={}));function g(...n){return i(jt,n,g.lazy)}function jt(n){return h(n,g.lazy())}function Wt(n){if(!Array.isArray(n))return n;const t=[];return n.forEach(e=>{Array.isArray(e)?t.push(...g(e)):t.push(e)}),t}(n=>{function t(){return e=>{const r=Wt(e);return Array.isArray(r)?{done:!1,hasMany:!0,hasNext:!0,next:r}:{done:!1,hasNext:!0,next:r}}}n.lazy=t})(g||(g={}));function z(...n){return i(En(!1),n,z.lazy)}function En(n){return(t,e)=>h(t,n?z.lazyIndexed(e):z.lazy(e),n)}function In(n){return t=>(e,r,u)=>(n?t(e,r,u):t(e),{done:!1,hasNext:!0,next:e})}(n=>{function t(...e){return i(En(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=In(!1),n.lazyIndexed=y(In(!0))})(z||(z={}));function F(...n){return i(On(!1),n)}function On(n){return(t,e)=>{const r={};return t.forEach((u,o)=>{const f=n?e(u,o,t):e(u);if(f!==void 0){const c=String(f);r[c]||(r[c]=[]),r[c].push(u)}}),r}}(n=>{function t(...e){return i(On(!0),e)}n.indexed=t,n.strict=n})(F||(F={}));function K(...n){return i(wn(!1),n)}function wn(n){return(t,e)=>t.reduce((r,u,o)=>{const f=n?e(u,o,t):e(u),c=String(f);return r[c]=u,r},{})}(n=>{function t(...e){return i(wn(!0),e)}n.indexed=t})(K||(K={}));function I(...n){return i(Ut,n,I.lazy)}function Ut(n,t){const e=I.lazy(t);return h(n,e)}(n=>{function t(e){return r=>new Set(e).has(r)?{done:!1,hasNext:!0,next:r}:{done:!1,hasNext:!1}}n.lazy=t})(I||(I={}));function O(...n){return i(qt,n,O.lazy)}function qt(n,t,e){const r=O.lazy(t,e);return h(n,r)}(n=>{function t(e,r){return u=>e.some(o=>r(u,o))?{done:!1,hasNext:!0,next:u}:{done:!1,hasNext:!1}}n.lazy=t})(O||(O={}));function Ft(...n){return i(Kt,n)}function Kt(n,t){return n.join(t)}function $t(...n){return i(Gt,n)}function Gt(n){return n[n.length-1]}function Ht(...n){return i(Vt,n)}function Vt(n){return"length"in n?n.length:Array.from(n).length}function _(...n){return i(Bn(!1),n,_.lazy)}function Bn(n){return(t,e)=>h(t,n?_.lazyIndexed(e):_.lazy(e),n)}function Tn(n){return t=>(e,r,u)=>({done:!1,hasNext:!0,next:n?t(e,r,u):t(e)})}(n=>{function t(...e){return i(Bn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=Tn(!1),n.lazyIndexed=y(Tn(!0)),n.strict=n})(_||(_={}));function $(...n){return i(Pn(!1),n)}function Pn(n){return(t,e)=>t.reduce((r,u,o)=>{const[f,c]=n?e(u,o,t):e(u);return r[f]=c,r},{})}(n=>{function t(...e){return i(Pn(!0),e)}n.indexed=t})($||($={}));function vn(n){return(t,e)=>{let r,u;return t.forEach((o,f)=>{const c=n?e(o,f,t):e(o);(u===void 0||c>u)&&(r=o,u=c)}),r}}function G(...n){return i(vn(!1),n)}(n=>{function t(...e){return i(vn(!0),e)}n.indexed=t})(G||(G={}));function Sn(n){return(t,e)=>{if(t.length===0)return Number.NaN;let r=0;return t.forEach((u,o)=>{r+=n?e(u,o,t):e(u)}),r/t.length}}function H(...n){return i(Sn(!1),n)}(n=>{function t(...e){return i(Sn(!0),e)}n.indexed=t})(H||(H={}));function Yt(n){return n.reduce((t,e)=>({...t,...e}),{})}function Cn(n){return(t,e)=>{let r,u;return t.forEach((o,f)=>{const c=n?e(o,f,t):e(o);(u===void 0||c<u)&&(r=o,u=c)}),r}}function V(...n){return i(Cn(!1),n)}(n=>{function t(...e){return i(Cn(!0),e)}n.indexed=t})(V||(V={}));function Y(...n){return i(Dn(!1),n)}function Dn(n){return(t,e)=>{const r=[[],[]];return t.forEach((u,o)=>{const f=n?e(u,o,t):e(u);r[f?0:1].push(u)}),r}}(n=>{function t(...e){return i(Dn(!0),e)}n.indexed=t})(Y||(Y={}));function kn(...n){return i(Jt,n)}function Jt(n,t){const e=[];for(let r=n;r<t;r++)e.push(r);return e}function J(...n){return i(Ln(!1),n)}function Ln(n){return(t,e,r)=>t.reduce((u,o,f)=>n?e(u,o,f,t):e(u,o),r)}(n=>{function t(...e){return i(Ln(!0),e)}n.indexed=t})(J||(J={}));function m(...n){return i(Rn(!1),n,m.lazy)}function Rn(n){return(t,e)=>h(t,n?m.lazyIndexed(e):m.lazy(e),n)}function Mn(n){return t=>(e,r,u)=>(n?t(e,r,u):t(e))?{done:!1,hasNext:!1}:{done:!1,hasNext:!0,next:e}}(n=>{function t(...e){return i(Rn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=Mn(!1),n.lazyIndexed=y(Mn(!0))})(m||(m={}));function Qt(...n){return i(Xt,n)}function Xt(n){return n.slice().reverse()}function Zt(...n){return i(ne,n)}function ne(n,t){if(t<0)throw new RangeError(`sampleSize must cannot be negative: ${t}`);if(!Number.isInteger(t))throw new TypeError(`sampleSize must be an integer: ${t}`);if(t>=n.length)return n;if(t===0)return[];const e=Math.min(t,n.length-t),r=new Set;for(;r.size<e;){const u=Math.floor(Math.random()*n.length);r.add(u)}return t===e?Array.from(r).sort((u,o)=>u-o).map(u=>n[u]):n.filter((u,o)=>!r.has(o))}function te(...n){return i(ee,n)}function ee(n){const t=n.slice();for(let e=0;e<n.length;e+=1){const r=e+Math.floor(Math.random()*(n.length-e)),u=t[r];t[r]=t[e],t[e]=u}return t}function Q(...n){return i(re,n)}function re(n,t){const e=[...n];return e.sort(t),e}(n=>{n.strict=n})(Q||(Q={}));var ue=["asc","desc"],oe={asc:(n,t)=>n>t,desc:(n,t)=>n<t};function X(n,...t){const e=ie(n)?[[n,...t]]:[n,t];return i(fe,e)}function ie(n){if(typeof n=="function")return!0;const[t,e,...r]=n;return r.length>0?!1:typeof t=="function"&&ue.includes(e)}function fe(n,t){return[...n].sort(bn(...t))}function bn(n,t,...e){const r=typeof n=="function"?n:n[0],u=typeof n=="function"?"asc":n[1],o=oe[u],f=t===void 0?void 0:bn(t,...e);return(c,s)=>{const d=r(c),l=r(s);return o(d,l)?1:o(l,d)?-1:f?.(c,s)??0}}(n=>{n.strict=n})(X||(X={}));function jn(...n){return i(ce,n)}function ce(n,t){const e=[...n],r=e.splice(t);return[e,r]}function se(...n){return i(le,n)}function le(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return jn(n,e);return[n,[]]}function Wn(n){return(t,e)=>{let r=0;return t.forEach((u,o)=>{const f=n?e(u,o,t):e(u);r+=f}),r}}function Z(...n){return i(Wn(!1),n)}(n=>{function t(...e){return i(Wn(!0),e)}n.indexed=t})(Z||(Z={}));function ae(...n){return i(de,n)}function de(n,t,e){return typeof n=="string"?he(n,t,e):Un(n,t,e)}function Un(n,t,e){const r=n.slice();if(Number.isNaN(t)||Number.isNaN(e))return r;const u=t<0?n.length+t:t,o=e<0?n.length+e:e;return u<0||u>n.length||o<0||o>n.length||(r[u]=n[o],r[o]=n[u]),r}function he(n,t,e){return Un(n.split(""),t,e).join("")}function w(...n){return i(ye,n,w.lazy)}function ye(n,t){return h(n,w.lazy(t))}(n=>{function t(e){return r=>e===0?{done:!0,hasNext:!1}:(e--,e===0?{done:!0,hasNext:!0,next:r}:{done:!1,hasNext:!0,next:r})}n.lazy=t})(w||(w={}));function pe(...n){return i(xe,n)}function xe(n,t){const e=[];for(const r of n){if(!t(r))break;e.push(r)}return e}function B(...n){return i(ge,n,B.lazy)}function ge(n){return h(n,B.lazy())}(n=>{function t(){const e=new Set;return r=>e.has(r)?{done:!1,hasNext:!1}:(e.add(r),{done:!1,hasNext:!0,next:r})}n.lazy=t})(B||(B={}));function ze(...n){return i(_e,n,qn)}function _e(n,t){return h(n,qn(t))}function qn(n){const t=new Set;return e=>{const r=n(e);return t.has(r)?{done:!1,hasNext:!1}:(t.add(r),{done:!1,hasNext:!0,next:e})}}function T(...n){return i(me,n,T.lazy)}function me(n,t){const e=T.lazy(t);return h(n,e,!0)}function Ae(n){return(t,e,r)=>r&&r.findIndex(u=>n(t,u))===e?{done:!1,hasNext:!0,next:t}:{done:!1,hasNext:!1}}(n=>{n.lazy=y(Ae)})(T||(T={}));function nn(...n){return i(Ne,n)}function Ne(n,t){const e=n.length>t.length?t.length:n.length,r=[];for(let u=0;u<e;u++)r.push([n[u],t[u]]);return r}(n=>{n.strict=n})(nn||(nn={}));function Ee(...n){return i(Ie,n)}function Ie(n,t){const e=n.length>t.length?t.length:n.length,r={};for(let u=0;u<e;u++)r[n[u]]=t[u];return r}function Oe(...n){if(typeof n[0]=="function"&&n.length===1)return function(t,e){return tn(t,e,n[0])};if(typeof n[0]=="function"&&n.length===2)return function(t){return tn(t,n[1],n[0])};if(n.length===3)return tn(n[0],n[1],n[2])}function tn(n,t,e){const r=n.length>t.length?t.length:n.length,u=[];for(let o=0;o<r;o++)u.push(e(n[o],t[o]));return u}function we(...n){return i(Be,n)}function Be(n,t){return t.min!=null&&t.min>n?t.min:t.max!=null&&t.max<n?t.max:n}function Te(...n){return i(Pe,n)}function Pe(n,t,e){return{...n,[t]:e}}function Fn(n){return n===null?"Null":n===void 0?"Undefined":Object.prototype.toString.call(n).slice(8,-1)}function ve(n){return new RegExp(n.source,(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.sticky?"y":"")+(n.unicode?"u":""))}function Kn(n,t,e,r){function u(o){const f=t.length;let c=0;for(;c<f;){if(n===t[c])return e[c];c+=1}t[c+1]=n,e[c+1]=o;for(const s in n)o[s]=r?Kn(n[s],t,e,!0):n[s];return o}switch(Fn(n)){case"Object":return u({});case"Array":return u([]);case"Date":return new Date(n.valueOf());case"RegExp":return ve(n);default:return n}}function Se(n){return n!=null&&typeof n.clone=="function"?n.clone():Kn(n,[],[],!0)}var $n=Array.isArray,Gn=Object.keys;function en(...n){return i(Ce,n)}function Ce(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){const e=$n(n),r=$n(t);let u,o,f;if(e&&r){if(o=n.length,o!==t.length)return!1;for(u=o;u--!==0;)if(!en(n[u],t[u]))return!1;return!0}if(e!==r)return!1;const c=n instanceof Date,s=t instanceof Date;if(c!==s)return!1;if(c&&s)return n.getTime()===t.getTime();const d=n instanceof RegExp,l=t instanceof RegExp;if(d!==l)return!1;if(d&&l)return n.toString()===t.toString();const a=Gn(n);if(o=a.length,o!==Gn(t).length)return!1;for(u=o;u--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[u]))return!1;for(u=o;u--!==0;)if(f=a[u],!en(n[f],t[f]))return!1;return!0}return n!==n&&t!==t}function rn(...n){return i(Hn(!1),n)}function Hn(n){return(t,e)=>{for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const u=t[r];n?e(u,r,t):e(u)}return t}}(n=>{function t(...e){return i(Hn(!0),e)}n.indexed=t})(rn||(rn={}));function L(n){const t={};for(const[e,r]of n)t[e]=r;return t}(n=>{n.strict=n})(L||(L={}));function De(...n){return i(ke,n)}function ke(n){const t={};for(const e in n)t[n[e]]=e;return t}function un(n){return Object.keys(n)}(n=>{n.strict=n})(un||(un={}));function Le(n,t){return arguments.length===1?e=>Vn(e,n):Vn(n,t)}function Vn(n,t){return Object.keys(n).reduce((e,r)=>(e[t(r,n[r])]=n[r],e),{})}function Re(n,t){return arguments.length===1?e=>Yn(e,n):Yn(n,t)}function Yn(n,t){return Object.keys(n).reduce((e,r)=>(e[r]=t(n[r],r),e),{})}function Me(...n){return i(be,n)}function be(n,t){return Object.assign({},n,t)}function je(...n){return i(Jn,n)}function Jn(n,t){const e={...n,...t};for(const r in t){if(!(r in n))continue;const u=n[r];if(!Qn(u))continue;const o=t[r];Qn(o)&&(e[r]=Jn(u,o))}return e}function Qn(n){return typeof n=="object"&&n!==null&&Object.getPrototypeOf(n)===Object.prototype}function We(...n){return i(Ue,n)}function Ue(n,t){if(t.length===0)return{...n};if(t.length===1){const[r]=t,{[r]:u,...o}=n;return o}if(!t.some(r=>r in n))return{...n};const e=new Set(t);return L(Object.entries(n).filter(([r])=>!e.has(r)))}function qe(...n){return i(Fe,n)}function Fe(n,t){return Object.keys(n).reduce((e,r)=>(t(n[r],r)||(e[r]=n[r]),e),{})}function Ke(...n){return i($e,n)}function $e(n,t,e){let r=n;for(const u of t){if(r==null||r[u]==null)return e;r=r[u]}return r}function Ge(...n){return i(He,n)}function He(n,t){return n==null?{}:t.reduce((e,r)=>(r in n&&(e[r]=n[r]),e),{})}function Ve(...n){return i(Ye,n)}function Ye(n,t){return n==null?{}:Object.keys(n).reduce((e,r)=>(t(n[r],r)&&(e[r]=n[r]),e),{})}function Je(n){return({[n]:t})=>t}function Qe(...n){return i(Xe,n)}function Xe(n,t,e){return{...n,[t]:e}}function Ze(...n){return i(R,n)}function R(n,t,e){return t.length===0?e:Array.isArray(n)?n.map((r,u)=>u===t[0]?R(r,t.slice(1),e):r):{...n,[t[0]]:R(n[t[0]],t.slice(1),e)}}function nr(...n){return i(tr,n)}function tr(n,t,e){const{[t]:r,[e]:u}=n;return{...n,[t]:u,[e]:r}}function on(n){return Object.entries(n)}(n=>{function t(e){return Object.entries(e)}n.strict=t})(on||(on={}));function er(n){return Object.values(n)}var rr=/\d/,ur=["-","_","/","."];function Xn(n=""){if(!rr.test(n))return n.toUpperCase()===n}function fn(n,t){const e=t??ur,r=[];if(!n||!b(n))return r;let u="",o,f;for(const c of n){const s=e.includes(c);if(s===!0){r.push(u),u="",o=void 0;continue}const d=Xn(c);if(f===!1){if(o===!1&&d===!0){r.push(u),u=c,o=d;continue}if(o===!0&&d===!1&&u.length>1){const l=u[u.length-1];r.push(u.slice(0,Math.max(0,u.length-1))),u=l+c,o=d;continue}}u+=c,o=d,f=s}return r.push(u),r}function Zn(n){return n?n[0].toUpperCase()+n.slice(1):""}function nt(n){return n?n[0].toLowerCase()+n.slice(1):""}function tt(n){return n?(Array.isArray(n)?n:fn(n)).map(t=>Zn(t)).join(""):""}function or(n){return nt(tt(n||""))}function et(n,t){return n?(Array.isArray(n)?n:fn(n)).map(e=>e.toLowerCase()).join(t??"-"):""}function ir(n){return et(n||"","_")}function fr(n,t=1e3){if(n<t)return`${n} B`;const e=t===1024?["Ki","Mi","Gi"]:["k","M","G"];let r=-1;for(;Math.abs(n)>=t&&r<e.length-1;)n/=t,++r;return`${n.toFixed(1)} ${e[r]}B`}function cr(n){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=()=>t[Math.floor(Math.random()*t.length)];return kn(0,n).reduce(r=>r+e(),"")}function sr(n){return n.normalize("NFD").replace(/[\u0300-\u036F]/g,"").toLowerCase().replace(/[^a-z0-9]/g," ").trim().replace(/\s+/g,"-")}function lr(n){return rt(n)}function rt(n){if(n.length===0)return[];const t=n.match(/^\[(.+?)\](.*)$/)??n.match(/^\.?([^.[\]]+)(.*)$/);if(t){const[,e,r]=t;return[e,...rt(r)]}return[n]}var ar=typeof window<"u";export{ut as KEY_CODES,R as _setPath,Te as addProp,at as allPass,ht as anyPass,pt as chunk,we as clamp,Se as clone,Tt as compact,Pt as concat,j as countBy,ot as createPipe,st as debounce,N as difference,A as differenceWith,E as drop,Dt as dropLast,en as equals,p as filter,C as find,S as findIndex,U as findLast,W as findLastIndex,D as first,k as flatMap,q as flatMapToObj,x as flatten,g as flattenDeep,z as forEach,rn as forEachObj,L as fromPairs,F as groupBy,fr as humanReadableFileSize,it as identity,K as indexBy,I as intersection,O as intersectionWith,De as invert,ln as isArray,gt as isBoolean,ar as isBrowser,zt as isDate,M as isDefined,mt as isEmpty,At as isError,Nt as isFunction,Et as isNil,It as isNonNull,Ot as isNot,wt as isNumber,an as isObject,Bt as isPromise,b as isString,dn as isTruthy,Xn as isUppercase,Ft as join,un as keys,$t as last,Ht as length,_ as map,Le as mapKeys,$ as mapToObj,Re as mapValues,G as maxBy,H as meanBy,Me as merge,Yt as mergeAll,je as mergeDeep,V as minBy,ft as noop,We as omit,qe as omitBy,ct as once,Y as partition,Ke as pathOr,Ge as pick,Ve as pickBy,cn as pipe,Je as prop,i as purry,cr as randomString,kn as range,J as reduce,m as reject,Qt as reverse,Zt as sample,Qe as set,Ze as setPath,te as shuffle,lt as sleep,sr as slugify,Q as sort,X as sortBy,jn as splitAt,fn as splitByCase,se as splitWhen,lr as stringToPath,Z as sumBy,ae as swapIndices,nr as swapProps,w as take,pe as takeWhile,or as toCamelCase,et as toKebabCase,nt as toLowerFirst,on as toPairs,tt as toPascalCase,ir as toSnakeCase,Zn as toUpperFirst,Fn as type,B as uniq,ze as uniqBy,T as uniqWith,er as values,nn as zip,Ee as zipObj,Oe as zipWith};
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|