@feedmepos/mf-menu 0.31.13-beta.1 → 0.31.13-prod

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 (56) hide show
  1. package/dist/{App-CyK1AQ93.js → App-DzwIYXCC.js} +6 -6
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-_1MffFUE.js → ApplyProduct.vue_vue_type_script_setup_true_lang-DwjRVBt4.js} +2 -2
  3. package/dist/{Catalog-CjZ1LA79.js → Catalog-BvavQk6R.js} +5 -5
  4. package/dist/{Category-5S5Ory3e.js → Category-CKOPnQAc.js} +5 -5
  5. package/dist/{Category-J2Sl28vD.js → Category-Cj02s0bD.js} +4 -4
  6. package/dist/{CookingGuide-DbDyPOMU.js → CookingGuide-CyEginT_.js} +3 -3
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DuGg6Lzk.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-BpFu-GUR.js} +1 -1
  8. package/dist/{Group-DJJrHLs6.js → Group-YFFFxGCq.js} +1 -1
  9. package/dist/{Group-DADs7pNr.js → Group-plIUz6mQ.js} +3 -3
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-BY1W25cC.js → Group.vue_vue_type_script_setup_true_lang-BHYcr3kC.js} +7 -7
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DiQkGyH4.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DzF0Sycs.js} +3 -3
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-BNrgKX7s.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DlY_fspL.js} +1267 -1267
  13. package/dist/{Ingredient-C_34cmVN.js → Ingredient-C_RIAZ8k.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DXpBG9XE.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CLSojPHv.js} +1052 -1052
  15. package/dist/{LinkProductSideSheet-BPPW6MGp.js → LinkProductSideSheet-B5GODfkw.js} +1 -1
  16. package/dist/{MenuSetting-PVrj8s6Y.js → MenuSetting-FywYOgmI.js} +4 -4
  17. package/dist/{PrintRoute-LRI2kHDL.js → PrintRoute-BO3-UkwS.js} +3 -3
  18. package/dist/{Product-B5nv7xtc.js → Product-BrlvooGG.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-gdOKIqjL.js → Product.vue_vue_type_script_setup_true_lang-BNA1nx-k.js} +11 -11
  20. package/dist/{Products-CoIfi-_n.js → Products-BPwLcwaE.js} +521 -521
  21. package/dist/{Publish-CeRvbDrv.js → Publish-CqP2L3H8.js} +3 -3
  22. package/dist/{Recipe-Dea5fjwe.js → Recipe-DO4yCnFG.js} +4 -4
  23. package/dist/{Scheduler-CC-JO3rD.js → Scheduler-CkFIeXN3.js} +3 -3
  24. package/dist/{ServingSequence-DvHpctRb.js → ServingSequence-B_-BOp8C.js} +3 -3
  25. package/dist/{Setting-BYPNWfsV.js → Setting-CY1-d04h.js} +4 -4
  26. package/dist/{Subcategory-DIkgZbjF.js → Subcategory-H3rxT2CG.js} +4 -4
  27. package/dist/{Takeaway-BFj5UQdY.js → Takeaway-BJVacqXp.js} +1 -1
  28. package/dist/{Takeaway-v_O5KcLQ.js → Takeaway-C6Z2ScCk.js} +4 -4
  29. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-trpz516y.js → Takeaway.vue_vue_type_script_setup_true_lang-vky_OjQ5.js} +5 -5
  30. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BxyD5Caz.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BEsR-cqN.js} +13 -13
  31. package/dist/{Unit-B4zGp6Ue.js → Unit-CT9vH-Li.js} +2 -2
  32. package/dist/{Variant-DCQTZo2k.js → Variant-DYxv7P2H.js} +3 -3
  33. package/dist/{_id_-QvbkNWvK.js → _id_-Dl-tTOCU.js} +9 -9
  34. package/dist/{app-EW0leMNZ.js → app-D349wgRv.js} +23 -23
  35. package/dist/{app-Bdc4AHnI.js → app-DXaQ2A8_.js} +1 -1
  36. package/dist/app.js +1 -1
  37. package/dist/assets/{linked-status-GnOG_Sl6.js → linked-status-DV0r63qX.js} +2 -2
  38. package/dist/assets/{override-menu-Bpau5RZO.js → override-menu-B1Il9Mtm.js} +2 -2
  39. package/dist/assets/{validate-menu-DsZfB630.js → validate-menu-u8H0BvHJ.js} +2 -2
  40. package/dist/{catalog-Cl8Emiam.js → catalog-Co0S8ONG.js} +1 -1
  41. package/dist/{catalogSetting-Db23tDig.js → catalogSetting-BpL871DP.js} +1 -1
  42. package/dist/{category-BpzRLgc7.js → category-pMoaKhVM.js} +1 -1
  43. package/dist/{currency-BfLFfq-4.js → currency-CbR9kSDS.js} +1 -1
  44. package/dist/{dayjs.min-CoNBIAZi.js → dayjs.min-Revise9-.js} +1 -1
  45. package/dist/{index-DE5KFDey.js → index-CcgWvTsC.js} +1 -1
  46. package/dist/{index-Bm0nplNT.js → index-CiBy1MJE.js} +3 -3
  47. package/dist/{index-CVzBRs_J.js → index-wErO3lhN.js} +2 -2
  48. package/dist/{item-NkNj_bjG.js → item-BZ-coUuR.js} +932 -932
  49. package/dist/{menu-CyaC6SDT.js → menu-BhmpEsRJ.js} +7 -7
  50. package/dist/{menu-BG3cY6AZ.js → menu-DHMpoZLf.js} +1 -1
  51. package/dist/{priceTier-nWXjLoDT.js → priceTier-DMoWzxYK.js} +1 -1
  52. package/dist/{scheduler-w0Z2xWZ6.js → scheduler-D7gjxSfM.js} +3 -3
  53. package/dist/{subcategory-CBUqj7DT.js → subcategory-R7C4OaTS.js} +159 -157
  54. package/dist/{toExcel-BNbMiFPw.js → toExcel-DiGrUwFp.js} +2 -2
  55. package/dist/{unit-CyT3hV9Y.js → unit-B_lUkXXv.js} +1 -1
  56. package/package.json +1 -1
