@zy-frontend/form-core 2.0.6

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,3587 @@
1
+ import { toRaw as H, defineComponent as pe, mergeModels as je, useModel as Ft, useAttrs as Yt, computed as J, createElementBlock as te, createBlock as _, openBlock as L, Fragment as ye, resolveDynamicComponent as ue, mergeProps as de, unref as Y, withKeys as dt, renderList as Ie, createCommentVNode as Le, createElementVNode as Un, normalizeClass as Be, withCtx as We, createTextVNode as hr, toDisplayString as Je, ref as se, onUnmounted as Fe, normalizeStyle as De, createVNode as Tt, shallowRef as vr, useTemplateRef as Pt, reactive as rt, watch as re, provide as Oe, inject as vt, nextTick as ve, onMounted as Ln, toRefs as gr, toRef as Bn, isRef as Xt, watchEffect as br, createSlots as wr, withDirectives as $r, vShow as Fr } from "vue";
2
+ var Wn = typeof global == "object" && global && global.Object === Object && global, Tr = typeof self == "object" && self && self.Object === Object && self, ge = Wn || Tr || Function("return this")(), Se = ge.Symbol, zn = Object.prototype, Er = zn.hasOwnProperty, Ar = zn.toString, Xe = Se ? Se.toStringTag : void 0;
3
+ function Or(e) {
4
+ var t = Er.call(e, Xe), n = e[Xe];
5
+ try {
6
+ e[Xe] = void 0;
7
+ var r = !0;
8
+ } catch {
9
+ }
10
+ var a = Ar.call(e);
11
+ return r && (t ? e[Xe] = n : delete e[Xe]), a;
12
+ }
13
+ var jr = Object.prototype, Sr = jr.toString;
14
+ function kr(e) {
15
+ return Sr.call(e);
16
+ }
17
+ var Mr = "[object Null]", qr = "[object Undefined]", Qt = Se ? Se.toStringTag : void 0;
18
+ function Ge(e) {
19
+ return e == null ? e === void 0 ? qr : Mr : Qt && Qt in Object(e) ? Or(e) : kr(e);
20
+ }
21
+ function He(e) {
22
+ return e != null && typeof e == "object";
23
+ }
24
+ var Dr = "[object Symbol]";
25
+ function Et(e) {
26
+ return typeof e == "symbol" || He(e) && Ge(e) == Dr;
27
+ }
28
+ function Pr(e, t) {
29
+ for (var n = -1, r = e == null ? 0 : e.length, a = Array(r); ++n < r; )
30
+ a[n] = t(e[n], n, e);
31
+ return a;
32
+ }
33
+ var Ze = Array.isArray, _t = Se ? Se.prototype : void 0, en = _t ? _t.toString : void 0;
34
+ function Yn(e) {
35
+ if (typeof e == "string")
36
+ return e;
37
+ if (Ze(e))
38
+ return Pr(e, Yn) + "";
39
+ if (Et(e))
40
+ return en ? en.call(e) : "";
41
+ var t = e + "";
42
+ return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
43
+ }
44
+ var xr = /\s/;
45
+ function Cr(e) {
46
+ for (var t = e.length; t-- && xr.test(e.charAt(t)); )
47
+ ;
48
+ return t;
49
+ }
50
+ var Rr = /^\s+/;
51
+ function Vr(e) {
52
+ return e && e.slice(0, Cr(e) + 1).replace(Rr, "");
53
+ }
54
+ function ke(e) {
55
+ var t = typeof e;
56
+ return e != null && (t == "object" || t == "function");
57
+ }
58
+ var tn = NaN, Ir = /^[-+]0x[0-9a-f]+$/i, Nr = /^0b[01]+$/i, Ur = /^0o[0-7]+$/i, Lr = parseInt;
59
+ function nn(e) {
60
+ if (typeof e == "number")
61
+ return e;
62
+ if (Et(e))
63
+ return tn;
64
+ if (ke(e)) {
65
+ var t = typeof e.valueOf == "function" ? e.valueOf() : e;
66
+ e = ke(t) ? t + "" : t;
67
+ }
68
+ if (typeof e != "string")
69
+ return e === 0 ? e : +e;
70
+ e = Vr(e);
71
+ var n = Nr.test(e);
72
+ return n || Ur.test(e) ? Lr(e.slice(2), n ? 2 : 8) : Ir.test(e) ? tn : +e;
73
+ }
74
+ var Br = "[object AsyncFunction]", Wr = "[object Function]", zr = "[object GeneratorFunction]", Yr = "[object Proxy]";
75
+ function Gn(e) {
76
+ if (!ke(e))
77
+ return !1;
78
+ var t = Ge(e);
79
+ return t == Wr || t == zr || t == Br || t == Yr;
80
+ }
81
+ var jt = ge["__core-js_shared__"], rn = function() {
82
+ var e = /[^.]+$/.exec(jt && jt.keys && jt.keys.IE_PROTO || "");
83
+ return e ? "Symbol(src)_1." + e : "";
84
+ }();
85
+ function Gr(e) {
86
+ return !!rn && rn in e;
87
+ }
88
+ var Hr = Function.prototype, Zr = Hr.toString;
89
+ function Ce(e) {
90
+ if (e != null) {
91
+ try {
92
+ return Zr.call(e);
93
+ } catch {
94
+ }
95
+ try {
96
+ return e + "";
97
+ } catch {
98
+ }
99
+ }
100
+ return "";
101
+ }
102
+ var Kr = /[\\^$.*+?()[\]{}|]/g, Jr = /^\[object .+?Constructor\]$/, Xr = Function.prototype, Qr = Object.prototype, _r = Xr.toString, ea = Qr.hasOwnProperty, ta = RegExp(
103
+ "^" + _r.call(ea).replace(Kr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
104
+ );
105
+ function na(e) {
106
+ if (!ke(e) || Gr(e))
107
+ return !1;
108
+ var t = Gn(e) ? ta : Jr;
109
+ return t.test(Ce(e));
110
+ }
111
+ function ra(e, t) {
112
+ return e == null ? void 0 : e[t];
113
+ }
114
+ function Re(e, t) {
115
+ var n = ra(e, t);
116
+ return na(n) ? n : void 0;
117
+ }
118
+ var xt = Re(ge, "WeakMap"), an = Object.create, aa = /* @__PURE__ */ function() {
119
+ function e() {
120
+ }
121
+ return function(t) {
122
+ if (!ke(t))
123
+ return {};
124
+ if (an)
125
+ return an(t);
126
+ e.prototype = t;
127
+ var n = new e();
128
+ return e.prototype = void 0, n;
129
+ };
130
+ }(), on = function() {
131
+ try {
132
+ var e = Re(Object, "defineProperty");
133
+ return e({}, "", {}), e;
134
+ } catch {
135
+ }
136
+ }();
137
+ function ia(e, t) {
138
+ for (var n = -1, r = e == null ? 0 : e.length; ++n < r && t(e[n], n, e) !== !1; )
139
+ ;
140
+ return e;
141
+ }
142
+ var oa = 9007199254740991, sa = /^(?:0|[1-9]\d*)$/;
143
+ function la(e, t) {
144
+ var n = typeof e;
145
+ return t = t ?? oa, !!t && (n == "number" || n != "symbol" && sa.test(e)) && e > -1 && e % 1 == 0 && e < t;
146
+ }
147
+ function ua(e, t, n) {
148
+ t == "__proto__" && on ? on(e, t, {
149
+ configurable: !0,
150
+ enumerable: !0,
151
+ value: n,
152
+ writable: !0
153
+ }) : e[t] = n;
154
+ }
155
+ function Hn(e, t) {
156
+ return e === t || e !== e && t !== t;
157
+ }
158
+ var fa = Object.prototype, ca = fa.hasOwnProperty;
159
+ function da(e, t, n) {
160
+ var r = e[t];
161
+ (!(ca.call(e, t) && Hn(r, n)) || n === void 0 && !(t in e)) && ua(e, t, n);
162
+ }
163
+ var ya = 9007199254740991;
164
+ function Zn(e) {
165
+ return typeof e == "number" && e > -1 && e % 1 == 0 && e <= ya;
166
+ }
167
+ function ma(e) {
168
+ return e != null && Zn(e.length) && !Gn(e);
169
+ }
170
+ var pa = Object.prototype;
171
+ function Kn(e) {
172
+ var t = e && e.constructor, n = typeof t == "function" && t.prototype || pa;
173
+ return e === n;
174
+ }
175
+ function ha(e, t) {
176
+ for (var n = -1, r = Array(e); ++n < e; )
177
+ r[n] = t(n);
178
+ return r;
179
+ }
180
+ var va = "[object Arguments]";
181
+ function sn(e) {
182
+ return He(e) && Ge(e) == va;
183
+ }
184
+ var Jn = Object.prototype, ga = Jn.hasOwnProperty, ba = Jn.propertyIsEnumerable, wa = sn(/* @__PURE__ */ function() {
185
+ return arguments;
186
+ }()) ? sn : function(e) {
187
+ return He(e) && ga.call(e, "callee") && !ba.call(e, "callee");
188
+ };
189
+ function $a() {
190
+ return !1;
191
+ }
192
+ var Xn = typeof exports == "object" && exports && !exports.nodeType && exports, ln = Xn && typeof module == "object" && module && !module.nodeType && module, Fa = ln && ln.exports === Xn, un = Fa ? ge.Buffer : void 0, Ta = un ? un.isBuffer : void 0, Qn = Ta || $a, Ea = "[object Arguments]", Aa = "[object Array]", Oa = "[object Boolean]", ja = "[object Date]", Sa = "[object Error]", ka = "[object Function]", Ma = "[object Map]", qa = "[object Number]", Da = "[object Object]", Pa = "[object RegExp]", xa = "[object Set]", Ca = "[object String]", Ra = "[object WeakMap]", Va = "[object ArrayBuffer]", Ia = "[object DataView]", Na = "[object Float32Array]", Ua = "[object Float64Array]", La = "[object Int8Array]", Ba = "[object Int16Array]", Wa = "[object Int32Array]", za = "[object Uint8Array]", Ya = "[object Uint8ClampedArray]", Ga = "[object Uint16Array]", Ha = "[object Uint32Array]", K = {};
193
+ K[Na] = K[Ua] = K[La] = K[Ba] = K[Wa] = K[za] = K[Ya] = K[Ga] = K[Ha] = !0;
194
+ K[Ea] = K[Aa] = K[Va] = K[Oa] = K[Ia] = K[ja] = K[Sa] = K[ka] = K[Ma] = K[qa] = K[Da] = K[Pa] = K[xa] = K[Ca] = K[Ra] = !1;
195
+ function Za(e) {
196
+ return He(e) && Zn(e.length) && !!K[Ge(e)];
197
+ }
198
+ function Gt(e) {
199
+ return function(t) {
200
+ return e(t);
201
+ };
202
+ }
203
+ var _n = typeof exports == "object" && exports && !exports.nodeType && exports, tt = _n && typeof module == "object" && module && !module.nodeType && module, Ka = tt && tt.exports === _n, St = Ka && Wn.process, ze = function() {
204
+ try {
205
+ var e = tt && tt.require && tt.require("util").types;
206
+ return e || St && St.binding && St.binding("util");
207
+ } catch {
208
+ }
209
+ }(), fn = ze && ze.isTypedArray, Ja = fn ? Gt(fn) : Za, Xa = Object.prototype, Qa = Xa.hasOwnProperty;
210
+ function _a(e, t) {
211
+ var n = Ze(e), r = !n && wa(e), a = !n && !r && Qn(e), o = !n && !r && !a && Ja(e), i = n || r || a || o, s = i ? ha(e.length, String) : [], l = s.length;
212
+ for (var v in e)
213
+ Qa.call(e, v) && !(i && // Safari 9 has enumerable `arguments.length` in strict mode.
214
+ (v == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
215
+ a && (v == "offset" || v == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
216
+ o && (v == "buffer" || v == "byteLength" || v == "byteOffset") || // Skip index properties.
217
+ la(v, l))) && s.push(v);
218
+ return s;
219
+ }
220
+ function er(e, t) {
221
+ return function(n) {
222
+ return e(t(n));
223
+ };
224
+ }
225
+ var ei = er(Object.keys, Object), ti = Object.prototype, ni = ti.hasOwnProperty;
226
+ function ri(e) {
227
+ if (!Kn(e))
228
+ return ei(e);
229
+ var t = [];
230
+ for (var n in Object(e))
231
+ ni.call(e, n) && n != "constructor" && t.push(n);
232
+ return t;
233
+ }
234
+ function ai(e) {
235
+ return ma(e) ? _a(e) : ri(e);
236
+ }
237
+ var ii = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, oi = /^\w*$/;
238
+ function si(e, t) {
239
+ if (Ze(e))
240
+ return !1;
241
+ var n = typeof e;
242
+ return n == "number" || n == "symbol" || n == "boolean" || e == null || Et(e) ? !0 : oi.test(e) || !ii.test(e) || t != null && e in Object(t);
243
+ }
244
+ var at = Re(Object, "create");
245
+ function li() {
246
+ this.__data__ = at ? at(null) : {}, this.size = 0;
247
+ }
248
+ function ui(e) {
249
+ var t = this.has(e) && delete this.__data__[e];
250
+ return this.size -= t ? 1 : 0, t;
251
+ }
252
+ var fi = "__lodash_hash_undefined__", ci = Object.prototype, di = ci.hasOwnProperty;
253
+ function yi(e) {
254
+ var t = this.__data__;
255
+ if (at) {
256
+ var n = t[e];
257
+ return n === fi ? void 0 : n;
258
+ }
259
+ return di.call(t, e) ? t[e] : void 0;
260
+ }
261
+ var mi = Object.prototype, pi = mi.hasOwnProperty;
262
+ function hi(e) {
263
+ var t = this.__data__;
264
+ return at ? t[e] !== void 0 : pi.call(t, e);
265
+ }
266
+ var vi = "__lodash_hash_undefined__";
267
+ function gi(e, t) {
268
+ var n = this.__data__;
269
+ return this.size += this.has(e) ? 0 : 1, n[e] = at && t === void 0 ? vi : t, this;
270
+ }
271
+ function xe(e) {
272
+ var t = -1, n = e == null ? 0 : e.length;
273
+ for (this.clear(); ++t < n; ) {
274
+ var r = e[t];
275
+ this.set(r[0], r[1]);
276
+ }
277
+ }
278
+ xe.prototype.clear = li;
279
+ xe.prototype.delete = ui;
280
+ xe.prototype.get = yi;
281
+ xe.prototype.has = hi;
282
+ xe.prototype.set = gi;
283
+ function bi() {
284
+ this.__data__ = [], this.size = 0;
285
+ }
286
+ function At(e, t) {
287
+ for (var n = e.length; n--; )
288
+ if (Hn(e[n][0], t))
289
+ return n;
290
+ return -1;
291
+ }
292
+ var wi = Array.prototype, $i = wi.splice;
293
+ function Fi(e) {
294
+ var t = this.__data__, n = At(t, e);
295
+ if (n < 0)
296
+ return !1;
297
+ var r = t.length - 1;
298
+ return n == r ? t.pop() : $i.call(t, n, 1), --this.size, !0;
299
+ }
300
+ function Ti(e) {
301
+ var t = this.__data__, n = At(t, e);
302
+ return n < 0 ? void 0 : t[n][1];
303
+ }
304
+ function Ei(e) {
305
+ return At(this.__data__, e) > -1;
306
+ }
307
+ function Ai(e, t) {
308
+ var n = this.__data__, r = At(n, e);
309
+ return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this;
310
+ }
311
+ function Te(e) {
312
+ var t = -1, n = e == null ? 0 : e.length;
313
+ for (this.clear(); ++t < n; ) {
314
+ var r = e[t];
315
+ this.set(r[0], r[1]);
316
+ }
317
+ }
318
+ Te.prototype.clear = bi;
319
+ Te.prototype.delete = Fi;
320
+ Te.prototype.get = Ti;
321
+ Te.prototype.has = Ei;
322
+ Te.prototype.set = Ai;
323
+ var it = Re(ge, "Map");
324
+ function Oi() {
325
+ this.size = 0, this.__data__ = {
326
+ hash: new xe(),
327
+ map: new (it || Te)(),
328
+ string: new xe()
329
+ };
330
+ }
331
+ function ji(e) {
332
+ var t = typeof e;
333
+ return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
334
+ }
335
+ function Ot(e, t) {
336
+ var n = e.__data__;
337
+ return ji(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
338
+ }
339
+ function Si(e) {
340
+ var t = Ot(this, e).delete(e);
341
+ return this.size -= t ? 1 : 0, t;
342
+ }
343
+ function ki(e) {
344
+ return Ot(this, e).get(e);
345
+ }
346
+ function Mi(e) {
347
+ return Ot(this, e).has(e);
348
+ }
349
+ function qi(e, t) {
350
+ var n = Ot(this, e), r = n.size;
351
+ return n.set(e, t), this.size += n.size == r ? 0 : 1, this;
352
+ }
353
+ function Me(e) {
354
+ var t = -1, n = e == null ? 0 : e.length;
355
+ for (this.clear(); ++t < n; ) {
356
+ var r = e[t];
357
+ this.set(r[0], r[1]);
358
+ }
359
+ }
360
+ Me.prototype.clear = Oi;
361
+ Me.prototype.delete = Si;
362
+ Me.prototype.get = ki;
363
+ Me.prototype.has = Mi;
364
+ Me.prototype.set = qi;
365
+ var Di = "Expected a function";
366
+ function Ht(e, t) {
367
+ if (typeof e != "function" || t != null && typeof t != "function")
368
+ throw new TypeError(Di);
369
+ var n = function() {
370
+ var r = arguments, a = t ? t.apply(this, r) : r[0], o = n.cache;
371
+ if (o.has(a))
372
+ return o.get(a);
373
+ var i = e.apply(this, r);
374
+ return n.cache = o.set(a, i) || o, i;
375
+ };
376
+ return n.cache = new (Ht.Cache || Me)(), n;
377
+ }
378
+ Ht.Cache = Me;
379
+ var Pi = 500;
380
+ function xi(e) {
381
+ var t = Ht(e, function(r) {
382
+ return n.size === Pi && n.clear(), r;
383
+ }), n = t.cache;
384
+ return t;
385
+ }
386
+ var Ci = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Ri = /\\(\\)?/g, Vi = xi(function(e) {
387
+ var t = [];
388
+ return e.charCodeAt(0) === 46 && t.push(""), e.replace(Ci, function(n, r, a, o) {
389
+ t.push(a ? o.replace(Ri, "$1") : r || n);
390
+ }), t;
391
+ });
392
+ function Ii(e) {
393
+ return e == null ? "" : Yn(e);
394
+ }
395
+ function Ni(e, t) {
396
+ return Ze(e) ? e : si(e, t) ? [e] : Vi(Ii(e));
397
+ }
398
+ function Ui(e) {
399
+ if (typeof e == "string" || Et(e))
400
+ return e;
401
+ var t = e + "";
402
+ return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
403
+ }
404
+ function Li(e, t) {
405
+ t = Ni(t, e);
406
+ for (var n = 0, r = t.length; e != null && n < r; )
407
+ e = e[Ui(t[n++])];
408
+ return n && n == r ? e : void 0;
409
+ }
410
+ function Zt(e, t, n) {
411
+ var r = e == null ? void 0 : Li(e, t);
412
+ return r === void 0 ? n : r;
413
+ }
414
+ function Bi(e, t) {
415
+ for (var n = -1, r = t.length, a = e.length; ++n < r; )
416
+ e[a + n] = t[n];
417
+ return e;
418
+ }
419
+ var Wi = er(Object.getPrototypeOf, Object);
420
+ function zi() {
421
+ this.__data__ = new Te(), this.size = 0;
422
+ }
423
+ function Yi(e) {
424
+ var t = this.__data__, n = t.delete(e);
425
+ return this.size = t.size, n;
426
+ }
427
+ function Gi(e) {
428
+ return this.__data__.get(e);
429
+ }
430
+ function Hi(e) {
431
+ return this.__data__.has(e);
432
+ }
433
+ var Zi = 200;
434
+ function Ki(e, t) {
435
+ var n = this.__data__;
436
+ if (n instanceof Te) {
437
+ var r = n.__data__;
438
+ if (!it || r.length < Zi - 1)
439
+ return r.push([e, t]), this.size = ++n.size, this;
440
+ n = this.__data__ = new Me(r);
441
+ }
442
+ return n.set(e, t), this.size = n.size, this;
443
+ }
444
+ function Ke(e) {
445
+ var t = this.__data__ = new Te(e);
446
+ this.size = t.size;
447
+ }
448
+ Ke.prototype.clear = zi;
449
+ Ke.prototype.delete = Yi;
450
+ Ke.prototype.get = Gi;
451
+ Ke.prototype.has = Hi;
452
+ Ke.prototype.set = Ki;
453
+ var tr = typeof exports == "object" && exports && !exports.nodeType && exports, cn = tr && typeof module == "object" && module && !module.nodeType && module, Ji = cn && cn.exports === tr, dn = Ji ? ge.Buffer : void 0;
454
+ dn && dn.allocUnsafe;
455
+ function Xi(e, t) {
456
+ return e.slice();
457
+ }
458
+ function Qi(e, t) {
459
+ for (var n = -1, r = e == null ? 0 : e.length, a = 0, o = []; ++n < r; ) {
460
+ var i = e[n];
461
+ t(i, n, e) && (o[a++] = i);
462
+ }
463
+ return o;
464
+ }
465
+ function _i() {
466
+ return [];
467
+ }
468
+ var eo = Object.prototype, to = eo.propertyIsEnumerable, yn = Object.getOwnPropertySymbols, no = yn ? function(e) {
469
+ return e == null ? [] : (e = Object(e), Qi(yn(e), function(t) {
470
+ return to.call(e, t);
471
+ }));
472
+ } : _i;
473
+ function ro(e, t, n) {
474
+ var r = t(e);
475
+ return Ze(e) ? r : Bi(r, n(e));
476
+ }
477
+ function ao(e) {
478
+ return ro(e, ai, no);
479
+ }
480
+ var Ct = Re(ge, "DataView"), Rt = Re(ge, "Promise"), Vt = Re(ge, "Set"), mn = "[object Map]", io = "[object Object]", pn = "[object Promise]", hn = "[object Set]", vn = "[object WeakMap]", gn = "[object DataView]", oo = Ce(Ct), so = Ce(it), lo = Ce(Rt), uo = Ce(Vt), fo = Ce(xt), $e = Ge;
481
+ (Ct && $e(new Ct(new ArrayBuffer(1))) != gn || it && $e(new it()) != mn || Rt && $e(Rt.resolve()) != pn || Vt && $e(new Vt()) != hn || xt && $e(new xt()) != vn) && ($e = function(e) {
482
+ var t = Ge(e), n = t == io ? e.constructor : void 0, r = n ? Ce(n) : "";
483
+ if (r)
484
+ switch (r) {
485
+ case oo:
486
+ return gn;
487
+ case so:
488
+ return mn;
489
+ case lo:
490
+ return pn;
491
+ case uo:
492
+ return hn;
493
+ case fo:
494
+ return vn;
495
+ }
496
+ return t;
497
+ });
498
+ var co = Object.prototype, yo = co.hasOwnProperty;
499
+ function mo(e) {
500
+ var t = e.length, n = new e.constructor(t);
501
+ return t && typeof e[0] == "string" && yo.call(e, "index") && (n.index = e.index, n.input = e.input), n;
502
+ }
503
+ var bn = ge.Uint8Array;
504
+ function Kt(e) {
505
+ var t = new e.constructor(e.byteLength);
506
+ return new bn(t).set(new bn(e)), t;
507
+ }
508
+ function po(e, t) {
509
+ var n = Kt(e.buffer);
510
+ return new e.constructor(n, e.byteOffset, e.byteLength);
511
+ }
512
+ var ho = /\w*$/;
513
+ function vo(e) {
514
+ var t = new e.constructor(e.source, ho.exec(e));
515
+ return t.lastIndex = e.lastIndex, t;
516
+ }
517
+ var wn = Se ? Se.prototype : void 0, $n = wn ? wn.valueOf : void 0;
518
+ function go(e) {
519
+ return $n ? Object($n.call(e)) : {};
520
+ }
521
+ function bo(e, t) {
522
+ var n = Kt(e.buffer);
523
+ return new e.constructor(n, e.byteOffset, e.length);
524
+ }
525
+ var wo = "[object Boolean]", $o = "[object Date]", Fo = "[object Map]", To = "[object Number]", Eo = "[object RegExp]", Ao = "[object Set]", Oo = "[object String]", jo = "[object Symbol]", So = "[object ArrayBuffer]", ko = "[object DataView]", Mo = "[object Float32Array]", qo = "[object Float64Array]", Do = "[object Int8Array]", Po = "[object Int16Array]", xo = "[object Int32Array]", Co = "[object Uint8Array]", Ro = "[object Uint8ClampedArray]", Vo = "[object Uint16Array]", Io = "[object Uint32Array]";
526
+ function No(e, t, n) {
527
+ var r = e.constructor;
528
+ switch (t) {
529
+ case So:
530
+ return Kt(e);
531
+ case wo:
532
+ case $o:
533
+ return new r(+e);
534
+ case ko:
535
+ return po(e);
536
+ case Mo:
537
+ case qo:
538
+ case Do:
539
+ case Po:
540
+ case xo:
541
+ case Co:
542
+ case Ro:
543
+ case Vo:
544
+ case Io:
545
+ return bo(e);
546
+ case Fo:
547
+ return new r();
548
+ case To:
549
+ case Oo:
550
+ return new r(e);
551
+ case Eo:
552
+ return vo(e);
553
+ case Ao:
554
+ return new r();
555
+ case jo:
556
+ return go(e);
557
+ }
558
+ }
559
+ function Uo(e) {
560
+ return typeof e.constructor == "function" && !Kn(e) ? aa(Wi(e)) : {};
561
+ }
562
+ var Lo = "[object Map]";
563
+ function Bo(e) {
564
+ return He(e) && $e(e) == Lo;
565
+ }
566
+ var Fn = ze && ze.isMap, Wo = Fn ? Gt(Fn) : Bo, zo = "[object Set]";
567
+ function Yo(e) {
568
+ return He(e) && $e(e) == zo;
569
+ }
570
+ var Tn = ze && ze.isSet, Go = Tn ? Gt(Tn) : Yo, nr = "[object Arguments]", Ho = "[object Array]", Zo = "[object Boolean]", Ko = "[object Date]", Jo = "[object Error]", rr = "[object Function]", Xo = "[object GeneratorFunction]", Qo = "[object Map]", _o = "[object Number]", ar = "[object Object]", es = "[object RegExp]", ts = "[object Set]", ns = "[object String]", rs = "[object Symbol]", as = "[object WeakMap]", is = "[object ArrayBuffer]", os = "[object DataView]", ss = "[object Float32Array]", ls = "[object Float64Array]", us = "[object Int8Array]", fs = "[object Int16Array]", cs = "[object Int32Array]", ds = "[object Uint8Array]", ys = "[object Uint8ClampedArray]", ms = "[object Uint16Array]", ps = "[object Uint32Array]", Z = {};
571
+ Z[nr] = Z[Ho] = Z[is] = Z[os] = Z[Zo] = Z[Ko] = Z[ss] = Z[ls] = Z[us] = Z[fs] = Z[cs] = Z[Qo] = Z[_o] = Z[ar] = Z[es] = Z[ts] = Z[ns] = Z[rs] = Z[ds] = Z[ys] = Z[ms] = Z[ps] = !0;
572
+ Z[Jo] = Z[rr] = Z[as] = !1;
573
+ function pt(e, t, n, r, a, o) {
574
+ var i;
575
+ if (i !== void 0)
576
+ return i;
577
+ if (!ke(e))
578
+ return e;
579
+ var s = Ze(e);
580
+ if (s)
581
+ i = mo(e);
582
+ else {
583
+ var l = $e(e), v = l == rr || l == Xo;
584
+ if (Qn(e))
585
+ return Xi(e);
586
+ if (l == ar || l == nr || v && !a)
587
+ i = v ? {} : Uo(e);
588
+ else {
589
+ if (!Z[l])
590
+ return a ? e : {};
591
+ i = No(e, l);
592
+ }
593
+ }
594
+ o || (o = new Ke());
595
+ var m = o.get(e);
596
+ if (m)
597
+ return m;
598
+ o.set(e, i), Go(e) ? e.forEach(function(y) {
599
+ i.add(pt(y, t, n, y, e, o));
600
+ }) : Wo(e) && e.forEach(function(y, w) {
601
+ i.set(w, pt(y, t, n, w, e, o));
602
+ });
603
+ var p = ao, d = s ? void 0 : p(e);
604
+ return ia(d || e, function(y, w) {
605
+ d && (w = y, y = e[w]), da(i, w, pt(y, t, n, w, e, o));
606
+ }), i;
607
+ }
608
+ var hs = 1, vs = 4;
609
+ function Ye(e) {
610
+ return pt(e, hs | vs);
611
+ }
612
+ var kt = function() {
613
+ return ge.Date.now();
614
+ }, gs = "Expected a function", bs = Math.max, ws = Math.min;
615
+ function Jt(e, t, n) {
616
+ var r, a, o, i, s, l, v = 0, m = !1, p = !1, d = !0;
617
+ if (typeof e != "function")
618
+ throw new TypeError(gs);
619
+ t = nn(t) || 0, ke(n) && (m = !!n.leading, p = "maxWait" in n, o = p ? bs(nn(n.maxWait) || 0, t) : o, d = "trailing" in n ? !!n.trailing : d);
620
+ function y(E) {
621
+ var P = r, S = a;
622
+ return r = a = void 0, v = E, i = e.apply(S, P), i;
623
+ }
624
+ function w(E) {
625
+ return v = E, s = setTimeout(u, t), m ? y(E) : i;
626
+ }
627
+ function $(E) {
628
+ var P = E - l, S = E - v, q = t - P;
629
+ return p ? ws(q, o - S) : q;
630
+ }
631
+ function g(E) {
632
+ var P = E - l, S = E - v;
633
+ return l === void 0 || P >= t || P < 0 || p && S >= o;
634
+ }
635
+ function u() {
636
+ var E = kt();
637
+ if (g(E))
638
+ return F(E);
639
+ s = setTimeout(u, $(E));
640
+ }
641
+ function F(E) {
642
+ return s = void 0, d && r ? y(E) : (r = a = void 0, i);
643
+ }
644
+ function c() {
645
+ s !== void 0 && clearTimeout(s), v = 0, r = l = a = s = void 0;
646
+ }
647
+ function T() {
648
+ return s === void 0 ? i : F(kt());
649
+ }
650
+ function A() {
651
+ var E = kt(), P = g(E);
652
+ if (r = arguments, a = this, l = E, P) {
653
+ if (s === void 0)
654
+ return w(l);
655
+ if (p)
656
+ return clearTimeout(s), s = setTimeout(u, t), y(l);
657
+ }
658
+ return s === void 0 && (s = setTimeout(u, t)), i;
659
+ }
660
+ return A.cancel = c, A.flush = T, A;
661
+ }
662
+ var $s = "Expected a function";
663
+ function Fs(e, t, n) {
664
+ var r = !0, a = !0;
665
+ if (typeof e != "function")
666
+ throw new TypeError($s);
667
+ return ke(n) && (r = "leading" in n ? !!n.leading : r, a = "trailing" in n ? !!n.trailing : a), Jt(e, t, {
668
+ leading: r,
669
+ maxWait: t,
670
+ trailing: a
671
+ });
672
+ }
673
+ function Pe() {
674
+ return Pe = Object.assign ? Object.assign.bind() : function(e) {
675
+ for (var t = 1; t < arguments.length; t++) {
676
+ var n = arguments[t];
677
+ for (var r in n)
678
+ Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
679
+ }
680
+ return e;
681
+ }, Pe.apply(this, arguments);
682
+ }
683
+ function Ts(e, t) {
684
+ e.prototype = Object.create(t.prototype), e.prototype.constructor = e, ot(e, t);
685
+ }
686
+ function It(e) {
687
+ return It = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
688
+ return n.__proto__ || Object.getPrototypeOf(n);
689
+ }, It(e);
690
+ }
691
+ function ot(e, t) {
692
+ return ot = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, a) {
693
+ return r.__proto__ = a, r;
694
+ }, ot(e, t);
695
+ }
696
+ function Es() {
697
+ if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
698
+ if (typeof Proxy == "function") return !0;
699
+ try {
700
+ return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
701
+ })), !0;
702
+ } catch {
703
+ return !1;
704
+ }
705
+ }
706
+ function ht(e, t, n) {
707
+ return Es() ? ht = Reflect.construct.bind() : ht = function(a, o, i) {
708
+ var s = [null];
709
+ s.push.apply(s, o);
710
+ var l = Function.bind.apply(a, s), v = new l();
711
+ return i && ot(v, i.prototype), v;
712
+ }, ht.apply(null, arguments);
713
+ }
714
+ function As(e) {
715
+ return Function.toString.call(e).indexOf("[native code]") !== -1;
716
+ }
717
+ function Nt(e) {
718
+ var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
719
+ return Nt = function(r) {
720
+ if (r === null || !As(r)) return r;
721
+ if (typeof r != "function")
722
+ throw new TypeError("Super expression must either be null or a function");
723
+ if (typeof t < "u") {
724
+ if (t.has(r)) return t.get(r);
725
+ t.set(r, a);
726
+ }
727
+ function a() {
728
+ return ht(r, arguments, It(this).constructor);
729
+ }
730
+ return a.prototype = Object.create(r.prototype, {
731
+ constructor: {
732
+ value: a,
733
+ enumerable: !1,
734
+ writable: !0,
735
+ configurable: !0
736
+ }
737
+ }), ot(a, r);
738
+ }, Nt(e);
739
+ }
740
+ var Os = /%[sdj%]/g, ir = function() {
741
+ };
742
+ typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (ir = function(t, n) {
743
+ typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && n.every(function(r) {
744
+ return typeof r == "string";
745
+ }) && console.warn(t, n);
746
+ });
747
+ function Ut(e) {
748
+ if (!e || !e.length) return null;
749
+ var t = {};
750
+ return e.forEach(function(n) {
751
+ var r = n.field;
752
+ t[r] = t[r] || [], t[r].push(n);
753
+ }), t;
754
+ }
755
+ function me(e) {
756
+ for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
757
+ n[r - 1] = arguments[r];
758
+ var a = 0, o = n.length;
759
+ if (typeof e == "function")
760
+ return e.apply(null, n);
761
+ if (typeof e == "string") {
762
+ var i = e.replace(Os, function(s) {
763
+ if (s === "%%")
764
+ return "%";
765
+ if (a >= o)
766
+ return s;
767
+ switch (s) {
768
+ case "%s":
769
+ return String(n[a++]);
770
+ case "%d":
771
+ return Number(n[a++]);
772
+ case "%j":
773
+ try {
774
+ return JSON.stringify(n[a++]);
775
+ } catch {
776
+ return "[Circular]";
777
+ }
778
+ break;
779
+ default:
780
+ return s;
781
+ }
782
+ });
783
+ return i;
784
+ }
785
+ return e;
786
+ }
787
+ function js(e) {
788
+ return e === "string" || e === "url" || e === "hex" || e === "email" || e === "date" || e === "pattern";
789
+ }
790
+ function ae(e, t) {
791
+ return !!(e == null || t === "array" && Array.isArray(e) && !e.length || js(t) && typeof e == "string" && !e);
792
+ }
793
+ function Ss(e, t, n) {
794
+ var r = [], a = 0, o = e.length;
795
+ function i(s) {
796
+ r.push.apply(r, s || []), a++, a === o && n(r);
797
+ }
798
+ e.forEach(function(s) {
799
+ t(s, i);
800
+ });
801
+ }
802
+ function En(e, t, n) {
803
+ var r = 0, a = e.length;
804
+ function o(i) {
805
+ if (i && i.length) {
806
+ n(i);
807
+ return;
808
+ }
809
+ var s = r;
810
+ r = r + 1, s < a ? t(e[s], o) : n([]);
811
+ }
812
+ o([]);
813
+ }
814
+ function ks(e) {
815
+ var t = [];
816
+ return Object.keys(e).forEach(function(n) {
817
+ t.push.apply(t, e[n] || []);
818
+ }), t;
819
+ }
820
+ var An = /* @__PURE__ */ function(e) {
821
+ Ts(t, e);
822
+ function t(n, r) {
823
+ var a;
824
+ return a = e.call(this, "Async Validation Error") || this, a.errors = n, a.fields = r, a;
825
+ }
826
+ return t;
827
+ }(/* @__PURE__ */ Nt(Error));
828
+ function Ms(e, t, n, r, a) {
829
+ if (t.first) {
830
+ var o = new Promise(function(d, y) {
831
+ var w = function(u) {
832
+ return r(u), u.length ? y(new An(u, Ut(u))) : d(a);
833
+ }, $ = ks(e);
834
+ En($, n, w);
835
+ });
836
+ return o.catch(function(d) {
837
+ return d;
838
+ }), o;
839
+ }
840
+ var i = t.firstFields === !0 ? Object.keys(e) : t.firstFields || [], s = Object.keys(e), l = s.length, v = 0, m = [], p = new Promise(function(d, y) {
841
+ var w = function(g) {
842
+ if (m.push.apply(m, g), v++, v === l)
843
+ return r(m), m.length ? y(new An(m, Ut(m))) : d(a);
844
+ };
845
+ s.length || (r(m), d(a)), s.forEach(function($) {
846
+ var g = e[$];
847
+ i.indexOf($) !== -1 ? En(g, n, w) : Ss(g, n, w);
848
+ });
849
+ });
850
+ return p.catch(function(d) {
851
+ return d;
852
+ }), p;
853
+ }
854
+ function qs(e) {
855
+ return !!(e && e.message !== void 0);
856
+ }
857
+ function Ds(e, t) {
858
+ for (var n = e, r = 0; r < t.length; r++) {
859
+ if (n == null)
860
+ return n;
861
+ n = n[t[r]];
862
+ }
863
+ return n;
864
+ }
865
+ function On(e, t) {
866
+ return function(n) {
867
+ var r;
868
+ return e.fullFields ? r = Ds(t, e.fullFields) : r = t[n.field || e.fullField], qs(n) ? (n.field = n.field || e.fullField, n.fieldValue = r, n) : {
869
+ message: typeof n == "function" ? n() : n,
870
+ fieldValue: r,
871
+ field: n.field || e.fullField
872
+ };
873
+ };
874
+ }
875
+ function jn(e, t) {
876
+ if (t) {
877
+ for (var n in t)
878
+ if (t.hasOwnProperty(n)) {
879
+ var r = t[n];
880
+ typeof r == "object" && typeof e[n] == "object" ? e[n] = Pe({}, e[n], r) : e[n] = r;
881
+ }
882
+ }
883
+ return e;
884
+ }
885
+ var or = function(t, n, r, a, o, i) {
886
+ t.required && (!r.hasOwnProperty(t.field) || ae(n, i || t.type)) && a.push(me(o.messages.required, t.fullField));
887
+ }, Ps = function(t, n, r, a, o) {
888
+ (/^\s+$/.test(n) || n === "") && a.push(me(o.messages.whitespace, t.fullField));
889
+ }, yt, xs = function() {
890
+ if (yt)
891
+ return yt;
892
+ var e = "[a-fA-F\\d:]", t = function(T) {
893
+ return T && T.includeBoundaries ? "(?:(?<=\\s|^)(?=" + e + ")|(?<=" + e + ")(?=\\s|$))" : "";
894
+ }, n = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", r = "[a-fA-F\\d]{1,4}", a = (`
895
+ (?:
896
+ (?:` + r + ":){7}(?:" + r + `|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
897
+ (?:` + r + ":){6}(?:" + n + "|:" + r + `|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
898
+ (?:` + r + ":){5}(?::" + n + "|(?::" + r + `){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
899
+ (?:` + r + ":){4}(?:(?::" + r + "){0,1}:" + n + "|(?::" + r + `){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
900
+ (?:` + r + ":){3}(?:(?::" + r + "){0,2}:" + n + "|(?::" + r + `){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
901
+ (?:` + r + ":){2}(?:(?::" + r + "){0,3}:" + n + "|(?::" + r + `){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
902
+ (?:` + r + ":){1}(?:(?::" + r + "){0,4}:" + n + "|(?::" + r + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
903
+ (?::(?:(?::` + r + "){0,5}:" + n + "|(?::" + r + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
904
+ )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
905
+ `).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), o = new RegExp("(?:^" + n + "$)|(?:^" + a + "$)"), i = new RegExp("^" + n + "$"), s = new RegExp("^" + a + "$"), l = function(T) {
906
+ return T && T.exact ? o : new RegExp("(?:" + t(T) + n + t(T) + ")|(?:" + t(T) + a + t(T) + ")", "g");
907
+ };
908
+ l.v4 = function(c) {
909
+ return c && c.exact ? i : new RegExp("" + t(c) + n + t(c), "g");
910
+ }, l.v6 = function(c) {
911
+ return c && c.exact ? s : new RegExp("" + t(c) + a + t(c), "g");
912
+ };
913
+ var v = "(?:(?:[a-z]+:)?//)", m = "(?:\\S+(?::\\S*)?@)?", p = l.v4().source, d = l.v6().source, y = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", w = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", $ = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", g = "(?::\\d{2,5})?", u = '(?:[/?#][^\\s"]*)?', F = "(?:" + v + "|www\\.)" + m + "(?:localhost|" + p + "|" + d + "|" + y + w + $ + ")" + g + u;
914
+ return yt = new RegExp("(?:^" + F + "$)", "i"), yt;
915
+ }, Sn = {
916
+ // http://emailregex.com/
917
+ email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
918
+ // url: new RegExp(
919
+ // '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$',
920
+ // 'i',
921
+ // ),
922
+ hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
923
+ }, et = {
924
+ integer: function(t) {
925
+ return et.number(t) && parseInt(t, 10) === t;
926
+ },
927
+ float: function(t) {
928
+ return et.number(t) && !et.integer(t);
929
+ },
930
+ array: function(t) {
931
+ return Array.isArray(t);
932
+ },
933
+ regexp: function(t) {
934
+ if (t instanceof RegExp)
935
+ return !0;
936
+ try {
937
+ return !!new RegExp(t);
938
+ } catch {
939
+ return !1;
940
+ }
941
+ },
942
+ date: function(t) {
943
+ return typeof t.getTime == "function" && typeof t.getMonth == "function" && typeof t.getYear == "function" && !isNaN(t.getTime());
944
+ },
945
+ number: function(t) {
946
+ return isNaN(t) ? !1 : typeof t == "number";
947
+ },
948
+ object: function(t) {
949
+ return typeof t == "object" && !et.array(t);
950
+ },
951
+ method: function(t) {
952
+ return typeof t == "function";
953
+ },
954
+ email: function(t) {
955
+ return typeof t == "string" && t.length <= 320 && !!t.match(Sn.email);
956
+ },
957
+ url: function(t) {
958
+ return typeof t == "string" && t.length <= 2048 && !!t.match(xs());
959
+ },
960
+ hex: function(t) {
961
+ return typeof t == "string" && !!t.match(Sn.hex);
962
+ }
963
+ }, Cs = function(t, n, r, a, o) {
964
+ if (t.required && n === void 0) {
965
+ or(t, n, r, a, o);
966
+ return;
967
+ }
968
+ var i = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], s = t.type;
969
+ i.indexOf(s) > -1 ? et[s](n) || a.push(me(o.messages.types[s], t.fullField, t.type)) : s && typeof n !== t.type && a.push(me(o.messages.types[s], t.fullField, t.type));
970
+ }, Rs = function(t, n, r, a, o) {
971
+ var i = typeof t.len == "number", s = typeof t.min == "number", l = typeof t.max == "number", v = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, m = n, p = null, d = typeof n == "number", y = typeof n == "string", w = Array.isArray(n);
972
+ if (d ? p = "number" : y ? p = "string" : w && (p = "array"), !p)
973
+ return !1;
974
+ w && (m = n.length), y && (m = n.replace(v, "_").length), i ? m !== t.len && a.push(me(o.messages[p].len, t.fullField, t.len)) : s && !l && m < t.min ? a.push(me(o.messages[p].min, t.fullField, t.min)) : l && !s && m > t.max ? a.push(me(o.messages[p].max, t.fullField, t.max)) : s && l && (m < t.min || m > t.max) && a.push(me(o.messages[p].range, t.fullField, t.min, t.max));
975
+ }, Ve = "enum", Vs = function(t, n, r, a, o) {
976
+ t[Ve] = Array.isArray(t[Ve]) ? t[Ve] : [], t[Ve].indexOf(n) === -1 && a.push(me(o.messages[Ve], t.fullField, t[Ve].join(", ")));
977
+ }, Is = function(t, n, r, a, o) {
978
+ if (t.pattern) {
979
+ if (t.pattern instanceof RegExp)
980
+ t.pattern.lastIndex = 0, t.pattern.test(n) || a.push(me(o.messages.pattern.mismatch, t.fullField, n, t.pattern));
981
+ else if (typeof t.pattern == "string") {
982
+ var i = new RegExp(t.pattern);
983
+ i.test(n) || a.push(me(o.messages.pattern.mismatch, t.fullField, n, t.pattern));
984
+ }
985
+ }
986
+ }, z = {
987
+ required: or,
988
+ whitespace: Ps,
989
+ type: Cs,
990
+ range: Rs,
991
+ enum: Vs,
992
+ pattern: Is
993
+ }, Ns = function(t, n, r, a, o) {
994
+ var i = [], s = t.required || !t.required && a.hasOwnProperty(t.field);
995
+ if (s) {
996
+ if (ae(n, "string") && !t.required)
997
+ return r();
998
+ z.required(t, n, a, i, o, "string"), ae(n, "string") || (z.type(t, n, a, i, o), z.range(t, n, a, i, o), z.pattern(t, n, a, i, o), t.whitespace === !0 && z.whitespace(t, n, a, i, o));
999
+ }
1000
+ r(i);
1001
+ }, Us = function(t, n, r, a, o) {
1002
+ var i = [], s = t.required || !t.required && a.hasOwnProperty(t.field);
1003
+ if (s) {
1004
+ if (ae(n) && !t.required)
1005
+ return r();
1006
+ z.required(t, n, a, i, o), n !== void 0 && z.type(t, n, a, i, o);
1007
+ }
1008
+ r(i);
1009
+ }, Ls = function(t, n, r, a, o) {
1010
+ var i = [], s = t.required || !t.required && a.hasOwnProperty(t.field);
1011
+ if (s) {
1012
+ if (n === "" && (n = void 0), ae(n) && !t.required)
1013
+ return r();
1014
+ z.required(t, n, a, i, o), n !== void 0 && (z.type(t, n, a, i, o), z.range(t, n, a, i, o));
1015
+ }
1016
+ r(i);
1017
+ }, Bs = function(t, n, r, a, o) {
1018
+ var i = [], s = t.required || !t.required && a.hasOwnProperty(t.field);
1019
+ if (s) {
1020
+ if (ae(n) && !t.required)
1021
+ return r();
1022
+ z.required(t, n, a, i, o), n !== void 0 && z.type(t, n, a, i, o);
1023
+ }
1024
+ r(i);
1025
+ }, Ws = function(t, n, r, a, o) {
1026
+ var i = [], s = t.required || !t.required && a.hasOwnProperty(t.field);
1027
+ if (s) {
1028
+ if (ae(n) && !t.required)
1029
+ return r();
1030
+ z.required(t, n, a, i, o), ae(n) || z.type(t, n, a, i, o);
1031
+ }
1032
+ r(i);
1033
+ }, zs = function(t, n, r, a, o) {
1034
+ var i = [], s = t.required || !t.required && a.hasOwnProperty(t.field);
1035
+ if (s) {
1036
+ if (ae(n) && !t.required)
1037
+ return r();
1038
+ z.required(t, n, a, i, o), n !== void 0 && (z.type(t, n, a, i, o), z.range(t, n, a, i, o));
1039
+ }
1040
+ r(i);
1041
+ }, Ys = function(t, n, r, a, o) {
1042
+ var i = [], s = t.required || !t.required && a.hasOwnProperty(t.field);
1043
+ if (s) {
1044
+ if (ae(n) && !t.required)
1045
+ return r();
1046
+ z.required(t, n, a, i, o), n !== void 0 && (z.type(t, n, a, i, o), z.range(t, n, a, i, o));
1047
+ }
1048
+ r(i);
1049
+ }, Gs = function(t, n, r, a, o) {
1050
+ var i = [], s = t.required || !t.required && a.hasOwnProperty(t.field);
1051
+ if (s) {
1052
+ if (n == null && !t.required)
1053
+ return r();
1054
+ z.required(t, n, a, i, o, "array"), n != null && (z.type(t, n, a, i, o), z.range(t, n, a, i, o));
1055
+ }
1056
+ r(i);
1057
+ }, Hs = function(t, n, r, a, o) {
1058
+ var i = [], s = t.required || !t.required && a.hasOwnProperty(t.field);
1059
+ if (s) {
1060
+ if (ae(n) && !t.required)
1061
+ return r();
1062
+ z.required(t, n, a, i, o), n !== void 0 && z.type(t, n, a, i, o);
1063
+ }
1064
+ r(i);
1065
+ }, Zs = "enum", Ks = function(t, n, r, a, o) {
1066
+ var i = [], s = t.required || !t.required && a.hasOwnProperty(t.field);
1067
+ if (s) {
1068
+ if (ae(n) && !t.required)
1069
+ return r();
1070
+ z.required(t, n, a, i, o), n !== void 0 && z[Zs](t, n, a, i, o);
1071
+ }
1072
+ r(i);
1073
+ }, Js = function(t, n, r, a, o) {
1074
+ var i = [], s = t.required || !t.required && a.hasOwnProperty(t.field);
1075
+ if (s) {
1076
+ if (ae(n, "string") && !t.required)
1077
+ return r();
1078
+ z.required(t, n, a, i, o), ae(n, "string") || z.pattern(t, n, a, i, o);
1079
+ }
1080
+ r(i);
1081
+ }, Xs = function(t, n, r, a, o) {
1082
+ var i = [], s = t.required || !t.required && a.hasOwnProperty(t.field);
1083
+ if (s) {
1084
+ if (ae(n, "date") && !t.required)
1085
+ return r();
1086
+ if (z.required(t, n, a, i, o), !ae(n, "date")) {
1087
+ var l;
1088
+ n instanceof Date ? l = n : l = new Date(n), z.type(t, l, a, i, o), l && z.range(t, l.getTime(), a, i, o);
1089
+ }
1090
+ }
1091
+ r(i);
1092
+ }, Qs = function(t, n, r, a, o) {
1093
+ var i = [], s = Array.isArray(n) ? "array" : typeof n;
1094
+ z.required(t, n, a, i, o, s), r(i);
1095
+ }, Mt = function(t, n, r, a, o) {
1096
+ var i = t.type, s = [], l = t.required || !t.required && a.hasOwnProperty(t.field);
1097
+ if (l) {
1098
+ if (ae(n, i) && !t.required)
1099
+ return r();
1100
+ z.required(t, n, a, s, o, i), ae(n, i) || z.type(t, n, a, s, o);
1101
+ }
1102
+ r(s);
1103
+ }, _s = function(t, n, r, a, o) {
1104
+ var i = [], s = t.required || !t.required && a.hasOwnProperty(t.field);
1105
+ if (s) {
1106
+ if (ae(n) && !t.required)
1107
+ return r();
1108
+ z.required(t, n, a, i, o);
1109
+ }
1110
+ r(i);
1111
+ }, nt = {
1112
+ string: Ns,
1113
+ method: Us,
1114
+ number: Ls,
1115
+ boolean: Bs,
1116
+ regexp: Ws,
1117
+ integer: zs,
1118
+ float: Ys,
1119
+ array: Gs,
1120
+ object: Hs,
1121
+ enum: Ks,
1122
+ pattern: Js,
1123
+ date: Xs,
1124
+ url: Mt,
1125
+ hex: Mt,
1126
+ email: Mt,
1127
+ required: Qs,
1128
+ any: _s
1129
+ };
1130
+ function Lt() {
1131
+ return {
1132
+ default: "Validation error on field %s",
1133
+ required: "%s is required",
1134
+ enum: "%s must be one of %s",
1135
+ whitespace: "%s cannot be empty",
1136
+ date: {
1137
+ format: "%s date %s is invalid for format %s",
1138
+ parse: "%s date could not be parsed, %s is invalid ",
1139
+ invalid: "%s date %s is invalid"
1140
+ },
1141
+ types: {
1142
+ string: "%s is not a %s",
1143
+ method: "%s is not a %s (function)",
1144
+ array: "%s is not an %s",
1145
+ object: "%s is not an %s",
1146
+ number: "%s is not a %s",
1147
+ date: "%s is not a %s",
1148
+ boolean: "%s is not a %s",
1149
+ integer: "%s is not an %s",
1150
+ float: "%s is not a %s",
1151
+ regexp: "%s is not a valid %s",
1152
+ email: "%s is not a valid %s",
1153
+ url: "%s is not a valid %s",
1154
+ hex: "%s is not a valid %s"
1155
+ },
1156
+ string: {
1157
+ len: "%s must be exactly %s characters",
1158
+ min: "%s must be at least %s characters",
1159
+ max: "%s cannot be longer than %s characters",
1160
+ range: "%s must be between %s and %s characters"
1161
+ },
1162
+ number: {
1163
+ len: "%s must equal %s",
1164
+ min: "%s cannot be less than %s",
1165
+ max: "%s cannot be greater than %s",
1166
+ range: "%s must be between %s and %s"
1167
+ },
1168
+ array: {
1169
+ len: "%s must be exactly %s in length",
1170
+ min: "%s cannot be less than %s in length",
1171
+ max: "%s cannot be greater than %s in length",
1172
+ range: "%s must be between %s and %s in length"
1173
+ },
1174
+ pattern: {
1175
+ mismatch: "%s value %s does not match pattern %s"
1176
+ },
1177
+ clone: function() {
1178
+ var t = JSON.parse(JSON.stringify(this));
1179
+ return t.clone = this.clone, t;
1180
+ }
1181
+ };
1182
+ }
1183
+ var Bt = Lt(), ut = /* @__PURE__ */ function() {
1184
+ function e(n) {
1185
+ this.rules = null, this._messages = Bt, this.define(n);
1186
+ }
1187
+ var t = e.prototype;
1188
+ return t.define = function(r) {
1189
+ var a = this;
1190
+ if (!r)
1191
+ throw new Error("Cannot configure a schema with no rules");
1192
+ if (typeof r != "object" || Array.isArray(r))
1193
+ throw new Error("Rules must be an object");
1194
+ this.rules = {}, Object.keys(r).forEach(function(o) {
1195
+ var i = r[o];
1196
+ a.rules[o] = Array.isArray(i) ? i : [i];
1197
+ });
1198
+ }, t.messages = function(r) {
1199
+ return r && (this._messages = jn(Lt(), r)), this._messages;
1200
+ }, t.validate = function(r, a, o) {
1201
+ var i = this;
1202
+ a === void 0 && (a = {}), o === void 0 && (o = function() {
1203
+ });
1204
+ var s = r, l = a, v = o;
1205
+ if (typeof l == "function" && (v = l, l = {}), !this.rules || Object.keys(this.rules).length === 0)
1206
+ return v && v(null, s), Promise.resolve(s);
1207
+ function m($) {
1208
+ var g = [], u = {};
1209
+ function F(T) {
1210
+ if (Array.isArray(T)) {
1211
+ var A;
1212
+ g = (A = g).concat.apply(A, T);
1213
+ } else
1214
+ g.push(T);
1215
+ }
1216
+ for (var c = 0; c < $.length; c++)
1217
+ F($[c]);
1218
+ g.length ? (u = Ut(g), v(g, u)) : v(null, s);
1219
+ }
1220
+ if (l.messages) {
1221
+ var p = this.messages();
1222
+ p === Bt && (p = Lt()), jn(p, l.messages), l.messages = p;
1223
+ } else
1224
+ l.messages = this.messages();
1225
+ var d = {}, y = l.keys || Object.keys(this.rules);
1226
+ y.forEach(function($) {
1227
+ var g = i.rules[$], u = s[$];
1228
+ g.forEach(function(F) {
1229
+ var c = F;
1230
+ typeof c.transform == "function" && (s === r && (s = Pe({}, s)), u = s[$] = c.transform(u)), typeof c == "function" ? c = {
1231
+ validator: c
1232
+ } : c = Pe({}, c), c.validator = i.getValidationMethod(c), c.validator && (c.field = $, c.fullField = c.fullField || $, c.type = i.getType(c), d[$] = d[$] || [], d[$].push({
1233
+ rule: c,
1234
+ value: u,
1235
+ source: s,
1236
+ field: $
1237
+ }));
1238
+ });
1239
+ });
1240
+ var w = {};
1241
+ return Ms(d, l, function($, g) {
1242
+ var u = $.rule, F = (u.type === "object" || u.type === "array") && (typeof u.fields == "object" || typeof u.defaultField == "object");
1243
+ F = F && (u.required || !u.required && $.value), u.field = $.field;
1244
+ function c(E, P) {
1245
+ return Pe({}, P, {
1246
+ fullField: u.fullField + "." + E,
1247
+ fullFields: u.fullFields ? [].concat(u.fullFields, [E]) : [E]
1248
+ });
1249
+ }
1250
+ function T(E) {
1251
+ E === void 0 && (E = []);
1252
+ var P = Array.isArray(E) ? E : [E];
1253
+ !l.suppressWarning && P.length && e.warning("async-validator:", P), P.length && u.message !== void 0 && (P = [].concat(u.message));
1254
+ var S = P.map(On(u, s));
1255
+ if (l.first && S.length)
1256
+ return w[u.field] = 1, g(S);
1257
+ if (!F)
1258
+ g(S);
1259
+ else {
1260
+ if (u.required && !$.value)
1261
+ return u.message !== void 0 ? S = [].concat(u.message).map(On(u, s)) : l.error && (S = [l.error(u, me(l.messages.required, u.field))]), g(S);
1262
+ var q = {};
1263
+ u.defaultField && Object.keys($.value).map(function(O) {
1264
+ q[O] = u.defaultField;
1265
+ }), q = Pe({}, q, $.rule.fields);
1266
+ var D = {};
1267
+ Object.keys(q).forEach(function(O) {
1268
+ var V = q[O], I = Array.isArray(V) ? V : [V];
1269
+ D[O] = I.map(c.bind(null, O));
1270
+ });
1271
+ var C = new e(D);
1272
+ C.messages(l.messages), $.rule.options && ($.rule.options.messages = l.messages, $.rule.options.error = l.error), C.validate($.value, $.rule.options || l, function(O) {
1273
+ var V = [];
1274
+ S && S.length && V.push.apply(V, S), O && O.length && V.push.apply(V, O), g(V.length ? V : null);
1275
+ });
1276
+ }
1277
+ }
1278
+ var A;
1279
+ if (u.asyncValidator)
1280
+ A = u.asyncValidator(u, $.value, T, $.source, l);
1281
+ else if (u.validator) {
1282
+ try {
1283
+ A = u.validator(u, $.value, T, $.source, l);
1284
+ } catch (E) {
1285
+ console.error == null || console.error(E), l.suppressValidatorError || setTimeout(function() {
1286
+ throw E;
1287
+ }, 0), T(E.message);
1288
+ }
1289
+ A === !0 ? T() : A === !1 ? T(typeof u.message == "function" ? u.message(u.fullField || u.field) : u.message || (u.fullField || u.field) + " fails") : A instanceof Array ? T(A) : A instanceof Error && T(A.message);
1290
+ }
1291
+ A && A.then && A.then(function() {
1292
+ return T();
1293
+ }, function(E) {
1294
+ return T(E);
1295
+ });
1296
+ }, function($) {
1297
+ m($);
1298
+ }, s);
1299
+ }, t.getType = function(r) {
1300
+ if (r.type === void 0 && r.pattern instanceof RegExp && (r.type = "pattern"), typeof r.validator != "function" && r.type && !nt.hasOwnProperty(r.type))
1301
+ throw new Error(me("Unknown rule type %s", r.type));
1302
+ return r.type || "string";
1303
+ }, t.getValidationMethod = function(r) {
1304
+ if (typeof r.validator == "function")
1305
+ return r.validator;
1306
+ var a = Object.keys(r), o = a.indexOf("message");
1307
+ return o !== -1 && a.splice(o, 1), a.length === 1 && a[0] === "required" ? nt.required : nt[this.getType(r)] || void 0;
1308
+ }, e;
1309
+ }();
1310
+ ut.register = function(t, n) {
1311
+ if (typeof n != "function")
1312
+ throw new Error("Cannot register a validator by type, validator is not a function");
1313
+ nt[t] = n;
1314
+ };
1315
+ ut.warning = ir;
1316
+ ut.messages = Bt;
1317
+ ut.validators = nt;
1318
+ var fe = /* @__PURE__ */ ((e) => (e.Input = "input", e.InputNumber = "inputNumber", e.Select = "select", e.MultiSelect = "multiSelect", e.Cascader = "cascader", e.Radio = "radio", e.Checkbox = "checkbox", e.Switch = "switch", e.DatePicker = "datePicker", e.DateTimePicker = "dateTimePicker", e.Upload = "upload", e.DynamicTable = "dynamicTable", e.DynamicForm = "dynamicForm", e.DynamicTabs = "dynamicTabs", e.Title = "title", e.Collapse = "collapse", e.ImageList = "imageList", e.CombinedFields = "combinedFields", e))(fe || {});
1319
+ const sr = [
1320
+ fe.Select,
1321
+ fe.MultiSelect,
1322
+ fe.Cascader,
1323
+ fe.Radio
1324
+ ], el = [
1325
+ fe.DynamicForm,
1326
+ fe.DynamicTable,
1327
+ fe.DynamicTabs
1328
+ ];
1329
+ var tl = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
1330
+ function nl(e) {
1331
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1332
+ }
1333
+ var lr = { exports: {} };
1334
+ (function(e, t) {
1335
+ (function(n, r) {
1336
+ e.exports = r();
1337
+ })(tl, function() {
1338
+ var n = 1e3, r = 6e4, a = 36e5, o = "millisecond", i = "second", s = "minute", l = "hour", v = "day", m = "week", p = "month", d = "quarter", y = "year", w = "date", $ = "Invalid Date", g = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, u = /\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, F = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(I) {
1339
+ var k = ["th", "st", "nd", "rd"], f = I % 100;
1340
+ return "[" + I + (k[(f - 20) % 10] || k[f] || k[0]) + "]";
1341
+ } }, c = function(I, k, f) {
1342
+ var b = String(I);
1343
+ return !b || b.length >= k ? I : "" + Array(k + 1 - b.length).join(f) + I;
1344
+ }, T = { s: c, z: function(I) {
1345
+ var k = -I.utcOffset(), f = Math.abs(k), b = Math.floor(f / 60), h = f % 60;
1346
+ return (k <= 0 ? "+" : "-") + c(b, 2, "0") + ":" + c(h, 2, "0");
1347
+ }, m: function I(k, f) {
1348
+ if (k.date() < f.date()) return -I(f, k);
1349
+ var b = 12 * (f.year() - k.year()) + (f.month() - k.month()), h = k.clone().add(b, p), j = f - h < 0, R = k.clone().add(b + (j ? -1 : 1), p);
1350
+ return +(-(b + (f - h) / (j ? h - R : R - h)) || 0);
1351
+ }, a: function(I) {
1352
+ return I < 0 ? Math.ceil(I) || 0 : Math.floor(I);
1353
+ }, p: function(I) {
1354
+ return { M: p, y, w: m, d: v, D: w, h: l, m: s, s: i, ms: o, Q: d }[I] || String(I || "").toLowerCase().replace(/s$/, "");
1355
+ }, u: function(I) {
1356
+ return I === void 0;
1357
+ } }, A = "en", E = {};
1358
+ E[A] = F;
1359
+ var P = "$isDayjsObject", S = function(I) {
1360
+ return I instanceof O || !(!I || !I[P]);
1361
+ }, q = function I(k, f, b) {
1362
+ var h;
1363
+ if (!k) return A;
1364
+ if (typeof k == "string") {
1365
+ var j = k.toLowerCase();
1366
+ E[j] && (h = j), f && (E[j] = f, h = j);
1367
+ var R = k.split("-");
1368
+ if (!h && R.length > 1) return I(R[0]);
1369
+ } else {
1370
+ var N = k.name;
1371
+ E[N] = k, h = N;
1372
+ }
1373
+ return !b && h && (A = h), h || !b && A;
1374
+ }, D = function(I, k) {
1375
+ if (S(I)) return I.clone();
1376
+ var f = typeof k == "object" ? k : {};
1377
+ return f.date = I, f.args = arguments, new O(f);
1378
+ }, C = T;
1379
+ C.l = q, C.i = S, C.w = function(I, k) {
1380
+ return D(I, { locale: k.$L, utc: k.$u, x: k.$x, $offset: k.$offset });
1381
+ };
1382
+ var O = function() {
1383
+ function I(f) {
1384
+ this.$L = q(f.locale, null, !0), this.parse(f), this.$x = this.$x || f.x || {}, this[P] = !0;
1385
+ }
1386
+ var k = I.prototype;
1387
+ return k.parse = function(f) {
1388
+ this.$d = function(b) {
1389
+ var h = b.date, j = b.utc;
1390
+ if (h === null) return /* @__PURE__ */ new Date(NaN);
1391
+ if (C.u(h)) return /* @__PURE__ */ new Date();
1392
+ if (h instanceof Date) return new Date(h);
1393
+ if (typeof h == "string" && !/Z$/i.test(h)) {
1394
+ var R = h.match(g);
1395
+ if (R) {
1396
+ var N = R[2] - 1 || 0, G = (R[7] || "0").substring(0, 3);
1397
+ return j ? new Date(Date.UTC(R[1], N, R[3] || 1, R[4] || 0, R[5] || 0, R[6] || 0, G)) : new Date(R[1], N, R[3] || 1, R[4] || 0, R[5] || 0, R[6] || 0, G);
1398
+ }
1399
+ }
1400
+ return new Date(h);
1401
+ }(f), this.init();
1402
+ }, k.init = function() {
1403
+ var f = this.$d;
1404
+ this.$y = f.getFullYear(), this.$M = f.getMonth(), this.$D = f.getDate(), this.$W = f.getDay(), this.$H = f.getHours(), this.$m = f.getMinutes(), this.$s = f.getSeconds(), this.$ms = f.getMilliseconds();
1405
+ }, k.$utils = function() {
1406
+ return C;
1407
+ }, k.isValid = function() {
1408
+ return this.$d.toString() !== $;
1409
+ }, k.isSame = function(f, b) {
1410
+ var h = D(f);
1411
+ return this.startOf(b) <= h && h <= this.endOf(b);
1412
+ }, k.isAfter = function(f, b) {
1413
+ return D(f) < this.startOf(b);
1414
+ }, k.isBefore = function(f, b) {
1415
+ return this.endOf(b) < D(f);
1416
+ }, k.$g = function(f, b, h) {
1417
+ return C.u(f) ? this[b] : this.set(h, f);
1418
+ }, k.unix = function() {
1419
+ return Math.floor(this.valueOf() / 1e3);
1420
+ }, k.valueOf = function() {
1421
+ return this.$d.getTime();
1422
+ }, k.startOf = function(f, b) {
1423
+ var h = this, j = !!C.u(b) || b, R = C.p(f), N = function(we, oe) {
1424
+ var he = C.w(h.$u ? Date.UTC(h.$y, oe, we) : new Date(h.$y, oe, we), h);
1425
+ return j ? he : he.endOf(v);
1426
+ }, G = function(we, oe) {
1427
+ return C.w(h.toDate()[we].apply(h.toDate("s"), (j ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(oe)), h);
1428
+ }, X = this.$W, ne = this.$M, ie = this.$D, ce = "set" + (this.$u ? "UTC" : "");
1429
+ switch (R) {
1430
+ case y:
1431
+ return j ? N(1, 0) : N(31, 11);
1432
+ case p:
1433
+ return j ? N(1, ne) : N(0, ne + 1);
1434
+ case m:
1435
+ var be = this.$locale().weekStart || 0, Ee = (X < be ? X + 7 : X) - be;
1436
+ return N(j ? ie - Ee : ie + (6 - Ee), ne);
1437
+ case v:
1438
+ case w:
1439
+ return G(ce + "Hours", 0);
1440
+ case l:
1441
+ return G(ce + "Minutes", 1);
1442
+ case s:
1443
+ return G(ce + "Seconds", 2);
1444
+ case i:
1445
+ return G(ce + "Milliseconds", 3);
1446
+ default:
1447
+ return this.clone();
1448
+ }
1449
+ }, k.endOf = function(f) {
1450
+ return this.startOf(f, !1);
1451
+ }, k.$set = function(f, b) {
1452
+ var h, j = C.p(f), R = "set" + (this.$u ? "UTC" : ""), N = (h = {}, h[v] = R + "Date", h[w] = R + "Date", h[p] = R + "Month", h[y] = R + "FullYear", h[l] = R + "Hours", h[s] = R + "Minutes", h[i] = R + "Seconds", h[o] = R + "Milliseconds", h)[j], G = j === v ? this.$D + (b - this.$W) : b;
1453
+ if (j === p || j === y) {
1454
+ var X = this.clone().set(w, 1);
1455
+ X.$d[N](G), X.init(), this.$d = X.set(w, Math.min(this.$D, X.daysInMonth())).$d;
1456
+ } else N && this.$d[N](G);
1457
+ return this.init(), this;
1458
+ }, k.set = function(f, b) {
1459
+ return this.clone().$set(f, b);
1460
+ }, k.get = function(f) {
1461
+ return this[C.p(f)]();
1462
+ }, k.add = function(f, b) {
1463
+ var h, j = this;
1464
+ f = Number(f);
1465
+ var R = C.p(b), N = function(ne) {
1466
+ var ie = D(j);
1467
+ return C.w(ie.date(ie.date() + Math.round(ne * f)), j);
1468
+ };
1469
+ if (R === p) return this.set(p, this.$M + f);
1470
+ if (R === y) return this.set(y, this.$y + f);
1471
+ if (R === v) return N(1);
1472
+ if (R === m) return N(7);
1473
+ var G = (h = {}, h[s] = r, h[l] = a, h[i] = n, h)[R] || 1, X = this.$d.getTime() + f * G;
1474
+ return C.w(X, this);
1475
+ }, k.subtract = function(f, b) {
1476
+ return this.add(-1 * f, b);
1477
+ }, k.format = function(f) {
1478
+ var b = this, h = this.$locale();
1479
+ if (!this.isValid()) return h.invalidDate || $;
1480
+ var j = f || "YYYY-MM-DDTHH:mm:ssZ", R = C.z(this), N = this.$H, G = this.$m, X = this.$M, ne = h.weekdays, ie = h.months, ce = h.meridiem, be = function(oe, he, Ae, M) {
1481
+ return oe && (oe[he] || oe(b, j)) || Ae[he].slice(0, M);
1482
+ }, Ee = function(oe) {
1483
+ return C.s(N % 12 || 12, oe, "0");
1484
+ }, we = ce || function(oe, he, Ae) {
1485
+ var M = oe < 12 ? "AM" : "PM";
1486
+ return Ae ? M.toLowerCase() : M;
1487
+ };
1488
+ return j.replace(u, function(oe, he) {
1489
+ return he || function(Ae) {
1490
+ switch (Ae) {
1491
+ case "YY":
1492
+ return String(b.$y).slice(-2);
1493
+ case "YYYY":
1494
+ return C.s(b.$y, 4, "0");
1495
+ case "M":
1496
+ return X + 1;
1497
+ case "MM":
1498
+ return C.s(X + 1, 2, "0");
1499
+ case "MMM":
1500
+ return be(h.monthsShort, X, ie, 3);
1501
+ case "MMMM":
1502
+ return be(ie, X);
1503
+ case "D":
1504
+ return b.$D;
1505
+ case "DD":
1506
+ return C.s(b.$D, 2, "0");
1507
+ case "d":
1508
+ return String(b.$W);
1509
+ case "dd":
1510
+ return be(h.weekdaysMin, b.$W, ne, 2);
1511
+ case "ddd":
1512
+ return be(h.weekdaysShort, b.$W, ne, 3);
1513
+ case "dddd":
1514
+ return ne[b.$W];
1515
+ case "H":
1516
+ return String(N);
1517
+ case "HH":
1518
+ return C.s(N, 2, "0");
1519
+ case "h":
1520
+ return Ee(1);
1521
+ case "hh":
1522
+ return Ee(2);
1523
+ case "a":
1524
+ return we(N, G, !0);
1525
+ case "A":
1526
+ return we(N, G, !1);
1527
+ case "m":
1528
+ return String(G);
1529
+ case "mm":
1530
+ return C.s(G, 2, "0");
1531
+ case "s":
1532
+ return String(b.$s);
1533
+ case "ss":
1534
+ return C.s(b.$s, 2, "0");
1535
+ case "SSS":
1536
+ return C.s(b.$ms, 3, "0");
1537
+ case "Z":
1538
+ return R;
1539
+ }
1540
+ return null;
1541
+ }(oe) || R.replace(":", "");
1542
+ });
1543
+ }, k.utcOffset = function() {
1544
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
1545
+ }, k.diff = function(f, b, h) {
1546
+ var j, R = this, N = C.p(b), G = D(f), X = (G.utcOffset() - this.utcOffset()) * r, ne = this - G, ie = function() {
1547
+ return C.m(R, G);
1548
+ };
1549
+ switch (N) {
1550
+ case y:
1551
+ j = ie() / 12;
1552
+ break;
1553
+ case p:
1554
+ j = ie();
1555
+ break;
1556
+ case d:
1557
+ j = ie() / 3;
1558
+ break;
1559
+ case m:
1560
+ j = (ne - X) / 6048e5;
1561
+ break;
1562
+ case v:
1563
+ j = (ne - X) / 864e5;
1564
+ break;
1565
+ case l:
1566
+ j = ne / a;
1567
+ break;
1568
+ case s:
1569
+ j = ne / r;
1570
+ break;
1571
+ case i:
1572
+ j = ne / n;
1573
+ break;
1574
+ default:
1575
+ j = ne;
1576
+ }
1577
+ return h ? j : C.a(j);
1578
+ }, k.daysInMonth = function() {
1579
+ return this.endOf(p).$D;
1580
+ }, k.$locale = function() {
1581
+ return E[this.$L];
1582
+ }, k.locale = function(f, b) {
1583
+ if (!f) return this.$L;
1584
+ var h = this.clone(), j = q(f, b, !0);
1585
+ return j && (h.$L = j), h;
1586
+ }, k.clone = function() {
1587
+ return C.w(this.$d, this);
1588
+ }, k.toDate = function() {
1589
+ return new Date(this.valueOf());
1590
+ }, k.toJSON = function() {
1591
+ return this.isValid() ? this.toISOString() : null;
1592
+ }, k.toISOString = function() {
1593
+ return this.$d.toISOString();
1594
+ }, k.toString = function() {
1595
+ return this.$d.toUTCString();
1596
+ }, I;
1597
+ }(), V = O.prototype;
1598
+ return D.prototype = V, [["$ms", o], ["$s", i], ["$m", s], ["$H", l], ["$W", v], ["$M", p], ["$y", y], ["$D", w]].forEach(function(I) {
1599
+ V[I[1]] = function(k) {
1600
+ return this.$g(k, I[0], I[1]);
1601
+ };
1602
+ }), D.extend = function(I, k) {
1603
+ return I.$i || (I(k, O, D), I.$i = !0), D;
1604
+ }, D.locale = q, D.isDayjs = S, D.unix = function(I) {
1605
+ return D(1e3 * I);
1606
+ }, D.en = E[A], D.Ls = E, D.p = {}, D;
1607
+ });
1608
+ })(lr);
1609
+ var rl = lr.exports;
1610
+ const al = /* @__PURE__ */ nl(rl), il = async (e, t, n, r, a) => {
1611
+ var s, l;
1612
+ const { remote: o } = e.component || {};
1613
+ if (!r || typeof r != "function")
1614
+ throw new Error("[form setup error]: requestFn is not found");
1615
+ const i = await r(
1616
+ n,
1617
+ t,
1618
+ typeof o == "object" ? o == null ? void 0 : o.url : "",
1619
+ typeof o == "object" ? H(o == null ? void 0 : o.extraParams) : {},
1620
+ void 0,
1621
+ a
1622
+ );
1623
+ !i || (s = a == null ? void 0 : a.signal) != null && s.aborted || Object.assign(e.component || {}, {
1624
+ props: { ...((l = e.component) == null ? void 0 : l.props) || {}, options: i }
1625
+ });
1626
+ }, ol = (e, t, n) => e && t === "datetime" && ["string", "number"].includes(typeof e) ? al(e).format(n.datetimeFormatPattern || "YYYY-MM-DD HH:mm:ss") : t === "array" && Array.isArray(e) ? e.join("、") : t === "boolean" && typeof e == "boolean" ? e ? "是" : "否" : e, ur = Symbol("zy_form_group"), fr = Symbol("zy_form_context"), cr = Symbol("zy_form_disabled"), kn = Symbol("zy_form_unfulfilled_field"), gt = Symbol("zy_form_data_refresh"), qt = "#ZY-FORM-CORE#", Ne = "#ZY-FORM-CORE-DELETED#", sl = ["href"], ll = pe({ name: "ZYFormItemComponent" }), Mn = /* @__PURE__ */ pe({
1627
+ ...ll,
1628
+ props: /* @__PURE__ */ je({
1629
+ components: {},
1630
+ field: {},
1631
+ disabled: { type: Boolean, default: !1 },
1632
+ readonly: { type: Boolean, default: !1 },
1633
+ requestFn: { type: Function, default: void 0 },
1634
+ remoteMethod: { type: Function, default: void 0 },
1635
+ uploadMethod: { type: Function, default: void 0 },
1636
+ removeMethod: { type: Function, default: void 0 },
1637
+ setCompRef: {},
1638
+ class: { default: void 0 },
1639
+ style: { default: void 0 }
1640
+ }, {
1641
+ modelValue: {
1642
+ required: !0,
1643
+ default: () => ({})
1644
+ },
1645
+ modelModifiers: {}
1646
+ }),
1647
+ emits: /* @__PURE__ */ je(["change", "blur", "keyupEnter"], ["update:modelValue"]),
1648
+ setup(e, { emit: t }) {
1649
+ const n = Ft(e, "modelValue"), r = e, a = t, o = Yt(), i = J(() => r.field.key), s = J(() => r.field.type), l = J(() => {
1650
+ var $;
1651
+ return ($ = r.field.component) == null ? void 0 : $.type;
1652
+ }), v = J(() => {
1653
+ var $;
1654
+ return (($ = r.field.component) == null ? void 0 : $.showWhenReadOnly) || !1;
1655
+ }), m = J(() => {
1656
+ var $, g, u, F, c, T, A;
1657
+ return {
1658
+ ...(($ = r.field.component) == null ? void 0 : $.props) || {},
1659
+ options: (u = (g = r.field.component) == null ? void 0 : g.options) != null && u.length ? r.field.component.options : ((c = (F = r.field.component) == null ? void 0 : F.props) == null ? void 0 : c.options) || [],
1660
+ customClassName: r.field.className,
1661
+ datetimeFormatPattern: r.field.datetimeFormatPattern || ((A = (T = r.field.component) == null ? void 0 : T.props) == null ? void 0 : A.format),
1662
+ disabled: r.disabled,
1663
+ clearValue: r.field.clearValue,
1664
+ readonly: r.readonly
1665
+ };
1666
+ }), p = /* @__PURE__ */ new Set([
1667
+ "remote",
1668
+ "name",
1669
+ "options",
1670
+ "customClassName",
1671
+ "datetimeFormatPattern",
1672
+ "clearValue"
1673
+ ]), d = J(() => {
1674
+ var $, g, u;
1675
+ return {
1676
+ ...Object.fromEntries(
1677
+ Object.entries(m.value).filter(([F]) => !p.has(F))
1678
+ ),
1679
+ fields: ((g = ($ = r.field.component) == null ? void 0 : $.props) == null ? void 0 : g.fields) || ((u = r.field.component) == null ? void 0 : u.fields) || []
1680
+ };
1681
+ }), y = ($, g, u, F, c, T) => {
1682
+ if (!r.requestFn || typeof r.requestFn != "function")
1683
+ throw new Error("[form setup error]: requestFn is not found");
1684
+ return r.requestFn(
1685
+ `${i.value}.${$.replace(/[^.]+\./, "")}`,
1686
+ g,
1687
+ u,
1688
+ F,
1689
+ c,
1690
+ T
1691
+ );
1692
+ }, w = J(() => {
1693
+ const $ = n.value[i.value];
1694
+ return ol($, s.value, m.value);
1695
+ });
1696
+ return ($, g) => {
1697
+ var u, F, c, T, A, E, P, S, q, D, C;
1698
+ return s.value === "null" ? (L(), te(ye, { key: 0 }, [
1699
+ l.value && e.components[l.value] ? (L(), _(ue(e.components[l.value]), de({
1700
+ key: 0,
1701
+ ref: (O) => {
1702
+ var V;
1703
+ return (V = e.setCompRef) == null ? void 0 : V.call(e, O);
1704
+ },
1705
+ modelValue: n.value[i.value],
1706
+ "onUpdate:modelValue": g[0] || (g[0] = (O) => n.value[i.value] = O)
1707
+ }, { ...m.value, ...Y(o) }), null, 16, ["modelValue"])) : (L(), te("div", de({
1708
+ key: 1,
1709
+ class: "zy-form-item-blank",
1710
+ style: e.style
1711
+ }, Y(o)), null, 16))
1712
+ ], 64)) : (!e.readonly || v.value) && l.value && e.components[l.value] ? (L(), te(ye, { key: 1 }, [
1713
+ Y(sr).includes(l.value) ? (L(), _(ue(e.components[l.value]), de({
1714
+ key: 0,
1715
+ ref: (O) => {
1716
+ var V;
1717
+ return (V = e.setCompRef) == null ? void 0 : V.call(e, O);
1718
+ },
1719
+ modelValue: n.value[i.value],
1720
+ "onUpdate:modelValue": g[1] || (g[1] = (O) => n.value[i.value] = O),
1721
+ "remote-method": e.remoteMethod
1722
+ }, m.value, {
1723
+ onChange: g[2] || (g[2] = (O) => a("change", O)),
1724
+ onBlur: g[3] || (g[3] = (O) => a("blur", O, H(n.value[i.value]))),
1725
+ onKeyup: g[4] || (g[4] = dt((O) => a("keyupEnter", O, H(n.value[i.value])), ["enter"]))
1726
+ }), null, 16, ["modelValue", "remote-method"])) : l.value === Y(fe).Upload ? (L(), _(ue(e.components[l.value]), de({
1727
+ key: 1,
1728
+ ref: (O) => {
1729
+ var V;
1730
+ return (V = e.setCompRef) == null ? void 0 : V.call(e, O);
1731
+ },
1732
+ modelValue: n.value[i.value],
1733
+ "onUpdate:modelValue": g[5] || (g[5] = (O) => n.value[i.value] = O),
1734
+ deleted: n.value[`${i.value}${Y(Ne)}`],
1735
+ "onUpdate:deleted": g[6] || (g[6] = (O) => n.value[`${i.value}${Y(Ne)}`] = O),
1736
+ "upload-method": e.uploadMethod,
1737
+ "remove-method": e.removeMethod
1738
+ }, m.value, {
1739
+ onChange: g[7] || (g[7] = (O) => a("change", O)),
1740
+ onBlur: g[8] || (g[8] = (O) => a("blur", O, H(n.value[i.value]))),
1741
+ onKeyup: g[9] || (g[9] = dt((O) => a("keyupEnter", O, H(n.value[i.value])), ["enter"]))
1742
+ }), null, 16, ["modelValue", "deleted", "upload-method", "remove-method"])) : Y(el).includes(l.value) ? (L(), _(ue(e.components[l.value]), de({
1743
+ key: 2,
1744
+ ref: (O) => {
1745
+ var V;
1746
+ return (V = e.setCompRef) == null ? void 0 : V.call(e, O);
1747
+ },
1748
+ modelValue: n.value[i.value],
1749
+ "onUpdate:modelValue": g[10] || (g[10] = (O) => n.value[i.value] = O),
1750
+ deleted: n.value[`${i.value}${Y(Ne)}`],
1751
+ "onUpdate:deleted": g[11] || (g[11] = (O) => n.value[`${i.value}${Y(Ne)}`] = O),
1752
+ "form-key": i.value,
1753
+ components: e.components,
1754
+ "request-fn": y
1755
+ }, d.value, {
1756
+ onChange: g[12] || (g[12] = (O) => a("change", O)),
1757
+ onBlur: g[13] || (g[13] = (O) => a("blur", O, H(n.value[i.value])))
1758
+ }), null, 16, ["modelValue", "deleted", "form-key", "components"])) : s.value === "combined" ? (L(), _(ue(e.components[l.value]), de({
1759
+ key: 3,
1760
+ ref: (O) => {
1761
+ var V;
1762
+ return (V = e.setCompRef) == null ? void 0 : V.call(e, O);
1763
+ },
1764
+ modelValue: n.value,
1765
+ "onUpdate:modelValue": g[14] || (g[14] = (O) => n.value = O),
1766
+ components: e.components,
1767
+ "request-fn": y
1768
+ }, { ...m.value, fields: ((u = e.field.component) == null ? void 0 : u.fields) || [] }, {
1769
+ onChange: g[15] || (g[15] = (O) => a("change", O)),
1770
+ onBlur: g[16] || (g[16] = (O) => a("blur", O, H(n.value[i.value]))),
1771
+ onKeyup: g[17] || (g[17] = dt((O) => a("keyupEnter", O, H(n.value[i.value])), ["enter"]))
1772
+ }), null, 16, ["modelValue", "components"])) : (L(), _(ue(e.components[l.value]), de({
1773
+ key: 4,
1774
+ ref: (O) => {
1775
+ var V;
1776
+ return (V = e.setCompRef) == null ? void 0 : V.call(e, O);
1777
+ },
1778
+ modelValue: n.value[i.value],
1779
+ "onUpdate:modelValue": g[18] || (g[18] = (O) => n.value[i.value] = O)
1780
+ }, m.value, {
1781
+ "request-fn": y,
1782
+ onChange: g[19] || (g[19] = (O) => a("change", O)),
1783
+ onBlur: g[20] || (g[20] = (O) => a("blur", O, H(n.value[i.value]))),
1784
+ onKeyup: g[21] || (g[21] = dt((O) => a("keyupEnter", O, H(n.value[i.value])), ["enter"]))
1785
+ }), null, 16, ["modelValue"]))
1786
+ ], 64)) : e.readonly && s.value === "images" && e.components.imageList ? (L(), _(ue(e.components.imageList), de({
1787
+ key: 2,
1788
+ images: n.value[i.value] || []
1789
+ }, m.value), null, 16, ["images"])) : e.readonly && l.value === Y(fe).Upload ? (L(!0), te(ye, { key: 3 }, Ie(Array.isArray(n.value[i.value]) ? n.value[i.value] : n.value[i.value] ? [n.value[i.value]] : [], (O) => (L(), te(ye, { key: O }, [
1790
+ e.components.link ? (L(), _(ue(e.components.link), {
1791
+ key: 0,
1792
+ class: Be(`${m.value.customClassName || ""}`),
1793
+ href: O
1794
+ }, {
1795
+ default: We(() => [
1796
+ hr(Je(O), 1)
1797
+ ]),
1798
+ _: 2
1799
+ }, 1032, ["class", "href"])) : Le("", !0),
1800
+ Un("a", {
1801
+ class: Be(`zy-form-item-link ${m.value.customClassName || ""}`),
1802
+ href: O
1803
+ }, Je(O), 11, sl)
1804
+ ], 64))), 128)) : (L(), te("p", {
1805
+ key: 4,
1806
+ class: Be(`zy-form-item-text ${m.value.customClassName || ""}`)
1807
+ }, Je(((c = (F = e.field.component) == null ? void 0 : F.props) == null ? void 0 : c.prefix) ?? "") + " " + Je(s.value === "combined" ? (A = (T = e.field.component) == null ? void 0 : T.fields) != null && A.length && ((P = (E = e.field.component) == null ? void 0 : E.fields) == null ? void 0 : P.length) > 0 ? e.field.component.fields.map(
1808
+ ({ key: O, component: V }) => {
1809
+ var I, k;
1810
+ return `${((I = V == null ? void 0 : V.props) == null ? void 0 : I.prefix) ?? ""}${n.value[O] ?? "--"}${((k = V == null ? void 0 : V.props) == null ? void 0 : k.suffix) ?? ""}`;
1811
+ }
1812
+ ).join(" ") : "--" : [void 0, null, ""].includes(w.value) ? "--" : (S = m.value.options) != null && S.length && ((q = m.value.options.find((O) => O.value === w.value)) == null ? void 0 : q.label) || w.value) + " " + Je(((C = (D = e.field.component) == null ? void 0 : D.props) == null ? void 0 : C.suffix) ?? ""), 3));
1813
+ };
1814
+ }
1815
+ }), dr = (e) => {
1816
+ let t = !1, n = !1, r = null;
1817
+ const a = async () => {
1818
+ if (!n) {
1819
+ for (n = !0; !t && r; ) {
1820
+ const s = r;
1821
+ r = null;
1822
+ try {
1823
+ await e(...s.args), s.resolve();
1824
+ } catch (l) {
1825
+ s.reject(l);
1826
+ }
1827
+ }
1828
+ n = !1;
1829
+ }
1830
+ };
1831
+ return { run: (...s) => new Promise((l, v) => {
1832
+ if (t) {
1833
+ l();
1834
+ return;
1835
+ }
1836
+ r == null || r.resolve(), r = { args: s, resolve: l, reject: v }, a();
1837
+ }), dispose: () => {
1838
+ t = !0, r == null || r.resolve(), r = null;
1839
+ } };
1840
+ }, bt = /* @__PURE__ */ new WeakMap(), ul = (e, t, n) => {
1841
+ const r = bt.get(e);
1842
+ if (!r) return;
1843
+ const a = new Set(n);
1844
+ r.forEach((o, i) => {
1845
+ const s = i.split("\0", 1)[0];
1846
+ s.startsWith(t) && !a.has(s) && r.delete(i);
1847
+ }), r.size === 0 && bt.delete(e);
1848
+ }, st = (e, t, n, r = "default") => {
1849
+ if (typeof e != "string") return e;
1850
+ if (!n) return new Function(...t, e);
1851
+ let a = bt.get(n);
1852
+ a || (a = /* @__PURE__ */ new Map(), bt.set(n, a));
1853
+ const o = `${r}\0${t.join(",")}`, i = a.get(o);
1854
+ if ((i == null ? void 0 : i.source) === e) return i.value;
1855
+ const s = new Function(...t, e);
1856
+ return a.set(o, { source: e, value: s }), s;
1857
+ }, wt = () => (/* @__PURE__ */ new Date()).getTime().toString(), Wt = (e, t) => {
1858
+ const n = [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])], r = {};
1859
+ return n.forEach((a) => {
1860
+ r[a] = e[a], ![null, void 0, ""].includes(t[a]) && (!Array.isArray(t[a]) || t[a].length > 0) && (typeof t[a] != "object" || Object.keys(t[a]).length > 0) && (r[a] = t[a]);
1861
+ }), r;
1862
+ }, fl = pe({ name: "ZYFormItem" }), Dt = /* @__PURE__ */ pe({
1863
+ ...fl,
1864
+ props: /* @__PURE__ */ je({
1865
+ components: {},
1866
+ field: {},
1867
+ keyPath: {},
1868
+ readonly: { type: Boolean },
1869
+ requestFn: { type: Function },
1870
+ className: {},
1871
+ style: {}
1872
+ }, {
1873
+ modelValue: {
1874
+ required: !0,
1875
+ default: () => ({})
1876
+ },
1877
+ modelModifiers: {}
1878
+ }),
1879
+ emits: /* @__PURE__ */ je(["change", "blur", "keyupEnter"], ["update:modelValue"]),
1880
+ setup(e, { expose: t, emit: n }) {
1881
+ var T;
1882
+ const r = Ft(e, "modelValue"), a = e, o = n, i = Yt(), s = se(null), l = (A) => {
1883
+ s.value = A;
1884
+ };
1885
+ t({ validate: async (A = 1 / 0) => {
1886
+ var E, P;
1887
+ return await ((P = (E = s.value) == null ? void 0 : E.validate) == null ? void 0 : P.call(E, A));
1888
+ } });
1889
+ let m = 0, p = !1;
1890
+ const d = /* @__PURE__ */ new Set(), y = async (A, E) => {
1891
+ var C, O;
1892
+ const P = new AbortController();
1893
+ let S = !1;
1894
+ const q = () => {
1895
+ var V;
1896
+ S || (S = !0, (V = A == null ? void 0 : A.signal) == null || V.removeEventListener("abort", D), d.delete(P));
1897
+ }, D = () => {
1898
+ P.abort(), q();
1899
+ };
1900
+ d.add(P), p || (C = A == null ? void 0 : A.signal) != null && C.aborted ? D() : (O = A == null ? void 0 : A.signal) == null || O.addEventListener("abort", D, { once: !0 });
1901
+ try {
1902
+ return await E({
1903
+ requestId: (A == null ? void 0 : A.requestId) ?? ++m,
1904
+ signal: P.signal
1905
+ });
1906
+ } finally {
1907
+ q();
1908
+ }
1909
+ };
1910
+ Fe(() => {
1911
+ p = !0, d.forEach((A) => A.abort()), d.clear();
1912
+ });
1913
+ const w = async (A = {}, E) => {
1914
+ var S;
1915
+ if (!((S = a.field.component) != null && S.remote)) return [];
1916
+ if (!a.requestFn || typeof a.requestFn != "function")
1917
+ throw new Error("[form setup error]: requestFn is not found");
1918
+ const P = await y(
1919
+ E,
1920
+ (q) => {
1921
+ var D, C, O, V;
1922
+ return a.requestFn(
1923
+ a.keyPath,
1924
+ r.value[a.field.key],
1925
+ typeof ((D = a.field.component) == null ? void 0 : D.remote) == "object" ? (C = a.field.component.remote) == null ? void 0 : C.url : "",
1926
+ typeof ((O = a.field.component) == null ? void 0 : O.remote) == "object" ? H((V = a.field.component.remote) == null ? void 0 : V.extraParams) : {},
1927
+ { ...A },
1928
+ q
1929
+ );
1930
+ }
1931
+ );
1932
+ return Array.isArray(P) ? P : [];
1933
+ };
1934
+ (T = a.field.component) != null && T.remote && sr.includes(a.field.component.type) && y(
1935
+ void 0,
1936
+ (A) => il(
1937
+ a.field,
1938
+ r.value[a.field.key],
1939
+ a.keyPath,
1940
+ a.requestFn,
1941
+ A
1942
+ )
1943
+ ).catch((A) => {
1944
+ p || console.error(A);
1945
+ });
1946
+ const $ = async (A = {}, E) => {
1947
+ var S, q;
1948
+ if (((S = a.field.component) == null ? void 0 : S.type) !== fe.Upload || !((q = a.field.component) != null && q.remote))
1949
+ return;
1950
+ if (!a.requestFn || typeof a.requestFn != "function")
1951
+ throw new Error("[form setup error]: requestFn is not found");
1952
+ const P = await y(
1953
+ E,
1954
+ (D) => {
1955
+ var C, O, V, I;
1956
+ return a.requestFn(
1957
+ a.keyPath,
1958
+ r.value[a.field.key],
1959
+ typeof ((C = a.field.component) == null ? void 0 : C.remote) == "object" ? (O = a.field.component.remote) == null ? void 0 : O.url : "",
1960
+ typeof ((V = a.field.component) == null ? void 0 : V.remote) == "object" ? H((I = a.field.component.remote) == null ? void 0 : I.extraParams) : {},
1961
+ { ...A },
1962
+ D
1963
+ );
1964
+ }
1965
+ );
1966
+ if (!P) throw new Error("[form upload error]: response type error");
1967
+ return P;
1968
+ }, g = async (A = {}, E) => {
1969
+ var P, S;
1970
+ if (!(((P = a.field.component) == null ? void 0 : P.type) !== fe.Upload || !((S = a.field.component) != null && S.remote))) {
1971
+ if (!a.requestFn || typeof a.requestFn != "function")
1972
+ throw new Error("[form setup error]: requestFn is not found");
1973
+ await y(
1974
+ E,
1975
+ (q) => {
1976
+ var D, C, O, V;
1977
+ return a.requestFn(
1978
+ a.keyPath,
1979
+ r.value[a.field.key],
1980
+ typeof ((D = a.field.component) == null ? void 0 : D.remote) == "object" ? (C = a.field.component.remote) == null ? void 0 : C.url : "",
1981
+ typeof ((O = a.field.component) == null ? void 0 : O.remote) == "object" ? H((V = a.field.component.remote) == null ? void 0 : V.extraParams) : {},
1982
+ { ...A },
1983
+ q
1984
+ );
1985
+ }
1986
+ );
1987
+ }
1988
+ }, u = ["fieldValue", "formData", "fieldConfig"], F = J(() => typeof a.field.disabled == "boolean" ? a.field.disabled : typeof a.field.disabled == "function" ? a.field.disabled(r.value[a.field.key], r.value, a.field) : typeof a.field.disabled == "string" ? st(a.field.disabled, u, a.field, "disabled")(
1989
+ r.value[a.field.key],
1990
+ r.value,
1991
+ a.field
1992
+ ) : !1), c = J(() => !!(a.readonly || a.field.readonly));
1993
+ return (A, E) => {
1994
+ var P, S, q;
1995
+ return e.field.type === "null" ? (L(), _(Mn, {
1996
+ key: 0,
1997
+ id: e.keyPath.replaceAll(".", "-"),
1998
+ modelValue: r.value,
1999
+ "onUpdate:modelValue": E[0] || (E[0] = (D) => r.value = D),
2000
+ components: e.components,
2001
+ field: e.field,
2002
+ disabled: F.value,
2003
+ readonly: c.value,
2004
+ "request-fn": e.requestFn,
2005
+ "set-comp-ref": l,
2006
+ class: Be(e.className),
2007
+ style: De(e.style),
2008
+ onChange: E[1] || (E[1] = (D) => o("change", D)),
2009
+ onBlur: E[2] || (E[2] = (D) => o("blur", D, H(r.value[e.field.key]))),
2010
+ onKeyupEnter: E[3] || (E[3] = (D) => o("keyupEnter", D, H(r.value[e.field.key])))
2011
+ }, null, 8, ["id", "modelValue", "components", "field", "disabled", "readonly", "request-fn", "class", "style"])) : (L(), _(ue(e.components.formItem), de({
2012
+ id: e.keyPath.replaceAll(".", "-"),
2013
+ key: e.field.key,
2014
+ prop: e.field.key,
2015
+ label: ((P = e.field.label) == null ? void 0 : P.text) || (typeof e.field.label == "string" ? e.field.label : ""),
2016
+ "label-width": (S = e.field.label) == null ? void 0 : S.width,
2017
+ "field-config": e.field,
2018
+ description: e.field.description,
2019
+ class: ["zy-form-item", { readonly: c.value }]
2020
+ }, {
2021
+ ...Y(i),
2022
+ ...typeof e.field.label == "object" ? e.field.label : {},
2023
+ ...e.field.props,
2024
+ class: e.className,
2025
+ style: e.style,
2026
+ showMessage: c.value ? !1 : (q = e.field.props) == null ? void 0 : q.showMessage
2027
+ }), {
2028
+ default: We(() => [
2029
+ Tt(Mn, {
2030
+ modelValue: r.value,
2031
+ "onUpdate:modelValue": E[4] || (E[4] = (D) => r.value = D),
2032
+ components: e.components,
2033
+ field: e.field,
2034
+ disabled: F.value,
2035
+ readonly: c.value,
2036
+ "request-fn": e.requestFn,
2037
+ "remote-method": w,
2038
+ "upload-method": $,
2039
+ "remove-method": g,
2040
+ "set-comp-ref": l,
2041
+ onChange: E[5] || (E[5] = (D) => o("change", D)),
2042
+ onBlur: E[6] || (E[6] = (D) => o("blur", D, H(r.value[e.field.key]))),
2043
+ onKeyupEnter: E[7] || (E[7] = (D) => o("keyupEnter", D, H(r.value[e.field.key])))
2044
+ }, null, 8, ["modelValue", "components", "field", "disabled", "readonly", "request-fn"])
2045
+ ]),
2046
+ _: 1
2047
+ }, 16, ["id", "prop", "label", "label-width", "field-config", "description", "class"]));
2048
+ };
2049
+ }
2050
+ }), cl = pe({ name: "ZYFormFieldsRenderer" }), qn = /* @__PURE__ */ pe({
2051
+ ...cl,
2052
+ props: /* @__PURE__ */ je({
2053
+ containerList: {},
2054
+ components: {},
2055
+ formKey: {},
2056
+ formConfig: {},
2057
+ readonly: { type: Boolean },
2058
+ requestFn: { type: Function, default: void 0 },
2059
+ unfulfilledFields: {},
2060
+ fieldMinValidateLevel: {},
2061
+ registerFormItemRef: {}
2062
+ }, {
2063
+ modelValue: {
2064
+ required: !0,
2065
+ default: () => ({})
2066
+ },
2067
+ modelModifiers: {}
2068
+ }),
2069
+ emits: /* @__PURE__ */ je(["change", "blur", "keyupEnter"], ["update:modelValue"]),
2070
+ setup(e, { emit: t }) {
2071
+ const n = Ft(e, "modelValue"), r = e, a = t, o = 24, i = ({ span: u }) => u / o, s = ({ span: u }) => {
2072
+ var F;
2073
+ return parseInt((((F = r.formConfig.gutter) == null ? void 0 : F.horizontal) || "").toString()) * (o / u - 1);
2074
+ }, l = (u, F = !1) => (F ? u : u.slice(1)).filter((T) => T.show && T.type !== "invisible"), v = (u) => {
2075
+ var F, c;
2076
+ return ((c = (F = u == null ? void 0 : u.component) == null ? void 0 : F.container) == null ? void 0 : c.className) ?? "";
2077
+ }, m = () => {
2078
+ var u, F;
2079
+ return {
2080
+ gap: `${(u = r.formConfig.gutter) == null ? void 0 : u.vertical} ${(F = r.formConfig.gutter) == null ? void 0 : F.horizontal}`
2081
+ };
2082
+ }, p = (u) => {
2083
+ const F = r.fieldMinValidateLevel[u.key];
2084
+ return F !== void 0 ? `zy-form-item-level-${F}` : "";
2085
+ }, d = (u) => ({
2086
+ width: `calc(${i(u) * 100}% - ${Math.ceil(s(u) * i(u))}px)`
2087
+ }), y = (u, F) => {
2088
+ a("change", `${r.formKey}.${u}`, F);
2089
+ }, w = (u, F, c) => {
2090
+ a("blur", u, `${r.formKey}.${F}`, c);
2091
+ }, $ = (u, F, c) => {
2092
+ a("keyupEnter", u, `${r.formKey}.${F}`, c);
2093
+ }, g = (u) => typeof u.label == "object" ? u.label.text : u.label;
2094
+ return (u, F) => (L(!0), te(ye, null, Ie(e.containerList, (c) => {
2095
+ var T, A, E, P;
2096
+ return L(), te(ye, {
2097
+ key: c[0].key
2098
+ }, [
2099
+ c[0].type === "container" ? (L(), te(ye, { key: 0 }, [
2100
+ c[0].show && ((T = c[0].component) != null && T.type) && e.components[(A = c[0].component) == null ? void 0 : A.type] ? (L(), _(ue(e.components[(E = c[0].component) == null ? void 0 : E.type]), de({
2101
+ id: `${e.formKey}.${c[0].key}`.replaceAll(".", "-"),
2102
+ key: c[0].key,
2103
+ title: g(c[0]),
2104
+ name: c[0].key,
2105
+ "field-config": c[0],
2106
+ fields: c,
2107
+ "unfulfilled-fields": e.unfulfilledFields
2108
+ }, { ref_for: !0 }, (P = c[0].component) == null ? void 0 : P.props), {
2109
+ default: We(() => [
2110
+ Un("div", {
2111
+ class: Be(["zy-form-inner", v(c[0])]),
2112
+ style: De(m())
2113
+ }, [
2114
+ (L(!0), te(ye, null, Ie(l(c), (S) => (L(), _(Y(Dt), {
2115
+ ref_for: !0,
2116
+ ref: (q) => e.registerFormItemRef(S.key, q),
2117
+ key: S.key,
2118
+ modelValue: n.value,
2119
+ "onUpdate:modelValue": F[0] || (F[0] = (q) => n.value = q),
2120
+ components: e.components,
2121
+ field: S,
2122
+ "key-path": `${e.formKey}.${S.key}`,
2123
+ readonly: e.readonly,
2124
+ "request-fn": e.requestFn,
2125
+ className: p(S),
2126
+ style: De(d(S)),
2127
+ onChange: (q) => y(S.key, q),
2128
+ onBlur: (q, D) => w(q, S.key, D),
2129
+ onKeyupEnter: (q, D) => $(q, S.key, D)
2130
+ }, null, 8, ["modelValue", "components", "field", "key-path", "readonly", "request-fn", "className", "style", "onChange", "onBlur", "onKeyupEnter"]))), 128))
2131
+ ], 6)
2132
+ ]),
2133
+ _: 2
2134
+ }, 1040, ["id", "title", "name", "field-config", "fields", "unfulfilled-fields"])) : c[0].show ? (L(), te("div", {
2135
+ key: `${c[0].key}-div-container`,
2136
+ class: Be(["zy-form-inner", v(c[0])]),
2137
+ style: De(m())
2138
+ }, [
2139
+ (L(!0), te(ye, null, Ie(l(c), (S) => (L(), _(Y(Dt), {
2140
+ ref_for: !0,
2141
+ ref: (q) => e.registerFormItemRef(S.key, q),
2142
+ key: S.key,
2143
+ modelValue: n.value,
2144
+ "onUpdate:modelValue": F[1] || (F[1] = (q) => n.value = q),
2145
+ components: e.components,
2146
+ field: S,
2147
+ "key-path": `${e.formKey}.${S.key}`,
2148
+ readonly: e.readonly,
2149
+ "request-fn": e.requestFn,
2150
+ className: p(S),
2151
+ style: De(d(S)),
2152
+ onChange: (q) => y(S.key, q),
2153
+ onBlur: (q, D) => w(q, S.key, D),
2154
+ onKeyupEnter: (q, D) => $(q, S.key, D)
2155
+ }, null, 8, ["modelValue", "components", "field", "key-path", "readonly", "request-fn", "className", "style", "onChange", "onBlur", "onKeyupEnter"]))), 128))
2156
+ ], 6)) : Le("", !0)
2157
+ ], 64)) : (L(), te("div", {
2158
+ key: c[0].key,
2159
+ class: "zy-form-inner",
2160
+ style: De(m())
2161
+ }, [
2162
+ (L(!0), te(ye, null, Ie(l(c, !0), (S) => (L(), _(Y(Dt), {
2163
+ ref_for: !0,
2164
+ ref: (q) => e.registerFormItemRef(S.key, q),
2165
+ key: S.key,
2166
+ modelValue: n.value,
2167
+ "onUpdate:modelValue": F[2] || (F[2] = (q) => n.value = q),
2168
+ components: e.components,
2169
+ field: S,
2170
+ "key-path": `${e.formKey}.${S.key}`,
2171
+ readonly: e.readonly,
2172
+ "request-fn": e.requestFn,
2173
+ "class-name": p(S),
2174
+ style: De(d(S)),
2175
+ onChange: (q) => y(S.key, q),
2176
+ onBlur: (q, D) => w(q, S.key, D),
2177
+ onKeyupEnter: (q, D) => $(q, S.key, D)
2178
+ }, null, 8, ["modelValue", "components", "field", "key-path", "readonly", "request-fn", "class-name", "style", "onChange", "onBlur", "onKeyupEnter"]))), 128))
2179
+ ], 4))
2180
+ ], 64);
2181
+ }), 128));
2182
+ }
2183
+ }), dl = pe({ name: "ZYFormRenderer" }), Dn = /* @__PURE__ */ pe({
2184
+ ...dl,
2185
+ props: /* @__PURE__ */ je({
2186
+ components: {},
2187
+ formKey: {},
2188
+ formConfig: {},
2189
+ formRules: {},
2190
+ readonly: { type: Boolean },
2191
+ disabled: { type: Boolean },
2192
+ requestFn: { type: Function, default: void 0 },
2193
+ anchorPositionAvailable: { type: Boolean },
2194
+ onContentScroll: {},
2195
+ hasCollapse: { type: Boolean },
2196
+ collapseGroupItems: {},
2197
+ containerValidateStatusMap: {},
2198
+ containerList: {},
2199
+ unfulfilledFields: {},
2200
+ fieldMinValidateLevel: {}
2201
+ }, {
2202
+ modelValue: {
2203
+ required: !0,
2204
+ default: () => ({})
2205
+ },
2206
+ modelModifiers: {}
2207
+ }),
2208
+ emits: /* @__PURE__ */ je(["change", "blur", "keyupEnter"], ["update:modelValue"]),
2209
+ setup(e, { expose: t, emit: n }) {
2210
+ const r = Ft(e, "modelValue"), a = e, o = n, i = vr({}), s = (p, d) => {
2211
+ i.value[p] = d;
2212
+ }, l = () => Object.entries(i.value).filter(([p, d]) => d !== null).map(([p, d]) => ({ key: p, ref: d })), v = () => {
2213
+ a.anchorPositionAvailable && a.onContentScroll();
2214
+ }, m = Pt("form");
2215
+ return t({
2216
+ getFormItemRefs: l,
2217
+ validate: async () => {
2218
+ var p;
2219
+ return await ((p = m.value) == null ? void 0 : p.validate());
2220
+ },
2221
+ validateField: async (...p) => {
2222
+ var d;
2223
+ return await ((d = m.value) == null ? void 0 : d.validateField(...p));
2224
+ },
2225
+ clearValidate: (...p) => {
2226
+ var d;
2227
+ return (d = m.value) == null ? void 0 : d.clearValidate(...p);
2228
+ },
2229
+ scrollToField: (...p) => {
2230
+ var d;
2231
+ return (d = m.value) == null ? void 0 : d.scrollToField(...p);
2232
+ }
2233
+ }), (p, d) => (L(), _(ue(e.components.form), de({
2234
+ ref: "form",
2235
+ model: r.value,
2236
+ rules: e.formRules
2237
+ }, e.formConfig.props, {
2238
+ disabled: e.disabled,
2239
+ class: { "zy-form readonly": a.readonly, "zy-form": !a.readonly },
2240
+ onScroll: v
2241
+ }), {
2242
+ default: We(() => [
2243
+ e.hasCollapse ? (L(), _(ue(e.components.collapse), {
2244
+ key: 0,
2245
+ "collapse-items": e.collapseGroupItems,
2246
+ "validate-status-map": e.containerValidateStatusMap
2247
+ }, {
2248
+ default: We(() => [
2249
+ Tt(qn, {
2250
+ modelValue: r.value,
2251
+ "onUpdate:modelValue": d[0] || (d[0] = (y) => r.value = y),
2252
+ "container-list": e.containerList,
2253
+ components: e.components,
2254
+ "form-key": e.formKey,
2255
+ "form-config": e.formConfig,
2256
+ readonly: e.readonly,
2257
+ "request-fn": e.requestFn,
2258
+ "unfulfilled-fields": e.unfulfilledFields,
2259
+ "field-min-validate-level": e.fieldMinValidateLevel,
2260
+ "register-form-item-ref": s,
2261
+ onChange: d[1] || (d[1] = (y, w) => o("change", y, w)),
2262
+ onBlur: d[2] || (d[2] = (y, w, $) => o("blur", y, w, $)),
2263
+ onKeyupEnter: d[3] || (d[3] = (y, w, $) => o("keyupEnter", y, w, $))
2264
+ }, null, 8, ["modelValue", "container-list", "components", "form-key", "form-config", "readonly", "request-fn", "unfulfilled-fields", "field-min-validate-level"])
2265
+ ]),
2266
+ _: 1
2267
+ }, 8, ["collapse-items", "validate-status-map"])) : (L(), _(qn, {
2268
+ key: 1,
2269
+ modelValue: r.value,
2270
+ "onUpdate:modelValue": d[4] || (d[4] = (y) => r.value = y),
2271
+ "container-list": e.containerList,
2272
+ components: e.components,
2273
+ "form-key": e.formKey,
2274
+ "form-config": e.formConfig,
2275
+ readonly: e.readonly,
2276
+ "request-fn": e.requestFn,
2277
+ "unfulfilled-fields": e.unfulfilledFields,
2278
+ "field-min-validate-level": e.fieldMinValidateLevel,
2279
+ "register-form-item-ref": s,
2280
+ onChange: d[5] || (d[5] = (y, w) => o("change", y, w)),
2281
+ onBlur: d[6] || (d[6] = (y, w, $) => o("blur", y, w, $)),
2282
+ onKeyupEnter: d[7] || (d[7] = (y, w, $) => o("keyupEnter", y, w, $))
2283
+ }, null, 8, ["modelValue", "container-list", "components", "form-key", "form-config", "readonly", "request-fn", "unfulfilled-fields", "field-min-validate-level"]))
2284
+ ]),
2285
+ _: 1
2286
+ }, 16, ["model", "rules", "disabled", "class"]));
2287
+ }
2288
+ }), Ue = (e) => {
2289
+ switch (e) {
2290
+ case "string":
2291
+ return "";
2292
+ case "array":
2293
+ return [];
2294
+ case "object":
2295
+ return {};
2296
+ default:
2297
+ return;
2298
+ }
2299
+ }, yl = (e, t) => {
2300
+ switch (t) {
2301
+ case "string":
2302
+ return String(e);
2303
+ case "array":
2304
+ return Array.isArray(e) ? e : e ? e.includes(",") ? e.split(",") : [e] : [];
2305
+ case "object":
2306
+ return typeof e == "object" ? e : {};
2307
+ case "boolean":
2308
+ return !!e;
2309
+ case "number":
2310
+ return Number(e);
2311
+ default:
2312
+ return e;
2313
+ }
2314
+ }, Pn = ({ type: e, defaultValue: t, clearValue: n }) => (typeof t == "function" ? t() : typeof t == "object" ? Ye(t) : t) ?? (typeof n == "function" ? n() : typeof n == "object" ? Ye(n) : n) ?? Ue(e), yr = (e, t) => e.find(({ key: o }) => o === t).fields.filter(({ type: o }) => !["null", "container"].includes(o)).reduce((o, i) => {
2315
+ var p;
2316
+ const { key: s, type: l, component: v } = i, m = {
2317
+ ...o,
2318
+ [s]: Pn(i)
2319
+ };
2320
+ return ["array", "object"].includes(l) && (m[`${s}${Ne}`] = []), l === "combined" && ((p = v == null ? void 0 : v.fields) != null && p.length) && v.fields.forEach((d) => {
2321
+ m[d.key] = Pn(d);
2322
+ }), m;
2323
+ }, {}), xn = ({ key: e, type: t }, n) => [null, void 0].includes(n == null ? void 0 : n[e]) ? Ue(t) : yl(n[e], t), mr = (e, t, n) => t.find(({ key: i }) => i === n).fields.filter(({ type: i }) => !["null", "container"].includes(i)).reduce((i, s) => {
2324
+ var d;
2325
+ const { key: l, type: v, component: m } = s, p = {
2326
+ ...i,
2327
+ [l]: xn(s, e)
2328
+ };
2329
+ return ["array", "object"].includes(v) && (p[`${l}${Ne}`] = []), v === "combined" && ((d = m == null ? void 0 : m.fields) != null && d.length) && m.fields.forEach((y) => {
2330
+ p[y.key] = xn(y, e);
2331
+ }), p;
2332
+ }, {}), zt = (e, t) => Object.entries(e).reduce((n, [r, a]) => {
2333
+ const o = Array.isArray(a) ? a.map((i) => typeof i == "object" ? zt(i, t) : i) : typeof a == "object" ? zt(a, t) : a;
2334
+ return r.match(new RegExp(`^${t}-[\\S]+`)) ? { ...n, [r.replace(`${t}-`, "")]: o } : [void 0, null].includes(e[`${t}-${r}`]) ? { ...n, [r]: o } : n;
2335
+ }, {}), ml = (e, t) => {
2336
+ var n;
2337
+ return t ? (n = e.rules) == null ? void 0 : n.some((r) => r.required) : e.show ?? !0;
2338
+ }, Cn = (e, t, n) => {
2339
+ var r, a, o, i, s;
2340
+ return {
2341
+ ...e,
2342
+ span: e.span ?? 24,
2343
+ show: ml(e, n),
2344
+ disabled: e.disabled ?? !1,
2345
+ formKey: t,
2346
+ component: e.component ? {
2347
+ ...e.component || {},
2348
+ props: {
2349
+ ...((r = e.component) == null ? void 0 : r.props) || {},
2350
+ remote: ((a = e.component) == null ? void 0 : a.remote) === !0 || Object.keys(((o = e.component) == null ? void 0 : o.remote) || {}).length > 0,
2351
+ name: ((s = (i = e.component) == null ? void 0 : i.props) == null ? void 0 : s.name) || e.key
2352
+ }
2353
+ } : void 0
2354
+ };
2355
+ }, pl = (e, t, n) => {
2356
+ const { gutter: r, fields: a, show: o } = e, i = (r == null ? void 0 : r.horizontal) ?? 20, s = (r == null ? void 0 : r.vertical) ?? 10, l = n ? a.some((v) => {
2357
+ var m;
2358
+ return (m = v.rules) == null ? void 0 : m.some((p) => p.required);
2359
+ }) : o ?? !0;
2360
+ return {
2361
+ ...e,
2362
+ show: l,
2363
+ gutter: {
2364
+ horizontal: typeof i == "string" ? i : `${i}px`,
2365
+ vertical: typeof s == "string" ? s : `${s}px`
2366
+ },
2367
+ fields: a.reduce((v, m) => {
2368
+ var p, d;
2369
+ return v.push(Cn(m, t, n)), m.type === "container" && ((d = (p = m.component) == null ? void 0 : p.fields) != null && d.length) && m.component.fields.forEach((y, w) => {
2370
+ m.component.fields[w] = rt(
2371
+ Cn(y, t, n)
2372
+ ), v.push(m.component.fields[w]);
2373
+ }), v;
2374
+ }, [])
2375
+ };
2376
+ }, hl = (e, t) => new Promise((n, r) => {
2377
+ new ut(e).validate(t, (a, o) => {
2378
+ a ? r(a) : n();
2379
+ });
2380
+ }), vl = (e) => {
2381
+ Array.isArray(e) ? e.forEach(({ key: t, message: n }) => /* @__PURE__ */ console.log(`[validate error]: ${t}: ${n}`)) : typeof e == "object" && Object.entries(e).forEach(([t, n]) => {
2382
+ n.forEach(({ message: r }) => {
2383
+ });
2384
+ });
2385
+ }, gl = (e) => {
2386
+ let t = null;
2387
+ return typeof e == "function" && (t = e), typeof e == "string" && (t = new Function("formData", "formConfig", e)), t;
2388
+ }, bl = (e) => {
2389
+ let t = null;
2390
+ return typeof e == "function" && (t = e), typeof e == "string" && (t = new Function("formData", "formConfig", e)), t;
2391
+ }, lt = (e, t, n) => Array.isArray(e) ? e.map(
2392
+ (r) => typeof r == "string" ? t.some(
2393
+ ({ key: a }) => r.includes(a) && (r.includes(".") || r.includes("["))
2394
+ ) ? r : `${n}["${r}"]` : r
2395
+ ) : [], $t = (e, t, n) => Array.isArray(e) ? e.some(
2396
+ (r) => t.some(
2397
+ ({ key: a, fields: o }) => r.split(".")[0] === a && (o == null ? void 0 : o.some(({ type: i }) => ["object", "array"].includes(i)))
2398
+ ) || t.find(({ key: a }) => a === n).fields.some(({ key: a, type: o }) => a === r && ["object", "array"].includes(o))
2399
+ ) : !1, wl = [
2400
+ "rule",
2401
+ "value",
2402
+ "callback",
2403
+ "formData",
2404
+ "formConfig",
2405
+ "validatorParams",
2406
+ "formGroupData",
2407
+ "depValues"
2408
+ ], Qe = {
2409
+ REQUIRED: "必填项",
2410
+ PATTERN_UNMATCHED: "正则规则不匹配",
2411
+ RANGE_UNMATCHED: "超过限制范围",
2412
+ LENGTH_UNMATCHED: "长度不匹配",
2413
+ ENUM_UNMATCHED: "枚举不匹配"
2414
+ }, _e = {
2415
+ // 必填required
2416
+ REQUIRED: (e, t) => t && Array.isArray(t) && (t.length === 0 || t.some((n) => [null, void 0, ""].includes(n))) ? !0 : e.required && [null, void 0, ""].includes(t),
2417
+ // 正则匹配pattern
2418
+ PATTERN: (e, t) => {
2419
+ var n;
2420
+ return e.pattern ? t && Array.isArray(t) && t.some((r) => {
2421
+ var a;
2422
+ return !((a = new RegExp(e.pattern)) != null && a.test(r));
2423
+ }) ? !0 : t && !((n = new RegExp(e.pattern)) != null && n.test(t)) : !1;
2424
+ },
2425
+ // 长度限制len
2426
+ LENGTH: (e, t) => e.len && t ? !!(typeof t == "number" && t !== e.len || (typeof t == "string" || Array.isArray(t)) && t.length !== e.len) : !1,
2427
+ // 范围限制min&max
2428
+ RANGE: (e, t) => !!(e.min && t && (typeof t == "number" && t < e.min || (typeof t == "string" || Array.isArray(t)) && t.length < e.min) || e.max && t && (typeof t == "number" && t > e.max || (typeof t == "string" || Array.isArray(t)) && t.length > e.max)),
2429
+ // 枚举值enum
2430
+ ENUMERABLE: (e, t) => e.type !== "enum" || !e.enum || !Array.isArray(e.enum) || !t ? !1 : Array.isArray(t) && t.some((n) => !e.enum.includes(n)) ? !0 : !e.enum.includes(t)
2431
+ }, $l = (e, t, n, r, a, o = 0, { type: i, component: s }, l, v, m) => {
2432
+ const p = typeof v == "object" ? v.handler : v, d = p ? st(
2433
+ p,
2434
+ wl,
2435
+ m,
2436
+ "validator"
2437
+ ) : null;
2438
+ return (y, w, $) => {
2439
+ var F;
2440
+ const g = $ || ((c) => c ? Promise.reject(c.message) : Promise.resolve());
2441
+ w = i === "combined" ? (F = s == null ? void 0 : s.fields) == null ? void 0 : F.map((c) => t.value[c.key]) : w;
2442
+ const u = l != null && l.length ? lt(l, n, r.key) : [];
2443
+ return a.value < o && g(), p && ["function", "string"].includes(typeof p) ? d == null ? void 0 : d(
2444
+ y,
2445
+ w,
2446
+ g,
2447
+ H(t.value),
2448
+ H(r),
2449
+ { rule: y, value: w, callback: g },
2450
+ H(e.value),
2451
+ (u == null ? void 0 : u.map((c) => Zt(e.value, c))) || []
2452
+ ) : _e.REQUIRED(y, w) ? g(new Error(y.message || Qe.REQUIRED)) : _e.PATTERN(y, w) ? g(new Error(y.message || Qe.PATTERN_UNMATCHED)) : _e.LENGTH(y, w) ? g(new Error(y.message || Qe.LENGTH_UNMATCHED)) : _e.RANGE(y, w) ? g(new Error(y.message || Qe.RANGE_UNMATCHED)) : _e.ENUMERABLE(y, w) ? g(new Error(y.message || Qe.ENUM_UNMATCHED)) : g();
2453
+ };
2454
+ }, Rn = ["fieldValue", "formKey", "formData", "formConfig", "oldFieldValue"], Vn = ["formKey", "formData", "formConfig"], mt = (e, t, n = !1) => {
2455
+ const r = (e.actions || []).map((a, o) => ({ action: a, index: o }));
2456
+ return ul(
2457
+ e,
2458
+ "action:",
2459
+ r.filter(({ action: a }) => typeof a != "object").map(({ index: a }) => `action:${a}`)
2460
+ ), r.filter(
2461
+ ({ action: a }) => !n || typeof a == "object" && (a == null ? void 0 : a.immediate) !== !1
2462
+ ).map(
2463
+ ({ action: a, index: o }) => st(
2464
+ typeof a == "object" ? a.handler : a,
2465
+ t,
2466
+ typeof a == "object" ? a : e,
2467
+ typeof a == "object" ? "handler" : `action:${o}`
2468
+ )
2469
+ );
2470
+ }, Fl = (e, t) => {
2471
+ const n = J(
2472
+ () => e.reduce(
2473
+ (v, m) => ({
2474
+ ...v,
2475
+ [m.key]: m
2476
+ }),
2477
+ {}
2478
+ )
2479
+ ), a = n.value[t].fields;
2480
+ let o = [];
2481
+ const i = () => {
2482
+ const v = a.filter(({ actions: p }) => p == null ? void 0 : p.length).map((p) => {
2483
+ var $;
2484
+ const { key: d, type: y, component: w } = p;
2485
+ return y === "combined" ? {
2486
+ source: (($ = w == null ? void 0 : w.fields) == null ? void 0 : $.map((g) => g.key)) || [],
2487
+ callbacks: mt(
2488
+ p,
2489
+ Vn
2490
+ )
2491
+ } : {
2492
+ source: d,
2493
+ callbacks: mt(p, Rn),
2494
+ options: { deep: ["array", "object"].includes(y) }
2495
+ };
2496
+ }), m = a.filter(
2497
+ ({ actions: p }) => (p == null ? void 0 : p.length) && p.some((d) => typeof d == "object" && (d == null ? void 0 : d.immediate) !== !1)
2498
+ ).map((p) => {
2499
+ var $;
2500
+ const { key: d, type: y, component: w } = p;
2501
+ return y === "combined" ? {
2502
+ source: (($ = w == null ? void 0 : w.fields) == null ? void 0 : $.map((g) => g.key)) || [],
2503
+ callbacks: mt(
2504
+ p,
2505
+ Vn,
2506
+ !0
2507
+ )
2508
+ } : {
2509
+ source: d,
2510
+ callbacks: mt(p, Rn, !0),
2511
+ options: { deep: ["array", "object"].includes(y) }
2512
+ };
2513
+ });
2514
+ return { watchers: v, immediateWatchers: m };
2515
+ }, s = () => {
2516
+ o.forEach((v) => v()), o = [];
2517
+ };
2518
+ return { getActionWatchers: i, startActionWatch: (v) => {
2519
+ const m = ({ source: y, callbacks: w }, $) => re(
2520
+ Array.isArray(y) ? y.map((g) => () => v[t][g]) : () => v[t][y],
2521
+ (g, u) => {
2522
+ w.forEach((F) => {
2523
+ try {
2524
+ Array.isArray(y) ? F(t, v, n.value) : F(
2525
+ g,
2526
+ t,
2527
+ v,
2528
+ n.value,
2529
+ u
2530
+ );
2531
+ } catch (c) {
2532
+ console.error(`[action handler error]: ${t} ${y}(${c})`);
2533
+ }
2534
+ });
2535
+ },
2536
+ $
2537
+ );
2538
+ o != null && o.length && s();
2539
+ const { watchers: p, immediateWatchers: d } = i();
2540
+ o = p.map((y) => m(y, y.options || {})), d.forEach(
2541
+ (y) => m(y, { ...y.options || {}, immediate: !0, once: !0 })
2542
+ );
2543
+ }, stopActionWatch: s };
2544
+ }, Tl = ["depValues", "formKey", "formData", "formConfig"], El = ["depValues", "formKey", "fieldKey", "formData", "fieldConfig"], Al = (e, t) => {
2545
+ const n = e.find(({ key: l }) => l === t), r = n.fields;
2546
+ let a = [];
2547
+ const o = () => {
2548
+ var m;
2549
+ const l = [];
2550
+ (m = n.subscribers) != null && m.length && n.subscribers.forEach((p) => {
2551
+ const { deps: d, immediate: y = !0, handler: w } = p, $ = st(
2552
+ w,
2553
+ Tl,
2554
+ p,
2555
+ "handler"
2556
+ ), g = l.find(
2557
+ ({ sources: u }) => Array.isArray(u) ? u.every((F) => d.includes(F)) && d.every((F) => u.includes(F)) : typeof d == "function" && u === d
2558
+ );
2559
+ g ? g.handlers.push({ target: t, immediate: y, callbacks: [$] }) : l.push({
2560
+ sources: lt(d, e, t),
2561
+ handlers: [
2562
+ {
2563
+ target: t,
2564
+ immediate: y,
2565
+ callbacks: [$]
2566
+ }
2567
+ ],
2568
+ deep: $t(d, e, t)
2569
+ });
2570
+ }), r.filter(({ subscribers: p }) => p == null ? void 0 : p.length).forEach(({ key: p, subscribers: d }) => {
2571
+ d.forEach((y) => {
2572
+ const { deps: w, immediate: $ = !0, handler: g } = y, u = st(
2573
+ g,
2574
+ El,
2575
+ y,
2576
+ "handler"
2577
+ ), F = l.find(
2578
+ ({ sources: c }) => Array.isArray(c) ? c.every((T) => w.includes(T)) && w.every((T) => c.includes(T)) : typeof w == "function" && c === w
2579
+ );
2580
+ if (F) {
2581
+ const c = F.handlers.find(({ target: T }) => T === p);
2582
+ c ? c.callbacks.push(u) : F.handlers.push({ target: p, immediate: $, callbacks: [u] });
2583
+ } else
2584
+ l.push({
2585
+ sources: lt(w, e, t),
2586
+ handlers: [{ target: p, immediate: $, callbacks: [u] }],
2587
+ deep: $t(w, e, t)
2588
+ });
2589
+ });
2590
+ });
2591
+ const v = l.filter(({ handlers: p }) => p.some(({ immediate: d }) => d)).map(({ sources: p, handlers: d, deep: y }) => ({
2592
+ sources: p,
2593
+ handlers: d.filter(({ immediate: w }) => w),
2594
+ deep: y
2595
+ }));
2596
+ return { watchers: l, immediateWatchers: v };
2597
+ };
2598
+ return { getSubscribeWatchers: o, startSubscribeWatch: (l) => {
2599
+ const { watchers: v, immediateWatchers: m } = o(), p = ({ sources: d, handlers: y, deep: w }, $) => re(
2600
+ d.map((g) => () => Zt(l, g)),
2601
+ (g) => {
2602
+ y.forEach(
2603
+ ({ target: u, callbacks: F }) => F.forEach((c) => {
2604
+ try {
2605
+ u === t ? c(g, t, l, n) : c(
2606
+ g,
2607
+ t,
2608
+ u,
2609
+ l,
2610
+ r.find(({ key: T }) => T === u)
2611
+ );
2612
+ } catch (T) {
2613
+ console.error(`[subscriber handler error]: ${T}`);
2614
+ }
2615
+ })
2616
+ );
2617
+ },
2618
+ { ...$, deep: ($ == null ? void 0 : $.deep) || w }
2619
+ );
2620
+ a = v.map((d) => p(d)), m.forEach(
2621
+ (d) => p(d, { immediate: !0, once: !0 })
2622
+ );
2623
+ }, stopSubscribeWatch: () => {
2624
+ a.forEach((l) => l()), a = [];
2625
+ } };
2626
+ }, Ol = (e, t, n, r, a, o) => {
2627
+ const i = t.find(({ key: u }) => u === n), s = se(1 / 0);
2628
+ let l = [];
2629
+ const v = (u, { type: F, component: c }, T, A) => {
2630
+ var E;
2631
+ if (T != null && T.length && l.push({
2632
+ sources: lt(T, t, i.key),
2633
+ targets: [u],
2634
+ deep: $t(T, t, i.key)
2635
+ }), typeof A != "object" && F === "combined" && ((E = c == null ? void 0 : c.fields) != null && E.length)) {
2636
+ const P = c.fields.filter(({ type: S }) => !["null", "container", "invisible"].includes(S)).map((S) => S.key);
2637
+ l.push({
2638
+ sources: lt(P, t, i.key),
2639
+ targets: [u],
2640
+ deep: $t(P, t, i.key)
2641
+ });
2642
+ }
2643
+ }, m = J(() => {
2644
+ const u = {};
2645
+ let F = !1;
2646
+ l = [];
2647
+ for (const { key: c, rules: T, type: A, show: E, disabled: P, component: S } of i.fields) {
2648
+ if (A === "null") continue;
2649
+ if (A === "container") {
2650
+ F = !E;
2651
+ continue;
2652
+ }
2653
+ !E || P || F || (u[c] = (T || []).map((D) => {
2654
+ const { validator: C, deps: O, level: V, ...I } = D, k = O != null && O.length ? O : typeof C == "object" ? C == null ? void 0 : C.deps : [];
2655
+ return v(c, { type: A, component: S }, k, C), {
2656
+ ...I,
2657
+ level: V,
2658
+ validator: $l(
2659
+ r,
2660
+ e,
2661
+ t,
2662
+ i,
2663
+ s,
2664
+ V,
2665
+ { type: A, component: S },
2666
+ k,
2667
+ C,
2668
+ typeof C == "object" ? C : D
2669
+ )
2670
+ };
2671
+ }));
2672
+ }
2673
+ return u;
2674
+ }), p = J(
2675
+ () => Object.entries(m.value).filter(([u, F]) => F == null ? void 0 : F.length).reduce(
2676
+ (u, [F, c]) => ({
2677
+ ...u,
2678
+ [F]: Math.min(...c.map((T) => T.level ?? 0))
2679
+ }),
2680
+ {}
2681
+ )
2682
+ );
2683
+ let d = [];
2684
+ const y = () => {
2685
+ const u = [];
2686
+ return l.forEach(({ sources: F, targets: c, deep: T }) => {
2687
+ const A = u.find(
2688
+ (E) => F.every((P) => E.sources.includes(P))
2689
+ );
2690
+ A ? A.targets.push(c[0]) : u.push({ sources: F, targets: c, deep: T });
2691
+ }), { watchers: u };
2692
+ }, w = () => {
2693
+ const { watchers: u } = y(), F = ({ sources: c, targets: T, deep: A }, E = { immediate: !0 }) => {
2694
+ const P = dr(async () => {
2695
+ await ve();
2696
+ try {
2697
+ await a(new Array(...new Set(T)));
2698
+ } catch {
2699
+ return;
2700
+ }
2701
+ }), S = re(
2702
+ c.map((q) => () => Zt(r.value, q)),
2703
+ () => {
2704
+ P.run();
2705
+ },
2706
+ { ...E, deep: A }
2707
+ );
2708
+ return () => {
2709
+ S(), P.dispose();
2710
+ };
2711
+ };
2712
+ d = u.map((c) => F(c));
2713
+ }, $ = () => {
2714
+ d.forEach((u) => u()), d = [];
2715
+ }, g = re(
2716
+ [m, o],
2717
+ () => {
2718
+ d != null && d.length && $(), o.value && w();
2719
+ },
2720
+ { immediate: !0 }
2721
+ );
2722
+ return Fe(() => {
2723
+ $(), g();
2724
+ }), { validateLevel: s, formRules: m, fieldMinValidateLevel: p };
2725
+ }, jl = (e, t) => {
2726
+ let n = [];
2727
+ const r = (s) => {
2728
+ const l = async () => {
2729
+ (!e.show || e.disabled) && (await ve(), e.fields.forEach(({ key: v, type: m, defaultValue: p, advancedConfig: d }) => {
2730
+ (d == null ? void 0 : d.skipAutoDataReset) !== !0 && (s[t][v] = p ?? Ue(m));
2731
+ }));
2732
+ };
2733
+ return [
2734
+ re(() => e.show, l),
2735
+ re(() => e.disabled, l)
2736
+ ];
2737
+ }, a = (s) => e.fields.map(({ key: l }) => {
2738
+ const v = e.fieldMap[l];
2739
+ return re(
2740
+ () => e.fieldMap[l].show,
2741
+ () => {
2742
+ var m, p, d;
2743
+ if (!v.show && !["invisible"].includes(v.type) && ((m = v.advancedConfig) == null ? void 0 : m.skipAutoDataReset) !== !0) {
2744
+ if (s[t][l] = v.defaultValue ?? Ue(v.type), v.type === "container") {
2745
+ let y = !1;
2746
+ e.fields.forEach((w) => {
2747
+ var $;
2748
+ w.key === l && (y = !0), w.type === "container" && w.key !== l && (y = !1), y && (($ = w.advancedConfig) == null ? void 0 : $.skipAutoDataReset) !== !0 && (s[t][w.key] = w.defaultValue ?? Ue(w.type));
2749
+ });
2750
+ }
2751
+ v.type === "combined" && ((d = (p = v.component) == null ? void 0 : p.fields) == null || d.forEach((y) => {
2752
+ s[t][y.key] = y.defaultValue ?? Ue(y.type);
2753
+ }));
2754
+ }
2755
+ }
2756
+ );
2757
+ }), o = () => {
2758
+ n.forEach((s) => s()), n = [];
2759
+ };
2760
+ return { startConfigWatch: (s) => {
2761
+ n != null && n.length && o(), n = [...r(s), ...a(s)];
2762
+ }, stopConfigWatch: o };
2763
+ };
2764
+ function Sl(e, t = { threshold: 1 }) {
2765
+ const n = new IntersectionObserver((o, i) => {
2766
+ o.forEach((s) => e(s, i));
2767
+ }, t);
2768
+ function r(o) {
2769
+ o.forEach((i) => n.observe(i));
2770
+ }
2771
+ function a(o) {
2772
+ o.forEach((i) => n.unobserve(i));
2773
+ }
2774
+ return Fe(() => {
2775
+ n.disconnect();
2776
+ }), { observer: n, observe: r, unobserve: a };
2777
+ }
2778
+ function kl(e) {
2779
+ let t = e.parentElement;
2780
+ for (; t; ) {
2781
+ if (t.scrollHeight > t.clientHeight)
2782
+ return t;
2783
+ t = t.parentElement;
2784
+ }
2785
+ return null;
2786
+ }
2787
+ function Ml(e, t) {
2788
+ let n = e.offsetTop, r = e.parentElement;
2789
+ for (; r && r !== t; )
2790
+ n += r.offsetTop, r = r.parentElement;
2791
+ return n;
2792
+ }
2793
+ const pr = (e, t) => ({ scrollTo: async (r) => {
2794
+ var i;
2795
+ const a = `${e}.${r}`, o = (i = t.value) == null ? void 0 : i.querySelector(
2796
+ `#${a.replaceAll(".", "-")}`
2797
+ );
2798
+ if (o) {
2799
+ await ve();
2800
+ const s = kl(o);
2801
+ if (s) {
2802
+ const l = Ml(o, s);
2803
+ s.scrollTo({
2804
+ top: l ? l - s.offsetTop : 0,
2805
+ left: 0,
2806
+ behavior: "smooth"
2807
+ });
2808
+ }
2809
+ }
2810
+ } }), ql = (e, t, n) => {
2811
+ const r = se(n.length > 0 ? n[0].name : void 0), a = se([]), o = se(!1), { observe: i, unobserve: s } = Sl(({ isIntersecting: u, target: F }) => {
2812
+ var T;
2813
+ const c = (T = F.id) == null ? void 0 : T.replace(`${e}-`, "");
2814
+ F.id && n.some(({ name: A }) => A === c) && (u ? a.value.push(c) : a.value = a.value.filter((A) => A !== c));
2815
+ }), l = () => {
2816
+ o.value = !0;
2817
+ const u = n.map(
2818
+ ({ name: F }) => {
2819
+ var c;
2820
+ return (c = t.value) == null ? void 0 : c.querySelector(
2821
+ `#${e}.${F}`.replaceAll(".", "-")
2822
+ );
2823
+ }
2824
+ ).filter((F) => F);
2825
+ i(u);
2826
+ }, v = () => {
2827
+ o.value = !1;
2828
+ const u = n.map(
2829
+ ({ name: F }) => {
2830
+ var c;
2831
+ return (c = t.value) == null ? void 0 : c.querySelector(
2832
+ `#${e}.${F}`.replaceAll(".", "-")
2833
+ );
2834
+ }
2835
+ ).filter((F) => F);
2836
+ s(u);
2837
+ }, m = Jt((u) => {
2838
+ var F;
2839
+ if (u.length > 0) {
2840
+ const c = (F = n.find(({ name: T }) => u.includes(T))) == null ? void 0 : F.name;
2841
+ c && (r.value = c);
2842
+ }
2843
+ }, 100), p = re(a, m, { deep: !0 });
2844
+ Fe(() => {
2845
+ m.cancel(), p();
2846
+ });
2847
+ const d = se(null);
2848
+ let y = null;
2849
+ const w = Fs(() => {
2850
+ if (d.value) {
2851
+ if (Date.now() - d.value > 1e3) {
2852
+ y !== null && clearTimeout(y), y = null, d.value = null;
2853
+ return;
2854
+ }
2855
+ y !== null && clearTimeout(y), y = setTimeout(() => {
2856
+ y = null, d.value = null;
2857
+ }, 600);
2858
+ }
2859
+ !o.value && !d.value && l();
2860
+ }, 500);
2861
+ Fe(() => {
2862
+ w.cancel(), y !== null && clearTimeout(y), y = null;
2863
+ });
2864
+ const { scrollTo: $ } = pr(e, t);
2865
+ return { current: r, onContentScroll: w, onTabChange: async (u) => {
2866
+ var T;
2867
+ const F = `${e}.${u}`;
2868
+ ((T = t.value) == null ? void 0 : T.querySelector(
2869
+ `#${F.replaceAll(".", "-")}`
2870
+ )) && (v(), d.value = Date.now(), $(u), ve(() => {
2871
+ r.value = u;
2872
+ }));
2873
+ } };
2874
+ }, Dl = (e, t, n, r = {}, a) => {
2875
+ const o = se([]), i = se({}), s = J(() => [
2876
+ ...H(o.value),
2877
+ ...Object.values(H(i.value)).flat()
2878
+ ]);
2879
+ let l = null, v = null, m = 0;
2880
+ Oe(
2881
+ kn,
2882
+ (w, $, { key: g, label: u } = {}, F) => {
2883
+ const c = e.fields.find(({ key: A }) => A === $), T = F ?? (c ? typeof c.label == "object" ? c.label.text : c.label : "");
2884
+ i.value = {
2885
+ ...i.value,
2886
+ [`${$}${qt}${g ?? ""}`]: (c ? w.map((A) => ({
2887
+ ...A,
2888
+ key: `${$}.${A.key}`,
2889
+ label: `${T}${T ? "-" : ""}${u ? u + "-" : ""}${A.label}`
2890
+ })) : w).filter(({ key: A }) => o.value.every((E) => E.key !== A))
2891
+ }, l || (l = re(
2892
+ () => e.fields,
2893
+ async (A) => {
2894
+ Object.entries(i.value).forEach(([E]) => {
2895
+ var P;
2896
+ ((P = A.find((S) => S.key === E.split(qt)[0])) == null ? void 0 : P.show) === !1 && delete i.value[E];
2897
+ });
2898
+ },
2899
+ { deep: !0 }
2900
+ )), v || (v = re(
2901
+ t,
2902
+ (A) => {
2903
+ const E = [];
2904
+ Object.entries(i.value).forEach(([P, S]) => {
2905
+ const [q, D] = P.split(qt);
2906
+ if (!A[q]) {
2907
+ E.push(P);
2908
+ return;
2909
+ }
2910
+ A[q][D] || E.push(P);
2911
+ }), E.forEach((P) => {
2912
+ delete i.value[P];
2913
+ });
2914
+ },
2915
+ { deep: !0 }
2916
+ )), a([
2917
+ ...H(o.value),
2918
+ ...Object.values(H(i.value)).flat()
2919
+ ]);
2920
+ }
2921
+ );
2922
+ const p = vt(
2923
+ kn,
2924
+ (w, $, { key: g, label: u } = {}) => {
2925
+ }
2926
+ ), d = dr(
2927
+ async (w, $, g) => {
2928
+ let u = [];
2929
+ try {
2930
+ await hl(w, $);
2931
+ } catch (F) {
2932
+ if (g !== m) return;
2933
+ const c = F.reduce(
2934
+ (T, { field: A, message: E }) => {
2935
+ var S;
2936
+ const P = (S = e.fields.find(({ key: q }) => q === A)) == null ? void 0 : S.label;
2937
+ return T.push({
2938
+ key: A,
2939
+ formKey: n,
2940
+ message: E,
2941
+ label: (typeof P == "object" ? P.text : P) ?? A
2942
+ }), T;
2943
+ },
2944
+ []
2945
+ );
2946
+ u = c.filter(
2947
+ (T, A) => c.findIndex(({ key: E }) => E === T.key) === A
2948
+ );
2949
+ }
2950
+ g === m && (o.value = u, a([
2951
+ ...H(o.value),
2952
+ ...Object.values(H(i.value)).flat()
2953
+ ]), p(o.value, n, r));
2954
+ }
2955
+ ), y = (w, $) => {
2956
+ const g = ++m;
2957
+ return d.run(w, $, g);
2958
+ };
2959
+ return Fe(() => {
2960
+ l == null || l(), v == null || v(), m++, d.dispose();
2961
+ }), { unfulfilledFields: s, getUnfulfilledFields: y };
2962
+ }, Pl = {
2963
+ key: 0,
2964
+ class: "zy-form-wrapper"
2965
+ }, xl = { key: 0 }, Cl = {
2966
+ key: 0,
2967
+ ref: "wrapper",
2968
+ class: "zy-form-wrapper"
2969
+ }, Rl = pe({ name: "ZYForm" }), In = /* @__PURE__ */ pe({
2970
+ ...Rl,
2971
+ props: {
2972
+ components: {},
2973
+ config: {},
2974
+ data: {},
2975
+ formKey: {},
2976
+ activated: { type: Boolean },
2977
+ readonly: { type: Boolean },
2978
+ static: { type: Boolean },
2979
+ disabled: { type: Boolean },
2980
+ requestFn: { type: Function, default: void 0 },
2981
+ scenario: { default: void 0 },
2982
+ requiredFieldOnly: { type: Boolean },
2983
+ anchorPositioning: { type: Boolean },
2984
+ anchorTabsPlacement: { default: "right" },
2985
+ nestedProps: {},
2986
+ showUnfulfilledTips: { type: Boolean, default: !0 }
2987
+ },
2988
+ emits: ["update:data", "update:config", "update:unfulfilledFields", "change", "blur", "keyupEnter", "mounted", "data-initialed"],
2989
+ setup(e, { expose: t, emit: n }) {
2990
+ const r = e, a = n, o = vt(ur, !1);
2991
+ o || Oe(cr, () => r.disabled);
2992
+ const i = se(!1);
2993
+ o ? re(
2994
+ () => r.activated,
2995
+ async (M) => {
2996
+ M ? (i.value = !0, await ve(), a("mounted")) : i.value = !1;
2997
+ },
2998
+ { immediate: !0 }
2999
+ ) : (i.value = !0, Ln(() => {
3000
+ a("mounted");
3001
+ }));
3002
+ const s = r.formKey, l = se(o ? r.config : Ye(r.config));
3003
+ (() => {
3004
+ var W;
3005
+ if (!l.value) return;
3006
+ let M = l.value.findIndex(({ key: U }) => U === s), x = l.value[M];
3007
+ r.scenario && (x = zt(x, r.scenario)), x = pl(x, s, r.requiredFieldOnly), x.readonly = r.readonly || x.readonly, x.fieldMap = (W = x.fields) == null ? void 0 : W.reduce((U, B) => ({ ...U, [B.key]: B }), {}), l.value[M] = x;
3008
+ })();
3009
+ const m = rt(
3010
+ l.value.find(({ key: M }) => M === s)
3011
+ ), { startActionWatch: p, stopActionWatch: d } = Fl(l.value, s), { startSubscribeWatch: y, stopSubscribeWatch: w } = Al(l.value, s), { startConfigWatch: $, stopConfigWatch: g } = jl(m, s);
3012
+ Fe(() => {
3013
+ d(), w(), g();
3014
+ });
3015
+ const u = async () => {
3016
+ d(), w(), g(), await ve(), p(r.data), y(r.data), $(r.data);
3017
+ };
3018
+ let F = null;
3019
+ !r.static && m.preScript && (F = gl(m.preScript));
3020
+ const { data: c } = gr(r), T = J({
3021
+ get: () => r.data[s] || {},
3022
+ set: (M) => a("update:data", {
3023
+ ...r.data,
3024
+ [s]: M
3025
+ })
3026
+ });
3027
+ let A = {};
3028
+ const E = () => {
3029
+ if (l.value)
3030
+ if (r.readonly && r.static)
3031
+ T.value = Ye(A);
3032
+ else {
3033
+ const M = yr(l.value, s);
3034
+ T.value = Wt(M, A), u();
3035
+ }
3036
+ }, P = se(wt()), S = async (M) => {
3037
+ A = mr(
3038
+ (M == null ? void 0 : M[s]) || M || T.value,
3039
+ l.value,
3040
+ s
3041
+ ), E(), P.value = wt(), await ve(), F == null || F(T, m), a("data-initialed", s);
3042
+ }, q = vt(gt, null);
3043
+ o || (S(), q ? re(
3044
+ () => q == null ? void 0 : q.value,
3045
+ (M) => {
3046
+ M && !o && S();
3047
+ }
3048
+ ) : Oe(gt, P));
3049
+ const { validateLevel: D, formRules: C, fieldMinValidateLevel: O } = Ol(
3050
+ T,
3051
+ l.value,
3052
+ s,
3053
+ c,
3054
+ async (M) => await I(1 / 0, M),
3055
+ i
3056
+ ), V = Pt("form-renderer"), I = async (M = 1 / 0, x = []) => {
3057
+ var U, B, Q;
3058
+ D.value = M;
3059
+ const W = ((U = V.value) == null ? void 0 : U.getFormItemRefs()) || [];
3060
+ try {
3061
+ return f(b.value, T.value), await Promise.all([
3062
+ ...W.filter((ee) => {
3063
+ var le;
3064
+ return ((le = ee.ref) == null ? void 0 : le.validate) && (!x.length || x.includes(ee.key));
3065
+ }).map((ee) => {
3066
+ var le;
3067
+ return (le = ee.ref) == null ? void 0 : le.validate(M);
3068
+ }),
3069
+ x != null && x.length ? (B = V.value) == null ? void 0 : B.validateField(x) : (Q = V.value) == null ? void 0 : Q.validate()
3070
+ ]);
3071
+ } catch (ee) {
3072
+ return vl(ee), Promise.reject(ee);
3073
+ }
3074
+ }, { unfulfilledFields: k, getUnfulfilledFields: f } = Dl(
3075
+ m,
3076
+ T,
3077
+ s,
3078
+ r.nestedProps,
3079
+ (M) => {
3080
+ a("update:unfulfilledFields", M);
3081
+ }
3082
+ ), b = J(() => {
3083
+ const M = {}, x = new Map(m.fields.map(({ key: W, rules: U }) => [W, U || []]));
3084
+ for (const [W, U] of Object.entries(C.value)) {
3085
+ const B = x.get(W) || [], Q = (le, ft) => {
3086
+ var ct;
3087
+ const qe = (ct = B[ft]) == null ? void 0 : ct.validator;
3088
+ return le.required || typeof qe == "object" && (qe == null ? void 0 : qe.required);
3089
+ }, ee = U.filter(Q);
3090
+ ee.length > 0 && (M[W] = ee);
3091
+ }
3092
+ return M;
3093
+ });
3094
+ if (!r.readonly) {
3095
+ const M = Jt(f, 100), x = re(
3096
+ [T, b, () => m.show, () => m.disabled],
3097
+ ([W, U, B, Q]) => {
3098
+ B && !Q && M(U, W);
3099
+ },
3100
+ { deep: !0, immediate: !0 }
3101
+ );
3102
+ Fe(() => {
3103
+ x(), M.cancel();
3104
+ });
3105
+ }
3106
+ r.static || re(
3107
+ () => r.requiredFieldOnly,
3108
+ (M) => {
3109
+ m.fields.forEach((x) => {
3110
+ var U;
3111
+ const W = !!((U = x.rules) != null && U.some((B) => B.required));
3112
+ x.show = !M || W;
3113
+ });
3114
+ }
3115
+ );
3116
+ const h = () => {
3117
+ if (!r.readonly) return;
3118
+ if (!m.postScript) return H(T.value);
3119
+ const M = bl(m.postScript);
3120
+ return M == null ? void 0 : M(T, m);
3121
+ }, j = Pt("wrapper"), { scrollTo: R } = pr(s, j);
3122
+ let N = null;
3123
+ const G = () => {
3124
+ N || r.readonly || (j.value ? R(k.value[0].key) : N = br(() => {
3125
+ j.value && (R(k.value[0].key), N == null || N(), N = null);
3126
+ }));
3127
+ }, X = J(() => {
3128
+ if (m.fields.every((W) => W.type !== "container")) return {};
3129
+ const M = {};
3130
+ return m.fields.forEach((W) => {
3131
+ var U;
3132
+ if (W.type === "container")
3133
+ M[W.key] = [];
3134
+ else {
3135
+ const [B] = Object.keys(M).slice(-1);
3136
+ (U = M[B]) == null || U.push(W.key);
3137
+ }
3138
+ }), Object.entries(M).reduce(
3139
+ (W, [U, B]) => (W[U] = B.some(
3140
+ (Q) => k.value.some((ee) => ee.key === Q)
3141
+ ), W),
3142
+ {}
3143
+ );
3144
+ }), ne = J(() => r.anchorPositioning && m.fields.some((M) => M.type === "container") && !!r.components.anchorTabs), ie = J(() => m.fields.filter(
3145
+ (M) => {
3146
+ var x;
3147
+ return M.type === "container" && M.show && ((x = M.component) == null ? void 0 : x.anchorTab) !== !1;
3148
+ }
3149
+ ).map((M) => {
3150
+ var x, W;
3151
+ return {
3152
+ label: ((W = (x = M.component) == null ? void 0 : x.props) == null ? void 0 : W.content) ?? (typeof M.label == "object" ? M.label.text : M.label),
3153
+ name: M.key
3154
+ };
3155
+ })), {
3156
+ current: ce,
3157
+ onContentScroll: be,
3158
+ onTabChange: Ee
3159
+ } = ql(s, j, ie.value), we = J(
3160
+ () => m.fields.some((M) => {
3161
+ var x;
3162
+ return ((x = M.component) == null ? void 0 : x.type) === fe.Collapse;
3163
+ }) && !!r.components.collapse
3164
+ ), oe = J(
3165
+ () => m.fields.filter((M) => {
3166
+ var x;
3167
+ return ((x = M.component) == null ? void 0 : x.type) === fe.Collapse;
3168
+ })
3169
+ ), he = J(() => m.fields.reduce((x, W, U) => {
3170
+ var Q, ee, le, ft, qe;
3171
+ const B = (Q = x[x.length - 1]) == null ? void 0 : Q[0];
3172
+ return W.type === "container" || U === 0 ? x.push([W]) : (B == null ? void 0 : B.type) !== "container" || !((le = (ee = B == null ? void 0 : B.component) == null ? void 0 : ee.fields) != null && le.length) || (qe = (ft = B == null ? void 0 : B.component) == null ? void 0 : ft.fields) != null && qe.some((ct) => ct.key === W.key) ? x[x.length - 1].push(W) : x.push([W]), x;
3173
+ }, [])), Ae = J(() => {
3174
+ if (!r.showUnfulfilledTips || r.readonly) return {};
3175
+ const M = {};
3176
+ return ie.value.forEach(({ name: x }) => {
3177
+ M[x] = k.value.filter((W) => {
3178
+ var Q;
3179
+ const U = m.fields.find(
3180
+ (ee) => ee.key === (W.formKey !== s ? W.formKey : W.key)
3181
+ );
3182
+ if (!U) return !1;
3183
+ let B = "";
3184
+ for (let ee = 0; ee < m.fields.length; ee++) {
3185
+ const le = m.fields[ee];
3186
+ if (le.key === U.key) break;
3187
+ le.type === "container" && ((Q = le.component) == null ? void 0 : Q.anchorTab) !== !1 && (B = le.key);
3188
+ }
3189
+ return B === x;
3190
+ });
3191
+ }), M;
3192
+ });
3193
+ return t({
3194
+ initFormData: S,
3195
+ resetFormData: E,
3196
+ restartWatch: u,
3197
+ validate: async (M, x) => r.readonly || await I(M, x),
3198
+ clearValidate: () => {
3199
+ var M;
3200
+ return r.readonly || ((M = V.value) == null ? void 0 : M.clearValidate());
3201
+ },
3202
+ getFormData: h,
3203
+ showFirstUnfulfilledField: G,
3204
+ scrollTo: (M) => R(M)
3205
+ }), o || Oe(
3206
+ fr,
3207
+ rt({
3208
+ disabled: Bn(() => r.disabled),
3209
+ initFormData: S,
3210
+ resetFormData: E,
3211
+ restartWatch: u,
3212
+ validate: async (M, x) => r.readonly || await I(M, x),
3213
+ getFormData: h,
3214
+ showFirstUnfulfilledField: G,
3215
+ scrollTo: (M) => R(M)
3216
+ })
3217
+ ), (M, x) => {
3218
+ var W;
3219
+ return i.value ? (L(), te("div", Pl, [
3220
+ (W = l.value) != null && W.find(({ key: U }) => U === Y(s)) ? (L(), te(ye, { key: 1 }, [
3221
+ e.anchorPositioning && e.components.anchorTabs ? (L(), te("div", Cl, [
3222
+ e.anchorTabsPlacement === "left" ? (L(), _(ue(e.components.anchorTabs), {
3223
+ key: 0,
3224
+ modelValue: Y(ce),
3225
+ "onUpdate:modelValue": x[0] || (x[0] = (U) => Xt(ce) ? ce.value = U : null),
3226
+ "tab-position": "left",
3227
+ tabs: ie.value,
3228
+ "unfulfilled-fields": Ae.value,
3229
+ onTabChange: Y(Ee)
3230
+ }, null, 40, ["modelValue", "tabs", "unfulfilled-fields", "onTabChange"])) : Le("", !0),
3231
+ Tt(Dn, {
3232
+ ref: "form-renderer",
3233
+ modelValue: T.value,
3234
+ "onUpdate:modelValue": x[1] || (x[1] = (U) => T.value = U),
3235
+ components: e.components,
3236
+ "form-key": Y(s),
3237
+ "form-config": m,
3238
+ "form-rules": Y(C),
3239
+ readonly: e.readonly,
3240
+ disabled: e.disabled,
3241
+ "request-fn": e.requestFn,
3242
+ "anchor-position-available": ne.value,
3243
+ "on-content-scroll": Y(be),
3244
+ "has-collapse": we.value,
3245
+ "collapse-group-items": oe.value,
3246
+ "container-list": he.value,
3247
+ "container-validate-status-map": X.value,
3248
+ "unfulfilled-fields": Y(k),
3249
+ "field-min-validate-level": Y(O),
3250
+ onChange: x[2] || (x[2] = (U, B) => a("change", U, B)),
3251
+ onBlur: x[3] || (x[3] = (U, B, Q) => a("blur", U, B, Q)),
3252
+ onKeyupEnter: x[4] || (x[4] = (U, B, Q) => a("keyupEnter", U, B, Q))
3253
+ }, null, 8, ["modelValue", "components", "form-key", "form-config", "form-rules", "readonly", "disabled", "request-fn", "anchor-position-available", "on-content-scroll", "has-collapse", "collapse-group-items", "container-list", "container-validate-status-map", "unfulfilled-fields", "field-min-validate-level"]),
3254
+ e.anchorTabsPlacement === "right" ? (L(), _(ue(e.components.anchorTabs), {
3255
+ key: 1,
3256
+ modelValue: Y(ce),
3257
+ "onUpdate:modelValue": x[5] || (x[5] = (U) => Xt(ce) ? ce.value = U : null),
3258
+ "tab-position": "right",
3259
+ tabs: ie.value,
3260
+ "unfulfilled-fields": Ae.value,
3261
+ onTabChange: Y(Ee)
3262
+ }, null, 40, ["modelValue", "tabs", "unfulfilled-fields", "onTabChange"])) : Le("", !0)
3263
+ ], 512)) : (L(), _(Dn, {
3264
+ key: 1,
3265
+ ref: "form-renderer",
3266
+ modelValue: T.value,
3267
+ "onUpdate:modelValue": x[6] || (x[6] = (U) => T.value = U),
3268
+ components: e.components,
3269
+ "form-key": Y(s),
3270
+ "form-config": m,
3271
+ "form-rules": Y(C),
3272
+ readonly: e.readonly,
3273
+ disabled: e.disabled,
3274
+ "request-fn": e.requestFn,
3275
+ "anchor-position-available": ne.value,
3276
+ "on-content-scroll": Y(be),
3277
+ "has-collapse": we.value,
3278
+ "collapse-group-items": oe.value,
3279
+ "container-list": he.value,
3280
+ "container-validate-status-map": X.value,
3281
+ "unfulfilled-fields": Y(k),
3282
+ "field-min-validate-level": Y(O),
3283
+ onChange: x[7] || (x[7] = (U, B) => a("change", U, B)),
3284
+ onBlur: x[8] || (x[8] = (U, B, Q) => a("blur", U, B, Q)),
3285
+ onKeyupEnter: x[9] || (x[9] = (U, B, Q) => a("keyupEnter", U, B, Q))
3286
+ }, null, 8, ["modelValue", "components", "form-key", "form-config", "form-rules", "readonly", "disabled", "request-fn", "anchor-position-available", "on-content-scroll", "has-collapse", "collapse-group-items", "container-list", "container-validate-status-map", "unfulfilled-fields", "field-min-validate-level"]))
3287
+ ], 64)) : (L(), te("div", xl, "表单配置读取失败"))
3288
+ ])) : Le("", !0);
3289
+ };
3290
+ }
3291
+ }), Nn = (e, t) => e.filter(
3292
+ ({ key: r }) => t === r || Array.isArray(t) && t.includes(r) || !t
3293
+ ).reduce(
3294
+ (r, { key: a }) => ({
3295
+ ...r,
3296
+ [a]: yr(e, a)
3297
+ }),
3298
+ {}
3299
+ ), Vl = (e, t, n) => t.filter(
3300
+ ({ key: a }) => n === a || Array.isArray(n) && n.includes(a) || !n
3301
+ ).reduce(
3302
+ (a, { key: o }) => ({
3303
+ ...a,
3304
+ [o]: mr(e[o], t, o)
3305
+ }),
3306
+ {}
3307
+ ), Il = pe({ name: "ZYFormGroup" }), Ul = /* @__PURE__ */ pe({
3308
+ ...Il,
3309
+ props: {
3310
+ components: {},
3311
+ config: {},
3312
+ data: {},
3313
+ readonly: { type: Boolean },
3314
+ static: { type: Boolean },
3315
+ disabled: { type: Boolean },
3316
+ requestFn: { type: Function, default: void 0 },
3317
+ scenario: { default: void 0 },
3318
+ requiredFieldOnly: { type: Boolean },
3319
+ containChildFormInTabs: { type: Boolean },
3320
+ defaultTabKey: { default: void 0 },
3321
+ showUnfulfilledTips: { type: Boolean, default: !0 }
3322
+ },
3323
+ emits: ["update:data", "tab-change", "mounted", "data-initialed"],
3324
+ setup(e, { expose: t, emit: n }) {
3325
+ var I, k;
3326
+ const r = e, a = n, o = Yt();
3327
+ Oe(cr, () => r.disabled);
3328
+ const i = se({}), s = (f, b) => {
3329
+ b ? i.value[f] = b : delete i.value[f];
3330
+ }, l = () => Object.entries(i.value).filter(
3331
+ (f) => f[1] !== null
3332
+ ), v = J(() => r.config), m = /* @__PURE__ */ new Set(), p = se(!1), d = J(
3333
+ () => v.value.filter(({ show: f }) => f ?? !0).map((f) => ({
3334
+ label: f.title,
3335
+ name: f.key,
3336
+ disabled: f.disabled ?? !1
3337
+ }))
3338
+ ), y = se(
3339
+ r.defaultTabKey ?? ((k = (I = v.value.filter(({ show: f }) => f ?? !0)) == null ? void 0 : I[0]) == null ? void 0 : k.key)
3340
+ );
3341
+ re(d, (f) => {
3342
+ var b;
3343
+ f.find((h) => h.name === y.value) || (y.value = ((b = v.value.find(({ show: h, disabled: j }) => h && !j)) == null ? void 0 : b.key) || "");
3344
+ });
3345
+ const w = se(r.data);
3346
+ re(
3347
+ () => w,
3348
+ (f) => a("update:data", f.value),
3349
+ { deep: !0 }
3350
+ );
3351
+ let $ = {};
3352
+ const g = async (f) => {
3353
+ var b;
3354
+ if (typeof f == "string") return (b = i.value[f]) == null ? void 0 : b.resetFormData();
3355
+ if (Array.isArray(f))
3356
+ return f.forEach((h) => {
3357
+ var j;
3358
+ return (j = i.value[h]) == null ? void 0 : j.resetFormData();
3359
+ });
3360
+ if (r.readonly && r.static)
3361
+ w.value = Ye($);
3362
+ else {
3363
+ const h = Nn(v.value);
3364
+ w.value = Object.entries(h).reduce(
3365
+ (j, [R, N]) => ({
3366
+ ...j,
3367
+ [R]: Wt(N, $[R] || {})
3368
+ }),
3369
+ {}
3370
+ );
3371
+ }
3372
+ await ve(), l().forEach(([, h]) => h.resetFormData());
3373
+ }, u = se(wt()), F = async (f) => {
3374
+ if ($ = Vl(f || r.data, v.value), r.readonly && r.static)
3375
+ w.value = Ye($);
3376
+ else {
3377
+ const b = Nn(v.value);
3378
+ w.value = Object.entries(b).reduce(
3379
+ (h, [j, R]) => ({
3380
+ ...h,
3381
+ [j]: Wt(R, $[j] || {})
3382
+ }),
3383
+ {}
3384
+ );
3385
+ }
3386
+ await ve(), await Promise.all(l().map(([, b]) => b.initFormData(w.value))), u.value = wt(), a("data-initialed");
3387
+ }, c = vt(gt, null);
3388
+ c && re(
3389
+ () => c.value,
3390
+ () => {
3391
+ F();
3392
+ }
3393
+ ), Oe(gt, u);
3394
+ const T = rt(
3395
+ v.value.reduce((f, { key: b }) => ({ ...f, [b]: [] }), {})
3396
+ );
3397
+ re(
3398
+ () => v.value.map(({ key: f }) => f),
3399
+ (f) => {
3400
+ const b = new Set(f);
3401
+ Object.keys(i.value).forEach((j) => {
3402
+ b.has(j) || delete i.value[j];
3403
+ }), Object.keys(T).forEach((j) => {
3404
+ b.has(j) || delete T[j];
3405
+ }), f.forEach((j) => {
3406
+ j in T || (T[j] = []);
3407
+ }), m.forEach((j) => {
3408
+ b.has(j) || m.delete(j);
3409
+ }), v.value.filter(({ show: j, disabled: R }) => !R && j !== !1).map(({ key: j }) => j).every((j) => m.has(j)) || (p.value = !1);
3410
+ },
3411
+ { immediate: !0 }
3412
+ );
3413
+ const A = (f, b = []) => {
3414
+ const h = v.value.find((j) => j.key === f);
3415
+ if (h && !h.disabled && h.show !== !1) {
3416
+ T[f] = b;
3417
+ return;
3418
+ }
3419
+ delete T[f];
3420
+ }, E = () => {
3421
+ const f = Object.entries(T).filter(([b]) => {
3422
+ const h = v.value.find((j) => j.key === b);
3423
+ return !!h && h.show !== !1 && h.disabled !== !0;
3424
+ }).find(([, b]) => b.length > 0);
3425
+ return f && (y.value = f[0]), f == null ? void 0 : f[0];
3426
+ }, P = (f) => {
3427
+ var h;
3428
+ const b = E();
3429
+ b && ((h = i.value[b]) == null || h.showFirstUnfulfilledField());
3430
+ };
3431
+ r.static || re(
3432
+ () => r.requiredFieldOnly,
3433
+ (f) => {
3434
+ v.value.forEach((b) => {
3435
+ b.fields.some(
3436
+ (j) => {
3437
+ var R;
3438
+ return !!((R = j.rules) != null && R.some((N) => N.required));
3439
+ }
3440
+ ) || (b.show = !f);
3441
+ });
3442
+ }
3443
+ );
3444
+ const S = async (f, b = 1 / 0, h = !1) => {
3445
+ var j;
3446
+ if (!r.readonly) {
3447
+ if (f && typeof f == "string")
3448
+ return await ((j = i.value[f]) == null ? void 0 : j.validate(b));
3449
+ {
3450
+ let R;
3451
+ try {
3452
+ R = await Promise.all(
3453
+ l().filter(([N]) => {
3454
+ const G = v.value.find((X) => X.key === N);
3455
+ return (!(f != null && f.length) || f.includes(N)) && (G == null ? void 0 : G.show) !== !1 && (G == null ? void 0 : G.disabled) !== !0;
3456
+ }).map(([, N]) => N.validate(b))
3457
+ );
3458
+ } finally {
3459
+ h && (await ve(), P());
3460
+ }
3461
+ return R;
3462
+ }
3463
+ }
3464
+ }, q = (f) => {
3465
+ var b;
3466
+ r.readonly || (f && typeof f == "string" ? (b = i.value[f]) == null || b.clearValidate() : l().filter(([h]) => !(f != null && f.length) || f.includes(h)).forEach(([, h]) => h.clearValidate()));
3467
+ }, D = () => r.readonly && r.static ? w.value : l().filter(([f]) => {
3468
+ var h;
3469
+ const b = v.value.find((j) => j.key === f);
3470
+ return (b == null ? void 0 : b.show) && (b == null ? void 0 : b.disabled) !== !0 && ((h = b == null ? void 0 : b.props) == null ? void 0 : h.disabled) !== !0;
3471
+ }).map(([f, b]) => ({
3472
+ [f]: b.getFormData()
3473
+ })).reduce((f, b) => ({ ...f, ...b }), {});
3474
+ t({
3475
+ resetFormData: g,
3476
+ initFormData: F,
3477
+ validate: S,
3478
+ clearValidate: q,
3479
+ getFormData: D,
3480
+ scrollTo: (f, b) => {
3481
+ var h;
3482
+ y.value = f, (h = i.value[f]) == null || h.scrollTo(b);
3483
+ }
3484
+ }), Oe(ur, !0), Oe(
3485
+ fr,
3486
+ rt({
3487
+ disabled: Bn(() => r.disabled),
3488
+ resetFormData: g,
3489
+ initFormData: F,
3490
+ validate: S,
3491
+ clearValidate: q,
3492
+ getFormData: D,
3493
+ scrollTo: (f, b) => {
3494
+ var h;
3495
+ y.value = f, (h = i.value[f]) == null || h.scrollTo(b);
3496
+ }
3497
+ })
3498
+ );
3499
+ const C = se(!1);
3500
+ let O = null;
3501
+ Ln(() => {
3502
+ O = setTimeout(() => {
3503
+ O = null, C.value = !0;
3504
+ }, 1e3);
3505
+ }), Fe(() => {
3506
+ O !== null && clearTimeout(O), O = null;
3507
+ });
3508
+ const V = async (f) => {
3509
+ m.add(f), v.value.filter(({ show: b, disabled: h }) => !h && b !== !1).every(({ key: b }) => m.has(b)) && !p.value && (p.value = !0, a("mounted"), await ve(), F());
3510
+ };
3511
+ return (f, b) => (L(), te(ye, null, [
3512
+ (L(), _(ue(e.components.tabs), {
3513
+ modelValue: y.value,
3514
+ "onUpdate:modelValue": b[1] || (b[1] = (h) => y.value = h),
3515
+ tabs: d.value,
3516
+ "unfulfilled-fields": !e.readonly && e.showUnfulfilledTips ? T : {},
3517
+ onTabChange: b[2] || (b[2] = (...h) => a("tab-change", ...h))
3518
+ }, wr({ _: 2 }, [
3519
+ e.containChildFormInTabs ? {
3520
+ name: "default",
3521
+ fn: We(({ tabKey: h }) => {
3522
+ var j, R;
3523
+ return [
3524
+ Tt(Y(In), de({
3525
+ ref: (N) => s(h, N),
3526
+ data: w.value,
3527
+ "onUpdate:data": b[0] || (b[0] = (N) => w.value = N),
3528
+ activated: ((j = v.value.find((N) => N.key === h)) == null ? void 0 : j.disabled) !== !0 && ((R = v.value.find((N) => N.key === h)) == null ? void 0 : R.show) !== !1,
3529
+ "form-key": h,
3530
+ components: e.components,
3531
+ config: v.value,
3532
+ "request-fn": e.requestFn,
3533
+ scenario: e.scenario,
3534
+ "required-field-only": e.requiredFieldOnly,
3535
+ readonly: e.readonly,
3536
+ static: e.static,
3537
+ disabled: e.disabled,
3538
+ "show-unfulfilled-tips": e.showUnfulfilledTips
3539
+ }, Y(o), {
3540
+ "onUpdate:unfulfilledFields": (N) => A(h, N),
3541
+ onMounted: () => V(h)
3542
+ }), null, 16, ["data", "activated", "form-key", "components", "config", "request-fn", "scenario", "required-field-only", "readonly", "static", "disabled", "show-unfulfilled-tips", "onUpdate:unfulfilledFields", "onMounted"])
3543
+ ];
3544
+ }),
3545
+ key: "0"
3546
+ } : void 0
3547
+ ]), 1064, ["modelValue", "tabs", "unfulfilled-fields"])),
3548
+ e.containChildFormInTabs ? Le("", !0) : (L(!0), te(ye, { key: 0 }, Ie(v.value, (h) => $r((L(), _(Y(In), de({
3549
+ key: h.key,
3550
+ ref_for: !0,
3551
+ ref: (j) => s(h.key, j),
3552
+ data: w.value,
3553
+ "onUpdate:data": b[3] || (b[3] = (j) => w.value = j),
3554
+ activated: h.disabled !== !0 && h.show !== !1 && (y.value === h.key || C.value),
3555
+ "form-key": h.key,
3556
+ components: e.components,
3557
+ config: v.value,
3558
+ "request-fn": e.requestFn,
3559
+ scenario: e.scenario,
3560
+ "required-field-only": e.requiredFieldOnly,
3561
+ readonly: e.readonly,
3562
+ static: e.static,
3563
+ disabled: e.disabled,
3564
+ "show-unfulfilled-tips": e.showUnfulfilledTips
3565
+ }, { ref_for: !0 }, Y(o), {
3566
+ "onUpdate:unfulfilledFields": (j) => A(h.key, j),
3567
+ onMounted: () => V(h.key)
3568
+ }), null, 16, ["data", "activated", "form-key", "components", "config", "request-fn", "scenario", "required-field-only", "readonly", "static", "disabled", "show-unfulfilled-tips", "onUpdate:unfulfilledFields", "onMounted"])), [
3569
+ [Fr, y.value === h.key]
3570
+ ])), 128))
3571
+ ], 64));
3572
+ }
3573
+ });
3574
+ export {
3575
+ fe as ComponentTypeEnum,
3576
+ Ne as DELETED_FIELD_IDENTIFIER,
3577
+ fr as FORM_CONTEXT_SYMBOL,
3578
+ gt as FORM_DATA_REFRESH_SYMBOL,
3579
+ cr as FORM_DISABLED_SYMBOL,
3580
+ ur as FORM_GROUP_SYMBOL,
3581
+ kn as FORM_UNFULFILLED_FIELD_SYMBOL,
3582
+ qt as IDENTIFIER,
3583
+ In as ZYForm,
3584
+ Ul as ZYFormGroup,
3585
+ ol as getFormattedFieldValue,
3586
+ hl as validateFields
3587
+ };