@nice2dev/ui-printing 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,149 +1,149 @@
1
- import { jsx as e, jsxs as a, Fragment as j } from "react/jsx-runtime";
2
- import { useNiceTranslation as J, NiceAppShell as je, NiceIcon as N } from "@nice2dev/ui";
3
- import Ke, { useReducer as Xe, useState as F, useCallback as M, useMemo as me, useEffect as Se, useRef as Je } from "react";
4
- import { createPortal as Qe } from "react-dom";
5
- const Ze = "_root_lceud_3", et = "_dark_lceud_27", tt = "_toolbar_lceud_39", nt = "_toolbarGroup_lceud_75", at = "_toolbarBtn_lceud_107", it = "_toolbarBtnActive_lceud_171", st = "_toolbarBtnDanger_lceud_195", rt = "_toolbarSelect_lceud_207", lt = "_toolbarSep_lceud_237", ot = "_insertWrapper_lceud_263", ct = "_insertBtn_lceud_271", dt = "_insertDropdown_lceud_293", pt = "_insertCategory_lceud_333", ut = "_insertItem_lceud_351", mt = "_insertIcon_lceud_395", ht = "_zoomSelect_lceud_409", _t = "_saveBtn_lceud_441", gt = "_editorBody_lceud_477", bt = "_leftPanel_lceud_493", yt = "_leftTabs_lceud_523", vt = "_leftTab_lceud_523", Nt = "_leftTabActive_lceud_601", ft = "_leftTabIcon_lceud_621", wt = "_leftTabLabel_lceud_629", kt = "_leftContent_lceud_639", St = "_panelHeader_lceud_653", Ct = "_panelHeaderIcon_lceud_677", Bt = "_panelHeaderName_lceud_685", It = "_searchBox_lceud_699", Lt = "_searchInput_lceud_707", xt = "_fieldList_lceud_753", zt = "_fieldItem_lceud_763", Tt = "_fieldItemIcon_lceud_807", Dt = "_fieldItemInfo_lceud_821", $t = "_fieldItemLabel_lceud_831", Rt = "_fieldItemPath_lceud_847", At = "_fieldItemType_lceud_863", Mt = "_layerList_lceud_883", Pt = "_layerItem_lceud_895", Et = "_layerItemSelected_lceud_931", Ft = "_layerIcon_lceud_949", Ht = "_layerName_lceud_961", Gt = "_layerActions_lceud_977", Ot = "_layerBtn_lceud_999", qt = "_wmList_lceud_1031", Wt = "_wmItem_lceud_1039", Ut = "_wmRow_lceud_1065", Yt = "_wmLabel_lceud_1079", Vt = "_wmInput_lceud_1091", jt = "_wmInputNum_lceud_1123", Kt = "_wmSelect_lceud_1143", Xt = "_wmSlider_lceud_1175", Jt = "_wmValue_lceud_1185", Qt = "_wmUnit_lceud_1199", Zt = "_wmDelete_lceud_1209", en = "_addBtn_lceud_1241", tn = "_settingsForm_lceud_1277", nn = "_settingsRow_lceud_1285", an = "_settingsLabel_lceud_1299", sn = "_settingsInput_lceud_1311", rn = "_settingsInputNum_lceud_1343", ln = "_settingsTextarea_lceud_1375", on = "_settingsDivider_lceud_1409", cn = "_settingsUnit_lceud_1429", dn = "_emptyMsg_lceud_1441", pn = "_canvasArea_lceud_1459", un = "_testDataBar_lceud_1485", mn = "_testDataLabel_lceud_1517", hn = "_testDataSelect_lceud_1527", _n = "_rulerWrapper_lceud_1547", gn = "_rulerCorner_lceud_1563", bn = "_ruler_lceud_1547", yn = "_ruler_h_lceud_1621", vn = "_ruler_v_lceud_1631", Nn = "_rulerTick_lceud_1651", fn = "_rulerTickMajor_lceud_1691", wn = "_rulerLabel_lceud_1711", kn = "_paperScroll_lceud_1749", Sn = "_paperShadow_lceud_1767", Cn = "_marginGuide_lceud_1803", Bn = "_watermark_lceud_1819", In = "_sectionCanvas_lceud_1845", Ln = "_sectionCanvasOver_lceud_1859", xn = "_sectionTypeChip_lceud_1867", zn = "_sectionResizeBar_lceud_1899", Tn = "_sectionResizeGrip_lceud_1933", Dn = "_fieldImagePlaceholder_lceud_1949", $n = "_fieldBarcodePlaceholder_lceud_1971", Rn = "_fieldSignaturePlaceholder_lceud_1999", An = "_resizeHandle_lceud_2031", Mn = "_handle_n_lceud_2051", Pn = "_handle_s_lceud_2063", En = "_handle_e_lceud_2075", Fn = "_handle_w_lceud_2087", Hn = "_handle_ne_lceud_2099", Gn = "_handle_nw_lceud_2109", On = "_handle_se_lceud_2119", qn = "_handle_sw_lceud_2129", Wn = "_rightPanel_lceud_2143", Un = "_rightTabs_lceud_2173", Yn = "_rightTab_lceud_2173", Vn = "_rightTabActive_lceud_2243", jn = "_propsBody_lceud_2255", Kn = "_propsEmpty_lceud_2267", Xn = "_propsEmptyIcon_lceud_2289", Jn = "_propsEmptyText_lceud_2299", Qn = "_posGrid_lceud_2311", Zn = "_posCell_lceud_2325", ea = "_posLabel_lceud_2337", ta = "_posInput_lceud_2349", na = "_posUnit_lceud_2391", aa = "_snapSection_lceud_2403", ia = "_snapTitle_lceud_2411", sa = "_snapRow_lceud_2429", ra = "_snapBtn_lceud_2439", la = "_styleGroup_lceud_2473", oa = "_styleGroupTitle_lceud_2481", ca = "_styleRow_lceud_2511", da = "_styleLabel_lceud_2525", pa = "_styleSelect_lceud_2539", ua = "_styleSelectFull_lceud_2569", ma = "_styleSelectSm_lceud_2601", ha = "_styleSelectXs_lceud_2621", _a = "_styleInput_lceud_2653", ga = "_styleInputFull_lceud_2685", ba = "_styleUnit_lceud_2717", ya = "_styleValue_lceud_2729", va = "_toggleGroup_lceud_2743", Na = "_toggleBtn_lceud_2753", fa = "_toggleBtnActive_lceud_2787", wa = "_colorPicker_lceud_2801", ka = "_colorHex_lceud_2819", Sa = "_clearBtn_lceud_2853", Ca = "_sliderInput_lceud_2885", Ba = "_conditionalHint_lceud_2897", Ia = "_clearConditionalBtn_lceud_2929", La = "_shortcutGrid_lceud_2961", xa = "_shortcutChip_lceud_2975", za = "_shortcutKeys_lceud_3007", Ta = "_shortcutLabel_lceud_3027", t = {
6
- root: Ze,
7
- dark: et,
8
- toolbar: tt,
9
- toolbarGroup: nt,
10
- toolbarBtn: at,
11
- toolbarBtnActive: it,
12
- toolbarBtnDanger: st,
13
- toolbarSelect: rt,
1
+ import { jsx as e, jsxs as a, Fragment as X } from "react/jsx-runtime";
2
+ import { useNiceTranslation as j, NiceAppShell as Xe, NiceIcon as w } from "@nice2dev/ui";
3
+ import Ke, { useReducer as Je, useState as H, useCallback as P, useMemo as ue, useEffect as Se, useRef as Qe } from "react";
4
+ import { createPortal as Ze } from "react-dom";
5
+ const et = "_root_19f1m_3", tt = "_dark_19f1m_27", nt = "_toolbar_19f1m_39", at = "_toolbarGroup_19f1m_75", it = "_toolbarBtn_19f1m_107", st = "_toolbarBtnActive_19f1m_171", rt = "_toolbarBtnDanger_19f1m_195", ot = "_toolbarSelect_19f1m_207", lt = "_toolbarSep_19f1m_237", ct = "_insertWrapper_19f1m_263", dt = "_insertBtn_19f1m_271", mt = "_insertDropdown_19f1m_293", pt = "_insertCategory_19f1m_333", ut = "_insertItem_19f1m_351", ht = "_insertIcon_19f1m_395", _t = "_zoomSelect_19f1m_409", gt = "_saveBtn_19f1m_441", bt = "_editorBody_19f1m_477", yt = "_leftPanel_19f1m_493", ft = "_leftTabs_19f1m_523", vt = "_leftTab_19f1m_523", Nt = "_leftTabActive_19f1m_601", wt = "_leftTabIcon_19f1m_621", kt = "_leftTabLabel_19f1m_629", St = "_leftContent_19f1m_639", Ct = "_panelHeader_19f1m_653", Bt = "_panelHeaderIcon_19f1m_677", It = "_panelHeaderName_19f1m_685", Lt = "_searchBox_19f1m_699", xt = "_searchInput_19f1m_707", zt = "_fieldList_19f1m_753", Tt = "_fieldItem_19f1m_763", $t = "_fieldItemIcon_19f1m_807", Dt = "_fieldItemInfo_19f1m_821", Rt = "_fieldItemLabel_19f1m_831", Et = "_fieldItemPath_19f1m_847", At = "_fieldItemType_19f1m_863", Mt = "_layerList_19f1m_883", Pt = "_layerItem_19f1m_895", Ft = "_layerItemSelected_19f1m_931", Ht = "_layerIcon_19f1m_949", Gt = "_layerName_19f1m_961", Ot = "_layerActions_19f1m_977", qt = "_layerBtn_19f1m_999", Wt = "_wmList_19f1m_1031", Yt = "_wmItem_19f1m_1039", Ut = "_wmRow_19f1m_1065", jt = "_wmLabel_19f1m_1079", Vt = "_wmInput_19f1m_1091", Xt = "_wmInputNum_19f1m_1123", Kt = "_wmSelect_19f1m_1143", Jt = "_wmSlider_19f1m_1175", Qt = "_wmValue_19f1m_1185", Zt = "_wmUnit_19f1m_1199", en = "_wmDelete_19f1m_1209", tn = "_addBtn_19f1m_1241", nn = "_settingsForm_19f1m_1277", an = "_settingsRow_19f1m_1285", sn = "_settingsLabel_19f1m_1299", rn = "_settingsInput_19f1m_1311", on = "_settingsInputNum_19f1m_1343", ln = "_settingsTextarea_19f1m_1375", cn = "_settingsDivider_19f1m_1409", dn = "_settingsUnit_19f1m_1429", mn = "_emptyMsg_19f1m_1441", pn = "_canvasArea_19f1m_1459", un = "_testDataBar_19f1m_1485", hn = "_testDataLabel_19f1m_1517", _n = "_testDataSelect_19f1m_1527", gn = "_rulerWrapper_19f1m_1547", bn = "_rulerCorner_19f1m_1563", yn = "_ruler_19f1m_1547", fn = "_ruler_h_19f1m_1621", vn = "_ruler_v_19f1m_1631", Nn = "_rulerTick_19f1m_1651", wn = "_rulerTickMajor_19f1m_1691", kn = "_rulerLabel_19f1m_1711", Sn = "_paperScroll_19f1m_1749", Cn = "_paperShadow_19f1m_1767", Bn = "_marginGuide_19f1m_1803", In = "_watermark_19f1m_1819", Ln = "_sectionCanvas_19f1m_1845", xn = "_sectionCanvasOver_19f1m_1859", zn = "_sectionTypeChip_19f1m_1867", Tn = "_sectionResizeBar_19f1m_1899", $n = "_sectionResizeGrip_19f1m_1933", Dn = "_fieldImagePlaceholder_19f1m_1949", Rn = "_fieldBarcodePlaceholder_19f1m_1971", En = "_fieldSignaturePlaceholder_19f1m_1999", An = "_resizeHandle_19f1m_2031", Mn = "_handle_n_19f1m_2051", Pn = "_handle_s_19f1m_2063", Fn = "_handle_e_19f1m_2075", Hn = "_handle_w_19f1m_2087", Gn = "_handle_ne_19f1m_2099", On = "_handle_nw_19f1m_2109", qn = "_handle_se_19f1m_2119", Wn = "_handle_sw_19f1m_2129", Yn = "_rightPanel_19f1m_2143", Un = "_rightTabs_19f1m_2173", jn = "_rightTab_19f1m_2173", Vn = "_rightTabActive_19f1m_2243", Xn = "_propsBody_19f1m_2255", Kn = "_propsEmpty_19f1m_2267", Jn = "_propsEmptyIcon_19f1m_2289", Qn = "_propsEmptyText_19f1m_2299", Zn = "_posGrid_19f1m_2311", ea = "_posCell_19f1m_2325", ta = "_posLabel_19f1m_2337", na = "_posInput_19f1m_2349", aa = "_posUnit_19f1m_2391", ia = "_snapSection_19f1m_2403", sa = "_snapTitle_19f1m_2411", ra = "_snapRow_19f1m_2429", oa = "_snapBtn_19f1m_2439", la = "_styleGroup_19f1m_2473", ca = "_styleGroupTitle_19f1m_2481", da = "_styleRow_19f1m_2511", ma = "_styleLabel_19f1m_2525", pa = "_styleSelect_19f1m_2539", ua = "_styleSelectFull_19f1m_2569", ha = "_styleSelectSm_19f1m_2601", _a = "_styleSelectXs_19f1m_2621", ga = "_styleInput_19f1m_2653", ba = "_styleInputFull_19f1m_2685", ya = "_styleUnit_19f1m_2717", fa = "_styleValue_19f1m_2729", va = "_toggleGroup_19f1m_2743", Na = "_toggleBtn_19f1m_2753", wa = "_toggleBtnActive_19f1m_2787", ka = "_colorPicker_19f1m_2801", Sa = "_colorHex_19f1m_2819", Ca = "_clearBtn_19f1m_2853", Ba = "_sliderInput_19f1m_2885", Ia = "_conditionalHint_19f1m_2897", La = "_clearConditionalBtn_19f1m_2929", xa = "_shortcutGrid_19f1m_2961", za = "_shortcutChip_19f1m_2975", Ta = "_shortcutKeys_19f1m_3007", $a = "_shortcutLabel_19f1m_3027", t = {
6
+ root: et,
7
+ dark: tt,
8
+ toolbar: nt,
9
+ toolbarGroup: at,
10
+ toolbarBtn: it,
11
+ toolbarBtnActive: st,
12
+ toolbarBtnDanger: rt,
13
+ toolbarSelect: ot,
14
14
  toolbarSep: lt,
15
- insertWrapper: ot,
16
- insertBtn: ct,
17
- insertDropdown: dt,
15
+ insertWrapper: ct,
16
+ insertBtn: dt,
17
+ insertDropdown: mt,
18
18
  insertCategory: pt,
19
19
  insertItem: ut,
20
- insertIcon: mt,
21
- zoomSelect: ht,
22
- saveBtn: _t,
23
- editorBody: gt,
24
- leftPanel: bt,
25
- leftTabs: yt,
20
+ insertIcon: ht,
21
+ zoomSelect: _t,
22
+ saveBtn: gt,
23
+ editorBody: bt,
24
+ leftPanel: yt,
25
+ leftTabs: ft,
26
26
  leftTab: vt,
27
27
  leftTabActive: Nt,
28
- leftTabIcon: ft,
29
- leftTabLabel: wt,
30
- leftContent: kt,
31
- panelHeader: St,
32
- panelHeaderIcon: Ct,
33
- panelHeaderName: Bt,
34
- searchBox: It,
35
- searchInput: Lt,
36
- fieldList: xt,
37
- fieldItem: zt,
38
- fieldItemIcon: Tt,
28
+ leftTabIcon: wt,
29
+ leftTabLabel: kt,
30
+ leftContent: St,
31
+ panelHeader: Ct,
32
+ panelHeaderIcon: Bt,
33
+ panelHeaderName: It,
34
+ searchBox: Lt,
35
+ searchInput: xt,
36
+ fieldList: zt,
37
+ fieldItem: Tt,
38
+ fieldItemIcon: $t,
39
39
  fieldItemInfo: Dt,
40
- fieldItemLabel: $t,
41
- fieldItemPath: Rt,
40
+ fieldItemLabel: Rt,
41
+ fieldItemPath: Et,
42
42
  fieldItemType: At,
43
43
  layerList: Mt,
44
44
  layerItem: Pt,
45
- layerItemSelected: Et,
46
- layerIcon: Ft,
47
- layerName: Ht,
48
- layerActions: Gt,
49
- layerBtn: Ot,
50
- wmList: qt,
51
- wmItem: Wt,
45
+ layerItemSelected: Ft,
46
+ layerIcon: Ht,
47
+ layerName: Gt,
48
+ layerActions: Ot,
49
+ layerBtn: qt,
50
+ wmList: Wt,
51
+ wmItem: Yt,
52
52
  wmRow: Ut,
53
- wmLabel: Yt,
53
+ wmLabel: jt,
54
54
  wmInput: Vt,
55
- wmInputNum: jt,
55
+ wmInputNum: Xt,
56
56
  wmSelect: Kt,
57
- wmSlider: Xt,
58
- wmValue: Jt,
59
- wmUnit: Qt,
60
- wmDelete: Zt,
61
- addBtn: en,
62
- settingsForm: tn,
63
- settingsRow: nn,
64
- settingsLabel: an,
65
- settingsInput: sn,
66
- settingsInputNum: rn,
57
+ wmSlider: Jt,
58
+ wmValue: Qt,
59
+ wmUnit: Zt,
60
+ wmDelete: en,
61
+ addBtn: tn,
62
+ settingsForm: nn,
63
+ settingsRow: an,
64
+ settingsLabel: sn,
65
+ settingsInput: rn,
66
+ settingsInputNum: on,
67
67
  settingsTextarea: ln,
68
- settingsDivider: on,
69
- settingsUnit: cn,
70
- emptyMsg: dn,
68
+ settingsDivider: cn,
69
+ settingsUnit: dn,
70
+ emptyMsg: mn,
71
71
  canvasArea: pn,
72
72
  testDataBar: un,
73
- testDataLabel: mn,
74
- testDataSelect: hn,
75
- rulerWrapper: _n,
76
- rulerCorner: gn,
77
- ruler: bn,
78
- ruler_h: yn,
73
+ testDataLabel: hn,
74
+ testDataSelect: _n,
75
+ rulerWrapper: gn,
76
+ rulerCorner: bn,
77
+ ruler: yn,
78
+ ruler_h: fn,
79
79
  ruler_v: vn,
80
80
  rulerTick: Nn,
81
- rulerTickMajor: fn,
82
- rulerLabel: wn,
83
- paperScroll: kn,
84
- paperShadow: Sn,
85
- marginGuide: Cn,
86
- watermark: Bn,
87
- sectionCanvas: In,
88
- sectionCanvasOver: Ln,
89
- sectionTypeChip: xn,
90
- sectionResizeBar: zn,
91
- sectionResizeGrip: Tn,
81
+ rulerTickMajor: wn,
82
+ rulerLabel: kn,
83
+ paperScroll: Sn,
84
+ paperShadow: Cn,
85
+ marginGuide: Bn,
86
+ watermark: In,
87
+ sectionCanvas: Ln,
88
+ sectionCanvasOver: xn,
89
+ sectionTypeChip: zn,
90
+ sectionResizeBar: Tn,
91
+ sectionResizeGrip: $n,
92
92
  fieldImagePlaceholder: Dn,
93
- fieldBarcodePlaceholder: $n,
94
- fieldSignaturePlaceholder: Rn,
93
+ fieldBarcodePlaceholder: Rn,
94
+ fieldSignaturePlaceholder: En,
95
95
  resizeHandle: An,
96
96
  handle_n: Mn,
97
97
  handle_s: Pn,
98
- handle_e: En,
99
- handle_w: Fn,
100
- handle_ne: Hn,
101
- handle_nw: Gn,
102
- handle_se: On,
103
- handle_sw: qn,
104
- rightPanel: Wn,
98
+ handle_e: Fn,
99
+ handle_w: Hn,
100
+ handle_ne: Gn,
101
+ handle_nw: On,
102
+ handle_se: qn,
103
+ handle_sw: Wn,
104
+ rightPanel: Yn,
105
105
  rightTabs: Un,
106
- rightTab: Yn,
106
+ rightTab: jn,
107
107
  rightTabActive: Vn,
108
- propsBody: jn,
108
+ propsBody: Xn,
109
109
  propsEmpty: Kn,
110
- propsEmptyIcon: Xn,
111
- propsEmptyText: Jn,
112
- posGrid: Qn,
113
- posCell: Zn,
114
- posLabel: ea,
115
- posInput: ta,
116
- posUnit: na,
117
- snapSection: aa,
118
- snapTitle: ia,
119
- snapRow: sa,
120
- snapBtn: ra,
110
+ propsEmptyIcon: Jn,
111
+ propsEmptyText: Qn,
112
+ posGrid: Zn,
113
+ posCell: ea,
114
+ posLabel: ta,
115
+ posInput: na,
116
+ posUnit: aa,
117
+ snapSection: ia,
118
+ snapTitle: sa,
119
+ snapRow: ra,
120
+ snapBtn: oa,
121
121
  styleGroup: la,
122
- styleGroupTitle: oa,
123
- styleRow: ca,
124
- styleLabel: da,
122
+ styleGroupTitle: ca,
123
+ styleRow: da,
124
+ styleLabel: ma,
125
125
  styleSelect: pa,
126
126
  styleSelectFull: ua,
127
- styleSelectSm: ma,
128
- styleSelectXs: ha,
129
- styleInput: _a,
130
- styleInputFull: ga,
131
- styleUnit: ba,
132
- styleValue: ya,
127
+ styleSelectSm: ha,
128
+ styleSelectXs: _a,
129
+ styleInput: ga,
130
+ styleInputFull: ba,
131
+ styleUnit: ya,
132
+ styleValue: fa,
133
133
  toggleGroup: va,
134
134
  toggleBtn: Na,
135
- toggleBtnActive: fa,
136
- colorPicker: wa,
137
- colorHex: ka,
138
- clearBtn: Sa,
139
- sliderInput: Ca,
140
- conditionalHint: Ba,
141
- clearConditionalBtn: Ia,
142
- shortcutGrid: La,
143
- shortcutChip: xa,
144
- shortcutKeys: za,
145
- shortcutLabel: Ta
146
- }, U = 3.78, Le = {
135
+ toggleBtnActive: wa,
136
+ colorPicker: ka,
137
+ colorHex: Sa,
138
+ clearBtn: Ca,
139
+ sliderInput: Ba,
140
+ conditionalHint: Ia,
141
+ clearConditionalBtn: La,
142
+ shortcutGrid: xa,
143
+ shortcutChip: za,
144
+ shortcutKeys: Ta,
145
+ shortcutLabel: $a
146
+ }, W = 3.78, Le = {
147
147
  A3: [297, 420],
148
148
  A4: [210, 297],
149
149
  A5: [148, 210],
@@ -198,13 +198,13 @@ const Ze = "_root_lceud_3", et = "_dark_lceud_27", tt = "_toolbar_lceud_39", nt
198
198
  page_number: "Page number",
199
199
  total_pages: "Total pages",
200
200
  print_date: "Print date"
201
- }, we = (n, l) => _e[l] ? n(`printing.fieldType.${l}`, _e[l]) : l;
202
- function $a(n, l) {
203
- switch (l.type) {
201
+ }, we = (n, o) => _e[o] ? n(`printing.fieldType.${o}`, _e[o]) : o;
202
+ function Ra(n, o) {
203
+ switch (o.type) {
204
204
  case "UPDATE":
205
205
  return {
206
206
  past: [...n.past.slice(-50), n.present],
207
- present: l.payload,
207
+ present: o.payload,
208
208
  future: []
209
209
  };
210
210
  case "UNDO":
@@ -223,17 +223,17 @@ function $a(n, l) {
223
223
  return n;
224
224
  }
225
225
  }
226
- const se = "#000000", ge = "#94a3b8";
226
+ const se = "#000000", be = "#94a3b8";
227
227
  function ce() {
228
228
  return `f-${Date.now()}-${Math.floor(Math.random() * 1e3)}`;
229
229
  }
230
- function ze(n, l) {
231
- const d = {
230
+ function ze(n, o) {
231
+ const m = {
232
232
  id: ce(),
233
- name: (l == null ? void 0 : l.label) ?? _e[n] ?? n,
234
- label: (l == null ? void 0 : l.label) ?? _e[n] ?? n,
233
+ name: (o == null ? void 0 : o.label) ?? _e[n] ?? n,
234
+ label: (o == null ? void 0 : o.label) ?? _e[n] ?? n,
235
235
  type: n,
236
- dataPath: (l == null ? void 0 : l.path) ?? "",
236
+ dataPath: (o == null ? void 0 : o.path) ?? "",
237
237
  fallback: n === "static_text" ? "Static text" : void 0,
238
238
  format: n === "date" || n === "datetime" ? "DD.MM.YYYY" : void 0,
239
239
  position: {
@@ -244,45 +244,45 @@ function ze(n, l) {
244
244
  },
245
245
  style: { fontSize: 10, color: se, fontFamily: "sans-serif" }
246
246
  };
247
- return n === "rect" && (d.style.backgroundColor = "var(--nice-bg-secondary, #f1f5f9)"), n === "line" && (d.style = {
248
- ...d.style,
247
+ return n === "rect" && (m.style.backgroundColor = "var(--nice-bg-secondary, #f1f5f9)"), n === "line" && (m.style = {
248
+ ...m.style,
249
249
  borderWidth: 0.5,
250
250
  borderColor: se,
251
251
  borderStyle: "solid"
252
- }), d;
252
+ }), m;
253
253
  }
254
254
  const Te = ({
255
255
  lengthMm: n,
256
- zoom: l,
257
- orientation: d
256
+ zoom: o,
257
+ orientation: m
258
258
  }) => {
259
- const o = [], S = l < 0.6 ? 20 : l < 1 ? 10 : 5;
260
- for (let b = 0; b <= n; b += S) {
261
- const m = b * l * U, I = b % (S * 2) === 0;
262
- o.push(
259
+ const l = [], C = o < 0.6 ? 20 : o < 1 ? 10 : 5;
260
+ for (let v = 0; v <= n; v += C) {
261
+ const g = v * o * W, _ = v % (C * 2) === 0;
262
+ l.push(
263
263
  /* @__PURE__ */ e(
264
264
  "div",
265
265
  {
266
- className: `${t.rulerTick} ${I ? t.rulerTickMajor : ""}`,
267
- style: d === "h" ? { left: m } : { top: m },
268
- children: I && /* @__PURE__ */ e("span", { className: t.rulerLabel, children: b })
266
+ className: `${t.rulerTick} ${_ ? t.rulerTickMajor : ""}`,
267
+ style: m === "h" ? { left: g } : { top: g },
268
+ children: _ && /* @__PURE__ */ e("span", { className: t.rulerLabel, children: v })
269
269
  },
270
- b
270
+ v
271
271
  )
272
272
  );
273
273
  }
274
- return /* @__PURE__ */ e("div", { className: `${t.ruler} ${t[`ruler_${d}`]}`, children: o });
275
- }, Ra = ["n", "s", "e", "w", "ne", "nw", "se", "sw"], Aa = ({ onResizeStart: n }) => /* @__PURE__ */ e(j, { children: Ra.map((l) => /* @__PURE__ */ e(
274
+ return /* @__PURE__ */ e("div", { className: `${t.ruler} ${t[`ruler_${m}`]}`, children: l });
275
+ }, Ea = ["n", "s", "e", "w", "ne", "nw", "se", "sw"], Aa = ({ onResizeStart: n }) => /* @__PURE__ */ e(X, { children: Ea.map((o) => /* @__PURE__ */ e(
276
276
  "div",
277
277
  {
278
- className: `${t.resizeHandle} ${t[`handle_${l}`]}`,
279
- onMouseDown: (d) => {
280
- d.stopPropagation(), n(l, d);
278
+ className: `${t.resizeHandle} ${t[`handle_${o}`]}`,
279
+ onMouseDown: (m) => {
280
+ m.stopPropagation(), n(o, m);
281
281
  }
282
282
  },
283
- l
283
+ o
284
284
  )) });
285
- function Ma(n, l) {
285
+ function Ma(n, o) {
286
286
  if (n.type === "static_text")
287
287
  return n.fallback ?? "Text";
288
288
  if (n.type === "page_number")
@@ -291,92 +291,93 @@ function Ma(n, l) {
291
291
  return "3";
292
292
  if (n.type === "print_date")
293
293
  return (/* @__PURE__ */ new Date()).toLocaleDateString("pl-PL");
294
- if (l && n.dataPath) {
295
- const d = n.dataPath.split(".").reduce(
296
- (o, S) => o && typeof o == "object" ? o[S] : null,
297
- l
294
+ if (o && n.dataPath) {
295
+ const m = n.dataPath.split(".").reduce(
296
+ (l, C) => l && typeof l == "object" ? l[C] : null,
297
+ o
298
298
  );
299
- if (d != null)
300
- return String(d);
299
+ if (m != null)
300
+ return String(m);
301
301
  }
302
302
  return n.label ? `{${n.label}}` : `{${n.dataPath}}`;
303
303
  }
304
304
  const Pa = ({
305
305
  field: n,
306
- zoom: l,
307
- selected: d,
308
- sampleData: o,
309
- onClick: S,
310
- onDragStart: b,
311
- onResizeStart: m,
312
- readOnly: I
306
+ zoom: o,
307
+ selected: m,
308
+ sampleData: l,
309
+ onClick: C,
310
+ onDragStart: v,
311
+ onResizeStart: g,
312
+ readOnly: _
313
313
  }) => {
314
- const h = n.position, f = n.style, s = (_) => _ * l * U, z = n.type === "line", w = n.type === "rect", L = n.type === "image" || n.type === "static_image", r = n.type === "barcode" || n.type === "qr", i = {
314
+ const { t: b } = j(), k = n.position, h = n.style, r = (d) => d * o * W, S = n.type === "line", I = n.type === "rect", x = n.type === "image" || n.type === "static_image", s = n.type === "barcode" || n.type === "qr", i = {
315
315
  position: "absolute",
316
- left: s(h.x),
317
- top: s(h.y),
318
- width: s(h.width),
319
- height: s(h.height),
320
- zIndex: h.zIndex ?? 1,
321
- transform: f.rotation ? `rotate(${f.rotation}deg)` : void 0,
316
+ left: r(k.x),
317
+ top: r(k.y),
318
+ width: r(k.width),
319
+ height: r(k.height),
320
+ zIndex: k.zIndex ?? 1,
321
+ transform: h.rotation ? `rotate(${h.rotation}deg)` : void 0,
322
322
  boxSizing: "border-box",
323
323
  overflow: "hidden",
324
- ...!z && !w ? {
325
- fontSize: (f.fontSize ?? 10) * l,
326
- fontFamily: f.fontFamily ?? "sans-serif",
327
- fontWeight: f.fontWeight ?? "normal",
328
- fontStyle: f.fontStyle ?? "normal",
329
- color: f.color ?? se,
330
- textAlign: f.textAlign ?? "left",
331
- lineHeight: f.lineHeight ?? 1.4,
332
- letterSpacing: f.letterSpacing ? `${f.letterSpacing}em` : void 0,
333
- padding: f.padding ? s(f.padding) : 0
324
+ ...!S && !I ? {
325
+ fontSize: (h.fontSize ?? 10) * o,
326
+ fontFamily: h.fontFamily ?? "sans-serif",
327
+ fontWeight: h.fontWeight ?? "normal",
328
+ fontStyle: h.fontStyle ?? "normal",
329
+ color: h.color ?? se,
330
+ textAlign: h.textAlign ?? "left",
331
+ lineHeight: h.lineHeight ?? 1.4,
332
+ letterSpacing: h.letterSpacing ? `${h.letterSpacing}em` : void 0,
333
+ padding: h.padding ? r(h.padding) : 0
334
334
  } : {},
335
- backgroundColor: f.backgroundColor,
336
- borderWidth: f.borderWidth ?? 0,
337
- borderColor: f.borderColor ?? "transparent",
338
- borderStyle: f.borderStyle ?? "solid",
339
- borderRadius: f.borderRadius,
340
- opacity: f.opacity,
341
- outline: d ? "1.5px solid var(--nice-primary-hover, #2563eb)" : "1px dashed transparent",
335
+ backgroundColor: h.backgroundColor,
336
+ borderWidth: h.borderWidth ?? 0,
337
+ borderColor: h.borderColor ?? "transparent",
338
+ borderStyle: h.borderStyle ?? "solid",
339
+ borderRadius: h.borderRadius,
340
+ opacity: h.opacity,
341
+ outline: m ? "1.5px solid var(--nice-primary-hover, #2563eb)" : "1px dashed transparent",
342
342
  outlineOffset: 1,
343
- cursor: I ? "default" : "move"
343
+ cursor: _ ? "default" : "move"
344
344
  };
345
- return /* @__PURE__ */ a("div", { style: i, onClick: S, onMouseDown: I ? void 0 : b, children: [
346
- z ? /* @__PURE__ */ e(
345
+ return /* @__PURE__ */ a("div", { style: i, onClick: C, onMouseDown: _ ? void 0 : v, children: [
346
+ S ? /* @__PURE__ */ e(
347
347
  "div",
348
348
  {
349
349
  style: {
350
350
  width: "100%",
351
- borderBottom: `${(f.borderWidth ?? 0.5) * l}px ${f.borderStyle ?? "solid"} ${f.borderColor ?? se}`
351
+ borderBottom: `${(h.borderWidth ?? 0.5) * o}px ${h.borderStyle ?? "solid"} ${h.borderColor ?? se}`
352
352
  }
353
353
  }
354
- ) : w ? null : L ? /* @__PURE__ */ e("div", { className: t.fieldImagePlaceholder, children: /* @__PURE__ */ e(N, { name: "image", size: 24 }) }) : r ? /* @__PURE__ */ a("div", { className: t.fieldBarcodePlaceholder, children: [
355
- /* @__PURE__ */ e(N, { name: n.type === "qr" ? "qr-code" : "barcode", size: 14 }),
354
+ ) : I ? null : x ? /* @__PURE__ */ e("div", { className: t.fieldImagePlaceholder, children: /* @__PURE__ */ e(w, { name: "image", size: 24 }) }) : s ? /* @__PURE__ */ a("div", { className: t.fieldBarcodePlaceholder, children: [
355
+ /* @__PURE__ */ e(w, { name: n.type === "qr" ? "qr-code" : "barcode", size: 14 }),
356
356
  " ",
357
- n.type === "qr" ? "QR" : "Barcode"
357
+ n.type === "qr" ? "QR" : b("templateEditor.barcode", "Barcode")
358
358
  ] }) : n.type === "signature" ? /* @__PURE__ */ a("div", { className: t.fieldSignaturePlaceholder, children: [
359
- /* @__PURE__ */ e(N, { name: "pen", size: 14 }),
359
+ /* @__PURE__ */ e(w, { name: "pen", size: 14 }),
360
360
  " ",
361
361
  n.label
362
- ] }) : /* @__PURE__ */ e("span", { style: { display: "block", width: "100%" }, children: Ma(n, o) }),
363
- d && !I && /* @__PURE__ */ e(Aa, { onResizeStart: m })
362
+ ] }) : /* @__PURE__ */ e("span", { style: { display: "block", width: "100%" }, children: Ma(n, l) }),
363
+ m && !_ && /* @__PURE__ */ e(Aa, { onResizeStart: g })
364
364
  ] });
365
- }, Ea = ({
365
+ }, Fa = ({
366
366
  section: n,
367
- zoom: l,
368
- paperWidthMm: d,
369
- selectedIds: o,
370
- sampleData: S,
371
- readOnly: b,
372
- showGrid: m,
373
- onFieldClick: I,
374
- onFieldDragStart: h,
375
- onResizeStart: f,
376
- onSectionHeightChange: s,
377
- onDropField: z
367
+ zoom: o,
368
+ paperWidthMm: m,
369
+ selectedIds: l,
370
+ sampleData: C,
371
+ readOnly: v,
372
+ showGrid: g,
373
+ onFieldClick: _,
374
+ onFieldDragStart: b,
375
+ onResizeStart: k,
376
+ onSectionHeightChange: h,
377
+ onDropField: r
378
378
  }) => {
379
- const w = (n.heightMm ?? (n.type === "body" ? 200 : 40)) * l * U, L = d * l * U, [r, i] = F(!1), _ = {
379
+ const S = (n.heightMm ?? (n.type === "body" ? 200 : 40)) * o * W, I = m * o * W, [x, s] = H(!1), i = {
380
+ // audit-allow: literal-color +3 — band tints on the white page - print colours
380
381
  header: "rgba(219,234,254,0.35)",
381
382
  footer: "rgba(220,252,231,0.35)",
382
383
  background: "rgba(254,249,195,0.35)",
@@ -385,56 +386,56 @@ const Pa = ({
385
386
  return /* @__PURE__ */ a(
386
387
  "div",
387
388
  {
388
- className: `${t.sectionCanvas} ${r ? t.sectionCanvasOver : ""}`,
389
+ className: `${t.sectionCanvas} ${x ? t.sectionCanvasOver : ""}`,
389
390
  style: {
390
- width: L,
391
- height: w,
391
+ width: I,
392
+ height: S,
392
393
  position: "relative",
393
- background: _[n.type] ?? "transparent",
394
- backgroundImage: m ? `repeating-linear-gradient(0deg, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 0, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 1px, transparent 1px, transparent ${5 * l * U}px),
395
- repeating-linear-gradient(90deg, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 0, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 1px, transparent 1px, transparent ${5 * l * U}px)` : void 0
394
+ background: i[n.type] ?? "transparent",
395
+ backgroundImage: g ? `repeating-linear-gradient(0deg, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 0, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 1px, transparent 1px, transparent ${5 * o * W}px),
396
+ repeating-linear-gradient(90deg, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 0, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 1px, transparent 1px, transparent ${5 * o * W}px)` : void 0
396
397
  },
397
- onDragOver: (p) => {
398
- p.preventDefault(), i(!0);
398
+ onDragOver: (d) => {
399
+ d.preventDefault(), s(!0);
399
400
  },
400
- onDragLeave: () => i(!1),
401
- onDrop: (p) => {
402
- p.preventDefault(), i(!1);
403
- const k = p.dataTransfer.getData("fieldPath");
404
- if (!k)
401
+ onDragLeave: () => s(!1),
402
+ onDrop: (d) => {
403
+ d.preventDefault(), s(!1);
404
+ const u = d.dataTransfer.getData("fieldPath");
405
+ if (!u)
405
406
  return;
406
- const H = p.currentTarget.getBoundingClientRect(), g = (p.clientX - H.left) / (l * U), $ = (p.clientY - H.top) / (l * U);
407
- z(n.id, k, Math.max(0, g), Math.max(0, $));
407
+ const z = d.currentTarget.getBoundingClientRect(), y = (d.clientX - z.left) / (o * W), R = (d.clientY - z.top) / (o * W);
408
+ r(n.id, u, Math.max(0, y), Math.max(0, R));
408
409
  },
409
410
  children: [
410
411
  /* @__PURE__ */ e("div", { className: t.sectionTypeChip, children: n.type }),
411
- n.fields.map((p) => /* @__PURE__ */ e(
412
+ n.fields.map((d) => /* @__PURE__ */ e(
412
413
  Pa,
413
414
  {
414
- field: p,
415
- zoom: l,
416
- selected: o.has(p.id),
417
- sampleData: S,
418
- readOnly: b,
419
- onClick: (k) => I(p.id, k),
420
- onDragStart: (k) => h(p.id, k),
421
- onResizeStart: (k, H) => f(p.id, k, H)
415
+ field: d,
416
+ zoom: o,
417
+ selected: l.has(d.id),
418
+ sampleData: C,
419
+ readOnly: v,
420
+ onClick: (u) => _(d.id, u),
421
+ onDragStart: (u) => b(d.id, u),
422
+ onResizeStart: (u, z) => k(d.id, u, z)
422
423
  },
423
- p.id
424
+ d.id
424
425
  )),
425
- !b && n.type !== "body" && /* @__PURE__ */ e(
426
+ !v && n.type !== "body" && /* @__PURE__ */ e(
426
427
  "div",
427
428
  {
428
429
  className: t.sectionResizeBar,
429
- onMouseDown: (p) => {
430
- p.preventDefault();
431
- const k = p.clientY, H = n.heightMm ?? 40, g = (v) => {
432
- const q = (v.clientY - k) / (l * U);
433
- s(n.id, Math.max(10, H + q));
434
- }, $ = () => {
435
- document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", $);
430
+ onMouseDown: (d) => {
431
+ d.preventDefault();
432
+ const u = d.clientY, z = n.heightMm ?? 40, y = (T) => {
433
+ const $ = (T.clientY - u) / (o * W);
434
+ h(n.id, Math.max(10, z + $));
435
+ }, R = () => {
436
+ document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", R);
436
437
  };
437
- document.addEventListener("mousemove", g), document.addEventListener("mouseup", $);
438
+ document.addEventListener("mousemove", y), document.addEventListener("mouseup", R);
438
439
  },
439
440
  children: /* @__PURE__ */ e("div", { className: t.sectionResizeGrip })
440
441
  }
@@ -442,45 +443,45 @@ const Pa = ({
442
443
  ]
443
444
  }
444
445
  );
445
- }, oe = ({ keys: n, label: l }) => /* @__PURE__ */ a("div", { className: t.shortcutChip, children: [
446
+ }, le = ({ keys: n, label: o }) => /* @__PURE__ */ a("div", { className: t.shortcutChip, children: [
446
447
  /* @__PURE__ */ e("span", { className: t.shortcutKeys, children: n }),
447
- /* @__PURE__ */ e("span", { className: t.shortcutLabel, children: l })
448
- ] }), Fa = [
448
+ /* @__PURE__ */ e("span", { className: t.shortcutLabel, children: o })
449
+ ] }), Ha = [
449
450
  { id: "fields", icon: "list", key: "printing.editor.tabFields", label: "Fields" },
450
451
  { id: "layers", icon: "layers", key: "printing.editor.tabLayers", label: "Layers" },
451
452
  { id: "watermarks", icon: "droplet", key: "printing.editor.tabWatermarks", label: "Watermarks" },
452
453
  { id: "signatures", icon: "pen", key: "printing.editor.tabSignatures", label: "Signatures" },
453
454
  { id: "settings", icon: "settings", key: "printing.editor.tabSettings", label: "Settings" }
454
- ], Ha = [
455
+ ], Ga = [
455
456
  { id: "position", key: "printing.editor.tabPosition", label: "Position" },
456
457
  { id: "style", key: "printing.editor.tabStyle", label: "Style" },
457
458
  { id: "data", key: "printing.editor.tabData", label: "Data" },
458
459
  { id: "conditional", key: "printing.editor.tabConditional", label: "Conditions" }
459
- ], Ga = ({
460
+ ], Oa = ({
460
461
  tpl: n,
461
- zoom: l,
462
- canUndo: d,
463
- canRedo: o,
464
- showGrid: S,
465
- showRulers: b,
466
- readOnly: m,
467
- selectedCount: I,
468
- onPaperChange: h,
469
- onZoom: f,
470
- onUndo: s,
471
- onRedo: z,
472
- onToggleGrid: w,
473
- onToggleRulers: L,
474
- onInsert: r,
475
- onDelete: i,
476
- onDuplicate: _,
477
- onAlignH: p,
478
- onAlignV: k,
479
- onBringForward: H,
480
- onSendBackward: g,
481
- onSave: $
462
+ zoom: o,
463
+ canUndo: m,
464
+ canRedo: l,
465
+ showGrid: C,
466
+ showRulers: v,
467
+ readOnly: g,
468
+ selectedCount: _,
469
+ onPaperChange: b,
470
+ onZoom: k,
471
+ onUndo: h,
472
+ onRedo: r,
473
+ onToggleGrid: S,
474
+ onToggleRulers: I,
475
+ onInsert: x,
476
+ onDelete: s,
477
+ onDuplicate: i,
478
+ onAlignH: d,
479
+ onAlignV: u,
480
+ onBringForward: z,
481
+ onSendBackward: y,
482
+ onSave: R
482
483
  }) => {
483
- const { t: v } = J(), [q, D] = F(!1), K = [0.5, 0.75, 1, 1.25, 1.5, 2];
484
+ const { t: T } = j(), { t: $ } = j(), [A, Y] = H(!1), Z = [0.5, 0.75, 1, 1.25, 1.5, 2];
484
485
  return /* @__PURE__ */ a("div", { className: t.toolbar, children: [
485
486
  /* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
486
487
  /* @__PURE__ */ e(
@@ -488,83 +489,83 @@ const Pa = ({
488
489
  {
489
490
  className: t.toolbarSelect,
490
491
  value: n.paperSize,
491
- onChange: (A) => h(A.target.value, n.orientation),
492
- children: ["A4", "A5", "A3", "Letter", "Legal", "Tabloid", "custom"].map((A) => /* @__PURE__ */ e("option", { value: A, children: A }, A))
492
+ onChange: (f) => b(f.target.value, n.orientation),
493
+ children: ["A4", "A5", "A3", "Letter", "Legal", "Tabloid", "custom"].map((f) => /* @__PURE__ */ e("option", { value: f, children: f }, f))
493
494
  }
494
495
  ),
495
496
  /* @__PURE__ */ e(
496
497
  "button",
497
498
  {
498
499
  className: `${t.toolbarBtn} ${n.orientation === "portrait" ? t.toolbarBtnActive : ""}`,
499
- onClick: () => h(n.paperSize, "portrait"),
500
- title: "Pion",
501
- children: /* @__PURE__ */ e(N, { name: "file", size: 14 })
500
+ onClick: () => b(n.paperSize, "portrait"),
501
+ title: T("templateEditor.portrait", "Portrait"),
502
+ children: /* @__PURE__ */ e(w, { name: "file", size: 14 })
502
503
  }
503
504
  ),
504
505
  /* @__PURE__ */ e(
505
506
  "button",
506
507
  {
507
508
  className: `${t.toolbarBtn} ${n.orientation === "landscape" ? t.toolbarBtnActive : ""}`,
508
- onClick: () => h(n.paperSize, "landscape"),
509
- title: "Poziom",
510
- children: /* @__PURE__ */ e(N, { name: "file", size: 14, style: { transform: "rotate(90deg)" } })
509
+ onClick: () => b(n.paperSize, "landscape"),
510
+ title: T("templateEditor.landscape", "Landscape"),
511
+ children: /* @__PURE__ */ e(w, { name: "file", size: 14, style: { transform: "rotate(90deg)" } })
511
512
  }
512
513
  )
513
514
  ] }),
514
- !m && /* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
515
+ !g && /* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
515
516
  /* @__PURE__ */ e(
516
517
  "button",
517
518
  {
518
519
  className: t.toolbarBtn,
519
- disabled: !d,
520
- onClick: s,
521
- title: `${v("printing.editor.undo", "Undo")} (Ctrl+Z)`,
522
- children: /* @__PURE__ */ e(N, { name: "undo", size: 14 })
520
+ disabled: !m,
521
+ onClick: h,
522
+ title: `${$("printing.editor.undo", "Undo")} (Ctrl+Z)`,
523
+ children: /* @__PURE__ */ e(w, { name: "undo", size: 14 })
523
524
  }
524
525
  ),
525
526
  /* @__PURE__ */ e(
526
527
  "button",
527
528
  {
528
529
  className: t.toolbarBtn,
529
- disabled: !o,
530
- onClick: z,
531
- title: `${v("printing.editor.redo", "Redo")} (Ctrl+Y)`,
532
- children: /* @__PURE__ */ e(N, { name: "redo", size: 14 })
530
+ disabled: !l,
531
+ onClick: r,
532
+ title: `${$("printing.editor.redo", "Redo")} (Ctrl+Y)`,
533
+ children: /* @__PURE__ */ e(w, { name: "redo", size: 14 })
533
534
  }
534
535
  )
535
536
  ] }),
536
- !m && /* @__PURE__ */ a("div", { className: t.insertWrapper, children: [
537
+ !g && /* @__PURE__ */ a("div", { className: t.insertWrapper, children: [
537
538
  /* @__PURE__ */ a(
538
539
  "button",
539
540
  {
540
541
  className: `${t.toolbarBtn} ${t.insertBtn}`,
541
- onClick: () => D((A) => !A),
542
+ onClick: () => Y((f) => !f),
542
543
  children: [
543
- /* @__PURE__ */ e(N, { name: "plus", size: 14 }),
544
+ /* @__PURE__ */ e(w, { name: "plus", size: 14 }),
544
545
  " ",
545
- v("printing.editor.insert", "Insert"),
546
+ $("printing.editor.insert", "Insert"),
546
547
  " ",
547
- /* @__PURE__ */ e(N, { name: "chevron-down", size: 12 })
548
+ /* @__PURE__ */ e(w, { name: "chevron-down", size: 12 })
548
549
  ]
549
550
  }
550
551
  ),
551
- q && /* @__PURE__ */ a("div", { className: t.insertDropdown, onMouseLeave: () => D(!1), children: [
552
- /* @__PURE__ */ e("div", { className: t.insertCategory, children: v("printing.editor.dataFields", "Data fields") }),
553
- ["text", "number", "currency", "date", "image", "barcode", "qr"].map((A) => /* @__PURE__ */ a(
552
+ A && /* @__PURE__ */ a("div", { className: t.insertDropdown, onMouseLeave: () => Y(!1), children: [
553
+ /* @__PURE__ */ e("div", { className: t.insertCategory, children: $("printing.editor.dataFields", "Data fields") }),
554
+ ["text", "number", "currency", "date", "image", "barcode", "qr"].map((f) => /* @__PURE__ */ a(
554
555
  "button",
555
556
  {
556
557
  className: t.insertItem,
557
558
  onClick: () => {
558
- r(A), D(!1);
559
+ x(f), Y(!1);
559
560
  },
560
561
  children: [
561
- /* @__PURE__ */ e("span", { className: t.insertIcon, children: he[A] }),
562
- we(v, A)
562
+ /* @__PURE__ */ e("span", { className: t.insertIcon, children: he[f] }),
563
+ we($, f)
563
564
  ]
564
565
  },
565
- A
566
+ f
566
567
  )),
567
- /* @__PURE__ */ e("div", { className: t.insertCategory, children: "Elementy statyczne" }),
568
+ /* @__PURE__ */ e("div", { className: t.insertCategory, children: T("templateEditor.staticElements", "Static elements") }),
568
569
  [
569
570
  "static_text",
570
571
  "static_image",
@@ -573,31 +574,31 @@ const Pa = ({
573
574
  "page_number",
574
575
  "total_pages",
575
576
  "print_date"
576
- ].map((A) => /* @__PURE__ */ a(
577
+ ].map((f) => /* @__PURE__ */ a(
577
578
  "button",
578
579
  {
579
580
  className: t.insertItem,
580
581
  onClick: () => {
581
- r(A), D(!1);
582
+ x(f), Y(!1);
582
583
  },
583
584
  children: [
584
- /* @__PURE__ */ e("span", { className: t.insertIcon, children: he[A] }),
585
- we(v, A)
585
+ /* @__PURE__ */ e("span", { className: t.insertIcon, children: he[f] }),
586
+ we($, f)
586
587
  ]
587
588
  },
588
- A
589
+ f
589
590
  )),
590
- /* @__PURE__ */ e("div", { className: t.insertCategory, children: "Specjalne" }),
591
+ /* @__PURE__ */ e("div", { className: t.insertCategory, children: T("templateEditor.special", "Special") }),
591
592
  /* @__PURE__ */ a(
592
593
  "button",
593
594
  {
594
595
  className: t.insertItem,
595
596
  onClick: () => {
596
- r("watermark"), D(!1);
597
+ x("watermark"), Y(!1);
597
598
  },
598
599
  children: [
599
- /* @__PURE__ */ e("span", { className: t.insertIcon, children: /* @__PURE__ */ e(N, { name: "droplet", size: 14 }) }),
600
- v("printing.editor.watermark", "Watermark")
600
+ /* @__PURE__ */ e("span", { className: t.insertIcon, children: /* @__PURE__ */ e(w, { name: "droplet", size: 14 }) }),
601
+ $("printing.editor.watermark", "Watermark")
601
602
  ]
602
603
  }
603
604
  ),
@@ -606,33 +607,33 @@ const Pa = ({
606
607
  {
607
608
  className: t.insertItem,
608
609
  onClick: () => {
609
- r("signature"), D(!1);
610
+ x("signature"), Y(!1);
610
611
  },
611
612
  children: [
612
- /* @__PURE__ */ e("span", { className: t.insertIcon, children: /* @__PURE__ */ e(N, { name: "pen", size: 14 }) }),
613
- v("printing.editor.signature", "Signature")
613
+ /* @__PURE__ */ e("span", { className: t.insertIcon, children: /* @__PURE__ */ e(w, { name: "pen", size: 14 }) }),
614
+ $("printing.editor.signature", "Signature")
614
615
  ]
615
616
  }
616
617
  )
617
618
  ] })
618
619
  ] }),
619
- !m && I > 0 && /* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
620
+ !g && _ > 0 && /* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
620
621
  /* @__PURE__ */ e(
621
622
  "button",
622
623
  {
623
624
  className: t.toolbarBtn,
624
- onClick: _,
625
- title: `${v("printing.editor.duplicate", "Duplicate")} (Ctrl+D)`,
626
- children: /* @__PURE__ */ e(N, { name: "copy", size: 14 })
625
+ onClick: i,
626
+ title: `${$("printing.editor.duplicate", "Duplicate")} (Ctrl+D)`,
627
+ children: /* @__PURE__ */ e(w, { name: "copy", size: 14 })
627
628
  }
628
629
  ),
629
630
  /* @__PURE__ */ e(
630
631
  "button",
631
632
  {
632
633
  className: `${t.toolbarBtn} ${t.toolbarBtnDanger}`,
633
- onClick: i,
634
- title: `${v("printing.action.remove", "Remove")} (Del)`,
635
- children: /* @__PURE__ */ e(N, { name: "trash", size: 14 })
634
+ onClick: s,
635
+ title: `${$("printing.action.remove", "Remove")} (Del)`,
636
+ children: /* @__PURE__ */ e(w, { name: "trash", size: 14 })
636
637
  }
637
638
  ),
638
639
  /* @__PURE__ */ e("span", { className: t.toolbarSep }),
@@ -640,35 +641,35 @@ const Pa = ({
640
641
  "button",
641
642
  {
642
643
  className: t.toolbarBtn,
643
- onClick: () => p("left"),
644
- title: v("printing.editor.alignLeft", "Align left"),
645
- children: /* @__PURE__ */ e(N, { name: "align-left", size: 14 })
644
+ onClick: () => d("left"),
645
+ title: $("printing.editor.alignLeft", "Align left"),
646
+ children: /* @__PURE__ */ e(w, { name: "align-left", size: 14 })
646
647
  }
647
648
  ),
648
649
  /* @__PURE__ */ e(
649
650
  "button",
650
651
  {
651
652
  className: t.toolbarBtn,
652
- onClick: () => p("center"),
653
- title: v("printing.editor.alignCenter", "Align centre"),
654
- children: /* @__PURE__ */ e(N, { name: "align-center", size: 14 })
653
+ onClick: () => d("center"),
654
+ title: $("printing.editor.alignCenter", "Align centre"),
655
+ children: /* @__PURE__ */ e(w, { name: "align-center", size: 14 })
655
656
  }
656
657
  ),
657
658
  /* @__PURE__ */ e(
658
659
  "button",
659
660
  {
660
661
  className: t.toolbarBtn,
661
- onClick: () => p("right"),
662
- title: v("printing.editor.alignRight", "Align right"),
663
- children: /* @__PURE__ */ e(N, { name: "align-right", size: 14 })
662
+ onClick: () => d("right"),
663
+ title: $("printing.editor.alignRight", "Align right"),
664
+ children: /* @__PURE__ */ e(w, { name: "align-right", size: 14 })
664
665
  }
665
666
  ),
666
667
  /* @__PURE__ */ e(
667
668
  "button",
668
669
  {
669
670
  className: t.toolbarBtn,
670
- onClick: () => k("top"),
671
- title: v("printing.editor.alignTop", "Align top"),
671
+ onClick: () => u("top"),
672
+ title: $("printing.editor.alignTop", "Align top"),
672
673
  children: "⊤"
673
674
  }
674
675
  ),
@@ -676,8 +677,8 @@ const Pa = ({
676
677
  "button",
677
678
  {
678
679
  className: t.toolbarBtn,
679
- onClick: () => k("center"),
680
- title: v("printing.editor.alignMiddle", "Align middle"),
680
+ onClick: () => u("center"),
681
+ title: $("printing.editor.alignMiddle", "Align middle"),
681
682
  children: "⊕"
682
683
  }
683
684
  ),
@@ -685,20 +686,28 @@ const Pa = ({
685
686
  "button",
686
687
  {
687
688
  className: t.toolbarBtn,
688
- onClick: () => k("bottom"),
689
- title: v("printing.editor.alignBottom", "Align bottom"),
689
+ onClick: () => u("bottom"),
690
+ title: $("printing.editor.alignBottom", "Align bottom"),
690
691
  children: "⊥"
691
692
  }
692
693
  ),
693
694
  /* @__PURE__ */ e("span", { className: t.toolbarSep }),
694
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: H, title: "Do przodu", children: /* @__PURE__ */ e(N, { name: "arrow-up", size: 14 }) }),
695
695
  /* @__PURE__ */ e(
696
696
  "button",
697
697
  {
698
698
  className: t.toolbarBtn,
699
- onClick: g,
700
- title: v("printing.editor.sendBackward", "Send backward"),
701
- children: /* @__PURE__ */ e(N, { name: "arrow-down", size: 14 })
699
+ onClick: z,
700
+ title: T("templateEditor.bringForward", "Bring forward"),
701
+ children: /* @__PURE__ */ e(w, { name: "arrow-up", size: 14 })
702
+ }
703
+ ),
704
+ /* @__PURE__ */ e(
705
+ "button",
706
+ {
707
+ className: t.toolbarBtn,
708
+ onClick: y,
709
+ title: $("printing.editor.sendBackward", "Send backward"),
710
+ children: /* @__PURE__ */ e(w, { name: "arrow-down", size: 14 })
702
711
  }
703
712
  )
704
713
  ] }),
@@ -706,140 +715,140 @@ const Pa = ({
706
715
  /* @__PURE__ */ e(
707
716
  "button",
708
717
  {
709
- className: `${t.toolbarBtn} ${S ? t.toolbarBtnActive : ""}`,
710
- onClick: w,
711
- title: v("printing.editor.grid", "Grid"),
718
+ className: `${t.toolbarBtn} ${C ? t.toolbarBtnActive : ""}`,
719
+ onClick: S,
720
+ title: $("printing.editor.grid", "Grid"),
712
721
  children: "⊞"
713
722
  }
714
723
  ),
715
724
  /* @__PURE__ */ e(
716
725
  "button",
717
726
  {
718
- className: `${t.toolbarBtn} ${b ? t.toolbarBtnActive : ""}`,
719
- onClick: L,
720
- title: v("printing.editor.rulers", "Rulers"),
721
- children: /* @__PURE__ */ e(N, { name: "ruler", size: 14 })
727
+ className: `${t.toolbarBtn} ${v ? t.toolbarBtnActive : ""}`,
728
+ onClick: I,
729
+ title: $("printing.editor.rulers", "Rulers"),
730
+ children: /* @__PURE__ */ e(w, { name: "ruler", size: 14 })
722
731
  }
723
732
  )
724
733
  ] }),
725
734
  /* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
726
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => f(Math.max(0.25, l - 0.1)), children: "−" }),
735
+ /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => k(Math.max(0.25, o - 0.1)), children: "−" }),
727
736
  /* @__PURE__ */ e(
728
737
  "select",
729
738
  {
730
739
  className: t.zoomSelect,
731
- value: K.includes(l) ? l : "",
732
- onChange: (A) => f(+A.target.value),
733
- children: K.map((A) => /* @__PURE__ */ a("option", { value: A, children: [
734
- Math.round(A * 100),
740
+ value: Z.includes(o) ? o : "",
741
+ onChange: (f) => k(+f.target.value),
742
+ children: Z.map((f) => /* @__PURE__ */ a("option", { value: f, children: [
743
+ Math.round(f * 100),
735
744
  "%"
736
- ] }, A))
745
+ ] }, f))
737
746
  }
738
747
  ),
739
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => f(Math.min(3, l + 0.1)), children: "+" }),
740
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => f(1), title: "100%", children: "⊡" })
748
+ /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => k(Math.min(3, o + 0.1)), children: "+" }),
749
+ /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => k(1), title: "100%", children: "⊡" })
741
750
  ] }),
742
- !m && $ && /* @__PURE__ */ a("button", { className: t.saveBtn, onClick: $, children: [
743
- /* @__PURE__ */ e(N, { name: "save", size: 14 }),
751
+ !g && R && /* @__PURE__ */ a("button", { className: t.saveBtn, onClick: R, children: [
752
+ /* @__PURE__ */ e(w, { name: "save", size: 14 }),
744
753
  " ",
745
- v("printing.editor.save", "Save")
754
+ $("printing.editor.save", "Save")
746
755
  ] })
747
756
  ] });
748
- }, Oa = ({
757
+ }, qa = ({
749
758
  activeTab: n,
750
- onTabChange: l,
751
- schema: d,
752
- tpl: o,
753
- allFields: S,
754
- selectedIds: b,
755
- onInsertSchemaField: m,
756
- onSelectField: I,
757
- onUpdateTpl: h,
758
- onReorderField: f
759
+ onTabChange: o,
760
+ schema: m,
761
+ tpl: l,
762
+ allFields: C,
763
+ selectedIds: v,
764
+ onInsertSchemaField: g,
765
+ onSelectField: _,
766
+ onUpdateTpl: b,
767
+ onReorderField: k
759
768
  }) => {
760
- const { t: s } = J(), [z, w] = F(""), L = d == null ? void 0 : d.fields.filter(
761
- (r) => r.label.toLowerCase().includes(z.toLowerCase()) || r.path.toLowerCase().includes(z.toLowerCase())
769
+ const { t: h } = j(), { t: r } = j(), [S, I] = H(""), x = m == null ? void 0 : m.fields.filter(
770
+ (s) => s.label.toLowerCase().includes(S.toLowerCase()) || s.path.toLowerCase().includes(S.toLowerCase())
762
771
  );
763
772
  return /* @__PURE__ */ a("div", { className: t.leftPanel, children: [
764
- /* @__PURE__ */ e("div", { className: t.leftTabs, children: Fa.map((r) => /* @__PURE__ */ a(
773
+ /* @__PURE__ */ e("div", { className: t.leftTabs, children: Ha.map((s) => /* @__PURE__ */ a(
765
774
  "button",
766
775
  {
767
- className: `${t.leftTab} ${n === r.id ? t.leftTabActive : ""}`,
768
- onClick: () => l(r.id),
769
- title: s(r.key, r.label),
776
+ className: `${t.leftTab} ${n === s.id ? t.leftTabActive : ""}`,
777
+ onClick: () => o(s.id),
778
+ title: r(s.key, s.label),
770
779
  children: [
771
- /* @__PURE__ */ e("span", { className: t.leftTabIcon, children: /* @__PURE__ */ e(N, { name: r.icon, size: 16 }) }),
772
- /* @__PURE__ */ e("span", { className: t.leftTabLabel, children: s(r.key, r.label) })
780
+ /* @__PURE__ */ e("span", { className: t.leftTabIcon, children: /* @__PURE__ */ e(w, { name: s.icon, size: 16 }) }),
781
+ /* @__PURE__ */ e("span", { className: t.leftTabLabel, children: r(s.key, s.label) })
773
782
  ]
774
783
  },
775
- r.id
784
+ s.id
776
785
  )) }),
777
786
  /* @__PURE__ */ a("div", { className: t.leftContent, children: [
778
- n === "fields" && /* @__PURE__ */ a(j, { children: [
779
- /* @__PURE__ */ e("div", { className: t.panelHeader, children: s("printing.editor.dataFields", "Data fields") }),
787
+ n === "fields" && /* @__PURE__ */ a(X, { children: [
788
+ /* @__PURE__ */ e("div", { className: t.panelHeader, children: r("printing.editor.dataFields", "Data fields") }),
780
789
  /* @__PURE__ */ e("div", { className: t.searchBox, children: /* @__PURE__ */ e(
781
790
  "input",
782
791
  {
783
792
  className: t.searchInput,
784
- placeholder: s("printing.editor.search", "Search…"),
785
- value: z,
786
- onChange: (r) => w(r.target.value)
793
+ placeholder: r("printing.editor.search", "Search…"),
794
+ value: S,
795
+ onChange: (s) => I(s.target.value)
787
796
  }
788
797
  ) }),
789
- d ? /* @__PURE__ */ a("div", { className: t.fieldList, children: [
790
- (L ?? []).map((r) => /* @__PURE__ */ a(
798
+ m ? /* @__PURE__ */ a("div", { className: t.fieldList, children: [
799
+ (x ?? []).map((s) => /* @__PURE__ */ a(
791
800
  "div",
792
801
  {
793
802
  className: t.fieldItem,
794
803
  draggable: !0,
795
804
  onDragStart: (i) => {
796
- i.dataTransfer.setData("fieldPath", r.path), i.dataTransfer.setData("fieldLabel", r.label), i.dataTransfer.setData("fieldType", r.type);
805
+ i.dataTransfer.setData("fieldPath", s.path), i.dataTransfer.setData("fieldLabel", s.label), i.dataTransfer.setData("fieldType", s.type);
797
806
  },
798
- onClick: () => m(r),
807
+ onClick: () => g(s),
799
808
  children: [
800
- /* @__PURE__ */ e("span", { className: t.fieldItemIcon, children: /* @__PURE__ */ e(N, { name: he[r.type] ?? "type", size: 14 }) }),
809
+ /* @__PURE__ */ e("span", { className: t.fieldItemIcon, children: /* @__PURE__ */ e(w, { name: he[s.type] ?? "type", size: 14 }) }),
801
810
  /* @__PURE__ */ a("div", { className: t.fieldItemInfo, children: [
802
- /* @__PURE__ */ e("div", { className: t.fieldItemLabel, children: r.label }),
803
- /* @__PURE__ */ e("div", { className: t.fieldItemPath, children: r.path })
811
+ /* @__PURE__ */ e("div", { className: t.fieldItemLabel, children: s.label }),
812
+ /* @__PURE__ */ e("div", { className: t.fieldItemPath, children: s.path })
804
813
  ] }),
805
- /* @__PURE__ */ e("span", { className: t.fieldItemType, children: r.type })
814
+ /* @__PURE__ */ e("span", { className: t.fieldItemType, children: s.type })
806
815
  ]
807
816
  },
808
- r.path
817
+ s.path
809
818
  )),
810
- (L == null ? void 0 : L.length) === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: s("printing.editor.noMatches", "No matches") })
811
- ] }) : /* @__PURE__ */ e("div", { className: t.emptyMsg, children: s(
819
+ (x == null ? void 0 : x.length) === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: r("printing.editor.noMatches", "No matches") })
820
+ ] }) : /* @__PURE__ */ e("div", { className: t.emptyMsg, children: r(
812
821
  "printing.editor.noSchema",
813
822
  "No data schema. Assign an entity in the Settings tab."
814
823
  ) })
815
824
  ] }),
816
- n === "layers" && /* @__PURE__ */ a(j, { children: [
825
+ n === "layers" && /* @__PURE__ */ a(X, { children: [
817
826
  /* @__PURE__ */ a("div", { className: t.panelHeader, children: [
818
- s("printing.editor.layers", "Layers"),
827
+ r("printing.editor.layers", "Layers"),
819
828
  " (",
820
- S.length,
829
+ C.length,
821
830
  ")"
822
831
  ] }),
823
832
  /* @__PURE__ */ a("div", { className: t.layerList, children: [
824
- S.length === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: s("printing.editor.noElements", "No elements") }),
825
- S.slice().reverse().map((r) => /* @__PURE__ */ a(
833
+ C.length === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: r("printing.editor.noElements", "No elements") }),
834
+ C.slice().reverse().map((s) => /* @__PURE__ */ a(
826
835
  "div",
827
836
  {
828
- className: `${t.layerItem} ${b.has(r.id) ? t.layerItemSelected : ""}`,
829
- onClick: () => I(r.id),
837
+ className: `${t.layerItem} ${v.has(s.id) ? t.layerItemSelected : ""}`,
838
+ onClick: () => _(s.id),
830
839
  children: [
831
- /* @__PURE__ */ e("span", { className: t.layerIcon, children: /* @__PURE__ */ e(N, { name: he[r.type] ?? "type", size: 14 }) }),
832
- /* @__PURE__ */ e("span", { className: t.layerName, children: r.name || r.label }),
840
+ /* @__PURE__ */ e("span", { className: t.layerIcon, children: /* @__PURE__ */ e(w, { name: he[s.type] ?? "type", size: 14 }) }),
841
+ /* @__PURE__ */ e("span", { className: t.layerName, children: s.name || s.label }),
833
842
  /* @__PURE__ */ a("div", { className: t.layerActions, children: [
834
843
  /* @__PURE__ */ e(
835
844
  "button",
836
845
  {
837
846
  className: t.layerBtn,
838
847
  onClick: (i) => {
839
- i.stopPropagation(), f(r.id, -1);
848
+ i.stopPropagation(), k(s.id, -1);
840
849
  },
841
- title: s("printing.editor.bringForward", "Bring forward"),
842
- children: /* @__PURE__ */ e(N, { name: "arrow-up", size: 12 })
850
+ title: r("printing.editor.bringForward", "Bring forward"),
851
+ children: /* @__PURE__ */ e(w, { name: "arrow-up", size: 12 })
843
852
  }
844
853
  ),
845
854
  /* @__PURE__ */ e(
@@ -847,57 +856,57 @@ const Pa = ({
847
856
  {
848
857
  className: t.layerBtn,
849
858
  onClick: (i) => {
850
- i.stopPropagation(), f(r.id, 1);
859
+ i.stopPropagation(), k(s.id, 1);
851
860
  },
852
- title: s("printing.editor.sendBackward", "Send backward"),
853
- children: /* @__PURE__ */ e(N, { name: "arrow-down", size: 12 })
861
+ title: r("printing.editor.sendBackward", "Send backward"),
862
+ children: /* @__PURE__ */ e(w, { name: "arrow-down", size: 12 })
854
863
  }
855
864
  )
856
865
  ] })
857
866
  ]
858
867
  },
859
- r.id
868
+ s.id
860
869
  ))
861
870
  ] })
862
871
  ] }),
863
- n === "watermarks" && /* @__PURE__ */ a(j, { children: [
864
- /* @__PURE__ */ e("div", { className: t.panelHeader, children: "Znaki wodne" }),
872
+ n === "watermarks" && /* @__PURE__ */ a(X, { children: [
873
+ /* @__PURE__ */ e("div", { className: t.panelHeader, children: h("templateEditor.watermarks", "Watermarks") }),
865
874
  /* @__PURE__ */ a("div", { className: t.wmList, children: [
866
- (o.watermarks ?? []).map((r) => /* @__PURE__ */ a("div", { className: t.wmItem, children: [
875
+ (l.watermarks ?? []).map((s) => /* @__PURE__ */ a("div", { className: t.wmItem, children: [
867
876
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
868
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: s("printing.editor.type", "Type") }),
877
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.type", "Type") }),
869
878
  /* @__PURE__ */ a(
870
879
  "select",
871
880
  {
872
881
  className: t.wmSelect,
873
- value: r.type,
882
+ value: s.type,
874
883
  onChange: (i) => {
875
- var _;
876
- return h({
877
- watermarks: (_ = o.watermarks) == null ? void 0 : _.map(
878
- (p) => p.id === r.id ? { ...p, type: i.target.value } : p
884
+ var d;
885
+ return b({
886
+ watermarks: (d = l.watermarks) == null ? void 0 : d.map(
887
+ (u) => u.id === s.id ? { ...u, type: i.target.value } : u
879
888
  )
880
889
  });
881
890
  },
882
891
  children: [
883
- /* @__PURE__ */ e("option", { value: "text", children: s("printing.fieldType.text", "Text") }),
884
- /* @__PURE__ */ e("option", { value: "image", children: s("printing.fieldType.image", "Image") })
892
+ /* @__PURE__ */ e("option", { value: "text", children: r("printing.fieldType.text", "Text") }),
893
+ /* @__PURE__ */ e("option", { value: "image", children: r("printing.fieldType.image", "Image") })
885
894
  ]
886
895
  }
887
896
  )
888
897
  ] }),
889
- r.type === "text" && /* @__PURE__ */ a("div", { className: t.wmRow, children: [
890
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: s("printing.fieldType.text", "Text") }),
898
+ s.type === "text" && /* @__PURE__ */ a("div", { className: t.wmRow, children: [
899
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.fieldType.text", "Text") }),
891
900
  /* @__PURE__ */ e(
892
901
  "input",
893
902
  {
894
903
  className: t.wmInput,
895
- value: r.text ?? "",
904
+ value: s.text ?? "",
896
905
  onChange: (i) => {
897
- var _;
898
- return h({
899
- watermarks: (_ = o.watermarks) == null ? void 0 : _.map(
900
- (p) => p.id === r.id ? { ...p, text: i.target.value } : p
906
+ var d;
907
+ return b({
908
+ watermarks: (d = l.watermarks) == null ? void 0 : d.map(
909
+ (u) => u.id === s.id ? { ...u, text: i.target.value } : u
901
910
  )
902
911
  });
903
912
  }
@@ -905,7 +914,7 @@ const Pa = ({
905
914
  )
906
915
  ] }),
907
916
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
908
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: "Krycie" }),
917
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: h("templateEditor.opacity", "Opacity") }),
909
918
  /* @__PURE__ */ e(
910
919
  "input",
911
920
  {
@@ -914,24 +923,24 @@ const Pa = ({
914
923
  max: 0.5,
915
924
  step: 0.01,
916
925
  className: t.wmSlider,
917
- value: r.opacity,
926
+ value: s.opacity,
918
927
  onChange: (i) => {
919
- var _;
920
- return h({
921
- watermarks: (_ = o.watermarks) == null ? void 0 : _.map(
922
- (p) => p.id === r.id ? { ...p, opacity: +i.target.value } : p
928
+ var d;
929
+ return b({
930
+ watermarks: (d = l.watermarks) == null ? void 0 : d.map(
931
+ (u) => u.id === s.id ? { ...u, opacity: +i.target.value } : u
923
932
  )
924
933
  });
925
934
  }
926
935
  }
927
936
  ),
928
937
  /* @__PURE__ */ a("span", { className: t.wmValue, children: [
929
- Math.round(r.opacity * 100),
938
+ Math.round(s.opacity * 100),
930
939
  "%"
931
940
  ] })
932
941
  ] }),
933
942
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
934
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: s("printing.editor.angle", "Angle") }),
943
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.angle", "Angle") }),
935
944
  /* @__PURE__ */ e(
936
945
  "input",
937
946
  {
@@ -940,24 +949,24 @@ const Pa = ({
940
949
  max: 90,
941
950
  step: 5,
942
951
  className: t.wmSlider,
943
- value: r.angle,
952
+ value: s.angle,
944
953
  onChange: (i) => {
945
- var _;
946
- return h({
947
- watermarks: (_ = o.watermarks) == null ? void 0 : _.map(
948
- (p) => p.id === r.id ? { ...p, angle: +i.target.value } : p
954
+ var d;
955
+ return b({
956
+ watermarks: (d = l.watermarks) == null ? void 0 : d.map(
957
+ (u) => u.id === s.id ? { ...u, angle: +i.target.value } : u
949
958
  )
950
959
  });
951
960
  }
952
961
  }
953
962
  ),
954
963
  /* @__PURE__ */ a("span", { className: t.wmValue, children: [
955
- r.angle,
964
+ s.angle,
956
965
  "°"
957
966
  ] })
958
967
  ] }),
959
968
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
960
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: s("printing.editor.size", "Size") }),
969
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.size", "Size") }),
961
970
  /* @__PURE__ */ e(
962
971
  "input",
963
972
  {
@@ -965,12 +974,12 @@ const Pa = ({
965
974
  min: 8,
966
975
  max: 200,
967
976
  className: t.wmInputNum,
968
- value: r.fontSize ?? 48,
977
+ value: s.fontSize ?? 48,
969
978
  onChange: (i) => {
970
- var _;
971
- return h({
972
- watermarks: (_ = o.watermarks) == null ? void 0 : _.map(
973
- (p) => p.id === r.id ? { ...p, fontSize: +i.target.value } : p
979
+ var d;
980
+ return b({
981
+ watermarks: (d = l.watermarks) == null ? void 0 : d.map(
982
+ (u) => u.id === s.id ? { ...u, fontSize: +i.target.value } : u
974
983
  )
975
984
  });
976
985
  }
@@ -979,18 +988,18 @@ const Pa = ({
979
988
  /* @__PURE__ */ e("span", { className: t.wmUnit, children: "pt" })
980
989
  ] }),
981
990
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
982
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: s("printing.editor.colour", "Colour") }),
991
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.colour", "Colour") }),
983
992
  /* @__PURE__ */ e(
984
993
  "input",
985
994
  {
986
995
  type: "color",
987
996
  className: t.colorPicker,
988
- value: r.color ?? ge,
997
+ value: s.color ?? be,
989
998
  onChange: (i) => {
990
- var _;
991
- return h({
992
- watermarks: (_ = o.watermarks) == null ? void 0 : _.map(
993
- (p) => p.id === r.id ? { ...p, color: i.target.value } : p
999
+ var d;
1000
+ return b({
1001
+ watermarks: (d = l.watermarks) == null ? void 0 : d.map(
1002
+ (u) => u.id === s.id ? { ...u, color: i.target.value } : u
994
1003
  )
995
1004
  });
996
1005
  }
@@ -1003,55 +1012,55 @@ const Pa = ({
1003
1012
  className: t.wmDelete,
1004
1013
  onClick: () => {
1005
1014
  var i;
1006
- return h({ watermarks: (i = o.watermarks) == null ? void 0 : i.filter((_) => _.id !== r.id) });
1015
+ return b({ watermarks: (i = l.watermarks) == null ? void 0 : i.filter((d) => d.id !== s.id) });
1007
1016
  },
1008
- children: s("printing.action.remove", "Remove")
1017
+ children: r("printing.action.remove", "Remove")
1009
1018
  }
1010
1019
  )
1011
- ] }, r.id)),
1020
+ ] }, s.id)),
1012
1021
  /* @__PURE__ */ a(
1013
1022
  "button",
1014
1023
  {
1015
1024
  className: t.addBtn,
1016
- onClick: () => h({
1025
+ onClick: () => b({
1017
1026
  watermarks: [
1018
- ...o.watermarks ?? [],
1027
+ ...l.watermarks ?? [],
1019
1028
  {
1020
1029
  id: ce(),
1021
1030
  type: "text",
1022
- text: "COPY",
1031
+ text: h("templateEditor.copy", "COPY"),
1023
1032
  opacity: 0.12,
1024
1033
  angle: -45,
1025
1034
  fontSize: 60,
1026
- color: ge
1035
+ color: be
1027
1036
  }
1028
1037
  ]
1029
1038
  }),
1030
1039
  children: [
1031
- /* @__PURE__ */ e(N, { name: "plus", size: 12 }),
1040
+ /* @__PURE__ */ e(w, { name: "plus", size: 12 }),
1032
1041
  " ",
1033
- s("printing.editor.addWatermark", "Add watermark")
1042
+ r("printing.editor.addWatermark", "Add watermark")
1034
1043
  ]
1035
1044
  }
1036
1045
  )
1037
1046
  ] })
1038
1047
  ] }),
1039
- n === "signatures" && /* @__PURE__ */ a(j, { children: [
1040
- /* @__PURE__ */ e("div", { className: t.panelHeader, children: "Podpisy" }),
1048
+ n === "signatures" && /* @__PURE__ */ a(X, { children: [
1049
+ /* @__PURE__ */ e("div", { className: t.panelHeader, children: h("templateEditor.signatures", "Signatures") }),
1041
1050
  /* @__PURE__ */ a("div", { className: t.wmList, children: [
1042
- (o.signatures ?? []).map((r) => /* @__PURE__ */ a("div", { className: t.wmItem, children: [
1051
+ (l.signatures ?? []).map((s) => /* @__PURE__ */ a("div", { className: t.wmItem, children: [
1043
1052
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
1044
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: "Etykieta" }),
1053
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: h("templateEditor.label", "Label") }),
1045
1054
  /* @__PURE__ */ e(
1046
1055
  "input",
1047
1056
  {
1048
1057
  className: t.wmInput,
1049
- value: r.label,
1058
+ value: s.label,
1050
1059
  onChange: (i) => {
1051
- var _;
1052
- return h({
1053
- signatures: (_ = o.signatures) == null ? void 0 : _.map(
1054
- (p) => p.id === r.id ? { ...p, label: i.target.value } : p
1060
+ var d;
1061
+ return b({
1062
+ signatures: (d = l.signatures) == null ? void 0 : d.map(
1063
+ (u) => u.id === s.id ? { ...u, label: i.target.value } : u
1055
1064
  )
1056
1065
  });
1057
1066
  }
@@ -1059,17 +1068,17 @@ const Pa = ({
1059
1068
  )
1060
1069
  ] }),
1061
1070
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
1062
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: "Nazwisko" }),
1071
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: h("templateEditor.signerName", "Name") }),
1063
1072
  /* @__PURE__ */ e(
1064
1073
  "input",
1065
1074
  {
1066
1075
  className: t.wmInput,
1067
- value: r.signerName ?? "",
1076
+ value: s.signerName ?? "",
1068
1077
  onChange: (i) => {
1069
- var _;
1070
- return h({
1071
- signatures: (_ = o.signatures) == null ? void 0 : _.map(
1072
- (p) => p.id === r.id ? { ...p, signerName: i.target.value } : p
1078
+ var d;
1079
+ return b({
1080
+ signatures: (d = l.signatures) == null ? void 0 : d.map(
1081
+ (u) => u.id === s.id ? { ...u, signerName: i.target.value } : u
1073
1082
  )
1074
1083
  });
1075
1084
  }
@@ -1077,17 +1086,17 @@ const Pa = ({
1077
1086
  )
1078
1087
  ] }),
1079
1088
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
1080
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: s("printing.fieldType.line", "Line") }),
1089
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.fieldType.line", "Line") }),
1081
1090
  /* @__PURE__ */ e(
1082
1091
  "input",
1083
1092
  {
1084
1093
  type: "checkbox",
1085
- checked: r.showLine ?? !0,
1094
+ checked: s.showLine ?? !0,
1086
1095
  onChange: (i) => {
1087
- var _;
1088
- return h({
1089
- signatures: (_ = o.signatures) == null ? void 0 : _.map(
1090
- (p) => p.id === r.id ? { ...p, showLine: i.target.checked } : p
1096
+ var d;
1097
+ return b({
1098
+ signatures: (d = l.signatures) == null ? void 0 : d.map(
1099
+ (u) => u.id === s.id ? { ...u, showLine: i.target.checked } : u
1091
1100
  )
1092
1101
  });
1093
1102
  }
@@ -1095,17 +1104,17 @@ const Pa = ({
1095
1104
  )
1096
1105
  ] }),
1097
1106
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
1098
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: s("printing.editor.showDate", "Show date") }),
1107
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.showDate", "Show date") }),
1099
1108
  /* @__PURE__ */ e(
1100
1109
  "input",
1101
1110
  {
1102
1111
  type: "checkbox",
1103
- checked: r.showDate ?? !1,
1112
+ checked: s.showDate ?? !1,
1104
1113
  onChange: (i) => {
1105
- var _;
1106
- return h({
1107
- signatures: (_ = o.signatures) == null ? void 0 : _.map(
1108
- (p) => p.id === r.id ? { ...p, showDate: i.target.checked } : p
1114
+ var d;
1115
+ return b({
1116
+ signatures: (d = l.signatures) == null ? void 0 : d.map(
1117
+ (u) => u.id === s.id ? { ...u, showDate: i.target.checked } : u
1109
1118
  )
1110
1119
  });
1111
1120
  }
@@ -1118,22 +1127,22 @@ const Pa = ({
1118
1127
  className: t.wmDelete,
1119
1128
  onClick: () => {
1120
1129
  var i;
1121
- return h({ signatures: (i = o.signatures) == null ? void 0 : i.filter((_) => _.id !== r.id) });
1130
+ return b({ signatures: (i = l.signatures) == null ? void 0 : i.filter((d) => d.id !== s.id) });
1122
1131
  },
1123
- children: s("printing.action.remove", "Remove")
1132
+ children: r("printing.action.remove", "Remove")
1124
1133
  }
1125
1134
  )
1126
- ] }, r.id)),
1135
+ ] }, s.id)),
1127
1136
  /* @__PURE__ */ a(
1128
1137
  "button",
1129
1138
  {
1130
1139
  className: t.addBtn,
1131
- onClick: () => h({
1140
+ onClick: () => b({
1132
1141
  signatures: [
1133
- ...o.signatures ?? [],
1142
+ ...l.signatures ?? [],
1134
1143
  {
1135
1144
  id: ce(),
1136
- label: s("printing.editor.signature", "Signature"),
1145
+ label: r("printing.editor.signature", "Signature"),
1137
1146
  position: { x: 10, y: 5, width: 70, height: 22 },
1138
1147
  showLine: !0,
1139
1148
  showDate: !1
@@ -1141,54 +1150,54 @@ const Pa = ({
1141
1150
  ]
1142
1151
  }),
1143
1152
  children: [
1144
- /* @__PURE__ */ e(N, { name: "plus", size: 12 }),
1153
+ /* @__PURE__ */ e(w, { name: "plus", size: 12 }),
1145
1154
  " ",
1146
- s("printing.editor.addSignature", "Add signature")
1155
+ r("printing.editor.addSignature", "Add signature")
1147
1156
  ]
1148
1157
  }
1149
1158
  )
1150
1159
  ] })
1151
1160
  ] }),
1152
- n === "settings" && /* @__PURE__ */ a(j, { children: [
1153
- /* @__PURE__ */ e("div", { className: t.panelHeader, children: s("printing.editor.templateSettings", "Template settings") }),
1161
+ n === "settings" && /* @__PURE__ */ a(X, { children: [
1162
+ /* @__PURE__ */ e("div", { className: t.panelHeader, children: r("printing.editor.templateSettings", "Template settings") }),
1154
1163
  /* @__PURE__ */ a("div", { className: t.settingsForm, children: [
1155
1164
  /* @__PURE__ */ a("div", { className: t.settingsRow, children: [
1156
- /* @__PURE__ */ e("label", { className: t.settingsLabel, children: s("printing.editor.name", "Name") }),
1165
+ /* @__PURE__ */ e("label", { className: t.settingsLabel, children: r("printing.editor.name", "Name") }),
1157
1166
  /* @__PURE__ */ e(
1158
1167
  "input",
1159
1168
  {
1160
1169
  className: t.settingsInput,
1161
- value: o.name,
1162
- onChange: (r) => h({ name: r.target.value })
1170
+ value: l.name,
1171
+ onChange: (s) => b({ name: s.target.value })
1163
1172
  }
1164
1173
  )
1165
1174
  ] }),
1166
1175
  /* @__PURE__ */ a("div", { className: t.settingsRow, children: [
1167
- /* @__PURE__ */ e("label", { className: t.settingsLabel, children: s("printing.editor.description", "Description") }),
1176
+ /* @__PURE__ */ e("label", { className: t.settingsLabel, children: r("printing.editor.description", "Description") }),
1168
1177
  /* @__PURE__ */ e(
1169
1178
  "textarea",
1170
1179
  {
1171
1180
  className: t.settingsTextarea,
1172
- value: o.description ?? "",
1173
- onChange: (r) => h({ description: r.target.value }),
1181
+ value: l.description ?? "",
1182
+ onChange: (s) => b({ description: s.target.value }),
1174
1183
  rows: 2
1175
1184
  }
1176
1185
  )
1177
1186
  ] }),
1178
1187
  /* @__PURE__ */ a("div", { className: t.settingsRow, children: [
1179
- /* @__PURE__ */ e("label", { className: t.settingsLabel, children: "Kategoria" }),
1188
+ /* @__PURE__ */ e("label", { className: t.settingsLabel, children: h("templateEditor.category", "Category") }),
1180
1189
  /* @__PURE__ */ e(
1181
1190
  "input",
1182
1191
  {
1183
1192
  className: t.settingsInput,
1184
- value: o.category ?? "",
1185
- onChange: (r) => h({ category: r.target.value })
1193
+ value: l.category ?? "",
1194
+ onChange: (s) => b({ category: s.target.value })
1186
1195
  }
1187
1196
  )
1188
1197
  ] }),
1189
- /* @__PURE__ */ e("div", { className: t.settingsDivider, children: s("printing.editor.margins", "Margins (mm)") }),
1190
- ["top", "right", "bottom", "left"].map((r) => /* @__PURE__ */ a("div", { className: t.settingsRow, children: [
1191
- /* @__PURE__ */ e("label", { className: t.settingsLabel, children: r === "top" ? s("printing.editor.marginTop", "Top") : r === "right" ? s("printing.editor.marginRight", "Right") : r === "bottom" ? s("printing.editor.marginBottom", "Bottom") : s("printing.editor.marginLeft", "Left") }),
1198
+ /* @__PURE__ */ e("div", { className: t.settingsDivider, children: r("printing.editor.margins", "Margins (mm)") }),
1199
+ ["top", "right", "bottom", "left"].map((s) => /* @__PURE__ */ a("div", { className: t.settingsRow, children: [
1200
+ /* @__PURE__ */ e("label", { className: t.settingsLabel, children: s === "top" ? r("printing.editor.marginTop", "Top") : s === "right" ? r("printing.editor.marginRight", "Right") : s === "bottom" ? r("printing.editor.marginBottom", "Bottom") : r("printing.editor.marginLeft", "Left") }),
1192
1201
  /* @__PURE__ */ e(
1193
1202
  "input",
1194
1203
  {
@@ -1197,51 +1206,51 @@ const Pa = ({
1197
1206
  max: 50,
1198
1207
  step: 1,
1199
1208
  className: t.settingsInputNum,
1200
- value: o.margins[r],
1201
- onChange: (i) => h({ margins: { ...o.margins, [r]: +i.target.value } })
1209
+ value: l.margins[s],
1210
+ onChange: (i) => b({ margins: { ...l.margins, [s]: +i.target.value } })
1202
1211
  }
1203
1212
  ),
1204
- /* @__PURE__ */ e("span", { className: t.settingsUnit, children: "mm" })
1205
- ] }, r))
1213
+ /* @__PURE__ */ e("span", { className: t.settingsUnit, children: h("templateEditor.mm", "mm") })
1214
+ ] }, s))
1206
1215
  ] })
1207
1216
  ] })
1208
1217
  ] })
1209
1218
  ] });
1210
- }, qa = ({
1219
+ }, Wa = ({
1211
1220
  field: n,
1212
- activeTab: l,
1213
- onTabChange: d,
1214
- onChange: o,
1215
- paperWidthMm: S,
1216
- paperHeightMm: b
1221
+ activeTab: o,
1222
+ onTabChange: m,
1223
+ onChange: l,
1224
+ paperWidthMm: C,
1225
+ paperHeightMm: v
1217
1226
  }) => {
1218
- var z, w, L, r;
1219
- const { t: m } = J(), I = M(
1220
- (i) => n && o({ position: { ...n.position, ...i } }),
1221
- [n, o]
1222
- ), h = M(
1223
- (i) => n && o({ style: { ...(n == null ? void 0 : n.style) ?? {}, ...i } }),
1224
- [n, o]
1227
+ var S, I, x, s;
1228
+ const { t: g } = j(), { t: _ } = j(), b = P(
1229
+ (i) => n && l({ position: { ...n.position, ...i } }),
1230
+ [n, l]
1231
+ ), k = P(
1232
+ (i) => n && l({ style: { ...(n == null ? void 0 : n.style) ?? {}, ...i } }),
1233
+ [n, l]
1225
1234
  );
1226
1235
  if (!n)
1227
1236
  return /* @__PURE__ */ a("div", { className: t.rightPanel, children: [
1228
- /* @__PURE__ */ e("div", { className: t.panelHeader, children: m("printing.editor.properties", "Properties") }),
1237
+ /* @__PURE__ */ e("div", { className: t.panelHeader, children: _("printing.editor.properties", "Properties") }),
1229
1238
  /* @__PURE__ */ a("div", { className: t.propsEmpty, children: [
1230
- /* @__PURE__ */ e("div", { className: t.propsEmptyIcon, children: /* @__PURE__ */ e(N, { name: "cursor", size: 28 }) }),
1231
- /* @__PURE__ */ e("div", { className: t.propsEmptyText, children: m("printing.editor.selectElement", "Select an element on the template") }),
1239
+ /* @__PURE__ */ e("div", { className: t.propsEmptyIcon, children: /* @__PURE__ */ e(w, { name: "cursor", size: 28 }) }),
1240
+ /* @__PURE__ */ e("div", { className: t.propsEmptyText, children: _("printing.editor.selectElement", "Select an element on the template") }),
1232
1241
  /* @__PURE__ */ a("div", { className: t.shortcutGrid, children: [
1233
- /* @__PURE__ */ e(oe, { keys: "Del", label: m("printing.action.remove", "Remove") }),
1234
- /* @__PURE__ */ e(oe, { keys: "Ctrl+D", label: m("printing.editor.duplicate", "Duplicate") }),
1235
- /* @__PURE__ */ e(oe, { keys: "↑↓←→", label: m("printing.editor.move", "Move") }),
1236
- /* @__PURE__ */ e(oe, { keys: "Ctrl+Z", label: m("printing.editor.undo", "Undo") }),
1237
- /* @__PURE__ */ e(oe, { keys: "Ctrl+A", label: m("printing.editor.selectAll", "Select all") }),
1238
- /* @__PURE__ */ e(oe, { keys: "Shift+↑", label: m("printing.editor.move5mm", "Move 5 mm") })
1242
+ /* @__PURE__ */ e(le, { keys: "Del", label: _("printing.action.remove", "Remove") }),
1243
+ /* @__PURE__ */ e(le, { keys: "Ctrl+D", label: _("printing.editor.duplicate", "Duplicate") }),
1244
+ /* @__PURE__ */ e(le, { keys: "↑↓←→", label: _("printing.editor.move", "Move") }),
1245
+ /* @__PURE__ */ e(le, { keys: "Ctrl+Z", label: _("printing.editor.undo", "Undo") }),
1246
+ /* @__PURE__ */ e(le, { keys: "Ctrl+A", label: _("printing.editor.selectAll", "Select all") }),
1247
+ /* @__PURE__ */ e(le, { keys: "Shift+↑", label: _("printing.editor.move5mm", "Move 5 mm") })
1239
1248
  ] })
1240
1249
  ] })
1241
1250
  ] });
1242
- const f = !["line", "rect", "image", "static_image", "barcode", "qr", "signature"].includes(
1251
+ const h = !["line", "rect", "image", "static_image", "barcode", "qr", "signature"].includes(
1243
1252
  n.type
1244
- ), s = ![
1253
+ ), r = ![
1245
1254
  "static_text",
1246
1255
  "static_image",
1247
1256
  "line",
@@ -1255,25 +1264,25 @@ const Pa = ({
1255
1264
  /* @__PURE__ */ e("span", { className: t.panelHeaderIcon, children: he[n.type] }),
1256
1265
  /* @__PURE__ */ e("span", { className: t.panelHeaderName, children: n.name })
1257
1266
  ] }),
1258
- /* @__PURE__ */ e("div", { className: t.rightTabs, children: Ha.map((i) => i.id === "data" && !s ? null : /* @__PURE__ */ e(
1267
+ /* @__PURE__ */ e("div", { className: t.rightTabs, children: Ga.map((i) => i.id === "data" && !r ? null : /* @__PURE__ */ e(
1259
1268
  "button",
1260
1269
  {
1261
- className: `${t.rightTab} ${l === i.id ? t.rightTabActive : ""}`,
1262
- onClick: () => d(i.id),
1263
- children: m(i.key, i.label)
1270
+ className: `${t.rightTab} ${o === i.id ? t.rightTabActive : ""}`,
1271
+ onClick: () => m(i.id),
1272
+ children: _(i.key, i.label)
1264
1273
  },
1265
1274
  i.id
1266
1275
  )) }),
1267
1276
  /* @__PURE__ */ a("div", { className: t.propsBody, children: [
1268
- l === "position" && /* @__PURE__ */ a(j, { children: [
1277
+ o === "position" && /* @__PURE__ */ a(X, { children: [
1269
1278
  /* @__PURE__ */ a("div", { className: t.posGrid, children: [
1270
1279
  [
1271
1280
  { key: "x", label: "X", unit: "mm" },
1272
1281
  { key: "y", label: "Y", unit: "mm" },
1273
- { key: "width", label: "Szer.", unit: "mm" },
1274
- { key: "height", label: "Wys.", unit: "mm" }
1275
- ].map(({ key: i, label: _, unit: p }) => /* @__PURE__ */ a("div", { className: t.posCell, children: [
1276
- /* @__PURE__ */ e("label", { className: t.posLabel, children: _ }),
1282
+ { key: "width", label: g("templateEditor.widthShort", "W"), unit: "mm" },
1283
+ { key: "height", label: g("templateEditor.heightShort", "H"), unit: "mm" }
1284
+ ].map(({ key: i, label: d, unit: u }) => /* @__PURE__ */ a("div", { className: t.posCell, children: [
1285
+ /* @__PURE__ */ e("label", { className: t.posLabel, children: d }),
1277
1286
  /* @__PURE__ */ e(
1278
1287
  "input",
1279
1288
  {
@@ -1281,13 +1290,13 @@ const Pa = ({
1281
1290
  step: 0.5,
1282
1291
  className: t.posInput,
1283
1292
  value: Math.round(n.position[i] * 10) / 10,
1284
- onChange: (k) => I({ [i]: +k.target.value })
1293
+ onChange: (z) => b({ [i]: +z.target.value })
1285
1294
  }
1286
1295
  ),
1287
- /* @__PURE__ */ e("span", { className: t.posUnit, children: p })
1296
+ /* @__PURE__ */ e("span", { className: t.posUnit, children: u })
1288
1297
  ] }, i)),
1289
1298
  /* @__PURE__ */ a("div", { className: t.posCell, children: [
1290
- /* @__PURE__ */ e("label", { className: t.posLabel, children: m("printing.editor.rotation", "Rotation") }),
1299
+ /* @__PURE__ */ e("label", { className: t.posLabel, children: _("printing.editor.rotation", "Rotation") }),
1291
1300
  /* @__PURE__ */ e(
1292
1301
  "input",
1293
1302
  {
@@ -1295,13 +1304,13 @@ const Pa = ({
1295
1304
  step: 5,
1296
1305
  className: t.posInput,
1297
1306
  value: n.style.rotation ?? 0,
1298
- onChange: (i) => h({ rotation: +i.target.value })
1307
+ onChange: (i) => k({ rotation: +i.target.value })
1299
1308
  }
1300
1309
  ),
1301
1310
  /* @__PURE__ */ e("span", { className: t.posUnit, children: "°" })
1302
1311
  ] }),
1303
1312
  /* @__PURE__ */ a("div", { className: t.posCell, children: [
1304
- /* @__PURE__ */ e("label", { className: t.posLabel, children: "Z-idx" }),
1313
+ /* @__PURE__ */ e("label", { className: t.posLabel, children: g("templateEditor.zIdx", "Z-idx") }),
1305
1314
  /* @__PURE__ */ e(
1306
1315
  "input",
1307
1316
  {
@@ -1310,29 +1319,29 @@ const Pa = ({
1310
1319
  min: 1,
1311
1320
  className: t.posInput,
1312
1321
  value: n.position.zIndex ?? 1,
1313
- onChange: (i) => I({ zIndex: +i.target.value })
1322
+ onChange: (i) => b({ zIndex: +i.target.value })
1314
1323
  }
1315
1324
  )
1316
1325
  ] })
1317
1326
  ] }),
1318
1327
  /* @__PURE__ */ a("div", { className: t.snapSection, children: [
1319
- /* @__PURE__ */ e("div", { className: t.snapTitle, children: m("printing.editor.snapToPage", "Snap to page") }),
1328
+ /* @__PURE__ */ e("div", { className: t.snapTitle, children: _("printing.editor.snapToPage", "Snap to page") }),
1320
1329
  /* @__PURE__ */ a("div", { className: t.snapRow, children: [
1321
1330
  /* @__PURE__ */ e(
1322
1331
  "button",
1323
1332
  {
1324
1333
  className: t.snapBtn,
1325
- onClick: () => I({ x: 0 }),
1326
- title: m("printing.editor.leftEdge", "Left edge"),
1327
- children: /* @__PURE__ */ e(N, { name: "align-left", size: 14 })
1334
+ onClick: () => b({ x: 0 }),
1335
+ title: _("printing.editor.leftEdge", "Left edge"),
1336
+ children: /* @__PURE__ */ e(w, { name: "align-left", size: 14 })
1328
1337
  }
1329
1338
  ),
1330
1339
  /* @__PURE__ */ e(
1331
1340
  "button",
1332
1341
  {
1333
1342
  className: t.snapBtn,
1334
- onClick: () => I({ x: (S - n.position.width) / 2 }),
1335
- title: m("printing.editor.horizontalCentre", "Horizontal centre"),
1343
+ onClick: () => b({ x: (C - n.position.width) / 2 }),
1344
+ title: _("printing.editor.horizontalCentre", "Horizontal centre"),
1336
1345
  children: "⊕"
1337
1346
  }
1338
1347
  ),
@@ -1340,37 +1349,37 @@ const Pa = ({
1340
1349
  "button",
1341
1350
  {
1342
1351
  className: t.snapBtn,
1343
- onClick: () => I({ x: S - n.position.width }),
1344
- title: m("printing.editor.rightEdge", "Right edge"),
1345
- children: /* @__PURE__ */ e(N, { name: "align-right", size: 14 })
1352
+ onClick: () => b({ x: C - n.position.width }),
1353
+ title: _("printing.editor.rightEdge", "Right edge"),
1354
+ children: /* @__PURE__ */ e(w, { name: "align-right", size: 14 })
1346
1355
  }
1347
1356
  )
1348
1357
  ] })
1349
1358
  ] })
1350
1359
  ] }),
1351
- l === "style" && /* @__PURE__ */ a(j, { children: [
1352
- f && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
1353
- /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: "Czcionka" }),
1360
+ o === "style" && /* @__PURE__ */ a(X, { children: [
1361
+ h && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
1362
+ /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: g("templateEditor.font", "Font") }),
1354
1363
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1355
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: "Rodzina" }),
1364
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("templateEditor.fontFamily", "Family") }),
1356
1365
  /* @__PURE__ */ e(
1357
1366
  "select",
1358
1367
  {
1359
1368
  className: t.styleSelectFull,
1360
1369
  value: n.style.fontFamily ?? "sans-serif",
1361
- onChange: (i) => h({ fontFamily: i.target.value }),
1370
+ onChange: (i) => k({ fontFamily: i.target.value }),
1362
1371
  children: Da.map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
1363
1372
  }
1364
1373
  )
1365
1374
  ] }),
1366
1375
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1367
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: m("printing.editor.size", "Size") }),
1376
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("printing.editor.size", "Size") }),
1368
1377
  /* @__PURE__ */ e(
1369
1378
  "select",
1370
1379
  {
1371
1380
  className: t.styleSelectSm,
1372
1381
  value: xe.includes(n.style.fontSize ?? 10) ? n.style.fontSize ?? 10 : "",
1373
- onChange: (i) => h({ fontSize: +i.target.value }),
1382
+ onChange: (i) => k({ fontSize: +i.target.value }),
1374
1383
  children: xe.map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
1375
1384
  }
1376
1385
  ),
@@ -1383,20 +1392,20 @@ const Pa = ({
1383
1392
  max: 200,
1384
1393
  className: t.styleInput,
1385
1394
  value: n.style.fontSize ?? 10,
1386
- onChange: (i) => h({ fontSize: +i.target.value })
1395
+ onChange: (i) => k({ fontSize: +i.target.value })
1387
1396
  }
1388
1397
  ),
1389
1398
  /* @__PURE__ */ e("span", { className: t.styleUnit, children: "pt" })
1390
1399
  ] }),
1391
1400
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1392
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: m("printing.editor.colour", "Colour") }),
1401
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("printing.editor.colour", "Colour") }),
1393
1402
  /* @__PURE__ */ e(
1394
1403
  "input",
1395
1404
  {
1396
1405
  type: "color",
1397
1406
  className: t.colorPicker,
1398
1407
  value: n.style.color ?? se,
1399
- onChange: (i) => h({ color: i.target.value })
1408
+ onChange: (i) => k({ color: i.target.value })
1400
1409
  }
1401
1410
  ),
1402
1411
  /* @__PURE__ */ e(
@@ -1404,19 +1413,19 @@ const Pa = ({
1404
1413
  {
1405
1414
  className: t.colorHex,
1406
1415
  value: n.style.color ?? se,
1407
- onChange: (i) => h({ color: i.target.value }),
1416
+ onChange: (i) => k({ color: i.target.value }),
1408
1417
  maxLength: 7
1409
1418
  }
1410
1419
  )
1411
1420
  ] }),
1412
1421
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1413
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: m("printing.editor.style", "Style") }),
1422
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("printing.editor.style", "Style") }),
1414
1423
  /* @__PURE__ */ a("div", { className: t.toggleGroup, children: [
1415
1424
  /* @__PURE__ */ e(
1416
1425
  "button",
1417
1426
  {
1418
1427
  className: `${t.toggleBtn} ${n.style.fontWeight === "bold" ? t.toggleBtnActive : ""}`,
1419
- onClick: () => h({ fontWeight: n.style.fontWeight === "bold" ? "normal" : "bold" }),
1428
+ onClick: () => k({ fontWeight: n.style.fontWeight === "bold" ? "normal" : "bold" }),
1420
1429
  children: /* @__PURE__ */ e("b", { children: "B" })
1421
1430
  }
1422
1431
  ),
@@ -1424,27 +1433,27 @@ const Pa = ({
1424
1433
  "button",
1425
1434
  {
1426
1435
  className: `${t.toggleBtn} ${n.style.fontStyle === "italic" ? t.toggleBtnActive : ""}`,
1427
- onClick: () => h({ fontStyle: n.style.fontStyle === "italic" ? "normal" : "italic" }),
1436
+ onClick: () => k({ fontStyle: n.style.fontStyle === "italic" ? "normal" : "italic" }),
1428
1437
  children: /* @__PURE__ */ e("i", { children: "I" })
1429
1438
  }
1430
1439
  )
1431
1440
  ] })
1432
1441
  ] }),
1433
1442
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1434
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: m("printing.editor.align", "Align") }),
1443
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("printing.editor.align", "Align") }),
1435
1444
  /* @__PURE__ */ e("div", { className: t.toggleGroup, children: ["left", "center", "right", "justify"].map((i) => /* @__PURE__ */ e(
1436
1445
  "button",
1437
1446
  {
1438
1447
  title: i,
1439
1448
  className: `${t.toggleBtn} ${(n.style.textAlign ?? "left") === i ? t.toggleBtnActive : ""}`,
1440
- onClick: () => h({ textAlign: i }),
1449
+ onClick: () => k({ textAlign: i }),
1441
1450
  children: i === "left" ? "≡L" : i === "center" ? "≡C" : i === "right" ? "≡R" : "≡J"
1442
1451
  },
1443
1452
  i
1444
1453
  )) })
1445
1454
  ] }),
1446
1455
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1447
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: "W. linii" }),
1456
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("templateEditor.lineHeight", "Line h.") }),
1448
1457
  /* @__PURE__ */ e(
1449
1458
  "input",
1450
1459
  {
@@ -1454,12 +1463,12 @@ const Pa = ({
1454
1463
  max: 4,
1455
1464
  className: t.styleInput,
1456
1465
  value: n.style.lineHeight ?? 1.4,
1457
- onChange: (i) => h({ lineHeight: +i.target.value })
1466
+ onChange: (i) => k({ lineHeight: +i.target.value })
1458
1467
  }
1459
1468
  )
1460
1469
  ] }),
1461
1470
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1462
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: m("printing.editor.spacing", "Spacing") }),
1471
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("printing.editor.spacing", "Spacing") }),
1463
1472
  /* @__PURE__ */ e(
1464
1473
  "input",
1465
1474
  {
@@ -1469,37 +1478,37 @@ const Pa = ({
1469
1478
  max: 0.5,
1470
1479
  className: t.styleInput,
1471
1480
  value: n.style.letterSpacing ?? 0,
1472
- onChange: (i) => h({ letterSpacing: +i.target.value })
1481
+ onChange: (i) => k({ letterSpacing: +i.target.value })
1473
1482
  }
1474
1483
  ),
1475
1484
  /* @__PURE__ */ e("span", { className: t.styleUnit, children: "em" })
1476
1485
  ] })
1477
1486
  ] }),
1478
1487
  /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
1479
- /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: m("printing.editor.background", "Background and border") }),
1488
+ /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: _("printing.editor.background", "Background and border") }),
1480
1489
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1481
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: m("printing.editor.fill", "Fill") }),
1490
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("printing.editor.fill", "Fill") }),
1482
1491
  /* @__PURE__ */ e(
1483
1492
  "input",
1484
1493
  {
1485
1494
  type: "color",
1486
1495
  className: t.colorPicker,
1487
1496
  value: n.style.backgroundColor ?? "var(--nice-bg, #fff)",
1488
- onChange: (i) => h({ backgroundColor: i.target.value })
1497
+ onChange: (i) => k({ backgroundColor: i.target.value })
1489
1498
  }
1490
1499
  ),
1491
1500
  /* @__PURE__ */ e(
1492
1501
  "button",
1493
1502
  {
1494
1503
  className: t.clearBtn,
1495
- onClick: () => h({ backgroundColor: void 0 }),
1496
- title: m("printing.editor.clearFill", "Clear fill"),
1497
- children: /* @__PURE__ */ e(N, { name: "close", size: 12 })
1504
+ onClick: () => k({ backgroundColor: void 0 }),
1505
+ title: _("printing.editor.clearFill", "Clear fill"),
1506
+ children: /* @__PURE__ */ e(w, { name: "close", size: 12 })
1498
1507
  }
1499
1508
  )
1500
1509
  ] }),
1501
1510
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1502
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: "Ramka" }),
1511
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("templateEditor.border", "Border") }),
1503
1512
  /* @__PURE__ */ e(
1504
1513
  "input",
1505
1514
  {
@@ -1509,7 +1518,7 @@ const Pa = ({
1509
1518
  max: 10,
1510
1519
  className: t.styleInput,
1511
1520
  value: n.style.borderWidth ?? 0,
1512
- onChange: (i) => h({ borderWidth: +i.target.value })
1521
+ onChange: (i) => k({ borderWidth: +i.target.value })
1513
1522
  }
1514
1523
  ),
1515
1524
  /* @__PURE__ */ e(
@@ -1518,7 +1527,7 @@ const Pa = ({
1518
1527
  type: "color",
1519
1528
  className: t.colorPicker,
1520
1529
  value: n.style.borderColor ?? se,
1521
- onChange: (i) => h({ borderColor: i.target.value })
1530
+ onChange: (i) => k({ borderColor: i.target.value })
1522
1531
  }
1523
1532
  ),
1524
1533
  /* @__PURE__ */ a(
@@ -1526,7 +1535,7 @@ const Pa = ({
1526
1535
  {
1527
1536
  className: t.styleSelectXs,
1528
1537
  value: n.style.borderStyle ?? "solid",
1529
- onChange: (i) => h({ borderStyle: i.target.value }),
1538
+ onChange: (i) => k({ borderStyle: i.target.value }),
1530
1539
  children: [
1531
1540
  /* @__PURE__ */ e("option", { value: "solid", children: "─" }),
1532
1541
  /* @__PURE__ */ e("option", { value: "dashed", children: "- -" }),
@@ -1536,7 +1545,7 @@ const Pa = ({
1536
1545
  )
1537
1546
  ] }),
1538
1547
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1539
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: "Zaokr." }),
1548
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("templateEditor.radius", "Radius") }),
1540
1549
  /* @__PURE__ */ e(
1541
1550
  "input",
1542
1551
  {
@@ -1546,13 +1555,13 @@ const Pa = ({
1546
1555
  max: 50,
1547
1556
  className: t.styleInput,
1548
1557
  value: n.style.borderRadius ?? 0,
1549
- onChange: (i) => h({ borderRadius: +i.target.value })
1558
+ onChange: (i) => k({ borderRadius: +i.target.value })
1550
1559
  }
1551
1560
  ),
1552
1561
  /* @__PURE__ */ e("span", { className: t.styleUnit, children: "px" })
1553
1562
  ] }),
1554
1563
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1555
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: "Padding" }),
1564
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("templateEditor.padding", "Padding") }),
1556
1565
  /* @__PURE__ */ e(
1557
1566
  "input",
1558
1567
  {
@@ -1562,13 +1571,13 @@ const Pa = ({
1562
1571
  max: 20,
1563
1572
  className: t.styleInput,
1564
1573
  value: n.style.padding ?? 0,
1565
- onChange: (i) => h({ padding: +i.target.value })
1574
+ onChange: (i) => k({ padding: +i.target.value })
1566
1575
  }
1567
1576
  ),
1568
- /* @__PURE__ */ e("span", { className: t.styleUnit, children: "mm" })
1577
+ /* @__PURE__ */ e("span", { className: t.styleUnit, children: g("templateEditor.mm", "mm") })
1569
1578
  ] }),
1570
1579
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1571
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: "Krycie" }),
1580
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("templateEditor.opacity", "Opacity") }),
1572
1581
  /* @__PURE__ */ e(
1573
1582
  "input",
1574
1583
  {
@@ -1578,7 +1587,7 @@ const Pa = ({
1578
1587
  step: 0.05,
1579
1588
  className: t.sliderInput,
1580
1589
  value: n.style.opacity ?? 1,
1581
- onChange: (i) => h({ opacity: +i.target.value })
1590
+ onChange: (i) => k({ opacity: +i.target.value })
1582
1591
  }
1583
1592
  ),
1584
1593
  /* @__PURE__ */ a("span", { className: t.styleValue, children: [
@@ -1588,163 +1597,163 @@ const Pa = ({
1588
1597
  ] })
1589
1598
  ] })
1590
1599
  ] }),
1591
- l === "data" && s && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
1592
- /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: m("printing.editor.dataSource", "Data source") }),
1600
+ o === "data" && r && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
1601
+ /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: _("printing.editor.dataSource", "Data source") }),
1593
1602
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1594
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: m("printing.editor.path", "Path") }),
1603
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("printing.editor.path", "Path") }),
1595
1604
  /* @__PURE__ */ e(
1596
1605
  "input",
1597
1606
  {
1598
1607
  className: t.styleInputFull,
1599
1608
  value: n.dataPath,
1600
- onChange: (i) => o({ dataPath: i.target.value }),
1601
- placeholder: "np. invoice.number"
1609
+ onChange: (i) => l({ dataPath: i.target.value }),
1610
+ placeholder: g("templateEditor.egInvoiceNumber", "e.g. invoice.number")
1602
1611
  }
1603
1612
  )
1604
1613
  ] }),
1605
1614
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1606
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: m("printing.editor.format", "Format") }),
1615
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("printing.editor.format", "Format") }),
1607
1616
  /* @__PURE__ */ e(
1608
1617
  "input",
1609
1618
  {
1610
1619
  className: t.styleInputFull,
1611
1620
  value: n.format ?? "",
1612
- onChange: (i) => o({ format: i.target.value }),
1613
- placeholder: "DD.MM.YYYY / #,##0.00"
1621
+ onChange: (i) => l({ format: i.target.value }),
1622
+ placeholder: g("templateEditor.ddMmYyyy000", "DD.MM.YYYY / #,##0.00")
1614
1623
  }
1615
1624
  )
1616
1625
  ] }),
1617
1626
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1618
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: m("printing.editor.default", "Default") }),
1627
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("printing.editor.default", "Default") }),
1619
1628
  /* @__PURE__ */ e(
1620
1629
  "input",
1621
1630
  {
1622
1631
  className: t.styleInputFull,
1623
1632
  value: n.fallback ?? "",
1624
- onChange: (i) => o({ fallback: i.target.value }),
1625
- placeholder: m("printing.editor.whenEmpty", "When there is no value")
1633
+ onChange: (i) => l({ fallback: i.target.value }),
1634
+ placeholder: _("printing.editor.whenEmpty", "When there is no value")
1626
1635
  }
1627
1636
  )
1628
1637
  ] }),
1629
1638
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1630
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: m("printing.editor.type", "Type") }),
1639
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("printing.editor.type", "Type") }),
1631
1640
  /* @__PURE__ */ e(
1632
1641
  "select",
1633
1642
  {
1634
1643
  className: t.styleSelectFull,
1635
1644
  value: n.type,
1636
- onChange: (i) => o({ type: i.target.value }),
1637
- children: Object.keys(_e).map((i) => /* @__PURE__ */ e("option", { value: i, children: we(m, i) }, i))
1645
+ onChange: (i) => l({ type: i.target.value }),
1646
+ children: Object.keys(_e).map((i) => /* @__PURE__ */ e("option", { value: i, children: we(_, i) }, i))
1638
1647
  }
1639
1648
  )
1640
1649
  ] }),
1641
1650
  (n.type === "barcode" || n.type === "qr") && /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1642
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: m("printing.editor.codeFormat", "Code format") }),
1651
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("printing.editor.codeFormat", "Code format") }),
1643
1652
  /* @__PURE__ */ e(
1644
1653
  "select",
1645
1654
  {
1646
1655
  className: t.styleSelectFull,
1647
1656
  value: n.barcodeType ?? "code128",
1648
- onChange: (i) => o({ barcodeType: i.target.value }),
1657
+ onChange: (i) => l({ barcodeType: i.target.value }),
1649
1658
  children: ["ean13", "ean8", "code128", "code39", "upc", "itf14", "datamatrix"].map((i) => /* @__PURE__ */ e("option", { value: i, children: i.toUpperCase() }, i))
1650
1659
  }
1651
1660
  )
