@feedmepos/mf-menu 0.31.65-prod → 0.31.66-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 (65) hide show
  1. package/dist/{App-NxvfKBS5.js → App-_hhF2vEm.js} +8 -8
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-dbW4tYqo.js → ApplyProduct.vue_vue_type_script_setup_true_lang-CklNnQOQ.js} +3 -3
  3. package/dist/{Catalog-56QNhwzQ.js → Catalog-a7OJl76V.js} +6 -6
  4. package/dist/{Category-CFEwgSeh.js → Category-BAgeeHZ6.js} +4 -4
  5. package/dist/{Category-BhcNTzuG.js → Category-DKFOm00_.js} +6 -6
  6. package/dist/{CookingGuide-DRS2iYQE.js → CookingGuide-GG_xpPxA.js} +4 -4
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-BBmdf1Ox.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-DF3qFAAY.js} +1 -1
  8. package/dist/{Group-DUidJF0Q.js → Group-A14aBWXV.js} +3 -3
  9. package/dist/{Group-dA82MfMe.js → Group-B-B6Jd4O.js} +1 -1
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-C0uyinHG.js → Group.vue_vue_type_script_setup_true_lang-Bo5aYMxd.js} +8 -8
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-C-xO929R.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-C-ZkWtEg.js} +6 -6
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Bfl43N4s.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DDRPLd2p.js} +7 -7
  13. package/dist/{Ingredient-IuEBFfAV.js → Ingredient-BIpvrB2N.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-cgwQnZwI.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DilJrYvT.js} +1052 -1052
  15. package/dist/{LinkProductSideSheet-bTFrtmEF.js → LinkProductSideSheet-30MhDAHW.js} +4 -4
  16. package/dist/{MenuSetting-DDNA5cSo.js → MenuSetting-BPJSvs_F.js} +6 -6
  17. package/dist/{PrintRoute-CLrP6oFz.js → PrintRoute-CEPvNwF5.js} +4 -4
  18. package/dist/{Product-BUBC1der.js → Product-_bW36Ykl.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-Dxngjgbw.js → Product.vue_vue_type_script_setup_true_lang-8AU_Whl5.js} +14 -14
  20. package/dist/{ProductInternalTools-BEExOwjE.js → ProductInternalTools-BxKNE_3-.js} +5 -5
  21. package/dist/{Products-mcxzdyvV.js → Products-B90T96zV.js} +11 -11
  22. package/dist/Publish-DGnnsb-y.js +587 -0
  23. package/dist/{Recipe-CvooOkEm.js → Recipe-CgX2BPTq.js} +4 -4
  24. package/dist/{Scheduler-DNW1s2cX.js → Scheduler-C3nDtZZ8.js} +3 -3
  25. package/dist/{ServingSequence-Di1HFZzi.js → ServingSequence-cQsCat2N.js} +3 -3
  26. package/dist/{Setting-BjUcj2eS.js → Setting-CaVVM7vJ.js} +5 -5
  27. package/dist/{Subcategory-A3V_5EwR.js → Subcategory-D6ebsCyz.js} +4 -4
  28. package/dist/{Takeaway-SS0ZZuff.js → Takeaway-BzJEWe1f.js} +1 -1
  29. package/dist/{Takeaway-Dl60BZ-I.js → Takeaway-Dl0mDmGj.js} +4 -4
  30. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CoPtEtBl.js → Takeaway.vue_vue_type_script_setup_true_lang-DMgGcRGX.js} +5 -5
  31. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-DLCEwTR1.js → Thumbnail.vue_vue_type_script_setup_true_lang-3VDWuhZU.js} +4 -4
  32. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BKx1towF.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BWlhpHF0.js} +15 -15
  33. package/dist/{Unit-DFQVca7g.js → Unit-DOLHXdK6.js} +2 -2
  34. package/dist/{Variant-D2ad7-aY.js → Variant-BUvj1bus.js} +3 -3
  35. package/dist/{_id_-Dhn2K-WO.js → _id_-RO4KdC1n.js} +10 -10
  36. package/dist/{app-CiBqmBzO.js → app-5fxKLAzS.js} +2667 -2564
  37. package/dist/{app-CHrfSnH-.js → app-CzbgqOf0.js} +26 -26
  38. package/dist/{app-BST1Ws0Q.js → app-DQQJ_9iV.js} +1 -1
  39. package/dist/app.js +1 -1
  40. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/assets/{linked-status-C88hxUQa.js → linked-status-Dt3Uze-A.js} +2 -2
  42. package/dist/assets/{override-menu-DKuz_186.js → override-menu-BQEFLWz8.js} +2 -2
  43. package/dist/assets/{validate-menu-DBd0Wz1c.js → validate-menu-BnfLMKMw.js} +2 -2
  44. package/dist/{catalog-BRfrkxXk.js → catalog-BUXOgvi0.js} +1 -1
  45. package/dist/{catalogSetting-82LtM5qr.js → catalogSetting-Cr--_S9s.js} +1 -1
  46. package/dist/{category-CJYDELtR.js → category-foWTUFXU.js} +1 -1
  47. package/dist/{currency-DL7o403k.js → currency-B6rUrrkO.js} +1 -1
  48. package/dist/{customAttributes-laCstc_D.js → customAttributes-nIVPnbIm.js} +2 -2
  49. package/dist/{dayjs.min-CqGLmCBm.js → dayjs.min---cWh2WB.js} +1 -1
  50. package/dist/{index-CyKl4kdN.js → index-DOvqkmcU.js} +4 -4
  51. package/dist/{index-DIuW1yrT.js → index-DfwxGeiO.js} +1 -1
  52. package/dist/{index-Cg1QT--E.js → index-FhzMSZhS.js} +3 -3
  53. package/dist/{index-XoZlSvmA.js → index-sv_MoGNZ.js} +1 -1
  54. package/dist/{item-Cex_kX2Y.js → item-hCbfNYuw.js} +16 -16
  55. package/dist/{jszip.min-Cyt3sNxf.js → jszip.min-DIGWbVTA.js} +245 -245
  56. package/dist/{menu-DZ0SKMgS.js → menu-CGpVK1Kw.js} +1 -1
  57. package/dist/{menu-RUcYPH-Z.js → menu-CgDLwNcD.js} +4 -4
  58. package/dist/{menuV2-DCKpicf5.js → menuV2-CuNqLLAt.js} +73 -73
  59. package/dist/{priceTier-9huRkA05.js → priceTier-BhpczzJB.js} +1 -1
  60. package/dist/{scheduler-ouP5_AvY.js → scheduler-BkV-4RPJ.js} +4 -4
  61. package/dist/{subcategory-CFJE8poU.js → subcategory-Dni2F8ro.js} +2 -2
  62. package/dist/{toExcel-BUfI8qSm.js → toExcel-BS-4qoqI.js} +2 -2
  63. package/dist/{unit-wnLzGtSP.js → unit-Ylo0Rojv.js} +3 -3
  64. package/package.json +1 -1
  65. package/dist/Publish-BYQLBhts.js +0 -581
