json-renderers 1.14.1 → 1.16.1

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,1510 @@
1
+ const k = {
2
+ version: "v15.0.0",
3
+ description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
4
+ }, B = (t) => {
5
+ var e;
6
+ typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderers ?? (e.jsonRenderers = {
7
+ meta: k,
8
+ renderToDom: t
9
+ }));
10
+ }, U = ({ intype: t, indata: e, intargetHtmlId: n, incoumns: o, inshowLog: r }) => {
11
+ if (typeof t != "string" || t.trim() === "")
12
+ throw console.error("type must be a string"), new Error("type must be a string");
13
+ if (!Array.isArray(e))
14
+ throw console.error("data must be an Array"), new Error("data must be an Array");
15
+ if (typeof n != "string" || !n.trim())
16
+ throw console.error("targetHtmlId must be a non-empty string"), new TypeError("targetHtmlId must be a non-empty string");
17
+ if (!Array.isArray(o))
18
+ throw console.error("columns must be an array"), new TypeError("columns must be an array");
19
+ if (typeof r != "boolean")
20
+ throw console.error("showLog must be a boolean"), new TypeError("showLog must be a boolean");
21
+ if (r !== !0)
22
+ throw console.error("showLog must be true"), new TypeError("showLog must be true");
23
+ return !0;
24
+ }, j = {
25
+ version: "v10.0.0",
26
+ description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
27
+ }, v = (t) => {
28
+ var e;
29
+ typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderersBuild ?? (e.jsonRenderersBuild = {
30
+ meta: j,
31
+ renderToDom: t
32
+ }));
33
+ }, O = "table", I = {
34
+ class: "table table-hover table-striped mb-0"
35
+ }, W = [], F = {
36
+ tagName: O,
37
+ attributes: I,
38
+ children: W
39
+ }, J = "thead", D = [], V = {
40
+ tagName: J,
41
+ children: D
42
+ }, R = "tr", H = [], M = {
43
+ tagName: R,
44
+ children: H
45
+ }, L = "th", K = {
46
+ value: ""
47
+ }, q = "", G = {
48
+ tagName: L,
49
+ attributes: K,
50
+ textContent: q
51
+ }, z = ({ inColumn: t } = {}) => {
52
+ const e = structuredClone(G);
53
+ return e.attributes.value = t, e.textContent = t, e;
54
+ }, P = ({ inColumns: t = [] } = {}) => {
55
+ const e = structuredClone(M), n = t.map((o) => z({ inColumn: o }));
56
+ return e.children = n, e;
57
+ }, _ = ({ inColumns: t = [] } = {}) => {
58
+ const e = structuredClone(V), n = [
59
+ P({ inColumns: t })
60
+ ];
61
+ return e.children = n, e;
62
+ }, X = "tbody", Q = [], Y = {
63
+ tagName: X,
64
+ children: Q
65
+ }, Z = "tr", tt = [], et = {
66
+ tagName: Z,
67
+ children: tt
68
+ }, ot = "td", nt = {
69
+ value: ""
70
+ }, rt = "", st = {
71
+ tagName: ot,
72
+ attributes: nt,
73
+ textContent: rt
74
+ }, lt = ({ inValue: t } = {}) => {
75
+ const e = structuredClone(st);
76
+ return e.attributes.value = t, e.textContent = t, e;
77
+ }, at = ({ inRow: t, inColumns: e = [] } = {}) => {
78
+ const n = structuredClone(et), o = e.map((r) => {
79
+ const s = Array.isArray(t) ? t[r] : t == null ? void 0 : t[r];
80
+ return lt({ inValue: s });
81
+ });
82
+ return n.children = o, n;
83
+ }, ct = ({ inData: t = [], inColumns: e = [] } = {}) => {
84
+ const n = structuredClone(Y), o = t.map((r) => at({
85
+ inRow: r,
86
+ inColumns: e
87
+ }));
88
+ return n.children = o, n;
89
+ }, it = "tfoot", ut = {
90
+ class: "table-light"
91
+ }, dt = [], bt = {
92
+ tagName: it,
93
+ attributes: ut,
94
+ children: dt
95
+ }, mt = "tr", ht = {
96
+ class: "align-middle"
97
+ }, pt = [], ft = {
98
+ tagName: mt,
99
+ attributes: ht,
100
+ children: pt
101
+ }, gt = "td", yt = {
102
+ class: "align-middle py-2"
103
+ }, wt = [], Ct = {
104
+ tagName: gt,
105
+ attributes: yt,
106
+ children: wt
107
+ }, $t = "input", Nt = {
108
+ type: "text",
109
+ name: "",
110
+ placeholder: "",
111
+ class: "form-control form-control-sm"
112
+ }, At = {
113
+ tagName: $t,
114
+ attributes: Nt
115
+ }, Tt = ({ inColumn: t } = {}) => {
116
+ const e = structuredClone(Ct), n = structuredClone(At);
117
+ return n.attributes.name = t, n.attributes.placeholder = t, e.children.push(n), e;
118
+ }, St = ({ inColumns: t = [] } = {}) => {
119
+ const e = structuredClone(ft);
120
+ return e.children = t.map((n) => Tt({ inColumn: n })), e;
121
+ }, xt = ({ inColumns: t = [] } = {}) => St({ inColumns: t }), Et = "tr", kt = {
122
+ class: "align-middle"
123
+ }, Bt = [], Ut = {
124
+ tagName: Et,
125
+ attributes: kt,
126
+ children: Bt
127
+ }, jt = "td", vt = {
128
+ class: "align-middle py-2"
129
+ }, Ot = [], It = {
130
+ tagName: jt,
131
+ attributes: vt,
132
+ children: Ot
133
+ }, Wt = "input", Ft = {
134
+ type: "text",
135
+ name: "",
136
+ placeholder: "",
137
+ class: "form-control form-control-sm"
138
+ }, Jt = {
139
+ tagName: Wt,
140
+ attributes: Ft
141
+ }, Dt = "button", Vt = {
142
+ type: "button",
143
+ class: "btn btn-primary btn-sm ms-2"
144
+ }, Rt = "Save", Ht = {
145
+ tagName: Dt,
146
+ attributes: Vt,
147
+ textContent: Rt
148
+ }, Mt = ({ inColumn: t, inSave: e = !1 } = {}) => {
149
+ const n = structuredClone(It), o = structuredClone(Jt);
150
+ return o.attributes.name = t, o.attributes.placeholder = t, n.children.push(o), e && n.children.push(structuredClone(Ht)), n;
151
+ }, Lt = ({ inColumns: t = [] } = {}) => {
152
+ const e = structuredClone(Ut);
153
+ return e.children = t.map((n, o) => Mt({
154
+ inColumn: n,
155
+ inSave: o === t.length - 1
156
+ })), e;
157
+ }, Kt = ({ inColumns: t = [] } = {}) => Lt({ inColumns: t }), qt = "tr", Gt = {
158
+ class: "fw-semibold align-middle"
159
+ }, zt = [], Pt = {
160
+ tagName: qt,
161
+ attributes: Gt,
162
+ children: zt
163
+ }, _t = "td", Xt = {
164
+ class: "align-middle py-2"
165
+ }, Qt = "", Yt = {
166
+ tagName: _t,
167
+ attributes: Xt,
168
+ textContent: Qt
169
+ }, Zt = (t, e) => Array.isArray(t) ? t[e] : t == null ? void 0 : t[e], te = ({ inColumn: t, inIndex: e, inData: n = [] } = {}) => {
170
+ const o = structuredClone(Yt), r = n.map((s) => Zt(s, t)).filter((s) => s != null && String(s).trim() !== "").map(Number).filter(Number.isFinite);
171
+ return o.textContent = r.length ? String(r.reduce((s, l) => s + l, 0)) : e === 0 ? "Total" : "", o;
172
+ }, ee = ({ inColumns: t = [], inData: e = [] } = {}) => {
173
+ const n = structuredClone(Pt);
174
+ return n.children = t.map(
175
+ (o, r) => te({ inColumn: o, inIndex: r, inData: e })
176
+ ), n;
177
+ }, oe = ({ inColumns: t = [], inData: e = [] } = {}) => ee({ inColumns: t, inData: e }), ne = "tr", re = {
178
+ class: "align-middle"
179
+ }, se = [], le = {
180
+ tagName: ne,
181
+ attributes: re,
182
+ children: se
183
+ }, ae = "td", ce = {
184
+ class: "align-middle py-2"
185
+ }, ie = {
186
+ tagName: ae,
187
+ attributes: ce
188
+ }, ue = () => structuredClone(ie), de = ({ inColumns: t = [] } = {}) => {
189
+ const e = structuredClone(le);
190
+ return e.children = t.map(() => ue()), e;
191
+ }, be = ({ inColumns: t = [] } = {}) => de({ inColumns: t }), g = {
192
+ inputs: xt,
193
+ inputsWithSave: Kt,
194
+ totals: oe,
195
+ empty: be
196
+ }, me = ({ inFooter: t = [], inColumns: e = [], inData: n = [] } = {}) => {
197
+ const o = structuredClone(bt);
198
+ return o.children = t.map((r) => {
199
+ if (!Object.hasOwn(g, r))
200
+ throw new Error(`Unknown footer "${r}".`);
201
+ return g[r]({ inColumns: e, inData: n });
202
+ }), o;
203
+ }, he = ({
204
+ inColumns: t = [],
205
+ inData: e = [],
206
+ inFooter: n = []
207
+ } = {}) => {
208
+ const o = structuredClone(F), r = [
209
+ _({ inColumns: t }),
210
+ ct({ inData: e, inColumns: t })
211
+ ];
212
+ if (!Array.isArray(n))
213
+ throw new TypeError("The footer property must be an array of footer names.");
214
+ return n.length > 0 && r.push(me({
215
+ inFooter: n,
216
+ inColumns: t,
217
+ inData: e
218
+ })), o.children = r, o;
219
+ }, pe = (t) => {
220
+ const [e, n] = t.children;
221
+ e.children[0].children.unshift({
222
+ tagName: "th",
223
+ textContent: "#"
224
+ }), n.children.forEach((o, r) => {
225
+ o.children.unshift({
226
+ tagName: "td",
227
+ textContent: String(r + 1)
228
+ });
229
+ });
230
+ }, fe = (t) => t === !0 ? [{ label: "Apply", type: "button" }] : Array.isArray(t) ? t : [], ge = (t, e) => {
231
+ const n = fe(e);
232
+ if (n.length === 0) return;
233
+ const [o, r] = t.children;
234
+ o.children[0].children.push({
235
+ tagName: "th",
236
+ textContent: "Actions"
237
+ }), r.children.forEach((s) => {
238
+ s.children.push({
239
+ tagName: "td",
240
+ children: n.map((l) => ({
241
+ tagName: "button",
242
+ attributes: { type: l.type || "button" },
243
+ textContent: l.label
244
+ }))
245
+ });
246
+ });
247
+ }, ye = (t, e = {}) => (e.showSerial && pe(t), e.showOptions && ge(t, e.showOptions), t), we = {
248
+ type: "table",
249
+ data: [
250
+ {
251
+ itemName: "0.09/30mm",
252
+ baseUnit: "kgs"
253
+ }
254
+ ],
255
+ columns: [
256
+ "itemName",
257
+ "baseUnit"
258
+ ],
259
+ options: {}
260
+ }, Ce = {
261
+ type: "table",
262
+ data: [
263
+ {
264
+ itemName: "0.09/30mm",
265
+ baseUnit: "kgs"
266
+ }
267
+ ],
268
+ columns: [
269
+ "itemName",
270
+ "baseUnit"
271
+ ],
272
+ options: {
273
+ showSerial: !0
274
+ }
275
+ }, $e = {
276
+ type: "table",
277
+ data: [
278
+ {
279
+ itemName: "0.09/30mm",
280
+ baseUnit: "kgs"
281
+ }
282
+ ],
283
+ columns: [
284
+ "itemName",
285
+ "baseUnit"
286
+ ],
287
+ options: {
288
+ showOptions: !0
289
+ }
290
+ }, Ne = {
291
+ type: "table",
292
+ data: [
293
+ {
294
+ itemName: "0.09/30mm",
295
+ baseUnit: "kgs"
296
+ }
297
+ ],
298
+ columns: [
299
+ "itemName",
300
+ "baseUnit"
301
+ ],
302
+ options: {
303
+ showOptions: [
304
+ {
305
+ label: "Show",
306
+ type: "button"
307
+ },
308
+ {
309
+ label: "Edit",
310
+ type: "button"
311
+ }
312
+ ]
313
+ }
314
+ }, Ae = {
315
+ type: "table",
316
+ data: [
317
+ {
318
+ itemName: "0.09/30mm",
319
+ baseUnit: "kgs"
320
+ }
321
+ ],
322
+ columns: [
323
+ "itemName",
324
+ "baseUnit"
325
+ ],
326
+ options: {
327
+ showSerial: !0,
328
+ showOptions: [
329
+ {
330
+ label: "Show",
331
+ type: "button"
332
+ }
333
+ ]
334
+ }
335
+ }, Te = {
336
+ type: "table",
337
+ data: [
338
+ {
339
+ itemName: "0.09/30mm",
340
+ baseUnit: "kgs"
341
+ }
342
+ ],
343
+ columns: [
344
+ "itemName",
345
+ "baseUnit"
346
+ ],
347
+ footer: [
348
+ "inputs"
349
+ ],
350
+ options: {}
351
+ }, Se = {
352
+ type: "table",
353
+ data: [
354
+ {
355
+ itemName: "0.09/30mm",
356
+ baseUnit: "kgs"
357
+ }
358
+ ],
359
+ columns: [
360
+ "itemName",
361
+ "baseUnit"
362
+ ],
363
+ footer: [
364
+ "inputsWithSave"
365
+ ],
366
+ options: {}
367
+ }, xe = {
368
+ type: "table",
369
+ data: [
370
+ {
371
+ itemName: "0.09/30mm",
372
+ baseUnit: "2"
373
+ },
374
+ {
375
+ itemName: "0.11-25",
376
+ baseUnit: "3"
377
+ }
378
+ ],
379
+ columns: [
380
+ "itemName",
381
+ "baseUnit"
382
+ ],
383
+ footer: [
384
+ "totals"
385
+ ],
386
+ options: {}
387
+ }, Ee = {
388
+ type: "table",
389
+ data: [
390
+ {
391
+ itemName: "0.09/30mm",
392
+ baseUnit: "2"
393
+ }
394
+ ],
395
+ columns: [
396
+ "itemName",
397
+ "baseUnit"
398
+ ],
399
+ footer: [
400
+ "inputs",
401
+ "totals",
402
+ "inputsWithSave",
403
+ "empty"
404
+ ],
405
+ options: {}
406
+ }, ke = {
407
+ type: "tableHead",
408
+ data: [],
409
+ columns: [
410
+ "itemName",
411
+ "baseUnit"
412
+ ],
413
+ options: {}
414
+ }, Be = {
415
+ type: "tableBody",
416
+ data: [
417
+ {
418
+ itemName: "0.09/30mm",
419
+ baseUnit: "kgs"
420
+ }
421
+ ],
422
+ columns: [
423
+ "itemName",
424
+ "baseUnit"
425
+ ],
426
+ options: {}
427
+ }, Ue = {
428
+ table: we,
429
+ tableWithSerial: Ce,
430
+ tableWithDefaultAction: $e,
431
+ tableWithCustomActions: Ne,
432
+ tableWithSerialAndActions: Ae,
433
+ tableWithFooter: Te,
434
+ tableWithFooterSave: Se,
435
+ tableWithTotals: xe,
436
+ tableWithMultipleFooters: Ee,
437
+ tableHead: ke,
438
+ tableBody: Be
439
+ }, y = ({
440
+ type: t = "table",
441
+ inData: e,
442
+ inColumns: n,
443
+ footer: o = [],
444
+ options: r = {}
445
+ } = {}) => {
446
+ if (t === "table") {
447
+ const s = he({
448
+ inColumns: n,
449
+ inData: e,
450
+ inFooter: o
451
+ });
452
+ return ye(s, r);
453
+ }
454
+ throw new Error(`Unknown table renderer type "${t}".`);
455
+ };
456
+ y.requests = Ue;
457
+ const w = ({ inItems: t, inRecipe: e, inExecute: n }) => {
458
+ const o = t, r = e, s = n;
459
+ return o.map((l) => f({
460
+ inSource: l,
461
+ inRecipe: r,
462
+ inExecute: s
463
+ })).flat(1 / 0).filter(Boolean);
464
+ }, je = ({ inSource: t, inRecipe: e, inExecute: n }) => {
465
+ const o = t, r = e, s = n;
466
+ let l = o;
467
+ typeof s == "function" && (l = s({
468
+ inSource: o,
469
+ inRecipe: r
470
+ }));
471
+ for (const [a, i] of Object.entries(l))
472
+ Array.isArray(i) && r && a in r && (l[a] = w({
473
+ inItems: i,
474
+ inRecipe: r[a],
475
+ inExecute: s
476
+ }));
477
+ return l;
478
+ }, f = ({ inSource: t, inRecipe: e, inExecute: n }) => {
479
+ const o = t, r = e, s = n;
480
+ return Array.isArray(o) ? w({
481
+ inItems: o,
482
+ inRecipe: r,
483
+ inExecute: s
484
+ }) : typeof o == "object" && o !== null ? je({
485
+ inSource: o,
486
+ inRecipe: r,
487
+ inExecute: s
488
+ }) : o;
489
+ }, ve = ({ inKey: t, inDirective: e }) => {
490
+ const n = t, o = e;
491
+ return (o == null ? void 0 : o.alterKey) || n;
492
+ }, Oe = ({ inValue: t, inDirective: e, inExecute: n }) => {
493
+ const o = t, r = e, s = n;
494
+ return r && "transform" in r ? f({
495
+ inSource: o,
496
+ inRecipe: r,
497
+ inExecute: s
498
+ }) : o;
499
+ }, Ie = ({ inValue: t, inDirective: e }) => {
500
+ const n = t, o = e;
501
+ return (o == null ? void 0 : o.valueType) === "array" && !Array.isArray(n) ? [n] : n;
502
+ }, We = ({ inValue: t, inDirective: e }) => {
503
+ const n = t, o = e;
504
+ return o != null && o.valueKey && n && typeof n == "object" ? n[o.valueKey] : n;
505
+ }, Fe = ({ inSource: t, inTransform: e, inExecute: n }) => {
506
+ const o = t, r = e, s = n, l = {};
507
+ for (const [a, i] of Object.entries(o)) {
508
+ if (!(a in r))
509
+ continue;
510
+ const u = r[a], c = ve({ inKey: a, inDirective: u });
511
+ let m = i;
512
+ m = Oe({
513
+ inValue: m,
514
+ inDirective: u,
515
+ inExecute: s
516
+ }), m = Ie({ inValue: m, inDirective: u }), m = We({ inValue: m, inDirective: u }), l[c] = m;
517
+ }
518
+ return l;
519
+ };
520
+ function C(t, e) {
521
+ for (const n in t)
522
+ typeof t[n] == "object" && t[n] !== null ? C(t[n], e) : typeof t[n] == "string" && t[n] === "${}" && (t[n] = e);
523
+ return t;
524
+ }
525
+ const Je = ({ inSource: t, inOperation: e, inExecute: n }) => {
526
+ const o = t, r = e;
527
+ for (const [s, l] of Object.entries(r))
528
+ if ("operationType" in l && l.operationType === "loopArray" && s in o) {
529
+ const a = o[s].map((i) => {
530
+ const u = structuredClone(l == null ? void 0 : l.template);
531
+ return C(u, i), u;
532
+ });
533
+ o[s] = a;
534
+ }
535
+ return o;
536
+ }, De = ({ inSource: t, inTemplate: e }) => {
537
+ const n = t;
538
+ let o = [];
539
+ for (const [r, s] of Object.entries(n)) {
540
+ const l = structuredClone(e);
541
+ l.textContent = s, o.push(l);
542
+ }
543
+ return o;
544
+ }, Ve = ({ inSource: t, inBuild: e, inExecute: n }) => {
545
+ const o = structuredClone(t), r = structuredClone(e);
546
+ for (const [s, l] of Object.entries(r)) {
547
+ const a = De({
548
+ inSource: o[s],
549
+ inTemplate: l
550
+ });
551
+ o[s] = a;
552
+ }
553
+ return o;
554
+ }, Re = ({ inSource: t, inTemplate: e }) => t.map((o) => {
555
+ const r = structuredClone(e == null ? void 0 : e.row), s = He({
556
+ inSource: o,
557
+ inTemplate: e == null ? void 0 : e.cell
558
+ });
559
+ return r.children = s, r;
560
+ }), He = ({ inSource: t, inTemplate: e }) => {
561
+ const n = t;
562
+ let o = [];
563
+ for (const [r, s] of Object.entries(n)) {
564
+ const l = structuredClone(e);
565
+ l.textContent = s, o.push(l);
566
+ }
567
+ return o;
568
+ }, Me = ({ inSource: t, inBuild: e, inExecute: n }) => {
569
+ const o = structuredClone(t), r = structuredClone(e);
570
+ for (const [s, l] of Object.entries(r)) {
571
+ const a = Re({
572
+ inSource: o[s],
573
+ inTemplate: l
574
+ });
575
+ o[s] = a;
576
+ }
577
+ return o;
578
+ }, Le = ({ inSource: t, inTemplate: e }) => t.map((r) => {
579
+ const s = structuredClone(e);
580
+ return s.textContent = r == null ? void 0 : r.columnName, s;
581
+ }), Ke = ({ inSource: t, inBuild: e, inExecute: n }) => {
582
+ const o = structuredClone(t), r = structuredClone(e);
583
+ for (const [s, l] of Object.entries(r)) {
584
+ const a = Le({
585
+ inSource: o[s],
586
+ inTemplate: l == null ? void 0 : l.cell
587
+ });
588
+ o[s] = l == null ? void 0 : l.row, o[s].children = a;
589
+ }
590
+ return o;
591
+ }, qe = ({ inSource: t, inTemplate: e }) => t.map((o) => {
592
+ const r = structuredClone(e == null ? void 0 : e.row), s = Ge({
593
+ inSource: o,
594
+ inTemplate: e == null ? void 0 : e.cell
595
+ });
596
+ return r.children = s, r;
597
+ }), Ge = ({ inSource: t, inTemplate: e }) => {
598
+ const n = t;
599
+ let o = [];
600
+ for (const [r, s] of Object.entries(n)) {
601
+ const l = structuredClone(e);
602
+ l.textContent = s, o.push(l);
603
+ }
604
+ return o;
605
+ }, ze = ({ inSource: t, inBuild: e, inExecute: n }) => {
606
+ const o = structuredClone(t), r = structuredClone(e);
607
+ for (const [s, l] of Object.entries(r)) {
608
+ const a = qe({
609
+ inSource: o[s],
610
+ inTemplate: l
611
+ });
612
+ o[s] = l == null ? void 0 : l.body, o[s].children = a;
613
+ }
614
+ return o;
615
+ }, Pe = ({ inSource: t, inTemplate: e }) => t.map((o) => {
616
+ const r = structuredClone(e == null ? void 0 : e.row), s = _e({
617
+ inSource: o,
618
+ inTemplate: e == null ? void 0 : e.cell
619
+ });
620
+ return r.children = s, r;
621
+ }), _e = ({ inSource: t, inTemplate: e }) => {
622
+ const n = t;
623
+ let o = [];
624
+ for (const [r, s] of Object.entries(n)) {
625
+ const l = structuredClone(e);
626
+ l.textContent = s, o.push(l);
627
+ }
628
+ return o;
629
+ }, Xe = ({ inSource: t, inBuild: e, inExecute: n }) => {
630
+ const o = structuredClone(t), r = structuredClone(e);
631
+ for (const [s, l] of Object.entries(r)) {
632
+ const a = Pe({
633
+ inSource: o[s],
634
+ inTemplate: l
635
+ });
636
+ o[s] = l == null ? void 0 : l.body, o[s].children = a;
637
+ }
638
+ return o;
639
+ }, Qe = ({ inSource: t, inTransform: e, inExecute: n }) => {
640
+ const o = e, r = {};
641
+ for (let [s, l] of Object.entries(o))
642
+ console.log("aaaaaaaaa : ", s);
643
+ return r;
644
+ }, b = ({ inSource: t, inRecipe: e }) => {
645
+ let n = t;
646
+ const o = e;
647
+ return o && typeof o == "object" && "transform" in o && (n = Fe({
648
+ inSource: n,
649
+ inTransform: o.transform,
650
+ inExecute: b
651
+ })), o && typeof o == "object" && "operation" in o && (n = Je({
652
+ inSource: n,
653
+ inOperation: o.operation,
654
+ inExecute: b
655
+ })), o && typeof o == "object" && "build" in o && (n = Ve({
656
+ inSource: n,
657
+ inBuild: o == null ? void 0 : o.build,
658
+ inExecute: b
659
+ })), o && typeof o == "object" && "buildCollection" in o && (n = Me({
660
+ inSource: n,
661
+ inBuild: o == null ? void 0 : o.buildCollection,
662
+ inExecute: b
663
+ })), o && typeof o == "object" && "buildArray" in o && (n = Ke({
664
+ inSource: n,
665
+ inBuild: o == null ? void 0 : o.buildArray,
666
+ inExecute: b
667
+ })), o && typeof o == "object" && "buildBody" in o && (n = ze({
668
+ inSource: n,
669
+ inBuild: o == null ? void 0 : o.buildBody,
670
+ inExecute: b
671
+ })), o && typeof o == "object" && "objectToArray" in o && (n = Xe({
672
+ inSource: n,
673
+ inBuild: o == null ? void 0 : o.objectToArray,
674
+ inExecute: b
675
+ })), o && typeof o == "object" && "spec" in o && (n = Qe({
676
+ inSource: n,
677
+ inTransform: o == null ? void 0 : o.spec,
678
+ inExecute: b
679
+ })), n;
680
+ }, $ = (t, e) => f({
681
+ inSource: t,
682
+ inRecipe: e,
683
+ inExecute: b
684
+ }), Ye = {
685
+ children: ""
686
+ }, Ze = {
687
+ children: {
688
+ operationType: "loopArray",
689
+ template: {
690
+ tagName: "option",
691
+ attributes: {
692
+ value: "${}"
693
+ },
694
+ textContent: "${}"
695
+ }
696
+ }
697
+ }, to = {
698
+ transform: Ye,
699
+ operation: Ze
700
+ }, N = ({
701
+ inData: t
702
+ }) => {
703
+ let n = $({
704
+ children: t
705
+ }, to);
706
+ return n == null ? void 0 : n.children;
707
+ }, eo = "select", oo = {
708
+ id: "LedgerName"
709
+ }, no = [], ro = {
710
+ tagName: eo,
711
+ attributes: oo,
712
+ children: no
713
+ }, so = ({
714
+ inData: t
715
+ }) => {
716
+ let n = N({
717
+ inData: t
718
+ });
719
+ const o = structuredClone(ro);
720
+ return o.children = n, o;
721
+ }, lo = "table", ao = {
722
+ class: "table table-hover table-striped align-middle border mb-0"
723
+ }, co = [
724
+ {
725
+ tagName: "thead",
726
+ attributes: {
727
+ class: "table-dark"
728
+ },
729
+ children: [
730
+ {
731
+ tagName: "tr",
732
+ children: []
733
+ }
734
+ ]
735
+ },
736
+ {
737
+ tagName: "tbody",
738
+ children: []
739
+ }
740
+ ], io = {
741
+ tagName: lo,
742
+ attributes: ao,
743
+ children: co
744
+ }, uo = {
745
+ columns: {
746
+ row: {
747
+ tagName: "tr"
748
+ },
749
+ cell: {
750
+ tagName: "th",
751
+ textContent: "${}"
752
+ }
753
+ }
754
+ }, bo = {
755
+ rows: {
756
+ body: {
757
+ tagName: "tbody"
758
+ },
759
+ row: {
760
+ tagName: "tr"
761
+ },
762
+ cell: {
763
+ tagName: "td",
764
+ textContent: "${}"
765
+ }
766
+ }
767
+ }, mo = {
768
+ buildArray: uo,
769
+ buildBody: bo
770
+ }, ho = ({
771
+ inColumns: t = [],
772
+ inData: e = [],
773
+ inFooter: n = []
774
+ } = {}) => {
775
+ const o = structuredClone(io), r = t.map((l) => ({
776
+ columnName: l
777
+ })), s = $({ columns: r, rows: e }, mo);
778
+ return o.children[0].children = [s == null ? void 0 : s.columns], o.children[1] = s == null ? void 0 : s.rows, o;
779
+ }, po = (t) => {
780
+ const [e, n] = t.children;
781
+ console.log("aaaaaaa--", e.children[0]), e.children[0].children.unshift({
782
+ tagName: "th",
783
+ textContent: "#"
784
+ }), n.children.forEach((o, r) => {
785
+ o.children.unshift({
786
+ tagName: "td",
787
+ textContent: String(r + 1)
788
+ });
789
+ });
790
+ }, fo = (t) => t === !0 ? [{ label: "Apply", type: "button" }] : Array.isArray(t) ? t : [], go = (t, e) => {
791
+ const n = fo(e);
792
+ if (n.length === 0) return;
793
+ const [o, r] = t.children;
794
+ o.children[0].children.push({
795
+ tagName: "th",
796
+ textContent: "Actions"
797
+ }), r.children.forEach((s) => {
798
+ s.children.push({
799
+ tagName: "td",
800
+ children: n.map((l) => ({
801
+ tagName: "button",
802
+ attributes: { type: l.type || "button" },
803
+ textContent: l.label
804
+ }))
805
+ });
806
+ });
807
+ }, yo = (t, e = {}) => (e.showSerial && po(t), e.showOptions && go(t, e.showOptions), t), wo = {
808
+ type: "table",
809
+ data: [
810
+ {
811
+ itemName: "0.09/30mm",
812
+ baseUnit: "kgs"
813
+ }
814
+ ],
815
+ columns: [
816
+ "itemName",
817
+ "baseUnit"
818
+ ],
819
+ options: {}
820
+ }, Co = {
821
+ type: "table",
822
+ data: [
823
+ {
824
+ itemName: "0.09/30mm",
825
+ baseUnit: "kgs"
826
+ }
827
+ ],
828
+ columns: [
829
+ "itemName",
830
+ "baseUnit"
831
+ ],
832
+ options: {
833
+ showSerial: !0
834
+ }
835
+ }, $o = {
836
+ type: "table",
837
+ data: [
838
+ {
839
+ itemName: "0.09/30mm",
840
+ baseUnit: "kgs"
841
+ }
842
+ ],
843
+ columns: [
844
+ "itemName",
845
+ "baseUnit"
846
+ ],
847
+ options: {
848
+ showOptions: !0
849
+ }
850
+ }, No = {
851
+ type: "table",
852
+ data: [
853
+ {
854
+ itemName: "0.09/30mm",
855
+ baseUnit: "kgs"
856
+ }
857
+ ],
858
+ columns: [
859
+ "itemName",
860
+ "baseUnit"
861
+ ],
862
+ options: {
863
+ showOptions: [
864
+ {
865
+ label: "Show",
866
+ type: "button"
867
+ },
868
+ {
869
+ label: "Edit",
870
+ type: "button"
871
+ }
872
+ ]
873
+ }
874
+ }, Ao = {
875
+ type: "table",
876
+ data: [
877
+ {
878
+ itemName: "0.09/30mm",
879
+ baseUnit: "kgs"
880
+ }
881
+ ],
882
+ columns: [
883
+ "itemName",
884
+ "baseUnit"
885
+ ],
886
+ options: {
887
+ showSerial: !0,
888
+ showOptions: [
889
+ {
890
+ label: "Show",
891
+ type: "button"
892
+ }
893
+ ]
894
+ }
895
+ }, To = {
896
+ type: "table",
897
+ data: [
898
+ {
899
+ itemName: "0.09/30mm",
900
+ baseUnit: "kgs"
901
+ }
902
+ ],
903
+ columns: [
904
+ "itemName",
905
+ "baseUnit"
906
+ ],
907
+ footer: [
908
+ "inputs"
909
+ ],
910
+ options: {}
911
+ }, So = {
912
+ type: "table",
913
+ data: [
914
+ {
915
+ itemName: "0.09/30mm",
916
+ baseUnit: "kgs"
917
+ }
918
+ ],
919
+ columns: [
920
+ "itemName",
921
+ "baseUnit"
922
+ ],
923
+ footer: [
924
+ "inputsWithSave"
925
+ ],
926
+ options: {}
927
+ }, xo = {
928
+ type: "table",
929
+ data: [
930
+ {
931
+ itemName: "0.09/30mm",
932
+ baseUnit: "2"
933
+ },
934
+ {
935
+ itemName: "0.11-25",
936
+ baseUnit: "3"
937
+ }
938
+ ],
939
+ columns: [
940
+ "itemName",
941
+ "baseUnit"
942
+ ],
943
+ footer: [
944
+ "totals"
945
+ ],
946
+ options: {}
947
+ }, Eo = {
948
+ type: "table",
949
+ data: [
950
+ {
951
+ itemName: "0.09/30mm",
952
+ baseUnit: "2"
953
+ }
954
+ ],
955
+ columns: [
956
+ "itemName",
957
+ "baseUnit"
958
+ ],
959
+ footer: [
960
+ "inputs",
961
+ "totals",
962
+ "inputsWithSave",
963
+ "empty"
964
+ ],
965
+ options: {}
966
+ }, ko = {
967
+ type: "tableHead",
968
+ data: [],
969
+ columns: [
970
+ "itemName",
971
+ "baseUnit"
972
+ ],
973
+ options: {}
974
+ }, Bo = {
975
+ type: "tableBody",
976
+ data: [
977
+ {
978
+ itemName: "0.09/30mm",
979
+ baseUnit: "kgs"
980
+ }
981
+ ],
982
+ columns: [
983
+ "itemName",
984
+ "baseUnit"
985
+ ],
986
+ options: {}
987
+ }, Uo = {
988
+ table: wo,
989
+ tableWithSerial: Co,
990
+ tableWithDefaultAction: $o,
991
+ tableWithCustomActions: No,
992
+ tableWithSerialAndActions: Ao,
993
+ tableWithFooter: To,
994
+ tableWithFooterSave: So,
995
+ tableWithTotals: xo,
996
+ tableWithMultipleFooters: Eo,
997
+ tableHead: ko,
998
+ tableBody: Bo
999
+ }, A = ({
1000
+ inData: t,
1001
+ inColumns: e,
1002
+ footer: n = [],
1003
+ options: o
1004
+ } = {}) => {
1005
+ const r = ho({
1006
+ inColumns: e,
1007
+ inData: t,
1008
+ inFooter: n
1009
+ });
1010
+ return o ? yo(r, o) : r;
1011
+ };
1012
+ A.requests = Uo;
1013
+ const jo = {
1014
+ table: y,
1015
+ select: so,
1016
+ selectOptionsOnly: N,
1017
+ tableFromSpec: A
1018
+ }, T = ({
1019
+ type: t = "table",
1020
+ data: e,
1021
+ columns: n,
1022
+ options: o
1023
+ }) => {
1024
+ const s = jo[t];
1025
+ return s({
1026
+ inColumns: n,
1027
+ inData: e,
1028
+ options: o
1029
+ });
1030
+ };
1031
+ v(T);
1032
+ const vo = {
1033
+ version: "v9",
1034
+ description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
1035
+ }, Oo = ({ inFuncDefinition: t, inReviewSpec: e } = {}) => {
1036
+ if (typeof globalThis > "u" || !t) return;
1037
+ globalThis.ks ?? (globalThis.ks = {});
1038
+ const n = {
1039
+ meta: vo,
1040
+ buildSpecElement: t,
1041
+ reviewSpec: e
1042
+ };
1043
+ globalThis.ks["json-to-tag"] = n, globalThis.ks.jsonToTag = n;
1044
+ }, Io = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : typeof t == "object" && (t.nodeType === 3 || t.tagName === "#text" || !t.tagName && (t.textContent !== void 0 || t.text !== void 0)) ? document.createTextNode(t.textContent ?? t.text ?? "") : x(t), S = (t) => Array.isArray(t) ? t.map(Io).flat(1 / 0).filter(Boolean) : [], Wo = (t) => (t == null, t), Fo = "http://www.w3.org/2000/svg", Jo = /* @__PURE__ */ new Set([
1045
+ "svg",
1046
+ "path",
1047
+ "symbol",
1048
+ "use",
1049
+ "g",
1050
+ "circle",
1051
+ "ellipse",
1052
+ "rect",
1053
+ "line",
1054
+ "polyline",
1055
+ "polygon",
1056
+ "text",
1057
+ "tspan",
1058
+ "defs",
1059
+ "clippath",
1060
+ "mask",
1061
+ "pattern",
1062
+ "marker",
1063
+ "lineargradient",
1064
+ "radialgradient",
1065
+ "stop",
1066
+ "image",
1067
+ "filter",
1068
+ "fegaussianblur",
1069
+ "femerge",
1070
+ "femergenode"
1071
+ ]), Do = ({ inTagName: t }) => {
1072
+ const e = t == null ? void 0 : t.toLowerCase();
1073
+ if (!e) return null;
1074
+ if (e === "checkbox") {
1075
+ const n = document.createElement("input");
1076
+ return n.type = "checkbox", n;
1077
+ }
1078
+ return Jo.has(e) ? document.createElementNS(Fo, e) : document.createElement(e);
1079
+ }, Vo = ({ inElement: t, inTextContent: e }) => (!t || e === void 0 || e === null || (t.textContent = e), t), Ro = ({ inElement: t, inProperties: e }) => (t && e && typeof e == "object" && Object.assign(t, e), t), Ho = "http://www.w3.org/1999/xlink", Mo = ({ inElement: t, inAttributes: e }) => {
1080
+ const n = t, o = e;
1081
+ if (!n || !o || typeof o != "object")
1082
+ return n;
1083
+ const r = typeof SVGElement < "u" ? n instanceof SVGElement : n.namespaceURI === "http://www.w3.org/2000/svg";
1084
+ return Object.entries(o).forEach(([s, l]) => {
1085
+ if (s === "class") {
1086
+ r ? n.setAttribute("class", String(l)) : n.className = l;
1087
+ return;
1088
+ }
1089
+ if (s === "xlink:href" || s === "href") {
1090
+ if (l != null) {
1091
+ const a = String(l);
1092
+ if (r)
1093
+ try {
1094
+ n.setAttributeNS(Ho, "href", a);
1095
+ } catch {
1096
+ }
1097
+ n.setAttribute("href", a), n.setAttribute("xlink:href", a);
1098
+ }
1099
+ return;
1100
+ }
1101
+ if (typeof l == "boolean") {
1102
+ l ? n.setAttribute(s, "") : n.removeAttribute(s);
1103
+ return;
1104
+ }
1105
+ l != null && n.setAttribute(s, String(l));
1106
+ }), n;
1107
+ }, Lo = ({ inElement: t, inClassList: e }) => {
1108
+ if (!t || !e) return t;
1109
+ const n = typeof e == "string" ? e.split(/\s+/).filter(Boolean) : Array.isArray(e) ? e.filter((o) => typeof o == "string" && o.trim()) : [];
1110
+ return n.length && t.classList.add(...n), t;
1111
+ }, Ko = (t) => {
1112
+ if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
1113
+ const e = Do({ inTagName: t.tagName });
1114
+ if (!e) return null;
1115
+ if (Vo({
1116
+ inElement: e,
1117
+ inTextContent: Wo(t.textContent),
1118
+ inTagName: t.tagName
1119
+ }), Ro({
1120
+ inElement: e,
1121
+ inProperties: t.properties
1122
+ }), Mo({
1123
+ inElement: e,
1124
+ inAttributes: t.attributes
1125
+ }), Lo({
1126
+ inElement: e,
1127
+ inClassList: t.classList
1128
+ }), Array.isArray(t.children)) {
1129
+ const n = S(t.children);
1130
+ n.length && e.append(...n);
1131
+ }
1132
+ return e;
1133
+ }, x = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? S(t) : typeof t == "object" ? Ko(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, qo = "./tags.schema.json", Go = {
1134
+ allowsTextContent: !1,
1135
+ allowsChildren: !0,
1136
+ allowedAttributes: [
1137
+ "title",
1138
+ "role"
1139
+ ],
1140
+ childTags: []
1141
+ }, zo = {
1142
+ allowsTextContent: !1,
1143
+ allowsChildren: !1,
1144
+ allowedAttributes: [
1145
+ "type",
1146
+ "placeholder",
1147
+ "value",
1148
+ "name",
1149
+ "disabled",
1150
+ "readonly",
1151
+ "required",
1152
+ "list"
1153
+ ]
1154
+ }, Po = {
1155
+ allowsTextContent: !1,
1156
+ allowsChildren: !1,
1157
+ allowedAttributes: [
1158
+ "type",
1159
+ "checked",
1160
+ "name",
1161
+ "value",
1162
+ "disabled",
1163
+ "required"
1164
+ ]
1165
+ }, _o = {
1166
+ allowsTextContent: !1,
1167
+ allowsChildren: !0,
1168
+ allowedAttributes: [
1169
+ "span"
1170
+ ],
1171
+ childTags: [
1172
+ "col"
1173
+ ]
1174
+ }, Xo = {
1175
+ allowsTextContent: !1,
1176
+ allowsChildren: !1,
1177
+ allowedAttributes: [
1178
+ "span",
1179
+ "style",
1180
+ "width"
1181
+ ]
1182
+ }, Qo = {
1183
+ allowsTextContent: !0,
1184
+ allowsChildren: !0,
1185
+ allowedAttributes: [
1186
+ "for"
1187
+ ],
1188
+ childTags: []
1189
+ }, Yo = {
1190
+ allowsTextContent: !1,
1191
+ allowsChildren: !0,
1192
+ allowedAttributes: [
1193
+ "action",
1194
+ "method",
1195
+ "autocomplete",
1196
+ "enctype",
1197
+ "name",
1198
+ "novalidate",
1199
+ "target"
1200
+ ],
1201
+ childTags: []
1202
+ }, Zo = {
1203
+ allowsTextContent: !1,
1204
+ allowsChildren: !0,
1205
+ allowedAttributes: [
1206
+ "name",
1207
+ "disabled",
1208
+ "required",
1209
+ "multiple",
1210
+ "size"
1211
+ ],
1212
+ childTags: [
1213
+ "option"
1214
+ ]
1215
+ }, tn = {
1216
+ allowsTextContent: !0,
1217
+ allowsChildren: !0,
1218
+ allowedAttributes: [],
1219
+ childTags: []
1220
+ }, en = {
1221
+ allowsTextContent: !0,
1222
+ allowsChildren: !0,
1223
+ allowedAttributes: [],
1224
+ childTags: []
1225
+ }, on = {
1226
+ allowsTextContent: !0,
1227
+ allowsChildren: !0,
1228
+ allowedAttributes: [],
1229
+ childTags: []
1230
+ }, nn = {
1231
+ allowsTextContent: !0,
1232
+ allowsChildren: !0,
1233
+ allowedAttributes: [],
1234
+ childTags: []
1235
+ }, rn = {
1236
+ allowsTextContent: !1,
1237
+ allowsChildren: !1,
1238
+ allowedAttributes: [
1239
+ "src",
1240
+ "alt",
1241
+ "width",
1242
+ "height",
1243
+ "loading"
1244
+ ]
1245
+ }, sn = {
1246
+ allowsTextContent: !0,
1247
+ allowsChildren: !0,
1248
+ allowedAttributes: [
1249
+ "type",
1250
+ "disabled",
1251
+ "name",
1252
+ "value"
1253
+ ],
1254
+ childTags: []
1255
+ }, ln = {
1256
+ allowsTextContent: !1,
1257
+ allowsChildren: !0,
1258
+ allowedAttributes: [
1259
+ "border",
1260
+ "cellpadding",
1261
+ "cellspacing"
1262
+ ],
1263
+ childTags: [
1264
+ "caption",
1265
+ "colgroup",
1266
+ "thead",
1267
+ "tbody",
1268
+ "tfoot",
1269
+ "tr"
1270
+ ]
1271
+ }, an = {
1272
+ allowsTextContent: !1,
1273
+ allowsChildren: !0,
1274
+ allowedAttributes: [],
1275
+ childTags: [
1276
+ "tr"
1277
+ ]
1278
+ }, cn = {
1279
+ allowsTextContent: !1,
1280
+ allowsChildren: !0,
1281
+ allowedAttributes: [],
1282
+ childTags: [
1283
+ "tr"
1284
+ ]
1285
+ }, un = {
1286
+ allowsTextContent: !1,
1287
+ allowsChildren: !0,
1288
+ allowedAttributes: [],
1289
+ childTags: [
1290
+ "tr"
1291
+ ]
1292
+ }, dn = {
1293
+ allowsTextContent: !1,
1294
+ allowsChildren: !0,
1295
+ allowedAttributes: [],
1296
+ childTags: [
1297
+ "td",
1298
+ "th"
1299
+ ]
1300
+ }, bn = {
1301
+ allowsTextContent: !0,
1302
+ allowsChildren: !0,
1303
+ allowedAttributes: [
1304
+ "scope",
1305
+ "colspan",
1306
+ "rowspan"
1307
+ ],
1308
+ childTags: []
1309
+ }, mn = {
1310
+ allowsTextContent: !0,
1311
+ allowsChildren: !0,
1312
+ allowedAttributes: [
1313
+ "colspan",
1314
+ "rowspan"
1315
+ ],
1316
+ childTags: []
1317
+ }, hn = {
1318
+ allowsTextContent: !1,
1319
+ allowsChildren: !0,
1320
+ allowedAttributes: [],
1321
+ childTags: [
1322
+ "option"
1323
+ ]
1324
+ }, pn = {
1325
+ allowsTextContent: !0,
1326
+ allowsChildren: !1,
1327
+ allowedAttributes: [
1328
+ "value",
1329
+ "label",
1330
+ "selected",
1331
+ "disabled"
1332
+ ]
1333
+ }, fn = {
1334
+ allowsTextContent: !1,
1335
+ allowsChildren: !0,
1336
+ allowedAttributes: [
1337
+ "role"
1338
+ ],
1339
+ childTags: []
1340
+ }, gn = {
1341
+ allowsTextContent: !0,
1342
+ allowsChildren: !0,
1343
+ allowedAttributes: [
1344
+ "href",
1345
+ "target",
1346
+ "rel",
1347
+ "title",
1348
+ "download"
1349
+ ],
1350
+ childTags: []
1351
+ }, yn = {
1352
+ allowsTextContent: !0,
1353
+ allowsChildren: !0,
1354
+ allowedAttributes: [
1355
+ "aria-hidden"
1356
+ ],
1357
+ childTags: []
1358
+ }, wn = {
1359
+ allowsTextContent: !0,
1360
+ allowsChildren: !0,
1361
+ allowedAttributes: [],
1362
+ childTags: []
1363
+ }, Cn = {
1364
+ allowsTextContent: !1,
1365
+ allowsChildren: !0,
1366
+ allowedAttributes: [
1367
+ "type"
1368
+ ],
1369
+ childTags: [
1370
+ "li"
1371
+ ]
1372
+ }, $n = {
1373
+ allowsTextContent: !0,
1374
+ allowsChildren: !0,
1375
+ allowedAttributes: [
1376
+ "value"
1377
+ ],
1378
+ childTags: []
1379
+ }, Nn = {
1380
+ allowsTextContent: !1,
1381
+ allowsChildren: !1,
1382
+ allowedAttributes: []
1383
+ }, An = {
1384
+ $schema: qo,
1385
+ div: Go,
1386
+ input: zo,
1387
+ checkbox: Po,
1388
+ colgroup: _o,
1389
+ col: Xo,
1390
+ label: Qo,
1391
+ form: Yo,
1392
+ select: Zo,
1393
+ p: tn,
1394
+ h1: en,
1395
+ h2: on,
1396
+ span: nn,
1397
+ img: rn,
1398
+ button: sn,
1399
+ table: ln,
1400
+ thead: an,
1401
+ tbody: cn,
1402
+ tfoot: un,
1403
+ tr: dn,
1404
+ th: bn,
1405
+ td: mn,
1406
+ datalist: hn,
1407
+ option: pn,
1408
+ header: fn,
1409
+ a: gn,
1410
+ i: yn,
1411
+ small: wn,
1412
+ ul: Cn,
1413
+ li: $n,
1414
+ hr: Nn
1415
+ }, p = ({ inSpec: t }) => {
1416
+ const e = t;
1417
+ if (!e) return [];
1418
+ if (Array.isArray(e))
1419
+ return e.flatMap((o) => p({ inSpec: o }));
1420
+ if (typeof e != "object") return [];
1421
+ const n = [];
1422
+ return typeof e.tagName == "string" && e.tagName.trim().length > 0 && n.push(e.tagName.toLowerCase()), Array.isArray(e.children) && e.children.length > 0 && e.children.forEach((o) => {
1423
+ const r = p({ inSpec: o });
1424
+ n.push(...r);
1425
+ }), n;
1426
+ }, Tn = ({ inTagsFound: t, inAllowedTags: e }) => {
1427
+ const n = t ?? [], o = e ?? {}, r = new Set(
1428
+ Object.keys(o).filter((c) => c !== "$schema").map((c) => c.toLowerCase())
1429
+ ), s = {}, l = [], a = [];
1430
+ n.forEach((c) => {
1431
+ s[c] = (s[c] || 0) + 1, r.has(c) ? l.includes(c) || l.push(c) : a.includes(c) || a.push(c);
1432
+ });
1433
+ const i = n.length, u = a.length === 0;
1434
+ return {
1435
+ totalTags: i,
1436
+ tagCounts: s,
1437
+ uniqueTags: Object.keys(s),
1438
+ recognizedTags: l,
1439
+ unrecognizedTags: a,
1440
+ areAllTagsPresent: u
1441
+ };
1442
+ }, Sn = ({ inSpec: t, inTags: e = An } = {}) => {
1443
+ const n = t, o = e, r = p({ inSpec: n }), s = Tn({
1444
+ inTagsFound: r,
1445
+ inAllowedTags: o
1446
+ });
1447
+ return {
1448
+ areAllTagsPresent: s.areAllTagsPresent,
1449
+ totalTags: s.totalTags,
1450
+ tagCounts: s.tagCounts,
1451
+ uniqueTags: s.uniqueTags,
1452
+ recognizedTags: s.recognizedTags,
1453
+ unrecognizedTags: s.unrecognizedTags
1454
+ };
1455
+ }, E = (t = {}) => {
1456
+ const e = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
1457
+ return x(e);
1458
+ };
1459
+ Oo({
1460
+ inFuncDefinition: E,
1461
+ inReviewSpec: Sn
1462
+ });
1463
+ const xn = ({
1464
+ inTargetHtmlId: t,
1465
+ inColumns: e,
1466
+ type: n,
1467
+ inData: o,
1468
+ showLog: r
1469
+ } = {}) => {
1470
+ const s = t, l = o ?? [], a = e;
1471
+ r && console.log("buildSpec 1 :", s, l.localColumns);
1472
+ let u = T({
1473
+ type: n,
1474
+ data: l,
1475
+ columns: a
1476
+ });
1477
+ const c = E(u);
1478
+ return console.log("buildSpec 2 :", u, c), r && console.log("buildSpec 3 :", c), c;
1479
+ }, En = ({
1480
+ type: t = "table",
1481
+ targetHtmlId: e,
1482
+ data: n,
1483
+ classToApply: o,
1484
+ columns: r,
1485
+ appendPosition: s,
1486
+ showLog: l = !1
1487
+ } = {}) => {
1488
+ const a = t, i = e, u = n, c = r;
1489
+ U({
1490
+ intype: a,
1491
+ indata: u,
1492
+ intargetHtmlId: i,
1493
+ incoumns: c,
1494
+ inshowLog: l
1495
+ });
1496
+ const h = xn({
1497
+ inTargetHtmlId: i,
1498
+ inColumns: c,
1499
+ showLog: l,
1500
+ inData: u,
1501
+ type: a
1502
+ });
1503
+ l && console.log("showLog 2 :", h);
1504
+ const d = document.getElementById(i);
1505
+ return l && console.log("showLog 3 :", d), Array.isArray(h) || h instanceof NodeList || h instanceof HTMLCollection ? s === "prepend" ? d.prepend(...h) : d.append(...h) : s === "prepend" ? d.prepend(h) : (d && (d.innerHTML = ""), d.append(h)), l && console.log("showLog 5 :", d), d;
1506
+ };
1507
+ B(En);
1508
+ export {
1509
+ En as default
1510
+ };