@feedmepos/mf-inventory-portal 1.2.17 → 1.2.19-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/{App-8eGUkgKF.js → App-Bom1bcak.js} +1 -1
  2. package/dist/{ApprovalView-D6Go9ojd.js → ApprovalView-D_orSDU0.js} +2 -2
  3. package/dist/{BindingsDialog-dXBHViQy.js → BindingsDialog-2eJElRIa.js} +2 -2
  4. package/dist/{BindingsPicker-By1dp_1z.js → BindingsPicker-CfsRK8B-.js} +1 -1
  5. package/dist/{BindingsTable-C2ZGoS__.js → BindingsTable-BR6Lxc53.js} +1 -1
  6. package/dist/{ClosingDraftView-CjgQ2_3H.js → ClosingDraftView-DGF3zNvA.js} +2 -2
  7. package/dist/{ClosingTemplateView-CAJTo6gT.js → ClosingTemplateView-u5yiwUff.js} +3 -3
  8. package/dist/{DeliveryOrderPrintPreview-CCRq9jKd.js → DeliveryOrderPrintPreview-Bb2_1YXd.js} +1 -1
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DqpUgHuh.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B8pQnBNv.js} +3 -3
  10. package/dist/{FmMultiselectDialog-BFd1PM4A.js → FmMultiselectDialog-BFlAHDjc.js} +1 -1
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-9WeEmQDK.js → FmUnitInput.vue_vue_type_script_setup_true_lang-U1ndsTwb.js} +1 -1
  12. package/dist/{ImportView-Bgqcun6Q.js → ImportView-CdheoPEB.js} +275 -279
  13. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CSWc06Cf.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-qIuxgD7a.js} +1 -1
  14. package/dist/{IngredientGroupView-Cx2qZunl.js → IngredientGroupView-BZ6GNod-.js} +2 -2
  15. package/dist/{IngredientsView-DyHmPwN1.js → IngredientsView-CpJf3xr9.js} +122 -119
  16. package/dist/{IntegrationView-B_DCEa4p.js → IntegrationView-DN6MCSef.js} +3 -3
  17. package/dist/{InventoryBindingForm-B537FeKW.js → InventoryBindingForm-JS_ot3qj.js} +1 -1
  18. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-C9fCB7WO.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-YZW-mYSn.js} +3 -3
  19. package/dist/{InventoryBindingSummary-cQ55WKYD.js → InventoryBindingSummary-Cp0qbqV3.js} +1 -1
  20. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CMk9KMd8.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BlW7SGya.js} +1 -1
  21. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-C1uPQTeL.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Bv4dMutg.js} +1 -1
  22. package/dist/{PublishView-D0lDf_ph.js → PublishView-D8jDsyTH.js} +1 -1
  23. package/dist/{PurchaseOrderPrintPreview-C6BhSFib.js → PurchaseOrderPrintPreview-De9UTgQH.js} +1 -1
  24. package/dist/{ReceiveRequestView-D1FXMLnO.js → ReceiveRequestView-D6B0nkYT.js} +193 -185
  25. package/dist/{RecipeView-DxvfnC2v.js → RecipeView-DDJWyAMn.js} +3 -3
  26. package/dist/{StockView-CVpKUzDe.js → StockView-Dlf5yAGG.js} +283 -283
  27. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CFE3Mupf.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BJCoys-I.js} +1 -1
  28. package/dist/{SupplierView-B8LJ6Zd8.js → SupplierView-BXxZ_vs7.js} +4 -4
  29. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Do-8paV2.js → TransferDetails.vue_vue_type_script_setup_true_lang-Cdyx0vJi.js} +5 -5
  30. package/dist/{TransferTemplateView-CdOuXyax.js → TransferTemplateView-DCqrkjub.js} +7 -7
  31. package/dist/{UnitView-B9Ot3auM.js → UnitView-j0DalCwr.js} +3 -3
  32. package/dist/{WarehouseView-bYYDyMQe.js → WarehouseView-C7z31F0k.js} +1 -1
  33. package/dist/{app-CExgqADu.js → app-sbPEAhrh.js} +2270 -2276
  34. package/dist/app.js +1 -1
  35. package/dist/{closing-template-Br-3sPe5.js → closing-template-SfWAt0Vr.js} +1 -1
  36. package/dist/{decimal-DCAmcnIp.js → decimal-Cp3c2-pu.js} +1 -1
  37. package/dist/{format-unit-display-laSW7jP6.js → format-unit-display-rXn-PWV3.js} +3 -3
  38. package/dist/{import-export.helper-Dek6SITQ.js → import-export.helper-DXkbqYff.js} +62 -67
  39. package/dist/{index-BP-Da1sV.js → index-Dya2hgd7.js} +1 -1
  40. package/dist/{index-BX9_SMBD.js → index-m6897Cv5.js} +1 -1
  41. package/dist/{purchase-order-template-B_fCWqXF.js → purchase-order-template-D2dudZ5w.js} +1 -1
  42. package/dist/{stock-rMJpZiuS.js → stock-7u0L0_a-.js} +1 -1
  43. package/dist/style.css +1 -1
  44. package/dist/{supplier-i2PxT1x8.js → supplier-uRZ4nMEI.js} +1 -1
  45. package/dist/{use-ingredient-select-dialog-B0bku9DD.js → use-ingredient-select-dialog-Ca9Vr9oE.js} +1 -1
  46. package/dist/{use-inventory-binding-dialog-DHUQ3pbj.js → use-inventory-binding-dialog-Dxd9gg90.js} +1 -1
  47. package/package.json +2 -2
