@feedmepos/mf-inventory-portal 1.2.50-dev.2 → 1.2.50

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 (90) hide show
  1. package/dist/{App-DAO7XF9h.js → App-DssF0b6P.js} +68 -72
  2. package/dist/{ApprovalView-BUHefc15.js → ApprovalView-DTCayLqE.js} +34 -34
  3. package/dist/{BindingsDialog-Cx9ngX7X.js → BindingsDialog-C2-THIG0.js} +2 -2
  4. package/dist/{BindingsPicker-CIZ9FVgv.js → BindingsPicker-Q9W92GzO.js} +2 -2
  5. package/dist/{BindingsTable-CMyZkvyn.js → BindingsTable-BQo8HpbF.js} +4 -4
  6. package/dist/{ClosingDraftView-D4CMfSvf.js → ClosingDraftView-B0spMbZd.js} +18 -19
  7. package/dist/{ClosingHistoryView-J_2EA-F4.js → ClosingHistoryView-DDVibMzL.js} +3 -3
  8. package/dist/{ClosingTemplateView-Bz21bJLn.js → ClosingTemplateView-BSiNTpkH.js} +17 -18
  9. package/dist/{DeliveryOrderPrintPreview-D9xRJSBT.js → DeliveryOrderPrintPreview-P9JASYcM.js} +1 -1
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-ifkxhq6-.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DkvLYf5A.js} +4 -4
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BcJ1ydJ1.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CaQq9jpc.js} +12 -12
  12. package/dist/FmMultiselectDialog-BgLyRNeD.js +598 -0
  13. package/dist/{FmMultiselectDialog-Cxj6_Bbq.js → FmMultiselectDialog-DKEGwdyz.js} +1 -1
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CJsg-6qm.js → FmUnitInput.vue_vue_type_script_setup_true_lang-H5xYFc6B.js} +3 -3
  15. package/dist/{ImportView-mq9p_YKN.js → ImportView-CKg0Z3Bz.js} +7 -7
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CvdNblLJ.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-y1qeqeUV.js} +1 -1
  17. package/dist/{IngredientGroupView-1YQdweWW.js → IngredientGroupView-DntDNlVX.js} +107 -108
  18. package/dist/{IngredientsView-rZZDO37M.js → IngredientsView-B93tavZW.js} +125 -126
  19. package/dist/{IntegrationView-0KCNTL9w.js → IntegrationView-CqEe7SWR.js} +80 -80
  20. package/dist/{InventoryBindingForm-Cz6tMVlQ.js → InventoryBindingForm-9E3VsD4v.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-9jHxMOEn.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Dgy_eFxJ.js} +4 -4
  22. package/dist/{InventoryBindingSummary-DarjH7Dn.js → InventoryBindingSummary-DTcoWk_n.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BR6U0SpT.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CIDw4WOz.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-C9ffyR0d.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Dao7XifY.js} +2 -2
  25. package/dist/{PublishView-Bam4W7ko.js → PublishView-GDJsOfeY.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-DEKkUMB6.js → PurchaseOrderPrintPreview-DFeZT5Zi.js} +1 -1
  27. package/dist/ReceiveRequestView-BvYpGKEB.js +2913 -0
  28. package/dist/{RecipeView-CwwKtDRg.js → RecipeView-DyJs2lsk.js} +82 -83
  29. package/dist/{StockView-CVN5MKbj.js → StockView-Cvwfcsf7.js} +112 -113
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Bm1MxmBR.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CMFiW6FL.js} +1 -1
  31. package/dist/{SupplierView-BhnmPv7N.js → SupplierView-C6rIxQOg.js} +27 -28
  32. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DdPVsOZY.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-6C5vAumx.js} +2 -2
  33. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js +162 -0
  34. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bp49G_dV.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bc0MVyK_.js} +13 -13
  35. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BQFBZ0CH.js → TransferDetails.vue_vue_type_script_setup_true_lang-BSNIRZx3.js} +15 -15
  36. package/dist/{TransferTemplateView-7AJGTAAy.js → TransferTemplateView-BVRXLZGK.js} +16 -16
  37. package/dist/{UnitView-Dz4bgzmW.js → UnitView-B9n1vDtN.js} +19 -20
  38. package/dist/{WarehouseView-DEYOa_Ol.js → WarehouseView-oyEVpI9M.js} +20 -21
  39. package/dist/{WastageTemplateView-DdPkFfyQ.js → WastageTemplateView-DCdR4fhu.js} +164 -165
  40. package/dist/api/netsuite.d.ts +0 -8
  41. package/dist/{app-kim0oKgm.js → app-_hCz0958.js} +4408 -4511
  42. package/dist/app-uBuHtW8m.js +8127 -0
  43. package/dist/app.d.ts +0 -52
  44. package/dist/app.js +1 -1
  45. package/dist/{closing-template-MLHUWgwA.js → closing-template-y0kvKjaN.js} +1 -1
  46. package/dist/components/FmInventoryTableToolbar.vue.d.ts +0 -8
  47. package/dist/components/FmMultiselectDialogProps.d.ts +0 -5
  48. package/dist/{date2-Ck1fxOS1.js → date2-Ct3mwV73.js} +1 -1
  49. package/dist/{dayjs.min-CgHxLw1P.js → dayjs.min-iDh15Qvq.js} +1 -1
  50. package/dist/{decimal-DVjzMCmx.js → decimal-DliTT0vp.js} +2 -2
  51. package/dist/{defineDeepModel-CLo1ie3w.js → defineDeepModel-DmVg-VGa.js} +1 -1
  52. package/dist/{duplicate-template-B_f_fYhs.js → duplicate-template-BO8LvPWq.js} +1 -1
  53. package/dist/{feature-D4HcMaGK.js → feature-Dk3_0hiC.js} +2810 -3440
  54. package/dist/{format-time-from-id-CwtHJpC0.js → format-time-from-id-DOmxxVYQ.js} +1 -1
  55. package/dist/{format-unit-display-DRIOlVir.js → format-unit-display-BuliV6Fn.js} +11 -11
  56. package/dist/{import-export.helper-BrcydEPI.js → import-export.helper-DpWf4zh7.js} +5 -5
  57. package/dist/{index-D9dtwK1d.js → index-BZ9fyZbO.js} +1 -1
  58. package/dist/{index-ChruXaud.js → index-C6nEuFpg.js} +1 -1
  59. package/dist/{index-Wd74fJNj.js → index-CY6-px7W.js} +3 -3
  60. package/dist/{lodash-MkfFbMhZ.js → lodash-DDMf37Aw.js} +1 -1
  61. package/dist/netsuite-CVg13Lx5.js +5131 -0
  62. package/dist/{purchase-order-template-BdKUiSPI.js → purchase-order-template-C9GqlQL3.js} +1 -1
  63. package/dist/router/name.d.ts +0 -1
  64. package/dist/{rules-KSzt3qOJ.js → rules-9-OxHCjJ.js} +3 -3
  65. package/dist/{stock-DZliLQNR.js → stock-CjJKvKsB.js} +3 -3
  66. package/dist/{stock-BHWNLsBc.js → stock-D7gYQHth.js} +1 -1
  67. package/dist/stores/integration/netsuite.d.ts +0 -5
  68. package/dist/style.css +1 -1
  69. package/dist/{supplier-CiMOpHKx.js → supplier-z1X1B4yZ.js} +2 -2
  70. package/dist/tsconfig.app.tsbuildinfo +1 -1
  71. package/dist/{use-ingredient-select-dialog-CK_Ldhwm.js → use-ingredient-select-dialog-B4u8ttOK.js} +2 -2
  72. package/dist/{use-inventory-binding-dialog-jfME3m3c.js → use-inventory-binding-dialog-CaFu9DlH.js} +2 -2
  73. package/dist/{use-template-enabled-locations-2-Dbk_RoRj.js → use-template-enabled-locations-2-KQU0hLX3.js} +2 -2
  74. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +0 -714
  75. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +0 -5
  76. package/dist/{vue-i18n-DUlOMRWF.js → vue-i18n-UG5lCeUG.js} +533 -533
  77. package/dist/{xlsx-CiNXr9Ie.js → xlsx-INrtkMe5.js} +1 -1
  78. package/dist/{xlsx.util-D81JjCsx.js → xlsx.util-OqI8IJfw.js} +1 -1
  79. package/package.json +4 -4
  80. package/dist/FmMultiselectDialog-B5F93-xV.js +0 -621
  81. package/dist/ReceiveRequestView-DDfHVcG2.js +0 -3028
  82. package/dist/SurchargeView-nlkL3YIK.js +0 -460
  83. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js +0 -84
  84. package/dist/api/surcharge.d.ts +0 -31
  85. package/dist/app-DiX-EfV6.js +0 -8167
  86. package/dist/component-DpCUABT3.js +0 -82
  87. package/dist/netsuite-D4cXyIr7.js +0 -5402
  88. package/dist/stores/surcharge.d.ts +0 -18
  89. package/dist/surcharge-CjdNdcm1.js +0 -71
  90. package/dist/views/surcharge/SurchargeView.vue.d.ts +0 -2
