@feedmepos/mf-menu 0.31.40-prod → 0.31.41-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 (90) hide show
  1. package/dist/{App-aWEH-ZEk.js → App-5Lzy8zHZ.js} +8 -8
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-jJyinQZl.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BnKXsQH-.js} +3 -3
  3. package/dist/{Catalog-BoFfFdn8.js → Catalog-s5b8V8nw.js} +8 -9
  4. package/dist/{Category-CWYbb3Jn.js → Category-BJzScJEY.js} +4 -4
  5. package/dist/{Category-DZ45uikR.js → Category-DZ-xqIMI.js} +6 -6
  6. package/dist/{CookingGuide-BU0PRWIQ.js → CookingGuide-Bkd6GPww.js} +4 -4
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Z5xsKDIE.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-B8tIjKOW.js} +1 -1
  8. package/dist/{Group-BMQDeqiS.js → Group-0b2Qiov3.js} +1 -1
  9. package/dist/{Group-C0T_uknK.js → Group-BOaCcKiI.js} +3 -3
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-DyfmY6F1.js → Group.vue_vue_type_script_setup_true_lang-DUlUfMAs.js} +8 -8
  11. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CouimeC4.js +399 -0
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Dl-Wvt3D.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DOvQmbrZ.js} +13 -14
  13. package/dist/{Ingredient-3lwDUQx_.js → Ingredient-ChcYUvOg.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-VLrrTkSC.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DE1HkipX.js} +2 -2
  15. package/dist/LinkProductSideSheet-BdzBGYxG.js +361 -0
  16. package/dist/MenuSetting-zAAttaoA.js +618 -0
  17. package/dist/{PrintRoute-DfJ-vUAb.js → PrintRoute-T-vuO5N8.js} +4 -4
  18. package/dist/{Product-F4PoLm9v.js → Product-B5q291VF.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-DT5gffpA.js → Product.vue_vue_type_script_setup_true_lang-DLRlT10W.js} +468 -465
  20. package/dist/{ProductInternalTools-DSGU-OqU.js → ProductInternalTools-BOlc0VUR.js} +5 -5
  21. package/dist/{Products-COzW2Z4g.js → Products-Cd4Mqhm3.js} +88 -85
  22. package/dist/{Publish-CDXVWCk2.js → Publish-SuRzt-_D.js} +3 -3
  23. package/dist/{Recipe-BZx4wrcP.js → Recipe-BKrjNs5g.js} +4 -4
  24. package/dist/{Scheduler-wHCWSeU2.js → Scheduler-DnDgImLC.js} +3 -3
  25. package/dist/{ServingSequence-BbYEhDYh.js → ServingSequence-D602bVnm.js} +3 -3
  26. package/dist/{Setting-C9Tlw1Iy.js → Setting-FMT4oBYH.js} +44 -45
  27. package/dist/{Subcategory-C8AwfrKb.js → Subcategory-CpYmjAvA.js} +4 -4
  28. package/dist/{Takeaway-t1053wg2.js → Takeaway-BXh3iuME.js} +1 -1
  29. package/dist/{Takeaway-DaEUn-yM.js → Takeaway-D4hjN5z5.js} +4 -4
  30. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-7XycP5fU.js → Takeaway.vue_vue_type_script_setup_true_lang-By1f-FCO.js} +5 -5
  31. package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-CZUwa5C_.js +440 -0
  32. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Ci6iqOry.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DfjtfcCh.js} +604 -600
  33. package/dist/{Unit-CnqptGCz.js → Unit-CsjHkV-h.js} +2 -2
  34. package/dist/{Variant-DiOYOwJs.js → Variant-Djra14ZX.js} +3 -3
  35. package/dist/{_id_-BSfU16VO.js → _id_-BXkqoCzB.js} +78 -75
  36. package/dist/{app-Ddb81PNo.js → app-CVqWWV4x.js} +278 -278
  37. package/dist/{LinkProductSideSheet.vue_vue_type_style_index_0_scoped_97fa9d58_lang-DvG3mOom.js → app-CiBqmBzO.js} +2120 -2084
  38. package/dist/{app-Cou6qPF2.js → app-PhBJNss_.js} +1 -1
  39. package/dist/app.js +1 -1
  40. package/dist/apps/mf-menu/src/api/menu.d.ts +2 -1
  41. package/dist/apps/mf-menu/src/app.d.ts +144 -0
  42. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierRuleEditor.vue.d.ts +36 -0
  43. package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesSelector.vue.d.ts +9 -3
  44. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +294 -4
  45. package/dist/apps/mf-menu/src/composable/attributes.d.ts +26 -0
  46. package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +40 -0
  47. package/dist/apps/mf-menu/src/helper/import-export.d.ts +285 -0
  48. package/dist/apps/mf-menu/src/helper/menu.d.ts +285 -0
  49. package/dist/apps/mf-menu/src/manager/menu/item.d.ts +285 -0
  50. package/dist/apps/mf-menu/src/stores/menu.d.ts +293 -3
  51. package/dist/apps/mf-menu/src/utils/array.d.ts +1 -0
  52. package/dist/apps/mf-menu/src/utils/customAttributes.d.ts +12 -0
  53. package/dist/apps/mf-menu/src/views/MenuSetting/LinkProductRuleGroups.vue.d.ts +2 -0
  54. package/dist/apps/mf-menu/src/views/MenuSetting/RuleGroupSideSheet.vue.d.ts +176 -0
  55. package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +166 -0
  56. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  57. package/dist/assets/linked-status-WlVAcpRn.js +13 -0
  58. package/dist/assets/override-menu-__h4D7ac.js +13 -0
  59. package/dist/assets/validate-menu-DyPuzLRg.js +13 -0
  60. package/dist/{catalog-DSuJhsUb.js → catalog-C_TuQLxq.js} +1 -1
  61. package/dist/{catalogSetting-C3gEw9ov.js → catalogSetting-BUlJu6hG.js} +1 -1
  62. package/dist/{category-CwWq3KCE.js → category-CmVw1Kj-.js} +1 -1
  63. package/dist/{currency-g45Sh-t6.js → currency-OhOTnAqk.js} +1 -1
  64. package/dist/customAttributes-fpOfmGnw.js +180 -0
  65. package/dist/{dayjs.min-g3eN5z-V.js → dayjs.min-CDhP-7L5.js} +1 -1
  66. package/dist/{index-QsLFbxyG.js → index-BJZEWB5C.js} +4 -4
  67. package/dist/{index-BLQCYEc6.js → index-DHAYGEPp.js} +7 -8
  68. package/dist/{index-0yRUi7LL.js → index-DtwHmS38.js} +1 -1
  69. package/dist/index-N3cGc8ex.js +245 -0
  70. package/dist/{item-BvvQ9urP.js → item-BELLphR0.js} +16 -16
  71. package/dist/{jszip.min-DzdUiaR4.js → jszip.min-CZtcGb7A.js} +353 -353
  72. package/dist/{menu-QrVg2Ph7.js → menu-Csyr6W9A.js} +7 -7
  73. package/dist/{menu-DFNvhoNQ.js → menu-DS_ERmBf.js} +23355 -23206
  74. package/dist/{menuV2-Ezf_jW40.js → menuV2-DKzAZ4Ss.js} +151 -146
  75. package/dist/mf-menu.css +1 -1
  76. package/dist/{priceTier-zENsn3P_.js → priceTier-CYWS5lDS.js} +1 -1
  77. package/dist/{scheduler-BuwGSv6A.js → scheduler-DI5dXC7Y.js} +8 -8
  78. package/dist/{subcategory-O3L_zCJA.js → subcategory-D_ao-IV9.js} +2 -2
  79. package/dist/{toExcel-CpRy_4nG.js → toExcel-Cml-rkJQ.js} +2 -2
  80. package/dist/{unit-Ct_7Hfa2.js → unit-BWDp2LkV.js} +42 -41
  81. package/package.json +3 -3
  82. package/dist/FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js +0 -50
  83. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D6qro5w_.js +0 -367
  84. package/dist/LinkProductSideSheet-LDZjKX95.js +0 -297
  85. package/dist/MenuSetting-AhutsCVy.js +0 -185
  86. package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-B7oLH9cP.js +0 -431
  87. package/dist/assets/linked-status-B_crHhZH.js +0 -24
  88. package/dist/assets/override-menu-BmlCEpHH.js +0 -24
  89. package/dist/assets/validate-menu-CF-psoB-.js +0 -24
  90. package/dist/index-0Q5T9VZV.js +0 -214
