@feedmepos/mf-menu 0.31.14-beta.1 → 0.31.15-beta.1

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 (58) hide show
  1. package/dist/{App-zFX3uush.js → App-D87EP5SE.js} +6 -6
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CHUFMaWx.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BnthFRoy.js} +2 -2
  3. package/dist/{Catalog-D2FTURpx.js → Catalog-DS4wKymx.js} +5 -5
  4. package/dist/{Category-BmYM9mSA.js → Category-D1TPC-aA.js} +5 -5
  5. package/dist/{Category-Weso_H_Z.js → Category-GbhIPLBW.js} +4 -4
  6. package/dist/{CookingGuide-uJHE_Fb6.js → CookingGuide-C39Ecv1F.js} +3 -3
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Dk5FypdM.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-DUeeVaHx.js} +1 -1
  8. package/dist/{Group-DyJJJzzC.js → Group-BzhEIgZk.js} +1 -1
  9. package/dist/{Group-Br4SVdfw.js → Group-dErNLF6H.js} +3 -3
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-0NLKlLn0.js → Group.vue_vue_type_script_setup_true_lang-BFXGHdMi.js} +7 -7
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B9qitqLz.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B5lGsR6N.js} +3 -3
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-L3eIj10P.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-D24MTd_K.js} +211 -211
  13. package/dist/{Ingredient-C8Gdb9xg.js → Ingredient-laBtGjS5.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DhSZIPOD.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DL8q7CNv.js} +1052 -1052
  15. package/dist/{LinkProductSideSheet-NwwdRb-j.js → LinkProductSideSheet-DX-MRKfp.js} +1 -1
  16. package/dist/{MenuSetting-CKS0c1Kc.js → MenuSetting-BIT1THUu.js} +4 -4
  17. package/dist/{PrintRoute-DLwub8uW.js → PrintRoute-BIvz4aN1.js} +3 -3
  18. package/dist/{Product-DowKo0s7.js → Product-CtfrgVK0.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-DiK-MIBy.js → Product.vue_vue_type_script_setup_true_lang-CvlMJdJf.js} +11 -11
  20. package/dist/{Products-Bn7xaGhh.js → Products-Ds2Yxmxo.js} +511 -511
  21. package/dist/Publish-BOWb-F33.js +569 -0
  22. package/dist/{Recipe-DH_e8MrT.js → Recipe-ul4kMBPm.js} +4 -4
  23. package/dist/{Scheduler-PXidqEyf.js → Scheduler-CoGSCUHZ.js} +3 -3
  24. package/dist/{ServingSequence-DzWaHfwb.js → ServingSequence-BLf6AqJ8.js} +3 -3
  25. package/dist/{Setting-EtztudWO.js → Setting-Du7gpreX.js} +4 -4
  26. package/dist/{Subcategory-DkkEu6gx.js → Subcategory-DTwKpA8u.js} +4 -4
  27. package/dist/{Takeaway-CArF4v3D.js → Takeaway-8xbOp8Xa.js} +1 -1
  28. package/dist/{Takeaway-BP96ZCL2.js → Takeaway-DxgaJnU0.js} +4 -4
  29. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-dOCLq4xp.js → Takeaway.vue_vue_type_script_setup_true_lang-vdmvli1A.js} +5 -5
  30. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DCV9KgmK.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-b9NscJTY.js} +12 -12
  31. package/dist/{Unit-SA3YP3kw.js → Unit-Ap7qpY-q.js} +2 -2
  32. package/dist/{Variant-CzNIvE36.js → Variant-POkEu-3s.js} +3 -3
  33. package/dist/{_id_-8uQ9YdPK.js → _id_--9S7--di.js} +9 -9
  34. package/dist/{app-BolRuPEq.js → app-BFZyK9BE.js} +1 -1
  35. package/dist/{app-My0NMUdz.js → app-CK6ZrpdZ.js} +26 -25
  36. package/dist/app.js +1 -1
  37. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  38. package/dist/assets/{linked-status-CEPycTlk.js → linked-status-CXhE5uCO.js} +2 -2
  39. package/dist/assets/{override-menu-_OICQSvN.js → override-menu-DVX8Orl1.js} +2 -2
  40. package/dist/assets/{validate-menu-yLFq_6YK.js → validate-menu-Di70DZHf.js} +2 -2
  41. package/dist/{catalog--wILrjkl.js → catalog-cJG6G1UU.js} +1 -1
  42. package/dist/{catalogSetting-B_tAzhVc.js → catalogSetting-CXaK7AC0.js} +1 -1
  43. package/dist/{category-csE2-2hB.js → category-RIXHr3i-.js} +1 -1
  44. package/dist/{currency-BDn4uyqM.js → currency-Bh0cQzAv.js} +1 -1
  45. package/dist/{dayjs.min-CEFQW6qP.js → dayjs.min-CeOhrh22.js} +1 -1
  46. package/dist/{index-Ctkjk6Ve.js → index-9k68QbSm.js} +3 -3
  47. package/dist/{index-gHNvvnIH.js → index-BjLVYbeK.js} +2 -2
  48. package/dist/{index-DQvyosax.js → index-CkF36-Yy.js} +1 -1
  49. package/dist/{item-DBg87Y2g.js → item-hh2futyR.js} +14 -14
  50. package/dist/{menu-CnPKcWjf.js → menu-CkxpNa3P.js} +2273 -2273
  51. package/dist/{menu-CcLYdceI.js → menu-b1EX-c7r.js} +1 -1
  52. package/dist/{priceTier-Bofl7Ezb.js → priceTier-_xtW9BQW.js} +1 -1
  53. package/dist/{scheduler-C7vSQnXy.js → scheduler-DpPfzjup.js} +3 -3
  54. package/dist/{subcategory-tMzAqsJC.js → subcategory-CH1FS_Is.js} +36 -36
  55. package/dist/{toExcel-CwKo0jnF.js → toExcel-C808hu94.js} +2 -2
  56. package/dist/{unit-C7iGFlv7.js → unit-Bj_UFAWe.js} +1 -1
  57. package/package.json +1 -1
  58. package/dist/Publish-CpNC0tWj.js +0 -547
