@feedmepos/mf-inventory-portal 1.2.7-dev.2 → 1.2.7-dev.4

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 (55) hide show
  1. package/dist/{App-CBwWCCOM.js → App-C36fMhxq.js} +1 -1
  2. package/dist/{ApprovalView-BrRGheio.js → ApprovalView-BK-UXBwv.js} +26 -26
  3. package/dist/{BindingsDialog-BSPkkRis.js → BindingsDialog-C5ry8Cg7.js} +2 -2
  4. package/dist/{BindingsPicker-L3XnC3__.js → BindingsPicker-D1lrIB-Y.js} +1 -1
  5. package/dist/{BindingsTable-CgUm0Ity.js → BindingsTable-CoWyge2-.js} +1 -1
  6. package/dist/{ClosingDraftView-D_gq2fCk.js → ClosingDraftView-FFi85ylu.js} +203 -203
  7. package/dist/{ClosingTemplateView-Q16zr6EV.js → ClosingTemplateView-BvSH7TM0.js} +53 -53
  8. package/dist/{DeliveryOrderPrintPreview-mVDQO6Xq.js → DeliveryOrderPrintPreview-BVVWnadB.js} +9 -9
  9. package/dist/{FmAdminBadge-Cjy6QPoR.js → FmAdminBadge-DtBVrN_M.js} +6 -6
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DnH2Qxnr.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CSigrMC2.js} +21 -21
  11. package/dist/{FmMultiselectDialog-BbYhJk_O.js → FmMultiselectDialog-Df50mxnw.js} +1 -1
  12. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-D0qlxGgo.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CdSQVfaU.js} +27 -27
  13. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CCuLSITo.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-A7Pgq3Sl.js} +1 -1
  14. package/dist/{IngredientGroupView-CJ9Rsfg-.js → IngredientGroupView-BVM3Um9Z.js} +12 -12
  15. package/dist/IngredientsView-75ahXQeJ.js +2271 -0
  16. package/dist/{IntegrationView-B4giJ-Zl.js → IntegrationView-DEUOEn_W.js} +84 -84
  17. package/dist/{InventoryBindingForm-bNRoyTsA.js → InventoryBindingForm-C2HvBwlT.js} +1 -1
  18. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DAaoOXUY.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CXJSFCLP.js} +41 -41
  19. package/dist/{InventoryBindingSummary-NfFve-nM.js → InventoryBindingSummary-B-V9QkyH.js} +1 -1
  20. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DP11tzty.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BELqcyvD.js} +1 -1
  21. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-yjjkBSqL.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BBE5_txM.js} +5 -5
  22. package/dist/{PublishView-w9GYA6kf.js → PublishView-DKkCs9F8.js} +17 -17
  23. package/dist/{PurchaseOrderPrintPreview-DmdDJmEq.js → PurchaseOrderPrintPreview-BvFR-uQk.js} +9 -9
  24. package/dist/{ReceiveRequestView-z4o7lZvK.js → ReceiveRequestView-BIrBMqdY.js} +80 -80
  25. package/dist/{RecipeView-DiiQtfXn.js → RecipeView-CI_Tec4J.js} +49 -49
  26. package/dist/{StockView-DKR2nFdm.js → StockView-Bx3lqHZg.js} +327 -327
  27. package/dist/{SupplierView-BJcU4iQk.js → SupplierView-BT2aZGQE.js} +1103 -1016
  28. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-UNVxzRmJ.js → TransferDetails.vue_vue_type_script_setup_true_lang-DWdnLRCB.js} +245 -245
  29. package/dist/{TransferTemplateView-rCbAWlh_.js → TransferTemplateView-DQtlCFze.js} +88 -87
  30. package/dist/{UnitView-BW9hbVHL.js → UnitView-h61yFjgP.js} +59 -59
  31. package/dist/{WarehouseView-BO0hf42-.js → WarehouseView-I8GqyD2C.js} +25 -25
  32. package/dist/api/netsuite.d.ts +3 -0
  33. package/dist/api/purchase-order-template.d.ts +1 -0
  34. package/dist/{app-ChezCkd5.js → app-CxSrmhCK.js} +6888 -6786
  35. package/dist/app.d.ts +57 -0
  36. package/dist/app.js +3 -3
  37. package/dist/components/FmInventoryTableToolbar.vue.d.ts +9 -2
  38. package/dist/components/SubsidiaryTreeDialog.vue.d.ts +2 -0
  39. package/dist/{decimal-1sc-GcXN.js → decimal-DpfcXNky.js} +1 -1
  40. package/dist/{format-unit-display-BK2TkQOA.js → format-unit-display-xov4MvuI.js} +368 -400
  41. package/dist/{index-CWivxw9k.js → index-B4hWNXtZ.js} +1 -1
  42. package/dist/{index-cLW2Uxz3.js → index-CwzV_5fz.js} +1 -1
  43. package/dist/purchase-order-template-DkBl6qMP.js +41 -0
  44. package/dist/{stock-FEj_v-SS.js → stock-Nt176YY7.js} +1 -1
  45. package/dist/stores/integration/netsuite.d.ts +10 -0
  46. package/dist/{supplier-2r8VFThu.js → supplier-B7gAUwhb.js} +1 -1
  47. package/dist/tsconfig.app.tsbuildinfo +1 -1
  48. package/dist/{use-ingredient-select-dialog-CvgFQA-k.js → use-ingredient-select-dialog-9HkEvXXS.js} +5 -5
  49. package/dist/{use-inventory-binding-dialog-BNp88Pjt.js → use-inventory-binding-dialog-pSVgqxMM.js} +8 -8
  50. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +16 -0
  51. package/dist/views/ingredients/components/ingredient-form/IngredientFormProps.d.ts +4 -0
  52. package/dist/views/integration/components/netsuite/business/BusinessNetSuiteSideSheet.vue.d.ts +2 -0
  53. package/dist/views/supplier/components/SupplierSupplyItemField.vue.d.ts +3 -0
  54. package/package.json +1 -1
  55. package/dist/IngredientsView-BbKzQnQP.js +0 -1886
@@ -1,65 +1,34 @@
1
- import { a4 as Ae, a as q, V as Ie, al as M, v as De, am as he, w as ve, u as Z, j as B, x as Oe, aP as ce, y as ge, b as te, t as G, Z as J, aO as Fe, aG as Pe, a1 as Ue, z as Me, B as Be, an as Le, e as me, f as re, R as ue, a3 as Qe, aj as He, D as j, i as I, h as Ve } from "./app-ChezCkd5.js";
2
- import { useCoreStore as ne, useI18n as oe } from "@feedmepos/mf-common";
3
- import { useDialogChild as qe, useSnackbar as be, useDialog as je, FmButtonVariant as z, components as X } from "@feedmepos/ui-library";
1
+ import { a as q, Z as Ae, an as U, z as Ne, ao as ye, B as he, u as Z, k as L, C as De, x as le, E as ve, b as te, t as G, w as J, aQ as Oe, aI as Fe, a4 as Pe, G as Me, H as Ue, ap as Le, e as ce, f as re, R as me, s as Be, al as Qe, D as j, i as N, h as He } from "./app-CxSrmhCK.js";
2
+ import { useCoreStore as ge, useI18n as ne } from "@feedmepos/mf-common";
3
+ import { useDialogChild as Ve, useSnackbar as be, useDialog as qe, FmButtonVariant as z, components as X } from "@feedmepos/ui-library";
4
4
  import { defineStore as xe } from "pinia";
5
- import { defineComponent as ae, resolveComponent as Q, openBlock as _, createElementBlock as k, createElementVNode as C, normalizeClass as H, createTextVNode as ze, toDisplayString as D, unref as A, createCommentVNode as V, createVNode as P, withCtx as ee, Fragment as L, renderList as Y, ref as R, onMounted as Ke, computed as de, watch as Ye, createSlots as We, createBlock as K, h as W } from "vue";
6
- import { useRouter as Ge } from "vue-router";
7
- import { u as se } from "./supplier-2r8VFThu.js";
8
- const Se = Ae((e, t) => {
9
- function s() {
10
- var o;
11
- return `business_${((o = ne().currentBusiness.value) == null ? void 0 : o._id) ?? ""}`;
12
- }
13
- return {
14
- async getTemplate(l) {
15
- const i = s(), o = `${e.inventoryBackendUrl}/${i}/purchase-order-template/${l}`;
16
- return t.get(o);
17
- },
18
- async readTemplates() {
19
- const l = s(), i = `${e.inventoryBackendUrl}/${l}/purchase-order-template`;
20
- return t.get(i);
21
- },
22
- async createTemplate(l) {
23
- const i = s(), o = `${e.inventoryBackendUrl}/${i}/purchase-order-template`;
24
- return t.post(o, l);
25
- },
26
- async updateTemplate(l) {
27
- const i = s(), o = `${e.inventoryBackendUrl}/${i}/purchase-order-template`;
28
- return t.put(o, l);
29
- },
30
- async deleteTemplate(l) {
31
- const i = s(), o = `${e.inventoryBackendUrl}/${i}/purchase-order-template`;
32
- return t.delete(o, { _id: l._id, _rev: l._rev });
33
- },
34
- async importTemplates(l) {
35
- const i = s(), o = `${e.inventoryBackendUrl}/${i}/purchase-order-template/import`;
36
- return t.post(o, l);
37
- }
38
- };
39
- });
5
+ import { u as Se } from "./purchase-order-template-DkBl6qMP.js";
6
+ import { defineComponent as oe, resolveComponent as Q, openBlock as _, createElementBlock as E, createElementVNode as C, normalizeClass as H, createTextVNode as je, toDisplayString as D, unref as A, createCommentVNode as V, createVNode as P, withCtx as ee, Fragment as B, renderList as Y, ref as R, onMounted as ze, computed as ue, watch as Ke, createSlots as Ye, createBlock as K, h as W } from "vue";
7
+ import { useRouter as We } from "vue-router";
8
+ import { u as ae } from "./supplier-B7gAUwhb.js";
40
9
  function Te(e) {
41
- const t = q(), s = e.sku, l = t.skuById[s._id];
42
- if (l.unit._id !== s.unit._id) return !0;
10
+ const t = q(), a = e.sku, u = t.skuById[a._id];
11
+ if (u.unit._id !== a.unit._id) return !0;
43
12
  const i = e.measurement;
44
- return i ? !t.unitById[l.unit._id].measurements.find((c) => c.id === i.id) : !1;
13
+ return i ? !t.unitById[u.unit._id].measurements.find((l) => l.id === i.id) : !1;
45
14
  }