@@ -2,17 +2,17 @@ import { defineComponent as L, ref as w, watch as W, resolveComponent as y, crea
2
2
  import { useI18n as T } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as B, components as j, useDialog as Y, FmButtonVariant as z, useBreakpoints as ae, FmButtonColorThemeVariant as oe } from "@feedmepos/ui-library";
4
4
  import { _ as ne } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
- import { G as D, u as N, O as A, J as K, A as G } from "./menu-DFNvhoNQ.js";
5
+ import { G as D, u as N, O as A, J as K, A as G } from "./menu-DS_ERmBf.js";
6
6
  import { _ as le } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
7
- import { _ as se } from "./app-Ddb81PNo.js";
7
+ import { _ as se } from "./app-CVqWWV4x.js";
8
8
  import { c as re } from "./createForm-BoUQeZTd.js";
9
9
  import { u as ie } from "./discardConfirm-BHni0LNu.js";
10
10
  import { c as I } from "./object-DVUNCr7w.js";
11
11
  import { r as ce } from "./rules-CIWTZQfh.js";
12
12
  import { c as ue } from "./check-C9mY6LiX.js";
13
- import { u as q } from "./subcategory-O3L_zCJA.js";
13
+ import { u as q } from "./subcategory-D_ao-IV9.js";
14
14
  import { _ as de } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