@@ -0,0 +1,569 @@
1
+ import { defineComponent as q, ref as $, computed as S, onMounted as ie, resolveComponent as k, createElementBlock as A, openBlock as g, createVNode as n, createElementVNode as o, toDisplayString as I, unref as u, Fragment as P, renderList as H, createBlock as B, withCtx as U, watch as re, createCommentVNode as ce, withModifiers as T, h as Y } from "vue";
2
+ import { D as Z } from "./dayjs.min-CeOhrh22.js";
3
+ import { useRouter as de } from "vue-router";
4
+ import { z as me, H as pe, G as ee, a8 as ve, J as Q, K as fe, u as ge, I as be } from "./menu-CkxpNa3P.js";
5
+ import { useI18n as G, useCoreStore as ae, RestaurantSelector as _e } from "@feedmepos/mf-common";
6
+ import { useSnackbar as te, useDialogChild as he, useDialog as ye, components as X } from "@feedmepos/ui-library";
7
+ import { _ as Ce } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
8
+ import { a as ke, _ as we } from "./app-CK6ZrpdZ.js";
9
+ import { a as xe, w as Ve } from "./tooltip-B5BiPMx9.js";
10
+ import { u as Fe } from "./discardConfirm-BHni0LNu.js";
11
+ import { _ as Se } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
12
+ function le(x) {
13
+ return x ? Z(x).format("DD/MM/YY HH:mm") : "-";
14
+ }
15
+ function Ie(x, V, l) {
16
+ const i = (t, m = !1) => {
17
+ var _;
18
+ return t === void 0 && !m ? "-" : ((_ = l.find((w) => w.value === (t || null))) == null ? void 0 : _.label) || "-";
19
+ };
20
+ return x.map((t) => {
21
+ var d;
22
+ const m = (d = V.find(({ _id: r }) => r === t._id)) == null ? void 0 : d.posVersion, _ = !!m && !!me.Pos.canUse({ feature: pe.F_FEATURE.enum.taxAndServiceChargeV4, posVersion: m }), w = i(t.catalogId);
23
+ return {
24
+ ...t,
25
+ _default: w,
26
+ _posTakeaway: t.takeawayCatalog ? i(t.takeawayCatalog) : w,
27
+ _additionalCatalogs: (t.additionalCatalogs || []).map((r) => i(r)),
28
+ _lastUpdate: le(t.updatedAt),
29
+ _pickup: _ ? i(t.pickupCatalog, !0) : "-",
30
+ _canUsePickup: _,
31
+ _posVersion: m || "-"
32
+ };
33
+ });
34
+ }
35
+ const $e = {
36
+ key: 0,
37
+ class: "flex items-center justify-center"
38
+ }, Ae = {
39
+ key: 1,
40
+ class: "space-y-16"
41
+ }, Re = { class: "text-fm-color-typo-secondary" }, De = { class: "space-y-4" }, Me = /* @__PURE__ */ q({
42
+ __name: "RevertDialog",
43
+ props: {
44
+ restaurant: {}
45
+ },
46
+ setup(x) {
47
+ const V = x, l = te(), { custom: i } = ee(l), t = $(!1), m = $(null);
48
+ async function _() {
49
+ await i(
50
+ async () => {
51
+ var p;
52
+ m.value = await ve.readMenuById(((p = V.restaurant.revertConfig) == null ? void 0 : p._id) || "");
53
+ },
54
+ { isLoading: t }
55
+ );
56
+ }
57
+ const w = S(() => {
58
+ var p;
59
+ return [
60
+ { label: "Main", value: null },
61
+ ...(((p = m.value) == null ? void 0 : p.modules.catalog) || []).map((y) => ({
62
+ label: y.name,
63
+ value: y._id
64
+ }))
65
+ ];
66
+ }), { t: d } = G(), r = S(() => {
67
+ var C;
68
+ const p = V.restaurant.revertConfig;
69
+ if (!p) return [];
70
+ const y = Ie(
71
+ [
72
+ {
73
+ ...p,
74
+ catalogId: p.catalogId || null
75
+ }
76
+ ],
77
+ ae().restaurants.value,
78
+ w.value
79
+ )[0];
80
+ return [
81
+ { label: d("menu.revert.labels.restaurant"), value: V.restaurant.name },
82
+ {
83
+ label: d("menu.revert.labels.revert_to"),
84
+ value: le((C = m.value) == null ? void 0 : C.updatedAt)
85
+ },
86
+ { label: d("menu.revert.labels.default"), value: y._default },
87
+ { label: d("menu.revert.labels.pos_takeaway"), value: y._posTakeaway },
88
+ { label: d("menu.revert.labels.pickup"), value: y._pickup },
89
+ {
90
+ label: d("menu.revert.labels.additional_catalogs"),
91
+ value: y._additionalCatalogs.join(", ")
92
+ }
93
+ ];
94
+ });
95
+ ie(async () => _());
96
+ const { emitData: h } = he();
97
+ return (p, y) => {
98
+ const C = k("FmCircularProgress");
99
+ return t.value ? (g(), A("div", $e, [
100
+ n(C, { size: "lg" })
101
+ ])) : (g(), A("div", Ae, [
102
+ o("div", Re, I(u(d)("menu.revert.description", { name: V.restaurant.name })), 1),
103
+ o("div", De, [
104
+ (g(!0), A(P, null, H(r.value, (R) => (g(), B(xe, {
105
+ key: R.label,
106
+ name: R.label,
107
+ value: R.value || "--"
108
+ }, null, 8, ["name", "value"]))), 128))
109
+ ])
110
+ ]));
111
+ };
112
+ }
113
+ }), Ue = { class: "fm-typo-en-title-md-600" }, Le = { class: "mt-40" }, Pe = { class: "fm-typo-en-title-sm-600" }, Be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4 mb-8" }, Ee = { class: "flex gap-8 items-center justify-start" }, ze = /* @__PURE__ */ q({
114
+ __name: "UpdateCatalogDialog",
115
+ props: {
116
+ catalogs: {
117
+ type: Array,
118
+ required: !0
119
+ }
120
+ },
121
+ emits: ["onComplete"],
122
+ setup(x, { expose: V, emit: l }) {
123
+ const { t: i } = G(), t = x;
124
+ V({
125
+ show: y,
126
+ hide: C
127
+ });
128
+ const m = l;
129
+ function _() {
130
+ return {
131
+ restaurantId: "",
132
+ catalogId: void 0,
133
+ takeawayCatalog: void 0,
134
+ pickupCatalog: null,
135
+ additionalCatalogs: []
136
+ };
137
+ }
138
+ const w = S(() => [
139
+ {
140
+ label: i("menu.publish.update_catalog_dialog.sections.default.use_default"),
141
+ value: null
142
+ },
143
+ ...t.catalogs.map((b) => ({
144
+ label: b.name,
145
+ value: b._id
146
+ }))
147
+ ]), d = S(() => [
148
+ {
149
+ label: i("menu.publish.update_catalog_dialog.sections.default.use_default"),
150
+ value: null
151
+ },
152
+ ...t.catalogs.map((b) => ({
153
+ label: b.name,
154
+ value: b._id
155
+ }))
156
+ ]), r = $(_()), h = $(!1), p = $(void 0);
157
+ function y(b) {
158
+ p.value = b ? Q(b) : _(), r.value = Q(p.value), h.value = !0;
159
+ }
160
+ function C() {
161
+ h.value = !1;
162
+ }
163
+ const R = Fe(
164
+ () => !fe.isEqual(p.value, r.value),
165
+ () => {
166
+ C();
167
+ }
168
+ );
169
+ function j() {
170
+ C(), m("onComplete", r.value);
171
+ }
172
+ return (b, f) => {
173
+ const F = k("FmSelect"), E = k("FmCheckbox"), D = k("FmButton"), z = k("FmSideSheet");
174
+ return g(), B(z, {
175
+ modelValue: h.value,
176
+ "onUpdate:modelValue": f[5] || (f[5] = (v) => h.value = v),
177
+ "max-width": 560,
178
+ "onOn:clickedAway": u(R)
179
+ }, {
180
+ "side-sheet-header": U(() => [
181
+ o("span", Ue, I(u(i)("menu.publish.update_catalog_dialog.title")), 1)
182
+ ]),
183
+ "side-sheet-footer": U(() => [
184
+ o("div", Ee, [
185
+ n(D, {
186
+ label: u(i)("menu.publish.update_catalog_dialog.actions.update"),
187
+ size: "lg",
188
+ variant: "primary",
189
+ onClick: f[4] || (f[4] = () => j())
190
+ }, null, 8, ["label"]),
191
+ n(D, {
192
+ label: u(i)("menu.publish.update_catalog_dialog.actions.cancel"),
193
+ size: "lg",
194
+ variant: "tertiary",
195
+ onClick: C
196
+ }, null, 8, ["label"])
197
+ ])
198
+ ]),
199
+ default: U(() => [
200
+ n(F, {
201
+ modelValue: r.value.catalogId,
202
+ "onUpdate:modelValue": f[0] || (f[0] = (v) => r.value.catalogId = v),
203
+ items: w.value,
204
+ class: "mb-24",
205
+ label: u(i)("menu.publish.update_catalog_dialog.sections.default.label")
206
+ }, null, 8, ["modelValue", "items", "label"]),
207
+ n(F, {
208
+ modelValue: r.value.takeawayCatalog,
209
+ "onUpdate:modelValue": f[1] || (f[1] = (v) => r.value.takeawayCatalog = v),
210
+ items: d.value,
211
+ class: "mb-24",
212
+ label: u(i)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label")
213
+ }, null, 8, ["modelValue", "items", "label"]),
214
+ n(F, {
215
+ modelValue: r.value.pickupCatalog,
216
+ "onUpdate:modelValue": f[2] || (f[2] = (v) => r.value.pickupCatalog = v),
217
+ items: d.value,
218
+ label: u(i)("menu.publish.update_catalog_dialog.sections.pickup.label")
219
+ }, null, 8, ["modelValue", "items", "label"]),
220
+ o("div", Le, [
221
+ o("div", Pe, I(u(i)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
222
+ o("div", Be, I(u(i)("menu.publish.update_catalog_dialog.sections.additional.subtitle")), 1),
223
+ (g(!0), A(P, null, H(x.catalogs, (v) => (g(), A("div", {
224
+ key: v._id
225
+ }, [
226
+ n(E, {
227
+ modelValue: r.value.additionalCatalogs,
228
+ "onUpdate:modelValue": f[3] || (f[3] = (L) => r.value.additionalCatalogs = L),
229
+ label: v.name,
230
+ value: v._id
231
+ }, null, 8, ["modelValue", "label", "value"])
232
+ ]))), 128))
233
+ ])
234
+ ]),
235
+ _: 1
236
+ }, 8, ["modelValue", "onOn:clickedAway"]);
237
+ };
238
+ }
239
+ }), Ke = {
240
+ class: "flex flex-col p-24 bg-fm-color-neutral-white min-h-[calc(100dvh-56px)] xs:max-h-[calc(100dvh-56px)]"
241
+ }, Ne = {
242
+ class: "flex items-center xs:mb-8 mb-24"
243
+ }, Oe = {
244
+ class: "mr-8"
245
+ }, Te = {
246
+ class: "fm-typo-en-title-md-600"
247
+ }, je = {
248
+ class: "xs:hidden"
249
+ }, Ye = {
250
+ class: "pb-8 flex justify-between xs:flex-col gap-8"
251
+ }, qe = {
252
+ class: "grow flex flex-col gap-4"
253
+ }, He = {
254
+ class: "flex gap-8 items-center"
255
+ }, Ge = {
256
+ class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary"
257
+ }, Je = {
258
+ class: "space-y-4"
259
+ }, We = {
260
+ class: "fm-typo-en-body-lg-600"
261
+ }, Qe = {
262
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
263
+ }, Xe = {
264
+ class: "flex gap-8"
265
+ }, Ze = {
266
+ class: "xs:block hidden fixed bottom-72 right-16"
267
+ }, da = /* @__PURE__ */ q({
268
+ __name: "Publish",
269
+ setup(x) {
270
+ const V = de(), {
271
+ t: l
272
+ } = G(), i = ae(), t = ge(), m = $(!0);
273
+ re(() => {
274
+ var e;
275
+ return (e = i.currentBusiness.value) == null ? void 0 : e._id;
276
+ }, async (e, a) => {
277
+ if (!(!e || e === a)) {
278
+ m.value = !0;
279
+ try {
280
+ await t.readRestaurants();
281
+ } catch (c) {
282
+ console.error("Failed to load restaurants:", c);
283
+ } finally {
284
+ m.value = !1;
285
+ }
286
+ }
287
+ }, {
288
+ immediate: !0
289
+ });
290
+ const _ = (e) => t.state.menu.updatedAt === e.updatedAt, w = ({
291
+ row: e
292
+ }) => {
293
+ const a = _(e);
294
+ return n(Ce, {
295
+ label: l(a ? "menu.publish.table.status.latest" : "menu.publish.table.status.outdated"),
296
+ variant: a ? "success" : "warning"
297
+ }, null);
298
+ }, d = $({}), r = [{
299
+ accessorKey: "name",
300
+ header: () => l("menu.publish.table.columns.restaurant"),
301
+ cell: (e) => e.getValue(),
302
+ enableSorting: !0
303
+ }, {
304
+ accessorKey: "catalog",
305
+ header: () => l("menu.publish.table.columns.default"),
306
+ enableSorting: !1,
307
+ cell: (e) => e.getValue().default
308
+ }, {
309
+ accessorKey: "catalog",
310
+ header: () => l("menu.publish.table.columns.pos_takeaway"),
311
+ enableSorting: !1,
312
+ cell: (e) => e.getValue().takeaway
313
+ }, {
314
+ accessorKey: "catalog",
315
+ header: () => l("menu.publish.table.columns.pickup"),
316
+ enableSorting: !1,
317
+ cell: (e) => e.getValue().pickup
318
+ }, {
319
+ accessorKey: "updatedAt",
320
+ header: () => l("menu.publish.table.columns.version"),
321
+ enableSorting: !1,
322
+ cell: (e) => {
323
+ const a = e.getValue();
324
+ return b(a);
325
+ }
326
+ }, {
327
+ accessorKey: "status",
328
+ header: () => l("menu.common.labels.status"),
329
+ enableSorting: !1,
330
+ size: 80,
331
+ cell: (e) => n(w, {
332
+ row: e.row.original
333
+ }, null)
334
+ }, {
335
+ accessorKey: "_id",
336
+ header: "",
337
+ size: 52,
338
+ enableSorting: !1,
339
+ cell: (e) => {
340
+ const a = e.row.original;
341
+ return Y("div", {
342
+ class: "flex justify-end gap-8"
343
+ }, [C.value && a.revertConfig ? Ve(Y(X.FmButton, {
344
+ prependIcon: "undo",
345
+ variant: "secondary",
346
+ onClick: T(async () => {
347
+ await R(e.row.original);
348
+ }, ["stop", "prevent"])
349
+ }), l("menu.publish.actions.revert")) : null, Y(X.FmButton, {
350
+ label: l("menu.publish.actions.publish"),
351
+ icon: "ios_share",
352
+ variant: "secondary",
353
+ onClick: T(async () => {
354
+ const c = D(e.row.original);
355
+ await L(c);
356
+ }, ["stop", "prevent"])
357
+ })]);
358
+ },
359
+ meta: {
360
+ width: "150px"
361
+ }
362
+ }], h = $(""), p = $(), y = ye(), C = S(() => t.version !== be.F_MENU_VERSION.enum.v3);
363
+ async function R(e) {
364
+ e.revertConfig && y.open({
365
+ title: "Revert menu",
366
+ contentComponent: Me,
367
+ contentComponentProps: {
368
+ restaurant: e
369
+ },
370
+ primaryActions: {
371
+ text: "Revert",
372
+ close: !0
373
+ },
374
+ secondaryActions: {
375
+ text: "Cancel",
376
+ close: !0
377
+ }
378
+ }).onPrimary(async () => {
379
+ await v.minor(async () => {
380
+ await t.revertRestaurantMenu(e._id);
381
+ }, {
382
+ customId: e._id,
383
+ message: `Revert menu of ${e.name}`
384
+ });
385
+ });
386
+ }
387
+ const j = S(() => l("menu.publish.labels.main_version", {
388
+ version: b(t.state.menu.updatedAt)
389
+ }));
390
+ function b(e) {
391
+ return e ? Z(e).format("DD/MM/YYYY hh:mmA") : "";
392
+ }
393
+ const f = S(() => t.state.menu.modules.catalog), F = S(() => v.queue.value.some((e) => e.id === t.state.menu._id));
394
+ function E(e) {
395
+ var a;
396
+ return e ? ((a = f.value.find((c) => c._id === e)) == null ? void 0 : a.name) ?? l("menu.publish.labels.catalog.invalid") : l("menu.publish.labels.catalog.main");
397
+ }
398
+ function D(e) {
399
+ return {
400
+ restaurantId: e._id,
401
+ catalogId: e.catalogId,
402
+ takeawayCatalog: e.takeawayCatalog,
403
+ pickupCatalog: e.pickupCatalog || null,
404
+ additionalCatalogs: e.additionalCatalogs
405
+ };
406
+ }
407
+ function z(e) {
408
+ var c;
409
+ const a = D(e);
410
+ (c = p.value) == null || c.show(a);
411
+ }
412
+ const v = ee(te());
413
+ async function L(e) {
414
+ var c;
415
+ const a = (c = M.value.find((N) => N._id === e.restaurantId)) == null ? void 0 : c.name;
416
+ await v.minor(async () => await t.publishMenu(e), {
417
+ customId: t.state.menu._id,
418
+ message: `Publishing menu for ${a}`,
419
+ successMessage: `Published to ${a}`
420
+ });
421
+ }
422
+ const K = $(null), M = S(() => t.state.restaurants.filter((e) => {
423
+ var a;
424
+ return !K.value || ((a = K.value) == null ? void 0 : a.includes(e._id));
425
+ }).map((e) => ({
426
+ ...e,
427
+ catalog: {
428
+ default: E(e.catalogId),
429
+ takeaway: E(e.takeawayCatalog),
430
+ pickup: E(e.pickupCatalog)
431
+ }
432
+ }))), oe = S(() => {
433
+ const e = h.value.toLowerCase();
434
+ return M.value.filter(({
435
+ name: a,
436
+ catalog: c
437
+ }) => a.toLowerCase().includes(e) || c.default.toLowerCase().includes(e) || c.takeaway.toLowerCase().includes(e) || c.pickup.toLowerCase().includes(e));
438
+ });
439
+ async function J() {
440
+ if (F.value) return;
441
+ const e = Object.keys(d.value).map(Number).filter((a) => d.value[a]);
442
+ if (e.length === 0 || e.length === M.value.length)
443
+ await v.minor(async () => await t.publishAllMenu(), {
444
+ customId: t.state.menu._id
445
+ });
446
+ else
447
+ for (const a of e) {
448
+ const c = M.value[a];
449
+ await L(D(c));
450
+ }
451
+ }
452
+ return (e, a) => {
453
+ const c = k("FmChip"), N = k("FmSpacer"), O = k("FmButton"), W = k("FmSearch"), ne = k("FmTable"), se = k("FmListItem"), ue = k("FmList");
454
+ return g(), A(P, null, [o("div", Ke, [o("div", Ne, [o("div", Oe, [o("div", Te, I(u(l)("menu.publish.title")), 1), a[7] || (a[7] = o("div", {
455
+ class: "hidden xs:block fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
456
+ }, null, -1))]), n(c, {
457
+ label: j.value,
458
+ class: "xs:hidden text-fm-color-primary bg-fm-color-system-warning-100"
459
+ }, null, 8, ["label"]), n(N), o("div", je, [n(O, {
460
+ disabled: F.value || m.value,
461
+ icon: "ios_share",
462
+ label: u(l)("menu.publish.actions.publish_all"),
463
+ variant: "primary",
464
+ onClick: a[0] || (a[0] = () => J())
465
+ }, null, 8, ["disabled", "label"])])]), m.value ? (g(), B(ke, {
466
+ key: 0
467
+ })) : (g(), A(P, {
468
+ key: 1
469
+ }, [o("div", Ye, [n(u(_e), {
470
+ multiple: "",
471
+ modelValue: K.value,
472
+ "onUpdate:modelValue": a[2] || (a[2] = (s) => K.value = s)
473
+ }, {
474
+ "append-right": U(() => [n(N, {
475
+ class: "xs:hidden"
476
+ }), n(W, {
477
+ modelValue: h.value,
478
+ "onUpdate:modelValue": a[1] || (a[1] = (s) => h.value = s),
479
+ autofocus: "",
480
+ class: "w-[320px] xs:hidden",
481
+ placeholder: u(l)("menu.publish.table.search.placeholder")
482
+ }, null, 8, ["modelValue", "placeholder"])]),
483
+ _: 1
484
+ }, 8, ["modelValue"]), n(W, {
485
+ modelValue: h.value,
486
+ "onUpdate:modelValue": a[3] || (a[3] = (s) => h.value = s),
487
+ autofocus: "",
488
+ class: "w-full xs:block hidden",
489
+ placeholder: u(l)("menu.publish.table.search.placeholder")
490
+ }, null, 8, ["modelValue", "placeholder"])]), M.value.length > 0 ? (g(), A(P, {
491
+ key: 0
492
+ }, [n(we, {
493
+ class: "xs:hidden block"
494
+ }, {
495
+ default: U(() => [n(ne, {
496
+ modelValue: d.value,
497
+ "onUpdate:modelValue": a[4] || (a[4] = (s) => d.value = s),
498
+ "column-defs": r,
499
+ loading: F.value,
500
+ "page-size": M.value.length,
501
+ "row-data": M.value,
502
+ "search-value": h.value,
503
+ shrinkAt: !1,
504
+ selection: "multiple",
505
+ "hide-footer": "",
506
+ "pin-header-row": "",
507
+ onRowClick: a[5] || (a[5] = (s) => z(s.original))
508
+ }, null, 8, ["modelValue", "loading", "page-size", "row-data", "search-value"])]),
509
+ _: 1
510
+ }), n(ue, {
511
+ class: "flex-col flex-1 min-h-0 overflow-auto xs:flex hidden w-full pb-64",
512
+ separator: ""
513
+ }, {
514
+ default: U(() => [(g(!0), A(P, null, H(oe.value, (s) => (g(), B(se, {
515
+ key: s._id,
516
+ label: s.name,
517
+ style: {
518
+ padding: "12px 0 !important"
519
+ },
520
+ onClick: () => z(s)
521
+ }, {
522
+ default: U(() => [o("div", qe, [o("div", He, [o("div", Ge, I(b(s.updatedAt)), 1), n(w, {
523
+ row: s
524
+ }, null, 8, ["row"])]), o("div", Je, [o("div", We, I(s.name), 1), o("div", Qe, [o("div", null, "Default: " + I(s.catalog.default), 1), o("div", null, "POS takeaway: " + I(s.catalog.takeaway), 1), o("div", null, "Pickup: " + I(s.catalog.pickup), 1)])])]), o("div", Xe, [C.value && s.revertConfig ? (g(), B(O, {
525
+ key: 0,
526
+ disabled: F.value,
527
+ icon: "undo",
528
+ variant: "tertiary",
529
+ onClick: T(() => R(s), ["stop"])
530
+ }, null, 8, ["disabled", "onClick"])) : ce("", !0), n(O, {
531
+ disabled: F.value,
532
+ icon: "ios_share",
533
+ variant: "tertiary",
534
+ onClick: T(() => L(D(s)), ["stop"])
535
+ }, null, 8, ["disabled", "onClick"])])]),
536
+ _: 2
537
+ }, 1032, ["label", "onClick"]))), 128))]),
538
+ _: 1
539
+ })], 64)) : (g(), B(u(Se), {
540
+ key: 1,
541
+ title: u(l)("menu.publish.empty.title"),
542
+ subtitle: u(l)("menu.publish.empty.subtitle"),
543
+ action: {
544
+ text: u(l)("menu.publish.empty.action"),
545
+ icon: "add",
546
+ callback: () => {
547
+ u(V).push({
548
+ name: "$settings-my-business"
549
+ });
550
+ }
551
+ }
552
+ }, null, 8, ["title", "subtitle", "action"]))], 64))]), o("div", Ze, [n(O, {
553
+ disabled: F.value || m.value,
554
+ icon: "ios_share",
555
+ label: u(l)("menu.publish.actions.publish_all"),
556
+ variant: "fab",
557
+ onClick: a[6] || (a[6] = () => J())
558
+ }, null, 8, ["disabled", "label"])]), n(ze, {
559
+ ref_key: "updateCatalogDialogRef",
560
+ ref: p,
561
+ catalogs: f.value,
562
+ onOnComplete: L
563
+ }, null, 8, ["catalogs"])], 64);
564
+ };
565
+ }
566
+ });
567
+ export {
568
+ da as default
569
+ };
@@ -2,15 +2,15 @@ import { defineComponent as K, 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-My0NMUdz.js";
6
- import { Q as q, G as $, J as ie, A as P, K as se, H as Y, M as O, I as T, u as H } from "./menu-CnPKcWjf.js";
5
+ import { _ as le } from "./app-CK6ZrpdZ.js";
6
+ import { Q as q, G as $, J as ie, A as P, K as se, H as Y, M as O, I as T, u as H } from "./menu-CkxpNa3P.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-DhSZIPOD.js";
10
+ import { _ as B, g as me } from "./InventoryBinding.vue_vue_type_script_setup_true_lang-DL8q7CNv.js";
11
11
  import { u as de } from "./discardConfirm-BHni0LNu.js";
12
12
  import { c as pe } from "./check-C9mY6LiX.js";
13
- import "./unit-C7iGFlv7.js";
13
+ import "./unit-Bj_UFAWe.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__ */ K({
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 I, createElementVNode as l, renderList as T, toDisplayString as S, createCommentVNode as H } from "vue";
2
- import { I as i, Q as W, u as Q, G } from "./menu-CnPKcWjf.js";
2
+ import { I as i, Q as W, u as Q, G } from "./menu-CkxpNa3P.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-My0NMUdz.js";
7
- import { d as ae, _ as oe, u as se, c as le } from "./scheduler-C7vSQnXy.js";
6
+ import { _ as ne } from "./app-CK6ZrpdZ.js";
7
+ import { d as ae, _ as oe, u as se, c as le } from "./scheduler-DpPfzjup.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 Q, ref as I, computed as L, 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 A, 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 H, renderList as ue } from "vue";
2
2
  import { useRouter as ce } from "vue-router";
