@nice2dev/ui-printing 1.1.6 → 1.1.7

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,8 +1,8 @@
1
1
  import { jsx as e, jsxs as s, Fragment as Y } from "react/jsx-runtime";
2
- import We, { useReducer as je, useState as M, useCallback as $, useMemo as oe, useEffect as ye, useRef as Fe } from "react";
2
+ import He, { useReducer as We, useState as P, useCallback as T, useMemo as oe, useEffect as ge, useRef as Fe } from "react";
3
3
  import { NiceAppShell as Oe, useNiceTranslation as Ue } from "@nice2dev/ui";
4
4
  import { createPortal as Ye } from "react-dom";
5
- const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze = "_toolbarGroup_552wg_75", Xe = "_toolbarBtn_552wg_107", Je = "_toolbarBtnActive_552wg_167", Qe = "_toolbarBtnDanger_552wg_191", et = "_toolbarSelect_552wg_203", tt = "_toolbarSep_552wg_233", at = "_insertWrapper_552wg_259", nt = "_insertBtn_552wg_267", st = "_insertDropdown_552wg_289", rt = "_insertCategory_552wg_329", lt = "_insertItem_552wg_347", it = "_insertIcon_552wg_391", ot = "_zoomSelect_552wg_405", ct = "_saveBtn_552wg_437", dt = "_editorBody_552wg_473", pt = "_leftPanel_552wg_489", mt = "_leftTabs_552wg_519", ut = "_leftTab_552wg_519", ht = "_leftTabActive_552wg_591", _t = "_leftTabIcon_552wg_611", gt = "_leftTabLabel_552wg_619", yt = "_leftContent_552wg_629", bt = "_panelHeader_552wg_643", wt = "_panelHeaderIcon_552wg_667", vt = "_panelHeaderName_552wg_675", Nt = "_searchBox_552wg_689", ft = "_searchInput_552wg_697", kt = "_fieldList_552wg_743", St = "_fieldItem_552wg_753", Bt = "_fieldItemIcon_552wg_797", Ct = "_fieldItemInfo_552wg_811", It = "_fieldItemLabel_552wg_821", Lt = "_fieldItemPath_552wg_837", xt = "_fieldItemType_552wg_853", zt = "_layerList_552wg_873", Dt = "_layerItem_552wg_885", Tt = "_layerItemSelected_552wg_919", $t = "_layerIcon_552wg_937", Rt = "_layerName_552wg_949", At = "_layerActions_552wg_965", Pt = "_layerBtn_552wg_987", Mt = "_wmList_552wg_1019", Et = "_wmItem_552wg_1027", Gt = "_wmRow_552wg_1053", Ht = "_wmLabel_552wg_1067", Wt = "_wmInput_552wg_1079", jt = "_wmInputNum_552wg_1111", Ft = "_wmSelect_552wg_1131", Ot = "_wmSlider_552wg_1163", Ut = "_wmValue_552wg_1173", Yt = "_wmUnit_552wg_1187", qt = "_wmDelete_552wg_1197", Kt = "_addBtn_552wg_1229", Vt = "_settingsForm_552wg_1265", Zt = "_settingsRow_552wg_1273", Xt = "_settingsLabel_552wg_1287", Jt = "_settingsInput_552wg_1299", Qt = "_settingsInputNum_552wg_1331", ea = "_settingsTextarea_552wg_1363", ta = "_settingsDivider_552wg_1397", aa = "_settingsUnit_552wg_1417", na = "_emptyMsg_552wg_1429", sa = "_canvasArea_552wg_1447", ra = "_testDataBar_552wg_1473", la = "_testDataLabel_552wg_1505", ia = "_testDataSelect_552wg_1515", oa = "_rulerWrapper_552wg_1535", ca = "_rulerCorner_552wg_1551", da = "_ruler_552wg_1535", pa = "_ruler_h_552wg_1609", ma = "_ruler_v_552wg_1619", ua = "_rulerTick_552wg_1639", ha = "_rulerTickMajor_552wg_1679", _a = "_rulerLabel_552wg_1699", ga = "_paperScroll_552wg_1737", ya = "_paperShadow_552wg_1755", ba = "_marginGuide_552wg_1779", wa = "_watermark_552wg_1795", va = "_sectionCanvas_552wg_1821", Na = "_sectionCanvasOver_552wg_1835", fa = "_sectionTypeChip_552wg_1843", ka = "_sectionResizeBar_552wg_1875", Sa = "_sectionResizeGrip_552wg_1909", Ba = "_fieldImagePlaceholder_552wg_1925", Ca = "_fieldBarcodePlaceholder_552wg_1947", Ia = "_fieldSignaturePlaceholder_552wg_1975", La = "_resizeHandle_552wg_2001", xa = "_handle_n_552wg_2021", za = "_handle_s_552wg_2023", Da = "_handle_e_552wg_2025", Ta = "_handle_w_552wg_2027", $a = "_handle_ne_552wg_2029", Ra = "_handle_nw_552wg_2031", Aa = "_handle_se_552wg_2033", Pa = "_handle_sw_552wg_2035", Ma = "_rightPanel_552wg_2041", Ea = "_rightTabs_552wg_2071", Ga = "_rightTab_552wg_2071", Ha = "_rightTabActive_552wg_2135", Wa = "_propsBody_552wg_2147", ja = "_propsEmpty_552wg_2159", Fa = "_propsEmptyIcon_552wg_2181", Oa = "_propsEmptyText_552wg_2191", Ua = "_posGrid_552wg_2203", Ya = "_posCell_552wg_2217", qa = "_posLabel_552wg_2229", Ka = "_posInput_552wg_2241", Va = "_posUnit_552wg_2283", Za = "_snapSection_552wg_2295", Xa = "_snapTitle_552wg_2303", Ja = "_snapRow_552wg_2321", Qa = "_snapBtn_552wg_2331", en = "_styleGroup_552wg_2365", tn = "_styleGroupTitle_552wg_2373", an = "_styleRow_552wg_2403", nn = "_styleLabel_552wg_2417", sn = "_styleSelect_552wg_2431", rn = "_styleSelectFull_552wg_2461", ln = "_styleSelectSm_552wg_2493", on = "_styleSelectXs_552wg_2513", cn = "_styleInput_552wg_2545", dn = "_styleInputFull_552wg_2577", pn = "_styleUnit_552wg_2609", mn = "_styleValue_552wg_2621", un = "_toggleGroup_552wg_2635", hn = "_toggleBtn_552wg_2645", _n = "_toggleBtnActive_552wg_2675", gn = "_colorPicker_552wg_2689", yn = "_colorHex_552wg_2707", bn = "_clearBtn_552wg_2741", wn = "_sliderInput_552wg_2773", vn = "_conditionalHint_552wg_2785", Nn = "_clearConditionalBtn_552wg_2817", fn = "_shortcutGrid_552wg_2849", kn = "_shortcutChip_552wg_2863", Sn = "_shortcutKeys_552wg_2895", Bn = "_shortcutLabel_552wg_2915", t = {
5
+ const qe = "_root_142ej_3", Ke = "_dark_142ej_27", Ve = "_toolbar_142ej_39", Ze = "_toolbarGroup_142ej_75", Xe = "_toolbarBtn_142ej_107", Je = "_toolbarBtnActive_142ej_171", Qe = "_toolbarBtnDanger_142ej_195", et = "_toolbarSelect_142ej_207", tt = "_toolbarSep_142ej_237", at = "_insertWrapper_142ej_263", nt = "_insertBtn_142ej_271", st = "_insertDropdown_142ej_293", lt = "_insertCategory_142ej_333", rt = "_insertItem_142ej_351", it = "_insertIcon_142ej_395", ot = "_zoomSelect_142ej_409", ct = "_saveBtn_142ej_441", dt = "_editorBody_142ej_477", pt = "_leftPanel_142ej_493", mt = "_leftTabs_142ej_523", ut = "_leftTab_142ej_523", _t = "_leftTabActive_142ej_601", ht = "_leftTabIcon_142ej_621", yt = "_leftTabLabel_142ej_629", gt = "_leftContent_142ej_639", bt = "_panelHeader_142ej_653", vt = "_panelHeaderIcon_142ej_677", Nt = "_panelHeaderName_142ej_685", wt = "_searchBox_142ej_699", ft = "_searchInput_142ej_707", kt = "_fieldList_142ej_753", St = "_fieldItem_142ej_763", Bt = "_fieldItemIcon_142ej_807", xt = "_fieldItemInfo_142ej_821", Ct = "_fieldItemLabel_142ej_831", It = "_fieldItemPath_142ej_847", Lt = "_fieldItemType_142ej_863", jt = "_layerList_142ej_883", zt = "_layerItem_142ej_895", Dt = "_layerItemSelected_142ej_931", Tt = "_layerIcon_142ej_949", $t = "_layerName_142ej_961", Rt = "_layerActions_142ej_977", At = "_layerBtn_142ej_999", Pt = "_wmList_142ej_1031", Mt = "_wmItem_142ej_1039", Et = "_wmRow_142ej_1065", Gt = "_wmLabel_142ej_1079", Ht = "_wmInput_142ej_1091", Wt = "_wmInputNum_142ej_1123", Ft = "_wmSelect_142ej_1143", Ot = "_wmSlider_142ej_1175", Ut = "_wmValue_142ej_1185", Yt = "_wmUnit_142ej_1199", qt = "_wmDelete_142ej_1209", Kt = "_addBtn_142ej_1241", Vt = "_settingsForm_142ej_1277", Zt = "_settingsRow_142ej_1285", Xt = "_settingsLabel_142ej_1299", Jt = "_settingsInput_142ej_1311", Qt = "_settingsInputNum_142ej_1343", ea = "_settingsTextarea_142ej_1375", ta = "_settingsDivider_142ej_1409", aa = "_settingsUnit_142ej_1429", na = "_emptyMsg_142ej_1441", sa = "_canvasArea_142ej_1459", la = "_testDataBar_142ej_1485", ra = "_testDataLabel_142ej_1517", ia = "_testDataSelect_142ej_1527", oa = "_rulerWrapper_142ej_1547", ca = "_rulerCorner_142ej_1563", da = "_ruler_142ej_1547", pa = "_ruler_h_142ej_1621", ma = "_ruler_v_142ej_1631", ua = "_rulerTick_142ej_1651", _a = "_rulerTickMajor_142ej_1691", ha = "_rulerLabel_142ej_1711", ya = "_paperScroll_142ej_1749", ga = "_paperShadow_142ej_1767", ba = "_marginGuide_142ej_1795", va = "_watermark_142ej_1811", Na = "_sectionCanvas_142ej_1837", wa = "_sectionCanvasOver_142ej_1851", fa = "_sectionTypeChip_142ej_1859", ka = "_sectionResizeBar_142ej_1891", Sa = "_sectionResizeGrip_142ej_1925", Ba = "_fieldImagePlaceholder_142ej_1941", xa = "_fieldBarcodePlaceholder_142ej_1963", Ca = "_fieldSignaturePlaceholder_142ej_1991", Ia = "_resizeHandle_142ej_2017", La = "_handle_n_142ej_2037", ja = "_handle_s_142ej_2049", za = "_handle_e_142ej_2061", Da = "_handle_w_142ej_2073", Ta = "_handle_ne_142ej_2085", $a = "_handle_nw_142ej_2095", Ra = "_handle_se_142ej_2105", Aa = "_handle_sw_142ej_2115", Pa = "_rightPanel_142ej_2129", Ma = "_rightTabs_142ej_2159", Ea = "_rightTab_142ej_2159", Ga = "_rightTabActive_142ej_2229", Ha = "_propsBody_142ej_2241", Wa = "_propsEmpty_142ej_2253", Fa = "_propsEmptyIcon_142ej_2275", Oa = "_propsEmptyText_142ej_2285", Ua = "_posGrid_142ej_2297", Ya = "_posCell_142ej_2311", qa = "_posLabel_142ej_2323", Ka = "_posInput_142ej_2335", Va = "_posUnit_142ej_2377", Za = "_snapSection_142ej_2389", Xa = "_snapTitle_142ej_2397", Ja = "_snapRow_142ej_2415", Qa = "_snapBtn_142ej_2425", en = "_styleGroup_142ej_2459", tn = "_styleGroupTitle_142ej_2467", an = "_styleRow_142ej_2497", nn = "_styleLabel_142ej_2511", sn = "_styleSelect_142ej_2525", ln = "_styleSelectFull_142ej_2555", rn = "_styleSelectSm_142ej_2587", on = "_styleSelectXs_142ej_2607", cn = "_styleInput_142ej_2639", dn = "_styleInputFull_142ej_2671", pn = "_styleUnit_142ej_2703", mn = "_styleValue_142ej_2715", un = "_toggleGroup_142ej_2729", _n = "_toggleBtn_142ej_2739", hn = "_toggleBtnActive_142ej_2773", yn = "_colorPicker_142ej_2787", gn = "_colorHex_142ej_2805", bn = "_clearBtn_142ej_2839", vn = "_sliderInput_142ej_2871", Nn = "_conditionalHint_142ej_2883", wn = "_clearConditionalBtn_142ej_2915", fn = "_shortcutGrid_142ej_2947", kn = "_shortcutChip_142ej_2961", Sn = "_shortcutKeys_142ej_2993", Bn = "_shortcutLabel_142ej_3013", t = {
6
6
  root: qe,
7
7
  dark: Ke,
8
8
  toolbar: Ve,
@@ -15,8 +15,8 @@ const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze
15
15
  insertWrapper: at,
16
16
  insertBtn: nt,
17
17
  insertDropdown: st,
18
- insertCategory: rt,
19
- insertItem: lt,
18
+ insertCategory: lt,
19
+ insertItem: rt,
20
20
  insertIcon: it,
21
21
  zoomSelect: ot,
22
22
  saveBtn: ct,
@@ -24,35 +24,35 @@ const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze
24
24
  leftPanel: pt,
25
25
  leftTabs: mt,
26
26
  leftTab: ut,
27
- leftTabActive: ht,
28
- leftTabIcon: _t,
29
- leftTabLabel: gt,
30
- leftContent: yt,
27
+ leftTabActive: _t,
28
+ leftTabIcon: ht,
29
+ leftTabLabel: yt,
30
+ leftContent: gt,
31
31
  panelHeader: bt,
32
- panelHeaderIcon: wt,
33
- panelHeaderName: vt,
34
- searchBox: Nt,
32
+ panelHeaderIcon: vt,
33
+ panelHeaderName: Nt,
34
+ searchBox: wt,
35
35
  searchInput: ft,
36
36
  fieldList: kt,
37
37
  fieldItem: St,
38
38
  fieldItemIcon: Bt,
39
- fieldItemInfo: Ct,
40
- fieldItemLabel: It,
41
- fieldItemPath: Lt,
42
- fieldItemType: xt,
43
- layerList: zt,
44
- layerItem: Dt,
45
- layerItemSelected: Tt,
46
- layerIcon: $t,
47
- layerName: Rt,
48
- layerActions: At,
49
- layerBtn: Pt,
50
- wmList: Mt,
51
- wmItem: Et,
52
- wmRow: Gt,
53
- wmLabel: Ht,
54
- wmInput: Wt,
55
- wmInputNum: jt,
39
+ fieldItemInfo: xt,
40
+ fieldItemLabel: Ct,
41
+ fieldItemPath: It,
42
+ fieldItemType: Lt,
43
+ layerList: jt,
44
+ layerItem: zt,
45
+ layerItemSelected: Dt,
46
+ layerIcon: Tt,
47
+ layerName: $t,
48
+ layerActions: Rt,
49
+ layerBtn: At,
50
+ wmList: Pt,
51
+ wmItem: Mt,
52
+ wmRow: Et,
53
+ wmLabel: Gt,
54
+ wmInput: Ht,
55
+ wmInputNum: Wt,
56
56
  wmSelect: Ft,
57
57
  wmSlider: Ot,
58
58
  wmValue: Ut,
@@ -69,8 +69,8 @@ const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze
69
69
  settingsUnit: aa,
70
70
  emptyMsg: na,
71
71
  canvasArea: sa,
72
- testDataBar: ra,
73
- testDataLabel: la,
72
+ testDataBar: la,
73
+ testDataLabel: ra,
74
74
  testDataSelect: ia,
75
75
  rulerWrapper: oa,
76
76
  rulerCorner: ca,
@@ -78,35 +78,35 @@ const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze
78
78
  ruler_h: pa,
79
79
  ruler_v: ma,
80
80
  rulerTick: ua,
81
- rulerTickMajor: ha,
82
- rulerLabel: _a,
83
- paperScroll: ga,
84
- paperShadow: ya,
81
+ rulerTickMajor: _a,
82
+ rulerLabel: ha,
83
+ paperScroll: ya,
84
+ paperShadow: ga,
85
85
  marginGuide: ba,
86
- watermark: wa,
87
- sectionCanvas: va,
88
- sectionCanvasOver: Na,
86
+ watermark: va,
87
+ sectionCanvas: Na,
88
+ sectionCanvasOver: wa,
89
89
  sectionTypeChip: fa,
90
90
  sectionResizeBar: ka,
91
91
  sectionResizeGrip: Sa,
92
92
  fieldImagePlaceholder: Ba,
93
- fieldBarcodePlaceholder: Ca,
94
- fieldSignaturePlaceholder: Ia,
95
- resizeHandle: La,
96
- handle_n: xa,
97
- handle_s: za,
98
- handle_e: Da,
99
- handle_w: Ta,
100
- handle_ne: $a,
101
- handle_nw: Ra,
102
- handle_se: Aa,
103
- handle_sw: Pa,
104
- rightPanel: Ma,
105
- rightTabs: Ea,
106
- rightTab: Ga,
107
- rightTabActive: Ha,
108
- propsBody: Wa,
109
- propsEmpty: ja,
93
+ fieldBarcodePlaceholder: xa,
94
+ fieldSignaturePlaceholder: Ca,
95
+ resizeHandle: Ia,
96
+ handle_n: La,
97
+ handle_s: ja,
98
+ handle_e: za,
99
+ handle_w: Da,
100
+ handle_ne: Ta,
101
+ handle_nw: $a,
102
+ handle_se: Ra,
103
+ handle_sw: Aa,
104
+ rightPanel: Pa,
105
+ rightTabs: Ma,
106
+ rightTab: Ea,
107
+ rightTabActive: Ga,
108
+ propsBody: Ha,
109
+ propsEmpty: Wa,
110
110
  propsEmptyIcon: Fa,
111
111
  propsEmptyText: Oa,
112
112
  posGrid: Ua,
@@ -123,27 +123,27 @@ const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze
123
123
  styleRow: an,
124
124
  styleLabel: nn,
125
125
  styleSelect: sn,
126
- styleSelectFull: rn,
127
- styleSelectSm: ln,
126
+ styleSelectFull: ln,
127
+ styleSelectSm: rn,
128
128
  styleSelectXs: on,
129
129
  styleInput: cn,
130
130
  styleInputFull: dn,
131
131
  styleUnit: pn,
132
132
  styleValue: mn,
133
133
  toggleGroup: un,
134
- toggleBtn: hn,
135
- toggleBtnActive: _n,
136
- colorPicker: gn,
137
- colorHex: yn,
134
+ toggleBtn: _n,
135
+ toggleBtnActive: hn,
136
+ colorPicker: yn,
137
+ colorHex: gn,
138
138
  clearBtn: bn,
139
- sliderInput: wn,
140
- conditionalHint: vn,
141
- clearConditionalBtn: Nn,
139
+ sliderInput: vn,
140
+ conditionalHint: Nn,
141
+ clearConditionalBtn: wn,
142
142
  shortcutGrid: fn,
143
143
  shortcutChip: kn,
144
144
  shortcutKeys: Sn,
145
145
  shortcutLabel: Bn
146
- }, F = 3.78, Ne = {
146
+ }, F = 3.78, we = {
147
147
  A3: [297, 420],
148
148
  A4: [210, 297],
149
149
  A5: [148, 210],
@@ -152,7 +152,7 @@ const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze
152
152
  Legal: [216, 356],
153
153
  Tabloid: [279, 432],
154
154
  custom: [210, 297]
155
- }, Cn = [
155
+ }, xn = [
156
156
  "sans-serif",
157
157
  "serif",
158
158
  "monospace",
@@ -199,7 +199,7 @@ const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze
199
199
  total_pages: "Liczba stron",
200
200
  print_date: "Data wydruku"
201
201
  };
202
- function In(a, i) {
202
+ function Cn(a, i) {
203
203
  switch (i.type) {
204
204
  case "UPDATE":
205
205
  return {
@@ -255,23 +255,23 @@ const Se = ({
255
255
  zoom: i,
256
256
  orientation: p
257
257
  }) => {
258
- const l = [], k = i < 0.6 ? 20 : i < 1 ? 10 : 5;
259
- for (let h = 0; h <= a; h += k) {
260
- const S = h * i * F, b = h % (k * 2) === 0;
261
- l.push(
258
+ const r = [], k = i < 0.6 ? 20 : i < 1 ? 10 : 5;
259
+ for (let _ = 0; _ <= a; _ += k) {
260
+ const S = _ * i * F, b = _ % (k * 2) === 0;
261
+ r.push(
262
262
  /* @__PURE__ */ e(
263
263
  "div",
264
264
  {
265
265
  className: `${t.rulerTick} ${b ? t.rulerTickMajor : ""}`,
266
266
  style: p === "h" ? { left: S } : { top: S },
267
- children: b && /* @__PURE__ */ e("span", { className: t.rulerLabel, children: h })
267
+ children: b && /* @__PURE__ */ e("span", { className: t.rulerLabel, children: _ })
268
268
  },
269
- h
269
+ _
270
270
  )
271
271
  );
272
272
  }
273
- return /* @__PURE__ */ e("div", { className: `${t.ruler} ${t[`ruler_${p}`]}`, children: l });
274
- }, Ln = ["n", "s", "e", "w", "ne", "nw", "se", "sw"], xn = ({ onResizeStart: a }) => /* @__PURE__ */ e(Y, { children: Ln.map((i) => /* @__PURE__ */ e(
273
+ return /* @__PURE__ */ e("div", { className: `${t.ruler} ${t[`ruler_${p}`]}`, children: r });
274
+ }, In = ["n", "s", "e", "w", "ne", "nw", "se", "sw"], Ln = ({ onResizeStart: a }) => /* @__PURE__ */ e(Y, { children: In.map((i) => /* @__PURE__ */ e(
275
275
  "div",
276
276
  {
277
277
  className: `${t.resizeHandle} ${t[`handle_${i}`]}`,
@@ -281,7 +281,7 @@ const Se = ({
281
281
  },
282
282
  i
283
283
  )) });
284
- function zn(a, i) {
284
+ function jn(a, i) {
285
285
  if (a.type === "static_text")
286
286
  return a.fallback ?? "Tekst";
287
287
  if (a.type === "page_number")
@@ -292,7 +292,7 @@ function zn(a, i) {
292
292
  return (/* @__PURE__ */ new Date()).toLocaleDateString("pl-PL");
293
293
  if (i && a.dataPath) {
294
294
  const p = a.dataPath.split(".").reduce(
295
- (l, k) => l && typeof l == "object" ? l[k] : null,
295
+ (r, k) => r && typeof r == "object" ? r[k] : null,
296
296
  i
297
297
  );
298
298
  if (p != null)
@@ -300,77 +300,77 @@ function zn(a, i) {
300
300
  }
301
301
  return a.label ? `{${a.label}}` : `{${a.dataPath}}`;
302
302
  }
303
- const Dn = ({
303
+ const zn = ({
304
304
  field: a,
305
305
  zoom: i,
306
306
  selected: p,
307
- sampleData: l,
307
+ sampleData: r,
308
308
  onClick: k,
309
- onDragStart: h,
309
+ onDragStart: _,
310
310
  onResizeStart: S,
311
311
  readOnly: b
312
312
  }) => {
313
- const g = a.position, v = a.style, c = (m) => m * i * F, T = a.type === "line", N = a.type === "rect", r = a.type === "image" || a.type === "static_image", n = a.type === "barcode" || a.type === "qr", u = {
313
+ const y = a.position, N = a.style, c = (m) => m * i * F, D = a.type === "line", w = a.type === "rect", l = a.type === "image" || a.type === "static_image", n = a.type === "barcode" || a.type === "qr", u = {
314
314
  position: "absolute",
315
- left: c(g.x),
316
- top: c(g.y),
317
- width: c(g.width),
318
- height: c(g.height),
319
- zIndex: g.zIndex ?? 1,
320
- transform: v.rotation ? `rotate(${v.rotation}deg)` : void 0,
315
+ left: c(y.x),
316
+ top: c(y.y),
317
+ width: c(y.width),
318
+ height: c(y.height),
319
+ zIndex: y.zIndex ?? 1,
320
+ transform: N.rotation ? `rotate(${N.rotation}deg)` : void 0,
321
321
  boxSizing: "border-box",
322
322
  overflow: "hidden",
323
- ...!T && !N ? {
324
- fontSize: (v.fontSize ?? 10) * i,
325
- fontFamily: v.fontFamily ?? "sans-serif",
326
- fontWeight: v.fontWeight ?? "normal",
327
- fontStyle: v.fontStyle ?? "normal",
328
- color: v.color ?? "var(--nice-text, #000)",
329
- textAlign: v.textAlign ?? "left",
330
- lineHeight: v.lineHeight ?? 1.4,
331
- letterSpacing: v.letterSpacing ? `${v.letterSpacing}em` : void 0,
332
- padding: v.padding ? c(v.padding) : 0
323
+ ...!D && !w ? {
324
+ fontSize: (N.fontSize ?? 10) * i,
325
+ fontFamily: N.fontFamily ?? "sans-serif",
326
+ fontWeight: N.fontWeight ?? "normal",
327
+ fontStyle: N.fontStyle ?? "normal",
328
+ color: N.color ?? "var(--nice-text, #000)",
329
+ textAlign: N.textAlign ?? "left",
330
+ lineHeight: N.lineHeight ?? 1.4,
331
+ letterSpacing: N.letterSpacing ? `${N.letterSpacing}em` : void 0,
332
+ padding: N.padding ? c(N.padding) : 0
333
333
  } : {},
334
- backgroundColor: v.backgroundColor,
335
- borderWidth: v.borderWidth ?? 0,
336
- borderColor: v.borderColor ?? "transparent",
337
- borderStyle: v.borderStyle ?? "solid",
338
- borderRadius: v.borderRadius,
339
- opacity: v.opacity,
334
+ backgroundColor: N.backgroundColor,
335
+ borderWidth: N.borderWidth ?? 0,
336
+ borderColor: N.borderColor ?? "transparent",
337
+ borderStyle: N.borderStyle ?? "solid",
338
+ borderRadius: N.borderRadius,
339
+ opacity: N.opacity,
340
340
  outline: p ? "1.5px solid var(--nice-primary-hover, #2563eb)" : "1px dashed transparent",
341
341
  outlineOffset: 1,
342
342
  cursor: b ? "default" : "move"
343
343
  };
344
- return /* @__PURE__ */ s("div", { style: u, onClick: k, onMouseDown: b ? void 0 : h, children: [
345
- T ? /* @__PURE__ */ e(
344
+ return /* @__PURE__ */ s("div", { style: u, onClick: k, onMouseDown: b ? void 0 : _, children: [
345
+ D ? /* @__PURE__ */ e(
346
346
  "div",
347
347
  {
348
348
  style: {
349
349
  width: "100%",
350
- borderBottom: `${(v.borderWidth ?? 0.5) * i}px ${v.borderStyle ?? "solid"} ${v.borderColor ?? "var(--nice-text, #000)"}`
350
+ borderBottom: `${(N.borderWidth ?? 0.5) * i}px ${N.borderStyle ?? "solid"} ${N.borderColor ?? "var(--nice-text, #000)"}`
351
351
  }
352
352
  }
353
- ) : N ? null : r ? /* @__PURE__ */ e("div", { className: t.fieldImagePlaceholder, children: "🖼" }) : n ? /* @__PURE__ */ e("div", { className: t.fieldBarcodePlaceholder, children: a.type === "qr" ? "⬛ QR" : "▮▌▮ Barcode" }) : a.type === "signature" ? /* @__PURE__ */ s("div", { className: t.fieldSignaturePlaceholder, children: [
353
+ ) : w ? null : l ? /* @__PURE__ */ e("div", { className: t.fieldImagePlaceholder, children: "🖼" }) : n ? /* @__PURE__ */ e("div", { className: t.fieldBarcodePlaceholder, children: a.type === "qr" ? "⬛ QR" : "▮▌▮ Barcode" }) : a.type === "signature" ? /* @__PURE__ */ s("div", { className: t.fieldSignaturePlaceholder, children: [
354
354
  "✍ ",
355
355
  a.label
356
- ] }) : /* @__PURE__ */ e("span", { style: { display: "block", width: "100%" }, children: zn(a, l) }),
357
- p && !b && /* @__PURE__ */ e(xn, { onResizeStart: S })
356
+ ] }) : /* @__PURE__ */ e("span", { style: { display: "block", width: "100%" }, children: jn(a, r) }),
357
+ p && !b && /* @__PURE__ */ e(Ln, { onResizeStart: S })
358
358
  ] });
359
- }, Tn = ({
359
+ }, Dn = ({
360
360
  section: a,
361
361
  zoom: i,
362
362
  paperWidthMm: p,
363
- selectedIds: l,
363
+ selectedIds: r,
364
364
  sampleData: k,
365
- readOnly: h,
365
+ readOnly: _,
366
366
  showGrid: S,
367
367
  onFieldClick: b,
368
- onFieldDragStart: g,
369
- onResizeStart: v,
368
+ onFieldDragStart: y,
369
+ onResizeStart: N,
370
370
  onSectionHeightChange: c,
371
- onDropField: T
371
+ onDropField: D
372
372
  }) => {
373
- const N = (a.heightMm ?? (a.type === "body" ? 200 : 40)) * i * F, r = p * i * F, [n, u] = M(!1), m = {
373
+ const w = (a.heightMm ?? (a.type === "body" ? 200 : 40)) * i * F, l = p * i * F, [n, u] = P(!1), m = {
374
374
  header: "rgba(219,234,254,0.35)",
375
375
  footer: "rgba(220,252,231,0.35)",
376
376
  background: "rgba(254,249,195,0.35)",
@@ -381,8 +381,8 @@ const Dn = ({
381
381
  {
382
382
  className: `${t.sectionCanvas} ${n ? t.sectionCanvasOver : ""}`,
383
383
  style: {
384
- width: r,
385
- height: N,
384
+ width: l,
385
+ height: w,
386
386
  position: "relative",
387
387
  background: m[a.type] ?? "transparent",
388
388
  backgroundImage: S ? `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 * i * F}px),
@@ -394,41 +394,41 @@ const Dn = ({
394
394
  onDragLeave: () => u(!1),
395
395
  onDrop: (f) => {
396
396
  f.preventDefault(), u(!1);
397
- const D = f.dataTransfer.getData("fieldPath");
398
- if (!D)
397
+ const z = f.dataTransfer.getData("fieldPath");
398
+ if (!z)
399
399
  return;
400
- const y = f.currentTarget.getBoundingClientRect(), x = (f.clientX - y.left) / (i * F), I = (f.clientY - y.top) / (i * F);
401
- T(a.id, D, Math.max(0, x), Math.max(0, I));
400
+ const g = f.currentTarget.getBoundingClientRect(), L = (f.clientX - g.left) / (i * F), C = (f.clientY - g.top) / (i * F);
401
+ D(a.id, z, Math.max(0, L), Math.max(0, C));
402
402
  },
403
403
  children: [
404
404
  /* @__PURE__ */ e("div", { className: t.sectionTypeChip, children: a.type }),
405
405
  a.fields.map((f) => /* @__PURE__ */ e(
406
- Dn,
406
+ zn,
407
407
  {
408
408
  field: f,
409
409
  zoom: i,
410
- selected: l.has(f.id),
410
+ selected: r.has(f.id),
411
411
  sampleData: k,
412
- readOnly: h,
413
- onClick: (D) => b(f.id, D),
414
- onDragStart: (D) => g(f.id, D),
415
- onResizeStart: (D, y) => v(f.id, D, y)
412
+ readOnly: _,
413
+ onClick: (z) => b(f.id, z),
414
+ onDragStart: (z) => y(f.id, z),
415
+ onResizeStart: (z, g) => N(f.id, z, g)
416
416
  },
417
417
  f.id
418
418
  )),
419
- !h && a.type !== "body" && /* @__PURE__ */ e(
419
+ !_ && a.type !== "body" && /* @__PURE__ */ e(
420
420
  "div",
421
421
  {
422
422
  className: t.sectionResizeBar,
423
423
  onMouseDown: (f) => {
424
424
  f.preventDefault();
425
- const D = f.clientY, y = a.heightMm ?? 40, x = (E) => {
426
- const W = (E.clientY - D) / (i * F);
427
- c(a.id, Math.max(10, y + W));
428
- }, I = () => {
429
- document.removeEventListener("mousemove", x), document.removeEventListener("mouseup", I);
425
+ const z = f.clientY, g = a.heightMm ?? 40, L = (M) => {
426
+ const H = (M.clientY - z) / (i * F);
427
+ c(a.id, Math.max(10, g + H));
428
+ }, C = () => {
429
+ document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", C);
430
430
  };
431
- document.addEventListener("mousemove", x), document.addEventListener("mouseup", I);
431
+ document.addEventListener("mousemove", L), document.addEventListener("mouseup", C);
432
432
  },
433
433
  children: /* @__PURE__ */ e("div", { className: t.sectionResizeGrip })
434
434
  }
@@ -439,42 +439,42 @@ const Dn = ({
439
439
  }, ne = ({ keys: a, label: i }) => /* @__PURE__ */ s("div", { className: t.shortcutChip, children: [
440
440
  /* @__PURE__ */ e("span", { className: t.shortcutKeys, children: a }),
441
441
  /* @__PURE__ */ e("span", { className: t.shortcutLabel, children: i })
442
- ] }), $n = [
442
+ ] }), Tn = [
443
443
  { id: "fields", icon: "📝", label: "Pola" },
444
444
  { id: "layers", icon: "◧", label: "Warstwy" },
445
445
  { id: "watermarks", icon: "💧", label: "Znaki" },
446
446
  { id: "signatures", icon: "✍", label: "Podpisy" },
447
447
  { id: "settings", icon: "⚙", label: "Ustawienia" }
448
- ], Rn = [
448
+ ], $n = [
449
449
  { id: "position", label: "Pozycja" },
450
450
  { id: "style", label: "Styl" },
451
451
  { id: "data", label: "Dane" },
452
452
  { id: "conditional", label: "Warunki" }
453
- ], An = ({
453
+ ], Rn = ({
454
454
  tpl: a,
455
455
  zoom: i,
456
456
  canUndo: p,
457
- canRedo: l,
457
+ canRedo: r,
458
458
  showGrid: k,
459
- showRulers: h,
459
+ showRulers: _,
460
460
  readOnly: S,
461
461
  selectedCount: b,
462
- onPaperChange: g,
463
- onZoom: v,
462
+ onPaperChange: y,
463
+ onZoom: N,
464
464
  onUndo: c,
465
- onRedo: T,
466
- onToggleGrid: N,
467
- onToggleRulers: r,
465
+ onRedo: D,
466
+ onToggleGrid: w,
467
+ onToggleRulers: l,
468
468
  onInsert: n,
469
469
  onDelete: u,
470
470
  onDuplicate: m,
471
471
  onAlignH: f,
472
- onAlignV: D,
473
- onBringForward: y,
474
- onSendBackward: x,
475
- onSave: I
472
+ onAlignV: z,
473
+ onBringForward: g,
474
+ onSendBackward: L,
475
+ onSave: C
476
476
  }) => {
477
- const [E, W] = M(!1), P = [0.5, 0.75, 1, 1.25, 1.5, 2];
477
+ const [M, H] = P(!1), A = [0.5, 0.75, 1, 1.25, 1.5, 2];
478
478
  return /* @__PURE__ */ s("div", { className: t.toolbar, children: [
479
479
  /* @__PURE__ */ s("div", { className: t.toolbarGroup, children: [
480
480
  /* @__PURE__ */ e(
@@ -482,15 +482,15 @@ const Dn = ({
482
482
  {
483
483
  className: t.toolbarSelect,
484
484
  value: a.paperSize,
485
- onChange: (_) => g(_.target.value, a.orientation),
486
- children: ["A4", "A5", "A3", "Letter", "Legal", "Tabloid", "custom"].map((_) => /* @__PURE__ */ e("option", { value: _, children: _ }, _))
485
+ onChange: (h) => y(h.target.value, a.orientation),
486
+ children: ["A4", "A5", "A3", "Letter", "Legal", "Tabloid", "custom"].map((h) => /* @__PURE__ */ e("option", { value: h, children: h }, h))
487
487
  }
488
488
  ),
489
489
  /* @__PURE__ */ e(
490
490
  "button",
491
491
  {
492
492
  className: `${t.toolbarBtn} ${a.orientation === "portrait" ? t.toolbarBtnActive : ""}`,
493
- onClick: () => g(a.paperSize, "portrait"),
493
+ onClick: () => y(a.paperSize, "portrait"),
494
494
  title: "Pion",
495
495
  children: "⬜"
496
496
  }
@@ -499,7 +499,7 @@ const Dn = ({
499
499
  "button",
500
500
  {
501
501
  className: `${t.toolbarBtn} ${a.orientation === "landscape" ? t.toolbarBtnActive : ""}`,
502
- onClick: () => g(a.paperSize, "landscape"),
502
+ onClick: () => y(a.paperSize, "landscape"),
503
503
  title: "Poziom",
504
504
  children: "▭"
505
505
  }
@@ -520,8 +520,8 @@ const Dn = ({
520
520
  "button",
521
521
  {
522
522
  className: t.toolbarBtn,
523
- disabled: !l,
524
- onClick: T,
523
+ disabled: !r,
524
+ onClick: D,
525
525
  title: "Ponów (Ctrl+Y)",
526
526
  children: "↪"
527
527
  }
@@ -532,25 +532,25 @@ const Dn = ({
532
532
  "button",
533
533
  {
534
534
  className: `${t.toolbarBtn} ${t.insertBtn}`,
535
- onClick: () => W((_) => !_),
535
+ onClick: () => H((h) => !h),
536
536
  children: "+ Wstaw ▾"
537
537
  }
538
538
  ),
539
- E && /* @__PURE__ */ s("div", { className: t.insertDropdown, onMouseLeave: () => W(!1), children: [
539
+ M && /* @__PURE__ */ s("div", { className: t.insertDropdown, onMouseLeave: () => H(!1), children: [
540
540
  /* @__PURE__ */ e("div", { className: t.insertCategory, children: "Pola danych" }),
541
- ["text", "number", "currency", "date", "image", "barcode", "qr"].map((_) => /* @__PURE__ */ s(
541
+ ["text", "number", "currency", "date", "image", "barcode", "qr"].map((h) => /* @__PURE__ */ s(
542
542
  "button",
543
543
  {
544
544
  className: t.insertItem,
545
545
  onClick: () => {
546
- n(_), W(!1);
546
+ n(h), H(!1);
547
547
  },
548
548
  children: [
549
- /* @__PURE__ */ e("span", { className: t.insertIcon, children: ce[_] }),
550
- de[_]
549
+ /* @__PURE__ */ e("span", { className: t.insertIcon, children: ce[h] }),
550
+ de[h]
551
551
  ]
552
552
  },
553
- _
553
+ h
554
554
  )),
555
555
  /* @__PURE__ */ e("div", { className: t.insertCategory, children: "Elementy statyczne" }),
556
556
  [
@@ -561,19 +561,19 @@ const Dn = ({
561
561
  "page_number",
562
562
  "total_pages",
563
563
  "print_date"
564
- ].map((_) => /* @__PURE__ */ s(
564
+ ].map((h) => /* @__PURE__ */ s(
565
565
  "button",
566
566
  {
567
567
  className: t.insertItem,
568
568
  onClick: () => {
569
- n(_), W(!1);
569
+ n(h), H(!1);
570
570
  },
571
571
  children: [
572
- /* @__PURE__ */ e("span", { className: t.insertIcon, children: ce[_] }),
573
- de[_]
572
+ /* @__PURE__ */ e("span", { className: t.insertIcon, children: ce[h] }),
573
+ de[h]
574
574
  ]
575
575
  },
576
- _
576
+ h
577
577
  )),
578
578
  /* @__PURE__ */ e("div", { className: t.insertCategory, children: "Specjalne" }),
579
579
  /* @__PURE__ */ s(
@@ -581,7 +581,7 @@ const Dn = ({
581
581
  {
582
582
  className: t.insertItem,
583
583
  onClick: () => {
584
- n("watermark"), W(!1);
584
+ n("watermark"), H(!1);
585
585
  },
586
586
  children: [
587
587
  /* @__PURE__ */ e("span", { className: t.insertIcon, children: "💧" }),
@@ -594,7 +594,7 @@ const Dn = ({
594
594
  {
595
595
  className: t.insertItem,
596
596
  onClick: () => {
597
- n("signature"), W(!1);
597
+ n("signature"), H(!1);
598
598
  },
599
599
  children: [
600
600
  /* @__PURE__ */ e("span", { className: t.insertIcon, children: "✍" }),
@@ -643,19 +643,19 @@ const Dn = ({
643
643
  children: "□□⬛"
644
644
  }
645
645
  ),
646
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => D("top"), title: "Góra", children: "⊤" }),
647
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => D("center"), title: "Środek V", children: "⊕" }),
648
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => D("bottom"), title: "Dół", children: "⊥" }),
646
+ /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => z("top"), title: "Góra", children: "⊤" }),
647
+ /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => z("center"), title: "Środek V", children: "⊕" }),
648
+ /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => z("bottom"), title: "Dół", children: "⊥" }),
649
649
  /* @__PURE__ */ e("span", { className: t.toolbarSep }),
650
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: y, title: "Do przodu", children: "▲" }),
651
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: x, title: "Do tyłu", children: "▼" })
650
+ /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: g, title: "Do przodu", children: "▲" }),
651
+ /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: L, title: "Do tyłu", children: "▼" })
652
652
  ] }),
653
653
  /* @__PURE__ */ s("div", { className: t.toolbarGroup, children: [
654
654
  /* @__PURE__ */ e(
655
655
  "button",
656
656
  {
657
657
  className: `${t.toolbarBtn} ${k ? t.toolbarBtnActive : ""}`,
658
- onClick: N,
658
+ onClick: w,
659
659
  title: "Siatka",
660
660
  children: "⊞"
661
661
  }
@@ -663,60 +663,60 @@ const Dn = ({
663
663
  /* @__PURE__ */ e(
664
664
  "button",
665
665
  {
666
- className: `${t.toolbarBtn} ${h ? t.toolbarBtnActive : ""}`,
667
- onClick: r,
666
+ className: `${t.toolbarBtn} ${_ ? t.toolbarBtnActive : ""}`,
667
+ onClick: l,
668
668
  title: "Linijki",
669
669
  children: "⊢"
670
670
  }
671
671
  )
672
672
  ] }),
673
673
  /* @__PURE__ */ s("div", { className: t.toolbarGroup, children: [
674
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => v(Math.max(0.25, i - 0.1)), children: "−" }),
674
+ /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => N(Math.max(0.25, i - 0.1)), children: "−" }),
675
675
  /* @__PURE__ */ e(
676
676
  "select",
677
677
  {
678
678
  className: t.zoomSelect,
679
- value: P.includes(i) ? i : "",
680
- onChange: (_) => v(+_.target.value),
681
- children: P.map((_) => /* @__PURE__ */ s("option", { value: _, children: [
682
- Math.round(_ * 100),
679
+ value: A.includes(i) ? i : "",
680
+ onChange: (h) => N(+h.target.value),
681
+ children: A.map((h) => /* @__PURE__ */ s("option", { value: h, children: [
682
+ Math.round(h * 100),
683
683
  "%"
684
- ] }, _))
684
+ ] }, h))
685
685
  }
686
686
  ),
687
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => v(Math.min(3, i + 0.1)), children: "+" }),
688
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => v(1), title: "100%", children: "⊡" })
687
+ /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => N(Math.min(3, i + 0.1)), children: "+" }),
688
+ /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => N(1), title: "100%", children: "⊡" })
689
689
  ] }),
690
- !S && I && /* @__PURE__ */ e("button", { className: t.saveBtn, onClick: I, children: "💾 Zapisz" })
690
+ !S && C && /* @__PURE__ */ e("button", { className: t.saveBtn, onClick: C, children: "💾 Zapisz" })
691
691
  ] });
692
- }, Pn = ({
692
+ }, An = ({
693
693
  activeTab: a,
694
694
  onTabChange: i,
695
695
  schema: p,
696
- tpl: l,
696
+ tpl: r,
697
697
  allFields: k,
698
- selectedIds: h,
698
+ selectedIds: _,
699
699
  onInsertSchemaField: S,
700
700
  onSelectField: b,
701
- onUpdateTpl: g,
702
- onReorderField: v
701
+ onUpdateTpl: y,
702
+ onReorderField: N
703
703
  }) => {
704
- const [c, T] = M(""), N = p == null ? void 0 : p.fields.filter(
705
- (r) => r.label.toLowerCase().includes(c.toLowerCase()) || r.path.toLowerCase().includes(c.toLowerCase())
704
+ const [c, D] = P(""), w = p == null ? void 0 : p.fields.filter(
705
+ (l) => l.label.toLowerCase().includes(c.toLowerCase()) || l.path.toLowerCase().includes(c.toLowerCase())
706
706
  );
707
707
  return /* @__PURE__ */ s("div", { className: t.leftPanel, children: [
708
- /* @__PURE__ */ e("div", { className: t.leftTabs, children: $n.map((r) => /* @__PURE__ */ s(
708
+ /* @__PURE__ */ e("div", { className: t.leftTabs, children: Tn.map((l) => /* @__PURE__ */ s(
709
709
  "button",
710
710
  {
711
- className: `${t.leftTab} ${a === r.id ? t.leftTabActive : ""}`,
712
- onClick: () => i(r.id),
713
- title: r.label,
711
+ className: `${t.leftTab} ${a === l.id ? t.leftTabActive : ""}`,
712
+ onClick: () => i(l.id),
713
+ title: l.label,
714
714
  children: [
715
- /* @__PURE__ */ e("span", { className: t.leftTabIcon, children: r.icon }),
716
- /* @__PURE__ */ e("span", { className: t.leftTabLabel, children: r.label })
715
+ /* @__PURE__ */ e("span", { className: t.leftTabIcon, children: l.icon }),
716
+ /* @__PURE__ */ e("span", { className: t.leftTabLabel, children: l.label })
717
717
  ]
718
718
  },
719
- r.id
719
+ l.id
720
720
  )) }),
721
721
  /* @__PURE__ */ s("div", { className: t.leftContent, children: [
722
722
  a === "fields" && /* @__PURE__ */ s(Y, { children: [
@@ -727,31 +727,31 @@ const Dn = ({
727
727
  className: t.searchInput,
728
728
  placeholder: "Szukaj...",
729
729
  value: c,
730
- onChange: (r) => T(r.target.value)
730
+ onChange: (l) => D(l.target.value)
731
731
  }
732
732
  ) }),
733
733
  p ? /* @__PURE__ */ s("div", { className: t.fieldList, children: [
734
- (N ?? []).map((r) => /* @__PURE__ */ s(
734
+ (w ?? []).map((l) => /* @__PURE__ */ s(
735
735
  "div",
736
736
  {
737
737
  className: t.fieldItem,
738
738
  draggable: !0,
739
739
  onDragStart: (n) => {
740
- n.dataTransfer.setData("fieldPath", r.path), n.dataTransfer.setData("fieldLabel", r.label), n.dataTransfer.setData("fieldType", r.type);
740
+ n.dataTransfer.setData("fieldPath", l.path), n.dataTransfer.setData("fieldLabel", l.label), n.dataTransfer.setData("fieldType", l.type);
741
741
  },
742
- onClick: () => S(r),
742
+ onClick: () => S(l),
743
743
  children: [
744
- /* @__PURE__ */ e("span", { className: t.fieldItemIcon, children: ce[r.type] ?? "📝" }),
744
+ /* @__PURE__ */ e("span", { className: t.fieldItemIcon, children: ce[l.type] ?? "📝" }),
745
745
  /* @__PURE__ */ s("div", { className: t.fieldItemInfo, children: [
746
- /* @__PURE__ */ e("div", { className: t.fieldItemLabel, children: r.label }),
747
- /* @__PURE__ */ e("div", { className: t.fieldItemPath, children: r.path })
746
+ /* @__PURE__ */ e("div", { className: t.fieldItemLabel, children: l.label }),
747
+ /* @__PURE__ */ e("div", { className: t.fieldItemPath, children: l.path })
748
748
  ] }),
749
- /* @__PURE__ */ e("span", { className: t.fieldItemType, children: r.type })
749
+ /* @__PURE__ */ e("span", { className: t.fieldItemType, children: l.type })
750
750
  ]
751
751
  },
752
- r.path
752
+ l.path
753
753
  )),
754
- (N == null ? void 0 : N.length) === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: "Brak wyników" })
754
+ (w == null ? void 0 : w.length) === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: "Brak wyników" })
755
755
  ] }) : /* @__PURE__ */ e("div", { className: t.emptyMsg, children: "Brak schematu danych. Przypisz encję w zakładce Ustawienia." })
756
756
  ] }),
757
757
  a === "layers" && /* @__PURE__ */ s(Y, { children: [
@@ -762,21 +762,21 @@ const Dn = ({
762
762
  ] }),
763
763
  /* @__PURE__ */ s("div", { className: t.layerList, children: [
764
764
  k.length === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: "Brak elementów" }),
765
- k.slice().reverse().map((r) => /* @__PURE__ */ s(
765
+ k.slice().reverse().map((l) => /* @__PURE__ */ s(
766
766
  "div",
767
767
  {
768
- className: `${t.layerItem} ${h.has(r.id) ? t.layerItemSelected : ""}`,
769
- onClick: () => b(r.id),
768
+ className: `${t.layerItem} ${_.has(l.id) ? t.layerItemSelected : ""}`,
769
+ onClick: () => b(l.id),
770
770
  children: [
771
- /* @__PURE__ */ e("span", { className: t.layerIcon, children: ce[r.type] ?? "📝" }),
772
- /* @__PURE__ */ e("span", { className: t.layerName, children: r.name || r.label }),
771
+ /* @__PURE__ */ e("span", { className: t.layerIcon, children: ce[l.type] ?? "📝" }),
772
+ /* @__PURE__ */ e("span", { className: t.layerName, children: l.name || l.label }),
773
773
  /* @__PURE__ */ s("div", { className: t.layerActions, children: [
774
774
  /* @__PURE__ */ e(
775
775
  "button",
776
776
  {
777
777
  className: t.layerBtn,
778
778
  onClick: (n) => {
779
- n.stopPropagation(), v(r.id, -1);
779
+ n.stopPropagation(), N(l.id, -1);
780
780
  },
781
781
  title: "Do przodu",
782
782
  children: "↑"
@@ -787,7 +787,7 @@ const Dn = ({
787
787
  {
788
788
  className: t.layerBtn,
789
789
  onClick: (n) => {
790
- n.stopPropagation(), v(r.id, 1);
790
+ n.stopPropagation(), N(l.id, 1);
791
791
  },
792
792
  title: "Do tyłu",
793
793
  children: "↓"
@@ -796,26 +796,26 @@ const Dn = ({
796
796
  ] })
797
797
  ]
798
798
  },
799
- r.id
799
+ l.id
800
800
  ))
801
801
  ] })
802
802
  ] }),
803
803
  a === "watermarks" && /* @__PURE__ */ s(Y, { children: [
804
804
  /* @__PURE__ */ e("div", { className: t.panelHeader, children: "Znaki wodne" }),
805
805
  /* @__PURE__ */ s("div", { className: t.wmList, children: [
806
- (l.watermarks ?? []).map((r) => /* @__PURE__ */ s("div", { className: t.wmItem, children: [
806
+ (r.watermarks ?? []).map((l) => /* @__PURE__ */ s("div", { className: t.wmItem, children: [
807
807
  /* @__PURE__ */ s("div", { className: t.wmRow, children: [
808
808
  /* @__PURE__ */ e("span", { className: t.wmLabel, children: "Typ" }),
809
809
  /* @__PURE__ */ s(
810
810
  "select",
811
811
  {
812
812
  className: t.wmSelect,
813
- value: r.type,
813
+ value: l.type,
814
814
  onChange: (n) => {
815
815
  var u;
816
- return g({
817
- watermarks: (u = l.watermarks) == null ? void 0 : u.map(
818
- (m) => m.id === r.id ? { ...m, type: n.target.value } : m
816
+ return y({
817
+ watermarks: (u = r.watermarks) == null ? void 0 : u.map(
818
+ (m) => m.id === l.id ? { ...m, type: n.target.value } : m
819
819
  )
820
820
  });
821
821
  },
@@ -826,18 +826,18 @@ const Dn = ({
826
826
  }
827
827
  )
828
828
  ] }),
829
- r.type === "text" && /* @__PURE__ */ s("div", { className: t.wmRow, children: [
829
+ l.type === "text" && /* @__PURE__ */ s("div", { className: t.wmRow, children: [
830
830
  /* @__PURE__ */ e("span", { className: t.wmLabel, children: "Tekst" }),
831
831
  /* @__PURE__ */ e(
832
832
  "input",
833
833
  {
834
834
  className: t.wmInput,
835
- value: r.text ?? "",
835
+ value: l.text ?? "",
836
836
  onChange: (n) => {
837
837
  var u;
838
- return g({
839
- watermarks: (u = l.watermarks) == null ? void 0 : u.map(
840
- (m) => m.id === r.id ? { ...m, text: n.target.value } : m
838
+ return y({
839
+ watermarks: (u = r.watermarks) == null ? void 0 : u.map(
840
+ (m) => m.id === l.id ? { ...m, text: n.target.value } : m
841
841
  )
842
842
  });
843
843
  }
@@ -854,19 +854,19 @@ const Dn = ({
854
854
  max: 0.5,
855
855
  step: 0.01,
856
856
  className: t.wmSlider,
857
- value: r.opacity,
857
+ value: l.opacity,
858
858
  onChange: (n) => {
859
859
  var u;
860
- return g({
861
- watermarks: (u = l.watermarks) == null ? void 0 : u.map(
862
- (m) => m.id === r.id ? { ...m, opacity: +n.target.value } : m
860
+ return y({
861
+ watermarks: (u = r.watermarks) == null ? void 0 : u.map(
862
+ (m) => m.id === l.id ? { ...m, opacity: +n.target.value } : m
863
863
  )
864
864
  });
865
865
  }
866
866
  }
867
867
  ),
868
868
  /* @__PURE__ */ s("span", { className: t.wmValue, children: [
869
- Math.round(r.opacity * 100),
869
+ Math.round(l.opacity * 100),
870
870
  "%"
871
871
  ] })
872
872
  ] }),
@@ -880,19 +880,19 @@ const Dn = ({
880
880
  max: 90,
881
881
  step: 5,
882
882
  className: t.wmSlider,
883
- value: r.angle,
883
+ value: l.angle,
884
884
  onChange: (n) => {
885
885
  var u;
886
- return g({
887
- watermarks: (u = l.watermarks) == null ? void 0 : u.map(
888
- (m) => m.id === r.id ? { ...m, angle: +n.target.value } : m
886
+ return y({
887
+ watermarks: (u = r.watermarks) == null ? void 0 : u.map(
888
+ (m) => m.id === l.id ? { ...m, angle: +n.target.value } : m
889
889
  )
890
890
  });
891
891
  }
892
892
  }
893
893
  ),
894
894
  /* @__PURE__ */ s("span", { className: t.wmValue, children: [
895
- r.angle,
895
+ l.angle,
896
896
  "°"
897
897
  ] })
898
898
  ] }),
@@ -905,12 +905,12 @@ const Dn = ({
905
905
  min: 8,
906
906
  max: 200,
907
907
  className: t.wmInputNum,
908
- value: r.fontSize ?? 48,
908
+ value: l.fontSize ?? 48,
909
909
  onChange: (n) => {
910
910
  var u;
911
- return g({
912
- watermarks: (u = l.watermarks) == null ? void 0 : u.map(
913
- (m) => m.id === r.id ? { ...m, fontSize: +n.target.value } : m
911
+ return y({
912
+ watermarks: (u = r.watermarks) == null ? void 0 : u.map(
913
+ (m) => m.id === l.id ? { ...m, fontSize: +n.target.value } : m
914
914
  )
915
915
  });
916
916
  }
@@ -925,12 +925,12 @@ const Dn = ({
925
925
  {
926
926
  type: "color",
927
927
  className: t.colorPicker,
928
- value: r.color ?? "var(--nice-text-muted, #94a3b8)",
928
+ value: l.color ?? "var(--nice-text-muted, #94a3b8)",
929
929
  onChange: (n) => {
930
930
  var u;
931
- return g({
932
- watermarks: (u = l.watermarks) == null ? void 0 : u.map(
933
- (m) => m.id === r.id ? { ...m, color: n.target.value } : m
931
+ return y({
932
+ watermarks: (u = r.watermarks) == null ? void 0 : u.map(
933
+ (m) => m.id === l.id ? { ...m, color: n.target.value } : m
934
934
  )
935
935
  });
936
936
  }
@@ -943,19 +943,19 @@ const Dn = ({
943
943
  className: t.wmDelete,
944
944
  onClick: () => {
945
945
  var n;
946
- return g({ watermarks: (n = l.watermarks) == null ? void 0 : n.filter((u) => u.id !== r.id) });
946
+ return y({ watermarks: (n = r.watermarks) == null ? void 0 : n.filter((u) => u.id !== l.id) });
947
947
  },
948
948
  children: "Usuń"
949
949
  }
950
950
  )
951
- ] }, r.id)),
951
+ ] }, l.id)),
952
952
  /* @__PURE__ */ e(
953
953
  "button",
954
954
  {
955
955
  className: t.addBtn,
956
- onClick: () => g({
956
+ onClick: () => y({
957
957
  watermarks: [
958
- ...l.watermarks ?? [],
958
+ ...r.watermarks ?? [],
959
959
  {
960
960
  id: se(),
961
961
  type: "text",
@@ -975,19 +975,19 @@ const Dn = ({
975
975
  a === "signatures" && /* @__PURE__ */ s(Y, { children: [
976
976
  /* @__PURE__ */ e("div", { className: t.panelHeader, children: "Podpisy" }),
977
977
  /* @__PURE__ */ s("div", { className: t.wmList, children: [
978
- (l.signatures ?? []).map((r) => /* @__PURE__ */ s("div", { className: t.wmItem, children: [
978
+ (r.signatures ?? []).map((l) => /* @__PURE__ */ s("div", { className: t.wmItem, children: [
979
979
  /* @__PURE__ */ s("div", { className: t.wmRow, children: [
980
980
  /* @__PURE__ */ e("span", { className: t.wmLabel, children: "Etykieta" }),
981
981
  /* @__PURE__ */ e(
982
982
  "input",
983
983
  {
984
984
  className: t.wmInput,
985
- value: r.label,
985
+ value: l.label,
986
986
  onChange: (n) => {
987
987
  var u;
988
- return g({
989
- signatures: (u = l.signatures) == null ? void 0 : u.map(
990
- (m) => m.id === r.id ? { ...m, label: n.target.value } : m
988
+ return y({
989
+ signatures: (u = r.signatures) == null ? void 0 : u.map(
990
+ (m) => m.id === l.id ? { ...m, label: n.target.value } : m
991
991
  )
992
992
  });
993
993
  }
@@ -1000,12 +1000,12 @@ const Dn = ({
1000
1000
  "input",
1001
1001
  {
1002
1002
  className: t.wmInput,
1003
- value: r.signerName ?? "",
1003
+ value: l.signerName ?? "",
1004
1004
  onChange: (n) => {
1005
1005
  var u;
1006
- return g({
1007
- signatures: (u = l.signatures) == null ? void 0 : u.map(
1008
- (m) => m.id === r.id ? { ...m, signerName: n.target.value } : m
1006
+ return y({
1007
+ signatures: (u = r.signatures) == null ? void 0 : u.map(
1008
+ (m) => m.id === l.id ? { ...m, signerName: n.target.value } : m
1009
1009
  )
1010
1010
  });
1011
1011
  }
@@ -1018,12 +1018,12 @@ const Dn = ({
1018
1018
  "input",
1019
1019
  {
1020
1020
  type: "checkbox",
1021
- checked: r.showLine ?? !0,
1021
+ checked: l.showLine ?? !0,
1022
1022
  onChange: (n) => {
1023
1023
  var u;
1024
- return g({
1025
- signatures: (u = l.signatures) == null ? void 0 : u.map(
1026
- (m) => m.id === r.id ? { ...m, showLine: n.target.checked } : m
1024
+ return y({
1025
+ signatures: (u = r.signatures) == null ? void 0 : u.map(
1026
+ (m) => m.id === l.id ? { ...m, showLine: n.target.checked } : m
1027
1027
  )
1028
1028
  });
1029
1029
  }
@@ -1036,12 +1036,12 @@ const Dn = ({
1036
1036
  "input",
1037
1037
  {
1038
1038
  type: "checkbox",
1039
- checked: r.showDate ?? !1,
1039
+ checked: l.showDate ?? !1,
1040
1040
  onChange: (n) => {
1041
1041
  var u;
1042
- return g({
1043
- signatures: (u = l.signatures) == null ? void 0 : u.map(
1044
- (m) => m.id === r.id ? { ...m, showDate: n.target.checked } : m
1042
+ return y({
1043
+ signatures: (u = r.signatures) == null ? void 0 : u.map(
1044
+ (m) => m.id === l.id ? { ...m, showDate: n.target.checked } : m
1045
1045
  )
1046
1046
  });
1047
1047
  }
@@ -1054,19 +1054,19 @@ const Dn = ({
1054
1054
  className: t.wmDelete,
1055
1055
  onClick: () => {
1056
1056
  var n;
1057
- return g({ signatures: (n = l.signatures) == null ? void 0 : n.filter((u) => u.id !== r.id) });
1057
+ return y({ signatures: (n = r.signatures) == null ? void 0 : n.filter((u) => u.id !== l.id) });
1058
1058
  },
1059
1059
  children: "Usuń"
1060
1060
  }
1061
1061
  )
1062
- ] }, r.id)),
1062
+ ] }, l.id)),
1063
1063
  /* @__PURE__ */ e(
1064
1064
  "button",
1065
1065
  {
1066
1066
  className: t.addBtn,
1067
- onClick: () => g({
1067
+ onClick: () => y({
1068
1068
  signatures: [
1069
- ...l.signatures ?? [],
1069
+ ...r.signatures ?? [],
1070
1070
  {
1071
1071
  id: se(),
1072
1072
  label: "Podpis",
@@ -1090,8 +1090,8 @@ const Dn = ({
1090
1090
  "input",
1091
1091
  {
1092
1092
  className: t.settingsInput,
1093
- value: l.name,
1094
- onChange: (r) => g({ name: r.target.value })
1093
+ value: r.name,
1094
+ onChange: (l) => y({ name: l.target.value })
1095
1095
  }
1096
1096
  )
1097
1097
  ] }),
@@ -1101,8 +1101,8 @@ const Dn = ({
1101
1101
  "textarea",
1102
1102
  {
1103
1103
  className: t.settingsTextarea,
1104
- value: l.description ?? "",
1105
- onChange: (r) => g({ description: r.target.value }),
1104
+ value: r.description ?? "",
1105
+ onChange: (l) => y({ description: l.target.value }),
1106
1106
  rows: 2
1107
1107
  }
1108
1108
  )
@@ -1113,14 +1113,14 @@ const Dn = ({
1113
1113
  "input",
1114
1114
  {
1115
1115
  className: t.settingsInput,
1116
- value: l.category ?? "",
1117
- onChange: (r) => g({ category: r.target.value })
1116
+ value: r.category ?? "",
1117
+ onChange: (l) => y({ category: l.target.value })
1118
1118
  }
1119
1119
  )
1120
1120
  ] }),
1121
1121
  /* @__PURE__ */ e("div", { className: t.settingsDivider, children: "Marginesy (mm)" }),
1122
- ["top", "right", "bottom", "left"].map((r) => /* @__PURE__ */ s("div", { className: t.settingsRow, children: [
1123
- /* @__PURE__ */ e("label", { className: t.settingsLabel, children: r === "top" ? "Góra" : r === "right" ? "Prawo" : r === "bottom" ? "Dół" : "Lewo" }),
1122
+ ["top", "right", "bottom", "left"].map((l) => /* @__PURE__ */ s("div", { className: t.settingsRow, children: [
1123
+ /* @__PURE__ */ e("label", { className: t.settingsLabel, children: l === "top" ? "Góra" : l === "right" ? "Prawo" : l === "bottom" ? "Dół" : "Lewo" }),
1124
1124
  /* @__PURE__ */ e(
1125
1125
  "input",
1126
1126
  {
@@ -1129,31 +1129,31 @@ const Dn = ({
1129
1129
  max: 50,
1130
1130
  step: 1,
1131
1131
  className: t.settingsInputNum,
1132
- value: l.margins[r],
1133
- onChange: (n) => g({ margins: { ...l.margins, [r]: +n.target.value } })
1132
+ value: r.margins[l],
1133
+ onChange: (n) => y({ margins: { ...r.margins, [l]: +n.target.value } })
1134
1134
  }
1135
1135
  ),
1136
1136
  /* @__PURE__ */ e("span", { className: t.settingsUnit, children: "mm" })
1137
- ] }, r))
1137
+ ] }, l))
1138
1138
  ] })
1139
1139
  ] })
1140
1140
  ] })
1141
1141
  ] });
1142
- }, Mn = ({
1142
+ }, Pn = ({
1143
1143
  field: a,
1144
1144
  activeTab: i,
1145
1145
  onTabChange: p,
1146
- onChange: l,
1146
+ onChange: r,
1147
1147
  paperWidthMm: k,
1148
- paperHeightMm: h
1148
+ paperHeightMm: _
1149
1149
  }) => {
1150
- var c, T, N, r;
1151
- const S = $(
1152
- (n) => a && l({ position: { ...a.position, ...n } }),
1153
- [a, l]
1154
- ), b = $(
1155
- (n) => a && l({ style: { ...(a == null ? void 0 : a.style) ?? {}, ...n } }),
1156
- [a, l]
1150
+ var c, D, w, l;
1151
+ const S = T(
1152
+ (n) => a && r({ position: { ...a.position, ...n } }),
1153
+ [a, r]
1154
+ ), b = T(
1155
+ (n) => a && r({ style: { ...(a == null ? void 0 : a.style) ?? {}, ...n } }),
1156
+ [a, r]
1157
1157
  );
1158
1158
  if (!a)
1159
1159
  return /* @__PURE__ */ s("div", { className: t.rightPanel, children: [
@@ -1171,9 +1171,9 @@ const Dn = ({
1171
1171
  ] })
1172
1172
  ] })
1173
1173
  ] });
1174
- const g = !["line", "rect", "image", "static_image", "barcode", "qr", "signature"].includes(
1174
+ const y = !["line", "rect", "image", "static_image", "barcode", "qr", "signature"].includes(
1175
1175
  a.type
1176
- ), v = ![
1176
+ ), N = ![
1177
1177
  "static_text",
1178
1178
  "static_image",
1179
1179
  "line",
@@ -1187,7 +1187,7 @@ const Dn = ({
1187
1187
  /* @__PURE__ */ e("span", { className: t.panelHeaderIcon, children: ce[a.type] }),
1188
1188
  /* @__PURE__ */ e("span", { className: t.panelHeaderName, children: a.name })
1189
1189
  ] }),
1190
- /* @__PURE__ */ e("div", { className: t.rightTabs, children: Rn.map((n) => n.id === "data" && !v ? null : /* @__PURE__ */ e(
1190
+ /* @__PURE__ */ e("div", { className: t.rightTabs, children: $n.map((n) => n.id === "data" && !N ? null : /* @__PURE__ */ e(
1191
1191
  "button",
1192
1192
  {
1193
1193
  className: `${t.rightTab} ${i === n.id ? t.rightTabActive : ""}`,
@@ -1273,7 +1273,7 @@ const Dn = ({
1273
1273
  ] })
1274
1274
  ] }),
1275
1275
  i === "style" && /* @__PURE__ */ s(Y, { children: [
1276
- g && /* @__PURE__ */ s("div", { className: t.styleGroup, children: [
1276
+ y && /* @__PURE__ */ s("div", { className: t.styleGroup, children: [
1277
1277
  /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: "Czcionka" }),
1278
1278
  /* @__PURE__ */ s("div", { className: t.styleRow, children: [
1279
1279
  /* @__PURE__ */ e("label", { className: t.styleLabel, children: "Rodzina" }),
@@ -1283,7 +1283,7 @@ const Dn = ({
1283
1283
  className: t.styleSelectFull,
1284
1284
  value: a.style.fontFamily ?? "sans-serif",
1285
1285
  onChange: (n) => b({ fontFamily: n.target.value }),
1286
- children: Cn.map((n) => /* @__PURE__ */ e("option", { value: n, children: n }, n))
1286
+ children: xn.map((n) => /* @__PURE__ */ e("option", { value: n, children: n }, n))
1287
1287
  }
1288
1288
  )
1289
1289
  ] }),
@@ -1512,7 +1512,7 @@ const Dn = ({
1512
1512
  ] })
1513
1513
  ] })
1514
1514
  ] }),
1515
- i === "data" && v && /* @__PURE__ */ s("div", { className: t.styleGroup, children: [
1515
+ i === "data" && N && /* @__PURE__ */ s("div", { className: t.styleGroup, children: [
1516
1516
  /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: "Źródło danych" }),
1517
1517
  /* @__PURE__ */ s("div", { className: t.styleRow, children: [
1518
1518
  /* @__PURE__ */ e("label", { className: t.styleLabel, children: "Ścieżka" }),
@@ -1521,7 +1521,7 @@ const Dn = ({
1521
1521
  {
1522
1522
  className: t.styleInputFull,
1523
1523
  value: a.dataPath,
1524
- onChange: (n) => l({ dataPath: n.target.value }),
1524
+ onChange: (n) => r({ dataPath: n.target.value }),
1525
1525
  placeholder: "np. invoice.number"
1526
1526
  }
1527
1527
  )
@@ -1533,7 +1533,7 @@ const Dn = ({
1533
1533
  {
1534
1534
  className: t.styleInputFull,
1535
1535
  value: a.format ?? "",
1536
- onChange: (n) => l({ format: n.target.value }),
1536
+ onChange: (n) => r({ format: n.target.value }),
1537
1537
  placeholder: "DD.MM.YYYY / #,##0.00"
1538
1538
  }
1539
1539
  )
@@ -1545,7 +1545,7 @@ const Dn = ({
1545
1545
  {
1546
1546
  className: t.styleInputFull,
1547
1547
  value: a.fallback ?? "",
1548
- onChange: (n) => l({ fallback: n.target.value }),
1548
+ onChange: (n) => r({ fallback: n.target.value }),
1549
1549
  placeholder: "Gdy brak wartości"
1550
1550
  }
1551
1551
  )
@@ -1557,7 +1557,7 @@ const Dn = ({
1557
1557
  {
1558
1558
  className: t.styleSelectFull,
1559
1559
  value: a.type,
1560
- onChange: (n) => l({ type: n.target.value }),
1560
+ onChange: (n) => r({ type: n.target.value }),
1561
1561
  children: Object.entries(de).map(([n, u]) => /* @__PURE__ */ e("option", { value: n, children: u }, n))
1562
1562
  }
1563
1563
  )
@@ -1569,7 +1569,7 @@ const Dn = ({
1569
1569
  {
1570
1570
  className: t.styleSelectFull,
1571
1571
  value: a.barcodeType ?? "code128",
1572
- onChange: (n) => l({ barcodeType: n.target.value }),
1572
+ onChange: (n) => r({ barcodeType: n.target.value }),
1573
1573
  children: ["ean13", "ean8", "code128", "code39", "upc", "itf14", "datamatrix"].map((n) => /* @__PURE__ */ e("option", { value: n, children: n.toUpperCase() }, n))
1574
1574
  }
1575
1575
  )
@@ -1587,7 +1587,7 @@ const Dn = ({
1587
1587
  value: ((c = a.conditional) == null ? void 0 : c.field) ?? "",
1588
1588
  onChange: (n) => {
1589
1589
  var u, m;
1590
- return l({
1590
+ return r({
1591
1591
  conditional: {
1592
1592
  field: n.target.value,
1593
1593
  operator: ((u = a.conditional) == null ? void 0 : u.operator) ?? "eq",
@@ -1605,10 +1605,10 @@ const Dn = ({
1605
1605
  "select",
1606
1606
  {
1607
1607
  className: t.styleSelectFull,
1608
- value: ((T = a.conditional) == null ? void 0 : T.operator) ?? "eq",
1608
+ value: ((D = a.conditional) == null ? void 0 : D.operator) ?? "eq",
1609
1609
  onChange: (n) => {
1610
1610
  var u, m;
1611
- return l({
1611
+ return r({
1612
1612
  conditional: {
1613
1613
  field: ((u = a.conditional) == null ? void 0 : u.field) ?? "",
1614
1614
  operator: n.target.value,
@@ -1632,10 +1632,10 @@ const Dn = ({
1632
1632
  "input",
1633
1633
  {
1634
1634
  className: t.styleInputFull,
1635
- value: String(((N = a.conditional) == null ? void 0 : N.value) ?? ""),
1635
+ value: String(((w = a.conditional) == null ? void 0 : w.value) ?? ""),
1636
1636
  onChange: (n) => {
1637
1637
  var u, m;
1638
- return l({
1638
+ return r({
1639
1639
  conditional: {
1640
1640
  field: ((u = a.conditional) == null ? void 0 : u.field) ?? "",
1641
1641
  operator: ((m = a.conditional) == null ? void 0 : m.operator) ?? "eq",
@@ -1647,11 +1647,11 @@ const Dn = ({
1647
1647
  }
1648
1648
  )
1649
1649
  ] }),
1650
- ((r = a.conditional) == null ? void 0 : r.field) && /* @__PURE__ */ e(
1650
+ ((l = a.conditional) == null ? void 0 : l.field) && /* @__PURE__ */ e(
1651
1651
  "button",
1652
1652
  {
1653
1653
  className: t.clearConditionalBtn,
1654
- onClick: () => l({ conditional: void 0 }),
1654
+ onClick: () => r({ conditional: void 0 }),
1655
1655
  children: "Wyczyść warunek"
1656
1656
  }
1657
1657
  )
@@ -1659,7 +1659,7 @@ const Dn = ({
1659
1659
  ] })
1660
1660
  ] });
1661
1661
  };
1662
- function En() {
1662
+ function Mn() {
1663
1663
  return {
1664
1664
  id: `tpl-${Date.now()}`,
1665
1665
  name: "Nowy szablon",
@@ -1676,61 +1676,61 @@ function En() {
1676
1676
  signatures: []
1677
1677
  };
1678
1678
  }
1679
- const el = ({
1679
+ const er = ({
1680
1680
  template: a,
1681
1681
  dataSchema: i,
1682
1682
  sampleData: p = [],
1683
- onChange: l,
1683
+ onChange: r,
1684
1684
  onSave: k,
1685
- readOnly: h = !1,
1685
+ readOnly: _ = !1,
1686
1686
  className: S,
1687
1687
  style: b,
1688
- theme: g = "light"
1688
+ theme: y = "light"
1689
1689
  }) => {
1690
- const [{ past: v, present: c, future: T }, N] = je(In, {
1690
+ const [{ past: N, present: c, future: D }, w] = We(Cn, {
1691
1691
  past: [],
1692
- present: a ?? En(),
1692
+ present: a ?? Mn(),
1693
1693
  future: []
1694
- }), [r, n] = M(/* @__PURE__ */ new Set()), [u, m] = M("sec-body"), [f, D] = M(1), [y, x] = M(0), [I, E] = M("fields"), [W, P] = M("position"), [_, q] = M(!1), [pe, Ce] = M(!0), R = $(
1694
+ }), [l, n] = P(/* @__PURE__ */ new Set()), [u, m] = P("sec-body"), [f, z] = P(1), [g, L] = P(0), [C, M] = P("fields"), [H, A] = P("position"), [h, q] = P(!1), [pe, xe] = P(!0), $ = T(
1695
1695
  (o) => {
1696
1696
  const d = { ...c, ...o };
1697
- N({ type: "UPDATE", payload: d }), l == null || l(d);
1697
+ w({ type: "UPDATE", payload: d }), r == null || r(d);
1698
1698
  },
1699
- [c, l]
1699
+ [c, r]
1700
1700
  ), [Z, me] = oe(() => {
1701
- const [o, d] = Ne[c.paperSize] ?? Ne.A4;
1701
+ const [o, d] = we[c.paperSize] ?? we.A4;
1702
1702
  return c.orientation === "landscape" ? [d, o] : [o, d];
1703
- }, [c.paperSize, c.orientation]), X = oe(() => c.sections.flatMap((o) => o.fields), [c]), G = oe(
1704
- () => X.find((o) => r.has(o.id)) ?? null,
1705
- [X, r]
1706
- ), ue = $(
1703
+ }, [c.paperSize, c.orientation]), X = oe(() => c.sections.flatMap((o) => o.fields), [c]), E = oe(
1704
+ () => X.find((o) => l.has(o.id)) ?? null,
1705
+ [X, l]
1706
+ ), ue = T(
1707
1707
  (o, d) => {
1708
- R({
1709
- sections: c.sections.map((C) => ({
1710
- ...C,
1711
- fields: C.fields.map(
1708
+ $({
1709
+ sections: c.sections.map((x) => ({
1710
+ ...x,
1711
+ fields: x.fields.map(
1712
1712
  (B) => B.id === o ? { ...B, ...d, style: { ...B.style, ...d.style ?? {} } } : B
1713
1713
  )
1714
1714
  }))
1715
1715
  });
1716
1716
  },
1717
- [c, R]
1718
- ), re = $(
1717
+ [c, $]
1718
+ ), le = T(
1719
1719
  (o) => {
1720
- R({
1720
+ $({
1721
1721
  sections: c.sections.map((d) => ({
1722
1722
  ...d,
1723
1723
  fields: d.fields.map(
1724
- (C) => r.has(C.id) ? { ...C, ...o, style: { ...C.style, ...o.style ?? {} } } : C
1724
+ (x) => l.has(x.id) ? { ...x, ...o, style: { ...x.style, ...o.style ?? {} } } : x
1725
1725
  )
1726
1726
  }))
1727
1727
  });
1728
1728
  },
1729
- [c, r, R]
1730
- ), be = $(
1729
+ [c, l, $]
1730
+ ), be = T(
1731
1731
  (o, d) => {
1732
1732
  if (o === "watermark") {
1733
- R({
1733
+ $({
1734
1734
  watermarks: [
1735
1735
  ...c.watermarks ?? [],
1736
1736
  {
@@ -1743,11 +1743,11 @@ const el = ({
1743
1743
  color: "var(--nice-text-muted, #94a3b8)"
1744
1744
  }
1745
1745
  ]
1746
- }), E("watermarks");
1746
+ }), M("watermarks");
1747
1747
  return;
1748
1748
  }
1749
1749
  if (o === "signature") {
1750
- R({
1750
+ $({
1751
1751
  signatures: [
1752
1752
  ...c.signatures ?? [],
1753
1753
  {
@@ -1758,87 +1758,87 @@ const el = ({
1758
1758
  showDate: !1
1759
1759
  }
1760
1760
  ]
1761
- }), E("signatures");
1761
+ }), M("signatures");
1762
1762
  return;
1763
1763
  }
1764
- const C = c.sections.find((H) => H.id === u) ?? c.sections.find((H) => H.type === "body");
1765
- if (!C)
1764
+ const x = c.sections.find((G) => G.id === u) ?? c.sections.find((G) => G.type === "body");
1765
+ if (!x)
1766
1766
  return;
1767
- const B = ke(o, d), A = {
1767
+ const B = ke(o, d), R = {
1768
1768
  sections: c.sections.map(
1769
- (H) => H.id === C.id ? { ...H, fields: [...H.fields, B] } : H
1769
+ (G) => G.id === x.id ? { ...G, fields: [...G.fields, B] } : G
1770
1770
  )
1771
1771
  };
1772
- N({ type: "UPDATE", payload: { ...c, ...A } }), l == null || l({ ...c, ...A }), n(/* @__PURE__ */ new Set([B.id]));
1772
+ w({ type: "UPDATE", payload: { ...c, ...R } }), r == null || r({ ...c, ...R }), n(/* @__PURE__ */ new Set([B.id]));
1773
1773
  },
1774
- [c, u, l]
1775
- ), Ie = $(
1776
- (o, d, C, B) => {
1777
- const A = i == null ? void 0 : i.fields.find((O) => O.path === d), H = ke((A == null ? void 0 : A.type) ?? "text", A);
1778
- H.position.x = Math.round(C * 2) / 2, H.position.y = Math.round(B * 2) / 2;
1774
+ [c, u, r]
1775
+ ), Ce = T(
1776
+ (o, d, x, B) => {
1777
+ const R = i == null ? void 0 : i.fields.find((O) => O.path === d), G = ke((R == null ? void 0 : R.type) ?? "text", R);
1778
+ G.position.x = Math.round(x * 2) / 2, G.position.y = Math.round(B * 2) / 2;
1779
1779
  const J = {
1780
1780
  sections: c.sections.map(
1781
- (O) => O.id === o ? { ...O, fields: [...O.fields, H] } : O
1781
+ (O) => O.id === o ? { ...O, fields: [...O.fields, G] } : O
1782
1782
  )
1783
1783
  };
1784
- N({ type: "UPDATE", payload: { ...c, ...J } }), l == null || l({ ...c, ...J }), n(/* @__PURE__ */ new Set([H.id]));
1784
+ w({ type: "UPDATE", payload: { ...c, ...J } }), r == null || r({ ...c, ...J }), n(/* @__PURE__ */ new Set([G.id]));
1785
1785
  },
1786
- [c, i, l]
1787
- ), Le = $((o, d) => {
1788
- d.ctrlKey || d.metaKey ? n((C) => {
1789
- const B = new Set(C);
1786
+ [c, i, r]
1787
+ ), Ie = T((o, d) => {
1788
+ d.ctrlKey || d.metaKey ? n((x) => {
1789
+ const B = new Set(x);
1790
1790
  return B.has(o) ? B.delete(o) : B.add(o), B;
1791
- }) : d.shiftKey ? n((C) => /* @__PURE__ */ new Set([...C, o])) : n(/* @__PURE__ */ new Set([o]));
1792
- }, []), xe = $(
1791
+ }) : d.shiftKey ? n((x) => /* @__PURE__ */ new Set([...x, o])) : n(/* @__PURE__ */ new Set([o]));
1792
+ }, []), Le = T(
1793
1793
  (o, d) => {
1794
- if (h)
1794
+ if (_)
1795
1795
  return;
1796
- d.preventDefault(), r.has(o) || n(/* @__PURE__ */ new Set([o]));
1797
- const C = d.clientX, B = d.clientY, A = c.sections.map((O) => ({
1796
+ d.preventDefault(), l.has(o) || n(/* @__PURE__ */ new Set([o]));
1797
+ const x = d.clientX, B = d.clientY, R = c.sections.map((O) => ({
1798
1798
  id: O.id,
1799
1799
  fields: O.fields.map((Q) => ({ id: Q.id, pos: { ...Q.position } }))
1800
- })), H = (O) => {
1801
- const Q = (O.clientX - C) / (f * F), te = (O.clientY - B) / (f * F), le = r.has(o) ? r : /* @__PURE__ */ new Set([o]), ie = c.sections.map((ee) => {
1802
- const K = A.find((U) => U.id === ee.id);
1800
+ })), G = (O) => {
1801
+ const Q = (O.clientX - x) / (f * F), te = (O.clientY - B) / (f * F), re = l.has(o) ? l : /* @__PURE__ */ new Set([o]), ie = c.sections.map((ee) => {
1802
+ const K = R.find((U) => U.id === ee.id);
1803
1803
  return {
1804
1804
  ...ee,
1805
1805
  fields: ee.fields.map((U) => {
1806
- var ve;
1807
- if (!le.has(U.id))
1806
+ var Ne;
1807
+ if (!re.has(U.id))
1808
1808
  return U;
1809
- const we = ((ve = K == null ? void 0 : K.fields.find((He) => He.id === U.id)) == null ? void 0 : ve.pos) ?? U.position;
1809
+ const ve = ((Ne = K == null ? void 0 : K.fields.find((Ge) => Ge.id === U.id)) == null ? void 0 : Ne.pos) ?? U.position;
1810
1810
  return {
1811
1811
  ...U,
1812
1812
  position: {
1813
1813
  ...U.position,
1814
- x: Math.max(0, Math.round((we.x + Q) * 2) / 2),
1815
- y: Math.max(0, Math.round((we.y + te) * 2) / 2)
1814
+ x: Math.max(0, Math.round((ve.x + Q) * 2) / 2),
1815
+ y: Math.max(0, Math.round((ve.y + te) * 2) / 2)
1816
1816
  }
1817
1817
  };
1818
1818
  })
1819
1819
  };
1820
1820
  }), ae = { ...c, sections: ie };
1821
- l == null || l(ae), N({ type: "UPDATE", payload: ae });
1821
+ r == null || r(ae), w({ type: "UPDATE", payload: ae });
1822
1822
  }, J = () => {
1823
- document.removeEventListener("mousemove", H), document.removeEventListener("mouseup", J);
1823
+ document.removeEventListener("mousemove", G), document.removeEventListener("mouseup", J);
1824
1824
  };
1825
- document.addEventListener("mousemove", H), document.addEventListener("mouseup", J);
1825
+ document.addEventListener("mousemove", G), document.addEventListener("mouseup", J);
1826
1826
  },
1827
- [c, f, r, h, l]
1828
- ), ze = $(
1829
- (o, d, C) => {
1830
- if (h)
1827
+ [c, f, l, _, r]
1828
+ ), je = T(
1829
+ (o, d, x) => {
1830
+ if (_)
1831
1831
  return;
1832
- C.preventDefault();
1832
+ x.preventDefault();
1833
1833
  const B = X.find((te) => te.id === o);
1834
1834
  if (!B)
1835
1835
  return;
1836
- const A = { ...B.position }, H = C.clientX, J = C.clientY, O = (te) => {
1837
- const le = (te.clientX - H) / (f * F), ie = (te.clientY - J) / (f * F);
1838
- let { x: ae, y: ee, width: K, height: U } = A;
1839
- d.includes("e") && (K = Math.max(5, K + le)), d.includes("s") && (U = Math.max(3, U + ie)), d.includes("w") && (ae = ae + le, K = Math.max(5, K - le)), d.includes("n") && (ee = ee + ie, U = Math.max(3, U - ie)), ue(o, {
1836
+ const R = { ...B.position }, G = x.clientX, J = x.clientY, O = (te) => {
1837
+ const re = (te.clientX - G) / (f * F), ie = (te.clientY - J) / (f * F);
1838
+ let { x: ae, y: ee, width: K, height: U } = R;
1839
+ d.includes("e") && (K = Math.max(5, K + re)), d.includes("s") && (U = Math.max(3, U + ie)), d.includes("w") && (ae = ae + re, K = Math.max(5, K - re)), d.includes("n") && (ee = ee + ie, U = Math.max(3, U - ie)), ue(o, {
1840
1840
  position: {
1841
- ...A,
1841
+ ...R,
1842
1842
  x: Math.round(ae * 2) / 2,
1843
1843
  y: Math.round(ee * 2) / 2,
1844
1844
  width: Math.round(K * 2) / 2,
@@ -1850,90 +1850,90 @@ const el = ({
1850
1850
  };
1851
1851
  document.addEventListener("mousemove", O), document.addEventListener("mouseup", Q);
1852
1852
  },
1853
- [X, f, h, ue]
1854
- ), he = $(() => {
1855
- R({
1853
+ [X, f, _, ue]
1854
+ ), _e = T(() => {
1855
+ $({
1856
1856
  sections: c.sections.map((o) => ({
1857
1857
  ...o,
1858
- fields: o.fields.filter((d) => !r.has(d.id))
1858
+ fields: o.fields.filter((d) => !l.has(d.id))
1859
1859
  }))
1860
1860
  }), n(/* @__PURE__ */ new Set());
1861
- }, [c, r, R]), _e = $(() => {
1861
+ }, [c, l, $]), he = T(() => {
1862
1862
  const o = /* @__PURE__ */ new Set();
1863
- R({
1863
+ $({
1864
1864
  sections: c.sections.map((d) => {
1865
- const C = d.fields.filter((B) => r.has(B.id)).map((B) => {
1866
- const A = {
1865
+ const x = d.fields.filter((B) => l.has(B.id)).map((B) => {
1866
+ const R = {
1867
1867
  ...B,
1868
1868
  id: se(),
1869
1869
  position: { ...B.position, x: B.position.x + 5, y: B.position.y + 5 }
1870
1870
  };
1871
- return o.add(A.id), A;
1871
+ return o.add(R.id), R;
1872
1872
  });
1873
- return { ...d, fields: [...d.fields, ...C] };
1873
+ return { ...d, fields: [...d.fields, ...x] };
1874
1874
  })
1875
1875
  }), n(o);
1876
- }, [c, r, R]), De = $(
1876
+ }, [c, l, $]), ze = T(
1877
1877
  (o) => {
1878
- R({
1878
+ $({
1879
1879
  sections: c.sections.map((d) => ({
1880
1880
  ...d,
1881
- fields: d.fields.map((C) => {
1882
- if (!r.has(C.id))
1883
- return C;
1884
- const B = o === "left" ? c.margins.left : o === "right" ? Z - c.margins.right - C.position.width : (Z - C.position.width) / 2;
1885
- return { ...C, position: { ...C.position, x: B } };
1881
+ fields: d.fields.map((x) => {
1882
+ if (!l.has(x.id))
1883
+ return x;
1884
+ const B = o === "left" ? c.margins.left : o === "right" ? Z - c.margins.right - x.position.width : (Z - x.position.width) / 2;
1885
+ return { ...x, position: { ...x.position, x: B } };
1886
1886
  })
1887
1887
  }))
1888
1888
  });
1889
1889
  },
1890
- [c, r, Z, R]
1891
- ), Te = $(
1890
+ [c, l, Z, $]
1891
+ ), De = T(
1892
1892
  (o) => {
1893
1893
  const d = c.sections.find((B) => B.id === u);
1894
1894
  if (!d)
1895
1895
  return;
1896
- const C = d.heightMm ?? 200;
1897
- R({
1896
+ const x = d.heightMm ?? 200;
1897
+ $({
1898
1898
  sections: c.sections.map((B) => B.id !== u ? B : {
1899
1899
  ...B,
1900
- fields: B.fields.map((A) => {
1901
- if (!r.has(A.id))
1902
- return A;
1903
- const H = o === "top" ? 0 : o === "bottom" ? C - A.position.height : (C - A.position.height) / 2;
1904
- return { ...A, position: { ...A.position, y: H } };
1900
+ fields: B.fields.map((R) => {
1901
+ if (!l.has(R.id))
1902
+ return R;
1903
+ const G = o === "top" ? 0 : o === "bottom" ? x - R.position.height : (x - R.position.height) / 2;
1904
+ return { ...R, position: { ...R.position, y: G } };
1905
1905
  })
1906
1906
  })
1907
1907
  });
1908
1908
  },
1909
- [c, r, u, R]
1910
- ), $e = $(() => {
1911
- R({
1909
+ [c, l, u, $]
1910
+ ), Te = T(() => {
1911
+ $({
1912
1912
  sections: c.sections.map((o) => ({
1913
1913
  ...o,
1914
1914
  fields: o.fields.map(
1915
- (d) => r.has(d.id) ? { ...d, position: { ...d.position, zIndex: (d.position.zIndex ?? 1) + 1 } } : d
1915
+ (d) => l.has(d.id) ? { ...d, position: { ...d.position, zIndex: (d.position.zIndex ?? 1) + 1 } } : d
1916
1916
  )
1917
1917
  }))
1918
1918
  });
1919
- }, [c, r, R]), Re = $(() => {
1920
- R({
1919
+ }, [c, l, $]), $e = T(() => {
1920
+ $({
1921
1921
  sections: c.sections.map((o) => ({
1922
1922
  ...o,
1923
1923
  fields: o.fields.map(
1924
- (d) => r.has(d.id) ? {
1924
+ (d) => l.has(d.id) ? {
1925
1925
  ...d,
1926
1926
  position: { ...d.position, zIndex: Math.max(1, (d.position.zIndex ?? 1) - 1) }
1927
1927
  } : d
1928
1928
  )
1929
1929
  }))
1930
1930
  });
1931
- }, [c, r, R]), Ae = $(
1931
+ }, [c, l, $]), Re = T(
1932
1932
  (o, d) => {
1933
- R({
1934
- sections: c.sections.map((C) => ({
1935
- ...C,
1936
- fields: C.fields.map(
1933
+ $({
1934
+ sections: c.sections.map((x) => ({
1935
+ ...x,
1936
+ fields: x.fields.map(
1937
1937
  (B) => B.id === o ? {
1938
1938
  ...B,
1939
1939
  position: {
@@ -1945,94 +1945,94 @@ const el = ({
1945
1945
  }))
1946
1946
  });
1947
1947
  },
1948
- [c, R]
1948
+ [c, $]
1949
1949
  );
1950
- ye(() => {
1950
+ ge(() => {
1951
1951
  const o = (d) => {
1952
- const C = d.target.tagName;
1953
- if (C === "INPUT" || C === "TEXTAREA" || C === "SELECT")
1952
+ const x = d.target.tagName;
1953
+ if (x === "INPUT" || x === "TEXTAREA" || x === "SELECT")
1954
1954
  return;
1955
1955
  const B = d.shiftKey ? 5 : 0.5;
1956
- d.key === "Delete" || d.key === "Backspace" ? r.size && (d.preventDefault(), he()) : d.ctrlKey && d.key === "z" ? (d.preventDefault(), N({ type: "UNDO" })) : d.ctrlKey && (d.key === "y" || d.key === "Y") ? (d.preventDefault(), N({ type: "REDO" })) : d.ctrlKey && (d.key === "d" || d.key === "D") ? (d.preventDefault(), r.size && _e()) : d.ctrlKey && d.key === "a" ? (d.preventDefault(), n(new Set(X.map((A) => A.id)))) : d.key === "ArrowLeft" ? (d.preventDefault(), re({
1957
- position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) - B }
1958
- })) : d.key === "ArrowRight" ? (d.preventDefault(), re({
1959
- position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) + B }
1960
- })) : d.key === "ArrowUp" ? (d.preventDefault(), re({
1961
- position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) - B }
1962
- })) : d.key === "ArrowDown" && (d.preventDefault(), re({
1963
- position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) + B }
1956
+ d.key === "Delete" || d.key === "Backspace" ? l.size && (d.preventDefault(), _e()) : d.ctrlKey && d.key === "z" ? (d.preventDefault(), w({ type: "UNDO" })) : d.ctrlKey && (d.key === "y" || d.key === "Y") ? (d.preventDefault(), w({ type: "REDO" })) : d.ctrlKey && (d.key === "d" || d.key === "D") ? (d.preventDefault(), l.size && he()) : d.ctrlKey && d.key === "a" ? (d.preventDefault(), n(new Set(X.map((R) => R.id)))) : d.key === "ArrowLeft" ? (d.preventDefault(), le({
1957
+ position: { ...E.position, x: ((E == null ? void 0 : E.position.x) ?? 0) - B }
1958
+ })) : d.key === "ArrowRight" ? (d.preventDefault(), le({
1959
+ position: { ...E.position, x: ((E == null ? void 0 : E.position.x) ?? 0) + B }
1960
+ })) : d.key === "ArrowUp" ? (d.preventDefault(), le({
1961
+ position: { ...E.position, y: ((E == null ? void 0 : E.position.y) ?? 0) - B }
1962
+ })) : d.key === "ArrowDown" && (d.preventDefault(), le({
1963
+ position: { ...E.position, y: ((E == null ? void 0 : E.position.y) ?? 0) + B }
1964
1964
  }));
1965
1965
  };
1966
1966
  return window.addEventListener("keydown", o), () => window.removeEventListener("keydown", o);
1967
- }, [r, X, G, he, _e, re]);
1968
- const Pe = $(
1967
+ }, [l, X, E, _e, he, le]);
1968
+ const Ae = T(
1969
1969
  (o, d) => {
1970
- R({
1970
+ $({
1971
1971
  sections: c.sections.map(
1972
- (C) => C.id === o ? { ...C, heightMm: Math.round(d * 2) / 2 } : C
1972
+ (x) => x.id === o ? { ...x, heightMm: Math.round(d * 2) / 2 } : x
1973
1973
  )
1974
1974
  });
1975
1975
  },
1976
- [c, R]
1977
- ), Me = oe(() => {
1978
- const o = Array.isArray(p) ? p[y] : p;
1976
+ [c, $]
1977
+ ), Pe = oe(() => {
1978
+ const o = Array.isArray(p) ? p[g] : p;
1979
1979
  return o ? "data" in o ? o.data : o : {};
1980
- }, [p, y]), Ee = Z * f * F, Ge = me * f * F;
1980
+ }, [p, g]), Me = Z * f * F, Ee = me * f * F;
1981
1981
  return /* @__PURE__ */ e(
1982
1982
  Oe,
1983
1983
  {
1984
1984
  flush: !0,
1985
- className: `${t.root} ${g === "dark" ? t.dark : ""} ${S ?? ""}`,
1985
+ className: `${t.root} ${y === "dark" ? t.dark : ""} ${S ?? ""}`,
1986
1986
  style: b,
1987
1987
  toolbar: /* @__PURE__ */ e(
1988
- An,
1988
+ Rn,
1989
1989
  {
1990
1990
  tpl: c,
1991
1991
  zoom: f,
1992
- canUndo: v.length > 0,
1993
- canRedo: T.length > 0,
1994
- showGrid: _,
1992
+ canUndo: N.length > 0,
1993
+ canRedo: D.length > 0,
1994
+ showGrid: h,
1995
1995
  showRulers: pe,
1996
- readOnly: h,
1997
- selectedCount: r.size,
1998
- onPaperChange: (o, d) => R({ paperSize: o, orientation: d }),
1999
- onZoom: D,
2000
- onUndo: () => N({ type: "UNDO" }),
2001
- onRedo: () => N({ type: "REDO" }),
1996
+ readOnly: _,
1997
+ selectedCount: l.size,
1998
+ onPaperChange: (o, d) => $({ paperSize: o, orientation: d }),
1999
+ onZoom: z,
2000
+ onUndo: () => w({ type: "UNDO" }),
2001
+ onRedo: () => w({ type: "REDO" }),
2002
2002
  onToggleGrid: () => q((o) => !o),
2003
- onToggleRulers: () => Ce((o) => !o),
2003
+ onToggleRulers: () => xe((o) => !o),
2004
2004
  onInsert: be,
2005
- onDelete: he,
2006
- onDuplicate: _e,
2007
- onAlignH: De,
2008
- onAlignV: Te,
2009
- onBringForward: $e,
2010
- onSendBackward: Re,
2005
+ onDelete: _e,
2006
+ onDuplicate: he,
2007
+ onAlignH: ze,
2008
+ onAlignV: De,
2009
+ onBringForward: Te,
2010
+ onSendBackward: $e,
2011
2011
  onSave: k ? () => k(c) : void 0
2012
2012
  }
2013
2013
  ),
2014
2014
  sidebar: /* @__PURE__ */ e(
2015
- Pn,
2015
+ An,
2016
2016
  {
2017
- activeTab: I,
2018
- onTabChange: E,
2017
+ activeTab: C,
2018
+ onTabChange: M,
2019
2019
  schema: i,
2020
2020
  tpl: c,
2021
2021
  allFields: X,
2022
- selectedIds: r,
2022
+ selectedIds: l,
2023
2023
  onInsertSchemaField: (o) => be(o.type, o),
2024
2024
  onSelectField: (o) => n(/* @__PURE__ */ new Set([o])),
2025
- onUpdateTpl: (o) => R(o),
2026
- onReorderField: Ae
2025
+ onUpdateTpl: (o) => $(o),
2026
+ onReorderField: Re
2027
2027
  }
2028
2028
  ),
2029
2029
  rightSidebar: /* @__PURE__ */ e(
2030
- Mn,
2030
+ Pn,
2031
2031
  {
2032
- field: G,
2033
- activeTab: W,
2034
- onTabChange: P,
2035
- onChange: (o) => G && ue(G.id, o),
2032
+ field: E,
2033
+ activeTab: H,
2034
+ onTabChange: A,
2035
+ onChange: (o) => E && ue(E.id, o),
2036
2036
  paperWidthMm: Z,
2037
2037
  paperHeightMm: me
2038
2038
  }
@@ -2044,8 +2044,8 @@ const el = ({
2044
2044
  "select",
2045
2045
  {
2046
2046
  className: t.testDataSelect,
2047
- value: y,
2048
- onChange: (o) => x(+o.target.value),
2047
+ value: g,
2048
+ onChange: (o) => L(+o.target.value),
2049
2049
  children: p.map((o, d) => /* @__PURE__ */ s("option", { value: d, children: [
2050
2050
  "Rekord ",
2051
2051
  d + 1
@@ -2058,7 +2058,7 @@ const el = ({
2058
2058
  /* @__PURE__ */ e(Se, { lengthMm: Z, zoom: f, orientation: "h" }),
2059
2059
  /* @__PURE__ */ e(Se, { lengthMm: me, zoom: f, orientation: "v" })
2060
2060
  ] }),
2061
- /* @__PURE__ */ e("div", { className: t.paperScroll, onClick: (o) => o.stopPropagation(), children: /* @__PURE__ */ s("div", { className: t.paperShadow, style: { width: Ee, minHeight: Ge }, children: [
2061
+ /* @__PURE__ */ e("div", { className: t.paperScroll, onClick: (o) => o.stopPropagation(), children: /* @__PURE__ */ s("div", { className: t.paperShadow, style: { width: Me, minHeight: Ee }, children: [
2062
2062
  /* @__PURE__ */ e(
2063
2063
  "div",
2064
2064
  {
@@ -2086,31 +2086,31 @@ const el = ({
2086
2086
  o.id
2087
2087
  )),
2088
2088
  c.sections.map((o) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
2089
- Tn,
2089
+ Dn,
2090
2090
  {
2091
2091
  section: o,
2092
2092
  zoom: f,
2093
2093
  paperWidthMm: Z,
2094
- selectedIds: r,
2095
- sampleData: Me,
2096
- readOnly: h,
2097
- showGrid: _,
2098
- onFieldClick: Le,
2099
- onFieldDragStart: xe,
2100
- onResizeStart: ze,
2101
- onSectionHeightChange: Pe,
2102
- onDropField: Ie
2094
+ selectedIds: l,
2095
+ sampleData: Pe,
2096
+ readOnly: _,
2097
+ showGrid: h,
2098
+ onFieldClick: Ie,
2099
+ onFieldDragStart: Le,
2100
+ onResizeStart: je,
2101
+ onSectionHeightChange: Ae,
2102
+ onDropField: Ce
2103
2103
  }
2104
2104
  ) }, o.id))
2105
2105
  ] }) })
2106
2106
  ] })
2107
2107
  }
2108
2108
  );
2109
- }, Gn = "_root_6hwvk_1", Hn = "_dark_6hwvk_25", Wn = "_topBar_6hwvk_31", jn = "_searchInput_6hwvk_55", Fn = "_actionBtn_6hwvk_83", On = "_categoryRow_6hwvk_117", Un = "_catChip_6hwvk_141", Yn = "_catChipActive_6hwvk_167", qn = "_grid_6hwvk_181", Kn = "_card_6hwvk_203", Vn = "_cardSelected_6hwvk_235", Zn = "_thumbnail_6hwvk_251", Xn = "_thumbnailImg_6hwvk_265", Jn = "_thumbnailPlaceholder_6hwvk_277", Qn = "_paperMini_6hwvk_291", es = "_paperLine_6hwvk_315", ts = "_cardOverlay_6hwvk_329", as = "_overlayBtn_6hwvk_349", ns = "_overlayBtnDanger_6hwvk_381", ss = "_cardBody_6hwvk_411", rs = "_cardName_6hwvk_415", ls = "_cardDesc_6hwvk_439", is = "_cardMeta_6hwvk_461", os = "_cardSize_6hwvk_475", cs = "_cardCat_6hwvk_491", ds = "_cardTags_6hwvk_507", ps = "_cardTag_6hwvk_507", ms = "_emptyState_6hwvk_531", us = "_emptyIcon_6hwvk_553", L = {
2110
- root: Gn,
2111
- dark: Hn,
2112
- topBar: Wn,
2113
- searchInput: jn,
2109
+ }, En = "_root_85lw2_1", Gn = "_dark_85lw2_25", Hn = "_topBar_85lw2_39", Wn = "_searchInput_85lw2_69", Fn = "_actionBtn_85lw2_111", On = "_categoryRow_85lw2_157", Un = "_catChip_85lw2_187", Yn = "_catChipActive_85lw2_217", qn = "_grid_85lw2_231", Kn = "_card_85lw2_253", Vn = "_cardSelected_85lw2_285", Zn = "_thumbnail_85lw2_307", Xn = "_thumbnailImg_85lw2_321", Jn = "_thumbnailPlaceholder_85lw2_333", Qn = "_paperMini_85lw2_347", es = "_paperLine_85lw2_371", ts = "_cardOverlay_85lw2_385", as = "_overlayBtn_85lw2_405", ns = "_overlayBtnDanger_85lw2_441", ss = "_cardBody_85lw2_481", ls = "_cardName_85lw2_489", rs = "_cardDesc_85lw2_517", is = "_cardMeta_85lw2_539", os = "_cardSize_85lw2_553", cs = "_cardCat_85lw2_569", ds = "_cardTags_85lw2_585", ps = "_cardTag_85lw2_585", ms = "_emptyState_85lw2_617", us = "_emptyIcon_85lw2_639", I = {
2110
+ root: En,
2111
+ dark: Gn,
2112
+ topBar: Hn,
2113
+ searchInput: Wn,
2114
2114
  actionBtn: Fn,
2115
2115
  categoryRow: On,
2116
2116
  catChip: Un,
@@ -2127,8 +2127,8 @@ const el = ({
2127
2127
  overlayBtn: as,
2128
2128
  overlayBtnDanger: ns,
2129
2129
  cardBody: ss,
2130
- cardName: rs,
2131
- cardDesc: ls,
2130
+ cardName: ls,
2131
+ cardDesc: rs,
2132
2132
  cardMeta: is,
2133
2133
  cardSize: os,
2134
2134
  cardCat: cs,
@@ -2136,76 +2136,76 @@ const el = ({
2136
2136
  cardTag: ps,
2137
2137
  emptyState: ms,
2138
2138
  emptyIcon: us
2139
- }, hs = ["Faktury", "Raporty", "Etykiety", "Listy", "Umowy", "Inne"];
2140
- function _s(a) {
2139
+ }, _s = ["Faktury", "Raporty", "Etykiety", "Listy", "Umowy", "Inne"];
2140
+ function hs(a) {
2141
2141
  return new Promise((i, p) => {
2142
- const l = new FileReader();
2143
- l.onload = (k) => {
2144
- var h;
2142
+ const r = new FileReader();
2143
+ r.onload = (k) => {
2144
+ var _;
2145
2145
  try {
2146
- i(JSON.parse((h = k.target) == null ? void 0 : h.result));
2146
+ i(JSON.parse((_ = k.target) == null ? void 0 : _.result));
2147
2147
  } catch (S) {
2148
2148
  p(S);
2149
2149
  }
2150
- }, l.readAsText(a);
2150
+ }, r.readAsText(a);
2151
2151
  });
2152
2152
  }
2153
- function gs(a) {
2154
- const i = new Blob([JSON.stringify(a, null, 2)], { type: "application/json" }), p = URL.createObjectURL(i), l = document.createElement("a");
2155
- l.href = p, l.download = `${a.name.replace(/\s+/g, "_")}.json`, l.click(), URL.revokeObjectURL(p);
2153
+ function ys(a) {
2154
+ const i = new Blob([JSON.stringify(a, null, 2)], { type: "application/json" }), p = URL.createObjectURL(i), r = document.createElement("a");
2155
+ r.href = p, r.download = `${a.name.replace(/\s+/g, "_")}.json`, r.click(), URL.revokeObjectURL(p);
2156
2156
  }
2157
- const tl = ({
2157
+ const tr = ({
2158
2158
  templates: a,
2159
2159
  selectedId: i,
2160
2160
  onSelect: p,
2161
- onImport: l,
2161
+ onImport: r,
2162
2162
  onExport: k,
2163
- onDelete: h,
2163
+ onDelete: _,
2164
2164
  onNew: S,
2165
2165
  className: b,
2166
- style: g,
2167
- theme: v = "light"
2166
+ style: y,
2167
+ theme: N = "light"
2168
2168
  }) => {
2169
- const [c, T] = M(""), [N, r] = M(null), [n, u] = M(null), m = We.useRef(null), f = async (y) => {
2170
- var I;
2171
- const x = (I = y.target.files) == null ? void 0 : I[0];
2172
- if (x) {
2169
+ const [c, D] = P(""), [w, l] = P(null), [n, u] = P(null), m = He.useRef(null), f = async (g) => {
2170
+ var C;
2171
+ const L = (C = g.target.files) == null ? void 0 : C[0];
2172
+ if (L) {
2173
2173
  try {
2174
- const E = await _s(x);
2175
- l == null || l(E);
2174
+ const M = await hs(L);
2175
+ r == null || r(M);
2176
2176
  } catch {
2177
2177
  }
2178
- y.target.value = "";
2178
+ g.target.value = "";
2179
2179
  }
2180
- }, D = a.filter((y) => {
2181
- const x = !c || y.name.toLowerCase().includes(c.toLowerCase()) || (y.description ?? "").toLowerCase().includes(c.toLowerCase()) || (y.tags ?? []).some((E) => E.toLowerCase().includes(c.toLowerCase())), I = !N || y.category === N;
2182
- return x && I;
2180
+ }, z = a.filter((g) => {
2181
+ const L = !c || g.name.toLowerCase().includes(c.toLowerCase()) || (g.description ?? "").toLowerCase().includes(c.toLowerCase()) || (g.tags ?? []).some((M) => M.toLowerCase().includes(c.toLowerCase())), C = !w || g.category === w;
2182
+ return L && C;
2183
2183
  });
2184
2184
  return /* @__PURE__ */ s(
2185
2185
  "div",
2186
2186
  {
2187
- className: `${L.root} ${v === "dark" ? L.dark : ""} ${b ?? ""}`,
2188
- style: g,
2187
+ className: `${I.root} ${N === "dark" ? I.dark : ""} ${b ?? ""}`,
2188
+ style: y,
2189
2189
  children: [
2190
- /* @__PURE__ */ s("div", { className: L.topBar, children: [
2190
+ /* @__PURE__ */ s("div", { className: I.topBar, children: [
2191
2191
  /* @__PURE__ */ e(
2192
2192
  "input",
2193
2193
  {
2194
2194
  type: "search",
2195
- className: L.searchInput,
2195
+ className: I.searchInput,
2196
2196
  placeholder: "Szukaj szablonów…",
2197
2197
  value: c,
2198
- onChange: (y) => T(y.target.value)
2198
+ onChange: (g) => D(g.target.value)
2199
2199
  }
2200
2200
  ),
2201
- /* @__PURE__ */ e("button", { className: L.actionBtn, onClick: S, title: "Nowy szablon", children: "+ Nowy" }),
2201
+ /* @__PURE__ */ e("button", { className: I.actionBtn, onClick: S, title: "Nowy szablon", children: "+ Nowy" }),
2202
2202
  /* @__PURE__ */ e(
2203
2203
  "button",
2204
2204
  {
2205
- className: L.actionBtn,
2205
+ className: I.actionBtn,
2206
2206
  onClick: () => {
2207
- var y;
2208
- return (y = m.current) == null ? void 0 : y.click();
2207
+ var g;
2208
+ return (g = m.current) == null ? void 0 : g.click();
2209
2209
  },
2210
2210
  title: "Importuj JSON",
2211
2211
  children: "⬆ Import"
@@ -2213,83 +2213,83 @@ const tl = ({
2213
2213
  ),
2214
2214
  /* @__PURE__ */ e("input", { ref: m, type: "file", accept: ".json", hidden: !0, onChange: f })
2215
2215
  ] }),
2216
- /* @__PURE__ */ s("div", { className: L.categoryRow, children: [
2216
+ /* @__PURE__ */ s("div", { className: I.categoryRow, children: [
2217
2217
  /* @__PURE__ */ e(
2218
2218
  "button",
2219
2219
  {
2220
- className: `${L.catChip} ${N ? "" : L.catChipActive}`,
2221
- onClick: () => r(null),
2220
+ className: `${I.catChip} ${w ? "" : I.catChipActive}`,
2221
+ onClick: () => l(null),
2222
2222
  children: "Wszystkie"
2223
2223
  }
2224
2224
  ),
2225
- hs.map((y) => /* @__PURE__ */ e(
2225
+ _s.map((g) => /* @__PURE__ */ e(
2226
2226
  "button",
2227
2227
  {
2228
- className: `${L.catChip} ${N === y ? L.catChipActive : ""}`,
2229
- onClick: () => r((x) => x === y ? null : y),
2230
- children: y
2228
+ className: `${I.catChip} ${w === g ? I.catChipActive : ""}`,
2229
+ onClick: () => l((L) => L === g ? null : g),
2230
+ children: g
2231
2231
  },
2232
- y
2232
+ g
2233
2233
  ))
2234
2234
  ] }),
2235
- /* @__PURE__ */ s("div", { className: L.grid, children: [
2236
- D.map((y) => /* @__PURE__ */ s(
2235
+ /* @__PURE__ */ s("div", { className: I.grid, children: [
2236
+ z.map((g) => /* @__PURE__ */ s(
2237
2237
  "div",
2238
2238
  {
2239
- className: `${L.card} ${i === y.id ? L.cardSelected : ""}`,
2240
- onClick: () => p == null ? void 0 : p(y),
2241
- onMouseEnter: () => u(y.id),
2239
+ className: `${I.card} ${i === g.id ? I.cardSelected : ""}`,
2240
+ onClick: () => p == null ? void 0 : p(g),
2241
+ onMouseEnter: () => u(g.id),
2242
2242
  onMouseLeave: () => u(null),
2243
2243
  children: [
2244
- /* @__PURE__ */ s("div", { className: L.thumbnail, children: [
2245
- y.previewImageUrl ? /* @__PURE__ */ e("img", { src: y.previewImageUrl, alt: y.name, className: L.thumbnailImg }) : /* @__PURE__ */ e("div", { className: L.thumbnailPlaceholder, children: /* @__PURE__ */ s("div", { className: L.paperMini, children: [
2244
+ /* @__PURE__ */ s("div", { className: I.thumbnail, children: [
2245
+ g.previewImageUrl ? /* @__PURE__ */ e("img", { src: g.previewImageUrl, alt: g.name, className: I.thumbnailImg }) : /* @__PURE__ */ e("div", { className: I.thumbnailPlaceholder, children: /* @__PURE__ */ s("div", { className: I.paperMini, children: [
2246
2246
  /* @__PURE__ */ e(
2247
2247
  "div",
2248
2248
  {
2249
- className: L.paperLine,
2249
+ className: I.paperLine,
2250
2250
  style: { width: "80%" }
2251
2251
  }
2252
2252
  ),
2253
2253
  /* @__PURE__ */ e(
2254
2254
  "div",
2255
2255
  {
2256
- className: L.paperLine,
2256
+ className: I.paperLine,
2257
2257
  style: { width: "60%" }
2258
2258
  }
2259
2259
  ),
2260
2260
  /* @__PURE__ */ e(
2261
2261
  "div",
2262
2262
  {
2263
- className: L.paperLine,
2263
+ className: I.paperLine,
2264
2264
  style: { width: "90%" }
2265
2265
  }
2266
2266
  ),
2267
2267
  /* @__PURE__ */ e(
2268
2268
  "div",
2269
2269
  {
2270
- className: L.paperLine,
2270
+ className: I.paperLine,
2271
2271
  style: { width: "50%" }
2272
2272
  }
2273
2273
  )
2274
2274
  ] }) }),
2275
- n === y.id && /* @__PURE__ */ s("div", { className: L.cardOverlay, children: [
2275
+ n === g.id && /* @__PURE__ */ s("div", { className: I.cardOverlay, children: [
2276
2276
  /* @__PURE__ */ e(
2277
2277
  "button",
2278
2278
  {
2279
- className: L.overlayBtn,
2280
- onClick: (x) => {
2281
- x.stopPropagation(), k == null || k(y), gs(y);
2279
+ className: I.overlayBtn,
2280
+ onClick: (L) => {
2281
+ L.stopPropagation(), k == null || k(g), ys(g);
2282
2282
  },
2283
2283
  title: "Eksportuj",
2284
2284
  children: "⬇"
2285
2285
  }
2286
2286
  ),
2287
- h && /* @__PURE__ */ e(
2287
+ _ && /* @__PURE__ */ e(
2288
2288
  "button",
2289
2289
  {
2290
- className: L.overlayBtnDanger,
2291
- onClick: (x) => {
2292
- x.stopPropagation(), h(y.id);
2290
+ className: I.overlayBtnDanger,
2291
+ onClick: (L) => {
2292
+ L.stopPropagation(), _(g.id);
2293
2293
  },
2294
2294
  title: "Usuń",
2295
2295
  children: "✕"
@@ -2297,47 +2297,47 @@ const tl = ({
2297
2297
  )
2298
2298
  ] })
2299
2299
  ] }),
2300
- /* @__PURE__ */ s("div", { className: L.cardBody, children: [
2301
- /* @__PURE__ */ e("div", { className: L.cardName, children: y.name }),
2302
- y.description && /* @__PURE__ */ e("div", { className: L.cardDesc, children: y.description }),
2303
- /* @__PURE__ */ s("div", { className: L.cardMeta, children: [
2304
- /* @__PURE__ */ s("span", { className: L.cardSize, children: [
2305
- y.paperSize,
2300
+ /* @__PURE__ */ s("div", { className: I.cardBody, children: [
2301
+ /* @__PURE__ */ e("div", { className: I.cardName, children: g.name }),
2302
+ g.description && /* @__PURE__ */ e("div", { className: I.cardDesc, children: g.description }),
2303
+ /* @__PURE__ */ s("div", { className: I.cardMeta, children: [
2304
+ /* @__PURE__ */ s("span", { className: I.cardSize, children: [
2305
+ g.paperSize,
2306
2306
  " ",
2307
- y.orientation === "landscape" ? "↔" : "↕"
2307
+ g.orientation === "landscape" ? "↔" : "↕"
2308
2308
  ] }),
2309
- y.category && /* @__PURE__ */ e("span", { className: L.cardCat, children: y.category })
2309
+ g.category && /* @__PURE__ */ e("span", { className: I.cardCat, children: g.category })
2310
2310
  ] }),
2311
- y.tags && y.tags.length > 0 && /* @__PURE__ */ e("div", { className: L.cardTags, children: y.tags.slice(0, 3).map((x) => /* @__PURE__ */ e("span", { className: L.cardTag, children: x }, x)) })
2311
+ g.tags && g.tags.length > 0 && /* @__PURE__ */ e("div", { className: I.cardTags, children: g.tags.slice(0, 3).map((L) => /* @__PURE__ */ e("span", { className: I.cardTag, children: L }, L)) })
2312
2312
  ] })
2313
2313
  ]
2314
2314
  },
2315
- y.id
2315
+ g.id
2316
2316
  )),
2317
- D.length === 0 && /* @__PURE__ */ s("div", { className: L.emptyState, children: [
2318
- /* @__PURE__ */ e("span", { className: L.emptyIcon, children: "📄" }),
2317
+ z.length === 0 && /* @__PURE__ */ s("div", { className: I.emptyState, children: [
2318
+ /* @__PURE__ */ e("span", { className: I.emptyIcon, children: "📄" }),
2319
2319
  /* @__PURE__ */ e("span", { children: c ? `Brak wyników dla "${c}"` : "Brak szablonów. Utwórz pierwszy!" })
2320
2320
  ] })
2321
2321
  ] })
2322
2322
  ]
2323
2323
  }
2324
2324
  );
2325
- }, ys = "_root_1grye_1", bs = "_dark_1grye_19", ws = "_headerBar_1grye_25", vs = "_entityNav_1grye_47", Ns = "_navBtn_1grye_49", fs = "_navLabel_1grye_73", ks = "_sampleBadge_1grye_77", Ss = "_zoomBar_1grye_95", Bs = "_zoomBtn_1grye_97", Cs = "_zoomLabel_1grye_119", Is = "_printBtn_1grye_123", Ls = "_canvas_1grye_149", xs = "_page_1grye_169", zs = "_watermark_1grye_191", Ds = "_footerBar_1grye_221", j = {
2326
- root: ys,
2325
+ }, gs = "_root_10i1f_1", bs = "_dark_10i1f_19", vs = "_headerBar_10i1f_31", Ns = "_entityNav_10i1f_59", ws = "_navBtn_10i1f_69", fs = "_navLabel_10i1f_103", ks = "_sampleBadge_10i1f_117", Ss = "_zoomBar_10i1f_135", Bs = "_zoomBtn_10i1f_147", xs = "_zoomLabel_10i1f_179", Cs = "_printBtn_10i1f_193", Is = "_canvas_10i1f_223", Ls = "_page_10i1f_243", js = "_watermark_10i1f_269", zs = "_footerBar_10i1f_299", W = {
2326
+ root: gs,
2327
2327
  dark: bs,
2328
- headerBar: ws,
2329
- entityNav: vs,
2330
- navBtn: Ns,
2328
+ headerBar: vs,
2329
+ entityNav: Ns,
2330
+ navBtn: ws,
2331
2331
  navLabel: fs,
2332
2332
  sampleBadge: ks,
2333
2333
  zoomBar: Ss,
2334
2334
  zoomBtn: Bs,
2335
- zoomLabel: Cs,
2336
- printBtn: Is,
2337
- canvas: Ls,
2338
- page: xs,
2339
- watermark: zs,
2340
- footerBar: Ds
2335
+ zoomLabel: xs,
2336
+ printBtn: Cs,
2337
+ canvas: Is,
2338
+ page: Ls,
2339
+ watermark: js,
2340
+ footerBar: zs
2341
2341
  }, V = 3.78, Be = {
2342
2342
  A3: [297, 420],
2343
2343
  A4: [210, 297],
@@ -2347,45 +2347,45 @@ const tl = ({
2347
2347
  Legal: [216, 356],
2348
2348
  Tabloid: [279, 432]
2349
2349
  };
2350
- function Ts(a, i) {
2350
+ function Ds(a, i) {
2351
2351
  try {
2352
- return a.split(".").reduce((p, l) => p && typeof p == "object" ? p[l] : null, i);
2352
+ return a.split(".").reduce((p, r) => p && typeof p == "object" ? p[r] : null, i);
2353
2353
  } catch {
2354
2354
  return null;
2355
2355
  }
2356
2356
  }
2357
- function $s(a, i, p) {
2357
+ function Ts(a, i, p) {
2358
2358
  if (a == null)
2359
2359
  return "";
2360
2360
  if (i === "date" && p)
2361
2361
  try {
2362
- const l = new Date(a);
2362
+ const r = new Date(a);
2363
2363
  if (p === "DD.MM.YYYY") {
2364
- const k = String(l.getDate()).padStart(2, "0"), h = String(l.getMonth() + 1).padStart(2, "0");
2365
- return `${k}.${h}.${l.getFullYear()}`;
2364
+ const k = String(r.getDate()).padStart(2, "0"), _ = String(r.getMonth() + 1).padStart(2, "0");
2365
+ return `${k}.${_}.${r.getFullYear()}`;
2366
2366
  }
2367
- return l.toLocaleDateString();
2367
+ return r.toLocaleDateString();
2368
2368
  } catch {
2369
2369
  return String(a);
2370
2370
  }
2371
2371
  if (i === "currency" && p) {
2372
- const l = Number(a);
2373
- if (!isNaN(l))
2374
- return `${l.toFixed(2)} ${p}`;
2372
+ const r = Number(a);
2373
+ if (!isNaN(r))
2374
+ return `${r.toFixed(2)} ${p}`;
2375
2375
  }
2376
2376
  return i === "number" && typeof a == "number" ? a.toLocaleString("pl-PL") : String(a);
2377
2377
  }
2378
- const Rs = ({ field: a, data: i, zoom: p }) => {
2379
- const l = a.dataPath ? Ts(a.dataPath, i) : null, k = l != null ? $s(l, a.type, a.format) : a.fallback ?? "", h = (b) => b * p * V, S = {
2378
+ const $s = ({ field: a, data: i, zoom: p }) => {
2379
+ const r = a.dataPath ? Ds(a.dataPath, i) : null, k = r != null ? Ts(r, a.type, a.format) : a.fallback ?? "", _ = (b) => b * p * V, S = {
2380
2380
  position: "absolute",
2381
- left: h(a.position.x),
2382
- top: h(a.position.y),
2383
- width: h(a.position.width),
2384
- height: h(a.position.height),
2381
+ left: _(a.position.x),
2382
+ top: _(a.position.y),
2383
+ width: _(a.position.width),
2384
+ height: _(a.position.height),
2385
2385
  fontSize: (a.style.fontSize ?? 10) * p,
2386
2386
  fontWeight: a.style.fontWeight ?? "normal",
2387
2387
  fontStyle: a.style.fontStyle ?? "normal",
2388
- color: a.style.color ?? "var(--text-primary, #0f172a)",
2388
+ color: a.style.color ?? "var(--nice-text-primary, #0f172a)",
2389
2389
  textAlign: a.style.textAlign ?? "left",
2390
2390
  backgroundColor: a.style.backgroundColor,
2391
2391
  transform: a.style.rotation ? `rotate(${a.style.rotation}deg)` : void 0,
@@ -2393,7 +2393,7 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
2393
2393
  display: "flex",
2394
2394
  alignItems: a.style.verticalAlign === "middle" ? "center" : a.style.verticalAlign === "bottom" ? "flex-end" : "flex-start",
2395
2395
  lineHeight: a.style.lineHeight ?? 1.4,
2396
- padding: a.style.padding ? h(a.style.padding) : 0,
2396
+ padding: a.style.padding ? _(a.style.padding) : 0,
2397
2397
  boxSizing: "border-box",
2398
2398
  borderWidth: a.style.borderWidth,
2399
2399
  borderColor: a.style.borderColor,
@@ -2401,10 +2401,10 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
2401
2401
  borderRadius: a.style.borderRadius,
2402
2402
  zIndex: a.position.zIndex ?? 1
2403
2403
  };
2404
- return a.type === "image" && l ? /* @__PURE__ */ e("div", { style: S, children: /* @__PURE__ */ e(
2404
+ return a.type === "image" && r ? /* @__PURE__ */ e("div", { style: S, children: /* @__PURE__ */ e(
2405
2405
  "img",
2406
2406
  {
2407
- src: String(l),
2407
+ src: String(r),
2408
2408
  alt: "",
2409
2409
  style: { width: "100%", height: "100%", objectFit: "contain" }
2410
2410
  }
@@ -2413,8 +2413,8 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
2413
2413
  {
2414
2414
  style: {
2415
2415
  ...S,
2416
- background: "var(--bg-secondary, #f8fafc)",
2417
- border: "1px dashed var(--border-color, #e2e8f0)",
2416
+ background: "var(--nice-bg-secondary, #f8fafc)",
2417
+ border: "1px dashed var(--nice-border-color, #e2e8f0)",
2418
2418
  alignItems: "center",
2419
2419
  justifyContent: "center",
2420
2420
  fontSize: 10 * p
@@ -2430,139 +2430,139 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
2430
2430
  {
2431
2431
  style: {
2432
2432
  ...S,
2433
- borderBottom: "1px solid var(--text-primary, #0f172a)",
2433
+ borderBottom: "1px solid var(--nice-text-primary, #0f172a)",
2434
2434
  alignItems: "flex-end"
2435
2435
  },
2436
- children: /* @__PURE__ */ e("span", { style: { fontSize: 8 * p, color: "var(--text-muted, #94a3b8)" }, children: a.label })
2436
+ children: /* @__PURE__ */ e("span", { style: { fontSize: 8 * p, color: "var(--nice-text-muted, #94a3b8)" }, children: a.label })
2437
2437
  }
2438
2438
  ) : a.type === "line" ? /* @__PURE__ */ e(
2439
2439
  "div",
2440
2440
  {
2441
2441
  style: {
2442
2442
  ...S,
2443
- borderBottom: `${a.style.borderWidth ?? 1}px ${a.style.borderStyle ?? "solid"} ${a.style.borderColor ?? "var(--text-primary, #0f172a)"}`
2443
+ borderBottom: `${a.style.borderWidth ?? 1}px ${a.style.borderStyle ?? "solid"} ${a.style.borderColor ?? "var(--nice-text-primary, #0f172a)"}`
2444
2444
  }
2445
2445
  }
2446
2446
  ) : /* @__PURE__ */ e("div", { style: S, children: k });
2447
- }, As = ({ template: a, data: i, zoom: p }) => {
2447
+ }, Rs = ({ template: a, data: i, zoom: p }) => {
2448
2448
  var b;
2449
- const [l, k] = (() => {
2450
- const [g, v] = Be[a.paperSize] ?? Be.A4;
2451
- return a.orientation === "landscape" ? [v * V * p, g * V * p] : [g * V * p, v * V * p];
2452
- })(), h = a.margins, S = a.sections.flatMap((g) => g.fields);
2453
- return /* @__PURE__ */ s("div", { className: j.page, style: { width: l, minHeight: k }, children: [
2449
+ const [r, k] = (() => {
2450
+ const [y, N] = Be[a.paperSize] ?? Be.A4;
2451
+ return a.orientation === "landscape" ? [N * V * p, y * V * p] : [y * V * p, N * V * p];
2452
+ })(), _ = a.margins, S = a.sections.flatMap((y) => y.fields);
2453
+ return /* @__PURE__ */ s("div", { className: W.page, style: { width: r, minHeight: k }, children: [
2454
2454
  /* @__PURE__ */ e(
2455
2455
  "div",
2456
2456
  {
2457
2457
  style: {
2458
2458
  position: "absolute",
2459
- top: h.top * p * V,
2460
- left: h.left * p * V,
2461
- right: h.right * p * V,
2462
- bottom: h.bottom * p * V
2459
+ top: _.top * p * V,
2460
+ left: _.left * p * V,
2461
+ right: _.right * p * V,
2462
+ bottom: _.bottom * p * V
2463
2463
  },
2464
- children: S.map((g) => /* @__PURE__ */ e(Rs, { field: g, data: i, zoom: p }, g.id))
2464
+ children: S.map((y) => /* @__PURE__ */ e($s, { field: y, data: i, zoom: p }, y.id))
2465
2465
  }
2466
2466
  ),
2467
- (b = a.watermarks) == null ? void 0 : b.map((g) => /* @__PURE__ */ e(
2467
+ (b = a.watermarks) == null ? void 0 : b.map((y) => /* @__PURE__ */ e(
2468
2468
  "div",
2469
2469
  {
2470
- className: j.watermark,
2470
+ className: W.watermark,
2471
2471
  style: {
2472
- opacity: g.opacity,
2473
- transform: `rotate(${g.angle}deg)`,
2474
- fontSize: (g.fontSize ?? 48) * p
2472
+ opacity: y.opacity,
2473
+ transform: `rotate(${y.angle}deg)`,
2474
+ fontSize: (y.fontSize ?? 48) * p
2475
2475
  },
2476
- children: g.type === "text" ? g.text : /* @__PURE__ */ e(
2476
+ children: y.type === "text" ? y.text : /* @__PURE__ */ e(
2477
2477
  "img",
2478
2478
  {
2479
- src: g.imageUrl,
2479
+ src: y.imageUrl,
2480
2480
  alt: "wm",
2481
2481
  style: { maxWidth: 200 * p }
2482
2482
  }
2483
2483
  )
2484
2484
  },
2485
- g.id
2485
+ y.id
2486
2486
  ))
2487
2487
  ] });
2488
- }, al = ({
2488
+ }, ar = ({
2489
2489
  template: a,
2490
2490
  entities: i = [],
2491
2491
  sampleData: p,
2492
- onPrint: l,
2492
+ onPrint: r,
2493
2493
  className: k,
2494
- style: h,
2494
+ style: _,
2495
2495
  theme: S = "light",
2496
2496
  asPopup: b = !0,
2497
- open: g,
2498
- onClose: v
2497
+ open: y,
2498
+ onClose: N
2499
2499
  }) => {
2500
- const { t: c } = Ue(), [T, N] = M(0), [r, n] = M(0.8), [u, m] = M(!0), f = g !== void 0, D = f ? g : u, y = () => {
2501
- f || m(!1), v == null || v();
2500
+ const { t: c } = Ue(), [D, w] = P(0), [l, n] = P(0.8), [u, m] = P(!0), f = y !== void 0, z = f ? y : u, g = () => {
2501
+ f || m(!1), N == null || N();
2502
2502
  };
2503
- ye(() => {
2504
- if (!b || !D)
2503
+ ge(() => {
2504
+ if (!b || !z)
2505
2505
  return;
2506
- const P = (_) => {
2507
- _.key === "Escape" && y();
2506
+ const A = (h) => {
2507
+ h.key === "Escape" && g();
2508
2508
  };
2509
- return document.addEventListener("keydown", P), document.body.style.overflow = "hidden", () => {
2510
- document.removeEventListener("keydown", P), document.body.style.overflow = "";
2509
+ return document.addEventListener("keydown", A), document.body.style.overflow = "hidden", () => {
2510
+ document.removeEventListener("keydown", A), document.body.style.overflow = "";
2511
2511
  };
2512
- }, [b, D]);
2513
- const x = oe(() => i.length > 0 ? i : p ? [p.data] : [{}], [i, p]), I = x[T] ?? {};
2514
- if (b && !D)
2512
+ }, [b, z]);
2513
+ const L = oe(() => i.length > 0 ? i : p ? [p.data] : [{}], [i, p]), C = L[D] ?? {};
2514
+ if (b && !z)
2515
2515
  return null;
2516
- const E = /* @__PURE__ */ s(
2516
+ const M = /* @__PURE__ */ s(
2517
2517
  "div",
2518
2518
  {
2519
- className: `${j.root} ${S === "dark" ? j.dark : ""} ${k ?? ""}`,
2520
- style: h,
2519
+ className: `${W.root} ${S === "dark" ? W.dark : ""} ${k ?? ""}`,
2520
+ style: _,
2521
2521
  children: [
2522
- /* @__PURE__ */ s("div", { className: j.headerBar, children: [
2523
- /* @__PURE__ */ s("div", { className: j.entityNav, children: [
2524
- x.length > 1 && /* @__PURE__ */ s(Y, { children: [
2522
+ /* @__PURE__ */ s("div", { className: W.headerBar, children: [
2523
+ /* @__PURE__ */ s("div", { className: W.entityNav, children: [
2524
+ L.length > 1 && /* @__PURE__ */ s(Y, { children: [
2525
2525
  /* @__PURE__ */ e(
2526
2526
  "button",
2527
2527
  {
2528
- className: j.navBtn,
2529
- disabled: T === 0,
2530
- onClick: () => N((P) => P - 1),
2528
+ className: W.navBtn,
2529
+ disabled: D === 0,
2530
+ onClick: () => w((A) => A - 1),
2531
2531
  children: "‹"
2532
2532
  }
2533
2533
  ),
2534
- /* @__PURE__ */ s("span", { className: j.navLabel, children: [
2535
- T + 1,
2534
+ /* @__PURE__ */ s("span", { className: W.navLabel, children: [
2535
+ D + 1,
2536
2536
  " / ",
2537
- x.length
2537
+ L.length
2538
2538
  ] }),
2539
2539
  /* @__PURE__ */ e(
2540
2540
  "button",
2541
2541
  {
2542
- className: j.navBtn,
2543
- disabled: T >= x.length - 1,
2544
- onClick: () => N((P) => P + 1),
2542
+ className: W.navBtn,
2543
+ disabled: D >= L.length - 1,
2544
+ onClick: () => w((A) => A + 1),
2545
2545
  children: "›"
2546
2546
  }
2547
2547
  )
2548
2548
  ] }),
2549
- i.length === 0 && p && /* @__PURE__ */ e("span", { className: j.sampleBadge, children: "Przykładowe dane" })
2549
+ i.length === 0 && p && /* @__PURE__ */ e("span", { className: W.sampleBadge, children: "Przykładowe dane" })
2550
2550
  ] }),
2551
- /* @__PURE__ */ s("div", { className: j.zoomBar, children: [
2552
- /* @__PURE__ */ e("button", { className: j.zoomBtn, onClick: () => n((P) => Math.max(0.3, P - 0.1)), children: "−" }),
2553
- /* @__PURE__ */ s("span", { className: j.zoomLabel, children: [
2554
- Math.round(r * 100),
2551
+ /* @__PURE__ */ s("div", { className: W.zoomBar, children: [
2552
+ /* @__PURE__ */ e("button", { className: W.zoomBtn, onClick: () => n((A) => Math.max(0.3, A - 0.1)), children: "−" }),
2553
+ /* @__PURE__ */ s("span", { className: W.zoomLabel, children: [
2554
+ Math.round(l * 100),
2555
2555
  "%"
2556
2556
  ] }),
2557
- /* @__PURE__ */ e("button", { className: j.zoomBtn, onClick: () => n((P) => Math.min(2.5, P + 0.1)), children: "+" }),
2558
- /* @__PURE__ */ e("button", { className: j.zoomBtn, onClick: () => n(0.8), title: "Dopasuj", children: "⊡" })
2557
+ /* @__PURE__ */ e("button", { className: W.zoomBtn, onClick: () => n((A) => Math.min(2.5, A + 0.1)), children: "+" }),
2558
+ /* @__PURE__ */ e("button", { className: W.zoomBtn, onClick: () => n(0.8), title: "Dopasuj", children: "⊡" })
2559
2559
  ] }),
2560
2560
  /* @__PURE__ */ s("div", { style: { display: "flex", gap: 8 }, children: [
2561
2561
  /* @__PURE__ */ e(
2562
2562
  "button",
2563
2563
  {
2564
- className: j.printBtn,
2565
- onClick: () => l == null ? void 0 : l({ copies: 1, printerId: "" }),
2564
+ className: W.printBtn,
2565
+ onClick: () => r == null ? void 0 : r({ copies: 1, printerId: "" }),
2566
2566
  children: c("printPreview.print", "Drukuj")
2567
2567
  }
2568
2568
  ),
@@ -2570,8 +2570,8 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
2570
2570
  "button",
2571
2571
  {
2572
2572
  type: "button",
2573
- className: j.zoomBtn,
2574
- onClick: y,
2573
+ className: W.zoomBtn,
2574
+ onClick: g,
2575
2575
  "aria-label": c("common.close", "Zamknij"),
2576
2576
  title: c("common.close", "Zamknij"),
2577
2577
  children: "✕"
@@ -2579,15 +2579,15 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
2579
2579
  )
2580
2580
  ] })
2581
2581
  ] }),
2582
- /* @__PURE__ */ e("div", { className: j.canvas, children: /* @__PURE__ */ e(As, { template: a, data: I, zoom: r }) }),
2583
- /* @__PURE__ */ s("div", { className: j.footerBar, children: [
2582
+ /* @__PURE__ */ e("div", { className: W.canvas, children: /* @__PURE__ */ e(Rs, { template: a, data: C, zoom: l }) }),
2583
+ /* @__PURE__ */ s("div", { className: W.footerBar, children: [
2584
2584
  /* @__PURE__ */ e("span", { children: a.name }),
2585
2585
  /* @__PURE__ */ s("span", { children: [
2586
2586
  a.paperSize,
2587
2587
  " · ",
2588
2588
  a.orientation === "portrait" ? "Pion" : "Poziom"
2589
2589
  ] }),
2590
- a.sections.reduce((P, _) => P + _.fields.length, 0),
2590
+ a.sections.reduce((A, h) => A + h.fields.length, 0),
2591
2591
  " pól"
2592
2592
  ] })
2593
2593
  ]
@@ -2599,15 +2599,15 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
2599
2599
  style: {
2600
2600
  position: "fixed",
2601
2601
  inset: 0,
2602
- background: "color-mix(in srgb, var(--text-primary, #000) 50%, transparent)",
2602
+ background: "color-mix(in srgb, var(--nice-text-primary, #000) 50%, transparent)",
2603
2603
  display: "flex",
2604
2604
  alignItems: "center",
2605
2605
  justifyContent: "center",
2606
2606
  zIndex: 1e3,
2607
2607
  padding: 24
2608
2608
  },
2609
- onMouseDown: (P) => {
2610
- P.target === P.currentTarget && y();
2609
+ onMouseDown: (A) => {
2610
+ A.target === A.currentTarget && g();
2611
2611
  },
2612
2612
  role: "presentation",
2613
2613
  children: /* @__PURE__ */ e(
@@ -2616,26 +2616,26 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
2616
2616
  role: "dialog",
2617
2617
  "aria-modal": "true",
2618
2618
  style: {
2619
- background: "var(--bg-elevated, var(--bg-primary, #ffffff))",
2619
+ background: "var(--nice-bg-elevated, var(--nice-bg-primary, #ffffff))",
2620
2620
  borderRadius: 12,
2621
- boxShadow: "0 20px 60px color-mix(in srgb, var(--text-primary, #000) 30%, transparent)",
2621
+ boxShadow: "0 20px 60px color-mix(in srgb, var(--nice-text-primary, #000) 30%, transparent)",
2622
2622
  maxWidth: "90vw",
2623
2623
  maxHeight: "90vh",
2624
2624
  overflow: "auto"
2625
2625
  },
2626
- children: E
2626
+ children: M
2627
2627
  }
2628
2628
  )
2629
2629
  }
2630
- ), document.body) : E;
2631
- }, Ps = "_root_18ftw_1", Ms = "_dark_18ftw_23", Es = "_statsBar_18ftw_29", Gs = "_stat_18ftw_29", Hs = "_dot_18ftw_51", Ws = "_statPrinting_18ftw_53", js = "_statQueued_18ftw_55", Fs = "_statDone_18ftw_57", Os = "_statError_18ftw_59", Us = "_toolbar_18ftw_65", Ys = "_filterTabs_18ftw_85", qs = "_filterTab_18ftw_85", Ks = "_filterTabActive_18ftw_109", Vs = "_filterCount_18ftw_111", Zs = "_bulkActions_18ftw_123", Xs = "_bulkCount_18ftw_125", Js = "_bulkBtn_18ftw_127", Qs = "_bulkBtnRemove_18ftw_147", er = "_jobList_18ftw_155", tr = "_listHeader_18ftw_159", ar = "_headerLabel_18ftw_187", nr = "_jobRow_18ftw_193", sr = "_jobRowSelected_18ftw_217", rr = "_jobCheckbox_18ftw_223", lr = "_statusBadge_18ftw_229", ir = "_pulse_18ftw_1", or = "_jobInfo_18ftw_267", cr = "_jobName_18ftw_269", dr = "_jobMeta_18ftw_271", pr = "_jobTime_18ftw_281", mr = "_jobDuration_18ftw_283", ur = "_jobError_18ftw_285", hr = "_progressBar_18ftw_291", _r = "_progressFill_18ftw_305", gr = "_copiesEditor_18ftw_321", yr = "_copiesBtn_18ftw_333", br = "_copiesValue_18ftw_357", wr = "_jobActions_18ftw_363", vr = "_actionBtn_18ftw_365", Nr = "_removeBtn_18ftw_387", fr = "_emptyState_18ftw_395", w = {
2632
- root: Ps,
2633
- dark: Ms,
2634
- statsBar: Es,
2635
- stat: Gs,
2636
- dot: Hs,
2637
- statPrinting: Ws,
2638
- statQueued: js,
2630
+ ), document.body) : M;
2631
+ }, As = "_root_lsn26_1", Ps = "_dark_lsn26_23", Ms = "_statsBar_lsn26_37", Es = "_stat_lsn26_37", Gs = "_dot_lsn26_75", Hs = "_statPrinting_lsn26_87", Ws = "_statQueued_lsn26_93", Fs = "_statDone_lsn26_99", Os = "_statError_lsn26_105", Us = "_toolbar_lsn26_115", Ys = "_filterTabs_lsn26_139", qs = "_filterTab_lsn26_139", Ks = "_filterTabActive_lsn26_177", Vs = "_filterCount_lsn26_187", Zs = "_bulkActions_lsn26_211", Xs = "_bulkCount_lsn26_223", Js = "_bulkBtn_lsn26_231", Qs = "_bulkBtnRemove_lsn26_255", el = "_jobList_lsn26_273", tl = "_listHeader_lsn26_281", al = "_headerLabel_lsn26_313", nl = "_jobRow_lsn26_323", sl = "_jobRowSelected_lsn26_359", ll = "_jobCheckbox_lsn26_373", rl = "_statusBadge_lsn26_387", il = "_pulse_lsn26_1", ol = "_jobInfo_lsn26_479", cl = "_jobName_lsn26_485", dl = "_jobMeta_lsn26_497", pl = "_jobTime_lsn26_513", ml = "_jobDuration_lsn26_519", ul = "_jobError_lsn26_525", _l = "_progressBar_lsn26_539", hl = "_progressFill_lsn26_553", yl = "_copiesEditor_lsn26_569", gl = "_copiesBtn_lsn26_581", bl = "_copiesValue_lsn26_621", vl = "_jobActions_lsn26_635", Nl = "_actionBtn_lsn26_645", wl = "_removeBtn_lsn26_677", fl = "_emptyState_lsn26_695", v = {
2632
+ root: As,
2633
+ dark: Ps,
2634
+ statsBar: Ms,
2635
+ stat: Es,
2636
+ dot: Gs,
2637
+ statPrinting: Hs,
2638
+ statQueued: Ws,
2639
2639
  statDone: Fs,
2640
2640
  statError: Os,
2641
2641
  toolbar: Us,
@@ -2647,36 +2647,36 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
2647
2647
  bulkCount: Xs,
2648
2648
  bulkBtn: Js,
2649
2649
  bulkBtnRemove: Qs,
2650
- jobList: er,
2651
- listHeader: tr,
2652
- headerLabel: ar,
2653
- jobRow: nr,
2654
- jobRowSelected: sr,
2655
- jobCheckbox: rr,
2656
- statusBadge: lr,
2657
- "badge-queued": "_badge-queued_18ftw_247",
2658
- "badge-printing": "_badge-printing_18ftw_249",
2659
- pulse: ir,
2660
- "badge-done": "_badge-done_18ftw_251",
2661
- "badge-error": "_badge-error_18ftw_253",
2662
- "badge-paused": "_badge-paused_18ftw_255",
2663
- "badge-cancelled": "_badge-cancelled_18ftw_257",
2664
- jobInfo: or,
2665
- jobName: cr,
2666
- jobMeta: dr,
2667
- jobTime: pr,
2668
- jobDuration: mr,
2669
- jobError: ur,
2670
- progressBar: hr,
2671
- progressFill: _r,
2672
- copiesEditor: gr,
2673
- copiesBtn: yr,
2674
- copiesValue: br,
2675
- jobActions: wr,
2676
- actionBtn: vr,
2677
- removeBtn: Nr,
2678
- emptyState: fr
2679
- }, ge = {
2650
+ jobList: el,
2651
+ listHeader: tl,
2652
+ headerLabel: al,
2653
+ jobRow: nl,
2654
+ jobRowSelected: sl,
2655
+ jobCheckbox: ll,
2656
+ statusBadge: rl,
2657
+ "badge-queued": "_badge-queued_lsn26_405",
2658
+ "badge-printing": "_badge-printing_lsn26_413",
2659
+ pulse: il,
2660
+ "badge-done": "_badge-done_lsn26_423",
2661
+ "badge-error": "_badge-error_lsn26_431",
2662
+ "badge-paused": "_badge-paused_lsn26_439",
2663
+ "badge-cancelled": "_badge-cancelled_lsn26_447",
2664
+ jobInfo: ol,
2665
+ jobName: cl,
2666
+ jobMeta: dl,
2667
+ jobTime: pl,
2668
+ jobDuration: ml,
2669
+ jobError: ul,
2670
+ progressBar: _l,
2671
+ progressFill: hl,
2672
+ copiesEditor: yl,
2673
+ copiesBtn: gl,
2674
+ copiesValue: bl,
2675
+ jobActions: vl,
2676
+ actionBtn: Nl,
2677
+ removeBtn: wl,
2678
+ emptyState: fl
2679
+ }, ye = {
2680
2680
  queued: "Kolejka",
2681
2681
  printing: "Drukowanie",
2682
2682
  done: "Wydrukowano",
@@ -2684,72 +2684,72 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
2684
2684
  paused: "Wstrzymano",
2685
2685
  cancelled: "Anulowano"
2686
2686
  };
2687
- function kr(a) {
2687
+ function kl(a) {
2688
2688
  try {
2689
2689
  return new Date(a).toLocaleTimeString("pl-PL", { hour: "2-digit", minute: "2-digit" });
2690
2690
  } catch {
2691
2691
  return a;
2692
2692
  }
2693
2693
  }
2694
- function Sr(a) {
2694
+ function Sl(a) {
2695
2695
  const i = Date.now() - new Date(a).getTime(), p = Math.floor(i / 1e3);
2696
2696
  return p < 60 ? `${p}s` : `${Math.floor(p / 60)}m ${p % 60}s`;
2697
2697
  }
2698
- const Br = ({ jobs: a }) => {
2699
- const i = a.filter((h) => h.status === "printing").length, p = a.filter((h) => h.status === "queued").length, l = a.filter((h) => h.status === "done").length, k = a.filter((h) => h.status === "error").length;
2700
- return /* @__PURE__ */ s("div", { className: w.statsBar, children: [
2701
- /* @__PURE__ */ s("span", { className: `${w.stat} ${w.statPrinting}`, children: [
2702
- /* @__PURE__ */ e("span", { className: w.dot }),
2698
+ const Bl = ({ jobs: a }) => {
2699
+ const i = a.filter((_) => _.status === "printing").length, p = a.filter((_) => _.status === "queued").length, r = a.filter((_) => _.status === "done").length, k = a.filter((_) => _.status === "error").length;
2700
+ return /* @__PURE__ */ s("div", { className: v.statsBar, children: [
2701
+ /* @__PURE__ */ s("span", { className: `${v.stat} ${v.statPrinting}`, children: [
2702
+ /* @__PURE__ */ e("span", { className: v.dot }),
2703
2703
  "Drukuje: ",
2704
2704
  /* @__PURE__ */ e("strong", { children: i })
2705
2705
  ] }),
2706
- /* @__PURE__ */ s("span", { className: `${w.stat} ${w.statQueued}`, children: [
2707
- /* @__PURE__ */ e("span", { className: w.dot }),
2706
+ /* @__PURE__ */ s("span", { className: `${v.stat} ${v.statQueued}`, children: [
2707
+ /* @__PURE__ */ e("span", { className: v.dot }),
2708
2708
  "W kolejce: ",
2709
2709
  /* @__PURE__ */ e("strong", { children: p })
2710
2710
  ] }),
2711
- /* @__PURE__ */ s("span", { className: `${w.stat} ${w.statDone}`, children: [
2712
- /* @__PURE__ */ e("span", { className: w.dot }),
2711
+ /* @__PURE__ */ s("span", { className: `${v.stat} ${v.statDone}`, children: [
2712
+ /* @__PURE__ */ e("span", { className: v.dot }),
2713
2713
  "Gotowe: ",
2714
- /* @__PURE__ */ e("strong", { children: l })
2714
+ /* @__PURE__ */ e("strong", { children: r })
2715
2715
  ] }),
2716
- k > 0 && /* @__PURE__ */ s("span", { className: `${w.stat} ${w.statError}`, children: [
2717
- /* @__PURE__ */ e("span", { className: w.dot }),
2716
+ k > 0 && /* @__PURE__ */ s("span", { className: `${v.stat} ${v.statError}`, children: [
2717
+ /* @__PURE__ */ e("span", { className: v.dot }),
2718
2718
  "Błędy: ",
2719
2719
  /* @__PURE__ */ e("strong", { children: k })
2720
2720
  ] })
2721
2721
  ] });
2722
- }, Cr = ({
2722
+ }, xl = ({
2723
2723
  job: a,
2724
2724
  index: i,
2725
2725
  total: p,
2726
- printers: l,
2726
+ printers: r,
2727
2727
  selected: k,
2728
- onSelect: h,
2728
+ onSelect: _,
2729
2729
  onUpdate: S,
2730
2730
  onRemove: b,
2731
- onPrint: g,
2732
- onReorder: v
2731
+ onPrint: y,
2732
+ onReorder: N
2733
2733
  }) => {
2734
- const c = l.find((r) => r.id === a.options.printerId), T = i > 0 && a.status === "queued", N = i < p - 1 && a.status === "queued";
2734
+ const c = r.find((l) => l.id === a.options.printerId), D = i > 0 && a.status === "queued", w = i < p - 1 && a.status === "queued";
2735
2735
  return /* @__PURE__ */ s(
2736
2736
  "div",
2737
2737
  {
2738
- className: `${w.jobRow} ${k ? w.jobRowSelected : ""} ${w[`status-${a.status}`] ?? ""}`,
2738
+ className: `${v.jobRow} ${k ? v.jobRowSelected : ""} ${v[`status-${a.status}`] ?? ""}`,
2739
2739
  children: [
2740
2740
  /* @__PURE__ */ e(
2741
2741
  "input",
2742
2742
  {
2743
2743
  type: "checkbox",
2744
- className: w.jobCheckbox,
2744
+ className: v.jobCheckbox,
2745
2745
  checked: k,
2746
- onChange: () => h(a.id)
2746
+ onChange: () => _(a.id)
2747
2747
  }
2748
2748
  ),
2749
- /* @__PURE__ */ e("span", { className: `${w.statusBadge} ${w[`badge-${a.status}`]}`, children: ge[a.status] ?? a.status }),
2750
- /* @__PURE__ */ s("div", { className: w.jobInfo, children: [
2751
- /* @__PURE__ */ e("div", { className: w.jobName, children: a.templateName ?? a.templateId }),
2752
- /* @__PURE__ */ s("div", { className: w.jobMeta, children: [
2749
+ /* @__PURE__ */ e("span", { className: `${v.statusBadge} ${v[`badge-${a.status}`]}`, children: ye[a.status] ?? a.status }),
2750
+ /* @__PURE__ */ s("div", { className: v.jobInfo, children: [
2751
+ /* @__PURE__ */ e("div", { className: v.jobName, children: a.templateName ?? a.templateId }),
2752
+ /* @__PURE__ */ s("div", { className: v.jobMeta, children: [
2753
2753
  a.entityLabel && /* @__PURE__ */ e("span", { children: a.entityLabel }),
2754
2754
  c && /* @__PURE__ */ s("span", { children: [
2755
2755
  "🖨 ",
@@ -2759,56 +2759,56 @@ const Br = ({ jobs: a }) => {
2759
2759
  "×",
2760
2760
  a.options.copies
2761
2761
  ] }),
2762
- a.createdAt && /* @__PURE__ */ e("span", { className: w.jobTime, children: kr(a.createdAt) }),
2763
- a.startedAt && a.status !== "done" && /* @__PURE__ */ e("span", { className: w.jobDuration, children: Sr(a.startedAt) })
2762
+ a.createdAt && /* @__PURE__ */ e("span", { className: v.jobTime, children: kl(a.createdAt) }),
2763
+ a.startedAt && a.status !== "done" && /* @__PURE__ */ e("span", { className: v.jobDuration, children: Sl(a.startedAt) })
2764
2764
  ] }),
2765
- a.status === "printing" && a.progress != null && /* @__PURE__ */ e("div", { className: w.progressBar, children: /* @__PURE__ */ e("div", { className: w.progressFill, style: { width: `${a.progress}%` } }) }),
2766
- a.status === "error" && a.errorMessage && /* @__PURE__ */ e("div", { className: w.jobError, children: a.errorMessage })
2765
+ a.status === "printing" && a.progress != null && /* @__PURE__ */ e("div", { className: v.progressBar, children: /* @__PURE__ */ e("div", { className: v.progressFill, style: { width: `${a.progress}%` } }) }),
2766
+ a.status === "error" && a.errorMessage && /* @__PURE__ */ e("div", { className: v.jobError, children: a.errorMessage })
2767
2767
  ] }),
2768
- /* @__PURE__ */ s("div", { className: w.copiesEditor, children: [
2768
+ /* @__PURE__ */ s("div", { className: v.copiesEditor, children: [
2769
2769
  /* @__PURE__ */ e(
2770
2770
  "button",
2771
2771
  {
2772
- className: w.copiesBtn,
2772
+ className: v.copiesBtn,
2773
2773
  disabled: a.options.copies <= 1,
2774
2774
  onClick: () => S(a.id, { options: { ...a.options, copies: a.options.copies - 1 } }),
2775
2775
  children: "−"
2776
2776
  }
2777
2777
  ),
2778
- /* @__PURE__ */ e("span", { className: w.copiesValue, children: a.options.copies }),
2778
+ /* @__PURE__ */ e("span", { className: v.copiesValue, children: a.options.copies }),
2779
2779
  /* @__PURE__ */ e(
2780
2780
  "button",
2781
2781
  {
2782
- className: w.copiesBtn,
2782
+ className: v.copiesBtn,
2783
2783
  onClick: () => S(a.id, { options: { ...a.options, copies: a.options.copies + 1 } }),
2784
2784
  children: "+"
2785
2785
  }
2786
2786
  )
2787
2787
  ] }),
2788
- /* @__PURE__ */ s("div", { className: w.jobActions, children: [
2789
- T && /* @__PURE__ */ e(
2788
+ /* @__PURE__ */ s("div", { className: v.jobActions, children: [
2789
+ D && /* @__PURE__ */ e(
2790
2790
  "button",
2791
2791
  {
2792
- className: w.actionBtn,
2792
+ className: v.actionBtn,
2793
2793
  title: "Przesuń wyżej",
2794
- onClick: () => v(i, i - 1),
2794
+ onClick: () => N(i, i - 1),
2795
2795
  children: "↑"
2796
2796
  }
2797
2797
  ),
2798
- N && /* @__PURE__ */ e(
2798
+ w && /* @__PURE__ */ e(
2799
2799
  "button",
2800
2800
  {
2801
- className: w.actionBtn,
2801
+ className: v.actionBtn,
2802
2802
  title: "Przesuń niżej",
2803
- onClick: () => v(i, i + 1),
2803
+ onClick: () => N(i, i + 1),
2804
2804
  children: "↓"
2805
2805
  }
2806
2806
  ),
2807
- a.status === "queued" && /* @__PURE__ */ e("button", { className: w.actionBtn, title: "Drukuj teraz", onClick: () => g(a.id), children: "▶" }),
2807
+ a.status === "queued" && /* @__PURE__ */ e("button", { className: v.actionBtn, title: "Drukuj teraz", onClick: () => y(a.id), children: "▶" }),
2808
2808
  a.status === "printing" && /* @__PURE__ */ e(
2809
2809
  "button",
2810
2810
  {
2811
- className: w.actionBtn,
2811
+ className: v.actionBtn,
2812
2812
  title: "Wstrzymaj",
2813
2813
  onClick: () => S(a.id, { status: "paused" }),
2814
2814
  children: "⏸"
@@ -2817,7 +2817,7 @@ const Br = ({ jobs: a }) => {
2817
2817
  a.status === "paused" && /* @__PURE__ */ e(
2818
2818
  "button",
2819
2819
  {
2820
- className: w.actionBtn,
2820
+ className: v.actionBtn,
2821
2821
  title: "Wznów",
2822
2822
  onClick: () => S(a.id, { status: "queued" }),
2823
2823
  children: "▶"
@@ -2826,7 +2826,7 @@ const Br = ({ jobs: a }) => {
2826
2826
  /* @__PURE__ */ e(
2827
2827
  "button",
2828
2828
  {
2829
- className: `${w.actionBtn} ${w.removeBtn}`,
2829
+ className: `${v.actionBtn} ${v.removeBtn}`,
2830
2830
  title: "Usuń",
2831
2831
  onClick: () => b(a.id),
2832
2832
  children: "✕"
@@ -2836,251 +2836,251 @@ const Br = ({ jobs: a }) => {
2836
2836
  ]
2837
2837
  }
2838
2838
  );
2839
- }, nl = ({
2839
+ }, nr = ({
2840
2840
  jobs: a,
2841
2841
  printers: i = [],
2842
2842
  onJobUpdate: p,
2843
- onJobRemove: l,
2843
+ onJobRemove: r,
2844
2844
  onJobReorder: k,
2845
- onJobPrint: h,
2845
+ onJobPrint: _,
2846
2846
  onBulkRemove: S,
2847
2847
  onBulkPrint: b,
2848
- maxHeight: g = 500,
2849
- className: v,
2848
+ maxHeight: y = 500,
2849
+ className: N,
2850
2850
  style: c,
2851
- theme: T = "light"
2851
+ theme: D = "light"
2852
2852
  }) => {
2853
- const [N, r] = M(/* @__PURE__ */ new Set()), [n, u] = M("all"), m = n === "all" ? a : a.filter((I) => I.status === n), f = $((I) => {
2854
- r((E) => {
2855
- const W = new Set(E);
2856
- return W.has(I) ? W.delete(I) : W.add(I), W;
2853
+ const [w, l] = P(/* @__PURE__ */ new Set()), [n, u] = P("all"), m = n === "all" ? a : a.filter((C) => C.status === n), f = T((C) => {
2854
+ l((M) => {
2855
+ const H = new Set(M);
2856
+ return H.has(C) ? H.delete(C) : H.add(C), H;
2857
2857
  });
2858
- }, []), D = $(() => {
2859
- N.size === m.length ? r(/* @__PURE__ */ new Set()) : r(new Set(m.map((I) => I.id)));
2860
- }, [m, N.size]), y = $(() => {
2861
- S == null || S(Array.from(N)), r(/* @__PURE__ */ new Set());
2862
- }, [N, S]), x = $(() => {
2863
- b == null || b(Array.from(N)), r(/* @__PURE__ */ new Set());
2864
- }, [N, b]);
2858
+ }, []), z = T(() => {
2859
+ w.size === m.length ? l(/* @__PURE__ */ new Set()) : l(new Set(m.map((C) => C.id)));
2860
+ }, [m, w.size]), g = T(() => {
2861
+ S == null || S(Array.from(w)), l(/* @__PURE__ */ new Set());
2862
+ }, [w, S]), L = T(() => {
2863
+ b == null || b(Array.from(w)), l(/* @__PURE__ */ new Set());
2864
+ }, [w, b]);
2865
2865
  return /* @__PURE__ */ s(
2866
2866
  "div",
2867
2867
  {
2868
- className: `${w.root} ${T === "dark" ? w.dark : ""} ${v ?? ""}`,
2868
+ className: `${v.root} ${D === "dark" ? v.dark : ""} ${N ?? ""}`,
2869
2869
  style: c,
2870
2870
  children: [
2871
- /* @__PURE__ */ e(Br, { jobs: a }),
2872
- /* @__PURE__ */ s("div", { className: w.toolbar, children: [
2873
- /* @__PURE__ */ e("div", { className: w.filterTabs, children: ["all", "queued", "printing", "done", "error"].map((I) => /* @__PURE__ */ s(
2871
+ /* @__PURE__ */ e(Bl, { jobs: a }),
2872
+ /* @__PURE__ */ s("div", { className: v.toolbar, children: [
2873
+ /* @__PURE__ */ e("div", { className: v.filterTabs, children: ["all", "queued", "printing", "done", "error"].map((C) => /* @__PURE__ */ s(
2874
2874
  "button",
2875
2875
  {
2876
- className: `${w.filterTab} ${n === I ? w.filterTabActive : ""}`,
2877
- onClick: () => u(I),
2876
+ className: `${v.filterTab} ${n === C ? v.filterTabActive : ""}`,
2877
+ onClick: () => u(C),
2878
2878
  children: [
2879
- I === "all" ? "Wszystkie" : ge[I],
2880
- /* @__PURE__ */ e("span", { className: w.filterCount, children: I === "all" ? a.length : a.filter((E) => E.status === I).length })
2879
+ C === "all" ? "Wszystkie" : ye[C],
2880
+ /* @__PURE__ */ e("span", { className: v.filterCount, children: C === "all" ? a.length : a.filter((M) => M.status === C).length })
2881
2881
  ]
2882
2882
  },
2883
- I
2883
+ C
2884
2884
  )) }),
2885
- N.size > 0 && /* @__PURE__ */ s("div", { className: w.bulkActions, children: [
2886
- /* @__PURE__ */ s("span", { className: w.bulkCount, children: [
2887
- N.size,
2885
+ w.size > 0 && /* @__PURE__ */ s("div", { className: v.bulkActions, children: [
2886
+ /* @__PURE__ */ s("span", { className: v.bulkCount, children: [
2887
+ w.size,
2888
2888
  " zaznaczonych"
2889
2889
  ] }),
2890
- b && /* @__PURE__ */ e("button", { className: w.bulkBtn, onClick: x, children: "▶ Drukuj wybrane" }),
2891
- S && /* @__PURE__ */ e("button", { className: `${w.bulkBtn} ${w.bulkBtnRemove}`, onClick: y, children: "✕ Usuń wybrane" })
2890
+ b && /* @__PURE__ */ e("button", { className: v.bulkBtn, onClick: L, children: "▶ Drukuj wybrane" }),
2891
+ S && /* @__PURE__ */ e("button", { className: `${v.bulkBtn} ${v.bulkBtnRemove}`, onClick: g, children: "✕ Usuń wybrane" })
2892
2892
  ] })
2893
2893
  ] }),
2894
- /* @__PURE__ */ e("div", { className: w.jobList, style: { maxHeight: g }, children: m.length === 0 ? /* @__PURE__ */ e("div", { className: w.emptyState, children: n === "all" ? "Brak zadań w kolejce" : `Brak zadań ze statusem "${ge[n]}"` }) : /* @__PURE__ */ s(Y, { children: [
2895
- /* @__PURE__ */ s("div", { className: w.listHeader, children: [
2894
+ /* @__PURE__ */ e("div", { className: v.jobList, style: { maxHeight: y }, children: m.length === 0 ? /* @__PURE__ */ e("div", { className: v.emptyState, children: n === "all" ? "Brak zadań w kolejce" : `Brak zadań ze statusem "${ye[n]}"` }) : /* @__PURE__ */ s(Y, { children: [
2895
+ /* @__PURE__ */ s("div", { className: v.listHeader, children: [
2896
2896
  /* @__PURE__ */ e(
2897
2897
  "input",
2898
2898
  {
2899
2899
  type: "checkbox",
2900
- onChange: D,
2901
- checked: N.size === m.length && m.length > 0
2900
+ onChange: z,
2901
+ checked: w.size === m.length && m.length > 0
2902
2902
  }
2903
2903
  ),
2904
- /* @__PURE__ */ e("span", { className: w.headerLabel, children: "Zadanie" }),
2905
- /* @__PURE__ */ e("span", { className: w.headerLabel, children: "Kopie" }),
2906
- /* @__PURE__ */ e("span", { className: w.headerLabel, children: "Akcje" })
2904
+ /* @__PURE__ */ e("span", { className: v.headerLabel, children: "Zadanie" }),
2905
+ /* @__PURE__ */ e("span", { className: v.headerLabel, children: "Kopie" }),
2906
+ /* @__PURE__ */ e("span", { className: v.headerLabel, children: "Akcje" })
2907
2907
  ] }),
2908
- m.map((I, E) => /* @__PURE__ */ e(
2909
- Cr,
2908
+ m.map((C, M) => /* @__PURE__ */ e(
2909
+ xl,
2910
2910
  {
2911
- job: I,
2912
- index: a.indexOf(I),
2911
+ job: C,
2912
+ index: a.indexOf(C),
2913
2913
  total: a.length,
2914
2914
  printers: i,
2915
- selected: N.has(I.id),
2915
+ selected: w.has(C.id),
2916
2916
  onSelect: f,
2917
2917
  onUpdate: p,
2918
- onRemove: l,
2919
- onPrint: h,
2918
+ onRemove: r,
2919
+ onPrint: _,
2920
2920
  onReorder: k
2921
2921
  },
2922
- I.id
2922
+ C.id
2923
2923
  ))
2924
2924
  ] }) })
2925
2925
  ]
2926
2926
  }
2927
2927
  );
2928
- }, Ir = "_container_yzbyh_1", Lr = "_buttonGroup_yzbyh_19", xr = "_trigger_yzbyh_31", zr = "_triggerDisabled_yzbyh_53", Dr = "_mainAction_yzbyh_85", Tr = "_dropdownToggle_yzbyh_95", $r = "_chevron_yzbyh_109", Rr = "_chevronUp_yzbyh_111", Ar = "_dropdown_yzbyh_95", Pr = "_dark_yzbyh_141", Mr = "_section_yzbyh_145", Er = "_sectionLabel_yzbyh_147", Gr = "_divider_yzbyh_167", Hr = "_copiesRow_yzbyh_175", Wr = "_copiesBtn_yzbyh_185", jr = "_copiesValue_yzbyh_209", Fr = "_printerSelect_yzbyh_229", Or = "_printerStatus_yzbyh_255", Ur = "_printerDot_yzbyh_269", Yr = "_printerStatusLabel_yzbyh_279", qr = "_submitBtn_yzbyh_285", Kr = "_spinner_yzbyh_317", Vr = "_spin_yzbyh_317", z = {
2929
- container: Ir,
2930
- buttonGroup: Lr,
2931
- trigger: xr,
2932
- triggerDisabled: zr,
2933
- "variant-primary": "_variant-primary_yzbyh_59",
2934
- "variant-secondary": "_variant-secondary_yzbyh_63",
2935
- "variant-ghost": "_variant-ghost_yzbyh_67",
2936
- "size-sm": "_size-sm_yzbyh_75",
2937
- "size-md": "_size-md_yzbyh_77",
2938
- "size-lg": "_size-lg_yzbyh_79",
2939
- mainAction: Dr,
2940
- dropdownToggle: Tr,
2941
- chevron: $r,
2942
- chevronUp: Rr,
2943
- dropdown: Ar,
2944
- dark: Pr,
2945
- section: Mr,
2946
- sectionLabel: Er,
2947
- divider: Gr,
2948
- copiesRow: Hr,
2949
- copiesBtn: Wr,
2950
- copiesValue: jr,
2951
- printerSelect: Fr,
2952
- printerStatus: Or,
2953
- printerDot: Ur,
2954
- "dot-ready": "_dot-ready_yzbyh_271",
2955
- "dot-busy": "_dot-busy_yzbyh_273",
2956
- "dot-offline": "_dot-offline_yzbyh_275",
2957
- "dot-error": "_dot-error_yzbyh_277",
2958
- printerStatusLabel: Yr,
2959
- submitBtn: qr,
2960
- spinner: Kr,
2961
- spin: Vr
2962
- }, sl = ({
2928
+ }, Cl = "_container_yxz96_1", Il = "_buttonGroup_yxz96_19", Ll = "_trigger_yxz96_31", jl = "_triggerDisabled_yxz96_57", zl = "_mainAction_yxz96_151", Dl = "_dropdownToggle_yxz96_175", Tl = "_chevron_yxz96_201", $l = "_chevronUp_yxz96_211", Rl = "_dropdown_yxz96_175", Al = "_dark_yxz96_245", Pl = "_section_yxz96_257", Ml = "_sectionLabel_yxz96_263", El = "_divider_yxz96_283", Gl = "_copiesRow_yxz96_301", Hl = "_copiesBtn_yxz96_311", Wl = "_copiesValue_yxz96_351", Fl = "_printerSelect_yxz96_375", Ol = "_printerStatus_yxz96_415", Ul = "_printerDot_yxz96_429", Yl = "_printerStatusLabel_yxz96_463", ql = "_submitBtn_yxz96_473", Kl = "_spinner_yxz96_515", Vl = "_spin_yxz96_515", j = {
2929
+ container: Cl,
2930
+ buttonGroup: Il,
2931
+ trigger: Ll,
2932
+ triggerDisabled: jl,
2933
+ "variant-primary": "_variant-primary_yxz96_69",
2934
+ "variant-secondary": "_variant-secondary_yxz96_83",
2935
+ "variant-ghost": "_variant-ghost_yxz96_99",
2936
+ "size-sm": "_size-sm_yxz96_117",
2937
+ "size-md": "_size-md_yxz96_127",
2938
+ "size-lg": "_size-lg_yxz96_137",
2939
+ mainAction: zl,
2940
+ dropdownToggle: Dl,
2941
+ chevron: Tl,
2942
+ chevronUp: $l,
2943
+ dropdown: Rl,
2944
+ dark: Al,
2945
+ section: Pl,
2946
+ sectionLabel: Ml,
2947
+ divider: El,
2948
+ copiesRow: Gl,
2949
+ copiesBtn: Hl,
2950
+ copiesValue: Wl,
2951
+ printerSelect: Fl,
2952
+ printerStatus: Ol,
2953
+ printerDot: Ul,
2954
+ "dot-ready": "_dot-ready_yxz96_439",
2955
+ "dot-busy": "_dot-busy_yxz96_445",
2956
+ "dot-offline": "_dot-offline_yxz96_451",
2957
+ "dot-error": "_dot-error_yxz96_457",
2958
+ printerStatusLabel: Yl,
2959
+ submitBtn: ql,
2960
+ spinner: Kl,
2961
+ spin: Vl
2962
+ }, sr = ({
2963
2963
  onPrint: a,
2964
2964
  printers: i = [],
2965
2965
  defaultPrinterId: p,
2966
- defaultCopies: l = 1,
2966
+ defaultCopies: r = 1,
2967
2967
  disabled: k = !1,
2968
- loading: h = !1,
2968
+ loading: _ = !1,
2969
2969
  variant: S = "primary",
2970
2970
  size: b = "md",
2971
- label: g = "Drukuj",
2972
- className: v,
2971
+ label: y = "Drukuj",
2972
+ className: N,
2973
2973
  style: c,
2974
- theme: T = "light"
2974
+ theme: D = "light"
2975
2975
  }) => {
2976
- var P;
2977
- const [N, r] = M(!1), [n, u] = M(l), [m, f] = M(p ?? ((P = i[0]) == null ? void 0 : P.id) ?? ""), D = Fe(null);
2978
- ye(() => {
2979
- if (!N)
2976
+ var A;
2977
+ const [w, l] = P(!1), [n, u] = P(r), [m, f] = P(p ?? ((A = i[0]) == null ? void 0 : A.id) ?? ""), z = Fe(null);
2978
+ ge(() => {
2979
+ if (!w)
2980
2980
  return;
2981
- const _ = (q) => {
2982
- D.current && !D.current.contains(q.target) && r(!1);
2981
+ const h = (q) => {
2982
+ z.current && !z.current.contains(q.target) && l(!1);
2983
2983
  };
2984
- return document.addEventListener("mousedown", _), () => document.removeEventListener("mousedown", _);
2985
- }, [N]);
2986
- const y = $(() => {
2987
- a({ copies: n, printerId: m }), r(!1);
2988
- }, [n, m, a]), x = $(() => u((_) => Math.min(99, _ + 1)), []), I = $(() => u((_) => Math.max(1, _ - 1)), []), E = [z.container, T === "dark" ? z.dark : "", v ?? ""].filter(Boolean).join(" "), W = [
2989
- z.trigger,
2990
- z[`variant-${S}`],
2991
- z[`size-${b}`],
2992
- k || h ? z.triggerDisabled : ""
2984
+ return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
2985
+ }, [w]);
2986
+ const g = T(() => {
2987
+ a({ copies: n, printerId: m }), l(!1);
2988
+ }, [n, m, a]), L = T(() => u((h) => Math.min(99, h + 1)), []), C = T(() => u((h) => Math.max(1, h - 1)), []), M = [j.container, D === "dark" ? j.dark : "", N ?? ""].filter(Boolean).join(" "), H = [
2989
+ j.trigger,
2990
+ j[`variant-${S}`],
2991
+ j[`size-${b}`],
2992
+ k || _ ? j.triggerDisabled : ""
2993
2993
  ].filter(Boolean).join(" ");
2994
- return /* @__PURE__ */ s("div", { ref: D, className: E, style: c, children: [
2995
- /* @__PURE__ */ s("div", { className: z.buttonGroup, children: [
2994
+ return /* @__PURE__ */ s("div", { ref: z, className: M, style: c, children: [
2995
+ /* @__PURE__ */ s("div", { className: j.buttonGroup, children: [
2996
2996
  /* @__PURE__ */ s(
2997
2997
  "button",
2998
2998
  {
2999
- className: `${W} ${z.mainAction}`,
3000
- disabled: k || h,
3001
- onClick: y,
3002
- "aria-label": g,
2999
+ className: `${H} ${j.mainAction}`,
3000
+ disabled: k || _,
3001
+ onClick: g,
3002
+ "aria-label": y,
3003
3003
  children: [
3004
- h ? /* @__PURE__ */ e("span", { className: z.spinner }) : /* @__PURE__ */ e("span", { children: "🖨" }),
3005
- /* @__PURE__ */ e("span", { children: g })
3004
+ _ ? /* @__PURE__ */ e("span", { className: j.spinner }) : /* @__PURE__ */ e("span", { children: "🖨" }),
3005
+ /* @__PURE__ */ e("span", { children: y })
3006
3006
  ]
3007
3007
  }
3008
3008
  ),
3009
3009
  /* @__PURE__ */ e(
3010
3010
  "button",
3011
3011
  {
3012
- className: `${W} ${z.dropdownToggle}`,
3013
- disabled: k || h,
3014
- onClick: () => r((_) => !_),
3012
+ className: `${H} ${j.dropdownToggle}`,
3013
+ disabled: k || _,
3014
+ onClick: () => l((h) => !h),
3015
3015
  "aria-label": "Opcje druku",
3016
- "aria-expanded": N,
3017
- children: /* @__PURE__ */ e("span", { className: `${z.chevron} ${N ? z.chevronUp : ""}`, children: "▾" })
3016
+ "aria-expanded": w,
3017
+ children: /* @__PURE__ */ e("span", { className: `${j.chevron} ${w ? j.chevronUp : ""}`, children: "▾" })
3018
3018
  }
3019
3019
  )
3020
3020
  ] }),
3021
- N && /* @__PURE__ */ s("div", { className: z.dropdown, children: [
3022
- /* @__PURE__ */ s("div", { className: z.section, children: [
3023
- /* @__PURE__ */ e("label", { className: z.sectionLabel, children: "Liczba kopii" }),
3024
- /* @__PURE__ */ s("div", { className: z.copiesRow, children: [
3025
- /* @__PURE__ */ e("button", { className: z.copiesBtn, onClick: I, disabled: n <= 1, children: "−" }),
3026
- /* @__PURE__ */ e("span", { className: z.copiesValue, children: n }),
3027
- /* @__PURE__ */ e("button", { className: z.copiesBtn, onClick: x, disabled: n >= 99, children: "+" })
3021
+ w && /* @__PURE__ */ s("div", { className: j.dropdown, children: [
3022
+ /* @__PURE__ */ s("div", { className: j.section, children: [
3023
+ /* @__PURE__ */ e("label", { className: j.sectionLabel, children: "Liczba kopii" }),
3024
+ /* @__PURE__ */ s("div", { className: j.copiesRow, children: [
3025
+ /* @__PURE__ */ e("button", { className: j.copiesBtn, onClick: C, disabled: n <= 1, children: "−" }),
3026
+ /* @__PURE__ */ e("span", { className: j.copiesValue, children: n }),
3027
+ /* @__PURE__ */ e("button", { className: j.copiesBtn, onClick: L, disabled: n >= 99, children: "+" })
3028
3028
  ] })
3029
3029
  ] }),
3030
- /* @__PURE__ */ e("div", { className: z.divider }),
3030
+ /* @__PURE__ */ e("div", { className: j.divider }),
3031
3031
  i.length > 0 && /* @__PURE__ */ s(Y, { children: [
3032
- /* @__PURE__ */ s("div", { className: z.section, children: [
3033
- /* @__PURE__ */ e("label", { className: z.sectionLabel, children: "Drukarka" }),
3032
+ /* @__PURE__ */ s("div", { className: j.section, children: [
3033
+ /* @__PURE__ */ e("label", { className: j.sectionLabel, children: "Drukarka" }),
3034
3034
  /* @__PURE__ */ e(
3035
3035
  "select",
3036
3036
  {
3037
- className: z.printerSelect,
3037
+ className: j.printerSelect,
3038
3038
  value: m,
3039
- onChange: (_) => f(_.target.value),
3040
- children: i.map((_) => /* @__PURE__ */ s(
3039
+ onChange: (h) => f(h.target.value),
3040
+ children: i.map((h) => /* @__PURE__ */ s(
3041
3041
  "option",
3042
3042
  {
3043
- value: _.id,
3044
- disabled: _.status === "offline" || !_.isOnline && _.status == null,
3043
+ value: h.id,
3044
+ disabled: h.status === "offline" || !h.isOnline && h.status == null,
3045
3045
  children: [
3046
- _.name,
3046
+ h.name,
3047
3047
  " ",
3048
- _.status === "offline" || !_.isOnline && _.status == null ? "(Offline)" : _.status === "busy" ? "(Zajęta)" : ""
3048
+ h.status === "offline" || !h.isOnline && h.status == null ? "(Offline)" : h.status === "busy" ? "(Zajęta)" : ""
3049
3049
  ]
3050
3050
  },
3051
- _.id
3051
+ h.id
3052
3052
  ))
3053
3053
  }
3054
3054
  ),
3055
- i.find((_) => _.id === m) && /* @__PURE__ */ e("div", { className: z.printerStatus, children: (() => {
3056
- const _ = i.find((pe) => pe.id === m), q = _.status ?? (_.isOnline ? "ready" : "offline");
3055
+ i.find((h) => h.id === m) && /* @__PURE__ */ e("div", { className: j.printerStatus, children: (() => {
3056
+ const h = i.find((pe) => pe.id === m), q = h.status ?? (h.isOnline ? "ready" : "offline");
3057
3057
  return /* @__PURE__ */ s(Y, { children: [
3058
- /* @__PURE__ */ e("span", { className: `${z.printerDot} ${z[`dot-${q}`]}` }),
3059
- /* @__PURE__ */ e("span", { className: z.printerStatusLabel, children: q === "ready" ? "Gotowa" : q === "busy" ? "Zajęta" : q === "offline" ? "Offline" : "Błąd" })
3058
+ /* @__PURE__ */ e("span", { className: `${j.printerDot} ${j[`dot-${q}`]}` }),
3059
+ /* @__PURE__ */ e("span", { className: j.printerStatusLabel, children: q === "ready" ? "Gotowa" : q === "busy" ? "Zajęta" : q === "offline" ? "Offline" : "Błąd" })
3060
3060
  ] });
3061
3061
  })() })
3062
3062
  ] }),
3063
- /* @__PURE__ */ e("div", { className: z.divider })
3063
+ /* @__PURE__ */ e("div", { className: j.divider })
3064
3064
  ] }),
3065
- /* @__PURE__ */ e("div", { className: z.section, children: /* @__PURE__ */ e(
3065
+ /* @__PURE__ */ e("div", { className: j.section, children: /* @__PURE__ */ e(
3066
3066
  "button",
3067
3067
  {
3068
- className: z.submitBtn,
3069
- onClick: y,
3070
- disabled: k || h || i.length > 0 && (() => {
3071
- const _ = i.find((q) => q.id === m);
3072
- return _ != null && (_.status === "offline" || !_.isOnline && _.status == null);
3068
+ className: j.submitBtn,
3069
+ onClick: g,
3070
+ disabled: k || _ || i.length > 0 && (() => {
3071
+ const h = i.find((q) => q.id === m);
3072
+ return h != null && (h.status === "offline" || !h.isOnline && h.status == null);
3073
3073
  })(),
3074
- children: h ? "Drukowanie..." : `🖨 Drukuj${n > 1 ? ` (${n} kopie)` : ""}`
3074
+ children: _ ? "Drukowanie..." : `🖨 Drukuj${n > 1 ? ` (${n} kopie)` : ""}`
3075
3075
  }
3076
3076
  ) })
3077
3077
  ] })
3078
3078
  ] });
3079
3079
  };
3080
3080
  export {
3081
- sl as NicePrintButton,
3082
- al as NicePrintPreview,
3083
- nl as NicePrintQueue,
3084
- tl as NiceTemplateBrowser,
3085
- el as NiceTemplateEditor
3081
+ sr as NicePrintButton,
3082
+ ar as NicePrintPreview,
3083
+ nr as NicePrintQueue,
3084
+ tr as NiceTemplateBrowser,
3085
+ er as NiceTemplateEditor
3086
3086
  };