@feedmepos/mf-inventory-portal 1.7.11-dev.0 → 1.7.11

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 (129) hide show
  1. package/dist/App-C_6oyWjy.js +311 -0
  2. package/dist/{ApprovalView-3pDiNOMO.js → ApprovalView-Dn0-OeH0.js} +9 -9
  3. package/dist/{BindingsDialog-CEXDujwo.js → BindingsDialog-BVVu8xWS.js} +2 -2
  4. package/dist/{BindingsPicker-UfogQ71P.js → BindingsPicker-krMKURKj.js} +2 -2
  5. package/dist/{BindingsTable-qxNINfoB.js → BindingsTable-CLiGmTHB.js} +4 -4
  6. package/dist/BulkReceiveRequestView-FKdv9h5_.js +2595 -0
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Dyy-mkOF.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BYtJnIsF.js} +1 -1
  8. package/dist/{ClosingDraftView-DgLOKZZv.js → ClosingDraftView-fUMDbnI6.js} +1201 -1235
  9. package/dist/{ClosingHistoryView-BMcoewSW.js → ClosingHistoryView-Cfvkxwlh.js} +5 -5
  10. package/dist/{ClosingTemplateView-C85_eRfx.js → ClosingTemplateView-DtIeSknz.js} +16 -16
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CIXV7TwL.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-Bz7CjD7v.js} +1 -1
  12. package/dist/{DefaultView-BCPdBP97.js → DefaultView-BbN62d8p.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-DvKOE8bs.js → DeliveryOrderPrintPreview-91UH3oJ8.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-D0XF1ILm.js → EmailDialog.vue_vue_type_script_setup_true_lang-DDunnzgw.js} +4106 -4111
  15. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-kTHffgJ0.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CKlpaNGP.js} +6 -6
  16. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D6T3zCf3.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DOqGzn08.js} +2 -2
  17. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-NuIzfwdk.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CxdQsFqQ.js} +2 -2
  18. package/dist/{FmMultiselectDialog-CE-n4_oS.js → FmMultiselectDialog-BEVkUX96.js} +1 -1
  19. package/dist/{FmMultiselectDialog-DAJZwLbn.js → FmMultiselectDialog-Dg70WmLs.js} +2 -2
  20. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BKfT_BMX.js → FmUnitInput.vue_vue_type_script_setup_true_lang-RQ44PYLb.js} +6 -6
  21. package/dist/{ImportView-CGgk98bu.js → ImportView-C0hAMz8m.js} +496 -499
  22. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-D19a-cBS.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-C6SNYEJl.js} +1 -1
  23. package/dist/{IngredientGroupView-CQ-spqfv.js → IngredientGroupView-CRGyWM_X.js} +5 -5
  24. package/dist/{IngredientsView-BDuPrYSY.js → IngredientsView-C7CVkoou.js} +17 -18
  25. package/dist/{IntegrationExplorerView-DXMTYLFQ.js → IntegrationExplorerView-2nvAOHbA.js} +4 -4
  26. package/dist/{IntegrationView-B6qaoyfJ.js → IntegrationView-CYSaTE2T.js} +14 -14
  27. package/dist/{InventoryBindingForm-Cj5DSxr7.js → InventoryBindingForm-CezLMw2l.js} +1 -1
  28. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CJ1HyFqS.js +441 -0
  29. package/dist/{InventoryBindingSummary-DTdjcASy.js → InventoryBindingSummary-QOztXyC8.js} +1 -1
  30. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-L_Mk0z6y.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BT0zK5o_.js} +1 -1
  31. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BnjSVqIF.js → PremiumBadge.vue_vue_type_script_setup_true_lang-_w5kZ9SM.js} +1 -1
  32. package/dist/{ProductionView-W2-oSNQn.js → ProductionView-BveNOlcK.js} +7 -7
  33. package/dist/{PublishView-DEX148S9.js → PublishView-bmecemJd.js} +3 -3
  34. package/dist/{PurchaseOrderPrintPreview-DN8TnmIP.js → PurchaseOrderPrintPreview-CDvO6BLm.js} +2 -2
  35. package/dist/{ReceiveRequestView-C3ExFs2T.js → ReceiveRequestView-CwVQ-KzO.js} +14 -14
  36. package/dist/RecipeView-B32tleCa.js +3584 -0
  37. package/dist/{SettingsView-Bv0BdRhB.js → SettingsView-DJcAum3t.js} +4 -4
  38. package/dist/{StockView-Cx2I8wc7.js → StockView-GDvWxpOJ.js} +21 -21
  39. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-D3AxBfTX.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DcCO7HHD.js} +1 -1
  40. package/dist/{SupplierView-n8tQo7GX.js → SupplierView-C3S8tTyF.js} +12 -12
  41. package/dist/{SurchargeView-BSq_i2LS.js → SurchargeView-skaVlUu3.js} +6 -6
  42. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DrVYEbqs.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-BrBgjPjN.js} +2 -2
  43. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DHbTvUSw.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BcvXD9Kt.js} +1 -1
  44. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-AZjFZAHD.js → TransferDetails.vue_vue_type_script_setup_true_lang-BO6vRibE.js} +1575 -1639
  45. package/dist/{TransferTemplateView-D29atWbe.js → TransferTemplateView-j6GNvA2S.js} +20 -20
  46. package/dist/{UnitCostHistoryView-Bc75dnSv.js → UnitCostHistoryView-0H_0-DbA.js} +4 -4
  47. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BL-N9tyu.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DJa1AaL2.js} +4 -4
  48. package/dist/{UnitView-CP452QJB.js → UnitView-CSD1Gnsb.js} +8 -8
  49. package/dist/{WarehouseView-hAFZ3OgC.js → WarehouseView-Cua66P5F.js} +5 -5
  50. package/dist/{WastageTemplateView-BHoD95B4.js → WastageTemplateView-kvuJXBiI.js} +14 -14
  51. package/dist/api/inventory.d.ts +2 -0
  52. package/dist/api/purchase-order.d.ts +0 -2
  53. package/dist/{app-DMuIqNOV.js → app-Bon7qTu5.js} +9140 -10029
  54. package/dist/app.d.ts +9 -900
  55. package/dist/app.js +1 -1
  56. package/dist/{closing-template-vfraoomZ.js → closing-template-BjekEF5s.js} +1 -1
  57. package/dist/components/MultiLocationSelector.vue.d.ts +2 -0
  58. package/dist/{date2-nHWr0vbq.js → date2-BXEHP1It.js} +5 -5
  59. package/dist/{dayjs.min-CWDZGPnC.js → dayjs.min-iFbgqyzU.js} +1 -1
  60. package/dist/{decimal-BRpZx0Ku.js → decimal-BIi1j8fj.js} +2 -2
  61. package/dist/{defineDeepModel-Cpd1mYyq.js → defineDeepModel-IMW3a6OW.js} +1 -1
  62. package/dist/{duplicate-template-D0SC2p3z.js → duplicate-template-DFciXweZ.js} +1 -1
  63. package/dist/{feature-_LWb4rW0.js → feature-CNI4MMSc.js} +2 -2
  64. package/dist/{format-time-from-id-Dl3MwzI7.js → format-time-from-id-DDH3ceGb.js} +1 -1
  65. package/dist/{format-unit-display-DWI0rLun.js → format-unit-display-Dp383g0F.js} +27 -27
  66. package/dist/{import-export.helper-B0Y6WK3R.js → import-export.helper-BPK_S1mX.js} +6 -6
  67. package/dist/{index-7XQuT32d.js → index-BbhrAzLH.js} +1 -1
  68. package/dist/{index-BSnZJjFV.js → index-BeP05_CC.js} +3 -3
  69. package/dist/{index-BpvlLCUv.js → index-D20KUiXn.js} +3232 -3306
  70. package/dist/{inventory-core-dart.default-DGcUQGOR.js → inventory-core-dart.default-B7F_lZ7E.js} +1 -1
  71. package/dist/{lz-string-Lbge8hci.js → lz-string-C_xIP_0T.js} +1 -1
  72. package/dist/{netsuite-CFXLrvd1.js → netsuite-a6M2ml9V.js} +2 -3
  73. package/dist/{number-B7y_oaIm.js → number-4OG2ZSmc.js} +3 -3
  74. package/dist/{predefined-templates-SX1B-fCF.js → predefined-templates-CjXICvUU.js} +1 -1
  75. package/dist/{purchase-order-template-qKmMGW-y.js → purchase-order-template-CXdomQWy.js} +1 -1
  76. package/dist/{recalculationUtils-DdG6rZr1.js → recalculationUtils-CEAhd7BW.js} +1 -1
  77. package/dist/{rules-DRizXY3Q.js → rules-Dvr47IAA.js} +2 -2
  78. package/dist/{stock-CAlt5MDT.js → stock-Caf05ukJ.js} +3 -3
  79. package/dist/{stock-BAMK_7xp.js → stock-DEOhLNew.js} +1 -1
  80. package/dist/stores/bulk-job.d.ts +0 -13
  81. package/dist/stores/location.d.ts +14 -0
  82. package/dist/style.css +1 -1
  83. package/dist/{supplier-B34rnmVy.js → supplier-BvHSfhV9.js} +2 -2
  84. package/dist/{surcharge-CMBDRIiD.js → surcharge-Cu0KfPTD.js} +8 -8
  85. package/dist/tsconfig.app.tsbuildinfo +1 -1
  86. package/dist/{uom-rules-DE4OV7iK.js → uom-rules-D71zOsgd.js} +1 -1
  87. package/dist/{use-ingredient-select-dialog-4yUGH4g0.js → use-ingredient-select-dialog-DZzvq4UK.js} +2 -2
  88. package/dist/{use-inventory-binding-dialog-CY42PPSW.js → use-inventory-binding-dialog-C1focrkJ.js} +2 -2
  89. package/dist/{use-template-enabled-locations-BhYnNMZ_.js → use-template-enabled-locations-DMcKtqkt.js} +2 -2
  90. package/dist/{use-transfer-locations-agCdJKE0.js → use-transfer-locations-DJttEyyP.js} +2 -2
  91. package/dist/{useHrmPermission-BQxDr0db.js → useHrmPermission-DaLaaQR9.js} +1 -1
  92. package/dist/{useNavigationMenu-Cm5dPWI-.js → useNavigationMenu-CoX50gGK.js} +2 -2
  93. package/dist/{useSseClient-DkX7GX1_.js → useSseClient-DTpRYQC7.js} +1 -1
  94. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +0 -2
  95. package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +0 -2
  96. package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryRecipeBindingV2Field.vue.d.ts +0 -4
  97. package/dist/views/receive-request/components/email-dialog/EmailDialogProps.d.ts +9 -23
  98. package/dist/views/recipe/composables/use-recipe-table.d.ts +0 -11
  99. package/dist/{vue-i18n-CsKZo5u4.js → vue-i18n-BC7M3p_r.js} +460 -460
  100. package/dist/{xlsx.util-Cy5DyLlu.js → xlsx.util-D7HlgjJM.js} +2 -2
  101. package/package.json +3 -3
  102. package/dist/App-8RkTRU8A.js +0 -1434
  103. package/dist/BulkReceiveRequestView-BOz0aMxF.js +0 -2657
  104. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bj4R7KQF.js +0 -563
  105. package/dist/RecipeView-BYeKfM6_.js +0 -3625
  106. package/dist/api/changelog.d.ts +0 -132
  107. package/dist/views/changelog/components/ChangelogDialog.vue.d.ts +0 -19
  108. package/dist/views/changelog/components/ChangelogFloatingButton.vue.d.ts +0 -2
  109. package/dist/views/changelog/components/ChangelogPanel.spec.d.ts +0 -1
  110. package/dist/views/changelog/components/ChangelogPanel.vue.d.ts +0 -20
  111. package/dist/views/changelog/composables/change-path.d.ts +0 -10
  112. package/dist/views/changelog/composables/commit-message.d.ts +0 -9
  113. package/dist/views/changelog/composables/commit-message.spec.d.ts +0 -1
  114. package/dist/views/changelog/composables/json-line-diff.d.ts +0 -10
  115. package/dist/views/changelog/composables/json-line-diff.spec.d.ts +0 -1
  116. package/dist/views/changelog/composables/use-changelog.d.ts +0 -90
  117. package/dist/views/changelog/composables/use-changelog.spec.d.ts +0 -1
  118. package/dist/views/changelog/composables/use-inventory-record-commits.d.ts +0 -97
  119. package/dist/views/changelog/composables/use-inventory-record-commits.spec.d.ts +0 -1
  120. package/dist/views/changelog/composables/use-snapshot-diff.d.ts +0 -29
  121. package/dist/views/changelog/composables/use-snapshot-diff.spec.d.ts +0 -1
  122. package/dist/views/changelog/composables/value-tree.d.ts +0 -14
  123. package/dist/views/changelog/composables/value-tree.spec.d.ts +0 -1
  124. package/dist/views/import/helper/submit-rows.d.ts +0 -13
  125. package/dist/views/import/helper/submit-rows.spec.d.ts +0 -1
  126. package/dist/views/ingredients/components/inventory-binding/RecipeBindingBreakdown.vue.d.ts +0 -25
  127. package/dist/views/ingredients/components/inventory-binding/composables/recipe-breakdown.d.ts +0 -34
  128. package/dist/views/ingredients/components/inventory-binding/composables/recipe-breakdown.spec.d.ts +0 -1
  129. package/dist/views/receive-request/components/email-dialog/EmailDialog.spec.d.ts +0 -1
