@feedmepos/mf-inventory-portal 0.0.25-dev.35 → 0.0.25-dev.37

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 (60) hide show
  1. package/dist/App-C0_9-oDP.js +277 -0
  2. package/dist/{ApprovalView-lHxxupqD.js → ApprovalView-BDUbQAH0.js} +12 -18
  3. package/dist/{BindingsDialog-BYXxxF3D.js → BindingsDialog-BvKDyWAP.js} +4 -4
  4. package/dist/{BindingsPicker-BiOmhG63.js → BindingsPicker-zAexcP3H.js} +5 -5
  5. package/dist/{BindingsTable-C2CG0Wzx.js → BindingsTable-6dPndhbk.js} +5 -5
  6. package/dist/{ClosingDraftView-BO8Fg9uW.js → ClosingDraftView-NwwxcHA-.js} +2 -2
  7. package/dist/{ClosingTemplateView-DmBvstOM.js → ClosingTemplateView-Cfh0BZXH.js} +2 -2
  8. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DKxW0e2c.js +211 -0
  9. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CQB9QYnf.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CD0p0eOE.js} +1 -1
  10. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DditohRx.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-eGofs51J.js} +1 -1
  11. package/dist/{IngredientGroupView-D5SpwtqP.js → IngredientGroupView-Cz4zcWgF.js} +1 -1
  12. package/dist/{IngredientsView-Dgw0nCeT.js → IngredientsView-Ctmor1Ds.js} +622 -605
  13. package/dist/{IntegrationView-BPkBh8lR.js → IntegrationView-DYV2ISmc.js} +23 -23
  14. package/dist/{InventoryBindingForm-COpLVAaA.js → InventoryBindingForm-Be75Cpzd.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BkyQOb8e.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-D8dK7h0Z.js} +11 -11
  16. package/dist/{InventoryBindingSummary-D6lmFeFs.js → InventoryBindingSummary-Cw1Woc3L.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BKzL_obr.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BhKk5nMz.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CRrDyI6N.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DECtXs-3.js} +1 -1
  19. package/dist/{PublishView-DRLVREhD.js → PublishView-D9mnP1d8.js} +11 -11
  20. package/dist/{PurchaseOrderPrintPreview-DvaJAeNk.js → PurchaseOrderPrintPreview-2DOgQczG.js} +1 -1
  21. package/dist/ReceiveRequestView-Ss803mII.js +2547 -0
  22. package/dist/{RecipeView-BFVpv5zA.js → RecipeView-DTwkk7M_.js} +3 -3
  23. package/dist/{StockView-BOzx7POz.js → StockView-cd047f5L.js} +7 -7
  24. package/dist/{SupplierView-DA3-b1sK.js → SupplierView-CkYiC3sV.js} +4 -4
  25. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CE3vSlpG.js +1540 -0
  26. package/dist/{TransferTemplateView-V4C_flzB.js → TransferTemplateView-C6-6Db2r.js} +7 -7
  27. package/dist/{UnitView-CfQSRLN9.js → UnitView-C-1I-kVv.js} +3 -3
  28. package/dist/{WarehouseView-B5mEXts4.js → WarehouseView-CJTtNzco.js} +1 -1
  29. package/dist/api/purchase-order.d.ts +2 -2
  30. package/dist/{app-tDCjbNqA.js → app-C720GM9g.js} +6632 -6672
  31. package/dist/app.js +1 -1
  32. package/dist/components/FmMultiselectDialog.d.ts +1 -24
  33. package/dist/{decimal-BXNZd-qR.js → decimal-BCdHyq3s.js} +1 -1
  34. package/dist/{feature-RoIIaF13.js → feature-Df0TfAlQ.js} +227 -231
  35. package/dist/{format-unit-display-B2P_1U8-.js → format-unit-display-DhVGfJ3A.js} +2 -2
  36. package/dist/{index-0DbWAreR.js → index-BcO0U3XD.js} +2 -2
  37. package/dist/{stock-BkYwqicV.js → stock-AgQ9Kd12.js} +1 -1
  38. package/dist/stores/feature.d.ts +2 -3
  39. package/dist/{supplier-2qlZME6l.js → supplier-y6wN-U1P.js} +1 -1
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/{use-ingredient-select-dialog-D9bLhIPr.js → use-ingredient-select-dialog-DedAlRiZ.js} +1 -1
  42. package/dist/{use-inventory-binding-dialog-FprlSH51.js → use-inventory-binding-dialog-D6ESCCxB.js} +1 -1
  43. package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +0 -1375
  44. package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +1 -3
  45. package/dist/views/receive-request/components/transfer-dialog/TransferDialogProps.d.ts +0 -3
  46. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +3022 -0
  47. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +2 -1
  48. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +1 -0
  49. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +9 -27
  50. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +9 -22
  51. package/dist/views/receive-request/helper/print-po.d.ts +2 -9
  52. package/dist/{vue-i18n-C2CwX0tc.js → vue-i18n-C4yPgaCz.js} +397 -397
  53. package/package.json +1 -1
  54. package/dist/App-DPw6U_NJ.js +0 -280
  55. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CJ7BgFh6.js +0 -215
  56. package/dist/ReceiveRequestView-C9Hqtit6.js +0 -2661
  57. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DRUroMZS.js +0 -1843
  58. package/dist/components/MountListener.vue.d.ts +0 -15
  59. package/dist/views/receive-request/helper/po-to-po-template.util.d.ts +0 -1
  60. package/dist/views/transfer-template/helpers/location-to-po-supplier.util.d.ts +0 -75
@@ -1,65 +1,65 @@
1
- import { ref as j, defineComponent as oe, computed as S, resolveComponent as C, openBlock as f, createBlock as B, withCtx as V, createVNode as p, unref as m, createElementBlock as A, Fragment as Q, createElementVNode as u, createCommentVNode as Y, renderSlot as ce, createTextVNode as Ie, toDisplayString as D, normalizeClass as X, onMounted as ot, watch as Oe, renderList as de, isRef as De, createSlots as qe, normalizeStyle as lt, Teleport as Pe, normalizeProps as at, guardReactiveProps as rt } from "vue";
2
- import { a as le, d as K, e as Ge, S as st, f as it, D as Be, h as fe, A as ge, b as Me, i as We, j as be, t as Ke, k as pe, l as xe, U as dt, m as ut, M as mt, n as Ne, C as ke, o as Le, p as Ze, q as ct, r as Je, s as pt, v as vt, I as ft, w as yt, x as gt, u as bt, y as ht, _ as _t, z as xt, B as kt, E as ze } from "./app-tDCjbNqA.js";
3
- import { useDialog as Qe, useSnackbar as he, useProxiedModel as He, useDialogChild as Vt, useBreakpoints as St } from "@feedmepos/ui-library";
4
- import { i as Ct, _ as wt } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
- import { useI18n as ae, useCoreStore as ve } from "@feedmepos/mf-common";
6
- import { defineStore as Ft, storeToRefs as It } from "pinia";
7
- import { g as Mt, _ as Ve, S as Se } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
8
- import { _ as $t } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-BkyQOb8e.js";
9
- import { _ as Ce } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-DditohRx.js";
10
- import { u as Xe } from "./feature-RoIIaF13.js";
11
- import { _ as we } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
12
- import { _ as Et } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
1
+ import { ref as Y, defineComponent as ne, computed as S, resolveComponent as C, openBlock as f, createBlock as P, withCtx as V, createVNode as c, unref as d, createElementBlock as T, Fragment as X, createElementVNode as m, createCommentVNode as O, renderSlot as pe, createTextVNode as $e, toDisplayString as A, normalizeClass as ee, onMounted as rt, watch as Ge, renderList as ie, isRef as Be, createSlots as We, normalizeStyle as st, Teleport as Ne, normalizeProps as it, guardReactiveProps as dt } from "vue";
2
+ import { a as oe, d as W, e as Ke, S as ut, f as mt, D as ze, h as he, A as _e, b as Ee, i as Ze, j as xe, t as Je, k as fe, l as Ve, U as ct, m as pt, M as vt, n as Le, C as Se, o as He, p as Qe, q as ft, r as Xe, s as yt, v as gt, I as bt, w as ht, x as _t, u as xt, y as kt, _ as Vt, z as St, B as Ct, E as Oe } from "./app-C720GM9g.js";
3
+ import { useDialog as et, useSnackbar as ke, useProxiedModel as Ye, useDialogChild as wt, useBreakpoints as Ft } from "@feedmepos/ui-library";
4
+ import { i as Mt, _ as It } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
+ import { useI18n as le, useCoreStore as ye } from "@feedmepos/mf-common";
6
+ import { defineStore as $t, storeToRefs as Et } from "pinia";
7
+ import { g as Ut, _ as Ce, S as we } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
8
+ import { _ as Rt } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-D8dK7h0Z.js";
9
+ import { _ as Fe } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-eGofs51J.js";
10
+ import { u as tt } from "./feature-Df0TfAlQ.js";
11
+ import { _ as Me } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
12
+ import { _ as Tt } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
13
13
  import "./array-hChJVZLE.js";
