@feedmepos/mf-inventory-portal 0.0.23-dev.22 → 0.0.23-dev.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/{App-B3Lc5sQ1.js → App-dQy0_X6Q.js} +3 -3
  2. package/dist/{ApprovalView-BS3jKVhn.js → ApprovalView-CxwAuXae.js} +2 -2
  3. package/dist/{BindingsDialog-CJsZBmYf.js → BindingsDialog-BX8J03Uc.js} +2 -2
  4. package/dist/{BindingsPicker-DDa3F7UG.js → BindingsPicker-CAW_3sSv.js} +1 -1
  5. package/dist/{BindingsTable-Cd43pT6-.js → BindingsTable-7UmxSmdW.js} +1 -1
  6. package/dist/ClosingDraftView-DukJAMlK.js +1135 -0
  7. package/dist/{ClosingTemplateView-BPMd73x8.js → ClosingTemplateView-Dm7_gMTo.js} +216 -217
  8. package/dist/{FmDroppableField-B0MCjb6f.js → FmDroppableField-BqZcDO2v.js} +1 -1
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-QKDk7BQ1.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DN3N20Nb.js} +3 -3
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DWG1kbH5.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BrPRiS_u.js} +1 -1
  11. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-B7dXsfLJ.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-Bln1lReW.js} +1 -1
  12. package/dist/{IngredientGroupView-D8g5285H.js → IngredientGroupView-BKIJHeh9.js} +1 -1
  13. package/dist/{IngredientsView-D3EBTVpL.js → IngredientsView-Blnohl3I.js} +7 -7
  14. package/dist/{IntegrationView-BQt35u9_.js → IntegrationView-Dna4bUA7.js} +2 -2
  15. package/dist/{InventoryBindingForm-Cbh3Q5K4.js → InventoryBindingForm-D6HSF8Wn.js} +1 -1
  16. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DD7zMo0u.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CnWvwNjJ.js} +3 -3
  17. package/dist/{InventoryBindingSummary-Z3YFpRpr.js → InventoryBindingSummary-CNNCv8NX.js} +1 -1
  18. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C8Pgb4za.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CrMkMTAt.js} +1 -1
  19. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CyCkwMSc.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Cw3E2NKS.js} +2 -2
  20. package/dist/{PurchaseOrderPrintPreview-5LKgnQqy.js → PurchaseOrderPrintPreview-PEN03dZK.js} +1 -1
  21. package/dist/{ReceiveRequestView-kHwlmbsq.js → ReceiveRequestView-rTUhjMLY.js} +146 -143
  22. package/dist/{RecipeView-CmhMcFYW.js → RecipeView-V1hx1AUG.js} +4 -4
  23. package/dist/{StockView-bpoymhya.js → StockView-B5nDn8nO.js} +7 -7
  24. package/dist/{SupplierView--_H4vORF.js → SupplierView-DyyRxm6k.js} +7 -7
  25. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DLivaday.js → TransferDetails.vue_vue_type_script_setup_true_lang-D6oZOwHL.js} +5 -5
  26. package/dist/{TransferTemplateView-COB5dMBd.js → TransferTemplateView-OTR9Re51.js} +7 -7
  27. package/dist/{UnitView-CGkMkxTB.js → UnitView-DGhm1JXD.js} +3 -3
  28. package/dist/{WarehouseView-DPiXq2vK.js → WarehouseView-DMAvFisd.js} +1 -1
  29. package/dist/{app-DGULB4V9.js → app-DQRbwx-z.js} +2224 -2192
  30. package/dist/app.js +1 -1
  31. package/dist/{decimal-HQR2xIiL.js → decimal-DuJEFEYp.js} +1 -1
  32. package/dist/{feature-BINaF_1s.js → feature-BRqas45f.js} +1 -1
  33. package/dist/{format-unit-display-XShcYaSo.js → format-unit-display-G6VtlQe7.js} +5 -5
  34. package/dist/{index-CTfao5ul.js → index-D3f51k-I.js} +1 -1
  35. package/dist/{netsuite-DsCeD02V.js → netsuite-D4b5JceM.js} +1 -1
  36. package/dist/{stock-OVllFFZj.js → stock-DZkj2LE0.js} +1 -1
  37. package/dist/{supplier-DSinhYHO.js → supplier-Cm5Cw3u7.js} +1 -1
  38. package/dist/tsconfig.app.tsbuildinfo +1 -1
  39. package/dist/{use-inventory-binding-dialog-BBSRiAlY.js → use-inventory-binding-dialog-DCt0wUiw.js} +1 -1
  40. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +178 -8
  41. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +1498 -478
  42. package/dist/{xlsx-CHmlVmKD.js → xlsx-9Gc42bxv.js} +1 -1
  43. package/dist/{xlsx.util-DZmuhVz8.js → xlsx.util-CEvUL8mk.js} +1 -1
  44. package/package.json +1 -1
  45. package/dist/ClosingDraftView-nWXh50Xp.js +0 -1116
@@ -1,11 +1,11 @@
1
- import { ref as M, h as F, defineComponent as O, resolveComponent as R, openBlock as k, createElementBlock as I, createElementVNode as _, normalizeClass as Y, createTextVNode as Fe, toDisplayString as C, unref as v, createCommentVNode as G, createVNode as T, withCtx as P, Fragment as H, renderList as J, computed as E, watch as Re, createSlots as Pe, createBlock as V, isRef as je, normalizeStyle as Ye, Teleport as Ke, normalizeProps as Ge, guardReactiveProps as Je, mergeProps as We } from "vue";
2
- import { N as qe, u as le, a6 as Qe, D as Se, f as N, e as Xe, d as Ae, n as Ze, a as ae, o as et, c as z, v as j, w as tt, a7 as nt, k as ot, s as Ee, A as st, x as lt, _ as at, a8 as ne, p as rt, q as it, r as ct } from "./app-DGULB4V9.js";
1
+ import { ref as D, h as F, defineComponent as O, resolveComponent as R, openBlock as k, createElementBlock as I, createElementVNode as _, normalizeClass as Y, createTextVNode as Fe, toDisplayString as C, unref as v, createCommentVNode as G, createVNode as T, withCtx as P, Fragment as H, renderList as J, computed as E, watch as Re, createSlots as Pe, createBlock as V, isRef as je, normalizeStyle as Ye, Teleport as Ke, normalizeProps as Ge, guardReactiveProps as Je, mergeProps as We } from "vue";
2
+ import { N as qe, u as le, a6 as Qe, D as Se, f as N, e as Xe, d as Ae, n as Ze, a as ae, o as et, c as z, v as j, w as tt, a7 as nt, k as ot, s as Ee, A as st, x as lt, _ as at, a8 as ne, p as rt, q as it, r as ct } from "./app-DQRbwx-z.js";
3
3
  import { useCoreStore as re, useI18n as B } from "@feedmepos/mf-common";
4
- import { useDialogChild as mt, useSnackbar as Z, useDialog as ie, FmButtonVariant as Me, components as L, useProxiedModel as ut, useBreakpoints as dt } from "@feedmepos/ui-library";
4
+ import { useDialogChild as mt, useSnackbar as Z, useDialog as ie, FmButtonVariant as De, components as L, useProxiedModel as ut, useBreakpoints as dt } from "@feedmepos/ui-library";
5
5
  import { defineStore as Ue, storeToRefs as Ve } from "pinia";