46
- var N = /* @__PURE__ */ ((e) => (e.PURCHASE = "PURCHASE", e.TRANSFER = "TRANSFER", e))(N || {}), ie = /* @__PURE__ */ ((e) => (e.Source = "Source", e.Destination = "Destination", e.Ingredient = "Ingredient", e))(ie || {});
47
- const pe = Ie(0);
15
+ var I = /* @__PURE__ */ ((e) => (e.PURCHASE = "PURCHASE", e.TRANSFER = "TRANSFER", e))(I || {}), se = /* @__PURE__ */ ((e) => (e.Source = "Source", e.Destination = "Destination", e.Ingredient = "Ingredient", e))(se || {});
16
+ const de = Ae(0);
48
17
  function _e(e) {
49
- var l;
18
+ var u;
50
19
  const t = e.sku;
51
20
  return {
52
21
  code: t.code,
53
22
  overrideCode: e.code,
54
23
  name: t.name,
55
- unit: ((l = t.unit.measurements.find((i) => i.id === t.trackingMeasurement)) == null ? void 0 : l.abbrev) ?? t.unit.abbrev,
56
- defaultQuantity: +B(e.quantity),
57
- minimumQuantity: +B(e.minimumQuantity ?? pe),
58
- maximumQuantity: +B(e.maximumQuantity ?? pe),
59
- quantityStep: +B(e.quantityStep)
24
+ unit: ((u = t.unit.measurements.find((i) => i.id === t.trackingMeasurement)) == null ? void 0 : u.abbrev) ?? t.unit.abbrev,
25
+ defaultQuantity: +L(e.quantity),
26
+ minimumQuantity: +L(e.minimumQuantity ?? de),
27
+ maximumQuantity: +L(e.maximumQuantity ?? de),
28
+ quantityStep: +L(e.quantityStep)
60
29
  };
61
30
  }
