@tolki/obj 1.0.1 → 1.0.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/README.md +13 -3
- package/dist/obj.d.ts +39 -35
- package/dist/obj.d.ts.map +1 -1
- package/dist/obj.js +364 -274
- package/package.json +7 -7
package/dist/obj.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { InvalidArgumentException as f, ItemNotFoundException as p, MultipleItemsFoundException as re, arrayKeyExistsError as ie, arrayValueMessage as ae, arrayableItems as m, arrayableValues as h, compareValues as g, createSortSpecComparator as oe, cssListItemToString as se, defineKey as _, isArray as v, isBoolean as y, isFalsy as ce, isFunction as b, isIllegalOffset as le, isInteger as ue, isIterable as de, isMap as x, isNull as S, isNumber as C, isObject as w, isPhpAccessible as T, isPhpArrayKey as fe, isPhpFalsy as E, isPhpNumeric as D, isPlainObject as O, isPrototypeObject as k, isString as A, isSymbol as j, isTruthyObject as pe, isUndefined as M, isWeakMap as me, keyedEntries as N, looseEqual as P, nextIntegerKey as he, operatorMatch as F, phpArrayKey as I, phpComputedKey as ge, phpSortComparator as _e, phpStringCast as ve, phpTypeName as L, phpValueMatch as R, phpValueMatcher as ye, readMapKey as be, reindexIntegerKeys as z, renumberPhpIntegerKeys as B, resolvePadLength as xe, resolveSliceRange as Se, resolveSpliceRange as Ce, resolveTakeCount as we, strictEqual as V, toPhpKeyString as H } from "@tolki/utils";
|
|
1
|
+
import { dotFlatten as e, explodePluckPath as t, forgetKeys as n, getNestedValue as r, getObjectValue as i, hasMixed as a, isArrayAccess as o, isEnumerable as s, readPluckKey as c, resolvePluckPath as l, setObjectValue as u, undotExpandObject as d } from "@tolki/path";
|
|
2
|
+
import { finish as ee, randomInt as te } from "@tolki/str";
|
|
3
|
+
import { InvalidArgumentException as f, ItemNotFoundException as p, MultipleItemsFoundException as ne, arrayKeyExistsError as re, arrayValueMessage as ie, arrayableItems as m, arrayableValues as h, compareValues as g, createSortSpecComparator as ae, cssListItemToString as oe, defineKey as _, isArray as v, isBoolean as y, isFalsy as se, isFunction as b, isIllegalOffset as ce, isInteger as le, isIterable as ue, isMap as x, isNull as S, isNumber as C, isObject as w, isPhpAccessible as T, isPhpArrayKey as de, isPhpFalsy as E, isPhpNumeric as D, isPlainObject as O, isPrototypeObject as k, isString as A, isSymbol as j, isTruthyObject as fe, isUndefined as M, isWeakMap as pe, keyedEntries as N, looseEqual as P, nextIntegerKey as me, operatorMatch as F, phpArrayKey as I, phpComputedKey as he, phpSortComparator as ge, phpStringCast as _e, phpTypeName as L, phpValueMatch as R, phpValueMatcher as ve, readMapKey as ye, reindexIntegerKeys as z, renumberPhpIntegerKeys as B, resolvePadLength as be, resolveSliceRange as xe, resolveSpliceRange as Se, resolveTakeCount as Ce, strictEqual as V, toPhpKeyString as H } from "@tolki/utils";
|
|
5
4
|
// src/obj.ts
|
|
6
|
-
|
|
5
|
+
function we(e, t) {
|
|
6
|
+
return ae((e, t) => r(e, t))(e, t);
|
|
7
|
+
}
|
|
8
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
7
9
|
function U(e) {
|
|
8
10
|
return w(e) && T(e);
|
|
9
11
|
}
|
|
10
12
|
function W(e) {
|
|
11
13
|
return N(e).map(([e, t]) => [I(e), t]);
|
|
12
14
|
}
|
|
13
|
-
function
|
|
14
|
-
let t =
|
|
15
|
-
return
|
|
15
|
+
function Te(e) {
|
|
16
|
+
let t = s(e) ? e.all() : e;
|
|
17
|
+
return s(e) && v(t) ? [...t.entries()] : /* @__PURE__ */ U(t) ? W(t) : null;
|
|
16
18
|
}
|
|
17
19
|
function G(e, t) {
|
|
18
20
|
if (x(e)) {
|
|
@@ -25,10 +27,10 @@ function G(e, t) {
|
|
|
25
27
|
for (let [e, r] of t) _(n, e, r);
|
|
26
28
|
}
|
|
27
29
|
function K(e) {
|
|
28
|
-
return x(e) ? J(e) : e;
|
|
30
|
+
return x(e) ? /* @__PURE__ */ J(e) : e;
|
|
29
31
|
}
|
|
30
|
-
function
|
|
31
|
-
let n =
|
|
32
|
+
function Ee(e, t) {
|
|
33
|
+
let n = me(e);
|
|
32
34
|
if (x(e)) {
|
|
33
35
|
let r = new Map(e);
|
|
34
36
|
for (let e of t) r.set(n++, e);
|
|
@@ -38,28 +40,33 @@ function De(e, t) {
|
|
|
38
40
|
for (let e of t) _(r, String(n++), e);
|
|
39
41
|
return r;
|
|
40
42
|
}
|
|
41
|
-
|
|
43
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
44
|
+
function De(e) {
|
|
42
45
|
return w(e) && T(e);
|
|
43
46
|
}
|
|
44
|
-
|
|
47
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
48
|
+
function Oe(e, t, n) {
|
|
45
49
|
let r = { ...K(e) };
|
|
46
|
-
return S(
|
|
50
|
+
return S(i(r, t)) ? u(r, t, n) : r;
|
|
47
51
|
}
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
53
|
+
function ke(e, t, n = null) {
|
|
54
|
+
let r = i(e, t, n);
|
|
50
55
|
if (!w(r)) {
|
|
51
56
|
let e = L(r);
|
|
52
57
|
throw new f(`Object value for key [${t}] must be an object, ${e} found.`);
|
|
53
58
|
}
|
|
54
59
|
return r;
|
|
55
60
|
}
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
62
|
+
function Ae(e, t, n = null) {
|
|
63
|
+
let r = i(e, t, n);
|
|
58
64
|
if (!y(r)) throw new f(`Object value for key [${t}] must be a boolean, ${L(r)} found.`);
|
|
59
65
|
return r;
|
|
60
66
|
}
|
|
61
|
-
|
|
62
|
-
|
|
67
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
68
|
+
function je(e, t, n) {
|
|
69
|
+
if (n = M(n) ? !0 : n, t <= 0 || !/* @__PURE__ */ U(e)) return {};
|
|
63
70
|
let r = N(e), i = {}, a = 0;
|
|
64
71
|
for (let e = 0; e < r.length; e += t) {
|
|
65
72
|
let o = r.slice(e, e + t);
|
|
@@ -75,9 +82,10 @@ function Me(e, t, n) {
|
|
|
75
82
|
}
|
|
76
83
|
return i;
|
|
77
84
|
}
|
|
78
|
-
|
|
85
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
86
|
+
function Me(e, t) {
|
|
79
87
|
let n = {};
|
|
80
|
-
if (
|
|
88
|
+
if (!/* @__PURE__ */ U(e)) return n;
|
|
81
89
|
let r = {}, i = 0, a = 0;
|
|
82
90
|
for (let [o, s] of N(e)) {
|
|
83
91
|
let e = I(o);
|
|
@@ -85,24 +93,26 @@ function Ne(e, t) {
|
|
|
85
93
|
}
|
|
86
94
|
return i > 0 && (n[a] = r), n;
|
|
87
95
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
97
|
+
function Ne(e, t) {
|
|
98
|
+
let n = b(t) ? t : (e) => S(t) || M(t) ? e : r(e, t), i;
|
|
99
|
+
return /* @__PURE__ */ Me(e, (e, t, r) => {
|
|
100
|
+
if (i === void 0) {
|
|
101
|
+
let [e, t] = Object.entries(r).at(-1);
|
|
102
|
+
i = {
|
|
94
103
|
key: I(e),
|
|
95
104
|
value: t
|
|
96
105
|
};
|
|
97
106
|
}
|
|
98
|
-
let a =
|
|
99
|
-
return
|
|
107
|
+
let a = i;
|
|
108
|
+
return i = {
|
|
100
109
|
key: t,
|
|
101
110
|
value: e
|
|
102
111
|
}, P(n(e, t), n(a.value, a.key));
|
|
103
112
|
});
|
|
104
113
|
}
|
|
105
|
-
|
|
114
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
115
|
+
function Pe(e) {
|
|
106
116
|
let t = {};
|
|
107
117
|
if (S(e) || M(e)) return t;
|
|
108
118
|
let n = 0;
|
|
@@ -112,7 +122,8 @@ function Fe(e) {
|
|
|
112
122
|
}
|
|
113
123
|
return t;
|
|
114
124
|
}
|
|
115
|
-
|
|
125
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
126
|
+
function Fe(e, t) {
|
|
116
127
|
let n = h(e).map((e) => H(e)), r = h(t), i = n.length;
|
|
117
128
|
if (i !== r.length) throw Error("array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements");
|
|
118
129
|
let a = {};
|
|
@@ -122,10 +133,11 @@ function Ie(e, t) {
|
|
|
122
133
|
}
|
|
123
134
|
return a;
|
|
124
135
|
}
|
|
125
|
-
|
|
136
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
137
|
+
function Ie(...e) {
|
|
126
138
|
let t = [{}];
|
|
127
139
|
for (let n of e) for (let [e, r] of N(n)) {
|
|
128
|
-
let n =
|
|
140
|
+
let n = Le(r);
|
|
129
141
|
if (n.length === 0) return [];
|
|
130
142
|
let i = [];
|
|
131
143
|
for (let r of t) for (let t of n) {
|
|
@@ -136,28 +148,32 @@ function Le(...e) {
|
|
|
136
148
|
}
|
|
137
149
|
return t;
|
|
138
150
|
}
|
|
139
|
-
function
|
|
140
|
-
return v(e) ? e : x(e) ? [...e.values()] :
|
|
151
|
+
function Le(e) {
|
|
152
|
+
return v(e) ? e : x(e) ? [...e.values()] : ue(e) ? [...e] : w(e) ? Object.values(e) : [];
|
|
141
153
|
}
|
|
142
|
-
|
|
143
|
-
|
|
154
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
155
|
+
function Re(e) {
|
|
156
|
+
if (!/* @__PURE__ */ U(e)) return [[], []];
|
|
144
157
|
let t = N(e);
|
|
145
158
|
return [t.map(([e]) => I(e)), t.map(([, e]) => e)];
|
|
146
159
|
}
|
|
147
|
-
|
|
148
|
-
|
|
160
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
161
|
+
function ze(t, n = "", r = Infinity) {
|
|
162
|
+
return /* @__PURE__ */ U(t) ? e(t, n, r) : {};
|
|
149
163
|
}
|
|
150
|
-
|
|
151
|
-
|
|
164
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
165
|
+
function Be(e) {
|
|
166
|
+
return S(e) || M(e) ? {} : d(e);
|
|
152
167
|
}
|
|
153
|
-
|
|
168
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
169
|
+
function Ve(...e) {
|
|
154
170
|
let [t, ...n] = e, r = {}, i = [v(t) || w(t) ? t : {}, ...n.map(m)];
|
|
155
171
|
for (let e of i) for (let [t, n] of Object.entries(e)) Object.hasOwn(r, t) || _(r, t, n);
|
|
156
172
|
return r;
|
|
157
173
|
}
|
|
158
|
-
function
|
|
174
|
+
function He(...e) {
|
|
159
175
|
let [t, ...n] = e;
|
|
160
|
-
if (
|
|
176
|
+
if (!/* @__PURE__ */ U(t)) {
|
|
161
177
|
let e = {};
|
|
162
178
|
return n.forEach((t, n) => {
|
|
163
179
|
e[n] = t;
|
|
@@ -165,27 +181,32 @@ function Ue(...e) {
|
|
|
165
181
|
}
|
|
166
182
|
return k(t) || G(t, B([...n.map((e) => ["0", e]), ...N(t)])), t;
|
|
167
183
|
}
|
|
168
|
-
|
|
169
|
-
|
|
184
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
185
|
+
function Ue(e, t) {
|
|
186
|
+
return /* @__PURE__ */ q(e, t);
|
|
170
187
|
}
|
|
171
|
-
|
|
188
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
189
|
+
function We(e, t, n = !1) {
|
|
172
190
|
if (S(e) || M(e)) return {};
|
|
173
191
|
let r = e, i = v(t) ? t : [t], a = {};
|
|
174
192
|
for (let [e, t] of Object.entries(r)) i.some((e) => n ? t === e : P(t, e)) || _(a, e, t);
|
|
175
193
|
return a;
|
|
176
194
|
}
|
|
177
|
-
|
|
178
|
-
|
|
195
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
196
|
+
function Ge(e, t) {
|
|
197
|
+
return /* @__PURE__ */ U(e) ? Object.hasOwn(e, H(t)) : !1;
|
|
179
198
|
}
|
|
180
|
-
|
|
181
|
-
|
|
199
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
200
|
+
function Ke(e, t, n) {
|
|
201
|
+
let r = () => M(n) ? null : b(n) ? n() : n, i = Te(e);
|
|
182
202
|
if (S(i)) return r();
|
|
183
203
|
if (!t) return i.length === 0 ? r() : i[0]?.[1];
|
|
184
204
|
for (let [e, n] of i) if (!E(t(n, e))) return n;
|
|
185
205
|
return r();
|
|
186
206
|
}
|
|
187
|
-
|
|
188
|
-
|
|
207
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
208
|
+
function qe(e, t, n) {
|
|
209
|
+
let r = () => M(n) ? null : b(n) ? n() : n, i = Te(e);
|
|
189
210
|
if (S(i)) return r();
|
|
190
211
|
if (!b(t)) return i.length === 0 ? r() : i[i.length - 1]?.[1];
|
|
191
212
|
let a = !1, o;
|
|
@@ -198,8 +219,9 @@ function Je(e, t, n) {
|
|
|
198
219
|
}
|
|
199
220
|
return a ? o : r();
|
|
200
221
|
}
|
|
201
|
-
|
|
202
|
-
|
|
222
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
223
|
+
function Je(e, t) {
|
|
224
|
+
if (!/* @__PURE__ */ U(e) || t === 0) return {};
|
|
203
225
|
let n = N(e), r = n.length;
|
|
204
226
|
if (r === 0) return {};
|
|
205
227
|
let i;
|
|
@@ -212,8 +234,9 @@ function Ye(e, t) {
|
|
|
212
234
|
for (let [e, t] of i) _(a, e, t);
|
|
213
235
|
return a;
|
|
214
236
|
}
|
|
215
|
-
|
|
216
|
-
|
|
237
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
238
|
+
function Ye(e, t = Infinity) {
|
|
239
|
+
if (!/* @__PURE__ */ U(e)) return [];
|
|
217
240
|
let n = [], r = (e, t) => {
|
|
218
241
|
let i = v(e) ? e : N(e).map(([, e]) => e);
|
|
219
242
|
for (let e of i) {
|
|
@@ -227,8 +250,9 @@ function Xe(e, t = Infinity) {
|
|
|
227
250
|
};
|
|
228
251
|
return r(e, t), n;
|
|
229
252
|
}
|
|
230
|
-
|
|
231
|
-
|
|
253
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
254
|
+
function Xe(e, t = Infinity) {
|
|
255
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
232
256
|
let n = {}, r = (e, t, i) => {
|
|
233
257
|
let a = t.length, o = a === 0 ? w(e) : O(e) || x(e), s = v(e);
|
|
234
258
|
if (!o && !s || a >= i) a > 0 && _(n, t.join("."), e);
|
|
@@ -237,27 +261,31 @@ function Ze(e, t = Infinity) {
|
|
|
237
261
|
};
|
|
238
262
|
return r(e, [], Number.isFinite(t) ? t + 1 : Infinity), n;
|
|
239
263
|
}
|
|
240
|
-
|
|
241
|
-
|
|
264
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
265
|
+
function Ze(e) {
|
|
266
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
242
267
|
let t = {};
|
|
243
|
-
for (let [n, r] of N(e))
|
|
268
|
+
for (let [n, r] of N(e)) de(r) && _(t, String(r), I(n));
|
|
244
269
|
return t;
|
|
245
270
|
}
|
|
246
|
-
|
|
247
|
-
|
|
271
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
272
|
+
function Qe(e, t, n = null) {
|
|
273
|
+
let r = i(e, t, n);
|
|
248
274
|
if (!C(r)) throw new f(`Object value for key [${t}] must be a float, ${L(r)} found.`);
|
|
249
275
|
return r;
|
|
250
276
|
}
|
|
277
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
251
278
|
function q(e, t) {
|
|
252
|
-
return U(e) ?
|
|
279
|
+
return /* @__PURE__ */ U(e) ? n(K(e), t) : {};
|
|
253
280
|
}
|
|
281
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
254
282
|
function J(e) {
|
|
255
283
|
if (x(e)) {
|
|
256
284
|
let t = {};
|
|
257
285
|
for (let [n, r] of N(e)) _(t, n, r);
|
|
258
286
|
return t;
|
|
259
287
|
}
|
|
260
|
-
if (
|
|
288
|
+
if (pe(e)) throw Error("WeakMap values cannot be enumerated in JavaScript; cannot convert to object.");
|
|
261
289
|
if (v(e)) {
|
|
262
290
|
let t = {};
|
|
263
291
|
for (let n = 0; n < e.length; n++) t[n] = e[n];
|
|
@@ -266,10 +294,11 @@ function J(e) {
|
|
|
266
294
|
if (w(e)) return { ...e };
|
|
267
295
|
throw new f("Items cannot be represented by a scalar value.");
|
|
268
296
|
}
|
|
269
|
-
|
|
297
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
298
|
+
function $e(e, t, n = null) {
|
|
270
299
|
if (S(t) || M(t)) return w(e) ? e : b(n) ? n() : n;
|
|
271
300
|
if (!w(e)) return b(n) ? n() : n;
|
|
272
|
-
let r = String(t), i = x(e) ?
|
|
301
|
+
let r = String(t), i = x(e) ? ye(e, r) : Object.hasOwn(e, r) ? {
|
|
273
302
|
found: !0,
|
|
274
303
|
value: e[r]
|
|
275
304
|
} : { found: !1 };
|
|
@@ -278,7 +307,7 @@ function et(e, t, n = null) {
|
|
|
278
307
|
let a = String(t).split("."), o = e;
|
|
279
308
|
for (let e of a) {
|
|
280
309
|
if (x(o)) {
|
|
281
|
-
o =
|
|
310
|
+
o = ye(o, e).value;
|
|
282
311
|
continue;
|
|
283
312
|
}
|
|
284
313
|
if (!w(o) && !v(o)) return b(n) ? n() : n;
|
|
@@ -288,44 +317,51 @@ function et(e, t, n = null) {
|
|
|
288
317
|
}
|
|
289
318
|
return M(o) ? b(n) ? n() : n : o;
|
|
290
319
|
}
|
|
320
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
291
321
|
function Y(e, t) {
|
|
292
322
|
if (S(t) || M(t)) return !1;
|
|
293
323
|
let n = v(t) ? t : [t];
|
|
294
|
-
if (
|
|
295
|
-
for (let t of n) if (!
|
|
324
|
+
if (!/* @__PURE__ */ U(e) || n.length === 0) return !1;
|
|
325
|
+
for (let t of n) if (!a(e, S(t) || M(t) ? "" : t)) return !1;
|
|
296
326
|
return !0;
|
|
297
327
|
}
|
|
298
|
-
|
|
328
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
329
|
+
function et(e, t) {
|
|
299
330
|
let n = v(t) ? t : [t];
|
|
300
|
-
if (
|
|
301
|
-
for (let t of n) if (
|
|
331
|
+
if (!/* @__PURE__ */ U(e) || n.length === 0) return !1;
|
|
332
|
+
for (let t of n) if (!/* @__PURE__ */ Y(e, t)) return !1;
|
|
302
333
|
return !0;
|
|
303
334
|
}
|
|
304
|
-
|
|
335
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
336
|
+
function tt(e, t) {
|
|
305
337
|
if (S(t)) return !1;
|
|
306
338
|
let n = v(t) ? t : [t];
|
|
307
|
-
if (n.length === 0 ||
|
|
308
|
-
for (let t of n) if (Y(e, t)) return !0;
|
|
339
|
+
if (n.length === 0 || !/* @__PURE__ */ U(e)) return !1;
|
|
340
|
+
for (let t of n) if (/* @__PURE__ */ Y(e, t)) return !0;
|
|
309
341
|
return !1;
|
|
310
342
|
}
|
|
311
|
-
|
|
312
|
-
|
|
343
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
344
|
+
function nt(e, t) {
|
|
345
|
+
if (!/* @__PURE__ */ U(e)) return !1;
|
|
313
346
|
for (let [n, r] of W(e)) if (E(t(r, n))) return !1;
|
|
314
347
|
return !0;
|
|
315
348
|
}
|
|
316
|
-
|
|
317
|
-
|
|
349
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
350
|
+
function rt(e, t) {
|
|
351
|
+
if (!/* @__PURE__ */ U(e)) return !1;
|
|
318
352
|
for (let [n, r] of W(e)) if (!E(t(r, n))) return !0;
|
|
319
353
|
return !1;
|
|
320
354
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
355
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
356
|
+
function it(e, t, n = null) {
|
|
357
|
+
let r = i(e, t, n);
|
|
358
|
+
if (!le(r)) throw new f(`Object value for key [${t}] must be an integer, ${L(r)} found.`);
|
|
324
359
|
return r;
|
|
325
360
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
361
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
362
|
+
function at(e, t, n = "") {
|
|
363
|
+
if (!/* @__PURE__ */ U(e)) return "";
|
|
364
|
+
let r = N(e).map(([, e]) => _e(e));
|
|
329
365
|
if (n === "") return r.join(t);
|
|
330
366
|
let i = r.length;
|
|
331
367
|
if (i === 0) return "";
|
|
@@ -333,57 +369,63 @@ function ot(e, t, n = "") {
|
|
|
333
369
|
let a = r.slice(0, -1).join(t), o = r[i - 1];
|
|
334
370
|
return a + n + o;
|
|
335
371
|
}
|
|
336
|
-
|
|
337
|
-
|
|
372
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
373
|
+
function ot(e, t) {
|
|
374
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
338
375
|
let n = {};
|
|
339
|
-
for (let [r,
|
|
340
|
-
let e = b(t) ? t(
|
|
341
|
-
_(n, j(e) ? e : I(e),
|
|
376
|
+
for (let [r, a] of N(e)) {
|
|
377
|
+
let e = b(t) ? t(a, I(r)) : i(a, t);
|
|
378
|
+
_(n, j(e) ? e : I(e), a);
|
|
342
379
|
}
|
|
343
380
|
return n;
|
|
344
381
|
}
|
|
345
|
-
|
|
346
|
-
|
|
382
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
383
|
+
function st(e, t) {
|
|
384
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
347
385
|
let n = {};
|
|
348
386
|
for (let [r, i] of N(e)) _(n, t + r, i);
|
|
349
387
|
return n;
|
|
350
388
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
389
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
390
|
+
function ct(e, t) {
|
|
391
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
392
|
+
let n = {}, r = S(t) ? [] : v(t) ? t : [t], i = new Set(r.filter(de).map(String));
|
|
354
393
|
for (let [t, r] of N(e)) i.has(t) && _(n, t, r);
|
|
355
394
|
for (let t of r) j(t) && Object.hasOwn(e, t) && _(n, t, e[t]);
|
|
356
395
|
return n;
|
|
357
396
|
}
|
|
358
|
-
|
|
397
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
398
|
+
function lt(e, t, n = !1) {
|
|
359
399
|
if (S(e) || M(e)) return {};
|
|
360
400
|
let r = e, i = v(t) ? t : [t], a = {};
|
|
361
401
|
for (let [e, t] of Object.entries(r)) i.some((e) => n ? t === e : P(t, e)) && _(a, e, t);
|
|
362
402
|
return a;
|
|
363
403
|
}
|
|
364
|
-
|
|
365
|
-
|
|
404
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
405
|
+
function ut(e, t) {
|
|
406
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
366
407
|
let n = e, r = S(t) || M(t) ? [] : v(t) ? t : [t], i = {};
|
|
367
|
-
for (let [e, t] of Object.entries(n)) _(i, e,
|
|
408
|
+
for (let [e, t] of Object.entries(n)) _(i, e, fn(t, r));
|
|
368
409
|
return i;
|
|
369
410
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
411
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
412
|
+
function dt(e, n, r = null) {
|
|
413
|
+
let i = M(n) ? null : n;
|
|
414
|
+
if (!/* @__PURE__ */ U(e)) return S(r) || M(r) ? [] : {};
|
|
373
415
|
let a = S(r) || M(r) ? [] : {};
|
|
374
|
-
for (let [,
|
|
416
|
+
for (let [, n] of N(e)) {
|
|
375
417
|
let e;
|
|
376
|
-
if (e = b(i) ? i(
|
|
418
|
+
if (e = b(i) ? i(n) : l(n, t(i)), S(r) || M(r)) {
|
|
377
419
|
a.push(e);
|
|
378
420
|
continue;
|
|
379
421
|
}
|
|
380
|
-
let o = b(r) ? r(
|
|
381
|
-
_(a,
|
|
422
|
+
let o = b(r) ? r(n) : l(n, t(r));
|
|
423
|
+
_(a, he(o, { stringables: !0 }), e);
|
|
382
424
|
}
|
|
383
425
|
return a;
|
|
384
426
|
}
|
|
385
|
-
function
|
|
386
|
-
if (S(e) ||
|
|
427
|
+
function ft(e, t = 1) {
|
|
428
|
+
if (S(e) || !/* @__PURE__ */ U(e) || k(e)) return t === 1 ? null : [];
|
|
387
429
|
let n = e, r = N(e);
|
|
388
430
|
if (r.length === 0) return t === 1 ? null : [];
|
|
389
431
|
if (t === 1) {
|
|
@@ -391,21 +433,23 @@ function pt(e, t = 1) {
|
|
|
391
433
|
return x(e) ? G(e, r.slice(0, -1)) : delete n[t], i;
|
|
392
434
|
}
|
|
393
435
|
if (t < 1) return [];
|
|
394
|
-
let i = [], a =
|
|
436
|
+
let i = [], a = Ce(t, r.length);
|
|
395
437
|
for (let t = 0; t < a; t++) {
|
|
396
438
|
let [a, o] = r[r.length - 1 - t];
|
|
397
439
|
x(e) || delete n[a], i.push(o);
|
|
398
440
|
}
|
|
399
441
|
return x(e) && G(e, r.slice(0, r.length - a)), i;
|
|
400
442
|
}
|
|
401
|
-
|
|
402
|
-
|
|
443
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
444
|
+
function pt(e, t) {
|
|
445
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
403
446
|
let n = {};
|
|
404
447
|
for (let [r, i] of N(e)) _(n, r, t(i, I(r)));
|
|
405
448
|
return n;
|
|
406
449
|
}
|
|
407
|
-
|
|
408
|
-
|
|
450
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
451
|
+
function mt(e, t) {
|
|
452
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
409
453
|
let n = {};
|
|
410
454
|
for (let [r, i] of N(e)) {
|
|
411
455
|
let e = t(i, I(r));
|
|
@@ -413,30 +457,33 @@ function ht(e, t) {
|
|
|
413
457
|
}
|
|
414
458
|
return n;
|
|
415
459
|
}
|
|
416
|
-
|
|
417
|
-
|
|
460
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
461
|
+
function ht(e, t) {
|
|
462
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
418
463
|
let n = {};
|
|
419
464
|
for (let [r, i] of N(e)) {
|
|
420
|
-
let e = !O(i) && w(i) && b(i.all) ? i.all() : i, a = v(e) ? e :
|
|
465
|
+
let e = !O(i) && w(i) && b(i.all) ? i.all() : i, a = v(e) ? e : /* @__PURE__ */ $t(/* @__PURE__ */ Zt(e));
|
|
421
466
|
_(n, r, t(...a, I(r)));
|
|
422
467
|
}
|
|
423
468
|
return n;
|
|
424
469
|
}
|
|
425
|
-
|
|
426
|
-
|
|
470
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
471
|
+
function gt(e, t, ...n) {
|
|
472
|
+
if (n.length === 0) return x(e) ? _t(e, t) : He({ .../* @__PURE__ */ U(e) ? e : {} }, t);
|
|
427
473
|
let [r] = n, i = {};
|
|
428
|
-
if (_(i, j(r) ? r : I(r), t), U(e)) for (let [t, n] of N(e)) Object.hasOwn(i, t) || _(i, t, n);
|
|
474
|
+
if (_(i, j(r) ? r : I(r), t), /* @__PURE__ */ U(e)) for (let [t, n] of N(e)) Object.hasOwn(i, t) || _(i, t, n);
|
|
429
475
|
return i;
|
|
430
476
|
}
|
|
431
|
-
function
|
|
477
|
+
function _t(e, t) {
|
|
432
478
|
let n = {}, r = 0;
|
|
433
479
|
_(n, r++, t);
|
|
434
480
|
for (let [t, i] of N(e)) _(n, C(I(t)) ? r++ : t, i);
|
|
435
481
|
return n;
|
|
436
482
|
}
|
|
437
|
-
|
|
483
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
484
|
+
function vt(e, t, n = null) {
|
|
438
485
|
let r = () => b(n) ? n() : n;
|
|
439
|
-
if (
|
|
486
|
+
if (!/* @__PURE__ */ U(e)) return {
|
|
440
487
|
value: r(),
|
|
441
488
|
data: {}
|
|
442
489
|
};
|
|
@@ -447,16 +494,17 @@ function yt(e, t, n = null) {
|
|
|
447
494
|
data: t
|
|
448
495
|
};
|
|
449
496
|
}
|
|
450
|
-
let
|
|
497
|
+
let a = K(e), o = i(a, t);
|
|
451
498
|
return S(o) ? {
|
|
452
499
|
value: r(),
|
|
453
|
-
data: { ...
|
|
500
|
+
data: { ...a }
|
|
454
501
|
} : {
|
|
455
502
|
value: o,
|
|
456
|
-
data: q(
|
|
503
|
+
data: /* @__PURE__ */ q(a, t)
|
|
457
504
|
};
|
|
458
505
|
}
|
|
459
|
-
|
|
506
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
507
|
+
function yt(e) {
|
|
460
508
|
if (S(e) || M(e)) return "";
|
|
461
509
|
let t = (e) => encodeURIComponent(e).replace(/[!'()*]/g, (e) => `%${e.charCodeAt(0).toString(16).toUpperCase()}`), n = (e) => y(e) ? e ? "1" : "0" : String(e), r = (e, i = "") => {
|
|
462
510
|
let a = [];
|
|
@@ -488,14 +536,15 @@ function bt(e) {
|
|
|
488
536
|
};
|
|
489
537
|
return r(e).join("&");
|
|
490
538
|
}
|
|
491
|
-
|
|
492
|
-
|
|
539
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
540
|
+
function bt(e, t, n = !1) {
|
|
541
|
+
if (!/* @__PURE__ */ U(e)) return S(t) || M(t) ? null : {};
|
|
493
542
|
let r = N(e), i = r.length, a = S(t) || M(t) ? 1 : t;
|
|
494
543
|
if (F(a, ">", i)) throw new f(`You requested ${H(a)} items, but there are only ${i} items available.`);
|
|
495
544
|
if (i === 0 || F(a, "<=", 0)) return {};
|
|
496
|
-
let o =
|
|
545
|
+
let o = xt(a), s = [], c = Array.from({ length: i }, (e, t) => t);
|
|
497
546
|
for (let e = 0; e < o; e++) {
|
|
498
|
-
let e =
|
|
547
|
+
let e = te(0, c.length - 1);
|
|
499
548
|
s.push(c[e]), c.splice(e, 1);
|
|
500
549
|
}
|
|
501
550
|
if (s.sort((e, t) => e - t), S(t) || M(t)) {
|
|
@@ -509,42 +558,45 @@ function xt(e, t, n = !1) {
|
|
|
509
558
|
}
|
|
510
559
|
return l;
|
|
511
560
|
}
|
|
512
|
-
function
|
|
561
|
+
function xt(e) {
|
|
513
562
|
if (A(e) ? !D(e) : Number.isNaN(e)) throw TypeError(`Random\\Randomizer::pickArrayKeys(): Argument #2 ($num) must be of type int, ${A(e) ? "string" : "float"} given`);
|
|
514
563
|
let t = Math.trunc(Number(e));
|
|
515
564
|
if (t < 1) throw Error("Random\\Randomizer::pickArrayKeys(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)");
|
|
516
565
|
return t;
|
|
517
566
|
}
|
|
518
|
-
function
|
|
567
|
+
function St(e, t = 1) {
|
|
519
568
|
if (t < 0) throw new f("Number of shifted items may not be less than zero.");
|
|
520
569
|
if (t === 0) return [];
|
|
521
|
-
if (
|
|
570
|
+
if (!/* @__PURE__ */ U(e) || k(e)) return t === 1 ? null : [];
|
|
522
571
|
let n = N(e);
|
|
523
572
|
if (n.length === 0) return t === 1 ? null : [];
|
|
524
|
-
let r =
|
|
573
|
+
let r = Ce(t, n.length), i = n.slice(0, r).map(([, e]) => e);
|
|
525
574
|
return G(e, B(n.slice(r))), t === 1 ? i[0] : i;
|
|
526
575
|
}
|
|
527
|
-
|
|
528
|
-
|
|
576
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
577
|
+
function Ct(e, t, n) {
|
|
578
|
+
return S(t) || M(t) ? n : /* @__PURE__ */ U(e) ? u(K(e), t, n) : {};
|
|
529
579
|
}
|
|
530
|
-
|
|
531
|
-
|
|
580
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
581
|
+
function wt(e, t, ...n) {
|
|
582
|
+
if (!/* @__PURE__ */ U(e)) {
|
|
532
583
|
if (S(t) || M(t)) throw Error("Cannot push to root of non-object data when key is null or undefined");
|
|
533
|
-
return
|
|
584
|
+
return u({}, t, n);
|
|
534
585
|
}
|
|
535
586
|
let r = K(e);
|
|
536
|
-
if (S(t) || M(t)) return
|
|
537
|
-
let
|
|
538
|
-
if (v(
|
|
539
|
-
let e = [...
|
|
540
|
-
return
|
|
541
|
-
}
|
|
542
|
-
if (x(
|
|
543
|
-
if (!
|
|
544
|
-
throw new f(
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
|
|
587
|
+
if (S(t) || M(t)) return Ee(r, n);
|
|
588
|
+
let o = i(r, t);
|
|
589
|
+
if (v(o)) {
|
|
590
|
+
let e = [...o, ...n];
|
|
591
|
+
return u(r, t, e);
|
|
592
|
+
}
|
|
593
|
+
if (x(o) || O(o) && !k(o)) return u(r, t, Ee(o, n));
|
|
594
|
+
if (!a(r, t)) return u(r, t, [...n]);
|
|
595
|
+
throw new f(ie(o, t));
|
|
596
|
+
}
|
|
597
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
598
|
+
function Tt(e) {
|
|
599
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
548
600
|
let t = Object.values(e);
|
|
549
601
|
for (let e = t.length - 1; e > 0; e--) {
|
|
550
602
|
let n = Math.floor(Math.random() * (e + 1));
|
|
@@ -555,23 +607,27 @@ function Et(e) {
|
|
|
555
607
|
n[t] = e;
|
|
556
608
|
}), n;
|
|
557
609
|
}
|
|
558
|
-
|
|
610
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
611
|
+
function Et(e, t) {
|
|
559
612
|
let n = $(t);
|
|
560
|
-
return
|
|
613
|
+
return /* @__PURE__ */ Dt(e, (e, t) => E(n(e, t)));
|
|
561
614
|
}
|
|
562
|
-
|
|
563
|
-
|
|
615
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
616
|
+
function Dt(e, t) {
|
|
617
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
564
618
|
let n = N(e), r = $(t), i = n.findIndex(([e, t]) => E(r(t, I(e))));
|
|
565
|
-
return
|
|
619
|
+
return pn(n.slice(i === -1 ? n.length : i));
|
|
566
620
|
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
621
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
622
|
+
function Ot(e, t, n = null) {
|
|
623
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
624
|
+
let r = N(e), { start: i, end: a } = xe(r.length, t, n), o = r.slice(i, a), s = {};
|
|
570
625
|
for (let [e, t] of o) _(s, e, t);
|
|
571
626
|
return s;
|
|
572
627
|
}
|
|
573
|
-
|
|
574
|
-
|
|
628
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
629
|
+
function kt(e, t) {
|
|
630
|
+
if (!/* @__PURE__ */ U(e)) throw new p();
|
|
575
631
|
let n = N(e);
|
|
576
632
|
if (n.length === 0) throw new p();
|
|
577
633
|
let r;
|
|
@@ -581,22 +637,23 @@ function At(e, t) {
|
|
|
581
637
|
} else r = n;
|
|
582
638
|
let i = r.length;
|
|
583
639
|
if (i === 0) throw new p();
|
|
584
|
-
if (i > 1) throw new
|
|
640
|
+
if (i > 1) throw new ne(i);
|
|
585
641
|
return r[0][1];
|
|
586
642
|
}
|
|
587
|
-
|
|
588
|
-
|
|
643
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
644
|
+
function At(e, t = null) {
|
|
645
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
589
646
|
let n = N(e);
|
|
590
647
|
if (v(t)) {
|
|
591
|
-
let e = t.map((e) =>
|
|
592
|
-
n.sort(
|
|
648
|
+
let e = t.map((e) => we(e, !1));
|
|
649
|
+
n.sort(ge(([, t], [, n]) => {
|
|
593
650
|
for (let r of e) {
|
|
594
651
|
let e = r(t, n);
|
|
595
652
|
if (e !== 0) return e;
|
|
596
653
|
}
|
|
597
654
|
return 0;
|
|
598
655
|
}));
|
|
599
|
-
} else
|
|
656
|
+
} else se(t) ? n.sort(([, e], [, t]) => g(e, t)) : A(t) ? n.sort(([, e], [, n]) => g(i(e, t), i(n, t))) : b(t) && (n = n.map(([e, n]) => ({
|
|
600
657
|
key: e,
|
|
601
658
|
value: n,
|
|
602
659
|
sortKey: t(n, I(e))
|
|
@@ -605,19 +662,20 @@ function jt(e, t = null) {
|
|
|
605
662
|
for (let [e, t] of z(n)) _(r, e, t);
|
|
606
663
|
return r;
|
|
607
664
|
}
|
|
608
|
-
|
|
609
|
-
|
|
665
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
666
|
+
function jt(e, t) {
|
|
667
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
610
668
|
let n = N(e);
|
|
611
669
|
if (v(t)) {
|
|
612
|
-
let e = t.map((e) =>
|
|
613
|
-
n.sort(
|
|
670
|
+
let e = t.map((e) => we(e, !0));
|
|
671
|
+
n.sort(ge(([, t], [, n]) => {
|
|
614
672
|
for (let r of e) {
|
|
615
673
|
let e = r(t, n);
|
|
616
674
|
if (e !== 0) return e;
|
|
617
675
|
}
|
|
618
676
|
return 0;
|
|
619
677
|
}));
|
|
620
|
-
} else
|
|
678
|
+
} else se(t) ? n.sort(([, e], [, t]) => g(t, e)) : A(t) ? n.sort(([, e], [, n]) => g(i(n, t), i(e, t))) : b(t) && (n = n.map(([e, n]) => ({
|
|
621
679
|
key: e,
|
|
622
680
|
value: n,
|
|
623
681
|
sortKey: t(n, I(e))
|
|
@@ -626,24 +684,26 @@ function Mt(e, t) {
|
|
|
626
684
|
for (let [e, t] of z(n)) _(r, e, t);
|
|
627
685
|
return r;
|
|
628
686
|
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
687
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
688
|
+
function X(e, t = !1) {
|
|
689
|
+
let n = t === !0 || t === "Descending";
|
|
690
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
691
|
+
let r = (e) => n ? -e : e, i = (e) => v(e) ? e.map(i).sort((e, t) => r(g(e, t))) : O(e) ? /* @__PURE__ */ X(e, n) : e, a = N(e).map(([e, t]) => [e, i(t)]), o = a.every(([e], t) => e === String(t)), s = {};
|
|
692
|
+
if (o) return a.sort(([, e], [, t]) => r(g(e, t))), a.forEach(([, e], t) => {
|
|
693
|
+
_(s, String(t), e);
|
|
694
|
+
}), s;
|
|
695
|
+
a.sort(([e], [t]) => r(g(I(e), I(t))));
|
|
696
|
+
for (let [e, t] of a) _(s, e, t);
|
|
697
|
+
return s;
|
|
698
|
+
}
|
|
699
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
700
|
+
function Mt(e) {
|
|
701
|
+
return /* @__PURE__ */ X(e, "Descending");
|
|
702
|
+
}
|
|
703
|
+
function Nt(e, t, n, ...r) {
|
|
704
|
+
if (!/* @__PURE__ */ U(e) || k(e)) return {};
|
|
705
|
+
let i = N(e), { start: a, count: o } = Se(i.length, t, n), s = i.slice(0, a), c = i.slice(a, a + o), l = i.slice(a + o), u = [];
|
|
706
|
+
for (let e of r) if (/* @__PURE__ */ U(e) || v(e)) for (let [, t] of N(e)) u.push(["0", t]);
|
|
647
707
|
else u.push(["0", e]);
|
|
648
708
|
G(e, B([
|
|
649
709
|
...s,
|
|
@@ -654,94 +714,108 @@ function Pt(e, t, n, ...r) {
|
|
|
654
714
|
for (let [e, t] of B(c)) _(d, e, t);
|
|
655
715
|
return d;
|
|
656
716
|
}
|
|
657
|
-
|
|
658
|
-
|
|
717
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
718
|
+
function Pt(e, t) {
|
|
719
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
659
720
|
let n = N(e), r = $(t), i = n.findIndex(([e, t]) => !E(r(t, I(e))));
|
|
660
|
-
return
|
|
721
|
+
return pn(n.slice(0, i === -1 ? n.length : i));
|
|
661
722
|
}
|
|
662
|
-
|
|
723
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
724
|
+
function Ft(e, t) {
|
|
663
725
|
let n = $(t);
|
|
664
|
-
return
|
|
726
|
+
return /* @__PURE__ */ Pt(e, (e, t) => E(n(e, t)));
|
|
665
727
|
}
|
|
666
|
-
|
|
667
|
-
|
|
728
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
729
|
+
function It(e, t, n = null) {
|
|
730
|
+
let r = i(e, t, n);
|
|
668
731
|
if (!A(r)) throw new f(`Object value for key [${t}] must be a string, ${L(r)} found.`);
|
|
669
732
|
return r;
|
|
670
733
|
}
|
|
671
|
-
|
|
672
|
-
|
|
734
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
735
|
+
function Lt(e) {
|
|
736
|
+
if (!/* @__PURE__ */ U(e)) return "";
|
|
673
737
|
let t = [];
|
|
674
|
-
for (let [n, r] of N(e)) D(n) ? t.push(
|
|
738
|
+
for (let [n, r] of N(e)) D(n) ? t.push(oe(r)) : E(r) || t.push(n);
|
|
675
739
|
return t.join(" ");
|
|
676
740
|
}
|
|
677
|
-
|
|
678
|
-
|
|
741
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
742
|
+
function Rt(e) {
|
|
743
|
+
if (!/* @__PURE__ */ U(e)) return "";
|
|
679
744
|
let t = [];
|
|
680
|
-
for (let [n, r] of N(e)) D(n) ? t.push(
|
|
745
|
+
for (let [n, r] of N(e)) D(n) ? t.push(ee(oe(r), ";")) : E(r) || t.push(ee(n, ";"));
|
|
681
746
|
return t.join(" ");
|
|
682
747
|
}
|
|
748
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
683
749
|
function Z(e, t) {
|
|
684
|
-
if (
|
|
750
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
685
751
|
let n = {};
|
|
686
752
|
for (let [r, i] of N(e)) E(t(i, I(r))) || _(n, r, i);
|
|
687
753
|
return n;
|
|
688
754
|
}
|
|
689
|
-
|
|
690
|
-
|
|
755
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
756
|
+
function zt(e, t) {
|
|
757
|
+
return /* @__PURE__ */ Z(e, (e, n) => E(t(e, n)));
|
|
691
758
|
}
|
|
692
|
-
|
|
759
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
760
|
+
function Bt(e, t) {
|
|
693
761
|
let n = { ...e }, r = m(t);
|
|
694
762
|
for (let [e, t] of Object.entries(r)) _(n, e, t);
|
|
695
763
|
return n;
|
|
696
764
|
}
|
|
697
|
-
|
|
698
|
-
|
|
765
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
766
|
+
function Vt(e, t) {
|
|
767
|
+
return Ht(e, m(t));
|
|
699
768
|
}
|
|
700
|
-
function
|
|
769
|
+
function Ht(e, t) {
|
|
701
770
|
let n = { ...e };
|
|
702
771
|
for (let [e, r] of Object.entries(t)) {
|
|
703
772
|
if (e === "__proto__") continue;
|
|
704
773
|
let t = n[e];
|
|
705
774
|
if ((v(r) || O(r)) && (v(t) || O(t))) {
|
|
706
|
-
let i =
|
|
775
|
+
let i = Ht(t, r), a = (v(t) || v(r)) && Object.keys(i).every((e, t) => e === String(t));
|
|
707
776
|
_(n, e, a ? Object.values(i) : i);
|
|
708
777
|
} else _(n, e, r);
|
|
709
778
|
}
|
|
710
779
|
return n;
|
|
711
780
|
}
|
|
712
|
-
|
|
713
|
-
|
|
781
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
782
|
+
function Ut(e) {
|
|
783
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
714
784
|
let t = N(e);
|
|
715
785
|
t.reverse();
|
|
716
786
|
let n = {};
|
|
717
787
|
for (let [e, r] of z(t)) _(n, e, r);
|
|
718
788
|
return n;
|
|
719
789
|
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
790
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
791
|
+
function Wt(e, t, n) {
|
|
792
|
+
let r = be(t);
|
|
793
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
723
794
|
let i = N(e), a = i.length;
|
|
724
|
-
if (Math.abs(r) <= a) return x(e) ? J(e) : { ...e };
|
|
795
|
+
if (Math.abs(r) <= a) return x(e) ? /* @__PURE__ */ J(e) : { ...e };
|
|
725
796
|
let o = Math.abs(r) - a, s = [];
|
|
726
797
|
for (let e = 0; e < o; e++) s.push(["0", n]);
|
|
727
798
|
let c = r > 0 ? [...i, ...s] : [...s, ...i], l = {};
|
|
728
799
|
for (let [e, t] of B(c)) _(l, e, t);
|
|
729
800
|
return l;
|
|
730
801
|
}
|
|
731
|
-
|
|
732
|
-
|
|
802
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
803
|
+
function Gt(e, t) {
|
|
804
|
+
if (!/* @__PURE__ */ U(e)) return [{}, {}];
|
|
733
805
|
let n = {}, r = {};
|
|
734
806
|
for (let [i, a] of N(e)) E(t(a, I(i))) ? _(r, i, a) : _(n, i, a);
|
|
735
807
|
return [n, r];
|
|
736
808
|
}
|
|
737
|
-
|
|
738
|
-
|
|
809
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
810
|
+
function Kt(e) {
|
|
811
|
+
return /* @__PURE__ */ Z(e, (e) => !S(e));
|
|
739
812
|
}
|
|
813
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
740
814
|
function Q(e, t, ...n) {
|
|
741
815
|
let [r, i] = n;
|
|
742
|
-
if (n.length > 1 || n.length === 1 && !y(r) && !M(r)) return Q(e,
|
|
816
|
+
if (n.length > 1 || n.length === 1 && !y(r) && !M(r)) return /* @__PURE__ */ Q(e, Jt(t, n.length > 1 ? String(r) : "=", n.length > 1 ? i : r));
|
|
743
817
|
let a = r === !0;
|
|
744
|
-
if (
|
|
818
|
+
if (!/* @__PURE__ */ U(e)) return !1;
|
|
745
819
|
let o = N(e);
|
|
746
820
|
if (b(t)) {
|
|
747
821
|
for (let [e, n] of o) if (!E(t(n, I(e)))) return !0;
|
|
@@ -751,17 +825,19 @@ function Q(e, t, ...n) {
|
|
|
751
825
|
for (let [, e] of o) if (P(e, t)) return !0;
|
|
752
826
|
return !1;
|
|
753
827
|
}
|
|
754
|
-
function
|
|
755
|
-
return S(t) || M(t) ? e :
|
|
828
|
+
function qt(e, t) {
|
|
829
|
+
return S(t) || M(t) ? e : r(e, t) ?? null;
|
|
756
830
|
}
|
|
757
|
-
function
|
|
758
|
-
return b(e) ? e : (r) => F(
|
|
831
|
+
function Jt(e, t, n) {
|
|
832
|
+
return b(e) ? e : (r) => F(qt(r, e), t, n);
|
|
759
833
|
}
|
|
760
|
-
|
|
761
|
-
|
|
834
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
835
|
+
function Yt(e, t, n) {
|
|
836
|
+
return M(n) ? /* @__PURE__ */ Q(e, t, !0) : /* @__PURE__ */ Q(e, (e) => V(qt(e, t), n));
|
|
762
837
|
}
|
|
763
|
-
|
|
764
|
-
|
|
838
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
839
|
+
function Xt(e, t) {
|
|
840
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
765
841
|
let n = {};
|
|
766
842
|
for (let [r, i] of N(e)) {
|
|
767
843
|
let e = b(t) ? t(i, I(r)) : i;
|
|
@@ -769,42 +845,50 @@ function Zt(e, t) {
|
|
|
769
845
|
}
|
|
770
846
|
return n;
|
|
771
847
|
}
|
|
772
|
-
|
|
848
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
849
|
+
function Zt(e) {
|
|
773
850
|
return S(e) ? {} : w(e) && T(e) ? e : { 0: e };
|
|
774
851
|
}
|
|
775
|
-
|
|
776
|
-
|
|
852
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
853
|
+
function Qt(e) {
|
|
854
|
+
return /* @__PURE__ */ U(e) ? (x(e) ? N(e).map(([e]) => e) : Object.keys(e)).map(I) : [];
|
|
777
855
|
}
|
|
778
|
-
|
|
779
|
-
|
|
856
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
857
|
+
function $t(e) {
|
|
858
|
+
return /* @__PURE__ */ U(e) ? N(e).map(([, e]) => e) : [];
|
|
780
859
|
}
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
860
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
861
|
+
function en(e, t) {
|
|
862
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
863
|
+
let n = e, r = h(t), i = ve(r), a = {};
|
|
784
864
|
for (let [e, t] of Object.entries(n)) i(t) || _(a, e, t);
|
|
785
865
|
return a;
|
|
786
866
|
}
|
|
787
|
-
|
|
788
|
-
|
|
867
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
868
|
+
function tn(e, t) {
|
|
869
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
789
870
|
let n = e, r = m(t), i = {};
|
|
790
871
|
for (let [e, t] of Object.entries(n)) Object.hasOwn(r, e) && R(r[e], t) || _(i, e, t);
|
|
791
872
|
return i;
|
|
792
873
|
}
|
|
793
|
-
|
|
794
|
-
|
|
874
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
875
|
+
function nn(e, t) {
|
|
876
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
795
877
|
let n = e, r = m(t), i = {};
|
|
796
878
|
for (let [e, t] of Object.entries(n)) Object.hasOwn(r, e) || _(i, e, t);
|
|
797
879
|
return i;
|
|
798
880
|
}
|
|
799
|
-
|
|
881
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
882
|
+
function rn(e, t, n) {
|
|
800
883
|
let r = {};
|
|
801
|
-
if (
|
|
884
|
+
if (!/* @__PURE__ */ U(e)) return r;
|
|
802
885
|
let i = h(t);
|
|
803
886
|
for (let [t, a] of Object.entries(e)) i.some((e) => n(a, e)) || _(r, t, a);
|
|
804
887
|
return r;
|
|
805
888
|
}
|
|
806
|
-
|
|
807
|
-
|
|
889
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
890
|
+
function an(e, t, n) {
|
|
891
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
808
892
|
let r = e, i = m(t), a = {}, o = Object.keys(i);
|
|
809
893
|
for (let [e, t] of Object.entries(r)) {
|
|
810
894
|
let r = o.find((t) => n(I(String(e)), I(String(t))));
|
|
@@ -812,37 +896,42 @@ function on(e, t, n) {
|
|
|
812
896
|
}
|
|
813
897
|
return a;
|
|
814
898
|
}
|
|
815
|
-
|
|
816
|
-
|
|
899
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
900
|
+
function on(e, t, n) {
|
|
901
|
+
if (!/* @__PURE__ */ U(e)) return {};
|
|
817
902
|
let r = e, i = m(t), a = {}, o = Object.keys(i);
|
|
818
903
|
for (let [e, t] of Object.entries(r)) o.find((t) => n(I(String(e)), I(String(t)))) === void 0 && _(a, e, t);
|
|
819
904
|
return a;
|
|
820
905
|
}
|
|
821
|
-
|
|
906
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
907
|
+
function sn(e, t, n = null) {
|
|
822
908
|
let r = {};
|
|
823
|
-
if (
|
|
909
|
+
if (!/* @__PURE__ */ U(e)) return r;
|
|
824
910
|
let i = h(t), a = Object.entries(e);
|
|
825
911
|
if (b(n)) {
|
|
826
912
|
for (let [e, t] of a) i.some((e) => n(t, e)) && _(r, e, t);
|
|
827
913
|
return r;
|
|
828
914
|
}
|
|
829
|
-
let o =
|
|
915
|
+
let o = ve(i);
|
|
830
916
|
for (let [e, t] of a) o(t) && _(r, e, t);
|
|
831
917
|
return r;
|
|
832
918
|
}
|
|
833
|
-
|
|
834
|
-
|
|
919
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
920
|
+
function cn(e, t, n) {
|
|
921
|
+
return /* @__PURE__ */ sn(e, t, n);
|
|
835
922
|
}
|
|
836
|
-
|
|
923
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
924
|
+
function ln(e, t) {
|
|
837
925
|
let n = {};
|
|
838
|
-
if (
|
|
926
|
+
if (!/* @__PURE__ */ U(e)) return n;
|
|
839
927
|
let r = m(t);
|
|
840
928
|
for (let [t, i] of Object.entries(e)) Object.hasOwn(r, t) && R(i, r[t]) && _(n, t, i);
|
|
841
929
|
return n;
|
|
842
930
|
}
|
|
843
|
-
|
|
931
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
932
|
+
function un(e, t, n) {
|
|
844
933
|
let r = {};
|
|
845
|
-
if (
|
|
934
|
+
if (!/* @__PURE__ */ U(e)) return r;
|
|
846
935
|
let i = m(t);
|
|
847
936
|
for (let [t, a] of Object.entries(e)) for (let [e, o] of Object.entries(i)) if (n(I(t), I(e)) && R(a, o)) {
|
|
848
937
|
_(r, t, a);
|
|
@@ -850,41 +939,42 @@ function dn(e, t, n) {
|
|
|
850
939
|
}
|
|
851
940
|
return r;
|
|
852
941
|
}
|
|
853
|
-
|
|
942
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
943
|
+
function dn(e, t) {
|
|
854
944
|
let n = {};
|
|
855
|
-
if (
|
|
945
|
+
if (!/* @__PURE__ */ U(e)) return n;
|
|
856
946
|
let r = m(t);
|
|
857
947
|
for (let [t, i] of Object.entries(e)) Object.hasOwn(r, t) && _(n, t, i);
|
|
858
948
|
return n;
|
|
859
949
|
}
|
|
860
|
-
function
|
|
950
|
+
function fn(e, t) {
|
|
861
951
|
let n = {};
|
|
862
|
-
if (!
|
|
863
|
-
let r = new Map(
|
|
952
|
+
if (!fe(e)) return n;
|
|
953
|
+
let r = new Map(s(e) ? [] : N(e)), i = T(e);
|
|
864
954
|
for (let a of t) {
|
|
865
|
-
if (
|
|
866
|
-
if (i) throw
|
|
955
|
+
if (ce(a)) {
|
|
956
|
+
if (i) throw re();
|
|
867
957
|
continue;
|
|
868
958
|
}
|
|
869
959
|
let t = S(a) || M(a) ? "" : String(a);
|
|
870
|
-
if (
|
|
871
|
-
let [r, i] =
|
|
960
|
+
if (o(e)) {
|
|
961
|
+
let [r, i] = c(e, t);
|
|
872
962
|
if (r) {
|
|
873
963
|
_(n, t, i);
|
|
874
964
|
continue;
|
|
875
965
|
}
|
|
876
966
|
}
|
|
877
|
-
let
|
|
878
|
-
r.has(t) && (i || !(S(
|
|
967
|
+
let s = r.get(t);
|
|
968
|
+
r.has(t) && (i || !(S(s) || M(s))) && _(n, t, s);
|
|
879
969
|
}
|
|
880
970
|
return n;
|
|
881
971
|
}
|
|
882
972
|
function $(e) {
|
|
883
973
|
return b(e) ? e : (t) => V(t, e);
|
|
884
974
|
}
|
|
885
|
-
function
|
|
975
|
+
function pn(e) {
|
|
886
976
|
let t = {};
|
|
887
977
|
for (let [n, r] of e) _(t, n, r);
|
|
888
978
|
return t;
|
|
889
979
|
}
|
|
890
|
-
export { U as accessible,
|
|
980
|
+
export { U as accessible, Oe as add, Ae as boolean, je as chunk, Ne as chunkBy, Me as chunkWhile, Pe as collapse, Fe as combine, Q as contains, Yt as containsStrict, Ie as crossJoin, en as diff, tn as diffAssoc, an as diffAssocUsing, nn as diffKeys, on as diffKeysUsing, rn as diffUsing, Re as divide, ze as dot, nt as every, Ue as except, We as exceptValues, Ge as exists, Xt as filter, Ke as first, Ye as flatten, Xe as flattenDot, Ze as flip, Qe as float, q as forget, J as from, $e as get, Y as has, et as hasAll, tt as hasAny, it as integer, sn as intersect, ln as intersectAssoc, un as intersectAssocUsing, dn as intersectByKeys, cn as intersectUsing, at as join, ot as keyBy, Qt as keys, qe as last, pt as map, ht as mapSpread, mt as mapWithKeys, ke as objectItem, De as objectifiable, ct as only, lt as onlyValues, Wt as pad, Gt as partition, dt as pluck, ft as pop, gt as prepend, st as prependKeysWith, vt as pull, wt as push, yt as query, bt as random, zt as reject, Bt as replace, Vt as replaceRecursive, Ut as reverse, ut as select, Ct as set, St as shift, Tt as shuffle, Et as skipUntil, Dt as skipWhile, Ot as slice, kt as sole, rt as some, At as sort, jt as sortDesc, X as sortRecursive, Mt as sortRecursiveDesc, Nt as splice, It as string, Je as take, Pt as takeUntil, Ft as takeWhile, Lt as toCssClasses, Rt as toCssStyles, Be as undot, Ve as union, He as unshift, $t as values, Z as where, Kt as whereNotNull, Zt as wrap };
|