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