@feedmepos/mf-menu 0.32.17 → 0.32.18-dev.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 (82) hide show
  1. package/dist/App-Cfl37TTw.js +152661 -0
  2. package/dist/{Catalog-ChlP8Cid.js → Catalog-Yxsb-D33.js} +47 -52
  3. package/dist/{Category-CHs96ibF.js → Category-0vJH8Ct0.js} +86 -92
  4. package/dist/{Category-B1tAJpNd.js → Category-qp0wI14I.js} +25 -26
  5. package/dist/{CookingGuide-mEvca-0v.js → CookingGuide-EpAr5F5U.js} +139 -143
  6. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Bk26jQI7.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CkyD0sdI.js} +14 -16
  7. package/dist/{Group-Ye2IIY52.js → Group-B3W9iSbO.js} +5 -5
  8. package/dist/{Group-Co2Vf4Lw.js → Group-DLCh0fDU.js} +1 -1
  9. package/dist/{Group.vue_vue_type_script_setup_true_lang-BcxSbvJS.js → Group.vue_vue_type_script_setup_true_lang-Bzy_hXDv.js} +176 -186
  10. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D1f8VG-n.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BFaAXp7r.js} +81 -88
  11. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Jv6iJlg9.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-CxP8lDD0.js} +2502 -2508
  12. package/dist/{Ingredient-BgnW8sWo.js → Ingredient-CVLMr_YB.js} +102 -105
  13. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-8ziHcUiK.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CdTC5ykI.js} +1058 -1059
  14. package/dist/{MenuSetting-GEngjeC8.js → MenuSetting-Blpi1vSd.js} +58 -61
  15. package/dist/{PrintRoute-BSlUQT7g.js → PrintRoute-BS7PPPkE.js} +49 -52
  16. package/dist/{Product-DNg_BUuV.js → Product-DDeNKQ7u.js} +1 -1
  17. package/dist/{Product.vue_vue_type_script_setup_true_lang-Cehy2oy-.js → Product.vue_vue_type_script_setup_true_lang-rmv8m4_D.js} +286 -298
  18. package/dist/{ProductInternalTools-B5A67yxH.js → ProductInternalTools-CVuothk9.js} +45 -46
  19. package/dist/{Products-DCsxmTPB.js → Products-BIvsHKEt.js} +111 -116
  20. package/dist/{Publish-Cst0Ll6T.js → Publish-CDADU3Pp.js} +154 -159
  21. package/dist/{Recipe-DupS3SQT.js → Recipe-CMhW7e_z.js} +40 -43
  22. package/dist/{Scheduler-BcThU1M6.js → Scheduler-BpxunKBV.js} +7 -7
  23. package/dist/{ServingSequence-CT3THBH6.js → ServingSequence-BQVuYyAB.js} +54 -58
  24. package/dist/{Setting-Dxh8E3no.js → Setting-Dj0yyP37.js} +63 -66
  25. package/dist/{Subcategory-DhJEzofz.js → Subcategory-BH4DDZM4.js} +72 -76
  26. package/dist/{Takeaway-DSC7U4Jk.js → Takeaway-CGJBZ_sJ.js} +1 -1
  27. package/dist/{Takeaway-B8BSSKNj.js → Takeaway-DifOudVE.js} +20 -21
  28. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-BLpiJlk2.js → Takeaway.vue_vue_type_script_setup_true_lang-D-R5_S5G.js} +59 -64
  29. package/dist/{Unit-joU7vZZu.js → Unit-DXDox2Ut.js} +8 -8
  30. package/dist/{Variant-D8YjRJ6N.js → Variant-DbJVwgm5.js} +75 -78
  31. package/dist/{_id_-Bd9uo1WW.js → _id_-RFYwWjbM.js} +34 -38
  32. package/dist/{app-BNrAos5Z.js → app-Z0KWH9-d.js} +74 -335
  33. package/dist/app.js +4 -5
  34. package/dist/apps/mf-menu/src/app.d.ts +1 -2
  35. package/dist/apps/mf-menu/src/helper/import-export-utils.d.ts +1 -0
  36. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  37. package/dist/assets/{linked-status-DbjzbFTw.js → linked-status-CkmoJAm-.js} +2 -2
  38. package/dist/assets/{menu-export-D_oNY_wi.js → menu-export-DcINiK28.js} +3 -3
  39. package/dist/assets/{override-menu-CIU7U1_4.js → override-menu-PUKiu-df.js} +2 -2
  40. package/dist/assets/{validate-menu-kuOxuwG9.js → validate-menu-CcqiRhNT.js} +2 -2
  41. package/dist/{catalogSetting-BHgsBDTl.js → catalogSetting-Bf66H-j7.js} +1 -1
  42. package/dist/dayjs.min-DNPTnUFp.js +6 -0
  43. package/dist/{jszip.min-7SsHzD5O.js → jszip.min-CO2_Gf69.js} +545 -545
  44. package/dist/{menu-Cd4NbFVq.js → menu-Brxar171.js} +1 -1
  45. package/dist/mf-menu.css +1 -1
  46. package/dist/{scheduler-B6OokVIA.js → scheduler-CqdIiE8G.js} +56 -60
  47. package/dist/{toExcel-BZkbXlHv.js → toExcel-CRJIU0NC.js} +2 -2
  48. package/dist/{unit-D6QOkMoM.js → unit-wYPYkm33.js} +98 -105
  49. package/package.json +1 -1
  50. package/dist/App-BiSEuDkd.js +0 -13484
  51. package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-C_SjdLpO.js +0 -161
  52. package/dist/FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js +0 -26
  53. package/dist/LinkProductSideSheet-DFDYEUBh.js +0 -687
  54. package/dist/MenuSelector.vue_vue_type_script_setup_true_lang-K6Z0QJBl.js +0 -69
  55. package/dist/RuleView.vue_vue_type_script_setup_true_lang-BeesK2ym.js +0 -3285
  56. package/dist/TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js +0 -20
  57. package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-C3qXnZlz.js +0 -399
  58. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CMe76XvZ.js +0 -6011
  59. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  60. package/dist/app-5fxKLAzS.js +0 -8163
  61. package/dist/app-nTzkERJW.js +0 -68
  62. package/dist/catalog-BO2nXwe5.js +0 -199
  63. package/dist/category-CuG3DsGL.js +0 -156
  64. package/dist/check-C9mY6LiX.js +0 -9
  65. package/dist/createComponentProgrammatically-Bt2rn1IQ.js +0 -11
  66. package/dist/currency-DxC5zyZB.js +0 -7
  67. package/dist/dayjs.min-BvFUSPWD.js +0 -6
  68. package/dist/discardConfirm-BHni0LNu.js +0 -28
  69. package/dist/index-B0nhvuxR.js +0 -273
  70. package/dist/index-C2zPvt64.js +0 -239
  71. package/dist/index-C36JQix-.js +0 -246
  72. package/dist/index-CisutoS9.js +0 -156
  73. package/dist/index.vue_vue_type_script_setup_true_lang-DCBYExNb.js +0 -109064
  74. package/dist/item-K01xd1Z0.js +0 -6868
  75. package/dist/menuV2-DKE-xanq.js +0 -1052
  76. package/dist/object-DVUNCr7w.js +0 -16
  77. package/dist/priceTier-Beavb91W.js +0 -87
  78. package/dist/search-BAPEUu1R.js +0 -15
  79. package/dist/string-DpfFixWH.js +0 -4
  80. package/dist/subcategory-DnslmmRD.js +0 -148
  81. package/dist/tooltip-B5BiPMx9.js +0 -32
  82. package/dist/vuedraggable-CK8z7qA8.js +0 -1728