@@ -1,16 +1,13 @@
1
- import { defineComponent as Ae, ref as D, computed as q, watch as ze, resolveComponent as ee, openBlock as N, createElementBlock as P, createVNode as B, normalizeClass as ve, unref as i, createSlots as Ke, withCtx as Z, createElementVNode as n, createBlock as ae, toDisplayString as a, createCommentVNode as te, Fragment as Be, renderList as Pe, shallowRef as $e, h as we, createTextVNode as E } from "vue";
2
- import { a as le, ar as je, b5 as Me, ap as We, W as Ve, ao as Se, l as Le, B as Je, C as Xe, E as qe, G as Ee, c as Qe } from "./app-CExgqADu.js";
3
- import { useCoreStore as ke, useI18n as Oe } from "@feedmepos/mf-common";
4
- import { useDialogChild as Ye, useSnackbar as He, useDialog as Ze, useBreakpoints as et } from "@feedmepos/ui-library";
5
- import { s as tt, g as nt, b as ot, d as Fe } from "./import-export.helper-Dek6SITQ.js";
6
- import { r as Re } from "./random-CSbEbElR.js";
7
- function rt() {
8
- return `unit_${(/* @__PURE__ */ new Date()).toISOString()}_${Re()}`;
1
+ import { defineComponent as De, ref as D, computed as q, watch as He, resolveComponent as ee, openBlock as N, createElementBlock as P, createVNode as B, normalizeClass as ve, unref as i, createSlots as ze, withCtx as Z, createElementVNode as n, createBlock as ae, toDisplayString as a, createCommentVNode as te, Fragment as Ae, renderList as Be, shallowRef as Me, h as we, createTextVNode as E } from "vue";
2
+ import { a as le, ar as Pe, b5 as Fe, ap as Ke, W as We, ao as ke, l as Ve, B as Le, C as Je, E as Xe, G as Se, c as qe } from "./app-sbPEAhrh.js";
3
+ import { useCoreStore as Re, useI18n as je } from "@feedmepos/mf-common";
4
+ import { useDialogChild as Qe, useSnackbar as Oe, useDialog as Ye, useBreakpoints as Ze } from "@feedmepos/ui-library";
5
+ import { s as et, g as tt, b as nt, d as $e } from "./import-export.helper-DXkbqYff.js";
6
+ import { r as ot } from "./random-CSbEbElR.js";
7
+ function Ie() {
8
+ return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${ot()}`;
9
9
  }
10
- function De() {
11
- return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${Re()}`;
12
- }
13
- function st(R) {
10
+ function rt(R) {
14
11
  const [
15
12
  e,
16
13
  S,
@@ -19,19 +16,19 @@ function st(R) {
19
16
  w,
20
17
  _,
21
18
  ...o
22
- ] = je(R);
23
- if (!e || !e.length || e.some((d) => d.length && !d.startsWith("system:")))
19
+ ] = Pe(R);
20
+ if (!e || !e.length || e.some((c) => c.length && !c.startsWith("system:")))
24
21
  throw new Error("Missing meta header. Excel file does not come from the template.");
25
- const l = e.map((d) => d.split(":")[1]), y = ["name", "symbol", "precision"].filter((d) => !l.includes(d));
22
+ const l = e.map((c) => c.split(":")[1]), y = ["name", "symbol", "precision"].filter((c) => !l.includes(c));
26
23
  if (y.length)
27
24
  throw new Error(
28
25
  `Missing meta headers (${y.join()}). Excel file does not come from the template.`
29
26
  );
30
- return o.map((d, f) => {
27
+ return o.map((c, f) => {
31
28
  const g = {};
32
29
  for (const p in l) {
33
- const u = l[p];
34
- Object.assign(g, { [u]: d[p] });
30
+ const d = l[p];
31
+ Object.assign(g, { [d]: c[p] });
35
32
  }
36
33
  return {
37
34
  index: f,
@@ -39,18 +36,17 @@ function st(R) {
39
36
  };
40
37
  });
41
38
  }
42
- function it(R) {
39
+ function st(R) {
43
40
  try {
44
- const e = st(R).filter((o) => {
45
- const { name: l, symbol: s, precision: y, measurement_name: c, measurement_symbol: d, measurement_conversion: f } = o.data;
46
- return l || s || y || c || d || f;
41
+ const e = rt(R).filter((o) => {
42
+ const { name: l, symbol: s, precision: y, measurement_name: u, measurement_symbol: c, measurement_conversion: f } = o.data;
43
+ return l || s || y || u || c || f;
47
44
  }), h = le().units, x = [], w = [];
48
45
  let _ = {};
49
46
  for (const o of e)
50
47
  if (o.data.name && o.data.symbol)
51
48
  _[o.data.name] = {
52
49
  unit: {
53
- _id: rt(),
54
50
  name: o.data.name,
55
51
  abbrev: o.data.symbol,
56
52
  precision: Math.max(0, Math.min(10, Math.floor(o.data.precision || 2))),
@@ -58,7 +54,7 @@ function it(R) {
58
54
  },
59
55
  rowNumber: o.index
60
56
  }, o.data.measurement_name && o.data.measurement_symbol && o.data.measurement_conversion && _[o.data.name].unit.measurements.push({
61
- id: De(),
57
+ id: Ie(),
62
58
  name: o.data.measurement_name,
63
59
  abbrev: o.data.measurement_symbol,
64
60
  conversion: {
@@ -69,7 +65,7 @@ function it(R) {
69
65
  else {
70
66
  const l = Object.keys(_)[Object.keys(_).length - 1];
71
67
  l && _[l] && o.data.measurement_name && o.data.measurement_symbol && o.data.measurement_conversion && _[l].unit.measurements.push({
72
- id: De(),
68
+ id: Ie(),
73
69
  name: o.data.measurement_name,
74
70
  abbrev: o.data.measurement_symbol,
75
71
  conversion: {
@@ -79,9 +75,9 @@ function it(R) {
79
75
  });
80
76
  }
81
77
  for (const [o, { unit: l, rowNumber: s }] of Object.entries(_)) {
82
- const y = h.find((c) => {
83
- var d, f;
84
- return c.abbrev === l.abbrev && ((d = c.name) == null ? void 0 : d.trim()) === ((f = l.name) == null ? void 0 : f.trim());
78
+ const y = h.find((u) => {
79
+ var c, f;
80
+ return u.abbrev === l.abbrev && ((c = u.name) == null ? void 0 : c.trim()) === ((f = l.name) == null ? void 0 : f.trim());
85
81
  });
86
82
  y ? w.push({
87
83
  type: "update",
@@ -91,16 +87,19 @@ function it(R) {
91
87
  name: l.name || y.name,
92
88
  abbrev: l.abbrev || y.abbrev,
93
89
  precision: l.precision !== void 0 ? l.precision : y.precision,
94
- measurements: l.measurements.map((c) => {
95
- const d = y.measurements.find((f) => f.name === c.name && f.abbrev === c.abbrev);
96
- return d ? { ...d, ...c, id: d.id } : c;
90
+ measurements: l.measurements.map((u) => {
91
+ const c = y.measurements.find((f) => f.name === u.name && f.abbrev === u.abbrev);
92
+ return c ? { ...c, ...u, id: c.id } : { ...u, id: Ie() };
97
93
  })
98
94
  },
99
95
  errors: [],
100
96
  excelRowNumber: s
101
97
  }) : x.push({
102
98
  type: "create",
103
- unit: l,
99
+ unit: {
100
+ ...l,
101
+ measurements: l.measurements.map((u) => ({ ...u, id: Ie() }))
102
+ },
104
103
  errors: [],
105
104
  excelRowNumber: s
106
105
  });
@@ -119,14 +118,11 @@ function it(R) {
119
118
  };
120
119
  }
121
120
  }
122
- function at() {
123
- return `recipe_${(/* @__PURE__ */ new Date()).toISOString()}_${Re()}`;
124
- }
125
- function lt(R, { ignoreErrors: e = !1 } = {}) {
121
+ function it(R, { ignoreErrors: e = !1 } = {}) {
126
122
  var S, h, x;
127
123
  try {
128
- const w = le(), _ = w.skuByCode, o = w.recipeByName, l = w.skuGroupById, s = w.skuGroups, y = w.units, c = [];
129
- let d = {};
124
+ const w = le(), _ = w.skuByCode, o = w.recipeByName, l = w.skuGroupById, s = w.skuGroups, y = w.units, u = [];
125
+ let c = {};
130
126
  for (const r of R) {
131
127
  const b = [];
132
128
  let C = "";
@@ -146,47 +142,47 @@ function lt(R, { ignoreErrors: e = !1 } = {}) {
146
142
  if ((r.data.unit || r.data.baseUnit) && r.data.type !== "RECIPE" && r.data.type !== "SKU_GROUP" && (A = y.find((U) => {
147
143
  var T, re;
148
144
  return U.abbrev === r.data.baseUnit && ((T = U.name) == null ? void 0 : T.trim()) === ((re = r.data.unit) == null ? void 0 : re.trim());
149
- }), A || (r.data.baseUnit && r.data.unit ? b.push(`Cannot find unit with symbol '${r.data.baseUnit}' and name '${r.data.unit}'`) : r.data.baseUnit ? b.push(`Cannot find unit with symbol '${r.data.baseUnit}'`) : r.data.unit && b.push(`Cannot find unit with name '${r.data.unit}'`))), b.length > 0 && c.push(`Row ${r.index + 6}: ${b.join(", ")}`), e || b.length === 0) {
145
+ }), A || (r.data.baseUnit && r.data.unit ? b.push(`Cannot find unit with symbol '${r.data.baseUnit}' and name '${r.data.unit}'`) : r.data.baseUnit ? b.push(`Cannot find unit with symbol '${r.data.baseUnit}'`) : r.data.unit && b.push(`Cannot find unit with name '${r.data.unit}'`))), b.length > 0 && u.push(`Row ${r.index + 6}: ${b.join(", ")}`), e || b.length === 0) {
150
146
  let U;
151
147
  if (r.data.type === "RECIPE" || r.data.type === "SKU_GROUP" ? U = void 0 : U = (S = A == null ? void 0 : A.measurements) == null ? void 0 : S.find((T) => T.abbrev === r.data.measurementName), r.data.recipeName)
152
- d[r.data.recipeName] = {
153
- _id: at(),
148
+ c[r.data.recipeName] = {
154
149
  name: r.data.recipeName,
155
- customAttributes: r.data.customAttributes ? tt(r.data.customAttributes) : {},
150
+ customAttributes: r.data.customAttributes ? et(r.data.customAttributes) : {},
156
151
  contains: [{
157
152
  type: r.data.type === "INGREDIENT" ? "SKU" : r.data.type,
158
153
  id: C,
159
154
  amount: {
160
155
  amount: parseFloat(r.data.amount) || 0,
161
- precision: Me(r.data.amount) === !0 && ((h = r.data.amount.split(".")[1]) == null ? void 0 : h.length) || 0
156
+ precision: Fe(r.data.amount) === !0 && ((h = r.data.amount.split(".")[1]) == null ? void 0 : h.length) || 0
162
157
  },
163
158
  measurement: U || void 0
164
159
  }]
165
- }, c[r.data.recipeName] = b.length > 0 ? `Row ${r.index + 6}: ${b.join(", ")}` : [];
160
+ }, u[r.data.recipeName] = b.length > 0 ? `Row ${r.index + 6}: ${b.join(", ")}` : [];
166
161
  else {
167
- const T = Object.keys(d)[Object.keys(d).length - 1];
168
- T && d[T] && (d[T] = {
169
- ...d[T],
162
+ const T = Object.keys(c)[Object.keys(c).length - 1];
163
+ T && c[T] && (c[T] = {
164
+ ...c[T],
170
165
  contains: [
171
- ...d[T].contains,
166
+ ...c[T].contains,
172
167
  {
173
168
  type: r.data.type === "INGREDIENT" ? "SKU" : r.data.type,
174
169
  id: C,
175
170
  amount: {
176
171
  amount: parseFloat(r.data.amount) || 0,
177
- precision: Me(r.data.amount) === !0 && ((x = r.data.amount.split(".")[1]) == null ? void 0 : x.length) || 0
172
+ precision: Fe(r.data.amount) === !0 && ((x = r.data.amount.split(".")[1]) == null ? void 0 : x.length) || 0
178
173
  },
179
174
  measurement: U || void 0
180
175
  }
181
176
  ]
182
- }, c[T] = b.length > 0 ? c[T] ? `${c[T]}, Row ${r.index + 6}: ${b.join(", ")}` : `Row ${r.index + 6}: ${b.join(", ")}` : []);
177
+ }, u[T] = b.length > 0 ? u[T] ? `${u[T]}, Row ${r.index + 6}: ${b.join(", ")}` : `Row ${r.index + 6}: ${b.join(", ")}` : []);
183
178
  }
184
179
  }
185
180
  }
186
- const f = Object.values(d), g = f.filter((r) => !o[r.name]), p = f.filter((r) => o[r.name]), u = g.map((r, b) => ({
181
+ const f = Object.values(c), g = f.filter((r) => !o[r.name]), p = f.filter((r) => o[r.name]), d = g.map((r, b) => ({
187
182
  type: "create",
188
183
  recipe: r,
189
- errors: c[r.name],
184
+ // Type assertion - _id will be assigned by backend
185
+ errors: u[r.name],
190
186
  excelRowNumber: b + 6
191
187
  // Assuming header rows
192
188
  })), G = p.map((r, b) => {
@@ -200,14 +196,14 @@ function lt(R, { ignoreErrors: e = !1 } = {}) {
200
196
  contains: r.contains.length > 0 ? r.contains : C.contains,
201
197
  customAttributes: r.customAttributes || C.customAttributes
202
198
  },
203
- errors: c[r.name],
199
+ errors: u[r.name],
204
200
  excelRowNumber: b + 6
205
201
  };
206
202
  });
207
203
  return {
208
- invalidExcel: c.length > 0,
209
- invalidExcelMessage: c.length > 0 ? `Import completed with ${c.length} error(s): ${c.join("; ")}` : void 0,
210
- importCreateResult: u,
204
+ invalidExcel: u.length > 0,
205
+ invalidExcelMessage: u.length > 0 ? `Import completed with ${u.length} error(s): ${u.join("; ")}` : void 0,
206
+ importCreateResult: d,
211
207
  importUpdateResult: G
212
208
  };
213
209
  } catch (w) {
@@ -219,7 +215,7 @@ function lt(R, { ignoreErrors: e = !1 } = {}) {
219
215
  };
220
216
  }
221
217
  }
222
- function mt(R) {
218
+ function at(R) {
223
219
  const [
224
220
  e,
225
221
  S,
@@ -228,31 +224,31 @@ function mt(R) {
228
224
  w,
229
225
  _,
230
226
  ...o
231
- ] = je(R);
232
- if (!e || !e.length || e.some((d) => d.length && !d.startsWith("system:")))
227
+ ] = Pe(R);
228
+ if (!e || !e.length || e.some((c) => c.length && !c.startsWith("system:")))
233
229
  throw new Error("Missing meta header. Excel file does not come from the template.");
234
- const l = e.map((d) => d.split(":")[1]), y = ["code", "recipeName", "unit", "baseUnit", "type", "amount"].filter((d) => !l.includes(d));
230
+ const l = e.map((c) => c.split(":")[1]), y = ["code", "recipeName", "unit", "baseUnit", "type", "amount"].filter((c) => !l.includes(c));
235
231
  if (y.length)
236
232
  throw new Error(
237
233
  `Missing meta headers (${y.join()}). Excel file does not come from the template.`
238
234
  );
239
- return o.map((d, f) => {
235
+ return o.map((c, f) => {
240
236
  const g = {};
241
237
  for (const p in l) {
242
- const u = l[p];
243
- Object.assign(g, { [u]: d[p] });
238
+ const d = l[p];
239
+ Object.assign(g, { [d]: c[p] });
244
240
  }
245
241
  return {
246
242
  index: f,
247
243
  data: g
248
244
  };
249
- }).filter((d) => {
250
- const { recipeName: f, type: g, code: p, name: u, amount: G, unit: r, baseUnit: b, measurementName: C, customAttributes: A } = d.data;
251
- return f || g || p || u || G || r || b || C || A;
245
+ }).filter((c) => {
246
+ const { recipeName: f, type: g, code: p, name: d, amount: G, unit: r, baseUnit: b, measurementName: C, customAttributes: A } = c.data;
247
+ return f || g || p || d || G || r || b || C || A;
252
248
  });
253
249
  }
254
- function ut() {
255
- const e = ke().currentBusiness.value, S = le(), h = [
250
+ function lt() {
251
+ const e = Re().currentBusiness.value, S = le(), h = [
256
252
  { id: "name", name: "Unit Name" },
257
253
  { id: "symbol", name: "Symbol" },
258
254
  { id: "precision", name: "Precision" },
@@ -306,24 +302,24 @@ function ut() {
306
302
  h.map((o) => o.name),
307
303
  ...x
308
304
  ], _ = h.map((o) => `system:${o.id}`);
309
- return Se(w, _);
305
+ return ke(w, _);
310
306
  }
311
- function dt() {
312
- const e = ke().currentBusiness.value, S = le(), h = ot();
307
+ function mt() {
308
+ const e = Re().currentBusiness.value, S = le(), h = nt();
313
309
  let x = [];
314
310
  S.skus.length > 0 ? x = S.skus.map((o) => {
315
- var l, s, y, c, d, f, g, p;
311
+ var l, s, y, u, c, f, g, p;
316
312
  return [
317
313
  o.code,
318
314
  o.name,
319
315
  ((l = o.unit) == null ? void 0 : l.name) || "",
320
316
  ((s = o.unit) == null ? void 0 : s.abbrev) || "",
321
- ((c = (y = o.unit) == null ? void 0 : y.measurements.find((u) => u.id === o.trackingMeasurement)) == null ? void 0 : c.abbrev) ?? o.unit.abbrev,
317
+ ((u = (y = o.unit) == null ? void 0 : y.measurements.find((d) => d.id === o.trackingMeasurement)) == null ? void 0 : u.abbrev) ?? o.unit.abbrev,
322
318
  o.valuation || "WAVG",
323
- (d = o.defaultCost) != null && d.costPerUnit ? +Le((f = o.defaultCost) == null ? void 0 : f.costPerUnit) : 0,
324
- ((g = o.thresholds) == null ? void 0 : g.low) ?? Fe().low,
325
- ((p = o.thresholds) == null ? void 0 : p.mid) ?? Fe().mid,
326
- o.customAttributes ? Object.entries(o.customAttributes).map(([u, G]) => `${u}:${G}`).join("|") : ""
319
+ (c = o.defaultCost) != null && c.costPerUnit ? +Ve((f = o.defaultCost) == null ? void 0 : f.costPerUnit) : 0,
320
+ ((g = o.thresholds) == null ? void 0 : g.low) ?? $e().low,
321
+ ((p = o.thresholds) == null ? void 0 : p.mid) ?? $e().mid,
322
+ o.customAttributes ? Object.entries(o.customAttributes).map(([d, G]) => `${d}:${G}`).join("|") : ""
327
323
  ];
328
324
  }) : x = [
329
325
  ["EXAMPLE_CODE", "Example Ingredient", "kg", "kg", "Unit Name", "WAVG", 10.5, 5, 10, ""]
@@ -336,10 +332,10 @@ function dt() {
336
332
  h.map((o) => o.name),
337
333
  ...x
338
334
  ], _ = h.map((o) => `system:${o.id}`);
339
- return Se(w, _);
335
+ return ke(w, _);
340
336
  }
341
- function ct() {
342
- const e = ke().currentBusiness.value, S = le(), h = [
337
+ function ut() {
338
+ const e = Re().currentBusiness.value, S = le(), h = [
343
339
  { id: "recipeName", name: "Recipe Name" },
344
340
  { id: "type", name: "Type" },
345
341
  { id: "code", name: "Code" },
@@ -354,54 +350,54 @@ function ct() {
354
350
  if (S.recipes.length > 0) {
355
351
  const o = S.recipeById, l = S.skuById, s = S.skuGroupById;
356
352
  x = S.recipes.flatMap((y) => {
357
- var d;
358
- const c = y.customAttributes ? Object.entries(y.customAttributes).map(([f, g]) => `${f}:${g}`).join("|") : "";
359
- if ((d = y.contains) != null && d.length) {
360
- const f = y.contains.filter((u) => u.type === "RECIPE"), g = y.contains.filter((u) => u.type === "SKU"), p = y.contains.filter((u) => u.type === "SKU_GROUP");
353
+ var c;
354
+ const u = y.customAttributes ? Object.entries(y.customAttributes).map(([f, g]) => `${f}:${g}`).join("|") : "";
355
+ if ((c = y.contains) != null && c.length) {
356
+ const f = y.contains.filter((d) => d.type === "RECIPE"), g = y.contains.filter((d) => d.type === "SKU"), p = y.contains.filter((d) => d.type === "SKU_GROUP");
361
357
  return [
362
- ...f.map((u, G) => {
358
+ ...f.map((d, G) => {
363
359
  var r;
364
360
  return [
365
361
  G === 0 ? y.name : "",
366
362
  "RECIPE",
367
363
  "",
368
- ((r = o[u.id]) == null ? void 0 : r.name) || "",
369
- u.amount.amount,
364
+ ((r = o[d.id]) == null ? void 0 : r.name) || "",
365
+ d.amount.amount,
370
366
  "",
371
367
  "unit",
372
368
  "Unit",
373
- G === 0 ? c : ""
369
+ G === 0 ? u : ""
374
370
  ];
375
371
  }),
376
- ...g.map((u, G) => {
372
+ ...g.map((d, G) => {
377
373
  var r, b, C, A, U, T, re, ye, ge, me, fe, ue, be, he, xe, _e;
378
374
  return [
379
375
  !f.length && G === 0 ? y.name : "",
380
376
  "INGREDIENT",
381
- ((r = l[u.id]) == null ? void 0 : r.code) || "",
382
- ((b = l[u.id]) == null ? void 0 : b.name) || "",
383
- u.amount.amount,
384
- u.measurement ? ((A = (C = l[u.id]) == null ? void 0 : C.unit) == null ? void 0 : A.name) || "" : ((T = (U = l[u.id]) == null ? void 0 : U.unit) == null ? void 0 : T.name) || "",
385
- u.measurement ? ((ye = (re = l[u.id]) == null ? void 0 : re.unit) == null ? void 0 : ye.abbrev) || "" : ((me = (ge = l[u.id]) == null ? void 0 : ge.unit) == null ? void 0 : me.abbrev) || "",
386
- u.measurement ? u.measurement.abbrev : ((he = (be = (ue = (fe = l[u.id]) == null ? void 0 : fe.unit) == null ? void 0 : ue.measurements) == null ? void 0 : be.find((Ie) => {
377
+ ((r = l[d.id]) == null ? void 0 : r.code) || "",
378
+ ((b = l[d.id]) == null ? void 0 : b.name) || "",
379
+ d.amount.amount,
380
+ d.measurement ? ((A = (C = l[d.id]) == null ? void 0 : C.unit) == null ? void 0 : A.name) || "" : ((T = (U = l[d.id]) == null ? void 0 : U.unit) == null ? void 0 : T.name) || "",
381
+ d.measurement ? ((ye = (re = l[d.id]) == null ? void 0 : re.unit) == null ? void 0 : ye.abbrev) || "" : ((me = (ge = l[d.id]) == null ? void 0 : ge.unit) == null ? void 0 : me.abbrev) || "",
382
+ d.measurement ? d.measurement.abbrev : ((he = (be = (ue = (fe = l[d.id]) == null ? void 0 : fe.unit) == null ? void 0 : ue.measurements) == null ? void 0 : be.find((Ee) => {
387
383
  var m;
388
- return Ie.id === ((m = l[u.id]) == null ? void 0 : m.trackingMeasurement);
389
- })) == null ? void 0 : he.abbrev) || ((_e = (xe = l[u.id]) == null ? void 0 : xe.unit) == null ? void 0 : _e.abbrev) || "",
390
- !f.length && G === 0 ? c : ""
384
+ return Ee.id === ((m = l[d.id]) == null ? void 0 : m.trackingMeasurement);
385
+ })) == null ? void 0 : he.abbrev) || ((_e = (xe = l[d.id]) == null ? void 0 : xe.unit) == null ? void 0 : _e.abbrev) || "",
386
+ !f.length && G === 0 ? u : ""
391
387
  ];
392
388
  }),
393
- ...p.map((u, G) => {
389
+ ...p.map((d, G) => {
394
390
  var r, b;
395
391
  return [
396
392
  f.length === 0 && g.length === 0 && G === 0 ? y.name : "",
397
393
  "SKU_GROUP",
398
- ((r = s[u.id]) == null ? void 0 : r.ref) || "",
399
- ((b = s[u.id]) == null ? void 0 : b.name) || "",
400
- u.amount.amount,
394
+ ((r = s[d.id]) == null ? void 0 : r.ref) || "",
395
+ ((b = s[d.id]) == null ? void 0 : b.name) || "",
396
+ d.amount.amount,
401
397
  "",
402
398
  "unit",
403
399
  "Unit",
404
- f.length === 0 && g.length === 0 && G === 0 ? c : ""
400
+ f.length === 0 && g.length === 0 && G === 0 ? u : ""
405
401
  ];
406
402
  })
407
403
  ];
@@ -422,83 +418,83 @@ function ct() {
422
418
  h.map((o) => o.name),
423
419
  ...x
424
420
  ], _ = h.map((o) => `system:${o.id}`);
425
- return Se(w, _);
421
+ return ke(w, _);
426
422
  }
427
- function pt() {
428
- const R = We({
429
- unit: ut(),
430
- ingredient: dt(),
431
- recipe: ct()
423
+ function dt() {
424
+ const R = Ke({
425
+ unit: lt(),
426
+ ingredient: mt(),
427
+ recipe: ut()
432
428
  }), e = "FeedMe comprehensive template.xlsx";
433
- return Ve(R, e), e;
429
+ return We(R, e), e;
434
430
  }
435
- async function vt(R) {
431
+ async function ct(R) {
436
432
  if (!R) return null;
437
433
  try {
438
- return it(R);
434
+ return st(R);
439
435
  } catch (e) {
440
436
  throw console.error("Error in processUnitsSheet:", e), e;
441
437
  }
442
438
  }
443
- async function yt(R) {
439
+ async function pt(R) {
444
440
  if (!R) return null;
445
441
  try {
446
- return nt(R);
442
+ return tt(R);
447
443
  } catch (e) {
448
444
  throw console.error("Error in processIngredientsSheet:", e), e;
449
445
  }
450
446
  }
451
- async function gt(R) {
447
+ async function vt(R) {
452
448
  if (!R) return null;
453
449
  try {
454
- const e = mt(R);
455
- return lt(e, { ignoreErrors: !0 });
450
+ const e = at(R);
451
+ return it(e, { ignoreErrors: !0 });
456
452
  } catch (e) {
457
453
  throw console.error("Error in processRecipesSheet:", e), e;
458
454
  }
459
455
  }
460
- const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8" }, ht = { class: "flex flex-col flex-1 gap-4" }, xt = { class: "fm-typo-en-body-md-600" }, _t = {
456
+ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8" }, ft = { class: "flex flex-col flex-1 gap-4" }, bt = { class: "fm-typo-en-body-md-600" }, ht = {
461
457
  key: 2,
462
458
  class: "shrink-0"
463
- }, wt = {
459
+ }, xt = {
464
460
  key: 0,
465
461
  class: "flex flex-col"
466
- }, It = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Et = {
462
+ }, _t = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, wt = {
467
463
  key: 0,
468
464
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
469
- }, St = { class: "fm-typo-en-body-lg-600" }, kt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Rt = /* @__PURE__ */ Ae({
465
+ }, It = { class: "fm-typo-en-body-lg-600" }, Et = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, St = /* @__PURE__ */ De({
470
466
  __name: "ImportDialog",
471
467
  setup(R) {
472
- const e = D(null), S = Ye();
473
- He();
474
- const h = D(!1), x = D(new Array()), w = D(null), _ = D([]), o = D([]), l = q(() => !!x.value.length), s = q(() => !!w.value && _.value.length > 0), { t: y } = Oe();
475
- async function c(g) {
468
+ const e = D(null), S = Qe();
469
+ Oe();
470
+ const h = D(!1), x = D(new Array()), w = D(null), _ = D([]), o = D([]), l = q(() => !!x.value.length), s = q(() => !!w.value && _.value.length > 0), { t: y } = je();
471
+ async function u(g) {
476
472
  x.value = [], w.value = null, _.value = [], o.value = [];
477
473
  try {
478
474
  h.value = !0;
479
475
  const [p] = await Promise.all([
480
- Xe(g),
476
+ Je(g),
481
477
  // fake buffer for UX
482
- new Promise((u) => setTimeout(u, 1e3))
478
+ new Promise((d) => setTimeout(d, 1e3))
483
479
  ]);
484
- w.value = p, d();
480
+ w.value = p, c();
485
481
  } catch (p) {
486
482
  console.error("Error parsing Excel file:", p), x.value.push((p == null ? void 0 : p.message) || "Unknown error occurred");
487
483
  } finally {
488
484
  h.value = !1;
489
485
  }
490
486
  }
491
- function d() {
487
+ function c() {
492
488
  if (x.value = [], !w.value) return;
493
- const p = ["unit", "ingredient", "recipe"].filter((u) => w.value.Sheets[u]);
489
+ const p = ["unit", "ingredient", "recipe"].filter((d) => w.value.Sheets[d]);
494
490
  if (p.length === 0) {
495
491
  x.value.push("No valid sheets found. Expected sheets: unit, ingredient, or recipe");
496
492
  return;
497
493
  }
498
494
  _.value = p, S.emitData({ availableSheets: p, workbook: w.value });
499
495
  }
500
- ze(e, (g) => {
501
- g && c(g);
496
+ He(e, (g) => {
497
+ g && u(g);
502
498
  });
503
499
  function f() {
504
500
  if (!w.value || _.value.length === 0) return "";
@@ -518,9 +514,9 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
518
514
  }), g.length > 0 ? `Ready to process: ${g.join(", ")}. Processing will follow dependency order.` : "No valid sheets found";
519
515
  }
520
516
  return (g, p) => {
521
- const u = ee("FmCircularProgress"), G = ee("FmIcon"), r = ee("FmButton");
522
- return N(), P("div", ft, [
523
- B(Je, {
517
+ const d = ee("FmCircularProgress"), G = ee("FmIcon"), r = ee("FmButton");
518
+ return N(), P("div", yt, [
519
+ B(Le, {
524
520
  class: ve({
525
521
  "w-full": !0,
526
522
  "h-[200px]": !e.value
@@ -529,11 +525,11 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
529
525
  onFileUpload: p[0] || (p[0] = (b) => e.value = b),
530
526
  label: i(y)("inventory.ingredient.import.uploadTemplate"),
531
527
  "button-label": i(y)("inventory.ingredient.import.selectFile")
532
- }, Ke({ _: 2 }, [
528
+ }, ze({ _: 2 }, [
533
529
  e.value ? {
534
530
  name: "default",
535
531
  fn: Z(({ openFileDialog: b }) => [
536
- n("div", bt, [
532
+ n("div", gt, [
537
533
  n("div", {
538
534
  class: ve([
539
535
  "fm-corner-radius-md p-16 flex items-center gap-16",
@@ -544,7 +540,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
544
540
  }
545
541
  ])
546
542
  }, [
547
- h.value ? (N(), ae(u, {
543
+ h.value ? (N(), ae(d, {
548
544
  key: 0,
549
545
  size: "md",
550
546
  color: "neutral-gray-200"
@@ -554,8 +550,8 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
554
550
  color: l.value ? "system-error-300" : "system-success-400",
555
551
  size: "lg"
556
552
  }, null, 8, ["name", "color"])),
557
- n("div", ht, [
558
- n("div", xt, a(e.value.name), 1),
553
+ n("div", ft, [
554
+ n("div", bt, a(e.value.name), 1),
559
555
  n("div", {
560
556
  class: ve([
561
557
  "fm-typo-en-body-sm-400",
@@ -566,7 +562,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
566
562
  ])
567
563
  }, a(l.value ? i(y)("inventory.ingredient.import.error.invalidContent") : "File valid"), 3)
568
564
  ]),
569
- h.value ? te("", !0) : (N(), P("div", _t, [
565
+ h.value ? te("", !0) : (N(), P("div", ht, [
570
566
  B(r, {
571
567
  label: i(y)("inventory.ingredient.import.replaceFile"),
572
568
  variant: l.value ? "destructive" : "secondary",
@@ -575,8 +571,8 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
575
571
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
576
572
  ]))
577
573
  ], 2),
578
- x.value.length ? (N(), P("div", wt, [
579
- (N(!0), P(Be, null, Pe(x.value, (C, A) => (N(), P("div", {
574
+ x.value.length ? (N(), P("div", xt, [
575
+ (N(!0), P(Ae, null, Be(x.value, (C, A) => (N(), P("div", {
580
576
  key: A,
581
577
  class: "flex gap-8 items-center"
582
578
  }, [
@@ -585,7 +581,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
585
581
  size: "sm",
586
582
  color: "system-error-300"
587
583
  }),
588
- n("div", It, a(C), 1)
584
+ n("div", _t, a(C), 1)
589
585
  ]))), 128))
590
586
  ])) : te("", !0)
591
587
  ])
@@ -593,51 +589,51 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
593
589
  key: "0"
594
590
  } : void 0
595
591
  ]), 1032, ["class", "label", "button-label"]),
596
- s.value ? (N(), P("div", Et, [
597
- n("div", St, a(i(y)("inventory.ingredient.import.summary")), 1),
598
- n("div", kt, a(f()), 1)
592
+ s.value ? (N(), P("div", wt, [
593
+ n("div", It, a(i(y)("inventory.ingredient.import.summary")), 1),
594
+ n("div", Et, a(f()), 1)
599
595
  ])) : te("", !0)
600
596
  ]);
601
597
  };
602
598
  }
603
- }), Ct = {
599
+ }), kt = {
604
600
  key: 0,
605
601
  class: "bg-blue-50 border border-blue-200 rounded-lg p-16"
606
- }, Ut = { class: "flex items-start gap-12" }, Nt = { class: "flex flex-col gap-8" }, Gt = { class: "fm-typo-en-body-md-400 text-blue-800" }, Tt = { class: "fm-typo-en-body-sm-400 text-blue-700" }, $t = { class: "mb-8" }, Mt = ["innerHTML"], Ft = ["innerHTML"], Dt = { class: "mb-8" }, At = { class: "mb-12" }, Bt = { class: "mb-12" }, Pt = { class: "mb-8" }, jt = { class: "text-orange-600" }, Ot = {
602
+ }, Rt = { class: "flex items-start gap-12" }, Ct = { class: "flex flex-col gap-8" }, Ut = { class: "fm-typo-en-body-md-400 text-blue-800" }, Nt = { class: "fm-typo-en-body-sm-400 text-blue-700" }, Gt = { class: "mb-8" }, Tt = ["innerHTML"], Mt = ["innerHTML"], Ft = { class: "mb-8" }, $t = { class: "mb-12" }, Dt = { class: "mb-12" }, At = { class: "mb-8" }, Bt = { class: "text-orange-600" }, Pt = {
607
603
  key: 1,
608
604
  class: "bg-white rounded-lg shadow"
609
- }, Ht = { class: "flex items-center justify-between p-16 border-b" }, zt = { class: "fm-typo-en-title-md-600" }, Kt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, Wt = {
605
+ }, jt = { class: "flex items-center justify-between p-16 border-b" }, Ot = { class: "fm-typo-en-title-md-600" }, Ht = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, zt = {
610
606
  key: 0,
611
607
  class: "text-red-600"
612
- }, Vt = {
608
+ }, Kt = {
613
609
  key: 1,
614
610
  class: "text-orange-600"
615
- }, Lt = {
611
+ }, Wt = {
616
612
  key: 2,
617
613
  class: "text-green-600"
618
- }, Jt = { class: "flex gap-8" }, Xt = { class: "p-16" }, qt = {
614
+ }, Vt = { class: "flex gap-8" }, Lt = { class: "p-16" }, Jt = {
619
615
  key: 2,
620
616
  class: "bg-white rounded-lg shadow"
621
- }, Qt = { class: "flex items-center justify-between p-16 border-b" }, Yt = { class: "fm-typo-en-title-md-600 text-red-800" }, Zt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, en = { class: "flex gap-8" }, tn = { class: "p-16" }, nn = {
617
+ }, Xt = { class: "flex items-center justify-between p-16 border-b" }, qt = { class: "fm-typo-en-title-md-600 text-red-800" }, Qt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, Yt = { class: "flex gap-8" }, Zt = { class: "p-16" }, en = {
622
618
  key: 0,
623
619
  class: "flex flex-col gap-16 p-16"
624
- }, on = { class: "fm-typo-en-title-sm-600 mb-12" }, rn = { class: "grid grid-cols-2 gap-12" }, sn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, an = { class: "fm-typo-en-body-md-600" }, ln = { key: 0 }, mn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, un = { class: "fm-typo-en-body-md-600" }, dn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, cn = { class: "fm-typo-en-body-md-600" }, pn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, vn = { class: "fm-typo-en-body-md-600" }, yn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, gn = { class: "fm-typo-en-title-sm-600 mb-12 text-red-800" }, fn = { class: "space-y-8" }, bn = { class: "fm-typo-en-body-md-400 text-red-800" }, hn = { class: "fm-typo-en-title-sm-600 mb-12" }, xn = { class: "bg-gray-50 p-12 rounded border overflow-auto" }, _n = { class: "text-sm" }, wn = { class: "flex gap-8" }, In = { class: "flex flex-col items-center justify-center h-64 gap-16" }, En = { class: "text-center" }, Sn = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, kn = { class: "flex flex-col items-center justify-center h-64 gap-16" }, Rn = { class: "text-center" }, Cn = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, Un = { class: "fm-typo-en-body-md-400 text-gray-500" }, Dn = /* @__PURE__ */ Ae({
620
+ }, tn = { class: "fm-typo-en-title-sm-600 mb-12" }, nn = { class: "grid grid-cols-2 gap-12" }, on = { class: "fm-typo-en-body-sm-400 text-gray-600" }, rn = { class: "fm-typo-en-body-md-600" }, sn = { key: 0 }, an = { class: "fm-typo-en-body-sm-400 text-gray-600" }, ln = { class: "fm-typo-en-body-md-600" }, mn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, un = { class: "fm-typo-en-body-md-600" }, dn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, cn = { class: "fm-typo-en-body-md-600" }, pn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, vn = { class: "fm-typo-en-title-sm-600 mb-12 text-red-800" }, yn = { class: "space-y-8" }, gn = { class: "fm-typo-en-body-md-400 text-red-800" }, fn = { class: "fm-typo-en-title-sm-600 mb-12" }, bn = { class: "bg-gray-50 p-12 rounded border overflow-auto" }, hn = { class: "text-sm" }, xn = { class: "flex gap-8" }, _n = { class: "flex flex-col items-center justify-center h-64 gap-16" }, wn = { class: "text-center" }, In = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, En = { class: "flex flex-col items-center justify-center h-64 gap-16" }, Sn = { class: "text-center" }, kn = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, Rn = { class: "fm-typo-en-body-md-400 text-gray-500" }, Fn = /* @__PURE__ */ De({
625
621
  __name: "ImportView",
626
622
  setup(R) {
627
- const { t: e } = Oe(), S = Ze(), h = He();
628
- qe();
629
- const x = Qe(), { breakpoints: w } = et(), _ = le(), o = D("");
623
+ const { t: e } = je(), S = Ye(), h = Oe();
624
+ Xe();
625
+ const x = qe(), { breakpoints: w } = Ze(), _ = le(), o = D("");
630
626
  D(!1);
631
- const l = D(!1), s = D(null), y = D(!1), c = D(null), d = D(!1), f = D([]), g = D(null), p = D([]), u = D(!1), G = q(() => w.value.xs || w.value.sm), r = q(() => G.value ? 10 : 20), b = q(() => {
627
+ const l = D(!1), s = D(null), y = D(!1), u = D(null), c = D(!1), f = D([]), g = D(null), p = D([]), d = D(!1), G = q(() => w.value.xs || w.value.sm), r = q(() => G.value ? 10 : 20), b = q(() => {
632
628
  const m = s.value;
633
629
  if (!m) return [];
634
- const t = [], { units: k, skus: j, recipes: J, _invalidExcel: W, _invalidExcelMessage: Q } = m, Y = (M) => {
630
+ const t = [], { units: k, skus: j, recipes: J, _invalidExcel: W, _invalidExcelMessage: Q } = m, Y = (F) => {
635
631
  var H;
636
- return ((H = M.errors) == null ? void 0 : H.length) > 0 ? Array.isArray(M.errors) ? M.errors.join(", ") : M.errors || e("inventory.common.validationFailed") : W ? Q || e("inventory.common.invalidExcelFormat") : e("inventory.common.readyToImport");
637
- }, K = (M, z) => {
638
- if (M)
632
+ return ((H = F.errors) == null ? void 0 : H.length) > 0 ? Array.isArray(F.errors) ? F.errors.join(", ") : F.errors || e("inventory.common.validationFailed") : W ? Q || e("inventory.common.invalidExcelFormat") : e("inventory.common.readyToImport");
633
+ }, K = (F, z) => {
634
+ if (F)
639
635
  for (const H of ["create", "update"]) {
640
- const V = M[H];
636
+ const V = F[H];
641
637
  if (V)
642
638
  for (const O of V)
643
639
  t.push({
@@ -678,7 +674,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
678
674
  function ye() {
679
675
  S.open({
680
676
  title: e("inventory.common.import"),
681
- contentComponent: Rt,
677
+ contentComponent: St,
682
678
  overlay: !0,
683
679
  closeButton: !0,
684
680
  primaryActions: {
@@ -698,7 +694,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
698
694
  m && m.workbook && m.availableSheets && (await ge(m), S.close()), f.value.length === 0 && S.close();
699
695
  }).onTertiary(() => {
700
696
  try {
701
- const m = pt();
697
+ const m = dt();
702
698
  h.open({
703
699
  title: e("inventory.common.export") + " " + e("inventory.ingredient.import.actions.downloadTemplate"),
704
700
  message: e("inventory.common.templateDownloaded", [m]),
@@ -714,10 +710,10 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
714
710
  });
715
711
  }
716
712
  async function ge(m) {
717
- g.value = m.workbook, f.value = [...m.availableSheets], s.value = {}, await me();
713
+ g.value = m.workbook, f.value = [...m.availableSheets], s.value = {}, p.value = [], await me();
718
714
  }
719
715
  async function me() {
720
- var t, k, j, J, W, Q, Y, K, M, z, H, V, O, de, ce;
716
+ var t, k, j, J, W, Q, Y, K, F, z, H, V, O, de, ce;
721
717
  if (!g.value || f.value.length === 0) {
722
718
  y.value = !0;
723
719
  return;
@@ -726,57 +722,57 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
726
722
  try {
727
723
  switch (m) {
728
724
  case "unit": {
729
- const X = g.value.Sheets.unit, I = await vt(X);
725
+ const X = g.value.Sheets.unit, I = await ct(X);
730
726
  I && (s.value = {
731
727
  ...s.value,
732
728
  _invalidExcel: I.invalidExcel || ((t = s.value) == null ? void 0 : t._invalidExcel),
733
729
  _invalidExcelMessage: I.invalidExcelMessage || ((k = s.value) == null ? void 0 : k._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Units sheet",
734
730
  units: I.importCreateResult || I.importUpdateResult ? {
735
- create: ((j = I.importCreateResult) == null ? void 0 : j.map((F) => ({
736
- ...F.unit,
737
- errors: F.errors
731
+ create: ((j = I.importCreateResult) == null ? void 0 : j.map(($) => ({
732
+ ...$.unit,
733
+ errors: $.errors
738
734
  }))) || [],
739
- update: ((J = I.importUpdateResult) == null ? void 0 : J.map((F) => ({
740
- ...F.unit,
741
- errors: F.errors
735
+ update: ((J = I.importUpdateResult) == null ? void 0 : J.map(($) => ({
736
+ ...$.unit,
737
+ errors: $.errors
742
738
  }))) || []
743
739
  } : (W = s.value) == null ? void 0 : W.units
744
740
  });
745
741
  break;
746
742
  }
747
743
  case "ingredient": {
748
- const X = g.value.Sheets.ingredient, I = await yt(X);
744
+ const X = g.value.Sheets.ingredient, I = await pt(X);
749
745
  I && (s.value = {
750
746
  ...s.value,
751
747
  _invalidExcel: I.invalidExcel || ((Q = s.value) == null ? void 0 : Q._invalidExcel),
752
748
  _invalidExcelMessage: I.invalidExcelMessage || ((Y = s.value) == null ? void 0 : Y._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Ingredients sheet",
753
749
  skus: I.importCreateResult || I.importUpdateResult ? {
754
- create: ((K = I.importCreateResult) == null ? void 0 : K.map((F) => ({
755
- ...F.sku,
756
- errors: F.errors
750
+ create: ((K = I.importCreateResult) == null ? void 0 : K.map(($) => ({
751
+ ...$.sku,
752
+ errors: $.errors
757
753
  }))) || [],
758
- update: ((M = I.importUpdateResult) == null ? void 0 : M.map((F) => ({
759
- ...F.sku,
760
- errors: F.errors
754
+ update: ((F = I.importUpdateResult) == null ? void 0 : F.map(($) => ({
755
+ ...$.sku,
756
+ errors: $.errors
761
757
  }))) || []
762
758
  } : (z = s.value) == null ? void 0 : z.skus
763
759
  });
764
760
  break;
765
761
  }
766
762
  case "recipe": {
767
- const X = g.value.Sheets.recipe, I = await gt(X);
763
+ const X = g.value.Sheets.recipe, I = await vt(X);
768
764
  I && (s.value = {
769
765
  ...s.value,
770
766
  _invalidExcel: I.invalidExcel || ((H = s.value) == null ? void 0 : H._invalidExcel),
771
767
  _invalidExcelMessage: I.invalidExcelMessage || ((V = s.value) == null ? void 0 : V._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Recipes sheet",
772
768
  recipes: I.importCreateResult || I.importUpdateResult ? {
773
- create: ((O = I.importCreateResult) == null ? void 0 : O.map((F) => ({
774
- ...F.recipe,
775
- errors: F.errors
769
+ create: ((O = I.importCreateResult) == null ? void 0 : O.map(($) => ({
770
+ ...$.recipe,
771
+ errors: $.errors
776
772
  }))) || [],
777
- update: ((de = I.importUpdateResult) == null ? void 0 : de.map((F) => ({
778
- ...F.recipe,
779
- errors: F.errors
773
+ update: ((de = I.importUpdateResult) == null ? void 0 : de.map(($) => ({
774
+ ...$.recipe,
775
+ errors: $.errors
780
776
  }))) || []
781
777
  } : (ce = s.value) == null ? void 0 : ce.recipes
782
778
  });
@@ -793,7 +789,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
793
789
  }
794
790
  }
795
791
  async function fe() {
796
- var m, t, k, j, J, W, Q, Y, K, M, z, H, V, O, de, ce, X, I, F, Ce, Ue, Ne, Ge, Te;
792
+ var m, t, k, j, J, W, Q, Y, K, F, z, H, V, O, de, ce, X, I, $, Ce, Ue, Ne, Ge, Te;
797
793
  if (s.value) {
798
794
  if (A.value) {
799
795
  h.open({
@@ -815,51 +811,51 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
815
811
  try {
816
812
  let L = 0, se = "";
817
813
  if (s.value.units && ((m = s.value.units.create) != null && m.length || (t = s.value.units.update) != null && t.length)) {
818
- const $ = {
814
+ const M = {
819
815
  create: ((k = s.value.units.create) == null ? void 0 : k.filter((v) => !v.errors || v.errors.length === 0)) || [],
820
816
  update: ((j = s.value.units.update) == null ? void 0 : j.filter((v) => !v.errors || v.errors.length === 0)) || []
821
817
  };
822
- if ($.create.length || $.update.length) {
823
- const v = await _.importUnits($);
818
+ if (M.create.length || M.update.length) {
819
+ const v = await _.importUnits(M);
824
820
  ((J = v == null ? void 0 : v.errors) == null ? void 0 : J.length) > 0 && p.value.push(...v.errors.map((ie) => ({
825
821
  type: "units",
826
822
  error: ie
827
823
  })));
828
- const ne = $.create.length + $.update.length, oe = ((W = v == null ? void 0 : v.errors) == null ? void 0 : W.length) || 0;
824
+ const ne = M.create.length + M.update.length, oe = ((W = v == null ? void 0 : v.errors) == null ? void 0 : W.length) || 0;
829
825
  L = ne - oe, se = "units", s.value = {
830
826
  ...s.value,
831
827
  units: null
832
828
  };
833
829
  }
834
830
  } else if (s.value.skus && ((Q = s.value.skus.create) != null && Q.length || (Y = s.value.skus.update) != null && Y.length)) {
835
- const $ = {
831
+ const M = {
836
832
  create: ((K = s.value.skus.create) == null ? void 0 : K.filter((v) => !v.errors || v.errors.length === 0)) || [],
837
- update: ((M = s.value.skus.update) == null ? void 0 : M.filter((v) => !v.errors || v.errors.length === 0)) || []
833
+ update: ((F = s.value.skus.update) == null ? void 0 : F.filter((v) => !v.errors || v.errors.length === 0)) || []
838
834
  };
839
- if ($.create.length || $.update.length) {
840
- const v = await _.importSkus($);
835
+ if (M.create.length || M.update.length) {
836
+ const v = await _.importSkus(M);
841
837
  ((z = v == null ? void 0 : v.errors) == null ? void 0 : z.length) > 0 && p.value.push(...v.errors.map((ie) => ({
842
838
  type: "ingredients",
843
839
  error: ie
844
840
  })));
845
- const ne = $.create.length + $.update.length, oe = ((H = v == null ? void 0 : v.errors) == null ? void 0 : H.length) || 0;
841
+ const ne = M.create.length + M.update.length, oe = ((H = v == null ? void 0 : v.errors) == null ? void 0 : H.length) || 0;
846
842
  L = ne - oe, se = "ingredients", s.value = {
847
843
  ...s.value,
848
844
  skus: null
849
845
  };
850
846
  }
851
847
  } else if (s.value.recipes && ((V = s.value.recipes.create) != null && V.length || (O = s.value.recipes.update) != null && O.length)) {
852
- const $ = {
848
+ const M = {
853
849
  create: ((de = s.value.recipes.create) == null ? void 0 : de.filter((v) => !v.errors || v.errors.length === 0)) || [],
854
850
  update: ((ce = s.value.recipes.update) == null ? void 0 : ce.filter((v) => !v.errors || v.errors.length === 0)) || []
855
851
  };
856
- if ($.create.length || $.update.length) {
857
- const v = await _.importRecipes($);
852
+ if (M.create.length || M.update.length) {
853
+ const v = await _.importRecipes(M);
858
854
  ((X = v == null ? void 0 : v.errors) == null ? void 0 : X.length) > 0 && p.value.push(...v.errors.map((ie) => ({
859
855
  type: "recipes",
860
856
  error: ie
861
857
  })));
862
- const ne = $.create.length + $.update.length, oe = ((I = v == null ? void 0 : v.errors) == null ? void 0 : I.length) || 0;
858
+ const ne = M.create.length + M.update.length, oe = ((I = v == null ? void 0 : v.errors) == null ? void 0 : I.length) || 0;
863
859
  L = ne - oe, se = "recipes", s.value = {
864
860
  ...s.value,
865
861
  recipes: null
@@ -867,10 +863,10 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
867
863
  }
868
864
  }
869
865
  if (L > 0) {
870
- const $ = p.value.filter((v) => v.type === se);
871
- $.length > 0 ? h.open({
866
+ const M = p.value.filter((v) => v.type === se);
867
+ M.length > 0 ? h.open({
872
868
  title: e("inventory.common.importCompletedWithIssues"),
873
- message: e("inventory.common.successfullyImported", [L, se, $.length, se]),
869
+ message: e("inventory.common.successfullyImported", [L, se, M.length, se]),
874
870
  type: "warning"
875
871
  }) : h.open({
876
872
  title: e("inventory.ingredient.import.success"),
@@ -880,10 +876,10 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
880
876
  }
881
877
  if (f.value.length > 0)
882
878
  await me();
883
- else if (!(s.value.units && (((F = s.value.units.create) == null ? void 0 : F.length) || ((Ce = s.value.units.update) == null ? void 0 : Ce.length)) || s.value.skus && (((Ue = s.value.skus.create) == null ? void 0 : Ue.length) || ((Ne = s.value.skus.update) == null ? void 0 : Ne.length)) || s.value.recipes && (((Ge = s.value.recipes.create) == null ? void 0 : Ge.length) || ((Te = s.value.recipes.update) == null ? void 0 : Te.length))))
879
+ else if (!(s.value.units && ((($ = s.value.units.create) == null ? void 0 : $.length) || ((Ce = s.value.units.update) == null ? void 0 : Ce.length)) || s.value.skus && (((Ue = s.value.skus.create) == null ? void 0 : Ue.length) || ((Ne = s.value.skus.update) == null ? void 0 : Ne.length)) || s.value.recipes && (((Ge = s.value.recipes.create) == null ? void 0 : Ge.length) || ((Te = s.value.recipes.update) == null ? void 0 : Te.length))))
884
880
  if (ue(), p.value.length > 0) {
885
881
  const v = p.value.filter((pe) => pe.type === "units").length, ne = p.value.filter((pe) => pe.type === "ingredients").length, oe = p.value.filter((pe) => pe.type === "recipes").length, ie = v + ne + oe;
886
- u.value = !0, h.open({
882
+ d.value = !0, h.open({
887
883
  title: e("inventory.common.importCompletedWithIssues"),
888
884
  message: e("inventory.common.importFinishedWithFailedItems", [ie, v, ne, oe]),
889
885
  type: "warning"
@@ -906,13 +902,13 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
906
902
  }
907
903
  }
908
904
  function ue() {
909
- y.value = !1, u.value = !1, s.value = null, f.value = [], g.value = null;
905
+ y.value = !1, d.value = !1, s.value = null, f.value = [], g.value = null;
910
906
  }
911
907
  function be() {
912
- u.value = !1, p.value = [];
908
+ d.value = !1, p.value = [];
913
909
  }
914
910
  function he() {
915
- d.value = !1, c.value = null;
911
+ c.value = !1, u.value = null;
916
912
  }
917
913
  const xe = q(() => [
918
914
  {
@@ -921,7 +917,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
921
917
  isPrimary: !1,
922
918
  prependIcon: "upload"
923
919
  }
924
- ]), _e = $e([
920
+ ]), _e = Me([
925
921
  {
926
922
  id: "name",
927
923
  accessorKey: "name",
@@ -951,7 +947,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
951
947
  return t === e("inventory.common.readyToImport") ? k += " bg-blue-100 text-blue-800 border border-blue-200" : t === "Imported" || t === "Successfully Imported" ? k += " bg-green-100 text-green-800 border border-green-200" : t === "Failed" ? k += " bg-red-100 text-red-800 border border-red-200" : t === e("inventory.common.validationFailed") ? k += " bg-orange-100 text-orange-800 border border-orange-200" : (t.includes("Invalid Excel"), k += " bg-red-100 text-red-800 border border-red-200"), we("div", { class: k, title: t }, t);
952
948
  }
953
949
  }
954
- ]), Ie = $e([
950
+ ]), Ee = Me([
955
951
  {
956
952
  id: "name",
957
953
  accessorKey: "name",
@@ -980,7 +976,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
980
976
  ]);
981
977
  return (m, t) => {
982
978
  const k = ee("FmIcon"), j = ee("FmButton"), J = ee("FmTable"), W = ee("FmCard"), Q = ee("FmSideSheet"), Y = ee("FmSpinner");
983
- return i(x).isLoaded && i(x).enableBulkImport ? (N(), ae(Ee, {
979
+ return i(x).isLoaded && i(x).enableBulkImport ? (N(), ae(Se, {
984
980
  key: 0,
985
981
  title: i(e)("inventory.common.import"),
986
982
  actions: xe.value,
@@ -998,37 +994,37 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
998
994
  }
999
995
  ])
1000
996
  }, [
1001
- y.value ? te("", !0) : (N(), P("div", Ct, [
1002
- n("div", Ut, [
997
+ y.value ? te("", !0) : (N(), P("div", kt, [
998
+ n("div", Rt, [
1003
999
  B(k, {
1004
1000
  name: "info",
1005
1001
  class: "text-blue-600 mt-2"
1006
1002
  }),
1007
- n("div", Nt, [
1008
- n("div", Gt, a(i(e)("inventory.ingredient.import.multiUploadTemplateInstruction")), 1),
1009
- n("div", Tt, [
1010
- n("div", $t, [
1003
+ n("div", Ct, [
1004
+ n("div", Ut, a(i(e)("inventory.ingredient.import.multiUploadTemplateInstruction")), 1),
1005
+ n("div", Nt, [
1006
+ n("div", Gt, [
1011
1007
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
1012
1008
  ]),
1013
1009
  t[39] || (t[39] = E(" 1. ")),
1014
1010
  n("span", {
1015
1011
  innerHTML: i(e)("inventory.ingredient.import.importInstructions.step1")
1016
- }, null, 8, Mt),
1012
+ }, null, 8, Tt),
1017
1013
  t[40] || (t[40] = n("br", null, null, -1)),
1018
1014
  t[41] || (t[41] = E(" 2. ")),
1019
1015
  n("span", {
1020
1016
  innerHTML: i(e)("inventory.ingredient.import.importInstructions.step2")
1021
- }, null, 8, Ft),
1017
+ }, null, 8, Mt),
1022
1018
  t[42] || (t[42] = n("br", null, null, -1)),
1023
1019
  E(" 3. " + a(i(e)("inventory.ingredient.import.importInstructions.step3")), 1),
1024
1020
  t[43] || (t[43] = n("br", null, null, -1)),
1025
1021
  E(" 4. " + a(i(e)("inventory.ingredient.import.importInstructions.step4")), 1),
1026
1022
  t[44] || (t[44] = n("br", null, null, -1)),
1027
1023
  t[45] || (t[45] = n("br", null, null, -1)),
1028
- n("div", Dt, [
1024
+ n("div", Ft, [
1029
1025
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
1030
1026
  ]),
1031
- n("div", At, [
1027
+ n("div", $t, [
1032
1028
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.title")), 1),
1033
1029
  E(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.description")), 1),
1034
1030
  t[1] || (t[1] = n("br", null, null, -1)),
@@ -1050,7 +1046,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
1050
1046
  t[12] || (t[12] = E(" • ")),
1051
1047
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col6")), 1)
1052
1048
  ]),
1053
- n("div", Bt, [
1049
+ n("div", Dt, [
1054
1050
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.title")), 1),
1055
1051
  E(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.description")), 1),
1056
1052
  t[13] || (t[13] = n("br", null, null, -1)),
@@ -1069,7 +1065,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
1069
1065
  t[22] || (t[22] = E(" • ")),
1070
1066
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col5")), 1)
1071
1067
  ]),
1072
- n("div", Pt, [
1068
+ n("div", At, [
1073
1069
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.title")), 1),
1074
1070
  E(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.description")), 1),
1075
1071
  t[23] || (t[23] = n("br", null, null, -1)),
@@ -1097,22 +1093,22 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
1097
1093
  t[38] || (t[38] = E(" • ")),
1098
1094
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col8")), 1)
1099
1095
  ]),
1100
- n("div", jt, [
1096
+ n("div", Bt, [
1101
1097
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.warning")), 1)
1102
1098
  ])
1103
1099
  ])
1104
1100
  ])
1105
1101
  ])
1106
1102
  ])),
1107
- y.value ? (N(), P("div", Ot, [
1108
- n("div", Ht, [
1103
+ y.value ? (N(), P("div", Pt, [
1104
+ n("div", jt, [
1109
1105
  n("div", null, [
1110
- n("div", zt, a(i(e)("inventory.common.importPreview")), 1),
1111
- n("div", Kt, [
1112
- A.value ? (N(), P("span", Wt, a(i(e)("inventory.common.errorExist")) + ": " + a(U.value), 1)) : C.value ? (N(), P("span", Vt, a(i(e)("inventory.common.someItemsValidationErrors")), 1)) : (N(), P("span", Lt, a(i(e)("inventory.common.allItemsValidReadyImport")), 1))
1106
+ n("div", Ot, a(i(e)("inventory.common.importPreview")), 1),
1107
+ n("div", Ht, [
1108
+ A.value ? (N(), P("span", zt, a(i(e)("inventory.common.errorExist")) + ": " + a(U.value), 1)) : C.value ? (N(), P("span", Kt, a(i(e)("inventory.common.someItemsValidationErrors")), 1)) : (N(), P("span", Wt, a(i(e)("inventory.common.allItemsValidReadyImport")), 1))
1113
1109
  ])
1114
1110
  ]),
1115
- n("div", Jt, [
1111
+ n("div", Vt, [
1116
1112
  B(j, {
1117
1113
  variant: "secondary",
1118
1114
  onClick: ue,
@@ -1127,7 +1123,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
1127
1123
  }, null, 8, ["loading", "disabled", "label"])
1128
1124
  ])
1129
1125
  ]),
1130
- n("div", Xt, [
1126
+ n("div", Lt, [
1131
1127
  B(J, {
1132
1128
  "column-defs": _e.value,
1133
1129
  "row-data": b.value,
@@ -1138,13 +1134,13 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
1138
1134
  }, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
1139
1135
  ])
1140
1136
  ])) : te("", !0),
1141
- u.value && p.value.length > 0 ? (N(), P("div", qt, [
1142
- n("div", Qt, [
1137
+ d.value && p.value.length > 0 ? (N(), P("div", Jt, [
1138
+ n("div", Xt, [
1143
1139
  n("div", null, [
1144
- n("div", Yt, a(i(e)("inventory.common.importErrors")), 1),
1145
- n("div", Zt, a(p.value.length) + " " + a(i(e)("inventory.common.itemsFailedImport")), 1)
1140
+ n("div", qt, a(i(e)("inventory.common.importErrors")), 1),
1141
+ n("div", Qt, a(p.value.length) + " " + a(i(e)("inventory.common.itemsFailedImport")), 1)
1146
1142
  ]),
1147
- n("div", en, [
1143
+ n("div", Yt, [
1148
1144
  B(j, {
1149
1145
  variant: "secondary",
1150
1146
  onClick: be,
@@ -1152,9 +1148,9 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
1152
1148
  }, null, 8, ["label"])
1153
1149
  ])
1154
1150
  ]),
1155
- n("div", tn, [
1151
+ n("div", Zt, [
1156
1152
  B(J, {
1157
- "column-defs": Ie.value,
1153
+ "column-defs": Ee.value,
1158
1154
  "row-data": T.value,
1159
1155
  "page-size": r.value,
1160
1156
  "search-value": o.value,
@@ -1165,14 +1161,14 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
1165
1161
  ])) : te("", !0)
1166
1162
  ], 2),
1167
1163
  B(Q, {
1168
- "model-value": d.value,
1169
- "onUpdate:modelValue": t[0] || (t[0] = (M) => d.value = M),
1170
- header: `${(K = c.value) == null ? void 0 : K.type} Details`,
1164
+ "model-value": c.value,
1165
+ "onUpdate:modelValue": t[0] || (t[0] = (F) => c.value = F),
1166
+ header: `${(K = u.value) == null ? void 0 : K.type} Details`,
1171
1167
  "max-width": 600,
1172
1168
  "dismiss-away": ""
1173
1169
  }, {
1174
1170
  "side-sheet-footer": Z(() => [
1175
- n("div", wn, [
1171
+ n("div", xn, [
1176
1172
  B(j, {
1177
1173
  label: i(e)("inventory.common.close"),
1178
1174
  variant: "tertiary",
@@ -1181,55 +1177,55 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
1181
1177
  ])
1182
1178
  ]),
1183
1179
  default: Z(() => [
1184
- c.value != null ? (N(), P("div", nn, [
1180
+ u.value != null ? (N(), P("div", en, [
1185
1181
  B(W, {
1186
1182
  variant: "outlined",
1187
1183
  class: "p-16"
1188
1184
  }, {
1189
1185
  default: Z(() => {
1190
- var M, z, H, V, O;
1186
+ var F, z, H, V, O;
1191
1187
  return [
1192
- n("div", on, a(i(e)("inventory.common.basicInformation")), 1),
1193
- n("div", rn, [
1188
+ n("div", tn, a(i(e)("inventory.common.basicInformation")), 1),
1189
+ n("div", nn, [
1194
1190
  n("div", null, [
1195
- n("div", sn, a(i(e)("inventory.common.name")), 1),
1196
- n("div", an, a(((z = (M = c.value) == null ? void 0 : M.details) == null ? void 0 : z.name) || ((H = c.value) == null ? void 0 : H.name)), 1)
1191
+ n("div", on, a(i(e)("inventory.common.name")), 1),
1192
+ n("div", rn, a(((z = (F = u.value) == null ? void 0 : F.details) == null ? void 0 : z.name) || ((H = u.value) == null ? void 0 : H.name)), 1)
1197
1193
  ]),
1198
- (O = (V = c.value) == null ? void 0 : V.details) != null && O.code ? (N(), P("div", ln, [
1199
- n("div", mn, a(i(e)("inventory.common.code")), 1),
1200
- n("div", un, a(c.value.details.code), 1)
1194
+ (O = (V = u.value) == null ? void 0 : V.details) != null && O.code ? (N(), P("div", sn, [
1195
+ n("div", an, a(i(e)("inventory.common.code")), 1),
1196
+ n("div", ln, a(u.value.details.code), 1)
1201
1197
  ])) : te("", !0),
1202
1198
  n("div", null, [
1203
- n("div", dn, a(i(e)("inventory.common.type")), 1),
1204
- n("div", cn, a(c.value.type), 1)
1199
+ n("div", mn, a(i(e)("inventory.common.type")), 1),
1200
+ n("div", un, a(u.value.type), 1)
1205
1201
  ]),
1206
1202
  n("div", null, [
1207
- n("div", pn, a(i(e)("inventory.common.operation")), 1),
1208
- n("div", vn, a(c.value.operation), 1)
1203
+ n("div", dn, a(i(e)("inventory.common.operation")), 1),
1204
+ n("div", cn, a(u.value.operation), 1)
1209
1205
  ]),
1210
1206
  n("div", null, [
1211
- n("div", yn, a(i(e)("inventory.common.status")), 1),
1207
+ n("div", pn, a(i(e)("inventory.common.status")), 1),
1212
1208
  n("div", {
1213
1209
  class: ve([
1214
1210
  "inline-block px-8 py-4 rounded text-sm",
1215
- c.value.status !== i(e)("inventory.common.readyToImport") ? "bg-red-100 text-red-800 border border-red-200" : "bg-green-100 text-green-800 border border-green-200"
1211
+ u.value.status !== i(e)("inventory.common.readyToImport") ? "bg-red-100 text-red-800 border border-red-200" : "bg-green-100 text-green-800 border border-green-200"
1216
1212
  ])
1217
- }, a(c.value.status), 3)
1213
+ }, a(u.value.status), 3)
1218
1214
  ])
1219
1215
  ])
1220
1216
  ];
1221
1217
  }),
1222
1218
  _: 1
1223
1219
  }),
1224
- c.value.errors && c.value.errors.length > 0 ? (N(), ae(W, {
1220
+ u.value.errors && u.value.errors.length > 0 ? (N(), ae(W, {
1225
1221
  key: 0,
1226
1222
  variant: "outlined",
1227
1223
  class: "p-16"
1228
1224
  }, {
1229
1225
  default: Z(() => [
1230
- n("div", gn, a(i(e)("inventory.common.validationErrors")), 1),
1231
- n("div", fn, [
1232
- (N(!0), P(Be, null, Pe(c.value.errors, (M, z) => (N(), P("div", {
1226
+ n("div", vn, a(i(e)("inventory.common.validationErrors")), 1),
1227
+ n("div", yn, [
1228
+ (N(!0), P(Ae, null, Be(u.value.errors, (F, z) => (N(), P("div", {
1233
1229
  key: z,
1234
1230
  class: "flex items-start gap-8 p-12 bg-red-50 border border-red-200 rounded"
1235
1231
  }, [
@@ -1238,7 +1234,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
1238
1234
  class: "text-red-600 mt-2",
1239
1235
  size: "sm"
1240
1236
  }),
1241
- n("div", bn, a(M), 1)
1237
+ n("div", gn, a(F), 1)
1242
1238
  ]))), 128))
1243
1239
  ])
1244
1240
  ]),
@@ -1249,9 +1245,9 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
1249
1245
  class: "p-16"
1250
1246
  }, {
1251
1247
  default: Z(() => [
1252
- n("div", hn, a(i(e)("inventory.common.rawData")), 1),
1253
- n("div", xn, [
1254
- n("pre", _n, a(JSON.stringify(c.value.details, null, 2)), 1)
1248
+ n("div", fn, a(i(e)("inventory.common.rawData")), 1),
1249
+ n("div", bn, [
1250
+ n("pre", hn, a(JSON.stringify(u.value.details, null, 2)), 1)
1255
1251
  ])
1256
1252
  ]),
1257
1253
  _: 1
@@ -1263,33 +1259,33 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
1263
1259
  ];
1264
1260
  }),
1265
1261
  _: 1
1266
- }, 8, ["title", "actions"])) : i(x).isLoaded ? (N(), ae(Ee, {
1262
+ }, 8, ["title", "actions"])) : i(x).isLoaded ? (N(), ae(Se, {
1267
1263
  key: 2,
1268
1264
  title: i(e)("inventory.common.import")
1269
1265
  }, {
1270
1266
  default: Z(() => [
1271
- n("div", kn, [
1267
+ n("div", En, [
1272
1268
  B(k, {
1273
1269
  name: "block",
1274
1270
  class: "text-gray-400",
1275
1271
  size: "xl"
1276
1272
  }),
1277
- n("div", Rn, [
1278
- n("div", Cn, a(i(e)("inventory.common.featureNotAvailable")), 1),
1279
- n("div", Un, a(i(e)("inventory.common.bulkImportNotEnabled")), 1)
1273
+ n("div", Sn, [
1274
+ n("div", kn, a(i(e)("inventory.common.featureNotAvailable")), 1),
1275
+ n("div", Rn, a(i(e)("inventory.common.bulkImportNotEnabled")), 1)
1280
1276
  ])
1281
1277
  ])
1282
1278
  ]),
1283
1279
  _: 1
1284
- }, 8, ["title"])) : (N(), ae(Ee, {
1280
+ }, 8, ["title"])) : (N(), ae(Se, {
1285
1281
  key: 1,
1286
1282
  title: i(e)("inventory.common.import")
1287
1283
  }, {
1288
1284
  default: Z(() => [
1289
- n("div", In, [
1285
+ n("div", _n, [
1290
1286
  B(Y, { size: "lg" }),
1291
- n("div", En, [
1292
- n("div", Sn, a(i(e)("inventory.common.loading")), 1)
1287
+ n("div", wn, [
1288
+ n("div", In, a(i(e)("inventory.common.loading")), 1)
1293
1289
  ])
1294
1290
  ])
1295
1291
  ]),
@@ -1299,5 +1295,5 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
1299
1295
  }
1300
1296
  });
1301
1297
  export {
1302
- Dn as default
1298
+ Fn as default
1303
1299
  };