@feedmepos/mf-inventory-portal 1.2.49 → 1.2.50-dev.1

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