@@ -1,12 +1,11 @@
1
- import { defineComponent as Z, ref as v, computed as $, resolveComponent as G, createElementBlock as c, openBlock as r, createElementVNode as s, createVNode as I, unref as h, createCommentVNode as T, normalizeClass as E, toDisplayString as U, createStaticVNode as B, Fragment as P, renderList as O, createBlock as oe, withCtx as R } from "vue";
2
- import { J as A, F as ne } from "./jszip.min-7SsHzD5O.js";
3
- import { G as le, u as ie, J as D, a1 as re, N as ce, O as de, P as me } from "./index.vue_vue_type_script_setup_true_lang-DCBYExNb.js";
4
- import { useI18n as ue } from "@feedmepos/mf-common";
5
- import { FmButtonVariant as z, useSnackbar as V, useDialog as ge, FmButtonColorThemeVariant as M } from "@feedmepos/ui-library";
6
- import { _ as pe } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
7
- import { u as fe, a as he } from "./menu-Cd4NbFVq.js";
8
- import { a as ye } from "./Product.vue_vue_type_script_setup_true_lang-Cehy2oy-.js";
9
- import { t as be, v as ve, w as _e } from "./item-K01xd1Z0.js";
1
+ import { defineComponent as Z, ref as v, computed as $, resolveComponent as W, createElementBlock as c, openBlock as r, createElementVNode as s, createVNode as I, unref as h, createCommentVNode as T, normalizeClass as E, toDisplayString as U, createStaticVNode as B, Fragment as P, renderList as R, createBlock as oe, withCtx as A } from "vue";
2
+ import { J as O, F as ne } from "./jszip.min-CO2_Gf69.js";
3
+ import { a as le, u as ie, n as D, r as re, s as ce, t as de, v as me, w as ue, x as ge, y as pe } from "./App-Cfl37TTw.js";
4
+ import { useI18n as fe } from "@feedmepos/mf-common";
5
+ import { FmButtonVariant as z, useSnackbar as V, useDialog as he, FmButtonColorThemeVariant as M } from "@feedmepos/ui-library";
6
+ import { _ as ye } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
7
+ import { u as be, a as ve } from "./menu-Brxar171.js";
8
+ import { a as _e } from "./Product.vue_vue_type_script_setup_true_lang-rmv8m4_D.js";
10
9
  const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center justify-between p-16 border-b border-gray-200" }, Ie = { class: "flex gap-8" }, ke = { class: "border-b border-gray-200" }, Ce = { class: "flex" }, Ue = { class: "flex-1 overflow-hidden" }, je = {
11
10
  key: 0,
12
11
  class: "h-full flex flex-col"