@@ -1,58 +1,58 @@
1
- import { defineComponent as Te, ref as F, computed as L, watch as Be, resolveComponent as Q, createElementBlock as D, openBlock as T, createVNode as A, createCommentVNode as Y, unref as i, normalizeClass as ce, createSlots as Pe, withCtx as q, createElementVNode as n, createBlock as se, toDisplayString as a, Fragment as Me, renderList as $e, shallowRef as Ue, h as Ie, createTextVNode as C } from "vue";
2
- import { u as je, _ as ke } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
3
- import { useCoreStore as Re, useI18n as Fe } from "@feedmepos/mf-common";
4
- import { useDialogChild as Oe, useSnackbar as Ae, useDialog as He, useBreakpoints as ze } from "@feedmepos/ui-library";
5
- import { u as Ke } from "./feature-_LWb4rW0.js";
6
- import { a as ie } from "./app-DMuIqNOV.js";
7
- import "./dayjs.min-CWDZGPnC.js";
1
+ import { defineComponent as De, ref as F, computed as J, watch as ze, resolveComponent as Y, createElementBlock as D, openBlock as N, createVNode as A, createCommentVNode as Z, unref as i, normalizeClass as ce, createSlots as Ke, withCtx as Q, createElementVNode as n, createBlock as se, toDisplayString as a, Fragment as Be, renderList as Pe, shallowRef as $e, h as Ie, createTextVNode as k } from "vue";
2
+ import { u as Ve, _ as ke } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
3
+ import { useCoreStore as Re, useI18n as je } from "@feedmepos/mf-common";
4
+ import { useDialogChild as We, useSnackbar as Oe, useDialog as Le, useBreakpoints as Je } from "@feedmepos/ui-library";
5
+ import { u as Xe } from "./feature-CNI4MMSc.js";
6
+ import { a as ie } from "./app-Bon7qTu5.js";
7
+ import "./dayjs.min-iFbgqyzU.js";
8
8
  import "./app-C39bYJmq.js";
9
9
  import "./FmAdminBadge-DlplQOHb.js";
10
- import { s as De, a as Ve, d as We, t as Ce, r as Le } from "./xlsx.util-Cy5DyLlu.js";
11
- import { s as Je, g as Xe, b as qe, d as Ge } from "./import-export.helper-B0Y6WK3R.js";
12
- import { r as Qe } from "./random-CSbEbElR.js";
13
- import { c as Ne, a as pe } from "./number-B7y_oaIm.js";
14
- import { F as Ye } from "./FmDroppableField-J0tG_U3w.js";
10
+ import { s as He, a as qe, d as Qe, t as Ce, r as Ye } from "./xlsx.util-D7HlgjJM.js";
11
+ import { s as Ze, g as et, b as tt, d as Fe } from "./import-export.helper-BPK_S1mX.js";
12
+ import { r as nt } from "./random-CSbEbElR.js";
13
+ import { c as Ae, a as pe } from "./number-4OG2ZSmc.js";
14
+ import { F as ot } from "./FmDroppableField-J0tG_U3w.js";
15
15
  function Ee() {
16
- return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${Qe()}`;
16
+ return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${nt()}`;
17
17
  }
