@feedmepos/mf-inventory-portal 0.0.22-dev.29 → 0.0.22-dev.30

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 (50) hide show
  1. package/dist/{ApprovalView-Ba-tUg0r.js → ApprovalView-BowcCo8d.js} +4 -4
  2. package/dist/{BindingsDialog-BzE7RozX.js → BindingsDialog-CmmLVQTN.js} +1 -1
  3. package/dist/{BindingsPicker-21frBXLS.js → BindingsPicker-BErHbcxb.js} +1 -1
  4. package/dist/{BindingsTable-b5C-I-cP.js → BindingsTable-hrfbN6tX.js} +1 -1
  5. package/dist/{ClosingTemplateView-DMBAODHP.js → ClosingTemplateView-BVefCGpC.js} +374 -370
  6. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DeX65Yyd.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CXHh_Bti.js} +1 -1
  7. package/dist/IngredientsView-BqnUckSv.js +1817 -0
  8. package/dist/{IntegrationView-BMrUQaFT.js → IntegrationView-BEdAKS1I.js} +120 -120
  9. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D0Yw7F_u.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-pr7Sb7Om.js} +1 -1
  10. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-IS1pDkV9.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DsYwNO5N.js} +1 -1
  11. package/dist/{PurchaseOrderPrintPreview-CdOwEm2W.js → PurchaseOrderPrintPreview-DzaS_c8R.js} +1 -1
  12. package/dist/{ReceiveRequestView-B86diRXc.js → ReceiveRequestView-CU-bhIjl.js} +6 -6
  13. package/dist/{RecipeView-7zB4lKdK.js → RecipeView-CmETsz5e.js} +3 -3
  14. package/dist/{StockView-zoWR3C4k.js → StockView-BgmjwPbh.js} +6 -6
  15. package/dist/{SupplierView-C-1jW5ON.js → SupplierView-CDm5q1th.js} +3 -3
  16. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BWItuAd0.js → TransferDetails.vue_vue_type_script_setup_true_lang-BZJyhJu4.js} +4 -4
  17. package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-lybenWiw.js +1678 -0
  18. package/dist/TransferTemplateView-CSQ2XxFU.js +1232 -0
  19. package/dist/{UnitView-yFNEgTl_.js → UnitView-D7bcDkOX.js} +4 -4
  20. package/dist/{WarehouseView-CregM24b.js → WarehouseView-BJAKVdRs.js} +2 -2
  21. package/dist/api/inventory.d.ts +71 -82
  22. package/dist/{app-BsDFpmXX.js → app-A8ykBdGf.js} +12514 -12256
  23. package/dist/app.js +1 -1
  24. package/dist/components/FmFilterableMenuOptions.vue.d.ts +54 -0
  25. package/dist/{decimal-B4_Y3KEm.js → decimal-BC4EGBAX.js} +1 -1
  26. package/dist/{defineDeepModel-BYWYdjn7.js → defineDeepModel-Ckfkwau_.js} +3 -3
  27. package/dist/{format-time-from-id-xHkyagtQ.js → format-time-from-id-o1plVFRH.js} +3 -3
  28. package/dist/{id-to-date-BZG9rZhi.js → id-to-date-DyPIToei.js} +1 -1
  29. package/dist/{purchase-order-transaction-type-B2Vf-MS0.js → purchase-order-transaction-type-skN4AmEj.js} +3 -3
  30. package/dist/stores/inventory.d.ts +15 -0
  31. package/dist/stores/location.d.ts +420 -486
  32. package/dist/stores/netsuite.d.ts +1 -1
  33. package/dist/{supplier-B9WHfMl-.js → supplier-DV3Tg4TT.js} +1 -1
  34. package/dist/tsconfig.app.tsbuildinfo +1 -1
  35. package/dist/{use-template-enabled-locations-2-DMyd7rbX.js → use-template-enabled-locations-2-u_kejm-N.js} +1 -1
  36. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +852 -984
  37. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +852 -984
  38. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +996 -58
  39. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +1511 -104
  40. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +1417 -10
  41. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +71 -82
  42. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +1272 -2652
  43. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +399 -859
  44. package/dist/views/transfer-template/helpers/remove-deleted-skus.helper.d.ts +108 -223
  45. package/dist/{xlsx-BFdyFL_3.js → xlsx-CrHTSBmd.js} +1 -1
  46. package/dist/{xlsx.util-UUCw3Kgc.js → xlsx.util-hjzkZFnf.js} +2 -2
  47. package/package.json +1 -1
  48. package/dist/IngredientsView-C6Lxkg-R.js +0 -1758
  49. package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-5u4NM7G5.js +0 -1522
  50. package/dist/TransferTemplateView-DnKSCXki.js +0 -1210
@@ -1,68 +1,68 @@
1
- import { ref as S, h as x, computed as P, defineComponent as Y, openBlock as k, createElementBlock as F, createElementVNode as f, toDisplayString as A, createVNode as w, unref as c, Fragment as _e, renderList as Ce, resolveComponent as V, createBlock as B, withCtx as I, watch as Me, isRef as Pe, createTextVNode as ve, normalizeClass as Se, normalizeStyle as Fe, Teleport as Ae, normalizeProps as Ve, guardReactiveProps as Ie, mergeProps as Re } from "vue";
2
- import { u as Ue, _ as Ee, a as ze } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DeX65Yyd.js";
3
- import { useCoreStore as Ne, useI18n as q } from "@feedmepos/mf-common";
4
- import { useDialog as Q, useSnackbar as W, FmButtonVariant as be, components as R, useProxiedModel as Be, useBreakpoints as Le } from "@feedmepos/ui-library";
1
+ import { ref as F, h as x, computed as P, defineComponent as Y, openBlock as k, createElementBlock as S, createElementVNode as f, toDisplayString as I, createVNode as _, unref as c, Fragment as _e, renderList as Ce, resolveComponent as V, createBlock as B, withCtx as R, watch as Me, isRef as Pe, createTextVNode as ve, normalizeClass as Fe, normalizeStyle as Se, Teleport as Ae, normalizeProps as Ve, guardReactiveProps as Ie, mergeProps as Re } from "vue";
2
+ import { u as Ue, _ as Ee, a as ze } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CXHh_Bti.js";
3
+ import { useCoreStore as Ne, useI18n as J } from "@feedmepos/mf-common";
4
+ import { useDialog as Q, useSnackbar as W, FmButtonVariant as be, components as U, useProxiedModel as Be, useBreakpoints as Le } from "@feedmepos/ui-library";
5
5
  import { defineStore as we, storeToRefs as Ye } from "pinia";
6
- import { F as U, D as ye, R as E } from "./row-action.enum-PMKMRrZR.js";
7
- import { o as je, c as xe, j as ke, u as Ke, R as He, z as Je, i as qe, T as he } from "./app-BsDFpmXX.js";
8
- import { c as Ge, F as N, _ as Te } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
9
- import { f as Oe } from "./format-time-from-id-xHkyagtQ.js";
6
+ import { F as E, D as ye, R as z } from "./row-action.enum-PMKMRrZR.js";
7
+ import { o as je, c as xe, j as ke, u as Ke, R as Ge, A as He, z as Je, i as qe, T as he } from "./app-A8ykBdGf.js";
8
+ import { c as Oe, F as N, _ as Te } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
9
+ import { f as Qe } from "./format-time-from-id-o1plVFRH.js";
10
10
  import "vue-router";