14
- const Fe = Ft("ingredientForm", function() {
15
- const o = Qe(), y = he(), s = le(), n = j(!1), { t: l } = ae(), i = j();
14
+ const Ie = $t("ingredientForm", function() {
15
+ const o = et(), y = ke(), r = oe(), n = Y(!1), { t: l } = le(), i = Y();
16
16
  function a() {
17
17
  const b = {
18
18
  unit: {},
19
- mode: K.CREATE,
19
+ mode: W.CREATE,
20
20
  show: !0,
21
- "onUpdate:show"(r) {
22
- i.value.show = r;
21
+ "onUpdate:show"(s) {
22
+ i.value.show = s;
23
23
  }
24
24
  };
25
25
  i.value = b;
26
26
  }
27
27
  async function h(b) {
28
- const r = {
29
- unit: Ge(b),
30
- mode: K.UPDATE,
28
+ const s = {
29
+ unit: Ke(b),
30
+ mode: W.UPDATE,
31
31
  show: !0,
32
32
  "onUpdate:show"(_) {
33
33
  i.value.show = _;
34
34
  }
35
35
  };
36
- i.value = r;
36
+ i.value = s;
37
37
  }
38
38
  async function k(b) {
39
39
  n.value = !0;
40
40
  try {
41
- await s.deleteSku(b), y.open({
41
+ await r.deleteSku(b), y.open({
42
42
  title: "Success",
43
43
  message: `Deleted ${b.name}`,
44
44
  type: "success"
45
45
  });
46
- } catch (r) {
47
- r instanceof st && Ct(r) ? o.open({
46
+ } catch (s) {
47
+ s instanceof ut && Mt(s) ? o.open({
48
48
  title: "Cannot delete ingredient",
49
- contentComponent: wt,
49
+ contentComponent: It,
50
50
  contentComponentProps: {
51
51
  subject: (b == null ? void 0 : b.name) ?? "",
52
- items: r.errorResponse.message
52
+ items: s.errorResponse.message
53
53
  },
54
54
  secondaryActions: {
55
55
  text: "Close",
56
56
  close: !0
57
57
  }
58
- }) : console.log("unable to delete ingredient", r), y.open({
58
+ }) : console.log("unable to delete ingredient", s), y.open({
59
59
  title: `Cannot delete ${b.name}`,
60
60
  message: "Please try again.",
61
61
  type: "error"
62
- }), console.error("failed to delete ingredient", r);
62
+ }), console.error("failed to delete ingredient", s);
63
63
  } finally {
64
64
  n.value = !1;
65
65
  }
@@ -88,15 +88,15 @@ const Fe = Ft("ingredientForm", function() {
88
88
  ingredientViewLoading: n
89
89
  };
90
90
  });
91
- function Ut() {
92
- const { updateIngredient: d, deleteIngredient: o } = Fe(), { t: y } = ae();
93
- async function s(l, i) {
94
- const a = Ge(i);
95
- if (l === fe.Edit) {
96
- await d(a);
91
+ function At() {
92
+ const { updateIngredient: u, deleteIngredient: o } = Ie(), { t: y } = le();
93
+ async function r(l, i) {
94
+ const a = Ke(i);
95
+ if (l === he.Edit) {
96
+ await u(a);
97
97
  return;
98
98
  }
99
- if (l === fe.Delete) {
99
+ if (l === he.Delete) {
100
100
  await o(a);
101
101
  return;
102
102
  }
@@ -136,10 +136,10 @@ function Ut() {
136
136
  id: "action",
137
137
  header: "",
138
138
  cell(l) {
139
- return it(
140
- [Be[fe.Edit], Be[fe.Delete]],
139
+ return mt(
140
+ [ze[he.Edit], ze[he.Delete]],
141
141
  (i) => {
142
- s(i, l.row.original);
142
+ r(i, l.row.original);
143
143
  }
144
144
  );
145
145
  },
@@ -152,7 +152,7 @@ function Ut() {
152
152
  }
153
153
  ] };
154
154
  }
155
- const Rt = /* @__PURE__ */ oe({
155
+ const Dt = /* @__PURE__ */ ne({
156
156
  __name: "ConvertForm",
157
157
  props: {
158
158
  modelValue: {},
@@ -161,74 +161,74 @@ const Rt = /* @__PURE__ */ oe({
161
161
  readonly: { type: Boolean }
162
162
  },
163
163
  emits: ["update:modelValue"],
164
- setup(d, { emit: o }) {
165
- const y = d, s = S(() => {
166
- var r;
167
- return (r = y.rootValue) == null ? void 0 : r.unit;
164
+ setup(u, { emit: o }) {
165
+ const y = u, r = S(() => {
166
+ var s;
167
+ return (s = y.rootValue) == null ? void 0 : s.unit;
168
168
  }), n = S(() => {
169
- var r;
170
- return (r = y.rootValue) == null ? void 0 : r._id;
171
- }), l = o, { t: i } = ae(), a = S({
169
+ var s;
170
+ return (s = y.rootValue) == null ? void 0 : s._id;
171
+ }), l = o, { t: i } = le(), a = S({
172
172
  get() {
173
173
  return !!y.modelValue;
174
174
  },
175
- set(r) {
176
- r ? l("update:modelValue", {
175
+ set(s) {
176
+ s ? l("update:modelValue", {
177
177
  measurement: null,
178
178
  inventoryBindings: []
179
179
  }) : l("update:modelValue", null);
180
180
  }
181
- }), h = S(() => Mt(s.value));
182
- function k(r) {
181
+ }), h = S(() => Ut(r.value));
182
+ function k(s) {
183
183
  const _ = y.modelValue ?? {};
184
- _.measurement = r ? `${r}` : null, l("update:modelValue", _);
184
+ _.measurement = s ? `${s}` : null, l("update:modelValue", _);
185
185
  }
186
- function g(r) {
186
+ function g(s) {
187
187
  const _ = y.modelValue ?? {};
188
- _.inventoryBindings = r, l("update:modelValue", _);
188
+ _.inventoryBindings = s, l("update:modelValue", _);
189
189
  }
190
190
  const b = S(() => {
191
191
  if (!y.modelValue) return null;
192
- const r = y.modelValue;
193
- return r.measurement ? h.value.find((_) => _.value === r.measurement) ?? null : h.value.find((_) => _.value === null) ?? null;
192
+ const s = y.modelValue;
193
+ return s.measurement ? h.value.find((_) => _.value === s.measurement) ?? null : h.value.find((_) => _.value === null) ?? null;
194
194
  });
195
- return (r, _) => {
196
- const U = C("FmSwitch"), I = C("FmSelect"), N = C("FmCard");
197
- return f(), B(N, {
195
+ return (s, _) => {
196
+ const U = C("FmSwitch"), I = C("FmSelect"), B = C("FmCard");
197
+ return f(), P(B, {
198
198
  variant: "outlined",
199
199
  class: "p-16 flex flex-col gap-16"
200
200
  }, {
201
201
  default: V(() => {
202
- var w, v;
202
+ var F, v;
203
203
  return [
204
- p(U, {
204
+ c(U, {
205
205
  value: "",
206
206
  "model-value": a.value,
207
207
  "onUpdate:modelValue": _[0] || (_[0] = (R) => a.value = R),
208
- label: m(i)("inventory.ingredient.convertible.title"),
209
- sublabel: m(i)("inventory.ingredient.convertible.subtitle"),
208
+ label: d(i)("inventory.ingredient.convertible.title"),
209
+ sublabel: d(i)("inventory.ingredient.convertible.subtitle"),
210
210
  labelPlacement: "right",
211
- disabled: r.readonly
211
+ disabled: s.readonly
212
212
  }, null, 8, ["model-value", "label", "sublabel", "disabled"]),
213
- a.value ? (f(), A(Q, { key: 0 }, [
214
- u("div", null, [
215
- p(I, {
216
- label: m(i)("inventory.ingredient.convertible.convertTo"),
217
- modelValue: (w = b.value) == null ? void 0 : w.value,
213
+ a.value ? (f(), T(X, { key: 0 }, [
214
+ m("div", null, [
215
+ c(I, {
216
+ label: d(i)("inventory.ingredient.convertible.convertTo"),
217
+ modelValue: (F = b.value) == null ? void 0 : F.value,
218
218
  "onUpdate:modelValue": k,
219
219
  items: h.value,
220
- disabled: r.readonly
220
+ disabled: s.readonly
221
221
  }, null, 8, ["label", "modelValue", "items", "disabled"])
222
222
  ]),
223
- p($t, {
223
+ c(Rt, {
224
224
  id: n.value,
225
- "model-value": ((v = r.modelValue) == null ? void 0 : v.inventoryBindings) ?? [],
225
+ "model-value": ((v = s.modelValue) == null ? void 0 : v.inventoryBindings) ?? [],
226
226
  "onUpdate:modelValue": g,
227
227
  "exclude-binding-id": n.value,
228
- rules: [m(ge)(1)],
229
- readonly: r.readonly
228
+ rules: [d(_e)(1)],
229
+ readonly: s.readonly
230
230
  }, null, 8, ["id", "model-value", "exclude-binding-id", "rules", "readonly"])
231
- ], 64)) : Y("", !0)
231
+ ], 64)) : O("", !0)
232
232
  ];
233
233
  }),
234
234
  _: 1
@@ -236,16 +236,16 @@ const Rt = /* @__PURE__ */ oe({
236
236
  };
237
237
  }
238
238
  });
239
- function ie() {
239
+ function se() {
240
240
  return {
241
241
  low: 6,
242
242
  mid: 14
243
243
  };
244
244
  }
245
- const Tt = {
245
+ const Pt = {
246
246
  key: 0,
247
247
  class: "flex flex-col gap-4"
248
- }, ye = /* @__PURE__ */ oe({
248
+ }, ve = /* @__PURE__ */ ne({
249
249
  __name: "FmLockableField",
250
250
  props: {
251
251
  locked: { type: Boolean },
@@ -257,68 +257,68 @@ const Tt = {
257
257
  tooltipPlacement: {},
258
258
  tooltipZIndex: {}
259
259
  },
260
- setup(d) {
260
+ setup(u) {
261
261
  return (o, y) => {
262
- const s = C("FmLabel"), n = C("FmIcon"), l = C("FmTooltip"), i = C("FmField");
263
- return o.locked ? (f(), A("div", Tt, [
264
- ce(o.$slots, "label", {}, () => [
265
- p(s, {
262
+ const r = C("FmLabel"), n = C("FmIcon"), l = C("FmTooltip"), i = C("FmField");
263
+ return o.locked ? (f(), T("div", Pt, [
264
+ pe(o.$slots, "label", {}, () => [
265
+ c(r, {
266
266
  label: o.label,
267
267
  disabled: o.disabled
268
268
  }, null, 8, ["label", "disabled"])
269
269
  ]),
270
- ce(o.$slots, "field", {}, () => [
271
- p(i, { disabled: o.disabled }, {
270
+ pe(o.$slots, "field", {}, () => [
271
+ c(i, { disabled: o.disabled }, {
272
272
  prepend: V(() => [
273
- o.tooltipMessage ? (f(), B(l, {
273
+ o.tooltipMessage ? (f(), P(l, {
274
274
  key: 0,
275
275
  placement: o.tooltipPlacement,
276
276
  "z-index": o.tooltipZIndex
277
277
  }, {
278
278
  content: V(() => [
279
- Ie(D(o.tooltipMessage), 1)
279
+ $e(A(o.tooltipMessage), 1)
280
280
  ]),
281
281
  default: V(() => [
282
- p(n, {
282
+ c(n, {
283
283
  name: "lock",
284
284
  color: "neutral-gray-400"
285
285
  })
286
286
  ]),
287
287
  _: 1
288
- }, 8, ["placement", "z-index"])) : (f(), B(n, {
288
+ }, 8, ["placement", "z-index"])) : (f(), P(n, {
289
289
  key: 1,
290
290
  name: "lock",
291
291
  color: "neutral-gray-400"
292
292
  }))
293
293
  ]),
294
294
  default: V(() => [
295
- ce(o.$slots, "modelValue", {}, () => [
296
- u("div", {
297
- class: X([
295
+ pe(o.$slots, "modelValue", {}, () => [
296
+ m("div", {
297
+ class: ee([
298
298
  o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary",
299
299
  "line-clamp-1 text-ellipsis break-all"
300
300
  ])
301
- }, D(o.modelValue), 3)
301
+ }, A(o.modelValue), 3)
302
302
  ])
303
303
  ]),
304
304
  _: 3
305
305
  }, 8, ["disabled"])
306
306
  ]),
307
- ce(o.$slots, "helper-text", {}, () => [
308
- u("div", {
309
- class: X([
307
+ pe(o.$slots, "helper-text", {}, () => [
308
+ m("div", {
309
+ class: ee([
310
310
  "fm-typo-en-body-sm-400 line-clamp-1",
311
311
  o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
312
312
  ])
313
- }, D(o.helperText), 3)
313
+ }, A(o.helperText), 3)
314
314
  ])
315
- ])) : ce(o.$slots, "default", { key: 1 });
315
+ ])) : pe(o.$slots, "default", { key: 1 });
316
316
  };
317
317
  }
318
- }), At = { class: "flex gap-8" }, Dt = { class: "flex-1" }, Pt = { class: "flex-1" }, Bt = { class: "text-fm-color-typo-secondary" }, Nt = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Lt = {
318
+ }), Bt = { class: "flex gap-8" }, Nt = { class: "flex-1" }, zt = { class: "flex-1" }, Lt = { class: "text-fm-color-typo-secondary" }, Ht = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Ot = {
319
319
  key: 2,
320
320
  class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
321
- }, zt = { class: "flex flex-col gap-12" }, Ht = { class: "flex flex-col gap-4" }, Yt = { class: "fm-typo-en-title-sm-600" }, jt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ot = { class: "flex flex-col gap-4" }, qt = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, Gt = { class: "flex-1 p-12 flex flex-col gap-8" }, Wt = { class: "mx-auto" }, Kt = { class: "flex flex-col" }, Zt = { class: "fm-typo-en-body-sm-600 translate-y-4" }, Jt = { class: "flex-1 p-12 flex flex-col gap-8" }, Qt = { class: "mx-auto" }, Xt = { class: "flex flex-col" }, en = { class: "fm-typo-en-body-sm-600 translate-y-4" }, tn = { class: "flex-1 p-12 flex flex-col gap-8" }, nn = { class: "mx-auto" }, on = { class: "flex flex-col" }, ln = { class: "fm-typo-en-body-sm-600 translate-y-4" }, an = /* @__PURE__ */ oe({
321
+ }, Yt = { class: "flex flex-col gap-12" }, jt = { class: "flex flex-col gap-4" }, qt = { class: "fm-typo-en-title-sm-600" }, Gt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Wt = { class: "flex flex-col gap-4" }, Kt = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, Zt = { class: "flex-1 p-12 flex flex-col gap-8" }, Jt = { class: "mx-auto" }, Qt = { class: "flex flex-col" }, Xt = { class: "fm-typo-en-body-sm-600 translate-y-4" }, en = { class: "flex-1 p-12 flex flex-col gap-8" }, tn = { class: "mx-auto" }, nn = { class: "flex flex-col" }, on = { class: "fm-typo-en-body-sm-600 translate-y-4" }, ln = { class: "flex-1 p-12 flex flex-col gap-8" }, an = { class: "mx-auto" }, rn = { class: "flex flex-col" }, sn = { class: "fm-typo-en-body-sm-600 translate-y-4" }, dn = /* @__PURE__ */ ne({
322
322
  __name: "IngredientForm",
323
323
  props: {
324
324
  mode: {},
@@ -326,22 +326,22 @@ const Tt = {
326
326
  disabled: { type: Boolean }
327
327
  },
328
328
  emits: ["update:modelValue", "click:submit"],
329
- setup(d, { expose: o, emit: y }) {
329
+ setup(u, { expose: o, emit: y }) {
330
330
  var me;
331
- const { t: s } = ae(), n = d, l = y, i = le(), a = ve(), h = Xe(), k = Me(), g = S(() => k.isEnabled);
331
+ const { t: r } = le(), n = u, l = y, i = oe(), a = ye(), h = tt(), k = Ee(), g = S(() => k.isEnabled);
332
332
  function b(e) {
333
333
  if (e.length === 0) return;
334
- const t = e[0], c = n.modelValue ?? {
334
+ const t = e[0], p = n.modelValue ?? {
335
335
  unit: i.units.find((x) => x)
336
336
  };
337
- c.unit || (c.unit = t, l("update:modelValue", c));
337
+ p.unit || (p.unit = t, l("update:modelValue", p));
338
338
  }
339
- ot(() => {
339
+ rt(() => {
340
340
  b(i.units);
341
- }), Oe([() => i.units], ([e]) => {
341
+ }), Ge([() => i.units], ([e]) => {
342
342
  b(e);
343
343
  });
344
- function r() {
344
+ function s() {
345
345
  l("click:submit");
346
346
  }
347
347
  const _ = S({
@@ -368,12 +368,12 @@ const Tt = {
368
368
  }
369
369
  }), I = S({
370
370
  get() {
371
- var t, c;
372
- const e = (c = (t = n.modelValue) == null ? void 0 : t.defaultCost) == null ? void 0 : c.costPerUnit;
373
- return e ? +We(e) : 0;
371
+ var t, p;
372
+ const e = (p = (t = n.modelValue) == null ? void 0 : t.defaultCost) == null ? void 0 : p.costPerUnit;
373
+ return e ? +Ze(e) : 0;
374
374
  },
375
375
  set(e) {
376
- var c, x, E, F;
376
+ var p, x, E, w;
377
377
  const t = n.modelValue ? {
378
378
  ...n.modelValue
379
379
  } : {};
@@ -381,72 +381,72 @@ const Tt = {
381
381
  costPerUnit: {
382
382
  amount: 0,
383
383
  precision: 2,
384
- currency: ((c = be(a.currentCountry.value)) == null ? void 0 : c.currency) ?? "MYR"
384
+ currency: ((p = xe(a.currentCountry.value)) == null ? void 0 : p.currency) ?? "MYR"
385
385
  },
386
- measurement: (F = (E = (x = n.modelValue) == null ? void 0 : x.unit) == null ? void 0 : E.measurements) == null ? void 0 : F.find(
387
- (G) => {
388
- var H;
389
- return G.id === ((H = n.modelValue) == null ? void 0 : H.trackingMeasurement);
386
+ measurement: (w = (E = (x = n.modelValue) == null ? void 0 : x.unit) == null ? void 0 : E.measurements) == null ? void 0 : w.find(
387
+ (q) => {
388
+ var Q;
389
+ return q.id === ((Q = n.modelValue) == null ? void 0 : Q.trackingMeasurement);
390
390
  }
391
391
  )
392
392
  }), t.defaultCost.costPerUnit = {
393
393
  ...t.defaultCost.costPerUnit,
394
- ...Ke(+e, 4)
394
+ ...Je(+e, 4)
395
395
  }, l("update:modelValue", t);
396
396
  }
397
- }), N = S(() => {
398
- var t, c, x;
397
+ }), B = S(() => {
398
+ var t, p, x;
399
399
  const e = ((t = n.modelValue) == null ? void 0 : t.unit) ?? i.units.find((E) => E);
400
400
  return e ? {
401
401
  _id: e._id,
402
- measurement: (c = n.modelValue) == null ? void 0 : c.trackingMeasurement,
402
+ measurement: (p = n.modelValue) == null ? void 0 : p.trackingMeasurement,
403
403
  name: ((x = e.measurements.find((E) => {
404
- var F;
405
- return E.id === ((F = n.modelValue) == null ? void 0 : F.trackingMeasurement);
404
+ var w;
405
+ return E.id === ((w = n.modelValue) == null ? void 0 : w.trackingMeasurement);
406
406
  })) == null ? void 0 : x.name) ?? e.name
407
407
  } : null;
408
- }), w = S(
409
- () => i.units.flatMap(({ name: e, _id: t, abbrev: c, measurements: x }) => [
408
+ }), F = S(
409
+ () => i.units.flatMap(({ name: e, _id: t, abbrev: p, measurements: x }) => [
410
410
  {
411
411
  label: `${e}`,
412
412
  value: null,
413
413
  displayAsSection: !0
414
414
  },
415
415
  {
416
- label: `${e} (${c})`,
416
+ label: `${e} (${p})`,
417
417
  value: { _id: t },
418
418
  displayAsSection: !1
419
419
  },
420
- ...x.map(({ id: E, name: F, abbrev: G }) => ({
421
- label: `${F} (${G})`,
420
+ ...x.map(({ id: E, name: w, abbrev: q }) => ({
421
+ label: `${w} (${q})`,
422
422
  value: { _id: t, measurement: E },
423
423
  displayAsSection: !1
424
424
  }))
425
425
  ])
426
426
  );
427
427
  function v(e) {
428
- var t, c, x, E, F;
429
- return ((c = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : c._id) === ((x = e.value) == null ? void 0 : x._id) && ((E = n.modelValue) == null ? void 0 : E.trackingMeasurement) === ((F = e.value) == null ? void 0 : F.measurement);
428
+ var t, p, x, E, w;
429
+ return ((p = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : p._id) === ((x = e.value) == null ? void 0 : x._id) && ((E = n.modelValue) == null ? void 0 : E.trackingMeasurement) === ((w = e.value) == null ? void 0 : w.measurement);
430
430
  }
431
431
  function R(e) {
432
- var G, H;
432
+ var q, Q;
433
433
  if (!e) return;
434
- const { _id: t, measurement: c } = e, x = c || void 0, E = i.units.find((te) => te._id === t);
434
+ const { _id: t, measurement: p } = e, x = p || void 0, E = i.units.find((ce) => ce._id === t);
435
435
  if (!E)
436
436
  return;
437
- const F = n.modelValue ?? {};
438
- F.unit = E, F.trackingMeasurement = x, F.convert && (F.convert.measurement = x || null), h.enableTotalCost && (F.defaultCost = {
439
- measurement: E.measurements.find((te) => te.id === x),
437
+ const w = n.modelValue ?? {};
438
+ w.unit = E, w.trackingMeasurement = x, w.convert && (w.convert.measurement = x || null), h.enableTotalCost && (w.defaultCost = {
439
+ measurement: E.measurements.find((ce) => ce.id === x),
440
440
  costPerUnit: {
441
- ...((G = F.defaultCost) == null ? void 0 : G.costPerUnit) ?? {
441
+ ...((q = w.defaultCost) == null ? void 0 : q.costPerUnit) ?? {
442
442
  amount: 0,
443
443
  precision: 2,
444
- currency: ((H = be(a.currentCountry.value)) == null ? void 0 : H.currency) ?? "MYR"
444
+ currency: ((Q = xe(a.currentCountry.value)) == null ? void 0 : Q.currency) ?? "MYR"
445
445
  }
446
446
  }
447
- }), l("update:modelValue", F);
447
+ }), l("update:modelValue", w);
448
448
  }
449
- const J = S({
449
+ const Z = S({
450
450
  get() {
451
451
  var e;
452
452
  return ((e = n.modelValue) == null ? void 0 : e.convert) ?? null;
@@ -457,13 +457,12 @@ const Tt = {
457
457
  } : {};
458
458
  e ? t.convert = e : t.convert = null, l("update:modelValue", t);
459
459
  }
460
- });
461
- S(() => pe.options.filter(
462
- (e) => e === pe.enum.FIFO || e === pe.enum.WAVG
460
+ }), K = S(() => fe.options.filter(
461
+ (e) => e === fe.enum.FIFO || e === fe.enum.WAVG
463
462
  ).map((e) => ({
464
- label: s(`inventory.ingredient.valuationMethod.${e}`),
463
+ label: r(`inventory.ingredient.valuationMethod.${e}`),
465
464
  value: e
466
- }))), S({
465
+ }))), L = S({
467
466
  get() {
468
467
  var e;
469
468
  return ((e = n.modelValue) == null ? void 0 : e.valuation) ?? "WAVG";
@@ -474,8 +473,7 @@ const Tt = {
474
473
  } : {};
475
474
  t.valuation = e, l("update:modelValue", t);
476
475
  }
477
- });
478
- const Z = S({
476
+ }), j = S({
479
477
  get() {
480
478
  var e;
481
479
  return ((e = n.modelValue) == null ? void 0 : e.customAttributes) ?? {};
@@ -486,155 +484,155 @@ const Tt = {
486
484
  } : {};
487
485
  t.customAttributes = e, l("update:modelValue", t);
488
486
  }
489
- }), L = j();
487
+ }), H = Y();
490
488
  o({
491
489
  validateInputs: () => {
492
490
  var e, t;
493
- (t = (e = L.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
491
+ (t = (e = H.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
494
492
  },
495
493
  resetInputsValidation: () => {
496
494
  var e, t;
497
- (t = (e = L.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
495
+ (t = (e = H.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
498
496
  },
499
497
  resetInputs: () => {
500
498
  var e, t;
501
- (t = (e = L.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
499
+ (t = (e = H.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
502
500
  }
503
501
  });
504
- const z = j(!1), q = S(
502
+ const J = Y(!1), de = S(
505
503
  () => {
506
- var e, t, c;
507
- return (e = n.modelValue) != null && e._id ? ((c = i.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : c.filter(
504
+ var e, t, p;
505
+ return (e = n.modelValue) != null && e._id ? ((p = i.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : p.filter(
508
506
  (x) => x.from === "INGREDIENT"
509
507
  )) ?? [] : [];
510
508
  }
511
- ), ne = S(
509
+ ), ge = S(
512
510
  () => {
513
- var e, t, c;
514
- return (e = n.modelValue) != null && e._id ? ((c = i.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : c.filter(
511
+ var e, t, p;
512
+ return (e = n.modelValue) != null && e._id ? ((p = i.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : p.filter(
515
513
  (x) => x.from === "RECIPE"
516
514
  )) ?? [] : [];
517
515
  }
518
- ), ue = S(
516
+ ), D = S(
519
517
  () => {
520
- var e, t, c;
521
- return (e = n.modelValue) != null && e._id ? ((c = i.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : c.filter((x) => x.from === "MENU")) ?? [] : [];
518
+ var e, t, p;
519
+ return (e = n.modelValue) != null && e._id ? ((p = i.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : p.filter((x) => x.from === "MENU")) ?? [] : [];
522
520
  }
523
- ), _e = S(
521
+ ), $ = S(
524
522
  () => i.skus.map((e) => ({ label: e.name, value: e.code }))
525
- ), P = j((me = n.modelValue) == null ? void 0 : me.code);
526
- function $(e) {
527
- var c;
523
+ ), ue = Y((me = n.modelValue) == null ? void 0 : me.code);
524
+ function ae(e) {
525
+ var p;
528
526
  const t = e.el;
529
- t && ((c = t.querySelector("[x-should-scroll-into=true]")) == null || c.scrollIntoView());
527
+ t && ((p = t.querySelector("[x-should-scroll-into=true]")) == null || p.scrollIntoView());
530
528
  }
531
529
  function re(e) {
532
530
  switch (e) {
533
- case ke.MY:
531
+ case Se.MY:
534
532
  return "MYR";
535
- case ke.SG:
533
+ case Se.SG:
536
534
  return "SGD";
537
- case ke.ID:
535
+ case Se.ID:
538
536
  return "IDR";
539
537
  default:
540
538
  return "MYR";
541
539
  }
542
540
  }
543
- const se = S(
541
+ const N = S(
544
542
  () => {
545
- var e, t, c, x, E, F;
546
- return ((x = (c = (t = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : c.find(
547
- (G) => {
548
- var H;
549
- return G.id === ((H = n.modelValue) == null ? void 0 : H.trackingMeasurement);
543
+ var e, t, p, x, E, w;
544
+ return ((x = (p = (t = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : p.find(
545
+ (q) => {
546
+ var Q;
547
+ return q.id === ((Q = n.modelValue) == null ? void 0 : Q.trackingMeasurement);
550
548
  }
551
- )) == null ? void 0 : x.abbrev) ?? ((F = (E = n.modelValue) == null ? void 0 : E.unit) == null ? void 0 : F.abbrev);
549
+ )) == null ? void 0 : x.abbrev) ?? ((w = (E = n.modelValue) == null ? void 0 : E.unit) == null ? void 0 : w.abbrev);
552
550
  }
553
- ), ee = S({
551
+ ), z = S({
554
552
  get() {
555
553
  var e, t;
556
- return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.low) ?? ie().low;
554
+ return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.low) ?? se().low;
557
555
  },
558
556
  set(e) {
559
557
  var x;
560
- const t = ((x = n.modelValue) == null ? void 0 : x.thresholds) ?? ie();
558
+ const t = ((x = n.modelValue) == null ? void 0 : x.thresholds) ?? se();
561
559
  t.low = e;
562
- const c = n.modelValue ? {
560
+ const p = n.modelValue ? {
563
561
  ...n.modelValue
564
562
  } : {};
565
- c.thresholds = t, l("update:modelValue", c);
563
+ p.thresholds = t, l("update:modelValue", p);
566
564
  }
567
- }), T = S({
565
+ }), te = S({
568
566
  get() {
569
567
  var e, t;
570
- return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ?? ie().mid;
568
+ return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ?? se().mid;
571
569
  },
572
570
  set(e) {
573
571
  var x;
574
- const t = ((x = n.modelValue) == null ? void 0 : x.thresholds) ?? ie();
572
+ const t = ((x = n.modelValue) == null ? void 0 : x.thresholds) ?? se();
575
573
  t.mid = e;
576
- const c = n.modelValue ? {
574
+ const p = n.modelValue ? {
577
575
  ...n.modelValue
578
576
  } : {};
579
- c.thresholds = t, l("update:modelValue", c);
577
+ p.thresholds = t, l("update:modelValue", p);
580
578
  }
581
579
  });
582
- function O() {
580
+ function be() {
583
581
  return function(t) {
584
582
  return typeof (t == null ? void 0 : t.low) != "number" || typeof (t == null ? void 0 : t.mid) != "number" ? "Required" : t.low >= t.mid ? "Days for red indicator should be less than yellow indicator." : !0;
585
583
  };
586
584
  }
587
585
  return (e, t) => {
588
- const c = C("FmTextField"), x = C("FmLabel"), E = C("FmField"), F = C("FmMenuHeader"), G = C("FmMenuDivider"), H = C("FmMenuItem"), te = C("FmMenu"), $e = C("FmFormGroup"), tt = C("FmSwitch"), Ee = C("FmStepperField"), nt = C("FmForm");
589
- return f(), B(nt, {
586
+ const p = C("FmTextField"), x = C("FmLabel"), E = C("FmField"), w = C("FmMenuHeader"), q = C("FmMenuDivider"), Q = C("FmMenuItem"), ce = C("FmMenu"), Ue = C("FmFormGroup"), ot = C("FmSelect"), lt = C("FmSwitch"), Re = C("FmStepperField"), at = C("FmForm");
587
+ return f(), P(at, {
590
588
  disabled: e.disabled,
591
589
  ref_key: "formRef",
592
- ref: L,
590
+ ref: H,
593
591
  class: "flex flex-col gap-32",
594
- onValidationSuccess: r
592
+ onValidationSuccess: s
595
593
  }, {
596
594
  default: V(() => {
597
- var Ue, Re, Te, Ae;
595
+ var Te, Ae, De, Pe;
598
596
  return [
599
- u("div", At, [
600
- u("div", Dt, [
601
- p(ye, {
597
+ m("div", Bt, [
598
+ m("div", Nt, [
599
+ c(ve, {
602
600
  "tooltip-message": "This field is managed by NetSuite",
603
601
  "tooltip-z-index": 50,
604
- label: m(s)("inventory.ingredient.code"),
602
+ label: d(r)("inventory.ingredient.code"),
605
603
  "model-value": _.value,
606
604
  "onUpdate:modelValue": t[1] || (t[1] = (M) => _.value = M),
607
605
  locked: g.value,
608
606
  disabled: e.disabled
609
607
  }, {
610
608
  default: V(() => [
611
- p(c, {
612
- label: m(s)("inventory.ingredient.code"),
609
+ c(p, {
610
+ label: d(r)("inventory.ingredient.code"),
613
611
  "model-value": _.value,
614
612
  "onUpdate:modelValue": t[0] || (t[0] = (M) => _.value = M),
615
- rules: [m(xe)(), m(dt)(_e.value, P.value)],
613
+ rules: [d(Ve)(), d(ct)($.value, ue.value)],
616
614
  "label-mark": "required"
617
615
  }, null, 8, ["label", "model-value", "rules"])
618
616
  ]),
619
617
  _: 1
620
618
  }, 8, ["label", "model-value", "locked", "disabled"])
621
619
  ]),
622
- u("div", Pt, [
623
- p(ye, {
620
+ m("div", zt, [
621
+ c(ve, {
624
622
  "tooltip-message": "This field is managed by NetSuite",
625
623
  "tooltip-z-index": 50,
626
- label: m(s)("inventory.ingredient.name"),
624
+ label: d(r)("inventory.ingredient.name"),
627
625
  "model-value": U.value,
628
626
  "onUpdate:modelValue": t[3] || (t[3] = (M) => U.value = M),
629
627
  locked: g.value,
630
628
  disabled: e.disabled
631
629
  }, {
632
630
  default: V(() => [
633
- p(c, {
634
- label: m(s)("inventory.ingredient.name"),
631
+ c(p, {
632
+ label: d(r)("inventory.ingredient.name"),
635
633
  "model-value": U.value,
636
634
  "onUpdate:modelValue": t[2] || (t[2] = (M) => U.value = M),
637
- rules: [m(xe)()],
635
+ rules: [d(Ve)()],
638
636
  "label-mark": "required"
639
637
  }, null, 8, ["label", "model-value", "rules"])
640
638
  ]),
@@ -642,31 +640,31 @@ const Tt = {
642
640
  }, 8, ["label", "model-value", "locked", "disabled"])
643
641
  ])
644
642
  ]),
645
- p(ye, {
643
+ c(ve, {
646
644
  "tooltip-message": "This field is managed by NetSuite",
647
645
  "tooltip-z-index": 50,
648
- label: m(s)("inventory.ingredient.unit"),
649
- "helper-text": (Ue = e.modelValue) != null && Ue.trackingMeasurement ? `Base unit: ${(Te = (Re = e.modelValue) == null ? void 0 : Re.unit) == null ? void 0 : Te.name}` : void 0,
650
- "model-value": (Ae = N.value) == null ? void 0 : Ae.name,
646
+ label: d(r)("inventory.ingredient.unit"),
647
+ "helper-text": (Te = e.modelValue) != null && Te.trackingMeasurement ? `Base unit: ${(De = (Ae = e.modelValue) == null ? void 0 : Ae.unit) == null ? void 0 : De.name}` : void 0,
648
+ "model-value": (Pe = B.value) == null ? void 0 : Pe.name,
651
649
  locked: g.value,
652
650
  disabled: e.disabled
653
651
  }, {
654
652
  default: V(() => [
655
- p($e, {
656
- "model-value": N.value,
657
- rules: [m(xe)()],
653
+ c(Ue, {
654
+ "model-value": B.value,
655
+ rules: [d(Ve)()],
658
656
  "label-mark": "required"
659
657
  }, {
660
658
  label: V(() => [
661
- p(x, {
662
- label: m(s)("inventory.ingredient.unit")
659
+ c(x, {
660
+ label: d(r)("inventory.ingredient.unit")
663
661
  }, null, 8, ["label"])
664
662
  ]),
665
663
  default: V(({ invalid: M }) => [
666
- p(te, null, {
664
+ c(ce, null, {
667
665
  "menu-button": V(() => [
668
- p(E, {
669
- class: X([
666
+ c(E, {
667
+ class: ee([
670
668
  "fm-typo-en-body-lg-400",
671
669
  {
672
670
  "text-fm-color-typo-primary": !e.disabled,
@@ -677,33 +675,33 @@ const Tt = {
677
675
  "append-icon": "expand_more"
678
676
  }, {
679
677
  default: V(() => {
680
- var W;
678
+ var G;
681
679
  return [
682
- Ie(D((W = N.value) == null ? void 0 : W.name), 1)
680
+ $e(A((G = B.value) == null ? void 0 : G.name), 1)
683
681
  ];
684
682
  }),
685
683
  _: 2
686
684
  }, 1032, ["class", "invalid"])
687
685
  ]),
688
686
  default: V(() => [
689
- u("div", {
687
+ m("div", {
690
688
  class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
691
- onVnodeMounted: $
689
+ onVnodeMounted: ae
692
690
  }, [
693
- (f(!0), A(Q, null, de(w.value, (W) => (f(), A(Q, {
694
- key: W.label
691
+ (f(!0), T(X, null, ie(F.value, (G) => (f(), T(X, {
692
+ key: G.label
695
693
  }, [
696
- W.displayAsSection ? (f(), A(Q, { key: 0 }, [
697
- p(F, {
698
- label: W.label
694
+ G.displayAsSection ? (f(), T(X, { key: 0 }, [
695
+ c(w, {
696
+ label: G.label
699
697
  }, null, 8, ["label"]),
700
- p(G)
701
- ], 64)) : (f(), B(H, {
698
+ c(q)
699
+ ], 64)) : (f(), P(Q, {
702
700
  key: 1,
703
- label: W.label,
704
- "model-value": v(W),
705
- onClick: (zn) => R(W.value),
706
- "x-should-scroll-into": `${v(W)}`
701
+ label: G.label,
702
+ "model-value": v(G),
703
+ onClick: (Yn) => R(G.value),
704
+ "x-should-scroll-into": `${v(G)}`
707
705
  }, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
708
706
  ], 64))), 128))
709
707
  ], 512)
@@ -716,119 +714,138 @@ const Tt = {
716
714
  ]),
717
715
  _: 1
718
716
  }, 8, ["label", "helper-text", "model-value", "locked", "disabled"]),
719
- m(h).enableTotalCost ? (f(), B(ye, {
717
+ c(ve, {
718
+ "tooltip-message": "This field is managed by NetSuite",
719
+ "tooltip-z-index": 50,
720
+ label: d(r)("inventory.ingredient.valuationMethod.title"),
721
+ "model-value": d(r)("inventory.ingredient.valuationMethod." + L.value),
722
+ locked: g.value,
723
+ disabled: e.disabled
724
+ }, {
725
+ default: V(() => [
726
+ c(ot, {
727
+ class: "col-span-2",
728
+ "model-value": L.value,
729
+ "onUpdate:modelValue": t[4] || (t[4] = (M) => L.value = M),
730
+ label: d(r)("inventory.ingredient.valuationMethod.title"),
731
+ items: K.value
732
+ }, null, 8, ["model-value", "label", "items"])
733
+ ]),
734
+ _: 1
735
+ }, 8, ["label", "model-value", "locked", "disabled"]),
736
+ d(h).enableTotalCost ? (f(), P(ve, {
720
737
  key: 0,
721
738
  "tooltip-message": "This field is managed by NetSuite",
722
739
  "tooltip-z-index": 50,
723
- "model-value": `${m(ut)()} ${I.value}`,
740
+ "model-value": `${d(pt)()} ${I.value}`,
724
741
  locked: g.value,
725
742
  disabled: e.disabled
726
743
  }, {
727
744
  label: V(() => [
728
- p(we, { "z-index": 50 }, {
745
+ c(Me, { "z-index": 50 }, {
729
746
  default: V(() => [
730
- p(x, {
731
- label: m(s)("inventory.ingredient.pricePerUnit")
747
+ c(x, {
748
+ label: d(r)("inventory.ingredient.pricePerUnit")
732
749
  }, null, 8, ["label"])
733
750
  ]),
734
751
  _: 1
735
752
  })
736
753
  ]),
737
754
  default: V(() => [
738
- m(h).enableTotalCost ? (f(), B(c, {
755
+ d(h).enableTotalCost ? (f(), P(p, {
739
756
  key: 0,
740
757
  "model-value": I.value,
741
- "onUpdate:modelValue": t[4] || (t[4] = (M) => I.value = M),
742
- rules: [m(ge)(0), m(mt)(4)]
758
+ "onUpdate:modelValue": t[5] || (t[5] = (M) => I.value = M),
759
+ rules: [d(_e)(0), d(vt)(4)]
743
760
  }, {
744
761
  label: V(() => [
745
- p(we, { "z-index": 50 }, {
762
+ c(Me, { "z-index": 50 }, {
746
763
  default: V(() => [
747
- p(x, {
748
- label: m(s)("inventory.ingredient.pricePerUnit")
764
+ c(x, {
765
+ label: d(r)("inventory.ingredient.pricePerUnit")
749
766
  }, null, 8, ["label"])
750
767
  ]),
751
768
  _: 1
752
769
  })
753
770
  ]),
754
771
  prepend: V(() => {
755
- var M, W;
772
+ var M, G;
756
773
  return [
757
- u("div", Bt, D(re(((M = m(a).currentCountry) == null ? void 0 : M.value) ?? m(Ne)) === "MYR" ? "RM" : re(((W = m(a).currentCountry) == null ? void 0 : W.value) ?? m(Ne))), 1)
774
+ m("div", Lt, A(re(((M = d(a).currentCountry) == null ? void 0 : M.value) ?? d(Le)) === "MYR" ? "RM" : re(((G = d(a).currentCountry) == null ? void 0 : G.value) ?? d(Le))), 1)
758
775
  ];
759
776
  }),
760
777
  append: V(() => [
761
- u("div", Nt, " / " + D(se.value), 1)
778
+ m("div", Ht, " / " + A(N.value), 1)
762
779
  ]),
763
780
  _: 1
764
- }, 8, ["model-value", "rules"])) : Y("", !0)
781
+ }, 8, ["model-value", "rules"])) : O("", !0)
765
782
  ]),
766
783
  _: 1
767
- }, 8, ["model-value", "locked", "disabled"])) : Y("", !0),
768
- !g.value || J.value ? (f(), B(Rt, {
784
+ }, 8, ["model-value", "locked", "disabled"])) : O("", !0),
785
+ !g.value || Z.value ? (f(), P(Dt, {
769
786
  key: 1,
770
- "model-value": J.value,
771
- "onUpdate:modelValue": t[5] || (t[5] = (M) => J.value = M),
787
+ "model-value": Z.value,
788
+ "onUpdate:modelValue": t[6] || (t[6] = (M) => Z.value = M),
772
789
  "root-value": e.modelValue,
773
790
  readonly: g.value
774
- }, null, 8, ["model-value", "root-value", "readonly"])) : Y("", !0),
775
- e.mode !== m(K).CREATE ? (f(), A("div", Lt, [
776
- u("div", null, [
777
- p(tt, {
778
- label: m(s)("inventory.ingredient.bindedItems.title"),
779
- modelValue: z.value,
780
- "onUpdate:modelValue": t[6] || (t[6] = (M) => z.value = M),
791
+ }, null, 8, ["model-value", "root-value", "readonly"])) : O("", !0),
792
+ e.mode !== d(W).CREATE ? (f(), T("div", Ot, [
793
+ m("div", null, [
794
+ c(lt, {
795
+ label: d(r)("inventory.ingredient.bindedItems.title"),
796
+ modelValue: J.value,
797
+ "onUpdate:modelValue": t[7] || (t[7] = (M) => J.value = M),
781
798
  "label-placement": "right"
782
799
  }, null, 8, ["label", "modelValue"])
783
800
  ]),
784
- z.value && q.value.length ? (f(), B(Ce, {
801
+ J.value && de.value.length ? (f(), P(Fe, {
785
802
  key: 0,
786
- name: m(s)("inventory.ingredient.bindedItems.ingredient"),
787
- bindings: q.value
788
- }, null, 8, ["name", "bindings"])) : Y("", !0),
789
- z.value && ne.value.length ? (f(), B(Ce, {
803
+ name: d(r)("inventory.ingredient.bindedItems.ingredient"),
804
+ bindings: de.value
805
+ }, null, 8, ["name", "bindings"])) : O("", !0),
806
+ J.value && ge.value.length ? (f(), P(Fe, {
790
807
  key: 1,
791
- name: m(s)("inventory.ingredient.bindedItems.recipe"),
792
- bindings: ne.value
793
- }, null, 8, ["name", "bindings"])) : Y("", !0),
794
- z.value && ue.value.length ? (f(), B(Ce, {
808
+ name: d(r)("inventory.ingredient.bindedItems.recipe"),
809
+ bindings: ge.value
810
+ }, null, 8, ["name", "bindings"])) : O("", !0),
811
+ J.value && D.value.length ? (f(), P(Fe, {
795
812
  key: 2,
796
- name: m(s)("inventory.ingredient.bindedItems.menu"),
797
- bindings: ue.value
798
- }, null, 8, ["name", "bindings"])) : Y("", !0)
799
- ])) : Y("", !0),
800
- u("div", zt, [
801
- u("div", Ht, [
802
- p(we, null, {
813
+ name: d(r)("inventory.ingredient.bindedItems.menu"),
814
+ bindings: D.value
815
+ }, null, 8, ["name", "bindings"])) : O("", !0)
816
+ ])) : O("", !0),
817
+ m("div", Yt, [
818
+ m("div", jt, [
819
+ c(Me, null, {
803
820
  default: V(() => [
804
- u("div", Yt, D(m(s)("inventory.ingredient.threshold.title")), 1)
821
+ m("div", qt, A(d(r)("inventory.ingredient.threshold.title")), 1)
805
822
  ]),
806
823
  _: 1
807
824
  }),
808
- u("div", jt, D(m(s)("inventory.ingredient.threshold.subtitle")), 1)
825
+ m("div", Gt, A(d(r)("inventory.ingredient.threshold.subtitle")), 1)
809
826
  ]),
810
- u("div", Ot, [
811
- p($e, {
812
- "model-value": { low: ee.value, mid: T.value },
813
- rules: [O()]
827
+ m("div", Wt, [
828
+ c(Ue, {
829
+ "model-value": { low: z.value, mid: te.value },
830
+ rules: [be()]
814
831
  }, null, 8, ["model-value", "rules"]),
815
- u("div", qt, [
816
- u("div", Gt, [
817
- u("div", Wt, [
818
- p(Ve, {
819
- days: ee.value,
820
- level: m(Se).low
832
+ m("div", Kt, [
833
+ m("div", Zt, [
834
+ m("div", Jt, [
835
+ c(Ce, {
836
+ days: z.value,
837
+ level: d(we).low
821
838
  }, null, 8, ["days", "level"])
822
839
  ]),
823
- u("div", Kt, [
824
- u("div", Zt, D(m(s)("inventory.ingredient.threshold.whenRemaining")), 1),
825
- p(Ee, {
826
- modelValue: ee.value,
827
- "onUpdate:modelValue": t[7] || (t[7] = (M) => ee.value = M),
828
- rules: [m(ge)(0)]
840
+ m("div", Qt, [
841
+ m("div", Xt, A(d(r)("inventory.ingredient.threshold.whenRemaining")), 1),
842
+ c(Re, {
843
+ modelValue: z.value,
844
+ "onUpdate:modelValue": t[8] || (t[8] = (M) => z.value = M),
845
+ rules: [d(_e)(0)]
829
846
  }, {
830
- append: V(() => t[10] || (t[10] = [
831
- u("div", {
847
+ append: V(() => t[11] || (t[11] = [
848
+ m("div", {
832
849
  class: "text-fm-color-typo-secondary",
833
850
  style: { "padding-right": "32px" }
834
851
  }, "days", -1)
@@ -837,31 +854,31 @@ const Tt = {
837
854
  }, 8, ["modelValue", "rules"])
838
855
  ])
839
856
  ]),
840
- t[12] || (t[12] = u("div", {
857
+ t[13] || (t[13] = m("div", {
841
858
  class: "h-full bg-fm-color-neutral-gray-200 relative",
842
859
  style: { width: "1px" }
843
860
  }, [
844
- u("div", {
861
+ m("div", {
845
862
  class: "absolute bg-white",
846
863
  style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
847
864
  }, " < ")
848
865
  ], -1)),
849
- u("div", Jt, [
850
- u("div", Qt, [
851
- p(Ve, {
852
- days: T.value,
853
- level: m(Se).mid
866
+ m("div", en, [
867
+ m("div", tn, [
868
+ c(Ce, {
869
+ days: te.value,
870
+ level: d(we).mid
854
871
  }, null, 8, ["days", "level"])
855
872
  ]),
856
- u("div", Xt, [
857
- u("div", en, D(m(s)("inventory.ingredient.threshold.whenRemaining")), 1),
858
- p(Ee, {
859
- modelValue: T.value,
860
- "onUpdate:modelValue": t[8] || (t[8] = (M) => T.value = M),
861
- rules: [m(ge)(0)]
873
+ m("div", nn, [
874
+ m("div", on, A(d(r)("inventory.ingredient.threshold.whenRemaining")), 1),
875
+ c(Re, {
876
+ modelValue: te.value,
877
+ "onUpdate:modelValue": t[9] || (t[9] = (M) => te.value = M),
878
+ rules: [d(_e)(0)]
862
879
  }, {
863
- append: V(() => t[11] || (t[11] = [
864
- u("div", {
880
+ append: V(() => t[12] || (t[12] = [
881
+ m("div", {
865
882
  class: "text-fm-color-typo-secondary",
866
883
  style: { "padding-right": "32px" }
867
884
  }, "days", -1)
@@ -870,34 +887,34 @@ const Tt = {
870
887
  }, 8, ["modelValue", "rules"])
871
888
  ])
872
889
  ]),
873
- t[13] || (t[13] = u("div", {
890
+ t[14] || (t[14] = m("div", {
874
891
  class: "h-full bg-fm-color-neutral-gray-200 relative",
875
892
  style: { width: "1px" }
876
893
  }, [
877
- u("div", {
894
+ m("div", {
878
895
  class: "absolute bg-white",
879
896
  style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
880
897
  }, " < ")
881
898
  ], -1)),
882
- u("div", tn, [
883
- u("div", nn, [
884
- p(Ve, {
885
- days: T.value + 1,
886
- level: m(Se).high
899
+ m("div", ln, [
900
+ m("div", an, [
901
+ c(Ce, {
902
+ days: te.value + 1,
903
+ level: d(we).high
887
904
  }, null, 8, ["days", "level"])
888
905
  ]),
889
- u("div", on, [
890
- u("div", ln, D(m(s)("inventory.ingredient.threshold.stockIsStaple")), 1)
906
+ m("div", rn, [
907
+ m("div", sn, A(d(r)("inventory.ingredient.threshold.stockIsStaple")), 1)
891
908
  ])
892
909
  ])
893
910
  ])
894
911
  ])
895
912
  ]),
896
- u("div", null, [
897
- p(Et, {
913
+ m("div", null, [
914
+ c(Tt, {
898
915
  entity: "inventorySku",
899
- modelValue: Z.value,
900
- "onUpdate:modelValue": t[9] || (t[9] = (M) => Z.value = M)
916
+ modelValue: j.value,
917
+ "onUpdate:modelValue": t[10] || (t[10] = (M) => j.value = M)
901
918
  }, null, 8, ["modelValue"])
902
919
  ])
903
920
  ];
@@ -906,46 +923,46 @@ const Tt = {
906
923
  }, 8, ["disabled"]);
907
924
  };
908
925
  }
909
- }), rn = { class: "flex flex-col gap-32" }, sn = {
926
+ }), un = { class: "flex flex-col gap-32" }, mn = {
910
927
  key: 0,
911
928
  class: "flex flex-col gap-12"
912
- }, dn = { class: "flex flex-col gap-4" }, un = { class: "flex-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, mn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, cn = { class: "flex gap-4" }, pn = /* @__PURE__ */ oe({
929
+ }, cn = { class: "flex flex-col gap-4" }, pn = { class: "flex-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, vn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, fn = { class: "flex gap-4" }, yn = /* @__PURE__ */ ne({
913
930
  __name: "IngredientDialog",
914
931
  props: {
915
932
  show: { type: Boolean },
916
933
  unit: {},
917
- mode: { default: K.READ }
934
+ mode: { default: W.READ }
918
935
  },
919
936
  emits: ["update:show"],
920
- setup(d) {
921
- const o = d, y = le(), s = Me(), n = he(), { t: l } = ae(), i = He(o, "show"), a = He(o, "unit"), h = S(
937
+ setup(u) {
938
+ const o = u, y = oe(), r = Ee(), n = ke(), { t: l } = le(), i = Ye(o, "show"), a = Ye(o, "unit"), h = S(
922
939
  () => {
923
940
  var v;
924
- return s.isEnabled && s.netSuiteItemBySkuId.has((v = o.unit) == null ? void 0 : v._id);
941
+ return r.isEnabled && r.netSuiteItemBySkuId.has((v = o.unit) == null ? void 0 : v._id);
925
942
  }
926
943
  ), k = S(() => {
927
944
  switch (o.mode) {
928
- case K.READ:
945
+ case W.READ:
929
946
  return "";
930
- case K.UPDATE:
947
+ case W.UPDATE:
931
948
  return l("inventory.ingredient.update.title");
932
- case K.CREATE:
949
+ case W.CREATE:
933
950
  return l("inventory.ingredient.create.title");
934
951
  }
935
952
  return "";
936
953
  }), g = S(() => {
937
954
  switch (o.mode) {
938
- case K.READ:
955
+ case W.READ:
939
956
  return "";
940
- case K.UPDATE:
957
+ case W.UPDATE:
941
958
  return l("common.save");
942
- case K.CREATE:
959
+ case W.CREATE:
943
960
  return l("common.add");
944
961
  }
945
962
  return "";
946
- }), b = j(), r = j(!1);
963
+ }), b = Y(), s = Y(!1);
947
964
  async function _() {
948
- r.value = !0;
965
+ s.value = !0;
949
966
  try {
950
967
  await y.createSku(a.value), i.value = !1, n.open({
951
968
  title: l("inventory.common.success"),
@@ -953,120 +970,120 @@ const Tt = {
953
970
  type: "success"
954
971
  });
955
972
  } catch (v) {
956
- v instanceof Le || n.open({
973
+ v instanceof He || n.open({
957
974
  title: l("inventory.ingredient.create.error.title"),
958
975
  message: l("inventory.ingredient.create.error.message"),
959
976
  type: "error"
960
977
  });
961
978
  } finally {
962
- r.value = !1;
979
+ s.value = !1;
963
980
  }
964
981
  }
965
982
  async function U() {
966
- r.value = !0;
983
+ s.value = !0;
967
984
  try {
968
- await y.updateSku(a.value), r.value = !1, i.value = !1, n.open({
985
+ await y.updateSku(a.value), s.value = !1, i.value = !1, n.open({
969
986
  title: l("inventory.common.success"),
970
987
  message: l("inventory.ingredient.update.success", { name: a.value.name }),
971
988
  type: "success"
972
989
  });
973
990
  } catch (v) {
974
- v instanceof Le || n.open({
991
+ v instanceof He || n.open({
975
992
  title: l("inventory.ingredient.update.error.title"),
976
993
  message: l("inventory.ingredient.update.error.message"),
977
994
  type: "error"
978
995
  });
979
996
  } finally {
980
- r.value = !1;
997
+ s.value = !1;
981
998
  }
982
999
  }
983
1000
  function I() {
984
1001
  var v, R;
985
1002
  (R = (v = b.value) == null ? void 0 : v.validateInputs) == null || R.call(v);
986
1003
  }
987
- function N() {
1004
+ function B() {
988
1005
  switch (o.mode) {
989
- case K.READ:
1006
+ case W.READ:
990
1007
  return;
991
- case K.UPDATE:
1008
+ case W.UPDATE:
992
1009
  return U();
993
- case K.CREATE:
1010
+ case W.CREATE:
994
1011
  return _();
995
1012
  }
996
1013
  }
997
- const w = S(() => {
998
- var J, Z;
999
- if (!s.isEnabled || !((J = o.unit) != null && J._id)) return null;
1000
- const v = (Z = s.netSuiteItemBySkuId.get(o.unit._id)) == null ? void 0 : Z[0];
1001
- return v ? s.state.setting.childItems.filter(
1014
+ const F = S(() => {
1015
+ var Z, K;
1016
+ if (!r.isEnabled || !((Z = o.unit) != null && Z._id)) return null;
1017
+ const v = (K = r.netSuiteItemBySkuId.get(o.unit._id)) == null ? void 0 : K[0];
1018
+ return v ? r.state.setting.childItems.filter(
1002
1019
  (L) => L.parentNetSuiteId === v.netSuiteId
1003
1020
  ).map((L) => {
1004
- var q;
1005
- const z = (q = s.measurementByNetsuiteId.get(L.unitOfMeasureId)) == null ? void 0 : q[0];
1006
- return z ? {
1021
+ var H;
1022
+ const j = (H = r.measurementByNetsuiteId.get(L.unitOfMeasureId)) == null ? void 0 : H[0];
1023
+ return j ? {
1007
1024
  externalId: L.externalId,
1008
- ...z
1025
+ ...j
1009
1026
  } : null;
1010
1027
  }).filter((L) => L).map((L) => L) : null;
1011
1028
  });
1012
1029
  return (v, R) => {
1013
- const J = C("FmChip"), Z = C("FmButton"), L = C("FmSideSheet");
1014
- return f(), B(L, {
1015
- "model-value": m(i),
1016
- "onUpdate:modelValue": R[3] || (R[3] = (z) => De(i) ? i.value = z : null),
1030
+ const Z = C("FmChip"), K = C("FmButton"), L = C("FmSideSheet");
1031
+ return f(), P(L, {
1032
+ "model-value": d(i),
1033
+ "onUpdate:modelValue": R[3] || (R[3] = (j) => Be(i) ? i.value = j : null),
1017
1034
  header: k.value,
1018
1035
  "close-button": "",
1019
1036
  "dismiss-away": "",
1020
1037
  "max-width": 500
1021
1038
  }, {
1022
1039
  "side-sheet-footer": V(() => [
1023
- u("div", cn, [
1024
- p(Z, {
1025
- loading: r.value,
1040
+ m("div", fn, [
1041
+ c(K, {
1042
+ loading: s.value,
1026
1043
  label: g.value,
1027
1044
  onClick: I
1028
1045
  }, null, 8, ["loading", "label"]),
1029
- p(Z, {
1030
- disabled: r.value,
1031
- label: m(l)("common.close"),
1046
+ c(K, {
1047
+ disabled: s.value,
1048
+ label: d(l)("common.close"),
1032
1049
  variant: "tertiary",
1033
- onClick: R[2] || (R[2] = (z) => i.value = !1)
1050
+ onClick: R[2] || (R[2] = (j) => i.value = !1)
1034
1051
  }, null, 8, ["disabled", "label"])
1035
1052
  ])
1036
1053
  ]),
1037
1054
  default: V(() => {
1038
- var z;
1055
+ var j;
1039
1056
  return [
1040
- u("div", rn, [
1041
- u("div", null, [
1042
- h.value ? (f(), B(J, {
1057
+ m("div", un, [
1058
+ m("div", null, [
1059
+ h.value ? (f(), P(Z, {
1043
1060
  key: 0,
1044
1061
  label: "Netsuite",
1045
1062
  compact: ""
1046
- })) : Y("", !0)
1063
+ })) : O("", !0)
1047
1064
  ]),
1048
- p(an, {
1065
+ c(dn, {
1049
1066
  class: "w-full",
1050
1067
  ref_key: "hasValidationExpose",
1051
1068
  ref: b,
1052
- modelValue: m(a),
1053
- "onUpdate:modelValue": R[0] || (R[0] = (q) => De(a) ? a.value = q : null),
1069
+ modelValue: d(a),
1070
+ "onUpdate:modelValue": R[0] || (R[0] = (H) => Be(a) ? a.value = H : null),
1054
1071
  mode: v.mode,
1055
- disabled: r.value,
1056
- "onClick:submit": R[1] || (R[1] = (q) => N())
1072
+ disabled: s.value,
1073
+ "onClick:submit": R[1] || (R[1] = (H) => B())
1057
1074
  }, null, 8, ["modelValue", "mode", "disabled"]),
1058
- (z = w.value) != null && z.length ? (f(), A("div", sn, [
1059
- R[4] || (R[4] = u("div", { class: "fm-typo-en-title-sm-600" }, D("NetSuite info"), -1)),
1060
- u("div", dn, [
1061
- (f(!0), A(Q, null, de(w.value, (q, ne) => (f(), A("div", {
1062
- key: ne,
1075
+ (j = F.value) != null && j.length ? (f(), T("div", mn, [
1076
+ R[4] || (R[4] = m("div", { class: "fm-typo-en-title-sm-600" }, A("NetSuite info"), -1)),
1077
+ m("div", cn, [
1078
+ (f(!0), T(X, null, ie(F.value, (H, J) => (f(), T("div", {
1079
+ key: J,
1063
1080
  class: "flex items-center"
1064
1081
  }, [
1065
- u("div", un, D(q.externalId), 1),
1066
- u("div", mn, D(q.abbrev), 1)
1082
+ m("div", pn, A(H.externalId), 1),
1083
+ m("div", vn, A(H.abbrev), 1)
1067
1084
  ]))), 128))
1068
1085
  ])
1069
- ])) : Y("", !0)
1086
+ ])) : O("", !0)
1070
1087
  ])
1071
1088
  ];
1072
1089
  }),
@@ -1075,39 +1092,39 @@ const Tt = {
1075
1092
  };
1076
1093
  }
1077
1094
  });
1078
- function* vn(d) {
1095
+ function* gn(u) {
1079
1096
  for (; ; )
1080
- yield d[Math.floor(Math.random() * d.length)];
1097
+ yield u[Math.floor(Math.random() * u.length)];
1081
1098
  }
1082
- function fn(d = 4, o = vn("qwertyuiopasdfghjklzxcvbnm".split(""))) {
1083
- return Array.from({ length: d }).map(() => o.next().value).join("");
1099
+ function bn(u = 4, o = gn("qwertyuiopasdfghjklzxcvbnm".split(""))) {
1100
+ return Array.from({ length: u }).map(() => o.next().value).join("");
1084
1101
  }
1085
- function yn() {
1086
- return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${fn()}`;
1102
+ function hn() {
1103
+ return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${bn()}`;
1087
1104
  }
1088
- const gn = {
1105
+ const _n = {
1089
1106
  _id: "",
1090
1107
  name: "",
1091
1108
  abbrev: "",
1092
1109
  precision: 0,
1093
1110
  measurements: []
1094
1111
  };
1095
- function bn(d) {
1096
- var y, s, n, l, i;
1112
+ function xn(u) {
1113
+ var y, r, n, l, i;
1097
1114
  return {
1098
- code: d.code,
1099
- name: d.name,
1100
- unit: ((y = d.unit.measurements.find((a) => a.id === d.trackingMeasurement)) == null ? void 0 : y.abbrev) ?? d.unit.abbrev,
1101
- baseUnit: d.unit.abbrev,
1102
- valuationMethod: d.valuation ?? "WAVG",
1103
- pricePerUnit: (s = d.defaultCost) != null && s.costPerUnit ? +We((n = d.defaultCost) == null ? void 0 : n.costPerUnit) : 0,
1104
- thresholdLow: ((l = d.thresholds) == null ? void 0 : l.low) ?? ie().low,
1105
- thresholdMid: ((i = d.thresholds) == null ? void 0 : i.mid) ?? ie().mid
1115
+ code: u.code,
1116
+ name: u.name,
1117
+ unit: ((y = u.unit.measurements.find((a) => a.id === u.trackingMeasurement)) == null ? void 0 : y.abbrev) ?? u.unit.abbrev,
1118
+ baseUnit: u.unit.abbrev,
1119
+ valuationMethod: u.valuation ?? "WAVG",
1120
+ pricePerUnit: (r = u.defaultCost) != null && r.costPerUnit ? +Ze((n = u.defaultCost) == null ? void 0 : n.costPerUnit) : 0,
1121
+ thresholdLow: ((l = u.thresholds) == null ? void 0 : l.low) ?? se().low,
1122
+ thresholdMid: ((i = u.thresholds) == null ? void 0 : i.mid) ?? se().mid
1106
1123
  };
1107
1124
  }
1108
- function et() {
1125
+ function nt() {
1109
1126
  var n;
1110
- const d = [
1127
+ const u = [
1111
1128
  {
1112
1129
  id: "code",
1113
1130
  name: "Code"
@@ -1124,17 +1141,17 @@ function et() {
1124
1141
  id: "baseUnit",
1125
1142
  name: "Base unit"
1126
1143
  }
1127
- ], o = Xe(), y = ve(), s = be(y.currentCountry.value);
1128
- return o.enableTotalCost && d.push(
1144
+ ], o = tt(), y = ye(), r = xe(y.currentCountry.value);
1145
+ return o.enableTotalCost && u.push(
1129
1146
  {
1130
1147
  id: "valuationMethod",
1131
1148
  name: "Valuation method"
1132
1149
  },
1133
1150
  {
1134
1151
  id: "pricePerUnit",
1135
- name: `Price per unit (${s == null ? void 0 : s.currency})`
1152
+ name: `Price per unit (${r == null ? void 0 : r.currency})`
1136
1153
  }
1137
- ), ((n = y.currentBusiness.value) == null ? void 0 : n.menuVersion) === "v4" && d.push(
1154
+ ), ((n = y.currentBusiness.value) == null ? void 0 : n.menuVersion) === "v4" && u.push(
1138
1155
  {
1139
1156
  id: "thresholdLow",
1140
1157
  name: "Show RED when remaining"
@@ -1143,51 +1160,51 @@ function et() {
1143
1160
  id: "thresholdMid",
1144
1161
  name: "Show YELLOW when remaining"
1145
1162
  }
1146
- ), d;
1163
+ ), u;
1147
1164
  }
1148
- function hn() {
1149
- const o = le().skus.map(bn), s = ve().currentBusiness.value, n = et(), l = [
1150
- ["Business name:", s == null ? void 0 : s.name],
1151
- ["Business ID:", s == null ? void 0 : s._id],
1152
- ["Menu version", s == null ? void 0 : s.menuVersion],
1165
+ function kn() {
1166
+ const o = oe().skus.map(xn), r = ye().currentBusiness.value, n = nt(), l = [
1167
+ ["Business name:", r == null ? void 0 : r.name],
1168
+ ["Business ID:", r == null ? void 0 : r._id],
1169
+ ["Menu version", r == null ? void 0 : r.menuVersion],
1153
1170
  [],
1154
1171
  n.map((k) => k.name),
1155
1172
  ...o.map((k) => n.map((g) => k[g.id]))
1156
- ], i = n.map((k) => `system:${k.id}`), a = Ze(l, i), h = `${s == null ? void 0 : s.name} ingredients (${ct(/* @__PURE__ */ new Date())}).xlsx`;
1157
- return Je(a, h), h;
1173
+ ], i = n.map((k) => `system:${k.id}`), a = Qe(l, i), h = `${r == null ? void 0 : r.name} ingredients (${ft(/* @__PURE__ */ new Date())}).xlsx`;
1174
+ return Xe(a, h), h;
1158
1175
  }
1159
- function _n() {
1160
- const o = ve().currentBusiness.value, y = et(), s = [
1176
+ function Vn() {
1177
+ const o = ye().currentBusiness.value, y = nt(), r = [
1161
1178
  ["Business name:", o == null ? void 0 : o.name],
1162
1179
  ["Business ID:", o == null ? void 0 : o._id],
1163
1180
  ["Menu version", o == null ? void 0 : o.menuVersion],
1164
1181
  [],
1165
1182
  y.map((a) => a.name)
1166
- ], n = y.map((a) => `system:${a.id}`), l = Ze(s, n), i = "FeedMe ingredients template.xlsx";
1167
- return Je(l, i), i;
1183
+ ], n = y.map((a) => `system:${a.id}`), l = Qe(r, n), i = "FeedMe ingredients template.xlsx";
1184
+ return Xe(l, i), i;
1168
1185
  }
1169
- function xn(d) {
1186
+ function Sn(u) {
1170
1187
  const [
1171
1188
  o,
1172
1189
  y,
1173
- s,
1190
+ r,
1174
1191
  n,
1175
1192
  l,
1176
1193
  i,
1177
1194
  ...a
1178
- ] = vt(d);
1179
- if (!o || !o.length || o.some((r) => r.length && !r.startsWith("system:")))
1195
+ ] = gt(u);
1196
+ if (!o || !o.length || o.some((s) => s.length && !s.startsWith("system:")))
1180
1197
  throw new Error("Missing meta header. Excel file does not come from the template.");
1181
- const h = o.map((r) => r.split(":")[1]), g = ["code", "name", "unit", "baseUnit"].filter((r) => !h.includes(r));
1198
+ const h = o.map((s) => s.split(":")[1]), g = ["code", "name", "unit", "baseUnit"].filter((s) => !h.includes(s));
1182
1199
  if (g.length)
1183
1200
  throw new Error(
1184
1201
  `Missing meta headers (${g.join()}). Excel file does not come from the template.`
1185
1202
  );
1186
- return a.map((r, _) => {
1203
+ return a.map((s, _) => {
1187
1204
  const U = {};
1188
1205
  for (const I in h) {
1189
- const N = h[I];
1190
- Object.assign(U, { [N]: r[I] });
1206
+ const B = h[I];
1207
+ Object.assign(U, { [B]: s[I] });
1191
1208
  }
1192
1209
  return {
1193
1210
  index: _,
@@ -1195,42 +1212,42 @@ function xn(d) {
1195
1212
  };
1196
1213
  });
1197
1214
  }
1198
- function Ye(d, o, y) {
1199
- var w;
1200
- const n = le().units, l = new Array(), i = y.filter((v) => v.data.code === d.code);
1215
+ function je(u, o, y) {
1216
+ var F;
1217
+ const n = oe().units, l = new Array(), i = y.filter((v) => v.data.code === u.code);
1201
1218
  i.length > 1 && l.push(
1202
- `Code ${d.code} is already used in row ${i.map((v) => v.index + 6).join()}.`
1219
+ `Code ${u.code} is already used in row ${i.map((v) => v.index + 6).join()}.`
1203
1220
  );
1204
- const a = n.find((v) => v.abbrev === d.baseUnit), h = a == null ? void 0 : a.measurements.find((v) => v.abbrev === d.unit);
1221
+ const a = n.find((v) => v.abbrev === u.baseUnit), h = a == null ? void 0 : a.measurements.find((v) => v.abbrev === u.unit);
1205
1222
  if (!a)
1206
- l.push(`Cannot find base unit of symbol ${d.baseUnit}.`);
1207
- else if (d.baseUnit !== d.unit && !h) {
1208
- const v = `Cannot find unit conversion for ${d.baseUnit} with symbol ${d.unit || "[empty]"}.`;
1223
+ l.push(`Cannot find base unit of symbol ${u.baseUnit}.`);
1224
+ else if (u.baseUnit !== u.unit && !h) {
1225
+ const v = `Cannot find unit conversion for ${u.baseUnit} with symbol ${u.unit || "[empty]"}.`;
1209
1226
  l.push(v);
1210
1227
  }
1211
- const k = pe.options.find(
1212
- (v) => v === d.valuationMethod
1228
+ const k = fe.options.find(
1229
+ (v) => v === u.valuationMethod
1213
1230
  );
1214
- d.valuationMethod && !k && l.push(
1215
- `Expected valuation method to be one of ${pe.options.join()} but got ${d.valuationMethod} instead.`
1231
+ u.valuationMethod && !k && l.push(
1232
+ `Expected valuation method to be one of ${fe.options.join()} but got ${u.valuationMethod} instead.`
1216
1233
  );
1217
- const b = ve().currentCountry.value, r = (v) => `${v}`.length && ft()(v) === !0, _ = r(`${d.pricePerUnit}`) === !0 ? {
1234
+ const b = ye().currentCountry.value, s = (v) => `${v}`.length && bt()(v) === !0, _ = s(`${u.pricePerUnit}`) === !0 ? {
1218
1235
  costPerUnit: {
1219
- ...Ke(Number(d.pricePerUnit) || 0),
1220
- currency: ((w = be(b)) == null ? void 0 : w.currency) ?? "MYR"
1236
+ ...Je(Number(u.pricePerUnit) || 0),
1237
+ currency: ((F = xe(b)) == null ? void 0 : F.currency) ?? "MYR"
1221
1238
  },
1222
1239
  measurement: h
1223
- } : void 0, U = r(`${d.thresholdLow}`) && r(`${d.thresholdMid}`) ? {
1224
- low: Number(d.thresholdLow) || 0,
1225
- mid: Number(d.thresholdMid) || 0
1240
+ } : void 0, U = s(`${u.thresholdLow}`) && s(`${u.thresholdMid}`) ? {
1241
+ low: Number(u.thresholdLow) || 0,
1242
+ mid: Number(u.thresholdMid) || 0
1226
1243
  } : void 0;
1227
1244
  return {
1228
1245
  type: "create",
1229
1246
  sku: {
1230
- _id: yn(),
1231
- code: d.code,
1232
- name: d.name,
1233
- unit: a ?? n.find((v) => v) ?? gn,
1247
+ _id: hn(),
1248
+ code: u.code,
1249
+ name: u.name,
1250
+ unit: a ?? n.find((v) => v) ?? _n,
1234
1251
  trackingMeasurement: h == null ? void 0 : h.id,
1235
1252
  valuation: k,
1236
1253
  defaultCost: _,
@@ -1240,12 +1257,12 @@ function Ye(d, o, y) {
1240
1257
  excelRowNumber: o + 6
1241
1258
  };
1242
1259
  }
1243
- function kn(d) {
1260
+ function Cn(u) {
1244
1261
  try {
1245
- const o = xn(d).filter((k) => k.data.code), s = le().skus, n = pt(s, "code"), l = o.filter((k) => !n[k.data.code]), i = o.filter((k) => n[k.data.code]), a = l.map(
1246
- (k) => Ye(k.data, k.index, o)
1262
+ const o = Sn(u).filter((k) => k.data.code), r = oe().skus, n = yt(r, "code"), l = o.filter((k) => !n[k.data.code]), i = o.filter((k) => n[k.data.code]), a = l.map(
1263
+ (k) => je(k.data, k.index, o)
1247
1264
  ), h = i.map((k) => {
1248
- const g = Ye(k.data, k.index, o), b = n[k.data.code];
1265
+ const g = je(k.data, k.index, o), b = n[k.data.code];
1249
1266
  return {
1250
1267
  ...g,
1251
1268
  type: "update",
@@ -1277,10 +1294,10 @@ function kn(d) {
1277
1294
  };
1278
1295
  }
1279
1296
  }
1280
- const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-col" }, Cn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, wn = {
1297
+ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-col" }, Mn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, In = {
1281
1298
  key: 0,
1282
1299
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
1283
- }, Fn = { key: 0 }, je = /* @__PURE__ */ oe({
1300
+ }, $n = { key: 0 }, qe = /* @__PURE__ */ ne({
1284
1301
  __name: "ImportIngredientItem",
1285
1302
  props: {
1286
1303
  type: {},
@@ -1288,30 +1305,30 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1288
1305
  name: {},
1289
1306
  errors: {}
1290
1307
  },
1291
- setup(d) {
1308
+ setup(u) {
1292
1309
  return (o, y) => {
1293
- const s = C("FmIcon"), n = C("FmTooltip");
1294
- return f(), A("div", Vn, [
1295
- y[0] || (y[0] = u("div", null, "•", -1)),
1296
- u("div", Sn, [
1297
- u("div", Cn, [
1298
- u("div", {
1299
- class: X({
1310
+ const r = C("FmIcon"), n = C("FmTooltip");
1311
+ return f(), T("div", wn, [
1312
+ y[0] || (y[0] = m("div", null, "•", -1)),
1313
+ m("div", Fn, [
1314
+ m("div", Mn, [
1315
+ m("div", {
1316
+ class: ee({
1300
1317
  "text-fm-color-system-error-300": o.errors.length
1301
1318
  })
1302
1319
  }, [
1303
- Ie(D(o.name) + " ", 1),
1304
- o.type === "create" ? (f(), A("span", wn, "(new)")) : Y("", !0)
1320
+ $e(A(o.name) + " ", 1),
1321
+ o.type === "create" ? (f(), T("span", In, "(new)")) : O("", !0)
1305
1322
  ], 2),
1306
- o.errors.length ? (f(), A("div", Fn, [
1307
- p(n, { "z-index": 50 }, {
1323
+ o.errors.length ? (f(), T("div", $n, [
1324
+ c(n, { "z-index": 50 }, {
1308
1325
  content: V(() => [
1309
- u("ol", null, [
1310
- (f(!0), A(Q, null, de(o.errors, (l, i) => (f(), A("li", { key: i }, D(l), 1))), 128))
1326
+ m("ol", null, [
1327
+ (f(!0), T(X, null, ie(o.errors, (l, i) => (f(), T("li", { key: i }, A(l), 1))), 128))
1311
1328
  ])
1312
1329
  ]),
1313
1330
  default: V(() => [
1314
- p(s, {
1331
+ c(r, {
1315
1332
  name: "error",
1316
1333
  size: "sm",
1317
1334
  color: "system-error-300"
@@ -1319,52 +1336,52 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1319
1336
  ]),
1320
1337
  _: 1
1321
1338
  })
1322
- ])) : Y("", !0)
1339
+ ])) : O("", !0)
1323
1340
  ]),
1324
- u("div", {
1325
- class: X([
1341
+ m("div", {
1342
+ class: ee([
1326
1343
  "fm-typo-en-body-sm-400",
1327
1344
  {
1328
1345
  "text-fm-color-system-error-200": o.errors.length,
1329
1346
  "text-fm-color-typo-secondary": !o.errors.length
1330
1347
  }
1331
1348
  ])
1332
- }, D(o.code), 3)
1349
+ }, A(o.code), 3)
1333
1350
  ])
1334
1351
  ]);
1335
1352
  };
1336
1353
  }
1337
- }), In = { class: "flex flex-col gap-24" }, Mn = { class: "fm-typo-en-body-md-400" }, $n = { class: "flex flex-col gap-8" }, En = { class: "line-clamp-2 text-ellipsis break-all" }, Un = {
1354
+ }), En = { class: "flex flex-col gap-24" }, Un = { class: "fm-typo-en-body-md-400" }, Rn = { class: "flex flex-col gap-8" }, Tn = { class: "line-clamp-2 text-ellipsis break-all" }, An = {
1338
1355
  key: 2,
1339
1356
  class: "shrink-0"
1340
- }, Rn = {
1357
+ }, Dn = {
1341
1358
  key: 0,
1342
1359
  class: "flex flex-col"
1343
- }, Tn = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, An = {
1360
+ }, Pn = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Bn = {
1344
1361
  key: 0,
1345
1362
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
1346
- }, Dn = { class: "fm-typo-en-body-lg-600" }, Pn = /* @__PURE__ */ oe({
1363
+ }, Nn = { class: "fm-typo-en-body-lg-600" }, zn = /* @__PURE__ */ ne({
1347
1364
  __name: "ImportIngredients",
1348
- setup(d) {
1349
- const o = j(null), y = Vt(), s = he(), n = j(!1), l = j(new Array()), i = j([]), a = j([]), h = S(
1350
- () => !!l.value.length || i.value.some((r) => r.errors.length) || a.value.some((r) => r.errors.length)
1365
+ setup(u) {
1366
+ const o = Y(null), y = wt(), r = ke(), n = Y(!1), l = Y(new Array()), i = Y([]), a = Y([]), h = S(
1367
+ () => !!l.value.length || i.value.some((s) => s.errors.length) || a.value.some((s) => s.errors.length)
1351
1368
  ), k = S(
1352
1369
  () => !!i.value.length || !!a.value.length
1353
- ), { t: g } = ae();
1354
- async function b(r) {
1370
+ ), { t: g } = le();
1371
+ async function b(s) {
1355
1372
  l.value = [], i.value = [], a.value = [];
1356
1373
  try {
1357
1374
  n.value = !0;
1358
1375
  const [_] = await Promise.all([
1359
- gt(r),
1376
+ _t(s),
1360
1377
  // fake buffer
1361
- new Promise((N) => setTimeout(N, 1e3))
1362
- ]), U = _.SheetNames.find((N) => N);
1378
+ new Promise((B) => setTimeout(B, 1e3))
1379
+ ]), U = _.SheetNames.find((B) => B);
1363
1380
  if (!U) {
1364
1381
  l.value.push(g("inventory.ingredient.import.fileError.noSheet"));
1365
1382
  return;
1366
1383
  }
1367
- const I = kn(_.Sheets[U]);
1384
+ const I = Cn(_.Sheets[U]);
1368
1385
  if (I.invalidExcel) {
1369
1386
  l.value.push(I.invalidExcelMessage ?? g("inventory.ingredient.import.fileError.invalidExcel"));
1370
1387
  return;
@@ -1375,40 +1392,40 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1375
1392
  }
1376
1393
  y.emitData(I);
1377
1394
  } catch (_) {
1378
- s.open({
1395
+ r.open({
1379
1396
  title: g("inventory.ingredient.import.fileError.unableToRead"),
1380
1397
  message: _ == null ? void 0 : _.message,
1381
1398
  type: "error"
1382
1399
  }), console.error("Error in reading file", _);
1383
1400
  } finally {
1384
- l.value.length && s.open({
1401
+ l.value.length && r.open({
1385
1402
  title: g("inventory.ingredient.import.fileError.invalidExcel"),
1386
1403
  type: "error"
1387
1404
  }), n.value = !1;
1388
1405
  }
1389
1406
  }
1390
- return Oe(o, (r) => {
1391
- r && b(r);
1392
- }), (r, _) => {
1393
- const U = C("FmCircularProgress"), I = C("FmIcon"), N = C("FmButton");
1394
- return f(), A("div", In, [
1395
- u("div", Mn, D(m(g)("inventory.ingredient.import.uploadDescription")), 1),
1396
- p(yt, {
1397
- class: X({
1407
+ return Ge(o, (s) => {
1408
+ s && b(s);
1409
+ }), (s, _) => {
1410
+ const U = C("FmCircularProgress"), I = C("FmIcon"), B = C("FmButton");
1411
+ return f(), T("div", En, [
1412
+ m("div", Un, A(d(g)("inventory.ingredient.import.uploadDescription")), 1),
1413
+ c(ht, {
1414
+ class: ee({
1398
1415
  "w-full": !0,
1399
1416
  "h-[200px]": !o.value
1400
1417
  }),
1401
1418
  accept: ".xlsx",
1402
- onFileUpload: _[0] || (_[0] = (w) => o.value = w),
1403
- label: m(g)("inventory.ingredient.import.uploadTemplate"),
1404
- "button-label": m(g)("inventory.ingredient.import.selectFile")
1405
- }, qe({ _: 2 }, [
1419
+ onFileUpload: _[0] || (_[0] = (F) => o.value = F),
1420
+ label: d(g)("inventory.ingredient.import.uploadTemplate"),
1421
+ "button-label": d(g)("inventory.ingredient.import.selectFile")
1422
+ }, We({ _: 2 }, [
1406
1423
  o.value ? {
1407
1424
  name: "default",
1408
- fn: V(({ openFileDialog: w }) => [
1409
- u("div", $n, [
1410
- u("div", {
1411
- class: X([
1425
+ fn: V(({ openFileDialog: F }) => [
1426
+ m("div", Rn, [
1427
+ m("div", {
1428
+ class: ee([
1412
1429
  "fm-corner-radius-md p-16 flex items-center gap-16",
1413
1430
  {
1414
1431
  "border border-fm-color-neutral-gray-100": n.value,
@@ -1417,18 +1434,18 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1417
1434
  }
1418
1435
  ])
1419
1436
  }, [
1420
- n.value ? (f(), B(U, {
1437
+ n.value ? (f(), P(U, {
1421
1438
  key: 0,
1422
1439
  size: "md",
1423
1440
  color: "neutral-gray-200"
1424
- })) : (f(), B(I, {
1441
+ })) : (f(), P(I, {
1425
1442
  key: 1,
1426
1443
  name: h.value ? "error" : "attach_file",
1427
1444
  outline: "",
1428
1445
  color: h.value ? "system-error-300" : void 0
1429
1446
  }, null, 8, ["name", "color"])),
1430
- u("div", {
1431
- class: X([
1447
+ m("div", {
1448
+ class: ee([
1432
1449
  "fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
1433
1450
  {
1434
1451
  "text-fm-color-typo-disabled": n.value,
@@ -1436,70 +1453,70 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1436
1453
  }
1437
1454
  ])
1438
1455
  }, [
1439
- u("div", En, D(o.value.name), 1)
1456
+ m("div", Tn, A(o.value.name), 1)
1440
1457
  ], 2),
1441
- n.value ? Y("", !0) : (f(), A("div", Un, [
1442
- p(N, {
1443
- label: m(g)("inventory.ingredient.import.replaceFile"),
1458
+ n.value ? O("", !0) : (f(), T("div", An, [
1459
+ c(B, {
1460
+ label: d(g)("inventory.ingredient.import.replaceFile"),
1444
1461
  variant: h.value ? "destructive" : "secondary",
1445
1462
  "prepend-icon": h.value ? void 0 : "autorenew",
1446
- onClick: w
1463
+ onClick: F
1447
1464
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
1448
1465
  ]))
1449
1466
  ], 2),
1450
- l.value.length ? (f(), A("div", Rn, [
1451
- (f(!0), A(Q, null, de(l.value, (v, R) => (f(), A("div", {
1467
+ l.value.length ? (f(), T("div", Dn, [
1468
+ (f(!0), T(X, null, ie(l.value, (v, R) => (f(), T("div", {
1452
1469
  key: R,
1453
1470
  class: "flex gap-8 items-center"
1454
1471
  }, [
1455
- p(I, {
1472
+ c(I, {
1456
1473
  name: "error",
1457
1474
  size: "sm",
1458
1475
  color: "system-error-300"
1459
1476
  }),
1460
- u("div", Tn, D(v), 1)
1477
+ m("div", Pn, A(v), 1)
1461
1478
  ]))), 128))
1462
- ])) : Y("", !0)
1479
+ ])) : O("", !0)
1463
1480
  ])
1464
1481
  ]),
1465
1482
  key: "0"
1466
1483
  } : void 0
1467
1484
  ]), 1032, ["class", "label", "button-label"]),
1468
- k.value ? (f(), A("div", An, [
1469
- u("div", Dn, D(m(g)("inventory.ingredient.import.summary")), 1),
1470
- (f(!0), A(Q, null, de(i.value, (w) => (f(), B(je, {
1471
- key: w.sku._id,
1472
- code: w.sku.code,
1473
- name: w.sku.name,
1474
- errors: w.errors,
1485
+ k.value ? (f(), T("div", Bn, [
1486
+ m("div", Nn, A(d(g)("inventory.ingredient.import.summary")), 1),
1487
+ (f(!0), T(X, null, ie(i.value, (F) => (f(), P(qe, {
1488
+ key: F.sku._id,
1489
+ code: F.sku.code,
1490
+ name: F.sku.name,
1491
+ errors: F.errors,
1475
1492
  type: "create"
1476
1493
  }, null, 8, ["code", "name", "errors"]))), 128)),
1477
- (f(!0), A(Q, null, de(a.value, (w) => (f(), B(je, {
1478
- key: w.sku._id,
1479
- code: w.sku.code,
1480
- name: w.sku.name,
1481
- errors: w.errors,
1494
+ (f(!0), T(X, null, ie(a.value, (F) => (f(), P(qe, {
1495
+ key: F.sku._id,
1496
+ code: F.sku.code,
1497
+ name: F.sku.name,
1498
+ errors: F.errors,
1482
1499
  type: "update"
1483
1500
  }, null, 8, ["code", "name", "errors"]))), 128))
1484
- ])) : Y("", !0)
1501
+ ])) : O("", !0)
1485
1502
  ]);
1486
1503
  };
1487
1504
  }
1488
- }), Bn = { class: "flex flex-col py-8" }, Nn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ln = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, to = /* @__PURE__ */ oe({
1505
+ }), Ln = { class: "flex flex-col py-8" }, Hn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, On = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, lo = /* @__PURE__ */ ne({
1489
1506
  __name: "IngredientsView",
1490
- setup(d) {
1491
- const o = le(), y = S(() => o.skus), s = bt(), n = Qe(), l = he(), i = Me(), { t: a } = ae(), { createIngredient: h, updateIngredient: k } = Fe(), { ingredientDialogProps: g, ingredientViewLoading: b } = It(Fe()), { columnDefs: r } = Ut();
1492
- function _(P) {
1493
- switch (P) {
1507
+ setup(u) {
1508
+ const o = oe(), y = S(() => o.skus), r = xt(), n = et(), l = ke(), i = Ee(), { t: a } = le(), { createIngredient: h, updateIngredient: k } = Ie(), { ingredientDialogProps: g, ingredientViewLoading: b } = Et(Ie()), { columnDefs: s } = At();
1509
+ function _(D) {
1510
+ switch (D) {
1494
1511
  case "add":
1495
1512
  return i.isEnabled ? void 0 : h();
1496
1513
  case "import":
1497
- return ue();
1514
+ return de();
1498
1515
  case "export":
1499
- return ne();
1516
+ return J();
1500
1517
  }
1501
1518
  }
1502
- const U = j(""), I = j(!1), N = S(() => I.value || b.value), { breakpoints: w } = St(), v = S(() => w.value.xs || w.value.sm), R = S(() => v.value ? 10 : 20), J = ht(), Z = j(!1), L = [
1519
+ const U = Y(""), I = Y(!1), B = S(() => I.value || b.value), { breakpoints: F } = Ft(), v = S(() => F.value.xs || F.value.sm), R = S(() => v.value ? 10 : 20), Z = kt(), K = Y(!1), L = [
1503
1520
  {
1504
1521
  value: "import",
1505
1522
  label: a("common.import")
@@ -1509,15 +1526,15 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1509
1526
  label: a("common.export")
1510
1527
  }
1511
1528
  ];
1512
- function z(P) {
1513
- switch (Z.value = !1, P) {
1529
+ function j(D) {
1530
+ switch (K.value = !1, D) {
1514
1531
  case "import":
1515
- return ue();
1532
+ return de();
1516
1533
  case "export":
1517
- return ne();
1534
+ return J();
1518
1535
  }
1519
1536
  }
1520
- const q = S(() => [
1537
+ const H = S(() => [
1521
1538
  ...i.isEnabled ? [] : [
1522
1539
  {
1523
1540
  label: a("inventory.ingredient.create.title"),
@@ -1529,18 +1546,18 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1529
1546
  ],
1530
1547
  { label: a("common.export"), value: "export" }
1531
1548
  ]);
1532
- function ne() {
1533
- const P = hn();
1549
+ function J() {
1550
+ const D = kn();
1534
1551
  l.open({
1535
1552
  title: a("inventory.ingredient.export.success"),
1536
- message: a("inventory.ingredient.export.filename", [P]),
1553
+ message: a("inventory.ingredient.export.filename", [D]),
1537
1554
  type: "success"
1538
1555
  });
1539
1556
  }
1540
- function ue() {
1557
+ function de() {
1541
1558
  n.open({
1542
1559
  title: a("inventory.ingredient.import.title"),
1543
- contentComponent: Pn,
1560
+ contentComponent: zn,
1544
1561
  overlay: !0,
1545
1562
  closeButton: !0,
1546
1563
  primaryActions: {
@@ -1556,15 +1573,15 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1556
1573
  close: !1,
1557
1574
  variant: "plain"
1558
1575
  }
1559
- }).onPrimary((P) => {
1560
- if (!P) {
1576
+ }).onPrimary((D) => {
1577
+ if (!D) {
1561
1578
  l.open({
1562
1579
  title: a("inventory.ingredient.import.error.noData"),
1563
1580
  type: "error"
1564
1581
  });
1565
1582
  return;
1566
1583
  }
1567
- if (!P.importCreateResult.length && !P.importUpdateResult.length) {
1584
+ if (!D.importCreateResult.length && !D.importUpdateResult.length) {
1568
1585
  l.open({
1569
1586
  title: a("inventory.ingredient.import.error.invalidContent"),
1570
1587
  message: a("inventory.ingredient.import.error.noImportData"),
@@ -1572,7 +1589,7 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1572
1589
  });
1573
1590
  return;
1574
1591
  }
1575
- if (P.importCreateResult.some(($) => $.errors.length) || P.importUpdateResult.some(($) => $.errors.length)) {
1592
+ if (D.importCreateResult.some(($) => $.errors.length) || D.importUpdateResult.some(($) => $.errors.length)) {
1576
1593
  l.open({
1577
1594
  title: a("inventory.ingredient.import.error.invalidContent"),
1578
1595
  message: a("inventory.ingredient.import.error.hasErrors"),
@@ -1580,29 +1597,29 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1580
1597
  });
1581
1598
  return;
1582
1599
  }
1583
- n.close(), _e(P);
1584
- }).onTertiary(_n);
1600
+ n.close(), ge(D);
1601
+ }).onTertiary(Vn);
1585
1602
  }
1586
- async function _e(P) {
1603
+ async function ge(D) {
1587
1604
  I.value = !0;
1588
1605
  try {
1589
1606
  const $ = [
1590
- ...P.importCreateResult.map(({ sku: T }) => ({ type: "create", sku: T })),
1591
- ...P.importUpdateResult.map(({ sku: T }) => ({ type: "update", sku: T }))
1592
- ], re = 100;
1593
- let se = 0;
1594
- const ee = () => {
1595
- se += re, l.open({
1607
+ ...D.importCreateResult.map(({ sku: N }) => ({ type: "create", sku: N })),
1608
+ ...D.importUpdateResult.map(({ sku: N }) => ({ type: "update", sku: N }))
1609
+ ], ue = 100;
1610
+ let ae = 0;
1611
+ const re = () => {
1612
+ ae += ue, l.open({
1596
1613
  title: a("inventory.ingredient.import.progress", [
1597
- Math.min(se, $.length),
1614
+ Math.min(ae, $.length),
1598
1615
  $.length
1599
1616
  ])
1600
1617
  });
1601
1618
  };
1602
- for (const T of $.chunk(100))
1603
- ee(), await o.importSkus({
1604
- create: T.filter((O) => O.type === "create").map((O) => O.sku),
1605
- update: T.filter((O) => O.type === "update").map((O) => O.sku)
1619
+ for (const N of $.chunk(100))
1620
+ re(), await o.importSkus({
1621
+ create: N.filter((z) => z.type === "create").map((z) => z.sku),
1622
+ update: N.filter((z) => z.type === "update").map((z) => z.sku)
1606
1623
  });
1607
1624
  l.open({
1608
1625
  title: a("inventory.ingredient.import.success"),
@@ -1613,21 +1630,21 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1613
1630
  title: a("inventory.ingredient.import.error.failed"),
1614
1631
  message: a("inventory.ingredient.import.error.systemMessage", [$ == null ? void 0 : $.message]),
1615
1632
  type: "error"
1616
- }), console.error("Error in importing skus", P, $);
1633
+ }), console.error("Error in importing skus", D, $);
1617
1634
  } finally {
1618
1635
  I.value = !1;
1619
1636
  }
1620
1637
  }
1621
- return (P, $) => {
1622
- const re = C("FmTable"), se = C("FmCollapsibleTabs"), ee = C("FmBottomSheet");
1623
- return f(), B(_t, {
1624
- title: m(a)("inventory.ingredient.title"),
1625
- actions: q.value,
1638
+ return (D, $) => {
1639
+ const ue = C("FmTable"), ae = C("FmCollapsibleTabs"), re = C("FmBottomSheet");
1640
+ return f(), P(Vt, {
1641
+ title: d(a)("inventory.ingredient.title"),
1642
+ actions: H.value,
1626
1643
  "onClick:action": _
1627
1644
  }, {
1628
1645
  default: V(() => [
1629
- u("div", {
1630
- class: X([
1646
+ m("div", {
1647
+ class: ee([
1631
1648
  "flex flex-col gap-8 max-h-full",
1632
1649
  {
1633
1650
  "p-0": v.value,
@@ -1635,40 +1652,40 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1635
1652
  }
1636
1653
  ])
1637
1654
  }, [
1638
- p(xt, {
1655
+ c(St, {
1639
1656
  searchable: "",
1640
1657
  search: U.value,
1641
- "onUpdate:search": $[0] || ($[0] = (T) => U.value = T)
1658
+ "onUpdate:search": $[0] || ($[0] = (N) => U.value = N)
1642
1659
  }, null, 8, ["search"]),
1643
- p(re, {
1644
- style: lt(m(J).tableHeight),
1645
- "column-defs": m(r),
1660
+ c(ue, {
1661
+ style: st(d(Z).tableHeight),
1662
+ "column-defs": d(s),
1646
1663
  "row-data": y.value,
1647
1664
  "search-value": U.value,
1648
- loading: !m(s)._currentLocation || N.value,
1665
+ loading: !d(r)._currentLocation || B.value,
1649
1666
  "loading-text": "Loading",
1650
- onRowClick: $[1] || ($[1] = (T) => m(k)(T.original)),
1667
+ onRowClick: $[1] || ($[1] = (N) => d(k)(N.original)),
1651
1668
  "page-size": R.value
1652
1669
  }, {
1653
- "list-row": V((T) => [
1654
- p(kt, {
1655
- row: T,
1656
- onRowClick: m(k)
1657
- }, qe({
1658
- default: V((O) => {
1659
- var me, e, t, c, x, E, F, G, H, te;
1670
+ "list-row": V((N) => [
1671
+ c(Ct, {
1672
+ row: N,
1673
+ onRowClick: d(k)
1674
+ }, We({
1675
+ default: V((z) => {
1676
+ var te, be, me, e, t, p, x, E, w, q;
1660
1677
  return [
1661
- u("div", Bn, [
1662
- u("div", Nn, [
1663
- p(m(ze), {
1664
- render: (t = (e = (me = O.code) == null ? void 0 : me.column) == null ? void 0 : e.columnDef) == null ? void 0 : t.cell,
1665
- props: (x = (c = O.code) == null ? void 0 : c.getContext) == null ? void 0 : x.call(c)
1678
+ m("div", Ln, [
1679
+ m("div", Hn, [
1680
+ c(d(Oe), {
1681
+ render: (me = (be = (te = z.code) == null ? void 0 : te.column) == null ? void 0 : be.columnDef) == null ? void 0 : me.cell,
1682
+ props: (t = (e = z.code) == null ? void 0 : e.getContext) == null ? void 0 : t.call(e)
1666
1683
  }, null, 8, ["render", "props"])
1667
1684
  ]),
1668
- u("div", Ln, [
1669
- p(m(ze), {
1670
- render: (G = (F = (E = O.name) == null ? void 0 : E.column) == null ? void 0 : F.columnDef) == null ? void 0 : G.cell,
1671
- props: (te = (H = O.name) == null ? void 0 : H.getContext) == null ? void 0 : te.call(H)
1685
+ m("div", On, [
1686
+ c(d(Oe), {
1687
+ render: (E = (x = (p = z.name) == null ? void 0 : p.column) == null ? void 0 : x.columnDef) == null ? void 0 : E.cell,
1688
+ props: (q = (w = z.name) == null ? void 0 : w.getContext) == null ? void 0 : q.call(w)
1672
1689
  }, null, 8, ["render", "props"])
1673
1690
  ])
1674
1691
  ])
@@ -1679,7 +1696,7 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1679
1696
  I.value ? {
1680
1697
  name: "loading-text",
1681
1698
  fn: V(() => [
1682
- u("div", null, D(m(a)("inventory.ingredient.table.importing")), 1)
1699
+ m("div", null, A(d(a)("inventory.ingredient.table.importing")), 1)
1683
1700
  ]),
1684
1701
  key: "0"
1685
1702
  } : void 0
@@ -1688,20 +1705,20 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1688
1705
  _: 1
1689
1706
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
1690
1707
  ], 2),
1691
- (f(), B(Pe, { to: "body" }, [
1692
- p(pn, at(rt(m(g))), null, 16)
1708
+ (f(), P(Ne, { to: "body" }, [
1709
+ c(yn, it(dt(d(g))), null, 16)
1693
1710
  ])),
1694
- (f(), B(Pe, { to: "body" }, [
1695
- p(ee, {
1711
+ (f(), P(Ne, { to: "body" }, [
1712
+ c(re, {
1696
1713
  "dismiss-away": "",
1697
- modelValue: Z.value,
1698
- "onUpdate:modelValue": $[3] || ($[3] = (T) => Z.value = T)
1714
+ modelValue: K.value,
1715
+ "onUpdate:modelValue": $[3] || ($[3] = (N) => K.value = N)
1699
1716
  }, {
1700
1717
  default: V(() => [
1701
- p(se, {
1718
+ c(ae, {
1702
1719
  class: "pb-8",
1703
1720
  items: L,
1704
- "onUpdate:modelValue": $[2] || ($[2] = (T) => z(T))
1721
+ "onUpdate:modelValue": $[2] || ($[2] = (N) => j(N))
1705
1722
  })
1706
1723
  ]),
1707
1724
  _: 1
@@ -1714,5 +1731,5 @@ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-
1714
1731
  }
1715
1732
  });
1716
1733
  export {
1717
- to as default
1734
+ lo as default
1718
1735
  };