6
- import { a as oe, b as Ne, d as Be, s as Le, r as pt } from "./xlsx.util-DZmuhVz8.js";
7
- import { F as ft } from "./FmDroppableField-B0MCjb6f.js";
8
- import { u as vt } from "./netsuite-DsCeD02V.js";
6
+ import { a as oe, b as Ne, d as Be, s as Le, r as pt } from "./xlsx.util-CEvUL8mk.js";
7
+ import { F as ft } from "./FmDroppableField-BqZcDO2v.js";
8
+ import { u as vt } from "./netsuite-D4b5JceM.js";
9
9
  const ee = qe((r, s) => {
10
10
  function o() {
11
11
  var t;
@@ -48,29 +48,29 @@ const ee = qe((r, s) => {
48
48
  }), te = Ue(
49
49
  "closingTable",
50
50
  function() {
51
- const { t: s } = B(), o = se(), l = M({}), e = M(new Array()), t = M(!1), y = le(), p = ee();
52
- async function f() {
53
- if (e.value = [], !!y._currentLocation) {
51
+ const { t: s } = B(), o = se(), l = D({}), e = D(new Array()), t = D(!1), g = le(), f = ee();
52
+ async function p() {
53
+ if (e.value = [], !!g._currentLocation) {
54
54
  t.value = !0;
55
55
  try {
56
- const [g, h] = await Promise.all([
57
- p.readTemplates(),
58
- p.getRecentPublishingJob()
56
+ const [y, h] = await Promise.all([
57
+ f.readTemplates(),
58
+ f.getRecentPublishingJob()
59
59
  ]).delayed(1e3);
60
- e.value = g, l.value = h;
61
- } catch (g) {
62
- console.log("Something went wrong when fetching templates:", g);
60
+ e.value = y, l.value = h;
61
+ } catch (y) {
62
+ console.log("Something went wrong when fetching templates:", y);
63
63
  } finally {
64
64
  t.value = !1;
65
65
  }
66
66
  }
67
67
  }
68
- async function i(g) {
69
- if (!e.value.find((h) => h._id) && y._currentLocation) {
68
+ async function i(y) {
69
+ if (!e.value.find((h) => h._id) && g._currentLocation) {
70
70
  t.value = !0;
71
71
  try {
72
72
  const [h] = await Promise.all([
73
- p.getTemplate(g),
73
+ f.getTemplate(y),
74
74
  new Promise((u) => setTimeout(u, 1e3))
75
75
  ]);
76
76
  e.value = [h];
@@ -81,14 +81,14 @@ const ee = qe((r, s) => {
81
81
  }
82
82
  }
83
83
  }
84
- function d(g, h) {
85
- switch (h = Ae(h), g) {
84
+ function d(y, h) {
85
+ switch (h = Ae(h), y) {
86
86
  case N.Details:
87
87
  return o.viewTemplate(h);
88
88
  case N.Edit:
89
89
  return o.updateTemplate(h);
90
90
  case N.Delete:
91
- return o.deleteTemplate(h, t, f);
91
+ return o.deleteTemplate(h, t, p);
92
92
  }
93
93
  }
94
94
  return {
@@ -97,8 +97,8 @@ const ee = qe((r, s) => {
97
97
  id: "_id",
98
98
  accessorKey: "_id",
99
99
  header: () => s("inventory.closing.table.createdAt"),
100
- cell(g) {
101
- return Qe(`${g.getValue()}`);
100
+ cell(y) {
101
+ return Qe(`${y.getValue()}`);
102
102
  },
103
103
  enableSorting: !0
104
104
  },
@@ -123,9 +123,9 @@ const ee = qe((r, s) => {
123
123
  id: "enabledLocations",
124
124
  accessorKey: "locations.length",
125
125
  header: () => s("inventory.closing.table.enabledOutlets"),
126
- cell(g) {
126
+ cell(y) {
127
127
  var u;
128
- const h = (u = g.row.original.locations) == null ? void 0 : u.length;
128
+ const h = (u = y.row.original.locations) == null ? void 0 : u.length;
129
129
  return h ? `${h}` : "All";
130
130
  },
131
131
  enableSorting: !1,
@@ -145,9 +145,9 @@ const ee = qe((r, s) => {
145
145
  id: "status",
146
146
  header: () => s("inventory.closing.table.status"),
147
147
  enableSorting: !1,
148
- cell(g) {
148
+ cell(y) {
149
149
  var x;
150
- const h = g.row.original, u = h._rev, n = (x = l.value.publishedRevs) == null ? void 0 : x[h._id], a = u === n;
150
+ const h = y.row.original, u = h._rev, n = (x = l.value.publishedRevs) == null ? void 0 : x[h._id], a = u === n;
151
151
  return F(
152
152
  "div",
153
153
  {
@@ -168,8 +168,8 @@ const ee = qe((r, s) => {
168
168
  },
169
169
  {
170
170
  id: "action",
171
- cell(g) {
172
- const h = g.row.original, u = [
171
+ cell(y) {
172
+ const h = y.row.original, u = [
173
173
  Se[N.Edit],
174
174
  Se[N.Delete]
175
175
  ];
@@ -186,7 +186,7 @@ const ee = qe((r, s) => {
186
186
  recentPublish: l,
187
187
  templates: e,
188
188
  loading: t,
189
- fetchTemplates: f,
189
+ fetchTemplates: p,
190
190
  loadTemplate: i
191
191
  };
192
192
  }
@@ -228,37 +228,37 @@ function He() {
228
228
  ];
229
229
  }
230
230
  function gt(r) {
231
- var p;
232
- const o = re().currentBusiness.value, e = (p = r.map((f) => {
231
+ var f;
232
+ const o = re().currentBusiness.value, e = (f = r.map((p) => {
233
233
  var u;
234
- const i = f.items.flatMap(ze), d = He(), m = [
235
- ["Template ID", f._id],
236
- ["Template name", f.name],
234
+ const i = p.items.flatMap(ze), d = He(), m = [
235
+ ["Template ID", p._id],
236
+ ["Template name", p.name],
237
237
  ["Business name", o == null ? void 0 : o.name],
238
238
  ["Business ID", o == null ? void 0 : o._id],
239
239
  ["Menu version", o == null ? void 0 : o.menuVersion],
240
240
  [
241
241
  "Locations",
242
- ...(u = f.locations) != null && u.length ? [f.locations.map((n) => `${n.name} (${n.dbName})`)] : ["All"]
242
+ ...(u = p.locations) != null && u.length ? [p.locations.map((n) => `${n.name} (${n.dbName})`)] : ["All"]
243
243
  ],
244
- ["Reference", f.ref ?? ""],
244
+ ["Reference", p.ref ?? ""],
245
245
  [],
246
246
  d.map((n) => n.name),
247
247
  ...i.map((n) => d.map((a) => n[a.id]))
248
- ], g = d.map((n) => `system:${n.id}`), h = oe(m, g);
249
- return { name: f.name, sheet: h };
248
+ ], y = d.map((n) => `system:${n.id}`), h = oe(m, y);
249
+ return { name: p.name, sheet: h };
250
250
  }).reduce(
251
- (f, i) => {
251
+ (p, i) => {
252
252
  var m;
253
253
  const d = i.name.slice(0, 12);
254
- return (m = f.sheetOccurence)[d] ?? (m[d] = 0), f.sheetOccurence[d] += 1, f.sheets[`${d} (${f.sheetOccurence[d]})`] = i.sheet, f;
254
+ return (m = p.sheetOccurence)[d] ?? (m[d] = 0), p.sheetOccurence[d] += 1, p.sheets[`${d} (${p.sheetOccurence[d]})`] = i.sheet, p;
255
255
  },
256
256
  {
257
257
  sheets: {},
258
258
  sheetOccurence: {}
259
259
  }
260
- )) == null ? void 0 : p.sheets, t = `${o == null ? void 0 : o.name} closing templates (${Ze(/* @__PURE__ */ new Date())}).xlsx`, y = Ne(e);
261
- return Be(y, t), t;
260
+ )) == null ? void 0 : f.sheets, t = `${o == null ? void 0 : o.name} closing templates (${Ze(/* @__PURE__ */ new Date())}).xlsx`, g = Ne(e);
261
+ return Be(g, t), t;
262
262
  }
263
263
  function yt() {
264
264
  const r = re(), s = ae(), o = vt(), l = ze({
@@ -274,7 +274,7 @@ function yt() {
274
274
  _id: "",
275
275
  name: "Sugar"
276
276
  }
277
- })[0], e = r.currentBusiness.value, t = He(), y = [
277
+ })[0], e = r.currentBusiness.value, t = He(), g = [
278
278
  ["Template ID (leave empty to create new)", ""],
279
279
  ["Template Name", "New template"],
280
280
  ["Business name", e == null ? void 0 : e.name],
@@ -289,7 +289,7 @@ function yt() {
289
289
  [],
290
290
  t.map((u) => u.name),
291
291
  t.map((u) => l[u.id])
292
- ], p = t.map((u) => `system:${u.id}`), f = oe(y, p), i = o.isEnabled ? o.state.setting.childItems ?? [] : [], d = i.reduce(
292
+ ], f = t.map((u) => `system:${u.id}`), p = oe(g, f), i = o.isEnabled ? o.state.setting.childItems ?? [] : [], d = i.reduce(
293
293
  (u, n) => {
294
294
  var b, w;
295
295
  const a = (b = o.netSuiteItemIdToSkuId.get(n.parentNetSuiteId)) == null ? void 0 : b[0], x = (w = o.netSuiteMeasurementIdToMeasurementId.get(
@@ -335,29 +335,29 @@ function yt() {
335
335
  "Enabled (true/false)",
336
336
  ...i.length ? ["Netsuite Parent"] : []
337
337
  ]
338
- ), g = Ne({
339
- Template: f,
338
+ ), y = Ne({
339
+ Template: p,
340
340
  Ingredients: m
341
341
  }), h = `${e == null ? void 0 : e.name} transfer templates import.xlsx`;
342
- return Be(g, h), h;
342
+ return Be(y, h), h;
343
343
  }
344
344
  function ht(r) {
345
345
  if (!r.length || `${r[0]}`.toLocaleLowerCase() === "all")
346
346
  return [];
347
347
  const s = /(.*) \(((warehouse_|restaurant_).{24,})\)/, l = le().locationByDbName;
348
348
  return r.map((e) => {
349
- const t = new Array(), y = e.trim(), p = s.exec(y);
350
- if (!p)
351
- return t.push(`Enabled location value of ${y} cannot be read.`), {
349
+ const t = new Array(), g = e.trim(), f = s.exec(g);
350
+ if (!f)
351
+ return t.push(`Enabled location value of ${g} cannot be read.`), {
352
352
  errors: t
353
353
  };
354
- const f = p[1], i = p[2], d = l[i];
355
- return d ? (f !== d.name && t.push(
356
- `Location id ${i} has non-matching name. Found ${f} but expected ${d.name}`
354
+ const p = f[1], i = f[2], d = l[i];
355
+ return d ? (p !== d.name && t.push(
356
+ `Location id ${i} has non-matching name. Found ${p} but expected ${d.name}`
357
357
  ), {
358
358
  errors: t,
359
359
  location: d
360
- }) : (t.push(`Location (${f}) of id ${i} is not found.`), {
360
+ }) : (t.push(`Location (${p}) of id ${i} is not found.`), {
361
361
  errors: t
362
362
  });
363
363
  });
@@ -369,15 +369,15 @@ function bt(r) {
369
369
  l,
370
370
  e,
371
371
  t,
372
- y,
373
- p,
374
- f
372
+ g,
373
+ f,
374
+ p
375
375
  ] = Le(r);
376
376
  return {
377
377
  id: `${o[1] ?? ""}`.trim(),
378
378
  name: `${l[1] ?? ""}`.trim(),
379
- locations: p.slice(1).map((i) => `${i}`.trim()).filter((i) => i),
380
- reference: `${f[1] ?? ""}`.trim()
379
+ locations: f.slice(1).map((i) => `${i}`.trim()).filter((i) => i),
380
+ reference: `${p[1] ?? ""}`.trim()
381
381
  };
382
382
  }
383
383
  function _t(r) {
@@ -387,24 +387,24 @@ function _t(r) {
387
387
  l,
388
388
  e,
389
389
  t,
390
- y,
391
- p,
390
+ g,
392
391
  f,
392
+ p,
393
393
  i,
394
394
  d,
395
395
  ...m
396
396
  ] = Le(r);
397
397
  if (!s || !s.length || s.some((a) => a.length && !a.startsWith("system:")))
398
398
  throw new Error("Missing meta header. Excel file does not come from the template.");
399
- const g = s.map((a) => a.split(":")[1]), u = ["code", "name", "unit", "enabled"].filter((a) => !g.includes(a));
399
+ const y = s.map((a) => a.split(":")[1]), u = ["code", "name", "unit", "enabled"].filter((a) => !y.includes(a));
400
400
  if (u.length)
401
401
  throw new Error(
402
402
  `Missing meta headers (${u.join()}). Excel file does not come from the template.`
403
403
  );
404
404
  return m.map((a, x) => {
405
405
  const c = {};
406
- for (const $ in g) {
407
- const b = g[$];
406
+ for (const $ in y) {
407
+ const b = y[$];
408
408
  Object.assign(c, { [b]: a[$] });
409
409
  }
410
410
  return {
@@ -429,22 +429,21 @@ function wt(r) {
429
429
  return o.push(`Cannot find ingredient of code ${s.code} ${s.name}`), { errors: o };
430
430
  const t = {
431
431
  sku: e
432
- }, y = e.unit.measurements.find((f) => f.abbrev === s.unit);
433
- s.unit !== e.unit.abbrev && !y ? o.push(
432
+ }, g = /* @__PURE__ */ new Set([e.unit._id, ...e.unit.measurements.map((p) => p.id)]), f = e.unit.measurements.find((p) => p.abbrev === s.unit);
433
+ s.unit !== e.unit.abbrev && !f ? o.push(
434
434
  `Cannot find measurement unit of ${s.unit} for (${s.code}) ${s.name}.`
435
- ) : (!s.enabled || `${s.enabled}`.toLocaleLowerCase() === "false") && (t.disabledMeasurements ?? (t.disabledMeasurements = []), t.disabledMeasurements.push((y == null ? void 0 : y.id) ?? e.unit._id));
436
- for (const f of r.children) {
437
- const i = f.data, d = i.unit === e.unit.abbrev ? e.unit : void 0, m = e.unit.measurements.find((g) => g.abbrev === i.unit);
435
+ ) : (s.enabled === !0 || `${s.enabled}`.toLocaleLowerCase() === "true") && g.delete(e.unit._id);
436
+ for (const p of r.children) {
437
+ const i = p.data, d = i.unit === e.unit.abbrev ? e.unit : void 0, m = e.unit.measurements.find((y) => y.abbrev === i.unit);
438
438
  if (!m && !d) {
439
439
  o.push(
440
440
  `Cannot find measurement unit of ${i.unit} for (${s.code}) ${s.name}.`
441
441
  );
442
442
  continue;
443
443
  }
444
- (!i.enabled || `${i.enabled}`.toLocaleLowerCase() === "false") && (t.disabledMeasurements ?? (t.disabledMeasurements = []), t.disabledMeasurements.push((m == null ? void 0 : m.id) ?? (d == null ? void 0 : d._id) ?? ""));
444
+ (i.enabled === !0 || `${i.enabled}`.toLocaleLowerCase() === "true") && g.delete((m == null ? void 0 : m.id) ?? (d == null ? void 0 : d._id) ?? "");
445
445
  }
446
- const p = new Set(t.disabledMeasurements);
447
- return p.has(e.unit._id) && t.sku.unit.measurements.every((f) => p.has(f.id)) && o.push(`Ingredient ${e.code} - ${e.name} must have at least one unit enabled.`), { errors: o, templateItem: t };
446
+ return g.has(e.unit._id) && t.sku.unit.measurements.every((p) => g.has(p.id)) && o.push(`Ingredient ${e.code} - ${e.name} must have at least one unit enabled.`), t.disabledMeasurements = [...g], { errors: o, templateItem: t };
448
447
  }
449
448
  function kt(r) {
450
449
  const s = r.SheetNames.filter(
@@ -452,17 +451,17 @@ function kt(r) {
452
451
  ), l = te().templates, e = et(l, "_id");
453
452
  try {
454
453
  return s.reduce(
455
- (t, y) => {
456
- const p = new Array(), f = r.Sheets[y], i = bt(f), d = ht(i.locations), m = d.filter((c) => c.location).map((c) => c.location);
457
- p.push(...d.flatMap((c) => c.errors));
458
- const g = _t(f).filter(
454
+ (t, g) => {
455
+ const f = new Array(), p = r.Sheets[g], i = bt(p), d = ht(i.locations), m = d.filter((c) => c.location).map((c) => c.location);
456
+ f.push(...d.flatMap((c) => c.errors));
457
+ const y = _t(p).filter(
459
458
  (c) => c.data.code || c.data.unit
460
- ), h = xt(g);
461
- p.push(...h.errors);
459
+ ), h = xt(y);
460
+ f.push(...h.errors);
462
461
  const u = h.result.map(
463
462
  (c) => wt(c)
464
463
  );
465
- p.push(...u.flatMap((c) => c.errors));
464
+ f.push(...u.flatMap((c) => c.errors));
466
465
  const n = u.filter((c) => c.templateItem).map((c) => c.templateItem);
467
466
  if (i.id) {
468
467
  const c = e[i.id];
@@ -470,15 +469,15 @@ function kt(r) {
470
469
  const b = {
471
470
  _id: i.id,
472
471
  _rev: "",
473
- name: i.name || `(unnamed from sheet ${y || "<unnamed sheet>"})`,
472
+ name: i.name || `(unnamed from sheet ${g || "<unnamed sheet>"})`,
474
473
  items: []
475
474
  };
476
- return p.push(`Template ID ${i.id} is not found.`), t.importUpdateResult.push({
475
+ return f.push(`Template ID ${i.id} is not found.`), t.importUpdateResult.push({
477
476
  type: "update",
478
477
  original: b,
479
478
  template: b,
480
- excelSheetName: y,
481
- errors: p
479
+ excelSheetName: g,
480
+ errors: f
482
481
  }), t;
483
482
  }
484
483
  const $ = {
@@ -491,8 +490,8 @@ function kt(r) {
491
490
  ref: i.reference,
492
491
  items: n
493
492
  },
494
- excelSheetName: y,
495
- errors: p
493
+ excelSheetName: g,
494
+ errors: f
496
495
  };
497
496
  return t.importUpdateResult.push($), t;
498
497
  }
@@ -504,8 +503,8 @@ function kt(r) {
504
503
  ref: i.reference,
505
504
  items: n
506
505
  },
507
- excelSheetName: y,
508
- errors: p
506
+ excelSheetName: g,
507
+ errors: f
509
508
  };
510
509
  return t.importCreateResult.push(x), t;
511
510
  },
@@ -527,7 +526,7 @@ function kt(r) {
527
526
  const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-col" }, Ct = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, It = {
528
527
  key: 0,
529
528
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
530
- }, St = { key: 0 }, De = /* @__PURE__ */ O({
529
+ }, St = { key: 0 }, Me = /* @__PURE__ */ O({
531
530
  __name: "ClosingTemplateImportItem",
532
531
  props: {
533
532
  type: {},
@@ -539,7 +538,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
539
538
  setup(r) {
540
539
  const { t: s } = B();
541
540
  return (o, l) => {
542
- var y, p, f;
541
+ var g, f, p;
543
542
  const e = R("FmIcon"), t = R("FmTooltip");
544
543
  return k(), I("div", Tt, [
545
544
  l[0] || (l[0] = _("div", null, "•", -1)),
@@ -579,12 +578,12 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
579
578
  "text-fm-color-typo-secondary": !o.errors.length
580
579
  }
581
580
  ])
582
- }, C((y = o.locations) != null && y.length ? v(s)("inventory.closing.template.import.nLocations", { count: (p = o.locations) == null ? void 0 : p.length }) : v(s)("inventory.closing.template.import.allLocations")) + ", " + C(v(s)("inventory.closing.template.import.nItems", { count: (f = o.items) == null ? void 0 : f.length })), 3)
581
+ }, C((g = o.locations) != null && g.length ? v(s)("inventory.closing.template.import.nLocations", { count: (f = o.locations) == null ? void 0 : f.length }) : v(s)("inventory.closing.template.import.allLocations")) + ", " + C(v(s)("inventory.closing.template.import.nItems", { count: (p = o.items) == null ? void 0 : p.length })), 3)
583
582
  ])
584
583
  ]);
585
584
  };
586
585
  }
587
- }), Mt = { class: "flex flex-col gap-24" }, Dt = { class: "fm-typo-en-body-md-400" }, Ft = {
586
+ }), Dt = { class: "flex flex-col gap-24" }, Mt = { class: "fm-typo-en-body-md-400" }, Ft = {
588
587
  key: 0,
589
588
  class: "flex items-center gap-8"
590
589
  }, Rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pt = { class: "flex flex-col gap-8" }, At = { class: "line-clamp-2 text-ellipsis break-all" }, Et = {
@@ -599,13 +598,13 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
599
598
  }, Bt = { class: "fm-typo-en-body-lg-600" }, Lt = /* @__PURE__ */ O({
600
599
  __name: "ClosingTemplateImport",
601
600
  setup(r) {
602
- const s = M(null), o = mt(), l = Z(), e = M(!1), t = M(!1), y = M(new Array()), p = M([]), f = M([]), i = E(
603
- () => !!y.value.length || p.value.some((h) => h.errors.length) || f.value.some((h) => h.errors.length)
601
+ const s = D(null), o = mt(), l = Z(), e = D(!1), t = D(!1), g = D(new Array()), f = D([]), p = D([]), i = E(
602
+ () => !!g.value.length || f.value.some((h) => h.errors.length) || p.value.some((h) => h.errors.length)
604
603
  ), d = E(
605
- () => !!p.value.length || !!f.value.length
604
+ () => !!f.value.length || !!p.value.length
606
605
  ), { t: m } = B();
607
- async function g(h) {
608
- y.value = [], p.value = [], f.value = [];
606
+ async function y(h) {
607
+ g.value = [], f.value = [], p.value = [];
609
608
  try {
610
609
  e.value = !0;
611
610
  const [u] = await Promise.all([
@@ -616,18 +615,18 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
616
615
  if (!u.SheetNames.filter(
617
616
  (c) => !Object.values(ce).map(String).includes(c)
618
617
  ).find((c) => c)) {
619
- y.value.push(m("inventory.ingredient.import.fileError.noSheet"));
618
+ g.value.push(m("inventory.ingredient.import.fileError.noSheet"));
620
619
  return;
621
620
  }
622
621
  const x = kt(u);
623
622
  if (x.invalidExcel) {
624
- y.value.push(
623
+ g.value.push(
625
624
  x.invalidExcelMessage ?? m("inventory.ingredient.import.fileError.invalidExcel")
626
625
  );
627
626
  return;
628
627
  }
629
- if (p.value = x.importCreateResult, f.value = x.importUpdateResult, !p.value.length && !f.value.length) {
630
- y.value.push(m("inventory.ingredient.import.fileError.noData"));
628
+ if (f.value = x.importCreateResult, p.value = x.importUpdateResult, !f.value.length && !p.value.length) {
629
+ g.value.push(m("inventory.ingredient.import.fileError.noData"));
631
630
  return;
632
631
  }
633
632
  o.emitData(x);
@@ -638,18 +637,18 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
638
637
  type: "error"
639
638
  }), console.error("Error in reading file", u);
640
639
  } finally {
641
- y.value.length && l.open({
640
+ g.value.length && l.open({
642
641
  title: m("inventory.ingredient.import.fileError.invalidExcel"),
643
642
  type: "error"
644
643
  }), e.value = !1;
645
644
  }
646
645
  }
647
646
  return Re(s, (h) => {
648
- h && g(h);
647
+ h && y(h);
649
648
  }), (h, u) => {
650
649
  const n = R("FmCircularProgress"), a = R("FmIcon"), x = R("FmButton");
651
- return k(), I("div", Mt, [
652
- _("div", Dt, C(v(m)("inventory.closing.template.import.message")), 1),
650
+ return k(), I("div", Dt, [
651
+ _("div", Mt, C(v(m)("inventory.closing.template.import.message")), 1),
653
652
  t.value ? (k(), I("div", Ft, [
654
653
  _("div", null, [
655
654
  T(n, {
@@ -713,8 +712,8 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
713
712
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
714
713
  ]))
715
714
  ], 2),
716
- y.value.length ? (k(), I("div", Ut, [
717
- (k(!0), I(H, null, J(y.value, ($, b) => (k(), I("div", {
715
+ g.value.length ? (k(), I("div", Ut, [
716
+ (k(!0), I(H, null, J(g.value, ($, b) => (k(), I("div", {
718
717
  key: b,
719
718
  class: "flex gap-8 items-center"
720
719
  }, [
@@ -733,7 +732,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
733
732
  ]), 1032, ["class", "label", "button-label"]),
734
733
  d.value ? (k(), I("div", Nt, [
735
734
  _("div", Bt, C(v(m)("inventory.ingredient.import.summary")), 1),
736
- (k(!0), I(H, null, J(p.value, (c, $) => (k(), V(De, {
735
+ (k(!0), I(H, null, J(f.value, (c, $) => (k(), V(Me, {
737
736
  key: $,
738
737
  name: c.template.name,
739
738
  locations: c.template.locations,
@@ -741,7 +740,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
741
740
  errors: c.errors,
742
741
  type: "create"
743
742
  }, null, 8, ["name", "locations", "items", "errors"]))), 128)),
744
- (k(!0), I(H, null, J(f.value, (c) => (k(), V(De, {
743
+ (k(!0), I(H, null, J(p.value, (c) => (k(), V(Me, {
745
744
  key: c.template._id,
746
745
  name: c.template.name,
747
746
  locations: c.template.locations,
@@ -755,23 +754,23 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
755
754
  };
756
755
  }
757
756
  }), se = Ue("closingTemplateActions", () => {
758
- const { t: r } = B(), s = ie(), o = Z(), l = ee(), e = te(), { loading: t } = Ve(e), y = M({});
759
- function p() {
760
- y.value = {
757
+ const { t: r } = B(), s = ie(), o = Z(), l = ee(), e = te(), { loading: t } = Ve(e), g = D({});
758
+ function f() {
759
+ g.value = {
761
760
  mode: z.CREATE,
762
761
  show: !0,
763
762
  "onUpdate:show"(n) {
764
- y.value.show = n;
763
+ g.value.show = n;
765
764
  }
766
765
  };
767
766
  }
768
- function f(n) {
769
- y.value = {
767
+ function p(n) {
768
+ g.value = {
770
769
  mode: z.UPDATE,
771
770
  modelValue: n,
772
771
  show: !0,
773
772
  "onUpdate:show"(a) {
774
- y.value.show = a;
773
+ g.value.show = a;
775
774
  }
776
775
  };
777
776
  }
@@ -781,12 +780,12 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
781
780
  message: "Deleted template can no longer be retrieved",
782
781
  primaryActions: {
783
782
  text: "Delete",
784
- variant: Me.Destructive,
783
+ variant: De.Destructive,
785
784
  close: !0
786
785
  },
787
786
  secondaryActions: {
788
787
  text: "Cancel",
789
- variant: Me.Plain,
788
+ variant: De.Plain,
790
789
  close: !0
791
790
  }
792
791
  }).onPrimary(async () => {
@@ -816,7 +815,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
816
815
  }
817
816
  });
818
817
  }
819
- const d = M({});
818
+ const d = D({});
820
819
  function m(n) {
821
820
  d.value = {
822
821
  template: n,
@@ -825,11 +824,11 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
825
824
  d.value.show = a;
826
825
  },
827
826
  "onAction:edit"() {
828
- d.value.show = !1, f(Ae(n));
827
+ d.value.show = !1, p(Ae(n));
829
828
  }
830
829
  };
831
830
  }
832
- function g() {
831
+ function y() {
833
832
  if (!e.templates.length) {
834
833
  o.open({
835
834
  title: "No data to export",
@@ -927,13 +926,13 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
927
926
  }
928
927
  }
929
928
  return {
930
- createTemplate: p,
929
+ createTemplate: f,
931
930
  viewTemplate: m,
932
- updateTemplate: f,
931
+ updateTemplate: p,
933
932
  deleteTemplate: i,
934
- exportTemplates: g,
933
+ exportTemplates: y,
935
934
  importTemplates: h,
936
- templateDialogProps: y,
935
+ templateDialogProps: g,
937
936
  templateDetailsProps: d
938
937
  };
939
938
  });
@@ -980,14 +979,14 @@ function zt(r) {
980
979
  minSize: 200,
981
980
  maxSize: 400,
982
981
  cell(e) {
983
- var y, p, f;
982
+ var g, f, p;
984
983
  const t = e.row.original;
985
984
  return F("div", { class: "flex items-center gap-32" }, [
986
985
  F(
987
986
  L.FmFormGroup,
988
987
  {
989
988
  value: t.sku.unit._id,
990
- modelValue: !((y = t.disabledMeasurements) != null && y.includes(t.sku.unit._id))
989
+ modelValue: !((g = t.disabledMeasurements) != null && g.includes(t.sku.unit._id))
991
990
  },
992
991
  F(
993
992
  "div",
@@ -998,8 +997,8 @@ function zt(r) {
998
997
  [
999
998
  F(L.FmCheckbox, {
1000
999
  value: t.sku.unit._id,
1001
- modelValue: !((p = t.disabledMeasurements) != null && p.includes(t.sku.unit._id)),
1002
- disabled: r.disabled || !((f = t.disabledMeasurements) != null && f.includes(t.sku.unit._id)) && t.sku.unit.measurements.every(
1000
+ modelValue: !((f = t.disabledMeasurements) != null && f.includes(t.sku.unit._id)),
1001
+ disabled: r.disabled || !((p = t.disabledMeasurements) != null && p.includes(t.sku.unit._id)) && t.sku.unit.measurements.every(
1003
1002
  (i) => {
1004
1003
  var d;
1005
1004
  return (d = t.disabledMeasurements) == null ? void 0 : d.includes(i.id);
@@ -1044,12 +1043,12 @@ function zt(r) {
1044
1043
  ),
1045
1044
  ...Array.from({ length: Math.max(o, 0) }).map((i, d) => {
1046
1045
  var h, u, n, a;
1047
- const m = e.row.original, g = m.sku.unit.measurements[d];
1048
- return g ? F(
1046
+ const m = e.row.original, y = m.sku.unit.measurements[d];
1047
+ return y ? F(
1049
1048
  L.FmFormGroup,
1050
1049
  {
1051
- modelValue: !((h = m.disabledMeasurements) != null && h.includes(g.id)),
1052
- value: g.id
1050
+ modelValue: !((h = m.disabledMeasurements) != null && h.includes(y.id)),
1051
+ value: y.id
1053
1052
  },
1054
1053
  F(
1055
1054
  "div",
@@ -1059,9 +1058,9 @@ function zt(r) {
1059
1058
  },
1060
1059
  [
1061
1060
  F(L.FmCheckbox, {
1062
- value: g.id,
1063
- modelValue: !((u = m.disabledMeasurements) != null && u.includes(g.id)),
1064
- disabled: r.disabled || !((n = m.disabledMeasurements) != null && n.includes(g.id)) && ((a = m.disabledMeasurements) == null ? void 0 : a.includes(m.sku.unit._id)) && m.sku.unit.measurements.filter((x) => x.id != g.id).every((x) => {
1061
+ value: y.id,
1062
+ modelValue: !((u = m.disabledMeasurements) != null && u.includes(y.id)),
1063
+ disabled: r.disabled || !((n = m.disabledMeasurements) != null && n.includes(y.id)) && ((a = m.disabledMeasurements) == null ? void 0 : a.includes(m.sku.unit._id)) && m.sku.unit.measurements.filter((x) => x.id != y.id).every((x) => {
1065
1064
  var c;
1066
1065
  return (c = m.disabledMeasurements) == null ? void 0 : c.includes(x.id);
1067
1066
  }),
@@ -1071,14 +1070,14 @@ function zt(r) {
1071
1070
  r.updateItem({
1072
1071
  ...m,
1073
1072
  disabledMeasurements: (c = m.disabledMeasurements) == null ? void 0 : c.filter(
1074
- ($) => $ !== g.id
1073
+ ($) => $ !== y.id
1075
1074
  )
1076
1075
  });
1077
1076
  else {
1078
1077
  const $ = m.disabledMeasurements ?? [];
1079
1078
  r.updateItem({
1080
1079
  ...m,
1081
- disabledMeasurements: [...$, g.id]
1080
+ disabledMeasurements: [...$, y.id]
1082
1081
  });
1083
1082
  }
1084
1083
  }
@@ -1088,13 +1087,13 @@ function zt(r) {
1088
1087
  { zIndex: 51 },
1089
1088
  {
1090
1089
  content() {
1091
- return g.abbrev;
1090
+ return y.abbrev;
1092
1091
  },
1093
1092
  default() {
1094
1093
  return F(
1095
1094
  "div",
1096
1095
  { class: "line-clamp-2 fm-typo-en-body-lg-400" },
1097
- g.abbrev
1096
+ y.abbrev
1098
1097
  );
1099
1098
  }
1100
1099
  }
@@ -1150,7 +1149,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1150
1149
  () => o.value.getVisibleCells().filter((e) => e.column.id !== K.Name && e.column.id !== K.Delete)
1151
1150
  );
1152
1151
  return (e, t) => {
1153
- var y, p, f, i, d;
1152
+ var g, f, p, i, d;
1154
1153
  return k(), I("div", Ht, [
1155
1154
  _("div", Ot, [
1156
1155
  _("div", jt, [
@@ -1159,7 +1158,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1159
1158
  ]),
1160
1159
  _("div", null, [
1161
1160
  T(v(j), {
1162
- render: (f = (p = (y = e.cellByColId[v(K).Delete]) == null ? void 0 : y.column) == null ? void 0 : p.columnDef) == null ? void 0 : f.cell,
1161
+ render: (p = (f = (g = e.cellByColId[v(K).Delete]) == null ? void 0 : g.column) == null ? void 0 : f.columnDef) == null ? void 0 : p.cell,
1163
1162
  props: (d = (i = e.cellByColId[v(K).Delete]) == null ? void 0 : i.getContext) == null ? void 0 : d.call(i)
1164
1163
  }, null, 8, ["render", "props"])
1165
1164
  ])
@@ -1167,12 +1166,12 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1167
1166
  _("div", Gt, [
1168
1167
  t[0] || (t[0] = _("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, null, -1)),
1169
1168
  (k(!0), I(H, null, J(l.value, (m) => {
1170
- var g, h, u;
1169
+ var y, h, u;
1171
1170
  return k(), I("div", {
1172
1171
  key: m.id
1173
1172
  }, [
1174
1173
  T(v(j), {
1175
- render: (h = (g = m.column) == null ? void 0 : g.columnDef) == null ? void 0 : h.cell,
1174
+ render: (h = (y = m.column) == null ? void 0 : y.columnDef) == null ? void 0 : h.cell,
1176
1175
  props: (u = m.getContext) == null ? void 0 : u.call(m)
1177
1176
  }, null, 8, ["render", "props"])
1178
1177
  ]);
@@ -1188,9 +1187,9 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1188
1187
  disabled: { type: Boolean }
1189
1188
  },
1190
1189
  setup(r, { expose: s }) {
1191
- const o = r, l = tt(), { t: e } = B(), t = ae(), y = ie(), {
1192
- promptSelectLocations: p,
1193
- columnDefs: f,
1190
+ const o = r, l = tt(), { t: e } = B(), t = ae(), g = ie(), {
1191
+ promptSelectLocations: f,
1192
+ columnDefs: p,
1194
1193
  rowData: i
1195
1194
  } = nt({
1196
1195
  getLocations() {
@@ -1199,7 +1198,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1199
1198
  setLocations(n) {
1200
1199
  l.locations = n;
1201
1200
  }
1202
- }), d = M(), m = M("");
1201
+ }), d = D(), m = D("");
1203
1202
  s({
1204
1203
  validateInputs: () => {
1205
1204
  var n, a;
@@ -1214,7 +1213,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1214
1213
  (a = (n = d.value) == null ? void 0 : n.resetInputs) == null || a.call(n);
1215
1214
  }
1216
1215
  });
1217
- const g = zt({
1216
+ const y = zt({
1218
1217
  updateItem: (n) => {
1219
1218
  l.items = l.items.map((a) => a.sku._id !== n.sku._id ? a : n);
1220
1219
  },
@@ -1227,7 +1226,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1227
1226
  get disabled() {
1228
1227
  return o.disabled;
1229
1228
  }
1230
- }), h = E(() => g.columnDefs.value);
1229
+ }), h = E(() => y.columnDefs.value);
1231
1230
  function u() {
1232
1231
  const n = t.skus.map((x) => ({
1233
1232
  label: x.name,
@@ -1237,7 +1236,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1237
1236
  var c;
1238
1237
  return (c = l.items) == null ? void 0 : c.find(($) => $.sku._id === x.value._id);
1239
1238
  }).map((x) => x.value);
1240
- y.open({
1239
+ g.open({
1241
1240
  title: e("inventory.closing.form.items.selectItem"),
1242
1241
  closeButton: !0,
1243
1242
  contentComponent: lt,
@@ -1257,7 +1256,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1257
1256
  }
1258
1257
  }).onPrimary((x) => {
1259
1258
  const c = l.items ?? [], $ = x.map((b) => {
1260
- const w = c.find((D) => D.sku._id === b._id);
1259
+ const w = c.find((M) => M.sku._id === b._id);
1261
1260
  return w || {
1262
1261
  sku: b
1263
1262
  };
@@ -1280,14 +1279,14 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1280
1279
  label: v(e)("inventory.closing.form.name"),
1281
1280
  "label-mark": "required",
1282
1281
  modelValue: v(l).name,
1283
- "onUpdate:modelValue": a[0] || (a[0] = (D) => v(l).name = D),
1282
+ "onUpdate:modelValue": a[0] || (a[0] = (M) => v(l).name = M),
1284
1283
  rules: [v(ot)()]
1285
1284
  }, null, 8, ["label", "modelValue", "rules"]),
1286
1285
  T(x, {
1287
1286
  label: v(e)("inventory.closing.form.reference"),
1288
1287
  "label-mark": "optional",
1289
1288
  modelValue: v(l).ref,
1290
- "onUpdate:modelValue": a[1] || (a[1] = (D) => v(l).ref = D)
1289
+ "onUpdate:modelValue": a[1] || (a[1] = (M) => v(l).ref = M)
1291
1290
  }, null, 8, ["label", "modelValue"])
1292
1291
  ])
1293
1292
  ]),
@@ -1300,14 +1299,14 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1300
1299
  "prepend-icon": "add",
1301
1300
  variant: "plain",
1302
1301
  class: "border-2 rounded-lg border-fm-color-primary",
1303
- onClick: v(p)
1302
+ onClick: v(f)
1304
1303
  }, null, 8, ["disabled", "label", "onClick"])
1305
1304
  ]),
1306
1305
  T($, {
1307
- "column-defs": v(f),
1306
+ "column-defs": v(p),
1308
1307
  "row-data": v(i),
1309
1308
  "shrink-at": 9999,
1310
- onRowClick: v(p),
1309
+ onRowClick: v(f),
1311
1310
  "hide-footer": ""
1312
1311
  }, null, 8, ["column-defs", "row-data", "onRowClick"])
1313
1312
  ]),
@@ -1320,21 +1319,21 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1320
1319
  "prepend-icon": "add",
1321
1320
  variant: "plain",
1322
1321
  class: "border-2 rounded-lg border-fm-color-primary",
1323
- onClick: a[2] || (a[2] = (D) => u()),
1322
+ onClick: a[2] || (a[2] = (M) => u()),
1324
1323
  size: "md"
1325
1324
  }, null, 8, ["disabled", "label"])
1326
1325
  ]),
1327
1326
  T(x, {
1328
1327
  placeholder: "Filter items",
1329
1328
  modelValue: m.value,
1330
- "onUpdate:modelValue": a[4] || (a[4] = (D) => m.value = D)
1329
+ "onUpdate:modelValue": a[4] || (a[4] = (M) => m.value = M)
1331
1330
  }, Pe({ _: 2 }, [
1332
1331
  m.value ? {
1333
1332
  name: "append",
1334
1333
  fn: P(() => [
1335
1334
  T(b, {
1336
1335
  name: "close",
1337
- onClick: a[3] || (a[3] = (D) => m.value = ""),
1336
+ onClick: a[3] || (a[3] = (M) => m.value = ""),
1338
1337
  class: "cursor-pointer"
1339
1338
  })
1340
1339
  ]),
@@ -1345,18 +1344,18 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1345
1344
  "search-value": m.value,
1346
1345
  "column-defs": h.value,
1347
1346
  "row-data": v(l).items,
1348
- key: v(l).items.map((D) => D.sku._id).join("."),
1347
+ key: v(l).items.map((M) => M.sku._id).join("."),
1349
1348
  "hide-footer": v(l).items.length <= 10,
1350
1349
  "page-size": Math.min(10, v(l).items.length)
1351
1350
  }, {
1352
- "list-row": P((D) => [
1351
+ "list-row": P((M) => [
1353
1352
  (k(), V(Ee, {
1354
- row: D,
1353
+ row: M,
1355
1354
  key: v(l).items.map((S) => S.sku._id).join(".")
1356
1355
  }, {
1357
1356
  default: P((S) => [
1358
1357
  T(Jt, {
1359
- row: D,
1358
+ row: M,
1360
1359
  "cell-by-col-id": S
1361
1360
  }, null, 8, ["row", "cell-by-col-id"])
1362
1361
  ]),
@@ -1385,7 +1384,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1385
1384
  emits: ["update:show", "submitted"],
1386
1385
  setup(r, { expose: s, emit: o }) {
1387
1386
  var $;
1388
- const l = r, e = o, t = ee(), y = Z(), { t: p } = B(), f = ut(l, "show");
1387
+ const l = r, e = o, t = ee(), g = Z(), { t: f } = B(), p = ut(l, "show");
1389
1388
  function i() {
1390
1389
  return {
1391
1390
  _id: "",
@@ -1393,7 +1392,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1393
1392
  items: []
1394
1393
  };
1395
1394
  }
1396
- const d = M(l.modelValue ?? i()), m = M((($ = l.modelValue) == null ? void 0 : $._id) ?? `${Math.random()}`);
1395
+ const d = D(l.modelValue ?? i()), m = D((($ = l.modelValue) == null ? void 0 : $._id) ?? `${Math.random()}`);
1397
1396
  Re(
1398
1397
  () => l.show,
1399
1398
  (b) => {
@@ -1401,17 +1400,17 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1401
1400
  b && (d.value = l.modelValue ?? i(), m.value = ((w = l.modelValue) == null ? void 0 : w._id) ?? `${Math.random()}`);
1402
1401
  }
1403
1402
  );
1404
- const g = M(!1), h = E(() => {
1403
+ const y = D(!1), h = E(() => {
1405
1404
  switch (l.mode) {
1406
1405
  case z.READ:
1407
1406
  return "";
1408
1407
  case z.CREATE:
1409
- return p("inventory.closing.template.create.title");
1408
+ return f("inventory.closing.template.create.title");
1410
1409
  case z.UPDATE:
1411
- return p("inventory.closing.template.update.title");
1410
+ return f("inventory.closing.template.update.title");
1412
1411
  }
1413
1412
  return "";
1414
- }), u = M();
1413
+ }), u = D();
1415
1414
  s({
1416
1415
  validateInputs: () => {
1417
1416
  var b, w;
@@ -1429,45 +1428,45 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1429
1428
  async function n() {
1430
1429
  const b = d.value;
1431
1430
  if (b) {
1432
- g.value = !0;
1431
+ y.value = !0;
1433
1432
  try {
1434
- await t.createTemplate(b), await new Promise((w) => setTimeout(w, 1e3)), y.open({
1435
- title: p("inventory.closing.template.create.success"),
1436
- message: p("inventory.closing.template.create.successMessage"),
1433
+ await t.createTemplate(b), await new Promise((w) => setTimeout(w, 1e3)), g.open({
1434
+ title: f("inventory.closing.template.create.success"),
1435
+ message: f("inventory.closing.template.create.successMessage"),
1437
1436
  type: "success"
1438
1437
  }), e("update:show", !1), e("submitted");
1439
1438
  } catch (w) {
1440
- y.open({
1441
- title: p("inventory.closing.template.create.error"),
1442
- message: p("inventory.closing.template.create.errorMessage"),
1439
+ g.open({
1440
+ title: f("inventory.closing.template.create.error"),
1441
+ message: f("inventory.closing.template.create.errorMessage"),
1443
1442
  type: "error"
1444
1443
  }), console.error("Error in creating closing template", w);
1445
1444
  } finally {
1446
- g.value = !1;
1445
+ y.value = !1;
1447
1446
  }
1448
1447
  }
1449
1448
  }
1450
1449
  async function a() {
1451
1450
  const b = d.value;
1452
1451
  if (b) {
1453
- g.value = !0;
1452
+ y.value = !0;
1454
1453
  try {
1455
1454
  await t.updateTemplate({
1456
1455
  ...b,
1457
1456
  _rev: b._rev ?? ""
1458
- }), await new Promise((w) => setTimeout(w, 1e3)), y.open({
1459
- title: p("inventory.closing.template.update.success"),
1460
- message: p("inventory.closing.template.update.successMessage"),
1457
+ }), await new Promise((w) => setTimeout(w, 1e3)), g.open({
1458
+ title: f("inventory.closing.template.update.success"),
1459
+ message: f("inventory.closing.template.update.successMessage"),
1461
1460
  type: "success"
1462
1461
  }), e("update:show", !1), e("submitted");
1463
1462
  } catch (w) {
1464
- y.open({
1465
- title: p("inventory.closing.template.update.error"),
1466
- message: p("inventory.closing.template.update.errorMessage"),
1463
+ g.open({
1464
+ title: f("inventory.closing.template.update.error"),
1465
+ message: f("inventory.closing.template.update.errorMessage"),
1467
1466
  type: "error"
1468
1467
  }), console.error("Error in updating closing template", w);
1469
1468
  } finally {
1470
- g.value = !1;
1469
+ y.value = !1;
1471
1470
  }
1472
1471
  }
1473
1472
  }
@@ -1484,10 +1483,10 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1484
1483
  (w = (b = u.value) == null ? void 0 : b.validateInputs) == null || w.call(b);
1485
1484
  }
1486
1485
  return (b, w) => {
1487
- const A = R("FmButton"), D = R("FmSideSheet");
1488
- return k(), V(D, {
1489
- modelValue: v(f),
1490
- "onUpdate:modelValue": w[2] || (w[2] = (S) => je(f) ? f.value = S : null),
1486
+ const A = R("FmButton"), M = R("FmSideSheet");
1487
+ return k(), V(M, {
1488
+ modelValue: v(p),
1489
+ "onUpdate:modelValue": w[2] || (w[2] = (S) => je(p) ? p.value = S : null),
1491
1490
  "dismiss-away": "",
1492
1491
  "close-button": "",
1493
1492
  "max-width": 800
@@ -1505,21 +1504,21 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1505
1504
  onValidationSuccess: x,
1506
1505
  "model-value": d.value,
1507
1506
  "onUpdate:modelValue": w[0] || (w[0] = (S) => d.value = S),
1508
- disabled: g.value,
1507
+ disabled: y.value,
1509
1508
  key: m.value
1510
1509
  }, null, 8, ["model-value", "disabled"]))
1511
1510
  ]),
1512
1511
  "side-sheet-footer": P(() => [
1513
1512
  _("div", an, [
1514
1513
  T(A, {
1515
- loading: g.value,
1516
- label: v(p)("common.save"),
1514
+ loading: y.value,
1515
+ label: v(f)("common.save"),
1517
1516
  onClick: c
1518
1517
  }, null, 8, ["loading", "label"]),
1519
1518
  T(A, {
1520
- disabled: g.value,
1519
+ disabled: y.value,
1521
1520
  variant: "tertiary",
1522
- label: v(p)("common.close"),
1521
+ label: v(f)("common.close"),
1523
1522
  onClick: w[1] || (w[1] = (S) => e("update:show", !1))
1524
1523
  }, null, 8, ["disabled", "label"])
1525
1524
  ])
@@ -1545,8 +1544,8 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1545
1544
  __name: "ClosingTemplatePublish",
1546
1545
  emits: ["close"],
1547
1546
  setup(r, { emit: s }) {
1548
- const o = M(!1), l = Z(), e = ee(), t = te(), { t: y } = B(), p = s;
1549
- async function f() {
1547
+ const o = D(!1), l = Z(), e = ee(), t = te(), { t: g } = B(), f = s;
1548
+ async function p() {
1550
1549
  o.value = !0;
1551
1550
  try {
1552
1551
  await e.startNewPublish().delayed(1e3), l.open({
@@ -1554,12 +1553,12 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1554
1553
  message: "You may refresh after a while to review publish status",
1555
1554
  type: "success"
1556
1555
  }), m();
1557
- } catch (g) {
1556
+ } catch (y) {
1558
1557
  l.open({
1559
1558
  title: "Something went wrong",
1560
1559
  message: "Please try again",
1561
1560
  type: "error"
1562
- }), console.error("error on creating publish task", g);
1561
+ }), console.error("error on creating publish task", y);
1563
1562
  } finally {
1564
1563
  o.value = !1;
1565
1564
  }
@@ -1568,9 +1567,9 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1568
1567
  () => t.templates.length && (!i.value || i.value.outlets.length === i.value.completed.length)
1569
1568
  );
1570
1569
  function m() {
1571
- p("close");
1570
+ f("close");
1572
1571
  }
1573
- return (g, h) => {
1572
+ return (y, h) => {
1574
1573
  const u = R("FmCircularProgress"), n = R("i18n-t"), a = R("FmButton");
1575
1574
  return k(), I("div", dn, [
1576
1575
  v(t).templates.length ? o.value ? (k(), I("div", fn, [
@@ -1581,7 +1580,7 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1581
1580
  })
1582
1581
  ]),
1583
1582
  _("div", vn, [
1584
- _("span", null, C(v(y)("inventory.closing.template.publish.publishing")), 1)
1583
+ _("span", null, C(v(g)("inventory.closing.template.publish.publishing")), 1)
1585
1584
  ])
1586
1585
  ])) : i.value ? i.value.outlets.length === i.value.completed.length ? (k(), I("div", yn, [
1587
1586
  T(n, {
@@ -1596,7 +1595,7 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1596
1595
  ]),
1597
1596
  _: 1
1598
1597
  }),
1599
- _("p", null, C(v(y)("inventory.closing.template.publish.message")), 1)
1598
+ _("p", null, C(v(g)("inventory.closing.template.publish.message")), 1)
1600
1599
  ])) : (k(), I("div", _n, [
1601
1600
  T(n, {
1602
1601
  keypath: "inventory.closing.template.publish.stillPublishing",
@@ -1612,17 +1611,17 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1612
1611
  }),
1613
1612
  Fe(" Your recent publishing task is still pending (" + C(i.value.completed.length) + " / " + C(i.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
1614
1613
  ])) : (k(), I("div", gn, [
1615
- _("p", null, C(v(y)("inventory.closing.template.publish.noRecentActivity")), 1),
1616
- _("p", null, C(v(y)("inventory.closing.template.publish.message")), 1)
1614
+ _("p", null, C(v(g)("inventory.closing.template.publish.noRecentActivity")), 1),
1615
+ _("p", null, C(v(g)("inventory.closing.template.publish.message")), 1)
1617
1616
  ])) : (k(), I("div", pn, [
1618
- _("p", null, C(v(y)("inventory.closing.template.publish.nothingToPublish")), 1)
1617
+ _("p", null, C(v(g)("inventory.closing.template.publish.nothingToPublish")), 1)
1619
1618
  ])),
1620
1619
  _("div", kn, [
1621
1620
  T(a, {
1622
1621
  disabled: !d.value,
1623
1622
  loading: o.value,
1624
1623
  label: "Publish to all outlets",
1625
- onClick: f
1624
+ onClick: p
1626
1625
  }, null, 8, ["disabled", "loading"]),
1627
1626
  T(a, {
1628
1627
  variant: "tertiary",
@@ -1633,12 +1632,12 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1633
1632
  ]);
1634
1633
  };
1635
1634
  }
1636
- }), $n = { class: "flex-1 flex flex-col gap-8" }, Cn = { class: "flex flex-col" }, In = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Sn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Mn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Dn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Bn = /* @__PURE__ */ O({
1635
+ }), $n = { class: "flex-1 flex flex-col gap-8" }, Cn = { class: "flex flex-col" }, In = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Sn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Dn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Mn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Bn = /* @__PURE__ */ O({
1637
1636
  __name: "ClosingTemplateView",
1638
1637
  setup(r) {
1639
- const { t: s } = B(), { createTemplate: o, updateTemplate: l, exportTemplates: e, importTemplates: t } = se(), { templateDialogProps: y, templateDetailsProps: p } = Ve(se()), f = le(), i = ie(), d = te(), m = rt(), { breakpoints: g } = dt();
1640
- f.watchLocation(d.fetchTemplates);
1641
- const h = E(() => d.loading), u = M(""), n = E(() => g.value.xs || g.value.sm), a = E(() => n.value ? 10 : 20);
1638
+ const { t: s } = B(), { createTemplate: o, updateTemplate: l, exportTemplates: e, importTemplates: t } = se(), { templateDialogProps: g, templateDetailsProps: f } = Ve(se()), p = le(), i = ie(), d = te(), m = rt(), { breakpoints: y } = dt();
1639
+ p.watchLocation(d.fetchTemplates);
1640
+ const h = E(() => d.loading), u = D(""), n = E(() => y.value.xs || y.value.sm), a = E(() => n.value ? 10 : 20);
1642
1641
  function x(w) {
1643
1642
  switch (w) {
1644
1643
  case N.Add:
@@ -1723,7 +1722,7 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1723
1722
  }
1724
1723
  ]);
1725
1724
  return (w, A) => {
1726
- const D = R("FmTable");
1725
+ const M = R("FmTable");
1727
1726
  return k(), I(H, null, [
1728
1727
  T(it, {
1729
1728
  title: v(s)("inventory.closing.template.title"),
@@ -1745,7 +1744,7 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1745
1744
  search: u.value,
1746
1745
  "onUpdate:search": A[0] || (A[0] = (S) => u.value = S)
1747
1746
  }, null, 8, ["search"]),
1748
- T(D, {
1747
+ T(M, {
1749
1748
  style: Ye(v(m).tableHeight),
1750
1749
  "column-defs": v(d).columnDefs,
1751
1750
  "row-data": v(d).templates,
@@ -1779,11 +1778,11 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1779
1778
  _("div", null, C((he = S.original.locations) != null && he.length ? v(s)("inventory.closing.table.enabledForN", {
1780
1779
  count: ((be = S.original.locations) == null ? void 0 : be.length) ?? 0
1781
1780
  }) : v(s)("inventory.closing.table.enabledForAll")), 1),
1782
- _("div", Mn, C([
1781
+ _("div", Dn, C([
1783
1782
  ...S.original.items.slice(0, 3).map((Oe) => Oe.sku.name),
1784
1783
  ...S.original.items.length >= 3 ? [`and ${S.original.items.length - 3} more items`] : []
1785
1784
  ].join(", ")), 1),
1786
- _("div", Dn, [
1785
+ _("div", Mn, [
1787
1786
  T(v(j), {
1788
1787
  render: (we = (xe = (_e = U.ref) == null ? void 0 : _e.column) == null ? void 0 : xe.columnDef) == null ? void 0 : we.cell,
1789
1788
  props: (ke = (Q = U.ref) == null ? void 0 : Q.getContext) == null ? void 0 : ke.call(Q)
@@ -1809,8 +1808,8 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1809
1808
  _: 1
1810
1809
  }, 8, ["title", "actions"]),
1811
1810
  (k(), V(Ke, { to: "body" }, [
1812
- T(un, Ge(Je(v(p))), null, 16),
1813
- T(rn, We(v(y), {
1811
+ T(un, Ge(Je(v(f))), null, 16),
1812
+ T(rn, We(v(g), {
1814
1813
  onSubmitted: A[2] || (A[2] = (S) => v(d).fetchTemplates())
1815
1814
  }), null, 16)
1816
1815
  ]))