15
- import { a as me } from "./menu-QrVg2Ph7.js";
15
+ import { a as me } from "./menu-Csyr6W9A.js";
16
16
  const pe = {
17
17
  class: "fm-typo-en-title-md-600"
18
18
  }, _e = {
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./Takeaway.vue_vue_type_script_setup_true_lang-7XycP5fU.js";
1
+ import { _ as f } from "./Takeaway.vue_vue_type_script_setup_true_lang-By1f-FCO.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as f, computed as y, ref as k, createBlock as i, openBlock as d, unref as a, withCtx as s, createElementVNode as t, toDisplayString as b, createCommentVNode as g, createVNode as m } from "vue";
2
- import { G as x, u as v, O as w, J as E, A as M } from "./menu-DFNvhoNQ.js";
2
+ import { G as x, u as v, O as w, J as E, A as M } from "./menu-DS_ERmBf.js";
3
3
  import { useI18n as T } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as V } from "@feedmepos/ui-library";
5
5
  import { _ as h } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
6
6
  import { _ as C } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
7
- import { _ as N } from "./Takeaway.vue_vue_type_script_setup_true_lang-7XycP5fU.js";
8
- import { T as O, l as S } from "./index-QsLFbxyG.js";
9
- import { a as L } from "./menu-QrVg2Ph7.js";
7
+ import { _ as N } from "./Takeaway.vue_vue_type_script_setup_true_lang-By1f-FCO.js";
8
+ import { T as O, l as S } from "./index-BJZEWB5C.js";
9
+ import { a as L } from "./menu-Csyr6W9A.js";
10
10
  const U = { class: "flex-1 flex justify-between gap-8 pl-8" }, B = { class: "flex items-center" }, F = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, A = { class: "fm-typo-en-body-md-600 font-semibold" }, z = /* @__PURE__ */ f({
11
11
  __name: "Takeaway",
12
12
  setup(D) {
@@ -1,14 +1,14 @@
1
1
  import { getCurrentInstance as te, defineComponent as oe, computed as h, watch as ne, h as R, resolveComponent as S, createElementBlock as C, openBlock as _, Fragment as O, normalizeClass as D, createElementVNode as k, createVNode as V, unref as t, isRef as j, withCtx as P, renderList as ie, createBlock as G, createCommentVNode as $, toDisplayString as B, withModifiers as H } from "vue";
2
- import { G as q, u as Q, O as W, J as N, A as z, H as L, B as se, an as J } from "./menu-DFNvhoNQ.js";
2
+ import { G as q, u as Q, O as W, J as N, A as z, H as L, B as se, an as J } from "./menu-DS_ERmBf.js";
3
3
  import { useI18n as X, useCoreStore as re } from "@feedmepos/mf-common";
4
4
  import { useDialog as le, useSnackbar as Z, FmButtonVariant as A, components as ce, useBreakpoints as de } from "@feedmepos/ui-library";
5
- import { _ as ue } from "./app-Ddb81PNo.js";
5
+ import { _ as ue } from "./app-CVqWWV4x.js";
6
6
  import { _ as me } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
7
- import { a as ye, l as ee, T as pe } from "./index-QsLFbxyG.js";
7
+ import { a as ye, l as ee, T as pe } from "./index-BJZEWB5C.js";
8
8
  import { u as fe } from "./search-BAPEUu1R.js";
9
- import { f as F } from "./currency-g45Sh-t6.js";
9
+ import { f as F } from "./currency-OhOTnAqk.js";
10
10
  import { defineStore as _e } from "pinia";
11
- import { C as ke } from "./catalog-DSuJhsUb.js";
11
+ import { C as ke } from "./catalog-C_TuQLxq.js";
12
12
  import { c as ve } from "./createComponentProgrammatically-Bt2rn1IQ.js";
13
13
  function we(T, U, l, m) {
14
14
  var y, v, w, g;
@@ -0,0 +1,440 @@
1
+ import { computed as i, defineComponent as V, ref as k, resolveComponent as b, createElementBlock as L, openBlock as w, normalizeClass as O, createVNode as K, normalizeStyle as x, withCtx as $, createBlock as U, createCommentVNode as B } from "vue";
2
+ import { A as p, J as E, G as S, O as N, ah as A, u as y, c as j } from "./menu-DS_ERmBf.js";
3
+ import { u as C } from "./menuV2-DKzAZ4Ss.js";
4
+ import { C as v, h as G } from "./catalog-C_TuQLxq.js";
5
+ import { useSnackbar as F, useDialog as Y } from "@feedmepos/ui-library";
6
+ import { a as T } from "./LinkProductSideSheet-BdzBGYxG.js";
7
+ import { useI18n as J } from "@feedmepos/mf-common";
8
+ function q() {
9
+ const t = C(), s = i(() => t.categorizedRawMenuItems.filter((u) => u.items.length > 0)), m = i(() => {
10
+ const u = t.currentCatalog;
11
+ return u ? v.getItemAvailable(u).map((e) => ({ _id: e })) : [];
12
+ });
13
+ async function g(u) {
14
+ const e = t.currentCatalog;
15
+ if (!e) return;
16
+ const a = u.reduce(
17
+ (o, r) => (o[r] = R(
18
+ r,
19
+ e.override.items[r],
20
+ u.includes(r),
21
+ t.version === p.F_MENU_VERSION.enum.v3
22
+ ), o),
23
+ {}
24
+ ), n = {
25
+ ...e,
26
+ override: {
27
+ ...e.override,
28
+ items: {
29
+ ...a
30
+ }
31
+ }
32
+ };
33
+ await t.updateMenu({
34
+ module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
35
+ operation: E.F_OPERATION_TYPE.update,
36
+ data: n
37
+ });
38
+ }
39
+ async function l(u) {
40
+ var o;
41
+ const e = t.currentCatalog;
42
+ if (!e) return;
43
+ const a = u.reduce(
44
+ (r, c) => {
45
+ const d = e.override.items[c];
46
+ return r[c] = R(
47
+ c,
48
+ d,
49
+ !0,
50
+ t.version === p.F_MENU_VERSION.enum.v3
51
+ ), r;
52
+ },
53
+ {}
54
+ ), n = {
55
+ ...e,
56
+ override: {
57
+ ...e.override,
58
+ items: {
59
+ ...((o = e.override) == null ? void 0 : o.items) || {},
60
+ ...a
61
+ }
62
+ },
63
+ /**
64
+ * linkItemRules and items under override are two ways to manage linked items under catalog,
65
+ * if we changed items under override, we should clear linkItemRules to avoid conflict.
66
+ */
67
+ linkItemRules: null
68
+ };
69
+ await t.updateMenu({
70
+ module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
71
+ operation: E.F_OPERATION_TYPE.update,
72
+ data: n
73
+ });
74
+ }
75
+ async function f(u) {
76
+ var o;
77
+ const e = t.currentCatalog;
78
+ if (!e) return;
79
+ const a = u.reduce(
80
+ (r, c) => {
81
+ const d = e.override.items[c];
82
+ return r[c] = R(
83
+ c,
84
+ d,
85
+ !1,
86
+ t.version === p.F_MENU_VERSION.enum.v3
87
+ ), r;
88
+ },
89
+ {}
90
+ ), n = {
91
+ ...e,
92
+ override: {
93
+ ...e.override,
94
+ items: {
95
+ ...((o = e.override) == null ? void 0 : o.items) || {},
96
+ ...a
97
+ }
98
+ }
99
+ };
100
+ await t.updateMenu({
101
+ module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
102
+ operation: E.F_OPERATION_TYPE.update,
103
+ data: n
104
+ });
105
+ }
106
+ async function _(u) {
107
+ const e = t.currentCatalog;
108
+ if (!e) return;
109
+ const a = {
110
+ ...e,
111
+ linkItemRules: u
112
+ };
113
+ await t.updateMenu({
114
+ module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
115
+ operation: E.F_OPERATION_TYPE.update,
116
+ data: a
117
+ });
118
+ }
119
+ return {
120
+ linkableItems: s,
121
+ currentItems: m,
122
+ setProduct: g,
123
+ applyProduct: l,
124
+ removeProduct: f,
125
+ saveLinkItemRules: _
126
+ };
127
+ }
128
+ function R(t, s, m, g) {
129
+ const l = s == null ? void 0 : s.find((u) => !u.combinationKey), f = m ? null : p.F_ORDER_FROM.enum.NONE, _ = g ? m ? null : "" : l == null ? void 0 : l.category;
130
+ return [
131
+ {
132
+ ...l ?? {},
133
+ orderFrom: f,
134
+ category: _,
135
+ _id: t
136
+ },
137
+ ...(s == null ? void 0 : s.filter((u) => !!u.combinationKey)) ?? []
138
+ ];
139
+ }
140
+ function H() {
141
+ const t = C(), s = F(), m = Y(), g = S(s), l = N(g), f = i(() => {
142
+ const e = t.categorizedRawMenuItems, a = new Set(
143
+ t.currentCatalog ? v.getItemAvailable(t.currentCatalog) : t.state.menu.modules.item.map((n) => n._id)
144
+ );
145
+ return e.map((n) => ({
146
+ ...n,
147
+ items: n.items.filter((o) => a.has(o._id))
148
+ })).filter((n) => n.items.length > 0);
149
+ }), _ = i(() => {
150
+ var o;
151
+ const e = t.currentScheduler;
152
+ if (!e) return [];
153
+ const a = t.currentCatalog, n = a ? ((o = a.override.scheduler[e._id]) == null ? void 0 : o.items) ?? [] : e.items;
154
+ return [
155
+ ...new Set(n.filter((r) => r.orderFrom != p.F_ORDER_FROM.enum.NONE).map((r) => r._id))
156
+ ].map((r) => ({ _id: r }));
157
+ });
158
+ async function u(e) {
159
+ const a = t.currentScheduler;
160
+ if (!a) return;
161
+ const n = t.currentCatalog;
162
+ if (n && t.rules.scheduler.override) {
163
+ const o = new v(
164
+ n,
165
+ t,
166
+ l.updateMenu,
167
+ m
168
+ );
169
+ o.overrideCatalogSchedulerItems(e, a._id), await t.updateMenu({
170
+ module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
171
+ operation: E.F_OPERATION_TYPE.update,
172
+ data: o.getCatalog()
173
+ });
174
+ } else {
175
+ const o = e.reduce(
176
+ (c, d) => {
177
+ const M = a.items.filter((h) => h._id == d) ?? [];
178
+ return c = c.concat(
179
+ A(d, M, (h) => ({
180
+ ...h,
181
+ orderFrom: null
182
+ }))
183
+ ), c;
184
+ },
185
+ []
186
+ ), r = {
187
+ ...a,
188
+ items: o
189
+ };
190
+ await t.updateMenu({
191
+ module: p.F_MENU_MODULE_V4_KEY.enum.scheduler,
192
+ operation: E.F_OPERATION_TYPE.update,
193
+ data: r
194
+ });
195
+ }
196
+ }
197
+ return {
198
+ linkableItems: f,
199
+ currentItems: _,
200
+ applyProduct: u
201
+ };
202
+ }
203
+ const Q = () => {
204
+ const t = y(), s = F(), m = S(s), g = N(m), l = i(() => t.categorizedRawMenuItems.filter((e) => e.items.length > 0)), f = i(() => {
205
+ const e = t.currentCatalog;
206
+ return e ? v.getItemAvailable(e).map((a) => ({ _id: a })) : [];
207
+ });
208
+ async function _(e) {
209
+ const a = t.currentCatalog;
210
+ if (!a) return;
211
+ const o = t.state.menu.modules.item.map((c) => c._id).reduce(
212
+ (c, d) => {
213
+ const M = a.override.items[d];
214
+ return c[d] = G(
215
+ d,
216
+ M,
217
+ e.includes(d),
218
+ t.version === j.F_MENU_VERSION.v3
219
+ ), c;
220
+ },
221
+ {}
222
+ ), r = {
223
+ ...a,
224
+ override: { ...a.override, items: o },
225
+ /**
226
+ * linkItemRules and items under override are two ways to manage linked items under catalog,
227
+ * if we changed items under override, we should clear linkItemRules to avoid conflict.
228
+ */
229
+ linkItemRules: null
230
+ };
231
+ await g.updateMenu(
232
+ {
233
+ module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
234
+ operation: E.F_OPERATION_TYPE.update,
235
+ data: r
236
+ },
237
+ r.name
238
+ );
239
+ }
240
+ async function u(e) {
241
+ const a = t.currentCatalog;
242
+ if (!a) return;
243
+ const n = {
244
+ ...a,
245
+ linkItemRules: e
246
+ };
247
+ await g.updateMenu(
248
+ {
249
+ module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
250
+ operation: E.F_OPERATION_TYPE.update,
251
+ data: n
252
+ },
253
+ n.name
254
+ );
255
+ }
256
+ return {
257
+ linkableItems: l,
258
+ currentItems: f,
259
+ applyProduct: _,
260
+ saveLinkItemRules: u
261
+ };
262
+ }, W = () => {
263
+ const t = y(), s = F(), m = Y(), g = S(s), l = N(g), f = i(() => {
264
+ const e = t.categorizedRawMenuItems, a = new Set(
265
+ t.currentCatalog ? v.getItemAvailable(t.currentCatalog) : t.state.menu.modules.item.map((n) => n._id)
266
+ );
267
+ return e.map((n) => ({
268
+ ...n,
269
+ items: n.items.filter((o) => a.has(o._id))
270
+ })).filter((n) => n.items.length > 0);
271
+ }), _ = i(() => {
272
+ var o;
273
+ const e = t.currentScheduler;
274
+ if (!e) return [];
275
+ const a = t.currentCatalog, n = a ? ((o = a.override.scheduler[e._id]) == null ? void 0 : o.items) ?? [] : e.items;
276
+ return [
277
+ ...new Set(n.filter((r) => r.orderFrom != p.F_ORDER_FROM.enum.NONE).map((r) => r._id))
278
+ ].map((r) => ({ _id: r }));
279
+ });
280
+ async function u(e) {
281
+ const a = t.currentScheduler;
282
+ if (!a) return;
283
+ const n = t.currentCatalog;
284
+ if (n && t.rules.scheduler.override) {
285
+ const o = new v(n, t, l.updateMenu, m);
286
+ o.overrideCatalogSchedulerItems(e, a._id), await o.update();
287
+ } else {
288
+ const o = e.reduce(
289
+ (c, d) => {
290
+ const M = a.items.filter((h) => h._id == d) ?? [];
291
+ return c = c.concat(
292
+ A(d, M, (h) => ({
293
+ ...h,
294
+ orderFrom: null
295
+ }))
296
+ ), c;
297
+ },
298
+ []
299
+ ), r = {
300
+ ...a,
301
+ items: o
302
+ };
303
+ await l.updateMenu(
304
+ {
305
+ module: p.F_MENU_MODULE_V4_KEY.enum.scheduler,
306
+ operation: E.F_OPERATION_TYPE.update,
307
+ data: r
308
+ },
309
+ r.name
310
+ );
311
+ }
312
+ }
313
+ return {
314
+ linkableItems: f,
315
+ currentItems: _,
316
+ applyProduct: u
317
+ };
318
+ };
319
+ function se(t) {
320
+ const s = {
321
+ // Under FdoMenuV4Category _id is string, but here we need null for Addon, so we bypass the type checking
322
+ // @ts-ignore
323
+ _id: null,
324
+ name: "Addon",
325
+ position: 0
326
+ };
327
+ if (!t) {
328
+ const n = y(), o = i(() => n.state.menu.modules.item ?? []), r = i(() => {
329
+ var I;
330
+ return ((I = n.currentCatalog) == null ? void 0 : I.linkItemRules) ?? null;
331
+ }), c = W(), d = Q(), M = i(() => !n.state.currentSchedulerId), h = (I) => {
332
+ if (I.mode === T.Rules)
333
+ d.saveLinkItemRules(I.linkItemRules);
334
+ else {
335
+ const P = I.items.map((z) => z._id);
336
+ M.value ? d.applyProduct(P) : c.applyProduct(P);
337
+ }
338
+ }, D = i(() => [s, ...n.state.menu.modules.category ?? []]);
339
+ return {
340
+ menuItems: o,
341
+ categories: D,
342
+ linkItemRules: r,
343
+ catalogManager: d,
344
+ schedulerManager: c,
345
+ noScheduler: M,
346
+ handleSubmit: h
347
+ };
348
+ }
349
+ const m = C(), g = i(() => m.state.menu.modules.item ?? []), l = i(() => {
350
+ var n;
351
+ return ((n = m.currentCatalog) == null ? void 0 : n.linkItemRules) ?? null;
352
+ }), f = H(), _ = q(), u = i(() => !m.state.currentSchedulerId), e = (n) => {
353
+ if (n.mode === T.Rules)
354
+ _.saveLinkItemRules(n.linkItemRules);
355
+ else {
356
+ const o = n.items.map((r) => r._id);
357
+ u.value ? _.applyProduct(o) : f.applyProduct(o);
358
+ }
359
+ }, a = i(() => [s, ...m.state.menu.modules.category ?? []]);
360
+ return {
361
+ menuItems: g,
362
+ categories: a,
363
+ linkItemRules: l,
364
+ catalogManager: _,
365
+ schedulerManager: f,
366
+ noScheduler: u,
367
+ handleSubmit: e
368
+ };
369
+ }
370
+ const X = ["alt", "src", "crossorigin"], ue = /* @__PURE__ */ V({
371
+ __name: "Thumbnail",
372
+ props: {
373
+ src: {},
374
+ alt: {},
375
+ className: {},
376
+ size: {},
377
+ crossorigin: { type: Boolean, default: !0 }
378
+ },
379
+ setup(t) {
380
+ const s = t, { t: m } = J(), g = k(!1), l = k(!s.src), f = () => {
381
+ g.value = !1, l.value = !0;
382
+ }, _ = () => {
383
+ g.value = !0, l.value = !0;
384
+ }, u = i(() => s.alt ? m("menu.thumbnail.alt.with_name", { name: s.alt }) : m("menu.thumbnail.alt.default")), e = i(() => typeof s.size == "number" ? {
385
+ width: s.size,
386
+ height: s.size
387
+ } : {
388
+ width: s.size.width,
389
+ height: s.size.height
390
+ }), a = i(() => {
391
+ if (!s.src) return null;
392
+ if (s.crossorigin) {
393
+ const n = s.src.includes("?") ? "&" : "?";
394
+ return `${s.src}${n}_cors=${Date.now()}`;
395
+ }
396
+ return s.src;
397
+ });
398
+ return (n, o) => {
399
+ const r = b("fm-icon"), c = b("fm-card");
400
+ return w(), L("div", {
401
+ class: O([n.className, "flex items-center justify-center"])
402
+ }, [
403
+ K(c, {
404
+ class: O(["flex items-center justify-center", "rounded-md"]),
405
+ style: x({ width: `${e.value.width}px`, height: `${e.value.height}px` }),
406
+ variant: "outlined"
407
+ }, {
408
+ default: $(() => [
409
+ a.value && !g.value ? (w(), L("img", {
410
+ key: 0,
411
+ alt: u.value,
412
+ class: O(["w-full h-full", "object-cover", l.value ? "" : "hidden"]),
413
+ src: a.value,
414
+ crossorigin: s.crossorigin ? "anonymous" : void 0,
415
+ onError: _,
416
+ onLoad: f
417
+ }, null, 42, X)) : (w(), U(r, {
418
+ key: 1,
419
+ color: "neutral-gray-300",
420
+ name: "image",
421
+ outline: ""
422
+ })),
423
+ l.value ? B("", !0) : (w(), U(r, {
424
+ key: 2,
425
+ class: "animate-spin",
426
+ name: "progress_activity",
427
+ spin: ""
428
+ }))
429
+ ]),
430
+ _: 1
431
+ }, 8, ["style"])
432
+ ], 2);
433
+ };
434
+ }
435
+ });
436
+ export {
437
+ ue as _,
438
+ q as a,
439
+ se as u
440
+ };