1652
1661
  ] })
1653
1662
  ] }),
1654
- l === "conditional" && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
1655
- /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: m("printing.editor.conditionalVisibility", "Conditional visibility") }),
1656
- /* @__PURE__ */ e("div", { className: t.conditionalHint, children: m(
1663
+ o === "conditional" && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
1664
+ /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: _("printing.editor.conditionalVisibility", "Conditional visibility") }),
1665
+ /* @__PURE__ */ e("div", { className: t.conditionalHint, children: _(
1657
1666
  "printing.editor.conditionalHint",
1658
1667
  "The element is hidden when the condition is not met."
1659
1668
  ) }),
1660
1669
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1661
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: m("printing.editor.conditionalField", "Field") }),
1670
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("printing.editor.conditionalField", "Field") }),
1662
1671
  /* @__PURE__ */ e(
1663
1672
  "input",
1664
1673
  {
1665
1674
  className: t.styleInputFull,
1666
- value: ((z = n.conditional) == null ? void 0 : z.field) ?? "",
1675
+ value: ((S = n.conditional) == null ? void 0 : S.field) ?? "",
1667
1676
  onChange: (i) => {
1668
- var _, p;
1669
- return o({
1677
+ var d, u;
1678
+ return l({
1670
1679
  conditional: {
1671
1680
  field: i.target.value,
1672
- operator: ((_ = n.conditional) == null ? void 0 : _.operator) ?? "eq",
1673
- value: (p = n.conditional) == null ? void 0 : p.value
1681
+ operator: ((d = n.conditional) == null ? void 0 : d.operator) ?? "eq",
1682
+ value: (u = n.conditional) == null ? void 0 : u.value
1674
1683
  }
1675
1684
  });
1676
1685
  },
1677
- placeholder: "np. invoice.isPaid"
1686
+ placeholder: g("templateEditor.egInvoiceIsPaid", "e.g. invoice.isPaid")
1678
1687
  }
1679
1688
  )
1680
1689
  ] }),