3
- import { J, u as W, G as X, Q as Z, M as O, I as S } from "./menu-CnPKcWjf.js";
3
+ import { J, u as W, G as X, Q as Z, M as O, I as S } from "./menu-CkxpNa3P.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 T, 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-My0NMUdz.js";
7
+ import { _ as ge, R as ve } from "./app-CK6ZrpdZ.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-BolRuPEq.js";
12
+ import { u as xe } from "./app-BFZyK9BE.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__ */ Q({
15
15
  __name: "Form",
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as ue, computed as p, ref as P, watch as ie, watchEffect as re, resolveComponent as m, createElementBlock as M, openBlock as r, normalizeClass as G, createVNode as s, withCtx as c, createElementVNode as g, createBlock as v, createCommentVNode as f, unref as e, Fragment as $, renderList as z, createTextVNode as me, toDisplayString as N } from "vue";
2
- import { u as ce, G as de, Q as pe, I as _, z as ve, J as w } from "./menu-CnPKcWjf.js";
2
+ import { u as ce, G as de, Q as pe, I as _, z as ve, J as w } from "./menu-CkxpNa3P.js";
3
3
  import { useCoreStore as ge, useI18n as fe } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as _e, useDialog as be, FmButtonVariant as H, FmButtonColorThemeVariant as J, components as ye } from "@feedmepos/ui-library";
