@feedmepos/mf-menu 0.31.57-beta.1 → 0.31.58-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 (66) hide show
  1. package/dist/{App-aAKiJnh0.js → App-CEwyPSKB.js} +9 -9
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-NXGiy_Vi.js → ApplyProduct.vue_vue_type_script_setup_true_lang-B1PaP0os.js} +3 -3
  3. package/dist/{Catalog-C10xa9eC.js → Catalog-CrgKBjTt.js} +6 -6
  4. package/dist/{Category-D8pSAVyA.js → Category-Brt03UVR.js} +4 -4
  5. package/dist/{Category-Bl2XO9Gw.js → Category-Do3tDNNq.js} +6 -6
  6. package/dist/{CookingGuide-CMuLuYac.js → CookingGuide-DtkAi9bK.js} +4 -4
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-D3HyvX87.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-8ObJv2LZ.js} +1 -1
  8. package/dist/{Group-Bj0bEvqc.js → Group-CX1rH4Ba.js} +1 -1
  9. package/dist/{Group-BXQwwY0b.js → Group-gQPAHr2A.js} +3 -3
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-qY3jdMS5.js → Group.vue_vue_type_script_setup_true_lang-DWVGPzwc.js} +7 -7
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DB-tcwBf.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-PQJm4GbD.js} +5 -5
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-dygqJ3VG.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DLVjK7wR.js} +4107 -4075
  13. package/dist/{Ingredient-Bjh831zB.js → Ingredient-_nl97wdl.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-Dx6kizk9.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DAO5hp3N.js} +2 -2
  15. package/dist/{LinkProductSideSheet-Dl7ZCKLX.js → LinkProductSideSheet-0p5Z66Ua.js} +3 -3
  16. package/dist/{MenuSetting-789QTAVy.js → MenuSetting-CHOMVwXS.js} +5 -5
  17. package/dist/{PrintRoute-BYMvZbDY.js → PrintRoute-PR9yqoD5.js} +4 -4
  18. package/dist/{Product-CksVbnED.js → Product-D74PpxCy.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-CtvxpNXr.js → Product.vue_vue_type_script_setup_true_lang-CW6W8Ros.js} +13 -13
  20. package/dist/{ProductInternalTools-DguHTMPE.js → ProductInternalTools-BH4Rtb8s.js} +6 -6
  21. package/dist/{Products-BMX_DEfq.js → Products-BoP_Sfwi.js} +248 -234
  22. package/dist/{Publish-D4pG8ROv.js → Publish-B82vhm2_.js} +3 -3
  23. package/dist/{Recipe-Bb2cvtQl.js → Recipe-C8KXjAzg.js} +4 -4
  24. package/dist/{Scheduler-3mB7sbUy.js → Scheduler-CkAclfQw.js} +3 -3
  25. package/dist/{ServingSequence-jqZltK35.js → ServingSequence-BlUDI5uT.js} +3 -3
  26. package/dist/{Setting-4ajIRdjS.js → Setting-B7jaIIPx.js} +5 -5
  27. package/dist/{Subcategory-Co2dVm-d.js → Subcategory-ZoTKyleD.js} +4 -4
  28. package/dist/{Takeaway-CI6sUy3N.js → Takeaway-bOnEUU7z.js} +1 -1
  29. package/dist/{Takeaway-CUMp76j-.js → Takeaway-hSioiPLy.js} +4 -4
  30. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-RZnNkRB-.js → Takeaway.vue_vue_type_script_setup_true_lang-B5HjkmRS.js} +5 -5
  31. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-BIeEXn3K.js → Thumbnail.vue_vue_type_script_setup_true_lang-SR02hz_g.js} +4 -4
  32. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-C4TSckYQ.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D6_okQqi.js} +15 -15
  33. package/dist/{Unit-Cw1aS6gI.js → Unit-iVeouD8Q.js} +2 -2
  34. package/dist/{Variant-BH3zII_W.js → Variant-09Ayb-LB.js} +3 -3
  35. package/dist/{_id_-GHpxvMJq.js → _id_-T4NFKO76.js} +10 -10
  36. package/dist/{app-B9SuCjTJ.js → app-BeeqJ5ia.js} +1 -1
  37. package/dist/{app-CE8Yjb5N.js → app-G1eIeNve.js} +26 -26
  38. package/dist/app.js +1 -1
  39. package/dist/apps/mf-menu/src/helper/import-export-utils.d.ts +3 -0
  40. package/dist/apps/mf-menu/src/helper/menuExport.d.ts +5 -1
  41. package/dist/apps/mf-menu/src/helper/menuImport.d.ts +5 -0
  42. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/assets/{linked-status-vxHdMTuo.js → linked-status-D54oQ8ty.js} +2 -2
  44. package/dist/assets/{override-menu-DHz7zcGn.js → override-menu-CTzTh4oF.js} +2 -2
  45. package/dist/assets/{validate-menu-BATWO60n.js → validate-menu-DEP4gzNo.js} +2 -2
  46. package/dist/{catalog-D9AmUcSy.js → catalog-DireBPbe.js} +1 -1
  47. package/dist/{catalogSetting-BJO4QrOF.js → catalogSetting-8687T4sf.js} +1 -1
  48. package/dist/{category-D37cZ_Dk.js → category-CxZ7l7TH.js} +1 -1
  49. package/dist/{currency-Zqm_LWL_.js → currency-C-x74Ihc.js} +1 -1
  50. package/dist/{customAttributes-D9-zftG3.js → customAttributes-PLOo5TFF.js} +1 -1
  51. package/dist/{dayjs.min-B9jKkSFx.js → dayjs.min-D4oh6LGN.js} +1 -1
  52. package/dist/{index-BVoSUbUK.js → index-B6y1Idp6.js} +3 -3
  53. package/dist/{index-D1Ochoxn.js → index-CWlWCkLQ.js} +1 -1
  54. package/dist/{index-0TfxxmDg.js → index-Deb8Se9C.js} +4 -4
  55. package/dist/{index-Du_lEFBb.js → index-Dr70dTcK.js} +1 -1
  56. package/dist/{item-BADDeXCY.js → item-8v-mL4Tk.js} +375 -375
  57. package/dist/{jszip.min-Dyeexk5v.js → jszip.min-BlCVvZNl.js} +2 -2
  58. package/dist/{menu-U8mwR2QD.js → menu-CbIzWmhP.js} +159 -159
  59. package/dist/{menu-dIq2-n2M.js → menu-DhH8YWvV.js} +1 -1
  60. package/dist/{menuV2-G2IOgnAS.js → menuV2-B3QHrvzJ.js} +69 -69
  61. package/dist/{priceTier-Bwd3ibGM.js → priceTier-BHuvA89h.js} +1 -1
  62. package/dist/{scheduler-mB0AE2bM.js → scheduler-PDDah5xR.js} +4 -4
  63. package/dist/{subcategory-C6rKZbqO.js → subcategory-B-usgK3T.js} +2 -2
  64. package/dist/{toExcel-CPZ73Gdw.js → toExcel-C6kSxe7z.js} +2 -2
  65. package/dist/{unit-Dori0VKd.js → unit-CtG4RVnF.js} +2 -2
  66. package/package.json +1 -1