1681
1690
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1682
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: "Operator" }),
1691
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("templateEditor.operator", "Operator") }),
1683
1692
  /* @__PURE__ */ a(
1684
1693
  "select",
1685
1694
  {
1686
1695
  className: t.styleSelectFull,
1687
- value: ((w = n.conditional) == null ? void 0 : w.operator) ?? "eq",
1696
+ value: ((I = n.conditional) == null ? void 0 : I.operator) ?? "eq",
1688
1697
  onChange: (i) => {
1689
- var _, p;
1690
- return o({
1698
+ var d, u;
1699
+ return l({
1691
1700
  conditional: {
1692
- field: ((_ = n.conditional) == null ? void 0 : _.field) ?? "",
1701
+ field: ((d = n.conditional) == null ? void 0 : d.field) ?? "",
1693
1702
  operator: i.target.value,
1694
- value: (p = n.conditional) == null ? void 0 : p.value
1703
+ value: (u = n.conditional) == null ? void 0 : u.value
1695
1704
  }
1696
1705
  });
1697
1706
  },
1698
1707
  children: [
1699
1708
  /* @__PURE__ */ a("option", { value: "eq", children: [
1700
1709
  "= ",
1701
- m("printing.editor.opEqual", "equal")
1710
+ _("printing.editor.opEqual", "equal")
1702
1711
  ] }),
1703
1712
  /* @__PURE__ */ a("option", { value: "neq", children: [
1704
1713
  "≠ ",
1705
- m("printing.editor.opNotEqual", "not equal")
1714
+ _("printing.editor.opNotEqual", "not equal")
1706
1715
  ] }),
1707
- /* @__PURE__ */ e("option", { value: "gt", children: "> wieksze" }),
1708
- /* @__PURE__ */ e("option", { value: "lt", children: "< mniejsze" }),
1709
- /* @__PURE__ */ e("option", { value: "contains", children: "zawiera" })
1716
+ /* @__PURE__ */ e("option", { value: "gt", children: g("templateEditor.greaterThan", "> greater than") }),
1717
+ /* @__PURE__ */ e("option", { value: "lt", children: g("templateEditor.lessThan", "< less than") }),
1718
+ /* @__PURE__ */ e("option", { value: "contains", children: g("templateEditor.contains", "contains") })
1710
1719
  ]
1711
1720
  }
1712
1721
  )
1713
1722
  ] }),
