@feedmepos/mf-menu 0.32.41 → 0.32.42-dev.3

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 (68) hide show
  1. package/dist/{App-Bt5lFavE.js → App-1oMjfIcc.js} +7 -7
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-DpyJ5gr2.js → ApplyProduct.vue_vue_type_script_setup_true_lang-AIw0Zgzf.js} +3 -3
  3. package/dist/{Catalog-DJyGxDRP.js → Catalog-CvQo24ck.js} +44 -44
  4. package/dist/{Category-BlIUSUxn.js → Category-C8bM8EwO.js} +24 -24
  5. package/dist/{Category-CNTOOIJE.js → Category-DmIaxrrK.js} +24 -24
  6. package/dist/{CookingGuide-CpZfKE5H.js → CookingGuide-CKEbyk4o.js} +105 -105
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-QzZR2W1U.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-Ci4gwgnH.js} +1 -1
  8. package/dist/{Group-B88fbCOf.js → Group-CoYyRvcx.js} +1 -1
  9. package/dist/{Group-Bhnov3p8.js → Group-EnJDk54z.js} +3 -3
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-CRAX3mIt.js → Group.vue_vue_type_script_setup_true_lang-tH2U82rV.js} +18 -18
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Bqh6a0oO.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BDxjuWcY.js} +30 -30
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-DPAxkce6.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-gVXNoAaN.js} +1457 -1456
  13. package/dist/{Ingredient-BORYH8yl.js → Ingredient-7PPPp7Yf.js} +20 -20
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-Ci-CaBED.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DQPjpqtv.js} +2 -2
  15. package/dist/{LinkProductSideSheet-DQN59t0a.js → LinkProductSideSheet-BS-MEIOG.js} +45 -45
  16. package/dist/{MenuSetting-cI0j1omE.js → MenuSetting-BNVyT0oG.js} +47 -47
  17. package/dist/{PrintRoute-CXSuomGR.js → PrintRoute-BMdk0zDv.js} +39 -39
  18. package/dist/{Product-DgbQeeKt.js → Product-DbIK7Eog.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-D0cnQC3i.js → Product.vue_vue_type_script_setup_true_lang-FnX_M8lJ.js} +139 -139
  20. package/dist/{ProductInternalTools-B1zpNBze.js → ProductInternalTools-BC8jWpQd.js} +66 -66
  21. package/dist/Products-CPi2vuUO.js +307 -0
  22. package/dist/{Publish-Cqdk3SjG.js → Publish-BcxHXZ1J.js} +29 -29
  23. package/dist/{Recipe-anT6QBZT.js → Recipe-egyxyFfA.js} +24 -24
  24. package/dist/RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-CP1NjxzF.js +144 -0
  25. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-Cc_k57qi.js → RuleView.vue_vue_type_script_setup_true_lang-CPMCeAK9.js} +366 -366
  26. package/dist/{Scheduler-Z64VCw-y.js → Scheduler-Cb-IJtj8.js} +11 -11
  27. package/dist/{ServingSequence-B7ZbvY1v.js → ServingSequence-B46n34xA.js} +44 -44
  28. package/dist/{Setting-DnVCq2hY.js → Setting-B_dZG5ZC.js} +17 -17
  29. package/dist/{Subcategory-dpz-Um56.js → Subcategory-DbjLfXvf.js} +51 -51
  30. package/dist/{Takeaway-DiyOBq1g.js → Takeaway-D4axornr.js} +13 -13
  31. package/dist/{Takeaway-mwLXbT9q.js → Takeaway-DNu6jYFC.js} +1 -1
  32. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-tg3AJE3_.js → Takeaway.vue_vue_type_script_setup_true_lang-Dvm8Lfp3.js} +28 -28
  33. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-FRH0zCh6.js → Thumbnail.vue_vue_type_script_setup_true_lang-BjPOOURv.js} +27 -27
  34. package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-nGzNSAX9.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-CXGsdChM.js} +4 -4
  35. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-C9eskCL4.js +5767 -0
  36. package/dist/{Unit-CmF2olR8.js → Unit-jV5Bee8E.js} +8 -8
  37. package/dist/{Variant-C9-_-SLX.js → Variant-jGcgA-W8.js} +24 -24
  38. package/dist/{_id_-C4Zpr6wS.js → _id_-CtvQ64EN.js} +28 -28
  39. package/dist/app-B6laFmet.js +2286 -0
  40. package/dist/{app-CrcPPLl1.js → app-eq7TaFfk.js} +1 -1
  41. package/dist/app.js +1 -1
  42. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/assets/{linked-status-68qGGp41.js → linked-status-Db18QnYH.js} +5 -5
  44. package/dist/assets/{menu-export-CRtF4W1I.js → menu-export-24uzPEwW.js} +2 -2
  45. package/dist/assets/{override-menu-DB0DJf_x.js → override-menu-DreGPEa-.js} +5 -5
  46. package/dist/assets/{validate-menu-oi_J1ue-.js → validate-menu-BSFHH8O3.js} +2 -2
  47. package/dist/{catalog-Cp4kVRAL.js → catalog-CXcQ-QmP.js} +1 -1
  48. package/dist/{catalogSetting-Cr0DX5kw.js → catalogSetting-DnUHD0I1.js} +1 -1
  49. package/dist/{currency-C_IuOt0j.js → currency-CwtLEvAZ.js} +1 -1
  50. package/dist/dayjs.min-BgQgGKeN.js +7 -0
  51. package/dist/{index-CXzIkkUH.js → index-Cx1Nqii7.js} +31 -31
  52. package/dist/{index-DzLNqNMt.js → index-D-Saeea8.js} +43 -43
  53. package/dist/{index.vue_vue_type_script_setup_true_lang-DyiwvQnC.js → index.vue_vue_type_script_setup_true_lang-CA1qH7Vf.js} +244 -269
  54. package/dist/{item-C3_GKsNy.js → item-CKRLnCIs.js} +15 -15
  55. package/dist/{jszip.min-BiRK-xY3.js → jszip.min-DOHC0a7i.js} +388 -387
  56. package/dist/{menu-CYrjppCV.js → menu-BduvULfe.js} +1 -1
  57. package/dist/{menuV2-DWQ093x3.js → menuV2-Da1zBhkS.js} +83 -83
  58. package/dist/{priceTier-CD3j-Ccs.js → priceTier-tObdSj6z.js} +1 -1
  59. package/dist/{rules-BTZh0AjD.js → rules-DD816lrT.js} +11 -11
  60. package/dist/{scheduler-PVlNN-pB.js → scheduler-CDhxmmVX.js} +29 -29
  61. package/dist/{toExcel-lSyQhZQ9.js → toExcel-tz6MIiQY.js} +2 -2
  62. package/dist/{unit-1MnbZYm8.js → unit-NGl3h7Qh.js} +35 -35
  63. package/package.json +2 -1
  64. package/dist/Products-JodXj4IG.js +0 -291
  65. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BzwlZ9jW.js +0 -6130
  66. package/dist/app-BC-PDZ1J.js +0 -363
  67. package/dist/dayjs.min-fN9Ef6y1.js +0 -6
  68. package/dist/index-vqNnqeRW.js +0 -246
