@feedmepos/mf-inventory-portal 0.0.22-dev.43 → 0.0.22-dev.44

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 (38) hide show
  1. package/dist/ApprovalView-DJhk8ORX.js +140 -0
  2. package/dist/{BindingsDialog-CKjAs5mJ.js → BindingsDialog-CNY83IzG.js} +1 -1
  3. package/dist/{BindingsPicker-BAVZ-3dF.js → BindingsPicker-BCeGBlTl.js} +1 -1
  4. package/dist/{BindingsTable-qq8M9fzG.js → BindingsTable-DwN0rUr_.js} +1 -1
  5. package/dist/{ClosingTemplateView-DOLuHmy8.js → ClosingTemplateView-BE1JMBGd.js} +342 -349
  6. package/dist/{FmDroppableField-BBpVEZs4.js → FmDroppableField-DeZRIGOb.js} +13 -13
  7. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-ChRPq-Ok.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CptHxbFO.js} +3 -3
  8. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BGYVXLcj.js +435 -0
  9. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DrL5a2Pn.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-C0liaZ9Y.js} +1 -1
  10. package/dist/{IngredientsView-m5K8MlM2.js → IngredientsView-B6BPG_MN.js} +414 -417
  11. package/dist/{IntegrationView-BE5P68EJ.js → IntegrationView-CXurxj5t.js} +2 -2
  12. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B8cCv--C.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C4np_znK.js} +1 -1
  13. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CcM04Veu.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CvSRvT_i.js} +2 -2
  14. package/dist/{PurchaseOrderPrintPreview-D40E9qZt.js → PurchaseOrderPrintPreview-BYSkl_zL.js} +3 -3
  15. package/dist/{ReceiveRequestView-Ci7FgSjU.js → ReceiveRequestView-DWKEL17S.js} +31 -27
  16. package/dist/{RecipeView-Bp7iBiy7.js → RecipeView-DEZblbQT.js} +91 -88
  17. package/dist/{StockView-BzowFcFA.js → StockView-hijQ7wQL.js} +533 -525
  18. package/dist/{SupplierView-CbRnAb8G.js → SupplierView-B2xKGKCF.js} +776 -802
  19. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BMikyrhA.js → TransferDetails.vue_vue_type_script_setup_true_lang-CBwT8yGC.js} +5 -5
  20. package/dist/TransferTemplateView--2vvQWBW.js +1258 -0
  21. package/dist/{UnitView-B-058oRk.js → UnitView-B30FwZGg.js} +4 -4
  22. package/dist/{WarehouseView-RtU3sWKx.js → WarehouseView-BwbqpKwn.js} +14 -14
  23. package/dist/{app-By3PLx0q.js → app-DXZpbt33.js} +7334 -7251
  24. package/dist/app.js +1 -1
  25. package/dist/{decimal-CtriZ1S6.js → decimal-BVO6jH4l.js} +1 -1
  26. package/dist/{defineDeepModel-ClK3S9xx.js → defineDeepModel-DlkycC_t.js} +1 -1
  27. package/dist/{format-time-from-id-CGLKzJJO.js → format-time-from-id-Dhgv47T9.js} +1 -1
  28. package/dist/{format-unit-display-COeZSqdS.js → format-unit-display-D4D1b9F7.js} +15 -15
  29. package/dist/{supplier-BxBMThPQ.js → supplier-Beauc4QC.js} +1 -1
  30. package/dist/tsconfig.app.tsbuildinfo +1 -1
  31. package/dist/{use-template-enabled-locations-2-BIgPnzRW.js → use-template-enabled-locations-2-DbnvkOM9.js} +1 -1
  32. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +30 -0
  33. package/dist/{xlsx-X_0qJPDg.js → xlsx-DXqCVrb5.js} +1 -1
  34. package/dist/{xlsx.util-BOPzVbUa.js → xlsx.util-7VhQushh.js} +1 -1
  35. package/package.json +1 -1
  36. package/dist/ApprovalView-1ZKaZJ2Z.js +0 -128
  37. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BSxhRfE4.js +0 -359
  38. package/dist/TransferTemplateView-BwamiSyk.js +0 -1302
@@ -1,23 +1,23 @@
1
- import { ref as O, defineComponent as le, computed as C, resolveComponent as U, openBlock as g, createBlock as T, withCtx as S, createVNode as p, unref as u, createElementBlock as P, Fragment as q, createElementVNode as d, createCommentVNode as Y, onMounted as nt, watch as ze, normalizeClass as J, createTextVNode as He, toDisplayString as L, renderList as Q, isRef as Ee, createSlots as Oe, normalizeStyle as ot, Teleport as Re, normalizeProps as lt, guardReactiveProps as rt } from "vue";
2
- import { u as X, c as je, S as at, _ as st, A as ge, a as Ye, g as be, t as Ge, F as ue, R as xe, U as it, M as ut, d as Ae, b as qe, C as Ve, e as De, f as dt, h as ct, I as mt, i as pt } from "./app-By3PLx0q.js";
1
+ import { ref as N, defineComponent as ae, computed as C, resolveComponent as U, openBlock as g, createBlock as D, withCtx as S, createVNode as p, unref as u, createElementBlock as T, Fragment as q, createElementVNode as d, createCommentVNode as O, onMounted as nt, watch as ze, normalizeClass as Z, createTextVNode as He, toDisplayString as B, renderList as ee, isRef as Ee, createSlots as Oe, normalizeStyle as ot, Teleport as Re, normalizeProps as lt, guardReactiveProps as rt } from "vue";
2
+ import { u as te, c as je, S as at, _ as st, A as ge, a as Ye, g as be, t as Ge, F as de, R as xe, U as it, M as ut, d as Ae, b as qe, C as Ve, e as De, f as dt, h as mt, I as ct, i as pt } from "./app-DXZpbt33.js";
3
3
  import { useDialog as We, useSnackbar as he, useProxiedModel as Te, useDialogChild as vt, useBreakpoints as ft } from "@feedmepos/ui-library";
4
4
  import { i as yt, _ as gt } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
- import { F as G, D as Pe, R as ye } from "./row-action.enum-PMKMRrZR.js";
6
- import { useI18n as Z, useCoreStore as de } from "@feedmepos/mf-common";
5
+ import { F as j, D as Pe, R as ye } from "./row-action.enum-PMKMRrZR.js";
6
+ import { useI18n as ne, useCoreStore as me } from "@feedmepos/mf-common";
7
7
  import { defineStore as bt, storeToRefs as ht } from "pinia";
8
8
  import { c as _t, _ as xt, F as Be } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
9
- import { u as Vt, _ as kt, a as Ct } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BSxhRfE4.js";
9
+ import { u as Vt, _ as kt, a as Ct } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BGYVXLcj.js";
10
10
  import { g as wt, _ as ke, S as Ce } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
11
- import { _ as we } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-DrL5a2Pn.js";
11
+ import { _ as we } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-C0liaZ9Y.js";
12
12
  import { _ as Se } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
