@feedmepos/mf-inventory-portal 1.6.0-dev.6 → 1.6.0

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 (82) hide show
  1. package/dist/{App-Di8cQoKT.js → App-EFQddl2W.js} +4 -4
  2. package/dist/{ApprovalView-qM9i8hVq.js → ApprovalView-DQG8Ti9p.js} +7 -7
  3. package/dist/{BindingsDialog-BZAGYZXv.js → BindingsDialog-D2IwJvme.js} +2 -2
  4. package/dist/{BindingsPicker-Dxv8-E41.js → BindingsPicker-ZGbgh9Vk.js} +2 -2
  5. package/dist/{BindingsTable-Av0a-FDQ.js → BindingsTable-Dgs2Od1_.js} +3 -3
  6. package/dist/{ClosingDraftView-BFJ4IBqb.js → ClosingDraftView-DGz2x5Lp.js} +1589 -1587
  7. package/dist/{ClosingHistoryView-BT-VDKmv.js → ClosingHistoryView-SvbQFffP.js} +5 -5
  8. package/dist/{ClosingTemplateView-DdE94MR4.js → ClosingTemplateView-LIyUAZ7a.js} +649 -633
  9. package/dist/{DefaultView-BgoUI3tD.js → DefaultView-B96qddHF.js} +2 -2
  10. package/dist/{DeliveryOrderPrintPreview-BdTL2m9C.js → DeliveryOrderPrintPreview-DWQ6hyoL.js} +2 -2
  11. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DYB-uCRa.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BfRdyxp5.js} +2 -2
  12. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DcM6xetz.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang--A4q92Mt.js} +2 -2
  13. package/dist/{FmMultiselectDialog-Ejv58jEW.js → FmMultiselectDialog-B1O653NS.js} +2 -2
  14. package/dist/{FmMultiselectDialog-BND4jAye.js → FmMultiselectDialog-SDMUzTex.js} +1 -1
  15. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DHy5OLee.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D8u2M7r1.js} +5 -5
  16. package/dist/{ImportView-B53g06tS.js → ImportView-BSlnGvlm.js} +6 -6
  17. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-D1RFIkGm.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DaihxdpF.js} +1 -1
  18. package/dist/{IngredientGroupView-DlVQL7q9.js → IngredientGroupView-Dy1fLXHf.js} +5 -5
  19. package/dist/{IngredientsView-CnlcPJOS.js → IngredientsView-Dno8kdrq.js} +15 -15
  20. package/dist/{IntegrationExplorerView-isFlGe0Z.js → IntegrationExplorerView-C_5XKtMn.js} +352 -352
  21. package/dist/{IntegrationView-jLnGwPAe.js → IntegrationView-D2_2A1ve.js} +13 -13
  22. package/dist/{InventoryBindingForm-Bz1iNKVE.js → InventoryBindingForm-YQFbS1hV.js} +1 -1
  23. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-usQ8ZPbn.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CMXe46hm.js} +5 -5
  24. package/dist/{InventoryBindingSummary-DZyoeLau.js → InventoryBindingSummary-DQEoKMWr.js} +1 -1
  25. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-NkzVPQq_.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CcJ7YBY5.js} +1 -1
  26. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DAXEWYd4.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DdTdixxy.js} +1 -1
  27. package/dist/{PublishView-DDK-PSH_.js → PublishView-Cv8penOo.js} +3 -3
  28. package/dist/{PurchaseOrderPrintPreview-CUby20Ms.js → PurchaseOrderPrintPreview-BvbaFNpc.js} +2 -2
  29. package/dist/{ReceiveRequestView-830tKUWt.js → ReceiveRequestView-BP7KFzO6.js} +36 -34
  30. package/dist/{RecipeView-CMKwkmte.js → RecipeView-DU0QKiC9.js} +17 -17
  31. package/dist/{SettingsView-DttG-rgv.js → SettingsView-DYNFioZF.js} +4 -4
  32. package/dist/{StockView-BSLKtOO-.js → StockView-CzdVLGZy.js} +19 -19
  33. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cn967MK-.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DyDTSy_F.js} +1 -1
  34. package/dist/{SupplierView-C0ZwULLi.js → SupplierView-BxbGPyPv.js} +12 -12
  35. package/dist/{SurchargeView-LWasGLSm.js → SurchargeView-DIxfUVfT.js} +6 -6
  36. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-BrK8u3nO.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-g0AfgEFk.js} +2 -2
  37. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DvVDeHjR.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DsLOwuNG.js} +1 -1
  38. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DcllUuxg.js → TransferDetails.vue_vue_type_script_setup_true_lang-CxVlssDF.js} +155 -155
  39. package/dist/{TransferTemplateView-CCVrzVkT.js → TransferTemplateView-DRqghp1v.js} +20 -20
  40. package/dist/{UnitCostHistoryView-DFJJ2u8P.js → UnitCostHistoryView-BCQDTDOB.js} +4 -4
  41. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DdzpfKGK.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BikZCEmA.js} +5 -5
  42. package/dist/{UnitView-BcYQKL84.js → UnitView-BXoXHqYc.js} +7 -7
  43. package/dist/{WarehouseView-kNgPHyAP.js → WarehouseView-DtnB7VJj.js} +5 -5
  44. package/dist/{WastageTemplateView-e0F6dinm.js → WastageTemplateView-SNpTF3AP.js} +14 -14
  45. package/dist/{app-DK2wDdRG.js → app-DTBAhC9s.js} +127 -118
  46. package/dist/app.js +1 -1
  47. package/dist/{closing-template-C1Ag3g2s.js → closing-template-DBDqx2IR.js} +1 -1
  48. package/dist/{date2-DdWkOefy.js → date2-BD3_Vr8I.js} +1 -1
  49. package/dist/{dayjs.min-DKWqZGj8.js → dayjs.min-CGyhCaEH.js} +1 -1
  50. package/dist/{decimal-jEQmohI0.js → decimal-CnReZARa.js} +2 -2
  51. package/dist/{defineDeepModel-DEeVL0NT.js → defineDeepModel-BCBQ-V52.js} +1 -1
  52. package/dist/{duplicate-template-B0a9h4uA.js → duplicate-template-Dpb2sb-q.js} +1 -1
  53. package/dist/{feature-DujhKQag.js → feature-BACkglr0.js} +2 -2
  54. package/dist/{format-time-from-id-BpRp_X3u.js → format-time-from-id-CxJLjrBT.js} +1 -1
  55. package/dist/{format-unit-display-Da8nKxPz.js → format-unit-display-BUfzwU3m.js} +12 -12
  56. package/dist/{import-export.helper-CYJq22cJ.js → import-export.helper-DttYDeho.js} +6 -6
  57. package/dist/{index-Bs2DT0wF.js → index-BY8NVCx7.js} +1 -1
  58. package/dist/{index-B31v4NEs.js → index-DGxWBGVv.js} +1 -1
  59. package/dist/{index-D15BT7xz.js → index-tFtJuoxA.js} +3 -3
  60. package/dist/{inventory-core-dart.default-D4osjzlQ.js → inventory-core-dart.default-DIKTKc_1.js} +784 -667
  61. package/dist/{lz-string-BT82cfCK.js → lz-string-CwPU-SlY.js} +1 -1
  62. package/dist/{netsuite-ZHiikF8a.js → netsuite-B9XrL1RC.js} +2 -2
  63. package/dist/{number-C6NSIT1m.js → number-DKjrPhev.js} +3 -3
  64. package/dist/{predefined-templates-DT6cIOQR.js → predefined-templates-CQvQIvR-.js} +1 -1
  65. package/dist/{purchase-order-template-D50dAJ8R.js → purchase-order-template-NA3Qn9lf.js} +1 -1
  66. package/dist/{recalculationUtils-7X6ayoRM.js → recalculationUtils-Ll9Jy0C-.js} +1 -1
  67. package/dist/{rules-Z9cYF33Y.js → rules-DtBEn-Rn.js} +2 -2
  68. package/dist/{stock-DW2d568F.js → stock-PIkXqbIP.js} +1 -1
  69. package/dist/{supplier-suSJz_Tj.js → supplier-B5LWMrcL.js} +2 -2
  70. package/dist/{surcharge-CmFdExzO.js → surcharge-C8PXRjfJ.js} +1 -1
  71. package/dist/{uom-rules-C_FGDepb.js → uom-rules-DddX9wN4.js} +1 -1
  72. package/dist/{use-ingredient-select-dialog-DDPAb2_X.js → use-ingredient-select-dialog-DWQxhfQD.js} +2 -2
  73. package/dist/{use-inventory-binding-dialog-BNwhsOA9.js → use-inventory-binding-dialog-BWSMrzp1.js} +2 -2
  74. package/dist/{use-template-enabled-locations-Dm14AOSo.js → use-template-enabled-locations-3DN8aZBs.js} +2 -2
  75. package/dist/{use-transfer-locations-BzLayMl_.js → use-transfer-locations-DnybeRXF.js} +2 -2
  76. package/dist/{useHrmPermission-DG3KUc2c.js → useHrmPermission-ymQe-N7i.js} +1 -1
  77. package/dist/{useNavigationMenu-Dp-MvtBY.js → useNavigationMenu-D88-0QxA.js} +2 -2
  78. package/dist/{useSseClient-IEGNBVKr.js → useSseClient-CWNMcLEX.js} +3 -3
  79. package/dist/{vue-i18n-DsC8R5FR.js → vue-i18n-D7c0eqQP.js} +390 -390
  80. package/dist/{xlsx-QxeFuAXt.js → xlsx-DXHnJflt.js} +1 -1
  81. package/dist/{xlsx.util-CarycIPW.js → xlsx.util-PhY8wVQG.js} +3 -3
  82. package/package.json +4 -4
@@ -1,32 +1,32 @@
1
- import { ref as N, h as $e, defineComponent as J, resolveComponent as B, openBlock as k, createElementBlock as D, createElementVNode as i, normalizeClass as te, createTextVNode as ee, toDisplayString as A, unref as x, createCommentVNode as W, createVNode as R, withCtx as z, Fragment as H, renderList as q, computed as U, watch as Fe, createSlots as je, createBlock as K, normalizeStyle as Te, withModifiers as pe, isRef as Ye, Teleport as Ke, normalizeProps as We, guardReactiveProps as qe, mergeProps as Je } from "vue";
2
- import { u as Xe, _ as Qe } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js";
3
- import { useI18n as oe, useCoreStore as Ce } from "@feedmepos/mf-common";
4
- import { useDialog as _e, useDialogChild as Ze, useSnackbar as xe, FmButtonVariant as fe, components as et, useProxiedModel as tt, useBreakpoints as ot } from "@feedmepos/ui-library";
1
+ import { ref as N, h as $e, defineComponent as Q, resolveComponent as E, openBlock as k, createElementBlock as D, createElementVNode as i, normalizeClass as oe, createTextVNode as X, toDisplayString as A, unref as x, createCommentVNode as G, createVNode as R, withCtx as z, Fragment as O, renderList as J, computed as U, watch as Fe, createSlots as je, createBlock as K, createStaticVNode as Ye, normalizeStyle as Te, withModifiers as pe, isRef as Ke, Teleport as We, normalizeProps as qe, guardReactiveProps as Je, mergeProps as Xe } from "vue";
2
+ import { u as Qe, _ as Ze } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js";
3
+ import { useI18n as ne, useCoreStore as Ce } from "@feedmepos/mf-common";
4
+ import { useDialog as _e, useDialogChild as et, useSnackbar as xe, FmButtonVariant as fe, components as tt, useProxiedModel as ot, useBreakpoints as nt } from "@feedmepos/ui-library";
5
5
  import { defineStore as Be, storeToRefs as Ne } from "pinia";
6
- import { F as Z } from "./form-mode.enum-BKiNVH6A.js";
7
- import { a as we } from "./closing-template-C1Ag3g2s.js";
8
- import { u as Ie, c as Ue, a as De, l as nt } from "./app-DK2wDdRG.js";
9
- import { t as be, a as Se, d as Ae, s as Le, r as st } from "./xlsx.util-CarycIPW.js";
10
- import { F as at } from "./FmDroppableField-J0xUsOTV.js";
11
- import { f as Ve, a as ge } from "./date2-DdWkOefy.js";
6
+ import { F as te } from "./form-mode.enum-BKiNVH6A.js";
7
+ import { a as we } from "./closing-template-DBDqx2IR.js";
8
+ import { u as Ie, c as Ue, a as De, l as st } from "./app-DTBAhC9s.js";
9
+ import { t as be, a as Se, d as Ae, s as Le, r as at } from "./xlsx.util-PhY8wVQG.js";
10
+ import { F as lt } from "./FmDroppableField-J0xUsOTV.js";
11
+ import { f as Ve, a as ge } from "./date2-BD3_Vr8I.js";
12
12
  import { D as ye, R as Y } from "./row-action.enum-DQ9bJ_uv.js";