@@ -0,0 +1,587 @@
1
+ import { defineComponent as G, ref as V, computed as R, onMounted as re, resolveComponent as w, createElementBlock as U, openBlock as y, createVNode as n, createElementVNode as o, toDisplayString as A, unref as r, Fragment as O, renderList as W, createBlock as N, withCtx as L, createCommentVNode as ce, withModifiers as z, h as Y } from "vue";
2
+ import { D as ae } from "./dayjs.min---cWh2WB.js";
3
+ import { useRouter as de } from "vue-router";
4
+ import { O as me, b as pe } from "./app-5fxKLAzS.js";
5
+ import { B as ge, e as be, G as te, a7 as ve, H as Z, I as fe, u as _e, A as he } from "./menu-CgDLwNcD.js";
6
+ import { useI18n as J, useCoreStore as ye, RestaurantSelector as Ce } from "@feedmepos/mf-common";
7
+ import { useSnackbar as le, useDialogChild as ke, useDialog as we, components as ee } from "@feedmepos/ui-library";
8
+ import { _ as xe } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
9
+ import { _ as Ve } from "./app-CzbgqOf0.js";
10
+ import { c as Se } from "./iteration-BoeoXAHD.js";
11
+ import { a as Fe, w as Ie, p as Ae } from "./tooltip-CQW9YRO5.js";
12
+ import { u as Me } from "./discardConfirm-BHni0LNu.js";
13
+ import { _ as $e } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
14
+ function se(S) {
15
+ return S ? ae(S).format("DD/MM/YY HH:mm") : "-";
16
+ }
17
+ function Re(S, F, l) {
18
+ const c = (u, f = !1) => {
19
+ var v;
20
+ return u === void 0 && !f ? "-" : ((v = l.find((x) => x.value === (u || null))) == null ? void 0 : v.label) || "-";
21
+ };
22
+ return S.map((u) => {
23
+ var t;
24
+ const f = (t = F.find(({ _id: d }) => d === u._id)) == null ? void 0 : t.posVersion, v = !!f && !!ge.Pos.canUse({ feature: be.F_FEATURE.enum.taxAndServiceChargeV4, posVersion: f }), x = c(u.catalogId);
25
+ return {
26
+ ...u,
27
+ _default: x,
28
+ _posTakeaway: u.takeawayCatalog ? c(u.takeawayCatalog) : x,
29
+ _additionalCatalogs: (u.additionalCatalogs || []).map((d) => c(d)),
30
+ _lastUpdate: se(u.updatedAt),
31
+ _pickup: v ? c(u.pickupCatalog, !0) : "-",
32
+ _canUsePickup: v,
33
+ _posVersion: f || "-"
34
+ };
35
+ });
36
+ }
37
+ const De = {
38
+ key: 0,
39
+ class: "flex items-center justify-center"
40
+ }, Pe = {
41
+ key: 1,
42
+ class: "space-y-16"
43
+ }, Ue = { class: "text-fm-color-typo-secondary" }, Le = { class: "space-y-4" }, Be = /* @__PURE__ */ G({
44
+ __name: "RevertDialog",
45
+ props: {
46
+ restaurant: {}
47
+ },
48
+ setup(S) {
49
+ const F = S, l = le(), { custom: c } = te(l), u = V(!1), f = V(null);
50
+ async function v() {
51
+ await c(
52
+ async () => {
53
+ var m;
54
+ f.value = await ve.readMenuById(((m = F.restaurant.revertConfig) == null ? void 0 : m._id) || "");
55
+ },
56
+ { isLoading: u }
57
+ );
58
+ }
59
+ const x = R(() => {
60
+ var m;
61
+ return [
62
+ { label: "Main", value: null },
63
+ ...(((m = f.value) == null ? void 0 : m.modules.catalog) || []).map((C) => ({
64
+ label: C.name,
65
+ value: C._id
66
+ }))
67
+ ];
68
+ }), { t } = J(), d = R(() => {
69
+ var _;
70
+ const m = F.restaurant.revertConfig;
71
+ if (!m) return [];
72
+ const C = Re(
73
+ [
74
+ {
75
+ ...m,
76
+ catalogId: m.catalogId || null
77
+ }
78
+ ],
79
+ ye().restaurants.value,
80
+ x.value
81
+ )[0];
82
+ return [
83
+ { label: t("menu.revert.labels.restaurant"), value: F.restaurant.name },
84
+ {
85
+ label: t("menu.revert.labels.revert_to"),
86
+ value: se((_ = f.value) == null ? void 0 : _.updatedAt)
87
+ },
88
+ { label: t("menu.revert.labels.default"), value: C._default },
89
+ { label: t("menu.revert.labels.pos_takeaway"), value: C._posTakeaway },
90
+ { label: t("menu.revert.labels.pickup"), value: C._pickup },
91
+ {
92
+ label: t("menu.revert.labels.additional_catalogs"),
93
+ value: C._additionalCatalogs.join(", ")
94
+ }
95
+ ];
96
+ });
97
+ re(async () => v());
98
+ const { emitData: D } = ke();
99
+ return (m, C) => {
100
+ const _ = w("FmCircularProgress");
101
+ return u.value ? (y(), U("div", De, [
102
+ n(_, { size: "lg" })
103
+ ])) : (y(), U("div", Pe, [
104
+ o("div", Ue, A(r(t)("menu.revert.description", { name: F.restaurant.name })), 1),
105
+ o("div", Le, [
106
+ (y(!0), U(O, null, W(d.value, (P) => (y(), N(Fe, {
107
+ key: P.label,
108
+ name: P.label,
109
+ value: P.value || "--"
110
+ }, null, 8, ["name", "value"]))), 128))
111
+ ])
112
+ ]));
113
+ };
114
+ }
115
+ }), Ee = { class: "fm-typo-en-title-md-600" }, Oe = { class: "mt-40" }, Ne = { class: "fm-typo-en-title-sm-600" }, Te = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4 mb-8" }, ze = { class: "flex gap-8 items-center justify-start" }, He = /* @__PURE__ */ G({
116
+ __name: "UpdateCatalogDialog",
117
+ props: {
118
+ catalogs: {
119
+ type: Array,
120
+ required: !0
121
+ }
122
+ },
123
+ emits: ["onComplete"],
124
+ setup(S, { expose: F, emit: l }) {
125
+ const { t: c } = J(), u = S;
126
+ F({
127
+ show: C,
128
+ hide: _
129
+ });
130
+ const f = l;
131
+ function v() {
132
+ return {
133
+ restaurantId: "",
134
+ catalogId: void 0,
135
+ takeawayCatalog: void 0,
136
+ pickupCatalog: null,
137
+ additionalCatalogs: []
138
+ };
139
+ }
140
+ const x = R(() => [
141
+ {
142
+ label: c("menu.publish.update_catalog_dialog.sections.default.use_default"),
143
+ value: null
144
+ },
145
+ ...u.catalogs.map((h) => ({
146
+ label: h.name,
147
+ value: h._id
148
+ }))
149
+ ]), t = R(() => [
150
+ {
151
+ label: c("menu.publish.update_catalog_dialog.sections.default.use_default"),
152
+ value: null
153
+ },
154
+ ...u.catalogs.map((h) => ({
155
+ label: h.name,
156
+ value: h._id
157
+ }))
158
+ ]), d = V(v()), D = V(!1), m = V(void 0);
159
+ function C(h) {
160
+ m.value = h ? Z(h) : v(), d.value = Z(m.value), D.value = !0;
161
+ }
162
+ function _() {
163
+ D.value = !1;
164
+ }
165
+ const P = Me(
166
+ () => !fe.isEqual(m.value, d.value),
167
+ () => {
168
+ _();
169
+ }
170
+ );
171
+ function M() {
172
+ _(), f("onComplete", d.value);
173
+ }
174
+ return (h, g) => {
175
+ const B = w("FmSelect"), T = w("FmCheckbox"), $ = w("FmButton"), E = w("FmSideSheet");
176
+ return y(), N(E, {
177
+ modelValue: D.value,
178
+ "onUpdate:modelValue": g[5] || (g[5] = (b) => D.value = b),
179
+ "max-width": 560,
180
+ "onOn:clickedAway": r(P)
181
+ }, {
182
+ "side-sheet-header": L(() => [
183
+ o("span", Ee, A(r(c)("menu.publish.update_catalog_dialog.title")), 1)
184
+ ]),
185
+ "side-sheet-footer": L(() => [
186
+ o("div", ze, [
187
+ n($, {
188
+ label: r(c)("menu.publish.update_catalog_dialog.actions.update"),
189
+ size: "lg",
190
+ variant: "primary",
191
+ onClick: g[4] || (g[4] = () => M())
192
+ }, null, 8, ["label"]),
193
+ n($, {
194
+ label: r(c)("menu.publish.update_catalog_dialog.actions.cancel"),
195
+ size: "lg",
196
+ variant: "tertiary",
197
+ onClick: _
198
+ }, null, 8, ["label"])
199
+ ])
200
+ ]),
201
+ default: L(() => [
202
+ n(B, {
203
+ modelValue: d.value.catalogId,
204
+ "onUpdate:modelValue": g[0] || (g[0] = (b) => d.value.catalogId = b),
205
+ items: x.value,
206
+ class: "mb-24",
207
+ label: r(c)("menu.publish.update_catalog_dialog.sections.default.label")
208
+ }, null, 8, ["modelValue", "items", "label"]),
209
+ n(B, {
210
+ modelValue: d.value.takeawayCatalog,
211
+ "onUpdate:modelValue": g[1] || (g[1] = (b) => d.value.takeawayCatalog = b),
212
+ items: t.value,
213
+ class: "mb-24",
214
+ label: r(c)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label")
215
+ }, null, 8, ["modelValue", "items", "label"]),
216
+ n(B, {
217
+ modelValue: d.value.pickupCatalog,
218
+ "onUpdate:modelValue": g[2] || (g[2] = (b) => d.value.pickupCatalog = b),
219
+ items: t.value,
220
+ label: r(c)("menu.publish.update_catalog_dialog.sections.pickup.label")
221
+ }, null, 8, ["modelValue", "items", "label"]),
222
+ o("div", Oe, [
223
+ o("div", Ne, A(r(c)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
224
+ o("div", Te, A(r(c)("menu.publish.update_catalog_dialog.sections.additional.subtitle")), 1),
225
+ (y(!0), U(O, null, W(S.catalogs, (b) => (y(), U("div", {
226
+ key: b._id
227
+ }, [
228
+ n(T, {
229
+ modelValue: d.value.additionalCatalogs,
230
+ "onUpdate:modelValue": g[3] || (g[3] = (k) => d.value.additionalCatalogs = k),
231
+ label: b.name,
232
+ value: b._id
233
+ }, null, 8, ["modelValue", "label", "value"])
234
+ ]))), 128))
235
+ ])
236
+ ]),
237
+ _: 1
238
+ }, 8, ["modelValue", "onOn:clickedAway"]);
239
+ };
240
+ }
241
+ }), Ke = {
242
+ class: "flex flex-col p-24 bg-fm-color-neutral-white min-h-[calc(100dvh-56px)] xs:max-h-[calc(100dvh-56px)]"
243
+ }, je = {
244
+ class: "flex items-center xs:mb-8 mb-24"
245
+ }, Ye = {
246
+ class: "mr-8"
247
+ }, qe = {
248
+ class: "fm-typo-en-title-md-600"
249
+ }, Ge = {
250
+ class: "xs:hidden mr-16"
251
+ }, We = {
252
+ class: "xs:hidden"
253
+ }, Je = {
254
+ class: "pb-8 flex justify-between items-start xs:flex-col xs:items-stretch gap-8"
255
+ }, Qe = {
256
+ class: "grow flex flex-col gap-4"
257
+ }, Xe = {
258
+ class: "flex gap-8 items-center"
259
+ }, Ze = {
260
+ class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary"
261
+ }, ea = {
262
+ class: "space-y-4"
263
+ }, aa = {
264
+ class: "fm-typo-en-body-lg-600"
265
+ }, ta = {
266
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
267
+ }, la = {
268
+ class: "flex gap-8"
269
+ }, sa = {
270
+ class: "xs:block hidden fixed bottom-72 right-16"
271
+ }, q = 40, _a = /* @__PURE__ */ G({
272
+ __name: "Publish",
273
+ setup(S) {
274
+ const F = de(), {
275
+ t: l
276
+ } = J(), c = ({
277
+ row: e
278
+ }) => {
279
+ const a = e.status === "latest";
280
+ return n(xe, {
281
+ label: l(a ? "menu.publish.table.status.latest" : "menu.publish.table.status.outdated"),
282
+ variant: a ? "success" : "warning"
283
+ }, null);
284
+ }, u = V({}), f = [{
285
+ accessorKey: "name",
286
+ header: () => l("menu.publish.table.columns.restaurant"),
287
+ cell: (e) => e.getValue(),
288
+ enableSorting: !0
289
+ }, {
290
+ accessorKey: "catalog",
291
+ header: () => l("menu.publish.table.columns.default"),
292
+ enableSorting: !1,
293
+ cell: (e) => e.getValue().default
294
+ }, {
295
+ accessorKey: "catalog",
296
+ header: () => l("menu.publish.table.columns.pos_takeaway"),
297
+ enableSorting: !1,
298
+ cell: (e) => e.getValue().takeaway
299
+ }, {
300
+ accessorKey: "catalog",
301
+ header: () => l("menu.publish.table.columns.pickup"),
302
+ enableSorting: !1,
303
+ cell: (e) => e.getValue().pickup
304
+ }, {
305
+ accessorKey: "updatedAt",
306
+ header: () => l("menu.publish.table.columns.version"),
307
+ enableSorting: !1,
308
+ cell: (e) => {
309
+ const a = e.getValue();
310
+ return _(a);
311
+ }
312
+ }, {
313
+ accessorKey: "status",
314
+ header: () => l("menu.common.labels.status"),
315
+ enableSorting: !1,
316
+ cell: (e) => n(c, {
317
+ row: e.row.original
318
+ }, null)
319
+ }, {
320
+ accessorKey: "_id",
321
+ header: "",
322
+ size: 52,
323
+ enableSorting: !1,
324
+ cell: (e) => {
325
+ const a = e.row.original;
326
+ return Y("div", {
327
+ class: "flex justify-end gap-8"
328
+ }, [D.value && a.revertConfig ? Ie(Y(ee.FmButton, {
329
+ prependIcon: "undo",
330
+ variant: "secondary",
331
+ onClick: z(async () => {
332
+ await m(e.row.original);
333
+ }, ["stop", "prevent"])
334
+ }), l("menu.publish.actions.revert")) : null, Y(ee.FmButton, {
335
+ label: l("menu.publish.actions.publish"),
336
+ icon: "ios_share",
337
+ variant: "secondary",
338
+ onClick: z(async () => {
339
+ const s = g(e.row.original);
340
+ await E(s);
341
+ }, ["stop", "prevent"])
342
+ })]);
343
+ },
344
+ meta: {
345
+ width: "150px"
346
+ }
347
+ }], v = V(""), x = V(), t = _e(), d = we(), D = R(() => t.version !== he.F_MENU_VERSION.enum.v3);
348
+ async function m(e) {
349
+ e.revertConfig && d.open({
350
+ title: "Revert menu",
351
+ contentComponent: Be,
352
+ contentComponentProps: {
353
+ restaurant: e
354
+ },
355
+ primaryActions: {
356
+ text: "Revert",
357
+ close: !0
358
+ },
359
+ secondaryActions: {
360
+ text: "Cancel",
361
+ close: !0
362
+ }
363
+ }).onPrimary(async () => {
364
+ await $.minor(async () => {
365
+ await t.revertRestaurantMenu(e._id);
366
+ }, {
367
+ customId: e._id,
368
+ message: `Revert menu of ${e.name}`
369
+ });
370
+ });
371
+ }
372
+ const C = R(() => l("menu.publish.labels.main_version", {
373
+ version: _(t.state.menu.updatedAt)
374
+ }));
375
+ function _(e) {
376
+ return e ? ae(e).format("DD/MM/YYYY hh:mmA") : "";
377
+ }
378
+ const P = R(() => t.state.menu.modules.catalog), M = R(() => $.queue.value.some((e) => e.id === t.state.menu._id));
379
+ function h(e) {
380
+ var a;
381
+ return e ? ((a = P.value.find((s) => s._id === e)) == null ? void 0 : a.name) ?? l("menu.publish.labels.catalog.invalid") : l("menu.publish.labels.catalog.main");
382
+ }
383
+ function g(e) {
384
+ return {
385
+ restaurantId: e._id,
386
+ catalogId: e.catalogId,
387
+ takeawayCatalog: e.takeawayCatalog,
388
+ pickupCatalog: e.pickupCatalog || null,
389
+ additionalCatalogs: e.additionalCatalogs
390
+ };
391
+ }
392
+ function B(e) {
393
+ var s;
394
+ const a = g(e);
395
+ (s = x.value) == null || s.show(a);
396
+ }
397
+ const T = le(), $ = te(T);
398
+ async function E(e) {
399
+ var s;
400
+ const a = (s = k.value.find((p) => p._id === e.restaurantId)) == null ? void 0 : s.name;
401
+ await $.minor(async () => await t.publishMenu(e), {
402
+ customId: t.state.menu._id,
403
+ message: `Publishing menu for ${a}`,
404
+ successMessage: `Published to ${a}`
405
+ });
406
+ }
407
+ const b = V(null), k = R(() => {
408
+ const e = v.value.toLowerCase(), a = t.state.menu.updatedAt;
409
+ return t.state.restaurants.filter((s) => {
410
+ var p;
411
+ return !b.value || ((p = b.value) == null ? void 0 : p.includes(s._id));
412
+ }).map((s) => ({
413
+ ...s,
414
+ catalog: {
415
+ default: h(s.catalogId),
416
+ takeaway: h(s.takeawayCatalog),
417
+ pickup: h(s.pickupCatalog)
418
+ },
419
+ status: a === s.updatedAt ? "latest" : "outdated"
420
+ })).filter((s) => me(s, H.value)).filter(({
421
+ name: s,
422
+ catalog: p
423
+ }) => e ? s.toLowerCase().includes(e) || p.default.toLowerCase().includes(e) || p.takeaway.toLowerCase().includes(e) || p.pickup.toLowerCase().includes(e) : !0);
424
+ }), H = V({
425
+ logic: "AND",
426
+ rules: []
427
+ }), oe = [{
428
+ type: "string",
429
+ key: "status",
430
+ entity: "menu",
431
+ values: ["latest", "outdated"]
432
+ }];
433
+ async function ne(e) {
434
+ const a = e.map((I) => I._id), s = Se(a, q), p = V("");
435
+ await $.minor(async () => {
436
+ await Ae({
437
+ items: s,
438
+ processor: async (I) => await t.publishMultipleMenu(I, !1),
439
+ batchSize: 1,
440
+ batchDelay: 50,
441
+ // 50ms delay to reduce server load
442
+ onProgress({
443
+ total: I,
444
+ batchStart: K,
445
+ batchEnd: X
446
+ }) {
447
+ const j = (K - 1) * q;
448
+ p.value = `Processed ${j} of ${e.length} restaurants`;
449
+ }
450
+ }), await t.readRestaurants(), await t.readMenu();
451
+ }, {
452
+ customId: t.state.menu._id,
453
+ message: "Publishing menu",
454
+ caption: p,
455
+ successMessage: `Published to ${e.length} restaurant${e.length > 1 ? "s" : ""}`
456
+ });
457
+ }
458
+ async function ue() {
459
+ await $.minor(async () => await t.readRestaurants(), {
460
+ customId: t.state.menu._id
461
+ });
462
+ }
463
+ async function Q() {
464
+ if (M.value) return;
465
+ const e = Object.keys(u.value).map(Number).filter((p) => u.value[p]), a = e.length === 0 || e.length === k.value.length ? k.value : e.map((p) => k.value[p]);
466
+ k.value.length === t.state.restaurants.length && (e.length === 0 || e.length === k.value.length) ? t.state.restaurants.length > q ? (t.publishAllMenu(), T.open({
467
+ type: "info",
468
+ title: "Publish menu request sent"
469
+ })) : await $.minor(async () => await t.publishAllMenu(), {
470
+ customId: t.state.menu._id
471
+ }) : await ne(a);
472
+ }
473
+ return (e, a) => {
474
+ const s = w("FmChip"), p = w("FmSpacer"), I = w("FmButton"), K = w("FmSearch"), X = w("FmTable"), j = w("FmListItem"), ie = w("FmList");
475
+ return y(), U(O, null, [o("div", Ke, [o("div", je, [o("div", Ye, [o("div", qe, A(r(l)("menu.publish.title")), 1), a[8] || (a[8] = o("div", {
476
+ class: "hidden xs:block fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
477
+ }, null, -1))]), n(s, {
478
+ label: C.value,
479
+ class: "xs:hidden text-fm-color-primary bg-fm-color-system-warning-100"
480
+ }, null, 8, ["label"]), n(p), o("div", Ge, [n(I, {
481
+ disabled: M.value,
482
+ label: r(l)("menu.publish.actions.refresh"),
483
+ variant: "secondary",
484
+ onClick: a[0] || (a[0] = () => ue())
485
+ }, null, 8, ["disabled", "label"])]), o("div", We, [n(I, {
486
+ disabled: M.value,
487
+ icon: "ios_share",
488
+ label: r(l)("menu.publish.actions.publish_all"),
489
+ variant: "primary",
490
+ onClick: a[1] || (a[1] = () => Q())
491
+ }, null, 8, ["disabled", "label"])])]), o("div", Je, [n(r(Ce), {
492
+ multiple: "",
493
+ modelValue: b.value,
494
+ "onUpdate:modelValue": a[3] || (a[3] = (i) => b.value = i)
495
+ }, {
496
+ "append-right": L(() => [n(r(pe), {
497
+ modelValue: H.value,
498
+ "onUpdate:modelValue": a[2] || (a[2] = (i) => H.value = i),
499
+ attributes: oe
500
+ }, null, 8, ["modelValue"])]),
501
+ _: 1
502
+ }, 8, ["modelValue"]), n(K, {
503
+ modelValue: v.value,
504
+ "onUpdate:modelValue": a[4] || (a[4] = (i) => v.value = i),
505
+ autofocus: "",
506
+ class: "w-[320px] xs:w-full",
507
+ placeholder: r(l)("menu.publish.table.search.placeholder")
508
+ }, null, 8, ["modelValue", "placeholder"])]), k.value.length > 0 ? (y(), U(O, {
509
+ key: 0
510
+ }, [n(Ve, {
511
+ class: "xs:hidden block"
512
+ }, {
513
+ default: L(() => [n(X, {
514
+ modelValue: u.value,
515
+ "onUpdate:modelValue": a[5] || (a[5] = (i) => u.value = i),
516
+ "column-defs": f,
517
+ loading: M.value,
518
+ "page-size": k.value.length,
519
+ "row-data": k.value,
520
+ shrinkAt: !1,
521
+ virtual: !0,
522
+ selection: "multiple",
523
+ "hide-footer": "",
524
+ "pin-header-row": "",
525
+ onRowClick: a[6] || (a[6] = (i) => B(i.original))
526
+ }, null, 8, ["modelValue", "loading", "page-size", "row-data"])]),
527
+ _: 1
528
+ }), n(ie, {
529
+ class: "flex-col flex-1 min-h-0 overflow-auto xs:flex hidden w-full pb-64",
530
+ separator: ""
531
+ }, {
532
+ default: L(() => [(y(!0), U(O, null, W(k.value, (i) => (y(), N(j, {
533
+ key: i._id,
534
+ label: i.name,
535
+ style: {
536
+ padding: "12px 0 !important"
537
+ },
538
+ onClick: () => B(i)
539
+ }, {
540
+ default: L(() => [o("div", Qe, [o("div", Xe, [o("div", Ze, A(_(i.updatedAt)), 1), n(c, {
541
+ row: i
542
+ }, null, 8, ["row"])]), o("div", ea, [o("div", aa, A(i.name), 1), o("div", ta, [o("div", null, "Default: " + A(i.catalog.default), 1), o("div", null, "POS takeaway: " + A(i.catalog.takeaway), 1), o("div", null, "Pickup: " + A(i.catalog.pickup), 1)])])]), o("div", la, [D.value && i.revertConfig ? (y(), N(I, {
543
+ key: 0,
544
+ disabled: M.value,
545
+ icon: "undo",
546
+ variant: "tertiary",
547
+ onClick: z(() => m(i), ["stop"])
548
+ }, null, 8, ["disabled", "onClick"])) : ce("", !0), n(I, {
549
+ disabled: M.value,
550
+ icon: "ios_share",
551
+ variant: "tertiary",
552
+ onClick: z(() => E(g(i)), ["stop"])
553
+ }, null, 8, ["disabled", "onClick"])])]),
554
+ _: 2
555
+ }, 1032, ["label", "onClick"]))), 128))]),
556
+ _: 1
557
+ })], 64)) : (y(), N(r($e), {
558
+ key: 1,
559
+ title: r(l)("menu.publish.empty.title"),
560
+ subtitle: r(l)("menu.publish.empty.subtitle"),
561
+ action: {
562
+ text: r(l)("menu.publish.empty.action"),
563
+ icon: "add",
564
+ callback: () => {
565
+ r(F).push({
566
+ name: "$settings-my-business"
567
+ });
568
+ }
569
+ }
570
+ }, null, 8, ["title", "subtitle", "action"]))]), o("div", sa, [n(I, {
571
+ disabled: M.value,
572
+ icon: "ios_share",
573
+ label: r(l)("menu.publish.actions.publish_all"),
574
+ variant: "fab",
575
+ onClick: a[7] || (a[7] = () => Q())
576
+ }, null, 8, ["disabled", "label"])]), n(He, {
577
+ ref_key: "updateCatalogDialogRef",
578
+ ref: x,
579
+ catalogs: P.value,
580
+ onOnComplete: E
581
+ }, null, 8, ["catalogs"])], 64);
582
+ };
583
+ }
584
+ });
585
+ export {
586
+ _a as default
587
+ };
@@ -2,15 +2,15 @@ import { defineComponent as z, computed as h, ref as w, reactive as Q, watch as
2
2
  import { useI18n as U } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as A, components as j, useDialog as ne, FmButtonVariant as G, useBreakpoints as oe } from "@feedmepos/ui-library";
