@agile-team/mach-report 2.21.1 → 2.23.0

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.
Files changed (169) hide show
  1. package/README.md +20 -5
  2. package/dist/{ExcelBindingWizard-mnAO2qOX.js → ExcelBindingWizard-D4FLind-.js} +3 -3
  3. package/dist/{ExcelBindingWizard-Bu0LUlzl.cjs → ExcelBindingWizard-D4RS5Bpg.cjs} +1 -1
  4. package/dist/{ParamEditor-38ZfNrPU.cjs → ParamEditor-C-6C9rd2.cjs} +1 -1
  5. package/dist/{ParamEditor-C8l0EC8m.js → ParamEditor-CASZt-Ma.js} +2 -2
  6. package/dist/{ReportBatchPanel-CfUVhvkO.js → ReportBatchPanel-Bq7t8a5r.js} +2 -2
  7. package/dist/{ReportBatchPanel-nCC06Nfp.cjs → ReportBatchPanel-YVj5IO5y.cjs} +1 -1
  8. package/dist/ReportLabelStudio-Cqhita1b.cjs +1 -0
  9. package/dist/ReportLabelStudio-Dj7GXhuv.js +783 -0
  10. package/dist/ReportParamPanel-DZbFVmDL.cjs +1 -0
  11. package/dist/{ReportParamPanel-peB-KEmm.js → ReportParamPanel-Dgmqro1Y.js} +265 -244
  12. package/dist/ReportPreview-DeWzG8jQ.js +6257 -0
  13. package/dist/ReportPreview-FFIryrIr.cjs +6 -0
  14. package/dist/{ReportTemplateLibrary-DVlsf72p.cjs → ReportTemplateLibrary-BaWodmpm.cjs} +1 -1
  15. package/dist/{ReportTemplateLibrary-B5t_EcIs.js → ReportTemplateLibrary-DdAAAD2I.js} +1 -1
  16. package/dist/{RuleEditor-kT1JsZ9f.js → RuleEditor-D2UwQGF6.js} +59 -59
  17. package/dist/{RuleEditor-xFkCVlii.cjs → RuleEditor-DcT9xI1v.cjs} +1 -1
  18. package/dist/TemplateOutlinePanel-CUHFFiNM.cjs +1 -0
  19. package/dist/{TemplateOutlinePanel-BesgGR1P.js → TemplateOutlinePanel-DrT7XN0m.js} +2 -2
  20. package/dist/{TemplateReusePanel-BNFU6V-W.js → TemplateReusePanel-4eejkNqi.js} +2 -2
  21. package/dist/{TemplateReusePanel-BG9Or5-P.cjs → TemplateReusePanel-DZMyiX5I.cjs} +1 -1
  22. package/dist/{TemplateReviewPanel-CwvwyCSs.js → TemplateReviewPanel-BIhNLeNw.js} +2 -2
  23. package/dist/TemplateReviewPanel-DnYImiXu.cjs +1 -0
  24. package/dist/analytics.cjs +1 -1
  25. package/dist/analytics.js +26 -26
  26. package/dist/artifact-integrity.json +108 -106
  27. package/dist/assets-D2gHc4Mz.cjs +1 -0
  28. package/dist/assets-T_gDeFaz.js +132 -0
  29. package/dist/auto-4pK9HePf.cjs +1 -0
  30. package/dist/auto-CTIJ6PnR.js +257 -0
  31. package/dist/capabilities-DiBj4Qgl.cjs +1 -0
  32. package/dist/capabilities-pg7j7VLT.js +106 -0
  33. package/dist/charts-Cjw5AYkg.cjs +1 -0
  34. package/dist/{charts-Dlv8j2AG.js → charts-CxJZ0XaY.js} +1 -1
  35. package/dist/computed-DK6BruFz.cjs +1 -0
  36. package/dist/{computed-C8NRZQss.js → computed-f3pOqWLX.js} +381 -301
  37. package/dist/data-bar-CeZuFmYl.cjs +1 -0
  38. package/dist/{data-bar-8baGYEZ9.js → data-bar-IkI6VvMQ.js} +1 -1
  39. package/dist/designer-DhrE7jzw.js +7169 -0
  40. package/dist/designer-IAZu6kBX.cjs +2 -0
  41. package/dist/designer.cjs +1 -1
  42. package/dist/designer.d.cts +246 -46
  43. package/dist/designer.d.ts +246 -46
  44. package/dist/designer.js +15 -14
  45. package/dist/dom-ChE5D-L-.cjs +1 -0
  46. package/dist/dom-JWrchIre.js +452 -0
  47. package/dist/dom-cell-address-DLD1mkTB.cjs +1 -0
  48. package/dist/dom-cell-address-Fn-8nk7D.js +11 -0
  49. package/dist/{encoding-B79hW4zq.cjs → encoding-BefcaHdp.cjs} +1 -1
  50. package/dist/{encoding-BSeUwrN7.js → encoding-CL6rXEkR.js} +2 -2
  51. package/dist/{font-loader-Di0lQKFf.js → font-loader-BT5baV-o.js} +1 -1
  52. package/dist/{font-loader-BB372_XN.cjs → font-loader-Ga51c2VC.cjs} +1 -1
  53. package/dist/grid-strokes-Be24LGuV.cjs +1 -0
  54. package/dist/grid-strokes-EoY66L2f.js +53 -0
  55. package/dist/index.cjs +8 -8
  56. package/dist/index.d.cts +44 -1
  57. package/dist/index.d.ts +44 -1
  58. package/dist/index.js +961 -1256
  59. package/dist/json-snapshot-1tvQNzQE.cjs +2 -0
  60. package/dist/{json-snapshot-Kgn459Oj.js → json-snapshot-OqkPyUk5.js} +763 -776
  61. package/dist/matrix-B8QWbsGM.cjs +1 -0
  62. package/dist/matrix-C6e_r_vp.js +302 -0
  63. package/dist/{pdf-CARdBcuw.cjs → pdf-HiEeXe9H.cjs} +42 -42
  64. package/dist/{pdf-DmlnL5eB.js → pdf-aobetCsy.js} +20 -20
  65. package/dist/pdf.cjs +1 -1
  66. package/dist/pdf.js +2 -2
  67. package/dist/{plugin-BaRUGORD.cjs → plugin-BFANt-i8.cjs} +1 -1
  68. package/dist/{plugin-D4kAxfLG.js → plugin-DeYYAL6F.js} +1 -1
  69. package/dist/{prefill-CJSazcVY.js → prefill-Dk4C6S5R.js} +21 -21
  70. package/dist/prefill-DsUD5OoK.cjs +1 -0
  71. package/dist/prepared-DCIxhKFo.js +94 -0
  72. package/dist/prepared-Dv-XM3i1.cjs +1 -0
  73. package/dist/progress-ByiOxUD3.js +250 -0
  74. package/dist/progress-WomPRP3B.cjs +1 -0
  75. package/dist/{protocol-C8VWF9An.cjs → protocol-B9YgfQ_d.cjs} +1 -1
  76. package/dist/{protocol-Bs9-ohHN.js → protocol-DxeUKGYG.js} +3 -3
  77. package/dist/record-bindings-DatJZv_e.js +200 -0
  78. package/dist/record-bindings-MBxbeBsi.cjs +1 -0
  79. package/dist/{region-binding-workflow-Cy4GIOUo.js → region-binding-workflow-DjrXuR1q.js} +2 -2
  80. package/dist/{region-binding-workflow-JNowHd0A.cjs → region-binding-workflow-l7NGfagJ.cjs} +2 -2
  81. package/dist/report-encoding-worker.cjs +1 -1
  82. package/dist/report-encoding-worker.js +1 -1
  83. package/dist/rich-text-layout-Ciwa6D2o.js +52 -0
  84. package/dist/rich-text-layout-DK7A_a5r.cjs +3 -0
  85. package/dist/{runtime-BDf5x1i1.js → runtime-75Y5Oq5B.js} +52 -51
  86. package/dist/runtime-DKlGd_D4.cjs +1 -0
  87. package/dist/sbom.cdx.json +1 -1
  88. package/dist/server/node.d.cts +9 -0
  89. package/dist/server/node.d.ts +9 -0
  90. package/dist/server-node.cjs +5 -4
  91. package/dist/server-node.js +2178 -2044
  92. package/dist/server.cjs +1 -1
  93. package/dist/server.d.cts +81 -0
  94. package/dist/server.d.ts +81 -0
  95. package/dist/server.js +24 -24
  96. package/dist/style.css +1 -1
  97. package/dist/{template-catalog-DFwIS9aN.js → template-catalog--cjxzgH7.js} +17 -17
  98. package/dist/template-catalog-CoT7jm_6.cjs +1 -0
  99. package/dist/{template-fragments-Dng-AlHk.js → template-fragments-CPpGpQoz.js} +24 -24
  100. package/dist/{template-fragments-DZVUBhuB.cjs → template-fragments-GVjpew_q.cjs} +1 -1
  101. package/dist/template-registry-DI59PXVK.cjs +1 -0
  102. package/dist/{template-registry-DhBqoD7W.js → template-registry-O0hNIOfB.js} +333 -261
  103. package/dist/template-serialization-CWmHq7lX.js +307 -0
  104. package/dist/template-serialization-CqQY4zDg.cjs +1 -0
  105. package/dist/{textwrap-CkGjRFT3.js → textwrap-BIjtEWmq.js} +1 -1
  106. package/dist/textwrap-Cy7o1hIR.cjs +4 -0
  107. package/dist/vue/async.d.cts +121 -2
  108. package/dist/vue/async.d.ts +121 -2
  109. package/dist/vue/index.d.cts +222 -5
  110. package/dist/vue/index.d.ts +222 -5
  111. package/dist/vue-async.cjs +1 -1
  112. package/dist/vue-async.js +3 -3
  113. package/dist/vue.cjs +1 -1
  114. package/dist/vue.js +101 -91
  115. package/dist/{workbook-session-NYv01LHe.cjs → workbook-session-C6-SrnCT.cjs} +4 -4
  116. package/dist/{workbook-session-oinxX3qo.js → workbook-session-C9ZmCBwY.js} +15 -16
  117. package/dist/workbook-sheets-CaPAulQ6.cjs +2 -0
  118. package/dist/workbook-sheets-D4M7XXBh.js +44 -0
  119. package/dist/worker.cjs +1 -1
  120. package/dist/worker.d.cts +9 -0
  121. package/dist/worker.d.ts +9 -0
  122. package/dist/worker.js +4 -4
  123. package/dist/xlsx.cjs +4 -4
  124. package/dist/xlsx.d.cts +39 -2
  125. package/dist/xlsx.d.ts +39 -2
  126. package/dist/xlsx.js +300 -275
  127. package/package.json +1 -1
  128. package/dist/ReportLabelStudio-CaEvYuSK.cjs +0 -1
  129. package/dist/ReportLabelStudio-DQPBmh4v.js +0 -765
  130. package/dist/ReportParamPanel-CVpK8mFc.cjs +0 -1
  131. package/dist/ReportPreview-BBJNlu2U.js +0 -5740
  132. package/dist/ReportPreview-nf4Dk1Jc.cjs +0 -6
  133. package/dist/TemplateOutlinePanel-CDI6mfWx.cjs +0 -1
  134. package/dist/TemplateReviewPanel-BmBrjt6P.cjs +0 -1
  135. package/dist/assets-CxHunY_9.js +0 -232
  136. package/dist/assets-vbjAGgk8.cjs +0 -1
  137. package/dist/auto-BkdGiNtr.js +0 -240
  138. package/dist/auto-Tq7ReIC1.cjs +0 -1
  139. package/dist/charts-aCtoswXq.cjs +0 -1
  140. package/dist/component-tree-1_QCiQJX.js +0 -67
  141. package/dist/component-tree-BjZIp6w9.cjs +0 -1
  142. package/dist/computed-4TnxzgIh.cjs +0 -1
  143. package/dist/data-bar-YltqGTaC.cjs +0 -1
  144. package/dist/designer-DU3yDWgs.cjs +0 -2
  145. package/dist/designer-HQi-03R6.js +0 -6869
  146. package/dist/grid-geometry-D3SJgWFv.js +0 -136
  147. package/dist/grid-geometry-D8ReblRV.cjs +0 -1
  148. package/dist/json-snapshot-I5VI84Vp.cjs +0 -2
  149. package/dist/matrix-0hywp0-F.cjs +0 -1
  150. package/dist/matrix-Dy-tyY7E.js +0 -381
  151. package/dist/prefill-Bpyn58AZ.cjs +0 -1
  152. package/dist/prepared-BiSz_9vN.cjs +0 -1
  153. package/dist/prepared-BwjwEzFz.js +0 -87
  154. package/dist/progress-B0ctFpKf.cjs +0 -1
  155. package/dist/progress-Hc2vxoCs.js +0 -52
  156. package/dist/record-bindings-Ct1HkPrc.cjs +0 -1
  157. package/dist/record-bindings-VZGS-Qd8.js +0 -155
  158. package/dist/rich-text-layout-K48VHUoW.cjs +0 -3
  159. package/dist/rich-text-layout-wxBhnAS7.js +0 -102
  160. package/dist/runtime-DsJt1PIf.cjs +0 -1
  161. package/dist/template-bindings-Cg5oBLFT.cjs +0 -1
  162. package/dist/template-bindings-TKnXM7ll.js +0 -62
  163. package/dist/template-catalog-D_2jdnkL.cjs +0 -1
  164. package/dist/template-outline-DWkzZXVC.cjs +0 -1
  165. package/dist/template-outline-DiADphlq.js +0 -88
  166. package/dist/template-registry-DpLUSLwF.cjs +0 -1
  167. package/dist/template-serialization-Cc3h-miv.js +0 -247
  168. package/dist/template-serialization-D1R5oAqh.cjs +0 -1
  169. package/dist/textwrap-OTOUMr4f.cjs +0 -4
