@feedmepos/mf-inventory-portal 1.2.43 → 1.2.44-dev.1

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 (95) hide show
  1. package/dist/{App-DVsAv4k3.js → App-D6h4PbkJ.js} +3 -3
  2. package/dist/{ApprovalView-EHDiLsmL.js → ApprovalView-Bll-QWib.js} +5 -5
  3. package/dist/{BindingsDialog-DL2Dgzpf.js → BindingsDialog-cm-tG1Du.js} +8 -8
  4. package/dist/{BindingsPicker-BpdNqjSm.js → BindingsPicker-Ca0BxJKj.js} +3 -3
  5. package/dist/{BindingsTable-C6KWR_kl.js → BindingsTable-BBNWeq4W.js} +3 -3
  6. package/dist/{ClosingDraftView-Byx8Zp15.js → ClosingDraftView-r2C27qph.js} +766 -723
  7. package/dist/ClosingHistoryView-CGV72nOD.js +447 -0
  8. package/dist/{ClosingTemplateView-DqfxzSBi.js → ClosingTemplateView-Xij995aZ.js} +14 -14
  9. package/dist/{DeliveryOrderPrintPreview-DvaTq4XO.js → DeliveryOrderPrintPreview-BoBBu5lC.js} +9 -9
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Dadg0d7W.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-SnXudMX4.js} +59 -60
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-yp0tPBLr.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-ClY0PFyA.js} +2 -2
  12. package/dist/{FmMultiselectDialog-M-tcECkK.js → FmMultiselectDialog-BcZpbDMT.js} +2 -2
  13. package/dist/{FmMultiselectDialog-iXXJJ181.js → FmMultiselectDialog-C9g5u6Kk.js} +1 -1
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CzYmgtjx.js → FmUnitInput.vue_vue_type_script_setup_true_lang-B-PD6CbF.js} +3 -3
  15. package/dist/{ImportView-BGbe571V.js → ImportView-CzMwJY2A.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-SkZJQR4H.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DgOrurbQ.js} +1 -1
  17. package/dist/{IngredientGroupView-B5AhZqGE.js → IngredientGroupView-DBbwP3E6.js} +5 -5
  18. package/dist/{IngredientsView-BkORfSgQ.js → IngredientsView-jRqkzOTc.js} +14 -14
  19. package/dist/{IntegrationView-DC1u6d1K.js → IntegrationView-B-_39POT.js} +12 -12
  20. package/dist/{InventoryBindingForm-D4ht1PMO.js → InventoryBindingForm-D14aWQqg.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CFWTE_sj.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DtHtGqKw.js} +14 -14
  22. package/dist/{InventoryBindingSummary-DKYKoLOt.js → InventoryBindingSummary-B7Q-G4Fx.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D1hfyifk.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CqB7pkKN.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BfsTUKPQ.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BfHSMN6k.js} +2 -2
  25. package/dist/{PublishView-CMTQJ7Nv.js → PublishView-C_icogKG.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-CzYlYowQ.js → PurchaseOrderPrintPreview-BeXqhfRn.js} +9 -9
  27. package/dist/ReceiveRequestView-COdOrOyg.js +2894 -0
  28. package/dist/{RecipeView-CIwSZuEd.js → RecipeView-Desvtm1a.js} +8 -8
  29. package/dist/{StockView-DBY2sHlj.js → StockView-B1NDBHQh.js} +344 -341
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-VY2KygFc.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CbCD3pOQ.js} +1 -1
  31. package/dist/{SupplierView-CGsqiXR4.js → SupplierView-CB6Gz5HH.js} +11 -11
  32. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-BUs4-nO6.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-3bruORgT.js} +2 -2
  33. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-plLh-5S3.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-C0Vd0X-5.js} +1 -1
  34. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-C8DluFT4.js → TransferDetails.vue_vue_type_script_setup_true_lang-Bnt6-X4t.js} +306 -306
  35. package/dist/{TransferTemplateView-BEXsC7mp.js → TransferTemplateView-CLeLzBvW.js} +354 -354
  36. package/dist/{UnitView-BGRkT8Hr.js → UnitView-YM302P8g.js} +6 -6
  37. package/dist/{WarehouseView-D7og7WBg.js → WarehouseView-D69BsVsb.js} +5 -5
  38. package/dist/WastageTemplateView-DfP43M8-.js +2327 -0
  39. package/dist/api/stock.d.ts +2 -0
  40. package/dist/{app-CioeggUO.js → app-BuvV4n4w.js} +2344 -2296
  41. package/dist/app.js +7 -7
  42. package/dist/{closing-template-DrBlhTbC.js → closing-template-D1NlAV-G.js} +1 -1
  43. package/dist/{date2-mucf0HV-.js → date2-CkkGwYSP.js} +1 -1
  44. package/dist/{dayjs.min-C5lVIjQ1.js → dayjs.min-DFvOuCCo.js} +21 -21
  45. package/dist/{decimal-EYAs7CPT.js → decimal-D1O4-kbG.js} +2 -2
  46. package/dist/{defineDeepModel-BQ_3cF8o.js → defineDeepModel-s0no34Rq.js} +1 -1
  47. package/dist/{duplicate-template-K_oezMr4.js → duplicate-template-DJceVj9n.js} +1 -1
  48. package/dist/feature-AINxwcz_.js +25697 -0
  49. package/dist/{format-time-from-id-qnJY4xQY.js → format-time-from-id-CRiwabgV.js} +1 -1
  50. package/dist/{format-unit-display-6I_PHQ9C.js → format-unit-display-kd8gPWFg.js} +245 -246
  51. package/dist/helper/form.d.ts +1 -0
  52. package/dist/helper/object.d.ts +21 -0
  53. package/dist/helper/reactivity.d.ts +11 -0
  54. package/dist/helper/reactivity.spec.d.ts +1 -0
  55. package/dist/{import-export.helper-vmA8rXwv.js → import-export.helper-CtI9oUN_.js} +5 -5
  56. package/dist/{index-5yza2WJR.js → index-Af5Cs7r5.js} +1 -1
  57. package/dist/{index-DXJ9MIiE.js → index-BVBQnKv6.js} +9 -9
  58. package/dist/{index-DqMYKP87.js → index-DKTL7IN3.js} +3 -3
  59. package/dist/{lodash-D6iOSfR7.js → lodash-TAQPcjEK.js} +1 -1
  60. package/dist/{netsuite-DKE_ORM0.js → netsuite-CcC4Y1c-.js} +70 -70
  61. package/dist/{purchase-order-template-Brpbfw8K.js → purchase-order-template-B-Xuh5oQ.js} +1 -1
  62. package/dist/{rules-fd3m4inF.js → rules-DwOMpBOV.js} +3 -3
  63. package/dist/{stock-CLX4SKxt.js → stock-DolMZJgQ.js} +3 -3
  64. package/dist/{stock-8-vRigjE.js → stock-X1ADgvOm.js} +35 -27
  65. package/dist/{supplier-Dlv1Clk5.js → supplier-DTzECjWy.js} +2 -2
  66. package/dist/tsconfig.app.tsbuildinfo +1 -1
  67. package/dist/{use-ingredient-select-dialog-2j3Nbou_.js → use-ingredient-select-dialog-D7UCiLcS.js} +2 -2
  68. package/dist/{use-inventory-binding-dialog-_S2XGoVU.js → use-inventory-binding-dialog-uYYsTsLi.js} +2 -2
  69. package/dist/{use-template-enabled-locations-2-CWlQQnyD.js → use-template-enabled-locations-2-l2e5ocrp.js} +2 -2
  70. package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +7 -0
  71. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +4 -1
  72. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +1 -0
  73. package/dist/views/receive-request/components/netsuite/NetSuitePanel.vue.d.ts +3 -2
  74. package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +3 -2
  75. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +6 -0
  76. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +628 -0
  77. package/dist/views/receive-request/components/transfer-form/composables/use-purchase-order-form-controller.d.ts +22 -0
  78. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +3 -2
  79. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +1 -1
  80. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +6 -6
  81. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +7 -7
  82. package/dist/views/receive-request/constants/purchase-order-transaction-type.d.ts +2 -2
  83. package/dist/views/receive-request/helper/get-transfer-type.d.ts +1 -2
  84. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +3 -2
  85. package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItemProps.d.ts +3 -2
  86. package/dist/views/transfer-template/helpers/import-export.helper.d.ts +4 -3
  87. package/dist/{vue-i18n-CCrvzsiW.js → vue-i18n-anAmA_v_.js} +376 -376
  88. package/dist/{xlsx-oL4emcgf.js → xlsx-CtBehOaB.js} +398 -398
  89. package/dist/{xlsx.util-JOeDOZ3P.js → xlsx.util-jpTCFIaP.js} +1 -1
  90. package/package.json +3 -3
  91. package/dist/ClosingHistoryView-BpFFNCqD.js +0 -391
  92. package/dist/ReceiveRequestView-CMHZZ9ul.js +0 -2841
  93. package/dist/WastageTemplateView-CwEUAwCw.js +0 -2287
  94. package/dist/feature-BkR98vGd.js +0 -20161
  95. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +0 -3159