4
4
  import { _ as ae } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
- import { _ as le } from "./app-CHrfSnH-.js";
6
- import { O as q, G as $, H as ie, D as P, I as se, e as Y, J as I, A as T, u as H } from "./menu-RUcYPH-Z.js";
5
+ import { _ as le } from "./app-CzbgqOf0.js";
6
+ import { O as q, G as $, H as ie, D as P, I as se, e as Y, J as I, A as T, u as H } from "./menu-CgDLwNcD.js";
7
7
  import { _ as re } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
8
8
  import { _ as ce } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
9
9
  import { defineStore as ue } from "pinia";
10
- import { _ as B, g as me } from "./InventoryBinding.vue_vue_type_script_setup_true_lang-cgwQnZwI.js";
10
+ import { _ as B, g as me } from "./InventoryBinding.vue_vue_type_script_setup_true_lang-DilJrYvT.js";
11
11
  import { u as de } from "./discardConfirm-BHni0LNu.js";
12
12
  import { c as pe } from "./check-C9mY6LiX.js";
13
- import "./unit-wnLzGtSP.js";
13
+ import "./unit-Ylo0Rojv.js";
14
14
  import { c as fe } from "./createComponentProgrammatically-Bt2rn1IQ.js";
15
15
  const _e = { class: "fm-typo-en-title-md-600" }, ve = { class: "pt-8 space-y-40" }, ye = { class: "flex flex-row gap-16" }, ge = { class: "flex gap-8 items-center justify-start" }, be = /* @__PURE__ */ z({
16
16
  __name: "Form",
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as N, computed as y, h as c, withModifiers as U, ref as V, resolveComponent as _, createBlock as k, openBlock as d, unref as m, withCtx as h, createElementBlock as D, createVNode as f, Fragment as H, createElementVNode as l, renderList as T, toDisplayString as S, createCommentVNode as I } from "vue";
2
- import { A as i, O as W, u as G, G as Q } from "./menu-RUcYPH-Z.js";
2
+ import { A as i, O as W, u as G, G as Q } from "./menu-CgDLwNcD.js";
3
3
  import { useI18n as J } from "@feedmepos/mf-common";
4
4
  import { components as X, useDialog as Z, useSnackbar as ee } from "@feedmepos/ui-library";
5
5
  import { _ as te } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
6
- import { _ as ne } from "./app-CHrfSnH-.js";
7
- import { d as ae, _ as oe, u as se, c as le } from "./scheduler-ouP5_AvY.js";
6
+ import { _ as ne } from "./app-CzbgqOf0.js";
7
+ import { d as ae, _ as oe, u as se, c as le } from "./scheduler-BkV-4RPJ.js";
8
8
  import { _ as re } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
9
9
  import { _ as ue } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
10
10
  const ce = {
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as J, ref as L, computed as O, resolveComponent as h, createElementBlock as g, openBlock as d, Fragment as x, renderSlot as ae, createVNode as l, unref as t, withCtx as m, createElementVNode as y, toDisplayString as z, onBeforeMount as oe, watch as F, watchEffect as se, h as $, getCurrentInstance as le, onMounted as re, createBlock as j, createCommentVNode as G, isRef as ie, normalizeClass as Q, renderList as ue } from "vue";
2
2
  import { useRouter as ce } from "vue-router";
3
- import { H, u as W, G as X, O as Z, J as I, A as S } from "./menu-RUcYPH-Z.js";
3
+ import { H, u as W, G as X, O as Z, J as I, A as S } from "./menu-CgDLwNcD.js";
4
4
  import { useI18n as ee, ItemSelector as de, useCoreStore as me } from "@feedmepos/mf-common";
5
5
  import { useSnackbar as ne, components as Y, useDialog as pe, FmButtonVariant as A, useBreakpoints as _e } from "@feedmepos/ui-library";
6
6
  import { _ as fe } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
7
- import { _ as ge, R as ve } from "./app-CHrfSnH-.js";
7
+ import { _ as ge, R as ve } from "./app-CzbgqOf0.js";
8
8
  import { _ as he } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
9
9
  import { c as ye } from "./check-C9mY6LiX.js";
10
10
  import { _ as be } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
11
11
  import { u as ke } from "./search-BAPEUu1R.js";
12
- import { u as xe } from "./app-BST1Ws0Q.js";
12
+ import { u as xe } from "./app-DQQJ_9iV.js";
13
13
  import { c as Se } from "./createComponentProgrammatically-Bt2rn1IQ.js";
14
14
  const Ce = { class: "fm-typo-en-title-md-600" }, qe = { class: "space-y-32 flex flex-col h-full" }, Ee = { class: "flex gap-8 items-center justify-start" }, Ve = /* @__PURE__ */ J({
15
15
  __name: "Form",
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as oe, computed as p, ref as se, watch as ue, watchEffect as ie, resolveComponent as m, createElementBlock as V, openBlock as r, normalizeClass as z, createVNode as s, withCtx as c, createElementVNode as v, createBlock as g, createCommentVNode as k, unref as e, Fragment as D, renderList as B, createTextVNode as re, toDisplayString as N } from "vue";
2
- import { u as me, G as ce, A as f, O as de, B as pe, H as w } from "./menu-RUcYPH-Z.js";
2
+ import { u as me, G as ce, A as f, O as de, B as pe, H as w } from "./menu-CgDLwNcD.js";
3
3
  import { useCoreStore as ve, useI18n as ge } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as fe, useDialog as _e, FmButtonVariant as $, FmButtonColorThemeVariant as P, components as be } from "@feedmepos/ui-library";
5
- import { _ as ye, a as E } from "./customAttributes-laCstc_D.js";
6
- import { _ as H, a as ke } from "./GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-C-xO929R.js";
7
- import { C as _, a as x } from "./catalogSetting-82LtM5qr.js";
8
- import { C as xe } from "./catalog-BRfrkxXk.js";
5
+ import { _ as ye, a as E } from "./customAttributes-nIVPnbIm.js";
6
+ import { _ as H, a as ke } from "./GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-C-ZkWtEg.js";
7
+ import { C as _, a as x } from "./catalogSetting-Cr--_S9s.js";
8
+ import { C as xe } from "./catalog-BUXOgvi0.js";
9
9
  const Ce = {
10
10
  class: /* @__PURE__ */ z(["overflow-scroll", "flex-1", "xs:px-16 xs:py-16", "pt-16"])
11
11
  }, Oe = {
@@ -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-RUcYPH-Z.js";
5
+ import { G as D, u as N, O as A, J as K, A as G } from "./menu-CgDLwNcD.js";
6
6
  import { _ as le } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
7
- import { _ as se } from "./app-CHrfSnH-.js";
7
+ import { _ as se } from "./app-CzbgqOf0.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-CFJE8poU.js";
13
+ import { u as q } from "./subcategory-Dni2F8ro.js";
14
14
  import { _ as de } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
15
- import { a as me } from "./menu-DZ0SKMgS.js";
15
+ import { a as me } from "./menu-CGpVK1Kw.js";
16
16
  const pe = {
17
17
  class: "fm-typo-en-title-md-600"
18
18
  }, _e = {