13
- import { t as Ke, d as Je, s as St, r as Ft } from "./xlsx.util-BOPzVbUa.js";
14
- import { F as Mt } from "./FmDroppableField-BBpVEZs4.js";
13
+ import { t as Ke, d as Je, s as St, r as Ft } from "./xlsx.util-7VhQushh.js";
14
+ import { F as Mt } from "./FmDroppableField-DeZRIGOb.js";
15
15
  const Fe = bt("ingredientForm", function() {
16
- const a = We(), f = he(), s = X(), n = O(!1), { t: l } = Z(), o = O();
17
- function m() {
16
+ const a = We(), f = he(), s = te(), n = N(!1), { t: l } = ne(), o = N();
17
+ function c() {
18
18
  const b = {
19
19
  unit: {},
20
- mode: G.CREATE,
20
+ mode: j.CREATE,
21
21
  show: !0,
22
22
  "onUpdate:show"(i) {
23
23
  o.value.show = i;
@@ -28,7 +28,7 @@ const Fe = bt("ingredientForm", function() {
28
28
  async function y(b) {
29
29
  const i = {
30
30
  unit: je(b),
31
- mode: G.UPDATE,
31
+ mode: j.UPDATE,
32
32
  show: !0,
33
33
  "onUpdate:show"(_) {
34
34
  o.value.show = _;
@@ -82,7 +82,7 @@ const Fe = bt("ingredientForm", function() {
82
82
  }).onPrimary(() => h(b));
83
83
  }
84
84
  return {
85
- createIngredient: m,
85
+ createIngredient: c,
86
86
  updateIngredient: y,
87
87
  deleteIngredient: v,
88
88
  ingredientDialogProps: o,
@@ -90,15 +90,15 @@ const Fe = bt("ingredientForm", function() {
90
90
  };
91
91
  });
92
92
  function It() {
93
- const { updateIngredient: r, deleteIngredient: a } = Fe(), { t: f } = Z();
93
+ const { updateIngredient: r, deleteIngredient: a } = Fe(), { t: f } = ne();
94
94
  async function s(l, o) {
95
- const m = je(o);
95
+ const c = je(o);
96
96
  if (l === ye.Edit) {
97
- await r(m);
97
+ await r(c);
98
98
  return;
99
99
  }
100
100
  if (l === ye.Delete) {
101
- await a(m);
101
+ await a(c);
102
102
  return;
103
103
  }
104
104
  }
@@ -119,10 +119,10 @@ function It() {
119
119
  id: "unit",
120
120
  header: () => f("inventory.ingredient.unit"),
121
121
  cell(l) {
122
- var m;
122
+ var c;
123
123
  const o = l.row.original;
124
124
  if (o.trackingMeasurement) {
125
- const y = (m = o.unit.measurements) == null ? void 0 : m.find(
125
+ const y = (c = o.unit.measurements) == null ? void 0 : c.find(
126
126
  (h) => h.id === o.trackingMeasurement
127
127
  );
128
128
  if (y)
@@ -153,7 +153,7 @@ function It() {
153
153
  }
154
154
  ] };
155
155
  }
156
- const Ut = /* @__PURE__ */ le({
156
+ const Ut = /* @__PURE__ */ ae({
157
157
  __name: "ConvertForm",
158
158
  props: {
159
159
  modelValue: {},
@@ -168,7 +168,7 @@ const Ut = /* @__PURE__ */ le({
168
168
  }), n = C(() => {
169
169
  var i;
170
170
  return (i = f.rootValue) == null ? void 0 : i._id;
171
- }), l = a, { t: o } = Z(), m = C({
171
+ }), l = a, { t: o } = ne(), c = C({
172
172
  get() {
173
173
  return !!f.modelValue;
174
174
  },
@@ -193,23 +193,23 @@ const Ut = /* @__PURE__ */ le({
193
193
  return i.measurement ? y.value.find((_) => _.value === i.measurement) ?? null : y.value.find((_) => _.value === null) ?? null;
194
194
  });
195
195
  return (i, _) => {
196
- const A = U("FmSwitch"), V = U("FmSelect"), F = U("FmCard");
197
- return g(), T(F, {
196
+ const R = U("FmSwitch"), V = U("FmSelect"), F = U("FmCard");
197
+ return g(), D(F, {
198
198
  variant: "outlined",
199
199
  class: "p-16 flex flex-col gap-16"
200
200
  }, {
201
201
  default: S(() => {
202
202
  var w, I;
203
203
  return [
204
- p(A, {
204
+ p(R, {
205
205
  value: "",
206
- "model-value": m.value,
207
- "onUpdate:modelValue": _[0] || (_[0] = (j) => m.value = j),
206
+ "model-value": c.value,
207
+ "onUpdate:modelValue": _[0] || (_[0] = (z) => c.value = z),
208
208
  label: u(o)("inventory.ingredient.convertible.title"),
209
209
  sublabel: u(o)("inventory.ingredient.convertible.subtitle"),
210
210
  labelPlacement: "right"
211
211
  }, null, 8, ["model-value", "label", "sublabel"]),
212
- m.value ? (g(), P(q, { key: 0 }, [
212
+ c.value ? (g(), T(q, { key: 0 }, [
213
213
  d("div", null, [
214
214
  p(V, {
215
215
  label: u(o)("inventory.ingredient.convertible.convertTo"),
@@ -225,7 +225,7 @@ const Ut = /* @__PURE__ */ le({
225
225
  "exclude-binding-id": n.value,
226
226
  rules: [u(ge)(1)]
227
227
  }, null, 8, ["id", "model-value", "exclude-binding-id", "rules"])
228
- ], 64)) : Y("", !0)
228
+ ], 64)) : O("", !0)
229
229
  ];
230
230
  }),
231
231
  _: 1
@@ -233,7 +233,7 @@ const Ut = /* @__PURE__ */ le({
233
233
  };
234
234
  }
235
235
  });
236
- function oe() {
236
+ function re() {
237
237
  return {
238
238
  low: 6,
239
239
  mid: 14
@@ -247,7 +247,7 @@ const $t = { class: "flex gap-8" }, Et = { class: "flex-1" }, Rt = { class: "fle
247
247
  class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
248
248
  }, Bt = { class: "flex flex-col gap-12" }, Lt = { class: "flex flex-col gap-4" }, Nt = { class: "fm-typo-en-title-sm-800" }, zt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ht = { class: "flex flex-col gap-4" }, Ot = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, jt = { class: "flex-1 p-12 flex flex-col gap-8" }, Yt = { class: "mx-auto" }, Gt = { class: "flex flex-col" }, qt = { class: "fm-typo-en-body-sm-600 translate-y-4" }, Wt = { class: "flex-1 p-12 flex flex-col gap-8" }, Kt = { class: "mx-auto" }, Jt = { class: "flex flex-col" }, Qt = { class: "fm-typo-en-body-sm-600 translate-y-4" }, Xt = { class: "flex-1 p-12 flex flex-col gap-8" }, Zt = { class: "mx-auto" }, en = { class: "flex flex-col" }, tn = { class: "fm-typo-en-body-sm-600 translate-y-4" };
249
249
  var Me = /* @__PURE__ */ ((r) => (r.Daily = "Daily", r.Consumables = "Consumables", r.ShortTerm = "Short term", r.Kitchen = "Kitchen", r))(Me || {});
250
- const nn = /* @__PURE__ */ le({
250
+ const nn = /* @__PURE__ */ ae({
251
251
  __name: "IngredientForm",
252
252
  props: {
253
253
  mode: {},
@@ -256,220 +256,220 @@ const nn = /* @__PURE__ */ le({
256
256
  },
257
257
  emits: ["update:modelValue", "click:submit"],
258
258
  setup(r, { expose: a, emit: f }) {
259
- var ie;
260
- const { t: s } = Z(), n = r, l = f, o = X(), m = de(), y = qe();
261
- function h(t) {
262
- if (t.length === 0) return;
263
- const e = t[0], c = n.modelValue ?? {
259
+ var X;
260
+ const { t: s } = ne(), n = r, l = f, o = te(), c = me(), y = qe();
261
+ function h(e) {
262
+ if (e.length === 0) return;
263
+ const t = e[0], m = n.modelValue ?? {
264
264
  unit: o.units.find((x) => x)
265
265
  };
266
- c.unit || (c.unit = e, l("update:modelValue", c));
266
+ m.unit || (m.unit = t, l("update:modelValue", m));
267
267
  }
268
268
  nt(() => {
269
269
  h(o.units);
270
- }), ze([() => o.units], ([t]) => {
271
- h(t);
270
+ }), ze([() => o.units], ([e]) => {
271
+ h(e);
272
272
  });
273
273
  function v() {
274
274
  l("click:submit");
275
275
  }
276
276
  const b = C({
277
277
  get() {
278
- var t;
279
- return ((t = n.modelValue) == null ? void 0 : t.code) ?? "";
278
+ var e;
279
+ return ((e = n.modelValue) == null ? void 0 : e.code) ?? "";
280
280
  },
281
- set(t) {
282
- const e = n.modelValue ? {
281
+ set(e) {
282
+ const t = n.modelValue ? {
283
283
  ...n.modelValue
284
284
  } : {};
285
- e.code = t, l("update:modelValue", e);
285
+ t.code = e, l("update:modelValue", t);
286
286
  }
287
287
  }), i = C({
288
288
  get() {
289
- var t;
290
- return ((t = n.modelValue) == null ? void 0 : t.name) ?? "";
289
+ var e;
290
+ return ((e = n.modelValue) == null ? void 0 : e.name) ?? "";
291
291
  },
292
- set(t) {
293
- const e = n.modelValue ? {
292
+ set(e) {
293
+ const t = n.modelValue ? {
294
294
  ...n.modelValue
295
295
  } : {};
296
- e.name = t, l("update:modelValue", e);
296
+ t.name = e, l("update:modelValue", t);
297
297
  }
298
298
  }), _ = C({
299
299
  get() {
300
- var e, c;
301
- const t = (c = (e = n.modelValue) == null ? void 0 : e.defaultCost) == null ? void 0 : c.costPerUnit;
302
- return t ? +Ye(t) : 0;
300
+ var t, m;
301
+ const e = (m = (t = n.modelValue) == null ? void 0 : t.defaultCost) == null ? void 0 : m.costPerUnit;
302
+ return e ? +Ye(e) : 0;
303
303
  },
304
- set(t) {
305
- var c, x, R, M;
306
- const e = n.modelValue ? {
304
+ set(e) {
305
+ var m, x, $, M;
306
+ const t = n.modelValue ? {
307
307
  ...n.modelValue
308
308
  } : {};
309
- e.defaultCost ?? (e.defaultCost = {
309
+ t.defaultCost ?? (t.defaultCost = {
310
310
  costPerUnit: {
311
311
  amount: 0,
312
312
  precision: 2,
313
- currency: ((c = be(m.currentCountry.value)) == null ? void 0 : c.currency) ?? "MYR"
313
+ currency: ((m = be(c.currentCountry.value)) == null ? void 0 : m.currency) ?? "MYR"
314
314
  },
315
- measurement: (M = (R = (x = n.modelValue) == null ? void 0 : x.unit) == null ? void 0 : R.measurements) == null ? void 0 : M.find(
316
- (N) => {
317
- var z;
318
- return N.id === ((z = n.modelValue) == null ? void 0 : z.trackingMeasurement);
315
+ measurement: (M = ($ = (x = n.modelValue) == null ? void 0 : x.unit) == null ? void 0 : $.measurements) == null ? void 0 : M.find(
316
+ (G) => {
317
+ var Y;
318
+ return G.id === ((Y = n.modelValue) == null ? void 0 : Y.trackingMeasurement);
319
319
  }
320
320
  )
321
- }), e.defaultCost.costPerUnit = {
322
- ...e.defaultCost.costPerUnit,
323
- ...Ge(+t, 4)
324
- }, l("update:modelValue", e);
321
+ }), t.defaultCost.costPerUnit = {
322
+ ...t.defaultCost.costPerUnit,
323
+ ...Ge(+e, 4)
324
+ }, l("update:modelValue", t);
325
325
  }
326
- }), A = C(() => {
327
- var e, c, x;
328
- const t = ((e = n.modelValue) == null ? void 0 : e.unit) ?? o.units.find((R) => R);
329
- return t ? {
330
- _id: t._id,
331
- measurement: (c = n.modelValue) == null ? void 0 : c.trackingMeasurement,
332
- name: ((x = t.measurements.find((R) => {
326
+ }), R = C(() => {
327
+ var t, m, x;
328
+ const e = ((t = n.modelValue) == null ? void 0 : t.unit) ?? o.units.find(($) => $);
329
+ return e ? {
330
+ _id: e._id,
331
+ measurement: (m = n.modelValue) == null ? void 0 : m.trackingMeasurement,
332
+ name: ((x = e.measurements.find(($) => {
333
333
  var M;
334
- return R.id === ((M = n.modelValue) == null ? void 0 : M.trackingMeasurement);
335
- })) == null ? void 0 : x.name) ?? t.name
334
+ return $.id === ((M = n.modelValue) == null ? void 0 : M.trackingMeasurement);
335
+ })) == null ? void 0 : x.name) ?? e.name
336
336
  } : null;
337
337
  }), V = C({
338
338
  get() {
339
- var t;
340
- return ((t = n.modelValue) == null ? void 0 : t.operationalGroup) ?? null;
339
+ var e;
340
+ return ((e = n.modelValue) == null ? void 0 : e.operationalGroup) ?? null;
341
341
  },
342
- set(t) {
343
- const e = n.modelValue ? {
342
+ set(e) {
343
+ const t = n.modelValue ? {
344
344
  ...n.modelValue
345
345
  } : {};
346
- e.operationalGroup = t, l("update:modelValue", e);
346
+ t.operationalGroup = e, l("update:modelValue", t);
347
347
  }
348
348
  }), F = C(
349
349
  () => [
350
350
  ...new Set(
351
- o.skus.map((t) => t.operationalGroup ?? "").filter((t) => t && !Object.values(Me).includes(t))
351
+ o.skus.map((e) => e.operationalGroup ?? "").filter((e) => e && !Object.values(Me).includes(e))
352
352
  )
353
353
  ].sort()
354
354
  ), w = C({
355
355
  get() {
356
356
  return V.value !== null;
357
357
  },
358
- set(t) {
359
- t ? V.value = "" : V.value = null;
358
+ set(e) {
359
+ e ? V.value = "" : V.value = null;
360
360
  }
361
361
  }), I = C(
362
- () => o.units.flatMap(({ name: t, _id: e, abbrev: c, measurements: x }) => [
362
+ () => o.units.flatMap(({ name: e, _id: t, abbrev: m, measurements: x }) => [
363
363
  {
364
- label: `${t}`,
364
+ label: `${e}`,
365
365
  value: null,
366
366
  displayAsSection: !0
367
367
  },
368
368
  {
369
- label: `${t} (${c})`,
370
- value: { _id: e },
369
+ label: `${e} (${m})`,
370
+ value: { _id: t },
371
371
  displayAsSection: !1
372
372
  },
373
- ...x.map(({ id: R, name: M, abbrev: N }) => ({
374
- label: `${M} (${N})`,
375
- value: { _id: e, measurement: R },
373
+ ...x.map(({ id: $, name: M, abbrev: G }) => ({
374
+ label: `${M} (${G})`,
375
+ value: { _id: t, measurement: $ },
376
376
  displayAsSection: !1
377
377
  }))
378
378
  ])
379
379
  );
380
- function j(t) {
381
- var e, c, x, R, M;
382
- return ((c = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : c._id) === ((x = t.value) == null ? void 0 : x._id) && ((R = n.modelValue) == null ? void 0 : R.trackingMeasurement) === ((M = t.value) == null ? void 0 : M.measurement);
380
+ function z(e) {
381
+ var t, m, x, $, M;
382
+ return ((m = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : m._id) === ((x = e.value) == null ? void 0 : x._id) && (($ = n.modelValue) == null ? void 0 : $.trackingMeasurement) === ((M = e.value) == null ? void 0 : M.measurement);
383
383
  }
384
- function ee(t) {
385
- var N, z;
386
- if (!t) return;
387
- const { _id: e, measurement: c } = t, x = c || void 0, R = o.units.find((ne) => ne._id === e);
388
- if (!R)
384
+ function se(e) {
385
+ var G, Y;
386
+ if (!e) return;
387
+ const { _id: t, measurement: m } = e, x = m || void 0, $ = o.units.find((le) => le._id === t);
388
+ if (!$)
389
389
  return;
390
390
  const M = n.modelValue ?? {};
391
- M.unit = R, M.trackingMeasurement = x, M.convert && (M.convert.measurement = x || null), y.enableTotalCost && (M.defaultCost = {
392
- measurement: R.measurements.find((ne) => ne.id === x),
391
+ M.unit = $, M.trackingMeasurement = x, M.convert && (M.convert.measurement = x || null), y.enableTotalCost && (M.defaultCost = {
392
+ measurement: $.measurements.find((le) => le.id === x),
393
393
  costPerUnit: {
394
- ...((N = M.defaultCost) == null ? void 0 : N.costPerUnit) ?? {
394
+ ...((G = M.defaultCost) == null ? void 0 : G.costPerUnit) ?? {
395
395
  amount: 0,
396
396
  precision: 2,
397
- currency: ((z = be(m.currentCountry.value)) == null ? void 0 : z.currency) ?? "MYR"
397
+ currency: ((Y = be(c.currentCountry.value)) == null ? void 0 : Y.currency) ?? "MYR"
398
398
  }
399
399
  }
400
400
  }), l("update:modelValue", M);
401
401
  }
402
402
  const ce = C({
403
403
  get() {
404
- var t;
405
- return ((t = n.modelValue) == null ? void 0 : t.convert) ?? null;
404
+ var e;
405
+ return ((e = n.modelValue) == null ? void 0 : e.convert) ?? null;
406
406
  },
407
- set(t) {
408
- const e = n.modelValue ? {
407
+ set(e) {
408
+ const t = n.modelValue ? {
409
409
  ...n.modelValue
410
410
  } : {};
411
- t ? e.convert = t : e.convert = null, l("update:modelValue", e);
411
+ e ? t.convert = e : t.convert = null, l("update:modelValue", t);
412
412
  }
413
- }), _e = C(() => ue.options.filter(
414
- (t) => t === ue.enum.FIFO || t === ue.enum.WAVG
415
- ).map((t) => ({
416
- label: s(`inventory.ingredient.valuationMethod.${t}`),
417
- value: t
418
- }))), me = C({
413
+ }), _e = C(() => de.options.filter(
414
+ (e) => e === de.enum.FIFO || e === de.enum.WAVG
415
+ ).map((e) => ({
416
+ label: s(`inventory.ingredient.valuationMethod.${e}`),
417
+ value: e
418
+ }))), pe = C({
419
419
  get() {
420
- var t;
421
- return ((t = n.modelValue) == null ? void 0 : t.valuation) ?? "WAVG";
420
+ var e;
421
+ return ((e = n.modelValue) == null ? void 0 : e.valuation) ?? "WAVG";
422
422
  },
423
- set(t) {
424
- const e = n.modelValue ? {
423
+ set(e) {
424
+ const t = n.modelValue ? {
425
425
  ...n.modelValue
426
426
  } : {};
427
- e.valuation = t, l("update:modelValue", e);
427
+ t.valuation = e, l("update:modelValue", t);
428
428
  }
429
- }), te = O();
429
+ }), J = N();
430
430
  a({
431
431
  validateInputs: () => {
432
- var t, e;
433
- (e = (t = te.value) == null ? void 0 : t.validateInputs) == null || e.call(t);
432
+ var e, t;
433
+ (t = (e = J.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
434
434
  },
435
435
  resetInputsValidation: () => {
436
- var t, e;
437
- (e = (t = te.value) == null ? void 0 : t.resetInputsValidation) == null || e.call(t);
436
+ var e, t;
437
+ (t = (e = J.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
438
438
  },
439
439
  resetInputs: () => {
440
- var t, e;
441
- (e = (t = te.value) == null ? void 0 : t.resetInputs) == null || e.call(t);
440
+ var e, t;
441
+ (t = (e = J.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
442
442
  }
443
443
  });
444
- const W = O(!1), re = C(
444
+ const W = N(!1), ve = C(
445
445
  () => {
446
- var t, e, c;
447
- return (t = n.modelValue) != null && t._id ? ((c = o.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : c.filter(
446
+ var e, t, m;
447
+ return (e = n.modelValue) != null && e._id ? ((m = o.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : m.filter(
448
448
  (x) => x.from === "INGREDIENT"
449
449
  )) ?? [] : [];
450
450
  }
451
- ), pe = C(
451
+ ), A = C(
452
452
  () => {
453
- var t, e, c;
454
- return (t = n.modelValue) != null && t._id ? ((c = o.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : c.filter(
453
+ var e, t, m;
454
+ return (e = n.modelValue) != null && e._id ? ((m = o.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : m.filter(
455
455
  (x) => x.from === "RECIPE"
456
456
  )) ?? [] : [];
457
457
  }
458
- ), ve = C(
458
+ ), E = C(
459
459
  () => {
460
- var t, e, c;
461
- return (t = n.modelValue) != null && t._id ? ((c = o.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : c.filter((x) => x.from === "MENU")) ?? [] : [];
460
+ var e, t, m;
461
+ return (e = n.modelValue) != null && e._id ? ((m = o.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : m.filter((x) => x.from === "MENU")) ?? [] : [];
462
462
  }
463
- ), E = C(
464
- () => o.skus.map((t) => ({ label: t.name, value: t.code }))
465
- ), $ = O((ie = n.modelValue) == null ? void 0 : ie.code);
466
- function ae(t) {
467
- var c;
468
- const e = t.el;
469
- e && ((c = e.querySelector("[x-should-scroll-into=true]")) == null || c.scrollIntoView());
463
+ ), ie = C(
464
+ () => o.skus.map((e) => ({ label: e.name, value: e.code }))
465
+ ), oe = N((X = n.modelValue) == null ? void 0 : X.code);
466
+ function ue(e) {
467
+ var m;
468
+ const t = e.el;
469
+ t && ((m = t.querySelector("[x-should-scroll-into=true]")) == null || m.scrollIntoView());
470
470
  }
471
- function K(t) {
472
- switch (t) {
471
+ function P(e) {
472
+ switch (e) {
473
473
  case Ve.MY:
474
474
  return "MYR";
475
475
  case Ve.SG:
@@ -480,82 +480,82 @@ const nn = /* @__PURE__ */ le({
480
480
  return "MYR";
481
481
  }
482
482
  }
483
- const se = C(
483
+ const H = C(
484
484
  () => {
485
- var t, e, c, x, R, M;
486
- return ((x = (c = (e = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : e.measurements) == null ? void 0 : c.find(
487
- (N) => {
488
- var z;
489
- return N.id === ((z = n.modelValue) == null ? void 0 : z.trackingMeasurement);
485
+ var e, t, m, x, $, M;
486
+ return ((x = (m = (t = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : m.find(
487
+ (G) => {
488
+ var Y;
489
+ return G.id === ((Y = n.modelValue) == null ? void 0 : Y.trackingMeasurement);
490
490
  }
491
- )) == null ? void 0 : x.abbrev) ?? ((M = (R = n.modelValue) == null ? void 0 : R.unit) == null ? void 0 : M.abbrev);
491
+ )) == null ? void 0 : x.abbrev) ?? ((M = ($ = n.modelValue) == null ? void 0 : $.unit) == null ? void 0 : M.abbrev);
492
492
  }
493
- ), D = C({
493
+ ), Q = C({
494
494
  get() {
495
- var t, e;
496
- return ((e = (t = n.modelValue) == null ? void 0 : t.thresholds) == null ? void 0 : e.low) ?? oe().low;
495
+ var e, t;
496
+ return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.low) ?? re().low;
497
497
  },
498
- set(t) {
498
+ set(e) {
499
499
  var x;
500
- const e = ((x = n.modelValue) == null ? void 0 : x.thresholds) ?? oe();
501
- e.low = t;
502
- const c = n.modelValue ? {
500
+ const t = ((x = n.modelValue) == null ? void 0 : x.thresholds) ?? re();
501
+ t.low = e;
502
+ const m = n.modelValue ? {
503
503
  ...n.modelValue
504
504
  } : {};
505
- c.thresholds = e, l("update:modelValue", c);
505
+ m.thresholds = t, l("update:modelValue", m);
506
506
  }
507
- }), B = C({
507
+ }), K = C({
508
508
  get() {
509
- var t, e;
510
- return ((e = (t = n.modelValue) == null ? void 0 : t.thresholds) == null ? void 0 : e.mid) ?? oe().mid;
509
+ var e, t;
510
+ return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ?? re().mid;
511
511
  },
512
- set(t) {
512
+ set(e) {
513
513
  var x;
514
- const e = ((x = n.modelValue) == null ? void 0 : x.thresholds) ?? oe();
515
- e.mid = t;
516
- const c = n.modelValue ? {
514
+ const t = ((x = n.modelValue) == null ? void 0 : x.thresholds) ?? re();
515
+ t.mid = e;
516
+ const m = n.modelValue ? {
517
517
  ...n.modelValue
518
518
  } : {};
519
- c.thresholds = e, l("update:modelValue", c);
519
+ m.thresholds = t, l("update:modelValue", m);
520
520
  }
521
521
  });
522
522
  function fe() {
523
- return function(e) {
524
- return typeof (e == null ? void 0 : e.low) != "number" || typeof (e == null ? void 0 : e.mid) != "number" ? "Required" : e.low >= e.mid ? "Days for red indicator should be less than yellow indicator." : !0;
523
+ return function(t) {
524
+ 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;
525
525
  };
526
526
  }
527
- return (t, e) => {
528
- const c = U("FmTextField"), x = U("FmLabel"), R = U("FmField"), M = U("FmMenuHeader"), N = U("FmMenuDivider"), z = U("FmMenuItem"), ne = U("FmMenu"), Ie = U("FmFormGroup"), Xe = U("FmSelect"), Ue = U("FmSwitch"), Ze = U("FmIcon"), et = U("FmCard"), $e = U("FmStepperField"), tt = U("FmForm");
529
- return g(), T(tt, {
530
- disabled: t.disabled,
527
+ return (e, t) => {
528
+ const m = U("FmTextField"), x = U("FmLabel"), $ = U("FmField"), M = U("FmMenuHeader"), G = U("FmMenuDivider"), Y = U("FmMenuItem"), le = U("FmMenu"), Ie = U("FmFormGroup"), Xe = U("FmSelect"), Ue = U("FmSwitch"), Ze = U("FmIcon"), et = U("FmCard"), $e = U("FmStepperField"), tt = U("FmForm");
529
+ return g(), D(tt, {
530
+ disabled: e.disabled,
531
531
  ref_key: "formRef",
532
- ref: te,
532
+ ref: J,
533
533
  class: "flex flex-col gap-32",
534
534
  onValidationSuccess: v
535
535
  }, {
536
536
  default: S(() => [
537
537
  d("div", $t, [
538
538
  d("div", Et, [
539
- p(c, {
539
+ p(m, {
540
540
  label: u(s)("inventory.ingredient.code"),
541
541
  "model-value": b.value,
542
- "onUpdate:modelValue": e[0] || (e[0] = (k) => b.value = k),
543
- rules: [u(xe)(), u(it)(E.value, $.value)],
542
+ "onUpdate:modelValue": t[0] || (t[0] = (k) => b.value = k),
543
+ rules: [u(xe)(), u(it)(ie.value, oe.value)],
544
544
  "label-mark": "required"
545
545
  }, null, 8, ["label", "model-value", "rules"])
546
546
  ]),
547
547
  d("div", Rt, [
548
- p(c, {
548
+ p(m, {
549
549
  label: u(s)("inventory.ingredient.name"),
550
550
  "model-value": i.value,
551
- "onUpdate:modelValue": e[1] || (e[1] = (k) => i.value = k),
551
+ "onUpdate:modelValue": t[1] || (t[1] = (k) => i.value = k),
552
552
  rules: [u(xe)()],
553
553
  "label-mark": "required"
554
554
  }, null, 8, ["label", "model-value", "rules"])
555
555
  ])
556
556
  ]),
557
557
  p(Ie, {
558
- "model-value": A.value,
558
+ "model-value": R.value,
559
559
  rules: [u(xe)()],
560
560
  "label-mark": "required"
561
561
  }, {
@@ -565,23 +565,23 @@ const nn = /* @__PURE__ */ le({
565
565
  }, null, 8, ["label"])
566
566
  ]),
567
567
  default: S(({ invalid: k }) => [
568
- p(ne, null, {
568
+ p(le, null, {
569
569
  "menu-button": S(() => [
570
- p(R, {
571
- class: J([
570
+ p($, {
571
+ class: Z([
572
572
  "fm-typo-en-body-lg-400",
573
573
  {
574
- "text-fm-color-typo-primary": !t.disabled,
575
- "text-fm-color-typo-disabled": t.disabled
574
+ "text-fm-color-typo-primary": !e.disabled,
575
+ "text-fm-color-typo-disabled": e.disabled
576
576
  }
577
577
  ]),
578
578
  invalid: k,
579
579
  "append-icon": "expand_more"
580
580
  }, {
581
581
  default: S(() => {
582
- var H;
582
+ var L;
583
583
  return [
584
- He(L((H = A.value) == null ? void 0 : H.name), 1)
584
+ He(B((L = R.value) == null ? void 0 : L.name), 1)
585
585
  ];
586
586
  }),
587
587
  _: 2
@@ -590,22 +590,22 @@ const nn = /* @__PURE__ */ le({
590
590
  default: S(() => [
591
591
  d("div", {
592
592
  class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
593
- onVnodeMounted: ae
593
+ onVnodeMounted: ue
594
594
  }, [
595
- (g(!0), P(q, null, Q(I.value, (H) => (g(), P(q, {
596
- key: H.label
595
+ (g(!0), T(q, null, ee(I.value, (L) => (g(), T(q, {
596
+ key: L.label
597
597
  }, [
598
- H.displayAsSection ? (g(), P(q, { key: 0 }, [
598
+ L.displayAsSection ? (g(), T(q, { key: 0 }, [
599
599
  p(M, {
600
- label: H.label
600
+ label: L.label
601
601
  }, null, 8, ["label"]),
602
- p(N)
603
- ], 64)) : (g(), T(z, {
602
+ p(G)
603
+ ], 64)) : (g(), D(Y, {
604
604
  key: 1,
605
- label: H.label,
606
- "model-value": j(H),
607
- onClick: (Rn) => ee(H.value),
608
- "x-should-scroll-into": `${j(H)}`
605
+ label: L.label,
606
+ "model-value": z(L),
607
+ onClick: (Rn) => se(L.value),
608
+ "x-should-scroll-into": `${z(L)}`
609
609
  }, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
610
610
  ], 64))), 128))
611
611
  ], 512)
@@ -615,11 +615,11 @@ const nn = /* @__PURE__ */ le({
615
615
  ]),
616
616
  _: 1
617
617
  }, 8, ["model-value", "rules"]),
618
- u(y).enableTotalCost ? (g(), T(Xe, {
618
+ u(y).enableTotalCost ? (g(), D(Xe, {
619
619
  key: 0,
620
620
  class: "col-span-1",
621
- "model-value": me.value,
622
- "onUpdate:modelValue": e[2] || (e[2] = (k) => me.value = k),
621
+ "model-value": pe.value,
622
+ "onUpdate:modelValue": t[2] || (t[2] = (k) => pe.value = k),
623
623
  items: _e.value
624
624
  }, {
625
625
  label: S(() => [
@@ -633,11 +633,11 @@ const nn = /* @__PURE__ */ le({
633
633
  })
634
634
  ]),
635
635
  _: 1
636
- }, 8, ["model-value", "items"])) : Y("", !0),
637
- u(y).enableTotalCost ? (g(), T(c, {
636
+ }, 8, ["model-value", "items"])) : O("", !0),
637
+ u(y).enableTotalCost ? (g(), D(m, {
638
638
  key: 1,
639
639
  "model-value": _.value,
640
- "onUpdate:modelValue": e[3] || (e[3] = (k) => _.value = k),
640
+ "onUpdate:modelValue": t[3] || (t[3] = (k) => _.value = k),
641
641
  rules: [u(ge)(0), u(ut)(4)]
642
642
  }, {
643
643
  label: S(() => [
@@ -651,16 +651,16 @@ const nn = /* @__PURE__ */ le({
651
651
  })
652
652
  ]),
653
653
  prepend: S(() => {
654
- var k, H;
654
+ var k, L;
655
655
  return [
656
- d("div", At, L(K(((k = u(m).currentCountry) == null ? void 0 : k.value) ?? u(Ae)) === "MYR" ? "RM" : K(((H = u(m).currentCountry) == null ? void 0 : H.value) ?? u(Ae))), 1)
656
+ d("div", At, B(P(((k = u(c).currentCountry) == null ? void 0 : k.value) ?? u(Ae)) === "MYR" ? "RM" : P(((L = u(c).currentCountry) == null ? void 0 : L.value) ?? u(Ae))), 1)
657
657
  ];
658
658
  }),
659
659
  append: S(() => [
660
- d("div", Dt, " / " + L(se.value), 1)
660
+ d("div", Dt, " / " + B(H.value), 1)
661
661
  ]),
662
662
  _: 1
663
- }, 8, ["model-value", "rules"])) : Y("", !0),
663
+ }, 8, ["model-value", "rules"])) : O("", !0),
664
664
  p(et, {
665
665
  variant: "outlined",
666
666
  class: "p-16 flex flex-col gap-16"
@@ -669,17 +669,17 @@ const nn = /* @__PURE__ */ le({
669
669
  p(Ue, {
670
670
  value: "",
671
671
  "model-value": w.value,
672
- "onUpdate:modelValue": e[4] || (e[4] = (k) => w.value = k),
672
+ "onUpdate:modelValue": t[4] || (t[4] = (k) => w.value = k),
673
673
  label: u(s)("inventory.ingredient.operational.applyOperationalGroup"),
674
674
  sublabel: u(s)("inventory.ingredient.operational.subtitle"),
675
675
  labelPlacement: "right"
676
676
  }, null, 8, ["model-value", "label", "sublabel"]),
677
- w.value ? (g(), T(ne, { key: 0 }, {
677
+ w.value ? (g(), D(le, { key: 0 }, {
678
678
  "menu-button": S(() => [
679
- p(c, {
679
+ p(m, {
680
680
  label: "Operational label",
681
681
  modelValue: V.value,
682
- "onUpdate:modelValue": e[5] || (e[5] = (k) => V.value = k),
682
+ "onUpdate:modelValue": t[5] || (t[5] = (k) => V.value = k),
683
683
  placeholder: "Input text or select preset"
684
684
  }, {
685
685
  append: S(() => [
@@ -692,89 +692,89 @@ const nn = /* @__PURE__ */ le({
692
692
  ]),
693
693
  default: S(() => [
694
694
  p(M, { label: "Preset" }),
695
- (g(!0), P(q, null, Q(Object.values(Me), (k) => (g(), T(z, {
695
+ (g(!0), T(q, null, ee(Object.values(Me), (k) => (g(), D(Y, {
696
696
  key: k,
697
697
  label: k,
698
698
  "model-value": V.value === k,
699
- onClick: (H) => V.value = k
699
+ onClick: (L) => V.value = k
700
700
  }, null, 8, ["label", "model-value", "onClick"]))), 128)),
701
- F.value.length ? (g(), T(M, {
701
+ F.value.length ? (g(), D(M, {
702
702
  key: 0,
703
703
  label: "Custom"
704
- })) : Y("", !0),
705
- (g(!0), P(q, null, Q(F.value, (k) => (g(), T(z, {
704
+ })) : O("", !0),
705
+ (g(!0), T(q, null, ee(F.value, (k) => (g(), D(Y, {
706
706
  key: k,
707
707
  label: k,
708
708
  "model-value": V.value === k,
709
- onClick: (H) => V.value = k
709
+ onClick: (L) => V.value = k
710
710
  }, null, 8, ["label", "model-value", "onClick"]))), 128))
711
711
  ]),
712
712
  _: 1
713
- })) : Y("", !0)
713
+ })) : O("", !0)
714
714
  ]),
715
715
  _: 1
716
716
  }),
717
717
  p(Ut, {
718
718
  "model-value": ce.value,
719
- "onUpdate:modelValue": e[6] || (e[6] = (k) => ce.value = k),
720
- "root-value": t.modelValue
719
+ "onUpdate:modelValue": t[6] || (t[6] = (k) => ce.value = k),
720
+ "root-value": e.modelValue
721
721
  }, null, 8, ["model-value", "root-value"]),
722
- t.mode !== u(G).CREATE ? (g(), P("div", Pt, [
722
+ e.mode !== u(j).CREATE ? (g(), T("div", Pt, [
723
723
  d("div", null, [
724
724
  p(Ue, {
725
725
  label: u(s)("inventory.ingredient.bindedItems.title"),
726
726
  modelValue: W.value,
727
- "onUpdate:modelValue": e[7] || (e[7] = (k) => W.value = k),
727
+ "onUpdate:modelValue": t[7] || (t[7] = (k) => W.value = k),
728
728
  "label-placement": "right"
729
729
  }, null, 8, ["label", "modelValue"])
730
730
  ]),
731
- W.value && re.value.length ? (g(), T(we, {
731
+ W.value && ve.value.length ? (g(), D(we, {
732
732
  key: 0,
733
733
  name: u(s)("inventory.ingredient.bindedItems.ingredient"),
734
- bindings: re.value
735
- }, null, 8, ["name", "bindings"])) : Y("", !0),
736
- W.value && pe.value.length ? (g(), T(we, {
734
+ bindings: ve.value
735
+ }, null, 8, ["name", "bindings"])) : O("", !0),
736
+ W.value && A.value.length ? (g(), D(we, {
737
737
  key: 1,
738
738
  name: u(s)("inventory.ingredient.bindedItems.recipe"),
739
- bindings: pe.value
740
- }, null, 8, ["name", "bindings"])) : Y("", !0),
741
- W.value && ve.value.length ? (g(), T(we, {
739
+ bindings: A.value
740
+ }, null, 8, ["name", "bindings"])) : O("", !0),
741
+ W.value && E.value.length ? (g(), D(we, {
742
742
  key: 2,
743
743
  name: u(s)("inventory.ingredient.bindedItems.menu"),
744
- bindings: ve.value
745
- }, null, 8, ["name", "bindings"])) : Y("", !0)
746
- ])) : Y("", !0),
744
+ bindings: E.value
745
+ }, null, 8, ["name", "bindings"])) : O("", !0)
746
+ ])) : O("", !0),
747
747
  d("div", Bt, [
748
748
  d("div", Lt, [
749
749
  p(Se, null, {
750
750
  default: S(() => [
751
- d("div", Nt, L(u(s)("inventory.ingredient.threshold.title")), 1)
751
+ d("div", Nt, B(u(s)("inventory.ingredient.threshold.title")), 1)
752
752
  ]),
753
753
  _: 1
754
754
  }),
755
- d("div", zt, L(u(s)("inventory.ingredient.threshold.subtitle")), 1)
755
+ d("div", zt, B(u(s)("inventory.ingredient.threshold.subtitle")), 1)
756
756
  ]),
757
757
  d("div", Ht, [
758
758
  p(Ie, {
759
- "model-value": { low: D.value, mid: B.value },
759
+ "model-value": { low: Q.value, mid: K.value },
760
760
  rules: [fe()]
761
761
  }, null, 8, ["model-value", "rules"]),
762
762
  d("div", Ot, [
763
763
  d("div", jt, [
764
764
  d("div", Yt, [
765
765
  p(ke, {
766
- days: D.value,
766
+ days: Q.value,
767
767
  level: u(Ce).low
768
768
  }, null, 8, ["days", "level"])
769
769
  ]),
770
770
  d("div", Gt, [
771
- d("div", qt, L(u(s)("inventory.ingredient.threshold.whenRemaining")), 1),
771
+ d("div", qt, B(u(s)("inventory.ingredient.threshold.whenRemaining")), 1),
772
772
  p($e, {
773
- modelValue: D.value,
774
- "onUpdate:modelValue": e[8] || (e[8] = (k) => D.value = k),
773
+ modelValue: Q.value,
774
+ "onUpdate:modelValue": t[8] || (t[8] = (k) => Q.value = k),
775
775
  rules: [u(ge)(0)]
776
776
  }, {
777
- append: S(() => e[10] || (e[10] = [
777
+ append: S(() => t[10] || (t[10] = [
778
778
  d("div", {
779
779
  class: "text-fm-color-typo-secondary",
780
780
  style: { "padding-right": "32px" }
@@ -784,7 +784,7 @@ const nn = /* @__PURE__ */ le({
784
784
  }, 8, ["modelValue", "rules"])
785
785
  ])
786
786
  ]),
787
- e[12] || (e[12] = d("div", {
787
+ t[12] || (t[12] = d("div", {
788
788
  class: "h-full bg-fm-color-neutral-gray-200 relative",
789
789
  style: { width: "1px" }
790
790
  }, [
@@ -796,18 +796,18 @@ const nn = /* @__PURE__ */ le({
796
796
  d("div", Wt, [
797
797
  d("div", Kt, [
798
798
  p(ke, {
799
- days: B.value,
799
+ days: K.value,
800
800
  level: u(Ce).mid
801
801
  }, null, 8, ["days", "level"])
802
802
  ]),
803
803
  d("div", Jt, [
804
- d("div", Qt, L(u(s)("inventory.ingredient.threshold.whenRemaining")), 1),
804
+ d("div", Qt, B(u(s)("inventory.ingredient.threshold.whenRemaining")), 1),
805
805
  p($e, {
806
- modelValue: B.value,
807
- "onUpdate:modelValue": e[9] || (e[9] = (k) => B.value = k),
806
+ modelValue: K.value,
807
+ "onUpdate:modelValue": t[9] || (t[9] = (k) => K.value = k),
808
808
  rules: [u(ge)(0)]
809
809
  }, {
810
- append: S(() => e[11] || (e[11] = [
810
+ append: S(() => t[11] || (t[11] = [
811
811
  d("div", {
812
812
  class: "text-fm-color-typo-secondary",
813
813
  style: { "padding-right": "32px" }
@@ -817,7 +817,7 @@ const nn = /* @__PURE__ */ le({
817
817
  }, 8, ["modelValue", "rules"])
818
818
  ])
819
819
  ]),
820
- e[13] || (e[13] = d("div", {
820
+ t[13] || (t[13] = d("div", {
821
821
  class: "h-full bg-fm-color-neutral-gray-200 relative",
822
822
  style: { width: "1px" }
823
823
  }, [
@@ -829,12 +829,12 @@ const nn = /* @__PURE__ */ le({
829
829
  d("div", Xt, [
830
830
  d("div", Zt, [
831
831
  p(ke, {
832
- days: B.value + 1,
832
+ days: K.value + 1,
833
833
  level: u(Ce).high
834
834
  }, null, 8, ["days", "level"])
835
835
  ]),
836
836
  d("div", en, [
837
- d("div", tn, L(u(s)("inventory.ingredient.threshold.stockIsStaple")), 1)
837
+ d("div", tn, B(u(s)("inventory.ingredient.threshold.stockIsStaple")), 1)
838
838
  ])
839
839
  ])
840
840
  ])
@@ -845,36 +845,36 @@ const nn = /* @__PURE__ */ le({
845
845
  }, 8, ["disabled"]);
846
846
  };
847
847
  }
848
- }), on = { class: "flex gap-4" }, ln = /* @__PURE__ */ le({
848
+ }), on = { class: "flex gap-4" }, ln = /* @__PURE__ */ ae({
849
849
  __name: "IngredientDialog",
850
850
  props: {
851
851
  show: { type: Boolean },
852
852
  unit: {},
853
- mode: { default: G.READ }
853
+ mode: { default: j.READ }
854
854
  },
855
855
  emits: ["update:show"],
856
856
  setup(r) {
857
- const a = r, f = X(), s = he(), { t: n } = Z(), l = Te(a, "show"), o = Te(a, "unit"), m = C(() => {
857
+ const a = r, f = te(), s = he(), { t: n } = ne(), l = Te(a, "show"), o = Te(a, "unit"), c = C(() => {
858
858
  switch (a.mode) {
859
- case G.READ:
859
+ case j.READ:
860
860
  return "";
861
- case G.UPDATE:
861
+ case j.UPDATE:
862
862
  return n("inventory.ingredient.update.title");
863
- case G.CREATE:
863
+ case j.CREATE:
864
864
  return n("inventory.ingredient.create.title");
865
865
  }
866
866
  return "";
867
867
  }), y = C(() => {
868
868
  switch (a.mode) {
869
- case G.READ:
869
+ case j.READ:
870
870
  return "";
871
- case G.UPDATE:
871
+ case j.UPDATE:
872
872
  return n("common.save");
873
- case G.CREATE:
873
+ case j.CREATE:
874
874
  return n("common.add");
875
875
  }
876
876
  return "";
877
- }), h = O(), v = O(!1);
877
+ }), h = N(), v = N(!1);
878
878
  async function b() {
879
879
  v.value = !0;
880
880
  try {
@@ -915,22 +915,22 @@ const nn = /* @__PURE__ */ le({
915
915
  var V, F;
916
916
  (F = (V = h.value) == null ? void 0 : V.validateInputs) == null || F.call(V);
917
917
  }
918
- function A() {
918
+ function R() {
919
919
  switch (a.mode) {
920
- case G.READ:
920
+ case j.READ:
921
921
  return;
922
- case G.UPDATE:
922
+ case j.UPDATE:
923
923
  return i();
924
- case G.CREATE:
924
+ case j.CREATE:
925
925
  return b();
926
926
  }
927
927
  }
928
928
  return (V, F) => {
929
929
  const w = U("FmButton"), I = U("FmSideSheet");
930
- return g(), T(I, {
930
+ return g(), D(I, {
931
931
  "model-value": u(l),
932
- "onUpdate:modelValue": F[3] || (F[3] = (j) => Ee(l) ? l.value = j : null),
933
- header: m.value,
932
+ "onUpdate:modelValue": F[3] || (F[3] = (z) => Ee(l) ? l.value = z : null),
933
+ header: c.value,
934
934
  "close-button": "",
935
935
  "dismiss-away": "",
936
936
  "max-width": 500
@@ -946,7 +946,7 @@ const nn = /* @__PURE__ */ le({
946
946
  disabled: v.value,
947
947
  label: u(n)("common.close"),
948
948
  variant: "tertiary",
949
- onClick: F[2] || (F[2] = (j) => l.value = !1)
949
+ onClick: F[2] || (F[2] = (z) => l.value = !1)
950
950
  }, null, 8, ["disabled", "label"])
951
951
  ])
952
952
  ]),
@@ -956,10 +956,10 @@ const nn = /* @__PURE__ */ le({
956
956
  ref_key: "hasValidationExpose",
957
957
  ref: h,
958
958
  modelValue: u(o),
959
- "onUpdate:modelValue": F[0] || (F[0] = (j) => Ee(o) ? o.value = j : null),
959
+ "onUpdate:modelValue": F[0] || (F[0] = (z) => Ee(o) ? o.value = z : null),
960
960
  mode: V.mode,
961
961
  disabled: v.value,
962
- "onClick:submit": F[1] || (F[1] = (j) => A())
962
+ "onClick:submit": F[1] || (F[1] = (z) => R())
963
963
  }, null, 8, ["modelValue", "mode", "disabled"])
964
964
  ]),
965
965
  _: 1
@@ -989,12 +989,12 @@ function dn(r) {
989
989
  return {
990
990
  code: r.code,
991
991
  name: r.name,
992
- unit: ((f = r.unit.measurements.find((m) => m.id === r.trackingMeasurement)) == null ? void 0 : f.abbrev) ?? r.unit.abbrev,
992
+ unit: ((f = r.unit.measurements.find((c) => c.id === r.trackingMeasurement)) == null ? void 0 : f.abbrev) ?? r.unit.abbrev,
993
993
  baseUnit: r.unit.abbrev,
994
994
  valuationMethod: r.valuation ?? "WAVG",
995
995
  pricePerUnit: (s = r.defaultCost) != null && s.costPerUnit ? +Ye((n = r.defaultCost) == null ? void 0 : n.costPerUnit) : 0,
996
- thresholdLow: ((l = r.thresholds) == null ? void 0 : l.low) ?? oe().low,
997
- thresholdMid: ((o = r.thresholds) == null ? void 0 : o.mid) ?? oe().mid
996
+ thresholdLow: ((l = r.thresholds) == null ? void 0 : l.low) ?? re().low,
997
+ thresholdMid: ((o = r.thresholds) == null ? void 0 : o.mid) ?? re().mid
998
998
  };
999
999
  }
1000
1000
  function Qe() {
@@ -1016,7 +1016,7 @@ function Qe() {
1016
1016
  id: "baseUnit",
1017
1017
  name: "Base unit"
1018
1018
  }
1019
- ], a = qe(), f = de(), s = be(f.currentCountry.value);
1019
+ ], a = qe(), f = me(), s = be(f.currentCountry.value);
1020
1020
  return a.enableTotalCost && r.push(
1021
1021
  {
1022
1022
  id: "valuationMethod",
@@ -1037,25 +1037,25 @@ function Qe() {
1037
1037
  }
1038
1038
  ), r;
1039
1039
  }
1040
- function cn() {
1041
- const a = X().skus.map(dn), s = de().currentBusiness.value, n = Qe(), l = [
1040
+ function mn() {
1041
+ const a = te().skus.map(dn), s = me().currentBusiness.value, n = Qe(), l = [
1042
1042
  ["Business name:", s == null ? void 0 : s.name],
1043
1043
  ["Business ID:", s == null ? void 0 : s._id],
1044
1044
  ["Menu version", s == null ? void 0 : s.menuVersion],
1045
1045
  [],
1046
1046
  n.map((h) => h.name),
1047
1047
  ...a.map((h) => n.map((v) => h[v.id]))
1048
- ], o = n.map((h) => `system:${h.id}`), m = Ke(l, o), y = `${s == null ? void 0 : s.name} ingredients (${dt(/* @__PURE__ */ new Date())}).xlsx`;
1049
- return Je(m, y), y;
1048
+ ], o = n.map((h) => `system:${h.id}`), c = Ke(l, o), y = `${s == null ? void 0 : s.name} ingredients (${dt(/* @__PURE__ */ new Date())}).xlsx`;
1049
+ return Je(c, y), y;
1050
1050
  }
1051
- function mn() {
1052
- const a = de().currentBusiness.value, f = Qe(), s = [
1051
+ function cn() {
1052
+ const a = me().currentBusiness.value, f = Qe(), s = [
1053
1053
  ["Business name:", a == null ? void 0 : a.name],
1054
1054
  ["Business ID:", a == null ? void 0 : a._id],
1055
1055
  ["Menu version", a == null ? void 0 : a.menuVersion],
1056
1056
  [],
1057
- f.map((m) => m.name)
1058
- ], n = f.map((m) => `system:${m.id}`), l = Ke(s, n), o = "FeedMe ingredients template.xlsx";
1057
+ f.map((c) => c.name)
1058
+ ], n = f.map((c) => `system:${c.id}`), l = Ke(s, n), o = "FeedMe ingredients template.xlsx";
1059
1059
  return Je(l, o), o;
1060
1060
  }
1061
1061
  function pn(r) {
@@ -1066,7 +1066,7 @@ function pn(r) {
1066
1066
  n,
1067
1067
  l,
1068
1068
  o,
1069
- ...m
1069
+ ...c
1070
1070
  ] = St(r);
1071
1071
  if (!a || !a.length || a.some((i) => i.length && !i.startsWith("system:")))
1072
1072
  throw new Error("Missing meta header. Excel file does not come from the template.");
@@ -1075,44 +1075,44 @@ function pn(r) {
1075
1075
  throw new Error(
1076
1076
  `Missing meta headers (${v.join()}). Excel file does not come from the template.`
1077
1077
  );
1078
- return m.map((i, _) => {
1079
- const A = {};
1078
+ return c.map((i, _) => {
1079
+ const R = {};
1080
1080
  for (const V in y) {
1081
1081
  const F = y[V];
1082
- Object.assign(A, { [F]: i[V] });
1082
+ Object.assign(R, { [F]: i[V] });
1083
1083
  }
1084
1084
  return {
1085
1085
  index: _,
1086
- data: A
1086
+ data: R
1087
1087
  };
1088
1088
  });
1089
1089
  }
1090
1090
  function Le(r, a, f) {
1091
1091
  var w;
1092
- const n = X().units, l = new Array(), o = f.filter((I) => I.data.code === r.code);
1092
+ const n = te().units, l = new Array(), o = f.filter((I) => I.data.code === r.code);
1093
1093
  o.length > 1 && l.push(
1094
1094
  `Code ${r.code} is already used in row ${o.map((I) => I.index + 6).join()}.`
1095
1095
  );
1096
- const m = n.find((I) => I.abbrev === r.baseUnit), y = m == null ? void 0 : m.measurements.find((I) => I.abbrev === r.unit);
1097
- if (!m)
1096
+ const c = n.find((I) => I.abbrev === r.baseUnit), y = c == null ? void 0 : c.measurements.find((I) => I.abbrev === r.unit);
1097
+ if (!c)
1098
1098
  l.push(`Cannot find base unit of symbol ${r.baseUnit}.`);
1099
1099
  else if (r.baseUnit !== r.unit && !y) {
1100
1100
  const I = `Cannot find unit conversion for ${r.baseUnit} with symbol ${r.unit || "[empty]"}.`;
1101
1101
  l.push(I);
1102
1102
  }
1103
- const h = ue.options.find(
1103
+ const h = de.options.find(
1104
1104
  (I) => I === r.valuationMethod
1105
1105
  );
1106
1106
  r.valuationMethod && !h && l.push(
1107
- `Expected valuation method to be one of ${ue.options.join()} but got ${r.valuationMethod} instead.`
1107
+ `Expected valuation method to be one of ${de.options.join()} but got ${r.valuationMethod} instead.`
1108
1108
  );
1109
- const b = de().currentCountry.value, i = (I) => `${I}`.length && mt()(I) === !0, _ = i(`${r.pricePerUnit}`) === !0 ? {
1109
+ const b = me().currentCountry.value, i = (I) => `${I}`.length && ct()(I) === !0, _ = i(`${r.pricePerUnit}`) === !0 ? {
1110
1110
  costPerUnit: {
1111
1111
  ...Ge(Number(r.pricePerUnit) || 0),
1112
1112
  currency: ((w = be(b)) == null ? void 0 : w.currency) ?? "MYR"
1113
1113
  },
1114
1114
  measurement: y
1115
- } : void 0, A = i(`${r.thresholdLow}`) && i(`${r.thresholdMid}`) ? {
1115
+ } : void 0, R = i(`${r.thresholdLow}`) && i(`${r.thresholdMid}`) ? {
1116
1116
  low: Number(r.thresholdLow) || 0,
1117
1117
  mid: Number(r.thresholdMid) || 0
1118
1118
  } : void 0;
@@ -1122,11 +1122,11 @@ function Le(r, a, f) {
1122
1122
  _id: sn(),
1123
1123
  code: r.code,
1124
1124
  name: r.name,
1125
- unit: m ?? n.find((I) => I) ?? un,
1125
+ unit: c ?? n.find((I) => I) ?? un,
1126
1126
  trackingMeasurement: y == null ? void 0 : y.id,
1127
1127
  valuation: h,
1128
1128
  defaultCost: _,
1129
- thresholds: A
1129
+ thresholds: R
1130
1130
  },
1131
1131
  errors: l,
1132
1132
  excelRowNumber: a + 6
@@ -1134,7 +1134,7 @@ function Le(r, a, f) {
1134
1134
  }
1135
1135
  function vn(r) {
1136
1136
  try {
1137
- const a = pn(r).filter((h) => h.data.code), s = X().skus, n = ct(s, "code"), l = a.filter((h) => !n[h.data.code]), o = a.filter((h) => n[h.data.code]), m = l.map(
1137
+ const a = pn(r).filter((h) => h.data.code), s = te().skus, n = mt(s, "code"), l = a.filter((h) => !n[h.data.code]), o = a.filter((h) => n[h.data.code]), c = l.map(
1138
1138
  (h) => Le(h.data, h.index, a)
1139
1139
  ), y = o.map((h) => {
1140
1140
  const v = Le(h.data, h.index, a), b = n[h.data.code];
@@ -1157,7 +1157,7 @@ function vn(r) {
1157
1157
  });
1158
1158
  return {
1159
1159
  invalidExcel: !1,
1160
- importCreateResult: m,
1160
+ importCreateResult: c,
1161
1161
  importUpdateResult: y
1162
1162
  };
1163
1163
  } catch (a) {
@@ -1172,7 +1172,7 @@ function vn(r) {
1172
1172
  const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-col" }, gn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, bn = {
1173
1173
  key: 0,
1174
1174
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
1175
- }, hn = { key: 0 }, Ne = /* @__PURE__ */ le({
1175
+ }, hn = { key: 0 }, Ne = /* @__PURE__ */ ae({
1176
1176
  __name: "ImportIngredientItem",
1177
1177
  props: {
1178
1178
  type: {},
@@ -1183,23 +1183,23 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1183
1183
  setup(r) {
1184
1184
  return (a, f) => {
1185
1185
  const s = U("FmIcon"), n = U("FmTooltip");
1186
- return g(), P("div", fn, [
1186
+ return g(), T("div", fn, [
1187
1187
  f[0] || (f[0] = d("div", null, "•", -1)),
1188
1188
  d("div", yn, [
1189
1189
  d("div", gn, [
1190
1190
  d("div", {
1191
- class: J({
1191
+ class: Z({
1192
1192
  "text-fm-color-system-error-300": a.errors.length
1193
1193
  })
1194
1194
  }, [
1195
- He(L(a.name) + " ", 1),
1196
- a.type === "create" ? (g(), P("span", bn, "(new)")) : Y("", !0)
1195
+ He(B(a.name) + " ", 1),
1196
+ a.type === "create" ? (g(), T("span", bn, "(new)")) : O("", !0)
1197
1197
  ], 2),
1198
- a.errors.length ? (g(), P("div", hn, [
1198
+ a.errors.length ? (g(), T("div", hn, [
1199
1199
  p(n, { "z-index": 50 }, {
1200
1200
  content: S(() => [
1201
1201
  d("ol", null, [
1202
- (g(!0), P(q, null, Q(a.errors, (l, o) => (g(), P("li", { key: o }, L(l), 1))), 128))
1202
+ (g(!0), T(q, null, ee(a.errors, (l, o) => (g(), T("li", { key: o }, B(l), 1))), 128))
1203
1203
  ])
1204
1204
  ]),
1205
1205
  default: S(() => [
@@ -1211,17 +1211,17 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1211
1211
  ]),
1212
1212
  _: 1
1213
1213
  })
1214
- ])) : Y("", !0)
1214
+ ])) : O("", !0)
1215
1215
  ]),
1216
1216
  d("div", {
1217
- class: J([
1217
+ class: Z([
1218
1218
  "fm-typo-en-body-sm-400",
1219
1219
  {
1220
1220
  "text-fm-color-system-error-200": a.errors.length,
1221
1221
  "text-fm-color-typo-secondary": !a.errors.length
1222
1222
  }
1223
1223
  ])
1224
- }, L(a.code), 3)
1224
+ }, B(a.code), 3)
1225
1225
  ])
1226
1226
  ]);
1227
1227
  };
@@ -1235,33 +1235,33 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1235
1235
  }, Sn = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Fn = {
1236
1236
  key: 0,
1237
1237
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
1238
- }, Mn = { class: "fm-typo-en-body-lg-600" }, In = /* @__PURE__ */ le({
1238
+ }, Mn = { class: "fm-typo-en-body-lg-600" }, In = /* @__PURE__ */ ae({
1239
1239
  __name: "ImportIngredients",
1240
1240
  setup(r) {
1241
- const a = O(null), f = vt(), s = he(), n = O(!1), l = O(new Array()), o = O([]), m = O([]), y = C(
1242
- () => !!l.value.length || o.value.some((i) => i.errors.length) || m.value.some((i) => i.errors.length)
1241
+ const a = N(null), f = vt(), s = he(), n = N(!1), l = N(new Array()), o = N([]), c = N([]), y = C(
1242
+ () => !!l.value.length || o.value.some((i) => i.errors.length) || c.value.some((i) => i.errors.length)
1243
1243
  ), h = C(
1244
- () => !!o.value.length || !!m.value.length
1245
- ), { t: v } = Z();
1244
+ () => !!o.value.length || !!c.value.length
1245
+ ), { t: v } = ne();
1246
1246
  async function b(i) {
1247
- l.value = [], o.value = [], m.value = [];
1247
+ l.value = [], o.value = [], c.value = [];
1248
1248
  try {
1249
1249
  n.value = !0;
1250
1250
  const [_] = await Promise.all([
1251
1251
  Ft(i),
1252
1252
  // fake buffer
1253
1253
  new Promise((F) => setTimeout(F, 1e3))
1254
- ]), A = _.SheetNames.find((F) => F);
1255
- if (!A) {
1254
+ ]), R = _.SheetNames.find((F) => F);
1255
+ if (!R) {
1256
1256
  l.value.push(v("inventory.ingredient.import.fileError.noSheet"));
1257
1257
  return;
1258
1258
  }
1259
- const V = vn(_.Sheets[A]);
1259
+ const V = vn(_.Sheets[R]);
1260
1260
  if (V.invalidExcel) {
1261
1261
  l.value.push(V.invalidExcelMessage ?? v("inventory.ingredient.import.fileError.invalidExcel"));
1262
1262
  return;
1263
1263
  }
1264
- if (o.value = V.importCreateResult, m.value = V.importUpdateResult, !o.value.length && !m.value.length) {
1264
+ if (o.value = V.importCreateResult, c.value = V.importUpdateResult, !o.value.length && !c.value.length) {
1265
1265
  l.value.push(v("inventory.ingredient.import.fileError.noData"));
1266
1266
  return;
1267
1267
  }
@@ -1282,11 +1282,11 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1282
1282
  return ze(a, (i) => {
1283
1283
  i && b(i);
1284
1284
  }), (i, _) => {
1285
- const A = U("FmCircularProgress"), V = U("FmIcon"), F = U("FmButton");
1286
- return g(), P("div", _n, [
1287
- d("div", xn, L(u(v)("inventory.ingredient.import.uploadDescription")), 1),
1285
+ const R = U("FmCircularProgress"), V = U("FmIcon"), F = U("FmButton");
1286
+ return g(), T("div", _n, [
1287
+ d("div", xn, B(u(v)("inventory.ingredient.import.uploadDescription")), 1),
1288
1288
  p(Mt, {
1289
- class: J({
1289
+ class: Z({
1290
1290
  "w-full": !0,
1291
1291
  "h-[200px]": !a.value
1292
1292
  }),
@@ -1300,7 +1300,7 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1300
1300
  fn: S(({ openFileDialog: w }) => [
1301
1301
  d("div", Vn, [
1302
1302
  d("div", {
1303
- class: J([
1303
+ class: Z([
1304
1304
  "fm-corner-radius-md p-16 flex items-center gap-16",
1305
1305
  {
1306
1306
  "border border-fm-color-neutral-gray-100": n.value,
@@ -1309,18 +1309,18 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1309
1309
  }
1310
1310
  ])
1311
1311
  }, [
1312
- n.value ? (g(), T(A, {
1312
+ n.value ? (g(), D(R, {
1313
1313
  key: 0,
1314
1314
  size: "md",
1315
1315
  color: "neutral-gray-200"
1316
- })) : (g(), T(V, {
1316
+ })) : (g(), D(V, {
1317
1317
  key: 1,
1318
1318
  name: y.value ? "error" : "attach_file",
1319
1319
  outline: "",
1320
1320
  color: y.value ? "system-error-300" : void 0
1321
1321
  }, null, 8, ["name", "color"])),
1322
1322
  d("div", {
1323
- class: J([
1323
+ class: Z([
1324
1324
  "fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
1325
1325
  {
1326
1326
  "text-fm-color-typo-disabled": n.value,
@@ -1328,9 +1328,9 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1328
1328
  }
1329
1329
  ])
1330
1330
  }, [
1331
- d("div", kn, L(a.value.name), 1)
1331
+ d("div", kn, B(a.value.name), 1)
1332
1332
  ], 2),
1333
- n.value ? Y("", !0) : (g(), P("div", Cn, [
1333
+ n.value ? O("", !0) : (g(), T("div", Cn, [
1334
1334
  p(F, {
1335
1335
  label: u(v)("inventory.ingredient.import.replaceFile"),
1336
1336
  variant: y.value ? "destructive" : "secondary",
@@ -1339,9 +1339,9 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1339
1339
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
1340
1340
  ]))
1341
1341
  ], 2),
1342
- l.value.length ? (g(), P("div", wn, [
1343
- (g(!0), P(q, null, Q(l.value, (I, j) => (g(), P("div", {
1344
- key: j,
1342
+ l.value.length ? (g(), T("div", wn, [
1343
+ (g(!0), T(q, null, ee(l.value, (I, z) => (g(), T("div", {
1344
+ key: z,
1345
1345
  class: "flex gap-8 items-center"
1346
1346
  }, [
1347
1347
  p(V, {
@@ -1349,47 +1349,49 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1349
1349
  size: "sm",
1350
1350
  color: "system-error-300"
1351
1351
  }),
1352
- d("div", Sn, L(I), 1)
1352
+ d("div", Sn, B(I), 1)
1353
1353
  ]))), 128))
1354
- ])) : Y("", !0)
1354
+ ])) : O("", !0)
1355
1355
  ])
1356
1356
  ]),
1357
1357
  key: "0"
1358
1358
  } : void 0
1359
1359
  ]), 1032, ["class", "label", "button-label"]),
1360
- h.value ? (g(), P("div", Fn, [
1361
- d("div", Mn, L(u(v)("inventory.ingredient.import.summary")), 1),
1362
- (g(!0), P(q, null, Q(o.value, (w) => (g(), T(Ne, {
1360
+ h.value ? (g(), T("div", Fn, [
1361
+ d("div", Mn, B(u(v)("inventory.ingredient.import.summary")), 1),
1362
+ (g(!0), T(q, null, ee(o.value, (w) => (g(), D(Ne, {
1363
1363
  key: w.sku._id,
1364
1364
  code: w.sku.code,
1365
1365
  name: w.sku.name,
1366
1366
  errors: w.errors,
1367
1367
  type: "create"
1368
1368
  }, null, 8, ["code", "name", "errors"]))), 128)),
1369
- (g(!0), P(q, null, Q(m.value, (w) => (g(), T(Ne, {
1369
+ (g(!0), T(q, null, ee(c.value, (w) => (g(), D(Ne, {
1370
1370
  key: w.sku._id,
1371
1371
  code: w.sku.code,
1372
1372
  name: w.sku.name,
1373
1373
  errors: w.errors,
1374
1374
  type: "update"
1375
1375
  }, null, 8, ["code", "name", "errors"]))), 128))
1376
- ])) : Y("", !0)
1376
+ ])) : O("", !0)
1377
1377
  ]);
1378
1378
  };
1379
1379
  }
1380
- }), Un = { class: "flex flex-col py-8" }, $n = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, En = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Wn = /* @__PURE__ */ le({
1380
+ }), Un = { class: "flex flex-col py-8" }, $n = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, En = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Wn = /* @__PURE__ */ ae({
1381
1381
  __name: "IngredientsView",
1382
1382
  setup(r) {
1383
- const a = X(), f = C(() => a.skus), s = pt(), n = We(), l = he(), { t: o } = Z(), { createIngredient: m, updateIngredient: y } = Fe(), { ingredientDialogProps: h, ingredientViewLoading: v } = ht(Fe()), { columnDefs: b } = It();
1384
- function i(E) {
1385
- switch (E) {
1383
+ const a = te(), f = C(() => a.skus), s = pt(), n = We(), l = he(), { t: o } = ne(), { createIngredient: c, updateIngredient: y } = Fe(), { ingredientDialogProps: h, ingredientViewLoading: v } = ht(Fe()), { columnDefs: b } = It();
1384
+ function i(A) {
1385
+ switch (A) {
1386
1386
  case "add":
1387
- return m();
1387
+ return c();
1388
1388
  case "import":
1389
- return re();
1389
+ return W();
1390
+ case "export":
1391
+ return J();
1390
1392
  }
1391
1393
  }
1392
- const _ = O(""), A = O(!1), V = C(() => A.value || v.value), { breakpoints: F } = ft(), w = C(() => F.value.xs || F.value.sm), I = C(() => w.value ? 10 : 20), j = Vt(), ee = O(!1), ce = [
1394
+ const _ = N(""), R = N(!1), V = C(() => R.value || v.value), { breakpoints: F } = ft(), w = C(() => F.value.xs || F.value.sm), I = C(() => w.value ? 10 : 20), z = Vt(), se = N(!1), ce = [
1393
1395
  {
1394
1396
  value: "import",
1395
1397
  label: o("common.import")
@@ -1399,34 +1401,33 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1399
1401
  label: o("common.export")
1400
1402
  }
1401
1403
  ];
1402
- function _e(E) {
1403
- switch (ee.value = !1, E) {
1404
+ function _e(A) {
1405
+ switch (se.value = !1, A) {
1404
1406
  case "import":
1405
- return re();
1406
- case "export":
1407
1407
  return W();
1408
+ case "export":
1409
+ return J();
1408
1410
  }
1409
1411
  }
1410
- const me = C(() => w.value ? [{ icon: "more_vert", onClick: ve }] : [{ icon: "ios_share", onClick: W }]), te = C(() => {
1411
- const E = [
1412
- {
1413
- label: o("inventory.ingredient.create.title"),
1414
- value: "add",
1415
- isPrimary: !0,
1416
- prependIcon: "add"
1417
- }
1418
- ];
1419
- return w.value ? E : [...E, { label: o("inventory.ingredient.import.title"), value: "import" }];
1420
- });
1421
- function W() {
1422
- const E = cn();
1412
+ const pe = C(() => [
1413
+ {
1414
+ label: o("inventory.ingredient.create.title"),
1415
+ value: "add",
1416
+ isPrimary: !0,
1417
+ prependIcon: "add"
1418
+ },
1419
+ { label: o("common.import"), value: "import" },
1420
+ { label: o("common.export"), value: "export" }
1421
+ ]);
1422
+ function J() {
1423
+ const A = mn();
1423
1424
  l.open({
1424
1425
  title: o("inventory.ingredient.export.success"),
1425
- message: o("inventory.ingredient.export.filename", [E]),
1426
+ message: o("inventory.ingredient.export.filename", [A]),
1426
1427
  type: "success"
1427
1428
  });
1428
1429
  }
1429
- function re() {
1430
+ function W() {
1430
1431
  n.open({
1431
1432
  title: o("inventory.ingredient.import.title"),
1432
1433
  contentComponent: In,
@@ -1445,15 +1446,15 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1445
1446
  close: !1,
1446
1447
  variant: "plain"
1447
1448
  }
1448
- }).onPrimary((E) => {
1449
- if (!E) {
1449
+ }).onPrimary((A) => {
1450
+ if (!A) {
1450
1451
  l.open({
1451
1452
  title: o("inventory.ingredient.import.error.noData"),
1452
1453
  type: "error"
1453
1454
  });
1454
1455
  return;
1455
1456
  }
1456
- if (!E.importCreateResult.length && !E.importUpdateResult.length) {
1457
+ if (!A.importCreateResult.length && !A.importUpdateResult.length) {
1457
1458
  l.open({
1458
1459
  title: o("inventory.ingredient.import.error.invalidContent"),
1459
1460
  message: o("inventory.ingredient.import.error.noImportData"),
@@ -1461,7 +1462,7 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1461
1462
  });
1462
1463
  return;
1463
1464
  }
1464
- if (E.importCreateResult.some(($) => $.errors.length) || E.importUpdateResult.some(($) => $.errors.length)) {
1465
+ if (A.importCreateResult.some((E) => E.errors.length) || A.importUpdateResult.some((E) => E.errors.length)) {
1465
1466
  l.open({
1466
1467
  title: o("inventory.ingredient.import.error.invalidContent"),
1467
1468
  message: o("inventory.ingredient.import.error.hasErrors"),
@@ -1469,57 +1470,54 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1469
1470
  });
1470
1471
  return;
1471
1472
  }
1472
- n.close(), pe(E);
1473
- }).onTertiary(mn);
1473
+ n.close(), ve(A);
1474
+ }).onTertiary(cn);
1474
1475
  }
1475
- async function pe(E) {
1476
- A.value = !0;
1476
+ async function ve(A) {
1477
+ R.value = !0;
1477
1478
  try {
1478
- const $ = [
1479
- ...E.importCreateResult.map(({ sku: D }) => ({ type: "create", sku: D })),
1480
- ...E.importUpdateResult.map(({ sku: D }) => ({ type: "update", sku: D }))
1481
- ], ae = 100;
1482
- let K = 0;
1483
- const se = () => {
1484
- K += ae, l.open({
1479
+ const E = [
1480
+ ...A.importCreateResult.map(({ sku: P }) => ({ type: "create", sku: P })),
1481
+ ...A.importUpdateResult.map(({ sku: P }) => ({ type: "update", sku: P }))
1482
+ ], ie = 100;
1483
+ let oe = 0;
1484
+ const ue = () => {
1485
+ oe += ie, l.open({
1485
1486
  title: o("inventory.ingredient.import.progress", [
1486
- Math.min(K, $.length),
1487
- $.length
1487
+ Math.min(oe, E.length),
1488
+ E.length
1488
1489
  ])
1489
1490
  });
1490
1491
  };
1491
- for (const D of $.chunk(100))
1492
- se(), await a.importSkus({
1493
- create: D.filter((B) => B.type === "create").map((B) => B.sku),
1494
- update: D.filter((B) => B.type === "update").map((B) => B.sku)
1492
+ for (const P of E.chunk(100))
1493
+ ue(), await a.importSkus({
1494
+ create: P.filter((H) => H.type === "create").map((H) => H.sku),
1495
+ update: P.filter((H) => H.type === "update").map((H) => H.sku)
1495
1496
  });
1496
1497
  l.open({
1497
1498
  title: o("inventory.ingredient.import.success"),
1498
1499
  type: "success"
1499
1500
  });
1500
- } catch ($) {
1501
+ } catch (E) {
1501
1502
  l.open({
1502
1503
  title: o("inventory.ingredient.import.error.failed"),
1503
- message: o("inventory.ingredient.import.error.systemMessage", [$ == null ? void 0 : $.message]),
1504
+ message: o("inventory.ingredient.import.error.systemMessage", [E == null ? void 0 : E.message]),
1504
1505
  type: "error"
1505
- }), console.error("Error in importing skus", E, $);
1506
+ }), console.error("Error in importing skus", A, E);
1506
1507
  } finally {
1507
- A.value = !1;
1508
+ R.value = !1;
1508
1509
  }
1509
1510
  }
1510
- function ve() {
1511
- ee.value = !0;
1512
- }
1513
- return (E, $) => {
1514
- const ae = U("FmTable"), K = U("FmCollapsibleTabs"), se = U("FmBottomSheet");
1515
- return g(), T(kt, {
1511
+ return (A, E) => {
1512
+ const ie = U("FmTable"), oe = U("FmCollapsibleTabs"), ue = U("FmBottomSheet");
1513
+ return g(), D(kt, {
1516
1514
  title: u(o)("inventory.ingredient.title"),
1517
- actions: te.value,
1515
+ actions: pe.value,
1518
1516
  "onClick:action": i
1519
1517
  }, {
1520
1518
  default: S(() => [
1521
1519
  d("div", {
1522
- class: J([
1520
+ class: Z([
1523
1521
  "flex flex-col gap-8 max-h-full",
1524
1522
  {
1525
1523
  "p-0": w.value,
@@ -1530,38 +1528,37 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1530
1528
  p(Ct, {
1531
1529
  searchable: "",
1532
1530
  search: _.value,
1533
- "onUpdate:search": $[0] || ($[0] = (D) => _.value = D),
1534
- actions: me.value
1535
- }, null, 8, ["search", "actions"]),
1536
- p(ae, {
1537
- style: ot(u(j).tableHeight),
1531
+ "onUpdate:search": E[0] || (E[0] = (P) => _.value = P)
1532
+ }, null, 8, ["search"]),
1533
+ p(ie, {
1534
+ style: ot(u(z).tableHeight),
1538
1535
  "column-defs": u(b),
1539
1536
  "row-data": f.value,
1540
1537
  "search-value": _.value,
1541
1538
  loading: !u(s)._currentLocation || V.value,
1542
1539
  "loading-text": "Loading",
1543
- onRowClick: $[1] || ($[1] = (D) => u(y)(D.original)),
1540
+ onRowClick: E[1] || (E[1] = (P) => u(y)(P.original)),
1544
1541
  "page-size": I.value
1545
1542
  }, {
1546
- "list-row": S((D) => [
1543
+ "list-row": S((P) => [
1547
1544
  p(xt, {
1548
- row: D,
1545
+ row: P,
1549
1546
  onRowClick: u(y)
1550
1547
  }, Oe({
1551
- default: S((B) => {
1552
- var fe, ie, t, e, c, x, R, M, N, z;
1548
+ default: S((H) => {
1549
+ var Q, K, fe, X, e, t, m, x, $, M;
1553
1550
  return [
1554
1551
  d("div", Un, [
1555
1552
  d("div", $n, [
1556
1553
  p(u(Be), {
1557
- render: (t = (ie = (fe = B.code) == null ? void 0 : fe.column) == null ? void 0 : ie.columnDef) == null ? void 0 : t.cell,
1558
- props: (c = (e = B.code) == null ? void 0 : e.getContext) == null ? void 0 : c.call(e)
1554
+ render: (fe = (K = (Q = H.code) == null ? void 0 : Q.column) == null ? void 0 : K.columnDef) == null ? void 0 : fe.cell,
1555
+ props: (e = (X = H.code) == null ? void 0 : X.getContext) == null ? void 0 : e.call(X)
1559
1556
  }, null, 8, ["render", "props"])
1560
1557
  ]),
1561
1558
  d("div", En, [
1562
1559
  p(u(Be), {
1563
- render: (M = (R = (x = B.name) == null ? void 0 : x.column) == null ? void 0 : R.columnDef) == null ? void 0 : M.cell,
1564
- props: (z = (N = B.name) == null ? void 0 : N.getContext) == null ? void 0 : z.call(N)
1560
+ render: (x = (m = (t = H.name) == null ? void 0 : t.column) == null ? void 0 : m.columnDef) == null ? void 0 : x.cell,
1561
+ props: (M = ($ = H.name) == null ? void 0 : $.getContext) == null ? void 0 : M.call($)
1565
1562
  }, null, 8, ["render", "props"])
1566
1563
  ])
1567
1564
  ])
@@ -1569,10 +1566,10 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1569
1566
  }),
1570
1567
  _: 2
1571
1568
  }, [
1572
- A.value ? {
1569
+ R.value ? {
1573
1570
  name: "loading-text",
1574
1571
  fn: S(() => [
1575
- d("div", null, L(u(o)("inventory.ingredient.table.importing")), 1)
1572
+ d("div", null, B(u(o)("inventory.ingredient.table.importing")), 1)
1576
1573
  ]),
1577
1574
  key: "0"
1578
1575
  } : void 0
@@ -1581,20 +1578,20 @@ const fn = { class: "flex items-center gap-12 pl-8" }, yn = { class: "flex flex-
1581
1578
  _: 1
1582
1579
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
1583
1580
  ], 2),
1584
- (g(), T(Re, { to: "body" }, [
1581
+ (g(), D(Re, { to: "body" }, [
1585
1582
  p(ln, lt(rt(u(h))), null, 16)
1586
1583
  ])),
1587
- (g(), T(Re, { to: "body" }, [
1588
- p(se, {
1584
+ (g(), D(Re, { to: "body" }, [
1585
+ p(ue, {
1589
1586
  "dismiss-away": "",
1590
- modelValue: ee.value,
1591
- "onUpdate:modelValue": $[3] || ($[3] = (D) => ee.value = D)
1587
+ modelValue: se.value,
1588
+ "onUpdate:modelValue": E[3] || (E[3] = (P) => se.value = P)
1592
1589
  }, {
1593
1590
  default: S(() => [
1594
- p(K, {
1591
+ p(oe, {
1595
1592
  class: "pb-8",
1596
1593
  items: ce,
1597
- "onUpdate:modelValue": $[2] || ($[2] = (D) => _e(D))
1594
+ "onUpdate:modelValue": E[2] || (E[2] = (P) => _e(P))
1598
1595
  })
1599
1596
  ]),
1600
1597
  _: 1