@@ -0,0 +1,783 @@
1
+ import { computed as b, shallowRef as Ce, ref as D, onMounted as vt, onScopeDispose as Ge, watch as ee, defineComponent as pt, markRaw as bt, nextTick as gt, openBlock as S, createElementBlock as k, unref as t, normalizeClass as qe, createElementVNode as r, createVNode as me, toDisplayString as d, createTextVNode as L, Fragment as ve, renderList as Ne, createCommentVNode as E, withDirectives as j, isRef as ie, vModelText as Se, vModelSelect as ht, withKeys as yt, withModifiers as wt, createBlock as Be, withCtx as St, vModelCheckbox as Mt, vShow as He, resolveDynamicComponent as Ct } from "vue";
2
+ import { useMachReport as kt, provideMachReportConfig as _t, ReportPreview as Lt } from "@agile-team/mach-report/vue";
3
+ import { a as pe } from "./_plugin-vue_export-helper-8SL1F89S.js";
4
+ import { defineReportTemplate as Rt, createLabelTemplate as Dt, parseReportTemplate as T, serializeReportTemplate as Me, createReportSource as Ft, defineLabelReport as Et, inspectReportTemplateCompatibility as Nt, imposeLabelSheets as xt } from "@agile-team/mach-report";
5
+ import { v as Ke } from "./progress-ByiOxUD3.js";
6
+ import { L as Tt, c as Vt, d as Ot } from "./designer-DhrE7jzw.js";
7
+ function $t() {
8
+ let e;
9
+ const s = () => e ??= import("@agile-team/mach-report/codes").then((i) => i.createCodeAssetRenderers()).catch((i) => {
10
+ throw e = void 0, i;
11
+ }), o = (i) => async (u) => {
12
+ Ke(u.signal);
13
+ const l = await s();
14
+ return Ke(u.signal), l[i](u);
15
+ };
16
+ return { assetRenderers: { barcode: o("barcode"), qrcode: o("qrcode") } };
17
+ }
18
+ function It(e) {
19
+ const s = e.pages[0];
20
+ if (!s || e.pages.some((u) => u.layout === "wide" || u.widthMm !== s.widthMm || u.heightMm !== s.heightMm)) return;
21
+ const o = Math.floor(190 / (s.widthMm + 4)), i = Math.floor(277 / (s.heightMm + 4));
22
+ if (!(o < 1 || i < 1 || o * i > 1e3))
23
+ return { paper: "a4", columns: o, rows: i, marginMm: 12, gapMm: 4, capacity: o * i };
24
+ }
25
+ const ke = [
26
+ { id: "material", widthMm: 80, heightMm: 55, faces: 1 },
27
+ { id: "paired", widthMm: 80, heightMm: 55, faces: 2 },
28
+ { id: "warehouse", widthMm: 100, heightMm: 60, faces: 1 }
29
+ ];
30
+ function Qe(e, s) {
31
+ return s ?? e.fields.find((o) => o.semanticRole === "identifier" && o.field !== e.rowKey)?.field ?? e.rowKey ?? e.fields[0]?.field;
32
+ }
33
+ function Le(e, s, o) {
34
+ const i = e.fields.filter((a) => a.field !== s && a.field !== e.rowKey);
35
+ if (o === void 0)
36
+ return i.map((a, m) => ({ field: a, index: m, priority: Pt(a) })).sort((a, m) => a.priority - m.priority || a.index - m.index).slice(0, 5).map((a) => a.field);
37
+ const u = new Map(i.map((a) => [a.field, a])), l = [...new Set(o)];
38
+ if (l.length > 5) throw new Error("成品标签最多显示 5 个字段,请先精简显示字段");
39
+ return l.map((a) => {
40
+ const m = u.get(a);
41
+ if (!m) throw new Error(`标签显示字段未在业务契约中声明:${a}`);
42
+ return m;
43
+ });
44
+ }
45
+ function Pt(e) {
46
+ return /^(?:name|title|label|category)$/i.test(e.field) || /名称|品名|品类|类别/.test(e.label ?? "") ? 0 : e.semanticRole === "dimension" ? 1 : e.semanticRole === "measure" && e.unit ? 2 : e.semanticRole === "identifier" ? 3 : e.semanticRole === "date" ? 4 : 5;
47
+ }
48
+ function zt(e = "paired") {
49
+ return ke.find((s) => s.id === e) ?? ke[1];
50
+ }
51
+ const Te = "#173450", Re = "#586c82";
52
+ function q(e, s, o, i, u = 4, l = 7) {
53
+ return {
54
+ kind: "text",
55
+ text: e,
56
+ leftMm: s,
57
+ topMm: o,
58
+ widthMm: i,
59
+ heightMm: u,
60
+ style: { fontSize: l, lineHeight: 1.1, color: Te, verticalAlign: "middle" }
61
+ };
62
+ }
63
+ function Ve(e, s) {
64
+ return {
65
+ kind: "line",
66
+ leftMm: 4,
67
+ topMm: e,
68
+ widthMm: s - 8,
69
+ heightMm: 0.2,
70
+ style: { lineColor: "#c9d7e5", lineWidthPt: 0.55 }
71
+ };
72
+ }
73
+ function Ye(e, s, o) {
74
+ const i = [];
75
+ let u = 4;
76
+ if (o?.logoData) {
77
+ if (!/^data:image\/(?:png|jpeg);base64,/i.test(o.logoData))
78
+ throw new Error("标签Logo须使用PNG或JPEG图片数据");
79
+ i.push({ kind: "image", leftMm: 4, topMm: 3, widthMm: 12, heightMm: 7, imageData: o.logoData, meta: { labelBrandLogo: !0 } }), u = 19;
80
+ }
81
+ return i.push({ ...q(o?.name?.trim() || e, u, 3, s - u - 4, 5, 9), style: { fontSize: 9, color: "#205582" }, meta: { labelStudioRole: "brand-name" } }), o?.tagline?.trim() && i.push({ ...q(o.tagline.trim(), u, 8, s - u - 4, 3, 5.5), style: { fontSize: 5.5, color: Re }, meta: { labelStudioRole: "brand-tagline" } }), i.push(Ve(12, s)), i;
82
+ }
83
+ function Ze(e, s, o, i, u = 4.7) {
84
+ return e.flatMap((l, a) => {
85
+ const m = s + a * u;
86
+ return [
87
+ { ...q(l.label ?? l.field, 4, m, o, 4, 6), style: { fontSize: 6, color: Re }, meta: { labelStudioRole: "field-label", labelStudioField: l.field } },
88
+ { ...q("", 4 + o, m, i, 4, 7), binding: { field: l.field, ...l.format ? { format: l.format } : {} }, meta: { labelStudioRole: "field-value", labelStudioField: l.field } }
89
+ ];
90
+ });
91
+ }
92
+ function Jt(e, s) {
93
+ return e ? [{ ...q("", 4, 14, s, 7, 14), binding: { field: e }, style: { fontSize: 14, color: Te } }] : [];
94
+ }
95
+ function At(e, s, o, i) {
96
+ const u = Le(e, o, i.fields), l = [
97
+ ...Ye(s, 80, i.brand),
98
+ ...Jt(o, 71),
99
+ ...Ze(u, 23, 21, 27)
100
+ ];
101
+ o && l.push({ kind: "qrcode", leftMm: 55, topMm: 23, widthMm: 20, heightMm: 20, binding: { field: o }, code: { quietZoneModules: 4, errorCorrection: "M" } }), l.push(Ve(48, 80));
102
+ const a = e.fields.find((m) => m.field === o)?.label ?? s;
103
+ return l.push({ ...q(a, 4, 49, 71, 3, 5.8), style: { fontSize: 5.8, color: Re } }), l;
104
+ }
105
+ function Ue(e, s, o, i, u = 80) {
106
+ const l = Ye(s, u, i.brand);
107
+ o && (l.push({ ...q("", 4, 14, u - 8, 8, 16), binding: { field: o }, style: { fontSize: 16, align: "center", color: Te } }), l.push({ kind: "qrcode", leftMm: (u - 20) / 2, topMm: 23, widthMm: 20, heightMm: 20, binding: { field: o }, code: { quietZoneModules: 4, errorCorrection: "M" } })), l.push(Ve(44, u));
108
+ const a = Le(e, o, i.fields);
109
+ return u === 100 ? a.forEach((m, y) => {
110
+ const g = y % 2 === 0 ? 4 : 52, v = 46 + Math.floor(y / 2) * 4.3;
111
+ l.push({ ...q(m.label ?? m.field, g, v, 19, 3.7, 5.8), style: { fontSize: 5.8, color: Re }, meta: { labelStudioRole: "field-label", labelStudioField: m.field } }), l.push({ ...q("", g + 19, v, 25, 3.7, 6.5), binding: { field: m.field, ...m.format ? { format: m.format } : {} }, meta: { labelStudioRole: "field-value", labelStudioField: m.field } });
112
+ }) : l.push(...Ze(a.slice(0, 1), 46, 24, u - 32, 5)), l;
113
+ }
114
+ function be(e, s, o, i = {}, u) {
115
+ const l = Qe(e, o), a = zt(i.preset), m = Object.fromEntries(["name", "tagline"].flatMap((h) => {
116
+ const M = i.brand?.[h];
117
+ return typeof M == "string" ? [[h, M]] : [];
118
+ })), y = { preset: a.id, brand: m, fields: Le(e, l, i.fields).map((h) => h.field) }, g = a.id === "warehouse" ? Ue(e, s, l, i, a.widthMm) : At(e, s, l, i), v = [{ widthMm: a.widthMm, heightMm: a.heightMm, meta: { title: `${s} · 1`, labelStudio: y }, components: g }];
119
+ return a.faces === 2 && v.push({ widthMm: a.widthMm, heightMm: a.heightMm, meta: { title: `${s} · 2`, labelStudio: y }, components: Ue(e, s, l, i) }), Rt({ id: "record-label", name: s, template: { ...Dt({ dataset: "records", rowKey: e.rowKey, pages: v }), ...u ? { dataContract: u } : {} } });
120
+ }
121
+ const P = (e) => e.meta?.labelStudioRole, xe = (e) => typeof P(e) == "string";
122
+ function _e(e) {
123
+ const s = { ...e, ...e.meta ? { meta: { ...e.meta } } : {} };
124
+ return s.meta && (delete s.meta.labelStudioRole, delete s.meta.labelStudioField, Object.keys(s.meta).length || delete s.meta), s;
125
+ }
126
+ function qt(e, s) {
127
+ for (const o of s.components.filter(xe)) {
128
+ if (e.components.some((u) => P(u) === P(o) && u.meta?.labelStudioField === o.meta?.labelStudioField)) continue;
129
+ const i = e.components.find((u) => !xe(u) && JSON.stringify(_e(u)) === JSON.stringify(_e(o)));
130
+ i && (i.meta = { ...i.meta, ...o.meta });
131
+ }
132
+ }
133
+ function Bt(e, s) {
134
+ const o = e.kind === "list" ? Number.POSITIVE_INFINITY : e.heightMm, i = s.kind === "list" ? Number.POSITIVE_INFINITY : s.heightMm;
135
+ return e.leftMm < s.leftMm + s.widthMm && e.leftMm + e.widthMm > s.leftMm && e.topMm < s.topMm + i && e.topMm + o > s.topMm;
136
+ }
137
+ function Ht(e, s) {
138
+ const o = { ...e, meta: { ...e.meta, ...s.meta } };
139
+ return o.kind === "text" && s.kind === "text" && (o.text = s.text, s.binding ? o.binding = s.binding : delete o.binding), o;
140
+ }
141
+ function Kt(e, s, o, i) {
142
+ const u = i.has("field-value");
143
+ qt(e, s);
144
+ const l = new Set(e.components.filter((v) => P(v) === "field-label" || P(v) === "field-value")), a = [...l], m = /* @__PURE__ */ new Map(), y = [];
145
+ for (const v of o.components.filter(xe)) {
146
+ const h = P(v);
147
+ if (!i.has(String(h))) continue;
148
+ const M = h === "field-label" || h === "field-value" ? a.find((F) => P(F) === h && !m.has(F)) : e.components.find((F) => P(F) === h);
149
+ M ? m.set(M, Ht(M, v)) : y.push(v);
150
+ }
151
+ const g = e.components.filter((v) => (!u || !l.has(v) || m.has(v)) && (!i.has("brand-tagline") || P(v) !== "brand-tagline" || o.components.some((h) => P(h) === "brand-tagline"))).map((v) => m.get(v) ?? v);
152
+ for (const v of y) {
153
+ if (g.some((h) => Bt(h, v))) return !1;
154
+ g.push(v);
155
+ }
156
+ return e.components = g, e.meta = { ...e.meta, labelStudio: o.meta?.labelStudio }, !0;
157
+ }
158
+ function Ut(e, s, o, i, u, l) {
159
+ const a = be(s, o, i, u), m = be(s, o, i, l), y = T(e), g = /* @__PURE__ */ new Set();
160
+ JSON.stringify(u.fields) !== JSON.stringify(l.fields) && (g.add("field-label"), g.add("field-value")), (u.brand?.name ?? "").trim() !== (l.brand?.name ?? "").trim() && g.add("brand-name"), (u.brand?.tagline ?? "").trim() !== (l.brand?.tagline ?? "").trim() && g.add("brand-tagline");
161
+ for (const [v, h] of y.template.pages.entries()) {
162
+ const M = a.template.pages[v], F = m.template.pages[v];
163
+ if (M && F && !Kt(h, M, F, g)) return;
164
+ }
165
+ return y;
166
+ }
167
+ function jt(e, s) {
168
+ const o = e.template.pages, i = s.template.pages;
169
+ return o.length !== i.length || o.some((u, l) => u.components.length !== i[l].components.length) ? !0 : o.some((u, l) => {
170
+ const a = i[l], m = { ...u, meta: void 0, components: void 0 }, y = { ...a, meta: void 0, components: void 0 };
171
+ return JSON.stringify(m) !== JSON.stringify(y) || u.components.some((g, v) => JSON.stringify(_e(g)) !== JSON.stringify(_e(a.components[v])));
172
+ });
173
+ }
174
+ function Gt(e, s, o, i, u) {
175
+ const l = { ...e, template: be(s, o, i, u, e.template.dataContract).template }, a = e.template.repeat;
176
+ return a?.copies !== void 0 && l.template.repeat && (l.template.repeat.copies = a.copies), l;
177
+ }
178
+ function I(e) {
179
+ const s = e.template.pages[0]?.meta?.labelStudio;
180
+ if (!s || typeof s != "object") return;
181
+ const o = s, i = ke.find((m) => m.id === o.preset);
182
+ if (!i) return;
183
+ const u = Array.isArray(o.fields) ? o.fields.filter((m) => typeof m == "string") : void 0;
184
+ if (u && u.length > 5) return;
185
+ const l = o.brand && typeof o.brand == "object" ? o.brand : {}, a = {};
186
+ for (const m of ["name", "tagline", "logoData"])
187
+ typeof l[m] == "string" && (a[m] = l[m]);
188
+ return { preset: i.id, fields: u, brand: a };
189
+ }
190
+ function je(e, s, o) {
191
+ const i = new Set(e.fields.filter((l) => l.field !== s && l.field !== e.rowKey).map((l) => l.field)), u = o?.filter((l) => i.has(l));
192
+ return Le(e, s, u).map((l) => l.field);
193
+ }
194
+ function Qt(e, s) {
195
+ const o = kt(), i = b(() => ({ ...Tt, ...e.messages })), u = b(() => e.title ?? i.value.title), l = { preset: e.preset, brand: e.brand, fields: e.fields }, a = Ce(e.modelValue ? T(e.modelValue) : be(e.schema, u.value, e.identityField, l, e.dataContract)), m = Ce(T(a.value)), y = D(!1), g = Ce();
196
+ let v, h;
197
+ vt(() => {
198
+ e.modelValue || s(T(a.value));
199
+ });
200
+ const M = D("preview"), F = D("all"), V = D(1), se = D(!1), oe = D(!1), w = D(), G = Vt(() => e.beforeDiscard), B = b(() => oe.value || G.pending.value || y.value && !w.value || w.value?.saving === !0 || w.value?.blocked === !0 || o.state.printing || o.state.exporting !== null), _ = D(""), te = b(() => Qe(e.schema, e.identityField)), z = D(I(a.value)?.preset ?? (e.modelValue ? void 0 : e.preset ?? "paired")), O = D(I(a.value)?.brand?.name ?? e.brand?.name ?? ""), Q = D(I(a.value)?.brand?.tagline ?? e.brand?.tagline ?? ""), R = D(je(e.schema, te.value, I(a.value)?.fields ?? e.fields)), ae = D(""), Y = b(() => e.schema.fields.filter((n) => n.field !== te.value && n.field !== e.schema.rowKey)), re = b(() => R.value.map((n) => ({ field: n, label: e.schema.fields.find((p) => p.field === n)?.label ?? n }))), ge = b(() => {
201
+ const n = ae.value.trim().toLocaleLowerCase();
202
+ return Y.value.filter((p) => `${p.label ?? ""} ${p.field}`.toLocaleLowerCase().includes(n)).slice(0, 30);
203
+ }), Z = b(() => {
204
+ const n = a.value.template.pages[0]?.components.find((p) => p.kind === "image" && p.meta?.labelBrandLogo);
205
+ return n?.kind === "image" ? n.imageData : e.brand?.logoData;
206
+ }), he = b(() => ({
207
+ preset: z.value,
208
+ fields: R.value,
209
+ brand: { ...e.brand, ...Z.value ? { logoData: Z.value } : {}, name: O.value, tagline: Q.value }
210
+ }));
211
+ let W = JSON.stringify(I(a.value));
212
+ const De = b(() => {
213
+ const n = I(a.value);
214
+ if (!n) return !0;
215
+ try {
216
+ const p = be(e.schema, u.value, e.identityField, { ...n, brand: { ...n.brand, ...Z.value ? { logoData: Z.value } : {} } });
217
+ return jt(a.value, p);
218
+ } catch {
219
+ return !0;
220
+ }
221
+ }), $ = D(!1), X = b(() => z.value !== I(a.value)?.preset), le = () => JSON.stringify({ preset: z.value, fields: R.value, name: O.value, tagline: Q.value }), ue = D(le()), J = b(() => le() !== ue.value), de = b(() => Me(a.value)), ye = b(() => Me(m.value)), ne = b(() => de.value !== ye.value), Fe = b(() => J.value || ne.value || w.value?.pendingLocalChanges === !0);
222
+ function ce() {
223
+ $.value = !1;
224
+ const n = I(a.value);
225
+ z.value = n?.preset, R.value = je(e.schema, te.value, n?.fields ?? e.fields), O.value = n?.brand?.name ?? e.brand?.name ?? "", Q.value = n?.brand?.tagline ?? e.brand?.tagline ?? "", W = JSON.stringify(n), ue.value = le();
226
+ }
227
+ function H(n) {
228
+ const p = I(n), C = JSON.stringify(p);
229
+ C !== W && (W = C, ce());
230
+ }
231
+ let N = !1;
232
+ Ge(() => {
233
+ N = !0, h?.abort();
234
+ });
235
+ const fe = $t();
236
+ _t({ get defaults() {
237
+ return { ...e.preview, assets: { ...fe, ...e.preview?.assets, assetRenderers: { ...fe.assetRenderers, ...e.preview?.assets?.assetRenderers } } };
238
+ } }), ee(w, (n) => {
239
+ const p = g.value;
240
+ if (!n || !p) return;
241
+ const C = a.value;
242
+ Me(p) !== de.value && n.applyTemplate?.(C.template), g.value = void 0, v = void 0;
243
+ }, { flush: "post" }), ee([z, R, O, Q], () => {
244
+ $.value = !1;
245
+ }), ee(() => e.modelValue, (n) => {
246
+ n && Me(n) !== de.value && (a.value = T(n), m.value = T(n), v = void 0, H(n));
247
+ }), ee(() => e.rows, () => {
248
+ F.value = "all", V.value = 1;
249
+ });
250
+ function A(n) {
251
+ _.value = "", a.value = n, H(n), s(n);
252
+ }
253
+ function K(n, p) {
254
+ p && R.value.length < 5 && !R.value.includes(n) ? R.value = [...R.value, n] : p || (R.value = R.value.filter((C) => C !== n));
255
+ }
256
+ function f(n = !1) {
257
+ if (B.value || N) return !1;
258
+ if (!z.value)
259
+ return _.value = i.value.choosePreset, !1;
260
+ if (w.value?.canApply === !1)
261
+ return _.value = w.value.saveReason || i.value.applyFirst, !1;
262
+ if (X.value && !n)
263
+ return $.value = !0, !1;
264
+ try {
265
+ const p = I(a.value);
266
+ let C;
267
+ if (n ? C = Gt(a.value, e.schema, u.value, e.identityField, he.value) : p && (C = Ut(a.value, e.schema, u.value, e.identityField, p, he.value)), !C)
268
+ return _.value = i.value.contentNeedsDesign, !1;
269
+ if (w.value?.applyTemplate) {
270
+ if (!w.value.applyTemplate(C.template))
271
+ return _.value = i.value.saveFailed, !1;
272
+ } else
273
+ v = T(a.value), A(C);
274
+ return $.value = !1, ue.value = le(), !0;
275
+ } catch (p) {
276
+ return _.value = p instanceof Error ? p.message : i.value.saveFailed, !1;
277
+ }
278
+ }
279
+ const c = b(() => F.value === "all" ? e.rows : Number.isSafeInteger(V.value) && e.rows[V.value - 1] ? [e.rows[V.value - 1]] : []), U = b(() => a.value.template.repeat?.dataset ?? "records"), We = b(() => ({ [U.value]: c.value })), Xe = b(() => ({ [U.value]: c.value.slice(0, 3) })), et = b(() => ({ [U.value]: e.schema })), tt = b(() => [{ id: U.value, label: u.value, rowKey: e.schema.rowKey, fields: e.schema.fields }]), at = b(() => a.value.template.pages[0]), Oe = b(() => a.value.template.pages.length), lt = b(() => {
280
+ const n = a.value.template.repeat?.copies ?? 1;
281
+ return typeof n == "number" ? n : void 0;
282
+ }), nt = b(() => {
283
+ const n = a.value.template.repeat?.copies;
284
+ return typeof n == "object" ? n.field : void 0;
285
+ }), $e = b(() => {
286
+ const n = nt.value;
287
+ if (!n) return;
288
+ let p = 0;
289
+ for (const C of c.value) {
290
+ const x = Object.getOwnPropertyDescriptor(C, n)?.value;
291
+ if (typeof x != "number" || !Number.isSafeInteger(x) || x < 1 || x > 1e3) return;
292
+ p += x;
293
+ }
294
+ return p;
295
+ }), it = b(() => {
296
+ const n = lt.value;
297
+ return n !== void 0 ? Number.isSafeInteger(n) && n >= 1 && n <= 1e3 ? c.value.length * n * Oe.value : void 0 : $e.value === void 0 ? void 0 : $e.value * Oe.value;
298
+ }), we = b(() => It(a.value.template)), st = b(() => {
299
+ const n = we.value;
300
+ return n ? i.value.sheetHint.replace("{columns}", String(n.columns)).replace("{rows}", String(n.rows)).replace("{capacity}", String(n.capacity)) : i.value.sheetUnavailable;
301
+ });
302
+ ee(we, (n) => {
303
+ n || (se.value = !1);
304
+ });
305
+ const ot = b(() => {
306
+ const n = Ft({ labels: Et({ template: a.value.template, rows: c.value, dataSchema: e.schema }) }), p = se.value ? we.value : void 0, C = e.dataContract ? Nt(a.value.template, e.dataContract) : void 0;
307
+ return async (x) => {
308
+ if (C && !C.ok) throw new Error(C.issues.map((mt) => mt.message).join(";"));
309
+ const Ae = await n(x);
310
+ return p ? xt(Ae, { ...p, signal: x.signal }) : Ae;
311
+ };
312
+ }), Ie = async (n, p) => {
313
+ if (N || p.signal.aborted) throw new DOMException("标签模板保存已取消", "AbortError");
314
+ const C = T(n), x = T(e.save ? await e.save(C, p) : C);
315
+ if (x.id !== n.id) throw new Error(i.value.invalidSavedTemplate);
316
+ if (N || p.signal.aborted) throw new DOMException("标签模板保存已取消", "AbortError");
317
+ return m.value = T(x), A(x), x;
318
+ };
319
+ async function Pe() {
320
+ if (!(B.value || N)) {
321
+ if (J.value && X.value) {
322
+ _.value = i.value.applyLayoutFirst;
323
+ return;
324
+ }
325
+ if (!(J.value && !f())) {
326
+ oe.value = !0;
327
+ try {
328
+ if (w.value) {
329
+ if (w.value.canApply === !1) {
330
+ _.value = w.value.saveReason || i.value.applyFirst;
331
+ return;
332
+ }
333
+ if (w.value.pendingLocalChanges && await w.value.save(), w.value.pendingLocalChanges) {
334
+ _.value = i.value.saveFailed;
335
+ return;
336
+ }
337
+ } else ne.value && (h = new AbortController(), await Ie(a.value, { expectedRevision: a.value.revision, signal: h.signal }), v = void 0);
338
+ if (!N)
339
+ return _.value = "", T(a.value);
340
+ } catch (n) {
341
+ N || (_.value = n instanceof Error ? n.message : i.value.saveFailed);
342
+ } finally {
343
+ oe.value = !1, h = void 0;
344
+ }
345
+ }
346
+ }
347
+ }
348
+ async function ze(n) {
349
+ if (!(B.value || n === M.value))
350
+ if (n === "design" && !y.value) {
351
+ if (J.value && X.value) {
352
+ _.value = i.value.applyLayoutFirst;
353
+ return;
354
+ }
355
+ if (J.value && !f()) return;
356
+ g.value = v, y.value = !0, M.value = n;
357
+ } else await Pe() && (M.value = n);
358
+ }
359
+ function rt(n) {
360
+ y.value = !1, M.value = "preview", _.value = `${i.value.designLoadFailed} ${n instanceof Error ? n.message : String(n)}`;
361
+ }
362
+ let Ee = !1;
363
+ const ut = (n) => Ee || G.request(n);
364
+ async function dt() {
365
+ if (B.value) return !1;
366
+ const n = w.value?.pendingLocalChanges === !0;
367
+ if (!n && !ne.value && !J.value) return !0;
368
+ if (!(n && w.value ? await w.value.guardChanges() : await G.request({ reason: "replace", document: T(a.value), pendingLocalChanges: !0 })) || N) return !1;
369
+ if (n && w.value) {
370
+ Ee = !0;
371
+ try {
372
+ await w.value.reset();
373
+ } finally {
374
+ Ee = !1;
375
+ }
376
+ }
377
+ return A(T(m.value)), v = void 0, ce(), !0;
378
+ }
379
+ const Je = b(() => M.value === "preview" && !B.value && o.state.canPrint);
380
+ async function ct() {
381
+ return await ze("preview"), !N && M.value === "preview";
382
+ }
383
+ async function ft() {
384
+ Je.value && await o.print();
385
+ }
386
+ return { m: i, notice: _, title: u, document: a, mode: M, preview: o, showPreview: ct, print: ft, canPrint: Je, editorVisited: y, editorInitialDocument: g, failDesignLoad: rt, sheetLayout: we, sheetHint: st, rebuilding: $, layoutChanged: X, record: F, recordIndex: V, sheet: se, busy: B, editor: w, rows: c, datasets: We, designDatasets: Xe, schemas: et, bindings: tt, paper: at, labelCount: it, fetcher: ot, update: A, save: Ie, navigate: ze, prepare: Pe, guardChanges: dt, preset: z, presets: ke, brandName: O, brandTagline: Q, fields: R, fieldQuery: ae, selectedFields: re, availableFields: ge, fieldCount: b(() => Y.value.length), configurationDirty: J, pendingLocalChanges: Fe, custom: De, toggleField: K, applyConfiguration: f, requestRebuild: () => {
387
+ $.value = !0;
388
+ }, cancelRebuild: () => {
389
+ $.value = !1;
390
+ }, restoreConfiguration: ce, beforeDiscard: ut, confirmation: G.confirmation, decideDiscard: G.decide };
391
+ }
392
+ const Yt = ["aria-label"], Zt = { class: "mr-label-context" }, Wt = { class: "mr-label-identity" }, Xt = { class: "mr-label-spec" }, ea = ["disabled"], ta = ["aria-label"], aa = ["aria-pressed", "onClick"], la = { class: "mr-label-fields" }, na = {
393
+ key: 0,
394
+ class: "mr-label-selected-fields"
395
+ }, ia = ["aria-label", "onClick"], sa = { class: "mr-label-field-search" }, oa = ["aria-label", "placeholder"], ra = { class: "mr-label-field-options" }, ua = ["checked", "disabled", "onChange"], da = { key: 0 }, ca = { key: 1 }, fa = { class: "mr-label-brand" }, ma = ["placeholder"], va = ["disabled"], pa = {
396
+ key: 1,
397
+ class: "mr-label-rebuild",
398
+ role: "alert"
399
+ }, ba = {
400
+ key: 3,
401
+ class: "mr-label-reflow-hint"
402
+ }, ga = { class: "mr-label-reflow-hint" }, ha = { class: "mr-label-record" }, ya = ["disabled"], wa = { value: "all" }, Sa = { value: "single" }, Ma = {
403
+ key: 0,
404
+ class: "mr-label-record-index"
405
+ }, Ca = ["max", "aria-label", "disabled"], ka = { class: "mr-label-count" }, _a = { class: "mr-label-help" }, La = { class: "mr-label-main" }, Ra = { class: "mr-label-bar" }, Da = ["aria-label"], Fa = ["aria-pressed", "disabled"], Ea = ["aria-pressed", "disabled"], Na = {
406
+ key: 0,
407
+ class: "mr-label-notice",
408
+ role: "status"
409
+ }, xa = ["aria-label"], Ta = { class: "mr-label-imposition" }, Va = ["disabled"], Oa = {
410
+ key: 3,
411
+ class: "mr-label-editor"
412
+ }, $a = {
413
+ key: 0,
414
+ class: "mr-label-editor-loading",
415
+ role: "status"
416
+ }, Ba = /* @__PURE__ */ pt({
417
+ __name: "ReportLabelStudio",
418
+ props: {
419
+ showSave: { type: Boolean, default: !0 },
420
+ rows: {},
421
+ schema: {},
422
+ title: {},
423
+ identityField: {},
424
+ dataContract: {},
425
+ modelValue: {},
426
+ preview: {},
427
+ save: {},
428
+ beforeDiscard: {},
429
+ messages: {},
430
+ preset: {},
431
+ brand: {},
432
+ fields: {}
433
+ },
434
+ emits: ["update:modelValue"],
435
+ setup(e, { expose: s, emit: o }) {
436
+ const i = e, u = o, l = Qt(i, (K) => u("update:modelValue", K)), { m: a, notice: m, title: y, document: g, mode: v, record: h, recordIndex: M, sheet: F, busy: V, editor: se, rows: oe, designDatasets: w, schemas: G, bindings: B, paper: _, labelCount: te, fetcher: z, preset: O, presets: Q, brandName: R, brandTagline: ae, fields: Y, fieldQuery: re, selectedFields: ge, availableFields: Z, fieldCount: he, configurationDirty: W, pendingLocalChanges: De, custom: $, confirmation: X, editorVisited: le, editorInitialDocument: ue, sheetLayout: J, sheetHint: de, rebuilding: ye, layoutChanged: ne } = l, { previewVisited: Fe, visibleFetcher: ce } = Ot(g, v, z), H = Ce();
437
+ let N = !1;
438
+ Ge(() => {
439
+ N = !0;
440
+ }), ee(l.editorVisited, async (K) => {
441
+ if (!(!K || H.value))
442
+ try {
443
+ const f = await import("./designer-DhrE7jzw.js").then((c) => c.w);
444
+ N || (H.value = bt(f.default));
445
+ } catch (f) {
446
+ N || l.failDesignLoad(f);
447
+ }
448
+ });
449
+ const fe = D();
450
+ let A = null;
451
+ return ee(X, async (K) => {
452
+ K ? (A = window.document.activeElement, await gt(), fe.value?.focus()) : A?.isConnected && (A.focus(), A = null);
453
+ }), s({ guardChanges: l.guardChanges, prepare: l.prepare, preview: l.showPreview, print: l.print, get mode() {
454
+ return v.value;
455
+ }, get canPrint() {
456
+ return l.canPrint.value;
457
+ }, get busy() {
458
+ return V.value;
459
+ }, get pendingLocalChanges() {
460
+ return De.value;
461
+ } }), (K, f) => (S(), k("section", {
462
+ class: qe(["mr-label-studio", { "is-design": t(v) === "design" }]),
463
+ "aria-label": t(y)
464
+ }, [
465
+ r("aside", Zt, [
466
+ r("div", Wt, [
467
+ me(pe, {
468
+ name: "file",
469
+ size: 18
470
+ }),
471
+ r("strong", null, d(t(y)), 1),
472
+ r("small", null, d(t($) ? t(a).customTemplate : t(a).readyTemplate), 1)
473
+ ]),
474
+ r("div", Xt, [
475
+ r("strong", null, [
476
+ L(d(t(_)?.widthMm) + " ", 1),
477
+ f[16] || (f[16] = r("i", null, "×", -1)),
478
+ L(" " + d(t(_)?.heightMm), 1)
479
+ ]),
480
+ r("span", null, "mm · " + d(t(g).template.pages.length) + " " + d(t(a).faces), 1)
481
+ ]),
482
+ r("fieldset", {
483
+ class: "mr-label-quick",
484
+ disabled: t(V)
485
+ }, [
486
+ r("legend", null, d(t(a).layout), 1),
487
+ r("div", {
488
+ class: "mr-label-presets",
489
+ "aria-label": t(a).layout
490
+ }, [
491
+ (S(!0), k(ve, null, Ne(t(Q), (c) => (S(), k("button", {
492
+ key: c.id,
493
+ type: "button",
494
+ "aria-pressed": t(O) === c.id,
495
+ onClick: (U) => O.value = c.id
496
+ }, [
497
+ r("span", {
498
+ class: qe(["mr-label-preset-art", `is-${c.id}`]),
499
+ "aria-hidden": "true"
500
+ }, [...f[17] || (f[17] = [
501
+ r("i", null, null, -1),
502
+ r("i", null, null, -1),
503
+ r("i", null, null, -1)
504
+ ])], 2),
505
+ r("span", null, [
506
+ r("strong", null, d(t(a)[`${c.id}Preset`]), 1),
507
+ r("small", null, d(c.widthMm) + " × " + d(c.heightMm) + " · " + d(c.faces) + " " + d(t(a).faces), 1)
508
+ ])
509
+ ], 8, aa))), 128))
510
+ ], 8, ta),
511
+ r("details", la, [
512
+ r("summary", null, [
513
+ L(d(t(a).fields) + " ", 1),
514
+ r("span", null, d(t(Y).length) + " / 5", 1)
515
+ ]),
516
+ t(ge).length ? (S(), k("div", na, [
517
+ (S(!0), k(ve, null, Ne(t(ge), (c) => (S(), k("button", {
518
+ key: c.field,
519
+ type: "button",
520
+ "aria-label": `${t(a).removeField} ${c.label}`,
521
+ onClick: (U) => t(l).toggleField(c.field, !1)
522
+ }, [
523
+ L(d(c.label) + " ", 1),
524
+ f[18] || (f[18] = r("span", { "aria-hidden": "true" }, "×", -1))
525
+ ], 8, ia))), 128))
526
+ ])) : E("", !0),
527
+ r("label", sa, [
528
+ me(pe, {
529
+ name: "search",
530
+ size: 13
531
+ }),
532
+ j(r("input", {
533
+ "onUpdate:modelValue": f[0] || (f[0] = (c) => ie(re) ? re.value = c : null),
534
+ type: "search",
535
+ "aria-label": t(a).findField,
536
+ placeholder: t(a).findField
537
+ }, null, 8, oa), [
538
+ [Se, t(re)]
539
+ ])
540
+ ]),
541
+ r("div", ra, [
542
+ (S(!0), k(ve, null, Ne(t(Z), (c) => (S(), k("label", {
543
+ key: c.field
544
+ }, [
545
+ r("input", {
546
+ type: "checkbox",
547
+ checked: t(Y).includes(c.field),
548
+ disabled: !t(Y).includes(c.field) && t(Y).length >= 5,
549
+ onChange: (U) => t(l).toggleField(c.field, U.target.checked)
550
+ }, null, 40, ua),
551
+ r("span", null, d(c.label ?? c.field), 1)
552
+ ]))), 128)),
553
+ t(Z).length ? E("", !0) : (S(), k("p", da, d(t(a).noFields), 1))
554
+ ]),
555
+ r("small", null, d(t(a).fieldLimit), 1),
556
+ t(he) > 30 ? (S(), k("small", ca, d(t(a).fieldSearchHint), 1)) : E("", !0)
557
+ ]),
558
+ r("details", fa, [
559
+ r("summary", null, d(t(a).brand), 1),
560
+ r("label", null, [
561
+ L(d(t(a).brandName), 1),
562
+ j(r("input", {
563
+ "onUpdate:modelValue": f[1] || (f[1] = (c) => ie(R) ? R.value = c : null),
564
+ maxlength: "80",
565
+ placeholder: t(y)
566
+ }, null, 8, ma), [
567
+ [Se, t(R)]
568
+ ])
569
+ ]),
570
+ r("label", null, [
571
+ L(d(t(a).brandTagline), 1),
572
+ j(r("input", {
573
+ "onUpdate:modelValue": f[2] || (f[2] = (c) => ie(ae) ? ae.value = c : null),
574
+ maxlength: "120"
575
+ }, null, 512), [
576
+ [Se, t(ae)]
577
+ ])
578
+ ])
579
+ ]),
580
+ r("button", {
581
+ class: "mr-label-apply",
582
+ type: "button",
583
+ disabled: !t(W) || !t(O),
584
+ onClick: f[3] || (f[3] = (c) => t(l).applyConfiguration())
585
+ }, [
586
+ me(pe, {
587
+ name: "arrow-right",
588
+ size: 13
589
+ }),
590
+ L(d(t(ne) ? t(a).applyLayout : t(a).applyContent), 1)
591
+ ], 8, va),
592
+ t($) && t(O) && !t(ye) ? (S(), k("button", {
593
+ key: 0,
594
+ class: "mr-label-reset-configuration mr-label-rebuild-current",
595
+ type: "button",
596
+ onClick: f[4] || (f[4] = //@ts-ignore
597
+ (...c) => t(l).requestRebuild && t(l).requestRebuild(...c))
598
+ }, d(t(a).rebuildCurrent), 1)) : E("", !0),
599
+ t(ye) ? (S(), k("div", pa, [
600
+ r("strong", null, d(t(a).rebuildTitle), 1),
601
+ r("p", null, d(t(a).rebuildDescription), 1),
602
+ r("div", null, [
603
+ r("button", {
604
+ type: "button",
605
+ onClick: f[5] || (f[5] = //@ts-ignore
606
+ (...c) => t(l).cancelRebuild && t(l).cancelRebuild(...c))
607
+ }, d(t(a).cancelRebuild), 1),
608
+ r("button", {
609
+ type: "button",
610
+ onClick: f[6] || (f[6] = (c) => t(l).applyConfiguration(!0))
611
+ }, d(t(a).confirmRebuild), 1)
612
+ ])
613
+ ])) : E("", !0),
614
+ t(W) ? (S(), k("button", {
615
+ key: 2,
616
+ class: "mr-label-reset-configuration",
617
+ type: "button",
618
+ onClick: f[7] || (f[7] = //@ts-ignore
619
+ (...c) => t(l).restoreConfiguration && t(l).restoreConfiguration(...c))
620
+ }, d(t(a).restoreConfiguration), 1)) : E("", !0),
621
+ t(W) && !t(O) ? (S(), k("p", ba, d(t(a).choosePreset), 1)) : E("", !0),
622
+ r("p", ga, d(t(ne) ? t(a).reflowHint : t(a).contentHint), 1)
623
+ ], 8, ea),
624
+ r("label", ha, [
625
+ L(d(t(a).records), 1),
626
+ j(r("select", {
627
+ "onUpdate:modelValue": f[8] || (f[8] = (c) => ie(h) ? h.value = c : null),
628
+ disabled: t(V) || !i.rows.length
629
+ }, [
630
+ r("option", wa, d(t(a).all) + " · " + d(i.rows.length), 1),
631
+ r("option", Sa, d(t(a).single), 1)
632
+ ], 8, ya), [
633
+ [ht, t(h)]
634
+ ])
635
+ ]),
636
+ t(h) === "single" ? (S(), k("label", Ma, [
637
+ L(d(t(a).record), 1),
638
+ j(r("input", {
639
+ "onUpdate:modelValue": f[9] || (f[9] = (c) => ie(M) ? M.value = c : null),
640
+ type: "number",
641
+ min: "1",
642
+ max: i.rows.length,
643
+ "aria-label": t(a).record,
644
+ disabled: t(V)
645
+ }, null, 8, Ca), [
646
+ [
647
+ Se,
648
+ t(M),
649
+ void 0,
650
+ { number: !0 }
651
+ ]
652
+ ]),
653
+ L(" / " + d(i.rows.length), 1)
654
+ ])) : E("", !0),
655
+ r("p", ka, [
656
+ r("strong", null, d(t(oe).length), 1),
657
+ L(" " + d(t(a).count) + " ", 1),
658
+ f[19] || (f[19] = r("span", null, "→", -1)),
659
+ f[20] || (f[20] = L()),
660
+ t(te) !== void 0 ? (S(), k(ve, { key: 0 }, [
661
+ r("strong", null, d(t(te)), 1),
662
+ L(" " + d(t(a).labels), 1)
663
+ ], 64)) : (S(), k(ve, { key: 1 }, [
664
+ L(d(t(a).invalidCopies), 1)
665
+ ], 64))
666
+ ]),
667
+ r("details", _a, [
668
+ r("summary", null, d(t(a).guide), 1),
669
+ r("p", null, d(t(a).help), 1),
670
+ r("p", null, d(t(a).printHint), 1)
671
+ ])
672
+ ]),
673
+ r("div", La, [
674
+ r("header", Ra, [
675
+ r("nav", { "aria-label": t(y) }, [
676
+ r("button", {
677
+ type: "button",
678
+ "aria-pressed": t(v) === "preview",
679
+ disabled: t(V),
680
+ onClick: f[10] || (f[10] = (c) => t(l).navigate("preview"))
681
+ }, [
682
+ me(pe, {
683
+ name: "file",
684
+ size: 14
685
+ }),
686
+ L(d(t(a).preview), 1)
687
+ ], 8, Fa),
688
+ r("button", {
689
+ type: "button",
690
+ "aria-pressed": t(v) === "design",
691
+ disabled: t(V),
692
+ onClick: f[11] || (f[11] = (c) => t(l).navigate("design"))
693
+ }, [
694
+ me(pe, {
695
+ name: "settings",
696
+ size: 14
697
+ }),
698
+ L(d(t(a).design), 1)
699
+ ], 8, Ea)
700
+ ], 8, Da),
701
+ r("span", null, d(t(v) === "design" ? t(a).designHint : t(a).flow), 1)
702
+ ]),
703
+ t(m) ? (S(), k("p", Na, d(t(m)), 1)) : E("", !0),
704
+ t(X) ? (S(), k("div", {
705
+ key: 1,
706
+ class: "mr-label-confirm",
707
+ role: "alertdialog",
708
+ "aria-label": t(a).discardTitle,
709
+ onKeydown: f[14] || (f[14] = yt(wt((c) => t(l).decideDiscard(!1), ["prevent", "stop"]), ["esc"]))
710
+ }, [
711
+ r("div", null, [
712
+ r("strong", null, d(t(a).discardTitle), 1),
713
+ r("p", null, d(t(a).discardDescription), 1)
714
+ ]),
715
+ r("button", {
716
+ ref_key: "keepEditingButton",
717
+ ref: fe,
718
+ type: "button",
719
+ onClick: f[12] || (f[12] = (c) => t(l).decideDiscard(!1))
720
+ }, d(t(a).keepEditing), 513),
721
+ r("button", {
722
+ type: "button",
723
+ onClick: f[13] || (f[13] = (c) => t(l).decideDiscard(!0))
724
+ }, d(t(a).discard), 1)
725
+ ], 40, xa)) : E("", !0),
726
+ t(Fe) ? j((S(), Be(t(Lt), {
727
+ key: t(g).id,
728
+ ref: t(l).preview.ref,
729
+ "report-id": "labels",
730
+ fetcher: t(ce),
731
+ refresh: { retainPrevious: !0, key: t(g).id },
732
+ "show-params": !1,
733
+ height: "100%",
734
+ toolbar: { exportFormats: ["pdf", "png", "html"], editing: !1, excelImport: !1 },
735
+ messages: { title: t(y), empty: t(a).empty }
736
+ }, {
737
+ settings: St(() => [
738
+ r("label", Ta, [
739
+ j(r("input", {
740
+ "onUpdate:modelValue": f[15] || (f[15] = (c) => ie(F) ? F.value = c : null),
741
+ type: "checkbox",
742
+ disabled: !t(J)
743
+ }, null, 8, Va), [
744
+ [Mt, t(F)]
745
+ ]),
746
+ L(d(t(a).sheet), 1),
747
+ r("small", null, d(t(de)), 1)
748
+ ])
749
+ ]),
750
+ _: 1
751
+ }, 8, ["fetcher", "refresh", "messages"])), [
752
+ [He, t(v) === "preview"]
753
+ ]) : E("", !0),
754
+ t(le) ? j((S(), k("div", Oa, [
755
+ H.value ? E("", !0) : (S(), k("p", $a, d(t(a).designLoading), 1)),
756
+ H.value ? (S(), Be(Ct(H.value), {
757
+ key: 1,
758
+ ref_key: "editor",
759
+ ref: se,
760
+ "model-value": t(ue) ?? t(g),
761
+ mode: "design",
762
+ "show-mode-switch": !1,
763
+ "show-save": e.showSave,
764
+ capabilities: { params: !1 },
765
+ datasets: t(w),
766
+ "data-schemas": t(G),
767
+ "binding-datasets": t(B),
768
+ "binding-data-contract": e.dataContract,
769
+ save: t(l).save,
770
+ "before-discard": t(l).beforeDiscard,
771
+ preview: e.preview,
772
+ "onUpdate:modelValue": t(l).update
773
+ }, null, 8, ["model-value", "show-save", "datasets", "data-schemas", "binding-datasets", "binding-data-contract", "save", "before-discard", "preview", "onUpdate:modelValue"])) : E("", !0)
774
+ ], 512)), [
775
+ [He, t(v) === "design"]
776
+ ]) : E("", !0)
777
+ ])
778
+ ], 10, Yt));
779
+ }
780
+ });
781
+ export {
782
+ Ba as default
783
+ };