@varlet/shared 3.14.2 → 3.15.0-alpha.1776606769606
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/lib/index.cjs +1713 -38
- package/lib/index.d.cts +478 -4
- package/lib/index.d.ts +4 -3
- package/lib/index.js +10 -16
- package/package.json +7 -7
package/lib/index.cjs
CHANGED
|
@@ -1,54 +1,1729 @@
|
|
|
1
|
-
"
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let node_crypto = require("node:crypto");
|
|
3
|
+
//#region ../../node_modules/.pnpm/rattail@2.0.5_@voidzero-dev+vite-plus-core@0.1.18_@types+node@20.19.39_esbuild@0.27.7_jiti@2._oaa5dabgz63tacyacthirbl23y/node_modules/rattail/dist/chunk-D1SwGrFN.mjs
|
|
2
4
|
var __defProp = Object.defineProperty;
|
|
3
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
var __exportAll = (all, no_symbols) => {
|
|
9
|
+
let target = {};
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
15
|
+
return target;
|
|
9
16
|
};
|
|
10
17
|
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
19
|
+
key = keys[i];
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
21
|
+
get: ((k) => from[k]).bind(null, key),
|
|
22
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
17
26
|
};
|
|
18
27
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region ../../node_modules/.pnpm/rattail@2.0.5_@voidzero-dev+vite-plus-core@0.1.18_@types+node@20.19.39_esbuild@0.27.7_jiti@2._oaa5dabgz63tacyacthirbl23y/node_modules/rattail/dist/isString-eoLxw4CX.mjs
|
|
30
|
+
function isArray(val) {
|
|
31
|
+
return Array.isArray(val);
|
|
32
|
+
}
|
|
33
|
+
function isString(val) {
|
|
34
|
+
return typeof val === "string";
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region ../../node_modules/.pnpm/rattail@2.0.5_@voidzero-dev+vite-plus-core@0.1.18_@types+node@20.19.39_esbuild@0.27.7_jiti@2._oaa5dabgz63tacyacthirbl23y/node_modules/rattail/dist/callOrReturn-MpTzoGlG.mjs
|
|
38
|
+
function isFunction(val) {
|
|
39
|
+
return typeof val === "function";
|
|
40
|
+
}
|
|
41
|
+
function callOrReturn(fnOrValue, ...args) {
|
|
42
|
+
if (isFunction(fnOrValue)) return fnOrValue(...args);
|
|
43
|
+
return fnOrValue;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region ../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist-node/regex.js
|
|
47
|
+
var regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region ../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist-node/validate.js
|
|
50
|
+
function validate(uuid) {
|
|
51
|
+
return typeof uuid === "string" && regex_default.test(uuid);
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region ../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist-node/parse.js
|
|
55
|
+
function parse(uuid) {
|
|
56
|
+
if (!validate(uuid)) throw TypeError("Invalid UUID");
|
|
57
|
+
let v;
|
|
58
|
+
return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, v >>> 16 & 255, v >>> 8 & 255, v & 255, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 255, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 255, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 255, (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255, v / 4294967296 & 255, v >>> 24 & 255, v >>> 16 & 255, v >>> 8 & 255, v & 255);
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region ../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist-node/stringify.js
|
|
62
|
+
const byteToHex = [];
|
|
63
|
+
for (let i = 0; i < 256; ++i) byteToHex.push((i + 256).toString(16).slice(1));
|
|
64
|
+
function unsafeStringify(arr, offset = 0) {
|
|
65
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region ../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist-node/rng.js
|
|
69
|
+
const rnds8Pool = new Uint8Array(256);
|
|
70
|
+
let poolPtr = rnds8Pool.length;
|
|
71
|
+
function rng() {
|
|
72
|
+
if (poolPtr > rnds8Pool.length - 16) {
|
|
73
|
+
(0, node_crypto.randomFillSync)(rnds8Pool);
|
|
74
|
+
poolPtr = 0;
|
|
75
|
+
}
|
|
76
|
+
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region ../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist-node/v1.js
|
|
80
|
+
const _state = {};
|
|
81
|
+
function v1(options, buf, offset) {
|
|
82
|
+
let bytes;
|
|
83
|
+
const isV6 = options?._v6 ?? false;
|
|
84
|
+
if (options) {
|
|
85
|
+
const optionsKeys = Object.keys(options);
|
|
86
|
+
if (optionsKeys.length === 1 && optionsKeys[0] === "_v6") options = void 0;
|
|
87
|
+
}
|
|
88
|
+
if (options) bytes = v1Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset);
|
|
89
|
+
else {
|
|
90
|
+
const now = Date.now();
|
|
91
|
+
const rnds = rng();
|
|
92
|
+
updateV1State(_state, now, rnds);
|
|
93
|
+
bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? void 0 : _state.clockseq, isV6 ? void 0 : _state.node, buf, offset);
|
|
94
|
+
}
|
|
95
|
+
return buf ?? unsafeStringify(bytes);
|
|
96
|
+
}
|
|
97
|
+
function updateV1State(state, now, rnds) {
|
|
98
|
+
state.msecs ??= -Infinity;
|
|
99
|
+
state.nsecs ??= 0;
|
|
100
|
+
if (now === state.msecs) {
|
|
101
|
+
state.nsecs++;
|
|
102
|
+
if (state.nsecs >= 1e4) {
|
|
103
|
+
state.node = void 0;
|
|
104
|
+
state.nsecs = 0;
|
|
105
|
+
}
|
|
106
|
+
} else if (now > state.msecs) state.nsecs = 0;
|
|
107
|
+
else if (now < state.msecs) state.node = void 0;
|
|
108
|
+
if (!state.node) {
|
|
109
|
+
state.node = rnds.slice(10, 16);
|
|
110
|
+
state.node[0] |= 1;
|
|
111
|
+
state.clockseq = (rnds[8] << 8 | rnds[9]) & 16383;
|
|
112
|
+
}
|
|
113
|
+
state.msecs = now;
|
|
114
|
+
return state;
|
|
115
|
+
}
|
|
116
|
+
function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) {
|
|
117
|
+
if (rnds.length < 16) throw new Error("Random bytes length must be >= 16");
|
|
118
|
+
if (!buf) {
|
|
119
|
+
buf = new Uint8Array(16);
|
|
120
|
+
offset = 0;
|
|
121
|
+
} else if (offset < 0 || offset + 16 > buf.length) throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
|
|
122
|
+
msecs ??= Date.now();
|
|
123
|
+
nsecs ??= 0;
|
|
124
|
+
clockseq ??= (rnds[8] << 8 | rnds[9]) & 16383;
|
|
125
|
+
node ??= rnds.slice(10, 16);
|
|
126
|
+
msecs += 0xb1d069b5400;
|
|
127
|
+
const tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296;
|
|
128
|
+
buf[offset++] = tl >>> 24 & 255;
|
|
129
|
+
buf[offset++] = tl >>> 16 & 255;
|
|
130
|
+
buf[offset++] = tl >>> 8 & 255;
|
|
131
|
+
buf[offset++] = tl & 255;
|
|
132
|
+
const tmh = msecs / 4294967296 * 1e4 & 268435455;
|
|
133
|
+
buf[offset++] = tmh >>> 8 & 255;
|
|
134
|
+
buf[offset++] = tmh & 255;
|
|
135
|
+
buf[offset++] = tmh >>> 24 & 15 | 16;
|
|
136
|
+
buf[offset++] = tmh >>> 16 & 255;
|
|
137
|
+
buf[offset++] = clockseq >>> 8 | 128;
|
|
138
|
+
buf[offset++] = clockseq & 255;
|
|
139
|
+
for (let n = 0; n < 6; ++n) buf[offset++] = node[n];
|
|
140
|
+
return buf;
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region ../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist-node/v1ToV6.js
|
|
144
|
+
function v1ToV6(uuid) {
|
|
145
|
+
const v6Bytes = _v1ToV6(typeof uuid === "string" ? parse(uuid) : uuid);
|
|
146
|
+
return typeof uuid === "string" ? unsafeStringify(v6Bytes) : v6Bytes;
|
|
147
|
+
}
|
|
148
|
+
function _v1ToV6(v1Bytes) {
|
|
149
|
+
return Uint8Array.of((v1Bytes[6] & 15) << 4 | v1Bytes[7] >> 4 & 15, (v1Bytes[7] & 15) << 4 | (v1Bytes[4] & 240) >> 4, (v1Bytes[4] & 15) << 4 | (v1Bytes[5] & 240) >> 4, (v1Bytes[5] & 15) << 4 | (v1Bytes[0] & 240) >> 4, (v1Bytes[0] & 15) << 4 | (v1Bytes[1] & 240) >> 4, (v1Bytes[1] & 15) << 4 | (v1Bytes[2] & 240) >> 4, 96 | v1Bytes[2] & 15, v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]);
|
|
150
|
+
}
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region ../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist-node/native.js
|
|
153
|
+
var native_default = { randomUUID: node_crypto.randomUUID };
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region ../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist-node/v4.js
|
|
156
|
+
function _v4(options, buf, offset) {
|
|
157
|
+
options = options || {};
|
|
158
|
+
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
159
|
+
if (rnds.length < 16) throw new Error("Random bytes length must be >= 16");
|
|
160
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
161
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
162
|
+
if (buf) {
|
|
163
|
+
offset = offset || 0;
|
|
164
|
+
if (offset < 0 || offset + 16 > buf.length) throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
|
|
165
|
+
for (let i = 0; i < 16; ++i) buf[offset + i] = rnds[i];
|
|
166
|
+
return buf;
|
|
167
|
+
}
|
|
168
|
+
return unsafeStringify(rnds);
|
|
169
|
+
}
|
|
170
|
+
function v4(options, buf, offset) {
|
|
171
|
+
if (native_default.randomUUID && !buf && !options) return native_default.randomUUID();
|
|
172
|
+
return _v4(options, buf, offset);
|
|
173
|
+
}
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region ../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist-node/v6.js
|
|
176
|
+
function v6(options, buf, offset) {
|
|
177
|
+
options ??= {};
|
|
178
|
+
offset ??= 0;
|
|
179
|
+
let bytes = v1({
|
|
180
|
+
...options,
|
|
181
|
+
_v6: true
|
|
182
|
+
}, new Uint8Array(16));
|
|
183
|
+
bytes = v1ToV6(bytes);
|
|
184
|
+
if (buf) {
|
|
185
|
+
for (let i = 0; i < 16; i++) buf[offset + i] = bytes[i];
|
|
186
|
+
return buf;
|
|
187
|
+
}
|
|
188
|
+
return unsafeStringify(bytes);
|
|
189
|
+
}
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region ../../node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs
|
|
192
|
+
function mitt_default(n) {
|
|
193
|
+
return {
|
|
194
|
+
all: n = n || /* @__PURE__ */ new Map(),
|
|
195
|
+
on: function(t, e) {
|
|
196
|
+
var i = n.get(t);
|
|
197
|
+
i ? i.push(e) : n.set(t, [e]);
|
|
198
|
+
},
|
|
199
|
+
off: function(t, e) {
|
|
200
|
+
var i = n.get(t);
|
|
201
|
+
i && (e ? i.splice(i.indexOf(e) >>> 0, 1) : n.set(t, []));
|
|
202
|
+
},
|
|
203
|
+
emit: function(t, e) {
|
|
204
|
+
var i = n.get(t);
|
|
205
|
+
i && i.slice().map(function(n) {
|
|
206
|
+
n(e);
|
|
207
|
+
}), (i = n.get("*")) && i.slice().map(function(n) {
|
|
208
|
+
n(t, e);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region ../../node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.mjs
|
|
215
|
+
/*! js-cookie v3.0.5 | MIT */
|
|
216
|
+
function assign(target) {
|
|
217
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
218
|
+
var source = arguments[i];
|
|
219
|
+
for (var key in source) target[key] = source[key];
|
|
220
|
+
}
|
|
221
|
+
return target;
|
|
222
|
+
}
|
|
223
|
+
var defaultConverter = {
|
|
224
|
+
read: function(value) {
|
|
225
|
+
if (value[0] === "\"") value = value.slice(1, -1);
|
|
226
|
+
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
227
|
+
},
|
|
228
|
+
write: function(value) {
|
|
229
|
+
return encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
function init(converter, defaultAttributes) {
|
|
233
|
+
function set(name, value, attributes) {
|
|
234
|
+
if (typeof document === "undefined") return;
|
|
235
|
+
attributes = assign({}, defaultAttributes, attributes);
|
|
236
|
+
if (typeof attributes.expires === "number") attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
|
|
237
|
+
if (attributes.expires) attributes.expires = attributes.expires.toUTCString();
|
|
238
|
+
name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
239
|
+
var stringifiedAttributes = "";
|
|
240
|
+
for (var attributeName in attributes) {
|
|
241
|
+
if (!attributes[attributeName]) continue;
|
|
242
|
+
stringifiedAttributes += "; " + attributeName;
|
|
243
|
+
if (attributes[attributeName] === true) continue;
|
|
244
|
+
stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
|
|
245
|
+
}
|
|
246
|
+
return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes;
|
|
247
|
+
}
|
|
248
|
+
function get(name) {
|
|
249
|
+
if (typeof document === "undefined" || arguments.length && !name) return;
|
|
250
|
+
var cookies = document.cookie ? document.cookie.split("; ") : [];
|
|
251
|
+
var jar = {};
|
|
252
|
+
for (var i = 0; i < cookies.length; i++) {
|
|
253
|
+
var parts = cookies[i].split("=");
|
|
254
|
+
var value = parts.slice(1).join("=");
|
|
255
|
+
try {
|
|
256
|
+
var found = decodeURIComponent(parts[0]);
|
|
257
|
+
jar[found] = converter.read(value, found);
|
|
258
|
+
if (name === found) break;
|
|
259
|
+
} catch (e) {}
|
|
260
|
+
}
|
|
261
|
+
return name ? jar[name] : jar;
|
|
262
|
+
}
|
|
263
|
+
return Object.create({
|
|
264
|
+
set,
|
|
265
|
+
get,
|
|
266
|
+
remove: function(name, attributes) {
|
|
267
|
+
set(name, "", assign({}, attributes, { expires: -1 }));
|
|
268
|
+
},
|
|
269
|
+
withAttributes: function(attributes) {
|
|
270
|
+
return init(this.converter, assign({}, this.attributes, attributes));
|
|
271
|
+
},
|
|
272
|
+
withConverter: function(converter) {
|
|
273
|
+
return init(assign({}, this.converter, converter), this.attributes);
|
|
274
|
+
}
|
|
275
|
+
}, {
|
|
276
|
+
attributes: { value: Object.freeze(defaultAttributes) },
|
|
277
|
+
converter: { value: Object.freeze(converter) }
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
var api = init(defaultConverter, { path: "/" });
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region ../../node_modules/.pnpm/rattail@2.0.5_@voidzero-dev+vite-plus-core@0.1.18_@types+node@20.19.39_esbuild@0.27.7_jiti@2._oaa5dabgz63tacyacthirbl23y/node_modules/rattail/dist/index.mjs
|
|
283
|
+
function at(arr, index) {
|
|
284
|
+
if (!arr.length) return;
|
|
285
|
+
if (index < 0) index += arr.length;
|
|
286
|
+
return arr[index];
|
|
287
|
+
}
|
|
288
|
+
function clamp(num, min, max) {
|
|
289
|
+
return Math.min(max, Math.max(min, num));
|
|
290
|
+
}
|
|
291
|
+
function clampArrayRange(index, arr) {
|
|
292
|
+
return clamp(index, 0, arr.length - 1);
|
|
293
|
+
}
|
|
294
|
+
function delay(time) {
|
|
295
|
+
return new Promise((resolve) => {
|
|
296
|
+
setTimeout(resolve, time);
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
function randomNumber(min = 0, max = 100) {
|
|
300
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
301
|
+
}
|
|
302
|
+
function times(num, fn) {
|
|
303
|
+
return Array.from({ length: num }, (_, index) => fn(index));
|
|
304
|
+
}
|
|
305
|
+
function inBrowser() {
|
|
306
|
+
return typeof window !== "undefined";
|
|
307
|
+
}
|
|
308
|
+
function getGlobalThis() {
|
|
309
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
310
|
+
if (inBrowser()) return window;
|
|
311
|
+
return typeof global !== "undefined" ? global : self;
|
|
312
|
+
}
|
|
313
|
+
const { hasOwnProperty } = Object.prototype;
|
|
314
|
+
function hasOwn(val, key) {
|
|
315
|
+
return hasOwnProperty.call(val, key);
|
|
316
|
+
}
|
|
317
|
+
function inMobile() {
|
|
318
|
+
return inBrowser() && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
319
|
+
}
|
|
320
|
+
const objectToString = Object.prototype.toString;
|
|
321
|
+
function toTypeString(value) {
|
|
322
|
+
return objectToString.call(value);
|
|
323
|
+
}
|
|
324
|
+
function toRawType(value) {
|
|
325
|
+
return toTypeString(value).slice(8, -1);
|
|
326
|
+
}
|
|
327
|
+
function isArrayBuffer(val) {
|
|
328
|
+
return toRawType(val) === "ArrayBuffer";
|
|
329
|
+
}
|
|
330
|
+
function isBoolean(val) {
|
|
331
|
+
return typeof val === "boolean";
|
|
332
|
+
}
|
|
333
|
+
function isDataView(val) {
|
|
334
|
+
return toRawType(val) === "DataView";
|
|
335
|
+
}
|
|
336
|
+
function isDate(val) {
|
|
337
|
+
return toRawType(val) === "Date";
|
|
338
|
+
}
|
|
339
|
+
function isDOMException(val) {
|
|
340
|
+
return toRawType(val) === "DOMException";
|
|
341
|
+
}
|
|
342
|
+
function isEmpty(val) {
|
|
343
|
+
return val === void 0 || val === null || val === "" || isArray(val) && !val.length;
|
|
344
|
+
}
|
|
345
|
+
function isError(val) {
|
|
346
|
+
return toRawType(val) === "Error";
|
|
347
|
+
}
|
|
348
|
+
function isMap(val) {
|
|
349
|
+
return toRawType(val) === "Map";
|
|
350
|
+
}
|
|
351
|
+
function isObject(val) {
|
|
352
|
+
return typeof val === "object" && val !== null;
|
|
353
|
+
}
|
|
354
|
+
function isPlainObject(val) {
|
|
355
|
+
return toRawType(val) === "Object";
|
|
356
|
+
}
|
|
357
|
+
function isRegExp(val) {
|
|
358
|
+
return toRawType(val) === "RegExp";
|
|
359
|
+
}
|
|
360
|
+
function isSet(val) {
|
|
361
|
+
return toRawType(val) === "Set";
|
|
362
|
+
}
|
|
363
|
+
function isTypedArray(val) {
|
|
364
|
+
return [
|
|
365
|
+
"Int8Array",
|
|
366
|
+
"Uint8Array",
|
|
367
|
+
"Uint8ClampedArray",
|
|
368
|
+
"Int16Array",
|
|
369
|
+
"Uint16Array",
|
|
370
|
+
"Int32Array",
|
|
371
|
+
"Uint32Array",
|
|
372
|
+
"Float32Array",
|
|
373
|
+
"Float64Array",
|
|
374
|
+
"BigInt64Array",
|
|
375
|
+
"BigUint64Array"
|
|
376
|
+
].includes(toRawType(val));
|
|
377
|
+
}
|
|
378
|
+
function isEqualWith(value, other, fn) {
|
|
379
|
+
const valueStack = /* @__PURE__ */ new WeakMap();
|
|
380
|
+
const otherStack = /* @__PURE__ */ new WeakMap();
|
|
381
|
+
function baseIsEqual(value, other, valueStack, otherStack) {
|
|
382
|
+
if (fn(value, other) === true) return true;
|
|
383
|
+
if (value === other) return true;
|
|
384
|
+
if (value !== value && other !== other) return true;
|
|
385
|
+
if (!isObject(value) || !isObject(other)) return value === other;
|
|
386
|
+
if (value.constructor !== other.constructor) return false;
|
|
387
|
+
if (toRawType(value) === "String" && toRawType(other) === "String" || toRawType(value) === "Number" && toRawType(other) === "Number" || toRawType(value) === "Boolean" && toRawType(other) === "Boolean" || toRawType(value) === "BigInt" && toRawType(other) === "BigInt" || toRawType(value) === "Symbol" && toRawType(other) === "Symbol") return value.valueOf() === other.valueOf();
|
|
388
|
+
if (isDate(value) && isDate(other)) return value.getTime() === other.getTime();
|
|
389
|
+
if (isRegExp(value) && isRegExp(other)) return value.source === other.source && value.flags === other.flags;
|
|
390
|
+
if (isError(value) && isError(other)) return value.name === other.name && value.message === other.message && value.cause === other.cause;
|
|
391
|
+
if (isDOMException(value) && isDOMException(other)) return value.name === other.name && value.message === other.message;
|
|
392
|
+
if (isTypedArray(value) && isTypedArray(other) || isDataView(value) && isDataView(other)) {
|
|
393
|
+
if (value.byteLength !== other.byteLength) return false;
|
|
394
|
+
const valueTypedArray = new Uint8Array(value.buffer);
|
|
395
|
+
const otherTypedArray = new Uint8Array(other.buffer);
|
|
396
|
+
return valueTypedArray.every((v, i) => v === otherTypedArray[i]);
|
|
397
|
+
}
|
|
398
|
+
if (isArrayBuffer(value) && isArrayBuffer(other)) {
|
|
399
|
+
if (value.byteLength !== other.byteLength) return false;
|
|
400
|
+
const valueTypedArray = new Uint8Array(value);
|
|
401
|
+
const otherTypedArray = new Uint8Array(other);
|
|
402
|
+
return valueTypedArray.every((v, i) => v === otherTypedArray[i]);
|
|
403
|
+
}
|
|
404
|
+
if (valueStack.get(value) === other && otherStack.get(other) === value) return true;
|
|
405
|
+
valueStack.set(value, other);
|
|
406
|
+
otherStack.set(other, value);
|
|
407
|
+
if (isMap(value) && isMap(other) || isSet(value) && isSet(other)) {
|
|
408
|
+
if (value.size !== other.size) return false;
|
|
409
|
+
const valueArray = [...value];
|
|
410
|
+
const otherArray = [...other];
|
|
411
|
+
const result = valueArray.every((v, i) => baseIsEqual(v, otherArray[i], valueStack, otherStack));
|
|
412
|
+
valueStack.delete(value);
|
|
413
|
+
otherStack.delete(other);
|
|
414
|
+
return result;
|
|
415
|
+
}
|
|
416
|
+
if (isArray(value) && isArray(other)) {
|
|
417
|
+
if (value.length !== other.length) return false;
|
|
418
|
+
const result = value.every((v, i) => baseIsEqual(v, other[i], valueStack, otherStack));
|
|
419
|
+
valueStack.delete(value);
|
|
420
|
+
otherStack.delete(other);
|
|
421
|
+
return result;
|
|
422
|
+
}
|
|
423
|
+
if (isPlainObject(value) && isPlainObject(other)) {
|
|
424
|
+
const valueOwnKeys = [...Object.keys(value), ...Object.getOwnPropertySymbols(value)];
|
|
425
|
+
const otherOwnKeys = [...Object.keys(other), ...Object.getOwnPropertySymbols(other)];
|
|
426
|
+
if (valueOwnKeys.length !== otherOwnKeys.length) return false;
|
|
427
|
+
const result = valueOwnKeys.every((k) => baseIsEqual(value[k], other[k], valueStack, otherStack));
|
|
428
|
+
valueStack.delete(value);
|
|
429
|
+
otherStack.delete(other);
|
|
430
|
+
return result;
|
|
431
|
+
}
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
return baseIsEqual(value, other, valueStack, otherStack);
|
|
435
|
+
}
|
|
436
|
+
function isEqual(value, other) {
|
|
437
|
+
return isEqualWith(value, other, () => void 0);
|
|
438
|
+
}
|
|
439
|
+
function isNonEmptyArray(val) {
|
|
440
|
+
return isArray(val) && !!val.length;
|
|
441
|
+
}
|
|
442
|
+
function isNullish(val) {
|
|
443
|
+
return val == null;
|
|
444
|
+
}
|
|
445
|
+
function isNumber(val) {
|
|
446
|
+
return typeof val === "number";
|
|
447
|
+
}
|
|
448
|
+
function isNumeric(val) {
|
|
449
|
+
return isNumber(val) || isString(val) && /^[-+]?\d+$/.test(val);
|
|
450
|
+
}
|
|
451
|
+
function isPromise(val) {
|
|
452
|
+
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
453
|
+
}
|
|
454
|
+
function isSymbol(val) {
|
|
455
|
+
return typeof val === "symbol";
|
|
456
|
+
}
|
|
457
|
+
function isTruthy(v) {
|
|
458
|
+
return Boolean(v);
|
|
459
|
+
}
|
|
460
|
+
function isWeakMap(val) {
|
|
461
|
+
return toRawType(val) === "WeakMap";
|
|
462
|
+
}
|
|
463
|
+
function isWeakSet(val) {
|
|
464
|
+
return toRawType(val) === "WeakSet";
|
|
465
|
+
}
|
|
466
|
+
function isWindow(val) {
|
|
467
|
+
return val === window;
|
|
468
|
+
}
|
|
469
|
+
function supportTouch() {
|
|
470
|
+
return inBrowser() && "ontouchstart" in window;
|
|
471
|
+
}
|
|
472
|
+
function isFile(val) {
|
|
473
|
+
return toRawType(val) === "File";
|
|
474
|
+
}
|
|
475
|
+
function isBlob(val) {
|
|
476
|
+
return toRawType(val) === "Blob";
|
|
477
|
+
}
|
|
478
|
+
function isPrimitive(val) {
|
|
479
|
+
return val == null || typeof val !== "object" && typeof val !== "function";
|
|
480
|
+
}
|
|
481
|
+
function isEmptyPlainObject(val) {
|
|
482
|
+
return isPlainObject(val) && Object.keys(val).length === 0 && Object.getOwnPropertySymbols(val).length === 0;
|
|
483
|
+
}
|
|
484
|
+
function assert$1(condition, message) {
|
|
485
|
+
if (!condition) throw new Error(message);
|
|
486
|
+
}
|
|
487
|
+
function hasDuplicates(arr) {
|
|
488
|
+
return uniq(arr).length !== arr.length;
|
|
489
|
+
}
|
|
490
|
+
function hasDuplicatesBy(arr, fn) {
|
|
491
|
+
return uniqBy(arr, fn).length !== arr.length;
|
|
492
|
+
}
|
|
493
|
+
function toNumber(val) {
|
|
494
|
+
if (val == null) return 0;
|
|
495
|
+
if (isString(val)) {
|
|
496
|
+
val = parseFloat(val);
|
|
497
|
+
val = Number.isNaN(val) ? 0 : val;
|
|
498
|
+
return val;
|
|
499
|
+
}
|
|
500
|
+
if (isBoolean(val)) return Number(val);
|
|
501
|
+
return val;
|
|
502
|
+
}
|
|
503
|
+
let key$1 = 0;
|
|
504
|
+
function genNumberKey() {
|
|
505
|
+
return key$1++;
|
|
506
|
+
}
|
|
507
|
+
function chunk(arr, size = 1) {
|
|
508
|
+
size = clamp(size, 1, arr.length);
|
|
509
|
+
const result = [];
|
|
510
|
+
let index = 0;
|
|
511
|
+
while (index < arr.length) {
|
|
512
|
+
result.push(arr.slice(index, index + size));
|
|
513
|
+
index += size;
|
|
514
|
+
}
|
|
515
|
+
return result;
|
|
516
|
+
}
|
|
517
|
+
function removeItem(arr, item) {
|
|
518
|
+
if (arr.length) {
|
|
519
|
+
const index = arr.indexOf(item);
|
|
520
|
+
if (index > -1) return arr.splice(index, 1);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
function removeItemBy(arr, fn) {
|
|
524
|
+
if (arr.length) {
|
|
525
|
+
const index = arr.findIndex((v) => fn(v));
|
|
526
|
+
if (index > -1) return arr.splice(index, 1);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
function removeItemsBy(arr, fn) {
|
|
530
|
+
let i = 0;
|
|
531
|
+
const removedItems = [];
|
|
532
|
+
while (i < arr.length) if (fn(arr[i])) removedItems.push(...arr.splice(i, 1));
|
|
533
|
+
else i++;
|
|
534
|
+
return removedItems;
|
|
535
|
+
}
|
|
536
|
+
function toggleItem(arr, item) {
|
|
537
|
+
arr.includes(item) ? removeItem(arr, item) : arr.push(item);
|
|
538
|
+
return arr;
|
|
539
|
+
}
|
|
540
|
+
function uniq(arr) {
|
|
541
|
+
return [...new Set(arr)];
|
|
542
|
+
}
|
|
543
|
+
function uniqBy(arr, fn) {
|
|
544
|
+
return arr.reduce((ret, i) => {
|
|
545
|
+
if (ret.findIndex((j) => fn(i, j)) === -1) ret.push(i);
|
|
546
|
+
return ret;
|
|
547
|
+
}, []);
|
|
548
|
+
}
|
|
549
|
+
function find(arr, fn, from = "start") {
|
|
550
|
+
let i = from === "start" ? 0 : arr.length - 1;
|
|
551
|
+
while (arr.length > 0 && i >= 0 && i <= arr.length - 1) {
|
|
552
|
+
if (fn(arr[i], i, arr)) return [arr[i], i];
|
|
553
|
+
from === "start" ? i++ : i--;
|
|
554
|
+
}
|
|
555
|
+
return [null, -1];
|
|
556
|
+
}
|
|
557
|
+
function shuffle(arr) {
|
|
558
|
+
for (let i = arr.length - 1; i > 0; i--) {
|
|
559
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
560
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
561
|
+
}
|
|
562
|
+
return arr;
|
|
563
|
+
}
|
|
564
|
+
function removeArrayBlank(arr) {
|
|
565
|
+
return arr.filter((item) => item != null);
|
|
566
|
+
}
|
|
567
|
+
function removeArrayEmpty(arr) {
|
|
568
|
+
return arr.filter((item) => item != null && item !== "");
|
|
569
|
+
}
|
|
570
|
+
function normalizeToArray(value) {
|
|
571
|
+
return isArray(value) ? value : [value];
|
|
572
|
+
}
|
|
573
|
+
function differenceWith(arr, ...values) {
|
|
574
|
+
const fn = at(values, -1);
|
|
575
|
+
const targets = values.slice(0, -1).reduce((targets, value) => [...targets, ...value], []);
|
|
576
|
+
return arr.filter((item) => !targets.some((value) => fn(item, value)));
|
|
577
|
+
}
|
|
578
|
+
function difference(arr, ...values) {
|
|
579
|
+
return differenceWith(arr, ...values, (a, b) => a === b);
|
|
580
|
+
}
|
|
581
|
+
function intersectionWith(...values) {
|
|
582
|
+
const fn = at(values, -1);
|
|
583
|
+
const targets = values.slice(0, -1);
|
|
584
|
+
if (targets.length === 0) return [];
|
|
585
|
+
if (targets.length === 1) return uniqBy(targets[0], fn);
|
|
586
|
+
function baseIntersectionWith(arr1, arr2) {
|
|
587
|
+
return arr1.filter((item) => arr2.some((value) => fn(item, value)));
|
|
588
|
+
}
|
|
589
|
+
return uniqBy(targets.reduce((result, target) => baseIntersectionWith(result, target)), fn);
|
|
590
|
+
}
|
|
591
|
+
function intersection(...values) {
|
|
592
|
+
return intersectionWith(...values, (a, b) => a === b);
|
|
593
|
+
}
|
|
594
|
+
function groupBy(arr, fn) {
|
|
595
|
+
return arr.reduce((result, item) => {
|
|
596
|
+
const key = fn(item);
|
|
597
|
+
(result[key] ??= []).push(item);
|
|
598
|
+
return result;
|
|
599
|
+
}, {});
|
|
600
|
+
}
|
|
601
|
+
function xorWith(...values) {
|
|
602
|
+
const fn = at(values, -1);
|
|
603
|
+
return uniqBy(values.slice(0, -1).reduce((result, target) => {
|
|
604
|
+
return [...differenceWith(result, target, fn), ...differenceWith(target, result, fn)];
|
|
605
|
+
}), fn);
|
|
606
|
+
}
|
|
607
|
+
function xor(...values) {
|
|
608
|
+
return xorWith(...values, (a, b) => a === b);
|
|
609
|
+
}
|
|
610
|
+
function pick(object, keys) {
|
|
611
|
+
return keys.reduce((result, key) => {
|
|
612
|
+
result[key] = object[key];
|
|
613
|
+
return result;
|
|
614
|
+
}, {});
|
|
615
|
+
}
|
|
616
|
+
function pickBy(object, fn) {
|
|
617
|
+
return [...Object.keys(object), ...Object.getOwnPropertySymbols(object)].reduce((result, key) => {
|
|
618
|
+
const value = object[key];
|
|
619
|
+
if (fn(value, key)) result[key] = value;
|
|
620
|
+
return result;
|
|
621
|
+
}, {});
|
|
622
|
+
}
|
|
623
|
+
function omit(object, keys) {
|
|
624
|
+
return [...Object.keys(object), ...Object.getOwnPropertySymbols(object)].reduce((result, key) => {
|
|
625
|
+
if (!keys.includes(key)) result[key] = object[key];
|
|
626
|
+
return result;
|
|
627
|
+
}, {});
|
|
628
|
+
}
|
|
629
|
+
function omitBy(object, fn) {
|
|
630
|
+
return [...Object.keys(object), ...Object.getOwnPropertySymbols(object)].reduce((result, key) => {
|
|
631
|
+
const value = object[key];
|
|
632
|
+
if (!fn(value, key)) result[key] = value;
|
|
633
|
+
return result;
|
|
634
|
+
}, {});
|
|
635
|
+
}
|
|
636
|
+
function mapObject(object, fn) {
|
|
637
|
+
return Object.entries(object).reduce((result, [key, value]) => {
|
|
638
|
+
const entry = fn(key, value);
|
|
639
|
+
if (isArray(entry)) {
|
|
640
|
+
const [newKey, newValue] = entry;
|
|
641
|
+
result[newKey] = newValue;
|
|
642
|
+
}
|
|
643
|
+
return result;
|
|
644
|
+
}, {});
|
|
645
|
+
}
|
|
646
|
+
function promiseWithResolvers() {
|
|
647
|
+
let resolve;
|
|
648
|
+
let reject;
|
|
649
|
+
return {
|
|
650
|
+
promise: new Promise((_resolver, _reject) => {
|
|
651
|
+
resolve = _resolver;
|
|
652
|
+
reject = _reject;
|
|
653
|
+
}),
|
|
654
|
+
resolve,
|
|
655
|
+
reject
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
function set(object, path, value) {
|
|
659
|
+
if (!isObject(object)) return;
|
|
660
|
+
const keys = [...path];
|
|
661
|
+
if (keys.length === 0) return;
|
|
662
|
+
let target = object;
|
|
663
|
+
while (keys.length > 1) {
|
|
664
|
+
const key = keys.shift();
|
|
665
|
+
const nextKey = keys[0];
|
|
666
|
+
if (!isObject(target[key])) target[key] = isNumber(nextKey) ? [] : {};
|
|
667
|
+
target = target[key];
|
|
668
|
+
}
|
|
669
|
+
target[keys[0]] = value;
|
|
670
|
+
}
|
|
671
|
+
function objectKeys(object) {
|
|
672
|
+
return Object.keys(object);
|
|
673
|
+
}
|
|
674
|
+
function objectEntries(object) {
|
|
675
|
+
return Object.entries(object);
|
|
676
|
+
}
|
|
677
|
+
var integrated_exports = /* @__PURE__ */ __exportAll({
|
|
678
|
+
mitt: () => mitt_default,
|
|
679
|
+
uuid: () => v4,
|
|
680
|
+
uuidV6: () => v6
|
|
28
681
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
682
|
+
function cancelAnimationFrame(handle) {
|
|
683
|
+
const globalThis = getGlobalThis();
|
|
684
|
+
globalThis.cancelAnimationFrame ? globalThis.cancelAnimationFrame(handle) : globalThis.clearTimeout(handle);
|
|
685
|
+
}
|
|
686
|
+
function classes(...classes) {
|
|
687
|
+
return classes.map((className) => {
|
|
688
|
+
if (isArray(className)) {
|
|
689
|
+
const [condition, truthy, falsy = null] = className;
|
|
690
|
+
return condition ? truthy : falsy;
|
|
691
|
+
}
|
|
692
|
+
return className;
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
function copyText(value) {
|
|
696
|
+
if (!value) return;
|
|
697
|
+
const textArea = document.createElement("textarea");
|
|
698
|
+
textArea.value = value;
|
|
699
|
+
textArea.style.position = "fixed";
|
|
700
|
+
textArea.style.opacity = "0";
|
|
701
|
+
document.body.appendChild(textArea);
|
|
702
|
+
textArea.select();
|
|
703
|
+
document.execCommand("copy");
|
|
704
|
+
document.body.removeChild(textArea);
|
|
705
|
+
}
|
|
706
|
+
function maskString(text, { prefix = 2, suffix = 2, mask = "*", maskLength } = {}) {
|
|
707
|
+
if (text.length <= 1) return text;
|
|
708
|
+
const effectivePrefix = Math.min(prefix, text.length - 1);
|
|
709
|
+
const effectiveSuffix = Math.min(suffix, Math.max(text.length - effectivePrefix - 1, 0));
|
|
710
|
+
const count = maskLength ?? text.length - effectivePrefix - effectiveSuffix;
|
|
711
|
+
const suffixPart = effectiveSuffix > 0 ? text.slice(-effectiveSuffix) : "";
|
|
712
|
+
return text.slice(0, effectivePrefix) + mask.repeat(count) + suffixPart;
|
|
713
|
+
}
|
|
714
|
+
function camelize(s) {
|
|
715
|
+
s = s.replace(/[-_](\w)/g, (_, p) => p.toUpperCase());
|
|
716
|
+
return s.replace(s.charAt(0), s.charAt(0).toLowerCase());
|
|
717
|
+
}
|
|
718
|
+
function ensurePrefix(s, prefix) {
|
|
719
|
+
return s.startsWith(prefix) ? s : prefix + s;
|
|
720
|
+
}
|
|
721
|
+
function ensureSuffix(s, suffix) {
|
|
722
|
+
return s.endsWith(suffix) ? s : s + suffix;
|
|
723
|
+
}
|
|
724
|
+
let key = 0;
|
|
725
|
+
function genStringKey() {
|
|
726
|
+
return `generated-key-${key++}`;
|
|
727
|
+
}
|
|
728
|
+
function kebabCase(s) {
|
|
729
|
+
return s.replace(/([A-Z])/g, " $1").replace(/[_\s]+/g, "-").trim().replace(/^-/, "").toLowerCase();
|
|
730
|
+
}
|
|
731
|
+
function pascalCase(s) {
|
|
732
|
+
const ret = camelize(s);
|
|
733
|
+
return ret.replace(ret.charAt(0), ret.charAt(0).toUpperCase());
|
|
734
|
+
}
|
|
735
|
+
function lowerFirst(s) {
|
|
736
|
+
return s.charAt(0).toLowerCase() + s.slice(1);
|
|
737
|
+
}
|
|
738
|
+
function upperFirst(s) {
|
|
739
|
+
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
740
|
+
}
|
|
741
|
+
function randomColor() {
|
|
742
|
+
const letters = "0123456789abcdef";
|
|
743
|
+
let color = "#";
|
|
744
|
+
for (let i = 0; i < 6; i++) color += letters[Math.floor(Math.random() * 16)];
|
|
745
|
+
return color;
|
|
746
|
+
}
|
|
747
|
+
function randomString(length = 10) {
|
|
748
|
+
let str = baseRandomString();
|
|
749
|
+
while (str.length < length) str += baseRandomString();
|
|
750
|
+
function baseRandomString() {
|
|
751
|
+
return Math.random().toString(36).slice(2);
|
|
752
|
+
}
|
|
753
|
+
return str.slice(0, length);
|
|
754
|
+
}
|
|
755
|
+
function slash(path) {
|
|
756
|
+
if (path.startsWith("\\\\?\\")) return path;
|
|
757
|
+
return path.replace(/\\/g, "/");
|
|
758
|
+
}
|
|
759
|
+
function createNamespaceFn(namespace) {
|
|
760
|
+
return (name) => {
|
|
761
|
+
const componentName = `${namespace}-${name}`;
|
|
762
|
+
const createBEM = (suffix) => {
|
|
763
|
+
if (!suffix) return componentName;
|
|
764
|
+
if (suffix[0] === "$") return suffix.replace("$", namespace);
|
|
765
|
+
return suffix.startsWith("--") ? `${componentName}${suffix}` : `${componentName}__${suffix}`;
|
|
766
|
+
};
|
|
767
|
+
return {
|
|
768
|
+
name: pascalCase(componentName),
|
|
769
|
+
n: createBEM,
|
|
770
|
+
classes
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
function requestAnimationFrame(fn) {
|
|
775
|
+
const globalThis = getGlobalThis();
|
|
776
|
+
return globalThis.requestAnimationFrame ? globalThis.requestAnimationFrame(fn) : globalThis.setTimeout(fn);
|
|
777
|
+
}
|
|
778
|
+
function doubleRaf() {
|
|
779
|
+
return new Promise((resolve) => {
|
|
780
|
+
requestAnimationFrame(() => {
|
|
781
|
+
requestAnimationFrame(resolve);
|
|
782
|
+
});
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
function getStyle(element) {
|
|
786
|
+
return window.getComputedStyle(element);
|
|
787
|
+
}
|
|
788
|
+
function getParentScroller(el) {
|
|
789
|
+
let element = el;
|
|
790
|
+
while (element) {
|
|
791
|
+
if (!element.parentNode) break;
|
|
792
|
+
element = element.parentNode;
|
|
793
|
+
if (element === document.body || element === document.documentElement) break;
|
|
794
|
+
const scrollRE = /(scroll|auto)/;
|
|
795
|
+
const { overflowY, overflow } = getStyle(element);
|
|
796
|
+
if (scrollRE.test(overflowY) || scrollRE.test(overflow)) return element;
|
|
797
|
+
}
|
|
798
|
+
return window;
|
|
799
|
+
}
|
|
800
|
+
function getAllParentScroller(el) {
|
|
801
|
+
const allParentScroller = [];
|
|
802
|
+
let element = el;
|
|
803
|
+
while (!isWindow(element)) {
|
|
804
|
+
element = getParentScroller(element);
|
|
805
|
+
allParentScroller.push(element);
|
|
806
|
+
}
|
|
807
|
+
return allParentScroller;
|
|
808
|
+
}
|
|
809
|
+
function getRect(element) {
|
|
810
|
+
if (isWindow(element)) {
|
|
811
|
+
const width = element.innerWidth;
|
|
812
|
+
const height = element.innerHeight;
|
|
813
|
+
const rect = {
|
|
814
|
+
x: 0,
|
|
815
|
+
y: 0,
|
|
816
|
+
top: 0,
|
|
817
|
+
left: 0,
|
|
818
|
+
right: width,
|
|
819
|
+
bottom: height,
|
|
820
|
+
width,
|
|
821
|
+
height
|
|
822
|
+
};
|
|
823
|
+
return {
|
|
824
|
+
...rect,
|
|
825
|
+
toJSON: () => rect
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
return element.getBoundingClientRect();
|
|
829
|
+
}
|
|
830
|
+
function getScrollLeft(element) {
|
|
831
|
+
const left = "scrollLeft" in element ? element.scrollLeft : element.scrollX;
|
|
832
|
+
return Math.max(left, 0);
|
|
833
|
+
}
|
|
834
|
+
function getScrollTop(element) {
|
|
835
|
+
const top = "scrollTop" in element ? element.scrollTop : element.scrollY;
|
|
836
|
+
return Math.max(top, 0);
|
|
837
|
+
}
|
|
838
|
+
function inViewport(element) {
|
|
839
|
+
const { top, bottom, left, right } = getRect(element);
|
|
840
|
+
const { width, height } = getRect(window);
|
|
841
|
+
return left <= width && right >= 0 && top <= height && bottom >= 0;
|
|
842
|
+
}
|
|
843
|
+
function prettyJSONObject(jsonObject) {
|
|
844
|
+
return JSON.stringify(jsonObject, null, 2);
|
|
845
|
+
}
|
|
846
|
+
function preventDefault(event) {
|
|
847
|
+
if (event.cancelable === false) return;
|
|
848
|
+
event.preventDefault();
|
|
849
|
+
}
|
|
850
|
+
function raf() {
|
|
851
|
+
return new Promise((resolve) => {
|
|
852
|
+
requestAnimationFrame(resolve);
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
function createStorage(storage) {
|
|
856
|
+
return {
|
|
857
|
+
...storage,
|
|
858
|
+
set(key, value) {
|
|
859
|
+
if (value == null) return;
|
|
860
|
+
if (!isString(value)) value = JSON.stringify(value);
|
|
861
|
+
storage.setItem(key, value);
|
|
862
|
+
},
|
|
863
|
+
get(key) {
|
|
864
|
+
const data = storage.getItem(key);
|
|
865
|
+
try {
|
|
866
|
+
return JSON.parse(data);
|
|
867
|
+
} catch (err) {
|
|
868
|
+
return data;
|
|
869
|
+
}
|
|
870
|
+
},
|
|
871
|
+
remove(key) {
|
|
872
|
+
storage.removeItem(key);
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
function createCookieStorage(options = {}) {
|
|
877
|
+
const defaultOptions = options;
|
|
878
|
+
return {
|
|
879
|
+
set(key, value, options = {}) {
|
|
880
|
+
if (value == null) return;
|
|
881
|
+
if (!isString(value)) value = JSON.stringify(value);
|
|
882
|
+
api.set(key, value, {
|
|
883
|
+
...defaultOptions,
|
|
884
|
+
...options
|
|
885
|
+
});
|
|
886
|
+
},
|
|
887
|
+
get(key) {
|
|
888
|
+
const data = api.get(key);
|
|
889
|
+
try {
|
|
890
|
+
return JSON.parse(data);
|
|
891
|
+
} catch (err) {
|
|
892
|
+
return data;
|
|
893
|
+
}
|
|
894
|
+
},
|
|
895
|
+
remove(key, options = {}) {
|
|
896
|
+
api.remove(key, {
|
|
897
|
+
...defaultOptions,
|
|
898
|
+
...options
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
const sessionStorage = createStorage(getGlobalThis().sessionStorage);
|
|
904
|
+
const localStorage = createStorage(getGlobalThis().localStorage);
|
|
905
|
+
function tryParseJSON(json) {
|
|
906
|
+
try {
|
|
907
|
+
return JSON.parse(json);
|
|
908
|
+
} catch {
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
function download(val, filename = "file") {
|
|
913
|
+
const a = document.createElement("a");
|
|
914
|
+
a.style.display = "none";
|
|
915
|
+
a.href = isString(val) ? val : URL.createObjectURL(val);
|
|
916
|
+
a.download = filename;
|
|
917
|
+
document.body.appendChild(a);
|
|
918
|
+
a.click();
|
|
919
|
+
URL.revokeObjectURL(a.href);
|
|
920
|
+
document.body.removeChild(a);
|
|
921
|
+
}
|
|
922
|
+
function call(fn, ...args) {
|
|
923
|
+
if (isArray(fn)) return fn.map((f) => f(...args));
|
|
924
|
+
if (fn) return fn(...args);
|
|
925
|
+
}
|
|
926
|
+
function tryCall(fn, ...args) {
|
|
927
|
+
try {
|
|
928
|
+
return [void 0, fn(...args)];
|
|
929
|
+
} catch (e) {
|
|
930
|
+
return [e, void 0];
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
async function tryAsyncCall(fn, ...args) {
|
|
934
|
+
try {
|
|
935
|
+
return [void 0, await fn(...args)];
|
|
936
|
+
} catch (e) {
|
|
937
|
+
return [e, void 0];
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
function once(fn) {
|
|
941
|
+
let called = false;
|
|
942
|
+
let result;
|
|
943
|
+
return function(...args) {
|
|
944
|
+
if (called) return result;
|
|
945
|
+
called = true;
|
|
946
|
+
result = fn.apply(this, args);
|
|
947
|
+
return result;
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
function debounce(fn, delay = 0) {
|
|
951
|
+
let timer;
|
|
952
|
+
return function(...args) {
|
|
953
|
+
if (timer) clearTimeout(timer);
|
|
954
|
+
timer = setTimeout(() => {
|
|
955
|
+
fn.apply(this, args);
|
|
956
|
+
}, delay);
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
function throttle(fn, delay = 200) {
|
|
960
|
+
let timer;
|
|
961
|
+
let start = 0;
|
|
962
|
+
return function loop(...args) {
|
|
963
|
+
const now = performance.now();
|
|
964
|
+
const elapsed = now - start;
|
|
965
|
+
if (!start) start = now;
|
|
966
|
+
if (timer) clearTimeout(timer);
|
|
967
|
+
if (elapsed >= delay) {
|
|
968
|
+
fn.apply(this, args);
|
|
969
|
+
start = now;
|
|
970
|
+
} else timer = setTimeout(() => {
|
|
971
|
+
loop.apply(this, args);
|
|
972
|
+
}, delay - elapsed);
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
function NOOP() {}
|
|
976
|
+
function enumOf(config) {
|
|
977
|
+
const extractValues = Object.entries(config).reduce((result, [key, value]) => {
|
|
978
|
+
result[key] = isPlainObject(value) ? value.value : value;
|
|
979
|
+
return result;
|
|
980
|
+
}, {});
|
|
981
|
+
const configValues = Object.values(config);
|
|
982
|
+
function label(v) {
|
|
983
|
+
const valueObject = getValueObject(v);
|
|
984
|
+
return valueObject?.label ? callOrReturn(valueObject.label) : "";
|
|
985
|
+
}
|
|
986
|
+
function description(v) {
|
|
987
|
+
const valueObject = getValueObject(v);
|
|
988
|
+
return valueObject?.description ? callOrReturn(valueObject.description) : "";
|
|
989
|
+
}
|
|
990
|
+
function values() {
|
|
991
|
+
return configValues.map((option) => isPlainObject(option) ? option.value : option);
|
|
992
|
+
}
|
|
993
|
+
function labels() {
|
|
994
|
+
return configValues.map((option) => {
|
|
995
|
+
if (isPlainObject(option)) return option.label ? callOrReturn(option.label) : "";
|
|
996
|
+
return "";
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
function descriptions() {
|
|
1000
|
+
return configValues.map((option) => {
|
|
1001
|
+
if (isPlainObject(option)) return option.description ? callOrReturn(option.description) : "";
|
|
1002
|
+
return "";
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
function resolveOption(option) {
|
|
1006
|
+
const result = {};
|
|
1007
|
+
for (const key of Object.keys(option)) result[key] = callOrReturn(option[key]);
|
|
1008
|
+
return result;
|
|
1009
|
+
}
|
|
1010
|
+
function option(v) {
|
|
1011
|
+
const valueObject = getValueObject(v);
|
|
1012
|
+
if (valueObject) return resolveOption(valueObject);
|
|
1013
|
+
return {
|
|
1014
|
+
value: v,
|
|
1015
|
+
label: "",
|
|
1016
|
+
description: ""
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
function options() {
|
|
1020
|
+
return configValues.map((option) => {
|
|
1021
|
+
if (isPlainObject(option)) return resolveOption(option);
|
|
1022
|
+
return {
|
|
1023
|
+
value: option,
|
|
1024
|
+
label: "",
|
|
1025
|
+
description: ""
|
|
1026
|
+
};
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
function getValueObject(v) {
|
|
1030
|
+
return configValues.find((option) => isPlainObject(option) && option.value === v);
|
|
1031
|
+
}
|
|
1032
|
+
return {
|
|
1033
|
+
...extractValues,
|
|
1034
|
+
values,
|
|
1035
|
+
label,
|
|
1036
|
+
description,
|
|
1037
|
+
labels,
|
|
1038
|
+
descriptions,
|
|
1039
|
+
option,
|
|
1040
|
+
options
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
function motion(options) {
|
|
1044
|
+
const { from, to, duration = 300, frame = () => {}, timingFunction = (value) => value, onStateChange = () => {} } = options;
|
|
1045
|
+
let state = "pending";
|
|
1046
|
+
let value = from;
|
|
1047
|
+
const distance = to - from;
|
|
1048
|
+
let ticker = void 0;
|
|
1049
|
+
let startTime = void 0;
|
|
1050
|
+
let pausedTime = void 0;
|
|
1051
|
+
let sleepTime = 0;
|
|
1052
|
+
function start() {
|
|
1053
|
+
if (state === "running" || state === "finished") return;
|
|
1054
|
+
setState("running");
|
|
1055
|
+
const now = performance.now();
|
|
1056
|
+
startTime = startTime != null ? startTime : now;
|
|
1057
|
+
sleepTime += pausedTime != null ? now - pausedTime : 0;
|
|
1058
|
+
pausedTime = void 0;
|
|
1059
|
+
tick();
|
|
1060
|
+
function tick() {
|
|
1061
|
+
ticker = requestAnimationFrame(() => {
|
|
1062
|
+
const progress = clamp((performance.now() - startTime - sleepTime) / duration, 0, 1);
|
|
1063
|
+
value = distance * timingFunction(progress) + from;
|
|
1064
|
+
if (progress >= 1) {
|
|
1065
|
+
setState("finished");
|
|
1066
|
+
frame({
|
|
1067
|
+
value: to,
|
|
1068
|
+
done: true
|
|
1069
|
+
});
|
|
1070
|
+
return;
|
|
1071
|
+
}
|
|
1072
|
+
frame({
|
|
1073
|
+
value,
|
|
1074
|
+
done: false
|
|
1075
|
+
});
|
|
1076
|
+
tick();
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
function pause() {
|
|
1081
|
+
if (state !== "running") return;
|
|
1082
|
+
cancelAnimationFrame(ticker);
|
|
1083
|
+
setState("paused");
|
|
1084
|
+
pausedTime = performance.now();
|
|
1085
|
+
}
|
|
1086
|
+
function reset() {
|
|
1087
|
+
cancelAnimationFrame(ticker);
|
|
1088
|
+
setState("pending");
|
|
1089
|
+
value = from;
|
|
1090
|
+
ticker = void 0;
|
|
1091
|
+
startTime = void 0;
|
|
1092
|
+
pausedTime = void 0;
|
|
1093
|
+
sleepTime = 0;
|
|
1094
|
+
}
|
|
1095
|
+
function getState() {
|
|
1096
|
+
return state;
|
|
1097
|
+
}
|
|
1098
|
+
function setState(_state) {
|
|
1099
|
+
state = _state;
|
|
1100
|
+
onStateChange(_state);
|
|
1101
|
+
}
|
|
1102
|
+
return {
|
|
1103
|
+
start,
|
|
1104
|
+
pause,
|
|
1105
|
+
reset,
|
|
1106
|
+
getState
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1109
|
+
function duration() {
|
|
1110
|
+
const ctx = {
|
|
1111
|
+
value: 0,
|
|
1112
|
+
years,
|
|
1113
|
+
months,
|
|
1114
|
+
weeks,
|
|
1115
|
+
days,
|
|
1116
|
+
hours,
|
|
1117
|
+
minutes,
|
|
1118
|
+
seconds,
|
|
1119
|
+
milliseconds,
|
|
1120
|
+
valueOf
|
|
1121
|
+
};
|
|
1122
|
+
function years(value) {
|
|
1123
|
+
ctx.value += value * 365 * 24 * 60 * 60 * 1e3;
|
|
1124
|
+
return ctx;
|
|
1125
|
+
}
|
|
1126
|
+
function months(value) {
|
|
1127
|
+
ctx.value += value * 30 * 24 * 60 * 60 * 1e3;
|
|
1128
|
+
return ctx;
|
|
1129
|
+
}
|
|
1130
|
+
function weeks(value) {
|
|
1131
|
+
ctx.value += value * 7 * 24 * 60 * 60 * 1e3;
|
|
1132
|
+
return ctx;
|
|
1133
|
+
}
|
|
1134
|
+
function days(value) {
|
|
1135
|
+
ctx.value += value * 24 * 60 * 60 * 1e3;
|
|
1136
|
+
return ctx;
|
|
1137
|
+
}
|
|
1138
|
+
function hours(value) {
|
|
1139
|
+
ctx.value += value * 60 * 60 * 1e3;
|
|
1140
|
+
return ctx;
|
|
1141
|
+
}
|
|
1142
|
+
function minutes(value) {
|
|
1143
|
+
ctx.value += value * 60 * 1e3;
|
|
1144
|
+
return ctx;
|
|
1145
|
+
}
|
|
1146
|
+
function seconds(value) {
|
|
1147
|
+
ctx.value += value * 1e3;
|
|
1148
|
+
return ctx;
|
|
1149
|
+
}
|
|
1150
|
+
function milliseconds(value) {
|
|
1151
|
+
ctx.value += value;
|
|
1152
|
+
return ctx;
|
|
1153
|
+
}
|
|
1154
|
+
function valueOf(options = { milliseconds: true }) {
|
|
1155
|
+
return options.milliseconds ? ctx.value : ctx.value / 1e3;
|
|
1156
|
+
}
|
|
1157
|
+
return ctx;
|
|
1158
|
+
}
|
|
1159
|
+
function createCacheManager(options = {}) {
|
|
1160
|
+
const cacheManager = /* @__PURE__ */ new Map();
|
|
1161
|
+
const { ttl: defaultTtl = Infinity } = options;
|
|
1162
|
+
function purgeStale() {
|
|
1163
|
+
cacheManager.forEach((value, key) => {
|
|
1164
|
+
if (performance.now() > value.expiredAt) remove(key);
|
|
1165
|
+
});
|
|
1166
|
+
}
|
|
1167
|
+
function has(key) {
|
|
1168
|
+
purgeStale();
|
|
1169
|
+
return cacheManager.has(key);
|
|
1170
|
+
}
|
|
1171
|
+
function get(key) {
|
|
1172
|
+
purgeStale();
|
|
1173
|
+
return cacheManager.get(key)?.value;
|
|
1174
|
+
}
|
|
1175
|
+
function set(key, value, options) {
|
|
1176
|
+
const ttl = options?.ttl ?? defaultTtl;
|
|
1177
|
+
cacheManager.set(key, {
|
|
1178
|
+
expiredAt: performance.now() + ttl,
|
|
1179
|
+
value
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1182
|
+
function remove(key) {
|
|
1183
|
+
return cacheManager.delete(key);
|
|
1184
|
+
}
|
|
1185
|
+
function clear() {
|
|
1186
|
+
cacheManager.clear();
|
|
1187
|
+
}
|
|
1188
|
+
return {
|
|
1189
|
+
has,
|
|
1190
|
+
get,
|
|
1191
|
+
set,
|
|
1192
|
+
remove,
|
|
1193
|
+
clear
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
function buildNavigationUrl(target) {
|
|
1197
|
+
if (isString(target)) return target;
|
|
1198
|
+
const { to, query, hash } = target;
|
|
1199
|
+
const hashIndex = to.indexOf("#");
|
|
1200
|
+
const toWithoutHash = hashIndex >= 0 ? to.slice(0, hashIndex) : to;
|
|
1201
|
+
const existingHash = hashIndex >= 0 ? `#${to.slice(hashIndex + 1)}` : "";
|
|
1202
|
+
const queryIndex = toWithoutHash.indexOf("?");
|
|
1203
|
+
const base = queryIndex >= 0 ? toWithoutHash.slice(0, queryIndex) : toWithoutHash;
|
|
1204
|
+
const existingQueryString = queryIndex >= 0 ? toWithoutHash.slice(queryIndex + 1) : "";
|
|
1205
|
+
const params = new URLSearchParams(existingQueryString);
|
|
1206
|
+
if (query) for (const [key, value] of Object.entries(query)) params.append(key, String(value));
|
|
1207
|
+
const queryString = params.toString();
|
|
1208
|
+
const finalHash = hash ?? existingHash;
|
|
1209
|
+
let url = base;
|
|
1210
|
+
if (queryString) url += `?${queryString}`;
|
|
1211
|
+
if (finalHash) url += finalHash;
|
|
1212
|
+
return url;
|
|
1213
|
+
}
|
|
1214
|
+
const navigation = {
|
|
1215
|
+
push(target) {
|
|
1216
|
+
window.location.assign(buildNavigationUrl(target));
|
|
1217
|
+
},
|
|
1218
|
+
replace(target) {
|
|
1219
|
+
window.location.replace(buildNavigationUrl(target));
|
|
1220
|
+
},
|
|
1221
|
+
open(target) {
|
|
1222
|
+
const url = buildNavigationUrl(target);
|
|
1223
|
+
window.open(url);
|
|
1224
|
+
},
|
|
1225
|
+
back() {
|
|
1226
|
+
window.history.back();
|
|
1227
|
+
},
|
|
1228
|
+
go(delta) {
|
|
1229
|
+
window.history.go(delta);
|
|
1230
|
+
}
|
|
1231
|
+
};
|
|
1232
|
+
function cloneDeepWith(value, fn) {
|
|
1233
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
|
1234
|
+
function baseCloneDeep(value, cache) {
|
|
1235
|
+
const customResult = fn(value);
|
|
1236
|
+
if (customResult !== void 0) return customResult;
|
|
1237
|
+
if (!isObject(value)) return value;
|
|
1238
|
+
if (cache.has(value)) return cache.get(value);
|
|
1239
|
+
if (isDate(value)) return new Date(value);
|
|
1240
|
+
if (isRegExp(value)) return new RegExp(value);
|
|
1241
|
+
if (isMap(value)) {
|
|
1242
|
+
const result = /* @__PURE__ */ new Map();
|
|
1243
|
+
cache.set(value, result);
|
|
1244
|
+
value.forEach((val, key) => {
|
|
1245
|
+
result.set(baseCloneDeep(key, cache), baseCloneDeep(val, cache));
|
|
1246
|
+
});
|
|
1247
|
+
return result;
|
|
1248
|
+
}
|
|
1249
|
+
if (isSet(value)) {
|
|
1250
|
+
const result = /* @__PURE__ */ new Set();
|
|
1251
|
+
cache.set(value, result);
|
|
1252
|
+
value.forEach((val) => {
|
|
1253
|
+
result.add(baseCloneDeep(val, cache));
|
|
1254
|
+
});
|
|
1255
|
+
return result;
|
|
1256
|
+
}
|
|
1257
|
+
if (toRawType(value) === "String" || toRawType(value) === "Number" || toRawType(value) === "Boolean") return newConstructor(value, value.valueOf());
|
|
1258
|
+
if (isWeakMap(value) || isWeakSet(value) || isError(value) || isDOMException(value)) return {};
|
|
1259
|
+
if (isTypedArray(value)) return newConstructor(value, baseCloneArrayBuffer(value.buffer), value.byteOffset, value.length);
|
|
1260
|
+
if (isDataView(value)) return newConstructor(value, baseCloneArrayBuffer(value.buffer), value.byteOffset, value.byteLength);
|
|
1261
|
+
if (isArrayBuffer(value)) return baseCloneArrayBuffer(value);
|
|
1262
|
+
if (isArray(value)) {
|
|
1263
|
+
const result = [];
|
|
1264
|
+
cache.set(value, result);
|
|
1265
|
+
value.forEach((value, index) => {
|
|
1266
|
+
result[index] = baseCloneDeep(value, cache);
|
|
1267
|
+
});
|
|
1268
|
+
return result;
|
|
1269
|
+
}
|
|
1270
|
+
if (isPlainObject(value)) {
|
|
1271
|
+
const result = Object.create(Reflect.getPrototypeOf(value));
|
|
1272
|
+
cache.set(value, result);
|
|
1273
|
+
[...Object.keys(value), ...Object.getOwnPropertySymbols(value)].forEach((key) => {
|
|
1274
|
+
result[key] = baseCloneDeep(value[key], cache);
|
|
1275
|
+
});
|
|
1276
|
+
return result;
|
|
1277
|
+
}
|
|
1278
|
+
return value;
|
|
1279
|
+
}
|
|
1280
|
+
function baseCloneArrayBuffer(value) {
|
|
1281
|
+
const result = new ArrayBuffer(value.byteLength);
|
|
1282
|
+
new Uint8Array(result).set(new Uint8Array(value));
|
|
1283
|
+
return result;
|
|
1284
|
+
}
|
|
1285
|
+
function newConstructor(value, ...args) {
|
|
1286
|
+
return new value.constructor(...args);
|
|
1287
|
+
}
|
|
1288
|
+
return baseCloneDeep(value, cache);
|
|
1289
|
+
}
|
|
1290
|
+
function cloneDeep(value) {
|
|
1291
|
+
return cloneDeepWith(value, () => void 0);
|
|
1292
|
+
}
|
|
1293
|
+
function mergeWith(object, ...sources) {
|
|
1294
|
+
const fn = at(sources, -1);
|
|
1295
|
+
const targets = [object, ...sources.slice(0, -1)];
|
|
1296
|
+
let len = targets.length - 1;
|
|
1297
|
+
let result = targets[len];
|
|
1298
|
+
while (len) {
|
|
1299
|
+
result = baseMergeWith(targets[len - 1], result, fn);
|
|
1300
|
+
len--;
|
|
1301
|
+
}
|
|
1302
|
+
function baseMergeWith(object, source, fn) {
|
|
1303
|
+
function baseMerge(target, src) {
|
|
1304
|
+
for (const key in src) if (hasOwn(src, key)) {
|
|
1305
|
+
const srcValue = src[key];
|
|
1306
|
+
const targetValue = target[key];
|
|
1307
|
+
const customResult = fn(targetValue, srcValue, key, object, source);
|
|
1308
|
+
if (customResult !== void 0) target[key] = customResult;
|
|
1309
|
+
else if (isObject(srcValue)) if (isObject(targetValue)) target[key] = baseMerge(targetValue, srcValue);
|
|
1310
|
+
else target[key] = baseMerge(isArray(srcValue) ? [] : {}, srcValue);
|
|
1311
|
+
else target[key] = srcValue;
|
|
1312
|
+
}
|
|
1313
|
+
return target;
|
|
1314
|
+
}
|
|
1315
|
+
return baseMerge(object, source);
|
|
1316
|
+
}
|
|
1317
|
+
return result;
|
|
1318
|
+
}
|
|
1319
|
+
function merge(object, ...sources) {
|
|
1320
|
+
return mergeWith(object, ...sources, () => void 0);
|
|
1321
|
+
}
|
|
1322
|
+
function toArrayBuffer(file) {
|
|
1323
|
+
return new Promise((resolve) => {
|
|
1324
|
+
const fileReader = new FileReader();
|
|
1325
|
+
fileReader.onload = () => {
|
|
1326
|
+
resolve(fileReader.result);
|
|
1327
|
+
};
|
|
1328
|
+
fileReader.readAsArrayBuffer(file);
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1331
|
+
function toDataURL(file) {
|
|
1332
|
+
return new Promise((resolve) => {
|
|
1333
|
+
const fileReader = new FileReader();
|
|
1334
|
+
fileReader.onload = () => {
|
|
1335
|
+
resolve(fileReader.result);
|
|
1336
|
+
};
|
|
1337
|
+
fileReader.readAsDataURL(file);
|
|
1338
|
+
});
|
|
1339
|
+
}
|
|
1340
|
+
function toText(file) {
|
|
1341
|
+
return new Promise((resolve) => {
|
|
1342
|
+
const fileReader = new FileReader();
|
|
1343
|
+
fileReader.onload = () => {
|
|
1344
|
+
resolve(fileReader.result);
|
|
1345
|
+
};
|
|
1346
|
+
fileReader.readAsText(file);
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
function maxBy(arr, fn) {
|
|
1350
|
+
return arr.reduce((result, item) => fn(result) > fn(item) ? result : item, arr[0]);
|
|
1351
|
+
}
|
|
1352
|
+
function minBy(arr, fn) {
|
|
1353
|
+
return arr.reduce((result, item) => fn(result) < fn(item) ? result : item, arr[0]);
|
|
1354
|
+
}
|
|
1355
|
+
function sum(arr) {
|
|
1356
|
+
return arr.reduce((ret, val) => ret + val, 0);
|
|
1357
|
+
}
|
|
1358
|
+
function sumBy(arr, fn) {
|
|
1359
|
+
return arr.reduce((ret, val) => ret + fn(val), 0);
|
|
1360
|
+
}
|
|
1361
|
+
function sumHash(value) {
|
|
1362
|
+
function sum(hash, value) {
|
|
1363
|
+
for (let i = 0; i < value.length; i++) {
|
|
1364
|
+
const chr = value.charCodeAt(i);
|
|
1365
|
+
hash = (hash << 5) - hash + chr;
|
|
1366
|
+
hash |= 0;
|
|
1367
|
+
}
|
|
1368
|
+
return hash < 0 ? hash * -2 : hash;
|
|
1369
|
+
}
|
|
1370
|
+
function baseSumHash(hash, value, key, seen) {
|
|
1371
|
+
hash = sum(hash, key);
|
|
1372
|
+
hash = sum(hash, toTypeString(value));
|
|
1373
|
+
hash = sum(hash, typeof value);
|
|
1374
|
+
if (value === null) return sum(hash, "null");
|
|
1375
|
+
if (value === void 0) return sum(hash, "undefined");
|
|
1376
|
+
if (isObject(value) || isFunction(value)) {
|
|
1377
|
+
if (seen.includes(value)) return sum(hash, `[Circular]${key}`);
|
|
1378
|
+
seen.push(value);
|
|
1379
|
+
hash = Object.keys(value).sort().reduce((hash, key) => baseSumHash(hash, value[key], key, seen), hash);
|
|
1380
|
+
if (isFunction(value.valueOf)) return sum(hash, String(value.valueOf()));
|
|
1381
|
+
return hash;
|
|
1382
|
+
}
|
|
1383
|
+
return sum(hash, value.toString());
|
|
1384
|
+
}
|
|
1385
|
+
return baseSumHash(0, value, "", []).toString(16).padStart(8, "0");
|
|
1386
|
+
}
|
|
1387
|
+
function mean(arr) {
|
|
1388
|
+
return sum(arr) / arr.length;
|
|
1389
|
+
}
|
|
1390
|
+
function meanBy(arr, fn) {
|
|
1391
|
+
return sumBy(arr, fn) / arr.length;
|
|
1392
|
+
}
|
|
1393
|
+
function sample(arr) {
|
|
1394
|
+
if (!arr.length) return;
|
|
1395
|
+
return arr[randomNumber(0, arr.length - 1)];
|
|
1396
|
+
}
|
|
1397
|
+
function round(val, precision = 0) {
|
|
1398
|
+
return baseRound(val, precision, Math.round);
|
|
1399
|
+
}
|
|
1400
|
+
function baseRound(val, precision, fn) {
|
|
1401
|
+
precision = clamp(precision ?? 0, -292, 292);
|
|
1402
|
+
if (!precision) return fn(val);
|
|
1403
|
+
return +`${fn(`${val}e${precision}`)}e${-precision}`;
|
|
1404
|
+
}
|
|
1405
|
+
function floor(val, precision = 0) {
|
|
1406
|
+
return baseRound(val, precision, Math.floor);
|
|
1407
|
+
}
|
|
1408
|
+
function ceil(val, precision = 0) {
|
|
1409
|
+
return baseRound(val, precision, Math.ceil);
|
|
1410
|
+
}
|
|
1411
|
+
__reExport(/* @__PURE__ */ __exportAll({
|
|
1412
|
+
NOOP: () => NOOP,
|
|
1413
|
+
assert: () => assert$1,
|
|
1414
|
+
at: () => at,
|
|
1415
|
+
baseRound: () => baseRound,
|
|
1416
|
+
buildNavigationUrl: () => buildNavigationUrl,
|
|
1417
|
+
call: () => call,
|
|
1418
|
+
callOrReturn: () => callOrReturn,
|
|
1419
|
+
camelize: () => camelize,
|
|
1420
|
+
cancelAnimationFrame: () => cancelAnimationFrame,
|
|
1421
|
+
ceil: () => ceil,
|
|
1422
|
+
chunk: () => chunk,
|
|
1423
|
+
clamp: () => clamp,
|
|
1424
|
+
clampArrayRange: () => clampArrayRange,
|
|
1425
|
+
classes: () => classes,
|
|
1426
|
+
cloneDeep: () => cloneDeep,
|
|
1427
|
+
cloneDeepWith: () => cloneDeepWith,
|
|
1428
|
+
copyText: () => copyText,
|
|
1429
|
+
createCacheManager: () => createCacheManager,
|
|
1430
|
+
createCookieStorage: () => createCookieStorage,
|
|
1431
|
+
createNamespaceFn: () => createNamespaceFn,
|
|
1432
|
+
createStorage: () => createStorage,
|
|
1433
|
+
debounce: () => debounce,
|
|
1434
|
+
delay: () => delay,
|
|
1435
|
+
difference: () => difference,
|
|
1436
|
+
differenceWith: () => differenceWith,
|
|
1437
|
+
doubleRaf: () => doubleRaf,
|
|
1438
|
+
download: () => download,
|
|
1439
|
+
duration: () => duration,
|
|
1440
|
+
ensurePrefix: () => ensurePrefix,
|
|
1441
|
+
ensureSuffix: () => ensureSuffix,
|
|
1442
|
+
enumOf: () => enumOf,
|
|
1443
|
+
find: () => find,
|
|
1444
|
+
floor: () => floor,
|
|
1445
|
+
genNumberKey: () => genNumberKey,
|
|
1446
|
+
genStringKey: () => genStringKey,
|
|
1447
|
+
getAllParentScroller: () => getAllParentScroller,
|
|
1448
|
+
getGlobalThis: () => getGlobalThis,
|
|
1449
|
+
getParentScroller: () => getParentScroller,
|
|
1450
|
+
getRect: () => getRect,
|
|
1451
|
+
getScrollLeft: () => getScrollLeft,
|
|
1452
|
+
getScrollTop: () => getScrollTop,
|
|
1453
|
+
getStyle: () => getStyle,
|
|
1454
|
+
groupBy: () => groupBy,
|
|
1455
|
+
hasDuplicates: () => hasDuplicates,
|
|
1456
|
+
hasDuplicatesBy: () => hasDuplicatesBy,
|
|
1457
|
+
hasOwn: () => hasOwn,
|
|
1458
|
+
inBrowser: () => inBrowser,
|
|
1459
|
+
inMobile: () => inMobile,
|
|
1460
|
+
inViewport: () => inViewport,
|
|
1461
|
+
intersection: () => intersection,
|
|
1462
|
+
intersectionWith: () => intersectionWith,
|
|
1463
|
+
isArray: () => isArray,
|
|
1464
|
+
isArrayBuffer: () => isArrayBuffer,
|
|
1465
|
+
isBlob: () => isBlob,
|
|
1466
|
+
isBoolean: () => isBoolean,
|
|
1467
|
+
isDOMException: () => isDOMException,
|
|
1468
|
+
isDataView: () => isDataView,
|
|
1469
|
+
isDate: () => isDate,
|
|
1470
|
+
isEmpty: () => isEmpty,
|
|
1471
|
+
isEmptyPlainObject: () => isEmptyPlainObject,
|
|
1472
|
+
isEqual: () => isEqual,
|
|
1473
|
+
isEqualWith: () => isEqualWith,
|
|
1474
|
+
isError: () => isError,
|
|
1475
|
+
isFile: () => isFile,
|
|
1476
|
+
isFunction: () => isFunction,
|
|
1477
|
+
isMap: () => isMap,
|
|
1478
|
+
isNonEmptyArray: () => isNonEmptyArray,
|
|
1479
|
+
isNullish: () => isNullish,
|
|
1480
|
+
isNumber: () => isNumber,
|
|
1481
|
+
isNumeric: () => isNumeric,
|
|
1482
|
+
isObject: () => isObject,
|
|
1483
|
+
isPlainObject: () => isPlainObject,
|
|
1484
|
+
isPrimitive: () => isPrimitive,
|
|
1485
|
+
isPromise: () => isPromise,
|
|
1486
|
+
isRegExp: () => isRegExp,
|
|
1487
|
+
isSet: () => isSet,
|
|
1488
|
+
isString: () => isString,
|
|
1489
|
+
isSymbol: () => isSymbol,
|
|
1490
|
+
isTruthy: () => isTruthy,
|
|
1491
|
+
isTypedArray: () => isTypedArray,
|
|
1492
|
+
isWeakMap: () => isWeakMap,
|
|
1493
|
+
isWeakSet: () => isWeakSet,
|
|
1494
|
+
isWindow: () => isWindow,
|
|
1495
|
+
kebabCase: () => kebabCase,
|
|
1496
|
+
localStorage: () => localStorage,
|
|
1497
|
+
lowerFirst: () => lowerFirst,
|
|
1498
|
+
mapObject: () => mapObject,
|
|
1499
|
+
maskString: () => maskString,
|
|
1500
|
+
maxBy: () => maxBy,
|
|
1501
|
+
mean: () => mean,
|
|
1502
|
+
meanBy: () => meanBy,
|
|
1503
|
+
merge: () => merge,
|
|
1504
|
+
mergeWith: () => mergeWith,
|
|
1505
|
+
minBy: () => minBy,
|
|
1506
|
+
mitt: () => mitt_default,
|
|
1507
|
+
motion: () => motion,
|
|
1508
|
+
navigation: () => navigation,
|
|
1509
|
+
normalizeToArray: () => normalizeToArray,
|
|
1510
|
+
objectEntries: () => objectEntries,
|
|
1511
|
+
objectKeys: () => objectKeys,
|
|
1512
|
+
objectToString: () => objectToString,
|
|
1513
|
+
omit: () => omit,
|
|
1514
|
+
omitBy: () => omitBy,
|
|
1515
|
+
once: () => once,
|
|
1516
|
+
pascalCase: () => pascalCase,
|
|
1517
|
+
pick: () => pick,
|
|
1518
|
+
pickBy: () => pickBy,
|
|
1519
|
+
prettyJSONObject: () => prettyJSONObject,
|
|
1520
|
+
preventDefault: () => preventDefault,
|
|
1521
|
+
promiseWithResolvers: () => promiseWithResolvers,
|
|
1522
|
+
raf: () => raf,
|
|
1523
|
+
randomColor: () => randomColor,
|
|
1524
|
+
randomNumber: () => randomNumber,
|
|
1525
|
+
randomString: () => randomString,
|
|
1526
|
+
removeArrayBlank: () => removeArrayBlank,
|
|
1527
|
+
removeArrayEmpty: () => removeArrayEmpty,
|
|
1528
|
+
removeItem: () => removeItem,
|
|
1529
|
+
removeItemBy: () => removeItemBy,
|
|
1530
|
+
removeItemsBy: () => removeItemsBy,
|
|
1531
|
+
requestAnimationFrame: () => requestAnimationFrame,
|
|
1532
|
+
round: () => round,
|
|
1533
|
+
sample: () => sample,
|
|
1534
|
+
sessionStorage: () => sessionStorage,
|
|
1535
|
+
set: () => set,
|
|
1536
|
+
shuffle: () => shuffle,
|
|
1537
|
+
slash: () => slash,
|
|
1538
|
+
sum: () => sum,
|
|
1539
|
+
sumBy: () => sumBy,
|
|
1540
|
+
sumHash: () => sumHash,
|
|
1541
|
+
supportTouch: () => supportTouch,
|
|
1542
|
+
throttle: () => throttle,
|
|
1543
|
+
times: () => times,
|
|
1544
|
+
toArrayBuffer: () => toArrayBuffer,
|
|
1545
|
+
toDataURL: () => toDataURL,
|
|
1546
|
+
toNumber: () => toNumber,
|
|
1547
|
+
toRawType: () => toRawType,
|
|
1548
|
+
toText: () => toText,
|
|
1549
|
+
toTypeString: () => toTypeString,
|
|
1550
|
+
toggleItem: () => toggleItem,
|
|
1551
|
+
tryAsyncCall: () => tryAsyncCall,
|
|
1552
|
+
tryCall: () => tryCall,
|
|
1553
|
+
tryParseJSON: () => tryParseJSON,
|
|
1554
|
+
uniq: () => uniq,
|
|
1555
|
+
uniqBy: () => uniqBy,
|
|
1556
|
+
upperFirst: () => upperFirst,
|
|
1557
|
+
uuid: () => v4,
|
|
1558
|
+
uuidV6: () => v6,
|
|
1559
|
+
xor: () => xor,
|
|
1560
|
+
xorWith: () => xorWith
|
|
1561
|
+
}), integrated_exports);
|
|
1562
|
+
//#endregion
|
|
1563
|
+
//#region src/index.ts
|
|
32
1564
|
function assert(condition, source, message) {
|
|
33
|
-
|
|
1565
|
+
return assert$1(condition, `Varlet [${source}]: ${message}`);
|
|
34
1566
|
}
|
|
35
1567
|
function warn(source, message) {
|
|
36
|
-
|
|
1568
|
+
console.warn(`Varlet [${source}]: ${message}`);
|
|
37
1569
|
}
|
|
38
1570
|
function error(source, message) {
|
|
39
|
-
|
|
1571
|
+
console.error(`Varlet [${source}]: ${message}`);
|
|
40
1572
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
return /^(http)|(\.*\/)/.test(val);
|
|
1573
|
+
const isURL = (val) => {
|
|
1574
|
+
if (!val) return false;
|
|
1575
|
+
return /^(http)|(\.*\/)/.test(val);
|
|
46
1576
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
1577
|
+
//#endregion
|
|
1578
|
+
exports.NOOP = NOOP;
|
|
1579
|
+
exports.assert = assert;
|
|
1580
|
+
exports.at = at;
|
|
1581
|
+
exports.baseRound = baseRound;
|
|
1582
|
+
exports.buildNavigationUrl = buildNavigationUrl;
|
|
1583
|
+
exports.call = call;
|
|
1584
|
+
exports.callOrReturn = callOrReturn;
|
|
1585
|
+
exports.camelize = camelize;
|
|
1586
|
+
exports.cancelAnimationFrame = cancelAnimationFrame;
|
|
1587
|
+
exports.ceil = ceil;
|
|
1588
|
+
exports.chunk = chunk;
|
|
1589
|
+
exports.clamp = clamp;
|
|
1590
|
+
exports.clampArrayRange = clampArrayRange;
|
|
1591
|
+
exports.classes = classes;
|
|
1592
|
+
exports.cloneDeep = cloneDeep;
|
|
1593
|
+
exports.cloneDeepWith = cloneDeepWith;
|
|
1594
|
+
exports.copyText = copyText;
|
|
1595
|
+
exports.createCacheManager = createCacheManager;
|
|
1596
|
+
exports.createCookieStorage = createCookieStorage;
|
|
1597
|
+
exports.createNamespaceFn = createNamespaceFn;
|
|
1598
|
+
exports.createStorage = createStorage;
|
|
1599
|
+
exports.debounce = debounce;
|
|
1600
|
+
exports.delay = delay;
|
|
1601
|
+
exports.difference = difference;
|
|
1602
|
+
exports.differenceWith = differenceWith;
|
|
1603
|
+
exports.doubleRaf = doubleRaf;
|
|
1604
|
+
exports.download = download;
|
|
1605
|
+
exports.duration = duration;
|
|
1606
|
+
exports.ensurePrefix = ensurePrefix;
|
|
1607
|
+
exports.ensureSuffix = ensureSuffix;
|
|
1608
|
+
exports.enumOf = enumOf;
|
|
1609
|
+
exports.error = error;
|
|
1610
|
+
exports.find = find;
|
|
1611
|
+
exports.floor = floor;
|
|
1612
|
+
exports.genNumberKey = genNumberKey;
|
|
1613
|
+
exports.genStringKey = genStringKey;
|
|
1614
|
+
exports.getAllParentScroller = getAllParentScroller;
|
|
1615
|
+
exports.getGlobalThis = getGlobalThis;
|
|
1616
|
+
exports.getParentScroller = getParentScroller;
|
|
1617
|
+
exports.getRect = getRect;
|
|
1618
|
+
exports.getScrollLeft = getScrollLeft;
|
|
1619
|
+
exports.getScrollTop = getScrollTop;
|
|
1620
|
+
exports.getStyle = getStyle;
|
|
1621
|
+
exports.groupBy = groupBy;
|
|
1622
|
+
exports.hasDuplicates = hasDuplicates;
|
|
1623
|
+
exports.hasDuplicatesBy = hasDuplicatesBy;
|
|
1624
|
+
exports.hasOwn = hasOwn;
|
|
1625
|
+
exports.inBrowser = inBrowser;
|
|
1626
|
+
exports.inMobile = inMobile;
|
|
1627
|
+
exports.inViewport = inViewport;
|
|
1628
|
+
exports.intersection = intersection;
|
|
1629
|
+
exports.intersectionWith = intersectionWith;
|
|
1630
|
+
exports.isArray = isArray;
|
|
1631
|
+
exports.isArrayBuffer = isArrayBuffer;
|
|
1632
|
+
exports.isBlob = isBlob;
|
|
1633
|
+
exports.isBoolean = isBoolean;
|
|
1634
|
+
exports.isDOMException = isDOMException;
|
|
1635
|
+
exports.isDataView = isDataView;
|
|
1636
|
+
exports.isDate = isDate;
|
|
1637
|
+
exports.isEmpty = isEmpty;
|
|
1638
|
+
exports.isEmptyPlainObject = isEmptyPlainObject;
|
|
1639
|
+
exports.isEqual = isEqual;
|
|
1640
|
+
exports.isEqualWith = isEqualWith;
|
|
1641
|
+
exports.isError = isError;
|
|
1642
|
+
exports.isFile = isFile;
|
|
1643
|
+
exports.isFunction = isFunction;
|
|
1644
|
+
exports.isMap = isMap;
|
|
1645
|
+
exports.isNonEmptyArray = isNonEmptyArray;
|
|
1646
|
+
exports.isNullish = isNullish;
|
|
1647
|
+
exports.isNumber = isNumber;
|
|
1648
|
+
exports.isNumeric = isNumeric;
|
|
1649
|
+
exports.isObject = isObject;
|
|
1650
|
+
exports.isPlainObject = isPlainObject;
|
|
1651
|
+
exports.isPrimitive = isPrimitive;
|
|
1652
|
+
exports.isPromise = isPromise;
|
|
1653
|
+
exports.isRegExp = isRegExp;
|
|
1654
|
+
exports.isSet = isSet;
|
|
1655
|
+
exports.isString = isString;
|
|
1656
|
+
exports.isSymbol = isSymbol;
|
|
1657
|
+
exports.isTruthy = isTruthy;
|
|
1658
|
+
exports.isTypedArray = isTypedArray;
|
|
1659
|
+
exports.isURL = isURL;
|
|
1660
|
+
exports.isWeakMap = isWeakMap;
|
|
1661
|
+
exports.isWeakSet = isWeakSet;
|
|
1662
|
+
exports.isWindow = isWindow;
|
|
1663
|
+
exports.kebabCase = kebabCase;
|
|
1664
|
+
exports.localStorage = localStorage;
|
|
1665
|
+
exports.lowerFirst = lowerFirst;
|
|
1666
|
+
exports.mapObject = mapObject;
|
|
1667
|
+
exports.maskString = maskString;
|
|
1668
|
+
exports.maxBy = maxBy;
|
|
1669
|
+
exports.mean = mean;
|
|
1670
|
+
exports.meanBy = meanBy;
|
|
1671
|
+
exports.merge = merge;
|
|
1672
|
+
exports.mergeWith = mergeWith;
|
|
1673
|
+
exports.minBy = minBy;
|
|
1674
|
+
exports.mitt = mitt_default;
|
|
1675
|
+
exports.motion = motion;
|
|
1676
|
+
exports.navigation = navigation;
|
|
1677
|
+
exports.normalizeToArray = normalizeToArray;
|
|
1678
|
+
exports.objectEntries = objectEntries;
|
|
1679
|
+
exports.objectKeys = objectKeys;
|
|
1680
|
+
exports.objectToString = objectToString;
|
|
1681
|
+
exports.omit = omit;
|
|
1682
|
+
exports.omitBy = omitBy;
|
|
1683
|
+
exports.once = once;
|
|
1684
|
+
exports.pascalCase = pascalCase;
|
|
1685
|
+
exports.pick = pick;
|
|
1686
|
+
exports.pickBy = pickBy;
|
|
1687
|
+
exports.prettyJSONObject = prettyJSONObject;
|
|
1688
|
+
exports.preventDefault = preventDefault;
|
|
1689
|
+
exports.promiseWithResolvers = promiseWithResolvers;
|
|
1690
|
+
exports.raf = raf;
|
|
1691
|
+
exports.randomColor = randomColor;
|
|
1692
|
+
exports.randomNumber = randomNumber;
|
|
1693
|
+
exports.randomString = randomString;
|
|
1694
|
+
exports.removeArrayBlank = removeArrayBlank;
|
|
1695
|
+
exports.removeArrayEmpty = removeArrayEmpty;
|
|
1696
|
+
exports.removeItem = removeItem;
|
|
1697
|
+
exports.removeItemBy = removeItemBy;
|
|
1698
|
+
exports.removeItemsBy = removeItemsBy;
|
|
1699
|
+
exports.requestAnimationFrame = requestAnimationFrame;
|
|
1700
|
+
exports.round = round;
|
|
1701
|
+
exports.sample = sample;
|
|
1702
|
+
exports.sessionStorage = sessionStorage;
|
|
1703
|
+
exports.set = set;
|
|
1704
|
+
exports.shuffle = shuffle;
|
|
1705
|
+
exports.slash = slash;
|
|
1706
|
+
exports.sum = sum;
|
|
1707
|
+
exports.sumBy = sumBy;
|
|
1708
|
+
exports.sumHash = sumHash;
|
|
1709
|
+
exports.supportTouch = supportTouch;
|
|
1710
|
+
exports.throttle = throttle;
|
|
1711
|
+
exports.times = times;
|
|
1712
|
+
exports.toArrayBuffer = toArrayBuffer;
|
|
1713
|
+
exports.toDataURL = toDataURL;
|
|
1714
|
+
exports.toNumber = toNumber;
|
|
1715
|
+
exports.toRawType = toRawType;
|
|
1716
|
+
exports.toText = toText;
|
|
1717
|
+
exports.toTypeString = toTypeString;
|
|
1718
|
+
exports.toggleItem = toggleItem;
|
|
1719
|
+
exports.tryAsyncCall = tryAsyncCall;
|
|
1720
|
+
exports.tryCall = tryCall;
|
|
1721
|
+
exports.tryParseJSON = tryParseJSON;
|
|
1722
|
+
exports.uniq = uniq;
|
|
1723
|
+
exports.uniqBy = uniqBy;
|
|
1724
|
+
exports.upperFirst = upperFirst;
|
|
1725
|
+
exports.uuid = v4;
|
|
1726
|
+
exports.uuidV6 = v6;
|
|
1727
|
+
exports.warn = warn;
|
|
1728
|
+
exports.xor = xor;
|
|
1729
|
+
exports.xorWith = xorWith;
|