62
- function $e() {
31
+ function we() {
63
32
  return [
64
33
  {
65
34
  id: "code",
@@ -95,53 +64,53 @@ function $e() {
95
64
  }
96
65
  ];
97
66
  }
98
- function Ze(e) {
99
- var c;
100
- const s = ne().currentBusiness.value, i = (c = e.map((a) => {
67
+ function Ge(e) {
68
+ var l;
69
+ const a = ge().currentBusiness.value, i = (l = e.map((o) => {
101
70
  var b;
102
- const m = a.purchaseOrder.items.map((r) => _e(r)), h = $e(), d = [
103
- ["Template ID", a._id],
104
- ["Template name", a.name],
105
- ["Business name", s == null ? void 0 : s.name],
106
- ["Business ID", s == null ? void 0 : s._id],
107
- ["Menu version", s == null ? void 0 : s.menuVersion],
71
+ const c = o.purchaseOrder.items.map((r) => _e(r)), h = we(), d = [
72
+ ["Template ID", o._id],
73
+ ["Template name", o.name],
74
+ ["Business name", a == null ? void 0 : a.name],
75
+ ["Business ID", a == null ? void 0 : a._id],
76
+ ["Menu version", a == null ? void 0 : a.menuVersion],
108
77
  [
109
78
  "Purchase/Transfer",
110
- typeof a.purchaseOrder.supplier.internal == "string" ? N.TRANSFER : N.PURCHASE
79
+ typeof o.purchaseOrder.supplier.internal == "string" ? I.TRANSFER : I.PURCHASE
111
80
  ],
112
81
  [
113
82
  "Transfer from",
114
- `${a.purchaseOrder.supplier.name} (${[
115
- a.purchaseOrder.supplier.internal,
116
- a.purchaseOrder.supplier._id
83
+ `${o.purchaseOrder.supplier.name} (${[
84
+ o.purchaseOrder.supplier.internal,
85
+ o.purchaseOrder.supplier._id
117
86
  ].filter((r) => r).join("_")})`
118
87
  ],
119
88
  [
120
89
  "Locations",
121
- ...(b = a.locations) != null && b.length ? a.locations.map((r) => `${r.name} (${r.dbName})`) : ["All"]
90
+ ...(b = o.locations) != null && b.length ? o.locations.map((r) => `${r.name} (${r.dbName})`) : ["All"]
122
91
  ],
123
- ["Reference", a.purchaseOrder.ref ?? ""],
124
- ["Remark", a.purchaseOrder.remark ?? ""],
92
+ ["Reference", o.purchaseOrder.ref ?? ""],
93
+ ["Remark", o.purchaseOrder.remark ?? ""],
125
94
  [],
126
95
  h.map((r) => r.name),
127
- ...m.map((r) => h.map((x) => r[x.id]))
128
- ], u = h.map((r) => `system:${r.id}`), v = M(d, u);
129
- return { name: a.name, sheet: v };
96
+ ...c.map((r) => h.map((x) => r[x.id]))
97
+ ], m = h.map((r) => `system:${r.id}`), v = U(d, m);
98
+ return { name: o.name, sheet: v };
130
99
  }).reduce(
131
- (a, m) => {
100
+ (o, c) => {
132
101
  var d;
133
- const h = m.name.slice(0, 12);
134
- return (d = a.sheetOccurence)[h] ?? (d[h] = 0), a.sheetOccurence[h] += 1, a.sheets[`${h} (${a.sheetOccurence[h]})`] = m.sheet, a;
102
+ const h = c.name.slice(0, 12);
103
+ return (d = o.sheetOccurence)[h] ?? (d[h] = 0), o.sheetOccurence[h] += 1, o.sheets[`${h} (${o.sheetOccurence[h]})`] = c.sheet, o;
135
104
  },
136
105
  {
137
106
  sheets: {},
138
107
  sheetOccurence: {}
139
108
  }
140
- )) == null ? void 0 : c.sheets, o = `${s == null ? void 0 : s.name} transfer templates (${De(/* @__PURE__ */ new Date())}).xlsx`, f = he(i);
141
- return ve(f, o), o;
109
+ )) == null ? void 0 : l.sheets, s = `${a == null ? void 0 : a.name} transfer templates (${Ne(/* @__PURE__ */ new Date())}).xlsx`, f = ye(i);
110
+ return he(f, s), s;
142
111
  }
143
- function Je() {
144
- const e = ne(), t = se(), s = Z(), l = q(), i = e.currentBusiness.value, o = _e({
112
+ function Ze() {
113
+ const e = ge(), t = ae(), a = Z(), u = q(), i = e.currentBusiness.value, s = _e({
145
114
  sku: {
146
115
  unit: {
147
116
  _id: "",
@@ -172,7 +141,7 @@ function Je() {
172
141
  amount: 1,
173
142
  precision: 0
174
143
  }
175
- }), f = $e(), c = [
144
+ }), f = we(), l = [
176
145
  ["Template ID (leave empty to create new)"],
177
146
  ["Template Name", "New template"],
178
147
  ["Business name", i == null ? void 0 : i.name],
@@ -193,8 +162,8 @@ function Je() {
193
162
  ["Remark"],
194
163
  [],
195
164
  f.map((r) => r.name),
196
- f.map((r) => o[r.id])
197
- ], a = f.map((r) => `system:${r.id}`), m = M(c, a), h = M(
165
+ f.map((r) => s[r.id])
166
+ ], o = f.map((r) => `system:${r.id}`), c = U(l, o), h = U(
198
167
  [
199
168
  ...t.businessSuppliers.map((r) => [
200
169
  `${r.name} (${r._id})`,
@@ -206,13 +175,13 @@ function Je() {
206
175
  r.address.state,
207
176
  r.address.country
208
177
  ]),
209
- ...s.locations.map((r) => {
210
- var x, $, S, p, n, y;
178
+ ...a.locations.map((r) => {
179
+ var x, w, S, p, n, y;
211
180
  return [
212
181
  `${r.name} (${r.dbName})`,
213
182
  "Transfer",
214
183
  (x = r.doc.profile.address) == null ? void 0 : x.line1,
215
- ($ = r.doc.profile.address) == null ? void 0 : $.line2,
184
+ (w = r.doc.profile.address) == null ? void 0 : w.line2,
216
185
  (S = r.doc.profile.address) == null ? void 0 : S.city,
217
186
  (p = r.doc.profile.address) == null ? void 0 : p.postcode,
218
187
  (n = r.doc.profile.address) == null ? void 0 : n.state,
@@ -221,13 +190,13 @@ function Je() {
221
190
  })
222
191
  ],
223
192
  ["Name", "Type", "Line 1", "Line 2", "City", "Postal", "State", "Country"]
224
- ), d = M(
225
- s.locations.map((r) => {
226
- var x, $, S, p, n, y;
193
+ ), d = U(
194
+ a.locations.map((r) => {
195
+ var x, w, S, p, n, y;
227
196
  return [
228
197
  `${r.name} (${r.dbName})`,
229
198
  (x = r.doc.profile.address) == null ? void 0 : x.line1,
230
- ($ = r.doc.profile.address) == null ? void 0 : $.line2,
199
+ (w = r.doc.profile.address) == null ? void 0 : w.line2,
231
200
  (S = r.doc.profile.address) == null ? void 0 : S.city,
232
201
  (p = r.doc.profile.address) == null ? void 0 : p.postcode,
233
202
  (n = r.doc.profile.address) == null ? void 0 : n.state,
@@ -235,41 +204,41 @@ function Je() {
235
204
  ];
236
205
  }),
237
206
  ["Name", "Line 1", "Line 2", "City", "Postal", "State", "Country"]
238
- ), u = M(
239
- l.skus.map((r) => [
207
+ ), m = U(
208
+ u.skus.map((r) => [
240
209
  r.code,
241
210
  r.name,
242
211
  r.unit.abbrev,
243
212
  ...r.unit.measurements.map((x) => x.abbrev)
244
213
  ]),
245
214
  ["Code", "Name", "Base unit", "Measurements"]
246
- ), v = he({
247
- Template: m,
215
+ ), v = ye({
216
+ Template: c,
248
217
  Source: h,
249
218
  Destination: d,
250
- Ingredient: u
219
+ Ingredient: m
251
220
  }), b = `${i == null ? void 0 : i.name} transfer templates import.xlsx`;
252
- return ve(v, b), b;
221
+ return he(v, b), b;
253
222
  }
254
- function Xe(e, t) {
255
- const s = new Array(), l = /(.*) \(((supplier_|warehouse_|restaurant_).{24,})\)/, o = Z().locationByDbName, c = se().supplierById, a = e.trim(), m = l.exec(a);
256
- if (!m)
257
- return s.push(`Transfer from location value of ${a} cannot be read.`), {
258
- errors: s
223
+ function Je(e, t) {
224
+ const a = new Array(), u = /(.*) \(((supplier_|warehouse_|restaurant_).{24,})\)/, s = Z().locationByDbName, l = ae().supplierById, o = e.trim(), c = u.exec(o);
225
+ if (!c)
226
+ return a.push(`Transfer from location value of ${o} cannot be read.`), {
227
+ errors: a
259
228
  };
260
- const h = m[1], d = m[2];
261
- let u;
229
+ const h = c[1], d = c[2];
230
+ let m;
262
231
  if (d.startsWith("supplier"))
263
- u = c[d], t !== N.PURCHASE && s.push(`Expected transfer type Purchase but found ${t} instead.`);
232
+ m = l[d], t !== I.PURCHASE && a.push(`Expected transfer type Purchase but found ${t} instead.`);
264
233
  else {
265
- const v = o[d];
234
+ const v = s[d];
266
235
  if (!v)
267
- return s.push(`Location (${h}) of id ${d} is not found.`), {
268
- errors: s
236
+ return a.push(`Location (${h}) of id ${d} is not found.`), {
237
+ errors: a
269
238
  };
270
- h !== v.name && s.push(
239
+ h !== v.name && a.push(
271
240
  `Location id ${d} has non-matching name. Found ${h} but expected ${v.name}`
272
- ), u = {
241
+ ), m = {
273
242
  _id: v.doc._id,
274
243
  name: v.name,
275
244
  address: v.doc.profile.address ?? {
@@ -280,7 +249,7 @@ function Xe(e, t) {
280
249
  postcode: "",
281
250
  coordinates: [0, 0]
282
251
  },
283
- internal: d.split("_")[0] === "restaurant" ? ce.enum.restaurant : ce.enum.warehouse,
252
+ internal: d.split("_")[0] === "restaurant" ? le.enum.restaurant : le.enum.warehouse,
284
253
  phoneNumber: v.doc.profile.phoneNo ?? "",
285
254
  email: v.doc.profile.email ?? "",
286
255
  _rev: "",
@@ -289,75 +258,75 @@ function Xe(e, t) {
289
258
  };
290
259
  }
291
260
  return {
292
- from: u,
293
- errors: s
261
+ from: m,
262
+ errors: a
294
263
  };
295
264
  }
296
- function et(e) {
265
+ function Xe(e) {
297
266
  if (!e.length || `${e[0]}`.toLocaleLowerCase() === "all")
298
267
  return [];
299
- const t = /(.*) \(((warehouse_|restaurant_).{24,})\)/, l = Z().locationByDbName;
268
+ const t = /(.*) \(((warehouse_|restaurant_).{24,})\)/, u = Z().locationByDbName;
300
269
  return e.map((i) => {
301
- const o = new Array(), f = i.trim(), c = t.exec(f);
302
- if (!c)
303
- return o.push(`Enabled location value of ${f} cannot be read.`), {
304
- errors: o
270
+ const s = new Array(), f = i.trim(), l = t.exec(f);
271
+ if (!l)
272
+ return s.push(`Enabled location value of ${f} cannot be read.`), {
273
+ errors: s
305
274
  };
306
- const a = c[1], m = c[2], h = l[m];
307
- return h ? (a !== h.name && o.push(
308
- `Location id ${m} has non-matching name. Found ${a} but expected ${h.name}`
275
+ const o = l[1], c = l[2], h = u[c];
276
+ return h ? (o !== h.name && s.push(
277
+ `Location id ${c} has non-matching name. Found ${o} but expected ${h.name}`
309
278
  ), {
310
- errors: o,
279
+ errors: s,
311
280
  location: h
312
- }) : (o.push(`Location (${a}) of id ${m} is not found.`), {
313
- errors: o
281
+ }) : (s.push(`Location (${o}) of id ${c} is not found.`), {
282
+ errors: s
314
283
  });
315
284
  });
316
285
  }
317
- function tt(e) {
286
+ function et(e) {
318
287
  const [
319
288
  t,
289
+ a,
290
+ u,
291
+ i,
320
292
  s,
293
+ f,
321
294
  l,
322
- i,
323
295
  o,
324
- f,
325
296
  c,
326
- a,
327
- m,
328
297
  h,
329
298
  d
330
- ] = ge(e);
299
+ ] = ve(e);
331
300
  return {
332
- id: `${s[1] ?? ""}`.trim(),
333
- name: `${l[1] ?? ""}`.trim(),
334
- type: `${c[1] ?? ""}`.trim().toLocaleLowerCase() === "transfer" ? N.TRANSFER : N.PURCHASE,
335
- transferFrom: `${a[1] ?? ""}`.trim(),
336
- locations: m.slice(1).map((u) => `${u}`.trim()).filter((u) => u),
301
+ id: `${a[1] ?? ""}`.trim(),
302
+ name: `${u[1] ?? ""}`.trim(),
303
+ type: `${l[1] ?? ""}`.trim().toLocaleLowerCase() === "transfer" ? I.TRANSFER : I.PURCHASE,
304
+ transferFrom: `${o[1] ?? ""}`.trim(),
305
+ locations: c.slice(1).map((m) => `${m}`.trim()).filter((m) => m),
337
306
  reference: `${h[1] ?? ""}`.trim(),
338
307
  remark: `${d[1] ?? ""}`.trim()
339
308
  };
340
309
  }
341
- function rt(e) {
310
+ function tt(e) {
342
311
  const [
343
312
  t,
313
+ a,
314
+ u,
315
+ i,
344
316
  s,
317
+ f,
345
318
  l,
346
- i,
347
319
  o,
348
- f,
349
320
  c,
350
- a,
351
- m,
352
321
  h,
353
322
  d,
354
- u,
323
+ m,
355
324
  v,
356
325
  ...b
357
- ] = ge(e);
326
+ ] = ve(e);
358
327
  if (!t || !t.length || t.some((p) => p.length && !p.startsWith("system:")))
359
328
  throw new Error("Missing meta header. Excel file does not come from the template.");
360
- const r = t.map((p) => p.split(":")[1]), $ = [
329
+ const r = t.map((p) => p.split(":")[1]), w = [
361
330
  "code",
362
331
  "name",
363
332
  "unit",
@@ -366,15 +335,15 @@ function rt(e) {
366
335
  "maximumQuantity",
367
336
  "quantityStep"
368
337
  ].filter((p) => !r.includes(p));
369
- if ($.length)
338
+ if (w.length)
370
339
  throw new Error(
371
- `Missing meta headers (${$.join()}). Excel file does not come from the template.`
340
+ `Missing meta headers (${w.join()}). Excel file does not come from the template.`
372
341
  );
373
342
  return b.map((p, n) => {
374
343
  const y = {};
375
344
  for (const T in r) {
376
- const w = r[T];
377
- Object.assign(y, { [w]: p[T] });
345
+ const $ = r[T];
346
+ Object.assign(y, { [$]: p[T] });
378
347
  }
379
348
  return {
380
349
  index: n,
@@ -382,42 +351,42 @@ function rt(e) {
382
351
  };
383
352
  });
384
353
  }
385
- function nt(e, t, s) {
386
- const l = e === "" ? null : G(e, s), i = t === "" ? null : G(t, s), o = l && i && l.amount > i.amount;
354
+ function rt(e, t, a) {
355
+ const u = e === "" ? null : G(e, a), i = t === "" ? null : G(t, a), s = u && i && u.amount > i.amount;
387
356
  return {
388
- min: l,
357
+ min: u,
389
358
  max: i,
390
- compareError: o ? "Minimum amount must be less than or equal to maximum amount" : void 0
359
+ compareError: s ? "Minimum amount must be less than or equal to maximum amount" : void 0
391
360
  };
392
361
  }
393
- function ot(e, t, s) {
394
- const l = q(), i = te(), o = l.skuByCode[e.code], f = new Array();
395
- if (!o)
362
+ function nt(e, t, a) {
363
+ const u = q(), i = te(), s = u.skuByCode[e.code], f = new Array();
364
+ if (!s)
396
365
  return f.push(`Cannot find ingredient with code (${e.code}) ${e.name}.`), {
397
366
  index: t,
398
367
  errors: f
399
368
  };
400
- if (s.filter((p) => p.data.code === e.code).length > 1)
369
+ if (a.filter((p) => p.data.code === e.code).length > 1)
401
370
  return f.push(`Ingredient ${e.code} is defined twice.`), {
402
371
  index: t,
403
372
  errors: f
404
373
  };
405
- const c = o.unit, a = c == null ? void 0 : c.measurements.find((p) => p.abbrev === e.unit);
406
- if (c.abbrev !== e.unit && !a) {
374
+ const l = s.unit, o = l == null ? void 0 : l.measurements.find((p) => p.abbrev === e.unit);
375
+ if (l.abbrev !== e.unit && !o) {
407
376
  const p = `Cannot find unit measurement of symbol ${e.unit || "[empty]"} for ingredient (${e.code}) ${e.name}.`;
408
377
  f.push(p);
409
378
  const n = {
410
- sku: o,
411
- code: e.overrideCode || o.code,
412
- name: o.name,
413
- measurement: a,
379
+ sku: s,
380
+ code: e.overrideCode || s.code,
381
+ name: s.name,
382
+ measurement: o,
414
383
  quantity: { amount: 0, precision: 0 },
415
384
  quantityStep: { amount: 0, precision: 0 },
416
385
  minimumQuantity: { amount: 0, precision: 0 },
417
386
  maximumQuantity: { amount: 0, precision: 0 }
418
387
  };
419
388
  if (i.isEnabled) {
420
- const y = i.getItemCustomCode(o);
389
+ const y = i.getItemCustomCode(s);
421
390
  y && (n.code = y);
422
391
  }
423
392
  return {
@@ -426,32 +395,32 @@ function ot(e, t, s) {
426
395
  templateItem: n
427
396
  };
428
397
  }
429
- const m = G(
398
+ const c = G(
430
399
  e.quantityStep,
431
- J(c, a)
400
+ J(l, o)
432
401
  );
433
402
  (Number.isNaN(Number(e.quantityStep)) || Number(e.quantityStep) <= 0) && f.push("Amount step must be more than 0");
434
- const h = Fe(m), d = nt(
403
+ const h = Oe(c), d = rt(
435
404
  e.minimumQuantity,
436
405
  e.maximumQuantity,
437
- J(c, a)
438
- ), u = d.min, v = d.max;
406
+ J(l, o)
407
+ ), m = d.min, v = d.max;
439
408
  d.compareError && f.push(d.compareError);
440
- const b = Pe(+e.minimumQuantity, +e.maximumQuantity), r = G(
409
+ const b = Fe(+e.minimumQuantity, +e.maximumQuantity), r = G(
441
410
  e.defaultQuantity,
442
- J(c, a)
411
+ J(l, o)
443
412
  ), x = h(r);
444
413
  typeof x == "string" && f.push(`Default amount: ${x}`);
445
- const $ = d.min && d.max ? b(`${e.defaultQuantity}`) : null;
446
- typeof $ == "string" && f.push(`Default amount: ${$}`);
414
+ const w = d.min && d.max ? b(`${e.defaultQuantity}`) : null;
415
+ typeof w == "string" && f.push(`Default amount: ${w}`);
447
416
  const S = {
448
- sku: o,
449
- code: e.overrideCode || o.code,
450
- name: e.name || o.name,
451
- measurement: a,
417
+ sku: s,
418
+ code: e.overrideCode || s.code,
419
+ name: e.name || s.name,
420
+ measurement: o,
452
421
  quantity: r,
453
- quantityStep: m,
454
- minimumQuantity: u,
422
+ quantityStep: c,
423
+ minimumQuantity: m,
455
424
  maximumQuantity: v
456
425
  };
457
426
  return {
@@ -460,80 +429,80 @@ function ot(e, t, s) {
460
429
  templateItem: S
461
430
  };
462
431
  }
463
- function at(e) {
432
+ function ot(e) {
464
433
  const t = e.SheetNames.filter(
465
- (o) => !Object.values(ie).map(String).includes(o)
466
- ), l = Ce().templates, i = Oe(l, "_id");
434
+ (s) => !Object.values(se).map(String).includes(s)
435
+ ), u = Ce().templates, i = De(u, "_id");
467
436
  try {
468
437
  return t.reduce(
469
- (o, f) => {
438
+ (s, f) => {
470
439
  var p;
471
- const c = new Array(), a = e.Sheets[f], m = tt(a), h = Xe(m.transferFrom, m.type);
472
- c.push(...h.errors);
473
- const d = h.from, u = et(m.locations), v = u.filter((n) => n.location).map((n) => n.location);
474
- c.push(...u.flatMap((n) => n.errors));
475
- const b = rt(a).filter((n) => n.data.code), r = b.map(
476
- (n, y) => ot(n.data, y, b)
440
+ const l = new Array(), o = e.Sheets[f], c = et(o), h = Je(c.transferFrom, c.type);
441
+ l.push(...h.errors);
442
+ const d = h.from, m = Xe(c.locations), v = m.filter((n) => n.location).map((n) => n.location);
443
+ l.push(...m.flatMap((n) => n.errors));
444
+ const b = tt(o).filter((n) => n.data.code), r = b.map(
445
+ (n, y) => nt(n.data, y, b)
477
446
  );
478
- c.push(
447
+ l.push(
479
448
  ...r.flatMap(
480
449
  (n) => n.errors.map((y) => `(Excel row ${n.index + 14}) ${y}`)
481
450
  )
482
451
  );
483
452
  const x = r.filter((n) => n.templateItem).map((n) => n.templateItem);
484
- if (m.id) {
485
- const n = i[m.id];
453
+ if (c.id) {
454
+ const n = i[c.id];
486
455
  if (!n) {
487
456
  const T = {
488
- _id: m.id,
457
+ _id: c.id,
489
458
  _rev: "",
490
- name: m.name || `(unnamed from sheet ${f || "<unnamed sheet>"})`,
491
- purchaseOrder: st()
459
+ name: c.name || `(unnamed from sheet ${f || "<unnamed sheet>"})`,
460
+ purchaseOrder: at()
492
461
  };
493
- return c.push(`Template ID ${m.id} is not found.`), o.importUpdateResult.push({
462
+ return l.push(`Template ID ${c.id} is not found.`), s.importUpdateResult.push({
494
463
  type: "update",
495
464
  original: T,
496
465
  template: T,
497
466
  excelSheetName: f,
498
- errors: c
499
- }), o;
467
+ errors: l
468
+ }), s;
500
469
  }
501
470
  const y = {
502
471
  type: "update",
503
472
  original: n,
504
473
  template: {
505
474
  ...n,
506
- name: m.name,
475
+ name: c.name,
507
476
  locations: v.length ? v : null,
508
477
  purchaseOrder: {
509
478
  ...n.purchaseOrder,
510
479
  supplier: d ?? ((p = n.purchaseOrder) == null ? void 0 : p.supplier),
511
- ref: m.reference,
512
- remark: m.remark,
480
+ ref: c.reference,
481
+ remark: c.remark,
513
482
  items: x
514
483
  }
515
484
  },
516
485
  excelSheetName: f,
517
- errors: c
486
+ errors: l
518
487
  };
519
- return o.importUpdateResult.push(y), o;
488
+ return s.importUpdateResult.push(y), s;
520
489
  }
521
490
  const S = {
522
491
  type: "create",
523
492
  template: {
524
- name: m.name,
493
+ name: c.name,
525
494
  locations: v.length ? v : null,
526
495
  purchaseOrder: {
527
- supplier: d ?? we(),
528
- ref: m.reference,
529
- remark: m.remark,
496
+ supplier: d ?? $e(),
497
+ ref: c.reference,
498
+ remark: c.remark,
530
499
  items: x
531
500
  }
532
501
  },
533
502
  excelSheetName: f,
534
- errors: c
503
+ errors: l
535
504
  };
536
- return o.importCreateResult.push(S), o;
505
+ return s.importCreateResult.push(S), s;
537
506
  },
538
507
  {
539
508
  invalidExcel: !1,
@@ -541,16 +510,16 @@ function at(e) {
541
510
  importUpdateResult: new Array()
542
511
  }
543
512
  );
544
- } catch (o) {
513
+ } catch (s) {
545
514
  return {
546
515
  invalidExcel: !0,
547
- invalidExcelMessage: (o == null ? void 0 : o.message) ?? "Invalid excel",
516
+ invalidExcelMessage: (s == null ? void 0 : s.message) ?? "Invalid excel",
548
517
  importCreateResult: [],
549
518
  importUpdateResult: []
550
519
  };
551
520
  }
552
521
  }
553
- function we() {
522
+ function $e() {
554
523
  return {
555
524
  _id: "",
556
525
  name: "",
@@ -564,18 +533,18 @@ function we() {
564
533
  }
565
534
  };
566
535
  }
567
- function st() {
536
+ function at() {
568
537
  return {
569
538
  remark: void 0,
570
539
  ref: void 0,
571
540
  items: [],
572
- supplier: we()
541
+ supplier: $e()
573
542
  };
574
543
  }
575
- const it = { class: "flex items-center gap-12 pl-8" }, lt = { class: "flex flex-col" }, ct = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, mt = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, ut = {
544
+ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-col" }, lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, ct = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, mt = {
576
545
  key: 0,
577
546
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
578
- }, dt = { key: 0 }, fe = /* @__PURE__ */ ae({
547
+ }, ut = { key: 0 }, pe = /* @__PURE__ */ oe({
579
548
  __name: "TransferTemplateImportItem",
580
549
  props: {
581
550
  type: {},
@@ -586,31 +555,31 @@ const it = { class: "flex items-center gap-12 pl-8" }, lt = { class: "flex flex-
586
555
  errors: {}
587
556
  },
588
557
  setup(e) {
589
- return (t, s) => {
590
- var o, f, c;
591
- const l = Q("FmIcon"), i = Q("FmTooltip");
592
- return _(), k("div", it, [
593
- s[0] || (s[0] = C("div", null, "•", -1)),
594
- C("div", lt, [
595
- C("div", ct, [
558
+ return (t, a) => {
559
+ var s, f, l;
560
+ const u = Q("FmIcon"), i = Q("FmTooltip");
561
+ return _(), E("div", st, [
562
+ a[0] || (a[0] = C("div", null, "•", -1)),
563
+ C("div", it, [
564
+ C("div", lt, [
596
565
  C("div", {
597
566
  class: H({
598
567
  "text-fm-color-system-error-300": t.errors.length
599
568
  })
600
569
  }, [
601
- ze(D(t.name) + " ", 1),
602
- C("span", mt, " (" + D(A(Ue)(`${t.transferType}`)) + ") ", 1),
603
- t.type === "create" ? (_(), k("span", ut, "(new)")) : V("", !0)
570
+ je(D(t.name) + " ", 1),
571
+ C("span", ct, " (" + D(A(Pe)(`${t.transferType}`)) + ") ", 1),
572
+ t.type === "create" ? (_(), E("span", mt, "(new)")) : V("", !0)
604
573
  ], 2),
605
- t.errors.length ? (_(), k("div", dt, [
574
+ t.errors.length ? (_(), E("div", ut, [
606
575
  P(i, { "z-index": 50 }, {
607
576
  content: ee(() => [
608
577
  C("ol", null, [
609
- (_(!0), k(L, null, Y(t.errors, (a, m) => (_(), k("li", { key: m }, D(a), 1))), 128))
578
+ (_(!0), E(B, null, Y(t.errors, (o, c) => (_(), E("li", { key: c }, D(o), 1))), 128))
610
579
  ])
611
580
  ]),
612
581
  default: ee(() => [
613
- P(l, {
582
+ P(u, {
614
583
  name: "error",
615
584
  size: "sm",
616
585
  color: "system-error-300"
@@ -628,93 +597,93 @@ const it = { class: "flex items-center gap-12 pl-8" }, lt = { class: "flex flex-
628
597
  "text-fm-color-typo-secondary": !t.errors.length
629
598
  }
630
599
  ])
631
- }, D((o = t.locations) != null && o.length ? `${(f = t.locations) == null ? void 0 : f.length} locations` : "All locations") + ", " + D(`${(c = t.items) == null ? void 0 : c.length} items`), 3)
600
+ }, D((s = t.locations) != null && s.length ? `${(f = t.locations) == null ? void 0 : f.length} locations` : "All locations") + ", " + D(`${(l = t.items) == null ? void 0 : l.length} items`), 3)
632
601
  ])
633
602
  ]);
634
603
  };
635
604
  }
636
- }), pt = { class: "flex flex-col gap-24" }, ft = {
605
+ }), dt = { class: "flex flex-col gap-24" }, pt = {
637
606
  key: 0,
638
607
  class: "flex items-center gap-8"
639
- }, yt = { class: "flex flex-col gap-8" }, ht = { class: "line-clamp-2 text-ellipsis break-all" }, vt = {
608
+ }, ft = { class: "flex flex-col gap-8" }, yt = { class: "line-clamp-2 text-ellipsis break-all" }, ht = {
640
609
  key: 2,
641
610
  class: "shrink-0"
642
- }, gt = {
611
+ }, vt = {
643
612
  key: 0,
644
613
  class: "flex flex-col"
645
- }, bt = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, xt = {
614
+ }, gt = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, bt = {
646
615
  key: 0,
647
616
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
648
- }, St = { class: "fm-typo-en-body-lg-600" }, Tt = /* @__PURE__ */ ae({
617
+ }, xt = { class: "fm-typo-en-body-lg-600" }, St = /* @__PURE__ */ oe({
649
618
  __name: "TransferTemplateImport",
650
619
  setup(e) {
651
- const t = R(null), s = qe(), l = be(), i = R(!1), o = R(!1), f = se();
652
- Ke(async () => {
653
- o.value = !0;
620
+ const t = R(null), a = Ve(), u = be(), i = R(!1), s = R(!1), f = ae();
621
+ ze(async () => {
622
+ s.value = !0;
654
623
  try {
655
624
  await f.readSuppliers().delayed(1e3);
656
625
  } catch {
657
- l.open({
626
+ u.open({
658
627
  title: "Something went wrong.",
659
628
  message: "Error at reading suppliers list. Please try again.",
660
629
  type: "error"
661
630
  });
662
631
  } finally {
663
- o.value = !1;
632
+ s.value = !1;
664
633
  }
665
634
  });
666
- const c = R(new Array()), a = R([]), m = R([]), h = de(
667
- () => !!c.value.length || a.value.some((b) => b.errors.length) || m.value.some((b) => b.errors.length)
668
- ), d = de(
669
- () => !!a.value.length || !!m.value.length
670
- ), { t: u } = oe();
635
+ const l = R(new Array()), o = R([]), c = R([]), h = ue(
636
+ () => !!l.value.length || o.value.some((b) => b.errors.length) || c.value.some((b) => b.errors.length)
637
+ ), d = ue(
638
+ () => !!o.value.length || !!c.value.length
639
+ ), { t: m } = ne();
671
640
  async function v(b) {
672
- c.value = [], a.value = [], m.value = [];
641
+ l.value = [], o.value = [], c.value = [];
673
642
  try {
674
643
  i.value = !0;
675
644
  const [r] = await Promise.all([
676
- Be(b),
645
+ Ue(b),
677
646
  // fake buffer
678
647
  new Promise((p) => setTimeout(p, 1e3))
679
648
  ]);
680
649
  if (!r.SheetNames.filter(
681
- (p) => !Object.values(ie).map(String).includes(p)
650
+ (p) => !Object.values(se).map(String).includes(p)
682
651
  ).find((p) => p)) {
683
- c.value.push(u("inventory.ingredient.import.fileError.noSheet"));
652
+ l.value.push(m("inventory.ingredient.import.fileError.noSheet"));
684
653
  return;
685
654
  }
686
- const S = at(r);
655
+ const S = ot(r);
687
656
  if (S.invalidExcel) {
688
- c.value.push(
689
- S.invalidExcelMessage ?? u("inventory.ingredient.import.fileError.invalidExcel")
657
+ l.value.push(
658
+ S.invalidExcelMessage ?? m("inventory.ingredient.import.fileError.invalidExcel")
690
659
  );
691
660
  return;
692
661
  }
693
- if (a.value = S.importCreateResult, m.value = S.importUpdateResult, !a.value.length && !m.value.length) {
694
- c.value.push(u("inventory.ingredient.import.fileError.noData"));
662
+ if (o.value = S.importCreateResult, c.value = S.importUpdateResult, !o.value.length && !c.value.length) {
663
+ l.value.push(m("inventory.ingredient.import.fileError.noData"));
695
664
  return;
696
665
  }
697
- s.emitData(S);
666
+ a.emitData(S);
698
667
  } catch (r) {
699
- l.open({
700
- title: u("inventory.ingredient.import.fileError.unableToRead"),
668
+ u.open({
669
+ title: m("inventory.ingredient.import.fileError.unableToRead"),
701
670
  message: r == null ? void 0 : r.message,
702
671
  type: "error"
703
672
  }), console.error("Error in reading file", r);
704
673
  } finally {
705
- c.value.length && l.open({
706
- title: u("inventory.ingredient.import.fileError.invalidExcel"),
674
+ l.value.length && u.open({
675
+ title: m("inventory.ingredient.import.fileError.invalidExcel"),
707
676
  type: "error"
708
677
  }), i.value = !1;
709
678
  }
710
679
  }
711
- return Ye(t, (b) => {
680
+ return Ke(t, (b) => {
712
681
  b && v(b);
713
682
  }), (b, r) => {
714
- const x = Q("FmCircularProgress"), $ = Q("FmIcon"), S = Q("FmButton");
715
- return _(), k("div", pt, [
683
+ const x = Q("FmCircularProgress"), w = Q("FmIcon"), S = Q("FmButton");
684
+ return _(), E("div", dt, [
716
685
  r[2] || (r[2] = C("div", { class: "fm-typo-en-body-md-400" }, "Import transfer templates from excel sheets.", -1)),
717
- o.value ? (_(), k("div", ft, [
686
+ s.value ? (_(), E("div", pt, [
718
687
  C("div", null, [
719
688
  P(x, {
720
689
  size: "md",
@@ -722,7 +691,7 @@ const it = { class: "flex items-center gap-12 pl-8" }, lt = { class: "flex flex-
722
691
  })
723
692
  ]),
724
693
  r[1] || (r[1] = C("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Loading...", -1))
725
- ])) : (_(), k(L, { key: 1 }, [
694
+ ])) : (_(), E(B, { key: 1 }, [
726
695
  P(Me, {
727
696
  class: H({
728
697
  "w-full": !0,
@@ -730,13 +699,13 @@ const it = { class: "flex items-center gap-12 pl-8" }, lt = { class: "flex flex-
730
699
  }),
731
700
  accept: ".xlsx",
732
701
  onFileUpload: r[0] || (r[0] = (p) => t.value = p),
733
- label: A(u)("inventory.ingredient.import.uploadTemplate"),
734
- "button-label": A(u)("inventory.ingredient.import.selectFile")
735
- }, We({ _: 2 }, [
702
+ label: A(m)("inventory.ingredient.import.uploadTemplate"),
703
+ "button-label": A(m)("inventory.ingredient.import.selectFile")
704
+ }, Ye({ _: 2 }, [
736
705
  t.value ? {
737
706
  name: "default",
738
707
  fn: ee(({ openFileDialog: p }) => [
739
- C("div", yt, [
708
+ C("div", ft, [
740
709
  C("div", {
741
710
  class: H([
742
711
  "fm-corner-radius-md p-16 flex items-center gap-16",
@@ -751,7 +720,7 @@ const it = { class: "flex items-center gap-12 pl-8" }, lt = { class: "flex flex-
751
720
  key: 0,
752
721
  size: "md",
753
722
  color: "neutral-gray-200"
754
- })) : (_(), K($, {
723
+ })) : (_(), K(w, {
755
724
  key: 1,
756
725
  name: h.value ? "error" : "attach_file",
757
726
  outline: "",
@@ -766,28 +735,28 @@ const it = { class: "flex items-center gap-12 pl-8" }, lt = { class: "flex flex-
766
735
  }
767
736
  ])
768
737
  }, [
769
- C("div", ht, D(t.value.name), 1)
738
+ C("div", yt, D(t.value.name), 1)
770
739
  ], 2),
771
- i.value ? V("", !0) : (_(), k("div", vt, [
740
+ i.value ? V("", !0) : (_(), E("div", ht, [
772
741
  P(S, {
773
- label: A(u)("inventory.ingredient.import.replaceFile"),
742
+ label: A(m)("inventory.ingredient.import.replaceFile"),
774
743
  variant: h.value ? "destructive" : "secondary",
775
744
  "prepend-icon": h.value ? void 0 : "autorenew",
776
745
  onClick: p
777
746
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
778
747
  ]))
779
748
  ], 2),
780
- c.value.length ? (_(), k("div", gt, [
781
- (_(!0), k(L, null, Y(c.value, (n, y) => (_(), k("div", {
749
+ l.value.length ? (_(), E("div", vt, [
750
+ (_(!0), E(B, null, Y(l.value, (n, y) => (_(), E("div", {
782
751
  key: y,
783
752
  class: "flex gap-8 items-center"
784
753
  }, [
785
- P($, {
754
+ P(w, {
786
755
  name: "error",
787
756
  size: "sm",
788
757
  color: "system-error-300"
789
758
  }),
790
- C("div", bt, D(n), 1)
759
+ C("div", gt, D(n), 1)
791
760
  ]))), 128))
792
761
  ])) : V("", !0)
793
762
  ])
@@ -795,21 +764,21 @@ const it = { class: "flex items-center gap-12 pl-8" }, lt = { class: "flex flex-
795
764
  key: "0"
796
765
  } : void 0
797
766
  ]), 1032, ["class", "label", "button-label"]),
798
- d.value ? (_(), k("div", xt, [
799
- C("div", St, D(A(u)("inventory.ingredient.import.summary")), 1),
800
- (_(!0), k(L, null, Y(a.value, (p, n) => (_(), K(fe, {
767
+ d.value ? (_(), E("div", bt, [
768
+ C("div", xt, D(A(m)("inventory.ingredient.import.summary")), 1),
769
+ (_(!0), E(B, null, Y(o.value, (p, n) => (_(), K(pe, {
801
770
  key: n,
802
771
  name: p.template.name,
803
- "transfer-type": typeof p.template.purchaseOrder.supplier.internal == "string" ? A(N).TRANSFER : A(N).PURCHASE,
772
+ "transfer-type": typeof p.template.purchaseOrder.supplier.internal == "string" ? A(I).TRANSFER : A(I).PURCHASE,
804
773
  locations: p.template.locations,
805
774
  items: p.template.purchaseOrder.items,
806
775
  errors: p.errors,
807
776
  type: "create"
808
777
  }, null, 8, ["name", "transfer-type", "locations", "items", "errors"]))), 128)),
809
- (_(!0), k(L, null, Y(m.value, (p) => (_(), K(fe, {
778
+ (_(!0), E(B, null, Y(c.value, (p) => (_(), K(pe, {
810
779
  key: p.template._id,
811
780
  name: p.template.name,
812
- "transfer-type": typeof p.template.purchaseOrder.supplier.internal == "string" ? A(N).TRANSFER : A(N).PURCHASE,
781
+ "transfer-type": typeof p.template.purchaseOrder.supplier.internal == "string" ? A(I).TRANSFER : A(I).PURCHASE,
813
782
  locations: p.template.locations,
814
783
  items: p.template.purchaseOrder.items,
815
784
  errors: p.errors,
@@ -821,39 +790,39 @@ const it = { class: "flex items-center gap-12 pl-8" }, lt = { class: "flex flex-
821
790
  };
822
791
  }
823
792
  });
824
- function _t(e) {
825
- var o, f;
793
+ function Tt(e) {
794
+ var s, f;
826
795
  const t = te();
827
796
  if (!t.isEnabled) return !0;
828
797
  if (!e.internal) {
829
- const c = t.getNetSuiteVendor(e._id), a = c == null ? void 0 : c.subsidiaryId, m = (o = t.currentVendorSubsidiary(e._id)) == null ? void 0 : o.id;
830
- return a && a == m;
798
+ const l = t.getNetSuiteVendor(e._id), o = l == null ? void 0 : l.subsidiaryId, c = (s = t.currentVendorSubsidiary(e._id)) == null ? void 0 : s.id;
799
+ return o && o == c;
831
800
  }
832
- const s = t.getNetSuiteLocation(`${e.internal}_${e._id}`), l = t.getLocationSubsidiary(s == null ? void 0 : s.netSuiteId).id, i = (f = t.currentLocationSubsidiary()) == null ? void 0 : f.id;
833
- return l && l == i;
801
+ const a = t.getNetSuiteLocation(`${e.internal}_${e._id}`), u = t.getLocationSubsidiary(a == null ? void 0 : a.netSuiteId).id, i = (f = t.currentLocationSubsidiary()) == null ? void 0 : f.id;
802
+ return u && u == i;
834
803
  }
835
- const $t = xe("transferTemplateActions", () => {
836
- const e = je(), t = be(), s = Z(), l = Ce(), i = Le(), o = Se(), f = te(), c = Ge(), { t: a } = oe(), m = R({});
804
+ const _t = xe("transferTemplateActions", () => {
805
+ const e = qe(), t = be(), a = Z(), u = Ce(), i = Le(), s = Se(), f = te(), l = We(), { t: o } = ne(), c = R({});
837
806
  function h() {
838
- m.value = {
839
- mode: me.CREATE,
807
+ c.value = {
808
+ mode: ce.CREATE,
840
809
  show: !0,
841
810
  "onUpdate:show"(n) {
842
- m.value.show = n;
811
+ c.value.show = n;
843
812
  }
844
813
  };
845
814
  }
846
815
  function d(n) {
847
- m.value = {
848
- mode: me.UPDATE,
816
+ c.value = {
817
+ mode: ce.UPDATE,
849
818
  modelValue: n,
850
819
  show: !0,
851
820
  "onUpdate:show"(y) {
852
- m.value.show = y;
821
+ c.value.show = y;
853
822
  }
854
823
  };
855
824
  }
856
- function u(n, y, T) {
825
+ function m(n, y, T) {
857
826
  e.open({
858
827
  title: `Confirm deleting template ${n.name}?`,
859
828
  message: "Deleted template can no longer be retrieved",
@@ -874,28 +843,28 @@ const $t = xe("transferTemplateActions", () => {
874
843
  });
875
844
  try {
876
845
  y.value = !0;
877
- const [w] = await Promise.allSettled([
878
- o.deleteTemplate(n),
879
- new Promise((E) => setTimeout(E, 1e3))
846
+ const [$] = await Promise.allSettled([
847
+ s.deleteTemplate(n),
848
+ new Promise((k) => setTimeout(k, 1e3))
880
849
  ]);
881
- if (w.status === "rejected") throw w.reason;
850
+ if ($.status === "rejected") throw $.reason;
882
851
  t.open({
883
852
  title: `Deleted ${n.name}`,
884
853
  type: "success"
885
854
  });
886
- } catch (w) {
855
+ } catch ($) {
887
856
  t.open({
888
857
  title: `Unable to delete ${n.name}`,
889
- message: `See error from server: ${w}`,
858
+ message: `See error from server: ${$}`,
890
859
  type: "error"
891
- }), console.error("error on deleting purchase order template", w);
860
+ }), console.error("error on deleting purchase order template", $);
892
861
  } finally {
893
862
  y.value = !1, T();
894
863
  }
895
864
  });
896
865
  }
897
866
  function v(n, y, T) {
898
- let w;
867
+ let $;
899
868
  e.open({
900
869
  title: `Confirm duplicating template "${n.name}"?`,
901
870
  message: "Duplicated template can be edited and used independently",
@@ -909,13 +878,13 @@ const $t = xe("transferTemplateActions", () => {
909
878
  variant: z.Plain,
910
879
  close: !0
911
880
  },
912
- contentComponent: ae({
881
+ contentComponent: oe({
913
882
  props: ["modelValue"],
914
883
  emits: ["update:modelValue"],
915
- setup(E) {
884
+ setup(k) {
916
885
  return () => W(X.FmTextField, {
917
- modelValue: E.modelValue,
918
- "onUpdate:modelValue": (g) => w = g,
886
+ modelValue: k.modelValue,
887
+ "onUpdate:modelValue": (g) => $ = g,
919
888
  label: "New Template Name",
920
889
  size: "md",
921
890
  variant: "primary"
@@ -929,21 +898,21 @@ const $t = xe("transferTemplateActions", () => {
929
898
  });
930
899
  try {
931
900
  y.value = !0;
932
- const [E] = await Promise.allSettled([
933
- i.duplicatePurchaseOrderTemplate(n._id, w),
901
+ const [k] = await Promise.allSettled([
902
+ i.duplicatePurchaseOrderTemplate(n._id, $),
934
903
  new Promise((g) => setTimeout(g, 1e3))
935
904
  ]);
936
- if (E.status === "rejected") throw E.reason;
905
+ if (k.status === "rejected") throw k.reason;
937
906
  t.open({
938
907
  title: `Duplicated ${n.name}`,
939
908
  type: "success"
940
909
  });
941
- } catch (E) {
910
+ } catch (k) {
942
911
  t.open({
943
912
  title: `Unable to duplicate ${n.name}`,
944
- message: `See error from server: ${E}`,
913
+ message: `See error from server: ${k}`,
945
914
  type: "error"
946
- }), console.error("error on duplicating purchase order template", E);
915
+ }), console.error("error on duplicating purchase order template", k);
947
916
  } finally {
948
917
  y.value = !1, T();
949
918
  }
@@ -965,11 +934,11 @@ const $t = xe("transferTemplateActions", () => {
965
934
  function x() {
966
935
  const { promise: n, resolve: y } = Promise.withResolvers(), T = (g) => {
967
936
  y(g);
968
- }, w = l.templates.filter((g) => {
937
+ }, $ = u.templates.filter((g) => {
969
938
  var O, F;
970
- return ((O = g.purchaseOrder.supplier) == null ? void 0 : O._id) === s.currentLocation.doc._id ? !1 : (F = g.locations) != null && F.length ? g.locations.find((U) => U.doc._id === s.currentLocation.doc._id) : !0;
939
+ return ((O = g.purchaseOrder.supplier) == null ? void 0 : O._id) === a.currentLocation.doc._id ? !1 : (F = g.locations) != null && F.length ? g.locations.find((M) => M.doc._id === a.currentLocation.doc._id) : !0;
971
940
  });
972
- if (!w.length)
941
+ if (!$.length)
973
942
  return e.open({
974
943
  title: "Select one template",
975
944
  message: "There is no available template in your business. Configure a new template?",
@@ -982,26 +951,26 @@ const $t = xe("transferTemplateActions", () => {
982
951
  close: !0
983
952
  }
984
953
  }).onPrimary(() => {
985
- c.push({ name: ue.TRANSFER_TEMPLATE }), T(void 0);
954
+ l.push({ name: me.TRANSFER_TEMPLATE }), T(void 0);
986
955
  }).onSecondary(() => T(void 0)).onClose(() => T(void 0)), n;
987
- const E = w.map((g) => {
988
- var le;
989
- const O = !g.purchaseOrder.items.length || g.purchaseOrder.items.some(Te), F = !_t(g.purchaseOrder.supplier), U = g.purchaseOrder.supplier.internal ? f.getNetSuiteLocation(
956
+ const k = $.map((g) => {
957
+ var ie;
958
+ const O = !g.purchaseOrder.items.length || g.purchaseOrder.items.some(Te), F = !Tt(g.purchaseOrder.supplier), M = g.purchaseOrder.supplier.internal ? f.getNetSuiteLocation(
990
959
  `${g.purchaseOrder.supplier.internal}_${g.purchaseOrder.supplier._id}`
991
- ) : f.getNetSuiteVendor(g.purchaseOrder.supplier._id), ke = F ? `The subsidiary of the request
992
- location is ${(le = f.getLocationSubsidiary(U == null ? void 0 : U.netSuiteId)) == null ? void 0 : le.fullName}.` : void 0, Ee = O || F, Re = O ? "This template is invalid. Update this template." : F ? ke : void 0, Ne = `${g.purchaseOrder.supplier.internal ? "Transfer" : "Purchase"} from ${g.purchaseOrder.supplier.name}`;
960
+ ) : f.getNetSuiteVendor(g.purchaseOrder.supplier._id), Ee = F ? `The subsidiary of the request
961
+ location is ${(ie = f.getLocationSubsidiary(M == null ? void 0 : M.netSuiteId)) == null ? void 0 : ie.fullName}.` : void 0, ke = O || F, Re = O ? "This template is invalid. Update this template." : F ? Ee : void 0, Ie = `${g.purchaseOrder.supplier.internal ? "Transfer" : "Purchase"} from ${g.purchaseOrder.supplier.name}`;
993
962
  return {
994
963
  label: g.name,
995
964
  value: g._id,
996
- disabled: Ee,
997
- sublabel: Re ?? Ne
965
+ disabled: ke,
966
+ sublabel: Re ?? Ie
998
967
  };
999
968
  });
1000
- return E.sort((g, O) => +!!g.disabled - +!!O.disabled), e.open({
969
+ return k.sort((g, O) => +!!g.disabled - +!!O.disabled), e.open({
1001
970
  title: "Select one template",
1002
- contentComponent: Qe,
971
+ contentComponent: Be,
1003
972
  contentComponentProps: {
1004
- items: E,
973
+ items: k,
1005
974
  singleSelect: !0
1006
975
  },
1007
976
  primaryActions: {
@@ -1017,54 +986,54 @@ const $t = xe("transferTemplateActions", () => {
1017
986
  close: !0
1018
987
  }
1019
988
  }).onPrimary((g) => Array.isArray(g) ? T(g[0]) : null).onSecondary(() => T(void 0)).onTertiary(() => {
1020
- c.push({ name: ue.TRANSFER_TEMPLATE }), T(void 0);
989
+ l.push({ name: me.TRANSFER_TEMPLATE }), T(void 0);
1021
990
  }).onClose(() => T(void 0)), n;
1022
991
  }
1023
- function $() {
992
+ function w() {
1024
993
  e.open({
1025
- title: a("inventory.ingredient.import.title"),
1026
- contentComponent: Tt,
994
+ title: o("inventory.ingredient.import.title"),
995
+ contentComponent: St,
1027
996
  overlay: !0,
1028
997
  closeButton: !0,
1029
998
  primaryActions: {
1030
- text: a("common.import"),
999
+ text: o("common.import"),
1031
1000
  close: !1
1032
1001
  },
1033
1002
  secondaryActions: {
1034
- text: a("common.close"),
1003
+ text: o("common.close"),
1035
1004
  close: !0
1036
1005
  },
1037
1006
  tertiaryActions: {
1038
- text: a("inventory.ingredient.import.actions.downloadTemplate"),
1007
+ text: o("inventory.ingredient.import.actions.downloadTemplate"),
1039
1008
  close: !1,
1040
1009
  variant: "plain"
1041
1010
  }
1042
1011
  }).onPrimary((n) => {
1043
1012
  if (!n) {
1044
1013
  t.open({
1045
- title: a("inventory.ingredient.import.error.noData"),
1014
+ title: o("inventory.ingredient.import.error.noData"),
1046
1015
  type: "error"
1047
1016
  });
1048
1017
  return;
1049
1018
  }
1050
1019
  if (!n.importCreateResult.length && !n.importUpdateResult.length) {
1051
1020
  t.open({
1052
- title: a("inventory.ingredient.import.error.invalidContent"),
1053
- message: a("inventory.ingredient.import.error.noImportData"),
1021
+ title: o("inventory.ingredient.import.error.invalidContent"),
1022
+ message: o("inventory.ingredient.import.error.noImportData"),
1054
1023
  type: "error"
1055
1024
  });
1056
1025
  return;
1057
1026
  }
1058
1027
  if (n.importCreateResult.some((y) => y.errors.length) || n.importUpdateResult.some((y) => y.errors.length)) {
1059
1028
  t.open({
1060
- title: a("inventory.ingredient.import.error.invalidContent"),
1061
- message: a("inventory.ingredient.import.error.hasErrors"),
1029
+ title: o("inventory.ingredient.import.error.invalidContent"),
1030
+ message: o("inventory.ingredient.import.error.hasErrors"),
1062
1031
  type: "error"
1063
1032
  });
1064
1033
  return;
1065
1034
  }
1066
1035
  e.close(), S(n);
1067
- }).onTertiary(Je);
1036
+ }).onTertiary(Ze);
1068
1037
  }
1069
1038
  async function S(n) {
1070
1039
  try {
@@ -1076,36 +1045,36 @@ const $t = xe("transferTemplateActions", () => {
1076
1045
  (g) => g.template
1077
1046
  )
1078
1047
  ], T = 100;
1079
- let w = 0;
1080
- const E = () => {
1081
- w += T, t.open({
1082
- title: a("inventory.ingredient.import.progress", [
1083
- Math.min(w, y.length),
1048
+ let $ = 0;
1049
+ const k = () => {
1050
+ $ += T, t.open({
1051
+ title: o("inventory.ingredient.import.progress", [
1052
+ Math.min($, y.length),
1084
1053
  y.length
1085
1054
  ])
1086
1055
  });
1087
1056
  };
1088
1057
  for (const g of y.chunk(100))
1089
- E(), await o.importTemplates(g);
1058
+ k(), await s.importTemplates(g);
1090
1059
  t.open({
1091
- title: a("inventory.ingredient.import.success"),
1060
+ title: o("inventory.ingredient.import.success"),
1092
1061
  type: "success"
1093
1062
  });
1094
1063
  } catch (y) {
1095
1064
  t.open({
1096
- title: a("inventory.ingredient.import.error.failed"),
1097
- message: a("inventory.ingredient.import.error.systemMessage", [y == null ? void 0 : y.message]),
1065
+ title: o("inventory.ingredient.import.error.failed"),
1066
+ message: o("inventory.ingredient.import.error.systemMessage", [y == null ? void 0 : y.message]),
1098
1067
  type: "error"
1099
1068
  }), console.error("Error in importing skus", n, y);
1100
1069
  } finally {
1101
- l.fetchTemplates();
1070
+ u.fetchTemplates();
1102
1071
  }
1103
1072
  }
1104
1073
  function p() {
1105
- const n = Ze(l.templates);
1074
+ const n = Ge(u.templates);
1106
1075
  t.open({
1107
- title: a("inventory.ingredient.export.success"),
1108
- message: a("inventory.ingredient.export.filename", [n]),
1076
+ title: o("inventory.ingredient.export.success"),
1077
+ message: o("inventory.ingredient.export.filename", [n]),
1109
1078
  type: "success"
1110
1079
  });
1111
1080
  }
@@ -1113,61 +1082,61 @@ const $t = xe("transferTemplateActions", () => {
1113
1082
  createTemplate: h,
1114
1083
  viewTemplate: r,
1115
1084
  updateTemplate: d,
1116
- deleteTemplate: u,
1085
+ deleteTemplate: m,
1117
1086
  duplicateTemplate: v,
1118
1087
  getTemplateId: x,
1119
- importTemplates: $,
1088
+ importTemplates: w,
1120
1089
  exportTemplates: p,
1121
- templateDialogProps: m,
1090
+ templateDialogProps: c,
1122
1091
  templateDetailsProps: b
1123
1092
  };
1124
1093
  });
1125
- function ye(e) {
1126
- const { skuById: t } = q(), s = re(e);
1127
- return s.purchaseOrder.items = e.purchaseOrder.items.filter((l) => t[l.sku._id]), s;
1094
+ function fe(e) {
1095
+ const { skuById: t } = q(), a = re(e);
1096
+ return a.purchaseOrder.items = e.purchaseOrder.items.filter((u) => t[u.sku._id]), a;
1128
1097
  }
1129
1098
  const Ce = xe(
1130
1099
  "transferTemplateTable",
1131
1100
  function() {
1132
- const { t } = oe(), s = $t(), l = R(!1), i = R(new Array()), o = Se(), f = q();
1133
- async function c() {
1134
- i.value = [], l.value = !0;
1101
+ const { t } = ne(), a = _t(), u = R(!1), i = R(new Array()), s = Se(), f = q();
1102
+ async function l() {
1103
+ i.value = [], u.value = !0;
1135
1104
  try {
1136
1105
  f.isInventoryLoaded || await f.readInventory();
1137
- const [d] = await Promise.all([o.readTemplates()]).delayed(
1106
+ const [d] = await Promise.all([s.readTemplates()]).delayed(
1138
1107
  1e3
1139
1108
  );
1140
- i.value = d.map(ye);
1109
+ i.value = d.map(fe);
1141
1110
  } catch (d) {
1142
1111
  console.log("Something went wrong when fetching templates:", d);
1143
1112
  } finally {
1144
- l.value = !1;
1113
+ u.value = !1;
1145
1114
  }
1146
1115
  }
1147
- async function a(d) {
1148
- if (!i.value.find((u) => u._id)) {
1149
- l.value = !0;
1116
+ async function o(d) {
1117
+ if (!i.value.find((m) => m._id)) {
1118
+ u.value = !0;
1150
1119
  try {
1151
1120
  i.value = [
1152
- await o.getTemplate(d).then(ye).delayed(1e3)
1121
+ await s.getTemplate(d).then(fe).delayed(1e3)
1153
1122
  ];
1154
- } catch (u) {
1155
- console.log("Something went wrong when fetching templates:", u);
1123
+ } catch (m) {
1124
+ console.log("Something went wrong when fetching templates:", m);
1156
1125
  } finally {
1157
- l.value = !1;
1126
+ u.value = !1;
1158
1127
  }
1159
1128
  }
1160
1129
  }
1161
- function m(d, u) {
1162
- switch (u = re(u), d) {
1163
- case I.Details:
1164
- return s.viewTemplate(u);
1165
- case I.Edit:
1166
- return s.updateTemplate(u);
1167
- case I.Delete:
1168
- return s.deleteTemplate(u, l, c);
1169
- case I.Duplicate:
1170
- return s.duplicateTemplate(u, l, c);
1130
+ function c(d, m) {
1131
+ switch (m = re(m), d) {
1132
+ case N.Details:
1133
+ return a.viewTemplate(m);
1134
+ case N.Edit:
1135
+ return a.updateTemplate(m);
1136
+ case N.Delete:
1137
+ return a.deleteTemplate(m, u, l);
1138
+ case N.Duplicate:
1139
+ return a.duplicateTemplate(m, u, l);
1171
1140
  }
1172
1141
  }
1173
1142
  return {
@@ -1177,7 +1146,7 @@ const Ce = xe(
1177
1146
  accessorKey: "_id",
1178
1147
  header: () => t("inventory.transfer.table.createdAt"),
1179
1148
  cell(d) {
1180
- return He(`${d.getValue()}`);
1149
+ return Qe(`${d.getValue()}`);
1181
1150
  },
1182
1151
  enableSorting: !0
1183
1152
  },
@@ -1205,8 +1174,8 @@ const Ce = xe(
1205
1174
  textAlign: "right"
1206
1175
  },
1207
1176
  cell(d) {
1208
- const u = Number(d.getValue()) || 0, v = d.row.original.purchaseOrder.items.some(Te);
1209
- return u === 0 || v ? W("div", { class: "flex justify-end gap-4 items-center" }, [
1177
+ const m = Number(d.getValue()) || 0, v = d.row.original.purchaseOrder.items.some(Te);
1178
+ return m === 0 || v ? W("div", { class: "flex justify-end gap-4 items-center" }, [
1210
1179
  W(
1211
1180
  X.FmTooltip,
1212
1181
  {},
@@ -1223,8 +1192,8 @@ const Ce = xe(
1223
1192
  }
1224
1193
  }
1225
1194
  ),
1226
- u
1227
- ]) : u;
1195
+ m
1196
+ ]) : m;
1228
1197
  }
1229
1198
  },
1230
1199
  {
@@ -1233,8 +1202,8 @@ const Ce = xe(
1233
1202
  header: () => "Enabled outlets",
1234
1203
  cell(d) {
1235
1204
  var v;
1236
- const u = (v = d.row.original.locations) == null ? void 0 : v.length;
1237
- return u ? `${u}` : "All";
1205
+ const m = (v = d.row.original.locations) == null ? void 0 : v.length;
1206
+ return m ? `${m}` : "All";
1238
1207
  },
1239
1208
  enableSorting: !1,
1240
1209
  meta: {
@@ -1252,13 +1221,13 @@ const Ce = xe(
1252
1221
  {
1253
1222
  id: "action",
1254
1223
  cell(d) {
1255
- const u = d.row.original, v = [
1256
- j[I.Details],
1257
- j[I.Edit],
1258
- j[I.Duplicate],
1259
- j[I.Delete]
1224
+ const m = d.row.original, v = [
1225
+ j[N.Details],
1226
+ j[N.Edit],
1227
+ j[N.Duplicate],
1228
+ j[N.Delete]
1260
1229
  ];
1261
- return Ve(v, (b) => m(b, u));
1230
+ return He(v, (b) => c(b, m));
1262
1231
  },
1263
1232
  enableSorting: !1,
1264
1233
  size: 40,
@@ -1269,20 +1238,19 @@ const Ce = xe(
1269
1238
  }
1270
1239
  ],
1271
1240
  templates: i,
1272
- loading: l,
1273
- fetchTemplates: c,
1274
- loadTemplate: a
1241
+ loading: u,
1242
+ fetchTemplates: l,
1243
+ loadTemplate: o
1275
1244
  };
1276
1245
  }
1277
1246
  );
1278
- function Dt(e, t, s) {
1279
- const l = (s == null ? void 0 : s.abbrev) ?? t.abbrev;
1280
- return `${B(e, !1)} ${l}`;
1247
+ function Dt(e, t, a) {
1248
+ const u = (a == null ? void 0 : a.abbrev) ?? t.abbrev;
1249
+ return `${L(e, !1)} ${u}`;
1281
1250
  }
1282
1251
  export {
1283
- N as P,
1284
- Se as a,
1285
- $t as b,
1252
+ I as P,
1253
+ _t as a,
1286
1254
  Dt as f,
1287
1255
  Te as t,
1288
1256
  Ce as u