@@ -1,2287 +0,0 @@
1
- import { ref as R, h as P, defineComponent as K, resolveComponent as D, openBlock as I, createElementBlock as A, createElementVNode as g, normalizeClass as H, createTextVNode as me, toDisplayString as C, unref as w, createCommentVNode as z, createVNode as S, createBlock as L, Fragment as Y, renderList as Q, computed as B, watch as ve, createSlots as Ue, withCtx as V, isRef as Le, normalizeStyle as Qe, Teleport as Xe, normalizeProps as Ze, guardReactiveProps as et, mergeProps as Ve } from "vue";
2
- import { u as tt, _ as nt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
3
- import { useI18n as G, useCoreStore as Be } from "@feedmepos/mf-common";
4
- import { D as re, R as U } from "./row-action.enum-BcW_L_nE.js";
5
- import { _ as ot } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-yp0tPBLr.js";
6
- import { useDialog as X, useDialogChild as st, useSnackbar as Z, FmButtonVariant as ie, components as W, useProxiedModel as Ne, useBreakpoints as at } from "@feedmepos/ui-library";
7
- import { defineStore as ze, storeToRefs as Oe } from "pinia";
8
- import { c as lt, _ as rt, F as ce } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
9
- import { u as ye, c as We, a as ee, D as j, n as it, B as de } from "./app-CioeggUO.js";
10
- import { F as J } from "./form-mode.enum-BKiNVH6A.js";
11
- import { f as ct } from "./format-time-from-id-qnJY4xQY.js";
12
- import { u as te } from "./closing-template-DrBlhTbC.js";
13
- import { _ as ut } from "./TemplatePublishDialog.vue_vue_type_script_setup_true_lang-plLh-5S3.js";
14
- import { t as pe, a as He, d as Ye, s as Ke, r as mt } from "./xlsx.util-JOeDOZ3P.js";
15
- import { f as dt, a as ue } from "./date2-mucf0HV-.js";
16
- import { u as pt } from "./netsuite-DKE_ORM0.js";
17
- import { F as ft } from "./FmDroppableField-J0xUsOTV.js";
18
- import { u as vt } from "./duplicate-template-K_oezMr4.js";
19
- import { A as yt, R as Ge } from "./rules-fd3m4inF.js";
20
- import { d as ht } from "./defineDeepModel-BQ_3cF8o.js";
21
- import { u as gt } from "./use-template-enabled-locations-2-CWlQQnyD.js";
22
- import { a as bt } from "./FmMultiselectDialog-M-tcECkK.js";
23
- import { _ as _t } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-BUs4-nO6.js";
24
- import { _ as xt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
25
- const ne = ze(
26
- "wastageTable",
27
- function() {
28
- const { t: s } = G(), m = X(), h = fe(), a = R({}), c = R(new Array()), l = R(!1), t = ye(), r = te(), o = R({}), u = R();
29
- async function b() {
30
- if (t._currentLocation)
31
- try {
32
- u.value = await r.getReasons();
33
- } catch (n) {
34
- console.log("Something went wrong when fetching reasons:", n);
35
- }
36
- }
37
- function v() {
38
- var e;
39
- if (!u.value) return !1;
40
- const n = (e = a.value.publishedRevs) == null ? void 0 : e[u.value._id];
41
- return u.value._rev === n;
42
- }
43
- function T(n) {
44
- const e = {
45
- title: n.name,
46
- doc: n,
47
- controller: {
48
- publishAll: async (i) => {
49
- const y = i || n.locations, _ = await r.publishSingleDoc(
50
- n._id,
51
- y == null ? void 0 : y.map(($) => $.dbName)
52
- );
53
- return o.value = _.publishedRevByLocation || {}, o.value;
54
- },
55
- publishAtLocation: async (i) => {
56
- const y = await r.publishSingleDoc(n._id, [
57
- i.dbName
58
- ]);
59
- return o.value = y.publishedRevByLocation || {}, o.value;
60
- }
61
- },
62
- initialPublishedRev: o.value,
63
- locations: t.locations,
64
- enabledLocations: n.locations
65
- };
66
- m.open({
67
- title: "Publish template",
68
- contentComponent: ut,
69
- contentComponentProps: e,
70
- closeButton: !0,
71
- primaryActions: {
72
- text: s("common.close"),
73
- close: !0,
74
- variant: "tertiary"
75
- }
76
- });
77
- }
78
- async function d() {
79
- if (c.value = [], !!t._currentLocation) {
80
- l.value = !0;
81
- try {
82
- const [n, e, i] = await Promise.all([
83
- r.readTemplates(),
84
- r.getRecentPublishingJob(),
85
- r.getRecentPublishInfo()
86
- ]).delayed(1e3);
87
- c.value = n, a.value = e, o.value = (i == null ? void 0 : i.publishedRevByLocation) || {}, await b();
88
- } catch (n) {
89
- console.log("Something went wrong when fetching templates:", n);
90
- } finally {
91
- l.value = !1;
92
- }
93
- }
94
- }
95
- async function x(n) {
96
- if (!c.value.find((e) => e._id) && t._currentLocation) {
97
- l.value = !0;
98
- try {
99
- const [e] = await Promise.all([
100
- r.getTemplate(n),
101
- new Promise((i) => setTimeout(i, 1e3))
102
- ]);
103
- c.value = [e];
104
- } catch (e) {
105
- console.log("Something went wrong when fetching templates:", e);
106
- } finally {
107
- l.value = !1;
108
- }
109
- }
110
- }
111
- function k(n, e) {
112
- switch (e = We(e), n) {
113
- case U.Details:
114
- return h.viewTemplate(e);
115
- case U.Edit:
116
- return h.updateTemplate(e);
117
- case U.Delete:
118
- return h.deleteTemplate(e, l, d);
119
- case U.Publish:
120
- return T(e);
121
- case U.Duplicate:
122
- return h.duplicateTemplate(e, l, d);
123
- }
124
- }
125
- return {
126
- columnDefs: [
127
- {
128
- id: "_id",
129
- accessorKey: "_id",
130
- header: () => s("inventory.adjustment.template.table.createdAt"),
131
- cell(n) {
132
- return ct(`${n.getValue()}`);
133
- },
134
- enableSorting: !0
135
- },
136
- {
137
- id: "name",
138
- accessorKey: "name",
139
- header: () => s("inventory.adjustment.template.table.name"),
140
- enableSorting: !0,
141
- size: 200
142
- },
143
- {
144
- id: "noOfItems",
145
- accessorKey: "items.length",
146
- header: () => s("inventory.adjustment.template.table.noOfItems"),
147
- enableSorting: !1,
148
- meta: {
149
- width: "10rem",
150
- textAlign: "right"
151
- }
152
- },
153
- {
154
- id: "enabledLocations",
155
- accessorKey: "locations.length",
156
- header: () => s("inventory.adjustment.template.table.enabledOutlets"),
157
- cell(n) {
158
- var i;
159
- const e = (i = n.row.original.locations) == null ? void 0 : i.length;
160
- return e ? `${e}` : "All";
161
- },
162
- enableSorting: !1,
163
- meta: {
164
- width: "10rem",
165
- textAlign: "right"
166
- }
167
- },
168
- {
169
- id: "status",
170
- header: () => s("inventory.adjustment.template.table.status"),
171
- enableSorting: !1,
172
- cell(n) {
173
- const e = n.row.original, i = e._rev, y = n.row.original.locations || t.locations, $ = y.filter((F) => !!(o.value[F.dbName] || []).find((E) => E._id === e._id && E._rev === i)).length === y.length;
174
- return P(
175
- "div",
176
- {
177
- class: "flex items-center gap-8"
178
- },
179
- P(
180
- "div",
181
- {
182
- class: [
183
- "fm-status-badge",
184
- $ ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
185
- ]
186
- },
187
- $ ? "Published" : "Unpublished"
188
- )
189
- );
190
- }
191
- },
192
- {
193
- id: "action",
194
- cell(n) {
195
- const e = n.row.original, i = [
196
- re[U.Edit],
197
- re[U.Duplicate],
198
- re[U.Delete],
199
- re[U.Publish]
200
- ];
201
- return lt(i, (y) => k(y, e));
202
- },
203
- enableSorting: !1,
204
- size: 40,
205
- meta: {
206
- cellClass: "",
207
- headerClass: ""
208
- }
209
- }
210
- ],
211
- recentPublish: a,
212
- templates: c,
213
- reasons: u,
214
- isReasonPublished: v,
215
- loading: l,
216
- fetchTemplates: d,
217
- loadTemplate: x
218
- };
219
- }
220
- );
221
- var he = /* @__PURE__ */ ((f) => (f.Ingredients = "Ingredients", f))(he || {});
222
- function Je(f, s, m) {
223
- var a, c, l;
224
- const h = [];
225
- if (f.type == j.Enum.sku) {
226
- const t = new Set(f.disabledMeasurements), r = (a = s.sku) == null ? void 0 : a.find((o) => o._id === f.id);
227
- if (r) {
228
- const o = {
229
- type: f.type,
230
- code: f.code,
231
- name: f.name,
232
- unit: r.unit.abbrev,
233
- enabled: !t.has(r.unit._id)
234
- };
235
- h.push(
236
- o,
237
- ...r.unit.measurements.map((u) => ({
238
- unit: u.abbrev,
239
- enabled: !t.has(u.id)
240
- }))
241
- );
242
- }
243
- }
244
- return f.type == j.Enum.recipe && ((c = s.recipe) != null && c.find((r) => r._id === f.id)) && h.push(f), f.type == j.Enum.menu && ((l = m == null ? void 0 : m.modules.item) != null && l.find((r) => r._id === f.id)) && h.push(f), h;
245
- }
246
- function qe() {
247
- return [
248
- {
249
- id: "code",
250
- name: "Code"
251
- },
252
- {
253
- id: "type",
254
- name: "Type"
255
- },
256
- {
257
- id: "name",
258
- name: "Name"
259
- },
260
- {
261
- id: "unit",
262
- name: "Unit"
263
- },
264
- {
265
- id: "enabled",
266
- name: "Enabled (Unit)"
267
- }
268
- ];
269
- }
270
- function wt(f) {
271
- var o;
272
- const s = Be(), m = ee(), h = m.menu.cache, a = s.currentBusiness.value, l = (o = f.map((u) => {
273
- var k;
274
- const b = u.items.flatMap(
275
- (p) => Je(p, m.state.inventory, h)
276
- ), v = qe(), T = [
277
- ["Template ID", u._id],
278
- ["Template name", u.name],
279
- ["Business name", a == null ? void 0 : a.name],
280
- ["Business ID", a == null ? void 0 : a._id],
281
- ["Menu version", a == null ? void 0 : a.menuVersion],
282
- [
283
- "Locations",
284
- ...(k = u.locations) != null && k.length ? u.locations.map((p) => `${p.name} (${p.dbName})`) : ["All"]
285
- ],
286
- // ['Reference', template.ref ?? ''],
287
- [],
288
- v.map((p) => p.name),
289
- ...b.map((p) => v.map((n) => p[n.id]))
290
- ], d = v.map((p) => `system:${p.id}`), x = pe(T, d);
291
- return { name: u.name, sheet: x };
292
- }).reduce(
293
- (u, b) => {
294
- var T;
295
- const v = b.name.slice(0, 12);
296
- return (T = u.sheetOccurence)[v] ?? (T[v] = 0), u.sheetOccurence[v] += 1, u.sheets[`${v} (${u.sheetOccurence[v]})`] = b.sheet, u;
297
- },
298
- {
299
- sheets: {},
300
- sheetOccurence: {}
301
- }
302
- )) == null ? void 0 : o.sheets, t = `${a == null ? void 0 : a.name} adjustment templates (${dt(/* @__PURE__ */ new Date())}).xlsx`, r = He(l);
303
- return Ye(r, t), t;
304
- }
305
- function Tt() {
306
- var k;
307
- const f = Be(), s = ee(), m = pt(), h = (k = s.state.inventory.sku) == null ? void 0 : k[0];
308
- if (!h)
309
- throw new Error("No inventory items");
310
- const c = Je(
311
- {
312
- type: j.Enum.sku,
313
- code: h.code,
314
- id: h._id,
315
- name: h.name
316
- },
317
- s.state.inventory,
318
- s.menu.cache
319
- )[0], l = f.currentBusiness.value, t = qe(), r = [
320
- ["Template ID (leave empty to create new)", ""],
321
- ["Template Name", "New template"],
322
- ["Business name", l == null ? void 0 : l.name],
323
- ["Business ID", l == null ? void 0 : l._id],
324
- ["Menu version", l == null ? void 0 : l.menuVersion],
325
- [
326
- "Location codes (leave empty to enable all)",
327
- "Example outlet (restaurant_xxx)",
328
- "Example outlet 2 (restaurant_xxx)"
329
- ],
330
- // ['Reference:'],
331
- [],
332
- t.map((p) => p.name),
333
- t.map((p) => c[p.id])
334
- ], o = t.map((p) => `system:${p.id}`), u = pe(r, o), b = m.isEnabled ? m.state.setting.childItems ?? [] : [], v = b.reduce(
335
- (p, n) => {
336
- var $, F;
337
- const e = ($ = m.netSuiteItemIdToSkuId.get(n.parentNetSuiteId)) == null ? void 0 : $[0], i = (F = m.netSuiteMeasurementIdToMeasurementId.get(
338
- n.unitOfMeasureId
339
- )) == null ? void 0 : F[0];
340
- if (!n.externalId)
341
- return p;
342
- if (!e)
343
- return console.error(`Item ${n.externalId} cannot be mapped to parent FdoInventorySku.`, n), p;
344
- const y = s.skuById[e], _ = y.unit.measurements.find((M) => M.id === i);
345
- return _ ? (p[n.externalId] = {
346
- sku: y,
347
- measurement: _
348
- }, p) : (console.error(
349
- `Item ${n.externalId} found parent FdoInventorySku of ${y.code} ${y.name} but the measurement of netsuite id ${n.unitOfMeasureId} cannot be found.`,
350
- n
351
- ), p);
352
- },
353
- {}
354
- ), T = pe(
355
- [
356
- ...s.skus.flatMap((p) => [
357
- [p.code, p.name, p.unit.abbrev, !0],
358
- ...p.unit.measurements.map((e) => [
359
- "",
360
- "",
361
- e.abbrev,
362
- !e.abbrev.toLocaleLowerCase("en-us").includes("inactive")
363
- ])
364
- ]),
365
- ...Object.entries(v).map(([p, { sku: n, measurement: e }]) => [
366
- n.code,
367
- n.name,
368
- e.abbrev,
369
- !e.abbrev.toLocaleLowerCase("en-us").includes("inactive"),
370
- p
371
- ])
372
- ],
373
- [
374
- "Code",
375
- "Type",
376
- "Name",
377
- "Units",
378
- "Enabled (true/false)",
379
- ...b.length ? ["Netsuite Parent"] : []
380
- ]
381
- ), d = He({
382
- Template: u,
383
- Ingredients: T
384
- }), x = `${l == null ? void 0 : l.name} transfer templates import.xlsx`;
385
- return Ye(d, x), x;
386
- }
387
- function kt(f) {
388
- if (!f.length || `${f[0]}`.toLocaleLowerCase() === "all")
389
- return [];
390
- const s = /(.*) \(((warehouse_|restaurant_).{24,})\)/, h = ye().locationByDbName;
391
- return f.map((a) => {
392
- const c = new Array(), l = a.trim(), t = s.exec(l);
393
- if (!t)
394
- return c.push(`Enabled location value of ${l} cannot be read.`), {
395
- errors: c
396
- };
397
- const r = t[1], o = t[2], u = h[o];
398
- return u ? (r !== u.name && c.push(
399
- `Location id ${o} has non-matching name. Found ${r} but expected ${u.name}`
400
- ), {
401
- errors: c,
402
- location: u
403
- }) : (c.push(`Location (${r}) of id ${o} is not found.`), {
404
- errors: c
405
- });
406
- });
407
- }
408
- function $t(f) {
409
- const [
410
- s,
411
- m,
412
- h,
413
- a,
414
- c,
415
- l,
416
- t,
417
- r
418
- ] = Ke(f);
419
- return {
420
- id: `${m[1] ?? ""}`.trim(),
421
- name: `${h[1] ?? ""}`.trim(),
422
- locations: t.slice(1).map((o) => `${o}`.trim()).filter((o) => o),
423
- reference: `${r[1] ?? ""}`.trim()
424
- };
425
- }
426
- function It(f) {
427
- const [
428
- s,
429
- m,
430
- h,
431
- a,
432
- c,
433
- l,
434
- t,
435
- r,
436
- o,
437
- ...u
438
- ] = Ke(f);
439
- if (!s || !s.length || s.some((x) => x.length && !x.startsWith("system:")))
440
- throw new Error("Missing meta header. Excel file does not come from the template.");
441
- const b = s.map((x) => x.split(":")[1]), T = [
442
- "code",
443
- "type",
444
- "name",
445
- "unit",
446
- "enabled"
447
- ].filter((x) => !b.includes(x));
448
- if (T.length)
449
- throw new Error(
450
- `Missing meta headers (${T.join()}). Excel file does not come from the template.`
451
- );
452
- return u.map((x, k) => {
453
- const p = {};
454
- for (const n in b) {
455
- const e = b[n];
456
- Object.assign(p, { [e]: x[n] });
457
- }
458
- return {
459
- index: k,
460
- data: p
461
- };
462
- });
463
- }
464
- function St(f) {
465
- return f.reduce(
466
- (s, m) => {
467
- var c;
468
- const h = m.data, a = m.index;
469
- if (h.type == j.Enum.recipe)
470
- s.result.push({ parent: m, children: [] });
471
- else if (h.type == j.Enum.menu)
472
- h.code ? s.result.push({ parent: m, children: [] }) : s.errors.push(`Menu item row ${a + 9} does not have a code.`);
473
- else {
474
- if (!h.unit) return s;
475
- h.code ? s.result.push({ parent: m, children: [] }) : s.result.length ? (c = s.result.at(-1)) == null || c.children.push(m) : s.errors.push(`Cannot find parent for row ${a + 9}`);
476
- }
477
- return s;
478
- },
479
- { result: new Array(), errors: new Array() }
480
- );
481
- }
482
- function Ft(f) {
483
- var r;
484
- const s = f.parent.data, m = new Array(), h = ee();
485
- if (f.parent.data.type == j.Enum.menu) {
486
- const o = h.menu.cache, u = (r = o == null ? void 0 : o.modules.item) == null ? void 0 : r.find((v) => v.code === s.code);
487
- if (!u)
488
- return m.push(`Cannot find menu module of id ${s.code}`), { errors: m };
489
- const b = {
490
- type: j.Enum.menu,
491
- code: u.code,
492
- id: u._id,
493
- name: u.name ?? ""
494
- };
495
- return { errors: m, templateItem: b };
496
- }
497
- if (f.parent.data.type == j.Enum.recipe) {
498
- const u = h.recipes.find((v) => v.name === s.name);
499
- if (!u)
500
- return m.push(`Cannot find recipe module of id ${s.code}`), { errors: m };
501
- const b = {
502
- type: j.Enum.recipe,
503
- id: u._id,
504
- name: u.name ?? ""
505
- };
506
- return { errors: m, templateItem: b };
507
- }
508
- const a = h.skuByCode[s.code ?? ""];
509
- if (!a)
510
- return m.push(`Cannot find ingredient of code [${s.code}] [${s.name}]`), { errors: m };
511
- const c = {
512
- type: j.Enum.sku,
513
- code: s.code,
514
- id: a._id,
515
- name: s.name ?? "",
516
- disabledMeasurements: []
517
- }, l = a.unit.measurements.find((o) => o.abbrev === s.unit);
518
- s.unit !== a.unit.abbrev && !l ? m.push(
519
- `Cannot find measurement unit of ${s.unit} for (${s.code}) ${s.name}.`
520
- ) : (!s.enabled || `${s.enabled}`.toLocaleLowerCase() === "false") && (c.disabledMeasurements ?? (c.disabledMeasurements = []), c.disabledMeasurements.push((l == null ? void 0 : l.id) ?? a.unit._id));
521
- for (const o of f.children) {
522
- const u = o.data, b = u.unit === a.unit.abbrev ? a.unit : void 0, v = a.unit.measurements.find((T) => T.abbrev === u.unit);
523
- if (!v && !b) {
524
- m.push(
525
- `Cannot find measurement unit of ${u.unit} for (${s.code}) ${s.name}.`
526
- );
527
- continue;
528
- }
529
- (!u.enabled || `${u.enabled}`.toLocaleLowerCase() === "false") && (c.disabledMeasurements ?? (c.disabledMeasurements = []), c.disabledMeasurements.push((v == null ? void 0 : v.id) ?? (b == null ? void 0 : b._id) ?? ""));
530
- }
531
- const t = new Set(c.disabledMeasurements);
532
- return t.has(a.unit._id) && a.unit.measurements.every((o) => t.has(o.id)) && m.push(`Ingredient ${a.code} - ${a.name} must have at least one unit enabled.`), { errors: m, templateItem: c };
533
- }
534
- function Ct(f) {
535
- const s = f.SheetNames.filter(
536
- (c) => !Object.values(he).map(String).includes(c)
537
- ), h = ne().templates, a = it(h, "_id");
538
- try {
539
- return s.reduce(
540
- (l, t) => {
541
- const r = new Array(), o = f.Sheets[t], u = $t(o), b = kt(u.locations), v = b.filter((e) => e.location).map((e) => e.location);
542
- r.push(...b.flatMap((e) => e.errors));
543
- const T = It(o).filter((e) => {
544
- const i = e.data;
545
- return i.type == j.Enum.menu ? i.code : i.type == j.Enum.recipe ? i.name : e.data.code || e.data.unit;
546
- }), d = St(T);
547
- r.push(...d.errors);
548
- const x = d.result.map(
549
- (e) => Ft(e)
550
- );
551
- r.push(...x.flatMap((e) => e.errors));
552
- const k = x.filter((e) => e.templateItem).map((e) => e.templateItem);
553
- if (u.id) {
554
- const e = a[u.id];
555
- if (!e) {
556
- const y = {
557
- type: de.Enum.WASTAGE,
558
- _id: u.id,
559
- _rev: "",
560
- name: u.name || `(unnamed from sheet ${t || "<unnamed sheet>"})`,
561
- items: []
562
- };
563
- return r.push(`Template ID ${u.id} is not found.`), l.importUpdateResult.push({
564
- type: "update",
565
- original: y,
566
- template: y,
567
- excelSheetName: t,
568
- errors: r
569
- }), l;
570
- }
571
- const i = {
572
- type: "update",
573
- original: e,
574
- template: {
575
- ...e,
576
- name: u.name,
577
- locations: v.length ? v : null,
578
- items: k
579
- },
580
- excelSheetName: t,
581
- errors: r
582
- };
583
- return l.importUpdateResult.push(i), l;
584
- }
585
- const n = {
586
- type: "create",
587
- template: {
588
- type: de.Enum.WASTAGE,
589
- name: u.name,
590
- locations: v.length ? v : null,
591
- items: k
592
- },
593
- excelSheetName: t,
594
- errors: r
595
- };
596
- return l.importCreateResult.push(n), l;
597
- },
598
- {
599
- invalidExcel: !1,
600
- importCreateResult: new Array(),
601
- importUpdateResult: new Array()
602
- }
603
- );
604
- } catch (c) {
605
- return {
606
- invalidExcel: !0,
607
- invalidExcelMessage: (c == null ? void 0 : c.message) ?? "Invalid excel",
608
- importCreateResult: [],
609
- importUpdateResult: []
610
- };
611
- }
612
- }
613
- const At = { class: "flex" }, Mt = { class: "flex flex-col flex-1" }, Rt = { class: "flex flex-col" }, Dt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Et = {
614
- key: 0,
615
- class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
616
- }, Pt = { key: 0 }, Vt = { class: "ml-auto" }, jt = { key: 0 }, je = /* @__PURE__ */ K({
617
- __name: "AdjustmentTemplateImportItem",
618
- props: {
619
- type: {},
620
- name: {},
621
- locations: {},
622
- items: {},
623
- errors: {}
624
- },
625
- setup(f) {
626
- const s = f, { t: m } = G(), h = R(!1), a = () => {
627
- s.errors.length && (h.value = !h.value);
628
- };
629
- return (c, l) => {
630
- var r, o, u;
631
- const t = D("FmIcon");
632
- return I(), A("div", At, [
633
- l[0] || (l[0] = g("div", null, "•", -1)),
634
- g("div", Mt, [
635
- g("div", {
636
- class: H(["flex items-center gap-12 pl-8", {
637
- "cursor-pointer": c.errors.length
638
- }]),
639
- onClick: a
640
- }, [
641
- g("div", Rt, [
642
- g("div", Dt, [
643
- g("div", {
644
- class: H({
645
- "text-fm-color-system-error-300": c.errors.length
646
- })
647
- }, [
648
- me(C(c.name) + " ", 1),
649
- c.type === "create" ? (I(), A("span", Et, "(" + C(w(m)("inventory.closing.template.import.new")) + ")", 1)) : z("", !0)
650
- ], 2),
651
- c.errors.length ? (I(), A("div", Pt, [
652
- S(t, {
653
- name: "error",
654
- size: "sm",
655
- color: "system-error-300"
656
- })
657
- ])) : z("", !0)
658
- ]),
659
- g("div", {
660
- class: H([
661
- "fm-typo-en-body-sm-400",
662
- {
663
- "text-fm-color-system-error-200": c.errors.length,
664
- "text-fm-color-typo-secondary": !c.errors.length
665
- }
666
- ])
667
- }, C((r = c.locations) != null && r.length ? w(m)("inventory.closing.template.import.nLocations", { count: (o = c.locations) == null ? void 0 : o.length }) : w(m)("inventory.closing.template.import.allLocations")) + ", " + C(w(m)("inventory.closing.template.import.nItems", { count: (u = c.items) == null ? void 0 : u.length })), 3)
668
- ]),
669
- g("div", Vt, [
670
- c.errors.length ? (I(), L(t, {
671
- key: 0,
672
- name: h.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
673
- size: "md"
674
- }, null, 8, ["name"])) : z("", !0)
675
- ])
676
- ], 2),
677
- h.value ? (I(), A("div", {
678
- key: 0,
679
- class: H(["flex flex-col gap-4 pl-8 fm-typo-en-body-sm-400", {
680
- "text-fm-color-typo-secondary": !c.errors.length,
681
- "text-fm-color-system-error-300": c.errors.length
682
- }])
683
- }, [
684
- c.errors.length ? (I(), A("div", jt, [
685
- g("ol", null, [
686
- (I(!0), A(Y, null, Q(c.errors, (b, v) => (I(), A("li", { key: v }, C(b), 1))), 128))
687
- ])
688
- ])) : z("", !0)
689
- ], 2)) : z("", !0)
690
- ])
691
- ]);
692
- };
693
- }
694
- }), Ut = { class: "flex flex-col gap-24" }, Lt = { class: "fm-typo-en-body-md-400" }, Bt = {
695
- key: 0,
696
- class: "flex items-center gap-8"
697
- }, Nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zt = { class: "flex flex-col gap-8" }, Ot = { class: "line-clamp-2 text-ellipsis break-all" }, Wt = {
698
- key: 2,
699
- class: "shrink-0"
700
- }, Ht = {
701
- key: 0,
702
- class: "flex flex-col"
703
- }, Yt = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Kt = {
704
- key: 0,
705
- class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
706
- }, Gt = { class: "fm-typo-en-body-lg-600" }, Jt = /* @__PURE__ */ K({
707
- __name: "AdjustmentTemplateImport",
708
- setup(f) {
709
- const s = R(null), m = st(), h = Z(), a = R(!1), c = R(!1), l = R(new Array()), t = R([]), r = R([]), o = B(
710
- () => !!l.value.length || t.value.some((T) => T.errors.length) || r.value.some((T) => T.errors.length)
711
- ), u = B(
712
- () => !!t.value.length || !!r.value.length
713
- ), { t: b } = G();
714
- async function v(T) {
715
- l.value = [], t.value = [], r.value = [];
716
- try {
717
- a.value = !0;
718
- const [d] = await Promise.all([
719
- mt(T),
720
- // fake buffer
721
- new Promise((n) => setTimeout(n, 1e3))
722
- ]);
723
- if (!d.SheetNames.filter(
724
- (n) => !Object.values(he).map(String).includes(n)
725
- ).find((n) => n)) {
726
- l.value.push(b("inventory.ingredient.import.fileError.noSheet"));
727
- return;
728
- }
729
- const p = Ct(d);
730
- if (p.invalidExcel) {
731
- l.value.push(
732
- p.invalidExcelMessage ?? b("inventory.ingredient.import.fileError.invalidExcel")
733
- );
734
- return;
735
- }
736
- if (t.value = p.importCreateResult, r.value = p.importUpdateResult, !t.value.length && !r.value.length) {
737
- l.value.push(b("inventory.ingredient.import.fileError.noData"));
738
- return;
739
- }
740
- m.emitData(p);
741
- } catch (d) {
742
- h.open({
743
- title: b("inventory.ingredient.import.fileError.unableToRead"),
744
- message: d == null ? void 0 : d.message,
745
- type: "error"
746
- }), console.error("Error in reading file", d);
747
- } finally {
748
- l.value.length && h.open({
749
- title: b("inventory.ingredient.import.fileError.invalidExcel"),
750
- type: "error"
751
- }), a.value = !1;
752
- }
753
- }
754
- return ve(s, (T) => {
755
- T && v(T);
756
- }), (T, d) => {
757
- const x = D("FmCircularProgress"), k = D("FmIcon"), p = D("FmButton");
758
- return I(), A("div", Ut, [
759
- g("div", Lt, C(w(b)("inventory.adjustment.template.import.message")), 1),
760
- c.value ? (I(), A("div", Bt, [
761
- g("div", null, [
762
- S(x, {
763
- size: "md",
764
- color: "neutral-gray-200"
765
- })
766
- ]),
767
- g("div", Nt, C(w(b)("inventory.formField.loading")), 1)
768
- ])) : (I(), A(Y, { key: 1 }, [
769
- S(ft, {
770
- class: H({
771
- "w-full": !0,
772
- "h-[200px]": !s.value
773
- }),
774
- accept: ".xlsx",
775
- onFileUpload: d[0] || (d[0] = (n) => s.value = n),
776
- label: w(b)("inventory.ingredient.import.uploadTemplate"),
777
- "button-label": w(b)("inventory.ingredient.import.selectFile")
778
- }, Ue({ _: 2 }, [
779
- s.value ? {
780
- name: "default",
781
- fn: V(({ openFileDialog: n }) => [
782
- g("div", zt, [
783
- g("div", {
784
- class: H([
785
- "fm-corner-radius-md p-16 flex items-center gap-16",
786
- {
787
- "border border-fm-color-neutral-gray-100": a.value,
788
- "border border-fm-color-neutral-gray-200": !a.value && !o.value,
789
- "border border-fm-color-system-error-200": o.value
790
- }
791
- ])
792
- }, [
793
- a.value ? (I(), L(x, {
794
- key: 0,
795
- size: "md",
796
- color: "neutral-gray-200"
797
- })) : (I(), L(k, {
798
- key: 1,
799
- name: o.value ? "error" : "attach_file",
800
- outline: "",
801
- color: o.value ? "system-error-300" : void 0
802
- }, null, 8, ["name", "color"])),
803
- g("div", {
804
- class: H([
805
- "fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
806
- {
807
- "text-fm-color-typo-disabled": a.value,
808
- "text-fm-color-typo-primary": !a.value
809
- }
810
- ])
811
- }, [
812
- g("div", Ot, C(s.value.name), 1)
813
- ], 2),
814
- a.value ? z("", !0) : (I(), A("div", Wt, [
815
- S(p, {
816
- label: w(b)("inventory.ingredient.import.replaceFile"),
817
- variant: o.value ? "destructive" : "secondary",
818
- "prepend-icon": o.value ? void 0 : "autorenew",
819
- onClick: n
820
- }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
821
- ]))
822
- ], 2),
823
- l.value.length ? (I(), A("div", Ht, [
824
- (I(!0), A(Y, null, Q(l.value, (e, i) => (I(), A("div", {
825
- key: i,
826
- class: "flex gap-8 items-center"
827
- }, [
828
- S(k, {
829
- name: "error",
830
- size: "sm",
831
- color: "system-error-300"
832
- }),
833
- g("div", Yt, C(e), 1)
834
- ]))), 128))
835
- ])) : z("", !0)
836
- ])
837
- ]),
838
- key: "0"
839
- } : void 0
840
- ]), 1032, ["class", "label", "button-label"]),
841
- u.value ? (I(), A("div", Kt, [
842
- g("div", Gt, C(w(b)("inventory.ingredient.import.summary")), 1),
843
- (I(!0), A(Y, null, Q(t.value, (n, e) => (I(), L(je, {
844
- key: e,
845
- name: n.template.name,
846
- locations: n.template.locations,
847
- items: n.template.items,
848
- errors: n.errors,
849
- type: "create"
850
- }, null, 8, ["name", "locations", "items", "errors"]))), 128)),
851
- (I(!0), A(Y, null, Q(r.value, (n) => (I(), L(je, {
852
- key: n.template._id,
853
- name: n.template.name,
854
- locations: n.template.locations,
855
- items: n.template.items,
856
- errors: n.errors,
857
- type: "update"
858
- }, null, 8, ["name", "locations", "items", "errors"]))), 128))
859
- ])) : z("", !0)
860
- ], 64))
861
- ]);
862
- };
863
- }
864
- }), fe = ze("wastageTemplateAction", () => {
865
- const { t: f } = G(), s = X(), m = Z(), h = te(), a = vt(), c = ne(), { loading: l } = Oe(c), t = R({});
866
- function r() {
867
- t.value = {
868
- mode: J.CREATE,
869
- show: !0,
870
- "onUpdate:show"(e) {
871
- t.value.show = e;
872
- }
873
- };
874
- }
875
- function o(e) {
876
- t.value = {
877
- mode: J.UPDATE,
878
- modelValue: e,
879
- show: !0,
880
- "onUpdate:show"(i) {
881
- t.value.show = i;
882
- }
883
- };
884
- }
885
- function u(e, i, y) {
886
- s.open({
887
- title: `Confirm deleting template ${e.name}?`,
888
- message: "Deleted template can no longer be retrieved",
889
- primaryActions: {
890
- text: "Delete",
891
- variant: ie.Destructive,
892
- close: !0
893
- },
894
- secondaryActions: {
895
- text: "Cancel",
896
- variant: ie.Plain,
897
- close: !0
898
- }
899
- }).onPrimary(async () => {
900
- m.open({
901
- title: `Deleting ${e.name}`,
902
- type: "info"
903
- });
904
- try {
905
- i.value = !0;
906
- const [_] = await Promise.allSettled([
907
- h.deleteTemplate(e),
908
- new Promise(($) => setTimeout($, 1e3))
909
- ]);
910
- if (_.status === "rejected") throw _.reason;
911
- m.open({
912
- title: `Deleted ${e.name}`,
913
- type: "success"
914
- });
915
- } catch (_) {
916
- m.open({
917
- title: `Unable to delete ${e.name}`,
918
- message: `See error from server: ${_}`,
919
- type: "error"
920
- }), console.error("error on deleting adjustment template", _);
921
- } finally {
922
- i.value = !1, y();
923
- }
924
- });
925
- }
926
- function b(e, i, y) {
927
- let _;
928
- s.open({
929
- title: `Confirm duplicating template "${e.name}"?`,
930
- message: "Duplicated template can be edited after creation",
931
- primaryActions: {
932
- text: "Duplicate",
933
- variant: ie.Destructive,
934
- close: !0
935
- },
936
- secondaryActions: {
937
- text: "Cancel",
938
- variant: ie.Plain,
939
- close: !0
940
- },
941
- contentComponent: K({
942
- props: ["modelValue"],
943
- emits: ["update:modelValue"],
944
- setup($) {
945
- return () => P(W.FmTextField, {
946
- modelValue: $.modelValue,
947
- "onUpdate:modelValue": (F) => _ = F,
948
- label: "New Template Name",
949
- size: "md",
950
- variant: "primary"
951
- });
952
- }
953
- })
954
- }).onPrimary(async () => {
955
- m.open({
956
- title: `Duplicating "${e.name}"`,
957
- type: "info"
958
- });
959
- try {
960
- i.value = !0;
961
- const [$] = await Promise.allSettled([
962
- a.duplicateWastagetemplate(e._id, _),
963
- new Promise((F) => setTimeout(F, 1e3))
964
- ]);
965
- if ($.status === "rejected") throw $.reason;
966
- m.open({
967
- title: `Duplicated "${e.name}"`,
968
- type: "success"
969
- });
970
- } catch ($) {
971
- m.open({
972
- title: `Unable to duplicate "${e.name}"`,
973
- message: `See error from server: ${$}`,
974
- type: "error"
975
- }), console.error("error on duplicating adjustment template", $);
976
- } finally {
977
- i.value = !1, y();
978
- }
979
- });
980
- }
981
- const v = R({});
982
- function T(e) {
983
- v.value = {
984
- template: e,
985
- show: !0,
986
- "onUpdate:show"(i) {
987
- v.value.show = i;
988
- },
989
- "onAction:edit"() {
990
- v.value.show = !1, o(We(e));
991
- }
992
- };
993
- }
994
- function d() {
995
- if (!c.templates.length) {
996
- m.open({
997
- title: "No data to export",
998
- type: "error"
999
- });
1000
- return;
1001
- }
1002
- const e = wt(c.templates);
1003
- m.open({
1004
- title: f("inventory.ingredient.export.success"),
1005
- message: f("inventory.ingredient.export.filename", [e]),
1006
- type: "success"
1007
- });
1008
- }
1009
- function x() {
1010
- c.loading || s.open({
1011
- title: f("inventory.adjustment.template.import.title"),
1012
- contentComponent: Jt,
1013
- overlay: !0,
1014
- closeButton: !0,
1015
- primaryActions: {
1016
- text: f("common.import"),
1017
- close: !1
1018
- },
1019
- secondaryActions: {
1020
- text: f("common.close"),
1021
- close: !0
1022
- },
1023
- tertiaryActions: {
1024
- text: f("inventory.ingredient.import.actions.downloadTemplate"),
1025
- close: !1,
1026
- variant: "plain"
1027
- }
1028
- }).onPrimary((e) => {
1029
- if (!e) {
1030
- m.open({
1031
- title: f("inventory.ingredient.import.error.noData"),
1032
- type: "error"
1033
- });
1034
- return;
1035
- }
1036
- if (!e.importCreateResult.length && !e.importUpdateResult.length) {
1037
- m.open({
1038
- title: f("inventory.ingredient.import.error.invalidContent"),
1039
- message: f("inventory.ingredient.import.error.noImportData"),
1040
- type: "error"
1041
- });
1042
- return;
1043
- }
1044
- if (e.importCreateResult.some((i) => i.errors.length) || e.importUpdateResult.some((i) => i.errors.length)) {
1045
- m.open({
1046
- title: f("inventory.ingredient.import.error.invalidContent"),
1047
- message: f("inventory.ingredient.import.error.hasErrors"),
1048
- type: "error"
1049
- });
1050
- return;
1051
- }
1052
- s.close(), k(e);
1053
- }).onTertiary(Tt);
1054
- }
1055
- async function k(e) {
1056
- l.value = !0;
1057
- try {
1058
- const i = [
1059
- ...e.importCreateResult.map(
1060
- (F) => F.template
1061
- ),
1062
- ...e.importUpdateResult.map(
1063
- (F) => F.template
1064
- )
1065
- ], y = 100;
1066
- let _ = 0;
1067
- const $ = () => {
1068
- _ += y, m.open({
1069
- title: f("inventory.ingredient.import.progress", [
1070
- Math.min(_, i.length),
1071
- i.length
1072
- ])
1073
- });
1074
- };
1075
- for (const F of i.chunk(100))
1076
- $(), await h.importTemplates(F);
1077
- m.open({
1078
- title: f("inventory.ingredient.import.success"),
1079
- type: "success"
1080
- });
1081
- } catch (i) {
1082
- m.open({
1083
- title: f("inventory.ingredient.import.error.failed"),
1084
- message: f("inventory.ingredient.import.error.systemMessage", [i == null ? void 0 : i.message]),
1085
- type: "error"
1086
- }), console.error("Error in importing skus", e, i);
1087
- } finally {
1088
- l.value = !1, c.fetchTemplates();
1089
- }
1090
- }
1091
- const p = R({});
1092
- function n() {
1093
- p.value = {
1094
- show: !0,
1095
- "onUpdate:show"(e) {
1096
- p.value.show = e;
1097
- }
1098
- };
1099
- }
1100
- return {
1101
- createTemplate: r,
1102
- viewTemplate: T,
1103
- updateTemplate: o,
1104
- deleteTemplate: u,
1105
- duplicateTemplate: b,
1106
- exportTemplates: d,
1107
- importTemplates: x,
1108
- viewReason: n,
1109
- templateDialogProps: t,
1110
- templateDetailsProps: v,
1111
- templateReasonProps: p
1112
- };
1113
- });
1114
- function qt(f) {
1115
- const s = ee(), m = B(() => {
1116
- const a = /* @__PURE__ */ new Map();
1117
- for (const c of s.skus)
1118
- a.set(c._id, c);
1119
- return a;
1120
- });
1121
- return {
1122
- columnDefs: B(() => {
1123
- const a = f.items.map((l) => l.type !== "sku" ? 0 : m.value.get(l.id).unit.measurements.length).reduce((l, t) => Math.max(l, t), 0);
1124
- return [
1125
- {
1126
- id: "Delete",
1127
- header: "",
1128
- cell(l) {
1129
- const t = l.row.original;
1130
- return P(
1131
- "div",
1132
- { class: "w-full flex justify-end" },
1133
- P(W.FmButton, {
1134
- class: "delete-button",
1135
- key: t.id,
1136
- type: "button",
1137
- icon: "delete",
1138
- variant: "tertiary",
1139
- size: "md",
1140
- disabled: f.disabled,
1141
- onClick: () => {
1142
- f.deleteItem(t);
1143
- }
1144
- })
1145
- );
1146
- },
1147
- enableSorting: !1,
1148
- size: 40,
1149
- meta: {
1150
- cellClass: "",
1151
- headerClass: ""
1152
- }
1153
- },
1154
- {
1155
- id: "Name",
1156
- header: () => "Name",
1157
- enableSorting: !1,
1158
- size: 400,
1159
- minSize: 400,
1160
- accessorFn: (l) => `${l.name} ${l.code}`,
1161
- cell(l) {
1162
- const t = l.row.original;
1163
- return P("div", { class: "flex", style: { minWidth: "400px" } }, [
1164
- P(
1165
- "div",
1166
- {
1167
- class: "flex flex-col grow"
1168
- },
1169
- [
1170
- P(
1171
- W.FmTooltip,
1172
- {
1173
- content: t.name,
1174
- placement: "top",
1175
- variant: "plain",
1176
- zIndex: 50
1177
- },
1178
- P(
1179
- "span",
1180
- {
1181
- class: "flex-auto fm-typo-en-body-lg-400 text-fm-color-typo-primary line-clamp-1"
1182
- },
1183
- t.name
1184
- )
1185
- ),
1186
- P(
1187
- "span",
1188
- { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary line-clamp-1" },
1189
- t.code ?? ""
1190
- )
1191
- ]
1192
- ),
1193
- P(
1194
- "div",
1195
- {
1196
- class: "flex flex-col justify-center"
1197
- },
1198
- [
1199
- P(
1200
- W.FmChip,
1201
- {
1202
- compact: !0
1203
- },
1204
- t.type === "sku" ? "Ingredient" : t.type === "recipe" ? "Recipe" : "Menu"
1205
- )
1206
- ]
1207
- )
1208
- ]);
1209
- }
1210
- },
1211
- {
1212
- id: "Unit",
1213
- header: () => "Enable unit",
1214
- enableSorting: !1,
1215
- minSize: 200,
1216
- maxSize: 400,
1217
- cell(l) {
1218
- var o, u, b;
1219
- const t = l.row.original;
1220
- if (t.type !== "sku") return P("span", "N/A");
1221
- const r = m.value.get(t.id);
1222
- return P("div", { class: "flex items-center gap-32" }, [
1223
- P(
1224
- W.FmFormGroup,
1225
- {
1226
- value: r.unit._id,
1227
- modelValue: !((o = t.disabledMeasurements) != null && o.includes(r.unit._id))
1228
- },
1229
- P(
1230
- "div",
1231
- {
1232
- class: "flex items-center gap-4",
1233
- style: { width: "120px" }
1234
- },
1235
- [
1236
- P(W.FmCheckbox, {
1237
- value: r.unit._id,
1238
- modelValue: !((u = t.disabledMeasurements) != null && u.includes(r.unit._id)),
1239
- disabled: f.disabled || !((b = t.disabledMeasurements) != null && b.includes(r.unit._id)) && r.unit.measurements.every(
1240
- (v) => {
1241
- var T;
1242
- return (T = t.disabledMeasurements) == null ? void 0 : T.includes(v.id);
1243
- }
1244
- ),
1245
- "onUpdate:modelValue"(v) {
1246
- var T;
1247
- if (console.log("active", v), v)
1248
- f.updateItem({
1249
- ...t,
1250
- disabledMeasurements: (T = t.disabledMeasurements) == null ? void 0 : T.filter(
1251
- (d) => d !== r.unit._id
1252
- )
1253
- });
1254
- else {
1255
- const d = t.disabledMeasurements ?? [];
1256
- f.updateItem({
1257
- ...t,
1258
- disabledMeasurements: [...d, r.unit._id]
1259
- });
1260
- }
1261
- }
1262
- }),
1263
- P(
1264
- W.FmTooltip,
1265
- { zIndex: 51 },
1266
- {
1267
- content() {
1268
- return m.value.get(t.id).unit.abbrev;
1269
- },
1270
- default() {
1271
- const v = m.value.get(t.id);
1272
- return P(
1273
- "div",
1274
- { class: "line-clamp-2 fm-typo-en-body-lg-400" },
1275
- v.unit.abbrev
1276
- );
1277
- }
1278
- }
1279
- )
1280
- ]
1281
- )
1282
- ),
1283
- ...Array.from({ length: Math.max(a, 0) }).map((v, T) => {
1284
- var p, n, e, i;
1285
- const d = l.row.original, x = m.value.get(d.id), k = x.unit.measurements[T];
1286
- return k ? P(
1287
- W.FmFormGroup,
1288
- {
1289
- modelValue: !((p = d.disabledMeasurements) != null && p.includes(k.id)),
1290
- value: k.id
1291
- },
1292
- P(
1293
- "div",
1294
- {
1295
- class: "flex items-center gap-4",
1296
- style: { width: "120px" }
1297
- },
1298
- [
1299
- P(W.FmCheckbox, {
1300
- value: k.id,
1301
- modelValue: !((n = d.disabledMeasurements) != null && n.includes(k.id)),
1302
- disabled: f.disabled || !((e = d.disabledMeasurements) != null && e.includes(k.id)) && ((i = d.disabledMeasurements) == null ? void 0 : i.includes(x.unit._id)) && x.unit.measurements.filter((y) => y.id != k.id).every((y) => {
1303
- var _;
1304
- return (_ = d.disabledMeasurements) == null ? void 0 : _.includes(y.id);
1305
- }),
1306
- "onUpdate:modelValue"(y) {
1307
- var _;
1308
- if (console.log("active", y), y)
1309
- f.updateItem({
1310
- ...d,
1311
- disabledMeasurements: (_ = d.disabledMeasurements) == null ? void 0 : _.filter(
1312
- ($) => $ !== k.id
1313
- )
1314
- });
1315
- else {
1316
- const $ = d.disabledMeasurements ?? [];
1317
- f.updateItem({
1318
- ...d,
1319
- disabledMeasurements: [...$, k.id]
1320
- });
1321
- }
1322
- }
1323
- }),
1324
- P(
1325
- W.FmTooltip,
1326
- { zIndex: 51 },
1327
- {
1328
- content() {
1329
- return k.abbrev;
1330
- },
1331
- default() {
1332
- return P(
1333
- "div",
1334
- { class: "line-clamp-2 fm-typo-en-body-lg-400" },
1335
- k.abbrev
1336
- );
1337
- }
1338
- }
1339
- )
1340
- ]
1341
- )
1342
- ) : null;
1343
- })
1344
- ]);
1345
- }
1346
- }
1347
- ];
1348
- })
1349
- };
1350
- }
1351
- const Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center" }, Zt = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, en = /* @__PURE__ */ K({
1352
- __name: "WastageTemplateItemTable",
1353
- props: {
1354
- modelValue: {},
1355
- disabled: { type: Boolean }
1356
- },
1357
- emits: ["update:modelValue"],
1358
- setup(f, { expose: s, emit: m }) {
1359
- const h = f, a = R(h.modelValue), { t: c } = G(), l = m, t = ee(), r = X(), o = R(), u = R("");
1360
- s({
1361
- validateInputs: () => {
1362
- var d, x;
1363
- (x = (d = o.value) == null ? void 0 : d.validateInputs) == null || x.call(d);
1364
- },
1365
- resetInputsValidation: () => {
1366
- var d, x;
1367
- (x = (d = o.value) == null ? void 0 : d.resetInputsValidation) == null || x.call(d);
1368
- },
1369
- resetInputs: () => {
1370
- var d, x;
1371
- (x = (d = o.value) == null ? void 0 : d.resetInputs) == null || x.call(d);
1372
- }
1373
- });
1374
- const b = qt({
1375
- updateItem: (d) => {
1376
- a.value = a.value.map((x) => x.id !== d.id ? x : d), l("update:modelValue", a.value);
1377
- },
1378
- deleteItem: (d) => {
1379
- a.value = a.value.filter((x) => x.id !== d.id), l("update:modelValue", a.value);
1380
- },
1381
- get items() {
1382
- return a.value;
1383
- },
1384
- get disabled() {
1385
- return h.disabled;
1386
- }
1387
- }), v = B(() => b.columnDefs.value);
1388
- function T() {
1389
- var y;
1390
- const d = t.skus.map((_) => {
1391
- var $, F;
1392
- return {
1393
- type: "sku",
1394
- name: _.name,
1395
- description: _.code,
1396
- data: _,
1397
- searchKeys: ($ = _.customAttributes) != null && $.tag ? [(F = _.customAttributes) == null ? void 0 : F.tag] : void 0
1398
- };
1399
- }), x = t.recipes.map((_) => {
1400
- var $, F;
1401
- return {
1402
- type: "recipe",
1403
- name: _.name,
1404
- description: "",
1405
- data: _,
1406
- searchKeys: ($ = _.customAttributes) != null && $.tag ? [(F = _.customAttributes) == null ? void 0 : F.tag] : void 0
1407
- };
1408
- }), k = ((y = t.menu.cache) == null ? void 0 : y.modules.item.map((_) => ({
1409
- type: "menu",
1410
- name: _.name,
1411
- description: `${_.code}`,
1412
- data: _
1413
- }))) ?? [], p = [...d, ...x, ...k].map((_) => {
1414
- var F;
1415
- const $ = [_.type == "sku" ? "Ingredient" : _.type == "recipe" ? "Recipe" : "Menu"];
1416
- if (_.type == "sku" || _.type == "recipe") {
1417
- const E = (F = _.data.customAttributes) == null ? void 0 : F.tag;
1418
- E && $.push(E);
1419
- }
1420
- return {
1421
- label: _.name,
1422
- sublabel: _.description,
1423
- value: _,
1424
- tags: $,
1425
- searchKeys: _.searchKeys
1426
- };
1427
- }), n = /* @__PURE__ */ new Set();
1428
- p.forEach((_) => {
1429
- _.tags && _.tags.forEach(($) => {
1430
- n.add($);
1431
- });
1432
- });
1433
- const e = n.size > 0 ? [
1434
- {
1435
- type: "string",
1436
- key: "tags",
1437
- entity: "item",
1438
- values: Array.from(n)
1439
- }
1440
- ] : [], i = p.filter((_) => a.value.find(($) => $.id === _.value.data._id)).map((_) => _.value);
1441
- r.open({
1442
- title: c("inventory.closing.form.items.selectItem"),
1443
- closeButton: !0,
1444
- contentComponent: bt,
1445
- contentComponentProps: {
1446
- modelValue: i,
1447
- items: p,
1448
- virtualScroll: !0,
1449
- filterAttributes: e
1450
- },
1451
- primaryActions: {
1452
- text: c("common.confirm"),
1453
- close: !0
1454
- },
1455
- secondaryActions: {
1456
- text: c("common.close"),
1457
- close: !0,
1458
- variant: "tertiary"
1459
- }
1460
- }).onPrimary((_) => {
1461
- const $ = a.value ?? [], F = _.map((M) => {
1462
- const E = $.find((N) => N.id === M.data._id);
1463
- return E ? {
1464
- ...E
1465
- } : {
1466
- id: M.data._id,
1467
- name: M.name,
1468
- code: M.description,
1469
- type: M.type,
1470
- disabledMeasurements: []
1471
- };
1472
- });
1473
- F.sort((M, E) => M.name.localeCompare(E.name)), console.log(a.value), a.value = F, l("update:modelValue", a.value);
1474
- });
1475
- }
1476
- return (d, x) => {
1477
- const k = D("FmButton"), p = D("FmIcon"), n = D("FmTextField"), e = D("FmTable"), i = D("FmFormGroup");
1478
- return I(), A("div", Qt, [
1479
- g("div", Xt, [
1480
- g("div", Zt, C(w(c)("inventory.closing.form.items.title")), 1),
1481
- S(k, {
1482
- disabled: d.disabled,
1483
- label: w(c)("inventory.closing.form.items.addItem"),
1484
- "prepend-icon": "add",
1485
- variant: "plain",
1486
- class: "border-2 rounded-lg border-fm-color-primary",
1487
- onClick: x[0] || (x[0] = (y) => T()),
1488
- size: "md"
1489
- }, null, 8, ["disabled", "label"])
1490
- ]),
1491
- S(n, {
1492
- placeholder: "Filter items",
1493
- modelValue: u.value,
1494
- "onUpdate:modelValue": x[2] || (x[2] = (y) => u.value = y)
1495
- }, Ue({ _: 2 }, [
1496
- u.value ? {
1497
- name: "append",
1498
- fn: V(() => [
1499
- S(p, {
1500
- name: "close",
1501
- onClick: x[1] || (x[1] = (y) => u.value = ""),
1502
- class: "cursor-pointer"
1503
- })
1504
- ]),
1505
- key: "0"
1506
- } : void 0
1507
- ]), 1032, ["modelValue"]),
1508
- (I(), L(e, {
1509
- "search-value": u.value,
1510
- "column-defs": v.value,
1511
- "row-data": a.value,
1512
- key: a.value.map((y) => y.id).join("."),
1513
- "hide-footer": a.value.length <= 10,
1514
- "page-size": Math.min(10, a.value.length)
1515
- }, null, 8, ["search-value", "column-defs", "row-data", "hide-footer", "page-size"])),
1516
- S(i, {
1517
- "model-value": a.value.length,
1518
- rules: [w(yt)(1)]
1519
- }, null, 8, ["model-value", "rules"])
1520
- ]);
1521
- };
1522
- }
1523
- }), tn = { class: "flex flex-col gap-16" }, nn = { class: "flex flex-col gap-24" }, on = { class: "flex flex-col gap-16" }, sn = { class: "flex items-center" }, an = { class: "flex-1 fm-typo-en-title-sm-600" }, ln = /* @__PURE__ */ K({
1524
- __name: "WastageTemplateForm",
1525
- props: {
1526
- modelValue: {},
1527
- disabled: { type: Boolean }
1528
- },
1529
- setup(f, { expose: s }) {
1530
- const m = ht(), { t: h } = G(), {
1531
- promptSelectLocations: a,
1532
- columnDefs: c,
1533
- rowData: l
1534
- } = gt({
1535
- getLocations() {
1536
- return m.locations;
1537
- },
1538
- setLocations(r) {
1539
- m.locations = r;
1540
- }
1541
- }), t = R();
1542
- return s({
1543
- validateInputs: () => {
1544
- var r, o;
1545
- (o = (r = t.value) == null ? void 0 : r.validateInputs) == null || o.call(r);
1546
- },
1547
- resetInputsValidation: () => {
1548
- var r, o;
1549
- (o = (r = t.value) == null ? void 0 : r.resetInputsValidation) == null || o.call(r);
1550
- },
1551
- resetInputs: () => {
1552
- var r, o;
1553
- (o = (r = t.value) == null ? void 0 : r.resetInputs) == null || o.call(r);
1554
- }
1555
- }), (r, o) => {
1556
- const u = D("FmTextField"), b = D("FmButton"), v = D("FmTable"), T = D("FmForm");
1557
- return I(), L(T, {
1558
- ref_key: "formRef",
1559
- ref: t,
1560
- class: "flex flex-col gap-32",
1561
- disabled: r.disabled
1562
- }, {
1563
- default: V(() => [
1564
- g("div", tn, [
1565
- g("div", nn, [
1566
- S(u, {
1567
- label: w(h)("inventory.closing.form.name"),
1568
- "label-mark": "required",
1569
- modelValue: w(m).name,
1570
- "onUpdate:modelValue": o[0] || (o[0] = (d) => w(m).name = d),
1571
- rules: [w(Ge)()]
1572
- }, null, 8, ["label", "modelValue", "rules"])
1573
- ])
1574
- ]),
1575
- g("div", on, [
1576
- g("div", sn, [
1577
- g("div", an, C(w(h)("inventory.closing.form.locations")), 1),
1578
- S(b, {
1579
- disabled: r.disabled,
1580
- label: w(h)("inventory.closing.form.selectLocation"),
1581
- "prepend-icon": "add",
1582
- variant: "plain",
1583
- class: "border-2 rounded-lg border-fm-color-primary",
1584
- onClick: w(a)
1585
- }, null, 8, ["disabled", "label", "onClick"])
1586
- ]),
1587
- S(v, {
1588
- "column-defs": w(c),
1589
- "row-data": w(l),
1590
- "shrink-at": 9999,
1591
- onRowClick: w(a),
1592
- "hide-footer": ""
1593
- }, null, 8, ["column-defs", "row-data", "onRowClick"])
1594
- ]),
1595
- S(en, {
1596
- "model-value": w(m).items,
1597
- "onUpdate:modelValue": o[1] || (o[1] = (d) => w(m).items = d)
1598
- }, null, 8, ["model-value"])
1599
- ]),
1600
- _: 1
1601
- }, 8, ["disabled"]);
1602
- };
1603
- }
1604
- }), rn = { class: "flex items-center" }, cn = { class: "fm-typo-en-title-md-600" }, un = { class: "flex justify-between" }, mn = { class: "fm-typo-en-body-lg-600" }, dn = { class: "flex flex-col gap-8" }, pn = { class: "flex flex-col gap-4" }, fn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vn = { class: "flex items-center gap-8" }, yn = { class: "fm-typo-en-body-lg-600" }, hn = { class: "flex gap-4" }, gn = /* @__PURE__ */ K({
1605
- __name: "WastageTemplateDialog",
1606
- props: {
1607
- mode: {},
1608
- modelValue: {},
1609
- show: { type: Boolean }
1610
- },
1611
- emits: ["update:show", "submitted"],
1612
- setup(f, { expose: s, emit: m }) {
1613
- var e;
1614
- const h = f, a = m, c = te(), l = Z(), { t } = G(), r = Ne(h, "show");
1615
- function o() {
1616
- return {
1617
- _id: "",
1618
- name: "",
1619
- type: de.Enum.WASTAGE,
1620
- items: []
1621
- };
1622
- }
1623
- const u = R(h.modelValue ?? o()), b = R(((e = h.modelValue) == null ? void 0 : e._id) ?? `${Math.random()}`);
1624
- ve(
1625
- () => h.show,
1626
- (i) => {
1627
- var y;
1628
- i && (u.value = h.modelValue ?? o(), b.value = ((y = h.modelValue) == null ? void 0 : y._id) ?? `${Math.random()}`);
1629
- }
1630
- );
1631
- const v = R(!1), T = B(() => {
1632
- switch (h.mode) {
1633
- case J.READ:
1634
- return "";
1635
- case J.CREATE:
1636
- return t("inventory.adjustment.template.create.title");
1637
- case J.UPDATE:
1638
- return t("inventory.adjustment.template.update.title");
1639
- }
1640
- return "";
1641
- }), d = R();
1642
- s({
1643
- validateInputs: () => {
1644
- var i, y;
1645
- (y = (i = d.value) == null ? void 0 : i.validateInputs) == null || y.call(i);
1646
- },
1647
- resetInputsValidation: () => {
1648
- var i, y;
1649
- (y = (i = d.value) == null ? void 0 : i.resetInputsValidation) == null || y.call(i);
1650
- },
1651
- resetInputs: () => {
1652
- var i, y;
1653
- (y = (i = d.value) == null ? void 0 : i.resetInputs) == null || y.call(i);
1654
- }
1655
- });
1656
- async function x() {
1657
- const i = u.value;
1658
- if (i) {
1659
- v.value = !0;
1660
- try {
1661
- await c.createTemplate(i), await new Promise((y) => setTimeout(y, 1e3)), l.open({
1662
- title: t("inventory.adjustment.template.create.success"),
1663
- message: t("inventory.adjustment.template.create.successMessage"),
1664
- type: "success"
1665
- }), a("update:show", !1), a("submitted");
1666
- } catch (y) {
1667
- l.open({
1668
- title: t("inventory.adjustment.template.create.error"),
1669
- message: t("inventory.adjustment.template.create.errorMessage"),
1670
- type: "error"
1671
- }), console.error("Error in creating adjustment template", y);
1672
- } finally {
1673
- v.value = !1;
1674
- }
1675
- }
1676
- }
1677
- async function k() {
1678
- const i = u.value;
1679
- if (i) {
1680
- v.value = !0;
1681
- try {
1682
- await c.updateTemplate({
1683
- ...i,
1684
- _rev: i._rev ?? ""
1685
- }), await new Promise((y) => setTimeout(y, 1e3)), l.open({
1686
- title: t("inventory.adjustment.template.update.success"),
1687
- message: t("inventory.adjustment.template.update.successMessage"),
1688
- type: "success"
1689
- }), a("update:show", !1), a("submitted");
1690
- } catch (y) {
1691
- l.open({
1692
- title: t("inventory.adjustment.template.update.error"),
1693
- message: t("inventory.adjustment.template.update.errorMessage"),
1694
- type: "error"
1695
- }), console.error("Error in updating adjustment template", y);
1696
- } finally {
1697
- v.value = !1;
1698
- }
1699
- }
1700
- }
1701
- function p() {
1702
- switch (h.mode) {
1703
- case J.CREATE:
1704
- return x();
1705
- case J.UPDATE:
1706
- return k();
1707
- }
1708
- }
1709
- function n() {
1710
- var i, y;
1711
- (y = (i = d.value) == null ? void 0 : i.validateInputs) == null || y.call(i);
1712
- }
1713
- return (i, y) => {
1714
- const _ = D("FmMenuDivider"), $ = D("FmCard"), F = D("FmButton"), M = D("FmSideSheet");
1715
- return I(), L(M, {
1716
- modelValue: w(r),
1717
- "onUpdate:modelValue": y[2] || (y[2] = (E) => Le(r) ? r.value = E : null),
1718
- "dismiss-away": "",
1719
- "close-button": "",
1720
- "max-width": 800
1721
- }, {
1722
- "side-sheet-header": V(() => [
1723
- g("div", rn, [
1724
- g("div", cn, C(T.value), 1)
1725
- ])
1726
- ]),
1727
- default: V(() => [
1728
- u.value.updatedAt ? (I(), A(Y, { key: 0 }, [
1729
- u.value.updatedAt ? (I(), L($, {
1730
- key: 0,
1731
- variant: "outlined",
1732
- class: "flex flex-col gap-8 px-12 py-16 mb-16"
1733
- }, {
1734
- default: V(() => {
1735
- var E;
1736
- return [
1737
- g("div", un, [
1738
- g("div", mn, C(w(t)("inventory.transfer.template.details.templateSummary")), 1)
1739
- ]),
1740
- S(_),
1741
- g("div", dn, [
1742
- g("div", pn, [
1743
- g("div", fn, C(w(t)("inventory.transfer.receiveRequest.details.updatedAt")), 1),
1744
- g("div", vn, [
1745
- g("div", yn, [
1746
- me(C(w(ue)(u.value.updatedAt)) + " ", 1),
1747
- (E = u.value.updatedBy) != null && E.name ? (I(), A(Y, { key: 0 }, [
1748
- me(" (" + C(u.value.updatedBy.name) + ") ", 1)
1749
- ], 64)) : z("", !0)
1750
- ]),
1751
- S(_t, {
1752
- "adjustment-id": u.value._id
1753
- }, null, 8, ["adjustment-id"])
1754
- ])
1755
- ])
1756
- ])
1757
- ];
1758
- }),
1759
- _: 1
1760
- })) : z("", !0)
1761
- ], 64)) : z("", !0),
1762
- (I(), L(ln, {
1763
- class: "w-full",
1764
- ref_key: "formRef",
1765
- ref: d,
1766
- onValidationSuccess: p,
1767
- "model-value": u.value,
1768
- "onUpdate:modelValue": y[0] || (y[0] = (E) => u.value = E),
1769
- disabled: v.value,
1770
- key: b.value
1771
- }, null, 8, ["model-value", "disabled"]))
1772
- ]),
1773
- "side-sheet-footer": V(() => [
1774
- g("div", hn, [
1775
- S(F, {
1776
- loading: v.value,
1777
- label: w(t)("common.save"),
1778
- onClick: n
1779
- }, null, 8, ["loading", "label"]),
1780
- S(F, {
1781
- disabled: v.value,
1782
- variant: "tertiary",
1783
- label: w(t)("common.close"),
1784
- onClick: y[1] || (y[1] = (E) => a("update:show", !1))
1785
- }, null, 8, ["disabled", "label"])
1786
- ])
1787
- ]),
1788
- _: 1
1789
- }, 8, ["modelValue"]);
1790
- };
1791
- }
1792
- }), bn = {};
1793
- function _n(f, s) {
1794
- return I(), A("div");
1795
- }
1796
- const xn = /* @__PURE__ */ xt(bn, [["render", _n]]), wn = { class: "flex flex-col gap-40" }, Tn = { key: 0 }, kn = {
1797
- key: 1,
1798
- class: "flex gap-8 items-center"
1799
- }, $n = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, In = {
1800
- key: 2,
1801
- class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary"
1802
- }, Sn = {
1803
- key: 3,
1804
- class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary flex flex-col gap-12"
1805
- }, Fn = { class: "fm-typo-en-body-md-600" }, Cn = { class: "fm-typo-en-body-md-600" }, An = { key: 4 }, Mn = { class: "fm-typo-en-body-md-600" }, Rn = { class: "fm-typo-en-body-md-600" }, Dn = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, En = /* @__PURE__ */ K({
1806
- __name: "WastageTemplatePublish",
1807
- emits: ["close"],
1808
- setup(f, { emit: s }) {
1809
- const m = R(!1), h = Z(), a = te(), c = ne(), { t: l } = G(), t = s;
1810
- async function r() {
1811
- m.value = !0;
1812
- try {
1813
- await a.startNewPublish().delayed(1e3), h.open({
1814
- title: "Success",
1815
- message: "You may refresh after a while to review publish status",
1816
- type: "success"
1817
- }), b();
1818
- } catch (v) {
1819
- h.open({
1820
- title: "Something went wrong",
1821
- message: "Please try again",
1822
- type: "error"
1823
- }), console.error("error on creating publish task", v);
1824
- } finally {
1825
- m.value = !1;
1826
- }
1827
- }
1828
- const o = B(() => c.recentPublish.recentJob), u = B(
1829
- () => c.templates.length && (!o.value || o.value.outlets.length === o.value.completed.length)
1830
- );
1831
- function b() {
1832
- t("close");
1833
- }
1834
- return (v, T) => {
1835
- const d = D("FmCircularProgress"), x = D("i18n-t"), k = D("FmButton");
1836
- return I(), A("div", wn, [
1837
- w(c).templates.length ? m.value ? (I(), A("div", kn, [
1838
- g("div", null, [
1839
- S(d, {
1840
- size: "md",
1841
- color: "neutral-gray-300"
1842
- })
1843
- ]),
1844
- g("div", $n, [
1845
- g("span", null, C(w(l)("inventory.adjustment.template.publish.publishing")), 1)
1846
- ])
1847
- ])) : o.value ? o.value.outlets.length === o.value.completed.length ? (I(), A("div", Sn, [
1848
- S(x, {
1849
- keypath: "inventory.adjustment.template.publish.recentlyPublishedAt",
1850
- tag: "p"
1851
- }, {
1852
- started: V(() => [
1853
- g("span", Fn, C(w(ue)(new Date(o.value.createdAt))), 1)
1854
- ]),
1855
- finished: V(() => [
1856
- g("span", Cn, C(w(ue)(new Date(o.value.updatedAt))), 1)
1857
- ]),
1858
- _: 1
1859
- }),
1860
- g("p", null, C(w(l)("inventory.adjustment.template.publish.message")), 1)
1861
- ])) : (I(), A("div", An, [
1862
- S(x, {
1863
- keypath: "inventory.adjustment.template.publish.stillPublishing",
1864
- tag: "p"
1865
- }, {
1866
- started: V(() => [
1867
- g("span", Mn, C(w(ue)(new Date(o.value.createdAt))), 1)
1868
- ]),
1869
- progress: V(() => [
1870
- g("span", Rn, " (" + C(o.value.completed.length) + "/" + C(o.value.outlets.length) + " completed) ", 1)
1871
- ]),
1872
- _: 1
1873
- }),
1874
- me(" Your recent publishing task is still pending (" + C(o.value.completed.length) + " / " + C(o.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
1875
- ])) : (I(), A("div", In, [
1876
- g("p", null, C(w(l)("inventory.adjustment.template.publish.noRecentActivity")), 1),
1877
- g("p", null, C(w(l)("inventory.adjustment.template.publish.message")), 1)
1878
- ])) : (I(), A("div", Tn, [
1879
- g("p", null, C(w(l)("inventory.adjustment.template.publish.nothingToPublish")), 1)
1880
- ])),
1881
- g("div", Dn, [
1882
- S(k, {
1883
- disabled: !u.value,
1884
- loading: m.value,
1885
- label: "Publish to all outlets",
1886
- onClick: r
1887
- }, null, 8, ["disabled", "loading"]),
1888
- S(k, {
1889
- variant: "tertiary",
1890
- label: "Close",
1891
- onClick: b
1892
- })
1893
- ])
1894
- ]);
1895
- };
1896
- }
1897
- }), Pn = { class: "flex flex-col gap-16" }, Vn = { class: "flex" }, jn = { class: "flex gap-24" }, Un = { class: "flex" }, Ln = { class: "flex-1" }, Bn = { class: "flex" }, Nn = { class: "flex gap-8 items-center justify-start" }, zn = /* @__PURE__ */ K({
1898
- __name: "WastageTemplateReason",
1899
- props: {
1900
- show: { type: Boolean }
1901
- },
1902
- emits: ["update:show", "submitted"],
1903
- setup(f, { emit: s }) {
1904
- const m = f, h = Ne(m, "show"), a = R(""), c = Z(), l = X(), t = R([]), r = s, o = ne(), u = te(), b = R(!1);
1905
- ve(
1906
- () => m.show,
1907
- (p) => {
1908
- var n;
1909
- p && (t.value = ((n = o.reasons) == null ? void 0 : n.value) ?? []);
1910
- }
1911
- );
1912
- const v = (p) => {
1913
- if (t.value.indexOf(t.value[p]) === -1)
1914
- return;
1915
- const n = t.value[p];
1916
- if (n.trim() === "") {
1917
- t.value.splice(p, 1);
1918
- return;
1919
- }
1920
- l.open({
1921
- title: "Delete reason",
1922
- message: `Are you sure you want to delete this reason? "${n}"`,
1923
- primaryActions: {
1924
- text: "Delete",
1925
- close: !0,
1926
- variant: "destructive"
1927
- },
1928
- secondaryActions: {
1929
- text: "Cancel",
1930
- close: !0,
1931
- variant: "secondary"
1932
- }
1933
- }).onPrimary(() => {
1934
- t.value.splice(p, 1);
1935
- });
1936
- }, T = () => {
1937
- t.value.push("");
1938
- const p = a.value.trim();
1939
- if (p) {
1940
- if (t.value.some((n) => n === p)) {
1941
- c.open({
1942
- title: "Reason already exists",
1943
- message: "Please enter a different reason",
1944
- type: "error"
1945
- });
1946
- return;
1947
- }
1948
- a.value = "";
1949
- }
1950
- }, d = async () => {
1951
- const p = t.value.map((n) => n.trim()).filter((n) => n);
1952
- if (o.reasons) {
1953
- b.value = !0;
1954
- try {
1955
- await u.update({
1956
- _id: o.reasons._id,
1957
- _rev: o.reasons._rev,
1958
- value: p
1959
- }), c.open({
1960
- title: "Reasons updated",
1961
- message: "Reasons have been updated successfully",
1962
- type: "success"
1963
- }), r("update:show", !1), r("submitted");
1964
- } catch {
1965
- c.open({
1966
- title: "Error updating reasons",
1967
- message: "There was an error updating reasons",
1968
- type: "error"
1969
- });
1970
- } finally {
1971
- b.value = !1;
1972
- }
1973
- }
1974
- }, x = R(), k = () => {
1975
- var p, n;
1976
- (n = (p = x.value) == null ? void 0 : p.validateInputs) == null || n.call(p);
1977
- };
1978
- return (p, n) => {
1979
- const e = D("FmButton"), i = D("FmAvatar"), y = D("FmTextField"), _ = D("FmList"), $ = D("FmForm"), F = D("FmSideSheet");
1980
- return I(), L(F, {
1981
- modelValue: w(h),
1982
- "onUpdate:modelValue": n[0] || (n[0] = (M) => Le(h) ? h.value = M : null),
1983
- header: "Reason for wastage",
1984
- "close-button": "",
1985
- "dismiss-away": !b.value,
1986
- "max-width": 500
1987
- }, {
1988
- default: V(() => [
1989
- S($, {
1990
- ref_key: "formRef",
1991
- ref: x,
1992
- class: "flex flex-col gap-32",
1993
- blameFormChildOnValidationFailed: "",
1994
- onValidationSuccess: d
1995
- }, {
1996
- default: V(() => [
1997
- g("div", Pn, [
1998
- g("div", Vn, [
1999
- S(e, {
2000
- class: "ml-auto px-5",
2001
- variant: "primary",
2002
- label: "Add new reason",
2003
- size: "md",
2004
- onClick: T
2005
- })
2006
- ])
2007
- ]),
2008
- g("div", jn, [
2009
- S(_, {
2010
- class: "w-full",
2011
- separator: ""
2012
- }, {
2013
- default: V(() => [
2014
- (I(!0), A(Y, null, Q(t.value, (M, E) => (I(), A("div", {
2015
- key: E,
2016
- class: "flex items-center gap-8 px-1 py-2"
2017
- }, [
2018
- g("div", Un, [
2019
- S(i, {
2020
- initials: String(E + 1),
2021
- size: "sm"
2022
- }, null, 8, ["initials"])
2023
- ]),
2024
- g("div", Ln, [
2025
- S(y, {
2026
- class: "cursor-pointer text-fm-color-typo-tertiary",
2027
- modelValue: t.value[E],
2028
- "onUpdate:modelValue": (q) => t.value[E] = q,
2029
- maxLength: 500,
2030
- rules: [w(Ge)()]
2031
- }, null, 8, ["modelValue", "onUpdate:modelValue", "rules"])
2032
- ]),
2033
- g("div", Bn, [
2034
- S(e, {
2035
- variant: "tertiary",
2036
- size: "md",
2037
- "prepend-icon": "delete",
2038
- onClick: (q) => v(E)
2039
- }, null, 8, ["onClick"])
2040
- ])
2041
- ]))), 128))
2042
- ]),
2043
- _: 1
2044
- })
2045
- ])
2046
- ]),
2047
- _: 1
2048
- }, 512)
2049
- ]),
2050
- "side-sheet-footer": V(() => [
2051
- g("div", Nn, [
2052
- S(e, {
2053
- variant: "primary",
2054
- label: "Save",
2055
- size: "lg",
2056
- onClick: k,
2057
- disabled: b.value,
2058
- loading: b.value
2059
- }, null, 8, ["disabled", "loading"]),
2060
- S(e, {
2061
- variant: "secondary",
2062
- label: "Close",
2063
- size: "lg"
2064
- })
2065
- ])
2066
- ]),
2067
- _: 1
2068
- }, 8, ["modelValue", "dismiss-away"]);
2069
- };
2070
- }
2071
- }), On = { class: "flex items-center gap-5" }, Wn = { class: "flex items-center gap-2" }, Hn = { class: "flex-1 flex flex-col gap-8" }, Yn = { class: "flex flex-col" }, Kn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Gn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Jn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, xo = /* @__PURE__ */ K({
2072
- __name: "WastageTemplateView",
2073
- setup(f) {
2074
- const { t: s } = G(), { createTemplate: m, updateTemplate: h, exportTemplates: a, importTemplates: c, viewReason: l } = fe(), { templateDialogProps: t, templateDetailsProps: r, templateReasonProps: o } = Oe(
2075
- fe()
2076
- ), u = ye(), b = X(), v = ne(), T = tt(), { breakpoints: d } = at();
2077
- u.watchLocation(v.fetchTemplates);
2078
- const x = B(() => v.loading), k = R(""), p = B(() => d.value.xs || d.value.sm), n = B(() => p.value ? 10 : 20);
2079
- function e(F) {
2080
- switch (F) {
2081
- case U.Add:
2082
- return m();
2083
- case "publish":
2084
- return i();
2085
- case "import":
2086
- return c();
2087
- case "export":
2088
- return a();
2089
- case "refresh":
2090
- return v.fetchTemplates();
2091
- }
2092
- }
2093
- function i() {
2094
- b.open({
2095
- title: "Publish wastage templates",
2096
- contentComponent: En,
2097
- contentComponentProps: {
2098
- onClose() {
2099
- b.close();
2100
- }
2101
- }
2102
- });
2103
- }
2104
- function y(F) {
2105
- return F;
2106
- }
2107
- const _ = B(() => p.value ? [
2108
- {
2109
- label: s("inventory.adjustment.template.create.title"),
2110
- value: U.Add,
2111
- isPrimary: !0,
2112
- prependIcon: "add"
2113
- },
2114
- {
2115
- label: s("inventory.common.refresh"),
2116
- value: "refresh",
2117
- isPrimary: !1
2118
- },
2119
- {
2120
- label: s("inventory.common.publish"),
2121
- value: "publish",
2122
- isPrimary: !1
2123
- },
2124
- {
2125
- label: s("inventory.common.import"),
2126
- value: "import",
2127
- isPrimary: !1
2128
- },
2129
- {
2130
- label: s("inventory.common.export"),
2131
- value: "export",
2132
- isPrimary: !1
2133
- }
2134
- ] : [
2135
- {
2136
- label: s("inventory.adjustment.template.create.title"),
2137
- value: U.Add,
2138
- isPrimary: !0,
2139
- prependIcon: "add"
2140
- },
2141
- {
2142
- label: s("inventory.common.publish"),
2143
- value: "publish",
2144
- isPrimary: !1
2145
- },
2146
- {
2147
- label: s("inventory.common.import"),
2148
- value: "import",
2149
- isPrimary: !1
2150
- },
2151
- {
2152
- label: s("inventory.common.refresh"),
2153
- value: "refresh",
2154
- isPrimary: !1
2155
- },
2156
- {
2157
- label: s("inventory.common.export"),
2158
- value: "export",
2159
- isPrimary: !1
2160
- }
2161
- ]), $ = () => {
2162
- l();
2163
- };
2164
- return (F, M) => {
2165
- const E = D("FmButton"), q = D("FmTable");
2166
- return I(), A(Y, null, [
2167
- S(nt, {
2168
- title: w(s)("inventory.adjustment.template.wastage.title"),
2169
- actions: _.value,
2170
- "onClick:action": e
2171
- }, {
2172
- default: V(() => [
2173
- g("div", {
2174
- class: H([
2175
- "flex flex-col gap-8 max-h-full",
2176
- {
2177
- "p-0": p.value,
2178
- "px-24 ": !p.value
2179
- }
2180
- ])
2181
- }, [
2182
- g("div", On, [
2183
- S(E, {
2184
- class: "ml-auto",
2185
- "prepend-icon": "edit",
2186
- key: "Reason for wastage",
2187
- label: "Default label",
2188
- "bg-color": "neutral-gray-100",
2189
- "text-color": "neutral-gray-400",
2190
- onClick: $
2191
- }, {
2192
- default: V(() => [
2193
- g("div", Wn, [
2194
- M[4] || (M[4] = g("span", null, "Reasons", -1)),
2195
- g("div", {
2196
- class: H([
2197
- "fm-status-badge",
2198
- w(v).isReasonPublished() ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
2199
- ])
2200
- }, C(w(v).isReasonPublished() ? "Published" : "Unpublished"), 3)
2201
- ])
2202
- ]),
2203
- _: 1
2204
- }),
2205
- S(ot, {
2206
- class: "flex-1",
2207
- searchable: "",
2208
- search: k.value,
2209
- "onUpdate:search": M[0] || (M[0] = (N) => k.value = N)
2210
- }, null, 8, ["search"])
2211
- ]),
2212
- S(q, {
2213
- style: Qe(w(T).tableHeight),
2214
- "column-defs": w(v).columnDefs,
2215
- "row-data": w(v).templates,
2216
- "search-value": k.value,
2217
- loading: x.value,
2218
- onRowClick: M[1] || (M[1] = (N) => w(h)(N.original)),
2219
- "page-size": n.value
2220
- }, {
2221
- "list-row": V((N) => [
2222
- S(rt, {
2223
- row: N,
2224
- onRowClick: (O) => w(h)(O)
2225
- }, {
2226
- default: V((O) => {
2227
- var ge, be, _e, oe, xe, we, Te, ke, se, $e, Ie, Se, Fe, Ce, Ae, ae, Me, Re, De, Ee, le, Pe;
2228
- return [
2229
- g("div", Hn, [
2230
- g("div", Yn, [
2231
- g("div", Kn, [
2232
- S(w(ce), {
2233
- render: (_e = (be = (ge = O._id) == null ? void 0 : ge.column) == null ? void 0 : be.columnDef) == null ? void 0 : _e.cell,
2234
- props: (xe = (oe = O._id) == null ? void 0 : oe.getContext) == null ? void 0 : xe.call(oe)
2235
- }, null, 8, ["render", "props"])
2236
- ]),
2237
- g("div", Gn, [
2238
- S(w(ce), {
2239
- render: (ke = (Te = (we = O.name) == null ? void 0 : we.column) == null ? void 0 : Te.columnDef) == null ? void 0 : ke.cell,
2240
- props: ($e = (se = O.name) == null ? void 0 : se.getContext) == null ? void 0 : $e.call(se)
2241
- }, null, 8, ["render", "props"])
2242
- ]),
2243
- g("div", null, C((Ie = N.original.locations) != null && Ie.length ? w(s)("inventory.adjustment.template.table.enabledForN", {
2244
- count: ((Se = N.original.locations) == null ? void 0 : Se.length) ?? 0
2245
- }) : w(s)("inventory.adjustment.template.table.enabledForAll")), 1),
2246
- M[5] || (M[5] = g("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, null, -1)),
2247
- g("div", Jn, [
2248
- S(w(ce), {
2249
- render: (Ae = (Ce = (Fe = O.ref) == null ? void 0 : Fe.column) == null ? void 0 : Ce.columnDef) == null ? void 0 : Ae.cell,
2250
- props: (Me = (ae = O.ref) == null ? void 0 : ae.getContext) == null ? void 0 : Me.call(ae)
2251
- }, null, 8, ["render", "props"])
2252
- ])
2253
- ]),
2254
- g("div", null, [
2255
- S(w(ce), {
2256
- render: (Ee = (De = (Re = O.status) == null ? void 0 : Re.column) == null ? void 0 : De.columnDef) == null ? void 0 : Ee.cell,
2257
- props: (Pe = (le = O.status) == null ? void 0 : le.getContext) == null ? void 0 : Pe.call(le)
2258
- }, null, 8, ["render", "props"])
2259
- ])
2260
- ])
2261
- ];
2262
- }),
2263
- _: 2
2264
- }, 1032, ["row", "onRowClick"])
2265
- ]),
2266
- _: 1
2267
- }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
2268
- ], 2)
2269
- ]),
2270
- _: 1
2271
- }, 8, ["title", "actions"]),
2272
- (I(), L(Xe, { to: "body" }, [
2273
- S(xn, Ze(et(w(r))), null, 16),
2274
- S(gn, Ve(w(t), {
2275
- onSubmitted: M[2] || (M[2] = (N) => w(v).fetchTemplates())
2276
- }), null, 16),
2277
- S(zn, Ve(w(o), {
2278
- onSubmitted: M[3] || (M[3] = (N) => w(v).fetchTemplates())
2279
- }), null, 16)
2280
- ]))
2281
- ], 64);
2282
- };
2283
- }
2284
- });
2285
- export {
2286
- xo as default
2287
- };