11
- import { d as Qe } from "./defineDeepModel-BYWYdjn7.js";
12
- import { u as We } from "./use-template-enabled-locations-2-DMyd7rbX.js";
13
- const G = je((m, g) => {
11
+ import { d as We } from "./defineDeepModel-Ckfkwau_.js";
12
+ import { u as Xe } from "./use-template-enabled-locations-2-u_kejm-N.js";
13
+ const q = je((m, g) => {
14
14
  function v() {
15
- var t;
16
- return `business_${((t = Ne().currentBusiness.value) == null ? void 0 : t._id) ?? ""}`;
15
+ var s;
16
+ return `business_${((s = Ne().currentBusiness.value) == null ? void 0 : s._id) ?? ""}`;
17
17
  }
18
18
  return {
19
19
  async getRecentPublishingJob() {
20
- const s = v(), n = `${m.inventoryBackendUrl}/${s}/closing-template/publish/recent`;
21
- return g.get(n);
20
+ const t = v(), o = `${m.inventoryBackendUrl}/${t}/closing-template/publish/recent`;
21
+ return g.get(o);
22
22
  },
23
23
  async startNewPublish() {
24
- const s = v(), n = `${m.inventoryBackendUrl}/${s}/closing-template/publish`;
25
- return g.post(n);
24
+ const t = v(), o = `${m.inventoryBackendUrl}/${t}/closing-template/publish`;
25
+ return g.post(o);
26
26
  },
27
- async getTemplate(s) {
28
- const n = v(), t = `${m.inventoryBackendUrl}/${n}/closing-template/${s}`;
29
- return g.get(t);
27
+ async getTemplate(t) {
28
+ const o = v(), s = `${m.inventoryBackendUrl}/${o}/closing-template/${t}`;
29
+ return g.get(s);
30
30
  },
31
31
  async readTemplates() {
32
- const s = v(), n = `${m.inventoryBackendUrl}/${s}/closing-template`;
33
- return g.get(n);
32
+ const t = v(), o = `${m.inventoryBackendUrl}/${t}/closing-template`;
33
+ return g.get(o);
34
34
  },
35
- async createTemplate(s) {
36
- const n = v(), t = `${m.inventoryBackendUrl}/${n}/closing-template`;
37
- return g.post(t, s);
35
+ async createTemplate(t) {
36
+ const o = v(), s = `${m.inventoryBackendUrl}/${o}/closing-template`;
37
+ return g.post(s, t);
38
38
  },
39
- async updateTemplate(s) {
40
- const n = v(), t = `${m.inventoryBackendUrl}/${n}/closing-template`;
41
- return g.put(t, s);
39
+ async updateTemplate(t) {
40
+ const o = v(), s = `${m.inventoryBackendUrl}/${o}/closing-template`;
41
+ return g.put(s, t);
42
42
  },
43
- async deleteTemplate(s) {
44
- const n = v(), t = `${m.inventoryBackendUrl}/${n}/closing-template`;
45
- return g.delete(t, { _id: s._id, _rev: s._rev });
43
+ async deleteTemplate(t) {
44
+ const o = v(), s = `${m.inventoryBackendUrl}/${o}/closing-template`;
45
+ return g.delete(s, { _id: t._id, _rev: t._rev });
46
46
  }
47
47
  };
48
48
  }), O = we("closingTemplateActions", () => {
49
- const m = Q(), g = W(), v = G(), s = S({});
50
- function n() {
51
- s.value = {
52
- mode: U.CREATE,
49
+ const m = Q(), g = W(), v = q(), t = F({});
50
+ function o() {
51
+ t.value = {
52
+ mode: E.CREATE,
53
53
  show: !0,
54
54
  "onUpdate:show"(d) {
55
- s.value.show = d;
55
+ t.value.show = d;
56
56
  }
57
57
  };
58
58
  }
59
- function t(d) {
60
- s.value = {
61
- mode: U.UPDATE,
59
+ function s(d) {
60
+ t.value = {
61
+ mode: E.UPDATE,
62
62
  modelValue: d,
63
63
  show: !0,
64
64
  "onUpdate:show"(u) {
65
- s.value.show = u;
65
+ t.value.show = u;
66
66
  }
67
67
  };
68
68
  }
@@ -89,7 +89,7 @@ const G = je((m, g) => {
89
89
  u.value = !0;
90
90
  const [p] = await Promise.allSettled([
91
91
  v.deleteTemplate(d),
92
- new Promise((_) => setTimeout(_, 1e3))
92
+ new Promise((w) => setTimeout(w, 1e3))
93
93
  ]);
94
94
  if (p.status === "rejected") throw p.reason;
95
95
  g.open({
@@ -107,71 +107,71 @@ const G = je((m, g) => {
107
107
  }
108
108
  });
109
109
  }
110
- const a = S({});
111
- function i(d) {
112
- a.value = {
110
+ const n = F({});
111
+ function r(d) {
112
+ n.value = {
113
113
  template: d,
114
114
  show: !0,
115
115
  "onUpdate:show"(u) {
116
- a.value.show = u;
116
+ n.value.show = u;
117
117
  },
118
118
  "onAction:edit"() {
119
- a.value.show = !1, t(xe(d));
119
+ n.value.show = !1, s(xe(d));
120
120
  }
121
121
  };
122
122
  }
123
123
  return {
124
- createTemplate: n,
125
- viewTemplate: i,
126
- updateTemplate: t,
124
+ createTemplate: o,
125
+ viewTemplate: r,
126
+ updateTemplate: s,
127
127
  deleteTemplate: b,
128
- templateDialogProps: s,
129
- templateDetailsProps: a
128
+ templateDialogProps: t,
129
+ templateDetailsProps: n
130
130
  };
131
131
  }), De = we(
132
132
  "closingTable",
133
133
  function() {
134
- const { t: g } = q(), { viewTemplate: v, updateTemplate: s, deleteTemplate: n } = O(), t = S({}), b = S(new Array()), a = S(!1), i = ke(), d = G();
134
+ const { t: g } = J(), { viewTemplate: v, updateTemplate: t, deleteTemplate: o } = O(), s = F({}), b = F(new Array()), n = F(!1), r = ke(), d = q();
135
135
  async function u() {
136
- if (b.value = [], !!i._currentLocation) {
137
- a.value = !0;
136
+ if (b.value = [], !!r._currentLocation) {
137
+ n.value = !0;
138
138
  try {
139
- const [e, o] = await Promise.all([
139
+ const [e, l] = await Promise.all([
140
140
  d.readTemplates(),
141
141
  d.getRecentPublishingJob()
142
142
  ]).delayed(1e3);
143
- b.value = e, t.value = o;
143
+ b.value = e, s.value = l;
144
144
  } catch (e) {
145
145
  console.log("Something went wrong when fetching templates:", e);
146
146
  } finally {
147
- a.value = !1;
147
+ n.value = !1;
148
148
  }
149
149
  }
150
150
  }
151
151
  async function y(e) {
152
- if (!b.value.find((o) => o._id) && i._currentLocation) {
153
- a.value = !0;
152
+ if (!b.value.find((l) => l._id) && r._currentLocation) {
153
+ n.value = !0;
154
154
  try {
155
- const [o] = await Promise.all([
155
+ const [l] = await Promise.all([
156
156
  d.getTemplate(e),
157
157
  new Promise((h) => setTimeout(h, 1e3))
158
158
  ]);
159
- b.value = [o];
160
- } catch (o) {
161
- console.log("Something went wrong when fetching templates:", o);
159
+ b.value = [l];
160
+ } catch (l) {
161
+ console.log("Something went wrong when fetching templates:", l);
162
162
  } finally {
163
- a.value = !1;
163
+ n.value = !1;
164
164
  }
165
165
  }
166
166
  }
167
- function p(e, o) {
168
- switch (o = xe(o), e) {
169
- case E.Details:
170
- return v(o);
171
- case E.Edit:
172
- return s(o);
173
- case E.Delete:
174
- return n(o, a, u);
167
+ function p(e, l) {
168
+ switch (l = xe(l), e) {
169
+ case z.Details:
170
+ return v(l);
171
+ case z.Edit:
172
+ return t(l);
173
+ case z.Delete:
174
+ return o(l, n, u);
175
175
  }
176
176
  }
177
177
  return {
@@ -181,7 +181,7 @@ const G = je((m, g) => {
181
181
  accessorKey: "_id",
182
182
  header: () => g("inventory.closing.table.createdAt"),
183
183
  cell(e) {
184
- return Oe(`${e.getValue()}`);
184
+ return Qe(`${e.getValue()}`);
185
185
  },
186
186
  enableSorting: !0
187
187
  },
@@ -208,8 +208,8 @@ const G = je((m, g) => {
208
208
  header: () => "Enabled outlets",
209
209
  cell(e) {
210
210
  var h;
211
- const o = (h = e.row.original.locations) == null ? void 0 : h.length;
212
- return o ? `${o}` : "All";
211
+ const l = (h = e.row.original.locations) == null ? void 0 : h.length;
212
+ return l ? `${l}` : "All";
213
213
  },
214
214
  enableSorting: !1,
215
215
  meta: {
@@ -230,7 +230,7 @@ const G = je((m, g) => {
230
230
  enableSorting: !1,
231
231
  cell(e) {
232
232
  var C;
233
- const o = e.row.original, h = o._rev, D = (C = t.value.publishedRevs) == null ? void 0 : C[o._id], $ = h === D;
233
+ const l = e.row.original, h = l._rev, D = (C = s.value.publishedRevs) == null ? void 0 : C[l._id], $ = h === D;
234
234
  return x(
235
235
  "div",
236
236
  {
@@ -252,11 +252,11 @@ const G = je((m, g) => {
252
252
  {
253
253
  id: "action",
254
254
  cell(e) {
255
- const o = e.row.original, h = [
256
- ye[E.Edit],
257
- ye[E.Delete]
255
+ const l = e.row.original, h = [
256
+ ye[z.Edit],
257
+ ye[z.Delete]
258
258
  ];
259
- return Ge(h, (D) => p(D, o));
259
+ return Oe(h, (D) => p(D, l));
260
260
  },
261
261
  enableSorting: !1,
262
262
  size: 40,
@@ -266,27 +266,27 @@ const G = je((m, g) => {
266
266
  }
267
267
  }
268
268
  ],
269
- recentPublish: t,
269
+ recentPublish: s,
270
270
  templates: b,
271
- loading: a,
271
+ loading: n,
272
272
  fetchTemplates: u,
273
273
  loadTemplate: y
274
274
  };
275
275
  }
276
276
  );
277
277
  var L = /* @__PURE__ */ ((m) => (m.Name = "Name", m.Unit = "Unit", m.Delete = "Delete", m))(L || {});
278
- function Xe(m) {
278
+ function Ze(m) {
279
279
  return {
280
280
  columnDefs: P(() => {
281
- const v = m.items.map((n) => n.sku.unit.measurements.length).reduce((n, t) => Math.max(n, t), 0);
281
+ const v = m.items.map((o) => o.sku.unit.measurements.length).reduce((o, s) => Math.max(o, s), 0);
282
282
  return [
283
283
  {
284
284
  id: "Name",
285
285
  header: () => "Name",
286
286
  enableSorting: !1,
287
287
  size: 400,
288
- cell(n) {
289
- const t = n.row.original;
288
+ cell(o) {
289
+ const s = o.row.original;
290
290
  return x(
291
291
  "div",
292
292
  {
@@ -296,12 +296,12 @@ function Xe(m) {
296
296
  x(
297
297
  "span",
298
298
  { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary line-clamp-1" },
299
- t.sku.name
299
+ s.sku.name
300
300
  ),
301
301
  x(
302
302
  "span",
303
303
  { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary line-clamp-1" },
304
- t.sku.code
304
+ s.sku.code
305
305
  )
306
306
  ]
307
307
  );
@@ -312,14 +312,14 @@ function Xe(m) {
312
312
  header: () => "Enable unit",
313
313
  enableSorting: !1,
314
314
  size: "auto",
315
- cell(n) {
316
- var b, a, i;
317
- const t = n.row.original;
315
+ cell(o) {
316
+ var b, n, r;
317
+ const s = o.row.original;
318
318
  return x(
319
- R.FmFormGroup,
319
+ U.FmFormGroup,
320
320
  {
321
- value: t.sku.unit._id,
322
- modelValue: !((b = t.disabledMeasurements) != null && b.includes(t.sku.unit._id))
321
+ value: s.sku.unit._id,
322
+ modelValue: !((b = s.disabledMeasurements) != null && b.includes(s.sku.unit._id))
323
323
  },
324
324
  x(
325
325
  "div",
@@ -327,45 +327,45 @@ function Xe(m) {
327
327
  class: "flex items-center gap-4"
328
328
  },
329
329
  [
330
- x(R.FmCheckbox, {
331
- value: t.sku.unit._id,
332
- modelValue: !((a = t.disabledMeasurements) != null && a.includes(t.sku.unit._id)),
333
- disabled: m.disabled || !((i = t.disabledMeasurements) != null && i.includes(t.sku.unit._id)) && t.sku.unit.measurements.every(
330
+ x(U.FmCheckbox, {
331
+ value: s.sku.unit._id,
332
+ modelValue: !((n = s.disabledMeasurements) != null && n.includes(s.sku.unit._id)),
333
+ disabled: m.disabled || !((r = s.disabledMeasurements) != null && r.includes(s.sku.unit._id)) && s.sku.unit.measurements.every(
334
334
  (d) => {
335
335
  var u;
336
- return (u = t.disabledMeasurements) == null ? void 0 : u.includes(d.id);
336
+ return (u = s.disabledMeasurements) == null ? void 0 : u.includes(d.id);
337
337
  }
338
338
  ),
339
339
  "onUpdate:modelValue"(d) {
340
340
  var u;
341
341
  if (d)
342
342
  m.updateItem({
343
- ...t,
344
- disabledMeasurements: (u = t.disabledMeasurements) == null ? void 0 : u.filter(
345
- (y) => y !== t.sku.unit._id
343
+ ...s,
344
+ disabledMeasurements: (u = s.disabledMeasurements) == null ? void 0 : u.filter(
345
+ (y) => y !== s.sku.unit._id
346
346
  )
347
347
  });
348
348
  else {
349
- const y = t.disabledMeasurements ?? [];
349
+ const y = s.disabledMeasurements ?? [];
350
350
  m.updateItem({
351
- ...t,
352
- disabledMeasurements: [...y, t.sku.unit._id]
351
+ ...s,
352
+ disabledMeasurements: [...y, s.sku.unit._id]
353
353
  });
354
354
  }
355
355
  }
356
356
  }),
357
357
  x(
358
- R.FmTooltip,
358
+ U.FmTooltip,
359
359
  { zIndex: 51 },
360
360
  {
361
361
  content() {
362
- return t.sku.unit.abbrev;
362
+ return s.sku.unit.abbrev;
363
363
  },
364
364
  default() {
365
365
  return x(
366
366
  "div",
367
367
  { class: "line-clamp-2 fm-typo-en-body-lg-400" },
368
- t.sku.unit.abbrev
368
+ s.sku.unit.abbrev
369
369
  );
370
370
  }
371
371
  }
@@ -376,19 +376,19 @@ function Xe(m) {
376
376
  }
377
377
  },
378
378
  ...Array.from({ length: Math.max(v, 0) }).map(
379
- (n, t) => ({
380
- id: `measurement${t}`,
379
+ (o, s) => ({
380
+ id: `measurement${s}`,
381
381
  header: () => "",
382
382
  enableSorting: !1,
383
383
  size: "auto",
384
384
  cell(b) {
385
385
  var d, u, y, p;
386
- const a = b.row.original, i = a.sku.unit.measurements[t];
387
- return i ? x(
388
- R.FmFormGroup,
386
+ const n = b.row.original, r = n.sku.unit.measurements[s];
387
+ return r ? x(
388
+ U.FmFormGroup,
389
389
  {
390
- modelValue: !((d = a.disabledMeasurements) != null && d.includes(i.id)),
391
- value: i.id
390
+ modelValue: !((d = n.disabledMeasurements) != null && d.includes(r.id)),
391
+ value: r.id
392
392
  },
393
393
  x(
394
394
  "div",
@@ -396,43 +396,43 @@ function Xe(m) {
396
396
  class: "flex items-center gap-4"
397
397
  },
398
398
  [
399
- x(R.FmCheckbox, {
400
- value: i.id,
401
- modelValue: !((u = a.disabledMeasurements) != null && u.includes(i.id)),
402
- disabled: m.disabled || !((y = a.disabledMeasurements) != null && y.includes(i.id)) && ((p = a.disabledMeasurements) == null ? void 0 : p.includes(a.sku.unit._id)) && a.sku.unit.measurements.filter((_) => _.id != i.id).every((_) => {
399
+ x(U.FmCheckbox, {
400
+ value: r.id,
401
+ modelValue: !((u = n.disabledMeasurements) != null && u.includes(r.id)),
402
+ disabled: m.disabled || !((y = n.disabledMeasurements) != null && y.includes(r.id)) && ((p = n.disabledMeasurements) == null ? void 0 : p.includes(n.sku.unit._id)) && n.sku.unit.measurements.filter((w) => w.id != r.id).every((w) => {
403
403
  var e;
404
- return (e = a.disabledMeasurements) == null ? void 0 : e.includes(_.id);
404
+ return (e = n.disabledMeasurements) == null ? void 0 : e.includes(w.id);
405
405
  }),
406
- "onUpdate:modelValue"(_) {
406
+ "onUpdate:modelValue"(w) {
407
407
  var e;
408
- if (_)
408
+ if (w)
409
409
  m.updateItem({
410
- ...a,
411
- disabledMeasurements: (e = a.disabledMeasurements) == null ? void 0 : e.filter(
412
- (o) => o !== i.id
410
+ ...n,
411
+ disabledMeasurements: (e = n.disabledMeasurements) == null ? void 0 : e.filter(
412
+ (l) => l !== r.id
413
413
  )
414
414
  });
415
415
  else {
416
- const o = a.disabledMeasurements ?? [];
416
+ const l = n.disabledMeasurements ?? [];
417
417
  m.updateItem({
418
- ...a,
419
- disabledMeasurements: [...o, i.id]
418
+ ...n,
419
+ disabledMeasurements: [...l, r.id]
420
420
  });
421
421
  }
422
422
  }
423
423
  }),
424
424
  x(
425
- R.FmTooltip,
425
+ U.FmTooltip,
426
426
  { zIndex: 51 },
427
427
  {
428
428
  content() {
429
- return i.abbrev;
429
+ return r.abbrev;
430
430
  },
431
431
  default() {
432
432
  return x(
433
433
  "div",
434
434
  { class: "line-clamp-2 fm-typo-en-body-lg-400" },
435
- i.abbrev
435
+ r.abbrev
436
436
  );
437
437
  }
438
438
  }
@@ -446,21 +446,21 @@ function Xe(m) {
446
446
  {
447
447
  id: "Delete",
448
448
  header: "",
449
- cell(n) {
450
- const t = n.row.original;
449
+ cell(o) {
450
+ const s = o.row.original;
451
451
  return x(
452
452
  "div",
453
453
  { class: "w-full flex justify-end" },
454
- x(R.FmButton, {
454
+ x(U.FmButton, {
455
455
  class: "delete-button",
456
- key: t.sku._id,
456
+ key: s.sku._id,
457
457
  type: "button",
458
458
  icon: "delete",
459
459
  variant: "tertiary",
460
460
  size: "md",
461
461
  disabled: m.disabled,
462
462
  onClick: () => {
463
- m.deleteItem(t);
463
+ m.deleteItem(s);
464
464
  }
465
465
  })
466
466
  );
@@ -476,40 +476,40 @@ function Xe(m) {
476
476
  })
477
477
  };
478
478
  }
479
- const Ze = { class: "flex flex-col gap-16 py-12" }, et = { class: "flex" }, tt = { class: "flex-1 flex flex-col" }, st = { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, lt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ot = { class: "flex flex-col gap-4" }, nt = /* @__PURE__ */ Y({
479
+ const et = { class: "flex flex-col gap-16 py-12" }, tt = { class: "flex" }, st = { class: "flex-1 flex flex-col" }, lt = { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, ot = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, nt = { class: "flex flex-col gap-4" }, at = /* @__PURE__ */ Y({
480
480
  __name: "ClosingTemplateItem",
481
481
  props: {
482
482
  cellByColId: {},
483
483
  row: {}
484
484
  },
485
485
  setup(m) {
486
- const g = m, v = P(() => g.row), s = P(
487
- () => v.value.getVisibleCells().filter((n) => n.column.id !== L.Name && n.column.id !== L.Delete)
486
+ const g = m, v = P(() => g.row), t = P(
487
+ () => v.value.getVisibleCells().filter((o) => o.column.id !== L.Name && o.column.id !== L.Delete)
488
488
  );
489
- return (n, t) => {
490
- var b, a, i, d, u;
491
- return k(), F("div", Ze, [
492
- f("div", et, [
493
- f("div", tt, [
494
- f("div", st, A(v.value.original.sku.name), 1),
495
- f("div", lt, A(v.value.original.sku.code), 1)
489
+ return (o, s) => {
490
+ var b, n, r, d, u;
491
+ return k(), S("div", et, [
492
+ f("div", tt, [
493
+ f("div", st, [
494
+ f("div", lt, I(v.value.original.sku.name), 1),
495
+ f("div", ot, I(v.value.original.sku.code), 1)
496
496
  ]),
497
497
  f("div", null, [
498
- w(c(N), {
499
- render: (i = (a = (b = n.cellByColId[c(L).Delete]) == null ? void 0 : b.column) == null ? void 0 : a.columnDef) == null ? void 0 : i.cell,
500
- props: (u = (d = n.cellByColId[c(L).Delete]) == null ? void 0 : d.getContext) == null ? void 0 : u.call(d)
498
+ _(c(N), {
499
+ render: (r = (n = (b = o.cellByColId[c(L).Delete]) == null ? void 0 : b.column) == null ? void 0 : n.columnDef) == null ? void 0 : r.cell,
500
+ props: (u = (d = o.cellByColId[c(L).Delete]) == null ? void 0 : d.getContext) == null ? void 0 : u.call(d)
501
501
  }, null, 8, ["render", "props"])
502
502
  ])
503
503
  ]),
504
- f("div", ot, [
505
- t[0] || (t[0] = f("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, "Enabled units", -1)),
506
- (k(!0), F(_e, null, Ce(s.value, (y) => {
507
- var p, _, e;
508
- return k(), F("div", {
504
+ f("div", nt, [
505
+ s[0] || (s[0] = f("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, "Enabled units", -1)),
506
+ (k(!0), S(_e, null, Ce(t.value, (y) => {
507
+ var p, w, e;
508
+ return k(), S("div", {
509
509
  key: y.id
510
510
  }, [
511
- w(c(N), {
512
- render: (_ = (p = y.column) == null ? void 0 : p.columnDef) == null ? void 0 : _.cell,
511
+ _(c(N), {
512
+ render: (w = (p = y.column) == null ? void 0 : p.columnDef) == null ? void 0 : w.cell,
513
513
  props: (e = y.getContext) == null ? void 0 : e.call(y)
514
514
  }, null, 8, ["render", "props"])
515
515
  ]);
@@ -518,179 +518,183 @@ const Ze = { class: "flex flex-col gap-16 py-12" }, et = { class: "flex" }, tt =
518
518
  ]);
519
519
  };
520
520
  }
521
- }), at = { class: "flex flex-col gap-16" }, it = { class: "flex flex-col gap-24" }, rt = { class: "flex flex-col gap-16" }, ct = { class: "flex items-center" }, ut = { class: "flex flex-col gap-16" }, dt = { class: "flex items-center" }, mt = { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, pt = /* @__PURE__ */ Y({
521
+ }), it = { class: "flex flex-col gap-16" }, rt = { class: "flex flex-col gap-24" }, ct = { class: "flex flex-col gap-16" }, ut = { class: "flex items-center" }, dt = { class: "flex flex-col gap-16" }, mt = { class: "flex items-center" }, pt = { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, ft = /* @__PURE__ */ Y({
522
522
  __name: "ClosingTemplateForm",
523
523
  props: {
524
524
  modelValue: {},
525
525
  disabled: { type: Boolean }
526
526
  },
527
527
  setup(m, { expose: g }) {
528
- const v = m, s = Qe(), { t: n } = q(), t = Ke(), b = Q(), {
529
- promptSelectLocations: a,
530
- columnDefs: i,
528
+ const v = m, t = We(), { t: o } = J(), s = Ke(), b = Q(), {
529
+ promptSelectLocations: n,
530
+ columnDefs: r,
531
531
  rowData: d
532
- } = We({
532
+ } = Xe({
533
533
  getLocations() {
534
- return s.locations;
534
+ return t.locations;
535
535
  },
536
536
  setLocations(e) {
537
- s.locations = e;
537
+ t.locations = e;
538
538
  }
539
- }), u = S();
539
+ }), u = F();
540
540
  g({
541
541
  validateInputs: () => {
542
- var e, o;
543
- (o = (e = u.value) == null ? void 0 : e.validateInputs) == null || o.call(e);
542
+ var e, l;
543
+ (l = (e = u.value) == null ? void 0 : e.validateInputs) == null || l.call(e);
544
544
  },
545
545
  resetInputsValidation: () => {
546
- var e, o;
547
- (o = (e = u.value) == null ? void 0 : e.resetInputsValidation) == null || o.call(e);
546
+ var e, l;
547
+ (l = (e = u.value) == null ? void 0 : e.resetInputsValidation) == null || l.call(e);
548
548
  },
549
549
  resetInputs: () => {
550
- var e, o;
551
- (o = (e = u.value) == null ? void 0 : e.resetInputs) == null || o.call(e);
550
+ var e, l;
551
+ (l = (e = u.value) == null ? void 0 : e.resetInputs) == null || l.call(e);
552
552
  }
553
553
  });
554
- const y = Xe({
554
+ const y = Ze({
555
555
  updateItem: (e) => {
556
- s.items = s.items.map((o) => o.sku._id !== e.sku._id ? o : e);
556
+ t.items = t.items.map((l) => l.sku._id !== e.sku._id ? l : e);
557
557
  },
558
558
  deleteItem: (e) => {
559
- s.items = s.items.filter((o) => o.sku._id !== e.sku._id);
559
+ t.items = t.items.filter((l) => l.sku._id !== e.sku._id);
560
560
  },
561
561
  get items() {
562
- return s.items;
562
+ return t.items;
563
563
  },
564
564
  get disabled() {
565
565
  return v.disabled;
566
566
  }
567
567
  }), p = P(() => y.columnDefs.value);
568
- function _() {
569
- const e = t.skus.map((h) => ({
568
+ function w() {
569
+ const e = s.skus.map((h) => ({
570
570
  label: h.name,
571
571
  sublabel: h.code,
572
572
  value: h
573
- })), o = e.filter((h) => {
573
+ })), l = e.filter((h) => {
574
574
  var D;
575
- return (D = s.items) == null ? void 0 : D.find(($) => $.sku._id === h.value._id);
575
+ return (D = t.items) == null ? void 0 : D.find(($) => $.sku._id === h.value._id);
576
576
  }).map((h) => h.value);
577
577
  b.open({
578
- title: n("inventory.closing.form.items.selectItem"),
578
+ title: o("inventory.closing.form.items.selectItem"),
579
579
  closeButton: !0,
580
580
  contentComponent: Je,
581
581
  contentComponentProps: {
582
- modelValue: o,
582
+ modelValue: l,
583
583
  items: e,
584
584
  virtualScroll: !0
585
585
  },
586
586
  primaryActions: {
587
- text: n("common.confirm"),
587
+ text: o("common.confirm"),
588
588
  close: !0
589
589
  },
590
590
  secondaryActions: {
591
- text: n("common.close"),
591
+ text: o("common.close"),
592
592
  close: !0,
593
593
  variant: "tertiary"
594
594
  }
595
595
  }).onPrimary((h) => {
596
- const D = s.items ?? [], $ = h.map((C) => {
597
- const l = D.find((z) => z.sku._id === C._id);
598
- return l || {
596
+ const D = t.items ?? [], $ = h.map((C) => {
597
+ const a = D.find((A) => A.sku._id === C._id);
598
+ return a || {
599
599
  sku: C
600
600
  };
601
601
  });
602
- $.sort((C, l) => C.sku.code.localeCompare(l.sku.code)), s.items = $;
602
+ $.sort((C, a) => C.sku.code.localeCompare(a.sku.code)), t.items = $;
603
603
  });
604
604
  }
605
- return (e, o) => {
606
- const h = V("FmTextField"), D = V("FmButton"), $ = V("FmTable"), C = V("FmForm");
607
- return k(), B(C, {
605
+ return (e, l) => {
606
+ const h = V("FmTextField"), D = V("FmButton"), $ = V("FmTable"), C = V("FmFormGroup"), a = V("FmForm");
607
+ return k(), B(a, {
608
608
  ref_key: "formRef",
609
609
  ref: u,
610
610
  class: "flex flex-col gap-32",
611
611
  disabled: e.disabled
612
612
  }, {
613
- default: I(() => [
614
- f("div", at, [
615
- f("div", it, [
616
- w(h, {
617
- label: c(n)("inventory.closing.form.name"),
613
+ default: R(() => [
614
+ f("div", it, [
615
+ f("div", rt, [
616
+ _(h, {
617
+ label: c(o)("inventory.closing.form.name"),
618
618
  "label-mark": "required",
619
- modelValue: c(s).name,
620
- "onUpdate:modelValue": o[0] || (o[0] = (l) => c(s).name = l),
621
- rules: [c(He)()]
619
+ modelValue: c(t).name,
620
+ "onUpdate:modelValue": l[0] || (l[0] = (i) => c(t).name = i),
621
+ rules: [c(Ge)()]
622
622
  }, null, 8, ["label", "modelValue", "rules"]),
623
- w(h, {
624
- label: c(n)("inventory.closing.form.reference"),
623
+ _(h, {
624
+ label: c(o)("inventory.closing.form.reference"),
625
625
  "label-mark": "optional",
626
- modelValue: c(s).ref,
627
- "onUpdate:modelValue": o[1] || (o[1] = (l) => c(s).ref = l)
626
+ modelValue: c(t).ref,
627
+ "onUpdate:modelValue": l[1] || (l[1] = (i) => c(t).ref = i)
628
628
  }, null, 8, ["label", "modelValue"])
629
629
  ])
630
630
  ]),
631
- f("div", rt, [
632
- f("div", ct, [
633
- o[3] || (o[3] = f("div", { class: "flex-1 fm-typo-en-title-sm-600" }, "Locations", -1)),
634
- w(D, {
631
+ f("div", ct, [
632
+ f("div", ut, [
633
+ l[3] || (l[3] = f("div", { class: "flex-1 fm-typo-en-title-sm-600" }, "Locations", -1)),
634
+ _(D, {
635
635
  disabled: e.disabled,
636
636
  label: "Select location",
637
637
  "prepend-icon": "add",
638
638
  variant: "plain",
639
639
  class: "border-2 rounded-lg border-fm-color-primary",
640
- onClick: c(a)
640
+ onClick: c(n)
641
641
  }, null, 8, ["disabled", "onClick"])
642
642
  ]),
643
- w($, {
644
- "column-defs": c(i),
643
+ _($, {
644
+ "column-defs": c(r),
645
645
  "row-data": c(d),
646
646
  "shrink-at": 9999,
647
- onRowClick: c(a),
647
+ onRowClick: c(n),
648
648
  "hide-footer": ""
649
649
  }, null, 8, ["column-defs", "row-data", "onRowClick"])
650
650
  ]),
651
- f("div", ut, [
652
- f("div", dt, [
653
- f("div", mt, A(c(n)("inventory.closing.form.items.title")), 1),
654
- w(D, {
651
+ f("div", dt, [
652
+ f("div", mt, [
653
+ f("div", pt, I(c(o)("inventory.closing.form.items.title")), 1),
654
+ _(D, {
655
655
  disabled: e.disabled,
656
- label: c(n)("inventory.closing.form.items.addItem"),
656
+ label: c(o)("inventory.closing.form.items.addItem"),
657
657
  "prepend-icon": "add",
658
658
  variant: "plain",
659
659
  class: "border-2 rounded-lg border-fm-color-primary",
660
- onClick: o[2] || (o[2] = (l) => _()),
660
+ onClick: l[2] || (l[2] = (i) => w()),
661
661
  size: "md"
662
662
  }, null, 8, ["disabled", "label"])
663
663
  ]),
664
664
  (k(), B($, {
665
665
  "column-defs": p.value,
666
- "row-data": c(s).items,
667
- key: c(s).items.map((l) => l.sku._id).join("."),
666
+ "row-data": c(t).items,
667
+ key: c(t).items.map((i) => i.sku._id).join("."),
668
668
  "hide-footer": "",
669
- "page-size": c(s).items.length
669
+ "page-size": c(t).items.length
670
670
  }, {
671
- "list-row": I((l) => [
671
+ "list-row": R((i) => [
672
672
  (k(), B(Te, {
673
- row: l,
674
- key: c(s).items.map((r) => r.sku._id).join(".")
673
+ row: i,
674
+ key: c(t).items.map((A) => A.sku._id).join(".")
675
675
  }, {
676
- default: I((r) => [
677
- w(nt, {
678
- row: l,
679
- "cell-by-col-id": r
676
+ default: R((A) => [
677
+ _(at, {
678
+ row: i,
679
+ "cell-by-col-id": A
680
680
  }, null, 8, ["row", "cell-by-col-id"])
681
681
  ]),
682
682
  _: 2
683
683
  }, 1032, ["row"]))
684
684
  ]),
685
685
  _: 1
686
- }, 8, ["column-defs", "row-data", "page-size"]))
686
+ }, 8, ["column-defs", "row-data", "page-size"])),
687
+ _(C, {
688
+ "model-value": c(t).items.length,
689
+ rules: [c(He)(1)]
690
+ }, null, 8, ["model-value", "rules"])
687
691
  ])
688
692
  ]),
689
693
  _: 1
690
694
  }, 8, ["disabled"]);
691
695
  };
692
696
  }
693
- }), ft = { class: "flex items-center" }, gt = { class: "fm-typo-en-title-md-800" }, vt = { class: "flex gap-4" }, bt = /* @__PURE__ */ Y({
697
+ }), gt = { class: "flex items-center" }, vt = { class: "fm-typo-en-title-md-800" }, bt = { class: "flex gap-4" }, yt = /* @__PURE__ */ Y({
694
698
  __name: "ClosingTemplateDialog",
695
699
  props: {
696
700
  mode: {},
@@ -700,7 +704,7 @@ const Ze = { class: "flex flex-col gap-16 py-12" }, et = { class: "flex" }, tt =
700
704
  emits: ["update:show", "submitted"],
701
705
  setup(m, { expose: g, emit: v }) {
702
706
  var C;
703
- const s = m, n = v, t = G(), b = W(), { t: a } = q(), i = Be(s, "show");
707
+ const t = m, o = v, s = q(), b = W(), { t: n } = J(), r = Be(t, "show");
704
708
  function d() {
705
709
  return {
706
710
  _id: "",
@@ -708,131 +712,131 @@ const Ze = { class: "flex flex-col gap-16 py-12" }, et = { class: "flex" }, tt =
708
712
  items: []
709
713
  };
710
714
  }
711
- const u = S(s.modelValue ?? d()), y = S(((C = s.modelValue) == null ? void 0 : C._id) ?? `${Math.random()}`);
715
+ const u = F(t.modelValue ?? d()), y = F(((C = t.modelValue) == null ? void 0 : C._id) ?? `${Math.random()}`);
712
716
  Me(
713
- () => s.show,
714
- (l) => {
715
- var r;
716
- l && (u.value = s.modelValue ?? d(), y.value = ((r = s.modelValue) == null ? void 0 : r._id) ?? `${Math.random()}`);
717
+ () => t.show,
718
+ (a) => {
719
+ var i;
720
+ a && (u.value = t.modelValue ?? d(), y.value = ((i = t.modelValue) == null ? void 0 : i._id) ?? `${Math.random()}`);
717
721
  }
718
722
  );
719
- const p = S(!1), _ = P(() => {
720
- switch (s.mode) {
721
- case U.READ:
723
+ const p = F(!1), w = P(() => {
724
+ switch (t.mode) {
725
+ case E.READ:
722
726
  return "";
723
- case U.CREATE:
724
- return a("inventory.closing.template.create.title");
725
- case U.UPDATE:
726
- return a("inventory.closing.template.update.title");
727
+ case E.CREATE:
728
+ return n("inventory.closing.template.create.title");
729
+ case E.UPDATE:
730
+ return n("inventory.closing.template.update.title");
727
731
  }
728
732
  return "";
729
- }), e = S();
733
+ }), e = F();
730
734
  g({
731
735
  validateInputs: () => {
732
- var l, r;
733
- (r = (l = e.value) == null ? void 0 : l.validateInputs) == null || r.call(l);
736
+ var a, i;
737
+ (i = (a = e.value) == null ? void 0 : a.validateInputs) == null || i.call(a);
734
738
  },
735
739
  resetInputsValidation: () => {
736
- var l, r;
737
- (r = (l = e.value) == null ? void 0 : l.resetInputsValidation) == null || r.call(l);
740
+ var a, i;
741
+ (i = (a = e.value) == null ? void 0 : a.resetInputsValidation) == null || i.call(a);
738
742
  },
739
743
  resetInputs: () => {
740
- var l, r;
741
- (r = (l = e.value) == null ? void 0 : l.resetInputs) == null || r.call(l);
744
+ var a, i;
745
+ (i = (a = e.value) == null ? void 0 : a.resetInputs) == null || i.call(a);
742
746
  }
743
747
  });
744
- async function o() {
745
- const l = u.value;
746
- if (l) {
748
+ async function l() {
749
+ const a = u.value;
750
+ if (a) {
747
751
  p.value = !0;
748
752
  try {
749
- await t.createTemplate(l), await new Promise((r) => setTimeout(r, 1e3)), b.open({
750
- title: a("inventory.closing.template.create.success"),
751
- message: a("inventory.closing.template.create.successMessage"),
753
+ await s.createTemplate(a), await new Promise((i) => setTimeout(i, 1e3)), b.open({
754
+ title: n("inventory.closing.template.create.success"),
755
+ message: n("inventory.closing.template.create.successMessage"),
752
756
  type: "success"
753
- }), n("update:show", !1), n("submitted");
754
- } catch (r) {
757
+ }), o("update:show", !1), o("submitted");
758
+ } catch (i) {
755
759
  b.open({
756
- title: a("inventory.closing.template.create.error"),
757
- message: a("inventory.closing.template.create.errorMessage"),
760
+ title: n("inventory.closing.template.create.error"),
761
+ message: n("inventory.closing.template.create.errorMessage"),
758
762
  type: "error"
759
- }), console.error("Error in creating closing template", r);
763
+ }), console.error("Error in creating closing template", i);
760
764
  } finally {
761
765
  p.value = !1;
762
766
  }
763
767
  }
764
768
  }
765
769
  async function h() {
766
- const l = u.value;
767
- if (l) {
770
+ const a = u.value;
771
+ if (a) {
768
772
  p.value = !0;
769
773
  try {
770
- await t.updateTemplate(l), await new Promise((r) => setTimeout(r, 1e3)), b.open({
771
- title: a("inventory.closing.template.update.success"),
772
- message: a("inventory.closing.template.update.successMessage"),
774
+ await s.updateTemplate(a), await new Promise((i) => setTimeout(i, 1e3)), b.open({
775
+ title: n("inventory.closing.template.update.success"),
776
+ message: n("inventory.closing.template.update.successMessage"),
773
777
  type: "success"
774
- }), n("update:show", !1), n("submitted");
775
- } catch (r) {
778
+ }), o("update:show", !1), o("submitted");
779
+ } catch (i) {
776
780
  b.open({
777
- title: a("inventory.closing.template.update.error"),
778
- message: a("inventory.closing.template.update.errorMessage"),
781
+ title: n("inventory.closing.template.update.error"),
782
+ message: n("inventory.closing.template.update.errorMessage"),
779
783
  type: "error"
780
- }), console.error("Error in updating closing template", r);
784
+ }), console.error("Error in updating closing template", i);
781
785
  } finally {
782
786
  p.value = !1;
783
787
  }
784
788
  }
785
789
  }
786
790
  function D() {
787
- switch (s.mode) {
788
- case U.CREATE:
789
- return o();
790
- case U.UPDATE:
791
+ switch (t.mode) {
792
+ case E.CREATE:
793
+ return l();
794
+ case E.UPDATE:
791
795
  return h();
792
796
  }
793
797
  }
794
798
  function $() {
795
- var l, r;
796
- (r = (l = e.value) == null ? void 0 : l.validateInputs) == null || r.call(l);
799
+ var a, i;
800
+ (i = (a = e.value) == null ? void 0 : a.validateInputs) == null || i.call(a);
797
801
  }
798
- return (l, r) => {
799
- const z = V("FmButton"), M = V("FmSideSheet");
802
+ return (a, i) => {
803
+ const A = V("FmButton"), M = V("FmSideSheet");
800
804
  return k(), B(M, {
801
- modelValue: c(i),
802
- "onUpdate:modelValue": r[2] || (r[2] = (T) => Pe(i) ? i.value = T : null),
805
+ modelValue: c(r),
806
+ "onUpdate:modelValue": i[2] || (i[2] = (T) => Pe(r) ? r.value = T : null),
803
807
  "dismiss-away": "",
804
808
  "close-button": "",
805
809
  "max-width": 800
806
810
  }, {
807
- "side-sheet-header": I(() => [
808
- f("div", ft, [
809
- f("div", gt, A(_.value), 1)
811
+ "side-sheet-header": R(() => [
812
+ f("div", gt, [
813
+ f("div", vt, I(w.value), 1)
810
814
  ])
811
815
  ]),
812
- default: I(() => [
813
- (k(), B(pt, {
816
+ default: R(() => [
817
+ (k(), B(ft, {
814
818
  class: "w-full",
815
819
  ref_key: "formRef",
816
820
  ref: e,
817
821
  onValidationSuccess: D,
818
822
  "model-value": u.value,
819
- "onUpdate:modelValue": r[0] || (r[0] = (T) => u.value = T),
823
+ "onUpdate:modelValue": i[0] || (i[0] = (T) => u.value = T),
820
824
  disabled: p.value,
821
825
  key: y.value
822
826
  }, null, 8, ["model-value", "disabled"]))
823
827
  ]),
824
- "side-sheet-footer": I(() => [
825
- f("div", vt, [
826
- w(z, {
828
+ "side-sheet-footer": R(() => [
829
+ f("div", bt, [
830
+ _(A, {
827
831
  loading: p.value,
828
- label: c(a)("common.save"),
832
+ label: c(n)("common.save"),
829
833
  onClick: $
830
834
  }, null, 8, ["loading", "label"]),
831
- w(z, {
835
+ _(A, {
832
836
  disabled: p.value,
833
837
  variant: "tertiary",
834
- label: c(a)("common.close"),
835
- onClick: r[1] || (r[1] = (T) => n("update:show", !1))
838
+ label: c(n)("common.close"),
839
+ onClick: i[1] || (i[1] = (T) => o("update:show", !1))
836
840
  }, null, 8, ["disabled", "label"])
837
841
  ])
838
842
  ]),
@@ -840,34 +844,34 @@ const Ze = { class: "flex flex-col gap-16 py-12" }, et = { class: "flex" }, tt =
840
844
  }, 8, ["modelValue"]);
841
845
  };
842
846
  }
843
- }), yt = {};
844
- function ht(m, g) {
845
- return k(), F("div");
847
+ }), ht = {};
848
+ function _t(m, g) {
849
+ return k(), S("div");
846
850
  }
847
- const _t = /* @__PURE__ */ qe(yt, [["render", ht]]), wt = { class: "flex flex-col gap-40" }, xt = { key: 0 }, kt = {
851
+ const wt = /* @__PURE__ */ qe(ht, [["render", _t]]), xt = { class: "flex flex-col gap-40" }, kt = { key: 0 }, Tt = {
848
852
  key: 1,
849
853
  class: "flex gap-8 items-center"
850
- }, Tt = {
854
+ }, Dt = {
851
855
  key: 2,
852
856
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary"
853
- }, Dt = {
857
+ }, $t = {
854
858
  key: 3,
855
859
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary flex flex-col gap-12"
856
- }, $t = { key: 4 }, Ct = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, Mt = /* @__PURE__ */ Y({
860
+ }, Ct = { key: 4 }, Mt = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, Pt = /* @__PURE__ */ Y({
857
861
  __name: "ClosingTemplatePublish",
858
862
  emits: ["close"],
859
863
  setup(m, { emit: g }) {
860
- const v = S(!1), s = W(), n = G(), t = De(), b = g;
861
- async function a() {
864
+ const v = F(!1), t = W(), o = q(), s = De(), b = g;
865
+ async function n() {
862
866
  v.value = !0;
863
867
  try {
864
- await n.startNewPublish().delayed(1e3), s.open({
868
+ await o.startNewPublish().delayed(1e3), t.open({
865
869
  title: "Success",
866
870
  message: "You may refresh after a while to review publish status",
867
871
  type: "success"
868
872
  }), u();
869
873
  } catch (y) {
870
- s.open({
874
+ t.open({
871
875
  title: "Something went wrong",
872
876
  message: "Please try again",
873
877
  type: "error"
@@ -876,18 +880,18 @@ const _t = /* @__PURE__ */ qe(yt, [["render", ht]]), wt = { class: "flex flex-co
876
880
  v.value = !1;
877
881
  }
878
882
  }
879
- const i = P(() => t.recentPublish.recentJob), d = P(
880
- () => t.templates.length && (!i.value || i.value.outlets.length === i.value.completed.length)
883
+ const r = P(() => s.recentPublish.recentJob), d = P(
884
+ () => s.templates.length && (!r.value || r.value.outlets.length === r.value.completed.length)
881
885
  );
882
886
  function u() {
883
887
  b("close");
884
888
  }
885
889
  return (y, p) => {
886
- const _ = V("FmCircularProgress"), e = V("FmButton");
887
- return k(), F("div", wt, [
888
- c(t).templates.length ? v.value ? (k(), F("div", kt, [
890
+ const w = V("FmCircularProgress"), e = V("FmButton");
891
+ return k(), S("div", xt, [
892
+ c(s).templates.length ? v.value ? (k(), S("div", Tt, [
889
893
  f("div", null, [
890
- w(_, {
894
+ _(w, {
891
895
  size: "md",
892
896
  color: "neutral-gray-300"
893
897
  })
@@ -895,22 +899,22 @@ const _t = /* @__PURE__ */ qe(yt, [["render", ht]]), wt = { class: "flex flex-co
895
899
  p[0] || (p[0] = f("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, [
896
900
  f("span", null, "Sending a task to publish templates to all outlets...")
897
901
  ], -1))
898
- ])) : i.value ? i.value.outlets.length === i.value.completed.length ? (k(), F("div", Dt, [
902
+ ])) : r.value ? r.value.outlets.length === r.value.completed.length ? (k(), S("div", $t, [
899
903
  f("p", null, [
900
- ve(" Your recent publishing task at " + A(c(he)(new Date(i.value.createdAt))) + " has ", 1),
904
+ ve(" Your recent publishing task at " + I(c(he)(new Date(r.value.createdAt))) + " has ", 1),
901
905
  p[1] || (p[1] = f("span", { class: "fm-typo-en-body-lg-600" }, "completed", -1)),
902
- ve(" at " + A(c(he)(new Date(i.value.updatedAt))) + ". ", 1)
906
+ ve(" at " + I(c(he)(new Date(r.value.updatedAt))) + ". ", 1)
903
907
  ]),
904
908
  p[2] || (p[2] = f("p", null, "Do you want to publish to all outlets?", -1))
905
- ])) : (k(), F("div", $t, " Your recent publishing task is still pending (" + A(i.value.completed.length) + " / " + A(i.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)) : (k(), F("div", Tt, " You have no recent publish activity. Do you want to publish to all outlets? ")) : (k(), F("div", xt, "You have no template to publish.")),
906
- f("div", Ct, [
907
- w(e, {
909
+ ])) : (k(), S("div", Ct, " Your recent publishing task is still pending (" + I(r.value.completed.length) + " / " + I(r.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)) : (k(), S("div", Dt, " You have no recent publish activity. Do you want to publish to all outlets? ")) : (k(), S("div", kt, "You have no template to publish.")),
910
+ f("div", Mt, [
911
+ _(e, {
908
912
  disabled: !d.value,
909
913
  loading: v.value,
910
914
  label: "Publish to all outlets",
911
- onClick: a
915
+ onClick: n
912
916
  }, null, 8, ["disabled", "loading"]),
913
- w(e, {
917
+ _(e, {
914
918
  variant: "tertiary",
915
919
  label: "Close",
916
920
  onClick: u
@@ -919,45 +923,45 @@ const _t = /* @__PURE__ */ qe(yt, [["render", ht]]), wt = { class: "flex flex-co
919
923
  ]);
920
924
  };
921
925
  }
922
- }), Pt = { class: "flex-1 flex flex-col gap-8" }, St = { class: "flex flex-col" }, Ft = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, At = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Vt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, It = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, qt = /* @__PURE__ */ Y({
926
+ }), Ft = { class: "flex-1 flex flex-col gap-8" }, St = { class: "flex flex-col" }, At = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, It = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Rt = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, qt = /* @__PURE__ */ Y({
923
927
  __name: "ClosingTemplateView",
924
928
  setup(m) {
925
- const { t: g } = q(), { createTemplate: v, updateTemplate: s } = O(), { templateDialogProps: n, templateDetailsProps: t } = Ye(O()), b = ke(), a = Q(), i = De(), d = Ue(), { breakpoints: u } = Le();
926
- b.watchLocation(i.fetchTemplates);
927
- const y = P(() => i.loading), p = S(""), _ = P(() => u.value.xs || u.value.sm), e = P(() => _.value ? 10 : 20);
928
- function o(l) {
929
- switch (l) {
930
- case E.Add:
929
+ const { t: g } = J(), { createTemplate: v, updateTemplate: t } = O(), { templateDialogProps: o, templateDetailsProps: s } = Ye(O()), b = ke(), n = Q(), r = De(), d = Ue(), { breakpoints: u } = Le();
930
+ b.watchLocation(r.fetchTemplates);
931
+ const y = P(() => r.loading), p = F(""), w = P(() => u.value.xs || u.value.sm), e = P(() => w.value ? 10 : 20);
932
+ function l(a) {
933
+ switch (a) {
934
+ case z.Add:
931
935
  return v();
932
936
  case "publish":
933
937
  return h();
934
938
  }
935
939
  }
936
940
  function h() {
937
- a.open({
941
+ n.open({
938
942
  title: "Publish closing templates",
939
- contentComponent: Mt,
943
+ contentComponent: Pt,
940
944
  contentComponentProps: {
941
945
  onClose() {
942
- a.close();
946
+ n.close();
943
947
  }
944
948
  }
945
949
  });
946
950
  }
947
- function D(l) {
948
- return l;
951
+ function D(a) {
952
+ return a;
949
953
  }
950
954
  const $ = P(() => {
951
- const l = [
955
+ const a = [
952
956
  {
953
957
  label: g("inventory.closing.template.create.title"),
954
- value: E.Add,
958
+ value: z.Add,
955
959
  isPrimary: !0,
956
960
  prependIcon: "add"
957
961
  }
958
962
  ];
959
- return _.value ? l : [
960
- ...l,
963
+ return w.value ? a : [
964
+ ...a,
961
965
  {
962
966
  label: "Publish",
963
967
  value: "publish",
@@ -965,80 +969,80 @@ const _t = /* @__PURE__ */ qe(yt, [["render", ht]]), wt = { class: "flex flex-co
965
969
  }
966
970
  ];
967
971
  }), C = P(() => {
968
- const l = [{ icon: "refresh", onClick: i.fetchTemplates }];
969
- return _.value ? [{ icon: "publish", onClick: h }, ...l] : l;
972
+ const a = [{ icon: "refresh", onClick: r.fetchTemplates }];
973
+ return w.value ? [{ icon: "publish", onClick: h }, ...a] : a;
970
974
  });
971
- return (l, r) => {
972
- const z = V("FmTable");
973
- return k(), F(_e, null, [
974
- w(Ee, {
975
+ return (a, i) => {
976
+ const A = V("FmTable");
977
+ return k(), S(_e, null, [
978
+ _(Ee, {
975
979
  title: c(g)("inventory.closing.template.title"),
976
980
  actions: $.value,
977
- "onClick:action": o
981
+ "onClick:action": l
978
982
  }, {
979
- default: I(() => [
983
+ default: R(() => [
980
984
  f("div", {
981
- class: Se([
985
+ class: Fe([
982
986
  "flex flex-col gap-8 max-h-full",
983
987
  {
984
- "p-0": _.value,
985
- "px-24 ": !_.value
988
+ "p-0": w.value,
989
+ "px-24 ": !w.value
986
990
  }
987
991
  ])
988
992
  }, [
989
- w(ze, {
993
+ _(ze, {
990
994
  searchable: "",
991
995
  search: p.value,
992
- "onUpdate:search": r[0] || (r[0] = (M) => p.value = M),
996
+ "onUpdate:search": i[0] || (i[0] = (M) => p.value = M),
993
997
  actions: C.value
994
998
  }, null, 8, ["search", "actions"]),
995
- w(z, {
996
- style: Fe(c(d).tableHeight),
997
- "column-defs": c(i).columnDefs,
998
- "row-data": c(i).templates,
999
+ _(A, {
1000
+ style: Se(c(d).tableHeight),
1001
+ "column-defs": c(r).columnDefs,
1002
+ "row-data": c(r).templates,
999
1003
  "search-value": p.value,
1000
1004
  loading: y.value,
1001
- onRowClick: r[1] || (r[1] = (M) => c(s)(M.original)),
1005
+ onRowClick: i[1] || (i[1] = (M) => c(t)(M.original)),
1002
1006
  "page-size": e.value
1003
1007
  }, {
1004
- "list-row": I((M) => [
1005
- w(Te, {
1008
+ "list-row": R((M) => [
1009
+ _(Te, {
1006
1010
  row: M,
1007
- onRowClick: (T) => c(s)(T)
1011
+ onRowClick: (T) => c(t)(T)
1008
1012
  }, {
1009
- default: I((T) => {
1010
- var X, Z, ee, j, te, se, le, oe, K, ne, ae, ie, re, ce, ue, H, de, me, pe, fe, J, ge;
1013
+ default: R((T) => {
1014
+ var X, Z, ee, j, te, se, le, oe, K, ne, ae, ie, re, ce, ue, G, de, me, pe, fe, H, ge;
1011
1015
  return [
1012
- f("div", Pt, [
1016
+ f("div", Ft, [
1013
1017
  f("div", St, [
1014
- f("div", Ft, [
1015
- w(c(N), {
1018
+ f("div", At, [
1019
+ _(c(N), {
1016
1020
  render: (ee = (Z = (X = T._id) == null ? void 0 : X.column) == null ? void 0 : Z.columnDef) == null ? void 0 : ee.cell,
1017
1021
  props: (te = (j = T._id) == null ? void 0 : j.getContext) == null ? void 0 : te.call(j)
1018
1022
  }, null, 8, ["render", "props"])
1019
1023
  ]),
1020
- f("div", At, [
1021
- w(c(N), {
1024
+ f("div", Vt, [
1025
+ _(c(N), {
1022
1026
  render: (oe = (le = (se = T.name) == null ? void 0 : se.column) == null ? void 0 : le.columnDef) == null ? void 0 : oe.cell,
1023
1027
  props: (ne = (K = T.name) == null ? void 0 : K.getContext) == null ? void 0 : ne.call(K)
1024
1028
  }, null, 8, ["render", "props"])
1025
1029
  ]),
1026
- f("div", null, A((ae = M.original.locations) != null && ae.length ? `Enabled for ${(ie = M.original.locations) == null ? void 0 : ie.length} outlets` : "Enabled for all outlets"), 1),
1027
- f("div", Vt, A([
1030
+ f("div", null, I((ae = M.original.locations) != null && ae.length ? `Enabled for ${(ie = M.original.locations) == null ? void 0 : ie.length} outlets` : "Enabled for all outlets"), 1),
1031
+ f("div", It, I([
1028
1032
  ...M.original.items.slice(0, 3).map(($e) => $e.sku.name),
1029
1033
  ...M.original.items.length >= 3 ? [`and ${M.original.items.length - 3} more items`] : []
1030
1034
  ].join(", ")), 1),
1031
- f("div", It, [
1032
- w(c(N), {
1035
+ f("div", Rt, [
1036
+ _(c(N), {
1033
1037
  render: (ue = (ce = (re = T.ref) == null ? void 0 : re.column) == null ? void 0 : ce.columnDef) == null ? void 0 : ue.cell,
1034
- props: (de = (H = T.ref) == null ? void 0 : H.getContext) == null ? void 0 : de.call(H)
1038
+ props: (de = (G = T.ref) == null ? void 0 : G.getContext) == null ? void 0 : de.call(G)
1035
1039
  }, null, 8, ["render", "props"])
1036
1040
  ])
1037
1041
  ]),
1038
1042
  f("div", null, [
1039
- w(c(N), {
1043
+ _(c(N), {
1040
1044
  render: (fe = (pe = (me = T.status) == null ? void 0 : me.column) == null ? void 0 : pe.columnDef) == null ? void 0 : fe.cell,
1041
- props: (ge = (J = T.status) == null ? void 0 : J.getContext) == null ? void 0 : ge.call(J)
1045
+ props: (ge = (H = T.status) == null ? void 0 : H.getContext) == null ? void 0 : ge.call(H)
1042
1046
  }, null, 8, ["render", "props"])
1043
1047
  ])
1044
1048
  ])
@@ -1054,9 +1058,9 @@ const _t = /* @__PURE__ */ qe(yt, [["render", ht]]), wt = { class: "flex flex-co
1054
1058
  _: 1
1055
1059
  }, 8, ["title", "actions"]),
1056
1060
  (k(), B(Ae, { to: "body" }, [
1057
- w(_t, Ve(Ie(c(t))), null, 16),
1058
- w(bt, Re(c(n), {
1059
- onSubmitted: r[2] || (r[2] = (M) => c(i).fetchTemplates())
1061
+ _(wt, Ve(Ie(c(s))), null, 16),
1062
+ _(yt, Re(c(o), {
1063
+ onSubmitted: i[2] || (i[2] = (M) => c(r).fetchTemplates())
1060
1064
  }), null, 16)
1061
1065
  ]))
1062
1066
  ], 64);