@@ -2,31 +2,30 @@ import { ref as D, h as P, defineComponent as G, resolveComponent as E, openBloc
2
2
  import { u as tt, _ as nt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
3
3
  import { useI18n as J, useCoreStore as Ne } from "@feedmepos/mf-common";
4
4
  import { D as ue, R as B } from "./row-action.enum-BcW_L_nE.js";
5
- import { _ as st } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BcJ1ydJ1.js";
6
- import { useDialog as Z, useDialogChild as ot, useSnackbar as ee, FmButtonVariant as me, components as H, useProxiedModel as Be, useBreakpoints as at } from "@feedmepos/ui-library";
5
+ import { _ as st } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CaQq9jpc.js";
6
+ import { useDialog as Z, useDialogChild as ot, useSnackbar as ee, FmButtonVariant as ce, components as H, useProxiedModel as Be, useBreakpoints as at } from "@feedmepos/ui-library";
7
7
  import { defineStore as ze, storeToRefs as Oe } from "pinia";
8
- import { _ as lt, F as ce } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
9
- import { u as he, c as We, a as te, E as N, n as rt, C as fe } from "./app-kim0oKgm.js";
8
+ import { c as lt, _ as rt, F as me } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
9
+ import { u as he, c as We, a as te, E as N, n as it, C as fe } from "./app-_hCz0958.js";
10
10
  import { F as q } from "./form-mode.enum-BKiNVH6A.js";
11
- import { c as it } from "./component-DpCUABT3.js";
12
- import { f as ut } from "./format-time-from-id-CwtHJpC0.js";
13
- import { u as ne } from "./closing-template-MLHUWgwA.js";
14
- import { _ as mt } from "./TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bp49G_dV.js";
15
- import { t as ve, a as He, d as Ke, s as Ye, r as ct } from "./xlsx.util-D81JjCsx.js";
16
- import { f as dt, a as de } from "./date2-Ck1fxOS1.js";
17
- import { u as pt } from "./netsuite-D4cXyIr7.js";
11
+ import { f as ut } from "./format-time-from-id-DOmxxVYQ.js";
12
+ import { u as ne } from "./closing-template-y0kvKjaN.js";
13
+ import { _ as ct } from "./TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bc0MVyK_.js";
14
+ import { t as ve, a as He, d as Ke, s as Ye, r as mt } from "./xlsx.util-OqI8IJfw.js";
15
+ import { f as dt, a as de } from "./date2-Ct3mwV73.js";
16
+ import { u as pt } from "./netsuite-CVg13Lx5.js";
18
17
  import { F as ft } from "./FmDroppableField-J0xUsOTV.js";
19
- import { u as vt } from "./duplicate-template-B_f_fYhs.js";
20
- import { A as yt, R as Ge } from "./rules-KSzt3qOJ.js";
21
- import { d as ht } from "./defineDeepModel-CLo1ie3w.js";
22
- import { u as gt } from "./use-template-enabled-locations-2-Dbk_RoRj.js";
23
- import { a as bt } from "./FmMultiselectDialog-B5F93-xV.js";
24
- import { _ as _t } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-DdPVsOZY.js";
18
+ import { u as vt } from "./duplicate-template-BO8LvPWq.js";
19
+ import { A as yt, R as Ge } from "./rules-9-OxHCjJ.js";
20
+ import { d as ht } from "./defineDeepModel-DmVg-VGa.js";
21
+ import { u as gt } from "./use-template-enabled-locations-2-KQU0hLX3.js";
22
+ import { a as bt } from "./FmMultiselectDialog-BgLyRNeD.js";
23
+ import { _ as _t } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-6C5vAumx.js";
25
24
  import { _ as xt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
26
25
  const se = ze(
27
26
  "wastageTable",
28
27
  function() {
29
- const { t: l } = J(), m = Z(), f = ye(), d = D({}), r = D(new Array()), c = D(!1), s = he(), n = ne(), o = D({}), u = D();
28
+ const { t: l } = J(), c = Z(), f = ye(), d = D({}), r = D(new Array()), m = D(!1), s = he(), n = ne(), o = D({}), u = D();
30
29
  async function h() {
31
30
  if (s._currentLocation)
32
31
  try {
@@ -64,9 +63,9 @@ const se = ze(
64
63
  locations: s.locations,
65
64
  enabledLocations: a.locations
66
65
  };
67
- m.open({
66
+ c.open({
68
67
  title: "Publish template",
69
- contentComponent: mt,
68
+ contentComponent: ct,
70
69
  contentComponentProps: e,
71
70
  closeButton: !0,
72
71
  primaryActions: {
@@ -78,7 +77,7 @@ const se = ze(
78
77
  }
79
78
  async function w() {
80
79
  if (r.value = [], !!s._currentLocation) {
81
- c.value = !0;
80
+ m.value = !0;
82
81
  try {
83
82
  const [a, e, i] = await Promise.all([
84
83
  n.readTemplates(),
@@ -89,13 +88,13 @@ const se = ze(
89
88
  } catch (a) {
90
89
  console.log("Something went wrong when fetching templates:", a);
91
90
  } finally {
92
- c.value = !1;
91
+ m.value = !1;
93
92
  }
94
93
  }
95
94
  }
96
95
  async function k(a) {
97
96
  if (!r.value.find((e) => e._id) && s._currentLocation) {
98
- c.value = !0;
97
+ m.value = !0;
99
98
  try {
100
99
  const [e] = await Promise.all([
101
100
  n.getTemplate(a),
@@ -105,7 +104,7 @@ const se = ze(
105
104
  } catch (e) {
106
105
  console.log("Something went wrong when fetching templates:", e);
107
106
  } finally {
108
- c.value = !1;
107
+ m.value = !1;
109
108
  }
110
109
  }
111
110
  }
@@ -116,11 +115,11 @@ const se = ze(
116
115
  case B.Edit:
117
116
  return f.updateTemplate(e);
118
117
  case B.Delete:
119
- return f.deleteTemplate(e, c, w);
118
+ return f.deleteTemplate(e, m, w);
120
119
  case B.Publish:
121
120
  return T(e);
122
121
  case B.Duplicate:
123
- return f.duplicateTemplate(e, c, w);
122
+ return f.duplicateTemplate(e, m, w);
124
123
  }
125
124
  }
126
125
  return {
@@ -199,7 +198,7 @@ const se = ze(
199
198
  ue[B.Delete],
200
199
  ue[B.Publish]
201
200
  ];
202
- return it(i, (g) => b(g, e));
201
+ return lt(i, (g) => b(g, e));
203
202
  },
204
203
  enableSorting: !1,
205
204
  size: 40,
@@ -213,15 +212,15 @@ const se = ze(
213
212
  templates: r,
214
213
  reasons: u,
215
214
  isReasonPublished: y,
216
- loading: c,
215
+ loading: m,
217
216
  fetchTemplates: w,
218
217
  loadTemplate: k
219
218
  };
220
219
  }
221
220
  );
222
221
  var ge = /* @__PURE__ */ ((p) => (p.Ingredients = "Ingredients", p))(ge || {});
223
- function Je(p, l, m) {
224
- var d, r, c;
222
+ function Je(p, l, c) {
223
+ var d, r, m;
225
224
  const f = [];
226
225
  if (p.type == N.Enum.sku) {
227
226
  const s = new Set(p.disabledMeasurements), n = (d = l.sku) == null ? void 0 : d.find((o) => o._id === p.id);
@@ -242,7 +241,7 @@ function Je(p, l, m) {
242
241
  );
243
242
  }
244
243
  }
245
- return p.type == N.Enum.recipe && ((r = l.recipe) != null && r.find((n) => n._id === p.id)) && f.push(p), p.type == N.Enum.menu && ((c = m == null ? void 0 : m.modules.item) != null && c.find((n) => n._id === p.id)) && f.push(p), f;
244
+ return p.type == N.Enum.recipe && ((r = l.recipe) != null && r.find((n) => n._id === p.id)) && f.push(p), p.type == N.Enum.menu && ((m = c == null ? void 0 : c.modules.item) != null && m.find((n) => n._id === p.id)) && f.push(p), f;
246
245
  }
247
246
  function qe() {
248
247
  return [
@@ -270,10 +269,10 @@ function qe() {
270
269
  }
271
270
  function wt(p) {
272
271
  var o;
273
- const l = Ne(), m = te(), f = m.menu.cache, d = l.currentBusiness.value, c = (o = p.map((u) => {
272
+ const l = Ne(), c = te(), f = c.menu.cache, d = l.currentBusiness.value, m = (o = p.map((u) => {
274
273
  var b;
275
274
  const h = u.items.flatMap(
276
- (t) => Je(t, m.state.inventory, f)
275
+ (t) => Je(t, c.state.inventory, f)
277
276
  ), y = qe(), T = [
278
277
  ["Template ID", u._id],
279
278
  ["Template name", u.name],
@@ -300,12 +299,12 @@ function wt(p) {
300
299
  sheets: {},
301
300
  sheetOccurence: {}
302
301
  }
303
- )) == null ? void 0 : o.sheets, s = `${d == null ? void 0 : d.name} adjustment templates (${dt(/* @__PURE__ */ new Date())}).xlsx`, n = He(c);
302
+ )) == null ? void 0 : o.sheets, s = `${d == null ? void 0 : d.name} adjustment templates (${dt(/* @__PURE__ */ new Date())}).xlsx`, n = He(m);
304
303
  return Ke(n, s), s;
305
304
  }
306
305
  function Tt() {
307
306
  var b;
308
- const p = Ne(), l = te(), m = pt(), f = (b = l.state.inventory.sku) == null ? void 0 : b[0];
307
+ const p = Ne(), l = te(), c = pt(), f = (b = l.state.inventory.sku) == null ? void 0 : b[0];
309
308
  if (!f)
310
309
  throw new Error("No inventory items");
311
310
  const r = Je(
@@ -317,12 +316,12 @@ function Tt() {
317
316
  },
318
317
  l.state.inventory,
319
318
  l.menu.cache
320
- )[0], c = p.currentBusiness.value, s = qe(), n = [
319
+ )[0], m = p.currentBusiness.value, s = qe(), n = [
321
320
  ["Template ID (leave empty to create new)", ""],
322
321
  ["Template Name", "New template"],
323
- ["Business name", c == null ? void 0 : c.name],
324
- ["Business ID", c == null ? void 0 : c._id],
325
- ["Menu version", c == null ? void 0 : c.menuVersion],
322
+ ["Business name", m == null ? void 0 : m.name],
323
+ ["Business ID", m == null ? void 0 : m._id],
324
+ ["Menu version", m == null ? void 0 : m.menuVersion],
326
325
  [
327
326
  "Location codes (leave empty to enable all)",
328
327
  "Example outlet (restaurant_xxx)",
@@ -332,10 +331,10 @@ function Tt() {
332
331
  [],
333
332
  s.map((t) => t.name),
334
333
  s.map((t) => r[t.id])
335
- ], o = s.map((t) => `system:${t.id}`), u = ve(n, o), h = m.isEnabled ? m.state.setting.childItems ?? [] : [], y = h.reduce(
334
+ ], o = s.map((t) => `system:${t.id}`), u = ve(n, o), h = c.isEnabled ? c.state.setting.childItems ?? [] : [], y = h.reduce(
336
335
  (t, a) => {
337
336
  var S, _;
338
- const e = (S = m.netSuiteItemIdToSkuId.get(a.parentNetSuiteId)) == null ? void 0 : S[0], i = (_ = m.netSuiteMeasurementIdToMeasurementId.get(
337
+ const e = (S = c.netSuiteItemIdToSkuId.get(a.parentNetSuiteId)) == null ? void 0 : S[0], i = (_ = c.netSuiteMeasurementIdToMeasurementId.get(
339
338
  a.unitOfMeasureId
340
339
  )) == null ? void 0 : _[0];
341
340
  if (!a.externalId)
@@ -382,7 +381,7 @@ function Tt() {
382
381
  ), w = He({
383
382
  Template: u,
384
383
  Ingredients: T
385
- }), k = `${c == null ? void 0 : c.name} transfer templates import.xlsx`;
384
+ }), k = `${m == null ? void 0 : m.name} transfer templates import.xlsx`;
386
385
  return Ke(w, k), k;
387
386
  }
388
387
  function kt(p) {
@@ -390,9 +389,9 @@ function kt(p) {
390
389
  return [];
391
390
  const l = /(.*) \(((warehouse_|restaurant_).{24,})\)/, f = he().locationByDbName;
392
391
  return p.map((d) => {
393
- const r = new Array(), c = d.trim(), s = l.exec(c);
392
+ const r = new Array(), m = d.trim(), s = l.exec(m);
394
393
  if (!s)
395
- return r.push(`Enabled location value of ${c} cannot be read.`), {
394
+ return r.push(`Enabled location value of ${m} cannot be read.`), {
396
395
  errors: r
397
396
  };
398
397
  const n = s[1], o = s[2], u = f[o];
@@ -409,16 +408,16 @@ function kt(p) {
409
408
  function $t(p) {
410
409
  const [
411
410
  l,
412
- m,
411
+ c,
413
412
  f,
414
413
  d,
415
414
  r,
416
- c,
415
+ m,
417
416
  s,
418
417
  n
419
418
  ] = Ye(p);
420
419
  return {
421
- id: `${m[1] ?? ""}`.trim(),
420
+ id: `${c[1] ?? ""}`.trim(),
422
421
  name: `${f[1] ?? ""}`.trim(),
423
422
  locations: s.slice(1).map((o) => `${o}`.trim()).filter((o) => o),
424
423
  reference: `${n[1] ?? ""}`.trim()
@@ -427,11 +426,11 @@ function $t(p) {
427
426
  function St(p) {
428
427
  const [
429
428
  l,
430
- m,
429
+ c,
431
430
  f,
432
431
  d,
433
432
  r,
434
- c,
433
+ m,
435
434
  s,
436
435
  n,
437
436
  o,
@@ -464,16 +463,16 @@ function St(p) {
464
463
  }
465
464
  function It(p) {
466
465
  return p.reduce(
467
- (l, m) => {
466
+ (l, c) => {
468
467
  var r;
469
- const f = m.data, d = m.index;
468
+ const f = c.data, d = c.index;
470
469
  if (f.type == N.Enum.recipe)
471
- l.result.push({ parent: m, children: [] });
470
+ l.result.push({ parent: c, children: [] });
472
471
  else if (f.type == N.Enum.menu)
473
- f.code ? l.result.push({ parent: m, children: [] }) : l.errors.push(`Menu item row ${d + 9} does not have a code.`);
472
+ f.code ? l.result.push({ parent: c, children: [] }) : l.errors.push(`Menu item row ${d + 9} does not have a code.`);
474
473
  else {
475
474
  if (!f.unit) return l;
476
- f.code ? l.result.push({ parent: m, children: [] }) : l.result.length ? (r = l.result.at(-1)) == null || r.children.push(m) : l.errors.push(`Cannot find parent for row ${d + 9}`);
475
+ f.code ? l.result.push({ parent: c, children: [] }) : l.result.length ? (r = l.result.at(-1)) == null || r.children.push(c) : l.errors.push(`Cannot find parent for row ${d + 9}`);
477
476
  }
478
477
  return l;
479
478
  },
@@ -482,47 +481,47 @@ function It(p) {
482
481
  }
483
482
  function Ft(p) {
484
483
  var n;
485
- const l = p.parent.data, m = new Array(), f = te();
484
+ const l = p.parent.data, c = new Array(), f = te();
486
485
  if (p.parent.data.type == N.Enum.menu) {
487
486
  const o = f.menu.cache, u = (n = o == null ? void 0 : o.modules.item) == null ? void 0 : n.find((y) => y.code === l.code);
488
487
  if (!u)
489
- return m.push(`Cannot find menu module of id ${l.code}`), { errors: m };
488
+ return c.push(`Cannot find menu module of id ${l.code}`), { errors: c };
490
489
  const h = {
491
490
  type: N.Enum.menu,
492
491
  code: u.code,
493
492
  id: u._id,
494
493
  name: u.name ?? ""
495
494
  };
496
- return { errors: m, templateItem: h };
495
+ return { errors: c, templateItem: h };
497
496
  }
498
497
  if (p.parent.data.type == N.Enum.recipe) {
499
498
  const u = f.recipes.find((y) => y.name === l.name);
500
499
  if (!u)
501
- return m.push(`Cannot find recipe module of id ${l.code}`), { errors: m };
500
+ return c.push(`Cannot find recipe module of id ${l.code}`), { errors: c };
502
501
  const h = {
503
502
  type: N.Enum.recipe,
504
503
  id: u._id,
505
504
  name: u.name ?? ""
506
505
  };
507
- return { errors: m, templateItem: h };
506
+ return { errors: c, templateItem: h };
508
507
  }
509
508
  const d = f.skuByCode[l.code ?? ""];
510
509
  if (!d)
511
- return m.push(`Cannot find ingredient of code [${l.code}] [${l.name}]`), { errors: m };
510
+ return c.push(`Cannot find ingredient of code [${l.code}] [${l.name}]`), { errors: c };
512
511
  const r = {
513
512
  type: N.Enum.sku,
514
513
  code: l.code,
515
514
  id: d._id,
516
515
  name: l.name ?? "",
517
516
  disabledMeasurements: []
518
- }, c = d.unit.measurements.find((o) => o.abbrev === l.unit);
519
- l.unit !== d.unit.abbrev && !c ? m.push(
517
+ }, m = d.unit.measurements.find((o) => o.abbrev === l.unit);
518
+ l.unit !== d.unit.abbrev && !m ? c.push(
520
519
  `Cannot find measurement unit of ${l.unit} for (${l.code}) ${l.name}.`
521
- ) : (!l.enabled || `${l.enabled}`.toLocaleLowerCase() === "false") && (r.disabledMeasurements ?? (r.disabledMeasurements = []), r.disabledMeasurements.push((c == null ? void 0 : c.id) ?? d.unit._id));
520
+ ) : (!l.enabled || `${l.enabled}`.toLocaleLowerCase() === "false") && (r.disabledMeasurements ?? (r.disabledMeasurements = []), r.disabledMeasurements.push((m == null ? void 0 : m.id) ?? d.unit._id));
522
521
  for (const o of p.children) {
523
522
  const u = o.data, h = u.unit === d.unit.abbrev ? d.unit : void 0, y = d.unit.measurements.find((T) => T.abbrev === u.unit);
524
523
  if (!y && !h) {
525
- m.push(
524
+ c.push(
526
525
  `Cannot find measurement unit of ${u.unit} for (${l.code}) ${l.name}.`
527
526
  );
528
527
  continue;
@@ -530,15 +529,15 @@ function Ft(p) {
530
529
  (!u.enabled || `${u.enabled}`.toLocaleLowerCase() === "false") && (r.disabledMeasurements ?? (r.disabledMeasurements = []), r.disabledMeasurements.push((y == null ? void 0 : y.id) ?? (h == null ? void 0 : h._id) ?? ""));
531
530
  }
532
531
  const s = new Set(r.disabledMeasurements);
533
- return s.has(d.unit._id) && d.unit.measurements.every((o) => s.has(o.id)) && m.push(`Ingredient ${d.code} - ${d.name} must have at least one unit enabled.`), { errors: m, templateItem: r };
532
+ return s.has(d.unit._id) && d.unit.measurements.every((o) => s.has(o.id)) && c.push(`Ingredient ${d.code} - ${d.name} must have at least one unit enabled.`), { errors: c, templateItem: r };
534
533
  }
535
534
  function Ct(p) {
536
535
  const l = p.SheetNames.filter(
537
536
  (r) => !Object.values(ge).map(String).includes(r)
538
- ), f = se().templates, d = rt(f, "_id");
537
+ ), f = se().templates, d = it(f, "_id");
539
538
  try {
540
539
  return l.reduce(
541
- (c, s) => {
540
+ (m, s) => {
542
541
  const n = new Array(), o = p.Sheets[s], u = $t(o), h = kt(u.locations), y = h.filter((e) => e.location).map((e) => e.location);
543
542
  n.push(...h.flatMap((e) => e.errors));
544
543
  const T = St(o).filter((e) => {
@@ -561,13 +560,13 @@ function Ct(p) {
561
560
  name: u.name || `(unnamed from sheet ${s || "<unnamed sheet>"})`,
562
561
  items: []
563
562
  };
564
- return n.push(`Template ID ${u.id} is not found.`), c.importUpdateResult.push({
563
+ return n.push(`Template ID ${u.id} is not found.`), m.importUpdateResult.push({
565
564
  type: "update",
566
565
  original: g,
567
566
  template: g,
568
567
  excelSheetName: s,
569
568
  errors: n
570
- }), c;
569
+ }), m;
571
570
  }
572
571
  const i = {
573
572
  type: "update",
@@ -581,7 +580,7 @@ function Ct(p) {
581
580
  excelSheetName: s,
582
581
  errors: n
583
582
  };
584
- return c.importUpdateResult.push(i), c;
583
+ return m.importUpdateResult.push(i), m;
585
584
  }
586
585
  const a = {
587
586
  type: "create",
@@ -594,7 +593,7 @@ function Ct(p) {
594
593
  excelSheetName: s,
595
594
  errors: n
596
595
  };
597
- return c.importCreateResult.push(a), c;
596
+ return m.importCreateResult.push(a), m;
598
597
  },
599
598
  {
600
599
  invalidExcel: !1,
@@ -624,14 +623,14 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
624
623
  errors: {}
625
624
  },
626
625
  setup(p) {
627
- const l = p, { t: m } = J(), f = D(!1), d = () => {
626
+ const l = p, { t: c } = J(), f = D(!1), d = () => {
628
627
  l.errors.length && (f.value = !f.value);
629
628
  };
630
- return (r, c) => {
629
+ return (r, m) => {
631
630
  var n, o, u;
632
631
  const s = E("FmIcon");
633
632
  return $(), M("div", At, [
634
- c[0] || (c[0] = v("div", null, "•", -1)),
633
+ m[0] || (m[0] = v("div", null, "•", -1)),
635
634
  v("div", Mt, [
636
635
  v("div", {
637
636
  class: Y(["flex items-center gap-12 pl-8", {
@@ -647,7 +646,7 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
647
646
  })
648
647
  }, [
649
648
  X(A(r.name) + " ", 1),
650
- r.type === "create" ? ($(), M("span", Et, "(" + A(x(m)("inventory.closing.template.import.new")) + ")", 1)) : z("", !0)
649
+ r.type === "create" ? ($(), M("span", Et, "(" + A(x(c)("inventory.closing.template.import.new")) + ")", 1)) : z("", !0)
651
650
  ], 2),
652
651
  r.errors.length ? ($(), M("div", Pt, [
653
652
  I(s, {
@@ -665,7 +664,7 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
665
664
  "text-fm-color-typo-secondary": !r.errors.length
666
665
  }
667
666
  ])
668
- }, A((n = r.locations) != null && n.length ? x(m)("inventory.closing.template.import.nLocations", { count: (o = r.locations) == null ? void 0 : o.length }) : x(m)("inventory.closing.template.import.allLocations")) + ", " + A(x(m)("inventory.closing.template.import.nItems", { count: (u = r.items) == null ? void 0 : u.length })), 3)
667
+ }, A((n = r.locations) != null && n.length ? x(c)("inventory.closing.template.import.nLocations", { count: (o = r.locations) == null ? void 0 : o.length }) : x(c)("inventory.closing.template.import.allLocations")) + ", " + A(x(c)("inventory.closing.template.import.nItems", { count: (u = r.items) == null ? void 0 : u.length })), 3)
669
668
  ]),
670
669
  v("div", Vt, [
671
670
  r.errors.length ? ($(), O(s, {
@@ -707,38 +706,38 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
707
706
  }, Gt = { class: "fm-typo-en-body-lg-600" }, Jt = /* @__PURE__ */ G({
708
707
  __name: "AdjustmentTemplateImport",
709
708
  setup(p) {
710
- const l = D(null), m = ot(), f = ee(), d = D(!1), r = D(!1), c = D(new Array()), s = D([]), n = D([]), o = U(
711
- () => !!c.value.length || s.value.some((T) => T.errors.length) || n.value.some((T) => T.errors.length)
709
+ const l = D(null), c = ot(), f = ee(), d = D(!1), r = D(!1), m = D(new Array()), s = D([]), n = D([]), o = U(
710
+ () => !!m.value.length || s.value.some((T) => T.errors.length) || n.value.some((T) => T.errors.length)
712
711
  ), u = U(
713
712
  () => !!s.value.length || !!n.value.length
714
713
  ), { t: h } = J();
715
714
  async function y(T) {
716
- c.value = [], s.value = [], n.value = [];
715
+ m.value = [], s.value = [], n.value = [];
717
716
  try {
718
717
  d.value = !0;
719
718
  const [w] = await Promise.all([
720
- ct(T),
719
+ mt(T),
721
720
  // fake buffer
722
721
  new Promise((a) => setTimeout(a, 1e3))
723
722
  ]);
724
723
  if (!w.SheetNames.filter(
725
724
  (a) => !Object.values(ge).map(String).includes(a)
726
725
  ).find((a) => a)) {
727
- c.value.push(h("inventory.ingredient.import.fileError.noSheet"));
726
+ m.value.push(h("inventory.ingredient.import.fileError.noSheet"));
728
727
  return;
729
728
  }
730
729
  const t = Ct(w);
731
730
  if (t.invalidExcel) {
732
- c.value.push(
731
+ m.value.push(
733
732
  t.invalidExcelMessage ?? h("inventory.ingredient.import.fileError.invalidExcel")
734
733
  );
735
734
  return;
736
735
  }
737
736
  if (s.value = t.importCreateResult, n.value = t.importUpdateResult, !s.value.length && !n.value.length) {
738
- c.value.push(h("inventory.ingredient.import.fileError.noData"));
737
+ m.value.push(h("inventory.ingredient.import.fileError.noData"));
739
738
  return;
740
739
  }
741
- m.emitData(t);
740
+ c.emitData(t);
742
741
  } catch (w) {
743
742
  f.open({
744
743
  title: h("inventory.ingredient.import.fileError.unableToRead"),
@@ -746,7 +745,7 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
746
745
  type: "error"
747
746
  }), console.error("Error in reading file", w);
748
747
  } finally {
749
- c.value.length && f.open({
748
+ m.value.length && f.open({
750
749
  title: h("inventory.ingredient.import.fileError.invalidExcel"),
751
750
  type: "error"
752
751
  }), d.value = !1;
@@ -821,8 +820,8 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
821
820
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
822
821
  ]))
823
822
  ], 2),
824
- c.value.length ? ($(), M("div", Ht, [
825
- ($(!0), M(K, null, Q(c.value, (e, i) => ($(), M("div", {
823
+ m.value.length ? ($(), M("div", Ht, [
824
+ ($(!0), M(K, null, Q(m.value, (e, i) => ($(), M("div", {
826
825
  key: i,
827
826
  class: "flex gap-8 items-center"
828
827
  }, [
@@ -863,7 +862,7 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
863
862
  };
864
863
  }
865
864
  }), ye = ze("wastageTemplateAction", () => {
866
- const { t: p } = J(), l = Z(), m = ee(), f = ne(), d = vt(), r = se(), { loading: c } = Oe(r), s = D({});
865
+ const { t: p } = J(), l = Z(), c = ee(), f = ne(), d = vt(), r = se(), { loading: m } = Oe(r), s = D({});
867
866
  function n() {
868
867
  s.value = {
869
868
  mode: q.CREATE,
@@ -889,16 +888,16 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
889
888
  message: "Deleted template can no longer be retrieved",
890
889
  primaryActions: {
891
890
  text: "Delete",
892
- variant: me.Destructive,
891
+ variant: ce.Destructive,
893
892
  close: !0
894
893
  },
895
894
  secondaryActions: {
896
895
  text: "Cancel",
897
- variant: me.Plain,
896
+ variant: ce.Plain,
898
897
  close: !0
899
898
  }
900
899
  }).onPrimary(async () => {
901
- m.open({
900
+ c.open({
902
901
  title: `Deleting ${e.name}`,
903
902
  type: "info"
904
903
  });
@@ -909,12 +908,12 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
909
908
  new Promise((S) => setTimeout(S, 1e3))
910
909
  ]);
911
910
  if (C.status === "rejected") throw C.reason;
912
- m.open({
911
+ c.open({
913
912
  title: `Deleted ${e.name}`,
914
913
  type: "success"
915
914
  });
916
915
  } catch (C) {
917
- m.open({
916
+ c.open({
918
917
  title: `Unable to delete ${e.name}`,
919
918
  message: `See error from server: ${C}`,
920
919
  type: "error"
@@ -931,12 +930,12 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
931
930
  message: "Duplicated template can be edited after creation",
932
931
  primaryActions: {
933
932
  text: "Duplicate",
934
- variant: me.Destructive,
933
+ variant: ce.Destructive,
935
934
  close: !0
936
935
  },
937
936
  secondaryActions: {
938
937
  text: "Cancel",
939
- variant: me.Plain,
938
+ variant: ce.Plain,
940
939
  close: !0
941
940
  },
942
941
  contentComponent: G({
@@ -953,7 +952,7 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
953
952
  }
954
953
  })
955
954
  }).onPrimary(async () => {
956
- m.open({
955
+ c.open({
957
956
  title: `Duplicating "${e.name}"`,
958
957
  type: "info"
959
958
  });
@@ -964,12 +963,12 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
964
963
  new Promise((_) => setTimeout(_, 1e3))
965
964
  ]);
966
965
  if (S.status === "rejected") throw S.reason;
967
- m.open({
966
+ c.open({
968
967
  title: `Duplicated "${e.name}"`,
969
968
  type: "success"
970
969
  });
971
970
  } catch (S) {
972
- m.open({
971
+ c.open({
973
972
  title: `Unable to duplicate "${e.name}"`,
974
973
  message: `See error from server: ${S}`,
975
974
  type: "error"
@@ -994,14 +993,14 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
994
993
  }
995
994
  function w() {
996
995
  if (!r.templates.length) {
997
- m.open({
996
+ c.open({
998
997
  title: "No data to export",
999
998
  type: "error"
1000
999
  });
1001
1000
  return;
1002
1001
  }
1003
1002
  const e = wt(r.templates);
1004
- m.open({
1003
+ c.open({
1005
1004
  title: p("inventory.ingredient.export.success"),
1006
1005
  message: p("inventory.ingredient.export.filename", [e]),
1007
1006
  type: "success"
@@ -1028,14 +1027,14 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
1028
1027
  }
1029
1028
  }).onPrimary((e) => {
1030
1029
  if (!e) {
1031
- m.open({
1030
+ c.open({
1032
1031
  title: p("inventory.ingredient.import.error.noData"),
1033
1032
  type: "error"
1034
1033
  });
1035
1034
  return;
1036
1035
  }
1037
1036
  if (!e.importCreateResult.length && !e.importUpdateResult.length) {
1038
- m.open({
1037
+ c.open({
1039
1038
  title: p("inventory.ingredient.import.error.invalidContent"),
1040
1039
  message: p("inventory.ingredient.import.error.noImportData"),
1041
1040
  type: "error"
@@ -1043,7 +1042,7 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
1043
1042
  return;
1044
1043
  }
1045
1044
  if (e.importCreateResult.some((i) => i.errors.length) || e.importUpdateResult.some((i) => i.errors.length)) {
1046
- m.open({
1045
+ c.open({
1047
1046
  title: p("inventory.ingredient.import.error.invalidContent"),
1048
1047
  message: p("inventory.ingredient.import.error.hasErrors"),
1049
1048
  type: "error"
@@ -1054,7 +1053,7 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
1054
1053
  }).onTertiary(Tt);
1055
1054
  }
1056
1055
  async function b(e) {
1057
- c.value = !0;
1056
+ m.value = !0;
1058
1057
  try {
1059
1058
  const i = [
1060
1059
  ...e.importCreateResult.map(
@@ -1066,7 +1065,7 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
1066
1065
  ], g = 100;
1067
1066
  let C = 0;
1068
1067
  const S = () => {
1069
- C += g, m.open({
1068
+ C += g, c.open({
1070
1069
  title: p("inventory.ingredient.import.progress", [
1071
1070
  Math.min(C, i.length),
1072
1071
  i.length
@@ -1075,18 +1074,18 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
1075
1074
  };
1076
1075
  for (const _ of i.chunk(100))
1077
1076
  S(), await f.importTemplates(_);
1078
- m.open({
1077
+ c.open({
1079
1078
  title: p("inventory.ingredient.import.success"),
1080
1079
  type: "success"
1081
1080
  });
1082
1081
  } catch (i) {
1083
- m.open({
1082
+ c.open({
1084
1083
  title: p("inventory.ingredient.import.error.failed"),
1085
1084
  message: p("inventory.ingredient.import.error.systemMessage", [i == null ? void 0 : i.message]),
1086
1085
  type: "error"
1087
1086
  }), console.error("Error in importing skus", e, i);
1088
1087
  } finally {
1089
- c.value = !1, r.fetchTemplates();
1088
+ m.value = !1, r.fetchTemplates();
1090
1089
  }
1091
1090
  }
1092
1091
  const t = D({});
@@ -1113,22 +1112,22 @@ const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { cla
1113
1112
  };
1114
1113
  });
1115
1114
  function qt(p) {
1116
- const l = te(), m = U(() => {
1115
+ const l = te(), c = U(() => {
1117
1116
  const r = /* @__PURE__ */ new Map();
1118
- for (const c of l.skus)
1119
- r.set(c._id, c);
1117
+ for (const m of l.skus)
1118
+ r.set(m._id, m);
1120
1119
  return r;
1121
1120
  }), f = U(() => {
1122
1121
  const r = [];
1123
- for (const c of p.items)
1124
- c.type === "sku" && (m.value.get(c.id) || r.push(c));
1122
+ for (const m of p.items)
1123
+ m.type === "sku" && (c.value.get(m.id) || r.push(m));
1125
1124
  return r;
1126
1125
  });
1127
1126
  return {
1128
1127
  columnDefs: U(() => {
1129
1128
  const r = p.items.map((s) => {
1130
1129
  if (s.type !== "sku") return 0;
1131
- const n = m.value.get(s.id);
1130
+ const n = c.value.get(s.id);
1132
1131
  return n ? n.unit.measurements.length : 0;
1133
1132
  }).reduce((s, n) => Math.max(s, n), 0);
1134
1133
  return [
@@ -1228,7 +1227,7 @@ function qt(p) {
1228
1227
  var u, h, y;
1229
1228
  const n = s.row.original;
1230
1229
  if (n.type !== "sku") return P("span", "N/A");
1231
- const o = m.value.get(n.id);
1230
+ const o = c.value.get(n.id);
1232
1231
  return P("div", { class: "flex items-center gap-32" }, [
1233
1232
  P(
1234
1233
  H.FmFormGroup,
@@ -1275,10 +1274,10 @@ function qt(p) {
1275
1274
  { zIndex: 51 },
1276
1275
  {
1277
1276
  content() {
1278
- return m.value.get(n.id).unit.abbrev;
1277
+ return c.value.get(n.id).unit.abbrev;
1279
1278
  },
1280
1279
  default() {
1281
- const T = m.value.get(n.id);
1280
+ const T = c.value.get(n.id);
1282
1281
  return P(
1283
1282
  "div",
1284
1283
  { class: "line-clamp-2 fm-typo-en-body-lg-400" },
@@ -1292,7 +1291,7 @@ function qt(p) {
1292
1291
  ),
1293
1292
  ...Array.from({ length: Math.max(r, 0) }).map((T, w) => {
1294
1293
  var a, e, i, g;
1295
- const k = s.row.original, b = m.value.get(k.id), t = b.unit.measurements[w];
1294
+ const k = s.row.original, b = c.value.get(k.id), t = b.unit.measurements[w];
1296
1295
  return t ? P(
1297
1296
  H.FmFormGroup,
1298
1297
  {
@@ -1369,8 +1368,8 @@ const Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center"
1369
1368
  disabled: { type: Boolean }
1370
1369
  },
1371
1370
  emits: ["update:modelValue"],
1372
- setup(p, { expose: l, emit: m }) {
1373
- const f = p, d = D(f.modelValue), { t: r } = J(), c = m, s = te(), n = Z(), o = D(), u = D("");
1371
+ setup(p, { expose: l, emit: c }) {
1372
+ const f = p, d = D(f.modelValue), { t: r } = J(), m = c, s = te(), n = Z(), o = D(), u = D("");
1374
1373
  l({
1375
1374
  validateInputs: () => {
1376
1375
  var b, t;
@@ -1387,10 +1386,10 @@ const Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center"
1387
1386
  });
1388
1387
  const h = qt({
1389
1388
  updateItem: (b) => {
1390
- d.value = d.value.map((t) => t.id !== b.id ? t : b), c("update:modelValue", w.value);
1389
+ d.value = d.value.map((t) => t.id !== b.id ? t : b), m("update:modelValue", w.value);
1391
1390
  },
1392
1391
  deleteItem: (b) => {
1393
- d.value = d.value.filter((t) => t.id !== b.id), c("update:modelValue", w.value);
1392
+ d.value = d.value.filter((t) => t.id !== b.id), m("update:modelValue", w.value);
1394
1393
  },
1395
1394
  get items() {
1396
1395
  return d.value;
@@ -1405,7 +1404,7 @@ const Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center"
1405
1404
  pe(
1406
1405
  () => w.value,
1407
1406
  (b, t) => {
1408
- T.value.length > 0 && JSON.stringify(b) !== JSON.stringify(t) && c("update:modelValue", b);
1407
+ T.value.length > 0 && JSON.stringify(b) !== JSON.stringify(t) && m("update:modelValue", b);
1409
1408
  },
1410
1409
  { immediate: !0 }
1411
1410
  );
@@ -1494,7 +1493,7 @@ const Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center"
1494
1493
  disabledMeasurements: []
1495
1494
  };
1496
1495
  });
1497
- R.sort((L, j) => L.name.localeCompare(j.name)), console.log(d.value), d.value = R, c("update:modelValue", w.value);
1496
+ R.sort((L, j) => L.name.localeCompare(j.name)), console.log(d.value), d.value = R, m("update:modelValue", w.value);
1498
1497
  });
1499
1498
  }
1500
1499
  return (b, t) => {
@@ -1561,23 +1560,23 @@ const Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center"
1561
1560
  ]);
1562
1561
  };
1563
1562
  }
1564
- }), an = { class: "flex flex-col gap-16" }, ln = { class: "flex flex-col gap-24" }, rn = { class: "flex flex-col gap-16" }, un = { class: "flex items-center" }, mn = { class: "flex-1 fm-typo-en-title-sm-600" }, cn = /* @__PURE__ */ G({
1563
+ }), an = { class: "flex flex-col gap-16" }, ln = { class: "flex flex-col gap-24" }, rn = { class: "flex flex-col gap-16" }, un = { class: "flex items-center" }, cn = { class: "flex-1 fm-typo-en-title-sm-600" }, mn = /* @__PURE__ */ G({
1565
1564
  __name: "WastageTemplateForm",
1566
1565
  props: {
1567
1566
  modelValue: {},
1568
1567
  disabled: { type: Boolean }
1569
1568
  },
1570
1569
  setup(p, { expose: l }) {
1571
- const m = ht(), { t: f } = J(), {
1570
+ const c = ht(), { t: f } = J(), {
1572
1571
  promptSelectLocations: d,
1573
1572
  columnDefs: r,
1574
- rowData: c
1573
+ rowData: m
1575
1574
  } = gt({
1576
1575
  getLocations() {
1577
- return m.locations;
1576
+ return c.locations;
1578
1577
  },
1579
1578
  setLocations(n) {
1580
- m.locations = n;
1579
+ c.locations = n;
1581
1580
  }
1582
1581
  }), s = D();
1583
1582
  return l({
@@ -1607,15 +1606,15 @@ const Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center"
1607
1606
  I(u, {
1608
1607
  label: x(f)("inventory.closing.form.name"),
1609
1608
  "label-mark": "required",
1610
- modelValue: x(m).name,
1611
- "onUpdate:modelValue": o[0] || (o[0] = (w) => x(m).name = w),
1609
+ modelValue: x(c).name,
1610
+ "onUpdate:modelValue": o[0] || (o[0] = (w) => x(c).name = w),
1612
1611
  rules: [x(Ge)()]
1613
1612
  }, null, 8, ["label", "modelValue", "rules"])
1614
1613
  ])
1615
1614
  ]),
1616
1615
  v("div", rn, [
1617
1616
  v("div", un, [
1618
- v("div", mn, A(x(f)("inventory.closing.form.locations")), 1),
1617
+ v("div", cn, A(x(f)("inventory.closing.form.locations")), 1),
1619
1618
  I(h, {
1620
1619
  disabled: n.disabled,
1621
1620
  label: x(f)("inventory.closing.form.selectLocation"),
@@ -1627,15 +1626,15 @@ const Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center"
1627
1626
  ]),
1628
1627
  I(y, {
1629
1628
  "column-defs": x(r),
1630
- "row-data": x(c),
1629
+ "row-data": x(m),
1631
1630
  "shrink-at": 9999,
1632
1631
  onRowClick: x(d),
1633
1632
  "hide-footer": ""
1634
1633
  }, null, 8, ["column-defs", "row-data", "onRowClick"])
1635
1634
  ]),
1636
1635
  I(on, {
1637
- "model-value": x(m).items,
1638
- "onUpdate:modelValue": o[1] || (o[1] = (w) => x(m).items = w)
1636
+ "model-value": x(c).items,
1637
+ "onUpdate:modelValue": o[1] || (o[1] = (w) => x(c).items = w)
1639
1638
  }, null, 8, ["model-value"])
1640
1639
  ]),
1641
1640
  _: 1
@@ -1650,9 +1649,9 @@ const Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center"
1650
1649
  show: { type: Boolean }
1651
1650
  },
1652
1651
  emits: ["update:show", "submitted"],
1653
- setup(p, { expose: l, emit: m }) {
1652
+ setup(p, { expose: l, emit: c }) {
1654
1653
  var e;
1655
- const f = p, d = m, r = ne(), c = ee(), { t: s } = J(), n = Be(f, "show");
1654
+ const f = p, d = c, r = ne(), m = ee(), { t: s } = J(), n = Be(f, "show");
1656
1655
  function o() {
1657
1656
  return {
1658
1657
  _id: "",
@@ -1699,13 +1698,13 @@ const Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center"
1699
1698
  if (i) {
1700
1699
  y.value = !0;
1701
1700
  try {
1702
- await r.createTemplate(i), await new Promise((g) => setTimeout(g, 1e3)), c.open({
1701
+ await r.createTemplate(i), await new Promise((g) => setTimeout(g, 1e3)), m.open({
1703
1702
  title: s("inventory.adjustment.template.create.success"),
1704
1703
  message: s("inventory.adjustment.template.create.successMessage"),
1705
1704
  type: "success"
1706
1705
  }), d("update:show", !1), d("submitted");
1707
1706
  } catch (g) {
1708
- c.open({
1707
+ m.open({
1709
1708
  title: s("inventory.adjustment.template.create.error"),
1710
1709
  message: s("inventory.adjustment.template.create.errorMessage"),
1711
1710
  type: "error"
@@ -1723,13 +1722,13 @@ const Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center"
1723
1722
  await r.updateTemplate({
1724
1723
  ...i,
1725
1724
  _rev: i._rev ?? ""
1726
- }), await new Promise((g) => setTimeout(g, 1e3)), c.open({
1725
+ }), await new Promise((g) => setTimeout(g, 1e3)), m.open({
1727
1726
  title: s("inventory.adjustment.template.update.success"),
1728
1727
  message: s("inventory.adjustment.template.update.successMessage"),
1729
1728
  type: "success"
1730
1729
  }), d("update:show", !1), d("submitted");
1731
1730
  } catch (g) {
1732
- c.open({
1731
+ m.open({
1733
1732
  title: s("inventory.adjustment.template.update.error"),
1734
1733
  message: s("inventory.adjustment.template.update.errorMessage"),
1735
1734
  type: "error"
@@ -1800,7 +1799,7 @@ const Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center"
1800
1799
  _: 1
1801
1800
  })) : z("", !0)
1802
1801
  ], 64)) : z("", !0),
1803
- ($(), O(cn, {
1802
+ ($(), O(mn, {
1804
1803
  class: "w-full",
1805
1804
  ref_key: "formRef",
1806
1805
  ref: w,
@@ -1847,9 +1846,9 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
1847
1846
  __name: "WastageTemplatePublish",
1848
1847
  emits: ["close"],
1849
1848
  setup(p, { emit: l }) {
1850
- const m = D(!1), f = ee(), d = ne(), r = se(), { t: c } = J(), s = l;
1849
+ const c = D(!1), f = ee(), d = ne(), r = se(), { t: m } = J(), s = l;
1851
1850
  async function n() {
1852
- m.value = !0;
1851
+ c.value = !0;
1853
1852
  try {
1854
1853
  await d.startNewPublish().delayed(1e3), f.open({
1855
1854
  title: "Success",
@@ -1863,7 +1862,7 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
1863
1862
  type: "error"
1864
1863
  }), console.error("error on creating publish task", y);
1865
1864
  } finally {
1866
- m.value = !1;
1865
+ c.value = !1;
1867
1866
  }
1868
1867
  }
1869
1868
  const o = U(() => r.recentPublish.recentJob), u = U(
@@ -1875,7 +1874,7 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
1875
1874
  return (y, T) => {
1876
1875
  const w = E("FmCircularProgress"), k = E("i18n-t"), b = E("FmButton");
1877
1876
  return $(), M("div", Sn, [
1878
- x(r).templates.length ? m.value ? ($(), M("div", Fn, [
1877
+ x(r).templates.length ? c.value ? ($(), M("div", Fn, [
1879
1878
  v("div", null, [
1880
1879
  I(w, {
1881
1880
  size: "md",
@@ -1883,7 +1882,7 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
1883
1882
  })
1884
1883
  ]),
1885
1884
  v("div", Cn, [
1886
- v("span", null, A(x(c)("inventory.adjustment.template.publish.publishing")), 1)
1885
+ v("span", null, A(x(m)("inventory.adjustment.template.publish.publishing")), 1)
1887
1886
  ])
1888
1887
  ])) : o.value ? o.value.outlets.length === o.value.completed.length ? ($(), M("div", Mn, [
1889
1888
  I(k, {
@@ -1898,7 +1897,7 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
1898
1897
  ]),
1899
1898
  _: 1
1900
1899
  }),
1901
- v("p", null, A(x(c)("inventory.adjustment.template.publish.message")), 1)
1900
+ v("p", null, A(x(m)("inventory.adjustment.template.publish.message")), 1)
1902
1901
  ])) : ($(), M("div", En, [
1903
1902
  I(k, {
1904
1903
  keypath: "inventory.adjustment.template.publish.stillPublishing",
@@ -1914,15 +1913,15 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
1914
1913
  }),
1915
1914
  X(" Your recent publishing task is still pending (" + A(o.value.completed.length) + " / " + A(o.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
1916
1915
  ])) : ($(), M("div", An, [
1917
- v("p", null, A(x(c)("inventory.adjustment.template.publish.noRecentActivity")), 1),
1918
- v("p", null, A(x(c)("inventory.adjustment.template.publish.message")), 1)
1916
+ v("p", null, A(x(m)("inventory.adjustment.template.publish.noRecentActivity")), 1),
1917
+ v("p", null, A(x(m)("inventory.adjustment.template.publish.message")), 1)
1919
1918
  ])) : ($(), M("div", In, [
1920
- v("p", null, A(x(c)("inventory.adjustment.template.publish.nothingToPublish")), 1)
1919
+ v("p", null, A(x(m)("inventory.adjustment.template.publish.nothingToPublish")), 1)
1921
1920
  ])),
1922
1921
  v("div", jn, [
1923
1922
  I(b, {
1924
1923
  disabled: !u.value,
1925
- loading: m.value,
1924
+ loading: c.value,
1926
1925
  label: "Publish to all outlets",
1927
1926
  onClick: n
1928
1927
  }, null, 8, ["disabled", "loading"]),
@@ -1942,9 +1941,9 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
1942
1941
  },
1943
1942
  emits: ["update:show", "submitted"],
1944
1943
  setup(p, { emit: l }) {
1945
- const m = p, f = Be(m, "show"), d = D(""), r = ee(), c = Z(), s = D([]), n = l, o = se(), u = ne(), h = D(!1);
1944
+ const c = p, f = Be(c, "show"), d = D(""), r = ee(), m = Z(), s = D([]), n = l, o = se(), u = ne(), h = D(!1);
1946
1945
  pe(
1947
- () => m.show,
1946
+ () => c.show,
1948
1947
  (t) => {
1949
1948
  var a;
1950
1949
  t && (s.value = ((a = o.reasons) == null ? void 0 : a.value) ?? []);
@@ -1958,7 +1957,7 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
1958
1957
  s.value.splice(t, 1);
1959
1958
  return;
1960
1959
  }
1961
- c.open({
1960
+ m.open({
1962
1961
  title: "Delete reason",
1963
1962
  message: `Are you sure you want to delete this reason? "${a}"`,
1964
1963
  primaryActions: {
@@ -2109,10 +2108,10 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
2109
2108
  }, 8, ["modelValue", "dismiss-away"]);
2110
2109
  };
2111
2110
  }
2112
- }), Yn = { class: "flex items-center gap-5" }, Gn = { class: "flex items-center gap-2" }, Jn = { class: "flex-1 flex flex-col gap-8" }, qn = { class: "flex flex-col" }, Qn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Zn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, $s = /* @__PURE__ */ G({
2111
+ }), Yn = { class: "flex items-center gap-5" }, Gn = { class: "flex items-center gap-2" }, Jn = { class: "flex-1 flex flex-col gap-8" }, qn = { class: "flex flex-col" }, Qn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Zn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, ks = /* @__PURE__ */ G({
2113
2112
  __name: "WastageTemplateView",
2114
2113
  setup(p) {
2115
- const { t: l } = J(), { createTemplate: m, updateTemplate: f, exportTemplates: d, importTemplates: r, viewReason: c } = ye(), { templateDialogProps: s, templateDetailsProps: n, templateReasonProps: o } = Oe(
2114
+ const { t: l } = J(), { createTemplate: c, updateTemplate: f, exportTemplates: d, importTemplates: r, viewReason: m } = ye(), { templateDialogProps: s, templateDetailsProps: n, templateReasonProps: o } = Oe(
2116
2115
  ye()
2117
2116
  ), u = he(), h = Z(), y = se(), T = tt(), { breakpoints: w } = at();
2118
2117
  u.watchLocation(y.fetchTemplates);
@@ -2120,7 +2119,7 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
2120
2119
  function e(_) {
2121
2120
  switch (_) {
2122
2121
  case B.Add:
2123
- return m();
2122
+ return c();
2124
2123
  case "publish":
2125
2124
  return i();
2126
2125
  case "import":
@@ -2200,7 +2199,7 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
2200
2199
  isPrimary: !1
2201
2200
  }
2202
2201
  ]), S = () => {
2203
- c();
2202
+ m();
2204
2203
  };
2205
2204
  return (_, F) => {
2206
2205
  const R = E("FmButton"), L = E("FmTable");
@@ -2260,7 +2259,7 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
2260
2259
  "page-size": a.value
2261
2260
  }, {
2262
2261
  "list-row": V((j) => [
2263
- I(lt, {
2262
+ I(rt, {
2264
2263
  row: j,
2265
2264
  onRowClick: (W) => x(f)(W)
2266
2265
  }, {
@@ -2270,13 +2269,13 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
2270
2269
  v("div", Jn, [
2271
2270
  v("div", qn, [
2272
2271
  v("div", Qn, [
2273
- I(x(ce), {
2272
+ I(x(me), {
2274
2273
  render: (_e = (be = (oe = W._id) == null ? void 0 : oe.column) == null ? void 0 : be.columnDef) == null ? void 0 : _e.cell,
2275
2274
  props: (xe = (ae = W._id) == null ? void 0 : ae.getContext) == null ? void 0 : xe.call(ae)
2276
2275
  }, null, 8, ["render", "props"])
2277
2276
  ]),
2278
2277
  v("div", Xn, [
2279
- I(x(ce), {
2278
+ I(x(me), {
2280
2279
  render: (ke = (Te = (we = W.name) == null ? void 0 : we.column) == null ? void 0 : Te.columnDef) == null ? void 0 : ke.cell,
2281
2280
  props: ($e = (le = W.name) == null ? void 0 : le.getContext) == null ? void 0 : $e.call(le)
2282
2281
  }, null, 8, ["render", "props"])
@@ -2286,14 +2285,14 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
2286
2285
  }) : x(l)("inventory.adjustment.template.table.enabledForAll")), 1),
2287
2286
  F[5] || (F[5] = v("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, null, -1)),
2288
2287
  v("div", Zn, [
2289
- I(x(ce), {
2288
+ I(x(me), {
2290
2289
  render: (Ae = (Ce = (Fe = W.ref) == null ? void 0 : Fe.column) == null ? void 0 : Ce.columnDef) == null ? void 0 : Ae.cell,
2291
2290
  props: (Me = (re = W.ref) == null ? void 0 : re.getContext) == null ? void 0 : Me.call(re)
2292
2291
  }, null, 8, ["render", "props"])
2293
2292
  ])
2294
2293
  ]),
2295
2294
  v("div", null, [
2296
- I(x(ce), {
2295
+ I(x(me), {
2297
2296
  render: (Ee = (De = (Re = W.status) == null ? void 0 : Re.column) == null ? void 0 : De.columnDef) == null ? void 0 : Ee.cell,
2298
2297
  props: (Pe = (ie = W.status) == null ? void 0 : ie.getContext) == null ? void 0 : Pe.call(ie)
2299
2298
  }, null, 8, ["render", "props"])
@@ -2324,5 +2323,5 @@ const $n = /* @__PURE__ */ xt(Tn, [["render", kn]]), Sn = { class: "flex flex-co
2324
2323
  }
2325
2324
  });
2326
2325
  export {
2327
- $s as default
2326
+ ks as default
2328
2327
  };