@feedmepos/mf-inventory-portal 1.2.11-dev.1 → 1.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/{App-DciovpKw.js → App-BCVrJ7-x.js} +1 -1
  2. package/dist/{ApprovalView-CGwfibXC.js → ApprovalView-BMEzgj9q.js} +2 -2
  3. package/dist/{BindingsDialog-D2lhTbF3.js → BindingsDialog-Do_UsSE4.js} +2 -2
  4. package/dist/{BindingsPicker-beFOEPht.js → BindingsPicker-CFUwkcKX.js} +1 -1
  5. package/dist/{BindingsTable-Ca4ljEVm.js → BindingsTable-a7rhi6MZ.js} +1 -1
  6. package/dist/{ClosingDraftView-BfLGyy2d.js → ClosingDraftView-Dv4lj9E7.js} +2 -2
  7. package/dist/{ClosingTemplateView-NVTYbxau.js → ClosingTemplateView-BRX45M7h.js} +3 -3
  8. package/dist/{DeliveryOrderPrintPreview-DqxSTa3Z.js → DeliveryOrderPrintPreview-CwMX74nM.js} +1 -1
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DuNiQN_o.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CL3yU8XA.js} +3 -3
  10. package/dist/{FmMultiselectDialog-nLl9PoEG.js → FmMultiselectDialog-BiLym6fH.js} +1 -1
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-6ymFYBwa.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BAGo4_1C.js} +1 -1
  12. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BRxz67ib.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BIImtfdR.js} +1 -1
  13. package/dist/{IngredientGroupView-AHHQPTJp.js → IngredientGroupView-CLVfJFTD.js} +2 -2
  14. package/dist/{IngredientsView-aO1bZZb-.js → IngredientsView-DETE0BaL.js} +384 -376
  15. package/dist/{IntegrationView-70JwBIOG.js → IntegrationView-Crm8R-cF.js} +3 -3
  16. package/dist/{InventoryBindingForm-CUYFM11E.js → InventoryBindingForm-DQeaxeQX.js} +1 -1
  17. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BOHhj4mY.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-yQZC9peR.js} +3 -3
  18. package/dist/{InventoryBindingSummary-UOalkgH7.js → InventoryBindingSummary-DUiYadJR.js} +1 -1
  19. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B70AhCwF.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DOpF4cSz.js} +1 -1
  20. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Chd994iw.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DFjhh2P6.js} +1 -1
  21. package/dist/{PublishView-D6efGIIF.js → PublishView-D3FS3ioY.js} +1 -1
  22. package/dist/{PurchaseOrderPrintPreview-CZCPLVUY.js → PurchaseOrderPrintPreview-ByURcesK.js} +1 -1
  23. package/dist/{ReceiveRequestView-dfNjKyUV.js → ReceiveRequestView-mt0ja21g.js} +8 -8
  24. package/dist/{RecipeView-B0XIq0FA.js → RecipeView-B04R5lQ1.js} +3 -3
  25. package/dist/{StockView-BYzpzOxT.js → StockView-C9erE0Vu.js} +7 -7
  26. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-6FTILwRr.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BC1mwDJX.js} +1 -1
  27. package/dist/{SupplierView-14vzBcxM.js → SupplierView-C_NMItXg.js} +4 -4
  28. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-fqfk6WJf.js → TransferDetails.vue_vue_type_script_setup_true_lang-Cts9z9LO.js} +5 -5
  29. package/dist/{TransferTemplateView-DRQURGGs.js → TransferTemplateView-DOVDiF7-.js} +7 -7
  30. package/dist/{UnitView--J7My-s_.js → UnitView-BVOtZ1eJ.js} +3 -3
  31. package/dist/{WarehouseView-CzSxA-MK.js → WarehouseView-lz2uVygR.js} +1 -1
  32. package/dist/{app-C2lkNMui.js → app-D0bYbsGd.js} +14 -14
  33. package/dist/app.js +1 -1
  34. package/dist/{closing-template-A7lhXMsa.js → closing-template-CrxsMQM1.js} +1 -1
  35. package/dist/{decimal-DU65ULsY.js → decimal-OP8pLXox.js} +1 -1
  36. package/dist/{format-unit-display-BrZWuimJ.js → format-unit-display-AxULhwcM.js} +3 -3
  37. package/dist/{index-Dt_SzFOY.js → index-BZumsz4L.js} +1 -1
  38. package/dist/{index-CFNTAKrx.js → index-DwPtx2QV.js} +1 -1
  39. package/dist/{purchase-order-template-DcVaMhPN.js → purchase-order-template-BO_iyudu.js} +1 -1
  40. package/dist/{stock-DzbSW4Kk.js → stock-DZbjPfvD.js} +1 -1
  41. package/dist/{supplier-B7sWYjCc.js → supplier-CcKZR4JV.js} +1 -1
  42. package/dist/{use-ingredient-select-dialog-DEGFtqy0.js → use-ingredient-select-dialog-DgZXbr91.js} +1 -1
  43. package/dist/{use-inventory-binding-dialog-1Q0kr_sK.js → use-inventory-binding-dialog-xJk-GAkH.js} +1 -1
  44. package/dist/views/ingredients/helper/import-export.helper.d.ts +1 -0
  45. package/package.json +3 -3
@@ -1,75 +1,75 @@
1
- import { ref as N, defineComponent as pe, computed as w, resolveComponent as M, openBlock as v, createElementBlock as F, Fragment as X, unref as a, createVNode as m, withModifiers as Ht, createCommentVNode as j, withCtx as T, createElementVNode as s, toDisplayString as U, normalizeClass as te, renderList as ue, createBlock as z, h as Z, renderSlot as Ce, createTextVNode as Je, mergeModels as ct, onMounted as Wt, watch as Tt, useModel as Yt, isRef as mt, createSlots as Vt, normalizeStyle as qt, Teleport as pt, normalizeProps as Gt, guardReactiveProps as Kt } from "vue";
2
- import { a as ve, e as W, f as St, S as Jt, b as Ee, h as Ge, i as Qt, D as vt, j as Re, A as Be, k as It, l as Ct, m as Oe, t as Ft, n as Zt, o as $e, p as Le, U as Xt, q as en, M as tn, r as ft, s as yt, c as Qe, v as je, _ as nn, w as gt, x as on, y as bt, z as $t, B as ln, C as Et, E as sn, G as an, I as rn, H as dn, J as un, N as cn, K as mn, u as pn, L as vn, O as fn, P as yn, Q as gn, T as ht, V as bn } from "./app-C2lkNMui.js";
3
- import { useDialog as De, useSnackbar as Ae, components as He, useProxiedModel as _t, useDialogChild as hn, useBreakpoints as _n } from "@feedmepos/ui-library";
1
+ import { ref as N, defineComponent as ve, computed as w, resolveComponent as A, openBlock as v, createElementBlock as F, Fragment as ee, unref as a, createVNode as m, withModifiers as Ht, createCommentVNode as j, withCtx as T, createElementVNode as s, toDisplayString as U, normalizeClass as ne, renderList as ce, createBlock as z, h as X, renderSlot as Ce, createTextVNode as Je, mergeModels as ct, onMounted as Wt, watch as Tt, useModel as Yt, isRef as mt, createSlots as Vt, normalizeStyle as qt, Teleport as pt, normalizeProps as Gt, guardReactiveProps as Kt } from "vue";
2
+ import { a as fe, e as W, f as St, S as Jt, b as Ee, h as Ge, i as Qt, D as vt, j as Re, A as Be, k as It, l as Ct, m as Oe, t as Ft, n as Zt, o as $e, p as Le, U as Xt, q as en, M as tn, r as ft, s as yt, c as Qe, v as je, _ as nn, w as gt, x as on, y as bt, z as $t, B as ln, C as Et, E as sn, G as an, I as rn, H as dn, J as un, N as cn, K as mn, u as pn, L as vn, O as fn, P as yn, Q as gn, T as ht, V as bn } from "./app-D0bYbsGd.js";
3
+ import { useDialog as De, useSnackbar as Me, components as He, useProxiedModel as _t, useDialogChild as hn, useBreakpoints as _n } from "@feedmepos/ui-library";
4
4
  import { i as xn, _ as kn } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
- import { useI18n as fe, useCoreStore as we } from "@feedmepos/mf-common";
5
+ import { useI18n as ye, useCoreStore as we } from "@feedmepos/mf-common";
6
6
  import { defineStore as wn, storeToRefs as Tn } from "pinia";
7
- import { g as Vn, _ as We, S as Ye, a as Sn } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-6FTILwRr.js";
8
- import { _ as In } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-BOHhj4mY.js";
9
- import { _ as qe } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-BRxz67ib.js";
7
+ import { g as Vn, _ as We, S as Ye, a as Sn } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BC1mwDJX.js";
8
+ import { _ as In } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-yQZC9peR.js";
9
+ import { _ as qe } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-BIImtfdR.js";
10
10
  import { _ as _e } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
11
11
  import { _ as Cn } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
12
- import { u as At } from "./purchase-order-template-DcVaMhPN.js";
13
- import { u as Mt } from "./closing-template-A7lhXMsa.js";
12
+ import { u as Mt } from "./purchase-order-template-BO_iyudu.js";
13
+ import { u as At } from "./closing-template-CrxsMQM1.js";
14
14
  import { r as Fn } from "./random-CSbEbElR.js";
15
15
  import "./array-Ca8T3f_G.js";
