@feedmepos/mf-menu 0.31.40-beta.2 → 0.31.40-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 (91) hide show
  1. package/dist/{App-CoKv0BFp.js → App-aWEH-ZEk.js} +9 -9
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-B14Q0hS_.js → ApplyProduct.vue_vue_type_script_setup_true_lang-jJyinQZl.js} +3 -3
  3. package/dist/{Catalog-BRovMtuI.js → Catalog-BoFfFdn8.js} +9 -8
  4. package/dist/{Category-DytZqgIt.js → Category-CWYbb3Jn.js} +4 -4
  5. package/dist/{Category-CT8-B4zh.js → Category-DZ45uikR.js} +6 -6
  6. package/dist/{CookingGuide-Ct5qRLG0.js → CookingGuide-BU0PRWIQ.js} +4 -4
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-D3R3TCba.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-Z5xsKDIE.js} +1 -1
  8. package/dist/FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js +50 -0
  9. package/dist/{Group-Dk1yQTTt.js → Group-BMQDeqiS.js} +1 -1
  10. package/dist/{Group-G_H8i5_8.js → Group-C0T_uknK.js} +3 -3
  11. package/dist/{Group.vue_vue_type_script_setup_true_lang-CoTdB2d5.js → Group.vue_vue_type_script_setup_true_lang-DyfmY6F1.js} +8 -8
  12. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D6qro5w_.js +367 -0
  13. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-BKx7uQtR.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Dl-Wvt3D.js} +14 -13
  14. package/dist/{Ingredient-ChynYQq6.js → Ingredient-3lwDUQx_.js} +3 -3
  15. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DyaUxnMx.js → InventoryBinding.vue_vue_type_script_setup_true_lang-VLrrTkSC.js} +2 -2
  16. package/dist/LinkProductSideSheet-LDZjKX95.js +297 -0
  17. package/dist/{app-CiBqmBzO.js → LinkProductSideSheet.vue_vue_type_style_index_0_scoped_97fa9d58_lang-DvG3mOom.js} +2084 -2120
  18. package/dist/MenuSetting-AhutsCVy.js +185 -0
  19. package/dist/{PrintRoute-DwAZHUrQ.js → PrintRoute-DfJ-vUAb.js} +4 -4
  20. package/dist/{Product-Bx2NPQvC.js → Product-F4PoLm9v.js} +1 -1
  21. package/dist/{Product.vue_vue_type_script_setup_true_lang-od_O6x7E.js → Product.vue_vue_type_script_setup_true_lang-DT5gffpA.js} +465 -468
  22. package/dist/{ProductInternalTools-BOguHh06.js → ProductInternalTools-DSGU-OqU.js} +6 -6
  23. package/dist/{Products-DA2hOsxr.js → Products-COzW2Z4g.js} +85 -88
  24. package/dist/{Publish-WATQWkjh.js → Publish-CDXVWCk2.js} +3 -3
  25. package/dist/{Recipe-WPwGgur3.js → Recipe-BZx4wrcP.js} +4 -4
  26. package/dist/{Scheduler-Djjggrh2.js → Scheduler-wHCWSeU2.js} +3 -3
  27. package/dist/{ServingSequence-CryZJTWA.js → ServingSequence-BbYEhDYh.js} +3 -3
  28. package/dist/{Setting-BtLsmoqY.js → Setting-C9Tlw1Iy.js} +45 -44
  29. package/dist/{Subcategory-BvlYDquD.js → Subcategory-C8AwfrKb.js} +4 -4
  30. package/dist/{Takeaway-8khxlcKQ.js → Takeaway-DaEUn-yM.js} +4 -4
  31. package/dist/{Takeaway-BBvFxAlx.js → Takeaway-t1053wg2.js} +1 -1
  32. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-B8blN-yJ.js → Takeaway.vue_vue_type_script_setup_true_lang-7XycP5fU.js} +5 -5
  33. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-CA9RlNkt.js → Thumbnail.vue_vue_type_script_setup_true_lang-B7oLH9cP.js} +95 -97
  34. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Ci6iqOry.js +5998 -0
  35. package/dist/{Unit-Diu00sM2.js → Unit-CnqptGCz.js} +2 -2
  36. package/dist/{Variant-CO15W0wb.js → Variant-DiOYOwJs.js} +3 -3
  37. package/dist/{_id_-CxA_FzSG.js → _id_-BSfU16VO.js} +75 -78
  38. package/dist/{app-Blbof2Ga.js → app-Cou6qPF2.js} +1 -1
  39. package/dist/{app-5ESai6-B.js → app-Ddb81PNo.js} +278 -278
  40. package/dist/app.js +1 -1
  41. package/dist/apps/mf-menu/src/api/menu.d.ts +1 -2
  42. package/dist/apps/mf-menu/src/app.d.ts +0 -144
  43. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierRuleEditor.vue.d.ts +0 -36
  44. package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesSelector.vue.d.ts +3 -9
  45. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/useItemFormManagement.d.ts +9 -2
  46. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +4 -294
  47. package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +0 -40
  48. package/dist/apps/mf-menu/src/helper/import-export.d.ts +0 -285
  49. package/dist/apps/mf-menu/src/helper/menu.d.ts +0 -285
  50. package/dist/apps/mf-menu/src/manager/menu/item.d.ts +0 -285
  51. package/dist/apps/mf-menu/src/stores/menu.d.ts +3 -293
  52. package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +0 -166
  53. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  54. package/dist/assets/linked-status-B_crHhZH.js +24 -0
  55. package/dist/assets/override-menu-BmlCEpHH.js +24 -0
  56. package/dist/assets/validate-menu-CF-psoB-.js +24 -0
  57. package/dist/{catalog-CXjEQ80k.js → catalog-DSuJhsUb.js} +1 -1
  58. package/dist/{catalogSetting-aJSUDY_z.js → catalogSetting-C3gEw9ov.js} +1 -1
  59. package/dist/{category-TqQULuHq.js → category-CwWq3KCE.js} +1 -1
  60. package/dist/{currency-CRjh8ne7.js → currency-g45Sh-t6.js} +1 -1
  61. package/dist/{dayjs.min-MBmYgyRY.js → dayjs.min-g3eN5z-V.js} +1 -1
  62. package/dist/index-0Q5T9VZV.js +214 -0
  63. package/dist/{index-dkHuztwB.js → index-0yRUi7LL.js} +1 -1
  64. package/dist/{index-CzjFGFvP.js → index-BLQCYEc6.js} +8 -7
  65. package/dist/{index-B1NS2hBa.js → index-QsLFbxyG.js} +4 -4
  66. package/dist/{item-Dj14On9a.js → item-BvvQ9urP.js} +386 -386
  67. package/dist/{jszip.min-Be1afVon.js → jszip.min-DzdUiaR4.js} +353 -353
  68. package/dist/{menu-C0Xu-iTb.js → menu-DFNvhoNQ.js} +31149 -31298
  69. package/dist/{menu-kRDoPBjm.js → menu-QrVg2Ph7.js} +7 -7
  70. package/dist/{menuV2-D6Gmxd9X.js → menuV2-Ezf_jW40.js} +137 -142
  71. package/dist/mf-menu.css +1 -1
  72. package/dist/{priceTier-CJlFGOpm.js → priceTier-zENsn3P_.js} +1 -1
  73. package/dist/{scheduler-B11d6fJr.js → scheduler-BuwGSv6A.js} +8 -8
  74. package/dist/{subcategory-D6hTbHP-.js → subcategory-O3L_zCJA.js} +2 -2
  75. package/dist/{toExcel-BedErXvS.js → toExcel-CpRy_4nG.js} +2 -2
  76. package/dist/{unit-D5jDzsM2.js → unit-Ct_7Hfa2.js} +41 -42
  77. package/package.json +3 -3
  78. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B_Yv8Thl.js +0 -399
  79. package/dist/LinkProductSideSheet-DsoPo7Q_.js +0 -361
  80. package/dist/MenuSetting-CDSc-56P.js +0 -618
  81. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-LVWB5CIa.js +0 -5994
  82. package/dist/apps/mf-menu/src/composable/attributes.d.ts +0 -26
  83. package/dist/apps/mf-menu/src/utils/array.d.ts +0 -1
  84. package/dist/apps/mf-menu/src/utils/customAttributes.d.ts +0 -12
  85. package/dist/apps/mf-menu/src/views/MenuSetting/LinkProductRuleGroups.vue.d.ts +0 -2
  86. package/dist/apps/mf-menu/src/views/MenuSetting/RuleGroupSideSheet.vue.d.ts +0 -176
  87. package/dist/assets/linked-status-x1efKEih.js +0 -13
  88. package/dist/assets/override-menu-D8d9BWzy.js +0 -13
  89. package/dist/assets/validate-menu-DUJ20GHx.js +0 -13
  90. package/dist/customAttributes-32VmzFKZ.js +0 -177
  91. package/dist/index-FzHOAFSW.js +0 -246