1714
1723
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1715
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: m("printing.editor.value", "Value") }),
1724
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("printing.editor.value", "Value") }),
1716
1725
  /* @__PURE__ */ e(
1717
1726
  "input",
1718
1727
  {
1719
1728
  className: t.styleInputFull,
1720
- value: String(((L = n.conditional) == null ? void 0 : L.value) ?? ""),
1729
+ value: String(((x = n.conditional) == null ? void 0 : x.value) ?? ""),
1721
1730
  onChange: (i) => {
1722
- var _, p;
1723
- return o({
1731
+ var d, u;
1732
+ return l({
1724
1733
  conditional: {
1725
- field: ((_ = n.conditional) == null ? void 0 : _.field) ?? "",
1726
- operator: ((p = n.conditional) == null ? void 0 : p.operator) ?? "eq",
1734
+ field: ((d = n.conditional) == null ? void 0 : d.field) ?? "",
1735
+ operator: ((u = n.conditional) == null ? void 0 : u.operator) ?? "eq",
1727
1736
  value: i.target.value
1728
1737
  }
1729
1738
  });
1730
1739
  },
1731
- placeholder: 'np. true / "PAID"'
1740
+ placeholder: g("templateEditor.egTruePaid", 'e.g. true / "PAID"')
1732
1741
  }
1733
1742
  )
1734
1743
  ] }),
1735
- ((r = n.conditional) == null ? void 0 : r.field) && /* @__PURE__ */ e(
1744
+ ((s = n.conditional) == null ? void 0 : s.field) && /* @__PURE__ */ e(
1736
1745
  "button",
1737
1746
  {
1738
1747
  className: t.clearConditionalBtn,
1739
- onClick: () => o({ conditional: void 0 }),
1740
- children: m("printing.editor.clearCondition", "Clear condition")
1748
+ onClick: () => l({ conditional: void 0 }),
1749
+ children: _("printing.editor.clearCondition", "Clear condition")
1741
1750
  }
1742
1751
  )
1743
1752
  ] })
1744
1753
  ] })
1745
1754
  ] });
1746
1755
  };