18
- function Ze(U) {
18
+ function rt(U) {
19
19
  const [
20
20
  e,
21
- S,
22
- y,
23
- b,
24
- k,
21
+ R,
22
+ g,
25
23
  h,
24
+ E,
25
+ x,
26
26
  ...r
27
- ] = De(U);
28
- if (!e || !e.length || e.some((c) => c.length && !c.startsWith("system:")))
27
+ ] = He(U);
28
+ if (!e || !e.length || e.some((p) => p.length && !p.startsWith("system:")))
29
29
  throw new Error("Missing meta header. Excel file does not come from the template.");
30
- const l = e.map((c) => c.split(":")[1]), u = ["name", "symbol", "precision"].filter((c) => !l.includes(c));
30
+ const l = e.map((p) => p.split(":")[1]), u = ["name", "symbol", "precision"].filter((p) => !l.includes(p));
31
31
  if (u.length)
32
32
  throw new Error(
33
33
  `Missing meta headers (${u.join()}). Excel file does not come from the template.`
34
34
  );
35
- return r.map((c, f) => {
36
- const g = {};
35
+ return r.map((p, b) => {
36
+ const f = {};
37
37
  for (const d in l) {
38
38
  const o = l[d];
39
- Object.assign(g, { [o]: c[d] });
39
+ Object.assign(f, { [o]: p[d] });
40
40
  }
41
41
  return {
42
- index: f,
43
- data: g
42
+ index: b,
43
+ data: f
44
44
  };
45
45
  });
46
46
  }
47
- function et(U) {
47
+ function st(U) {
48
48
  try {
49
- const e = Ze(U).filter((r) => {
50
- const { name: l, symbol: s, precision: u, measurement_name: p, measurement_symbol: c, measurement_conversion: f } = r.data;
51
- return l || s || u || p || c || f;
52
- }), y = ie().units, b = [], k = [], h = {};
49
+ const e = rt(U).filter((r) => {
50
+ const { name: l, symbol: s, precision: u, measurement_name: v, measurement_symbol: p, measurement_conversion: b } = r.data;
51
+ return l || s || u || v || p || b;
52
+ }), g = ie().units, h = [], E = [], x = {};
53
53
  for (const r of e)
54
54
  if (r.data.name && r.data.symbol)
55
- h[r.data.name] = {
55
+ x[r.data.name] = {
56
56
  unit: {
57
57
  name: r.data.name,
58
58
  abbrev: r.data.symbol,
@@ -60,33 +60,33 @@ function et(U) {
60
60
  measurements: []
61
61
  },
62
62
  rowNumber: r.index
63
- }, r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && h[r.data.name].unit.measurements.push({
63
+ }, r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && x[r.data.name].unit.measurements.push({
64
64
  id: Ee(),
65
65
  name: r.data.measurement_name,
66
66
  abbrev: r.data.measurement_symbol,
67
67
  conversion: {
68
- amount: Math.round(r.data.measurement_conversion * Math.pow(10, h[r.data.name].unit.precision)),
69
- precision: h[r.data.name].unit.precision
68
+ amount: Math.round(r.data.measurement_conversion * Math.pow(10, x[r.data.name].unit.precision)),
69
+ precision: x[r.data.name].unit.precision
70
70
  }
71
71
  });
72
72
  else {
73
- const l = Object.keys(h)[Object.keys(h).length - 1];
74
- l && h[l] && r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && h[l].unit.measurements.push({
73
+ const l = Object.keys(x)[Object.keys(x).length - 1];
74
+ l && x[l] && r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && x[l].unit.measurements.push({
75
75
  id: Ee(),
76
76
  name: r.data.measurement_name,
77
77
  abbrev: r.data.measurement_symbol,
78
78
  conversion: {
79
- amount: Math.round(r.data.measurement_conversion * Math.pow(10, h[l].unit.precision)),
80
- precision: h[l].unit.precision
79
+ amount: Math.round(r.data.measurement_conversion * Math.pow(10, x[l].unit.precision)),
80
+ precision: x[l].unit.precision
81
81
  }
82
82
  });
83
83
  }
84
- for (const [r, { unit: l, rowNumber: s }] of Object.entries(h)) {
85
- const u = y.find((p) => {
86
- var c, f;
87
- return p.abbrev === l.abbrev && ((c = p.name) == null ? void 0 : c.trim()) === ((f = l.name) == null ? void 0 : f.trim());
84
+ for (const [r, { unit: l, rowNumber: s }] of Object.entries(x)) {
85
+ const u = g.find((v) => {
86
+ var p, b;
87
+ return v.abbrev === l.abbrev && ((p = v.name) == null ? void 0 : p.trim()) === ((b = l.name) == null ? void 0 : b.trim());
88
88
  });
89
- u ? k.push({
89
+ u ? E.push({
90
90
  type: "update",
91
91
  original: u,
92
92
  unit: {
@@ -94,18 +94,18 @@ function et(U) {
94
94
  name: l.name || u.name,
95
95
  abbrev: l.abbrev || u.abbrev,
96
96
  precision: l.precision !== void 0 ? l.precision : u.precision,
97
- measurements: l.measurements.map((p) => {
98
- const c = u.measurements.find((f) => f.name === p.name && f.abbrev === p.abbrev);
99
- return c ? { ...c, ...p, id: c.id } : { ...p, id: Ee() };
97
+ measurements: l.measurements.map((v) => {
98
+ const p = u.measurements.find((b) => b.name === v.name && b.abbrev === v.abbrev);
99
+ return p ? { ...p, ...v, id: p.id } : { ...v, id: Ee() };
100
100
  })
101
101
  },
102
102
  errors: [],
103
103
  excelRowNumber: s
104
- }) : b.push({
104
+ }) : h.push({
105
105
  type: "create",
106
106
  unit: {
107
107
  ...l,
108
- measurements: l.measurements.map((p) => ({ ...p, id: Ee() }))
108
+ measurements: l.measurements.map((v) => ({ ...v, id: Ee() }))
109
109
  },
110
110
  errors: [],
111
111
  excelRowNumber: s
@@ -113,8 +113,8 @@ function et(U) {
113
113
  }
114
114
  return {
115
115
  invalidExcel: !1,
116
- importCreateResult: b,
117
- importUpdateResult: k
116
+ importCreateResult: h,
117
+ importUpdateResult: E
118
118
  };
119
119
  } catch (e) {
120
120
  return {
@@ -125,130 +125,130 @@ function et(U) {
125
125
  };
126
126
  }
127
127
  }
128
- function tt(U, { ignoreErrors: e = !1 } = {}) {
129
- var S;
128
+ function it(U, { ignoreErrors: e = !1 } = {}) {
129
+ var R;
130
130
  try {
131
- const y = ie(), b = y.skuByCode, k = y.recipeByName, h = y.skuGroupById, r = y.skuGroups, l = y.units, s = [], u = {};
131
+ const g = ie(), h = g.skuByCode, E = g.recipeByName, x = g.skuGroupById, r = g.skuGroups, l = g.units, s = [], u = {};
132
132
  for (const o of U) {
133
- const v = [];
134
- let w = "";
133
+ const y = [];
134
+ let _ = "";
135
135
  if (o.data.type === "INGREDIENT") {
136
- const I = b[o.data.code];
137
- I ? w = I._id : v.push(`Ingredient with code '${o.data.code}' not found`);
136
+ const w = h[o.data.code];
137
+ w ? _ = w._id : y.push(`Ingredient with code '${o.data.code}' not found`);
138
138
  } else if (o.data.type === "RECIPE") {
139
- const I = k[o.data.name];
140
- I ? w = I._id : v.push(`Recipe with name '${o.data.name}' not found`);
139
+ const w = E[o.data.name];
140
+ w ? _ = w._id : y.push(`Recipe with name '${o.data.name}' not found`);
141
141
  } else if (o.data.type === "SKU_GROUP") {
142
- const I = r.find((E) => E.ref === o.data.code || E.name === o.data.name);
143
- I ? w = I._id : v.push(`SKU Group with ref '${o.data.code}' or name '${o.data.name}' not found`);
142
+ const w = r.find((I) => I.ref === o.data.code || I.name === o.data.name);
143
+ w ? _ = w._id : y.push(`SKU Group with ref '${o.data.code}' or name '${o.data.name}' not found`);
144
144
  } else
145
- v.push(`Invalid type '${o.data.type}'. Must be 'INGREDIENT', 'RECIPE', or 'SKU_GROUP'`);
146
- o.data.amount || v.push(`Invalid amount '${o.data.amount}'. Must be a valid number`);
147
- let N;
148
- if ((o.data.unit || o.data.baseUnit) && o.data.type !== "RECIPE" && o.data.type !== "SKU_GROUP" && (N = l.find((I) => {
149
- var E, Z;
150
- return I.abbrev === o.data.baseUnit && ((E = I.name) == null ? void 0 : E.trim()) === ((Z = o.data.unit) == null ? void 0 : Z.trim());
151
- }), N || (o.data.baseUnit && o.data.unit ? v.push(`Cannot find unit with symbol '${o.data.baseUnit}' and name '${o.data.unit}'`) : o.data.baseUnit ? v.push(`Cannot find unit with symbol '${o.data.baseUnit}'`) : o.data.unit && v.push(`Cannot find unit with name '${o.data.unit}'`))), v.length > 0 && s.push(`Row ${o.index + 6}: ${v.join(", ")}`), e || v.length === 0) {
152
- let I;
153
- if (o.data.type === "RECIPE" || o.data.type === "SKU_GROUP" ? I = void 0 : I = (S = N == null ? void 0 : N.measurements) == null ? void 0 : S.find((E) => E.abbrev === o.data.measurementName), o.data.recipeName)
145
+ y.push(`Invalid type '${o.data.type}'. Must be 'INGREDIENT', 'RECIPE', or 'SKU_GROUP'`);
146
+ o.data.amount || y.push(`Invalid amount '${o.data.amount}'. Must be a valid number`);
147
+ let G;
148
+ if ((o.data.unit || o.data.baseUnit) && o.data.type !== "RECIPE" && o.data.type !== "SKU_GROUP" && (G = l.find((w) => {
149
+ var I, ee;
150
+ return w.abbrev === o.data.baseUnit && ((I = w.name) == null ? void 0 : I.trim()) === ((ee = o.data.unit) == null ? void 0 : ee.trim());
151
+ }), G || (o.data.baseUnit && o.data.unit ? y.push(`Cannot find unit with symbol '${o.data.baseUnit}' and name '${o.data.unit}'`) : o.data.baseUnit ? y.push(`Cannot find unit with symbol '${o.data.baseUnit}'`) : o.data.unit && y.push(`Cannot find unit with name '${o.data.unit}'`))), y.length > 0 && s.push(`Row ${o.index + 6}: ${y.join(", ")}`), e || y.length === 0) {
152
+ let w;
153
+ if (o.data.type === "RECIPE" || o.data.type === "SKU_GROUP" ? w = void 0 : w = (R = G == null ? void 0 : G.measurements) == null ? void 0 : R.find((I) => I.abbrev === o.data.measurementName), o.data.recipeName)
154
154
  u[o.data.recipeName] = {
155
155
  name: o.data.recipeName,
156
- customAttributes: o.data.customAttributes ? Je(o.data.customAttributes) : {},
156
+ customAttributes: o.data.customAttributes ? Ze(o.data.customAttributes) : {},
157
157
  contains: [{
158
158
  type: o.data.type === "INGREDIENT" ? "SKU" : o.data.type,
159
- id: w,
160
- amount: Ne(+o.data.amount),
161
- measurement: I || void 0
159
+ id: _,
160
+ amount: Ae(+o.data.amount),
161
+ measurement: w || void 0
162
162
  }]
163
- }, s[o.data.recipeName] = v.length > 0 ? `Row ${o.index + 6}: ${v.join(", ")}` : [];
163
+ }, s[o.data.recipeName] = y.length > 0 ? `Row ${o.index + 6}: ${y.join(", ")}` : [];
164
164
  else {
165
- const E = Object.keys(u)[Object.keys(u).length - 1];
166
- E && u[E] && (u[E] = {
167
- ...u[E],
165
+ const I = Object.keys(u)[Object.keys(u).length - 1];
166
+ I && u[I] && (u[I] = {
167
+ ...u[I],
168
168
  contains: [
169
- ...u[E].contains,
169
+ ...u[I].contains,
170
170
  {
171
171
  type: o.data.type === "INGREDIENT" ? "SKU" : o.data.type,
172
- id: w,
173
- amount: Ne(+o.data.amount),
174
- measurement: I || void 0
172
+ id: _,
173
+ amount: Ae(+o.data.amount),
174
+ measurement: w || void 0
175
175
  }
176
176
  ]
177
- }, s[E] = v.length > 0 ? s[E] ? `${s[E]}, Row ${o.index + 6}: ${v.join(", ")}` : `Row ${o.index + 6}: ${v.join(", ")}` : []);
177
+ }, s[I] = y.length > 0 ? s[I] ? `${s[I]}, Row ${o.index + 6}: ${y.join(", ")}` : `Row ${o.index + 6}: ${y.join(", ")}` : []);
178
178
  }
179
179
  }
180
180
  }
181
- const p = Object.values(u), c = p.filter((o) => !k[o.name]), f = p.filter((o) => k[o.name]), g = c.map((o, v) => ({
181
+ const v = Object.values(u), p = v.filter((o) => !E[o.name]), b = v.filter((o) => E[o.name]), f = p.map((o, y) => ({
182
182
  type: "create",
183
183
  recipe: o,
184
184
  // Type assertion - _id will be assigned by backend
185
185
  errors: s[o.name],
186
- excelRowNumber: v + 6
186
+ excelRowNumber: y + 6
187
187
  // Assuming header rows
188
- })), d = f.map((o, v) => {
189
- const w = k[o.name];
188
+ })), d = b.map((o, y) => {
189
+ const _ = E[o.name];
190
190
  return {
191
191
  type: "update",
192
- original: w,
192
+ original: _,
193
193
  recipe: {
194
- ...w,
195
- name: o.name || w.name,
196
- contains: o.contains.length > 0 ? o.contains : w.contains,
197
- customAttributes: o.customAttributes || w.customAttributes
194
+ ..._,
195
+ name: o.name || _.name,
196
+ contains: o.contains.length > 0 ? o.contains : _.contains,
197
+ customAttributes: o.customAttributes || _.customAttributes
198
198
  },
199
199
  errors: s[o.name],
200
- excelRowNumber: v + 6
200
+ excelRowNumber: y + 6
201
201
  };
202
202
  });
203
203
  return {
204
204
  invalidExcel: s.length > 0,
205
205
  invalidExcelMessage: s.length > 0 ? `Import completed with ${s.length} error(s): ${s.join("; ")}` : void 0,
206
- importCreateResult: g,
206
+ importCreateResult: f,
207
207
  importUpdateResult: d
208
208
  };
209
- } catch (y) {
209
+ } catch (g) {
210
210
  return {
211
211
  invalidExcel: !0,
212
- invalidExcelMessage: y instanceof Error ? y.message : "Unknown error occurred",
212
+ invalidExcelMessage: g instanceof Error ? g.message : "Unknown error occurred",
213
213
  importCreateResult: [],
214
214
  importUpdateResult: []
215
215
  };
216
216
  }
217
217
  }
218
- function nt(U) {
218
+ function at(U) {
219
219
  const [
220
220
  e,
221
- S,
222
- y,
223
- b,
224
- k,
221
+ R,
222
+ g,
225
223
  h,
224
+ E,
225
+ x,
226
226
  ...r
227
- ] = De(U);
228
- if (!e || !e.length || e.some((c) => c.length && !c.startsWith("system:")))
227
+ ] = He(U);
228
+ if (!e || !e.length || e.some((p) => p.length && !p.startsWith("system:")))
229
229
  throw new Error("Missing meta header. Excel file does not come from the template.");
230
- const l = e.map((c) => c.split(":")[1]), u = ["code", "recipeName", "unit", "baseUnit", "type", "amount"].filter((c) => !l.includes(c));
230
+ const l = e.map((p) => p.split(":")[1]), u = ["code", "recipeName", "unit", "baseUnit", "type", "amount"].filter((p) => !l.includes(p));
231
231
  if (u.length)
232
232
  throw new Error(
233
233
  `Missing meta headers (${u.join()}). Excel file does not come from the template.`
234
234
  );
235
- return r.map((c, f) => {
236
- const g = {};
235
+ return r.map((p, b) => {
236
+ const f = {};
237
237
  for (const d in l) {
238
238
  const o = l[d];
239
- Object.assign(g, { [o]: c[d] });
239
+ Object.assign(f, { [o]: p[d] });
240
240
  }
241
241
  return {
242
- index: f,
243
- data: g
242
+ index: b,
243
+ data: f
244
244
  };
245
- }).filter((c) => {
246
- const { recipeName: f, type: g, code: d, name: o, amount: v, unit: w, baseUnit: N, measurementName: I, customAttributes: E } = c.data;
247
- return f || g || d || o || v || w || N || I || E;
245
+ }).filter((p) => {
246
+ const { recipeName: b, type: f, code: d, name: o, amount: y, unit: _, baseUnit: G, measurementName: w, customAttributes: I } = p.data;
247
+ return b || f || d || o || y || _ || G || w || I;
248
248
  });
249
249
  }
250
- function ot() {
251
- const e = Re().currentBusiness.value, S = ie(), y = [
250
+ function lt() {
251
+ const e = Re().currentBusiness.value, R = ie(), g = [
252
252
  { id: "name", name: "Unit Name" },
253
253
  { id: "symbol", name: "Symbol" },
254
254
  { id: "precision", name: "Precision" },
@@ -256,10 +256,10 @@ function ot() {
256
256
  { id: "measurement_symbol", name: "Measurement Symbol" },
257
257
  { id: "measurement_conversion", name: "Measurement Conversion" }
258
258
  ];
259
- let b = [];
260
- S.units.length > 0 ? S.units.forEach((r) => {
259
+ let h = [];
260
+ R.units.length > 0 ? R.units.forEach((r) => {
261
261
  if (r.measurements.length === 0)
262
- b.push([
262
+ h.push([
263
263
  r.name,
264
264
  r.abbrev,
265
265
  r.precision,
@@ -268,7 +268,7 @@ function ot() {
268
268
  ""
269
269
  ]);
270
270
  else {
271
- b.push([
271
+ h.push([
272
272
  r.name,
273
273
  r.abbrev,
274
274
  r.precision,
@@ -277,7 +277,7 @@ function ot() {
277
277
  +pe(r.measurements[0].conversion)
278
278
  ]);
279
279
  for (let l = 1; l < r.measurements.length; l++)
280
- b.push([
280
+ h.push([
281
281
  "",
282
282
  "",
283
283
  "",
@@ -286,7 +286,7 @@ function ot() {
286
286
  +pe(r.measurements[l].conversion)
287
287
  ]);
288
288
  }
289
- }) : b = [
289
+ }) : h = [
290
290
  ["Length", "m", 2, "Meter", "m", 1],
291
291
  ["", "", "", "Centimeter", "cm", 0.01],
292
292
  ["", "", "", "Millimeter", "mm", 1e-3],
@@ -294,48 +294,48 @@ function ot() {
294
294
  ["", "", "", "Gram", "g", 1e-3],
295
295
  ["", "", "", "Pound", "lb", 0.453592]
296
296
  ];
297
- const k = [
297
+ const E = [
298
298
  ["Business name:", e == null ? void 0 : e.name],
299
299
  ["Business ID:", e == null ? void 0 : e._id],
300
300
  ["Menu version", e == null ? void 0 : e.menuVersion],
301
301
  [],
302
- y.map((r) => r.name),
303
- ...b
304
- ], h = y.map((r) => `system:${r.id}`);
305
- return Ce(k, h);
302
+ g.map((r) => r.name),
303
+ ...h
304
+ ], x = g.map((r) => `system:${r.id}`);
305
+ return Ce(E, x);
306
306
  }
307
- function rt() {
308
- const e = Re().currentBusiness.value, S = ie(), y = qe();
309
- let b = [];
310
- S.skus.length > 0 ? b = S.skus.map((r) => {
311
- var l, s, u, p, c, f, g, d;
307
+ function mt() {
308
+ const e = Re().currentBusiness.value, R = ie(), g = tt();
309
+ let h = [];
310
+ R.skus.length > 0 ? h = R.skus.map((r) => {
311
+ var l, s, u, v, p, b, f, d;
312
312
  return [
313
313
  r.code,
314
314
  r.name,
315
315
  ((l = r.unit) == null ? void 0 : l.name) || "",
316
316
  ((s = r.unit) == null ? void 0 : s.abbrev) || "",
317
- ((p = (u = r.unit) == null ? void 0 : u.measurements.find((o) => o.id === r.trackingMeasurement)) == null ? void 0 : p.abbrev) ?? r.unit.abbrev,
317
+ ((v = (u = r.unit) == null ? void 0 : u.measurements.find((o) => o.id === r.trackingMeasurement)) == null ? void 0 : v.abbrev) ?? r.unit.abbrev,
318
318
  r.valuation || "WAVG",
319
- (c = r.defaultCost) != null && c.costPerUnit ? +pe((f = r.defaultCost) == null ? void 0 : f.costPerUnit) : 0,
320
- ((g = r.thresholds) == null ? void 0 : g.low) ?? Ge().low,
321
- ((d = r.thresholds) == null ? void 0 : d.mid) ?? Ge().mid,
322
- r.customAttributes ? Object.entries(r.customAttributes).map(([o, v]) => `${o}:${v}`).join("|") : ""
319
+ (p = r.defaultCost) != null && p.costPerUnit ? +pe((b = r.defaultCost) == null ? void 0 : b.costPerUnit) : 0,
320
+ ((f = r.thresholds) == null ? void 0 : f.low) ?? Fe().low,
321
+ ((d = r.thresholds) == null ? void 0 : d.mid) ?? Fe().mid,
322
+ r.customAttributes ? Object.entries(r.customAttributes).map(([o, y]) => `${o}:${y}`).join("|") : ""
323
323
  ];
324
- }) : b = [
324
+ }) : h = [
325
325
  ["EXAMPLE_CODE", "Example Ingredient", "kg", "kg", "Unit Name", "WAVG", 10.5, 5, 10, ""]
326
326
  ];
327
- const k = [
327
+ const E = [
328
328
  ["Business name:", e == null ? void 0 : e.name],
329
329
  ["Business ID:", e == null ? void 0 : e._id],
330
330
  ["Menu version", e == null ? void 0 : e.menuVersion],
331
331
  [],
332
- y.map((r) => r.name),
333
- ...b
334
- ], h = y.map((r) => `system:${r.id}`);
335
- return Ce(k, h);
332
+ g.map((r) => r.name),
333
+ ...h
334
+ ], x = g.map((r) => `system:${r.id}`);
335
+ return Ce(E, x);
336
336
  }
337
- function st() {
338
- const e = Re().currentBusiness.value, S = ie(), y = [
337
+ function ut() {
338
+ const e = Re().currentBusiness.value, R = ie(), g = [
339
339
  { id: "recipeName", name: "Recipe Name" },
340
340
  { id: "type", name: "Type" },
341
341
  { id: "code", name: "Code" },
@@ -346,58 +346,58 @@ function st() {
346
346
  { id: "measurementName", name: "Measurement Symbol" },
347
347
  { id: "customAttributes", name: "Custom Attributes" }
348
348
  ];
349
- let b = [];
350
- if (S.recipes.length > 0) {
351
- const r = S.recipeById, l = S.skuById, s = S.skuGroupById;
352
- b = S.recipes.flatMap((u) => {
353
- var c;
354
- const p = u.customAttributes ? Object.entries(u.customAttributes).map(([f, g]) => `${f}:${g}`).join("|") : "";
355
- if ((c = u.contains) != null && c.length) {
356
- const f = u.contains.filter((o) => o.type === "RECIPE"), g = u.contains.filter((o) => o.type === "SKU"), d = u.contains.filter((o) => o.type === "SKU_GROUP");
349
+ let h = [];
350
+ if (R.recipes.length > 0) {
351
+ const r = R.recipeById, l = R.skuById, s = R.skuGroupById;
352
+ h = R.recipes.flatMap((u) => {
353
+ var p;
354
+ const v = u.customAttributes ? Object.entries(u.customAttributes).map(([b, f]) => `${b}:${f}`).join("|") : "";
355
+ if ((p = u.contains) != null && p.length) {
356
+ const b = u.contains.filter((o) => o.type === "RECIPE"), f = u.contains.filter((o) => o.type === "SKU"), d = u.contains.filter((o) => o.type === "SKU_GROUP");
357
357
  return [
358
- ...f.map((o, v) => {
359
- var w;
358
+ ...b.map((o, y) => {
359
+ var _;
360
360
  return [
361
- v === 0 ? u.name : "",
361
+ y === 0 ? u.name : "",
362
362
  "RECIPE",
363
363
  "",
364
- ((w = r[o.id]) == null ? void 0 : w.name) || "",
364
+ ((_ = r[o.id]) == null ? void 0 : _.name) || "",
365
365
  o.amount.amount,
366
366
  "",
367
367
  "unit",
368
368
  "Unit",
369
- v === 0 ? p : ""
369
+ y === 0 ? v : ""
370
370
  ];
371
371
  }),
372
- ...g.map((o, v) => {
373
- var w, N, I, E, Z, ve, ye, ge, fe, ae, be, le, he, xe, _e, we;
372
+ ...f.map((o, y) => {
373
+ var _, G, w, I, ee, ve, ye, ge, fe, ae, be, le, he, xe, _e, we;
374
374
  return [
375
- !f.length && v === 0 ? u.name : "",
375
+ !b.length && y === 0 ? u.name : "",
376
376
  "INGREDIENT",
377
- ((w = l[o.id]) == null ? void 0 : w.code) || "",
378
- ((N = l[o.id]) == null ? void 0 : N.name) || "",
377
+ ((_ = l[o.id]) == null ? void 0 : _.code) || "",
378
+ ((G = l[o.id]) == null ? void 0 : G.name) || "",
379
379
  +pe(o.amount),
380
- o.measurement ? ((E = (I = l[o.id]) == null ? void 0 : I.unit) == null ? void 0 : E.name) || "" : ((ve = (Z = l[o.id]) == null ? void 0 : Z.unit) == null ? void 0 : ve.name) || "",
380
+ o.measurement ? ((I = (w = l[o.id]) == null ? void 0 : w.unit) == null ? void 0 : I.name) || "" : ((ve = (ee = l[o.id]) == null ? void 0 : ee.unit) == null ? void 0 : ve.name) || "",
381
381
  o.measurement ? ((ge = (ye = l[o.id]) == null ? void 0 : ye.unit) == null ? void 0 : ge.abbrev) || "" : ((ae = (fe = l[o.id]) == null ? void 0 : fe.unit) == null ? void 0 : ae.abbrev) || "",
382
382
  o.measurement ? o.measurement.abbrev : ((xe = (he = (le = (be = l[o.id]) == null ? void 0 : be.unit) == null ? void 0 : le.measurements) == null ? void 0 : he.find((Se) => {
383
383
  var m;
384
384
  return Se.id === ((m = l[o.id]) == null ? void 0 : m.trackingMeasurement);
385
385
  })) == null ? void 0 : xe.abbrev) || ((we = (_e = l[o.id]) == null ? void 0 : _e.unit) == null ? void 0 : we.abbrev) || "",
386
- !f.length && v === 0 ? p : ""
386
+ !b.length && y === 0 ? v : ""
387
387
  ];
388
388
  }),
389
- ...d.map((o, v) => {
390
- var w, N;
389
+ ...d.map((o, y) => {
390
+ var _, G;
391
391
  return [
392
- f.length === 0 && g.length === 0 && v === 0 ? u.name : "",
392
+ b.length === 0 && f.length === 0 && y === 0 ? u.name : "",
393
393
  "SKU_GROUP",
394
- ((w = s[o.id]) == null ? void 0 : w.ref) || "",
395
- ((N = s[o.id]) == null ? void 0 : N.name) || "",
394
+ ((_ = s[o.id]) == null ? void 0 : _.ref) || "",
395
+ ((G = s[o.id]) == null ? void 0 : G.name) || "",
396
396
  +pe(o.amount),
397
397
  "",
398
398
  "unit",
399
399
  "Unit",
400
- f.length === 0 && g.length === 0 && v === 0 ? p : ""
400
+ b.length === 0 && f.length === 0 && y === 0 ? v : ""
401
401
  ];
402
402
  })
403
403
  ];
@@ -405,156 +405,153 @@ function st() {
405
405
  return [];
406
406
  });
407
407
  } else
408
- b = [
408
+ h = [
409
409
  ["Pizza Dough", "INGREDIENT", "FLOUR001", "Flour", "500", "Weight", "g", "Gram", "difficulty:easy, category:italian"],
410
410
  ["", "INGREDIENT", "WATER001", "Water", "300", "Volume", "ml", "Milliliter", ""],
411
411
  ["", "INGREDIENT", "SALT001", "Salt", "10", "Weight", "g", "Gram", ""]
412
412
  ];
413
- const k = [
413
+ const E = [
414
414
  ["Business name:", e == null ? void 0 : e.name],
415
415
  ["Business ID:", e == null ? void 0 : e._id],
416
416
  ["Menu version", e == null ? void 0 : e.menuVersion],
417
417
  [],
418
- y.map((r) => r.name),
419
- ...b
420
- ], h = y.map((r) => `system:${r.id}`);
421
- return Ce(k, h);
418
+ g.map((r) => r.name),
419
+ ...h
420
+ ], x = g.map((r) => `system:${r.id}`);
421
+ return Ce(E, x);
422
422
  }
423
- function it() {
424
- const U = Ve({
425
- unit: ot(),
426
- ingredient: rt(),
427
- recipe: st()
423
+ function dt() {
424
+ const U = qe({
425
+ unit: lt(),
426
+ ingredient: mt(),
427
+ recipe: ut()
428
428
  }), e = "FeedMe comprehensive template.xlsx";
429
- return We(U, e), e;
429
+ return Qe(U, e), e;
430
430
  }
431
- async function at(U) {
431
+ async function ct(U) {
432
432
  if (!U) return null;
433
433
  try {
434
- return et(U);
434
+ return st(U);
435
435
  } catch (e) {
436
436
  throw console.error("Error in processUnitsSheet:", e), e;
437
437
  }
438
438
  }
439
- async function lt(U) {
439
+ async function pt(U) {
440
440
  if (!U) return null;
441
441
  try {
442
- return Xe(U);
442
+ return et(U);
443
443
  } catch (e) {
444
444
  throw console.error("Error in processIngredientsSheet:", e), e;
445
445
  }
446
446
  }
447
- async function mt(U) {
447
+ async function vt(U) {
448
448
  if (!U) return null;
449
449
  try {
450
- const e = nt(U);
451
- return tt(e, { ignoreErrors: !0 });
450
+ const e = at(U);
451
+ return it(e, { ignoreErrors: !0 });
452
452
  } catch (e) {
453
453
  throw console.error("Error in processRecipesSheet:", e), e;
454
454
  }
455
455
  }
456
- function re(U) {
457
- return (U ?? []).filter((e) => !e.errors || e.errors.length === 0).map(({ errors: e, ...S }) => S);
458
- }
459
- const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8" }, ct = { class: "flex flex-col flex-1 gap-4" }, pt = { class: "fm-typo-en-body-md-600" }, vt = {
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 = {
460
457
  key: 2,
461
458
  class: "shrink-0"
462
- }, yt = {
459
+ }, xt = {
463
460
  key: 0,
464
461
  class: "flex flex-col"
465
- }, gt = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, ft = {
462
+ }, _t = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, wt = {
466
463
  key: 0,
467
464
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
468
- }, bt = { class: "fm-typo-en-body-lg-600" }, ht = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, xt = /* @__PURE__ */ Te({
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({
469
466
  __name: "ImportDialog",
470
467
  setup(U) {
471
- const e = F(null), S = Oe();
472
- Ae();
473
- const y = F(!1), b = F(new Array()), k = F(null), h = F([]), r = F([]), l = L(() => !!b.value.length), s = L(() => !!k.value && h.value.length > 0), { t: u } = Fe();
474
- async function p(g) {
475
- b.value = [], k.value = null, h.value = [], r.value = [];
468
+ const e = F(null), R = We();
469
+ Oe();
470
+ const g = F(!1), h = F(new Array()), E = F(null), x = F([]), r = F([]), l = J(() => !!h.value.length), s = J(() => !!E.value && x.value.length > 0), { t: u } = je();
471
+ async function v(f) {
472
+ h.value = [], E.value = null, x.value = [], r.value = [];
476
473
  try {
477
- y.value = !0;
474
+ g.value = !0;
478
475
  const [d] = await Promise.all([
479
- Le(g),
476
+ Ye(f),
480
477
  // fake buffer for UX
481
478
  new Promise((o) => setTimeout(o, 1e3))
482
479
  ]);
483
- k.value = d, c();
480
+ E.value = d, p();
484
481
  } catch (d) {
485
- console.error("Error parsing Excel file:", d), b.value.push((d == null ? void 0 : d.message) || "Unknown error occurred");
482
+ console.error("Error parsing Excel file:", d), h.value.push((d == null ? void 0 : d.message) || "Unknown error occurred");
486
483
  } finally {
487
- y.value = !1;
484
+ g.value = !1;
488
485
  }
489
486
  }
490
- function c() {
491
- if (b.value = [], !k.value) return;
492
- const d = ["unit", "ingredient", "recipe"].filter((o) => k.value.Sheets[o]);
487
+ function p() {
488
+ if (h.value = [], !E.value) return;
489
+ const d = ["unit", "ingredient", "recipe"].filter((o) => E.value.Sheets[o]);
493
490
  if (d.length === 0) {
494
- b.value.push("No valid sheets found. Expected sheets: unit, ingredient, or recipe");
491
+ h.value.push("No valid sheets found. Expected sheets: unit, ingredient, or recipe");
495
492
  return;
496
493
  }
497
- h.value = d, S.emitData({ availableSheets: d, workbook: k.value });
494
+ x.value = d, R.emitData({ availableSheets: d, workbook: E.value });
498
495
  }
499
- Be(e, (g) => {
500
- g && p(g);
496
+ ze(e, (f) => {
497
+ f && v(f);
501
498
  });
502
- function f() {
503
- if (!k.value || h.value.length === 0) return "";
504
- const g = [];
505
- return h.value.forEach((d) => {
499
+ function b() {
500
+ if (!E.value || x.value.length === 0) return "";
501
+ const f = [];
502
+ return x.value.forEach((d) => {
506
503
  switch (d) {
507
504
  case "unit":
508
- g.push("Units sheet found");
505
+ f.push("Units sheet found");
509
506
  break;
510
507
  case "ingredient":
511
- g.push("Ingredients sheet found");
508
+ f.push("Ingredients sheet found");
512
509
  break;
513
510
  case "recipe":
514
- g.push("Recipes sheet found");
511
+ f.push("Recipes sheet found");
515
512
  break;
516
513
  }
517
- }), g.length > 0 ? `Ready to process: ${g.join(", ")}. Processing will follow dependency order.` : "No valid sheets found";
514
+ }), f.length > 0 ? `Ready to process: ${f.join(", ")}. Processing will follow dependency order.` : "No valid sheets found";
518
515
  }
519
- return (g, d) => {
520
- const o = Q("FmCircularProgress"), v = Q("FmIcon"), w = Q("FmButton");
521
- return T(), D("div", ut, [
522
- A(Ye, {
516
+ return (f, d) => {
517
+ const o = Y("FmCircularProgress"), y = Y("FmIcon"), _ = Y("FmButton");
518
+ return N(), D("div", yt, [
519
+ A(ot, {
523
520
  class: ce({
524
521
  "w-full": !0,
525
522
  "h-[200px]": !e.value
526
523
  }),
527
524
  accept: ".xlsx,.xls",
528
- onFileUpload: d[0] || (d[0] = (N) => e.value = N),
525
+ onFileUpload: d[0] || (d[0] = (G) => e.value = G),
529
526
  label: i(u)("inventory.ingredient.import.uploadTemplate"),
530
527
  "button-label": i(u)("inventory.ingredient.import.selectFile")
531
- }, Pe({ _: 2 }, [
528
+ }, Ke({ _: 2 }, [
532
529
  e.value ? {
533
530
  name: "default",
534
- fn: q(({ openFileDialog: N }) => [
535
- n("div", dt, [
531
+ fn: Q(({ openFileDialog: G }) => [
532
+ n("div", gt, [
536
533
  n("div", {
537
534
  class: ce([
538
535
  "fm-corner-radius-md p-16 flex items-center gap-16",
539
536
  {
540
- "border border-fm-color-neutral-gray-100": y.value,
541
- "border border-fm-color-neutral-gray-200": !y.value && !l.value,
537
+ "border border-fm-color-neutral-gray-100": g.value,
538
+ "border border-fm-color-neutral-gray-200": !g.value && !l.value,
542
539
  "border border-fm-color-system-error-200": l.value
543
540
  }
544
541
  ])
545
542
  }, [
546
- y.value ? (T(), se(o, {
543
+ g.value ? (N(), se(o, {
547
544
  key: 0,
548
545
  size: "md",
549
546
  color: "neutral-gray-200"
550
- })) : (T(), se(v, {
547
+ })) : (N(), se(y, {
551
548
  key: 1,
552
549
  name: l.value ? "error" : "check_circle",
553
550
  color: l.value ? "system-error-300" : "system-success-400",
554
551
  size: "lg"
555
552
  }, null, 8, ["name", "color"])),
556
- n("div", ct, [
557
- n("div", pt, a(e.value.name), 1),
553
+ n("div", ft, [
554
+ n("div", bt, a(e.value.name), 1),
558
555
  n("div", {
559
556
  class: ce([
560
557
  "fm-typo-en-body-sm-400",
@@ -565,105 +562,105 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
565
562
  ])
566
563
  }, a(l.value ? i(u)("inventory.ingredient.import.error.invalidContent") : "File valid"), 3)
567
564
  ]),
568
- y.value ? Y("", !0) : (T(), D("div", vt, [
569
- A(w, {
565
+ g.value ? Z("", !0) : (N(), D("div", ht, [
566
+ A(_, {
570
567
  label: i(u)("inventory.ingredient.import.replaceFile"),
571
568
  variant: l.value ? "destructive" : "secondary",
572
569
  "prepend-icon": l.value ? void 0 : "autorenew",
573
- onClick: N
570
+ onClick: G
574
571
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
575
572
  ]))
576
573
  ], 2),
577
- b.value.length ? (T(), D("div", yt, [
578
- (T(!0), D(Me, null, $e(b.value, (I, E) => (T(), D("div", {
579
- key: E,
574
+ h.value.length ? (N(), D("div", xt, [
575
+ (N(!0), D(Be, null, Pe(h.value, (w, I) => (N(), D("div", {
576
+ key: I,
580
577
  class: "flex gap-8 items-center"
581
578
  }, [
582
- A(v, {
579
+ A(y, {
583
580
  name: "error",
584
581
  size: "sm",
585
582
  color: "system-error-300"
586
583
  }),
587
- n("div", gt, a(I), 1)
584
+ n("div", _t, a(w), 1)
588
585
  ]))), 128))
589
- ])) : Y("", !0)
586
+ ])) : Z("", !0)
590
587
  ])
591
588
  ]),
592
589
  key: "0"
593
590
  } : void 0
594
591
  ]), 1032, ["class", "label", "button-label"]),
595
- s.value ? (T(), D("div", ft, [
596
- n("div", bt, a(i(u)("inventory.ingredient.import.summary")), 1),
597
- n("div", ht, a(f()), 1)
598
- ])) : Y("", !0)
592
+ s.value ? (N(), D("div", wt, [
593
+ n("div", It, a(i(u)("inventory.ingredient.import.summary")), 1),
594
+ n("div", Et, a(b()), 1)
595
+ ])) : Z("", !0)
599
596
  ]);
600
597
  };
601
598
  }
602
- }), _t = {
599
+ }), kt = {
603
600
  key: 0,
604
601
  class: "bg-blue-50 border border-blue-200 rounded-lg p-16"
605
- }, wt = { class: "flex items-start gap-12" }, It = { class: "flex flex-col gap-8" }, Et = { class: "fm-typo-en-body-md-400 text-blue-800" }, St = { class: "fm-typo-en-body-sm-400 text-blue-700" }, kt = { class: "mb-8" }, Rt = ["innerHTML"], Ct = ["innerHTML"], Ut = { class: "mb-8" }, Gt = { class: "mb-12" }, Nt = { class: "mb-12" }, Tt = { class: "mb-8" }, Mt = { class: "text-orange-600" }, $t = {
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" }, Gt = { class: "fm-typo-en-body-sm-400 text-blue-700" }, Nt = { class: "mb-8" }, Tt = ["innerHTML"], Mt = ["innerHTML"], $t = { class: "mb-8" }, Ft = { class: "mb-12" }, At = { class: "mb-12" }, Dt = { class: "mb-8" }, Bt = { class: "text-orange-600" }, Pt = {
606
603
  key: 1,
607
604
  class: "bg-white rounded-lg shadow"
608
- }, Ft = { class: "flex items-center justify-between p-16 border-b" }, At = { class: "fm-typo-en-title-md-600" }, Dt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, Bt = {
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 = {
609
606
  key: 0,
610
607
  class: "text-red-600"
611
- }, Pt = {
608
+ }, Kt = {
612
609
  key: 1,
613
610
  class: "text-orange-600"
614
- }, jt = {
611
+ }, Vt = {
615
612
  key: 2,
616
613
  class: "text-green-600"
617
- }, Ot = { class: "flex gap-8" }, Ht = { class: "p-16" }, zt = {
614
+ }, Wt = { class: "flex gap-8" }, Lt = { class: "p-16" }, Jt = {
618
615
  key: 2,
619
616
  class: "bg-white rounded-lg shadow"
620
- }, Kt = { class: "flex items-center justify-between p-16 border-b" }, Vt = { class: "fm-typo-en-title-md-600 text-red-800" }, Wt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, Lt = { class: "flex gap-8" }, Jt = { class: "p-16" }, Xt = {
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 = {
621
618
  key: 0,
622
619
  class: "flex flex-col gap-16 p-16"
623
- }, qt = { class: "fm-typo-en-title-sm-600 mb-12" }, Qt = { class: "grid grid-cols-2 gap-12" }, Yt = { class: "fm-typo-en-body-sm-400 text-gray-600" }, Zt = { class: "fm-typo-en-body-md-600" }, en = { key: 0 }, tn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, nn = { class: "fm-typo-en-body-md-600" }, on = { class: "fm-typo-en-body-sm-400 text-gray-600" }, rn = { class: "fm-typo-en-body-md-600" }, sn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, an = { class: "fm-typo-en-body-md-600" }, ln = { class: "fm-typo-en-body-sm-400 text-gray-600" }, mn = { class: "fm-typo-en-title-sm-600 mb-12 text-red-800" }, un = { class: "space-y-8" }, dn = { class: "fm-typo-en-body-md-400 text-red-800" }, cn = { class: "fm-typo-en-title-sm-600 mb-12" }, pn = { class: "bg-gray-50 p-12 rounded border overflow-auto" }, vn = { class: "text-sm" }, yn = { class: "flex gap-8" }, gn = { class: "flex flex-col items-center justify-center h-64 gap-16" }, fn = { class: "text-center" }, bn = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, hn = { class: "flex flex-col items-center justify-center h-64 gap-16" }, xn = { class: "text-center" }, _n = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, wn = { class: "fm-typo-en-body-md-400 text-gray-500" }, Dn = /* @__PURE__ */ Te({
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" }, Hn = /* @__PURE__ */ De({
624
621
  __name: "ImportView",
625
622
  setup(U) {
626
- const { t: e } = Fe(), S = He(), y = Ae();
627
- je();
628
- const b = Ke(), { breakpoints: k } = ze(), h = ie(), r = F("");
623
+ const { t: e } = je(), R = Le(), g = Oe();
624
+ Ve();
625
+ const h = Xe(), { breakpoints: E } = Je(), x = ie(), r = F("");
629
626
  F(!1);
630
- const l = F(!1), s = F(null), u = F(!1), p = F(null), c = F(!1), f = F([]), g = F(null), d = F([]), o = F(!1), v = L(() => k.value.xs || k.value.sm), w = L(() => v.value ? 10 : 20), N = L(() => {
627
+ const l = F(!1), s = F(null), u = F(!1), v = F(null), p = F(!1), b = F([]), f = F(null), d = F([]), o = F(!1), y = J(() => E.value.xs || E.value.sm), _ = J(() => y.value ? 10 : 20), G = J(() => {
631
628
  const m = s.value;
632
629
  if (!m) return [];
633
- const t = [], { units: G, skus: B, recipes: V, _invalidExcel: z, _invalidExcelMessage: J } = m, X = ($) => {
630
+ const t = [], { units: C, skus: B, recipes: W, _invalidExcel: z, _invalidExcelMessage: X } = m, q = (M) => {
634
631
  var j;
635
- return ((j = $.errors) == null ? void 0 : j.length) > 0 ? Array.isArray($.errors) ? $.errors.join(", ") : $.errors || e("inventory.common.validationFailed") : z ? J || e("inventory.common.invalidExcelFormat") : e("inventory.common.readyToImport");
636
- }, H = ($, O) => {
637
- if ($)
632
+ return ((j = M.errors) == null ? void 0 : j.length) > 0 ? Array.isArray(M.errors) ? M.errors.join(", ") : M.errors || e("inventory.common.validationFailed") : z ? X || e("inventory.common.invalidExcelFormat") : e("inventory.common.readyToImport");
633
+ }, H = (M, O) => {
634
+ if (M)
638
635
  for (const j of ["create", "update"]) {
639
- const K = $[j];
636
+ const K = M[j];
640
637
  if (K)
641
638
  for (const P of K)
642
639
  t.push({
643
640
  name: P.name || P.abbrev || P.code || e("inventory.common.unknown"),
644
641
  type: O,
645
642
  operation: e(j === "create" ? "inventory.common.create" : "inventory.common.update"),
646
- status: X(P),
643
+ status: q(P),
647
644
  errors: P.errors || [],
648
645
  details: P
649
646
  });
650
647
  }
651
648
  };
652
- return H(G, e("inventory.common.unit")), H(B, e("inventory.common.ingredient")), H(V, e("inventory.common.recipe")), t;
653
- }), I = L(() => N.value.some(
649
+ return H(C, e("inventory.common.unit")), H(B, e("inventory.common.ingredient")), H(W, e("inventory.common.recipe")), t;
650
+ }), w = J(() => G.value.some(
654
651
  (m) => m.errors && m.errors.length > 0
655
- )), E = L(() => N.value.some(
652
+ )), I = J(() => G.value.some(
656
653
  (m) => m.status && m.status.includes("Invalid Excel")
657
- )), Z = L(() => {
658
- const m = N.value.find(
654
+ )), ee = J(() => {
655
+ const m = G.value.find(
659
656
  (t) => t.status && t.status.includes("Invalid Excel")
660
657
  );
661
658
  return (m == null ? void 0 : m.status) || e("inventory.common.invalidExcelFormatDetected");
662
- }), ve = L(() => !d.value || d.value.length === 0 ? [] : d.value.map((m, t) => {
663
- var G, B;
659
+ }), ve = J(() => !d.value || d.value.length === 0 ? [] : d.value.map((m, t) => {
660
+ var C, B;
664
661
  return {
665
662
  id: t + 1,
666
- name: ((G = m.error.data) == null ? void 0 : G.name) || e("inventory.common.unknown"),
663
+ name: ((C = m.error.data) == null ? void 0 : C.name) || e("inventory.common.unknown"),
667
664
  type: m.type || e("inventory.common.general"),
668
665
  message: ((B = m.error) == null ? void 0 : B.message) || JSON.stringify(m.error)
669
666
  };
@@ -675,9 +672,9 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
675
672
  }
676
673
  }
677
674
  function ge() {
678
- S.open({
675
+ R.open({
679
676
  title: e("inventory.common.import"),
680
- contentComponent: xt,
677
+ contentComponent: St,
681
678
  overlay: !0,
682
679
  closeButton: !0,
683
680
  primaryActions: {
@@ -694,17 +691,17 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
694
691
  variant: "plain"
695
692
  }
696
693
  }).onPrimary(async (m) => {
697
- m && m.workbook && m.availableSheets && (await fe(m), S.close()), f.value.length === 0 && S.close();
694
+ m && m.workbook && m.availableSheets && (await fe(m), R.close()), b.value.length === 0 && R.close();
698
695
  }).onTertiary(() => {
699
696
  try {
700
- const m = it();
701
- y.open({
697
+ const m = dt();
698
+ g.open({
702
699
  title: e("inventory.common.export") + " " + e("inventory.ingredient.import.actions.downloadTemplate"),
703
700
  message: e("inventory.common.templateDownloaded", [m]),
704
701
  type: "success"
705
702
  });
706
703
  } catch (m) {
707
- y.open({
704
+ g.open({
708
705
  title: e("inventory.common.downloadFailed"),
709
706
  message: e("inventory.common.failedDownloadTemplate"),
710
707
  type: "error"
@@ -713,78 +710,78 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
713
710
  });
714
711
  }
715
712
  async function fe(m) {
716
- g.value = m.workbook, f.value = [...m.availableSheets], s.value = {}, d.value = [], await ae();
713
+ f.value = m.workbook, b.value = [...m.availableSheets], s.value = {}, d.value = [], await ae();
717
714
  }
718
715
  async function ae() {
719
- var t, G, B, V, z, J, X, H, $, O, j, K, P, me, ue;
720
- if (!g.value || f.value.length === 0) {
716
+ var t, C, B, W, z, X, q, H, M, O, j, K, P, me, ue;
717
+ if (!f.value || b.value.length === 0) {
721
718
  u.value = !0;
722
719
  return;
723
720
  }
724
- const m = f.value[0];
721
+ const m = b.value[0];
725
722
  try {
726
723
  switch (m) {
727
724
  case "unit": {
728
- const W = g.value.Sheets.unit, R = await at(W);
729
- R && (s.value = {
725
+ const L = f.value.Sheets.unit, S = await ct(L);
726
+ S && (s.value = {
730
727
  ...s.value,
731
- _invalidExcel: R.invalidExcel || ((t = s.value) == null ? void 0 : t._invalidExcel),
732
- _invalidExcelMessage: R.invalidExcelMessage || ((G = s.value) == null ? void 0 : G._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Units sheet",
733
- units: R.importCreateResult || R.importUpdateResult ? {
734
- create: ((B = R.importCreateResult) == null ? void 0 : B.map((x) => ({
735
- ...x.unit,
736
- errors: x.errors
728
+ _invalidExcel: S.invalidExcel || ((t = s.value) == null ? void 0 : t._invalidExcel),
729
+ _invalidExcelMessage: S.invalidExcelMessage || ((C = s.value) == null ? void 0 : C._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Units sheet",
730
+ units: S.importCreateResult || S.importUpdateResult ? {
731
+ create: ((B = S.importCreateResult) == null ? void 0 : B.map(($) => ({
732
+ ...$.unit,
733
+ errors: $.errors
737
734
  }))) || [],
738
- update: ((V = R.importUpdateResult) == null ? void 0 : V.map((x) => ({
739
- ...x.unit,
740
- errors: x.errors
735
+ update: ((W = S.importUpdateResult) == null ? void 0 : W.map(($) => ({
736
+ ...$.unit,
737
+ errors: $.errors
741
738
  }))) || []
742
739
  } : (z = s.value) == null ? void 0 : z.units
743
740
  });
744
741
  break;
745
742
  }
746
743
  case "ingredient": {
747
- const W = g.value.Sheets.ingredient, R = await lt(W);
748
- R && (s.value = {
744
+ const L = f.value.Sheets.ingredient, S = await pt(L);
745
+ S && (s.value = {
749
746
  ...s.value,
750
- _invalidExcel: R.invalidExcel || ((J = s.value) == null ? void 0 : J._invalidExcel),
751
- _invalidExcelMessage: R.invalidExcelMessage || ((X = s.value) == null ? void 0 : X._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Ingredients sheet",
752
- skus: R.importCreateResult || R.importUpdateResult ? {
753
- create: ((H = R.importCreateResult) == null ? void 0 : H.map((x) => ({
754
- ...x.sku,
755
- errors: x.errors
747
+ _invalidExcel: S.invalidExcel || ((X = s.value) == null ? void 0 : X._invalidExcel),
748
+ _invalidExcelMessage: S.invalidExcelMessage || ((q = s.value) == null ? void 0 : q._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Ingredients sheet",
749
+ skus: S.importCreateResult || S.importUpdateResult ? {
750
+ create: ((H = S.importCreateResult) == null ? void 0 : H.map(($) => ({
751
+ ...$.sku,
752
+ errors: $.errors
756
753
  }))) || [],
757
- update: (($ = R.importUpdateResult) == null ? void 0 : $.map((x) => ({
758
- ...x.sku,
759
- errors: x.errors
754
+ update: ((M = S.importUpdateResult) == null ? void 0 : M.map(($) => ({
755
+ ...$.sku,
756
+ errors: $.errors
760
757
  }))) || []
761
758
  } : (O = s.value) == null ? void 0 : O.skus
762
759
  });
763
760
  break;
764
761
  }
765
762
  case "recipe": {
766
- const W = g.value.Sheets.recipe, R = await mt(W);
767
- R && (s.value = {
763
+ const L = f.value.Sheets.recipe, S = await vt(L);
764
+ S && (s.value = {
768
765
  ...s.value,
769
- _invalidExcel: R.invalidExcel || ((j = s.value) == null ? void 0 : j._invalidExcel),
770
- _invalidExcelMessage: R.invalidExcelMessage || ((K = s.value) == null ? void 0 : K._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Recipes sheet",
771
- recipes: R.importCreateResult || R.importUpdateResult ? {
772
- create: ((P = R.importCreateResult) == null ? void 0 : P.map((x) => ({
773
- ...x.recipe,
774
- errors: x.errors
766
+ _invalidExcel: S.invalidExcel || ((j = s.value) == null ? void 0 : j._invalidExcel),
767
+ _invalidExcelMessage: S.invalidExcelMessage || ((K = s.value) == null ? void 0 : K._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Recipes sheet",
768
+ recipes: S.importCreateResult || S.importUpdateResult ? {
769
+ create: ((P = S.importCreateResult) == null ? void 0 : P.map(($) => ({
770
+ ...$.recipe,
771
+ errors: $.errors
775
772
  }))) || [],
776
- update: ((me = R.importUpdateResult) == null ? void 0 : me.map((x) => ({
777
- ...x.recipe,
778
- errors: x.errors
773
+ update: ((me = S.importUpdateResult) == null ? void 0 : me.map(($) => ({
774
+ ...$.recipe,
775
+ errors: $.errors
779
776
  }))) || []
780
777
  } : (ue = s.value) == null ? void 0 : ue.recipes
781
778
  });
782
779
  break;
783
780
  }
784
781
  }
785
- f.value.shift(), u.value = !0;
786
- } catch (W) {
787
- console.error(`Error processing ${m} sheet:`, W), y.open({
782
+ b.value.shift(), u.value = !0;
783
+ } catch (L) {
784
+ console.error(`Error processing ${m} sheet:`, L), g.open({
788
785
  title: e("inventory.common.processingError"),
789
786
  message: e("inventory.common.failedToProcessSheet", [m]),
790
787
  type: "error"
@@ -792,18 +789,18 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
792
789
  }
793
790
  }
794
791
  async function be() {
795
- var m, t, G, B, V, z, J, X, H, $, O, j, K, P, me, ue, W, R;
792
+ var m, t, C, B, W, z, X, q, H, M, O, j, K, P, me, ue, L, S, $, Ue, Ge, Ne, Te, Me;
796
793
  if (s.value) {
797
- if (E.value) {
798
- y.open({
794
+ if (I.value) {
795
+ g.open({
799
796
  title: e("inventory.common.invalidExcelFormatTitle"),
800
- message: Z.value,
797
+ message: ee.value,
801
798
  type: "error"
802
799
  });
803
800
  return;
804
801
  }
805
- if (I.value) {
806
- y.open({
802
+ if (w.value) {
803
+ g.open({
807
804
  title: e("inventory.ingredient.import.error.invalidContent"),
808
805
  message: e("inventory.ingredient.import.error.hasErrors"),
809
806
  type: "error"
@@ -812,115 +809,115 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
812
809
  }
813
810
  l.value = !0;
814
811
  try {
815
- let x = 0, ne = "";
812
+ let V = 0, oe = "";
816
813
  if (s.value.units && ((m = s.value.units.create) != null && m.length || (t = s.value.units.update) != null && t.length)) {
817
- const M = {
818
- create: re(s.value.units.create),
819
- update: re(s.value.units.update)
814
+ const T = {
815
+ create: ((C = s.value.units.create) == null ? void 0 : C.filter((c) => !c.errors || c.errors.length === 0)) || [],
816
+ update: ((B = s.value.units.update) == null ? void 0 : B.filter((c) => !c.errors || c.errors.length === 0)) || []
820
817
  };
821
- if (M.create.length || M.update.length) {
822
- const _ = await h.importUnits(M);
823
- ((G = _ == null ? void 0 : _.errors) == null ? void 0 : G.length) > 0 && d.value.push(..._.errors.map((oe) => ({
818
+ if (T.create.length || T.update.length) {
819
+ const c = await x.importUnits(T);
820
+ ((W = c == null ? void 0 : c.errors) == null ? void 0 : W.length) > 0 && d.value.push(...c.errors.map((re) => ({
824
821
  type: "units",
825
- error: oe
822
+ error: re
826
823
  })));
827
- const ee = M.create.length + M.update.length, te = ((B = _ == null ? void 0 : _.errors) == null ? void 0 : B.length) || 0;
828
- x = ee - te, ne = "units", s.value = {
824
+ const te = T.create.length + T.update.length, ne = ((z = c == null ? void 0 : c.errors) == null ? void 0 : z.length) || 0;
825
+ V = te - ne, oe = "units", s.value = {
829
826
  ...s.value,
830
827
  units: null
831
828
  };
832
829
  }
833
- } else if (s.value.skus && ((V = s.value.skus.create) != null && V.length || (z = s.value.skus.update) != null && z.length)) {
834
- const M = {
835
- create: re(s.value.skus.create),
836
- update: re(s.value.skus.update)
830
+ } else if (s.value.skus && ((X = s.value.skus.create) != null && X.length || (q = s.value.skus.update) != null && q.length)) {
831
+ const T = {
832
+ create: ((H = s.value.skus.create) == null ? void 0 : H.filter((c) => !c.errors || c.errors.length === 0)) || [],
833
+ update: ((M = s.value.skus.update) == null ? void 0 : M.filter((c) => !c.errors || c.errors.length === 0)) || []
837
834
  };
838
- if (M.create.length || M.update.length) {
839
- const _ = await h.importSkus(M);
840
- ((J = _ == null ? void 0 : _.errors) == null ? void 0 : J.length) > 0 && d.value.push(..._.errors.map((oe) => ({
835
+ if (T.create.length || T.update.length) {
836
+ const c = await x.importSkus(T);
837
+ ((O = c == null ? void 0 : c.errors) == null ? void 0 : O.length) > 0 && d.value.push(...c.errors.map((re) => ({
841
838
  type: "ingredients",
842
- error: oe
839
+ error: re
843
840
  })));
844
- const ee = M.create.length + M.update.length, te = ((X = _ == null ? void 0 : _.errors) == null ? void 0 : X.length) || 0;
845
- x = ee - te, ne = "ingredients", s.value = {
841
+ const te = T.create.length + T.update.length, ne = ((j = c == null ? void 0 : c.errors) == null ? void 0 : j.length) || 0;
842
+ V = te - ne, oe = "ingredients", s.value = {
846
843
  ...s.value,
847
844
  skus: null
848
845
  };
849
846
  }
850
- } else if (s.value.recipes && ((H = s.value.recipes.create) != null && H.length || ($ = s.value.recipes.update) != null && $.length)) {
851
- const M = {
852
- create: re(s.value.recipes.create),
853
- update: re(s.value.recipes.update)
847
+ } else if (s.value.recipes && ((K = s.value.recipes.create) != null && K.length || (P = s.value.recipes.update) != null && P.length)) {
848
+ const T = {
849
+ create: ((me = s.value.recipes.create) == null ? void 0 : me.filter((c) => !c.errors || c.errors.length === 0)) || [],
850
+ update: ((ue = s.value.recipes.update) == null ? void 0 : ue.filter((c) => !c.errors || c.errors.length === 0)) || []
854
851
  };
855
- if (M.create.length || M.update.length) {
856
- const _ = await h.importRecipes(M);
857
- ((O = _ == null ? void 0 : _.errors) == null ? void 0 : O.length) > 0 && d.value.push(..._.errors.map((oe) => ({
852
+ if (T.create.length || T.update.length) {
853
+ const c = await x.importRecipes(T);
854
+ ((L = c == null ? void 0 : c.errors) == null ? void 0 : L.length) > 0 && d.value.push(...c.errors.map((re) => ({
858
855
  type: "recipes",
859
- error: oe
856
+ error: re
860
857
  })));
861
- const ee = M.create.length + M.update.length, te = ((j = _ == null ? void 0 : _.errors) == null ? void 0 : j.length) || 0;
862
- x = ee - te, ne = "recipes", s.value = {
858
+ const te = T.create.length + T.update.length, ne = ((S = c == null ? void 0 : c.errors) == null ? void 0 : S.length) || 0;
859
+ V = te - ne, oe = "recipes", s.value = {
863
860
  ...s.value,
864
861
  recipes: null
865
862
  };
866
863
  }
867
864
  }
868
- if (x > 0) {
869
- const M = d.value.filter((_) => _.type === ne);
870
- M.length > 0 ? y.open({
865
+ if (V > 0) {
866
+ const T = d.value.filter((c) => c.type === oe);
867
+ T.length > 0 ? g.open({
871
868
  title: e("inventory.common.importCompletedWithIssues"),
872
- message: e("inventory.common.successfullyImported", [x, ne, M.length, ne]),
869
+ message: e("inventory.common.successfullyImported", [V, oe, T.length, oe]),
873
870
  type: "warning"
874
- }) : y.open({
871
+ }) : g.open({
875
872
  title: e("inventory.ingredient.import.success"),
876
- message: e("inventory.common.successfullyImported", [x, ne, "0", ""]),
873
+ message: e("inventory.common.successfullyImported", [V, oe, "0", ""]),
877
874
  type: "success"
878
875
  });
879
876
  }
880
- if (f.value.length > 0)
877
+ if (b.value.length > 0)
881
878
  await ae();
882
- else if (!(s.value.units && (((K = s.value.units.create) == null ? void 0 : K.length) || ((P = s.value.units.update) == null ? void 0 : P.length)) || s.value.skus && (((me = s.value.skus.create) == null ? void 0 : me.length) || ((ue = s.value.skus.update) == null ? void 0 : ue.length)) || s.value.recipes && (((W = s.value.recipes.create) == null ? void 0 : W.length) || ((R = s.value.recipes.update) == null ? void 0 : R.length))))
879
+ else if (!(s.value.units && ((($ = s.value.units.create) == null ? void 0 : $.length) || ((Ue = s.value.units.update) == null ? void 0 : Ue.length)) || s.value.skus && (((Ge = s.value.skus.create) == null ? void 0 : Ge.length) || ((Ne = s.value.skus.update) == null ? void 0 : Ne.length)) || s.value.recipes && (((Te = s.value.recipes.create) == null ? void 0 : Te.length) || ((Me = s.value.recipes.update) == null ? void 0 : Me.length))))
883
880
  if (le(), d.value.length > 0) {
884
- const _ = d.value.filter((de) => de.type === "units").length, ee = d.value.filter((de) => de.type === "ingredients").length, te = d.value.filter((de) => de.type === "recipes").length, oe = _ + ee + te;
885
- o.value = !0, y.open({
881
+ const c = d.value.filter((de) => de.type === "units").length, te = d.value.filter((de) => de.type === "ingredients").length, ne = d.value.filter((de) => de.type === "recipes").length, re = c + te + ne;
882
+ o.value = !0, g.open({
886
883
  title: e("inventory.common.importCompletedWithIssues"),
887
- message: e("inventory.common.importFinishedWithFailedItems", [oe, _, ee, te]),
884
+ message: e("inventory.common.importFinishedWithFailedItems", [re, c, te, ne]),
888
885
  type: "warning"
889
886
  }), console.error("Import errors:", d.value);
890
887
  } else
891
- y.open({
888
+ g.open({
892
889
  title: e("inventory.common.importComplete"),
893
890
  message: e("inventory.common.allDataSuccessfullyImported"),
894
891
  type: "success"
895
892
  });
896
- } catch (x) {
897
- y.open({
893
+ } catch (V) {
894
+ g.open({
898
895
  title: e("inventory.ingredient.import.error.failed"),
899
- message: (x == null ? void 0 : x.message) || e("inventory.common.unknownErrorOccurred"),
896
+ message: (V == null ? void 0 : V.message) || e("inventory.common.unknownErrorOccurred"),
900
897
  type: "error"
901
- }), console.error("Error during import:", x);
898
+ }), console.error("Error during import:", V);
902
899
  } finally {
903
900
  l.value = !1;
904
901
  }
905
902
  }
906
903
  }
907
904
  function le() {
908
- u.value = !1, o.value = !1, s.value = null, f.value = [], g.value = null;
905
+ u.value = !1, o.value = !1, s.value = null, b.value = [], f.value = null;
909
906
  }
910
907
  function he() {
911
908
  o.value = !1, d.value = [];
912
909
  }
913
910
  function xe() {
914
- c.value = !1, p.value = null;
911
+ p.value = !1, v.value = null;
915
912
  }
916
- const _e = L(() => [
913
+ const _e = J(() => [
917
914
  {
918
915
  label: e("inventory.common.import"),
919
916
  value: "import",
920
917
  isPrimary: !1,
921
918
  prependIcon: "upload"
922
919
  }
923
- ]), we = Ue([
920
+ ]), we = $e([
924
921
  {
925
922
  id: "name",
926
923
  accessorKey: "name",
@@ -946,11 +943,11 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
946
943
  size: 120,
947
944
  cell: (m) => {
948
945
  const t = m.row.original.status;
949
- let G = "px-8 py-4 rounded";
950
- return t === e("inventory.common.readyToImport") ? G += " bg-blue-100 text-blue-800 border border-blue-200" : t === "Imported" || t === "Successfully Imported" ? G += " bg-green-100 text-green-800 border border-green-200" : t === "Failed" ? G += " bg-red-100 text-red-800 border border-red-200" : t === e("inventory.common.validationFailed") ? G += " bg-orange-100 text-orange-800 border border-orange-200" : (t.includes("Invalid Excel"), G += " bg-red-100 text-red-800 border border-red-200"), Ie("div", { class: G, title: t }, t);
946
+ let C = "px-8 py-4 rounded";
947
+ return t === e("inventory.common.readyToImport") ? C += " bg-blue-100 text-blue-800 border border-blue-200" : t === "Imported" || t === "Successfully Imported" ? C += " bg-green-100 text-green-800 border border-green-200" : t === "Failed" ? C += " bg-red-100 text-red-800 border border-red-200" : t === e("inventory.common.validationFailed") ? C += " bg-orange-100 text-orange-800 border border-orange-200" : (t.includes("Invalid Excel"), C += " bg-red-100 text-red-800 border border-red-200"), Ie("div", { class: C, title: t }, t);
951
948
  }
952
949
  }
953
- ]), Se = Ue([
950
+ ]), Se = $e([
954
951
  {
955
952
  id: "name",
956
953
  accessorKey: "name",
@@ -962,8 +959,8 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
962
959
  accessorKey: "type",
963
960
  header: () => e("inventory.common.errorType"),
964
961
  cell: (m) => {
965
- const t = m.row.original.type, G = e(t === "units" ? "inventory.common.unit" : t === "ingredients" ? "inventory.common.ingredient" : t === "recipes" ? "inventory.common.recipe" : "inventory.common.unknown");
966
- return Ie("div", { class: "text-gray-800 text-sm py-2" }, G);
962
+ const t = m.row.original.type, C = e(t === "units" ? "inventory.common.unit" : t === "ingredients" ? "inventory.common.ingredient" : t === "recipes" ? "inventory.common.recipe" : "inventory.common.unknown");
963
+ return Ie("div", { class: "text-gray-800 text-sm py-2" }, C);
967
964
  }
968
965
  },
969
966
  {
@@ -978,140 +975,140 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
978
975
  }
979
976
  ]);
980
977
  return (m, t) => {
981
- const G = Q("FmIcon"), B = Q("FmButton"), V = Q("FmTable"), z = Q("FmCard"), J = Q("FmSideSheet"), X = Q("FmSpinner");
982
- return i(b).isLoaded && i(b).enableBulkImport ? (T(), se(ke, {
978
+ const C = Y("FmIcon"), B = Y("FmButton"), W = Y("FmTable"), z = Y("FmCard"), X = Y("FmSideSheet"), q = Y("FmSpinner");
979
+ return i(h).isLoaded && i(h).enableBulkImport ? (N(), se(ke, {
983
980
  key: 0,
984
981
  title: i(e)("inventory.common.import"),
985
982
  actions: _e.value,
986
983
  "onClick:action": ye
987
984
  }, {
988
- default: q(() => {
985
+ default: Q(() => {
989
986
  var H;
990
987
  return [
991
988
  n("div", {
992
989
  class: ce([
993
990
  "flex flex-col gap-8 max-h-full",
994
991
  {
995
- "p-0": v.value,
996
- "px-24": !v.value
992
+ "p-0": y.value,
993
+ "px-24": !y.value
997
994
  }
998
995
  ])
999
996
  }, [
1000
- u.value ? Y("", !0) : (T(), D("div", _t, [
1001
- n("div", wt, [
1002
- A(G, {
997
+ u.value ? Z("", !0) : (N(), D("div", kt, [
998
+ n("div", Rt, [
999
+ A(C, {
1003
1000
  name: "info",
1004
1001
  class: "text-blue-600 mt-2"
1005
1002
  }),
1006
- n("div", It, [
1007
- n("div", Et, a(i(e)("inventory.ingredient.import.multiUploadTemplateInstruction")), 1),
1008
- n("div", St, [
1009
- n("div", kt, [
1003
+ n("div", Ct, [
1004
+ n("div", Ut, a(i(e)("inventory.ingredient.import.multiUploadTemplateInstruction")), 1),
1005
+ n("div", Gt, [
1006
+ n("div", Nt, [
1010
1007
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
1011
1008
  ]),
1012
- t[39] || (t[39] = C(" 1. ")),
1009
+ t[39] || (t[39] = k(" 1. ")),
1013
1010
  n("span", {
1014
1011
  innerHTML: i(e)("inventory.ingredient.import.importInstructions.step1")
1015
- }, null, 8, Rt),
1012
+ }, null, 8, Tt),
1016
1013
  t[40] || (t[40] = n("br", null, null, -1)),
1017
- t[41] || (t[41] = C(" 2. ")),
1014
+ t[41] || (t[41] = k(" 2. ")),
1018
1015
  n("span", {
1019
1016
  innerHTML: i(e)("inventory.ingredient.import.importInstructions.step2")
1020
- }, null, 8, Ct),
1017
+ }, null, 8, Mt),
1021
1018
  t[42] || (t[42] = n("br", null, null, -1)),
1022
- C(" 3. " + a(i(e)("inventory.ingredient.import.importInstructions.step3")), 1),
1019
+ k(" 3. " + a(i(e)("inventory.ingredient.import.importInstructions.step3")), 1),
1023
1020
  t[43] || (t[43] = n("br", null, null, -1)),
1024
- C(" 4. " + a(i(e)("inventory.ingredient.import.importInstructions.step4")), 1),
1021
+ k(" 4. " + a(i(e)("inventory.ingredient.import.importInstructions.step4")), 1),
1025
1022
  t[44] || (t[44] = n("br", null, null, -1)),
1026
1023
  t[45] || (t[45] = n("br", null, null, -1)),
1027
- n("div", Ut, [
1024
+ n("div", $t, [
1028
1025
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
1029
1026
  ]),
1030
- n("div", Gt, [
1027
+ n("div", Ft, [
1031
1028
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.title")), 1),
1032
- C(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.description")), 1),
1029
+ k(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.description")), 1),
1033
1030
  t[1] || (t[1] = n("br", null, null, -1)),
1034
- t[2] || (t[2] = C(" • ")),
1031
+ t[2] || (t[2] = k(" • ")),
1035
1032
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col1")), 1),
1036
1033
  t[3] || (t[3] = n("br", null, null, -1)),
1037
- t[4] || (t[4] = C(" • ")),
1034
+ t[4] || (t[4] = k(" • ")),
1038
1035
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col2")), 1),
1039
1036
  t[5] || (t[5] = n("br", null, null, -1)),
1040
- t[6] || (t[6] = C(" • ")),
1037
+ t[6] || (t[6] = k(" • ")),
1041
1038
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col3")), 1),
1042
1039
  t[7] || (t[7] = n("br", null, null, -1)),
1043
- t[8] || (t[8] = C(" • ")),
1040
+ t[8] || (t[8] = k(" • ")),
1044
1041
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col4")), 1),
1045
1042
  t[9] || (t[9] = n("br", null, null, -1)),
1046
- t[10] || (t[10] = C(" • ")),
1043
+ t[10] || (t[10] = k(" • ")),
1047
1044
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col5")), 1),
1048
1045
  t[11] || (t[11] = n("br", null, null, -1)),
1049
- t[12] || (t[12] = C(" • ")),
1046
+ t[12] || (t[12] = k(" • ")),
1050
1047
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col6")), 1)
1051
1048
  ]),
1052
- n("div", Nt, [
1049
+ n("div", At, [
1053
1050
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.title")), 1),
1054
- C(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.description")), 1),
1051
+ k(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.description")), 1),
1055
1052
  t[13] || (t[13] = n("br", null, null, -1)),
1056
- t[14] || (t[14] = C(" • ")),
1053
+ t[14] || (t[14] = k(" • ")),
1057
1054
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col1")), 1),
1058
1055
  t[15] || (t[15] = n("br", null, null, -1)),
1059
- t[16] || (t[16] = C(" • ")),
1056
+ t[16] || (t[16] = k(" • ")),
1060
1057
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col2")), 1),
1061
1058
  t[17] || (t[17] = n("br", null, null, -1)),
1062
- t[18] || (t[18] = C(" • ")),
1059
+ t[18] || (t[18] = k(" • ")),
1063
1060
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col3")), 1),
1064
1061
  t[19] || (t[19] = n("br", null, null, -1)),
1065
- t[20] || (t[20] = C(" • ")),
1062
+ t[20] || (t[20] = k(" • ")),
1066
1063
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col4")), 1),
1067
1064
  t[21] || (t[21] = n("br", null, null, -1)),
1068
- t[22] || (t[22] = C(" • ")),
1065
+ t[22] || (t[22] = k(" • ")),
1069
1066
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col5")), 1)
1070
1067
  ]),
1071
- n("div", Tt, [
1068
+ n("div", Dt, [
1072
1069
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.title")), 1),
1073
- C(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.description")), 1),
1070
+ k(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.description")), 1),
1074
1071
  t[23] || (t[23] = n("br", null, null, -1)),
1075
- t[24] || (t[24] = C(" • ")),
1072
+ t[24] || (t[24] = k(" • ")),
1076
1073
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col1")), 1),
1077
1074
  t[25] || (t[25] = n("br", null, null, -1)),
1078
- t[26] || (t[26] = C(" • ")),
1075
+ t[26] || (t[26] = k(" • ")),
1079
1076
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col2")), 1),
1080
1077
  t[27] || (t[27] = n("br", null, null, -1)),
1081
- t[28] || (t[28] = C(" • ")),
1078
+ t[28] || (t[28] = k(" • ")),
1082
1079
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col3")), 1),
1083
1080
  t[29] || (t[29] = n("br", null, null, -1)),
1084
- t[30] || (t[30] = C(" • ")),
1081
+ t[30] || (t[30] = k(" • ")),
1085
1082
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col4")), 1),
1086
1083
  t[31] || (t[31] = n("br", null, null, -1)),
1087
- t[32] || (t[32] = C(" • ")),
1084
+ t[32] || (t[32] = k(" • ")),
1088
1085
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col5")), 1),
1089
1086
  t[33] || (t[33] = n("br", null, null, -1)),
1090
- t[34] || (t[34] = C(" • ")),
1087
+ t[34] || (t[34] = k(" • ")),
1091
1088
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col6")), 1),
1092
1089
  t[35] || (t[35] = n("br", null, null, -1)),
1093
- t[36] || (t[36] = C(" • ")),
1090
+ t[36] || (t[36] = k(" • ")),
1094
1091
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col7")), 1),
1095
1092
  t[37] || (t[37] = n("br", null, null, -1)),
1096
- t[38] || (t[38] = C(" • ")),
1093
+ t[38] || (t[38] = k(" • ")),
1097
1094
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col8")), 1)
1098
1095
  ]),
1099
- n("div", Mt, [
1096
+ n("div", Bt, [
1100
1097
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.warning")), 1)
1101
1098
  ])
1102
1099
  ])
1103
1100
  ])
1104
1101
  ])
1105
1102
  ])),
1106
- u.value ? (T(), D("div", $t, [
1107
- n("div", Ft, [
1103
+ u.value ? (N(), D("div", Pt, [
1104
+ n("div", jt, [
1108
1105
  n("div", null, [
1109
- n("div", At, a(i(e)("inventory.common.importPreview")), 1),
1110
- n("div", Dt, [
1111
- E.value ? (T(), D("span", Bt, a(i(e)("inventory.common.errorExist")) + ": " + a(Z.value), 1)) : I.value ? (T(), D("span", Pt, a(i(e)("inventory.common.someItemsValidationErrors")), 1)) : (T(), D("span", jt, a(i(e)("inventory.common.allItemsValidReadyImport")), 1))
1106
+ n("div", Ot, a(i(e)("inventory.common.importPreview")), 1),
1107
+ n("div", Ht, [
1108
+ I.value ? (N(), D("span", zt, a(i(e)("inventory.common.errorExist")) + ": " + a(ee.value), 1)) : w.value ? (N(), D("span", Kt, a(i(e)("inventory.common.someItemsValidationErrors")), 1)) : (N(), D("span", Vt, a(i(e)("inventory.common.allItemsValidReadyImport")), 1))
1112
1109
  ])
1113
1110
  ]),
1114
- n("div", Ot, [
1111
+ n("div", Wt, [
1115
1112
  A(B, {
1116
1113
  variant: "secondary",
1117
1114
  onClick: le,
@@ -1121,29 +1118,29 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
1121
1118
  variant: "primary",
1122
1119
  onClick: be,
1123
1120
  loading: l.value,
1124
- disabled: l.value || I.value || E.value,
1121
+ disabled: l.value || w.value || I.value,
1125
1122
  label: i(e)("inventory.common.import")
1126
1123
  }, null, 8, ["loading", "disabled", "label"])
1127
1124
  ])
1128
1125
  ]),
1129
- n("div", Ht, [
1130
- A(V, {
1126
+ n("div", Lt, [
1127
+ A(W, {
1131
1128
  "column-defs": we.value,
1132
- "row-data": N.value,
1133
- "page-size": w.value,
1129
+ "row-data": G.value,
1130
+ "page-size": _.value,
1134
1131
  "search-value": r.value,
1135
1132
  loading: !1,
1136
1133
  "row-hover": ""
1137
1134
  }, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
1138
1135
  ])
1139
- ])) : Y("", !0),
1140
- o.value && d.value.length > 0 ? (T(), D("div", zt, [
1141
- n("div", Kt, [
1136
+ ])) : Z("", !0),
1137
+ o.value && d.value.length > 0 ? (N(), D("div", Jt, [
1138
+ n("div", Xt, [
1142
1139
  n("div", null, [
1143
- n("div", Vt, a(i(e)("inventory.common.importErrors")), 1),
1144
- n("div", Wt, a(d.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(d.value.length) + " " + a(i(e)("inventory.common.itemsFailedImport")), 1)
1145
1142
  ]),
1146
- n("div", Lt, [
1143
+ n("div", Yt, [
1147
1144
  A(B, {
1148
1145
  variant: "secondary",
1149
1146
  onClick: he,
@@ -1151,27 +1148,27 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
1151
1148
  }, null, 8, ["label"])
1152
1149
  ])
1153
1150
  ]),
1154
- n("div", Jt, [
1155
- A(V, {
1151
+ n("div", Zt, [
1152
+ A(W, {
1156
1153
  "column-defs": Se.value,
1157
1154
  "row-data": ve.value,
1158
- "page-size": w.value,
1155
+ "page-size": _.value,
1159
1156
  "search-value": r.value,
1160
1157
  loading: !1,
1161
1158
  "row-hover": ""
1162
1159
  }, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
1163
1160
  ])
1164
- ])) : Y("", !0)
1161
+ ])) : Z("", !0)
1165
1162
  ], 2),
1166
- A(J, {
1167
- "model-value": c.value,
1168
- "onUpdate:modelValue": t[0] || (t[0] = ($) => c.value = $),
1169
- header: `${(H = p.value) == null ? void 0 : H.type} Details`,
1163
+ A(X, {
1164
+ "model-value": p.value,
1165
+ "onUpdate:modelValue": t[0] || (t[0] = (M) => p.value = M),
1166
+ header: `${(H = v.value) == null ? void 0 : H.type} Details`,
1170
1167
  "max-width": 600,
1171
1168
  "dismiss-away": ""
1172
1169
  }, {
1173
- "side-sheet-footer": q(() => [
1174
- n("div", yn, [
1170
+ "side-sheet-footer": Q(() => [
1171
+ n("div", xn, [
1175
1172
  A(B, {
1176
1173
  label: i(e)("inventory.common.close"),
1177
1174
  variant: "tertiary",
@@ -1179,116 +1176,116 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
1179
1176
  }, null, 8, ["label"])
1180
1177
  ])
1181
1178
  ]),
1182
- default: q(() => [
1183
- p.value != null ? (T(), D("div", Xt, [
1179
+ default: Q(() => [
1180
+ v.value != null ? (N(), D("div", en, [
1184
1181
  A(z, {
1185
1182
  variant: "outlined",
1186
1183
  class: "p-16"
1187
1184
  }, {
1188
- default: q(() => {
1189
- var $, O, j, K, P;
1185
+ default: Q(() => {
1186
+ var M, O, j, K, P;
1190
1187
  return [
1191
- n("div", qt, a(i(e)("inventory.common.basicInformation")), 1),
1192
- n("div", Qt, [
1188
+ n("div", tn, a(i(e)("inventory.common.basicInformation")), 1),
1189
+ n("div", nn, [
1193
1190
  n("div", null, [
1194
- n("div", Yt, a(i(e)("inventory.common.name")), 1),
1195
- n("div", Zt, a(((O = ($ = p.value) == null ? void 0 : $.details) == null ? void 0 : O.name) || ((j = p.value) == null ? void 0 : j.name)), 1)
1191
+ n("div", on, a(i(e)("inventory.common.name")), 1),
1192
+ n("div", rn, a(((O = (M = v.value) == null ? void 0 : M.details) == null ? void 0 : O.name) || ((j = v.value) == null ? void 0 : j.name)), 1)
1196
1193
  ]),
1197
- (P = (K = p.value) == null ? void 0 : K.details) != null && P.code ? (T(), D("div", en, [
1198
- n("div", tn, a(i(e)("inventory.common.code")), 1),
1199
- n("div", nn, a(p.value.details.code), 1)
1200
- ])) : Y("", !0),
1194
+ (P = (K = v.value) == null ? void 0 : K.details) != null && P.code ? (N(), D("div", sn, [
1195
+ n("div", an, a(i(e)("inventory.common.code")), 1),
1196
+ n("div", ln, a(v.value.details.code), 1)
1197
+ ])) : Z("", !0),
1201
1198
  n("div", null, [
1202
- n("div", on, a(i(e)("inventory.common.type")), 1),
1203
- n("div", rn, a(p.value.type), 1)
1199
+ n("div", mn, a(i(e)("inventory.common.type")), 1),
1200
+ n("div", un, a(v.value.type), 1)
1204
1201
  ]),
1205
1202
  n("div", null, [
1206
- n("div", sn, a(i(e)("inventory.common.operation")), 1),
1207
- n("div", an, a(p.value.operation), 1)
1203
+ n("div", dn, a(i(e)("inventory.common.operation")), 1),
1204
+ n("div", cn, a(v.value.operation), 1)
1208
1205
  ]),
1209
1206
  n("div", null, [
1210
- n("div", ln, a(i(e)("inventory.common.status")), 1),
1207
+ n("div", pn, a(i(e)("inventory.common.status")), 1),
1211
1208
  n("div", {
1212
1209
  class: ce([
1213
1210
  "inline-block px-8 py-4 rounded text-sm",
1214
- p.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
+ v.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"
1215
1212
  ])
1216
- }, a(p.value.status), 3)
1213
+ }, a(v.value.status), 3)
1217
1214
  ])
1218
1215
  ])
1219
1216
  ];
1220
1217
  }),
1221
1218
  _: 1
1222
1219
  }),
1223
- p.value.errors && p.value.errors.length > 0 ? (T(), se(z, {
1220
+ v.value.errors && v.value.errors.length > 0 ? (N(), se(z, {
1224
1221
  key: 0,
1225
1222
  variant: "outlined",
1226
1223
  class: "p-16"
1227
1224
  }, {
1228
- default: q(() => [
1229
- n("div", mn, a(i(e)("inventory.common.validationErrors")), 1),
1230
- n("div", un, [
1231
- (T(!0), D(Me, null, $e(p.value.errors, ($, O) => (T(), D("div", {
1225
+ default: Q(() => [
1226
+ n("div", vn, a(i(e)("inventory.common.validationErrors")), 1),
1227
+ n("div", yn, [
1228
+ (N(!0), D(Be, null, Pe(v.value.errors, (M, O) => (N(), D("div", {
1232
1229
  key: O,
1233
1230
  class: "flex items-start gap-8 p-12 bg-red-50 border border-red-200 rounded"
1234
1231
  }, [
1235
- A(G, {
1232
+ A(C, {
1236
1233
  name: "error",
1237
1234
  class: "text-red-600 mt-2",
1238
1235
  size: "sm"
1239
1236
  }),
1240
- n("div", dn, a($), 1)
1237
+ n("div", gn, a(M), 1)
1241
1238
  ]))), 128))
1242
1239
  ])
1243
1240
  ]),
1244
1241
  _: 1
1245
- })) : Y("", !0),
1242
+ })) : Z("", !0),
1246
1243
  A(z, {
1247
1244
  variant: "outlined",
1248
1245
  class: "p-16"
1249
1246
  }, {
1250
- default: q(() => [
1251
- n("div", cn, a(i(e)("inventory.common.rawData")), 1),
1252
- n("div", pn, [
1253
- n("pre", vn, a(JSON.stringify(p.value.details, null, 2)), 1)
1247
+ default: Q(() => [
1248
+ n("div", fn, a(i(e)("inventory.common.rawData")), 1),
1249
+ n("div", bn, [
1250
+ n("pre", hn, a(JSON.stringify(v.value.details, null, 2)), 1)
1254
1251
  ])
1255
1252
  ]),
1256
1253
  _: 1
1257
1254
  })
1258
- ])) : Y("", !0)
1255
+ ])) : Z("", !0)
1259
1256
  ]),
1260
1257
  _: 1
1261
1258
  }, 8, ["model-value", "header"])
1262
1259
  ];
1263
1260
  }),
1264
1261
  _: 1
1265
- }, 8, ["title", "actions"])) : i(b).isLoaded ? (T(), se(ke, {
1262
+ }, 8, ["title", "actions"])) : i(h).isLoaded ? (N(), se(ke, {
1266
1263
  key: 2,
1267
1264
  title: i(e)("inventory.common.import")
1268
1265
  }, {
1269
- default: q(() => [
1270
- n("div", hn, [
1271
- A(G, {
1266
+ default: Q(() => [
1267
+ n("div", En, [
1268
+ A(C, {
1272
1269
  name: "block",
1273
1270
  class: "text-gray-400",
1274
1271
  size: "xl"
1275
1272
  }),
1276
- n("div", xn, [
1277
- n("div", _n, a(i(e)("inventory.common.featureNotAvailable")), 1),
1278
- n("div", wn, 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)
1279
1276
  ])
1280
1277
  ])
1281
1278
  ]),
1282
1279
  _: 1
1283
- }, 8, ["title"])) : (T(), se(ke, {
1280
+ }, 8, ["title"])) : (N(), se(ke, {
1284
1281
  key: 1,
1285
1282
  title: i(e)("inventory.common.import")
1286
1283
  }, {
1287
- default: q(() => [
1288
- n("div", gn, [
1289
- A(X, { size: "lg" }),
1290
- n("div", fn, [
1291
- n("div", bn, a(i(e)("inventory.common.loading")), 1)
1284
+ default: Q(() => [
1285
+ n("div", _n, [
1286
+ A(q, { size: "lg" }),
1287
+ n("div", wn, [
1288
+ n("div", In, a(i(e)("inventory.common.loading")), 1)
1292
1289
  ])
1293
1290
  ])
1294
1291
  ]),
@@ -1298,5 +1295,5 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
1298
1295
  }
1299
1296
  });
1300
1297
  export {
1301
- Dn as default
1298
+ Hn as default
1302
1299
  };