@@ -1,20 +1,20 @@
1
1
  import { computed as n, onMounted as d, onBeforeUnmount as m } from "vue";
2
- import { u as c } from "./menu-C0Xu-iTb.js";
2
+ import { u as a } from "./menu-DFNvhoNQ.js";
3
3
  import "@feedmepos/mf-common";
4
4
  import "@feedmepos/ui-library";
5
5
  function p() {
6
- const e = c(), o = n(() => !e.state.currentSchedulerId), s = n(() => !e.state.currentCatalogId), u = n(() => {
6
+ const e = a(), o = n(() => !e.state.currentSchedulerId), s = n(() => !e.state.currentCatalogId), u = n(() => {
7
7
  const r = e.categorizedItems;
8
8
  return s.value && o.value ? r : r.filter((t) => !!t.items.length);
9
- }), a = n(() => u.value.slice().sort((t, i) => t.id ? i.id ? 0 : -1 : 1)), l = n(() => e.state.currentCategoryIds ? a.value.filter((r) => {
9
+ }), c = n(() => u.value.slice().sort((t, i) => t.id ? i.id ? 0 : -1 : 1)), l = n(() => e.state.currentCategoryIds ? c.value.filter((r) => {
10
10
  var t;
11
11
  return (t = e.state.currentCategoryIds) == null ? void 0 : t.includes(r.id);
12
- }) : a.value ?? []);
13
- return { categories: a, selectedCategories: l };
12
+ }) : c.value ?? []);
13
+ return { categories: c, selectedCategories: l };
14
14
  }
