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

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