@gx-design-vue/pro-utils 0.2.0-beta.5 → 0.2.0-beta.51

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.
@@ -0,0 +1,872 @@
1
+ import { Comment as q, Fragment as M, isVNode as x } from "vue";
2
+ function J(e, t) {
3
+ return Object.prototype.toString.call(e) === `[object ${t}]`;
4
+ }
5
+ function $(e) {
6
+ return typeof e == "boolean";
7
+ }
8
+ function y(e) {
9
+ return typeof e == "number";
10
+ }
11
+ function a(e) {
12
+ return typeof Array.isArray > "u" ? Object.prototype.toString.call(e) === "[object Array]" : Array.isArray(e);
13
+ }
14
+ function d(e) {
15
+ return e !== null && J(e, "Object");
16
+ }
17
+ function X(e) {
18
+ return typeof e == "string" || e instanceof String;
19
+ }
20
+ function ge(e) {
21
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Function]";
22
+ }
23
+ function we(e) {
24
+ if (typeof e != "string")
25
+ return !1;
26
+ try {
27
+ const t = JSON.parse(e);
28
+ return typeof t == "object" && t !== null;
29
+ } catch {
30
+ return !1;
31
+ }
32
+ }
33
+ function me() {
34
+ const e = navigator.userAgent || navigator.vendor;
35
+ return !!(/iPhone/.test(e) || /Android/.test(e) && /Mobile/.test(e) || /Windows Phone/.test(e) || /Mobile/.test(e) && !Z());
36
+ }
37
+ function Z() {
38
+ const e = navigator.userAgent || navigator.vendor;
39
+ return !!(/iPad/.test(e) || /Macintosh/.test(e) && "ontouchend" in document || /Android/.test(e) && !/Mobile/.test(e));
40
+ }
41
+ function Y(...e) {
42
+ const t = [];
43
+ for (let r = 0; r < e.length; r++) {
44
+ const n = e[r];
45
+ if (n) {
46
+ if (X(n))
47
+ t.push(n);
48
+ else if (a(n))
49
+ for (let i = 0; i < n.length; i++) {
50
+ const o = Y(n[i]);
51
+ o && t.push(o);
52
+ }
53
+ else if (d(n))
54
+ for (const i in n)
55
+ n[i] && t.push(i);
56
+ }
57
+ }
58
+ return t.filter((r) => r).join(" ");
59
+ }
60
+ function V(e, t) {
61
+ if (typeof t != "string" && !Array.isArray(t))
62
+ return;
63
+ const r = Array.isArray(t) ? t : t.split(":");
64
+ let n = e;
65
+ for (let i = 0; i < r.length; i++)
66
+ if (n && n.hasOwnProperty(r[i]))
67
+ n = n[r[i]];
68
+ else
69
+ return;
70
+ return n;
71
+ }
72
+ function he(e) {
73
+ return /\w.(png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e);
74
+ }
75
+ const xe = (e) => e == null, A = typeof window > "u", Ae = (e) => {
76
+ if (!e || !e.startsWith("http"))
77
+ return !1;
78
+ try {
79
+ return !!new URL(e);
80
+ } catch {
81
+ return !1;
82
+ }
83
+ }, ve = (...e) => {
84
+ const t = {}, r = e.length;
85
+ let n, i = 0;
86
+ for (; i < r; i += 1)
87
+ for (n in e[i])
88
+ e[i].hasOwnProperty(n) && (typeof t[n] == "object" && typeof e[i][n] == "object" && t[n] !== void 0 && t[n] !== null && !Array.isArray(t[n]) && !Array.isArray(e[i][n]) ? t[n] = {
89
+ ...t[n],
90
+ ...e[i][n]
91
+ } : t[n] = e[i][n]);
92
+ return t;
93
+ }, G = (e, t) => {
94
+ if (typeof e != "object" || e === null)
95
+ throw new Error("Target must be an object");
96
+ for (const r in t)
97
+ if (Object.prototype.hasOwnProperty.call(t, r)) {
98
+ const n = r, i = t[n], o = e[n];
99
+ Array.isArray(i) ? e[n] = [...i] : typeof i == "object" && i !== null && typeof o == "object" && o !== null ? e[n] = G(o, i) : i !== void 0 && (e[n] = i);
100
+ }
101
+ return e;
102
+ };
103
+ let F = 0;
104
+ const B = (e = 21) => {
105
+ if (typeof window > "u" || !window.crypto)
106
+ return (F += 1).toFixed(0);
107
+ let t = "";
108
+ const r = crypto.getRandomValues(new Uint8Array(e));
109
+ for (; e--; ) {
110
+ const n = 63 & r[e];
111
+ t += n < 36 ? n.toString(36) : n < 62 ? (n - 26).toString(36).toUpperCase() : n < 63 ? "_" : "-";
112
+ }
113
+ return t;
114
+ }, Oe = () => typeof window > "u" ? B() : window.crypto && window.crypto.randomUUID && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : B();
115
+ /**
116
+ * @vue/shared v3.5.13
117
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
118
+ * @license MIT
119
+ **/
120
+ process.env.NODE_ENV !== "production" && Object.freeze({});
121
+ process.env.NODE_ENV !== "production" && Object.freeze([]);
122
+ const Q = (e) => {
123
+ const t = /* @__PURE__ */ Object.create(null);
124
+ return (r) => t[r] || (t[r] = e(r));
125
+ }, b = /-(\w)/g, K = Q(
126
+ (e) => e.replace(b, (t, r) => r ? r.toUpperCase() : "")
127
+ ), O = function(e, t) {
128
+ var r;
129
+ if (A || !e || !t)
130
+ return "";
131
+ t = K(t), t === "float" && (t = "cssFloat");
132
+ try {
133
+ const n = e.style[t];
134
+ if (n)
135
+ return n;
136
+ const i = (r = document == null ? void 0 : document.defaultView) == null ? void 0 : r.getComputedStyle(e, "");
137
+ return i ? i[t] : "";
138
+ } catch {
139
+ return e.style[t];
140
+ }
141
+ }, j = (e, t) => A ? void 0 : (t == null ? O(e, "overflow") : t ? O(e, "overflow-y") : O(e, "overflow-x")).match(/(scroll|auto|overlay)/), Se = (e, t) => {
142
+ if (A)
143
+ return;
144
+ let r = e;
145
+ for (; r; ) {
146
+ if ([window, document, document.documentElement].includes(r))
147
+ return window;
148
+ if (j(r, t))
149
+ return r;
150
+ r = r.parentNode;
151
+ }
152
+ return r;
153
+ }, Ee = (e, t) => {
154
+ if (A || !e || !t)
155
+ return !1;
156
+ const r = e.getBoundingClientRect();
157
+ let n;
158
+ return [window, document, document.documentElement, null, void 0].includes(t) ? n = {
159
+ top: 0,
160
+ right: window.innerWidth,
161
+ bottom: window.innerHeight,
162
+ left: 0
163
+ } : n = t.getBoundingClientRect(), r.top < n.bottom && r.bottom > n.top && r.right > n.left && r.left < n.right;
164
+ };
165
+ function E(e) {
166
+ return e != null && e === e.window;
167
+ }
168
+ function k(e, t) {
169
+ var i;
170
+ if (typeof window > "u")
171
+ return 0;
172
+ const r = t ? "scrollTop" : "scrollLeft";
173
+ let n = 0;
174
+ return E(e) ? n = e[t ? "pageYOffset" : "pageXOffset"] : e instanceof Document ? n = e.documentElement[r] : e && (n = e[r]), e && !E(e) && typeof n != "number" && (n = (i = (e.ownerDocument || e).documentElement) == null ? void 0 : i[r]), n;
175
+ }
176
+ function ee(e, t, r, n) {
177
+ const i = r - t;
178
+ return e /= n / 2, e < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t;
179
+ }
180
+ let N = (e) => setTimeout(e, 16), z = (e) => clearTimeout(e);
181
+ typeof window < "u" && "requestAnimationFrame" in window && (N = (e) => window.requestAnimationFrame(e), z = (e) => window.cancelAnimationFrame(e));
182
+ let L = 0;
183
+ const I = /* @__PURE__ */ new Map();
184
+ function W(e) {
185
+ I.delete(e);
186
+ }
187
+ function R(e, t = 1) {
188
+ L += 1;
189
+ const r = L;
190
+ function n(i) {
191
+ if (i === 0)
192
+ W(r), e();
193
+ else {
194
+ const o = N(() => {
195
+ n(i - 1);
196
+ });
197
+ I.set(r, o);
198
+ }
199
+ }
200
+ return n(t), r;
201
+ }
202
+ R.cancel = (e) => {
203
+ const t = I.get(e);
204
+ return W(t), z(t);
205
+ };
206
+ function Re(e, t = {}) {
207
+ const { getContainer: r = () => window, callback: n, duration: i = 450 } = t, o = r(), f = k(o, !0), u = Date.now(), c = () => {
208
+ const l = Date.now() - u, g = ee(l > i ? i : l, f, e, i);
209
+ E(o) ? o.scrollTo(window.pageXOffset, g) : o instanceof HTMLDocument || o.constructor.name === "HTMLDocument" ? o.documentElement.scrollTop = g : o.scrollTop = g, l < i ? R(c) : typeof n == "function" && n();
210
+ };
211
+ o && R(c);
212
+ }
213
+ function Te(e) {
214
+ let t;
215
+ const r = (i) => () => {
216
+ t = null, e(...i);
217
+ }, n = (...i) => {
218
+ t == null && (t = requestAnimationFrame(r(i)));
219
+ };
220
+ return n.cancel = () => cancelAnimationFrame(t), n;
221
+ }
222
+ const h = {
223
+ videoAllowType: [
224
+ "mp4",
225
+ "webm",
226
+ "ogg"
227
+ ],
228
+ audioAllowType: ["mp3"],
229
+ imageType: ["bmp", "png", "gif", "jpg", "jpeg", "psd", "tif"],
230
+ videoType: [
231
+ "mp4",
232
+ "swf",
233
+ "rmvb",
234
+ "avi",
235
+ "flv",
236
+ "mpg",
237
+ "rm",
238
+ "mov",
239
+ "asf",
240
+ "3gp",
241
+ "mkv",
242
+ "ts",
243
+ "f4v",
244
+ "webm",
245
+ "m4v",
246
+ "3g2",
247
+ "m3u8"
248
+ ],
249
+ audioType: ["mp3", "mpeg", "aac", "wav", "wma", "mp2", "flac", "midi", "ra", "ape", "aac", "cda"]
250
+ };
251
+ function te(e) {
252
+ return Object.getOwnPropertySymbols(e).filter((t) => Object.prototype.propertyIsEnumerable.call(e, t));
253
+ }
254
+ function ne(e) {
255
+ return e == null || typeof e != "object" && typeof e != "function";
256
+ }
257
+ function re(e) {
258
+ return ArrayBuffer.isView(e) && !(e instanceof DataView);
259
+ }
260
+ function v(e) {
261
+ return p(e);
262
+ }
263
+ function p(e, t = /* @__PURE__ */ new Map()) {
264
+ if (ne(e))
265
+ return e;
266
+ if (t.has(e))
267
+ return t.get(e);
268
+ if (Array.isArray(e)) {
269
+ const r = Array.from({ length: e.length });
270
+ t.set(e, r);
271
+ for (let n = 0; n < e.length; n++)
272
+ r[n] = p(e[n], t);
273
+ return Object.prototype.hasOwnProperty.call(e, "index") && (r.index = e.index), Object.prototype.hasOwnProperty.call(e, "input") && (r.input = e.input), r;
274
+ }
275
+ if (e instanceof Date)
276
+ return new Date(e.getTime());
277
+ if (e instanceof RegExp) {
278
+ const r = new RegExp(e.source, e.flags);
279
+ return r.lastIndex = e.lastIndex, r;
280
+ }
281
+ if (e instanceof Map) {
282
+ const r = /* @__PURE__ */ new Map();
283
+ t.set(e, r);
284
+ for (const [n, i] of e)
285
+ r.set(n, p(i, t));
286
+ return r;
287
+ }
288
+ if (e instanceof Set) {
289
+ const r = /* @__PURE__ */ new Set();
290
+ t.set(e, r);
291
+ for (const n of e)
292
+ r.add(p(n, t));
293
+ return r;
294
+ }
295
+ if (typeof Buffer < "u" && Buffer.isBuffer(e))
296
+ return e.subarray();
297
+ if (re(e)) {
298
+ const r = new (Object.getPrototypeOf(e)).constructor(e.length);
299
+ t.set(e, r);
300
+ for (let n = 0; n < e.length; n++)
301
+ r[n] = p(e[n], t);
302
+ return r;
303
+ }
304
+ if (e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer)
305
+ return e.slice(0);
306
+ if (e instanceof DataView) {
307
+ const r = new DataView(e.buffer.slice(0), e.byteOffset, e.byteLength);
308
+ return t.set(e, r), w(r, e, t), r;
309
+ }
310
+ if (typeof File < "u" && e instanceof File) {
311
+ const r = new File([e], e.name, { type: e.type });
312
+ return t.set(e, r), w(r, e, t), r;
313
+ }
314
+ if (e instanceof Blob) {
315
+ const r = new Blob([e], { type: e.type });
316
+ return t.set(e, r), w(r, e, t), r;
317
+ }
318
+ if (e instanceof Error) {
319
+ const r = new e.constructor();
320
+ return t.set(e, r), r.message = e.message, r.name = e.name, r.stack = e.stack, r.cause = e.cause, w(r, e, t), r;
321
+ }
322
+ if (typeof e == "object" && e !== null) {
323
+ const r = {};
324
+ return t.set(e, r), w(r, e, t), r;
325
+ }
326
+ return e;
327
+ }
328
+ function w(e, t, r) {
329
+ const n = [...Object.keys(t), ...te(t)];
330
+ for (let i = 0; i < n.length; i++) {
331
+ const o = n[i], f = Object.getOwnPropertyDescriptor(e, o);
332
+ (f == null || f.writable) && (e[o] = p(t[o], r));
333
+ }
334
+ }
335
+ const ie = typeof process < "u" && process.versions != null && process.versions.node != null, Ie = () => process.env.NODE_ENV === "TEST" ? !0 : typeof window < "u" && typeof window.document < "u" && typeof window.matchMedia < "u" && !ie;
336
+ function S(e, t, r, n) {
337
+ if (e === t)
338
+ return !0;
339
+ if (e && t && typeof e == "object" && typeof t == "object") {
340
+ if (e.constructor !== t.constructor)
341
+ return !1;
342
+ let i, o, f;
343
+ if (Array.isArray(e)) {
344
+ if (i = e.length, i != t.length)
345
+ return !1;
346
+ for (o = i; o-- !== 0; )
347
+ if (!S(e[o], t[o], r, n))
348
+ return !1;
349
+ return !0;
350
+ }
351
+ if (e instanceof Map && t instanceof Map) {
352
+ if (e.size !== t.size)
353
+ return !1;
354
+ for (o of e.entries())
355
+ if (!t.has(o[0]))
356
+ return !1;
357
+ for (o of e.entries())
358
+ if (!S(o[1], t.get(o[0]), r, n))
359
+ return !1;
360
+ return !0;
361
+ }
362
+ if (e instanceof Set && t instanceof Set) {
363
+ if (e.size !== t.size)
364
+ return !1;
365
+ for (o of e.entries())
366
+ if (!t.has(o[0]))
367
+ return !1;
368
+ return !0;
369
+ }
370
+ if (ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
371
+ if (i = e.length, i != t.length)
372
+ return !1;
373
+ for (o = i; o-- !== 0; )
374
+ if (e[o] !== t[o])
375
+ return !1;
376
+ return !0;
377
+ }
378
+ if (e.constructor === RegExp)
379
+ return e.source === t.source && e.flags === t.flags;
380
+ if (e.valueOf !== Object.prototype.valueOf && e.valueOf)
381
+ return e.valueOf() === t.valueOf();
382
+ if (e.toString !== Object.prototype.toString && e.toString)
383
+ return e.toString() === t.toString();
384
+ if (f = Object.keys(e), i = f.length, i !== Object.keys(t).length)
385
+ return !1;
386
+ for (o = i; o-- !== 0; )
387
+ if (!Object.prototype.hasOwnProperty.call(t, f[o]))
388
+ return !1;
389
+ for (o = i; o-- !== 0; ) {
390
+ const u = f[o];
391
+ if (!(r != null && r.includes(u)) && !(u === "_owner" && e.$$typeof) && !S(e[u], t[u], r, n))
392
+ return n && console.log(u), !1;
393
+ }
394
+ return !0;
395
+ }
396
+ return e !== e && t !== t;
397
+ }
398
+ const De = (e) => {
399
+ if (e && e !== !0)
400
+ return e;
401
+ }, Ue = (e) => {
402
+ const t = {};
403
+ if (Object.keys(e || {}).forEach((r) => {
404
+ e[r] !== void 0 && (t[r] = e[r]);
405
+ }), !(Object.keys(t).length < 1))
406
+ return t;
407
+ }, Fe = (e) => {
408
+ const t = {};
409
+ return Object.keys(e || {}).forEach((r) => {
410
+ var n;
411
+ Array.isArray(e[r]) && ((n = e[r]) == null ? void 0 : n.length) === 0 || e[r] !== void 0 && (t[r] = e[r]);
412
+ }), t;
413
+ };
414
+ function D(e) {
415
+ var t;
416
+ if (!(typeof e != "string" && !Array.isArray(e)))
417
+ return Array.isArray(e) ? e[e.length - 1] : (t = e.split(":")) == null ? void 0 : t.slice(-1)[0];
418
+ }
419
+ function oe(e) {
420
+ return e && (e.type === q || e.type === M && e.children.length === 0 || e.type === Text && e.children.trim() === "");
421
+ }
422
+ function Be(e, t) {
423
+ var r;
424
+ return H((r = e[t]) == null ? void 0 : r.call(e));
425
+ }
426
+ function H(e = []) {
427
+ const t = [];
428
+ return e.forEach((r) => {
429
+ Array.isArray(r) ? t.push(...r) : (r == null ? void 0 : r.type) === M ? t.push(...H(r.children)) : t.push(r);
430
+ }), t.filter((r) => !oe(r));
431
+ }
432
+ function _(e, ...t) {
433
+ return typeof e == "function" ? e == null ? void 0 : e(...t) : e;
434
+ }
435
+ function fe(e, t, r = "default", n) {
436
+ const i = D(r);
437
+ if (i) {
438
+ let o;
439
+ const f = V(t, r);
440
+ return f === !1 ? o = !1 : f === !0 ? o = e == null ? void 0 : e[i] : d(f) && n ? x(f) ? o = f : o = e == null ? void 0 : e[i] : o = f || (e == null ? void 0 : e[i]), n ? x(o) ? o : _(o) : o;
441
+ }
442
+ }
443
+ function ue(e, t, r = "default", n) {
444
+ var o, f, u;
445
+ const i = D(r);
446
+ if (i) {
447
+ let c;
448
+ const s = V(t, r);
449
+ return s === !1 ? c = !1 : s === !0 ? c = (o = e == null ? void 0 : e[i]) == null ? void 0 : o.call(e, n) : d(s) ? x(s) ? c = s : c = (f = e == null ? void 0 : e[i]) == null ? void 0 : f.call(e, n) : c = s || ((u = e == null ? void 0 : e[i]) == null ? void 0 : u.call(e, n)), x(c) ? c : _(c, n);
450
+ }
451
+ }
452
+ function Le(e, t, r, n) {
453
+ const i = {};
454
+ return e.forEach((o) => {
455
+ const f = D(o);
456
+ if (f) {
457
+ const u = n != null && n.render ? ue(t, r, o, n == null ? void 0 : n.params) : fe(t, r, o);
458
+ ($(u) || u) && (i[f] = u);
459
+ }
460
+ }), i;
461
+ }
462
+ const Pe = ({ suffixCls: e, customizePrefixCls: t, isPor: r, className: n }) => {
463
+ const i = n || (r ? "gx-pro" : "gx");
464
+ return t || (e ? `${i}-${e}` : i);
465
+ }, Ce = (e, t) => e ? a(e) ? e.join("-") : e.toString() : `${t || 0}`;
466
+ function Me(e, { align: t, showIndex: r }) {
467
+ const n = v(e);
468
+ if (r && e.length && e.every((i) => i.dataIndex !== "sortIndex")) {
469
+ const i = e[0];
470
+ n.unshift({
471
+ title: "序号",
472
+ align: t,
473
+ fixed: i.fixed,
474
+ width: 60,
475
+ uuid: le().uuid(15),
476
+ dataIndex: "sortIndex",
477
+ key: "sortIndex"
478
+ });
479
+ } else
480
+ n.filter((i) => i.dataIndex !== "sortIndex");
481
+ return n;
482
+ }
483
+ function $e(e, ...t) {
484
+ return typeof e == "function" ? e(...t) : e;
485
+ }
486
+ function Ve(e) {
487
+ return JSON.parse(JSON.stringify(e));
488
+ }
489
+ function Ne(e, t) {
490
+ if (d(e)) {
491
+ const { pageSize: r = 10, total: n = 0 } = e;
492
+ let { current: i = 1 } = e;
493
+ return n - t <= r * (i - 1) && (i = i - 1), i === 0 ? 1 : i;
494
+ }
495
+ return 1;
496
+ }
497
+ function ze(e = [], t, r = "children") {
498
+ function n(i, o) {
499
+ return o.map((f, u) => {
500
+ const c = `${i}-${u + 1}`;
501
+ return f[r] && (f[r] = n(c, f[r])), f.sortIndex = c, f;
502
+ });
503
+ }
504
+ return v(e).map((i, o) => {
505
+ const f = d(t) && t.current || 1, u = d(t) && t.pageSize || 10, c = `${f ? (f - 1) * u + (o + 1) : o + 1}`;
506
+ return i[r] && (i[r] = n(`${c}`, i[r])), i.sortIndex = c, i;
507
+ });
508
+ }
509
+ function We(e, t) {
510
+ return a(e) ? e == null ? void 0 : e.filter((r, n) => {
511
+ if (y(t))
512
+ return n <= t - 1;
513
+ if (a(t) && t.length === 2) {
514
+ const i = t[0] - 1, o = t[1] ? t[1] - 1 : e.length - 1;
515
+ return n <= o && n >= i;
516
+ } else if (a(t) && t.length === 1) {
517
+ const i = t[0] - 1, o = e.length - 1;
518
+ return n <= o && n >= i;
519
+ }
520
+ return !0;
521
+ }) : [];
522
+ }
523
+ function ce(e, t, r, n = 0) {
524
+ const i = y(n) && (n === 0 || n === 1) ? n : 0, o = e[r], f = t[r];
525
+ let u = 0;
526
+ return o < f ? u = i === 0 ? -1 : 0 : o > f && (u = i === 0 ? 0 : -1), u;
527
+ }
528
+ function se(e, t, r, n = 0) {
529
+ const i = y(n) && (n === 0 || n === 1) ? n : 0, o = new Date(e[r]), f = new Date(t[r]);
530
+ let u = 0;
531
+ return o < f ? u = i === 0 ? -1 : 0 : o > f && (u = i === 0 ? 0 : -1), u;
532
+ }
533
+ function He(e, t, r = 0) {
534
+ return e.sort((n, i) => ce(n, i, t, r));
535
+ }
536
+ function _e(e, t, r = 0) {
537
+ return e.sort((n, i) => se(n, i, t, r));
538
+ }
539
+ function qe(e) {
540
+ let t = v(e);
541
+ const r = new Set(t);
542
+ return t = Array.from(r), t;
543
+ }
544
+ function Je(e, t) {
545
+ const r = ["null", "undefined"];
546
+ let n = !0;
547
+ return e === 0 ? n = !0 : r.includes(e) ? n = !1 : e || (n = !1), n ? {
548
+ value: e,
549
+ success: n
550
+ } : {
551
+ value: t === "" ? t : t || "-",
552
+ success: n
553
+ };
554
+ }
555
+ function Xe(e) {
556
+ let t = "";
557
+ if (e > -1) {
558
+ const r = Math.floor(e / 3600), n = Math.floor(e / 60) % 60, i = Number.parseInt(String(e % 60));
559
+ r < 10 ? t = "0" + r + ":" : t = r + ":", n < 10 && (t += "0"), t += n + ":", i < 10 && (t += "0"), t += i;
560
+ }
561
+ return t.split(":")[0] === "00" ? `${t.split(":")[1]}:${t.split(":")[2]}` : t;
562
+ }
563
+ function le() {
564
+ const e = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
565
+ return {
566
+ uuid(t, r) {
567
+ const n = e, i = [], o = r || n.length;
568
+ let f, u;
569
+ if (t)
570
+ for (f = 0; f < t; f += 1)
571
+ i[f] = n[Number.parseInt(String(Math.random() * o))];
572
+ else
573
+ for (i[8] = "-", i[13] = "-", i[18] = "-", i[23] = "-", i[14] = "4", f = 0; f < 36; f += 1)
574
+ i[f] || (u = Math.random() * 16, i[f] = n[f === 19 ? u && 3 || 8 : u]);
575
+ return i.join("");
576
+ },
577
+ uuidFast() {
578
+ const t = e, r = Array.from({ length: 36 });
579
+ let n = 0, i, o;
580
+ for (o = 0; o < 36; o += 1)
581
+ o === 8 || o === 13 || o === 18 || o === 23 ? r[o] = "-" : o === 14 ? r[o] = "4" : (n <= 2 && (n = 33554432 + Math.random() * 16777216 || 0), i = n && 15, n = n > 4, r[o] = t[o === 19 ? i && 3 || 8 : i]);
582
+ return r.join("");
583
+ },
584
+ uuidString() {
585
+ return this.uuidFast().replace(new RegExp("-", "g"), "");
586
+ },
587
+ uuidCompact() {
588
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
589
+ const r = Math.random() * 16 || 0;
590
+ return (t === "x" ? r : r && 3 || 8).toString(16);
591
+ });
592
+ }
593
+ };
594
+ }
595
+ function Ze(e = [], t = "children") {
596
+ let r = 0;
597
+ function n(i = [], o) {
598
+ i.forEach((f) => {
599
+ f.floor = o, o > r && (r = o), f[t] && f[t].length > 0 && n(f[t], o + 1);
600
+ });
601
+ }
602
+ return n(e, 1), r;
603
+ }
604
+ function ae(e, t = "children") {
605
+ let r = [];
606
+ return e.forEach((n) => {
607
+ r.push(n), a(n[t]) && n[t].length > 0 && (r = r.concat(ae(n[t], t)));
608
+ }), r;
609
+ }
610
+ function Ye(e, t) {
611
+ if (!e || !a(e) || (e == null ? void 0 : e.length) === 0)
612
+ return [];
613
+ const { id: r = "id", parentId: n = "parentId", children: i = "children", rootId: o = 0, emptyChildren: f = !0 } = t || {}, u = v(e);
614
+ return u.map((c) => {
615
+ var s;
616
+ return !f && c[i] && ((s = c[i]) == null ? void 0 : s.length) === 0 && delete c[i], c;
617
+ }).filter((c) => {
618
+ const s = u.filter((l) => c[r] === l[n]);
619
+ return s.length > 0 ? c[i] = s : f && (c[i] = []), c[n] === o;
620
+ });
621
+ }
622
+ function Ge(e) {
623
+ return URL.createObjectURL(e);
624
+ }
625
+ function Qe(e) {
626
+ return new Promise((t, r) => {
627
+ const n = new FileReader();
628
+ n.readAsDataURL(e), n.onload = () => t(n.result), n.onerror = (i) => r(i);
629
+ });
630
+ }
631
+ function be(e) {
632
+ const t = e.split(","), r = t[0].match(/:(.*?);/)[1], n = atob(t[1]);
633
+ let i = n.length;
634
+ const o = new Uint8Array(i);
635
+ for (; i--; )
636
+ o[i] = n.charCodeAt(i);
637
+ return new Blob([o], { type: r });
638
+ }
639
+ function Ke(e, t) {
640
+ const r = e.split(","), n = r[0].match(/:(.*?);/)[1], i = atob(r[1]);
641
+ let o = i.length;
642
+ const f = new Uint8Array(o);
643
+ for (; o--; )
644
+ f[o] = i.charCodeAt(o);
645
+ return new File([f], t, { type: n });
646
+ }
647
+ function je(e, t, r) {
648
+ return new window.File([e], t, { type: r });
649
+ }
650
+ function de(e) {
651
+ if (!e || typeof e != "string")
652
+ return "";
653
+ const t = e.indexOf("?");
654
+ return t > 0 ? `${e.substring(0, t)}` : e;
655
+ }
656
+ function T(e) {
657
+ var n, i, o, f, u;
658
+ if (!e || typeof e != "string")
659
+ return "";
660
+ const t = de(e), r = t.lastIndexOf(".");
661
+ return r > 0 && ((u = (f = `${(o = (i = (n = t == null ? void 0 : t.substring) == null ? void 0 : n.call(t, r)) == null ? void 0 : i.split("?")) == null ? void 0 : o[0]}`) == null ? void 0 : f.split(".")) == null ? void 0 : u[1]) || "";
662
+ }
663
+ function m(e, t) {
664
+ if (t)
665
+ return t;
666
+ if (!e || e === "data:")
667
+ return "4";
668
+ let r = "4";
669
+ return U(e) ? e.includes("data:image/") ? r = "png" : e.includes("data:video/") ? r = "mp4" : e.includes("data:audio/") && (r = "mp3") : e instanceof Blob ? (e = String(e), e.includes("image") ? r = "png" : e.includes("video") ? r = "mp4" : e.includes("audio") && (r = "mp3")) : r = T(e).toLowerCase(), h.imageType.includes(r) ? "1" : h.videoType.includes(r) ? "3" : h.audioType.includes(r) ? "2" : "4";
670
+ }
671
+ function pe(e) {
672
+ const { url: t = "", fileType: r = "1" } = e || {};
673
+ let n = "", i = { play: !1, height: 0, size: 0, width: 0, duration: 0 };
674
+ function o() {
675
+ i = { play: !1, height: 0, size: 0, width: 0, duration: 0 };
676
+ }
677
+ return t instanceof File ? n = URL.createObjectURL(t) : U(t) ? n = t : t instanceof Blob ? n = URL.createObjectURL(t) : (t.includes("https") || t.includes("http")) && (n = t), new Promise((f) => {
678
+ let u;
679
+ r === "1" ? (u = document.createElement("img"), u.src = n) : r === "2" ? (u = document.createElement("audio"), u.src = n) : r === "3" && (u = document.createElement("video"), u.src = n), r === "1" ? u.onload = function() {
680
+ o(), i.play = !0, i.width = u.width || 0, i.height = u.height || 0, f(i), u = null;
681
+ } : u.oncanplay = function() {
682
+ o(), i.play = !0, i.width = (u == null ? void 0 : u.videoWidth) || 0, i.height = (u == null ? void 0 : u.videoHeight) || 0, i.duration = (u == null ? void 0 : u.duration) || 0, f(i), u = null;
683
+ }, u.onerror = function() {
684
+ o(), f(i), u = null;
685
+ };
686
+ });
687
+ }
688
+ async function ke(e) {
689
+ const { url: t = "", currentTime: r, videoSuffix: n = "", vidoeAllowPlay: i = !1 } = e;
690
+ let o = "", f = n, u = "1", c;
691
+ return t instanceof File ? (o = URL.createObjectURL(t), f = T(t.name), u = m(t.name)) : t instanceof Blob ? (o = URL.createObjectURL(t), u = m(t)) : U(t) ? (o = t, u = m(t)) : (t.includes("https") || t.includes("http")) && (o = t, f = T(t), u = m(t)), (f ? h.videoAllowType.includes(f.toLowerCase()) : !1) ? i ? P(o, r) : (c = await pe({
692
+ url: o,
693
+ fileType: u
694
+ }), c.play ? P(o, r) : new Promise((l) => {
695
+ l("");
696
+ })) : new Promise((l) => {
697
+ l("");
698
+ });
699
+ }
700
+ async function P(e, t = 0) {
701
+ return new Promise((r) => {
702
+ let n = document.createElement("video");
703
+ n && (n.controls = !0, n.muted = !0, n.setAttribute("src", e), n.setAttribute("muted", String(!0)), n.setAttribute("crossorigin", "anonymous"), n.setAttribute("autoplay", String(!0)), n.addEventListener("loadeddata", async () => {
704
+ let i;
705
+ for (n == null || n.addEventListener("seeked", async () => {
706
+ i && i();
707
+ }); t < ((n == null ? void 0 : n.duration) || 0); ) {
708
+ n && (n.currentTime = t), await new Promise((g) => i = g);
709
+ const o = document.createElement("canvas"), f = 0.8, u = o.getContext("2d"), c = (n == null ? void 0 : n.videoWidth) || 0 * f, s = (n == null ? void 0 : n.videoHeight) || 0 * f, l = 0;
710
+ o.width = (n == null ? void 0 : n.videoWidth) || 0 * f, o.height = (n == null ? void 0 : n.videoHeight) || 0 * f, n && u.drawImage(n, 0, 0, c + l, s + l), n = null, r(c === 0 || s === 0 ? "" : o.toDataURL("image/png", 1));
711
+ }
712
+ }));
713
+ });
714
+ }
715
+ function U(e = "") {
716
+ return !!(e && [
717
+ "data:image/",
718
+ "data:video/",
719
+ "data:audio/"
720
+ ].find((r) => e.includes(r)));
721
+ }
722
+ function et(e) {
723
+ return typeof e == "string" && /^data:(image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(e);
724
+ }
725
+ function tt(e, t, r, n = !1) {
726
+ e && t && r && e.addEventListener(t, r, n);
727
+ }
728
+ function nt(e, t, r, n = !1) {
729
+ e && t && r && e.removeEventListener(t, r, n);
730
+ }
731
+ function rt() {
732
+ return /windows|win32/i.test(navigator.userAgent);
733
+ }
734
+ function it(e) {
735
+ return $(e) ? e : !!e;
736
+ }
737
+ function C(e, t) {
738
+ const r = `^\\d+(?:\\.\\d{0,${e}})?`, n = new RegExp(r), i = t.toString().match(n);
739
+ if (i) {
740
+ const o = i[0];
741
+ if (o.includes(".")) {
742
+ const [f, u] = o.split(".");
743
+ if (/^0*$/.test(u))
744
+ return f;
745
+ }
746
+ return o;
747
+ }
748
+ return t.toString();
749
+ }
750
+ function ot(e, t) {
751
+ const { toChinese: r = !1, fixed: n = 2, min: i = 1e4 } = t || {}, o = y(i) ? i : 1e4, f = y(n) ? n : 2, u = r ? e < o ? "" : e < 1e8 ? "万" : "亿" : e < o ? "" : e < 1e8 ? "w" : "亿";
752
+ if (!y(e))
753
+ return {
754
+ str: `${e}`,
755
+ number: `${e}`
756
+ };
757
+ if (e < o)
758
+ return {
759
+ str: `${e}`,
760
+ number: `${e}`
761
+ };
762
+ if (f === 0) {
763
+ const s = (e / (e < 1e8 ? 1e4 : 1e8)).toFixed(1).split(".")[0];
764
+ return {
765
+ str: `${s}${u}`,
766
+ number: s,
767
+ unit: u
768
+ };
769
+ }
770
+ let c;
771
+ return e < 1e8 ? (c = C(f, e / 1e4), {
772
+ str: c + u,
773
+ number: c,
774
+ unit: u
775
+ }) : (c = C(f, e / 1e8), {
776
+ str: c + u,
777
+ number: c,
778
+ unit: u
779
+ });
780
+ }
781
+ function ft(e, t) {
782
+ let r = 0;
783
+ const n = document.querySelector(t.root || "hiddenElement");
784
+ if (!n)
785
+ return 0;
786
+ const i = document.createElement(t.createName || "span");
787
+ return i.innerHTML = e, (t.cssObject || d(t.cssObject)) && Object.keys(t.cssObject).forEach((o) => {
788
+ var f, u;
789
+ (f = t.cssObject) != null && f[o] && (i.style[o] = (u = t.cssObject) == null ? void 0 : u[o]);
790
+ }), n.append(i), r = i.getBoundingClientRect()[t.type || "width"], n.removeChild(i), r;
791
+ }
792
+ export {
793
+ qe as arrayRepeat,
794
+ We as arraySlice,
795
+ je as blobToDataURL,
796
+ m as checkFileType,
797
+ Y as classNames,
798
+ v as cloneDeep,
799
+ ce as compareArray,
800
+ He as compareArraySort,
801
+ _e as compareArrayTimeSort,
802
+ se as compareTime,
803
+ it as convertValueBoolean,
804
+ w as copyProperties,
805
+ be as dataURLtoBlob,
806
+ Ke as dataURLtoFile,
807
+ Ve as deepCopy,
808
+ G as deepMerge,
809
+ H as filterEmpty,
810
+ Xe as formatDuraton,
811
+ C as formatNumber,
812
+ Ce as genColumnKey,
813
+ P as generateVidoePicture,
814
+ Qe as getBase64,
815
+ Ge as getBlobUrl,
816
+ T as getFileSuffix,
817
+ ae as getLevelData,
818
+ Ze as getMaxFloor,
819
+ pe as getMediaInfos,
820
+ Pe as getPrefixCls,
821
+ le as getRandomNumber,
822
+ k as getScroll,
823
+ Se as getScrollContainer,
824
+ fe as getSlot,
825
+ ue as getSlotVNode,
826
+ Be as getSlotsChildren,
827
+ Le as getSlotsProps,
828
+ ze as getSortIndex,
829
+ ft as getTextWidth,
830
+ V as getValueFromObjectByKey,
831
+ ke as getVideoCoverPicture,
832
+ de as getVideoFileUrl,
833
+ h as globalConfig,
834
+ Ne as handleCurrentPage,
835
+ Me as handleShowIndex,
836
+ Je as hanndleEmptyField,
837
+ J as is,
838
+ a as isArray,
839
+ U as isBase64,
840
+ $ as isBoolean,
841
+ Ie as isBrowser,
842
+ et as isDataURLBase64,
843
+ S as isDeepEqualReact,
844
+ oe as isEmptyElement,
845
+ ge as isFunction,
846
+ he as isImg,
847
+ Ee as isInContainer,
848
+ we as isJSONStr,
849
+ me as isMobile,
850
+ xe as isNil,
851
+ y as isNumber,
852
+ d as isObject,
853
+ j as isScroll,
854
+ A as isServer,
855
+ X as isString,
856
+ Z as isTablet,
857
+ Ae as isUrl,
858
+ rt as isWindowsOs,
859
+ ve as merge,
860
+ Oe as nanoid,
861
+ nt as off,
862
+ De as omitBoolean,
863
+ Ue as omitUndefined,
864
+ Fe as omitUndefinedAndEmptyArr,
865
+ tt as on,
866
+ $e as runFunction,
867
+ Re as scrollTo,
868
+ _ as slotRender,
869
+ Te as throttleByAnimationFrame,
870
+ ot as toConvertNumberShow,
871
+ Ye as treeData
872
+ };