16
- import { u as $n } from "./FmMultiselectDialog-nLl9PoEG.js";
16
+ import { u as $n } from "./FmMultiselectDialog-BiLym6fH.js";
17
17
  const Ke = wn("ingredientForm", function() {
18
- const o = De(), b = Ae(), l = ve(), c = N(!1), { t: h } = fe(), k = N();
18
+ const o = De(), b = Me(), l = fe(), c = N(!1), { t: h } = ye(), k = N();
19
19
  function f() {
20
- const d = {
20
+ const u = {
21
21
  sku: {},
22
22
  mode: W.CREATE,
23
23
  show: !0,
24
- "onUpdate:show"(i) {
25
- k.value.show = i;
24
+ "onUpdate:show"(d) {
25
+ k.value.show = d;
26
26
  }
27
27
  };
28
- k.value = d;
28
+ k.value = u;
29
29
  }
30
- async function n(d) {
31
- const i = {
32
- sku: St(d),
30
+ async function n(u) {
31
+ const d = {
32
+ sku: St(u),
33
33
  mode: W.UPDATE,
34
34
  show: !0,
35
35
  "onUpdate:show"(p) {
36
36
  k.value.show = p;
37
37
  }
38
38
  };
39
- k.value = i;
39
+ k.value = d;
40
40
  }
41
- async function r(d) {
41
+ async function r(u) {
42
42
  c.value = !0;
43
43
  try {
44
- await l.deleteSku(d), b.open({
44
+ await l.deleteSku(u), b.open({
45
45
  title: "Success",
46
- message: `Deleted ${d.name}`,
46
+ message: `Deleted ${u.name}`,
47
47
  type: "success"
48
48
  });
49
- } catch (i) {
50
- i instanceof Jt && xn(i) ? o.open({
49
+ } catch (d) {
50
+ d instanceof Jt && xn(d) ? o.open({
51
51
  title: "Cannot delete ingredient",
52
52
  contentComponent: kn,
53
53
  contentComponentProps: {
54
- subject: (d == null ? void 0 : d.name) ?? "",
55
- items: i.errorResponse.message
54
+ subject: (u == null ? void 0 : u.name) ?? "",
55
+ items: d.errorResponse.message
56
56
  },
57
57
  secondaryActions: {
58
58
  text: "Close",
59
59
  close: !0
60
60
  }
61
- }) : console.log("unable to delete ingredient", i), b.open({
62
- title: `Cannot delete ${d.name}`,
61
+ }) : console.log("unable to delete ingredient", d), b.open({
62
+ title: `Cannot delete ${u.name}`,
63
63
  message: "Please try again.",
64
64
  type: "error"
65
- }), console.error("failed to delete ingredient", i);
65
+ }), console.error("failed to delete ingredient", d);
66
66
  } finally {
67
67
  c.value = !1;
68
68
  }
69
69
  }
70
- function y(d) {
70
+ function y(u) {
71
71
  o.open({
72
- title: h("inventory.ingredient.delete.title", [(d == null ? void 0 : d.name) ?? ""]),
72
+ title: h("inventory.ingredient.delete.title", [(u == null ? void 0 : u.name) ?? ""]),
73
73
  closeButton: !1,
74
74
  message: h("inventory.ingredient.delete.message"),
75
75
  primaryActions: {
@@ -81,7 +81,7 @@ const Ke = wn("ingredientForm", function() {
81
81
  text: h("common.cancel"),
82
82
  close: !0
83
83
  }
84
- }).onPrimary(() => r(d));
84
+ }).onPrimary(() => r(u));
85
85
  }
86
86
  return {
87
87
  createIngredient: f,
@@ -93,21 +93,21 @@ const Ke = wn("ingredientForm", function() {
93
93
  }), En = {
94
94
  key: 0,
95
95
  class: "flex items-center gap-8"
96
- }, An = { class: "flex flex-col gap-1" }, Mn = { class: "fm-typo-en-heading-lg-600" }, Un = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Rn = {
96
+ }, Mn = { class: "flex flex-col gap-1" }, An = { class: "fm-typo-en-heading-lg-600" }, Un = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Rn = {
97
97
  key: 0,
98
98
  class: "fm-typo-en-body-md-400 text-fm-color-system-warning-300"
99
99
  }, Bn = {
100
100
  key: 1,
101
101
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
102
- }, On = { class: "flex flex-col gap-2 mt-4" }, Dn = { class: "flex items-center gap-2 fm-typo-en-body-md-400" }, Nn = { class: "flex flex-wrap gap-2" }, zn = { class: "flex flex-col" }, Ln = { class: "flex flex-col bg-fm-color-bg-secondary font-mono p-4 rounded-md" }, jn = { class: "text-fm-color-typo-tertiary flex-shrink-0 fm-typo-en-body-md-400 whitespace-pre flex items-center" }, Hn = { class: "px-2 py-1 rounded-md bg-blue-200 border-2 border-blue-400" }, Wn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, Yn = /* @__PURE__ */ pe({
102
+ }, On = { class: "flex flex-col gap-2 mt-4" }, Dn = { class: "flex items-center gap-2 fm-typo-en-body-md-400" }, Nn = { class: "flex flex-wrap gap-2" }, zn = { class: "flex flex-col" }, Ln = { class: "flex flex-col bg-fm-color-bg-secondary font-mono p-4 rounded-md" }, jn = { class: "text-fm-color-typo-tertiary flex-shrink-0 fm-typo-en-body-md-400 whitespace-pre flex items-center" }, Hn = { class: "px-2 py-1 rounded-md bg-blue-200 border-2 border-blue-400" }, Wn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, Yn = /* @__PURE__ */ ve({
103
103
  __name: "ItemSubsidiaryTreeDialog",
104
104
  props: {
105
105
  skuId: {},
106
106
  itemName: {},
107
107
  itemCode: {}
108
108
  },
109
- setup(u) {
110
- const o = u, { t: b } = fe(), l = we(), c = Ee(), h = N(!1), k = w(() => {
109
+ setup(i) {
110
+ const o = i, { t: b } = ye(), l = we(), c = Ee(), h = N(!1), k = w(() => {
111
111
  var p;
112
112
  return ((p = l.sessionUser.value) == null ? void 0 : p.role.isAdmin) ?? !1;
113
113
  }), f = w(() => c.getSkuSubsidiaries(o.skuId)), n = w(() => {
@@ -126,23 +126,23 @@ const Ke = wn("ingredientForm", function() {
126
126
  function r(p, _ = [], I = !1) {
127
127
  const $ = [];
128
128
  return p.forEach((g, D) => {
129
- const C = D === p.length - 1, ye = [..._, C];
130
- let ne = "";
131
- for (let ee = 0; ee < _.length; ee++)
132
- ne += _[ee] ? " " : "│ ";
133
- ne += C ? "└── " : "├── ";
134
- const ce = n.value.has(g.id), oe = g.isAssigned === !0, le = I && !oe;
129
+ const C = D === p.length - 1, le = [..._, C];
130
+ let Q = "";
131
+ for (let te = 0; te < _.length; te++)
132
+ Q += _[te] ? " " : "│ ";
133
+ Q += C ? "└── " : "├── ";
134
+ const me = n.value.has(g.id), oe = g.isAssigned === !0, se = I && !oe;
135
135
  if ($.push({
136
136
  id: g.id,
137
137
  name: g.name,
138
- prefix: _.length === 0 ? "" : ne,
139
- isHighlighted: ce,
138
+ prefix: _.length === 0 ? "" : Q,
139
+ isHighlighted: me,
140
140
  isDirectlyBound: oe,
141
- isParentIncludedChild: le,
141
+ isParentIncludedChild: se,
142
142
  isRoot: _.length === 0
143
143
  }), g.children && g.children.length > 0) {
144
- const ee = I || oe && f.value.includeChildren;
145
- $.push(...r(g.children, ye, ee));
144
+ const te = I || oe && f.value.includeChildren;
145
+ $.push(...r(g.children, le, te));
146
146
  }
147
147
  }), $;
148
148
  }
@@ -154,24 +154,24 @@ const Ke = wn("ingredientForm", function() {
154
154
  }
155
155
  return I;
156
156
  }
157
- function d(p, _) {
157
+ function u(p, _) {
158
158
  return p.map((I) => _.has(I.id) || I.isAssigned === !0 ? {
159
159
  ...I,
160
160
  // Recursively filter children
161
- children: I.children ? d(I.children, _) : []
161
+ children: I.children ? u(I.children, _) : []
162
162
  } : null).filter(Boolean);
163
163
  }
164
- const i = w(() => {
164
+ const d = w(() => {
165
165
  let p = f.value.subsidiaryTree;
166
166
  if ((!p || p.length === 0) && (p = c.getBusinessSubsidiaryTree()), !k.value) {
167
167
  const _ = y(p);
168
- p = d(p, _);
168
+ p = u(p, _);
169
169
  }
170
170
  return r(p, []);
171
171
  });
172
172
  return (p, _) => {
173
- const I = M("FmButton"), $ = M("FmDialog");
174
- return v(), F(X, null, [
173
+ const I = A("FmButton"), $ = A("FmDialog");
174
+ return v(), F(ee, null, [
175
175
  a(c).isEnabled ? (v(), F("div", En, [
176
176
  m(I, {
177
177
  "prepend-icon": "info",
@@ -186,8 +186,8 @@ const Ke = wn("ingredientForm", function() {
186
186
  dismissAway: ""
187
187
  }, {
188
188
  "dialog-header": T(() => [
189
- s("div", An, [
190
- s("div", Mn, U(a(b)("inventory.integration.netsuite.subsidiaryHierarchy.title")), 1),
189
+ s("div", Mn, [
190
+ s("div", An, U(a(b)("inventory.integration.netsuite.subsidiaryHierarchy.title")), 1),
191
191
  s("p", Un, " Name: " + U(o.itemName), 1),
192
192
  s("p", Pn, " Code: " + U(o.itemCode), 1),
193
193
  k.value ? (v(), F("p", Rn, " All subsidiaries are shown since you are an admin. ")) : (v(), F("p", Bn, " Only showing subsidiaries in your business path and bound subsidiaries. ")),
@@ -195,7 +195,7 @@ const Ke = wn("ingredientForm", function() {
195
195
  s("div", Dn, [
196
196
  _[2] || (_[2] = s("span", { class: "font-semibold" }, "Include Children Subsidiaries:", -1)),
197
197
  s("span", {
198
- class: te(
198
+ class: ne(
199
199
  f.value.includeChildren ? "text-green-600 font-semibold" : "text-red-600 font-semibold"
200
200
  )
201
201
  }, U(f.value.includeChildren ? "Yes" : "No"), 3)
@@ -221,7 +221,7 @@ const Ke = wn("ingredientForm", function() {
221
221
  default: T(() => [
222
222
  s("div", zn, [
223
223
  s("div", Ln, [
224
- (v(!0), F(X, null, ue(i.value, (g) => (v(), F("div", {
224
+ (v(!0), F(ee, null, ce(d.value, (g) => (v(), F("div", {
225
225
  key: g.id,
226
226
  class: "flex items-stretch"
227
227
  }, [
@@ -238,13 +238,13 @@ const Ke = wn("ingredientForm", function() {
238
238
  _: 2
239
239
  }, 1024)) : (v(), F("div", {
240
240
  key: 1,
241
- class: te([
241
+ class: ne([
242
242
  "px-2 py-1 rounded-md flex-1",
243
243
  g.isDirectlyBound ? "border-2 bg-green-200 border-green-400" : "bg-fm-color-bg-primary border border-fm-color-border-secondary"
244
244
  ])
245
245
  }, [
246
246
  s("span", {
247
- class: te([
247
+ class: ne([
248
248
  g.isHighlighted ? "fm-typo-en-body-md-600 text-fm-color-typo-primary" : "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
249
249
  ])
250
250
  }, U(g.name), 3)
@@ -260,13 +260,13 @@ const Ke = wn("ingredientForm", function() {
260
260
  }
261
261
  });
262
262
  function qn() {
263
- const { updateIngredient: u, deleteIngredient: o } = Ke(), b = ve(), l = Ee();
263
+ const { updateIngredient: i, deleteIngredient: o } = Ke(), b = fe(), l = Ee();
264
264
  De();
265
- const { t: c } = fe();
265
+ const { t: c } = ye();
266
266
  async function h(f, n) {
267
267
  const r = St(n);
268
268
  if (f === Re.Edit) {
269
- await u(r);
269
+ await i(r);
270
270
  return;
271
271
  }
272
272
  if (f === Re.Delete) {
@@ -288,15 +288,15 @@ function qn() {
288
288
  size: 300,
289
289
  cell(f) {
290
290
  const n = f.row.original, r = b.skuBindingFlattenCache[n._id], y = r == null ? void 0 : r.inventoryBindings.some(
291
- (d) => "error" in d && d.reason === "circularDependency"
291
+ (u) => "error" in u && u.reason === "circularDependency"
292
292
  );
293
- return Z("div", { class: "flex items-center w-full gap-4" }, [
294
- y ? Z(
293
+ return X("div", { class: "flex items-center w-full gap-4" }, [
294
+ y ? X(
295
295
  He.FmTooltip,
296
296
  { class: "text-left" },
297
297
  {
298
298
  default() {
299
- return Z(He.FmIcon, {
299
+ return X(He.FmIcon, {
300
300
  name: "info",
301
301
  color: "system-error-300",
302
302
  size: "sm"
@@ -317,10 +317,10 @@ function qn() {
317
317
  accessorFn: (f) => xt(f),
318
318
  cell(f) {
319
319
  const n = f.row.original, r = xt(n);
320
- return Z(
320
+ return X(
321
321
  He.FmTooltip,
322
322
  { zIndex: 51, content: r },
323
- Z(
323
+ X(
324
324
  "span",
325
325
  {
326
326
  class: "flex-auto line-clamp-2 text-ellipsis break-all"
@@ -337,7 +337,7 @@ function qn() {
337
337
  header: () => c("inventory.ingredient.status.title"),
338
338
  cell(f) {
339
339
  const n = f.row.original.isInactive;
340
- return Z(
340
+ return X(
341
341
  "span",
342
342
  {
343
343
  class: [
@@ -356,15 +356,15 @@ function qn() {
356
356
  header: () => "NetSuite Subsidiary",
357
357
  cell(f) {
358
358
  const n = f.row.original, { flattenedSubsidiaryNames: r } = l.getSkuSubsidiaries(n._id);
359
- return Z("div", { class: "flex gap-2 items-start" }, [
360
- Z(
359
+ return X("div", { class: "flex gap-2 items-start" }, [
360
+ X(
361
361
  "span",
362
362
  {
363
363
  class: "flex-1 line-clamp-2 text-ellipsis break-all whitespace-pre-wrap"
364
364
  },
365
365
  r.join(", ")
366
366
  ),
367
- Z(Yn, { skuId: n._id, itemName: n.name, itemCode: n.code })
367
+ X(Yn, { skuId: n._id, itemName: n.name, itemCode: n.code })
368
368
  ]);
369
369
  },
370
370
  enableSorting: !1,
@@ -390,16 +390,16 @@ function qn() {
390
390
  }
391
391
  ] };
392
392
  }
393
- function xt(u) {
393
+ function xt(i) {
394
394
  var o;
395
- if (u.trackingMeasurement) {
396
- const b = (o = u.unit.measurements) == null ? void 0 : o.find((l) => l.id === u.trackingMeasurement);
395
+ if (i.trackingMeasurement) {
396
+ const b = (o = i.unit.measurements) == null ? void 0 : o.find((l) => l.id === i.trackingMeasurement);
397
397
  if (b)
398
398
  return `${b.name} (${b.abbrev})`;
399
399
  }
400
- return `${u.unit.name} (${u.unit.abbrev})`;
400
+ return `${i.unit.name} (${i.unit.abbrev})`;
401
401
  }
402
- const Gn = /* @__PURE__ */ pe({
402
+ const Gn = /* @__PURE__ */ ve({
403
403
  __name: "ConvertForm",
404
404
  props: {
405
405
  modelValue: {},
@@ -408,39 +408,39 @@ const Gn = /* @__PURE__ */ pe({
408
408
  readonly: { type: Boolean }
409
409
  },
410
410
  emits: ["update:modelValue"],
411
- setup(u, { emit: o }) {
412
- const b = u, l = w(() => {
413
- var i;
414
- return (i = b.rootValue) == null ? void 0 : i.unit;
411
+ setup(i, { emit: o }) {
412
+ const b = i, l = w(() => {
413
+ var d;
414
+ return (d = b.rootValue) == null ? void 0 : d.unit;
415
415
  }), c = w(() => {
416
- var i;
417
- return (i = b.rootValue) == null ? void 0 : i._id;
418
- }), h = o, { t: k } = fe(), f = w({
416
+ var d;
417
+ return (d = b.rootValue) == null ? void 0 : d._id;
418
+ }), h = o, { t: k } = ye(), f = w({
419
419
  get() {
420
420
  return !!b.modelValue;
421
421
  },
422
- set(i) {
423
- i ? h("update:modelValue", {
422
+ set(d) {
423
+ d ? h("update:modelValue", {
424
424
  measurement: null,
425
425
  inventoryBindings: []
426
426
  }) : h("update:modelValue", null);
427
427
  }
428
428
  }), n = w(() => Vn(l.value));
429
- function r(i) {
429
+ function r(d) {
430
430
  const p = b.modelValue ?? {};
431
- p.measurement = i ? `${i}` : null, h("update:modelValue", p);
431
+ p.measurement = d ? `${d}` : null, h("update:modelValue", p);
432
432
  }
433
- function y(i) {
433
+ function y(d) {
434
434
  const p = b.modelValue ?? {};
435
- p.inventoryBindings = i, h("update:modelValue", p);
435
+ p.inventoryBindings = d, h("update:modelValue", p);
436
436
  }
437
- const d = w(() => {
437
+ const u = w(() => {
438
438
  if (!b.modelValue) return null;
439
- const i = b.modelValue;
440
- return i.measurement ? n.value.find((p) => p.value === i.measurement) ?? null : n.value.find((p) => p.value === null) ?? null;
439
+ const d = b.modelValue;
440
+ return d.measurement ? n.value.find((p) => p.value === d.measurement) ?? null : n.value.find((p) => p.value === null) ?? null;
441
441
  });
442
- return (i, p) => {
443
- const _ = M("FmSwitch"), I = M("FmSelect"), $ = M("FmCard");
442
+ return (d, p) => {
443
+ const _ = A("FmSwitch"), I = A("FmSelect"), $ = A("FmCard");
444
444
  return v(), z($, {
445
445
  variant: "outlined",
446
446
  class: "p-16 flex flex-col gap-16"
@@ -455,25 +455,25 @@ const Gn = /* @__PURE__ */ pe({
455
455
  label: a(k)("inventory.ingredient.convertible.title"),
456
456
  sublabel: a(k)("inventory.ingredient.convertible.subtitle"),
457
457
  labelPlacement: "right",
458
- disabled: i.readonly
458
+ disabled: d.readonly
459
459
  }, null, 8, ["model-value", "label", "sublabel", "disabled"]),
460
- f.value ? (v(), F(X, { key: 0 }, [
460
+ f.value ? (v(), F(ee, { key: 0 }, [
461
461
  s("div", null, [
462
462
  m(I, {
463
463
  label: a(k)("inventory.ingredient.convertible.convertTo"),
464
- modelValue: (g = d.value) == null ? void 0 : g.value,
464
+ modelValue: (g = u.value) == null ? void 0 : g.value,
465
465
  "onUpdate:modelValue": r,
466
466
  items: n.value,
467
- disabled: i.readonly
467
+ disabled: d.readonly
468
468
  }, null, 8, ["label", "modelValue", "items", "disabled"])
469
469
  ]),
470
470
  m(In, {
471
471
  id: c.value,
472
- "model-value": ((D = i.modelValue) == null ? void 0 : D.inventoryBindings) ?? [],
472
+ "model-value": ((D = d.modelValue) == null ? void 0 : D.inventoryBindings) ?? [],
473
473
  "onUpdate:modelValue": y,
474
474
  "exclude-binding-id": c.value,
475
475
  rules: [a(Be)(1)],
476
- readonly: i.readonly
476
+ readonly: d.readonly
477
477
  }, null, 8, ["id", "model-value", "exclude-binding-id", "rules", "readonly"])
478
478
  ], 64)) : j("", !0)
479
479
  ];
@@ -492,7 +492,7 @@ function ke() {
492
492
  const Kn = {
493
493
  key: 0,
494
494
  class: "flex flex-col gap-4"
495
- }, Fe = /* @__PURE__ */ pe({
495
+ }, Fe = /* @__PURE__ */ ve({
496
496
  __name: "FmLockableField",
497
497
  props: {
498
498
  locked: { type: Boolean },
@@ -504,9 +504,9 @@ const Kn = {
504
504
  tooltipPlacement: {},
505
505
  tooltipZIndex: {}
506
506
  },
507
- setup(u) {
507
+ setup(i) {
508
508
  return (o, b) => {
509
- const l = M("FmLabel"), c = M("FmIcon"), h = M("FmTooltip"), k = M("FmField");
509
+ const l = A("FmLabel"), c = A("FmIcon"), h = A("FmTooltip"), k = A("FmField");
510
510
  return o.locked ? (v(), F("div", Kn, [
511
511
  Ce(o.$slots, "label", {}, () => [
512
512
  m(l, {
@@ -541,7 +541,7 @@ const Kn = {
541
541
  default: T(() => [
542
542
  Ce(o.$slots, "modelValue", {}, () => [
543
543
  s("div", {
544
- class: te([
544
+ class: ne([
545
545
  o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary",
546
546
  "line-clamp-1 text-ellipsis break-all"
547
547
  ])
@@ -553,7 +553,7 @@ const Kn = {
553
553
  ]),
554
554
  Ce(o.$slots, "helper-text", {}, () => [
555
555
  s("div", {
556
- class: te([
556
+ class: ne([
557
557
  "fm-typo-en-body-sm-400 line-clamp-1",
558
558
  o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
559
559
  ])
@@ -574,10 +574,10 @@ const Kn = {
574
574
  }, So = { class: "flex flex-col" }, Io = { class: "flex items-center justify-between" }, Co = { class: "fm-typo-en-title-sm-600" }, Fo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, $o = {
575
575
  key: 0,
576
576
  class: "flex flex-col gap-8"
577
- }, Eo = { class: "flex flex-wrap gap-8" }, Ao = {
577
+ }, Eo = { class: "flex flex-wrap gap-8" }, Mo = {
578
578
  key: 6,
579
579
  class: "flex flex-col gap-12"
580
- }, Mo = { class: "flex flex-col" }, Uo = { class: "flex items-center justify-between" }, Po = { class: "fm-typo-en-title-sm-600" }, Ro = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Bo = {
580
+ }, Ao = { class: "flex flex-col" }, Uo = { class: "flex items-center justify-between" }, Po = { class: "fm-typo-en-title-sm-600" }, Ro = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Bo = {
581
581
  key: 0,
582
582
  class: "flex flex-col gap-8"
583
583
  }, Oo = { class: "flex flex-wrap gap-8" }, Do = {
@@ -586,7 +586,7 @@ const Kn = {
586
586
  }, No = { class: "flex flex-col" }, zo = { class: "flex items-center justify-between" }, Lo = { class: "fm-typo-en-title-sm-600" }, jo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ho = {
587
587
  key: 0,
588
588
  class: "flex flex-col gap-8"
589
- }, Wo = { class: "flex flex-wrap gap-8" }, Yo = /* @__PURE__ */ pe({
589
+ }, Wo = { class: "flex flex-wrap gap-8" }, Yo = /* @__PURE__ */ ve({
590
590
  __name: "IngredientForm",
591
591
  props: /* @__PURE__ */ ct({
592
592
  mode: {},
@@ -600,29 +600,29 @@ const Kn = {
600
600
  searchModifiers: {}
601
601
  }),
602
602
  emits: /* @__PURE__ */ ct(["update:modelValue", "click:submit", "update:purchaseOrderTemplateIds", "update:wastageTemplateIds", "update:closingTemplateIds"], ["update:search"]),
603
- setup(u, { expose: o, emit: b }) {
603
+ setup(i, { expose: o, emit: b }) {
604
604
  var ot;
605
- const { t: l } = fe(), c = De();
606
- Ae();
607
- const h = At(), k = It(), f = Mt(), n = u, r = b, y = ve(), d = we(), i = Qe(), p = Ee(), _ = w(() => p.isEnabled);
605
+ const { t: l } = ye(), c = De();
606
+ Me();
607
+ const h = Mt(), k = It(), f = At(), n = i, r = b, y = fe(), u = we(), d = Qe(), p = Ee(), _ = w(() => p.isEnabled);
608
608
  N(void 0);
609
609
  const I = N([]), $ = N([]), g = N([]), D = N(!1);
610
610
  function C(e) {
611
611
  if (e.length === 0) return;
612
612
  const t = e[0], S = n.modelValue ?? {
613
- unit: y.units.find((A) => A)
613
+ unit: y.units.find((M) => M)
614
614
  };
615
615
  S.unit || (S.unit = t, r("update:modelValue", S));
616
616
  }
617
617
  Wt(() => {
618
- C(y.units), n.mode === W.CREATE && (i.mustUsePoTemplate && ne(), i.enableWastageTemplate && ce(), i.enableClosingTemplate && oe());
618
+ C(y.units), n.mode === W.CREATE && (d.mustUsePoTemplate && Q(), d.enableWastageTemplate && me(), d.enableClosingTemplate && oe());
619
619
  }), Tt([() => y.units], ([e]) => {
620
620
  C(e);
621
621
  });
622
- function ye() {
622
+ function le() {
623
623
  r("click:submit");
624
624
  }
625
- async function ne() {
625
+ async function Q() {
626
626
  I.value = [], D.value = !0;
627
627
  try {
628
628
  const [e] = await Promise.all([h.readTemplates()]).delayed(1e3);
@@ -633,7 +633,7 @@ const Kn = {
633
633
  D.value = !1;
634
634
  }
635
635
  }
636
- async function ce() {
636
+ async function me() {
637
637
  $.value = [], D.value = !0;
638
638
  try {
639
639
  const [e] = await Promise.all([k.readTemplates()]).delayed(
@@ -659,7 +659,7 @@ const Kn = {
659
659
  D.value = !1;
660
660
  }
661
661
  }
662
- const le = w({
662
+ const se = w({
663
663
  get() {
664
664
  var e;
665
665
  return ((e = n.modelValue) == null ? void 0 : e.code) ?? "";
@@ -670,7 +670,7 @@ const Kn = {
670
670
  } : {};
671
671
  t.code = e, r("update:modelValue", t);
672
672
  }
673
- }), ee = w({
673
+ }), te = w({
674
674
  get() {
675
675
  var e;
676
676
  return ((e = n.modelValue) == null ? void 0 : e.isInactive) ?? !1;
@@ -681,7 +681,7 @@ const Kn = {
681
681
  } : {};
682
682
  t.isInactive = e, r("update:modelValue", t);
683
683
  }
684
- }), se = w({
684
+ }), ae = w({
685
685
  get() {
686
686
  var e;
687
687
  return ((e = n.modelValue) == null ? void 0 : e.name) ?? "";
@@ -699,7 +699,7 @@ const Kn = {
699
699
  return e ? +Ct(e) : 0;
700
700
  },
701
701
  set(e) {
702
- var S, A, q, L;
702
+ var S, M, q, L;
703
703
  const t = n.modelValue ? {
704
704
  ...n.modelValue
705
705
  } : {};
@@ -707,12 +707,12 @@ const Kn = {
707
707
  costPerUnit: {
708
708
  amount: 0,
709
709
  precision: 2,
710
- currency: ((S = Oe(d.currentCountry.value)) == null ? void 0 : S.currency) ?? "MYR"
710
+ currency: ((S = Oe(u.currentCountry.value)) == null ? void 0 : S.currency) ?? "MYR"
711
711
  },
712
- measurement: (L = (q = (A = n.modelValue) == null ? void 0 : A.unit) == null ? void 0 : q.measurements) == null ? void 0 : L.find(
713
- (re) => {
714
- var ie;
715
- return re.id === ((ie = n.modelValue) == null ? void 0 : ie.trackingMeasurement);
712
+ measurement: (L = (q = (M = n.modelValue) == null ? void 0 : M.unit) == null ? void 0 : q.measurements) == null ? void 0 : L.find(
713
+ (ie) => {
714
+ var de;
715
+ return ie.id === ((de = n.modelValue) == null ? void 0 : de.trackingMeasurement);
716
716
  }
717
717
  )
718
718
  }), t.defaultCost.costPerUnit = {
@@ -721,18 +721,18 @@ const Kn = {
721
721
  }, r("update:modelValue", t);
722
722
  }
723
723
  }), be = w(() => {
724
- var t, S, A;
724
+ var t, S, M;
725
725
  const e = ((t = n.modelValue) == null ? void 0 : t.unit) ?? y.units.find((q) => q);
726
726
  return e ? {
727
727
  _id: e._id,
728
728
  measurement: (S = n.modelValue) == null ? void 0 : S.trackingMeasurement,
729
- name: ((A = e.measurements.find((q) => {
729
+ name: ((M = e.measurements.find((q) => {
730
730
  var L;
731
731
  return q.id === ((L = n.modelValue) == null ? void 0 : L.trackingMeasurement);
732
- })) == null ? void 0 : A.name) ?? e.name
732
+ })) == null ? void 0 : M.name) ?? e.name
733
733
  } : null;
734
734
  }), Te = w(
735
- () => y.units.flatMap(({ name: e, _id: t, abbrev: S, measurements: A }) => [
735
+ () => y.units.flatMap(({ name: e, _id: t, abbrev: S, measurements: M }) => [
736
736
  {
737
737
  label: `${e}`,
738
738
  value: null,
@@ -743,36 +743,36 @@ const Kn = {
743
743
  value: { _id: t },
744
744
  displayAsSection: !1
745
745
  },
746
- ...A.map(({ id: q, name: L, abbrev: re }) => ({
747
- label: `${L} (${re})`,
746
+ ...M.map(({ id: q, name: L, abbrev: ie }) => ({
747
+ label: `${L} (${ie})`,
748
748
  value: { _id: t, measurement: q },
749
749
  displayAsSection: !1
750
750
  }))
751
751
  ])
752
- ), V = Yt(u, "search"), B = w(
752
+ ), V = Yt(i, "search"), B = w(
753
753
  () => new Zt(Te.value, ["label", "value"], {
754
754
  caseSensitive: !1,
755
755
  sort: !0
756
756
  })
757
757
  ), G = w(() => B.value.search(V.value));
758
758
  function P(e) {
759
- var t, S, A, q, L;
760
- return ((S = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : S._id) === ((A = e.value) == null ? void 0 : A._id) && ((q = n.modelValue) == null ? void 0 : q.trackingMeasurement) === ((L = e.value) == null ? void 0 : L.measurement);
759
+ var t, S, M, q, L;
760
+ return ((S = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : S._id) === ((M = e.value) == null ? void 0 : M._id) && ((q = n.modelValue) == null ? void 0 : q.trackingMeasurement) === ((L = e.value) == null ? void 0 : L.measurement);
761
761
  }
762
762
  function x(e) {
763
- var re, ie;
763
+ var ie, de;
764
764
  if (!e) return;
765
- const { _id: t, measurement: S } = e, A = S || void 0, q = y.units.find((Ie) => Ie._id === t);
765
+ const { _id: t, measurement: S } = e, M = S || void 0, q = y.units.find((Ie) => Ie._id === t);
766
766
  if (!q)
767
767
  return;
768
768
  const L = n.modelValue ?? {};
769
- L.unit = q, L.trackingMeasurement = A, L.convert && (L.convert.measurement = A || null), i.enableTotalCost && (L.defaultCost = {
770
- measurement: q.measurements.find((Ie) => Ie.id === A),
769
+ L.unit = q, L.trackingMeasurement = M, L.convert && (L.convert.measurement = M || null), d.enableTotalCost && (L.defaultCost = {
770
+ measurement: q.measurements.find((Ie) => Ie.id === M),
771
771
  costPerUnit: {
772
- ...((re = L.defaultCost) == null ? void 0 : re.costPerUnit) ?? {
772
+ ...((ie = L.defaultCost) == null ? void 0 : ie.costPerUnit) ?? {
773
773
  amount: 0,
774
774
  precision: 2,
775
- currency: ((ie = Oe(d.currentCountry.value)) == null ? void 0 : ie.currency) ?? "MYR"
775
+ currency: ((de = Oe(u.currentCountry.value)) == null ? void 0 : de.currency) ?? "MYR"
776
776
  }
777
777
  }
778
778
  }), r("update:modelValue", L);
@@ -793,7 +793,7 @@ const Kn = {
793
793
  ).map((e) => ({
794
794
  label: l(`inventory.ingredient.valuationMethod.${e}`),
795
795
  value: e
796
- }))), me = w({
796
+ }))), pe = w({
797
797
  get() {
798
798
  var e;
799
799
  return ((e = n.modelValue) == null ? void 0 : e.valuation) ?? "WAVG";
@@ -834,24 +834,24 @@ const Kn = {
834
834
  () => {
835
835
  var e, t, S;
836
836
  return (e = n.modelValue) != null && e._id ? ((S = y.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : S.filter(
837
- (A) => A.from === "INGREDIENT"
837
+ (M) => M.from === "INGREDIENT"
838
838
  )) ?? [] : [];
839
839
  }
840
- ), de = w(
840
+ ), ue = w(
841
841
  () => {
842
842
  var e, t, S;
843
843
  return (e = n.modelValue) != null && e._id ? ((S = y.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : S.filter(
844
- (A) => A.from === "RECIPE"
844
+ (M) => M.from === "RECIPE"
845
845
  )) ?? [] : [];
846
846
  }
847
847
  ), Ve = w(
848
848
  () => {
849
849
  var e, t, S;
850
- return (e = n.modelValue) != null && e._id ? ((S = y.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : S.filter((A) => A.from === "MENU")) ?? [] : [];
850
+ return (e = n.modelValue) != null && e._id ? ((S = y.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : S.filter((M) => M.from === "MENU")) ?? [] : [];
851
851
  }
852
852
  ), xe = w(
853
853
  () => y.skus.map((e) => ({ label: e.name, value: e.code }))
854
- ), Me = N((ot = n.modelValue) == null ? void 0 : ot.code);
854
+ ), Ae = N((ot = n.modelValue) == null ? void 0 : ot.code);
855
855
  function Ue(e) {
856
856
  var S;
857
857
  const t = e.el;
@@ -859,13 +859,13 @@ const Kn = {
859
859
  }
860
860
  const Pe = w(
861
861
  () => {
862
- var e, t, S, A, q, L;
863
- return ((A = (S = (t = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : S.find(
864
- (re) => {
865
- var ie;
866
- return re.id === ((ie = n.modelValue) == null ? void 0 : ie.trackingMeasurement);
862
+ var e, t, S, M, q, L;
863
+ return ((M = (S = (t = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : S.find(
864
+ (ie) => {
865
+ var de;
866
+ return ie.id === ((de = n.modelValue) == null ? void 0 : de.trackingMeasurement);
867
867
  }
868
- )) == null ? void 0 : A.abbrev) ?? ((L = (q = n.modelValue) == null ? void 0 : q.unit) == null ? void 0 : L.abbrev);
868
+ )) == null ? void 0 : M.abbrev) ?? ((L = (q = n.modelValue) == null ? void 0 : q.unit) == null ? void 0 : L.abbrev);
869
869
  }
870
870
  ), he = w({
871
871
  get() {
@@ -873,39 +873,39 @@ const Kn = {
873
873
  return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.low) ?? ke().low;
874
874
  },
875
875
  set(e) {
876
- var A;
877
- const t = ((A = n.modelValue) == null ? void 0 : A.thresholds) ?? ke();
876
+ var M;
877
+ const t = ((M = n.modelValue) == null ? void 0 : M.thresholds) ?? ke();
878
878
  t.low = e;
879
879
  const S = n.modelValue ? {
880
880
  ...n.modelValue
881
881
  } : {};
882
882
  S.thresholds = t, r("update:modelValue", S);
883
883
  }
884
- }), ae = w({
884
+ }), re = w({
885
885
  get() {
886
886
  var e, t;
887
887
  return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ?? ke().mid;
888
888
  },
889
889
  set(e) {
890
- var A;
891
- const t = ((A = n.modelValue) == null ? void 0 : A.thresholds) ?? ke();
890
+ var M;
891
+ const t = ((M = n.modelValue) == null ? void 0 : M.thresholds) ?? ke();
892
892
  t.mid = e;
893
893
  const S = n.modelValue ? {
894
894
  ...n.modelValue
895
895
  } : {};
896
896
  S.thresholds = t, r("update:modelValue", S);
897
897
  }
898
- }), Se = w(() => i.mustUsePoTemplate && n.mode === W.CREATE && I.value.length > 0 ? I.value.map((e) => ({
898
+ }), Se = w(() => d.mustUsePoTemplate && n.mode === W.CREATE && I.value.length > 0 ? I.value.map((e) => ({
899
899
  label: e.name || "Template",
900
900
  value: e._id || "template_" + e.name
901
901
  })) : []), Ze = w(() => Se.value.filter(
902
902
  (e) => (n.purchaseOrderTemplateIds ?? []).includes(e.value)
903
- )), Xe = w(() => i.enableWastageTemplate && n.mode === W.CREATE && $.value.length > 0 ? $.value.map((e) => ({
903
+ )), Xe = w(() => d.enableWastageTemplate && n.mode === W.CREATE && $.value.length > 0 ? $.value.map((e) => ({
904
904
  label: e.name || "Template",
905
905
  value: e._id || "template_" + e.name
906
906
  })) : []), et = w(() => Xe.value.filter(
907
907
  (e) => (n.wastageTemplateIds ?? []).includes(e.value)
908
- )), tt = w(() => i.enableClosingTemplate && n.mode === W.CREATE && g.value.length > 0 ? g.value.map((e) => ({
908
+ )), tt = w(() => d.enableClosingTemplate && n.mode === W.CREATE && g.value.length > 0 ? g.value.map((e) => ({
909
909
  label: e.name || "Template",
910
910
  value: e._id || "template_" + e.name
911
911
  })) : []), nt = w(() => tt.value.filter(
@@ -983,13 +983,13 @@ const Kn = {
983
983
  };
984
984
  }
985
985
  return (e, t) => {
986
- const S = M("FmTextField"), A = M("FmLabel"), q = M("FmField"), L = M("FmIcon"), re = M("FmMenuHeader"), ie = M("FmMenuDivider"), Ie = M("FmMenuItem"), Nt = M("FmMenu"), lt = M("FmFormGroup"), zt = M("FmSelect"), st = M("FmSwitch"), at = M("FmStepperField"), Ne = M("FmButton"), ze = M("FmChip"), Lt = M("FmForm");
986
+ const S = A("FmTextField"), M = A("FmLabel"), q = A("FmField"), L = A("FmIcon"), ie = A("FmMenuHeader"), de = A("FmMenuDivider"), Ie = A("FmMenuItem"), Nt = A("FmMenu"), lt = A("FmFormGroup"), zt = A("FmSelect"), st = A("FmSwitch"), at = A("FmStepperField"), Ne = A("FmButton"), ze = A("FmChip"), Lt = A("FmForm");
987
987
  return v(), z(Lt, {
988
988
  disabled: e.disabled,
989
989
  ref_key: "formRef",
990
990
  ref: R,
991
991
  class: "flex flex-col gap-32",
992
- onValidationSuccess: ye
992
+ onValidationSuccess: le
993
993
  }, {
994
994
  default: T(() => {
995
995
  var rt, it, dt, ut;
@@ -1000,17 +1000,17 @@ const Kn = {
1000
1000
  "tooltip-message": "This field is managed by NetSuite",
1001
1001
  "tooltip-z-index": 50,
1002
1002
  label: a(l)("inventory.ingredient.code"),
1003
- "model-value": le.value,
1004
- "onUpdate:modelValue": t[1] || (t[1] = (E) => le.value = E),
1003
+ "model-value": se.value,
1004
+ "onUpdate:modelValue": t[1] || (t[1] = (E) => se.value = E),
1005
1005
  locked: _.value,
1006
1006
  disabled: e.disabled
1007
1007
  }, {
1008
1008
  default: T(() => [
1009
1009
  m(S, {
1010
1010
  label: a(l)("inventory.ingredient.code"),
1011
- "model-value": le.value,
1012
- "onUpdate:modelValue": t[0] || (t[0] = (E) => le.value = E),
1013
- rules: [a(Le)(), a(Xt)(xe.value, Me.value)],
1011
+ "model-value": se.value,
1012
+ "onUpdate:modelValue": t[0] || (t[0] = (E) => se.value = E),
1013
+ rules: [a(Le)(), a(Xt)(xe.value, Ae.value)],
1014
1014
  "label-mark": "required"
1015
1015
  }, null, 8, ["label", "model-value", "rules"])
1016
1016
  ]),
@@ -1022,16 +1022,16 @@ const Kn = {
1022
1022
  "tooltip-message": "This field is managed by NetSuite",
1023
1023
  "tooltip-z-index": 50,
1024
1024
  label: a(l)("inventory.ingredient.name"),
1025
- "model-value": se.value,
1026
- "onUpdate:modelValue": t[3] || (t[3] = (E) => se.value = E),
1025
+ "model-value": ae.value,
1026
+ "onUpdate:modelValue": t[3] || (t[3] = (E) => ae.value = E),
1027
1027
  locked: _.value,
1028
1028
  disabled: e.disabled
1029
1029
  }, {
1030
1030
  default: T(() => [
1031
1031
  m(S, {
1032
1032
  label: a(l)("inventory.ingredient.name"),
1033
- "model-value": se.value,
1034
- "onUpdate:modelValue": t[2] || (t[2] = (E) => se.value = E),
1033
+ "model-value": ae.value,
1034
+ "onUpdate:modelValue": t[2] || (t[2] = (E) => ae.value = E),
1035
1035
  rules: [a(Le)()],
1036
1036
  "label-mark": "required"
1037
1037
  }, null, 8, ["label", "model-value", "rules"])
@@ -1056,7 +1056,7 @@ const Kn = {
1056
1056
  "label-mark": "required"
1057
1057
  }, {
1058
1058
  label: T(() => [
1059
- m(A, {
1059
+ m(M, {
1060
1060
  label: a(l)("inventory.ingredient.unit")
1061
1061
  }, null, 8, ["label"])
1062
1062
  ]),
@@ -1064,7 +1064,7 @@ const Kn = {
1064
1064
  m(Nt, null, {
1065
1065
  "menu-button": T(() => [
1066
1066
  m(q, {
1067
- class: te([
1067
+ class: ne([
1068
1068
  "fm-typo-en-body-lg-400",
1069
1069
  {
1070
1070
  "text-fm-color-typo-primary": !e.disabled,
@@ -1075,9 +1075,9 @@ const Kn = {
1075
1075
  "append-icon": "expand_more"
1076
1076
  }, {
1077
1077
  default: T(() => {
1078
- var Q;
1078
+ var Z;
1079
1079
  return [
1080
- Je(U((Q = be.value) == null ? void 0 : Q.name), 1)
1080
+ Je(U((Z = be.value) == null ? void 0 : Z.name), 1)
1081
1081
  ];
1082
1082
  }),
1083
1083
  _: 2
@@ -1087,7 +1087,7 @@ const Kn = {
1087
1087
  s("div", Xn, [
1088
1088
  m(S, {
1089
1089
  modelValue: V.value,
1090
- "onUpdate:modelValue": t[4] || (t[4] = (Q) => V.value = Q),
1090
+ "onUpdate:modelValue": t[4] || (t[4] = (Z) => V.value = Z),
1091
1091
  placeholder: "Filter options"
1092
1092
  }, {
1093
1093
  prepend: T(() => [
@@ -1099,18 +1099,18 @@ const Kn = {
1099
1099
  class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
1100
1100
  onVnodeMounted: Ue
1101
1101
  }, [
1102
- (v(!0), F(X, null, ue(G.value, (Q, jt) => (v(), F(X, { key: jt }, [
1103
- Q.displayAsSection ? (v(), F(X, { key: 0 }, [
1104
- m(re, {
1105
- label: Q.label
1102
+ (v(!0), F(ee, null, ce(G.value, (Z, jt) => (v(), F(ee, { key: jt }, [
1103
+ Z.displayAsSection ? (v(), F(ee, { key: 0 }, [
1104
+ m(ie, {
1105
+ label: Z.label
1106
1106
  }, null, 8, ["label"]),
1107
- m(ie)
1107
+ m(de)
1108
1108
  ], 64)) : (v(), z(Ie, {
1109
1109
  key: 1,
1110
- label: Q.label,
1111
- "model-value": P(Q),
1112
- onClick: (Vl) => x(Q.value),
1113
- "x-should-scroll-into": `${P(Q)}`
1110
+ label: Z.label,
1111
+ "model-value": P(Z),
1112
+ onClick: (Vl) => x(Z.value),
1113
+ "x-should-scroll-into": `${P(Z)}`
1114
1114
  }, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
1115
1115
  ], 64))), 128))
1116
1116
  ], 512)
@@ -1124,19 +1124,19 @@ const Kn = {
1124
1124
  ]),
1125
1125
  _: 1
1126
1126
  }, 8, ["label", "helper-text", "model-value", "locked", "disabled"]),
1127
- a(i).enableTotalCost ? (v(), z(Fe, {
1127
+ a(d).enableTotalCost ? (v(), z(Fe, {
1128
1128
  key: 0,
1129
1129
  "tooltip-message": "This field is managed by NetSuite",
1130
1130
  "tooltip-z-index": 50,
1131
1131
  label: a(l)("inventory.ingredient.valuationMethod.title"),
1132
- "model-value": a(l)("inventory.ingredient.valuationMethod." + me.value),
1132
+ "model-value": a(l)("inventory.ingredient.valuationMethod." + pe.value),
1133
1133
  locked: _.value,
1134
1134
  disabled: e.disabled
1135
1135
  }, {
1136
1136
  label: T(() => [
1137
1137
  m(_e, { "z-index": 50 }, {
1138
1138
  default: T(() => [
1139
- m(A, {
1139
+ m(M, {
1140
1140
  label: a(l)("inventory.ingredient.valuationMethod.title")
1141
1141
  }, null, 8, ["label"])
1142
1142
  ]),
@@ -1147,14 +1147,14 @@ const Kn = {
1147
1147
  m(zt, {
1148
1148
  class: "col-span-2",
1149
1149
  label: a(l)("inventory.ingredient.valuationMethod.title"),
1150
- "model-value": me.value,
1151
- "onUpdate:modelValue": t[5] || (t[5] = (E) => me.value = E),
1150
+ "model-value": pe.value,
1151
+ "onUpdate:modelValue": t[5] || (t[5] = (E) => pe.value = E),
1152
1152
  items: K.value
1153
1153
  }, null, 8, ["label", "model-value", "items"])
1154
1154
  ]),
1155
1155
  _: 1
1156
1156
  }, 8, ["label", "model-value", "locked", "disabled"])) : j("", !0),
1157
- a(i).enableTotalCost ? (v(), z(Fe, {
1157
+ a(d).enableTotalCost ? (v(), z(Fe, {
1158
1158
  key: 1,
1159
1159
  "tooltip-message": "This field is managed by NetSuite",
1160
1160
  "tooltip-z-index": 50,
@@ -1165,7 +1165,7 @@ const Kn = {
1165
1165
  label: T(() => [
1166
1166
  m(_e, { "z-index": 50 }, {
1167
1167
  default: T(() => [
1168
- m(A, {
1168
+ m(M, {
1169
1169
  label: a(l)("inventory.ingredient.pricePerUnit")
1170
1170
  }, null, 8, ["label"])
1171
1171
  ]),
@@ -1181,7 +1181,7 @@ const Kn = {
1181
1181
  label: T(() => [
1182
1182
  m(_e, { "z-index": 50 }, {
1183
1183
  default: T(() => [
1184
- m(A, {
1184
+ m(M, {
1185
1185
  label: a(l)("inventory.ingredient.pricePerUnit")
1186
1186
  }, null, 8, ["label"])
1187
1187
  ]),
@@ -1189,9 +1189,9 @@ const Kn = {
1189
1189
  })
1190
1190
  ]),
1191
1191
  prepend: T(() => {
1192
- var E, Q;
1192
+ var E, Z;
1193
1193
  return [
1194
- s("div", eo, U(a(ft)(((E = a(d).currentCountry) == null ? void 0 : E.value) ?? a(yt)) === "MYR" ? "RM" : a(ft)(((Q = a(d).currentCountry) == null ? void 0 : Q.value) ?? a(yt))), 1)
1194
+ s("div", eo, U(a(ft)(((E = a(u).currentCountry) == null ? void 0 : E.value) ?? a(yt)) === "MYR" ? "RM" : a(ft)(((Z = a(u).currentCountry) == null ? void 0 : Z.value) ?? a(yt))), 1)
1195
1195
  ];
1196
1196
  }),
1197
1197
  append: T(() => [
@@ -1212,8 +1212,8 @@ const Kn = {
1212
1212
  e.mode !== a(W).CREATE ? (v(), F("div", no, [
1213
1213
  m(st, {
1214
1214
  label: a(l)("inventory.ingredient.status.inactive"),
1215
- "model-value": ee.value,
1216
- "onUpdate:modelValue": t[8] || (t[8] = (E) => ee.value = E),
1215
+ "model-value": te.value,
1216
+ "onUpdate:modelValue": t[8] || (t[8] = (E) => te.value = E),
1217
1217
  "label-placement": "right",
1218
1218
  disabled: _.value
1219
1219
  }, null, 8, ["label", "model-value", "disabled"]),
@@ -1235,10 +1235,10 @@ const Kn = {
1235
1235
  name: a(l)("inventory.ingredient.bindedItems.ingredient"),
1236
1236
  bindings: Y.value
1237
1237
  }, null, 8, ["name", "bindings"])) : j("", !0),
1238
- O.value && de.value.length ? (v(), z(qe, {
1238
+ O.value && ue.value.length ? (v(), z(qe, {
1239
1239
  key: 1,
1240
1240
  name: a(l)("inventory.ingredient.bindedItems.recipe"),
1241
- bindings: de.value
1241
+ bindings: ue.value
1242
1242
  }, null, 8, ["name", "bindings"])) : j("", !0),
1243
1243
  O.value && Ve.value.length ? (v(), z(qe, {
1244
1244
  key: 2,
@@ -1258,7 +1258,7 @@ const Kn = {
1258
1258
  ]),
1259
1259
  s("div", co, [
1260
1260
  m(lt, {
1261
- "model-value": { low: he.value, mid: ae.value },
1261
+ "model-value": { low: he.value, mid: re.value },
1262
1262
  rules: [Dt()]
1263
1263
  }, null, 8, ["model-value", "rules"]),
1264
1264
  s("div", mo, [
@@ -1298,15 +1298,15 @@ const Kn = {
1298
1298
  s("div", go, [
1299
1299
  s("div", bo, [
1300
1300
  m(We, {
1301
- days: ae.value,
1301
+ days: re.value,
1302
1302
  level: a(Ye).mid
1303
1303
  }, null, 8, ["days", "level"])
1304
1304
  ]),
1305
1305
  s("div", ho, [
1306
1306
  s("div", _o, U(a(l)("inventory.ingredient.threshold.whenRemaining")), 1),
1307
1307
  m(at, {
1308
- modelValue: ae.value,
1309
- "onUpdate:modelValue": t[11] || (t[11] = (E) => ae.value = E),
1308
+ modelValue: re.value,
1309
+ "onUpdate:modelValue": t[11] || (t[11] = (E) => re.value = E),
1310
1310
  rules: [a(Be)(0)]
1311
1311
  }, {
1312
1312
  append: T(() => t[14] || (t[14] = [
@@ -1331,7 +1331,7 @@ const Kn = {
1331
1331
  s("div", xo, [
1332
1332
  s("div", ko, [
1333
1333
  m(We, {
1334
- days: ae.value + 1,
1334
+ days: re.value + 1,
1335
1335
  level: a(Ye).high
1336
1336
  }, null, 8, ["days", "level"])
1337
1337
  ]),
@@ -1342,7 +1342,7 @@ const Kn = {
1342
1342
  ])
1343
1343
  ])
1344
1344
  ]),
1345
- a(i).mustUsePoTemplate && e.mode === a(W).CREATE ? (v(), F("div", Vo, [
1345
+ a(d).mustUsePoTemplate && e.mode === a(W).CREATE ? (v(), F("div", Vo, [
1346
1346
  s("div", So, [
1347
1347
  s("div", Io, [
1348
1348
  m(_e, null, {
@@ -1363,7 +1363,7 @@ const Kn = {
1363
1363
  ]),
1364
1364
  Ze.value.length > 0 ? (v(), F("div", $o, [
1365
1365
  s("div", Eo, [
1366
- (v(!0), F(X, null, ue(Ze.value, (E) => (v(), z(ze, {
1366
+ (v(!0), F(ee, null, ce(Ze.value, (E) => (v(), z(ze, {
1367
1367
  key: E.value,
1368
1368
  label: E.label,
1369
1369
  variant: "info",
@@ -1372,8 +1372,8 @@ const Kn = {
1372
1372
  ])
1373
1373
  ])) : j("", !0)
1374
1374
  ])) : j("", !0),
1375
- a(i).enableWastageTemplate && e.mode === a(W).CREATE ? (v(), F("div", Ao, [
1376
- s("div", Mo, [
1375
+ a(d).enableWastageTemplate && e.mode === a(W).CREATE ? (v(), F("div", Mo, [
1376
+ s("div", Ao, [
1377
1377
  s("div", Uo, [
1378
1378
  m(_e, null, {
1379
1379
  default: T(() => [
@@ -1393,7 +1393,7 @@ const Kn = {
1393
1393
  ]),
1394
1394
  et.value.length > 0 ? (v(), F("div", Bo, [
1395
1395
  s("div", Oo, [
1396
- (v(!0), F(X, null, ue(et.value, (E) => (v(), z(ze, {
1396
+ (v(!0), F(ee, null, ce(et.value, (E) => (v(), z(ze, {
1397
1397
  key: E.value,
1398
1398
  label: E.label,
1399
1399
  variant: "info",
@@ -1402,7 +1402,7 @@ const Kn = {
1402
1402
  ])
1403
1403
  ])) : j("", !0)
1404
1404
  ])) : j("", !0),
1405
- a(i).enableClosingTemplate && e.mode === a(W).CREATE ? (v(), F("div", Do, [
1405
+ a(d).enableClosingTemplate && e.mode === a(W).CREATE ? (v(), F("div", Do, [
1406
1406
  s("div", No, [
1407
1407
  s("div", zo, [
1408
1408
  m(_e, null, {
@@ -1423,7 +1423,7 @@ const Kn = {
1423
1423
  ]),
1424
1424
  nt.value.length > 0 ? (v(), F("div", Ho, [
1425
1425
  s("div", Wo, [
1426
- (v(!0), F(X, null, ue(nt.value, (E) => (v(), z(ze, {
1426
+ (v(!0), F(ee, null, ce(nt.value, (E) => (v(), z(ze, {
1427
1427
  key: E.value,
1428
1428
  label: E.label,
1429
1429
  variant: "info",
@@ -1448,7 +1448,7 @@ const Kn = {
1448
1448
  }), qo = { class: "flex flex-col gap-32" }, Go = {
1449
1449
  key: 0,
1450
1450
  class: "flex justify-between items-center"
1451
- }, Ko = { class: "flex gap-4" }, Jo = /* @__PURE__ */ pe({
1451
+ }, Ko = { class: "flex gap-4" }, Jo = /* @__PURE__ */ ve({
1452
1452
  __name: "IngredientDialog",
1453
1453
  props: {
1454
1454
  show: { type: Boolean },
@@ -1456,8 +1456,8 @@ const Kn = {
1456
1456
  mode: { default: W.READ }
1457
1457
  },
1458
1458
  emits: ["update:show"],
1459
- setup(u) {
1460
- const o = u, b = ve(), l = Qe(), c = Ee(), h = At(), k = It(), f = Mt(), n = Ae(), { t: r } = fe(), y = _t(o, "show"), d = _t(o, "sku"), i = N([]), p = N([]), _ = N([]), I = w(
1459
+ setup(i) {
1460
+ const o = i, b = fe(), l = Qe(), c = Ee(), h = Mt(), k = It(), f = At(), n = Me(), { t: r } = ye(), y = _t(o, "show"), u = _t(o, "sku"), d = N([]), p = N([]), _ = N([]), I = w(
1461
1461
  () => {
1462
1462
  var V;
1463
1463
  return c.isEnabled && c.netSuiteItemBySkuId.has((V = o.sku) == null ? void 0 : V._id);
@@ -1483,14 +1483,14 @@ const Kn = {
1483
1483
  }
1484
1484
  return "";
1485
1485
  }), D = N(), C = N(!1);
1486
- async function ye() {
1486
+ async function le() {
1487
1487
  C.value = !0;
1488
1488
  try {
1489
- await b.createSku(d.value);
1490
- const V = b.skuByCode[d.value.code];
1491
- l.enablePoTemplate && i.value.length > 0 && await ce(V), l.enableWastageTemplate && p.value.length > 0 && await oe(V), l.enableClosingTemplate && _.value.length > 0 && await le(V), y.value = !1, n.open({
1489
+ await b.createSku(u.value);
1490
+ const V = b.skuByCode[u.value.code];
1491
+ l.enablePoTemplate && d.value.length > 0 && await me(V), l.enableWastageTemplate && p.value.length > 0 && await oe(V), l.enableClosingTemplate && _.value.length > 0 && await se(V), y.value = !1, n.open({
1492
1492
  title: r("inventory.common.success"),
1493
- message: r("inventory.ingredient.create.success", { name: d.value.name }),
1493
+ message: r("inventory.ingredient.create.success", { name: u.value.name }),
1494
1494
  type: "success"
1495
1495
  });
1496
1496
  } catch (V) {
@@ -1503,12 +1503,12 @@ const Kn = {
1503
1503
  C.value = !1;
1504
1504
  }
1505
1505
  }
1506
- async function ne() {
1506
+ async function Q() {
1507
1507
  C.value = !0;
1508
1508
  try {
1509
- await b.updateSku(d.value), C.value = !1, y.value = !1, n.open({
1509
+ await b.updateSku(u.value), C.value = !1, y.value = !1, n.open({
1510
1510
  title: r("inventory.common.success"),
1511
- message: r("inventory.ingredient.update.success", { name: d.value.name }),
1511
+ message: r("inventory.ingredient.update.success", { name: u.value.name }),
1512
1512
  type: "success"
1513
1513
  });
1514
1514
  } catch (V) {
@@ -1521,10 +1521,10 @@ const Kn = {
1521
1521
  C.value = !1;
1522
1522
  }
1523
1523
  }
1524
- async function ce(V) {
1524
+ async function me(V) {
1525
1525
  var B, G, P, x;
1526
1526
  try {
1527
- for (const H of i.value) {
1527
+ for (const H of d.value) {
1528
1528
  const K = await h.getTemplate(H);
1529
1529
  if (!K) {
1530
1530
  console.warn(`Template with ID ${H} not found`);
@@ -1549,7 +1549,7 @@ const Kn = {
1549
1549
  }
1550
1550
  };
1551
1551
  (((P = O.purchaseOrder.supplier) == null ? void 0 : P.internal) === bt.enum.warehouse || ((x = O.purchaseOrder.supplier) == null ? void 0 : x.internal) === bt.enum.restaurant) && (O.purchaseOrder.items = O.purchaseOrder.items.map(
1552
- ({ totalCost: Y, ...de }) => de
1552
+ ({ totalCost: Y, ...ue }) => ue
1553
1553
  )), await h.updateTemplate(O), await new Promise((Y) => setTimeout(Y, 1e3));
1554
1554
  }
1555
1555
  }
@@ -1591,7 +1591,7 @@ const Kn = {
1591
1591
  }), console.error("Error in updating wastage template", B);
1592
1592
  }
1593
1593
  }
1594
- async function le(V) {
1594
+ async function se(V) {
1595
1595
  try {
1596
1596
  for (const B of _.value) {
1597
1597
  const G = await f.getTemplate(B);
@@ -1617,22 +1617,22 @@ const Kn = {
1617
1617
  }), console.error("Error in updating closing template", B);
1618
1618
  }
1619
1619
  }
1620
- function ee() {
1620
+ function te() {
1621
1621
  var V, B;
1622
1622
  (B = (V = D.value) == null ? void 0 : V.validateInputs) == null || B.call(V);
1623
1623
  }
1624
- function se() {
1624
+ function ae() {
1625
1625
  switch (o.mode) {
1626
1626
  case W.READ:
1627
1627
  return;
1628
1628
  case W.UPDATE:
1629
- return ne();
1629
+ return Q();
1630
1630
  case W.CREATE:
1631
- return ye();
1631
+ return le();
1632
1632
  }
1633
1633
  }
1634
1634
  function ge(V) {
1635
- i.value = V;
1635
+ d.value = V;
1636
1636
  }
1637
1637
  function be(V) {
1638
1638
  p.value = V;
@@ -1641,7 +1641,7 @@ const Kn = {
1641
1641
  _.value = V;
1642
1642
  }
1643
1643
  return (V, B) => {
1644
- const G = M("FmChip"), P = M("FmButton"), x = M("FmSideSheet");
1644
+ const G = A("FmChip"), P = A("FmButton"), x = A("FmSideSheet");
1645
1645
  return v(), z(x, {
1646
1646
  "model-value": a(y),
1647
1647
  "onUpdate:modelValue": B[3] || (B[3] = (H) => mt(y) ? y.value = H : null),
@@ -1655,7 +1655,7 @@ const Kn = {
1655
1655
  m(P, {
1656
1656
  loading: C.value,
1657
1657
  label: g.value,
1658
- onClick: ee
1658
+ onClick: te
1659
1659
  }, null, 8, ["loading", "label"]),
1660
1660
  m(P, {
1661
1661
  disabled: C.value,
@@ -1682,14 +1682,14 @@ const Kn = {
1682
1682
  class: "w-full",
1683
1683
  ref_key: "hasValidationExpose",
1684
1684
  ref: D,
1685
- modelValue: a(d),
1686
- "onUpdate:modelValue": B[0] || (B[0] = (H) => mt(d) ? d.value = H : null),
1685
+ modelValue: a(u),
1686
+ "onUpdate:modelValue": B[0] || (B[0] = (H) => mt(u) ? u.value = H : null),
1687
1687
  mode: V.mode,
1688
1688
  disabled: C.value,
1689
- purchaseOrderTemplateIds: i.value,
1689
+ purchaseOrderTemplateIds: d.value,
1690
1690
  wastageTemplateIds: p.value,
1691
1691
  closingTemplateIds: _.value,
1692
- "onClick:submit": B[1] || (B[1] = (H) => se()),
1692
+ "onClick:submit": B[1] || (B[1] = (H) => ae()),
1693
1693
  "onUpdate:purchaseOrderTemplateIds": ge,
1694
1694
  "onUpdate:wastageTemplateIds": be,
1695
1695
  "onUpdate:closingTemplateIds": Te
@@ -1711,13 +1711,13 @@ const Zo = {
1711
1711
  precision: 0,
1712
1712
  measurements: []
1713
1713
  };
1714
- function Xo(u) {
1715
- return !u || Object.keys(u).length === 0 ? "" : Object.entries(u).map(([o, b]) => `${o}: ${b}`).join(", ");
1714
+ function Xo(i) {
1715
+ return !i || Object.keys(i).length === 0 ? "" : Object.entries(i).map(([o, b]) => `${o}: ${b}`).join(", ");
1716
1716
  }
1717
- function Ut(u) {
1718
- if (!u || u.trim() === "")
1717
+ function Ut(i) {
1718
+ if (!i || i.trim() === "")
1719
1719
  return;
1720
- const o = {}, b = u.split(",").map((l) => l.trim());
1720
+ const o = {}, b = i.split(",").map((l) => l.trim());
1721
1721
  for (const l of b) {
1722
1722
  const c = l.indexOf(":");
1723
1723
  if (c > 0) {
@@ -1727,23 +1727,24 @@ function Ut(u) {
1727
1727
  }
1728
1728
  return Object.keys(o).length > 0 ? o : void 0;
1729
1729
  }
1730
- function el(u) {
1730
+ function el(i) {
1731
1731
  var b, l, c, h, k;
1732
1732
  return {
1733
- code: u.code,
1734
- name: u.name,
1735
- unit: ((b = u.unit.measurements.find((f) => f.id === u.trackingMeasurement)) == null ? void 0 : b.abbrev) ?? u.unit.abbrev,
1736
- baseUnit: u.unit.abbrev,
1737
- valuationMethod: u.valuation ?? "WAVG",
1738
- pricePerUnit: (l = u.defaultCost) != null && l.costPerUnit ? +Ct((c = u.defaultCost) == null ? void 0 : c.costPerUnit) : 0,
1739
- thresholdLow: ((h = u.thresholds) == null ? void 0 : h.low) ?? ke().low,
1740
- thresholdMid: ((k = u.thresholds) == null ? void 0 : k.mid) ?? ke().mid,
1741
- customAttributes: Xo(u.customAttributes)
1733
+ code: i.code,
1734
+ name: i.name,
1735
+ unit: i.unit.name,
1736
+ baseUnit: i.unit.abbrev,
1737
+ measurementName: ((b = i.unit.measurements.find((f) => f.id === i.trackingMeasurement)) == null ? void 0 : b.abbrev) ?? i.unit.abbrev,
1738
+ valuationMethod: i.valuation ?? "WAVG",
1739
+ pricePerUnit: (l = i.defaultCost) != null && l.costPerUnit ? +Ct((c = i.defaultCost) == null ? void 0 : c.costPerUnit) : 0,
1740
+ thresholdLow: ((h = i.thresholds) == null ? void 0 : h.low) ?? ke().low,
1741
+ thresholdMid: ((k = i.thresholds) == null ? void 0 : k.mid) ?? ke().mid,
1742
+ customAttributes: Xo(i.customAttributes)
1742
1743
  };
1743
1744
  }
1744
1745
  function Pt() {
1745
1746
  var c;
1746
- const u = [
1747
+ const i = [
1747
1748
  {
1748
1749
  id: "code",
1749
1750
  name: "Code"
@@ -1759,9 +1760,13 @@ function Pt() {
1759
1760
  {
1760
1761
  id: "baseUnit",
1761
1762
  name: "Base unit"
1763
+ },
1764
+ {
1765
+ id: "measurementName",
1766
+ name: "Measurement Name"
1762
1767
  }
1763
1768
  ], o = Qe(), b = we(), l = Oe(b.currentCountry.value);
1764
- return o.enableTotalCost && u.push(
1769
+ return o.enableTotalCost && i.push(
1765
1770
  {
1766
1771
  id: "valuationMethod",
1767
1772
  name: "Valuation method"
@@ -1770,7 +1775,7 @@ function Pt() {
1770
1775
  id: "pricePerUnit",
1771
1776
  name: `Price per unit (${l == null ? void 0 : l.currency})`
1772
1777
  }
1773
- ), ((c = b.currentBusiness.value) == null ? void 0 : c.menuVersion) === "v4" && u.push(
1778
+ ), ((c = b.currentBusiness.value) == null ? void 0 : c.menuVersion) === "v4" && i.push(
1774
1779
  {
1775
1780
  id: "thresholdLow",
1776
1781
  name: "Show RED when remaining"
@@ -1779,13 +1784,13 @@ function Pt() {
1779
1784
  id: "thresholdMid",
1780
1785
  name: "Show YELLOW when remaining"
1781
1786
  }
1782
- ), u.push({
1787
+ ), i.push({
1783
1788
  id: "customAttributes",
1784
1789
  name: "Custom Attributes"
1785
- }), u;
1790
+ }), i;
1786
1791
  }
1787
1792
  function tl() {
1788
- const o = ve().skus.map(el), l = we().currentBusiness.value, c = Pt(), h = [
1793
+ const o = fe().skus.map(el), l = we().currentBusiness.value, c = Pt(), h = [
1789
1794
  ["Business name:", l == null ? void 0 : l.name],
1790
1795
  ["Business ID:", l == null ? void 0 : l._id],
1791
1796
  ["Menu version", l == null ? void 0 : l.menuVersion],
@@ -1805,7 +1810,7 @@ function nl() {
1805
1810
  ], c = b.map((f) => `system:${f.id}`), h = $t(l, c), k = "FeedMe ingredients template.xlsx";
1806
1811
  return Et(h, k), k;
1807
1812
  }
1808
- function ol(u) {
1813
+ function ol(i) {
1809
1814
  const [
1810
1815
  o,
1811
1816
  b,
@@ -1814,19 +1819,19 @@ function ol(u) {
1814
1819
  h,
1815
1820
  k,
1816
1821
  ...f
1817
- ] = an(u);
1818
- if (!o || !o.length || o.some((i) => i.length && !i.startsWith("system:")))
1822
+ ] = an(i);
1823
+ if (!o || !o.length || o.some((d) => d.length && !d.startsWith("system:")))
1819
1824
  throw new Error("Missing meta header. Excel file does not come from the template.");
1820
- const n = o.map((i) => i.split(":")[1]), y = ["code", "name", "unit", "baseUnit"].filter((i) => !n.includes(i));
1825
+ const n = o.map((d) => d.split(":")[1]), y = ["code", "name", "unit", "baseUnit", "measurementName"].filter((d) => !n.includes(d));
1821
1826
  if (y.length)
1822
1827
  throw new Error(
1823
1828
  `Missing meta headers (${y.join()}). Excel file does not come from the template.`
1824
1829
  );
1825
- return f.map((i, p) => {
1830
+ return f.map((d, p) => {
1826
1831
  const _ = {};
1827
1832
  for (const I in n) {
1828
1833
  const $ = n[I];
1829
- Object.assign(_, { [$]: i[I] });
1834
+ Object.assign(_, { [$]: d[I] });
1830
1835
  }
1831
1836
  return {
1832
1837
  index: p,
@@ -1834,41 +1839,44 @@ function ol(u) {
1834
1839
  };
1835
1840
  });
1836
1841
  }
1837
- function kt(u, o, b) {
1842
+ function kt(i, o, b) {
1838
1843
  var D;
1839
- const c = ve().units, h = new Array(), k = b.filter((C) => C.data.code === u.code);
1844
+ const c = fe().units, h = new Array(), k = b.filter((C) => C.data.code === i.code);
1840
1845
  k.length > 1 && h.push(
1841
- `Code ${u.code} is already used in row ${k.map((C) => C.index + 6).join()}.`
1846
+ `Code ${i.code} is already used in row ${k.map((C) => C.index + 6).join()}.`
1842
1847
  );
1843
- const f = c.find((C) => C.abbrev === u.baseUnit), n = f == null ? void 0 : f.measurements.find((C) => C.abbrev === u.unit);
1848
+ const f = c.find((C) => {
1849
+ var le, Q;
1850
+ return C.abbrev === i.baseUnit && ((le = C.name) == null ? void 0 : le.trim()) === ((Q = i.unit) == null ? void 0 : Q.trim());
1851
+ }), n = f == null ? void 0 : f.measurements.find((C) => C.abbrev === i.measurementName);
1844
1852
  if (!f)
1845
- h.push(`Cannot find base unit of symbol ${u.baseUnit}.`);
1846
- else if (u.baseUnit !== u.unit && !n) {
1847
- const C = `Cannot find unit conversion for ${u.baseUnit} with symbol ${u.unit || "[empty]"}.`;
1853
+ h.push(`Cannot find base unit of symbol ${i.baseUnit}.`);
1854
+ else if (i.baseUnit !== i.measurementName && !n) {
1855
+ const C = `Cannot find unit conversion for ${i.baseUnit} with symbol ${i.measurementName || "[empty]"}.`;
1848
1856
  h.push(C);
1849
1857
  }
1850
1858
  const r = $e.options.find(
1851
- (C) => C === u.valuationMethod
1859
+ (C) => C === i.valuationMethod
1852
1860
  );
1853
- u.valuationMethod && !r && h.push(
1854
- `Expected valuation method to be one of ${$e.options.join()} but got ${u.valuationMethod} instead.`
1861
+ i.valuationMethod && !r && h.push(
1862
+ `Expected valuation method to be one of ${$e.options.join()} but got ${i.valuationMethod} instead.`
1855
1863
  );
1856
- const d = we().currentCountry.value, i = (C) => `${C}`.length && rn()(C) === !0, p = i(`${u.pricePerUnit}`) === !0 ? {
1864
+ const u = we().currentCountry.value, d = (C) => `${C}`.length && rn()(C) === !0, p = d(`${i.pricePerUnit}`) === !0 ? {
1857
1865
  costPerUnit: {
1858
- ...Ft(Number(u.pricePerUnit) || 0),
1859
- currency: ((D = Oe(d)) == null ? void 0 : D.currency) ?? "MYR"
1866
+ ...Ft(Number(i.pricePerUnit) || 0),
1867
+ currency: ((D = Oe(u)) == null ? void 0 : D.currency) ?? "MYR"
1860
1868
  },
1861
1869
  measurement: n
1862
- } : void 0, _ = i(`${u.thresholdLow}`) && i(`${u.thresholdMid}`) ? {
1863
- low: Number(u.thresholdLow) || 0,
1864
- mid: Number(u.thresholdMid) || 0
1865
- } : void 0, I = "customAttributes" in u ? Ut(u.customAttributes) : null;
1870
+ } : void 0, _ = d(`${i.thresholdLow}`) && d(`${i.thresholdMid}`) ? {
1871
+ low: Number(i.thresholdLow) || 0,
1872
+ mid: Number(i.thresholdMid) || 0
1873
+ } : void 0, I = "customAttributes" in i ? Ut(i.customAttributes) : null;
1866
1874
  return {
1867
1875
  type: "create",
1868
1876
  sku: {
1869
1877
  _id: Qo(),
1870
- code: u.code,
1871
- name: u.name,
1878
+ code: i.code,
1879
+ name: i.name,
1872
1880
  unit: f ?? c.find((C) => C) ?? Zo,
1873
1881
  trackingMeasurement: n == null ? void 0 : n.id,
1874
1882
  valuation: r,
@@ -1880,28 +1888,28 @@ function kt(u, o, b) {
1880
1888
  excelRowNumber: o + 6
1881
1889
  };
1882
1890
  }
1883
- function ll(u) {
1891
+ function ll(i) {
1884
1892
  try {
1885
- const o = ol(u).filter((r) => r.data.code), l = ve().skus, c = sn(l, "code"), h = o.filter((r) => !c[r.data.code]), k = o.filter((r) => c[r.data.code]), f = h.map(
1893
+ const o = ol(i).filter((r) => r.data.code), l = fe().skus, c = sn(l, "code"), h = o.filter((r) => !c[r.data.code]), k = o.filter((r) => c[r.data.code]), f = h.map(
1886
1894
  (r) => kt(r.data, r.index, o)
1887
1895
  ), n = k.map((r) => {
1888
- const y = kt(r.data, r.index, o), d = c[r.data.code];
1889
- let i = d.customAttributes;
1890
- return "customAttributes" in r.data && (i = Ut(r.data.customAttributes)), {
1896
+ const y = kt(r.data, r.index, o), u = c[r.data.code];
1897
+ let d = u.customAttributes;
1898
+ return "customAttributes" in r.data && (d = Ut(r.data.customAttributes)), {
1891
1899
  ...y,
1892
1900
  type: "update",
1893
- original: d,
1901
+ original: u,
1894
1902
  sku: {
1895
1903
  // to maintain original props not in the import excel, e.g. inventory binding, etc...
1896
- ...d,
1897
- code: y.sku.code || d.code,
1898
- name: y.sku.name || d.name,
1899
- unit: y.sku.unit || d.unit,
1900
- trackingMeasurement: y.sku.trackingMeasurement || d.trackingMeasurement,
1901
- valuation: y.sku.valuation || d.valuation,
1902
- defaultCost: y.sku.defaultCost || d.defaultCost,
1903
- thresholds: y.sku.thresholds || d.thresholds,
1904
- customAttributes: i
1904
+ ...u,
1905
+ code: y.sku.code || u.code,
1906
+ name: y.sku.name || u.name,
1907
+ unit: y.sku.unit || u.unit,
1908
+ trackingMeasurement: y.sku.trackingMeasurement || u.trackingMeasurement,
1909
+ valuation: y.sku.valuation || u.valuation,
1910
+ defaultCost: y.sku.defaultCost || u.defaultCost,
1911
+ thresholds: y.sku.thresholds || u.thresholds,
1912
+ customAttributes: d
1905
1913
  }
1906
1914
  };
1907
1915
  });
@@ -1922,7 +1930,7 @@ function ll(u) {
1922
1930
  const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-col" }, rl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, il = {
1923
1931
  key: 0,
1924
1932
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
1925
- }, dl = { key: 0 }, wt = /* @__PURE__ */ pe({
1933
+ }, dl = { key: 0 }, wt = /* @__PURE__ */ ve({
1926
1934
  __name: "ImportIngredientItem",
1927
1935
  props: {
1928
1936
  type: {},
@@ -1930,15 +1938,15 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
1930
1938
  name: {},
1931
1939
  errors: {}
1932
1940
  },
1933
- setup(u) {
1941
+ setup(i) {
1934
1942
  return (o, b) => {
1935
- const l = M("FmIcon"), c = M("FmTooltip");
1943
+ const l = A("FmIcon"), c = A("FmTooltip");
1936
1944
  return v(), F("div", sl, [
1937
1945
  b[0] || (b[0] = s("div", null, "•", -1)),
1938
1946
  s("div", al, [
1939
1947
  s("div", rl, [
1940
1948
  s("div", {
1941
- class: te({
1949
+ class: ne({
1942
1950
  "text-fm-color-system-error-300": o.errors.length
1943
1951
  })
1944
1952
  }, [
@@ -1949,7 +1957,7 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
1949
1957
  m(c, { "z-index": 50 }, {
1950
1958
  content: T(() => [
1951
1959
  s("ol", null, [
1952
- (v(!0), F(X, null, ue(o.errors, (h, k) => (v(), F("li", { key: k }, U(h), 1))), 128))
1960
+ (v(!0), F(ee, null, ce(o.errors, (h, k) => (v(), F("li", { key: k }, U(h), 1))), 128))
1953
1961
  ])
1954
1962
  ]),
1955
1963
  default: T(() => [
@@ -1964,7 +1972,7 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
1964
1972
  ])) : j("", !0)
1965
1973
  ]),
1966
1974
  s("div", {
1967
- class: te([
1975
+ class: ne([
1968
1976
  "fm-typo-en-body-sm-400",
1969
1977
  {
1970
1978
  "text-fm-color-system-error-200": o.errors.length,
@@ -1985,20 +1993,20 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
1985
1993
  }, yl = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, gl = {
1986
1994
  key: 0,
1987
1995
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
1988
- }, bl = { class: "fm-typo-en-body-lg-600" }, hl = /* @__PURE__ */ pe({
1996
+ }, bl = { class: "fm-typo-en-body-lg-600" }, hl = /* @__PURE__ */ ve({
1989
1997
  __name: "ImportIngredients",
1990
- setup(u) {
1991
- const o = N(null), b = hn(), l = Ae(), c = N(!1), h = N(new Array()), k = N([]), f = N([]), n = w(
1992
- () => !!h.value.length || k.value.some((i) => i.errors.length) || f.value.some((i) => i.errors.length)
1998
+ setup(i) {
1999
+ const o = N(null), b = hn(), l = Me(), c = N(!1), h = N(new Array()), k = N([]), f = N([]), n = w(
2000
+ () => !!h.value.length || k.value.some((d) => d.errors.length) || f.value.some((d) => d.errors.length)
1993
2001
  ), r = w(
1994
2002
  () => !!k.value.length || !!f.value.length
1995
- ), { t: y } = fe();
1996
- async function d(i) {
2003
+ ), { t: y } = ye();
2004
+ async function u(d) {
1997
2005
  h.value = [], k.value = [], f.value = [];
1998
2006
  try {
1999
2007
  c.value = !0;
2000
2008
  const [p] = await Promise.all([
2001
- un(i),
2009
+ un(d),
2002
2010
  // fake buffer
2003
2011
  new Promise(($) => setTimeout($, 1e3))
2004
2012
  ]), _ = p.SheetNames.find(($) => $);
@@ -2029,14 +2037,14 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2029
2037
  }), c.value = !1;
2030
2038
  }
2031
2039
  }
2032
- return Tt(o, (i) => {
2033
- i && d(i);
2034
- }), (i, p) => {
2035
- const _ = M("FmCircularProgress"), I = M("FmIcon"), $ = M("FmButton");
2040
+ return Tt(o, (d) => {
2041
+ d && u(d);
2042
+ }), (d, p) => {
2043
+ const _ = A("FmCircularProgress"), I = A("FmIcon"), $ = A("FmButton");
2036
2044
  return v(), F("div", ul, [
2037
2045
  s("div", cl, U(a(y)("inventory.ingredient.import.uploadDescription")), 1),
2038
2046
  m(dn, {
2039
- class: te({
2047
+ class: ne({
2040
2048
  "w-full": !0,
2041
2049
  "h-[200px]": !o.value
2042
2050
  }),
@@ -2050,7 +2058,7 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2050
2058
  fn: T(({ openFileDialog: g }) => [
2051
2059
  s("div", ml, [
2052
2060
  s("div", {
2053
- class: te([
2061
+ class: ne([
2054
2062
  "fm-corner-radius-md p-16 flex items-center gap-16",
2055
2063
  {
2056
2064
  "border border-fm-color-neutral-gray-100": c.value,
@@ -2070,7 +2078,7 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2070
2078
  color: n.value ? "system-error-300" : void 0
2071
2079
  }, null, 8, ["name", "color"])),
2072
2080
  s("div", {
2073
- class: te([
2081
+ class: ne([
2074
2082
  "fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
2075
2083
  {
2076
2084
  "text-fm-color-typo-disabled": c.value,
@@ -2090,7 +2098,7 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2090
2098
  ]))
2091
2099
  ], 2),
2092
2100
  h.value.length ? (v(), F("div", fl, [
2093
- (v(!0), F(X, null, ue(h.value, (D, C) => (v(), F("div", {
2101
+ (v(!0), F(ee, null, ce(h.value, (D, C) => (v(), F("div", {
2094
2102
  key: C,
2095
2103
  class: "flex gap-8 items-center"
2096
2104
  }, [
@@ -2109,14 +2117,14 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2109
2117
  ]), 1032, ["class", "label", "button-label"]),
2110
2118
  r.value ? (v(), F("div", gl, [
2111
2119
  s("div", bl, U(a(y)("inventory.ingredient.import.summary")), 1),
2112
- (v(!0), F(X, null, ue(k.value, (g) => (v(), z(wt, {
2120
+ (v(!0), F(ee, null, ce(k.value, (g) => (v(), z(wt, {
2113
2121
  key: g.sku._id,
2114
2122
  code: g.sku.code,
2115
2123
  name: g.sku.name,
2116
2124
  errors: g.errors,
2117
2125
  type: "create"
2118
2126
  }, null, 8, ["code", "name", "errors"]))), 128)),
2119
- (v(!0), F(X, null, ue(f.value, (g) => (v(), z(wt, {
2127
+ (v(!0), F(ee, null, ce(f.value, (g) => (v(), z(wt, {
2120
2128
  key: g.sku._id,
2121
2129
  code: g.sku.code,
2122
2130
  name: g.sku.name,
@@ -2130,10 +2138,10 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2130
2138
  }), _l = {
2131
2139
  key: 0,
2132
2140
  class: "flex items-center gap-1"
2133
- }, xl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, kl = { class: "flex flex-col py-8" }, wl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Tl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ll = /* @__PURE__ */ pe({
2141
+ }, xl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, kl = { class: "flex flex-col py-8" }, wl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Tl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ll = /* @__PURE__ */ ve({
2134
2142
  __name: "IngredientsView",
2135
- setup(u) {
2136
- const o = ve(), b = Ee(), l = w(() => [
2143
+ setup(i) {
2144
+ const o = fe(), b = Ee(), l = w(() => [
2137
2145
  {
2138
2146
  type: "string",
2139
2147
  key: "skuCode",
@@ -2168,7 +2176,7 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2168
2176
  if (!c.value)
2169
2177
  return o.skus;
2170
2178
  const P = cn.build(c.value);
2171
- return o.skus.filter((x) => b.isEnabled && ne.value && h.value && !h.value.has(x._id) ? !1 : mn(
2179
+ return o.skus.filter((x) => b.isEnabled && Q.value && h.value && !h.value.has(x._id) ? !1 : mn(
2172
2180
  {
2173
2181
  skuCode: x.code,
2174
2182
  skuUnitAbbrev: x.unit.abbrev,
@@ -2176,29 +2184,29 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2176
2184
  },
2177
2185
  P
2178
2186
  ));
2179
- }), f = pn(), n = De(), r = $n(), y = Ae(), { t: d } = fe(), { createIngredient: i, updateIngredient: p } = Ke(), { ingredientDialogProps: _, ingredientViewLoading: I } = Tn(Ke()), { columnDefs: $ } = qn();
2187
+ }), f = pn(), n = De(), r = $n(), y = Me(), { t: u } = ye(), { createIngredient: d, updateIngredient: p } = Ke(), { ingredientDialogProps: _, ingredientViewLoading: I } = Tn(Ke()), { columnDefs: $ } = qn();
2180
2188
  function g(P) {
2181
2189
  switch (P) {
2182
2190
  case "add":
2183
- return b.isEnabled ? void 0 : i();
2191
+ return b.isEnabled ? void 0 : d();
2184
2192
  case "import":
2185
2193
  return B();
2186
2194
  case "export":
2187
2195
  return V();
2188
2196
  }
2189
2197
  }
2190
- const D = N(""), C = N(!1), ye = w(() => C.value || I.value), ne = N(!0), { breakpoints: ce } = _n(), oe = w(() => ce.value.xs || ce.value.sm), le = w(() => oe.value ? 10 : 20), ee = vn(), se = N(!1), ge = [
2198
+ const D = N(""), C = N(!1), le = w(() => C.value || I.value), Q = N(!0), { breakpoints: me } = _n(), oe = w(() => me.value.xs || me.value.sm), se = w(() => oe.value ? 10 : 20), te = vn(), ae = N(!1), ge = [
2191
2199
  {
2192
2200
  value: "import",
2193
- label: d("common.import")
2201
+ label: u("common.import")
2194
2202
  },
2195
2203
  {
2196
2204
  value: "export",
2197
- label: d("common.export")
2205
+ label: u("common.export")
2198
2206
  }
2199
2207
  ];
2200
2208
  function be(P) {
2201
- switch (se.value = !1, P) {
2209
+ switch (ae.value = !1, P) {
2202
2210
  case "import":
2203
2211
  return B();
2204
2212
  case "export":
@@ -2208,62 +2216,62 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2208
2216
  const Te = w(() => [
2209
2217
  ...b.isEnabled ? [] : [
2210
2218
  {
2211
- label: d("inventory.ingredient.create.title"),
2219
+ label: u("inventory.ingredient.create.title"),
2212
2220
  value: "add",
2213
2221
  isPrimary: !0,
2214
2222
  prependIcon: "add"
2215
2223
  }
2216
2224
  ],
2217
- { label: d("common.import"), value: "import" },
2218
- { label: d("common.export"), value: "export" }
2225
+ { label: u("common.import"), value: "import" },
2226
+ { label: u("common.export"), value: "export" }
2219
2227
  ]);
2220
2228
  function V() {
2221
2229
  const P = tl();
2222
2230
  y.open({
2223
- title: d("inventory.ingredient.export.success"),
2224
- message: d("inventory.ingredient.export.filename", [P]),
2231
+ title: u("inventory.ingredient.export.success"),
2232
+ message: u("inventory.ingredient.export.filename", [P]),
2225
2233
  type: "success"
2226
2234
  });
2227
2235
  }
2228
2236
  function B() {
2229
2237
  n.open({
2230
- title: d("inventory.ingredient.import.title"),
2238
+ title: u("inventory.ingredient.import.title"),
2231
2239
  contentComponent: hl,
2232
2240
  overlay: !0,
2233
2241
  closeButton: !0,
2234
2242
  primaryActions: {
2235
- text: d("common.import"),
2243
+ text: u("common.import"),
2236
2244
  close: !1
2237
2245
  },
2238
2246
  secondaryActions: {
2239
- text: d("common.close"),
2247
+ text: u("common.close"),
2240
2248
  close: !0
2241
2249
  },
2242
2250
  tertiaryActions: {
2243
- text: d("inventory.ingredient.import.actions.downloadTemplate"),
2251
+ text: u("inventory.ingredient.import.actions.downloadTemplate"),
2244
2252
  close: !1,
2245
2253
  variant: "plain"
2246
2254
  }
2247
2255
  }).onPrimary((P) => {
2248
2256
  if (!P) {
2249
2257
  y.open({
2250
- title: d("inventory.ingredient.import.error.noData"),
2258
+ title: u("inventory.ingredient.import.error.noData"),
2251
2259
  type: "error"
2252
2260
  });
2253
2261
  return;
2254
2262
  }
2255
2263
  if (!P.importCreateResult.length && !P.importUpdateResult.length) {
2256
2264
  y.open({
2257
- title: d("inventory.ingredient.import.error.invalidContent"),
2258
- message: d("inventory.ingredient.import.error.noImportData"),
2265
+ title: u("inventory.ingredient.import.error.invalidContent"),
2266
+ message: u("inventory.ingredient.import.error.noImportData"),
2259
2267
  type: "error"
2260
2268
  });
2261
2269
  return;
2262
2270
  }
2263
2271
  if (P.importCreateResult.some((x) => x.errors.length) || P.importUpdateResult.some((x) => x.errors.length)) {
2264
2272
  y.open({
2265
- title: d("inventory.ingredient.import.error.invalidContent"),
2266
- message: d("inventory.ingredient.import.error.hasErrors"),
2273
+ title: u("inventory.ingredient.import.error.invalidContent"),
2274
+ message: u("inventory.ingredient.import.error.hasErrors"),
2267
2275
  type: "error"
2268
2276
  });
2269
2277
  return;
@@ -2279,16 +2287,16 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2279
2287
  ...P.importUpdateResult.map(({ sku: R }) => ({ type: "update", sku: R }))
2280
2288
  ], H = 100;
2281
2289
  let K = 0;
2282
- const me = () => {
2290
+ const pe = () => {
2283
2291
  K += H, y.open({
2284
- title: d("inventory.ingredient.import.progress", [
2292
+ title: u("inventory.ingredient.import.progress", [
2285
2293
  Math.min(K, x.length),
2286
2294
  x.length
2287
2295
  ])
2288
2296
  });
2289
2297
  }, J = new Array();
2290
2298
  for (const R of x.chunk(100)) {
2291
- me();
2299
+ pe();
2292
2300
  try {
2293
2301
  const O = await o.importSkus({
2294
2302
  create: R.filter((Y) => Y.type === "create").map((Y) => Y.sku),
@@ -2298,7 +2306,7 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2298
2306
  } catch (O) {
2299
2307
  J.push(
2300
2308
  ...R.map((Y) => {
2301
- const de = {
2309
+ const ue = {
2302
2310
  module: bn.enum.sku,
2303
2311
  _id: Y.sku._id,
2304
2312
  name: Y.sku.name,
@@ -2306,24 +2314,24 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2306
2314
  };
2307
2315
  return {
2308
2316
  data: Y.sku,
2309
- error: [de]
2317
+ error: [ue]
2310
2318
  };
2311
2319
  })
2312
2320
  );
2313
2321
  }
2314
2322
  }
2315
2323
  y.open({
2316
- title: d("inventory.ingredient.import.success"),
2324
+ title: u("inventory.ingredient.import.success"),
2317
2325
  type: "success"
2318
2326
  }), J.length && r.alert(
2319
2327
  "Some operation failed",
2320
- Z(
2328
+ X(
2321
2329
  "div",
2322
2330
  { class: "flex flex-col gap-8" },
2323
2331
  J.map(
2324
- (R) => Z("div", { class: "flex flex-col" }, [
2325
- Z("div", { class: "fm-typo-en-body-lg-600" }, `(${R.data.code}) ${R.data.name}`),
2326
- Z(
2332
+ (R) => X("div", { class: "flex flex-col" }, [
2333
+ X("div", { class: "fm-typo-en-body-lg-600" }, `(${R.data.code}) ${R.data.name}`),
2334
+ X(
2327
2335
  "div",
2328
2336
  { class: "fm-typo-en-body-lg-400" },
2329
2337
  `${R.error.map((O) => (O == null ? void 0 : O.message) ?? "Unknown error").join(", ")}`
@@ -2334,8 +2342,8 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2334
2342
  );
2335
2343
  } catch (x) {
2336
2344
  y.open({
2337
- title: d("inventory.ingredient.import.error.failed"),
2338
- message: d("inventory.ingredient.import.error.systemMessage", [x == null ? void 0 : x.message]),
2345
+ title: u("inventory.ingredient.import.error.failed"),
2346
+ message: u("inventory.ingredient.import.error.systemMessage", [x == null ? void 0 : x.message]),
2339
2347
  type: "error"
2340
2348
  }), console.error("Error in importing skus", P, x);
2341
2349
  } finally {
@@ -2343,15 +2351,15 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2343
2351
  }
2344
2352
  }
2345
2353
  return (P, x) => {
2346
- const H = M("FmSwitch"), K = M("FmTable"), me = M("FmCollapsibleTabs"), J = M("FmBottomSheet");
2354
+ const H = A("FmSwitch"), K = A("FmTable"), pe = A("FmCollapsibleTabs"), J = A("FmBottomSheet");
2347
2355
  return v(), z(fn, {
2348
- title: a(d)("inventory.ingredient.title"),
2356
+ title: a(u)("inventory.ingredient.title"),
2349
2357
  actions: Te.value,
2350
2358
  "onClick:action": g
2351
2359
  }, {
2352
2360
  default: T(() => [
2353
2361
  s("div", {
2354
- class: te([
2362
+ class: ne([
2355
2363
  "flex flex-col gap-8 max-h-full",
2356
2364
  {
2357
2365
  "p-0": oe.value,
@@ -2370,13 +2378,13 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2370
2378
  }, {
2371
2379
  default: T(() => [
2372
2380
  a(b).isEnabled ? (v(), F("div", _l, [
2373
- s("span", xl, U(a(d)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2381
+ s("span", xl, U(a(u)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2374
2382
  m(Sn),
2375
2383
  m(Ge, null, {
2376
2384
  default: T(() => [
2377
2385
  m(H, {
2378
- modelValue: ne.value,
2379
- "onUpdate:modelValue": x[0] || (x[0] = (R) => ne.value = R)
2386
+ modelValue: Q.value,
2387
+ "onUpdate:modelValue": x[0] || (x[0] = (R) => Q.value = R)
2380
2388
  }, null, 8, ["modelValue"])
2381
2389
  ]),
2382
2390
  _: 1
@@ -2387,17 +2395,17 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2387
2395
  }, 8, ["search", "filter-attributes", "filter"]),
2388
2396
  (v(), z(K, {
2389
2397
  key: JSON.stringify(c.value),
2390
- style: qt(a(ee).tableHeight),
2398
+ style: qt(a(te).tableHeight),
2391
2399
  "column-defs": a($),
2392
2400
  "row-data": k.value,
2393
2401
  "search-value": D.value,
2394
2402
  columnVisibility: {
2395
2403
  netsuiteSubsidiary: a(b).isEnabled
2396
2404
  },
2397
- loading: (!a(f)._currentLocation || ye.value) && a(b).isReady,
2405
+ loading: (!a(f)._currentLocation || le.value) && a(b).isReady,
2398
2406
  "loading-text": "Loading",
2399
2407
  onRowClick: x[3] || (x[3] = (R) => a(p)(R.original)),
2400
- "page-size": le.value
2408
+ "page-size": se.value
2401
2409
  }, {
2402
2410
  "list-row": T((R) => [
2403
2411
  m(gn, {
@@ -2405,19 +2413,19 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2405
2413
  onRowClick: a(p)
2406
2414
  }, Vt({
2407
2415
  default: T((O) => {
2408
- var Y, de, Ve, xe, Me, Ue, Pe, he, ae, Se;
2416
+ var Y, ue, Ve, xe, Ae, Ue, Pe, he, re, Se;
2409
2417
  return [
2410
2418
  s("div", kl, [
2411
2419
  s("div", wl, [
2412
2420
  m(a(ht), {
2413
- render: (Ve = (de = (Y = O.code) == null ? void 0 : Y.column) == null ? void 0 : de.columnDef) == null ? void 0 : Ve.cell,
2414
- props: (Me = (xe = O.code) == null ? void 0 : xe.getContext) == null ? void 0 : Me.call(xe)
2421
+ render: (Ve = (ue = (Y = O.code) == null ? void 0 : Y.column) == null ? void 0 : ue.columnDef) == null ? void 0 : Ve.cell,
2422
+ props: (Ae = (xe = O.code) == null ? void 0 : xe.getContext) == null ? void 0 : Ae.call(xe)
2415
2423
  }, null, 8, ["render", "props"])
2416
2424
  ]),
2417
2425
  s("div", Tl, [
2418
2426
  m(a(ht), {
2419
2427
  render: (he = (Pe = (Ue = O.name) == null ? void 0 : Ue.column) == null ? void 0 : Pe.columnDef) == null ? void 0 : he.cell,
2420
- props: (Se = (ae = O.name) == null ? void 0 : ae.getContext) == null ? void 0 : Se.call(ae)
2428
+ props: (Se = (re = O.name) == null ? void 0 : re.getContext) == null ? void 0 : Se.call(re)
2421
2429
  }, null, 8, ["render", "props"])
2422
2430
  ])
2423
2431
  ])
@@ -2428,7 +2436,7 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2428
2436
  C.value ? {
2429
2437
  name: "loading-text",
2430
2438
  fn: T(() => [
2431
- s("div", null, U(a(d)("inventory.ingredient.table.importing")), 1)
2439
+ s("div", null, U(a(u)("inventory.ingredient.table.importing")), 1)
2432
2440
  ]),
2433
2441
  key: "0"
2434
2442
  } : void 0
@@ -2443,11 +2451,11 @@ const sl = { class: "flex items-center gap-12 pl-8" }, al = { class: "flex flex-
2443
2451
  (v(), z(pt, { to: "body" }, [
2444
2452
  m(J, {
2445
2453
  "dismiss-away": "",
2446
- modelValue: se.value,
2447
- "onUpdate:modelValue": x[5] || (x[5] = (R) => se.value = R)
2454
+ modelValue: ae.value,
2455
+ "onUpdate:modelValue": x[5] || (x[5] = (R) => ae.value = R)
2448
2456
  }, {
2449
2457
  default: T(() => [
2450
- m(me, {
2458
+ m(pe, {
2451
2459
  class: "pb-8",
2452
2460
  items: ge,
2453
2461
  "onUpdate:modelValue": x[4] || (x[4] = (R) => be(R))