15
15
  function v() {
16
- const e = c(), o = () => {
17
- e.selectCatalog(null), e.selectCategory(null), e.selectScheduler(null), e.setRestaurantAttrParams({});
16
+ const e = a(), o = () => {
17
+ e.selectCatalog(null), e.selectCategory(null), e.selectScheduler(null), e.setRestaurantCustomAttributes(null);
18
18
  };
19
19
  function s() {
20
20
  m(() => {
@@ -1,21 +1,21 @@
1
- import { ao as L, H as k, D as I, A as J, ap as j, J as U, I as Y, a9 as w, c as x, X as E, aj as q, aq as Me, ar as Ee, B as ke, ab as Ie, as as Re, at as Te, a8 as Fe } from "./menu-C0Xu-iTb.js";
1
+ import { ao as G, H as k, D as I, A as J, ap as q, J as H, I as Y, a9 as w, c as x, X as E, aj as z, aq as Me, ar as Ee, B as ke, ab as Ie, as as Re, at as Te, a8 as Fe } from "./menu-DFNvhoNQ.js";
2
2
  import { defineStore as Ae } from "pinia";
3
- import { shallowRef as X, ref as D, computed as h, shallowReactive as Ke, effectScope as Pe, watch as Oe } from "vue";
4
- import { useCoreStore as z } from "@feedmepos/mf-common";
5
- import { useSnackbar as Ve } from "@feedmepos/ui-library";
6
- const xe = "/assets/linked-status-x1efKEih.js", Ne = "/assets/override-menu-D8d9BWzy.js";
7
- function $e(e) {
3
+ import { shallowRef as X, ref as U, computed as h, shallowReactive as Ke, effectScope as Oe, watch as Ve } from "vue";
4
+ import { useCoreStore as L } from "@feedmepos/mf-common";
5
+ import { useSnackbar as Ne } from "@feedmepos/ui-library";
6
+ const xe = "/assets/linked-status-B_crHhZH.js", $e = "/assets/override-menu-BmlCEpHH.js";
7
+ function Pe(e) {
8
8
  var a;
9
9
  const n = k(e), o = (a = n.variant) == null ? void 0 : a.variantCombinations;
10
10
  return delete n.variant, delete n.thumbnail, [n, ...o || []];
11
11
  }
12
- function Ue(e, n, o, a) {
13
- const r = k(n), l = o ? r.modules.catalog.find((_) => _._id === o) : null, d = a ? r.modules.scheduler.find((_) => _._id === a) : null, i = l ? k(l) : void 0, c = o ? r.modules.catalog.filter((_) => _._id !== o) : [], m = d ? k(d) : void 0, f = e.reduce((_, y) => (_[y._id] = $e(y), _), {});
14
- function v(_ = []) {
15
- const y = e.map((C) => C._id);
12
+ function He(e, n, o, a) {
13
+ const r = k(n), l = o ? r.modules.catalog.find((g) => g._id === o) : null, d = a ? r.modules.scheduler.find((g) => g._id === a) : null, i = l ? k(l) : void 0, c = o ? r.modules.catalog.filter((g) => g._id !== o) : [], m = d ? k(d) : void 0, f = e.reduce((g, y) => (g[y._id] = Pe(y), g), {});
14
+ function v(g = []) {
15
+ const y = e.map((b) => b._id);
16
16
  return [
17
- ..._.filter((C) => !y.includes(C._id)),
18
- ...Object.values(f).flatMap((C) => C)
17
+ ...g.filter((b) => !y.includes(b._id)),
18
+ ...Object.values(f).flatMap((b) => b)
19
19
  ];
20
20
  }
21
21
  return i && a ? (i.override.scheduler = {
@@ -23,8 +23,8 @@ function Ue(e, n, o, a) {
23
23
  [a]: {
24
24
  ...i.override.scheduler[a],
25
25
  _id: a,
26
- items: v(m == null ? void 0 : m.items).map((_) => ({
27
- ..._,
26
+ items: v(m == null ? void 0 : m.items).map((g) => ({
27
+ ...g,
28
28
  orderFrom: J.F_ORDER_FROM.enum.ALL
29
29
  }))
30
30
  }
@@ -32,12 +32,12 @@ function Ue(e, n, o, a) {
32
32
  ...i.override.items,
33
33
  ...f
34
34
  }, r.modules.catalog = [...c, i], r) : m ? (m.items = v(m.items), r.modules.scheduler = [
35
- ...r.modules.scheduler.filter((_) => _._id !== a),
35
+ ...r.modules.scheduler.filter((g) => g._id !== a),
36
36
  m
37
37
  ], r) : {
38
- ...j(),
38
+ ...q(),
39
39
  modules: {
40
- ...j().modules,
40
+ ...q().modules,
41
41
  catalog: r.modules.catalog,
42
42
  item: r.modules.item,
43
43
  group: r.modules.group,
@@ -54,15 +54,15 @@ function T(e, n, o) {
54
54
  throw new Error(`_insertItemOverriders - Item not found - ${e._id}`);
55
55
  const r = (l = a.groups) == null ? void 0 : l.map((d) => {
56
56
  var m, f, v;
57
- const i = (m = e == null ? void 0 : e.groups) == null ? void 0 : m.find((_) => _._id === d._id);
57
+ const i = (m = e == null ? void 0 : e.groups) == null ? void 0 : m.find((g) => g._id === d._id);
58
58
  let c;
59
- return i ? c = ((f = d.items) == null ? void 0 : f.map((_) => {
60
- var C;
61
- const y = (C = i.items) == null ? void 0 : C.find(
62
- (R) => R._id === _._id && R.combinationKey === _.combinationKey
59
+ return i ? c = ((f = d.items) == null ? void 0 : f.map((g) => {
60
+ var b;
61
+ const y = (b = i.items) == null ? void 0 : b.find(
62
+ (R) => R._id === g._id && R.combinationKey === g.combinationKey
63
63
  );
64
- return T(y || _, n, o + 1);
65
- })) ?? [] : c = ((v = d.items) == null ? void 0 : v.map((_) => T(_, n, o + 1))) ?? [], {
64
+ return T(y || g, n, o + 1);
65
+ })) ?? [] : c = ((v = d.items) == null ? void 0 : v.map((g) => T(g, n, o + 1))) ?? [], {
66
66
  ...d,
67
67
  items: c
68
68
  };
@@ -75,12 +75,12 @@ function T(e, n, o) {
75
75
  groups: r
76
76
  };
77
77
  }
78
- function De(e, n) {
78
+ function Ue(e, n) {
79
79
  const o = e.groups.map((l) => {
80
80
  const d = n.modules.group.find((c) => c._id === l._id), i = ((d == null ? void 0 : d.items) || []).map((c) => {
81
81
  var v;
82
82
  const m = (v = l.items) == null ? void 0 : v.find(
83
- (_) => _._id === c._id && _.combinationKey === c.combinationKey
83
+ (g) => g._id === c._id && g.combinationKey === c.combinationKey
84
84
  );
85
85
  if (m)
86
86
  return T(m, n, 1);
@@ -101,7 +101,7 @@ function De(e, n) {
101
101
  };
102
102
  return [...a, r];
103
103
  }
104
- function H(e, n) {
104
+ function D(e, n) {
105
105
  var a;
106
106
  if (!n)
107
107
  return e;
@@ -114,11 +114,11 @@ function H(e, n) {
114
114
  const m = (f = l == null ? void 0 : l.items) == null ? void 0 : f.find(
115
115
  (v) => v._id === c._id && v.combinationKey === c.combinationKey
116
116
  );
117
- return H(c, m);
117
+ return D(c, m);
118
118
  }), r;
119
119
  }), o;
120
120
  }
121
- function He(e, n) {
121
+ function De(e, n) {
122
122
  const o = e.items[n._id];
123
123
  n.variant && (n.variant = {
124
124
  ...n.variant,
@@ -128,7 +128,7 @@ function He(e, n) {
128
128
  );
129
129
  if (!l)
130
130
  throw new Error(`Item overrider not found - ${r._id} - ${r.combinationKey}`);
131
- return H(l, r);
131
+ return D(l, r);
132
132
  })
133
133
  });
134
134
  const a = o.find((r) => !r.combinationKey);
@@ -142,7 +142,7 @@ function He(e, n) {
142
142
  const c = (m = l == null ? void 0 : l.items) == null ? void 0 : m.find(
143
143
  (f) => f._id === i._id && f.combinationKey === i.combinationKey
144
144
  );
145
- return H(i, c);
145
+ return D(i, c);
146
146
  }), r;
147
147
  }), {
148
148
  ...n,
@@ -150,9 +150,9 @@ function He(e, n) {
150
150
  };
151
151
  }
152
152
  async function et(e, n, o, a, r, l = !0) {
153
- const d = k(o), i = l ? Ue(n, d, a, r) : d, c = n.reduce((v, _) => (v[_._id] = i.modules.item.find((y) => y._id === _._id), v), {}), m = n.reduce((v, _) => {
154
- const y = _._id;
155
- return v[y] = De(c[y], e), v;
153
+ const d = k(o), i = l ? He(n, d, a, r) : d, c = n.reduce((v, g) => (v[g._id] = i.modules.item.find((y) => y._id === g._id), v), {}), m = n.reduce((v, g) => {
154
+ const y = g._id;
155
+ return v[y] = Ue(c[y], e), v;
156
156
  }, {}), f = I.getFallbackPrices({
157
157
  rawMenu: i,
158
158
  items: m,
@@ -160,9 +160,9 @@ async function et(e, n, o, a, r, l = !0) {
160
160
  schedulerId: r
161
161
  });
162
162
  return n.map((v) => {
163
- const _ = v._id, y = c[_];
163
+ const g = v._id, y = c[g];
164
164
  return {
165
- ...He(f, y),
165
+ ...De(f, y),
166
166
  category: a || r ? y == null ? void 0 : y.category : null
167
167
  };
168
168
  });
@@ -180,22 +180,22 @@ function tt(e, n) {
180
180
  return r;
181
181
  }, [])) || []).join(" / ");
182
182
  }
183
- const N = /* @__PURE__ */ new Map();
183
+ const $ = /* @__PURE__ */ new Map();
184
184
  async function nt(e, n) {
185
185
  const o = `${e._id}-${e.updatedAt}-${n}`;
186
- if (N.has(o))
187
- return N.get(o);
188
- const a = await L(
186
+ if ($.has(o))
187
+ return $.get(o);
188
+ const a = await G(
189
189
  xe,
190
190
  JSON.stringify({
191
191
  menu: e,
192
192
  itemId: n
193
193
  })
194
194
  );
195
- return N.set(o, a), a;
195
+ return $.set(o, a), a;
196
196
  }
197
- async function Q(e, n, o) {
198
- return await L(Ne, {
197
+ async function Z(e, n, o) {
198
+ return await G($e, {
199
199
  menu: e,
200
200
  catalogId: n,
201
201
  schedulerId: o
@@ -231,17 +231,17 @@ function ot(e, n, o) {
231
231
  }
232
232
  return r(n, o);
233
233
  }
234
- const $ = /* @__PURE__ */ new Map();
235
- async function We(e, n, o) {
234
+ const P = /* @__PURE__ */ new Map();
235
+ async function Be(e, n, o) {
236
236
  const a = `${e._id}-${e.updatedAt}-${n || "null"}-${o || "null"}`;
237
- if ($.has(a))
238
- return $.get(a);
239
- const r = await Q(e, n, o);
240
- return $.set(a, r), r;
237
+ if (P.has(a))
238
+ return P.get(a);
239
+ const r = await Z(e, n, o);
240
+ return P.set(a, r), r;
241
241
  }
242
242
  async function st(e, n, o) {
243
243
  var d, i;
244
- const a = await We(e, n, null), r = [], l = (c, m) => {
244
+ const a = await Be(e, n, null), r = [], l = (c, m) => {
245
245
  const f = k(c);
246
246
  for (const v in m)
247
247
  m[v] && (f[v] = m[v]);
@@ -250,25 +250,25 @@ async function st(e, n, o) {
250
250
  for (const c of a.modules.group) {
251
251
  const m = (d = c.items) == null ? void 0 : d.find((v) => v._id === o && !v.combinationKey), f = e.modules.item.find((v) => v._id === o);
252
252
  if (m) {
253
- const v = (i = c.items) == null ? void 0 : i.filter((y) => y._id === o && y.combinationKey), _ = [m, ...v].map((y) => {
253
+ const v = (i = c.items) == null ? void 0 : i.filter((y) => y._id === o && y.combinationKey), g = [m, ...v].map((y) => {
254
254
  var F, A;
255
- const C = y.combinationKey ? (A = (F = f == null ? void 0 : f.variant) == null ? void 0 : F.variantCombinations) == null ? void 0 : A.find(
255
+ const b = y.combinationKey ? (A = (F = f == null ? void 0 : f.variant) == null ? void 0 : F.variantCombinations) == null ? void 0 : A.find(
256
256
  (K) => K.combinationKey === y.combinationKey
257
- ) : f, R = C && f ? l(f, C) : y;
257
+ ) : f, R = b && f ? l(f, b) : y;
258
258
  return l(R, y);
259
259
  });
260
260
  r.push({
261
261
  group: c,
262
- items: _
262
+ items: g
263
263
  });
264
264
  }
265
265
  }
266
266
  return r;
267
267
  }
268
- function Be({
268
+ function We({
269
269
  maxHistorySize: e = 50
270
270
  }) {
271
- const n = X([]), o = D(-1), a = h(() => o.value > 0), r = h(() => o.value < n.value.length - 1);
271
+ const n = X([]), o = U(-1), a = h(() => o.value > 0), r = h(() => o.value < n.value.length - 1);
272
272
  function l(m) {
273
273
  n.value.push(m), o.value++, n.value.length > e && (n.value.shift(), o.value--);
274
274
  }
@@ -292,9 +292,9 @@ function Be({
292
292
  clear: c
293
293
  };
294
294
  }
295
- const Ge = {
295
+ const je = {
296
296
  async updateMenuModule(e, n) {
297
- const o = U.RequestRunner.operation(n, e.modules);
297
+ const o = H.RequestRunner.operation(n, e.modules);
298
298
  if (o.validateError.length > 0)
299
299
  throw new Error(o.validateError.join(`
300
300
  `));
@@ -306,7 +306,7 @@ const Ge = {
306
306
  return Y.cloneDeep({ menu: a, updateId: o.id ?? null });
307
307
  }
308
308
  };
309
- function Z() {
309
+ function Q() {
310
310
  return {
311
311
  _id: "",
312
312
  masterCatalogSetting: { inclusiveTaxes: [] },
@@ -329,23 +329,20 @@ function Z() {
329
329
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
330
330
  };
331
331
  }
332
- function je() {
332
+ function qe() {
333
333
  return {
334
334
  restaurants: [],
335
- menu: { ...Z(), _rev: "" },
335
+ menu: { ...Q(), _rev: "" },
336
336
  currentCatalogId: null,
337
337
  currentCategoryIds: null,
338
338
  currentSchedulerId: "",
339
- currentRestaurantAttrParams: {
340
- restaurantCustomAttributes: null,
341
- restaurantAttributes: null
342
- }
339
+ currentRestaurantCustomAttributes: null
343
340
  };
344
341
  }
345
342
  const at = Ae(
346
343
  "mf-menu-store-v2",
347
344
  () => {
348
- const e = Ke(je()), n = z(), o = Ve(), a = h(() => e.menu.modules.serveSequence ? w(e.menu.modules.serveSequence, {
345
+ const e = Ke(qe()), n = L(), o = Ne(), a = h(() => e.menu.modules.serveSequence ? w(e.menu.modules.serveSequence, {
349
346
  selector: "position"
350
347
  }) : []), r = h(() => {
351
348
  var t;
@@ -360,9 +357,8 @@ const at = Ae(
360
357
  );
361
358
  return t && ((s = t.linkItemRules) != null && s.length) && (t = I.populateCatalog({
362
359
  catalog: t,
363
- ruleGroupSettings: e.menu.ruleGroupSettings,
364
360
  items: e.menu.modules.item,
365
- ...e.currentRestaurantAttrParams ?? {}
361
+ restaurantCustomAttributes: e.currentRestaurantCustomAttributes || {}
366
362
  })), t;
367
363
  }), c = h(() => w(v.value.modules.scheduler, { selector: "name" })), m = h(() => e.menu.modules.scheduler.find(
368
364
  (t) => t._id === e.currentSchedulerId
@@ -370,21 +366,20 @@ const at = Ae(
370
366
  function f(t, s = !0) {
371
367
  e.menu = { ...t, _rev: e.menu._rev }, s && M.push(e.menu);
372
368
  }
373
- const v = X(Z()), _ = D(!1), y = D(1);
374
- async function C() {
369
+ const v = X(Q()), g = U(!1), y = U(1);
370
+ async function b() {
375
371
  var u;
376
- _.value = !0;
372
+ g.value = !0;
377
373
  let t = e.menu.modules.catalog;
378
374
  if (i.value && ((u = i.value.linkItemRules) != null && u.length)) {
379
375
  const p = I.populateCatalog({
380
376
  catalog: i.value,
381
- ruleGroupSettings: e.menu.ruleGroupSettings,
382
377
  items: e.menu.modules.item,
383
- ...e.currentRestaurantAttrParams ?? {}
378
+ restaurantCustomAttributes: e.currentRestaurantCustomAttributes || {}
384
379
  });
385
- t = e.menu.modules.catalog.map((g) => g._id === (p == null ? void 0 : p._id) ? p : g);
380
+ t = e.menu.modules.catalog.map((_) => _._id === (p == null ? void 0 : p._id) ? p : _);
386
381
  }
387
- const s = await Q(
382
+ const s = await Z(
388
383
  {
389
384
  ...e.menu,
390
385
  modules: {
@@ -397,20 +392,20 @@ const at = Ae(
397
392
  );
398
393
  if (e.currentSchedulerId != null) {
399
394
  const p = e.menu.modules.catalog.find(
400
- (b) => b._id === e.currentCatalogId
401
- ), g = p ? p.override.scheduler[e.currentSchedulerId] : e.menu.modules.scheduler.find(
402
- (b) => b._id === e.currentSchedulerId
403
- ), S = new Set(((g == null ? void 0 : g.items) || []).map((b) => b._id));
404
- s.modules.item = s.modules.item.filter((b) => S.has(b._id));
395
+ (S) => S._id === e.currentCatalogId
396
+ ), _ = p ? p.override.scheduler[e.currentSchedulerId] : e.menu.modules.scheduler.find(
397
+ (S) => S._id === e.currentSchedulerId
398
+ ), C = new Set(((_ == null ? void 0 : _.items) || []).map((S) => S._id));
399
+ s.modules.item = s.modules.item.filter((S) => C.has(S._id));
405
400
  }
406
- return v.value = s, _.value = !1, y.value = y.value + 1, s;
401
+ return v.value = s, g.value = !1, y.value = y.value + 1, s;
407
402
  }
408
- const F = Y.debounce(C, 200);
409
- Pe(!0).run(() => {
410
- Oe(
403
+ const F = Y.debounce(b, 200);
404
+ Oe(!0).run(() => {
405
+ Ve(
411
406
  () => [e.menu, e.currentCatalogId, e.currentSchedulerId],
412
407
  () => {
413
- _.value || F();
408
+ g.value || F();
414
409
  }
415
410
  );
416
411
  });
@@ -423,10 +418,10 @@ const at = Ae(
423
418
  label: t.name,
424
419
  value: t._id
425
420
  }))
426
- ]), W = h(() => {
421
+ ]), B = h(() => {
427
422
  const t = v.value.modules.category;
428
423
  return [
429
- ...O.value.item.addon ? [
424
+ ...V.value.item.addon ? [
430
425
  {
431
426
  _id: e.currentCatalogId ? "" : null,
432
427
  name: "Addon",
@@ -438,31 +433,31 @@ const at = Ae(
438
433
  }), ee = h(() => {
439
434
  const t = v.value.modules.subCategory || [];
440
435
  return E(t, (s) => s.name);
441
- }), B = h(() => {
436
+ }), W = h(() => {
442
437
  var s;
443
438
  let t = v.value.modules.item;
444
439
  if (i.value) {
445
440
  const u = (s = i.value) == null ? void 0 : s.override.items;
446
441
  t = t.filter((p) => {
447
- var S;
448
- const g = (S = u == null ? void 0 : u[p._id]) == null ? void 0 : S.find(
449
- (b) => !b.combinationKey
442
+ var C;
443
+ const _ = (C = u == null ? void 0 : u[p._id]) == null ? void 0 : C.find(
444
+ (S) => !S.combinationKey
450
445
  );
451
- return (g == null ? void 0 : g.orderFrom) !== J.F_ORDER_FROM.enum.NONE;
446
+ return (_ == null ? void 0 : _.orderFrom) !== J.F_ORDER_FROM.enum.NONE;
452
447
  });
453
448
  }
454
449
  return E(t, (u) => u.code || u.name);
455
450
  }), te = h(() => {
456
451
  const t = e.menu.modules.category, s = E(t, (p) => p.name).reduce(
457
- (p, g, S) => (p[g._id] = S, p),
452
+ (p, _, C) => (p[_._id] = C, p),
458
453
  { "": 0 }
459
454
  ), u = e.menu.modules.item;
460
455
  return E(
461
456
  u,
462
457
  (p) => p.code || p.name
463
- ).reduce((p, g, S) => (p[g._id] = S + s[g.category || ""], p), {});
464
- }), ne = h(() => q(P.value, W.value, B.value)), re = h(() => {
465
- const t = O.value.item.addon ? [
458
+ ).reduce((p, _, C) => (p[_._id] = C + s[_.category || ""], p), {});
459
+ }), ne = h(() => z(O.value, B.value, W.value)), re = h(() => {
460
+ const t = V.value.item.addon ? [
466
461
  {
467
462
  _id: e.currentCatalogId ? "" : null,
468
463
  name: "Addon",
@@ -470,18 +465,18 @@ const at = Ae(
470
465
  },
471
466
  ...e.menu.modules.category
472
467
  ] : e.menu.modules.category;
473
- return q(
468
+ return z(
474
469
  e.menu.modules.variant,
475
470
  t,
476
471
  e.menu.modules.item
477
472
  );
478
- }), P = h(() => {
473
+ }), O = h(() => {
479
474
  const t = v.value.modules.variant;
480
475
  return w(t, { selector: "name" });
481
476
  });
482
477
  function oe(t = []) {
483
- const s = t.map((p) => P.value.find((g) => g._id === p)).filter((p) => !!p);
484
- return I.fullVariantCombination(s).reduce((p, g) => (p[g.combinationKey] = g.selectionName.join(" / "), p), {});
478
+ const s = t.map((p) => O.value.find((_) => _._id === p)).filter((p) => !!p);
479
+ return I.fullVariantCombination(s).reduce((p, _) => (p[_.combinationKey] = _.selectionName.join(" / "), p), {});
485
480
  }
486
481
  const se = h(() => E(v.value.modules.group, (t) => t.name)), ae = h(() => w(v.value.modules.takeaway, { selector: "name" })), ue = h(() => w(e.menu.modules.printDepartment || [], {
487
482
  selector: "name"
@@ -490,7 +485,7 @@ const at = Ae(
490
485
  })), le = h(() => e.menu.modules.cookingGuide), de = h(() => {
491
486
  const t = Ee(e.menu.modules.sku);
492
487
  return w(t, { selector: "code" });
493
- }), O = h(() => {
488
+ }), V = h(() => {
494
489
  const t = !e.currentCatalogId, s = r.value === x.F_MENU_VERSION.v4, u = !e.currentSchedulerId, p = {
495
490
  create: t && u,
496
491
  edit: t && u,
@@ -525,7 +520,7 @@ const at = Ae(
525
520
  bindToVariant: s,
526
521
  print: t && u,
527
522
  toRoot: s && u,
528
- takeaway: (g) => !!g && (s || t) && u,
523
+ takeaway: (_) => !!_ && (s || t) && u,
529
524
  multiScheduler: s,
530
525
  canRearrange: s,
531
526
  printConfig: s
@@ -559,7 +554,7 @@ const at = Ae(
559
554
  }
560
555
  };
561
556
  });
562
- function V(t) {
557
+ function N(t) {
563
558
  return `${t.systemCode}/${t.taxCode}`;
564
559
  }
565
560
  function me(t) {
@@ -567,66 +562,66 @@ const at = Ae(
567
562
  return { systemCode: s, taxCode: u };
568
563
  }
569
564
  function fe(t, s, u) {
570
- return (t ?? s ?? []).map((p) => V(p)).find((p) => u.some((g) => g.value === p));
565
+ return (t ?? s ?? []).map((p) => N(p)).find((p) => u.some((_) => _.value === p));
571
566
  }
572
567
  const pe = h(() => {
573
568
  var p;
574
569
  const t = ["SV5", "SV10"], s = ke.Country.getCountryFlattenTaxes(
575
- z().currentCountry.value
576
- ), u = s.filter((g) => l.value || !t.includes(g.taxCode)).map((g) => ({
577
- label: `${g.name} (${Ie(g.rate)}%)`,
578
- value: V(g),
570
+ L().currentCountry.value
571
+ ), u = s.filter((_) => l.value || !t.includes(_.taxCode)).map((_) => ({
572
+ label: `${_.name} (${Ie(_.rate)}%)`,
573
+ value: N(_),
579
574
  meta: {
580
- rate: g.rate
575
+ rate: _.rate
581
576
  }
582
577
  }));
583
- return u.sort((g, S) => g.label.localeCompare(S.label, void 0, { numeric: !0 })), {
578
+ return u.sort((_, C) => _.label.localeCompare(C.label, void 0, { numeric: !0 })), {
584
579
  systemCode: (p = s[0]) == null ? void 0 : p.systemCode,
585
580
  countryTaxOptions: u
586
581
  };
587
582
  }), ve = async () => {
588
583
  const t = await Fe.readMenu();
589
- e.menu = t ?? e.menu, G(null);
590
- }, ge = async () => {
584
+ e.menu = t ?? e.menu, j(null);
585
+ }, _e = async () => {
591
586
  const { fetchAllRestaurants: t } = Te();
592
587
  await t({
593
588
  onBatchEnd: (s) => {
594
589
  e.restaurants = s;
595
590
  }
596
591
  });
597
- }, G = (t) => {
592
+ }, j = (t) => {
598
593
  e.currentCatalogId = t;
599
- }, _e = (t) => {
594
+ }, ge = (t) => {
600
595
  e.currentSchedulerId = t;
601
596
  }, ye = (t) => {
602
597
  e.currentCategoryIds = t;
603
598
  }, he = (t) => {
604
- e.currentRestaurantAttrParams = t;
605
- }, Se = async (t, s) => {
599
+ e.currentRestaurantCustomAttributes = t;
600
+ }, Ce = async (t, s) => {
606
601
  const u = Array.isArray(t) ? t : [t];
607
602
  if (!u.length) return;
608
- const p = u.map((g) => ({
609
- ...g,
603
+ const p = u.map((_) => ({
604
+ ..._,
610
605
  _id: e.menu._id,
611
606
  _rev: e.menu._rev
612
607
  }));
613
608
  try {
614
609
  if (s || p.some(
615
- (S) => [U.F_OPERATION_TYPE.delete, U.F_OPERATION_TYPE.deleteMany].includes(S.operation)
610
+ (C) => [H.F_OPERATION_TYPE.delete, H.F_OPERATION_TYPE.deleteMany].includes(C.operation)
616
611
  )) {
617
- const S = await Re(p, e.menu.modules);
618
- if (S !== !0) throw new Error(S);
612
+ const C = await Re(p, e.menu.modules);
613
+ if (C !== !0) throw new Error(C);
619
614
  }
620
- const g = await Ge.updateMenuModule(e.menu, p);
621
- return f(g.menu), g;
622
- } catch (g) {
615
+ const _ = await je.updateMenuModule(e.menu, p);
616
+ return f(_.menu), _;
617
+ } catch (_) {
623
618
  o.open({
624
619
  type: "error",
625
620
  title: "Failed to update menu",
626
- message: g
621
+ message: _
627
622
  });
628
623
  }
629
- }, Ce = async (t) => {
624
+ }, be = async (t) => {
630
625
  const s = {
631
626
  ...e.menu,
632
627
  masterCatalogSetting: t.masterCatalogSetting,
@@ -634,11 +629,11 @@ const at = Ae(
634
629
  priceTierSettings: t.priceTierSettings
635
630
  };
636
631
  return f(s), s;
637
- }, M = Be({ maxHistorySize: 50 }), be = h(() => M.canUndo.value), we = h(() => M.canRedo.value);
632
+ }, M = We({ maxHistorySize: 50 }), Se = h(() => M.canUndo.value), we = h(() => M.canRedo.value);
638
633
  return {
639
634
  state: e,
640
635
  // loading state
641
- workerIsComputing: _,
636
+ workerIsComputing: g,
642
637
  mergedMenuChangeId: y,
643
638
  // async computed state
644
639
  mergedMenu: v,
@@ -651,13 +646,13 @@ const at = Ae(
651
646
  schedulers: c,
652
647
  currentScheduler: m,
653
648
  catalogOptions: K,
654
- categories: W,
649
+ categories: B,
655
650
  subcategories: ee,
656
- items: B,
651
+ items: W,
657
652
  sortedItems: te,
658
653
  categorizedItems: ne,
659
654
  categorizedRawMenuItems: re,
660
- variants: P,
655
+ variants: O,
661
656
  groups: se,
662
657
  takeaways: ae,
663
658
  printDepartments: ue,
@@ -665,26 +660,26 @@ const at = Ae(
665
660
  recipes: ce,
666
661
  cookingGuide: le,
667
662
  skus: de,
668
- rules: O,
663
+ rules: V,
669
664
  taxSetting: pe,
670
665
  // Action
671
666
  setMenu: f,
672
667
  readMenu: ve,
673
- readRestaurants: ge,
674
- selectCatalog: G,
675
- selectScheduler: _e,
668
+ readRestaurants: _e,
669
+ selectCatalog: j,
670
+ selectScheduler: ge,
676
671
  selectCategory: ye,
677
- setRestaurantAttrParams: he,
678
- updateMenu: Se,
679
- updateMenuSetting: Ce,
680
- computeMergedMenu: C,
672
+ setRestaurantCustomAttributes: he,
673
+ updateMenu: Ce,
674
+ updateMenuSetting: be,
675
+ computeMergedMenu: b,
681
676
  // helper
682
- encodeTax: V,
677
+ encodeTax: N,
683
678
  decodeTax: me,
684
679
  getSelectedTax: fe,
685
680
  mapVariant: oe,
686
681
  // history
687
- canUndoHistory: be,
682
+ canUndoHistory: Se,
688
683
  canRedoHistory: we,
689
684
  undoHistory: () => {
690
685
  const t = M.undo();
@@ -707,6 +702,6 @@ export {
707
702
  st as f,
708
703
  tt as g,
709
704
  et as m,
710
- We as o,
705
+ Be as o,
711
706
  at as u
712
707
  };