5
5
  import { _ as E } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
6
6
  import { _ as ke } from "./FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js";
7
- import { _ as j, a as xe } from "./GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B9qitqLz.js";
8
- import { C as b, a as x } from "./catalogSetting-B_tAzhVc.js";
9
- import { C as q } from "./catalog--wILrjkl.js";
7
+ import { _ as j, a as xe } from "./GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B5lGsR6N.js";
8
+ import { C as b, a as x } from "./catalogSetting-CXaK7AC0.js";
9
+ import { C as q } from "./catalog-cJG6G1UU.js";
10
10
  const Ce = {
11
11
  class: /* @__PURE__ */ G(["overflow-scroll", "flex-1", "xs:px-16 xs:py-16"])
12
12
  }, Oe = {
@@ -2,17 +2,17 @@ import { defineComponent as L, ref as w, watch as W, resolveComponent as y, crea
2
2
  import { useI18n as B } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as O, components as j, useDialog as Y, FmButtonVariant as R, 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, Q as U, M as K, I as G } from "./menu-CnPKcWjf.js";
5
+ import { G as D, u as N, Q as U, M as K, I as G } from "./menu-CkxpNa3P.js";
6
6
  import { _ as le } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
7
- import { _ as se } from "./app-My0NMUdz.js";
7
+ import { _ as se } from "./app-CK6ZrpdZ.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 z } 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 { a as q } from "./subcategory-tMzAqsJC.js";
13
+ import { a as q } from "./subcategory-CH1FS_Is.js";
14
14
  import { _ as de } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
15
- import { a as me } from "./menu-CcLYdceI.js";
15
+ import { a as me } from "./menu-b1EX-c7r.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-dOCLq4xp.js";
1
+ import { _ as f } from "./Takeaway.vue_vue_type_script_setup_true_lang-vdmvli1A.js";
2
2
  export {
3
3
  f as default
4
4
  };