@@ -19,16 +18,16 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
19
18
  }, Me = { class: "space-y-12" }, $e = { class: "fm-typo-en-body-sm font-medium" }, ze = { class: "flex" }, Pe = { class: "w-64 h-64 bg-gray-100 rounded-8 overflow-hidden flex items-center justify-center" }, Le = ["src", "alt"], Ne = {
20
19
  key: 1,
21
20
  class: "text-gray-400 text-xs"
22
- }, Te = { class: "flex" }, Ee = { class: "w-64 h-64 bg-gray-100 rounded-8 overflow-hidden" }, Be = ["src", "alt"], Oe = {
21
+ }, Te = { class: "flex" }, Ee = { class: "w-64 h-64 bg-gray-100 rounded-8 overflow-hidden" }, Be = ["src", "alt"], Re = {
23
22
  key: 1,
24
23
  class: "h-full flex flex-col"
25
- }, Re = {
24
+ }, Ae = {
26
25
  key: 0,
27
26
  class: "flex-1 flex items-center justify-center"
28
- }, Ae = {
27
+ }, Oe = {
29
28
  key: 1,
30
29
  class: "flex-1 overflow-y-auto p-16"
31
- }, De = { class: "space-y-12" }, Ve = { class: "fm-typo-en-body-sm font-medium break-all" }, Ze = { class: "flex" }, Ge = { class: "w-64 h-64 bg-gray-100 rounded-8 overflow-hidden" }, Je = ["src", "alt"], We = /* @__PURE__ */ Z({
30
+ }, De = { class: "space-y-12" }, Ve = { class: "fm-typo-en-body-sm font-medium break-all" }, Ze = { class: "flex" }, We = { class: "w-64 h-64 bg-gray-100 rounded-8 overflow-hidden" }, qe = ["src", "alt"], Ge = /* @__PURE__ */ Z({
32
31
  __name: "ImageUpdatePreview",
33
32
  props: {
34
33
  matchedImages: {},
@@ -44,7 +43,7 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
44
43
  F("update", u.matchedImages);
45
44
  }
46
45
  return (w, l) => {
47
- const x = G("fm-button");
46
+ const x = W("fm-button");
48
47
  return r(), c("div", we, [
49
48
  s("div", xe, [
50
49
  l[2] || (l[2] = s("h2", { class: "fm-typo-en-headline-sm font-semibold" }, "Update Product Images", -1)),
@@ -92,7 +91,7 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
92
91
  s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "New Image")
93
92
  ], -1)),
94
93
  s("div", Me, [
95
- (r(!0), c(P, null, O(u.matchedImages, (m, C) => (r(), c("div", {
94
+ (r(!0), c(P, null, R(u.matchedImages, (m, C) => (r(), c("div", {
96
95
  key: C,
97
96
  class: "grid grid-cols-3 gap-16 py-12 border-b border-gray-100 items-center"
98
97
  }, [
@@ -119,27 +118,27 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
119
118
  ]))), 128))
120
119
  ])
121
120
  ]))
122
- ])) : y.value === "unmatched" ? (r(), c("div", Oe, [
123
- k.value === 0 ? (r(), c("div", Re, l[5] || (l[5] = [
121
+ ])) : y.value === "unmatched" ? (r(), c("div", Re, [
122
+ k.value === 0 ? (r(), c("div", Ae, l[5] || (l[5] = [
124
123
  B('<div class="text-center text-gray-500"><svg class="mx-auto h-48 w-48 text-gray-400 mb-16" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg><p class="fm-typo-en-body-lg text-gray-500">All images matched!</p><p class="fm-typo-en-body-sm text-gray-400 mt-4">No unmatched images found</p></div>', 1)
125
- ]))) : (r(), c("div", Ae, [
124
+ ]))) : (r(), c("div", Oe, [
126
125
  l[6] || (l[6] = s("div", { class: "grid grid-cols-2 gap-16 pb-12 border-b border-gray-200 mb-16" }, [
127
126
  s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "Filename"),
128
127
  s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "Image")
129
128
  ], -1)),
130
129
  s("div", De, [
131
- (r(!0), c(P, null, O(u.unmatchedImages, (m, C) => (r(), c("div", {
130
+ (r(!0), c(P, null, R(u.unmatchedImages, (m, C) => (r(), c("div", {
132
131
  key: C,
133
132
  class: "grid grid-cols-2 gap-16 py-12 border-b border-gray-100 items-center"
134
133
  }, [
135
134
  s("div", Ve, U(m.filename), 1),
136
135
  s("div", Ze, [
137
- s("div", Ge, [
136
+ s("div", We, [
138
137
  s("img", {
139
138
  src: m.imageUrl,
140
139
  alt: m.filename,
141
140
  class: "w-full h-full object-cover"
142
- }, null, 8, Je)
141
+ }, null, 8, qe)
143
142
  ])
144
143
  ])
145
144
  ]))), 128))
@@ -151,32 +150,32 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
151
150
  };
152
151
  }
153
152
  });
154
- var qe = { firebase: { storageBucket: "image.feedme.cc" } };
153
+ var Je = { firebase: { storageBucket: "image.feedmedev.cc" } };
155
154
  const He = {
156
155
  key: 0,
157
156
  class: "h-screen"
158
- }, Xe = { class: "flex-1 flex justify-between gap-8 pl-8" }, Ke = { class: "flex items-center" }, Qe = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ye = { class: "fm-typo-en-body-md-600 font-semibold" }, et = { class: "flex gap-8" }, dt = /* @__PURE__ */ Z({
157
+ }, Xe = { class: "flex-1 flex justify-between gap-8 pl-8" }, Ke = { class: "flex items-center" }, Qe = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ye = { class: "fm-typo-en-body-md-600 font-semibold" }, et = { class: "flex gap-8" }, ct = /* @__PURE__ */ Z({
159
158
  __name: "ProductInternalTools",
160
159
  setup(L) {
161
- const { t: j } = ue(), u = le(V()), F = V(), y = ge(), b = ie(), { selectedCategories: k } = fe(), _ = v(!1), S = v(), w = v([]), l = v([]), x = $(() => {
160
+ const { t: j } = fe(), u = le(V()), F = V(), y = he(), b = ie(), { selectedCategories: k } = be(), _ = v(!1), S = v(), w = v([]), l = v([]), x = $(() => {
162
161
  const e = D.flatten(k.value.map((a) => a.items));
163
162
  return D.uniqBy(e, (a) => a._id);
164
163
  }), m = $(() => x.value.length);
165
164
  async function C(e, a) {
166
- return await _e(e, {
165
+ return await me(e, {
167
166
  withTimestamp: !0,
168
167
  filename: a
169
168
  });
170
169
  }
171
- async function J(e, a = "images.zip") {
172
- const o = new A();
170
+ async function q(e, a = "images.zip") {
171
+ const o = new O();
173
172
  e.forEach(({ blob: d, filename: n }) => {
174
173
  d && o.file(n, d);
175
174
  });
176
175
  const g = await o.generateAsync({ type: "blob" });
177
176
  ne.saveAs(g, a);
178
177
  }
179
- async function W() {
178
+ async function G() {
180
179
  const e = x.value.filter((a) => a.thumbnail);
181
180
  if (e.length === 0) {
182
181
  F.open({ type: "error", title: "No downloadable images found" });
@@ -206,7 +205,7 @@ const He = {
206
205
  };
207
206
  });
208
207
  a.value = `Starting download of ${o.length} images...`;
209
- const d = (await be(o, C, {
208
+ const d = (await re(o, C, {
210
209
  batchSize: 5,
211
210
  // Download 5 images at a time
212
211
  batchDelay: 200,
@@ -215,7 +214,7 @@ const He = {
215
214
  })).filter((n) => n !== null);
216
215
  if (a.value = "Creating ZIP file...", d.length > 0) {
217
216
  const n = `images_${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`;
218
- await J(d, n);
217
+ await q(d, n);
219
218
  } else
220
219
  throw new Error("Failed to fetch any images");
221
220
  },
@@ -227,8 +226,8 @@ const He = {
227
226
  );
228
227
  });
229
228
  }
230
- async function q(e) {
231
- const o = await new A().loadAsync(e), g = [];
229
+ async function J(e) {
230
+ const o = await new O().loadAsync(e), g = [];
232
231
  for (const [d, n] of Object.entries(o.files)) {
233
232
  if (n.dir || d.includes("__MACOSX/") || !N(d))
234
233
  continue;
@@ -262,7 +261,7 @@ const He = {
262
261
  const a = [];
263
262
  for (const t of e)
264
263
  if (t.type === "application/zip" || t.name.toLowerCase().endsWith(".zip")) {
265
- const i = await q(t);
264
+ const i = await J(t);
266
265
  a.push(...i);
267
266
  } else N(t.name) && a.push(t);
268
267
  const o = /* @__PURE__ */ new Map();
@@ -308,12 +307,12 @@ const He = {
308
307
  await u.minor(
309
308
  async () => {
310
309
  const o = async (t) => {
311
- const i = ce(t.productId);
310
+ const i = ue(t.productId);
312
311
  let f = "";
313
- return t.newImage && (await de.update(i, t.newImage, qe.firebase.storageBucket), f = me(i)), { productId: t.productId, newImageUrl: f };
312
+ return t.newImage && (await ge.update(i, t.newImage, Je.firebase.storageBucket), f = pe(i)), { productId: t.productId, newImageUrl: f };
314
313
  };
315
314
  a.value = `Starting upload of ${e.length} product images...`;
316
- const g = await ve({
315
+ const g = await ce({
317
316
  items: e,
318
317
  processor: o,
319
318
  batchSize: 5,
@@ -325,7 +324,7 @@ const He = {
325
324
  }
326
325
  });
327
326
  a.value = "Updating product data...";
328
- const d = b.state.menu, n = re(d), p = new Map(g.map((t) => [t == null ? void 0 : t.productId, t]));
327
+ const d = b.state.menu, n = de(d), p = new Map(g.map((t) => [t == null ? void 0 : t.productId, t]));
329
328
  n.modules.item = n.modules.item.map((t) => {
330
329
  const i = p.get(t._id);
331
330
  return i && i.newImageUrl ? { ...t, thumbnail: i.newImageUrl } : t;
@@ -353,24 +352,24 @@ const He = {
353
352
  }
354
353
  a.value = "";
355
354
  }
356
- return he().resetOnMount(), (e, a) => {
357
- const o = G("fm-button");
355
+ return ve().resetOnMount(), (e, a) => {
356
+ const o = W("fm-button");
358
357
  return r(), c(P, null, [
359
358
  _.value ? (r(), c("div", He, [
360
- I(We, {
359
+ I(Ge, {
361
360
  "matched-images": w.value,
362
361
  "unmatched-images": l.value,
363
362
  onCancel: te,
364
363
  onUpdate: ee
365
364
  }, null, 8, ["matched-images", "unmatched-images"])
366
- ])) : (r(), oe(pe, {
365
+ ])) : (r(), oe(ye, {
367
366
  key: 1,
368
367
  heading: h(j)("menu.productInternalTools.title")
369
368
  }, {
370
- default: R(() => [
371
- I(ye)
369
+ default: A(() => [
370
+ I(_e)
372
371
  ]),
373
- "append-heading": R(() => [
372
+ "append-heading": A(() => [
374
373
  s("div", Xe, [
375
374
  s("div", Ke, [
376
375
  s("div", Qe, [
@@ -383,7 +382,7 @@ const He = {
383
382
  "text-color": h(M).TypoSecondary,
384
383
  variant: h(z).Primary,
385
384
  label: "Download Images",
386
- onClick: W
385
+ onClick: G
387
386
  }, null, 8, ["bg-color", "text-color", "variant"]),
388
387
  I(o, {
389
388
  "bg-color": h(M).NeutralGray100,
@@ -411,5 +410,5 @@ const He = {
411
410
  }
412
411
  });
413
412
  export {
414
- dt as default
413
+ ct as default
415
414
  };
@@ -1,20 +1,16 @@
1
- import { defineComponent as E, computed as g, ref as j, resolveComponent as w, createBlock as y, openBlock as m, unref as e, withCtx as c, createElementVNode as l, toDisplayString as q, createVNode as o, createCommentVNode as G, createElementBlock as P, Fragment as A } from "vue";
2
- import { D as F } from "./dayjs.min-BvFUSPWD.js";
3
- import { J as oe, F as ne } from "./jszip.min-7SsHzD5O.js";
4
- import { u as J, G as W, B as R, H, A as Z, D as ae, I as re, J as U, K as se } from "./index.vue_vue_type_script_setup_true_lang-DCBYExNb.js";
5
- import { w as ie } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-Jv6iJlg9.js";
6
- import { useCoreStore as K, useI18n as le } from "@feedmepos/mf-common";
7
- import { useDialog as Q, useDialogChild as ue, useSnackbar as X, useBreakpoints as ce, FmButtonVariant as $, FmButtonColorThemeVariant as S } from "@feedmepos/ui-library";
1
+ import { defineComponent as E, computed as g, ref as q, resolveComponent as M, createBlock as y, openBlock as m, unref as e, withCtx as c, createElementVNode as i, toDisplayString as O, createVNode as n, createCommentVNode as G, createElementBlock as P, Fragment as A } from "vue";
2
+ import { D as F } from "./dayjs.min-DNPTnUFp.js";
3
+ import { J as ne, F as oe } from "./jszip.min-CO2_Gf69.js";
4
+ import { u as J, a as W, i as R, j as U, e as Z, k as ae, l as re, c as se, n as z, o as ie, p as le, L as H, q as ue } from "./App-Cfl37TTw.js";
5
+ import { w as ce } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-CxP8lDD0.js";
6
+ import { useCoreStore as K, useI18n as me } from "@feedmepos/mf-common";
7
+ import { useDialog as Q, useDialogChild as de, useSnackbar as X, useBreakpoints as pe, FmButtonVariant as $, FmButtonColorThemeVariant as h } from "@feedmepos/ui-library";
8
8
  import { _ as V } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
9
- import { _ as me, a as z } from "./BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js";
10
- import { _ as de } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
11
- import { u as pe, a as _e } from "./menu-Cd4NbFVq.js";
12
- import { u as fe } from "./item-K01xd1Z0.js";
13
- import { _ as L, a as ve } from "./Product.vue_vue_type_script_setup_true_lang-Cehy2oy-.js";
14
- import { L as O } from "./LinkProductSideSheet-DFDYEUBh.js";
15
- import { _ as ge } from "./TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CMe76XvZ.js";
16
- import { u as be } from "./Thumbnail.vue_vue_type_script_setup_true_lang-C3qXnZlz.js";
17
- import { m as ye } from "./toExcel-BZkbXlHv.js";
9
+ import { _ as _e, a as L } from "./BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js";
10
+ import { _ as fe } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
11
+ import { u as ve, a as ge } from "./menu-Brxar171.js";
12
+ import { _ as j, a as be } from "./Product.vue_vue_type_script_setup_true_lang-rmv8m4_D.js";
13
+ import { m as ye } from "./toExcel-CRJIU0NC.js";
18
14
  const ke = { class: "space-y-24 mb-24" }, xe = ["innerHTML"], he = { class: "flex justify-end gap-8" }, Se = /* @__PURE__ */ E({
19
15
  __name: "ConfirmActionDialog",
20
16
  props: {
@@ -23,36 +19,36 @@ const ke = { class: "space-y-24 mb-24" }, xe = ["innerHTML"], he = { class: "fle
23
19
  message: { default: "To confirm your action, type <b>[[value]]</b> in the text field." }
24
20
  },
25
21
  setup(C) {
26
- const t = C, M = g(() => t.message.replace("[[value]]", t.value)), k = j(""), a = Q(), { emitAction: x } = ue();
27
- return (d, r) => {
28
- const p = w("FmTextField"), _ = w("FmButton"), f = w("FmForm");
22
+ const t = C, S = g(() => t.message.replace("[[value]]", t.value)), k = q(""), r = Q(), { emitAction: x } = de();
23
+ return (d, s) => {
24
+ const p = M("FmTextField"), _ = M("FmButton"), f = M("FmForm");
29
25
  return m(), y(f, {
30
26
  "on-validation-success": () => e(x)("primary"),
31
27
  "blame-form-child-on-validation-failed": ""
32
28
  }, {
33
29
  default: c(() => [
34
- l("div", ke, [
35
- l("div", null, q(d.description), 1),
36
- l("div", { innerHTML: M.value }, null, 8, xe),
37
- l("div", null, [
38
- o(p, {
30
+ i("div", ke, [
31
+ i("div", null, O(d.description), 1),
32
+ i("div", { innerHTML: S.value }, null, 8, xe),
33
+ i("div", null, [
34
+ n(p, {
39
35
  modelValue: k.value,
40
36
  "onUpdate:modelValue": [
41
- r[0] || (r[0] = (u) => k.value = u),
42
- r[1] || (r[1] = () => {
37
+ s[0] || (s[0] = (l) => k.value = l),
38
+ s[1] || (s[1] = () => {
43
39
  })
44
40
  ],
45
41
  placeholder: d.value,
46
- rules: [(u) => u === d.value || "Value does not match"]
42
+ rules: [(l) => l === d.value || "Value does not match"]
47
43
  }, null, 8, ["modelValue", "placeholder", "rules"])
48
44
  ]),
49
- l("div", he, [
50
- o(_, {
45
+ i("div", he, [
46
+ n(_, {
51
47
  label: "Cancel",
52
48
  variant: "secondary",
53
- onClick: r[2] || (r[2] = (u) => e(a).close())
49
+ onClick: s[2] || (s[2] = (l) => e(r).close())
54
50
  }),
55
- o(_, {
51
+ n(_, {
56
52
  label: "Confirm",
57
53
  type: "submit"
58
54
  })
@@ -66,8 +62,8 @@ const ke = { class: "space-y-24 mb-24" }, xe = ["innerHTML"], he = { class: "fle
66
62
  }), Me = /* @__PURE__ */ E({
67
63
  __name: "Migrate",
68
64
  setup(C) {
69
- const t = J(), M = K(), k = X(), { minor: a } = W(k), x = j(!1), d = Q();
70
- async function r() {
65
+ const t = J(), S = K(), k = X(), { minor: r } = W(k), x = q(!1), d = Q();
66
+ async function s() {
71
67
  p.value || x.value || d.open({
72
68
  title: "Migrate to new version",
73
69
  contentComponent: Se,
@@ -76,7 +72,7 @@ const ke = { class: "space-y-24 mb-24" }, xe = ["innerHTML"], he = { class: "fle
76
72
  description: "Do you want to migrate to new version? Once migrate it will unable to revert to the older version."
77
73
  }
78
74
  }).onPrimary(async () => {
79
- d.close(), await a(
75
+ d.close(), await r(
80
76
  async () => {
81
77
  await t.migrate(), setTimeout(() => {
82
78
  window.location.reload();
@@ -92,14 +88,14 @@ const ke = { class: "space-y-24 mb-24" }, xe = ["innerHTML"], he = { class: "fle
92
88
  });
93
89
  }
94
90
  const p = g(() => {
95
- const _ = M.restaurants.value;
91
+ const _ = S.restaurants.value;
96
92
  if (!_.length) return "Required at least one restaurant to migrate";
97
- const f = _.filter((b) => !b.posVersion || !R.Pos.canUse({ feature: H.F_FEATURE.enum.menuV4, posVersion: b.posVersion }));
98
- return f.length ? `Upgrade POS to V${R.Pos.minVersionToUse(H.F_FEATURE.enum.menuV4)} to use new menu: ${f.map((b) => b.profile.name).join(", ")}` : null;
93
+ const f = _.filter((b) => !b.posVersion || !R.Pos.canUse({ feature: U.F_FEATURE.enum.menuV4, posVersion: b.posVersion }));
94
+ return f.length ? `Upgrade POS to V${R.Pos.minVersionToUse(U.F_FEATURE.enum.menuV4)} to use new menu: ${f.map((b) => b.profile.name).join(", ")}` : null;
99
95
  });
100
96
  return g(() => p.value ? p.value : "Migrate your menu to new version to enjoy more features. Content of new menu will remain the same as current."), (_, f) => {
101
- const u = w("FmSnackbar");
102
- return !p.value && e(t).version !== e(Z.F_MENU_VERSION).enum.v4 ? (m(), y(u, {
97
+ const l = M("FmSnackbar");
98
+ return !p.value && e(t).version !== e(Z.F_MENU_VERSION).enum.v4 ? (m(), y(l, {
103
99
  key: 0,
104
100
  class: "!max-w-full",
105
101
  title: "New version of menu is out now!",
@@ -107,48 +103,47 @@ const ke = { class: "space-y-24 mb-24" }, xe = ["innerHTML"], he = { class: "fle
107
103
  variant: "info",
108
104
  action: "Migrate",
109
105
  "z-index": 0,
110
- onOnAction: r
106
+ onOnAction: s
111
107
  })) : G("", !0);
112
108
  };
113
109
  }
114
- }), we = "/assets/menu-export-D_oNY_wi.js", Ce = { class: "flex-1 flex justify-between gap-8 pl-8" }, Fe = { class: "flex items-center" }, $e = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ve = { class: "fm-typo-en-body-md-600 font-semibold" }, Ee = { class: "flex gap-8" }, Je = /* @__PURE__ */ E({
110
+ }), we = "/assets/menu-export-DcINiK28.js", Ce = { class: "flex-1 flex justify-between gap-8 pl-8" }, Fe = { class: "flex items-center" }, $e = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ve = { class: "fm-typo-en-body-md-600 font-semibold" }, Ee = { class: "flex gap-8" }, je = /* @__PURE__ */ E({
115
111
  __name: "Products",
116
112
  setup(C) {
117
- const { t } = le(), M = K(), k = W(X()), a = J(), x = g(() => a.rules.item), d = fe(), r = g(() => !a.state.currentSchedulerId), { selectedCategories: p } = pe(), _ = g(() => ({
118
- ...ae.menuV4ToV3(re(a.state.menu)),
119
- _id: a.state.menu._id,
120
- _rev: a.state.menu._rev
113
+ const { t } = me(), S = K(), k = W(X()), r = J(), x = g(() => r.rules.item), d = ae(), s = g(() => !r.state.currentSchedulerId), { selectedCategories: p } = ve(), _ = g(() => ({
114
+ ...re.menuV4ToV3(se(r.state.menu)),
115
+ _id: r.state.menu._id,
116
+ _rev: r.state.menu._rev
121
117
  })), f = g(() => {
122
- const v = U.flatten(p.value.map((s) => s.items));
123
- return U.uniqBy(v, (s) => s._id).length;
118
+ const u = z.flatten(p.value.map((o) => o.items));
119
+ return z.uniqBy(u, (o) => o._id).length;
124
120
  });
125
- async function u(v, s) {
126
- const i = new oe();
127
- for (let h = 0; h < v.length; h++)
128
- i.file(`${s[h]}.xlsx`, v[h]);
129
- const n = await i.generateAsync({ type: "blob" });
130
- ne.saveAs(n, `books_${F().format("DD-MM-YYYY_HH-mm")}.zip`);
121
+ async function l(u, o) {
122
+ const v = new ne();
123
+ for (let w = 0; w < u.length; w++)
124
+ v.file(`${o[w]}.xlsx`, u[w]);
125
+ const a = await v.generateAsync({ type: "blob" });
126
+ oe.saveAs(a, `books_${F().format("DD-MM-YYYY_HH-mm")}.zip`);
131
127
  }
132
128
  async function b() {
133
129
  await k.minor(
134
130
  async () => {
135
- var v;
136
- if (await a.readMenu(), a.version === Z.F_MENU_VERSION.enum.v4) {
137
- const s = a.state.menu, i = F().format("DD-MM-YYYY_HH-mm"), n = [
138
- `menu_${i}`,
139
- `addonGroup_${i}`,
140
- `itemLinkedAddon_${i}`
141
- ], h = await se(
131
+ if (await r.readMenu(), r.version === Z.F_MENU_VERSION.enum.v4) {
132
+ const u = r.state.menu, o = F().format("DD-MM-YYYY_HH-mm"), v = [
133
+ `menu_${o}`,
134
+ `addonGroup_${o}`,
135
+ `itemLinkedAddon_${o}`
136
+ ], a = await ue(
142
137
  we,
143
138
  JSON.stringify({
144
- menu: s,
145
- attributeSettings: ((v = M.currentBusiness.value) == null ? void 0 : v.attributeSettings) ?? []
139
+ menu: u,
140
+ attributeSettings: S.itemAttributeSettings.value
146
141
  })
147
142
  );
148
- await u(h, n);
143
+ await l(a, v);
149
144
  } else {
150
- const s = ye(_.value), i = `menu_${F().format("DD-MM-YYYY_HH-mm")}`;
151
- await ie(s, `${i}.xlsx`, {
145
+ const u = ye(_.value), o = `menu_${F().format("DD-MM-YYYY_HH-mm")}`;
146
+ await ce(u, `${o}.xlsx`, {
152
147
  bookType: "xlsx",
153
148
  bookSST: !0,
154
149
  type: "array",
@@ -156,45 +151,45 @@ const ke = { class: "space-y-24 mb-24" }, xe = ["innerHTML"], he = { class: "fle
156
151
  });
157
152
  }
158
153
  },
159
- { successMessage: "Menu exported", customId: a.state.menu._id }
154
+ { successMessage: "Menu exported", customId: r.state.menu._id }
160
155
  );
161
156
  }
162
157
  const {
163
158
  menuItems: T,
164
- categories: D,
165
- linkItemRules: I,
159
+ categories: I,
160
+ linkItemRules: D,
166
161
  handleSubmit: N,
167
162
  catalogManager: Y,
168
163
  schedulerManager: B
169
- } = be(!1), ee = ce(), te = g(() => ee.breakpoints.value.xs);
170
- return _e().resetOnMount(), (v, s) => {
171
- const i = w("fm-button");
172
- return m(), y(de, {
164
+ } = ie(!1), ee = pe(), te = g(() => ee.breakpoints.value.xs);
165
+ return ge().resetOnMount(), (u, o) => {
166
+ const v = M("fm-button");
167
+ return m(), y(fe, {
173
168
  heading: e(t)("menu.products.title")
174
169
  }, {
175
170
  default: c(() => [
176
- o(Me),
177
- o(ve)
171
+ n(Me),
172
+ n(be)
178
173
  ]),
179
174
  "append-heading": c(() => [
180
- l("div", Ce, [
181
- l("div", Fe, [
182
- l("div", $e, [
183
- l("p", Ve, q(f.value), 1)
175
+ i("div", Ce, [
176
+ i("div", Fe, [
177
+ i("div", $e, [
178
+ i("p", Ve, O(f.value), 1)
184
179
  ])
185
180
  ]),
186
- l("div", Ee, [
187
- te.value ? (m(), y(L, { key: 1 }, {
188
- default: c(({ trigger: n }) => [
189
- o(me, null, {
181
+ i("div", Ee, [
182
+ te.value ? (m(), y(j, { key: 1 }, {
183
+ default: c(({ trigger: a }) => [
184
+ n(_e, null, {
190
185
  default: c(() => [
191
- o(z, {
186
+ n(L, {
192
187
  label: e(t)("menu.products.actions.export"),
193
188
  onClick: b
194
189
  }, null, 8, ["label"]),
195
- o(z, {
190
+ n(L, {
196
191
  label: e(t)("menu.products.actions.import"),
197
- onClick: n
192
+ onClick: a
198
193
  }, null, 8, ["label", "onClick"])
199
194
  ]),
200
195
  _: 2
@@ -202,33 +197,33 @@ const ke = { class: "space-y-24 mb-24" }, xe = ["innerHTML"], he = { class: "fle
202
197
  ]),
203
198
  _: 1
204
199
  })) : (m(), P(A, { key: 0 }, [
205
- o(ge, null, {
206
- default: c(({ trigger: n }) => [
207
- o(i, {
200
+ n(le, null, {
201
+ default: c(({ trigger: a }) => [
202
+ n(v, {
208
203
  label: e(t)("menu.tree_editor.title"),
209
- "bg-color": e(S).NeutralGray100,
210
- "text-color": e(S).TypoSecondary,
204
+ "bg-color": e(h).NeutralGray100,
205
+ "text-color": e(h).TypoSecondary,
211
206
  variant: e($).Primary,
212
- onClick: n
207
+ onClick: a
213
208
  }, null, 8, ["label", "bg-color", "text-color", "variant", "onClick"])
214
209
  ]),
215
210
  _: 1
216
211
  }),
217
- o(i, {
218
- "bg-color": e(S).NeutralGray100,
219
- "text-color": e(S).TypoSecondary,
212
+ n(v, {
213
+ "bg-color": e(h).NeutralGray100,
214
+ "text-color": e(h).TypoSecondary,
220
215
  variant: e($).Primary,
221
216
  label: e(t)("menu.products.actions.export"),
222
217
  onClick: b
223
218
  }, null, 8, ["bg-color", "text-color", "variant", "label"]),
224
- o(L, null, {
225
- default: c(({ trigger: n }) => [
226
- o(i, {
227
- "bg-color": e(S).NeutralGray100,
228
- "text-color": e(S).TypoSecondary,
219
+ n(j, null, {
220
+ default: c(({ trigger: a }) => [
221
+ n(v, {
222
+ "bg-color": e(h).NeutralGray100,
223
+ "text-color": e(h).TypoSecondary,
229
224
  variant: e($).Primary,
230
225
  label: e(t)("menu.products.actions.import"),
231
- onClick: n
226
+ onClick: a
232
227
  }, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])
233
228
  ]),
234
229
  _: 1
@@ -239,41 +234,41 @@ const ke = { class: "space-y-24 mb-24" }, xe = ["innerHTML"], he = { class: "fle
239
234
  key: 0,
240
235
  label: e(t)("menu.products.actions.add"),
241
236
  "prepend-icon": "add",
242
- onClick: s[0] || (s[0] = (n) => e(d).create(null))
243
- }, null, 8, ["label"])) : r.value ? (m(), y(O, {
237
+ onClick: o[0] || (o[0] = (a) => e(d).create(null))
238
+ }, null, 8, ["label"])) : s.value ? (m(), y(H, {
244
239
  key: 1,
245
240
  "categorized-items": e(Y).linkableItems.value,
246
241
  "initial-value": e(Y).currentItems.value,
247
242
  "show-variant": !1,
248
243
  "menu-items": e(T),
249
- categories: e(D),
250
- "link-item-rules": e(I),
251
- "no-scheduler": r.value,
244
+ categories: e(I),
245
+ "link-item-rules": e(D),
246
+ "no-scheduler": s.value,
252
247
  onSubmit: e(N)
253
248
  }, {
254
- default: c(({ trigger: n }) => [
255
- o(V, {
249
+ default: c(({ trigger: a }) => [
250
+ n(V, {
256
251
  label: e(t)("menu.products.actions.link"),
257
252
  "prepend-icon": "link",
258
- onClick: n
253
+ onClick: a
259
254
  }, null, 8, ["label", "onClick"])
260
255
  ]),
261
256
  _: 1
262
- }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : (m(), y(O, {
257
+ }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : (m(), y(H, {
263
258
  key: 2,
264
259
  "categorized-items": e(B).linkableItems.value,
265
260
  "initial-value": e(B).currentItems.value,
266
261
  "show-variant": !1,
267
262
  "menu-items": e(T),
268
- categories: e(D),
269
- "link-item-rules": e(I),
270
- "no-scheduler": r.value,
263
+ categories: e(I),
264
+ "link-item-rules": e(D),
265
+ "no-scheduler": s.value,
271
266
  onSubmit: e(N)
272
267
  }, {
273
- default: c(({ trigger: n }) => [
274
- o(V, {
268
+ default: c(({ trigger: a }) => [
269
+ n(V, {
275
270
  label: e(t)("menu.products.actions.apply_scheduler"),
276
- onClick: n
271
+ onClick: a
277
272
  }, null, 8, ["label", "onClick"])
278
273
  ]),
279
274
  _: 1
@@ -288,5 +283,5 @@ const ke = { class: "space-y-24 mb-24" }, xe = ["innerHTML"], he = { class: "fle
288
283
  }
289
284
  });
290
285
  export {
291
- Je as default
286
+ je as default
292
287
  };