13
- import { c as lt } from "./component-kqxARxvM.js";
14
- import { f as rt } from "./format-time-from-id-BpRp_X3u.js";
15
- import { _ as it } from "./TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DvVDeHjR.js";
16
- import { u as ct } from "./netsuite-ZHiikF8a.js";
17
- import { u as ut } from "./duplicate-template-B0a9h4uA.js";
18
- import { _ as mt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DcM6xetz.js";
19
- import { R as dt, A as pt } from "./rules-Z9cYF33Y.js";
20
- import { u as ze } from "./use-ingredient-select-dialog-DDPAb2_X.js";
21
- import { d as ft } from "./defineDeepModel-DEeVL0NT.js";
22
- import { u as yt } from "./use-template-enabled-locations-Dm14AOSo.js";
23
- import { _ as vt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-BrK8u3nO.js";
24
- import { _ as gt, F as ve } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
25
- import { _ as bt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
+ import { c as rt } from "./component-kqxARxvM.js";
14
+ import { f as it } from "./format-time-from-id-CxJLjrBT.js";
15
+ import { _ as ct } from "./TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DsLOwuNG.js";
16
+ import { u as mt } from "./netsuite-B9XrL1RC.js";
17
+ import { u as dt } from "./duplicate-template-Dpb2sb-q.js";
18
+ import { _ as ut } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang--A4q92Mt.js";
19
+ import { R as pt, A as ft } from "./rules-DtBEn-Rn.js";
20
+ import { u as ze } from "./use-ingredient-select-dialog-DWQxhfQD.js";
21
+ import { d as yt } from "./defineDeepModel-BCBQ-V52.js";
22
+ import { u as vt } from "./use-template-enabled-locations-3DN8aZBs.js";
23
+ import { _ as gt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-g0AfgEFk.js";
24
+ import { _ as bt, F as ve } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
25
+ import { _ as ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
26
26
  const ke = Be(
27
27
  "closingTemplateTable",
28
28
  function() {
29
- const { t: o } = oe(), t = _e(), v = N({}), r = he(), f = N({}), g = N(new Array()), d = N(!1), a = Ie(), s = we();
29
+ const { t: o } = ne(), t = _e(), g = N({}), r = he(), f = N({}), b = N(new Array()), u = N(!1), a = Ie(), s = we();
30
30
  function w(l) {
31
31
  const n = {
32
32
  title: l.name,
@@ -35,35 +35,35 @@ const ke = Be(
35
35
  publishAll: async (y) => {
36
36
  const e = y || l.locations, _ = await s.publishSingleDoc(
37
37
  l._id,
38
- e == null ? void 0 : e.map((C) => C.dbName)
38
+ e == null ? void 0 : e.map((F) => F.dbName)
39
39
  );
40
- return v.value = _.publishedRevByLocation || {}, v.value;
40
+ return g.value = _.publishedRevByLocation || {}, g.value;
41
41
  },
42
42
  publishAtLocation: async (y) => {
43
43
  const e = await s.publishSingleDoc(l._id, [y.dbName]);
44
- return v.value = e.publishedRevByLocation || {}, v.value;
44
+ return g.value = e.publishedRevByLocation || {}, g.value;
45
45
  },
46
46
  unpublishAll: async (y) => {
47
47
  const e = y || l.locations, _ = await s.unpublishSingleDoc(
48
48
  l._id,
49
- e == null ? void 0 : e.map((C) => C.dbName)
49
+ e == null ? void 0 : e.map((F) => F.dbName)
50
50
  );
51
- return v.value = _.publishedRevByLocation || {}, v.value;
51
+ return g.value = _.publishedRevByLocation || {}, g.value;
52
52
  },
53
53
  unpublishAtLocation: async (y) => {
54
54
  const e = await s.unpublishSingleDoc(l._id, [
55
55
  y.dbName
56
56
  ]);
57
- return v.value = e.publishedRevByLocation || {}, v.value;
57
+ return g.value = e.publishedRevByLocation || {}, g.value;
58
58
  }
59
59
  },
60
- initialPublishedRev: v.value,
60
+ initialPublishedRev: g.value,
61
61
  locations: a.locations,
62
62
  enabledLocations: l.locations
63
63
  };
64
64
  t.open({
65
65
  title: "Publish template",
66
- contentComponent: it,
66
+ contentComponent: ct,
67
67
  contentComponentProps: n,
68
68
  closeButton: !0,
69
69
  minWidth: 700,
@@ -77,50 +77,50 @@ const ke = Be(
77
77
  });
78
78
  }
79
79
  async function p() {
80
- if (g.value = [], !!a._currentLocation) {
81
- d.value = !0;
80
+ if (b.value = [], !!a._currentLocation) {
81
+ u.value = !0;
82
82
  try {
83
83
  const [l, n, y] = await Promise.all([
84
84
  s.readTemplates(),
85
85
  s.getRecentPublishingJob(),
86
86
  s.getRecentPublishInfo()
87
87
  ]).delayed(1e3);
88
- g.value = l, f.value = n, v.value = y.publishedRevByLocation || {};
88
+ b.value = l, f.value = n, g.value = y.publishedRevByLocation || {};
89
89
  } catch (l) {
90
90
  console.log("Something went wrong when fetching templates:", l);
91
91
  } finally {
92
- d.value = !1;
92
+ u.value = !1;
93
93
  }
94
94
  }
95
95
  }
96
96
  async function I(l) {
97
- if (!g.value.find((n) => n._id) && a._currentLocation) {
98
- d.value = !0;
97
+ if (!b.value.find((n) => n._id) && a._currentLocation) {
98
+ u.value = !0;
99
99
  try {
100
100
  const [n] = await Promise.all([
101
101
  s.getTemplate(l),
102
102
  new Promise((y) => setTimeout(y, 1e3))
103
103
  ]);
104
- g.value = [n];
104
+ b.value = [n];
105
105
  } catch (n) {
106
106
  console.log("Something went wrong when fetching templates:", n);
107
107
  } finally {
108
- d.value = !1;
108
+ u.value = !1;
109
109
  }
110
110
  }
111
111
  }
112
- function F(l, n) {
112
+ function T(l, n) {
113
113
  switch (n = Ue(n), l) {
114
114
  case Y.Details:
115
115
  return r.viewTemplate(n);
116
116
  case Y.Edit:
117
117
  return r.updateTemplate(n);
118
118
  case Y.Delete:
119
- return r.deleteTemplate(n, d, p);
119
+ return r.deleteTemplate(n, u, p);
120
120
  case Y.Publish:
121
121
  return w(n);
122
122
  case Y.Duplicate:
123
- return r.duplicateTemplate(n, d, p);
123
+ return r.duplicateTemplate(n, u, p);
124
124
  }
125
125
  }
126
126
  return {
@@ -130,7 +130,7 @@ const ke = Be(
130
130
  accessorKey: "_id",
131
131
  header: () => o("inventory.closing.table.createdAt"),
132
132
  cell(l) {
133
- return rt(`${l.getValue()}`);
133
+ return it(`${l.getValue()}`);
134
134
  },
135
135
  enableSorting: !0
136
136
  },
@@ -178,9 +178,9 @@ const ke = Be(
178
178
  header: () => o("inventory.adjustment.template.table.status"),
179
179
  enableSorting: !1,
180
180
  cell(l) {
181
- const n = l.row.original, e = (l.row.original.locations || a.locations).filter((S) => !!a.locationByDbName[S.dbName]), _ = e.filter((S) => !!(v.value[S.dbName] || []).find(
181
+ const n = l.row.original, e = (l.row.original.locations || a.locations).filter((S) => !!a.locationByDbName[S.dbName]), _ = e.filter((S) => !!(g.value[S.dbName] || []).find(
182
182
  ($) => $._id === n._id && ($.updatedAt ? $.updatedAt === n.updatedAt : $._rev === n._rev)
183
- )).length, C = e.length > 0 && _ === e.length;
183
+ )).length, F = e.length > 0 && _ === e.length;
184
184
  return $e(
185
185
  "div",
186
186
  {
@@ -191,10 +191,10 @@ const ke = Be(
191
191
  {
192
192
  class: [
193
193
  "fm-status-badge",
194
- C ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
194
+ F ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
195
195
  ]
196
196
  },
197
- C ? "Published" : "Unpublished"
197
+ F ? "Published" : "Unpublished"
198
198
  )
199
199
  );
200
200
  }
@@ -208,7 +208,7 @@ const ke = Be(
208
208
  ye[Y.Delete],
209
209
  ye[Y.Publish]
210
210
  ];
211
- return lt(y, (e) => F(e, n));
211
+ return rt(y, (e) => T(e, n));
212
212
  },
213
213
  enableSorting: !1,
214
214
  size: 40,
@@ -219,8 +219,8 @@ const ke = Be(
219
219
  }
220
220
  ],
221
221
  recentPublish: f,
222
- templates: g,
223
- loading: d,
222
+ templates: b,
223
+ loading: u,
224
224
  fetchTemplates: p,
225
225
  loadTemplate: I
226
226
  };
@@ -242,7 +242,7 @@ function Ge(c) {
242
242
  }))
243
243
  ];
244
244
  }
245
- function He() {
245
+ function Oe() {
246
246
  return [
247
247
  {
248
248
  id: "code",
@@ -262,11 +262,11 @@ function He() {
262
262
  }
263
263
  ];
264
264
  }
265
- function ht(c) {
266
- var d;
267
- const t = Ce().currentBusiness.value, r = (d = c.map((a) => {
268
- var m;
269
- const s = a.items.flatMap(Ge), w = He(), p = [
265
+ function _t(c) {
266
+ var u;
267
+ const t = Ce().currentBusiness.value, r = (u = c.map((a) => {
268
+ var d;
269
+ const s = a.items.flatMap(Ge), w = Oe(), p = [
270
270
  ["Template ID", a._id],
271
271
  ["Template name", a.name],
272
272
  ["Business name", t == null ? void 0 : t.name],
@@ -274,14 +274,14 @@ function ht(c) {
274
274
  ["Menu version", t == null ? void 0 : t.menuVersion],
275
275
  [
276
276
  "Locations",
277
- ...(m = a.locations) != null && m.length ? a.locations.map((l) => `${l.name} (${l.dbName})`) : ["All"]
277
+ ...(d = a.locations) != null && d.length ? a.locations.map((l) => `${l.name} (${l.dbName})`) : ["All"]
278
278
  ],
279
279
  ["Reference", a.ref ?? ""],
280
280
  [],
281
281
  w.map((l) => l.name),
282
282
  ...s.map((l) => w.map((n) => l[n.id]))
283
- ], I = w.map((l) => `system:${l.id}`), F = be(p, I);
284
- return { name: a.name, sheet: F };
283
+ ], I = w.map((l) => `system:${l.id}`), T = be(p, I);
284
+ return { name: a.name, sheet: T };
285
285
  }).reduce(
286
286
  (a, s) => {
287
287
  var p;
@@ -292,17 +292,17 @@ function ht(c) {
292
292
  sheets: {},
293
293
  sheetOccurence: {}
294
294
  }
295
- )) == null ? void 0 : d.sheets, f = `${t == null ? void 0 : t.name} closing templates (${Ve(/* @__PURE__ */ new Date())}).xlsx`, g = Se(r);
296
- return Ae(g, f), f;
295
+ )) == null ? void 0 : u.sheets, f = `${t == null ? void 0 : t.name} closing templates (${Ve(/* @__PURE__ */ new Date())}).xlsx`, b = Se(r);
296
+ return Ae(b, f), f;
297
297
  }
298
- function _t(c) {
298
+ function xt(c) {
299
299
  Ce().currentBusiness.value;
300
- const t = 3, v = (p) => {
301
- const I = [], F = p.sku, m = new Set(p.disabledMeasurements || []);
302
- m.has(F.unit._id) || I.push(F.unit.abbrev);
303
- for (const l of F.unit.measurements) {
300
+ const t = 3, g = (p) => {
301
+ const I = [], T = p.sku, d = new Set(p.disabledMeasurements || []);
302
+ d.has(T.unit._id) || I.push(T.unit.abbrev);
303
+ for (const l of T.unit.measurements) {
304
304
  if (I.length >= t) break;
305
- m.has(l.id) || I.push(l.abbrev);
305
+ d.has(l.id) || I.push(l.abbrev);
306
306
  }
307
307
  return I;
308
308
  }, r = ["#", "Code", "Name", "UOM"], f = [
@@ -311,7 +311,7 @@ function _t(c) {
311
311
  [],
312
312
  r,
313
313
  ...c.items.map((p, I) => {
314
- const F = v(p);
314
+ const T = g(p);
315
315
  return [
316
316
  I + 1,
317
317
  // Index starting from 1
@@ -319,27 +319,27 @@ function _t(c) {
319
319
  p.sku.name,
320
320
  // Add UOM columns (up to MAX_UOM_COLUMNS)
321
321
  ...Array(t).fill("").map(
322
- (m, l) => F[l] ? `_____ ${F[l]}` : ""
322
+ (d, l) => T[l] ? `_____ ${T[l]}` : ""
323
323
  )
324
324
  ];
325
325
  })
326
- ], g = be(f, r);
327
- if (g["!ref"]) {
326
+ ], b = be(f, r);
327
+ if (b["!ref"]) {
328
328
  const p = {
329
329
  top: { style: "thin", color: { rgb: "000000" } },
330
330
  bottom: { style: "thin", color: { rgb: "000000" } },
331
331
  left: { style: "thin", color: { rgb: "000000" } },
332
332
  right: { style: "thin", color: { rgb: "000000" } }
333
- }, I = 4, F = I + c.items.length, m = r.map((l, n) => String.fromCharCode(65 + n));
334
- for (let l = I; l <= F; l++)
335
- m.forEach((n) => {
333
+ }, I = 4, T = I + c.items.length, d = r.map((l, n) => String.fromCharCode(65 + n));
334
+ for (let l = I; l <= T; l++)
335
+ d.forEach((n) => {
336
336
  const y = `${n}${l}`;
337
- g[y] || (g[y] = { t: "s", v: "" }), g[y].s = {
337
+ b[y] || (b[y] = { t: "s", v: "" }), b[y].s = {
338
338
  border: p
339
339
  };
340
340
  });
341
341
  }
342
- g["!cols"] = [
342
+ b["!cols"] = [
343
343
  { wch: 5 },
344
344
  // Index column - narrow
345
345
  { wch: 15 },
@@ -348,7 +348,7 @@ function _t(c) {
348
348
  // Name column - adjusted for more columns
349
349
  ...Array.from({ length: t }, () => ({ wch: 15 }))
350
350
  // UOM columns
351
- ], g["!margins"] = {
351
+ ], b["!margins"] = {
352
352
  left: 0.7,
353
353
  right: 0.7,
354
354
  top: 0.75,
@@ -356,11 +356,11 @@ function _t(c) {
356
356
  header: 0.3,
357
357
  footer: 0.3
358
358
  };
359
- const a = c.name.slice(0, 31), s = Se({ [a]: g }), w = `${c.name} - Closing Template (${Ve(/* @__PURE__ */ new Date())}).xlsx`;
359
+ const a = c.name.slice(0, 31), s = Se({ [a]: b }), w = `${c.name} - Closing Template (${Ve(/* @__PURE__ */ new Date())}).xlsx`;
360
360
  return Ae(s, w), w;
361
361
  }
362
- function xt() {
363
- const c = Ce(), o = De(), t = ct(), v = Ge({
362
+ function wt() {
363
+ const c = Ce(), o = De(), t = mt(), g = Ge({
364
364
  sku: {
365
365
  unit: {
366
366
  _id: "",
@@ -373,7 +373,7 @@ function xt() {
373
373
  _id: "",
374
374
  name: "Sugar"
375
375
  }
376
- })[0], r = c.currentBusiness.value, f = He(), g = [
376
+ })[0], r = c.currentBusiness.value, f = Oe(), b = [
377
377
  ["Template ID (leave empty to create new)", ""],
378
378
  ["Template Name", "New template"],
379
379
  ["Business name", r == null ? void 0 : r.name],
@@ -386,45 +386,45 @@ function xt() {
386
386
  ],
387
387
  ["Reference:"],
388
388
  [],
389
- f.map((m) => m.name),
390
- f.map((m) => v[m.id])
391
- ], d = f.map((m) => `system:${m.id}`), a = be(g, d), s = t.isEnabled ? t.state.setting.childItems ?? [] : [], w = s.reduce(
392
- (m, l) => {
393
- var C, S;
394
- const n = (C = t.netSuiteItemIdToSkuId.get(l.parentNetSuiteId)) == null ? void 0 : C[0], y = (S = t.netSuiteMeasurementIdToMeasurementId.get(
389
+ f.map((d) => d.name),
390
+ f.map((d) => g[d.id])
391
+ ], u = f.map((d) => `system:${d.id}`), a = be(b, u), s = t.isEnabled ? t.state.setting.childItems ?? [] : [], w = s.reduce(
392
+ (d, l) => {
393
+ var F, S;
394
+ const n = (F = t.netSuiteItemIdToSkuId.get(l.parentNetSuiteId)) == null ? void 0 : F[0], y = (S = t.netSuiteMeasurementIdToMeasurementId.get(
395
395
  l.unitOfMeasureId
396
396
  )) == null ? void 0 : S[0];
397
397
  if (!l.externalId)
398
- return m;
398
+ return d;
399
399
  if (!n)
400
- return console.error(`Item ${l.externalId} cannot be mapped to parent FdoInventorySku.`, l), m;
400
+ return console.error(`Item ${l.externalId} cannot be mapped to parent FdoInventorySku.`, l), d;
401
401
  const e = o.skuById[n], _ = e.unit.measurements.find((h) => h.id === y);
402
- return _ ? (m[l.externalId] = {
402
+ return _ ? (d[l.externalId] = {
403
403
  sku: e,
404
404
  measurement: _
405
- }, m) : (console.error(
405
+ }, d) : (console.error(
406
406
  `Item ${l.externalId} found parent FdoInventorySku of ${e.code} ${e.name} but the measurement of netsuite id ${l.unitOfMeasureId} cannot be found.`,
407
407
  l
408
- ), m);
408
+ ), d);
409
409
  },
410
410
  {}
411
411
  ), p = be(
412
412
  [
413
- ...o.skus.flatMap((m) => [
414
- [m.code, m.name, m.unit.abbrev, !0],
415
- ...m.unit.measurements.map((n) => [
413
+ ...o.skus.flatMap((d) => [
414
+ [d.code, d.name, d.unit.abbrev, !0],
415
+ ...d.unit.measurements.map((n) => [
416
416
  "",
417
417
  "",
418
418
  n.abbrev,
419
419
  !n.abbrev.toLocaleLowerCase("en-us").includes("inactive")
420
420
  ])
421
421
  ]),
422
- ...Object.entries(w).map(([m, { sku: l, measurement: n }]) => [
422
+ ...Object.entries(w).map(([d, { sku: l, measurement: n }]) => [
423
423
  l.code,
424
424
  l.name,
425
425
  n.abbrev,
426
426
  !n.abbrev.toLocaleLowerCase("en-us").includes("inactive"),
427
- m
427
+ d
428
428
  ])
429
429
  ],
430
430
  [
@@ -437,20 +437,20 @@ function xt() {
437
437
  ), I = Se({
438
438
  Template: a,
439
439
  Ingredients: p
440
- }), F = `${r == null ? void 0 : r.name} transfer templates import.xlsx`;
441
- return Ae(I, F), F;
440
+ }), T = `${r == null ? void 0 : r.name} transfer templates import.xlsx`;
441
+ return Ae(I, T), T;
442
442
  }
443
- function wt(c) {
443
+ function kt(c) {
444
444
  if (!c.length || `${c[0]}`.toLocaleLowerCase() === "all")
445
445
  return [];
446
- const o = /(.*) \(((warehouse_|restaurant_).{24,})\)/, v = Ie().locationByDbName;
446
+ const o = /(.*) \(((warehouse_|restaurant_).{24,})\)/, g = Ie().locationByDbName;
447
447
  return c.map((r) => {
448
- const f = new Array(), g = r.trim(), d = o.exec(g);
449
- if (!d)
450
- return f.push(`Enabled location value of ${g} cannot be read.`), {
448
+ const f = new Array(), b = r.trim(), u = o.exec(b);
449
+ if (!u)
450
+ return f.push(`Enabled location value of ${b} cannot be read.`), {
451
451
  errors: f
452
452
  };
453
- const a = d[1], s = d[2], w = v[s];
453
+ const a = u[1], s = u[2], w = g[s];
454
454
  return w ? (a !== w.name && f.push(
455
455
  `Location id ${s} has non-matching name. Found ${a} but expected ${w.name}`
456
456
  ), {
@@ -461,33 +461,33 @@ function wt(c) {
461
461
  });
462
462
  });
463
463
  }
464
- function kt(c) {
464
+ function $t(c) {
465
465
  const [
466
466
  o,
467
467
  t,
468
- v,
468
+ g,
469
469
  r,
470
470
  f,
471
- g,
472
- d,
471
+ b,
472
+ u,
473
473
  a
474
474
  ] = Le(c);
475
475
  return {
476
476
  id: `${t[1] ?? ""}`.trim(),
477
- name: `${v[1] ?? ""}`.trim(),
478
- locations: d.slice(1).map((s) => `${s}`.trim()).filter((s) => s),
477
+ name: `${g[1] ?? ""}`.trim(),
478
+ locations: u.slice(1).map((s) => `${s}`.trim()).filter((s) => s),
479
479
  reference: `${a[1] ?? ""}`.trim()
480
480
  };
481
481
  }
482
- function $t(c) {
482
+ function Tt(c) {
483
483
  const [
484
484
  o,
485
485
  t,
486
- v,
486
+ g,
487
487
  r,
488
488
  f,
489
- g,
490
- d,
489
+ b,
490
+ u,
491
491
  a,
492
492
  s,
493
493
  w,
@@ -495,16 +495,16 @@ function $t(c) {
495
495
  ] = Le(c);
496
496
  if (!o || !o.length || o.some((n) => n.length && !n.startsWith("system:")))
497
497
  throw new Error("Missing meta header. Excel file does not come from the template.");
498
- const I = o.map((n) => n.split(":")[1]), m = ["code", "name", "unit", "enabled"].filter((n) => !I.includes(n));
499
- if (m.length)
498
+ const I = o.map((n) => n.split(":")[1]), d = ["code", "name", "unit", "enabled"].filter((n) => !I.includes(n));
499
+ if (d.length)
500
500
  throw new Error(
501
- `Missing meta headers (${m.join()}). Excel file does not come from the template.`
501
+ `Missing meta headers (${d.join()}). Excel file does not come from the template.`
502
502
  );
503
503
  return p.map((n, y) => {
504
504
  const e = {};
505
505
  for (const _ in I) {
506
- const C = I[_];
507
- Object.assign(e, { [C]: n[_] });
506
+ const F = I[_];
507
+ Object.assign(e, { [F]: n[_] });
508
508
  }
509
509
  return {
510
510
  index: y,
@@ -512,26 +512,26 @@ function $t(c) {
512
512
  };
513
513
  });
514
514
  }
515
- function Tt(c) {
515
+ function Ft(c) {
516
516
  return c.reduce(
517
517
  (o, t) => {
518
518
  var f;
519
- const v = t.data, r = t.index;
520
- return v.unit && (v.code ? o.result.push({ parent: t, children: [] }) : o.result.length ? (f = o.result.at(-1)) == null || f.children.push(t) : o.errors.push(`Cannot find parent for row ${r + 9}`)), o;
519
+ const g = t.data, r = t.index;
520
+ return g.unit && (g.code ? o.result.push({ parent: t, children: [] }) : o.result.length ? (f = o.result.at(-1)) == null || f.children.push(t) : o.errors.push(`Cannot find parent for row ${r + 9}`)), o;
521
521
  },
522
522
  { result: new Array(), errors: new Array() }
523
523
  );
524
524
  }
525
- function Ft(c) {
525
+ function Ct(c) {
526
526
  const o = c.parent.data, t = new Array(), r = De().skuByCode[o.code ?? ""];
527
527
  if (!r)
528
528
  return t.push(`Cannot find ingredient of code ${o.code} ${o.name}`), { errors: t };
529
529
  const f = {
530
530
  sku: r
531
- }, g = /* @__PURE__ */ new Set([r.unit._id, ...r.unit.measurements.map((a) => a.id)]), d = r.unit.measurements.find((a) => a.abbrev === o.unit);
532
- o.unit !== r.unit.abbrev && !d ? t.push(
531
+ }, b = /* @__PURE__ */ new Set([r.unit._id, ...r.unit.measurements.map((a) => a.id)]), u = r.unit.measurements.find((a) => a.abbrev === o.unit);
532
+ o.unit !== r.unit.abbrev && !u ? t.push(
533
533
  `Cannot find measurement unit of ${o.unit} for (${o.code}) ${o.name}.`
534
- ) : (o.enabled === !0 || `${o.enabled}`.toLocaleLowerCase() === "true") && g.delete(r.unit._id);
534
+ ) : (o.enabled === !0 || `${o.enabled}`.toLocaleLowerCase() === "true") && b.delete(r.unit._id);
535
535
  for (const a of c.children) {
536
536
  const s = a.data, w = s.unit === r.unit.abbrev ? r.unit : void 0, p = r.unit.measurements.find((I) => I.abbrev === s.unit);
537
537
  if (!p && !w) {
@@ -540,43 +540,43 @@ function Ft(c) {
540
540
  );
541
541
  continue;
542
542
  }
543
- (s.enabled === !0 || `${s.enabled}`.toLocaleLowerCase() === "true") && g.delete((p == null ? void 0 : p.id) ?? (w == null ? void 0 : w._id) ?? "");
543
+ (s.enabled === !0 || `${s.enabled}`.toLocaleLowerCase() === "true") && b.delete((p == null ? void 0 : p.id) ?? (w == null ? void 0 : w._id) ?? "");
544
544
  }
545
- return g.has(r.unit._id) && f.sku.unit.measurements.every((a) => g.has(a.id)) && t.push(`Ingredient ${r.code} - ${r.name} must have at least one unit enabled.`), f.disabledMeasurements = [...g], { errors: t, templateItem: f };
545
+ return b.has(r.unit._id) && f.sku.unit.measurements.every((a) => b.has(a.id)) && t.push(`Ingredient ${r.code} - ${r.name} must have at least one unit enabled.`), f.disabledMeasurements = [...b], { errors: t, templateItem: f };
546
546
  }
547
- function Ct(c) {
547
+ function It(c) {
548
548
  const o = c.SheetNames.filter(
549
549
  (f) => !Object.values(Re).map(String).includes(f)
550
- ), v = ke().templates, r = nt(v, "_id");
550
+ ), g = ke().templates, r = st(g, "_id");
551
551
  try {
552
552
  return o.reduce(
553
- (f, g) => {
554
- const d = new Array(), a = c.Sheets[g], s = kt(a), w = wt(s.locations), p = w.filter((e) => e.location).map((e) => e.location);
555
- d.push(...w.flatMap((e) => e.errors));
556
- const I = $t(a).filter(
553
+ (f, b) => {
554
+ const u = new Array(), a = c.Sheets[b], s = $t(a), w = kt(s.locations), p = w.filter((e) => e.location).map((e) => e.location);
555
+ u.push(...w.flatMap((e) => e.errors));
556
+ const I = Tt(a).filter(
557
557
  (e) => e.data.code || e.data.unit
558
- ), F = Tt(I);
559
- d.push(...F.errors);
560
- const m = F.result.map(
561
- (e) => Ft(e)
558
+ ), T = Ft(I);
559
+ u.push(...T.errors);
560
+ const d = T.result.map(
561
+ (e) => Ct(e)
562
562
  );
563
- d.push(...m.flatMap((e) => e.errors));
564
- const l = m.filter((e) => e.templateItem).map((e) => e.templateItem);
563
+ u.push(...d.flatMap((e) => e.errors));
564
+ const l = d.filter((e) => e.templateItem).map((e) => e.templateItem);
565
565
  if (s.id) {
566
566
  const e = r[s.id];
567
567
  if (!e) {
568
- const C = {
568
+ const F = {
569
569
  _id: s.id,
570
570
  _rev: "",
571
- name: s.name || `(unnamed from sheet ${g || "<unnamed sheet>"})`,
571
+ name: s.name || `(unnamed from sheet ${b || "<unnamed sheet>"})`,
572
572
  items: []
573
573
  };
574
- return d.push(`Template ID ${s.id} is not found.`), f.importUpdateResult.push({
574
+ return u.push(`Template ID ${s.id} is not found.`), f.importUpdateResult.push({
575
575
  type: "update",
576
- original: C,
577
- template: C,
578
- excelSheetName: g,
579
- errors: d
576
+ original: F,
577
+ template: F,
578
+ excelSheetName: b,
579
+ errors: u
580
580
  }), f;
581
581
  }
582
582
  const _ = {
@@ -589,8 +589,8 @@ function Ct(c) {
589
589
  ref: s.reference,
590
590
  items: l
591
591
  },
592
- excelSheetName: g,
593
- errors: d
592
+ excelSheetName: b,
593
+ errors: u
594
594
  };
595
595
  return f.importUpdateResult.push(_), f;
596
596
  }
@@ -602,8 +602,8 @@ function Ct(c) {
602
602
  ref: s.reference,
603
603
  items: l
604
604
  },
605
- excelSheetName: g,
606
- errors: d
605
+ excelSheetName: b,
606
+ errors: u
607
607
  };
608
608
  return f.importCreateResult.push(y), f;
609
609
  },
@@ -622,10 +622,10 @@ function Ct(c) {
622
622
  };
623
623
  }
624
624
  }
625
- const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-col" }, St = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, At = {
625
+ const Dt = { class: "flex items-center gap-12 pl-8" }, St = { class: "flex flex-col" }, At = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Rt = {
626
626
  key: 0,
627
627
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
628
- }, Rt = { key: 0 }, Ee = /* @__PURE__ */ J({
628
+ }, Pt = { key: 0 }, Ee = /* @__PURE__ */ Q({
629
629
  __name: "ClosingTemplateImportItem",
630
630
  props: {
631
631
  type: {},
@@ -635,27 +635,27 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
635
635
  errors: {}
636
636
  },
637
637
  setup(c) {
638
- const { t: o } = oe();
639
- return (t, v) => {
640
- var g, d, a;
641
- const r = B("FmIcon"), f = B("FmTooltip");
642
- return k(), D("div", It, [
643
- v[0] || (v[0] = i("div", null, "•", -1)),
644
- i("div", Dt, [
645
- i("div", St, [
638
+ const { t: o } = ne();
639
+ return (t, g) => {
640
+ var b, u, a;
641
+ const r = E("FmIcon"), f = E("FmTooltip");
642
+ return k(), D("div", Dt, [
643
+ g[0] || (g[0] = i("div", null, "•", -1)),
644
+ i("div", St, [
645
+ i("div", At, [
646
646
  i("div", {
647
- class: te({
647
+ class: oe({
648
648
  "text-fm-color-system-error-300": t.errors.length
649
649
  })
650
650
  }, [
651
- ee(A(t.name) + " ", 1),
652
- t.type === "create" ? (k(), D("span", At, "(" + A(x(o)("inventory.closing.template.import.new")) + ")", 1)) : W("", !0)
651
+ X(A(t.name) + " ", 1),
652
+ t.type === "create" ? (k(), D("span", Rt, "(" + A(x(o)("inventory.closing.template.import.new")) + ")", 1)) : G("", !0)
653
653
  ], 2),
654
- t.errors.length ? (k(), D("div", Rt, [
654
+ t.errors.length ? (k(), D("div", Pt, [
655
655
  R(f, { "z-index": 50 }, {
656
656
  content: z(() => [
657
657
  i("ol", null, [
658
- (k(!0), D(H, null, q(t.errors, (s, w) => (k(), D("li", { key: w }, A(s), 1))), 128))
658
+ (k(!0), D(O, null, J(t.errors, (s, w) => (k(), D("li", { key: w }, A(s), 1))), 128))
659
659
  ])
660
660
  ]),
661
661
  default: z(() => [
@@ -667,112 +667,112 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
667
667
  ]),
668
668
  _: 1
669
669
  })
670
- ])) : W("", !0)
670
+ ])) : G("", !0)
671
671
  ]),
672
672
  i("div", {
673
- class: te([
673
+ class: oe([
674
674
  "fm-typo-en-body-sm-400",
675
675
  {
676
676
  "text-fm-color-system-error-200": t.errors.length,
677
677
  "text-fm-color-typo-secondary": !t.errors.length
678
678
  }
679
679
  ])
680
- }, A((g = t.locations) != null && g.length ? x(o)("inventory.closing.template.import.nLocations", { count: (d = t.locations) == null ? void 0 : d.length }) : x(o)("inventory.closing.template.import.allLocations")) + ", " + A(x(o)("inventory.closing.template.import.nItems", { count: (a = t.items) == null ? void 0 : a.length })), 3)
680
+ }, A((b = t.locations) != null && b.length ? x(o)("inventory.closing.template.import.nLocations", { count: (u = t.locations) == null ? void 0 : u.length }) : x(o)("inventory.closing.template.import.allLocations")) + ", " + A(x(o)("inventory.closing.template.import.nItems", { count: (a = t.items) == null ? void 0 : a.length })), 3)
681
681
  ])
682
682
  ]);
683
683
  };
684
684
  }
685
- }), Pt = { class: "flex flex-col gap-24" }, Mt = { class: "fm-typo-en-body-md-400" }, Et = {
685
+ }), Mt = { class: "flex flex-col gap-24" }, Et = { class: "fm-typo-en-body-md-400" }, Bt = {
686
686
  key: 0,
687
687
  class: "flex items-center gap-8"
688
- }, Bt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Nt = { class: "flex flex-col gap-8" }, Ut = { class: "line-clamp-2 text-ellipsis break-all" }, Lt = {
688
+ }, Nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ut = { class: "flex flex-col gap-8" }, Lt = { class: "line-clamp-2 text-ellipsis break-all" }, Vt = {
689
689
  key: 2,
690
690
  class: "shrink-0"
691
- }, Vt = {
691
+ }, zt = {
692
692
  key: 0,
693
693
  class: "flex flex-col"
694
- }, zt = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Gt = {
694
+ }, Gt = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Ot = {
695
695
  key: 0,
696
696
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
697
- }, Ht = { class: "fm-typo-en-body-lg-600" }, Ot = /* @__PURE__ */ J({
697
+ }, Ht = { class: "fm-typo-en-body-lg-600" }, jt = /* @__PURE__ */ Q({
698
698
  __name: "ClosingTemplateImport",
699
699
  setup(c) {
700
- const o = N(null), t = Ze(), v = xe(), r = N(!1), f = N(!1), g = N(new Array()), d = N([]), a = N([]), s = U(
701
- () => !!g.value.length || d.value.some((F) => F.errors.length) || a.value.some((F) => F.errors.length)
700
+ const o = N(null), t = et(), g = xe(), r = N(!1), f = N(!1), b = N(new Array()), u = N([]), a = N([]), s = U(
701
+ () => !!b.value.length || u.value.some((T) => T.errors.length) || a.value.some((T) => T.errors.length)
702
702
  ), w = U(
703
- () => !!d.value.length || !!a.value.length
704
- ), { t: p } = oe();
705
- async function I(F) {
706
- g.value = [], d.value = [], a.value = [];
703
+ () => !!u.value.length || !!a.value.length
704
+ ), { t: p } = ne();
705
+ async function I(T) {
706
+ b.value = [], u.value = [], a.value = [];
707
707
  try {
708
708
  r.value = !0;
709
- const [m] = await Promise.all([
710
- st(F),
709
+ const [d] = await Promise.all([
710
+ at(T),
711
711
  // fake buffer
712
712
  new Promise((e) => setTimeout(e, 1e3))
713
713
  ]);
714
- if (!m.SheetNames.filter(
714
+ if (!d.SheetNames.filter(
715
715
  (e) => !Object.values(Re).map(String).includes(e)
716
716
  ).find((e) => e)) {
717
- g.value.push(p("inventory.ingredient.import.fileError.noSheet"));
717
+ b.value.push(p("inventory.ingredient.import.fileError.noSheet"));
718
718
  return;
719
719
  }
720
- const y = Ct(m);
720
+ const y = It(d);
721
721
  if (y.invalidExcel) {
722
- g.value.push(
722
+ b.value.push(
723
723
  y.invalidExcelMessage ?? p("inventory.ingredient.import.fileError.invalidExcel")
724
724
  );
725
725
  return;
726
726
  }
727
- if (d.value = y.importCreateResult, a.value = y.importUpdateResult, !d.value.length && !a.value.length) {
728
- g.value.push(p("inventory.ingredient.import.fileError.noData"));
727
+ if (u.value = y.importCreateResult, a.value = y.importUpdateResult, !u.value.length && !a.value.length) {
728
+ b.value.push(p("inventory.ingredient.import.fileError.noData"));
729
729
  return;
730
730
  }
731
731
  t.emitData(y);
732
- } catch (m) {
733
- v.open({
732
+ } catch (d) {
733
+ g.open({
734
734
  title: p("inventory.ingredient.import.fileError.unableToRead"),
735
- message: m == null ? void 0 : m.message,
735
+ message: d == null ? void 0 : d.message,
736
736
  type: "error"
737
- }), console.error("Error in reading file", m);
737
+ }), console.error("Error in reading file", d);
738
738
  } finally {
739
- g.value.length && v.open({
739
+ b.value.length && g.open({
740
740
  title: p("inventory.ingredient.import.fileError.invalidExcel"),
741
741
  type: "error"
742
742
  }), r.value = !1;
743
743
  }
744
744
  }
745
- return Fe(o, (F) => {
746
- F && I(F);
747
- }), (F, m) => {
748
- const l = B("FmCircularProgress"), n = B("FmIcon"), y = B("FmButton");
749
- return k(), D("div", Pt, [
750
- i("div", Mt, A(x(p)("inventory.closing.template.import.message")), 1),
751
- f.value ? (k(), D("div", Et, [
745
+ return Fe(o, (T) => {
746
+ T && I(T);
747
+ }), (T, d) => {
748
+ const l = E("FmCircularProgress"), n = E("FmIcon"), y = E("FmButton");
749
+ return k(), D("div", Mt, [
750
+ i("div", Et, A(x(p)("inventory.closing.template.import.message")), 1),
751
+ f.value ? (k(), D("div", Bt, [
752
752
  i("div", null, [
753
753
  R(l, {
754
754
  size: "md",
755
755
  color: "neutral-gray-200"
756
756
  })
757
757
  ]),
758
- i("div", Bt, A(x(p)("inventory.formField.loading")), 1)
759
- ])) : (k(), D(H, { key: 1 }, [
760
- R(at, {
761
- class: te({
758
+ i("div", Nt, A(x(p)("inventory.formField.loading")), 1)
759
+ ])) : (k(), D(O, { key: 1 }, [
760
+ R(lt, {
761
+ class: oe({
762
762
  "w-full": !0,
763
763
  "h-[200px]": !o.value
764
764
  }),
765
765
  accept: ".xlsx",
766
- onFileUpload: m[0] || (m[0] = (e) => o.value = e),
766
+ onFileUpload: d[0] || (d[0] = (e) => o.value = e),
767
767
  label: x(p)("inventory.ingredient.import.uploadTemplate"),
768
768
  "button-label": x(p)("inventory.ingredient.import.selectFile")
769
769
  }, je({ _: 2 }, [
770
770
  o.value ? {
771
771
  name: "default",
772
772
  fn: z(({ openFileDialog: e }) => [
773
- i("div", Nt, [
773
+ i("div", Ut, [
774
774
  i("div", {
775
- class: te([
775
+ class: oe([
776
776
  "fm-corner-radius-md p-16 flex items-center gap-16",
777
777
  {
778
778
  "border border-fm-color-neutral-gray-100": r.value,
@@ -792,7 +792,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
792
792
  color: s.value ? "system-error-300" : void 0
793
793
  }, null, 8, ["name", "color"])),
794
794
  i("div", {
795
- class: te([
795
+ class: oe([
796
796
  "fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
797
797
  {
798
798
  "text-fm-color-typo-disabled": r.value,
@@ -800,9 +800,9 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
800
800
  }
801
801
  ])
802
802
  }, [
803
- i("div", Ut, A(o.value.name), 1)
803
+ i("div", Lt, A(o.value.name), 1)
804
804
  ], 2),
805
- r.value ? W("", !0) : (k(), D("div", Lt, [
805
+ r.value ? G("", !0) : (k(), D("div", Vt, [
806
806
  R(y, {
807
807
  label: x(p)("inventory.ingredient.import.replaceFile"),
808
808
  variant: s.value ? "destructive" : "secondary",
@@ -811,9 +811,9 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
811
811
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
812
812
  ]))
813
813
  ], 2),
814
- g.value.length ? (k(), D("div", Vt, [
815
- (k(!0), D(H, null, q(g.value, (_, C) => (k(), D("div", {
816
- key: C,
814
+ b.value.length ? (k(), D("div", zt, [
815
+ (k(!0), D(O, null, J(b.value, (_, F) => (k(), D("div", {
816
+ key: F,
817
817
  class: "flex gap-8 items-center"
818
818
  }, [
819
819
  R(n, {
@@ -821,17 +821,17 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
821
821
  size: "sm",
822
822
  color: "system-error-300"
823
823
  }),
824
- i("div", zt, A(_), 1)
824
+ i("div", Gt, A(_), 1)
825
825
  ]))), 128))
826
- ])) : W("", !0)
826
+ ])) : G("", !0)
827
827
  ])
828
828
  ]),
829
829
  key: "0"
830
830
  } : void 0
831
831
  ]), 1032, ["class", "label", "button-label"]),
832
- w.value ? (k(), D("div", Gt, [
832
+ w.value ? (k(), D("div", Ot, [
833
833
  i("div", Ht, A(x(p)("inventory.ingredient.import.summary")), 1),
834
- (k(!0), D(H, null, q(d.value, (e, _) => (k(), K(Ee, {
834
+ (k(!0), D(O, null, J(u.value, (e, _) => (k(), K(Ee, {
835
835
  key: _,
836
836
  name: e.template.name,
837
837
  locations: e.template.locations,
@@ -839,7 +839,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
839
839
  errors: e.errors,
840
840
  type: "create"
841
841
  }, null, 8, ["name", "locations", "items", "errors"]))), 128)),
842
- (k(!0), D(H, null, q(a.value, (e) => (k(), K(Ee, {
842
+ (k(!0), D(O, null, J(a.value, (e) => (k(), K(Ee, {
843
843
  key: e.template._id,
844
844
  name: e.template.name,
845
845
  locations: e.template.locations,
@@ -847,33 +847,33 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
847
847
  errors: e.errors,
848
848
  type: "update"
849
849
  }, null, 8, ["name", "locations", "items", "errors"]))), 128))
850
- ])) : W("", !0)
850
+ ])) : G("", !0)
851
851
  ], 64))
852
852
  ]);
853
853
  };
854
854
  }
855
855
  }), he = Be("closingTemplateActions", () => {
856
- const { t: c } = oe(), o = _e(), t = xe(), v = we(), r = ut(), f = ke(), { loading: g } = Ne(f), d = N({});
856
+ const { t: c } = ne(), o = _e(), t = xe(), g = we(), r = dt(), f = ke(), { loading: b } = Ne(f), u = N({});
857
857
  function a() {
858
- d.value = {
859
- mode: Z.CREATE,
858
+ u.value = {
859
+ mode: te.CREATE,
860
860
  show: !0,
861
861
  "onUpdate:show"(e) {
862
- d.value.show = e;
862
+ u.value.show = e;
863
863
  }
864
864
  };
865
865
  }
866
866
  function s(e) {
867
- d.value = {
868
- mode: Z.UPDATE,
867
+ u.value = {
868
+ mode: te.UPDATE,
869
869
  modelValue: e,
870
870
  show: !0,
871
871
  "onUpdate:show"(_) {
872
- d.value.show = _;
872
+ u.value.show = _;
873
873
  }
874
874
  };
875
875
  }
876
- function w(e, _, C) {
876
+ function w(e, _, F) {
877
877
  o.open({
878
878
  title: `Confirm deleting template ${e.name}?`,
879
879
  message: "Deleted template can no longer be retrieved",
@@ -895,7 +895,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
895
895
  try {
896
896
  _.value = !0;
897
897
  const [S] = await Promise.allSettled([
898
- v.deleteTemplate(e),
898
+ g.deleteTemplate(e),
899
899
  new Promise((h) => setTimeout(h, 1e3))
900
900
  ]);
901
901
  if (S.status === "rejected") throw S.reason;
@@ -910,11 +910,11 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
910
910
  type: "error"
911
911
  });
912
912
  } finally {
913
- _.value = !1, C();
913
+ _.value = !1, F();
914
914
  }
915
915
  });
916
916
  }
917
- function p(e, _, C) {
917
+ function p(e, _, F) {
918
918
  let S;
919
919
  o.open({
920
920
  title: `Confirm duplicating template "${e.name}"?`,
@@ -929,11 +929,11 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
929
929
  variant: fe.Plain,
930
930
  close: !0
931
931
  },
932
- contentComponent: J({
932
+ contentComponent: Q({
933
933
  props: ["modelValue"],
934
934
  emits: ["update:modelValue"],
935
935
  setup(h) {
936
- return () => $e(et.FmTextField, {
936
+ return () => $e(tt.FmTextField, {
937
937
  modelValue: h.modelValue,
938
938
  "onUpdate:modelValue": ($) => S = $,
939
939
  label: "New Template Name",
@@ -965,12 +965,12 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
965
965
  type: "error"
966
966
  }), console.error("error on duplicating closing template", h);
967
967
  } finally {
968
- _.value = !1, C();
968
+ _.value = !1, F();
969
969
  }
970
970
  });
971
971
  }
972
972
  const I = N({});
973
- function F(e) {
973
+ function T(e) {
974
974
  I.value = {
975
975
  template: e,
976
976
  show: !0,
@@ -982,7 +982,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
982
982
  }
983
983
  };
984
984
  }
985
- function m() {
985
+ function d() {
986
986
  if (!f.templates.length) {
987
987
  t.open({
988
988
  title: "No data to export",
@@ -990,7 +990,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
990
990
  });
991
991
  return;
992
992
  }
993
- const e = ht(f.templates);
993
+ const e = _t(f.templates);
994
994
  t.open({
995
995
  title: c("inventory.ingredient.export.success"),
996
996
  message: c("inventory.ingredient.export.filename", [e]),
@@ -1005,7 +1005,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
1005
1005
  });
1006
1006
  return;
1007
1007
  }
1008
- const _ = _t(e);
1008
+ const _ = xt(e);
1009
1009
  t.open({
1010
1010
  title: c("inventory.ingredient.export.success"),
1011
1011
  message: c("inventory.ingredient.export.filename", [_]),
@@ -1015,7 +1015,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
1015
1015
  function n() {
1016
1016
  f.loading || o.open({
1017
1017
  title: c("inventory.ingredient.import.title"),
1018
- contentComponent: Ot,
1018
+ contentComponent: jt,
1019
1019
  overlay: !0,
1020
1020
  closeButton: !0,
1021
1021
  primaryActions: {
@@ -1056,10 +1056,10 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
1056
1056
  return;
1057
1057
  }
1058
1058
  o.close(), y(e);
1059
- }).onTertiary(xt);
1059
+ }).onTertiary(wt);
1060
1060
  }
1061
1061
  async function y(e) {
1062
- g.value = !0;
1062
+ b.value = !0;
1063
1063
  try {
1064
1064
  const _ = [
1065
1065
  ...e.importCreateResult.map(
@@ -1068,10 +1068,10 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
1068
1068
  ...e.importUpdateResult.map(
1069
1069
  ($) => $.template
1070
1070
  )
1071
- ], C = 100;
1071
+ ], F = 100;
1072
1072
  let S = 0;
1073
1073
  const h = () => {
1074
- S += C, t.open({
1074
+ S += F, t.open({
1075
1075
  title: c("inventory.ingredient.import.progress", [
1076
1076
  Math.min(S, _.length),
1077
1077
  _.length
@@ -1079,7 +1079,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
1079
1079
  });
1080
1080
  };
1081
1081
  for (const $ of _.chunk(100))
1082
- h(), await v.importTemplates($);
1082
+ h(), await g.importTemplates($);
1083
1083
  t.open({
1084
1084
  title: c("inventory.ingredient.import.success"),
1085
1085
  type: "success"
@@ -1091,23 +1091,23 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
1091
1091
  type: "error"
1092
1092
  }), console.error("Error in importing skus", e, _);
1093
1093
  } finally {
1094
- g.value = !1, f.fetchTemplates();
1094
+ b.value = !1, f.fetchTemplates();
1095
1095
  }
1096
1096
  }
1097
1097
  return {
1098
1098
  createTemplate: a,
1099
- viewTemplate: F,
1099
+ viewTemplate: T,
1100
1100
  updateTemplate: s,
1101
1101
  deleteTemplate: w,
1102
1102
  duplicateTemplate: p,
1103
- exportTemplates: m,
1103
+ exportTemplates: d,
1104
1104
  exportSingleTemplate: l,
1105
1105
  importTemplates: n,
1106
- templateDialogProps: d,
1106
+ templateDialogProps: u,
1107
1107
  templateDetailsProps: I
1108
1108
  };
1109
1109
  });
1110
- function jt(c) {
1110
+ function Yt(c) {
1111
1111
  return c ? Number(c.amount) / Math.pow(10, Number(c.precision) || 0) : 0;
1112
1112
  }
1113
1113
  function Pe(c) {
@@ -1120,55 +1120,55 @@ function Pe(c) {
1120
1120
  enabled: !o.has(c.sku.unit._id)
1121
1121
  }
1122
1122
  ];
1123
- for (const v of c.sku.unit.measurements)
1123
+ for (const g of c.sku.unit.measurements)
1124
1124
  t.push({
1125
- id: v.id,
1126
- label: v.abbrev,
1125
+ id: g.id,
1126
+ label: g.abbrev,
1127
1127
  isBase: !1,
1128
- factor: jt(v.conversion),
1129
- enabled: !o.has(v.id)
1128
+ factor: Yt(g.conversion),
1129
+ enabled: !o.has(g.id)
1130
1130
  });
1131
1131
  return t;
1132
1132
  }
1133
- function Yt(c) {
1133
+ function Kt(c) {
1134
1134
  return Pe(c).filter((o) => o.enabled).length;
1135
1135
  }
1136
- function Kt(c) {
1136
+ function Wt(c) {
1137
1137
  return Pe(c).filter((o) => o.enabled).map((o) => !o.isBase && o.factor ? `${o.label} ×${o.factor}` : o.label);
1138
1138
  }
1139
- function Wt(c, o) {
1139
+ function qt(c, o) {
1140
1140
  const t = new Set(c.disabledMeasurements ?? []);
1141
1141
  if (o.enabled) {
1142
- if (Yt(c) <= 1) return null;
1142
+ if (Kt(c) <= 1) return null;
1143
1143
  t.add(o.id);
1144
1144
  } else
1145
1145
  t.delete(o.id);
1146
1146
  return { ...c, disabledMeasurements: [...t] };
1147
1147
  }
1148
- const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1148
+ const Jt = { class: "flex items-center gap-12 py-12" }, Xt = {
1149
1149
  class: "flex items-center justify-center shrink-0 rounded-md border border-fm-color-neutral-gray-300 fm-typo-en-body-sm-600 text-fm-color-typo-secondary",
1150
1150
  style: { width: "28px", height: "28px" }
1151
- }, Xt = {
1151
+ }, Qt = {
1152
1152
  class: "flex flex-col gap-2 shrink-0",
1153
1153
  style: { width: "280px" }
1154
- }, Qt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border border-fm-color-neutral-gray-200 rounded px-8 py-1 self-start" }, Zt = {
1154
+ }, Zt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border border-fm-color-neutral-gray-200 rounded px-8 py-1 self-start" }, eo = {
1155
1155
  class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary",
1156
1156
  style: { "word-break": "break-word", "line-height": "1.2" }
1157
- }, eo = {
1157
+ }, to = {
1158
1158
  class: "flex-1 flex flex-wrap items-center",
1159
1159
  style: { gap: "6px" }
1160
- }, to = {
1160
+ }, oo = {
1161
1161
  key: 0,
1162
1162
  class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-200 rounded",
1163
1163
  style: { padding: "0 6px" }
1164
- }, oo = {
1164
+ }, no = {
1165
1165
  key: 1,
1166
1166
  class: "fm-typo-en-body-sm-400 text-fm-color-primary",
1167
1167
  style: { opacity: "0.7" }
1168
- }, no = {
1168
+ }, so = {
1169
1169
  class: "shrink-0 flex items-center justify-end gap-4",
1170
1170
  style: { width: "200px" }
1171
- }, so = /* @__PURE__ */ J({
1171
+ }, ao = /* @__PURE__ */ Q({
1172
1172
  __name: "ClosingTemplateItem",
1173
1173
  props: {
1174
1174
  item: {},
@@ -1177,58 +1177,58 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1177
1177
  },
1178
1178
  emits: ["update", "delete"],
1179
1179
  setup(c, { emit: o }) {
1180
- const t = c, v = o, r = U(() => Pe(t.item)), f = U(() => r.value.filter((s) => s.enabled)), g = U(() => f.value.length);
1181
- function d(s) {
1180
+ const t = c, g = o, r = U(() => Pe(t.item)), f = U(() => r.value.filter((s) => s.enabled)), b = U(() => f.value.length);
1181
+ function u(s) {
1182
1182
  if (t.disabled) return;
1183
- const w = Wt(t.item, s);
1184
- w && v("update", w);
1183
+ const w = qt(t.item, s);
1184
+ w && g("update", w);
1185
1185
  }
1186
1186
  function a(s) {
1187
1187
  return s.isBase ? "Base unit" : s.factor ? `1 ${s.label} = ${s.factor} ${t.item.sku.unit.abbrev}` : "";
1188
1188
  }
1189
1189
  return (s, w) => {
1190
- const p = B("FmButton"), I = B("FmMenuItem"), F = B("FmMenu");
1191
- return k(), D("div", qt, [
1192
- i("span", Jt, A(s.index + 1), 1),
1193
- i("div", Xt, [
1194
- i("span", Qt, A(s.item.sku.code), 1),
1195
- i("div", Zt, A(s.item.sku.name), 1)
1190
+ const p = E("FmButton"), I = E("FmMenuItem"), T = E("FmMenu");
1191
+ return k(), D("div", Jt, [
1192
+ i("span", Xt, A(s.index + 1), 1),
1193
+ i("div", Qt, [
1194
+ i("span", Zt, A(s.item.sku.code), 1),
1195
+ i("div", eo, A(s.item.sku.name), 1)
1196
1196
  ]),
1197
- i("div", eo, [
1198
- (k(!0), D(H, null, q(f.value, (m) => (k(), D("span", {
1199
- key: m.id,
1200
- class: te([
1197
+ i("div", to, [
1198
+ (k(!0), D(O, null, J(f.value, (d) => (k(), D("span", {
1199
+ key: d.id,
1200
+ class: oe([
1201
1201
  "flex items-center rounded-full border",
1202
- m.isBase ? "border-fm-color-neutral-gray-300 bg-fm-color-neutral-gray-100" : "border-fm-color-primary bg-fm-color-system-warning-100"
1202
+ d.isBase ? "border-fm-color-neutral-gray-300 bg-fm-color-neutral-gray-100" : "border-fm-color-primary bg-fm-color-system-warning-100"
1203
1203
  ]),
1204
1204
  style: { gap: "6px", padding: "4px 12px" }
1205
1205
  }, [
1206
1206
  i("span", {
1207
- class: te(["fm-typo-en-body-sm-600 whitespace-nowrap", m.isBase ? "text-fm-color-typo-primary" : "text-fm-color-primary"])
1208
- }, A(m.label), 3),
1209
- m.isBase ? (k(), D("span", to, " BASE ")) : m.factor ? (k(), D("span", oo, " ×" + A(m.factor), 1)) : W("", !0)
1207
+ class: oe(["fm-typo-en-body-sm-600 whitespace-nowrap", d.isBase ? "text-fm-color-typo-primary" : "text-fm-color-primary"])
1208
+ }, A(d.label), 3),
1209
+ d.isBase ? (k(), D("span", oo, " BASE ")) : d.factor ? (k(), D("span", no, " ×" + A(d.factor), 1)) : G("", !0)
1210
1210
  ], 2))), 128))
1211
1211
  ]),
1212
- i("div", no, [
1213
- R(F, { "close-on-click": !1 }, {
1212
+ i("div", so, [
1213
+ R(T, { "close-on-click": !1 }, {
1214
1214
  "menu-button": z(() => [
1215
1215
  R(p, {
1216
1216
  variant: "secondary",
1217
1217
  "prepend-icon": "tune",
1218
1218
  size: "md",
1219
1219
  disabled: s.disabled,
1220
- label: `Units ${g.value}/${r.value.length}`
1220
+ label: `Units ${b.value}/${r.value.length}`
1221
1221
  }, null, 8, ["disabled", "label"])
1222
1222
  ]),
1223
1223
  default: z(() => [
1224
- (k(!0), D(H, null, q(r.value, (m) => (k(), K(I, {
1225
- key: m.id,
1226
- "model-value": m.enabled,
1224
+ (k(!0), D(O, null, J(r.value, (d) => (k(), K(I, {
1225
+ key: d.id,
1226
+ "model-value": d.enabled,
1227
1227
  "has-checkbox": "",
1228
- label: m.label,
1229
- sublabel: a(m),
1230
- disabled: s.disabled || m.enabled && g.value === 1,
1231
- onClick: (l) => d(m)
1228
+ label: d.label,
1229
+ sublabel: a(d),
1230
+ disabled: s.disabled || d.enabled && b.value === 1,
1231
+ onClick: (l) => u(d)
1232
1232
  }, null, 8, ["model-value", "label", "sublabel", "disabled", "onClick"]))), 128))
1233
1233
  ]),
1234
1234
  _: 1
@@ -1238,45 +1238,48 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1238
1238
  icon: "delete",
1239
1239
  variant: "tertiary",
1240
1240
  size: "md",
1241
- onClick: w[0] || (w[0] = (m) => v("delete"))
1241
+ onClick: w[0] || (w[0] = (d) => g("delete"))
1242
1242
  }, null, 8, ["disabled"])
1243
1243
  ])
1244
1244
  ]);
1245
1245
  };
1246
1246
  }
1247
- }), ao = { class: "flex flex-col gap-12" }, lo = { class: "flex items-start justify-between gap-8" }, ro = { class: "flex flex-col" }, io = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, co = { class: "flex gap-8 shrink-0" }, uo = { class: "flex flex-wrap items-center gap-8" }, mo = ["onClick"], po = { class: "fm-typo-en-body-md-600 whitespace-nowrap" }, fo = ["disabled"], yo = { class: "rounded-lg border border-fm-color-neutral-gray-200 overflow-hidden" }, vo = { class: "flex items-center gap-12 px-16 py-12 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-50" }, go = {
1247
+ }), lo = { class: "flex flex-col gap-12" }, ro = { class: "flex items-start justify-between gap-8" }, io = { class: "flex flex-col" }, co = { class: "flex items-center gap-8" }, mo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, uo = { class: "flex gap-8 shrink-0" }, po = { class: "flex flex-wrap items-center gap-8" }, fo = ["onClick"], yo = { class: "fm-typo-en-body-md-600 whitespace-nowrap" }, vo = ["disabled"], go = { class: "rounded-lg border border-fm-color-neutral-gray-200 overflow-hidden" }, bo = { class: "flex items-center gap-12 px-16 py-12 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-50" }, ho = {
1248
1248
  key: 0,
1249
1249
  class: "flex-1 flex items-baseline gap-8 min-w-0"
1250
- }, bo = {
1250
+ }, _o = {
1251
1251
  key: 1,
1252
1252
  class: "flex-1 min-w-0"
1253
- }, ho = {
1253
+ }, xo = {
1254
1254
  class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 rounded-full shrink-0",
1255
1255
  style: { padding: "4px 10px" }
1256
- }, _o = {
1256
+ }, wo = {
1257
1257
  key: 0,
1258
+ class: "flex items-center gap-4 px-16 py-8 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-50 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
1259
+ }, ko = {
1260
+ key: 1,
1258
1261
  class: "flex flex-col"
1259
- }, xo = ["onDragstart", "onDrop"], wo = {
1262
+ }, $o = ["onDragstart", "onDrop"], To = {
1260
1263
  key: 0,
1261
1264
  class: "m-16 rounded-lg border border-dashed border-fm-color-neutral-gray-300 text-center fm-typo-en-body-sm-400 text-fm-color-typo-secondary",
1262
1265
  style: { padding: "24px" }
1263
- }, ko = {
1264
- key: 1,
1266
+ }, Fo = {
1267
+ key: 2,
1265
1268
  class: "flex flex-col"
1266
- }, $o = {
1269
+ }, Co = {
1267
1270
  key: 0,
1268
1271
  class: "m-16 rounded-lg border border-dashed border-fm-color-neutral-gray-300 text-center fm-typo-en-body-sm-400 text-fm-color-typo-secondary",
1269
1272
  style: { padding: "24px" }
1270
- }, To = ["onDragstart", "onDrop"], Fo = {
1273
+ }, Io = ["onDragstart", "onDrop"], Do = {
1271
1274
  class: "flex items-center justify-center shrink-0 rounded-md border border-fm-color-neutral-gray-300 fm-typo-en-body-sm-600 text-fm-color-typo-secondary",
1272
1275
  style: { width: "28px", height: "28px" }
1273
- }, Co = { class: "flex-1 min-w-0" }, Io = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Do = {
1276
+ }, So = { class: "flex-1 min-w-0" }, Ao = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ro = {
1274
1277
  class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary",
1275
1278
  style: { "line-height": "1.2" }
1276
- }, So = {
1279
+ }, Po = {
1277
1280
  class: "flex flex-wrap gap-4 justify-end",
1278
1281
  style: { "max-width": "320px" }
1279
- }, Ao = /* @__PURE__ */ J({
1282
+ }, Mo = /* @__PURE__ */ Q({
1280
1283
  __name: "ClosingTemplateGroupsEditor",
1281
1284
  props: {
1282
1285
  items: {},
@@ -1288,160 +1291,163 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1288
1291
  },
1289
1292
  emits: ["reorderDefault", "addItems"],
1290
1293
  setup(c, { emit: o }) {
1291
- const { promptSelectIngredients: t } = ze(), v = _e(), r = c, f = o, g = ["#EAB308", "#22C55E", "#3B82F6", "#A855F7", "#F97316", "#EC4899", "#14B8A6"], d = N("default"), a = U(() => r.groups ?? []);
1292
- function s(u) {
1293
- r.updateGroups(u);
1294
+ const { promptSelectIngredients: t } = ze(), g = _e(), r = c, f = o, b = ["#EAB308", "#22C55E", "#3B82F6", "#A855F7", "#F97316", "#EC4899", "#14B8A6"], u = N("default"), a = U(() => r.groups ?? []);
1295
+ function s(m) {
1296
+ r.updateGroups(m);
1294
1297
  }
1295
1298
  function w() {
1296
1299
  return `tmplGroup_${Date.now()}_${Math.floor(Math.random() * 1e4)}`;
1297
1300
  }
1298
1301
  const p = N(null), I = N(null);
1299
- function F(u, b, T) {
1302
+ function T(m, v, C) {
1300
1303
  var P;
1301
- I.value = u, p.value = b, (P = T.dataTransfer) == null || P.setData("text/plain", String(b)), T.dataTransfer && (T.dataTransfer.effectAllowed = "move");
1304
+ I.value = m, p.value = v, (P = C.dataTransfer) == null || P.setData("text/plain", String(v)), C.dataTransfer && (C.dataTransfer.effectAllowed = "move");
1302
1305
  }
1303
- function m(u, b, T) {
1304
- const P = [...u], [M] = P.splice(b, 1);
1305
- return P.splice(T, 0, M), P;
1306
+ function d(m, v, C) {
1307
+ const P = [...m], [M] = P.splice(v, 1);
1308
+ return P.splice(C, 0, M), P;
1306
1309
  }
1307
- function l(u, b) {
1308
- const T = p.value, P = I.value;
1309
- if (p.value = null, I.value = null, !(T === null || P !== u || T === b))
1310
- if (u === "default")
1310
+ function l(m, v) {
1311
+ const C = p.value, P = I.value;
1312
+ if (p.value = null, I.value = null, !(C === null || P !== m || C === v))
1313
+ if (m === "default")
1311
1314
  f(
1312
1315
  "reorderDefault",
1313
- m(
1316
+ d(
1314
1317
  r.items.map((M) => M.sku._id),
1315
- T,
1316
- b
1318
+ C,
1319
+ v
1317
1320
  )
1318
1321
  );
1319
1322
  else {
1320
- const M = V(u);
1321
- M && Q(u, m(M.items.map((E) => E.skuId), T, b));
1323
+ const M = V(m);
1324
+ M && ee(m, d(M.items.map((q) => q.skuId), C, v));
1322
1325
  }
1323
1326
  }
1324
1327
  const n = U(
1325
- () => Object.fromEntries(r.items.map((u) => [u.sku._id, u]))
1328
+ () => Object.fromEntries(r.items.map((m) => [m.sku._id, m]))
1326
1329
  );
1327
1330
  Fe(
1328
- () => r.items.map((u) => u.sku._id),
1329
- (u) => {
1330
- const b = new Set(u);
1331
- let T = !1;
1331
+ () => r.items.map((m) => m.sku._id),
1332
+ (m) => {
1333
+ const v = new Set(m);
1334
+ let C = !1;
1332
1335
  const P = a.value.map((M) => {
1333
- const E = M.items.filter((G) => b.has(G.skuId));
1334
- return E.length !== M.items.length ? (T = !0, { ...M, items: E }) : M;
1336
+ const q = M.items.filter((B) => v.has(B.skuId));
1337
+ return q.length !== M.items.length ? (C = !0, { ...M, items: q }) : M;
1335
1338
  });
1336
- T && s(P);
1339
+ C && s(P);
1337
1340
  }
1338
1341
  );
1339
1342
  const y = U(() => {
1340
- const u = /* @__PURE__ */ new Map();
1341
- for (const T of a.value)
1342
- for (const P of T.items) u.set(P.skuId, (u.get(P.skuId) ?? 0) + 1);
1343
- let b = 0;
1344
- return u.forEach((T) => {
1345
- T > 1 && b++;
1346
- }), b;
1343
+ const m = /* @__PURE__ */ new Map();
1344
+ for (const C of a.value)
1345
+ for (const P of C.items) m.set(P.skuId, (m.get(P.skuId) ?? 0) + 1);
1346
+ let v = 0;
1347
+ return m.forEach((C) => {
1348
+ C > 1 && v++;
1349
+ }), v;
1347
1350
  }), e = U(() => {
1348
- const u = a.value.length;
1349
- return `${r.items.length} items in Default · ${y.value} shared across named groups · ${u + 1} total groups (${u} named + Default)`;
1351
+ const m = a.value.length;
1352
+ return `${r.items.length} items in Default · ${y.value} shared across named groups · ${m + 1} total groups (${m} named + Default)`;
1350
1353
  }), _ = U(() => [
1351
1354
  { id: "default", isDefault: !0, name: "Default", color: null, itemCount: r.items.length },
1352
- ...a.value.map((u, b) => ({
1353
- id: u.id,
1355
+ ...a.value.map((m, v) => ({
1356
+ id: m.id,
1354
1357
  isDefault: !1,
1355
- name: u.name,
1356
- color: g[b % g.length],
1357
- itemCount: u.items.length
1358
+ name: m.name,
1359
+ color: b[v % b.length],
1360
+ itemCount: m.items.length
1358
1361
  }))
1359
- ]), C = U(
1360
- () => _.value.find((u) => u.id === d.value) ?? _.value[0]
1361
- ), S = U(() => C.value.isDefault), h = U(
1362
- () => S.value ? [] : ce(d.value)
1362
+ ]), F = U(
1363
+ () => _.value.find((m) => m.id === u.value) ?? _.value[0]
1364
+ ), S = U(() => F.value.isDefault), h = U(
1365
+ () => S.value ? [] : de(u.value)
1363
1366
  );
1364
- function $(u) {
1365
- return d.value === u;
1367
+ function $(m) {
1368
+ return u.value === m;
1366
1369
  }
1367
1370
  function L() {
1368
- const u = w();
1369
- s([...a.value, { id: u, name: `Group ${a.value.length + 1}`, items: [] }]), d.value = u;
1371
+ const m = w();
1372
+ s([...a.value, { id: m, name: `Group ${a.value.length + 1}`, items: [] }]), u.value = m;
1370
1373
  }
1371
- function V(u) {
1372
- return a.value.find((b) => b.id === u) ?? null;
1374
+ function V(m) {
1375
+ return a.value.find((v) => v.id === m) ?? null;
1373
1376
  }
1374
- function X(u) {
1375
- s(a.value.filter((b) => b.id !== u)), d.value === u && (d.value = "default");
1377
+ function Z(m) {
1378
+ s(a.value.filter((v) => v.id !== m)), u.value === m && (u.value = "default");
1376
1379
  }
1377
- function ne(u, b) {
1378
- v.open({
1379
- title: `Delete group "${b || "Untitled"}"?`,
1380
+ function se(m, v) {
1381
+ g.open({
1382
+ title: `Delete group "${v || "Untitled"}"?`,
1380
1383
  closeButton: !1,
1381
1384
  message: "This removes the group and its item selection. The items stay in Default and other groups.",
1382
1385
  primaryActions: { text: "Delete", close: !0, variant: "destructive" },
1383
1386
  secondaryActions: { text: "Cancel", close: !0 }
1384
- }).onPrimary(() => X(u));
1387
+ }).onPrimary(() => Z(m));
1385
1388
  }
1386
- function O(u, b) {
1387
- s(a.value.map((T) => T.id === u ? { ...T, name: b } : T));
1389
+ function H(m, v) {
1390
+ s(a.value.map((C) => C.id === m ? { ...C, name: v } : C));
1388
1391
  }
1389
- function Q(u, b) {
1392
+ function ee(m, v) {
1390
1393
  s(
1391
1394
  a.value.map(
1392
- (T) => T.id === u ? { ...T, items: b.map((P, M) => ({ skuId: P, position: M })) } : T
1395
+ (C) => C.id === m ? { ...C, items: v.map((P, M) => ({ skuId: P, position: M })) } : C
1393
1396
  )
1394
1397
  );
1395
1398
  }
1396
- async function le(u) {
1399
+ async function ie(m) {
1397
1400
  if (r.disabled) return;
1398
- const b = V(u);
1399
- if (!b) return;
1400
- const T = await t(
1401
- b.items.map((P) => P.skuId),
1401
+ const v = V(m);
1402
+ if (!v) return;
1403
+ const C = await t(
1404
+ v.items.map((P) => P.skuId),
1402
1405
  (P) => P,
1403
1406
  r.items.map((P) => P.sku)
1404
1407
  );
1405
- T && Q(u, T);
1408
+ C && ee(m, C);
1406
1409
  }
1407
- function re() {
1408
- S.value ? f("addItems") : le(d.value);
1410
+ function ce() {
1411
+ S.value ? f("addItems") : ie(u.value);
1409
1412
  }
1410
- function ie(u, b) {
1411
- const T = V(u);
1412
- if (!T) return;
1413
- const P = T.items.some((M) => M.skuId === b) ? T.items.filter((M) => M.skuId !== b).map((M) => M.skuId) : [...T.items.map((M) => M.skuId), b];
1414
- Q(u, P);
1413
+ function me(m, v) {
1414
+ const C = V(m);
1415
+ if (!C) return;
1416
+ const P = C.items.some((M) => M.skuId === v) ? C.items.filter((M) => M.skuId !== v).map((M) => M.skuId) : [...C.items.map((M) => M.skuId), v];
1417
+ ee(m, P);
1415
1418
  }
1416
- function ce(u) {
1417
- const b = V(u);
1418
- return b ? b.items.map((T) => n.value[T.skuId]).filter(Boolean) : [];
1419
+ function de(m) {
1420
+ const v = V(m);
1421
+ return v ? v.items.map((C) => n.value[C.skuId]).filter(Boolean) : [];
1419
1422
  }
1420
- function se(u) {
1421
- const b = $(u.id);
1422
- if (u.isDefault)
1423
- return b ? { background: "#1F2937", color: "#FFFFFF", border: "1px solid #1F2937" } : { background: "#FFFFFF", color: "#374151", border: "1px solid #E5E7EB" };
1424
- const T = u.color || "#999999";
1425
- return b ? { background: T, color: ae(T), border: `1px solid ${T}` } : { background: `${T}1A`, color: "#374151", border: `1px solid ${T}` };
1423
+ function ae(m) {
1424
+ const v = $(m.id);
1425
+ if (m.isDefault)
1426
+ return v ? { background: "#1F2937", color: "#FFFFFF", border: "1px solid #1F2937" } : { background: "#FFFFFF", color: "#374151", border: "1px solid #E5E7EB" };
1427
+ const C = m.color || "#999999";
1428
+ return v ? { background: C, color: re(C), border: `1px solid ${C}` } : { background: `${C}1A`, color: "#374151", border: `1px solid ${C}` };
1426
1429
  }
1427
- function ae(u) {
1428
- const b = u.replace("#", ""), T = parseInt(b.slice(0, 2), 16), P = parseInt(b.slice(2, 4), 16), M = parseInt(b.slice(4, 6), 16);
1429
- return (0.299 * T + 0.587 * P + 0.114 * M) / 255 > 0.6 ? "#1F2937" : "#FFFFFF";
1430
+ function re(m) {
1431
+ const v = m.replace("#", ""), C = parseInt(v.slice(0, 2), 16), P = parseInt(v.slice(2, 4), 16), M = parseInt(v.slice(4, 6), 16);
1432
+ return (0.299 * C + 0.587 * P + 0.114 * M) / 255 > 0.6 ? "#1F2937" : "#FFFFFF";
1430
1433
  }
1431
- function ue(u) {
1432
- return $(u.id) ? (u.isDefault ? "#FFFFFF" : ae(u.color || "#999999")) === "#FFFFFF" ? { background: "rgba(255,255,255,0.25)", color: "#FFFFFF" } : { background: "rgba(0,0,0,0.12)", color: "#1F2937" } : { background: "rgba(0,0,0,0.06)", color: "inherit" };
1434
+ function ue(m) {
1435
+ return $(m.id) ? (m.isDefault ? "#FFFFFF" : re(m.color || "#999999")) === "#FFFFFF" ? { background: "rgba(255,255,255,0.25)", color: "#FFFFFF" } : { background: "rgba(0,0,0,0.12)", color: "#1F2937" } : { background: "rgba(0,0,0,0.06)", color: "inherit" };
1433
1436
  }
1434
- return (u, b) => {
1435
- const T = B("FmButton"), P = B("FmIcon"), M = B("FmTextField");
1436
- return k(), D("div", ao, [
1437
- i("div", lo, [
1438
- i("div", ro, [
1439
- b[4] || (b[4] = i("div", { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, "Groups & items", -1)),
1440
- i("div", io, A(e.value), 1)
1437
+ return (m, v) => {
1438
+ const C = E("FmPill"), P = E("FmButton"), M = E("FmIcon"), q = E("FmTextField");
1439
+ return k(), D("div", lo, [
1440
+ i("div", ro, [
1441
+ i("div", io, [
1442
+ i("div", co, [
1443
+ v[4] || (v[4] = i("div", { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, "Groups & items", -1)),
1444
+ R(C, { variant: "beta" })
1445
+ ]),
1446
+ i("div", mo, A(e.value), 1)
1441
1447
  ]),
1442
- i("div", co, [
1443
- R(T, {
1444
- disabled: u.disabled,
1448
+ i("div", uo, [
1449
+ R(P, {
1450
+ disabled: m.disabled,
1445
1451
  label: "New Group",
1446
1452
  "prepend-icon": "add",
1447
1453
  variant: "primary",
@@ -1451,155 +1457,165 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1451
1457
  }, null, 8, ["disabled"])
1452
1458
  ])
1453
1459
  ]),
1454
- i("div", uo, [
1455
- (k(!0), D(H, null, q(_.value, (E) => (k(), D("button", {
1456
- key: E.id,
1460
+ v[10] || (v[10] = Ye('<div class="flex items-start gap-8 p-12 fm-corner-radius-md border-1 border-yellow-500 bg-yellow-50 text-yellow-700"><div class="flex flex-col gap-2"><div class="fm-typo-en-body-md-600 text-fm-color-typo-primary">📦 Closing Groups</div><div class="fm-typo-en-body-sm-400"> Split a closing template into named groups (e.g. by section, fridge, or station) so several staff can stock take in parallel and you manage them in one place. Group stock take is currently only available in the Inventory mobile app — it&#39;s not yet available in POS. You can keep using the <span class="fm-typo-en-body-sm-600 text-fm-color-typo-primary">Default (master list)</span> group as usual. </div></div></div>', 1)),
1461
+ i("div", po, [
1462
+ (k(!0), D(O, null, J(_.value, (B) => (k(), D("button", {
1463
+ key: B.id,
1457
1464
  type: "button",
1458
1465
  class: "flex items-center rounded-full",
1459
- style: Te([{ gap: "8px", padding: "6px 14px" }, se(E)]),
1460
- onClick: (G) => d.value = E.id
1466
+ style: Te([{ gap: "8px", padding: "6px 14px" }, ae(B)]),
1467
+ onClick: (W) => u.value = B.id
1461
1468
  }, [
1462
- i("span", po, A(E.name), 1),
1469
+ i("span", yo, A(B.name), 1),
1463
1470
  i("span", {
1464
1471
  class: "fm-typo-en-body-sm-600 rounded-full",
1465
- style: Te([{ padding: "0 8px" }, ue(E)])
1466
- }, A(E.itemCount), 5)
1467
- ], 12, mo))), 128)),
1472
+ style: Te([{ padding: "0 8px" }, ue(B)])
1473
+ }, A(B.itemCount), 5)
1474
+ ], 12, fo))), 128)),
1468
1475
  i("button", {
1469
1476
  type: "button",
1470
- disabled: u.disabled,
1477
+ disabled: m.disabled,
1471
1478
  class: "flex items-center rounded-full border border-dashed border-fm-color-neutral-gray-400 text-fm-color-typo-secondary",
1472
1479
  style: { gap: "6px", padding: "6px 14px" },
1473
1480
  onClick: L
1474
1481
  }, [
1475
- R(P, {
1482
+ R(M, {
1476
1483
  name: "add",
1477
1484
  size: "sm"
1478
1485
  }),
1479
- b[5] || (b[5] = i("span", { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, "New group", -1))
1480
- ], 8, fo)
1486
+ v[5] || (v[5] = i("span", { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, "New group", -1))
1487
+ ], 8, vo)
1481
1488
  ]),
1482
- i("div", yo, [
1483
- i("div", vo, [
1484
- S.value ? (k(), D("div", go, b[6] || (b[6] = [
1489
+ i("div", go, [
1490
+ i("div", bo, [
1491
+ S.value ? (k(), D("div", ho, v[6] || (v[6] = [
1485
1492
  i("span", { class: "fm-typo-en-body-lg-600 italic text-fm-color-typo-primary" }, "Default", -1),
1486
1493
  i("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary truncate" }, " master list · sets the item pool & units ", -1)
1487
- ]))) : (k(), D("div", bo, [
1488
- R(M, {
1489
- "model-value": C.value.name,
1490
- disabled: u.disabled,
1494
+ ]))) : (k(), D("div", _o, [
1495
+ R(q, {
1496
+ "model-value": F.value.name,
1497
+ disabled: m.disabled,
1491
1498
  placeholder: "Group name",
1492
- "onUpdate:modelValue": b[0] || (b[0] = (E) => O(d.value, E))
1499
+ "onUpdate:modelValue": v[0] || (v[0] = (B) => H(u.value, B))
1493
1500
  }, null, 8, ["model-value", "disabled"])
1494
1501
  ])),
1495
- i("span", ho, A(C.value.itemCount) + " items ", 1),
1496
- S.value ? W("", !0) : (k(), K(T, {
1502
+ i("span", xo, A(F.value.itemCount) + " items ", 1),
1503
+ S.value ? G("", !0) : (k(), K(P, {
1497
1504
  key: 2,
1498
- disabled: u.disabled,
1505
+ disabled: m.disabled,
1499
1506
  label: "Delete group",
1500
1507
  "prepend-icon": "delete",
1501
1508
  variant: "secondary",
1502
1509
  size: "md",
1503
1510
  class: "rounded-lg shrink-0",
1504
- onClick: b[1] || (b[1] = (E) => ne(d.value, C.value.name))
1511
+ onClick: v[1] || (v[1] = (B) => se(u.value, F.value.name))
1505
1512
  }, null, 8, ["disabled"])),
1506
- R(T, {
1507
- disabled: u.disabled,
1513
+ R(P, {
1514
+ disabled: m.disabled,
1508
1515
  label: "Add items",
1509
1516
  "prepend-icon": "add",
1510
1517
  variant: "primary",
1511
1518
  size: "md",
1512
1519
  class: "rounded-lg shrink-0",
1513
- onClick: re
1520
+ onClick: ce
1514
1521
  }, null, 8, ["disabled"])
1515
1522
  ]),
1516
- S.value ? (k(), D("div", _o, [
1517
- (k(!0), D(H, null, q(u.items, (E, G) => (k(), D("div", {
1518
- key: E.sku._id,
1523
+ F.value.itemCount > 1 ? (k(), D("div", wo, [
1524
+ R(M, {
1525
+ name: "drag_indicator",
1526
+ size: "sm",
1527
+ color: "neutral-gray-400",
1528
+ class: "shrink-0"
1529
+ }),
1530
+ v[7] || (v[7] = X(" Drag a row to reorder items. "))
1531
+ ])) : G("", !0),
1532
+ S.value ? (k(), D("div", ko, [
1533
+ (k(!0), D(O, null, J(m.items, (B, W) => (k(), D("div", {
1534
+ key: B.sku._id,
1519
1535
  draggable: "true",
1520
- onDragstart: (j) => F("default", G, j),
1521
- onDragover: b[2] || (b[2] = pe(() => {
1536
+ onDragstart: (j) => T("default", W, j),
1537
+ onDragover: v[2] || (v[2] = pe(() => {
1522
1538
  }, ["prevent"])),
1523
- onDrop: pe((j) => l("default", G), ["prevent"]),
1539
+ onDrop: pe((j) => l("default", W), ["prevent"]),
1524
1540
  class: "flex items-center gap-4 px-16 border-b border-fm-color-neutral-gray-200 hover:bg-fm-color-neutral-gray-100 cursor-grab"
1525
1541
  }, [
1526
- R(P, {
1542
+ R(M, {
1527
1543
  name: "drag_indicator",
1528
1544
  size: "sm",
1529
1545
  color: "neutral-gray-400",
1530
1546
  class: "shrink-0"
1531
1547
  }),
1532
- R(so, {
1548
+ R(ao, {
1533
1549
  class: "flex-1 min-w-0",
1534
- item: E,
1535
- index: G,
1536
- disabled: u.disabled,
1537
- onUpdate: u.updateItem,
1538
- onDelete: (j) => u.deleteItem(E)
1550
+ item: B,
1551
+ index: W,
1552
+ disabled: m.disabled,
1553
+ onUpdate: m.updateItem,
1554
+ onDelete: (j) => m.deleteItem(B)
1539
1555
  }, null, 8, ["item", "index", "disabled", "onUpdate", "onDelete"])
1540
- ], 40, xo))), 128)),
1541
- u.items.length ? W("", !0) : (k(), D("div", wo, b[7] || (b[7] = [
1542
- ee(" No items yet — click "),
1556
+ ], 40, $o))), 128)),
1557
+ m.items.length ? G("", !0) : (k(), D("div", To, v[8] || (v[8] = [
1558
+ X(" No items yet — click "),
1543
1559
  i("span", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary" }, "+ Add items", -1),
1544
- ee(" to add from your catalog. ")
1560
+ X(" to add from your catalog. ")
1545
1561
  ])))
1546
- ])) : (k(), D("div", ko, [
1547
- h.value.length ? W("", !0) : (k(), D("div", $o, b[8] || (b[8] = [
1548
- ee(" No items yet — click "),
1562
+ ])) : (k(), D("div", Fo, [
1563
+ h.value.length ? G("", !0) : (k(), D("div", Co, v[9] || (v[9] = [
1564
+ X(" No items yet — click "),
1549
1565
  i("span", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary" }, "+ Add items", -1),
1550
- ee(" on this group to assign items. ")
1566
+ X(" on this group to assign items. ")
1551
1567
  ]))),
1552
- (k(!0), D(H, null, q(h.value, (E, G) => (k(), D("div", {
1553
- key: E.sku._id,
1568
+ (k(!0), D(O, null, J(h.value, (B, W) => (k(), D("div", {
1569
+ key: B.sku._id,
1554
1570
  draggable: "true",
1555
- onDragstart: (j) => F(d.value, G, j),
1556
- onDragover: b[3] || (b[3] = pe(() => {
1571
+ onDragstart: (j) => T(u.value, W, j),
1572
+ onDragover: v[3] || (v[3] = pe(() => {
1557
1573
  }, ["prevent"])),
1558
- onDrop: pe((j) => l(d.value, G), ["prevent"]),
1574
+ onDrop: pe((j) => l(u.value, W), ["prevent"]),
1559
1575
  class: "flex items-center gap-12 px-16 py-12 border-b border-fm-color-neutral-gray-200 hover:bg-fm-color-neutral-gray-100 cursor-grab"
1560
1576
  }, [
1561
- R(P, {
1577
+ R(M, {
1562
1578
  name: "drag_indicator",
1563
1579
  size: "sm",
1564
1580
  color: "neutral-gray-400",
1565
1581
  class: "shrink-0"
1566
1582
  }),
1567
- i("span", Fo, A(G + 1), 1),
1568
- i("div", Co, [
1569
- i("div", Io, A(E.sku.code), 1),
1570
- i("div", Do, A(E.sku.name), 1)
1571
- ]),
1583
+ i("span", Do, A(W + 1), 1),
1572
1584
  i("div", So, [
1573
- (k(!0), D(H, null, q(x(Kt)(E), (j, me) => (k(), D("span", {
1574
- key: me,
1585
+ i("div", Ao, A(B.sku.code), 1),
1586
+ i("div", Ro, A(B.sku.name), 1)
1587
+ ]),
1588
+ i("div", Po, [
1589
+ (k(!0), D(O, null, J(x(Wt)(B), (j, le) => (k(), D("span", {
1590
+ key: le,
1575
1591
  class: "px-8 py-2 rounded-full border border-fm-color-neutral-gray-200 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
1576
1592
  }, A(j), 1))), 128))
1577
1593
  ]),
1578
- R(T, {
1579
- disabled: u.disabled,
1594
+ R(P, {
1595
+ disabled: m.disabled,
1580
1596
  icon: "delete",
1581
1597
  variant: "tertiary",
1582
1598
  size: "md",
1583
- onClick: (j) => ie(d.value, E.sku._id)
1599
+ onClick: (j) => me(u.value, B.sku._id)
1584
1600
  }, null, 8, ["disabled", "onClick"])
1585
- ], 40, To))), 128))
1601
+ ], 40, Io))), 128))
1586
1602
  ]))
1587
1603
  ])
1588
1604
  ]);
1589
1605
  };
1590
1606
  }
1591
- }), Ro = { class: "flex flex-col gap-16" }, Po = { class: "flex flex-col gap-24" }, Mo = { class: "flex flex-col gap-16" }, Eo = { class: "flex items-center" }, Bo = { class: "flex-1 fm-typo-en-title-sm-600" }, No = { class: "flex flex-col gap-16" }, Uo = { class: "flex items-center" }, Lo = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, Vo = /* @__PURE__ */ J({
1607
+ }), Eo = { class: "flex flex-col gap-16" }, Bo = { class: "flex flex-col gap-24" }, No = { class: "flex flex-col gap-16" }, Uo = { class: "flex items-center" }, Lo = { class: "flex-1 fm-typo-en-title-sm-600" }, Vo = { class: "flex flex-col gap-16" }, zo = { class: "flex items-center" }, Go = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, Oo = /* @__PURE__ */ Q({
1592
1608
  __name: "ClosingTemplateForm",
1593
1609
  props: {
1594
1610
  modelValue: {},
1595
1611
  disabled: { type: Boolean }
1596
1612
  },
1597
1613
  setup(c, { expose: o }) {
1598
- const t = ft(), { t: v } = oe(), r = De(), {
1614
+ const t = yt(), { t: g } = ne(), r = De(), {
1599
1615
  promptSelectLocations: f,
1600
- columnDefs: g,
1601
- rowData: d
1602
- } = yt({
1616
+ columnDefs: b,
1617
+ rowData: u
1618
+ } = vt({
1603
1619
  getLocations() {
1604
1620
  return t.locations;
1605
1621
  },
@@ -1612,9 +1628,9 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1612
1628
  }).map(({ item: n }) => n));
1613
1629
  function w(n) {
1614
1630
  const y = new Map(t.items.map((_) => [_.sku._id, _])), e = [];
1615
- n.forEach((_, C) => {
1631
+ n.forEach((_, F) => {
1616
1632
  const S = y.get(_);
1617
- S && e.push({ ...S, position: C });
1633
+ S && e.push({ ...S, position: F });
1618
1634
  }), t.items = e;
1619
1635
  }
1620
1636
  o({
@@ -1637,31 +1653,31 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1637
1653
  function I(n) {
1638
1654
  t.items = t.items.filter((y) => y.sku._id !== n.sku._id);
1639
1655
  }
1640
- function F(n) {
1656
+ function T(n) {
1641
1657
  t.groups = n;
1642
1658
  }
1643
- const { promptSelectIngredients: m } = ze();
1659
+ const { promptSelectIngredients: d } = ze();
1644
1660
  async function l() {
1645
- const y = r.skus.map((C) => ({
1646
- label: C.name,
1647
- sublabel: C.code,
1648
- value: C
1649
- })).filter((C) => {
1661
+ const y = r.skus.map((F) => ({
1662
+ label: F.name,
1663
+ sublabel: F.code,
1664
+ value: F
1665
+ })).filter((F) => {
1650
1666
  var S;
1651
- return (S = t.items) == null ? void 0 : S.find((h) => h.sku._id === C.value._id);
1652
- }).map((C) => C.value), e = t.items ?? [], _ = await m(
1653
- y.map((C) => C._id),
1654
- (C) => {
1655
- const S = r.skuById[C], h = e.find((L) => L.sku._id === S._id);
1667
+ return (S = t.items) == null ? void 0 : S.find((h) => h.sku._id === F.value._id);
1668
+ }).map((F) => F.value), e = t.items ?? [], _ = await d(
1669
+ y.map((F) => F._id),
1670
+ (F) => {
1671
+ const S = r.skuById[F], h = e.find((L) => L.sku._id === S._id);
1656
1672
  return h || {
1657
1673
  sku: S
1658
1674
  };
1659
1675
  }
1660
1676
  );
1661
- _ && (_.sort((C, S) => C.sku.code.localeCompare(S.sku.code)), t.items = _);
1677
+ _ && (_.sort((F, S) => F.sku.code.localeCompare(S.sku.code)), t.items = _);
1662
1678
  }
1663
1679
  return (n, y) => {
1664
- const e = B("FmTextField"), _ = B("FmButton"), C = B("FmTable"), S = B("FmFormGroup"), h = B("FmForm");
1680
+ const e = E("FmTextField"), _ = E("FmButton"), F = E("FmTable"), S = E("FmFormGroup"), h = E("FmForm");
1665
1681
  return k(), K(h, {
1666
1682
  ref_key: "formRef",
1667
1683
  ref: a,
@@ -1669,60 +1685,60 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1669
1685
  disabled: n.disabled
1670
1686
  }, {
1671
1687
  default: z(() => [
1672
- i("div", Ro, [
1673
- i("div", Po, [
1688
+ i("div", Eo, [
1689
+ i("div", Bo, [
1674
1690
  R(e, {
1675
- label: x(v)("inventory.closing.form.name"),
1691
+ label: x(g)("inventory.closing.form.name"),
1676
1692
  "label-mark": "required",
1677
1693
  modelValue: x(t).name,
1678
1694
  "onUpdate:modelValue": y[0] || (y[0] = ($) => x(t).name = $),
1679
- rules: [x(dt)()]
1695
+ rules: [x(pt)()]
1680
1696
  }, null, 8, ["label", "modelValue", "rules"]),
1681
1697
  R(e, {
1682
- label: x(v)("inventory.closing.form.reference"),
1698
+ label: x(g)("inventory.closing.form.reference"),
1683
1699
  "label-mark": "optional",
1684
1700
  modelValue: x(t).ref,
1685
1701
  "onUpdate:modelValue": y[1] || (y[1] = ($) => x(t).ref = $)
1686
1702
  }, null, 8, ["label", "modelValue"])
1687
1703
  ])
1688
1704
  ]),
1689
- i("div", Mo, [
1690
- i("div", Eo, [
1691
- i("div", Bo, A(x(v)("inventory.closing.form.locations")), 1),
1705
+ i("div", No, [
1706
+ i("div", Uo, [
1707
+ i("div", Lo, A(x(g)("inventory.closing.form.locations")), 1),
1692
1708
  R(_, {
1693
1709
  disabled: n.disabled,
1694
- label: x(v)("inventory.closing.form.selectLocation"),
1710
+ label: x(g)("inventory.closing.form.selectLocation"),
1695
1711
  "prepend-icon": "add",
1696
1712
  variant: "plain",
1697
1713
  class: "border-2 rounded-lg border-fm-color-primary",
1698
1714
  onClick: x(f)
1699
1715
  }, null, 8, ["disabled", "label", "onClick"])
1700
1716
  ]),
1701
- R(C, {
1702
- "column-defs": x(g),
1703
- "row-data": x(d),
1717
+ R(F, {
1718
+ "column-defs": x(b),
1719
+ "row-data": x(u),
1704
1720
  "shrink-at": 9999,
1705
1721
  onRowClick: x(f),
1706
1722
  "hide-footer": ""
1707
1723
  }, null, 8, ["column-defs", "row-data", "onRowClick"])
1708
1724
  ]),
1709
- i("div", No, [
1710
- i("div", Uo, [
1711
- i("div", Lo, A(x(v)("inventory.closing.form.items.title")), 1)
1725
+ i("div", Vo, [
1726
+ i("div", zo, [
1727
+ i("div", Go, A(x(g)("inventory.closing.form.items.title")), 1)
1712
1728
  ]),
1713
- R(Ao, {
1729
+ R(Mo, {
1714
1730
  items: s.value,
1715
1731
  groups: x(t).groups,
1716
1732
  "update-item": p,
1717
1733
  "delete-item": I,
1718
- "update-groups": F,
1734
+ "update-groups": T,
1719
1735
  disabled: n.disabled,
1720
1736
  onReorderDefault: w,
1721
1737
  onAddItems: l
1722
1738
  }, null, 8, ["items", "groups", "disabled"]),
1723
1739
  R(S, {
1724
1740
  "model-value": x(t).items.length,
1725
- rules: [x(pt)(1)]
1741
+ rules: [x(ft)(1)]
1726
1742
  }, null, 8, ["model-value", "rules"])
1727
1743
  ])
1728
1744
  ]),
@@ -1730,7 +1746,7 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1730
1746
  }, 8, ["disabled"]);
1731
1747
  };
1732
1748
  }
1733
- }), zo = { class: "flex items-center" }, Go = { class: "fm-typo-en-title-md-600" }, Ho = { class: "flex justify-between" }, Oo = { class: "fm-typo-en-body-lg-600" }, jo = { class: "flex flex-col gap-8" }, Yo = { class: "flex flex-col gap-4" }, Ko = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Wo = { class: "flex items-center gap-8" }, qo = { class: "fm-typo-en-body-lg-600" }, Jo = { class: "flex gap-4" }, Xo = /* @__PURE__ */ J({
1749
+ }), Ho = { class: "flex items-center" }, jo = { class: "fm-typo-en-title-md-600" }, Yo = { class: "flex justify-between" }, Ko = { class: "fm-typo-en-body-lg-600" }, Wo = { class: "flex flex-col gap-8" }, qo = { class: "flex flex-col gap-4" }, Jo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xo = { class: "flex items-center gap-8" }, Qo = { class: "fm-typo-en-body-lg-600" }, Zo = { class: "flex gap-4" }, en = /* @__PURE__ */ Q({
1734
1750
  __name: "ClosingTemplateDialog",
1735
1751
  props: {
1736
1752
  mode: {},
@@ -1740,7 +1756,7 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1740
1756
  emits: ["update:show", "submitted"],
1741
1757
  setup(c, { expose: o, emit: t }) {
1742
1758
  var S;
1743
- const v = c, r = t, f = we(), g = he(), d = xe(), { t: a } = oe(), s = tt(v, "show");
1759
+ const g = c, r = t, f = we(), b = he(), u = xe(), { t: a } = ne(), s = ot(g, "show");
1744
1760
  function w() {
1745
1761
  return {
1746
1762
  _id: "",
@@ -1748,21 +1764,21 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1748
1764
  items: []
1749
1765
  };
1750
1766
  }
1751
- const p = N(v.modelValue ?? w()), I = N(((S = v.modelValue) == null ? void 0 : S._id) ?? `${Math.random()}`);
1767
+ const p = N(g.modelValue ?? w()), I = N(((S = g.modelValue) == null ? void 0 : S._id) ?? `${Math.random()}`);
1752
1768
  Fe(
1753
- () => v.show,
1769
+ () => g.show,
1754
1770
  (h) => {
1755
1771
  var $;
1756
- h && (p.value = v.modelValue ?? w(), I.value = (($ = v.modelValue) == null ? void 0 : $._id) ?? `${Math.random()}`);
1772
+ h && (p.value = g.modelValue ?? w(), I.value = (($ = g.modelValue) == null ? void 0 : $._id) ?? `${Math.random()}`);
1757
1773
  }
1758
1774
  );
1759
- const F = N(!1), m = U(() => {
1760
- switch (v.mode) {
1761
- case Z.READ:
1775
+ const T = N(!1), d = U(() => {
1776
+ switch (g.mode) {
1777
+ case te.READ:
1762
1778
  return "";
1763
- case Z.CREATE:
1779
+ case te.CREATE:
1764
1780
  return a("inventory.closing.template.create.title");
1765
- case Z.UPDATE:
1781
+ case te.UPDATE:
1766
1782
  return a("inventory.closing.template.update.title");
1767
1783
  }
1768
1784
  return "";
@@ -1784,53 +1800,53 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1784
1800
  async function n() {
1785
1801
  const h = p.value;
1786
1802
  if (h) {
1787
- F.value = !0;
1803
+ T.value = !0;
1788
1804
  try {
1789
- await f.createTemplate(h), await new Promise(($) => setTimeout($, 1e3)), d.open({
1805
+ await f.createTemplate(h), await new Promise(($) => setTimeout($, 1e3)), u.open({
1790
1806
  title: a("inventory.closing.template.create.success"),
1791
1807
  message: a("inventory.closing.template.create.successMessage"),
1792
1808
  type: "success"
1793
1809
  }), r("update:show", !1), r("submitted");
1794
1810
  } catch ($) {
1795
- d.open({
1811
+ u.open({
1796
1812
  title: a("inventory.closing.template.create.error"),
1797
1813
  message: a("inventory.closing.template.create.errorMessage"),
1798
1814
  type: "error"
1799
1815
  }), console.error("Error in creating closing template", $);
1800
1816
  } finally {
1801
- F.value = !1;
1817
+ T.value = !1;
1802
1818
  }
1803
1819
  }
1804
1820
  }
1805
1821
  async function y() {
1806
1822
  const h = p.value;
1807
1823
  if (h) {
1808
- F.value = !0, delete h.updatedAt;
1824
+ T.value = !0, delete h.updatedAt;
1809
1825
  try {
1810
1826
  await f.updateTemplate({
1811
1827
  ...h,
1812
1828
  _rev: h._rev ?? ""
1813
- }), await new Promise(($) => setTimeout($, 1e3)), d.open({
1829
+ }), await new Promise(($) => setTimeout($, 1e3)), u.open({
1814
1830
  title: a("inventory.closing.template.update.success"),
1815
1831
  message: a("inventory.closing.template.update.successMessage"),
1816
1832
  type: "success"
1817
1833
  }), r("update:show", !1), r("submitted");
1818
1834
  } catch ($) {
1819
- d.open({
1835
+ u.open({
1820
1836
  title: a("inventory.closing.template.update.error"),
1821
1837
  message: a("inventory.closing.template.update.errorMessage"),
1822
1838
  type: "error"
1823
1839
  }), console.error("Error in updating closing template", $);
1824
1840
  } finally {
1825
- F.value = !1;
1841
+ T.value = !1;
1826
1842
  }
1827
1843
  }
1828
1844
  }
1829
1845
  function e() {
1830
- switch (v.mode) {
1831
- case Z.CREATE:
1846
+ switch (g.mode) {
1847
+ case te.CREATE:
1832
1848
  return n();
1833
- case Z.UPDATE:
1849
+ case te.UPDATE:
1834
1850
  return y();
1835
1851
  }
1836
1852
  }
@@ -1838,21 +1854,21 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1838
1854
  var h, $;
1839
1855
  ($ = (h = l.value) == null ? void 0 : h.validateInputs) == null || $.call(h);
1840
1856
  }
1841
- function C() {
1842
- p.value && g.exportSingleTemplate(p.value);
1857
+ function F() {
1858
+ p.value && b.exportSingleTemplate(p.value);
1843
1859
  }
1844
1860
  return (h, $) => {
1845
- const L = B("FmMenuDivider"), V = B("FmCard"), X = B("FmButton"), ne = B("FmSideSheet");
1846
- return k(), K(ne, {
1861
+ const L = E("FmMenuDivider"), V = E("FmCard"), Z = E("FmButton"), se = E("FmSideSheet");
1862
+ return k(), K(se, {
1847
1863
  modelValue: x(s),
1848
- "onUpdate:modelValue": $[2] || ($[2] = (O) => Ye(s) ? s.value = O : null),
1864
+ "onUpdate:modelValue": $[2] || ($[2] = (H) => Ke(s) ? s.value = H : null),
1849
1865
  "dismiss-away": "",
1850
1866
  "close-button": "",
1851
1867
  "max-width": 9999
1852
1868
  }, {
1853
1869
  "side-sheet-header": z(() => [
1854
- i("div", zo, [
1855
- i("div", Go, A(m.value), 1)
1870
+ i("div", Ho, [
1871
+ i("div", jo, A(d.value), 1)
1856
1872
  ])
1857
1873
  ]),
1858
1874
  default: z(() => [
@@ -1862,23 +1878,23 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1862
1878
  class: "flex flex-col gap-8 px-12 py-16 mb-16"
1863
1879
  }, {
1864
1880
  default: z(() => {
1865
- var O;
1881
+ var H;
1866
1882
  return [
1867
- i("div", Ho, [
1868
- i("div", Oo, A(x(a)("inventory.transfer.template.details.templateSummary")), 1)
1883
+ i("div", Yo, [
1884
+ i("div", Ko, A(x(a)("inventory.transfer.template.details.templateSummary")), 1)
1869
1885
  ]),
1870
1886
  R(L),
1871
- i("div", jo, [
1872
- i("div", Yo, [
1873
- i("div", Ko, A(x(a)("inventory.transfer.receiveRequest.details.updatedAt")), 1),
1874
- i("div", Wo, [
1875
- i("div", qo, [
1876
- ee(A(x(ge)(p.value.updatedAt)) + " ", 1),
1877
- (O = p.value.updatedBy) != null && O.name ? (k(), D(H, { key: 0 }, [
1878
- ee(" (" + A(p.value.updatedBy.name) + ") ", 1)
1879
- ], 64)) : W("", !0)
1887
+ i("div", Wo, [
1888
+ i("div", qo, [
1889
+ i("div", Jo, A(x(a)("inventory.transfer.receiveRequest.details.updatedAt")), 1),
1890
+ i("div", Xo, [
1891
+ i("div", Qo, [
1892
+ X(A(x(ge)(p.value.updatedAt)) + " ", 1),
1893
+ (H = p.value.updatedBy) != null && H.name ? (k(), D(O, { key: 0 }, [
1894
+ X(" (" + A(p.value.updatedBy.name) + ") ", 1)
1895
+ ], 64)) : G("", !0)
1880
1896
  ]),
1881
- R(vt, {
1897
+ R(gt, {
1882
1898
  "closing-id": p.value._id
1883
1899
  }, null, 8, ["closing-id"])
1884
1900
  ])
@@ -1887,38 +1903,38 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1887
1903
  ];
1888
1904
  }),
1889
1905
  _: 1
1890
- })) : W("", !0),
1891
- (k(), K(Vo, {
1906
+ })) : G("", !0),
1907
+ (k(), K(Oo, {
1892
1908
  class: "w-full",
1893
1909
  ref_key: "formRef",
1894
1910
  ref: l,
1895
1911
  onValidationSuccess: e,
1896
1912
  "model-value": p.value,
1897
- "onUpdate:modelValue": $[0] || ($[0] = (O) => p.value = O),
1898
- disabled: F.value,
1913
+ "onUpdate:modelValue": $[0] || ($[0] = (H) => p.value = H),
1914
+ disabled: T.value,
1899
1915
  key: I.value
1900
1916
  }, null, 8, ["model-value", "disabled"]))
1901
1917
  ]),
1902
1918
  "side-sheet-footer": z(() => [
1903
- i("div", Jo, [
1904
- R(X, {
1905
- loading: F.value,
1919
+ i("div", Zo, [
1920
+ R(Z, {
1921
+ loading: T.value,
1906
1922
  label: x(a)("common.save"),
1907
1923
  onClick: _
1908
1924
  }, null, 8, ["loading", "label"]),
1909
- h.mode === x(Z).UPDATE ? (k(), K(X, {
1925
+ h.mode === x(te).UPDATE ? (k(), K(Z, {
1910
1926
  key: 0,
1911
- disabled: F.value,
1927
+ disabled: T.value,
1912
1928
  variant: "secondary",
1913
1929
  label: x(a)("inventory.common.export"),
1914
1930
  "prepend-icon": "download",
1915
- onClick: C
1916
- }, null, 8, ["disabled", "label"])) : W("", !0),
1917
- R(X, {
1918
- disabled: F.value,
1931
+ onClick: F
1932
+ }, null, 8, ["disabled", "label"])) : G("", !0),
1933
+ R(Z, {
1934
+ disabled: T.value,
1919
1935
  variant: "tertiary",
1920
1936
  label: x(a)("common.close"),
1921
- onClick: $[1] || ($[1] = (O) => r("update:show", !1))
1937
+ onClick: $[1] || ($[1] = (H) => r("update:show", !1))
1922
1938
  }, null, 8, ["disabled", "label"])
1923
1939
  ])
1924
1940
  ]),
@@ -1926,34 +1942,34 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
1926
1942
  }, 8, ["modelValue"]);
1927
1943
  };
1928
1944
  }
1929
- }), Qo = {};
1930
- function Zo(c, o) {
1945
+ }), tn = {};
1946
+ function on(c, o) {
1931
1947
  return k(), D("div");
1932
1948
  }
1933
- const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-col gap-40" }, on = { key: 0 }, nn = {
1949
+ const nn = /* @__PURE__ */ ht(tn, [["render", on]]), sn = { class: "flex flex-col gap-40" }, an = { key: 0 }, ln = {
1934
1950
  key: 1,
1935
1951
  class: "flex gap-8 items-center"
1936
- }, sn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, an = {
1952
+ }, rn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, cn = {
1937
1953
  key: 2,
1938
1954
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary"
1939
- }, ln = {
1955
+ }, mn = {
1940
1956
  key: 3,
1941
1957
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary flex flex-col gap-12"
1942
- }, rn = { class: "fm-typo-en-body-md-600" }, cn = { class: "fm-typo-en-body-md-600" }, un = { key: 4 }, mn = { class: "fm-typo-en-body-md-600" }, dn = { class: "fm-typo-en-body-md-600" }, pn = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, fn = /* @__PURE__ */ J({
1958
+ }, dn = { class: "fm-typo-en-body-md-600" }, un = { class: "fm-typo-en-body-md-600" }, pn = { key: 4 }, fn = { class: "fm-typo-en-body-md-600" }, yn = { class: "fm-typo-en-body-md-600" }, vn = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, gn = /* @__PURE__ */ Q({
1943
1959
  __name: "ClosingTemplatePublish",
1944
1960
  emits: ["close"],
1945
1961
  setup(c, { emit: o }) {
1946
- const t = N(!1), v = xe(), r = we(), f = ke(), { t: g } = oe(), d = o;
1962
+ const t = N(!1), g = xe(), r = we(), f = ke(), { t: b } = ne(), u = o;
1947
1963
  async function a() {
1948
1964
  t.value = !0;
1949
1965
  try {
1950
- await r.startNewPublish().delayed(1e3), v.open({
1966
+ await r.startNewPublish().delayed(1e3), g.open({
1951
1967
  title: "Success",
1952
1968
  message: "You may refresh after a while to review publish status",
1953
1969
  type: "success"
1954
1970
  }), p();
1955
1971
  } catch (I) {
1956
- v.open({
1972
+ g.open({
1957
1973
  title: "Something went wrong",
1958
1974
  message: "Please try again",
1959
1975
  type: "error"
@@ -1966,56 +1982,56 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
1966
1982
  () => f.templates.length && (!s.value || s.value.outlets.length === s.value.completed.length)
1967
1983
  );
1968
1984
  function p() {
1969
- d("close");
1985
+ u("close");
1970
1986
  }
1971
- return (I, F) => {
1972
- const m = B("FmCircularProgress"), l = B("i18n-t"), n = B("FmButton");
1973
- return k(), D("div", tn, [
1974
- x(f).templates.length ? t.value ? (k(), D("div", nn, [
1987
+ return (I, T) => {
1988
+ const d = E("FmCircularProgress"), l = E("i18n-t"), n = E("FmButton");
1989
+ return k(), D("div", sn, [
1990
+ x(f).templates.length ? t.value ? (k(), D("div", ln, [
1975
1991
  i("div", null, [
1976
- R(m, {
1992
+ R(d, {
1977
1993
  size: "md",
1978
1994
  color: "neutral-gray-300"
1979
1995
  })
1980
1996
  ]),
1981
- i("div", sn, [
1982
- i("span", null, A(x(g)("inventory.closing.template.publish.publishing")), 1)
1997
+ i("div", rn, [
1998
+ i("span", null, A(x(b)("inventory.closing.template.publish.publishing")), 1)
1983
1999
  ])
1984
- ])) : s.value ? s.value.outlets.length === s.value.completed.length ? (k(), D("div", ln, [
2000
+ ])) : s.value ? s.value.outlets.length === s.value.completed.length ? (k(), D("div", mn, [
1985
2001
  R(l, {
1986
2002
  keypath: "inventory.closing.template.publish.recentlyPublishedAt",
1987
2003
  tag: "p"
1988
2004
  }, {
1989
2005
  started: z(() => [
1990
- i("span", rn, A(x(ge)(new Date(s.value.createdAt))), 1)
2006
+ i("span", dn, A(x(ge)(new Date(s.value.createdAt))), 1)
1991
2007
  ]),
1992
2008
  finished: z(() => [
1993
- i("span", cn, A(x(ge)(new Date(s.value.updatedAt))), 1)
2009
+ i("span", un, A(x(ge)(new Date(s.value.updatedAt))), 1)
1994
2010
  ]),
1995
2011
  _: 1
1996
2012
  }),
1997
- i("p", null, A(x(g)("inventory.closing.template.publish.message")), 1)
1998
- ])) : (k(), D("div", un, [
2013
+ i("p", null, A(x(b)("inventory.closing.template.publish.message")), 1)
2014
+ ])) : (k(), D("div", pn, [
1999
2015
  R(l, {
2000
2016
  keypath: "inventory.closing.template.publish.stillPublishing",
2001
2017
  tag: "p"
2002
2018
  }, {
2003
2019
  started: z(() => [
2004
- i("span", mn, A(x(ge)(new Date(s.value.createdAt))), 1)
2020
+ i("span", fn, A(x(ge)(new Date(s.value.createdAt))), 1)
2005
2021
  ]),
2006
2022
  progress: z(() => [
2007
- i("span", dn, " (" + A(s.value.completed.length) + "/" + A(s.value.outlets.length) + " completed) ", 1)
2023
+ i("span", yn, " (" + A(s.value.completed.length) + "/" + A(s.value.outlets.length) + " completed) ", 1)
2008
2024
  ]),
2009
2025
  _: 1
2010
2026
  }),
2011
- ee(" Your recent publishing task is still pending (" + A(s.value.completed.length) + " / " + A(s.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
2027
+ X(" Your recent publishing task is still pending (" + A(s.value.completed.length) + " / " + A(s.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
2028
+ ])) : (k(), D("div", cn, [
2029
+ i("p", null, A(x(b)("inventory.closing.template.publish.noRecentActivity")), 1),
2030
+ i("p", null, A(x(b)("inventory.closing.template.publish.message")), 1)
2012
2031
  ])) : (k(), D("div", an, [
2013
- i("p", null, A(x(g)("inventory.closing.template.publish.noRecentActivity")), 1),
2014
- i("p", null, A(x(g)("inventory.closing.template.publish.message")), 1)
2015
- ])) : (k(), D("div", on, [
2016
- i("p", null, A(x(g)("inventory.closing.template.publish.nothingToPublish")), 1)
2032
+ i("p", null, A(x(b)("inventory.closing.template.publish.nothingToPublish")), 1)
2017
2033
  ])),
2018
- i("div", pn, [
2034
+ i("div", vn, [
2019
2035
  R(n, {
2020
2036
  disabled: !w.value,
2021
2037
  loading: t.value,
@@ -2031,12 +2047,12 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
2031
2047
  ]);
2032
2048
  };
2033
2049
  }
2034
- }), yn = { class: "flex-1 flex flex-col gap-8" }, vn = { class: "flex flex-col" }, gn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, bn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, hn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, _n = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Yn = /* @__PURE__ */ J({
2050
+ }), bn = { class: "flex-1 flex flex-col gap-8" }, hn = { class: "flex flex-col" }, _n = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, wn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, kn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, qn = /* @__PURE__ */ Q({
2035
2051
  __name: "ClosingTemplateView",
2036
2052
  setup(c) {
2037
- const { t: o } = oe(), { createTemplate: t, updateTemplate: v, exportTemplates: r, importTemplates: f } = he(), { templateDialogProps: g, templateDetailsProps: d } = Ne(he()), a = Ie(), s = _e(), w = ke(), p = Xe(), { breakpoints: I } = ot();
2053
+ const { t: o } = ne(), { createTemplate: t, updateTemplate: g, exportTemplates: r, importTemplates: f } = he(), { templateDialogProps: b, templateDetailsProps: u } = Ne(he()), a = Ie(), s = _e(), w = ke(), p = Qe(), { breakpoints: I } = nt();
2038
2054
  a.watchLocation(w.fetchTemplates);
2039
- const F = U(() => w.loading), m = N(""), l = U(() => I.value.xs || I.value.sm), n = U(() => l.value ? 10 : 20);
2055
+ const T = U(() => w.loading), d = N(""), l = U(() => I.value.xs || I.value.sm), n = U(() => l.value ? 10 : 20);
2040
2056
  function y(S) {
2041
2057
  switch (S) {
2042
2058
  case Y.Add:
@@ -2054,7 +2070,7 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
2054
2070
  function e() {
2055
2071
  s.open({
2056
2072
  title: "Publish closing templates",
2057
- contentComponent: fn,
2073
+ contentComponent: gn,
2058
2074
  contentComponentProps: {
2059
2075
  onClose() {
2060
2076
  s.close();
@@ -2065,7 +2081,7 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
2065
2081
  function _(S) {
2066
2082
  return S;
2067
2083
  }
2068
- const C = U(() => l.value ? [
2084
+ const F = U(() => l.value ? [
2069
2085
  {
2070
2086
  label: o("inventory.closing.template.create.title"),
2071
2087
  value: Y.Add,
@@ -2121,16 +2137,16 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
2121
2137
  }
2122
2138
  ]);
2123
2139
  return (S, h) => {
2124
- const $ = B("FmTable");
2125
- return k(), D(H, null, [
2126
- R(Qe, {
2140
+ const $ = E("FmTable");
2141
+ return k(), D(O, null, [
2142
+ R(Ze, {
2127
2143
  title: x(o)("inventory.closing.template.title"),
2128
- actions: C.value,
2144
+ actions: F.value,
2129
2145
  "onClick:action": y
2130
2146
  }, {
2131
2147
  default: z(() => [
2132
2148
  i("div", {
2133
- class: te([
2149
+ class: oe([
2134
2150
  "flex flex-col gap-8 max-h-full",
2135
2151
  {
2136
2152
  "p-0": l.value,
@@ -2138,60 +2154,60 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
2138
2154
  }
2139
2155
  ])
2140
2156
  }, [
2141
- R(mt, {
2157
+ R(ut, {
2142
2158
  searchable: "",
2143
- search: m.value,
2144
- "onUpdate:search": h[0] || (h[0] = (L) => m.value = L)
2159
+ search: d.value,
2160
+ "onUpdate:search": h[0] || (h[0] = (L) => d.value = L)
2145
2161
  }, null, 8, ["search"]),
2146
2162
  R($, {
2147
2163
  style: Te(x(p).tableHeight),
2148
2164
  "column-defs": x(w).columnDefs,
2149
2165
  "row-data": x(w).templates,
2150
- "search-value": m.value,
2151
- loading: F.value,
2152
- onRowClick: h[1] || (h[1] = (L) => x(v)(L.original)),
2166
+ "search-value": d.value,
2167
+ loading: T.value,
2168
+ onRowClick: h[1] || (h[1] = (L) => x(g)(L.original)),
2153
2169
  "page-size": n.value
2154
2170
  }, {
2155
2171
  "list-row": z((L) => [
2156
- R(gt, {
2172
+ R(bt, {
2157
2173
  row: L,
2158
- onRowClick: (V) => x(v)(V)
2174
+ onRowClick: (V) => x(g)(V)
2159
2175
  }, {
2160
2176
  default: z((V) => {
2161
- var X, ne, O, Q, le, re, ie, ce, se, ae, ue, u, b, T, P, M, E, G, j, me, de, Me;
2177
+ var Z, se, H, ee, ie, ce, me, de, ae, re, ue, m, v, C, P, M, q, B, W, j, le, Me;
2162
2178
  return [
2163
- i("div", yn, [
2164
- i("div", vn, [
2165
- i("div", gn, [
2179
+ i("div", bn, [
2180
+ i("div", hn, [
2181
+ i("div", _n, [
2166
2182
  R(x(ve), {
2167
- render: (O = (ne = (X = V._id) == null ? void 0 : X.column) == null ? void 0 : ne.columnDef) == null ? void 0 : O.cell,
2168
- props: (le = (Q = V._id) == null ? void 0 : Q.getContext) == null ? void 0 : le.call(Q)
2183
+ render: (H = (se = (Z = V._id) == null ? void 0 : Z.column) == null ? void 0 : se.columnDef) == null ? void 0 : H.cell,
2184
+ props: (ie = (ee = V._id) == null ? void 0 : ee.getContext) == null ? void 0 : ie.call(ee)
2169
2185
  }, null, 8, ["render", "props"])
2170
2186
  ]),
2171
- i("div", bn, [
2187
+ i("div", xn, [
2172
2188
  R(x(ve), {
2173
- render: (ce = (ie = (re = V.name) == null ? void 0 : re.column) == null ? void 0 : ie.columnDef) == null ? void 0 : ce.cell,
2174
- props: (ae = (se = V.name) == null ? void 0 : se.getContext) == null ? void 0 : ae.call(se)
2189
+ render: (de = (me = (ce = V.name) == null ? void 0 : ce.column) == null ? void 0 : me.columnDef) == null ? void 0 : de.cell,
2190
+ props: (re = (ae = V.name) == null ? void 0 : ae.getContext) == null ? void 0 : re.call(ae)
2175
2191
  }, null, 8, ["render", "props"])
2176
2192
  ]),
2177
2193
  i("div", null, A((ue = L.original.locations) != null && ue.length ? x(o)("inventory.closing.table.enabledForN", {
2178
- count: ((u = L.original.locations) == null ? void 0 : u.length) ?? 0
2194
+ count: ((m = L.original.locations) == null ? void 0 : m.length) ?? 0
2179
2195
  }) : x(o)("inventory.closing.table.enabledForAll")), 1),
2180
- i("div", hn, A([
2181
- ...L.original.items.slice(0, 3).map((Oe) => Oe.sku.name),
2196
+ i("div", wn, A([
2197
+ ...L.original.items.slice(0, 3).map((He) => He.sku.name),
2182
2198
  ...L.original.items.length >= 3 ? [`and ${L.original.items.length - 3} more items`] : []
2183
2199
  ].join(", ")), 1),
2184
- i("div", _n, [
2200
+ i("div", kn, [
2185
2201
  R(x(ve), {
2186
- render: (P = (T = (b = V.ref) == null ? void 0 : b.column) == null ? void 0 : T.columnDef) == null ? void 0 : P.cell,
2187
- props: (E = (M = V.ref) == null ? void 0 : M.getContext) == null ? void 0 : E.call(M)
2202
+ render: (P = (C = (v = V.ref) == null ? void 0 : v.column) == null ? void 0 : C.columnDef) == null ? void 0 : P.cell,
2203
+ props: (q = (M = V.ref) == null ? void 0 : M.getContext) == null ? void 0 : q.call(M)
2188
2204
  }, null, 8, ["render", "props"])
2189
2205
  ])
2190
2206
  ]),
2191
2207
  i("div", null, [
2192
2208
  R(x(ve), {
2193
- render: (me = (j = (G = V.status) == null ? void 0 : G.column) == null ? void 0 : j.columnDef) == null ? void 0 : me.cell,
2194
- props: (Me = (de = V.status) == null ? void 0 : de.getContext) == null ? void 0 : Me.call(de)
2209
+ render: (j = (W = (B = V.status) == null ? void 0 : B.column) == null ? void 0 : W.columnDef) == null ? void 0 : j.cell,
2210
+ props: (Me = (le = V.status) == null ? void 0 : le.getContext) == null ? void 0 : Me.call(le)
2195
2211
  }, null, 8, ["render", "props"])
2196
2212
  ])
2197
2213
  ])
@@ -2206,9 +2222,9 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
2206
2222
  ]),
2207
2223
  _: 1
2208
2224
  }, 8, ["title", "actions"]),
2209
- (k(), K(Ke, { to: "body" }, [
2210
- R(en, We(qe(x(d))), null, 16),
2211
- R(Xo, Je(x(g), {
2225
+ (k(), K(We, { to: "body" }, [
2226
+ R(nn, qe(Je(x(u))), null, 16),
2227
+ R(en, Xe(x(b), {
2212
2228
  onSubmitted: h[2] || (h[2] = (L) => x(w).fetchTemplates())
2213
2229
  }), null, 16)
2214
2230
  ]))
@@ -2217,5 +2233,5 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
2217
2233
  }
2218
2234
  });
2219
2235
  export {
2220
- Yn as default
2236
+ qn as default
2221
2237
  };