@@ -1,23 +1,23 @@
1
1
  var le = Object.defineProperty;
2
2
  var ue = (x, e, i) => e in x ? le(x, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : x[e] = i;
3
- var $ = (x, e, i) => ue(x, typeof e != "symbol" ? e + "" : e, i);
4
- import { defineComponent as W, computed as S, ref as te, resolveComponent as G, createBlock as D, openBlock as E, unref as l, withCtx as I, createElementVNode as M, toDisplayString as oe, createVNode as _, createCommentVNode as ae, createElementBlock as j, Fragment as B } from "vue";
5
- import { D as K } from "./dayjs.min-B9jKkSFx.js";
6
- import { m as R, A as P, f as y, a as H, b as L, e as A, n as O, w as de } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-dygqJ3VG.js";
7
- import { J as pe, F as fe } from "./jszip.min-Dyeexk5v.js";
8
- import { u as ne, G as re, B as J, e as z, A as ie, D as he, H as q, I as X } from "./menu-U8mwR2QD.js";
9
- import { useCoreStore as be, useI18n as ye } from "@feedmepos/mf-common";
10
- import { useDialog as se, useDialogChild as ge, useSnackbar as ce, useBreakpoints as _e, FmButtonVariant as U, FmButtonColorThemeVariant as N } from "@feedmepos/ui-library";
3
+ var K = (x, e, i) => ue(x, typeof e != "symbol" ? e + "" : e, i);
4
+ import { defineComponent as W, computed as S, ref as te, resolveComponent as V, createBlock as D, openBlock as E, unref as l, withCtx as I, createElementVNode as M, toDisplayString as oe, createVNode as _, createCommentVNode as ae, createElementBlock as j, Fragment as B } from "vue";
5
+ import { D as G } from "./dayjs.min-D4oh6LGN.js";
6
+ import { m as R, A as P, f as h, a as H, b as L, e as A, n as O, w as de } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-DLVjK7wR.js";
7
+ import { J as pe, F as fe } from "./jszip.min-BlCVvZNl.js";
8
+ import { u as re, G as ne, B as J, e as z, A as ie, D as be, H as q, I as X } from "./menu-CbIzWmhP.js";
9
+ import { useCoreStore as ge, useI18n as he } from "@feedmepos/mf-common";
10
+ import { useDialog as se, useDialogChild as ye, useSnackbar as ce, useBreakpoints as _e, FmButtonVariant as U, FmButtonColorThemeVariant as N } from "@feedmepos/ui-library";
11
11
  import { _ as Y } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
12
12
  import { _ as ke, a as Z } from "./BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js";
13
13
  import { _ as ve } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
14
- import { u as we, a as xe } from "./menu-dIq2-n2M.js";
15
- import { u as Fe } from "./item-BADDeXCY.js";
16
- import { _ as Q, a as Ce } from "./Product.vue_vue_type_script_setup_true_lang-CtvxpNXr.js";
17
- import { L as ee } from "./LinkProductSideSheet-Dl7ZCKLX.js";
18
- import { _ as Me } from "./TreeEditorOpenner.vue_vue_type_script_setup_true_lang-C4TSckYQ.js";
19
- import { u as Ie } from "./Thumbnail.vue_vue_type_script_setup_true_lang-BIeEXn3K.js";
20
- import { m as Ee } from "./toExcel-CPZ73Gdw.js";
14
+ import { u as we, a as xe } from "./menu-DhH8YWvV.js";
15
+ import { u as Ce } from "./item-8v-mL4Tk.js";
16
+ import { _ as Q, a as Fe } from "./Product.vue_vue_type_script_setup_true_lang-CW6W8Ros.js";
17
+ import { L as ee } from "./LinkProductSideSheet-0p5Z66Ua.js";
18
+ import { _ as Me } from "./TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D6_okQqi.js";
19
+ import { u as Ie } from "./Thumbnail.vue_vue_type_script_setup_true_lang-SR02hz_g.js";
20
+ import { m as Ee } from "./toExcel-C6kSxe7z.js";
21
21
  const Te = { class: "space-y-24 mb-24" }, Se = ["innerHTML"], De = { class: "flex justify-end gap-8" }, Ne = /* @__PURE__ */ W({
22
22
  __name: "ConfirmActionDialog",
23
23
  props: {
@@ -26,34 +26,34 @@ const Te = { class: "space-y-24 mb-24" }, Se = ["innerHTML"], De = { class: "fle
26
26
  message: { default: "To confirm your action, type <b>[[value]]</b> in the text field." }
27
27
  },
28
28
  setup(x) {
29
- const e = x, i = S(() => e.message.replace("[[value]]", e.value)), a = te(""), t = se(), { emitAction: n } = ge();
30
- return (r, o) => {
31
- const c = G("FmTextField"), s = G("FmButton"), u = G("FmForm");
32
- return E(), D(u, {
33
- "on-validation-success": () => l(n)("primary"),
29
+ const e = x, i = S(() => e.message.replace("[[value]]", e.value)), a = te(""), t = se(), { emitAction: r } = ye();
30
+ return (n, o) => {
31
+ const m = V("FmTextField"), s = V("FmButton"), d = V("FmForm");
32
+ return E(), D(d, {
33
+ "on-validation-success": () => l(r)("primary"),
34
34
  "blame-form-child-on-validation-failed": ""
35
35
  }, {
36
36
  default: I(() => [
37
37
  M("div", Te, [
38
- M("div", null, oe(r.description), 1),
38
+ M("div", null, oe(n.description), 1),
39
39
  M("div", { innerHTML: i.value }, null, 8, Se),
40
40
  M("div", null, [
41
- _(c, {
41
+ _(m, {
42
42
  modelValue: a.value,
43
43
  "onUpdate:modelValue": [
44
- o[0] || (o[0] = (m) => a.value = m),
44
+ o[0] || (o[0] = (c) => a.value = c),
45
45
  o[1] || (o[1] = () => {
46
46
  })
47
47
  ],
48
- placeholder: r.value,
49
- rules: [(m) => m === r.value || "Value does not match"]
48
+ placeholder: n.value,
49
+ rules: [(c) => c === n.value || "Value does not match"]
50
50
  }, null, 8, ["modelValue", "placeholder", "rules"])
51
51
  ]),
52
52
  M("div", De, [
53
53
  _(s, {
54
54
  label: "Cancel",
55
55
  variant: "secondary",
56
- onClick: o[2] || (o[2] = (m) => l(t).close())
56
+ onClick: o[2] || (o[2] = (c) => l(t).close())
57
57
  }),
58
58
  _(s, {
59
59
  label: "Confirm",
@@ -69,9 +69,9 @@ const Te = { class: "space-y-24 mb-24" }, Se = ["innerHTML"], De = { class: "fle
69
69
  }), Ke = /* @__PURE__ */ W({
70
70
  __name: "Migrate",
71
71
  setup(x) {
72
- const e = ne(), i = be(), a = ce(), { minor: t } = re(a), n = te(!1), r = se();
72
+ const e = re(), i = ge(), a = ce(), { minor: t } = ne(a), r = te(!1), n = se();
73
73
  async function o() {
74
- c.value || n.value || r.open({
74
+ m.value || r.value || n.open({
75
75
  title: "Migrate to new version",
76
76
  contentComponent: Ne,
77
77
  contentComponentProps: {
@@ -79,14 +79,14 @@ const Te = { class: "space-y-24 mb-24" }, Se = ["innerHTML"], De = { class: "fle
79
79
  description: "Do you want to migrate to new version? Once migrate it will unable to revert to the older version."
80
80
  }
81
81
  }).onPrimary(async () => {
82
- r.close(), await t(
82
+ n.close(), await t(
83
83
  async () => {
84
84
  await e.migrate(), setTimeout(() => {
85
85
  window.location.reload();
86
86
  }, 2e3);
87
87
  },
88
88
  {
89
- isLoading: n,
89
+ isLoading: r,
90
90
  customId: e.state.menu._id,
91
91
  message: "Migrating menu",
92
92
  successMessage: "Migration completed"
@@ -94,15 +94,15 @@ const Te = { class: "space-y-24 mb-24" }, Se = ["innerHTML"], De = { class: "fle
94
94
  );
95
95
  });
96
96
  }
97
- const c = S(() => {
97
+ const m = S(() => {
98
98
  const s = i.restaurants.value;
99
99
  if (!s.length) return "Required at least one restaurant to migrate";
100
- const u = s.filter((d) => !d.posVersion || !J.Pos.canUse({ feature: z.F_FEATURE.enum.menuV4, posVersion: d.posVersion }));
101
- return u.length ? `Upgrade POS to V${J.Pos.minVersionToUse(z.F_FEATURE.enum.menuV4)} to use new menu: ${u.map((d) => d.profile.name).join(", ")}` : null;
100
+ const d = s.filter((u) => !u.posVersion || !J.Pos.canUse({ feature: z.F_FEATURE.enum.menuV4, posVersion: u.posVersion }));
101
+ return d.length ? `Upgrade POS to V${J.Pos.minVersionToUse(z.F_FEATURE.enum.menuV4)} to use new menu: ${d.map((u) => u.profile.name).join(", ")}` : null;
102
102
  });
103
- return S(() => c.value ? c.value : "Migrate your menu to new version to enjoy more features. Content of new menu will remain the same as current."), (s, u) => {
104
- const m = G("FmSnackbar");
105
- return !c.value && l(e).version !== l(ie.F_MENU_VERSION).enum.v4 ? (E(), D(m, {
103
+ return S(() => m.value ? m.value : "Migrate your menu to new version to enjoy more features. Content of new menu will remain the same as current."), (s, d) => {
104
+ const c = V("FmSnackbar");
105
+ return !m.value && l(e).version !== l(ie.F_MENU_VERSION).enum.v4 ? (E(), D(c, {
106
106
  key: 0,
107
107
  class: "!max-w-full",
108
108
  title: "New version of menu is out now!",
@@ -117,25 +117,28 @@ const Te = { class: "space-y-24 mb-24" }, Se = ["innerHTML"], De = { class: "fle
117
117
  });
118
118
  class Ge {
119
119
  constructor(e) {
120
- $(this, "menu");
121
- $(this, "categoryMap");
122
- $(this, "takeawayMap");
123
- this.menu = e, this.categoryMap = e.modules.category.reduce((i, a) => (i[a._id] = a, i), {}), this.takeawayMap = e.modules.takeaway.reduce((i, a) => (i[a._id] = a, i), {});
120
+ K(this, "menu");
121
+ K(this, "categoryMap");
122
+ K(this, "takeawayMap");
123
+ K(this, "subCategoryMap");
124
+ this.menu = e, this.categoryMap = e.modules.category.reduce((a, t) => (a[t._id] = t, a), {}), this.takeawayMap = e.modules.takeaway.reduce((a, t) => (a[t._id] = t, a), {});
125
+ const i = e.modules.subCategory || [];
126
+ this.subCategoryMap = i.reduce((a, t) => (a[t._id] = t, a), {});
124
127
  }
125
128
  transformData() {
126
129
  let e = [], i = [];
127
130
  return this.menu.modules.item.forEach((a) => {
128
- var c;
129
- const t = a.variant ? R(this.menu, a.variant.variantGroupIds) : {}, n = this.transformProductToDataRow(a, t), o = (((c = a.variant) == null ? void 0 : c.variantCombinations) ?? []).reduce(
130
- (s, u) => {
131
- const m = this.transformProductToDataRow(
131
+ var m;
132
+ const t = a.variant ? R(this.menu, a.variant.variantGroupIds) : {}, r = this.transformProductToDataRow(a, t), o = (((m = a.variant) == null ? void 0 : m.variantCombinations) ?? []).reduce(
133
+ (s, d) => {
134
+ const c = this.transformProductToDataRow(
132
135
  a,
133
136
  t,
134
- u.combinationKey
137
+ d.combinationKey
135
138
  );
136
- return s.push(m), s;
139
+ return s.push(c), s;
137
140
  },
138
- [n]
141
+ [r]
139
142
  );
140
143
  i = [...i, ...o.flatMap((s) => Object.keys(s.tag))], e = [...e, ...o];
141
144
  }), {
@@ -148,38 +151,38 @@ class Ge {
148
151
  }
149
152
  transformOverrideData(e) {
150
153
  let i = [], a = [], t = [];
151
- const n = e.reduce(
152
- (r, o) => (r[o._id] || (r[o._id] = []), o.combinationKey && r[o._id].push(o.combinationKey), r),
154
+ const r = e.reduce(
155
+ (n, o) => (n[o._id] || (n[o._id] = []), o.combinationKey && n[o._id].push(o.combinationKey), n),
153
156
  {}
154
157
  );
155
- for (let r = 0; r < e.length; r++) {
156
- const o = e[r], c = this.menu.modules.item.find((s) => s._id === o._id);
157
- if (c && c.variant) {
158
- const s = c.variant.variantCombinations.map(
158
+ for (let n = 0; n < e.length; n++) {
159
+ const o = e[n], m = this.menu.modules.item.find((s) => s._id === o._id);
160
+ if (m && m.variant) {
161
+ const s = m.variant.variantCombinations.map(
159
162
  (p) => p.combinationKey
160
- ), u = n[o._id] || [], m = s.filter((p) => !u.includes(p)), d = [];
161
- if (m.forEach((p) => {
162
- const k = c.variant.variantCombinations.find(
163
- (b) => b.combinationKey === p
163
+ ), d = r[o._id] || [], c = s.filter((p) => !d.includes(p)), u = [];
164
+ if (c.forEach((p) => {
165
+ const k = m.variant.variantCombinations.find(
166
+ (g) => g.combinationKey === p
164
167
  );
165
- k && (d.push({
168
+ k && (u.push({
166
169
  _id: o._id,
167
170
  combinationKey: p,
168
171
  price: k.price,
169
172
  orderFrom: k.orderFrom
170
- }), n[o._id].push(p));
171
- }), d.length > 0) {
172
- const p = e.findIndex((b) => b._id === o._id && !b.combinationKey), k = p >= 0 ? p + 1 : r + 1;
173
- e.splice(k, 0, ...d), r += d.length;
173
+ }), r[o._id].push(p));
174
+ }), u.length > 0) {
175
+ const p = e.findIndex((g) => g._id === o._id && !g.combinationKey), k = p >= 0 ? p + 1 : n + 1;
176
+ e.splice(k, 0, ...u), n += u.length;
174
177
  }
175
178
  }
176
179
  }
177
- for (let r = 0; r < e.length; r++) {
178
- const o = e[r], c = this.menu.modules.item.find((d) => d._id === o._id);
179
- if (!c)
180
+ for (let n = 0; n < e.length; n++) {
181
+ const o = e[n], m = this.menu.modules.item.find((u) => u._id === o._id);
182
+ if (!m)
180
183
  throw new Error(`Invalid item ${o._id} in catalog`);
181
- const s = c.variant ? R(this.menu, c.variant.variantGroupIds) : {}, m = [this.transformOverrideDataToRow(o, s)];
182
- t = [...t, ...m.flatMap((d) => Object.keys(d.priceTier))], a = [...a, ...m.flatMap((d) => Object.keys(d.tag))], i = [...i, ...m];
184
+ const s = m.variant ? R(this.menu, m.variant.variantGroupIds) : {}, c = [this.transformOverrideDataToRow(o, s)];
185
+ t = [...t, ...c.flatMap((u) => Object.keys(u.priceTier))], a = [...a, ...c.flatMap((u) => Object.keys(u.tag))], i = [...i, ...c];
183
186
  }
184
187
  return {
185
188
  rows: i,
@@ -189,71 +192,82 @@ class Ge {
189
192
  }
190
193
  };
191
194
  }
195
+ getSubCategoryNames(e, i) {
196
+ return i || !e.subCategories ? "" : e.subCategories.map((a) => {
197
+ var t;
198
+ return ((t = this.subCategoryMap[a]) == null ? void 0 : t.name) || "";
199
+ }).filter((a) => a).join(",");
200
+ }
192
201
  transformProductToDataRow(e, i, a) {
193
- var o, c, s;
194
- const t = (o = e.variant) == null ? void 0 : o.variantCombinations.find(
195
- (u) => u.combinationKey === a
202
+ var m, s, d;
203
+ const t = (m = e.variant) == null ? void 0 : m.variantCombinations.find(
204
+ (c) => c.combinationKey === a
196
205
  );
197
206
  if (a && !t)
198
207
  throw new Error(`Invalid combination key ${a}`);
199
- const n = e.category ? (c = this.categoryMap[e.category]) == null ? void 0 : c.name : P;
200
- let r;
201
- if (t ? r = t.takeawayUsed ? this.takeawayMap[t.takeawayUsed] : void 0 : r = e.takeawayUsed ? this.takeawayMap[e.takeawayUsed] : void 0, !n)
208
+ const r = e.category ? (s = this.categoryMap[e.category]) == null ? void 0 : s.name : P;
209
+ let n;
210
+ if (t ? n = t.takeawayUsed ? this.takeawayMap[t.takeawayUsed] : void 0 : n = e.takeawayUsed ? this.takeawayMap[e.takeawayUsed] : void 0, !r)
202
211
  throw new Error(`Invalid category ${e.category}`);
212
+ const o = this.getSubCategoryNames(e, !!t);
203
213
  return {
204
214
  _id: e._id,
205
215
  code: t && t.code || e.code,
206
216
  name: e.name,
207
217
  variantKey: (t == null ? void 0 : t.combinationKey) ?? "",
208
218
  variantName: t ? i[t.combinationKey] : "",
209
- category: n,
219
+ category: r,
220
+ subCategories: o,
210
221
  orderFrom: t ? t.orderFrom ?? e.orderFrom : e.orderFrom,
211
222
  perXUnit: e.perXUnit || "",
212
223
  unit: e.unit || "",
213
224
  openPrice: e.openPrice === !0 ? "T" : "",
214
- price: t ? t.price ? parseFloat(y(t.price)) : parseFloat(y(e.price)) : parseFloat(y(e.price)),
225
+ price: t ? t.price ? parseFloat(h(t.price)) : parseFloat(h(e.price)) : parseFloat(h(e.price)),
215
226
  priceTier: e.priceTiers || {},
216
- trackingCost: e.costing ? parseFloat(y(e.costing)) : "",
217
- minPrice: e.minPrice ? parseFloat(y(e.minPrice)) : "",
218
- groupByParent: ((s = e.print) == null ? void 0 : s.toRoot) === !0 ? "" : "T",
219
- takeawayName: (r == null ? void 0 : r.name) || "",
220
- takeawayPrice: r != null && r.price ? parseFloat(y(r == null ? void 0 : r.price)) : "",
227
+ trackingCost: e.costing ? parseFloat(h(e.costing)) : "",
228
+ minPrice: e.minPrice ? parseFloat(h(e.minPrice)) : "",
229
+ groupByParent: ((d = e.print) == null ? void 0 : d.toRoot) === !0 ? "" : "T",
230
+ takeawayName: (n == null ? void 0 : n.name) || "",
231
+ takeawayPrice: n != null && n.price ? parseFloat(h(n == null ? void 0 : n.price)) : "",
221
232
  tag: e.customAttributes || {}
222
233
  };
223
234
  }
224
235
  transformOverrideDataToRow(e, i, a) {
225
- var c, s;
226
- const t = this.menu.modules.item.find((u) => u._id === e._id);
236
+ var s, d;
237
+ const t = this.menu.modules.item.find((c) => c._id === e._id);
227
238
  if (!t)
228
239
  throw new Error(`Invalid item ${e._id} in catelog`);
229
- const n = (c = t.variant) == null ? void 0 : c.variantCombinations.find(
230
- (u) => u.combinationKey === e.combinationKey
240
+ const r = (s = t.variant) == null ? void 0 : s.variantCombinations.find(
241
+ (c) => c.combinationKey === e.combinationKey
231
242
  );
232
- if (a && !n)
243
+ if (a && !r)
233
244
  throw new Error(`Invalid combination key ${a}`);
234
- const r = () => {
235
- var u, m;
236
- return e.category ? e.category ? (m = this.categoryMap[e.category]) == null ? void 0 : m.name : P : t.category ? (u = this.categoryMap[t.category]) == null ? void 0 : u.name : P;
245
+ const n = () => {
246
+ var c, u;
247
+ return e.category ? e.category ? (u = this.categoryMap[e.category]) == null ? void 0 : u.name : P : t.category ? (c = this.categoryMap[t.category]) == null ? void 0 : c.name : P;
237
248
  };
238
249
  let o;
239
- return n ? e.takeawayUsed ? o = e.takeawayUsed ? this.takeawayMap[e.takeawayUsed] : void 0 : o = n.takeawayUsed ? this.takeawayMap[n.takeawayUsed] : void 0 : e.takeawayUsed ? o = e.takeawayUsed ? this.takeawayMap[e.takeawayUsed] : void 0 : o = t.takeawayUsed ? this.takeawayMap[t.takeawayUsed] : void 0, {
250
+ r ? e.takeawayUsed ? o = e.takeawayUsed ? this.takeawayMap[e.takeawayUsed] : void 0 : o = r.takeawayUsed ? this.takeawayMap[r.takeawayUsed] : void 0 : e.takeawayUsed ? o = e.takeawayUsed ? this.takeawayMap[e.takeawayUsed] : void 0 : o = t.takeawayUsed ? this.takeawayMap[t.takeawayUsed] : void 0;
251
+ const m = this.getSubCategoryNames(t, !!r);
252
+ return {
240
253
  _id: e._id,
241
- code: e.code ? e.code : n && n.code || t.code,
254
+ code: e.code ? e.code : r && r.code || t.code,
242
255
  name: t.name,
243
- variantKey: e.combinationKey ? e.combinationKey : (n == null ? void 0 : n.combinationKey) ?? "",
244
- variantName: n ? i[n.combinationKey] : "",
245
- category: r(),
246
- orderFrom: e.orderFrom ? e.orderFrom : n ? n.orderFrom ?? t.orderFrom : t.orderFrom,
256
+ variantKey: e.combinationKey ? e.combinationKey : (r == null ? void 0 : r.combinationKey) ?? "",
257
+ variantName: r ? i[r.combinationKey] : "",
258
+ category: n(),
259
+ subCategories: m,
260
+ orderFrom: e.orderFrom ? e.orderFrom : r ? r.orderFrom ?? t.orderFrom : t.orderFrom,
247
261
  perXUnit: t.perXUnit || "",
248
262
  unit: t.unit || "",
249
263
  openPrice: t.openPrice === !0 ? "T" : "",
250
- price: e.price ? parseFloat(y(e.price)) : n ? n.price ? parseFloat(y(n.price)) : parseFloat(y(t.price)) : parseFloat(y(t.price)),
264
+ price: e.price ? parseFloat(h(e.price)) : r ? r.price ? parseFloat(h(r.price)) : parseFloat(h(t.price)) : parseFloat(h(t.price)),
251
265
  priceTier: t.priceTiers || {},
252
- trackingCost: t.costing ? parseFloat(y(t.costing)) : "",
253
- minPrice: e.minPrice ? parseFloat(y(e.minPrice)) : t.minPrice ? parseFloat(y(t.minPrice)) : "",
254
- groupByParent: ((s = t.print) == null ? void 0 : s.toRoot) === !0 ? "" : "T",
266
+ trackingCost: t.costing ? parseFloat(h(t.costing)) : "",
267
+ minPrice: e.minPrice ? parseFloat(h(e.minPrice)) : t.minPrice ? parseFloat(h(t.minPrice)) : "",
268
+ groupByParent: ((d = t.print) == null ? void 0 : d.toRoot) === !0 ? "" : "T",
255
269
  takeawayName: (o == null ? void 0 : o.name) || "",
256
- takeawayPrice: o != null && o.price ? parseFloat(y(o == null ? void 0 : o.price)) : "",
270
+ takeawayPrice: o != null && o.price ? parseFloat(h(o == null ? void 0 : o.price)) : "",
257
271
  tag: t.customAttributes || {}
258
272
  };
259
273
  }
@@ -267,49 +281,49 @@ class Ge {
267
281
  const i = this.menu.modules.group.map((t) => t._id), a = e.map((t) => t._id);
268
282
  return i.forEach((t) => {
269
283
  if (!a.includes(t)) {
270
- const n = this.menu.modules.group.find((r) => r._id === t);
284
+ const r = this.menu.modules.group.find((n) => n._id === t);
271
285
  e.push({
272
- ...n,
286
+ ...r,
273
287
  groupKey: ""
274
288
  });
275
289
  }
276
- }), e.sort((t, n) => i.indexOf(t._id) - i.indexOf(n._id)), e.flatMap((t) => {
277
- const n = this.menu.modules.group.find((o) => o._id === t._id);
278
- if (!n)
290
+ }), e.sort((t, r) => i.indexOf(t._id) - i.indexOf(r._id)), e.flatMap((t) => {
291
+ const r = this.menu.modules.group.find((o) => o._id === t._id);
292
+ if (!r)
279
293
  throw new Error("Invalid addon group id");
280
- const r = {};
281
- return n.items.map((o, c) => {
282
- var b, w, F;
283
- const s = this.menu.modules.item.find((g) => g._id === o._id);
294
+ const n = {};
295
+ return r.items.map((o, m) => {
296
+ var g, w, C;
297
+ const s = this.menu.modules.item.find((y) => y._id === o._id);
284
298
  if (!s)
285
299
  throw new Error("Invalid item id");
286
- let u;
287
- o.combinationKey && (u = (b = s.variant) == null ? void 0 : b.variantCombinations.find(
288
- (g) => g.combinationKey === o.combinationKey
300
+ let d;
301
+ o.combinationKey && (d = (g = s.variant) == null ? void 0 : g.variantCombinations.find(
302
+ (y) => y.combinationKey === o.combinationKey
289
303
  ));
290
- const m = (w = t.items) == null ? void 0 : w.find(
291
- (g) => g._id === o._id && g.combinationKey === o.combinationKey
292
- ), d = s.name, p = R(
304
+ const c = (w = t.items) == null ? void 0 : w.find(
305
+ (y) => y._id === o._id && y.combinationKey === o.combinationKey
306
+ ), u = s.name, p = R(
293
307
  this.menu,
294
- ((F = s.variant) == null ? void 0 : F.variantGroupIds) ?? []
295
- ), k = (m == null ? void 0 : m.price) ?? o.price ?? (u == null ? void 0 : u.price) ?? s.price;
296
- return o.name && !o.combinationKey && (r[o._id] = o.name), {
308
+ ((C = s.variant) == null ? void 0 : C.variantGroupIds) ?? []
309
+ ), k = (c == null ? void 0 : c.price) ?? o.price ?? (d == null ? void 0 : d.price) ?? s.price;
310
+ return o.name && !o.combinationKey && (n[o._id] = o.name), {
297
311
  id: t._id,
298
- name: n.name,
299
- min: n.min,
300
- max: n.max,
301
- stackable: n.stackable === !0 ? "T" : "",
312
+ name: r.name,
313
+ min: r.min,
314
+ max: r.max,
315
+ stackable: r.stackable === !0 ? "T" : "",
302
316
  itemId: o._id,
303
317
  itemCode: s.code || "",
304
- itemName: d,
305
- itemNameOverrider: r[o._id] || "",
318
+ itemName: u,
319
+ itemNameOverrider: n[o._id] || "",
306
320
  combinationKey: o.combinationKey ?? "",
307
321
  combinationName: o.combinationKey ? p[o.combinationKey] : "",
308
- price: parseFloat(y(k)),
322
+ price: parseFloat(h(k)),
309
323
  priceTier: o.priceTiers || {},
310
- orderFrom: (m == null ? void 0 : m.orderFrom) ?? o.orderFrom ?? s.orderFrom ?? "ALL",
324
+ orderFrom: (c == null ? void 0 : c.orderFrom) ?? o.orderFrom ?? s.orderFrom ?? "ALL",
311
325
  isDefault: o.isDefault === !0 ? "T" : "",
312
- index: c
326
+ index: m
313
327
  };
314
328
  });
315
329
  });
@@ -317,18 +331,18 @@ class Ge {
317
331
  mapAddonGroup(e) {
318
332
  return e.flatMap((i) => {
319
333
  let a = {};
320
- return a = i.items.reduce((t, n) => (t[n._id] || n.name && !n.combinationKey && (t[n._id] = n.name), t), {}), i.items.map((t, n) => {
321
- var u, m;
322
- const r = this.menu.modules.item.find((d) => d._id === t._id);
323
- if (!r)
334
+ return a = i.items.reduce((t, r) => (t[r._id] || r.name && !r.combinationKey && (t[r._id] = r.name), t), {}), i.items.map((t, r) => {
335
+ var d, c;
336
+ const n = this.menu.modules.item.find((u) => u._id === t._id);
337
+ if (!n)
324
338
  throw new Error("Invalid item id");
325
339
  let o;
326
- t.combinationKey && (o = (u = r.variant) == null ? void 0 : u.variantCombinations.find(
327
- (d) => d.combinationKey === t.combinationKey
340
+ t.combinationKey && (o = (d = n.variant) == null ? void 0 : d.variantCombinations.find(
341
+ (u) => u.combinationKey === t.combinationKey
328
342
  ));
329
- const c = t.price ?? (o == null ? void 0 : o.price) ?? r.price, s = R(
343
+ const m = t.price ?? (o == null ? void 0 : o.price) ?? n.price, s = R(
330
344
  this.menu,
331
- ((m = r.variant) == null ? void 0 : m.variantGroupIds) ?? []
345
+ ((c = n.variant) == null ? void 0 : c.variantGroupIds) ?? []
332
346
  );
333
347
  return {
334
348
  id: i._id,
@@ -337,16 +351,16 @@ class Ge {
337
351
  max: i.max,
338
352
  stackable: i.stackable === !0 ? "T" : "",
339
353
  itemId: t._id,
340
- itemCode: r.code || "",
341
- itemName: r.name,
354
+ itemCode: n.code || "",
355
+ itemName: n.name,
342
356
  itemNameOverrider: a[t._id] || "",
343
357
  combinationKey: t.combinationKey ?? "",
344
358
  combinationName: t.combinationKey ? s[t.combinationKey] : "",
345
- price: parseFloat(y(c)),
359
+ price: parseFloat(h(m)),
346
360
  priceTier: t.priceTiers || {},
347
- orderFrom: t.orderFrom ?? r.orderFrom,
361
+ orderFrom: t.orderFrom ?? n.orderFrom,
348
362
  isDefault: t.isDefault === !0 ? "T" : "",
349
- index: n
363
+ index: r
350
364
  };
351
365
  });
352
366
  });
@@ -371,52 +385,52 @@ class Ge {
371
385
  exportToExcel() {
372
386
  var k;
373
387
  const e = [], { rows: i, metaData: a } = this.transformData();
374
- a.priceTiers = ((k = this.menu.priceTierSettings) == null ? void 0 : k.map((b) => b.key)) || [];
375
- const t = i.map(({ priceTier: b, tag: w, ...F }) => {
376
- const g = Object.entries(F), C = g.findIndex(([h]) => h === "price");
388
+ a.priceTiers = ((k = this.menu.priceTierSettings) == null ? void 0 : k.map((g) => g.key)) || [];
389
+ const t = i.map(({ priceTier: g, tag: w, ...C }) => {
390
+ const y = Object.entries(C), F = y.findIndex(([b]) => b === "price");
377
391
  return [
378
- ...g.slice(0, C + 1).map(([, h]) => h),
392
+ ...y.slice(0, F + 1).map(([, b]) => b),
379
393
  ...a.priceTiers.map(
380
- (h) => parseFloat(y(b[h])) || ""
394
+ (b) => parseFloat(h(g[b])) || ""
381
395
  ),
382
- ...g.slice(C + 1).map(([, h]) => h),
383
- ...a.tags.map((h) => w[h] || "")
396
+ ...y.slice(F + 1).map(([, b]) => b),
397
+ ...a.tags.map((b) => w[b] || "")
384
398
  ];
385
- }), n = this.createWorkbookExcelJS(
399
+ }), r = this.createWorkbookExcelJS(
386
400
  t,
387
401
  "Default Catalog",
388
402
  this.exportCatalogToExcelExcelJS()
389
- ), r = n.worksheets[0];
390
- H(r, a.tags, a.priceTiers), this.formatWorkbookCell(n);
391
- const c = this.transformAddonGroup().map(({ priceTier: b, ...w }) => {
392
- const { index: F, ...g } = w, C = Object.entries(g), h = C.findIndex(([f]) => f === "price");
403
+ ), n = r.worksheets[0];
404
+ H(n, a.tags, a.priceTiers), this.formatWorkbookCell(r);
405
+ const m = this.transformAddonGroup().map(({ priceTier: g, ...w }) => {
406
+ const { index: C, ...y } = w, F = Object.entries(y), b = F.findIndex(([f]) => f === "price");
393
407
  return [
394
- ...C.slice(0, h + 1).map(([, f]) => f),
408
+ ...F.slice(0, b + 1).map(([, f]) => f),
395
409
  ...a.priceTiers.map(
396
- (f) => parseFloat(y(b[f])) || ""
410
+ (f) => parseFloat(h(g[f])) || ""
397
411
  ),
398
- ...C.slice(h + 1).map(([, f]) => f)
412
+ ...F.slice(b + 1).map(([, f]) => f)
399
413
  ];
400
414
  }), s = this.createWorkbookExcelJS(
401
- c,
415
+ m,
402
416
  "Default AddonGroup",
403
417
  this.exportCatalogAddonToExcelExcelJS()
404
- ), u = s.worksheets[0];
405
- L(u, a.priceTiers), this.formatWorkbookCell(s);
406
- const m = this.transformItemsLinkWithGroup(), d = Object.keys(m), p = new A.Workbook();
407
- if (d.length > 0)
408
- d.forEach((b, w) => {
409
- const F = Object.values(m[b]), g = this.menu.modules.group.find((f) => f._id === b);
410
- if (!g) throw new Error(`Group not found for id: ${b}`);
411
- const C = O(`${w + 1}. ${g.name}`), h = p.addWorksheet(C);
412
- h.columns = [
418
+ ), d = s.worksheets[0];
419
+ L(d, a.priceTiers), this.formatWorkbookCell(s);
420
+ const c = this.transformItemsLinkWithGroup(), u = Object.keys(c), p = new A.Workbook();
421
+ if (u.length > 0)
422
+ u.forEach((g, w) => {
423
+ const C = Object.values(c[g]), y = this.menu.modules.group.find((f) => f._id === g);
424
+ if (!y) throw new Error(`Group not found for id: ${g}`);
425
+ const F = O(`${w + 1}. ${y.name}`), b = p.addWorksheet(F);
426
+ b.columns = [
413
427
  { header: "Group ID", key: "groupId" },
414
428
  { header: "Item ID", key: "itemId" },
415
429
  { header: "Item Name", key: "itemName" },
416
430
  { header: "Default Catalog", key: "defaultCatalog" }
417
- ], F.forEach((f) => {
418
- h.addRow({
419
- groupId: b,
431
+ ], C.forEach((f) => {
432
+ b.addRow({
433
+ groupId: g,
420
434
  itemId: f.itemId,
421
435
  itemName: f.itemName,
422
436
  defaultCatalog: f.defaultCatalog
@@ -424,24 +438,24 @@ class Ge {
424
438
  });
425
439
  });
426
440
  else {
427
- const b = p.addWorksheet("Group Name");
428
- b.columns = [
441
+ const g = p.addWorksheet("Group Name");
442
+ g.columns = [
429
443
  { header: "Group ID", key: "groupId" },
430
444
  { header: "Item ID", key: "itemId" },
431
445
  { header: "Item Name", key: "itemName" },
432
446
  { header: "Default Catalog", key: "defaultCatalog" }
433
447
  ];
434
448
  }
435
- return this.formatWorkbookCell(p), e.push(n, s, p), e;
449
+ return this.formatWorkbookCell(p), e.push(r, s, p), e;
436
450
  }
437
451
  createWorkbookExcelJS(e, i, a) {
438
- const t = new A.Workbook(), n = t.addWorksheet(i);
439
- return e.forEach((r) => {
440
- n.addRow(r);
441
- }), a && a.worksheets.forEach((r) => {
442
- const o = t.addWorksheet(r.name);
443
- r.eachRow({ includeEmpty: !0 }, (c) => {
444
- const s = c.values;
452
+ const t = new A.Workbook(), r = t.addWorksheet(i);
453
+ return e.forEach((n) => {
454
+ r.addRow(n);
455
+ }), a && a.worksheets.forEach((n) => {
456
+ const o = t.addWorksheet(n.name);
457
+ n.eachRow({ includeEmpty: !0 }, (m) => {
458
+ const s = m.values;
445
459
  o.addRow(s.slice(1));
446
460
  });
447
461
  }), t;
@@ -449,15 +463,15 @@ class Ge {
449
463
  formatWorkbookCell(e) {
450
464
  e.eachSheet((i) => {
451
465
  i.eachRow({ includeEmpty: !0 }, (t) => {
452
- t.eachCell({ includeEmpty: !0 }, (n) => {
453
- n.font = {
466
+ t.eachCell({ includeEmpty: !0 }, (r) => {
467
+ r.font = {
454
468
  name: "Calibri",
455
469
  size: 12
456
- }, t.number === 1 && (n.fill = {
470
+ }, t.number === 1 && (r.fill = {
457
471
  type: "pattern",
458
472
  pattern: "solid",
459
473
  fgColor: { argb: "FABF8F" }
460
- }, n.alignment = { horizontal: "center", vertical: "middle" });
474
+ }, r.alignment = { horizontal: "center", vertical: "middle" });
461
475
  });
462
476
  });
463
477
  const a = i.getRow(1);
@@ -476,63 +490,63 @@ class Ge {
476
490
  exportCatalogToExcelExcelJS() {
477
491
  const e = new A.Workbook();
478
492
  return this.menu.modules.catalog.forEach((i) => {
479
- const a = Object.values(i.override.items).flatMap((s) => s), { rows: t, metaData: n } = this.transformOverrideData(a), r = t.map(({ priceTier: s, tag: u, ...m }) => [
480
- ...Object.entries(m).map(([, p]) => p),
481
- ...n.tags.map((p) => u[p] || "")
482
- ]), o = O(i.name), c = e.addWorksheet(o);
483
- r.forEach((s) => {
484
- c.addRow(s);
485
- }), H(c, n.tags, n.priceTiers, i);
493
+ const a = Object.values(i.override.items).flatMap((s) => s), { rows: t, metaData: r } = this.transformOverrideData(a), n = t.map(({ priceTier: s, tag: d, ...c }) => [
494
+ ...Object.entries(c).map(([, p]) => p),
495
+ ...r.tags.map((p) => d[p] || "")
496
+ ]), o = O(i.name), m = e.addWorksheet(o);
497
+ n.forEach((s) => {
498
+ m.addRow(s);
499
+ }), H(m, r.tags, r.priceTiers, i);
486
500
  }), e;
487
501
  }
488
502
  exportCatalogAddonToExcelExcelJS() {
489
503
  const e = new A.Workbook();
490
504
  return this.menu.modules.catalog.forEach((i) => {
491
505
  const a = Object.values(i.override.groups).flatMap(
492
- (c) => c
493
- ), n = this.transformOverrideAddonGroup(a).map(({ priceTier: c, ...s }) => {
494
- const { index: u, ...m } = s;
495
- return [...Object.entries(m).map(([, p]) => p)];
496
- }), r = O(i.name), o = e.addWorksheet(r);
497
- n.forEach((c) => {
498
- o.addRow(c);
506
+ (m) => m
507
+ ), r = this.transformOverrideAddonGroup(a).map(({ priceTier: m, ...s }) => {
508
+ const { index: d, ...c } = s;
509
+ return [...Object.entries(c).map(([, p]) => p)];
510
+ }), n = O(i.name), o = e.addWorksheet(n);
511
+ r.forEach((m) => {
512
+ o.addRow(m);
499
513
  }), L(o);
500
514
  }), e;
501
515
  }
502
516
  }
503
- const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "flex items-center" }, Re = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ae = { class: "fm-typo-en-body-md-600 font-semibold" }, Pe = { class: "flex gap-8" }, nt = /* @__PURE__ */ W({
517
+ const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "flex items-center" }, Re = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ae = { class: "fm-typo-en-body-md-600 font-semibold" }, Pe = { class: "flex gap-8" }, rt = /* @__PURE__ */ W({
504
518
  __name: "Products",
505
519
  setup(x) {
506
- const { t: e } = ye(), i = re(ce()), a = ne(), t = S(() => a.rules.item), n = Fe(), r = S(() => !a.state.currentSchedulerId), { selectedCategories: o } = we(), c = S(() => ({
507
- ...he.menuV4ToV3(q(a.state.menu)),
520
+ const { t: e } = he(), i = ne(ce()), a = re(), t = S(() => a.rules.item), r = Ce(), n = S(() => !a.state.currentSchedulerId), { selectedCategories: o } = we(), m = S(() => ({
521
+ ...be.menuV4ToV3(q(a.state.menu)),
508
522
  _id: a.state.menu._id,
509
523
  _rev: a.state.menu._rev
510
524
  })), s = S(() => {
511
- const h = X.flatten(o.value.map((f) => f.items));
512
- return X.uniqBy(h, (f) => f._id).length;
525
+ const b = X.flatten(o.value.map((f) => f.items));
526
+ return X.uniqBy(b, (f) => f._id).length;
513
527
  });
514
- async function u(h, f) {
528
+ async function d(b, f) {
515
529
  const T = new pe();
516
- for (let V = 0; V < h.length; V++) {
517
- const me = await h[V].xlsx.writeBuffer();
518
- T.file(`${f[V]}.xlsx`, me);
530
+ for (let $ = 0; $ < b.length; $++) {
531
+ const me = await b[$].xlsx.writeBuffer();
532
+ T.file(`${f[$]}.xlsx`, me);
519
533
  }
520
534
  const v = await T.generateAsync({ type: "blob" });
521
- fe.saveAs(v, `books_${K().format("DD-MM-YYYY_HH-mm")}.zip`);
535
+ fe.saveAs(v, `books_${G().format("DD-MM-YYYY_HH-mm")}.zip`);
522
536
  }
523
- async function m() {
537
+ async function c() {
524
538
  await i.minor(
525
539
  async () => {
526
540
  if (await a.readMenu(), a.version === ie.F_MENU_VERSION.enum.v4) {
527
- const h = q(a.state.menu), f = new Ge(h).exportToExcel(), T = [
528
- `menu_${K().format("DD-MM-YYYY_HH-mm")}`,
529
- `addonGroup_${K().format("DD-MM-YYYY_HH-mm")}`,
530
- `itemLinkedAddon${K().format("DD-MM-YYYY_HH-mm")}`
541
+ const b = q(a.state.menu), f = new Ge(b).exportToExcel(), T = [
542
+ `menu_${G().format("DD-MM-YYYY_HH-mm")}`,
543
+ `addonGroup_${G().format("DD-MM-YYYY_HH-mm")}`,
544
+ `itemLinkedAddon${G().format("DD-MM-YYYY_HH-mm")}`
531
545
  ];
532
- u(f, T);
546
+ d(f, T);
533
547
  } else {
534
- const h = Ee(c.value), f = `menu_${K().format("DD-MM-YYYY_HH-mm")}`;
535
- await de(h, `${f}.xlsx`, {
548
+ const b = Ee(m.value), f = `menu_${G().format("DD-MM-YYYY_HH-mm")}`;
549
+ await de(b, `${f}.xlsx`, {
536
550
  bookType: "xlsx",
537
551
  bookSST: !1,
538
552
  type: "array"
@@ -543,21 +557,21 @@ const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "f
543
557
  );
544
558
  }
545
559
  const {
546
- menuItems: d,
560
+ menuItems: u,
547
561
  categories: p,
548
562
  linkItemRules: k,
549
- handleSubmit: b,
563
+ handleSubmit: g,
550
564
  catalogManager: w,
551
- schedulerManager: F
552
- } = Ie(!1), g = _e(), C = S(() => g.breakpoints.value.xs);
553
- return xe().resetOnMount(), (h, f) => {
554
- const T = G("fm-button");
565
+ schedulerManager: C
566
+ } = Ie(!1), y = _e(), F = S(() => y.breakpoints.value.xs);
567
+ return xe().resetOnMount(), (b, f) => {
568
+ const T = V("fm-button");
555
569
  return E(), D(ve, {
556
570
  heading: l(e)("menu.products.title")
557
571
  }, {
558
572
  default: I(() => [
559
573
  _(Ke),
560
- _(Ce)
574
+ _(Fe)
561
575
  ]),
562
576
  "append-heading": I(() => [
563
577
  M("div", Ve, [
@@ -567,13 +581,13 @@ const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "f
567
581
  ])
568
582
  ]),
569
583
  M("div", Pe, [
570
- C.value ? (E(), D(Q, { key: 1 }, {
584
+ F.value ? (E(), D(Q, { key: 1 }, {
571
585
  default: I(({ trigger: v }) => [
572
586
  _(ke, null, {
573
587
  default: I(() => [
574
588
  _(Z, {
575
589
  label: l(e)("menu.products.actions.export"),
576
- onClick: m
590
+ onClick: c
577
591
  }, null, 8, ["label"]),
578
592
  _(Z, {
579
593
  label: l(e)("menu.products.actions.import"),
@@ -602,7 +616,7 @@ const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "f
602
616
  "text-color": l(N).TypoSecondary,
603
617
  variant: l(U).Primary,
604
618
  label: l(e)("menu.products.actions.export"),
605
- onClick: m
619
+ onClick: c
606
620
  }, null, 8, ["bg-color", "text-color", "variant", "label"]),
607
621
  _(Q, null, {
608
622
  default: I(({ trigger: v }) => [
@@ -622,17 +636,17 @@ const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "f
622
636
  key: 0,
623
637
  label: l(e)("menu.products.actions.add"),
624
638
  "prepend-icon": "add",
625
- onClick: f[0] || (f[0] = (v) => l(n).create(null))
626
- }, null, 8, ["label"])) : r.value ? (E(), D(ee, {
639
+ onClick: f[0] || (f[0] = (v) => l(r).create(null))
640
+ }, null, 8, ["label"])) : n.value ? (E(), D(ee, {
627
641
  key: 1,
628
642
  "categorized-items": l(w).linkableItems.value,
629
643
  "initial-value": l(w).currentItems.value,
630
644
  "show-variant": !1,
631
- "menu-items": l(d),
645
+ "menu-items": l(u),
632
646
  categories: l(p),
633
647
  "link-item-rules": l(k),
634
- "no-scheduler": r.value,
635
- onSubmit: l(b)
648
+ "no-scheduler": n.value,
649
+ onSubmit: l(g)
636
650
  }, {
637
651
  default: I(({ trigger: v }) => [
638
652
  _(Y, {
@@ -644,14 +658,14 @@ const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "f
644
658
  _: 1
645
659
  }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : (E(), D(ee, {
646
660
  key: 2,
647
- "categorized-items": l(F).linkableItems.value,
648
- "initial-value": l(F).currentItems.value,
661
+ "categorized-items": l(C).linkableItems.value,
662
+ "initial-value": l(C).currentItems.value,
649
663
  "show-variant": !1,
650
- "menu-items": l(d),
664
+ "menu-items": l(u),
651
665
  categories: l(p),
652
666
  "link-item-rules": l(k),
653
- "no-scheduler": r.value,
654
- onSubmit: l(b)
667
+ "no-scheduler": n.value,
668
+ onSubmit: l(g)
655
669
  }, {
656
670
  default: I(({ trigger: v }) => [
657
671
  _(Y, {
@@ -671,5 +685,5 @@ const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "f
671
685
  }
672
686
  });
673
687
  export {
674
- nt as default
688
+ rt as default
675
689
  };