@owp/core 1.25.0 → 1.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1209 @@
1
+ var Xe = Object.defineProperty;
2
+ var o = (e, t) => Xe(e, "name", { value: t, configurable: !0 });
3
+ import { d as ie, b as oe, e as W, c as K, a as ce, T as qe, f as Je } from "./treeGrid-CPgV7yMG.js";
4
+ import fe from "dayjs";
5
+ import Ze from "exceljs";
6
+ import { enqueueSnackbar as Qe } from "notistack";
7
+ function ke(e) {
8
+ return Number.isSafeInteger(e) && e >= 0;
9
+ }
10
+ o(ke, "isLength");
11
+ function ae(e) {
12
+ return e != null && typeof e != "function" && ke(e.length);
13
+ }
14
+ o(ae, "isArrayLike");
15
+ function x(e) {
16
+ return e === "__proto__";
17
+ }
18
+ o(x, "isUnsafeProperty");
19
+ function ue(e) {
20
+ switch (typeof e) {
21
+ case "number":
22
+ case "symbol":
23
+ return !1;
24
+ case "string":
25
+ return e.includes(".") || e.includes("[") || e.includes("]");
26
+ }
27
+ }
28
+ o(ue, "isDeepKey");
29
+ function le(e) {
30
+ var t;
31
+ return typeof e == "string" || typeof e == "symbol" ? e : Object.is((t = e == null ? void 0 : e.valueOf) == null ? void 0 : t.call(e), -0) ? "-0" : String(e);
32
+ }
33
+ o(le, "toKey");
34
+ function de(e) {
35
+ const t = [], n = e.length;
36
+ if (n === 0)
37
+ return t;
38
+ let r = 0, s = "", c = "", i = !1;
39
+ for (e.charCodeAt(0) === 46 && (t.push(""), r++); r < n; ) {
40
+ const f = e[r];
41
+ c ? f === "\\" && r + 1 < n ? (r++, s += e[r]) : f === c ? c = "" : s += f : i ? f === '"' || f === "'" ? c = f : f === "]" ? (i = !1, t.push(s), s = "") : s += f : f === "[" ? (i = !0, s && (t.push(s), s = "")) : f === "." ? s && (t.push(s), s = "") : s += f, r++;
42
+ }
43
+ return s && t.push(s), t;
44
+ }
45
+ o(de, "toPath");
46
+ function Y(e, t, n) {
47
+ if (e == null)
48
+ return n;
49
+ switch (typeof t) {
50
+ case "string": {
51
+ if (x(t))
52
+ return n;
53
+ const r = e[t];
54
+ return r === void 0 ? ue(t) ? Y(e, de(t), n) : n : r;
55
+ }
56
+ case "number":
57
+ case "symbol": {
58
+ typeof t == "number" && (t = le(t));
59
+ const r = e[t];
60
+ return r === void 0 ? n : r;
61
+ }
62
+ default: {
63
+ if (Array.isArray(t))
64
+ return ve(e, t, n);
65
+ if (Object.is(t == null ? void 0 : t.valueOf(), -0) ? t = "-0" : t = String(t), x(t))
66
+ return n;
67
+ const r = e[t];
68
+ return r === void 0 ? n : r;
69
+ }
70
+ }
71
+ }
72
+ o(Y, "get");
73
+ function ve(e, t, n) {
74
+ if (t.length === 0)
75
+ return n;
76
+ let r = e;
77
+ for (let s = 0; s < t.length; s++) {
78
+ if (r == null || x(t[s]))
79
+ return n;
80
+ r = r[t[s]];
81
+ }
82
+ return r === void 0 ? n : r;
83
+ }
84
+ o(ve, "getWithPath");
85
+ function et(e) {
86
+ return e == null || typeof e != "object" && typeof e != "function";
87
+ }
88
+ o(et, "isPrimitive");
89
+ function tt(e, t) {
90
+ return e === t || Number.isNaN(e) && Number.isNaN(t);
91
+ }
92
+ o(tt, "eq");
93
+ function F(e) {
94
+ return Object.getOwnPropertySymbols(e).filter((t) => Object.prototype.propertyIsEnumerable.call(e, t));
95
+ }
96
+ o(F, "getSymbols");
97
+ function T(e) {
98
+ return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
99
+ }
100
+ o(T, "getTag");
101
+ const ye = "[object RegExp]", ge = "[object String]", pe = "[object Number]", we = "[object Boolean]", H = "[object Arguments]", he = "[object Symbol]", me = "[object Date]", be = "[object Map]", Se = "[object Set]", Ie = "[object Array]", nt = "[object Function]", Ae = "[object ArrayBuffer]", L = "[object Object]", rt = "[object Error]", Re = "[object DataView]", xe = "[object Uint8Array]", Ee = "[object Uint8ClampedArray]", Oe = "[object Uint16Array]", Ge = "[object Uint32Array]", st = "[object BigUint64Array]", De = "[object Int8Array]", Be = "[object Int16Array]", _e = "[object Int32Array]", it = "[object BigInt64Array]", je = "[object Float32Array]", Ne = "[object Float64Array]";
102
+ function Le(e) {
103
+ return ArrayBuffer.isView(e) && !(e instanceof DataView);
104
+ }
105
+ o(Le, "isTypedArray$1");
106
+ function Wn(e, t) {
107
+ return R(e, void 0, e, /* @__PURE__ */ new Map(), t);
108
+ }
109
+ o(Wn, "cloneDeepWith");
110
+ function R(e, t, n, r = /* @__PURE__ */ new Map(), s = void 0) {
111
+ const c = s == null ? void 0 : s(e, t, n, r);
112
+ if (c !== void 0)
113
+ return c;
114
+ if (et(e))
115
+ return e;
116
+ if (r.has(e))
117
+ return r.get(e);
118
+ if (Array.isArray(e)) {
119
+ const i = new Array(e.length);
120
+ r.set(e, i);
121
+ for (let f = 0; f < e.length; f++)
122
+ i[f] = R(e[f], f, n, r, s);
123
+ return Object.hasOwn(e, "index") && (i.index = e.index), Object.hasOwn(e, "input") && (i.input = e.input), i;
124
+ }
125
+ if (e instanceof Date)
126
+ return new Date(e.getTime());
127
+ if (e instanceof RegExp) {
128
+ const i = new RegExp(e.source, e.flags);
129
+ return i.lastIndex = e.lastIndex, i;
130
+ }
131
+ if (e instanceof Map) {
132
+ const i = /* @__PURE__ */ new Map();
133
+ r.set(e, i);
134
+ for (const [f, a] of e)
135
+ i.set(f, R(a, f, n, r, s));
136
+ return i;
137
+ }
138
+ if (e instanceof Set) {
139
+ const i = /* @__PURE__ */ new Set();
140
+ r.set(e, i);
141
+ for (const f of e)
142
+ i.add(R(f, void 0, n, r, s));
143
+ return i;
144
+ }
145
+ if (typeof Buffer < "u" && Buffer.isBuffer(e))
146
+ return e.subarray();
147
+ if (Le(e)) {
148
+ const i = new (Object.getPrototypeOf(e)).constructor(e.length);
149
+ r.set(e, i);
150
+ for (let f = 0; f < e.length; f++)
151
+ i[f] = R(e[f], f, n, r, s);
152
+ return i;
153
+ }
154
+ if (e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer)
155
+ return e.slice(0);
156
+ if (e instanceof DataView) {
157
+ const i = new DataView(e.buffer.slice(0), e.byteOffset, e.byteLength);
158
+ return r.set(e, i), D(i, e, n, r, s), i;
159
+ }
160
+ if (typeof File < "u" && e instanceof File) {
161
+ const i = new File([e], e.name, {
162
+ type: e.type
163
+ });
164
+ return r.set(e, i), D(i, e, n, r, s), i;
165
+ }
166
+ if (e instanceof Blob) {
167
+ const i = new Blob([e], { type: e.type });
168
+ return r.set(e, i), D(i, e, n, r, s), i;
169
+ }
170
+ if (e instanceof Error) {
171
+ const i = new e.constructor();
172
+ return r.set(e, i), i.message = e.message, i.name = e.name, i.stack = e.stack, i.cause = e.cause, D(i, e, n, r, s), i;
173
+ }
174
+ if (typeof e == "object" && ot(e)) {
175
+ const i = Object.create(Object.getPrototypeOf(e));
176
+ return r.set(e, i), D(i, e, n, r, s), i;
177
+ }
178
+ return e;
179
+ }
180
+ o(R, "cloneDeepWithImpl");
181
+ function D(e, t, n = e, r, s) {
182
+ const c = [...Object.keys(t), ...F(t)];
183
+ for (let i = 0; i < c.length; i++) {
184
+ const f = c[i], a = Object.getOwnPropertyDescriptor(e, f);
185
+ (a == null || a.writable) && (e[f] = R(t[f], f, n, r, s));
186
+ }
187
+ }
188
+ o(D, "copyProperties");
189
+ function ot(e) {
190
+ switch (T(e)) {
191
+ case H:
192
+ case Ie:
193
+ case Ae:
194
+ case Re:
195
+ case we:
196
+ case me:
197
+ case je:
198
+ case Ne:
199
+ case De:
200
+ case Be:
201
+ case _e:
202
+ case be:
203
+ case pe:
204
+ case L:
205
+ case ye:
206
+ case Se:
207
+ case ge:
208
+ case he:
209
+ case xe:
210
+ case Ee:
211
+ case Oe:
212
+ case Ge:
213
+ return !0;
214
+ default:
215
+ return !1;
216
+ }
217
+ }
218
+ o(ot, "isCloneableObject");
219
+ function ct(e) {
220
+ return R(e, void 0, e, /* @__PURE__ */ new Map(), void 0);
221
+ }
222
+ o(ct, "cloneDeep");
223
+ function ft(e) {
224
+ return e !== null && typeof e == "object" && T(e) === "[object Arguments]";
225
+ }
226
+ o(ft, "isArguments");
227
+ function at(e, t) {
228
+ const n = new Set(t);
229
+ return e.filter((r) => !n.has(r));
230
+ }
231
+ o(at, "difference");
232
+ function ut(e) {
233
+ return typeof e == "object" && e !== null;
234
+ }
235
+ o(ut, "isObjectLike");
236
+ function lt(e) {
237
+ return ut(e) && ae(e);
238
+ }
239
+ o(lt, "isArrayLikeObject");
240
+ function Z(e, t) {
241
+ if (e == null)
242
+ return !0;
243
+ switch (typeof t) {
244
+ case "symbol":
245
+ case "number":
246
+ case "object": {
247
+ if (Array.isArray(t))
248
+ return Q(e, t);
249
+ if (typeof t == "number" ? t = le(t) : typeof t == "object" && (Object.is(t == null ? void 0 : t.valueOf(), -0) ? t = "-0" : t = String(t)), x(t))
250
+ return !1;
251
+ if ((e == null ? void 0 : e[t]) === void 0)
252
+ return !0;
253
+ try {
254
+ return delete e[t], !0;
255
+ } catch {
256
+ return !1;
257
+ }
258
+ }
259
+ case "string": {
260
+ if ((e == null ? void 0 : e[t]) === void 0 && ue(t))
261
+ return Q(e, de(t));
262
+ if (x(t))
263
+ return !1;
264
+ try {
265
+ return delete e[t], !0;
266
+ } catch {
267
+ return !1;
268
+ }
269
+ }
270
+ }
271
+ }
272
+ o(Z, "unset");
273
+ function Q(e, t) {
274
+ const n = Y(e, t.slice(0, -1), e), r = t[t.length - 1];
275
+ if ((n == null ? void 0 : n[r]) === void 0)
276
+ return !0;
277
+ if (x(r))
278
+ return !1;
279
+ try {
280
+ return delete n[r], !0;
281
+ } catch {
282
+ return !1;
283
+ }
284
+ }
285
+ o(Q, "unsetWithPath");
286
+ function dt(e) {
287
+ return Array.isArray(e);
288
+ }
289
+ o(dt, "isArray");
290
+ function yt(e, ...t) {
291
+ return at(e, t);
292
+ }
293
+ o(yt, "without$1");
294
+ function gt(e, ...t) {
295
+ return lt(e) ? yt(Array.from(e), ...t) : [];
296
+ }
297
+ o(gt, "without");
298
+ function Te(e) {
299
+ if (e == null)
300
+ return "";
301
+ if (typeof e == "string")
302
+ return e;
303
+ if (Array.isArray(e))
304
+ return e.map(Te).join(",");
305
+ const t = String(e);
306
+ return t === "0" && Object.is(Number(e), -0) ? "-0" : t;
307
+ }
308
+ o(Te, "toString");
309
+ function C(e) {
310
+ if (!e || typeof e != "object")
311
+ return !1;
312
+ const t = Object.getPrototypeOf(e);
313
+ return t === null || t === Object.prototype || Object.getPrototypeOf(t) === null ? Object.prototype.toString.call(e) === "[object Object]" : !1;
314
+ }
315
+ o(C, "isPlainObject$1");
316
+ function pt(e, t, n) {
317
+ return B(e, t, void 0, void 0, void 0, void 0, n);
318
+ }
319
+ o(pt, "isEqualWith");
320
+ function B(e, t, n, r, s, c, i) {
321
+ const f = i(e, t, n, r, s, c);
322
+ if (f !== void 0)
323
+ return f;
324
+ if (typeof e == typeof t)
325
+ switch (typeof e) {
326
+ case "bigint":
327
+ case "string":
328
+ case "boolean":
329
+ case "symbol":
330
+ case "undefined":
331
+ return e === t;
332
+ case "number":
333
+ return e === t || Object.is(e, t);
334
+ case "function":
335
+ return e === t;
336
+ case "object":
337
+ return _(e, t, c, i);
338
+ }
339
+ return _(e, t, c, i);
340
+ }
341
+ o(B, "isEqualWithImpl");
342
+ function _(e, t, n, r) {
343
+ if (Object.is(e, t))
344
+ return !0;
345
+ let s = T(e), c = T(t);
346
+ if (s === H && (s = L), c === H && (c = L), s !== c)
347
+ return !1;
348
+ switch (s) {
349
+ case ge:
350
+ return e.toString() === t.toString();
351
+ case pe: {
352
+ const a = e.valueOf(), u = t.valueOf();
353
+ return tt(a, u);
354
+ }
355
+ case we:
356
+ case me:
357
+ case he:
358
+ return Object.is(e.valueOf(), t.valueOf());
359
+ case ye:
360
+ return e.source === t.source && e.flags === t.flags;
361
+ case nt:
362
+ return e === t;
363
+ }
364
+ n = n ?? /* @__PURE__ */ new Map();
365
+ const i = n.get(e), f = n.get(t);
366
+ if (i != null && f != null)
367
+ return i === t;
368
+ n.set(e, t), n.set(t, e);
369
+ try {
370
+ switch (s) {
371
+ case be: {
372
+ if (e.size !== t.size)
373
+ return !1;
374
+ for (const [a, u] of e.entries())
375
+ if (!t.has(a) || !B(u, t.get(a), a, e, t, n, r))
376
+ return !1;
377
+ return !0;
378
+ }
379
+ case Se: {
380
+ if (e.size !== t.size)
381
+ return !1;
382
+ const a = Array.from(e.values()), u = Array.from(t.values());
383
+ for (let l = 0; l < a.length; l++) {
384
+ const d = a[l], y = u.findIndex((p) => B(d, p, void 0, e, t, n, r));
385
+ if (y === -1)
386
+ return !1;
387
+ u.splice(y, 1);
388
+ }
389
+ return !0;
390
+ }
391
+ case Ie:
392
+ case xe:
393
+ case Ee:
394
+ case Oe:
395
+ case Ge:
396
+ case st:
397
+ case De:
398
+ case Be:
399
+ case _e:
400
+ case it:
401
+ case je:
402
+ case Ne: {
403
+ if (typeof Buffer < "u" && Buffer.isBuffer(e) !== Buffer.isBuffer(t) || e.length !== t.length)
404
+ return !1;
405
+ for (let a = 0; a < e.length; a++)
406
+ if (!B(e[a], t[a], a, e, t, n, r))
407
+ return !1;
408
+ return !0;
409
+ }
410
+ case Ae:
411
+ return e.byteLength !== t.byteLength ? !1 : _(new Uint8Array(e), new Uint8Array(t), n, r);
412
+ case Re:
413
+ return e.byteLength !== t.byteLength || e.byteOffset !== t.byteOffset ? !1 : _(new Uint8Array(e), new Uint8Array(t), n, r);
414
+ case rt:
415
+ return e.name === t.name && e.message === t.message;
416
+ case L: {
417
+ if (!(_(e.constructor, t.constructor, n, r) || C(e) && C(t)))
418
+ return !1;
419
+ const u = [...Object.keys(e), ...F(e)], l = [...Object.keys(t), ...F(t)];
420
+ if (u.length !== l.length)
421
+ return !1;
422
+ for (let d = 0; d < u.length; d++) {
423
+ const y = u[d], p = e[y];
424
+ if (!Object.hasOwn(t, y))
425
+ return !1;
426
+ const w = t[y];
427
+ if (!B(p, w, y, e, t, n, r))
428
+ return !1;
429
+ }
430
+ return !0;
431
+ }
432
+ default:
433
+ return !1;
434
+ }
435
+ } finally {
436
+ n.delete(e), n.delete(t);
437
+ }
438
+ }
439
+ o(_, "areObjectsEqual");
440
+ function wt() {
441
+ }
442
+ o(wt, "noop");
443
+ function Kn(e, t) {
444
+ return pt(e, t, wt);
445
+ }
446
+ o(Kn, "isEqual");
447
+ function ht(e) {
448
+ const t = e == null ? void 0 : e.constructor, n = typeof t == "function" ? t.prototype : Object.prototype;
449
+ return e === n;
450
+ }
451
+ o(ht, "isPrototype");
452
+ function mt(e) {
453
+ return Le(e);
454
+ }
455
+ o(mt, "isTypedArray");
456
+ function k(e) {
457
+ var n;
458
+ if (typeof e != "object" || e == null)
459
+ return !1;
460
+ if (Object.getPrototypeOf(e) === null)
461
+ return !0;
462
+ if (Object.prototype.toString.call(e) !== "[object Object]") {
463
+ const r = e[Symbol.toStringTag];
464
+ return r == null || !((n = Object.getOwnPropertyDescriptor(e, Symbol.toStringTag)) != null && n.writable) ? !1 : e.toString() === `[object ${r}]`;
465
+ }
466
+ let t = e;
467
+ for (; Object.getPrototypeOf(t) !== null; )
468
+ t = Object.getPrototypeOf(t);
469
+ return Object.getPrototypeOf(e) === t;
470
+ }
471
+ o(k, "isPlainObject");
472
+ function bt(e, ...t) {
473
+ if (e == null)
474
+ return {};
475
+ const n = ct(e);
476
+ for (let r = 0; r < t.length; r++) {
477
+ let s = t[r];
478
+ switch (typeof s) {
479
+ case "object": {
480
+ Array.isArray(s) || (s = Array.from(s));
481
+ for (let c = 0; c < s.length; c++) {
482
+ const i = s[c];
483
+ Z(n, i);
484
+ }
485
+ break;
486
+ }
487
+ case "string":
488
+ case "symbol":
489
+ case "number": {
490
+ Z(n, s);
491
+ break;
492
+ }
493
+ }
494
+ }
495
+ return n;
496
+ }
497
+ o(bt, "omit");
498
+ function V(e) {
499
+ if (e == null)
500
+ return !0;
501
+ if (ae(e))
502
+ return typeof e.splice != "function" && typeof e != "string" && (typeof Buffer > "u" || !Buffer.isBuffer(e)) && !mt(e) && !ft(e) ? !1 : e.length === 0;
503
+ if (typeof e == "object") {
504
+ if (e instanceof Map || e instanceof Set)
505
+ return e.size === 0;
506
+ const t = Object.keys(e);
507
+ return ht(e) ? t.filter((n) => n !== "constructor").length === 0 : t.length === 0;
508
+ }
509
+ return !0;
510
+ }
511
+ o(V, "isEmpty");
512
+ const St = new RegExp("\\p{Lu}?\\p{Ll}+|[0-9]+|\\p{Lu}+(?!\\p{Ll})|\\p{Emoji_Presentation}|\\p{Extended_Pictographic}|\\p{L}+", "gu");
513
+ function It(e) {
514
+ return Array.from(e.match(St) ?? []);
515
+ }
516
+ o(It, "words");
517
+ function At(e) {
518
+ return typeof e != "string" && (e = Te(e)), e.replace(/['\u2019]/g, "");
519
+ }
520
+ o(At, "normalizeForCase");
521
+ function Rt(e) {
522
+ return It(e).map((n) => n.toLowerCase()).join(" ");
523
+ }
524
+ o(Rt, "lowerCase$1");
525
+ function xt(e) {
526
+ return Rt(At(e));
527
+ }
528
+ o(xt, "lowerCase");
529
+ const Et = "Header", Ot = "Toolbar", Me = "Foot", Pe = "nextSibling", Gt = [
530
+ Et,
531
+ Ot,
532
+ Me
533
+ ], Dt = Object.prototype.hasOwnProperty;
534
+ let v;
535
+ const U = /* @__PURE__ */ o((e, t) => {
536
+ const n = e;
537
+ for (const r in t) {
538
+ if (!Dt.call(t, r) || r === Pe)
539
+ continue;
540
+ const s = t[r];
541
+ s !== void 0 && (n[r] = s);
542
+ }
543
+ }, "assignTreeGridSectionFields"), Bt = /* @__PURE__ */ o((e, t) => {
544
+ if (!t || !(e != null && e.Header))
545
+ return;
546
+ let n = t[Pe], r = e.Header.nextSibling;
547
+ for (; n && r; )
548
+ U(r, n), n = n.nextSibling, r = r.nextSibling;
549
+ }, "applyTreeGridSubHeaderLayoutText"), _t = /* @__PURE__ */ o((e) => {
550
+ var t;
551
+ try {
552
+ if (!e || typeof DOMParser != "function")
553
+ return;
554
+ v ?? (v = new DOMParser());
555
+ const r = (t = v.parseFromString(e, "text/xml").documentElement) == null ? void 0 : t.children;
556
+ if (!(r != null && r.length))
557
+ return;
558
+ const s = new Array(r.length);
559
+ for (let c = 0; c < r.length; c += 1) {
560
+ const i = r[c].attributes, f = {};
561
+ for (let a = 0; a < i.length; a += 1) {
562
+ const u = i[a];
563
+ f[u.name] = u.value;
564
+ }
565
+ s[c] = f;
566
+ }
567
+ return s;
568
+ } catch (n) {
569
+ console.error(n);
570
+ return;
571
+ }
572
+ }, "parseTreeGridXmlToJson"), Yn = /* @__PURE__ */ o((e, t, n) => {
573
+ var i, f;
574
+ if (!t || !e)
575
+ return;
576
+ const r = (((i = e == null ? void 0 : e.Header) == null ? void 0 : i.Block) ?? 0) > 0, s = t.Header, c = (f = e.Foot) == null ? void 0 : f.lastChild;
577
+ r && s && k(s) && Bt(e, s);
578
+ for (const a of Gt) {
579
+ const u = t[a];
580
+ if (!u || !k(u))
581
+ continue;
582
+ if (a === Me && c) {
583
+ U(c, u);
584
+ continue;
585
+ }
586
+ const l = e[a];
587
+ l && U(l, u);
588
+ }
589
+ n || e.ReloadBody();
590
+ }, "applyTreeGridLayoutToGrid"), jt = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", Nt = "sheet", Lt = /* @__PURE__ */ o((e, t) => e.getCell(t), "getWorksheetCell"), Tt = /* @__PURE__ */ o((e, t) => {
591
+ const n = t ?? Nt, r = URL.createObjectURL(e), s = document.createElement("a");
592
+ s.href = r, s.download = `${n.normalize("NFC")}.xlsx`, s.click(), URL.revokeObjectURL(r);
593
+ }, "downloadExcelFile"), Mt = /* @__PURE__ */ o((e, t) => ({
594
+ ...oe,
595
+ ...!e && ie,
596
+ ...t
597
+ }), "createCellFont"), Pt = /* @__PURE__ */ o((e) => ({
598
+ ...W,
599
+ ...e
600
+ }), "createCellAlignment"), Ft = /* @__PURE__ */ o((e, t, n) => {
601
+ if (e.border = K, n) {
602
+ e.fill = ce;
603
+ return;
604
+ }
605
+ V(t) || (e.fill = t);
606
+ }, "applyCellFillAndBorder"), Vn = /* @__PURE__ */ o((e) => e.split("").reduce((t, n) => t * 26 + parseInt(n, 36) - 9, 0), "getIndexByLetters"), zn = /* @__PURE__ */ o((e) => {
607
+ const t = String.fromCharCode(65 + (e - 1) % 26);
608
+ return e > 26 ? String.fromCharCode(64 + (e - 1) / 26) + t : t;
609
+ }, "getLettersByIndex"), Ht = /* @__PURE__ */ o((e, t) => {
610
+ const n = new Blob([e], {
611
+ type: jt
612
+ });
613
+ Tt(n, t);
614
+ }, "exportExcelByBuffer"), Ct = /* @__PURE__ */ o((e, { key: t, value: n, font: r, alignment: s, fill: c, isHeader: i }) => {
615
+ const f = Lt(e, t);
616
+ f.value = n, f.font = Mt(i, r), f.alignment = Pt(s), Ft(f, c, i);
617
+ }, "setCellValue"), Xn = /* @__PURE__ */ o((e, { range: t, value: n, font: r, alignment: s, fill: c, isHeader: i }) => {
618
+ const f = t.split(":")[1];
619
+ e.mergeCells(t), Ct(e, {
620
+ key: f,
621
+ value: n,
622
+ alignment: s,
623
+ font: r,
624
+ fill: c,
625
+ isHeader: i
626
+ });
627
+ }, "setMergeCells"), I = 200, ee = /* @__PURE__ */ new Map(), Ut = "엑셀 다운로드 중 오류가 발생했습니다.", $t = "TreeGrid 인스턴스가 없습니다.", $ = /* @__PURE__ */ o((e) => e == null || typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e instanceof Date, "isPrimitiveCellValue"), S = /* @__PURE__ */ o(() => new Promise((e) => {
628
+ if (typeof requestAnimationFrame == "function") {
629
+ requestAnimationFrame(() => {
630
+ e();
631
+ });
632
+ return;
633
+ }
634
+ setTimeout(e, 0);
635
+ }), "yieldToMain"), te = /* @__PURE__ */ o((e, t, n) => (e == null ? void 0 : e(t, { defaultValue: n })) ?? n, "translateText"), Wt = /* @__PURE__ */ o((e) => e.ColNames ?? [], "getGridColNames"), z = /* @__PURE__ */ o((e) => e.Cols, "getGridCols"), Kt = /* @__PURE__ */ o((e) => e.Rows, "getGridRows"), Yt = /* @__PURE__ */ o((e) => e.Header ?? null, "getGridHeader"), Vt = /* @__PURE__ */ o((e) => e.Head ?? null, "getGridHead"), zt = /* @__PURE__ */ o((e) => e.ExportName, "getGridExportName"), Xt = /* @__PURE__ */ o((e) => (e == null ? void 0 : e.firstChild) ?? null, "getRowFirstChild"), qt = /* @__PURE__ */ o((e) => (e == null ? void 0 : e.nextSibling) ?? null, "getRowNextSibling"), Fe = /* @__PURE__ */ o((e) => (e ?? "sheet").trim().replace(/[\\/:*?"<>|]/g, "_") || "sheet", "getSafeExportName"), Jt = /* @__PURE__ */ o((e) => Fe(e).slice(0, 31) || "sheet", "getSafeSheetName"), He = /* @__PURE__ */ o((e) => {
636
+ const t = Number(e);
637
+ return !Number.isFinite(t) || t < 1 ? 1 : Math.floor(t);
638
+ }, "toPositiveInt"), Ce = /* @__PURE__ */ o((e) => e !== 0 && e !== !1 && e !== "0", "isVisible"), Zt = /* @__PURE__ */ o((e) => e === 1 || e === !0 || e === "1", "isDeleted"), Qt = /* @__PURE__ */ o((e) => (e == null ? void 0 : e.Type) === "Button" || `${(e == null ? void 0 : e.Button) ?? ""}` == "Button", "isButtonColumn"), kt = /* @__PURE__ */ o((e) => {
639
+ const t = Wt(e).flat(), n = t.length > 0 ? t : typeof e.GetCols == "function" ? e.GetCols() : [], r = [], s = /* @__PURE__ */ new Set();
640
+ for (const c of n)
641
+ !c || s.has(c) || (s.add(c), r.push(c));
642
+ return r;
643
+ }, "getColumnNames"), vt = /* @__PURE__ */ o((e) => {
644
+ const t = z(e);
645
+ return kt(e).filter((n) => {
646
+ const r = t[n];
647
+ return !r || n === "Panel" || Qt(r) ? !1 : r.CanExport !== 0;
648
+ });
649
+ }, "getAllExportColumns"), en = /* @__PURE__ */ o((e, t) => {
650
+ const n = z(e);
651
+ return t.filter((r) => {
652
+ const s = n[r];
653
+ return s ? Ce(s.Visible) : !1;
654
+ });
655
+ }, "getVisibleExportColumns"), tn = /* @__PURE__ */ o((e) => {
656
+ const t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ o((c) => {
657
+ !c || n.has(c) || c.Kind && c.Kind !== "Header" || (n.add(c), t.push(c));
658
+ }, "appendHeaderRow");
659
+ r(Yt(e));
660
+ let s = Xt(Vt(e));
661
+ for (; s; )
662
+ r(s), s = qt(s);
663
+ return t;
664
+ }, "getHeaderRows"), ne = /* @__PURE__ */ o((e) => !!e && e.Kind === "Data" && Ce(e.Visible) && !Zt(e.Deleted) && e.Fixed !== "Foot", "isExportDataRow");
665
+ function* Ue(e) {
666
+ if (typeof e.GetFirst == "function" && typeof e.GetNext == "function") {
667
+ let n = e.GetFirst();
668
+ for (; n; )
669
+ ne(n) && (yield n), n = e.GetNext(n);
670
+ return;
671
+ }
672
+ const t = Kt(e);
673
+ for (const n in t) {
674
+ const r = t[n];
675
+ ne(r) && (yield r);
676
+ }
677
+ }
678
+ o(Ue, "iterateExportDataRows");
679
+ const nn = /* @__PURE__ */ o((e) => {
680
+ let t = 0;
681
+ for (const n of Ue(e))
682
+ n && (t += 1);
683
+ return t;
684
+ }, "getExportDataRowCount"), rn = /* @__PURE__ */ o((e, t) => {
685
+ const n = new Map(e.map((a, u) => [a, u])), r = new Map(
686
+ t.map((a, u) => [a, u])
687
+ ), s = new Array(e.length + 1).fill(0), c = new Array(e.length).fill(-1), i = new Array(e.length).fill(-1);
688
+ let f = -1;
689
+ for (let a = 0; a < e.length; a += 1) {
690
+ const u = e[a];
691
+ if (!u)
692
+ continue;
693
+ const l = r.get(u) ?? -1;
694
+ c[a] = l, s[a + 1] = s[a] + (l >= 0 ? 1 : 0);
695
+ }
696
+ for (let a = e.length - 1; a >= 0; a -= 1)
697
+ c[a] >= 0 && (f = a), i[a] = f;
698
+ return (a, u) => {
699
+ const l = n.get(a);
700
+ if (l === void 0)
701
+ return {
702
+ allColSpan: 1,
703
+ visibleColIndex: null,
704
+ visibleColSpan: 0
705
+ };
706
+ const d = He(u), y = Math.min(e.length - 1, l + d - 1), p = i[l], w = p >= 0 && p <= y ? c[p] : null, h = s[y + 1] - s[l];
707
+ return {
708
+ allColSpan: d,
709
+ visibleColIndex: w !== null && w >= 0 ? w : null,
710
+ visibleColSpan: h
711
+ };
712
+ };
713
+ }, "createSpanResolver"), sn = /* @__PURE__ */ o((e) => {
714
+ const t = `${(e == null ? void 0 : e.Align) ?? ""}`.toLowerCase();
715
+ return t === "left" || t === "center" || t === "right" ? t : (e == null ? void 0 : e.Type) === "Int" || (e == null ? void 0 : e.Type) === "Float" ? "right" : (e == null ? void 0 : e.Type) === "Date" || (e == null ? void 0 : e.Type) === "Enum" ? "center" : "left";
716
+ }, "getCellHorizontalAlignment"), on = /* @__PURE__ */ o((e) => {
717
+ if ((e == null ? void 0 : e.Type) !== "Date")
718
+ return null;
719
+ const t = `${e.Format ?? ""}`.trim();
720
+ if (!t)
721
+ return null;
722
+ const n = ee.get(t);
723
+ if (n !== void 0)
724
+ return n;
725
+ const r = "__TREEGRID_MINUTE_TWO__", s = "__TREEGRID_MINUTE_ONE__", c = t.replace(/yyyy/g, "YYYY").replace(/yy/g, "YY").replace(/tt/g, "A").replace(/hh/g, "HH").replace(/\bh\b/g, "H").replace(/(H{1,2}:)mm/g, `$1${r}`).replace(/(H{1,2}:)m/g, `$1${s}`).replace(/mmmm/g, "MMMM").replace(/mmm/g, "MMM").replace(/mm/g, "MM").replace(/\bm\b/g, "M").replace(new RegExp(r, "g"), "mm").replace(new RegExp(s, "g"), "m").replace(/dddd/g, "dddd").replace(/ddd/g, "ddd").replace(/dd/g, "DD").replace(/\bd\b/g, "D");
726
+ return ee.set(t, c), c;
727
+ }, "getDayjsDateFormat"), M = /* @__PURE__ */ o((e, t) => {
728
+ const n = on(t);
729
+ if (!n || !$(e) || e === null || e === void 0 || e === "" || typeof e == "boolean")
730
+ return null;
731
+ const r = fe(e);
732
+ return r.isValid() ? r.format(n) : null;
733
+ }, "formatDateValue"), P = /* @__PURE__ */ o((e, t) => (t == null ? void 0 : t.Type) !== "Bool" ? null : e == null || e === "" ? "" : e === !0 || e === 1 || e === "1" || e === "Y" || e === "y" || e === "true" || e === "TRUE" ? "Y" : e === !1 || e === 0 || e === "0" || e === "N" || e === "n" || e === "false" || e === "FALSE" ? "N" : null, "formatBoolValue"), re = /* @__PURE__ */ o((e, t, n) => {
734
+ const r = t == null ? void 0 : t[n];
735
+ return r != null ? String(r) : typeof e.GetCaption == "function" ? e.GetCaption(n) ?? "" : n;
736
+ }, "getHeaderValue"), b = /* @__PURE__ */ o((e, t) => {
737
+ const n = `${(t == null ? void 0 : t.HtmlPostfix) ?? ""}`;
738
+ return !n || e === null || e === void 0 || e === "" ? e : `${e}${n}`;
739
+ }, "appendHtmlPostfix"), cn = /* @__PURE__ */ o((e, t, n, r) => {
740
+ if ((r == null ? void 0 : r.Type) === "Enum" && typeof e.GetString == "function") {
741
+ const f = e.GetString(t, n);
742
+ if (f != null)
743
+ return b(f, r);
744
+ }
745
+ const s = t[n], c = P(s, r);
746
+ if (c !== null)
747
+ return b(c, r);
748
+ const i = M(s, r);
749
+ if (i !== null)
750
+ return b(i, r);
751
+ if ($(s))
752
+ return b(s, r);
753
+ if (typeof e.GetValue == "function") {
754
+ const f = e.GetValue(t, n), a = P(f, r);
755
+ if (a !== null)
756
+ return b(a, r);
757
+ const u = M(f, r);
758
+ if (u !== null)
759
+ return b(u, r);
760
+ if ($(f))
761
+ return b(f, r);
762
+ }
763
+ if (typeof e.GetString == "function") {
764
+ const f = e.GetString(t, n), a = P(f, r);
765
+ if (a !== null)
766
+ return b(a, r);
767
+ const u = M(f, r);
768
+ if (u !== null)
769
+ return b(u, r);
770
+ if (f != null)
771
+ return b(f, r);
772
+ }
773
+ return "";
774
+ }, "getBodyValue"), $e = /* @__PURE__ */ o(({
775
+ colName: e,
776
+ resolveSpan: t,
777
+ row: n,
778
+ rowIndex: r,
779
+ totalRows: s
780
+ }) => {
781
+ const c = Math.min(
782
+ He(n[`${e}RowSpan`]),
783
+ Math.max(1, s - r)
784
+ ), { allColSpan: i, visibleColIndex: f, visibleColSpan: a } = t(
785
+ e,
786
+ n[`${e}Span`]
787
+ );
788
+ return {
789
+ allColSpan: i,
790
+ rowSpan: c,
791
+ visibleColIndex: f,
792
+ visibleColSpan: a
793
+ };
794
+ }, "getCellSpanInfo"), We = /* @__PURE__ */ o((e, t, n) => {
795
+ var r;
796
+ return (r = e.get(t)) == null ? void 0 : r.has(n);
797
+ }, "isOccupied"), Ke = /* @__PURE__ */ o((e, t, n, r, s) => {
798
+ for (let c = t; c < t + r; c += 1) {
799
+ const i = e.get(c) ?? /* @__PURE__ */ new Set();
800
+ for (let f = n; f < n + s; f += 1)
801
+ i.add(f);
802
+ e.set(c, i);
803
+ }
804
+ }, "markOccupied"), fn = /* @__PURE__ */ o(async ({
805
+ allExportColumns: e,
806
+ getValue: t,
807
+ onVisibleEntry: n,
808
+ resolveSpan: r,
809
+ rows: s
810
+ }) => {
811
+ if (!e.length)
812
+ return [];
813
+ const c = /* @__PURE__ */ new Map(), i = s.map(() => []);
814
+ for (let f = 0; f < s.length; f += 1) {
815
+ const a = s[f], u = i[f];
816
+ if (!(!a || !u)) {
817
+ for (let l = 0; l < e.length; l += 1) {
818
+ const d = e[l];
819
+ if (!d || We(c, f, l))
820
+ continue;
821
+ const { allColSpan: y, rowSpan: p, visibleColIndex: w, visibleColSpan: h } = $e({
822
+ row: a,
823
+ colName: d,
824
+ rowIndex: f,
825
+ totalRows: s.length,
826
+ resolveSpan: r
827
+ });
828
+ if (Ke(c, f, l, p, y), w === null || h < 1)
829
+ continue;
830
+ const g = t(a, d);
831
+ n == null || n(w, g), u.push({
832
+ colIndex: w,
833
+ value: g,
834
+ rowSpan: p,
835
+ colSpan: h
836
+ });
837
+ }
838
+ (f + 1) % I === 0 && await S();
839
+ }
840
+ }
841
+ return i;
842
+ }, "createEntryRows"), an = /* @__PURE__ */ o(async ({
843
+ allExportColumns: e,
844
+ grid: t,
845
+ headerRows: n,
846
+ resolveSpan: r,
847
+ visibleExportColumns: s
848
+ }) => s.length ? n.length ? fn({
849
+ allExportColumns: e,
850
+ getValue: /* @__PURE__ */ o((c, i) => re(t, c, i), "getValue"),
851
+ resolveSpan: r,
852
+ rows: n
853
+ }) : [
854
+ s.map((c, i) => ({
855
+ colName: c,
856
+ colIndex: i,
857
+ value: re(t, null, c),
858
+ rowSpan: 1,
859
+ colSpan: 1
860
+ }))
861
+ ] : [], "createHeaderEntries"), un = /* @__PURE__ */ o(async ({
862
+ worksheet: e,
863
+ allExportColumns: t,
864
+ columns: n,
865
+ grid: r,
866
+ onVisibleEntry: s,
867
+ resolveSpan: c,
868
+ visibleColumnCount: i
869
+ }) => {
870
+ const f = e.rowCount + 1;
871
+ if (!i)
872
+ return { startRowIndex: f, rowCount: 0, mergeRanges: [] };
873
+ const a = nn(r), u = /* @__PURE__ */ new Map(), l = [], d = [];
874
+ let y = 0;
875
+ for (const p of Ue(r)) {
876
+ const w = new Array(i).fill("");
877
+ for (let h = 0; h < t.length; h += 1) {
878
+ const g = t[h];
879
+ if (!g || We(u, y, h))
880
+ continue;
881
+ const { allColSpan: j, rowSpan: E, visibleColIndex: A, visibleColSpan: O } = $e({
882
+ row: p,
883
+ colName: g,
884
+ rowIndex: y,
885
+ totalRows: a,
886
+ resolveSpan: c
887
+ });
888
+ if (Ke(u, y, h, E, j), A === null || O < 1)
889
+ continue;
890
+ const N = cn(r, p, g, n[g]);
891
+ s == null || s(A, N), w[A] = N ?? "", !(E === 1 && O === 1) && d.push({
892
+ startRowIndex: f + y,
893
+ startColIndex: A + 1,
894
+ endRowIndex: f + y + E - 1,
895
+ endColIndex: A + O
896
+ });
897
+ }
898
+ l.push(w), u.delete(y), y += 1, l.length === I ? (e.addRows(l), l.length = 0, await S()) : y % I === 0 && await S();
899
+ }
900
+ return l.length && e.addRows(l), { startRowIndex: f, rowCount: y, mergeRanges: d };
901
+ }, "appendBodyRows"), ln = /* @__PURE__ */ o(async (e, t, n) => {
902
+ const r = e.rowCount + 1, s = [];
903
+ for (let c = 0; c < t.length; c += 1) {
904
+ const i = t[c] ?? [], f = new Array(n).fill("");
905
+ for (let a = 0; a < i.length; a += 1) {
906
+ const u = i[a];
907
+ u && (f[u.colIndex] = u.value ?? "");
908
+ }
909
+ s.push(f), s.length === I ? (e.addRows(s), s.length = 0, await S()) : (c + 1) % I === 0 && await S();
910
+ }
911
+ return s.length && e.addRows(s), r;
912
+ }, "appendEntryRows"), dn = /* @__PURE__ */ o(async (e, t, n) => {
913
+ for (let r = 0; r < t.length; r += 1) {
914
+ const s = t[r] ?? [];
915
+ for (let c = 0; c < s.length; c += 1) {
916
+ const i = s[c];
917
+ i && (i.rowSpan === 1 && i.colSpan === 1 || e.mergeCells(
918
+ n + r,
919
+ i.colIndex + 1,
920
+ n + r + i.rowSpan - 1,
921
+ i.colIndex + i.colSpan
922
+ ));
923
+ }
924
+ (r + 1) % I === 0 && await S();
925
+ }
926
+ }, "mergeEntryRows"), yn = /* @__PURE__ */ o(async (e, t) => {
927
+ for (let n = 0; n < t.length; n += 1) {
928
+ const r = t[n];
929
+ r && (e.mergeCells(
930
+ r.startRowIndex,
931
+ r.startColIndex,
932
+ r.endRowIndex,
933
+ r.endColIndex
934
+ ), (n + 1) % I === 0 && await S());
935
+ }
936
+ }, "mergeWorksheetRanges"), gn = /* @__PURE__ */ o(async (e, t, n, r) => {
937
+ for (let s = 0; s < n; s += 1) {
938
+ const c = e.getRow(t + s);
939
+ c.font = oe;
940
+ for (let i = 1; i <= r; i += 1) {
941
+ const f = c.getCell(i);
942
+ f.fill = ce, f.border = K, f.alignment = {
943
+ ...W,
944
+ horizontal: "center"
945
+ };
946
+ }
947
+ (s + 1) % I === 0 && await S();
948
+ }
949
+ }, "styleHeaderRows"), pn = /* @__PURE__ */ o(async (e, t, n, r) => {
950
+ for (let s = 0; s < n; s += 1) {
951
+ const c = e.getRow(t + s);
952
+ c.font = ie;
953
+ for (let i = 1; i <= r; i += 1)
954
+ c.getCell(i).border = K;
955
+ (s + 1) % I === 0 && await S();
956
+ }
957
+ }, "styleBodyRows"), wn = /* @__PURE__ */ o((e) => {
958
+ const t = Number((e == null ? void 0 : e.Width) ?? (e == null ? void 0 : e.MinWidth));
959
+ return !Number.isFinite(t) || t <= 0 ? null : Math.min(Math.max(Math.round(t / 8), 10), 50);
960
+ }, "getPreferredColumnWidth"), se = /* @__PURE__ */ o((e) => Math.min(Math.max(e + 4, 10), 50), "getAutoColumnWidth"), hn = /* @__PURE__ */ o((e, t, n) => {
961
+ const r = new Array(n.length).fill(10), s = new Array(n.length).fill(!1);
962
+ for (let c = 0; c < n.length; c += 1) {
963
+ const i = n[c];
964
+ if (!i)
965
+ continue;
966
+ const f = t[i], a = wn(f);
967
+ if (a !== null) {
968
+ r[c] = a, s[c] = !0;
969
+ continue;
970
+ }
971
+ const u = (typeof e.GetCaption == "function" ? e.GetCaption(i) : "") || i;
972
+ r[c] = se(`${u}`.length);
973
+ }
974
+ return {
975
+ widths: r,
976
+ updateWidth: /* @__PURE__ */ o((c, i) => {
977
+ if (s[c])
978
+ return;
979
+ const f = r[c];
980
+ if (f === void 0)
981
+ return;
982
+ const a = se(`${i ?? ""}`.length);
983
+ a > f && (r[c] = a);
984
+ }, "updateWidth")
985
+ };
986
+ }, "createColumnWidths"), Ye = /* @__PURE__ */ o(async (e, t) => {
987
+ try {
988
+ const n = typeof t == "string" ? { exportName: t } : t, r = n == null ? void 0 : n.t;
989
+ if (!e)
990
+ throw new Error(
991
+ te(r, "Message.TreeGrid 인스턴스가 없습니다.", $t)
992
+ );
993
+ const s = z(e), c = vt(e), i = en(e, c), { widths: f, updateWidth: a } = hn(e, s, i), u = tn(e), l = rn(c, i), d = await an({
994
+ allExportColumns: c,
995
+ grid: e,
996
+ headerRows: u,
997
+ resolveSpan: l,
998
+ visibleExportColumns: i
999
+ }), y = new Ze.Workbook(), p = (n == null ? void 0 : n.exportName) ?? zt(e) ?? e.id ?? "sheet", w = n != null && n.useAppendCurrentDateTimeToExportName ? `-${fe().format("YYYY-MM-DD-HH-mm-ss")}` : "", h = Fe(`${p}${w}`), g = y.addWorksheet(Jt(h)), j = await ln(
1000
+ g,
1001
+ d,
1002
+ i.length
1003
+ ), {
1004
+ startRowIndex: E,
1005
+ rowCount: A,
1006
+ mergeRanges: O
1007
+ } = await un({
1008
+ worksheet: g,
1009
+ allExportColumns: c,
1010
+ columns: s,
1011
+ grid: e,
1012
+ onVisibleEntry: a,
1013
+ resolveSpan: l,
1014
+ visibleColumnCount: i.length
1015
+ });
1016
+ for (let G = 0; G < i.length; G += 1) {
1017
+ const q = i[G];
1018
+ if (!q)
1019
+ continue;
1020
+ const ze = s[q], J = g.getColumn(G + 1);
1021
+ J.width = f[G], J.alignment = {
1022
+ ...W,
1023
+ horizontal: sn(ze)
1024
+ };
1025
+ }
1026
+ await dn(g, d, j), await yn(g, O), await gn(
1027
+ g,
1028
+ j,
1029
+ d.length,
1030
+ i.length
1031
+ ), await pn(g, E, A, i.length), g.views = [{ state: "frozen", ySplit: d.length }], await S();
1032
+ const N = await y.xlsx.writeBuffer({
1033
+ useSharedStrings: !1,
1034
+ useStyles: !0
1035
+ });
1036
+ Ht(N, h);
1037
+ } catch (n) {
1038
+ const r = typeof t == "string" ? {} : t, s = r == null ? void 0 : r.t;
1039
+ Qe(
1040
+ n instanceof Error ? n.message : te(
1041
+ s,
1042
+ "Message.엑셀 다운로드 중 오류가 발생했습니다.",
1043
+ Ut
1044
+ ),
1045
+ {
1046
+ variant: "error"
1047
+ }
1048
+ );
1049
+ }
1050
+ }, "exportTreeGridExcel"), qn = Ye, mn = ["Added", "Changed"], bn = ["OWP", "IPX"], Sn = /* @__PURE__ */ o((e) => Object.values((e == null ? void 0 : e.Rows) ?? {}).filter((t) => t.Kind === "Data"), "getDataRows"), In = /* @__PURE__ */ o((e, t) => {
1051
+ const n = (t == null ? void 0 : t.insertPosition) ?? "top", r = t == null ? void 0 : t.parent, s = t == null ? void 0 : t.anchorRow;
1052
+ let c = r ?? (s ? s.parentNode : null) ?? e.GetFirst(), i = null;
1053
+ switch (n) {
1054
+ case "top":
1055
+ i = e.GetFirst();
1056
+ break;
1057
+ case "last":
1058
+ c = e.GetNext(e.GetLast(), e.RowCount > 0 ? e.RowCount + 1 : 0), i = c;
1059
+ break;
1060
+ case "above":
1061
+ i = s ?? e.GetFirst();
1062
+ break;
1063
+ case "below":
1064
+ i = (s == null ? void 0 : s.nextSibling) ?? e.GetFirst();
1065
+ break;
1066
+ }
1067
+ return { resolvedParent: c, next: i };
1068
+ }, "resolveRowInsertionTarget"), An = /* @__PURE__ */ o((e, t) => {
1069
+ C(t) && Object.entries(t).forEach(([n, r]) => {
1070
+ e[n] = r;
1071
+ });
1072
+ }, "assignInitialRowValues"), Rn = /* @__PURE__ */ o((e) => bn.some((t) => e.startsWith(t)), "isTreeGridDataKey"), xn = /* @__PURE__ */ o((e) => Object.fromEntries(
1073
+ gt(Object.keys(e), "id").filter((t) => Rn(t) && !V(e[t])).map((t) => [t, e[t]])
1074
+ ), "normalizeAddedRow"), En = /* @__PURE__ */ o((e, t) => e.filter((n) => Y(n, t) === "1" && n.Deleted !== "1").map((n) => t === "Changed" ? bt(n, ["id", "Changed"]) : xn(n)).filter((n) => !V(n)), "getChangedRowsByStatus"), m = /* @__PURE__ */ o((e) => Grids[e], "getTreeGridById"), On = /* @__PURE__ */ o((e) => {
1075
+ const t = m(e);
1076
+ return Sn(t);
1077
+ }, "getTreeGridDataRowsById"), Gn = /* @__PURE__ */ o((e, t) => {
1078
+ const n = m(e);
1079
+ if (!n)
1080
+ return;
1081
+ const r = n.Data.Data;
1082
+ n.Data.Data = {
1083
+ ...r,
1084
+ Data: { Body: [t || []] },
1085
+ Url: ""
1086
+ }, n.ReloadBody();
1087
+ }, "reloadTreeGridBodyById"), Dn = /* @__PURE__ */ o((e, t) => {
1088
+ const n = m(e);
1089
+ if (!n)
1090
+ return;
1091
+ const r = t == null ? void 0 : t.canSelect, s = t == null ? void 0 : t.initialValues, { resolvedParent: c, next: i } = In(n, t), f = n.AddRow(c, i, 1);
1092
+ An(f, s), f.CanEdit = 1, f.CanDelete = 1, f.CanSelect = r ? 1 : 0, n.Focus(f), n.RefreshRow(f);
1093
+ }, "addTreeGridRowById"), Bn = /* @__PURE__ */ o((e) => {
1094
+ const t = m(e), n = _t(t == null ? void 0 : t.GetXmlData("changes,allcols,nogrid,noio"));
1095
+ return dt(n) ? Object.fromEntries(
1096
+ mn.map((r) => [
1097
+ xt(r),
1098
+ En(n, r)
1099
+ ])
1100
+ ) : { added: [], changed: [] };
1101
+ }, "getTreeGridRowChangesById"), _n = /* @__PURE__ */ o((e, t) => {
1102
+ const n = m(e);
1103
+ n && Ye(n, { exportName: t ?? "" });
1104
+ }, "exportTreeGridToExcelById"), jn = /* @__PURE__ */ o((e) => {
1105
+ const t = m(e);
1106
+ return (t == null ? void 0 : t.GetSelRows()) ?? [];
1107
+ }, "getTreeGridSelectedRowsById"), Nn = /* @__PURE__ */ o((e, t) => {
1108
+ const n = m(e);
1109
+ if (!n || !(t != null && t.targetKey))
1110
+ return;
1111
+ const r = t == null ? void 0 : t.targetKey;
1112
+ if (t == null ? void 0 : t.canVisible) {
1113
+ n.ShowCol(r);
1114
+ return;
1115
+ }
1116
+ n.HideCol(r);
1117
+ }, "setTreeGridColumnVisibilityById"), Ln = /* @__PURE__ */ o((e, t) => {
1118
+ const n = m(e), r = t == null ? void 0 : t.row, s = t == null ? void 0 : t.col;
1119
+ !n || !r || !s || (n.SetValue(r, `${s}Class`, qe), n.SetValue(r, `${s}Color`, Je), n.RefreshCell(r, s));
1120
+ }, "highlightTreeGridCellById"), X = /* @__PURE__ */ o((e) => {
1121
+ const t = m(e);
1122
+ t && t.ActionDeselectAll(1, 0);
1123
+ }, "resetTreeGridSelectionById"), Tn = /* @__PURE__ */ o((e) => {
1124
+ e.forEach(X);
1125
+ }, "resetTreeGridSelectionsByIds"), Ve = /* @__PURE__ */ o((e) => {
1126
+ const t = m(e);
1127
+ t && (t.ActionUndoAll(1, 0), X(e));
1128
+ }, "resetTreeGridChangesById"), Mn = /* @__PURE__ */ o((e) => {
1129
+ e.forEach(Ve);
1130
+ }, "resetTreeGridChangesByIds"), Pn = /* @__PURE__ */ o((e, t, n, r, s) => {
1131
+ if (!(n != null && n.length))
1132
+ return;
1133
+ const c = m(e);
1134
+ if (!c)
1135
+ return;
1136
+ const i = n.map((a) => {
1137
+ const u = a;
1138
+ return `${s.map((d) => u[d]).find((d) => d != null && d !== "") ?? ""}`;
1139
+ }).join("|"), f = n.map((a) => `${a[r] ?? ""}`).join("|");
1140
+ c.SetAttribute(null, t, "Type", "Enum", 0, 0), c.SetAttribute(null, t, "Enum", `|${i}`, 0, 0), c.SetAttribute(null, t, "EnumKeys", `|${f}`, 1, 0);
1141
+ }, "setTreeGridColumnEnumOptionsById"), Jn = m, Zn = On, Qn = Gn, kn = Dn, vn = Bn, er = _n, tr = jn, nr = Nn, rr = Ln, sr = X, ir = Tn, or = Ve, cr = Mn, fr = Pn;
1142
+ export {
1143
+ Le as $,
1144
+ er as A,
1145
+ tr as B,
1146
+ nr as C,
1147
+ rr as D,
1148
+ sr as E,
1149
+ ir as F,
1150
+ or as G,
1151
+ cr as H,
1152
+ fr as I,
1153
+ Kn as J,
1154
+ k as K,
1155
+ C as L,
1156
+ Y as M,
1157
+ tt as N,
1158
+ et as O,
1159
+ ct as P,
1160
+ Wn as Q,
1161
+ H as R,
1162
+ D as S,
1163
+ we as T,
1164
+ ge as U,
1165
+ pe as V,
1166
+ ue as W,
1167
+ de as X,
1168
+ ft as Y,
1169
+ le as Z,
1170
+ ae as _,
1171
+ zn as a,
1172
+ F as a0,
1173
+ x as a1,
1174
+ ut as a2,
1175
+ mt as a3,
1176
+ wt as a4,
1177
+ Te as a5,
1178
+ dt as a6,
1179
+ lt as a7,
1180
+ V as a8,
1181
+ Yn as a9,
1182
+ bt as aa,
1183
+ Xn as b,
1184
+ Ye as c,
1185
+ qn as d,
1186
+ Ht as e,
1187
+ m as f,
1188
+ Vn as g,
1189
+ On as h,
1190
+ Dn as i,
1191
+ Bn as j,
1192
+ _n as k,
1193
+ jn as l,
1194
+ Nn as m,
1195
+ Ln as n,
1196
+ X as o,
1197
+ Tn as p,
1198
+ Ve as q,
1199
+ Gn as r,
1200
+ Ct as s,
1201
+ Mn as t,
1202
+ Pn as u,
1203
+ Jn as v,
1204
+ Zn as w,
1205
+ Qn as x,
1206
+ kn as y,
1207
+ vn as z
1208
+ };
1209
+ //# sourceMappingURL=treeGridUtil-CLlPlDq6.js.map