eatopia-ds 0.0.949 → 0.0.951

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/build/index10.js CHANGED
@@ -1,37 +1,115 @@
1
- import { j as n } from "./index24.js";
2
- import Me, { useState as v, useEffect as U, useMemo as M } from "react";
3
- import { StockLeadTime as Ee } from "./index18.js";
4
- import { calculateConsumptionForecast as pe, calculateTotalConsumptionForRange as Pe } from "./index21.js";
5
- import { AlertIcon as We } from "./index23.js";
6
- const be = [1, 2, 3, 7, 10, 15, 30, 60, 90], y = (o) => {
7
- const p = o.getFullYear(), j = String(o.getMonth() + 1).padStart(2, "0"), c = String(o.getDate()).padStart(2, "0");
8
- return `${p}-${j}-${c}`;
9
- }, F = (o) => {
10
- const p = o.split("-").map(Number);
11
- return p.length !== 3 || p.some(Number.isNaN) ? /* @__PURE__ */ new Date(NaN) : new Date(p[0], p[1] - 1, p[2]);
12
- }, Re = () => {
13
- const o = /* @__PURE__ */ new Date();
14
- return o.setDate(o.getDate() + 1), o.setHours(0, 0, 0, 0), y(o);
15
- }, _ = () => {
16
- const o = /* @__PURE__ */ new Date();
17
- return o.setDate(o.getDate() + 1), o.setHours(0, 0, 0, 0), o;
18
- }, xe = (o) => o <= 0 ? 7 : be.reduce(
19
- (p, j) => Math.abs(j - o) < Math.abs(p - o) ? j : p
20
- );
21
- function Oe({
22
- data: o,
23
- onSubmit: p,
24
- onCancel: j,
25
- timelineData: c,
26
- fornecedoresOptions: Le,
27
- marcasOptions: ze,
28
- embalagensOptions: He,
1
+ import { j as t } from "./index24.js";
2
+ import Le, { useState as k, useEffect as Y, useMemo as D } from "react";
3
+ import { StockLeadTime as ze } from "./index18.js";
4
+ import { calculateConsumptionForecast as ye, calculateTotalConsumptionForRange as He } from "./index21.js";
5
+ import { AlertIcon as Ne } from "./index23.js";
6
+ const he = [1, 2, 3, 7, 10, 15, 30, 60, 90], v = (n) => {
7
+ const m = n.getFullYear(), q = String(n.getMonth() + 1).padStart(2, "0"), d = String(n.getDate()).padStart(2, "0");
8
+ return `${m}-${q}-${d}`;
9
+ }, I = (n) => {
10
+ const m = n.split("-").map(Number);
11
+ return m.length !== 3 || m.some(Number.isNaN) ? /* @__PURE__ */ new Date(NaN) : new Date(m[0], m[1] - 1, m[2]);
12
+ }, _e = () => {
13
+ const n = /* @__PURE__ */ new Date();
14
+ return n.setDate(n.getDate() + 1), n.setHours(0, 0, 0, 0), v(n);
15
+ }, A = () => {
16
+ const n = /* @__PURE__ */ new Date();
17
+ return n.setDate(n.getDate() + 1), n.setHours(0, 0, 0, 0), n;
18
+ }, P = (n) => n <= 0 ? 7 : he.reduce(
19
+ (m, q) => Math.abs(q - n) < Math.abs(m - n) ? q : m
20
+ ), Ue = 42, ve = {
21
+ position: "relative",
22
+ height: `${Ue}px`,
23
+ border: "1.5px solid #e2e8f0",
24
+ borderRadius: "10px",
25
+ backgroundColor: "#f8fafc",
26
+ display: "flex",
27
+ alignItems: "center",
28
+ boxSizing: "border-box"
29
+ }, je = {
30
+ position: "absolute",
31
+ inset: 0,
32
+ width: "100%",
33
+ height: "100%",
34
+ border: "none",
35
+ background: "transparent",
36
+ outline: "none",
37
+ fontSize: "14px",
38
+ fontWeight: "500",
39
+ color: "#0f172a",
40
+ fontFamily: "Inter, sans-serif",
41
+ cursor: "pointer",
42
+ boxSizing: "border-box"
43
+ }, W = ({
44
+ children: n,
45
+ ...m
46
+ }) => /* @__PURE__ */ t.jsxs("div", { style: ve, children: [
47
+ /* @__PURE__ */ t.jsx(
48
+ "select",
49
+ {
50
+ ...m,
51
+ style: {
52
+ ...je,
53
+ padding: "0 36px 0 14px",
54
+ appearance: "none",
55
+ WebkitAppearance: "none"
56
+ },
57
+ children: n
58
+ }
59
+ ),
60
+ /* @__PURE__ */ t.jsx(
61
+ "span",
62
+ {
63
+ "aria-hidden": !0,
64
+ style: {
65
+ position: "absolute",
66
+ right: "12px",
67
+ top: "50%",
68
+ transform: "translateY(-50%)",
69
+ pointerEvents: "none",
70
+ color: "#64748b",
71
+ display: "flex",
72
+ alignItems: "center"
73
+ },
74
+ children: /* @__PURE__ */ t.jsx(
75
+ "svg",
76
+ {
77
+ width: "14",
78
+ height: "14",
79
+ viewBox: "0 0 24 24",
80
+ fill: "none",
81
+ stroke: "currentColor",
82
+ strokeWidth: "2.5",
83
+ strokeLinecap: "round",
84
+ strokeLinejoin: "round",
85
+ children: /* @__PURE__ */ t.jsx("polyline", { points: "6 9 12 15 18 9" })
86
+ }
87
+ )
88
+ }
89
+ )
90
+ ] }), Ve = (n) => /* @__PURE__ */ t.jsx("div", { style: ve, children: /* @__PURE__ */ t.jsx(
91
+ "input",
92
+ {
93
+ type: "date",
94
+ ...n,
95
+ style: { ...je, padding: "0 14px" }
96
+ }
97
+ ) });
98
+ function Ze({
99
+ data: n,
100
+ onSubmit: m,
101
+ onCancel: q,
102
+ timelineData: d,
103
+ fornecedoresOptions: Ye,
104
+ marcasOptions: Ae,
105
+ embalagensOptions: Oe,
29
106
  dailyConsumptionAverages: x,
30
- showSuggestionBar: ye = !0,
31
- showLegendTimeline: he = !1
107
+ showSuggestionBar: ke = !0,
108
+ showLegendTimeline: qe = !1,
109
+ initialQtdDays: j
32
110
  }) {
33
- var J, X, Z, ee, te, ne, oe, re, se, ie, ae, le, de, ce, ue, fe;
34
- Me.useEffect(() => {
111
+ var ee, te, ne, oe, re, se, ie, ae, le, ce, de, ue, fe, ge, pe, me;
112
+ Le.useEffect(() => {
35
113
  const e = document.createElement("style");
36
114
  return e.textContent = `
37
115
  .order-form-quantity-input::-webkit-outer-spin-button,
@@ -46,61 +124,61 @@ function Oe({
46
124
  document.head.removeChild(e);
47
125
  };
48
126
  }, []);
49
- const [I, ve] = v(!1);
50
- U(() => {
127
+ const [C, Ce] = k(!1);
128
+ Y(() => {
51
129
  const e = () => {
52
- ve(window.innerWidth <= 768);
130
+ Ce(window.innerWidth <= 768);
53
131
  };
54
132
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
55
133
  }, []);
56
- const V = () => {
57
- if (!(c != null && c.timeline)) return 0;
58
- const { restockSuggestionStart: e, restockSuggestionEnd: s } = c.timeline;
134
+ const O = () => {
135
+ if (!(d != null && d.timeline)) return 0;
136
+ const { restockSuggestionStart: e, restockSuggestionEnd: s } = d.timeline;
59
137
  if (!e || !s) return 0;
60
- const r = new Date(e), l = new Date(s).getTime() - r.getTime(), d = Math.ceil(l / (1e3 * 60 * 60 * 24));
61
- return d > 0 ? d : 0;
62
- }, je = () => {
138
+ const r = new Date(e), l = new Date(s).getTime() - r.getTime(), c = Math.ceil(l / (1e3 * 60 * 60 * 24));
139
+ return c > 0 ? c : 0;
140
+ }, we = () => {
63
141
  var i;
64
- const e = _(), s = (i = c == null ? void 0 : c.timeline) == null ? void 0 : i.stockEndDate;
65
- if (!s) return y(e);
66
- const r = F(s);
67
- return isNaN(r.getTime()) || r < e ? y(e) : y(r);
68
- }, ke = () => xe(V()), g = (() => {
69
- var i, l, d;
70
- const e = (i = o == null ? void 0 : o.fornecedores) == null ? void 0 : i[0];
142
+ const e = A(), s = (i = d == null ? void 0 : d.timeline) == null ? void 0 : i.stockEndDate;
143
+ if (!s) return v(e);
144
+ const r = I(s);
145
+ return isNaN(r.getTime()) || r < e ? v(e) : v(r);
146
+ }, Fe = () => P(O()), Te = () => j != null && j > 0 ? P(j) : Fe(), g = (() => {
147
+ var i, l, c;
148
+ const e = (i = n == null ? void 0 : n.fornecedores) == null ? void 0 : i[0];
71
149
  if (!e) return null;
72
- const s = V();
150
+ const s = O();
73
151
  if (!x || s <= 0) {
74
- const u = (l = e.marcas) == null ? void 0 : l[0], f = (d = u == null ? void 0 : u.embalagens) == null ? void 0 : d[0];
152
+ const u = (l = e.marcas) == null ? void 0 : l[0], f = (c = u == null ? void 0 : u.embalagens) == null ? void 0 : c[0];
75
153
  return u && f ? {
76
154
  marca: u.nome,
77
155
  embalagem: f.label,
78
- quantidade: (o == null ? void 0 : o.qtdPedido) > 0 ? o.qtdPedido : 0,
156
+ quantidade: (n == null ? void 0 : n.qtdPedido) > 0 ? n.qtdPedido : 0,
79
157
  valorUnitario: f.valor_unitario
80
158
  } : null;
81
159
  }
82
160
  let r = null;
83
161
  for (const u of e.marcas || [])
84
162
  for (const f of u.embalagens || []) {
85
- const m = f.quantidade_fornecedor;
86
- if (!(m <= 0))
87
- for (let b = 1; b <= 100; b++) {
88
- const ge = b * m, H = pe({
163
+ const p = f.quantidade_fornecedor;
164
+ if (!(p <= 0))
165
+ for (let h = 1; h <= 100; h++) {
166
+ const xe = h * p, U = ye({
89
167
  dailyAverages: x,
90
168
  startDate: /* @__PURE__ */ new Date(),
91
- totalQuantity: ge
169
+ totalQuantity: xe
92
170
  });
93
- if (H.totalDays >= s) {
94
- const me = b * f.valor_unitario * m, N = H.totalDays - s;
95
- (!r || N < r.daysDifference || N === r.daysDifference && me < r.totalValue) && (r = {
171
+ if (U.totalDays >= s) {
172
+ const be = h * f.valor_unitario * p, V = U.totalDays - s;
173
+ (!r || V < r.daysDifference || V === r.daysDifference && be < r.totalValue) && (r = {
96
174
  marca: u.nome,
97
175
  embalagem: f.label,
98
- quantidade: b,
176
+ quantidade: h,
99
177
  valorUnitario: f.valor_unitario,
100
- totalKg: ge,
101
- totalValue: me,
102
- days: H.totalDays,
103
- daysDifference: N
178
+ totalKg: xe,
179
+ totalValue: be,
180
+ days: U.totalDays,
181
+ daysDifference: V
104
182
  });
105
183
  }
106
184
  }
@@ -111,181 +189,181 @@ function Oe({
111
189
  quantidade: r.quantidade,
112
190
  valorUnitario: r.valorUnitario
113
191
  } : null;
114
- })(), qe = () => {
115
- var i, l, d;
192
+ })(), Se = () => {
193
+ var i, l, c;
116
194
  if (g)
117
195
  return g.valorUnitario;
118
- const e = (i = o == null ? void 0 : o.fornecedores) == null ? void 0 : i[0];
196
+ const e = (i = n == null ? void 0 : n.fornecedores) == null ? void 0 : i[0];
119
197
  if (!e) return 0;
120
198
  const s = (l = e.marcas) == null ? void 0 : l[0];
121
199
  if (!s) return 0;
122
- const r = (d = s.embalagens) == null ? void 0 : d[0];
200
+ const r = (c = s.embalagens) == null ? void 0 : c[0];
123
201
  return (r == null ? void 0 : r.valor_unitario) ?? 0;
124
- }, E = o.unidade_medida ?? "kg", Ce = ((J = o.ultima_compra) == null ? void 0 : J.unidade) ?? o.unidade_medida ?? "kg", [a, Q] = v({
125
- ...o,
126
- qtdPedido: (g == null ? void 0 : g.quantidade) ?? (o == null ? void 0 : o.qtdPedido) ?? 0,
127
- valorTotal: (o == null ? void 0 : o.valorTotal) ?? ((g == null ? void 0 : g.quantidade) ?? (o == null ? void 0 : o.qtdPedido) ?? 0) * qe()
128
- }), [we, Y] = v(
129
- ((Z = (X = o == null ? void 0 : o.fornecedores) == null ? void 0 : X[0]) == null ? void 0 : Z.nome) ?? ""
130
- ), [k, S] = v(
131
- (g == null ? void 0 : g.marca) ?? ((oe = (ne = (te = (ee = o == null ? void 0 : o.fornecedores) == null ? void 0 : ee[0]) == null ? void 0 : te.marcas) == null ? void 0 : ne[0]) == null ? void 0 : oe.nome) ?? ""
132
- ), [w, B] = v(
133
- (g == null ? void 0 : g.embalagem) ?? ((de = (le = (ae = (ie = (se = (re = o == null ? void 0 : o.fornecedores) == null ? void 0 : re[0]) == null ? void 0 : se.marcas) == null ? void 0 : ie[0]) == null ? void 0 : ae.embalagens) == null ? void 0 : le[0]) == null ? void 0 : de.label) ?? ""
134
- ), [P, O] = v(
135
- je
136
- ), [W, A] = v(ke);
137
- U(() => {
138
- var d, u, f;
139
- const e = _(), s = (d = c == null ? void 0 : c.timeline) == null ? void 0 : d.stockEndDate;
202
+ }, R = n.unidade_medida ?? "kg", Ie = ((ee = n.ultima_compra) == null ? void 0 : ee.unidade) ?? n.unidade_medida ?? "kg", [a, $] = k({
203
+ ...n,
204
+ qtdPedido: (g == null ? void 0 : g.quantidade) ?? (n == null ? void 0 : n.qtdPedido) ?? 0,
205
+ valorTotal: (n == null ? void 0 : n.valorTotal) ?? ((g == null ? void 0 : g.quantidade) ?? (n == null ? void 0 : n.qtdPedido) ?? 0) * Se()
206
+ }), [Ee, Q] = k(
207
+ ((ne = (te = n == null ? void 0 : n.fornecedores) == null ? void 0 : te[0]) == null ? void 0 : ne.nome) ?? ""
208
+ ), [w, E] = k(
209
+ (g == null ? void 0 : g.marca) ?? ((ie = (se = (re = (oe = n == null ? void 0 : n.fornecedores) == null ? void 0 : oe[0]) == null ? void 0 : re.marcas) == null ? void 0 : se[0]) == null ? void 0 : ie.nome) ?? ""
210
+ ), [T, B] = k(
211
+ (g == null ? void 0 : g.embalagem) ?? ((fe = (ue = (de = (ce = (le = (ae = n == null ? void 0 : n.fornecedores) == null ? void 0 : ae[0]) == null ? void 0 : le.marcas) == null ? void 0 : ce[0]) == null ? void 0 : de.embalagens) == null ? void 0 : ue[0]) == null ? void 0 : fe.label) ?? ""
212
+ ), [L, G] = k(
213
+ we
214
+ ), [z, K] = k(Te);
215
+ Y(() => {
216
+ var c, u, f;
217
+ const e = A(), s = (c = d == null ? void 0 : d.timeline) == null ? void 0 : c.stockEndDate;
140
218
  let r;
141
219
  if (s) {
142
- const m = F(s);
143
- r = isNaN(m.getTime()) || m < e ? y(e) : y(m);
220
+ const p = I(s);
221
+ r = isNaN(p.getTime()) || p < e ? v(e) : v(p);
144
222
  } else
145
- r = y(e);
223
+ r = v(e);
146
224
  let i = 0;
147
- if ((u = c == null ? void 0 : c.timeline) != null && u.restockSuggestionStart && ((f = c == null ? void 0 : c.timeline) != null && f.restockSuggestionEnd)) {
148
- const m = F(c.timeline.restockSuggestionStart), b = F(c.timeline.restockSuggestionEnd);
149
- !isNaN(m.getTime()) && !isNaN(b.getTime()) && (i = Math.ceil((b.getTime() - m.getTime()) / (1e3 * 60 * 60 * 24)) || 0);
225
+ if ((u = d == null ? void 0 : d.timeline) != null && u.restockSuggestionStart && ((f = d == null ? void 0 : d.timeline) != null && f.restockSuggestionEnd)) {
226
+ const p = I(d.timeline.restockSuggestionStart), h = I(d.timeline.restockSuggestionEnd);
227
+ !isNaN(p.getTime()) && !isNaN(h.getTime()) && (i = Math.ceil((h.getTime() - p.getTime()) / (1e3 * 60 * 60 * 24)) || 0);
150
228
  }
151
- const l = xe(i);
152
- O(r), A(l);
153
- }, [c, o]), U(() => {
229
+ const l = j != null && j > 0 ? P(j) : P(i);
230
+ G(r), K(l);
231
+ }, [d, n, j]), Y(() => {
154
232
  var s, r, i;
155
233
  if (g) return;
156
- const e = (s = o == null ? void 0 : o.fornecedores) == null ? void 0 : s[0];
234
+ const e = (s = n == null ? void 0 : n.fornecedores) == null ? void 0 : s[0];
157
235
  if (e) {
158
- Y(e.nome);
236
+ Q(e.nome);
159
237
  const l = (r = e.marcas) == null ? void 0 : r[0];
160
238
  if (l) {
161
- S(l.nome);
162
- const d = (i = l.embalagens) == null ? void 0 : i[0];
163
- d && B(d.label);
239
+ E(l.nome);
240
+ const c = (i = l.embalagens) == null ? void 0 : i[0];
241
+ c && B(c.label);
164
242
  }
165
243
  }
166
- }, [o, g]);
167
- const D = M(() => {
168
- var l, d, u;
244
+ }, [n, g]);
245
+ const M = D(() => {
246
+ var l, c, u;
169
247
  const e = (l = a.fornecedores) == null ? void 0 : l[0];
170
248
  if (!e) return 0;
171
- const s = (d = e.marcas) == null ? void 0 : d.find((f) => f.nome === k);
249
+ const s = (c = e.marcas) == null ? void 0 : c.find((f) => f.nome === w);
172
250
  if (!s) return 0;
173
251
  const r = (u = s.embalagens) == null ? void 0 : u.find(
174
- (f) => f.label === w
252
+ (f) => f.label === T
175
253
  ), i = (r == null ? void 0 : r.quantidade_fornecedor) ?? 0;
176
254
  return a.qtdPedido * i;
177
255
  }, [
178
256
  a.qtdPedido,
179
257
  a.fornecedores,
180
- k,
181
- w
182
- ]), R = M(() => !x || D <= 0 ? null : pe({
258
+ w,
259
+ T
260
+ ]), H = D(() => !x || M <= 0 ? null : ye({
183
261
  dailyAverages: x,
184
262
  startDate: /* @__PURE__ */ new Date(),
185
- totalQuantity: D
186
- }), [x, D]), q = (R == null ? void 0 : R.totalDays) ?? 0, h = M(() => {
263
+ totalQuantity: M
264
+ }), [x, M]), F = (H == null ? void 0 : H.totalDays) ?? 0, b = D(() => {
187
265
  if (!x) return 0;
188
- const e = _(), s = F(P);
266
+ const e = A(), s = I(L);
189
267
  if (isNaN(s.getTime())) return 0;
190
268
  const r = s < e ? e : s;
191
- return Pe(
269
+ return He(
192
270
  x,
193
271
  r,
194
- W
272
+ z
195
273
  );
196
- }, [x, P, W]), $ = M(() => {
197
- if (c)
274
+ }, [x, L, z]), J = D(() => {
275
+ if (d)
198
276
  return {
199
- ...c,
277
+ ...d,
200
278
  timeline: {
201
- ...c.timeline,
279
+ ...d.timeline,
202
280
  dailyConsumptionAverage: x
203
281
  }
204
282
  };
205
- }, [c, x]);
206
- if (!o)
283
+ }, [d, x]);
284
+ if (!n)
207
285
  return null;
208
- const G = () => {
286
+ const X = () => {
209
287
  var r, i, l;
210
288
  const e = (r = a.fornecedores) == null ? void 0 : r[0];
211
289
  if (!e) return null;
212
- const s = (i = e.marcas) == null ? void 0 : i.find((d) => d.nome === k);
213
- return s ? ((l = s.embalagens) == null ? void 0 : l.find((d) => d.label === w)) ?? null : null;
214
- }, L = () => {
290
+ const s = (i = e.marcas) == null ? void 0 : i.find((c) => c.nome === w);
291
+ return s ? ((l = s.embalagens) == null ? void 0 : l.find((c) => c.label === T)) ?? null : null;
292
+ }, N = () => {
215
293
  var e;
216
- return ((e = G()) == null ? void 0 : e.valor_unitario) ?? 0;
217
- }, K = (e) => {
294
+ return ((e = X()) == null ? void 0 : e.valor_unitario) ?? 0;
295
+ }, Z = (e) => {
218
296
  const s = Number(e).toFixed(2), [r, i] = s.split(".");
219
297
  return `R$ ${r.replace(
220
298
  /\B(?=(\d{3})+(?!\d))/g,
221
299
  "."
222
300
  )},${i}`;
223
- }, C = () => {
301
+ }, y = () => {
224
302
  var e;
225
- return ((e = G()) == null ? void 0 : e.quantidade_fornecedor) ?? 0;
226
- }, T = (e) => {
227
- const s = L(), r = e * s;
228
- Q((i) => ({
303
+ return ((e = X()) == null ? void 0 : e.quantidade_fornecedor) ?? 0;
304
+ }, S = (e) => {
305
+ const s = N(), r = e * s;
306
+ $((i) => ({
229
307
  ...i,
230
308
  qtdPedido: e,
231
309
  valorTotal: r
232
310
  }));
233
- }, z = (e) => {
234
- var d, u, f;
311
+ }, _ = (e) => {
312
+ var c, u, f;
235
313
  B(e);
236
- const s = (d = a.fornecedores) == null ? void 0 : d[0];
314
+ const s = (c = a.fornecedores) == null ? void 0 : c[0];
237
315
  if (!s) return;
238
- const r = (u = s.marcas) == null ? void 0 : u.find((m) => m.nome === k);
316
+ const r = (u = s.marcas) == null ? void 0 : u.find((p) => p.nome === w);
239
317
  if (!r) return;
240
- const i = (f = r.embalagens) == null ? void 0 : f.find((m) => m.label === e);
318
+ const i = (f = r.embalagens) == null ? void 0 : f.find((p) => p.label === e);
241
319
  if (!i) return;
242
320
  const l = a.qtdPedido * (i.valor_unitario ?? 0);
243
- Q((m) => ({
244
- ...m,
321
+ $((p) => ({
322
+ ...p,
245
323
  valorTotal: l
246
324
  }));
247
- }, Te = () => {
325
+ }, Be = () => {
248
326
  var s;
249
327
  const e = (s = a.fornecedores) == null ? void 0 : s[0];
250
328
  return e ? e.marcas || [] : [];
251
- }, Fe = () => {
329
+ }, Me = () => {
252
330
  var r, i;
253
331
  const e = (r = a.fornecedores) == null ? void 0 : r[0];
254
332
  if (!e) return [];
255
- const s = (i = e.marcas) == null ? void 0 : i.find((l) => l.nome === k);
333
+ const s = (i = e.marcas) == null ? void 0 : i.find((l) => l.nome === w);
256
334
  return s ? s.embalagens || [] : [];
257
- }, Ie = (e) => {
258
- var l, d;
259
- S(e);
335
+ }, De = (e) => {
336
+ var l, c;
337
+ E(e);
260
338
  const s = (l = a.fornecedores) == null ? void 0 : l[0];
261
339
  if (!s) return;
262
- const r = (d = s.marcas) == null ? void 0 : d.find((u) => u.nome === e);
340
+ const r = (c = s.marcas) == null ? void 0 : c.find((u) => u.nome === e);
263
341
  if (!r || !r.embalagens || r.embalagens.length === 0) return;
264
342
  const i = r.embalagens[0];
265
- z(i.label);
266
- }, Se = (e) => {
267
- var l, d, u;
268
- Y(e);
343
+ _(i.label);
344
+ }, Pe = (e) => {
345
+ var l, c, u;
346
+ Q(e);
269
347
  const s = (l = a.fornecedores) == null ? void 0 : l.find(
270
348
  (f) => f.nome === e
271
349
  );
272
350
  if (!s) return;
273
- const r = (d = s.marcas) == null ? void 0 : d[0];
351
+ const r = (c = s.marcas) == null ? void 0 : c[0];
274
352
  if (!r) {
275
- S(""), B("");
353
+ E(""), B("");
276
354
  return;
277
355
  }
278
- S(r.nome);
356
+ E(r.nome);
279
357
  const i = (u = r.embalagens) == null ? void 0 : u[0];
280
- i ? z(i.label) : B("");
281
- }, Be = (e) => {
282
- e.preventDefault(), p(a);
283
- }, De = () => {
284
- const e = C();
285
- if (e <= 0 || h <= 0) return;
286
- const s = Math.ceil(h / e);
287
- T(s);
288
- }, t = {
358
+ i ? _(i.label) : B("");
359
+ }, We = (e) => {
360
+ e.preventDefault(), m(a);
361
+ }, Re = () => {
362
+ const e = y();
363
+ if (e <= 0 || b <= 0) return;
364
+ const s = Math.ceil(b / e);
365
+ S(s);
366
+ }, o = {
289
367
  container: {
290
368
  display: "flex",
291
369
  flexDirection: "column",
@@ -360,64 +438,6 @@ function Oe({
360
438
  color: "#111827",
361
439
  fontFamily: "Inter, sans-serif"
362
440
  },
363
- select: {
364
- height: "36px",
365
- padding: "6px 10px",
366
- border: "1px solid #d1d5db",
367
- borderRadius: "6px",
368
- fontSize: "14px",
369
- backgroundColor: "white",
370
- color: "#374151",
371
- cursor: "pointer",
372
- outline: "none",
373
- fontFamily: "Inter, sans-serif",
374
- boxSizing: "border-box",
375
- lineHeight: "1"
376
- },
377
- dateInput: {
378
- height: "36px",
379
- padding: "6px 10px",
380
- border: "1px solid #d1d5db",
381
- borderRadius: "6px",
382
- fontSize: "14px",
383
- backgroundColor: "white",
384
- color: "#374151",
385
- outline: "none",
386
- fontFamily: "Inter, sans-serif",
387
- boxSizing: "border-box",
388
- lineHeight: "1"
389
- },
390
- rangeTotal: {
391
- fontSize: "20px",
392
- fontWeight: "700",
393
- color: "#111827",
394
- fontFamily: "Inter, sans-serif",
395
- display: "flex",
396
- alignItems: "center"
397
- },
398
- addConsumoButton: {
399
- display: "flex",
400
- alignItems: "center",
401
- justifyContent: "center",
402
- width: "28px",
403
- height: "28px",
404
- minWidth: "28px",
405
- borderRadius: "6px",
406
- border: "1px solid #9ca3af",
407
- backgroundColor: "#e5e7eb",
408
- color: "#374151",
409
- fontSize: "16px",
410
- fontWeight: "600",
411
- cursor: "pointer",
412
- transition: "all 0.2s",
413
- fontFamily: "Inter, sans-serif"
414
- },
415
- addConsumoButtonDisabled: {
416
- opacity: 0.5,
417
- cursor: "not-allowed",
418
- backgroundColor: "#d1d5db",
419
- borderColor: "#9ca3af"
420
- },
421
441
  // Estilos da seção de pedido (estilo calculadora)
422
442
  orderSectionContainer: {
423
443
  backgroundColor: "#f5f5f5",
@@ -552,10 +572,10 @@ function Oe({
552
572
  backgroundColor: "#DC2626"
553
573
  }
554
574
  };
555
- return /* @__PURE__ */ n.jsxs("form", { onSubmit: Be, style: t.container, children: [
556
- /* @__PURE__ */ n.jsxs("div", { style: t.header, children: [
557
- /* @__PURE__ */ n.jsx("h2", { style: t.itemTitle, children: a.nome }),
558
- /* @__PURE__ */ n.jsx("div", { style: t.valorUnitario, children: /* @__PURE__ */ n.jsx(
575
+ return /* @__PURE__ */ t.jsxs("form", { onSubmit: We, style: o.container, children: [
576
+ /* @__PURE__ */ t.jsxs("div", { style: o.header, children: [
577
+ /* @__PURE__ */ t.jsx("h2", { style: o.itemTitle, children: a.nome }),
578
+ /* @__PURE__ */ t.jsx("div", { style: o.valorUnitario, children: /* @__PURE__ */ t.jsx(
559
579
  "div",
560
580
  {
561
581
  style: {
@@ -566,11 +586,11 @@ function Oe({
566
586
  backgroundColor: "#FF4E00",
567
587
  fontWeight: "600"
568
588
  },
569
- children: K(L())
589
+ children: Z(N())
570
590
  }
571
591
  ) })
572
592
  ] }),
573
- /* @__PURE__ */ n.jsxs(
593
+ /* @__PURE__ */ t.jsxs(
574
594
  "div",
575
595
  {
576
596
  style: {
@@ -580,182 +600,227 @@ function Oe({
580
600
  flexDirection: "column"
581
601
  },
582
602
  children: [
583
- /* @__PURE__ */ n.jsxs("div", { style: t.infoRow, children: [
584
- /* @__PURE__ */ n.jsxs("div", { style: t.infoText, children: [
585
- /* @__PURE__ */ n.jsx(We, { width: 20, height: 20 }),
603
+ /* @__PURE__ */ t.jsxs("div", { style: o.infoRow, children: [
604
+ /* @__PURE__ */ t.jsxs("div", { style: o.infoText, children: [
605
+ /* @__PURE__ */ t.jsx(Ne, { width: 20, height: 20 }),
586
606
  "Última compra ",
587
- (ce = a.ultima_compra) == null ? void 0 : ce.data
607
+ (ge = a.ultima_compra) == null ? void 0 : ge.data
588
608
  ] }),
589
- /* @__PURE__ */ n.jsxs("div", { style: t.infoValue, children: [
590
- Number(((ue = a.ultima_compra) == null ? void 0 : ue.quantidade) ?? 0).toFixed(2),
609
+ /* @__PURE__ */ t.jsxs("div", { style: o.infoValue, children: [
610
+ Number(((pe = a.ultima_compra) == null ? void 0 : pe.quantidade) ?? 0).toFixed(2),
591
611
  " ",
592
- Ce.toUpperCase()
612
+ Ie.toUpperCase()
593
613
  ] })
594
614
  ] }),
595
- /* @__PURE__ */ n.jsxs("div", { style: t.formGrid, children: [
596
- /* @__PURE__ */ n.jsxs("div", { style: t.formField, children: [
597
- /* @__PURE__ */ n.jsx("label", { style: t.label, children: "Fornecedores:" }),
598
- /* @__PURE__ */ n.jsx(
599
- "select",
615
+ /* @__PURE__ */ t.jsxs("div", { style: o.formGrid, children: [
616
+ /* @__PURE__ */ t.jsxs("div", { style: o.formField, children: [
617
+ /* @__PURE__ */ t.jsx("label", { style: o.label, children: "Fornecedores:" }),
618
+ /* @__PURE__ */ t.jsx(
619
+ W,
600
620
  {
601
- value: we,
602
- onChange: (e) => Se(e.target.value),
603
- style: t.select,
604
- children: (fe = a.fornecedores) == null ? void 0 : fe.map((e) => /* @__PURE__ */ n.jsx("option", { value: e.nome, children: e.nome }, e.nome))
621
+ value: Ee,
622
+ onChange: (e) => Pe(e.target.value),
623
+ children: (me = a.fornecedores) == null ? void 0 : me.map((e) => /* @__PURE__ */ t.jsx("option", { value: e.nome, children: e.nome }, e.nome))
605
624
  }
606
625
  )
607
626
  ] }),
608
- /* @__PURE__ */ n.jsxs("div", { style: t.formField, children: [
609
- /* @__PURE__ */ n.jsx("label", { style: t.label, children: "Marcas:" }),
610
- /* @__PURE__ */ n.jsx(
611
- "select",
627
+ /* @__PURE__ */ t.jsxs("div", { style: o.formField, children: [
628
+ /* @__PURE__ */ t.jsx("label", { style: o.label, children: "Marcas:" }),
629
+ /* @__PURE__ */ t.jsx(
630
+ W,
612
631
  {
613
- value: k,
614
- onChange: (e) => Ie(e.target.value),
615
- style: t.select,
616
- children: Te().map((e) => /* @__PURE__ */ n.jsx("option", { value: e.nome, children: e.nome }, e.nome))
632
+ value: w,
633
+ onChange: (e) => De(e.target.value),
634
+ children: Be().map((e) => /* @__PURE__ */ t.jsx("option", { value: e.nome, children: e.nome }, e.nome))
617
635
  }
618
636
  )
619
637
  ] }),
620
- /* @__PURE__ */ n.jsxs("div", { style: t.formField, children: [
621
- /* @__PURE__ */ n.jsx("label", { style: t.label, children: "Embalagem:" }),
622
- /* @__PURE__ */ n.jsx(
623
- "select",
638
+ /* @__PURE__ */ t.jsxs("div", { style: o.formField, children: [
639
+ /* @__PURE__ */ t.jsx("label", { style: o.label, children: "Embalagem:" }),
640
+ /* @__PURE__ */ t.jsx(
641
+ W,
624
642
  {
625
- value: w,
626
- onChange: (e) => z(e.target.value),
627
- style: t.select,
628
- children: Fe().map((e) => /* @__PURE__ */ n.jsx("option", { value: e.label, children: e.label }, e.label))
643
+ value: T,
644
+ onChange: (e) => _(e.target.value),
645
+ children: Me().map((e) => /* @__PURE__ */ t.jsx("option", { value: e.label, children: e.label }, e.label))
629
646
  }
630
647
  )
631
648
  ] })
632
649
  ] }),
633
- $ && /* @__PURE__ */ n.jsx("div", { style: { marginTop: "8px", marginBottom: "8px" }, children: /* @__PURE__ */ n.jsx(
634
- Ee,
650
+ J && /* @__PURE__ */ t.jsx("div", { style: { marginTop: "8px", marginBottom: "8px" }, children: /* @__PURE__ */ t.jsx(
651
+ ze,
635
652
  {
636
- data: $,
653
+ data: J,
637
654
  controls: !0,
638
- showLegend: he,
655
+ showLegend: qe,
639
656
  size: "sm",
640
- showSuggestionBar: ye,
641
- unitLabel: E,
642
- onAddSuggestedWeight: (e) => T(e),
643
- selectedQty: D,
644
- selectedQtyDays: q
657
+ showSuggestionBar: ke,
658
+ unitLabel: R,
659
+ onAddSuggestedWeight: (e) => S(e),
660
+ selectedQty: M,
661
+ selectedQtyDays: F
645
662
  }
646
663
  ) }),
647
- /* @__PURE__ */ n.jsxs(
664
+ /* @__PURE__ */ t.jsxs(
648
665
  "div",
649
666
  {
650
667
  style: {
651
- ...t.formGrid,
668
+ display: "grid",
669
+ gridTemplateColumns: C ? "1fr 1fr" : "1fr 1fr 1fr",
670
+ gap: "16px",
652
671
  marginTop: "8px",
653
672
  alignItems: "flex-start"
654
673
  },
655
674
  children: [
656
- /* @__PURE__ */ n.jsxs("div", { style: t.formField, children: [
657
- /* @__PURE__ */ n.jsx("label", { style: t.label, children: "Data inicial" }),
658
- /* @__PURE__ */ n.jsx(
659
- "input",
675
+ /* @__PURE__ */ t.jsxs("div", { style: o.formField, children: [
676
+ /* @__PURE__ */ t.jsx("label", { style: o.label, children: "Data inicial" }),
677
+ /* @__PURE__ */ t.jsx(
678
+ Ve,
660
679
  {
661
- type: "date",
662
- value: P,
663
- min: Re(),
664
- onChange: (e) => O(e.target.value),
665
- style: t.dateInput,
680
+ value: L,
681
+ min: _e(),
682
+ onChange: (e) => G(e.target.value),
666
683
  "aria-label": "Data inicial"
667
684
  }
668
685
  )
669
686
  ] }),
670
- /* @__PURE__ */ n.jsxs("div", { style: t.formField, children: [
671
- /* @__PURE__ */ n.jsx("label", { style: t.label, children: "Quantos dias?" }),
672
- /* @__PURE__ */ n.jsx(
673
- "select",
687
+ /* @__PURE__ */ t.jsxs("div", { style: o.formField, children: [
688
+ /* @__PURE__ */ t.jsx("label", { style: o.label, children: "Quantos dias?" }),
689
+ /* @__PURE__ */ t.jsx(
690
+ W,
674
691
  {
675
- value: W,
676
- onChange: (e) => A(Number(e.target.value)),
677
- style: t.select,
692
+ value: z,
693
+ onChange: (e) => K(Number(e.target.value)),
678
694
  "aria-label": "Quantos dias?",
679
- children: be.map((e) => /* @__PURE__ */ n.jsx("option", { value: e, children: e }, e))
695
+ children: he.map((e) => /* @__PURE__ */ t.jsx("option", { value: e, children: e }, e))
680
696
  }
681
697
  )
682
698
  ] }),
683
- /* @__PURE__ */ n.jsxs("div", { style: t.formField, children: [
684
- /* @__PURE__ */ n.jsx("label", { style: t.label, children: "Consumo previsto" }),
685
- /* @__PURE__ */ n.jsxs(
686
- "div",
687
- {
688
- style: {
689
- display: "flex",
690
- alignItems: "center",
691
- gap: "8px"
692
- },
693
- children: [
694
- /* @__PURE__ */ n.jsxs("div", { style: t.rangeTotal, children: [
695
- h.toFixed(2),
696
- " ",
697
- E
698
- ] }),
699
- /* @__PURE__ */ n.jsx(
700
- "button",
701
- {
702
- type: "button",
703
- onClick: De,
704
- disabled: h <= 0 || C() <= 0,
705
- style: {
706
- ...t.addConsumoButton,
707
- ...h <= 0 || C() <= 0 ? t.addConsumoButtonDisabled : {}
708
- },
709
- onMouseEnter: (e) => {
710
- h > 0 && C() > 0 && (e.currentTarget.style.backgroundColor = "#d1d5db");
711
- },
712
- onMouseLeave: (e) => {
713
- h > 0 && C() > 0 && (e.currentTarget.style.backgroundColor = "#e5e7eb");
714
- },
715
- "aria-label": "Definir quantidade pelo consumo previsto",
716
- children: "↻"
717
- }
718
- )
719
- ]
720
- }
721
- )
722
- ] })
699
+ /* @__PURE__ */ t.jsxs(
700
+ "div",
701
+ {
702
+ style: {
703
+ ...o.formField,
704
+ ...C ? { gridColumn: "1 / -1" } : {}
705
+ },
706
+ children: [
707
+ /* @__PURE__ */ t.jsx("label", { style: o.label, children: "Consumo previsto" }),
708
+ /* @__PURE__ */ t.jsxs(
709
+ "div",
710
+ {
711
+ style: {
712
+ display: "flex",
713
+ alignItems: "center",
714
+ justifyContent: "space-between",
715
+ padding: "8px 14px",
716
+ backgroundColor: "#f8fafc",
717
+ border: "1.5px solid #e2e8f0",
718
+ borderRadius: "10px",
719
+ height: "42px"
720
+ },
721
+ children: [
722
+ /* @__PURE__ */ t.jsxs(
723
+ "span",
724
+ {
725
+ style: {
726
+ fontSize: "18px",
727
+ fontWeight: "700",
728
+ color: "#0f172a",
729
+ fontFamily: "Inter, sans-serif",
730
+ letterSpacing: "-0.3px"
731
+ },
732
+ children: [
733
+ b.toFixed(2),
734
+ " ",
735
+ /* @__PURE__ */ t.jsx(
736
+ "span",
737
+ {
738
+ style: {
739
+ fontSize: "13px",
740
+ fontWeight: "500",
741
+ color: "#64748b"
742
+ },
743
+ children: R
744
+ }
745
+ )
746
+ ]
747
+ }
748
+ ),
749
+ /* @__PURE__ */ t.jsx(
750
+ "button",
751
+ {
752
+ type: "button",
753
+ onClick: Re,
754
+ disabled: b <= 0 || y() <= 0,
755
+ style: {
756
+ display: "flex",
757
+ alignItems: "center",
758
+ justifyContent: "center",
759
+ width: "30px",
760
+ height: "30px",
761
+ minWidth: "30px",
762
+ borderRadius: "8px",
763
+ border: "none",
764
+ backgroundColor: b > 0 && y() > 0 ? "#FF4E00" : "#e5e7eb",
765
+ color: b > 0 && y() > 0 ? "white" : "#9ca3af",
766
+ fontSize: "16px",
767
+ cursor: b > 0 && y() > 0 ? "pointer" : "not-allowed",
768
+ opacity: b <= 0 || y() <= 0 ? 0.5 : 1,
769
+ transition: "all 0.2s",
770
+ fontFamily: "Inter, sans-serif"
771
+ },
772
+ onMouseEnter: (e) => {
773
+ b > 0 && y() > 0 && (e.currentTarget.style.backgroundColor = "#e04400");
774
+ },
775
+ onMouseLeave: (e) => {
776
+ b > 0 && y() > 0 && (e.currentTarget.style.backgroundColor = "#FF4E00");
777
+ },
778
+ "aria-label": "Definir quantidade pelo consumo previsto",
779
+ children: "↻"
780
+ }
781
+ )
782
+ ]
783
+ }
784
+ )
785
+ ]
786
+ }
787
+ )
723
788
  ]
724
789
  }
725
790
  ),
726
- /* @__PURE__ */ n.jsxs("div", { style: t.orderSectionContainer, children: [
727
- /* @__PURE__ */ n.jsxs("div", { style: t.quantityRow, children: [
728
- /* @__PURE__ */ n.jsx(
791
+ /* @__PURE__ */ t.jsxs("div", { style: o.orderSectionContainer, children: [
792
+ /* @__PURE__ */ t.jsxs("div", { style: o.quantityRow, children: [
793
+ /* @__PURE__ */ t.jsx(
729
794
  "button",
730
795
  {
731
796
  type: "button",
732
797
  style: {
733
- ...t.quantityButton,
734
- ...a.qtdPedido <= 0 ? t.quantityButtonDisabled : {}
798
+ ...o.quantityButton,
799
+ ...a.qtdPedido <= 0 ? o.quantityButtonDisabled : {}
735
800
  },
736
- onClick: () => T(Math.max(0, a.qtdPedido - 1)),
801
+ onClick: () => S(Math.max(0, a.qtdPedido - 1)),
737
802
  onMouseEnter: (e) => {
738
- a.qtdPedido > 0 && (e.currentTarget.style.background = t.quantityButtonHover.background, e.currentTarget.style.transform = t.quantityButtonHover.transform);
803
+ a.qtdPedido > 0 && (e.currentTarget.style.background = o.quantityButtonHover.background, e.currentTarget.style.transform = o.quantityButtonHover.transform);
739
804
  },
740
805
  onMouseLeave: (e) => {
741
- e.currentTarget.style.background = t.quantityButton.background, e.currentTarget.style.transform = "";
806
+ e.currentTarget.style.background = o.quantityButton.background, e.currentTarget.style.transform = "";
742
807
  },
743
808
  onMouseDown: (e) => {
744
- a.qtdPedido > 0 && (e.currentTarget.style.background = t.quantityButtonActive.background, e.currentTarget.style.transform = t.quantityButtonActive.transform);
809
+ a.qtdPedido > 0 && (e.currentTarget.style.background = o.quantityButtonActive.background, e.currentTarget.style.transform = o.quantityButtonActive.transform);
745
810
  },
746
811
  onMouseUp: (e) => {
747
- a.qtdPedido > 0 && (e.currentTarget.style.background = t.quantityButtonHover.background, e.currentTarget.style.transform = t.quantityButtonHover.transform);
812
+ a.qtdPedido > 0 && (e.currentTarget.style.background = o.quantityButtonHover.background, e.currentTarget.style.transform = o.quantityButtonHover.transform);
748
813
  },
749
814
  disabled: a.qtdPedido <= 0,
750
815
  "aria-label": "Diminuir quantidade",
751
- children: /* @__PURE__ */ n.jsx(
816
+ children: /* @__PURE__ */ t.jsx(
752
817
  "svg",
753
818
  {
754
819
  style: { width: "24px", height: "24px" },
755
820
  fill: "none",
756
821
  viewBox: "0 0 24 24",
757
822
  stroke: "#000",
758
- children: /* @__PURE__ */ n.jsx(
823
+ children: /* @__PURE__ */ t.jsx(
759
824
  "path",
760
825
  {
761
826
  strokeLinecap: "round",
@@ -768,50 +833,50 @@ function Oe({
768
833
  )
769
834
  }
770
835
  ),
771
- /* @__PURE__ */ n.jsxs("div", { style: t.quantityInputContainer, children: [
772
- /* @__PURE__ */ n.jsx(
836
+ /* @__PURE__ */ t.jsxs("div", { style: o.quantityInputContainer, children: [
837
+ /* @__PURE__ */ t.jsx(
773
838
  "input",
774
839
  {
775
840
  type: "number",
776
841
  value: a.qtdPedido,
777
- onChange: (e) => T(
842
+ onChange: (e) => S(
778
843
  Math.max(0, parseInt(e.target.value) || 0)
779
844
  ),
780
- style: t.quantityInput,
845
+ style: o.quantityInput,
781
846
  className: "order-form-quantity-input",
782
847
  min: "0",
783
848
  "aria-label": "Quantidade"
784
849
  }
785
850
  ),
786
- /* @__PURE__ */ n.jsx("span", { style: t.quantityLabel, children: w || "unidades" })
851
+ /* @__PURE__ */ t.jsx("span", { style: o.quantityLabel, children: T || "unidades" })
787
852
  ] }),
788
- /* @__PURE__ */ n.jsx(
853
+ /* @__PURE__ */ t.jsx(
789
854
  "button",
790
855
  {
791
856
  type: "button",
792
- style: t.quantityButton,
793
- onClick: () => T(a.qtdPedido + 1),
857
+ style: o.quantityButton,
858
+ onClick: () => S(a.qtdPedido + 1),
794
859
  onMouseEnter: (e) => {
795
- e.currentTarget.style.background = t.quantityButtonHover.background, e.currentTarget.style.transform = t.quantityButtonHover.transform;
860
+ e.currentTarget.style.background = o.quantityButtonHover.background, e.currentTarget.style.transform = o.quantityButtonHover.transform;
796
861
  },
797
862
  onMouseLeave: (e) => {
798
- e.currentTarget.style.background = t.quantityButton.background, e.currentTarget.style.transform = "";
863
+ e.currentTarget.style.background = o.quantityButton.background, e.currentTarget.style.transform = "";
799
864
  },
800
865
  onMouseDown: (e) => {
801
- e.currentTarget.style.background = t.quantityButtonActive.background, e.currentTarget.style.transform = t.quantityButtonActive.transform;
866
+ e.currentTarget.style.background = o.quantityButtonActive.background, e.currentTarget.style.transform = o.quantityButtonActive.transform;
802
867
  },
803
868
  onMouseUp: (e) => {
804
- e.currentTarget.style.background = t.quantityButtonHover.background, e.currentTarget.style.transform = t.quantityButtonHover.transform;
869
+ e.currentTarget.style.background = o.quantityButtonHover.background, e.currentTarget.style.transform = o.quantityButtonHover.transform;
805
870
  },
806
871
  "aria-label": "Aumentar quantidade",
807
- children: /* @__PURE__ */ n.jsx(
872
+ children: /* @__PURE__ */ t.jsx(
808
873
  "svg",
809
874
  {
810
875
  style: { width: "24px", height: "24px" },
811
876
  fill: "none",
812
877
  viewBox: "0 0 24 24",
813
878
  stroke: "#FF4E00",
814
- children: /* @__PURE__ */ n.jsx(
879
+ children: /* @__PURE__ */ t.jsx(
815
880
  "path",
816
881
  {
817
882
  strokeLinecap: "round",
@@ -825,61 +890,61 @@ function Oe({
825
890
  }
826
891
  )
827
892
  ] }),
828
- /* @__PURE__ */ n.jsxs(
893
+ /* @__PURE__ */ t.jsxs(
829
894
  "div",
830
895
  {
831
896
  style: {
832
- ...t.totalsRow,
833
- ...I ? {
897
+ ...o.totalsRow,
898
+ ...C ? {
834
899
  flexDirection: "column",
835
900
  gap: "12px",
836
901
  alignItems: "stretch"
837
902
  } : {}
838
903
  },
839
904
  children: [
840
- /* @__PURE__ */ n.jsxs(
905
+ /* @__PURE__ */ t.jsxs(
841
906
  "div",
842
907
  {
843
908
  style: {
844
- ...t.totalItem,
845
- ...I ? { justifyContent: "space-between", width: "100%" } : {}
909
+ ...o.totalItem,
910
+ ...C ? { justifyContent: "space-between", width: "100%" } : {}
846
911
  },
847
912
  children: [
848
- /* @__PURE__ */ n.jsx("span", { style: t.totalLabel, children: "Total:" }),
849
- /* @__PURE__ */ n.jsxs("span", { style: t.totalValue, children: [
850
- (a.qtdPedido * C()).toFixed(2),
913
+ /* @__PURE__ */ t.jsx("span", { style: o.totalLabel, children: "Total:" }),
914
+ /* @__PURE__ */ t.jsxs("span", { style: o.totalValue, children: [
915
+ (a.qtdPedido * y()).toFixed(2),
851
916
  " ",
852
- E
917
+ R
853
918
  ] })
854
919
  ]
855
920
  }
856
921
  ),
857
- /* @__PURE__ */ n.jsxs(
922
+ /* @__PURE__ */ t.jsxs(
858
923
  "div",
859
924
  {
860
925
  style: {
861
- ...t.totalItem,
862
- ...I ? { justifyContent: "space-between", width: "100%" } : {}
926
+ ...o.totalItem,
927
+ ...C ? { justifyContent: "space-between", width: "100%" } : {}
863
928
  },
864
929
  children: [
865
- /* @__PURE__ */ n.jsx("span", { style: t.totalLabel, children: "Valor:" }),
866
- /* @__PURE__ */ n.jsx("span", { style: t.totalValueHighlight, children: K(a.qtdPedido * L()) })
930
+ /* @__PURE__ */ t.jsx("span", { style: o.totalLabel, children: "Valor:" }),
931
+ /* @__PURE__ */ t.jsx("span", { style: o.totalValueHighlight, children: Z(a.qtdPedido * N()) })
867
932
  ]
868
933
  }
869
934
  ),
870
- q > 0 && /* @__PURE__ */ n.jsxs(
935
+ F > 0 && /* @__PURE__ */ t.jsxs(
871
936
  "div",
872
937
  {
873
938
  style: {
874
- ...t.totalItem,
875
- ...I ? { justifyContent: "space-between", width: "100%" } : {}
939
+ ...o.totalItem,
940
+ ...C ? { justifyContent: "space-between", width: "100%" } : {}
876
941
  },
877
942
  children: [
878
- /* @__PURE__ */ n.jsx("span", { style: t.totalLabel, children: "Duração:" }),
879
- /* @__PURE__ */ n.jsxs("span", { style: t.totalValue, children: [
880
- q % 1 === 0 ? q.toString() : q.toFixed(1),
943
+ /* @__PURE__ */ t.jsx("span", { style: o.totalLabel, children: "Duração:" }),
944
+ /* @__PURE__ */ t.jsxs("span", { style: o.totalValue, children: [
945
+ F % 1 === 0 ? F.toString() : F.toFixed(1),
881
946
  " ",
882
- q === 1 ? "dia" : "dias"
947
+ F === 1 ? "dia" : "dias"
883
948
  ] })
884
949
  ]
885
950
  }
@@ -888,37 +953,37 @@ function Oe({
888
953
  }
889
954
  )
890
955
  ] }),
891
- /* @__PURE__ */ n.jsxs("div", { style: t.buttons, children: [
892
- /* @__PURE__ */ n.jsx(
956
+ /* @__PURE__ */ t.jsxs("div", { style: o.buttons, children: [
957
+ /* @__PURE__ */ t.jsx(
893
958
  "button",
894
959
  {
895
960
  type: "submit",
896
961
  disabled: a.qtdPedido <= 0,
897
962
  style: {
898
- ...t.button,
899
- ...t.addButton,
900
- ...a.qtdPedido <= 0 ? t.addButtonDisabled : {}
963
+ ...o.button,
964
+ ...o.addButton,
965
+ ...a.qtdPedido <= 0 ? o.addButtonDisabled : {}
901
966
  },
902
967
  onMouseEnter: (e) => {
903
- a.qtdPedido > 0 && (e.currentTarget.style.backgroundColor = t.addButtonHover.backgroundColor);
968
+ a.qtdPedido > 0 && (e.currentTarget.style.backgroundColor = o.addButtonHover.backgroundColor);
904
969
  },
905
970
  onMouseLeave: (e) => {
906
- a.qtdPedido > 0 && (e.currentTarget.style.backgroundColor = t.addButton.backgroundColor);
971
+ a.qtdPedido > 0 && (e.currentTarget.style.backgroundColor = o.addButton.backgroundColor);
907
972
  },
908
973
  children: "Adicionar"
909
974
  }
910
975
  ),
911
- /* @__PURE__ */ n.jsx(
976
+ /* @__PURE__ */ t.jsx(
912
977
  "button",
913
978
  {
914
979
  type: "button",
915
- style: { ...t.button, ...t.cancelButton },
916
- onClick: j,
980
+ style: { ...o.button, ...o.cancelButton },
981
+ onClick: q,
917
982
  onMouseEnter: (e) => {
918
- e.currentTarget.style.backgroundColor = t.cancelButtonHover.backgroundColor;
983
+ e.currentTarget.style.backgroundColor = o.cancelButtonHover.backgroundColor;
919
984
  },
920
985
  onMouseLeave: (e) => {
921
- e.currentTarget.style.backgroundColor = t.cancelButton.backgroundColor;
986
+ e.currentTarget.style.backgroundColor = o.cancelButton.backgroundColor;
922
987
  },
923
988
  children: "Cancelar"
924
989
  }
@@ -930,6 +995,6 @@ function Oe({
930
995
  ] });
931
996
  }
932
997
  export {
933
- Oe as OrderForm
998
+ Ze as OrderForm
934
999
  };
935
1000
  //# sourceMappingURL=index10.js.map