@@ -1,16 +1,16 @@
1
- import { shallowRef as Q, ref as T, computed as h, shallowReactive as Fe, watch as H, defineComponent as Re, resolveComponent as B, createBlock as Te, openBlock as Oe, unref as P, withCtx as Ve, createVNode as Ne } from "vue";
2
- import { J as k, A as x, aj as X, I, ak as z, M as S, K as ee, a9 as C, c as $, $ as w, ai as G, al as Pe, am as xe, z as Ae, ab as Ke, an as Ue, a8 as L, u as $e } from "./menu-CyaC6SDT.js";
3
- import { useCoreStore as J, useI18n as te } from "@feedmepos/mf-common";
4
- import { useSnackbar as De, useDialogChild as qe } from "@feedmepos/ui-library";
5
- import { defineStore as He } from "pinia";
6
- const Ye = "/assets/linked-status-GnOG_Sl6.js", We = "/assets/override-menu-Bpau5RZO.js";
7
- function je(e) {
1
+ import { shallowRef as Z, ref as R, computed as h, shallowReactive as Te, effectScope as Re, watch as H, defineComponent as Ve, resolveComponent as z, createBlock as Ne, openBlock as Oe, unref as N, withCtx as Pe, createVNode as xe } from "vue";
2
+ import { J as k, A as O, aj as ee, I, ak as G, M as S, K as te, a9 as C, c as D, $ as E, ai as L, al as Ae, am as Ke, z as Ue, ab as De, an as $e, a8 as J, u as qe } from "./menu-BhmpEsRJ.js";
3
+ import { useCoreStore as X, useI18n as ne } from "@feedmepos/mf-common";
4
+ import { useSnackbar as He, useDialogChild as Ye } from "@feedmepos/ui-library";
5
+ import { defineStore as We } from "pinia";
6
+ const je = "/assets/linked-status-DV0r63qX.js", Be = "/assets/override-menu-B1Il9Mtm.js";
7
+ function ze(e) {
8
8
  var o;
9
9
  const n = k(e), a = (o = n.variant) == null ? void 0 : o.variantCombinations;
10
10
  return delete n.variant, delete n.thumbnail, [n, ...a || []];
11
11
  }
12
- function Be(e, n, a, o) {
13
- const r = k(n), f = a ? r.modules.catalog.find((_) => _._id === a) : null, d = o ? r.modules.scheduler.find((_) => _._id === o) : null, i = f ? k(f) : void 0, m = a ? r.modules.catalog.filter((_) => _._id !== a) : [], u = d ? k(d) : void 0, s = e.reduce((_, y) => (_[y._id] = je(y), _), {});
12
+ function Ge(e, n, a, o) {
13
+ const r = k(n), f = a ? r.modules.catalog.find((_) => _._id === a) : null, d = o ? r.modules.scheduler.find((_) => _._id === o) : null, i = f ? k(f) : void 0, m = a ? r.modules.catalog.filter((_) => _._id !== a) : [], u = d ? k(d) : void 0, s = e.reduce((_, y) => (_[y._id] = ze(y), _), {});
14
14
  function p(_ = []) {
15
15
  const y = e.map((b) => b._id);
16
16
  return [
@@ -35,9 +35,9 @@ function Be(e, n, a, o) {
35
35
  ...r.modules.scheduler.filter((_) => _._id !== o),
36
36
  u
37
37
  ], r) : {
38
- ...z(),
38
+ ...G(),
39
39
  modules: {
40
- ...z().modules,
40
+ ...G().modules,
41
41
  catalog: r.modules.catalog,
42
42
  item: r.modules.item,
43
43
  group: r.modules.group,
@@ -46,7 +46,7 @@ function Be(e, n, a, o) {
46
46
  _id: r._id
47
47
  };
48
48
  }
49
- function R(e, n, a) {
49
+ function T(e, n, a) {
50
50
  var f;
51
51
  if (a >= 3) return e;
52
52
  const o = n.modules.item.find((d) => d._id === e._id);
@@ -61,8 +61,8 @@ function R(e, n, a) {
61
61
  const y = (b = i.items) == null ? void 0 : b.find(
62
62
  (F) => F._id === _._id && F.combinationKey === _.combinationKey
63
63
  );
64
- return R(y || _, n, a + 1);
65
- })) ?? [] : m = ((p = d.items) == null ? void 0 : p.map((_) => R(_, n, a + 1))) ?? [], {
64
+ return T(y || _, n, a + 1);
65
+ })) ?? [] : m = ((p = d.items) == null ? void 0 : p.map((_) => T(_, n, a + 1))) ?? [], {
66
66
  ...d,
67
67
  items: m
68
68
  };
@@ -75,7 +75,7 @@ function R(e, n, a) {
75
75
  groups: r
76
76
  };
77
77
  }
78
- function ze(e, n) {
78
+ function Le(e, n) {
79
79
  const a = e.groups.map((f) => {
80
80
  const d = n.modules.group.find((m) => m._id === f._id), i = ((d == null ? void 0 : d.items) || []).map((m) => {
81
81
  var p;
@@ -83,17 +83,17 @@ function ze(e, n) {
83
83
  (_) => _._id === m._id && _.combinationKey === m.combinationKey
84
84
  );
85
85
  if (u)
86
- return R(u, n, 1);
86
+ return T(u, n, 1);
87
87
  const s = {
88
- ...x.generator.initMenuV4ItemOverrider(),
88
+ ...O.generator.initMenuV4ItemOverrider(),
89
89
  _id: m._id,
90
90
  combinationKey: m.combinationKey
91
91
  };
92
- return R(s, n, 1);
92
+ return T(s, n, 1);
93
93
  });
94
94
  return { ...f, items: i };
95
- }), o = e.variant ? e.variant.variantCombinations.map((f) => R(f, n, 1)) : [], r = {
96
- ...x.generator.initMenuV4ItemOverrider(),
95
+ }), o = e.variant ? e.variant.variantCombinations.map((f) => T(f, n, 1)) : [], r = {
96
+ ...O.generator.initMenuV4ItemOverrider(),
97
97
  _id: e._id,
98
98
  name: e.name,
99
99
  code: e.code,
@@ -118,7 +118,7 @@ function Y(e, n) {
118
118
  }), r;
119
119
  }), a;
120
120
  }