@@ -1,34 +1,34 @@
1
- import { defineComponent as Z, ref as v, computed as M, 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-BiRK-xY3.js";
3
- import { G as le, u as ie, J as D, a2 as re, N as ce, O as de, P as me } from "./index.vue_vue_type_script_setup_true_lang-DyiwvQnC.js";
1
+ import { defineComponent as Z, ref as v, computed as z, resolveComponent as W, createElementBlock as c, openBlock as r, createElementVNode as s, createVNode as I, unref as h, createCommentVNode as T, normalizeClass as B, toDisplayString as U, createStaticVNode as E, 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-DOHC0a7i.js";
3
+ import { B as le, u as ie, H as D, a0 as re, K as ce, M as de, N as me } from "./index.vue_vue_type_script_setup_true_lang-CA1qH7Vf.js";
4
4
  import { useI18n as ue } from "@feedmepos/mf-common";
5
- import { FmButtonVariant as $, useSnackbar as V, useDialog as ge, FmButtonColorThemeVariant as z } from "@feedmepos/ui-library";
5
+ import { FmButtonVariant as $, useSnackbar as V, useDialog as ge, FmButtonColorThemeVariant as S } from "@feedmepos/ui-library";
6
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-CYrjppCV.js";
8
- import { a as ye } from "./Product.vue_vue_type_script_setup_true_lang-D0cnQC3i.js";
9
- import { x as be, y as ve, z as _e } from "./item-C3_GKsNy.js";
7
+ import { u as fe, a as he } from "./menu-BduvULfe.js";
8
+ import { a as ye } from "./Product.vue_vue_type_script_setup_true_lang-FnX_M8lJ.js";
9
+ import { x as be, y as ve, z as _e } from "./item-CKRLnCIs.js";
10
10
  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
11
  key: 0,
12
12
  class: "h-full flex flex-col"
13
13
  }, Fe = {
14
14
  key: 0,
15
15
  class: "flex-1 flex items-center justify-center"
16
- }, Se = {
16
+ }, Me = {
17
17
  key: 1,
18
18
  class: "flex-1 overflow-y-auto p-16"
19
- }, ze = { class: "space-y-12" }, Me = { class: "fm-typo-en-body-sm font-medium" }, $e = { class: "flex" }, Pe = { class: "w-64 h-64 bg-gray-100 rounded-8 overflow-hidden flex items-center justify-center" }, Le = ["src", "alt"], Ne = {
19
+ }, Se = { class: "space-y-12" }, ze = { class: "fm-typo-en-body-sm font-medium" }, $e = { 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
20
  key: 1,
21
21
  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 = {
22
+ }, Te = { class: "flex" }, Be = { class: "w-64 h-64 bg-gray-100 rounded-8 overflow-hidden" }, Ee = ["src", "alt"], Re = {
23
23
  key: 1,
24
24
  class: "h-full flex flex-col"
25
- }, Re = {
25
+ }, Ae = {
26
26
  key: 0,
27
27
  class: "flex-1 flex items-center justify-center"
28
- }, Ae = {
28
+ }, Oe = {
29
29
  key: 1,
30
30
  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({
31
+ }, 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
32
  __name: "ImageUpdatePreview",
33
33
  props: {
34
34
  matchedImages: {},
@@ -36,15 +36,15 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
36
36
  },
37
37
  emits: ["cancel", "update"],
38
38
  setup(L, { emit: j }) {
39
- const u = L, F = j, y = v("matched"), b = M(() => u.matchedImages.length), k = M(() => u.unmatchedImages.length);
39
+ const u = L, F = j, y = v("matched"), b = z(() => u.matchedImages.length), k = z(() => u.unmatchedImages.length);
40
40
  function _() {
41
41
  F("cancel");
42
42
  }
43
- function S() {
43
+ function M() {
44
44
  F("update", u.matchedImages);
45
45
  }
46
46
  return (w, l) => {
47
- const x = G("fm-button");
47
+ const x = W("fm-button");
48
48
  return r(), c("div", we, [
49
49
  s("div", xe, [
50
50
  l[2] || (l[2] = s("h2", { class: "fm-typo-en-headline-sm font-semibold" }, "Update Product Images", -1)),
@@ -58,14 +58,14 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
58
58
  variant: h($).Primary,
59
59
  label: "Update",
60
60
  disabled: b.value === 0,
61
- onClick: S
61
+ onClick: M
62
62
  }, null, 8, ["variant", "disabled"])
63
63
  ])
64
64
  ]),
65
65
  s("div", ke, [
66
66
  s("div", Ce, [
67
67
  s("button", {
68
- class: E([
68
+ class: B([
69
69
  "px-16 py-12 font-medium text-sm border-b-2 transition-colors",
70
70
  y.value === "matched" ? "border-blue-500 text-blue-600 bg-blue-50" : "border-transparent text-gray-500 hover:text-gray-700"
71
71
  ]),
@@ -73,7 +73,7 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
73
73
  }, " Matched Images (" + U(b.value) + ") ", 3),
74
74
  k.value > 0 ? (r(), c("button", {
75
75
  key: 0,
76
- class: E([
76
+ class: B([
77
77
  "px-16 py-12 font-medium text-sm border-b-2 transition-colors",
78
78
  y.value === "unmatched" ? "border-blue-500 text-blue-600 bg-blue-50" : "border-transparent text-gray-500 hover:text-gray-700"
79
79
  ]),
@@ -84,19 +84,19 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
84
84
  s("div", Ue, [
85
85
  y.value === "matched" ? (r(), c("div", je, [
86
86
  b.value === 0 ? (r(), c("div", Fe, l[3] || (l[3] = [
87
- 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="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path></svg><p class="fm-typo-en-body-lg text-gray-500">No matched images found</p><p class="fm-typo-en-body-sm text-gray-400 mt-4"> Make sure your image filenames match product names </p></div>', 1)
88
- ]))) : (r(), c("div", Se, [
87
+ E('<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="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path></svg><p class="fm-typo-en-body-lg text-gray-500">No matched images found</p><p class="fm-typo-en-body-sm text-gray-400 mt-4"> Make sure your image filenames match product names </p></div>', 1)
88
+ ]))) : (r(), c("div", Me, [
89
89
  l[4] || (l[4] = s("div", { class: "grid grid-cols-3 gap-16 pb-12 border-b border-gray-200 mb-16" }, [
90
90
  s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "Product Name"),
91
91
  s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "Current Image"),
92
92
  s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "New Image")
93
93
  ], -1)),
94
- s("div", ze, [
95
- (r(!0), c(P, null, O(u.matchedImages, (m, C) => (r(), c("div", {
94
+ s("div", Se, [
95
+ (r(!0), c(P, null, R(u.matchedImages, (m, C) => (r(), c("div", {
96
96
  key: C,
97
97
  class: "grid grid-cols-3 gap-16 py-12 border-b border-gray-100 items-center"
98
98
  }, [
99
- s("div", Me, U(m.productName), 1),
99
+ s("div", ze, U(m.productName), 1),
100
100
  s("div", $e, [
101
101
  s("div", Pe, [
102
102
  m.originalThumbnail ? (r(), c("img", {
@@ -108,38 +108,38 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
108
108
  ])
109
109
  ]),
110
110
  s("div", Te, [
111
- s("div", Ee, [
111
+ s("div", Be, [
112
112
  s("img", {
113
113
  src: m.newImageUrl,
114
114
  alt: m.newImage.name,
115
115
  class: "w-full h-full object-cover"
116
- }, null, 8, Be)
116
+ }, null, 8, Ee)
117
117
  ])
118
118
  ])
119
119
  ]))), 128))
120
120
  ])
121
121
  ]))
122
- ])) : y.value === "unmatched" ? (r(), c("div", Oe, [
123
- k.value === 0 ? (r(), c("div", Re, l[5] || (l[5] = [
124
- 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, [
122
+ ])) : y.value === "unmatched" ? (r(), c("div", Re, [
123
+ k.value === 0 ? (r(), c("div", Ae, l[5] || (l[5] = [
124
+ E('<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", Oe, [
126
126
  l[6] || (l[6] = s("div", { class: "grid grid-cols-2 gap-16 pb-12 border-b border-gray-200 mb-16" }, [
127
127
  s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "Filename"),
128
128
  s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "Image")
129
129
  ], -1)),
130
130
  s("div", De, [
131
- (r(!0), c(P, null, O(u.unmatchedImages, (m, C) => (r(), c("div", {
131
+ (r(!0), c(P, null, R(u.unmatchedImages, (m, C) => (r(), c("div", {
132
132
  key: C,
133
133
  class: "grid grid-cols-2 gap-16 py-12 border-b border-gray-100 items-center"
134
134
  }, [
135
135
  s("div", Ve, U(m.filename), 1),
136
136
  s("div", Ze, [
137
- s("div", Ge, [
137
+ s("div", We, [
138
138
  s("img", {
139
139
  src: m.imageUrl,
140
140
  alt: m.filename,
141
141
  class: "w-full h-full object-cover"
142
- }, null, 8, Je)
142
+ }, null, 8, qe)
143
143
  ])
144
144
  ])
145
145
  ]))), 128))
@@ -151,32 +151,32 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
151
151
  };
152
152
  }
153
153
  });
154
- var qe = { firebase: { storageBucket: "image.feedme.cc" } };
155
- const He = {
154
+ var He = { firebase: { storageBucket: "image.feedmedev.cc" } };
155
+ const Je = {
156
156
  key: 0,
157
157
  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({
158
+ }, Ke = { class: "flex-1 flex justify-between gap-8 pl-8" }, Xe = { 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({
159
159
  __name: "ProductInternalTools",
160
160
  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 = M(() => {
161
+ const { t: j } = ue(), u = le(V()), F = V(), y = ge(), b = ie(), { selectedCategories: k } = fe(), _ = v(!1), M = v(), w = v([]), l = v([]), x = z(() => {
162
162
  const e = D.flatten(k.value.map((a) => a.items));
163
163
  return D.uniqBy(e, (a) => a._id);
164
- }), m = M(() => x.value.length);
164
+ }), m = z(() => x.value.length);
165
165
  async function C(e, a) {
166
166
  return await _e(e, {
167
167
  withTimestamp: !0,
168
168
  filename: a
169
169
  });
170
170
  }
171
- async function J(e, a = "images.zip") {
172
- const o = new A();
171
+ async function q(e, a = "images.zip") {
172
+ const o = new O();
173
173
  e.forEach(({ blob: d, filename: n }) => {
174
174
  d && o.file(n, d);
175
175
  });
176
176
  const g = await o.generateAsync({ type: "blob" });
177
177
  ne.saveAs(g, a);
178
178
  }
179
- async function W() {
179
+ async function G() {
180
180
  const e = x.value.filter((a) => a.thumbnail);
181
181
  if (e.length === 0) {
182
182
  F.open({ type: "error", title: "No downloadable images found" });
@@ -215,7 +215,7 @@ const He = {
215
215
  })).filter((n) => n !== null);
216
216
  if (a.value = "Creating ZIP file...", d.length > 0) {
217
217
  const n = `images_${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`;
218
- await J(d, n);
218
+ await q(d, n);
219
219
  } else
220
220
  throw new Error("Failed to fetch any images");
221
221
  },
@@ -227,12 +227,12 @@ const He = {
227
227
  );
228
228
  });
229
229
  }
230
- async function q(e) {
231
- const o = await new A().loadAsync(e), g = [];
230
+ async function H(e) {
231
+ const o = await new O().loadAsync(e), g = [];
232
232
  for (const [d, n] of Object.entries(o.files)) {
233
233
  if (n.dir || d.includes("__MACOSX/") || !N(d))
234
234
  continue;
235
- const p = await n.async("blob"), t = d.split("/").pop() || d, i = new File([p], t, { type: H(t) });
235
+ const p = await n.async("blob"), t = d.split("/").pop() || d, i = new File([p], t, { type: J(t) });
236
236
  g.push(i);
237
237
  }
238
238
  return g;
@@ -241,7 +241,7 @@ const He = {
241
241
  const a = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp"], o = e.toLowerCase().substring(e.lastIndexOf("."));
242
242
  return a.includes(o);
243
243
  }
244
- function H(e) {
244
+ function J(e) {
245
245
  const a = e.toLowerCase().substring(e.lastIndexOf("."));
246
246
  return {
247
247
  ".jpg": "image/jpeg",
@@ -252,17 +252,17 @@ const He = {
252
252
  ".bmp": "image/bmp"
253
253
  }[a] || "image/jpeg";
254
254
  }
255
- function X(e) {
255
+ function K(e) {
256
256
  return (e.substring(0, e.lastIndexOf(".")) || e).toLowerCase().trim().replace(/[_\-\s]+/g, " ");
257
257
  }
258
- function K(e) {
258
+ function X(e) {
259
259
  return e.toLowerCase().trim().replace(/[_\-\s]+/g, " ");
260
260
  }
261
261
  async function Q(e) {
262
262
  const a = [];
263
263
  for (const t of e)
264
264
  if (t.type === "application/zip" || t.name.toLowerCase().endsWith(".zip")) {
265
- const i = await q(t);
265
+ const i = await H(t);
266
266
  a.push(...i);
267
267
  } else N(t.name) && a.push(t);
268
268
  const o = /* @__PURE__ */ new Map();
@@ -272,11 +272,11 @@ const He = {
272
272
  });
273
273
  const g = Array.from(o.values()), d = [], n = [], p = /* @__PURE__ */ new Map();
274
274
  x.value.forEach((t) => {
275
- const i = K(t.name);
275
+ const i = X(t.name);
276
276
  p.set(i, t);
277
277
  });
278
278
  for (const t of g) {
279
- const i = X(t.name), f = p.get(i);
279
+ const i = K(t.name), f = p.get(i);
280
280
  f ? d.push({
281
281
  productId: f._id,
282
282
  productName: f.name,
@@ -310,7 +310,7 @@ const He = {
310
310
  const o = async (t) => {
311
311
  const i = ce(t.productId);
312
312
  let f = "";
313
- return t.newImage && (await de.update(i, t.newImage, qe.firebase.storageBucket), f = me(i)), { productId: t.productId, newImageUrl: f };
313
+ return t.newImage && (await de.update(i, t.newImage, He.firebase.storageBucket), f = me(i)), { productId: t.productId, newImageUrl: f };
314
314
  };
315
315
  a.value = `Starting upload of ${e.length} product images...`;
316
316
  const g = await ve({
@@ -343,7 +343,7 @@ const He = {
343
343
  }
344
344
  function ae() {
345
345
  var e;
346
- (e = S.value) == null || e.click();
346
+ (e = M.value) == null || e.click();
347
347
  }
348
348
  function se(e) {
349
349
  const a = e.target;
@@ -354,10 +354,10 @@ const He = {
354
354
  a.value = "";
355
355
  }
356
356
  return he().resetOnMount(), (e, a) => {
357
- const o = G("fm-button");
357
+ const o = W("fm-button");
358
358
  return r(), c(P, null, [
359
- _.value ? (r(), c("div", He, [
360
- I(We, {
359
+ _.value ? (r(), c("div", Je, [
360
+ I(Ge, {
361
361
  "matched-images": w.value,
362
362
  "unmatched-images": l.value,
363
363
  onCancel: te,
@@ -367,27 +367,27 @@ const He = {
367
367
  key: 1,
368
368
  heading: h(j)("menu.productInternalTools.title")
369
369
  }, {
370
- default: R(() => [
370
+ default: A(() => [
371
371
  I(ye)
372
372
  ]),
373
- "append-heading": R(() => [
374
- s("div", Xe, [
375
- s("div", Ke, [
373
+ "append-heading": A(() => [
374
+ s("div", Ke, [
375
+ s("div", Xe, [
376
376
  s("div", Qe, [
377
377
  s("p", Ye, U(m.value), 1)
378
378
  ])
379
379
  ]),
380
380
  s("div", et, [
381
381
  I(o, {
382
- "bg-color": h(z).NeutralGray100,
383
- "text-color": h(z).TypoSecondary,
382
+ "bg-color": h(S).NeutralGray100,
383
+ "text-color": h(S).TypoSecondary,
384
384
  variant: h($).Primary,
385
385
  label: "Download Images",
386
- onClick: W
386
+ onClick: G
387
387
  }, null, 8, ["bg-color", "text-color", "variant"]),
388
388
  I(o, {
389
- "bg-color": h(z).NeutralGray100,
390
- "text-color": h(z).TypoSecondary,
389
+ "bg-color": h(S).NeutralGray100,
390
+ "text-color": h(S).TypoSecondary,
391
391
  variant: h($).Primary,
392
392
  label: "Update Images",
393
393
  onClick: ae
@@ -399,7 +399,7 @@ const He = {
399
399
  }, 8, ["heading"])),
400
400
  s("input", {
401
401
  ref_key: "fileInput",
402
- ref: S,
402
+ ref: M,
403
403
  type: "file",
404
404
  multiple: "",
405
405
  accept: "image/*,.zip",
@@ -0,0 +1,307 @@
1
+ import { defineComponent as I, computed as m, ref as J, resolveComponent as w, createBlock as c, openBlock as l, unref as e, withCtx as _, createElementVNode as d, toDisplayString as Z, createVNode as u, createCommentVNode as M, createElementBlock as j, Fragment as z } from "vue";
2
+ import { D as V } from "./dayjs.min-BgQgGKeN.js";
3
+ import { J as re, F as ie } from "./jszip.min-DOHC0a7i.js";
4
+ import { u as K, B as Q, z as R, D as H, y as X, A as le, G as ue, H as L, I as ce } from "./index.vue_vue_type_script_setup_true_lang-CA1qH7Vf.js";
5
+ import { w as me } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-gVXNoAaN.js";
6
+ import { h as F, A as O } from "./app-B6laFmet.js";
7
+ import { useCoreStore as ee, useI18n as de } from "@feedmepos/mf-common";
8
+ import { useDialog as te, useDialogChild as pe, useSnackbar as ne, useBreakpoints as _e, FmButtonVariant as E, FmButtonColorThemeVariant as h } from "@feedmepos/ui-library";
9
+ import { _ as T } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
10
+ import { _ as fe, a as q } from "./BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js";
11
+ import { _ as ve } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
12
+ import { u as ge, a as be } from "./menu-BduvULfe.js";
13
+ import { u as ye } from "./item-CKRLnCIs.js";
14
+ import { _ as G, a as ke } from "./Product.vue_vue_type_script_setup_true_lang-FnX_M8lJ.js";
15
+ import { L as W } from "./LinkProductSideSheet-BS-MEIOG.js";
16
+ import { _ as xe } from "./TreeEditorOpenner.vue_vue_type_script_setup_true_lang-C9eskCL4.js";
17
+ import { u as Se } from "./Thumbnail.vue_vue_type_script_setup_true_lang-BjPOOURv.js";
18
+ import { m as he } from "./toExcel-tz6MIiQY.js";
19
+ const Me = { class: "space-y-24 mb-24" }, we = ["innerHTML"], Ce = { class: "flex justify-end gap-8" }, Fe = /* @__PURE__ */ I({
20
+ __name: "ConfirmActionDialog",
21
+ props: {
22
+ description: {},
23
+ value: {},
24
+ message: { default: "To confirm your action, type <b>[[value]]</b> in the text field." }
25
+ },
26
+ setup($) {
27
+ const n = $, y = m(() => n.message.replace("[[value]]", n.value)), x = J(""), s = te(), { emitAction: S } = pe();
28
+ return (f, i) => {
29
+ const v = w("FmTextField"), g = w("FmButton"), b = w("FmForm");
30
+ return l(), c(b, {
31
+ "on-validation-success": () => e(S)("primary"),
32
+ "blame-form-child-on-validation-failed": ""
33
+ }, {
34
+ default: _(() => [
35
+ d("div", Me, [
36
+ d("div", null, Z(f.description), 1),
37
+ d("div", { innerHTML: y.value }, null, 8, we),
38
+ d("div", null, [
39
+ u(v, {
40
+ modelValue: x.value,
41
+ "onUpdate:modelValue": [
42
+ i[0] || (i[0] = (p) => x.value = p),
43
+ i[1] || (i[1] = () => {
44
+ })
45
+ ],
46
+ placeholder: f.value,
47
+ rules: [(p) => p === f.value || "Value does not match"]
48
+ }, null, 8, ["modelValue", "placeholder", "rules"])
49
+ ]),
50
+ d("div", Ce, [
51
+ u(g, {
52
+ label: "Cancel",
53
+ variant: "secondary",
54
+ onClick: i[2] || (i[2] = (p) => e(s).close())
55
+ }),
56
+ u(g, {
57
+ label: "Confirm",
58
+ type: "submit"
59
+ })
60
+ ])
61
+ ])
62
+ ]),
63
+ _: 1
64
+ }, 8, ["on-validation-success"]);
65
+ };
66
+ }
67
+ }), $e = /* @__PURE__ */ I({
68
+ __name: "Migrate",
69
+ setup($) {
70
+ const n = K(), y = ee(), x = ne(), { minor: s } = Q(x), S = J(!1), f = te();
71
+ async function i() {
72
+ v.value || S.value || f.open({
73
+ title: "Migrate to new version",
74
+ contentComponent: Fe,
75
+ contentComponentProps: {
76
+ value: "MIGRATE",
77
+ description: "Do you want to migrate to new version? Once migrate it will unable to revert to the older version."
78
+ }
79
+ }).onPrimary(async () => {
80
+ f.close(), await s(
81
+ async () => {
82
+ await n.migrate(), setTimeout(() => {
83
+ window.location.reload();
84
+ }, 2e3);
85
+ },
86
+ {
87
+ isLoading: S,
88
+ customId: n.state.menu._id,
89
+ message: "Migrating menu",
90
+ successMessage: "Migration completed"
91
+ }
92
+ );
93
+ });
94
+ }
95
+ const v = m(() => {
96
+ const g = y.restaurants.value;
97
+ if (!g.length) return "Required at least one restaurant to migrate";
98
+ const b = g.filter((k) => !k.posVersion || !R.Pos.canUse({ feature: H.F_FEATURE.enum.menuV4, posVersion: k.posVersion }));
99
+ return b.length ? `Upgrade POS to V${R.Pos.minVersionToUse(H.F_FEATURE.enum.menuV4)} to use new menu: ${b.map((k) => k.profile.name).join(", ")}` : null;
100
+ });
101
+ return m(() => v.value ? v.value : "Migrate your menu to new version to enjoy more features. Content of new menu will remain the same as current."), (g, b) => {
102
+ const p = w("FmSnackbar");
103
+ return !v.value && e(n).version !== e(X.F_MENU_VERSION).enum.v4 ? (l(), c(p, {
104
+ key: 0,
105
+ class: "!max-w-full",
106
+ title: "New version of menu is out now!",
107
+ description: "Migrate your current menu version to the latest to enjoy more features such as product sequential dispatch, serving sequence, scheduler and more! Your content and current setting will be preserved.",
108
+ variant: "info",
109
+ action: "Migrate",
110
+ "z-index": 0,
111
+ onOnAction: i
112
+ })) : M("", !0);
113
+ };
114
+ }
115
+ }), Ve = "/assets/menu-export-24uzPEwW.js", Ee = { class: "flex-1 flex justify-between gap-8 pl-8" }, Te = { class: "flex items-center" }, Ie = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ae = { class: "fm-typo-en-body-md-600 font-semibold" }, De = { class: "flex gap-8" }, Xe = /* @__PURE__ */ I({
116
+ __name: "Products",
117
+ setup($) {
118
+ const { t: n } = de(), y = ee(), x = Q(ne()), s = K(), S = m(() => s.rules.item), f = ye(), i = m(() => !s.state.currentSchedulerId), { selectedCategories: v } = ge(), g = m(() => ({
119
+ ...le.menuV4ToV3(ue(s.state.menu)),
120
+ _id: s.state.menu._id,
121
+ _rev: s.state.menu._rev
122
+ })), b = m(() => {
123
+ const r = L.flatten(v.value.map((t) => t.items));
124
+ return L.uniqBy(r, (t) => t._id).length;
125
+ });
126
+ async function p(r, t) {
127
+ const o = new re();
128
+ for (let C = 0; C < r.length; C++)
129
+ o.file(`${t[C]}.xlsx`, r[C]);
130
+ const a = await o.generateAsync({ type: "blob" });
131
+ ie.saveAs(a, `books_${V().format("DD-MM-YYYY_HH-mm")}.zip`);
132
+ }
133
+ async function k() {
134
+ await x.minor(
135
+ async () => {
136
+ if (await s.readMenu(), s.version === X.F_MENU_VERSION.enum.v4) {
137
+ const r = s.state.menu, t = V().format("DD-MM-YYYY_HH-mm"), o = [
138
+ `menu_${t}`,
139
+ `addonGroup_${t}`,
140
+ `itemLinkedAddon_${t}`
141
+ ], a = await ce(
142
+ Ve,
143
+ JSON.stringify({
144
+ menu: r,
145
+ attributeSettings: y.itemAttributeSettings.value
146
+ })
147
+ );
148
+ await p(a, o);
149
+ } else {
150
+ const r = he(g.value), t = `menu_${V().format("DD-MM-YYYY_HH-mm")}`;
151
+ await me(r, `${t}.xlsx`, {
152
+ bookType: "xlsx",
153
+ bookSST: !0,
154
+ type: "array",
155
+ compression: !0
156
+ });
157
+ }
158
+ },
159
+ { successMessage: "Menu exported", customId: s.state.menu._id }
160
+ );
161
+ }
162
+ const {
163
+ menuItems: A,
164
+ categories: D,
165
+ linkItemRules: B,
166
+ handleSubmit: N,
167
+ catalogManager: Y,
168
+ schedulerManager: P
169
+ } = Se(!1), oe = _e(), ae = m(() => oe.breakpoints.value.xs), se = m(() => {
170
+ var o;
171
+ const r = ((o = y.sessionUser.value) == null ? void 0 : o.permissions) ?? [], t = {
172
+ action: F.Action.manage,
173
+ subject: F.Subject.Business.menu_menuManagement
174
+ };
175
+ return O([t], r).granted;
176
+ }), U = m(() => {
177
+ var o;
178
+ const r = ((o = y.sessionUser.value) == null ? void 0 : o.permissions) ?? [], t = {
179
+ action: F.Action.manage,
180
+ subject: F.Subject.Business.menu_importExport
181
+ };
182
+ return O([t], r).granted;
183
+ });
184
+ return be().resetOnMount(), (r, t) => {
185
+ const o = w("fm-button");
186
+ return l(), c(ve, {
187
+ heading: e(n)("menu.products.title")
188
+ }, {
189
+ default: _(() => [
190
+ u($e),
191
+ u(ke)
192
+ ]),
193
+ "append-heading": _(() => [
194
+ d("div", Ee, [
195
+ d("div", Te, [
196
+ d("div", Ie, [
197
+ d("p", Ae, Z(b.value), 1)
198
+ ])
199
+ ]),
200
+ d("div", De, [
201
+ ae.value ? (l(), c(G, { key: 1 }, {
202
+ default: _(({ trigger: a }) => [
203
+ u(fe, null, {
204
+ default: _(() => [
205
+ u(q, {
206
+ label: e(n)("menu.products.actions.export"),
207
+ onClick: k
208
+ }, null, 8, ["label"]),
209
+ u(q, {
210
+ label: e(n)("menu.products.actions.import"),
211
+ onClick: a
212
+ }, null, 8, ["label", "onClick"])
213
+ ]),
214
+ _: 2
215
+ }, 1024)
216
+ ]),
217
+ _: 1
218
+ })) : (l(), j(z, { key: 0 }, [
219
+ se.value ? (l(), c(xe, { key: 0 }, {
220
+ default: _(({ trigger: a }) => [
221
+ u(o, {
222
+ label: e(n)("menu.tree_editor.title"),
223
+ "bg-color": e(h).NeutralGray100,
224
+ "text-color": e(h).TypoSecondary,
225
+ variant: e(E).Primary,
226
+ onClick: a
227
+ }, null, 8, ["label", "bg-color", "text-color", "variant", "onClick"])
228
+ ]),
229
+ _: 1
230
+ })) : M("", !0),
231
+ U.value ? (l(), c(o, {
232
+ key: 1,
233
+ "bg-color": e(h).NeutralGray100,
234
+ "text-color": e(h).TypoSecondary,
235
+ variant: e(E).Primary,
236
+ label: e(n)("menu.products.actions.export"),
237
+ onClick: k
238
+ }, null, 8, ["bg-color", "text-color", "variant", "label"])) : M("", !0),
239
+ U.value ? (l(), c(G, { key: 2 }, {
240
+ default: _(({ trigger: a }) => [
241
+ u(o, {
242
+ "bg-color": e(h).NeutralGray100,
243
+ "text-color": e(h).TypoSecondary,
244
+ variant: e(E).Primary,
245
+ label: e(n)("menu.products.actions.import"),
246
+ onClick: a
247
+ }, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])
248
+ ]),
249
+ _: 1
250
+ })) : M("", !0)
251
+ ], 64)),
252
+ b.value > 0 ? (l(), j(z, { key: 2 }, [
253
+ S.value.create ? (l(), c(T, {
254
+ key: 0,
255
+ label: e(n)("menu.products.actions.add"),
256
+ "prepend-icon": "add",
257
+ onClick: t[0] || (t[0] = (a) => e(f).create(null))
258
+ }, null, 8, ["label"])) : i.value ? (l(), c(W, {
259
+ key: 1,
260
+ "categorized-items": e(Y).linkableItems.value,
261
+ "initial-value": e(Y).currentItems.value,
262
+ "show-variant": !1,
263
+ "menu-items": e(A),
264
+ categories: e(D),
265
+ "link-item-rules": e(B),
266
+ "no-scheduler": i.value,
267
+ onSubmit: e(N)
268
+ }, {
269
+ default: _(({ trigger: a }) => [
270
+ u(T, {
271
+ label: e(n)("menu.products.actions.link"),
272
+ "prepend-icon": "link",
273
+ onClick: a
274
+ }, null, 8, ["label", "onClick"])
275
+ ]),
276
+ _: 1
277
+ }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : (l(), c(W, {
278
+ key: 2,
279
+ "categorized-items": e(P).linkableItems.value,
280
+ "initial-value": e(P).currentItems.value,
281
+ "show-variant": !1,
282
+ "menu-items": e(A),
283
+ categories: e(D),
284
+ "link-item-rules": e(B),
285
+ "no-scheduler": i.value,
286
+ onSubmit: e(N)
287
+ }, {
288
+ default: _(({ trigger: a }) => [
289
+ u(T, {
290
+ label: e(n)("menu.products.actions.apply_scheduler"),
291
+ onClick: a
292
+ }, null, 8, ["label", "onClick"])
293
+ ]),
294
+ _: 1
295
+ }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"]))
296
+ ], 64)) : M("", !0)
297
+ ])
298
+ ])
299
+ ]),
300
+ _: 1
301
+ }, 8, ["heading"]);
302
+ };
303
+ }
304
+ });
305
+ export {
306
+ Xe as default
307
+ };