1747
- function Wa() {
1756
+ function Ya() {
1748
1757
  return {
1749
1758
  id: `tpl-${Date.now()}`,
1750
1759
  name: "New template",
@@ -1761,137 +1770,137 @@ function Wa() {
1761
1770
  signatures: []
1762
1771
  };
1763
1772
  }
1764
- const rr = ({
1773
+ const cr = ({
1765
1774
  template: n,
1766
- dataSchema: l,
1767
- sampleData: d = [],
1768
- onChange: o,
1769
- onSave: S,
1770
- readOnly: b = !1,
1771
- className: m,
1772
- style: I,
1773
- theme: h = "light"
1775
+ dataSchema: o,
1776
+ sampleData: m = [],
1777
+ onChange: l,
1778
+ onSave: C,
1779
+ readOnly: v = !1,
1780
+ className: g,
1781
+ style: _,
1782
+ theme: b = "light"
1774
1783
  }) => {
1775
- const [{ past: f, present: s, future: z }, w] = Xe($a, {
1784
+ const { t: k } = j(), [{ past: h, present: r, future: S }, I] = Je(Ra, {
1776
1785
  past: [],
1777
- present: n ?? Wa(),
1786
+ present: n ?? Ya(),
1778
1787
  future: []
1779
- }), { t: L } = J(), [r, i] = F(/* @__PURE__ */ new Set()), [_, p] = F("sec-body"), [k, H] = F(1), [g, $] = F(0), [v, q] = F("fields"), [D, K] = F("position"), [A, T] = F(!1), [X, be] = F(!0), P = M(
1788
+ }), { t: x } = j(), [s, i] = H(/* @__PURE__ */ new Set()), [d, u] = H("sec-body"), [z, y] = H(1), [R, T] = H(0), [$, A] = H("fields"), [Y, Z] = H("position"), [f, K] = H(!1), [ge, Re] = H(!0), M = P(
1780
1789
  (c) => {
1781
- const u = { ...s, ...c };
1782
- w({ type: "UPDATE", payload: u }), o == null || o(u);
1790
+ const p = { ...r, ...c };
1791
+ I({ type: "UPDATE", payload: p }), l == null || l(p);
1783
1792
  },
1784
- [s, o]
1785
- ), [ee, ye] = me(() => {
1786
- const [c, u] = Le[s.paperSize] ?? Le.A4;
1787
- return s.orientation === "landscape" ? [u, c] : [c, u];
1788
- }, [s.paperSize, s.orientation]), te = me(() => s.sections.flatMap((c) => c.fields), [s]), G = me(
1789
- () => te.find((c) => r.has(c.id)) ?? null,
1790
- [te, r]
1791
- ), ve = M(
1792
- (c, u) => {
1793
- P({
1794
- sections: s.sections.map((B) => ({
1795
- ...B,
1796
- fields: B.fields.map(
1797
- (C) => C.id === c ? { ...C, ...u, style: { ...C.style, ...u.style ?? {} } } : C
1793
+ [r, l]
1794
+ ), [ee, ye] = ue(() => {
1795
+ const [c, p] = Le[r.paperSize] ?? Le.A4;
1796
+ return r.orientation === "landscape" ? [p, c] : [c, p];
1797
+ }, [r.paperSize, r.orientation]), te = ue(() => r.sections.flatMap((c) => c.fields), [r]), G = ue(
1798
+ () => te.find((c) => s.has(c.id)) ?? null,
1799
+ [te, s]
1800
+ ), fe = P(
1801
+ (c, p) => {
1802
+ M({
1803
+ sections: r.sections.map((L) => ({
1804
+ ...L,
1805
+ fields: L.fields.map(
1806
+ (B) => B.id === c ? { ...B, ...p, style: { ...B.style, ...p.style ?? {} } } : B
1798
1807
  )
1799
1808
  }))
1800
1809
  });
1801
1810
  },
1802
- [s, P]
1803
- ), de = M(
1811
+ [r, M]
1812
+ ), de = P(
1804
1813
  (c) => {
1805
- P({
1806
- sections: s.sections.map((u) => ({
1807
- ...u,
1808
- fields: u.fields.map(
1809
- (B) => r.has(B.id) ? { ...B, ...c, style: { ...B.style, ...c.style ?? {} } } : B
1814
+ M({
1815
+ sections: r.sections.map((p) => ({
1816
+ ...p,
1817
+ fields: p.fields.map(
1818
+ (L) => s.has(L.id) ? { ...L, ...c, style: { ...L.style, ...c.style ?? {} } } : L
1810
1819
  )
1811
1820
  }))
1812
1821
  });
1813
1822
  },
1814
- [s, r, P]
1815
- ), Ce = M(
1816
- (c, u) => {
1823
+ [r, s, M]
1824
+ ), Ce = P(
1825
+ (c, p) => {
1817
1826
  if (c === "watermark") {
1818
- P({
1827
+ M({
1819
1828
  watermarks: [
1820
- ...s.watermarks ?? [],
1829
+ ...r.watermarks ?? [],
1821
1830
  {
1822
1831
  id: ce(),
1823
1832
  type: "text",
1824
- text: "COPY",
1833
+ text: k("templateEditor.copy", "COPY"),
1825
1834
  opacity: 0.12,
1826
1835
  angle: -45,
1827
1836
  fontSize: 60,
1828
- color: ge
1837
+ color: be
1829
1838
  }
1830
1839
  ]
1831
- }), q("watermarks");
1840
+ }), A("watermarks");
1832
1841
  return;
1833
1842
  }
1834
1843
  if (c === "signature") {
1835
- P({
1844
+ M({
1836
1845
  signatures: [
1837
- ...s.signatures ?? [],
1846
+ ...r.signatures ?? [],
1838
1847
  {
1839
1848
  id: ce(),
1840
- label: L("printing.editor.signature", "Signature"),
1849
+ label: x("printing.editor.signature", "Signature"),
1841
1850
  position: { x: 10, y: 5, width: 70, height: 22 },
1842
1851
  showLine: !0,
1843
1852
  showDate: !1
1844
1853
  }
1845
1854
  ]
1846
- }), q("signatures");
1855
+ }), A("signatures");
1847
1856
  return;
1848
1857
  }
1849
- const B = s.sections.find((O) => O.id === _) ?? s.sections.find((O) => O.type === "body");
1850
- if (!B)
1858
+ const L = r.sections.find((O) => O.id === d) ?? r.sections.find((O) => O.type === "body");
1859
+ if (!L)
1851
1860
  return;
1852
- const C = ze(c, u), E = {
1853
- sections: s.sections.map(
1854
- (O) => O.id === B.id ? { ...O, fields: [...O.fields, C] } : O
1861
+ const B = ze(c, p), F = {
1862
+ sections: r.sections.map(
1863
+ (O) => O.id === L.id ? { ...O, fields: [...O.fields, B] } : O
1855
1864
  )
1856
1865
  };
1857
- w({ type: "UPDATE", payload: { ...s, ...E } }), o == null || o({ ...s, ...E }), i(/* @__PURE__ */ new Set([C.id]));
1866
+ I({ type: "UPDATE", payload: { ...r, ...F } }), l == null || l({ ...r, ...F }), i(/* @__PURE__ */ new Set([B.id]));
1858
1867
  },
1859
- [s, _, o]
1860
- ), Re = M(
1861
- (c, u, B, C) => {
1862
- const E = l == null ? void 0 : l.fields.find((Y) => Y.path === u), O = ze((E == null ? void 0 : E.type) ?? "text", E);
1863
- O.position.x = Math.round(B * 2) / 2, O.position.y = Math.round(C * 2) / 2;
1868
+ [r, d, l, k, x, M]
1869
+ ), Ee = P(
1870
+ (c, p, L, B) => {
1871
+ const F = o == null ? void 0 : o.fields.find((U) => U.path === p), O = ze((F == null ? void 0 : F.type) ?? "text", F);
1872
+ O.position.x = Math.round(L * 2) / 2, O.position.y = Math.round(B * 2) / 2;
1864
1873
  const ne = {
1865
- sections: s.sections.map(
1866
- (Y) => Y.id === c ? { ...Y, fields: [...Y.fields, O] } : Y
1874
+ sections: r.sections.map(
1875
+ (U) => U.id === c ? { ...U, fields: [...U.fields, O] } : U
1867
1876
  )
1868
1877
  };
1869
- w({ type: "UPDATE", payload: { ...s, ...ne } }), o == null || o({ ...s, ...ne }), i(/* @__PURE__ */ new Set([O.id]));
1878
+ I({ type: "UPDATE", payload: { ...r, ...ne } }), l == null || l({ ...r, ...ne }), i(/* @__PURE__ */ new Set([O.id]));
1870
1879
  },
1871
- [s, l, o]
1872
- ), Ae = M((c, u) => {
1873
- u.ctrlKey || u.metaKey ? i((B) => {
1874
- const C = new Set(B);
1875
- return C.has(c) ? C.delete(c) : C.add(c), C;
1876
- }) : u.shiftKey ? i((B) => /* @__PURE__ */ new Set([...B, c])) : i(/* @__PURE__ */ new Set([c]));
1877
- }, []), Me = M(
1878
- (c, u) => {
1879
- if (b)
1880
+ [r, o, l]
1881
+ ), Ae = P((c, p) => {
1882
+ p.ctrlKey || p.metaKey ? i((L) => {
1883
+ const B = new Set(L);
1884
+ return B.has(c) ? B.delete(c) : B.add(c), B;
1885
+ }) : p.shiftKey ? i((L) => /* @__PURE__ */ new Set([...L, c])) : i(/* @__PURE__ */ new Set([c]));
1886
+ }, []), Me = P(
1887
+ (c, p) => {
1888
+ if (v)
1880
1889
  return;
1881
- u.preventDefault(), r.has(c) || i(/* @__PURE__ */ new Set([c]));
1882
- const B = u.clientX, C = u.clientY, E = s.sections.map((Y) => ({
1883
- id: Y.id,
1884
- fields: Y.fields.map((ae) => ({ id: ae.id, pos: { ...ae.position } }))
1885
- })), O = (Y) => {
1886
- const ae = (Y.clientX - B) / (k * U), re = (Y.clientY - C) / (k * U), pe = r.has(c) ? r : /* @__PURE__ */ new Set([c]), ue = s.sections.map((ie) => {
1887
- const Q = E.find((V) => V.id === ie.id);
1890
+ p.preventDefault(), s.has(c) || i(/* @__PURE__ */ new Set([c]));
1891
+ const L = p.clientX, B = p.clientY, F = r.sections.map((U) => ({
1892
+ id: U.id,
1893
+ fields: U.fields.map((ae) => ({ id: ae.id, pos: { ...ae.position } }))
1894
+ })), O = (U) => {
1895
+ const ae = (U.clientX - L) / (z * W), re = (U.clientY - B) / (z * W), me = s.has(c) ? s : /* @__PURE__ */ new Set([c]), pe = r.sections.map((ie) => {
1896
+ const J = F.find((V) => V.id === ie.id);
1888
1897
  return {
1889
1898
  ...ie,
1890
1899
  fields: ie.fields.map((V) => {
1891
1900
  var Ie;
1892
- if (!pe.has(V.id))
1901
+ if (!me.has(V.id))
1893
1902
  return V;
1894
- const Be = ((Ie = Q == null ? void 0 : Q.fields.find((Ve) => Ve.id === V.id)) == null ? void 0 : Ie.pos) ?? V.position;
1903
+ const Be = ((Ie = J == null ? void 0 : J.fields.find((Ve) => Ve.id === V.id)) == null ? void 0 : Ie.pos) ?? V.position;
1895
1904
  return {
1896
1905
  ...V,
1897
1906
  position: {
@@ -1902,330 +1911,330 @@ const rr = ({
1902
1911
  };
1903
1912
  })
1904
1913
  };
1905
- }), le = { ...s, sections: ue };
1906
- o == null || o(le), w({ type: "UPDATE", payload: le });
1914
+ }), oe = { ...r, sections: pe };
1915
+ l == null || l(oe), I({ type: "UPDATE", payload: oe });
1907
1916
  }, ne = () => {
1908
1917
  document.removeEventListener("mousemove", O), document.removeEventListener("mouseup", ne);
1909
1918
  };
1910
1919
  document.addEventListener("mousemove", O), document.addEventListener("mouseup", ne);
1911
1920
  },
1912
- [s, k, r, b, o]
1913
- ), Pe = M(
1914
- (c, u, B) => {
1915
- if (b)
1921
+ [r, z, s, v, l]
1922
+ ), Pe = P(
1923
+ (c, p, L) => {
1924
+ if (v)
1916
1925
  return;
1917
- B.preventDefault();
1918
- const C = te.find((re) => re.id === c);
1919
- if (!C)
1926
+ L.preventDefault();
1927
+ const B = te.find((re) => re.id === c);
1928
+ if (!B)
1920
1929
  return;
1921
- const E = { ...C.position }, O = B.clientX, ne = B.clientY, Y = (re) => {
1922
- const pe = (re.clientX - O) / (k * U), ue = (re.clientY - ne) / (k * U);
1923
- let { x: le, y: ie, width: Q, height: V } = E;
1924
- u.includes("e") && (Q = Math.max(5, Q + pe)), u.includes("s") && (V = Math.max(3, V + ue)), u.includes("w") && (le = le + pe, Q = Math.max(5, Q - pe)), u.includes("n") && (ie = ie + ue, V = Math.max(3, V - ue)), ve(c, {
1930
+ const F = { ...B.position }, O = L.clientX, ne = L.clientY, U = (re) => {
1931
+ const me = (re.clientX - O) / (z * W), pe = (re.clientY - ne) / (z * W);
1932
+ let { x: oe, y: ie, width: J, height: V } = F;
1933
+ p.includes("e") && (J = Math.max(5, J + me)), p.includes("s") && (V = Math.max(3, V + pe)), p.includes("w") && (oe = oe + me, J = Math.max(5, J - me)), p.includes("n") && (ie = ie + pe, V = Math.max(3, V - pe)), fe(c, {
1925
1934
  position: {
1926
- ...E,
1927
- x: Math.round(le * 2) / 2,
1935
+ ...F,
1936
+ x: Math.round(oe * 2) / 2,
1928
1937
  y: Math.round(ie * 2) / 2,
1929
- width: Math.round(Q * 2) / 2,
1938
+ width: Math.round(J * 2) / 2,
1930
1939
  height: Math.round(V * 2) / 2
1931
1940
  }
1932
1941
  });
1933
1942
  }, ae = () => {
1934
- document.removeEventListener("mousemove", Y), document.removeEventListener("mouseup", ae);
1943
+ document.removeEventListener("mousemove", U), document.removeEventListener("mouseup", ae);
1935
1944
  };
1936
- document.addEventListener("mousemove", Y), document.addEventListener("mouseup", ae);
1945
+ document.addEventListener("mousemove", U), document.addEventListener("mouseup", ae);
1937
1946
  },
1938
- [te, k, b, ve]
1939
- ), Ne = M(() => {
1940
- P({
1941
- sections: s.sections.map((c) => ({
1947
+ [te, z, v, fe]
1948
+ ), ve = P(() => {
1949
+ M({
1950
+ sections: r.sections.map((c) => ({
1942
1951
  ...c,
1943
- fields: c.fields.filter((u) => !r.has(u.id))
1952
+ fields: c.fields.filter((p) => !s.has(p.id))
1944
1953
  }))
1945
1954
  }), i(/* @__PURE__ */ new Set());
1946
- }, [s, r, P]), fe = M(() => {
1955
+ }, [r, s, M]), Ne = P(() => {
1947
1956
  const c = /* @__PURE__ */ new Set();
1948
- P({
1949
- sections: s.sections.map((u) => {
1950
- const B = u.fields.filter((C) => r.has(C.id)).map((C) => {
1951
- const E = {
1952
- ...C,
1957
+ M({
1958
+ sections: r.sections.map((p) => {
1959
+ const L = p.fields.filter((B) => s.has(B.id)).map((B) => {
1960
+ const F = {
1961
+ ...B,
1953
1962
  id: ce(),
1954
- position: { ...C.position, x: C.position.x + 5, y: C.position.y + 5 }
1963
+ position: { ...B.position, x: B.position.x + 5, y: B.position.y + 5 }
1955
1964
  };
1956
- return c.add(E.id), E;
1965
+ return c.add(F.id), F;
1957
1966
  });
1958
- return { ...u, fields: [...u.fields, ...B] };
1967
+ return { ...p, fields: [...p.fields, ...L] };
1959
1968
  })
1960
1969
  }), i(c);
1961
- }, [s, r, P]), Ee = M(
1970
+ }, [r, s, M]), Fe = P(
1962
1971
  (c) => {
1963
- P({
1964
- sections: s.sections.map((u) => ({
1965
- ...u,
1966
- fields: u.fields.map((B) => {
1967
- if (!r.has(B.id))
1968
- return B;
1969
- const C = c === "left" ? s.margins.left : c === "right" ? ee - s.margins.right - B.position.width : (ee - B.position.width) / 2;
1970
- return { ...B, position: { ...B.position, x: C } };
1972
+ M({
1973
+ sections: r.sections.map((p) => ({
1974
+ ...p,
1975
+ fields: p.fields.map((L) => {
1976
+ if (!s.has(L.id))
1977
+ return L;
1978
+ const B = c === "left" ? r.margins.left : c === "right" ? ee - r.margins.right - L.position.width : (ee - L.position.width) / 2;
1979
+ return { ...L, position: { ...L.position, x: B } };
1971
1980
  })
1972
1981
  }))
1973
1982
  });
1974
1983
  },
1975
- [s, r, ee, P]
1976
- ), Fe = M(
1984
+ [r, s, ee, M]
1985
+ ), He = P(
1977
1986
  (c) => {
1978
- const u = s.sections.find((C) => C.id === _);
1979
- if (!u)
1987
+ const p = r.sections.find((B) => B.id === d);
1988
+ if (!p)
1980
1989
  return;
1981
- const B = u.heightMm ?? 200;
1982
- P({
1983
- sections: s.sections.map((C) => C.id !== _ ? C : {
1984
- ...C,
1985
- fields: C.fields.map((E) => {
1986
- if (!r.has(E.id))
1987
- return E;
1988
- const O = c === "top" ? 0 : c === "bottom" ? B - E.position.height : (B - E.position.height) / 2;
1989
- return { ...E, position: { ...E.position, y: O } };
1990
+ const L = p.heightMm ?? 200;
1991
+ M({
1992
+ sections: r.sections.map((B) => B.id !== d ? B : {
1993
+ ...B,
1994
+ fields: B.fields.map((F) => {
1995
+ if (!s.has(F.id))
1996
+ return F;
1997
+ const O = c === "top" ? 0 : c === "bottom" ? L - F.position.height : (L - F.position.height) / 2;
1998
+ return { ...F, position: { ...F.position, y: O } };
1990
1999
  })
1991
2000
  })
1992
2001
  });
1993
2002
  },
1994
- [s, r, _, P]
1995
- ), He = M(() => {
1996
- P({
1997
- sections: s.sections.map((c) => ({
2003
+ [r, s, d, M]
2004
+ ), Ge = P(() => {
2005
+ M({
2006
+ sections: r.sections.map((c) => ({
1998
2007
  ...c,
1999
2008
  fields: c.fields.map(
2000
- (u) => r.has(u.id) ? { ...u, position: { ...u.position, zIndex: (u.position.zIndex ?? 1) + 1 } } : u
2009
+ (p) => s.has(p.id) ? { ...p, position: { ...p.position, zIndex: (p.position.zIndex ?? 1) + 1 } } : p
2001
2010
  )
2002
2011
  }))
2003
2012
  });
2004
- }, [s, r, P]), Ge = M(() => {
2005
- P({
2006
- sections: s.sections.map((c) => ({
2013
+ }, [r, s, M]), Oe = P(() => {
2014
+ M({
2015
+ sections: r.sections.map((c) => ({
2007
2016
  ...c,
2008
2017
  fields: c.fields.map(
2009
- (u) => r.has(u.id) ? {
2010
- ...u,
2011
- position: { ...u.position, zIndex: Math.max(1, (u.position.zIndex ?? 1) - 1) }
2012
- } : u
2018
+ (p) => s.has(p.id) ? {
2019
+ ...p,
2020
+ position: { ...p.position, zIndex: Math.max(1, (p.position.zIndex ?? 1) - 1) }
2021
+ } : p
2013
2022
  )
2014
2023
  }))
2015
2024
  });
2016
- }, [s, r, P]), Oe = M(
2017
- (c, u) => {
2018
- P({
2019
- sections: s.sections.map((B) => ({
2020
- ...B,
2021
- fields: B.fields.map(
2022
- (C) => C.id === c ? {
2023
- ...C,
2025
+ }, [r, s, M]), qe = P(
2026
+ (c, p) => {
2027
+ M({
2028
+ sections: r.sections.map((L) => ({
2029
+ ...L,
2030
+ fields: L.fields.map(
2031
+ (B) => B.id === c ? {
2032
+ ...B,
2024
2033
  position: {
2025
- ...C.position,
2026
- zIndex: Math.max(1, (C.position.zIndex ?? 1) - u)
2034
+ ...B.position,
2035
+ zIndex: Math.max(1, (B.position.zIndex ?? 1) - p)
2027
2036
  }
2028
- } : C
2037
+ } : B
2029
2038
  )
2030
2039
  }))
2031
2040
  });
2032
2041
  },
2033
- [s, P]
2042
+ [r, M]
2034
2043
  );
2035
2044
  Se(() => {
2036
- const c = (u) => {
2037
- const B = u.target.tagName;
2038
- if (B === "INPUT" || B === "TEXTAREA" || B === "SELECT")
2045
+ const c = (p) => {
2046
+ const L = p.target.tagName;
2047
+ if (L === "INPUT" || L === "TEXTAREA" || L === "SELECT")
2039
2048
  return;
2040
- const C = u.shiftKey ? 5 : 0.5;
2041
- u.key === "Delete" || u.key === "Backspace" ? r.size && (u.preventDefault(), Ne()) : u.ctrlKey && u.key === "z" ? (u.preventDefault(), w({ type: "UNDO" })) : u.ctrlKey && (u.key === "y" || u.key === "Y") ? (u.preventDefault(), w({ type: "REDO" })) : u.ctrlKey && (u.key === "d" || u.key === "D") ? (u.preventDefault(), r.size && fe()) : u.ctrlKey && u.key === "a" ? (u.preventDefault(), i(new Set(te.map((E) => E.id)))) : u.key === "ArrowLeft" ? (u.preventDefault(), de({
2042
- position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) - C }
2043
- })) : u.key === "ArrowRight" ? (u.preventDefault(), de({
2044
- position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) + C }
2045
- })) : u.key === "ArrowUp" ? (u.preventDefault(), de({
2046
- position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) - C }
2047
- })) : u.key === "ArrowDown" && (u.preventDefault(), de({
2048
- position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) + C }
2049
+ const B = p.shiftKey ? 5 : 0.5;
2050
+ p.key === "Delete" || p.key === "Backspace" ? s.size && (p.preventDefault(), ve()) : p.ctrlKey && p.key === "z" ? (p.preventDefault(), I({ type: "UNDO" })) : p.ctrlKey && (p.key === "y" || p.key === "Y") ? (p.preventDefault(), I({ type: "REDO" })) : p.ctrlKey && (p.key === "d" || p.key === "D") ? (p.preventDefault(), s.size && Ne()) : p.ctrlKey && p.key === "a" ? (p.preventDefault(), i(new Set(te.map((F) => F.id)))) : p.key === "ArrowLeft" ? (p.preventDefault(), de({
2051
+ position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) - B }
2052
+ })) : p.key === "ArrowRight" ? (p.preventDefault(), de({
2053
+ position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) + B }
2054
+ })) : p.key === "ArrowUp" ? (p.preventDefault(), de({
2055
+ position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) - B }
2056
+ })) : p.key === "ArrowDown" && (p.preventDefault(), de({
2057
+ position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) + B }
2049
2058
  }));
2050
2059
  };
2051
2060
  return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
2052
- }, [r, te, G, Ne, fe, de]);
2053
- const qe = M(
2054
- (c, u) => {
2055
- P({
2056
- sections: s.sections.map(
2057
- (B) => B.id === c ? { ...B, heightMm: Math.round(u * 2) / 2 } : B
2061
+ }, [s, te, G, ve, Ne, de]);
2062
+ const We = P(
2063
+ (c, p) => {
2064
+ M({
2065
+ sections: r.sections.map(
2066
+ (L) => L.id === c ? { ...L, heightMm: Math.round(p * 2) / 2 } : L
2058
2067
  )
2059
2068
  });
2060
2069
  },
2061
- [s, P]
2062
- ), We = me(() => {
2063
- const c = Array.isArray(d) ? d[g] : d;
2070
+ [r, M]
2071
+ ), Ye = ue(() => {
2072
+ const c = Array.isArray(m) ? m[R] : m;
2064
2073
  return c ? "data" in c ? c.data : c : {};
2065
- }, [d, g]), Ue = ee * k * U, Ye = ye * k * U;
2074
+ }, [m, R]), Ue = ee * z * W, je = ye * z * W;
2066
2075
  return /* @__PURE__ */ e(
2067
- je,
2076
+ Xe,
2068
2077
  {
2069
2078
  flush: !0,
2070
- className: `${t.root} ${h === "dark" ? t.dark : ""} ${m ?? ""}`,
2071
- style: I,
2079
+ className: `${t.root} ${b === "dark" ? t.dark : ""} ${g ?? ""}`,
2080
+ style: _,
2072
2081
  toolbar: /* @__PURE__ */ e(
2073
- Ga,
2082
+ Oa,
2074
2083
  {
2075
- tpl: s,
2076
- zoom: k,
2077
- canUndo: f.length > 0,
2078
- canRedo: z.length > 0,
2079
- showGrid: A,
2080
- showRulers: X,
2081
- readOnly: b,
2082
- selectedCount: r.size,
2083
- onPaperChange: (c, u) => P({ paperSize: c, orientation: u }),
2084
- onZoom: H,
2085
- onUndo: () => w({ type: "UNDO" }),
2086
- onRedo: () => w({ type: "REDO" }),
2087
- onToggleGrid: () => T((c) => !c),
2088
- onToggleRulers: () => be((c) => !c),
2084
+ tpl: r,
2085
+ zoom: z,
2086
+ canUndo: h.length > 0,
2087
+ canRedo: S.length > 0,
2088
+ showGrid: f,
2089
+ showRulers: ge,
2090
+ readOnly: v,
2091
+ selectedCount: s.size,
2092
+ onPaperChange: (c, p) => M({ paperSize: c, orientation: p }),
2093
+ onZoom: y,
2094
+ onUndo: () => I({ type: "UNDO" }),
2095
+ onRedo: () => I({ type: "REDO" }),
2096
+ onToggleGrid: () => K((c) => !c),
2097
+ onToggleRulers: () => Re((c) => !c),
2089
2098
  onInsert: Ce,
2090
- onDelete: Ne,
2091
- onDuplicate: fe,
2092
- onAlignH: Ee,
2093
- onAlignV: Fe,
2094
- onBringForward: He,
2095
- onSendBackward: Ge,
2096
- onSave: S ? () => S(s) : void 0
2099
+ onDelete: ve,
2100
+ onDuplicate: Ne,
2101
+ onAlignH: Fe,
2102
+ onAlignV: He,
2103
+ onBringForward: Ge,
2104
+ onSendBackward: Oe,
2105
+ onSave: C ? () => C(r) : void 0
2097
2106
  }
2098
2107
  ),
2099
2108
  sidebar: /* @__PURE__ */ e(
2100
- Oa,
2109
+ qa,
2101
2110
  {
2102
- activeTab: v,
2103
- onTabChange: q,
2104
- schema: l,
2105
- tpl: s,
2111
+ activeTab: $,
2112
+ onTabChange: A,
2113
+ schema: o,
2114
+ tpl: r,
2106
2115
  allFields: te,
2107
- selectedIds: r,
2116
+ selectedIds: s,
2108
2117
  onInsertSchemaField: (c) => Ce(c.type, c),
2109
2118
  onSelectField: (c) => i(/* @__PURE__ */ new Set([c])),
2110
- onUpdateTpl: (c) => P(c),
2111
- onReorderField: Oe
2119
+ onUpdateTpl: (c) => M(c),
2120
+ onReorderField: qe
2112
2121
  }
2113
2122
  ),
2114
2123
  rightSidebar: /* @__PURE__ */ e(
2115
- qa,
2124
+ Wa,
2116
2125
  {
2117
2126
  field: G,
2118
- activeTab: D,
2119
- onTabChange: K,
2120
- onChange: (c) => G && ve(G.id, c),
2127
+ activeTab: Y,
2128
+ onTabChange: Z,
2129
+ onChange: (c) => G && fe(G.id, c),
2121
2130
  paperWidthMm: ee,
2122
2131
  paperHeightMm: ye
2123
2132
  }
2124
2133
  ),
2125
2134
  children: /* @__PURE__ */ a("div", { className: t.canvasArea, onClick: () => i(/* @__PURE__ */ new Set()), children: [
2126
- Array.isArray(d) && d.length > 0 && /* @__PURE__ */ a("div", { className: t.testDataBar, children: [
2135
+ Array.isArray(m) && m.length > 0 && /* @__PURE__ */ a("div", { className: t.testDataBar, children: [
2127
2136
  /* @__PURE__ */ a("span", { className: t.testDataLabel, children: [
2128
- L("printing.editor.testData", "Sample data"),
2137
+ x("printing.editor.testData", "Sample data"),
2129
2138
  ":"
2130
2139
  ] }),
2131
2140
  /* @__PURE__ */ e(
2132
2141
  "select",
2133
2142
  {
2134
2143
  className: t.testDataSelect,
2135
- value: g,
2136
- onChange: (c) => $(+c.target.value),
2137
- children: d.map((c, u) => /* @__PURE__ */ a("option", { value: u, children: [
2138
- L("printing.editor.record", "Record"),
2144
+ value: R,
2145
+ onChange: (c) => T(+c.target.value),
2146
+ children: m.map((c, p) => /* @__PURE__ */ a("option", { value: p, children: [
2147
+ x("printing.editor.record", "Record"),
2139
2148
  " ",
2140
- u + 1
2141
- ] }, u))
2149
+ p + 1
2150
+ ] }, p))
2142
2151
  }
2143
2152
  )
2144
2153
  ] }),
2145
- X && /* @__PURE__ */ a("div", { className: t.rulerWrapper, children: [
2154
+ ge && /* @__PURE__ */ a("div", { className: t.rulerWrapper, children: [
2146
2155
  /* @__PURE__ */ e("div", { className: t.rulerCorner }),
2147
- /* @__PURE__ */ e(Te, { lengthMm: ee, zoom: k, orientation: "h" }),
2148
- /* @__PURE__ */ e(Te, { lengthMm: ye, zoom: k, orientation: "v" })
2156
+ /* @__PURE__ */ e(Te, { lengthMm: ee, zoom: z, orientation: "h" }),
2157
+ /* @__PURE__ */ e(Te, { lengthMm: ye, zoom: z, orientation: "v" })
2149
2158
  ] }),
2150
- /* @__PURE__ */ e("div", { className: t.paperScroll, onClick: (c) => c.stopPropagation(), children: /* @__PURE__ */ a("div", { className: t.paperShadow, style: { width: Ue, minHeight: Ye }, children: [
2159
+ /* @__PURE__ */ e("div", { className: t.paperScroll, onClick: (c) => c.stopPropagation(), children: /* @__PURE__ */ a("div", { className: t.paperShadow, style: { width: Ue, minHeight: je }, children: [
2151
2160
  /* @__PURE__ */ e(
2152
2161
  "div",
2153
2162
  {
2154
2163
  className: t.marginGuide,
2155
2164
  style: {
2156
- top: s.margins.top * k * U,
2157
- right: s.margins.right * k * U,
2158
- bottom: s.margins.bottom * k * U,
2159
- left: s.margins.left * k * U
2165
+ top: r.margins.top * z * W,
2166
+ right: r.margins.right * z * W,
2167
+ bottom: r.margins.bottom * z * W,
2168
+ left: r.margins.left * z * W
2160
2169
  }
2161
2170
  }
2162
2171
  ),
2163
- (s.watermarks ?? []).map((c) => /* @__PURE__ */ e(
2172
+ (r.watermarks ?? []).map((c) => /* @__PURE__ */ e(
2164
2173
  "div",
2165
2174
  {
2166
2175
  className: t.watermark,
2167
2176
  style: {
2168
- fontSize: (c.fontSize ?? 60) * k,
2169
- color: c.color ?? ge,
2177
+ fontSize: (c.fontSize ?? 60) * z,
2178
+ color: c.color ?? be,
2170
2179
  opacity: c.opacity,
2171
2180
  transform: `translate(-50%, -50%) rotate(${c.angle}deg)`
2172
2181
  },
2173
- children: c.type === "text" ? c.text : /* @__PURE__ */ e(N, { name: "image", size: (c.fontSize ?? 60) * k })
2182
+ children: c.type === "text" ? c.text : /* @__PURE__ */ e(w, { name: "image", size: (c.fontSize ?? 60) * z })
2174
2183
  },
2175
2184
  c.id
2176
2185
  )),
2177
- s.sections.map((c) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
2178
- Ea,
2186
+ r.sections.map((c) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
2187
+ Fa,
2179
2188
  {
2180
2189
  section: c,
2181
- zoom: k,
2190
+ zoom: z,
2182
2191
  paperWidthMm: ee,
2183
- selectedIds: r,
2184
- sampleData: We,
2185
- readOnly: b,
2186
- showGrid: A,
2192
+ selectedIds: s,
2193
+ sampleData: Ye,
2194
+ readOnly: v,
2195
+ showGrid: f,
2187
2196
  onFieldClick: Ae,
2188
2197
  onFieldDragStart: Me,
2189
2198
  onResizeStart: Pe,
2190
- onSectionHeightChange: qe,
2191
- onDropField: Re
2199
+ onSectionHeightChange: We,
2200
+ onDropField: Ee
2192
2201
  }
2193
2202
  ) }, c.id))
2194
2203
  ] }) })
2195
2204
  ] })
2196
2205
  }
2197
2206
  );
2198
- }, Ua = "_root_7m4s0_1", Ya = "_dark_7m4s0_25", Va = "_topBar_7m4s0_39", ja = "_searchInput_7m4s0_69", Ka = "_actionBtn_7m4s0_111", Xa = "_categoryRow_7m4s0_157", Ja = "_catChip_7m4s0_187", Qa = "_catChipActive_7m4s0_217", Za = "_grid_7m4s0_231", ei = "_card_7m4s0_253", ti = "_cardSelected_7m4s0_285", ni = "_thumbnail_7m4s0_307", ai = "_thumbnailImg_7m4s0_321", ii = "_thumbnailPlaceholder_7m4s0_333", si = "_paperMini_7m4s0_347", ri = "_paperLine_7m4s0_371", li = "_cardOverlay_7m4s0_385", oi = "_overlayBtn_7m4s0_405", ci = "_overlayBtnDanger_7m4s0_441", di = "_cardBody_7m4s0_481", pi = "_cardName_7m4s0_489", ui = "_cardDesc_7m4s0_517", mi = "_cardMeta_7m4s0_539", hi = "_cardSize_7m4s0_553", _i = "_cardCat_7m4s0_569", gi = "_cardTags_7m4s0_585", bi = "_cardTag_7m4s0_585", yi = "_emptyState_7m4s0_617", vi = "_emptyIcon_7m4s0_639", x = {
2207
+ }, Ua = "_root_7m4s0_1", ja = "_dark_7m4s0_25", Va = "_topBar_7m4s0_39", Xa = "_searchInput_7m4s0_69", Ka = "_actionBtn_7m4s0_111", Ja = "_categoryRow_7m4s0_157", Qa = "_catChip_7m4s0_187", Za = "_catChipActive_7m4s0_217", ei = "_grid_7m4s0_231", ti = "_card_7m4s0_253", ni = "_cardSelected_7m4s0_285", ai = "_thumbnail_7m4s0_307", ii = "_thumbnailImg_7m4s0_321", si = "_thumbnailPlaceholder_7m4s0_333", ri = "_paperMini_7m4s0_347", oi = "_paperLine_7m4s0_371", li = "_cardOverlay_7m4s0_385", ci = "_overlayBtn_7m4s0_405", di = "_overlayBtnDanger_7m4s0_441", mi = "_cardBody_7m4s0_481", pi = "_cardName_7m4s0_489", ui = "_cardDesc_7m4s0_517", hi = "_cardMeta_7m4s0_539", _i = "_cardSize_7m4s0_553", gi = "_cardCat_7m4s0_569", bi = "_cardTags_7m4s0_585", yi = "_cardTag_7m4s0_585", fi = "_emptyState_7m4s0_617", vi = "_emptyIcon_7m4s0_639", D = {
2199
2208
  root: Ua,
2200
- dark: Ya,
2209
+ dark: ja,
2201
2210
  topBar: Va,
2202
- searchInput: ja,
2211
+ searchInput: Xa,
2203
2212
  actionBtn: Ka,
2204
- categoryRow: Xa,
2205
- catChip: Ja,
2206
- catChipActive: Qa,
2207
- grid: Za,
2208
- card: ei,
2209
- cardSelected: ti,
2210
- thumbnail: ni,
2211
- thumbnailImg: ai,
2212
- thumbnailPlaceholder: ii,
2213
- paperMini: si,
2214
- paperLine: ri,
2213
+ categoryRow: Ja,
2214
+ catChip: Qa,
2215
+ catChipActive: Za,
2216
+ grid: ei,
2217
+ card: ti,
2218
+ cardSelected: ni,
2219
+ thumbnail: ai,
2220
+ thumbnailImg: ii,
2221
+ thumbnailPlaceholder: si,
2222
+ paperMini: ri,
2223
+ paperLine: oi,
2215
2224
  cardOverlay: li,
2216
- overlayBtn: oi,
2217
- overlayBtnDanger: ci,
2218
- cardBody: di,
2225
+ overlayBtn: ci,
2226
+ overlayBtnDanger: di,
2227
+ cardBody: mi,
2219
2228
  cardName: pi,
2220
2229
  cardDesc: ui,
2221
- cardMeta: mi,
2222
- cardSize: hi,
2223
- cardCat: _i,
2224
- cardTags: gi,
2225
- cardTag: bi,
2226
- emptyState: yi,
2230
+ cardMeta: hi,
2231
+ cardSize: _i,
2232
+ cardCat: gi,
2233
+ cardTags: bi,
2234
+ cardTag: yi,
2235
+ emptyState: fi,
2227
2236
  emptyIcon: vi
2228
- }, Ni = [
2237
+ }, Ni = [], wi = [
2229
2238
  { key: "printing.category.invoices", fallback: "Invoices" },
2230
2239
  { key: "printing.category.reports", fallback: "Reports" },
2231
2240
  { key: "printing.category.labels", fallback: "Labels" },
@@ -2233,224 +2242,224 @@ const rr = ({
2233
2242
  { key: "printing.category.contracts", fallback: "Contracts" },
2234
2243
  { key: "printing.category.other", fallback: "Other" }
2235
2244
  ];
2236
- function fi(n) {
2237
- return new Promise((l, d) => {
2238
- const o = new FileReader();
2239
- o.onload = (S) => {
2240
- var b;
2245
+ function ki(n) {
2246
+ return new Promise((o, m) => {
2247
+ const l = new FileReader();
2248
+ l.onload = (C) => {
2249
+ var v;
2241
2250
  try {
2242
- l(JSON.parse((b = S.target) == null ? void 0 : b.result));
2243
- } catch (m) {
2244
- d(m);
2251
+ o(JSON.parse((v = C.target) == null ? void 0 : v.result));
2252
+ } catch (g) {
2253
+ m(g);
2245
2254
  }
2246
- }, o.readAsText(n);
2255
+ }, l.readAsText(n);
2247
2256
  });
2248
2257
  }
2249
- function wi(n) {
2250
- const l = new Blob([JSON.stringify(n, null, 2)], { type: "application/json" }), d = URL.createObjectURL(l), o = document.createElement("a");
2251
- o.href = d, o.download = `${n.name.replace(/\s+/g, "_")}.json`, o.click(), URL.revokeObjectURL(d);
2258
+ function Si(n) {
2259
+ const o = new Blob([JSON.stringify(n, null, 2)], { type: "application/json" }), m = URL.createObjectURL(o), l = document.createElement("a");
2260
+ l.href = m, l.download = `${n.name.replace(/\s+/g, "_")}.json`, l.click(), URL.revokeObjectURL(m);
2252
2261
  }
2253
- const lr = ({
2254
- templates: n,
2255
- selectedId: l,
2256
- onSelect: d,
2257
- onImport: o,
2258
- onExport: S,
2259
- onDelete: b,
2260
- onNew: m,
2261
- className: I,
2262
- style: h,
2263
- theme: f = "light"
2262
+ const dr = ({
2263
+ templates: n = Ni,
2264
+ selectedId: o,
2265
+ onSelect: m,
2266
+ onImport: l,
2267
+ onExport: C,
2268
+ onDelete: v,
2269
+ onNew: g,
2270
+ className: _,
2271
+ style: b,
2272
+ theme: k = "light"
2264
2273
  }) => {
2265
- const { t: s } = J(), [z, w] = F(""), [L, r] = F(null), [i, _] = F(null), p = Ke.useRef(null), k = async (g) => {
2266
- var v;
2267
- const $ = (v = g.target.files) == null ? void 0 : v[0];
2268
- if ($) {
2274
+ const { t: h } = j(), [r, S] = H(""), [I, x] = H(null), [s, i] = H(null), d = Ke.useRef(null), u = async (y) => {
2275
+ var T;
2276
+ const R = (T = y.target.files) == null ? void 0 : T[0];
2277
+ if (R) {
2269
2278
  try {
2270
- const q = await fi($);
2271
- o == null || o(q);
2279
+ const $ = await ki(R);
2280
+ l == null || l($);
2272
2281
  } catch {
2273
2282
  }
2274
- g.target.value = "";
2283
+ y.target.value = "";
2275
2284
  }
2276
- }, H = n.filter((g) => {
2277
- const $ = !z || g.name.toLowerCase().includes(z.toLowerCase()) || (g.description ?? "").toLowerCase().includes(z.toLowerCase()) || (g.tags ?? []).some((q) => q.toLowerCase().includes(z.toLowerCase())), v = !L || g.category === L;
2278
- return $ && v;
2285
+ }, z = n.filter((y) => {
2286
+ const R = !r || y.name.toLowerCase().includes(r.toLowerCase()) || (y.description ?? "").toLowerCase().includes(r.toLowerCase()) || (y.tags ?? []).some(($) => $.toLowerCase().includes(r.toLowerCase())), T = !I || y.category === I;
2287
+ return R && T;
2279
2288
  });
2280
2289
  return /* @__PURE__ */ a(
2281
2290
  "div",
2282
2291
  {
2283
- className: `${x.root} ${f === "dark" ? x.dark : ""} ${I ?? ""}`,
2284
- style: h,
2292
+ className: `${D.root} ${k === "dark" ? D.dark : ""} ${_ ?? ""}`,
2293
+ style: b,
2285
2294
  children: [
2286
- /* @__PURE__ */ a("div", { className: x.topBar, children: [
2295
+ /* @__PURE__ */ a("div", { className: D.topBar, children: [
2287
2296
  /* @__PURE__ */ e(
2288
2297
  "input",
2289
2298
  {
2290
2299
  type: "search",
2291
- className: x.searchInput,
2292
- placeholder: s("printing.searchTemplates", "Search templates…"),
2293
- value: z,
2294
- onChange: (g) => w(g.target.value)
2300
+ className: D.searchInput,
2301
+ placeholder: h("printing.searchTemplates", "Search templates…"),
2302
+ value: r,
2303
+ onChange: (y) => S(y.target.value)
2295
2304
  }
2296
2305
  ),
2297
2306
  /* @__PURE__ */ a(
2298
2307
  "button",
2299
2308
  {
2300
- className: x.actionBtn,
2301
- onClick: m,
2302
- title: s("printing.newTemplate", "New template"),
2309
+ className: D.actionBtn,
2310
+ onClick: g,
2311
+ title: h("printing.newTemplate", "New template"),
2303
2312
  children: [
2304
- /* @__PURE__ */ e(N, { name: "plus", size: 14 }),
2313
+ /* @__PURE__ */ e(w, { name: "plus", size: 14 }),
2305
2314
  " ",
2306
- s("printing.new", "New")
2315
+ h("printing.new", "New")
2307
2316
  ]
2308
2317
  }
2309
2318
  ),
2310
2319
  /* @__PURE__ */ a(
2311
2320
  "button",
2312
2321
  {
2313
- className: x.actionBtn,
2322
+ className: D.actionBtn,
2314
2323
  onClick: () => {
2315
- var g;
2316
- return (g = p.current) == null ? void 0 : g.click();
2324
+ var y;
2325
+ return (y = d.current) == null ? void 0 : y.click();
2317
2326
  },
2318
- title: s("printing.importJson", "Import JSON"),
2327
+ title: h("printing.importJson", "Import JSON"),
2319
2328
  children: [
2320
- /* @__PURE__ */ e(N, { name: "upload", size: 14 }),
2329
+ /* @__PURE__ */ e(w, { name: "upload", size: 14 }),
2321
2330
  " ",
2322
- s("printing.import", "Import")
2331
+ h("printing.import", "Import")
2323
2332
  ]
2324
2333
  }
2325
2334
  ),
2326
- /* @__PURE__ */ e("input", { ref: p, type: "file", accept: ".json", hidden: !0, onChange: k })
2335
+ /* @__PURE__ */ e("input", { ref: d, type: "file", accept: ".json", hidden: !0, onChange: u })
2327
2336
  ] }),
2328
- /* @__PURE__ */ a("div", { className: x.categoryRow, children: [
2337
+ /* @__PURE__ */ a("div", { className: D.categoryRow, children: [
2329
2338
  /* @__PURE__ */ e(
2330
2339
  "button",
2331
2340
  {
2332
- className: `${x.catChip} ${L ? "" : x.catChipActive}`,
2333
- onClick: () => r(null),
2334
- children: s("printing.filter.all", "All")
2341
+ className: `${D.catChip} ${I ? "" : D.catChipActive}`,
2342
+ onClick: () => x(null),
2343
+ children: h("printing.filter.all", "All")
2335
2344
  }
2336
2345
  ),
2337
- Ni.map((g) => /* @__PURE__ */ e(
2346
+ wi.map((y) => /* @__PURE__ */ e(
2338
2347
  "button",
2339
2348
  {
2340
- className: `${x.catChip} ${L === g.fallback ? x.catChipActive : ""}`,
2341
- onClick: () => r(($) => $ === g.fallback ? null : g.fallback),
2342
- children: s(g.key, g.fallback)
2349
+ className: `${D.catChip} ${I === y.fallback ? D.catChipActive : ""}`,
2350
+ onClick: () => x((R) => R === y.fallback ? null : y.fallback),
2351
+ children: h(y.key, y.fallback)
2343
2352
  },
2344
- g.key
2353
+ y.key
2345
2354
  ))
2346
2355
  ] }),
2347
- /* @__PURE__ */ a("div", { className: x.grid, children: [
2348
- H.map((g) => /* @__PURE__ */ a(
2356
+ /* @__PURE__ */ a("div", { className: D.grid, children: [
2357
+ z.map((y) => /* @__PURE__ */ a(
2349
2358
  "div",
2350
2359
  {
2351
- className: `${x.card} ${l === g.id ? x.cardSelected : ""}`,
2352
- onClick: () => d == null ? void 0 : d(g),
2353
- onMouseEnter: () => _(g.id),
2354
- onMouseLeave: () => _(null),
2360
+ className: `${D.card} ${o === y.id ? D.cardSelected : ""}`,
2361
+ onClick: () => m == null ? void 0 : m(y),
2362
+ onMouseEnter: () => i(y.id),
2363
+ onMouseLeave: () => i(null),
2355
2364
  children: [
2356
- /* @__PURE__ */ a("div", { className: x.thumbnail, children: [
2357
- g.previewImageUrl ? /* @__PURE__ */ e("img", { src: g.previewImageUrl, alt: g.name, className: x.thumbnailImg }) : /* @__PURE__ */ e("div", { className: x.thumbnailPlaceholder, children: /* @__PURE__ */ a("div", { className: x.paperMini, children: [
2365
+ /* @__PURE__ */ a("div", { className: D.thumbnail, children: [
2366
+ y.previewImageUrl ? /* @__PURE__ */ e("img", { src: y.previewImageUrl, alt: y.name, className: D.thumbnailImg }) : /* @__PURE__ */ e("div", { className: D.thumbnailPlaceholder, children: /* @__PURE__ */ a("div", { className: D.paperMini, children: [
2358
2367
  /* @__PURE__ */ e(
2359
2368
  "div",
2360
2369
  {
2361
- className: x.paperLine,
2370
+ className: D.paperLine,
2362
2371
  style: { width: "80%" }
2363
2372
  }
2364
2373
  ),
2365
2374
  /* @__PURE__ */ e(
2366
2375
  "div",
2367
2376
  {
2368
- className: x.paperLine,
2377
+ className: D.paperLine,
2369
2378
  style: { width: "60%" }
2370
2379
  }
2371
2380
  ),
2372
2381
  /* @__PURE__ */ e(
2373
2382
  "div",
2374
2383
  {
2375
- className: x.paperLine,
2384
+ className: D.paperLine,
2376
2385
  style: { width: "90%" }
2377
2386
  }
2378
2387
  ),
2379
2388
  /* @__PURE__ */ e(
2380
2389
  "div",
2381
2390
  {
2382
- className: x.paperLine,
2391
+ className: D.paperLine,
2383
2392
  style: { width: "50%" }
2384
2393
  }
2385
2394
  )
2386
2395
  ] }) }),
2387
- i === g.id && /* @__PURE__ */ a("div", { className: x.cardOverlay, children: [
2396
+ s === y.id && /* @__PURE__ */ a("div", { className: D.cardOverlay, children: [
2388
2397
  /* @__PURE__ */ e(
2389
2398
  "button",
2390
2399
  {
2391
- className: x.overlayBtn,
2392
- onClick: ($) => {
2393
- $.stopPropagation(), S == null || S(g), wi(g);
2400
+ className: D.overlayBtn,
2401
+ onClick: (R) => {
2402
+ R.stopPropagation(), C == null || C(y), Si(y);
2394
2403
  },
2395
- title: s("printing.export", "Export"),
2396
- children: /* @__PURE__ */ e(N, { name: "download", size: 14 })
2404
+ title: h("printing.export", "Export"),
2405
+ children: /* @__PURE__ */ e(w, { name: "download", size: 14 })
2397
2406
  }
2398
2407
  ),
2399
- b && /* @__PURE__ */ e(
2408
+ v && /* @__PURE__ */ e(
2400
2409
  "button",
2401
2410
  {
2402
- className: x.overlayBtnDanger,
2403
- onClick: ($) => {
2404
- $.stopPropagation(), b(g.id);
2411
+ className: D.overlayBtnDanger,
2412
+ onClick: (R) => {
2413
+ R.stopPropagation(), v(y.id);
2405
2414
  },
2406
- title: s("printing.action.remove", "Remove"),
2407
- children: /* @__PURE__ */ e(N, { name: "trash", size: 14 })
2415
+ title: h("printing.action.remove", "Remove"),
2416
+ children: /* @__PURE__ */ e(w, { name: "trash", size: 14 })
2408
2417
  }
2409
2418
  )
2410
2419
  ] })
2411
2420
  ] }),
2412
- /* @__PURE__ */ a("div", { className: x.cardBody, children: [
2413
- /* @__PURE__ */ e("div", { className: x.cardName, children: g.name }),
2414
- g.description && /* @__PURE__ */ e("div", { className: x.cardDesc, children: g.description }),
2415
- /* @__PURE__ */ a("div", { className: x.cardMeta, children: [
2416
- /* @__PURE__ */ a("span", { className: x.cardSize, children: [
2417
- g.paperSize,
2421
+ /* @__PURE__ */ a("div", { className: D.cardBody, children: [
2422
+ /* @__PURE__ */ e("div", { className: D.cardName, children: y.name }),
2423
+ y.description && /* @__PURE__ */ e("div", { className: D.cardDesc, children: y.description }),
2424
+ /* @__PURE__ */ a("div", { className: D.cardMeta, children: [
2425
+ /* @__PURE__ */ a("span", { className: D.cardSize, children: [
2426
+ y.paperSize,
2418
2427
  " ",
2419
- g.orientation === "landscape" ? s("printing.orientation.landscape", "landscape") : s("printing.orientation.portrait", "portrait")
2428
+ y.orientation === "landscape" ? h("printing.orientation.landscape", "landscape") : h("printing.orientation.portrait", "portrait")
2420
2429
  ] }),
2421
- g.category && /* @__PURE__ */ e("span", { className: x.cardCat, children: g.category })
2430
+ y.category && /* @__PURE__ */ e("span", { className: D.cardCat, children: y.category })
2422
2431
  ] }),
2423
- g.tags && g.tags.length > 0 && /* @__PURE__ */ e("div", { className: x.cardTags, children: g.tags.slice(0, 3).map(($) => /* @__PURE__ */ e("span", { className: x.cardTag, children: $ }, $)) })
2432
+ y.tags && y.tags.length > 0 && /* @__PURE__ */ e("div", { className: D.cardTags, children: y.tags.slice(0, 3).map((R) => /* @__PURE__ */ e("span", { className: D.cardTag, children: R }, R)) })
2424
2433
  ] })
2425
2434
  ]
2426
2435
  },
2427
- g.id
2436
+ y.id
2428
2437
  )),
2429
- H.length === 0 && /* @__PURE__ */ a("div", { className: x.emptyState, children: [
2430
- /* @__PURE__ */ e("span", { className: x.emptyIcon, children: /* @__PURE__ */ e(N, { name: "file", size: 32 }) }),
2431
- /* @__PURE__ */ e("span", { children: z ? `${s("printing.noMatches", "No matches for")} "${z}"` : s("printing.noTemplates", "No templates yet.") })
2438
+ z.length === 0 && /* @__PURE__ */ a("div", { className: D.emptyState, children: [
2439
+ /* @__PURE__ */ e("span", { className: D.emptyIcon, children: /* @__PURE__ */ e(w, { name: "file", size: 32 }) }),
2440
+ /* @__PURE__ */ e("span", { children: r ? `${h("printing.noMatches", "No matches for")} "${r}"` : h("printing.noTemplates", "No templates yet.") })
2432
2441
  ] })
2433
2442
  ] })
2434
2443
  ]
2435
2444
  }
2436
2445
  );
2437
- }, ki = "_root_91917_1", Si = "_dark_91917_19", Ci = "_headerBar_91917_31", Bi = "_entityNav_91917_59", Ii = "_navBtn_91917_69", Li = "_navLabel_91917_103", xi = "_sampleBadge_91917_117", zi = "_zoomBar_91917_135", Ti = "_zoomBtn_91917_147", Di = "_zoomLabel_91917_179", $i = "_printBtn_91917_193", Ri = "_canvas_91917_223", Ai = "_page_91917_243", Mi = "_watermark_91917_269", Pi = "_footerBar_91917_299", W = {
2438
- root: ki,
2439
- dark: Si,
2440
- headerBar: Ci,
2441
- entityNav: Bi,
2442
- navBtn: Ii,
2443
- navLabel: Li,
2444
- sampleBadge: xi,
2445
- zoomBar: zi,
2446
- zoomBtn: Ti,
2447
- zoomLabel: Di,
2448
- printBtn: $i,
2449
- canvas: Ri,
2450
- page: Ai,
2451
- watermark: Mi,
2452
- footerBar: Pi
2453
- }, Z = 3.78, De = {
2446
+ }, Ci = "_root_18ja1_1", Bi = "_dark_18ja1_19", Ii = "_headerBar_18ja1_31", Li = "_entityNav_18ja1_59", xi = "_navBtn_18ja1_69", zi = "_navLabel_18ja1_103", Ti = "_sampleBadge_18ja1_117", $i = "_zoomBar_18ja1_135", Di = "_zoomBtn_18ja1_147", Ri = "_zoomLabel_18ja1_179", Ei = "_printBtn_18ja1_193", Ai = "_canvas_18ja1_223", Mi = "_page_18ja1_243", Pi = "_watermark_18ja1_269", Fi = "_footerBar_18ja1_299", q = {
2447
+ root: Ci,
2448
+ dark: Bi,
2449
+ headerBar: Ii,
2450
+ entityNav: Li,
2451
+ navBtn: xi,
2452
+ navLabel: zi,
2453
+ sampleBadge: Ti,
2454
+ zoomBar: $i,
2455
+ zoomBtn: Di,
2456
+ zoomLabel: Ri,
2457
+ printBtn: Ei,
2458
+ canvas: Ai,
2459
+ page: Mi,
2460
+ watermark: Pi,
2461
+ footerBar: Fi
2462
+ }, Q = 3.78, $e = {
2454
2463
  A3: [297, 420],
2455
2464
  A4: [210, 297],
2456
2465
  A5: [148, 210],
@@ -2459,42 +2468,42 @@ const lr = ({
2459
2468
  Legal: [216, 356],
2460
2469
  Tabloid: [279, 432]
2461
2470
  };
2462
- function Ei(n, l) {
2471
+ function Hi(n, o) {
2463
2472
  try {
2464
- return n.split(".").reduce((d, o) => d && typeof d == "object" ? d[o] : null, l);
2473
+ return n.split(".").reduce((m, l) => m && typeof m == "object" ? m[l] : null, o);
2465
2474
  } catch {
2466
2475
  return null;
2467
2476
  }
2468
2477
  }
2469
- function Fi(n, l, d) {
2478
+ function Gi(n, o, m) {
2470
2479
  if (n == null)
2471
2480
  return "";
2472
- if (l === "date" && d)
2481
+ if (o === "date" && m)
2473
2482
  try {
2474
- const o = new Date(n);
2475
- if (d === "DD.MM.YYYY") {
2476
- const S = String(o.getDate()).padStart(2, "0"), b = String(o.getMonth() + 1).padStart(2, "0");
2477
- return `${S}.${b}.${o.getFullYear()}`;
2483
+ const l = new Date(n);
2484
+ if (m === "DD.MM.YYYY") {
2485
+ const C = String(l.getDate()).padStart(2, "0"), v = String(l.getMonth() + 1).padStart(2, "0");
2486
+ return `${C}.${v}.${l.getFullYear()}`;
2478
2487
  }
2479
- return o.toLocaleDateString();
2488
+ return l.toLocaleDateString();
2480
2489
  } catch {
2481
2490
  return String(n);
2482
2491
  }
2483
- if (l === "currency" && d) {
2484
- const o = Number(n);
2485
- if (!isNaN(o))
2486
- return `${o.toFixed(2)} ${d}`;
2492
+ if (o === "currency" && m) {
2493
+ const l = Number(n);
2494
+ if (!isNaN(l))
2495
+ return `${l.toFixed(2)} ${m}`;
2487
2496
  }
2488
- return l === "number" && typeof n == "number" ? n.toLocaleString("pl-PL") : String(n);
2497
+ return o === "number" && typeof n == "number" ? n.toLocaleString("pl-PL") : String(n);
2489
2498
  }
2490
- const Hi = ({ field: n, data: l, zoom: d }) => {
2491
- const o = n.dataPath ? Ei(n.dataPath, l) : null, S = o != null ? Fi(o, n.type, n.format) : n.fallback ?? "", b = (I) => I * d * Z, m = {
2499
+ const Oi = ({ field: n, data: o, zoom: m }) => {
2500
+ const l = n.dataPath ? Hi(n.dataPath, o) : null, C = l != null ? Gi(l, n.type, n.format) : n.fallback ?? "", v = (_) => _ * m * Q, g = {
2492
2501
  position: "absolute",
2493
- left: b(n.position.x),
2494
- top: b(n.position.y),
2495
- width: b(n.position.width),
2496
- height: b(n.position.height),
2497
- fontSize: (n.style.fontSize ?? 10) * d,
2502
+ left: v(n.position.x),
2503
+ top: v(n.position.y),
2504
+ width: v(n.position.width),
2505
+ height: v(n.position.height),
2506
+ fontSize: (n.style.fontSize ?? 10) * m,
2498
2507
  fontWeight: n.style.fontWeight ?? "normal",
2499
2508
  fontStyle: n.style.fontStyle ?? "normal",
2500
2509
  color: n.style.color ?? "var(--nice-text-primary, #0f172a)",
@@ -2505,7 +2514,7 @@ const Hi = ({ field: n, data: l, zoom: d }) => {
2505
2514
  display: "flex",
2506
2515
  alignItems: n.style.verticalAlign === "middle" ? "center" : n.style.verticalAlign === "bottom" ? "flex-end" : "flex-start",
2507
2516
  lineHeight: n.style.lineHeight ?? 1.4,
2508
- padding: n.style.padding ? b(n.style.padding) : 0,
2517
+ padding: n.style.padding ? v(n.style.padding) : 0,
2509
2518
  boxSizing: "border-box",
2510
2519
  borderWidth: n.style.borderWidth,
2511
2520
  borderColor: n.style.borderColor,
@@ -2513,10 +2522,10 @@ const Hi = ({ field: n, data: l, zoom: d }) => {
2513
2522
  borderRadius: n.style.borderRadius,
2514
2523
  zIndex: n.position.zIndex ?? 1
2515
2524
  };
2516
- return n.type === "image" && o ? /* @__PURE__ */ e("div", { style: m, children: /* @__PURE__ */ e(
2525
+ return n.type === "image" && l ? /* @__PURE__ */ e("div", { style: g, children: /* @__PURE__ */ e(
2517
2526
  "img",
2518
2527
  {
2519
- src: String(o),
2528
+ src: String(l),
2520
2529
  alt: "",
2521
2530
  style: { width: "100%", height: "100%", objectFit: "contain" }
2522
2531
  }
@@ -2524,189 +2533,198 @@ const Hi = ({ field: n, data: l, zoom: d }) => {
2524
2533
  "div",
2525
2534
  {
2526
2535
  style: {
2527
- ...m,
2536
+ ...g,
2528
2537
  background: "var(--nice-bg-secondary, #f8fafc)",
2529
2538
  border: "1px dashed var(--nice-border-color, #e2e8f0)",
2530
2539
  alignItems: "center",
2531
2540
  justifyContent: "center",
2532
- fontSize: 10 * d
2541
+ fontSize: 10 * m
2533
2542
  },
2534
2543
  children: [
2535
- /* @__PURE__ */ e(N, { name: n.type === "qr" ? "qr-code" : "barcode", size: 12 * d }),
2544
+ /* @__PURE__ */ e(w, { name: n.type === "qr" ? "qr-code" : "barcode", size: 12 * m }),
2536
2545
  " ",
2537
- S
2546
+ C
2538
2547
  ]
2539
2548
  }
2540
2549
  ) : n.type === "signature" ? /* @__PURE__ */ e(
2541
2550
  "div",
2542
2551
  {
2543
2552
  style: {
2544
- ...m,
2553
+ ...g,
2545
2554
  borderBottom: "1px solid var(--nice-border-color, #0f172a)",
2546
2555
  alignItems: "flex-end"
2547
2556
  },
2548
- children: /* @__PURE__ */ e("span", { style: { fontSize: 8 * d, color: "var(--nice-text-muted, #94a3b8)" }, children: n.label })
2557
+ children: /* @__PURE__ */ e("span", { style: { fontSize: 8 * m, color: "var(--nice-text-muted, #94a3b8)" }, children: n.label })
2549
2558
  }
2550
2559
  ) : n.type === "line" ? /* @__PURE__ */ e(
2551
2560
  "div",
2552
2561
  {
2553
2562
  style: {
2554
- ...m,
2563
+ ...g,
2555
2564
  borderBottom: `${n.style.borderWidth ?? 1}px ${n.style.borderStyle ?? "solid"} ${n.style.borderColor ?? "var(--nice-text-primary, #0f172a)"}`
2556
2565
  }
2557
2566
  }
2558
- ) : /* @__PURE__ */ e("div", { style: m, children: S });
2559
- }, Gi = ({ template: n, data: l, zoom: d }) => {
2560
- var I;
2561
- const [o, S] = (() => {
2562
- const [h, f] = De[n.paperSize] ?? De.A4;
2563
- return n.orientation === "landscape" ? [f * Z * d, h * Z * d] : [h * Z * d, f * Z * d];
2564
- })(), b = n.margins, m = n.sections.flatMap((h) => h.fields);
2565
- return /* @__PURE__ */ a("div", { className: W.page, style: { width: o, minHeight: S }, children: [
2567
+ ) : /* @__PURE__ */ e("div", { style: g, children: C });
2568
+ }, qi = ({ template: n, data: o, zoom: m }) => {
2569
+ var _;
2570
+ const [l, C] = (() => {
2571
+ const [b, k] = $e[n.paperSize] ?? $e.A4;
2572
+ return n.orientation === "landscape" ? [k * Q * m, b * Q * m] : [b * Q * m, k * Q * m];
2573
+ })(), v = n.margins, g = n.sections.flatMap((b) => b.fields);
2574
+ return /* @__PURE__ */ a("div", { className: q.page, style: { width: l, minHeight: C }, children: [
2566
2575
  /* @__PURE__ */ e(
2567
2576
  "div",
2568
2577
  {
2569
2578
  style: {
2570
2579
  position: "absolute",
2571
- top: b.top * d * Z,
2572
- left: b.left * d * Z,
2573
- right: b.right * d * Z,
2574
- bottom: b.bottom * d * Z
2580
+ top: v.top * m * Q,
2581
+ left: v.left * m * Q,
2582
+ right: v.right * m * Q,
2583
+ bottom: v.bottom * m * Q
2575
2584
  },
2576
- children: m.map((h) => /* @__PURE__ */ e(Hi, { field: h, data: l, zoom: d }, h.id))
2585
+ children: g.map((b) => /* @__PURE__ */ e(Oi, { field: b, data: o, zoom: m }, b.id))
2577
2586
  }
2578
2587
  ),
2579
- (I = n.watermarks) == null ? void 0 : I.map((h) => /* @__PURE__ */ e(
2588
+ (_ = n.watermarks) == null ? void 0 : _.map((b) => /* @__PURE__ */ e(
2580
2589
  "div",
2581
2590
  {
2582
- className: W.watermark,
2591
+ className: q.watermark,
2583
2592
  style: {
2584
- opacity: h.opacity,
2585
- transform: `rotate(${h.angle}deg)`,
2586
- fontSize: (h.fontSize ?? 48) * d
2593
+ opacity: b.opacity,
2594
+ transform: `rotate(${b.angle}deg)`,
2595
+ fontSize: (b.fontSize ?? 48) * m
2587
2596
  },
2588
- children: h.type === "text" ? h.text : /* @__PURE__ */ e(
2597
+ children: b.type === "text" ? b.text : /* @__PURE__ */ e(
2589
2598
  "img",
2590
2599
  {
2591
- src: h.imageUrl,
2600
+ src: b.imageUrl,
2592
2601
  alt: "wm",
2593
- style: { maxWidth: 200 * d }
2602
+ style: { maxWidth: 200 * m }
2594
2603
  }
2595
2604
  )
2596
2605
  },
2597
- h.id
2606
+ b.id
2598
2607
  ))
2599
2608
  ] });
2600
- }, or = ({
2609
+ }, mr = ({
2601
2610
  template: n,
2602
- entities: l = [],
2603
- sampleData: d,
2604
- onPrint: o,
2605
- className: S,
2606
- style: b,
2607
- theme: m = "light",
2608
- asPopup: I = !0,
2609
- open: h,
2610
- onClose: f
2611
+ entities: o = [],
2612
+ sampleData: m,
2613
+ onPrint: l,
2614
+ className: C,
2615
+ style: v,
2616
+ theme: g = "light",
2617
+ asPopup: _ = !0,
2618
+ open: b,
2619
+ onClose: k
2611
2620
  }) => {
2612
- const { t: s } = J(), [z, w] = F(0), [L, r] = F(0.8), [i, _] = F(!0), p = h !== void 0, k = p ? h : i, H = () => {
2613
- p || _(!1), f == null || f();
2621
+ const { t: h } = j(), [r, S] = H(0), [I, x] = H(0.8), [s, i] = H(!0), d = b !== void 0, u = d ? b : s, z = () => {
2622
+ d || i(!1), k == null || k();
2614
2623
  };
2615
2624
  Se(() => {
2616
- if (!I || !k)
2625
+ if (!_ || !u)
2617
2626
  return;
2618
- const D = (K) => {
2619
- K.key === "Escape" && H();
2627
+ const A = (Y) => {
2628
+ Y.key === "Escape" && z();
2620
2629
  };
2621
- return document.addEventListener("keydown", D), document.body.style.overflow = "hidden", () => {
2622
- document.removeEventListener("keydown", D), document.body.style.overflow = "";
2630
+ return document.addEventListener("keydown", A), document.body.style.overflow = "hidden", () => {
2631
+ document.removeEventListener("keydown", A), document.body.style.overflow = "";
2623
2632
  };
2624
- }, [I, k]);
2625
- const g = me(() => l.length > 0 ? l : d ? [d.data] : [{}], [l, d]), $ = g[z] ?? {};
2626
- if (I && !k)
2633
+ }, [_, u]);
2634
+ const y = ue(() => o.length > 0 ? o : m ? [m.data] : [{}], [o, m]), R = y[r] ?? {};
2635
+ if (_ && !u)
2627
2636
  return null;
2628
- const v = /* @__PURE__ */ a(
2637
+ const T = /* @__PURE__ */ a(
2629
2638
  "div",
2630
2639
  {
2631
- className: `${W.root} ${m === "dark" ? W.dark : ""} ${S ?? ""}`,
2632
- style: b,
2640
+ className: `${q.root} ${g === "dark" ? q.dark : ""} ${C ?? ""}`,
2641
+ style: v,
2633
2642
  children: [
2634
- /* @__PURE__ */ a("div", { className: W.headerBar, children: [
2635
- /* @__PURE__ */ a("div", { className: W.entityNav, children: [
2636
- g.length > 1 && /* @__PURE__ */ a(j, { children: [
2643
+ /* @__PURE__ */ a("div", { className: q.headerBar, children: [
2644
+ /* @__PURE__ */ a("div", { className: q.entityNav, children: [
2645
+ y.length > 1 && /* @__PURE__ */ a(X, { children: [
2637
2646
  /* @__PURE__ */ e(
2638
2647
  "button",
2639
2648
  {
2640
- className: W.navBtn,
2641
- disabled: z === 0,
2642
- onClick: () => w((D) => D - 1),
2649
+ className: q.navBtn,
2650
+ disabled: r === 0,
2651
+ onClick: () => S((A) => A - 1),
2643
2652
  children: "‹"
2644
2653
  }
2645
2654
  ),
2646
- /* @__PURE__ */ a("span", { className: W.navLabel, children: [
2647
- z + 1,
2655
+ /* @__PURE__ */ a("span", { className: q.navLabel, children: [
2656
+ r + 1,
2648
2657
  " / ",
2649
- g.length
2658
+ y.length
2650
2659
  ] }),
2651
2660
  /* @__PURE__ */ e(
2652
2661
  "button",
2653
2662
  {
2654
- className: W.navBtn,
2655
- disabled: z >= g.length - 1,
2656
- onClick: () => w((D) => D + 1),
2663
+ className: q.navBtn,
2664
+ disabled: r >= y.length - 1,
2665
+ onClick: () => S((A) => A + 1),
2657
2666
  children: "›"
2658
2667
  }
2659
2668
  )
2660
2669
  ] }),
2661
- l.length === 0 && d && /* @__PURE__ */ e("span", { className: W.sampleBadge, children: s("printing.sampleData", "Sample data") })
2670
+ o.length === 0 && m && /* @__PURE__ */ e("span", { className: q.sampleBadge, children: h("printing.sampleData", "Sample data") })
2662
2671
  ] }),
2663
- /* @__PURE__ */ a("div", { className: W.zoomBar, children: [
2664
- /* @__PURE__ */ e("button", { className: W.zoomBtn, onClick: () => r((D) => Math.max(0.3, D - 0.1)), children: "−" }),
2665
- /* @__PURE__ */ a("span", { className: W.zoomLabel, children: [
2666
- Math.round(L * 100),
2672
+ /* @__PURE__ */ a("div", { className: q.zoomBar, children: [
2673
+ /* @__PURE__ */ e("button", { className: q.zoomBtn, onClick: () => x((A) => Math.max(0.3, A - 0.1)), children: "−" }),
2674
+ /* @__PURE__ */ a("span", { className: q.zoomLabel, children: [
2675
+ Math.round(I * 100),
2667
2676
  "%"
2668
2677
  ] }),
2669
- /* @__PURE__ */ e("button", { className: W.zoomBtn, onClick: () => r((D) => Math.min(2.5, D + 0.1)), children: "+" }),
2670
- /* @__PURE__ */ e("button", { className: W.zoomBtn, onClick: () => r(0.8), title: "Dopasuj", children: "⊡" })
2678
+ /* @__PURE__ */ e("button", { className: q.zoomBtn, onClick: () => x((A) => Math.min(2.5, A + 0.1)), children: "+" }),
2679
+ /* @__PURE__ */ e(
2680
+ "button",
2681
+ {
2682
+ className: q.zoomBtn,
2683
+ onClick: () => x(0.8),
2684
+ title: h("printing.fit", "Fit"),
2685
+ children: "⊡"
2686
+ }
2687
+ )
2671
2688
  ] }),
2672
2689
  /* @__PURE__ */ a("div", { style: { display: "flex", gap: 8 }, children: [
2673
2690
  /* @__PURE__ */ e(
2674
2691
  "button",
2675
2692
  {
2676
- className: W.printBtn,
2677
- onClick: () => o == null ? void 0 : o({ copies: 1, printerId: "" }),
2678
- children: s("printPreview.print", "Print")
2693
+ className: q.printBtn,
2694
+ onClick: () => l == null ? void 0 : l({ copies: 1, printerId: "" }),
2695
+ children: h("printPreview.print", "Print")
2679
2696
  }
2680
2697
  ),
2681
- I && /* @__PURE__ */ e(
2698
+ _ && /* @__PURE__ */ e(
2682
2699
  "button",
2683
2700
  {
2684
2701
  type: "button",
2685
- className: W.zoomBtn,
2686
- onClick: H,
2687
- "aria-label": s("close", "Close"),
2688
- title: s("close", "Close"),
2689
- children: /* @__PURE__ */ e(N, { name: "close", size: 16 })
2702
+ className: q.zoomBtn,
2703
+ onClick: z,
2704
+ "aria-label": h("close", "Close"),
2705
+ title: h("close", "Close"),
2706
+ children: /* @__PURE__ */ e(w, { name: "close", size: 16 })
2690
2707
  }
2691
2708
  )
2692
2709
  ] })
2693
2710
  ] }),
2694
- /* @__PURE__ */ e("div", { className: W.canvas, children: /* @__PURE__ */ e(Gi, { template: n, data: $, zoom: L }) }),
2695
- /* @__PURE__ */ a("div", { className: W.footerBar, children: [
2711
+ /* @__PURE__ */ e("div", { className: q.canvas, children: /* @__PURE__ */ e(qi, { template: n, data: R, zoom: I }) }),
2712
+ /* @__PURE__ */ a("div", { className: q.footerBar, children: [
2696
2713
  /* @__PURE__ */ e("span", { children: n.name }),
2697
2714
  /* @__PURE__ */ a("span", { children: [
2698
2715
  n.paperSize,
2699
- " · ",
2700
- n.orientation === "portrait" ? "Pion" : "Poziom"
2716
+ " ·",
2717
+ " ",
2718
+ n.orientation === "portrait" ? h("printing.portrait", "Portrait") : h("printing.landscape", "Landscape")
2701
2719
  ] }),
2702
- n.sections.reduce((D, K) => D + K.fields.length, 0),
2720
+ n.sections.reduce((A, Y) => A + Y.fields.length, 0),
2703
2721
  " ",
2704
- s("printing.fields", "fields")
2722
+ h("printing.fields", "fields")
2705
2723
  ] })
2706
2724
  ]
2707
2725
  }
2708
2726
  );
2709
- return I ? Qe(/* @__PURE__ */ e(
2727
+ return _ ? Ze(/* @__PURE__ */ e(
2710
2728
  "div",
2711
2729
  {
2712
2730
  style: {
@@ -2719,8 +2737,8 @@ const Hi = ({ field: n, data: l, zoom: d }) => {
2719
2737
  zIndex: 1e3,
2720
2738
  padding: 24
2721
2739
  },
2722
- onMouseDown: (D) => {
2723
- D.target === D.currentTarget && H();
2740
+ onMouseDown: (A) => {
2741
+ A.target === A.currentTarget && z();
2724
2742
  },
2725
2743
  role: "presentation",
2726
2744
  children: /* @__PURE__ */ e(
@@ -2736,507 +2754,507 @@ const Hi = ({ field: n, data: l, zoom: d }) => {
2736
2754
  maxHeight: "90vh",
2737
2755
  overflow: "auto"
2738
2756
  },
2739
- children: v
2757
+ children: T
2740
2758
  }
2741
2759
  )
2742
2760
  }
2743
- ), document.body) : v;
2744
- }, Oi = "_root_lbbp6_1", qi = "_dark_lbbp6_23", Wi = "_statsBar_lbbp6_37", Ui = "_stat_lbbp6_37", Yi = "_dot_lbbp6_75", Vi = "_statPrinting_lbbp6_87", ji = "_statQueued_lbbp6_93", Ki = "_statDone_lbbp6_99", Xi = "_statError_lbbp6_105", Ji = "_toolbar_lbbp6_115", Qi = "_filterTabs_lbbp6_139", Zi = "_filterTab_lbbp6_139", es = "_filterTabActive_lbbp6_177", ts = "_filterCount_lbbp6_187", ns = "_bulkActions_lbbp6_211", as = "_bulkCount_lbbp6_223", is = "_bulkBtn_lbbp6_231", ss = "_bulkBtnRemove_lbbp6_255", rs = "_jobList_lbbp6_273", ls = "_listHeader_lbbp6_281", os = "_headerLabel_lbbp6_313", cs = "_jobRow_lbbp6_323", ds = "_jobRowSelected_lbbp6_359", ps = "_jobCheckbox_lbbp6_373", us = "_statusBadge_lbbp6_387", ms = "_pulse_lbbp6_1", hs = "_jobInfo_lbbp6_479", _s = "_jobName_lbbp6_485", gs = "_jobMeta_lbbp6_497", bs = "_jobTime_lbbp6_513", ys = "_jobDuration_lbbp6_519", vs = "_jobError_lbbp6_525", Ns = "_progressBar_lbbp6_539", fs = "_progressFill_lbbp6_553", ws = "_copiesEditor_lbbp6_569", ks = "_copiesBtn_lbbp6_581", Ss = "_copiesValue_lbbp6_621", Cs = "_jobActions_lbbp6_635", Bs = "_actionBtn_lbbp6_645", Is = "_removeBtn_lbbp6_677", Ls = "_emptyState_lbbp6_695", y = {
2745
- root: Oi,
2746
- dark: qi,
2747
- statsBar: Wi,
2748
- stat: Ui,
2749
- dot: Yi,
2750
- statPrinting: Vi,
2751
- statQueued: ji,
2752
- statDone: Ki,
2753
- statError: Xi,
2754
- toolbar: Ji,
2755
- filterTabs: Qi,
2756
- filterTab: Zi,
2757
- filterTabActive: es,
2758
- filterCount: ts,
2759
- bulkActions: ns,
2760
- bulkCount: as,
2761
- bulkBtn: is,
2762
- bulkBtnRemove: ss,
2763
- jobList: rs,
2764
- listHeader: ls,
2765
- headerLabel: os,
2766
- jobRow: cs,
2767
- jobRowSelected: ds,
2768
- jobCheckbox: ps,
2769
- statusBadge: us,
2770
- "badge-queued": "_badge-queued_lbbp6_405",
2771
- "badge-printing": "_badge-printing_lbbp6_413",
2772
- pulse: ms,
2773
- "badge-done": "_badge-done_lbbp6_423",
2774
- "badge-error": "_badge-error_lbbp6_431",
2775
- "badge-paused": "_badge-paused_lbbp6_439",
2776
- "badge-cancelled": "_badge-cancelled_lbbp6_447",
2777
- jobInfo: hs,
2778
- jobName: _s,
2779
- jobMeta: gs,
2780
- jobTime: bs,
2781
- jobDuration: ys,
2782
- jobError: vs,
2783
- progressBar: Ns,
2784
- progressFill: fs,
2785
- copiesEditor: ws,
2786
- copiesBtn: ks,
2787
- copiesValue: Ss,
2788
- jobActions: Cs,
2789
- actionBtn: Bs,
2790
- removeBtn: Is,
2791
- emptyState: Ls
2792
- }, $e = {
2761
+ ), document.body) : T;
2762
+ }, Wi = "_root_1f4bm_1", Yi = "_dark_1f4bm_23", Ui = "_statsBar_1f4bm_37", ji = "_stat_1f4bm_37", Vi = "_dot_1f4bm_75", Xi = "_statPrinting_1f4bm_87", Ki = "_statQueued_1f4bm_93", Ji = "_statDone_1f4bm_99", Qi = "_statError_1f4bm_105", Zi = "_toolbar_1f4bm_115", es = "_filterTabs_1f4bm_139", ts = "_filterTab_1f4bm_139", ns = "_filterTabActive_1f4bm_177", as = "_filterCount_1f4bm_187", is = "_bulkActions_1f4bm_211", ss = "_bulkCount_1f4bm_223", rs = "_bulkBtn_1f4bm_231", os = "_bulkBtnRemove_1f4bm_255", ls = "_jobList_1f4bm_273", cs = "_listHeader_1f4bm_281", ds = "_headerLabel_1f4bm_313", ms = "_jobRow_1f4bm_323", ps = "_jobRowSelected_1f4bm_359", us = "_jobCheckbox_1f4bm_373", hs = "_statusBadge_1f4bm_387", _s = "_pulse_1f4bm_1", gs = "_jobInfo_1f4bm_479", bs = "_jobName_1f4bm_485", ys = "_jobMeta_1f4bm_497", fs = "_jobTime_1f4bm_513", vs = "_jobDuration_1f4bm_519", Ns = "_jobError_1f4bm_525", ws = "_progressBar_1f4bm_539", ks = "_progressFill_1f4bm_553", Ss = "_copiesEditor_1f4bm_569", Cs = "_copiesBtn_1f4bm_581", Bs = "_copiesValue_1f4bm_621", Is = "_jobActions_1f4bm_635", Ls = "_actionBtn_1f4bm_645", xs = "_removeBtn_1f4bm_677", zs = "_emptyState_1f4bm_695", N = {
2763
+ root: Wi,
2764
+ dark: Yi,
2765
+ statsBar: Ui,
2766
+ stat: ji,
2767
+ dot: Vi,
2768
+ statPrinting: Xi,
2769
+ statQueued: Ki,
2770
+ statDone: Ji,
2771
+ statError: Qi,
2772
+ toolbar: Zi,
2773
+ filterTabs: es,
2774
+ filterTab: ts,
2775
+ filterTabActive: ns,
2776
+ filterCount: as,
2777
+ bulkActions: is,
2778
+ bulkCount: ss,
2779
+ bulkBtn: rs,
2780
+ bulkBtnRemove: os,
2781
+ jobList: ls,
2782
+ listHeader: cs,
2783
+ headerLabel: ds,
2784
+ jobRow: ms,
2785
+ jobRowSelected: ps,
2786
+ jobCheckbox: us,
2787
+ statusBadge: hs,
2788
+ "badge-queued": "_badge-queued_1f4bm_405",
2789
+ "badge-printing": "_badge-printing_1f4bm_413",
2790
+ pulse: _s,
2791
+ "badge-done": "_badge-done_1f4bm_423",
2792
+ "badge-error": "_badge-error_1f4bm_431",
2793
+ "badge-paused": "_badge-paused_1f4bm_439",
2794
+ "badge-cancelled": "_badge-cancelled_1f4bm_447",
2795
+ jobInfo: gs,
2796
+ jobName: bs,
2797
+ jobMeta: ys,
2798
+ jobTime: fs,
2799
+ jobDuration: vs,
2800
+ jobError: Ns,
2801
+ progressBar: ws,
2802
+ progressFill: ks,
2803
+ copiesEditor: Ss,
2804
+ copiesBtn: Cs,
2805
+ copiesValue: Bs,
2806
+ jobActions: Is,
2807
+ actionBtn: Ls,
2808
+ removeBtn: xs,
2809
+ emptyState: zs
2810
+ }, Ts = [], De = {
2793
2811
  queued: "Queued",
2794
2812
  printing: "Printing",
2795
2813
  done: "Printed",
2796
2814
  error: "Error",
2797
2815
  paused: "Paused",
2798
2816
  cancelled: "Cancelled"
2799
- }, ke = (n, l) => $e[l] ? n(`printing.status.${l}`, $e[l]) : l;
2800
- function xs(n, l) {
2817
+ }, ke = (n, o) => De[o] ? n(`printing.status.${o}`, De[o]) : o;
2818
+ function $s(n, o) {
2801
2819
  try {
2802
- return new Date(l).toLocaleTimeString(n, { hour: "2-digit", minute: "2-digit" });
2820
+ return new Date(o).toLocaleTimeString(n, { hour: "2-digit", minute: "2-digit" });
2803
2821
  } catch {
2804
- return l;
2822
+ return o;
2805
2823
  }
2806
2824
  }
2807
- function zs(n) {
2808
- const l = Math.floor((Date.now() - new Date(n).getTime()) / 1e3);
2809
- if (l < 60)
2810
- return `${l}s`;
2811
- const d = Math.floor(l / 60);
2812
- if (d < 60)
2813
- return `${d}m ${l % 60}s`;
2814
- const o = Math.floor(d / 60);
2815
- return o < 24 ? `${o}h ${d % 60}m` : `${Math.floor(o / 24)}d ${o % 24}h`;
2825
+ function Ds(n) {
2826
+ const o = Math.floor((Date.now() - new Date(n).getTime()) / 1e3);
2827
+ if (o < 60)
2828
+ return `${o}s`;
2829
+ const m = Math.floor(o / 60);
2830
+ if (m < 60)
2831
+ return `${m}m ${o % 60}s`;
2832
+ const l = Math.floor(m / 60);
2833
+ return l < 24 ? `${l}h ${m % 60}m` : `${Math.floor(l / 24)}d ${l % 24}h`;
2816
2834
  }
2817
- const Ts = ({ jobs: n }) => {
2818
- const { t: l } = J(), d = n.filter((m) => m.status === "printing").length, o = n.filter((m) => m.status === "queued").length, S = n.filter((m) => m.status === "done").length, b = n.filter((m) => m.status === "error").length;
2819
- return /* @__PURE__ */ a("div", { className: y.statsBar, children: [
2820
- /* @__PURE__ */ a("span", { className: `${y.stat} ${y.statPrinting}`, children: [
2821
- /* @__PURE__ */ e("span", { className: y.dot }),
2822
- l("printing.stats.active", "Printing"),
2835
+ const Rs = ({ jobs: n }) => {
2836
+ const { t: o } = j(), m = n.filter((g) => g.status === "printing").length, l = n.filter((g) => g.status === "queued").length, C = n.filter((g) => g.status === "done").length, v = n.filter((g) => g.status === "error").length;
2837
+ return /* @__PURE__ */ a("div", { className: N.statsBar, children: [
2838
+ /* @__PURE__ */ a("span", { className: `${N.stat} ${N.statPrinting}`, children: [
2839
+ /* @__PURE__ */ e("span", { className: N.dot }),
2840
+ o("printing.stats.active", "Printing"),
2823
2841
  ": ",
2824
- /* @__PURE__ */ e("strong", { children: d })
2842
+ /* @__PURE__ */ e("strong", { children: m })
2825
2843
  ] }),
2826
- /* @__PURE__ */ a("span", { className: `${y.stat} ${y.statQueued}`, children: [
2827
- /* @__PURE__ */ e("span", { className: y.dot }),
2828
- l("printing.stats.queued", "In queue"),
2844
+ /* @__PURE__ */ a("span", { className: `${N.stat} ${N.statQueued}`, children: [
2845
+ /* @__PURE__ */ e("span", { className: N.dot }),
2846
+ o("printing.stats.queued", "In queue"),
2829
2847
  ": ",
2830
- /* @__PURE__ */ e("strong", { children: o })
2848
+ /* @__PURE__ */ e("strong", { children: l })
2831
2849
  ] }),
2832
- /* @__PURE__ */ a("span", { className: `${y.stat} ${y.statDone}`, children: [
2833
- /* @__PURE__ */ e("span", { className: y.dot }),
2834
- l("printing.stats.done", "Done"),
2850
+ /* @__PURE__ */ a("span", { className: `${N.stat} ${N.statDone}`, children: [
2851
+ /* @__PURE__ */ e("span", { className: N.dot }),
2852
+ o("printing.stats.done", "Done"),
2835
2853
  ": ",
2836
- /* @__PURE__ */ e("strong", { children: S })
2854
+ /* @__PURE__ */ e("strong", { children: C })
2837
2855
  ] }),
2838
- b > 0 && /* @__PURE__ */ a("span", { className: `${y.stat} ${y.statError}`, children: [
2839
- /* @__PURE__ */ e("span", { className: y.dot }),
2840
- l("printing.stats.errors", "Errors"),
2856
+ v > 0 && /* @__PURE__ */ a("span", { className: `${N.stat} ${N.statError}`, children: [
2857
+ /* @__PURE__ */ e("span", { className: N.dot }),
2858
+ o("printing.stats.errors", "Errors"),
2841
2859
  ": ",
2842
- /* @__PURE__ */ e("strong", { children: b })
2860
+ /* @__PURE__ */ e("strong", { children: v })
2843
2861
  ] })
2844
2862
  ] });
2845
- }, Ds = ({
2863
+ }, Es = ({
2846
2864
  job: n,
2847
- index: l,
2848
- total: d,
2849
- printers: o,
2850
- selected: S,
2851
- onSelect: b,
2852
- onUpdate: m,
2853
- onRemove: I,
2854
- onPrint: h,
2855
- onReorder: f
2865
+ index: o,
2866
+ total: m,
2867
+ printers: l,
2868
+ selected: C,
2869
+ onSelect: v,
2870
+ onUpdate: g,
2871
+ onRemove: _,
2872
+ onPrint: b,
2873
+ onReorder: k
2856
2874
  }) => {
2857
- const { t: s, lang: z } = J(), w = o.find((i) => i.id === n.options.printerId), L = l > 0 && n.status === "queued", r = l < d - 1 && n.status === "queued";
2875
+ const { t: h, lang: r } = j(), S = l.find((s) => s.id === n.options.printerId), I = o > 0 && n.status === "queued", x = o < m - 1 && n.status === "queued";
2858
2876
  return /* @__PURE__ */ a(
2859
2877
  "div",
2860
2878
  {
2861
- className: `${y.jobRow} ${S ? y.jobRowSelected : ""} ${y[`status-${n.status}`] ?? ""}`,
2879
+ className: `${N.jobRow} ${C ? N.jobRowSelected : ""} ${N[`status-${n.status}`] ?? ""}`,
2862
2880
  children: [
2863
2881
  /* @__PURE__ */ e(
2864
2882
  "input",
2865
2883
  {
2866
2884
  type: "checkbox",
2867
- className: y.jobCheckbox,
2868
- checked: S,
2869
- onChange: () => b(n.id)
2885
+ className: N.jobCheckbox,
2886
+ checked: C,
2887
+ onChange: () => v(n.id)
2870
2888
  }
2871
2889
  ),
2872
- /* @__PURE__ */ e("span", { className: `${y.statusBadge} ${y[`badge-${n.status}`]}`, children: ke(s, n.status) }),
2873
- /* @__PURE__ */ a("div", { className: y.jobInfo, children: [
2874
- /* @__PURE__ */ e("div", { className: y.jobName, children: n.templateName ?? n.templateId }),
2875
- /* @__PURE__ */ a("div", { className: y.jobMeta, children: [
2890
+ /* @__PURE__ */ e("span", { className: `${N.statusBadge} ${N[`badge-${n.status}`]}`, children: ke(h, n.status) }),
2891
+ /* @__PURE__ */ a("div", { className: N.jobInfo, children: [
2892
+ /* @__PURE__ */ e("div", { className: N.jobName, children: n.templateName ?? n.templateId }),
2893
+ /* @__PURE__ */ a("div", { className: N.jobMeta, children: [
2876
2894
  n.entityLabel && /* @__PURE__ */ e("span", { children: n.entityLabel }),
2877
- w && /* @__PURE__ */ a("span", { children: [
2878
- /* @__PURE__ */ e(N, { name: "printer", size: 12 }),
2895
+ S && /* @__PURE__ */ a("span", { children: [
2896
+ /* @__PURE__ */ e(w, { name: "printer", size: 12 }),
2879
2897
  " ",
2880
- w.name
2898
+ S.name
2881
2899
  ] }),
2882
2900
  /* @__PURE__ */ a("span", { children: [
2883
2901
  "×",
2884
2902
  n.options.copies
2885
2903
  ] }),
2886
- n.createdAt && /* @__PURE__ */ e("span", { className: y.jobTime, children: xs(z, n.createdAt) }),
2887
- n.startedAt && n.status !== "done" && /* @__PURE__ */ e("span", { className: y.jobDuration, children: zs(n.startedAt) })
2904
+ n.createdAt && /* @__PURE__ */ e("span", { className: N.jobTime, children: $s(r, n.createdAt) }),
2905
+ n.startedAt && n.status !== "done" && /* @__PURE__ */ e("span", { className: N.jobDuration, children: Ds(n.startedAt) })
2888
2906
  ] }),
2889
- n.status === "printing" && n.progress != null && /* @__PURE__ */ e("div", { className: y.progressBar, children: /* @__PURE__ */ e("div", { className: y.progressFill, style: { width: `${n.progress}%` } }) }),
2890
- n.status === "error" && n.errorMessage && /* @__PURE__ */ e("div", { className: y.jobError, children: n.errorMessage })
2907
+ n.status === "printing" && n.progress != null && /* @__PURE__ */ e("div", { className: N.progressBar, children: /* @__PURE__ */ e("div", { className: N.progressFill, style: { width: `${n.progress}%` } }) }),
2908
+ n.status === "error" && n.errorMessage && /* @__PURE__ */ e("div", { className: N.jobError, children: n.errorMessage })
2891
2909
  ] }),
2892
- /* @__PURE__ */ a("div", { className: y.copiesEditor, children: [
2910
+ /* @__PURE__ */ a("div", { className: N.copiesEditor, children: [
2893
2911
  /* @__PURE__ */ e(
2894
2912
  "button",
2895
2913
  {
2896
- className: y.copiesBtn,
2914
+ className: N.copiesBtn,
2897
2915
  disabled: n.options.copies <= 1,
2898
- "aria-label": s("printing.copies.decrease", "One copy fewer"),
2899
- onClick: () => m(n.id, { options: { ...n.options, copies: n.options.copies - 1 } }),
2900
- children: /* @__PURE__ */ e(N, { name: "minus", size: 12 })
2916
+ "aria-label": h("printing.copies.decrease", "One copy fewer"),
2917
+ onClick: () => g(n.id, { options: { ...n.options, copies: n.options.copies - 1 } }),
2918
+ children: /* @__PURE__ */ e(w, { name: "minus", size: 12 })
2901
2919
  }
2902
2920
  ),
2903
- /* @__PURE__ */ e("span", { className: y.copiesValue, children: n.options.copies }),
2921
+ /* @__PURE__ */ e("span", { className: N.copiesValue, children: n.options.copies }),
2904
2922
  /* @__PURE__ */ e(
2905
2923
  "button",
2906
2924
  {
2907
- className: y.copiesBtn,
2908
- "aria-label": s("printing.copies.increase", "One copy more"),
2909
- onClick: () => m(n.id, { options: { ...n.options, copies: n.options.copies + 1 } }),
2910
- children: /* @__PURE__ */ e(N, { name: "plus", size: 12 })
2925
+ className: N.copiesBtn,
2926
+ "aria-label": h("printing.copies.increase", "One copy more"),
2927
+ onClick: () => g(n.id, { options: { ...n.options, copies: n.options.copies + 1 } }),
2928
+ children: /* @__PURE__ */ e(w, { name: "plus", size: 12 })
2911
2929
  }
2912
2930
  )
2913
2931
  ] }),
2914
- /* @__PURE__ */ a("div", { className: y.jobActions, children: [
2915
- L && /* @__PURE__ */ e(
2932
+ /* @__PURE__ */ a("div", { className: N.jobActions, children: [
2933
+ I && /* @__PURE__ */ e(
2916
2934
  "button",
2917
2935
  {
2918
- className: y.actionBtn,
2919
- title: s("printing.action.moveUp", "Move up"),
2920
- onClick: () => f(l, l - 1),
2921
- children: /* @__PURE__ */ e(N, { name: "arrow-up", size: 14 })
2936
+ className: N.actionBtn,
2937
+ title: h("printing.action.moveUp", "Move up"),
2938
+ onClick: () => k(o, o - 1),
2939
+ children: /* @__PURE__ */ e(w, { name: "arrow-up", size: 14 })
2922
2940
  }
2923
2941
  ),
2924
- r && /* @__PURE__ */ e(
2942
+ x && /* @__PURE__ */ e(
2925
2943
  "button",
2926
2944
  {
2927
- className: y.actionBtn,
2928
- title: s("printing.action.moveDown", "Move down"),
2929
- onClick: () => f(l, l + 1),
2930
- children: /* @__PURE__ */ e(N, { name: "arrow-down", size: 14 })
2945
+ className: N.actionBtn,
2946
+ title: h("printing.action.moveDown", "Move down"),
2947
+ onClick: () => k(o, o + 1),
2948
+ children: /* @__PURE__ */ e(w, { name: "arrow-down", size: 14 })
2931
2949
  }
2932
2950
  ),
2933
2951
  n.status === "queued" && /* @__PURE__ */ e(
2934
2952
  "button",
2935
2953
  {
2936
- className: y.actionBtn,
2937
- title: s("printing.action.printNow", "Print now"),
2938
- onClick: () => h(n.id),
2939
- children: /* @__PURE__ */ e(N, { name: "play", size: 14 })
2954
+ className: N.actionBtn,
2955
+ title: h("printing.action.printNow", "Print now"),
2956
+ onClick: () => b(n.id),
2957
+ children: /* @__PURE__ */ e(w, { name: "play", size: 14 })
2940
2958
  }
2941
2959
  ),
2942
2960
  n.status === "printing" && /* @__PURE__ */ e(
2943
2961
  "button",
2944
2962
  {
2945
- className: y.actionBtn,
2946
- title: s("printing.action.pause", "Pause"),
2947
- onClick: () => m(n.id, { status: "paused" }),
2948
- children: /* @__PURE__ */ e(N, { name: "pause", size: 14 })
2963
+ className: N.actionBtn,
2964
+ title: h("printing.action.pause", "Pause"),
2965
+ onClick: () => g(n.id, { status: "paused" }),
2966
+ children: /* @__PURE__ */ e(w, { name: "pause", size: 14 })
2949
2967
  }
2950
2968
  ),
2951
2969
  n.status === "paused" && /* @__PURE__ */ e(
2952
2970
  "button",
2953
2971
  {
2954
- className: y.actionBtn,
2955
- title: s("printing.action.resume", "Resume"),
2956
- onClick: () => m(n.id, { status: "queued" }),
2957
- children: /* @__PURE__ */ e(N, { name: "play", size: 14 })
2972
+ className: N.actionBtn,
2973
+ title: h("printing.action.resume", "Resume"),
2974
+ onClick: () => g(n.id, { status: "queued" }),
2975
+ children: /* @__PURE__ */ e(w, { name: "play", size: 14 })
2958
2976
  }
2959
2977
  ),
2960
2978
  /* @__PURE__ */ e(
2961
2979
  "button",
2962
2980
  {
2963
- className: `${y.actionBtn} ${y.removeBtn}`,
2964
- title: s("printing.action.remove", "Remove"),
2965
- onClick: () => I(n.id),
2966
- children: /* @__PURE__ */ e(N, { name: "close", size: 14 })
2981
+ className: `${N.actionBtn} ${N.removeBtn}`,
2982
+ title: h("printing.action.remove", "Remove"),
2983
+ onClick: () => _(n.id),
2984
+ children: /* @__PURE__ */ e(w, { name: "close", size: 14 })
2967
2985
  }
2968
2986
  )
2969
2987
  ] })
2970
2988
  ]
2971
2989
  }
2972
2990
  );
2973
- }, cr = ({
2974
- jobs: n,
2975
- printers: l = [],
2976
- onJobUpdate: d,
2977
- onJobRemove: o,
2978
- onJobReorder: S,
2979
- onJobPrint: b,
2980
- onBulkRemove: m,
2981
- onBulkPrint: I,
2982
- maxHeight: h = 500,
2983
- className: f,
2984
- style: s,
2985
- theme: z = "light"
2991
+ }, pr = ({
2992
+ jobs: n = Ts,
2993
+ printers: o = [],
2994
+ onJobUpdate: m,
2995
+ onJobRemove: l,
2996
+ onJobReorder: C,
2997
+ onJobPrint: v,
2998
+ onBulkRemove: g,
2999
+ onBulkPrint: _,
3000
+ maxHeight: b = 500,
3001
+ className: k,
3002
+ style: h,
3003
+ theme: r = "light"
2986
3004
  }) => {
2987
- const { t: w } = J(), [L, r] = F(/* @__PURE__ */ new Set()), [i, _] = F("all"), p = i === "all" ? n : n.filter((v) => v.status === i), k = M((v) => {
2988
- r((q) => {
2989
- const D = new Set(q);
2990
- return D.has(v) ? D.delete(v) : D.add(v), D;
3005
+ const { t: S } = j(), [I, x] = H(/* @__PURE__ */ new Set()), [s, i] = H("all"), d = s === "all" ? n : n.filter((T) => T.status === s), u = P((T) => {
3006
+ x(($) => {
3007
+ const A = new Set($);
3008
+ return A.has(T) ? A.delete(T) : A.add(T), A;
2991
3009
  });
2992
- }, []), H = M(() => {
2993
- L.size === p.length ? r(/* @__PURE__ */ new Set()) : r(new Set(p.map((v) => v.id)));
2994
- }, [p, L.size]), g = M(() => {
2995
- m == null || m(Array.from(L)), r(/* @__PURE__ */ new Set());
2996
- }, [L, m]), $ = M(() => {
2997
- I == null || I(Array.from(L)), r(/* @__PURE__ */ new Set());
2998
- }, [L, I]);
3010
+ }, []), z = P(() => {
3011
+ I.size === d.length ? x(/* @__PURE__ */ new Set()) : x(new Set(d.map((T) => T.id)));
3012
+ }, [d, I.size]), y = P(() => {
3013
+ g == null || g(Array.from(I)), x(/* @__PURE__ */ new Set());
3014
+ }, [I, g]), R = P(() => {
3015
+ _ == null || _(Array.from(I)), x(/* @__PURE__ */ new Set());
3016
+ }, [I, _]);
2999
3017
  return /* @__PURE__ */ a(
3000
3018
  "div",
3001
3019
  {
3002
- className: `${y.root} ${z === "dark" ? y.dark : ""} ${f ?? ""}`,
3003
- style: s,
3020
+ className: `${N.root} ${r === "dark" ? N.dark : ""} ${k ?? ""}`,
3021
+ style: h,
3004
3022
  children: [
3005
- /* @__PURE__ */ e(Ts, { jobs: n }),
3006
- /* @__PURE__ */ a("div", { className: y.toolbar, children: [
3007
- /* @__PURE__ */ e("div", { className: y.filterTabs, children: ["all", "queued", "printing", "done", "error"].map((v) => /* @__PURE__ */ a(
3023
+ /* @__PURE__ */ e(Rs, { jobs: n }),
3024
+ /* @__PURE__ */ a("div", { className: N.toolbar, children: [
3025
+ /* @__PURE__ */ e("div", { className: N.filterTabs, children: ["all", "queued", "printing", "done", "error"].map((T) => /* @__PURE__ */ a(
3008
3026
  "button",
3009
3027
  {
3010
- className: `${y.filterTab} ${i === v ? y.filterTabActive : ""}`,
3011
- onClick: () => _(v),
3028
+ className: `${N.filterTab} ${s === T ? N.filterTabActive : ""}`,
3029
+ onClick: () => i(T),
3012
3030
  children: [
3013
- v === "all" ? w("printing.filter.all", "All") : ke(w, v),
3014
- /* @__PURE__ */ e("span", { className: y.filterCount, children: v === "all" ? n.length : n.filter((q) => q.status === v).length })
3031
+ T === "all" ? S("printing.filter.all", "All") : ke(S, T),
3032
+ /* @__PURE__ */ e("span", { className: N.filterCount, children: T === "all" ? n.length : n.filter(($) => $.status === T).length })
3015
3033
  ]
3016
3034
  },
3017
- v
3035
+ T
3018
3036
  )) }),
3019
- L.size > 0 && /* @__PURE__ */ a("div", { className: y.bulkActions, children: [
3020
- /* @__PURE__ */ a("span", { className: y.bulkCount, children: [
3021
- L.size,
3037
+ I.size > 0 && /* @__PURE__ */ a("div", { className: N.bulkActions, children: [
3038
+ /* @__PURE__ */ a("span", { className: N.bulkCount, children: [
3039
+ I.size,
3022
3040
  " ",
3023
- w("printing.bulk.selected", "selected")
3041
+ S("printing.bulk.selected", "selected")
3024
3042
  ] }),
3025
- I && /* @__PURE__ */ a("button", { className: y.bulkBtn, onClick: $, children: [
3026
- /* @__PURE__ */ e(N, { name: "printer", size: 14 }),
3043
+ _ && /* @__PURE__ */ a("button", { className: N.bulkBtn, onClick: R, children: [
3044
+ /* @__PURE__ */ e(w, { name: "printer", size: 14 }),
3027
3045
  " ",
3028
- w("printing.bulk.print", "Print selected")
3046
+ S("printing.bulk.print", "Print selected")
3029
3047
  ] }),
3030
- m && /* @__PURE__ */ a("button", { className: `${y.bulkBtn} ${y.bulkBtnRemove}`, onClick: g, children: [
3031
- /* @__PURE__ */ e(N, { name: "trash", size: 14 }),
3048
+ g && /* @__PURE__ */ a("button", { className: `${N.bulkBtn} ${N.bulkBtnRemove}`, onClick: y, children: [
3049
+ /* @__PURE__ */ e(w, { name: "trash", size: 14 }),
3032
3050
  " ",
3033
- w("printing.bulk.remove", "Remove selected")
3051
+ S("printing.bulk.remove", "Remove selected")
3034
3052
  ] })
3035
3053
  ] })
3036
3054
  ] }),
3037
- /* @__PURE__ */ e("div", { className: y.jobList, style: { maxHeight: h }, children: p.length === 0 ? /* @__PURE__ */ e("div", { className: y.emptyState, children: i === "all" ? w("printing.empty.queue", "No jobs in the queue") : `${w("printing.empty.filtered", "No jobs with status")} "${ke(w, i)}"` }) : /* @__PURE__ */ a(j, { children: [
3038
- /* @__PURE__ */ a("div", { className: y.listHeader, children: [
3055
+ /* @__PURE__ */ e("div", { className: N.jobList, style: { maxHeight: b }, children: d.length === 0 ? /* @__PURE__ */ e("div", { className: N.emptyState, children: s === "all" ? S("printing.empty.queue", "No jobs in the queue") : `${S("printing.empty.filtered", "No jobs with status")} "${ke(S, s)}"` }) : /* @__PURE__ */ a(X, { children: [
3056
+ /* @__PURE__ */ a("div", { className: N.listHeader, children: [
3039
3057
  /* @__PURE__ */ e(
3040
3058
  "input",
3041
3059
  {
3042
3060
  type: "checkbox",
3043
- onChange: H,
3044
- checked: L.size === p.length && p.length > 0
3061
+ onChange: z,
3062
+ checked: I.size === d.length && d.length > 0
3045
3063
  }
3046
3064
  ),
3047
- /* @__PURE__ */ e("span", { className: y.headerLabel, children: w("printing.col.job", "Job") }),
3048
- /* @__PURE__ */ e("span", { className: y.headerLabel, children: w("printing.col.copies", "Copies") }),
3049
- /* @__PURE__ */ e("span", { className: y.headerLabel, children: w("printing.col.actions", "Actions") })
3065
+ /* @__PURE__ */ e("span", { className: N.headerLabel, children: S("printing.col.job", "Job") }),
3066
+ /* @__PURE__ */ e("span", { className: N.headerLabel, children: S("printing.col.copies", "Copies") }),
3067
+ /* @__PURE__ */ e("span", { className: N.headerLabel, children: S("printing.col.actions", "Actions") })
3050
3068
  ] }),
3051
- p.map((v, q) => /* @__PURE__ */ e(
3052
- Ds,
3069
+ d.map((T, $) => /* @__PURE__ */ e(
3070
+ Es,
3053
3071
  {
3054
- job: v,
3055
- index: n.indexOf(v),
3072
+ job: T,
3073
+ index: n.indexOf(T),
3056
3074
  total: n.length,
3057
- printers: l,
3058
- selected: L.has(v.id),
3059
- onSelect: k,
3060
- onUpdate: d,
3061
- onRemove: o,
3062
- onPrint: b,
3063
- onReorder: S
3075
+ printers: o,
3076
+ selected: I.has(T.id),
3077
+ onSelect: u,
3078
+ onUpdate: m,
3079
+ onRemove: l,
3080
+ onPrint: v,
3081
+ onReorder: C
3064
3082
  },
3065
- v.id
3083
+ T.id
3066
3084
  ))
3067
3085
  ] }) })
3068
3086
  ]
3069
3087
  }
3070
3088
  );
3071
- }, $s = "_container_1f76z_1", Rs = "_buttonGroup_1f76z_19", As = "_trigger_1f76z_31", Ms = "_triggerDisabled_1f76z_57", Ps = "_mainAction_1f76z_151", Es = "_dropdownToggle_1f76z_175", Fs = "_chevron_1f76z_201", Hs = "_chevronUp_1f76z_211", Gs = "_dropdown_1f76z_175", Os = "_dark_1f76z_245", qs = "_section_1f76z_257", Ws = "_sectionLabel_1f76z_263", Us = "_divider_1f76z_283", Ys = "_copiesRow_1f76z_301", Vs = "_copiesBtn_1f76z_311", js = "_copiesValue_1f76z_351", Ks = "_printerSelect_1f76z_375", Xs = "_printerStatus_1f76z_415", Js = "_printerDot_1f76z_429", Qs = "_printerStatusLabel_1f76z_463", Zs = "_submitBtn_1f76z_473", er = "_spinner_1f76z_515", tr = "_spin_1f76z_515", R = {
3072
- container: $s,
3073
- buttonGroup: Rs,
3074
- trigger: As,
3075
- triggerDisabled: Ms,
3089
+ }, As = "_container_1f76z_1", Ms = "_buttonGroup_1f76z_19", Ps = "_trigger_1f76z_31", Fs = "_triggerDisabled_1f76z_57", Hs = "_mainAction_1f76z_151", Gs = "_dropdownToggle_1f76z_175", Os = "_chevron_1f76z_201", qs = "_chevronUp_1f76z_211", Ws = "_dropdown_1f76z_175", Ys = "_dark_1f76z_245", Us = "_section_1f76z_257", js = "_sectionLabel_1f76z_263", Vs = "_divider_1f76z_283", Xs = "_copiesRow_1f76z_301", Ks = "_copiesBtn_1f76z_311", Js = "_copiesValue_1f76z_351", Qs = "_printerSelect_1f76z_375", Zs = "_printerStatus_1f76z_415", er = "_printerDot_1f76z_429", tr = "_printerStatusLabel_1f76z_463", nr = "_submitBtn_1f76z_473", ar = "_spinner_1f76z_515", ir = "_spin_1f76z_515", E = {
3090
+ container: As,
3091
+ buttonGroup: Ms,
3092
+ trigger: Ps,
3093
+ triggerDisabled: Fs,
3076
3094
  "variant-primary": "_variant-primary_1f76z_69",
3077
3095
  "variant-secondary": "_variant-secondary_1f76z_83",
3078
3096
  "variant-ghost": "_variant-ghost_1f76z_99",
3079
3097
  "size-sm": "_size-sm_1f76z_117",
3080
3098
  "size-md": "_size-md_1f76z_127",
3081
3099
  "size-lg": "_size-lg_1f76z_137",
3082
- mainAction: Ps,
3083
- dropdownToggle: Es,
3084
- chevron: Fs,
3085
- chevronUp: Hs,
3086
- dropdown: Gs,
3087
- dark: Os,
3088
- section: qs,
3089
- sectionLabel: Ws,
3090
- divider: Us,
3091
- copiesRow: Ys,
3092
- copiesBtn: Vs,
3093
- copiesValue: js,
3094
- printerSelect: Ks,
3095
- printerStatus: Xs,
3096
- printerDot: Js,
3100
+ mainAction: Hs,
3101
+ dropdownToggle: Gs,
3102
+ chevron: Os,
3103
+ chevronUp: qs,
3104
+ dropdown: Ws,
3105
+ dark: Ys,
3106
+ section: Us,
3107
+ sectionLabel: js,
3108
+ divider: Vs,
3109
+ copiesRow: Xs,
3110
+ copiesBtn: Ks,
3111
+ copiesValue: Js,
3112
+ printerSelect: Qs,
3113
+ printerStatus: Zs,
3114
+ printerDot: er,
3097
3115
  "dot-ready": "_dot-ready_1f76z_439",
3098
3116
  "dot-busy": "_dot-busy_1f76z_445",
3099
3117
  "dot-offline": "_dot-offline_1f76z_451",
3100
3118
  "dot-error": "_dot-error_1f76z_457",
3101
- printerStatusLabel: Qs,
3102
- submitBtn: Zs,
3103
- spinner: er,
3104
- spin: tr
3105
- }, dr = ({
3119
+ printerStatusLabel: tr,
3120
+ submitBtn: nr,
3121
+ spinner: ar,
3122
+ spin: ir
3123
+ }, ur = ({
3106
3124
  onPrint: n,
3107
- printers: l = [],
3108
- defaultPrinterId: d,
3109
- defaultCopies: o = 1,
3110
- disabled: S = !1,
3111
- loading: b = !1,
3112
- variant: m = "primary",
3113
- size: I = "md",
3114
- label: h,
3115
- className: f,
3116
- style: s,
3117
- theme: z = "light"
3125
+ printers: o = [],
3126
+ defaultPrinterId: m,
3127
+ defaultCopies: l = 1,
3128
+ disabled: C = !1,
3129
+ loading: v = !1,
3130
+ variant: g = "primary",
3131
+ size: _ = "md",
3132
+ label: b,
3133
+ className: k,
3134
+ style: h,
3135
+ theme: r = "light"
3118
3136
  }) => {
3119
- var A;
3120
- const { t: w } = J(), L = h ?? w("printing.print", "Print"), [r, i] = F(!1), [_, p] = F(o), [k, H] = F(d ?? ((A = l[0]) == null ? void 0 : A.id) ?? ""), g = Je(null);
3137
+ var Z;
3138
+ const { t: S } = j(), I = b ?? S("printing.print", "Print"), [x, s] = H(!1), [i, d] = H(l), [u, z] = H(m ?? ((Z = o[0]) == null ? void 0 : Z.id) ?? ""), y = Qe(null);
3121
3139
  Se(() => {
3122
- if (!r)
3140
+ if (!x)
3123
3141
  return;
3124
- const T = (X) => {
3125
- g.current && !g.current.contains(X.target) && i(!1);
3142
+ const f = (K) => {
3143
+ y.current && !y.current.contains(K.target) && s(!1);
3126
3144
  };
3127
- return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
3128
- }, [r]);
3129
- const $ = M(() => {
3130
- n({ copies: _, printerId: k }), i(!1);
3131
- }, [_, k, n]), v = M(() => p((T) => Math.min(99, T + 1)), []), q = M(() => p((T) => Math.max(1, T - 1)), []), D = [R.container, z === "dark" ? R.dark : "", f ?? ""].filter(Boolean).join(" "), K = [
3132
- R.trigger,
3133
- R[`variant-${m}`],
3134
- R[`size-${I}`],
3135
- S || b ? R.triggerDisabled : ""
3145
+ return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
3146
+ }, [x]);
3147
+ const R = P(() => {
3148
+ n({ copies: i, printerId: u }), s(!1);
3149
+ }, [i, u, n]), T = P(() => d((f) => Math.min(99, f + 1)), []), $ = P(() => d((f) => Math.max(1, f - 1)), []), A = [E.container, r === "dark" ? E.dark : "", k ?? ""].filter(Boolean).join(" "), Y = [
3150
+ E.trigger,
3151
+ E[`variant-${g}`],
3152
+ E[`size-${_}`],
3153
+ C || v ? E.triggerDisabled : ""
3136
3154
  ].filter(Boolean).join(" ");
3137
- return /* @__PURE__ */ a("div", { ref: g, className: D, style: s, children: [
3138
- /* @__PURE__ */ a("div", { className: R.buttonGroup, children: [
3155
+ return /* @__PURE__ */ a("div", { ref: y, className: A, style: h, children: [
3156
+ /* @__PURE__ */ a("div", { className: E.buttonGroup, children: [
3139
3157
  /* @__PURE__ */ a(
3140
3158
  "button",
3141
3159
  {
3142
- className: `${K} ${R.mainAction}`,
3143
- disabled: S || b,
3144
- onClick: $,
3145
- "aria-label": L,
3160
+ className: `${Y} ${E.mainAction}`,
3161
+ disabled: C || v,
3162
+ onClick: R,
3163
+ "aria-label": I,
3146
3164
  children: [
3147
- b ? /* @__PURE__ */ e("span", { className: R.spinner }) : /* @__PURE__ */ e(N, { name: "printer", size: 16 }),
3148
- /* @__PURE__ */ e("span", { children: L })
3165
+ v ? /* @__PURE__ */ e("span", { className: E.spinner }) : /* @__PURE__ */ e(w, { name: "printer", size: 16 }),
3166
+ /* @__PURE__ */ e("span", { children: I })
3149
3167
  ]
3150
3168
  }
3151
3169
  ),
3152
3170
  /* @__PURE__ */ e(
3153
3171
  "button",
3154
3172
  {
3155
- className: `${K} ${R.dropdownToggle}`,
3156
- disabled: S || b,
3157
- onClick: () => i((T) => !T),
3158
- "aria-label": w("printing.options", "Print options"),
3159
- "aria-expanded": r,
3160
- children: /* @__PURE__ */ e("span", { className: `${R.chevron} ${r ? R.chevronUp : ""}`, children: /* @__PURE__ */ e(N, { name: "chevron-down", size: 12 }) })
3173
+ className: `${Y} ${E.dropdownToggle}`,
3174
+ disabled: C || v,
3175
+ onClick: () => s((f) => !f),
3176
+ "aria-label": S("printing.options", "Print options"),
3177
+ "aria-expanded": x,
3178
+ children: /* @__PURE__ */ e("span", { className: `${E.chevron} ${x ? E.chevronUp : ""}`, children: /* @__PURE__ */ e(w, { name: "chevron-down", size: 12 }) })
3161
3179
  }
3162
3180
  )
3163
3181
  ] }),
3164
- r && /* @__PURE__ */ a("div", { className: R.dropdown, children: [
3165
- /* @__PURE__ */ a("div", { className: R.section, children: [
3166
- /* @__PURE__ */ e("label", { className: R.sectionLabel, children: w("printing.copies.label", "Copies") }),
3167
- /* @__PURE__ */ a("div", { className: R.copiesRow, children: [
3182
+ x && /* @__PURE__ */ a("div", { className: E.dropdown, children: [
3183
+ /* @__PURE__ */ a("div", { className: E.section, children: [
3184
+ /* @__PURE__ */ e("label", { className: E.sectionLabel, children: S("printing.copies.label", "Copies") }),
3185
+ /* @__PURE__ */ a("div", { className: E.copiesRow, children: [
3168
3186
  /* @__PURE__ */ e(
3169
3187
  "button",
3170
3188
  {
3171
- className: R.copiesBtn,
3172
- onClick: q,
3173
- disabled: _ <= 1,
3174
- "aria-label": w("printing.copies.decrease", "One copy fewer"),
3175
- children: /* @__PURE__ */ e(N, { name: "minus", size: 12 })
3189
+ className: E.copiesBtn,
3190
+ onClick: $,
3191
+ disabled: i <= 1,
3192
+ "aria-label": S("printing.copies.decrease", "One copy fewer"),
3193
+ children: /* @__PURE__ */ e(w, { name: "minus", size: 12 })
3176
3194
  }
3177
3195
  ),
3178
- /* @__PURE__ */ e("span", { className: R.copiesValue, children: _ }),
3196
+ /* @__PURE__ */ e("span", { className: E.copiesValue, children: i }),
3179
3197
  /* @__PURE__ */ e(
3180
3198
  "button",
3181
3199
  {
3182
- className: R.copiesBtn,
3183
- onClick: v,
3184
- disabled: _ >= 99,
3185
- "aria-label": w("printing.copies.increase", "One copy more"),
3186
- children: /* @__PURE__ */ e(N, { name: "plus", size: 12 })
3200
+ className: E.copiesBtn,
3201
+ onClick: T,
3202
+ disabled: i >= 99,
3203
+ "aria-label": S("printing.copies.increase", "One copy more"),
3204
+ children: /* @__PURE__ */ e(w, { name: "plus", size: 12 })
3187
3205
  }
3188
3206
  )
3189
3207
  ] })
3190
3208
  ] }),
3191
- /* @__PURE__ */ e("div", { className: R.divider }),
3192
- l.length > 0 && /* @__PURE__ */ a(j, { children: [
3193
- /* @__PURE__ */ a("div", { className: R.section, children: [
3194
- /* @__PURE__ */ e("label", { className: R.sectionLabel, children: w("printing.printer", "Printer") }),
3209
+ /* @__PURE__ */ e("div", { className: E.divider }),
3210
+ o.length > 0 && /* @__PURE__ */ a(X, { children: [
3211
+ /* @__PURE__ */ a("div", { className: E.section, children: [
3212
+ /* @__PURE__ */ e("label", { className: E.sectionLabel, children: S("printing.printer", "Printer") }),
3195
3213
  /* @__PURE__ */ e(
3196
3214
  "select",
3197
3215
  {
3198
- className: R.printerSelect,
3199
- value: k,
3200
- onChange: (T) => H(T.target.value),
3201
- children: l.map((T) => /* @__PURE__ */ a(
3216
+ className: E.printerSelect,
3217
+ value: u,
3218
+ onChange: (f) => z(f.target.value),
3219
+ children: o.map((f) => /* @__PURE__ */ a(
3202
3220
  "option",
3203
3221
  {
3204
- value: T.id,
3205
- disabled: T.status === "offline" || !T.isOnline && T.status == null,
3222
+ value: f.id,
3223
+ disabled: f.status === "offline" || !f.isOnline && f.status == null,
3206
3224
  children: [
3207
- T.name,
3225
+ f.name,
3208
3226
  " ",
3209
- T.status === "offline" || !T.isOnline && T.status == null ? "(Offline)" : T.status === "busy" ? `(${w("printing.printerBusyLabel", "Busy")})` : ""
3227
+ f.status === "offline" || !f.isOnline && f.status == null ? S("printing.offline", "(Offline)") : f.status === "busy" ? `(${S("printing.printerBusyLabel", "Busy")})` : ""
3210
3228
  ]
3211
3229
  },
3212
- T.id
3230
+ f.id
3213
3231
  ))
3214
3232
  }
3215
3233
  ),
3216
- l.find((T) => T.id === k) && /* @__PURE__ */ e("div", { className: R.printerStatus, children: (() => {
3217
- const T = l.find((be) => be.id === k), X = T.status ?? (T.isOnline ? "ready" : "offline");
3218
- return /* @__PURE__ */ a(j, { children: [
3219
- /* @__PURE__ */ e("span", { className: `${R.printerDot} ${R[`dot-${X}`]}` }),
3220
- /* @__PURE__ */ e("span", { className: R.printerStatusLabel, children: X === "ready" ? w("printing.printerReady", "Ready") : X === "busy" ? w("printing.printerBusyLabel", "Busy") : X === "offline" ? "Offline" : w("printing.printerError", "Error") })
3234
+ o.find((f) => f.id === u) && /* @__PURE__ */ e("div", { className: E.printerStatus, children: (() => {
3235
+ const f = o.find((ge) => ge.id === u), K = f.status ?? (f.isOnline ? "ready" : "offline");
3236
+ return /* @__PURE__ */ a(X, { children: [
3237
+ /* @__PURE__ */ e("span", { className: `${E.printerDot} ${E[`dot-${K}`]}` }),
3238
+ /* @__PURE__ */ e("span", { className: E.printerStatusLabel, children: K === "ready" ? S("printing.printerReady", "Ready") : K === "busy" ? S("printing.printerBusyLabel", "Busy") : K === "offline" ? S("printing.offline2", "Offline") : S("printing.printerError", "Error") })
3221
3239
  ] });
3222
3240
  })() })
3223
3241
  ] }),
3224
- /* @__PURE__ */ e("div", { className: R.divider })
3242
+ /* @__PURE__ */ e("div", { className: E.divider })
3225
3243
  ] }),
3226
- /* @__PURE__ */ e("div", { className: R.section, children: /* @__PURE__ */ e(
3244
+ /* @__PURE__ */ e("div", { className: E.section, children: /* @__PURE__ */ e(
3227
3245
  "button",
3228
3246
  {
3229
- className: R.submitBtn,
3230
- onClick: $,
3231
- disabled: S || b || l.length > 0 && (() => {
3232
- const T = l.find((X) => X.id === k);
3233
- return T != null && (T.status === "offline" || !T.isOnline && T.status == null);
3247
+ className: E.submitBtn,
3248
+ onClick: R,
3249
+ disabled: C || v || o.length > 0 && (() => {
3250
+ const f = o.find((K) => K.id === u);
3251
+ return f != null && (f.status === "offline" || !f.isOnline && f.status == null);
3234
3252
  })(),
3235
- children: b ? w("printing.printing", "Printing…") : /* @__PURE__ */ a(j, { children: [
3236
- /* @__PURE__ */ e(N, { name: "printer", size: 14 }),
3253
+ children: v ? S("printing.printing", "Printing…") : /* @__PURE__ */ a(X, { children: [
3254
+ /* @__PURE__ */ e(w, { name: "printer", size: 14 }),
3237
3255
  " ",
3238
- L,
3239
- _ > 1 ? ` (${_})` : ""
3256
+ I,
3257
+ i > 1 ? ` (${i})` : ""
3240
3258
  ] })
3241
3259
  }
3242
3260
  ) })
@@ -3244,9 +3262,9 @@ const Ts = ({ jobs: n }) => {
3244
3262
  ] });
3245
3263
  };
3246
3264
  export {
3247
- dr as NicePrintButton,
3248
- or as NicePrintPreview,
3249
- cr as NicePrintQueue,
3250
- lr as NiceTemplateBrowser,
3251
- rr as NiceTemplateEditor
3265
+ ur as NicePrintButton,
3266
+ mr as NicePrintPreview,
3267
+ pr as NicePrintQueue,
3268
+ dr as NiceTemplateBrowser,
3269
+ cr as NiceTemplateEditor
3252
3270
  };