121
- function Ge(e, n) {
121
+ function Je(e, n) {
122
122
  const a = e.items[n._id];
123
123
  n.variant && (n.variant = {
124
124
  ...n.variant,
@@ -149,11 +149,11 @@ function Ge(e, n) {
149
149
  price: (o == null ? void 0 : o.price) || n.price
150
150
  };
151
151
  }
152
- async function it(e, n, a, o, r, f = !0) {
153
- const d = k(a), i = f ? Be(n, d, o, r) : d, m = n.reduce((p, _) => (p[_._id] = i.modules.item.find((y) => y._id === _._id), p), {}), u = n.reduce((p, _) => {
152
+ async function lt(e, n, a, o, r, f = !0) {
153
+ const d = k(a), i = f ? Ge(n, d, o, r) : d, m = n.reduce((p, _) => (p[_._id] = i.modules.item.find((y) => y._id === _._id), p), {}), u = n.reduce((p, _) => {
154
154
  const y = _._id;
155
- return p[y] = ze(m[y], e), p;
156
- }, {}), s = x.getFallbackPrices({
155
+ return p[y] = Le(m[y], e), p;
156
+ }, {}), s = O.getFallbackPrices({
157
157
  rawMenu: i,
158
158
  items: u,
159
159
  catalogId: o || void 0,
@@ -162,12 +162,12 @@ async function it(e, n, a, o, r, f = !0) {
162
162
  return n.map((p) => {
163
163
  const _ = p._id, y = m[_];
164
164
  return {
165
- ...Ge(s, y),
165
+ ...Je(s, y),
166
166
  category: o || r ? y == null ? void 0 : y.category : null
167
167
  };
168
168
  });
169
169
  }
170
- function ct(e, n) {
170
+ function dt(e, n) {
171
171
  if (e.length === 0) return "";
172
172
  const a = e == null ? void 0 : e.split("variant");
173
173
  return ((a == null ? void 0 : a.reduce((r, f) => {
@@ -180,28 +180,28 @@ function ct(e, n) {
180
180
  return r;
181
181
  }, [])) || []).join(" / ");
182
182
  }
183
- const D = /* @__PURE__ */ new Map();
184
- async function lt(e, n) {
183
+ const $ = /* @__PURE__ */ new Map();
184
+ async function mt(e, n) {
185
185
  const a = `${e._id}-${e.updatedAt}-${n}`;
186
- if (D.has(a))
187
- return D.get(a);
188
- const o = await X(
189
- Ye,
186
+ if ($.has(a))
187
+ return $.get(a);
188
+ const o = await ee(
189
+ je,
190
190
  JSON.stringify({
191
191
  menu: e,
192
192
  itemId: n
193
193
  })
194
194
  );
195
- return D.set(a, o), o;
195
+ return $.set(a, o), o;
196
196
  }
197
- async function ne(e, n, a) {
198
- return await X(We, {
197
+ async function oe(e, n, a) {
198
+ return await ee(Be, {
199
199
  menu: e,
200
200
  catalogId: n,
201
201
  schedulerId: a
202
202
  });
203
203
  }
204
- function dt(e, n, a) {
204
+ function ft(e, n, a) {
205
205
  const o = /* @__PURE__ */ new Set();
206
206
  function r(f, d) {
207
207
  if (!e || !f || !d || o.has(d)) return !1;
@@ -216,7 +216,7 @@ function dt(e, n, a) {
216
216
  }
217
217
  return r(n, a);
218
218
  }
219
- function mt(e, n, a) {
219
+ function pt(e, n, a) {
220
220
  const o = /* @__PURE__ */ new Set();
221
221
  function r(f, d) {
222
222
  if (!e || !f || !d || o.has(f)) return !1;
@@ -232,16 +232,16 @@ function mt(e, n, a) {
232
232
  return r(n, a);
233
233
  }
234
234
  const q = /* @__PURE__ */ new Map();
235
- async function Le(e, n, a) {
235
+ async function Xe(e, n, a) {
236
236
  const o = `${e._id}-${e.updatedAt}-${n || "null"}-${a || "null"}`;
237
237
  if (q.has(o))
238
238
  return q.get(o);
239
- const r = await ne(e, n, a);
239
+ const r = await oe(e, n, a);
240
240
  return q.set(o, r), r;
241
241
  }
242
- async function ft(e, n, a) {
242
+ async function _t(e, n, a) {
243
243
  var d, i;
244
- const o = await Le(e, n, null), r = [], f = (m, u) => {
244
+ const o = await Xe(e, n, null), r = [], f = (m, u) => {
245
245
  const s = k(m);
246
246
  for (const p in u)
247
247
  u[p] && (s[p] = u[p]);
@@ -251,9 +251,9 @@ async function ft(e, n, a) {
251
251
  const u = (d = m.items) == null ? void 0 : d.find((p) => p._id === a && !p.combinationKey), s = e.modules.item.find((p) => p._id === a);
252
252
  if (u) {
253
253
  const p = (i = m.items) == null ? void 0 : i.filter((y) => y._id === a && y.combinationKey), _ = [u, ...p].map((y) => {
254
- var O, V;
255
- const b = y.combinationKey ? (V = (O = s == null ? void 0 : s.variant) == null ? void 0 : O.variantCombinations) == null ? void 0 : V.find(
256
- (N) => N.combinationKey === y.combinationKey
254
+ var V, P;
255
+ const b = y.combinationKey ? (P = (V = s == null ? void 0 : s.variant) == null ? void 0 : V.variantCombinations) == null ? void 0 : P.find(
256
+ (x) => x.combinationKey === y.combinationKey
257
257
  ) : s, F = b && s ? f(s, b) : y;
258
258
  return f(F, y);
259
259
  });
@@ -265,10 +265,10 @@ async function ft(e, n, a) {
265
265
  }
266
266
  return r;
267
267
  }
268
- function Je({
268
+ function Qe({
269
269
  maxHistorySize: e = 50
270
270
  }) {
271
- const n = Q([]), a = T(-1), o = h(() => a.value > 0), r = h(() => a.value < n.value.length - 1);
271
+ const n = Z([]), a = R(-1), o = h(() => a.value > 0), r = h(() => a.value < n.value.length - 1);
272
272
  function f(u) {
273
273
  n.value.push(u), a.value++, n.value.length > e && (n.value.shift(), a.value--);
274
274
  }
@@ -303,10 +303,10 @@ const Ze = {
303
303
  modules: a.result || e.modules,
304
304
  _rev: a.id ?? ""
305
305
  };
306
- return ee.cloneDeep({ menu: o, updateId: a.id ?? null });
306
+ return te.cloneDeep({ menu: o, updateId: a.id ?? null });
307
307
  }
308
308
  };
309
- function oe() {
309
+ function re() {
310
310
  return {
311
311
  _id: "",
312
312
  masterCatalogSetting: { inclusiveTaxes: [] },
@@ -329,36 +329,36 @@ function oe() {
329
329
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
330
330
  };
331
331
  }
332
- function Qe() {
332
+ function et() {
333
333
  return {
334
334
  restaurants: [],
335
- menu: { ...oe(), _rev: "" },
335
+ menu: { ...re(), _rev: "" },
336
336
  currentCatalogId: null,
337
337
  currentCategoryIds: null,
338
338
  currentSchedulerId: ""
339
339
  };
340
340
  }
341
- const Xe = He(
341
+ const tt = We(
342
342
  "mf-menu-store-v2",
343
343
  () => {
344
- const e = Fe(Qe()), n = J(), a = De(), o = h(() => e.menu.modules.serveSequence ? C(e.menu.modules.serveSequence, {
344
+ const e = Te(et()), n = X(), a = He(), o = h(() => e.menu.modules.serveSequence ? C(e.menu.modules.serveSequence, {
345
345
  selector: "position"
346
346
  }) : []), r = h(() => {
347
347
  var t;
348
- return ((t = n.currentBusiness.value) == null ? void 0 : t.menuVersion) || $.F_MENU_VERSION.v3;
349
- }), f = h(() => r.value === $.F_MENU_VERSION.v4), d = h(() => {
348
+ return ((t = n.currentBusiness.value) == null ? void 0 : t.menuVersion) || D.F_MENU_VERSION.v3;
349
+ }), f = h(() => r.value === D.F_MENU_VERSION.v4), d = h(() => {
350
350
  const t = e.menu.modules.catalog;
351
351
  return C(t, { selector: "name" });
352
352
  }), i = h(() => e.menu.modules.catalog.find((t) => t._id === e.currentCatalogId)), m = h(() => C(p.value.modules.scheduler, { selector: "name" })), u = h(() => e.menu.modules.scheduler.find(
353
353
  (t) => t._id === e.currentSchedulerId
354
354
  ));
355
355
  function s(t, l = !0) {
356
- e.menu = { ...t, _rev: e.menu._rev }, l && E.push(e.menu);
356
+ e.menu = { ...t, _rev: e.menu._rev }, l && w.push(e.menu);
357
357
  }
358
- const p = Q(oe()), _ = T(!1), y = T(1);
358
+ const p = Z(re()), _ = R(!1), y = R(1);
359
359
  async function b() {
360
360
  _.value = !0;
361
- const t = await ne(
361
+ const t = await oe(
362
362
  e.menu,
363
363
  e.currentCatalogId,
364
364
  e.currentSchedulerId
@@ -373,14 +373,16 @@ const Xe = He(
373
373
  }
374
374
  return p.value = t, _.value = !1, y.value = y.value + 1, t;
375
375
  }
376
- const O = ee.debounce(b, 200);
377
- H(
378
- () => [e.menu, e.currentCatalogId, e.currentSchedulerId],
379
- () => {
380
- _.value || O();
381
- }
382
- );
383
- const V = h(() => [
376
+ const V = te.debounce(b, 200);
377
+ Re(!0).run(() => {
378
+ H(
379
+ () => [e.menu, e.currentCatalogId, e.currentSchedulerId],
380
+ () => {
381
+ _.value || V();
382
+ }
383
+ );
384
+ });
385
+ const x = h(() => [
384
386
  {
385
387
  label: "Main",
386
388
  value: null
@@ -389,7 +391,7 @@ const Xe = He(
389
391
  label: t.name,
390
392
  value: t._id
391
393
  }))
392
- ]), N = h(() => {
394
+ ]), W = h(() => {
393
395
  const t = p.value.modules.category;
394
396
  return [
395
397
  ...K.value.item.addon ? [
@@ -399,12 +401,12 @@ const Xe = He(
399
401
  position: 0
400
402
  }
401
403
  ] : [],
402
- ...w(t, (l) => l.name)
404
+ ...E(t, (l) => l.name)
403
405
  ];
404
- }), re = h(() => {
406
+ }), ae = h(() => {
405
407
  const t = p.value.modules.subCategory || [];
406
- return w(t, (l) => l.name);
407
- }), W = h(() => {
408
+ return E(t, (l) => l.name);
409
+ }), j = h(() => {
408
410
  var l;
409
411
  let t = p.value.modules.item;
410
412
  if (i.value) {
@@ -412,22 +414,22 @@ const Xe = He(
412
414
  t = t.filter((g) => {
413
415
  var M;
414
416
  const v = (M = c == null ? void 0 : c[g._id]) == null ? void 0 : M.find(
415
- (ke) => !ke.combinationKey
417
+ (Fe) => !Fe.combinationKey
416
418
  );
417
419
  return (v == null ? void 0 : v.orderFrom) !== I.F_ORDER_FROM.enum.NONE;
418
420
  });
419
421
  }
420
- return w(t, (c) => c.code || c.name);
421
- }), ae = h(() => {
422
- const t = e.menu.modules.category, l = w(t, (g) => g.name).reduce(
422
+ return E(t, (c) => c.code || c.name);
423
+ }), se = h(() => {
424
+ const t = e.menu.modules.category, l = E(t, (g) => g.name).reduce(
423
425
  (g, v, M) => (g[v._id] = M, g),
424
426
  { "": 0 }
425
427
  ), c = e.menu.modules.item;
426
- return w(
428
+ return E(
427
429
  c,
428
430
  (g) => g.code || g.name
429
431
  ).reduce((g, v, M) => (g[v._id] = M + l[v.category || ""], g), {});
430
- }), se = h(() => G(A.value, N.value, W.value)), ue = h(() => {
432
+ }), ue = h(() => L(A.value, W.value, j.value)), ie = h(() => {
431
433
  const t = K.value.item.addon ? [
432
434
  {
433
435
  _id: e.currentCatalogId ? "" : null,
@@ -436,7 +438,7 @@ const Xe = He(
436
438
  },
437
439
  ...e.menu.modules.category
438
440
  ] : e.menu.modules.category;
439
- return G(
441
+ return L(
440
442
  e.menu.modules.variant,
441
443
  t,
442
444
  e.menu.modules.item
@@ -445,19 +447,19 @@ const Xe = He(
445
447
  const t = p.value.modules.variant;
446
448
  return C(t, { selector: "name" });
447
449
  });
448
- function ie(t = []) {
450
+ function ce(t = []) {
449
451
  const l = t.map((g) => A.value.find((v) => v._id === g)).filter((g) => !!g);
450
- return x.fullVariantCombination(l).reduce((g, v) => (g[v.combinationKey] = v.selectionName.join(" / "), g), {});
452
+ return O.fullVariantCombination(l).reduce((g, v) => (g[v.combinationKey] = v.selectionName.join(" / "), g), {});
451
453
  }
452
- const ce = h(() => w(p.value.modules.group, (t) => t.name)), le = h(() => C(p.value.modules.takeaway, { selector: "name" })), de = h(() => C(e.menu.modules.printDepartment || [], {
454
+ const le = h(() => E(p.value.modules.group, (t) => t.name)), de = h(() => C(p.value.modules.takeaway, { selector: "name" })), me = h(() => C(e.menu.modules.printDepartment || [], {
453
455
  selector: "name"
454
- })), me = h(() => C(e.menu.modules.unit, { selector: "name" })), fe = h(() => C(Pe(e.menu.modules.recipe, e.menu.modules.sku), {
456
+ })), fe = h(() => C(e.menu.modules.unit, { selector: "name" })), pe = h(() => C(Ae(e.menu.modules.recipe, e.menu.modules.sku), {
455
457
  selector: "name"
456
- })), pe = h(() => e.menu.modules.cookingGuide), _e = h(() => {
457
- const t = xe(e.menu.modules.sku);
458
+ })), _e = h(() => e.menu.modules.cookingGuide), ge = h(() => {
459
+ const t = Ke(e.menu.modules.sku);
458
460
  return C(t, { selector: "code" });
459
461
  }), K = h(() => {
460
- const t = !e.currentCatalogId, l = r.value === $.F_MENU_VERSION.v4, c = !e.currentSchedulerId, g = {
462
+ const t = !e.currentCatalogId, l = r.value === D.F_MENU_VERSION.v4, c = !e.currentSchedulerId, g = {
461
463
  create: t && c,
462
464
  edit: t && c,
463
465
  delete: t && c
@@ -528,41 +530,41 @@ const Xe = He(
528
530
  function U(t) {
529
531
  return `${t.systemCode}/${t.taxCode}`;
530
532
  }
531
- function ge(t) {
533
+ function ve(t) {
532
534
  const [l, c] = t.split("/");
533
535
  return { systemCode: l, taxCode: c };
534
536
  }
535
- function ve(t, l, c) {
537
+ function ye(t, l, c) {
536
538
  return (t ?? l ?? []).map((g) => U(g)).find((g) => c.some((v) => v.value === g));
537
539
  }
538
- const ye = h(() => {
540
+ const he = h(() => {
539
541
  var l;
540
- const t = Ae.Country.getCountryFlattenTaxes(
541
- J().currentCountry.value
542
+ const t = Ue.Country.getCountryFlattenTaxes(
543
+ X().currentCountry.value
542
544
  );
543
545
  return {
544
546
  systemCode: (l = t[0]) == null ? void 0 : l.systemCode,
545
547
  countryTaxOptions: t.map((c) => ({
546
- label: `${c.name} (${Ke(c.rate)}%)`,
548
+ label: `${c.name} (${De(c.rate)}%)`,
547
549
  value: U(c),
548
550
  meta: {
549
551
  rate: c.rate
550
552
  }
551
553
  }))
552
554
  };
553
- }), he = async () => {
554
- const t = await L.readMenu();
555
- e.menu = t ?? e.menu, j(null);
556
- }, be = async () => {
557
- const t = await L.readRestaurantsWithMenu();
555
+ }), be = async () => {
556
+ const t = await J.readMenu();
557
+ e.menu = t ?? e.menu, B(null);
558
+ }, Me = async () => {
559
+ const t = await J.readRestaurantsWithMenu();
558
560
  e.restaurants = C(t, { selector: "name" });
559
- }, j = (t) => {
561
+ }, B = (t) => {
560
562
  e.currentCatalogId = t;
561
- }, Me = (t) => {
562
- e.currentSchedulerId = t;
563
563
  }, Ce = (t) => {
564
+ e.currentSchedulerId = t;
565
+ }, Se = (t) => {
564
566
  e.currentCategoryIds = t;
565
- }, Se = async (t, l) => {
567
+ }, we = async (t, l) => {
566
568
  const c = Array.isArray(t) ? t : [t];
567
569
  if (!c.length) return;
568
570
  const g = c.map((v) => ({
@@ -574,7 +576,7 @@ const Xe = He(
574
576
  if (l || g.some(
575
577
  (M) => [S.F_OPERATION_TYPE.delete, S.F_OPERATION_TYPE.deleteMany].includes(M.operation)
576
578
  )) {
577
- const M = await Ue(g, e.menu.modules);
579
+ const M = await $e(g, e.menu.modules);
578
580
  if (M !== !0) throw new Error(M);
579
581
  }
580
582
  const v = await Ze.updateMenuModule(e.menu, g);
@@ -594,7 +596,7 @@ const Xe = He(
594
596
  priceTierSettings: t.priceTierSettings
595
597
  };
596
598
  return s(l), l;
597
- }, E = Je({ maxHistorySize: 50 }), we = h(() => E.canUndo.value), Ie = h(() => E.canRedo.value);
599
+ }, w = Qe({ maxHistorySize: 50 }), Ie = h(() => w.canUndo.value), ke = h(() => w.canRedo.value);
598
600
  return {
599
601
  state: e,
600
602
  // loading state
@@ -610,68 +612,68 @@ const Xe = He(
610
612
  currentCatalog: i,
611
613
  schedulers: m,
612
614
  currentScheduler: u,
613
- catalogOptions: V,
614
- categories: N,
615
- subcategories: re,
616
- items: W,
617
- sortedItems: ae,
618
- categorizedItems: se,
619
- categorizedRawMenuItems: ue,
615
+ catalogOptions: x,
616
+ categories: W,
617
+ subcategories: ae,
618
+ items: j,
619
+ sortedItems: se,
620
+ categorizedItems: ue,
621
+ categorizedRawMenuItems: ie,
620
622
  variants: A,
621
- groups: ce,
622
- takeaways: le,
623
- printDepartments: de,
624
- units: me,
625
- recipes: fe,
626
- cookingGuide: pe,
627
- skus: _e,
623
+ groups: le,
624
+ takeaways: de,
625
+ printDepartments: me,
626
+ units: fe,
627
+ recipes: pe,
628
+ cookingGuide: _e,
629
+ skus: ge,
628
630
  rules: K,
629
- taxSetting: ye,
631
+ taxSetting: he,
630
632
  // Action
631
633
  setMenu: s,
632
- readMenu: he,
633
- readRestaurants: be,
634
- selectCatalog: j,
635
- selectScheduler: Me,
636
- selectCategory: Ce,
637
- updateMenu: Se,
634
+ readMenu: be,
635
+ readRestaurants: Me,
636
+ selectCatalog: B,
637
+ selectScheduler: Ce,
638
+ selectCategory: Se,
639
+ updateMenu: we,
638
640
  updateMenuSetting: Ee,
639
641
  computeMergedMenu: b,
640
642
  // helper
641
643
  encodeTax: U,
642
- decodeTax: ge,
643
- getSelectedTax: ve,
644
- mapVariant: ie,
644
+ decodeTax: ve,
645
+ getSelectedTax: ye,
646
+ mapVariant: ce,
645
647
  // history
646
- canUndoHistory: we,
647
- canRedoHistory: Ie,
648
+ canUndoHistory: Ie,
649
+ canRedoHistory: ke,
648
650
  undoHistory: () => {
649
- const t = E.undo();
651
+ const t = w.undo();
650
652
  t && s(t, !1);
651
653
  },
652
654
  redoHistory: () => {
653
- const t = E.redo();
655
+ const t = w.redo();
654
656
  t && s(t, !1);
655
657
  },
656
658
  clearHistory: () => {
657
- E.clear();
659
+ w.clear();
658
660
  }
659
661
  };
660
662
  }
661
- ), Z = /* @__PURE__ */ Re({
663
+ ), Q = /* @__PURE__ */ Ve({
662
664
  __name: "AddSubcategoryDialogContentComponent",
663
665
  props: {
664
666
  initialValue: {}
665
667
  },
666
668
  setup(e) {
667
- const n = e, { t: a } = te();
669
+ const n = e, { t: a } = ne();
668
670
  H(
669
671
  () => n.initialValue,
670
672
  (d) => {
671
673
  o.value = d ?? "";
672
674
  }
673
675
  );
674
- const o = T(n.initialValue), { emitData: r, emitAction: f } = qe();
676
+ const o = R(n.initialValue), { emitData: r, emitAction: f } = Ye();
675
677
  return H(
676
678
  o,
677
679
  (d) => {
@@ -681,35 +683,35 @@ const Xe = He(
681
683
  immediate: !0
682
684
  }
683
685
  ), (d, i) => {
684
- const m = B("fm-text-field"), u = B("FmForm");
685
- return Oe(), Te(u, {
686
- onValidationSuccess: i[1] || (i[1] = (s) => P(f)("primary"))
686
+ const m = z("fm-text-field"), u = z("FmForm");
687
+ return Oe(), Ne(u, {
688
+ onValidationSuccess: i[1] || (i[1] = (s) => N(f)("primary"))
687
689
  }, {
688
- default: Ve(() => [
689
- Ne(m, {
690
+ default: Pe(() => [
691
+ xe(m, {
690
692
  modelValue: o.value,
691
693
  "onUpdate:modelValue": i[0] || (i[0] = (s) => o.value = s),
692
- rules: [(s) => !!s || P(a)("menu.subcategory.dialog.add.name.required")],
694
+ rules: [(s) => !!s || N(a)("menu.subcategory.dialog.add.name.required")],
693
695
  autofocus: "",
694
- label: P(a)("menu.subcategory.dialog.add.name.label"),
695
- placeholder: P(a)("menu.subcategory.dialog.add.name.placeholder")
696
+ label: N(a)("menu.subcategory.dialog.add.name.label"),
697
+ placeholder: N(a)("menu.subcategory.dialog.add.name.placeholder")
696
698
  }, null, 8, ["modelValue", "rules", "label", "placeholder"])
697
699
  ]),
698
700
  _: 1
699
701
  });
700
702
  };
701
703
  }
702
- }), pt = ({
704
+ }), gt = ({
703
705
  dialog: e,
704
706
  menuLoader: n,
705
707
  isLocalOnly: a = !1
706
708
  }) => {
707
- const { t: o } = te(), r = Xe().updateMenu;
709
+ const { t: o } = ne(), r = tt().updateMenu;
708
710
  function f() {
709
- const u = T(!1);
711
+ const u = R(!1);
710
712
  e.open({
711
713
  title: o("menu.subcategory.manager.dialog.add.title"),
712
- contentComponent: Z,
714
+ contentComponent: Q,
713
715
  primaryActions: {
714
716
  text: o("menu.subcategory.manager.dialog.add.action"),
715
717
  close: !1,
@@ -728,7 +730,7 @@ const Xe = He(
728
730
  operation: S.F_OPERATION_TYPE.create,
729
731
  data: {
730
732
  name: s,
731
- position: $e().subcategories.length
733
+ position: qe().subcategories.length
732
734
  }
733
735
  };
734
736
  a ? await r(p) : await n.updateMenu(p, s), e.close();
@@ -740,7 +742,7 @@ const Xe = He(
740
742
  function d(u) {
741
743
  e.open({
742
744
  title: o("menu.subcategory.manager.dialog.update.title"),
743
- contentComponent: Z,
745
+ contentComponent: Q,
744
746
  contentComponentProps: {
745
747
  initialValue: u.name
746
748
  },
@@ -799,13 +801,13 @@ const Xe = He(
799
801
  };
800
802
  };
801
803
  export {
802
- pt as a,
803
- lt as b,
804
- mt as c,
805
- dt as d,
806
- ft as f,
807
- ct as g,
808
- it as m,
809
- Le as o,
810
- Xe as u
804
+ gt as a,
805
+ mt as b,
806
+ pt as c,
807
+ ft as d,
808
+ _t as f,
809
+ dt as g,
810
+ lt as m,
811
+ Xe as o,
812
+ tt as u
811
813
  };
@@ -1,5 +1,5 @@
1
- import { c as C } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-BNrgKX7s.js";
2
- import "./menu-CyaC6SDT.js";
1
+ import { c as C } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-DlY_fspL.js";
2
+ import "./menu-BhmpEsRJ.js";
3
3
  var Z = {
4
4
  defaultAmount: 0,
5
5
  defaultCurrency: "USD",
@@ -1,6 +1,6 @@
1
1
  import { defineStore as Q } from "pinia";
2
2
  import { defineComponent as T, computed as U, ref as h, watch as L, resolveComponent as V, createBlock as W, openBlock as F, withCtx as w, createVNode as m, createElementVNode as f, normalizeClass as H, createElementBlock as A, toDisplayString as M, unref as l, Fragment as q, renderSlot as X, renderList as Z, getCurrentInstance as ee } from "vue";
3
- import { a6 as P, a7 as te, a4 as B, J as k, Q as $, G as I, A as E, K as ne, a5 as ae, M as C, I as D, u as oe } from "./menu-CyaC6SDT.js";
3
+ import { a6 as P, a7 as te, a4 as B, J as k, Q as $, G as I, A as E, K as ne, a5 as ae, M as C, I as D, u as oe } from "./menu-BhmpEsRJ.js";
4
4
  import { useI18n as N } from "@feedmepos/mf-common";
5
5
  import { useSnackbar as j, components as le, useDialog as ue, FmButtonVariant as ie } from "@feedmepos/ui-library";
6
6
  import { u as se } from "./discardConfirm-BHni0LNu.js";